dvadf
/home/homerdlh/public_html/1ef9ad/__pycache__.tar
cgi.cpython-38.opt-2.pyc000064400000043303151450073350010704 0ustar00U

&�.e���@sfdZddlmZmZmZddlmZddlZddlZddl	Z
ddlmZddl
mZddlZddlZddlZddd	d
ddd
dddddgZdadadd�Zdd�Zdd�Zdd�Zeadadejdddfdd	�Zd0d d
�Zd!d"�Zd#d�ZGd$d�d�Z Gd%d�d�Z!ejfd&d�Z"d1d'd
�Z#ejfd(d�Z$d)d�Z%d*d�Z&d+d�Z'd,d�Z(d-d.�Z)e*d/k�rbe"�dS)2z2.6�)�StringIO�BytesIO�
TextIOWrapper)�MappingN)�
FeedParser)�Message�MiniFieldStorage�FieldStorage�parse�parse_multipart�parse_header�test�print_exception�
print_environ�
print_form�print_directory�print_arguments�print_environ_usage�cGsFtr,ts,zttd�aWntk
r*YnXts6tantat|�dS)N�a)�logfile�logfp�open�OSError�nolog�log�dolog�Zallargs�r�/usr/lib64/python3.8/cgi.py�initlog8sr cGst�||d�dS)N�
)r�write)Zfmt�argsrrrr[srcGsdS�Nrrrrrr_srcCsdatrt��datadS)Nr)rr�closer rrrrr�closelogcs
r&c
Cs^|dkrtj}t|d�r |j}nd}t|t�r4|j}d|krDd|d<|ddk�rt|d�\}}|dkrxt|||d�S|d	kr�t	|d
�}t
r�|t
kr�td��|�|��
|�}	nd}	d
|kr�|	r�|	d}	|	|d
}	n*tjdd��r|	r�|	d}	|	tjd}	|	|d
<n<d
|k�r |d
}	n(tjdd��r<tjd}	nd}	|	|d
<tjj|	||||d�S)N�encodingzlatin-1�REQUEST_METHOD�GET�POST�CONTENT_TYPEzmultipart/form-data)�	separator�!application/x-www-form-urlencoded�CONTENT_LENGTH�Maximum content length exceededr�QUERY_STRING�&�)r'r,)�sys�stdin�hasattrr'�
isinstancer�bufferrr�int�maxlen�
ValueError�read�decode�argv�urllibr
Zparse_qs)
�fp�environ�keep_blank_values�strict_parsingr,r'�ctype�pdictZclength�qsrrrr
vsL




��utf-8�replacer1csx|d�d�}d�|�}t�}|�|�z|d|d<Wntk
rLYnXt||||ddi|d���fd	d
��D�S)N�boundary�asciiz multipart/form-data; boundary={}zCONTENT-LENGTHzContent-Lengthr(r*)�headersr'�errorsr@r,csi|]}|��|��qSr)�getlist)�.0�k�Zfsrr�
<dictcomp>�sz#parse_multipart.<locals>.<dictcomp>)r<�formatrZset_type�KeyErrorr	)r?rDr'rKr,rHrCrJrrOrr�s


�ccs�|dd�dkr�|dd�}|�d�}|dkr`|�dd|�|�dd|�dr`|�d|d�}q&|dkrpt|�}|d|�}|��V||d�}qdS)Nr2�;r�"�\"�)�find�count�len�strip)�s�end�frrr�_parseparam�s
(
r^cCs�td|�}|��}i}|D]�}|�d�}|dkr|d|�����}||dd���}t|�dkr�|d|dkr�dkr�nn |dd�}|�dd	��d
d�}|||<q||fS)NrS�=rr2rV���rTz\\�\rU)r^�__next__rWrZ�lowerrYrG)�line�parts�keyrD�p�i�name�valuerrrr�s
,
c@s<eZdZdZdZdZdZiZdZiZ	iZ
dd�Zdd�ZdS)rNcCs||_||_dSr$�rirj��selfrirjrrr�__init__	szMiniFieldStorage.__init__cCsd|j|jfS)NzMiniFieldStorage(%r, %r)rk�rmrrr�__repr__szMiniFieldStorage.__repr__)
�__name__�
__module__�__qualname__�filename�list�type�file�type_options�disposition�disposition_optionsrJrnrprrrrr�sc@s�eZdZdddejdddddddfdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zd9dd�Z
d:dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdZd&d'�Zd(d)�Zd*Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�ZdS);r	N�rrFrGcCsZd}||_||_|
|_||_d|kr0|d��}d|_|dksF|dkr�d|krX|d}
ntjdd�rrtjd}
nd}
|
�t	�
�d�}
t|
�}|dkr�dd	i}|dkr�i}|d
kr�d	|d<d|kr�|d|d<d|kr�|d|_d|kr�|d|d
<nt|t
tf��std��||_|dk�r*tjj|_n<t|t��r@|j|_n&t|d��rXt|d��s`td��||_||_|	|_t|t��s�tdt|�j��||_d|_||_di}}d|jk�r�t|jd�\}}||_||_ d|_!d|k�r�|d|_!d|_"d|k�r
|d|_"|j"dk	|_#d|jk�r6t|jd�\}}n(|j�sH|d
k�rTdi}}n
d	i}}||_||_$d|k�r�|d�|j|j�|_%nd|_%d}d
|jk�r�zt&|jd
�}Wnt'k
�r�YnXt(�r�|t(k�r�t'd��||_)|jdk�r|dk�r||_d|_*|_+d|_,|d	k�r,|�-�n*|dd�dk�rN|�.|||�n|�/�dS)Nr)r(ZHEADr0r2r�surrogateescapezcontent-typer-r*r+r.�content-lengthz?headers must be mapping or an instance of email.message.Messager;�readlinezfp must be file pointerz#outerboundary must be bytes, not %srzcontent-dispositionrirtz
text/plainrHr{r`r/�
z
multipart/)0rArB�max_num_fieldsr,�upper�
qs_on_postr3r=�encode�localeZgetpreferredencodingrr6rr�	TypeErrorrJr4r7r?rr5r'rK�bytesrvrq�
outerboundary�
bytes_read�limitrryrzrirt�_binary_filerx�
innerboundaryr8r:r9�lengthrurw�done�read_urlencoded�
read_multi�read_single)rmr?rJr�r@rArBr�r'rKr�r,�methodrEZcdisprDrCZclenrrrrn?s�/
�


�






�

zFieldStorage.__init__cCs(z|j��Wntk
r"YnXdSr$)rwr%�AttributeErrorrorrr�__del__�szFieldStorage.__del__cCs|Sr$rrorrr�	__enter__�szFieldStorage.__enter__cGs|j��dSr$)rwr%)rmr#rrr�__exit__�szFieldStorage.__exit__cCsd|j|j|jfS)NzFieldStorage(%r, %r, %r))rirtrjrorrrrp�s
�zFieldStorage.__repr__cCst|���Sr$)�iter�keysrorrr�__iter__�szFieldStorage.__iter__cCsT|dkrt|��|jr:|j�d�|j��}|j�d�n|jdk	rL|j}nd}|S)Nrjr)r�rw�seekr;rurlrrr�__getattr__�s

zFieldStorage.__getattr__cCs^|jdkrtd��g}|jD]}|j|kr|�|�q|sBt|��t|�dkrV|dS|SdS)N�
not indexabler2r)rur�ri�appendrRrY)rmrf�found�itemrrr�__getitem__s


zFieldStorage.__getitem__cCs8||kr0||}t|t�r(dd�|D�S|jSn|SdS)NcSsg|]
}|j�qSr�rj�rM�xrrr�
<listcomp>sz)FieldStorage.getvalue.<locals>.<listcomp>�r6rurj�rmrf�defaultrjrrr�getvalues
zFieldStorage.getvaluecCs4||kr,||}t|t�r$|djS|jSn|SdS�Nrr�r�rrr�getfirsts

zFieldStorage.getfirstcCs:||kr2||}t|t�r(dd�|D�S|jgSngSdS)NcSsg|]
}|j�qSrr�r�rrrr�.sz(FieldStorage.getlist.<locals>.<listcomp>r�)rmrfrjrrrrL)s

zFieldStorage.getlistcCs*|jdkrtd��ttdd�|jD���S)Nr�css|]}|jVqdSr$�ri�rMr�rrr�	<genexpr>8sz$FieldStorage.keys.<locals>.<genexpr>)rur��setrorrrr�4s
zFieldStorage.keyscs*|jdkrtd��t�fdd�|jD��S)Nr�c3s|]}|j�kVqdSr$r�r��rfrrr�>sz,FieldStorage.__contains__.<locals>.<genexpr>)rur��any)rmrfrr�r�__contains__:s
zFieldStorage.__contains__cCst|���Sr$)rYr�rorrr�__len__@szFieldStorage.__len__cCs|jdkrtd��t|j�S)NzCannot be converted to bool.)rur��boolrorrr�__bool__Ds
zFieldStorage.__bool__c	Cs�|j�|j�}t|t�s0td|jt|�jf��|�|j	|j
�}|jrT|d|j7}tj
j||j|j|j	|j
|j|jd�}dd�|D�|_|��dS)N�%s should return bytes, got %sr1�r'rKr�r,cSsg|]\}}t||��qSr�r�rMrfrjrrrr�Vsz0FieldStorage.read_urlencoded.<locals>.<listcomp>)r?r;r�r6r�r:rvrqr<r'rKr�r>r
�	parse_qslrArBr�r,ru�
skip_lines)rmrE�queryrrrr�Is&
��zFieldStorage.read_urlencodedcCsL|j}t|�std|f��g|_|jrftjj|j|j|j	|j
|j|j|j
d�}|j�dd�|D��|jpp|j}|j��}t|t�s�td|jt|�jf��|jt|�7_|��d|jkr�|r�|j��}|jt|�7_q�|j}|dk	�r|t|j�8}t�}	d}
|j��}|
|7}
|���s�q0�q|
�s:�q@|jt|
�7_|	�|
�|j
|j��|	��}d|k�rz|d=|jdk�r�dn
|j|j}
||j||||||
|j
|j||j
�}|dk	�r�|d	8}|j�r�|t|j�8}|d
k�r�td��|j|j7_|j�|�|j �s@|j|j!k�r4d
k�rnn�q@�q|�"�dS)Nz&Invalid boundary in multipart form: %rr�css|]\}}t||�VqdSr$r�r�rrrr�fsz*FieldStorage.read_multi.<locals>.<genexpr>r��--r{r}r2rzMax number of fields exceeded)#r��valid_boundaryr:rur�r>r
r�rArBr'rKr�r,�extend�FieldStorageClass�	__class__r?r~r6r�rvrqr�rYrZrZfeedr<r%r�r�r�r�r�)rmr@rArBZibr��klassZ
first_liner��parserZhdr_text�datarJr��partrrrr�[s��

��





��

(zFieldStorage.read_multicCs4|jdkr|��|��n|��|j�d�dSr�)r��read_binaryr��
read_linesrwr�rorrrr��s


zFieldStorage.read_singlei cCs�|��|_|j}|dkr�|dkr�|j�t||j��}t|t�sVt	d|jt
|�jf��|jt
|�7_|std|_q�|j�|�|t
|�}qdS)Nrr�r`)�	make_filerwr�r?r;�min�bufsizer6r�r:rvrqr�rYr�r")rmZtodor�rrrr��s

�zFieldStorage.read_binarycCs@|jrt�|_|_nt�|_|_|jr4|��n|��dSr$)r�rrw�_FieldStorage__filerr��read_lines_to_outerboundary�read_lines_to_eofrorrrr��s
zFieldStorage.read_linescCsv|jdk	rF|j��t|�dkrF|��|_|j��}|j�|�d|_|jrZ|j�|�n|j�|�|j	|j
��dS)Ni�)r��tellrYr�rwr�r"r�r<r'rK)rmrdr�rrrZ__write�s


zFieldStorage.__writecCs:|j�d�}|jt|�7_|s*d|_q6|�|�qdS)N�r`)r?r~r�rYr��_FieldStorage__write)rmrdrrrr��szFieldStorage.read_lines_to_eofc	CsJd|j}|d}d}d}d}|jdk	rFd|jkr>|krFnn�qF|j�d�}|jt|�7_|t|�7}|s~d|_�qF|dkr�||}d}|�d�r�|r�|��}||kr��qF||kr�d|_�qF|}|�	d	�r�d	}|dd
�}d}nL|�	d��rd}|dd�}d}n*|�	d��r.d}|dd�}d}nd}d}|�
||�qdS)
Nr�r{Trr�r`�
r2s
����
F)r�r�r?r~r�rYr��
startswith�rstrip�endswithr�)	rm�
next_boundary�
last_boundaryZdelim�last_line_lfendZ_readrd�strippedlineZodelimrrrr��sN
$
z(FieldStorage.read_lines_to_outerboundarycCs�|jr|jrdSd|j}|d}d}|j�d�}|jt|�7_|sPd|_q�|�d�r�|r�|��}||krpq�||kr�d|_q�|�d�}q&dS)Nr�Tr�r`r2r�)r�r�r?r~r�rYr�rZ)rmr�r�r�rdr�rrrr�s$
zFieldStorage.skip_linescCs&|jrt�d�Stjd|jdd�SdS)Nzwb+zw+r!)r'�newline)r��tempfileZ
TemporaryFiler'rorrrr�(s
�zFieldStorage.make_file)N)N) rqrrrs�osr@rnr�r�r�rpr�r�r�r�r�rLr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	sJ+�
&


E	
2cCs�td�t�tjt_zNt�}t�t�t|�t|�t	�dd�}|fdd�}td�|�Wnt
�YnXtd�daz&t�}t�t�t|�t|�Wnt
�YnXdS)	NzContent-type: text/htmlcSstd�dS)Nz,testing print_exception() -- <I>italics?</I>)�execrrrrr][sztest.<locals>.fcSs
|�dSr$r)r]rrr�g]sztest.<locals>.gz9<H3>What follows is a test, not an actual exception:</H3>z*<H1>Second try with a small maxlen...</H1>�2)�printr3�stdout�stderrr	rrrrrrr9)r@�formr]r�rrrr
Js4
c	Csx|dkrt��\}}}ddl}t�td�|�||�|�||�}tdt�d�|dd���t�|d�f�~dS)Nrz+<H3>Traceback (most recent call last):</H3>z<PRE>%s<B>%s</B></PRE>rr`)	r3�exc_info�	tracebackr��	format_tb�format_exception_only�html�escape�join)rvrj�tbr�r�rurrrrqs

��c	Cs\t|���}t�td�td�|D]"}tdt�|�dt�||��q&td�t�dS)Nz<H3>Shell Environment:</H3>�<DL>�<DT>�<DD>�</DL>)�sortedr�r�r�r�)r@r�rfrrrrs cCs�t|���}t�td�|s&td�td�|D]Z}tdt�|�ddd�||}tdt�tt|���d	�td
t�t|���q2td�t�dS)Nz<H3>Form Contents:</H3>z<P>No form fields.r�r��:� )r\z<i>z</i>r�r�)r�r�r�r�r��reprrv)r�r�rfrjrrrr�sc
Csjt�td�zt��}Wn6tk
rP}ztdt�t|���W5d}~XYnXtt�|��t�dS)Nz#<H3>Current Working Directory:</H3>zOSError:)r�r��getcwdrr�r��str)�pwd�msgrrrr�s&cCs(t�td�t�ttj�t�dS)Nz <H3>Command Line Arguments:</H3>)r�r3r=rrrrr�s

cCstd�dS)Na�
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
)r�rrrrr�scCs(ddl}t|t�rd}nd}|�||�S)Nrs^[ -~]{0,200}[!-~]$z^[ -~]{0,200}[!-~]$)�rer6r��match)r[r�Z_vb_patternrrrr��s

r��__main__)rFrGr1)NNNN)+�__version__�iorrrZcollections.abcrr3r�Zurllib.parser>Zemail.parserrZ
email.messagerr�r�r��__all__rrr rrr&rr9r@r
rr^rrr	r
rrrrrrr�rqrrrr�<module>sf�#	�
F
:'
/
codeop.cpython-38.opt-1.pyc000064400000014423151450073350011413 0ustar00U

e5d��@sldZddlZddlZdd�ejD�ZdddgZdZd	d
�Zdd�Zddd�Z	Gdd�d�Z
Gdd�d�ZdS)a[Utilities to compile possibly incomplete Python source code.

This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:

- Return code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).

Approach:

First, check if the source consists entirely of blank lines and
comments; if so, replace it with 'pass', because the built-in
parser doesn't always do the right thing for these.

Compile three times: as is, with \n, and with \n\n appended.  If it
compiles as is, it's complete.  If it compiles with one \n appended,
we expect more.  If it doesn't compile either way, we compare the
error we get when compiling with \n or \n\n appended.  If the errors
are the same, the code is broken.  But if the errors are different, we
expect more.  Not intuitive; not even guaranteed to hold in future
releases; but this matches the compiler's behavior from Python 1.4
through 2.2, at least.

Caveat:

It is possible (but not likely) that the parser stops parsing with a
successful outcome before reaching the end of the source; in this
case, trailing symbols may be ignored instead of causing an error.
For example, a backslash followed by two newlines may be followed by
arbitrary garbage.  This will be fixed once the API for the parser is
better.

The two interfaces are:

compile_command(source, filename, symbol):

    Compiles a single command in the manner described above.

CommandCompiler():

    Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.

The module also provides another class:

Compile():

    Instances of this class act like the built-in function compile,
    but with 'memory' in the sense described above.
�NcCsg|]}tt|��qS�)�getattr�
__future__)�.0Zfnamerr�/usr/lib64/python3.8/codeop.py�
<listcomp>>s�r�compile_command�Compile�CommandCompilericCsZ|�d�D] }|��}|r
|ddkr
q8q
|dkr8d}d}}}d}}	}
z||||�}Wn"tk
r�}zW5d}~XYnXt����t�d�z||d||�}	Wn&tk
r�}z|}W5d}~XYnXz||d||�}
Wn(tk
�r}z|}W5d}~XYnXW5QRXz.|�r,|W�"S|	�sHt|�t|�k�rH|�W5d}}XdS)N�
r�#�eval�pass�errorz

)�split�strip�SyntaxError�warnings�catch_warnings�simplefilter�repr)�compiler�source�filename�symbol�line�errZerr1Zerr2�code�code1�code2�errr�_maybe_compileEs8

 r!cCst|||t�S�N)�compile�PyCF_DONT_IMPLY_DEDENT�rrrrrr�_compilensr&�<input>�singlecCstt|||�S)a�Compile a command and determine whether it is incomplete.

    Arguments:

    source -- the source string; may contain \n characters
    filename -- optional filename from which source was read; default
                "<input>"
    symbol -- optional grammar start symbol; "single" (default), "exec"
              or "eval"

    Return value / exceptions raised:

    - Return a code object if the command is complete and valid
    - Return None if the command is incomplete
    - Raise SyntaxError, ValueError or OverflowError if the command is a
      syntax error (OverflowError and ValueError can be produced by
      malformed literals).
    )r!r&r%rrrrqsc@s eZdZdZdd�Zdd�ZdS)r	z�Instances of this class behave much like the built-in compile
    function, but if one is used to compile text containing a future
    statement, it "remembers" and compiles all subsequent program texts
    with the statement in force.cCs
t|_dSr")r$�flags��selfrrr�__init__�szCompile.__init__cCs<t||||jd�}tD] }|j|j@r|j|jO_q|S)N�)r#r)�	_features�co_flagsZ
compiler_flag)r+rrrZcodeobZfeaturerrr�__call__�s
zCompile.__call__N��__name__�
__module__�__qualname__�__doc__r,r0rrrrr	�sc@s"eZdZdZdd�Zd	dd�ZdS)
r
a(Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.cCst�|_dSr")r	rr*rrrr,�szCommandCompiler.__init__r'r(cCst|j|||�S)a�Compile a command and determine whether it is incomplete.

        Arguments:

        source -- the source string; may contain \n characters
        filename -- optional filename from which source was read;
                    default "<input>"
        symbol -- optional grammar start symbol; "single" (default) or
                  "eval"

        Return value / exceptions raised:

        - Return a code object if the command is complete and valid
        - Return None if the command is incomplete
        - Raise SyntaxError, ValueError or OverflowError if the command is a
          syntax error (OverflowError and ValueError can be produced by
          malformed literals).
        )r!r)r+rrrrrrr0�szCommandCompiler.__call__N)r'r(r1rrrrr
�s)r'r()r5rrZall_feature_namesr.�__all__r$r!r&rr	r
rrrr�<module>s:�
)
zipapp.cpython-38.opt-2.pyc000064400000011110151450073350011434 0ustar00U

e5do�@s�ddlZddlZddlZddlZddlZddlZddlZdddgZdZej	�
d�rXdZne��ZGdd�de
�Zejd	d
��Zdd�Zdd
d�Zddd�Zdd�Zddd�Zedkr�e�dS)�N�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�win�utf-8c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/zipapp.pyr!sc	cs8t|ttjf�r.t||��}|VW5QRXn|VdS�N)�
isinstance�str�os�PathLike�open)�archive�mode�fr
r
r�_maybe_open%srcCs$|r d|�t�d}|�|�dS)N�#!�
)�encode�shebang_encoding�write)r�interpreterZshebangr
r
r�_write_file_prefix.src
Cs�t|d��Z}|�d�}|dkr*d}|��t|d��&}t||�|�|�t�||�W5QRXW5QRX|r�t|t�r�t	�
|t	�|�jtj
B�dS)N�rb�r��wb)r�read�readlinerr�shutilZcopyfileobjr
rr�chmod�stat�st_mode�S_IEXEC)rZnew_archiver�srcZfirst_2Zdstr
r
r�
_copy_archive5s


 r)Fc
Cs�d}t|d�rt|d�rd}nt�|�}|��r4d}|rHt|||�dS|��sXtd��|d��}|rt|rttd��|s�|s�td��d}|r�|�d	�\}	}
}td
d�|	�	d�D��}td
d�|�	d�D��}
|
d	kr�|r�|
s�td|��t
j|	|d�}|dk�r|�d�}nt|d��s"t�|�}t
|d���}t||�|�rDtjntj}tj|d|d��^}|�d�D]4}|�|�}|dk�s�||��rf|�||����qf|�r�|�d|�d��W5QRXW5QRX|�r�t|d��s�|�|��jtjB�dS)NFr!r"TzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry point�:css|]}|��VqdSr��isidentifier��.0�partr
r
r�	<genexpr>{sz!create_archive.<locals>.<genexpr>�.css|]}|��VqdSrr+r-r
r
rr0|szInvalid entry point: )�module�fnz.pyzrr �w)�compression�*r)�hasattr�pathlib�Path�is_filer)�existsr�	partition�all�split�
MAIN_TEMPLATE�formatZwith_suffixrr�zipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglob�relative_torZas_posixZwritestrrr$r%r&r')�source�targetr�main�filter�
compressedZsource_is_fileZhas_mainZmain_py�mod�sepr3Zmod_okZfn_ok�fdr5�zZchildZarcnamer
r
rrLsX
�


�
&c
CsFt|d��2}|�d�dkr8|�����t�W5QR�SW5QRXdS)Nrrr)rr!r"�strip�decoder)rrr
r
rr�scCs<ddl}|��}|jddddd�|jddddd�|jd	d
ddd�|jdd
ddd�|jddddd�|jddd�|�|�}|jr�tj�|j�s�t	d��t
|j�}td�|p�d��t
�d�tj�|j��r|jdk�stj�|j��rtj�|j|j��rt	d��|j�rt	d��t|j|j|j|j|jd�dS)Nrz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)�default�helpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-c�
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)�actionrOz--infoFz)Display the interpreter from the archive.)rNrQrOrCz'Source directory (or existing archive).)rOz%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)rrErG)�argparse�ArgumentParser�add_argument�
parse_args�infor�path�isfilerC�
SystemExitr�printr@�sys�exit�outputr;�samefilerEr�python�compress)�argsrR�parserrr
r
rrE�sN
�
�
�
�
��


�
�rE�__main__)N)NNNNF)N)�
contextlibrr8r#r%r[rA�__all__r?�platform�
startswithr�getfilesystemencoding�
ValueErrorr�contextmanagerrrr)rrrErr
r
r
r�<module>s0



�
J
1bdb.cpython-38.opt-2.pyc000064400000037015151450073350010674 0ustar00U

e5d8}�@s�ddlZddlZddlZddlmZmZmZdddgZeeBeBZGdd�de	�Z
Gdd�d�Zdd	�ZGd
d�d�Z
dd�Zd
d�ZGdd�de�Zdd�Zdd�Zdd�ZdS)�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�
Breakpointc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/bdb.pyr
sc@sreZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd[d%d&�Zd\d'd(�Zd)d*�Zd+d,�Zd-d.�Zd]d/d0�Zd1d2�Zd3d4�Zd^d6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dLdM�Z'd_dOdP�Z(d`dQdR�Z)dadSdT�Z*dUdV�Z+dWdX�Z,dYe,_-dS)brNcCs(|rt|�nd|_i|_i|_d|_dS�N)�set�skip�breaks�fncache�frame_returning)�selfrrrr�__init__szBdb.__init__cCsR|d|dd�dkr|S|j�|�}|sNtj�|�}tj�|�}||j|<|S)N�<�����>)r�get�os�path�abspath�normcase)r�filename�canonicrrrr%s
zBdb.canoniccCs&ddl}|��d|_|�dd�dS)Nr)�	linecache�
checkcache�botframe�
_set_stopinfo)rr rrr�reset6sz	Bdb.resetcCs�|jr
dS|dkr|�|�S|dkr0|�||�S|dkrD|�||�S|dkrX|�||�S|dkrf|jS|dkrt|jS|dkr�|jStdt|��|jS)	N�lineZcall�returnZ	exceptionZc_callZc_exceptionZc_returnz*bdb.Bdb.dispatch: unknown debugging event:)�quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exception�trace_dispatch�print�repr)r�frameZevent�argrrrr,=s$
zBdb.trace_dispatchcCs.|�|�s|�|�r(|�|�|jr(t�|jSr
)�	stop_here�
break_here�	user_liner'rr,�rr/rrrr(hs

zBdb.dispatch_linecCsd|jdkr|j|_|jS|�|�s0|�|�s0dS|jrH|jjt@rH|jS|�	||�|j
r^t�|jSr
)r"�f_backr,r1�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr'r�rr/r0rrrr)ts
zBdb.dispatch_callcCs||�|�s||jkrv|jr,|jjt@r,|jSz||_|�||�W5d|_X|j	rVt
�|j|krv|jdkrv|�dd�|jS�Nr)
r1�returnframer7r8r9r:r,r�user_returnr'r�
stoplinenor#r<rrrr*�szBdb.dispatch_returncCs�|�|�rF|jjt@r.|dtkr.|ddks�|�||�|jr�t�nD|jr�||jk	r�|jjjt@r�|dtt	fkr�|�||�|jr�t�|j
S)Nr�)r1r8r9r:�
StopIteration�user_exceptionr'rr7�
GeneratorExitr,r<rrrr+�s$

�
���zBdb.dispatch_exceptioncCs.|dkrdS|jD]}t�||�rdSqdS�NFT)r�fnmatch)rZmodule_name�patternrrr�is_skipped_module�s
zBdb.is_skipped_modulecCsN|jr|�|j�d��rdS||jkr@|jdkr4dS|j|jkS|jsJdSdS)NrFrT)rrH�	f_globalsrr7r@�f_linenor4rrrr1�s�

z
Bdb.stop_herecCs�|�|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j	r�|�
t|j��dSdSdSrE)rr8�co_filenamerrJ�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr/r�lineno�bp�flagrrrr2�s

zBdb.break_herecCstd��dS)Nz)subclass of bdb must implement do_clear())�NotImplementedError)rr0rrrrP�szBdb.do_clearcCs|�|jj�|jkSr
)rr8rKrr4rrrr6�szBdb.break_anywherecCsdSr
r)rr/Z
argument_listrrrr;sz
Bdb.user_callcCsdSr
rr4rrrr3sz
Bdb.user_linecCsdSr
r)rr/Zreturn_valuerrrr?	szBdb.user_returncCsdSr
r)rr/�exc_inforrrrC
szBdb.user_exceptionrcCs||_||_d|_||_dS�NF)r7r>r'r@)rr7r>r@rrrr#szBdb._set_stopinfocCs$|dkr|jd}|�|||�dS)Nr)rJr#)rr/rRrrr�	set_until"s
z
Bdb.set_untilcCs0|jr |jj}|r |js |j|_|�dd�dSr
)rr5�f_tracer,r#)rZcaller_framerrr�set_step*s

zBdb.set_stepcCs|�|d�dSr
)r#r4rrr�set_next6szBdb.set_nextcCs.|jjt@r|�|dd�n|�|j|�dSr=)r8r9r:r#r5r4rrr�
set_return:szBdb.set_returncCsL|dkrt��j}|��|r4|j|_||_|j}q|��t�|j�dSr
)	�sys�	_getframer5r$r,rYr"rZ�settracer4rrr�	set_traceAs
z
Bdb.set_tracecCsH|�|jdd�|jsDt�d�t��j}|rD||jk	rD|`|j}q*dSr=)r#r"rr]r_r^r5rYr4rrr�set_continuePs

zBdb.set_continuecCs"|j|_d|_d|_t�d�dS�NT)r"r7r>r'r]r_�rrrr�set_quit_szBdb.set_quitFc
Csb|�|�}ddl}|�||�}|s.d||fS|j�|g�}||krN|�|�t|||||�}	dS)NrzLine %s:%d does not exist)rr �getliner�
setdefault�appendr)
rrrRrO�cond�funcnamer r%�listrSrrr�	set_breakps

z
Bdb.set_breakcCs4||ftjkr|j|�|�|j|s0|j|=dSr
)r�bplistr�remove�rrrRrrr�
_prune_breaks�s
zBdb._prune_breakscCsj|�|�}||jkrd|S||j|kr6d||fStj||fdd�D]}|��qL|�||�dS)N�There are no breakpoints in %szThere is no breakpoint at %s:%d)rrrrl�deleteMero)rrrRrSrrr�clear_break�s


zBdb.clear_breakc
CsZz|�|�}Wn.tk
r<}zt|�WY�Sd}~XYnX|��|�|j|j�dSr
)�get_bpbynumber�
ValueErrorrQrqro�filer%)rr0rS�errrrr�clear_bpbynumber�szBdb.clear_bpbynumbercCsX|�|�}||jkrd|S|j|D]$}tj||f}|D]}|��q<q&|j|=dS)Nrp)rrrrlrq)rrr%ZblistrSrrr�clear_all_file_breaks�s

zBdb.clear_all_file_breakscCs,|js
dStjD]}|r|��qi|_dS)NzThere are no breakpoints)rr�
bpbynumberrq)rrSrrr�clear_all_breaks�s

zBdb.clear_all_breakscCs�|std��zt|�}Wn"tk
r:td|�d�YnXztj|}Wn"tk
rltd|�d�YnX|dkr�td|��|S)NzBreakpoint number expectedz Non-numeric breakpoint number %sz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rt�intrry�
IndexError)rr0rNrSrrrrs�szBdb.get_bpbynumbercCs"|�|�}||jko ||j|kSr
�rrrnrrr�	get_break�s

�z
Bdb.get_breakcCs4|�|�}||jkr0||j|kr0tj||fp2gSr
)rrrrlrnrrr�
get_breaks�s

���zBdb.get_breakscCs&|�|�}||jkr|j|SgSdSr
r})rrrrr�get_file_breaks�s


zBdb.get_file_breakscCs|jSr
)rrcrrr�get_all_breaks�szBdb.get_all_breakscCs�g}|r|j|kr|j}|dk	rD|�||jf�||jkr<qD|j}q|��tdt|�d�}|dk	r�|�|j|j	f�|j}q^|dkr�tdt|�d�}||fS)Nrr)
�tb_frame�tb_nextrgrJr"r5�reverse�max�len�	tb_lineno)r�f�t�stack�irrr�	get_stack�s 
z
Bdb.get_stack�: cCs�ddl}ddl}|\}}|�|jj�}d||f}|jjrH||jj7}n|d7}|d7}d|jkr�|jd}	|d7}||�|	�7}|�|||j	�}
|
r�|||
�
�7}|S)Nrz%s(%r)z<lambda>z()Z
__return__z->)r �reprlibrr8rK�co_name�f_localsr.rerI�strip)rZframe_linenoZlprefixr r�r/rRr�s�rvr%rrr�format_stack_entrys 	

zBdb.format_stack_entryc	Cs�|dkrddl}|j}|dkr"|}|��t|t�r@t|dd�}t�|j�z*zt
|||�Wntk
rrYnXW5d|_	t�d�XdS)Nrz<string>�execT)�__main__�__dict__r$�
isinstancerQ�compiler]r_r,r'r�r)r�cmd�globals�localsr�rrr�run5s

zBdb.runc	Csz|dkrddl}|j}|dkr"|}|��t�|j�z,zt|||�WW�Stk
r^YnXW5d|_t�d�XdS)NrT)	r�r�r$r]r_r,r'�evalr)r�exprr�r�r�rrr�runevalKs
zBdb.runevalcCs|�|||�dSr
)r�)rr�r�r�rrr�runctx_sz
Bdb.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��t�|j	�d}z(z|||�}Wntk
r�YnXW5d	|_
t�d�X|S)
NrAz6descriptor 'runcall' of 'Bdb' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %drT)r��	TypeError�pop�warnings�warn�DeprecationWarningr$r]r_r,r'r)�args�kwdsrr�r��resrrr�runcallfs2

�
�
zBdb.runcallz($self, func, /, *args, **kwds))N)r)N)N)FNN)r�)NN)NN).rr	r
rrr$r,r(r)r*r+rHr1r2rPr6r;r3r?rCr#rXrZr[r\r`rardrkrorrrwrxrzrsr~rr�r�r�r�r�r�r�r��__text_signature__rrrrrsZ
+	


�







cCst���dSr
)rr`rrrrr`�sr`c@sVeZdZdZiZdgZddd�Zdd�Zdd	�Zd
d�Z	ddd
�Z
dd�Zdd�ZdS)rrNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|j�
|�||f|jkr||j||f�
|�n|g|j||f<dS)NTrr)ri�func_first_executable_linerur%rOrh�enabled�ignore�hitsr�nextrNryrgrl)rrur%rOrhrirrrr�szBreakpoint.__init__cCs>|j|jf}d|j|j<|j|�|�|j|s:|j|=dSr
)rur%ryrNrlrm)r�indexrrrrq�s

zBreakpoint.deleteMecCs
d|_dSrb�r�rcrrr�enable�szBreakpoint.enablecCs
d|_dSrWr�rcrrr�disable�szBreakpoint.disablecCs"|dkrtj}t|��|d�dS)N)ru)r]�stdoutr-�bpformat)r�outrrr�bpprint�szBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d	}nd
}|d|j|f7}|S)Nzdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz
	stop only if %sz
	ignore next %d hitsrr��z"
	breakpoint already hit %d time%s)rOr�rNrur%rhr�r�)rZdispZretZssrrrr��s(
�
zBreakpoint.bpformatcCsd|j|j|jfS)Nzbreakpoint %s at %s:%s)rNrur%rcrrr�__str__�szBreakpoint.__str__)FNN)N)
rr	r
r�rlryrrqr�r�r�r�r�rrrrr�s


cCsN|js|j|jkrdSdS|jj|jkr,dS|js:|j|_|j|jkrJdSdSrE)rir%rJr8r�r�)�br/rrr�
checkfuncnamesr�cCs�tj||f}|D]�}|jsqt||�s*q|jd7_|jsh|jdkrZ|jd8_qq�|dfSqzBt|j|j|j	�}|r�|jdkr�|jd8_n|dfWSWq|dfYSXqdS)NrrTF)NN)
rrlr�r�r�rhr�r�rIr�)rur%r/Z	possiblesr��valrrrrM#s*


rMc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)N�???z+++ call)r8r�r-)rr/r��namerrrr;Tsz
Tdb.user_callcCsTddl}|jj}|sd}|�|jj�}|�||j|j�}td||j|d|�	��dS)Nrr�z+++�:)
r r8r�rrKrerJrIr-r�)rr/r r��fnr%rrrr3Xsz
Tdb.user_linecCstd|�dS)Nz
+++ return�r-)rr/Zretvalrrrr?_szTdb.user_returncCstd|�|��dS)Nz
+++ exception)r-ra)rr/Z	exc_stuffrrrrCas
zTdb.user_exceptionN)rr	r
r;r3r?rCrrrrr�Ssr�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r-�bar)�n�xrrr�fooesr�cCstd|d�|dS)Nzbar(r�rAr�)�arrrr�jsr�cCst�}|�d�dS)Nzimport bdb; bdb.foo(10))r�r�)r�rrr�testnsr�)rFr]r�inspectrrr�__all__r:�	Exceptionrrr`rr�rMr�r�r�r�rrrr�<module>s&
{t"0copy.cpython-38.pyc000064400000015515151450073350010160 0ustar00U

e5d�!�@sTdZddlZddlZddlmZGdd�de�ZeZzddlm	Z	Wne
k
r\dZ	YnXdddgZd	d�ZiZ
Zd
d�Zed�eeeeeeeeeeeeejee�ee�ejej fD]Z!eee!<q�e"edd�Z!e!dk	r�eee!<e#jee#<e$jee$<e%jee%<e&jee&<e	dk	�r e	jee	<[[!dgfd
d�Z'iZ(Zdd�Z)e)eed�<e)eee�<e)eee�<e)ee<e)ee<e)ee<e)ee<e)ee<e)ee<e)eej*<e)ee<e)eej<e)eej<e)eej <e)ee<e'fdd�Z+e+ee#<e'fdd�Z,e,ee<e'fdd�Z-e-ee$<e	dk	�re-ee	<dd�Z.e.eej/<[dd�Z0ddde'fdd�Z1[[[	dS)a�Generic (shallow and deep) copying operations.

Interface summary:

        import copy

        x = copy.copy(y)        # make a shallow copy of y
        x = copy.deepcopy(y)    # make a deep copy of y

For module specific errors, copy.Error is raised.

The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).

- A shallow copy constructs a new compound object and then (to the
  extent possible) inserts *the same objects* into it that the
  original contains.

- A deep copy constructs a new compound object and then, recursively,
  inserts *copies* into it of the objects found in the original.

Two problems often exist with deep copy operations that don't exist
with shallow copy operations:

 a) recursive objects (compound objects that, directly or indirectly,
    contain a reference to themselves) may cause a recursive loop

 b) because deep copy copies *everything* it may copy too much, e.g.
    administrative data structures that should be shared even between
    copies

Python's deep copy operation avoids these problems by:

 a) keeping a table of objects already copied during the current
    copying pass

 b) letting user-defined classes override the copying operation or the
    set of components copied

This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor array, nor
any similar types.

Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called __getinitargs__(),
__getstate__() and __setstate__().  See the documentation for module
"pickle" for information on these methods.
�N)�dispatch_tablec@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/copy.pyr7sr)�PyStringMap�copy�deepcopycCs�t|�}t�|�}|r||�St|t�r0t|�St|dd�}|dk	rL||�St�|�}|dk	rh||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t|t	�r�|St
|df|��S)zlShallow copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    �__copy__N�
__reduce_ex__��
__reduce__z%un(shallow)copyable object of type %s)�type�_copy_dispatch�get�
issubclass�_copy_immutable�getattrrr�
isinstance�str�_reconstruct)�x�cls�copier�reductor�rvrrrr
Bs,





cCs|S�Nr)rrrrrksr�CodeTypec	Cs |dkri}t|�}|�||�}||k	r,|St|�}t�|�}|dk	rR|||�}n�t|t�rht||�}n�t|dd�}|dk	r�||�}nzt�|�}|r�||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t	|t
�r�|}nt||f|��}||k	�r|||<t||�|S)ziDeep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    N�__deepcopy__r
rrz"un(deep)copyable object of type %s)
�idrr�_deepcopy_dispatchr�_deepcopy_atomicrrrrrr�_keep_alive)	r�memoZ_nil�d�yrrrrrrrr�sD





�


cCs|Srr�rr%rrrr#�sr#cCs2g}||t|�<|j}|D]}||||��q|Sr)r!�append)rr%rr'r)�arrr�_deepcopy_list�sr+csh��fdd�|D�}z�t|�WStk
r6YnXt||�D]\}}||k	rBt|�}qdqB|}|S)Ncsg|]}�|���qSrr)�.0r*�rr%rr�
<listcomp>�sz#_deepcopy_tuple.<locals>.<listcomp>)r!�KeyError�zip�tuple)rr%rr'�k�jrr-r�_deepcopy_tuple�sr4cCs:i}||t|�<|��D]\}}|||�||||�<q|Sr)r!�items)rr%rr'�key�valuerrr�_deepcopy_dict�s
r8cCst|�|jt|j|��Sr)r�__func__r�__self__r(rrr�_deepcopy_method�sr;cCs>z|t|��|�Wn"tk
r8|g|t|�<YnXdS)aMKeeps a reference to the object x in the memo.

    Because we remember objects by their id, we have
    to assure that possibly temporary objects are kept
    alive by referencing them.
    We store a reference at the id of the memo, which should
    normally not be used unless someone tries to deepcopy
    the memo itself...
    N)r!r)r/r(rrrr$�s
r$csb�dk	}|r$|r$��fdd�|D�}||�}	|r<|	�t|�<|dk	r�|rR�|��}t|	d�rh|	�|�n^t|t�r�t|�dkr�|\}}
nd}
|dk	r�|	j�|�|
dk	r�|
��D]\}}t	|	||�q�|dk	�r|r�|D]}
�|
��}
|	�
|
�q�n|D]}
|	�
|
�q�|dk	�r^|�rF|D]&\}}�|��}�|��}||	|<�qn|D]\}}||	|<�qJ|	S)Nc3s|]}�|��VqdSrr)r,�argr-rr�	<genexpr>sz_reconstruct.<locals>.<genexpr>�__setstate__�)r!�hasattrr>rr1�len�__dict__�updater5�setattrr))rr%�func�args�stateZlistiterZdictiterrZdeepr'Z	slotstater6r7�itemrr-rrsF







r)2�__doc__�types�weakref�copyregr�	Exceptionr�errorZorg.python.corer	�ImportError�__all__r
rr&rr�int�float�bool�complexrr1�bytes�	frozenset�range�slice�property�BuiltinFunctionType�Ellipsis�NotImplemented�FunctionType�ref�tr�list�dict�set�	bytearrayrr"r#rr+r4r8r;�
MethodTyper$rrrrr�<module>s�2

'�






4





�
-quopri.cpython-38.pyc000064400000013166151450073350010525 0ustar00U

e5dT�@s�dZddddgZdZdZdZdZzd	d
lmZmZWne	k
rPdZdZYnXdd
�Z
dd�Zddd�Zddd�Z
ddd�Zddd�Zdd�Zdd�Zdd�Zedkr�e�dS) zHConversions to/from quoted-printable transport encoding as per RFC 1521.�encode�decode�encodestring�decodestring�=�Ls0123456789ABCDEF��)�a2b_qp�b2a_qpNcCsHt|t�st�|dkr|S|dkr&|S|tkpFd|ko@dknS)z�Decide whether a particular byte ordinal needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    � 	�_� �~)�
isinstance�bytes�AssertionError�ESCAPE)�c�	quotetabs�header�r�/usr/lib64/python3.8/quopri.py�needsquotingsrcCsBt|t�rt|�dkst�t|�}ttt|dt|df�S)zQuote a single character.��)rr�lenr�ordr�HEX�rrrr�quote$srFc
Cs2tdk	r,|��}t|||d�}|�|�dS|dfdd�}d}|��}|sN�qg}	d}
|dd�dkrv|dd�}d}
|D]D}t|f�}t|||�r�t|�}|r�|dkr�|	�d	�qz|	�|�qz|dk	r�||�t�	|	�}t
|�tk�r||dtd
�dd�|td
d�}q�|}q>|dk	�r.|||
d�dS)
avRead 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are binary file objects. The 'quotetabs' flag
    indicates whether embedded tabs and spaces should be quoted. Note that
    line-ending tabs and spaces are always encoded, as per RFC 1521.
    The 'header' flag indicates whether we are encoding spaces as _ as per RFC
    1522.N�rr�
cSsj|r<|dd�dkr<|�|dd�t|dd��|�n*|dkrX|�t|�|�n|�||�dS)N���r�.)�writer)�s�output�lineEndrrrr$;s
(zencode.<locals>.writerr"r
rrs=
)r')r
�readr$�readlinerrr�append�EMPTYSTRING�joinr�MAXLINESIZE)
�inputr&rr�data�odatar$Zprevline�lineZoutline�strippedrZthislinerrrr,s>	




cCsFtdk	rt|||d�Sddlm}||�}|�}t||||�|��S)Nr r��BytesIO)r
�ior4r�getvalue)r%rrr4�infp�outfprrrrjscCs�tdk	r*|��}t||d�}|�|�dSd}|��}|s>�q�dt|�}}|dkr�||d|�dkr�d}	|d}|dkr�||d|�dkr�|d}qtnd}	||k�r�|||d�}
|
dkr�|r�|d	}|d}q�|
tkr�||
}|d}q�|d|k�r|	�sd}	�q�q�|d|k�rJ||d|d
�tk�rJ|t}|d
}q�|d
|k�r�t||d|d
���r�t||d
|d���r�|tt||d|d��f�}|d}q�||
}|d}q�|	s.|�|d�d}q.|�r�|�|�dS)z�Read 'input', apply quoted-printable decoding, and write to 'output'.
    'input' and 'output' are binary file objects.
    If 'header' is true, decode underscore as space (per RFC 1522).N�rrrrr!s 	
rr
��)	r	r(r$r)rr�ishexr�unhex)r.r&rr/r0�newr1�i�n�partialrrrrrusP



(
B"

cCsDtdk	rt||d�Sddlm}||�}|�}t|||d�|��S)Nr9rr3)r	r5r4rr6)r%rr4r7r8rrrr�scCsVt|t�st�d|ko dknpTd|ko8dknpTd|koPdkSS)zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.�0�9�a�f�A�F)rrrrrrrr<�sr<cCs�d}|D]�}t|f�}d|kr*dkr8nn
td�}n`d|krLdkr^nntd�d}n:d	|krrd
kr�nntd	�d}nds�tdt|���|d
t|�|}q|S)z.Get the integer value of a hexadecimal number.rrBrC�0rDrE�a�
rFrGFznon-hex digit r)rrr�repr)r%�bitsrr?rrrr=�s

r=cCs�ddl}ddl}z|�|jdd�d�\}}WnV|jk
r�}z6|j|_t|�td�td�td�|�d�W5d}~XYnXd}d}|D] \}}|dkr�d}|d	kr�d}q�|r�|r�|j|_td
�|�d�|s�dg}d}	|D]�}
|
dkr�|jj	}nTzt
|
d�}WnDtk
�rP}z$|j�d
|
|f�d}	WY�q�W5d}~XYnXz*|�rjt||jj	�nt||jj	|�W5|
dk�r�|�
�Xq�|	�r�|�|	�dS)NrrZtdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder:z-tz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s)
)�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr$�closerr)rOrPZopts�args�msgZdecoZtabs�orI�sts�file�fprrr�main�sT


rb�__main__)F)FF)F)F)�__doc__�__all__rr-rr+Zbinasciir	r
�ImportErrorrrrrrrr<r=rb�__name__rrrr�<module>s*

>

+
.heapq.cpython-38.opt-2.pyc000064400000025460151450073350011244 0ustar00U

e5d]Y�@sVdZddddddddgZd	d�Zd
d�Zdd�Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
ddd�dd�Zd(d d�Zd)d!d�Zzd"d#lTWnek
r�YnXzd"d$lmZWnek
r�YnXzd"d%lm	Z	Wnek
�r
YnXzd"d&lmZWnek
�r2YnXed'k�rRd"dlZee���dS)*uoHeap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
�heappush�heappop�heapify�heapreplace�merge�nlargest�	nsmallest�heappushpopcCs"|�|�t|dt|�d�dS)N��)�append�	_siftdown�len��heap�item�r�/usr/lib64/python3.8/heapq.pyr�s
cCs.|��}|r*|d}||d<t|d�|S|S�Nr	)�pop�_siftup�rZlastelt�
returnitemrrrr�s
cCs|d}||d<t|d�|Sr�r�rrrrrrr�s
cCs0|r,|d|kr,|d|}|d<t|d�|Srrrrrrr�s
cCs,t|�}tt|d��D]}t||�qdS�N�)r
�reversed�ranger��x�n�irrrr�scCs.|��}|r*|d}||d<t|d�|S|Sr)r�_siftup_maxrrrr�_heappop_max�s
r#cCs|d}||d<t|d�|Sr)r"rrrr�_heapreplace_max�s
r$cCs,t|�}tt|d��D]}t||�qdSr)r
rrr"rrrr�_heapify_max�sr%cCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS�Nr
r�r�startpos�pos�newitem�	parentpos�parentrrrr�srcCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS�Nrr
)r
r�rr)�endposr(r*�childpos�rightposrrrrsrcCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dSr&rr'rrr�
_siftdown_maxsr2cCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dSr-)r
r2r.rrrr"%sr"NF��key�reversec	gsg}|j}|r t}t}t}d}nt}t}t}d}|dk�rttt	|��D]<\}	}
z|
j
}||�|	||g�WqHtk
r�YqHXqH||�t|�dkr�z2|d\}}	}}
|V|�|
d<|||
�q�Wq�tk
r�||�Yq�Xq�|�r|d\}}	}|V|j
EdHdSttt	|��D]J\}	}
z(|
j
}|�}|||�|	|||g�Wntk
�rjYnX�q$||�t|�dk�r�zF|d\}}	}}}
|V|�}||�|
d<||
d<|||
��q�Wntk
�r�||�YnX�qx|�r|d\}}	}}|V|j
EdHdS)N���r
r	r)rr%r#r$rrr�	enumerate�map�iter�__next__�
StopIterationr
�__self__)r4r5�	iterables�h�h_append�_heapify�_heappop�_heapreplace�	direction�order�it�next�value�s�	key_valuerrrr:sl


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYnX||krxt|�d�d|�S�dk�rt|�}dd�tt|�|�D�}|s�|St	|�|dd}|}t
}	|D].}
|
|kr�|	||
|f�|d\}}|d7}q�|��dd�|D�St|�}�fdd�tt|�|�D�}|�s>|St	|�|dd}|}t
}	|D]>}
�|
�}||k�r^|	||||
f�|d\}}}
|d7}�q^|��d	d�|D�S)
Nr
��defaultr4�r4cSsg|]\}}||f�qSrr��.0r!�elemrrr�
<listcomp>�sznsmallest.<locals>.<listcomp>r	cSsg|]\}}|�qSrr�rNrOrDrrrrP�scsg|]\}}�|�||f�qSrrrMrLrrrP�scSsg|]\}}}|�qSrr�rN�krDrOrrrrPs)r9�object�minr
�	TypeError�AttributeError�sorted�ziprr%r$�sort�r �iterabler4rE�sentinel�result�size�toprDrBrO�_orderrS�_elemrrLrr�sV


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYn X||krzt|�dd�d|�S�dk�rt|�}dd�ttd|d�|�D�}|s�|St	|�|dd}|}t
}	|D].}
||
kr�|	||
|f�|d\}}|d8}q�|jdd	�d
d�|D�St|�}�fdd�ttd|d�|�D�}|�sR|St	|�|dd}|}t
}	|D]>}
�|
�}||k�rt|	||||
f�|d\}}}
|d8}�qt|jdd	�dd�|D�S)
Nr
rJTr3cSsg|]\}}||f�qSrrrMrrrrP"sznlargest.<locals>.<listcomp>r	r6)r5cSsg|]\}}|�qSrrrQrrrrP/scsg|]\}}�|�||f�qSrrrMrLrrrP3scSsg|]\}}}|�qSrrrRrrrrPAs)r9rT�maxr
rVrWrXrYrrrrZr[rrLrr	sV

"
r	)�*)r$)r%)r#�__main__)N)N)�	__about__�__all__rrrrrr#r$r%rrr2r"rrr�_heapq�ImportError�__name__Zdoctest�printZtestmodrrrr�<module>!sP^
�

	5
<
;
ipaddress.cpython-38.pyc000064400000165113151450073350011164 0ustar00U

e5d��@s�dZdZddlZdZdZGdd�de�ZGdd	�d	e�Zd
d�Zd=d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZGd#d$�d$�ZejGd%d&�d&e��ZejGd'd(�d(e��ZGd)d*�d*�ZGd+d,�d,ee�ZGd-d.�d.e�ZGd/d0�d0ee�ZGd1d2�d2�Zee_Gd3d4�d4�ZGd5d6�d6ee�ZGd7d8�d8e�Z Gd9d:�d:ee�Z!Gd;d<�d<�Z"e"e_dS)>z�A fast, lightweight IPv4/IPv6 manipulation library in Python.

This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.

z1.0�N� �c@seZdZdZdS)�AddressValueErrorz%A Value Error related to the address.N��__name__�
__module__�__qualname__�__doc__�r
r
�!/usr/lib64/python3.8/ipaddress.pyrsrc@seZdZdZdS)�NetmaskValueErrorz%A Value Error related to the netmask.Nrr
r
r
rrsrc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Address or IPv6Address object.

    Raises:
        ValueError: if the *address* passed isn't either a v4 or a v6
          address

    z0%r does not appear to be an IPv4 or IPv6 addressN)�IPv4Addressrr�IPv6Address�
ValueError��addressr
r
r�
ip_addresss

�rTc	Cs\zt||�WSttfk
r$YnXzt||�WSttfk
rJYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP network.  Either IPv4 or
          IPv6 networks may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Network or IPv6Network object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address. Or if the network has host bits set.

    z0%r does not appear to be an IPv4 or IPv6 networkN)�IPv4Networkrr�IPv6Networkr)r�strictr
r
r�
ip_network9s�rc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)agTake an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Interface or IPv6Interface object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address.

    Notes:
        The IPv?Interface classes describe an Address on a particular
        Network, so they're basically a combination of both the Address
        and Network classes.

    z2%r does not appear to be an IPv4 or IPv6 interfaceN)�
IPv4Interfacerr�
IPv6Interfacerrr
r
r�ip_interfaceWs

�rcCs0z|�dd�WStk
r*td��YnXdS)a`Represent an address as 4 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv4 IP address.

    Returns:
        The integer address packed as 4 bytes in network (big-endian) order.

    Raises:
        ValueError: If the integer is negative or too large to be an
          IPv4 IP address.

    ��bigz&Address negative or too large for IPv4N��to_bytes�
OverflowErrorrrr
r
r�v4_int_to_packedzsrcCs0z|�dd�WStk
r*td��YnXdS)z�Represent an address as 16 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv6 IP address.

    Returns:
        The integer address packed as 16 bytes in network (big-endian) order.

    �rz&Address negative or too large for IPv6Nrrr
r
r�v6_int_to_packed�s
r!cCs*t|��d�}t|�dkr&td|��|S)zAHelper to split the netmask and raise AddressValueError if needed�/�zOnly one '/' permitted in %r)�str�split�lenr)r�addrr
r
r�_split_optional_netmask�sr(ccsNt|�}t|�}}|D]&}|j|jdkr:||fV|}|}q||fVdS)z�Find a sequence of sorted deduplicated IPv#Address.

    Args:
        addresses: a list of IPv#Address objects.

    Yields:
        A tuple containing the first and last IP addresses in the sequence.

    �N)�iter�next�_ip)�	addresses�it�first�last�ipr
r
r�_find_address_range�s

r2cCs$|dkr|St|||d@���S)z�Count the number of zero bits on the right hand side.

    Args:
        number: an integer.
        bits: maximum number of bits to count.

    Returns:
        The number of zero bits on the right hand side of the number.

    rr))�min�
bit_length)Znumber�bitsr
r
r�_count_righthand_zero_bits�sr6ccs�t|t�rt|t�std��|j|jkr8td||f��||krHtd��|jdkrXt}n|jdkrht}ntd��|j}|j}|j}||kr�t	t
||�||d��d�}||||f�}|V|d|>7}|d|jkr�q�q�dS)	a�Summarize a network range given the first and last IP addresses.

    Example:
        >>> list(summarize_address_range(IPv4Address('192.0.2.0'),
        ...                              IPv4Address('192.0.2.130')))
        ...                                #doctest: +NORMALIZE_WHITESPACE
        [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'),
         IPv4Network('192.0.2.130/32')]

    Args:
        first: the first IPv4Address or IPv6Address in the range.
        last: the last IPv4Address or IPv6Address in the range.

    Returns:
        An iterator of the summarized IPv(4|6) network objects.

    Raise:
        TypeError:
            If the first and last objects are not IP addresses.
            If the first and last objects are not the same version.
        ValueError:
            If the last object is not greater than the first.
            If the version of the first address is not 4 or 6.

    z1first and last must be IP addresses, not networks�%%s and %s are not of the same versionz*last IP address must be greater than firstr�zunknown IP versionr)N)
�
isinstance�_BaseAddress�	TypeError�versionrrr�_max_prefixlenr,r3r6r4�	_ALL_ONES)r/r0r1Zip_bitsZ	first_intZlast_intZnbits�netr
r
r�summarize_address_range�s8
��


�r@ccs�t|�}i}|rV|��}|��}|�|�}|dkr<|||<q||kr||=|�|�qd}t|���D]$}|dk	r�|j|jkr�qf|V|}qfdS)auLoops through the addresses, collapsing concurrent netblocks.

    Example:

        ip1 = IPv4Network('192.0.2.0/26')
        ip2 = IPv4Network('192.0.2.64/26')
        ip3 = IPv4Network('192.0.2.128/26')
        ip4 = IPv4Network('192.0.2.192/26')

        _collapse_addresses_internal([ip1, ip2, ip3, ip4]) ->
          [IPv4Network('192.0.2.0/24')]

        This shouldn't be called directly; it is called via
          collapse_addresses([]).

    Args:
        addresses: A list of IPv4Network's or IPv6Network's

    Returns:
        A list of IPv4Network's or IPv6Network's depending on what we were
        passed.

    N)�list�pop�supernet�get�append�sorted�values�broadcast_address)r-Zto_merge�subnetsr?rCZexistingr0r
r
r�_collapse_addresses_internals$

rJc	Cs0g}g}g}|D]�}t|t�rR|rF|dj|jkrFtd||df��|�|�q|j|jkr�|r�|dj|jkr�td||df��z|�|j�Wq�tk
r�|�|j	�Yq�Xq|r�|dj|jkr�td||df��|�|�qt
t|��}|�r$t|�D]\}}|�
t||���qt||�S)a�Collapse a list of IP objects.

    Example:
        collapse_addresses([IPv4Network('192.0.2.0/25'),
                            IPv4Network('192.0.2.128/25')]) ->
                           [IPv4Network('192.0.2.0/24')]

    Args:
        addresses: An iterator of IPv4Network or IPv6Network objects.

    Returns:
        An iterator of the collapsed IPv(4|6)Network objects.

    Raises:
        TypeError: If passed a list of mixed version objects.

    ���r7)r9r:�_versionr;rE�
_prefixlenr=r1�AttributeError�network_addressrF�setr2�extendr@rJ)r-ZaddrsZipsZnetsr1r/r0r
r
r�collapse_addresses2s@
���rRcCs(t|t�r|��St|t�r$|��StS)a2Return a key suitable for sorting between networks and addresses.

    Address and Network objects are not sortable by default; they're
    fundamentally different so the expression

        IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')

    doesn't make any sense.  There are some times however, where you may wish
    to have ipaddress sort these for you anyway. If you need to do this, you
    can use this function as the key= argument to sorted().

    Args:
      obj: either a Network or Address object.
    Returns:
      appropriate key.

    )r9�_BaseNetwork�_get_networks_keyr:�_get_address_key�NotImplemented)�objr
r
r�get_mixed_type_keyhs


rXc@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�ZdS)�_IPAddressBasezThe mother class.r
cCs|��S)z:Return the longhand version of the IP address as a string.)�_explode_shorthand_ip_string��selfr
r
r�exploded�sz_IPAddressBase.explodedcCst|�S)z;Return the shorthand version of the IP address as a string.�r$r[r
r
r�
compressed�sz_IPAddressBase.compressedcCs|��S)aIThe name of the reverse DNS pointer for the IP address, e.g.:
            >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
            '1.0.0.127.in-addr.arpa'
            >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
            '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'

        )�_reverse_pointerr[r
r
r�reverse_pointer�s	z_IPAddressBase.reverse_pointercCsdt|�f}t|��dS)Nz%200s has no version specified��type�NotImplementedError�r\�msgr
r
rr<�sz_IPAddressBase.versioncCsF|dkrd}t|||jf��||jkrBd}t|||j|jf��dS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrLr>r=)r\rrfr
r
r�_check_int_address�s

�z!_IPAddressBase._check_int_addresscCs.t|�}||kr*d}t|||||jf��dS)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r&rrL)r\rZexpected_lenZaddress_lenrfr
r
r�_check_packed_address�s�z$_IPAddressBase._check_packed_addresscCs|j|j|?AS)z�Turn the prefix length into a bitwise netmask

        Args:
            prefixlen: An integer, the prefix length.

        Returns:
            An integer.

        )r>)�cls�	prefixlenr
r
r�_ip_int_from_prefix�sz"_IPAddressBase._ip_int_from_prefixc	Cs\t||j�}|j|}||?}d|>d}||krX|jd}|�|d�}d}t||��|S)aReturn prefix length from the bitwise netmask.

        Args:
            ip_int: An integer, the netmask in expanded bitwise format

        Returns:
            An integer, the prefix length.

        Raises:
            ValueError: If the input intermingles zeroes & ones
        r)�rz&Netmask pattern %r mixes zeroes & ones)r6r=rr)	ri�ip_intZtrailing_zeroesrjZleading_onesZall_onesZbyteslenZdetailsrfr
r
r�_prefix_from_ip_int�s
�

z"_IPAddressBase._prefix_from_ip_intcCsd|}t|�d�dS)Nz%r is not a valid netmask)r)riZnetmask_strrfr
r
r�_report_invalid_netmask�sz&_IPAddressBase._report_invalid_netmaskcCsl|��r|��s|�|�zt|�}Wntk
rD|�|�YnXd|kr\|jkshn|�|�|S)a	Return prefix length from a numeric string

        Args:
            prefixlen_str: The string to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask
        r)�isascii�isdigitro�intrr=)riZ
prefixlen_strrjr
r
r�_prefix_from_prefix_string�s

z)_IPAddressBase._prefix_from_prefix_stringcCs�z|�|�}Wntk
r,|�|�YnXz|�|�WStk
rNYnX||jN}z|�|�WStk
r�|�|�YnXdS)aTurn a netmask/hostmask string into a prefix length

        Args:
            ip_str: The netmask/hostmask to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask/hostmask
        N)�_ip_int_from_stringrrornrr>)ri�ip_strrmr
r
r�_prefix_from_ip_string�s
z%_IPAddressBase._prefix_from_ip_stringcCsHt|ttf�r||jfSt|t�s*t|�}t|�dkr:|S|d|jfS)z�Helper function to parse address of Network/Interface.

        Arg:
            address: Argument of Network/Interface.

        Returns:
            (addr, prefix) tuple.
        r)r)r9�bytesrrr=�tupler(r&)rirr
r
r�_split_addr_prefixs

z!_IPAddressBase._split_addr_prefixcCs|jt|�ffS�N)�	__class__r$r[r
r
r�
__reduce__/sz_IPAddressBase.__reduce__N)rrrr	�	__slots__�propertyr]r_rar<rgrh�classmethodrkrnrorsrvryr|r
r
r
rrY�s2




	




!
rYc@sdeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)r:z�A generic IP object.

    This IP class contains the version independent methods which are
    used by single IP addresses.
    r
cCs|jSrz�r,r[r
r
r�__int__>sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk
r2tYSXdSrz)r,rLrNrV�r\�otherr
r
r�__eq__As
�z_BaseAddress.__eq__cCsFt|t�stS|j|jkr*td||f��|j|jkrB|j|jkSdS�Nr7F)r9r:rVrLr;r,r�r
r
r�__lt__Hs
�z_BaseAddress.__lt__cCs t|t�stS|�t|�|�Srz�r9rrrVr{r�r
r
r�__add__Ts
z_BaseAddress.__add__cCs t|t�stS|�t|�|�Srzr�r�r
r
r�__sub__Ys
z_BaseAddress.__sub__cCsd|jjt|�fS�Nz%s(%r)�r{rr$r[r
r
r�__repr__^sz_BaseAddress.__repr__cCst|�|j��Srz)r$�_string_from_ip_intr,r[r
r
r�__str__asz_BaseAddress.__str__cCsttt|j���Srz)�hash�hexrrr,r[r
r
r�__hash__dsz_BaseAddress.__hash__cCs
|j|fSrz�rLr[r
r
rrUgsz_BaseAddress._get_address_keycCs|j|jffSrz)r{r,r[r
r
rr|jsz_BaseAddress.__reduce__N)rrrr	r}r�r�r�r�r�r�r�r�rUr|r
r
r
rr:3sr:c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ejdd��Zejdd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zd&d'�Zd(d)�Zd*d+�ZdFd.d/�ZdGd0d1�Zed2d3��Zed4d5��Z d6d7�Z!d8d9�Z"ed:d;��Z#ed<d=��Z$ed>d?��Z%ed@dA��Z&edBdC��Z'edDdE��Z(d-S)HrSz}A generic IP network object.

    This IP class contains the version independent methods which are
    used by networks.
    cCsd|jjt|�fSr�r�r[r
r
rr�vsz_BaseNetwork.__repr__cCsd|j|jfS�N�%s/%d)rOrjr[r
r
rr�ysz_BaseNetwork.__str__ccs8t|j�}t|j�}t|d|�D]}|�|�Vq"dS)z�Generate Iterator over usable hosts in a network.

        This is like __iter__ except it doesn't return the network
        or broadcast addresses.

        r)N�rrrOrH�range�_address_class�r\�network�	broadcast�xr
r
r�hosts|s

z_BaseNetwork.hostsccs8t|j�}t|j�}t||d�D]}|�|�Vq"dS�Nr)r�r�r
r
r�__iter__�s

z_BaseNetwork.__iter__cCslt|j�}t|j�}|dkr>|||kr0td��|�||�S|d7}|||krZtd��|�||�SdS)Nrzaddress out of ranger))rrrOrH�
IndexErrorr�)r\�nr�r�r
r
r�__getitem__�s

z_BaseNetwork.__getitem__cCs^t|t�stS|j|jkr*td||f��|j|jkrB|j|jkS|j|jkrZ|j|jkSdSr�)r9rSrVrLr;rO�netmaskr�r
r
rr��s
�z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|j�t|j�kWStk
rFtYSXdSrz)rLrOrrr�rNrVr�r
r
rr��s
��z_BaseNetwork.__eq__cCstt|j�t|j�A�Srz)r�rrrOr�r[r
r
rr��sz_BaseNetwork.__hash__cCs8|j|jkrdSt|t�rdS|j|jj@|jjkSdS�NF)rLr9rSr,r�rOr�r
r
r�__contains__�s

z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kS)z*Tell if self is partly contained in other.)rOrHr�r
r
r�overlaps�s



�z_BaseNetwork.overlapscCs|�t|j�t|j�B�Srz)r�rrrO�hostmaskr[r
r
rrH�s�z_BaseNetwork.broadcast_addresscCs|�t|j�|jA�Srz)r�rrr�r>r[r
r
rr��sz_BaseNetwork.hostmaskcCsd|j|jfSr�)rOrMr[r
r
r�with_prefixlen�sz_BaseNetwork.with_prefixlencCsd|j|jfS�N�%s/%s)rOr�r[r
r
r�with_netmask�sz_BaseNetwork.with_netmaskcCsd|j|jfSr�)rOr�r[r
r
r�
with_hostmask�sz_BaseNetwork.with_hostmaskcCst|j�t|j�dS)z&Number of hosts in the current subnet.r))rrrHrOr[r
r
r�
num_addresses�sz_BaseNetwork.num_addressescCsdt|�f}t|��dS)Nz%%200s has no associated address classrbrer
r
rr��sz_BaseNetwork._address_classcCs|jSrz)rMr[r
r
rrj�sz_BaseNetwork.prefixlenccs|j|jkstd||f��t|t�s2td|��|�|�sLtd||f��||krXdS|�d|j|jf�}|�	�\}}||kr�||kr�|�|�r�|V|�	�\}}qz|�|�r�|V|�	�\}}qzt
d|||f��qz||kr�|Vn"||kr�|Vnt
d|||f��dS)a�Remove an address from a larger block.

        For example:

            addr1 = ip_network('192.0.2.0/28')
            addr2 = ip_network('192.0.2.1/32')
            list(addr1.address_exclude(addr2)) =
                [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'),
                 IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')]

        or IPv6:

            addr1 = ip_network('2001:db8::1/32')
            addr2 = ip_network('2001:db8::1/128')
            list(addr1.address_exclude(addr2)) =
                [ip_network('2001:db8::1/128'),
                 ip_network('2001:db8::2/127'),
                 ip_network('2001:db8::4/126'),
                 ip_network('2001:db8::8/125'),
                 ...
                 ip_network('2001:db8:8000::/33')]

        Args:
            other: An IPv4Network or IPv6Network object of the same type.

        Returns:
            An iterator of the IPv(4|6)Network objects which is self
            minus other.

        Raises:
            TypeError: If self and other are of differing address
              versions, or if other is not a network object.
            ValueError: If other is not completely contained by self.

        r7z%s is not a network objectz%s not contained in %sNr�z3Error performing exclusion: s1: %s s2: %s other: %s)rLr;r9rS�	subnet_ofrr{rOrjrI�AssertionError)r\r��s1�s2r
r
r�address_exclude�s@$�


�

��z_BaseNetwork.address_excludecCs`|j|jkrtd||f��|j|jkr,dS|j|jkr<dS|j|jkrLdS|j|jkr\dSdS)a�Compare two IP objects.

        This is only concerned about the comparison of the integer
        representation of the network addresses.  This means that the
        host bits aren't considered at all in this method.  If you want
        to compare host bits, you can easily enough do a
        'HostA._ip < HostB._ip'

        Args:
            other: An IP object.

        Returns:
            If the IP versions of self and other are the same, returns:

            -1 if self < other:
              eg: IPv4Network('192.0.2.0/25') < IPv4Network('192.0.2.128/25')
              IPv6Network('2001:db8::1000/124') <
                  IPv6Network('2001:db8::2000/124')
            0 if self == other
              eg: IPv4Network('192.0.2.0/24') == IPv4Network('192.0.2.0/24')
              IPv6Network('2001:db8::1000/124') ==
                  IPv6Network('2001:db8::1000/124')
            1 if self > other
              eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25')
                  IPv6Network('2001:db8::2000/124') >
                      IPv6Network('2001:db8::1000/124')

          Raises:
              TypeError if the IP versions are different.

        z"%s and %s are not of the same typerKr)r)rLr;rOr�r�r
r
r�compare_networks6s!�z_BaseNetwork.compare_networkscCs|j|j|jfS)z�Network-only key function.

        Returns an object that identifies this address' network and
        netmask. This function is a suitable "key" argument for sorted()
        and list.sort().

        )rLrOr�r[r
r
rrTfsz_BaseNetwork._get_networks_keyr)Nc	cs�|j|jkr|VdS|dk	rJ||jkr0td��|dkr@td��||j}|dkrZtd��|j|}||jkr~td||f��t|j�}t|j�d}t|j�d|?}t|||�D]}|�||f�}|Vq�dS)a�The subnets which join to make the current subnet.

        In the case that self contains only one IP
        (self._prefixlen == 32 for IPv4 or self._prefixlen == 128
        for IPv6), yield an iterator with just ourself.

        Args:
            prefixlen_diff: An integer, the amount the prefix length
              should be increased by. This should not be set if
              new_prefix is also set.
            new_prefix: The desired new prefix length. This must be a
              larger number (smaller prefix) than the existing prefix.
              This should not be set if prefixlen_diff is also set.

        Returns:
            An iterator of IPv(4|6) objects.

        Raises:
            ValueError: The prefixlen_diff is too small or too large.
                OR
            prefixlen_diff and new_prefix are both set or new_prefix
              is a smaller number than the current prefix (smaller
              number means a larger network)

        Nznew prefix must be longerr)�(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s)	rMr=rrrrOrHr�r�r{)	r\�prefixlen_diff�
new_prefix�
new_prefixlen�start�end�stepZnew_addrZcurrentr
r
rrIps2



��
z_BaseNetwork.subnetscCs�|jdkr|S|dk	rB||jkr(td��|dkr8td��|j|}|j|}|dkrftd|j|f��|�t|j�t|j�|>@|f�S)a�The supernet containing the current network.

        Args:
            prefixlen_diff: An integer, the amount the prefix length of
              the network should be decreased by.  For example, given a
              /24 network and a prefixlen_diff of 3, a supernet with a
              /21 netmask is returned.

        Returns:
            An IPv4 network object.

        Raises:
            ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have
              a negative prefix length.
                OR
            If prefixlen_diff and new_prefix are both set or new_prefix is a
              larger number than the current prefix (larger number means a
              smaller network)

        rNznew prefix must be shorterr)r�z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rMrrjr{rrrOr�)r\r�r�r�r
r
rrC�s&



���z_BaseNetwork.supernetcCs|jjo|jjS�z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        )rO�is_multicastrHr[r
r
rr��s	�z_BaseNetwork.is_multicastcCshz:|j|jkr"t|�d|�d���|j|jko8|j|jkWStk
rbtd|�d|����YnXdS)Nz and z are not of the same versionz*Unable to test subnet containment between )rLr;rOrHrN)�a�br
r
r�
_is_subnet_of�s
�z_BaseNetwork._is_subnet_ofcCs|�||�S)z1Return True if this network is a subnet of other.�r�r�r
r
rr��sz_BaseNetwork.subnet_ofcCs|�||�S)z3Return True if this network is a supernet of other.r�r�r
r
r�supernet_of�sz_BaseNetwork.supernet_ofcCs|jjo|jjS)��Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        )rO�is_reservedrHr[r
r
rr��s	�z_BaseNetwork.is_reservedcCs|jjo|jjS�z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        )rO�
is_link_localrHr[r
r
rr��s�z_BaseNetwork.is_link_localcCs|jjo|jjS)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        )rO�
is_privaterHr[r
r
rr�s	�z_BaseNetwork.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        �r�r[r
r
r�	is_globals	z_BaseNetwork.is_globalcCs|jjo|jjS)��Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        )rO�is_unspecifiedrHr[r
r
rr�s	�z_BaseNetwork.is_unspecifiedcCs|jjo|jjS)��Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        )rO�is_loopbackrHr[r
r
rr�(s	�z_BaseNetwork.is_loopback)r)N)r)N))rrrr	r�r�r�r�r�r�r�r�r�r��	functools�cached_propertyrHr�r~r�r�r�r�r�rjr�r�rTrIrCr��staticmethodr�r�r�r�r�r�r�r�r�r
r
r
rrSnsd








K0

5
)








rSc@s�eZdZdZdZdZdedZeZiZ	dd�Z
edd	��Zed
d��Z
edd
��Zedd��Zdd�Zedd��Zedd��ZdS)�_BaseV4zyBase IPv4 object.

    The following methods are used by IPv4 objects in both single IP
    addresses and networks.

    r
rr#r)cCst|�Srzr^r[r
r
rrZHsz$_BaseV4._explode_shorthand_ip_stringcCs�||jkr�t|t�r<|}d|kr.|jksjn|�|�n.z|�|�}Wntk
rh|�|�}YnXt|�	|��}||f|j|<|j|S�aMake a (netmask, prefix_len) tuple from the given argument.

        Argument can be:
        - an integer (the prefix length)
        - a string representing the prefix length (e.g. "24")
        - a string representing the prefix netmask (e.g. "255.255.255.0")
        r)
�_netmask_cacher9rrr=rorsrrvr
rk�ri�argrjr�r
r
r�
_make_netmaskKs	

z_BaseV4._make_netmaskc
Cs~|std��|�d�}t|�dkr.td|��zt�t|j|�d�WStk
rx}ztd||f�d�W5d}~XYnXdS)aTurn the given IP string into an integer for comparison.

        Args:
            ip_str: A string, the IP ip_str.

        Returns:
            The IP ip_str as an integer.

        Raises:
            AddressValueError: if ip_str isn't a valid IPv4 Address.

        �Address cannot be empty�.rzExpected 4 octets in %rr�%s in %rN)rr%r&rr�
from_bytes�map�_parse_octetr)riruZoctets�excr
r
rrtes
z_BaseV4._ip_int_from_stringcCs�|std��|��r|��s,d}t||��t|�dkrHd}t||��|dkrl|ddkrld}t||��t|d�}|d	kr�td
|��|S)aConvert a decimal octet into an integer.

        Args:
            octet_str: A string, the number to parse.

        Returns:
            The octet as an integer.

        Raises:
            ValueError: if the octet isn't strictly a decimal from [0..255].

        zEmpty octet not permittedz#Only decimal digits permitted in %r�z$At most 3 characters permitted in %r�0rz%Leading zeros are not permitted in %r�
�zOctet %d (> 255) not permitted)rrprqr&rr)riZ	octet_strrfZ	octet_intr
r
rr�s
z_BaseV4._parse_octetcCsd�tt|�dd���S)z�Turns a 32-bit integer into dotted decimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            The IP address as a string in dotted decimal notation.

        r�rr)�joinr�r$r)rirmr
r
rr��sz_BaseV4._string_from_ip_intcCs&t|��d�ddd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv4 address.

        This implements the method described in RFC1035 3.5.

        r�NrKz
.in-addr.arpa)r$r%r�)r\Zreverse_octetsr
r
rr`�sz_BaseV4._reverse_pointercCs|jSrz�r=r[r
r
r�
max_prefixlen�sz_BaseV4.max_prefixlencCs|jSrzr�r[r
r
rr<�sz_BaseV4.versionN)rrrr	r}rL�
IPV4LENGTHr>r=r�rZrr�rtr�r�r`r~r�r<r
r
r
rr�5s(


#
	
r�c@s�eZdZdZdZdd�Zedd��Zedd��Zee	�
�d	d
���Zee	�
�dd���Zed
d��Z
edd��Zedd��Zedd��ZdS)r
z/Represent and manipulate single IPv4 Addresses.�r,�__weakref__cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)a�
        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv4Address('192.0.2.1') == IPv4Address(3221225985).
              or, more generally
              IPv4Address(int(IPv4Address('192.0.2.1'))) ==
                IPv4Address('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.

        Nrrr"�Unexpected '/' in %r�
r9rrrgr,rwrhr�r$rrt�r\rZaddr_strr
r
r�__init__�s


zIPv4Address.__init__cCs
t|j�S�z*The binary representation of this address.)rr,r[r
r
r�packed�szIPv4Address.packedcCs||jjkS)z�Test if the address is otherwise IETF reserved.

         Returns:
             A boolean, True if the address is within the
             reserved IPv4 Network range.

        )�
_constants�_reserved_networkr[r
r
rr��s	zIPv4Address.is_reservedcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry.

        c3s|]}�|kVqdSrzr
��.0r?r[r
r�	<genexpr>sz)IPv4Address.is_private.<locals>.<genexpr>��anyr��_private_networksr[r
r[rr��s
zIPv4Address.is_privatecCs||jjko|jSrz)r��_public_networkr�r[r
r
rr�szIPv4Address.is_globalcCs||jjkS)z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is multicast.
            See RFC 3171 for details.

        �r��_multicast_networkr[r
r
rr�s	zIPv4Address.is_multicastcCs||jjkS)z�Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 5735 3.

        )r��_unspecified_addressr[r
r
rr�s	zIPv4Address.is_unspecifiedcCs||jjkS)z�Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback per RFC 3330.

        )r��_loopback_networkr[r
r
rr�"szIPv4Address.is_loopbackcCs||jjkS)z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is link-local per RFC 3927.

        �r��_linklocal_networkr[r
r
rr�,szIPv4Address.is_link_localN)rrrr	r}r�r~r�r�r��	lru_cacher�r�r�r�r�r�r
r
r
rr
�s*#








	r
c@sxeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dS�NF)r)ryr
r�rr�r�rM�r\rr'�maskr
r
rr�9s

zIPv4Interface.__init__cCs|jjSrz�r�r�r[r
r
rr�AszIPv4Interface.hostmaskcCsd|�|j�|jfSr��r�r,rMr[r
r
rr�Es�zIPv4Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)r
r�rVr�rN�r\r�Z
address_equalr
r
rr�IszIPv4Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)r
r�rVr�rN�r\r�Zaddress_lessr
r
rr�Us�zIPv4Interface.__lt__cCst|j|jt|jj�f�Srz�r�r,rMrrr�rOr[r
r
rr�aszIPv4Interface.__hash__cCs
t|j�Srz)r
r,r[r
r
rr1fszIPv4Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr�js�zIPv4Interface.with_prefixlencCsd|�|j�|jfSr��r�r,r�r[r
r
rr�os�zIPv4Interface.with_netmaskcCsd|�|j�|jfSr��r�r,r�r[r
r
rr�ts�zIPv4Interface.with_hostmaskN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r
r
r
rr7s 



rc@s2eZdZdZeZddd�Zee�	�dd���Z
dS)	raeThis class represents and manipulates 32-bit IPv4 network + addresses..

    Attributes: [examples for IPv4Network('192.0.2.0/27')]
        .network_address: IPv4Address('192.0.2.0')
        .hostmask: IPv4Address('0.0.0.31')
        .broadcast_address: IPv4Address('192.0.2.32')
        .netmask: IPv4Address('255.255.255.224')
        .prefixlen: 27

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)aInstantiate a new IPv4 network object.

        Args:
            address: A string or integer representing the IP [& network].
              '192.0.2.0/24'
              '192.0.2.0/255.255.255.0'
              '192.0.2.0/0.0.0.255'
              are all functionally the same in IPv4. Similarly,
              '192.0.2.1'
              '192.0.2.1/255.255.255.255'
              '192.0.2.1/32'
              are also functionally equivalent. That is to say, failing to
              provide a subnetmask will create an object with a mask of /32.

              If the mask (portion after the / in the argument) is given in
              dotted quad form, it is treated as a netmask if it starts with a
              non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it
              starts with a zero field (e.g. 0.255.255.255 == /8), with the
              single exception of an all-zero mask which is treated as a
              netmask == /0. If no mask is given, a default of /32 is used.

              Additionally, an integer can be passed, so
              IPv4Network('192.0.2.1') == IPv4Network(3221225985)
              or, more generally
              IPv4Interface(int(IPv4Interface('192.0.2.1'))) ==
                IPv4Interface('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv4 address.
            ValueError: If strict is True and a network address is not
              supplied.
        �%s has host bits setr)cs
t��gSrz)r
r
�r'r
r�<lambda>��z&IPv4Network.__init__.<locals>.<lambda>N)ryr
rOr�r�rMrrrr=r�r��r\rrr�r�r
rrr��s#

�
zIPv4Network.__init__cCs&|jtd�ko|jtd�ko$|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry.

        �
100.64.0.0/10)rOrrHr�r[r
r
rr��s

��zIPv4Network.is_globalN)T)rrrr	r
r�r�r~r�r�r�r
r
r
rrzs
4rc@s�eZdZed�Zed�Zed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�ed
�ed�ed�ed�gZed�Z	e
d�ZdS)�_IPv4Constantsz169.254.0.0/16z127.0.0.0/8z224.0.0.0/4rz	0.0.0.0/8z
10.0.0.0/8z
172.16.0.0/12z192.0.0.0/29z192.0.0.170/31z192.0.2.0/24z192.168.0.0/16z
198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z240.0.0.0/4z255.255.255.255/32z0.0.0.0N)rrrrr�r�r�r�r�r�r
r�r
r
r
rr�s*�rc@s�eZdZdZdZdZdedZdZe	d�Z
eZiZe
dd	��Ze
d
d��Ze
dd
��Ze
dd��Ze
ddd��Zdd�Zdd�Zedd��Zedd��ZdS)�_BaseV6zyBase IPv6 object.

    The following methods are used by IPv6 objects in both single IP
    addresses and networks.

    r
r8r#r)rlZ0123456789ABCDEFabcdefcCsl||jkrbt|t�r<|}d|kr.|jksFn|�|�n
|�|�}t|�|��}||f|j|<|j|Sr�)r�r9rrr=rorsrrkr�r
r
rr�s	


z_BaseV6._make_netmaskc
Cs�|std��|�d�}d}t|�|kr:d||f}t|��d|dkr�zt|���j}Wn4tk
r�}ztd||f�d�W5d}~XYnX|�d	|d
?d@�|�d	|d@�|jd}t|�|kr�d
|d|f}t|��d}tdt|�d�D]*}	||	s�|dk	�r d|}t|��|	}q�|dk	�r�|}
t|�|d}|d�sl|
d8}
|
�rld}t||��|d�s�|d8}|�r�d}t||��|j|
|}|dk�r2d}t||jd|f��njt|�|jk�r�d}t||j|f��|d�sd}t||��|d�s"d}t||��t|�}
d}d}znd}
t|
�D] }	|
d
K}
|
|�	||	�O}
�q@|
d
|K}
t|d�D] }	|
d
K}
|
|�	||	�O}
�qz|
WSt
k
�r�}ztd||f�d�W5d}~XYnXdS)z�Turn an IPv6 ip_str into an integer.

        Args:
            ip_str: A string, the IPv6 ip_str.

        Returns:
            An int, the IPv6 address

        Raises:
            AddressValueError: if ip_str isn't a valid IPv6 Address.

        r��:r�z At least %d parts expected in %rr�rKr�N�%xr �r)z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r)rr%r&r
rBr,rE�
_HEXTET_COUNTr��
_parse_hextetr)riru�partsZ
_min_partsrfZipv4_intr�Z
_max_partsZ
skip_index�iZparts_hiZparts_loZ
parts_skippedrmr
r
rrts�
$







z_BaseV6._ip_int_from_stringcCs>|j�|�std|��t|�dkr4d}t||��t|d�S)a&Convert an IPv6 hextet string into an integer.

        Args:
            hextet_str: A string, the number to parse.

        Returns:
            The hextet as an integer.

        Raises:
            ValueError: if the input isn't strictly a hex number from
              [0..FFFF].

        zOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr )�_HEX_DIGITS�
issupersetrr&rr)riZ
hextet_strrfr
r
rr~sz_BaseV6._parse_hextetc	Cs�d}d}d}d}t|�D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr�||}|t|�kr~|dg7}dg|||�<|dkr�dg|}|S)a�Compresses a list of hextets.

        Compresses a list of strings, replacing the longest continuous
        sequence of "0" in the list with "" and adding empty strings at
        the beginning or at the end of the string such that subsequently
        calling ":".join(hextets) will produce the compressed version of
        the IPv6 address.

        Args:
            hextets: A list of strings, the hextets to compress.

        Returns:
            A list of strings.

        rKrr�r)�)�	enumerater&)	ri�hextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_len�indexZhextetZbest_doublecolon_endr
r
r�_compress_hextets�s0�

z_BaseV6._compress_hextetsNcsZ|dkrt|j�}||jkr$td��d|��fdd�tddd�D�}|�|�}d	�|�S)
a,Turns a 128-bit integer into hexadecimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            A string, the hexadecimal representation of the address.

        Raises:
            ValueError: The address is bigger than 128 bits of all ones.

        NzIPv6 address is too large�%032xcs&g|]}dt�||d�d��qS)rrr )rr�r�r��Zhex_strr
r�
<listcomp>�sz/_BaseV6._string_from_ip_int.<locals>.<listcomp>rrrr)rrr,r>rr�rr�)rirmrr
rrr��s


z_BaseV6._string_from_ip_intcs�t|t�rt|j�}nt|t�r,t|j�}nt|�}|�|�}d|��fdd�tddd�D�}t|ttf�r�dd�	|�|j
fSd�	|�S)	z�Expand a shortened IPv6 address.

        Args:
            ip_str: A string, the IPv6 address.

        Returns:
            A string, the expanded IPv6 address.

        rcsg|]}�||d��qS)rr
rrr
rr�sz8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>rrrr�r)r9rr$rOrr1rtr�rSr�rM)r\rurmrr
rrrZ�s



z$_BaseV6._explode_shorthand_ip_stringcCs&|jddd��dd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv6 address.

        This implements the method described in RFC3596 2.5.

        NrKrrr�z	.ip6.arpa)r]�replacer�)r\Z
reverse_charsr
r
rr`�sz_BaseV6._reverse_pointercCs|jSrzr�r[r
r
rr�sz_BaseV6.max_prefixlencCs|jSrzr�r[r
r
rr<sz_BaseV6.version)N)rrrr	r}rL�
IPV6LENGTHr>r�	frozensetrr=r�rr�rtrrr�rZr`r~r�r<r
r
r
rr
�s0

g

/	
r
c@s�eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	edd��Z
ed
d��Zee�
�dd���Zedd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)rz/Represent and manipulate single IPv6 Addresses.r�cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)aInstantiate a new IPv6 address object.

        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv6Address('2001:db8::') ==
                IPv6Address(42540766411282592856903984951653826560)
              or, more generally
              IPv6Address(int(IPv6Address('2001:db8::'))) ==
                IPv6Address('2001:db8::')

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.

        Nr rr"r�r�r�r
r
rr�s


zIPv6Address.__init__cCs
t|j�Sr�)r!r,r[r
r
rr�6szIPv6Address.packedcCs||jjkSr�r�r[r
r
rr�;s	zIPv6Address.is_multicastcst�fdd��jjD��S)r�c3s|]}�|kVqdSrzr
rr[r
rr�Osz*IPv6Address.is_reserved.<locals>.<genexpr>)r�r��_reserved_networksr[r
r[rr�Fs	zIPv6Address.is_reservedcCs||jjkSr�r�r[r
r
rr�QszIPv6Address.is_link_localcCs||jjkS�a`Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        )r��_sitelocal_networkr[r
r
r�
is_site_local[szIPv6Address.is_site_localcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv6-special-registry.

        c3s|]}�|kVqdSrzr
r�r[r
rr�ssz)IPv6Address.is_private.<locals>.<genexpr>r�r[r
r[rr�is
zIPv6Address.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, true if the address is not reserved per
            iana-ipv6-special-registry.

        r�r[r
r
rr�us	zIPv6Address.is_globalcCs
|jdkS)r�rr�r[r
r
rr��s	zIPv6Address.is_unspecifiedcCs
|jdkS)r�r)r�r[r
r
rr��s	zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@�S)z�Return the IPv4 mapped address.

        Returns:
            If the IPv6 address is a v4 mapped address, return the
            IPv4 mapped address. Return None otherwise.

        rrN����r,r
r[r
r
r�ipv4_mapped�s	zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@�t|jd@�fS)z�Tuple of embedded teredo IPs.

        Returns:
            Tuple of the (server, client) IPs or None if the address
            doesn't appear to be a teredo address (doesn't start with
            2001::/32)

        �`i N�@r'r(r[r
r
r�teredo�s

�zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@�S)z�Return the IPv4 6to4 embedded address.

        Returns:
            The IPv4 6to4-embedded address if present or None if the
            address doesn't appear to contain a 6to4 embedded address.

        �pi N�Pr'r(r[r
r
r�	sixtofour�s	zIPv6Address.sixtofourN)rrrr	r}r�r~r�r�r�r�r&r�r�r�r�r�r�r)r,r/r
r
r
rrs8$





	










rc@s�eZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dSr�)ryrr�rr�r�rMr�r
r
rr��s

zIPv6Interface.__init__cCs|jjSrzr�r[r
r
rr��szIPv6Interface.hostmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)rr�rVr�rNrr
r
rr��szIPv6Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)rr�rVr�rNrr
r
rr��s�zIPv6Interface.__lt__cCst|j|jt|jj�f�Srzrr[r
r
rr��szIPv6Interface.__hash__cCs
t|j�Srz)rr,r[r
r
rr1�szIPv6Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_prefixlencCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_netmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_hostmaskcCs|jdko|jjS)Nr)r,r�r�r[r
r
rr�szIPv6Interface.is_unspecifiedcCs|jdko|jjSr�)r,r�r�r[r
r
rr�szIPv6Interface.is_loopbackN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r�r�r
r
r
rr�s(





rc@s2eZdZdZeZd
dd�Zdd�Zedd��Z	d	S)ravThis class represents and manipulates 128-bit IPv6 networks.

    Attributes: [examples for IPv6('2001:db8::1000/124')]
        .network_address: IPv6Address('2001:db8::1000')
        .hostmask: IPv6Address('::f')
        .broadcast_address: IPv6Address('2001:db8::100f')
        .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0')
        .prefixlen: 124

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)a�Instantiate a new IPv6 Network object.

        Args:
            address: A string or integer representing the IPv6 network or the
              IP and prefix/netmask.
              '2001:db8::/128'
              '2001:db8:0000:0000:0000:0000:0000:0000/128'
              '2001:db8::'
              are all functionally the same in IPv6.  That is to say,
              failing to provide a subnetmask will create an object with
              a mask of /128.

              Additionally, an integer can be passed, so
              IPv6Network('2001:db8::') ==
                IPv6Network(42540766411282592856903984951653826560)
              or, more generally
              IPv6Network(int(IPv6Network('2001:db8::'))) ==
                IPv6Network('2001:db8::')

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::1000/124 and not an
              IP address on a network, eg, 2001:db8::1/124.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.
        rr)cs
t��gSrz)rr
rr
rrIr	z&IPv6Network.__init__.<locals>.<lambda>N)ryrrOr�r�rMrrrr=r�r�r
r
rrr�s

�
zIPv6Network.__init__ccs<t|j�}t|j�}t|d|d�D]}|�|�Vq&dS)z�Generate Iterator over usable hosts in a network.

          This is like __iter__ except it doesn't return the
          Subnet-Router anycast address.

        r)Nr�r�r
r
rr�Ks

zIPv6Network.hostscCs|jjo|jjSr$)rOr&rHr[r
r
rr&Ws�zIPv6Network.is_site_localN)T)
rrrr	rr�r�r�r~r&r
r
r
rrs
0rc@s�eZdZed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�g
Zed�ed
�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�gZed�ZdS)�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z100::/64z	2001::/23z2001:2::/48z
2001:db8::/32z2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)	rrrrr�r�r�r#r%r
r
r
rr0gs<��r0)T)#r	�__version__r�r�r!rrrrrrrr!r(r2r6r@rJrRrXrY�total_orderingr:rSr�r
rrrr�r
rrrr0r
r
r
r�<module>sV
#7163:IuCR 5K\!pstats.cpython-38.opt-2.pyc000064400000046130151450073350011461 0ustar00U

e5d�j�@s�ddlZddlZddlZddlZddlZddlmZddlmZddgZ	Gdd�de
e�ZGdd�d�ZGdd	�d	�Z
d
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zedk�r|ddlZzddlZWnek
r�YnXGdd�dej�Zeej�dk�rejdZndZzPee�Zejdd�D]Ze� e��q,e!dej"d�e�#�e!dej"d�Wne$k
�rzYnXdS) �N)�Enum)�
cmp_to_key�Stats�SortKeyc@s8eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
d�ZdS)
r)�calls�ncalls)�
cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimecGs@|d}t�||�}||_|dd�D]}||j|<q&||_|S�Nr�)�str�__new__�_value_�_value2member_map_Z_all_values)�cls�values�value�objZother_value�r�/usr/lib64/python3.8/pstats.pyr-szSortKey.__new__N)
�__name__�
__module__�__qualname__ZCALLSZ
CUMULATIVEZFILENAMEZLINE�NAMEZNFLZPCALLSZSTDNAMEZTIMErrrrrr"sc@s�eZdZdd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdddddddddddddd�
Z	dd�Z
dd�Zdd�Zdd �Z
d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd6d0d1�Zd2d3�Zd4d5�ZdS)7rN)�streamcGsF|ptj|_t|�sd}n|d}|dd�}|�|�|j|�dSr)�sys�stdoutr#�len�init�add)�selfr#�args�argrrr�__init__Ys
zStats.__init__cCs�d|_g|_d|_d|_d|_d|_d|_t�|_i|_	i|_
|�|�z|��Wn8t
k
r�td|jrx|jdnd|jd��YnXdS)NrzInvalid timing data %s������file)�all_callees�files�fcn_list�total_tt�total_calls�
prim_calls�max_name_len�set�	top_level�stats�
sort_arg_dict�
load_stats�get_top_level_stats�	Exception�printr#)r)r+rrrr'cs(
��z
Stats.initc	Cs�|dkri|_dSt|t�rxt|d��}t�|�|_W5QRXz"t�|�}t�	|j
�d|}WnYnX|g|_n t|d�r�|�
�|j|_i|_|js�td|j|f��dS)N�rbz    �create_statsz.Cannot create or construct a %r object from %r)r:�
isinstancer�open�marshal�load�os�statr�ctime�st_mtimer2�hasattrrA�	TypeError�	__class__)r)r+�fZ
file_statsrrrr<vs*



�zStats.load_statscCs�|j��D]p\}\}}}}}|j|7_|j|7_|j|7_d|krZ|j�|�tt|��|j	kr
tt|��|_	q
dS)N)ZjprofilerZprofiler)
r:�itemsr5r6r4r9r(r&�func_std_stringr7)r)�func�cc�nc�tt�ct�callersrrrr=�szStats.get_top_level_statscGs�|s|St|�D]�}t|�t|�kr,t|�}|j|j7_|j|j7_|j|j7_|j|j7_|jD]}|j�|�qr|j	|j	kr�|j	|_	d|_
|j��D]<\}}||jkr�|j|}nddddif}t
||�|j|<q�q|S�Nr)�reversed�typerr2r5r6r4r9r(r7r3r:rN�add_func_stats)r)�arg_list�itemrPrGZ
old_func_statrrrr(�s(

z	Stats.addc	Cs(t|d��}t�|j|�W5QRXdS)N�wb)rCrD�dumpr:)r)r
rMrrr�
dump_stats�szStats.dump_stats)))rr-z
call count)))�r-zcumulative time))��rz	file name))��rzline number))��rz
function name))rdr`rbzname/file/line)))rr-zprimitive call count)))�rz
standard name)))�r-z
internal time)
rrr	rr
rrr
rrrrrcCst|jsni|_}i}|j��D]>\}}|}|r|s4q||krFd||<q|||<|dd�}q*q|D]
}||=qb|jS)Nrr-)r;�sort_arg_dict_defaultrN)r)�dictZbad_list�word�tupZfragmentrrr�get_sort_arg_defs�s 
zStats.get_sort_arg_defscGs\|sd|_|St|�dkrBt|dt�rBddddd�|dg}n:t|�dkr||dd�D] }t|�t|d�krZtd	��qZ|��}d
}d|_d}|D]B}t|t�r�|j	}|||d}|j|||d7_d}q�g}|j
��D]4\}\}	}
}}}
|�|	|
||f|t
|�|f�q�|jtt|�j�d
�g|_}|D]}|�|d��qB|S)Nrrrrrr)r-rrrgrgzCan't have mixed argument typerr.z, )�keyr-)r3r&rB�intrXrKrl�	sort_typerrr:rN�appendrO�sortr�	TupleComp�compare)r)Zfieldr+Z
sort_arg_defsZ
sort_tupleZ	connectorrjZ
stats_listrPrQrRrSrTrUr3�tuplerrr�
sort_stats�sF��


�
zStats.sort_statscCs|jr|j��|S�N)r3�reverse�r)rrr�
reverse_orders
zStats.reverse_ordercCs�|j}i|_}d}|��D]�\}\}}}}}	t|�}
tt|
��|krRtt|
��}i}|	��D]\}}
|
|t|�<q^|
|kr�t||
|||||f�||
<q|||||f||
<q|j}t�|_}|D]}|�t|��q�||_	d|_
d|_|SrV)r:rN�func_strip_pathr&rOrYr9r8r(r7r3r1)r)ZoldstatsZnewstatsr7rPrQrRrSrTrUZnewfuncZ
newcallers�func2�callerZold_topZnew_toprrr�
strip_dirss0
�
zStats.strip_dirsc
Cst|jr
dSi|_}|j��D]P\}\}}}}}||kr@i||<|��D]$\}}	||kr`i||<|	|||<qHqdSrv)r1r:rN)
r)r1rPrQrRrSrTrUr{r|rrr�calc_callees#s
zStats.calc_calleescCs|}t|t�rpzt�|�}Wn*tjk
rF|d|7}||fYSXg}|D]}|�t|��rP|�|�qPnzt|�}t|t	�r�d|kr�dkr�nnt
||d�}|d|�}n2t|t
�r�d|kr�|kr�nn|}|d|�}t|�t|�k�r|dt|�t|�|f7}||fS)Nz#   <Invalid regular expression %r>
gg�?g�?rz6   List reduced from %r to %r due to restriction <%r>
)rBr�re�compile�error�searchrOrpr&�floatrn)r)Zsel�list�msgZnew_listZrexrP�countrrr�eval_print_amount6s2
""�zStats.eval_print_amountcCs�|j}|jr*|jdd�}d|jd}nt|j���}d}|D]}|�|||�\}}q@t|�}|sld|fSt||j	d�|t|j�kr�d}|D] }tt
|��|kr�tt
|��}q�|d|fS)Nz   Ordered by: �
z!   Random listing order was used
rr/rg)r7r3ror�r:�keysr�r&r?r#rO)r)Zsel_list�widthZ	stat_listr�Z	selectionr�rPrrr�get_print_listPs$zStats.get_print_listcGs�|jD]}t||jd�q|jr,t|jd�d}|jD]}t|t|�|jd�q6t||jdd|jd�|j|jkr�td|jd|jd�td|j|jd�t|jd�|�|�\}}|r�|�	�|D]}|�
|�q�t|jd�t|jd�|S)Nr/�        zfunction calls� ��endr0z(%d primitive calls)zin %.3f seconds)r2r?r#r9�func_get_function_namer5r6r4r��print_title�
print_line)r)�amountr
�indentrPr�r�rrr�print_statshs(

zStats.print_statscGsz|�|�\}}|rv|��|�|d�|D]2}||jkrN|�|||j|�q*|�||i�q*t|jd�t|jd�|S)Nz	called...r/)r�r~�print_call_headingr1�print_call_liner?r#)r)r�r�r�rPrrr�
print_calleess
zStats.print_calleesc
Gsh|�|�\}}|rd|�|d�|D](}|j|\}}}}}	|�|||	d�q"t|jd�t|jd�|S)Nzwas called by...z<-r/)r�r�r:r�r?r#)
r)r�r�r�rPrQrRrSrTrUrrr�
print_callers�szStats.print_callersc
Csvtd�|�||jd�d}|j��D]0\}}}}}|r&tt|����}	t|	t�}qXq&|rrtd|d|jd�dS)Nz	Function r/Fr�z    ncalls  tottime  cumtime)	r?�ljustr#r:r�next�iterrBrt)
r)�	name_sizeZcolumn_titleZ	subheaderrQrRrSrTrUrrrrr��s
zStats.print_call_heading�->cCstt|��|�|d|jd�|s2t|jd�dSt|���}d}|D]�}t|�}||}	t|	t�r�|	\}
}}}
|
|kr�d|
|f}n
d|
f}d|�dd	t	|��t
|�t
|
�|f}|d
}n$d||	t
|j|d�f}|d}t||||jd�d}qFdS)
Nr�r�r/r.z%d/%dz%dz%s %s %s  %srfrgrz	%s(%r) %sr_)r?rOr�r#�sortedr�rBrt�rjustr&�f8r:)r)r��sourceZ	call_dictZarrowZclistr�rPr
rrRrQrSrTZsubstatsZ
left_widthrrrr��s0

�
zStats.print_call_linecCs"tdd|jd�td|jd�dS)Nz-   ncalls  tottime  percall  cumtime  percallr�r�zfilename:lineno(function)r/�r?r#rxrrrr��szStats.print_titlecCs�|j|\}}}}}t|�}||kr4|dt|�}t|�d�d|jd�tt|�d|jd�|dkrxtdd|jd�ntt||�d|jd�tt|�d|jd�|dkr�tdd|jd�ntt||�d|jd�tt|�|jd�dS)N�/�	r�r�rr�r/)r:rr?r�r#r�rO)r)rPrQrRrSrTrU�crrrr��szStats.print_line)r�)rr r!r,r'r<r=r(r^rhrlruryr}r~r�r�r�r�r�r�r�r�r�rrrrr7sD"

�'
c@seZdZdd�Zdd�ZdS)rrcCs
||_dSrv��comp_select_list)r)r�rrrr,�szTupleComp.__init__cCsF|jD]:\}}||}||}||kr0|S||kr|SqdSrVr�)r)�left�right�index�	direction�l�rrrrrs�s

zTupleComp.compareN)rr r!r,rsrrrrrr�srrcCs|\}}}tj�|�||fSrv)rF�path�basename)�	func_namer
rr
rrrrz�s
rzcCs|dS)Nrgr)rPrrrr��sr�cCsN|dd�dkrB|d}|�d�r<|�d�r<d|dd�S|Snd|SdS)	Nrg)�~r�<�>z{%s}rr-z	%s:%d(%s))�
startswith�endswith)r�r
rrrrO�srOcCs@|\}}}}}|\}}}	}
}||||||	||
t||�fSrv)�add_callers)�targetr�rQrRrSrTrUZt_ccZt_ncZt_ttZt_ctZ	t_callersrrrrYs
�rYcCs�i}|��D]\}}|||<q|��D]V\}}||krtt|t�rbtdd�t|||�D��||<q||||7<q&|||<q&|S)Ncss|]\}}||VqdSrvr)�.0�i�jrrr�	<genexpr>szadd_callers.<locals>.<genexpr>)rNrBrt�zip)r�r�Znew_callersrPr|rrrr�s

"
r�cCsd}|��D]}||7}q|SrV)r)rUrRrrrr�count_callss
r�cCsd|S)Nz%8.3fr)�xrrrr�(sr��__main__c@s�eZdZd6dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7�ProfileBrowserNcCs6tj�|�d|_d|_tj|_|dk	r2|�|�dS)N�% )	�cmd�Cmdr,�promptr:r$r%r#�do_read)r)�profilerrrr,7szProfileBrowser.__init__c	Cs�|��}g}|D]�}z|�t|��WqWntk
r>YnXz<t|�}|dksZ|dkrltd|jd�Wq|�|�WqWntk
r�YnX|�|�q|jr�t|j|�|�ntd|jd�dS)Nrrz#Fraction argument must be in [0, 1]r/�No statistics object is loaded.)	�splitrprn�
ValueErrorr�r?r#r:�getattr)r)�fnrr*Z	processedZtermZfracrrr�generic?s,
zProfileBrowser.genericcCsXtd|jd�td|jd�td|jd�td|jd�td|jd�td|jd�dS)NzArguments may be:r/z0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz-  what fraction of selected entries to print.z8* A regular expression; only entries with function namesz  that match it are printed.r�rxrrr�generic_helpWszProfileBrowser.generic_helpc
Csd|jrRz|j�|�Wq`tk
rN}ztd||f|jd�W5d}~XYq`Xntd|jd�dS)Nz$Failed to load statistics for %s: %sr/r�r)r:r(�OSErrorr?r#)r)r�errr�do_add_s*zProfileBrowser.do_addcCstd|jd�dS)Nz>Add profile info from given file to current statistics object.r/r�rxrrr�help_addhszProfileBrowser.help_addcCs|�d|�S)Nr��r��r)rrrr�
do_calleeskszProfileBrowser.do_calleescCstd|jd�|��dS)Nz6Print callees statistics from the current stat object.r/�r?r#r�rxrrr�help_calleesmszProfileBrowser.help_calleescCs|�d|�S)Nr�r�r�rrr�
do_callersqszProfileBrowser.do_callerscCstd|jd�|��dS)Nz6Print callers statistics from the current stat object.r/r�rxrrr�help_callerssszProfileBrowser.help_callerscCstd|jd�dS)Nr.r/rr�r�rrr�do_EOFwszProfileBrowser.do_EOFcCstd|jd�dS�NzLeave the profile browser.r/r�rxrrr�help_EOFzszProfileBrowser.help_EOFcCsdS)Nrrr�rrr�do_quit}szProfileBrowser.do_quitcCstd|jd�dSr�r�rxrrr�	help_quitszProfileBrowser.help_quitc
Cs�|r�zt|�|_Wnztk
rN}zt|jd|jd�WY�dSd}~XYn@tk
r�}z"t|jjd||jd�WY�dSd}~XYnX|d|_	n6t
|j	�dkr�|j	dd�}|�|�ntd|jd�dS)	Nrr/�:r�rg���z1No statistics object is current -- cannot reload.r)rr:r�r?r*r#r>rLrr�r&r�)r)r�errrrrr��szProfileBrowser.do_readcCs td|jd�td|jd�dS)Nz+Read in profile data from a specified file.r/z*Without argument, reload the current file.r�rxrrr�	help_read�szProfileBrowser.help_readcCs$|jr|j��ntd|jd�dS)Nr�r/r)r:ryr?r#r�rrr�
do_reverse�szProfileBrowser.do_reversecCstd|jd�dS)Nz/Reverse the sort order of the profiling report.r/r�rxrrr�help_reverse�szProfileBrowser.help_reversecs�|jstd|jd�dS|j���|rRt�fdd�|��D��rR|jj|���n<td|jd�tj�	�D]"\}}td||df|jd�qjdS)	Nr�r/c3s|]}|�kVqdSrvr)r�r��Zabbrevsrrr��sz)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %srr)
r:r?r#rl�allr�rurrhrN)r)rrmrrr�r�do_sort�s
zProfileBrowser.do_sortcCs td|jd�td|jd�dS)Nz.Sort profile data according to specified keys.r/z3(Typing `sort' without arguments lists valid keys.)r�rxrrr�	help_sort�szProfileBrowser.help_sortcs�fdd�tjD�S)Ncsg|]}|���r|�qSr)r�)r��a��textrr�
<listcomp>�s
z0ProfileBrowser.complete_sort.<locals>.<listcomp>)rrh)r)r�r*rr�r�
complete_sort�szProfileBrowser.complete_sortcCs|�d|�S)Nr�r�r�rrr�do_stats�szProfileBrowser.do_statscCstd|jd�|��dS)Nz.Print statistics from the current stat object.r/r�rxrrr�
help_stats�szProfileBrowser.help_statscCs$|jr|j��ntd|jd�dS)Nr�r/)r:r}r?r#r�rrr�do_strip�szProfileBrowser.do_stripcCstd|jd�dS)Nz<Strip leading path information from filenames in the report.r/r�rxrrr�
help_strip�szProfileBrowser.help_stripcCstd|jd�dS)NzShow help for a given command.r/r�rxrrr�	help_help�szProfileBrowser.help_helpcCs|r|SdSrvr)r)�stoprrrr�postcmd�szProfileBrowser.postcmd)N)rr r!r,r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�6s4
	r�rrgz*Welcome to the profile statistics browser.r/zGoodbye.)%r$rFrrDr�enumr�	functoolsr�__all__rrrrrrzr�rOrYr�r�r�rr��readline�ImportErrorr�r�r&�argvZinitprofileZbrowserr�r�r?r#Zcmdloop�KeyboardInterruptrrrr�<module>sP 
symtable.cpython-38.opt-2.pyc000064400000024315151450073350011764 0ustar00U

e5dU�	@sFddlZddlmZmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlZdddddgZdd�ZGd	d
�d
�Ze�ZGdd�d�ZGdd�de�ZGd
d�de�ZGdd�d�Zedk�rBddlZddlZeejd��Ze��Z W5QRXee ej!�"ejd�dd�Z#e#�$�D]$Z%e#�&e%�Z'e(e'e'�)�e'�*���qdS)�N)�USE�
DEF_GLOBAL�DEF_NONLOCAL�	DEF_LOCAL�	DEF_PARAM�
DEF_IMPORT�	DEF_BOUND�	DEF_ANNOT�	SCOPE_OFF�
SCOPE_MASK�FREE�LOCAL�GLOBAL_IMPLICIT�GLOBAL_EXPLICIT�CELL�symtable�SymbolTable�Class�Function�SymbolcCst�|||�}t||�S�N)�	_symtabler�_newSymbolTable)�code�filenameZcompile_type�top�r� /usr/lib64/python3.8/symtable.pyrsc@s$eZdZdd�Zdd�Zdd�ZdS)�SymbolTableFactorycCst��|_dSr)�weakrefZWeakValueDictionary�_SymbolTableFactory__memo��selfrrr�__init__szSymbolTableFactory.__init__cCs6|jtjkrt||�S|jtjkr,t||�St||�Sr)�typer�
TYPE_FUNCTIONr�
TYPE_CLASSrr)r"�tablerrrr�news


zSymbolTableFactory.newcCs8||f}|j�|d�}|dkr4|�||�}|j|<|Sr)r �getr()r"r'r�key�objrrr�__call__s
zSymbolTableFactory.__call__N)�__name__�
__module__�__qualname__r#r(r,rrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) rcCs||_||_i|_dSr)�_table�	_filename�_symbols)r"Z	raw_tablerrrrr#'szSymbolTable.__init__cCsN|jtkrd}nd|jj}|jjdkr6d�||j�Sd�||jj|j�SdS)N�z%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)�	__class__rr-r0�name�formatr1)r"Zkindrrr�__repr__,s
�zSymbolTable.__repr__cCs:|jjtjkrdS|jjtjkr$dS|jjtjkr6dSdS)N�moduleZfunction�class)r0r$rZTYPE_MODULEr%r&r!rrr�get_type9szSymbolTable.get_typecCs|jjSr)r0�idr!rrr�get_idCszSymbolTable.get_idcCs|jjSr)r0r5r!rrr�get_nameFszSymbolTable.get_namecCs|jjSr)r0�linenor!rrr�
get_linenoIszSymbolTable.get_linenocCst|jjtjk�Sr)�boolr0r$rr%r!rrr�is_optimizedLszSymbolTable.is_optimizedcCst|jj�Sr)r@r0�nestedr!rrr�	is_nestedOszSymbolTable.is_nestedcCst|jj�Sr)r@r0�childrenr!rrr�has_childrenRszSymbolTable.has_childrencCsdS)NFrr!rrr�has_execUszSymbolTable.has_execcCs|jj��Sr)r0�symbols�keysr!rrr�get_identifiersYszSymbolTable.get_identifierscCsT|j�|�}|dkrP|jj|}|�|�}|jjdk}t||||d�}|j|<|S)Nr��module_scope)r2r)r0rG�_SymbolTable__check_childrenr5r)r"r5Zsym�flags�
namespacesrKrrr�lookup\s
�zSymbolTable.lookupcs�fdd����D�S)Ncsg|]}��|��qSr)rO��.0�identr!rr�
<listcomp>gsz+SymbolTable.get_symbols.<locals>.<listcomp>)rIr!rr!r�get_symbolsfszSymbolTable.get_symbolscs��fdd��jjD�S)Ncs"g|]}|j�krt|�j��qSr)r5rr1�rQ�st�r5r"rrrSjs
�z0SymbolTable.__check_children.<locals>.<listcomp>�r0rD)r"r5rrWrZ__check_childrenis�zSymbolTable.__check_childrencs�fdd��jjD�S)Ncsg|]}t|�j��qSr)rr1rUr!rrrSos�z,SymbolTable.get_children.<locals>.<listcomp>rXr!rr!r�get_childrenns
�zSymbolTable.get_childrenN)r-r.r/r#r7r:r<r=r?rArCrErFrIrOrTrLrYrrrrr%s


c@sPeZdZdZdZdZdZdZdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dS)rNcst��fdd����D��S)Nc3s"|]}��jj|�r|VqdSr)r0rGrP�r"Z	test_funcrr�	<genexpr>}s�z-Function.__idents_matching.<locals>.<genexpr>)�tuplerIrZrrZrZ__idents_matching|szFunction.__idents_matchingcCs |jdkr|�dd��|_|jS)NcSs|t@Sr)r��xrrr�<lambda>��z)Function.get_parameters.<locals>.<lambda>)�_Function__params�_Function__idents_matchingr!rrr�get_parameters�s
zFunction.get_parameterscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSr�r
rr]�Zlocsrrr_�r`z%Function.get_locals.<locals>.<lambda>)�_Function__localsr
rrb�r"Ztestrrer�
get_locals�s

zFunction.get_localscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSrrdr]�Zglobrrr_�r`z&Function.get_globals.<locals>.<lambda>)�_Function__globalsrrrbrgrrir�get_globals�s

zFunction.get_globalscCs |jdkr|�dd��|_|jS)NcSs|t@Sr)rr]rrrr_�r`z(Function.get_nonlocals.<locals>.<lambda>)�_Function__nonlocalsrbr!rrr�
get_nonlocals�s
zFunction.get_nonlocalscCs$|jdkrdd�}|�|�|_|jS)NcSs|t?t@tkSr)r
rrr]rrrr_�r`z$Function.get_frees.<locals>.<lambda>)�_Function__freesrb)r"�is_freerrr�	get_frees�s
zFunction.get_frees)r-r.r/rarfrnrjrlrbrcrhrkrmrprrrrrssc@seZdZdZdd�ZdS)rNcCs6|jdkr0i}|jjD]}d||j<qt|�|_|jS)N�)�_Class__methodsr0rDr5r\)r"�drVrrr�get_methods�s

zClass.get_methods)r-r.r/rrrtrrrrr�sc@s�eZdZd$dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%rNFrJcCs.||_||_|t?t@|_|p d|_||_dS)Nr)�
_Symbol__name�_Symbol__flagsr
r�_Symbol__scope�_Symbol__namespaces�_Symbol__module_scope)r"r5rMrNrKrrrr#�s

zSymbol.__init__cCsd�|j�S)Nz<symbol {0!r}>)r6rur!rrrr7�szSymbol.__repr__cCs|jSr)rur!rrrr=�szSymbol.get_namecCst|jtj@�Sr)r@rvrrr!rrr�
is_referenced�szSymbol.is_referencedcCst|jt@�Sr)r@rvrr!rrr�is_parameter�szSymbol.is_parametercCs"t|jttfkp|jo|jt@�Sr)r@rwrrryrvrr!rrr�	is_global�s�zSymbol.is_globalcCst|jt@�Sr)r@rvrr!rrr�is_nonlocal�szSymbol.is_nonlocalcCst|jtk�Sr)r@rwrr!rrr�is_declared_global�szSymbol.is_declared_globalcCs"t|jttfkp|jo|jt@�Sr)r@rwr
rryrvrr!rrr�is_local�s�zSymbol.is_localcCst|jt@�Sr)r@rvr	r!rrr�is_annotated�szSymbol.is_annotatedcCst|jtk�Sr)r@rwrr!rrrro�szSymbol.is_freecCst|jt@�Sr)r@rvrr!rrr�is_imported�szSymbol.is_importedcCst|jt@�Sr)r@rvrr!rrr�is_assigned�szSymbol.is_assignedcCs
t|j�Sr)r@rxr!rrr�is_namespace�szSymbol.is_namespacecCs|jSr)rxr!rrr�get_namespaces�szSymbol.get_namespacescCs t|j�dkrtd��|jdS)Nrqz$name is bound to multiple namespacesr)�lenrx�
ValueErrorr!rrr�
get_namespace�szSymbol.get_namespace)N)r-r.r/r#r7r=rzr{r|r}r~rr�ror�r�r�r�r�rrrrr�s 
�__main__rq�exec)+rrrrrrrrr	r
rrr
rrrr�__all__rrrrrrrr-�os�sys�open�argv�f�read�src�path�split�modrIrRrO�info�printrr�rrrr�<module>s$DN,
M

pydoc.cpython-38.opt-2.pyc000064400000220241151450073350011256 0ustar00U

��.e̠�@s�dgZdZdZdZddlZddlZddlZddlZddl	Zddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZd	d
�Zdd�Zd
d�Zdd�Z dd�Z!dd�Z"dd�Z#e�$dej%�Z&dd�Z'dd�Z(dd�Z)dd�Z*dwd d!�Z+d"d#�Z,d$d%�Z-d&d'�Z.d(d)�Z/ifd*d+�Z0Gd,d-�d-e1�Z2d.d/�Z3difd0d1�Z4Gd2d3�d3�Z5Gd4d5�d5e�Z6Gd6d7�d7e5�Z7Gd8d9�d9e�Z8Gd:d;�d;e5�Z9Gd<d=�d=e9�Z:d>d?�a;d@dA�Z<dBdC�Z=dDdE�Z>dFdG�Z?dHdI�Z@dJdK�ZAdLdM�ZBdNdO�ZCdxdPdQ�ZDe9�ZEe:�ZFe7�ZGdydRdS�ZHdzdUdV�ZId{dWdX�ZJd|dYdZ�ZKd}d\d]�ZLGd^d_�d_�ZMeM�ZNGd`da�da�ZOdbdc�ZPddde�ZQd~dgdh�ZRddidjdk�dldm�ZSdndo�ZTdpdq�ZUdrds�ZVdtdu�ZWeXdvk�r�eW�dS)��helpzKa-Ping Yee <ping@lfw.org>z26 February 2001z�Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
�N)�deque)�Repr)�format_exception_onlycCs\g}g}tjD]H}tj�|pd�}tj�|�}||krtj�|�r|�|�|�|�q|S�N�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir�r�/usr/lib64/python3.8/pydoc.py�pathdirsPs

rcCs.t�|�pt�|�}|r*t�dd|���p,dS)Nz^ *
�)�inspect�getdocZgetcomments�re�sub�rstrip)�object�resultrrrr\srcCsf|���d�}t|�dkr&|ddfSt|�dkrX|d��sX|dd�|dd��fSdd�|�fS)N�
�rr�)�strip�split�lenr�join)�doc�linesrrr�splitdocasr%cCs"|j}|j|kr|jd|}|Sr)�__name__�
__module__)r�modname�namerrr�	classnamejs
r*cCs>t�|�p:t�|�p:t�|�p:t�|�p:t�|�p:t�|�S�N)r�ismodule�isclass�	isroutineZisframeZistracebackZiscode�rrrr�isdataqs����r0cGs.|r*|d�|�|d��}|dd�}q|S)Nrrr)r"r )�textZpairsrrr�replacewsr2cCsXt|�|krTtd|dd�}td|d|�}|d|�d|t|�|d�S|S)Nr�r�...)r!�max)r1�maxlenZpreZpostrrr�cram~s
$r7z at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)Nz\1)�_re_stripidr�r1rrr�stripid�sr:cCs<t�|�rdSt�|�r8t|dd�}t�|�p4|dkSdS)NT�__self__F)r�ismethod�	isbuiltin�getattrr,)�fn�selfrrr�_is_bound_method�s

rAcCs^i}t�|tj�D]\}}d||<q|jD]}|�t|��q*|��D]}t||�||<qF|S�Nr)r�
getmembersr.�	__bases__�update�
allmethods�keysr>)�cl�methods�key�value�baserrrrF�s

rFcCs8g}g}|D]"}||�r$|�|�q|�|�q||fSr+�r)�s�	predicateZyesZno�xrrr�_split_list�srQcCs\|dkrdS|�d�r$|�d�r$dS|�d�r<t|d�r<dS|dk	rL||kS|�d�SdS)N>�	__slots__�__date__�__path__�__qualname__�__builtins__�__credits__�__doc__�
__author__�__version__�__file__r&�
__cached__r'�
__loader__�__spec__�__package__r�__r�_�_fieldsT)�
startswith�endswith�hasattr)r)�all�objrrr�visiblename�srhcCsXg}t�|�D]D\}}}}t�|�r@d}t|t�r@|jdkr@d}|�||||f�q|S)N�data descriptor�readonly property)r�classify_class_attrs�isdatadescriptor�
isinstance�property�fsetr)r�resultsr)�kind�clsrKrrrrk�s
rkcs\t|dg��z�fdd�t��D��Wntk
r>i�YnX�fdd�}|j|d�dS)Nrbcsi|]\}}||t���qSr)r!)�.0�ir))�fieldsrr�
<dictcomp>�sz#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)�get)�attr)�field_orderrr�<lambda>��z!sort_attributes.<locals>.<lambda>�rJ)r>�	enumerate�	TypeError�sort)�attrsrZkeyfuncr)rzrur�sort_attributes�s
r�cCs:tj�|�r6dD]$}tj�tj�|d|��rdSqdS)N)z.pyz.pyc�__init__TF)r
r	r
�isfiler")r	�extrrr�	ispackage�s
r�cCs�|��}|dd�dks |��s0|��}|sq0q|��}|dd�dkrT|dd�}|dd�dkr�|dd�}|dd�dkr�|dd�}|��s�|��}|s�q�q�|�d�d	��}nd}|S)
Nr�#�zr"""r3�"""����\r)�readlinerr )�file�linerrrr�source_synopsis�s&r�c
	Cs t�|�j}|�|d�\}}|dks.||k�r|�ttjj��rJtjj	}n |�ttjj
��rftjj}nd}|dkr�zt�
|�}Wntk
r�YdSX|�t|�}W5QRXn^|d|�}tjjd||d�}ztj�|�}	WnYdSXtjd=|	j�r|	j��dnd}||f||<|S)N)NNZ__temp__��loaderr)r
�stat�st_mtimerxrd�tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr�modulesrX�
splitlines)
�filename�cache�mtimeZ
lastupdaterZ
loader_clsr�r��spec�modulerrr�synopsis�s6



�r�c@seZdZdd�Zdd�ZdS)�ErrorDuringImportcCs||_|\|_|_|_dSr+)r��excrK�tb)r@r��exc_inforrrr�#szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r&r�rK)r@r�rrr�__str__'szErrorDuringImport.__str__N)r&r'rUr�r�rrrrr�!sr�c		Cs�tjj}t|d��}||�t|��k}W5QRXtj�|�}tj�	|�\}}|r`tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����YnXdS)N�rbr�)r�r��MAGIC_NUMBERr��readr!r
r	�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r	�magicr�Zis_bytecoder�r)r�r�r�rrr�
importfile+sr�c	s z^|rT�tjkrT�tjkrT�fdd�tjD�}�g|D]}tj|||<tj|=q8t��}Wnzt��\}}}}	�tjkr�ttj�j|	��n>|tkr�t|j|	��n(t	|t
�r�|j�kr�YdSt�t����YnX��d�dd�D].}
zt
||
�}Wq�tk
�rYdSXq�|S)Ncsg|]}|��d�r|�qS)r)rc)rs�m�r	rr�
<listcomp>Qszsafeimport.<locals>.<listcomp>rr)rr��builtin_module_names�
__import__r�r�r[�SyntaxErrorr��
issubclass�ImportErrorr)r r>�AttributeError)r	�	forceloadr�ZsubsrJr�r�rKr��info�partrr�r�
safeimport=s.


r�c@sfeZdZej�ddejdd��Zddd�Z	d
dd�Z
e
ZZZ
ZZZe�d	�fd
d�ZdS)�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrcGs�||f|}zFt�|�r$|j|�WSt�|�r:|j|�WSt�|�rP|j|�WSWntk
rfYnXt�|�r||j	|�S|j
|�Sr+)rr,�	docmoduler-�docclassr.�
docroutiner�rl�docdata�docother)r@rr)�argsrrr�documentss




zDoc.documentcGs*d|odt|�t|�jf}t|��dS)Nz.don't know how to document object%s of type %s� )�repr�typer&r)r@rr)r��messagerrr�fail�s
�zDoc.failZstdlibcCs�zt�|�}Wntk
r&d}YnXtj�d|j�}tj�|�}t	|t
t��r�|jdksz|�|�r�|�tj�
|d��s�|jdkr�|�d�r�d|�d�|j��f}q�tj�
||j��d	�}nd}|S)
N�
(built-in)r�)
�errno�
exceptionsZgcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z%s/%s�/�.html)r�
getabsfilerr
�environrxr�r	rrmr�r&rcr"r�lower)r@rZbasedirr��doclocrrr�	getdocloc�s(
����
z
Doc.getdocloc)N)N)r&r'rUr
r�rxr�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfigZget_pathr�rrrrr�ms��

r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZeZdd�Z	eZ
d
S)�HTMLReprcCs,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r@rrrr��s
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)r2�r@r1rrr�escape�szHTMLRepr.escapecCst�||�Sr+)rr��r@rrrrr��sz
HTMLRepr.reprcCsZtt|�d�r@dd�t|�j���}t||�r@t||�||�S|�ttt	|��|j
��S�Nr&�repr_ra)rer�r"r&r r>r�r7r:r�r��r@rP�levelZ
methodnamerrr�repr1�s

zHTMLRepr.repr1cCs^t||j�}t|�}d|krJdt|dd�krJd|d|�|�|dSt�dd|�|��S)Nr��\\r�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r7r�r�r2r�rr�r@rPr�ZtestZtestreprrrr�repr_string�s�zHTMLRepr.repr_stringcCs@z|�ttt|��|j��WS|�d|jj�YSXdS�Nz
<%s instance>)r�r7r:r�r��	__class__r&�r@rPr�rrr�
repr_instance�szHTMLRepr.repr_instanceN)r&r'rUr�r�r�r�r��repr_strrZrepr_unicoderrrrr��sr�c@s�eZdZe�ZejZejZdd�Zd0dd�Zd1d	d
�Z	dd�Z
d
d�Zd2dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd�Zd3d d!�Zd4d"d#�Zddiifd$d%�Zd&d'�Zddiiidfd(d)�Zd5d*d+�ZeZd6d,d-�Zd7d.d/�ZdS)8�HTMLDoccCsd||fS)Nz�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>r)r@�title�contentsrrr�page�s�zHTMLDoc.pagercCsd|||||pdfS)Na'
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    �&nbsp;r)r@r�fgcol�bgcolZextrasrrr�heading�s�zHTMLDoc.heading�Nrc	
Cs^|dkrdd|d}d|||f}	|r@|	d||||f}	n|	d|||f}	|	d|S)Nz<tt>rz</tt>z�<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r@rr	r
r�widthZpreludeZ
marginaliaZgaprrrr�section�s�
��zHTMLDoc.sectioncGsd|}|j|f|��S)Nz<big><strong>%s</strong></big>)r)r@rr�rrr�
bigsectionszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)N�

z
 
r�rr�<br>
)r��
expandtabsr2r�rrr�	preformat
s�zHTMLDoc.preformatr�cCs�d}t|�|d|}t|�D]X}|dd|}t|||||�D]$}|t|�krJ||||�d}qJ|d}q d|S)Nrrz<td width="%d%%" valign=top>r�rz</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r!�range)r@�list�formatZcolsr�rows�colrtrrr�multicolumns
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rr�rrr�greyr|zHTMLDoc.greycGs*|D] }||krd|||fSq|S)N�<a href="%s">%s</a>r)r@r)Zdicts�dictrrr�namelinkszHTMLDoc.namelinkcCsN|jtj�|j�}}t||�rDt||�|krDd|j|t||�fSt||�S)Nz<a href="%s.html#%s">%s</a>)r&rr�rxr'rer>r*)r@rr(r)r�rrr�	classlink%s�zHTMLDoc.classlinkcCsd|j|jfS�Nz<a href="%s.html">%s</a>)r&r�rrr�
modulelink-szHTMLDoc.modulelinkcCsR|\}}}}|r|�|�S|r,d||f}nd|}|rBd|}n|}d||fS)Nz
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)r)r)r@Z
modpkginfor)r	r��shadowed�urlr1rrr�
modpkglink1s

zHTMLDoc.modpkglinkcCsd||fS)Nz<a href="file:%s">%s</a>r)r@r"r	rrr�filelink@szHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}|�||�}	|	s0�qh|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n�|r�dt|�}|�d|||�f�n�|�r"|||d�d	k�r|�d
|�	||��n|�d|�n@|||d�d	k�rP|�|�	||||��n|�|�	||��|}q|�|||d���d�
|�S)
NrzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;rz'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r�(zself.zself.<strong>%s</strong>r)r�r�compile�search�spanr�groupsr2�intrr")r@r1r��funcs�classesrIrp�here�pattern�match�start�endrfZschemeZrfcZpepZselfdotr)r"rrr�markupDs:

zHTMLDoc.markupc
Cs�d}|D]�}t|�td�kr�|\}}|d}||�||�}|r�||fkr�g}|D]}	|�|�|	|��qR|dd�|�d}|d}qt|�tg�kr|d|�|||�}qd	|S)
Nrrz"<dt><font face="helvetica, arial">r&�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r�rrr"�
formattree)
r@�treer(�parentr�entry�c�bases�parentsrLrrrr6os&
�
zHTMLDoc.formattreec#
s�|j}z
|j}Wntk
r(d}YnX|�d�}g}tt|�d�D],}|�dd�|d|d��||f�qHd�||dd��}	d|	}
z&t�	|�}t
j�|�}��
||�}
Wntk
r�d}
YnXg}t|d��r6t|j�}|dd�d	k�r"|dd�d
k�r"|dd���}|�d��|��t|d��rX|���t|j���|�rp|
d
d�|�}
��|�}|dk	�r�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|tj�D]Z\}}|dk	�s�t�|��p�||k�r�t|||��r�|�||f�d|||<||<�q�|D]�\}}|jD]n}|j|j}}tj �!|�}||k�r@|�r@t||��r@t"||�|k�r@||k�r@|d|||<||<�q@�q2gi}}t�|tj#�D]p\}}|dk	�s�t�$|��s�t�|�|k�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q�g}t�|t&�D]&\}}t|||��rN|�||f��qN��'t(|��j)||�}|�o�d|}|d|}t|d��rg}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n.|�r<��.|�fdd��}!|��0ddd|!�}|�r�d d!�|D�}"��1t�2|"d�|�g}!|D]"\}}|!���3|||||���qj|��0d"dd#d$�|!��}|�r�g}!|D]"\}}|!���3|||||���q�|��0d%dd&d$�|!��}|�r:g}!|D]\}}|!���3||���q|��0d'dd(d)�|!��}t|d*��rn��'t|j4��j)�}!|��0d+dd|!�}t|d,��r���'t|j5��j)�}!|��0d-dd|!�}|S).Nrrz5<a href="%s.html"><font color="#ffffff">%s</font></a>r��)<big><big><strong>%s</strong></big></big>r�rZ��$Revision: �$z
version %srSz (%s)r4z-<br><a href="%(docloc)s">Module Reference</a>r�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
rTrzPackage Contentsz#aa55cccs��|d�SrB)r ��tr�rrr{�r|z#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|�qSrr�rsrJrKrrrr��sz%HTMLDoc.docmodule.<locals>.<listcomp>ZClasses�#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55rrYZAuthorrWZCredits)6r&�__all__r�r rr!rr"rr��urllib�parseZquoter$rre�strrZrr�rSr��localsrrCr,r-�	getmodulerhrDr'rr�rxr>r.r=�
isfunctionr0r3rr�pkgutil�iter_modulesrTr�rr#rr6�getclasstreer�rYrW)#r@rr)�mod�ignoredrf�partsZlinksrtZ
linkedname�headr	r"r$r��versionr�rr�r-ZcdictrJrKrLr(r�r,Zfdict�datar#�modpkgs�importer�ispkgr�	classlistrr�rr��s*


��


$


�

�

 

���
��������zHTMLDoc.docmodulec	s��j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkr�����d�|D]}�d��|�j	��qd�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]n\}}}}d|d|�|<}zt�|�}Wntk
�r4YnXz|�|<Wq�t
k
�rXYq�Xq�|�rj|�rr|���n|dd�t|�fdd��\}}�tjk	�r��tjk�r�|}�q\n"��k�r�d}nd����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|}�q\d#�|	�}	||k�r�d$||f}nd%|||f}|�r�g}|D]}|���|�j	���q�|d&d'�|�}d#}zt���}Wntt
fk
�rd}YnX|�r8t|�}|�r8|d(k�r8|��|�d)}t��}|�rT||�pPd#}��|�j����}|�otd*|}��|d+d,|	d-|�S).Ncs eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrw�Zneedoner�rrrr�sz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)Nz<hr>
rr[r���pushrr�maybe	sz.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r&r'rUr�r^rr\rr�HorizontalRulesr`rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|r�����|�|D]d\}}}}zt�|�}Wn&tk
rf���||���YnX���||��������d�q&|S)Nr�rQr^r>�	Exceptionr�r���msgr�rO�okr)rq�homeclsrK�r-r,�hr�mdictrQrr]r@rr�spills"�
zHTMLDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr+�rQr^r�rd�rirQr]r@rr�spilldescriptors+sz*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|r�����|�|D]�\}}}}��t�|�|��}t|�sXt�|�rft|dd�}	nd}	|	dkr��d|�n0��t|��j	����}	d|	}	�d||	f��d�q&|S)NrXz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rQr^r�r>�callablerrlr3rr)
rer�rOrfr)rqrgrKrLr#rhrr�	spilldata4s(�
z#HTMLDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS�)rg�rh�rsr)rqrrrKr/rrr�Is
�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rcs|d�kS�NrrrC��	thisclassrrr{br|z"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scSs|ddkS�Nr�methodrrCrrrr{rr|zClass methods %scSs|ddkS�Nrzclass methodrrCrrrr{tr|zStatic methods %scSs|ddkS�Nrz
static methodrrCrrrr{vr|zReadonly properties %scSs|ddkS�NrrjrrCrrrr{xr|zData descriptors %scSs|ddkS�NrrirrCrrrr{zr|zData and other attributes %scSs|ddkS�NrrVrrCrrrr{|r|rz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)r4�()rz<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r3)r&rDrrr�getmror!r^rr'rkr>rcr�popleftrQ�builtinsrr�r"�	signature�
ValueErrorrJr�rr3rr)r@rr)rQr,r-rR�realnamer;rr`�mrorLrkrnrpr�rJrqrgrK�anchor�	inherited�tagrr<�declr��argspecr#r)	r-r,rirjrQrr]r@rwrr��s�
�
	
�

�

�
�
�
�
�
�

��
zHTMLDoc.docclasscCs|�d|�|��S�N�=)rr�r�rrr�formatvalue�szHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jpdd|}	d}
d}t|�r�|jj}|rZ||k	r�d|�||�}
n0|jdk	rzd|�|jj|�}
nd|�||�}
t�|�s�t�|�r�d}
nd}
||kr�d|	|f}nD|r�t�||g�|kr�d	|jd||f}d
}n|}d|	||f}d}t�	|��rlzt�
|�}Wnttfk
�r>d}YnX|�rlt
|�}|dk�rld
|}|d
d�}|�svd}|
||�|�|
�o�|�d|
�}|�r�d|S|�t|�|j|||�}|�o�d|}d||fSdS)Nrrtr� from � method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %s�<lambda>z$<strong>%s</strong> <em>lambda</em> r��(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r&rAr;rrr�iscoroutinefunction�isasyncgenfunction�getattr_staticr.r�r�rrJr�rr3rr)r@rr)rQr,r-rIrHr�r��note�skipdocs�imclass�asyncqualifierrZreallinkr�r�r�r#rrrr��s|
�
���

��zHTMLDoc.docroutinecCsNg}|j}|r|d|�|�t|�|j�}|r<|d|�|d�d�|�S)Nz!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
rar)rr3rrr"�r@rr)rQrHrpr]r#rrrr��szHTMLDoc.docdatacGs|rd|pd}||�|�S)Nz<strong>%s</strong> = r�r�)r@rr)rQrRZlhsrrrr��szHTMLDoc.docothercCs�g}|dkri}t�|g�D]<\}}}tdd�|D��r:q|�|d|||kf�d||<q|��|�||j�}|�|dd|�S)Ncss*|]"}dt|�kodknVqdS)i�i��N)�ord�rsZchrrr�	<genexpr>�sz HTMLDoc.index.<locals>.<genexpr>rrrArF)rNrO�anyrr�rr#r)r@rr!rWrXr)rYrrrr�index�s
z
HTMLDoc.index)r)rrNr)r�)N)NN)NNN)NN)N)r&r'rUr��_repr_instancer�r�rrrrrrrrrr r#r$r3r6r�r�r�r�r�r�r�r�rrrrr�sF

�

+

y&�
A

rc@s0eZdZdd�Zdd�Zdd�ZeZdd�Zd	S)
�TextReprcCs,t�|�d|_|_d|_d|_|_dSr�r�r�rrrr�
s
zTextRepr.__init__cCsTtt|�d�r@dd�t|�j���}t||�r@t||�||�Sttt|��|j	�Sr�)
rer�r"r&r r>r7r:r�r�r�rrrr�s

zTextRepr.repr1cCsHt||j�}t|�}d|krDdt|dd�krDd|d||dS|S)Nr�r�rr�r)r7r�r�r2r�rrrr�s
zTextRepr.repr_stringcCs4zttt|��|j�WSd|jjYSXdSr�)r7r:r�r�rr&rrrrr%szTextRepr.repr_instanceN)r&r'rUr�r�r�rrrrrrr�s
	r�c@szeZdZe�ZejZdd�Zddd�Zdd�Zdd
d�Z	ddd
�Z
ddd�Zdd�Zddd�Z
ddd�ZeZddd�ZdS)�TextDoccCsd�dd�|D��S)Nrcss|]}|d|VqdS)�Nrr�rrrr�5szTextDoc.bold.<locals>.<genexpr>)r"r�rrr�bold3szTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r4|d��|d<d�|�S)Nrcsg|]}�|�qSrr�rsr���prefixrrr�:sz"TextDoc.indent.<locals>.<listcomp>rr�)r rr")r@r1r�r$rr�r�indent7szTextDoc.indentcCs$|�|���}|�|�d|dS)Nrr)r�rr�)r@rrZclean_contentsrrrr>szTextDoc.sectionNrc
	s�d}|D]�}t|�td�krr|\}}||t|��}|rh||fkrh�fdd�|D�}	|dd�|	�}|d}qt|�tg�kr||�|�||d�}q|S)	Nrrc3s|]}t|��VqdSr+�r*)rsr:�r(rrr�Msz%TextDoc.formattree.<locals>.<genexpr>r�r4rr�)r�r*r"r6)
r@r7r(r8r�rr9r:r;r<rr�rr6Es"
�zTextDoc.formattreec	Cs$|j}tt|��\}}|�d||o(d|�}t|dd�}|�|�}|dk	r`||�d|d�}|rt||�d|�}g}	t�|tj�D]<\}
}|dk	s�t�	|�p�||kr�t
|
||�r�|	�|
|f�q�g}t�|tj�D]F\}
}|dk	�st�
|��st�	|�|kr�t
|
||�r�|�|
|f�q�g}
t�|t�D]&\}
}t
|
||��r.|
�|
|f��q.g}t�}t|d��r�t�|j�D]6\}}}|�|�|�r�|�|d�n
|�|��qx|��||�d	d
�|��}g}t�|tj�D]0\}
}|j�|d��r�|
|k�r�|�|
��q�|�r6|��||�dd
�|��}|	�r�d
d�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���qd||�dd
�|��}|�r�g}|D]\}
}|�|�||
|���q�||�dd
�|��}|
�r&g}|
D]"\}
}|�|j||
|dd���q�||�dd
�|��}t|d��r�t|j�}|dd�dk�rp|dd�dk�rp|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d��r�||�d t|j"��}zt�#|�}Wnt$k
�rd!}YnX||�d"|�}|S)#N�NAME� - rGzMODULE REFERENCEa.

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
ZDESCRIPTIONrT�
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|�qSrrrErrrr��sz%TextDoc.docmodule.<locals>.<listcomp>r�CLASSES�	FUNCTIONS�F)r6ZDATArZr>r?r�r@ZVERSIONrSZDATErYZAUTHORrWZCREDITSr�ZFILE)%r&r%rrr>r�rrCr-rLrhrr.r=r0�setrerNrOrT�addr�r"r,rcr6rPr�r�rJrZrrSrYrWr�r)r@rr)rQZsynop�descrrfr�r-rJrKr,rVrWZ
modpkgs_namesrXr(rYZ
submodulesrZrrUr�rrrr�Us�
	�
��
��
�
$
zTextDoc.docmodulec	sL�j}|p|}�j}�jfdd�}||kr:d��|�}n��|�d|}|rlt||�}	|dd�|	�}g}
|
j�zt���}Wnt	t
fk
r�d}YnX|r�t|�}|r�|dkrʈ||d�t��}
|
r�|
d�t
t����}t|�d	k�r*�d
�|D]}�d||���q
�d�td
d�t���D�tjd�}t|�}d}|�r��d�|d|�D]}�d|��qn||k�r��dt||�d��d�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r|�r*|���n|dd	�t|�fdd ��\}}�tjk	�rn�tjk�rn|}�qn ��k�r~d!}nd"t��j�}t|��|d#||d$d ��}|d%||d&d ��}|d'||d(d ��}|d)||d*d ��}|d+||d,d ��}|d-||d.d ��}|}�qd�|
�}
|
�s0|dS|d��|
��d/�dS)0NcSs
t||�Sr+r�)r:r�rrr�makename�sz"TextDoc.docclass.<locals>.makename�class z	 = class r�r4r�rrzMethod resolution order:r�rcss.|]&}|j�d�s|jdkrt|j�VqdS)rar�N)r&rcr'rJ)rsrrrrrr��s
�z#TextDoc.docclass.<locals>.<genexpr>r}r�zBuilt-in subclasses:z    ... and z other subclassescs eZdZdd�Z�fdd�ZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrwr[r�rrrr��sz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)NzF----------------------------------------------------------------------rr[r�r\rrr^�sz.TextDoc.docclass.<locals>.HorizontalRule.maybeNr_rr\rrr`�sr`c
s�t||�\}}|r~����|�|D]V\}}}}zt�|�}Wn&tk
rf���||���Yq&X���||����q&|Sr+rbrd�rirQrr]r@rrrk�s�zTextDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr+rlrdrmrrrnsz*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|r�����|�|D]v\}}}}t|�sDt�|�rNt|�}nd}zt�|�}	Wntk
r~|j|}	YnX��j	|	|�d|d�d�q&|S)Nr�)r6r#r)
rQr^rorrlrr>r��__dict__r�)
rer�rOrfr)rqrgrKr#rgr�rrrps 
�z#TextDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qSrqrrrsr/rrr�+s
�z$TextDoc.docclass.<locals>.<listcomp>rcs|d�kSrurrCrvrrr{4r|z"TextDoc.docclass.<locals>.<lambda>rxryzMethods %s:
cSs|ddkSrzrrCrrrr{Cr|zClass methods %s:
cSs|ddkSr|rrCrrrr{Er|zStatic methods %s:
cSs|ddkSr}rrCrrrr{Gr|zReadonly properties %s:
cSs|ddkSr~rrCrrrr{Ir|zData descriptors %s:
cSs|ddkSrrrCrrrr{Kr|zData and other attributes %s:
cSs|ddkSr�rrCrrrr{Mr|z |  )r&rDr'r��mapr"rrr�r�rrJrrr�r!�sortedr��__subclasses__r�rkr�rQr�rr*r�r�r)r@rr)rQrRr�r;r�rr<rr�r�r#r�rLZ
subclassesZno_of_subclassesZMAX_SUBCLASSES_TO_DISPLAYZsubclassnamer`rkrnrpr�r�r�r)rirQrr]r@rwrr��s�

�

��	
�

�

�
�
�
�
�
�
zTextDoc.docclasscCsd|�|�Sr�r�r�rrrr�WszTextDoc.formatvaluec	Cs�|j}|p|}d}d}t|�rn|jj}|rB||k	rndt||�}n,|jdk	r`dt|jj|�}ndt||�}t�|�s�t�|�r�d}	nd}	||kr�|�|�}
n,|r�t�	||g�|kr�d}|�|�d|}
d}t�
|��r<zt�|�}Wntt
fk
�rd}YnX|�r<t|�}|d	k�r<|�|�d
}
|dd�}|�sFd}|	|
||}
|�rd|
d
St|��ppd}|
d
|�o�|�|���d
SdS)Nrrr�r�r�r�r� = r�z lambda r�r�r)r&rAr;rr*rr�r�r�r�r.r�r�rrJrr�r)r@rr)rQrHr�r�r�r�r�rr�r�r�r#rrrr�[sV
�
�

zTextDoc.docroutinecCsTg}|j}|r$||�|��|d�t|�p.d}|rJ||�|��|d�d�|�S)Nrr)rr�rr�r"r�rrrr��szTextDoc.docdatac
Cs�|�|�}|rF|r|dpd|}|t|�}	|	dkrF|d|	�d}|rX|�|�dpZd|}|dk	r~|d|�t|��7}|S)Nr�rrr4r)r�r!r�r�rJ)
r@rr)rQr8r6r#r�r�Zchoprrrr��s
zTextDoc.docother)r�)Nr)NN)NN)NNN)NNN)NNNNN)r&r'rUr�r�r�r�r�rr6r�r�r�r�r�r�r�rrrrr�+s


e

7
r�c@seZdZdd�ZdS)�
_PlainTextDoccCs|Sr+rr�rrrr��sz_PlainTextDoc.boldN)r&r'rUr�rrrrr��sr�cCst�at|�dSr+)�getpager�pagerr9rrrr��sr�c	s@ttjd�stSttjd�s tStj��r4tj��s8tStj�d�pNtj�d���r�tj	dkrj�fdd�Stj�d�dkr��fd	d�S�fd
d�Stj�d�dkr�tStj	dkr�dd�Sttd�r�t�
d
�dkr�dd�Sddl}|��\}}t�
|�z8ttd��r$t�
d|�dk�r$dd�W�StW�SW5t�|�XdS)N�isattyZMANPAGERZPAGER�win32cstt|���Sr+��
tempfilepager�plainr9�Z	use_pagerrrr{�r|zgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscstt|���Sr+)�	pipepagerr�r9r�rrr{�r|cs
t|��Sr+�r�r9r�rrr{�r|cSstt|�d�S)Nzmore <r�r9rrrr{�r|�systemz(less) 2>/dev/nullrcSs
t|d�S)NZlessr�r9rrrr{�r|z	more "%s"cSs
t|d�S)NZmorer�r9rrrr{�r|)rer�stdin�
plainpager�stdoutr�r
r�rx�platformr��tempfileZmkstemp�close�unlink�ttypager)r��fdr�rr�rr��s6


 r�cCst�dd|�S)Nz.r)rrr9rrrr��sr�c	Cs�ddl}|j|d|jd�}zDtj|jdd��*}z|�|�Wntk
rPYnXW5QRXWntk
rrYnXz|�	�Wq�Wqttk
r�YqtXqtdS)NrT)�shellr��backslashreplace)�errors)
�
subprocess�Popen�PIPE�io�
TextIOWrapperr��write�KeyboardInterruptr��wait)r1�cmdr��proc�piperrrr��sr�c
Cs~ddl}|���d}tj�|d�}t|ddtjdkr<t�d�ndd��}|�	|�W5QRXt�
|d|d�W5QRXdS)	Nrz	pydoc.out�wr�r�)r��encodingz "r%)r�ZTemporaryDirectoryr
r	r"r�rr��device_encodingr�r�)r1r�r�Ztempdirr�r�rrrr��s
��r�cCs$ttjdd�pd}|�|d��|�S)Nr��utf-8r�)r>rr��encode�decode)r1r�rrr�_escape_stdoutsr�c
Cs�tt|���d�}z2ddl}tj��}|�|�}|�|�dd�}Wn(t	t
tjfk
rld}dd�}YnX�z0zttj�dd��}Wntk
r�d}YnX|dkr�d}|d}}tj�d�|d|��d�||d��r�tj�d	�tj��|�}	|	d
k�rtj�d��q�n,|	dk�rJtj�d||d�|d}q�|	d
k�rn|||}|dk�rnd}tj�dd�||||��d�||}q�W5|�r�|�
||j|�XdS)NrrcSstj�d�SrB)rr�r�rrrrr{r|zttypager.<locals>.<lambda>cSstj��dd�dd�S)Nr�r)rr�r�rrrrr{r|ZLINESr�z
-- more --)�q�Qz
          
)�
r)�b�B�)r�r�r �ttyrr��filenoZ	tcgetattrZ	setcbreakr�r�r��UnsupportedOperationZ	tcsetattrZ	TCSAFLUSHr+r
r�rxr�r�r�r"�flush)
r1r$r�r��oldZgetchar�hr�Zincr:rrrr�	sL








&r�cCstj�tt|���dSr+)rr�r�r�r�r9rrrr�5sr�cCs�t�|�r>|jtjkr d|jSt|d�r4d|jSd|jSt�|�rRd|jSt�|�rtd|jj	|jj|jfSt�
|�r�d|jj	|jj|jfSt�|�r�d|jSt�|�r�d	|jSt�
|�r�d
|jSt|�jS)Nzbuilt-in module rTzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr�z	function zmethod )rr,r&rr�rer=Zisgetsetdescriptor�__objclass__r'Zismemberdescriptorr-rMr<r�)�thingrrr�describe9s6







�
�





r�c	Cs�dd�|�d�D�}d\}}|t|�kr\td�|d|d��|�}|r\||d}}qq\q|rf|}nt}||d�D],}zt||�}Wqvtk
r�YdSXqv|S)NcSsg|]}|r|�qSrr)rsr�rrrr�Vszlocate.<locals>.<listcomp>rrwr)r r!r�r"r�r>r�)r	r�rSr��nZ
nextmodulerr�rrr�locateTs r�cCsVt|t�r0t||�}|dkr(td|��||fSt|dd�}|t|t�rL|ndfSdS)Nz~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.r&)rmrJr�r�r>)r�r�rr)rrr�resolvems

�r�� Python Library Documentation: %scCs�|dkrt}t||�\}}t|�}t�|�}|rTd|krT|d|d|�d��7}n|rn||k	rn|d|j7}t�|�s�t�|�s�t�	|�s�t�
|�s�t|�}|d7}||d|�||�S)Nrz in z in module z objectr)
r1r�r�rrL�rfindr&r,r-r.rlr�r�)r�rr�Zrendererrr)r�r�rrr�
render_doc{s&

���rc
Csfz2|dkrtt|||��n|�t|||t��Wn.ttfk
r`}zt|�W5d}~XYnXdSr+)r�rr��	plaintextr�r��print)r�rr��outputrKrrrr#�sr#c
Cs�z`t||�\}}t�t|�t�||��}t|dddd��}|�|�W5QRXtd|d�Wn.tt	fk
r�}zt|�W5d}~XYnXdS)Nr�r�r�)r�Zwrote)
r��htmlrr�r�r�r�rr�r�)r�r�rr)rr�rKrrr�writedoc�srrcCs2|dkri}t�|g|�D]\}}}t|�qdSr+)rN�
walk_packagesr)r�pkgpathZdonerXr(rYrrr�	writedocs�s

r
cJ@s"eZdZddddddddddd	d
ddd
ddddddddddddddddddddd�#Zd d!�d"D�Zd�e�d'd(d)d*d+d,d-�Zd.d/d0d1d2d3d4d5d6d7d8d9d9d:d:d;�Ze��D]:\ZZ	e	D],Z
e�e
e�Zeekr�ed<eZeee
<q�q�d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdLdMdNdOdPdQddRdSdSdTdUdVdWdXdYdZd[d\d]d^d_d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{ddd|d}d~dd��IZd�d�d��Z
ed�d���Zed�d���Zd�d��Ze�Zefd�d��Zd�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d�d��Zd�d��Zd�d�d��Z d�S)��Helperr�BOOLEAN�with)�assertr)�asyncr)�awaitr)�break�	while for)�classzCLASSES SPECIALMETHODS)�continuer)Zfunctionr)�del�BASICMETHODS�if)�elser�try)�forzbreak continue while�import)�globalznonlocal NAMESPACES)r�
TRUTHVALUE)r�MODULES)�in�SEQUENCEMETHODS�
COMPARISON)�lambdar�)�nonlocalzglobal NAMESPACES)�passr)�raise�
EXCEPTIONS)�returnr�)rr&)�whilezbreak continue if TRUTHVALUE)r
z CONTEXTMANAGERS EXCEPTIONS yield)�yieldr)#�False�None�True�and�asrrrrrr�defr�elifr�except�finallyr�fromrrrr�isr"r#�not�orr$r%r'rr(r
r)cCsg|]}dD]}||�qqS)��'r%r)rs�pr�rrrr��szHelper.<listcomp>)r��fr��ur8�'''r%r�)�+rt�*�**r�z//�%�<<�>>r��|�^�~r�r��<=�>=�==�!=�<>)r�r�rFrGrHrIrJ)rtrE)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rArBr�rCrDrE)�j�J)�STRINGS�	OPERATORSr!�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classrM�PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)r@r?�,rr4�:�@r�rar`�`r&r5�[�]r�)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES)zstring-methodszSTRINGS FORMATTING)Z
formatstringsrN)r]z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES)ZnumberszINTEGER FLOAT COMPLEX TYPES)Zintegersz	int range)Zfloatingz
float math)Z	imaginaryz
complex cmath)Ztypesseqz$STRINGMETHODS FORMATTING range LISTS�DICTIONARIES)Ztypesfunctionsz	def TYPES)Ztypesmethodszclass def CLASSES TYPES)zbltin-code-objectszcompile FUNCTIONS TYPES)zbltin-type-objectsztypes TYPES�TYPES)zbltin-null-objectr)zbltin-ellipsis-object�SLICINGS)Zspecialattrsr)r\z!class SPECIALMETHODS PRIVATENAMES)Ztypesmodulesr)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES�EXPRESSIONS)Zobjectsr_)ZspecialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES)Z
customizationzhash repr str SPECIALMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS)zcallable-typeszCALLS SPECIALMETHODS)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS)rbzMAPPINGS SPECIALMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS)Z	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS)Znamingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES)zdynamic-featuresr�
NAMESPACES)r�ztry except finally raise)Zconversionsr)Zidentifierszkeywords SPECIALIDENTIFIERS)z
id-classesr)zatom-identifiersr)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�	SEQUENCES)Z	exprlistszTUPLES LITERALS)ztypesseq-mutable�LISTLITERALS)ZlistszLISTS LITERALS)Ztypesmapping�DICTIONARYLITERALS)rzDICTIONARIES LITERALS)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS)Z
subscriptionsr )Zslicingsr )Zcallsra)Zpowerra)Zunaryra)Zbinaryra)Zshiftingra)Zbitwisera)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEr)Z
assignmentrP)Z	augassign�
NUMBERMETHODSrr')Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersr
)Ir_rMZ
STRINGMETHODSZ
FORMATTING�UNICODEZNUMBERSZINTEGERZFLOATrRrdZMAPPINGSr�ZMETHODSZCODEOBJECTSZTYPEOBJECTSZFRAMEOBJECTSZ
TRACEBACKSZNONErTZSPECIALATTRIBUTESr�rZPACKAGESrarNZ
PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSr ZMAPPINGMETHODSrgZ	EXECUTIONrcZDYNAMICFEATURESZSCOPINGZFRAMESr&ZCONVERSIONSZIDENTIFIERSZSPECIALIDENTIFIERSrUZLITERALSZTUPLESZ
TUPLELITERALSZLISTSrer^rfZ
ATTRIBUTESZ
SUBSCRIPTSr`ZCALLSrSrOZBINARYZSHIFTINGrQr!rZ	ASSERTIONZ
ASSIGNMENTrPZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGrZ	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dSr+)�_input�_output)r@�inputrrrrr�^szHelper.__init__cCs|jp
tjSr+)rjrr�r�rrrrlbszHelper.inputcCs|jp
tjSr+)rkrr�r�rrrrfsz
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)Nrr3�?rz<%s.%s instance>)r�stackrr'rUr�rrr�__repr__js�zHelper.__repr__cCs6||jk	r|�|�n|��|��|j�d�dS)Na
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
)�_GoInteractiver�intro�interactrr��r@Zrequestrrr�__call__rs

zHelper.__call__c	Cs�|j�d�z|�d�}|s Wq�Wnttfk
r>Yq�YnX|��}t|�dkr�|d|dkrpdkr�nn |d|dd�kr�|dd�}|��dkr�q�|d	kr�|��q|�	|�qdS)
Nrzhelp> rrr�r7r)r��quitr)
rr��getliner��EOFErrorrr!r�rqrrsrrrrrs"

,�
zHelper.interactcCs8|jtjkrt|�S|j�|�|j��|j��SdSr+)rlrr�rr�r�r�)r@�promptrrrrv�s

zHelper.getlinecCs<t|�td�k�r|��}|dkr,|��n�|dkr>|��n�|dkrP|��n�|dkrb|��n�|dd�dkr�|�|��d�n�||jkr�|�|�nj|d	kr�t	t
|�d
�nR||jkr�|�|�n<||j
kr�|�|�n&|r�t	|d
|jd�nt	td
|jd�n$t|t��r|�nt	|d
|jd�|j�d�dS)
Nr�keywords�symbols�topicsr��zmodules r)r,r*r+zHelp on %s:)rr)r�r�listkeywords�listsymbols�
listtopics�listmodulesr rz�
showsymbolr#�evalry�	showtopicr{rkrJrmrrr�rsrrrr�s6






zHelper.helpcCs$|j�d�dtjdd���dS)Na�
Welcome to Python {0}'s help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/{0}/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
z%d.%dr)rr�rrr�r�rrrrq�s
�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D]v}t|�D]\}|||}|t|�kr<|j�||�||dkr<|j�dd|dt||��q<|j�d�q0dS)Nrr�r)rr�r!rrr�)	r@�items�columnsr
Zcolwr�rowrrtrrrr�s&zHelper.listcCs |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rr�rryrGr�rrrr}�szHelper.listkeywordscCs |j�d�|�|j���dS)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rr�rrzrGr�rrrr~�szHelper.listsymbolscCs |j�d�|�|j���dS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rr�rr{rGr�rrrr�szHelper.listtopicscCs0zddl}Wn"tk
r.|j�d�YdSX|j�||j�|��}|sb|j�dt|��dSt|�td�kr~|�	||�S|\}}z|jj|}Wn*t
k
r�|j�dt|��YdSX|��d}|r�|p�dd|}|�r$ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nr�t
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrr��Related help topics: r4�Hz
%s
)�pydoc_data.topicsr�rr�r{rxryr�r�r��KeyErrorr�textwrapr"r Zwrapr�)r@�topic�
more_xrefs�
pydoc_data�target�label�xrefsr#r�r1Zwrapped_textrrrr��s4zHelper.showtopiccCs�zddl}Wntk
r"YdSX|j�||j�|��}|sFtd��t|t�r\|�||�S|\}}|jj|}|r�|pzdd|}||fS)Nr)r�rzcould not find topicrr�)	r�r�r{rxryr�rmrJ�	_gettopic)r@r�r�r�r�r�r�r#rrrr�s	
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)rz�	partitionr�)r@�symbolr�r�rar�rrrr�!s
zHelper.showsymbolcsv|r |j�d�|��t|�nR|j�d�i}|fdd���fdd�}t�j�|d�|�|���|j�d�dS)	Nzy
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

zI
Please wait a moment while I gather a list of all available modules...

cSs>|r$|dd�dkr$|dd�d}|�d�dkr:d||<dS)N����	.__init__r�rrr)�find)r	r(r�r�rrr�callback4sz$Helper.listmodules.<locals>.callbackcs�d|d�dSr+rr��r�rr�onerror9sz#Helper.listmodules.<locals>.onerror�r�z�
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
)rr�r�apropos�
ModuleScanner�runrrG)r@rJr�r�rr�rr�&s
�
zHelper.listmodules)r8r<r%r�)NN)r�r�)r)r)r)!r&r'rUryZ_strprefixesZ_symbols_inverserzr�r�Zsymbols_r�rxr{r�rnrlrrorrprtrrrvrrqrr}r~rr�r�r�r�rrrrr�sB�'���W



	


 
rc@seZdZddd�ZdS)r�Nc	Cs
|r|��}d|_i}tjD]p}|dkrd||<|dkrF|d|d�qt|�jpRd}|�d�d}|d|}|���|�dkr|d||�qtj	|d�D�]\\}	}}
|jr��q�|dkr�|d|d�q�zt�
|	|�}Wntk
r�Yq�YnX|j}t
|d	��rnz|�|�}
Wn(tk
�r:|�r2||�Yq�YnXtt�|
���pNd}t
|d
��rh|�|�}nd}n`ztj�|�}Wn(tk
�r�|�r�||�Yq�YnX|j�r�|j��dnd}t|dd�}|d|}|���|�dkr�||||�q�|�r|�dS)NF�__main__rrrrr�r��
get_source�get_filenamer[)r�rurr�r�rXr r�rNr�	_get_specr�r�rer�rcr�r��StringIOr�r�r�r�r�r�r>)r@r�rJZ	completerr��seenr(r)r�rXrYr�r��sourcer	r�rrrr�Gs`



zModuleScanner.run)NNN)r&r'rUr�rrrrr�Dsr�c	CsDdd�}dd�}t���"t�d�t�j|||d�W5QRXdS)NcSs6|dd�dkr |dd�d}t||o.d|�dS�Nr�r�r�z- )r�r	r(r�rrrr��szapropos.<locals>.callbackcSsdSr+rr�rrrr��szapropos.<locals>.onerror�ignorer�)�warnings�catch_warnings�filterwarningsr�r�)rJr�r�rrrr��s


r�cs�ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	s�|j
s�t�d�q~|S)	Nrc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsX|j�d�rd}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)Nz.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8r�)	r	rdZ
send_responseZsend_headerZend_headersZwfiler��
urlhandlerr�)r@�content_typerrr�do_GET�s

��z(_start_server.<locals>.DocHandler.do_GETcWsdSr+r)r@r�rrr�log_message�sz-_start_server.<locals>.DocHandler.log_messageN)r&r'rUr�r�rrrr�
DocHandler�sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�hostZaddressr�rLr��handlerru)r@r��portr�rrrr��s
z)_start_server.<locals>.DocServer.__init__cs>|js2��|j��gggd�\}}}|r|��q|��dSrB)ru�selectZsocketr�Zhandle_requestZserver_close)r@ZrdZwrZex�r�rr�serve_until_quit�s

z1_start_server.<locals>.DocServer.serve_until_quitcSs |j�|�|jr|�|�dSr+)rL�server_activater�r�rrrr��sz0_start_server.<locals>.DocServer.server_activateN)r&r'rUr�r�r�rr�rr�	DocServer�sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�r+r��Threadr��serving�error)r@r�r�r�)�	threadingrrr��s
z,_start_server.<locals>.ServerThread.__init__c
sxzJ�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�Wn(tk
rr}z
||_W5d}~XYnXdSr+)�server�
HTTPServerrLr�r�ZMessageZMessageClass�staticmethodr�r�r��ready�	docserverr�rcr�)r@Zdocsvr�e)r�r��email�httprrr�	s

z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r�r�Zserver_portr�r")r@r�rrrr�	sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)NTF)r�rur"r�r"r�rrr�stop	s
z(_start_server.<locals>.ServerThread.stopN)r&r'rUr�r�r�r�r)r�r�r�r�r�rr�ServerThread�s
r�g{�G�z�?)
Zhttp.serverZ
email.messager�r�r�ZBaseHTTPRequestHandlerr�r�r1r�r��time�sleep)r��hostnamer�r��threadr)r�r�r�r�r�r�r�
_start_server�s8'r�r�c
s(G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�r�|dd�}|dk�rtj�tj�t��}tj�||�}t|��}d�|�	��W5QR�SQRXn|dk�r||�St
d||f��dS)NcseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccsd}d|}d||��|fS)Nzpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">a<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>r)r@rr�css_pathZcss_link��html_navbarrrr2	s���z#_url_handler.<locals>._HTMLDoc.pageN)r&r'rUrrr�rr�_HTMLDoc0	sr�cs>��dt��t��dt��f�}d|��tjdd��fS)Nz%s [%s, %s]raZ
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            T)Zterse)r�r�Zpython_versionZpython_buildZpython_compiler)rU�rrrr�B	s
��z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��qT|�d�dd
�|�fS)NcSsd||fSrr�r)rrr�	bltinlink`	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>rArBcSsg|]}|dkr|�qS)r�r)rsr)rrrr�f	s�z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in ModulesrFz|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</font>zIndex of Modulesr)	rrr�rrr	rr�r")r�r�namesrr�rr�rr�
html_index]	s*��
�z _url_handler.<locals>.html_indexc		s�g��fdd�}t���*t�d�dd�}t�j|||d�W5QRXdd�}g}��d	d
d�}�D]\}}|�||�|�qf|��d|d
d
d�|��}d|fS)Ncs:|dd�dkr |dd�d}��||o0d|f�dSr�rMr��Z
search_resultrrr�{	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSsdSr+rr�rrrr��	sz2_url_handler.<locals>.html_search.<locals>.onerrorr�cSsd||fSrrr�rrrr��	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>rArBzkey = %srF�<br>zSearch Results)	r�r�r�r�r�rrrr")	rJr�r�r�rprr)r�rr�r�r�html_searchv	s,

��z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)NcSsd||fS�Nz<a href="topic?key=%s">%s</a>rr�rrrr��	sz4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>rArBZTopicsrF)rr�rr{rGrr)r�rr�rr�rr�html_topics�	s��z!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)Nr�rArBcSsd||fSr�rr�rrrr��	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsrF)rr�rryrGrr)rr�r�rr�rr�
html_keywords�	s��z#_url_handler.<locals>.html_keywordscs�t��}t||�}|�|�\}}||jkr0d}nd}��d|dd�}d��|�}��|dd|�}|r�t|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
NZKEYWORDZTOPICr=rArBz
<pre>%s</pre>rFcSsd||fSr�rr�rrrr��	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkr�z%s %sr)
r�r�rr�ryrr3rr�r rrr")r�ZbufZhtmlhelprr�rrr�r�rr�html_topicpage�	s2

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dkr$|dkr$td��t|�}��||�}||fS)Nr)r�r+zcould not find object)r�r�r�r�)r"rgr�contentr�rr�html_getobj�	sz!_url_handler.<locals>.html_getobjcsP��ddd�}d��fdd�tt|�|�D��}|��|dd|�}d||fS)	Nz,<big><big><strong>Error</strong></big></big>rArBr�c3s|]}��|�VqdSr+)r�r�r�rrr��	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rr"rr�r)r"r�rrr�rr�
html_error�	s���z _url_handler.<locals>.html_errorc
sr|}|�d�r|dd�}�z|dkr2��\}}n�|dkrF��\}}n�|dkrZ��\}}n�d|k�r$|�d�\}}}|dkr��|�\}}n�|dkr�z�|�\}}Wn tk
r��|�\}}YnXn\|d	k�r|dkr��\}}n4z�|�\}}Wn"tk
�r�|�\}}YnXntd
��n�|�\}}Wn2tk
�rd}z�||�\}}W5d}~XYnX��||�S)Nr����)rr�r{ryr�z
search?keyz	topic?keyzget?keyz
bad pydoc url)rdr�r�rcr)r"Zcomplete_urlrr��oprar�)rr�r�r�r�r�r�r�rr�
get_html_page�	s>



 z#_url_handler.<locals>.get_html_pager�rr�rr�z"unknown content type %r for url %s)rrcr
r	�dirname�realpathr[r"r��	readlinesr)r"r�r�r�Z	path_herer��fpr)	rr�r�r�r�r�r�r�r�r�_url_handler'	s*	
(


"
r�T�	localhost)�open_browserr�c	Cs�ddl}tt||�}|jr(t|j�dS|jr�d}|rB|�|j�z~zZtd|j�t|�|jr�t	d�}|�
�}|dkr|q�qZ|dkr�|�|j�qZt|�qZWnttfk
r�t�YnXW5|jr�|��td�XdS)Nrz"Server commands: [b]rowser, [q]uitzServer stoppedzServer ready atzserver> r�r�)
�
webbrowserr�r�r�rr�r�r"r�rlr�r�rw)r�r�r�r�ZserverthreadZserver_help_msgr�rrr�browse
s2
r�cCst|t�o|�tj�dkSrw)rmrJr�r
�sep)rPrrr�ispath9
sr�cCsvd|kstj|kst��|kr"dStj�t�}tj�|�}|��}||krbtj�||�sb|�|�|�	dt���|S)Nrr)
r
�curdir�getcwdr	r�r[�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path<
s

r�cCs,ttjtjd�}|dk	r(|tjdd�<dSrw)r�rr	�argv)r�rrr�_adjust_cli_sys_pathX
sr�cCs�ddl}Gdd�dt�}t��zv|�tjdd�d�\}}d}d}d}d}d}|D]\\}	}
|	dkrld	}d	}|	d
kr�t|
�WdS|	dkr�d	}|
}|	dkr�d	}|	d
krTd	}|
}qT|r�t|||d�WdS|s�|�|D]�}t|��rtj	�
|��std|��q�z`t|��r&tj	�|��r&t
|�}|�rXt|��rNtj	�|��rNt|�nt|�n
t�|�Wq�tk
�r�}zt|�W5d}~XYq�Xq�WnN|j|fk
�r�tj	�tj	�tjd��d}
tdj|
tjd��YnXdS)Nrc@seZdZdS)zcli.<locals>.BadUsageN)r&r'rUrrrr�BadUsagee
sr�rzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exista�pydoc - the Python documentation tool

{cmd} <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '{sep}', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

{cmd} -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

{cmd} -n <hostname>
    Start an HTTP server with the given hostname (default: localhost).

{cmd} -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

{cmd} -b
    Start an HTTP server on an arbitrary unused port and open a Web browser
    to interactively browse documentation.  This option can be used in
    combination with -n and/or -p.

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
)r�r�)�getoptrcr�rr�r�r�r�r
r	�existsrr�r�r
r
rrr�r�r�r�rr�)r�r�Zoptsr�ZwritingZstart_serverr�r�r��opt�val�argrKr�rrr�clib
sd

 �rr�)NN)r)r)rrN)rrN)r)rN)r�)r)YrGrYrSrWr�Zimportlib._bootstrapr�Zimportlib._bootstrap_external�importlib.machinery�importlib.utilrr�r
rNr�rrr�r�r�Zurllib.parserHr��collectionsr�reprlibr�	tracebackrrrr%r*r0r2r7r'�
IGNORECASEr8r:rArFrQrhrkr�r�r�r�rcr�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r1rrr�rr#rr
rrr�r�r�r�r�r�r�r�rr&rrrr�<module>'s�
	


'
0:*> ",

�
�


=
n%
U
smtplib.cpython-38.opt-1.pyc000064400000105434151450073350011617 0ustar00U

e5dɯ�
@srdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZdddddd	d
ddd
dddg
ZdZdZdZdZdZdZe�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z Gdd
�d
e�Z!Gdd�de�Z"Gd d�de�Z#Gd!d
�d
e�Z$d"d�Z%d#d$�Z&d%d�Z'd&d'�Z(d(d)�Z)zddl*Z*Wne+k
�r�d*Z,YnXd+Z,Gd,d�d�Z-e,�r�Gd-d.�d.e-�Z.e�/d.�d/Z0Gd0d1�d1e-�Z1e2d2k�rnd3d4�Z3e3d5�Z4e3d6��5d7�Z6e7d8�d9Z8ej9�:�Z;e;�s*�q6e8e;Z8�qe7d:e<e8��e-d;�Z=e=�>d<�e=�?e4e6e8�e=�@�dS)=aSMTP/ESMTP client class.

This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).

Notes:

Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RCPT
and MAIL commands!

Example:

  >>> import smtplib
  >>> s=smtplib.SMTP("localhost")
  >>> print(s.help())
  This is Sendmail version 8.8.4
  Topics:
      HELO    EHLO    MAIL    RCPT    DATA
      RSET    NOOP    QUIT    HELP    VRFY
      EXPN    VERB    ETRN    DSN
  For more info use "HELP <topic>".
  To report bugs in the implementation send email to
      sendmail-bugs@sendmail.org.
  For local information send email to Postmaster at your site.
  End of HELP info
  >>> s.putcmd("vrfy","someone@here")
  >>> s.getreply()
  (250, "Somebody OverHere <somebody@here.my.org>")
  >>> s.quit()
�N)�body_encode�
SMTPException�SMTPNotSupportedError�SMTPServerDisconnected�SMTPResponseException�SMTPSenderRefused�SMTPRecipientsRefused�
SMTPDataError�SMTPConnectError�
SMTPHeloError�SMTPAuthenticationError�	quoteaddr�	quotedata�SMTP�i��
s
i �z	auth=(.*)c@seZdZdZdS)rz4Base class for all exceptions raised by this module.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/smtplib.pyrHsc@seZdZdZdS)rz�The command or option is not supported by the SMTP server.

    This exception is raised when an attempt is made to run a command or a
    command with an option which is not supported by the server.
    NrrrrrrKsc@seZdZdZdS)rz�Not connected to any SMTP server.

    This exception is raised when the server unexpectedly disconnects,
    or when an attempt is made to use the SMTP instance before
    connecting it to a server.
    NrrrrrrRsc@seZdZdZdd�ZdS)ra2Base class for all exceptions that include an SMTP error code.

    These exceptions are generated in some instances when the SMTP
    server returns an error code.  The error code is stored in the
    `smtp_code' attribute of the error, and the `smtp_error' attribute
    is set to the error message.
    cCs||_||_||f|_dS�N)�	smtp_code�
smtp_error�args)�self�code�msgrrr�__init__cszSMTPResponseException.__init__N�rrrrr!rrrrrZsc@seZdZdZdd�ZdS)rz�Sender address refused.

    In addition to the attributes set by on all SMTPResponseException
    exceptions, this sets `sender' to the string that the SMTP refused.
    cCs"||_||_||_|||f|_dSr)rr�senderr)rrr r#rrrr!oszSMTPSenderRefused.__init__Nr"rrrrrhsc@seZdZdZdd�ZdS)rz�All recipient addresses refused.

    The errors for each recipient are accessible through the attribute
    'recipients', which is a dictionary of exactly the same sort as
    SMTP.sendmail() returns.
    cCs||_|f|_dSr)�
recipientsr)rr$rrrr!}szSMTPRecipientsRefused.__init__Nr"rrrrrusc@seZdZdZdS)r	z'The SMTP server didn't accept the data.Nrrrrrr	�sc@seZdZdZdS)r
z&Error during connection establishment.Nrrrrrr
�sc@seZdZdZdS)rz"The server refused our HELO reply.Nrrrrrr�sc@seZdZdZdS)rzvAuthentication error.

    Most probably the server didn't accept the username/password
    combination provided.
    Nrrrrrr�scCs>tj�|�\}}||fdkr6|���d�r.|Sd|Sd|S)z�Quote a subset of the email addresses defined by RFC 821.

    Should be able to handle anything email.utils.parseaddr can handle.
    ��r&�<z<%s>)�email�utils�	parseaddr�strip�
startswith�Z
addrstringZdisplayname�addrrrrr
�scCs$tj�|�\}}||fdkr |S|S)Nr%)r(r)r*r-rrr�
_addr_only�sr/c	Cst�ddt�dt|��S)z�Quote data for email.

    Double leading '.', and change Unix newline '\n', or Mac '\r' into
    Internet CRLF end-of-line.
    z(?m)^\.z..�(?:\r\n|\n|\r(?!\n))��re�sub�CRLF��datarrrr�s�cCst�dd|�S)Ns(?m)^\.s..)r2r3)Zbindatarrr�_quote_periods�sr7cCst�dt|�S)Nr0r1r5rrr�	_fix_eols�sr8FTc@szeZdZdZdZdZdZdZdZdZ	dZ
eZddde
jdfdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�ZdNdd�Zdd�ZdOdd�Zdd�ZdPdd�ZdQdd�ZdRdd �Zd!d"�ZdSd#d$�Zd%d&�Zd'd(�Zd)d*�Z dTd,d-�Z!dUd.d/�Z"d0d1�Z#d2d3�Z$e$Z%d4d5�Z&d6d7�Z'd8d9�d:d;�Z(dVd<d=�Z)dWd>d?�Z*dXd@dA�Z+d8d9�dBdC�Z,dYdDdE�Z-dZdFdG�Z.d[dHdI�Z/dJdK�Z0dLdM�Z1dS)\ra�This class manages a connection to an SMTP or ESMTP server.
    SMTP Objects:
        SMTP objects have the following attributes:
            helo_resp
                This is the message given by the server in response to the
                most recent HELO command.

            ehlo_resp
                This is the message given by the server in response to the
                most recent EHLO command. This is usually multiline.

            does_esmtp
                This is a True value _after you do an EHLO command_, if the
                server supports ESMTP.

            esmtp_features
                This is a dictionary, which, if the server supports ESMTP,
                will _after you do an EHLO command_, contain the names of the
                SMTP service extensions this server supports, and their
                parameters (if any).

                Note, all extension names are mapped to lower case in the
                dictionary.

        See each method's docstrings for details.  In general, there is a
        method of the same name to perform each SMTP command.  There is also a
        method called 'sendmail' that will do an entire mail transaction.
        rN�ehlor&c
Cs�||_||_i|_d|_||_d|_|rR|�||�\}}|dkrR|��t||��|dk	rb||_	nPt
��}d|krz||_	n8d}	zt
�t
�
��}	Wnt
jk
r�YnXd|	|_	dS)aInitialize a new instance.

        If specified, `host` is the name of the remote host to which to
        connect.  If specified, `port` specifies the port to which to connect.
        By default, smtplib.SMTP_PORT is used.  If a host is specified the
        connect method is called, and if it returns anything other than a
        success code an SMTPConnectError is raised.  If specified,
        `local_hostname` is used as the FQDN of the local host in the HELO/EHLO
        command.  Otherwise, the local hostname is found using
        socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host,
        port) for the socket to bind to as its source address before
        connecting. If the host is '' and port is 0, the OS default behavior
        will be used.

        �asciir��N�.z	127.0.0.1z[%s])�_host�timeout�esmtp_features�command_encoding�source_address�_auth_challenge_count�connect�closer
�local_hostname�socketZgetfqdnZ
gethostbynameZgethostnameZgaierror)
r�host�portrEr>rArr Zfqdnr.rrrr!�s,
z
SMTP.__init__cCs|Srr�rrrr�	__enter__szSMTP.__enter__cGsNz>z$|�d�\}}|dkr$t||��Wntk
r:YnXW5|��XdS)NZQUIT��)rD�docmdrr)rrr�messagerrr�__exit__s
z
SMTP.__exit__cCs
||_dS)z�Set the debug output level.

        A non-false value results in debug messages for connection and for all
        messages sent to and received from the server.

        N)�
debuglevel)rrOrrr�set_debuglevel"szSMTP.set_debuglevelcGs@|jdkr,ttj����f|�dtji�nt|dtji�dS)N��file)rO�print�datetimeZnow�time�sys�stderr�rrrrr�_print_debug+s
"zSMTP._print_debugcCs2|jdkr|�d||f|j�t�||f||j�S)Nrzconnect: to)rOrYrArF�create_connection)rrGrHr>rrr�_get_socket1s

�zSMTP._get_socket�	localhostcCs�|r
||_|s||�d�|�d�kr||�d�}|dkr||d|�||dd�}}zt|�}Wntk
rztd��YnX|s�|j}t�d|||�|�	|||j
�|_d|_|�
�\}}|jdkr�|�dt|��||fS)apConnect to a host on a given port.

        If the hostname ends with a colon (`:') followed by a number, and
        there is no port specified, that suffix will be stripped off and the
        number interpreted as the port number to use.

        Note: This method is automatically invoked by __init__, if a host is
        specified during instantiation.

        �:rNrQznonnumeric portzsmtplib.connect�connect:)rA�find�rfind�int�
ValueError�OSError�default_portrV�auditr[r>�sockrR�getreplyrOrY�repr)rrGrHrA�irr rrrrC9s&

zSMTP.connectcCs�|jdkr|�dt|��|jr|t|t�r6|�|j�}t�	d||�z|j�
|�Wq�tk
rx|��t
d��Yq�Xnt
d��dS)zSend `s' to the server.rzsend:zsmtplib.send�Server not connectedzplease run connect() firstN)rOrYrhrf�
isinstance�str�encoder@rVreZsendallrcrDr)r�srrr�sendZs

z	SMTP.sendcCsd|dkr|}n|�d|��}d|ks,d|krN|�dd��dd�}td|����|�|�t���dS)	zSend a command to the server.r&� �
�
z\nz\rz=command and arguments contain prohibited newline characters: N)�replacerbror4)r�cmdrrnrrr�putcmdms�zSMTP.putcmdc
CsPg}|jdkr|j�d�|_z|j�td�}Wn:tk
rj}z|��tdt|���W5d}~XYnX|s�|��td��|j	dkr�|�
dt|��t|�tkr�|��t
dd	��|�|d
d��d��|dd�}zt|�}Wn tk
�rd
}Y�q YnX|dd
�dkr�q qd�|�}|j	dk�rH|�
d||f�||fS)a�Get a reply from the server.

        Returns a tuple consisting of:

          - server response code (e.g. '250', or such, if all goes well)
            Note: returns -1 if it can't read response code.

          - server response string corresponding to response code (multiline
            responses are converted to a single, multiline string).

        Raises SMTPServerDisconnected if end-of-file is reached.
        N�rbrQz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:i�zLine too long.�s 	
�����-�
zreply: retcode (%s); Msg: %a)rRrfZmakefile�readline�_MAXLINErcrDrrlrOrYrh�lenr�appendr+rarb�join)r�resp�line�erZerrcode�errmsgrrrrgzs>

�


z
SMTP.getreplycCs|�||�|��S)z-Send a command, and return its response code.�rurg)rrtrrrrrL�sz
SMTP.docmdcCs,|�d|p|j�|��\}}||_||fS)zwSMTP 'helo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        �helo)rurErg�	helo_resp)r�namerr rrrr��sz	SMTP.heloc
Cs.i|_|�|j|p|j�|��\}}|dkrJt|�dkrJ|��td��||_|dkr`||fSd|_	|j�
d��d�}|d=|D]�}t�
|�}|r�|j�dd	�d
|�d�d|jd<q�t�
d|�}|r�|�d���}|j|�d�d
���}	|dk�r|j�|d	�d
|	|j|<q�|	|j|<q�||fS)zx SMTP 'ehlo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        ryrrj�rQzlatin-1rr�authr&rpz((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?�featureN)r?ru�ehlo_msgrErgr~rDr�	ehlo_resp�
does_esmtp�decode�split�
OLDSTYLE_AUTH�match�get�groupsr2�group�lower�string�endr+)
rr�rr r��eachZ
auth_match�mr�Zparamsrrrr9�sB
��

��z	SMTP.ehlocCs|��|jkS)z7Does the server support a given SMTP service extension?)r�r?)r�optrrr�has_extn�sz
SMTP.has_extncCs|�d|�|��dS)z;SMTP 'help' command.
        Returns help text from server.�helprQr�rXrrrr��sz	SMTP.helpcCsd|_|�d�S)z&SMTP 'rset' command -- resets session.r:�rset)r@rLrIrrrr��sz	SMTP.rsetcCs&z|��Wntk
r YnXdS)aInternal 'rset' command which ignores any SMTPServerDisconnected error.

        Used internally in the library, since the server disconnected error
        should appear to the application when the *next* command is issued, if
        we are doing an internal "safety" reset.
        N)r�rrIrrr�_rset�sz
SMTP._rsetcCs
|�d�S)z-SMTP 'noop' command -- doesn't do anything :>�noop)rLrIrrrr�	sz	SMTP.nooprcCshd}|rH|jrHtdd�|D��r:|�d�r2d|_ntd��dd�|�}|�dd	t|�|f�|��S)
a8SMTP 'mail' command -- begins mail xfer session.

        This method may raise the following exceptions:

         SMTPNotSupportedError  The options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.
        r&css|]}|��dkVqdS)�smtputf8N)r�)�.0�xrrr�	<genexpr>szSMTP.mail.<locals>.<genexpr>r�zutf-8z SMTPUTF8 not supported by serverrp�mailz	FROM:%s%s)	r��anyr�r@rr�rur
rg)rr#�options�
optionlistrrrr�
s	

�z	SMTP.mailcCs<d}|r|jrdd�|�}|�ddt|�|f�|��S)z;SMTP 'rcpt' command -- indicates 1 recipient for this mail.r&rp�rcptzTO:%s%s)r�r�rur
rg)rZrecipr�r�rrrr�"s

z	SMTP.rcptcCs�|�d�|��\}}|jdkr0|�d||f�|dkrDt||��n|t|t�r\t|��d�}t	|�}|dd�t
kr||t
}|dt
}|�|�|��\}}|jdkr�|�d||f�||fSdS)	a�SMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.  If msg
        is a string, lone '\r' and '\n' characters are converted to
        '\r\n' characters.  If msg is bytes, it is transmitted as is.
        r6rzdata:ibr:���N�.)rurgrOrYr	rkrlr8rmr7�bCRLFro)rr r�repl�qrrrr6*s"





z	SMTP.datacCs|�dt|��|��S)z5SMTP 'verify' command -- checks for address validity.�vrfy�rur/rg�rZaddressrrr�verifyGszSMTP.verifycCs|�dt|��|��S)z.SMTP 'expn' command -- expands a mailing list.�expnr�r�rrrr�Nsz	SMTP.expncCsb|jdkr^|jdkr^d|��dkr0dks^n|��\}}d|krRdks^nt||��dS)abCall self.ehlo() and/or self.helo() if needed.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        N��ri+)r�r�r9r�r)rrr�rrr�ehlo_or_helo_if_neededUs
zSMTP.ehlo_or_helo_if_neededT��initial_response_okc	Cs�|��}|r|�nd}|dk	rPt|�d�dd�}|�d|d|�\}}d|_n|�d|�\}}d|_|d	kr�|jd7_t�|�}t||��d�dd�}|�|�\}}|jtkrftd
t	||f���qf|dkr�||fSt
||��dS)a�Authentication command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - the valid values are those listed in the 'auth'
        element of 'esmtp_features'.

        'authobject' must be a callable object taking a single argument:

                data = authobject(challenge)

        It will be called to process the server's challenge response; the
        challenge argument it is passed will be a bytes.  It should return
        an ASCII string that will be base64 encoded and sent to the server.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.
        Nr:r&)ZeolZAUTHrprQriNz4Server AUTH mechanism infinite loop. Last response: ���i�)�upper�
encode_base64rmrLrB�base64Zdecodebytes�
_MAXCHALLENGErrhr)	rZ	mechanismZ
authobjectr�Zinitial_responseZresponserr��	challengerrrr�fs2
�

��z	SMTP.authcCs0|dkrdS|jdt�|j�d�|d���S)zh Authobject to use with CRAM-MD5 authentication. Requires self.user
        and self.password to be set.Nrpr:Zmd5)�user�hmacZHMAC�passwordrmZ	hexdigest�rr�rrr�
auth_cram_md5�s
�zSMTP.auth_cram_md5cCsd|j|jfS)ze Authobject to use with PLAIN authentication. Requires self.user and
        self.password to be set.z%s%s)r�r�r�rrr�
auth_plain�szSMTP.auth_plaincCs"|dks|jdkr|jS|jSdS)ze Authobject to use with LOGIN authentication. Requires self.user and
        self.password to be set.N�)rBr�r�r�rrr�
auth_login�szSMTP.auth_logincs�|��|�d�std��|jd���dddg}�fdd�|D�}|sPtd��|||_|_|D]t}d	|���	d
d�}z4|j
|t||�|d�\}}	|d
kr�||	fWSWqbtk
r�}
z|
}W5d}
~
XYqbXqb|�dS)awLog in on an SMTP server that requires authentication.

        The arguments are:
            - user:         The user name to authenticate with.
            - password:     The password for the authentication.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method will return normally if the authentication was successful.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
         SMTPAuthenticationError  The server didn't accept the username/
                                  password combination.
         SMTPNotSupportedError    The AUTH command is not supported by the
                                  server.
         SMTPException            No suitable authentication method was
                                  found.
        r�z,SMTP AUTH extension not supported by server.zCRAM-MD5ZPLAINZLOGINcsg|]}|�kr|�qSrr)r�r��Zadvertised_authlistrr�
<listcomp>�s�zSMTP.login.<locals>.<listcomp>z(No suitable authentication method found.Zauth_�-�_r�r�N)
r�r�rr?r�rr�r�r�rsr��getattrr)rr�r�r�Zpreferred_authsZauthlistZ
authmethodZmethod_namerr�r�Zlast_exceptionrr�r�login�s0
�
�
z
SMTP.logincCs�|��|�d�std��|�d�\}}|dkr�ts<td��|dk	rT|dk	rTtd��|dk	rl|dk	rltd��|dk	s||dk	r�d	dl}|�d
t	d�|dkr�t
j||d�}|j|j
|jd
�|_
d|_d|_d|_i|_d	|_n
t||��||fS)a�Puts the connection to the SMTP server into TLS mode.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        If the server supports TLS, this will encrypt the rest of the SMTP
        session. If you provide the keyfile and certfile parameters,
        the identity of the SMTP server and client can be checked. This,
        however, depends on whether the socket module really checks the
        certificates.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        �starttlsz+STARTTLS extension not supported by server.ZSTARTTLSr;z&No SSL support included in this PythonN�4context and keyfile arguments are mutually exclusive�5context and certfile arguments are mutually exclusiver�Akeyfile and certfile are deprecated, use a custom context insteadr���certfile�keyfile�Zserver_hostname)r�r�rrL�	_have_ssl�RuntimeErrorrb�warnings�warn�DeprecationWarning�ssl�_create_stdlib_context�wrap_socketrfr=rRr�r�r?r�r)rr�r��contextr�Zreplyr�rrrr��sB
����
z
SMTP.starttlscCs^|��g}t|t�r$t|��d�}|jrZ|�d�rF|�dt|��|D]}|�|�qJ|�	||�\}}	|dkr�|dkr�|�
�n|��t||	|��i}
t|t�r�|g}|D]H}|�
||�\}}	|dkr�|dkr�||	f|
|<|dkr�|�
�t|
��q�t|
�t|�k�r|��t|
��|�|�\}}	|dk�rZ|dk�rH|�
�n|��t||	��|
S)a|This command performs an entire mail transaction.

        The arguments are:
            - from_addr    : The address sending this mail.
            - to_addrs     : A list of addresses to send this mail to.  A bare
                             string will be treated as a list with 1 address.
            - msg          : The message to send.
            - mail_options : List of ESMTP options (such as 8bitmime) for the
                             mail command.
            - rcpt_options : List of ESMTP options (such as DSN commands) for
                             all the rcpt commands.

        msg may be a string containing characters in the ASCII range, or a byte
        string.  A string is encoded to bytes using the ascii codec, and lone
        \r and \n characters are converted to \r\n characters.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.  If the server does ESMTP, message size
        and each of the specified options will be passed to it.  If EHLO
        fails, HELO will be tried and ESMTP options suppressed.

        This method will return normally if the mail is accepted for at least
        one recipient.  It returns a dictionary, with one entry for each
        recipient that was refused.  Each entry contains a tuple of the SMTP
        error code and the accompanying error message sent by the server.

        This method may raise the following exceptions:

         SMTPHeloError          The server didn't reply properly to
                                the helo greeting.
         SMTPRecipientsRefused  The server rejected ALL recipients
                                (no mail was sent).
         SMTPSenderRefused      The server didn't accept the from_addr.
         SMTPDataError          The server replied with an unexpected
                                error code (other than a refusal of
                                a recipient).
         SMTPNotSupportedError  The mail_options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.

        Note: the connection will be open even after an exception is raised.

        Example:

         >>> import smtplib
         >>> s=smtplib.SMTP("localhost")
         >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
         >>> msg = '''\
         ... From: Me@my.org
         ... Subject: testin'...
         ...
         ... This is a test '''
         >>> s.sendmail("me@my.org",tolist,msg)
         { "three@three.org" : ( 550 ,"User unknown" ) }
         >>> s.quit()

        In the above example, the message was accepted for delivery to three
        of the four addresses, and one was rejected, with the error code
        550.  If all addresses are accepted, then the method will return an
        empty dictionary.

        r:�sizezsize=%dr�i��)r�rkrlr8rmr�r�rr~r�rDr�rr�rr6r	)r�	from_addr�to_addrsr �mail_options�rcpt_optionsZ
esmtp_optsZoptionrr�Zsenderrsr�rrr�sendmail&sF@








z
SMTP.sendmailc	Cs�|��|�d�}|dkr d}nt|�dkr2d}ntd��|dkr||d|krZ||dn
||d}tj�|g�d	d}|dkr�d
d�||d||d
||dfD�}dd�tj�|�D�}t�|�}	|	d
=|	d=d}
zd�|f|���	d�Wn.t
k
�r(|�d��s td��d}
YnXt
���R}|
�r^tjj||jjdd�d�}|d�}ntj�|�}|j|	dd�|��}
W5QRX|�|||
||�S)a~Converts message to a bytestring and passes it to sendmail.

        The arguments are as for sendmail, except that msg is an
        email.message.Message object.  If from_addr is None or to_addrs is
        None, these arguments are taken from the headers of the Message as
        described in RFC 2822 (a ValueError is raised if there is more than
        one set of 'Resent-' headers).  Regardless of the values of from_addr and
        to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
        resent) of the Message object won't be transmitted.  The Message
        object is then serialized using email.generator.BytesGenerator and
        sendmail is called to transmit the message.  If the sender or any of
        the recipient addresses contain non-ASCII and the server advertises the
        SMTPUTF8 capability, the policy is cloned with utf8 set to True for the
        serialization, and SMTPUTF8 and BODY=8BITMIME are asserted on the send.
        If the server does not support SMTPUTF8, an SMTPNotSupported error is
        raised.  Otherwise the generator is called without modifying the
        policy.

        zResent-DateNr&rQzResent-z0message has more than one 'Resent-' header blockZSender�FromrcSsg|]}|dk	r|�qSrr)r��frrrr��s�z%SMTP.send_message.<locals>.<listcomp>�ToZBccZCccSsg|]}|d�qS)rQr)r��arrrr��sz
Resent-BccFr:r�z�One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)�utf8)�policy�SMTPUTF8�
BODY=8BITMIMEr)�linesep)r�r�)r�Zget_allr~rbr(r)Zgetaddresses�copyr�rm�UnicodeEncodeErrorr�r�io�BytesIO�	generatorZBytesGeneratorr�ZcloneZflatten�getvaluer�)rr r�r�r�r�ZresentZ
header_prefixZaddr_fieldsZmsg_copyZ
internationalZbytesmsg�gZflatmsgrrr�send_message�sX

�
�

�
�

�
�zSMTP.send_messagecCs<z|j}d|_|r|��W5|j}d|_|r6|��XdS)z(Close the connection to the SMTP server.N)rfrDrR)rrfrRrrrrD�sz
SMTP.closecCs.|�d�}d|_|_i|_d|_|��|S)zTerminate the SMTP session.�quitNF)rLr�r�r?r�rD)r�resrrrr��s
z	SMTP.quit)r\rN)r&)r&)r&)r&)r&)r)r)N)N)N)NNN)rr)NNrr)2rrrrrOrfrRr�r�r�r��	SMTP_PORTrdrF�_GLOBAL_DEFAULT_TIMEOUTr!rJrNrPrYr[rCrorurgrLr�r9r�r�r�r�r�r�r�r6r�r�r�r�r�r�r�r�r�r�r�r�rDr�rrrrr�sh�
0
	
!

1



3


0
	

B
8�
h�
M
c@s8eZdZdZeZdddddejddfdd�Zdd�Z	dS)	�SMTP_SSLa� This is a subclass derived from SMTP that connects over an SSL
        encrypted socket (to use this class you need a socket module that was
        compiled with SSL support). If host is not specified, '' (the local
        host) is used. If port is omitted, the standard SMTP-over-SSL port
        (465) is used.  local_hostname and source_address have the same meaning
        as they do in the SMTP class.  keyfile and certfile are also optional -
        they can contain a PEM formatted private key and certificate chain file
        for the SSL connection. context also optional, can contain a
        SSLContext, and is an alternative to keyfile and certfile; If it is
        specified both keyfile and certfile must be None.

        r&rNc	
Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}	|	�dtd�||_||_|dkrxtj||d�}||_t	�
||||||�dS)Nr�r�rr�r�r�)rbr�r�r�r�r�r�r�r�rr!)
rrGrHrEr�r�r>rAr�r�rrrr!s(���zSMTP_SSL.__init__cCsD|jdkr|�d||f�t�||f||j�}|jj||jd�}|S)Nrr^r�)rOrYrFrZrAr�r�r=)rrGrHr>Z
new_socketrrrr[s
��zSMTP_SSL._get_socket)
rrrr�
SMTP_SSL_PORTrdrFr�r!r[rrrrr��s
�
r�i�c@s0eZdZdZdZdeddfdd�Zdd	d
�ZdS)�LMTPa�LMTP - Local Mail Transfer Protocol

    The LMTP protocol, which is very similar to ESMTP, is heavily based
    on the standard SMTP client. It's common to use Unix sockets for
    LMTP, so our connect() method must support that as well as a regular
    host:port server.  local_hostname and source_address have the same
    meaning as they do in the SMTP class.  To specify a Unix socket,
    you must use an absolute path as the host, starting with a '/'.

    Authentication is supported, using the regular SMTP mechanism. When
    using a Unix socket, LMTP generally don't support or require any
    authentication, but your mileage might vary.Zlhlor&NcCstj|||||d�dS)zInitialize a new instance.)rErAN)rr!)rrGrHrErArrrr!;s�z
LMTP.__init__r\rcCs�|ddkrtj||||d�Sz(t�tjtj�|_d|_|j�|�WnBtk
r�|jdkrl|�	d|�|jr||j�
�d|_�YnX|��\}}|jdkr�|�	d|�||fS)z=Connect to the LMTP daemon, on either a Unix or a TCP socket.r�/)rANz
connect fail:r^)rrCrFZAF_UNIXZSOCK_STREAMrfrRrcrOrYrDrg)rrGrHrArr rrrrCAs"


zLMTP.connect)r\rN)rrrrr��	LMTP_PORTr!rCrrrrr�+s
�
r��__main__cCs(tj�|d�tj��tj����S)Nz: )rV�stdout�write�flush�stdinr|r+)�promptrrrr[s
rr�r��,zEnter message, end with ^D:r&zMessage length is %dr\rQ)ArrFr�r2Zemail.utilsr(Z
email.messageZemail.generatorr�r�r�rTrVZemail.base64mimerr��__all__r�r�r4r�r}r��compile�Ir�rcrrrrrrr	r
rrr
r/rr7r8r��ImportErrorr�rr�rr�r�rrZfromaddrr�ZtoaddrsrSr rr|r�r~ZserverrPr�r�rrrr�<module>s�)�


	
:0
/


cgitb.cpython-38.pyc000064400000023650151450073350010275 0ustar00U

e5d@/�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dd�ZgZdd�Z
dd�Zd	d
�Zdd�Zd
d�Zddd�Zddd�ZGdd�d�Ze�jZddd�ZdS)a�More comprehensive traceback formatting for Python scripts.

To enable this module, do:

    import cgitb; cgitb.enable()

at the top of your script.  The optional arguments to enable() are:

    display     - if true, tracebacks are displayed in the web browser
    logdir      - if set, tracebacks are written to files in this directory
    context     - number of lines of source code to show for each stack frame
    format      - 'text' or 'html' controls the output format

By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)

Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler().  The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.

�NcCsdS)zAReturn a string that resets the CGI and browser to a known state.a'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>�rrr�/usr/lib64/python3.8/cgitb.py�reset#srcCs|rd|dSdSdS)Nz<small>z</small>�r��textrrr�small.srcCs|rd|dSdSdS)Nz<strong>z	</strong>rrrrrr�strong4sr	cCs|rd|dSdSdS)Nz<font color="#909090">z</font>rrrrrr�grey:sr
cCs�||krd||fS||jkr,d|j|fSd|jkr~|jd}t|�ti�krf||kr~d||fSnt||�r~dt||�fSdtfS)z9Find the value for a given name in the given environment.�local�global�__builtins__�builtinN)�	f_globals�type�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinsrrr�lookup@s



rcCs�gdddtf\}}}}}t�|�D]�\}}	}
}}|tjkr>q�|tjkr�|	tjkr�|dkr�|tk	r�t||	t�}|�||	||f�q�t	|	||�\}
}|�|	|
|f�n"|	dkr�||d7}|}nd\}}|	}q"|S)zEScan one logical line of Python and look up values of variables used.Nr�.)Nr)
r�tokenize�generate_tokens�NEWLINE�NAME�keyword�kwlistr�appendr)�readerrr�varsZ	lasttoken�parent�prefix�valueZttype�token�start�end�line�whererrr�scanvarsPs"
r+�c"s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	j
�dtt	j
�
t|���dd|d|�d	}d
td�d}g}	t�||�}
|
D�]F\}�}}
}}�r�tj����d
�t	j
�
��f}nd�}t�|�\}}}}d}|
dk�r8dtt	j
�
|
��}|
dk�r8|tj||||dd�d�7}i�|gf��fdd�	}t|||�}dd||fg}|dk	�r
||}|D]�}tddtt|��t|��d}|�k�r�d|t	j
�|�f}|�d|�n&d|t	j
�|�f}|�dt|��|d 7}�q�ig}}|D]�\}}} ||k�r0�qd ||<| tk	�r�|d!k�r^d"|t|�}n*|d#k�rrt|�}n|t|�d$�d%�}|�d&|t	j
�| �f�n|�|d'��q|�dttd(�|����|	�d)d*�|��q�d+tt	j
�
t|���t	j
�
t|��fg}!t|�D]B}|dd �d,k�r4�qt	j
�t ||��} |!�d-||| f��q|d�|	�d�|!�d.t	j
�
d�t!�"|||���S)/z9Return a nice HTML document describing a given traceback.�Python r�: z<body bgcolor="#f0f0f8">z<big><big>%s</big></big>z#ffffffz#6622aaz<br>z�
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://%s">%s</a>�?r�in �<module>cSsdtj�|�S�N�=)�pydoc�html�repr�r%rrr�<lambda>��zhtml.<locals>.<lambda>�Zformatvaluec
s8d�|d<zt��|d�W�S|dd7<XdS�N�r��	linecache�getline��lnum��fileZ	highlightrrr!�szhtml.<locals>.readerz+<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>z<big>&nbsp;</big>Nz&nbsp;r,z<tt>=&gt;%s%s</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;%s%s</tt>z<tr><td>%s</td></tr>r<)rrz<em>%s</em> rr���z%s&nbsp;= %sz <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>�
z	<p>%s: %s�_z
<br>%s%s&nbsp;=
%sz�


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
)#�
isinstancer�__name__�sys�version�split�
executable�time�ctimer4r5Zheadingr	�escape�strr�inspect�getinnerframes�os�path�abspath�getargvalues�formatargvaluesr+�lenZ	preformatr r
rr6�join�dirr�	traceback�format_exception)"�einfo�context�etype�evalue�etb�pyver�date�head�indent�frames�recordsrrA�func�lines�index�link�args�varargs�varkwr�callr!r"�rows�ir)�num�done�dumprr*r%�	exceptionrrBrr5es�

�
��

��
$






��	��r5c 	s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	|�||fd}g}t
�||�}	|	D�]�\}
�}}}
}�r�tj
���p�d�t
�|
�\}}}}d}|dkr�d|}|d	kr�|t
j||||d
d�d�7}i�|gf��fd
d�	}t||
|�}d�|fg}|dk	�rP||}|
D](}d|}|�||���|d7}�q&ig}}|D]�\}}}||k�rv�q^d||<|tk	�r�|dk�r�d|}n|dk�r�||�d�d}|�d|tj�|�f�n|�|d��q^|�d�|��|�dd�|��qndt	|�t	|�fg}t|�D],}tj�t||��}|�dd||f��q*|d�|�d�|�dd�t�|||��S) z:Return a plain text document describing a given traceback.r-rr.z	%s
%s
%s
z�
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r/rr0r1cSsdtj�|�Sr2)r4rr6r7rrrr8�r9ztext.<locals>.<lambda>r:c
s8d�|d<zt��|d�W�S|dd7<XdSr;r=r@rBrrr!�sztext.<locals>.readerz %s %sNz%5d r<rzglobal rrrDz%s = %sz
 undefinedrEz
%s
z%s: %sz

%s%s = %sz    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rGrrHrIrJrKrLrMrNrPrQrRrSrTrUrVrWr+r �rstriprr4rr6rYrZrr[r\) r]r^r_r`rarbrcrdrfrgrrArhrirjrlrmrnrror!r"rprqr)rrrsrtrr*r%rurrBrr�sb

�






�rc@s,eZdZdZddd�Zdd	�Zd
d
d�ZdS)�Hookz?A hook to replace sys.excepthook that shows tracebacks in HTML.r<Nr,r5cCs(||_||_||_|ptj|_||_dS�N)�display�logdirr^rI�stdoutrC�format)�selfryrzr^rCr|rrr�__init__s
z
Hook.__init__cCs|�|||f�dSrx)�handle)r}r_r`rarrr�__call__
sz
Hook.__call__c
	Csz|p
t��}|jdkr$|j�t��|jdkr2tp4t}d}z|||j�}Wn d�	t
j|��}d}YnX|jr�|r�t
j�|�}|j�d|d�q�|j�|d�n|j�d�|jdk	�rZd	d
g|jdk}tj||jd�\}}z.t�|d��}|�|�W5QRXd
|}	Wnd|}	YnX|jdk�rJ|j�d|	�n|j�|	d�z|j��WnYnXdS)Nr5FrTz<pre>z</pre>
rEz*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrZ�wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)rI�exc_infor|rC�writerr5rr^rYr[r\ryr4rOrz�tempfileZmkstemprS�fdopen�flush)
r}�infoZ	formatterZplain�docr��fdrTrC�msgrrrrs@

zHook.handle)r<Nr,Nr5)N)rH�
__module__�__qualname__�__doc__r~r�rrrrrrws�
rwr<cCst||||d�t_dS)aInstall an exception handler that formats tracebacks as HTML.

    The optional argument 'display' can be set to 0 to suppress sending the
    traceback to the browser, and 'logdir' can be set to a directory to cause
    tracebacks to be written to files there.�ryrzr^r|N)rwrI�
excepthookr�rrr�enable:s�r�)r,)r,)r<Nr,r5)r�rQrr>rSr4rIr�rMrr[rrrr	r
rr+r5rrwrZhandlerr�rrrr�<module>s,

[
B7zipapp.cpython-38.opt-1.pyc000064400000013340151450073350011442 0ustar00U

e5do�@s�ddlZddlZddlZddlZddlZddlZddlZdddgZdZej	�
d�rXdZne��ZGdd�de
�Zejd	d
��Zdd�Zdd
d�Zddd�Zdd�Zddd�Zedkr�e�dS)�N�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�win�utf-8c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/zipapp.pyr!sc	cs8t|ttjf�r.t||��}|VW5QRXn|VdS�N)�
isinstance�str�os�PathLike�open)�archive�mode�fr
r
r�_maybe_open%srcCs$|r d|�t�d}|�|�dS)zWrite a shebang line.�#!�
N)�encode�shebang_encoding�write)r�interpreterZshebangr
r
r�_write_file_prefix.src
Cs�t|d��Z}|�d�}|dkr*d}|��t|d��&}t||�|�|�t�||�W5QRXW5QRX|r�t|t�r�t	�
|t	�|�jtj
B�dS)z8Copy an application archive, modifying the shebang line.�rb�r��wbN)r�read�readlinerr�shutilZcopyfileobjr
rr�chmod�stat�st_mode�S_IEXEC)rZnew_archiver�srcZfirst_2Zdstr
r
r�
_copy_archive5s


 r)Fc
Cs�d}t|d�rt|d�rd}nt�|�}|��r4d}|rHt|||�dS|��sXtd��|d��}|rt|rttd��|s�|s�td	��d}|r�|�d
�\}	}
}tdd�|	�	d
�D��}tdd�|�	d
�D��}
|
d
kr�|r�|
s�td|��t
j|	|d�}|dk�r|�d�}nt|d��s"t�|�}t
|d���}t||�|�rDtjntj}tj|d|d��^}|�d�D]4}|�|�}|dk�s�||��rf|�||����qf|�r�|�d|�d��W5QRXW5QRX|�r�t|d��s�|�|��jtjB�dS)abCreate an application archive from SOURCE.

    The SOURCE can be the name of a directory, or a filename or a file-like
    object referring to an existing archive.

    The content of SOURCE is packed into an application archive in TARGET,
    which can be a filename or a file-like object.  If SOURCE is a directory,
    TARGET can be omitted and will default to the name of SOURCE with .pyz
    appended.

    The created application archive will have a shebang line specifying
    that it should run with INTERPRETER (there will be no shebang line if
    INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
    not specified, an existing __main__.py will be used).  It is an error
    to specify MAIN for anything other than a directory source with no
    __main__.py, and it is an error to omit MAIN if the directory has no
    __main__.py.
    Fr!r"TNzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry point�:css|]}|��VqdSr��isidentifier��.0�partr
r
r�	<genexpr>{sz!create_archive.<locals>.<genexpr>�.css|]}|��VqdSrr+r-r
r
rr0|szInvalid entry point: )�module�fnz.pyzrr �w)�compression�*r)�hasattr�pathlib�Path�is_filer)�existsr�	partition�all�split�
MAIN_TEMPLATE�formatZwith_suffixrr�zipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglob�relative_torZas_posixZwritestrrr$r%r&r')�source�targetr�main�filter�
compressedZsource_is_fileZhas_mainZmain_py�mod�sepr3Zmod_okZfn_ok�fdr5�zZchildZarcnamer
r
rrLsX
�


�
&c
CsFt|d��2}|�d�dkr8|�����t�W5QR�SW5QRXdS)Nrrr)rr!r"�strip�decoder)rrr
r
rr�scCs<ddl}|��}|jddddd�|jdddd	d�|jd
dddd�|jd
dddd�|jddddd�|jddd�|�|�}|jr�tj�|j�s�t	d��t
|j�}td�|p�d��t
�d�tj�|j��r|jdk�stj�|j��rtj�|j|j��rt	d��|j�rt	d��t|j|j|j|j|jd�dS)z�Run the zipapp command line interface.

    The ARGS parameter lets you specify the argument list directly.
    Omitting ARGS (or setting it to None) works as for argparse, using
    sys.argv[1:] as the argument list.
    rNz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)�default�helpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-c�
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)�actionrOz--infoFz)Display the interpreter from the archive.)rNrQrOrCz'Source directory (or existing archive).)rOz%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)rrErG)�argparse�ArgumentParser�add_argument�
parse_args�infor�path�isfilerC�
SystemExitr�printr@�sys�exit�outputr;�samefilerEr�python�compress)�argsrR�parserrr
r
rrE�sN
�
�
�
�
��


�
�rE�__main__)N)NNNNF)N)�
contextlibrr8r#r%r[rA�__all__r?�platform�
startswithr�getfilesystemencoding�
ValueErrorr�contextmanagerrrr)rrrErr
r
r
r�<module>s0



�
J
1turtle.cpython-38.opt-1.pyc000064400000375750151450073350011476 0ustar00U

e5dd1�O@s6dZdZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZddd	d
ddd
ddg	Zddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.gZd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}gOZd~dgZeeeed�gZdd0d3d@dMdQdUd[d]dbdcdedfdqdvdydzgZd�d�d�d�ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d��Zd�d��Zd�d��Zzee�Wnek
�r
ed��YnXGd�d�de�Zd�d��Zd�d��Zd�Zd�d�d��Z Gd�d�dej!�Z"e e"ej#d��Gd�d��d�ej$�Z%ej#Z#Gd�d��d�e&�Z'Gd�d��d�e�Z(Gd�d��d�e�Z)Gd�d�de&�Z*Gd�d��d�e&�Z+Gd�d�de'�Z,Gd�d��d�e&�Z-Gd�d��d�e&�Z.Gd�d��d�e&�Z/Gd�d
�d
e.e-�Z0e0Z1d�d	�Z2Gd�d��d�e,�Z3Gd�d�de0�Z4e4Z5d�d�d~�Z6d�d��Z7ed�Z8ze8d�k�rre7e8�Wn@e9k
�r�ed�e8�Yn"ek
�r�ed�e8�YnXd�d��Z:d�dÄZ;d�dńZ<d�Z=d�dȄZ>e>ee3d�d�e<�e>ee4d�d�e;�e?Z@eAd�k�r2d�dτZBd�dфZCd�dӄZDeC�eD�eE�dS)�a�

Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it
the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
the direction it is facing, drawing a line as it moves. Give it the
command turtle.right(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.

----- turtle.py

This module is an extended reimplementation of turtle.py from the
Python standard distribution up to Python 2.5. (See: http://www.python.org)

It tries to keep the merits of turtle.py and to be (nearly) 100%
compatible with it. This means in the first place to enable the
learning programmer to use all the commands, classes and methods
interactively when using the module from within IDLE run with
the -n switch.

Roughly it has the following features added:

- Better animation of the turtle movements, especially of turning the
  turtle. So the turtles can more easily be used as a visual feedback
  instrument by the (beginning) programmer.

- Different turtle shapes, gif-images as turtle shapes, user defined
  and user controllable turtle shapes, among them compound
  (multicolored) shapes. Turtle shapes can be stretched and tilted, which
  makes turtles very versatile geometrical objects.

- Fine control over turtle movement and screen updates via delay(),
  and enhanced tracer() and speed() methods.

- Aliases for the most commonly used commands, like fd for forward etc.,
  following the early Logo traditions. This reduces the boring work of
  typing long sequences of commands, which often occur in a natural way
  when kids try to program fancy pictures on their first encounter with
  turtle graphics.

- Turtles now have an undo()-method with configurable undo-buffer.

- Some simple commands/methods for creating event driven programs
  (mouse-, key-, timer-events). Especially useful for programming games.

- A scrollable Canvas class. The default scrollable Canvas can be
  extended interactively as needed while playing around with the turtle(s).

- A TurtleScreen class with methods controlling background color or
  background image, window and canvas size and other properties of the
  TurtleScreen.

- There is a method, setworldcoordinates(), to install a user defined
  coordinate-system for the TurtleScreen.

- The implementation uses a 2-vector class named Vec2D, derived from tuple.
  This class is public, so it can be imported by the application programmer,
  which makes certain types of computations very natural and compact.

- Appearance of the TurtleScreen and the Turtles at startup/import can be
  configured by means of a turtle.cfg configuration file.
  The default configuration mimics the appearance of the old turtle module.

- If configured appropriately the module reads in docstrings from a docstring
  dictionary in some different language, supplied separately  and replaces
  the English ones by those read in. There is a utility function
  write_docstringdict() to write a dictionary with the original (English)
  docstrings to disc, so it can serve as a template for translations.

Behind the scenes there are some features included with possible
extensions in mind. These will be commented and documented elsewhere.

z-turtle 1.1b- - for Python 3.1   -  4. 5. 2009�N)�isfile�split�join)�deepcopy)�simpledialog�ScrolledCanvas�TurtleScreen�Screen�	RawTurtle�Turtle�RawPen�Pen�Shape�Vec2D�addshape�bgcolor�bgpic�bye�clearscreen�	colormode�delay�exitonclick�	getcanvas�	getshapes�listen�mainloop�mode�numinput�onkey�
onkeypress�onkeyrelease�
onscreenclick�ontimer�register_shape�resetscreen�
screensize�setup�setworldcoordinates�	textinput�title�tracer�turtles�update�
window_height�window_width�back�backward�
begin_fill�
begin_poly�bk�circle�clear�
clearstamp�clearstamps�clone�color�degrees�distance�dot�down�end_fill�end_poly�fd�	fillcolor�filling�forward�get_poly�getpen�	getscreen�
get_shapepoly�	getturtle�goto�heading�
hideturtle�home�ht�isdown�	isvisible�left�lt�onclick�ondrag�	onrelease�pd�pen�pencolor�pendown�pensize�penup�pos�position�pu�radians�right�reset�
resizemode�rt�seth�
setheading�setpos�setposition�settiltangle�
setundobuffer�setx�sety�shape�	shapesize�shapetransform�shearfactor�
showturtle�speed�st�stamp�tilt�	tiltangle�towards�
turtlesize�undo�undobufferentries�up�width�write�xcor�ycor�write_docstringdict�done�
Terminator��?g�?i�i,�standard��?�
i��classic�black�noresizeTZenglish�turtle�screenzPython Turtle GraphicsF)rz�height�	canvwidth�
canvheight�	leftright�	topbottomrrr�undobuffersizerkrWrAra�visible�language�
exampleturtle�
examplescreenr)�
using_IDLEc	Cs�t|d��}|��}W5QRXi}|D]�}|��}|r&|�d�rBq&z|�d�\}}Wn(tk
r|td||f�Yq&YnX|��}|��}|dkr�t|�}n4zd|kr�t|�}nt	|�}Wntk
r�YnX|||<q&|S)z/Convert content of config-file into dictionary.�r�#�=zBad line in config-file %s:
%s)�True�False�Nonez''z""�.)
�open�	readlines�strip�
startswithr�
ValueError�print�eval�float�int)�filename�fZcfglines�cfgdict�line�key�value�r��/usr/lib64/python3.8/turtle.py�config_dict�s0



r�cCs�d}i}i}t|�rt|�}d|kr0d|d}ztt�\}}t||�}Wntk
rbd}YnXt|�rtt|�}t�|�t�|�dS)a@Read config-files, change configuration-dict accordingly.

    If there is a turtle.cfg file in the current working directory,
    read it from there. If this contains an importconfig-value,
    say 'myway', construct filename turtle_mayway.cfg else use
    turtle.cfg and read it from the import-directory, where
    turtle.py is located.
    Update configuration dictionary first according to config-file,
    in the import directory, then according to config-file in the
    current working directory.
    If no config-file is found, the default configuration is used.
    z
turtle.cfgZimportconfigz
turtle_%s.cfg�N)rr�r�__file__r�	Exception�_CFGr,)r�Zdefault_cfgZcfgdict1Zcfgdict2�head�tailZ	cfg_file2r�r�r��
readconfig�s 


r�z"No configfile read, reason unknownc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)ra�A 2 dimensional vector class, used as a helper class
    for implementing turtle graphics.
    May be useful for turtle graphics programs also.
    Derived from tuple, so a vector is a tuple!

    Provides (for a, b vectors, k number):
       a+b vector addition
       a-b vector subtraction
       a*b inner product
       k*a and a*k multiplication with scalar
       |a| absolute value of a
       a.rotate(angle) rotation
    cCst�|||f�S�N)�tuple�__new__)�cls�x�yr�r�r�r��sz
Vec2D.__new__cCs"t|d|d|d|d�S�Nr��r��self�otherr�r�r��__add__�sz
Vec2D.__add__cCsDt|t�r*|d|d|d|dSt|d||d|�Sr�)�
isinstancerr�r�r�r��__mul__�s
 z
Vec2D.__mul__cCs2t|t�st|t�r.t|d||d|�StSr�)r�r�r�r�NotImplementedr�r�r�r��__rmul__szVec2D.__rmul__cCs"t|d|d|d|d�Sr�r�r�r�r�r��__sub__sz
Vec2D.__sub__cCst|d|d�Sr�r��r�r�r�r��__neg__sz
Vec2D.__neg__cCs|dd|dddS)Nr�r�r�r�r�r�r�r��__abs__
sz
Vec2D.__abs__cCsjt|d|d�}|tjd}t�|�t�|�}}t|d||d||d||d|�S)z.rotate self counterclockwise by angle
        r�r��f@)r�math�pi�cos�sin)r��angleZperp�c�sr�r�r��rotateszVec2D.rotatecCs|d|dfSr�r�r�r�r�r��__getnewargs__szVec2D.__getnewargs__cCsd|S)Nz(%.2f,%.2f)r�r�r�r�r��__repr__szVec2D.__repr__N)�__name__�
__module__�__qualname__�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s
cCsTt|j�}|��|D]}t||�q|j��D]\}}t|�tjkr0|||<q0dS)�#helper function for Scrolled CanvasN)	�list�	__bases__�reverse�__methodDict�__dict__�items�type�types�FunctionType)r��_dictZbaseListZ_superr�r�r�r�r�r�!s
r�cCsi}t||�|��S)r�)r��keys)r�r�r�r�r��	__methods+s
r�zTdef %(method)s(self, *args, **kw): return self.%(attribute)s.%(method)s(*args, **kw)r�cCs�i}t||�i}t|�}|��D]B}|dd�dksd|dd�dksd||ksd||krXq"||||<q"|��D]D\}}	||	d�}
t|t�r�t||d�}t||
�t|||
|�qndS)Nr��_���)�method�func)r�Z	attribute)	r�r�r�r�r��str�__stringBody�exec�setattr)Z	fromClassZtoClassZtoPartZexcludeZ_dict_1r�ZmfcZexr�r��dZ
execStringr�r�r��__forwardmethods5s
0

�
r�c@sdeZdZdZddd�Zddd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz�Modeled after the scrolled canvas class from Grayons's Tkinter book.

    Used as the default canvas, which pops up automatically when
    using turtle graphics functions or the Turtle class.
    ���^�Xc
Cs0tjj||||d�|��|_|||_|_|||_|_d|_	tj
||||j	tjdd�|_tj
||jjtjd�|_tj
||jjd�|_|jj|jj|jjd�|jdd	dd
�|jdd	dd
�|jjd	|d	ddd	d	dd�|jjd	|d	dd	d	d	dd�|jjd	|d	d	dd	d	dd�|��|j�d
|j�dS)N)rzr��whiter�)rzr��bgZreliefZborderwidth)�commandZorient)r�)ZxscrollcommandZyscrollcommandrr�)ZweightZminsize�news�ZpadxZin_Zpady�row�columnZrowspanZ
columnspanZstickyz<Configure>)�TK�Frame�__init__�winfo_toplevelZ_rootwindowrzr�r�r�r��CanvasZSUNKEN�_canvasZ	ScrollbarZxviewZ
HORIZONTAL�hscrollZyview�vscrollZ	configure�setZrowconfigureZcolumnconfigure�gridr`�bind�onResize)r��masterrzr�r�r�r�r�r�r�PsN

������zScrolledCanvas.__init__NcCs�|r
||_|r||_|r||_|jj||jd|jd|jd|jdfd�|j�d|j|jd|j�|j�d|j|jd|j�|�	�dS)z<Adjust canvas and scrollbars according to given canvas size.r�)r��scrollregionr��N)
r�r�r�r�config�xview_movetorz�yview_movetor��
adjustScrolls�r�r�r�r�r�r�r�r`is&����zScrolledCanvas.resetc
Cs�|j��}|j��}|j�d|j||j�|j�d|j||j�||jks`||jkr�|jjd|ddddddd�|j	jd|ddddddd�n|j�
�|j	�
�dS)zA Adjust scrollbars according to window- and canvas-size.
        r�r�rr�r�N)r�winfo_width�winfo_heightrr�rr�rrrZgrid_forget)r��cwidth�cheightr�r�r�r
{s&

��
zScrolledCanvas.adjustScrollscCs|��dS)zself-explanatoryN)r
)r��eventr�r�r�r�szScrolledCanvas.onResizecGs|jj|�S��@ 'forward' method, which canvas itself has inherited...
        )r�bbox�r��argsr�r�r�r�szScrolledCanvas.bboxcOs|jj||�Sr)r�cget�r�r�kwargsr�r�r�r�szScrolledCanvas.cgetcOs|jj||�dS�rN)rr
rr�r�r�r
�szScrolledCanvas.configcOs|jj||�dSr)rrrr�r�r�r�szScrolledCanvas.bindcOs|jj||�dSr)r�unbindrr�r�r�r�szScrolledCanvas.unbindcCs|j��dSr)r�focus_forcer�r�r�r�r�szScrolledCanvas.focus_force)r�r�r�r�)NNN)r�r�r�r�r�r`r
rrrr
rrrr�r�r�r�rJs�

rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�_Rootz'Root class for Screen based on Tkinter.cCstj�|�dSr�)r��Tkr�r�r�r�r�r��sz_Root.__init__cCs&t|||||�|_|jjddd�dS)Nr�Zboth)�expand�fill)rrZpack)r�rzr�rrr�r�r��setupcanvas�sz_Root.setupcanvascCs|jSr�)rr�r�r�r��
_getcanvas�sz_Root._getcanvascCs|�d||||f�dS)Nz%dx%d%+d%+d)Zgeometry)r�rzr��startx�startyr�r�r��set_geometry�sz_Root.set_geometrycCs|�d|�dS)NZWM_DELETE_WINDOW)Zwm_protocol)r��destroyr�r�r��	ondestroy�sz_Root.ondestroycCs|��Sr�)Zwinfo_screenwidthr�r�r�r��	win_width�sz_Root.win_widthcCs|��Sr�)Zwinfo_screenheightr�r�r�r��
win_height�sz_Root.win_heightN)r�r�r�r�r�r#r$r'r)r*r+r�r�r�r�r�src@s,eZdZdZdd�Zdd�Zdd�Zdd	�ZdGdd
�Zdd�Z	dHdd�Z
dd�Zdd�Zdd�Z
dd�ZdIdd�Zdd�ZdJdd �ZdKd!d"�ZdLd#d$�ZdMd%d&�Zd'd(�ZdNd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdOd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dPdEdF�Z$d
S)Q�TurtleScreenBasez�Provide the basic graphics functionality.
       Interface between Tkinter and turtle.py.

       To port turtle.py to some different graphics toolkit
       a corresponding TurtleScreenBase class has to be implemented.
    cCstjdd|jd�}|��|S)z$return a blank image object
        r�)rzr�r)r��
PhotoImage�cv�blank)r�Zimgr�r�r��_blankimage�szTurtleScreenBase._blankimagecCstj||jd�S)z`return an image object containing the
        imagedata from a gif-file named filename.
        )�filer)r�r-r.)r�r�r�r�r��_image�szTurtleScreenBase._imagecCs�||_t|t�r"|jj}|jj}nJt|j�d��}t|j�d��}|jj|d|d|d|dfd�||_||_d|_|_	dS)Nrzr�r��rr�)
r.r�rr�r�r�rr
�xscale�yscale)r�r.�w�hr�r�r�r��s

*zTurtleScreenBase.__init__cCs|jjdddd�S)z<Create an invisible polygon item on canvas self.cv)
        )rrrrrrr��r"�outline)r.Zcreate_polygonr�r�r�r��_createpoly�szTurtleScreenBase._createpolyNFc
Cs�g}|D]*\}}	|�||j�|�|	|j�q|jj|f|��|dk	r^|jj||d�|dk	rv|jj||d�|dk	r�|jj||d�|r�|j�|�dS)a`Configure polygonitem polyitem according to provided
        arguments:
        coordlist is sequence of coordinates
        fill is filling color
        outline is outline color
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        N�r")r9�rz��appendr4r5r.�coordsZ
itemconfigureZ	tag_raise)
r�Zpolyitem�	coordlistr"r9rz�top�clr�r�r�r�r��	_drawpoly�szTurtleScreenBase._drawpolyc	Cs|jjddddddtjd�S)z9Create an invisible line item on canvas self.cv)
        rr�r�)r"rzZcapstyle)r.Zcreate_liner�ZROUNDr�r�r�r��_createlines�zTurtleScreenBase._createlinec	Cs�|dk	rNg}|D]*\}}|�||j�|�||j�q|jj|f|��|dk	rf|jj||d�|dk	r~|jj||d�|r�|j�|�dS)aQConfigure lineitem according to provided arguments:
        coordlist is sequence of coordinates
        fill is drawing color
        width is width of drawn line.
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        Nr;r<r=)	r�Zlineitemr@r"rzrArBr�r�r�r�r��	_drawlines
zTurtleScreenBase._drawlinecCs|j�|�dS)z]Delete graphics item from canvas.
        If item is"all" delete all graphics items.
        N)r.�delete�r��itemr�r�r��_delete(szTurtleScreenBase._deletecCs|j��dS)z(Redraw graphics items on canvas
        N)r.r,r�r�r�r��_update.szTurtleScreenBase._updatecCs|j�|�dS)z-Delay subsequent canvas actions for delay ms.N)r.�after�r�rr�r�r��_delay3szTurtleScreenBase._delaycCs4z|j�|�}d}Wntjk
r.d}YnX|S)zCCheck if the string color is a legal Tkinter color string.
        TF)r.Z	winfo_rgbr�ZTclError)r�r9Zrgb�okr�r�r��_iscolorstring7s
zTurtleScreenBase._iscolorstringcCs0|dk	r |jj|d�|��n|j�d�SdS)zVSet canvas' backgroundcolor if color is not None,
        else return backgroundcolor.N)r�r�)r.r
rJr)r�r9r�r�r��_bgcolorAs
zTurtleScreenBase._bgcolorcCst|\}}||j}||j}dddd�}|jj|d||||||d�}	|j�|	�\}
}}}
|j��|	|dfS)z�Write txt at pos in canvas with specified font
        and color.
        Return text item and x-coord of right bottom corner
        of text's bounding box.�swr�Zse)rP�centerr_r�)�text�anchorr"�font)r4r5r.Zcreate_textrr,)r�r[�txt�alignrUrWr�r�rTrHZx0Zy0Zx1Zy1r�r�r��_writeJs

�
zTurtleScreenBase._writer�csD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)z�Bind fun to mouse-click event on turtle.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1
        N�<Button-%s>cs:�j�|j��j�j�|j��j}}�||�dSr��r.�canvasxr�r4�canvasyr�r5�rr�r���funr�r�r��eventfunes�z+TurtleScreenBase._onclick.<locals>.eventfun�r.Z
tag_unbindZtag_bind�r�rHr_�num�addr`r�r^r��_onclick\szTurtleScreenBase._onclickcsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)agBind fun to mouse-button-release event on turtle.
        fun must be a function with two arguments, the coordinates
        of the point on the canvas where mouse button is released.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        Nz<Button%s-ButtonRelease>cs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`ws�z-TurtleScreenBase._onrelease.<locals>.eventfunrarbr�r^r��
_onreleaseks	�zTurtleScreenBase._onreleasecsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)aqBind fun to mouse-move-event (with pressed mouse button) on turtle.
        fun must be a function with two arguments, the coordinates of the
        actual mouse position on the canvas.
        num, the number of the mouse-button defaults to 1

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.
        Nz<Button%s-Motion>csTz:�j�|j��j�j�|j��j}}�||�Wntk
rNYnXdSr�)r.r[r�r4r\r�r5r�r]r^r�r�r`�s�z*TurtleScreenBase._ondrag.<locals>.eventfunrarbr�r^r��_ondrag~s	zTurtleScreenBase._ondragcs@�dkr�j�d|�n"��fdd�}�j�d|||�dS)aGBind fun to mouse-click event on canvas.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        NrYcs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`�s�z1TurtleScreenBase._onscreenclick.<locals>.eventfun�r.rr)r�r_rcrdr`r�r^r��_onscreenclick�s	zTurtleScreenBase._onscreenclickcs>�dkr|j�d|d�n�fdd�}|j�d||�dS)z`Bind fun to key-release event of key.
        Canvas must have focus. See method listen
        Nz<KeyRelease-%s>cs
��dSr�r��r�r_r�r�r`�sz0TurtleScreenBase._onkeyrelease.<locals>.eventfunrh�r�r_r�r`r�rkr��
_onkeyrelease�szTurtleScreenBase._onkeyreleasecsn�dkr4|dkr |j�dd�qj|j�d|d�n6�fdd�}|dkrX|j�d|�n|j�d||�dS)z�If key is given, bind fun to key-press event of key.
        Otherwise bind fun to any key-press.
        Canvas must have focus. See method listen.
        Nz
<KeyPress>z
<KeyPress-%s>cs
��dSr�r�rjrkr�r�r`�sz.TurtleScreenBase._onkeypress.<locals>.eventfunrhrlr�rkr��_onkeypress�szTurtleScreenBase._onkeypresscCs|j��dS)z=Set focus on canvas (in order to collect key-events)
        N)r.rr�r�r�r��_listen�szTurtleScreenBase._listencCs(|dkr|j�|�n|j�||�dS)z?Install a timer, which calls fun after t milliseconds.
        rN)r.Z
after_idlerK�r�r_�tr�r�r��_ontimer�szTurtleScreenBase._ontimercCs|jjdd|d�S)z0Create and return image item on canvas.
        r��image)r.Zcreate_image)r�rtr�r�r��_createimage�szTurtleScreenBase._createimagecCs<|\}}|j�|||j||jf�|jj||d�dS)zZConfigure image item as to draw image object
        at position (x,y) on canvas)
        rsN)r.r?r4r5�
itemconfig)r�rHr[rtr�r�r�r�r��
_drawimage�s zTurtleScreenBase._drawimagecCs |jj||d�|j�|�dS)z�Configure image item as to draw image object
        at center of canvas. Set item to the first item
        in the displaylist, so it will be drawn below
        any other item .rsN)r.rvZ	tag_lower)r�rHrtr�r�r��	_setbgpic�szTurtleScreenBase._setbgpiccCs|j�|�S)zQReturn 'line' or 'polygon' or 'image' depending on
        type of item.
        )r.r�rGr�r�r��_type�szTurtleScreenBase._typecs.|j�|���fdd�tdt��d�D�}|S)a returns list of coordinate-pairs of points of item
        Example (for insiders):
        >>> from turtle import *
        >>> getscreen()._pointlist(getturtle().turtle._item)
        [(0.0, 9.9999999999999982), (0.0, -9.9999999999999982),
        (9.9999999999999982, 0.0)]
        >>> cs"g|]}�|�|df�qS)r�r���.0�i�rBr�r��
<listcomp>�sz/TurtleScreenBase._pointlist.<locals>.<listcomp>rr�)r.r?�range�len)r�rH�plr�r}r��
_pointlist�szTurtleScreenBase._pointlistcCs|jj||||fd�dS)Nr3)r.r
)r��srx1�sry1�srx2�sry2r�r�r��_setscrollregion�sz!TurtleScreenBase._setscrollregionc	Cs||j��}|D]h}t|j�|��}g}|rd|dd�\}}|�||�|�||�|dd�}q&|jj|f|��qdS)Nr�)r.Zfind_allr�r?r>)	r�ZxscalefactorZyscalefactorr�rHZcoordinatesZnewcoordlistr�r�r�r�r��_rescale�s
zTurtleScreenBase._rescalecCszt|jt�s|j|jfS||kr6|kr6dkrJnn|jj|jjfS|dk	rX||_|dk	rf||_|j�|||�dS)zaResize the canvas the turtles are drawing on. Does
        not alter the drawing window.
        N)r�r.rr�r�r`rr�r�r��_resizes"zTurtleScreenBase._resizecCs@|j��}|dkr|jd}|j��}|dkr8|jd}||fS)z; Return the width and height of the turtle window.
        r�rzr�)r.rr)r�rzr�r�r�r��_window_sizes



zTurtleScreenBase._window_sizecCs|jj��dS)a{Starts event loop - calling Tkinter's mainloop function.

        No argument.

        Must be last statement in a turtle graphics program.
        Must NOT be used if a script is run from within IDLE in -n mode
        (No subprocess) - for interactive use of turtle graphics.

        Example (for a TurtleScreen instance named screen):
        >>> screen.mainloop()

        N)r.Ztkrr�r�r�r�rs
zTurtleScreenBase.mainloopcCstj|||jd�S)a�Pop up a dialog window for input of a string.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what information to input.

        Return the string input
        If the dialog is canceled, return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.textinput("NIM", "Name of first player:")

        )�parent)rZ	askstringr.)r�r)�promptr�r�r�r(.s
zTurtleScreenBase.textinputcCstj||||||jd�S)a�Pop up a dialog window for input of a number.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what numerical information to input.
        default: default value
        minval: minimum value for input
        maxval: maximum value for input

        The number input must be in the range minval .. maxval if these are
        given. If not, a hint is issued and the dialog remains open for
        correction. Return the number input.
        If the dialog is canceled,  return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000)

        )ZinitialvalueZminvalueZmaxvaluer�)rZaskfloatr.)r�r)r��defaultZminvalZmaxvalr�r�r�r=s

�zTurtleScreenBase.numinput)NNNF)NNNF)N)r�N)r�N)r�N)r�N)N)NNN)NNN)%r�r�r�r�r0r2r�r:rCrDrErIrJrMrOrPrXrerfrgrirmrnrorrrurwrxryr�r�r�r�r�rr(rr�r�r�r�r,�sT
�
�


	





r,c@seZdZdZdS)r�z�Will be raised in TurtleScreen.update, if _RUNNING becomes False.

    This stops execution of a turtle graphics script.
    Main purpose: use in the Demo-Viewer turtle.Demo.py.
    N�r�r�r�r�r�r�r�r�r�Ysc@seZdZdZdS)�TurtleGraphicsErrorzSome TurtleGraphics Error
    Nr�r�r�r�r�r�bsr�c@s$eZdZdZddd�Zddd�ZdS)	rz�Data structure modeling shapes.

    attribute _type is one of "polygon", "image", "compound"
    attribute _data is - depending on _type a poygon-tuple,
    an image or a list constructed using the addcomponent method.
    NcCsz||_|dkr"t|t�rpt|�}nN|dkrVt|t�rp|���d�rpt|�rpt�	|�}n|dkrdg}nt
d|��||_dS)N�polygonrt�.gif�compoundzThere is no shape type %s)ryr�r�r�r��lower�endswithrrr2r��_data)r�Ztype_�datar�r�r�r�ns


zShape.__init__cCs:|jdkrtd|j��|dkr$|}|j�|||g�dS)a-Add component to a shape of type compound.

        Arguments: poly is a polygon, i. e. a tuple of number pairs.
        fill is the fillcolor of the component,
        outline is the outline color of the component.

        call (for a Shapeobject namend s):
        --   s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue")

        Example:
        >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
        >>> s = Shape("compound")
        >>> s.addcomponent(poly, "red", "blue")
        >>> # .. add more components and then use register_shape()
        r�z Cannot add component to %s ShapeN)ryr�r�r>)r��polyr"r9r�r�r��addcomponent~s
�zShape.addcomponent)N)N)r�r�r�r�r�r�r�r�r�r�rgs
c@sDeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�Tbufferz5Ring buffer used as undobuffer for RawTurtle objects.r�cCs$||_dgg||_d|_d|_dS)Nr�F)�bufsize�buffer�ptr�cumulate)r�r�r�r�r�r��szTbuffer.__init__NcCsD|dkr&t|j�D]}dg|j|<qn||_dgg||_d|_dS)Nr�)rr�r�r�)r�r�r|r�r�r�r`�sz
Tbuffer.resetcCsF|jdkrB|js0|jd|j|_||j|j<n|j|j�|�dSr�)r�r�r�r�r>rGr�r�r��push�s

zTbuffer.pushcCsJ|jdkrF|j|j}|dkr"dSdg|j|j<|jd|j|_|SdSr�)r�r�r�rGr�r�r��pop�s
zTbuffer.popcCs|j|j�dg�Sr�)r�r��countr�r�r�r��nr_of_items�szTbuffer.nr_of_itemscCst|j�dt|j�S)N� )r�r�r�r�r�r�r�r��szTbuffer.__repr__)r�)N)
r�r�r�r�r�r`r�r�r�r�r�r�r�r�r��s

	r�c@s"eZdZdZdZedededfdd�Zdd	�Zd=dd�Zd
d�Z	d>dd�Z
dd�Zdd�Zd?dd�Z
dd�Zdd�Zdd�Zd@dd�ZdAdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdBd.d/�Zd0d1�ZdCd2d3�ZdDd4d5�ZdEd7d8�ZdFd9d:�ZdGd;d<�ZeZ eZ!eZ"e
Z#eZ$d
S)Hrz�Provides screen oriented methods like setbg etc.

    Only relies upon the methods of TurtleScreenBase and NOT
    upon components of the underlying graphics toolkit -
    which is Tkinter in this case.
    Trrrc
Cs�t�||�tdd�tdd�tdd�tdd�tdd�tdd�td|���d	�|_d
di|_||_||_td|_	g|_
|��tj
d
kr�|��}|�ddddd�|�ddddd�dS)Nr�)����r�r�r�rr�))r�)����)r�r�)����)����	)����)����)r�r�)������)���r�)r�r�)r�r��rr�)�r�)�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�)��Q�#@���Q�@)�G�z. @��Q��@)r�r�)r�r�r�)���Q��r�)��Q���r�)�G�z. �r�)��Q�#�r�r�)r�r�)r�r�)r�r�)r�r�)g�g$�)r�r�)r�r�)r�r�)r�r�))r�r�)r�r�)r�r�)r�r�))r���G�z�)rg�����'@)r�r�)�rr)r�r�r�)r�r�rt)Zarrowr�r4ZsquareZtriangler�r/�nopicr�r�darwinZwmZ
attributesr�z-topmost�1�0)r,r�rr0�_shapes�_bgpics�_mode�_delayvaluer��
_colormode�_keysr5�sys�platformr�Zcall)r�r.rrrZ
rootwindowr�r�r�r��s&�


zTurtleScreen.__init__cCs�td|_td|_|�d�|�d�|_d|_d|_d|_g|_	|�
d�d	D]}|�d
|�qP|�d
�|j
d
d
�D]}|�d
|�|�d
|�qzd
t_d
S)aqDelete all drawings and all turtles from the TurtleScreen.

        No argument.

        Reset empty TurtleScreen to its initial state: white background,
        no backgroundimage, no eventbindings and tracing on.

        Example (for a TurtleScreen instance named screen):
        >>> screen.clear()

        Note: this method is not available as function.
        rr�allr�r�r�rr�)r�r��N)r�r�r�rIru�_bgpic�
_bgpicname�_tracing�_updatecounter�_turtlesrrRrr�rr�_pen)r��btnr�r�r�r�r5�s 




zTurtleScreen.clearNcCs||dkr|jS|��}|dkr*td|��||_|dkrp|�|jd|jd|jd|jd�d|_|_|��dS)ahSet turtle-mode ('standard', 'logo' or 'world') and perform reset.

        Optional argument:
        mode -- one of the strings 'standard', 'logo' or 'world'

        Mode 'standard' is compatible with turtle.py.
        Mode 'logo' is compatible with most Logo-Turtle-Graphics.
        Mode 'world' uses userdefined 'worldcoordinates'. *Attention*: in
        this mode angles appear distorted if x/y unit-ratio doesn't equal 1.
        If mode is not given, return the current mode.

             Mode      Initial turtle heading     positive angles
         ------------|-------------------------|-------------------
          'standard'    to the right (east)       counterclockwise
            'logo'        upward    (north)         clockwise

        Examples:
        >>> mode('logo')   # resets turtle heading to north
        >>> mode()
        'logo'
        N�r��logo�worldzNo turtle-graphics-mode %s)r�r�r�r�)	r�r�r�r�r�r�r4r5r`�r�rr�r�r�rs�zTurtleScreen.modecCs�|��dkr|�d�t||�}t||�}|��\}}|�|d|d�|j|j}	}
|j||_|j||_||j}||j}|j|}
|j|}|�|||
|�|�	|j|	|j|
�|�
�dS)asSet up a user defined coordinate-system.

        Arguments:
        llx -- a number, x-coordinate of lower left corner of canvas
        lly -- a number, y-coordinate of lower left corner of canvas
        urx -- a number, x-coordinate of upper right corner of canvas
        ury -- a number, y-coordinate of upper right corner of canvas

        Set up user coodinat-system and switch to mode 'world' if necessary.
        This performs a screen.reset. If mode 'world' is already active,
        all drawings are redrawn according to the new coordinates.

        But ATTENTION: in user-defined coordinatesystems angles may appear
        distorted. (see Screen.mode())

        Example (for a TurtleScreen instance named screen):
        >>> screen.setworldcoordinates(-10,-0.5,50,1.5)
        >>> for _ in range(36):
        ...     left(10)
        ...     forward(0.5)
        r��N)rr�r�r%r4r5r�r�r�r�r,)r�ZllxZllyZurxZuryZxspanZyspanZwxZwyZ	oldxscaleZ	oldyscaler�r�r�r�r�r�r�r'-s 



z TurtleScreen.setworldcoordinatescCsT|dkr2|���d�r(td|�|��}qFtd��nt|t�rFtd|�}||j|<dS)a�Adds a turtle shape to TurtleScreen's shapelist.

        Arguments:
        (1) name is the name of a gif-file and shape is None.
            Installs the corresponding image shape.
            !! Image-shapes DO NOT rotate when turning the turtle,
            !! so they do not display the heading of the turtle!
        (2) name is an arbitrary string and shape is a tuple
            of pairs of coordinates. Installs the corresponding
            polygon shape
        (3) name is an arbitrary string and shape is a
            (compound) Shape object. Installs the corresponding
            compound shape.
        To use a shape, you have to issue the command shape(shapename).

        call: register_shape("turtle.gif")
        --or: register_shape("tri", ((0,0), (10,10), (-10,10)))

        Example (for a TurtleScreen instance named screen):
        >>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3)))

        Nr�rtz;Bad arguments for register_shape.
Use  help(register_shape)r�)r�r�rr2r�r�r�r�)r��namerkr�r�r�r#Ts


zTurtleScreen.register_shapec	Cst|�dkr|d}t|t�rD|�|�s0|dkr4|Stdt|���z|\}}}Wn(ttfk
rztdt|���YnX|jdkr�dd�|||fD�\}}}d|kr�d	kr�nn.d|kr�d	kr�nnd|kr�d	ks�ntd
t|���d|||fS)aReturn color string corresponding to args.

        Argument may be a string or a tuple of three
        numbers corresponding to actual colormode,
        i.e. in the range 0<=n<=colormode.

        If the argument doesn't represent a color,
        an error is raised.
        r�rr�zbad color string: %s�bad color arguments: %sr�cSsg|]}td|��qS�g�o@��round�r{r�r�r�r�r~�sz*TurtleScreen._colorstr.<locals>.<listcomp>��bad color sequence: %s�
#%02x%02x%02x)r�r�r�rOr��	TypeErrorr�r�)r�r9r��g�br�r�r��	_colorstrws


FzTurtleScreen._colorstrcsx��d�s�St��dkr.�fdd�dD�}n4t��dkrV�fdd��dd�D�}ntd	���t�fd
d�|D��S)Nr�r�cs"g|]}t�||d�d��qS)r�r��r�rz��cstrr�r�r~�sz'TurtleScreen._color.<locals>.<listcomp>)r�r�r�r�csg|]}dt�|d��qS)r�r�)r{r7r�r�r�r~�sr�zbad colorstring: %sc3s|]}|�jdVqdS)r�N)r�)r{r�r�r�r��	<genexpr>�sz&TurtleScreen._color.<locals>.<genexpr>)r�r�r�r�)r�r�rBr�)r�r�r��_color�s
zTurtleScreen._colorcCs8|dkr|jS|dkr"t|�|_n|dkr4t|�|_dS)aqReturn the colormode or set it to 1.0 or 255.

        Optional argument:
        cmode -- one of the values 1.0 or 255

        r, g, b values of colortriples have to be in range 0..cmode.

        Example (for a TurtleScreen instance named screen):
        >>> screen.colormode()
        1.0
        >>> screen.colormode(255)
        >>> pencolor(240,160,80)
        Nr�r�)r�r�r�)r�Zcmoder�r�r�r�szTurtleScreen.colormodecCs$|jD]}|�|j�|��qdS)z�Reset all Turtles on the Screen to their initial state.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.reset()
        N)r��_setmoder�r`)r�r�r�r�r�r`�s
zTurtleScreen.resetcCs|jS)z�Return the list of turtles on the screen.

        Example (for a TurtleScreen instance named screen):
        >>> screen.turtles()
        [<turtle.Turtle object at 0x00E11FB0>]
        )r�r�r�r�r�r+�szTurtleScreen.turtlescGs4|r|�|�}nd}|�|�}|dk	r0|�|�}|S)a�Set or return backgroundcolor of the TurtleScreen.

        Arguments (if given): a color string or three numbers
        in the range 0..colormode or a 3-tuple of such numbers.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgcolor("orange")
        >>> screen.bgcolor()
        'orange'
        >>> screen.bgcolor(0.5,0,0.5)
        >>> screen.bgcolor()
        '#800080'
        N)r�rPr��r�rr9r�r�r�r�s

zTurtleScreen.bgcolorcCsB|dkr|jSt|�|_d|_|dk	r0t|�|_|jr>|��dS)aeTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a TurtleScreen instance named screen):
        >>> screen.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     fd(dist)
        ...     rt(90)
        ...     dist += 2
        Nr)r�r�r�r�r,)r��nrr�r�r�r*�s

zTurtleScreen.tracercCs|dkr|jSt|�|_dS)z� Return or set the drawing delay in milliseconds.

        Optional argument:
        delay -- positive integer

        Example (for a TurtleScreen instance named screen):
        >>> screen.delay(15)
        >>> screen.delay()
        15
        N)r�r�rLr�r�r�r�szTurtleScreen.delaycCs<tjsdt_t�|jdkr8|jd7_|j|j;_dS)zIncrement update counter.Trr�N)r�_RUNNINGr�r�r�r�r�r�r��
_incrementudc	s
zTurtleScreen._incrementudccCs<|j}d|_|��D]}|��|��q||_|��dS)z'Perform a TurtleScreen update.
        TN)r�r+�_update_data�_drawturtlerJ)r��tracingrqr�r�r�r,s
zTurtleScreen.updatecCs|��dS)z� Return the width of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        r�r�r�r�r�r�r.szTurtleScreen.window_widthcCs|��dS)z� Return the height of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        r�r�r�r�r�r�r-&szTurtleScreen.window_heightcCs|jS)z�Return the Canvas of this TurtleScreen.

        No argument.

        Example (for a Screen instance named screen):
        >>> cv = screen.getcanvas()
        >>> cv
        <turtle.ScrolledCanvas instance at 0x010742D8>
        )r.r�r�r�r�r/s
zTurtleScreen.getcanvascCst|j���S)z�Return a list of names of all currently available turtle shapes.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.getshapes()
        ['arrow', 'blank', 'circle', ... , 'turtle']
        )�sortedr�r�r�r�r�r�r;s	zTurtleScreen.getshapesr�cCs|�|||�dS)a�Bind fun to mouse-click event on canvas.

        Arguments:
        fun -- a function with two arguments, the coordinates of the
               clicked point on the canvas.
        btn -- the number of the mouse-button, defaults to 1

        Example (for a TurtleScreen instance named screen)

        >>> screen.onclick(goto)
        >>> # Subsequently clicking into the TurtleScreen will
        >>> # make the turtle move to the clicked point.
        >>> screen.onclick(None)
        N)ri�r�r_r�rdr�r�r�rRFszTurtleScreen.onclickcCsF|dkr ||jkr6|j�|�n||jkr6|j�|�|�||�dS)amBind fun to key-release event of key.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkey(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, consequently drawing a hexagon

        N)r��remover>rm�r�r_r�r�r�r�rWs

zTurtleScreen.onkeycCsN|dkr ||jkr>|j�|�n|dk	r>||jkr>|j�|�|�||�dS)aBind fun to key-press event of key if key is given,
        or to any key-press-event if no key is given.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen
        and a Turtle instance named turtle):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkeypress(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, or by keeping pressed the up-arrow key.
        consequently drawing a hexagon.
        N)r�r�r>rnr�r�r�r�rus
zTurtleScreen.onkeypresscCs|��dS)aSet focus on TurtleScreen (in order to collect key-events)

        No arguments.
        Dummy arguments are provided in order
        to be able to pass listen to the onclick method.

        Example (for a TurtleScreen instance named screen):
        >>> screen.listen()
        N)ro)r��xdummy�ydummyr�r�r�r�s
zTurtleScreen.listenrcCs|�||�dS)a�Install a timer, which calls fun after t milliseconds.

        Arguments:
        fun -- a function with no arguments.
        t -- a number >= 0

        Example (for a TurtleScreen instance named screen):

        >>> running = True
        >>> def f():
        ...     if running:
        ...             fd(50)
        ...             lt(60)
        ...             screen.ontimer(f, 250)
        ...
        >>> f()   # makes the turtle marching around
        >>> running = False
        N)rrrpr�r�r�r"�szTurtleScreen.ontimercCsF|dkr|jS||jkr(|�|�|j|<|�|j|j|�||_dS)aFSet background image or return name of current backgroundimage.

        Optional argument:
        picname -- a string, name of a gif-file or "nopic".

        If picname is a filename, set the corresponding image as background.
        If picname is "nopic", delete backgroundimage, if present.
        If picname is None, return the filename of the current backgroundimage.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgpic()
        'nopic'
        >>> screen.bgpic("landscape.gif")
        >>> screen.bgpic()
        'landscape.gif'
        N)r�r�r2rxr�)r�Zpicnamer�r�r�r�s
zTurtleScreen.bgpiccCs|�|||�S)a�Resize the canvas the turtles are drawing on.

        Optional arguments:
        canvwidth -- positive integer, new width of canvas in pixels
        canvheight --  positive integer, new height of canvas in pixels
        bg -- colorstring or color-tuple, new backgroundcolor
        If no arguments are given, return current (canvaswidth, canvasheight)

        Do not alter the drawing window. To observe hidden parts of
        the canvas use the scrollbars. (Can make visible those parts
        of a drawing, which were outside the canvas before!)

        Example (for a Turtle instance named turtle):
        >>> turtle.screensize(2000,1500)
        >>> # e.g. to search for an erroneously escaped turtle ;-)
        )r�rr�r�r�r%�szTurtleScreen.screensize)N)N)N)NN)N)r�N)N)NN)r)N)NNN)%r�r�r�r�r�r�r�r5rr'r#r�r�rr`r+rr*rr�r,r.r-rrrRrrrr"rr%r!r$rrr r�r�r�r�r�sH�
(
"'
#
	

			

 



c@sTeZdZdZedd�edd�edd�d�ZdZdZdZefdd	�Z	d
d�Z
dBd
d�Zdd�ZdCdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�ZdDd*d+�Zd,d-�Zd.d/�Zd0d1�ZdEd2d3�ZdFd4d5�Zd6d7�Zd8d9�Z dGd:d;�Z!dHd<d=�Z"dId>d?�Z#dJd@dA�Z$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,e Z-dS)K�
TNavigatorzRNavigation part of the RawTurtle.
    Implements methods for turtle movement.
    r��)r�r�r�r�rr�cCsB|j|_|j|_||_d|_|��d|_|�|�t�	|�dSr�)
�DEFAULT_ANGLEOFFSET�_angleOffset�DEFAULT_ANGLEORIENT�_angleOrientr��
undobufferr:r�r�r`r�r�r�r�r��s
zTNavigator.__init__cCstdd�|_tj|j|_dS)zXreset turtle to its initial values

        Will be overwritten by parent class
        r�N)r�	_positionr��START_ORIENTATIONr��_orientr�r�r�r�r`�szTNavigator.resetNcCsL|dkr|jS|dkrdS||_|dkr6d|_d|_n|jd|_d|_dS)z:Set turtle-mode to 'standard', 'world' or 'logo'.
        Nr�)r�r�rr��@r�)r�rr�_fullcircler�r�r�r�r�szTNavigator._setmodecCs0||_d||_|jdkr"d|_n
|d|_dS)z+Helper function for degrees() and radians()ihr�rrN)r�
_degreesPerAUr�r�r�Z
fullcircler�r�r��_setDegreesPerAUs


zTNavigator._setDegreesPerAU��v@cCs|�|�dS)a> Set angle measurement units to degrees.

        Optional argument:
        fullcircle -  a number

        Set angle measurement units, i. e. set number
        of 'degrees' for a full circle. Default value is
        360 degrees.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(90)
        >>> turtle.heading()
        90

        Change angle measurement unit to grad (also known as gon,
        grade, or gradian and equals 1/100-th of the right angle.)
        >>> turtle.degrees(400.0)
        >>> turtle.heading()
        100

        N)rr
r�r�r�r:szTNavigator.degreescCs|�dtj�dS)a Set the angle measurement units to radians.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        90
        >>> turtle.radians()
        >>> turtle.heading()
        1.5707963267948966
        r�N)rr�r�r�r�r�r�r^5szTNavigator.radianscCs|j|j|}|�|�dS)z)move turtle forward by specified distanceN)rr�_goto)r�r;Zender�r�r��_goCszTNavigator._gocCs||j9}|j�|�|_dS)z=Turn turtle counterclockwise by specified angle if angle > 0.N)r	rr��r�r�r�r�r��_rotateHs
zTNavigator._rotatecCs
||_dS)zmove turtle to position end.N�r)r��endr�r�r�r
MszTNavigator._gotocCs|�|�dS)aMove the turtle forward by the specified distance.

        Aliases: forward | fd

        Argument:
        distance -- a number (integer or float)

        Move the turtle forward by the specified distance, in the direction
        the turtle is headed.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.forward(25)
        >>> turtle.position()
        (25.00,0.00)
        >>> turtle.forward(-75)
        >>> turtle.position()
        (-50.00,0.00)
        N�r�r�r;r�r�r�rCQszTNavigator.forwardcCs|�|�dS)a�Move the turtle backward by distance.

        Aliases: back | backward | bk

        Argument:
        distance -- a number

        Move the turtle backward by distance, opposite to the direction the
        turtle is headed. Do not change the turtle's heading.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.backward(30)
        >>> turtle.position()
        (-30.00, 0.00)
        Nrrr�r�r�r/hszTNavigator.backcCs|�|�dS)a�Turn turtle right by angle units.

        Aliases: right | rt

        Argument:
        angle -- a number (integer or float)

        Turn turtle right by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.right(45)
        >>> turtle.heading()
        337.0
        N�rrr�r�r�r_|szTNavigator.rightcCs|�|�dS)a�Turn turtle left by angle units.

        Aliases: left | lt

        Argument:
        angle -- a number (integer or float)

        Turn turtle left by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.left(45)
        >>> turtle.heading()
        67.0
        Nrrr�r�r�rP�szTNavigator.leftcCs|jS)z�Return the turtle's current location (x,y), as a Vec2D-vector.

        Aliases: pos | position

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 240.00)
        rr�r�r�r�r[�szTNavigator.poscCs
|jdS)z� Return the turtle's x coordinate.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.xcor()
        50.0
        rrr�r�r�r�r|�szTNavigator.xcorcCs
|jdS)a	 Return the turtle's y coordinate
        ---
        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.ycor()
        86.6025403784
        r�rr�r�r�r�r}�szTNavigator.ycorcCs,|dkr|�t|��n|�t||��dS)atMove turtle to an absolute position.

        Aliases: setpos | setposition | goto:

        Arguments:
        x -- a number      or     a pair/vector of numbers
        y -- a number             None

        call: goto(x, y)         # two coordinates
        --or: goto((x, y))       # a pair (tuple) of coordinates
        --or: goto(vec)          # e.g. as returned by pos()

        Move turtle to an absolute position. If the pen is down,
        a line will be drawn. The turtle's orientation does not change.

        Example (for a Turtle instance named turtle):
        >>> tp = turtle.pos()
        >>> tp
        (0.00, 0.00)
        >>> turtle.setpos(60,30)
        >>> turtle.pos()
        (60.00,30.00)
        >>> turtle.setpos((20,80))
        >>> turtle.pos()
        (20.00,80.00)
        >>> turtle.setpos(tp)
        >>> turtle.pos()
        (0.00,0.00)
        N)r
r)r�r�r�r�r�r�rI�szTNavigator.gotocCs|�dd�|�d�dS)a$Move turtle to the origin - coordinates (0,0).

        No arguments.

        Move turtle to the origin - coordinates (0,0) and set its
        heading to its start-orientation (which depends on mode).

        Example (for a Turtle instance named turtle):
        >>> turtle.home()
        rN)rIrdr�r�r�r�rL�szTNavigator.homecCs|�t||jd��dS)a�Set the turtle's first coordinate to x

        Argument:
        x -- a number (integer or float)

        Set the turtle's first coordinate to x, leave second coordinate
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 240.00)
        >>> turtle.setx(10)
        >>> turtle.position()
        (10.00, 240.00)
        r�N�r
rr)r�r�r�r�r�riszTNavigator.setxcCs|�t|jd|��dS)a�Set the turtle's second coordinate to y

        Argument:
        y -- a number (integer or float)

        Set the turtle's first coordinate to x, second coordinate remains
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 40.00)
        >>> turtle.sety(-10)
        >>> turtle.position()
        (0.00, -10.00)
        rNr)r�r�r�r�r�rjszTNavigator.setycCsT|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}t||j�S)a�Return the distance from the turtle to (x,y) in turtle step units.

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 0.00)
        >>> turtle.distance(30,40)
        50.0
        >>> pen = Turtle()
        >>> pen.forward(77)
        >>> turtle.distance(pen)
        77.0
        N)rr�r�r�r�abs)r�r�r�r[r�r�r�r;%s




zTNavigator.distancecCs�|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}||j\}}tt�||�dtjd�d}||j	}|j
|j||jS)aCReturn the angle of the line from the turtle's position to (x, y).

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Return the angle, between the line from turtle-position to position
        specified by x, y and the turtle's start orientation. (Depends on
        modes - "standard" or "logo")

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (10.00, 10.00)
        >>> turtle.towards(0,0)
        225.0
        Nr�r�r)
rr�r�r�rr�r��atan2r�r	rrr)r�r�r�r[�resultr�r�r�ruEs




 
zTNavigator.towardscCsJ|j\}}tt�||�dtjd�d}||j}|j|j||jS)z� Return the turtle's current heading.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(67)
        >>> turtle.heading()
        67.0
        r�r�r)	rr�r�rr�r	rrr)r�r�r�rr�r�r�rJhs

 
zTNavigator.headingcCs>||��|j}|j}||d||d}|�|�dS)a�Set the orientation of the turtle to to_angle.

        Aliases:  setheading | seth

        Argument:
        to_angle -- a number (integer or float)

        Set the orientation of the turtle to to_angle.
        Here are some common directions in degrees:

         standard - mode:          logo-mode:
        -------------------|--------------------
           0 - east                0 - north
          90 - north              90 - east
         180 - west              180 - south
         270 - south             270 - west

        Example (for a Turtle instance named turtle):
        >>> turtle.setheading(90)
        >>> turtle.heading()
        90
        �@N)rJrrr)r�Zto_angler�Zfullr�r�r�rdwszTNavigator.setheadingcCsp|jr|j�dg�d|j_|��}|dkr2|j}|dkrjt|�|j}dttdt|�dd�|�}d||}d	|}d
|t�	|tj
d|j�}|dkr�|||}}}|��}	|�
�}
|dkr�|�dd�n
|�d�|�|�t|�D].}|�|�|�|�|�d�|�|��q|�|�|dk�rR|�|	|
�|�|�|j�rld
|j_dS)a� Draw a circle with given radius.

        Arguments:
        radius -- a number
        extent (optional) -- a number
        steps (optional) -- an integer

        Draw a circle with given radius. The center is radius units left
        of the turtle; extent - an angle - determines which part of the
        circle is drawn. If extent is not given, draw the entire circle.
        If extent is not a full circle, one endpoint of the arc is the
        current pen position. Draw the arc in counterclockwise direction
        if radius is positive, otherwise in clockwise direction. Finally
        the direction of the turtle is changed by the amount of extent.

        As the circle is approximated by an inscribed regular polygon,
        steps determines the number of steps to use. If not given,
        it will be calculated automatically. Maybe used to draw regular
        polygons.

        call: circle(radius)                  # full circle
        --or: circle(radius, extent)          # arc
        --or: circle(radius, extent, steps)
        --or: circle(radius, steps=6)         # 6-sided polygon

        Example (for a Turtle instance named turtle):
        >>> turtle.circle(50)
        >>> turtle.circle(120, 180)  # semicircle
        �seqTNr��g@g�M@r�r�rr�rF)rr�r�rprrr��minr�r�r�r	�_tracerrMrrr)r��radiusZextent�stepsrpZfracr6Zw2�lZtrZdlr|r�r�r�r4�s>""






zTNavigator.circlecCsdS�z/dummy method - to be overwritten by child classNr�)r�r�r�r�r�rp�szTNavigator.speedcCsdSr"r�)r��ar�r�r�r�r�szTNavigator._tracercCsdSr"r�)r�r�r�r�r�rM�szTNavigator._delay)N)r)N)N)N)NN)r)NN)N).r�r�r�r�rrZDEFAULT_MODEr�rr�r`r�rr:r^rrr
rCr/r_rPr[r|r}rIrLrirjr;rurJrdr4rprrMr@r3r0rbrQr\rerfrcr�r�r�r�r��sZ�

	


#
 
#
A


r�c@s�eZdZdZedfdd�Zededfdd�Zd.d
d�Zd/dd
�Zdd�Z	dd�Z
dd�Zd0dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd1d"d#�Zd2d%d&�Zd3d(d)�Zd*d+�Zd,d-�ZeZe	Ze	Ze
Ze
ZeZeZd	S)4�TPenzFDrawing part of the RawTurtle.
    Implements drawing properties.
    racCs||_d|_t�|�dSr�)�_resizemoderr$�_reset)r�rar�r�r�r��sz
TPen.__init__rWrAcCsFd|_d|_||_||_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr�Tr�)r�r�r�)r�r�r�r�)�_pensize�_shown�	_pencolor�
_fillcolor�_drawing�_speed�_stretchfactor�_shearfactor�_tilt�_shapetrafo�
_outlinewidth)r�rWrAr�r�r�r&�szTPen._resetNcCs.|dkr|jS|��}|dkr*|j|d�dS)azSet resizemode to one of the values: "auto", "user", "noresize".

        (Optional) Argument:
        rmode -- one of the strings "auto", "user", "noresize"

        Different resizemodes have the following effects:
          - "auto" adapts the appearance of the turtle
                   corresponding to the value of pensize.
          - "user" adapts the appearance of the turtle according to the
                   values of stretchfactor and outlinewidth (outline),
                   which are set by shapesize()
          - "noresize" no adaption of the turtle's appearance takes place.
        If no argument is given, return current resizemode.
        resizemode("user") is called by a call of shapesize with arguments.


        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("noresize")
        >>> turtle.resizemode()
        'noresize'
        N)�auto�userr��ra)r%r�rV)r�Zrmoder�r�r�ra�s
zTPen.resizemodecCs|dkr|jS|j|d�dS)a!Set or return the line thickness.

        Aliases:  pensize | width

        Argument:
        width -- positive number

        Set the line thickness to width or return it. If resizemode is set
        to "auto" and turtleshape is a polygon, that polygon is drawn with
        the same line thickness. If no argument is given, current pensize
        is returned.

        Example (for a Turtle instance named turtle):
        >>> turtle.pensize()
        1
        >>> turtle.pensize(10)   # from here on lines of width 10 are drawn
        N)rY)r'rV)r�rzr�r�r�rYszTPen.pensizecCs|js
dS|jdd�dS)z�Pull the pen up -- no drawing when moving.

        Aliases: penup | pu | up

        No argument

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        NF�rX�r+rVr�r�r�r�rZ0s
z
TPen.penupcCs|jr
dS|jdd�dS)z�Pull the pen down -- drawing when moving.

        Aliases: pendown | pd | down

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.pendown()
        NTr5r6r�r�r�r�rX>s
zTPen.pendowncCs|jS)aReturn True if pen is down, False if it's up.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        >>> turtle.isdown()
        False
        >>> turtle.pendown()
        >>> turtle.isdown()
        True
        )r+r�r�r�r�rNLs
zTPen.isdowncCsjdddddd�}|dkr|jS||kr0||}n*d|krDd	krVnntt|��}nd}|j|d
�dS)a� Return or set the turtle's speed.

        Optional argument:
        speed -- an integer in the range 0..10 or a speedstring (see below)

        Set the turtle's speed to an integer value in the range 0 .. 10.
        If no argument is given: return current speed.

        If input is a number greater than 10 or smaller than 0.5,
        speed is set to 0.
        Speedstrings  are mapped to speedvalues in the following way:
            'fastest' :  0
            'fast'    :  10
            'normal'  :  6
            'slow'    :  3
            'slowest' :  1
        speeds from 1 to 10 enforce increasingly faster animation of
        line drawing and turtle turning.

        Attention:
        speed = 0 : *no* animation takes place. forward/back makes turtle jump
        and likewise left/right make the turtle turn instantly.

        Example (for a Turtle instance named turtle):
        >>> turtle.speed(3)
        rr�r�r�r�)ZfastestZfast�normalZslowZslowestNr�g%@)rp)r,r�r�rV)r�rpZspeedsr�r�r�rp[s
z
TPen.speedcGs�|rht|�}|dkr"|d}}n"|dkr4|\}}n|dkrD|}}|�|�}|�|�}|j||d�n|�|j�|�|j�fSdS)a�Return or set the pencolor and fillcolor.

        Arguments:
        Several input formats are allowed.
        They use 0, 1, 2, or 3 arguments as follows:

        color()
            Return the current pencolor and the current fillcolor
            as a pair of color specification strings as are returned
            by pencolor and fillcolor.
        color(colorstring), color((r,g,b)), color(r,g,b)
            inputs as in pencolor, set both, fillcolor and pencolor,
            to the given value.
        color(colorstring1, colorstring2),
        color((r1,g1,b1), (r2,g2,b2))
            equivalent to pencolor(colorstring1) and fillcolor(colorstring2)
            and analogously, if the other input format is used.

        If turtleshape is a polygon, outline and interior of that polygon
        is drawn with the newly set colors.
        For more info see: pencolor, fillcolor

        Example (for a Turtle instance named turtle):
        >>> turtle.color('red', 'green')
        >>> turtle.color()
        ('red', 'green')
        >>> colormode(255)
        >>> color((40, 80, 120), (160, 200, 240))
        >>> color()
        ('#285078', '#a0c8f0')
        r�rr�r�)rWrAN)r�r�rVr�r)r*)r�rr!ZpcolorZfcolorr�r�r�r9�s 


z
TPen.colorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)aZ Return or set the pencolor.

        Arguments:
        Four input formats are allowed:
          - pencolor()
            Return the current pencolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - pencolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - pencolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - pencolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the outline of that polygon is drawn
        with the newly set pencolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.pencolor('brown')
        >>> tup = (0.2, 0.8, 0.55)
        >>> turtle.pencolor(tup)
        >>> turtle.pencolor()
        '#33cc8c'
        N)rW)r�r)rVr�r�r�r�r�rW�s

z
TPen.pencolorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)a] Return or set the fillcolor.

        Arguments:
        Four input formats are allowed:
          - fillcolor()
            Return the current fillcolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - fillcolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - fillcolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - fillcolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the interior of that polygon is drawn
        with the newly set fillcolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.fillcolor('violet')
        >>> col = turtle.pencolor()
        >>> turtle.fillcolor(col)
        >>> turtle.fillcolor(0, .5, 0)
        N)rA)r�r*rVr�r�r�r�r�rA�s

zTPen.fillcolorcCs|jdd�dS)z�Makes the turtle visible.

        Aliases: showturtle | st

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> turtle.showturtle()
        T��shownN�rVr�r�r�r�ro�szTPen.showturtlecCs|jdd�dS)aYMakes the turtle invisible.

        Aliases: hideturtle | ht

        No argument.

        It's a good idea to do this while you're in the
        middle of a complicated drawing, because hiding
        the turtle speeds up the drawing observably.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        Fr8Nr:r�r�r�r�rK	szTPen.hideturtlecCs|jS)z�Return True if the Turtle is shown, False if it's hidden.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> print turtle.isvisible():
        False
        )r(r�r�r�r�rO	s
zTPen.isvisiblecKs�|j|j|j|j|j|j|j|j|j|j	|j
d�}|s>|s>|St|t�rN|}ni}|�
|�i}|D]}||||<qd|jr�|j�d|f�d}d|kr�|j|dkr�d}d|kr�t|dt�r�|�|df�|d<|j|dkr�d}d|k�r|j|dk�rd}|�r|��d|k�r&|d|_d|k�r:|d|_d|k�rN|d|_d|k�r�t|dt��r||�|df�|d<|d|_d	|k�r�|d	|_d
|k�r�|d
|_d|k�r�|d}t|ttf��r�||f}||_d|k�r�|d|_d
|k�r|d
|_	d|k�r|d|_d|k�r.|d|_
d|k�sLd|k�sLd|k�r�|j\}	}
|j}t�|j
�t�|j
�}}
|	|
|
||
||	||
|
||f|_|��dS)aLReturn or set the pen's attributes.

        Arguments:
            pen -- a dictionary with some or all of the below listed keys.
            **pendict -- one or more keyword-arguments with the below
                         listed keys as keywords.

        Return or set the pen's attributes in a 'pen-dictionary'
        with the following key/value pairs:
           "shown"      :   True/False
           "pendown"    :   True/False
           "pencolor"   :   color-string or color-tuple
           "fillcolor"  :   color-string or color-tuple
           "pensize"    :   positive number
           "speed"      :   number in range 0..10
           "resizemode" :   "auto" or "user" or "noresize"
           "stretchfactor": (positive number, positive number)
           "shearfactor":   number
           "outline"    :   positive number
           "tilt"       :   number

        This dictionary can be used as argument for a subsequent
        pen()-call to restore the former pen-state. Moreover one
        or more of these attributes can be provided as keyword-arguments.
        This can be used to set several pen attributes in one statement.


        Examples (for a Turtle instance named turtle):
        >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10)
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'black',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> penstate=turtle.pen()
        >>> turtle.color("yellow","")
        >>> turtle.penup()
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'yellow', 'pendown': False, 'fillcolor': '',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> p.pen(penstate, fillcolor="green")
        >>> p.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'green',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        )r9rXrWrArYrpra�
stretchfactorrnr9rsrVFrXTrWrYrArprar;rnr9r9rsN)r(r+r)r*r'r,r%r-r.r1r/r��dictr,rr�r�r��_newLiner�r�r�r�r�r0rJ)r�rVZpendictZ_pd�pZ_p_bufr�ZnewLineZsfZscxZscyZshf�sa�car�r�r�rV!	s�/�

























�zTPen.penTcCsdSr"r��r�ZusePosr�r�r�r=�	sz
TPen._newLineFcCsdSr"r�)r�r�Zforcedr�r�r�rJ�	szTPen._updatecCsdSr"r�rr�r�r�r��	szTPen._colorcCsdSr"r�rr�r�r�r��	szTPen._colorstr)N)N)N)N)T)TF)r�r�r�r�r�r�r&rarYrZrXrNrpr9rWrArorKrOrVr=rJr�r�rzryr]rUr=rqrMr�r�r�r�r$�s:�



&.%$



r$c@s eZdZdZdd�Zdd�ZdS)�_TurtleImagez6Helper class: Datatype to store Turtle attributes
    cCs||_d|_|�|�dSr�)r�ry�	_setshape)r�r��
shapeIndexr�r�r�r��	sz_TurtleImage.__init__cs�|j�||_|jdkr*�j|jkr2nndS|jdkrP�j|jkrXnndS|jdkrp��|j�n |jdkr�|jD]}��|�q��j|j|_|jdkr����|_nF|jdkrԈ��jdj�|_n&|jdkr��fdd��j|jD�|_dS)Nr�rt)rtr�r�r/csg|]}����qSr��r:�r{rH�r�r�r�r~�	sz*_TurtleImage._setshape.<locals>.<listcomp>)	r�rDryr�rI�_itemr:rur�)r�rDrHr�rGr�rC�	s(""







�z_TurtleImage._setshapeN)r�r�r�r�r�rCr�r�r�r�rB�	srBc@s�eZdZdZgZdedededfdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dmdd�Zdd�Zdd�Zdd�Zdd�Zdnd d!�Zdod"d#�Zdpd$d%�Zd&d'�Zdqd(d)�Zd*d+�Zdrd,d-�Zd.d/�Zd0d1�Zdsd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z dtd=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dudFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dvdNdO�Z)dPdQ�Z*dwdTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0e0Z1dxd`da�Z2dydcdd�Z3dzdedf�Z4d{dgdh�Z5didj�Z6dkdl�Z7eZ8dS)|r
zvAnimation part of the RawTurtle.
    Puts RawTurtle upon a TurtleScreen and provides tools for
    its animation.
    Nrkr�r�cCs4t|t�r||_n|t|t�r:|tjkr2tj�|�||_nTt|ttf�r�tjD]}|j	|krN||_q�qNt|�|_tj�|j�nt
d|��|j}t�||�
��t�|�|j�|�|��|_t||�|_d|_d|_d|_|_||_d|_|��|_|jg|_|jg|_g|_||_t |�|_!|�"�dS)Nzbad canvas argument %sF)#r��_Screenr�rr
�screensr>rr�r.r�r�r�rr$r�rD�drawingLineItemrBr��_poly�
_creatingPoly�	_fillitem�	_fillpathr(�_hidden_from_screen�currentLineItemr�currentLiner��
stampItems�_undobuffersizer�rrJ)r�Zcanvasrkr�r�r�r�r�r�r��	s@











zRawTurtle.__init__cCs0t�|�t�|�|��|��|��dS)a�Delete the turtle's drawings and restore its default values.

        No argument.

        Delete the turtle's drawings from the screen, re-center the turtle
        and set variables to the default values.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00,-22.00)
        >>> turtle.heading()
        100.0
        >>> turtle.reset()
        >>> turtle.position()
        (0.00,0.00)
        >>> turtle.heading()
        0.0
        N)r�r`r$r&�_clearr�rJr�r�r�r�r`
s


zRawTurtle.resetcCs&|dks|dkrd|_n
t|�|_dS)a�Set or disable undobuffer.

        Argument:
        size -- an integer or None

        If size is an integer an empty undobuffer of given size is installed.
        Size gives the maximum number of turtle-actions that can be undone
        by the undo() function.
        If size is None, no undobuffer is present.

        Example (for a Turtle instance named turtle):
        >>> turtle.setundobuffer(42)
        Nr)rr�)r��sizer�r�r�rh
szRawTurtle.setundobuffercCs|jdkrdS|j��S)z�Return count of entries in the undobuffer.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> while undobufferentries():
        ...     undo()
        Nr)rr�r�r�r�r�rx,
s	
zRawTurtle.undobufferentriescCsld|_|_|jD]}|j�|�q|j��|_g|_|jrJ|j�	|j
�|jg|_|��|�|j
�dS)zDelete all of pen's drawingsN)rNrOr�r�rIrDrQrRr+r>rr7rhrTrGr�r�r�rU9
s

zRawTurtle._clearcCs|��|��dS)agDelete the turtle's drawings from the screen. Do not move turtle.

        No arguments.

        Delete the turtle's drawings from the screen. Do not move turtle.
        State and position of the turtle as well as drawings of other
        turtles are not affected.

        Examples (for a Turtle instance named turtle):
        >>> turtle.clear()
        N)rUrJr�r�r�r�r5G
szRawTurtle.clearcCsF|j��|jjdkrdSt|j�dkrB|j�|j|j|j|j�dSr�)	r�r�r�r�rRrErQr)r'r�r�r�r�r�V
s
�zRawTurtle._update_datacCsx|j}|jdkrdS|jdkrD|��|��|��|�|j�n0|��|jdkrt|��D]}|��q^|��dS)z&Perform a Turtle-data update.
        rNr�)	r�r�r�r�rJrMr�r�r+)r�r�rqr�r�r�rJ^
s



zRawTurtle._updatecCs|j�||�S)amTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a Turtle instance named turtle):
        >>> turtle.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     turtle.fd(dist)
        ...     turtle.rt(90)
        ...     dist += 2
        )r�r*)r��flagrr�r�r�rp
szRawTurtle._tracercCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorcCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorstrc	Cs�t|t�r|Sz|\}}}Wn(ttfk
rDtdt|���YnX|jjdkrldd�|||fD�\}}}d|kr�dkr�nn.d|kr�dkr�nnd|kr�dks�ntdt|���d|||fS)	z,Convert colortriples to hexstrings.
        r�r�cSsg|]}td|��qSr�r�r�r�r�r�r~�
sz!RawTurtle._cc.<locals>.<listcomp>rr�r�r�)r�r�r�r�r�r�r�)r�rr�r�r�r�r�r��_cc�
s
Fz
RawTurtle._cccs�|j�|�|j�|j}d|_d|_t|�}�|_||_�|_t�|jj�|_�j�|��j	|jjj
}|dkr����|j_nJ|dkr���
�j	dj�|j_n*|dkrʇfdd��j	|jjjD�|j_���|_|��|S)aCreate and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
        Nr�rtr/r�csg|]}����qSr�rErFrGr�r�r~�
sz#RawTurtle.clone.<locals>.<listcomp>)r�r=r+r�rrBrDr�r>r�ryr:rHrur�rDrQrJ)r�r��q�ttyper�rGr�r8�
s.
�

zRawTurtle.clonecCsB|dkr|jjS||j��kr*td|��|j�|�|��dS)a�Set turtle shape to shape with given name / return current shapename.

        Optional argument:
        name -- a string, which is a valid shapename

        Set turtle shape to shape with given name or, if name is not given,
        return name of current shape.
        Shape with name must exist in the TurtleScreen's shape dictionary.
        Initially there are the following polygon shapes:
        'arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'.
        To learn about how to deal with shapes see Screen-method register_shape.

        Example (for a Turtle instance named turtle):
        >>> turtle.shape()
        'arrow'
        >>> turtle.shape("turtle")
        >>> turtle.shape()
        'turtle'
        NzThere is no shape named %s)r�rDr�rr�rCrJ)r�r�r�r�r�rk�
szRawTurtle.shapecCs�||kr|krdkr8nn|j\}}|||jfS|dksH|dkrPtd��|dk	rt|dkrj||f}q�||f}n|dk	r�|jd|f}n|j}|dkr�|j}|jd||d�dS)aOSet/return turtle's stretchfactors/outline. Set resizemode to "user".

        Optional arguments:
           stretch_wid : positive number
           stretch_len : positive number
           outline  : positive number

        Return or set the pen's attributes x/y-stretchfactors and/or outline.
        Set resizemode to "user".
        If and only if resizemode is set to "user", the turtle will be displayed
        stretched according to its stretchfactors:
        stretch_wid is stretchfactor perpendicular to orientation
        stretch_len is stretchfactor in direction of turtles orientation.
        outline determines the width of the shapes's outline.

        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("user")
        >>> turtle.shapesize(5, 5, 12)
        >>> turtle.shapesize(outline=8)
        Nrz(stretch_wid/stretch_len must not be zeror3)rar;r9)r-r1r�rV)r�Zstretch_widZstretch_lenr9r;r�r�r�rl�
s$"


�zRawTurtle.shapesizecCs |dkr|jS|jd|d�dS)a�Set or return the current shearfactor.

        Optional argument: shear -- number, tangent of the shear angle

        Shear the turtleshape according to the given shearfactor shear,
        which is the tangent of the shear angle. DO NOT change the
        turtle's heading (direction of movement).
        If shear is not given: return the current shearfactor, i. e. the
        tangent of the shear angle, by which lines parallel to the
        heading of the turtle are sheared.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.shearfactor(0.5)
        >>> turtle.shearfactor()
        >>> 0.5
        Nr3)rarn)r.rV)r�Zshearr�r�r�rnszRawTurtle.shearfactorcCs<||j|j}|tjddtj}|jd|d�dS)aIRotate the turtleshape to point in the specified direction

        Argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).


        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.settiltangle(45)
        >>> stamp()
        >>> turtle.fd(50)
        >>> turtle.settiltangle(-45)
        >>> stamp()
        >>> turtle.fd(50)
        r�r�r3)rarsN)r	rr�r�rV�r�r�rsr�r�r�rgszRawTurtle.settiltanglecCs>|dkr0|jdtj|j}||j|jS|�|�dS)a�Set or return the current tilt-angle.

        Optional argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).
        If angle is not given: return the current tilt-angle, i. e. the angle
        between the orientation of the turtleshape and the heading of the
        turtle (its direction of movement).

        Deprecated since Python 3.1

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(45)
        >>> turtle.tiltangle()
        Nr�)r/r�r�rr	rrgr[r�r�r�rt4szRawTurtle.tiltanglecCs|�||���dS)a�Rotate the turtleshape by angle.

        Argument:
        angle - a number

        Rotate the turtleshape by angle from its current tilt-angle,
        but do NOT change the turtle's heading (direction of movement).

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        N)rgrtrr�r�r�rsNszRawTurtle.tiltcCs6||kr(|kr(|kr(dkr2nn|jS|j\}}}}|dk	rL|}|dk	rX|}|dk	rd|}|dk	rp|}||||dkr�td��||||f|_t�||�dtj}	t�|	�t�|	�}
}|||
||||
||
||||
|||f\}}
}}||f|_|
||_|	|_	|j
dd�dS)a�Set or return the current transformation matrix of the turtle shape.

        Optional arguments: t11, t12, t21, t22 -- numbers.

        If none of the matrix elements are given, return the transformation
        matrix.
        Otherwise set the given elements and transform the turtleshape
        according to the matrix consisting of first row t11, t12 and
        second row t21, 22.
        Modify stretchfactor, shearfactor and tiltangle according to the
        given matrix.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapesize(4,2)
        >>> turtle.shearfactor(-0.5)
        >>> turtle.shapetransform()
        (4.0, -1.0, -0.0, 2.0)
        Nrz0Bad shape transform matrix: must not be singularr�r3r4)r0r�r�rr�r�r�r-r.r/rV)r��t11�t12�t21�t22Zm11Zm12Zm21Zm22Zalfar?r@Za11Za12Za21Za22r�r�r�rmas0,�

zRawTurtle.shapetransformcs^|j�|j\��|j\��t���j�j�}dt|�|\�������fdd�|D�S)zlComputes transformed polygon shapes from a shape
        according to current position and heading.
        r�csFg|]>\}}��|�|�j��|�|�jf�qSr�)r4r5�r{r�r��Ze0Ze1Zp0Zp1r�r�r�r~�s�z(RawTurtle._polytrafo.<locals>.<listcomp>)r�rrrr5r4r)r�r��er�rar��
_polytrafo�s

�zRawTurtle._polytrafocCs2|jj|jj}|jdkr.|�|j|jdk�SdS)a@Return the current shape polygon as tuple of coordinate pairs.

        No argument.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapetransform(4, -1, 0, 2)
        >>> turtle.get_shapepoly()
        ((50, -20), (30, 20), (-50, 20), (-30, -20))

        r�r�N)r�r�r�rDry�
_getshapepolyr�)r�rkr�r�r�rG�s
zRawTurtle.get_shapepolyFcsx|jdks|r|j\����n>|jdkrNtd|jd�}|dd|f\����n|jdkr\|St����fdd�|D��S)	z`Calculate transformed shape polygon according to resizemode
        and shapetransform.
        r3r2r�g@rr�c3s2|]*\}}�|�|�|�|fVqdSr�r�r`�r\r]r^r_r�r�r��sz*RawTurtle._getshapepoly.<locals>.<genexpr>)r%r0�maxr'r�)r�r�r�r!r�rer�rd�s

zRawTurtle._getshapepolyc	Cs�|j}|j|jj}|j}|jj}|j�r*|jdk�r*|jdk�r*d|_	|j
}|dkr�|jdkrfd}n|jdkrx|j}n|j
}|�|�|��}|j|j}}|j|||||dd�nt|d	kr�|�||j|�nZ|d
k�r�t||�D]D\}	\}
}}|�|�|
d��}
|j|	|
|�|�|�|�|j
dd�q�nx|j	�r6dS|dk�rR|�|dd
d
�nJ|d	k�rv|�||j|jdj
�n&|d
k�r�|D]}	|�|	dd
d
��q�d|_	dS)zpManages the correct rendering of the turtle with respect to
        its shape, resizemode, stretch and tilt etc.rFr�r�r�r2T�r"r9rzrArtr�N�r�r�r�r�r/)r�r�r�rDryrHr(r�r�rPr�r%r'r1rcrdr*r)rCrwr�ziprX)r�r�rkrZZtitem�tshaper6�fc�ocrHr�r�r�r�r��sR 

�
�




�
zRawTurtle._drawturtlec	CsT|j}|j|jj}|j}|j}|dkr�|��}|jdkr@d}n|jdkrR|j}n|j	}|�
|�|��}|j|j
}}|j|||||dd�n�|dkr�|�d�}|�||j|�n�|d	k�r4g}|D]}	|��}
|�|
�q�t|�}t||�D]D\}
\}}}|�
|�|d��}|j|
||�|�|�|�|j	dd�q�|j�|�|j�d
|f�|S)a�Stamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
        r�r�r�r2Trgrtr�r�rr)r�r�r�rDryr�r:r%r'r1rcrdr*r)rCrurwrr>r�rirXrSrr�)r�r�rkrZrj�stitemr6rkrlZelementrHr�r�r�r�rr�sH

�

�zRawTurtle.stampcCs�||jkrDt|t�r,|D]}|j�|�qn|j�|�|j�|�d|f}|j}||jkr`dS|j�|�}|j�|�||j	kr�|j	d|j
|_	|j�|j	d|j
dg�dS)z9does the work for clearstamp() and clearstamps()
        rrNr�)rSr�r�r�rIr�rr��indexr�r��insert)r��stampidZsubitemrHZbufrnr�r�r��_clearstamps



zRawTurtle._clearstampcCs|�|�|��dS)aDDelete stamp with given stampid

        Argument:
        stampid - an integer, must be return value of previous stamp() call.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> astamp = turtle.stamp()
        >>> turtle.fd(50)
        >>> turtle.clearstamp(astamp)
        N)rqrJ)r�rpr�r�r�r6s
zRawTurtle.clearstampcCs^|dkr|jdd�}n&|dkr0|jd|�}n|j|d�}|D]}|�|�qB|��dS)a�Delete all or first/last n of turtle's stamps.

        Optional argument:
        n -- an integer

        If n is None, delete all of pen's stamps,
        else if n > 0 delete first n stamps
        else if n < 0 delete last n stamps.

        Example (for a Turtle instance named turtle):
        >>> for i in range(8):
        ...     turtle.stamp(); turtle.fd(30)
        ...
        >>> turtle.clearstamps(2)
        >>> turtle.clearstamps(-2)
        >>> turtle.clearstamps()
        Nr)rSrqrJ)r�r�ZtoDeleterHr�r�r�r7-szRawTurtle.clearstampsc
Cs�|j|j|jt|jt�f}|j}d|j|||j|j	dd�|�
|j�|jdd�ff}|jrh|j�
|�|j}|j�rZ|jdk�rZ||}|d|jd|d|jd}dt|ddd|j|j�}|d	|}	td|�D]R}
|
dkr�d
}nd}||	|
|_|j�r2|�|j||jf|j|j|�|��q�|j�rZ|j|jdd
|jd�|j�rn|j	�|�t|jt��r�|j�|�||_|j�r�|j�|�t|j	�dk�r�|��|��dS)z�Move the pen to the point end, thereby drawing a line
        if pen is down. All other methods for turtle movement depend
        on this one.
        �goNr�rr�r�r�皙�����?r�TF�r�r�r��r"rz�*)r+r)r'r�rOr�r�rrQrRr�r�rr�r,r�r4r5r�rrErKrJr>rMrLr�r=)r�r�go_modesr�Z
undo_entry�start�diff�diffsq�nhops�deltar�rAr�r�r�r
Isb
�

��$$�

�zRawTurtle._gotocs|\}}}}|\}}}}	|\}
}}�|j�t|j|�dkrDtd�|
|_||_|ddgkrbd}
n|}
�j|
||
|d���fdd�|jD�}|D]}��|�|j�	|�q�|}|j
�r��jdk�r�||}|d	�jd
|d�j
d
}dt|ddd|j
|j
�}|d
|}td|�D]P}|dk�r@d}nd}||||_|�rr��|j||jf|||�|���q,|�r��j|jdd|d�||_|j�r�t|j�d	k�r�|j��|jgk�r�d|_d|_|	�r|jgk�r�d|_td�n|jdk	�r|j��|��dS)z)Reverse a _goto. Used for undo()
        r�z$undogoto: HALLO-DA-STIMMT-WAS-NICHT!r�r�rucs&g|]}|�kr��|�dkr|�qS)r�)ryrz�r�r�r�r�r~�s�z'RawTurtle._undogoto.<locals>.<listcomp>r�rr�r�rsr�TFrtNzUnwahrscheinlich in _undogoto!)r�rrr�rQrRrEr�rIr�r,r�r4r5r�rrKrJrMr�rLr�rO)r��entry�old�newrwZcoodataZdrawingZpcZpsrBZcLIZcLr�ZusepcZtodeleter|rxryrzr{r|r�rAr�r}r��	_undogoto~sl
$$
�
�


zRawTurtle._undogotocCs�|jr|j�d||jf�||j9}|j�|�}|jj}|dkr�|jdkr�d|j}dtt	|�|�}d||}t
|�D]}|j�|�|_|��q|||_|��dS)z&Turns pen clockwise by angle.
        �rotr�rg@r�N)rr�r	rr�r�r�r,r�rrrJ)r�r�Z	neworientr�Zanglevelr r|r�r�r�r�r�s


zRawTurtle._rotateTcCsnt|j�dkrD|j�|j|j|j|j�|j��|_|j�	|j�n|jj|jdd�g|_|rj|j
g|_dS)z�Closes current line item and starts a new one.
           Remark: if current line became too long, animation
           performance (via _drawline) slowed down considerably.
        r�T)rAN)r�rRr�rErQr)r'rDr�r>rrAr�r�r�r=�s�zRawTurtle._newLinecCst|jt�S)aReturn fillstate (True if filling, False else).

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> if turtle.filling():
        ...     turtle.pensize(5)
        ... else:
        ...     turtle.pensize(3)
        )r�rOr�r�r�r�r�rB�szRawTurtle.fillingcCsX|��s"|j��|_|j�|j�|jg|_|��|j	rL|j	�
d|jf�|��dS)aCalled just before drawing a shape to be filled.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        �	beginfillN)rBr�r:rNr�r>rrOr=rr�rJr�r�r�r�r1�s
zRawTurtle.begin_fillcCs^|��rZt|j�dkrF|jj|j|j|jd�|jrF|j�d|jf�d|_|_|�	�dS)aFill the shape drawn after the call begin_fill().

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        r�r;�dofillN)
rBr�rOr�rCrNr*rr�rJr�r�r�r�r>
s�zRawTurtle.end_fillc	Gs8|sNt|ttf�r0|�|�}|jt|jd�}qr|j}|sr|jt|jd�}n$|dkrh|jt|jd�}|�|�}t|jd�r�|j�	|j
||�}|j�|�|j
r�|j
�d|f�n�|��}|j
r�|j
�dg�d|j
_z>|��dkr�|��|��|�|�|�|�|�d�W5|�|�X|j
�r4d	|j
_dS)
a�Draw a dot with diameter size, using color.

        Optional arguments:
        size -- an integer >= 1 (if given)
        color -- a colorstring or a numeric color tuple

        Draw a circular dot with diameter size, using color.
        If size is not given, the maximum of pensize+4 and 2*pensize is used.

        Example (for a Turtle instance named turtle):
        >>> turtle.dot()
        >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
        r�N�_dotr<rTr2rF)r�r�r�r�r'rfr)�hasattrr�r�rr�r>rr�rVr�rarMrXrYrWrC)r�rVr9rHrVr�r�r�r<
s:



z
RawTurtle.dotcCsB|j�|j||||j�\}}|j�|�|jr>|j�d|f�|S)z)Performs the writing for write()
        �wri)r�rXrr)r�r>rr�)r�rVrWrUrHrr�r�r�rXH
s�zRawTurtle._writerP��Arialr�r7cCs`|jr|j�dg�d|j_|�t|�|��|�}|rN|��\}}|�||�|jr\d|j_dS)a�Write text at the current turtle position.

        Arguments:
        arg -- info, which is to be written to the TurtleScreen
        move (optional) -- True/False
        align (optional) -- one of the strings "left", "center" or right"
        font (optional) -- a triple (fontname, fontsize, fonttype)

        Write text - the string representation of arg - at the current
        turtle position according to align ("left", "center" or right")
        and with the given font.
        If move is True, the pen is moved to the bottom-right corner
        of the text. By default, move is False.

        Example (for a Turtle instance named turtle):
        >>> turtle.write('Home = ', True, align="center")
        >>> turtle.write((0,0), True)
        rTFN)rr�r�rXr�r�r[re)r��argZmoverWrUrr�r�r�r�r�r{R
szRawTurtle.writecCs|jg|_d|_dS)aStart recording the vertices of a polygon.

        No argument.

        Start recording the vertices of a polygon. Current turtle position
        is first point of polygon.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_poly()
        TN)rrLrMr�r�r�r�r2o
s
zRawTurtle.begin_polycCs
d|_dS)a7Stop recording the vertices of a polygon.

        No argument.

        Stop recording the vertices of a polygon. Current turtle position is
        last point of polygon. This will be connected with the first point.

        Example (for a Turtle instance named turtle):
        >>> turtle.end_poly()
        FN)rMr�r�r�r�r?}
szRawTurtle.end_polycCs|jdk	rt|j�SdS)z�Return the lastly recorded polygon.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> p = turtle.get_poly()
        >>> turtle.register_shape("myFavouriteShape", p)
        N)rLr�r�r�r�r�rD�
s

zRawTurtle.get_polycCs|jS)a�Return the TurtleScreen object, the turtle is drawing  on.

        No argument.

        Return the TurtleScreen object, the turtle is drawing  on.
        So TurtleScreen-methods can be called for that object.

        Example (for a Turtle instance named turtle):
        >>> ts = turtle.getscreen()
        >>> ts
        <turtle.TurtleScreen object at 0x0106B770>
        >>> ts.bgcolor("pink")
        rGr�r�r�r�rF�
szRawTurtle.getscreencCs|S)aUReturn the Turtleobject itself.

        No argument.

        Only reasonable use: as a function to return the 'anonymous turtle':

        Example:
        >>> pet = getturtle()
        >>> pet.fd(50)
        >>> pet
        <turtle.Turtle object at 0x0187D810>
        >>> turtles()
        [<turtle.Turtle object at 0x0187D810>]
        r�r�r�r�r�rH�
szRawTurtle.getturtlecCs|j�|�S)zDSet delay value which determines speed of turtle animation.
        )r�rrLr�r�r�rM�
szRawTurtle._delayr�cCs"|j�|jj|||�|��dS)a�Bind fun to mouse-click event on this turtle on canvas.

        Arguments:
        fun --  a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).
        add --  True or False. If True, new binding will be added, otherwise
                it will replace a former binding.

        Example for the anonymous turtle, i. e. the procedural way:

        >>> def turn(x, y):
        ...     left(360)
        ...
        >>> onclick(turn)  # Now clicking into the turtle will turn it.
        >>> onclick(None)  # event-binding will be removed
        N)r�rer�rHrJr�r�r�r�rR�
szRawTurtle.onclickcCs"|j�|jj|||�|��dS)a�Bind fun to mouse-button-release event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).

        Example (for a MyTurtle instance named joe):
        >>> class MyTurtle(Turtle):
        ...     def glow(self,x,y):
        ...             self.fillcolor("red")
        ...     def unglow(self,x,y):
        ...             self.fillcolor("")
        ...
        >>> joe = MyTurtle()
        >>> joe.onclick(joe.glow)
        >>> joe.onrelease(joe.unglow)

        Clicking on joe turns fillcolor red, unclicking turns it to
        transparent.
        N)r�rfr�rHrJr�r�r�r�rT�
szRawTurtle.onreleasecCs|j�|jj|||�dS)a�Bind fun to mouse-move event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
               the coordinates of the clicked point on the canvas.
        btn -- number of the mouse-button defaults to 1 (left mouse button).

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.

        Example (for a Turtle instance named turtle):
        >>> turtle.ondrag(turtle.goto)

        Subsequently clicking and dragging a Turtle will move it
        across the screen thereby producing handdrawings (if pen is
        down).
        N)r�rgr�rHr�r�r�r�rS�
szRawTurtle.ondragcCs,|jdkrdS|dkr@|\}}|�|||j�|j��}n�|dkr\|d}|�|�n�|dkrp|�|�n�|dkr�|d}|j�|�|j�	|�n�|dkr�|d}|jj
|dd	d	d
�nh|dk�r|d}d|_|_||jk�r(|j�|�|j�	|�n$|dk�r(t
�||d�|j��dS)
z2Does the main part of the work for undo()
        Nr�rrrrr)r�r<r�rhr�r8r�rV)rrr	r�r6r�r�rIr�r�rCrNrOr$rV)r��actionr�r�ZdegPAUZdummyrmrHr�r�r��_undos<

�

zRawTurtle._undocCsl|jdkrdS|j��}|d}|dd�}|dkr\|rh|��}|�|d|dd��q4n|�||�dS)a�undo (repeatedly) the last turtle action.

        No argument.

        undo (repeatedly) the last turtle action.
        Number of available undo actions is determined by the size of
        the undobuffer.

        Example (for a Turtle instance named turtle):
        >>> for i in range(4):
        ...     turtle.fd(50); turtle.lt(80)
        ...
        >>> for i in range(8):
        ...     turtle.undo()
        ...
        Nrr�r)rr�r�)r�rHr�r�r�r�r�rw's

zRawTurtle.undo)NN)N)NNN)N)N)NNNN)F)N)T)N)FrPr�)N)r�N)r�N)r�N)9r�r�r�r�rJr�r�r`rhrxrUr5r�rJrr�r�rXr8rkrlrnrgrtrsrmrcrGrdr�rrrqr6r7r
r�rr=rBr1r>r<rXr{r2r?rDrFrHrErMrRrTrSr�rwrvr�r�r�r�r
�	sr�
(

(

(


(

(-
5A

0







 cCstjdkrt�t_tjS)z�Return the singleton screen object.
    If none exists at the moment, create a new one and return it,
    else return the existing one.N)r�_screenrIr�r�r�r�r	Js
c@sfeZdZdZdZedZdd�Zededededfd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rINr)cCs�tjdkr4t�t_|_|j�tj�|j�|j�tjdkr�td}td}td}td}td}td}|j�	||||�|j�
�t_t�|tj�|�
||||�dS)Nrzr�r�r�r�r�)rI�_rootrr)�_titler)�_destroyrr�r#r$rr�r&)r�rzr�r�r�r�r�r�r�r�r�Xs

z_Screen.__init__rzr�r�r�cCs�t|jd�sdS|j��}|j��}t|t�rNd|krBdkrNnn||}|dkrb||d}t|t�r�d|kr�dkr�nn||}|dkr�||d}|j�||||�|��dS)a Set the size and position of the main window.

        Arguments:
        width: as integer a size in pixels, as float a fraction of the screen.
          Default is 50% of screen.
        height: as integer the height in pixels, as float a fraction of the
          screen. Default is 75% of screen.
        startx: if positive, starting position in pixels from the left
          edge of the screen, if negative from the right edge
          Default, startx=None is to center window horizontally.
        starty: if positive, starting position in pixels from the top
          edge of the screen, if negative from the bottom edge
          Default, starty=None is to center window vertically.

        Examples (for a Screen instance named screen):
        >>> screen.setup (width=200, height=200, startx=0, starty=0)

        sets window to 200x200 pixels, in upper left of screen

        >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)

        sets window to 75% of screen by 50% of screen and centers
        r'Nrr�r�)r�r�r*r+r�r�r'r,)r�rzr�r%r&rQZshr�r�r�r&ns

""z
_Screen.setupcCs tjdk	rtj�|�|t_dS)aqSet title of turtle-window

        Argument:
        titlestring -- a string, to appear in the titlebar of the
                       turtle graphics window.

        This is a method of Screen-class. Not available for TurtleScreen-
        objects.

        Example (for a Screen instance named screen):
        >>> screen.title("Welcome to the turtle-zoo!")
        N)rIr�r)r�)r�Ztitlestringr�r�r�r)�s
z
_Screen.titlecCs:|j}|tjkr(dt_dt_dt_dt_dt_|��dS)NF)	r�rIrr�r�rrr�r()r��rootr�r�r�r��s
z_Screen._destroycCs|��dS)z~Shut the turtlegraphics window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bye()
        N)r�r�r�r�r�r�sz_Screen.byecsN�fdd�}��|�tdr"dSz
t�Wntk
rHtd�YnXdS)alGo into mainloop until the mouse is clicked.

        No arguments.

        Bind bye() method to mouseclick on TurtleScreen.
        If "using_IDLE" - value in configuration dictionary is False
        (default value), enter mainloop.
        If IDLE with -n switch (no subprocess) is used, this value should be
        set to True in turtle.cfg. In this case IDLE's mainloop
        is active also for the client script.

        This is a method of the Screen-class and not available for
        TurtleScreen instances.

        Example (for a Screen instance named screen):
        >>> screen.exitonclick()

        cs���dS)z&Screen.bye() with two dummy-parametersN)r)r�r�r�r�r��exitGracefully�sz+_Screen.exitonclick.<locals>.exitGracefullyr�Nr)rRr�r�AttributeError�exit)r�r�r�r�r�r�s

z_Screen.exitonclick)
r�r�r�r�rr�r�r�r&r)r�rrr�r�r�r�rIRs�
(
rIc@s4eZdZdZdZdZedededfdd�ZdS)rz�RawTurtle auto-creating (scrolled) canvas.

    When a Turtle object is created or a function derived from some
    Turtle method is called a TurtleScreen object is automatically created.
    Nrkr�r�cCs,tjdkrt�t_tj|tj|||d�dS)N)rkr�r�)rr�r	r
r�)r�rkr�r�r�r�r�r��s

�zTurtle.__init__)r�r�r�r�r�r�r�r�r�r�r�r�r�s��turtle_docstringdictc	Cs�i}tD]}d|}t|�j||<qtD]}d|}t|�j||<q(td|d���}tdd�|D��}|�d�|dd	�D](}|�d
t|��|�d||�q||d	}|�d
t|��|�d||�|�d
�|��W5QRXdS)a�Create and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitly, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
    z_Screen.zTurtle.z%s.pyr6css$|]}|�d�dtkr|VqdS)r�r�N)r�_alias_listr�r�r�r�r�s�z&write_docstringdict.<locals>.<genexpr>zdocsdict = {

Nr�z%s :
z        """%s
""",

z        """%s
"""

z}
)	�_tg_screen_functionsr�r��_tg_turtle_functionsr�r�r{�repr�close)r��docsdict�
methodnamer�r�r�r�r�r�r~�s$

c	Cs`dd|��i}t|�}|j}|D]8}z||t|�_Wq"tk
rXtd|�Yq"Xq"dS)z�Read in docstrings from lang-specific docstring dictionary.

    Transfer docstrings, translated to lang, from a dictionary-file
    to the methods of classes Screen and Turtle and - in revised form -
    to the corresponding functions.
    z!turtle_docstringdict_%(language)sr�zBad docstring-entry: %sN)r��
__import__r�r�r�r�r�)Zlang�modname�moduler�r�r�r�r��read_docstringssr�r�zCannot find docsdict forz;Unknown Error when trying to import %s-docstring-dictionaryc
Cs�d}}t�|j�\}}}|dd�}|dd�}|jp:g}dd�|D�}dgt|�t|�|}dd�t||�D�}	|dk	r�|	�d|�|�d|�|dk	r�|	�d|�|�d|�d	�|	�}d
|}d	�|�}d
|}||fS)a?Get strings describing the arguments for the given object

    Returns a pair of strings representing function parameter lists
    including parenthesis.  The first string is suitable for use in
    function definition and the second is suitable for use in function
    call.  The "self" parameter is not included.
    r�r�NcSsg|]}d|f�qS)z=%rr�)r{r�r�r�r�r~<sz"getmethparlist.<locals>.<listcomp>cSsg|]\}}||�qSr�r�)r{r�Zdfltr�r�r�r~>s�*z**z, z(%s))�inspectZgetargs�__code__�__defaults__r�rir>r)
ZobZdefTextZcallTextrZvarargsZvarkwZitems2ZrealArgs�defaultsZitems1r�r�r��getmethparlist,s&


r�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z<To reduce docstrings from RawTurtle class for functions
    rNr��%s.r�� \(.+ %s\):�:��rer��replace�compile�sub)�docstrr�Z
turtlename�	newdocstr�parexpr�r�r��_turtle_docreviseKsr�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z?To reduce docstrings from TurtleScreen class for functions
    rNr�r�r�r�r�r�)r�r�Z
screennamer�r�r�r�r��_screen_docreviseWsr�ardef {name}{paramslist}:
    if {obj} is None:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        {obj} = {init}
    try:
        return {obj}.{name}{argslist}
    except TK.TclError:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        raise
c
Csl|D]b}t||�}t|�\}}|dkr4td||�qtj|||||d�}	t|	t��||j�t�|_qdS)Nr�z>>>>>>)�obj�initr�Z
paramslistZargslist)�getattrr�r��__func_body�formatr��globalsr�)
Z	functionsr�r�r�Z	docreviser�r�Zpl1Zpl2Zdefstrr�r�r��_make_global_funcsws

�r�zTurtle._screenzScreen()zTurtle._penzTurtle()�__main__cCst�rt�nt�dSr�)rNr]rUr�r�r�r��	switchpen�sr�cCslt�td�t�td�t�td�td�D]Z}|dkrDt�td�D]}td�t	d�qL|dkrxt
d�t�t�td	�t�q2td
�t
d�td�t�td�td�td�td�td
�t�t
dd
�t
dd
�t
d�td�D]$}td�t	d�td�td�q�td�t�td�D]&}td�t	d�td�td��q:t�dS)zDemo of old turtle.py - moduleT�dr�r�r�r��ZZmaroonr	r�r�F�Z
startstartrx�redr�N)r`r*ryr0r=rzrr1rCrPr9r>r_r{)r|r�r�r�r��demo1�sX



r�cCsBtd�t�td�ttdd��tdd�d}td�td�D]}t�t	|d�qBt
d�t�rnt�q`t
�td�td	�d}td
�td�td�tdd
�D]p}|dkr�t�td	d|dd|�td�D]}t|�td�q�t�|d7}td�tt�dd�q�td�t�td�td�t�tdd�td�t�td�D](}t	dd�td�td�td��q`t�td�t�td�t�td�t�}|�d�t�}|�d�|�d�|�
�|�d�|�d�|��|�dd�|�d�|��|�d�|�dd�|�d�|�d�tt|��d}|�|�dk�r�|�d�|�d �|�|�|��|�d�|d!dk�r�|� �|� �t�|d7}�qZ|j
d"d#d$d%�|�d&�|�d�d'd(�}t!�"d�t��r|��|���q�|�d�|j
d)d*d+�|�#|d�d,S)-zDemo of some new features.r�r�rrr��r�zwait a moment...r�Zgreenr�r�r���x��Fr	r�Zyellowr��2r�r2i�(r�ZblueZoranger�g@g333333�?r�zCAUGHT! )r�r��boldr_)rUrWr�cSst�t�dSr�)rr)r�r�r�r�r��babaszdemo2.<locals>.babaz  Click me!)ZCourierr�r�)rUN)$rprqrYrdrur;rbrr�r4r{rxrwr`rQrrWr1rAr@r>r]rUr9rkrHrarrPryrIr=rr�time�sleeprR)rr�Zlaenger|Ztrir�r�r�r�r�r��demo2�s�


















r�)r�)r�)Fr�Z_verZtkinterr�r�r�r�r�r�Zos.pathrrr�copyrrZ_tg_classesr�r�Z
_tg_utilities�__all__r�r�r�r�r�r�r�rr�r�r�r�r�rr�r r�objectr,r�r�rr�rr�r$rBr
rr	rIrr
r~r�Z	_LANGUAGE�ImportErrorr�r�r�r�r�rrr�r�r�r�rr�r�r�r��<module>s�N��
�

����5
�
c	/&/O}
"
���
5cbinhex.cpython-38.pyc000064400000027550151450073350010465 0ustar00U

e5d�6�@s�dZddlZddlZddlZddlZdddgZGdd�de�ZdZdZ	dZ
d	Zd
ZGdd�d�Z
d
d�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZdS)z�Macintosh binhex compression/decompression.

easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
�N�binhex�hexbin�Errorc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/binhex.pyrs�i��@��c@seZdZdd�ZdS)�FInfocCsd|_d|_d|_dS)Nz????r)�Type�Creator�Flags��selfrrr	�__init__0szFInfo.__init__N)rrrrrrrr	r
/sr
c	Cstt�}t�|d��2}|�d�}d|kr,d|_|�dd�|��}W5QRXtj�	|�\}}|�
ddd�}|||dfS)	N�rbirZTEXT��:�-r
)r
�io�open�readr�seek�tell�os�path�split�replace)�name�finfo�fp�dataZdsize�dir�filerrr	�getfileinfo5s
r'c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�openrsrccGsdS�Nr�r�argsrrr	rCszopenrsrc.__init__cGsdS�N�rr*rrr	rFsz
openrsrc.readcGsdSr)rr*rrr	�writeIszopenrsrc.writecCsdSr)rrrrr	�closeLszopenrsrc.closeN)rrrrrr.r/rrrr	r(Bsr(c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Hqxcoderenginez(Write data to the coder in 3-byte chunkscCs ||_d|_d|_td|_dS)Nr-r
)�ofpr$�hqxdata�LINELEN�linelen�rr1rrr	rRsz_Hqxcoderengine.__init__cCsh|j||_t|j�}|dd}|jd|�}|j|d�|_|sHdS|jt�|�|_|�d�dS)N�r)r$�lenr2�binascii�b2a_hqx�_flush)rr$ZdatalenZtodorrr	r.Xs
z_Hqxcoderengine.writecCsrd}|t|j�|jkrH||j}|j�|j||�d�t|_|}q|j|d�|_|rn|j�|jd�dS)Nr�
s:
)r7r2r4r1r.r3)rZforce�firstZlastrrr	r:cs
z_Hqxcoderengine._flushcCs6|jr|jt�|j�|_|�d�|j��|`dS)Nr
)r$r2r8r9r:r1r/rrrr	r/ns


z_Hqxcoderengine.closeN)rrr�__doc__rr.r:r/rrrr	r0Os
r0c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Rlecoderenginez4Write data to the RLE-coder in suitably large chunkscCs||_d|_dSr,)r1r$r5rrr	rxsz_Rlecoderengine.__init__cCs@|j||_t|j�tkrdSt�|j�}|j�|�d|_dSr,)r$r7�REASONABLY_LARGEr8�rlecode_hqxr1r.)rr$�rledatarrr	r.|sz_Rlecoderengine.writecCs0|jrt�|j�}|j�|�|j��|`dSr))r$r8r@r1r.r/)rrArrr	r/�s

z_Rlecoderengine.closeN)rrrr=rr.r/rrrr	r>usr>c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BinHexc
Cs�|\}}}}d}t|t�r.|}t�|d�}d}zR|�d�t|�}	t|	�|_d|_|dkr`t	�}||_
||_|�||�t
|_Wn|r�|���YnXdS)NF�wbTs0(This file must be converted with BinHex 4.0)

:r)�
isinstance�strrrr.r0r>r1�crcr
�dlen�rlen�
_writeinfo�_DID_HEADER�stater/)
rZname_finfo_dlen_rlenr1r!r"rGrHZclose_on_errorZofnameZhqxerrrr	r�s*



zBinHex.__init__cCs�t|�}|dkrtd��t|g�|�d�d}|j|j}}t|t�rR|�d�}t|t�rf|�d�}||}t�	d|j
�}t�	d|j|j�}	||||	}
|�
|
�|��dS)N�?zFilename too longzlatin-1��>hz>ii)r7r�bytes�encoderrrDrE�struct�packrrGrH�_write�	_writecrc)rr!r"�nl�d�tpZcrZd2Zd3Zd4�inforrr	rI�s




zBinHex._writeinfocCs t�||j�|_|j�|�dSr))r8�crc_hqxrFr1r.�rr$rrr	rS�sz
BinHex._writecCs4|jdkrd}nd}|j�t�||j��d|_dS)NrrNz>H)rFr1r.rQrR)rZfmtrrr	rT�s

zBinHex._writecrccCs0|jtkrtd��|jt|�|_|�|�dS)NzWriting data at the wrong time)rKrJrrGr7rSrZrrr	r.�s
zBinHex.writecCs,|jdkrtd|jf��|��t|_dS)NrzIncorrect data size, diff=%r)rGrrHrT�	_DID_DATArKrrrr	�
close_data�s
zBinHex.close_datacCsB|jtkr|��|jtkr$td��|jt|�|_|�|�dS)Nz'Writing resource data at the wrong time)rKr[r\rrHr7rSrZrrr	�
write_rsrc�s

zBinHex.write_rsrccCsx|jdkrdSzJ|jtkr"|��|jtkr4td��|jdkrNtd|jf��|��W5d|_|j}|`|��XdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rKr1r/r[r\rrHrTr5rrr	r/�s



zBinHex.closeN)rrrrrIrSrTr.r\r]r/rrrr	rB�s
rBc	Cs�t|�}t||�}t�|d��*}|�d�}|s0q<|�|�q |��W5QRXt|d�}|�d�}|shqt|�|�qX|�	�|�	�dS)zEbinhex(infilename, outfilename): create binhex-encoded copy of a filer��N)
r'rBrrrr.r\r(r]r/)�inp�outr"r1�ifprVrrr	r�s



c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Hqxdecoderenginez*Read data via the decoder in 4-byte chunkscCs||_d|_dS)Nr)ra�eof�rrarrr	rsz_Hqxdecoderengine.__init__cCs�d}|}|dkr�|jr|S|ddd}|j�|�}zt�|�\}|_Wq�Wntjk
rdYnX|j�d�}|s~td��||}q6||}|t|�}|s|jstd��q|S)z&Read at least wtd bytes (or until EOF)r-rrr6�r
zPremature EOF on binhex file)rcrarr8Za2b_hqxZ
Incompleterr7)rZtotalwtdZdecdata�wtdr$Z
decdatacur�newdatarrr	rs*


z_Hqxdecoderengine.readcCs|j��dSr)�rar/rrrr	r/%sz_Hqxdecoderengine.closeN)rrrr=rrr/rrrr	rb�s rbc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_RledecoderenginezRead data via the RLE-codercCs||_d|_d|_d|_dS)Nr-r)ra�
pre_buffer�post_bufferrcrdrrr	r+sz_Rledecoderengine.__init__cCsD|t|j�kr"|�|t|j��|jd|�}|j|d�|_|Sr))r7rk�_fill)rrf�rvrrr	r1s
z_Rledecoderengine.readcCs�|j|j�|d�|_|jjr>|jt�|j�|_d|_dSt|j�}|jdd�tdtkrl|d}nX|jdd�tkr�|d}n<|jdd�tdkr�|d}n|jdd�tkr�n|d	}|jt�|jd|��|_|j|d�|_dS)
Nrer-���rMr6���r���r
)	rjrarrcrkr8Z
rledecode_hqxr7�RUNCHAR)rrfZmarkrrr	rl8s*
�



�z_Rledecoderengine._fillcCs|j��dSr)rhrrrr	r/[sz_Rledecoderengine.closeN)rrrr=rrrlr/rrrr	ri(s
#ric@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HexBincCsft|t�rt�|d�}|�d�}|s,td��|dkr6q|dkrqBqt|�}t|�|_d|_	|�
�dS)Nrr
zNo binhex data foundr;�:r)rDrErrrrrbrirarF�_readheader)rraZchZhqxifprrr	r_s


zHexBin.__init__cCs |j�|�}t�||j�|_|Sr))rarr8rYrF)rr7r$rrr	�_readuszHexBin._readcCsNt�d|j�d��dd@}|jd@|_||jkrDtd|j|f��d|_dS)NrNrri��zCRC error, computed %x, read %x)rQ�unpackrarrFr)rZfilecrcrrr	�	_checkcrczs
�zHexBin._checkcrccCs�|�d�}|�t|��}|�d�}|��|dd�}|dd�}t�d|dd��d}t�d|dd	��d|_t�d|d	d��d|_||_t�|_||j_	||j_
||j_t|_
dS)
Nr
���	rN�rz>l�)ru�ordrwrQrvrGrH�FNamer
rrrrJrK)rr7Zfname�rest�typeZcreator�flagsrrr	rt�s

zHexBin._readheadercGsj|jtkrtd��|r,|d}t||j�}n|j}d}t|�|krZ||�|t|��}q6|j||_|S)NzRead data at wrong timerr-)rKrJr�minrGr7ru)r�nrmrrr	r�s
zHexBin.readcCs6|jtkrtd��|jr$|�|j�}|��t|_dS)Nzclose_data at wrong time)rKrJrrGrurwr[�rZdummyrrr	r\�s
zHexBin.close_datacGsZ|jtkr|��|jtkr$td��|r>|d}t||j�}n|j}|j||_|�|�S)Nz Read resource data at wrong timer)rKrJr\r[rr�rHru)rr�rrr	�	read_rsrc�s

zHexBin.read_rsrccCsD|jdkrdSz|jr"|�|j�}|��W5d|_|j��XdSr))rKrar/rHr�rwr�rrr	r/�s
zHexBin.closeN)rrrrrurwrtrr\r�r/rrrr	rr^s

rrc	Cs�t|�}|j}|s|j}t�|d��"}|�d�}|s6qB|�|�q&W5QRX|��|�d�}|r�t	|d�}|�|�|�d�}|s�q�|�|�qv|�
�|�
�dS)z6hexbin(infilename, outfilename) - Decode binhexed filerCr^N)rrr
r~rrrr.r\r�r(r/)r_r`rar"r1rVrrr	r�s(




)r=rrrQr8�__all__�	ExceptionrrJr[r?r3rqr
r'r(r0r>rBrrbrirrrrrrr	�<module>s,


&^*6hio.cpython-38.opt-1.pyc000064400000006600151450073350010547 0ustar00U

e5d�
�@sjdZdZdddddddd	d
ddd
dddddddgZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZejZde_dZdZdZGdd�dejejd�ZGdd�deje�ZGdd
�d
eje�ZGdd�deje�Z e�!e
�ee
eeefD]Z"e�!e"��qeefD]Z"e �!e"��q ["zdd lm#Z#Wne$k
�rZYnXe�!e#�dS)!a�The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.

At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; implementations are
allowed to raise an OSError if they do not support a given operation.

Extending IOBase is RawIOBase which deals simply with the reading and
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
an interface to OS files.

BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
streams that are readable, writable, and both respectively.
BufferedRandom provides a buffered interface to random access
streams. BytesIO is a simple stream of in-memory bytes.

Another IOBase subclass, TextIOBase, deals with the encoding and decoding
of streams into text. TextIOWrapper, which extends it, is a buffered text
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
is an in-memory stream for text.

Argument names are not part of the specification, and only the arguments
of open() are intended to be used as keyword arguments.

data:

DEFAULT_BUFFER_SIZE

   An int containing the default buffer size used by the module's buffered
   I/O classes. open() uses the file's blksize (as obtained by os.stat) if
   possible.
z�Guido van Rossum <guido@python.org>, Mike Verdone <mike.verdone@gmail.com>, Mark Russell <mark.russell@zen.co.uk>, Antoine Pitrou <solipsis@pitrou.net>, Amaury Forgeot d'Arc <amauryfa@gmail.com>, Benjamin Peterson <benjamin@python.org>�BlockingIOError�open�	open_code�IOBase�	RawIOBase�FileIO�BytesIO�StringIO�BufferedIOBase�BufferedReader�BufferedWriter�BufferedRWPair�BufferedRandom�
TextIOBase�
TextIOWrapper�UnsupportedOperation�SEEK_SET�SEEK_CUR�SEEK_END�N)�DEFAULT_BUFFER_SIZErrrrrrrr
rrr
�IncrementalNewlineDecoderr�io��c@seZdZejjZdS)rN)�__name__�
__module__�__qualname__�_io�_IOBase�__doc__�r r �/usr/lib64/python3.8/io.pyrHs)�	metaclassc@seZdZejjZdS)rN)rrrr�
_RawIOBaserr r r r!rKsc@seZdZejjZdS)r	N)rrrr�_BufferedIOBaserr r r r!r	Nsc@seZdZejjZdS)rN)rrrr�_TextIOBaserr r r r!rQs)�_WindowsConsoleIO)%r�
__author__�__all__r�abcrrrrrrrrr
rrr
rr�OpenWrapperrrrrr�ABCMetarr#rr$r	r%r�register�klassr&�ImportErrorr r r r!�<module>sT$
�@
�shelve.cpython-38.pyc000064400000022424151450073350010471 0ustar00U

e5dO!�@s�dZddlmZmZddlmZddlZddddgZGd	d
�d
ej	j
�ZGdd�dej	j
�ZGdd�de�Z
Gd
d�de�Zddd�ZdS)a�
Manage shelves of pickled objects.

A "shelf" is a persistent, dictionary-like object.  The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle.  This includes most class instances, recursive data
types, and objects containing lots of shared sub-objects.  The keys
are ordinary strings.

To summarize the interface (key is a string, data is an arbitrary
object):

        import shelve
        d = shelve.open(filename) # open, with (g)dbm filename -- no suffix

        d[key] = data   # store data at key (overwrites old data if
                        # using an existing key)
        data = d[key]   # retrieve a COPY of the data at key (raise
                        # KeyError if no such key) -- NOTE that this
                        # access returns a *copy* of the entry!
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # a list of all existing keys (slow!)

        d.close()       # close it

Dependent on the implementation, closing a persistent dictionary may
or may not be necessary to flush changes to disk.

Normally, d[key] returns a COPY of the entry.  This needs care when
mutable entries are mutated: for example, if d[key] is a list,
        d[key].append(anitem)
does NOT modify the entry d[key] itself, as stored in the persistent
mapping -- it only modifies the copy, which is then immediately
discarded, so that the append has NO effect whatsoever.  To append an
item to d[key] in a way that will affect the persistent mapping, use:
        data = d[key]
        data.append(anitem)
        d[key] = data

To avoid the problem with mutable entries, you may pass the keyword
argument writeback=True in the call to shelve.open.  When you use:
        d = shelve.open(filename, writeback=True)
then d keeps a cache of all entries you access, and writes them all back
to the persistent mapping when you call d.close().  This ensures that
such usage as d[key].append(anitem) works as intended.

However, using keyword argument writeback=True may consume vast amount
of memory for the cache, and it may make d.close() very slow, if you
access many of d's entries after opening it in this way: d has no way to
check which of the entries you access are mutable and/or which ones you
actually mutate, so it must cache, and write back at close, all of the
entries that you access.  You can call d.sync() to write back all the
entries in the cache, and empty the cache (d.sync() also synchronizes
the persistent dictionary on disk, if feasible).
�)�Pickler�	Unpickler)�BytesION�Shelf�
BsdDbShelf�DbfilenameShelf�openc@s8eZdZdZdd�ZeZZZZZ	Z
dd�ZdS)�_ClosedDictz>Marker for a closed dict.  Access attempts raise a ValueError.cGstd��dS)Nz!invalid operation on closed shelf)�
ValueError)�self�args�r
�/usr/lib64/python3.8/shelve.py�closedEsz_ClosedDict.closedcCsdS)Nz<Closed Dictionary>r
�rr
r
r�__repr__Isz_ClosedDict.__repr__N)�__name__�
__module__�__qualname__�__doc__r�__iter__�__len__�__getitem__�__setitem__�__delitem__�keysrr
r
r
rr	Bsr	c@s|eZdZdZddd�Zdd�Zd	d
�Zdd�Zd d
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)!rz�Base class for shelf implementations.

    This is initialized with a dictionary-like object.
    See the module's __doc__ string for an overview of the interface.
    NF�utf-8cCs.||_|dkrd}||_||_i|_||_dS)N�)�dict�	_protocol�	writeback�cache�keyencoding�rr�protocolr r"r
r
r�__init__TszShelf.__init__ccs"|j��D]}|�|j�Vq
dS�N)rr�decoder")r�kr
r
rr^szShelf.__iter__cCs
t|j�Sr&)�lenrrr
r
rrbsz
Shelf.__len__cCs|�|j�|jkSr&��encoder"r�r�keyr
r
r�__contains__eszShelf.__contains__cCs|�|j�|jkr||S|Sr&r*)rr-�defaultr
r
r�gethsz	Shelf.getcCsZz|j|}WnFtk
rTt|j|�|j��}t|���}|jrP||j|<YnX|Sr&)	r!�KeyErrorrrr+r"r�loadr �rr-�value�fr
r
rrmszShelf.__getitem__cCsF|jr||j|<t�}t||j�}|�|�|��|j|�|j	�<dSr&)
r r!rrr�dump�getvaluerr+r")rr-r4r5�pr
r
rrws

zShelf.__setitem__cCs6|j|�|j�=z|j|=Wntk
r0YnXdSr&)rr+r"r!r1r,r
r
rrs
zShelf.__delitem__cCs|Sr&r
rr
r
r�	__enter__�szShelf.__enter__cCs|��dSr&)�close)r�typer4�	tracebackr
r
r�__exit__�szShelf.__exit__cCsf|jdkrdSz0|��z|j��Wntk
r:YnXW5zt�|_Wnd|_YnXXdSr&)rr	�syncr:�AttributeErrorrr
r
rr:�s

zShelf.closecCst|d�sdS|��dS)Nr )�hasattrr:rr
r
r�__del__�s
z
Shelf.__del__cCsT|jr:|jr:d|_|j��D]\}}|||<qd|_i|_t|jd�rP|j��dS)NFTr>)r r!�itemsr@rr>)rr-�entryr
r
rr>�s
z
Shelf.sync)NFr)N)rrrrr%rrr.r0rrrr9r=r:rAr>r
r
r
rrMs �



c@sBeZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)ra�Shelf implementation using the "BSD" db interface.

    This adds methods first(), next(), previous(), last() and
    set_location() that have no counterpart in [g]dbm databases.

    The actual database must be opened using one of the "bsddb"
    modules "open" routines (i.e. bsddb.hashopen, bsddb.btopen or
    bsddb.rnopen) and passed to the constructor.

    See the module's __doc__ string for an overview of the interface.
    NFrcCst�|||||�dSr&)rr%r#r
r
rr%�szBsdDbShelf.__init__cCs0|j�|�\}}t|�}|�|j�t|���fSr&)r�set_locationrr'r"rr2r3r
r
rrD�szBsdDbShelf.set_locationcCs.t|j�\}}t|�}|�|j�t|���fSr&)�nextrrr'r"rr2r3r
r
rrE�szBsdDbShelf.nextcCs.|j��\}}t|�}|�|j�t|���fSr&)r�previousrr'r"rr2r3r
r
rrF�szBsdDbShelf.previouscCs.|j��\}}t|�}|�|j�t|���fSr&)r�firstrr'r"rr2r3r
r
rrG�szBsdDbShelf.firstcCs.|j��\}}t|�}|�|j�t|���fSr&)r�lastrr'r"rr2r3r
r
rrH�szBsdDbShelf.last)NFr)
rrrrr%rDrErFrGrHr
r
r
rr�s�
c@seZdZdZddd�ZdS)rz�Shelf implementation using the "dbm" generic dbm interface.

    This is initialized with the filename for the dbm database.
    See the module's __doc__ string for an overview of the interface.
    �cNFcCs$ddl}t�||�||�||�dS)Nr)�dbmrr%r)r�filename�flagr$r rJr
r
rr%�szDbfilenameShelf.__init__)rINF)rrrrr%r
r
r
rr�srIFcCst||||�S)a�Open a persistent dictionary for reading and writing.

    The filename parameter is the base filename for the underlying
    database.  As a side-effect, an extension may be added to the
    filename and more than one file may be created.  The optional flag
    parameter has the same interpretation as the flag parameter of
    dbm.open(). The optional protocol parameter specifies the
    version of the pickle protocol.

    See the module's __doc__ string for an overview of the interface.
    )r)rKrLr$r r
r
rr�s
)rINF)r�picklerr�iorZcollections.abc�collections�__all__�abc�MutableMappingr	rrrrr
r
r
r�<module>s:b+selectors.cpython-38.pyc000064400000041051151450073350011203 0ustar00U

e5d�H�@s�dZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
dZdZdd	�Z
ed
ddd
dg�Zde_e
jdkr�dej_dej_dej_dej_Gdd�de�ZGdd�ded�ZGdd�de�ZGdd�de�ZGdd�de�Zee	d ��rGd!d"�d"e�Zee	d#��r Gd$d%�d%e�Zee	d&��r<Gd'd(�d(e�Zee	d)��rXGd*d+�d+e�Zd+e�k�rjeZn:d%e�k�r|eZn(d(e�k�r�eZnd"e�k�r�eZneZdS),z|Selectors module.

This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
�)�ABCMeta�abstractmethod)�
namedtuple)�MappingN��c
Csft|t�r|}n<zt|���}Wn*tttfk
rJtd�|��d�YnX|dkrbtd�|���|S)z�Return a file descriptor from a file object.

    Parameters:
    fileobj -- file object or file descriptor

    Returns:
    corresponding file descriptor

    Raises:
    ValueError if the object is invalid
    zInvalid file object: {!r}NrzInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError�	TypeError�
ValueError�format)�fileobj�fd�r�!/usr/lib64/python3.8/selectors.py�_fileobj_to_fds
��r�SelectorKeyrr�events�dataz�SelectorKey(fileobj, fd, events, data)

    Object used to associate a file object to its backing
    file descriptor, selected event mask, and attached data.
)��zFile object registered.zUnderlying file descriptor.z3Events that must be waited for on this file object.zzOptional opaque data associated to this file object.
    For example, this could be used to store a per-client session ID.c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_SelectorMappingz)Mapping of file objects to selector keys.cCs
||_dS�N)�	_selector)�selfZselectorrrr�__init__?sz_SelectorMapping.__init__cCst|jj�Sr)�lenr�
_fd_to_key�rrrr�__len__Bsz_SelectorMapping.__len__cCsDz|j�|�}|jj|WStk
r>td�|��d�YnXdS�N�{!r} is not registered)r�_fileobj_lookupr�KeyErrorr)rrrrrr�__getitem__Es
z_SelectorMapping.__getitem__cCst|jj�Sr)�iterrrr rrr�__iter__Lsz_SelectorMapping.__iter__N)�__name__�
__module__�__qualname__�__doc__rr!r&r(rrrrr<s
rc@sneZdZdZeddd��Zedd��Zddd�Zedd	d
��Zdd�Z	d
d�Z
edd��Zdd�Zdd�Z
dS)�BaseSelectora-Selector abstract base class.

    A selector supports registering file objects to be monitored for specific
    I/O events.

    A file object is a file descriptor or any object with a `fileno()` method.
    An arbitrary object can be attached to the file object, which can be used
    for example to store context information, a callback, etc.

    A selector can use various implementations (select(), poll(), epoll()...)
    depending on the platform. The default `Selector` class uses the most
    efficient implementation on the current platform.
    NcCst�dS)a3Register a file object.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        ValueError if events is invalid
        KeyError if fileobj is already registered
        OSError if fileobj is closed or otherwise is unacceptable to
                the underlying system call (if a system call is made)

        Note:
        OSError may or may not be raised
        N��NotImplementedError�rrrrrrr�register_szBaseSelector.registercCst�dS)ajUnregister a file object.

        Parameters:
        fileobj -- file object or file descriptor

        Returns:
        SelectorKey instance

        Raises:
        KeyError if fileobj is not registered

        Note:
        If fileobj is registered but has since been closed this does
        *not* raise OSError (even if the wrapped syscall does)
        Nr.)rrrrr�
unregistervszBaseSelector.unregistercCs|�|�|�|||�S)ayChange a registered file object monitored events or attached data.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        Anything that unregister() or register() raises
        )r2r1r0rrr�modify�s
zBaseSelector.modifycCst�dS)aqPerform the actual selection, until some monitored file objects are
        ready or a timeout expires.

        Parameters:
        timeout -- if timeout > 0, this specifies the maximum wait time, in
                   seconds
                   if timeout <= 0, the select() call won't block, and will
                   report the currently ready file objects
                   if timeout is None, select() will block until a monitored
                   file object becomes ready

        Returns:
        list of (key, events) for ready file objects
        `events` is a bitwise mask of EVENT_READ|EVENT_WRITE
        Nr.)r�timeoutrrr�select�szBaseSelector.selectcCsdS)zmClose the selector.

        This must be called to make sure that any underlying resource is freed.
        Nrr rrr�close�szBaseSelector.closecCsL|��}|dkrtd��z
||WStk
rFtd�|��d�YnXdS)zzReturn the key associated to a registered file object.

        Returns:
        SelectorKey for this file object
        NzSelector is closedr#)�get_map�RuntimeErrorr%r)rr�mappingrrr�get_key�s
zBaseSelector.get_keycCst�dS)z2Return a mapping of file objects to selector keys.Nr.r rrrr7�szBaseSelector.get_mapcCs|Srrr rrr�	__enter__�szBaseSelector.__enter__cGs|��dSr)r6)r�argsrrr�__exit__�szBaseSelector.__exit__)N)N)N)r)r*r+r,rr1r2r3r5r6r:r7r;r=rrrrr-Ps


r-)�	metaclassc@sTeZdZdZdd�Zdd�Zddd�Zd	d
�Zddd�Zd
d�Z	dd�Z
dd�ZdS)�_BaseSelectorImplzBase selector implementation.cCsi|_t|�|_dSr)rr�_mapr rrrr�sz_BaseSelectorImpl.__init__cCsNz
t|�WStk
rH|j��D]}|j|kr$|jYSq$�YnXdS)alReturn a file descriptor from a file object.

        This wraps _fileobj_to_fd() to do an exhaustive search in case
        the object is invalid but we still have it in our map.  This
        is used by unregister() so we can unregister an object that
        was previously registered even if it is closed.  It is also
        used by _SelectorMapping.
        N)rr
r�valuesrr�rr�keyrrrr$�s	

z!_BaseSelectorImpl._fileobj_lookupNcCsb|r|ttB@r td�|���t||�|�||�}|j|jkrRtd�||j���||j|j<|S)NzInvalid events: {!r}z"{!r} (FD {}) is already registered)	�
EVENT_READ�EVENT_WRITEr
rrr$rrr%�rrrrrCrrrr1�s�z_BaseSelectorImpl.registercCs@z|j�|�|��}Wn$tk
r:td�|��d�YnX|Sr")r�popr$r%rrBrrrr2�s
z_BaseSelectorImpl.unregistercCs�z|j|�|�}Wn$tk
r8td�|��d�YnX||jkr^|�|�|�|||�}n"||jkr�|j|d�}||j|j	<|S)Nr#)r)
rr$r%rrr2r1r�_replacerrFrrrr3�s


z_BaseSelectorImpl.modifycCs|j��d|_dSr)r�clearr@r rrrr6s
z_BaseSelectorImpl.closecCs|jSr)r@r rrrr7sz_BaseSelectorImpl.get_mapcCs(z|j|WStk
r"YdSXdS)z�Return the key associated to a given file descriptor.

        Parameters:
        fd -- file descriptor

        Returns:
        corresponding key, or None if not found
        N)rr%)rrrrr�_key_from_fds	z_BaseSelectorImpl._key_from_fd)N)N)r)r*r+r,rr$r1r2r3r6r7rJrrrrr?�s


r?cs`eZdZdZ�fdd�Zd�fdd�	Z�fdd�Zejd	krHdd
d�Z	ne
j
Z	ddd
�Z
�ZS)�SelectSelectorzSelect-based selector.cst���t�|_t�|_dSr)�superr�set�_readers�_writersr ��	__class__rrr%s
zSelectSelector.__init__Ncs@t��|||�}|t@r&|j�|j�|t@r<|j�|j�|Sr)rLr1rDrN�addrrErOrFrPrrr1*szSelectSelector.registercs,t��|�}|j�|j�|j�|j�|Sr)rLr2rN�discardrrOrBrPrrr22szSelectSelector.unregisterZwin32cCs$t�||||�\}}}|||gfSr)r5)r�r�w�_r4�xrrr�_select9szSelectSelector._selectc	Cs�|dkrdnt|d�}g}z|�|j|jg|�\}}}Wntk
rP|YSXt|�}t|�}||BD]J}d}||kr�|tO}||kr�|tO}|�|�}|rj|�	|||j
@f�qj|S�Nr)�maxrXrNrO�InterruptedErrorrMrDrErJ�appendr)	rr4�readyrTrUrVrrrCrrrr5?s$

zSelectSelector.select)N)N)N)r)r*r+r,rr1r2�sys�platformrXr5�
__classcell__rrrPrrK"s
rKcs^eZdZdZdZdZdZ�fdd�Zd
�fdd�	Z�fdd�Z	d�fd	d
�	Z
ddd�Z�ZS)�_PollLikeSelectorz<Base class shared between poll, epoll and devpoll selectors.Ncst���|��|_dSr)rLr�
_selector_clsrr rPrrr[s
z_PollLikeSelector.__init__cslt��|||�}d}|t@r&||jO}|t@r8||jO}z|j�|j|�Wnt��|��YnX|SrY)	rLr1rD�_EVENT_READrE�_EVENT_WRITErrr2)rrrrrCZ
poller_eventsrPrrr1_s

z_PollLikeSelector.registercs8t��|�}z|j�|j�Wntk
r2YnX|Sr)rLr2rr�OSErrorrBrPrrr2msz_PollLikeSelector.unregistercs�z|j|�|�}Wn$tk
r8t|�d��d�YnXd}||jkr�d}|t@r^||jO}|t@rp||jO}z|j�	|j
|�Wnt��|��YnXd}||j
kr�d}|r�|j||d�}||j|j
<|S)Nz is not registeredFrT)rr)rr$r%rrDrcrErdrr3rrLr2rrH)rrrrrCZchangedZselector_eventsrPrrr3ws.



z_PollLikeSelector.modifycCs�|dkrd}n|dkrd}nt�|d�}g}z|j�|�}Wntk
rV|YSX|D]V\}}d}||j@r||tO}||j@r�|tO}|�	|�}|r\|�
|||j@f�q\|S)Nr�@�@)�math�ceilr�pollr[rcrErdrDrJr\r)rr4r]�
fd_event_listr�eventrrCrrrr5�s(

z_PollLikeSelector.select)N)N)N)
r)r*r+r,rbrcrdrr1r2r3r5r`rrrPrraUs
raric@s"eZdZdZejZejZej	Z
dS)�PollSelectorzPoll-based selector.N)r)r*r+r,r5rirb�POLLINrc�POLLOUTrdrrrrrl�srl�epollcsDeZdZdZejZejZej	Z
dd�Zd	dd�Z�fdd�Z�Z
S)
�
EpollSelectorzEpoll-based selector.cCs
|j��Sr�rr
r rrrr
�szEpollSelector.filenoNc	Cs�|dkrd}n |dkrd}nt�|d�d}tt|j�d�}g}z|j�||�}Wntk
rl|YSX|D]V\}}d}|tj	@r�|t
O}|tj@r�|tO}|�
|�}|rr|�|||j@f�qr|S)N���rrfg����MbP?r)rgrhrZrrrrir[r5�EPOLLINrE�EPOLLOUTrDrJr\r)	rr4�max_evr]rjrrkrrCrrrr5�s*

zEpollSelector.selectcs|j��t���dSr�rr6rLr rPrrr6�s
zEpollSelector.close)N)r)r*r+r,r5rorbrsrcrtrdr
r6r`rrrPrrp�s
 rp�devpollcs:eZdZdZejZejZej	Z
dd�Z�fdd�Z�Z
S)�DevpollSelectorzSolaris /dev/poll selector.cCs
|j��Srrqr rrrr
�szDevpollSelector.filenocs|j��t���dSrrvr rPrrr6�s
zDevpollSelector.close)r)r*r+r,r5rwrbrmrcrnrdr
r6r`rrrPrrx�srx�kqueuecsXeZdZdZ�fdd�Zdd�Zd�fdd�	Z�fd	d
�Zddd�Z�fd
d�Z	�Z
S)�KqueueSelectorzKqueue-based selector.cst���t��|_dSr)rLrr5ryrr rPrrr�s
zKqueueSelector.__init__cCs
|j��Srrqr rrrr
szKqueueSelector.filenoNcs�t��|||�}z`|t@r@t�|jtjtj�}|j�	|gdd�|t
@rnt�|jtjtj�}|j�	|gdd�Wnt��|��YnX|SrY)
rLr1rDr5�keventr�KQ_FILTER_READZ	KQ_EV_ADDr�controlrE�KQ_FILTER_WRITEr2)rrrrrC�kevrPrrr1s ��zKqueueSelector.registercs�t��|�}|jt@rVt�|jtjtj�}z|j	�
|gdd�Wntk
rTYnX|jt@r�t�|jtj
tj�}z|j	�
|gdd�Wntk
r�YnX|SrY)rLr2rrDr5r{rr|ZKQ_EV_DELETErr}rerEr~)rrrCrrPrrr2s$
�
�zKqueueSelector.unregisterc
Cs�|dkrdnt|d�}t|j�}g}z|j�d||�}Wntk
rP|YSX|D]Z}|j}|j}d}|tj	kr||t
O}|tjkr�|tO}|�
|�}	|	rV|�|	||	j@f�qV|SrY)rZrrrr}r[Zident�filterr5r|rDr~rErJr\r)
rr4rur]Zkev_listrr�flagrrCrrrr5)s&




zKqueueSelector.selectcs|j��t���dSrrvr rPrrr6?s
zKqueueSelector.close)N)N)r)r*r+r,rr
r1r2r5r6r`rrrPrrz�s
rz) r,�abcrr�collectionsrZcollections.abcrrgr5r^rDrErr�version_inforrrrrr-r?rKra�hasattrrlrprxrz�globalsZDefaultSelectorrrrr�<module>sL
~T3Z.Mpy_compile.cpython-38.opt-1.pyc000064400000016332151450073350012303 0ustar00U

&�.e �@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddddgZ
Gdd�de�ZGdd�dej
�Zd	d
�Zdd
d�Zddd�Zedkr�e�e��dS)zqRoutine to "compile" a .py file to a .pyc file.

This module has intimate knowledge of the format of .pyc files.
�N�compile�main�PyCompileError�PycInvalidationModec@s"eZdZdZddd�Zdd�ZdS)	ra�Exception raised when an error occurs while attempting to
    compile the file.

    To raise this exception, use

        raise PyCompileError(exc_type,exc_value,file[,msg])

    where

        exc_type:   exception type to be used in error message
                    type name can be accesses as class variable
                    'exc_type_name'

        exc_value:  exception value to be used in error message
                    can be accesses as class variable 'exc_value'

        file:       name of file being compiled to be used in error message
                    can be accesses as class variable 'file'

        msg:        string message to be written as error message
                    If no value is given, a default exception message will be
                    given, consistent with 'standard' py_compile output.
                    message (or default) can be accesses as class variable
                    'msg'

    �cCst|j}|tkr2d�t�||��}|�dd|�}nd||f}t�||pJ||||�||_||_	||_
|pl||_dS)NrzFile "<string>"z	File "%s"z
Sorry: %s: %s)�__name__�SyntaxError�join�	traceback�format_exception_only�replace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�self�exc_typerrrr�tbtext�errmsg�r�"/usr/lib64/python3.8/py_compile.pyr.s�zPyCompileError.__init__cCs|jS)N)r)rrrr�__str__>szPyCompileError.__str__N)r)r�
__module__�__qualname__�__doc__rrrrrrrs
c@seZdZdZdZdZdS)r���N)rrr�	TIMESTAMP�CHECKED_HASH�UNCHECKED_HASHrrrrrBscCs(tj�d�rtj�d�stjStjSdS)N�SOURCE_DATE_EPOCH�RPM_BUILD_ROOT)�os�environ�getrr!r rrrr�_get_default_invalidation_modeHs

�r(F���c
Cs�|dkrt�}|dkrL|dkr@|dkr*|nd}tjj||d�}ntj�|�}tj�|�rld}t|�|���n*tj�	|�r�tj�
|�s�d}t|�|���tj�d|�}	|	�
|�}
z|	j|
|p�||d	�}Wndtk
�r*}zDt|j||p�|�}
|d
k�r|�r|
�ntj�|
jd�WY�dSd}~XYnXz tj�|�}|�rJt�|�Wntk
�rbYnX|tjk�r�|	�|�}tj�||d|d
�}n"tj�|
�}tj�|||tjk�}tj� |�}tj�!|||�|S)a�Byte-compile one Python source file to Python bytecode.

    :param file: The source file name.
    :param cfile: The target byte compiled file name.  When not given, this
        defaults to the PEP 3147/PEP 488 location.
    :param dfile: Purported file name, i.e. the file name that shows up in
        error messages.  Defaults to the source file name.
    :param doraise: Flag indicating whether or not an exception should be
        raised when a compile error is found.  If an exception occurs and this
        flag is set to False, a string indicating the nature of the exception
        will be printed, and the function will return to the caller. If an
        exception occurs and this flag is set to True, a PyCompileError
        exception will be raised.
    :param optimize: The optimization level for the compiler.  Valid values
        are -1, 0, 1 and 2.  A value of -1 means to use the optimization
        level of the current interpreter, as given by -O command line options.
    :param invalidation_mode:
    :param quiet: Return full output with False or 0, errors only with 1,
        and no output with 2.

    :return: Path to the resulting byte compiled file.

    Note that it isn't necessary to byte-compile Python modules for
    execution efficiency -- Python itself byte-compiles a module when
    it is loaded, and if it can, writes out the bytecode to the
    corresponding .pyc file.

    However, if a Python installation is shared between users, it is a
    good idea to byte-compile all modules upon installation, since
    other users may not be able to write in the source directories,
    and thus they won't be able to write the .pyc file, and then
    they would be byte-compiling every module each time it is loaded.
    This can slow down program start-up considerably.

    See compileall.py for a script/module that uses this module to
    byte-compile all installed files (or all files in selected
    directories).

    Do note that FileExistsError is raised if cfile ends up pointing at a
    non-regular file or symlink. Because the compilation uses a file renaming,
    the resulting file would be regular and thus not the same type of file as
    it was previously.
    Nrrr)�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)�	_optimizer�
�mtime�size)"r(�	importlib�util�cache_from_sourcer%�path�islink�FileExistsError�format�exists�isfile�	machinery�SourceFileLoader�get_data�source_to_coder
r�	__class__�sys�stderr�writer�dirname�makedirsrr �
path_stats�_bootstrap_external�_code_to_timestamp_pyc�source_hash�_code_to_hash_pycr!�
_calc_mode�
_write_atomic)r�cfile�dfile�doraise�optimize�invalidation_mode�quietr*r�loader�source_bytes�code�err�py_excr@�source_stats�bytecoderE�moderrrrPsd-�
�


��cCs|dkrtjdd�}d}|dgkr�tj��}|s4q�|�d�}zt|dd�Wq$tk
r�}zd}tj�d|j	�W5d}~XYq$t
k
r�}zd}tj�d|�W5d}~XYq$Xq$nV|D]P}zt|dd�Wq�tk
�r}zd}tj�d|j	�W5d}~XYq�Xq�|S)	a�Compile several source files.

    The files named in 'args' (or on the command line, if 'args' is
    not specified) are compiled and the resulting bytecode is cached
    in the normal manner.  This function does not search a directory
    structure to locate source files; it only compiles files named
    explicitly.  If '-' is the only parameter in args, the list of
    files is taken from standard input.

    Nrr�-r,T)rKz%s
)r=�argv�stdin�readline�rstriprrr>r?r�OSError)�args�rv�filename�errorrrrr�s.


"&&�__main__)NNFr)Nr)N)r�enumZimportlib._bootstrap_externalr/�importlib.machinery�importlib.utilr%Zos.pathr=r
�__all__r
r�Enumrr(rrr�exitrrrr�<module>s&0�
a
&antigravity.cpython-38.opt-1.pyc000064400000001437151450073350012504 0ustar00U

e5d��@s&ddlZddlZe�d�dd�ZdS)�Nzhttps://xkcd.com/353/cCs\t�|���}dd�|dd�|dd�fD�\}}td||dd�||dd�f�dS)z�Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    cSsg|]}dt�d|��qS)z%fz0.)�float�fromhex)�.0�x�r�#/usr/lib64/python3.8/antigravity.py�
<listcomp>szgeohash.<locals>.<listcomp>N�� z	%d%s %d%s�)�hashlibZmd5Z	hexdigest�print)ZlatitudeZ	longitudeZdatedow�h�p�qrrr�geohashs&r)Z
webbrowserr�openrrrrr�<module>s
bdb.cpython-38.pyc000064400000060533151450073350007735 0ustar00U

e5d8}�@s�dZddlZddlZddlZddlmZmZmZdddgZeeBeBZ	Gdd�de
�ZGdd�d�Zd	d
�Z
Gdd�d�Zdd
�Zdd�ZGdd�de�Zdd�Zdd�Zdd�ZdS)zDebugger basics�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�
Breakpointc@seZdZdZdS)rz Exception to give up completely.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/bdb.pyr
sc@sveZdZdZd[dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd\d&d'�Zd]d(d)�Zd*d+�Zd,d-�Zd.d/�Zd^d0d1�Zd2d3�Zd4d5�Zd_d7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dMdN�Z(d`dPdQ�Z)dadRdS�Z*dbdTdU�Z+dVdW�Z,dXdY�Z-dZe-_.dS)craGeneric Python debugger base class.

    This class takes care of details of the trace facility;
    a derived class should implement user interaction.
    The standard debugger class (pdb.Pdb) is an example.

    The optional skip argument must be an iterable of glob-style
    module name patterns.  The debugger will not step into frames
    that originate in a module that matches one of these patterns.
    Whether a frame is considered to originate in a certain module
    is determined by the __name__ in the frame globals.
    NcCs(|rt|�nd|_i|_i|_d|_dS)N)�set�skip�breaks�fncache�frame_returning)�selfrrrr
�__init__szBdb.__init__cCsR|d|dd�dkr|S|j�|�}|sNtj�|�}tj�|�}||j|<|S)a%Return canonical form of filename.

        For real filenames, the canonical form is a case-normalized (on
        case insensitive filesystems) absolute path.  'Filenames' with
        angle brackets, such as "<stdin>", generated in interactive
        mode, are returned unchanged.
        �<�����>)r�get�os�path�abspath�normcase)r�filename�canonicrrr
r%s
zBdb.canoniccCs&ddl}|��d|_|�dd�dS)z5Set values of attributes as ready to start debugging.rN)�	linecache�
checkcache�botframe�
_set_stopinfo)rr rrr
�reset6sz	Bdb.resetcCs�|jr
dS|dkr|�|�S|dkr0|�||�S|dkrD|�||�S|dkrX|�||�S|dkrf|jS|dkrt|jS|dkr�|jStd	t|��|jS)
aODispatch a trace function for debugged frames based on the event.

        This function is installed as the trace function for debugged
        frames. Its return value is the new trace function, which is
        usually itself. The default implementation decides how to
        dispatch a frame, depending on the type of event (passed in as a
        string) that is about to be executed.

        The event can be one of the following:
            line: A new line of code is going to be executed.
            call: A function is about to be called or another code block
                  is entered.
            return: A function or other code block is about to return.
            exception: An exception has occurred.
            c_call: A C function is about to be called.
            c_return: A C function has returned.
            c_exception: A C function has raised an exception.

        For the Python events, specialized functions (see the dispatch_*()
        methods) are called.  For the C events, no action is taken.

        The arg parameter depends on the previous event.
        N�lineZcall�returnZ	exceptionZc_callZc_exceptionZc_returnz*bdb.Bdb.dispatch: unknown debugging event:)�quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exception�trace_dispatch�print�repr)r�frameZevent�argrrr
r,=s$
zBdb.trace_dispatchcCs.|�|�s|�|�r(|�|�|jr(t�|jS)a	Invoke user function and return trace function for line event.

        If the debugger stops on the current line, invoke
        self.user_line(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        )�	stop_here�
break_here�	user_liner'rr,�rr/rrr
r(hs

zBdb.dispatch_linecCsd|jdkr|j|_|jS|�|�s0|�|�s0dS|jrH|jjt@rH|jS|�	||�|j
r^t�|jS)aInvoke user function and return trace function for call event.

        If the debugger stops on this function call, invoke
        self.user_call(). Raise BbdQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        N)r"�f_backr,r1�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr'r�rr/r0rrr
r)ts
zBdb.dispatch_callcCs||�|�s||jkrv|jr,|jjt@r,|jSz||_|�||�W5d|_X|j	rVt
�|j|krv|jdkrv|�dd�|jS)aInvoke user function and return trace function for return event.

        If the debugger stops on this function return, invoke
        self.user_return(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        Nr)
r1�returnframer7r8r9r:r,r�user_returnr'r�
stoplinenor#r<rrr
r*�szBdb.dispatch_returncCs�|�|�rF|jjt@r.|dtkr.|ddks�|�||�|jr�t�nD|jr�||jk	r�|jjjt@r�|dtt	fkr�|�||�|jr�t�|j
S)aInvoke user function and return trace function for exception event.

        If the debugger stops on this exception, invoke
        self.user_exception(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        r�N)r1r8r9r:�
StopIteration�user_exceptionr'rr7�
GeneratorExitr,r<rrr
r+�s$

�
���zBdb.dispatch_exceptioncCs.|dkrdS|jD]}t�||�rdSqdS)z4Return True if module_name matches any skip pattern.NFT)r�fnmatch)rZmodule_name�patternrrr
�is_skipped_module�s
zBdb.is_skipped_modulecCsN|jr|�|j�d��rdS||jkr@|jdkr4dS|j|jkS|jsJdSdS)z>Return True if frame is below the starting frame in the stack.rFrT)rrF�	f_globalsrr7r?�f_linenor4rrr
r1�s�

z
Bdb.stop_herecCs�|�|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j	r�|�
t|j��dSdSdS)z�Return True if there is an effective breakpoint for this line.

        Check for line or function breakpoint and if in effect.
        Delete temporary breakpoints if effective() says to.
        FTN)rr8�co_filenamerrH�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr/r�lineno�bp�flagrrr
r2�s

zBdb.break_herecCstd��dS)zlRemove temporary breakpoint.

        Must implement in derived classes or get NotImplementedError.
        z)subclass of bdb must implement do_clear()N)�NotImplementedError)rr0rrr
rN�szBdb.do_clearcCs|�|jj�|jkS)zEReturn True if there is any breakpoint for frame's filename.
        )rr8rIrr4rrr
r6�szBdb.break_anywherecCsdS)z&Called if we might stop in a function.Nr)rr/Z
argument_listrrr
r;sz
Bdb.user_callcCsdS)z'Called when we stop or break at a line.Nrr4rrr
r3sz
Bdb.user_linecCsdS)z&Called when a return trap is set here.Nr)rr/Zreturn_valuerrr
r>	szBdb.user_returncCsdS)z$Called when we stop on an exception.Nr)rr/�exc_inforrr
rB
szBdb.user_exceptionrcCs||_||_d|_||_dS)z�Set the attributes for stopping.

        If stoplineno is greater than or equal to 0, then stop at line
        greater than or equal to the stopline.  If stoplineno is -1, then
        don't stop at all.
        FN)r7r=r'r?)rr7r=r?rrr
r#szBdb._set_stopinfocCs$|dkr|jd}|�|||�dS)zxStop when the line with the lineno greater than the current one is
        reached or when returning from current frame.Nr)rHr#)rr/rPrrr
�	set_until"s
z
Bdb.set_untilcCs0|jr |jj}|r |js |j|_|�dd�dS)zStop after one line of code.N)rr5�f_tracer,r#)rZcaller_framerrr
�set_step*s

zBdb.set_stepcCs|�|d�dS)z2Stop on the next line in or below the given frame.N)r#r4rrr
�set_next6szBdb.set_nextcCs.|jjt@r|�|dd�n|�|j|�dS)z)Stop when returning from the given frame.Nr)r8r9r:r#r5r4rrr
�
set_return:szBdb.set_returncCsL|dkrt��j}|��|r4|j|_||_|j}q|��t�|j�dS)znStart debugging from frame.

        If frame is not specified, debugging starts from caller's frame.
        N)	�sys�	_getframer5r$r,rVr"rW�settracer4rrr
�	set_traceAs
z
Bdb.set_tracecCsH|�|jdd�|jsDt�d�t��j}|rD||jk	rD|`|j}q*dS)z�Stop only at breakpoints or when finished.

        If there are no breakpoints, set the system trace function to None.
        Nr)r#r"rrZr\r[r5rVr4rrr
�set_continuePs

zBdb.set_continuecCs"|j|_d|_d|_t�d�dS)zuSet quitting attribute to True.

        Raises BdbQuit exception in the next call to a dispatch_*() method.
        NT)r"r7r=r'rZr\�rrrr
�set_quit_szBdb.set_quitFc
Csb|�|�}ddl}|�||�}|s.d||fS|j�|g�}||krN|�|�t|||||�}	dS)z�Set a new breakpoint for filename:lineno.

        If lineno doesn't exist for the filename, return an error message.
        The filename should be in canonical form.
        rNzLine %s:%d does not exist)rr �getliner�
setdefault�appendr)
rrrPrM�cond�funcnamer r%�listrQrrr
�	set_breakps

z
Bdb.set_breakcCs4||ftjkr|j|�|�|j|s0|j|=dS)aPrune breakpoints for filename:lineno.

        A list of breakpoints is maintained in the Bdb instance and in
        the Breakpoint class.  If a breakpoint in the Bdb instance no
        longer exists in the Breakpoint class, then it's removed from the
        Bdb instance.
        N)r�bplistr�remove�rrrPrrr
�
_prune_breaks�s
zBdb._prune_breakscCsj|�|�}||jkrd|S||j|kr6d||fStj||fdd�D]}|��qL|�||�dS)znDelete breakpoints for filename:lineno.

        If no breakpoints were set, return an error message.
        �There are no breakpoints in %szThere is no breakpoint at %s:%dN)rrrrh�deleteMerk)rrrPrQrrr
�clear_break�s


zBdb.clear_breakc
CsZz|�|�}Wn.tk
r<}zt|�WY�Sd}~XYnX|��|�|j|j�dS)zxDelete a breakpoint by its index in Breakpoint.bpbynumber.

        If arg is invalid, return an error message.
        N)�get_bpbynumber�
ValueErrorrOrmrk�filer%)rr0rQ�errrrr
�clear_bpbynumber�szBdb.clear_bpbynumbercCsX|�|�}||jkrd|S|j|D]$}tj||f}|D]}|��q<q&|j|=dS)z`Delete all breakpoints in filename.

        If none were set, return an error message.
        rlN)rrrrhrm)rrr%ZblistrQrrr
�clear_all_file_breaks�s

zBdb.clear_all_file_breakscCs,|js
dStjD]}|r|��qi|_dS)z]Delete all existing breakpoints.

        If none were set, return an error message.
        zThere are no breakpointsN)rr�
bpbynumberrm)rrQrrr
�clear_all_breaks�s

zBdb.clear_all_breakscCs�|std��zt|�}Wn"tk
r:td|�d�YnXztj|}Wn"tk
rltd|�d�YnX|dkr�td|��|S)z�Return a breakpoint by its index in Breakpoint.bybpnumber.

        For invalid arg values or if the breakpoint doesn't exist,
        raise a ValueError.
        zBreakpoint number expectedz Non-numeric breakpoint number %sNz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rp�intrru�
IndexError)rr0rLrQrrr
ro�szBdb.get_bpbynumbercCs"|�|�}||jko ||j|kS)z9Return True if there is a breakpoint for filename:lineno.�rrrjrrr
�	get_break�s

�z
Bdb.get_breakcCs4|�|�}||jkr0||j|kr0tj||fp2gS)znReturn all breakpoints for filename:lineno.

        If no breakpoints are set, return an empty list.
        )rrrrhrjrrr
�
get_breaks�s

���zBdb.get_breakscCs&|�|�}||jkr|j|SgSdS)zrReturn all lines with breakpoints for filename.

        If no breakpoints are set, return an empty list.
        Nry)rrrrr
�get_file_breaks�s


zBdb.get_file_breakscCs|jS)z$Return all breakpoints that are set.)rr_rrr
�get_all_breaks�szBdb.get_all_breakscCs�g}|r|j|kr|j}|dk	rD|�||jf�||jkr<qD|j}q|��tdt|�d�}|dk	r�|�|j|j	f�|j}q^|dkr�tdt|�d�}||fS)z�Return a list of (frame, lineno) in a stack trace and a size.

        List starts with original calling frame, if there is one.
        Size may be number of frames above or below f.
        Nrr)
�tb_frame�tb_nextrcrHr"r5�reverse�max�len�	tb_lineno)r�f�t�stack�irrr
�	get_stack�s 
z
Bdb.get_stack�: cCs�ddl}ddl}|\}}|�|jj�}d||f}|jjrH||jj7}n|d7}|d7}d|jkr�|jd}	|d7}||�|	�7}|�|||j	�}
|
r�|||
�
�7}|S)a:Return a string with information about a stack entry.

        The stack entry frame_lineno is a (frame, lineno) tuple.  The
        return string contains the canonical filename, the function name
        or '<lambda>', the input arguments, the return value, and the
        line of code (if it exists).

        rNz%s(%r)z<lambda>z()Z
__return__z->)r �reprlibrr8rI�co_name�f_localsr.rarG�strip)rZframe_linenoZlprefixr r�r/rPr�s�rvr%rrr
�format_stack_entrys 	

zBdb.format_stack_entryc	Cs�|dkrddl}|j}|dkr"|}|��t|t�r@t|dd�}t�|j�z*zt
|||�Wntk
rrYnXW5d|_	t�d�XdS)z�Debug a statement executed via the exec() function.

        globals defaults to __main__.dict; locals defaults to globals.
        Nrz<string>�execT)�__main__�__dict__r$�
isinstancerO�compilerZr\r,r'r�r)r�cmd�globals�localsr�rrr
�run5s

zBdb.runc	Csz|dkrddl}|j}|dkr"|}|��t�|j�z,zt|||�WW�Stk
r^YnXW5d|_t�d�XdS)z�Debug an expression executed via the eval() function.

        globals defaults to __main__.dict; locals defaults to globals.
        NrT)	r�r�r$rZr\r,r'�evalr)r�exprr�r�r�rrr
�runevalKs
zBdb.runevalcCs|�|||�dS)z.For backwards-compatibility.  Defers to run().N)r�)rr�r�r�rrr
�runctx_sz
Bdb.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|��t�|j	�d}z(z|||�}Wntk
r�YnXW5d
|_
t�d�X|S)zWDebug a single function call.

        Return the result of the function call.
        r@z6descriptor 'runcall' of 'Bdb' object needs an argument�funcrNz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %drT)r��	TypeError�pop�warnings�warn�DeprecationWarningr$rZr\r,r'r)�args�kwdsrr�r��resrrr
�runcallfs2

�
�
zBdb.runcallz($self, func, /, *args, **kwds))N)r)N)N)FNN)r�)NN)NN)/rr	r
rrrr$r,r(r)r*r+rFr1r2rNr6r;r3r>rBr#rUrWrXrYr]r^r`rgrkrnrsrtrvrorzr{r|r}r�r�r�r�r�r��__text_signature__rrrr
rs\
+	


�







cCst���dS)z<Start debugging with a Bdb instance from the caller's frame.N)rr]rrrr
r]�sr]c@sZeZdZdZdZiZdgZddd�Zdd�Zd	d
�Z	dd�Z
dd
d�Zdd�Zdd�Z
dS)ra�Breakpoint class.

    Implements temporary breakpoints, ignore counts, disabling and
    (re)-enabling, and conditionals.

    Breakpoints are indexed by number through bpbynumber and by
    the (file, line) tuple using bplist.  The former points to a
    single instance of class Breakpoint.  The latter points to a
    list of such instances since there may be more than one
    breakpoint per line.

    When creating a breakpoint, its associated filename should be
    in canonical form.  If funcname is defined, a breakpoint hit will be
    counted when the first line of that function is executed.  A
    conditional breakpoint always counts a hit.
    rNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|j�
|�||f|jkr||j||f�
|�n|g|j||f<dS)NTrr)re�func_first_executable_linerqr%rMrd�enabled�ignore�hitsr�nextrLrurcrh)rrqr%rMrdrerrr
r�szBreakpoint.__init__cCs>|j|jf}d|j|j<|j|�|�|j|s:|j|=dS)z�Delete the breakpoint from the list associated to a file:line.

        If it is the last breakpoint in that position, it also deletes
        the entry for the file:line.
        N)rqr%rurLrhri)r�indexrrr
rm�s

zBreakpoint.deleteMecCs
d|_dS)zMark the breakpoint as enabled.TN�r�r_rrr
�enable�szBreakpoint.enablecCs
d|_dS)z Mark the breakpoint as disabled.FNr�r_rrr
�disable�szBreakpoint.disablecCs"|dkrtj}t|��|d�dS)z�Print the output of bpformat().

        The optional out argument directs where the output is sent
        and defaults to standard output.
        N)rq)rZ�stdoutr-�bpformat)r�outrrr
�bpprint�szBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d	}nd
}|d|j|f7}|S)z�Return a string with information about the breakpoint.

        The information includes the breakpoint number, temporary
        status, file:line position, break condition, number of times to
        ignore, and number of times hit.

        zdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz
	stop only if %sz
	ignore next %d hitsrr��z"
	breakpoint already hit %d time%s)rMr�rLrqr%rdr�r�)rZdispZretZssrrr
r��s(
�
zBreakpoint.bpformatcCsd|j|j|jfS)z1Return a condensed description of the breakpoint.zbreakpoint %s at %s:%s)rLrqr%r_rrr
�__str__�szBreakpoint.__str__)FNN)N)rr	r
rr�rhrurrmr�r�r�r�r�rrrr
r�s


cCsN|js|j|jkrdSdS|jj|jkr,dS|js:|j|_|j|jkrJdSdS)aVReturn True if break should happen here.

    Whether a break should happen depends on the way that b (the breakpoint)
    was set.  If it was set via line number, check if b.line is the same as
    the one in the frame.  If it was set via function name, check if this is
    the right function and if it is on the first executable line.
    FT)rer%rHr8r�r�)�br/rrr
�
checkfuncnamesr�cCs�tj||f}|D]�}|jsqt||�s*q|jd7_|jsh|jdkrZ|jd8_qq�|dfSqzBt|j|j|j	�}|r�|jdkr�|jd8_n|dfWSWq|dfYSXqdS)aEDetermine which breakpoint for this file:line is to be acted upon.

    Called only if we know there is a breakpoint at this location.  Return
    the breakpoint that was triggered and a boolean that indicates if it is
    ok to delete a temporary breakpoint.  Return (None, None) if there is no
    matching breakpoint.
    rrTF)NN)
rrhr�r�r�rdr�r�rGr�)rqr%r/Z	possiblesr��valrrr
rK#s*


rKc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)N�???z+++ call)r8r�r-)rr/r��namerrr
r;Tsz
Tdb.user_callcCsTddl}|jj}|sd}|�|jj�}|�||j|j�}td||j|d|�	��dS)Nrr�z+++�:)
r r8r�rrIrarHrGr-r�)rr/r r��fnr%rrr
r3Xsz
Tdb.user_linecCstd|�dS)Nz
+++ return�r-)rr/Zretvalrrr
r>_szTdb.user_returncCstd|�|��dS)Nz
+++ exception)r-r^)rr/Z	exc_stuffrrr
rBas
zTdb.user_exceptionN)rr	r
r;r3r>rBrrrr
r�Ssr�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r-�bar)�n�xrrr
�fooesr�cCstd|d�|dS)Nzbar(r�r@r�)�arrr
r�jsr�cCst�}|�d�dS)Nzimport bdb; bdb.foo(10))r�r�)r�rrr
�testnsr�)rrDrZr�inspectrrr�__all__r:�	Exceptionrrr]rr�rKr�r�r�r�rrrr
�<module>s(
{t"0shelve.cpython-38.opt-2.pyc000064400000012335151450073350011431 0ustar00U

e5dO!�@s�ddlmZmZddlmZddlZddddgZGdd	�d	ejj	�Z
Gd
d�dejj	�ZGdd�de�ZGdd�de�Z
ddd�ZdS)�)�Pickler�	Unpickler)�BytesION�Shelf�
BsdDbShelf�DbfilenameShelf�openc@s4eZdZdd�ZeZZZZZZ	dd�Z
dS)�_ClosedDictcGstd��dS)Nz!invalid operation on closed shelf)�
ValueError)�self�args�r
�/usr/lib64/python3.8/shelve.py�closedEsz_ClosedDict.closedcCsdS)Nz<Closed Dictionary>r
�rr
r
r�__repr__Isz_ClosedDict.__repr__N)�__name__�
__module__�__qualname__r�__iter__�__len__�__getitem__�__setitem__�__delitem__�keysrr
r
r
rr	Bsr	c@sxeZdZddd�Zdd�Zdd	�Zd
d�Zddd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS) rNF�utf-8cCs.||_|dkrd}||_||_i|_||_dS)N�)�dict�	_protocol�	writeback�cache�keyencoding�rr�protocolrr!r
r
r�__init__TszShelf.__init__ccs"|j��D]}|�|j�Vq
dS�N)rr�decoder!)r�kr
r
rr^szShelf.__iter__cCs
t|j�Sr%)�lenrrr
r
rrbsz
Shelf.__len__cCs|�|j�|jkSr%��encoder!r�r�keyr
r
r�__contains__eszShelf.__contains__cCs|�|j�|jkr||S|Sr%r))rr,�defaultr
r
r�gethsz	Shelf.getcCsZz|j|}WnFtk
rTt|j|�|j��}t|���}|jrP||j|<YnX|Sr%)	r �KeyErrorrrr*r!r�loadr�rr,�value�fr
r
rrmszShelf.__getitem__cCsF|jr||j|<t�}t||j�}|�|�|��|j|�|j	�<dSr%)
rr rrr�dump�getvaluerr*r!)rr,r3r4�pr
r
rrws

zShelf.__setitem__cCs6|j|�|j�=z|j|=Wntk
r0YnXdSr%)rr*r!r r0r+r
r
rrs
zShelf.__delitem__cCs|Sr%r
rr
r
r�	__enter__�szShelf.__enter__cCs|��dSr%)�close)r�typer3�	tracebackr
r
r�__exit__�szShelf.__exit__cCsf|jdkrdSz0|��z|j��Wntk
r:YnXW5zt�|_Wnd|_YnXXdSr%)rr	�syncr9�AttributeErrorrr
r
rr9�s

zShelf.closecCst|d�sdS|��dS)Nr)�hasattrr9rr
r
r�__del__�s
z
Shelf.__del__cCsT|jr:|jr:d|_|j��D]\}}|||<qd|_i|_t|jd�rP|j��dS)NFTr=)rr �itemsr?rr=)rr,�entryr
r
rr=�s
z
Shelf.sync)NFr)N)rrrr$rrr-r/rrrr8r<r9r@r=r
r
r
rrMs�



c@s>eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�ZdS)rNFrcCst�|||||�dSr%)rr$r"r
r
rr$�szBsdDbShelf.__init__cCs0|j�|�\}}t|�}|�|j�t|���fSr%)r�set_locationrr&r!rr1r2r
r
rrC�szBsdDbShelf.set_locationcCs.t|j�\}}t|�}|�|j�t|���fSr%)�nextrrr&r!rr1r2r
r
rrD�szBsdDbShelf.nextcCs.|j��\}}t|�}|�|j�t|���fSr%)r�previousrr&r!rr1r2r
r
rrE�szBsdDbShelf.previouscCs.|j��\}}t|�}|�|j�t|���fSr%)r�firstrr&r!rr1r2r
r
rrF�szBsdDbShelf.firstcCs.|j��\}}t|�}|�|j�t|���fSr%)r�lastrr&r!rr1r2r
r
rrG�szBsdDbShelf.last)NFr)	rrrr$rCrDrErFrGr
r
r
rr�s
�
c@seZdZddd�ZdS)r�cNFcCs$ddl}t�||�||�||�dS)Nr)�dbmrr$r)r�filename�flagr#rrIr
r
rr$�szDbfilenameShelf.__init__)rHNF)rrrr$r
r
r
rr�srHFcCst||||�Sr%)r)rJrKr#rr
r
rr�s
)rHNF)�picklerr�iorZcollections.abc�collections�__all__�abc�MutableMappingr	rrrrr
r
r
r�<module>;sb+_compat_pickle.cpython-38.pyc000064400000012577151450073350012164 0ustar00U

e5d-"�+@sdddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�*Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdL�!ZdMZzeWnek
r�Yn
XedN7ZeD]ZdefedOef<q�dPZeD]ZdQefedRef<q�edSdT�e��D��Z	e
e	�e
e�k�s0t�edUdT�e��D��Ze
e�e
e�k�s\t�e�
dVdWdddd"d"dXdXdXd(dYdYdZ�
�e	�
d[d(d\d]dVd^��e�
d/d_d6d`da��e�
dbdcdddedfdgdhdidjdkdldmdndo�
�dpZeD]Zdqedef<�q�drZeD]Zdsedef<�q�dtS)u�builtins�copyregZqueueZsocketserverZconfigparser�reprlib�tkinter.filedialog�tkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.client�
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejar�http.serverztest.support�
subprocess�urllib.parsezurllib.robotparser�urllib.request�dbmzcollections.abc)*�__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZtkFileDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmr
�gdbmZ	xmlrpclibZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerztest.test_supportZcommandsZurlparseZrobotparser�urllib2ZanydbmZ_abcoll)r�range)�	functools�reduce)�sys�intern)r�chr)r�str)r�int)r�zip)r�map)r�filter)�	itertools�filterfalse)r�zip_longest)�collections�UserDict)r"�UserList)r"�
UserString)r
�whichdb)�socket�fromfd)zmultiprocessing.connection�
Connection)�multiprocessing.context�Process)zmultiprocessing.popen_fork�Popen)�urllib.error�ContentTooShortError)r�
getproxies)r�pathname2url)r�
quote_plus)r�quote)r�unquote_plus)r�unquote)r�url2pathname)r�
urlcleanup)r�	urlencode)r�urlopen)r�urlretrieve)r-�	HTTPError)r-�URLError)!)rZxrange�rr)rr)rZunichr)rZunicode)rZlong)rZizip)rZimap)rZifilter)rZifilterfalse)rZizip_longest)r#ZIterableUserDict)r$r$)r%r%)r&r&)�_socketr()Z_multiprocessingr))zmultiprocessing.processr+)zmultiprocessing.forkingr,)�urllibr.)r>r/)r>r0)r>r1)r>r2)r>r3)r>r4)r>r5)r>r6)r>r7)r>r8)r>r9)rr:)rr;)/�ArithmeticError�AssertionError�AttributeError�
BaseException�BufferError�BytesWarning�DeprecationWarning�EOFError�EnvironmentError�	Exception�FloatingPointError�
FutureWarning�
GeneratorExit�IOError�ImportError�
ImportWarning�IndentationError�
IndexError�KeyError�KeyboardInterrupt�LookupError�MemoryError�	NameError�NotImplementedError�OSError�
OverflowError�PendingDeprecationWarning�ReferenceError�RuntimeError�RuntimeWarning�
StopIteration�SyntaxError�
SyntaxWarning�SystemError�
SystemExit�TabError�	TypeError�UnboundLocalError�UnicodeDecodeError�UnicodeEncodeError�UnicodeError�UnicodeTranslateError�UnicodeWarning�UserWarning�
ValueError�Warning�ZeroDivisionError)�WindowsError�
exceptions)ZAuthenticationErrorZBufferTooShortZProcessError�TimeoutErrorr*Zmultiprocessingccs|]\}}||fVqdS�N���.0�k�vrrrr�&/usr/lib64/python3.8/_compat_pickle.py�	<genexpr>�srxccs|]\}}||fVqdSrqrrrsrrrrrwrx�s�picklezxml.etree.ElementTreer"�io)
ZcPickleZ_elementtree�
FileDialog�SimpleDialog�DocXMLRPCServer�SimpleHTTPServer�
CGIHTTPServerr#r$r%r&�StringIOZ	cStringIO�bz2rr)Z_bz2Z_dbm�
_functoolsZ_gdbm�_pickle)rrH)r'Z
SocketType))rZ
basestring)roZ
StandardError)r#r#�r'Z
_socketobjectr<)r{r{)r{�LoadFileDialog)r{�SaveFileDialog)r|r|)r}�
ServerHTMLDoc)r}�XMLRPCDocGenerator)r}�DocXMLRPCRequestHandler)r}r})r}�DocCGIXMLRPCRequestHandler)r~�SimpleHTTPRequestHandler)r�CGIHTTPRequestHandlerr�)
)r�r)rr{)rr�)rr�)rr|)rr�)rr�)rr�)rr})rr�)r	r�)r	r�)r=r')�BrokenPipeError�ChildProcessError�ConnectionAbortedError�ConnectionError�ConnectionRefusedError�ConnectionResetError�FileExistsError�FileNotFoundError�InterruptedError�IsADirectoryError�NotADirectoryError�PermissionError�ProcessLookupErrorrp)rorW)�ModuleNotFoundError)rorMN)ZIMPORT_MAPPINGZNAME_MAPPINGZPYTHON2_EXCEPTIONSrnrUZexcnameZMULTIPROCESSING_EXCEPTIONS�dict�itemsZREVERSE_IMPORT_MAPPING�lenr@ZREVERSE_NAME_MAPPING�updateZPYTHON3_OSERROR_EXCEPTIONSZPYTHON3_IMPORTERROR_EXCEPTIONSrrrrrrrw�<module>	s�2�$3����types.cpython-38.opt-2.pyc000064400000017425151450073350011314 0ustar00U

e5d�%�@s�ddlZdd�Zee�Zedd��Zeej�Zeej�Zeej	�Z
dd�Zee��Zdd	�Z
ee
��Zd
d�Ze�Zee�Ze��dd
�Ze�Zee�ZGdd�d�Zee�j�Zee�Zegj�Zeej�Zee�j�Zee j!�Z"ee#jd�Z$ee�Z%ze&�Wn:e&k
�r>e�'�dZ(ee(�Z)ee(j*�Z+dZ([(YnXeej�Z,eej-�Z.[[[
[[[d#dd�Z/dd�Z0d$dd�Z1dd�Z2Gdd�d�Z3Gdd�d�Z4dd �Z5d!d"�e6�D�Z7dS)%�NcCsdS�N�rrr�/usr/lib64/python3.8/types.py�_f�rcCsdSrrrrrr�<lambda>
rrcsd��fdd�}|jdS)N�csdSrrr��arr�fsz_cell_factory.<locals>.fr)�__closure__)rrr	r�
_cell_factorysr
ccs
dVdS)Nrrrrrr�_gsrc�sdSrrrrrr�_crrcCs
dVdSrrrrrr�_ag"src@seZdZdd�ZdS)�_CcCsdSrr��selfrrr�_m(rz_C._mN)�__name__�
__module__�__qualname__rrrrrr'sr�fromkeys�rcCsJt|�}t|||�\}}}|dk	r*||�||k	r:||d<||||f|�S)N�__orig_bases__)�
resolve_bases�
prepare_class)�name�bases�kwds�	exec_body�resolved_bases�meta�nsrrr�	new_classEsr$cCs�t|�}d}d}t|�D]j\}}t|t�r,qt|d�s8q|�|�}d}t|t�sZtd��q||||||d�<|t|�d7}q|s�|St|�S)NFr�__mro_entries__Tz#__mro_entries__ must return a tupler)	�list�	enumerate�
isinstance�type�hasattrr%�tuple�	TypeError�len)r�	new_bases�updated�shift�i�base�new_baserrrrOs"




rcCs~|dkri}nt|�}d|kr*|�d�}n|r<t|d�}nt}t|t�rTt||�}t|d�rp|j||f|�}ni}|||fS)N�	metaclassr�__prepare__)�dict�popr)r(�_calculate_metar*r5)rrrr"r#rrrrds


rcCs>|}|D]0}t|�}t||�r qt||�r0|}qtd��q|S)Nzxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r)�
issubclassr,)r"r�winnerr2�	base_metarrrr8�s


r8c@sHeZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�DynamicClassAttributeNcCs>||_||_||_|p|j|_|dk|_tt|dd��|_dS)N�__isabstractmethod__F)�fget�fset�fdel�__doc__�
overwrite_doc�bool�getattrr=)rr>r?r@�docrrr�__init__�s
zDynamicClassAttribute.__init__cCs6|dkr|jr|St��n|jdkr,td��|�|�S)Nzunreadable attribute)r=�AttributeErrorr>)r�instance�
ownerclassrrr�__get__�s
zDynamicClassAttribute.__get__cCs"|jdkrtd��|�||�dS)Nzcan't set attribute)r?rG)rrH�valuerrr�__set__�s
zDynamicClassAttribute.__set__cCs |jdkrtd��|�|�dS)Nzcan't delete attribute)r@rG)rrHrrr�
__delete__�s
z DynamicClassAttribute.__delete__cCs8|jr|jnd}t|�||j|j|p(|j�}|j|_|Sr)rBrAr)r?r@)rr>�fdoc�resultrrr�getter�szDynamicClassAttribute.gettercCs$t|�|j||j|j�}|j|_|Sr)r)r>r@rArB)rr?rOrrr�setter�szDynamicClassAttribute.settercCs$t|�|j|j||j�}|j|_|Sr)r)r>r?rArB)rr@rOrrr�deleter�szDynamicClassAttribute.deleter)NNNN)N)
rrrrFrJrLrMrPrQrRrrrrr<�s


	r<c@s�eZdZdd�Zdd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
edd��ZeZe	Z
e
ZeZdd�Zdd�ZeZdS)�_GeneratorWrappercCs2||_|jtk|_t|dd�|_t|dd�|_dS)Nrr)�_GeneratorWrapper__wrapped�	__class__�
GeneratorType�_GeneratorWrapper__isgenrDrr)r�genrrrrF�sz_GeneratorWrapper.__init__cCs|j�|�Sr)rT�send)r�valrrrrY�sz_GeneratorWrapper.sendcGs|jj|f|��Sr)rT�throw)r�tp�restrrrr[�sz_GeneratorWrapper.throwcCs
|j��Sr)rT�closerrrrr^�sz_GeneratorWrapper.closecCs|jjSr)rT�gi_coderrrrr_�sz_GeneratorWrapper.gi_codecCs|jjSr)rT�gi_framerrrrr`�sz_GeneratorWrapper.gi_framecCs|jjSr)rT�
gi_runningrrrrra�sz_GeneratorWrapper.gi_runningcCs|jjSr)rT�gi_yieldfromrrrrrb�sz_GeneratorWrapper.gi_yieldfromcCs
t|j�Sr)�nextrTrrrr�__next__�sz_GeneratorWrapper.__next__cCs|jr|jS|Sr)rWrTrrrr�__iter__�sz_GeneratorWrapper.__iter__N)rrrrFrYr[r^�propertyr_r`rarb�cr_code�cr_frame�
cr_running�cr_awaitrdre�	__await__rrrrrS�s&



rScs�t��std���jtkrft�dd�jtkrf�jj}|d@r@�S|d@rf�j}|j|jdBd��_�Sddl	}ddl
�|�����fdd	��}|S)
Nz$types.coroutine() expects a callable�__code__i�� �)�co_flagsrcsR�||�}|jtks*|jtkr.|jjd@r.|St|�j�rNt|�j�sNt|�S|S)Nrn)	rU�
CoroutineTyperVr_ror(�	Generator�	CoroutinerS)�args�kwargs�coro��_collections_abc�funcrr�wrappeds

�
�
�zcoroutine.<locals>.wrapped)�callabler,rU�FunctionTyperD�CodeTyperlro�replace�	functoolsrw�wraps)rxro�cor~ryrrvr�	coroutine�s"
�r�cCs g|]}|dd�dkr|�qS)Nr�_r)�.0�nrrr�
<listcomp>(sr�)rNN)rN)8�sysrr)r{�
LambdaTyperlr|�__dict__�MappingProxyType�implementation�SimpleNamespacer
�CellTyperrVrrpr^r�AsyncGeneratorTyperr�
MethodTyper-�BuiltinFunctionType�append�BuiltinMethodType�objectrF�WrapperDescriptorType�__str__�MethodWrapperType�str�join�MethodDescriptorTyper6�ClassMethodDescriptorType�
ModuleTyper,�exc_info�tb�
TracebackType�tb_frame�	FrameType�GetSetDescriptorType�__globals__�MemberDescriptorTyper$rrr8r<rSr��globals�__all__rrrr�<module>sZ













 :%4types.cpython-38.opt-1.pyc000064400000021733151450073350011310 0ustar00U

e5d�%�@s�dZddlZdd�Zee�Zedd��Zeej�Zeej�Z	eej
�Zdd�Zee��Z
d	d
�Zee��Zdd�Ze�Zee�Ze��d
d�Ze�Zee�ZGdd�d�Zee�j�Zee�Zegj�Zeej�Zee�j�Z ee!j"�Z#ee$jd�Z%ee�Z&ze'�Wn:e'k
�rBe�(�dZ)ee)�Z*ee)j+�Z,dZ)[)YnXeej�Z-eej.�Z/[[[[[[d$dd�Z0dd�Z1d%dd�Z2dd�Z3Gdd�d�Z4Gdd�d�Z5d d!�Z6d"d#�e7�D�Z8dS)&zO
Define names for built-in types that aren't directly accessible as a builtin.
�NcCsdS�N�rrr�/usr/lib64/python3.8/types.py�_f�rcCsdSrrrrrr�<lambda>
rrcsd��fdd�}|jdS)N�csdSrrr��arr�fsz_cell_factory.<locals>.fr)�__closure__)rrr	r�
_cell_factorysr
ccs
dVdS)Nrrrrrr�_gsrc�sdSrrrrrr�_crrcCs
dVdSrrrrrr�_ag"src@seZdZdd�ZdS)�_CcCsdSrr��selfrrr�_m(rz_C._mN)�__name__�
__module__�__qualname__rrrrrr'sr�fromkeys�rcCsJt|�}t|||�\}}}|dk	r*||�||k	r:||d<||||f|�S)zBCreate a class object dynamically using the appropriate metaclass.N�__orig_bases__)�
resolve_bases�
prepare_class)�name�bases�kwds�	exec_body�resolved_bases�meta�nsrrr�	new_classEsr$cCs�t|�}d}d}t|�D]j\}}t|t�r,qt|d�s8q|�|�}d}t|t�sZtd��q||||||d�<|t|�d7}q|s�|St|�S)z8Resolve MRO entries dynamically as specified by PEP 560.Fr�__mro_entries__Tz#__mro_entries__ must return a tupler)	�list�	enumerate�
isinstance�type�hasattrr%�tuple�	TypeError�len)r�	new_bases�updated�shift�i�base�new_baserrrrOs"




rcCs~|dkri}nt|�}d|kr*|�d�}n|r<t|d�}nt}t|t�rTt||�}t|d�rp|j||f|�}ni}|||fS)azCall the __prepare__ method of the appropriate metaclass.

    Returns (metaclass, namespace, kwds) as a 3-tuple

    *metaclass* is the appropriate metaclass
    *namespace* is the prepared class namespace
    *kwds* is an updated copy of the passed in kwds argument with any
    'metaclass' entry removed. If no kwds argument is passed in, this will
    be an empty dict.
    N�	metaclassr�__prepare__)�dict�popr)r(�_calculate_metar*r5)rrrr"r#rrrrds


rcCs>|}|D]0}t|�}t||�r qt||�r0|}qtd��q|S)z%Calculate the most derived metaclass.zxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r)�
issubclassr,)r"r�winnerr2�	base_metarrrr8�s


r8c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�DynamicClassAttributeaRoute attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    This allows one to have properties active on an instance, and have virtual
    attributes on the class with the same name (see Enum for an example).

    NcCs>||_||_||_|p|j|_|dk|_tt|dd��|_dS)N�__isabstractmethod__F)�fget�fset�fdel�__doc__�
overwrite_doc�bool�getattrr=)rr>r?r@�docrrr�__init__�s
zDynamicClassAttribute.__init__cCs6|dkr|jr|St��n|jdkr,td��|�|�S)Nzunreadable attribute)r=�AttributeErrorr>)r�instance�
ownerclassrrr�__get__�s
zDynamicClassAttribute.__get__cCs"|jdkrtd��|�||�dS)Nzcan't set attribute)r?rG)rrH�valuerrr�__set__�s
zDynamicClassAttribute.__set__cCs |jdkrtd��|�|�dS)Nzcan't delete attribute)r@rG)rrHrrr�
__delete__�s
z DynamicClassAttribute.__delete__cCs8|jr|jnd}t|�||j|j|p(|j�}|j|_|Sr)rBrAr)r?r@)rr>�fdoc�resultrrr�getter�szDynamicClassAttribute.gettercCs$t|�|j||j|j�}|j|_|Sr)r)r>r@rArB)rr?rOrrr�setter�szDynamicClassAttribute.settercCs$t|�|j|j||j�}|j|_|Sr)r)r>r?rArB)rr@rOrrr�deleter�szDynamicClassAttribute.deleter)NNNN)N)rrrrArFrJrLrMrPrQrRrrrrr<�s


	r<c@s�eZdZdd�Zdd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
edd��ZeZe	Z
e
ZeZdd�Zdd�ZeZdS)�_GeneratorWrappercCs2||_|jtk|_t|dd�|_t|dd�|_dS)Nrr)�_GeneratorWrapper__wrapped�	__class__�
GeneratorType�_GeneratorWrapper__isgenrDrr)r�genrrrrF�sz_GeneratorWrapper.__init__cCs|j�|�Sr)rT�send)r�valrrrrY�sz_GeneratorWrapper.sendcGs|jj|f|��Sr)rT�throw)r�tp�restrrrr[�sz_GeneratorWrapper.throwcCs
|j��Sr)rT�closerrrrr^�sz_GeneratorWrapper.closecCs|jjSr)rT�gi_coderrrrr_�sz_GeneratorWrapper.gi_codecCs|jjSr)rT�gi_framerrrrr`�sz_GeneratorWrapper.gi_framecCs|jjSr)rT�
gi_runningrrrrra�sz_GeneratorWrapper.gi_runningcCs|jjSr)rT�gi_yieldfromrrrrrb�sz_GeneratorWrapper.gi_yieldfromcCs
t|j�Sr)�nextrTrrrr�__next__�sz_GeneratorWrapper.__next__cCs|jr|jS|Sr)rWrTrrrr�__iter__�sz_GeneratorWrapper.__iter__N)rrrrFrYr[r^�propertyr_r`rarb�cr_code�cr_frame�
cr_running�cr_awaitrdre�	__await__rrrrrS�s&



rScs�t��std���jtkrft�dd�jtkrf�jj}|d@r@�S|d@rf�j}|j|jdBd��_�Sddl	}ddl
�|�����fd	d
��}|S)z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callable�__code__Ni�� �)�co_flagsrcsR�||�}|jtks*|jtkr.|jjd@r.|St|�j�rNt|�j�sNt|�S|S)Nrn)	rU�
CoroutineTyperVr_ror(�	Generator�	CoroutinerS)�args�kwargs�coro��_collections_abc�funcrr�wrappeds

�
�
�zcoroutine.<locals>.wrapped)�callabler,rU�FunctionTyperD�CodeTyperlro�replace�	functoolsrw�wraps)rxro�cor~ryrrvr�	coroutine�s"
�r�cCs g|]}|dd�dkr|�qS)Nr�_r)�.0�nrrr�
<listcomp>(sr�)rNN)rN)9rA�sysrr)r{�
LambdaTyperlr|�__dict__�MappingProxyType�implementation�SimpleNamespacer
�CellTyperrVrrpr^r�AsyncGeneratorTyperr�
MethodTyper-�BuiltinFunctionType�append�BuiltinMethodType�objectrF�WrapperDescriptorType�__str__�MethodWrapperType�str�join�MethodDescriptorTyper6�ClassMethodDescriptorType�
ModuleTyper,�exc_info�tb�
TracebackType�tb_frame�	FrameType�GetSetDescriptorType�__globals__�MemberDescriptorTyper$rrr8r<rSr��globals�__all__rrrr�<module>s\













 :%4stat.cpython-38.pyc000064400000010426151450073350010155 0ustar00U

e5dm�
@sLdZdZdZdZdZdZdZdZdZd	Z	d
Z
dd�Zd
d�ZdZ
dZdZdZdZdZdZdZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z d*Z!d+Z"e"Z#d,Z$d-Z%d.Z&d/Z'd0Z(d-Z)d.Z*d/Z+d1Z,d2Z-d3Z.d	Z/dZ0dZ1dZ2dZ3dZ4dZ5dZ6d	Z7d3Z8d2Z9dZ:d4Z;d5Z<d6Z=d7Z>d8Z?ed9fed:fed;fed<fe
d=fed>fed?ffe)d@ffe*dAffe+e!Bd:fe!dBfe+dCffe-d@ffe.dAffe/e"Bd:fe"dBfe/dCffe1d@ffe2dAffe3e$BdDfe$dEfe3dCfff
Z@dFdG�ZAd2ZBd*ZCd/ZDd3ZEdZFdZGdZHd.ZIdZJd5ZKdZLdZMd+ZNd,ZOdZPd-ZQd4ZRzddHlSTWneTk
�rFYnXdIS)JzoConstants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *
����������	cCs|d@S)zMReturn the portion of the file's mode that can be set by
    os.chmod().
    i����moderr�/usr/lib64/python3.8/stat.py�S_IMODEsrcCs|d@S)zLReturn the portion of the file's mode that describes the
    file type.
    i�rrrrr�S_IFMTsri@i i`i�ii�i�cCst|�tkS)z(Return True if mode is from a directory.)r�S_IFDIRrrrr�S_ISDIR2srcCst|�tkS)z<Return True if mode is from a character special device file.)r�S_IFCHRrrrr�S_ISCHR6srcCst|�tkS)z8Return True if mode is from a block special device file.)r�S_IFBLKrrrr�S_ISBLK:srcCst|�tkS)z+Return True if mode is from a regular file.)r�S_IFREGrrrr�S_ISREG>srcCst|�tkS)z0Return True if mode is from a FIFO (named pipe).)r�S_IFIFOrrrr�S_ISFIFOBsrcCst|�tkS)z,Return True if mode is from a symbolic link.)r�S_IFLNKrrrr�S_ISLNKFsrcCst|�tkS)z%Return True if mode is from a socket.)r�S_IFSOCKrrrr�S_ISSOCKJsrcCsdS)z#Return True if mode is from a door.Frrrrr�S_ISDOORNsrcCsdS)z*Return True if mode is from an event port.Frrrrr�S_ISPORTRsr cCsdS)z'Return True if mode is from a whiteout.Frrrrr�S_ISWHTVsr!iii���@i��8� �iiiii �l�s�-�b�d�c�p�r�w�S�x�t�TcCsJg}tD]6}|D]"\}}||@|kr|�|�qq|�d�qd�|�S)z;Convert a file's mode to a string of the form '-rwxrwxrwx'.r*�)�_filemode_table�append�join)r
Zperm�table�bit�charrrr�filemode�s
r<)�*N)U�__doc__�ST_MODE�ST_INO�ST_DEV�ST_NLINK�ST_UID�ST_GID�ST_SIZE�ST_ATIME�ST_MTIME�ST_CTIMErrrrrrrrr�S_IFDOOR�S_IFPORT�S_IFWHTrrrrrrrrr r!�S_ISUID�S_ISGID�S_ENFMT�S_ISVTX�S_IREAD�S_IWRITE�S_IEXEC�S_IRWXU�S_IRUSR�S_IWUSR�S_IXUSR�S_IRWXG�S_IRGRP�S_IWGRP�S_IXGRP�S_IRWXO�S_IROTH�S_IWOTH�S_IXOTH�	UF_NODUMP�UF_IMMUTABLE�	UF_APPEND�	UF_OPAQUE�UF_NOUNLINK�
UF_COMPRESSED�	UF_HIDDEN�SF_ARCHIVED�SF_IMMUTABLE�	SF_APPEND�SF_NOUNLINK�SF_SNAPSHOTr6r<�FILE_ATTRIBUTE_ARCHIVE�FILE_ATTRIBUTE_COMPRESSED�FILE_ATTRIBUTE_DEVICE�FILE_ATTRIBUTE_DIRECTORY�FILE_ATTRIBUTE_ENCRYPTED�FILE_ATTRIBUTE_HIDDEN�FILE_ATTRIBUTE_INTEGRITY_STREAM�FILE_ATTRIBUTE_NORMAL�"FILE_ATTRIBUTE_NOT_CONTENT_INDEXED�FILE_ATTRIBUTE_NO_SCRUB_DATA�FILE_ATTRIBUTE_OFFLINE�FILE_ATTRIBUTE_READONLY�FILE_ATTRIBUTE_REPARSE_POINT�FILE_ATTRIBUTE_SPARSE_FILE�FILE_ATTRIBUTE_SYSTEM�FILE_ATTRIBUTE_TEMPORARY�FILE_ATTRIBUTE_VIRTUAL�_stat�ImportErrorrrrr�<module>s�	�
�
�
��copyreg.cpython-38.opt-1.pyc000064400000010275151450073350011613 0ustar00U

e5d��@s�dZdddddgZiZddd�Zdd�ZzeWnek
rDYnXd	d
�Zeeee�dd�Zd
Z	dd�Z
dd�Zdd�Zdd�Z
iZiZiZdd�Zdd�Zdd�ZdS)z�Helper to provide extensibility for pickle.

This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
�pickle�constructor�
add_extension�remove_extension�clear_extension_cacheNcCs,t|�std��|t|<|dk	r(t|�dS)Nz$reduction functions must be callable)�callable�	TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�/usr/lib64/python3.8/copyreg.pyrs
cCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rscCst|j|jffS�N)�complex�real�imag)�crrr
�pickle_complex"srcCs<|tkrt�|�}n$|�||�}|jtjkr8|�||�|Sr)r�__new__�__init__)�cls�base�state�objrrr
�_reconstructor)sricCs�|j}|jD]}t|d�r|jt@sq.qt}|tkr<d}n"||krVtd|j�d���||�}|||f}z
|j}Wn\t	k
r�t
|dd�r�td|j�d|���d�z
|j}Wnt	k
r�d}YnXYnX|�}|r�t||fSt|fSdS)N�	__flags__zcannot pickle z object�	__slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )
�	__class__�__mro__�hasattrr�	_HEAPTYPErr�__name__�__getstate__�AttributeError�getattr�__dict__r)�self�protorrr�args�getstate�dictrrr
�
_reduce_ex6s4


�

r,cGs|j|f|��Sr�r)rr)rrr
�
__newobj__Zsr.cCs|j|f|�|�S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with
    keyword-only arguments to be pickled correctly.
    r-)rr)�kwargsrrr
�
__newobj_ex__]sr0cCs�|j�d�}|dk	r|Sg}t|d�s(n�|jD]�}d|jkr.|jd}t|t�rV|f}|D]^}|dkrjqZqZ|�d�r�|�d�s�|j�	d�}|r�|�
d||f�q�|�
|�qZ|�
|�qZq.z
||_WnYnX|S)a�Return a list of slot names for a given class.

    This needs to find slots defined by the class and its bases, so we
    can't simply return the __slots__ attribute.  We must walk down
    the Method Resolution Order and concatenate the __slots__ of each
    class found there.  (This assumes classes don't modify their
    __slots__ attribute to misrepresent their slots after the class is
    defined.)
    �
__slotnames__Nr)r&�__weakref__�__�_z_%s%s)r&�getr r�
isinstance�str�
startswith�endswithr"�lstrip�appendr1)r�namesr�slots�name�strippedrrr
�
_slotnamescs2





r@cCs�t|�}d|krdks&ntd��||f}t�|�|krNt�|�|krNdS|tkrjtd|t|f��|tkr�td|t|f��|t|<|t|<dS)zRegister an extension code.�i���zcode out of rangeNz)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr5�_inverted_registry��moduler>�code�keyrrr
r�s$�
�
�cCsR||f}t�|�|ks$t�|�|kr4td||f��t|=t|=|tkrNt|=dS)z0Unregister an extension code.  For testing only.z%key %s is not registered with code %sN)rDr5rErC�_extension_cacherFrrr
r�s��cCst��dSr)rJ�clearrrrr
r�s)N)�__doc__�__all__rrrr�	NameErrorrrr!r,r.r0r@rDrErJrrrrrrr
�<module>s4�

	$<trace.cpython-38.opt-1.pyc000064400000047120151450073350011240 0ustar00U

e5d�t�@s�dZddgZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlZdZGdd�d�Zd	d
�Zdd�ZGd
d�d�Zdd�Zdd�Zddd�Zdd�ZGdd�d�Zdd�Zedkr�e�dS)a�program/module to trace Python program or function execution

Sample use, command line:
  trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs
  trace.py -t --ignore-dir '$prefix' spam.py eggs
  trace.py --trackcalls spam.py eggs

Sample use, programmatically
  import sys

  # create a Trace object, telling it what to ignore, and whether to
  # do tracing or line-counting or both.
  tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
                       trace=0, count=1)
  # run the new command using the given tracer
  tracer.run('main()')
  # make a report, placing output in /tmp
  r = tracer.results()
  r.write_results(show_missing=True, coverdir="/tmp")
�Trace�CoverageResults�N)�	monotonicz#pragma NO COVERc@seZdZddd�Zdd�ZdS)�_IgnoreNcCs:|s
t�nt|�|_|sgndd�|D�|_ddi|_dS)NcSsg|]}tj�|��qS�)�os�path�normpath��.0�drr�/usr/lib64/python3.8/trace.py�
<listcomp>Hs�z$_Ignore.__init__.<locals>.<listcomp>z<string>�)�set�_mods�_dirs�_ignore)�self�modules�dirsrrr
�__init__Fs
�z_Ignore.__init__cCs�||jkr|j|S||jkr,d|j|<dS|jD]"}|�|d�r2d|j|<dSq2|dkrld|j|<dS|jD]$}|�|tj�rrd|j|<dSqrd|j|<dS)Nr�.r)rr�
startswithrr�sep)r�filename�
modulename�modrrrr
�namesLs$









z
_Ignore.names)NN)�__name__�
__module__�__qualname__rrrrrr
rEs
rcCs tj�|�}tj�|�\}}|S)z-Return a plausible module name for the patch.)rr�basename�splitext)r�baser�extrrr
�_modnamewsr&cCs�tj�|�}d}tjD]@}tj�|�}|�|�r|t|�tjkrt|�t|�kr|}q|rr|t|�dd�}n|}tj�|�\}}|�tjd�}tj	r�|�tj	d�}tj�
|�\}}|�d�S)z,Return a plausible module name for the path.�rNr)rr�normcase�sysr�lenr�
splitdrive�replace�altsepr#�lstrip)rZcomparepathZlongest�dirr$Zdriverr%rrr
�_fullmodname~s 
r0c@s:eZdZddd�Zdd�Zdd�Zdd
d�Zddd
�ZdS)rNc
Cs�||_|jdkri|_|j��|_||_|jdkr8i|_|j��|_||_|jdkrZi|_|j��|_||_||_|jr�z@t|jd��}t�	|�\}}}W5QRX|�
|�|||��Wn@tt
tfk
r�}ztd|j|ftjd�W5d}~XYnXdS)N�rbzSkipping counts file %r: %s��file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update�	__class__�OSError�EOFError�
ValueError�printr)�stderr)rr4r6r8r7r9�f�errrrr
r�s2


��zCoverageResults.__init__cCs|�d�o|�d�S)z_Return True if the filename does not refer to a file
        we want to have reported.
        �<�>)r�endswith)rrrrr
�is_ignored_filename�sz#CoverageResults.is_ignored_filenamec	Csn|j}|j}|j}|j}|j}|j}|D]}|�|d�||||<q(|D]}d||<qJ|D]}d||<q\dS)z.Merge in the data from another CoverageResultsrrN)r4r6r7�get)	r�otherr4r6r7Zother_countsZother_calledfuncsZ
other_callers�keyrrr
r=�s
zCoverageResults.updateTFc"
Cs�|jr@t�td�|j}t|�D]\}}}td|||f�q"|jr�t�td�d}}	t|j�D]h\\}
}}\}
}}|
|kr�t�td|
d�|
}d}	|
|
kr�|	|
kr�td|
�|
}	td||||f�qfi}|jD].\}}|�|i�}||<|j||f||<q�i}|��D�]\}}|�|��r0�q|�d��rH|d	d
�}|d	k�rpt	j
�t	j
�|��}t
|�}n$|}t	j
�|��s�t	�|�t|�}|�r�t|�}ni}t�|�}t	j
�||d�}t|d��}t�|j�\}}W5QRX|�|||||�\}}|�r|�rtd
||�}||||f||<�q|�rt|�rttd�t|�D]&}||\}}}}td||��qL|j�r�z6t|jd�� } t�|j|j|jf| d�W5QRXWn6tk
�r�}!ztd|!tj d�W5d	}!~!XYnXd	S)af
        Write the coverage results.

        :param show_missing: Show lines that had no hits.
        :param summary: Include coverage summary per module.
        :param coverdir: If None, the results of each module are placed in its
                         directory, otherwise it is included in the directory
                         specified.
        zfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r'z***z  -->z    %s.%s -> %s.%sz.pycN���z.coverr1�dzlines   cov%   module   (path)z%5d   %3d%%   %s   (%s)�wbrz"Can't save counts files because %sr2)!r6rB�sortedr7r4rJ�itemsrIrHrr�dirname�abspathr&�exists�makedirsr0�_find_executable_linenos�	linecache�getlines�joinr:�tokenize�detect_encoding�readline�write_results_file�intr9r;�dumpr?r)rC)"rZshow_missing�summary�coverdirZcallsrr�funcnameZlastfileZ	lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno�	lines_hitZsums�countr/�lnotab�sourceZ	coverpath�fp�encoding�_�n_hits�n_linesZpercent�mrDrErrr
�
write_results�s�
��





��zCoverageResults.write_resultsc
Cs�zt|d|d�}Wn>tk
rP}z td||ftjd�WY�dSd}~XYnXd}d}	|��t|d�D]r\}
}|
|kr�|�d	||
�|	d7}	|d7}n.|
|kr�t|kr�|�d
�|d7}n
|�d�|�|�d��qjW5QRX|	|fS)
z'Return a coverage results file in path.�w�rjz3trace: Could not open %r for writing: %s - skippingr2)rrNrrz%5d: z>>>>>> z       �)	r:r?rBr)rC�	enumerate�write�PRAGMA_NOCOVER�
expandtabs)rr�linesrgrerjr9rErmrlrd�linerrr
r])s.��



z"CoverageResults.write_results_file)NNNNN)TFN)N)rr r!rrIr=ror]rrrr
r�s�

\cCs,i}t�|�D]\}}||krd||<q|S)z:Return dict where keys are lines in the line number table.r)�disZfindlinestarts)�code�strs�linenosrkrdrrr
�_find_lines_from_codeIs

r}cCs4t||�}|jD]}t�|�r|�t||��q|S)z<Return lineno dict for all code objects reachable from code.)r}�	co_consts�inspectZiscoder=�_find_lines)rzr{r|�crrr
r�Ss



r�c	Cs�i}tj}t||d��j}t�|j�}|D]R\}}}}	}
|tjkrv|tjkrv|\}}|	\}
}t||
d�D]}d||<qh|}q(W5QRX|S)z�Return a dict of possible docstring positions.

    The dict maps line numbers to strings.  There is an entry for
    line that contains only a string or a part of a triple-quoted
    string.
    rqr)�token�INDENTr:rZ�generate_tokensr\�STRING�range)rrjrZ
prev_ttyperD�tokZttypeZtstr�start�endrxZslineZscolZelineZecol�irrr
�
_find_strings_s


r�c
Cs�z(t�|��}|��}|j}W5QRXWn@tk
rh}z"td||ftjd�iWY�Sd}~XYnXt||d�}t	||�}t
||�S)zAReturn dict where keys are line numbers in the line number table.z%Not printing coverage data for %r: %sr2N�exec)rZr:�readrjr?rBr)rC�compiler�r�)rrD�progrjrErzr{rrr
rVvs��
rVc	@sveZdZddd�Zdd	�Zd d
d�Zdd
�Zde_dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)!rrrrNFc

Cs�||_||_t||�|_i|_i|_d|_||_i|_i|_	i|_
d|_|	rTt�|_|rb|j
|_nZ|rp|j|_nL|r�|r�|j|_|j|_n2|r�|j|_|j|_n|r�|j|_|j|_nd|_dS)ax
        @param count true iff it should count number of times each
                     line is executed
        @param trace true iff it should print out each line that is
                     being counted
        @param countfuncs true iff it should just output a list of
                     (filename, modulename, funcname,) for functions
                     that were called at least once;  This overrides
                     `count' and `trace'
        @param ignoremods a list of the names of modules to ignore
        @param ignoredirs a list of the names of directories to ignore
                     all of the (recursive) contents of
        @param infile file from which to read stored counts to be
                     added into the results
        @param outfile file in which to write the results
        @param timing true iff timing information be displayed
        rNr)r8r9r�ignorer4Zpathtobasename�	donothing�trace�_calledfuncs�_callers�
_caller_cache�
start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count�
localtrace�localtrace_trace�localtrace_count)
rrfr��
countfuncs�countcallers�
ignoremods�
ignoredirsr8r9�timingrrr
r�s6




zTrace.__init__cCs ddl}|j}|�|||�dS)Nr)�__main__�__dict__�runctx)r�cmdr��dictrrr
�run�sz	Trace.runc	Csh|dkri}|dkri}|js6t�|j�t�|j�zt|||�W5|jsbt�d�t�d�XdS)N)r��	threading�settracer�r)r�)rr��globals�localsrrr
r��s
zTrace.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��d}|js�t�|j	�z|||�}W5|js�t�d�X|S)	N�z8descriptor 'runfunc' of 'Trace' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runfunc expected at least 1 positional argument, got %dr)
r*�	TypeError�pop�warnings�warn�DeprecationWarningr�r)r�r�)�args�kwrr�r��resultrrr
�runfunc�s.

�
�z
Trace.runfuncz($self, func, /, *args, **kw)c
Cs�|j}|j}|rt|�}nd}|j}d}||jkrL|j|dk	r�|j|}n�d|j|<dd�t�|�D�}t|�dkr�dd�t�|d�D�}t|�dkr�dd�t�|d�D�}	t|	�dkr�|	dj}||j|<|dk	r�d||f}|||fS)NcSsg|]}t�|�r|�qSr)rZ
isfunction)rrDrrr
r�s
�z1Trace.file_module_function_of.<locals>.<listcomp>rcSsg|]}t|t�r|�qSr)�
isinstancer�r
rrr
r�s
�rcSsg|]}t|d�r|�qS)�	__bases__)�hasattr)rr�rrr
r�s
�z%s.%s)	�f_code�co_filenamer&�co_namer��gcZ
get_referrersr*r)
r�framerzrrrbZclsnameZfuncsZdicts�classesrrr
�file_module_function_of�s,




zTrace.file_module_function_ofcCs0|dkr,|�|�}|�|j�}d|j||f<dS)zkHandler for call events.

        Adds information about who called who to the self._callers dict.
        �callrN)r��f_backr�)rr��why�arg�	this_funcZparent_funcrrr
r�
s
zTrace.globaltrace_trackcallerscCs |dkr|�|�}d|j|<dS)zoHandler for call events.

        Adds (filename, modulename, funcname) to the self._calledfuncs dict.
        r�rN)r�r�)rr�r�r�r�rrr
r�s
zTrace.globaltrace_countfuncscCsj|dkrf|j}|j�dd�}|rbt|�}|dk	rf|j�||�}|sf|jrZtd||jf�|j	SndSdS)z�Handler for call events.

        If the code block being entered is to be ignored, returns `None',
        else returns self.localtrace.
        r��__file__Nz! --- modulename: %s, funcname: %s)
r��	f_globalsrJr&r�rr�rBr�r�)rr�r�r�rzrrZ	ignore_itrrr
r�!s�zTrace.globaltrace_ltcCs�|dkr~|jj}|j}||f}|j�|d�d|j|<|jrTtdt�|jdd�tj	�
|�}td||t�||�fdd�|j
S)	Nrxrr�%.2f� �r��
%s(%d): %sr')r�r��f_linenor4rJr�rBr�rrr"rW�getliner�)rr�r�r�rrdrL�bnamerrr
r�8s
��z Trace.localtrace_trace_and_countcCsd|dkr^|jj}|j}|jr4tdt�|jdd�tj�|�}td||t	�
||�fdd�|jS)Nrxr�r�r�r�r')r�r�r�r�rBr�rrr"rWr�r�)rr�r�r�rrdr�rrr
r�Gs
��zTrace.localtrace_tracecCs<|dkr6|jj}|j}||f}|j�|d�d|j|<|jS)Nrxrr)r�r�r�r4rJr�)rr�r�r�rrdrLrrr
r�TszTrace.localtrace_countcCst|j|j|j|j|jd�S)N)r8r9r6r7)rr4r8r9r�r�)rrrr
�results\s

�z
Trace.results)	rrrrrrNNF)NN)rr r!rr�r�r��__text_signature__r�r�r�r�r�r�r�r�rrrr
r�s&�
2

)	
cs�ddl}|��}|jdddd�|�dd�}|jdd	d
dd�|jd
dd
dd�|jddd
dd�|jddd
dd�|�d�}|��}|jddd
dd�|jddd
dd�|jdddd �|jd!d"d#d �|jd$d%d
d&d�|jd'd(d
d)d�|jd*d+d
d,d�|�d-d.�}|jd/d0gd1d2�|jd3d0gd4d2�|jd5d
d6d7d2�|jd8d9d:d;�|jd<|jd=d;�|��}|j�r�t�	d>��t�	d?����fd@dA��dBdC�|j
D�|_
�fdDdC�|jD�|_|j�r�|j�s�|�
dE�t|j|jdF�}|�|j|j|j�St|j|j|j|jg��s |�
dG�|j�rB|j�s8|j�rB|�
dH�|j�r\|j�s\|�
dI�|jdk�rr|�
dJ�t|j|j|j|j|j
|j|j|j|jdK�	}z�|j�r�ddl}|j}|�|�\}	}
}|jf|j�t _!dL|j|
j"|
j#|
ddM�}n^|jf|j�t _!t$j%�&|j�t j%d<t'�(|j��}
t)|
�*�|jdN�}W5QRX|jdLdddO�}|�+|||�WnPt,k
�r�}zt �-dPt j!d|f�W5d}~XYnt.k
�r�YnX|�/�}|j0�s�|�|j|j|j�dS)QNrz	--version�versionz	trace 2.0)�actionr�zMain optionsz(One of these (or --report) must be givenz-cz--count�
store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r��helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z	Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r�z-Cz
--coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz	--missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz	--summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r��defaultr�z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).z--moduleFzTrace a module. �progname�?zfile to run as main program)�nargsr��	argumentszarguments to the programZstdlibZ
platstdlibcs4tj�tj�|��}|�d���d��}tj�|�S)Nz$prefixz$exec_prefix)rr�
expanduser�
expandvarsr,r	)�s)�_exec_prefix�_prefixrr
�parse_ignore_dir�szmain.<locals>.parse_ignore_dircSs$g|]}|�d�D]}|���qqS)�,)�split�strip)rr�rrrr
r�s�zmain.<locals>.<listcomp>cs&g|]}|�tj�D]}�|��qqSr)r�r�pathsep)rr�r�)r�rr
r�s�z-r/--report requires -f/--file)r8r9zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3progname is missing: required with the main options)r�r�r�r�r8r9r�r�)rr��__package__�
__loader__�__spec__�
__cached__r�)r�rr�r�zCannot run file %r because: %s)1�argparse�ArgumentParser�add_argumentZadd_argument_groupZadd_mutually_exclusive_groupZ	REMAINDER�
parse_argsZ
ignore_dir�	sysconfigZget_pathZ
ignore_moduleZreportr3�errorrroZmissingr`ra�anyr�rfZ	listfuncsZ
trackcallsr�rr��module�runpyZ_get_module_detailsr�r�r)�argv�parent�loaderrrrR�io�	open_coder�r�r�r?�exit�
SystemExitr�Z	no_report)r��parserZgrpZ_grpZoptsr��tr�Zmodule_nameZmod_nameZmod_specrzZglobsrirEr)r�r�r�r
�mainbs��
�
�
�
�

�
���
�
�
��
�
�
��
�

�
�




��	�(r�r�)N)�__doc__�__all__r�rWrr)r�r�rZrr�ryr;�timerr�r�rurr&r0rr}r�r�rVrr�rrrrr
�<module>s<20

_fractions.cpython-38.opt-2.pyc000064400000026135151450073350012136 0ustar00U

e5d	_�@s�ddlmZddlZddlZddlZddlZddlZddgZdd�Zdd�Z	ej
jZej
j
Ze�dejejB�ZGd	d�dej�ZdS)
���DecimalN�Fraction�gcdcCsfddl}|�dtd�t|�tkr2t|�kr\nn&|p<|dkrPt�||�St�||�St||�S)Nrz6fractions.gcd() is deprecated. Use math.gcd() instead.�)�warnings�warn�DeprecationWarning�type�int�mathr�_gcd)�a�br�r�!/usr/lib64/python3.8/fractions.pyrs� cCs|r|||}}q|S�Nr�rrrrrr
 sr
aC
    \A\s*                      # optional whitespace at the start, then
    (?P<sign>[-+]?)            # an optional sign, then
    (?=\d|\.\d)                # lookahead for digit or .digit
    (?P<num>\d*)               # numerator (possibly empty)
    (?:                        # followed by
       (?:/(?P<denom>\d+))?    # an optional denominator
    |                          # or
       (?:\.(?P<decimal>\d*))? # an optional fractional part
       (?:E(?P<exp>[-+]?\d+))? # and optional exponent
    )
    \s*\Z                      # and optional whitespace to finish
cs�eZdZdZdQdd��fdd�Zedd	��Zed
d��Zdd
�ZdRdd�Z	e
dd��Ze
dd��Zdd�Z
dd�Zdd�Zdd�Zeeej�\ZZdd�Zeeej�\ZZdd �Zeeej�\ZZd!d"�Zeeej�\ZZ d#d$�Z!ee!ej"�\Z#Z$d%d&�Z%ee%e&�\Z'Z(d'd(�Z)ee)ej*�\Z+Z,d)d*�Z-d+d,�Z.d-d.�Z/d/d0�Z0d1d2�Z1d3d4�Z2d5d6�Z3d7d8�Z4dSd9d:�Z5d;d<�Z6d=d>�Z7d?d@�Z8dAdB�Z9dCdD�Z:dEdF�Z;dGdH�Z<dIdJ�Z=dKdL�Z>dMdN�Z?dOdP�Z@�ZAS)Tr��
_numerator�_denominatorrNT��
_normalizecsRtt|��|�}|dk�rdt|�tkr6||_d|_|St|tj	�rV|j
|_|j|_|St|tt
f�rx|��\|_|_|St|t��rZt�|�}|dkr�td|��t|�d�p�d�}|�d�}|r�t|�}nvd}|�d�}|�rdt|�}||t|�}||9}|�d�}	|	�rBt|	�}	|	d	k�r4|d|	9}n|d|	9}|�d
�dk�rb|}ntd��nft|�tk�r�t|�k�r�nnn@t|tj	��r�t|tj	��r�|j
|j|j
|j}}ntd
��|d	k�r�td|��|�rBt|�tk�rt|�k�r(nnt�||�}
|d	k�r2|
}
n
t||�}
||
}||
}||_||_|S)N�z Invalid literal for Fraction: %rZnum�0�denom�decimal�
�exprZsign�-z2argument should be a string or a Rational instancez+both arguments should be Rational instanceszFraction(%s, 0))�superr�__new__r
rrr�
isinstance�numbers�Rational�	numerator�denominator�floatr�as_integer_ratio�str�_RATIONAL_FORMAT�match�
ValueError�group�len�	TypeError�ZeroDivisionErrorrrr
)�clsr%r&r�self�mrrZscaler�g��	__class__rrr!Tsx

�





$
�

�
$

zFraction.__new__cCsDt|tj�r||�St|t�s8td|j|t|�jf��||���S)Nz.%s.from_float() only takes floats, not %r (%s))r"r#�Integralr'r/�__name__r
r()r1�frrr�
from_float�s
�zFraction.from_floatcCsVddlm}t|tj�r&|t|��}n$t||�sJtd|j|t|�jf��||�	��S)Nrrz2%s.from_decimal() only takes Decimals, not %r (%s))
rrr"r#r7rr/r8r
r()r1Zdecrrrr�from_decimal�s
��zFraction.from_decimalcCs|j|jfSrr�r2rrrr(�szFraction.as_integer_ratio�@Bc
Cs�|dkrtd��|j|kr"t|�Sd\}}}}|j|j}}||}|||}	|	|krZq�||||||	f\}}}}||||}}q<|||}
t||
|||
|�}t||�}t||�t||�kr�|S|SdS)Nrz$max_denominator should be at least 1)rrrr)r,rrr�abs)
r2Zmax_denominatorZp0Zq0Zp1Zq1�n�drZq2�kZbound1Zbound2rrr�limit_denominator�s$ 

zFraction.limit_denominatorcCs|jSr)r�rrrrr%szFraction.numeratorcCs|jSr)rrCrrrr&szFraction.denominatorcCsd|jj|j|jfS)Nz
%s(%s, %s))r6r8rrr<rrr�__repr__"s�zFraction.__repr__cCs(|jdkrt|j�Sd|j|jfSdS)Nrz%s/%s)rr)rr<rrr�__str__'s

zFraction.__str__csT��fdd�}d�jd|_�j|_��fdd�}d�jd|_�j|_||fS)NcsPt|ttf�r�||�St|t�r0�t|�|�St|t�rH�t|�|�StSdSr)r"rrr'�complex�NotImplementedr��fallback_operator�monomorphic_operatorrr�forward~s


z-Fraction._operator_fallbacks.<locals>.forward�__csZt|tj�r�||�St|tj�r4�t|�t|��St|tj�rR�t|�t|��StSdSr)r"r#r$ZRealr'�ComplexrFrG�rrrHrr�reverse�s
z-Fraction._operator_fallbacks.<locals>.reverseZ__r)r8�__doc__)rJrIrKrOrrHr�_operator_fallbacks.sP	
zFraction._operator_fallbackscCs,|j|j}}t|j||j|||�Sr�r&rr%�rr�da�dbrrr�_add�s�z
Fraction._addcCs,|j|j}}t|j||j|||�SrrRrSrrr�_sub�s�z
Fraction._subcCst|j|j|j|j�Sr�rr%r&rrrr�_mul�sz
Fraction._mulcCst|j|j|j|j�SrrXrrrr�_div�s
�z
Fraction._divcCs|j|j|j|jSr�r%r&rrrr�	_floordiv�szFraction._floordivcCs:|j|j}}t|j|||j�\}}|t|||�fSr)r&�divmodr%r)rrrTrUZdivZn_modrrr�_divmod�szFraction._divmodcCs,|j|j}}t|j||j|||�SrrRrSrrr�_mod�sz
Fraction._modcCs�t|tj�r�|jdkr�|j}|dkr>t|j||j|dd�S|jdkrft|j||j|dd�St|j||j|dd�Sq�t|�t|�Snt|�|SdS)NrrFr)	r"r#r$r&r%rrrr')rrZpowerrrr�__pow__�s&

�

��zFraction.__pow__cCs\|jdkr|jdkr||jSt|tj�r<t|j|j�|S|jdkrP||jS|t|�S)Nrr)	rrr"r#r$rr%r&r'rNrrr�__rpow__�s


zFraction.__rpow__cCst|j|jdd�S�NFr�rrrrCrrr�__pos__�szFraction.__pos__cCst|j|jdd�SrbrcrCrrr�__neg__�szFraction.__neg__cCstt|j�|jdd�Srb)rr>rrrCrrr�__abs__�szFraction.__abs__cCs*|jdkr|j|jS|j|jSdS)NrrrCrrr�	__trunc__s
zFraction.__trunc__cCs|j|jSrr[rCrrr�	__floor__
szFraction.__floor__cCs|j|jSrr[rCrrr�__ceil__szFraction.__ceil__cCs�|dkrZt|j|j�\}}|d|jkr,|S|d|jkrB|dS|ddkrR|S|dSdt|�}|dkr�tt||�|�Stt||�|�SdS)Nrrrr)r]r%r&r>r�round)r2ZndigitsZfloorZ	remainder�shiftrrr�	__round__szFraction.__round__cCsPt|jtdt�}|st}nt|j�|t}|dkr:|n|}|dkrLdS|S)Nrr������)�powr�_PyHASH_MODULUS�_PyHASH_INFr>r)r2ZdinvZhash_�resultrrr�__hash__,szFraction.__hash__cCs�t|�tkr |j|ko|jdkSt|tj�rD|j|jkoB|j|jkSt|tj	�r`|j
dkr`|j}t|t�r�t
�|�s~t
�|�r�d|kS||�|�kSntSdS)Nrr�)r
rrrr"r#r$r%r&rM�imag�realr'r�isnan�isinfr:rGrrrr�__eq__Bs
�
zFraction.__eq__cCsht|tj�r&||j|j|j|j�St|t�r`t�	|�sDt�
|�rN|d|�S|||�|��SntSdS)Nrt)
r"r#r$rr&rr%r'rrwrxr:rG)r2�other�oprrr�_richcmpWs
�

zFraction._richcmpcCs|�|tj�Sr)r|�operator�ltrrrr�__lt__mszFraction.__lt__cCs|�|tj�Sr)r|r}�gtrrrr�__gt__qszFraction.__gt__cCs|�|tj�Sr)r|r}�lerrrr�__le__uszFraction.__le__cCs|�|tj�Sr)r|r}�gerrrr�__ge__yszFraction.__ge__cCs
t|j�Sr)�boolrrCrrr�__bool__}szFraction.__bool__cCs|jt|�ffSr)r6r)r<rrr�
__reduce__�szFraction.__reduce__cCs t|�tkr|S|�|j|j�Sr�r
rr6rrr<rrr�__copy__�szFraction.__copy__cCs t|�tkr|S|�|j|j�Srr�)r2Zmemorrr�__deepcopy__�szFraction.__deepcopy__)rN)r=)N)Br8�
__module__�__qualname__�	__slots__r!�classmethodr:r;r(rB�propertyr%r&rDrErQrVr}�add�__add__�__radd__rW�sub�__sub__�__rsub__rY�mul�__mul__�__rmul__rZ�truediv�__truediv__�__rtruediv__r\�floordiv�__floordiv__�
__rfloordiv__r^r]�
__divmod__�__rdivmod__r_�mod�__mod__�__rmod__r`rardrerfrgrhrirlrsryr|rr�r�r�r�r�r�r��
__classcell__rrr5rr<sbm



7

k
)rrrr#r}�re�sys�__all__rr
�	hash_info�modulusrp�infrq�compile�VERBOSE�
IGNORECASEr*r$rrrrr�<module>s
�asyncore.cpython-38.opt-1.pyc000064400000037236151450073350011774 0ustar00U

e5d~N�@shdZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZeee
eeeeh�ZzeWnek
r�iZYnXdd�ZGdd�de�ZeeefZdd	�Zd
d�Z dd
�Z!dd�Z"d&dd�Z#d'dd�Z$e$Z%d(dd�Z&Gdd�d�Z'Gdd�de'�Z(dd�Z)d)dd �Z*ej+d!k�rdGd"d#�d#�Z,Gd$d%�d%e'�Z-dS)*a�Basic infrastructure for asynchronous socket service clients and servers.

There are only two ways to have a program on a single processor do "more
than one thing at a time".  Multi-threaded programming is the simplest and
most popular way to do it, but there is another very different technique,
that lets you have nearly all the advantages of multi-threading, without
actually using multiple threads. it's really only practical if your program
is largely I/O bound. If your program is CPU bound, then pre-emptive
scheduled threads are probably what you really need. Network servers are
rarely CPU-bound, however.

If your operating system supports the select() system call in its I/O
library (and nearly all do), then you can use it to juggle multiple
communication channels at once; doing other work while your I/O is taking
place in the "background."  Although this strategy can seem strange and
complex, especially at first, it is in many ways easier to understand and
control than multi-threaded programming. The module documented here solves
many of the difficult problems for you, making the task of building
sophisticated high-performance network servers and clients a snap.
�N)
�EALREADY�EINPROGRESS�EWOULDBLOCK�
ECONNRESET�EINVAL�ENOTCONN�	ESHUTDOWN�EISCONN�EBADF�ECONNABORTED�EPIPE�EAGAIN�	errorcodec
CsHzt�|�WStttfk
rB|tkr6t|YSd|YSXdS)NzUnknown error %s)�os�strerror�
ValueError�
OverflowError�	NameErrorr)�err�r� /usr/lib64/python3.8/asyncore.py�	_strerrorDsrc@seZdZdS)�ExitNowN)�__name__�
__module__�__qualname__rrrrrLsrcCs:z|��Wn(tk
r"�Yn|��YnXdS�N)�handle_read_event�_reraised_exceptions�handle_error��objrrr�readQsr"cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_write_eventrrr rrr�writeYsr$cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_expt_eventrrr rrr�
_exceptionasr&c
Cs�zX|tj@r|��|tj@r&|��|tj@r8|��|tjtjBtj	B@rV|�
�Wnhtk
r�}z$|jdt
kr�|��n|�
�W5d}~XYn(tk
r��Yn|��YnXdS�Nr)�select�POLLINr�POLLOUTr#�POLLPRIr%ZPOLLHUPZPOLLERRZPOLLNVAL�handle_close�OSError�args�
_DISCONNECTEDrr)r!�flags�errr�	readwriteis"



r2�c	Cs<|dkrt}|�r8g}g}g}t|���D]L\}}|��}|��}|rP|�|�|rd|jsd|�|�|sl|r*|�|�q*g|kr�|kr�|kr�nnt�|�dSt	�	||||�\}}}|D] }|�
|�}|dkr�q�t|�q�|D]"}|�
|�}|dk�rq�t|�q�|D]&}|�
|�}|dk�r,�qt
|��qdSr)�
socket_map�list�items�readable�writable�append�	accepting�time�sleepr(�getr"r$r&)	�timeout�map�r�wr1�fdr!Zis_rZis_wrrr�poll}sD


"







rCcCs�|dkrt}|dk	r t|d�}t��}|r�t|���D]L\}}d}|��r\|tjtjBO}|�	�rt|j
st|tjO}|r8|�||�q8|�|�}|D]&\}}|�
|�}|dkr�q�t||�q�dS)Ni�r)r4�intr(rCr5r6r7r)r+r8r:r*�registerr=r2)r>r?ZpollsterrBr!r0r@rrr�poll2�s(


rF�>@FcCsb|dkrt}|r ttd�r t}nt}|dkr>|r^|||�q,n |r^|dkr^|||�|d}q>dS)NrCr�)r4�hasattrr(rFrC)r>Zuse_pollr?�countZpoll_funrrr�loop�s
rKc@s2eZdZdZdZdZdZdZdZe	dh�Z
dAdd�Zdd�ZdBdd	�Z
dCd
d�Zejejfdd
�ZdDdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdEd'd(�Zd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#d1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'd9d:�Z(d;d<�Z)d=d>�Z*d?d@�Z+dS)F�
dispatcherFN�warningc
Cs�|dkrt|_n||_d|_|r�|�d�|�||�d|_z|��|_Wq�tk
r�}z*|j	dt
tfkrvd|_n|�|��W5d}~XYq�Xnd|_
dS�NrTF)r4�_map�_fileno�setblocking�
set_socket�	connectedZgetpeername�addrr-r.rr�del_channel�socket)�self�sockr?rrrr�__init__�s 

zdispatcher.__init__cCs�|jjd|jjg}|jr.|jr.|�d�n|jr>|�d�|jdk	r�z|�d|j�Wn$tk
r�|�t|j��YnXdd�	|�t
|�fS)N�.Z	listeningrSz%s:%dz<%s at %#x>� )�	__class__rrr:rTr9rS�	TypeError�repr�join�id)rWZstatusrrr�__repr__�s

zdispatcher.__repr__cCs|dkr|j}|||j<dSr)rOrP)rWr?rrr�add_channel	szdispatcher.add_channelcCs,|j}|dkr|j}||kr"||=d|_dSr)rPrO)rWr?rBrrrrUszdispatcher.del_channelcCs.||f|_t�||�}|�d�|�|�dSr')Zfamily_and_typerVrQrR)rWZfamily�typerXrrr�
create_sockets

zdispatcher.create_socketcCs||_|��|_|�|�dSr)rV�filenorPrb�rWrXr?rrrrRs
zdispatcher.set_socketcCsDz*|j�tjtj|j�tjtj�dB�Wntk
r>YnXdS)NrH)rVZ
setsockopt�
SOL_SOCKETZSO_REUSEADDR�
getsockoptr-�rWrrr�set_reuse_addr#s
���zdispatcher.set_reuse_addrcCsdS�NTrrirrrr74szdispatcher.readablecCsdSrkrrirrrr87szdispatcher.writablecCs(d|_tjdkr|dkrd}|j�|�S)NT�nt�)r:r�namerV�listen)rWZnumrrrro>szdispatcher.listencCs||_|j�|�Sr)rTrV�bind)rWrTrrrrpDszdispatcher.bindcCspd|_d|_|j�|�}|tttfks8|tkrBtj	dkrB||_
dS|dtfkr^||_
|��nt
|t|��dS)NFTrlr)rS�
connectingrVZ
connect_exrrrrrrnrTr	�handle_connect_eventr-r)rWZaddressrrrr�connectHs��
zdispatcher.connectc
Csvz|j��\}}WnVtk
r(YdStk
rh}z$|jdtttfkrVWY�
dS�W5d}~XYn
X||fSdSr')rV�acceptr]r-r.rrr
)rWZconnrT�whyrrrrtVs
zdispatcher.acceptc
Cstz|j�|�}|WStk
rn}z>|jdtkr<WY�*dS|jdtkr\|��WY�
dS�W5d}~XYnXdSr')rV�sendr-r.rr/r,)rW�data�resultrurrrrvds

zdispatcher.sendc
Csrz(|j�|�}|s |��WdS|WSWnDtk
rl}z&|jdtkrZ|��WY�
dS�W5d}~XYnXdS)N�r)rV�recvr,r-r.r/)rWZbuffer_sizerwrurrrrzqs

zdispatcher.recvc
Csnd|_d|_d|_|��|jdk	rjz|j��Wn6tk
rh}z|jdtt	fkrX�W5d}~XYnXdS)NFr)
rSr:rqrUrV�closer-r.rr
)rWrurrrr{�s
zdispatcher.closecCstj�dt|��dS)Nzlog: %s
)�sys�stderrr$�str)rW�messagerrr�log�szdispatcher.log�infocCs||jkrtd||f�dS)Nz%s: %s)�ignore_log_types�print)rWrrcrrr�log_info�s
zdispatcher.log_infocCs:|jr|��n&|js.|jr$|��|��n|��dSr)r:�
handle_acceptrSrqrr�handle_readrirrrr�s

zdispatcher.handle_read_eventcCs@|j�tjtj�}|dkr(t|t|���|��d|_d|_dSrN)	rVrhrg�SO_ERRORr-r�handle_connectrSrq�rWrrrrrr�szdispatcher.handle_connect_eventcCs*|jr
dS|js|jr|��|��dSr)r:rSrqrr�handle_writerirrrr#�szdispatcher.handle_write_eventcCs0|j�tjtj�}|dkr$|��n|��dSr')rVrhrgr�r,�handle_exptr�rrrr%�s
zdispatcher.handle_expt_eventcCsXt�\}}}}zt|�}Wndt|�}YnX|�d||||fd�|��dS)Nz)<__repr__(self) failed for object at %0x>z:uncaptured python exception, closing channel %s (%s:%s %s)�error)�compact_tracebackr^r`r�r,)rWZnil�t�v�tbinfoZ	self_reprrrrr�s��	zdispatcher.handle_errorcCs|�dd�dS)Nz!unhandled incoming priority eventrM�r�rirrrr��szdispatcher.handle_exptcCs|�dd�dS)Nzunhandled read eventrMr�rirrrr��szdispatcher.handle_readcCs|�dd�dS)Nzunhandled write eventrMr�rirrrr��szdispatcher.handle_writecCs|�dd�dS)Nzunhandled connect eventrMr�rirrrr��szdispatcher.handle_connectcCs|��}|dk	r|j|�dSr)rt�handle_accepted)rWZpairrrrr��szdispatcher.handle_acceptcCs|��|�dd�dS)Nzunhandled accepted eventrM)r{r�)rWrXrTrrrr��szdispatcher.handle_acceptedcCs|�dd�|��dS)Nzunhandled close eventrM)r�r{rirrrr,�szdispatcher.handle_close)NN)N)N)N)r�),rrr�debugrSr:rq�closingrT�	frozensetr�rYrarbrUrVZAF_INETZSOCK_STREAMrdrRrjr7r8rorprsrtrvrzr{r�r�rrrr#r%rr�r�r�r�r�r�r,rrrrrL�sJ

 

	


rLc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�dispatcher_with_sendNcCst�|||�d|_dS)Nry)rLrY�
out_bufferrfrrrrY�szdispatcher_with_send.__init__cCs.d}t�||jdd��}|j|d�|_dS)Nri)rLrvr�)rWZnum_sentrrr�
initiate_sendsz"dispatcher_with_send.initiate_sendcCs|��dSr)r�rirrrr�sz!dispatcher_with_send.handle_writecCs|jpt|j�Sr)rS�lenr�rirrrr8szdispatcher_with_send.writablecCs0|jr|�dt|��|j||_|��dS)Nz
sending %s)r�r�r^r�r�)rWrwrrrrvszdispatcher_with_send.send)NN)rrrrYr�r�r8rvrrrrr��s

r�cCs�t��\}}}g}|std��|rL|�|jjj|jjjt|j	�f�|j
}q~|d\}}}d�dd�|D��}|||f|||fS)Nztraceback does not exist���r[cSsg|]}d|�qS)z
[%s|%s|%s]r)�.0�xrrr�
<listcomp>&sz%compact_traceback.<locals>.<listcomp>)r|�exc_info�AssertionErrorr9�tb_frame�f_code�co_filename�co_namer~�	tb_lineno�tb_nextr_)r�r��tbr��fileZfunction�liner�rrrr�s�r�cCs�|dkrt}t|���D]n}z|��Wqtk
r`}z|jdtkrJn|sP�W5d}~XYqtk
rt�Yq|s��YqXq|��dSr')	r4r5�valuesr{r-r.r
r�clear)r?Z
ignore_allr�rrr�	close_all)s 
r��posixc@sNeZdZdd�Zdd�Zdd�Zdd�Zdd
d�ZeZeZ	dd
�Z
dd�Zd	S)�file_wrappercCst�|�|_dSr)r�duprB�rWrBrrrrYNszfile_wrapper.__init__cCs*|jdkrtjd|t|d�|��dS)Nrzunclosed file %r)�source)rB�warnings�warn�ResourceWarningr{rirrr�__del__Qs

�zfile_wrapper.__del__cGstj|jf|��Sr)rr"rB�rWr.rrrrzWszfile_wrapper.recvcGstj|jf|��Sr)rr$rBr�rrrrvZszfile_wrapper.sendNcCs(|tjkr|tjkr|sdStd��dS)Nrz-Only asyncore specific behaviour implemented.)rVrgr��NotImplementedError)rW�levelZoptnameZbuflenrrrrh]s
��zfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t�|�dS)Nrr�)rBrr{r�rrrr{hs

zfile_wrapper.closecCs|jSr)rBrirrrreoszfile_wrapper.fileno)N)rrrrYr�rzrvrhr"r$r{rerrrrr�Is
r�c@seZdZddd�Zdd�ZdS)�file_dispatcherNcCsPt�|d|�d|_z|��}Wntk
r4YnX|�|�t�|d�dS)NTF)rLrYrSre�AttributeError�set_filer�set_blocking)rWrBr?rrrrYts
zfile_dispatcher.__init__cCs"t|�|_|j��|_|��dSr)r�rVrerPrbr�rrrr�s
zfile_dispatcher.set_file)N)rrrrYr�rrrrr�rs
r�)r3N)r3N)rGFNN)NF).�__doc__r(rVr|r;r�r�errnorrrrrrrr	r
rrr
rr�r/r4rr�	Exceptionr�KeyboardInterrupt�
SystemExitrr"r$r&r2rCrFZpoll3rKrLr�r�r�rnr�r�rrrr�<module>sD<�


'

*
)site.cpython-38.opt-1.pyc000064400000041121151450073350011101 0ustar00U

&�.eNU�@s&dZddlZddlZddlZddlZddlZejejgada	da
dadd�Zdd�Z
dd�Zd	d
�Zdd�Zd2d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd3dd�Zd4dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z d-d.�Z!ej"j#�s
e!�d/d0�Z$e%d1k�r"e$�dS)5a�Append module search paths for third-party packages to sys.path.

****************************************************************
* This module is automatically imported during initialization. *
****************************************************************

This will append site-specific paths to the module search path.  On
Unix (including Mac OSX), it starts with sys.prefix and
sys.exec_prefix (if different) and appends
lib/python<version>/site-packages.
On other platforms (such as Windows), it tries each of the
prefixes directly, as well as with lib/site-packages appended.  The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.

If a file named "pyvenv.cfg" exists one directory above sys.executable,
sys.prefix and sys.exec_prefix are set to that directory and
it is also checked for site-packages (sys.base_prefix and
sys.base_exec_prefix will always be the "real" prefixes of the Python
installation). If "pyvenv.cfg" (a bootstrap configuration file) contains
the key "include-system-site-packages" set to anything other than "false"
(case-insensitive), the system-level prefixes will still also be
searched for site-packages; otherwise they won't.

All of the resulting site-specific directories, if they exist, are
appended to sys.path, and also inspected for path configuration
files.

A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
to be added to sys.path.  Non-existing directories (or
non-directories) are never added to sys.path; no directory is added to
sys.path more than once.  Blank lines and lines beginning with
'#' are skipped. Lines starting with 'import' are executed.

For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python2.5/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth.  Assume foo.pth contains the
following:

  # foo package configuration
  foo
  bar
  bletch

and bar.pth contains:

  # bar package configuration
  bar

Then the following directories are added to sys.path, in this order:

  /usr/local/lib/python2.5/site-packages/bar
  /usr/local/lib/python2.5/site-packages/foo

Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
omitted because it is not mentioned in either path configuration file.

The readline module is also automatically configured to enable
completion for systems that support it.  This can be overridden in
sitecustomize, usercustomize or PYTHONSTARTUP.  Starting Python in
isolated mode (-I) disables automatic readline configuration.

After these operations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
site-specific customizations.  If this import fails with an
ImportError exception, it is silently ignored.
�NcGsBtjj|�}ztj�|�}Wntk
r0YnX|tj�|�fS�N)�os�path�join�abspath�OSError�normcase)�paths�dir�r�/usr/lib64/python3.8/site.py�makepath[sr
cCs�ttj���D]~}tt|dd�dd�dkr,qztj�|j�|_Wnt	t
tfk
rZYnXztj�|j�|_Wqt	t
tfk
r�YqXqdS)zESet all module __file__ and __cached__ attributes to an absolute path�
__loader__N�
__module__)�_frozen_importlib�_frozen_importlib_external)
�set�sys�modules�values�getattrrrr�__file__�AttributeErrorr�	TypeError�
__cached__)�mrrr�	abs_pathsds�rcCsPg}t�}tjD],}t|�\}}||kr|�|�|�|�q|tjdd�<|S)zK Remove duplicate entries from sys.path along with making them
    absoluteN)rrrr
�append�add)�L�known_pathsr
�dircaserrr�removeduppathsts

r"c	CsVt�}tjD]D}z&tj�|�r4t|�\}}|�|�Wqtk
rNYqYqXq|S)zEReturn a set containing all existing file system items from sys.path.)rrrr�existsr
rr)�d�item�_�itemcaserrr�_init_pathinfo�s
r(cCsr|dkrt�}d}nd}tj�||�}zt�t�|��}Wntk
rPYdSX|��t|�D]�\}}|�	d�rvqbzZ|�	d�r�t
|�Wqb|��}t||�\}}	|	|kr�tj�
|�r�tj�|�|�|	�Wqbtk
�rVtd�|d|�tjd�d	dl}
|
jt���D](}|��D]}td
|tjd��q�qtdtjd�Y�qZYqbXqbW5QRX|�rnd}|S)z�Process a .pth file within the site-packages directory:
       For each line in the file, either combine it with sitedir to a path
       and add that to known_paths, or execute it if it starts with 'import '.
    NTF�#)zimport zimport	z"Error processing line {:d} of {}:
�)�filerz  z
Remainder of file ignored)r(rrr�io�
TextIOWrapper�	open_coder�	enumerate�
startswith�exec�rstripr
r#rrr�	Exception�print�format�stderr�	traceback�format_exception�exc_info�
splitlines)�sitedir�namer �reset�fullname�f�n�liner
r!r7�recordrrr�
addpackage�sF

�rCcCs�|dkrt�}d}nd}t|�\}}||krBtj�|�|�|�zt�|�}Wntk
rfYdSXdd�|D�}t	|�D]}t
|||�q~|r�d}|S)zTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'NTFcSsg|]}|�d�r|�qS)z.pth)�endswith)�.0r<rrr�
<listcomp>�s
zaddsitedir.<locals>.<listcomp>)r(r
rrrrr�listdirr�sortedrC)r;r r=�sitedircase�namesr<rrr�
addsitedir�s$
rKcCs`tjjrdSttd�r4ttd�r4t��t��kr4dSttd�r\ttd�r\t��t��kr\dSdS)a,Check if user site directory is safe for inclusion

    The function tests for the command line flag (including environment var),
    process uid/gid equal to effective uid/gid.

    None: Disabled for security reasons
    False: Disabled by user (command line option)
    True: Safe and enabled
    F�getuid�geteuidN�getgid�getegidT)	r�flags�no_user_site�hasattrrrMrLrOrNrrrr�check_enableusersite�s
rScCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)rr�
expanduserr)�argsrrr�joinuser�sz_getuserbase.<locals>.joinuser�nt�APPDATA�~�Python�darwin�Libraryz%d.%d�z.local)r�environ�getr<r�platform�
_framework�version_info)�env_baserW�baserrr�_getuserbase�s


�rfcCsdtj}tjdkr,|�d|d�|d�d�StjdkrFtjrF|�d�S|�d|d�d	|d�d
�S)NrXz\Pythonrr*z\site-packagesr\z/lib/python/site-packagesz/lib/python�.z/site-packages)rrcrr<rarb)�userbase�versionrrr�	_get_path
s

rjcCstdkrt�atS)z�Returns the `user base` directory path.

    The `user base` directory can be used to store data. If the global
    variable ``USER_BASE`` is not initialized yet, this function will also set
    it.
    N)�	USER_BASErfrrrr�getuserbasesrlcCst�}tdkrt|�atS)z�Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    N)rl�	USER_SITErj)rhrrr�getusersitepackages#srncCs$t�}tr tj�|�r t||�|S)z�Add a per user site-package to sys.path

    Each user has its own python directory with site-packages in the
    home directory.
    )rn�ENABLE_USER_SITErr�isdirrK)r �	user_siterrr�addusersitepackages1s
rrcCs�g}t�}|dkrt}|D]�}|r||kr,q|�|�tjdkr�|�tj�|ddtj	dd�d��|�tj�|ddtj
dd	�d��q|�|�|�tj�|dd��|�tj�|dd��q|S)
aReturns a list containing all global site-packages directories.

    For each directory present in ``prefixes`` (or the global ``PREFIXES``),
    this function will find its `site-packages` subdirectory depending on the
    system environment, and will return a list of full paths.
    N�/�lib64�python�z
site-packages�libzpython%d.%dr^)r�PREFIXESrr�seprrrrrirc)�prefixes�sitepackages�seen�prefixrrr�getsitepackages?s*

��
r~cCsBtrdtjkrt�dd�t|�D]}tj�|�r"t||�q"|S)z�Add site-packages to sys.path

    '/usr/local' is included in PREFIXES if RPM build is not detected
    to make packages installed into this location visible.

    �RPM_BUILD_ROOTrz
/usr/local)	rorr_rx�insertr~rrprK)r rzr;rrr�addsitepackages^sr�cCs4tjdkrd}nd}t�d|�t_t�d|�t_dS)z�Define new builtins 'quit' and 'exit'.

    These are objects which make the interpreter exit when called.
    The repr of each object contains a hint at how it works.

    �\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)�quit�exitN)rry�
_sitebuiltins�Quitter�builtinsr�r�)�eofrrr�setquitms

r�cCs�t�dtj�t_tjdd�dkr2t�dd�t_nt�dd�t_gg}}ttd�r�tj	�
tj�}|�d	d
g�|�tj	�
|tj�|tjg�t�dd||�t_dS)
z)Set 'copyright' and 'credits' in builtins�	copyrightN��java�creditsz?Jython is maintained by the Jython developers (www.jython.org).z�    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.rzLICENSE.txt�LICENSE�licensez'See https://www.python.org/psf/license/)r��_Printerrr�r�rar�rRrr�dirnamer�extendr�pardir�curdirr�)�files�dirs�hererrr�setcopyright}s$�

�r�cCst��t_dSr)r��_Helperr��helprrrr�	sethelper�sr�cCsdd�}|t_dS)ajEnable default readline configuration on interactive prompts, by
    registering a sys.__interactivehook__.

    If the readline module can be imported, the hook will set the Tab key
    as completion key and register ~/.python_history as history file.
    This can be overridden in the sitecustomize or usercustomize module,
    or in a PYTHONSTARTUP file.
    cs�ddl}zddl�ddl}Wntk
r2YdSXt�dd�}|dk	r\d|kr\��d�n
��d�z���Wntk
r�YnX���dkr�t	j
�t	j
�d�d��z��
��Wntk
r�YnX��fd	d
�}|�|�dS)Nr�__doc__��libeditzbind ^I rl_completez
tab: completerZz.python_historycs(z����Wntk
r"YnXdSr)�write_history_filerr��history�readlinerr�
write_history�szCenablerlcompleter.<locals>.register_readline.<locals>.write_history)�atexitr��rlcompleter�ImportErrorr�parse_and_bind�read_init_filer�get_current_history_lengthrrrrU�read_history_file�register)r�r��readline_docr�rr�r�register_readline�s0
�z,enablerlcompleter.<locals>.register_readlineN)r�__interactivehook__)r�rrr�enablerlcompleter�s	0r�c	CsHtj}tjdkr*d|kr*tjd}t_ntj}tj�tj�|��\}}tj�	|�}dt_
d}dd�tj�||�tj�||�fD�}|�rD|d}d}	t|dd	��\}
|
D]P}d
|kr�|�
d
�\}}}
|����}|
��}
|dkr�|
��}	q�|dkr�|
t_
q�W5QRX|t_t_t|tjg�|	dk�r8t�dtj�ntjgad
a|S)Nr\�__PYVENV_LAUNCHER__z
pyvenv.cfgcSsg|]}tj�|�r|�qSr)rr�isfile)rE�conffilerrrrF�s�zvenv.<locals>.<listcomp>r�truezutf-8)�encoding�=zinclude-system-site-packages�homeF)rr_rra�_base_executable�
executabler�splitrr��_homer�open�	partition�strip�lowerr}�exec_prefixr�rxr�ro)r �envr��exe_dirr&�site_prefix�
conf_basename�candidate_confs�virtual_conf�system_siter?rA�key�valuerrr�venv�sB��

r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom site specific code, if available.rN�
sitecustomizez@Error in sitecustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrP�verbose�
excepthookr9r6�write�	__class__�__name__)r��exc�errrrr�execsitecustomizes

��r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom user specific code, if available.rN�
usercustomizez@Error in usercustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrPr�r�r9r6r�r�r�)r�r�r�rrr�execusercustomizes

��r�cCs~tjdd�}t�}|tjkr$t�t|�}tdkr:t�at|�}t|�}t	�t
�t�tjj
sjt�t�trzt�dS)z�Add standard site-specific directories to the module search path.

    This function is called automatically when this module is imported,
    unless the python interpreter was started with the -S flag.
    N)rrr"rr�rorSrrr�r�r�r�rP�isolatedr�r�r�)�	orig_pathr rrr�main/s"
r�cCs\d}tjdd�}|s�t�}t�}td�tjD]}td|f�q0td�td|tj�|�rbdndf�td	|tj�|�r�dndf�td
t�t�	d�g}d|kr�|�
t�d
|kr�|�
t�|�r(ttj
�|��tr�t�	d�n6tdk�rt�	d�n tdk�rt�	d�n
t�	d�n0ddl}t|�|tjdtj
f��t�	d�dS)Na�    %s [--user-base] [--user-site]

    Without arguments print some useful information
    With arguments print the value of USER_BASE and/or USER_SITE separated
    by '%s'.

    Exit codes with --user-base or --user-site:
      0 - user site directory is enabled
      1 - user site directory is disabled by user
      2 - uses site directory is disabled by super user
          or for security reasons
     >2 - unknown error
    r*zsys.path = [z    %r,�]zUSER_BASE: %r (%s)r#z
doesn't existzUSER_SITE: %r (%s)zENABLE_USER_SITE: %rrz--user-basez--user-siteFr^rv�
)r�argvrlrnr4rrrpror�rrkrm�pathsepr�textwrap�dedent)r�rV�	user_baserqr
�bufferr�rrr�_scriptQsD
��




r��__main__)N)N)N)&r�rrr�r�r,r}r�rxrormrkr
rr"r(rCrKrSrfrjrlrnrrr~r�r�r�r�r�r�r�r�r�rP�no_siter�r�rrrr�<module>sHG	
*
 


;4
3
codeop.cpython-38.pyc000064400000014423151450073350010454 0ustar00U

e5d��@sldZddlZddlZdd�ejD�ZdddgZdZd	d
�Zdd�Zddd�Z	Gdd�d�Z
Gdd�d�ZdS)a[Utilities to compile possibly incomplete Python source code.

This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:

- Return code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).

Approach:

First, check if the source consists entirely of blank lines and
comments; if so, replace it with 'pass', because the built-in
parser doesn't always do the right thing for these.

Compile three times: as is, with \n, and with \n\n appended.  If it
compiles as is, it's complete.  If it compiles with one \n appended,
we expect more.  If it doesn't compile either way, we compare the
error we get when compiling with \n or \n\n appended.  If the errors
are the same, the code is broken.  But if the errors are different, we
expect more.  Not intuitive; not even guaranteed to hold in future
releases; but this matches the compiler's behavior from Python 1.4
through 2.2, at least.

Caveat:

It is possible (but not likely) that the parser stops parsing with a
successful outcome before reaching the end of the source; in this
case, trailing symbols may be ignored instead of causing an error.
For example, a backslash followed by two newlines may be followed by
arbitrary garbage.  This will be fixed once the API for the parser is
better.

The two interfaces are:

compile_command(source, filename, symbol):

    Compiles a single command in the manner described above.

CommandCompiler():

    Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.

The module also provides another class:

Compile():

    Instances of this class act like the built-in function compile,
    but with 'memory' in the sense described above.
�NcCsg|]}tt|��qS�)�getattr�
__future__)�.0Zfnamerr�/usr/lib64/python3.8/codeop.py�
<listcomp>>s�r�compile_command�Compile�CommandCompilericCsZ|�d�D] }|��}|r
|ddkr
q8q
|dkr8d}d}}}d}}	}
z||||�}Wn"tk
r�}zW5d}~XYnXt����t�d�z||d||�}	Wn&tk
r�}z|}W5d}~XYnXz||d||�}
Wn(tk
�r}z|}W5d}~XYnXW5QRXz.|�r,|W�"S|	�sHt|�t|�k�rH|�W5d}}XdS)N�
r�#�eval�pass�errorz

)�split�strip�SyntaxError�warnings�catch_warnings�simplefilter�repr)�compiler�source�filename�symbol�line�errZerr1Zerr2�code�code1�code2�errr�_maybe_compileEs8

 r!cCst|||t�S�N)�compile�PyCF_DONT_IMPLY_DEDENT�rrrrrr�_compilensr&�<input>�singlecCstt|||�S)a�Compile a command and determine whether it is incomplete.

    Arguments:

    source -- the source string; may contain \n characters
    filename -- optional filename from which source was read; default
                "<input>"
    symbol -- optional grammar start symbol; "single" (default), "exec"
              or "eval"

    Return value / exceptions raised:

    - Return a code object if the command is complete and valid
    - Return None if the command is incomplete
    - Raise SyntaxError, ValueError or OverflowError if the command is a
      syntax error (OverflowError and ValueError can be produced by
      malformed literals).
    )r!r&r%rrrrqsc@s eZdZdZdd�Zdd�ZdS)r	z�Instances of this class behave much like the built-in compile
    function, but if one is used to compile text containing a future
    statement, it "remembers" and compiles all subsequent program texts
    with the statement in force.cCs
t|_dSr")r$�flags��selfrrr�__init__�szCompile.__init__cCs<t||||jd�}tD] }|j|j@r|j|jO_q|S)N�)r#r)�	_features�co_flagsZ
compiler_flag)r+rrrZcodeobZfeaturerrr�__call__�s
zCompile.__call__N��__name__�
__module__�__qualname__�__doc__r,r0rrrrr	�sc@s"eZdZdZdd�Zd	dd�ZdS)
r
a(Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.cCst�|_dSr")r	rr*rrrr,�szCommandCompiler.__init__r'r(cCst|j|||�S)a�Compile a command and determine whether it is incomplete.

        Arguments:

        source -- the source string; may contain \n characters
        filename -- optional filename from which source was read;
                    default "<input>"
        symbol -- optional grammar start symbol; "single" (default) or
                  "eval"

        Return value / exceptions raised:

        - Return a code object if the command is complete and valid
        - Return None if the command is incomplete
        - Raise SyntaxError, ValueError or OverflowError if the command is a
          syntax error (OverflowError and ValueError can be produced by
          malformed literals).
        )r!r)r+rrrrrrr0�szCommandCompiler.__call__N)r'r(r1rrrrr
�s)r'r()r5rrZall_feature_namesr.�__all__r$r!r&rr	r
rrrr�<module>s:�
)
plistlib.cpython-38.opt-2.pyc000064400000056763151450073350012002 0ustar00U

e5d�}�
@s:dddddddddd	d
ddg
Zd
dlZd
dlZd
dlZd
dlZd
dlZd
dlmZd
dlZd
dl	Z	d
dl
Z
d
dlZd
dlm
Z
d
dlmZejdded�Ze��ej�ejdd��Zdd�Zdd�Zdd�Zdd�ZGdd�d�ZGdd�d�ZdZe
�d�Z dKd d!�Z!d"d#�Z"e
�d$e
j#�Z$d%d&�Z%d'd(�Z&d)d*�Z'Gd+d,�d,�Z(Gd-d.�d.�Z)Gd/d0�d0e)�Z*d1d2�Z+Gd3d�de,�Z-d4d5d6d7d8�Z.e/�Z0Gd9d:�d:�Z1d;d<�Z2e3e4e5eje6fZ7Gd=d>�d>e/�Z8d?d@�Z9e:e;e+e(e*dA�e<e;e9e1e8dA�iZ=ddBe;dC�dDd�Z>ddBe;dC�dEd
�Z?e:dBdFdG�dHd	�Z@e:dFdBdI�dJd�ZAdS)L�	readPlist�
writePlist�readPlistFromBytes�writePlistToBytes�Data�InvalidFileException�FMT_XML�
FMT_BINARY�load�dump�loads�dumps�UID�N)�BytesIO)�warn)�ParserCreate�PlistFormatzFMT_XML FMT_BINARY)�modulec	cs2t|t�r(t||��}|VW5QRXn|VdS�N)�
isinstance�str�open)�
pathOrFile�mode�fp�r� /usr/lib64/python3.8/plistlib.py�_maybe_openOs
rc
Cs<tdtd�t|d��}t|ddd�W5QR�SQRXdS)Nz8The readPlist function is deprecated, use load() instead��rbF��fmt�use_builtin_types)r�DeprecationWarningrr	)rrrrrrYs�c	Cs8tdtd�t|d��}t||tddd�W5QRXdS)Nz9The writePlist function is deprecated, use dump() insteadr�wbTF�r!�	sort_keys�skipkeys)rr#rr
r)�valuerrrrrrfs�cCstdtd�tt|�ddd�S)NzBThe readPlistFromBytes function is deprecated, use loads() insteadrFr )rr#r	r��datarrrrss
�cCs,tdtd�t�}t||tddd�|��S)NzAThe writePlistToBytes function is deprecated, use dumps() insteadrTFr%)rr#rr
r�getvalue)r(�frrrr~s�c@s:eZdZdd�Zedd��Zd
dd�Zdd	�Zd
d�ZdS)rcCst|t�std��||_dS)Nzdata must be as bytes)r�bytes�	TypeErrorr*��selfr*rrr�__init__�s
z
Data.__init__cCs|t|��Sr)�_decode_base64)�clsr*rrr�
fromBase64�szData.fromBase64�LcCst|j|�Sr)�_encode_base64r*)r0�
maxlinelengthrrr�asBase64�sz
Data.asBase64cCs4t||j�r|j|jkSt|t�r,|j|kStSdSr)r�	__class__r*r-�NotImplemented�r0�otherrrr�__eq__�s


zData.__eq__cCsd|jjt|j�fS�Nz%s(%s)�r9�__name__�reprr*�r0rrr�__repr__�sz
Data.__repr__N)r5)	r@�
__module__�__qualname__r1�classmethodr4r8r=rCrrrrr�s

c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r
cCs<t|t�std��|dkr"td��|dkr2td��||_dS)Nzdata must be an int�zUIDs cannot be >= 2**64r�UIDs must be positive)r�intr.�
ValueErrorr*r/rrrr1�s
zUID.__init__cCs|jSrr)rBrrr�	__index__�sz
UID.__index__cCsd|jjt|j�fSr>r?rBrrrrC�szUID.__repr__cCs|j|jffSr)r9r*rBrrr�
__reduce__�szUID.__reduce__cCst|t�stS|j|jkSr)rr
r:r*r;rrrr=�s
z
UID.__eq__cCs
t|j�Sr)�hashr*rBrrr�__hash__�szUID.__hash__N)	r@rDrEr1rKrCrLr=rNrrrrr
�s	s�<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
zv[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]r5cCsP|dd}g}tdt|�|�D]$}||||�}|�t�|��q d�|�S)N��r�)�range�len�append�binasciiZ
b2a_base64�join)�sr7Z
maxbinsize�pieces�i�chunkrrrr6�sr6cCs(t|t�rt�|�d��St�|�SdS)N�utf-8)rrrUZ
a2b_base64�encode)rWrrrr2�s
r2z{(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?ZcCsLd}t�|���}g}|D]&}||}|dkr2qB|�t|��qtj|�S)N�ZyearZmonthZdayZhourZminute�second)�_dateParser�match�	groupdictrTrI�datetime)rW�orderZgdZlst�key�valrrr�_date_from_string�srfcCs d|j|j|j|j|j|jfS)Nz%04d-%02d-%02dT%02d:%02d:%02dZr])�drrr�_date_to_strings�rhcCsZt�|�}|dk	rtd��|�dd�}|�dd�}|�dd�}|�dd�}|�d	d
�}|S)Nz<strings can't contains control characters; use bytes insteadz
�
�
�&z&amp;�<z&lt;�>z&gt;)�_controlCharPat�searchrJ�replace)�text�mrrr�_escapes
rsc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�_PlistParsercCs"g|_d|_d|_||_||_dSr)�stack�current_key�root�_use_builtin_types�
_dict_type�r0r"�	dict_typerrrr1s
z_PlistParser.__init__cCsBt�|_|j|j_|j|j_|j|j_|j|j_	|j�
|�|jSr)r�parser�handle_begin_elementZStartElementHandler�handle_end_elementZEndElementHandler�handle_dataZCharacterDataHandler�handle_entity_declZEntityDeclHandlerZ	ParseFilerw)r0Zfileobjrrr�parses



z_PlistParser.parsecCstd��dS)Nz8XML entity declarations are not supported in plist files)r)r0Zentity_nameZis_parameter_entityr(�baseZ	system_idZ	public_idZ
notation_namerrrr�$sz_PlistParser.handle_entity_declcCs*g|_t|d|d�}|dk	r&||�dS)NZbegin_)r*�getattr)r0�element�attrs�handlerrrrr}*sz!_PlistParser.handle_begin_elementcCs"t|d|d�}|dk	r|�dS)NZend_)r�)r0r�r�rrrr~0sz_PlistParser.handle_end_elementcCs|j�|�dSr)r*rTr/rrrr5sz_PlistParser.handle_datacCs�|jdk	rFt|jdti��s.td|jj��||jd|j<d|_nB|jsT||_n4t|jdtg��sxtd|jj��|jd�|�dS)N���zunexpected element at line %d)	rvrru�typerJr|�CurrentLineNumberrwrT�r0r(rrr�
add_object8s
��z_PlistParser.add_objectcCsd�|j�}g|_|S)N�)rVr*r/rrr�get_dataHsz_PlistParser.get_datacCs"|��}|�|�|j�|�dSr)ryr�rurT)r0r�rgrrr�
begin_dictOs
z_PlistParser.begin_dictcCs*|jrtd|j|jjf��|j��dS)Nz%missing value for key '%s' at line %d)rvrJr|r�ru�poprBrrr�end_dictTs
�z_PlistParser.end_dictcCs8|jst|jdti��s*td|jj��|��|_dS)Nr�zunexpected key at line %d)rvrrur�rJr|r�r�rBrrr�end_keyZs
�z_PlistParser.end_keycCsg}|�|�|j�|�dSr)r�rurT)r0r��arrr�begin_array`s
z_PlistParser.begin_arraycCs|j��dSr)rur�rBrrr�	end_arrayesz_PlistParser.end_arraycCs|�d�dS)NT�r�rBrrr�end_truehsz_PlistParser.end_truecCs|�d�dS)NFr�rBrrr�	end_falseksz_PlistParser.end_falsecCs@|��}|�d�s|�d�r.|�t|d��n|�t|��dS)NZ0xZ0X�)r��
startswithr�rI)r0�rawrrr�end_integernsz_PlistParser.end_integercCs|�t|����dSr)r��floatr�rBrrr�end_realusz_PlistParser.end_realcCs|�|���dSr)r�r�rBrrr�
end_stringxsz_PlistParser.end_stringcCs2|jr|�t|����n|�t�|����dSr)rxr�r2r�rr4rBrrr�end_data{sz_PlistParser.end_datacCs|�t|����dSr)r�rfr�rBrrr�end_date�sz_PlistParser.end_dateN)r@rDrEr1r�r�r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrts(	rtc@s8eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zd	S)�_DumbXMLWriterr�	cCs||_g|_||_||_dSr)�fileru�
_indent_level�indent)r0r��indent_levelr�rrrr1�sz_DumbXMLWriter.__init__cCs,|j�|�|�d|�|jd7_dS)Nz<%s>�)rurT�writelnr��r0r�rrr�
begin_element�sz_DumbXMLWriter.begin_elementcCs |jd8_|�d|�dS)Nr�z</%s>)r�r�r�rrr�end_element�sz_DumbXMLWriter.end_elementNcCs8|dk	r&t|�}|�d|||f�n|�d|�dS)Nz<%s>%s</%s>z<%s/>)rsr�)r0r�r(rrr�simple_element�sz_DumbXMLWriter.simple_elementcCsH|r8t|t�r|�d�}|j�|j|j�|j�|�|j�d�dS)Nr[�
)rrr\r��writer�r�)r0�linerrrr��s

z_DumbXMLWriter.writeln)rr�)N)r@rDrEr1r�r�r�r�rrrrr��s


r�c@sFeZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dS)�_PlistWriterr�	r�TFcCs.|r|�t�t�||||�||_||_dSr)r��PLISTHEADERr�r1�
_sort_keys�	_skipkeys)r0r�r�r�ZwriteHeaderr&r'rrrr1�s

z_PlistWriter.__init__cCs"|�d�|�|�|�d�dS)Nz<plist version="1.0">z</plist>)r��write_valuer�rrrr��s

z_PlistWriter.writecCs4t|t�r|�d|��n|dkr0|�d��n|dkrD|�d�n�t|t�r�d|krbdkrxnn|�dd	|�nt|��n�t|t�r�|�d
t|��n�t|t�r�|�|�n|t|t	�r�|�
|�nft|ttf�r�|�
|�nLt|tj��r|�dt|��n,t|ttf��r |�|�ntdt|���dS)
N�stringT�trueFZfalsel����rGZintegerz%d�real�datezunsupported type: %s)rrr�rI�
OverflowErrorr�rA�dict�
write_dictr�
write_datar-�	bytearray�write_bytesrbrh�tuple�list�write_arrayr.r�r�rrrr��s.





z_PlistWriter.write_valuecCs|�|j�dSr)r�r*r/rrrr��sz_PlistWriter.write_datacCsz|�d�|jd8_tddt|j�dd�|j��}t||��d�D]}|rJ|�|�qJ|jd7_|�	d�dS)Nr*r�r�r5r�s        r�)
r�r��maxrSr�rpr6�splitr�r�)r0r*r7r�rrrr��s
�z_PlistWriter.write_bytescCs�|rt|�d�|jr"t|���}n|��}|D]8\}}t|t�sP|jrHq.td��|�d|�|�	|�q.|�
d�n
|�d�dS)Nr��keys must be stringsrd)r�r��sorted�itemsrrr�r.r�r�r�)r0rgr�rdr(rrrr��s

z_PlistWriter.write_dictcCs<|r.|�d�|D]}|�|�q|�d�n
|�d�dS)N�array)r�r�r�r�)r0r�r(rrrr�s
z_PlistWriter.write_arrayN)rr�r�TF)
r@rDrEr1r�r�r�r�r�r�rrrrr��s�

%
r�cCs�d}|D]}|�|�rdSqtjdftjdftjdffD]N\}}|�|�sNq:|D]4}||�d��|�}|dt|��|krRdSqRq:dS)N)s<?xmls<plistTr[z	utf-16-bez	utf-16-le�asciiF)r��codecs�BOM_UTF8�BOM_UTF16_BE�BOM_UTF16_LE�decoder\rS)�header�prefixesZpfxZbom�encoding�start�prefixrrr�_is_fmt_xmls
�
r�c@seZdZddd�ZdS)r�Invalid filecCst�||�dSr)rJr1)r0�messagerrrr12szInvalidFileException.__init__N)r�)r@rDrEr1rrrrr1s�B�H�L�Q)r�rrO�c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistParsercCs||_||_dSr)rxryrzrrrr1Asz_BinaryPlistParser.__init__cCs�z~||_|j�dtj�|j�d�}t|�dkr6t��t�d|�\}|_	}}}|j�|�|�
||�|_tg||_
|�|�WStttjttfk
r�t��YnXdS)Ni��� z>6xBBQQQ)�_fp�seek�os�SEEK_END�readrSr�struct�unpack�	_ref_size�
_read_ints�_object_offsets�
_undefined�_objects�_read_object�OSError�
IndexError�errorr�rJ)r0r�trailer�offset_size�num_objects�
top_object�offset_table_offsetrrrr�Es*
��z_BinaryPlistParser.parsecCsL|dkrH|j�d�dd@}d|>}dt|}t�||j�|��dS|S)N�r�rrPrm)r�r��_BINARY_FORMATr�r�)r0�tokenLrrrWr,rrr�	_get_size^sz_BinaryPlistParser._get_sizecst|j��|���tkr2t�d|�t�����S�rFt���|krLt��t��fdd�td�|��D��SdS)Nrmc3s&|]}t��||��d�VqdS)�bigN)rI�
from_bytes)�.0rY�r*�sizerr�	<genexpr>os�z0_BinaryPlistParser._read_ints.<locals>.<genexpr>r)	r�r�r�r�r�rSrr�rR)r0�nr�rr�rr�hs�z_BinaryPlistParser._read_intscCs|�||j�Sr)r�r�)r0r�rrr�
_read_refsrsz_BinaryPlistParser._read_refscs�j|}|tk	r|S�j|}�j�|��j�d�d}|d@|d@}}|dkr^d}�n�|dkrnd}�n�|dkr~d}�n�|dkr�d	}�n�|d
kr�tj�j�d|>�d|dkd
�}�nT|dkr�t�	d�j�d��d}�n0|dk�rt�	d�j�d��d}�n
|dk�rDt�	d�j�d��d}t
�
ddd�t
j|d�}�n�|dk�r���|�}�j�|�}t
|�|k�rxt���j�st|�}�n�|dk�rΈ�|�}�j�|�}	t
|	�|k�r�t��|	�d�}�n@|dk�r��|�d}�j�|�}	t
|	�|k�rt��|	�d�}n�|dk�r:tt��j�d|�d��}n�|dk�r���|�}��|�}
g}|�j|<|��fdd�|
D��n�|d k�r��|�}��|�}��|�}
���}|�j|<z.t||
�D]\}}
��|
�|��|�<�q�Wntk
�rt��YnXnt��|�j|<|S)!Nr�r��r�r�F�	TrQr�r�rP�Zsigned�"z>frO�#z>d�3��)Zseconds�@�Pr��`r�utf-16be��c3s|]}��|�VqdSr)r�)r��xrBrrr��sz2_BinaryPlistParser._read_object.<locals>.<genexpr>��)r�r�r�r�r�r�rIr�r�r�rbZ	timedeltar�rSrrxrr�r
r��extendry�zipr�r.)r0�ref�result�offset�tokenZtokenHr�r,rWr*Zobj_refsZkey_refs�k�orrBrr�us�

�



�















z_BinaryPlistParser._read_objectN)	r@rDrEr1r�r�r�r�r�rrrrr�9s

r�cCs,|dkrdS|dkrdS|dkr$dSdSdS)N�r��r�rOr�r)�countrrr�_count_to_size�src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistWritercCs||_||_||_dSr)r�r�r�)r0rr&r'rrrr1�sz_BinaryPlistWriter.__init__c
Cs�g|_i|_i|_|�|�t|j�}dg||_t|�|_t|j|_	|j
�d�|jD]}|�|�qZ|�
|�}|j
��}t|�}dt||}|j
�tj|f|j���d}|||j|||f}	|j
�tjd|	���dS)Nr�bplist00rm�	>5xBBBQQQ)r)�_objlist�	_objtable�_objidtable�_flattenrSr�rr�r��_ref_formatr�r��
_write_object�
_getrefnum�tellr��pack)
r0r(r��objr�r�r�Z
offset_formatZsort_versionr�rrrr��s2





�z_BinaryPlistWriter.writec	Csrt|t�r"t|�|f|jkrZdSn8t|t�rHt|j�|jf|jkrZdSnt|�|jkrZdSt|j	�}|j	�
|�t|t�r�||jt|�|f<n0t|t�r�||jt|j�|jf<n||jt|�<t|t��rHg}g}|��}|j
r�t|�}|D]:\}}t|t��s|j�r
q�td��|�
|�|�
|�q�t�||�D]}|�|��q4n&t|ttf��rn|D]}|�|��q\dS)Nr�)r�_scalarsr�rrr*�idr rSrrTr�r�r�r�rr�r.�	itertools�chainr!r�r�)	r0r(Zrefnum�keys�valuesr�r�vrrrrr!sB





z_BinaryPlistWriter._flattencCsNt|t�r|jt|�|fSt|t�r<|jt|j�|jfS|jt|�SdSr)rr(rr�rr*r r)r�rrrr$Ns


z_BinaryPlistWriter._getrefnumcCs�|dkr"|j�t�d||B��n�|dkrH|j�t�d|dBd|��nh|dkrn|j�t�d|dBd|��nB|d	kr�|j�t�d
|dBd|��n|j�t�d|dBd
|��dS)Nr�z>Brz>BBBr�rz>BBH�rz>BBL�z>BBQ�)r�r�r�r&)r0rr�rrr�_write_sizeVsz_BinaryPlistWriter._write_sizecs���|�}�j���j|<|dkr2�j�d��nl|dkrJ�j�d��nT|dkrb�j�d��n<t|t��rl|dkr�z�j�t�dd|��Wn tj	k
r�t
|�d�YnXn�|d	krԈj�t�d
d|��n�|dkr�j�t�d
d|��nt|dk�r�j�t�dd|��nR|dk�r8�j�t�dd|��n0|dk�r`�j�d|jdddd��nt
|���n2t|t��r��j�t�dd|���nt|t
j
��r�|t
�
ddd���}�j�t�dd|���n�t|t��r��dt|j���j�|j��n�t|ttf��r0��dt|���j�|��nnt|t��r�z|�d�}��dt|��Wn4tk
�r�|�d �}��d!t|�d"�YnX�j�|��n�t|t��r^|jdk�r�td#��n�|jd	k�r�j�t�d
d$|��nt|jdk�r
�j�t�d
d%|��nP|jdk�r.�j�t�dd&|��n,|jdk�rR�j�t�dd'|��nt
|���n@t|ttf��r��fd(d)�|D�}t|�}��d*|��j�tjd+�j|f|���n�t|t��r�gg}}�j�r�t|� ��}	n|� �}	|	D]J\}
}t|
t��s�j!�r�q�t"d,��|�#��|
��|�#��|���q�t|�}��d-|��j�tjd+�j|f|����j�tjd+�j|f|���nt"|��dS).N�F�Tr�rz>Bqr1rz>BBr�rz>BHr/rz>BLr0lz>BQrG�r�rz>Bdrrr�rrr�rr	rrrHr
���csg|]}��|��qSr)r$)r�rrBrr�
<listcomp>�sz4_BinaryPlistWriter._write_object.<locals>.<listcomp>rrmr�r
)$r$r�r%r�r�rrIr�r&r�r��to_bytesr�rbZ
total_secondsrr2rSr*r-r�rr\�UnicodeEncodeErrorr
rJr�r�r"r�r�r�r�r�r.rT)r0r(rr,�tZrefsrWZkeyRefsZvalRefsZ	rootItemsrr.rrBrr#fs�






$
"$z _BinaryPlistWriter._write_objectN)	r@rDrEr1r�r!r$r2r#rrrrr�s-0rcCs|dd�dkS)Nr�rr)r�rrr�_is_fmt_binary�sr=)�detectr|�writerT�r!r"r{cCsl|dkrJ|�d�}|�d�t��D]}|d|�r$|d}qVq$t��nt|d}|||d�}|�|�S)Nr�rr>r|)r"r{)r�r��_FORMATSr-rr�)rr!r"r{r��info�P�prrrr	�s

cCst|�}t||||d�S)Nr@)rr	)r(r!r"r{rrrrr�s�Fr%cCs:|tkrtd|f��t|d|||d�}|�|�dS)NzUnsupported format: %rr?)r&r')rArJr�)r(rr!r&r'r?rrrr
s�r!r'r&cCs t�}t|||||d�|��S)NrE)rr
r+)r(r!r'r&rrrrrs)r5)B�__all__rUr��
contextlibrb�enum�iorr*r��rer��warningsrZxml.parsers.expatr�Enumr@r�globals�update�__members__�contextmanagerrrrrrrr
r��compilernr6r2�ASCIIr_rfrhrsrtr�r�r�rJrr��objectr�r�rrrIr�r-r(rr=rr�rrAr	rr
rrrrr�<module>1s��

	


'"�
	
s&d!$
a	���	colorsys.cpython-38.opt-1.pyc000064400000006252151450073350012020 0ustar00U

e5d��@s\dZddddddgZdZdZd	Zd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
dd�ZdS)aJConversion functions between RGB and other color systems.

This modules provides two functions for each color system ABC:

  rgb_to_abc(r, g, b) --> a, b, c
  abc_to_rgb(a, b, c) --> r, g, b

All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly larger range).
Inputs outside the valid range may cause exceptions or invalid outputs.

Supported color systems:
RGB: Red, Green, Blue components
YIQ: Luminance, Chrominance (used by composite video signals)
HLS: Hue, Luminance, Saturation
HSV: Hue, Saturation, Value
�
rgb_to_yiq�
yiq_to_rgb�
rgb_to_hls�
hls_to_rgb�
rgb_to_hsv�
hsv_to_rgbgUUUUUU�?gUUUUUU�?gUUUUUU�?cCsRd|d|d|}d||d||}d||d||}|||fS)Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g=
ףp=�?�)�r�g�b�y�i�qrr� /usr/lib64/python3.8/colorsys.pyr(scCs�|d|d|}|d|d|}|d|d|}|dkrHd}|dkrTd}|dkr`d}|dkrld}|dkrxd}|dkr�d}|||fS)	Ng2r��L�?g����,��?g:�����?g�nєW�?g6�޷���?gJ"�X�?���?r)rrr
rr	r
rrrr.s cCs�t|||�}t|||�}||d}||kr6d|dfS|dkrP||||}n||d||}||||}||||}||||}	||kr�|	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)N�@r��?�@�@r��max�min)rr	r
�maxc�minc�l�s�rc�gc�bc�hrrrrKs$

cCsn|dkr|||fS|dkr(|d|}n||||}d||}t|||t�t|||�t|||t�fS)Nrrrr)�_v�	ONE_THIRD)rrr�m2�m1rrrrbs
cCsT|d}|tkr$||||dS|dkr0|S|tkrP|||t|dS|S)Nrrr)�	ONE_SIXTH�	TWO_THIRD)r#r"Zhuerrrr lsr cCs�t|||�}t|||�}|}||kr.dd|fS|||}||||}||||}||||}	||kr||	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)Nrrrrrr)rr	r
rr�vrrrrrrrrr|s 

cCs�|dkr|||fSt|d�}|d|}|d|}|d||}|d|d|}|d}|dkrt|||fS|dkr�|||fS|dkr�|||fS|dkr�|||fS|d	kr�|||fS|d
kr�|||fSdS)Nrrr�������)�int)rrr&r�f�pr
�trrrr�s(





N)�__doc__�__all__r!r$r%rrrrr rrrrrr�<module>s�	
warnings.cpython-38.opt-1.pyc000064400000031612151450073350011771 0ustar00U

e5d�L�@s�dZddlZddddddd	d
gZd<dd�Zd=dd�Zd
d�Zdd�ZeZdd�ZeZ	dd�Z
dedddfdd�Zeddfdd�Z
dd�Zdd	�ZGdd�de�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd>d+d�Zd?d,d�ZGd-d.�d.e�ZGd/d
�d
e�Zd0d1�Zz0dd2lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d3Z%Wn2e&k
�rngZd4Z#iZ$d*a'd5d6�Z"dZ%YnXeej(�e%�s�e)ed7��s�ed4e*d8d*d9�e
d:e*d*d;�e
d:e+d*d;�e
d:e,d*d;�e
d:e-d*d;�[%dS)@z&Python part of the warnings subsystem.�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS)�7Hook to write a warning to a file; replace if you like.N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r� /usr/lib64/python3.8/warnings.pyr
scCst||||d|�}t|�S)�.Function to format a warning the standard way.N)r�_formatwarnmsg_impl)r
rrrrrrrrrscCsP|j}|dkr tj}|dkr dSt|�}z|�|�Wntk
rJYnXdS�N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdkrpzddl}|�|j|j�}Wqvtk
rld}d}YqvXn|j}|r�|�	�}|d|7}|j
dk	�r�zddl}Wntk
r�d}d}Yn4X|��}z|�
|j
�}Wntk
r�d}YnX|dk	�r�|d7}|D]t}|d|j|jf7}z$|dk	�rB|�|j|j�}nd}Wntk
�rbd}YnX|�r|�	�}|d	|7}�qn|�s�||�d
�7}|S)N�:z: �
rz  %s
Tz-Object allocated at (most recent call last):
z  File "%s", lineno %s
z    %s
z<: Enable tracemalloc to get the object allocation traceback
)r�__name__rrr
r�	linecache�getline�	Exception�strip�source�tracemalloc�
is_tracing�get_object_traceback)	rr�sr"rr'�tracing�tb�framerrrr#sT"




�

rcCsdzt}Wntk
rYn<X|tk	rXt|�s6td��||j|j|j|j|j	|j
�dSt|�dS)r
z:warnings.showwarning() must be set to a function or methodN)r�	NameError�_showwarning_orig�callable�	TypeErrorr
rrrrrr)r�swrrr�_showwarnmsg`s�r3cCsHzt}Wntk
rYn$X|tk	r@||j|j|j|j|j�St|�S)r)	rr.�_formatwarning_origr
rrrrr)r�fwrrrrus
�r�FcCsT|s|rddl}|r$|�||j�}nd}|r8|�|�}nd}t||||||d�dS)a�Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    rN��append)�re�compile�I�_add_filter)�actionr
r�modulerr8r9rrrr�scCst|d|d||d�dS)a�Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    Nr7)r<)r=rrr8rrrr�scGsR|s6zt�|�Wntk
r&YnXt�d|�n|tkrHt�|�t�dS)Nr)�filters�remove�
ValueError�insertr8�_filters_mutated)r8�itemrrrr<�s
r<cCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)r?rCrrrrr�sc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r!�
__module__�__qualname__�__doc__rrrrrE�srEcCsN|D]D}zt|�Wqtk
rF}ztd|tjd�W5d}~XYqXqdS)NzInvalid -W option ignored:)r)�
_setoptionrE�printrr)�args�argrrrr�_processoptions�s
rMc	Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t	�Wq�t	t
fk
r�td	|f�d�Yq�Xnd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr6cSsg|]}|���qSr)r%)�.0r*rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrEr8�
_getaction�_getcategoryr9�escape�intrA�
OverflowErrorr)rL�partsr=r
rr>rr9rrrrI�s2
�
rIcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)N�default�all�always)rYr[�ignorer>�once�errorzinvalid action: %r)�
startswithrE)r=�arrrrS�s

rScCs�|stSd|krddl}|}nJ|�d�\}}}zt|dd|g�}Wn$tk
rftd|f�d�YnXzt||�}Wn$tk
r�td|f�d�YnXt|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	�Warning�builtins�
rpartition�
__import__�ImportErrorrE�getattr�AttributeError�
issubclass)r�m�klassr>�_�catrrrrT�s"
rTcCs|jj}d|kod|kS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r-rrrr�_is_internal_framesrrcCs"|j}|dk	rt|�r|j}q|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrr)r-rrr�_next_external_framesrt�c	Cst|t�r|j}|dkrt}t|t�r0t|t�sDtd�t|�j���zV|dks\t	t
�d��rht
�|�}n0t
�d�}t|d�D]}t
|�}|dkr~t�q~Wn"tk
r�t
j}d}d}YnX|j}|jj}|j}d|kr�|d}	nd}	|�di�}
t|||||	|
||�dS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'rurr!z<string>Z__warningregistry__)�
isinstancerb�	__class__�UserWarning�typerir1�formatr!rrr�	_getframe�rangertrA�__dict__�	f_globalsrprq�f_lineno�
setdefaultr)r
r�
stacklevelr&r-�x�globalsrrr>�registryrrrrs>
�



�cCs�t|�}|dkr8|pd}|dd���dkr8|dd�}|dkrDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSt	D]V}
|
\}}}
}}|dks�|�
|�r�t||
�r�|dks�|�
|�r�|dks�||kr��qq�t}|dk�rdSddl
}|�||�|dk�r2|�|dk�rfd	||	<||f}t�|��r\dSd	t|<nf|d
k�rrnZ|dk�r�d	||	<||df}|�|��r�dSd	||<n$|dk�r�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrr\r^r]rur[r>rYz1Unrecognized action (%r) in warnings.filters:
 %s)rV�lower�get�_filters_version�clearrvrb�strrwr?�matchri�
defaultactionr"�getlines�onceregistry�RuntimeErrorrr3)r
rrrr>r��module_globalsr&r�keyrDr=rrm�modZlnr"ZoncekeyZaltkeyrrrrGs|


�����









��c@s"eZdZdZddd�Zdd�ZdS)r)r
rrrrrr&NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr)	r
rrrrrr&r!�_category_name)�selfr
rrrrrr&rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r
r�rrr)r�rrr�__str__�s��zWarningMessage.__str__)NNN)r!rFrG�_WARNING_DETAILSr�r�rrrrr�s�
rc@s8eZdZdZddd�dd�Zdd�Zd	d
�Zdd�ZdS)
r	a�A context manager that copies and restores the warnings filter upon
    exiting the context.

    The 'record' argument specifies whether warnings should be captured by a
    custom implementation of warnings.showwarning() and be appended to a list
    returned by the context manager. Otherwise None is returned by the context
    manager. The objects appended to the list are arguments whose attributes
    mirror the arguments to showwarning().

    The 'module' argument is to specify an alternative module to the module
    named 'warnings' and imported under that name. This argument is only useful
    when testing the warnings module itself.

    FN)�recordr>cCs(||_|dkrtjdn||_d|_dS)z�Specify whether to record warnings and if an alternative module
        should be used other than sys.modules['warnings'].

        For compatibility with Python 3.0, please consider all arguments to be
        keyword-only.

        N�warningsF)�_recordr�modules�_module�_entered)r�r�r>rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdk	r4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r8r�rr�ryr!�join)r�rK�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�r?�_filtersrCr�_showwarningrr�r8r/)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�r?rCr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)r!rFrGrHr�r�r�r�rrrrr	�s
	cszd�j�d�g}�jdk	rVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s4t�j�D]$\}}}��||�}||||fVq
dSr)�reversed�	cr_originr#)rr�funcnamer��coror"rr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r6r �)rr�r&)rGr�r"�	tracebackr8�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)r?�_defaultaction�
_onceregistryrrrCTrYcCstd7adS)Nru)r�rrrrrCsrCZgettotalrefcount�__main__)rr>r8r\)rr8)NN)N)NruN)NNNN).rHr�__all__rrrrr/r3r4rrbrrr<rr$rErMrIrSrTrrrtrr�objectrr	r��	_warningsr?r�r�rCr�r�Z_warnings_defaultsrfr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>s|�

;
�
#
	
)�
GC 

�uuid.cpython-38.opt-2.pyc000064400000040051151450073350011105 0ustar00U

&�.e3w�@sddlZddlZddlmZdZejdkr4dZZn ddlZe��Z	e	dkZe	dkZdd	d
dg\Z
ZZZ
eZeZGdd
�d
e�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zdaada zddl!Z!Wne"k
�rdZ!YnXd$d%�Z#d&d'�Z$d(d)�Z%d*d+�Z&e�rBeegZ'nJejd,k�rZeeegZ'n2ejd-k�rpeegZ'ne�r~egZ'neeeeegZ'ej(d.k�r�e$ge'Z)nej(d/k�r�e%ge'Z)ne'Z)da*dd0�d1d2�Z+da,d?d3d4�Z-d5d6�Z.d7d8�Z/d9d:�Z0ed;�Z1ed<�Z2ed=�Z3ed>�Z4dS)@�N)�EnumzKa-Ping Yee <ping@zesty.ca>)�win32�darwinFZAIXZLinuxzreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definitionc@seZdZdZdZdZdS)�SafeUUIDr���N)�__name__�
__module__�__qualname__ZsafeZunsafe�unknown�rr�/usr/lib64/python3.8/uuid.pyrHsrc@s6eZdZdZd<ejd�dd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zed2d3��Zed4d5��Zed6d7��Z ed8d9��Z!ed:d;��Z"dS)=�UUID)�int�is_safe�__weakref__N)rcCs�|||||g�d�dkr td��|dk	rl|�dd��dd�}|�d��dd�}t|�dkrbtd	��t|d
�}|dk	r�t|�d
kr�td��|ddd
�|ddd
�|ddd
�|dd�}|dk	r�t|�d
kr�td��tj|dd�}|dk	�rt|�dk�rtd��|\}}	}
}}}
d|k�r0dk�s:ntd��d|	k�rRdk�s\ntd��d|
k�rtdk�s~ntd��d|k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|
k�r�dk�s�ntd ��|d>|B}|d!>|	d">B|
d#>B|d$>B|
B}|dk	�rDd|k�r:d%d&>k�sDntd'��|dk	�r�d%|k�rfdk�spntd(��|d)M}|d*O}|d+M}||d,>O}t�	|d-|�t�	|d.|�dS)/N�zGone of the hex, bytes, bytes_le, fields, or int arguments must be givenzurn:�zuuid:z{}�-� z$badly formed hexadecimal UUID string�z bytes_le is not a 16-char string�r���zbytes is not a 16-char string�big)�	byteorder�zfields is not a 6-tuplerlz*field 1 out of range (need a 32-bit value)iz*field 2 out of range (need a 16-bit value)z*field 3 out of range (need a 16-bit value)�z*field 4 out of range (need an 8-bit value)z*field 5 out of range (need an 8-bit value)�z*field 6 out of range (need a 48-bit value)�`�P�@�0��z*int is out of range (need a 128-bit value)zillegal version numberl�����l�����Lrr)
�count�	TypeError�replace�strip�len�
ValueError�int_�
from_bytes�object�__setattr__)�self�hex�bytes�bytes_le�fieldsr�versionr�time_low�time_mid�time_hi_version�clock_seq_hi_variant�
clock_seq_low�node�	clock_seqrrr�__init__�sx 
�
�
����

z
UUID.__init__cCs&d|ji}|jtjkr"|jj|d<|S�Nrr)rrrr
�value)r1�drrr�__getstate__�s
zUUID.__getstate__cCs:t�|d|d�t�|dd|kr.t|d�ntj�dSr?)r/r0rr
)r1�staterrr�__setstate__�s��zUUID.__setstate__cCst|t�r|j|jkStS�N��
isinstancer
r�NotImplemented�r1�otherrrr�__eq__�s
zUUID.__eq__cCst|t�r|j|jkStSrErFrIrrr�__lt__�s
zUUID.__lt__cCst|t�r|j|jkStSrErFrIrrr�__gt__�s
zUUID.__gt__cCst|t�r|j|jkStSrErFrIrrr�__le__�s
zUUID.__le__cCst|t�r|j|jkStSrErFrIrrr�__ge__s
zUUID.__ge__cCs
t|j�SrE)�hashr�r1rrr�__hash__sz
UUID.__hash__cCs|jSrE�rrQrrr�__int__szUUID.__int__cCsd|jjt|�fS)Nz%s(%r))�	__class__r�strrQrrr�__repr__sz
UUID.__repr__cCstd��dS)NzUUID objects are immutable)r()r1�namer@rrrr0szUUID.__setattr__cCsDd|j}d|dd�|dd�|dd�|dd�|dd�fS)N�%032xz%s-%s-%s-%s-%sr�r�rS)r1r2rrr�__str__s





�zUUID.__str__cCs|j�dd�S)Nrr)r�to_bytesrQrrrr3sz
UUID.bytescCs<|j}|ddd�|ddd�|ddd�|dd�S)Nrrrrr�r3)r1r3rrrr4s(
�z
UUID.bytes_lecCs|j|j|j|j|j|jfSrE)r7r8r9r:r;r<rQrrrr5 s
�zUUID.fieldscCs
|jd?S)NrrSrQrrrr7%sz
UUID.time_lowcCs|jd?d@S)Nr �rSrQrrrr8)sz
UUID.time_midcCs|jd?d@S)Nr!r_rSrQrrrr9-szUUID.time_hi_versioncCs|jd?d@S)N�8�rSrQrrrr:1szUUID.clock_seq_hi_variantcCs|jd?d@S)Nr"rarSrQrrrr;5szUUID.clock_seq_lowcCs|jd@d>|jd>B|jBS)N�r"r)r9r8r7rQrrr�time9s
��z	UUID.timecCs|jd@d>|jBS)N�?r)r:r;rQrrrr=>s�zUUID.clock_seqcCs
|jd@S)Nl���rSrQrrrr<Csz	UUID.nodecCs
d|jS)NrYrSrQrrrr2GszUUID.hexcCsdt|�S)Nz	urn:uuid:)rVrQrrr�urnKszUUID.urncCs2|jd@stS|jd@stS|jd@s*tStSdS)Nr%ll)r�RESERVED_NCS�RFC_4122�RESERVED_MICROSOFT�RESERVED_FUTURErQrrr�variantOs


zUUID.variantcCs |jtkrt|jd?d@�SdS)Nr&�)rjrgrrQrrrr6Zs
zUUID.version)NNNNNN)#rrr	�	__slots__rr
r>rBrDrKrLrMrNrOrRrTrWr0r\�propertyr3r4r5r7r8r9r:r;rcr=r<r2rerjr6rrrrr
Nsb4��V














r
c	Gs�ddl}ddl}ddl}|�|�}|dkrP|j�d�}|j||d�}|dkrPdSt|j�}d|d<|j|f||j	|j
|d�}|S)Nr)z/sbinz	/usr/sbin)�path�C�LC_ALL)�stdout�stderr�env)�os�shutil�
subprocessZwhich�pathsep�join�dict�environ�Popen�PIPEZDEVNULL)	�command�argsrtrurv�
executablernrs�procrrr�_popen`s

�r�cCs
|d@S)Nlr��macrrr�
_is_universal�sr�cCs�d}z�t|f|����}|s"WdS|��|jD]�}|������}tt|��D]x}|||krNzN|||�}	t|	�dd�d�}
t	|
�r�|
WW5QR�WS|p�|
}WqNt
tfk
r�YqNXqNq.W5QRXWntk
r�YnX|p�dS)N�:�r)
r��splitrq�lower�rstrip�ranger+rr)r�r,�
IndexError�OSError)r}r~Zhw_identifiersZ	get_index�first_local_macr��line�words�i�wordr�rrr�	_find_mac�s*
r�cCs4d}dD]&}td||dd��}|r*|SdSdS)N)shwaddrsethersaddress:slladdr)rz-az-avZifconfigcSs|dS�Nr#r�r�rrr�<lambda>�r�z#_ifconfig_getnode.<locals>.<lambda>�r�)�keywordsr~r�rrr�_ifconfig_getnode�sr�cCs tdddgdd��}|r|SdS)NZip�links
link/ethercSs|dSr�rr�rrrr��r�z_ip_getnode.<locals>.<lambda>r�r�rrr�_ip_getnode�sr�cCs�ddl}ddl}z|�|���}Wntk
r8YdSXtdd|�|�gdd��}|r\|Stdd|�|�gdd��}|r~|Stdd|�d|�gdd��}|r�|SdS)	NrZarpz-ancSsdS)Nrrr�rrrr��r�z_arp_getnode.<locals>.<lambda>cSs|dSr�rr�rrrr��r�z(%s)cSs|dS)N�rr�rrrr��r�)rt�socketZ
gethostbynameZgethostnamer�r��fsencode)rtr�Zip_addrr�rrr�_arp_getnode�s"�r�cCstdddgdd��S)NZlanscanz-aislan0cSsdS)Nrrr�rrrr��r�z"_lanscan_getnode.<locals>.<lambda>r�rrrr�_lanscan_getnode�sr�cCs&d}�z�tdd�}|sWdS|��|j������}z|�d�}Wn"tk
rdYW5QR�WdSX|jD]�}zl|����}||}t|�dkr�|�d�dkr�t	|�
dd�d�}t|�r�|WW5QR�WS|p�|}Wqlttfk
r�YqlXqlW5QRXWnt
k
�rYnX|�p$dS)	NZnetstatz-iasAddress�r�rr�r)r�rq�readliner�r��indexr,r+r'rr)r�r�r�)r�r�r�r�r�r�r�rrr�_netstat_getnode�s2

r�cCs<ddl}ddl}ddl}d}dddg}z:ddl}|�d�}|jj�|d�|�d|j	�
d��WnYnX|D]�}z$|j|j�
|d�dg|jd	d
�}Wntk
r�YqrYnX|�r|jD]d}	|	�d�d����}
|�d
|
�r�t|
�dd�d�}t|��r|W5QR�S|�p"|}q�W5QRXqr|�p:dS)Nrrzc:\windows\system32zc:\winnt\system32i,�mbcsZipconfigz/allZoem)rq�encoding�:rz((?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]rr)rt�rerv�ctypes�create_string_buffer�windllZkernel32ZGetSystemDirectoryA�insertr@�decoder{rnrxr|r�rqr�r*r��	fullmatchrr)r�)rtr�rvr��dirsr��buffer�dirr�r�r@r�rrr�_ipconfig_getnode�s6

�



r�c	Cs6ddl}ddl}d}|��}|j|_|��|_}|��|�|�dkrLdS|�	�t
|j�D]�}|��|j
|_t|j|�|_|�|�dkr�q^|��|j|_t|j|�|_d�d�|_|��|_}|�|�dkr�q^|�	�|jdd�}t|�dk�rq^t�|d�}t|��r |S|�p(|}q^|�p4dS)Nr�*rrr)�	win32wnet�netbiosZNCBZNCBENUMZCommandZ	LANA_ENUMZBufferZ_packZNetbiosZ_unpackr�ZlengthZResetZNCBRESET�ordZlanaZLana_numZNCBASTAT�ljustZCallnameZADAPTER_STATUSZadapter_addressr+rr.r�)	r�r�r�ZncbZadaptersr�Zstatusr3r�rrr�_netbios_getnodes>
r�c
s�tdk	rdSdatjdkr8tt��j�d�d�dkr8ntdk	rPtj	a
tjadSz�ddl�ddl
�dg}tj�d�s~|�d�|D]�}z���j�|��}Wntk
r�Yq�YnXt|d	�r�|j���fd
d�a
da�qq�t|d
�r�|j�d�_��fdd�a
�qq�z�jj}Wnd}YnXt|dt|dd��aWn>tk
�r~}zddl}|�d|��t�W5d}~XYnXdS)NFr�.r�	Zuuid�win�c�uuid_generate_time_safecs ��d�}�|�}t|j�|fS�Nr�r�r3�raw)�_buffer�res)�_uuid_generate_time_safer�rr�_generate_time_safehs
r�T�uuid_generate_timecs ��d�}�|�t|j�dfSr�r�)r�)�_uuid_generate_timer�rrr�ss
ZUuidCreateSequentialZ
UuidCreatez/Could not find fallback ctypes uuid functions: )�_has_uuid_generate_time_safe�sys�platformrrt�uname�releaser��_uuidZgenerate_time_safer�Zhas_uuid_generate_time_safer�Zctypes.util�
startswith�appendZCDLL�utilZfind_library�	Exception�hasattrr�r�Zrestyper�Zrpcrt4�getattr�_UuidCreate�warnings�warn�
ImportWarning)Z	_libnamesZlibname�lib�excr�r)r�r�r�r�_load_system_functions:sT&






��r�cCst�t�\}}t|d�jS)Nr^)r�r�r
r<)�	uuid_time�_rrr�
_unix_getnode�s
r�cCs:ddl}t�|�d�}t|�dkr6tt|j�d�jSdS)Nrrr^)r�r�r�r�r
�bytes_r�r<)r�r�rrr�_windll_getnode�s

r�cCsddl}|�d�dBS)Nrr"l)�random�getrandbits)r�rrr�_random_getnode�sr�rr�posix�nt)�getterscCsdtdk	rtSttgD]H}z
|�aWnYqYnXtdk	rdtkrRdkrnqtSqdS)Nrr)�_node�_GETTERSr�)r��getterrrr�getnode�s	

 
r�cCst�tdk	rd||kr"dkrdnn>t�\}}zt|�}Wntk
rVtj}YnXt||d�Sddl}|��}|dd}tdk	r�|tkr�td}|a|dkr�ddl	}|�
d�}|d@}	|d?d	@}
|d
?d@}|d@}|d
?d@}
|dkr�t�}t|	|
||
||fdd�S)N)r3rr�dl@'Hw�
r#�l��rr_r"rbrarrd)r5r6)r�r�rr,r
r
rc�time_ns�_last_timestampr�r�r�)r<r=r�Zsafely_generatedrrcZnanosecondsZ	timestampr�r7r8r9r;r:rrr�uuid1�s> 

��r�cCs<ddlm}||jt|d�dd���}t|dd�dd�S)	Nr)�md5�utf-8F)Zusedforsecurityrr�r3r6)�hashlibr�r3�digestr
)�	namespacerXr�r�rrr�uuid3s�
r�cCstt�d�dd�S)Nrrr�)r
rt�urandomrrrr�uuid4sr�cCs8ddlm}||jt|d����}t|dd�dd�S)Nr)�sha1r�rrr�)r�r�r3r�r
)r�rXr�rPrrr�uuid5sr�z$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8)NN)5rtr��enumr�
__author__r�Z_AIXZ_LINUX�systemZ_platform_systemrfrgrhrirr-r3r�rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r��ImportErrorr�r�r�r�Z_OS_GETTERSrXr�r�r�r�r�r�r�r�Z
NAMESPACE_DNSZ
NAMESPACE_URLZ
NAMESPACE_OIDZNAMESPACE_X500rrrr�<module>/s�

�"
$
T

�
'	ipaddress.cpython-38.opt-2.pyc000064400000106453151450073350012126 0ustar00U

e5d��@s�dZddlZdZdZGdd�de�ZGdd�de�Zd	d
�Zd<dd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�ZGd"d#�d#�ZejGd$d%�d%e��ZejGd&d'�d'e��ZGd(d)�d)�ZGd*d+�d+ee�ZGd,d-�d-e�ZGd.d/�d/ee�ZGd0d1�d1�Zee_Gd2d3�d3�ZGd4d5�d5ee�ZGd6d7�d7e�ZGd8d9�d9ee�Z Gd:d;�d;�Z!e!e_dS)=z1.0�N� �c@seZdZdS)�AddressValueErrorN��__name__�
__module__�__qualname__�r	r	�!/usr/lib64/python3.8/ipaddress.pyrsrc@seZdZdS)�NetmaskValueErrorNrr	r	r	r
rsrc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)Nz0%r does not appear to be an IPv4 or IPv6 address)�IPv4Addressrr�IPv6Address�
ValueError��addressr	r	r
�
ip_addresss

�rTc	Cs\zt||�WSttfk
r$YnXzt||�WSttfk
rJYnXtd|��dS)Nz0%r does not appear to be an IPv4 or IPv6 network)�IPv4Networkrr�IPv6Networkr)r�strictr	r	r
�
ip_network9s�rc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)Nz2%r does not appear to be an IPv4 or IPv6 interface)�
IPv4Interfacerr�
IPv6Interfacerrr	r	r
�ip_interfaceWs

�rcCs0z|�dd�WStk
r*td��YnXdS)N��bigz&Address negative or too large for IPv4��to_bytes�
OverflowErrorrrr	r	r
�v4_int_to_packedzsrcCs0z|�dd�WStk
r*td��YnXdS)N�rz&Address negative or too large for IPv6rrr	r	r
�v6_int_to_packed�s
r cCs*t|��d�}t|�dkr&td|��|S)N�/�zOnly one '/' permitted in %r)�str�split�lenr)r�addrr	r	r
�_split_optional_netmask�sr'ccsNt|�}t|�}}|D]&}|j|jdkr:||fV|}|}q||fVdS�N�)�iter�next�_ip)�	addresses�it�first�last�ipr	r	r
�_find_address_range�s

r2cCs$|dkr|St|||d@���S)Nrr))�min�
bit_length)Znumber�bitsr	r	r
�_count_righthand_zero_bits�sr6ccs�t|t�rt|t�std��|j|jkr8td||f��||krHtd��|jdkrXt}n|jdkrht}ntd��|j}|j}|j}||kr�t	t
||�||d��d�}||||f�}|V|d|>7}|d|jkr�q�q�dS)Nz1first and last must be IP addresses, not networks�%%s and %s are not of the same versionz*last IP address must be greater than firstr�zunknown IP versionr))
�
isinstance�_BaseAddress�	TypeError�versionrrr�_max_prefixlenr,r3r6r4�	_ALL_ONES)r/r0r1Zip_bitsZ	first_intZlast_intZnbits�netr	r	r
�summarize_address_range�s8
��


�r@ccs�t|�}i}|rV|��}|��}|�|�}|dkr<|||<q||kr||=|�|�qd}t|���D]$}|dk	r�|j|jkr�qf|V|}qfdS�N)�list�pop�supernet�get�append�sorted�values�broadcast_address)r-Zto_merge�subnetsr?rDZexistingr0r	r	r
�_collapse_addresses_internals$

rKc	Cs0g}g}g}|D]�}t|t�rR|rF|dj|jkrFtd||df��|�|�q|j|jkr�|r�|dj|jkr�td||df��z|�|j�Wq�tk
r�|�|j	�Yq�Xq|r�|dj|jkr�td||df��|�|�qt
t|��}|�r$t|�D]\}}|�
t||���qt||�S)N���r7)r9r:�_versionr;rF�
_prefixlenr=r1�AttributeError�network_addressrG�setr2�extendr@rK)r-ZaddrsZipsZnetsr1r/r0r	r	r
�collapse_addresses2s@
���rScCs(t|t�r|��St|t�r$|��StSrA)r9�_BaseNetwork�_get_networks_keyr:�_get_address_key�NotImplemented)�objr	r	r
�get_mixed_type_keyhs


rYc@s�eZdZdZedd��Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
edd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zdd�ZdS)�_IPAddressBaser	cCs|��SrA)�_explode_shorthand_ip_string��selfr	r	r
�exploded�sz_IPAddressBase.explodedcCst|�SrA�r#r\r	r	r
�
compressed�sz_IPAddressBase.compressedcCs|��SrA)�_reverse_pointerr\r	r	r
�reverse_pointer�s	z_IPAddressBase.reverse_pointercCsdt|�f}t|��dS)Nz%200s has no version specified��type�NotImplementedError�r]�msgr	r	r
r<�sz_IPAddressBase.versioncCsF|dkrd}t|||jf��||jkrBd}t|||j|jf��dS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrMr>r=)r]rrgr	r	r
�_check_int_address�s

�z!_IPAddressBase._check_int_addresscCs.t|�}||kr*d}t|||||jf��dS)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r%rrM)r]rZexpected_lenZaddress_lenrgr	r	r
�_check_packed_address�s�z$_IPAddressBase._check_packed_addresscCs|j|j|?ASrA)r>)�cls�	prefixlenr	r	r
�_ip_int_from_prefix�sz"_IPAddressBase._ip_int_from_prefixc	Cs\t||j�}|j|}||?}d|>d}||krX|jd}|�|d�}d}t||��|S)Nr)�rz&Netmask pattern %r mixes zeroes & ones)r6r=rr)	rj�ip_intZtrailing_zeroesrkZleading_onesZall_onesZbyteslenZdetailsrgr	r	r
�_prefix_from_ip_int�s
�

z"_IPAddressBase._prefix_from_ip_intcCsd|}t|�d�dS)Nz%r is not a valid netmask)r)rjZnetmask_strrgr	r	r
�_report_invalid_netmask�sz&_IPAddressBase._report_invalid_netmaskcCsl|��r|��s|�|�zt|�}Wntk
rD|�|�YnXd|kr\|jkshn|�|�|S�Nr)�isascii�isdigitrp�intrr=)rjZ
prefixlen_strrkr	r	r
�_prefix_from_prefix_string�s

z)_IPAddressBase._prefix_from_prefix_stringcCs�z|�|�}Wntk
r,|�|�YnXz|�|�WStk
rNYnX||jN}z|�|�WStk
r�|�|�YnXdSrA)�_ip_int_from_stringrrprorr>)rj�ip_strrnr	r	r
�_prefix_from_ip_string�s
z%_IPAddressBase._prefix_from_ip_stringcCsHt|ttf�r||jfSt|t�s*t|�}t|�dkr:|S|d|jfS)Nr)r)r9�bytesrtr=�tupler'r%)rjrr	r	r
�_split_addr_prefixs

z!_IPAddressBase._split_addr_prefixcCs|jt|�ffSrA)�	__class__r#r\r	r	r
�
__reduce__/sz_IPAddressBase.__reduce__N)rrr�	__slots__�propertyr^r`rbr<rhri�classmethodrlrorprurxr{r}r	r	r	r
rZ�s0




	




!
rZc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)r:r	cCs|jSrA�r,r\r	r	r
�__int__>sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk
r2tYSXdSrA)r,rMrOrW�r]�otherr	r	r
�__eq__As
�z_BaseAddress.__eq__cCsFt|t�stS|j|jkr*td||f��|j|jkrB|j|jkSdS�Nr7F)r9r:rWrMr;r,r�r	r	r
�__lt__Hs
�z_BaseAddress.__lt__cCs t|t�stS|�t|�|�SrA�r9rtrWr|r�r	r	r
�__add__Ts
z_BaseAddress.__add__cCs t|t�stS|�t|�|�SrAr�r�r	r	r
�__sub__Ys
z_BaseAddress.__sub__cCsd|jjt|�fS�Nz%s(%r)�r|rr#r\r	r	r
�__repr__^sz_BaseAddress.__repr__cCst|�|j��SrA)r#�_string_from_ip_intr,r\r	r	r
�__str__asz_BaseAddress.__str__cCsttt|j���SrA)�hash�hexrtr,r\r	r	r
�__hash__dsz_BaseAddress.__hash__cCs
|j|fSrA�rMr\r	r	r
rVgsz_BaseAddress._get_address_keycCs|j|jffSrA)r|r,r\r	r	r
r}jsz_BaseAddress.__reduce__N)rrrr~r�r�r�r�r�r�r�r�rVr}r	r	r	r
r:3s	r:c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
jdd��Ze
jdd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zd%d&�Zd'd(�Zd)d*�ZdEd-d.�ZdFd/d0�Zed1d2��Zed3d4��Zd5d6�Z d7d8�Z!ed9d:��Z"ed;d<��Z#ed=d>��Z$ed?d@��Z%edAdB��Z&edCdD��Z'd,S)GrTcCsd|jjt|�fSr�r�r\r	r	r
r�vsz_BaseNetwork.__repr__cCsd|j|jfS�N�%s/%d)rPrkr\r	r	r
r�ysz_BaseNetwork.__str__ccs8t|j�}t|j�}t|d|�D]}|�|�Vq"dSr(�rtrPrI�range�_address_class�r]�network�	broadcast�xr	r	r
�hosts|s

z_BaseNetwork.hostsccs8t|j�}t|j�}t||d�D]}|�|�Vq"dSr(r�r�r	r	r
�__iter__�s

z_BaseNetwork.__iter__cCslt|j�}t|j�}|dkr>|||kr0td��|�||�S|d7}|||krZtd��|�||�SdS)Nrzaddress out of ranger))rtrPrI�
IndexErrorr�)r]�nr�r�r	r	r
�__getitem__�s

z_BaseNetwork.__getitem__cCs^t|t�stS|j|jkr*td||f��|j|jkrB|j|jkS|j|jkrZ|j|jkSdSr�)r9rTrWrMr;rP�netmaskr�r	r	r
r��s
�z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|j�t|j�kWStk
rFtYSXdSrA)rMrPrtr�rOrWr�r	r	r
r��s
��z_BaseNetwork.__eq__cCstt|j�t|j�A�SrA)r�rtrPr�r\r	r	r
r��sz_BaseNetwork.__hash__cCs8|j|jkrdSt|t�rdS|j|jj@|jjkSdS�NF)rMr9rTr,r�rPr�r	r	r
�__contains__�s

z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kSrA)rPrIr�r	r	r
�overlaps�s



�z_BaseNetwork.overlapscCs|�t|j�t|j�B�SrA)r�rtrP�hostmaskr\r	r	r
rI�s�z_BaseNetwork.broadcast_addresscCs|�t|j�|jA�SrA)r�rtr�r>r\r	r	r
r��sz_BaseNetwork.hostmaskcCsd|j|jfSr�)rPrNr\r	r	r
�with_prefixlen�sz_BaseNetwork.with_prefixlencCsd|j|jfS�N�%s/%s)rPr�r\r	r	r
�with_netmask�sz_BaseNetwork.with_netmaskcCsd|j|jfSr�)rPr�r\r	r	r
�
with_hostmask�sz_BaseNetwork.with_hostmaskcCst|j�t|j�dSr()rtrIrPr\r	r	r
�
num_addresses�sz_BaseNetwork.num_addressescCsdt|�f}t|��dS)Nz%%200s has no associated address classrcrfr	r	r
r��sz_BaseNetwork._address_classcCs|jSrA)rNr\r	r	r
rk�sz_BaseNetwork.prefixlenccs|j|jkstd||f��t|t�s2td|��|�|�sLtd||f��||krXdS|�d|j|jf�}|�	�\}}||kr�||kr�|�|�r�|V|�	�\}}qz|�|�r�|V|�	�\}}qzt
d|||f��qz||kr�|Vn"||kr�|Vnt
d|||f��dS)Nr7z%s is not a network objectz%s not contained in %sr�z3Error performing exclusion: s1: %s s2: %s other: %s)rMr;r9rT�	subnet_ofrr|rPrkrJ�AssertionError)r]r��s1�s2r	r	r
�address_exclude�s@$�


�

��z_BaseNetwork.address_excludecCs`|j|jkrtd||f��|j|jkr,dS|j|jkr<dS|j|jkrLdS|j|jkr\dSdS)Nz"%s and %s are not of the same typerLr)r)rMr;rPr�r�r	r	r
�compare_networks6s!�z_BaseNetwork.compare_networkscCs|j|j|jfSrA)rMrPr�r\r	r	r
rUfsz_BaseNetwork._get_networks_keyr)Nc	cs�|j|jkr|VdS|dk	rJ||jkr0td��|dkr@td��||j}|dkrZtd��|j|}||jkr~td||f��t|j�}t|j�d}t|j�d|?}t|||�D]}|�||f�}|Vq�dS)Nznew prefix must be longerr)�(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s)	rNr=rrtrPrIr�r�r|)	r]�prefixlen_diff�
new_prefix�
new_prefixlen�start�end�stepZnew_addrZcurrentr	r	r
rJps2



��
z_BaseNetwork.subnetscCs�|jdkr|S|dk	rB||jkr(td��|dkr8td��|j|}|j|}|dkrftd|j|f��|�t|j�t|j�|>@|f�S)Nrznew prefix must be shorterr)r�z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rNrrkr|rtrPr�)r]r�r�r�r	r	r
rD�s&



���z_BaseNetwork.supernetcCs|jjo|jjSrA)rP�is_multicastrIr\r	r	r
r��s	�z_BaseNetwork.is_multicastcCshz:|j|jkr"t|�d|�d���|j|jko8|j|jkWStk
rbtd|�d|����YnXdS)Nz and z are not of the same versionz*Unable to test subnet containment between )rMr;rPrIrO)�a�br	r	r
�
_is_subnet_of�s
�z_BaseNetwork._is_subnet_ofcCs|�||�SrA�r�r�r	r	r
r��sz_BaseNetwork.subnet_ofcCs|�||�SrAr�r�r	r	r
�supernet_of�sz_BaseNetwork.supernet_ofcCs|jjo|jjSrA)rP�is_reservedrIr\r	r	r
r��s	�z_BaseNetwork.is_reservedcCs|jjo|jjSrA)rP�
is_link_localrIr\r	r	r
r��s�z_BaseNetwork.is_link_localcCs|jjo|jjSrA)rP�
is_privaterIr\r	r	r
r�s	�z_BaseNetwork.is_privatecCs|jSrA�r�r\r	r	r
�	is_globals	z_BaseNetwork.is_globalcCs|jjo|jjSrA)rP�is_unspecifiedrIr\r	r	r
r�s	�z_BaseNetwork.is_unspecifiedcCs|jjo|jjSrA)rP�is_loopbackrIr\r	r	r
r�(s	�z_BaseNetwork.is_loopback)r)N)r)N)(rrrr�r�r�r�r�r�r�r�r�r��	functools�cached_propertyrIr�rr�r�r�r�r�rkr�r�rUrJrDr��staticmethodr�r�r�r�r�r�r�r�r�r	r	r	r
rTnsb








K0

5
)








rTc@s�eZdZdZdZdedZeZiZdd�Z	e
dd��Ze
d	d
��Ze
dd��Z
e
d
d��Zdd�Zedd��Zedd��ZdS)�_BaseV4r	rr"r)cCst|�SrAr_r\r	r	r
r[Hsz$_BaseV4._explode_shorthand_ip_stringcCs�||jkr�t|t�r<|}d|kr.|jksjn|�|�n.z|�|�}Wntk
rh|�|�}YnXt|�	|��}||f|j|<|j|Srq)
�_netmask_cacher9rtr=rprurrxrrl�rj�argrkr�r	r	r
�
_make_netmaskKs	

z_BaseV4._make_netmaskc
Cs~|std��|�d�}t|�dkr.td|��zt�t|j|�d�WStk
rx}ztd||f�d�W5d}~XYnXdS)N�Address cannot be empty�.rzExpected 4 octets in %rr�%s in %r)rr$r%rt�
from_bytes�map�_parse_octetr)rjrwZoctets�excr	r	r
rves
z_BaseV4._ip_int_from_stringcCs�|std��|��r|��s,d}t||��t|�dkrHd}t||��|dkrl|ddkrld}t||��t|d�}|d	kr�td
|��|S)NzEmpty octet not permittedz#Only decimal digits permitted in %r�z$At most 3 characters permitted in %r�0rz%Leading zeros are not permitted in %r�
�zOctet %d (> 255) not permitted)rrrrsr%rt)rjZ	octet_strrgZ	octet_intr	r	r
r�s
z_BaseV4._parse_octetcCsd�tt|�dd���S)Nr�rr)�joinr�r#r)rjrnr	r	r
r��sz_BaseV4._string_from_ip_intcCs&t|��d�ddd�}d�|�dS)Nr�rLz
.in-addr.arpa)r#r$r�)r]Zreverse_octetsr	r	r
ra�sz_BaseV4._reverse_pointercCs|jSrA�r=r\r	r	r
�
max_prefixlen�sz_BaseV4.max_prefixlencCs|jSrAr�r\r	r	r
r<�sz_BaseV4.versionN)rrrr~rM�
IPV4LENGTHr>r=r�r[r�r�rvr�r�rarr�r<r	r	r	r
r�5s&	


#
	
r�c@s�eZdZdZdd�Zedd��Zedd��Zee�	�dd	���Z
ee�	�d
d���Zedd
��Zedd��Z
edd��Zedd��ZdS)r�r,�__weakref__cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)Nrrr!�Unexpected '/' in %r�
r9rtrhr,ryrir�r#rrv�r]rZaddr_strr	r	r
�__init__�s


zIPv4Address.__init__cCs
t|j�SrA)rr,r\r	r	r
�packed�szIPv4Address.packedcCs||jjkSrA)�
_constants�_reserved_networkr\r	r	r
r��s	zIPv4Address.is_reservedcst�fdd��jjD��S)Nc3s|]}�|kVqdSrAr	��.0r?r\r	r
�	<genexpr>sz)IPv4Address.is_private.<locals>.<genexpr>��anyr��_private_networksr\r	r\r
r��s
zIPv4Address.is_privatecCs||jjko|jSrA)r��_public_networkr�r\r	r	r
r�szIPv4Address.is_globalcCs||jjkSrA�r��_multicast_networkr\r	r	r
r�s	zIPv4Address.is_multicastcCs||jjkSrA)r��_unspecified_addressr\r	r	r
r�s	zIPv4Address.is_unspecifiedcCs||jjkSrA)r��_loopback_networkr\r	r	r
r�"szIPv4Address.is_loopbackcCs||jjkSrA�r��_linklocal_networkr\r	r	r
r�,szIPv4Address.is_link_localN)rrrr~r�rr�r�r��	lru_cacher�r�r�r�r�r�r	r	r	r
r�s(#








	rc@sxeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dS�NF)r)r{rr�rr�r�rN�r]rr&�maskr	r	r
r�9s

zIPv4Interface.__init__cCs|jjSrA�r�r�r\r	r	r
r�AszIPv4Interface.hostmaskcCsd|�|j�|jfSr��r�r,rNr\r	r	r
r�Es�zIPv4Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)rr�rWr�rO�r]r�Z
address_equalr	r	r
r�IszIPv4Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)rr�rWr�rO�r]r�Zaddress_lessr	r	r
r�Us�zIPv4Interface.__lt__cCst|j|jt|jj�f�SrA�r�r,rNrtr�rPr\r	r	r
r�aszIPv4Interface.__hash__cCs
t|j�SrA)rr,r\r	r	r
r1fszIPv4Interface.ipcCsd|�|j�|jfSr�r�r\r	r	r
r�js�zIPv4Interface.with_prefixlencCsd|�|j�|jfSr��r�r,r�r\r	r	r
r�os�zIPv4Interface.with_netmaskcCsd|�|j�|jfSr��r�r,r�r\r	r	r
r�ts�zIPv4Interface.with_hostmaskN)rrrr�r�r�r�r�r�r�r�rZr}rr1r�r�r�r	r	r	r
r7s 



rc@s.eZdZeZddd�Zee��dd���Z	dS)rTcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)N�%s has host bits setr)cs
t��gSrA)rr	�r&r	r
�<lambda>��z&IPv4Network.__init__.<locals>.<lambda>)r{rrPr�r�rNrtrr=r�r��r]rrr�r�r	rr
r��s#

�
zIPv4Network.__init__cCs&|jtd�ko|jtd�ko$|jS)N�
100.64.0.0/10)rPrrIr�r\r	r	r
r��s

��zIPv4Network.is_globalN)T)
rrrrr�r�rr�r�r�r	r	r	r
rzs


4rc@s�eZdZed�Zed�Zed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�ed
�ed�ed�ed�gZed�Z	e
d�ZdS)�_IPv4Constantsz169.254.0.0/16z127.0.0.0/8z224.0.0.0/4rz	0.0.0.0/8z
10.0.0.0/8z
172.16.0.0/12z192.0.0.0/29z192.0.0.170/31z192.0.2.0/24z192.168.0.0/16z
198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z240.0.0.0/4z255.255.255.255/32z0.0.0.0N)rrrrr�r�r�r�r�r�rr�r	r	r	r
r�s*�rc@s�eZdZdZdZdedZdZed�Z	eZ
iZedd��Z
ed	d
��Zedd��Zed
d��Zeddd��Zdd�Zdd�Zedd��Zedd��ZdS)�_BaseV6r	r8r"r)rmZ0123456789ABCDEFabcdefcCsl||jkrbt|t�r<|}d|kr.|jksFn|�|�n
|�|�}t|�|��}||f|j|<|j|Srq)r�r9rtr=rprur
rlr�r	r	r
r�s	


z_BaseV6._make_netmaskc
Cs�|std��|�d�}d}t|�|kr:d||f}t|��d|dkr�zt|���j}Wn4tk
r�}ztd||f�d�W5d}~XYnX|�d|d	?d
@�|�d|d
@�|jd}t|�|kr�d|d|f}t|��d}tdt|�d�D]*}	||	s�|dk	�r d
|}t|��|	}q�|dk	�r�|}
t|�|d}|d�sl|
d8}
|
�rld}t||��|d�s�|d8}|�r�d}t||��|j|
|}|dk�r2d}t||jd|f��njt|�|jk�r�d}t||j|f��|d�sd}t||��|d�s"d}t||��t|�}
d}d}znd}
t|
�D] }	|
d	K}
|
|�	||	�O}
�q@|
d	|K}
t|d�D] }	|
d	K}
|
|�	||	�O}
�qz|
WSt
k
�r�}ztd||f�d�W5d}~XYnXdS)Nr��:r�z At least %d parts expected in %rr�rLr��%xr�r)z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r)rr$r%rrCr,rF�
_HEXTET_COUNTr��
_parse_hextetr)rjrw�partsZ
_min_partsrgZipv4_intr�Z
_max_partsZ
skip_index�iZparts_hiZparts_loZ
parts_skippedrnr	r	r
rvs�
$







z_BaseV6._ip_int_from_stringcCs>|j�|�std|��t|�dkr4d}t||��t|d�S)NzOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr)�_HEX_DIGITS�
issupersetrr%rt)rjZ
hextet_strrgr	r	r
r~sz_BaseV6._parse_hextetc	Cs�d}d}d}d}t|�D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr�||}|t|�kr~|dg7}dg|||�<|dkr�dg|}|S)NrLrr�r)�)�	enumerater%)	rj�hextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_len�indexZhextetZbest_doublecolon_endr	r	r
�_compress_hextets�s0�

z_BaseV6._compress_hextetsNcsZ|dkrt|j�}||jkr$td��d|��fdd�tddd�D�}|�|�}d�|�S)	NzIPv6 address is too large�%032xcs&g|]}dt�||d�d��qS)rrr)rt�r�r��Zhex_strr	r
�
<listcomp>�sz/_BaseV6._string_from_ip_int.<locals>.<listcomp>rrrr)rtr,r>rr�rr�)rjrnrr	rr
r��s


z_BaseV6._string_from_ip_intcs�t|t�rt|j�}nt|t�r,t|j�}nt|�}|�|�}d|��fdd�tddd�D�}t|ttf�r�dd�	|�|j
fSd�	|�S)	Nrcsg|]}�||d��qS)rr	rrr	r
r�sz8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>rrrr�r)r9rr#rPrr1rvr�rTr�rN)r]rwrnrr	rr
r[�s



z$_BaseV6._explode_shorthand_ip_stringcCs&|jddd��dd�}d�|�dS)NrLrrr�z	.ip6.arpa)r^�replacer�)r]Z
reverse_charsr	r	r
ra�sz_BaseV6._reverse_pointercCs|jSrAr�r\r	r	r
r�sz_BaseV6.max_prefixlencCs|jSrAr�r\r	r	r
r<sz_BaseV6.version)N)rrrr~rM�
IPV6LENGTHr>r
�	frozensetrr=r�r�r�rvrrr�r[rarr�r<r	r	r	r
r�s.	

g

/	
rc@s�eZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
ee��dd���Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)r
r�cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)Nrrr!r�r�r�r	r	r
r�s


zIPv6Address.__init__cCs
t|j�SrA)r r,r\r	r	r
r�6szIPv6Address.packedcCs||jjkSrAr�r\r	r	r
r�;s	zIPv6Address.is_multicastcst�fdd��jjD��S)Nc3s|]}�|kVqdSrAr	rr\r	r
r�Osz*IPv6Address.is_reserved.<locals>.<genexpr>)r�r��_reserved_networksr\r	r\r
r�Fs	zIPv6Address.is_reservedcCs||jjkSrAr�r\r	r	r
r�QszIPv6Address.is_link_localcCs||jjkSrA)r��_sitelocal_networkr\r	r	r
�
is_site_local[szIPv6Address.is_site_localcst�fdd��jjD��S)Nc3s|]}�|kVqdSrAr	r�r\r	r
r�ssz)IPv6Address.is_private.<locals>.<genexpr>r�r\r	r\r
r�is
zIPv6Address.is_privatecCs|jSrAr�r\r	r	r
r�us	zIPv6Address.is_globalcCs
|jdkSrqr�r\r	r	r
r��s	zIPv6Address.is_unspecifiedcCs
|jdkSr(r�r\r	r	r
r��s	zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@�S)Nrr	����r,rr\r	r	r
�ipv4_mapped�s	zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@�t|jd@�fS)N�`i �@rr r\r	r	r
�teredo�s

�zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@�S)N�pi �Prr r\r	r	r
�	sixtofour�s	zIPv6Address.sixtofourN)rrrr~r�rr�r�r�r�rr�r�r�r�r�r�r!r$r'r	r	r	r
r
s6$





	










r
c@s�eZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dSr�)r{r
r�rr�r�rNr�r	r	r
r��s

zIPv6Interface.__init__cCs|jjSrAr�r\r	r	r
r��szIPv6Interface.hostmaskcCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)r
r�rWr�rOr�r	r	r
r��szIPv6Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)r
r�rWr�rOr�r	r	r
r��s�zIPv6Interface.__lt__cCst|j|jt|jj�f�SrAr�r\r	r	r
r��szIPv6Interface.__hash__cCs
t|j�SrA)r
r,r\r	r	r
r1�szIPv6Interface.ipcCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.with_prefixlencCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.with_netmaskcCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.with_hostmaskcCs|jdko|jjSrq)r,r�r�r\r	r	r
r�szIPv6Interface.is_unspecifiedcCs|jdko|jjSr()r,r�r�r\r	r	r
r�szIPv6Interface.is_loopbackN)rrrr�r�r�r�r�r�r�r�rZr}rr1r�r�r�r�r�r	r	r	r
r�s(





rc@s.eZdZeZd	dd�Zdd�Zedd��ZdS)
rTcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)Nr�r)cs
t��gSrA)r
r	rr	r
rIrz&IPv6Network.__init__.<locals>.<lambda>)r{r
rPr�r�rNrtrr=r�r�rr	rr
r�s

�
zIPv6Network.__init__ccs<t|j�}t|j�}t|d|d�D]}|�|�Vq&dSr(r�r�r	r	r
r�Ks

zIPv6Network.hostscCs|jjo|jjSrA)rPrrIr\r	r	r
rWs�zIPv6Network.is_site_localN)T)	rrrr
r�r�r�rrr	r	r	r
rs

0rc@s�eZdZed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�g
Zed�ed
�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�gZed�ZdS)�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z100::/64z	2001::/23z2001:2::/48z
2001:db8::/32z2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)	rrrrr�r�r�rrr	r	r	r
r(gs<��r()T)"�__version__r�r�rrrrrrrrr r'r2r6r@rKrSrYrZ�total_orderingr:rTr�rrrrr�rr
rrr(r	r	r	r
�<module>sT
#7163:IuCR 5K\!dis.cpython-38.opt-1.pyc000064400000036702151450073350010725 0ustar00U

e5dZP�@sdZddlZddlZddlZddlZddlTddlmZddddd	d
ddd
ddgeZ[ejej	ej
eee
fZedZdedfedfedffZedZdZdd�ZdVddd�dd�ZdWdd�dd�Zdddd d!d"d#d$d%d&d'�
Zd(d)�Zd*d+�Zd,d�Zd-d.�Zdd�d/d�Ze� d0d1�Z!d2e!j"_d3e!j_d4e!j#_d5e!j$_d6e!j%_d7e!j&_d8e!j'_d9e!j(_d:Z)d;Z*Gd<d�de!�Z+dd=�d>d
�Z,d?d@�Z-dAdB�Z.dXdCdD�Z/dYdd�dFd�Z0ddd�dGdH�Z1dZdddI�dJdK�Z2dLdM�Z3e0Z4dNdO�Z5dPd�Z6dQd
�Z7GdRd�d�Z8dSdT�Z9e:dUk�re9�dS)[z0Disassembler of Python byte code into mnemonics.�N)�*)�__all__�	code_info�dis�disassemble�distb�disco�findlinestarts�
findlabels�	show_code�get_instructions�Instruction�Bytecode�FORMAT_VALUE)N��str�repr�ascii�
MAKE_FUNCTION)�defaultsZ
kwdefaultsZannotationsZclosurecCs6zt||d�}Wn tk
r0t||d�}YnX|S)z�Attempts to compile the given source, first as an expression and
       then as a statement if the first approach fails.

       Utility function to accept strings in functions that otherwise
       expect code objects
    �eval�exec)�compile�SyntaxError)�source�name�c�r�/usr/lib64/python3.8/dis.py�_try_compiles
r��file�depthcCsh|dkrt|d�dSt|d�r&|j}t|d�r8|j}n4t|d�rJ|j}n"t|d�r\|j}nt|d�rl|j}t|d�r�t|j�	��}|D]p\}}t
|t�r�td	||d�zt
|||d
�Wn0tk
r�}ztd||d�W5d}~XYnXt|d�q�nht|d��rt|||d
�nLt
|ttf��r6t||d�n.t
|t��rRt|||d
�ntd
t|�j��dS)a0Disassemble classes, methods, functions, and other compiled objects.

    With no argument, disassemble the last traceback.

    Compiled objects currently include generator objects, async generator
    objects, and coroutine objects, all of which store their code object
    in a special attribute.
    N�r!�__func__�__code__�gi_code�ag_code�cr_code�__dict__zDisassembly of %s:r zSorry:�co_code�(don't know how to disassemble %s objects)r�hasattrr$r%r&r'r(�sortedr)�items�
isinstance�
_have_code�printr�	TypeError�_disassemble_recursive�bytes�	bytearray�_disassemble_bytesr�_disassemble_str�type�__name__)�xr!r"r.rZx1�msgrrrr+s@	







 �r#cCsX|dkr@z
tj}Wntk
r0td�d�YnX|jr@|j}q2t|jj|j|d�dS)z2Disassemble a traceback (default: last traceback).Nz no last traceback to disassembler#)	�sys�last_traceback�AttributeError�RuntimeError�tb_nextr�tb_frame�f_code�tb_lasti)�tbr!rrrrXs
Z	OPTIMIZEDZ	NEWLOCALSZVARARGSZVARKEYWORDSZNESTEDZ	GENERATORZNOFREEZ	COROUTINEZITERABLE_COROUTINEZASYNC_GENERATOR)
������ �@��icCs`g}td�D]:}d|>}||@r|�t�|t|���||N}|sqVq|�t|��d�|�S)z+Return pretty representation of code flags.rJrE�, )�range�append�COMPILER_FLAG_NAMES�get�hex�join)�flags�names�i�flagrrr�pretty_flagsrsrYcCs�t|d�r|j}t|d�r"|j}n4t|d�r4|j}n"t|d�rF|j}nt|d�rV|j}t|t�rjt|d�}t|d�rx|St	dt
|�j��d	S)
zDHelper to handle methods, compiled or raw code objects, and strings.r$r%r&r'r(z
<disassembly>r*r+N)r,r$r%r&r'r(r/rrr2r8r9�r:rrr�_get_code_object�s"







�r[cCstt|��S)z1Formatted details of methods, functions, or code.)�_format_code_infor[rZrrrr�scCs�g}|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�dt|j	��|j
r�|�d	�t|j
�D]}|�d
|�q�|jr�|�d�t|j�D]}|�d|�q�|j
�r|�d
�t|j
�D]}|�d|��q|j�rH|�d�t|j�D]}|�d|��q2|j�rz|�d�t|j�D]}|�d|��qdd�|�S)NzName:              %szFilename:          %szArgument count:    %szPositional-only arguments: %szKw-only arguments: %szNumber of locals:  %szStack size:        %szFlags:             %sz
Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:�
)rP�co_name�co_filename�co_argcount�co_posonlyargcount�co_kwonlyargcount�
co_nlocals�co_stacksizerY�co_flags�	co_consts�	enumerate�co_names�co_varnames�co_freevars�co_cellvarsrT)�co�linesZi_cZi_nrrrr\�s<




r\cCstt|�|d�dS)z}Print details of methods, functions, or code to *file*.

    If *file* is not provided, the output is printed on stdout.
    r#N)r1r)rlr!rrrr�s�_InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetz!Human readable name for operationzNumeric code for operationz6Numeric argument to operation (if any), otherwise Nonez4Resolved arg value (if known), otherwise same as argz0Human readable description of operation argumentz1Start index of operation within bytecode sequencez4Line started by this opcode (if any), otherwise Nonez1True if other code jumps to here, otherwise False��c@seZdZdZddd�ZdS)	r
aKDetails for a bytecode operation

       Defined fields:
         opname - human readable name for operation
         opcode - numeric code for operation
         arg - numeric argument to operation (if any), otherwise None
         argval - resolved arg value (if known), otherwise same as arg
         argrepr - human readable description of operation argument
         offset - start index of operation within bytecode sequence
         starts_line - line started by this opcode (if any), otherwise None
         is_jump_target - True if other code jumps to here, otherwise False
    �FrGcCs�g}|r:|jdk	r,d|}|�||j�n|�d|�|rJ|�d�n
|�d�|jrf|�d�n
|�d�|�t|j��|��|�|j�t��|j	dk	r�|�t|j	��t
��|jr�|�d|jd	�d�|��
�S)
a%Format instruction details for inclusion in disassembly output

        *lineno_width* sets the width of the line number field (0 omits it)
        *mark_as_current* inserts a '-->' marker arrow as part of the line
        *offset_width* sets the width of the instruction offset field
        Nz%%%dd� z-->z   z>>z  �(�))�starts_linerP�is_jump_targetr�offset�rjust�opname�ljust�
_OPNAME_WIDTH�arg�_OPARG_WIDTH�argreprrT�rstrip)�self�lineno_widthZmark_as_current�offset_widthZfieldsZ
lineno_fmtrrr�_disassemble�s&



zInstruction._disassembleN)rqFrG)r9�
__module__�__qualname__�__doc__r�rrrrr
�s
)�
first_linecCsTt|�}|j|j}tt|��}|dk	r4||j}nd}t|j|j|j	|j
|||�S)a�Iterator for the opcodes in methods, functions or code

    Generates a series of Instruction named tuples giving the details of
    each operations in the supplied code.

    If *first_line* is not None, it indicates the line number that should
    be reported for the first source line in the disassembled code.
    Otherwise, the source line information (if any) is taken directly from
    the disassembled code object.
    Nr)r[rkrj�dictr	�co_firstlineno�_get_instructions_bytesr*rirhrf)r:r�rl�
cell_names�
linestarts�line_offsetrrrrs�cCs |}|dk	r||}|t|�fS)z�Helper to get optional details about const references

       Returns the dereferenced constant and its repr if the constant
       list is defined.
       Otherwise returns the constant index and its repr().
    N�r)Zconst_indexZ
const_list�argvalrrr�_get_const_infosr�cCs*|}|dk	r||}|}nt|�}||fS)z�Helper to get optional details about named references

       Returns the dereferenced name as both value and repr if the name
       list is defined.
       Otherwise returns the name index and its repr().
    Nr�)Z
name_indexZ	name_listr�r~rrr�_get_name_info'sr�c
#s�t|�}d}t|�D�]r\}	}
�|dk	rD|�|	d�}|dk	rD||7}|	|k}d}d}
�dk	�rl�}|
tkrzt�|�\}}
n�|
tkr�t�|�\}}
n�|
tkr�|	d�}dt|�}
n�|
t	kr�t�|�\}}
n�|
t
kr�t�}|}
n�|
tkr�t�|�\}}
nr|
t
k�rFt�d@\}}
|t�d@�f}|d�rl|
�r<|
d7}
|
d	7}
n&|
tk�rld��fd
d�tt�D��}
tt|
|
�||
|	||�VqdS)a&Iterate over the instructions in a bytecode string.

    Generates a sequence of Instruction namedtuples giving the details of each
    opcode.  Additional information about the code's runtime environment
    (e.g. variable names, constants) can be specified using optional
    arguments.

    NrrFzto rqrGrErNzwith formatc3s"|]\}}�d|>@r|VqdS)rENr)�.0rW�s�r|rr�	<genexpr>gs�z*_get_instructions_bytes.<locals>.<genexpr>)r
�_unpack_opargsrRZhasconstr�Zhasnamer��hasjrelrZhaslocalZ
hascompareZcmp_opZhasfreer�FORMAT_VALUE_CONVERTERS�boolrrTrg�MAKE_FUNCTION_FLAGSr
ry)�code�varnamesrV�	constants�cellsr�r��labelsrurw�oprvr�r~rr�rr�7sV






�r����c
Cs<|j|j}tt|��}t|j||j|j|j|||d�dS)zDisassemble a code object.r#N)	rkrjr�r	r6r*rirhrf)rl�lastir!r�r�rrrrms�cCspt||d�|dks|dkrl|dk	r,|d}|jD]8}t|d�r2t|d�td|f|d�t|||d�q2dS)Nr#rrEr*zDisassembly of %r:r )rrfr,r1r3)rlr!r"r:rrrr3ts


r3)r!r�c	Cs�|dk	}	|	r8t|���|}
|
dkr2tt|
��}q<d}nd}t|�d}|dkr^tt|��}
nd}
t|||||||d�D]J}|	o�|jdk	o�|jdk}|r�t|d�|j|k}t|�|||
�|d�qxdS)	Ni�rqrrFi'rG�r�r#)	�max�values�lenrr�rurwr1r�)r�r�r�rVr�r�r�r!r�Zshow_linenoZ	maxlinenor�Z	maxoffsetr�ZinstrZnew_source_lineZis_current_instrrrrr6s8�
��

�r6cKstt|d�f|�dS)z<Compile the source string, then disassemble the code object.z<dis>N)r3r)r�kwargsrrrr7�sr7ccsdd}tdt|�d�D]J}||}|tkrN||d|B}|tkrH|d>nd}nd}|||fVqdS)NrrFrErH)rOr�Z
HAVE_ARGUMENTZEXTENDED_ARG)r�Zextended_argrWr�r|rrrr��sr�cCs\g}t|�D]J\}}}|dk	r|tkr4|d|}n|tkr|}nq||kr|�|�q|S)z`Detect all offsets in a byte code which are jump targets.

    Return the list of offsets.

    NrF)r�r�ZhasjabsrP)r�r�rwr�r|Zlabelrrrr
�sc	cs�|jddd�}|jddd�}t|j�}d}|j}d}t||�D]P\}}|rz||krd||fV|}||7}||krzdS|dkr�|d8}||7}qB||kr�||fVdS)z�Find the offsets in a byte code which are start of lines in the source.

    Generate pairs (offset, lineno) as described in Python/compile.c.

    rNrFrErLrM)�	co_lnotabr�r*r��zip)	r�Zbyte_incrementsZline_incrementsZbytecode_lenZ
lastlineno�linenoZaddrZ	byte_incrZ	line_incrrrrr	�s&


c@sLeZdZdZddd�dd�Zdd�Zdd	�Zed
d��Zdd
�Z	dd�Z
dS)raThe bytecode operations of a piece of code

    Instantiate this with a function, method, other compiled object, string of
    code, or a code object (as returned by compile()).

    Iterating over this yields the bytecode operations as Instruction instances.
    N)r��current_offsetcCsdt|�|_}|dkr&|j|_d|_n||_||j|_|j|j|_tt	|��|_
||_||_dS)Nr)
r[�codeobjr�r��_line_offsetrkrj�_cell_namesr�r	�_linestarts�_original_objectr�)r�r:r�r�rlrrr�__init__�szBytecode.__init__c	Cs*|j}t|j|j|j|j|j|j|jd�S)Nr�)	r�r�r*rirhrfr�r�r�)r�rlrrr�__iter__�s�zBytecode.__iter__cCsd�|jj|j�S)Nz{}({!r}))�format�	__class__r9r��r�rrr�__repr__�s
�zBytecode.__repr__cCs |jr|j}q||jj|jd�S)z/ Construct a Bytecode from the given traceback )r�)r@rArBrC)�clsrDrrr�from_traceback�szBytecode.from_tracebackcCs
t|j�S)z3Return formatted information about the code object.)r\r�r�rrr�infosz
Bytecode.infocCsl|j}|jdk	r|j}nd}t���>}t|j|j|j|j|j	|j
|j||d�	|��W5QR�SQRXdS)z3Return a formatted view of the bytecode operations.Nr�)r�rVr�r�r�r�r!r�)
r�r��io�StringIOr6r*rirhrfr�r�r��getvalue)r�rlrw�outputrrrr
s


�zBytecode.dis)r9r�r�r�r�r�r��classmethodr�r�rrrrrr�s

c	Csfddl}|��}|jd|�d�ddd�|��}|j�}|��}W5QRXt||jjd�}t	|�dS)	z*Simple test program to disassemble a file.rN�infile�rb�?�-)r8�nargs�defaultr)
�argparse�ArgumentParser�add_argumentZFileType�
parse_argsr��readrrr)r��parser�argsr�rr�rrr�_testsr��__main__)N)N)NNNNNr)r�)r�NNNNN);r�r<�types�collectionsr�ZopcoderZ_opcodes_all�
MethodType�FunctionType�CodeTyper��staticmethodr8r0Zopmaprrrrr�rr�rrrrQrYr[rr\r�
namedtuplernryr|r�r~rwrurvr{r}r
rr�r�r�rr3r6r7rr�r
r	rr�r9rrrr�<module>s�
����
-�
 �4�
6��=
queue.cpython-38.opt-1.pyc000064400000024604151450073350011270 0ustar00U

e5d\,�@sdZddlZddlmZddlmZmZddlmZzddl	m
Z
Wnek
r\dZ
YnXddd	d
ddgZzdd
l	m
Z
Wn$ek
r�Gdd�de�Z
YnXGdd�de�ZGdd	�d	�ZGdd
�d
e�ZGdd�de�ZGdd�d�Ze
dkr�eZ
dS)z'A multi-producer, multi-consumer queue.�N)�deque)�heappush�heappop)�	monotonic)�SimpleQueue�Empty�Full�Queue�
PriorityQueue�	LifoQueuer)rc@seZdZdZdS)rz4Exception raised by Queue.get(block=0)/get_nowait().N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/queue.pyrsc@seZdZdZdS)rz4Exception raised by Queue.put(block=0)/put_nowait().Nrrrrrrsc@s�eZdZdZd!dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	d"dd�Z
d#dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �ZdS)$r	zjCreate a queue object with a given maximum size.

    If maxsize is <= 0, the queue size is infinite.
    rcCsN||_|�|�t��|_t�|j�|_t�|j�|_t�|j�|_d|_	dS�Nr)
�maxsize�_init�	threadingZLock�mutexZ	Condition�	not_empty�not_full�all_tasks_done�unfinished_tasks��selfrrrr�__init__!s

zQueue.__init__c	CsH|j�8|jd}|dkr4|dkr*td��|j��||_W5QRXdS)a.Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.
        �rz!task_done() called too many timesN)rr�
ValueErrorZ
notify_all)rZ
unfinishedrrr�	task_done8s

zQueue.task_donec	Cs(|j�|jr|j��qW5QRXdS)a�Blocks until all items in the Queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer thread calls task_done()
        to indicate the item was retrieved and all work on it is complete.

        When the count of unfinished tasks drops to zero, join() unblocks.
        N)rr�wait�rrrr�joinNs	z
Queue.joinc
Cs&|j�|��W5QR�SQRXdS)�9Return the approximate size of the queue (not reliable!).N�r�_qsizer#rrr�qsize[szQueue.qsizec
Cs(|j�|��W5QR�SQRXdS)a�Return True if the queue is empty, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() == 0
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can grow before the result of empty() or
        qsize() can be used.

        To create code that needs to wait for all queued tasks to be
        completed, the preferred technique is to use the join() method.
        Nr&r#rrr�empty`szQueue.emptyc
Cs<|j�,d|jko |��knW5QR�SQRXdS)aOReturn True if the queue is full, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() >= n
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can shrink before the result of full() or
        qsize() can be used.
        rN)rrr'r#rrr�fullnsz
Queue.fullTNc	Cs�|j��|jdkr�|s*|��|jkr�t�nr|dkrN|��|jkr�|j��q2nN|dkr`td��n<t�|}|��|jkr�|t�}|dkr�t�|j�|�qj|�|�|jd7_|j	�
�W5QRXdS)aPut an item into the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until a free slot is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Full exception if no free slot was available within that time.
        Otherwise ('block' is false), put an item on the queue if a free slot
        is immediately available, else raise the Full exception ('timeout'
        is ignored in that case).
        rN�''timeout' must be a non-negative number�r)rrr'rr"r �time�_putrr�notify)r�item�block�timeout�endtime�	remainingrrr�putys&




z	Queue.putc
Cs�|j��|s|��s�t�nf|dkr8|��s�|j��q"nH|dkrJtd��n6t�|}|��s�|t�}|dkrrt�|j�|�qT|��}|j��|W5QR�SQRXdS)�Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        Nrr+r,)	rr'rr"r r-�_getrr/)rr1r2r3r4r0rrr�get�s$



z	Queue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.
        F�r1�r5�rr0rrr�
put_nowait�szQueue.put_nowaitcCs|jdd�S�z�Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        Fr9�r8r#rrr�
get_nowait�szQueue.get_nowaitcCst�|_dS�N)r�queuerrrrr�szQueue._initcCs
t|j�Sr@��lenrAr#rrrr'�szQueue._qsizecCs|j�|�dSr@�rA�appendr;rrrr.�sz
Queue._putcCs
|j��Sr@)rA�popleftr#rrrr7�sz
Queue._get)r)TN)TN)r
rrrrr!r$r(r)r*r5r8r<r?rr'r.r7rrrrr	s


 

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r
z�Variant of Queue that retrieves open entries in priority order (lowest first).

    Entries are typically tuples of the form:  (priority number, data).
    cCs
g|_dSr@�rArrrrr�szPriorityQueue._initcCs
t|j�Sr@rBr#rrrr'�szPriorityQueue._qsizecCst|j|�dSr@)rrAr;rrrr.�szPriorityQueue._putcCs
t|j�Sr@)rrAr#rrrr7�szPriorityQueue._getN�r
rrrrr'r.r7rrrrr
�s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBVariant of Queue that retrieves most recently added entries first.cCs
g|_dSr@rGrrrrr�szLifoQueue._initcCs
t|j�Sr@rBr#rrrr'�szLifoQueue._qsizecCs|j�|�dSr@rDr;rrrr.�szLifoQueue._putcCs
|j��Sr@)rA�popr#rrrr7�szLifoQueue._getNrHrrrrr�s
c@sLeZdZdZdd�Zddd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�_PySimpleQueuezYSimple, unbounded FIFO queue.

    This pure Python implementation is not reentrant.
    cCst�|_t�d�|_dSr)r�_queuerZ	Semaphore�_countr#rrrr	sz_PySimpleQueue.__init__TNcCs|j�|�|j��dS)z�Put the item on the queue.

        The optional 'block' and 'timeout' arguments are ignored, as this method
        never blocks.  They are provided for compatibility with the Queue class.
        N)rKrErL�release)rr0r1r2rrrr5
sz_PySimpleQueue.putcCs4|dk	r|dkrtd��|j�||�s*t�|j��S)r6Nrr+)r rL�acquirerrKrF)rr1r2rrrr8s
z_PySimpleQueue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        This is exactly equivalent to `put(item)` and is only provided
        for compatibility with the Queue class.
        Fr9r:r;rrrr<'sz_PySimpleQueue.put_nowaitcCs|jdd�Sr=r>r#rrrr?/sz_PySimpleQueue.get_nowaitcCst|j�dkS)zCReturn True if the queue is empty, False otherwise (not reliable!).r�rCrKr#rrrr)7sz_PySimpleQueue.emptycCs
t|j�S)r%rOr#rrrr(;sz_PySimpleQueue.qsize)TN)TN)r
rrrrr5r8r<r?r)r(rrrrrJ�s	
	
rJ)rr�collectionsr�heapqrrr-rrKr�ImportError�__all__r�	Exceptionrr	r
rrJrrrr�<module>s*
BA_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-38.opt-2.pyc000064400000070505151450073350017627 0ustar00U

��.e]���@s`dddddddddddd	d
dddd
ddddddddddddddddddddddd	dd dd!d"d#d$d%dddd&d'dd(d)d*d&d+dd!dd,d-dddddddd.d&d&d&d&dd&dd&d&d&d&d&dddddddddd&dd&d&d&d&d&d&d&d&dd&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&dd&dd&dd&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&ddd&d&dd&dddd&d&d&ddd&d&dddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&dd&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&d&d&d&d&ddd&d&d&dd&d&ddd&d&d&d&d&d&d&dddddd&dd&d&dddddd&ddd&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&ddd&d&d&ddd&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&dd
d/ddd0d1d0d0d2d3d4dd5d6d7ddd8dd	d9dd:d;dd<d=dd>ddd?d@dAdBddd+ddCdDddEdd	dddd&dFdGdHdIdddJddKdLd&dMddddNdOdddddddddPdQdRdddSd&d&dddddTddddUdVdddWddXd&dYdZdd[d6d\d]dd^d&d&ddd_d`dadbdcd9dddded?dfd&dddgdhdidhdgdidgdgdhdhdgd]dgdgdgdgdhd&djdkdld&dmdnddod:d&dddddpddqdrdd&ddddsd&dtdud&d&d&d&dddd&d&ddvdwdudxdydydudz���Zd{S)|�d�z"cpython-38-x86_64-linux-gnu"ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPython�z/usr/binz/usr/lib64/python3.8z-L. -lpython3.8dzOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa{-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Ogz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--with-pydebug' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8dz=/builddir/build/BUILD/Python-3.8.17/build/debug/coverage.infoz;/builddir/build/BUILD/Python-3.8.17/build/debug/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz .cpython-38d-x86_64-linux-gnu.soi�ZyeszI/usr/include /usr/include /usr/include/python3.8d /usr/include/python3.8dz/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8d.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8d.soz3.8dz
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz1/usr/lib64/python3.8/config-3.8d-x86_64-linux-gnuzlibpython3.8d.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa1-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgozno-frameworkz./python -Ez	python3.8a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internala�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidz?LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debugz	@SGI_ABI@z/bin/shz.so���zcpython-38d-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczHLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz3.8z#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz//builddir/build/BUILD/Python-3.8.17/build/debugz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�?/usr/lib64/python3.8/_sysconfigdata_d_linux_x86_64-linux-gnu.py�<module>sb2+-��������asynchat.cpython-38.opt-1.pyc000064400000015305151450073350011754 0ustar00U

e5d@,�@sDdZddlZddlmZGdd�dej�ZGdd�d�Zdd	�ZdS)
a�A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
�N)�dequec@s�eZdZdZdZdZdZdZd(dd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))�
async_chatz�This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator()irzlatin-1NcCs(d|_g|_t�|_tj�|||�dS�N�)�ac_in_buffer�incomingr�
producer_fifo�asyncore�
dispatcher�__init__)�selfZsock�map�r� /usr/lib64/python3.8/asynchat.pyrCszasync_chat.__init__cCstd��dS�Nzmust be implemented in subclass��NotImplementedError�r�datarrr�collect_incoming_dataQsz async_chat.collect_incoming_datacCs|j�|�dS�N)r�appendrrrr�_collect_incoming_dataTsz!async_chat._collect_incoming_datacCsd�|j�}|jdd�=|Sr)�joinr)r�drrr�	_get_dataWszasync_chat._get_datacCstd��dSrr�rrrr�found_terminator\szasync_chat.found_terminatorcCsBt|t�r|jrt||j�}nt|t�r8|dkr8td��||_dS)zdSet the input delimiter.

        Can be a fixed string of any length, an integer, or None.
        rz-the number of received bytes must be positiveN)�
isinstance�str�use_encoding�bytes�encoding�int�
ValueError�
terminator)rZtermrrr�set_terminator_s
zasync_chat.set_terminatorcCs|jSr)r%rrrr�get_terminatorjszasync_chat.get_terminatorc
Cs�z|�|j�}WnDtk
r&YdStk
rT}z|��WY�dSd}~XYnXt|t�rr|jrrtt|j	�}|j
||_
|j
�r�t|j
�}|��}|s�|�
|j
�d|_
q~t|t��r|}||kr�|�
|j
�d|_
|j||_n2|�
|j
d|��|j
|d�|_
d|_|��q~t|�}|j
�|�}|dk�rv|dk�rX|�
|j
d|��|j
||d�|_
|��q~t|j
|�}|�r�||k�r�|�
|j
d|��|j
|d�|_
�q�q~|�
|j
�d|_
q~dS)Nrr���)Zrecv�ac_in_buffer_size�BlockingIOError�OSError�handle_errorrrr r!r"r�lenr'rr#r%r�find�find_prefix_at_end)rrZwhyZlbr%�nZterminator_len�indexrrr�handle_readrsR

	



zasync_chat.handle_readcCs|��dSr)�
initiate_sendrrrr�handle_write�szasync_chat.handle_writecCs|��dSr)�closerrrr�handle_close�szasync_chat.handle_closecCsxt|tttf�stdt|���|j}t|�|kr`tdt|�|�D]}|j	�
||||��q@n|j	�
|�|��dS)Nz#data argument must be byte-ish (%r)r)rr!�	bytearray�
memoryview�	TypeError�type�ac_out_buffer_sizer-�rangerrr3)rrZsabs�irrr�push�s�zasync_chat.pushcCs|j�|�|��dSr)rrr3)rZproducerrrr�push_with_producer�szasync_chat.push_with_producercCsdS)z4predicate for inclusion in the readable for select()�rrrrr�readable�szasync_chat.readablecCs|jp|jS)z4predicate for inclusion in the writable for select())r�	connectedrrrr�writable�szasync_chat.writablecCs|j�d�dS)zAautomatically close this channel once the outgoing queue is emptyN)rrrrrr�close_when_done�szasync_chat.close_when_donecCs|j�r|j�r|jd}|s:|jd=|dkr:|��dS|j}z|d|�}Wn:tk
r�|��}|rz|j�|�n|jd=YqYnXt|t�r�|j	r�t
||j�}z|�|�}Wnt
k
r�|��YdSX|�r|t|�ks�|t|�k�r
||d�|jd<n|jd=dSdS)Nr)rrBr6r;r9�more�
appendleftrrr r!r"�sendr+r,r-)r�firstZobsrZnum_sentrrrr3�s8

zasync_chat.initiate_sendcCs d|_|jdd�=|j��dSr)rrr�clearrrrr�discard_buffersszasync_chat.discard_buffers)NN)�__name__�
__module__�__qualname__�__doc__r)r;r r"rrrrrr&r'r2r4r6r>r?rArCrDr3rJrrrrr4s,
H(rc@seZdZddd�Zdd�ZdS)�simple_producer�cCs||_||_dSr)r�buffer_size)rrrQrrrrszsimple_producer.__init__cCsJt|j�|jkr6|jd|j�}|j|jd�|_|S|j}d|_|SdSr)r-rrQ)r�resultrrrrEszsimple_producer.moreN)rP)rKrLrMrrErrrrrOs
rOcCs0t|�d}|r,|�|d|��s,|d8}q|S)Nr@)r-�endswith)ZhaystackZneedle�lrrrr//s
r/)rNr	�collectionsrr
rrOr/rrrr�<module>s\ csv.cpython-38.opt-2.pyc000064400000023221151450073350010732 0ustar00U

e5d?�@s<ddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlmZddlmZddddd	d
ddd
ddddddddddddgZGdd
�d
�ZGdd�de�Zede�Gdd
�d
e�Zede�Gdd�de�Zede�Gd d�d�ZGd!d�d�ZzeWnek
�r(eZYnXGd"d�d�ZdS)#�N)�Error�__version__�writer�reader�register_dialect�unregister_dialect�get_dialect�
list_dialects�field_size_limit�
QUOTE_MINIMAL�	QUOTE_ALL�QUOTE_NONNUMERIC�
QUOTE_NONE�__doc__)�Dialect)�StringIOrrr
rrrr�excel�	excel_tabr
rrrrr	�Snifferrr�
DictReader�
DictWriter�unix_dialectc@s@eZdZdZdZdZdZdZdZdZ	dZ
dZdd�Zdd�Z
dS)r�FNcCs|jtkrd|_|��dS)NT)�	__class__r�_valid�	_validate��self�r�/usr/lib64/python3.8/csv.py�__init__*s
zDialect.__init__c
Cs@zt|�Wn.tk
r:}ztt|���W5d}~XYnXdS�N)�_Dialect�	TypeErrorr�str)r�errrr/szDialect._validate)�__name__�
__module__�__qualname__�_namer�	delimiter�	quotecharZ
escapechar�doublequote�skipinitialspace�lineterminator�quotingr rrrrrrsc@s$eZdZdZdZdZdZdZeZ	dS)r�,�"TF�
N)
r&r'r(r*r+r,r-r.rr/rrrrr6sc@seZdZdZdS)r�	N)r&r'r(r*rrrrr@sz	excel-tabc@s$eZdZdZdZdZdZdZeZ	dS)rr0r1TF�
N)
r&r'r(r*r+r,r-r.rr/rrrrrEsZunixc@s@eZdZddd�Zdd�Zedd��Zejd	d��Zd
d�ZdS)
rNrcOs6||_||_||_t||f|�|�|_||_d|_dS�Nr)�_fieldnames�restkey�restvalr�dialect�line_num)r�f�
fieldnamesr7r8r9�args�kwdsrrrr QszDictReader.__init__cCs|Sr!rrrrr�__iter__ZszDictReader.__iter__cCs@|jdkr0zt|j�|_Wntk
r.YnX|jj|_|jSr!)r6�nextr�
StopIterationr:rrrrr<]s

zDictReader.fieldnamescCs
||_dSr!)r6)r�valuerrrr<gscCs�|jdkr|jt|j�}|jj|_|gkr8t|j�}q$tt|j|��}t|j�}t|�}||krv||d�||j<n&||kr�|j|d�D]}|j||<q�|Sr5)	r:r<r@r�dict�zip�lenr7r8)r�row�dZlfZlr�keyrrr�__next__ks



zDictReader.__next__)NNNr)	r&r'r(r r?�propertyr<�setterrIrrrrrPs�
	
	
c@s6eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rr�raisercOsB||_||_|��dkr$td|��||_t||f|�|�|_dS)N)rL�ignorez-extrasaction (%s) must be 'raise' or 'ignore')r<r8�lower�
ValueError�extrasactionr)rr;r<r8rPr9r=r>rrrr �s�zDictWriter.__init__cCstt|j|j��}|�|�Sr!)rCrDr<�writerow)r�headerrrr�writeheader�szDictWriter.writeheadercsN�jdkr8����j}|r8tdd�dd�|D������fdd��jD�S)NrLz(dict contains fields not in fieldnames: z, cSsg|]}t|��qSr)�repr)�.0�xrrr�
<listcomp>�sz,DictWriter._dict_to_list.<locals>.<listcomp>c3s|]}��|�j�VqdSr!)�getr8)rUrH��rowdictrrr�	<genexpr>�sz+DictWriter._dict_to_list.<locals>.<genexpr>)rP�keysr<rO�join)rrZZwrong_fieldsrrYr�
_dict_to_list�s
�zDictWriter._dict_to_listcCs|j�|�|��Sr!)rrQr^)rrZrrrrQ�szDictWriter.writerowcCs|j�t|j|��Sr!)r�	writerows�mapr^)rZrowdictsrrrr_�szDictWriter.writerowsN)rrLr)r&r'r(r rSr^rQr_rrrrr�s�

c@s6eZdZdd�Zddd�Zdd�Zdd	�Zd
d�ZdS)
rcCsdddddg|_dS)Nr0r3�;� �:)�	preferredrrrrr �szSniffer.__init__NcCsd|�||�\}}}}|s(|�||�\}}|s4td��Gdd�dt�}||_||_|pVd|_||_|S)NzCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff.<locals>.dialectZsniffedr2N)r&r'r(r)r.rr/rrrrr9�sr9r1)�_guess_quote_and_delimiter�_guess_delimiterrrr,r*r+r-)r�sample�
delimitersr+r,r*r-r9rrr�sniff�s
�
�
z
Sniffer.sniffc	Cs�g}dD]*}t�|tjtjB�}|�|�}|rq4q|s<dSi}i}d}|j}	|D]�}
|	dd}|
|}|r�|�|d�d||<z|	dd}|
|}Wntk
r�YqRYnX|r�|dks�||kr�|�|d�d||<z|	dd}Wntk
�rYqRYnX|
|rR|d7}qRt||jd�}
|�rXt||jd�}|||k}|d	k�r`d
}nd
}d}t�dt�	|�|
d�tj�}|�
|��r�d
}nd}|
|||fS)N)zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n))rFNrr�quote��delimZspace�rHr4rz]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rlrjTF)�re�compile�DOTALL�	MULTILINE�findall�
groupindexrX�KeyError�max�escape�search)r�datarhZmatchesZrestrZregexpZquotes�delimsZspacesrs�m�nrHr+rlr-Z	dq_regexpr,rrrre�s`




��z"Sniffer._guess_quote_and_delimitercCsttd|�d���}dd�td�D�}tdt|��}d}i}i}i}d|}	}
|	t|�k�rR|d7}||	|
�D]@}|D]6}|�|i�}
|�|�}|
�|d�d|
|<|
||<qxqp|��D]�}t||�	��}t|�dkr�|dddkr�q�t|�dk�rLt
|dd	�d
�||<|�||�||d||dtdd�|D��f||<q�|d||<q�|�	�}t
t||t|���}d
}d}t|�dk�r�||k�r�|D]T\}}|ddk�r�|ddk�r�|d||k�r�|dk�s�||k�r�|||<�q�|d8}�q�t|�dk�rDt|���d}|d�|�|d�d|�k}||fS|
}	|
|7}
qN|�s\dSt|�dk�r�|jD]@}||��k�rp|d�|�|d�d|�k}||fS�qpdd�|�	�D�}|��|dd}|d�|�|d�d|�k}||fS)Nr4cSsg|]}t|��qSr)�chr)rU�crrrrW-sz,Sniffer._guess_delimiter.<locals>.<listcomp>��
rrkcSs|dS)Nrkr)rVrrr�<lambda>G�z*Sniffer._guess_delimiter.<locals>.<lambda>rmcss|]}|dVqdS)rkNr)rU�itemrrrr[Lsz+Sniffer._guess_delimiter.<locals>.<genexpr>g�?g�������?g{�G�z�?z%c )rrcSsg|]\}}||f�qSrr)rU�k�vrrrrWvs���)�list�filter�split�range�minrErX�countr\�itemsru�remove�sum�floatrd�sort)rrxrh�asciiZchunkLengthZ	iterationZ
charFrequencyZmodesry�start�end�line�charZ
metaFrequencyZfreqr�ZmodeListZtotalZconsistencyZ	thresholdr�r�rlr-rGrrrrfs�

����

��zSniffer._guess_delimiterc
Cs�tt|�|�|��}t|�}t|�}i}t|�D]}d||<q0d}|D]�}|dkrVq�|d7}t|�|krlqFt|���D]x}	tt	t
fD]4}
z|
||	�Wq�Wq�ttfk
r�Yq�Xq�t||	�}
|
||	krx||	dkr�|
||	<qx||	=qxqFd}|�
�D]~\}	}t|�td�k�r@t||	�|k�r6|d7}n|d8}n<z|||	�Wn"ttfk
�rr|d7}Yn
X|d8}�q|dkS)Nr�rk)rrrir@rEr�r�r\�intr��complexrO�
OverflowErrorr��typer#)
rrgZrdrrR�columnsZcolumnTypes�i�checkedrF�colZthisTypeZ	hasHeaderZcolTyperrr�
has_headersJ






zSniffer.has_header)N)r&r'r(r rirerfr�rrrrr�s

Lg)rnZ_csvrrrrrrrr	r
rrr
rrrr"�ior�__all__rrrrrr��	NameErrorr�rrrrr�<module>sH@�


2
dummy_threading.cpython-38.opt-2.pyc000064400000001343151450073350013320 0ustar00U

e5d�
�	@s�ddlmZddlZdZdZdZz�dekr6edZ	dZeded<dekr\edZdZed=dekrvedZdZed=ddl
Z
eded	<ed=eded
<ed=ddlTddlmZW5er�eed<[[er�eed<[[er�e	ed<[	ned=[[[XdS)
�)�modulesNF�	threadingZ_threading_local�_threadT�
_dummy_thread�_dummy_threadingZ_dummy__threading_local)�*)�__all__)
�sysrZsys_modulesrZholding_threadZholding_threadingZholding__threading_localZheld_threadingZheld__threading_localZheld_threadrrr�r
r
�'/usr/lib64/python3.8/dummy_threading.py�<module>	sN_bootlocale.cpython-38.opt-1.pyc000064400000002303151450073350012416 0ustar00U

e5d	�@szdZddlZddlZej�d�r,ddd�ZnJz
ejWn4ek
rjeed�r\ddd�Zn
d
d	d�ZYnXdd
d�ZdS)z�A minimal subset of the locale module used at interpreter startup
(imported by the _io module), in order to reduce startup time.

Don't import directly from third-party code; use the `locale` module instead!
�N�winTcCstjjrdSt��dS)N�UTF-8�)�sys�flags�	utf8_mode�_localeZ_getdefaultlocale��do_setlocale�r�#/usr/lib64/python3.8/_bootlocale.py�getpreferredencodingsr
ZgetandroidapilevelcCsdS)Nrrr	rrrr
scCstjjrdSddl}|�|�S)Nrr)rrr�localer
)r
rrrrr
scCs.tjjrdSt�tj�}|s*tjdkr*d}|S)Nr�darwin)rrrr�nl_langinfo�CODESET�platform)r
�resultrrrr
!s)T)T)T)T)	�__doc__rrr�
startswithr
r�AttributeError�hasattrrrrr�<module>s

tabnanny.cpython-38.opt-2.pyc000064400000013723151450073350011757 0ustar00U

e5d�,�@s�dZddlZddlZddlZeed�s.ed��dddgZdadadd	�Z	d
d�Z
Gdd�de�Zd
d�Z
Gdd�d�Zdd�Zdd�Zedkr�e
�dS)�6�N�NLz4tokenize.NL doesn't exist -- tokenize module too old�check�NannyNag�process_tokenscGs6d}|D]}tj�|t|��d}qtj�d�dS)N�� �
)�sys�stderr�write�str)�args�sep�arg�r� /usr/lib64/python3.8/tabnanny.py�errprint"s
rc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnX|D](\}}|dkrvtda|dkr^tdaq^|s�tdtjdd�dS|D]}t|�q�dS)Nr�Zqvz-qz-vzUsage:z[-v] file_or_directory ...)�getoptr
�argv�errorr�
filename_only�verboser)rZoptsr�msg�o�arrrr�main)s 
rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs||||_|_|_dS�N)�linenor�line)�selfrrr rrr�__init__BszNannyNag.__init__cCs|jSr)r�r!rrr�
get_linenoDszNannyNag.get_linenocCs|jSr)rr#rrr�get_msgFszNannyNag.get_msgcCs|jSr)r r#rrr�get_lineHszNannyNag.get_lineN)�__name__�
__module__�__qualname__r"r$r%r&rrrrr=sc	
CsHtj�|�r�tj�|�s�tr*td|f�t�|�}|D]J}tj�||�}tj�|�rbtj�|�rztj�|dd��dkr8t	|�q8dSzt
�|�}Wn8tk
r�}zt
d||f�WY�dSd}~XYnXtdkr�td|��z>ztt
�|j��W�n"t
jk
�r@}z t
d||f�WY�
W���dSd}~XYn�tk
�r|}zt
d||f�WY�W��dSd}~XYn�tk
�r }z�|��}|��}t�r�td	||f�td
|f�t|���n6d|k�r�d|d}t�r�t|�nt||t|��WY�W�dSd}~XYnXW5|��Xt�rDtd
|f�dS)Nz%r: listing directory���z.pyz%r: I/O Error: %srzchecking %r ...z%r: Token Error: %sz%r: Indentation Error: %sz)%r: *** Line %d: trouble in tab city! ***zoffending line: %rr�"z%r: Clean bill of health.)�os�path�isdir�islinkr�print�listdir�join�normcaser�tokenize�open�OSErrorr�closer�generate_tokens�readline�
TokenError�IndentationErrorrr$r&r%r�repr)	�file�names�name�fullname�frZnag�badliner rrrrKsX


��


 
c@sLeZdZd\ZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
Whitespacez 	c	Cs�||_tjtj}}g}d}}}|jD]v}||krH|d}|d}q*||kr�|d}|d}|t|�kr�|dg|t|�d}||d||<d}q*q�q*||_||_t|�|f|_t|�dk|_	dS)Nrr)
�rawrC�S�T�len�n�nt�tuple�norm�	is_simple)	r!ZwsrErF�count�brHrIZchrrrr"�s(

zWhitespace.__init__cCs|j\}}tt|�d|�S�Nr)rK�maxrG)r!rM�trailingrrr�longest_run_of_spaces�s
z Whitespace.longest_run_of_spacescCsH|j\}}d}t|t|��D]}|||||}q||||jS)Nr)rK�rangerGrI)r!�tabsizerMrQZil�irrr�indent_level�s

zWhitespace.indent_levelcCs|j|jkSr)rK)r!�otherrrr�equal�szWhitespace.equalcCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrO�rPrRrSrV�append�r!rWrHr�tsrrr�not_equal_witness�s���zWhitespace.not_equal_witnesscCsp|j|jkrdS|jr(|jr(|j|jkSt|��|���d}td|d�D]}|�|�|�|�krLdSqLdS)NFr�T)rHrLrIrPrRrSrV)r!rWrHr\rrr�less�s��zWhitespace.lesscCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrOrYr[rrr�not_less_witnesss���zWhitespace.not_less_witnessN)r'r(r)rErFr"rRrVrXr]r_r`rrrrrC�srCcCs8dd�|D�}d}t|�dkr&|d}|dd�|�S)Ncss|]}t|d�VqdS)rN)r
)�.0�tuprrr�	<genexpr>sz#format_witnesses.<locals>.<genexpr>zat tab sizer�srz, )rGr2)�wZfirsts�prefixrrr�format_witnessess
rgcCstj}tj}tj}tjtjf}td�g}d}|D]�\}}}	}
}||krLd}q0||kr�d}t|�}|d�|�s�|d�|�}
dt	|
�}t
|	d||��|�|�q0||kr�d}|d=q0|r0||kr0d}t|�}|d�|�s0|d�
|�}
dt	|
�}t
|	d||��q0dS)Nrrr���zindent not greater e.g. zindent not equal e.g. )r4�INDENT�DEDENT�NEWLINE�COMMENTrrCr_r`rgrrZrXr])�tokensrirjrkZJUNK�indentsZcheck_equal�type�token�start�endr ZthisguyZwitnessrrrrrs6

�__main__)�__version__r,r
r4�hasattr�
ValueError�__all__rrrr�	ExceptionrrrCrgrr'rrrr�<module>s$

=7fractions.cpython-38.pyc000064400000044465151450073350011204 0ustar00U

e5d	_�@s�dZddlmZddlZddlZddlZddlZddlZddgZdd�Z	dd�Z
ejjZ
ejjZe�d	ejejB�ZGd
d�dej�ZdS)z+Fraction, infinite-precision, real numbers.���DecimalN�Fraction�gcdcCsfddl}|�dtd�t|�tkr2t|�kr\nn&|p<|dkrPt�||�St�||�St||�S)z�Calculate the Greatest Common Divisor of a and b.

    Unless b==0, the result will have the same sign as b (so that when
    b is divided by it, the result comes out positive).
    rNz6fractions.gcd() is deprecated. Use math.gcd() instead.�)�warnings�warn�DeprecationWarning�type�int�mathr�_gcd)�a�br�r�!/usr/lib64/python3.8/fractions.pyrs� cCs|r|||}}q|S�Nr�rrrrrr
 sr
aC
    \A\s*                      # optional whitespace at the start, then
    (?P<sign>[-+]?)            # an optional sign, then
    (?=\d|\.\d)                # lookahead for digit or .digit
    (?P<num>\d*)               # numerator (possibly empty)
    (?:                        # followed by
       (?:/(?P<denom>\d+))?    # an optional denominator
    |                          # or
       (?:\.(?P<decimal>\d*))? # an optional fractional part
       (?:E(?P<exp>[-+]?\d+))? # and optional exponent
    )
    \s*\Z                      # and optional whitespace to finish
cs�eZdZdZdZdRdd��fdd�Zed	d
��Zedd��Zd
d�Z	dSdd�Z
edd��Zedd��Z
dd�Zdd�Zdd�Zdd�Zeeej�\ZZdd�Zeeej�\ZZd d!�Zeeej�\ZZd"d#�Zeeej�\Z Z!d$d%�Z"ee"ej#�\Z$Z%d&d'�Z&ee&e'�\Z(Z)d(d)�Z*ee*ej+�\Z,Z-d*d+�Z.d,d-�Z/d.d/�Z0d0d1�Z1d2d3�Z2d4d5�Z3d6d7�Z4d8d9�Z5dTd:d;�Z6d<d=�Z7d>d?�Z8d@dA�Z9dBdC�Z:dDdE�Z;dFdG�Z<dHdI�Z=dJdK�Z>dLdM�Z?dNdO�Z@dPdQ�ZA�ZBS)Ura]This class implements rational numbers.

    In the two-argument form of the constructor, Fraction(8, 6) will
    produce a rational number equivalent to 4/3. Both arguments must
    be Rational. The numerator defaults to 0 and the denominator
    defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.

    Fractions can also be constructed from:

      - numeric strings similar to those accepted by the
        float constructor (for example, '-2.3' or '1e10')

      - strings of the form '123/456'

      - float and Decimal instances

      - other Rational instances (including integers)

    ��
_numerator�_denominatorrNT��
_normalizecsRtt|��|�}|dk�rdt|�tkr6||_d|_|St|tj	�rV|j
|_|j|_|St|tt
f�rx|��\|_|_|St|t��rZt�|�}|dkr�td|��t|�d�p�d�}|�d�}|r�t|�}nvd}|�d�}|�rdt|�}||t|�}||9}|�d	�}	|	�rBt|	�}	|	d
k�r4|d|	9}n|d|	9}|�d�dk�rb|}ntd
��nft|�tk�r�t|�k�r�nnn@t|tj	��r�t|tj	��r�|j
|j|j
|j}}ntd��|d
k�r�td|��|�rBt|�tk�rt|�k�r(nnt�||�}
|d
k�r2|
}
n
t||�}
||
}||
}||_||_|S)a�Constructs a Rational.

        Takes a string like '3/2' or '1.5', another Rational instance, a
        numerator/denominator pair, or a float.

        Examples
        --------

        >>> Fraction(10, -8)
        Fraction(-5, 4)
        >>> Fraction(Fraction(1, 7), 5)
        Fraction(1, 35)
        >>> Fraction(Fraction(1, 7), Fraction(2, 3))
        Fraction(3, 14)
        >>> Fraction('314')
        Fraction(314, 1)
        >>> Fraction('-35/4')
        Fraction(-35, 4)
        >>> Fraction('3.1415') # conversion from numeric string
        Fraction(6283, 2000)
        >>> Fraction('-47e-2') # string may include a decimal exponent
        Fraction(-47, 100)
        >>> Fraction(1.47)  # direct construction from float (exact conversion)
        Fraction(6620291452234629, 4503599627370496)
        >>> Fraction(2.25)
        Fraction(9, 4)
        >>> Fraction(Decimal('1.47'))
        Fraction(147, 100)

        N�z Invalid literal for Fraction: %rZnum�0�denom�decimal�
�exprZsign�-z2argument should be a string or a Rational instancez+both arguments should be Rational instanceszFraction(%s, 0))�superr�__new__r
rrr�
isinstance�numbers�Rational�	numerator�denominator�floatr�as_integer_ratio�str�_RATIONAL_FORMAT�match�
ValueError�group�len�	TypeError�ZeroDivisionErrorrrr
)�clsr%r&r�self�mrrZscaler�g��	__class__rrr!Tsx

�





$
�

�
$

zFraction.__new__cCsDt|tj�r||�St|t�s8td|j|t|�jf��||���S)z�Converts a finite float to a rational number, exactly.

        Beware that Fraction.from_float(0.3) != Fraction(3, 10).

        z.%s.from_float() only takes floats, not %r (%s))r"r#�Integralr'r/�__name__r
r()r1�frrr�
from_float�s
�zFraction.from_floatcCsVddlm}t|tj�r&|t|��}n$t||�sJtd|j|t|�jf��||�	��S)zAConverts a finite Decimal instance to a rational number, exactly.rrz2%s.from_decimal() only takes Decimals, not %r (%s))
rrr"r#r7rr/r8r
r()r1Zdecrrrr�from_decimal�s
��zFraction.from_decimalcCs|j|jfS)z�Return the integer ratio as a tuple.

        Return a tuple of two integers, whose ratio is equal to the
        Fraction and with a positive denominator.
        r�r2rrrr(�szFraction.as_integer_ratio�@Bc
Cs�|dkrtd��|j|kr"t|�Sd\}}}}|j|j}}||}|||}	|	|krZq�||||||	f\}}}}||||}}q<|||}
t||
|||
|�}t||�}t||�t||�kr�|S|SdS)aWClosest Fraction to self with denominator at most max_denominator.

        >>> Fraction('3.141592653589793').limit_denominator(10)
        Fraction(22, 7)
        >>> Fraction('3.141592653589793').limit_denominator(100)
        Fraction(311, 99)
        >>> Fraction(4321, 8765).limit_denominator(10000)
        Fraction(4321, 8765)

        rz$max_denominator should be at least 1)rrrrN)r,rrr�abs)
r2Zmax_denominatorZp0Zq0Zp1Zq1�n�drZq2�kZbound1Zbound2rrr�limit_denominator�s$ 

zFraction.limit_denominatorcCs|jSr)r�rrrrr%szFraction.numeratorcCs|jSr)rrCrrrr&szFraction.denominatorcCsd|jj|j|jfS)z
repr(self)z
%s(%s, %s))r6r8rrr<rrr�__repr__"s�zFraction.__repr__cCs(|jdkrt|j�Sd|j|jfSdS)z	str(self)rz%s/%sN)rr)rr<rrr�__str__'s

zFraction.__str__csT��fdd�}d�jd|_�j|_��fdd�}d�jd|_�j|_||fS)a�Generates forward and reverse operators given a purely-rational
        operator and a function from the operator module.

        Use this like:
        __op__, __rop__ = _operator_fallbacks(just_rational_op, operator.op)

        In general, we want to implement the arithmetic operations so
        that mixed-mode operations either call an implementation whose
        author knew about the types of both arguments, or convert both
        to the nearest built in type and do the operation there. In
        Fraction, that means that we define __add__ and __radd__ as:

            def __add__(self, other):
                # Both types have numerators/denominator attributes,
                # so do the operation directly
                if isinstance(other, (int, Fraction)):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                # float and complex don't have those operations, but we
                # know about those types, so special case them.
                elif isinstance(other, float):
                    return float(self) + other
                elif isinstance(other, complex):
                    return complex(self) + other
                # Let the other type take over.
                return NotImplemented

            def __radd__(self, other):
                # radd handles more types than add because there's
                # nothing left to fall back to.
                if isinstance(other, numbers.Rational):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                elif isinstance(other, Real):
                    return float(other) + float(self)
                elif isinstance(other, Complex):
                    return complex(other) + complex(self)
                return NotImplemented


        There are 5 different cases for a mixed-type addition on
        Fraction. I'll refer to all of the above code that doesn't
        refer to Fraction, float, or complex as "boilerplate". 'r'
        will be an instance of Fraction, which is a subtype of
        Rational (r : Fraction <: Rational), and b : B <:
        Complex. The first three involve 'r + b':

            1. If B <: Fraction, int, float, or complex, we handle
               that specially, and all is well.
            2. If Fraction falls back to the boilerplate code, and it
               were to return a value from __add__, we'd miss the
               possibility that B defines a more intelligent __radd__,
               so the boilerplate should return NotImplemented from
               __add__. In particular, we don't handle Rational
               here, even though we could get an exact answer, in case
               the other type wants to do something special.
            3. If B <: Fraction, Python tries B.__radd__ before
               Fraction.__add__. This is ok, because it was
               implemented with knowledge of Fraction, so it can
               handle those instances before delegating to Real or
               Complex.

        The next two situations describe 'b + r'. We assume that b
        didn't know about Fraction in its implementation, and that it
        uses similar boilerplate code:

            4. If B <: Rational, then __radd_ converts both to the
               builtin rational type (hey look, that's us) and
               proceeds.
            5. Otherwise, __radd__ tries to find the nearest common
               base ABC, and fall back to its builtin type. Since this
               class doesn't subclass a concrete type, there's no
               implementation to fall back to, so we need to try as
               hard as possible to return an actual value, or the user
               will get a TypeError.

        csPt|ttf�r�||�St|t�r0�t|�|�St|t�rH�t|�|�StSdSr)r"rrr'�complex�NotImplementedr��fallback_operator�monomorphic_operatorrr�forward~s


z-Fraction._operator_fallbacks.<locals>.forward�__csZt|tj�r�||�St|tj�r4�t|�t|��St|tj�rR�t|�t|��StSdSr)r"r#r$ZRealr'�ComplexrFrG�rrrHrr�reverse�s
z-Fraction._operator_fallbacks.<locals>.reverseZ__r)r8�__doc__)rJrIrKrOrrHr�_operator_fallbacks.sP	
zFraction._operator_fallbackscCs,|j|j}}t|j||j|||�S)za + b�r&rr%�rr�da�dbrrr�_add�s�z
Fraction._addcCs,|j|j}}t|j||j|||�S)za - brRrSrrr�_sub�s�z
Fraction._subcCst|j|j|j|j�S)za * b�rr%r&rrrr�_mul�sz
Fraction._mulcCst|j|j|j|j�S)za / brXrrrr�_div�s
�z
Fraction._divcCs|j|j|j|jS)za // b�r%r&rrrr�	_floordiv�szFraction._floordivcCs:|j|j}}t|j|||j�\}}|t|||�fS)z(a // b, a % b))r&�divmodr%r)rrrTrUZdivZn_modrrr�_divmod�szFraction._divmodcCs,|j|j}}t|j||j|||�S)za % brRrSrrr�_mod�sz
Fraction._modcCs�t|tj�r�|jdkr�|j}|dkr>t|j||j|dd�S|jdkrft|j||j|dd�St|j||j|dd�Sq�t|�t|�Snt|�|SdS)z�a ** b

        If b is not an integer, the result will be a float or complex
        since roots are generally irrational. If b is an integer, the
        result will be rational.

        rrFrN)	r"r#r$r&r%rrrr')rrZpowerrrr�__pow__�s&

�

��zFraction.__pow__cCs\|jdkr|jdkr||jSt|tj�r<t|j|j�|S|jdkrP||jS|t|�S)za ** brr)	rrr"r#r$rr%r&r'rNrrr�__rpow__�s


zFraction.__rpow__cCst|j|jdd�S)z++a: Coerces a subclass instance to FractionFr�rrrrCrrr�__pos__�szFraction.__pos__cCst|j|jdd�S)z-aFrrbrCrrr�__neg__�szFraction.__neg__cCstt|j�|jdd�S)zabs(a)Fr)rr>rrrCrrr�__abs__�szFraction.__abs__cCs*|jdkr|j|jS|j|jSdS)ztrunc(a)rNrrCrrr�	__trunc__s
zFraction.__trunc__cCs|j|jS)z
math.floor(a)r[rCrrr�	__floor__
szFraction.__floor__cCs|j|jS)zmath.ceil(a)r[rCrrr�__ceil__szFraction.__ceil__cCs�|dkrZt|j|j�\}}|d|jkr,|S|d|jkrB|dS|ddkrR|S|dSdt|�}|dkr�tt||�|�Stt||�|�SdS)z?round(self, ndigits)

        Rounds half toward even.
        Nrrrr)r]r%r&r>r�round)r2ZndigitsZfloorZ	remainder�shiftrrr�	__round__szFraction.__round__cCsPt|jtdt�}|st}nt|j�|t}|dkr:|n|}|dkrLdS|S)z
hash(self)rr������)�powr�_PyHASH_MODULUS�_PyHASH_INFr>r)r2ZdinvZhash_�resultrrr�__hash__,szFraction.__hash__cCs�t|�tkr |j|ko|jdkSt|tj�rD|j|jkoB|j|jkSt|tj	�r`|j
dkr`|j}t|t�r�t
�|�s~t
�|�r�d|kS||�|�kSntSdS)za == brr�N)r
rrrr"r#r$r%r&rM�imag�realr'r�isnan�isinfr:rGrrrr�__eq__Bs
�
zFraction.__eq__cCsht|tj�r&||j|j|j|j�St|t�r`t�	|�sDt�
|�rN|d|�S|||�|��SntSdS)acHelper for comparison operators, for internal use only.

        Implement comparison between a Rational instance `self`, and
        either another Rational instance or a float `other`.  If
        `other` is not a Rational instance or a float, return
        NotImplemented. `op` should be one of the six standard
        comparison operators.

        rsN)
r"r#r$rr&rr%r'rrvrwr:rG)r2�other�oprrr�_richcmpWs
�

zFraction._richcmpcCs|�|tj�S)za < b)r{�operator�ltrrrr�__lt__mszFraction.__lt__cCs|�|tj�S)za > b)r{r|�gtrrrr�__gt__qszFraction.__gt__cCs|�|tj�S)za <= b)r{r|�lerrrr�__le__uszFraction.__le__cCs|�|tj�S)za >= b)r{r|�gerrrr�__ge__yszFraction.__ge__cCs
t|j�S)za != 0)�boolrrCrrr�__bool__}szFraction.__bool__cCs|jt|�ffSr)r6r)r<rrr�
__reduce__�szFraction.__reduce__cCs t|�tkr|S|�|j|j�Sr�r
rr6rrr<rrr�__copy__�szFraction.__copy__cCs t|�tkr|S|�|j|j�Srr�)r2Zmemorrr�__deepcopy__�szFraction.__deepcopy__)rN)r=)N)Cr8�
__module__�__qualname__rP�	__slots__r!�classmethodr:r;r(rB�propertyr%r&rDrErQrVr|�add�__add__�__radd__rW�sub�__sub__�__rsub__rY�mul�__mul__�__rmul__rZ�truediv�__truediv__�__rtruediv__r\�floordiv�__floordiv__�
__rfloordiv__r^r]�
__divmod__�__rdivmod__r_�mod�__mod__�__rmod__r`rarcrdrerfrgrhrkrrrxr{r~r�r�r�r�r�r�r��
__classcell__rrr5rr<sdm



7

k
)rPrrrr#r|�re�sys�__all__rr
�	hash_info�modulusro�infrp�compile�VERBOSE�
IGNORECASEr*r$rrrrr�<module>s
�datetime.cpython-38.opt-2.pyc000064400000134612151450073350011742 0ustar00U

e5d�X�
@sRddlZddlZddlZdd�ZdZdZdZddd	dd
dd
ddd
dd
dg
Z	dgZ
dZe	dd�D]Ze
�
e�ee7Zq`[[dd�Zd
d�Zdd�Zdd�Zdd�Zed�Zed�Zed�Zdd�Zdddddddd d!d"d#d$d%g
Zdd&d'd(d)d*d+d,gZd-d.�Zdhd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'GdLdM�dM�Z(e(dN�e(_)e(dOdPdQdQdRdS�e(_*e(ddT�e(_+GdUdV�dV�Z,e,Z-e,ddd�e,_)e,ddWd�e,_*e(ddX�e,_+GdYdZ�dZ�Z.e.Z/Gd[d\�d\�ZeZ0eddd�e_)edPdQdQdR�e_*e(ddT�e_+Gd]d^�d^e,�Z1e1ddd�e1_)e1ddWddPdQdQdR�e1_*e(ddT�e1_+d_d`�Z2Gdadb�dbe.�Z3e3�4e(d��e3_5e3�4e(dPdQdc��e3_)e3�4e(dPdQdc��e3_*e1dddde3j5de�Z6zddfl7TWne8k
�r�YnXX[[
[	[[[[6[[[[#["[$[%[ [![[&[-[[[[[[[2[[[[0[/[[['[[[ddgl7m9Z9dS)i�NcCs||krdS||krdSdS)Nr�������x�yrr� /usr/lib64/python3.8/datetime.py�_cmpsr	ri'i۹7r���cCs$|ddko"|ddkp"|ddkS)N�r�d�r)�yearrrr�_is_leap%srcCs(|d}|d|d|d|dS)Nr�mr
rrr)rrrrr�_days_before_year)srcCs|dkrt|�rdSt|S)N��)r�_DAYS_IN_MONTH�r�monthrrr�_days_in_month.srcCst||dkot|�S�Nr)�_DAYS_BEFORE_MONTHrrrrr�_days_before_month5srcCs t||�}t|�t||�|S�N)rrr�rr�day�dimrrr�_ymd2ord:s
��r!i��e�c	Cs�|d8}t|t�\}}|dd}t|t�\}}t|t�\}}t|d�\}}||d|d|7}|dkst|dkr�|dddfS|dko�|d	kp�|dk}|d
d?}t||dko�|}||kr�|d8}|t||dko�|8}||8}|||dfS)
Nrrrrr
�r
���2r#r)�divmod�_DI400Y�_DI100Y�_DI4Yrr)	�nZn400rZn100Zn4Zn1ZleapyearrZ	precedingrrr�_ord2ymdSs"r-ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecZMonZTueZWedZThuZFriZSatZSunc	Cs>t|||�dd}t||�|}t�|||||||||f	�S�N��)r!r�_time�struct_time)	r�m�d�hh�mm�ssZdstflagZwdayZdnumrrr�_build_struct_time�sr8�autocCstdddddd�}|dkr&|r dnd	}n|d
kr6|d}z||}Wntk
r^td��YnX|�||||�SdS)
Nz{:02d}z
{:02d}:{:02d}z{:02d}:{:02d}:{:02d}z{:02d}:{:02d}:{:02d}.{:03d}z{:02d}:{:02d}:{:02d}.{:06d})�hours�minutes�seconds�milliseconds�microsecondsr9r>r<r=��zUnknown timespec value)�KeyError�
ValueError�format)r5r6r7�us�timespecZspecs�fmtrrr�_format_time�s�rFcCs�d}|dk	r�|jdkr"d}|}nd}t|tdd��\}}t|tdd��\}}|d|||f7}|sj|jr�|d	|j7}|jr�|d
|j7}|S)N�r�-�+r�r:�r;z%s%02d:%02dz:%02d�.%06d)�daysr(�	timedeltar>r<)�off�s�signr5r6r7rrr�_format_offset�s

rRcCs�d}d}d}g}|j}dt|�}}	||	k�r�||}
|d7}|
dk�r�||	k�r�||}
|d7}|
dkr�|dkr�dt|dd�}|�|��q�|
dk�r^|dk�rRd}t|d	��rR|��}|dk	�rRd
}|jdkr�|}d}t|tdd��\}
}t|tdd
��\}}|j}|j	}|�r,d||
|||f}n&|�rDd||
||f}nd||
|f}|�|�n^|
dk�r�|dk�r�d}t|d��r�|�
�}|dk	�r�|�dd�}|�|�n|d�||
�n|d�q$||
�q$d�|�}t
�||�S)Nrr�%�fz%06d�microsecond�zrG�	utcoffsetrIrHrJrKz%c%02d%02d%02d.%06dz%c%02d%02d%02dz
%c%02d%02d�Z�tznamez%%)�append�len�getattr�hasattrrWrMr(rNr<r>rY�replace�joinr1�strftime)�objectrB�	timetupleZfreplaceZzreplaceZZreplaceZ	newformat�push�ir,Zch�offsetrQ�h�restr3rP�urrr�_wrap_strftime�sl


�










ricCsjt|dd��}|ddkr,td|d��t|dd��}|ddkrPtd��t|dd	��}|||gS)
Nrr
rHzInvalid date separator: %sr#r0zInvalid date separator��
)�intrA)Zdtstrrrrrrr�_parse_isoformat_datesrmcCs
t|�}ddddg}d}tdd�D]t}||dkr:td��t|||d��||<|d7}|||d�}|rv|dkrzq�|dkr�td|��|d7}q"||k�r||dkr�td	��nN|d7}||}|d
kr�td	��t||d��|d<|dk�r|dd9<|S)Nrr%rzIncomplete time componentr�:zInvalid time separator: %c�.zInvalid microsecond component)r%r/r?)r[�rangerArl)�tstr�len_str�
time_comps�pos�compZ	next_charZ
len_remainderrrr�_parse_hh_mm_ss_ffs2



rvc
Cs�t|�}|dkrtd��|�d�dp2|�d�d}|dkrL|d|d�n|}t|�}d}|dkr�||d�}t|�dkr�td��t|�}td	d
�|D��r�tj}nD||ddkr�dnd}t|d|d|d|dd
�}	t||	�}|�|�|S)NrzIsoformat time too shortrHrrIr)r#rj�zMalformed time zone stringcss|]}|dkVqdS)rNr)�.0rrrr�	<genexpr>Tsz(_parse_isoformat_time.<locals>.<genexpr>rr%�r:r;r<r>)	r[rA�findrv�all�timezone�utcrNrZ)
rqrrZtz_posZtimestrrsZtziZtzstrZtz_compsZtzsignZtdrrr�_parse_isoformat_time;s,�
rcCs&|dk	r"t|t�s"tdt|���dS)Nz4tzinfo.tzname() must return None or string, not '%s')�
isinstance�str�	TypeError�type)�namerrr�
_check_tznameds�r�cCs^|dkrdSt|t�s*td|t|�f��td�|krHtd�ksZntd||f��dS)Nz3tzinfo.%s() must return None or timedelta, not '%s'rzN%s()=%s, must be strictly between -timedelta(hours=24) and timedelta(hours=24))r�rNr�r�rA)r�rerrr�_check_utc_offsetos

� �r�cCs�t|t�r|St|t�r td��z|��}Wntk
r@Yn"Xt|t�s^tdt|�j��|S|}z|��}Wntk
r�YnDXt|t�s�tdt|�j��ddl	}|j
dt|�jtdd�|Stdt|�j��dS)Nz$integer argument expected, got floatz$__index__ returned non-int (type %s)z"__int__ returned non-int (type %s)rz$an integer is required (got type %s)r)�
stacklevel)r�rl�floatr��	__index__�AttributeErrorr��__name__�__int__�warnings�warn�DeprecationWarning)�valueZorigr�rrr�_check_int_field{sB


�
����r�cCs�t|�}t|�}t|�}t|kr,tks@ntdttf|��d|krTdks`ntd|��t||�}d|kr~|ks�ntd||��|||fS)Nzyear must be in %d..%drr$zmonth must be in 1..12zday must be in 1..%d)r��MINYEAR�MAXYEARrArrrrr�_check_date_fields�s

r�cCs�t|�}t|�}t|�}t|�}d|kr4dks@ntd|��d|krTdks`ntd|��d|krtdks�ntd|��d|kr�dks�ntd|��|d	kr�td
|��|||||fS)Nr�zhour must be in 0..23�;zminute must be in 0..59zsecond must be in 0..59�?Bz microsecond must be in 0..999999)rrzfold must be either 0 or 1)r�rA)�hour�minute�secondrU�foldrrr�_check_time_fields�s




r�cCs|dk	rt|t�std��dS)Nz4tzinfo argument must be None or of a tzinfo subclass)r��tzinfor�)�tzrrr�_check_tzinfo_arg�sr�cCs tdt|�jt|�jf��dS)Nzcan't compare '%s' to '%s')r�r�r�rrrr�	_cmperror�s�r�cCsRt||�\}}|d9}|dkr&||kn||k}|sF||krN|ddkrN|d7}|S)Nrrr)r()�a�b�q�rZgreater_than_halfrrr�_divide_and_round�sr�c@seZdZdZd>dd�Zdd�Zdd�Zd	d
�Zedd��Z	ed
d��Z
edd��Zdd�ZeZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#d=S)?rN)�_days�_seconds�
_microseconds�	_hashcodercCs�d}}	}
||d7}||d|d7}||d7}t|t�rtt�|�\}}t�|d�\}}
t|
�}	t|�}nd}|}t|t�r�t�|�\}}t|�}||7}n|}t|d�\}}||7}|	t|�7}	|d	}t|t��rt||�}t|d
�\}}t|d�\}}||7}|	|7}	n@t|�}t|d
�\}}t|d�\}}||7}|	|7}	t||�}t|d
�\}}
|	|7}	t|	d�\}}	||7}t|�dk�r�td|��t	�
|�}||_|	|_|
|_
d
|_|S)Nrr0�<�r?g�@g�Q���.A�@B�ɚ;z$timedelta # of days is too large: %dr)r�r��_math�modfrlr(�round�abs�
OverflowErrorra�__new__r�r�r�r�)�clsrMr<r>r=r;r:Zweeksr4rPrCZdayfracZdaysecondsfracZdaysecondswholeZsecondsfracZusdouble�selfrrrr��sZ




ztimedelta.__new__cCspg}|jr|�d|j�|jr0|�d|j�|jrF|�d|j�|sT|�d�d|jj|jjd�|�fS)Nzdays=%dz
seconds=%dzmicroseconds=%d�0�	%s.%s(%s)�, )r�rZr�r��	__class__�
__module__�__qualname__r_)r��argsrrr�__repr__Ms
�ztimedelta.__repr__cCsdt|jd�\}}t|d�\}}d|||f}|jrLdd�}d||j�|}|jr`|d|j}|S)Nr�z%d:%02d:%02dcSs|t|�dkrdpdfS)NrrPrG)r�)r,rrr�plural`sz!timedelta.__str__.<locals>.pluralz
%d day%s, rL)r(r�r�r�)r�r6r7r5rPr�rrr�__str__[sztimedelta.__str__cCs|jd|jd|jdS�Nr�r�)rMr<r>�r�rrr�
total_secondsgs
��ztimedelta.total_secondscCs|jSr�r�r�rrrrMmsztimedelta.dayscCs|jSr)r�r�rrrr<rsztimedelta.secondscCs|jSr)r�r�rrrr>wsztimedelta.microsecondscCs2t|t�r.t|j|j|j|j|j|j�StSr�r�rNr�r�r��NotImplemented�r��otherrrr�__add__|s


�ztimedelta.__add__cCs2t|t�r.t|j|j|j|j|j|j�StSrr�r�rrr�__sub__�s


�ztimedelta.__sub__cCst|t�r||StSr)r�rNr�r�rrr�__rsub__�s

ztimedelta.__rsub__cCst|j|j|j�Sr)rNr�r�r�r�rrr�__neg__�s�ztimedelta.__neg__cCs|Srrr�rrr�__pos__�sztimedelta.__pos__cCs|jdkr|S|SdS�Nrr�r�rrr�__abs__�s
ztimedelta.__abs__cCs`t|t�r(t|j||j||j|�St|t�r\|��}|��\}}tddt	|||��St
Sr�)r�rlrNr�r�r�r��_to_microseconds�as_integer_ratior�r��r�r��usecr�r�rrr�__mul__�s

�
ztimedelta.__mul__cCs|jd|jd|jSr��r�r�r�r�rrrr��s�ztimedelta._to_microsecondscCsNt|ttf�stS|��}t|t�r0||��St|t�rJtdd||�SdSr�)r�rlrNr�r�)r�r�r�rrr�__floordiv__�s

ztimedelta.__floordiv__cCs~t|tttf�stS|��}t|t�r2||��St|t�rNtddt||��St|t�rz|��\}}tddt|||��SdSr�)r�rlr�rNr�r�r�r�r�rrr�__truediv__�s


ztimedelta.__truediv__cCs*t|t�r&|��|��}tdd|�StSr�)r�rNr�r�)r�r�r�rrr�__mod__�s
ztimedelta.__mod__cCs4t|t�r0t|��|���\}}|tdd|�fStSr�)r�rNr(r�r�)r�r�r�r�rrr�
__divmod__�s
�ztimedelta.__divmod__cCs t|t�r|�|�dkStSdSr��r�rNr	r�r�rrr�__eq__�s
ztimedelta.__eq__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__le__�s
ztimedelta.__le__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__lt__�s
ztimedelta.__lt__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__ge__�s
ztimedelta.__ge__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__gt__�s
ztimedelta.__gt__cCst|��|���Sr)r	�	_getstater�rrrr	�sztimedelta._cmpcCs|jdkrt|���|_|jS�Nr�r��hashr�r�rrr�__hash__�s
ztimedelta.__hash__cCs|jdkp|jdkp|jdkSr�r�r�rrr�__bool__s

��ztimedelta.__bool__cCs|j|j|jfSrr�r�rrrr�
sztimedelta._getstatecCs|j|��fSr�r�r�r�rrr�
__reduce__
sztimedelta.__reduce__N)rrrrrrr)$r�r�r��	__slots__r�r�r�r��propertyrMr<r>r��__radd__r�r�r�r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�rrrrrN�sP�
e


		
		rNi6e�r�r�r�r�)rMr:r;r<r>)r>c@s<eZdZdZdCdd�Zedd��Zedd��Zed	d
��Zedd��Z	ed
d��Z
dd�Zdd�Zdd�Z
dd�Zdd�ZeZedd��Zedd��Zedd��Zdd �Zd!d"�ZdDd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZeZ d5d6�Z!d7d8�Z"d9d:�Z#d;d<�Z$d=d>�Z%d?d@�Z&dAdB�Z'dS)E�date)�_year�_month�_dayr�NcCs�|dkr�t|ttf�r�t|�dkr�dt|dd��krBdkr�nnTt|t�r|z|�d�}Wntk
rztd��YnXt�	|�}|�
|�d|_|St|||�\}}}t�	|�}||_
||_||_d|_|S)	Nr
rrr%r$�latin1znFailed to encode latin1 string when unpickling a date object. pickle.load(data, encoding='latin1') is assumed.r)r��bytesr�r[�ord�encode�UnicodeEncodeErrorrArar��_date__setstater�r�r�r�r�)r�rrrr�rrrr�3s8�
���

�



zdate.__new__c	Cs(t�|�\	}}}}}}}}	}
||||�Sr)r1�	localtime)r��trr3r4r5r6r7�weekday�jday�dstrrr�
fromtimestampUszdate.fromtimestampcCst��}|�|�Sr�r1�timer��r�r�rrr�today[sz
date.todaycCst|�\}}}||||�Sr)r-)r�r,rr3r4rrr�fromordinalaszdate.fromordinalcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS�N�#fromisoformat: argument must be str�Invalid isoformat string: )r�r�r�rm�	ExceptionrA)r��date_stringrrr�
fromisoformatks
zdate.fromisoformatc	Cs�t|krtks$ntd|����d|kr8dks�nd}|dkrrt|dd�d}|dksn|dkrrt|�rrd	}|r�td
|����d|kr�dks�ntd|�d
���|dd|d}t|�}||}|t|��S)NzYear is out of range: r�5Trr0r
r%FzInvalid week: rjzInvalid weekday: z (range is [1, 7]))r�r�rAr!r�_isoweek1mondayr-)	r�r�weekrZout_of_rangeZ
first_weekdayZ
day_offsetZday_1Zord_dayrrr�fromisocalendarws$�zdate.fromisocalendarcCs d|jj|jj|j|j|jfS)Nz%s.%s(%d, %d, %d))r�r�r�r�r�r�r�rrrr��s�z
date.__repr__cCs.|��dpd}dt|t|j|j|jfS)Nr0z%s %s %2d 00:00:00 %04d)�	toordinal�	_DAYNAMES�_MONTHNAMESr�r�r��r�r�rrr�ctime�s�z
date.ctimecCst|||���Sr)rirb�r�rErrrr`�sz
date.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�S�Nzmust be str, not %sr�r�r�r�r�r�r[r`rrrr�
__format__�s


zdate.__format__cCsd|j|j|jfS)Nz%04d-%02d-%02d)r�r�r�r�rrr�	isoformat�s	zdate.isoformatcCs|jSr)r�r�rrrr�sz	date.yearcCs|jSr)r�r�rrrr�sz
date.monthcCs|jSr)r�r�rrrr�szdate.daycCst|j|j|jdddd�S)Nrr)r8r�r�r�r�rrrrb�s�zdate.timetuplecCst|j|j|j�Sr)r!r�r�r�r�rrrr�szdate.toordinalcCs:|dkr|j}|dkr|j}|dkr*|j}t|�|||�Sr)r�r�r�r�)r�rrrrrrr^�szdate.replacecCst|t�r|�|�dkStSr��r�r�r	r�r�rrrr��s
zdate.__eq__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__le__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__lt__cCst|t�r|�|�dkStSr�rr�rrrr�
s
zdate.__ge__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__gt__cCsB|j|j|j}}}|j|j|j}}}t|||f|||f�Sr)r�r�r�r	)r�r�rr3r4Zy2Zm2Zd2rrrr	sz	date._cmpcCs|jdkrt|���|_|jSr�r�r�rrrr�s
z
date.__hash__cCsJt|t�rF|��|j}d|kr,tkr>nnt|��|�Std��tS)Nr�result out of range)	r�rNrrM�_MAXORDINALr�rr�r�)r�r��orrrr�%s
zdate.__add__cCsDt|t�r|t|j�St|t�r@|��}|��}t||�StSr)r�rNrMr�rr�)r�r��days1�days2rrrr�0s

zdate.__sub__cCs|��ddSr.�rr�rrrr�:szdate.weekdaycCs|��dpdS)Nr0rr�rrr�
isoweekday@szdate.isoweekdaycCs�|j}t|�}t|j|j|j�}t||d�\}}|dkr^|d8}t|�}t||d�\}}n$|dkr�|t|d�kr�|d7}d}||d|dfS)Nr0rr�4)r�r	r!r�r�r()r�r�week1mondayrr
rrrr�isocalendarEs
zdate.isocalendarcCs&t|jd�\}}t|||j|jg�fS�N�)r(r�r�r�r�)r��yhi�ylorrrr�cszdate._getstatecCs"|\}}|_|_|d||_dSr!)r�r�r�)r��stringr#r$rrr�
__setstategszdate.__setstatecCs|j|��fSrr�r�rrrr�kszdate.__reduce__)NN)NNN)(r�r�r�r�r��classmethodr�rrrrr�rr`rrr�r�rrrrbrr^r�r�r�r�r�r	r�r�r�r�r�rr r�r�r�rrrrr�sV
"


	

$



	
r�r$)rMc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
r�rcCstd��dS)Nz&tzinfo subclass must override tzname()��NotImplementedError�r��dtrrrrY|sz
tzinfo.tznamecCstd��dS)Nz)tzinfo subclass must override utcoffset()r(r*rrrrW�sztzinfo.utcoffsetcCstd��dS)Nz#tzinfo subclass must override dst()r(r*rrrr��sz
tzinfo.dstcCs�t|t�std��|j|k	r$td��|��}|dkr<td��|��}|dkrTtd��||}|r�||7}|��}|dkr�td��||S)Nz&fromutc() requires a datetime argumentzdt.tzinfo is not selfz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultz;fromutc(): dt.dst gave inconsistent results; cannot convert)r��datetimer�r�rArWr�)r�r+ZdtoffZdtdst�deltarrr�fromutc�s"

ztzinfo.fromutccCsft|dd�}|r|�}nd}t|dd�}|r4|�}nt|dd�pBd}|dkrV|j|fS|j||fSdS)N�__getinitargs__r�__getstate__�__dict__)r\r�)r�Zgetinitargsr��getstate�staterrrr��s
ztzinfo.__reduce__N)	r�r�r�r�rYrWr�r.r�rrrrr�usr�c@s&eZdZdZdAdd�dd�Zedd��Zed	d
��Zedd��Zed
d��Z	edd��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�ZdBdd�Zd d!�Zd"d#�Zd$d%�ZdCd'd(�ZeZed)d*��Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdDdd�d6d7�ZdEd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dS)Fr�)�_hour�_minute�_second�_microsecond�_tzinfor��_foldrN�r�cCs�t|ttf�r�t|�dkr�t|dd��d@dkr�t|t�rhz|�d�}Wntk
rftd��YnXt�	|�}|�
||p~d�d|_|St|||||�\}}}}}t
|�t�	|�}||_||_||_||_||_d|_||_|S)	Nr/rr�r&r�znFailed to encode latin1 string when unpickling a time object. pickle.load(data, encoding='latin1') is assumed.r)r�r�r�r[r�r�r�rArar��_time__setstater�r�r�r4r5r6r7r8r9)r�r�r�r�rUr�r�r�rrrr��s>
�
�

�
ztime.__new__cCs|jSr�r4r�rrrr��sz	time.hourcCs|jSr�r5r�rrrr�sztime.minutecCs|jSr�r6r�rrrr�sztime.secondcCs|jSr�r7r�rrrrUsztime.microsecondcCs|jSr�r8r�rrrr�sztime.tzinfocCs|jSr�r9r�rrrr�sz	time.foldcCs$t|t�r|j|dd�dkStSdS)NT��allow_mixedr�r�r�r	r�r�rrrr�s
ztime.__eq__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�#s
ztime.__le__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�)s
ztime.__lt__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�/s
ztime.__ge__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�5s
ztime.__gt__Fc
Cs�|j}|j}d}}||kr"d}n|��}|��}||k}|rht|j|j|j|jf|j|j|j|jf�S|dksx|dkr�|r�dStd��|jd|j|tdd�}|jd|j|tdd�}	t||j|jf|	|j|jf�S)NTrz$cannot compare naive and aware timesr�rrK)	r8rWr	r4r5r6r7r�rN)
r�r�rD�mytz�ottz�myoff�otoff�base_compareZmyhhmmZothhmmrrrr	;s2����z	time._cmpcCs�|jdkr�|jr|jdd�}n|}|��}|sBt|��d�|_nztt|j|j	d�|tdd��\}}|tdd�}d|kr�dkr�nntt
|||j|j��|_nt|||j|jf�|_|jS)	Nrrr:�r:r;rrJrKr&)
r�r�r^rWr�r�r(rNr�r�r�r�rU)r�r��tzoffrfr3rrrr�Ws
�z
time.__hash__cCs|��}t|�Sr)rWrR)r�rOrrr�_tzstrnsztime._tzstrcCs�|jdkrd|j|jf}n|jdkr2d|j}nd}d|jj|jj|j|j|f}|jdk	rx|dd�d|jd}|jr�|dd�d	}|S)
Nrz, %d, %dz, %drGz%s.%s(%d, %d%s)r�, tzinfo=%r�)�	, fold=1))	r7r6r�r�r�r4r5r8r9�r�rPrrrr�ss 

�
z
time.__repr__r9cCs0t|j|j|j|j|�}|��}|r,||7}|Sr)rFr4r5r6r7rM)r�rDrPr�rrrr�s
�ztime.isoformatcCsHt|t�std��z|t|��WStk
rBtd|����YnXdSr)r�r�r�rrrA)r�Ztime_stringrrrr�s
ztime.fromisoformatc	Cs(ddd|j|j|jdddf	}t|||�S)Nilrrr)r4r5r6ri)r�rErbrrrr`�s�z
time.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�Srrrrrrr�s


ztime.__format__cCs(|jdkrdS|j�d�}td|�|S�NrW�r8rWr��r�rerrrrW�s


ztime.utcoffsetcCs&|jdkrdS|j�d�}t|�|Sr�r8rYr��r�r�rrrrY�s

ztime.tznamecCs(|jdkrdS|j�d�}td|�|S�Nr��r8r�r�rTrrrr��s
	

ztime.dstTcCsl|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}t|�||||||d�S�NTr:)r�r�r�rUr�r9r�)r�r�r�r�rUr�r�rrrr^�sztime.replacer%cCspt|jd�\}}t|d�\}}|j}|jr:|dkr:|d7}t||j|j|||g�}|jdkrb|fS||jfSdS�Nr"r%�)r(r7r4r9r�r5r6r8)r��protocol�us2�us3�us1rf�	basestaterrrr��s�
ztime._getstatecCst|dk	rt|t�std��|\}|_|_}}}|dkrHd|_|d|_nd|_||_|d>|Bd>|B|_||_dS)N�bad tzinfo state argr;rr[rrj)	r��
_tzinfo_classr�r5r6r9r4r7r8)r�r%r�rfr_r]r^rrrr&�sztime.__setstatecCs|j|�|�fSrr��r�r\rrr�
__reduce_ex__sztime.__reduce_ex__cCs
|�d�Sr�rdr�rrrr�sztime.__reduce__)rrrrN)F)r9)NNNNT)r%)#r�r�r�r�r�r�r�r�r�rUr�r�r�r�r�r�r�r	r�rMr�rr�r'rr`rrWrYr�r^r�r<rdr�rrrrr��sR(








		
��


r�c@s�eZdZejejZdcdd�dd�Zedd��Zedd	��Z	ed
d��Z
edd
��Zedd��Zedd��Z
edd��Zedddd��Zedd��Zededd��Zedd��Zedfdd��Zedd ��Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zdgdd�d/d0�Zd1d2�Zdhd3d4�Zd5d6�Zdid9d:�Zd;d<�Z d=d>�Z!ed?d@��Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*djdRdS�Z+dTdU�Z,e,Z-dVdW�Z.dXdY�Z/dkd[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dS)lr,Nrr:c	Cst|ttf�r�t|�dkr�dt|dd��d@kr>dkr�nnVt|t�rxzt|d�}Wntk
rvtd��YnXt�|�}
|
�	||�d	|
_
|
St|||�\}}}t|||||	�\}}}}}	t
|�t�|�}
||
_||
_||
_||
_||
_||
_||
_||
_d	|
_
|	|
_|
S)
Nrkrrr%r;r$r�zrFailed to encode latin1 string when unpickling a datetime object. pickle.load(data, encoding='latin1') is assumed.r)r�r�r�r[r�r�rArar��_datetime__setstater�r�r�r�r�r�r�r4r5r6r7r8r9)r�rrrr�r�r�rUr�r�r�rrrr�sL��

�

�
zdatetime.__new__cCs|jSrr=r�rrrr�Csz
datetime.hourcCs|jSrr>r�rrrr�Hszdatetime.minutecCs|jSrr?r�rrrr�Mszdatetime.secondcCs|jSrr@r�rrrrURszdatetime.microsecondcCs|jSrrAr�rrrr�Wszdatetime.tzinfocCs|jSrrBr�rrrr�\sz
datetime.foldc	Cspt�|�\}}t|d�}|dkr4|d7}|d8}n|dkrL|d8}|d7}|rVtjntj}||�\	}}}	}
}}}
}}t|d�}||||	|
||||�}|dk�rbd}||kr�tj�	d�r�|S|||�dd�\}}}	}
}}||||	|
||||�}||t
d|�}|jdk�rl|||t
dd��dd�\}}}	}
}}||||	|
||||�}||k�rld|_n
|�
|�}|S)	Nr�r�rrr�r��winr/)r�r�r�r1�gmtimer��min�sys�platform�
startswithrNrMr9r.)r�r�r~r�ZfracrCZ	converterrr3r4r5r6r7r�r�r��result�max_fold_secondsZprobe1ZtransZprobe2rrr�_fromtimestamp`s4


 *

zdatetime._fromtimestampcCst|�|�||dk	|�Sr)r�ro)r�r�r�rrrr��szdatetime.fromtimestampcCs|�|dd�S)NT)ror�rrr�utcfromtimestamp�szdatetime.utcfromtimestampcCst��}|�||�Srr�)r�r�r�rrr�now�szdatetime.nowcCst��}|�|�Sr)r1r�rpr�rrr�utcnow�szdatetime.utcnowTcCs\t|t�std��t|t�s$td��|dkr2|j}||j|j|j|j|j	|j
|j||jd�	S)Nz%date argument must be a date instancez%time argument must be a time instanceTr:)
r��_date_classr��_time_classr�rrrr�r�r�rUr�)r�r�r�r�rrr�combine�s

�zdatetime.combinecCs�t|t�std��|dd�}|dd�}zt|�}Wn"tk
rXtd|����YnX|r�zt|�}Wq�tk
r�td|����Yq�Xndddddg}|||�S)Nrrrk�r)r�r�r�rmrAr)r�rZdstrrqZdate_componentsZtime_componentsrrrr�s
zdatetime.fromisoformatcCsD|��}|dkrd}n|r d}nd}t|j|j|j|j|j|j|�S)Nrrr)r�r8rrrr�r�r�)r�r�rrrrb�s�zdatetime.timetuplec
s�tddd��d}|�tdd�}�fdd�}||�|}||}||�}||kr�|||f|j}||�|}||kr�|Sn||}||}||�}	|	|kr�|S||kr�|Sttf|j||�S)N�rr�rcs>t�|�dd�\}}}}}}t||||||��tdd�S)Nr/rr)r1r�r,rN)rhrr3r4r5r6r7�Zepochrr�local�szdatetime._mktime.<locals>.local)r,rNr��maxri)
r�rnr�ryr�Zu1�t1Zu2r��t2rrxr�_mktime�s(zdatetime._mktimecCs0|jdkr |��}||jdS|t��SdS)Nr�)r8r}rU�_EPOCHr�rQrrr�	timestamp�s
zdatetime.timestampcCsT|��}|r||8}|j|j|j}}}|j|j|j}}}t||||||d�Sr�)rWrrrr�r�r�r8)r�rerr3r4r5r6r7rrr�utctimetupleszdatetime.utctimetuplecCst|j|j|j�Sr)r�r�r�r�r�rrrr�sz
datetime.datecCst|j|j|j|j|jd�S�Nr:)r�r�r�r�rUr�r�rrrr�sz
datetime.timecCs t|j|j|j|j|j|jd�Sr�)r�r�r�r�rUr8r�r�rrr�timetzs�zdatetime.timetzc	
Cs�|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}|dkrb|j}|dkrp|j}|	dkr~|j}	t	|�|||||||||	d�	SrY)
rrrr�r�r�rUr�r�r�)
r�rrrr�r�r�rUr�r�rrrr^s.�zdatetime.replacecCs\|jdkr|��}n|ttdd�}t�|�}t|dd��}|j}|j}t	t|d�|�S)Nr)r<r/)
r�r}r~rNr1r�r,�	tm_gmtoff�tm_zoner})r�ZtsZlocaltmryZgmtoffZzonerrr�_local_timezone4s


zdatetime._local_timezonecCs�|dkr|��}nt|t�s$td��|j}|dkrF|��}|�|�}n,|�|�}|dkrr|jdd���}|�|�}||kr~|S||j|d�}|�|�S)Nz)tz argument must be an instance of tzinfo�r�)r�r�r�r�rWr^r.)r�r�rFZmyoffsetr~rrr�
astimezone@s 



zdatetime.astimezonecCs:|��dpd}dt|t|j|j|j|j|j|jfS)Nr0z%s %s %2d %02d:%02d:%02d %04d)	rr
rr�r�r4r5r6r�rrrrr[s�zdatetime.ctime�Tr9cCsNd|j|j|j|ft|j|j|j|j|�}|��}t	|�}|rJ||7}|S)Nz%04d-%02d-%02d%c)
r�r�r�rFr4r5r6r7rWrR)r��seprDrPrOr�rrrres��zdatetime.isoformatcCs�|j|j|j|j|j|j|jg}|ddkr2|d=|ddkrD|d=d|jj|jj	d�
tt|��f}|j
dk	r�|dd�d|j
d}|jr�|dd�d}|S)Nrrr�r�rNrOrP)r�r�r�r4r5r6r7r�r�r�r_�mapr�r8r9)r��LrPrrrr��s&��
zdatetime.__repr__cCs|jdd�S)N� )r�)rr�rrrr��szdatetime.__str__cCsddl}|�|||�Sr�)�	_strptimeZ_strptime_datetime)r�rrBr�rrr�strptime�szdatetime.strptimecCs(|jdkrdS|j�|�}td|�|SrRrSrTrrrrW�s


zdatetime.utcoffsetcCs&|jdkrdS|j�|�}t|�|SrrUrVrrrrY�s

zdatetime.tznamecCs(|jdkrdS|j�|�}td|�|SrWrXrTrrrr��s
	

zdatetime.dstcCs2t|t�r|j|dd�dkSt|t�s*tSdSdS)NTrCrF)r�r,r	r�r�r�rrrr��s


zdatetime.__eq__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr��r�r,r	r�r�r�r�rrrr��s


zdatetime.__le__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__lt__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__ge__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__gt__Fc		Cs�|j}|j}d}}||kr"d}nT|��}|��}|rn||j|jd���krRdS||j|jd���krndS||k}|r�t|j|j|j|j|j	|j
|jf|j|j|j|j|j	|j
|jf�S|dks�|dkr�|r�dStd��||}|j
dkr�dS|r�dp�dS)NTr:rz(cannot compare naive and aware datetimesrrr)r8rWr^r�r	r�r�r�r4r5r6r7r�rM)	r�r�rDrFrGrHrIrJZdiffrrrr	�sF���
z
datetime._cmpc
Cs�t|t�stSt|��|j|j|j|jd�}||7}t|j	d�\}}t|d�\}}d|j
krhtkr�nn*t|��
t�|j
�t||||j|jd��Std��dS)Nrzr�r�rr�r)r�rNr�rr4r5r6r7r(r<rMrr�rur�rr�r>r8r�)r�r�r-r�Zremr�r�rrrr�s&
���zdatetime.__add__c	Cs�t|t�s"t|t�r||StS|��}|��}|j|jd|jd}|j|jd|jd}t|||||j|j�}|j	|j	kr�|S|�
�}|�
�}||kr�|S|dks�|dkr�td��|||S)Nr�r�z(cannot mix naive and timezone-aware time)r�r,rNr�rr6r5r4r7r8rWr�)	r�r�rrZsecs1Zsecs2�baserHrIrrrr�&s*



�zdatetime.__sub__cCs�|jdkr�|jr|jdd�}n|}|��}|dkrFt|��d�|_nDt|j|j|j	�}|j
d|jd|j}tt
|||j�|�|_|jS)Nrrr:r�r�)r�r�r^rWr�r�r!rrrr�r�r�rNrU)r�r�rLrMr<rrrr�>s
zdatetime.__hash__r%c	Cs�t|jd�\}}t|jd�\}}t|d�\}}|j}|jrJ|dkrJ|d7}t||||j|j|j|j	|||g
�}|j
dkr~|fS||j
fSdSrZ)r(r�r7r�r9r�r�r4r5r6r8)	r�r\r#r$r]r^r_r3r`rrrr�Os"�
zdatetime._getstatec	
Cs�|dk	rt|t�std��|\
}}}|_|_|_|_}}}|dkrTd|_|d|_nd|_||_|d||_	|d>|Bd>|B|_
||_dS)Nrar;rr[rr"rj)r�rbr�r�r4r5r6r9r�r�r7r8)	r�r%r�r#r$r3r_r]r^rrrr&^s"�zdatetime.__setstatecCs|j|�|�fSrr�rcrrrrdmszdatetime.__reduce_ex__cCs
|�d�Srrer�rrrr�pszdatetime.__reduce__)NNrrrrN)N)N)T)NNNNNNNT)N)r�r9)F)r%)4r�r�r�r�r�r�r�r�r�r�r�rUr�r�r'ror�rprqrrrurrbr}rr�r�r^r�r�rrr�r�r�rWrYr�r�r�r�r�r�r	r�r�r�r�r�rfrdr�rrrrr,s���$






+	



#	��



	

%
r,cCs8d}t|dd�}|dd}||}||kr4|d7}|S)Nr%rr/r0)r!)rZTHURSDAYZfirstdayZfirstweekdayrrrrr	ysr	c@s�eZdZdZe�Zefdd�Zeddd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zeddd�ZeZedd��ZdS)r})�_offset�_namecCslt|t�std��||jkr,|s&|jSd}nt|t�s>td��|j|krV|jks`ntd��|�	||�S)Nzoffset must be a timedeltazname must be a stringzYoffset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).)
r�rNr��_Omittedr~r��
_minoffset�
_maxoffsetrA�_create)r�rer�rrrr��s


ztimezone.__new__NcCst�|�}||_||_|Sr)r�r�r�r�)r�rer�r�rrrr��s
ztimezone._createcCs|jdkr|jfS|j|jfSr)r�r�r�rrrr/�s
ztimezone.__getinitargs__cCst|t�r|j|jkStSr)r�r}r�r�r�rrrr��s
ztimezone.__eq__cCs
t|j�Sr)r�r�r�rrrr��sztimezone.__hash__cCsL||jkrdS|jdkr0d|jj|jj|jfSd|jj|jj|j|jfS)Nzdatetime.timezone.utcz	%s.%s(%r)z
%s.%s(%r, %r))r~r�r�r�r�r�r�rrrr��s


��ztimezone.__repr__cCs
|�d�Sr)rYr�rrrr��sztimezone.__str__cCs$t|t�s|dkr|jStd��dS)Nz8utcoffset() argument must be a datetime instance or None)r�r,r�r�r*rrrrW�sztimezone.utcoffsetcCs:t|t�s|dkr.|jdkr(|�|j�S|jStd��dS)Nz5tzname() argument must be a datetime instance or None)r�r,r��_name_from_offsetr�r�r*rrrrY�s

ztimezone.tznamecCs"t|t�s|dkrdStd��dS)Nz2dst() argument must be a datetime instance or None)r�r,r�r*rrrr��sztimezone.dstcCs2t|t�r&|j|k	rtd��||jStd��dS)Nzfromutc: dt.tzinfo is not selfz6fromutc() argument must be a datetime instance or None)r�r,r�rAr�r�r*rrrr.�s



ztimezone.fromutcr&r)r:r>c
Cs�|sdS|td�kr d}|}nd}t|tdd��\}}t|tdd��\}}|j}|j}|r�d|�|d�d	|d�d	|d�d
|d��	S|r�d|�|d�d	|d�d	|d��Sd|�|d�d	|d��S)NZUTCrrHrIrrJrKZ02drnroZ06d)rNr(r<r>)r-rQr:rgr;r<r>rrrr��s( ztimezone._name_from_offset)N)r�r�r�r�rar�r�r'r�r/r�r�r�r�rWrYr�r.rNr�r��staticmethodr�rrrrr}�s$	r}rKrwr�)�*)�__doc__)r9):r�r1Zmathr�rjr	r�r�rrrZdbmr rZrrrrr!r)r*r+r-rr
r8rFrRrirmrvrr�r�r�r�r�r�r�r�rNrirzZ
resolutionr�rsr�rbrtr,r	r}r�r~r~Z	_datetime�ImportErrorr�rrrr�<module>s�

	?�
@') 
=

�[DXatG
pickletools.cpython-38.pyc000064400000203206151450073350011532 0ustar00U

e5d.m�L@s�
dZddlZddlZddlZddlZddlZdddgZejZdZdZ	dZ
d	Zd
ZGdd�de
�Zdd
lmZdd�Zeddedd�Zdd�Zeddedd�Zdd�Zeddedd�Zdd�Zed ded!d�Zd"d#�Zed$d%ed&d�Z�d�d(d)�Zed*eed+d�Zd,d-�Zed.eed/d�Zd0d1�Z ed2ee d3d�Z!d4d5�Z"ed6e	e"d7d�Z#d8d9�Z$ed:e
e$d;d�Z%d<d=�Z&ed>e	e&d?d�Z'd@dA�Z(edBee(dCd�Z)dDdE�Z*edFee*dGd�Z+dHdI�Z,edJee,dKd�Z-dLdM�Z.edNee.dOd�Z/dPdQ�Z0edRe	e0dSd�Z1dTdU�Z2edVee2dWd�Z3dXdY�Z4edZee4d[d�Z5d\d]�Z6d^d_�Z7ed`ee6dad�Z8edbee7dcd�Z9ddde�Z:edfee:dgd�Z;dhdi�Z<edjd%e<dkd�Z=ddllm>Z>dmdn�Z?edoe	e?dpd�Z@dqdr�ZAedse
eAdtd�ZBGdudv�dve
�ZCeCdweDdxdy�ZEZFeCdzeDeGfd{dy�ZHeCd|eGd}dy�ZIeCd~eJddy�ZKeCd�eLeMfd�dy�ZNZOeCd�eLd�dy�ZPeCd�eQd�dy�ZReCd�eMd�dy�ZSeCd�eTd�d�dy�ZUeCd�eVd�dy�ZWeCd�eXd�dy�ZYeCd�eZd�dy�Z[eCd�e\d�dy�Z]eCd�e\d�dy�Z^eCd�e
d�dy�Z_eCd�e
d�dy�Z`eCd�eCd�dy�ZaeCd�eCd�dy�ZbGd�d��d�e
�ZcecZdedd�d�e8geHgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�e9geEgdd�d��edd�d�e@geEgdd�d��edd�d�eBgeEgdd�d��edd�d�egeNgdd�d��edd�d�e%geNgdd�d��edd�d�e#geNgdd�d��edd�d�e)gePgd�d�d��edd�d�e'gePgd�d�d��edd�d�e+gePgdd�d��edd�d�e-geRgd�d�d��edd�d�dge_gd�d�d��edd�d�de_ge_gd�d�d��edd�d�dgeUgdd�d��edd�d�dgeIgdd�d��edd�d�dgeIgdd�d��edd�d�e/geSgdd�d��edd�d�e1geSgdd�d��edd�d�e3geSgdd�d��edd�d�e5geSgdd�d��edd�d�e;geKgdd�d��edd�d�e=geKgdd�d��edd�d�dgeYgdd�d��edd�d�deYe`geYgdd�d��edd�d�deYeaebgeYgdd�d��edd�d�deaebgeYgdd�d��edd�d�dgeWgdd�d��edd�d�deaebgeWgdd�d��edd�d�de`geWgd�dd��ed�d�dde`e`geWgd�dd��ed�d�dde`e`e`geWgd�dd��ed�d�ddge[gd�d	d��ed�d
�ddeaebge[gd�dd��ed�d
�dde[e`e`ge[gd�dd��ed�d�dde[eaebge[gd�dd��ed�d�ddge]gd�dd��ed�d�dde]eaebge]gd�dd��ed�d�ddeaebge^gd�dd��ed�d�dde`ggd�dd��ed�d�d de`ge`e`gd�d!d��ed�d"�d#dgeagd�d$d��ed�d%�d&deaebggd�d'd��ed�d(�d)e8ge`gd�d*d��ed�d+�d,ege`gd�d-d��ed�d.�d/ege`gd�d0d��ed�d1�d2e8ggd�d3d��ed�d4�d5eggd�d6d��ed�d7�d8eggd�d9d��ed�d:�d;de`ge`gd�d<d��ed�d=�d>ege`gd�d?d��ed�d@�dAege`gd�dBd��ed�dC�dDege`gd�dEd��ed�dF�dGe!ge`gd�dHd��ed�dI�dJdeSeSge`gd�dKd��ed�dL�dMde`e`ge`gd�dNd��ed�dO�dPde`e`ge`gd�dQd��ed�dR�dSe!eaebge`gd�dTd��ed�dU�dVdeae`ebge`gd�dWd��ed�dX�dYde`e`ge`gd�dZd��ed�d[�d\de`e`e`ge`gd�d]d��ed�d^�d_eggd�d`d��ed�da�dbde`ggd�dcd��ed�dd�deeggd�dfd��ed�dg�dhege`gd�did��ed�dj�dkde`ge`gd�dld��gDZe[diZfiZgehee�D]n\ZiZjejjkefk�rBel�dmejjkefejjkeif��ejjmegk�rjel�dnejjmegejjmeif��eiefejjk<eiegejjm<�q[f[g[i[jiZneeD]Zjejenejjm<�q�[j�d��dp�dq�Zoeo�[o�d��dr�ds�Zp�dtd�Zq�dud�Zr�d��dvd�ZsG�dw�dx��dx�Zt�dyZu�dzZveuev�d{�Zw�d|�d}�Zxey�d~k�
r�ddlzZzezj{�d�d��Z|e|j}�d�ez�~�d���d��d��d��e|j}�d��d�ejez�~�d���d��d��e|j}�d��d��d��d��d��e|j}�d��d�deD�d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��e|���Z�e�j��
rPex�n�e�j��
r^�d�ndZ�e�j��
ste|���n�e�e�j��dk�
r�ese�j�de�j�de�j�e��nVe�j��
r�indZ�e�j�D]>Z�e�j�j�e�jk�d��Z�e�j���e��d��ese�e�j�e�e�j�e���
q�dS(�ar"Executable documentation" for the pickle module.

Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here.  Some functions meant for external use:

genops(pickle)
   Generate all the opcodes in a pickle, as (opcode, arg, position) triples.

dis(pickle, out=None, memo=None, indentlevel=4)
   Print a symbolic disassembly of a pickle.
�N�dis�genops�optimize���������������c@seZdZdZdd�ZdS)�ArgumentDescriptor��name�n�reader�doccCs`t|t�st�||_t|t�r8|dks<|ttttt	fks<t�||_
||_t|t�sVt�||_dS�Nr)
�
isinstance�str�AssertionErrorr�int�
UP_TO_NEWLINE�TAKEN_FROM_ARGUMENT1�TAKEN_FROM_ARGUMENT4�TAKEN_FROM_ARGUMENT4U�TAKEN_FROM_ARGUMENT8Ur
rr)�selfrr
rr�r�#/usr/lib64/python3.8/pickletools.py�__init__�s��zArgumentDescriptor.__init__N��__name__�
__module__�__qualname__�	__slots__rrrrrr
�sr
)�unpackcCs"|�d�}|r|dStd��dS)zG
    >>> import io
    >>> read_uint1(io.BytesIO(b'\xff'))
    255
    �rz'not enough data in stream to read uint1N)�read�
ValueError��f�datarrr�
read_uint1�s
r*�uint1r$zOne-byte unsigned integer.rcCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint2(io.BytesIO(b'\xff\x00'))
    255
    >>> read_uint2(io.BytesIO(b'\xff\xff'))
    65535
    �z<Hrz'not enough data in stream to read uint2N�r%�len�_unpackr&r'rrr�
read_uint2�s	
r0�uint2r,z)Two-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_int4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_int4(io.BytesIO(b'\x00\x00\x00\x80')) == -(2**31)
    True
    �z<irz&not enough data in stream to read int4Nr-r'rrr�	read_int4�s	
r3�int4r2z8Four-byte signed integer, little-endian, 2's complement.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_uint4(io.BytesIO(b'\x00\x00\x00\x80')) == 2**31
    True
    r2z<Irz'not enough data in stream to read uint4Nr-r'rrr�
read_uint4s	
r5�uint4z*Four-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00'))
    255
    >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1
    True
    �z<Qrz'not enough data in stream to read uint8Nr-r'rrr�
read_uint8&s	
r8�uint8r7z+Eight-byte unsigned integer, little-endian.TcCs�|��}|�d�std��|dd�}|rtdD]8}|�|�r.|�|�sVtd||f��|dd�}qtq.td|��|r�t�|�d	�d
�}|S)au
    >>> import io
    >>> read_stringnl(io.BytesIO(b"'abcd'\nefg\n"))
    'abcd'

    >>> read_stringnl(io.BytesIO(b"\n"))
    Traceback (most recent call last):
    ...
    ValueError: no string quotes around b''

    >>> read_stringnl(io.BytesIO(b"\n"), stripquotes=False)
    ''

    >>> read_stringnl(io.BytesIO(b"''\n"))
    ''

    >>> read_stringnl(io.BytesIO(b'"abcd"'))
    Traceback (most recent call last):
    ...
    ValueError: no newline found when trying to read stringnl

    Embedded escapes are undone in the result.
    >>> read_stringnl(io.BytesIO(br"'a\n\\b\x00c\td'" + b"\n'e'"))
    'a\n\\b\x00c\td'
    �
z-no newline found when trying to read stringnlNr)�"�'z,strinq quote %r not found at both ends of %rr$zno string quotes around %rr�ascii)�readline�endswithr&�
startswith�codecs�
escape_decode�decode)r(rC�stripquotesr)�qrrr�
read_stringnl;s"


�rF�stringnlz�A newline-terminated string.

                   This is a repr-style string, with embedded escapes, and
                   bracketing quotes.
                   cCst|dd�S)NF)rD)rF�r(rrr�read_stringnl_noescapetsrI�stringnl_noescapeaA newline-terminated string.

                        This is a str-style string, without embedded escapes,
                        or bracketing quotes.  It should consist solely of
                        printable ASCII characters.
                        cCsdt|�t|�fS)zp
    >>> import io
    >>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
    'Queue Empty'
    z%s %s)rIrHrrr�read_stringnl_noescape_pair�srK�stringnl_noescape_paira�A pair of newline-terminated strings.

                             These are str-style strings, without embedded
                             escapes, or bracketing quotes.  They should
                             consist solely of printable ASCII characters.
                             The pair is returned as a single string, with
                             a single blank separating the two strings.
                             cCsLt|�}|dkst�|�|�}t|�|kr4|�d�Std|t|�f��dS)z�
    >>> import io
    >>> read_string1(io.BytesIO(b"\x00"))
    ''
    >>> read_string1(io.BytesIO(b"\x03abcdef"))
    'abc'
    r�latin-1z2expected %d bytes in a string1, but only %d remainN)r*rr%r.rCr&�r(r
r)rrr�read_string1�s	


�rO�string1z�A counted string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes in the string, and the second argument is that many
              bytes.
              cCsTt|�}|dkrtd|��|�|�}t|�|kr<|�d�Std|t|�f��dS)aP
    >>> import io
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    ''
    >>> read_string4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    'abc'
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a string4, but only 6 remain
    rzstring4 byte count < 0: %drMz2expected %d bytes in a string4, but only %d remainN)r3r&r%r.rCrNrrr�read_string4�s



�rQ�string4z�A counted string.

              The first argument is a 4-byte little-endian signed int giving
              the number of bytes in the string, and the second argument is
              that many bytes.
              cCsFt|�}|dkst�|�|�}t|�|kr.|Std|t|�f��dS)z�
    >>> import io
    >>> read_bytes1(io.BytesIO(b"\x00"))
    b''
    >>> read_bytes1(io.BytesIO(b"\x03abcdef"))
    b'abc'
    rz1expected %d bytes in a bytes1, but only %d remainN)r*rr%r.r&rNrrr�read_bytes1�s	

�rS�bytes1z�A counted bytes string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes, and the second argument is that many bytes.
              cCs\t|�}|dkst�|tjkr*td|��|�|�}t|�|krD|Std|t|�f��dS)aN
    >>> import io
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    b'abc'
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a bytes4, but only 6 remain
    rz#bytes4 byte count > sys.maxsize: %dz1expected %d bytes in a bytes4, but only %d remainN)r5r�sys�maxsizer&r%r.rNrrr�read_bytes4�s



�rW�bytes4z�A counted bytes string.

              The first argument is a 4-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs\t|�}|dkst�|tjkr*td|��|�|�}t|�|krD|Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    b'abc'
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytes8, but only 6 remain
    rz#bytes8 byte count > sys.maxsize: %dz1expected %d bytes in a bytes8, but only %d remainN)r8rrUrVr&r%r.rNrrr�read_bytes8s


�rY�bytes8z�A counted bytes string.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs`t|�}|dkst�|tjkr*td|��|�|�}t|�|krHt|�Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytearray8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    bytearray(b'')
    >>> read_bytearray8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    bytearray(b'abc')
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytearray8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytearray8, but only 6 remain
    rz'bytearray8 byte count > sys.maxsize: %dz5expected %d bytes in a bytearray8, but only %d remainN)r8rrUrVr&r%r.�	bytearrayrNrrr�read_bytearray89s


�r\�
bytearray8z�A counted bytearray.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs0|��}|�d�std��|dd�}t|d�S)zm
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
    r:z4no newline found when trying to read unicodestringnlNrzraw-unicode-escape)r>r?r&rr'rrr�read_unicodestringnl[s

r^�unicodestringnlz�A newline-terminated Unicode string.

                      This is raw-unicode-escape encoded, so consists of
                      printable ASCII characters, and may contain embedded
                      escape sequences.
                      cCsNt|�}|dkst�|�|�}t|�|kr6t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)])  # little-endian 1-byte length
    >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring1, but only 6 remain
    r�utf-8�
surrogatepassz9expected %d bytes in a unicodestring1, but only %d remainN)r*rr%r.rr&rNrrr�read_unicodestring1us

�rb�unicodestring1aAA counted Unicode string.

                    The first argument is a 1-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsdt|�}|dkst�|tjkr*td|��|�|�}t|�|krLt|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc), 0, 0, 0])  # little-endian 4-byte length
    >>> t = read_unicodestring4(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring4(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring4, but only 6 remain
    rz+unicodestring4 byte count > sys.maxsize: %dr`raz9expected %d bytes in a unicodestring4, but only %d remainN)r5rrUrVr&r%r.rrNrrr�read_unicodestring4�s


�rd�unicodestring4aAA counted Unicode string.

                    The first argument is a 4-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsdt|�}|dkst�|tjkr*td|��|�|�}t|�|krLt|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)]) + b'\0' * 7  # little-endian 8-byte length
    >>> t = read_unicodestring8(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring8(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring8, but only 6 remain
    rz+unicodestring8 byte count > sys.maxsize: %dr`raz9expected %d bytes in a unicodestring8, but only %d remainN)r8rrUrVr&r%r.rrNrrr�read_unicodestring8�s


�rf�unicodestring8aBA counted Unicode string.

                    The first argument is an 8-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCs.t|ddd�}|dkrdS|dkr&dSt|�S)z�
    >>> import io
    >>> read_decimalnl_short(io.BytesIO(b"1234\n56"))
    1234

    >>> read_decimalnl_short(io.BytesIO(b"1234L\n56"))
    Traceback (most recent call last):
    ...
    ValueError: invalid literal for int() with base 10: b'1234L'
    F�rCrDs00s01T�rFr�r(�srrr�read_decimalnl_short�srlcCs2t|ddd�}|dd�dkr*|dd�}t|�S)z�
    >>> import io

    >>> read_decimalnl_long(io.BytesIO(b"1234L\n56"))
    1234

    >>> read_decimalnl_long(io.BytesIO(b"123456789012345678901234L\n6"))
    123456789012345678901234
    FrhrN�Lrirjrrr�read_decimalnl_longsrn�decimalnl_shorta�A newline-terminated decimal integer literal.

                          This never has a trailing 'L', and the integer fit
                          in a short Python int on the box where the pickle
                          was written -- but there's no guarantee it will fit
                          in a short Python int on the box where the pickle
                          is read.
                          �decimalnl_longz�A newline-terminated decimal integer literal.

                         This has a trailing 'L', and can represent integers
                         of any size.
                         cCst|ddd�}t|�S)zO
    >>> import io
    >>> read_floatnl(io.BytesIO(b"-1.25\n6"))
    -1.25
    Frh)rF�floatrjrrr�read_floatnl-srr�floatnla�A newline-terminated decimal floating literal.

              In general this requires 17 significant digits for roundtrip
              identity, and pickling then unpickling infinities, NaNs, and
              minus zero doesn't work across boxes, or on some boxes even
              on itself (e.g., Windows can't read the strings it produces
              for infinities or NaNs).
              cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io, struct
    >>> raw = struct.pack(">d", -1.25)
    >>> raw
    b'\xbf\xf4\x00\x00\x00\x00\x00\x00'
    >>> read_float8(io.BytesIO(raw + b"\n"))
    -1.25
    r7z>drz(not enough data in stream to read float8Nr-r'rrr�read_float8Cs

rt�float8aAn 8-byte binary representation of a float, big-endian.

             The format is unique to Python, and shared with the struct
             module (format string '>d') "in theory" (the struct and pickle
             implementations don't share the code -- they should).  It's
             strongly related to the IEEE-754 double format, and, in normal
             cases, is in fact identical to the big-endian 754 double format.
             On other boxes the dynamic range is limited to that of a 754
             double, and "add a half and chop" rounding is used to reduce
             the precision to 53 bits.  However, even on a 754 box,
             infinities, NaNs, and minus zero may not be handled correctly
             (may not survive roundtrip pickling intact).
             )�decode_longcCs.t|�}|�|�}t|�|kr&td��t|�S)a+
    >>> import io
    >>> read_long1(io.BytesIO(b"\x00"))
    0
    >>> read_long1(io.BytesIO(b"\x02\xff\x00"))
    255
    >>> read_long1(io.BytesIO(b"\x02\xff\x7f"))
    32767
    >>> read_long1(io.BytesIO(b"\x02\x00\xff"))
    -256
    >>> read_long1(io.BytesIO(b"\x02\x00\x80"))
    -32768
    z'not enough data in stream to read long1)r*r%r.r&rvrNrrr�
read_long1is

rw�long1aA binary long, little-endian, using 1-byte size.

    This first reads one byte as an unsigned size, then reads that
    many bytes and interprets them as a little-endian 2's-complement long.
    If the size is 0, that's taken as a shortcut for the long 0L.
    cCsBt|�}|dkrtd|��|�|�}t|�|kr:td��t|�S)ag
    >>> import io
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
    255
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
    32767
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
    -256
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
    -32768
    >>> read_long1(io.BytesIO(b"\x00\x00\x00\x00"))
    0
    rzlong4 byte count < 0: %dz'not enough data in stream to read long4)r3r&r%r.rvrNrrr�
read_long4�s
ry�long4a�A binary representation of a long, little-endian.

    This first reads four bytes as a signed size (but requires the
    size to be >= 0), then reads that many bytes and interprets them
    as a little-endian 2's-complement long.  If the size is 0, that's taken
    as a shortcut for the int 0, although LONG1 should really be used
    then instead (and in any case where # of bytes < 256).
    c@s eZdZdZdd�Zdd�ZdS)�StackObject�r�obtypercCslt|t�st�||_t|t�s,t|t�s,t�t|t�rN|D]}t|t�s:t�q:||_t|t�sbt�||_dS�N)rrrr�type�tupler}r)rrr}rZ	containedrrrr�s
zStackObject.__init__cCs|jSr~�r)rrrr�__repr__�szStackObject.__repr__N)rr r!r"rr�rrrrr{�s
r{rzA Python integer object.r|Zint_or_boolz#A Python integer or boolean object.�boolzA Python boolean object.rqzA Python float object.Zbytes_or_strz*A Python bytes or (Unicode) string object.�byteszA Python bytes object.r[zA Python bytearray object.rz!A Python (Unicode) string object.�NonezThe Python None object.r�zA Python tuple object.�listzA Python list object.�dictzA Python dict object.�setzA Python set object.�	frozensetzA Python frozenset object.�bufferzA Python buffer-like object.�anyzAny kind of object whatsoever.Zmarkaz'The mark' is a unique object.

Opcodes that operate on a variable number of objects
generally don't embed the count of objects in the opcode,
or pull it off the stack.  Instead the MARK opcode is used
to push a special marker object on the stack, and then
some other opcodes grab all the objects from the top of
the stack down to (but not including) the topmost marker
object.
�
stackslicea�An object representing a contiguous slice of the stack.

This is used in conjunction with markobject, to represent all
of the stack following the topmost markobject.  For example,
the POP_MARK opcode changes the stack from

    [..., markobject, stackslice]
to
    [...]

No matter how many object are on the stack after the topmost
markobject, POP_MARK gets rid of all of them (including the
topmost markobject too).
c@seZdZdZdd�ZdS)�
OpcodeInfo�r�code�arg�stack_before�stack_after�protorc	Cs�t|t�st�||_t|t�s"t�t|�dks2t�||_|dksNt|t�sNt�||_t|t�sbt�|D]}t|t	�sft�qf||_
t|t�s�t�|D]}t|t	�s�t�q�||_t|t�r�d|kr�t
jks�nt�||_t|t�s�t�||_dS)Nr$r)rrrrr.r�r
r�r�r{r�r�r�pickleZHIGHEST_PROTOCOLr�r)	rrr�r�r�r�r�r�xrrrrds&&zOpcodeInfo.__init__Nrrrrrr�Esr�ZINT�Ia�Push an integer or bool.

      The argument is a newline-terminated decimal literal string.

      The intent may have been that this always fit in a short Python int,
      but INT can be generated in pickles written on a 64-bit box that
      require a Python long on a 32-bit box.  The difference between this
      and LONG then is that INT skips a trailing 'L', and produces a short
      int whenever possible.

      Another difference is due to that, when bool was introduced as a
      distinct type in 2.3, builtin names True and False were also added to
      2.2.2, mapping to ints 1 and 0.  For compatibility in both directions,
      True gets pickled as INT + "I01\n", and False as INT + "I00\n".
      Leading zeroes are never produced for a genuine integer.  The 2.3
      (and later) unpicklers special-case these and return bool instead;
      earlier unpicklers ignore the leading "0" and return the int.
      r�ZBININT�Ja1Push a four-byte signed integer.

      This handles the full range of Python (short) integers on a 32-bit
      box, directly as binary bytes (1 for the opcode and 4 for the integer).
      If the integer is non-negative and fits in 1 or 2 bytes, pickling via
      BININT1 or BININT2 saves space.
      ZBININT1�Kz�Push a one-byte unsigned integer.

      This is a space optimization for pickling very small non-negative ints,
      in range(256).
      ZBININT2�Mz�Push a two-byte unsigned integer.

      This is a space optimization for pickling small positive ints, in
      range(256, 2**16).  Integers in range(256) can also be pickled via
      BININT2, but BININT1 instead saves a byte.
      ZLONG�La�Push a long integer.

      The same as INT, except that the literal ends with 'L', and always
      unpickles to a Python long.  There doesn't seem a real purpose to the
      trailing 'L'.

      Note that LONG takes time quadratic in the number of digits when
      unpickling (this is simply due to the nature of decimal->binary
      conversion).  Proto 2 added linear-time (in C; still quadratic-time
      in Python) LONG1 and LONG4 opcodes.
      ZLONG1�Šz|Long integer using one-byte length.

      A more efficient encoding of a Python long; the long1 encoding
      says it all.ZLONG4�‹z~Long integer using found-byte length.

      A more efficient encoding of a Python long; the long4 encoding
      says it all.�STRING�Sa�Push a Python string object.

      The argument is a repr-style string, with bracketing quote characters,
      and perhaps embedded escapes.  The argument extends until the next
      newline character.  These are usually decoded into a str instance
      using the encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      Z	BINSTRING�Ta�Push a Python string object.

      There are two arguments: the first is a 4-byte little-endian
      signed int giving the number of bytes in the string, and the
      second is that many bytes, which are taken literally as the string
      content.  These are usually decoded into a str instance using the
      encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      ZSHORT_BINSTRING�Ua�Push a Python string object.

      There are two arguments: the first is a 1-byte unsigned int giving
      the number of bytes in the string, and the second is that many
      bytes, which are taken literally as the string content.  These are
      usually decoded into a str instance using the encoding given to
      the Unpickler constructor. or the default, 'ASCII'.  If the
      encoding given was 'bytes' however, they will be decoded as bytes
      object instead.
      ZBINBYTES�B�z�Push a Python bytes object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes, and the second is that many bytes, which are
      taken literally as the bytes content.
      ZSHORT_BINBYTES�Cz�Push a Python bytes object.

      There are two arguments:  the first is a 1-byte unsigned int giving
      the number of bytes, and the second is that many bytes, which are taken
      literally as the string content.
      Z	BINBYTES8�Žz�Push a Python bytes object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the string, and the second is that many bytes,
      which are taken literally as the string content.
      Z
BYTEARRAY8�–�z�Push a Python bytearray object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the bytearray, and the second is that many bytes,
      which are taken literally as the bytearray content.
      ZNEXT_BUFFER�—z"Push an out-of-band buffer object.ZREADONLY_BUFFER�˜z,Make an out-of-band buffer object read-only.ZNONE�NzPush None on the stack.ZNEWTRUE�ˆzPush True onto the stack.ZNEWFALSE�‰zPush False onto the stack.�UNICODE�Vz�Push a Python Unicode string object.

      The argument is a raw-unicode-escape encoding of a Unicode string,
      and so may contain embedded escape sequences.  The argument extends
      until the next newline character.
      ZSHORT_BINUNICODE�ŒaPush a Python Unicode string object.

      There are two arguments:  the first is a 1-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      Z
BINUNICODE�XaPush a Python Unicode string object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZBINUNICODE8�aPush a Python Unicode string object.

      There are two arguments:  the first is an 8-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZFLOAT�Fa�Newline-terminated decimal float literal.

      The argument is repr(a_float), and in general requires 17 significant
      digits for roundtrip conversion to be an identity (this is so for
      IEEE-754 double precision values, which is what Python float maps to
      on most boxes).

      In general, FLOAT cannot be used to transport infinities, NaNs, or
      minus zero across boxes (or even on a single box, if the platform C
      library can't read the strings it produces for such things -- Windows
      is like that), but may do less damage than BINFLOAT on boxes with
      greater precision or dynamic range than IEEE-754 double.
      ZBINFLOAT�Ga�Float stored in binary form, with 8 bytes of data.

      This generally requires less than half the space of FLOAT encoding.
      In general, BINFLOAT cannot be used to transport infinities, NaNs, or
      minus zero, raises an exception if the exponent exceeds the range of
      an IEEE-754 double, and retains no more than 53 bits of precision (if
      there are more than that, "add a half and chop" rounding is used to
      cut it back to 53 significant bits).
      Z
EMPTY_LIST�]zPush an empty list.ZAPPEND�az�Append an object to a list.

      Stack before:  ... pylist anyobject
      Stack after:   ... pylist+[anyobject]

      although pylist is really extended in-place.
      ZAPPENDS�ez�Extend a list by a slice of stack objects.

      Stack before:  ... pylist markobject stackslice
      Stack after:   ... pylist+stackslice

      although pylist is really extended in-place.
      ZLIST�lasBuild a list out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python list, which single list object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... [1, 2, 3, 'abc']
      ZEMPTY_TUPLE�)zPush an empty tuple.ZTUPLE�tavBuild a tuple out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python tuple, which single tuple object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... (1, 2, 3, 'abc')
      ZTUPLE1�…z�Build a one-tuple out of the topmost item on the stack.

      This code pops one value off the stack and pushes a tuple of
      length 1 whose one item is that value back onto it.  In other
      words:

          stack[-1] = tuple(stack[-1:])
      ZTUPLE2�†aBuild a two-tuple out of the top two items on the stack.

      This code pops two values off the stack and pushes a tuple of
      length 2 whose items are those values back onto it.  In other
      words:

          stack[-2:] = [tuple(stack[-2:])]
      ZTUPLE3�‡aBuild a three-tuple out of the top three items on the stack.

      This code pops three values off the stack and pushes a tuple of
      length 3 whose items are those values back onto it.  In other
      words:

          stack[-3:] = [tuple(stack[-3:])]
      Z
EMPTY_DICT�}zPush an empty dict.ZDICT�da�Build a dict out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python dict, which single dict object replaces all of the
      stack from the topmost markobject onward.  The stack slice alternates
      key, value, key, value, ....  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... {1: 2, 3: 'abc'}
      ZSETITEMrkz�Add a key+value pair to an existing dict.

      Stack before:  ... pydict key value
      Stack after:   ... pydict

      where pydict has been modified via pydict[key] = value.
      ZSETITEMS�ua\Add an arbitrary number of key+value pairs to an existing dict.

      The slice of the stack following the topmost markobject is taken as
      an alternating sequence of keys and values, added to the dict
      immediately under the topmost markobject.  Everything at and after the
      topmost markobject is popped, leaving the mutated dict at the top
      of the stack.

      Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
      Stack after:   ... pydict

      where pydict has been modified via pydict[key_i] = value_i for i in
      1, 2, ..., n, and in that order.
      Z	EMPTY_SET�zPush an empty set.ZADDITEMS�a$Add an arbitrary number of items to an existing set.

      The slice of the stack following the topmost markobject is taken as
      a sequence of items, added to the set immediately under the topmost
      markobject.  Everything at and after the topmost markobject is popped,
      leaving the mutated set at the top of the stack.

      Stack before:  ... pyset markobject item_1 ... item_n
      Stack after:   ... pyset

      where pyset has been modified via pyset.add(item_i) = item_i for i in
      1, 2, ..., n, and in that order.
      Z	FROZENSET�‘azBuild a frozenset out of the topmost slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python frozenset, which single frozenset object replaces all
      of the stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3
      Stack after:  ... frozenset({1, 2, 3})
      �POP�0z<Discard the top stack item, shrinking the stack by one item.ZDUP�2z=Push the top stack item onto the stack again, duplicating it.�MARK�(z�Push markobject onto the stack.

      markobject is a unique object, used by other opcodes to identify a
      region of the stack containing a variable number of objects for them
      to work on.  See markobject.doc for more detail.
      ZPOP_MARK�1aPop all the stack objects at and above the topmost markobject.

      When an opcode using a variable number of stack objects is done,
      POP_MARK is used to remove those objects, and to remove the markobject
      that delimited their starting position on the stack.
      �GET�gz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the newline-terminated
      decimal string following.  BINGET and LONG_BINGET are space-optimized
      versions.
      �BINGET�hz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 1-byte unsigned
      integer following.
      �LONG_BINGET�jz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 4-byte unsigned
      little-endian integer following.
      �PUT�pz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the newline-
      terminated decimal string following.  BINPUT and LONG_BINPUT are
      space-optimized versions.
      �BINPUTrEz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 1-byte
      unsigned integer following.
      �LONG_BINPUT�rz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 4-byte
      unsigned little-endian integer following.
      �MEMOIZE�”z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write is the number of
      elements currently present in the memo.
      ZEXT1�‚a�Extension code.

      This code and the similar EXT2 and EXT4 allow using a registry
      of popular objects that are pickled by name, typically classes.
      It is envisioned that through a global negotiation and
      registration process, third parties can set up a mapping between
      ints and object names.

      In order to guarantee pickle interchangeability, the extension
      code registry ought to be global, although a range of codes may
      be reserved for private use.

      EXT1 has a 1-byte integer argument.  This is used to index into the
      extension registry, and the object at that index is pushed on the stack.
      ZEXT2�ƒzNExtension code.

      See EXT1.  EXT2 has a two-byte integer argument.
      ZEXT4�„zOExtension code.

      See EXT1.  EXT4 has a four-byte integer argument.
      ZGLOBAL�ca�Push a global object (module.attr) on the stack.

      Two newline-terminated strings follow the GLOBAL opcode.  The first is
      taken as a module name, and the second as a class name.  The class
      object module.class is pushed on the stack.  More accurately, the
      object returned by self.find_class(module, class) is pushed on the
      stack, so unpickling subclasses can override this form of lookup.
      ZSTACK_GLOBAL�“z7Push a global object (module.attr) on the stack.
      ZREDUCE�RaLPush an object built from a callable and an argument tuple.

      The opcode is named to remind of the __reduce__() method.

      Stack before: ... callable pytuple
      Stack after:  ... callable(*pytuple)

      The callable and the argument tuple are the first two items returned
      by a __reduce__ method.  Applying the callable to the argtuple is
      supposed to reproduce the original object, or at least get it started.
      If the __reduce__ method returns a 3-tuple, the last component is an
      argument to be passed to the object's __setstate__, and then the REDUCE
      opcode is followed by code to create setstate's argument, and then a
      BUILD opcode to apply  __setstate__ to that argument.

      If not isinstance(callable, type), REDUCE complains unless the
      callable has been registered with the copyreg module's
      safe_constructors dict, or the callable has a magic
      '__safe_for_unpickling__' attribute with a true value.  I'm not sure
      why it does this, but I've sure seen this complaint often enough when
      I didn't want to <wink>.
      ZBUILD�ba�Finish building an object, via __setstate__ or dict update.

      Stack before: ... anyobject argument
      Stack after:  ... anyobject

      where anyobject may have been mutated, as follows:

      If the object has a __setstate__ method,

          anyobject.__setstate__(argument)

      is called.

      Else the argument must be a dict, the object must have a __dict__, and
      the object is updated via

          anyobject.__dict__.update(argument)
      ZINST�iaqBuild a class instance.

      This is the protocol 0 version of protocol 1's OBJ opcode.
      INST is followed by two newline-terminated strings, giving a
      module and class name, just as for the GLOBAL opcode (and see
      GLOBAL for more details about that).  self.find_class(module, name)
      is used to get a class object.

      In addition, all the objects on the stack following the topmost
      markobject are gathered into a tuple and popped (along with the
      topmost markobject), just as for the TUPLE opcode.

      Now it gets complicated.  If all of these are true:

        + The argtuple is empty (markobject was at the top of the stack
          at the start).

        + The class object does not have a __getinitargs__ attribute.

      then we want to create an old-style class instance without invoking
      its __init__() method (pickle has waffled on this over the years; not
      calling __init__() is current wisdom).  In this case, an instance of
      an old-style dummy class is created, and then we try to rebind its
      __class__ attribute to the desired class object.  If this succeeds,
      the new instance object is pushed on the stack, and we're done.

      Else (the argtuple is not empty, it's not an old-style class object,
      or the class object does have a __getinitargs__ attribute), the code
      first insists that the class object have a __safe_for_unpickling__
      attribute.  Unlike as for the __safe_for_unpickling__ check in REDUCE,
      it doesn't matter whether this attribute has a true or false value, it
      only matters whether it exists (XXX this is a bug).  If
      __safe_for_unpickling__ doesn't exist, UnpicklingError is raised.

      Else (the class object does have a __safe_for_unpickling__ attr),
      the class object obtained from INST's arguments is applied to the
      argtuple obtained from the stack, and the resulting instance object
      is pushed on the stack.

      NOTE:  checks for __safe_for_unpickling__ went away in Python 2.3.
      NOTE:  the distinction between old-style and new-style classes does
             not make sense in Python 3.
      ZOBJ�oa�Build a class instance.

      This is the protocol 1 version of protocol 0's INST opcode, and is
      very much like it.  The major difference is that the class object
      is taken off the stack, allowing it to be retrieved from the memo
      repeatedly if several instances of the same class are created.  This
      can be much more efficient (in both time and space) than repeatedly
      embedding the module and class names in INST opcodes.

      Unlike INST, OBJ takes no arguments from the opcode stream.  Instead
      the class object is taken off the stack, immediately above the
      topmost markobject:

      Stack before: ... markobject classobject stackslice
      Stack after:  ... new_instance_object

      As for INST, the remainder of the stack above the markobject is
      gathered into an argument tuple, and then the logic seems identical,
      except that no __safe_for_unpickling__ check is done (XXX this is
      a bug).  See INST for the gory details.

      NOTE:  In Python 2.3, INST and OBJ are identical except for how they
      get the class object.  That was always the intent; the implementations
      had diverged for accidental reasons.
      ZNEWOBJ�aLBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple (the tuple being the stack
      top).  Call these cls and args.  They are popped off the stack,
      and the value returned by cls.__new__(cls, *args) is pushed back
      onto the stack.
      Z	NEWOBJ_EX�’auBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple and by a keyword argument dict
      (the dict being the stack top).  Call these cls and args.  They are
      popped off the stack, and the value returned by
      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
      �PROTO�€z�Protocol version indicator.

      For protocol 2 and above, a pickle must start with this opcode.
      The argument is the protocol version, an int in range(2, 256).
      �STOP�.z�Stop the unpickling machine.

      Every pickle ends with this opcode.  The object at the top of the stack
      is popped, and that's the result of unpickling.  The stack should be
      empty then.
      �FRAME�•z�Indicate the beginning of a new frame.

      The unpickler may use this opcode to safely prefetch data from its
      underlying stream.
      ZPERSID�PaPush an object identified by a persistent ID.

      The pickle module doesn't define what a persistent ID means.  PERSID's
      argument is a newline-terminated str-style (no embedded escapes, no
      bracketing quote characters) string, which *is* "the persistent ID".
      The unpickler passes this string to self.persistent_load().  Whatever
      object that returns is pushed on the stack.  There is no implementation
      of persistent_load() in Python's unpickler:  it must be supplied by an
      unpickler subclass.
      Z	BINPERSID�QaXPush an object identified by a persistent ID.

      Like PERSID, except the persistent ID is popped off the stack (instead
      of being a string embedded in the opcode bytestream).  The persistent
      ID is passed to self.persistent_load(), and whatever object that
      returns is pushed on the stack.  See PERSID for more detail.
      z%repeated name %r at indices %d and %dz%repeated code %r at indices %d and %dFcCst��}tjD]�}t�d|�s0|rtd|�qtt|�}t|t	�rPt
|�dkrf|rtd||f�q|�d�}||kr�|r�td||f�||}|j|kr�t
d|||jf��||=qt
d||f��q|�rd	g}|��D]\}}|�d
|j|f�q�t
d�|���dS)Nz[A-Z][A-Z0-9_]+$z0skipping %r: it doesn't look like an opcode namer$z5skipping %r: value %r doesn't look like a pickle coderMz+checking name %r w/ code %r for consistencyzBfor pickle code %r, pickle.py uses name %r but we're using name %rzPpickle.py appears to have a pickle opcode with name %r and code %r, but we don'tz=we appear to have pickle opcodes that pickle.py doesn't have:z    name %r with code %r�
)�code2op�copyr��__all__�re�match�print�getattrrr�r.rCrr&�items�append�join)�verboser�rZ
picklecoder��msgr�rrr�assure_pickle_consistency�sJ

�
�
���r�ccs�t|t�rt�|�}t|d�r&|j}ndd�}|�}|�d�}t�|�	d��}|dkr�|dkrht
d��nt
d|dkrxd	n||f��|jdkr�d}n|j�|�}|r�||||�fVn|||fV|d
kr.|j
dks�t�q�q.dS)N�tellcSsdSr~rrrrr�<lambda>��z_genops.<locals>.<lambda>r$rMr�z#pickle exhausted before seeing STOPz!at position %s, opcode %r unknownz	<unknown>�.r�)r�bytes_types�io�BytesIO�hasattrr�r%r��getrCr&r�rrr)r)�
yield_end_posZgetpos�posr��opcoder�rrr�_genops�s0




�
rcCst|�S)axGenerate all the opcodes in a pickle.

    'pickle' is a file-like object, or string, containing the pickle.

    Each opcode in the pickle is generated, from the current pickle position,
    stopping after a STOP opcode is delivered.  A triple is generated for
    each opcode:

        opcode, arg, pos

    opcode is an OpcodeInfo record, describing the current opcode.

    If the opcode has an argument embedded in the pickle, arg is its decoded
    value, as a Python object.  If the opcode doesn't have an argument, arg
    is None.

    If the pickle has a tell() method, pos was the value of pickle.tell()
    before reading the current opcode.  If the pickle is a bytes object,
    it's wrapped in a BytesIO object, and the latter's tell() result is
    used.  Else (the pickle doesn't have a tell(), and it's not obvious how
    to query its current position) pos is None.
    )r)r�rrrr�scCsd}d}t�}i}g}d}d}t|dd�D]�\}}	}
}d|jkrZ|�|	�|�||	f�q*|jdkr�t|�}|�|�|�||f�q*d|jkr�q*d|jkr�|j|kr�|j}d	||	<|�||	f�q*|jd
k�r|	|kr�|	}|
dkr�||
|�}n|�|
|f�q*|�|
|f�q*~t��}
|
�	|�t
�|
|�}|dk�rF|j�
�d}|D]�\}}	d}||k�r�|	|k�rr�qN|�|�}|||	<|d
7}n6||k�r�|�||	�}n|||	�}t|�|jjk}|jj|d�|�r�|j�|�n
|�	|��qN|j��|
��S)z7Optimize a pickle string by removing unused PUT opcodesr�r�rr�T)r�r�r�Nr�r2Fr$)Zforce)r�rr�addr�r.r�r�r��writer�Z_PicklerZframerZ
start_framing�putr�Z_FRAME_SIZE_TARGETZcommit_frameZ
file_writeZend_framing�getvalue)r�rr�ZoldidsZnewids�opcodesr�Zprotoheaderrr�rZend_pos�idx�outZpickler�opZ	framelessr)rrrr	sl















c	Csng}|dkri}d}g}d|}d}	|}
t|�D�]\}}}
|
dk	rVtd|
d|d�dt|j�dd�|t|�|jf}t||j�}|j}|j	}t|�}d}t
|ks�|jdk�rx|�rx|dt
k�rxt
|ks�t�t
|kr�|dtks�t�|�rp|�
�}|dk�r
d	}nd
|}|dt
k	�r,|�
��q|�
�z|�t
�}Wn*tk
�rl|jdk�sdt�d}YnXnd}	}|jd
k�r�|jdk�r�t|�}d|}n|dk	�s�t�|}||k�r�d|}	n,|�s�d}	n |dt
k�r�d}	n|d||<n<|jdk�r2||k�r*t|�dk�st�||g}nd|}	|dk	�sB|�r�|ddt|j�7}|dk	�rr|dt|�7}|�r�|d|7}|�r�|d|
t|�7}t|�}
|
dk�r�|}
|d|j�dd�d7}t||d�|	�r�t|	��t|�|k�r
td|t|�f��|�r||d�=t
|k�r>t
|k�s4t�|�|
�|�|�q0td||d�|�rjtd|��dS)aKProduce a symbolic disassembly of a pickle.

    'pickle' is a file-like object, or string, containing a (at least one)
    pickle.  The pickle is disassembled from the current position, through
    the first STOP opcode encountered.

    Optional arg 'out' is a file-like object to which the disassembly is
    printed.  It defaults to sys.stdout.

    Optional arg 'memo' is a Python dict, used as the pickle's memo.  It
    may be mutated by dis(), if the pickle contains PUT or BINPUT opcodes.
    Passing the same memo object to another dis() call then allows disassembly
    to proceed across multiple pickles that were all created by the same
    pickler with the same memo.  Ordinarily you don't need to worry about this.

    Optional arg 'indentlevel' is the number of blanks by which to indent
    a new MARK level.  It defaults to 4.

    Optional arg 'annotate' if nonzero instructs dis() to add short
    description of the opcode on each line of disassembled output.
    The value given to 'annotate' must be an integer and is used as a
    hint for the column where annotation should start.  The default
    value is 0, meaning no annotations.

    In addition to printing the disassembly, some sanity checks are made:

    + All embedded opcode arguments "make sense".

    + Explicit and implicit pop operations have enough items on the stack.

    + When an opcode implicitly refers to a markobject, a markobject is
      actually on the stack.

    + A memo entry isn't referenced before it's defined.

    + The markobject isn't stored in the memo.

    + A memo entry isn't redefined.
    Nr� z%5d:)�end�filez	%-4s %s%sr$r�z(MARK at unknown opcode offset)z(MARK at %d)rzno MARK exists on stack)r�r�r�r�r�z(as %d)zmemo key %r already definedz'stack is empty -- can't store into memoz"can't store markobject in the memo)r�r�r�z&memo key %r has never been stored into�
�2r�)r
z3tries to pop %d items from stack with only %d itemsz highest protocol among opcodes =zstack not empty after STOP: %r)rr��reprr�r.r�maxr�r�r��
markobjectrr��pop�indexr&r�splitr��extend)r�r	�memo�indentlevel�annotate�stackZmaxprotoZ	markstackZindentchunkZerrormsgZannocolrr�r�lineZbeforeZafterZnumtopopZmarkmsgZmarkposZmemo_idxrrrr[	s�-
��
�







�

c@seZdZdd�ZdS)�_ExamplecCs
||_dSr~)�value)rrrrrr�	sz_Example.__init__N)rr r!rrrrrr�	sra�
>>> import pickle
>>> x = [1, 2, (3, 4), {b'abc': "def"}]
>>> pkl0 = pickle.dumps(x, 0)
>>> dis(pkl0)
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: I    INT        1
    8: a    APPEND
    9: I    INT        2
   12: a    APPEND
   13: (    MARK
   14: I        INT        3
   17: I        INT        4
   20: t        TUPLE      (MARK at 13)
   21: p    PUT        1
   24: a    APPEND
   25: (    MARK
   26: d        DICT       (MARK at 25)
   27: p    PUT        2
   30: c    GLOBAL     '_codecs encode'
   46: p    PUT        3
   49: (    MARK
   50: V        UNICODE    'abc'
   55: p        PUT        4
   58: V        UNICODE    'latin1'
   66: p        PUT        5
   69: t        TUPLE      (MARK at 49)
   70: p    PUT        6
   73: R    REDUCE
   74: p    PUT        7
   77: V    UNICODE    'def'
   82: p    PUT        8
   85: s    SETITEM
   86: a    APPEND
   87: .    STOP
highest protocol among opcodes = 0

Try again with a "binary" pickle.

>>> pkl1 = pickle.dumps(x, 1)
>>> dis(pkl1)
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: K        BININT1    1
    6: K        BININT1    2
    8: (        MARK
    9: K            BININT1    3
   11: K            BININT1    4
   13: t            TUPLE      (MARK at 8)
   14: q        BINPUT     1
   16: }        EMPTY_DICT
   17: q        BINPUT     2
   19: c        GLOBAL     '_codecs encode'
   35: q        BINPUT     3
   37: (        MARK
   38: X            BINUNICODE 'abc'
   46: q            BINPUT     4
   48: X            BINUNICODE 'latin1'
   59: q            BINPUT     5
   61: t            TUPLE      (MARK at 37)
   62: q        BINPUT     6
   64: R        REDUCE
   65: q        BINPUT     7
   67: X        BINUNICODE 'def'
   75: q        BINPUT     8
   77: s        SETITEM
   78: e        APPENDS    (MARK at 3)
   79: .    STOP
highest protocol among opcodes = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
>>> dis(pickle.dumps(pickletools.dis, 0))
    0: c    GLOBAL     'pickletools dis'
   17: p    PUT        0
   20: .    STOP
highest protocol among opcodes = 0

>>> from pickletools import _Example
>>> x = [_Example(42)] * 2
>>> dis(pickle.dumps(x, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: c    GLOBAL     'copy_reg _reconstructor'
   30: p    PUT        1
   33: (    MARK
   34: c        GLOBAL     'pickletools _Example'
   56: p        PUT        2
   59: c        GLOBAL     '__builtin__ object'
   79: p        PUT        3
   82: N        NONE
   83: t        TUPLE      (MARK at 33)
   84: p    PUT        4
   87: R    REDUCE
   88: p    PUT        5
   91: (    MARK
   92: d        DICT       (MARK at 91)
   93: p    PUT        6
   96: V    UNICODE    'value'
  103: p    PUT        7
  106: I    INT        42
  110: s    SETITEM
  111: b    BUILD
  112: a    APPEND
  113: g    GET        5
  116: a    APPEND
  117: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(x, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: c        GLOBAL     'copy_reg _reconstructor'
   29: q        BINPUT     1
   31: (        MARK
   32: c            GLOBAL     'pickletools _Example'
   54: q            BINPUT     2
   56: c            GLOBAL     '__builtin__ object'
   76: q            BINPUT     3
   78: N            NONE
   79: t            TUPLE      (MARK at 31)
   80: q        BINPUT     4
   82: R        REDUCE
   83: q        BINPUT     5
   85: }        EMPTY_DICT
   86: q        BINPUT     6
   88: X        BINUNICODE 'value'
   98: q        BINPUT     7
  100: K        BININT1    42
  102: s        SETITEM
  103: b        BUILD
  104: h        BINGET     5
  106: e        APPENDS    (MARK at 3)
  107: .    STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-object test.

>>> L = []
>>> T = L,
>>> L.append(T)
>>> L[0] is T
True
>>> T[0] is L
True
>>> L[0][0] is L
True
>>> T[0][0] is T
True
>>> dis(pickle.dumps(L, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: (    MARK
    6: g        GET        0
    9: t        TUPLE      (MARK at 5)
   10: p    PUT        1
   13: a    APPEND
   14: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(L, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: h        BINGET     0
    6: t        TUPLE      (MARK at 3)
    7: q    BINPUT     1
    9: a    APPEND
   10: .    STOP
highest protocol among opcodes = 1

Note that, in the protocol 0 pickle of the recursive tuple, the disassembler
has to emulate the stack in order to realize that the POP opcode at 16 gets
rid of the MARK at 0.

>>> dis(pickle.dumps(T, 0))
    0: (    MARK
    1: (        MARK
    2: l            LIST       (MARK at 1)
    3: p        PUT        0
    6: (        MARK
    7: g            GET        0
   10: t            TUPLE      (MARK at 6)
   11: p        PUT        1
   14: a        APPEND
   15: 0        POP
   16: 0        POP        (MARK at 0)
   17: g    GET        1
   20: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(T, 1))
    0: (    MARK
    1: ]        EMPTY_LIST
    2: q        BINPUT     0
    4: (        MARK
    5: h            BINGET     0
    7: t            TUPLE      (MARK at 4)
    8: q        BINPUT     1
   10: a        APPEND
   11: 1        POP_MARK   (MARK at 0)
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 1

Try protocol 2.

>>> dis(pickle.dumps(L, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: .    STOP
highest protocol among opcodes = 2

>>> dis(pickle.dumps(T, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: 0    POP
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 2

Try protocol 3 with annotations:

>>> dis(pickle.dumps(T, 3), annotate=1)
    0: \x80 PROTO      3 Protocol version indicator.
    2: ]    EMPTY_LIST   Push an empty list.
    3: q    BINPUT     0 Store the stack top into the memo.  The stack is not popped.
    5: h    BINGET     0 Read an object from the memo and push it on the stack.
    7: \x85 TUPLE1       Build a one-tuple out of the topmost item on the stack.
    8: q    BINPUT     1 Store the stack top into the memo.  The stack is not popped.
   10: a    APPEND       Append an object to a list.
   11: 0    POP          Discard the top stack item, shrinking the stack by one item.
   12: h    BINGET     1 Read an object from the memo and push it on the stack.
   14: .    STOP         Stop the unpickling machine.
highest protocol among opcodes = 2

a=
>>> import pickle
>>> import io
>>> f = io.BytesIO()
>>> p = pickle.Pickler(f, 2)
>>> x = [1, 2, 3]
>>> p.dump(x)
>>> p.dump(x)
>>> f.seek(0)
0
>>> memo = {}
>>> dis(f, memo=memo)
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: K        BININT1    1
    8: K        BININT1    2
   10: K        BININT1    3
   12: e        APPENDS    (MARK at 5)
   13: .    STOP
highest protocol among opcodes = 2
>>> dis(f, memo=memo)
   14: \x80 PROTO      2
   16: h    BINGET     0
   18: .    STOP
highest protocol among opcodes = 2
)Zdisassembler_testZdisassembler_memo_testcCsddl}|��Sr)�doctestZtestmod)rrrr�_testsr�__main__z$disassemble one or more pickle files)Zdescription�pickle_file�br�*zthe pickle file)r�nargs�helpz-oz--output�wz+the file where the output should be written)�defaultrr%z-mz--memo�
store_truez#preserve memo between disassemblies)�actionr%z-lz
--indentlevelz8the number of blanks by which to indent a new MARK levelz-az
--annotatez2annotate each line with a short opcode descriptionz-pz
--preamblez==> {name} <==zMif more than one pickle file is specified, print this before each disassembly)r'r%z-tz--testzrun self-test suitez-vz)run verbosely; only affects self-test run�r�r�)TT)F)F)NNr2r)��__doc__rAr�r�r�rUr�r�rrrrr�objectr
Zstructr#r/r*r+r0r1r3r4r5r6r8r9rFrGrIrJrKrLrOrPrQrRrSrTrWrXrYrZr\r]r^r_rbrcrdrerfrgrlrnrorprrrsrtrurvrwrxryrzr{rZpyintZpylongr�Zpyinteger_or_boolZpyboolrqZpyfloatr�rZpybytes_or_strZpystringZpybytesr[ZpybytearrayZ	pyunicoderZpynoner�Zpytupler�Zpylistr�Zpydictr�ZpysetZpyfrozensetZpybufferZ	anyobjectrr�r�r�rZname2iZcode2i�	enumerater�r�rr&r�r�r�rrrrrZ	_dis_testZ
_memo_testZ__test__rr�argparse�ArgumentParser�parser�add_argumentZFileType�stdout�
parse_args�argsZtestrr!Z
print_helpr.�outputrrr(Zpreamble�formatrrrrr�<module>s`
$�����/�
�	�������
��
�
�
�
�	�
����
����
�������������;����
���
����
�
����
���
�
�
�
����������������������
��
���
�����������2� ������������������
& 

C��
�
�������
�
imghdr.cpython-38.pyc000064400000010030151450073350010443 0ustar00U

e5d��@s2dZddlmZdgZd%dd�ZgZdd�Ze�e�dd	�Ze�e�d
d�Z	e�e	�dd
�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�d d!�Zd"d#�Zed$k�r.e�dS)&z<Recognize image file formats based on their first few bytes.�)�PathLike�whatNcCs�d}zp|dkrNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�tD]}|||�}|rR|W�SqRW5|r�|��XdS)N�rb� )	�close�
isinstance�strr�open�read�tell�seek�tests)�file�h�f�locationZtf�res�r�/usr/lib64/python3.8/imghdr.pyrs 




cCs|dd�dkrdSdS)z JPEG data in JFIF or Exif format��
)sJFIFsExifZjpegNr�rrrrr�	test_jpeg%srcCs|�d�rdSdS)Ns�PNG

Zpng��
startswithrrrr�test_png,s
rcCs|dd�dkrdSdS)zGIF ('87 and '89 variants)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2srcCs|dd�dkrdSdS)z-TIFF (can be in Motorola or Intel byte order)N�)sMMsIIZtiffrrrrr�	test_tiff9srcCs|�d�rdSdS)zSGI image librarys�ZrgbNrrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPBM (portable bitmap)�r�P�s14r� 	

ZpbmN��len�ordrrrr�test_pbmGs�
�
�r'cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPGM (portable graymap)r rr!r"s25rr#ZpgmNr$rrrr�test_pgmOs�
�
�r(cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPPM (portable pixmap)r rr!r"s36rr#ZppmNr$rrrr�test_ppmWs�
�
�r)cCs|�d�rdSdS)zSun raster filesY�j�ZrastNrrrrr�	test_rast_s
r*cCs|�d�rdSdS)zX bitmap (X10 or X11)s#define ZxbmNrrrrr�test_xbmfs
r+cCs|�d�rdSdS)NsBMZbmprrrrr�test_bmpms
r,cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpssr/cCs|�d�rdSdS)Nsv/1Zexrrrrrr�test_exrys
r0cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr"z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r2�	recursiverrr�test�sr:c	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r2�os�path�isdir�print�glob�join�escaper4�stdout�flushr�OSError)�listr9Ztoplevelr2r?�filenamerC�namesrrrr4�s"

r4�__main__)N)�__doc__r?r�__all__rr
r�appendrrrrr'r(r)r*r+r,r/r0r:r4�__name__rrrr�<module>sD














shlex.cpython-38.opt-1.pyc000064400000016562151450073350011273 0ustar00U

e5d
4�	@s�dZddlZddlZddlZddlmZddlmZddddgZGd	d�d�Z	ddd�Z
d
d�Ze�dej
�jZdd�Zdd�Zedkr�eej�dkr�ee	��n,ejdZee��Zee	ee��W5QRXdS)�8A lexical analyzer class for simple shell-like syntaxes.�N)�deque)�StringIO�shlex�split�quote�joinc@sreZdZdZddd�Zedd��Zdd	�Zdd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dd�Zdd�ZdS)rrNFcCst|t�rt|�}|dk	r(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
|jrn|j
d7_
d|_d|_d|_
d|_d	|_d
|_t�|_d|_d|_d|_t�|_d|_|s�d}n|d
kr�d}||_|�rt�|_|j
d7_
|j
�t�|��}|j
�|�|_
dS)N��#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"�\�"� �rTz();<>|&z~-./*?=)�
isinstance�strr�instream�infile�sys�stdin�posix�eof�
commenters�	wordchars�
whitespace�whitespace_split�quotes�escape�
escapedquotes�stater�pushback�lineno�debug�token�	filestack�source�_punctuation_chars�_pushback_chars�	maketrans�dict�fromkeys�	translate)�selfrrr�punctuation_chars�t�r.�/usr/lib64/python3.8/shlex.py�__init__sJ
zshlex.__init__cCs|jS�N)r%�r+r.r.r/r,Dszshlex.punctuation_charscCs*|jdkrtdt|��|j�|�dS)z:Push a token onto the stack popped by the get_token methodrzshlex: pushing token N)r!�print�reprr�
appendleft)r+�tokr.r.r/�
push_tokenHs
zshlex.push_tokencCspt|t�rt|�}|j�|j|j|jf�||_||_d|_|jrl|dk	r\t	d|jf�nt	d|jf�dS)z9Push an input source onto the lexer's input source stack.rNzshlex: pushing to file %szshlex: pushing to stream %s)
rrrr#r5rrr r!r3)r+�	newstream�newfiler.r.r/�push_sourceNs
zshlex.push_sourcecCsD|j��|j��\|_|_|_|jr:td|j|jf�d|_dS)zPop the input source stack.zshlex: popping to %s, line %dr
N)	r�closer#�popleftrr r!r3rr2r.r.r/�
pop_source\s

�zshlex.pop_sourcecCs�|jr.|j��}|jdkr*tdt|��|S|��}|jdk	rz||jkrz|�|���}|rp|\}}|�||�|�	�}q@||j
kr�|js�|j
S|��|�	�}qz|jdkr�||j
kr�tdt|��ntd�|S)zBGet a token from the input stream (or from stack if it's nonempty)rzshlex: popping token Nz
shlex: token=zshlex: token=EOF)
rr<r!r3r4�
read_tokenr$�
sourcehookr:�	get_tokenrr#r=)r+r6�raw�specr9r8r.r.r/r@es.








zshlex.get_tokencCs�d}d}|jr |jr |j��}n|j�d�}|dkrB|jd7_|jdkr^td|j|f�|jdkrtd|_	�q�q|jdk�r�|s�d|_�q��q�||j
kr�|jdkr�td	�|j	s�|jr|r�q�nqn�||jkr�|j�
�|jd7_n�|j�r||jk�rd
}||_n�||jk�r&||_	d
|_nr||jk�r@||_	d|_nX||jk�rb|j�sZ||_	||_n6|j�rx||_	d
|_n ||_	|j	�s�|jr|r�q�nqq|j|jk�rDd}|�s�|jdk�r�td
�td��||jk�r|j�s�|j	|7_	d|_�q�nd
|_n>|j�r4||jk�r4|j|jk�r4|j}||_n|j	|7_	q|j|jk�r�|�st|jdk�rltd�td��||jk�r�||jk�r�||k�r�|j	|j7_	|j	|7_	||_q|jdkr|�s�d|_�q�q||j
k�r|jdk�r�td�d|_|j	�s�|jr|r�q�nqq||jk�rh|j�
�|jd7_|j�r�d|_|j	�s�|jr|r�q�nqq|jdk�r�||jk�r�|j	|7_	n"||j
k�r�|j�|�d|_�q�q|j�r�||jk�r�||_q|j�r�||jk�r�d
}||_q||jk�s||jk�s|j�r,||jk�r,|j	|7_	q|j�rB|j�|�n|j�|�|jdk�rbtd�d|_|j	�s�|jr|r�q�qqq|j	}d|_	|j�r�|�s�|dk�r�d}|jdk�r�|�r�tdt|��ntd�|S)NFr
r�
�z&shlex: in state %r I see character: %rr	�z+shlex: I see whitespace in whitespace state�a�cTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rFrGz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r,r&�popr�readr r!r3rr"rrr�readlinerrrr�
ValueErrorr�appendrr5r4)r+ZquotedZescapedstateZnextchar�resultr.r.r/r>�s

�




���

��zshlex.read_tokencCsV|ddkr|dd�}t|jt�rHtj�|�sHtj�tj�|j�|�}|t|d�fS)z(Hook called on a filename to be sourced.rrr����r)	rrr�os�path�isabsr�dirname�open)r+r9r.r.r/r?s
zshlex.sourcehookcCs(|dkr|j}|dkr|j}d||fS)z<Emit a C-compiler-like, Emacs-friendly error-message leader.Nz"%s", line %d: )rr )r+rr r.r.r/�error_leader s
zshlex.error_leadercCs|Sr1r.r2r.r.r/�__iter__(szshlex.__iter__cCs|��}||jkrt�|Sr1)r@r�
StopIteration)r+r"r.r.r/�__next__+s
zshlex.__next__)NNFF)N)NN)�__name__�
__module__�__qualname__�__doc__r0�propertyr,r7r:r=r@r>r?rUrVrXr.r.r.r/rs �
/

	 	
FTcCs$t||d�}d|_|sd|_t|�S)z-Split the string *s* using shell-like syntax.)rTr	)rrr�list)�sZcommentsrZlexr.r.r/r1s
cCsd�dd�|D��S)z3Return a shell-escaped string from *split_command*.r
css|]}t|�VqdSr1)r)�.0�argr.r.r/�	<genexpr><szjoin.<locals>.<genexpr>)r)Z
split_commandr.r.r/r:sz[^\w@%+=:,./-]cCs,|sdSt|�dkr|Sd|�dd�dS)z1Return a shell-escaped version of the string *s*.z''N�'z'"'"')�_find_unsafe�replace)r_r.r.r/rAs
cCs$|��}|sq tdt|��qdS)NzToken: )r@r3r4)ZlexerZttr.r.r/�
_print_tokensMsrf�__main__r)FT)r\rP�rer�collectionsr�ior�__all__rrr�compile�ASCII�searchrdrrfrY�len�argv�fnrT�fr.r.r.r/�<module>s(	 
	

shutil.cpython-38.opt-2.pyc000064400000062422151450073350011455 0ustar00U

e5d1��@s�ddlZddlZddlZddlZddlZddlZzddlZ[dZWnek
rZdZYnXzddl	Z	[	dZ
Wnek
r�dZ
YnXzddlZ[dZWnek
r�dZYnXzddl
mZWnek
r�dZYnXzddlmZWnek
�rdZYnXejdkZdZZejdk�r2ddlZne�r@ddlZe�rJdnd	Zeed
��odej�d�ae�oteed�Zd
Zddddddddddddddddddd d!d"d#d$d%d&gZGd'd�de�ZGd(d&�d&e�ZGd)d�de�Z Gd*d�de�Z!Gd+d,�d,e�Z"Gd-d.�d.e#�Z$Gd/d0�d0e#�Z%d1d2�Z&d3d4�Z'efd5d6�Z(d�d7d�Z)d8d9�Z*d:d;�Z+d<d=�Z,dd>�d?d�Z-dd>�d@d�Z.eedA��r�dd>�dBdC�Z/ndDdC�Z/dd>�dEd�Z0dd>�dFd�Z1dd>�dGd�Z2dHd"�Z3d�dIdJ�Z4dde2ddfdKd�Z5eej6dL��rdMdN�Z7dOdP�Z8ndQdN�Z7dRdP�Z8dSdT�Z9dUdV�Z:ej;ejej<ej=hej>k�obej?ej@k�obejejAkZBd�dWd�ZCeBeC_DdXdY�ZEe2fdZd�ZFd[d\�ZGd]d^�ZHd_d`�ZIdadb�ZJd�ddde�ZKd�dfdg�ZLdheKdigdjfiZMe�r�eKdkgdlfeMdm<eLgdnfeMdo<e
�reKdpgdqfeMdr<e�reKdsgdtfeMdu<dvd�ZNd�dxd�ZOdyd�ZPd�dzd�ZQd{d�ZRd|d}�ZSd�d~d�ZTdd �ZUd�d��ZVd�d��ZWdd��d�d��ZXd�geXgdjfd�geWgdnfd��ZYe�r�d�d�geXgdlfeYdm<e
�r�d�d�geXgdqfeYdr<e�r�d�d�geXgdtfeYdu<d�d��ZZd�dd��d�d!�Z[eed���rHe�\d��e�]d�d��Z^d�e^j__`d�e^ja_`d�e^jb_`d�d��Zcn$e�rle�\d��e�]d�d��Z^d�d��Zcd�d�d#�Zdd�d�d%�Zed�d��ZfejgejhBdfd�d$�ZidS)��NTF)�getpwnam)�getgrnam�nt�posixii�sendfileZlinux�
_fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)rN��__name__�
__module__�__qualname__�r%r%�/usr/lib64/python3.8/shutil.pyrEsc@seZdZdS)r Nr!r%r%r%r&r Hsc@seZdZdS)rNr!r%r%r%r&rKsc@seZdZdS)rNr!r%r%r%r&rOsc@seZdZdS)�	ReadErrorNr!r%r%r%r&r'Rsr'c@seZdZdS)�
RegistryErrorNr!r%r%r%r&r(Usr(c@seZdZdS)�_GiveupOnFastCopyNr!r%r%r%r&r)Ysr)c
Cs�z|��}|��}Wn*tk
r>}zt|��W5d}~XYnXzt�|||�WnTtk
r�}z6|j|_|j|_|j	t	j
t	jhkr�t|��n|d�W5d}~XYnXdS�N)�fileno�	Exceptionr)rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr%r%r&�_fastcopy_fcopyfile^s
r:c
CsDz|��}|��}Wn*tk
r>}zt|��W5d}~XYnXztt�|�jd�}Wntk
rnd}YnXtj	dkr�t
|d�}d}zt�||||�}Wn�tk
�r&}zj|j|_
|j|_|jtjkr�dat|��|jtjkr�|d�|dk�rt�|dtj�dk�rt|��|�W5d}~XYq�X|dk�r6�q@||7}q�dS)Ni�ili@rF)r+r,r)�max�os�fstat�st_sizer-�sys�maxsize�minrr.r/r0r1ZENOTSOCK�_USE_CP_SENDFILEZENOSPC�lseek�SEEK_CUR)r4r5r7r8r9Z	blocksize�offsetZsentr%r%r&�_fastcopy_sendfilers8


 
rFc
Csn|j}|j}tt|���L}||�}|s*q`q||krV|d|��}|�|�W5QRXq||�qW5QRXdSr*)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr%r%r&�_copyfileobj_readinto�srNcCs0|st}|j}|j}||�}|s"q,||�qdSr*)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr%r%r&r�scCs�t|tj�rJttjd�rJztj�|��t�|��WStk
rHYdSXttjd�r~ztj�||�WStk
r|YdSXtj�	tj�
|��tj�	tj�
|��kS)N�samestatF�samefile)�
isinstancer<�DirEntry�hasattr�pathrQ�statr-rR�normcase�abspath��src�dstr%r%r&�	_samefile�s�r]cCst|tj�r|��St�|�Sr*)rSr<rTrW��fnr%r%r&�_stat�sr`cCs t|tj�r|��Stj�|�Sr*)rSr<rT�
is_symlinkrV�islinkr^r%r%r&�_islink�src��follow_symlinksc	Cs�t�d||�t||�r(td�||���d}t||g�D]j\}}zt|�}Wntk
r`Yq8Xt�	|j
�r�t|tj
�r�|jn|}td|��tr8|dkr8|j}q8|s�t|�r�t�t�|�|��n
t|d����}t|d���}t�r,z,t||tj�|WW5QR�W5QR�Stk
�r(YnXn�t�rtz(t||�|WW5QR�W5QR�Stk
�rpYnXn>t�r�|dk�r�t||t|t��|W5QR�W5QR�St ||�W5QRXW5QRX|S)Nzshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wb)!r?�auditr]r �format�	enumerater`r-rW�S_ISFIFO�st_moderSr<rTrVr�_WINDOWSr>rc�symlink�readlink�open�_HAS_FCOPYFILEr:rZ_COPYFILE_DATAr)rBrFrNrArOr)	r[r\re�	file_size�ir_�str4r5r%r%r&r	�sD

cCspt�d||�|sFt|�rFtj�|�rFttd�r@tjtj}}qRdSnt	tj
}}||�}||t�|j
��dS)Nzshutil.copymode�lchmod)r?rhrcr<rVrbrU�lstatrur`�chmodrW�S_IMODErl)r[r\reZ	stat_funcZ
chmod_funcrtr%r%r&r
!s
�	listxattrcCs�ztj||d�}Wn@tk
rR}z"|jtjtjtjfkr<�WY�dSd}~XYnX|D]j}z&tj|||d�}tj||||d�WqXtk
r�}z |jtj	tjtjtjfkr��W5d}~XYqXXqXdS�Nrd)
r<ryr-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\re�names�er.�valuer%r%r&�
_copyxattr7s	�r�cOsdSr*r%)�args�kwargsr%r%r&r�Osc	
s`t�d||�ddd�dd��|p6t|�o4tj�|�}|rJ�fdd�}n�fdd�}t|tj�rp|j|d�}n|d	�||d�}t�	|j
�}|d
�||j|jf|d�t
|||d�z|d�|||d�Wntk
r�YnXt|d��r\z|d
�||j|d�WnVtk
�rZ}z6dD]*}tt|��r|jtt|�k�r�qJ�q�W5d}~XYnXdS)Nzshutil.copystat)�nsrecWsdSr*r%)r�rer�r%r%r&�_nop`szcopystat.<locals>._nopcstt|��Sr*)�getattrr<�r.�r�r%r&�lookupgszcopystat.<locals>.lookupcstt|��}|tjkr|S�Sr*)r�r<�supports_follow_symlinks)r.r_r�r%r&r�ls
rdrW�utimerw�st_flagsZchflags)Z
EOPNOTSUPPr3)r?rhrcr<rVrbrSrTrWrxrl�st_atime_ns�st_mtime_nsr��NotImplementedErrorrUr�r-r1r�)	r[r\reZfollowr�rt�mode�whyr9r%r�r&rRs4�
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|Srz)r<rV�isdir�join�basenamer	r
�r[r\rer%r%r&r�s
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|Srz)r<rVr�r�r�r	rr�r%r%r&r
�s
cs�fdd�}|S)Ncs(g}�D]}|�t�||��qt|�Sr*)�extend�fnmatch�filter�set)rVr}�
ignored_names�pattern��patternsr%r&�_ignore_patterns�sz)ignore_patterns.<locals>._ignore_patternsr%)r�r�r%r�r&r�scCs>|dk	r$|t�|�dd�|D��}nt�}tj||d�g}	|tkpJ|tk}
|D�]~}|j|krbqPtj�||j�}tj�||j�}
|
r�|n|}z�|�	�}|r�tjdkr�|j
dd�}|jt
jkr�d}|�r8t�
|�}|r�t�||
�t||
|d�nBtj�|��s|�rWqP|���r,t||
||||d�n
|||
�n*|���rXt||
||||d�n
|||
�WqPtk
�r�}z|	�|jd�W5d}~XYqPtk
�r�}z|	�||
t|�f�W5d}~XYqPXqPzt||�WnJtk
�r*}z*t|d	d�dk�r|	�||t|�f�W5d}~XYnX|	�r:t|	��|S)
NcSsg|]
}|j�qSr%r�)�.0�xr%r%r&�
<listcomp>�sz_copytree.<locals>.<listcomp>)�exist_okrFrd)�
dirs_exist_okrZwinerror)r<�fspathr��makedirsr
rr.rVr�rarW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrornr�exists�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinksr�r��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrarv�linktor9r�r%r%r&�	_copytree�s`




�
� (&r�c	
CsDt�d||�t�|��}t|�}W5QRXt||||||||d�S)Nzshutil.copytree)r�r[r\r�r�r�r�r�)r?rhr<�scandir�listr�)	r[r\r�r�r�r�r�Zitrr�r%r%r&rs&
��st_file_attributescCsPz4|jdd�}t�|j�o2|jtj@o0|jtjkWStk
rJYdSXdS�NFrd)rW�S_ISDIRrlr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrtr%r%r&�
_rmtree_isdir6s
�r�cCsLz0t�|�}t�|j�p.|jtj@o.|jtjkWSt	k
rFYdSXdS)NF)
r<rvrW�S_ISLNKrlr�r�r�r�r-)rVrtr%r%r&�_rmtree_islink?s

�r�cCs*z|jdd�WStk
r$YdSXdSr�)r�r-)r�r%r%r&r�HscCstj�|�Sr*)r<rVrb)rVr%r%r&r�Nsc	Cs&z"t�|��}t|�}W5QRXWn*tk
rL|tj|t���g}YnX|D]�}|j}t|�r�z|��rvtd��Wn,tk
r�|tjj	|t���YqRYnXt
||�qRzt�|�WqRtk
r�|tj|t���YqRXqRzt�|�Wn(tk
�r |tj|t���YnXdS)N�%Cannot call rmtree on a symbolic link)
r<r�r�r-r?�exc_inforVr�rarb�_rmtree_unsafe�unlink�rmdir)rV�onerror�
scandir_itr�r��fullnamer%r%r&r�Rs0

r�c
Cs.z"t�|��}t|�}W5QRXWn@tk
rb}z"||_|tj|t���WY�dSd}~XYnX|D�]�}tj�||j	�}z|j
dd�}Wntk
r�d}YnNX|r�z|jdd�}	t�|	j
�}Wn*tk
r�|tj|t���YqhYnX|�r�ztj|j	tj|d�}
Wn(tk
�r:|tj|t���Yn�Xz�tj�|	t�|
���r�t|
||�ztj|j	|d�Wn(tk
�r�|tj|t���YnXn8ztd��Wn*tk
�r�|tjj|t���YnXW5t�|
�Xqhztj|j	|d�Wqhtk
�r&|tj|t���YqhXqhdS)NFrd)�dir_fdr�)r<r�r�r-r/r?r�rVr�r.r�rWr�rlrvrp�O_RDONLY�closerQr=�_rmtree_safe_fdr�rbr�)�topfdrVr�r�r�r9r�r�r��orig_st�dirfdr%r%r&r�qsR


r�c	Cs�t�d|�|rdd�}n|dkr*dd�}t�r`t|t�rDt�|�}zt�|�}Wn(tk
rz|tj|t�	��YdSXzt�
|tj�}Wn(tk
r�|tj
|t�	��YdSXz�tj
�|t�|���rt|||�zt�|�Wn(tk
�r|tj|t�	��YnXn8ztd��Wn*tk
�rL|tj
j|t�	��YnXW5t�|�XnNzt|��rttd��Wn,tk
�r�|tj
j|t�	��YdSXt||�SdS)Nz
shutil.rmtreecWsdSr*r%�r�r%r%r&r��szrmtree.<locals>.onerrorcWs�dSr*r%r�r%r%r&r��sr�)r?rh�_use_fd_functionsrS�bytesr<�fsdecodervr,r�rpr�r�rVrQr=r�r�r-rbr�r�)rV�
ignore_errorsr�r��fdr%r%r&r�sJ



cCs&tjjtjjpd}tj�|�|��S)N�)r<rV�sep�altsepr��rstrip)rVr�r%r%r&�	_basename�sr�c	CsTt�d||�|}tj�|�rbt||�r8t�||�dStj�|t|��}tj�	|�rbt
d|��zt�||�Wn�tk
�rNtj�|�r�t�
|�}t�||�t�|�n�tj�|��r6t||�r�t
d||f��t|��st�|tj��st�|��rtjdk�rtd||f��t|||dd�t|�n|||�t�|�YnX|S)Nzshutil.movez$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.�darwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)r�r�)r?rhr<rVr�r]�renamer�r�r�rr-rbrornr��
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)r[r\r�Zreal_dstr�r%r%r&r�sL


�
�����

cCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�Sr*)r<rVrY�endswithr��
startswithrZr%r%r&r�/sr�cCs(t|�}tjtjg}t|d�o&|j|kS)Nr�)r`rW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[rtZimmutable_statesr%r%r&r�8sr�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS�N�)r�KeyError�r.�resultr%r%r&�_get_gid=s
r�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdSr�)rr�r�r%r%r&�_get_uidIs
r��gzipcs |dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���ddl}	|rfd	|nd}
|d
|
}tj�|�}|r�tj�	|�s�|dk	r�|�
d|�|s�t�|�|dk	r�|�
d�t���t
�������fd
d�}
|�s|	�|d|�}z|j||
d�W5|��X|S)Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|Sr*)�gidZgname�uid�uname)Ztarinfo�r��group�ownerr�r%r&�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorri�tarfiler<rV�dirnamer��infor�r�r�rpr��add)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionr�Zcompress_extZarchive_name�archive_dirr��tarr%r�r&�
_make_tarballUs>�

	
r
c	Csnddl}|d}tj�|�}|rNtj�|�sN|dk	r@|�d|�|sNt�|�|dk	rd|�d||�|�sj|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dk	r�|�d|	�t�|�D]�\}
}}t
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dk	r�|�d|	�q�|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|dk	�r|�d|	��qq�W5QRX|S)Nr�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVr�r�rr��ZipFileZZIP_DEFLATED�normpath�curdirrH�walk�sortedr��isfile)rrrrrr
Zzip_filenamerZzfrV�dirpathZdirnames�	filenamesr.r%r%r&�
_make_zipfile�sH
��

rr	)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)NcSsg|]\}}||df�qS)r�r%)r�r.�registryr%r%r&r��sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr%r%r&r�s
�r�cCst|dkrg}t|�s td|��t|ttf�s6td��|D]&}t|ttf�rXt|�dkr:td��q:|||ft|<dS)NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorrS�tupler��lenr)r.�function�
extra_args�descriptionZelementr%r%r&r�s	
cCs
t|=dSr*)rr�r%r%r&r�sc	
Cst�d||||�t��}	|dk	rP|dk	r6|�d|�tj�|�}|sPt�|�|dkr^tj}||d�}
zt	|}Wn"t
k
r�td|�d�YnX|d}|dD]\}
}||
|
<q�|dkr�||
d<||
d	<z|||f|
�}W5|dk	�r|dk	�r|�d
|	�t�|	�X|S)Nzshutil.make_archivezchanging into '%s')rrzunknown archive format '%s'r�rr�r�zchanging back to '%s')r?rhr<�getcwd�debugrVrY�chdirrrr�r�)rriZroot_dirrrrr�r�rZsave_cwdr��format_info�func�arg�valr/r%r%r&r�s8




cCsdd�t��D�}|��|S)NcSs"g|]\}}||d|df�qS)r�r%)r�r.rr%r%r&r�3sz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSrrrr%r%r&r-s
�c	Csji}t��D]\}}|dD]}|||<qq|D]$}||kr0d}t||||f��q0t|�sftd��dS)Nrz!%s is already registered for "%s"z*The registered function must be a callable)r-rr(rr)	�
extensionsr!r"Zexisting_extensionsr.r�ext�	extension�msgr%r%r&�_check_unpack_options8s�
r2cCs,|dkrg}t|||�||||ft|<dSr*)r2r-)r.r.r!r"r#r%r%r&rJscCs
t|=dSr*)r-r�r%r%r&r`scCs&tj�|�}tj�|�s"t�|�dSr*)r<rVr�r�r�)rVr�r%r%r&�_ensure_directorydsr3c		Cs�ddl}|�|�std|��|�|�}z�|��D]�}|j}|�d�s2d|krPq2tj	j
|f|�d���}|snq2t|�|�
d�s2|�|j�}t|d�}z|�|�W5|��~Xq2W5|��XdS)Nrz%s is not a zip file�/z..rg)r
Z
is_zipfiler'rr�Zinfolistr/r�r<rVr��splitr3r�rPrprH)	r/�extract_dirr
rrr.�target�data�fr%r%r&�_unpack_zipfilejs*




r:r�cCs\ddl}z|�|�}Wn"|jk
r8td|��YnXz|j||d�W5|��XdS)Nrz/%s is not a compressed or uncompressed tar filer�)r�rpZTarErrorr'r�Z
extractall)r/r6r�r�Ztarobjr%r%r&�_unpack_tarfile�s�
r;r�r)r	rz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D],\}}|dD]}|�|�r|SqqdS)Nr)r-rr�)r/r.rr0r%r%r&�_find_unpack_format�s

r<cCs�t�d|||�|dkr t��}t�|�}t�|�}|dkrBi}nd|i}|dk	r�zt|}Wn$tk
r�td�|��d�YnX|d}|||ft	|d�|��nRt
|�}|dkr�td�|���t|d}t	t|d�}|�|�|||f|�dS)Nzshutil.unpack_archiver�zUnknown unpack format '{0}'r$r�zUnknown archive format '{0}')
r?rhr<r%r�r-r�r�ri�dictr<r'�update)r/r6rir�Z
filter_kwargsr(r)r�r%r%r&r�s,


�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�Sr*)r<r?�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVrt�free�total�usedr%r%r&r@�s

cCs"t�|�\}}||}t|||�Sr*)rZ
_getdiskusagerE)rVrGrFrHr%r%r&r@�scCs�t�d|||�|dkr(|dkr(td��|}|}|dkr>d}n(t|t�rft|�}|dkrftd�|���|dkrtd}n(t|t�s�t	|�}|dkr�td�|���t
�|||�dS)Nzshutil.chownzuser and/or group must be set���zno such user: {!r}zno such group: {!r})r?rhr�rSr�r��LookupErrorri�intr�r<r)rV�userr�Z_userZ_groupr%r%r&rs$

��P�c
Cs�zttjd�}Wnttfk
r.d}YnXzttjd�}Wnttfk
r^d}YnX|dksp|dkr�zt�tj���}Wn$t	tt
fk
r�t�|�}YnX|dkr�|j}|dkr�|j
}t�||f�S)NZCOLUMNSrZLINES)rKr<�environr�r�rr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)ZfallbackrTrU�sizer%r%r&r(s$

cCs&tj�|�o$t�||�o$tj�|�Sr*)r<rVr�r�r�)r_r�r%r%r&�
_access_checkYs�rWc
	s�tj���rt�|�r�SdSt�t�}|dkrttj�dd�}|dkrtzt�d�}Wnt	t
fk
rrtj}YnX|s|dS|r�t�|�}|�
t�tj��}nt�|�}|�
tj�}tjdk�rTtj}|r�t�|�}||kr�|�d|�t�d�p�t}dd�|�
tj�D�}|�r dd�|D�}t�fd	d
�|D���r@�g}n�fdd�|D�}n�g}t�}|D]X}	tj�|	�}
|
|k�rd|�|
�|D],}tj�|	|�}t||��r�|S�q��qddS)N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr%r%�r�r/r%r%r&r��szwhich.<locals>.<listcomp>cSsg|]}t�|��qSr%)r<�fsencoderZr%r%r&r��sc3s |]}����|���VqdSr*)�lowerr�rZ��cmdr%r&�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSr%r%rZr]r%r&r��s)r<rVr�rWrSr�rP�get�confstrrRr��defpathr[r5�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
r^r�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r%r]r&r^sV







)r)F)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)rM)jr<r?rWr��collectionsr1�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrprr.rmrrrOrUr�r�rBrqrf�__all__r-rr rrr'r,r(r)r:rFrNrr]r`rcr	r
r�rrr
rr�r�stat_resultr�r�r�r�rpr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�rr�r�r�r�r
rrrrrrrr2rrr3r:r;r-r<rr��
namedtuplerErG�__doc__rHrFr@rrrW�F_OK�X_OKrr%r%r%r&�<module>sr






�
@

7B
�
A�
.	
	4�
�
�
>?	�
A
-
����

�
8�
"�
�
�
�2



 
1imghdr.cpython-38.opt-2.pyc000064400000007335151450073350011421 0ustar00U

e5d��@s.ddlmZdgZd$dd�ZgZdd�Ze�e�dd�Ze�e�d	d
�Ze�e�dd�Z	e�e	�d
d�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd �Zd!d"�Zed#k�r*e�dS)%�)�PathLike�whatNcCs�d}zp|dkrNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�tD]}|||�}|rR|W�SqRW5|r�|��XdS)N�rb� )	�close�
isinstance�strr�open�read�tell�seek�tests)�file�h�f�locationZtf�res�r�/usr/lib64/python3.8/imghdr.pyrs 




cCs|dd�dkrdSdS)N��
)sJFIFsExifZjpegr�rrrrr�	test_jpeg%srcCs|�d�rdSdS)Ns�PNG

Zpng��
startswithrrrr�test_png,s
rcCs|dd�dkrdSdS)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2srcCs|dd�dkrdSdS)N�)sMMsIIZtiffrrrrr�	test_tiff9srcCs|�d�rdSdS)Ns�Zrgbrrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSdS)	N�r�P�s14r� 	

Zpbm��len�ordrrrr�test_pbmGs�
�
�r'cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSdS)	Nr rr!r"s25rr#Zpgmr$rrrr�test_pgmOs�
�
�r(cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSdS)	Nr rr!r"s36rr#Zppmr$rrrr�test_ppmWs�
�
�r)cCs|�d�rdSdS)NsY�j�Zrastrrrrr�	test_rast_s
r*cCs|�d�rdSdS)Ns#define Zxbmrrrrr�test_xbmfs
r+cCs|�d�rdSdS)NsBMZbmprrrrr�test_bmpms
r,cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpssr/cCs|�d�rdSdS)Nsv/1Zexrrrrrr�test_exrys
r0cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr"z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r2�	recursiverrr�test�sr:c	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r2�os�path�isdir�print�glob�join�escaper4�stdout�flushr�OSError)�listr9Ztoplevelr2r?�filenamerC�namesrrrr4�s"

r4�__main__)N)r?r�__all__rr
r�appendrrrrr'r(r)r*r+r,r/r0r:r4�__name__rrrr�<module>sB














calendar.cpython-38.opt-1.pyc000064400000064672151450073350011726 0ustar00U

e5da�@s4dZddlZddlZddlZddlmZdddddd	d
ddd
ddddddddddddddgZeZ	Gdd�de�Z
Gdd�de�ZdZdZ
dd d!d d"d d"d d d"d d"d g
ZGd#d$�d$�ZGd%d&�d&�Zed'�Zed(�Zed)�Zed*�Zed+�\ZZZZZZZd,d�Zd-d	�Zd.d
�Zd/d�Z d0d1�Z!d2d3�Z"d4d5�Z#Gd6d�de$�Z%Gd7d�de%�Z&Gd8d�de%�Z'Gd9d:�d:�Z(Gd;d�de&�Z)Gd<d�de'�Z*e&�Z+e+j,Z-d=d�Z.e+j/Z0e+j1Z1e+j2Z3e+j4Z5e+j6Z6e+j7Z8e+j9Z:e+j;Z<d>Z=d?Z>e=e>fd@dA�Z?e=e>fdBdC�Z@dDZAe�BeAdd��C�ZDdEd�ZEdFdG�ZFeGdHk�r0eFejH�dS)Ia$Calendar printing functions

Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday).�N)�repeat�IllegalMonthError�IllegalWeekdayError�setfirstweekday�firstweekday�isleap�leapdays�weekday�
monthrange�
monthcalendar�prmonth�month�prcal�calendar�timegm�
month_name�
month_abbr�day_name�day_abbr�Calendar�TextCalendar�HTMLCalendar�LocaleTextCalendar�LocaleHTMLCalendar�
weekheaderc@seZdZdd�Zdd�ZdS)rcCs
||_dS�N�r
)�selfr
�r� /usr/lib64/python3.8/calendar.py�__init__szIllegalMonthError.__init__cCs
d|jS)Nz!bad month number %r; must be 1-12r�rrrr�__str__szIllegalMonthError.__str__N��__name__�
__module__�__qualname__r r"rrrrrsc@seZdZdd�Zdd�ZdS)rcCs
||_dSr�r	)rr	rrrr  szIllegalWeekdayError.__init__cCs
d|jS)Nz7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)r'r!rrrr""szIllegalWeekdayError.__str__Nr#rrrrrs�����c@sFeZdZdd�ed�D�Ze�ddd��dd�Zd	d
�Zdd�Zd
S)�_localized_monthcCs g|]}t�d|dd�j�qS�i�r(��datetime�date�strftime��.0�irrr�
<listcomp>4sz_localized_month.<listcomp>�rcCsdS)N�r)�xrrr�<lambda>5�z_localized_month.<lambda>cCs
||_dSr��format�rr=rrrr 7sz_localized_month.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<�r4�fr!rrr6=sz0_localized_month.__getitem__.<locals>.<listcomp>)�_months�
isinstance�slicer=�rr5Zfuncsrr!r�__getitem__:s

z_localized_month.__getitem__cCsdS)N�
rr!rrr�__len__Asz_localized_month.__len__N)	r$r%r&�rangerA�insertr rErGrrrrr-2s
r-c@s6eZdZdd�ed�D�Zdd�Zdd�Zdd	�Zd
S)�_localized_daycCs g|]}t�dd|d�j�qSr.r/r3rrrr6Hsz_localized_day.<listcomp>�cCs
||_dSrr<r>rrrr Jsz_localized_day.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<r?r!rrr6Psz._localized_day.__getitem__.<locals>.<listcomp>)�_daysrBrCr=rDrr!rrEMs

z_localized_day.__getitem__cCsdS�NrKrr!rrrrGTsz_localized_day.__len__N)r$r%r&rHrLr rErGrrrrrJEsrJz%Az%az%Bz%brKcCs$|ddko"|ddkp"|ddkS)z5Return True for leap years, False for non-leap years.�r�d�r)�yearrrrrdscCs@|d8}|d8}|d|d|d|d|d|dS)zFReturn number of leap years in range [y1, y2).
       Assume y1 <= y2.r(rNrOrPr)Zy1Zy2rrrriscCs8tj|krtjks&nd|d}t�|||���S)zBReturn weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).i�rP)r0ZMINYEARZMAXYEARr1r	)rQr
�dayrrrr	qscCsJd|krdksnt|��t||d�}t||tko>t|�}||fS)zQReturn weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
       year, month.r(r7)rr	�mdays�Februaryr)rQr
�day1�ndaysrrrr
xs
cCst||tkot|�Sr)rSrTr�rQr
rrr�	_monthlen�srXcCs$|dkr|ddfS||dfSdS)Nr(r7rrWrrr�
_prevmonth�srYcCs$|dkr|ddfS||dfSdS)Nr7r(rrWrrr�
_nextmonth�srZc@s�eZdZdZd#dd�Zdd�Zdd�Zeee�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd$dd�Zd%dd�Zd&d d!�Zd"S)'rzo
    Base calendar class. This class doesn't do any formatting. It simply
    provides data to subclasses.
    rcCs
||_dSr�r�rrrrrr �szCalendar.__init__cCs
|jdSrM�Z
_firstweekdayr!rrr�getfirstweekday�szCalendar.getfirstweekdaycCs
||_dSrr]r\rrrr�szCalendar.setfirstweekdayccs&t|j|jd�D]}|dVqdS)zt
        Return an iterator for one week of weekday numbers starting with the
        configured first one.
        rKN)rHr)rr5rrr�iterweekdays�szCalendar.iterweekdaysccs,|�||�D]\}}}t�|||�VqdS)z�
        Return an iterator for one month. The iterator will yield datetime.date
        values and will always iterate through complete weeks, so it will yield
        dates outside the specified month.
        N)�itermonthdays3r0r1)rrQr
�y�m�drrr�itermonthdates�szCalendar.itermonthdatesccsft||�\}}||jd}td|�EdHtd|d�EdH|j||d}td|�EdHdS)z�
        Like itermonthdates(), but will yield day numbers. For days outside
        the specified month the day number is 0.
        rKrNr()r
rrrH)rrQr
rUrV�days_before�
days_afterrrr�
itermonthdays�szCalendar.itermonthdaysccs0t|�||�|j�D]\}}||dfVqdS)z�
        Like itermonthdates(), but will yield (day number, weekday number)
        tuples. For days outside the specified month the day number is 0.
        rKN)�	enumeratergr)rrQr
r5rcrrr�itermonthdays2�szCalendar.itermonthdays2ccs�t||�\}}||jd}|j||d}t||�\}}t||�d}	t|	||	�D]}
|||
fVqXtd|d�D]}
|||
fVqxt||�\}}td|d�D]}
|||
fVq�dS)z�
        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
        used for dates outside of datetime.date range.
        rKr(N)r
rrYrXrHrZ)rrQr
rUrVrerfrarb�endrcrrrr`�szCalendar.itermonthdays3ccs<t|�||��D]&\}\}}}||||j|dfVqdS)z�
        Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.
        Can be used for dates outside of datetime.date range.
        rKN)rhr`r)rrQr
r5rarbrcrrr�itermonthdays4�szCalendar.itermonthdays4cs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix (list of lists) representing a month's calendar.
        Each row represents a week; week entries are datetime.date values.
        csg|]}�||d��qS�rKrr3�Zdatesrrr6�sz/Calendar.monthdatescalendar.<locals>.<listcomp>rrK)�listrdrH�len�rrQr
rrmr�monthdatescalendar�szCalendar.monthdatescalendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; week entries are
        (day number, weekday number) tuples. Day numbers outside this month
        are zero.
        csg|]}�||d��qSrlrr3��daysrrr6�sz/Calendar.monthdays2calendar.<locals>.<listcomp>rrK)rnrirHrorprrrr�monthdays2calendar�szCalendar.monthdays2calendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; days outside this month are zero.
        csg|]}�||d��qSrlrr3rrrrr6�sz.Calendar.monthdayscalendar.<locals>.<listcomp>rrK)rnrgrHrorprrrr�monthdayscalendar�szCalendar.monthdayscalendar�cs>��fdd�tttd�D����fdd�tdt����D�S)a'
        Return the data for the specified year ready for formatting. The return
        value is a list of month rows. Each month row contains up to width months.
        Each month contains between 4 and 6 weeks and each week contains 1-7
        days. Days are datetime.date objects.
        csg|]}���|��qSr)rqr3�rrQrrr6s�z.Calendar.yeardatescalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3��months�widthrrr6	sr�rH�Januaryro�rrQrzr�ryrrzrQr�yeardatescalendar�s�zCalendar.yeardatescalendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are
        (day number, weekday number) tuples. Day numbers outside this month are
        zero.
        csg|]}���|��qSr)rtr3rwrrr6s�z.Calendar.yeardays2calendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6srr{r}rr~r�yeardays2calendars�zCalendar.yeardays2calendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are day numbers.
        Day numbers outside this month are zero.
        csg|]}���|��qSr)rur3rwrrr6s�z-Calendar.yeardayscalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6"srr{r}rr~r�yeardayscalendars�zCalendar.yeardayscalendarN)r)rv)rv)rv)r$r%r&�__doc__r r^r�propertyrr_rdrgrir`rkrqrtrurr�r�rrrrr�s"

	



c@sjeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Z	ddd�Z
ddd�Zd dd�Zd!dd�Z
dS)"rzr
    Subclass of Calendar that outputs a calendar as a simple plain text
    similar to the UNIX program cal.
    cCst|�||�dd�dS)z3
        Print a single week (no newline).
        r8�rjN)�print�
formatweek�r�theweekrzrrr�prweek+szTextCalendar.prweekcCs |dkrd}nd|}|�|�S)z*
        Returns a formatted day.
        rr8z%2i��center)rrRr	rz�srrr�	formatday1szTextCalendar.formatdaycsd���fdd�|D��S)zA
        Returns a single week in a string (no newline).
        � c3s |]\}}��||��VqdSr�r��r4rcZwd�rrzrr�	<genexpr>?sz*TextCalendar.formatweek.<locals>.<genexpr>��joinr�rr�rr�;szTextCalendar.formatweekcCs(|dkrt}nt}||d|��|�S)z4
        Returns a formatted week day name.
        �	N)rrr�)rrRrz�namesrrr�
formatweekdayAszTextCalendar.formatweekdaycsd���fdd����D��S)z-
        Return a header for a week.
        r�c3s|]}��|��VqdSr�r�r3r�rrr�Osz0TextCalendar.formatweekheader.<locals>.<genexpr>�r�r_r�rr�r�formatweekheaderKszTextCalendar.formatweekheaderTcCs"t|}|rd||f}|�|�S)z0
        Return a formatted month name.
        �%s %r)rr��r�theyear�themonthrz�withyearr�rrr�formatmonthnameQszTextCalendar.formatmonthnamercCst|�||||�dd�dS)z+
        Print a month's calendar.
        r8r�N)r��formatmonth)rr�r��w�lrrrrZszTextCalendar.prmonthcCs�td|�}td|�}|�||d|dd�}|��}|d|7}||�|���7}|d|7}|�||�D]$}||�||���7}|d|7}ql|S)z@
        Return a month's calendar string (multi-line).
        r)r(rK�
)�maxr��rstripr�rtr�)rr�r�r�r�r��weekrrrr�`s

zTextCalendar.formatmonthr)r(�rvc	s�td|�}td|�}td|�}|ddd�g}|j}|t����|||d����|d|���|��t���|��D�]"\}}	t||dt	||ddd��}
|d|����fdd�|
D�}|t
|�|����|d|��fdd�|
D�}|t
|�|����|d|�td	d�|	D��}
t|
�D]f}g}|	D]6}|t|�k�rj|�d
�n|���|||���qL|t
|�|����|d|��q@q�d
�
|�S)zC
        Returns a year's calendar as a multi-line string.
        r)r(rKr�rFc3s|]}���|�d�VqdS)FN)r��r4�k)�colwidthrr�rrr��s�z*TextCalendar.formatyear.<locals>.<genexpr>c3s|]
}�VqdSrrr�)�headerrrr��scss|]}t|�VqdSr)ro)r4�calrrrr��sr8)r��append�reprr�r�r�rhr�rH�min�formatstringror�r�)rr�r�r��crb�v�ar5�rowryr�ZheadersZheight�jZweeksr�r)r�r�rr�r�
formatyearps<


&
$�zTextCalendar.formatyearcCst|�|||||�dd�dS)zPrint a year's calendar.r8r�N)r�r�)rr�r�r�r�rbrrr�pryear�szTextCalendar.pryearN)T)rr)rr)r)r(r�rv)rrr�rv)r$r%r&r�r�r�r�r�r�r�rr�r�r�rrrrr%s


	


%c@s�eZdZdZdddddddgZeZd	Zd
Zd
ZdZ	dZ
dd
�Zdd�Zdd�Z
dd�Zd dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$rz4
    This calendar returns complete HTML pages.
    ZmonZtueZwedZthuZfriZsatZsunZnodayr
rQcCs(|dkrd|jSd|j||fSdS)z/
        Return a day as a table cell.
        rz<td class="%s">&nbsp;</td>z<td class="%s">%d</td>N)�cssclass_noday�
cssclasses)rrRr	rrrr��s
zHTMLCalendar.formatdaycs d��fdd�|D��}d|S)z8
        Return a complete week as a table row.
        r8c3s|]\}}��||�VqdSrr�r�r!rrr��sz*HTMLCalendar.formatweek.<locals>.<genexpr>�<tr>%s</tr>r�)rr�r�rr!rr��szHTMLCalendar.formatweekcCsd|j|t|fS)z:
        Return a weekday name as a table header.
        �<th class="%s">%s</th>)�cssclasses_weekday_headr)rrRrrrr��s�zHTMLCalendar.formatweekdaycs$d��fdd����D��}d|S)z<
        Return a header for a week as a table row.
        r8c3s|]}��|�VqdSrr�r3r!rrr��sz0HTMLCalendar.formatweekheader.<locals>.<genexpr>r�r�)rr�rr!rr��szHTMLCalendar.formatweekheaderTcCs0|rdt||f}ndt|}d|j|fS)z5
        Return a month name as a table row.
        �%s %sz%sz+<tr><th colspan="7" class="%s">%s</th></tr>)r�cssclass_month_head�rr�r�r�r�rrrr��s�zHTMLCalendar.formatmonthnamecCs�g}|j}|d|j�|d�||j|||d��|d�||���|d�|�||�D]}||�|��|d�q\|d�|d�d�|�S)z6
        Return a formatted month as a table.
        �=<table border="0" cellpadding="0" cellspacing="0" class="%s">r��r��</table>r8)r��cssclass_monthr�r�rtr�r�)rr�r�r�r�r�r�rrrr��s �
zHTMLCalendar.formatmonthrvcCs�g}|j}t|d�}|d|j�|d�|d||j|f�tttd|�D]V}t|t||d��}|d�|D](}|d�||j||d	d
��|d�qr|d�qN|d
�d�|�S)z?
        Return a formatted year as a table of tables.
        r(r�r�z,<tr><th colspan="%d" class="%s">%s</th></tr>r7rFz<tr>z<td>Fr�z</td>z</tr>r�r8)	r�r��
cssclass_year�cssclass_year_headrHr|r�r�r�)rr�rzr�r�r5ryrbrrrr��s,
��

zHTMLCalendar.formatyear�calendar.cssNcCs�|dkrt��}g}|j}|d|�|d�|d�|d�|d|�|dk	r^|d|�|d|�|d	�|d
�||�||��|d�|d�d
�|��|d�S)zB
        Return a formatted year as a complete HTML page.
        Nz$<?xml version="1.0" encoding="%s"?>
zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
z<html>
z<head>
zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />
z4<link rel="stylesheet" type="text/css" href="%s" />
z<title>Calendar for %d</title>
z</head>
z<body>
z</body>
z</html>
r8�xmlcharrefreplace)�sys�getdefaultencodingr�r�r��encode)rr�rz�css�encodingr�r�rrr�formatyearpage
s$zHTMLCalendar.formatyearpage)T)T)rv)rvr�N)r$r%r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�s 



c@s$eZdZdd�Zdd�Zdd�ZdS)�different_localecCs
||_dSr��locale)rr�rrrr #szdifferent_locale.__init__cCs"t�tj�|_t�tj|j�dSr)�_localeZ	getlocale�LC_TIME�	oldlocale�	setlocaler�r!rrr�	__enter__&szdifferent_locale.__enter__cGst�tj|j�dSr)r�r�r�r�)r�argsrrr�__exit__*szdifferent_locale.__exit__N)r$r%r&r r�r�rrrrr�"sr�c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
r�
    This class can be passed a locale name in the constructor and will return
    month and weekday names in the specified locale. If this locale includes
    an encoding all strings containing month and weekday names will be returned
    as unicode.
    rNcCs&t�||�|dkrt��}||_dSr)rr r��getdefaultlocaler��rrr�rrrr 6szLocaleTextCalendar.__init__c
CsNt|j��:|dkrt}nt}||}|d|��|�W5QR�SQRXdS)Nr�)r�r�rrr�)rrRrzr��namerrrr�<sz LocaleTextCalendar.formatweekdayTc
CsDt|j��0t|}|r$d||f}|�|�W5QR�SQRXdS)Nr�)r�r�rr�r�rrrr�Es
z"LocaleTextCalendar.formatmonthname)rN)T�r$r%r&r�r r�r�rrrrr.s
	c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
rr�rNcCs&t�||�|dkrt��}||_dSr)rr r�r�r�r�rrrr TszLocaleHTMLCalendar.__init__c
Cs<t|j��(t|}d|j||fW5QR�SQRXdS)Nr�)r�r�rr�)rrRr�rrrr�Zsz LocaleHTMLCalendar.formatweekdayTc
CsBt|j��.t|}|r$d||f}d|W5QR�SQRXdS)Nr�z.<tr><th colspan="7" class="month">%s</th></tr>)r�r�rr�rrrr�_s
z"LocaleHTMLCalendar.formatmonthname)rN)Tr�rrrrrMs
cCs(t|krtksnt|��|t_dSr)�MONDAY�SUNDAYrr�rr[rrrrls�r�cCstt|||��dS)z1Prints multi-column formatting for year calendarsN)r�r��Zcolsr��spacingrrrr=�sr=cs |d9}|��fdd�|D��S)zEReturns a string formatted from n strings, centered within n columns.r�c3s|]}|���VqdSrr�)r4r��r�rrr��szformatstring.<locals>.<genexpr>r�r�rr�rr��sr�i�cCs^|dd�\}}}}}}t�||d���t|d}|d|}|d|}	|	d|}
|
S)zBUnrelated but handy function to calculate Unix timestamp from GMT.Nr�r(��<)r0r1�	toordinal�
_EPOCH_ORD)�tuplerQr
rRZhourZminute�secondrsZhoursZminutesZsecondsrrrr�scCs�ddl}|��}|�d�}|�d�}|jddtddd�|jd	d
tddd�|jd
dtddd�|jddtddd�|jddddd�|jddddd�|jddddd�|jd d!d"d#d$d%�|jd&d'td(d)�|jd*d'td+d)�|�|dd��}|j�r|j�s|�d,�t	�
d�|j|jf}|jd-k�r�|j�rDt|d.�}nt
�}|j}|dk�rbt	��}t||jd/�}	t	jjj}
|jdk�r�|
|jtj��jf|	��n6|jdk�r�|
|j|jf|	��n|�d0�t	�
d�n�|j�r�t|d.�}nt�}t|j|jd1�}	|jdk�r$|j|	d2<|j|	d3<|jdk�rH|j tj��jf|	�}n2|jdk�rf|j |jf|	�}n|j!|j|jf|	�}t	jj}
|j�r�|�"|j�}t	jjj}
|
|�dS)4Nrztext only argumentszhtml only argumentsz-wz--widthr)z width of date column (default 2))�type�default�helpz-lz--linesr(z)number of lines for each week (default 1)z-sz	--spacingr�z"spacing between months (default 6)z-mz--monthsrvzmonths per row (default 3)z-cz--cssr�zCSS to use for page)r�r�z-Lz--localez.locale to be used from month and weekday namesz-ez
--encodingzencoding to use for outputz-tz--type�text)r��htmlzoutput type (text or html))r��choicesr�rQ�?zyear number (1-9999))�nargsr�r�r
zmonth number (1-12, text only)z/if --locale is specified --encoding is requiredr�r�)r�r�zincorrect number of arguments)r�r�r�rb)#�argparse�ArgumentParserZadd_argument_group�add_argument�int�
parse_argsr�r��errorr��exitr�rrr��dictr��stdout�buffer�writerQr�r0r1Ztodayr
rrrz�linesr�ryr�r�r�)r�r��parserZ	textgroupZ	htmlgroupZoptionsr�r�r�Zoptdictr��resultrrr�main�s�

����������







r�__main__)Ir�r�r0r�r��	itertoolsr�__all__�
ValueErrorr�rrr|rTrSr-rJrrrrrHr�ZTUESDAYZ	WEDNESDAYZTHURSDAYZFRIDAYZSATURDAYr�rrr	r
rXrYrZ�objectrrrr�rrr�r^rrrurr�r�r�r�rrr�r
r�rr�rZ	_colwidthZ_spacingr=r�ZEPOCHr1r�r�rrr$�argvrrrr�<module>s��
u	
h
compileall.cpython-38.opt-2.pyc000064400000015575151450073350012275 0ustar00U

e5dn5�	@s�ddlZddlZddlZddlZddlZddlmZdddgZddd�Z	ddd�Z
d
d�Zddd�Zddd�Z
dd�Zedkr�ee��Ze�e�dS)�N)�partial�compile_dir�compile_file�compile_path�
ccs|dkrt|tj�rt�|�}|s0td�|��zt�|�}Wn.tk
rl|dkrdtd�|��g}YnX|��|D]�}|dkr�qztj	�
||�}|dk	r�tj	�
||�}nd}tj	�|�s�||fVqz|dkrz|tjkrz|tj
krztj	�|�rztj	�|�szt|||d|d�EdHqzdS)N�zListing {!r}...zCan't list {!r}�__pycache__r�)�ddir�	maxlevels�quiet)�
isinstance�os�PathLike�fspath�print�format�listdir�OSError�sort�path�join�isdir�curdir�pardir�islink�	_walk_dir)�dirr
rr�names�name�fullname�dfile�r"�"/usr/lib64/python3.8/compileall.pyrs:


�
��rF���r	c
Cs�d}
|dkrtd��|dkrFzddlm}
Wntk
rDd}YnXt||||d�}d}|dkr�|
dk	r�|ppd}|
|d��0}
|
�tt||||||	d�|�}t|dd	�}W5QRXn(|D]"\}}t	||||||||	�s�d
}q�|S)Nrz%workers must be greater or equal to 0r	)�ProcessPoolExecutor)rrr
T)Zmax_workers)�force�rxr�legacy�optimize�invalidation_mode)�defaultF)
�
ValueErrorZconcurrent.futuresr%�ImportErrorr�mapr�_compile_file_tuple�minr)rrr
r&r'rr(r)�workersr*r%Zfiles_and_ddirs�successZexecutorZresults�filer!r"r"r#r2sF
����cKs|\}}t||f|�S)N)r)Zfile_and_dfile�kwargsr3r!r"r"r#r/esr/c
Cs�d}|dkr"t|tj�r"t�|�}tj�|�}	|dk	rFtj�||	�}
nd}
|dk	rd|�|�}|rd|Stj�|��r�|r�|d}nB|dkr�|dkr�|nd}
t	j
j||
d�}nt	j
�|�}tj�|�}|	dd�|	dd�}}|d	k�r�|�s\zXt
t�|�j�}t�d
t	j
jd|�}t|d��}|�d�}W5QRX||k�rB|WSWntk
�rZYnX|�sptd
�|��ztj|||
d||d�}W�ntjk
�r}zjd}|dk�r�|WY�RS|�r�td�|��ntddd�|jjtjjdd�}|� tjj�}t|�W5d}~XYn�t!t"tfk
�r�}zRd}|dk�rJ|WY�:S|�r`td�|��ntddd�t|j#j$d|�W5d}~XYnX|dk�r�d}|S)NTr�crr	�)�optimization���z.pyz<4sll�rb�zCompiling {!r}...)r)r*Fz*** Error compiling {!r}...z*** )�end�backslashreplace)�errors�:)%r
rrrr�basenamer�search�isfile�	importlib�util�cache_from_source�dirname�int�stat�st_mtime�structZpack�MAGIC_NUMBER�open�readrrr�
py_compile�compile�PyCompileError�msg�encode�sys�stdout�encoding�decode�SyntaxError�UnicodeError�	__class__�__name__)r r
r&r'rr(r)r*r2rr!Zmo�cfile�optZ	cache_dir�head�tail�mtimeZexpectZchandleZactual�ok�errrP�er"r"r#rjs�


�
�

�
�
$
c	CsTd}tjD]D}|r|tjkr2|r2|dkrNtd�q
|oLt||d|||||d�}q
|S)NTrzSkipping current directory)rr(r)r*)rRrrrrr)	Zskip_curdirrr&rr(r)r*r2rr"r"r#r�s 

�
c
Cs�ddl}|jdd�}|jddddddd	�|jd
tddd
�|jddddd�|jdddddd�|jddddd�|jdddddd�|jd d!d"dd#d�|jd$d%d&d'd(�|jd)d*d+d,d-�|jd.d/d0td1d2�d3d4�tjD�}|jd5t|�d6d7�|��}|j}|j	�r$ddl
}|�|j	�|_	|jdk	�r8|j}n|j
}|j�r�zF|jd8k�rZtjnt|j�� }|D]}|�|����qjW5QRXWn4tk
�r�|jd9k�r�td:�|j��Yd;SX|j�r�|j�d8d<���}	tj|	}
nd}
d=}z�|�rl|D]h}tj�|��r6t||j|j |j	|j|j!|
d>��sbd;}n,t"|||j|j |j	|j|j!|j#|
d?�	�s�d;}�q�|WSt$|j!|j |j|
d@�WSWn,t%k
�r�|jd9k�r�tdA�Yd;SXd=S)BNrz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrrz!don't recurse into subdirectories)�actionZconstr+�dest�helpz-r�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)�typercrdz-f�
store_truer&z/force rebuild even if timestamps are up to date)rbrcrdz-q�countrzIoutput only error messages; -qq will suppress the error messages as well.)rbrcr+rdz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)�metavarrcr+rdz-xZREGEXPr'zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILE�flistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rircrd�compile_destzFILE|DIR�*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)ri�nargsrdz-jz	--workersr	zRun compileall concurrently)r+rfrdcSsg|]}|j���dd��qS)�_�-)r�lower�replace)�.0�moder"r"r#�
<listcomp>	s�zmain.<locals>.<listcomp>z--invalidation-modez�set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)�choicesrdrorzError reading file list {}FrnT)r*)r1r*)r(r&rr*z
[interrupted])&�argparse�ArgumentParser�add_argumentrFrM�PycInvalidationMode�sorted�
parse_argsrkr'�rerNrerrjrR�stdinrK�append�striprrrrr*rq�upperrrrArr
r&r(rr1r�KeyboardInterrupt)
rv�parserZinvalidation_modes�argsZ
compile_destsr|r�f�lineZivl_moder*r2rcr"r"r#�main�s��
�
�
��
���
�
�
��� �
�
�r��__main__)Nrr)	rNFNrFr$r	N)NFNrFr$N)r	rFrFr$N)rrR�importlib.utilrBrMrI�	functoolsr�__all__rrr/rrr�rYrFZexit_status�exitr"r"r"r#�<module>
s:

�
3�
V�
"iposixpath.cpython-38.pyc000064400000024276151450073350011231 0ustar00U

e5d=�&@s^dZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Z
d0d1�Zd2d
�Zd3d�Zd4d�Zd5d�Zd6d�Zejje_d7d
�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zd=d�Zdadad>d�Zd?d�Zd@d �Z dAd,�Z!dBdC�Z"e
j#dDkZ$dGdEd.�Z%dFd/�Z&dS)Ha�Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
�.�..�/�:z
/bin:/usr/binNz	/dev/null�)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes��path�r2�!/usr/lib64/python3.8/posixpath.py�_get_sep)s
r4cCs
t�|�S)z6Normalize case of pathname.  Has no effect under Posix��os�fspath)�sr2r2r3r4scCst�|�}t|�}|�|�S)zTest whether a path is absolute)r6r7r4�
startswith)r8r#r2r2r3r<s
c
Gs�t�|�}t|�}|}z^|s,|dd�|ttj|�D]8}|�|�rL|}q8|rZ|�|�rd||7}q8|||7}q8Wn.tttfk
r�t	j
d|f|���YnX|S)z�Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr	)r6r7r4�mapr9�endswith�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr#r1�br2r2r3r	Gs 


cCs`t�|�}t|�}|�|�d}|d|�||d�}}|rX||t|�krX|�|�}||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N�r6r7r4�rfind�len�rstrip)rBr#�i�head�tailr2r2r3rds

cCs6t�|�}t|t�rd}d}nd}d}t�||d|�S)Nr-�.rr)r6r7r.r/r?�	_splitext)rBr#r'r2r2r3rus

cCst�|�}|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr5)rBr2r2r3r
�s
cCs,t�|�}t|�}|�|�d}||d�S)z)Returns the final component of a pathnamerDN)r6r7r4rF)rBr#rIr2r2r3r
�s
cCsNt�|�}t|�}|�|�d}|d|�}|rJ||t|�krJ|�|�}|S)z-Returns the directory component of a pathnamerDNrE)rBr#rIrJr2r2r3r�s

c
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)z&Test whether a path is a symbolic linkF)r6�lstat�OSError�
ValueErrorr=�stat�S_ISLNK�st_mode)r1�str2r2r3r�s
c	Cs.zt�|�Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r6rNrOrPr0r2r2r3r�s
c	Cs�zt�|�}Wnttfk
r(YdSXt�|j�r:dSt|t�rPt	|d�}n
t	|d�}t
|�}zt�|�}Wnttfk
r�YdSX|j}|j}||kr�dS|j}|j}||kr�dSdS)z$Test whether a path is a mount pointF�..rT)
r6rNrOrPrQrRrSr.r/r	r)�st_dev�st_ino)r1�s1�parent�s2�dev1�dev2�ino1�ino2r2r2r3r�s.

c	Cs<t�|�}t|t�rd}nd}|�|�s,|St|�}|�|d�}|dkrPt|�}|dkr�dtjkr�ddl	}z|�
t���j}Wq�t
k
r�|YSXn
tjd}nVddl	}|d|�}t|t�r�t|d�}z|�|�}Wnt
k
r�|YSX|j}t|t��rt�|�}d}nd	}|�|�}|||d��p:|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.�~�~rDr�HOMEN�ASCIIr-r)r6r7r.r/r9r4�findrG�environ�pwd�getpwuid�getuid�pw_dir�KeyError�str�getpwnam�fsencoderH)	r1�tilder#rIre�userhome�name�pwent�rootr2r2r3r�sB








cCsZt�|�}t|t�rVd|kr |Sts:ddl}|�d|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|�d	|j�a
t
j}d
}d}tj}d}|||�}|s��qV|�d�\}}|�
d�}	|	�|�r�|	�|�r�|	dd
�}	z.|dk�rt�tjt�|	��}
n||	}
Wntk
�r&|}Yq�X||d�}|d|�|
}t|�}||7}q�|S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.�$rNs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}rD���)r6r7r.r/�	_varprogb�re�compilerb�search�getattr�_varprogrd�span�groupr9r;rl�fsdecoderirG)r1r{r}�start�endrdrI�m�jro�valuerKr2r2r3rsN






c	Cs�t�|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|�|�}|rp|�|d	�rp|�|d
�spd	}|�|�}g}|D]J}|||fkr�q�||ks�|s�|r�|r�|d|kr�|�|�q�|r�|��q�|}|�|�}|r�|||}|p�|S)z0Normalize path, eliminating double slashes, etc.r-�rLrUr�rr��ry)	r6r7r.r/r9r�append�popr	)	r1r#�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr2r2r3rNsJ


��
�
�

cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)zReturn an absolute path.)	r6r7rr.r/�getcwdb�getcwdr	r)r1�cwdr2r2r3rts



cCs*t�|�}t|dd�|i�\}}t|�S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r6r7�
_joinrealpathr)�filenamer1�okr2r2r3r)�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}|�r|�|�\}}}|r<||kr`q<||kr�|r�t|�\}}||kr�t|||�}q<|}q<t||�}t|�s�|}q<||kr�||}|dk	r�q<t||�dfSd||<t|t�	|�|�\}}	|	�st||�dfS|||<q<|d	fS)
Nr-rLrUrrrrDFT)
r.r/r�	partitionrr	rr�r6�readlink)
r1�rest�seenr#r!r"ro�_�newpathr�r2r2r3r��sH


r��darwinc	Cs�|std��t�|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
t�|�}zrd	d
�t|��|�D�}dd
�t|��|�D�}tt||g��}|gt|�|||d�}|s�|WSt	|�WSt
ttt
fk
r�t�d||��YnXdS)
z#Return a relative version of a pathzno path specifiedrLr-rUrrrNcSsg|]}|r|�qSr2r2��.0�xr2r2r3�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr2r2r�r2r2r3r��sr+)rPr6r7r.r/rrrGrr	r<r=r>�DeprecationWarningr?r@)	r1r�r!r#r"�
start_list�	path_listrI�rel_listr2r2r3r+�s0



c		s2|std��tttj|��}t|dt�r4d�d�nd�d�zƇfdd�|D�}zt�fd	d
�|D��\}Wntk
r�td�d�YnX�fd
d�|D�}t|�}t	|�}|}t
|�D]$\}}|||kr�|d|�}q�q�|r�n
�dd�}|��|�WStt
fk
�r,tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr-rLrrcsg|]}|����qSr2)r)r�r1�r#r2r3r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdS)NrDr2)r�rBr�r2r3�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr2r2)r��c�r!r2r3r�sz)commonpath.<locals>.<listcomp>.<listcomp>r2)r�r8r�r2r3r�sr,)r,)rP�tupler:r6r7r.r/�set�min�max�	enumerater	r<r=r?r@)	�paths�split_pathsrrXrZ�commonrIr��prefixr2)r!r#r3r,�s6)N)'�__doc__r!r"r'r#r$r%r&r(r6�sysrQr?�__all__r4rrr	rrrMr
r
rrrrrrrzrrrr)r��platformr*r+r,r2r2r2r3�<module>s��
	
	

*25&	3

)pty.cpython-38.opt-1.pyc000064400000007565151450073350010767 0ustar00U

e5d��@s�dZddlmZddlZddlZddlZdddgZdZdZdZdZ	d	d�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zeefdd�Zeefdd�ZdS)zPseudo terminal utilities.�)�selectN�openpty�fork�spawn��c	Cs>z
t��WSttfk
r"YnXt�\}}t|�}||fS)zdopenpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible.)�osr�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fd�r�/usr/lib64/python3.8/pty.pyrs

c	CsLzt��\}}Wnttfk
r(YnXt�|�}t�|�||fSt�S)z�master_open() -> (master_fd, slave_name)
    Open a pty master and return the fd, and the filename of the slave end.
    Deprecated, use openpty() instead.)rrr	r
�ttyname�closer)r
rrrrr�master_open"s

rc
CsndD]\}dD]R}d||}zt�|tj�}Wntk
rFYqYnX|d||fSqtd��dS)z1Open pty master and return (master_fd, tty_name).ZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devicesN)r�open�O_RDWRr
)�x�yZpty_name�fdrrrr2s
rcCsrt�|tj�}zddlm}m}Wntk
r:|YSXz|||d�|||d�Wntk
rlYnX|S)z�slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead.r)�ioctl�I_PUSHZptemZldterm)rrrZfcntlrr�ImportErrorr
)Ztty_name�resultrrrrrr>s
rc	Cs�zt��\}}Wnttfk
r(Yn4X|tkrTzt��Wntk
rRYnX||fSt�\}}t��}|tkr�t��t�|�t�	|t
�t�	|t�t�	|t�|tkr�t�|�t�
t�t�tj�}t�|�n
t�|�||fS)zdfork() -> (pid, master_fd)
    Fork and make the child a session leader with a controlling terminal.)r�forkptyr	r
�CHILD�setsidrrr�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidrr
rZtmp_fdrrrrPs0



cCs"|rt�||�}||d�}qdS)z#Write all the data to a descriptor.N)r�write)r�data�nrrr�_writenxsr)cCst�|d�S)zDefault read function.i)r�read)rrrr�_read~sr+cCsv|tg}t|gg�\}}}||krF||�}|s:|�|�nt�t|�t|kr|t�}|sf|�t�qt||�qdS)z�Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)N)r"r�removerr&r#r))r
�master_read�
stdin_readZfdsZrfdsZwfdsZxfdsr'rrr�_copy�sr/cCs�t|�td�kr|f}t�d|�t�\}}|tkrHtj|df|��zt�t	�}t�
t	�d}Wntjk
r~d}YnXzt|||�Wn(t
k
r�|r�t�t	tj|�YnXt�|�t�|d�dS)zCreate a spawned process.�z	pty.spawnrr)�type�sys�auditrrr�execlp�ttyZ	tcgetattrr"Zsetraw�errorr/r
Z	tcsetattrZ	TCSAFLUSHr�waitpid)�argvr-r.r%r
�modeZrestorerrrr�s&




)�__doc__rrr2r5�__all__r"r#r$rrrrrrr)r+r/rrrrr�<module>s$
(smtpd.cpython-38.opt-1.pyc000064400000063541151450073350011276 0ustar00U

e5d���@s^dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddddd	gZejdZd
ZGdd�d�Ze�ad
ZdZdZd%dd�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGdd�d�Z dd�Z!e"dk�rZe!�Z#e#j$Z$de$k�rpe$�%d�Z&e'e$de&�e(�e)�dg�Z*e$e&dd�Z$nddl+Z*e,e*e$�Z-e-e#j.e#j/fe#j0e#j1fe#j2e#j3d�Z4e#j5�r6zddl6Z6Wn.e7k
�r�e8d ej9d!�e�:d�YnXe6�;d"�d#Z<ze�5e<�Wn.e=k
�r4e8d$ej9d!�e�:d�YnXze�>�Wne?k
�rXYnXdS)&a�An RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions.

Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]

Options:

    --nosetuid
    -n
        This program generally tries to setuid `nobody', unless this flag is
        set.  The setuid call will fail if this program is not run as root (in
        which case, use this flag).

    --version
    -V
        Print the version number and exit.

    --class classname
    -c classname
        Use `classname' as the concrete SMTP proxy class.  Uses `PureProxy' by
        default.

    --size limit
    -s limit
        Restrict the total size of the incoming message to "limit" number of
        bytes via the RFC 1870 SIZE extension.  Defaults to 33554432 bytes.

    --smtputf8
    -u
        Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy.

    --debug
    -d
        Turn on debugging prints.

    --help
    -h
        Print this message and exit.

Version: %(__version__)s

If localhost is not given then `localhost' is used, and if localport is not
given then 8025 is used.  If remotehost is not given then `localhost' is used,
and if remoteport is not given, then 25 is used.
�N)�warn)�
get_addr_spec�get_angle_addr�SMTPChannel�
SMTPServer�DebuggingServer�	PureProxy�MailmanProxyzPython SMTP proxy version 0.3c@seZdZdd�Zdd�ZdS)�DevnullcCsdS�N���self�msgrr�/usr/lib64/python3.8/smtpd.py�writef�z
Devnull.writecCsdSrr�rrrr�flushgrz
Devnull.flushN)�__name__�
__module__�__qualname__rrrrrrr
esr
�
z, i�cCs4ttt�tjd�|r&t|tjd�t�|�dS)N��file)�print�__doc__�globals�sys�stderr�exit)�coderrrr�usagepsr#c@s�eZdZdZdZdZe�efdd��Ze	dd��Z
edd	d	fd
d�Zdd
�Z
dd�Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd ��Zejd!d ��Ze	d"d#��Zejd$d#��Ze	d%d&��Zejd'd&��Ze	d(d)��Zejd*d)��Ze	d+d,��Zejd-d,��Ze	d.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dS)Srr�icCs|Srr)�xrrr�<lambda>|rzSMTPChannel.<lambda>cCs0zt|j���WStk
r*|jYSXdSr)�max�command_size_limits�values�
ValueError�command_size_limitrrrr�max_command_size_limit~sz"SMTPChannel.max_command_size_limitNFc	
Cs&tjj|||d�||_||_||_||_||_||_|rF|rFt	d��|rdd|_
d|_d|_t
|_nd|_
d|_td�|_d	|_|��d|_d
|_|j��t��|_z|��|_WnBtk
r�}z$|��|jdtjkr�WY�dSd}~XYnXtdt |j�t!d
�|�"d|jt#f�dS)N��map�Fdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer�
�.r�
�.�
FrzPeer:rz	220 %s %s)$�asynchat�
async_chat�__init__�smtp_server�conn�addr�data_size_limit�enable_SMTPUTF8�_decode_datar*�_emptystring�_linesep�_dotsep�NEWLINE�_newline�ord�_set_rset_state�
seen_greeting�
extended_smtpr(�clear�socketZgetfqdn�fqdnZgetpeername�peer�OSError�close�args�errnoZENOTCONNr�repr�DEBUGSTREAM�push�__version__)	rZserverr9r:r;r.r<�decode_data�errrrrr7�s@


zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|�d�dS)z/Reset state variables to their post-DATA state.NFrr2)�COMMAND�
smtp_state�mailfrom�rcpttos�require_SMTPUTF8�	num_bytes�set_terminatorrrrr�_set_post_data_state�sz SMTPChannel._set_post_data_statecCs|��d|_g|_dS)z.Reset all state variables except the greeting.rN)r\�
received_data�received_linesrrrrrD�szSMTPChannel._set_rset_statecCstdtd�|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' instead��r�DeprecationWarningr8rrrr�__server�s
�zSMTPChannel.__servercCstdtd�||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr_r`�r�valuerrrrb�s
�cCstdtd�|jS)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr_�rrar^rrrr�__line�s
�zSMTPChannel.__linecCstdtd�||_dS)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr_rercrrrrf�s
�cCstdtd�|jS)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr_�rrarVrrrr�__state�s
�zSMTPChannel.__statecCstdtd�||_dS)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr_rgrcrrrrh�s
�cCstdtd�|jS)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr_�rrarErrrr�
__greeting�s
�zSMTPChannel.__greetingcCstdtd�||_dS)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr_rircrrrrj�s
�cCstdtd�|jS)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr_�rrarWrrrr�
__mailfrom�s
�zSMTPChannel.__mailfromcCstdtd�||_dS)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr_rkrcrrrrl�s
�cCstdtd�|jS)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr_�rrarXrrrr�	__rcpttos�s
�zSMTPChannel.__rcpttoscCstdtd�||_dS)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr_rmrcrrrrn�s
�cCstdtd�|jS)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr_�rrar]rrrr�__data�s
�zSMTPChannel.__datacCstdtd�||_dS)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr_rorcrrrrps
�cCstdtd�|jS)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr_�rrarIrrrr�__fqdn
s
�zSMTPChannel.__fqdncCstdtd�||_dS)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr_rqrcrrrrrs
�cCstdtd�|jS)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr_�rrarJrrrr�__peers
�zSMTPChannel.__peercCstdtd�||_dS)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr_rsrcrrrrts
�cCstdtd�|jS)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr_�rrar9rrrr�__conn s
�zSMTPChannel.__conncCstdtd�||_dS)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr_rurcrrrrv%s
�cCstdtd�|jS)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr_�rrar:rrrr�__addr+s
�zSMTPChannel.__addrcCstdtd�||_dS)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr_rwrcrrrrx0s
�cCs&tj�|t|d|jrdnd��dS)Nr0�utf-8�ascii)r5r6rQ�bytesrYr
rrrrQ7s
�zSMTPChannel.pushcCs|d}|j|jkr|j}n|j|jkr*|j}|r<|j|kr<dS|rR|jt|�7_|jrl|j�	t
|d��n|j�	|�dS)Nry)rVrUr,�DATAr;rZ�lenr=r^�append�str)r�data�limitrrr�collect_incoming_data<sz!SMTPChannel.collect_incoming_datac
Cs|j�|j�}tdt|�td�g|_|j|jk�r|jd}|_|sT|�	d�dS|j
sdt|d�}|�d�}|dkr�|�
�}d}n$|d|��
�}||dd���}|jr�|j|n|j}||kr�|�	d�dSt|d	|d�}|s�|�	d
|�dS||�dS|j|jk�r(|�	d�d|_dS|j�rR|j|jk�rR|�	d�d|_dSg}|�|j�D]:}	|	�r�|	d|jk�r�|�|	dd��n
|�|	��qb|j�|�|_|j|j|j|jf}
i}|j
�s�|j|jd
�}|j j!|
|�}|�"�|�s|�	d�n
|�	|�dS)NzData:rrz500 Error: bad syntaxry� r$z500 Error: line too longZsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data)�mail_options�rcpt_options�250 OK)#r>�joinr^rrOrPrVrUrZrQr=r�find�upper�striprFr(r+�getattrr|r;�splitr?r@r~rBr]rJrWrXr�r�r8�process_messager\)
r�lineZsz�i�command�argZmax_sz�methodr��textrM�kwargsZstatusrrr�found_terminatorLsl


��


�zSMTPChannel.found_terminatorcCsH|s|�d�dS|jr&|�d�dS|��||_|�d|j�dS)Nz501 Syntax: HELO hostname�503 Duplicate HELO/EHLOz250 %s)rQrErDrI�rr�rrr�	smtp_HELO�s

zSMTPChannel.smtp_HELOcCs�|s|�d�dS|jr&|�d�dS|��||_d|_|�d|j�|jrr|�d|j�|jdd7<|js�|�d�|jr�|�d	�|jdd
7<|�d�dS)Nz501 Syntax: EHLO hostnamer�Tz250-%sz250-SIZE %s�MAIL�z250-8BITMIMEz250-SMTPUTF8�
z250 HELP)	rQrErDrFrIr;r(r=r<r�rrr�	smtp_EHLO�s&



zSMTPChannel.smtp_EHLOcCs|r|�d�n
|�d�dS)Nz501 Syntax: NOOPr��rQr�rrr�	smtp_NOOP�szSMTPChannel.smtp_NOOPcCs|�d�|��dS)Nz221 Bye)rQZclose_when_doner�rrr�	smtp_QUIT�s
zSMTPChannel.smtp_QUITcCs0t|�}|d|���|kr,||d���SdS)Nr)r}r�r�)r�keywordr�Zkeylenrrr�_strip_command_keyword�sz"SMTPChannel._strip_command_keywordcCsF|sdS|���d�r$t|�\}}nt|�\}}|s<||fS|j|fS)N)rr�<)�lstrip�
startswithrrZ	addr_spec)rr��address�restrrr�_getaddr�szSMTPChannel._getaddrcCsHi}|D]:}|�d�\}}}|��r,|r2|s2dS|r:|nd||<q|S)N�=T)�	partition�isalnum)r�params�resultZparam�eqrdrrr�
_getparams�szSMTPChannel._getparamscCs|r�d}|��}|dkr$|�d�q�|dkr8|�d�q�|dkr^d}|jrR||7}|�|�q�|dkr�d	}|jrx||7}|�|�q�|d
kr�|�d�q�|dkr�|�d
�q�|dkr�|�d�q�|dkr�|�d�q�|dkr�|�d�q�|�d�n
|�d�dS)N� [SP <mail-parameters>]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamer�z 250 Syntax: MAIL FROM: <address>ZRCPTz250 Syntax: RCPT TO: <address>r|z250 Syntax: DATAZRSETz250 Syntax: RSETZNOOPz250 Syntax: NOOPZQUITz250 Syntax: QUITZVRFYz250 Syntax: VRFY <address>zD501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFYzD250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY)r�rQrF)rr�ZextendedZlc_argrrrr�	smtp_HELP�s:zSMTPChannel.smtp_HELPcCs@|r2|�|�\}}|r"|�d�q<|�d|�n
|�d�dS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY <address>)r�rQ)rr�r�r�rrr�	smtp_VRFY�szSMTPChannel.smtp_VRFYcCs�|js|�d�dStd|td�d}|jr4|d7}|dkrJ|�|�dS|�d|�}|�|�\}}|sv|�|�dS|js�|r�|�|�dS|jr�|�d�dS|���	�|_
|�|j
�}|dkr�|�|�dS|js�|�
dd	�}|d
kr�|�d�dS|j�r8|�
dd
�}|dk�r d|_n|d
k	�r8|�d�dS|�
dd�}|�r�|���sb|�|�dS|j�r�t|�|jk�r�|�d�dSt|���dk�r�|�d�dS||_td|jtd�|�d�dS)N�503 Error: send HELO firstz	===> MAILrz 501 Syntax: MAIL FROM: <address>r�zFROM:z503 Error: nested MAIL commandZBODY�7BIT)r�Z8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMEZSMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsZSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r�)rErQrrPrFr�r�rWr�r�r�r�r=�popr<rY�isdigitr;�intr}�keys)rr��	syntaxerrr�r�Zbody�smtputf8�sizerrr�	smtp_MAILsh














zSMTPChannel.smtp_MAILcCs|js|�d�dStd|td�|js6|�d�dSd}|jrH|d7}|dkr^|�|�dS|�d|�}|�|�\}}|s�|�|�dS|js�|r�|�|�dS|���	�|_
|�|j
�}|dkr�|�|�dSt|�
��dkr�|�d	�dS|j�|�td
|jtd�|�d�dS)Nr�z	===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO: <address>r�zTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r�)rErQrrPrWrFr�r�r�r�r�r�r}r�rXr~)rr�r�r�r�rrr�	smtp_RCPT7s@







zSMTPChannel.smtp_RCPTcCs(|r|�d�dS|��|�d�dS)Nz501 Syntax: RSETr�)rQrDr�rrr�	smtp_RSETZs

zSMTPChannel.smtp_RSETcCsZ|js|�d�dS|js(|�d�dS|r:|�d�dS|j|_|�d�|�d�dS)Nr�z503 Error: need RCPT commandz501 Syntax: DATAs
.
z#354 End data with <CR><LF>.<CR><LF>)rErQrXr|rVr[r�rrr�	smtp_DATAas



zSMTPChannel.smtp_DATAcCs|�d�dS)Nz502 EXPN not implementedr�r�rrr�	smtp_EXPNpszSMTPChannel.smtp_EXPN),rrrrUr|r+�collections�defaultdictr(�propertyr,�DATA_SIZE_DEFAULTr7r\rDZ_SMTPChannel__server�setterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrws�
�
'	





















>#6#c@s2eZdZeZedddfdd�Zdd�Zdd�ZdS)	rNFcCs�||_||_||_||_||_|r.|r.td��tjj||d�zNt	j
|dt	ji�}|�|dd|dd�|�
�|�|�|�d�Wn|���Yn(Xtd|jjt�t���||ftd�dS)	Nr/r-�typerr$�z0%s started at %s
	Local addr: %s
	Remote addr:%sr)Z
_localaddr�_remoteaddrr;r<r=r*�asyncore�
dispatcherr7rHZgetaddrinfoZSOCK_STREAMZ
create_socketZset_reuse_addrZbindZlistenrLr�	__class__r�time�ctimerP)rZ	localaddrZ
remoteaddrr;r.r<rSZgai_resultsrrrr7xs6�
��zSMTPServer.__init__c	Cs6tdt|�td�|�||||j|j|j|j�}dS)NzIncoming connection from %sr)rrOrP�
channel_classr;�_mapr<r=)rr9r:Zchannelrrr�handle_accepted�s�zSMTPServer.handle_acceptedcKst�dS)aOverride this abstract method to handle messages from the client.

        peer is a tuple containing (ipaddr, port) of the client that made the
        socket connection to our smtp port.

        mailfrom is the raw address the client claims the message is coming
        from.

        rcpttos is a list of raw addresses the client wishes to deliver the
        message to.

        data is a string containing the entire full text of the message,
        headers (if supplied) and all.  It has been `de-transparencied'
        according to RFC 821, Section 4.5.2.  In other words, a line
        containing a `.' followed by other text has had the leading dot
        removed.

        kwargs is a dictionary containing additional information.  It is
        empty if decode_data=True was given as init parameter, otherwise
        it will contain the following keys:
            'mail_options': list of parameters to the mail command.  All
                            elements are uppercase strings.  Example:
                            ['BODY=8BITMIME', 'SMTPUTF8'].
            'rcpt_options': same, for the rcpt command.

        This function should return None for a normal `250 Ok' response;
        otherwise, it should return the desired response string in RFC 821
        format.

        N)�NotImplementedError�rrJrWrXr�r�rrrr��szSMTPServer.process_message)	rrrrr�r�r7r�r�rrrrrts�
c@seZdZdd�Zdd�ZdS)rcCsld}|��}|D]V}|rL|sLd|d}t|t�s@t|�d��}t|�d}t|t�s^t|�}t|�qdS)Nr$zX-Peer: rry)�
splitlines�
isinstancerrO�encoder)rrJr�Z	inheaders�linesr�Z
peerheaderrrr�_print_message_content�s

z&DebuggingServer._print_message_contentcKsXtd�|r@|�d�r&td|d�|�d�r@td|d�|�||�td�dS)Nz%---------- MESSAGE FOLLOWS ----------r�zmail options: %sr�zrcpt options: %s
z%------------ END MESSAGE ------------)r�getr�r�rrrr��s

zDebuggingServer.process_messageN)rrrr�r�rrrrr�scs,eZdZ�fdd�Zdd�Zdd�Z�ZS)rcs.d|kr|drtd��tt|�j||�dS)Nr<z$PureProxy does not support SMTPUTF8.�r*�superrr7�rrMr��r�rrr7�szPureProxy.__init__c	Csf|�d�}d}|D]}|sq(|d7}q|�|d|d�t�|�}|�|||�}td|td�dS)Nrrr$z
X-Peer: %szwe got some refusals:r)r��insertrAr��_deliverrrP)	rrJrWrXr�r�r�r��refusedrrrr��s


zPureProxy.process_messagec
Cs�ddl}i}zB|��}|�|jd|jd�z|�|||�}W5|��XWn�|jk
r�}ztdtd�|j	}W5d}~XYnft
|jfk
r�}zBtd|jtd�t
|dd�}t
|dd	�}	|D]}
||	f||
<q�W5d}~XYnX|S)
Nrr$zgot SMTPRecipientsRefusedrZgotZ	smtp_code���Z
smtp_error�ignore)�smtplibZSMTPZconnectr��quitZsendmailZSMTPRecipientsRefusedrrPZ
recipientsrKZ
SMTPExceptionr�r�)rrWrXr�r�r��s�eZerrcode�errmsg�rrrrr��s$ zPureProxy._deliver)rrrr7r�r��
__classcell__rrr�rr�scs$eZdZ�fdd�Zdd�Z�ZS)r	cs.d|kr|drtd��tt|�j||�dS)Nr<z'MailmanProxy does not support SMTPUTF8.r�r�r�rrr7
szMailmanProxy.__init__cCs*ddlm}ddlm}ddlm}ddlm}g}	|D]t}
|
���d�d}|�d�}t|�dkrfq8|d}
t|�dkr�|d	}nd
}|�	|
�r8|dkr�q8|	�
|
|
|f�q8|	D]\}
}
}|�|
�q�tdd
�
|�td�|r�|�|||�}td|td�i}||�}|�|�}|�d��s&||d<|�d��sDt�t���|d<|	D]�\}
}
}td|
td�|�|
�}|�s�|j|
dd�}|||
<|d
k�r�|j|d	d�n�|dk�r�|j|d	d�nh|dk�r�|j|d	d�nN|dk�r�|j|d	d�n4|dk�rH|dk�rd|d <nd!|d <|j|d	d��qHdS)"Nr)�StringIO)�Utils)�Message)�MailList�@�-r_r$r)r�admin�owner�requestr��leavezforwarding recips:r�rzwe got refusals:�fromZFrom�dateZDatezsending message to)�lock)�tolistr�)Ztoadminr�)Ztoownerr�)Z	torequest)r�r�r�Z	subscribeZSubjectZunsubscribe)�ior�ZMailmanr�r�r��lowerr�r}Zlist_existsr~�removerr�rPr�r�r�r�ZEnqueue)rrJrWrXr�r�r�r�r�Z	listnamesZrcptZlocal�partsZlistnamer�r�Zmlistsr�rZmlistrrrr�sb










zMailmanProxy.process_message)rrrr7r�r�rrr�rr	sc@seZdZdZdZdZdZdS)�OptionsTrNF)rrr�setuid�	classname�
size_limitr<rrrrr�_sr�c
Cspz.t�tjdd�dddddddd	g�\}}Wn.tjk
r\}ztd|�W5d}~XYnXt�}|D]�\}}|d
kr�td�qh|dkr�tt�t�d�qh|d
kr�d|_	qh|dkr�||_
qh|dkr�tjaqh|dkr�d|_
qh|dkrhzt|�}||_Wqhtd|tjd�t�d�YqhXqht|�dk�r<d}d}nPt|�dk�rX|d}d}n4t|�dk�rx|d}|d}ntddt�|��|�d�}	|	dk�r�tdd|�|d|	�|_zt||	dd��|_Wn$tk
�r�tdd|�YnX|�d�}	|	dk�rtdd|�|d|	�|_zt||	dd��|_Wn$tk
�rjtdd|�YnX|S) Nr$z	nVhc:s:duzclass=Znosetuid�version�helpzsize=�debugr�)z-hz--helpr)z-Vz	--version)z-nz
--nosetuidF)z-cz--class)z-dz--debug)z-uz
--smtputf8T)z-sz--sizezInvalid size: rzlocalhost:8025zlocalhost:25r_�zInvalid arguments: %s�:zBad local spec: %szBad local port: %szBad remote spec: %szBad remote port: %s)�getoptr�argv�errorr#r�rrRr!r�r�r rPr<r�r�r}�
COMMASPACEr�r��	localhost�	localportr*�
remotehost�
remoteport)
ZoptsrMr��options�optr�Zint_sizeZ	localspecZ
remotespecr�rrr�	parseargsfsv��






r
�__main__r1r$)r<z7Cannot import module "pwd"; try running with -n option.r�nobodyr_z3Cannot setuid "nobody"; try running with -n option.)r)@rr�osrNrr�rHr�r5r��warningsrZemail._header_value_parserrr�__all__rZprogramrRr
rPrArr�r#r6rr�rrrr	r�r
rrr��rfindZlastdot�
__import__r�locals�modrr�Zclass_rrr	r
r�r<�proxyr��pwd�ImportErrorrr r!�getpwnamr�PermissionErrorZloop�KeyboardInterruptrrrr�<module>s�N�

M-SB




�fnmatch.cpython-38.pyc000064400000006435151450073350010627 0ustar00U

e5d��@sjdZddlZddlZddlZddlZddddgZdd�Zejdd	d
�dd��Zd
d�Z	dd�Z
dd�ZdS)a�Filename matching with shell patterns.

fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.

The functions operate by translating the pattern into a regular
expression.  They cache the compiled regular expressions for speed.

The function translate(PATTERN) returns a regular expression
corresponding to PATTERN.  (It does not compile it.)
�N�filter�fnmatch�fnmatchcase�	translatecCs"tj�|�}tj�|�}t||�S)a�Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).
    )�os�path�normcaser)�name�pat�r�/usr/lib64/python3.8/fnmatch.pyrs�T)�maxsize�typedcCs<t|t�r(t|d�}t|�}t|d�}nt|�}t�|�jS)Nz
ISO-8859-1)�
isinstance�bytes�strr�re�compile�match)r
Zpat_strZres_str�resrrr�_compile_pattern&s

rcCshg}tj�|�}t|�}tjtkr@|D]}||�r&|�|�q&n$|D]}|tj�|��rD|�|�qD|S)zJConstruct a list from those elements of the iterable NAMES that match PAT.)rrrr�	posixpath�append)�namesr
�resultrr	rrrr0s
cCst|�}||�dk	S)z�Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    N)r)r	r
rrrrr@sc	Cs�dt|�}}d}||k�r�||}|d}|dkr>|d}q|dkrP|d}q|dk�r�|}||krz||d	krz|d}||kr�||d
kr�|d}||kr�||d
kr�|d}q�||kr�|d}�q�|||�}d|kr�|�d
d�}n�g}||d	k�r|dn|d}|�d||�}|dk�r(�qN|�|||��|d}|d}�q|�|||��d�dd�|D��}t�dd|�}|d}|dd	k�r�d|dd�}n|ddk�r�d
|}d||f}q|t�|�}qd|S)zfTranslate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    r���*z.*�?�.�[�!�]z\[z--�\�\\��-�css"|]}|�dd��dd�VqdS)r$r%r'z\-N)�replace)�.0�srrr�	<genexpr>ts�ztranslate.<locals>.<genexpr>z([&~|])z\\\1�^N)r-r!z%s[%s]z	(?s:%s)\Z)�lenr)�findr�joinr�sub�escape)	r
�i�nr�c�jZstuffZchunks�krrrrJsV






�)�__doc__rrr�	functools�__all__r�	lru_cacherrrrrrrr�<module>s
	
_compression.cpython-38.opt-1.pyc000064400000010064151450073350012637 0ustar00U

e5d��@s:dZddlZejZGdd�dej�ZGdd�dej�ZdS)z7Internal classes used by the gzip, lzma and bz2 modules�Nc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
BaseStreamzMode-checking helper functions.cCs|jrtd��dS)NzI/O operation on closed file)�closed�
ValueError��self�r�$/usr/lib64/python3.8/_compression.py�_check_not_closedszBaseStream._check_not_closedcCs|��st�d��dS)NzFile not open for reading)�readable�io�UnsupportedOperationrrrr�_check_can_readszBaseStream._check_can_readcCs|��st�d��dS)NzFile not open for writing)�writablerrrrrr�_check_can_writeszBaseStream._check_can_writecCs(|��st�d��|��s$t�d��dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r
rr�seekablerrrr�_check_can_seeks
zBaseStream._check_can_seekN)�__name__�
__module__�__qualname__�__doc__r	r
rrrrrrr	s
rcsjeZdZdZdd�Zddd�Z�fdd�Zd	d
�Zdd�Zddd�Z	dd�Z
ejfdd�Z
dd�Z�ZS)�DecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIcCsdS)NTrrrrrr
$szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|j�|_||_dS)NFr���)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args�
_decompressor�_trailing_error)r�fpZdecomp_factoryZtrailing_errorZdecomp_argsrrr�__init__'szDecompressReader.__init__csd|_t���S�N)r�super�closer��	__class__rrr$;szDecompressReader.closecCs
|j��Sr")rrrrrrr?szDecompressReader.seekablec
CsPt|��:}|�d��$}|�t|��}||dt|��<W5QRXW5QRXt|�S)N�B)�
memoryview�cast�read�len)r�bZviewZ	byte_view�datarrr�readintoBs$zDecompressReader.readintorcCs�|dkr|��S|r|jrdSd}|jjr�|jjp<|j�t�}|sDq�|jf|j	�|_z|j�
||�}Wq�|jk
r�Yq�Yq�Xn4|jjr�|j�t�}|s�t
d��nd}|j�
||�}|r"q�q"|s�d|_|j|_dS|jt|�7_|S)Nr�zACompressed file ended before the end-of-stream marker was reachedT)�readallrr�eofZunused_datarr*�BUFFER_SIZErr�
decompressrZneeds_input�EOFErrorrrr+)r�sizer-Zrawblockrrrr*Hs@

��
zDecompressReader.readcCs,|j�d�d|_d|_|jf|j�|_dS)NrF)r�seekrrrrrrrrr�_rewindrszDecompressReader._rewindcCs�|tjkrnR|tjkr"|j|}n<|tjkrP|jdkrD|�tj�rDq6|j|}ntd�	|���||jkrr|�
�n
||j8}|dkr�|�ttj|��}|s�q�|t|�8}q||jS)NrzInvalid value for whence: {})
r�SEEK_SET�SEEK_CURr�SEEK_ENDrr*�DEFAULT_BUFFER_SIZEr�formatr7�minr+)r�offset�whencer-rrrr6xs&






zDecompressReader.seekcCs|jS)z!Return the current file position.)rrrrr�tell�szDecompressReader.tell)r)r)rrrrr
r!r$rr.r*r7rr8r6r@�
__classcell__rrr%rr!s

*r)rrr;r2�BufferedIOBaser�	RawIOBaserrrrr�<module>sdummy_threading.cpython-38.opt-1.pyc000064400000002130151450073350013312 0ustar00U

e5d�
�	@sdZddlmZddlZdZdZdZz�dekr:edZ
dZed	ed<dekr`edZdZed=dekrzedZ	dZed=ddlZeded
<ed=eded<ed=ddlTdd
lm
Z
W5er�eed<[[er�e	ed<[	[er�e
ed<[
ned=[[[XdS)aaFaux ``threading`` version using ``dummy_thread`` instead of ``thread``.

The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported.  Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``_thread`` was available which is not desired.

�)�modulesNF�	threadingZ_threading_local�_threadT�
_dummy_thread�_dummy_threadingZ_dummy__threading_local)�*)�__all__)�__doc__�sysrZsys_modulesrZholding_threadZholding_threadingZholding__threading_localZheld_threadingZheld__threading_localZheld_threadrrr�rr�'/usr/lib64/python3.8/dummy_threading.py�<module>sP_dummy_thread.cpython-38.opt-1.pyc000064400000013627151450073350012770 0ustar00U

e5d��@s�dZddddddddgZd	ZeZifd
d�Zdd�Zdd�Zd
d�Zddd�Z	dd�Z
Gdd�de�ZGdd�de�Z
dadadd�ZdS)a/Drop-in replacement for the thread module.

Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.

Suggested usage is::

    try:
        import _thread
    except ImportError:
        import _dummy_thread as _thread

�error�start_new_thread�exit�	get_ident�
allocate_lock�interrupt_main�LockType�RLocklcCs�t|�tt��krtd��t|�tt��kr4td��daz|||�Wn.tk
rZYnddl}|��YnXdatr�dat	�dS)a�Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    z2nd arg must be a tuplez3rd arg must be a dictF�NT)
�type�tuple�	TypeError�dict�_main�
SystemExit�	traceback�	print_exc�
_interrupt�KeyboardInterrupt)Zfunction�args�kwargsr�r�%/usr/lib64/python3.8/_dummy_thread.pyrs 
cCst�dS)z'Dummy implementation of _thread.exit().N)rrrrrr=scCsdS)z�Dummy implementation of _thread.get_ident().

    Since this module should only be used when _threadmodule is not
    available, it is safe to assume that the current process is the
    only thread.  Thus a constant can be safely returned.
    �rrrrrrAscCst�S)z0Dummy implementation of _thread.allocate_lock().�rrrrrrJsNcCs|dk	rtd��dS)z-Dummy implementation of _thread.stack_size().Nz'setting thread stack size not supportedr	)r)�sizerrr�
stack_sizeNsrcCst�S)z0Dummy implementation of _thread._set_sentinel().rrrrr�
_set_sentinelTsrc@sFeZdZdZdd�Zddd�ZeZdd	�Zd
d�Zdd
�Z	dd�Z
dS)ra�Class implementing dummy implementation of _thread.LockType.

    Compatibility is maintained by maintaining self.locked_status
    which is a boolean that stores the state of the lock.  Pickling of
    the lock, though, should not be done since if the _thread module is
    then used with an unpickled ``lock()`` from here problems could
    occur from this class not having atomic methods.

    cCs
d|_dS)NF��
locked_status��selfrrr�__init__cszLockType.__init__N���cCsH|dks|rd|_dS|js&d|_dS|dkr@ddl}|�|�dSdS)a�Dummy implementation of acquire().

        For blocking calls, self.locked_status is automatically set to
        True and returned appropriately based on value of
        ``waitflag``.  If it is non-blocking, then the value is
        actually checked and not set if it is already acquired.  This
        is all done so that threading.Condition's assert statements
        aren't triggered and throw a little fit.

        NTr	F)r�time�sleep)r �waitflag�timeoutr#rrr�acquirefs
zLockType.acquirecCs|��dS�N)�release)r �typ�val�tbrrr�__exit__�szLockType.__exit__cCs|js
t�d|_dS)zRelease the dummy lock.FT)rrrrrrr)�szLockType.releasecCs|jSr(rrrrr�locked�szLockType.lockedcCs*d|jrdnd|jj|jjtt|��fS)Nz<%s %s.%s object at %s>r.Zunlocked)r�	__class__�
__module__�__qualname__�hex�idrrrr�__repr__�s
�zLockType.__repr__)Nr")�__name__r0r1�__doc__r!r'�	__enter__r-r)r.r4rrrrrXs

	cs:eZdZdZ�fdd�Zd
�fdd�	Z�fdd	�Z�ZS)raDummy implementation of threading._RLock.

    Re-entrant lock can be aquired multiple times and needs to be released
    just as many times. This dummy implemention does not check wheter the
    current thread actually owns the lock, but does accounting on the call
    counts.
    cst���d|_dS)Nr	)�superr!�_levelsr�r/rrr!�s
zRLock.__init__Nr"cs$t��||�}|r |jd7_|S)zEAquire the lock, can be called multiple times in succession.
        r)r8r'r9)r r%r&r.r:rrr'�sz
RLock.acquirecs4|jdkrt�|jdkr"t���|jd8_dS)zERelease needs to be called once for every call to acquire().
        r	rN)r9rr8r)rr:rrr)�s



z
RLock.release)Nr")r5r0r1r6r!r'r)�
__classcell__rrr:rr�sFTcCstr
t�ndadS)z^Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting.TN)rrrrrrrr�s)N)r6�__all__�TIMEOUT_MAX�RuntimeErrorrrrrrrr�objectrrrrrrrrr�<module>s$
� 	
@shlex.cpython-38.pyc000064400000016562151450073350010334 0ustar00U

e5d
4�	@s�dZddlZddlZddlZddlmZddlmZddddgZGd	d�d�Z	ddd�Z
d
d�Ze�dej
�jZdd�Zdd�Zedkr�eej�dkr�ee	��n,ejdZee��Zee	ee��W5QRXdS)�8A lexical analyzer class for simple shell-like syntaxes.�N)�deque)�StringIO�shlex�split�quote�joinc@sreZdZdZddd�Zedd��Zdd	�Zdd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dd�Zdd�ZdS)rrNFcCst|t�rt|�}|dk	r(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
|jrn|j
d7_
d|_d|_d|_
d|_d	|_d
|_t�|_d|_d|_d|_t�|_d|_|s�d}n|d
kr�d}||_|�rt�|_|j
d7_
|j
�t�|��}|j
�|�|_
dS)N��#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"�\�"� �rTz();<>|&z~-./*?=)�
isinstance�strr�instream�infile�sys�stdin�posix�eof�
commenters�	wordchars�
whitespace�whitespace_split�quotes�escape�
escapedquotes�stater�pushback�lineno�debug�token�	filestack�source�_punctuation_chars�_pushback_chars�	maketrans�dict�fromkeys�	translate)�selfrrr�punctuation_chars�t�r.�/usr/lib64/python3.8/shlex.py�__init__sJ
zshlex.__init__cCs|jS�N)r%�r+r.r.r/r,Dszshlex.punctuation_charscCs*|jdkrtdt|��|j�|�dS)z:Push a token onto the stack popped by the get_token methodrzshlex: pushing token N)r!�print�reprr�
appendleft)r+�tokr.r.r/�
push_tokenHs
zshlex.push_tokencCspt|t�rt|�}|j�|j|j|jf�||_||_d|_|jrl|dk	r\t	d|jf�nt	d|jf�dS)z9Push an input source onto the lexer's input source stack.rNzshlex: pushing to file %szshlex: pushing to stream %s)
rrrr#r5rrr r!r3)r+�	newstream�newfiler.r.r/�push_sourceNs
zshlex.push_sourcecCsD|j��|j��\|_|_|_|jr:td|j|jf�d|_dS)zPop the input source stack.zshlex: popping to %s, line %dr
N)	r�closer#�popleftrr r!r3rr2r.r.r/�
pop_source\s

�zshlex.pop_sourcecCs�|jr.|j��}|jdkr*tdt|��|S|��}|jdk	rz||jkrz|�|���}|rp|\}}|�||�|�	�}q@||j
kr�|js�|j
S|��|�	�}qz|jdkr�||j
kr�tdt|��ntd�|S)zBGet a token from the input stream (or from stack if it's nonempty)rzshlex: popping token Nz
shlex: token=zshlex: token=EOF)
rr<r!r3r4�
read_tokenr$�
sourcehookr:�	get_tokenrr#r=)r+r6�raw�specr9r8r.r.r/r@es.








zshlex.get_tokencCs�d}d}|jr |jr |j��}n|j�d�}|dkrB|jd7_|jdkr^td|j|f�|jdkrtd|_	�q�q|jdk�r�|s�d|_�q��q�||j
kr�|jdkr�td	�|j	s�|jr|r�q�nqn�||jkr�|j�
�|jd7_n�|j�r||jk�rd
}||_n�||jk�r&||_	d
|_nr||jk�r@||_	d|_nX||jk�rb|j�sZ||_	||_n6|j�rx||_	d
|_n ||_	|j	�s�|jr|r�q�nqq|j|jk�rDd}|�s�|jdk�r�td
�td��||jk�r|j�s�|j	|7_	d|_�q�nd
|_n>|j�r4||jk�r4|j|jk�r4|j}||_n|j	|7_	q|j|jk�r�|�st|jdk�rltd�td��||jk�r�||jk�r�||k�r�|j	|j7_	|j	|7_	||_q|jdkr|�s�d|_�q�q||j
k�r|jdk�r�td�d|_|j	�s�|jr|r�q�nqq||jk�rh|j�
�|jd7_|j�r�d|_|j	�s�|jr|r�q�nqq|jdk�r�||jk�r�|j	|7_	n"||j
k�r�|j�|�d|_�q�q|j�r�||jk�r�||_q|j�r�||jk�r�d
}||_q||jk�s||jk�s|j�r,||jk�r,|j	|7_	q|j�rB|j�|�n|j�|�|jdk�rbtd�d|_|j	�s�|jr|r�q�qqq|j	}d|_	|j�r�|�s�|dk�r�d}|jdk�r�|�r�tdt|��ntd�|S)NFr
r�
�z&shlex: in state %r I see character: %rr	�z+shlex: I see whitespace in whitespace state�a�cTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rFrGz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r,r&�popr�readr r!r3rr"rrr�readlinerrrr�
ValueErrorr�appendrr5r4)r+ZquotedZescapedstateZnextchar�resultr.r.r/r>�s

�




���

��zshlex.read_tokencCsV|ddkr|dd�}t|jt�rHtj�|�sHtj�tj�|j�|�}|t|d�fS)z(Hook called on a filename to be sourced.rrr����r)	rrr�os�path�isabsr�dirname�open)r+r9r.r.r/r?s
zshlex.sourcehookcCs(|dkr|j}|dkr|j}d||fS)z<Emit a C-compiler-like, Emacs-friendly error-message leader.Nz"%s", line %d: )rr )r+rr r.r.r/�error_leader s
zshlex.error_leadercCs|Sr1r.r2r.r.r/�__iter__(szshlex.__iter__cCs|��}||jkrt�|Sr1)r@r�
StopIteration)r+r"r.r.r/�__next__+s
zshlex.__next__)NNFF)N)NN)�__name__�
__module__�__qualname__�__doc__r0�propertyr,r7r:r=r@r>r?rUrVrXr.r.r.r/rs �
/

	 	
FTcCs$t||d�}d|_|sd|_t|�S)z-Split the string *s* using shell-like syntax.)rTr	)rrr�list)�sZcommentsrZlexr.r.r/r1s
cCsd�dd�|D��S)z3Return a shell-escaped string from *split_command*.r
css|]}t|�VqdSr1)r)�.0�argr.r.r/�	<genexpr><szjoin.<locals>.<genexpr>)r)Z
split_commandr.r.r/r:sz[^\w@%+=:,./-]cCs,|sdSt|�dkr|Sd|�dd�dS)z1Return a shell-escaped version of the string *s*.z''N�'z'"'"')�_find_unsafe�replace)r_r.r.r/rAs
cCs$|��}|sq tdt|��qdS)NzToken: )r@r3r4)ZlexerZttr.r.r/�
_print_tokensMsrf�__main__r)FT)r\rP�rer�collectionsr�ior�__all__rrr�compile�ASCII�searchrdrrfrY�len�argv�fnrT�fr.r.r.r/�<module>s(	 
	

codecs.cpython-38.opt-1.pyc000064400000102246151450073350011403 0ustar00U

e5d;��,@s�dZddlZddlZzddlTWn.ek
rNZzede��W5dZ[XYnXddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g,Zd1Zd2Z	Z
d3ZZd4Z
d5Zejd6kr�e
ZZe
ZneZZeZe
ZeZe
ZeZGd7d�de�ZGd8d�d�ZGd9d�de�ZGd:d;�d;e�ZGd<d�de�ZGd=d>�d>e�ZGd?d�de�ZGd@d�de�Z GdAd�d�Z!GdBd�d�Z"d\dFd�Z#d]dGd�Z$dHd�Z%dId �Z&dJd!�Z'dKd"�Z(dLd#�Z)dMd$�Z*d^dNd'�Z+d_dOd(�Z,dPdQ�Z-dRdS�Z.z4e/dD�Z0e/dT�Z1e/dU�Z2e/dV�Z3e/dW�Z4e/dX�Z5Wn.e6k
�r`dZ0dZ1dZ2dZ3dZ4dZ5YnXdZ7e7�rtddl8Z8e9dYk�r�e$ej:dZd[�e_:e$ej;d[dZ�e_;dS)`z� codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N)�*z%Failed to load the builtin codecs: %s�register�lookup�open�EncodedFile�BOM�BOM_BE�BOM_LE�BOM32_BE�BOM32_LE�BOM64_BE�BOM64_LE�BOM_UTF8�	BOM_UTF16�BOM_UTF16_LE�BOM_UTF16_BE�	BOM_UTF32�BOM_UTF32_LE�BOM_UTF32_BE�	CodecInfo�Codec�IncrementalEncoder�IncrementalDecoder�StreamReader�StreamWriter�StreamReaderWriter�
StreamRecoder�
getencoder�
getdecoder�getincrementalencoder�getincrementaldecoder�	getreader�	getwriter�encode�decode�
iterencode�
iterdecode�
strict_errors�
ignore_errors�replace_errors�xmlcharrefreplace_errors�backslashreplace_errors�namereplace_errors�register_error�lookup_errorss��s��s��s���littlec@s,eZdZdZdZd	dd�dd�Zdd�ZdS)
rz0Codec details when looking up the codec registryTN)�_is_text_encodingc
CsPt�|||||f�}	||	_||	_||	_||	_||	_||	_||	_|dk	rL||	_	|	S�N)
�tuple�__new__�namer#r$�incrementalencoder�incrementaldecoder�streamwriter�streamreaderr0)
�clsr#r$r8r7r5r6r4r0�self�r;�/usr/lib64/python3.8/codecs.pyr3^szCodecInfo.__new__cCsd|jj|jj|jt|�fS)Nz%<%s.%s object for encoding %s at %#x>)�	__class__�
__module__�__qualname__r4�id�r:r;r;r<�__repr__ms��zCodecInfo.__repr__)NNNNN)�__name__r>r?�__doc__r0r3rBr;r;r;r<rSs��c@s$eZdZdZddd�Zd	dd�ZdS)
ra9 Defines the interface for stateless encoders/decoders.

        The .encode()/.decode() methods may use different error
        handling schemes by providing the errors argument. These
        string values are predefined:

         'strict' - raise a ValueError error (or a subclass)
         'ignore' - ignore the character and continue with the next
         'replace' - replace with a suitable replacement character;
                    Python will use the official U+FFFD REPLACEMENT
                    CHARACTER for the builtin Unicode codecs on
                    decoding and '?' on encoding.
         'surrogateescape' - replace with private code points U+DCnn.
         'xmlcharrefreplace' - Replace with the appropriate XML
                               character reference (only for encoding).
         'backslashreplace'  - Replace with backslashed escape sequences.
         'namereplace'       - Replace with \N{...} escape sequences
                               (only for encoding).

        The set of allowed values can be extended via register_error.

    �strictcCst�dS)a# Encodes the object input and returns a tuple (output
            object, length consumed).

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamWriter for codecs which have to keep state in order to
            make encoding efficient.

            The encoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        N��NotImplementedError�r:�input�errorsr;r;r<r#�szCodec.encodecCst�dS)a� Decodes the object input and returns a tuple (output
            object, length consumed).

            input must be an object which provides the bf_getreadbuf
            buffer slot. Python strings, buffer objects and memory
            mapped files are examples of objects providing this slot.

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamReader for codecs which have to keep state in order to
            make decoding efficient.

            The decoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        NrFrHr;r;r<r$�szCodec.decodeN)rE)rE)rCr>r?rDr#r$r;r;r;r<rrs
c@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalEncoder encodes an input in multiple steps. The input can
    be passed piece by piece to the encode() method. The IncrementalEncoder
    remembers the state of the encoding process between calls to encode().
    rEcCs||_d|_dS)z�
        Creates an IncrementalEncoder instance.

        The IncrementalEncoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        �N)rJ�buffer�r:rJr;r;r<�__init__�szIncrementalEncoder.__init__FcCst�dS)zA
        Encodes input and returns the resulting object.
        NrF�r:rI�finalr;r;r<r#�szIncrementalEncoder.encodecCsdS)z:
        Resets the encoder to the initial state.
        Nr;rAr;r;r<�reset�szIncrementalEncoder.resetcCsdS)z:
        Return the current state of the encoder.
        rr;rAr;r;r<�getstate�szIncrementalEncoder.getstatecCsdS)zl
        Set the current state of the encoder. state must have been
        returned by getstate().
        Nr;�r:�stater;r;r<�setstate�szIncrementalEncoder.setstateN)rE)F)	rCr>r?rDrNr#rQrRrUr;r;r;r<r�s

c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalEncoderz�
    This subclass of IncrementalEncoder can be used as the baseclass for an
    incremental encoder if the encoder must keep some of the output in a
    buffer between calls to encode().
    rEcCst�||�d|_dS�NrK)rrNrLrMr;r;r<rN�sz#BufferedIncrementalEncoder.__init__cCst�dSr1rF�r:rIrJrPr;r;r<�_buffer_encode�sz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrYrJ�r:rIrP�data�result�consumedr;r;r<r#�s
z!BufferedIncrementalEncoder.encodecCst�|�d|_dSrW)rrQrLrAr;r;r<rQ�s
z BufferedIncrementalEncoder.resetcCs
|jpdS�Nr�rLrAr;r;r<rR�sz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrWr_rSr;r;r<rU�sz#BufferedIncrementalEncoder.setstateN)rE)F)
rCr>r?rDrNrYr#rQrRrUr;r;r;r<rV�s

rVc@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalDecoder decodes an input in multiple steps. The input can
    be passed piece by piece to the decode() method. The IncrementalDecoder
    remembers the state of the decoding process between calls to decode().
    rEcCs
||_dS)z�
        Create an IncrementalDecoder instance.

        The IncrementalDecoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        N)rJrMr;r;r<rNszIncrementalDecoder.__init__FcCst�dS)z@
        Decode input and returns the resulting object.
        NrFrOr;r;r<r$szIncrementalDecoder.decodecCsdS)z9
        Reset the decoder to the initial state.
        Nr;rAr;r;r<rQszIncrementalDecoder.resetcCsdS)a	
        Return the current state of the decoder.

        This must be a (buffered_input, additional_state_info) tuple.
        buffered_input must be a bytes object containing bytes that
        were passed to decode() that have not yet been converted.
        additional_state_info must be a non-negative integer
        representing the state of the decoder WITHOUT yet having
        processed the contents of buffered_input.  In the initial state
        and after reset(), getstate() must return (b"", 0).
        )�rr;rAr;r;r<rRszIncrementalDecoder.getstatecCsdS)z�
        Set the current state of the decoder.

        state must have been returned by getstate().  The effect of
        setstate((b"", 0)) must be equivalent to reset().
        Nr;rSr;r;r<rU'szIncrementalDecoder.setstateN)rE)F)	rCr>r?rDrNr$rQrRrUr;r;r;r<r�s


c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalDecoderz�
    This subclass of IncrementalDecoder can be used as the baseclass for an
    incremental decoder if the decoder must be able to handle incomplete
    byte sequences.
    rEcCst�||�d|_dS�Nr`)rrNrLrMr;r;r<rN5sz#BufferedIncrementalDecoder.__init__cCst�dSr1rFrXr;r;r<�_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrcrJrZr;r;r<r$?s
z!BufferedIncrementalDecoder.decodecCst�|�d|_dSrb)rrQrLrAr;r;r<rQGs
z BufferedIncrementalDecoder.resetcCs
|jdfSr^r_rAr;r;r<rRKsz#BufferedIncrementalDecoder.getstatecCs|d|_dSr^r_rSr;r;r<rUOsz#BufferedIncrementalDecoder.setstateN)rE)F)
rCr>r?rDrNrcr$rQrRrUr;r;r;r<ra/s

rac@sTeZdZddd�Zdd�Zdd�Zdd	�Zddd�Zefd
d�Z	dd�Z
dd�ZdS)rrEcCs||_||_dS)aw Creates a StreamWriter instance.

            stream must be a file-like object open for writing.

            The StreamWriter may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'xmlcharrefreplace' - Replace with the appropriate XML
                                   character reference.
             'backslashreplace'  - Replace with backslashed escape
                                   sequences.
             'namereplace'       - Replace with \N{...} escape sequences.

            The set of allowed parameter values can be extended via
            register_error.
        N)�streamrJ�r:rdrJr;r;r<rN\szStreamWriter.__init__cCs"|�||j�\}}|j�|�dS)z> Writes the object's contents encoded to self.stream.
        N)r#rJrd�write)r:�objectr[r]r;r;r<rfuszStreamWriter.writecCs|�d�|��dS)z[ Writes the concatenated list of strings to the stream
            using .write().
        rKN)rf�join�r:�listr;r;r<�
writelines|szStreamWriter.writelinescCsdS)a5 Flushes and resets the codec buffers used for keeping state.

            Calling this method should ensure that the data on the
            output is put into a clean state, that allows appending
            of new fresh data without having to rescan the whole
            stream to recover state.

        Nr;rAr;r;r<rQ�s
zStreamWriter.resetrcCs*|j�||�|dkr&|dkr&|��dSr^�rd�seekrQ�r:�offset�whencer;r;r<rm�szStreamWriter.seekcCs||j|�S�z? Inherit all other methods from the underlying stream.
        �rd�r:r4�getattrr;r;r<�__getattr__�szStreamWriter.__getattr__cCs|Sr1r;rAr;r;r<�	__enter__�szStreamWriter.__enter__cCs|j��dSr1�rd�close�r:�type�value�tbr;r;r<�__exit__�szStreamWriter.__exit__N)rE)r)rCr>r?rNrfrkrQrmrtrurvr}r;r;r;r<rZs

�
c@s�eZdZeZddd�Zd dd�Zd!dd	�Zd"dd
�Zd#dd�Z	dd�Z
d$dd�Zdd�Zdd�Z
efdd�Zdd�Zdd�Zd
S)%rrEcCs.||_||_d|_|��|_|j|_d|_dS)a� Creates a StreamReader instance.

            stream must be a file-like object open for reading.

            The StreamReader may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'backslashreplace' - Replace with backslashed escape sequences;

            The set of allowed parameter values can be extended via
            register_error.
        r`N)rdrJ�
bytebuffer�charbuffertype�_empty_charbuffer�
charbuffer�
linebufferrer;r;r<rN�s
zStreamReader.__init__cCst�dSr1rFrHr;r;r<r$�szStreamReader.decode���Fc
CsN|jr|j�|j�|_d|_|dkr(|}|dkrBt|j�|krB�q|dkrV|j��}n|j�|�}|j|}|st�qz|�||j	�\}}Wn`t
k
r�}zB|r�|�|d|j�|j	�\}}|jdd�}	t|	�dkrڂn�W5d}~XYnX||d�|_|j|7_|s(�qq(|dk�r,|j}
|j|_n|jd|�}
|j|d�|_|
S)a� Decodes data from the stream self.stream and returns the
            resulting object.

            chars indicates the number of decoded code points or bytes to
            return. read() will never return more data than requested,
            but it might return less, if there is not enough available.

            size indicates the approximate maximum number of decoded
            bytes or code points to read for decoding. The decoder
            can modify this setting as appropriate. The default value
            -1 indicates to read and decode as much as possible.  size
            is intended to prevent having to decode huge files in one
            step.

            If firstline is true, and a UnicodeDecodeError happens
            after the first line terminator in the input only the first line
            will be returned, the rest of the input will be kept until the
            next call to read().

            The method should use a greedy read strategy, meaning that
            it should read as much data as is allowed within the
            definition of the encoding and the given size, e.g.  if
            optional encoding endings or state markers are available
            on the stream, these should be read too.
        NrT��keepends�)
r�r�rhr��lenrd�readr~r$rJ�UnicodeDecodeError�start�
splitlines)r:�size�chars�	firstline�newdatar[�newchars�decodedbytes�exc�linesr\r;r;r<r��sD
�

zStreamReader.readNTc	Cs�|jrP|jd}|jd=t|j�dkr8|jd|_d|_|sL|jdd�d}|S|pVd}|j}|j|dd�}|r�t|t�r�|�d	�s�t|t	�r�|�d
�r�||jddd�7}||7}|jdd�}|�r�t|�dk�r8|d}|d=t|�dk�r|d|j7<||_d|_n|d|j|_|�s�|jdd�d}�q�|d}|djdd�d}||k�r�|j�
|dd��|j|_|�r�|}n|}�q�|�r�|dk	�r�|�r�|�s�|jdd�d}�q�|d
kr^|d9}q^|S)z� Read one line from the input stream and return the
            decoded data.

            size, if given, is passed as size argument to the
            read() method.

        rr�NFr��HT)r��
�
)r�r�r�i@�)r�r�r�r�r�r��
isinstance�str�endswith�bytesrh)	r:r�r��line�readsizer[r��line0withend�line0withoutendr;r;r<�readlinesd
��
�
zStreamReader.readlinecCs|��}|�|�S)aS Read all lines available on the input stream
            and return them as a list.

            Line breaks are implemented using the codec's decoder
            method and are included in the list entries.

            sizehint, if given, is ignored since there is no efficient
            way to finding the true end-of-line.

        )r�r�)r:�sizehintr�r[r;r;r<�	readlines^szStreamReader.readlinescCsd|_|j|_d|_dS)z� Resets the codec buffers used for keeping state.

            Note that no stream repositioning should take place.
            This method is primarily intended to be able to recover
            from decoding errors.

        r`N)r~r�r�r�rAr;r;r<rQms	zStreamReader.resetrcCs|j�||�|��dS)zp Set the input stream's current position.

            Resets the codec buffers used for keeping state.
        Nrlrnr;r;r<rmzszStreamReader.seekcCs|��}|r|St�dS)�4 Return the next decoded line from the input stream.N)r��
StopIteration)r:r�r;r;r<�__next__�szStreamReader.__next__cCs|Sr1r;rAr;r;r<�__iter__�szStreamReader.__iter__cCs||j|�Srqrrrsr;r;r<ru�szStreamReader.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReader.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReader.__exit__)rE)rE)r�r�F)NT)NT)r)rCr>r?r�rrNr$r�r�r�rQrmr�r�rtrurvr}r;r;r;r<r�s


P
K

�
c@s�eZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d%dd�Zefdd�Zdd�Zdd �Zd	S)&ra StreamReaderWriter instances allow wrapping streams which
        work in both read and write modes.

        The design is such that one can use the factory functions
        returned by the codec.lookup() function to construct the
        instance.

    �unknownrEcCs(||_|||�|_|||�|_||_dS)aR Creates a StreamReaderWriter instance.

            stream must be a Stream-like object.

            Reader, Writer must be factory functions or classes
            providing the StreamReader, StreamWriter interface resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rd�reader�writerrJ)r:rd�Reader�WriterrJr;r;r<rN�s
zStreamReaderWriter.__init__r�cCs|j�|�Sr1)r�r��r:r�r;r;r<r��szStreamReaderWriter.readNcCs|j�|�Sr1)r�r�r�r;r;r<r��szStreamReaderWriter.readlinecCs|j�|�Sr1)r�r�)r:r�r;r;r<r��szStreamReaderWriter.readlinescCs
t|j�S�r�)�nextr�rAr;r;r<r��szStreamReaderWriter.__next__cCs|Sr1r;rAr;r;r<r��szStreamReaderWriter.__iter__cCs|j�|�Sr1)r�rf)r:r[r;r;r<rf�szStreamReaderWriter.writecCs|j�|�Sr1)r�rkrir;r;r<rk�szStreamReaderWriter.writelinescCs|j��|j��dSr1�r�rQr�rAr;r;r<rQ�s
zStreamReaderWriter.resetrcCs6|j�||�|j��|dkr2|dkr2|j��dSr^)rdrmr�rQr�rnr;r;r<rm�s
zStreamReaderWriter.seekcCs||j|�Srqrrrsr;r;r<ru�szStreamReaderWriter.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReaderWriter.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReaderWriter.__exit__)rE)r�)N)N)r)rCr>r?rD�encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s 	




�
	c@s�eZdZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd%dd�Zefdd�Zdd�Zdd �Zd	S)&raB StreamRecoder instances translate data from one encoding to another.

        They use the complete set of APIs returned by the
        codecs.lookup() function to implement their task.

        Data written to the StreamRecoder is first decoded into an
        intermediate format (depending on the "decode" codec) and then
        written to the underlying stream using an instance of the provided
        Writer class.

        In the other direction, data is read from the underlying stream using
        a Reader instance and then encoded and returned to the caller.

    r�rEcCs4||_||_||_|||�|_|||�|_||_dS)a� Creates a StreamRecoder instance which implements a two-way
            conversion: encode and decode work on the frontend (the
            data visible to .read() and .write()) while Reader and Writer
            work on the backend (the data in stream).

            You can use these objects to do transparent
            transcodings from e.g. latin-1 to utf-8 and back.

            stream must be a file-like object.

            encode and decode must adhere to the Codec interface; Reader and
            Writer must be factory functions or classes providing the
            StreamReader and StreamWriter interfaces resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rdr#r$r�r�rJ)r:rdr#r$r�r�rJr;r;r<rNszStreamRecoder.__init__r�cCs"|j�|�}|�||j�\}}|Sr1)r�r�r#rJ�r:r�r[�bytesencodedr;r;r<r�#szStreamRecoder.readNcCs6|dkr|j��}n|j�|�}|�||j�\}}|Sr1)r�r�r#rJr�r;r;r<r�)s
zStreamRecoder.readlinecCs(|j��}|�||j�\}}|jdd�S)NTr�)r�r�r#rJr�)r:r�r[r�r;r;r<r�2s
zStreamRecoder.readlinescCs t|j�}|�||j�\}}|Sr�)r�r�r#rJ)r:r[r�r;r;r<r�8s
zStreamRecoder.__next__cCs|Sr1r;rAr;r;r<r�?szStreamRecoder.__iter__cCs|�||j�\}}|j�|�Sr1)r$rJr�rf)r:r[�bytesdecodedr;r;r<rfBszStreamRecoder.writecCs(d�|�}|�||j�\}}|j�|�Srb)rhr$rJr�rf)r:rjr[r�r;r;r<rkGs
zStreamRecoder.writelinescCs|j��|j��dSr1r�rAr;r;r<rQMs
zStreamRecoder.resetrcCs |j�||�|j�||�dSr1)r�rmr�rnr;r;r<rmRszStreamRecoder.seekcCs||j|�Srqrrrsr;r;r<ruXszStreamRecoder.__getattr__cCs|Sr1r;rAr;r;r<rv_szStreamRecoder.__enter__cCs|j��dSr1rwryr;r;r<r}bszStreamRecoder.__exit__)rE)r�)N)N)r)rCr>r?rD�
data_encoding�
file_encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s$�


	

�
�rrEr�cCst|dk	rd|kr|d}t�|||�}|dkr2|Sz&t|�}t||j|j|�}||_|WS|���YnXdS)aq Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually be
        Unicode as well.

        Underlying encoded files are always opened in binary mode.
        The default file mode is 'r', meaning to open the file in read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to -1 which means that the default buffer size will
        be used.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    N�b)�builtinsrrrr8r7r�rx)�filename�moder�rJ�	buffering�file�info�srwr;r;r<rgs�cCsF|dkr|}t|�}t|�}t||j|j|j|j|�}||_||_|S)a� Return a wrapped version of file which provides transparent
        encoding translation.

        Data written to the wrapped file is decoded according
        to the given data_encoding and then encoded to the underlying
        file using file_encoding. The intermediate data type
        will usually be Unicode but depends on the specified codecs.

        Bytes read from the file are decoded using file_encoding and then
        passed back to the caller encoded using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    N)rrr#r$r8r7r�r�)r�r�r�rJ�	data_info�	file_info�srr;r;r<r�s�cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr#�r�r;r;r<r�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr$r�r;r;r<r�scCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalEncoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental encoder.

    N)rr5�LookupError)r��encoderr;r;r<r�s	
cCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalDecoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental decoder.

    N)rr6r�)r��decoderr;r;r<r �s	
cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr8r�r;r;r<r!�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr7r�r;r;r<r"�scksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Encoding iterator.

    Encodes the input strings from the iterator using an IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
    rKTN)rr#)�iteratorr�rJ�kwargsr�rI�outputr;r;r<r%s	
cksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Decoding iterator.

    Decodes the input strings from the iterator using an IncrementalDecoder.

    errors and kwargs are passed through to the IncrementalDecoder
    constructor.
    r`TN)r r$)r�r�rJr�r�rIr�r;r;r<r&s	
cCsdd�|D�S)z� make_identity_dict(rng) -> dict

        Return a dictionary where elements of the rng sequence are
        mapped to themselves.

    cSsi|]
}||�qSr;r;)�.0�ir;r;r<�
<dictcomp>/sz&make_identity_dict.<locals>.<dictcomp>r;)�rngr;r;r<�make_identity_dict'sr�cCs4i}|��D]"\}}||kr&|||<qd||<q|S)a� Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \u001a.

    N)�items)�decoding_map�m�k�vr;r;r<�make_encoding_map1s


r��ignore�replace�xmlcharrefreplace�backslashreplace�namereplace�__main__zlatin-1zutf-8)r�NrEr�)NrE)rE)rE)<rDr��sys�_codecs�ImportErrorZwhy�SystemError�__all__rr	rrrrr�	byteorderrrrrr
r
rr2rrrgrrVrrarrrrrrrrrr r!r"r%r&r�r�r.r'r(r)r*r+r,r��_falseZ	encodingsrC�stdout�stdinr;r;r;r<�<module>s�	�
B("1+IzWt
0
&








imaplib.cpython-38.opt-2.pyc000064400000065060151450073350011563 0ustar00U

e5df��*@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
m
Z
mZmZddl
mZzddlZdZWnek
r�dZYnXddd	d
ddgZd
ZdZdZdZdZdZdddddddddddddddddddddddddddddddddddddddddd�)Ze�d�Ze�d�Ze�d�Ze�dej�Ze�d�Z e�d�Z!e�d�Z"e�dej�Z#dZ$dZ%Gd d�d�Z&e�r�Gd!d"�d"e&�Z'e�(d"�Gd#d�de&�Z)Gd$d%�d%�Z*d&�+d'�Z,d(d)�e-e,d*d��D�Z.d+d	�Z/d,d
�Z0d-d�Z1d.d�Z2e3d/k�r�ddl4Z4ddl5Z5ze4�4ej6d*d�d0�\Z7Z8Wn.e4j9k
�rlZ:zd1\Z7Z8W5dZ:[:XYnXdZ;e7D]8\Z<Z:e<d2k�r�e=e:�Zne<d3k�rve:Z;e8�sve;fZ8�qve8�s�d4Z8e8dZ>e5�?�Z@e5�5d5e@e>�p�d6f�ZAd7e@d8d9�ZBd:e@eAffd;d<d=d>d?ddeBffd@dAdBdCdDdEdFdGdHfZCdIdJdKdLd>dddeBffdGdMfZDdNdO�ZE�ze;�r^e)e;�ZFne&e>�ZFeFjGdPk�r~eCd*d�ZCeF�HdQeFjI�eF�HdReFjJf�eCD]\ZKZ8eEeKe8��q�eEdSdT�D]<ZLe�MdUeL�ZNeN�r�eN�Od*�ZPneL�+�dVZPeEdWePf��q�eDD]T\ZKZ8eEeKe8�ZQeKe8fdKk�r*�qeQdV�+�ZReR�s@�qeEdXdYdZeRdVd[f��qeSd\�Wn.eSd]�e�s�eSd^ej6d��YnXdS)_z2.58�N)�datetime�timezone�	timedelta)�DEFAULT_BUFFER_SIZETF�IMAP4�IMAP4_stream�Internaldate2tuple�Int2AP�
ParseFlags�Time2Internaldate�
�i�)Z	IMAP4REV1ri@B)�AUTH�SELECTED)�NONAUTH)rrr�LOGOUT)r)r))�APPEND�AUTHENTICATE�
CAPABILITY�CHECK�CLOSE�COPY�CREATE�DELETE�	DELETEACL�ENABLE�EXAMINE�EXPUNGE�FETCH�GETACL�
GETANNOTATION�GETQUOTA�GETQUOTAROOT�MYRIGHTS�LIST�LOGINr�LSUBZMOVE�	NAMESPACE�NOOP�PARTIAL�	PROXYAUTH�RENAME�SEARCH�SELECT�SETACL�
SETANNOTATION�SETQUOTA�SORT�STARTTLS�STATUS�STORE�	SUBSCRIBE�THREAD�UID�UNSUBSCRIBEs\+( (?P<data>.*))?s.*FLAGS \((?P<flags>[^\)]*)\)s�.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])"s.*{(?P<size>\d+)}$s
\r\n|\r|\ns%\[(?P<type>[A-Z-]+)( (?P<data>.*))?\]s$\* (?P<type>[A-Z-]+)( (?P<data>.*))?s3\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?c@s�eZdZGdd�de�ZGdd�de�ZGdd�de�Zdefdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdefdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'd�dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dRdS�Z,d�dTdU�Z-dVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4d�dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9d�dqdr�Z:dsdt�Z;dudv�Z<dwdx�Z=dydz�Z>d{d|�Z?d}d~�Z@dd��ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNdpS)�rc@seZdZdS)zIMAP4.errorN��__name__�
__module__�__qualname__�r=r=�/usr/lib64/python3.8/imaplib.py�error�sr?c@seZdZdS)zIMAP4.abortNr9r=r=r=r>�abort�sr@c@seZdZdS)zIMAP4.readonlyNr9r=r=r=r>�readonly�srA�cCs�t|_d|_d|_i|_i|_d|_d|_d|_d|_	|�
�|�||�z|��Wn8t
k
r�z|��Wntk
r�YnX�YnXdS)NrrBFr)�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�is_readonly�tagnum�_tls_established�_mode_ascii�open�_connect�	Exception�shutdown�OSError��self�host�portr=r=r>�__init__�s&zIMAP4.__init__cCs0d|_d|_t�ttj�|_t�ttj�|_dS)NF�ascii)	�utf8_enabled�	_encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rTr=r=r>rM�szIMAP4._mode_asciicCs(d|_d|_t�t�|_t�t�|_dS)NT�utf-8)rYrZr[r\r]r_r`rarbr=r=r>�
_mode_utf8�szIMAP4._mode_utf8cCs�tt�dd��|_t�d|jdtj�|_|�	�|_
d|jkrHd|_nd|jkrZd|_n|�
|j
��|��tD]}||jkr�qr||_dS|�
d	��dS)
Nii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)ZPREAUTHr�OKrzserver not IMAP4 compliant)r	�randomZrandint�tagprer[r\r^�tagre�__version__�
_get_responseZwelcomerHrEr?�_get_capabilities�AllowedVersions�capabilities�PROTOCOL_VERSION)rT�versionr=r=r>rO�s*���



zIMAP4._connectcCs&|tkrt||���Std|��dS)NzUnknown IMAP4 command: '%s')�Commands�getattr�lower�AttributeError)rT�attrr=r=r>�__getattr__	szIMAP4.__getattr__cCs|S�Nr=rbr=r=r>�	__enter__szIMAP4.__enter__cGs4|jdkrdSz|��Wntk
r.YnXdS�Nr)rE�logoutrR)rT�argsr=r=r>�__exit__s
zIMAP4.__exit__cCs4|js
dn|j}t�d||j|j�t�||jf�S)Nzimaplib.open)rU�sys�auditrV�socketZcreate_connection)rTrUr=r=r>�_create_socketszIMAP4._create_socketcCs(||_||_|��|_|j�d�|_dS)N�rb)rUrVr�sock�makefile�filerSr=r=r>rN's
z
IMAP4.opencCs|j�|�Srv)r��read�rT�sizer=r=r>r�3sz
IMAP4.readcCs.|j�td�}t|�tkr*|�dt��|S)N�zgot more than %d bytes)r��readline�_MAXLINE�lenr?�rT�liner=r=r>r�8szIMAP4.readlinecCst�d||�|j�|�dS)Nzimaplib.send)r|r}r�Zsendall�rT�datar=r=r>�send@sz
IMAP4.sendc
Cst|j��zXz|j�tj�Wn@tk
r^}z"|jtjkrNt	|dd�dkrN�W5d}~XYnXW5|j��XdS)NZwinerrorri&')
r��closer�rQr~Z	SHUT_RDWRrR�errnoZENOTCONNrq)rT�excr=r=r>rQFs
�zIMAP4.shutdowncCs|jSrv)r�rbr=r=r>r~VszIMAP4.socketcCsBd}|�ddg|�\}}|dr(||fS|��\}}|�|||�S)NZRECENTre���)�_untagged_response�noop�rT�name�typ�datr=r=r>�recentbs	zIMAP4.recentcCs|�|dg|���Srv)r��upper)rT�coder=r=r>�responsesszIMAP4.responsecCsxd}|sd}|r.|d|dfdkr2d|}nd}|r@t|�}nd}t�t|�}|jrbd|d}||_|�||||�S)	Nr�INBOXrr���(�)�(%s)sUTF8 (�))r�MapCRLF�sub�CRLFrYrF�_simple_command)rT�mailbox�flags�	date_time�messager�rFr=r=r>�append�s

zIMAP4.appendcCsP|��}t|�j|_|�d|�\}}|dkrB|�|d�dd���d|_||fS)Nrrer�rc�replacer)r��_Authenticator�processrFr�r?�decoderE)rTZ	mechanismZ
authobject�mechr�r�r=r=r>�authenticate�szIMAP4.authenticatecCs d}|�|�\}}|�|||�S)Nr�r�r�r�r=r=r>�
capability�szIMAP4.capabilitycCs
|�d�S)Nr�r�rbr=r=r>�check�szIMAP4.checkcCs$z|�d�\}}W5d|_X||fS)Nrr)rEr��rTr�r�r=r=r>r��szIMAP4.closecCs|�d||�S)Nrr�)rT�message_setZnew_mailboxr=r=r>�copy�sz
IMAP4.copycCs|�d|�S)Nrr��rTr�r=r=r>�create�szIMAP4.createcCs|�d|�S)Nrr�r�r=r=r>�delete�szIMAP4.deletecCs|�d||�S)Nrr�)rTr��whor=r=r>�	deleteacl�szIMAP4.deleteaclcCsHd|jkrt�d��|�d|�\}}|dkr@d|��kr@|��||fS)NrzServer does not support ENABLErezUTF8=ACCEPT)rmrr?r�r�rd)rTr�r�r�r=r=r>�enable�s

zIMAP4.enablecCs d}|�|�\}}|�|||�S)Nrr�r�r=r=r>�expunges	z
IMAP4.expungecCs$d}|�|||�\}}|�|||�S)Nrr�)rTr�Z
message_partsr�r�r�r=r=r>�fetchs
zIMAP4.fetchcCs|�d|�\}}|�||d�S)NrZACLr��rTr�r�r�r=r=r>�getaclszIMAP4.getaclcCs"|�d|||�\}}|�||d�S)Nr �
ANNOTATIONr�)rTr��entryZ	attributer�r�r=r=r>�
getannotation(szIMAP4.getannotationcCs|�d|�\}}|�||d�S)Nr!�QUOTAr�)rT�rootr�r�r=r=r>�getquota0szIMAP4.getquotacCs@|�d|�\}}|�||d�\}}|�||d�\}}|||gfS)Nr"r�Z	QUOTAROOTr�)rTr�r�r�ZquotaZ	quotarootr=r=r>�getquotaroot;szIMAP4.getquotaroot�""�*cCs$d}|�|||�\}}|�|||�S)Nr$r��rTZ	directory�patternr�r�r�r=r=r>�listFsz
IMAP4.listcCs<|�d||�|��\}}|dkr.|�|d��d|_||fS)Nr%rer�r)r��_quoter?rE)rT�user�passwordr�r�r=r=r>�loginRs
zIMAP4.logincCs|||_|_|�d|j�S)NzCRAM-MD5)r�r�r��_CRAM_MD5_AUTH)rTr�r�r=r=r>�login_cram_md5`szIMAP4.login_cram_md5cCsBddl}t|jt�r |j�d�n|j}|jd|�||d���S)Nrrc� Zmd5)�hmac�
isinstancer��str�encoder�ZHMACZ	hexdigest)rTZ	challenger��pwdr=r=r>r�is
�zIMAP4._CRAM_MD5_AUTHcCs$d|_|�d�\}}|��||fSrx)rEr�rQr�r=r=r>ryqszIMAP4.logoutcCs$d}|�|||�\}}|�|||�S)Nr&r�r�r=r=r>�lsub~sz
IMAP4.lsubcCs|�d|�\}}|�||d�S)Nr#r�r�r=r=r>�myrights�szIMAP4.myrightscCs d}|�|�\}}|�|||�S)Nr'r�r�r=r=r>�	namespace�szIMAP4.namespacecCs
|�d�S)Nr(r�rbr=r=r>r��sz
IMAP4.noopcCs(d}|�|||||�\}}|�||d�S)Nr)rr�)rTZmessage_numZmessage_part�startZlengthr�r�r�r=r=r>�partial�sz
IMAP4.partialcCsd}|�d|�S)Nr*r�)rTr�r�r=r=r>�	proxyauth�s	zIMAP4.proxyauthcCs|�d||�S)Nr+r�)rTZ
oldmailboxZ
newmailboxr=r=r>�rename�szIMAP4.renamecGsTd}|r2|jrt�d��|j|d|f|��\}}n|j|f|��\}}|�|||�S)Nr,z'Non-None charset not valid in UTF8 mode�CHARSET)rYrr?r�r�)rT�charsetZcriteriar�r�r�r=r=r>�search�s
zIMAP4.searchr�FcCsvi|_||_|rd}nd}|�||�\}}|dkr@d|_||fSd|_d|jkrb|sb|�d|��||j�ddg�fS)	Nrr-rerr�	READ-ONLYz%s is not writable�EXISTS)rHrJr�rErA�get)rTr�rAr�r�r�r=r=r>�select�s
�zIMAP4.selectcCs|�d|||�S)Nr.r�)rTr�r�Zwhatr=r=r>�setacl�szIMAP4.setaclcGs |jd|��\}}|�||d�S)Nr/r�)r/r�)rTrzr�r�r=r=r>�
setannotationszIMAP4.setannotationcCs |�d||�\}}|�||d�S)Nr0r�r�)rTr�Zlimitsr�r�r=r=r>�setquota	szIMAP4.setquotacGsFd}|d|dfdkr d|}|j|||f|��\}}|�|||�S)Nr1rr�r�r�r�)rTZ
sort_criteriar��search_criteriar�r�r�r=r=r>�sorts
z
IMAP4.sortNcCs�d}ts|�d��|jr"|�d��||jkr6|�d��|dkrFt��}|�|�\}}|dkr�|j|j	|j
d�|_	|j	�d�|_d|_|�
�n
|�d	��|�|||�S)
Nr2zSSL support missingzTLS session already establishedzTLS not supported by serverre�Zserver_hostnamer�TzCouldn't establish TLS session)�HAVE_SSLr?rLr@rm�ssl�_create_stdlib_contextr��wrap_socketr�rUr�r�rkr�)rT�ssl_contextr�r�r�r=r=r>�starttls s&



�

zIMAP4.starttlscCs$d}|�|||�\}}|�|||�S)Nr3r�)rTr��namesr�r�r�r=r=r>�status7szIMAP4.statuscCs>|d|dfdkrd|}|�d|||�\}}|�||d�S)Nrr�r�r�r4rr�)rTr��commandr�r�r�r=r=r>�storeCszIMAP4.storecCs|�d|�S)Nr5r�r�r=r=r>�	subscribeNszIMAP4.subscribecGs*d}|j|||f|��\}}|�|||�S)Nr6r�)rTZthreading_algorithmr�r�r�r�r�r=r=r>�threadVszIMAP4.threadc	Gs�|��}|tkr|�d|��|jt|krL|�d||jd�t|�f��d}|j||f|��\}}|dkrt|}nd}|�|||�S)NzUnknown IMAP4 UID command: %s�9command %s illegal in state %s, only allowed in states %s�, r7)r,r1r6r)r�rpr?rE�joinr�r�)rTr�rzr�r�r�r=r=r>�uid`s��z	IMAP4.uidcCs|�d|�S)Nr8r�r�r=r=r>�unsubscribeyszIMAP4.unsubscribecGs,|��}|tkr|jft|<|j|f|��Srv)r�rprEr��rTr�rzr=r=r>�xatom�s
zIMAP4.xatomcCs8|dkrd}|j}||kr*||�|�n
|g||<dS�N�)rHr�r�)rTr�r�Zurr=r=r>�_append_untagged�szIMAP4._append_untaggedcCs,|j�d�}|r(|�|d�|jd���dS)N�BYEr�r�)rHr�r@r�rZ)rT�byer=r=r>�
_check_bye�szIMAP4._check_byec

Gs�|jt|kr4d|_|�d||jd�t|�f��dD]}||jkr8|j|=q8d|jkrj|jsj|�d��|��}t	||j
�}|d|}|D]0}|dkr�q�t|t�r�t	||j
�}|d|}q�|j}|dk	�r
d|_t
|�t
|j�kr�|}nd}|t	dt|�|j
�}z|�|t�Wn2tk
�rN}	z|�d|	��W5d}	~	XYnX|dk�r^|S|���r||j|�r^|S�q^|�r�||j�}z|�|�|�t�Wn2tk
�r�}	z|�d|	��W5d}	~	XYnX|�s^�q�q^|S)	Nr�r��re�NO�BADr�z#mailbox status changed to READ-ONLY� z {%s}zsocket error: %s)rErprFr?r�rHrJrA�_new_tag�bytesrZr�r��type�_commandr�r�r�rRr@rjrGrI)
rTr�rzr��tagr��argrFZ	literator�valr=r=r>r�sb��


�


 



 zIMAP4._commandc
Cs�|dk}|s|��z|j||d�\}}Wnj|jk
r`}z|�d||f��W5d}~XYn6|jk
r�}z|�d||f��W5d}~XYnX|s�|��|dkr�|�d|||f��||fS)Nr)�
expect_byezcommand: %s => %srz%s command error: %s %s)r�_get_tagged_responser@r?)rTr�rryr�r�rr=r=r>�_command_complete�s"$zIMAP4._command_completecCsJ|��\}}|dgkr |�d��t|d|j�}|��}t|���|_dS)Nz"no CAPABILITY response from serverr�)r�r?r�rZr��tuple�splitrmr�r=r=r>rk
s

zIMAP4._get_capabilitiescCs�|��}|�|j|�rp|j�d�}||jkr:|�d|��|j�d�}t||j�}|j�d�}||gf|j|<n�d}|�t	|�s�|�|j
|�r�|j�d�}|jdkr�|�t|�r�|j�d�|_dS|�d|��|j�d�}t||j�}|j�d�}|dk�rd}|�r|d|}|�|j
|��rZt|j�d	��}|�|�}|�|||f�|��}�q|�||�|d
k�r�|�t|��r�|j�d�}t||j�}|�||j�d��|S)Nrzunexpected tagged response: %rrr�Zdata2zunexpected response: %rrrr�r	)�	_get_line�_matchrh�mo�grouprGr@r�rZ�Untagged_responsera�ContinuationrIr_�intr�r�
Response_code)rT�resprr�r�Zdat2r�r�r=r=r>rjsH



zIMAP4._get_responsec
Cs�|j|}|dk	r|j|=|S|rDd}|j�|d�}|dk	rD||fS|��z|��Wq|jk
r~}z�W5d}~XYqXqdS)Nr)rGrH�poprrjr@)rTrr�resultr�rrr=r=r>rcs
zIMAP4._get_tagged_responsecCs>|��}|s|�d��|�d�s.|�d|��|dd�}|S)Nzsocket error: EOFrz#socket error: unterminated line: %r���)r�r@�endswithr�r=r=r>r�s

zIMAP4._get_linecCs|�|�|_|jdk	Srv)�matchr)rTZcre�sr=r=r>r�szIMAP4._matchcCs2|jtt|j�|j�}|jd|_d|j|<|S)Nr�)rgrr�rKrZrG)rTrr=r=r>r
�s
zIMAP4._new_tagcCs$|�dd�}|�dd�}d|dS)N�\z\\�"z\")r�)rTrr=r=r>r��szIMAP4._quotecGs|�||j|f|���Srv)rrrr=r=r>r��szIMAP4._simple_commandcCs8|dkr||fS||jkr$|dgfS|j�|�}||fS)Nr
)rHr")rTr�r�r�r�r=r=r>r��s

zIMAP4._untagged_response)r�r�)r�r�)r�F)N)F)Sr:r;r<rPr?r@rA�
IMAP4_PORTrWrMrdrOrurwr{rrNr�r�r�rQr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ryr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrkrjrrrr
r�r�r��_mesgZ_dump_urZ_logZ	print_logr=r=r=r>r�s�.*
		
	



 	

M	P
!$c@s6eZdZdedddfdd�Zdd�Zdefdd�ZdS)	�	IMAP4_SSLrBNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
|||�dS)Nz8ssl_context and keyfile arguments are mutually exclusivez9ssl_context and certfile arguments are mutually exclusiverzEkeyfile and certfile are deprecated, use a custom ssl_context instead�)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningr/r.r�r�r�rrW)rTrUrVr/r.r�r1r=r=r>rW�s$��zIMAP4_SSL.__init__cCst�|�}|jj||jd�S)Nr�)rrr�r�rU)rTr�r=r=r>rs
�zIMAP4_SSL._create_socketcCst�|||�dSrv)rrNrSr=r=r>rNszIMAP4_SSL.open)r:r;r<�IMAP4_SSL_PORTrWrrNr=r=r=r>r,�s�
r,c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rcCs||_t�|�dSrv)r�rrW)rTr�r=r=r>rW/szIMAP4_stream.__init__NcCsNd|_d|_d|_d|_tj|jttjtjddd�|_	|j	j
|_|j	j|_
dS)NT)�bufsize�stdin�stdout�shellZ	close_fds)rUrVr�r��
subprocess�Popenr�r�PIPEr�r6�	writefiler7�readfilerSr=r=r>rN4s�
zIMAP4_stream.opencCs|j�|�Srv)r=r�r�r=r=r>r�DszIMAP4_stream.readcCs
|j��Srv)r=r�rbr=r=r>r�IszIMAP4_stream.readlinecCs|j�|�|j��dSrv)r<�write�flushr�r=r=r>r�NszIMAP4_stream.sendcCs"|j��|j��|j��dSrv)r=r�r<r��waitrbr=r=r>rQTs

zIMAP4_stream.shutdown)NN)	r:r;r<rWrNr�r�r�rQr=r=r=r>r#s
c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCs
||_dSrv)r�)rTZmechinstr=r=r>rWbsz_Authenticator.__init__cCs&|�|�|��}|dkrdS|�|�S)N�*)r�r�r�)rTr�Zretr=r=r>r�esz_Authenticator.processcCsnd}t|t�r|�d�}|rjt|�dkrB|dd�}|dd�}n|}d}t�|�}|r||dd�}q|S)Nrrc�0r�)r�r�r�r��binasciiZ
b2a_base64)rT�inpZoup�t�er=r=r>r�ks	


z_Authenticator.encodecCs|sdSt�|�Sr)rCZ
a2b_base64)rTrDr=r=r>r��sz_Authenticator.decodeN)r:r;r<rWr�r�r�r=r=r=r>r�\sr�z0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decr�cCsi|]\}}|��|d�qS)r�)r�)�.0�nr'r=r=r>�
<dictcomp>�srIr�c	Cs�t�|�}|sdSt|�d�}|�d�}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}	t|�d	��}
|	d
|
d
}|dkr�|}||||||dddf	}t�|�|}
t�|
�S)
N�mon�zonen�day�year�hour�min�sec�zoneh�zonem�<�-r�)	�InternalDater&�Mon2numrr�calendarZtimegm�time�	localtime)r!rrJrKrLrMrNrOrPrQrRZzoneZtt�utcr=r=r>r�s$

cCs@d}d}tt|��}|r<t|d�\}}|||d�|}q|S)NrsABCDEFGHIJKLMNOP�r�)r�abs�divmod)ZnumrZAP�modr=r=r>r	�scCs$t�|�}|sdSt|�d����S)Nr=r�)�Flagsr&rrr)r!rr=r=r>r
�s
cCst|ttf�r"t�|tj���}n�t|t�r�z
|j	}WnZt
k
r�tjr�|d}|dkrpt�
t�|��d}tjtjf|}ntj}YnXt|d�}t|dd�dt|�i�}nLt|t�r�|jdkr�td��|}n*t|t�r�|d|dfdkr�|Std	��d
�t|j�}|�|�S)N�r�)Zseconds��tzinfozdate_time must be awarer)r)r)zdate_time not of a known typez"%d-{}-%Y %H:%M:%S %z")r�r�floatrZ
fromtimestamprrZZ
astimezoner�	tm_gmtoffrsrX�daylightrY�mktime�altzonerrbr0r��format�MonthsZmonth�strftime)r�ZdtZgmtoffZdstZdeltaZfmtr=r=r>r�s2�





�__main__zd:s:)r=r=z-dz-s)rBzIMAP password for %s on %s: Z	localhostzJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s�
)r�Zlfr�)r�)�
/tmp/xxx 1)r�)rmz/tmp/yyy)r��
/tmp/yyz 2r�ro)r�)z/tmpzyy*)r�rn)r�)NZSUBJECTZtest)r�)�1z(FLAGS INTERNALDATE RFC822))r�)rp�FLAGSz
(\Deleted))r�r=)r�r=)r�r=)r�r=)r�r=)r�)ZUIDVALIDITY)r�)r,ZALL)r�)r�)ryr=cCsLt�d||f�tt|�|�\}}t�d|||f�|dkrH|d�|S)Nz%s %sz%s => %s %sr
r)�Mr+rq)�cmdrzr�r�r=r=r>�run'srtrzPROTOCOL_VERSION = %szCAPABILITIES = %rr�)z/tmp/zyy%z.*"([^"]+)"$r�r�r�rz%sz:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)z
All tests OK.z
Tests failed.z8
If you would like to see debugging output,
try: %s -d5
)TrirCr�rfr[r~r9r|rXrWrrr�iorr�r��ImportError�__all__r�rCr*r4rlr�rpr\rr_rUr^r_r�r rrar]r`rr,r�rr�rri�	enumeraterVrr	r
rr:ZgetoptZgetpass�argvZoptlistrzr?rZstream_command�optrrUZgetuserZUSERZPASSWDZ	test_mesgZ	test_seq1Z	test_seq2rtrrrEr+rnrmrsZmlr&rr�pathr�r��printr=r=r=r>�<module>sXH
�	�/



	

�l4
9,
#
)





��


�
�imp.cpython-38.pyc000064400000023123151450073350007765 0ustar00U

e5d()�@s�dZddlmZmZmZmZmZmZmZm	Z	m
Z
zddlmZWnek
rXdZYnXddl
mZmZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejd	ed
d�dZdZd
Z d
Z!dZ"dZ#dZ$dZ%dZ&dZ'dd�Z(dd�Z)dd�Z*d8dd�Z+dd�Z,dd�Z-Gd d!�d!�Z.Gd"d#�d#�Z/Gd$d%�d%e/ej0�Z1d9d&d'�Z2Gd(d)�d)e/e�Z3d:d*d+�Z4d,d-�Z5d.d/�Z6d;d0d1�Z7d2d3�Z8d4d5�Z9e�r�d<d6d7�Z:ndZ:dS)=z�This module provides the components needed to build your own __import__
function.  Undocumented functions are obsolete.

In most cases it is preferred you consider using the importlib module's
functionality over this module.

�)	�	lock_held�acquire_lock�release_lock�get_frozen_object�is_frozen_package�init_frozen�
is_builtin�	is_frozen�_fix_co_filename)�create_dynamicN)�_ERR_MSG�_exec�_load�_builtin_from_name)�SourcelessFileLoader)�	machinery)�utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses�)�
stacklevel��������	cCs
t�|�S)z_**DEPRECATED**

    Create a new module.

    The module is not entered into sys.modules.

    )�types�
ModuleType��name�r!�/usr/lib64/python3.8/imp.py�
new_module0sr#cCstjS)z@**DEPRECATED**

    Return the magic number for .pyc files.
    )r�MAGIC_NUMBERr!r!r!r"�	get_magic;sr%cCstjjS)z$Return the magic tag for .pyc files.)�sys�implementation�	cache_tagr!r!r!r"�get_tagCsr)c
Cs6t���$t�d�t�||�W5QR�SQRXdS)a�**DEPRECATED**

    Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    If debug_override is not None, then it must be a boolean and is used in
    place of sys.flags.optimize.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    �ignoreN)�warnings�catch_warnings�simplefilterr�cache_from_source)�path�debug_overrider!r!r"r.Hs

r.cCs
t�|�S)a~**DEPRECATED**

    Given the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    )r�source_from_cache�r/r!r!r"r1[sr1cCs<dd�tjD�}dd�tjD�}dd�tjD�}|||S)�**DEPRECATED**cSsg|]}|dtf�qS��rb)�C_EXTENSION��.0�sr!r!r"�
<listcomp>ksz get_suffixes.<locals>.<listcomp>cSsg|]}|dtf�qS)�r)�	PY_SOURCEr7r!r!r"r:lscSsg|]}|dtf�qSr4)�PY_COMPILEDr7r!r!r"r:ms)r�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXES)�
extensions�source�bytecoder!r!r"�get_suffixesisrDc@s eZdZdZdd�Zdd�ZdS)�NullImporterz-**DEPRECATED**

    Null import object.

    cCs2|dkrtddd��ntj�|�r.td|d��dS)N�zempty pathnamer2zexisting directory)�ImportError�osr/�isdir)�selfr/r!r!r"�__init__zszNullImporter.__init__cCsdS)zAlways returns None.Nr!)rJ�fullnamer!r!r"�find_module�szNullImporter.find_moduleN)�__name__�
__module__�__qualname__�__doc__rKrMr!r!r!r"rErsrEcs.eZdZdZd�fdd�	Z�fdd�Z�ZS)�_HackedGetDatazMCompatibility support for 'file' arguments of various load_*()
    functions.Ncst��||�||_dS)N)�superrK�file)rJrLr/rT��	__class__r!r"rK�sz_HackedGetData.__init__c
s||jrl||jkrl|jjs0|j}d|jkr0|��|jjrJt|jd�|_}|�|��W5QR�SQRXnt��|�SdS)z;Gross hack to contort loader to deal w/ load_*()'s bad API.�br5N)	rTr/�closed�mode�close�open�readrS�get_data)rJr/rTrUr!r"r]�s
z_HackedGetData.get_data)N)rNrOrPrQrKr]�
__classcell__r!r!rUr"rR�srRc@seZdZdZdS)�_LoadSourceCompatibilityz5Compatibility support for implementing load_source().N�rNrOrPrQr!r!r!r"r_�sr_cCs\t|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t�||�|_	|j	|j
_|S)N��loader)r_r�spec_from_file_locationr&�modulesr
rr�SourceFileLoader�
__loader__�__spec__rb�r �pathnamerTrb�spec�moduler!r!r"�load_source�s

rlc@seZdZdZdS)�_LoadCompiledCompatibilityz7Compatibility support for implementing load_compiled().Nr`r!r!r!r"rm�srmcCsZt|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t||�|_|j|j	_
|S)r3ra)rmrrcr&rdr
rrrfrgrbrhr!r!r"�
load_compiled�s

rncCs�tj�|�rftjdd�tjdd�}|D]*}tj�|d|�}tj�|�r,|}qfq,td�	|���t
j||gd�}|tj
kr�t|tj
|�St|�SdS)r3NrKz{!r} is not a package)�submodule_search_locations)rHr/rIrr?r@�join�exists�
ValueError�formatrrcr&rdr
r)r r/rA�	extensionZ	init_pathrjr!r!r"�load_package�s ��
ruc	
Cs$|\}}}|r0|�d�r d|kr0td�|���n�|dkrX|tthkrXd�|�}t|��n�|tkrlt|||�S|tkr�t|||�S|tkr�tdk	r�|dkr�t	|d��}t|||�W5QR�SQRXnt|||�SnN|t
kr�t||�S|tk�r�t
|�S|tk�rt|�Sd�||�}t||d��dS)	z�**DEPRECATED**

    Load a module, given information returned by find_module().

    The module name must include the full package name, if any.

    )r;�U�+zinvalid file open mode {!r}Nz.file object required for import (type code {})r5z*Don't know how to import {} (type code {})r)�
startswithrrrsr<r=rlrnr6�load_dynamicr[�
PKG_DIRECTORYru�	C_BUILTIN�init_builtin�	PY_FROZENrrG)	r rT�filenameZdetails�suffixrY�type_�msgZopened_filer!r!r"�load_module�s.


 


r�c	Cs�t|t�std�t|����n$t|td�tf�sBtd�t|����|dkr�t|�rbddddtffSt	|�rzddddt
ffStj}|D]�}t
j�||�}dtjdfD]>}d|}t
j�||�}t
j�|�r�d|ddtffSq�t�D]2\}}}||}	t
j�||	�}t
j�|�r��q q�q��q:q�tt�|�|d��d}
d	|k�rnt|d
��}t�|j�d}
W5QRXt|||
d�}|||||ffS)a,**DEPRECATED**

    Search for a module.

    If path is omitted or None, search for a built-in, frozen or special
    module and continue search in sys.path. The module name cannot
    contain '.'; to search for a submodule of a package, pass the
    submodule name and the package's __path__.

    z'name' must be a str, not {}Nz%'path' must be None or a list, not {}rFz.pyrrKrrWr5)�encoding)�
isinstance�str�	TypeErrorrs�type�list�RuntimeErrorrr{r	r}r&r/rHrprr@�isfilerzrDrGrr[�tokenize�detect_encoding�readline)r r/�entryZpackage_directoryrZpackage_file_nameZ	file_pathrYr��	file_namer�rTr!r!r"rM�sB
�
rMcCs
t�|�S)zw**DEPRECATED**

    Reload the module and return it.

    The module must have been successfully imported before.

    )�	importlib�reload)rkr!r!r"r�2sr�cCs&z
t|�WStk
r YdSXdS)zl**DEPRECATED**

    Load and return a built-in module by name, or None is such module doesn't
    exist
    N)rrGrr!r!r"r|=s
r|cCs0ddl}|j�||�}|jj|||d�}t|�S)z:**DEPRECATED**

        Load an extension module.
        rN)r rb�origin)�importlib.machineryr�ExtensionFileLoader�
ModuleSpecr)r r/rTr�rbrjr!r!r"ryJs�ry)N)N)N)N)N);rQ�_imprrrrrrrr	r
rrGZimportlib._bootstraprr
rrZimportlib._bootstrap_externalrr�rrrHr&r�rr+�warn�DeprecationWarningZSEARCH_ERRORr<r=r6ZPY_RESOURCErzr{r}ZPY_CODERESOURCEZIMP_HOOKr#r%r)r.r1rDrErRrer_rlrmrnrur�rMr�r|ryr!r!r!r"�<module>sb,
�
	

#
4secrets.cpython-38.pyc000064400000004220151450073350010645 0ustar00U

e5d��@s�dZddddddddgZd	d
lZd	d
lZd	d
lZd	dlmZd	dlmZe�Z	e	j
Ze	jZd
d�Z
dZddd�Zddd�Zddd�Zd
S)z�Generate cryptographically strong pseudo-random numbers suitable for
managing secrets such as account authentication, tokens, and similar.

See PEP 506 for more information.
https://www.python.org/dev/peps/pep-0506/

�choice�	randbelow�randbits�SystemRandom�token_bytes�	token_hex�
token_urlsafe�compare_digest�N)r)rcCs|dkrtd��t�|�S)z(Return a random int in the range [0, n).r	zUpper bound must be positive.)�
ValueError�_sysrandZ
_randbelow)Zexclusive_upper_bound�r�/usr/lib64/python3.8/secrets.pyrs� cCs|dkrt}t�|�S)z�Return a random byte string containing *nbytes* bytes.

    If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_bytes(16)  #doctest:+SKIP
    b'\xebr\x17D*t\xae\xd4\xe3S\xb6\xe2\xebP1\x8b'

    N)�DEFAULT_ENTROPY�os�urandom��nbytesrrr
r#s
cCst�t|���d�S)a"Return a random text string, in hexadecimal.

    The string has *nbytes* random bytes, each byte converted to two
    hex digits.  If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_hex(16)  #doctest:+SKIP
    'f9bf78b9a18ce6d46a0cd2b0b86df9da'

    �ascii)�binasciiZhexlifyr�decoderrrr
r1scCst|�}t�|��d��d�S)z�Return a random URL-safe text string, in Base64 encoding.

    The string has *nbytes* random bytes.  If *nbytes* is ``None``
    or not supplied, a reasonable default is used.

    >>> token_urlsafe(16)  #doctest:+SKIP
    'Drmhze6EPcv0fN_81Bj-nA'

    �=r)r�base64Zurlsafe_b64encode�rstripr)r�tokrrr
r>s
)N)N)N)�__doc__�__all__rrrZhmacrZrandomrrZgetrandbitsrrrrrrrrrrr
�<module>s&�


code.cpython-38.pyc000064400000023273151450073350010120 0ustar00U

e5d~)�@s�dZddlZddlZddlmZmZddddgZGdd�d�ZGd	d�de�Zdd
d�Z	e
dkr�ddlZe��Z
e
jdd
dd�e
��Zejs�ejjr�dZndZe	e�dS)z?Utilities needed to emulate Python's interactive interpreter.

�N)�CommandCompiler�compile_command�InteractiveInterpreter�InteractiveConsole�interactrc@sFeZdZdZddd�Zddd�Zd	d
�Zddd�Zd
d�Zdd�Z	dS)rz�Base class for InteractiveConsole.

    This class deals with parsing and interpreter state (the user's
    namespace); it doesn't deal with input buffering or prompting or
    input file naming (the filename is always passed in explicitly).

    NcCs$|dkrddd�}||_t�|_dS)aConstructor.

        The optional 'locals' argument specifies the dictionary in
        which code will be executed; it defaults to a newly created
        dictionary with key "__name__" set to "__console__" and key
        "__doc__" set to None.

        NZ__console__)�__name__�__doc__)�localsr�compile)�selfr	�r�/usr/lib64/python3.8/code.py�__init__s	
zInteractiveInterpreter.__init__�<input>�singlec
CsTz|�|||�}Wn&tttfk
r8|�|�YdSX|dkrFdS|�|�dS)a�Compile and run some source in the interpreter.

        Arguments are as for compile_command().

        One of several things can happen:

        1) The input is incorrect; compile_command() raised an
        exception (SyntaxError or OverflowError).  A syntax traceback
        will be printed by calling the showsyntaxerror() method.

        2) The input is incomplete, and more input is required;
        compile_command() returned None.  Nothing happens.

        3) The input is complete; compile_command() returned a code
        object.  The code is executed by calling self.runcode() (which
        also handles run-time exceptions, except for SystemExit).

        The return value is True in case 2, False in the other cases (unless
        an exception is raised).  The return value can be used to
        decide whether to use sys.ps1 or sys.ps2 to prompt the next
        line.

        FNT)r
�
OverflowError�SyntaxError�
ValueError�showsyntaxerror�runcode)r�source�filenameZsymbol�coderrr
�	runsource&s

z InteractiveInterpreter.runsourcecCs>zt||j�Wn(tk
r&�Yn|��YnXdS)a�Execute a code object.

        When an exception occurs, self.showtraceback() is called to
        display a traceback.  All exceptions are caught except
        SystemExit, which is reraised.

        A note about KeyboardInterrupt: this exception may occur
        elsewhere in this code, and may not always be caught.  The
        caller should be prepared to deal with it.

        N)�execr	�
SystemExit�
showtraceback)rrrrr
rMszInteractiveInterpreter.runcodecCs�t��\}}}|t_|t_|t_|rp|tkrpz|j\}\}}}}	Wntk
rVYnXt|||||	f�}|t_tjtj	kr�t
�||�}
|�d�
|
��nt�|||�dS)apDisplay the syntax error that just occurred.

        This doesn't display a stack trace because there isn't one.

        If a filename is given, it is stuffed in the exception instead
        of what was there before (because Python's parser always uses
        "<string>" when reading from a string).

        The output is written by self.write(), below.

        �N)�sys�exc_info�	last_type�
last_value�last_tracebackr�argsr�
excepthook�__excepthook__�	traceback�format_exception_only�write�join)rr�type�value�tb�msgZdummy_filename�lineno�offset�line�linesrrr
r`sz&InteractiveInterpreter.showsyntaxerrorcCs|t��\t_t_}}|t_zPt�|d|d|j�}tjtj	krT|�
d�|��nt�|d|d|�W5d}}XdS)z�Display the exception that just occurred.

        We remove the first stack item because it is our own code.

        The output is written by self.write(), below.

        Nr�r)rrr r!r"r&�format_exception�tb_nextr$r%r(r))rZlast_tbZeir1rrr
r�sz$InteractiveInterpreter.showtracebackcCstj�|�dS)z�Write a string.

        The base implementation writes to sys.stderr; a subclass may
        replace this with a different implementation.

        N)r�stderrr()r�datarrr
r(�szInteractiveInterpreter.write)N)rr)N)
r�
__module__�__qualname__rrrrrrr(rrrr
rs

'
#c@s>eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
d�ZdS)rz�Closely emulate the behavior of the interactive Python interpreter.

    This class builds on InteractiveInterpreter and adds prompting
    using the familiar sys.ps1 and sys.ps2, and input buffering.

    N�	<console>cCst�||�||_|��dS)z�Constructor.

        The optional locals argument will be passed to the
        InteractiveInterpreter base class.

        The optional filename argument should specify the (file)name
        of the input stream; it will show up in tracebacks.

        N)rrr�resetbuffer)rr	rrrr
r�s
zInteractiveConsole.__init__cCs
g|_dS)zReset the input buffer.N)�buffer)rrrr
r:�szInteractiveConsole.resetbuffercCsRz
tjWntk
r$dt_YnXz
tjWntk
rJdt_YnXd}|dkrx|�dtjtj||jjf�n|r�|�dt	|��d}zV|r�tj}ntj}z|�
|�}Wn&tk
r�|�d�YW�qYnX|�|�}Wq�t
k
�r|�d	�|��d}Yq�Xq�|dk�r6|�d
|jj�n|dk�rN|�d|�dS)a�Closely emulate the interactive Python console.

        The optional banner argument specifies the banner to print
        before the first interaction; by default it prints a banner
        similar to the one printed by the real Python interpreter,
        followed by the current class name in parentheses (so as not
        to confuse this with the real interpreter -- since it's so
        close!).

        The optional exitmsg argument specifies the exit message
        printed when exiting. Pass the empty string to suppress
        printing an exit message. If exitmsg is not given or None,
        a default message is printed.

        z>>> z... zFType "help", "copyright", "credits" or "license" for more information.NzPython %s on %s
%s
(%s)
z%s
r�
z
KeyboardInterrupt
znow exiting %s...
r)rZps1�AttributeErrorZps2r(�version�platform�	__class__r�str�	raw_input�EOFError�push�KeyboardInterruptr:)r�banner�exitmsgZcprt�more�promptr0rrr
r�sH


��



zInteractiveConsole.interactcCs6|j�|�d�|j�}|�||j�}|s2|��|S)aPush a line to the interpreter.

        The line should not have a trailing newline; it may have
        internal newlines.  The line is appended to a buffer and the
        interpreter's runsource() method is called with the
        concatenated contents of the buffer as source.  If this
        indicates that the command was executed or invalid, the buffer
        is reset; otherwise, the command is incomplete, and the buffer
        is left as it was after the line was appended.  The return
        value is 1 if more input is required, 0 if the line was dealt
        with in some way (this is the same as runsource()).

        r<)r;�appendr)rrr:)rr0rrHrrr
rD�szInteractiveConsole.pushrcCst|�S)aDWrite a prompt and read a line.

        The returned line does not include the trailing newline.
        When the user enters the EOF key sequence, EOFError is raised.

        The base implementation uses the built-in function
        input(); a subclass may replace this with a different
        implementation.

        )�input)rrIrrr
rBszInteractiveConsole.raw_input)Nr9)NN)r)	rr7r8rrr:rrDrBrrrr
r�s

6cCsJt|�}|dk	r||_n"zddl}Wntk
r8YnX|�||�dS)a&Closely emulate the interactive Python interpreter.

    This is a backwards compatible interface to the InteractiveConsole
    class.  When readfunc is not specified, it attempts to import the
    readline module to enable GNU readline if it is available.

    Arguments (all optional, all default to None):

    banner -- passed to InteractiveConsole.interact()
    readfunc -- if not None, replaces InteractiveConsole.raw_input()
    local -- passed to InteractiveInterpreter.__init__()
    exitmsg -- passed to InteractiveConsole.interact()

    Nr)rrB�readline�ImportErrorr)rFZreadfuncZlocalrGZconsolerLrrr
rs�__main__z-q�
store_truez*don't print version and copyright messages)�action�helpr)NNNN)rrr&Zcodeoprr�__all__rrrr�argparse�ArgumentParser�parser�add_argument�
parse_argsr#�q�flags�quietrFrrrr
�<module>s*�t
�mimetypes.cpython-38.opt-2.pyc000064400000023442151450073350012160 0ustar00U

e5d�T�
@s�ddlZddlZddlZddlZzddlZWnek
rDdZYnXdddddddd	d
ddd
dg
Zdddddddddg	Z	da
daGdd�d�Zd%dd�Z
d&dd�Zd'dd�Zd(dd�Zd)dd	�Zdd
�Zd d!�Ze�d"d#�Zed$kr�e�dS)*�N�
knownfiles�inited�	MimeTypes�
guess_type�guess_all_extensions�guess_extension�add_type�init�read_mime_types�
suffix_map�
encodings_map�	types_map�common_typesz/etc/mime.typesz/etc/httpd/mime.typesz/etc/httpd/conf/mime.typesz/etc/apache/mime.typesz/etc/apache2/mime.typesz$/usr/local/etc/httpd/conf/mime.typesz"/usr/local/lib/netscape/mime.typesz/usr/local/etc/mime.typesFc@s\eZdZddd�Zddd�Zddd�Zdd	d
�Zddd�Zdd
d�Zddd�Z	ddd�Z
dS)r�TcCs�ts
t�t��|_t��|_iif|_iif|_t	�
�D]\}}|�||d�q:t�
�D]\}}|�||d�qZ|D]}|�
||�qvdS�NTF)rr	�_encodings_map_default�copyr�_suffix_map_defaultrr
�
types_map_inv�_types_map_default�itemsr�_common_types_default�read)�self�	filenames�strict�ext�type�namerr�!/usr/lib64/python3.8/mimetypes.py�__init__Bs



zMimeTypes.__init__cCs6||j||<|j|�|g�}||kr2|�|�dS�N)r
r�
setdefault�append)rrrrZextsrrrrPszMimeTypes.add_typecCsrt�|�}tj�|�\}}|dkr�|�d�}|dkr8dS|�dd|�}|dkr\|d|�}n|d|�}d|ksxd|kr|d}|dfSt�|�\}}||jkr�t�||j|�\}}q�||j	kr�|j	|}	t�|�\}}nd}	|j
d	}
||
kr�|
||	fS|��|
k�r|
|��|	fS|�r(d|	fS|j
d
}
||
k�rH|
||	fS|��|
k�rf|
|��|	fSd|	fSdS)N�data�,r)NN�;�=�/�
text/plainTF)�os�fspath�urllib�parseZ
_splittype�find�	posixpath�splitextrrr
�lower)r�urlrZschemeZcommaZsemir�baser�encodingr
rrrrasB







zMimeTypes.guess_typecCsL|��}|jd�|g�}|sH|jd�|g�D]}||kr0|�|�q0|Sr)r1r�getr#)rrr�
extensionsrrrrr�szMimeTypes.guess_all_extensionscCs|�||�}|sdS|dS)Nr)r)rrrr6rrrr�s
zMimeTypes.guess_extensionc	Cs(t|dd��}|�||�W5QRXdS)N�utf-8�r4)�open�readfp)r�filenamer�fprrrr�szMimeTypes.readc	Cs�|��}|sq�|��}tt|��D]"}||ddkr"||d�=qFq"|sLq|d|dd�}}|D]}|�|d||�qfqdS)Nr�#��.)�readline�split�range�lenr)	rr<r�lineZwords�ir�suffixesZsuffrrrr:�s	
zMimeTypes.readfpcCs�tsdSdd�}t�tjd���}||�D]�}zjt�||��T}|�d�sTW5QR�Wq(t�|d�\}}|tjkr|W5QR�Wq(|�|||�W5QRXWq(tk
r�Yq(Yq(Xq(W5QRXdS)NcssJd}zt�||�}Wntk
r,YqFYnXd|kr<|V|d7}qdS)Nr�r>)�_winregZEnumKey�OSError)ZmimedbrEZctyperrr�
enum_types�s
z3MimeTypes.read_windows_registry.<locals>.enum_types�r?zContent Type)rH�OpenKeyZHKEY_CLASSES_ROOT�
startswithZQueryValueExZREG_SZrrI)rrrJZhkcrZ
subkeynameZsubkeyZmimetypeZdatatyperrr�read_windows_registry�s$

�
zMimeTypes.read_windows_registryN)rT)T)T)T)T)T)T)T)�__name__�
__module__�__qualname__r rrrrrr:rNrrrrr:s


?



TcCstdkrt�t�||�Sr!)�_dbr	r)r2rrrrrscCstdkrt�t�||�Sr!)rRr	r�rrrrrr's
cCstdkrt�t�||�Sr!)rRr	rrSrrrr8scCstdkrt�t�|||�Sr!)rRr	r)rrrrrrrHscCs�da|dkstdkrBt�}tr&|��|dkr4t}qFtt|�}nt}|D]}tj�	|�rJ|�
|�qJ|ja|ja|j
da
|j
da|adSr)rrRrrHrNr�listr*�path�isfilerrrr
r)�files�db�filerrrr	Ys"

c
Cs`zt|dd�}Wntk
r&YdSX|�*t�}|�|d�|jdW5QR�SQRXdS)Nr7r8T)r9rIrr:r
)rY�frXrrrr
usc�CsXddddddd�aadddd	d
�aadddd
ddddddddddddddddddddddddddddddddddd d!d!d"d"d#d$d$d%d&d'd(d)d*d+d,d-d-d.d.d.d/d0d1d2d3d4d4d4d4d5d6d6d7d7d8d8d8d9d:d;d<d=d>d>d>d?d@dAdAdBdCdDdEdFdGdHdIdJdKdLdMdMdMdMdNdOdPdPdQdQdQdQdQdQdRdSdTdUdVdVdWdXdYdZdZdZdZdZd[d[d\d]d^d_��aad`dadadbdcdcdcddde�aadS)fNz.svg.gzz.tar.gzz.tar.bz2z.tar.xz)z.svgzz.tgzz.tazz.tzz.tbz2z.txzZgzip�compressZbzip2Zxz)z.gzz.Zz.bz2z.xzzapplication/javascriptzapplication/jsonzapplication/manifest+jsonzapplication/mswordzapplication/octet-streamzapplication/odazapplication/pdfzapplication/pkcs7-mimezapplication/postscriptzapplication/vnd.apple.mpegurlzapplication/vnd.ms-excelzapplication/vnd.ms-powerpointzapplication/wasmzapplication/x-bcpiozapplication/x-cpiozapplication/x-cshzapplication/x-dvizapplication/x-gtarzapplication/x-hdfzapplication/x-hdf5zapplication/x-latexzapplication/x-mifzapplication/x-netcdfzapplication/x-pkcs12zapplication/x-pn-realaudiozapplication/x-python-codezapplication/x-shzapplication/x-sharzapplication/x-shockwave-flashzapplication/x-sv4cpiozapplication/x-sv4crczapplication/x-tarzapplication/x-tclzapplication/x-texzapplication/x-texinfozapplication/x-troffzapplication/x-troff-manzapplication/x-troff-mezapplication/x-troff-mszapplication/x-ustarzapplication/x-wais-sourcezapplication/xmlzapplication/zipzaudio/basicz
audio/mpegzaudio/x-aiffzaudio/x-pn-realaudiozaudio/x-wavz	image/bmpz	image/gifz	image/iefz
image/jpegz	image/pngz
image/svg+xmlz
image/tiffzimage/vnd.microsoft.iconzimage/x-cmu-rasterzimage/x-ms-bmpzimage/x-portable-anymapzimage/x-portable-bitmapzimage/x-portable-graymapzimage/x-portable-pixmapzimage/x-rgbzimage/x-xbitmapzimage/x-xpixmapzimage/x-xwindowdumpzmessage/rfc822ztext/cssztext/csvz	text/htmlr)z
text/richtextztext/tab-separated-valuesz
text/x-pythonz
text/x-setextztext/x-sgmlztext/x-vcardztext/xmlz	video/mp4z
video/mpegzvideo/quicktimez
video/webmzvideo/x-msvideozvideo/x-sgi-movie)�z.jsz.mjsz.jsonz.webmanifestz.docz.dotz.wizz.binz.az.dllz.exez.oz.objz.soz.odaz.pdfz.p7cz.psz.aiz.epsz.m3uz.m3u8z.xlsz.xlbz.pptz.potz.ppaz.ppsz.pwzz.wasmz.bcpioz.cpioz.cshz.dviz.gtarz.hdfz.h5z.latexz.mifz.cdfz.ncz.p12z.pfxz.ramz.pycz.pyoz.shz.sharz.swfz.sv4cpioz.sv4crcz.tarz.tclz.texz.texiz.texinfoz.roffz.tz.trz.manz.mez.msz.ustarz.srcz.xslz.rdfz.wsdlz.xpdlz.zipz.auz.sndz.mp3z.mp2z.aifz.aifcz.aiffz.raz.wav�.bmpz.gifz.ief�.jpgz.jpez.jpegz.pngz.svgz.tiffz.tifz.icoz.rasr\z.pnmz.pbmz.pgmz.ppmz.rgbz.xbmz.xpmz.xwdz.emlz.mhtz.mhtmlz.nwsz.cssz.csvz.htmlz.htmz.txtz.batz.cz.hz.kshz.plz.rtxz.tsvz.pyz.etxz.sgmz.sgmlz.vcfz.xmlz.mp4z.mpegz.m1vz.mpaz.mpez.mpgz.movz.qtz.webmz.aviz.moviezapplication/rtfz
audio/midiz	image/jpgz
image/pictztext/xul)z.rtfz.midiz.midr]z.pictz.pctz.picz.xul)rrrrr
rrrrrrr�_default_mime_types�s8�

�
��

�r^c
sddl}d�d�fdd�	}z&|�tjdd�ddd	d
g�\}}Wn.|jk
rn}z|d|�W5d}~XYnXd}d}|D]4\}}|dkr�|d�q||dkr�d}q||d
kr|d}q||D]Z}	|r�t|	|�}
|
s�td|	�nt|
�q�t|	|�\}
}|
�std|	�q�td|
d|�q�dS)Nra4Usage: mimetypes.py [options] type

Options:
    --help / -h       -- print this message and exit
    --lenient / -l    -- additionally search of some common, but non-standard
                         types.
    --extension / -e  -- guess extension instead of type

More than one type argument may be given.
rKcs"t��|rt|�t�|�dSr!)�print�sys�exit)�code�msg�ZUSAGErr�usageFsz_main.<locals>.usager>Zhle�helpZlenient�	extension)z-hz--help)z-lz	--lenient)z-ez--extensionz I don't know anything about typeztype:z	encoding:)rK)�getoptr`�argv�errorrr_r)rhreZopts�argsrcrrg�opt�argZgtypeZguessr4rrdr�_main7s8�


rn�__main__)T)T)T)T)N)r*r`r/Zurllib.parser,�winregrH�ImportError�__all__rrrRrrrrrr	r
r^rnrOrrrr�<module>s^
��W




5.inspect.cpython-38.pyc000064400000235323151450073350010654 0ustar00U

e5d��@s�dZdZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlmZddlmZmZe�Zej��D]\ZZeede<q�dZdd	�Zd
d�Z dd
�Z!dd�Z"dd�Z#e$ed��rdd�Z%ndd�Z%e$ed��r*dd�Z&ndd�Z&dd�Z'dd�Z(dd�Z)d d!�Z*d"d#�Z+d$d%�Z,d&d'�Z-d(d)�Z.d*d+�Z/d,d-�Z0d.d/�Z1d0d1�Z2d2d3�Z3d4d5�Z4d6d7�Z5d�d8d9�Z6ed:d;�Z7d<d=�Z8d>d?�Z9dd@�dAdB�Z:dCdD�Z;dEdF�Z<dGdH�Z=dIdJ�Z>dKdL�Z?dMdN�Z@dOdP�ZAdQdR�ZBd�dSdT�ZCiZDiZEd�dUdV�ZFdWdX�ZGdYdZ�ZHGd[d\�d\eI�ZJGd]d^�d^�ZKd_d`�ZLdadb�ZMdcdd�ZNdedf�ZOd�dhdi�ZPedjdk�ZQdldm�ZRedndo�ZSdpdq�ZTedrds�ZUdtdu�ZVedvdw�ZWdxdy�ZXd�dzd{�ZYd|d}�ZZdddd~iie[dd��d�d��d�d��d�d��eYfd�d��Z\e[d�d��d�d��d�d��fd�d��Z]d�d��Z^d�d��Z_d�d��Z`ed�d��Zad�d��Zbed�d��Zcd�d�d��Zdd�d��Zeed�d�ecjf�Zgd�d�d��Zhd�d�d��Zid�d��Zjd�d�d��Zkd�d�d��Zlem�Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsenfd�d��Ztd�Zud�Zvd�Zwd�Zxd�d��Zyd�d��Zzd�Z{d�Z|d�Z}d�Z~d�d��Zd�dÄZ�e�e�j��Z�e�e�j��Z�e�e�j�d��Z�e�e�e�ej�fZ�d�dƄZ�d�d�dȄZ�d�dʄZ�d�d̄Z�d�d΄Z�d�dЄZ�d�d҄Z�d�d�dՄZ��dd�dׄZ��dd�dلZ�d�d�dڜd�d܄Z�Gd�dބdރZ�Gd�d�d�Z�Gd�d�d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�d�e�d�e�d�e�d�e�d�iZ�Gd�d�d�Z�Gd�d�d�Z�Gd�d�d�Z�d�d�d�d�Z�d�d�Z�e�d�k�r�e��dS(aGet useful information from live Python objects.

This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.

Here are some of the useful functions provided by this module:

    ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
        isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
        isroutine() - check object types
    getmembers() - get members of an object that satisfy a given condition

    getfile(), getsourcefile(), getsource() - find an object's source code
    getdoc(), getcomments() - get documentation on an object
    getmodule() - determine the module that an object came from
    getclasstree() - arrange classes so as to represent their hierarchy

    getargvalues(), getcallargs() - get info about function arguments
    getfullargspec() - same, with support for Python 3 features
    formatargvalues() - format an argument spec
    getouterframes(), getinnerframes() - get info about frames
    currentframe() - get the current stack frame
    stack(), trace() - get info about frames on the stack or in a traceback

    signature() - get a Signature object for the callable
)zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�N)�
attrgetter)�
namedtuple�OrderedDictZCO_icCst|tj�S)z�Return true if the object is a module.

    Module objects provide these attributes:
        __cached__      pathname to byte compiled file
        __doc__         documentation string
        __file__        filename (missing for built-in modules))�
isinstance�types�
ModuleType��object�r
�/usr/lib64/python3.8/inspect.py�ismodule?srcCs
t|t�S)z�Return true if the object is a class.

    Class objects provide these attributes:
        __doc__         documentation string
        __module__      name of module in which this class was defined)r�typerr
r
r�isclassHsrcCst|tj�S)a_Return true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        __func__        function object containing implementation of method
        __self__        instance to which this method is bound)rr�
MethodTyperr
r
r�ismethodPsrcCs:t|�st|�st|�rdSt|�}t|d�o8t|d�S)a�Return true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    __func__ attribute (etc) when an object passes ismethod().F�__get__�__set__�rr�
isfunctionr
�hasattr�r	�tpr
r
r�ismethoddescriptorZsrcCs8t|�st|�st|�rdSt|�}t|d�p6t|d�S)a}Return true if the object is a data descriptor.

    Data descriptors have a __set__ or a __delete__ attribute.  Examples are
    properties (defined in Python) and getsets and members (defined in C).
    Typically, data descriptors will also have __name__ and __doc__ attributes
    (properties, getsets, and members have both of these attributes), but this
    is not guaranteed.Fr�
__delete__rrr
r
r�isdatadescriptornsr�MemberDescriptorTypecCst|tj�S)��Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�ismemberdescriptor~srcCsdS)rFr
rr
r
rr�s�GetSetDescriptorTypecCst|tj�S)��Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�isgetsetdescriptor�sr cCsdS)rFr
rr
r
rr �scCst|tj�S)a(Return true if the object is a user-defined function.

    Function objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this function was defined
        __code__        code object containing compiled function bytecode
        __defaults__    tuple of any default values for arguments
        __globals__     global namespace in which this function was defined
        __annotations__ dict of parameter annotations
        __kwdefaults__  dict of keyword only parameters with defaults)rr�FunctionTyperr
r
rr�srcCs6t|�r|j}qt�|�}t|�s&dSt|jj|@�S)z�Return true if ``f`` is a function (or a method or functools.partial
    wrapper wrapping a function) whose code object has the given ``flag``
    set in its flags.F)r�__func__�	functools�_unwrap_partialr�bool�__code__�co_flags)�f�flagr
r
r�_has_code_flag�s
r*cCs
t|t�S)z�Return true if the object is a user-defined generator function.

    Generator function objects provide the same attributes as functions.
    See help(isfunction) for a list of attributes.)r*ZCO_GENERATOR��objr
r
r�isgeneratorfunction�sr-cCs
t|t�S)zuReturn true if the object is a coroutine function.

    Coroutine functions are defined with "async def" syntax.
    )r*ZCO_COROUTINEr+r
r
r�iscoroutinefunction�sr.cCs
t|t�S)z�Return true if the object is an asynchronous generator function.

    Asynchronous generator functions are defined with "async def"
    syntax and have "yield" expressions in their body.
    )r*ZCO_ASYNC_GENERATORr+r
r
r�isasyncgenfunction�sr/cCst|tj�S)z7Return true if the object is an asynchronous generator.)rr�AsyncGeneratorTyperr
r
r�
isasyncgen�sr1cCst|tj�S)aReturn true if the object is a generator.

    Generator objects provide these attributes:
        __iter__        defined to support iteration over container
        close           raises a new GeneratorExit exception inside the
                        generator to terminate the iteration
        gi_code         code object
        gi_frame        frame object or possibly None once the generator has
                        been exhausted
        gi_running      set to 1 when generator is executing, 0 otherwise
        next            return the next item from the container
        send            resumes the generator and "sends" a value that becomes
                        the result of the current yield-expression
        throw           used to raise an exception inside the generator)rr�
GeneratorTyperr
r
r�isgenerator�sr3cCst|tj�S)z)Return true if the object is a coroutine.)rr�
CoroutineTyperr
r
r�iscoroutine�sr5cCs6t|tj�p4t|tj�r(t|jjt@�p4t|tj	j
�S)z?Return true if object can be passed to an ``await`` expression.)rrr4r2r%�gi_coder'ZCO_ITERABLE_COROUTINE�collections�abc�	Awaitablerr
r
r�isawaitable�s��r:cCst|tj�S)abReturn true if the object is a traceback.

    Traceback objects provide these attributes:
        tb_frame        frame object at this level
        tb_lasti        index of last attempted instruction in bytecode
        tb_lineno       current line number in Python source code
        tb_next         next inner traceback object (called by this level))rr�
TracebackTyperr
r
r�istraceback�sr<cCst|tj�S)a`Return true if the object is a frame object.

    Frame objects provide these attributes:
        f_back          next outer frame object (this frame's caller)
        f_builtins      built-in namespace seen by this frame
        f_code          code object being executed in this frame
        f_globals       global namespace seen by this frame
        f_lasti         index of last attempted instruction in bytecode
        f_lineno        current line number in Python source code
        f_locals        local namespace seen by this frame
        f_trace         tracing function for this frame, or None)rr�	FrameTyperr
r
r�isframe�sr>cCst|tj�S)a�Return true if the object is a code object.

    Code objects provide these attributes:
        co_argcount         number of arguments (not including *, ** args
                            or keyword only arguments)
        co_code             string of raw compiled bytecode
        co_cellvars         tuple of names of cell variables
        co_consts           tuple of constants used in the bytecode
        co_filename         name of file in which this code object was created
        co_firstlineno      number of first line in Python source code
        co_flags            bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
                            | 16=nested | 32=generator | 64=nofree | 128=coroutine
                            | 256=iterable_coroutine | 512=async_generator
        co_freevars         tuple of names of free variables
        co_posonlyargcount  number of positional only arguments
        co_kwonlyargcount   number of keyword only arguments (not including ** arg)
        co_lnotab           encoded mapping of line numbers to bytecode indices
        co_name             name with which this code object was defined
        co_names            tuple of names of local variables
        co_nlocals          number of local variables
        co_stacksize        virtual machine stack space required
        co_varnames         tuple of names of arguments and local variables)rr�CodeTyperr
r
r�iscodesr@cCst|tj�S)a,Return true if the object is a built-in function or method.

    Built-in functions and methods provide these attributes:
        __doc__         documentation string
        __name__        original name of this function or method
        __self__        instance to which a method is bound, or None)rr�BuiltinFunctionTyperr
r
r�	isbuiltinsrBcCs t|�pt|�pt|�pt|�S)z<Return true if the object is any kind of function or method.)rBrrrrr
r
r�	isroutine&s���rCcCs�t|t�sdS|jt@rdStt|�tj�s0dSt|d�r>dS|j�	�D]\}}t
|dd�rHdSqH|jD]6}t
|dd�D]$}t
||d�}t
|dd�rzdSqzqjdS)z:Return true if the object is an abstract base class (ABC).FT�__abstractmethods__�__isabstractmethod__r
N)rr
�	__flags__�TPFLAGS_IS_ABSTRACT�
issubclassr8�ABCMetar�__dict__�items�getattr�	__bases__)r	�name�value�baser
r
r�
isabstract-s"



rQc	Cst|�r|ft|�}nd}g}t�}t|�}z:|jD].}|j��D]\}}t|tj	�rD|�
|�qDq6Wntk
r|YnX|D]~}	zt||	�}
|	|kr�t�Wn:tk
r�|D]}|	|jkr�|j|	}
q�q�Yq�YnX|r�||
�r�|�
|	|
f�|�
|	�q�|jdd�d�|S)z�Return all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate.r
cSs|dS)Nrr
)Zpairr
r
r�<lambda>n�zgetmembers.<locals>.<lambda>��key)r�getmro�set�dirrMrJrKrr�DynamicClassAttribute�append�AttributeErrorrL�add�sort)r	Z	predicate�mro�results�	processed�namesrP�k�vrUrOr
r
r�
getmembersEs:




rd�	Attributezname kind defining_class objectcCsTt|�}tt|��}tdd�|D��}|f|}||}t|�}|D].}|j��D]\}}t|tj�rR|�	|�qRqDg}	t
�}
|D�]�}d}d}
d}||
k�rzz|dkr�td��t||�}
Wn"tk
r�}zW5d}~XYn�Xt|
d|�}||k�rzd}d}|D] }t||d�}||
k�r|}�q|D]B}z|�
||�}Wntk
�rXY�q(YnX||
k�r(|}�q(|dk	�rz|}|D]0}||jk�r~|j|}||k�r�|}�q��q~|dk�r�q�|
dk	�r�|
n|}t|ttjf��r�d}|}nFt|ttjf��rd}|}n*t|t��rd	}|}nt|��r,d
}nd}|	�	t||||��|
�|�q�|	S)aNReturn list of attribute-descriptor tuples.

    For each name in dir(cls), the return list contains a 4-tuple
    with these elements:

        0. The name (a string).

        1. The kind of attribute this is, one of these strings:
               'class method'    created via classmethod()
               'static method'   created via staticmethod()
               'property'        created via property()
               'method'          any other flavor of method or descriptor
               'data'            not a method

        2. The class which defined this attribute (a class).

        3. The object as obtained by calling getattr; if this fails, or if the
           resulting object does not live anywhere in the class' mro (including
           metaclasses) then the object is looked up in the defining class's
           dict (found by walking the mro).

    If one of the items in dir(cls) is stored in the metaclass it will now
    be discovered and not have None be listed as the class in which it was
    defined.  Any items whose home class cannot be discovered are skipped.
    css|]}|ttfkr|VqdS�N)r
r	)�.0�clsr
r
r�	<genexpr>�sz'classify_class_attrs.<locals>.<genexpr>NrJz)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)rVr
�tuplerXrJrKrrrYrZrW�	ExceptionrL�__getattr__r[�staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyperkrCrer\)rhr^ZmetamroZclass_basesZ	all_basesrarPrbrc�resultr`rNZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_objr,�kindr
r
r�classify_class_attrsss�












rxcCs|jS)zHReturn tuple of base classes (including cls) in method resolution order.)�__mro__)rhr
r
rrV�srV��stopcs|�dkrdd�}n�fdd�}|}t|�|i}t��}||�rx|j}t|�}||ks`t|�|krntd�|���|||<q6|S)anGet the object wrapped by *func*.

   Follows the chain of :attr:`__wrapped__` attributes returning the last
   object in the chain.

   *stop* is an optional callback accepting an object in the wrapper chain
   as its sole argument that allows the unwrapping to be terminated early if
   the callback returns a true value. If the callback never returns a true
   value, the last object in the chain is returned as usual. For example,
   :func:`signature` uses this to stop unwrapping if any object in the
   chain has a ``__signature__`` attribute defined.

   :exc:`ValueError` is raised if a cycle is encountered.

    NcSs
t|d�S�N�__wrapped__�r�r(r
r
r�_is_wrapper�szunwrap.<locals>._is_wrappercst|d�o�|�Sr|r~rrzr
rr�sz!wrapper loop when unwrapping {!r})�id�sys�getrecursionlimitr}�len�
ValueError�format)�funcr{r�r(ZmemoZrecursion_limitZid_funcr
rzr�unwrap�s

r�cCs|��}t|�t|���S)zBReturn the indent size, in spaces, at the start of a line of text.)�
expandtabsr��lstrip)�lineZexpliner
r
r�
indentsizesr�cCsNtj�|j�}|dkrdS|j�d�dd�D]}t||�}q.t|�sJdS|S)N�.���)r��modules�get�
__module__�__qualname__�splitrLr)r�rhrNr
r
r�
_findclasssr�c	Cst|�rT|jD]@}|tk	rz
|j}Wntk
r<YqYnX|dk	r|SqdSt|�r�|jj}|j}t|�r�t	t	||d�d�|jkr�|}n|j
}�n$t|�r�|j}t|�}|dks�t	||�|k	r�dSn�t
|��r|j}|j}t|��r|jd||jk�r|}n|j
}n�t|t��rP|j}|j}t|�}|dk�sJt	||�|k	�r�dSnnt|��sdt|��r�|j}|j}t	||�|k	�r�dSt|��r�t	|dd�}t|t��r�||k�r�||SndS|jD]F}zt	||�j}Wntk
�r�Y�q�YnX|dk	�r�|S�q�dS)Nr"r��	__slots__)rryr	�__doc__r[rr"�__name__�__self__rL�	__class__rr�rBr�rrk�fgetrrrjr�dict)r,rP�docrN�selfrhr��slotsr
r
r�_finddoc sn



�


�



r�c	Cshz
|j}Wntk
r YdSX|dkrRzt|�}Wnttfk
rPYdSXt|t�s`dSt|�S)z�Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed.N)r�r[r��	TypeErrorr�str�cleandoc)r	r�r
r
r�getdoc^s

r�cCs�z|���d�}Wntk
r(YdSXtj}|dd�D]*}t|���}|r<t|�|}t||�}q<|r||d��|d<|tjkr�tdt|��D]}|||d�||<q�|r�|ds�|�	�q�|r�|ds�|�	d�q�d�
|�SdS)z�Clean up indentation from docstrings.

    Any whitespace that can be uniformly removed from the second line
    onwards is removed.�
N�rr�)r�r��UnicodeErrorr��maxsizer�r��min�range�pop�join)r��linesZmarginr�Zcontent�indent�ir
r
rr�qs(

r�cCs�t|�r(t|dd�r|jStd�|���t|�rht|d�rZtj�	|j
�}t|dd�rZ|jStd�|���t|�rv|j}t
|�r�|j}t|�r�|j}t|�r�|j}t|�r�|jStd�t|�j���dS)z@Work out which source or compiled file an object was defined in.�__file__Nz{!r} is a built-in moduler�z{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})rrLr�r�r�rrr�r�r�r�rr"rr&r<�tb_framer>�f_coder@�co_filenamer
r�)r	�moduler
r
r�getfile�s.
�r�cCsTtj�|�}dd�tj��D�}|��|D]"\}}|�|�r,|d|�Sq,dS)z1Return the module name for a given file, or None.cSsg|]}t|�|f�qSr
)r�)rg�suffixr
r
r�
<listcomp>�s�z!getmodulename.<locals>.<listcomp>N)�os�path�basename�	importlib�	machinery�all_suffixesr]�endswith)r�Zfname�suffixesZneglenr�r
r
r�
getmodulename�s�
r�cs�t|��tjjdd�}|tjjdd�7}t�fdd�|D��r`tj���dtjj	d�nt�fdd�tjj
D��r~dStj���r��Stt
|��dd�dk	r��S�tjkr��SdS)z�Return the filename that can be used to locate an object's source.
    Return None if no way can be identified to get the source.
    Nc3s|]}��|�VqdSrf�r��rg�s��filenamer
rri�sz getsourcefile.<locals>.<genexpr>rc3s|]}��|�VqdSrfr�r�r�r
rri�s�
__loader__)r�r�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr�r��splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrL�	getmodule�	linecache�cache)r	Zall_bytecode_suffixesr
r�r�
getsourcefile�s"
��
r�cCs,|dkrt|�pt|�}tj�tj�|��S)z�Return an absolute path to the source or compiled file for an object.

    The idea is for each object to have a unique origin, so this routine
    normalizes the result as much as possible.N)r�r�r�r��normcase�abspath)r	�	_filenamer
r
r�
getabsfile�sr�c
Cs�t|�r|St|d�r$tj�|j�S|dk	rD|tkrDtj�t|�Szt||�}Wntk
rhYdSX|tkr�tj�t|�Stj�	��
�D]\\}}t|�r�t|d�r�|j}|t�|d�kr�q�|t|<t|�}|j
t|<ttj�|�<q�|tk�rtj�t|�Stjd}t|d��s"dSt||j
��rJt||j
�}||k�rJ|Stjd}t||j
��r|t||j
�}	|	|k�r||SdS)zAReturn the module an object was defined in, or None if not found.r�Nr��__main__r��builtins)rrr�r�r�r��
modulesbyfiler�r��copyrKr��_filesbymodnamer�r�r��realpathrL)
r	r��file�modnamer�r(�mainZ
mainobjectZbuiltinZ
builtinobjectr
r
rr��sJ
�

�




r�cCs�t|�}|rt�|�n$t|�}|�d�r4|�d�s<td��t||�}|rZt�||j	�}n
t�|�}|sptd��t
|�r�|dfSt|��r |j}t
�d|d�}g}tt|��D]F}|�||�}|r�||ddkr�||fS|�|�d	�|f�q�|�r|��||dd	fStd
��t|��r0|j}t|��r@|j}t|��rP|j}t|��r`|j}t|��r�t|d��s~td��|jd	}	t
�d
�}|	dk�r�z||	}
Wnt k
�r�td��YnX|�|
��rؐq�|	d	}	�q�||	fStd��dS)abReturn the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
    in the file and the line number indexes a line in that list.  An OSError
    is raised if the source code cannot be retrieved.�<�>zsource code not availablezcould not get source coderz^(\s*)class\s*z\b�cr�zcould not find class definition�co_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code objectN)!r�r��
checkcacher��
startswithr��OSErrorr��getlinesrJrrr��re�compiler�r��matchrZ�groupr]rr"rr&r<r�r>r�r@rr��
IndexError)r	r�r�r�rNZpatZ
candidatesr�r��lnumr�r
r
r�
findsourcesf










r�c	Cs.zt|�\}}Wnttfk
r*YdSXt|�r�d}|rT|ddd�dkrTd}|t|�krz||��dkrz|d}qT|t|�kr�||dd�dkr�g}|}|t|�kr�||dd�dkr�|�||���|d}q�d�|�S�n>|dk�r*t	||�}|d}|dk�r*||�
�dd�dk�r*t	||�|k�r*||���
�g}|dk�r�|d}||���
�}|dd�dk�r�t	||�|k�r�|g|dd�<|d}|dk�r��q�||���
�}�qt|�r�|d��dk�r�g|dd�<�q�|�r |d	��dk�r g|d	d�<�q�d�|�SdS)
zwGet lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    Nr�z#!r�)��#r�r�r�)r�r�r�rr��striprZr�r�r�r�)r	r�r��startZcomments�endr�Zcommentr
r
r�getcommentsRsL
  

$�
$
r�c@seZdZdS)�
EndOfBlockN)r�r�r�r
r
r
rr�sr�c@s eZdZdZdd�Zdd�ZdS)�BlockFinderz@Provide a tokeneater() method to detect the end of a code block.cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrFr�)r��islambda�started�passline�indecorator�decoratorhasargs�last�	body_col0�r�r
r
r�__init__�szBlockFinder.__init__cCsr|jsB|jsB|dkrd|_n|dkr8|dkr2d|_d|_d|_�n,|dkrZ|jrVd|_�n|dkrv|jrtd|_d|_n�|tjkr�d|_|d|_|jr�t�|jr�|js�d|_n�|jr�n�|tj	kr�|j
dkr�|jr�|d	|_
|jd	|_d|_n�|tjk�r|jd	|_|jdk�rnt�nV|tj
k�rL|j
dk	�rn|d	|j
k�rn|d|_n"|jdk�rn|tj
tjfk�rnt�dS)
N�@T)�def�class�lambdar�(�)Frr�)r�r�r�r�r��tokenize�NEWLINEr�r��INDENTr�r��DEDENT�COMMENT�NL)r�r
�tokenZsrowcolZerowcolr�r
r
r�
tokeneater�sL





zBlockFinder.tokeneaterN)r�r�r�r�r�rr
r
r
rr��s
r�c	CsVt�}z(t�t|�j�}|D]}|j|�qWnttfk
rFYnX|d|j�S)z@Extract the block of code at the top of the given list of lines.N)	r�r�generate_tokens�iter�__next__rr��IndentationErrorr�)r�Zblockfinder�tokensZ_tokenr
r
r�getblock�srcCsbt|�}t|�\}}t|�r"|j}t|�s>t|�rF|jjdkrF|dfSt||d��|dfSdS)a�Return a list of source lines and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of the lines
    corresponding to the object and the line number indicates where in the
    original source file the first line of code was found.  An OSError is
    raised if the source code cannot be retrieved.z<module>rNr�)	r�r�r<r�rr>r��co_namer�r	r�r�r
r
r�getsourcelines�s�
�rcCst|�\}}d�|�S)aReturn the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    OSError is raised if the source code cannot be retrieved.r�)rr�rr
r
r�	getsource�srcCsRg}|jtdd�d�|D]2}|�||jf�||kr|�t||||��q|S)z-Recursive helper function for getclasstree().r�r�rT)r]rrZrM�walktree)�classes�children�parentr_r�r
r
rr�srFcCs�i}g}|D]d}|jr^|jD]>}||kr0g||<|||krJ||�|�|r||krqpqq||kr|�|�q|D]}||krv|�|�qvt||d�S)a�Arrange the given list of classes into a hierarchy of nested lists.

    Where a nested list appears, it contains classes derived from the class
    whose entry immediately precedes the list.  Each entry is a 2-tuple
    containing a class and a tuple of its base classes.  If the 'unique'
    argument is true, exactly one entry appears in the returned structure
    for each class in the given list.  Otherwise, classes using multiple
    inheritance and their descendants will appear multiple times.N)rMrZr)r�uniquer�rootsr�rr
r
r�getclasstree�s"	
r�	Argumentszargs, varargs, varkwc	Cs�t|�std�|���|j}|j}|j}t|d|��}t||||��}d}||7}d}|jt@rx|j|}|d}d}|jt	@r�|j|}t
||||�S)aGet information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where
    'args' is the list of argument names. Keyword-only arguments are
    appended. 'varargs' and 'varkw' are the names of the * and **
    arguments or None.z{!r} is not a code objectNrr�)r@r�r��co_varnames�co_argcount�co_kwonlyargcount�listr'�
CO_VARARGS�CO_VARKEYWORDSr)	�cora�nargsZnkwargs�args�
kwonlyargs�step�varargs�varkwr
r
r�getargss"



r,�ArgSpeczargs varargs keywords defaultscCsDtjdtdd�t|�\}}}}}}}|s.|r6td��t||||�S)aeGet the names and default values of a function's parameters.

    A tuple of four things is returned: (args, varargs, keywords, defaults).
    'args' is a list of the argument names, including keyword-only argument names.
    'varargs' and 'keywords' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.

    This function is deprecated, as it does not support annotations or
    keyword-only parameters and will raise ValueError if either is present
    on the supplied callable.

    For a more structured introspection API, use inspect.signature() instead.

    Alternatively, use getfullargspec() for an API with a similar namedtuple
    based interface, but full support for annotations and keyword-only
    parameters.

    Deprecated since Python 3.5, use `inspect.getfullargspec()`.
    zhinspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()r���
stacklevelzgFunction has keyword-only parameters or annotations, use inspect.signature() API which can support them)�warnings�warn�DeprecationWarning�getfullargspecr�r-)r�r'r*r+�defaultsr(�kwonlydefaults�annr
r
r�
getargspec-s��r7�FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc
Cs|zt|ddtd�}Wn,tk
r@}ztd�|�W5d}~XYnXg}d}d}g}g}d}i}	d}i}
|j|jk	r||j|	d<|j��D]�}|j}|j	}
|t
kr�|�|
�|j|jk	r�||jf7}nv|t
kr�|�|
�|j|jk	r�||jf7}nJ|tkr�|
}n<|tk�r*|�|
�|j|jk	�r8|j|
|
<n|tk�r8|
}|j|jk	r�|j|	|
<q�|
�sZd}
|�sdd}t|||||||
|	�S)a$Get the names and default values of a callable object's parameters.

    A tuple of seven things is returned:
    (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
    'args' is a list of the parameter names.
    'varargs' and 'varkw' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.
    'kwonlyargs' is a list of keyword-only parameter names.
    'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
    'annotations' is a dictionary mapping parameter names to annotations.

    Notable differences from inspect.signature():
      - the "self" parameter is always reported, even for bound methods
      - wrapper chains defined by __wrapped__ *not* unwrapped automatically
    F��follow_wrapper_chains�skip_bound_arg�sigclszunsupported callableNr
�return)�_signature_from_callable�	Signatureror��return_annotation�empty�
parameters�valuesrwrN�_POSITIONAL_ONLYrZ�default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr8)r��sig�exr'r*r+Zposonlyargsr(r4�annotations�
kwdefaults�paramrwrNr
r
rr3Nsb�






�r3�ArgInfozargs varargs keywords localscCs t|j�\}}}t||||j�S)a9Get information about arguments passed into a particular frame.

    A tuple of four things is returned: (args, varargs, varkw, locals).
    'args' is a list of the argument names.
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'locals' is the locals dictionary of the given frame.)r,r�rP�f_locals)�framer'r*r+r
r
r�getargvalues�srScCsVt|dd�dkr t|��dd�St|t�rN|jd|fkr>|jS|jd|jSt|�S)Nr��typingztyping.r�r�r�)rL�repr�replacerr
r�r�)rJZbase_moduler
r
r�formatannotation�s
rWcst|dd���fdd�}|S)Nr�cs
t|��Srf)rW)rJ�r�r
r�_formatannotation�sz5formatannotationrelativeto.<locals>._formatannotation)rL)r	rYr
rXr�formatannotationrelativeto�srZr
cCsd|S�N�*r
�rNr
r
rrR�rSrRcCsd|S�N�**r
r]r
r
rrR�rScCsdt|�S�N�=�rU�rOr
r
rrR�rScCsd|S)Nz -> r
)�textr
r
rrR�rSc
s<ddlm}
|
dtdd����fdd�}g}|rBt|�t|�}t|�D]:\}}||�}|rz||krz||
|||�}|�|�qJ|dk	r�|�|||���n|r�|�d	�|r�|D]2}||�}|r�||kr�||
||�7}|�|�q�|dk	�r|�|	||���d
d�|�d}d
�k�r8||��d
��7}|S)a�Format an argument spec from the values returned by getfullargspec.

    The first seven arguments are (args, varargs, varkw, defaults,
    kwonlyargs, kwonlydefaults, annotations).  The other five arguments
    are the corresponding optional formatting functions that are called to
    turn names and values into strings.  The last argument is an optional
    function to format the sequence of arguments.

    Deprecated since Python 3.5: use the `signature` function and `Signature`
    objects.
    r)r1zc`formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directlyr�r.cs(�|�}|�kr$|d��|�7}|S)Nz: r
)�argru�rMrW�	formatargr
r�formatargandannotation�sz-formatargspec.<locals>.formatargandannotationNr\r�, rr=)r0r1r2r��	enumeraterZr�)r'r*r+r4r(r5rMrg�
formatvarargs�formatvarkw�formatvalueZ
formatreturnsrWr1rh�specsZfirstdefaultr�re�specZ	kwonlyargrur
rfr�
formatargspec�s<�


rpcCsd|Sr[r
r]r
r
rrRrScCsd|Sr^r
r]r
r
rrRrScCsdt|�Sr`rbrcr
r
rrRrScCs�|||fdd�}g}	tt|��D]}
|	�|||
��q |rV|	�||�|||��|rt|	�||�|||��dd�|	�dS)afFormat an argument spec from the 4 values returned by getargvalues.

    The first four arguments are (args, varargs, varkw, locals).  The
    next four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.cSs||�|||�Srfr
)rN�localsrgrmr
r
r�convertsz formatargvalues.<locals>.convertrrir)r�r�rZr�)r'r*r+rqrgrkrlrmrrrnr�r
r
r�formatargvaluess�
rscs��fdd�|D�}t|�}|dkr,|d}n>|dkr@dj|�}n*dj|dd��}|dd�=d	�|�|}td
|||rzdnd|dkr�d
nd|f��dS)Ncsg|]}|�krt|��qSr
rb)rgrN�rCr
rr�sz&_missing_arguments.<locals>.<listcomp>r�rr�z	{} and {}z, {} and {}���riz*%s() missing %i required %s argument%s: %s�
positional�keyword-onlyr�r�)r�r�r�r�)�f_nameZargnames�posrCra�missingr��tailr
rtr�_missing_argumentss 


��r|c
	s�t|�|}t�fdd�|D��}|r:|dk}	d|f}
n2|rTd}	d|t|�f}
nt|�dk}	tt|��}
d}|r�d}||dkr�d	nd||dkr�d	ndf}td
||
|	r�d	nd|||dkr�|s�dndf��dS)
Ncsg|]}|�kr|�qSr
r
)rgrertr
rr�)sz_too_many.<locals>.<listcomp>r�zat least %dTz
from %d to %dr�z7 positional argument%s (and %d keyword-only argument%s)r�z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)r�r�r�)
rxr'Zkwonlyr*ZdefcountZgivenrCZatleastZkwonly_givenZpluralrKZ
kwonly_sig�msgr
rtr�	_too_many's*���r~cOst|�}|\}}}}}}	}
|j}i}t|�rB|jdk	rB|jf|}t|�}
t|�}|r^t|�nd}t|
|�}t|�D]}|||||<qt|r�t||d��||<t||�}|r�i||<|�	�D]T\}}||kr�|s�t
d||f��||||<q�||k�rt
d||f��|||<q�|
|k�r<|�s<t||||||
|�|
|k�r�|d||�}|D]}||k�rZt||d|��qZt
|||d��D] \}}||k�r�||||<�q�d}|D]6}||k�r�|	�r�||	k�r�|	|||<n|d7}�q�|�rt||d|�|S)z�Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
    values from 'positional' and 'named'.Nrz*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTr�F)r3r�rr�r�r�r�rnrWrKr�r~r|rj)r�rvZnamedror'r*r+r4r(r5r6rxZ	arg2valueZnum_posZnum_argsZnum_defaults�nr�Zpossible_kwargs�kwrOZreqrerz�kwargr
r
r�getcallargs<sh
�
�
�



r��ClosureVarsz"nonlocals globals builtins unboundc	Cs�t|�r|j}t|�s$td�|���|j}|jdkr:i}ndd�t|j|j�D�}|j	}|�
dtj�}t
|�rt|j}i}i}t�}|jD]d}|dkr�q�z||||<Wq�tk
r�z||||<Wntk
r�|�|�YnXYq�Xq�t||||�S)a
    Get the mapping of free variables to their current values.

    Returns a named tuple of dicts mapping the current nonlocal, global
    and builtin references as seen by the body of the function. A final
    set of unbound names that could not be resolved is also provided.
    �{!r} is not a Python functionNcSsi|]\}}||j�qSr
)�
cell_contents)rg�varZcellr
r
r�
<dictcomp>�s�z"getclosurevars.<locals>.<dictcomp>�__builtins__)�None�True�False)rr"rr�r�r&�__closure__�zip�co_freevars�__globals__r�r�rJrrW�co_names�KeyErrorr\r�)	r��codeZ
nonlocal_varsZ	global_nsZ
builtin_nsZglobal_varsZbuiltin_varsZ
unbound_namesrNr
r
r�getclosurevarszs>	
�
�r��	Tracebackz+filename lineno function code_context indexr�cCs�t|�r|j}|j}n|j}t|�s2td�|���t|�p@t|�}|dkr�|d|d}zt	|�\}}Wnt
k
r�d}}Yq�Xtdt|t
|�|��}||||�}|d|}nd}}t|||jj||�S)a�Get information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line.z'{!r} is not a frame or traceback objectrr�r�N)r<�	tb_linenor��f_linenor>r�r�r�r�r�r��maxr�r�r�r�r)rR�context�linenor�r�r�r��indexr
r
r�getframeinfo�s$r�cCs|jS)zCGet the line number from a frame object, allowing for optimization.)r��rRr
r
r�	getlineno�sr��	FrameInfor�cCs2g}|r.|ft||�}|�t|��|j}q|S)z�Get a list of records for a frame and all higher (calling) frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�rZr��f_back)rRr��	framelist�	frameinfor
r
r�getouterframes�sr�cCs4g}|r0|jft||�}|�t|��|j}q|S)z�Get a list of records for a traceback's frame and all lower frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�r�rZr��tb_next)�tbr�r�r�r
r
r�getinnerframes�sr�cCsttd�rt�d�SdS)z?Return the frame of the caller or None if this is not possible.�	_getframer�N)rr�r�r
r
r
r�currentframe�sr�cCstt�d�|�S)z@Return a list of records for the stack above the caller's frame.r�)r�r�r��r�r
r
r�stack�sr�cCstt��d|�S)zCReturn a list of records for the stack below the current exception.r�)r�r��exc_infor�r
r
r�trace�sr�cCstjd�|�S)Nry)r
rJr)�klassr
r
r�_static_getmrosr�cCs8i}zt�|d�}Wntk
r(YnXt�||t�S�NrJ)r	�__getattribute__r[r�r��	_sentinel)r,�attrZ
instance_dictr
r
r�_check_instancesr�c	CsHt|�D]:}tt|��tkrz|j|WStk
r@YqXqtSrf)r��_shadowed_dictr
r�rJr�)r�r��entryr
r
r�_check_class
sr�cCs(zt|�Wntk
r"YdSXdS�NFT)r�r�r+r
r
r�_is_types
r�c	Csntjd}t|�D]V}z|�|�d}Wntk
r<YqXt|�tjkr`|jdkr`|j|ks|Sqt	Sr�)
r
rJr�rr�rrr�rjr�)r��	dict_attrr�Z
class_dictr
r
rr�s
��
r�c	Cst}t|�s>t|�}t|�}|tks2t|�tjkrBt||�}n|}t||�}|tk	r�|tk	r�tt|�d�tk	r�tt|�d�tk	r�|S|tk	r�|S|tk	r�|S||kr�tt|��D]:}tt|��tkr�z|j	|WSt
k
r�Yq�Xq�|tk	r�|St|��dS)a�Retrieve attributes without triggering dynamic lookup via the
       descriptor protocol,  __getattr__ or __getattribute__.

       Note: this function may not be able to retrieve all attributes
       that getattr can fetch (like dynamically created attributes)
       and may find attributes that getattr can't (like descriptors
       that raise AttributeError). It can also return descriptor objects
       instead of instance members in some cases. See the
       documentation for details.
    rrN)r�r�r
r�rrr�r�r�rJr�r[)r,r�rEZinstance_resultr�r�Zklass_resultr�r
r
r�getattr_static+s:�
�r��GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�
GEN_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a#Get current state of a generator-iterator.

    Possible states are:
      GEN_CREATED: Waiting to start execution.
      GEN_RUNNING: Currently being executed by the interpreter.
      GEN_SUSPENDED: Currently suspended at a yield expression.
      GEN_CLOSED: Execution has completed.
    Nr�)�
gi_runningr��gi_framer��f_lastir�r�)�	generatorr
r
r�getgeneratorstate`s	
r�cCs:t|�std�|���t|dd�}|dk	r2|jjSiSdS)z�
    Get the mapping of generator local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.z{!r} is not a Python generatorr�N)r3r�r�rLr�rQ)r�rRr
r
r�getgeneratorlocalsrsr��CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a&Get current state of a coroutine object.

    Possible states are:
      CORO_CREATED: Waiting to start execution.
      CORO_RUNNING: Currently being executed by the interpreter.
      CORO_SUSPENDED: Currently suspended at an await expression.
      CORO_CLOSED: Execution has completed.
    Nr�)�
cr_runningr��cr_framer�r�r�r�)�	coroutiner
r
r�getcoroutinestate�s	
r�cCs"t|dd�}|dk	r|jSiSdS)z�
    Get the mapping of coroutine local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.r�N)rLrQ)r�rRr
r
r�getcoroutinelocals�sr��
from_bytescCs8zt||�}Wntk
r$YdSXt|t�s4|SdS)z�Private helper. Checks if ``cls`` has an attribute
    named ``method_name`` and returns it only if it is a
    pure python function.
    N)rLr[r�_NonUserDefinedCallables)rhZmethod_nameZmethr
r
r�"_signature_get_user_defined_method�s
r�c
Cs�|j}t|���}|jpd}|jp$i}|r2||}z|j||�}Wn6tk
rx}zd�|�}	t|	�|�W5d}~XYnXd}
|��D�]\}}z|j	|}
Wnt
k
r�YnlX|jtkr�|�
|�q�|jtk�r||kr�d}
|j|
d�||<n|�
|j�q�|jtk�r|j|
d�||<|
r�|jtk	�s2t�|jtk�rb||jtd�}|||<|�|�q�|jttfk�r~|�|�q�|jtkr�|�
|j�q�|j|��d�S)	z�Private helper to calculate how 'wrapped_sig' signature will
    look like after applying a 'functools.partial' object (or alike)
    on it.
    r
z+partial object {!r} has incorrect argumentsNFT)rE�rw�rB)rBrrKr'�keywords�bind_partialr�r�r��	argumentsr�rwrDr�rFrVrNrH�AssertionError�move_to_endrIrGrC)�wrapped_sig�partialZ
extra_argsZ
old_params�
new_paramsZpartial_argsZpartial_keywordsZbarLr}Ztransform_to_kwonly�
param_namerOZ	arg_valueZ	new_paramr
r
r�_signature_get_partial�sN






r�cCslt|j���}|r$|djttfkr,td��|dj}|ttfkrP|dd�}n|t	k	r`td��|j
|d�S)zWPrivate helper to transform signatures for unbound
    functions to bound methods.
    rzinvalid method signaturer�Nzinvalid argument typer�)rnrBrCrwrIrHr�rFrDrGrV)rK�paramsrwr
r
r�_signature_bound_methods
r�cCs&t|�p$t|�p$t|t�p$|ttfkS)zxPrivate helper to test if `obj` is a callable that might
    support Argument Clinic's __text_signature__ protocol.
    )rBrrr�r
r	r+r
r
r�_signature_is_builtin.s��
�r�cCs�t|�rt|�rdSt|dd�}t|dd�}t|dt�}t|dt�}t|dd�}t|tj�o�t|t�o�|dksxt|t�o�|dks�t|t	�o�t|t	�S)z�Private helper to test if `obj` is a duck type of FunctionType.
    A good example of such objects are functions compiled with
    Cython, which have all attributes that a pure Python function
    would have, but have their code statically compiled.
    Fr�Nr&�__defaults__�__kwdefaults__�__annotations__)
�callablerrL�_voidrrr?r�rnr�)r,rNr�r4rNrMr
r
r�_signature_is_functionlike:s ����r�cCsr|�d�st�|�d�}|dkr*|�d�}|�d�}|dksH||ksHt�|�d�}|dksf||ksft�|d|�S)z� Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
    z($�,r�r�:rar�)r�r��find)roryZcposr
r
r�_signature_get_bound_paramSs



r�cCsd|s|ddfSd}d}dd�|�d�D�}t|�j}t�|�}d}d}g}|j}	d}
tj}tj}t|�}
|
j	tj
ksxt�|D]�}
|
j	|
j}}||kr�|dkr�|r�d}q||r�t�d}|
d	7}
q||d
kr�|r�t�|dks�t�d}|
d	}q|||k�r|dk�r|dk�s
t�|
}q||�r6d}||k�r.|dk�s6|	d
�|	|�|dkr||	d�q|d�
|�}|||fS)a�
    Private helper function. Takes a signature in Argument Clinic's
    extended signature format.

    Returns a tuple of three things:
      * that signature re-rendered in standard Python syntax,
      * the index of the "self" parameter (generally 0), or None if
        the function does not have a "self" parameter, and
      * the index of the last "positional only" parameter,
        or None if the signature has no positional-only parameters.
    NcSsg|]}|�d��qS)�ascii)�encode)rg�lr
r
rr�}sz6_signature_strip_non_python_syntax.<locals>.<listcomp>r�Frr�Tr��/�$rri� r�)r�rrrrZr�OP�
ERRORTOKEN�nextr
�ENCODINGr��stringr�)�	signature�self_parameter�last_positional_onlyr�r�Ztoken_streamZ
delayed_commaZskip_next_commardr\Zcurrent_parameterr�r��tr
r��clean_signaturer
r
r�"_signature_strip_non_python_syntaxjsZ





r�Tc	sjddl�|j�t|�\}}}d|d}z��|�}Wntk
rNd}YnXt|�j�sjtd�|���|j	d}	g��j
�t��d}i�t|dd�}
|
r�t
j�|
d�}|r�|j�t
j���	�fdd�����	fd	d
��
G��
fdd�d�j���f��������fd
d�	}t|	jj�}t|	jj�}
tj||
dd�}|dk	�rJ�j�n�j�ttt|���D](\}\}}|||�||k�r`�j��q`|	jj�r��j�||	jj���j�t|	jj |	jj!�D]\}}|||��q�|	jj"�r�j#�||	jj"��|dk	�r\��st$�t|dd�}|dk	}t%|�}|�rB|�s6|�rB��&d�n�dj'�jd�}|�d<|�|j
d�S)zdPrivate helper to parse content of '__text_signature__'
    and return a Signature based on it.
    rNzdef fooz: passz"{!r} builtin has invalid signaturer�cs(t|�j�st�|jdk	r"td��|jS)Nz'Annotations are not currently supported)rrer�rJr�)�node)�astr
r�
parse_name�s
z&_signature_fromstr.<locals>.parse_namecs|zt|��}Wn>tk
rLzt|��}Wntk
rFt��YnXYnXt|tttttt	d�f�rr��
|�St��dSrf)�eval�	NameError�RuntimeErrorrr��int�float�bytesr%r
ZConstant)r�rO)r��module_dict�sys_module_dictr
r�
wrap_value�s
z&_signature_fromstr.<locals>.wrap_valuecs(eZdZ��fdd�Z��fdd�ZdS)z,_signature_fromstr.<locals>.RewriteSymbolicscs\g}|}t|�j�r(|�|j�|j}qt|�j�s:t��|�|j�d�t	|��}�|�S)Nr�)
rrerZr�rO�Namer�r�r��reversed)r�r��arrO�r�rr
r�visit_Attribute�sz<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributecst|j�j�st���|j�Srf)rZctxZLoadr�r�)r�r�r	r
r�
visit_Name�sz7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r�r�r�r
rr
r	r
r�RewriteSymbolics�srcs��|�}|�krdS|rp|tk	rpz���|�}��|�}Wntk
rR�}YnX|�kr`dS|�k	rl|n|}���|�|�d��dS)N�rErJ)�_emptyZvisitZliteral_evalr�rZ)Z	name_nodeZdefault_noderErN�o)�	Parameterrr�rA�invalidrwrBr�r
r�p�s
z_signature_fromstr.<locals>.p)�	fillvaluer�r��r@)(r��_parameter_clsr��parse�SyntaxErrorrZModuler�r�ZbodyrAr	rLr�r�r�rJr�ZNodeTransformerrr'r4�	itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDrjr"Zvararg�VAR_POSITIONAL�KEYWORD_ONLYr�r(Zkw_defaultsr��VAR_KEYWORDr�rr�rV)rhr,r�r;r�r�r�Zprogramr�r(Zmodule_namerr'r4rr�rNrEZ_selfZself_isboundZ
self_ismoduler
)rrr�rArrwrrBr�rrr�_signature_fromstr�sp�











rcCsBt|�std�|���t|dd�}|s4td�|���t||||�S)zHPrivate helper function to get signature for
    builtin callables.
    z%{!r} is not a Python builtin function�__text_signature__Nz#no signature found for builtin {!r})r�r�r�rLr�r)rhr�r;r�r
r
r�_signature_from_builtin<s�r!c	CsHd}t|�s(t|�rd}ntd�|���t|dd�}|rFt||||�S|j}|j}|j}|j	}|j
}	|d|�}
|j}||||�}|j}
|j
}|j}|r�t|�}nd}g}||}|	}|
d|�D]<}|r�tnt}|
�|t�}|�||||d��|r�|d8}q�t|
|d��D]L\}}|�r&tnt}|
�|t�}|�||||||d	��|�r|d8}�q|jt@�r�|||}|
�|t�}|�|||td��|D]B}t}|dk	�r�|�|t�}|
�|t�}|�|||t|d	���q�|jt@�r2||}|jt@�r
|d7}||}|
�|t�}|�|||td��|||
�d
t�|d�S)zCPrivate helper: constructs Signature for the given python function.FTr�r Nr)rJrwr�)rJrwrEr=�r@�__validate_parameters__)rr�r�r�rLrrr&r r�co_posonlyargcountr!r�r�r�r�rDrFr�rrZrjr'r#rGrHr$rI)rhr�r;Zis_duck_functionr�rZ	func_codeZ	pos_countZ	arg_namesZ
posonly_countrvZkeyword_only_countZkeyword_onlyrMr4rNZpos_default_countrBZnon_default_countZposonly_leftrNrwrJ�offsetrEr�r
r
r�_signature_from_functionLs�

�

�
�

�
�
�r&)r:r;c
Cs�t|�std�|���t|tj�rDt|j|||d�}|r@t|�S|S|rtt	|dd�d�}t|tj�rtt||||d�Sz
|j
}Wntk
r�Yn&X|dk	r�t|t�s�td�|���|Sz
|j
}Wntk
r�Yn�Xt|tj��rdt|j|||d�}t||d�}t|j���d	}|jtjk�r(|St|j���}|�rN||d	k	�sNt�|f|}	|j|	d
�St|��sxt|��r�t|||d�St|��r�t|||d�St|tj��r�t|j|||d�}t||�Sd}t|t ��r�t!t |�d�}
|
dk	�rt|
|||d�}nJt!|d
�}|dk	�r(t||||d�}n$t!|d�}|dk	�rLt||||d�}|dk�rX|j"dd�D]>}
z
|
j#}Wntk
�r�YnX|�rdt$|||�S�qdt |j"k�rX|j%t&j%k�r�|j't&j'k�r�|�(t&�St)d�|���nrt|t*��sXt!t |�d�}
|
dk	�rXzt|
|||d�}Wn8t)k
�rV}zd�|�}t)|�|�W5d}~XYnX|dk	�rt|�rpt|�S|St|tj+��r�d�|�}t)|��t)d�|���dS)zQPrivate helper function to get signature for arbitrary
    callable objects.
    z{!r} is not a callable objectr9cSs
t|d�S)N�
__signature__r~rr
r
rrR�rSz*_signature_from_callable.<locals>.<lambda>rzNz1unexpected object {!r} in __signature__ attributerfrr�)r;�__call__�__new__r�r�z(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature),r�r�r�rrrr>r"r�r�r'r[r?�_partialmethodr#�
partialmethodr�r�rnrBrCrwrrr�rVrr�r&r�r!r�r
r�ryr rr�r	r)�
from_callabler�r�rA)r,r:r;r<rKr+r�Zfirst_wrapped_paramZ
sig_paramsr�Zcall�newZinitrPZtext_sigrLr}r
r
rr>�s
	��

��
�
�
�
��

�

�

�


�
�
�



r>c@seZdZdZdS)r�z1A private marker - used in Parameter & Signature.N�r�r�r�r�r
r
r
rr�t	sr�c@seZdZdZdS)rz6Marker object for Signature.empty and Parameter.empty.Nr.r
r
r
rrx	src@s4eZdZdZdZdZdZdZdd�Ze	dd	��Z
d
S)�_ParameterKindrr�r���cCs|jSrf)�_name_r�r
r
r�__str__�	sz_ParameterKind.__str__cCst|Srf)�_PARAM_NAME_MAPPINGr�r
r
r�description�	sz_ParameterKind.descriptionN)r�r�r�rrrrrr3rkr5r
r
r
rr/|	sr/zpositional-onlyzpositional or keywordzvariadic positionalrwzvariadic keywordc@s�eZdZdZdZeZeZe	Z
eZe
ZeZeed�dd�Zdd�Zdd	�Zed
d��Zedd
��Zedd��Zedd��Zeeeed�dd�Zdd�Zdd�Zdd�Zdd�ZdS)raRepresents a parameter in a function signature.

    Has the following public attributes:

    * name : str
        The name of the parameter as a string.
    * default : object
        The default value for the parameter if specified.  If the
        parameter has no default value, this attribute is set to
        `Parameter.empty`.
    * annotation
        The annotation for the parameter if specified.  If the
        parameter has no annotation, this attribute is set to
        `Parameter.empty`.
    * kind : str
        Describes how argument values are bound to the parameter.
        Possible values: `Parameter.POSITIONAL_ONLY`,
        `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
        `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
    )�_name�_kind�_default�_annotationr
cCszt|�|_Wn$tk
r2td|�d���YnX|tk	rd|jttfkrdd}|�|jj�}t|��||_||_	|tkr�td��t
|t�s�d�t|�j
�}t|��|ddkr�|dd���r�|jtkr�d	}|�|jj�}t|��t|_d
�|dd��}|���std�|���||_dS)Nzvalue z is not a valid Parameter.kindz({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {}rr�r�zLimplicit arguments must be passed as positional or keyword arguments, not {}z
implicit{}z"{!r} is not a valid parameter name)r/r7r�rrGrIr�r5r8r9rr�r
r�r��isdigitrFrD�isidentifierr6)r�rNrwrErJr}r
r
rr��	s6

�
zParameter.__init__cCs t|�|j|jf|j|jd�fS)N�r8r9)r
r6r7r8r9r�r
r
r�
__reduce__�	s
��zParameter.__reduce__cCs|d|_|d|_dS)Nr8r9r<�r��stater
r
r�__setstate__�	s
zParameter.__setstate__cCs|jSrf)r6r�r
r
rrN�	szParameter.namecCs|jSrf)r8r�r
r
rrE�	szParameter.defaultcCs|jSrf)r9r�r
r
rrJ�	szParameter.annotationcCs|jSrf)r7r�r
r
rrw�	szParameter.kind)rNrwrJrEcCsL|tkr|j}|tkr|j}|tkr*|j}|tkr8|j}t|�||||d�S)z+Creates a customized copy of the Parameter.r
)r�r6r7r9r8r
)r�rNrwrJrEr
r
rrV�	szParameter.replacecCs�|j}|j}|jtk	r(d�|t|j��}|jtk	rb|jtk	rPd�|t|j��}nd�|t|j��}|tkrtd|}n|t	kr�d|}|S)Nz{}: {}z{} = {}z{}={}r\r_)
rwr6r9rr�rWr8rUrGrI)r�rw�	formattedr
r
rr3
s
�


zParameter.__str__cCsd�|jj|�S)Nz	<{} "{}">�r�r�r�r�r
r
r�__repr__#
szParameter.__repr__cCst|j|j|j|jf�Srf)�hashrNrwrJrEr�r
r
r�__hash__&
szParameter.__hash__cCsJ||krdSt|t�stS|j|jkoH|j|jkoH|j|jkoH|j|jkS�NT)rr�NotImplementedr6r7r8r9�r��otherr
r
r�__eq__)
s

�
�
�zParameter.__eq__N)r�r�r�r�r�rDrrFrrGrrHrrIrrrAr�r=r@rkrNrErJrwr�rVr3rCrErJr
r
r
rr�	s6(



�rc@sheZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)�BoundArgumentsaResult of `Signature.bind` call.  Holds the mapping of arguments
    to the function's parameters.

    Has the following public attributes:

    * arguments : OrderedDict
        An ordered mutable mapping of parameters' names to arguments' values.
        Does not contain arguments' default values.
    * signature : Signature
        The Signature object that created this instance.
    * args : tuple
        Tuple of positional arguments values.
    * kwargs : dict
        Dict of keyword arguments values.
    )r��
_signature�__weakref__cCs||_||_dSrf)r�rL)r�r�r�r
r
rr�G
szBoundArguments.__init__cCs|jSrf)rLr�r
r
rr�K
szBoundArguments.signaturec	Cs~g}|jj��D]d\}}|jttfkr*qvz|j|}Wntk
rRYqvYqX|jtkrj|�	|�q|�
|�qt|�Srf)rLrBrKrwrIrHr�r�rG�extendrZrn)r�r'r�rOrer
r
rr'O
s
zBoundArguments.argsc	Cs�i}d}|jj��D]x\}}|sD|jttfkr4d}n||jkrDd}q|sJqz|j|}Wntk
rlYqX|jtkr�|�|�q|||<q|Sr�)	rLrBrKrwrIrHr�r��update)r��kwargsZkwargs_startedr�rOrer
r
rrPf
s&


zBoundArguments.kwargsc	Cs�|j}g}|jj��D]x\}}z|�|||f�Wqtk
r�|jtk	rV|j}n$|jt	krfd}n|jt
krvi}nYq|�||f�YqXqt|�|_dS)z�Set default values for missing arguments.

        For variable-positional arguments (*args) the default is an
        empty tuple.

        For variable-keyword arguments (**kwargs) the default is an
        empty dict.
        r
N)r�rLrBrKrZr�rErrwrGrIr)r�r�Z
new_argumentsrNrO�valr
r
r�apply_defaults�
s	


zBoundArguments.apply_defaultscCs2||krdSt|t�stS|j|jko0|j|jkSrF)rrKrGr�r�rHr
r
rrJ�
s

�zBoundArguments.__eq__cCs|d|_|d|_dS)NrLr��rLr�r>r
r
rr@�
s
zBoundArguments.__setstate__cCs|j|jd�S)NrSrSr�r
r
r�__getstate__�
szBoundArguments.__getstate__cCs@g}|j��D]\}}|�d�||��qd�|jjd�|��S)Nz{}={!r}z	<{} ({})>ri)r�rKrZr�r�r�r�)r�r'rerOr
r
rrC�
szBoundArguments.__repr__N)r�r�r�r�r�r�rkr�r'rPrRrJr@rTrCr
r
r
rrK4
s


rKc@s�eZdZdZdZeZeZe	Z
d,e	dd�dd�Zedd	��Z
ed
d��Zedd�d
d��Zedd��Zedd��Zeed�dd�Zdd�Zdd�Zdd�Zdd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdS)-r?aA Signature object represents the overall signature of a function.
    It stores a Parameter object for each parameter accepted by the
    function, as well as information specific to the function itself.

    A Signature object has the following public attributes and methods:

    * parameters : OrderedDict
        An ordered mapping of parameters' names to the corresponding
        Parameter objects (keyword-only arguments are in the same order
        as listed in `code.co_varnames`).
    * return_annotation : object
        The annotation for the return type of the function if specified.
        If the function has no annotation for its return type, this
        attribute is set to `Signature.empty`.
    * bind(*args, **kwargs) -> BoundArguments
        Creates a mapping from positional and keyword arguments to
        parameters.
    * bind_partial(*args, **kwargs) -> BoundArguments
        Creates a partial mapping from positional and keyword arguments
        to parameters (simulating 'functools.partial' behavior.)
    )�_return_annotation�_parametersNTr"cCs�|dkrt�}n�|r�t�}t}d}t|�D]�\}}|j}	|j}
|	|krdd}|�|j|	j�}t|��n|	|krtd}|	}|	ttfkr�|j	t
kr�|r�d}t|��nd}|
|kr�d�|
�}t|��|||
<q*ntdd�|D��}t�|�|_
||_dS)	z�Constructs Signature from the given list of Parameter
        objects and 'return_annotation'.  All arguments are optional.
        NFz7wrong parameter order: {} parameter before {} parameterz-non-default argument follows default argumentTzduplicate parameter name: {!r}css|]}|j|fVqdSrfr]�rgrOr
r
rris�z%Signature.__init__.<locals>.<genexpr>)rrDrjrwrNr�r5r�rFrErr�MappingProxyTyperVrU)r�rBr@r#r�Ztop_kindZ
kind_defaults�idxrOrwrNr}r
r
rr��
sD��



�zSignature.__init__cCstjdtdd�t||�S)z�Constructs Signature for the given python function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z_inspect.Signature.from_function() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r&�rhr�r
r
r�
from_functions
�zSignature.from_functioncCstjdtdd�t||�S)z�Constructs Signature for the given builtin function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z^inspect.Signature.from_builtin() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r!rZr
r
r�from_builtins
�zSignature.from_builtin��follow_wrappedcCst|||d�S)z3Constructs Signature for the given callable object.)r<r:)r>)rhr,r^r
r
rr,#s�zSignature.from_callablecCs|jSrf)rVr�r
r
rrB)szSignature.parameterscCs|jSrf�rUr�r
r
rr@-szSignature.return_annotation)rBr@cCs0|tkr|j��}|tkr |j}t|�||d�S)z�Creates a customized copy of the Signature.
        Pass 'parameters' and/or 'return_annotation' arguments
        to override them in the new copy.
        r)r�rBrCrUr
)r�rBr@r
r
rrV1s
�zSignature.replacecCs8tdd�|j��D��}dd�|j��D�}|||jfS)Ncss|]}|jtkr|VqdSrf)rwrHrWr
r
rriAs
�z(Signature._hash_basis.<locals>.<genexpr>cSsi|]}|jtkr|j|�qSr
)rwrHrNrWr
r
rr�Ds
�z)Signature._hash_basis.<locals>.<dictcomp>)rnrBrCr@)r�r��
kwo_paramsr
r
r�_hash_basis@szSignature._hash_basiscCs(|��\}}}t|���}t|||f�Srf)ra�	frozensetrCrD)r�r�r`r@r
r
rrEIszSignature.__hash__cCs*||krdSt|t�stS|��|��kSrF)rr?rGrarHr
r
rrJNs

zSignature.__eq__F�r�cCs�t�}t|j���}d}t|�}zt|�}Wn�tk
�rzt|�}	Wntk
rfYY�q�Yn�X|	jtkrzY�q�n�|	j|kr�|	jt	kr�d}
|
j
|	jd�}
t|
�d�|	f}Y�q�nP|	jtks�|	j
tk	r�|	f}Y�q�n.|r�|	f}Y�q�nd}
|
j
|	jd�}
t|
�d�Yq Xzt|�}	Wn tk
�r:td�d�Yq X|	jttfk�rVtd�d�|	jtk�r�|g}|�|�t|�||	j<�q�|	j|k�r�|	jt	k�r�tdj
|	jd��d�|||	j<q d}t�||�D]�}	|	jtk�r�|	}�q�|	jtk�r�q�|	j}
z|�|
�}WnFtk
�rN|�sJ|	jtk�rJ|	j
tk�rJtdj
|
d��d�Yn(X|	jt	k�rntdj
|	jd���|||
<�q�|�r�|dk	�r�|||j<ntdj
tt|��d���|�||�S)	z#Private method. Don't use directly.r
zA{arg!r} parameter is positional only, but was passed as a keyword)reNz$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rrrBrCr��
StopIterationrwrGrNrDr�r�rIrErrHrNrnr�chainr�r��_bound_arguments_cls)r�r'rPr�r�rBZ
parameters_exZarg_valsZarg_valrOr}rCZkwargs_paramr�r
r
r�_bindUs�




���
�������

��zSignature._bindcOs|�||�S)z�Get a BoundArguments object, that maps the passed `args`
        and `kwargs` to the function's signature.  Raises `TypeError`
        if the passed arguments can not be bound.
        �rg�r�r'rPr
r
r�bind�szSignature.bindcOs|j||dd�S)z�Get a BoundArguments object, that partially maps the
        passed `args` and `kwargs` to the function's signature.
        Raises `TypeError` if the passed arguments can not be bound.
        Trcrhrir
r
rr��szSignature.bind_partialcCs t|�t|j���fd|jifS�NrU)r
rnrVrCrUr�r
r
rr=�s�zSignature.__reduce__cCs|d|_dSrkr_r>r
r
rr@�szSignature.__setstate__cCsd�|jj|�S)Nz<{} {}>rBr�r
r
rrC�szSignature.__repr__c	Cs�g}d}d}|j��D]d}t|�}|j}|tkr6d}n|rH|�d�d}|tkrVd}n|tkrp|rp|�d�d}|�|�q|r�|�d�d�d�	|��}|j
tk	r�t|j
�}|d�|�7}|S)NFTr�r\z({})riz -> {})
rBrCr�rwrDrZrGrHr�r�r@rrW)	r�ruZrender_pos_only_separatorZrender_kw_only_separatorrOrArwZrenderedZannor
r
rr3�s0




zSignature.__str__)N)r�r�r�r�r�rrrKrfrrAr�rsr[r\r,rkrBr@r�rVrarErJrgrjr�r=r@rCr3r
r
r
rr?�
s<�7



	r?r]cCstj||d�S)z/Get a signature object for the passed callable.r])r?r,)r,r^r
r
rr�sr�c
Cs�ddl}ddl}|��}|jddd�|jdddd	d
�|��}|j}|�d�\}}}z|�|�}}	WnNtk
r�}
z0d�	|t
|
�j|
�}t|t
jd
�t
�d�W5d}
~
XYnX|r�|�d�}|	}|D]}
t||
�}q�|	jt
jk�rtdt
jd
�t
�d�|j�r�td�	|��td�	t|	���td�	|	j��||	k�rxtd�	t|	j���t|	d��r�td�	|	j��n6zt|�\}}Wntk
�r�YnXtd�	|��td�ntt|��dS)z6 Logic for inspecting an object given at command line rNr	zCThe object to be analysed. It supports the 'module:qualname' syntax)�helpz-dz	--details�
store_truez9Display info about the module rather than its source code)�actionrlr�zFailed to import {} ({}: {}))r�r�r�z#Can't get info for builtin modules.r�z
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r�)�argparser��ArgumentParser�add_argument�
parse_argsr	�	partition�
import_moduleror�r
r��printr��stderr�exitr�rL�builtin_module_namesZdetailsr��
__cached__rUr�rror�r)rpr��parserr'�targetZmod_nameZ	has_attrs�attrsr,r�rvr}�parts�part�__r�r
r
r�_main$s`���



r�r�)N)N)N)F)N)r�)r�)r�)r�)r�)r
)T)T)T)�r��
__author__r8�disZcollections.abcr7�enum�importlib.machineryr�rr�r�r�r�rrrr0r#r��operatorrrr�globalsZmod_dictZCOMPILER_FLAG_NAMESrKrbrcrGrrrrrrrr rr*r-r.r/r1r3r5r:r<r>r@rBrCrQrdrerxrVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ror�r�rrrrrrr,r-r7r8r3rPrSrWrZr�rprsr|r~r�r�r�r�r�r��_fieldsr�r�r�r�r�r�r	r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r(Z_WrapperDescriptor�allZ_MethodWrapperrrJZ_ClassMethodWrapperrAr�r�r�r�r�r�r�r�rr!r&r>r�r�IntEnumr/rrDrrFrrGrrHrrIr4rrKr?r�r�r�r
r
r
r�<module>sz	




	
,
t$
>
	
.N->




�]


	�
;�
<
5

 



		0

�
LH
_�K�	k:
cmd.cpython-38.pyc000064400000030524151450073350007746 0ustar00U

e5d:�@s@dZddlZddlZdgZdZejejdZGdd�d�ZdS)a	A generic class to build line-oriented command interpreters.

Interpreters constructed with this class obey the following conventions:

1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
   of characters in the identchars member.
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
   is passed a single argument consisting of the remainder of the line.
4. Typing an empty line repeats the last command.  (Actually, it calls the
   method `emptyline', which may be overridden in a subclass.)
5. There is a predefined `help' method.  Given an argument `topic', it
   calls the command `help_topic'.  With no arguments, it lists all topics
   with defined help_ functions, broken into up to three topics; documented
   commands, miscellaneous help topics, and undocumented commands.
6. The command '?' is a synonym for `help'.  The command '!' is a synonym
   for `shell', if a do_shell method exists.
7. If completion is enabled, completing commands will be done automatically,
   and completing of commands args is done by calling complete_foo() with
   arguments text, line, begidx, endidx.  text is string we are matching
   against, all returned matches must begin with it.  line is the current
   input line (lstripped), begidx and endidx are the beginning and end
   indexes of the text being matched, which could be used to provide
   different completion depending upon which position the argument is in.

The `default' method may be overridden to intercept commands for which there
is no do_ method.

The `completedefault' method may be overridden to intercept completions for
commands that have no complete_ method.

The data member `self.ruler' sets the character used to draw separator lines
in the help messages.  If empty, no ruler line is drawn.  It defaults to "=".

If the value of `self.intro' is nonempty when the cmdloop method is called,
it is printed out on interpreter startup.  This value may be overridden
via an optional argument to the cmdloop() method.

The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.
�N�Cmdz(Cmd) �_c@s�eZdZdZeZeZdZdZ	dZ
dZdZdZ
dZdZd	Zd0dd�Zd1d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Z d+d,�Z!d2d.d/�Z"dS)3raA simple framework for writing line-oriented command interpreters.

    These are often useful for test harnesses, administrative tools, and
    prototypes that will later be wrapped in a more sophisticated interface.

    A Cmd instance or subclass instance is a line-oriented interpreter
    framework.  There is no good reason to instantiate Cmd itself; rather,
    it's useful as a superclass of an interpreter class you define yourself
    in order to inherit Cmd's methods and encapsulate action methods.

    �=�Nz(Documented commands (type help <topic>):zMiscellaneous help topics:zUndocumented commands:z*** No help on %s��tabcCs@|dk	r||_ntj|_|dk	r(||_ntj|_g|_||_dS)a�Instantiate a line-oriented interpreter framework.

        The optional argument 'completekey' is the readline name of a
        completion key; it defaults to the Tab key. If completekey is
        not None and the readline module is available, command completion
        is done automatically. The optional arguments stdin and stdout
        specify alternate input and output file objects; if not specified,
        sys.stdin and sys.stdout are used.

        N)�stdin�sys�stdout�cmdqueue�completekey)�selfrrr
�r�/usr/lib64/python3.8/cmd.py�__init__LszCmd.__init__cCs�|��|jr\|jr\z2ddl}|��|_|�|j�|�|jd�Wnt	k
rZYnXz�|dk	rl||_
|j
r�|j�t
|j
�d�d}|�s4|jr�|j�d�}nl|jr�zt|j�}Wntk
r�d}YnXn<|j�|j�|j��|j��}t|��sd}n
|�d�}|�|�}|�|�}|�||�}q�|��W5|j�r�|j�r�zddl}|�|j�Wnt	k
�r~YnXXdS)z�Repeatedly issue a prompt, accept input, parse an initial prefix
        off the received input, and dispatch to action methods, passing them
        the remainder of the line as argument.

        rNz
: complete�
�EOFz
)�preloop�use_rawinputr�readlineZ
get_completerZ
old_completerZ
set_completer�complete�parse_and_bind�ImportError�intror
�write�strr�pop�input�prompt�EOFError�flushr�len�rstrip�precmd�onecmd�postcmd�postloop)r
rr�stop�linerrr�cmdloopbsN






zCmd.cmdloopcCs|S)z�Hook method executed just before the command line is
        interpreted, but after the input prompt is generated and issued.

        r�r
r(rrrr#�sz
Cmd.precmdcCs|S)z?Hook method executed just after a command dispatch is finished.r)r
r'r(rrrr%�szCmd.postcmdcCsdS)z>Hook method executed once when the cmdloop() method is called.Nr�r
rrrr�szCmd.preloopcCsdS)zYHook method executed once when the cmdloop() method is about to
        return.

        Nrr+rrrr&�szCmd.postloopcCs�|��}|sdd|fS|ddkr4d|dd�}n2|ddkrft|d�r\d|dd�}n
dd|fSdt|�}}||kr�|||jkr�|d}qt|d|�||d���}}|||fS)	z�Parse the line into a command name and a string containing
        the arguments.  Returns a tuple containing (command, args, line).
        'command' and 'args' may be None if the line couldn't be parsed.
        Nr�?zhelp r�!Zdo_shellzshell )�strip�hasattrr!�
identchars)r
r(�i�n�cmd�argrrr�	parseline�s



z
Cmd.parselinecCs�|�|�\}}}|s|��S|dkr.|�|�S||_|dkrBd|_|dkrT|�|�Szt|d|�}Wntk
r�|�|�YSX||�SdS)ahInterpret the argument as though it had been typed in response
        to the prompt.

        This may be overridden, but should not normally need to be;
        see the precmd() and postcmd() methods for useful execution hooks.
        The return value is a flag indicating whether interpretation of
        commands by the interpreter should stop.

        Nrr�do_)r5�	emptyline�default�lastcmd�getattr�AttributeError)r
r(r3r4�funcrrrr$�s


z
Cmd.onecmdcCs|jr|�|j�SdS)z�Called when an empty line is entered in response to the prompt.

        If this method is not overridden, it repeats the last nonempty
        command entered.

        N)r9r$r+rrrr7�sz
Cmd.emptylinecCs|j�d|�dS)z�Called on an input line when the command prefix is not recognized.

        If this method is not overridden, it prints an error message and
        returns.

        z*** Unknown syntax: %s
N)r
rr*rrrr8�szCmd.defaultcGsgS)z�Method called to complete an input line when no command-specific
        complete_*() method is available.

        By default, it returns an empty list.

        r)r
�ignoredrrr�completedefault�szCmd.completedefaultcsd|��fdd�|��D�S)Nr6cs"g|]}|���r|dd��qS)�N��
startswith��.0�a�Zdotextrr�
<listcomp>�s
z%Cmd.completenames.<locals>.<listcomp>)�	get_names)r
�textr=rrEr�
completenames�szCmd.completenamesc
Cs�|dkr�ddl}|��}|��}t|�t|�}|��|}|��|}|dkr�|�|�\}	}
}|	dkrp|j}q�zt|d|	�}Wq�t	k
r�|j}Yq�Xn|j
}|||||�|_z|j|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        rNrZ	complete_)
rZget_line_buffer�lstripr!Z
get_begidxZ
get_endidxr5r>r:r;rIZcompletion_matches�
IndexError)
r
rH�staterZorigliner(�strippedZbegidxZendidxr3�argsZfooZcompfuncrrrr�s*zCmd.completecCs
t|j�S)N)�dir�	__class__r+rrrrGsz
Cmd.get_namescs4t|j���}t�fdd�|��D��}t||B�S)Nc3s,|]$}|�d�d�r|dd�VqdS)�help_r�Nr@rB�rNrr�	<genexpr> s�z$Cmd.complete_help.<locals>.<genexpr>)�setrIrG�list)r
rNZcommandsZtopicsrrSr�
complete_helpszCmd.complete_helpcCs�|r�zt|d|�}Wn|tk
r�z4t|d|�j}|rX|j�dt|��WYdSWntk
rnYnX|j�dt|j|f��YdSX|��n|��}g}g}i}|D]$}|dd�dkr�d||dd�<q�|��d}	|D]p}|dd�dkr�||	k�rq�|}	|dd�}
|
|k�r8|�	|
�||
=q�t||�j�rR|�	|
�q�|�	|
�q�|j�dt|j
��|�|j|d	d
�|�|j
t|���d	d
�|�|j|d	d
�dS)zEList available commands with "help" or detailed help with "help cmd".rQr6�%s
NrRrrr?��P)r:r;�__doc__r
rr�nohelprG�sort�append�
doc_leader�print_topics�
doc_header�misc_headerrV�keys�undoc_header)r
r4r<�doc�namesZcmds_docZ
cmds_undoc�help�nameZprevnamer3rrr�do_help$sN



zCmd.do_helpcCs\|rX|j�dt|��|jr<|j�dt|jt|���|�||d�|j�d�dS)NrXrr)r
rr�rulerr!�	columnize)r
�headerZcmdsZcmdlenZmaxcolrrrr`RszCmd.print_topicsrZcs��s|j�d�dS�fdd�tt���D�}|rJtdd�tt|����t��}|dkrv|j�dt�d	��dStdt���D]�}||d|}g}d
}t|�D]h}	d	}
t|�D]2}|||	}||kr�q�|}
t|
t|
��}
q�|�	|
�||
d7}||kr��qq�||kr��q4q�t��}d}d	g}t|�D]�}g}t|�D]4}	|||	}||k�rld}
n�|}
|�	|
��qL|�r�|d
�s�|d
=�q�tt|��D]}	||	�
||	�||	<�q�|j�dtd�|����q<dS)z�Display a list of strings as a compact set of columns.

        Each column is only as wide as necessary.
        Columns are separated by two spaces (one was not legible enough).
        z<empty>
Ncsg|]}t�|t�s|�qSr)�
isinstancer)rCr1�rVrrrFds�z!Cmd.columnize.<locals>.<listcomp>z list[i] not a string for i in %sz, rrXr����r���z  )r
r�ranger!�	TypeError�join�mapr�maxr^�ljust)r
rVZdisplaywidthZ
nonstrings�sizeZnrowsZncolsZ	colwidthsZtotwidth�colZcolwidth�rowr1�xZtextsrrnrrkZs\�


z
Cmd.columnize)rNN)N)rZ)#�__name__�
__module__�__qualname__r[�PROMPTr�
IDENTCHARSr0rjr9rr_rarbrdr\rrr)r#r%rr&r5r$r7r8r>rIrrGrWrir`rkrrrrr4s<

4
		.)	r[�stringr	�__all__rZ
ascii_lettersZdigitsr�rrrrr�<module>s
,mimetypes.cpython-38.pyc000064400000037241151450073350011222 0ustar00U

e5d�T�
@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddg
Z	dddddddddg	Z
dadaGdd�d�Z
d&dd�Zd'dd�Zd(dd�Zd)dd	�Zd*dd
�Zd d�Zd!d"�Ze�d#d$�Zed%kr�e�dS)+a�Guess the MIME type of a file.

This module defines two useful functions:

guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.

guess_extension(type, strict=True) -- guess the extension for a given MIME type.

It also contains the following, for tuning the behavior:

Data:

knownfiles -- list of files to parse
inited -- flag set when init() has been called
suffix_map -- dictionary mapping suffixes to suffixes
encodings_map -- dictionary mapping suffixes to encodings
types_map -- dictionary mapping suffixes to types

Functions:

init([files]) -- parse a list of files, default knownfiles (on Windows, the
  default values are taken from the registry)
read_mime_types(file) -- parse one file, return a dictionary or None
�N�
knownfiles�inited�	MimeTypes�
guess_type�guess_all_extensions�guess_extension�add_type�init�read_mime_types�
suffix_map�
encodings_map�	types_map�common_typesz/etc/mime.typesz/etc/httpd/mime.typesz/etc/httpd/conf/mime.typesz/etc/apache/mime.typesz/etc/apache2/mime.typesz$/usr/local/etc/httpd/conf/mime.typesz"/usr/local/lib/netscape/mime.typesz/usr/local/etc/mime.typesFc@s`eZdZdZddd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	ddd�Z
ddd�ZdS)rz�MIME-types datastore.

    This datastore can handle information from mime.types-style files
    and supports basic determination of MIME type from a filename or
    URL, and can guess a reasonable extension given a MIME type.
    �TcCs�ts
t�t��|_t��|_iif|_iif|_t	�
�D]\}}|�||d�q:t�
�D]\}}|�||d�qZ|D]}|�
||�qvdS�NTF)rr	�_encodings_map_default�copyr�_suffix_map_defaultrr
�
types_map_inv�_types_map_default�itemsr�_common_types_default�read)�self�	filenames�strict�ext�type�namerr�!/usr/lib64/python3.8/mimetypes.py�__init__Bs



zMimeTypes.__init__cCs6||j||<|j|�|g�}||kr2|�|�dS)a�Add a mapping between a type and an extension.

        When the extension is already known, the new
        type will replace the old one. When the type
        is already known the extension will be added
        to the list of known extensions.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        N)r
r�
setdefault�append)rrrrZextsrrrrPszMimeTypes.add_typecCsrt�|�}tj�|�\}}|dkr�|�d�}|dkr8dS|�dd|�}|dkr\|d|�}n|d|�}d|ksxd|kr|d	}|dfSt�|�\}}||jkr�t�||j|�\}}q�||j	kr�|j	|}	t�|�\}}nd}	|j
d
}
||
kr�|
||	fS|��|
k�r|
|��|	fS|�r(d|	fS|j
d}
||
k�rH|
||	fS|��|
k�rf|
|��|	fSd|	fSdS)aUGuess the type of a file which is either a URL or a path-like object.

        Return value is a tuple (type, encoding) where type is None if
        the type can't be guessed (no or unknown suffix) or a string
        of the form type/subtype, usable for a MIME Content-type
        header; and encoding is None for no encoding or the name of
        the program used to encode (e.g. compress or gzip).  The
        mappings are table driven.  Encoding suffixes are case
        sensitive; type suffixes are first tried case sensitive, then
        case insensitive.

        The suffixes .tgz, .taz and .tz (case sensitive!) are all
        mapped to '.tar.gz'.  (This is table-driven too, using the
        dictionary suffix_map.)

        Optional `strict' argument when False adds a bunch of commonly found,
        but non-standard types.
        �data�,r)NN�;N�=�/�
text/plainTF)�os�fspath�urllib�parseZ
_splittype�find�	posixpath�splitextrrr
�lower)r�urlrZschemeZcommaZsemir�baser�encodingr
rrrrasB







zMimeTypes.guess_typecCsL|��}|jd�|g�}|sH|jd�|g�D]}||kr0|�|�q0|S)a�Guess the extensions for a file based on its MIME type.

        Return value is a list of strings giving the possible filename
        extensions, including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data stream,
        but would be mapped to the MIME type `type' by guess_type().

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        TF)r0r�getr")rrr�
extensionsrrrrr�szMimeTypes.guess_all_extensionscCs|�||�}|sdS|dS)aGuess the extension for a file based on its MIME type.

        Return value is a string giving a filename extension,
        including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data
        stream, but would be mapped to the MIME type `type' by
        guess_type().  If no extension can be guessed for `type', None
        is returned.

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        Nr)r)rrrr5rrrr�s
zMimeTypes.guess_extensionc	Cs(t|dd��}|�||�W5QRXdS)z�
        Read a single mime.types-format file, specified by pathname.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        �utf-8�r3N)�open�readfp)r�filenamer�fprrrr�szMimeTypes.readc	Cs�|��}|sq�|��}tt|��D]"}||ddkr"||d�=qFq"|sLq|d|dd�}}|D]}|�|d||�qfqdS)z�
        Read a single mime.types-format file.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        r�#N��.)�readline�split�range�lenr)	rr;r�lineZwords�ir�suffixesZsuffrrrr9�s	
zMimeTypes.readfpcCs�tsdSdd�}t�tjd���}||�D]�}zjt�||��T}|�d�sTW5QR�Wq(t�|d�\}}|tjkr|W5QR�Wq(|�|||�W5QRXWq(tk
r�Yq(Yq(Xq(W5QRXdS)z�
        Load the MIME types database from Windows registry.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        NcssJd}zt�||�}Wntk
r,YqFYnXd|kr<|V|d7}qdS)Nr�r=)�_winregZEnumKey�OSError)ZmimedbrDZctyperrr�
enum_types�s
z3MimeTypes.read_windows_registry.<locals>.enum_types�r>zContent Type)rG�OpenKeyZHKEY_CLASSES_ROOT�
startswithZQueryValueExZREG_SZrrH)rrrIZhkcrZ
subkeynameZsubkeyZmimetypeZdatatyperrr�read_windows_registry�s$

�
zMimeTypes.read_windows_registryN)rT)T)T)T)T)T)T)T)�__name__�
__module__�__qualname__�__doc__r rrrrrr9rMrrrrr:s


?



TcCstdkrt�t�||�S)a�Guess the type of a file based on its URL.

    Return value is a tuple (type, encoding) where type is None if the
    type can't be guessed (no or unknown suffix) or a string of the
    form type/subtype, usable for a MIME Content-type header; and
    encoding is None for no encoding or the name of the program used
    to encode (e.g. compress or gzip).  The mappings are table
    driven.  Encoding suffixes are case sensitive; type suffixes are
    first tried case sensitive, then case insensitive.

    The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped
    to ".tar.gz".  (This is table-driven too, using the dictionary
    suffix_map).

    Optional `strict' argument when false adds a bunch of commonly found, but
    non-standard types.
    N)�_dbr	r)r1rrrrrscCstdkrt�t�||�S)a�Guess the extensions for a file based on its MIME type.

    Return value is a list of strings giving the possible filename
    extensions, including the leading dot ('.').  The extension is not
    guaranteed to have been associated with any particular data
    stream, but would be mapped to the MIME type `type' by
    guess_type().  If no extension can be guessed for `type', None
    is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	r�rrrrrr's
cCstdkrt�t�||�S)a�Guess the extension for a file based on its MIME type.

    Return value is a string giving a filename extension, including the
    leading dot ('.').  The extension is not guaranteed to have been
    associated with any particular data stream, but would be mapped to the
    MIME type `type' by guess_type().  If no extension can be guessed for
    `type', None is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	rrSrrrr8scCstdkrt�t�|||�S)aiAdd a mapping between a type and an extension.

    When the extension is already known, the new
    type will replace the old one. When the type
    is already known the extension will be added
    to the list of known extensions.

    If strict is true, information will be added to
    list of standard types, else to the list of non-standard
    types.
    N)rRr	r)rrrrrrrHscCs�da|dkstdkrBt�}tr&|��|dkr4t}qFtt|�}nt}|D]}tj�	|�rJ|�
|�qJ|ja|ja|j
da
|j
da|adSr)rrRrrGrMr�listr)�path�isfilerrrr
r)�files�db�filerrrr	Ys"

c
Cs`zt|dd�}Wntk
r&YdSX|�*t�}|�|d�|jdW5QR�SQRXdS)Nr6r7T)r8rHrr9r
)rY�frXrrrr
usc�CsXddddddd�aadddd	d
�aadddd
ddddddddddddddddddddddddddddddddddd d!d!d"d"d#d$d$d%d&d'd(d)d*d+d,d-d-d.d.d.d/d0d1d2d3d4d4d4d4d5d6d6d7d7d8d8d8d9d:d;d<d=d>d>d>d?d@dAdAdBdCdDdEdFdGdHdIdJdKdLdMdMdMdMdNdOdPdPdQdQdQdQdQdQdRdSdTdUdVdVdWdXdYdZdZdZdZdZd[d[d\d]d^d_��aad`dadadbdcdcdcddde�aadS)fNz.svg.gzz.tar.gzz.tar.bz2z.tar.xz)z.svgzz.tgzz.tazz.tzz.tbz2z.txzZgzip�compressZbzip2Zxz)z.gzz.Zz.bz2z.xzzapplication/javascriptzapplication/jsonzapplication/manifest+jsonzapplication/mswordzapplication/octet-streamzapplication/odazapplication/pdfzapplication/pkcs7-mimezapplication/postscriptzapplication/vnd.apple.mpegurlzapplication/vnd.ms-excelzapplication/vnd.ms-powerpointzapplication/wasmzapplication/x-bcpiozapplication/x-cpiozapplication/x-cshzapplication/x-dvizapplication/x-gtarzapplication/x-hdfzapplication/x-hdf5zapplication/x-latexzapplication/x-mifzapplication/x-netcdfzapplication/x-pkcs12zapplication/x-pn-realaudiozapplication/x-python-codezapplication/x-shzapplication/x-sharzapplication/x-shockwave-flashzapplication/x-sv4cpiozapplication/x-sv4crczapplication/x-tarzapplication/x-tclzapplication/x-texzapplication/x-texinfozapplication/x-troffzapplication/x-troff-manzapplication/x-troff-mezapplication/x-troff-mszapplication/x-ustarzapplication/x-wais-sourcezapplication/xmlzapplication/zipzaudio/basicz
audio/mpegzaudio/x-aiffzaudio/x-pn-realaudiozaudio/x-wavz	image/bmpz	image/gifz	image/iefz
image/jpegz	image/pngz
image/svg+xmlz
image/tiffzimage/vnd.microsoft.iconzimage/x-cmu-rasterzimage/x-ms-bmpzimage/x-portable-anymapzimage/x-portable-bitmapzimage/x-portable-graymapzimage/x-portable-pixmapzimage/x-rgbzimage/x-xbitmapzimage/x-xpixmapzimage/x-xwindowdumpzmessage/rfc822ztext/cssztext/csvz	text/htmlr(z
text/richtextztext/tab-separated-valuesz
text/x-pythonz
text/x-setextztext/x-sgmlztext/x-vcardztext/xmlz	video/mp4z
video/mpegzvideo/quicktimez
video/webmzvideo/x-msvideozvideo/x-sgi-movie)�z.jsz.mjsz.jsonz.webmanifestz.docz.dotz.wizz.binz.az.dllz.exez.oz.objz.soz.odaz.pdfz.p7cz.psz.aiz.epsz.m3uz.m3u8z.xlsz.xlbz.pptz.potz.ppaz.ppsz.pwzz.wasmz.bcpioz.cpioz.cshz.dviz.gtarz.hdfz.h5z.latexz.mifz.cdfz.ncz.p12z.pfxz.ramz.pycz.pyoz.shz.sharz.swfz.sv4cpioz.sv4crcz.tarz.tclz.texz.texiz.texinfoz.roffz.tz.trz.manz.mez.msz.ustarz.srcz.xslz.rdfz.wsdlz.xpdlz.zipz.auz.sndz.mp3z.mp2z.aifz.aifcz.aiffz.raz.wav�.bmpz.gifz.ief�.jpgz.jpez.jpegz.pngz.svgz.tiffz.tifz.icoz.rasr\z.pnmz.pbmz.pgmz.ppmz.rgbz.xbmz.xpmz.xwdz.emlz.mhtz.mhtmlz.nwsz.cssz.csvz.htmlz.htmz.txtz.batz.cz.hz.kshz.plz.rtxz.tsvz.pyz.etxz.sgmz.sgmlz.vcfz.xmlz.mp4z.mpegz.m1vz.mpaz.mpez.mpgz.movz.qtz.webmz.aviz.moviezapplication/rtfz
audio/midiz	image/jpgz
image/pictztext/xul)z.rtfz.midiz.midr]z.pictz.pctz.picz.xul)rrrrr
rrrrrrr�_default_mime_types�s8�

�
��

�r^c
sddl}d�d�fdd�	}z&|�tjdd�ddd	d
g�\}}Wn.|jk
rn}z|d|�W5d}~XYnXd}d}|D]4\}}|dkr�|d�q||dkr�d}q||d
kr|d}q||D]Z}	|r�t|	|�}
|
s�td|	�nt|
�q�t|	|�\}
}|
�std|	�q�td|
d|�q�dS)Nra4Usage: mimetypes.py [options] type

Options:
    --help / -h       -- print this message and exit
    --lenient / -l    -- additionally search of some common, but non-standard
                         types.
    --extension / -e  -- guess extension instead of type

More than one type argument may be given.
rJcs"t��|rt|�t�|�dS)N)�print�sys�exit)�code�msg�ZUSAGErr�usageFsz_main.<locals>.usager=Zhle�helpZlenient�	extension)z-hz--help)z-lz	--lenient)z-ez--extensionz I don't know anything about typeztype:z	encoding:)rJ)�getoptr`�argv�errorrr_r)rhreZopts�argsrcrrg�opt�argZgtypeZguessr3rrdr�_main7s8�


rn�__main__)T)T)T)T)N)rQr)r`r.Zurllib.parser+�winregrG�ImportError�__all__rrrRrrrrrr	r
r^rnrNrrrr�<module>s`
��W




5.contextlib.cpython-38.opt-2.pyc000064400000034406151450073350012321 0ustar00U

e5d�a�@sfddlZddlZddlZddlmZddlmZddlmZddddd	d
ddd
dddgZ	Gdd	�d	ej
�ZGdd
�d
ej
�ZGdd�de
�ZGdd�d�ZGdd�deee�ZGdd�dee�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d#�d#�ZGd$d
�d
ee�ZGd%d�dee�ZGd&d�de�ZdS)'�N)�deque��wraps��
MethodType�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppressc@s.eZdZdd�Zejdd��Zedd��ZdS)rcCs|S�N���selfrr�"/usr/lib64/python3.8/contextlib.py�	__enter__sz AbstractContextManager.__enter__cCsdSrr�r�exc_type�	exc_value�	tracebackrrr�__exit__szAbstractContextManager.__exit__cCs|tkrt�|dd�StS)Nrr)r�_collections_abc�_check_methods�NotImplemented��cls�Crrr�__subclasshook__sz'AbstractContextManager.__subclasshook__N)	�__name__�
__module__�__qualname__r�abc�abstractmethodr�classmethodr$rrrrrs

c@s.eZdZdd�Zejdd��Zedd��ZdS)rc�s|Srrrrrr�
__aenter__'sz&AbstractAsyncContextManager.__aenter__c�sdSrrrrrr�	__aexit__+sz%AbstractAsyncContextManager.__aexit__cCs|tkrt�|dd�StS)Nr+r,)rrrr r!rrrr$0s
�z,AbstractAsyncContextManager.__subclasshook__N)	r%r&r'r+r(r)r,r*r$rrrrr#s

c@seZdZdd�Zdd�ZdS)rcCs|Srrrrrr�_recreate_cm;s
zContextDecorator._recreate_cmcst����fdd��}|S)Nc
s*�����||�W5QR�SQRXdSr)r-��args�kwds��funcrrr�innerHs
z(ContextDecorator.__call__.<locals>.innerr)rr2r3rr1r�__call__GszContextDecorator.__call__N)r%r&r'r-r4rrrrr8sc@seZdZdd�ZdS)�_GeneratorContextManagerBasecCsJ|||�|_||||_|_|_t|dd�}|dkr@t|�j}||_dS)N�__doc__)�genr2r/r0�getattr�typer6)rr2r/r0�docrrr�__init__Rs
z%_GeneratorContextManagerBase.__init__N)r%r&r'r;rrrrr5Osr5c@s$eZdZdd�Zdd�Zdd�ZdS)�_GeneratorContextManagercCs|�|j|j|j�Sr)�	__class__r2r/r0rrrrr-fsz%_GeneratorContextManager._recreate_cmcCs<|`|`|`zt|j�WStk
r6td�d�YnXdS�Nzgenerator didn't yield)r/r0r2�nextr7�
StopIteration�RuntimeErrorrrrrrls
z"_GeneratorContextManager.__enter__c
Cs|dkr8zt|j�Wntk
r,YdSXtd��n�|dkrF|�}z|j�|||�Wn�tk
r�}z||k	WY�Sd}~XYnttk
r�}z4||kr�WY�&dS|tkr�|j|kr�WY�
dS�W5d}~XYn$t��d|kr�YdS�YnXtd��dS)NF�generator didn't stop�z#generator didn't stop after throw())r?r7r@rA�throw�	__cause__�sys�exc_info)rr9�valuer�excrrrrus.


z!_GeneratorContextManager.__exit__N)r%r&r'r-rrrrrrr<as	r<c@seZdZdd�Zdd�ZdS)�_AsyncGeneratorContextManagerc�s6z|j��IdHWStk
r0td�d�YnXdSr>)r7�	__anext__�StopAsyncIterationrArrrrr+�sz(_AsyncGeneratorContextManager.__aenter__c
�s&|dkr>z|j��IdHWntk
r2YdSXtd��n�|dkrL|�}z"|j�|||�IdHtd��Wn�tk
r�}z||k	WY�Sd}~XYn�tk
r�}z:||kr�WY�,dSt|ttf�r�|j|kr�WY�
dS�W5d}~XYn0tk
�r }z||k	�r�W5d}~XYnXdS)NrBz$generator didn't stop after athrow()F)	r7rKrLrA�athrow�
isinstancer@rE�
BaseException)r�typrHrrIrrrr,�s.




z'_AsyncGeneratorContextManager.__aexit__N)r%r&r'r+r,rrrrrJ�srJcst���fdd��}|S)Ncst�||�Sr)r<r.�r2rr�helper�szcontextmanager.<locals>.helperr�r2rRrrQrr�scst���fdd��}|S)Ncst�||�Sr)rJr.rQrrrRsz#asynccontextmanager.<locals>.helperrrSrrQrr�sc@s$eZdZdd�Zdd�Zdd�ZdS)r	cCs
||_dSr��thing)rrUrrrr;&szclosing.__init__cCs|jSrrTrrrrr(szclosing.__enter__cGs|j��dSr)rU�close)rrGrrrr*szclosing.__exit__N�r%r&r'r;rrrrrrr	sc@s(eZdZdZdd�Zdd�Zdd�ZdS)�_RedirectStreamNcCs||_g|_dSr)�_new_target�_old_targets)r�
new_targetrrrr;2sz_RedirectStream.__init__cCs*|j�tt|j��tt|j|j�|jSr)rZ�appendr8rF�_stream�setattrrYrrrrr7sz_RedirectStream.__enter__cCstt|j|j���dSr)r^rFr]rZ�pop�r�exctype�excinst�exctbrrrr<sz_RedirectStream.__exit__)r%r&r'r]r;rrrrrrrX.srXc@seZdZdZdS)r�stdoutN�r%r&r'r]rrrrr@s
c@seZdZdZdS)r�stderrNrerrrrrPsc@s$eZdZdd�Zdd�Zdd�ZdS)rcGs
||_dSr)�_exceptions)r�
exceptionsrrrr;aszsuppress.__init__cCsdSrrrrrrrdszsuppress.__enter__cCs|dk	ot||j�Sr)�
issubclassrgr`rrrrgs
zsuppress.__exit__NrWrrrrrVsc@sdeZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
de
_dd�Zddd�Z
dS)�_BaseExitStackcCs
t||�Srr��cm�cm_exitrrr�_create_exit_wrapperwsz#_BaseExitStack._create_exit_wrappercs���fdd�}|S)Ncs����dSrr�rrI�tb�r/�callbackr0rr�
_exit_wrapper}sz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapperr�rrr/r0rsrrqr�_create_cb_wrapper{sz!_BaseExitStack._create_cb_wrappercCst�|_dSr)r�_exit_callbacksrrrrr;�sz_BaseExitStack.__init__cCst|��}|j|_t�|_|Sr)r9rvr)r�	new_stackrrr�pop_all�s
z_BaseExitStack.pop_allcCsBt|�}z
|j}Wntk
r0|�|�YnX|�||�|Sr)r9r�AttributeError�_push_exit_callback�
_push_cm_exit�r�exit�_cb_type�exit_methodrrr�push�s	
z_BaseExitStack.pushcCs(t|�}|j}|�|�}|�||�|Sr)r9rrr{�rrl�_cm_type�_exit�resultrrr�
enter_context�s

z_BaseExitStack.enter_contextcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j|f|�|�}||_|�|�|S)	N�zBdescriptor 'callback' of '_BaseExitStack' object needs an argumentrrr�4Passing 'callback' as keyword argument is deprecated��
stacklevelz8callback expected at least 1 positional argument, got %drC)	�len�	TypeErrorr_�warnings�warn�DeprecationWarningru�__wrapped__rz�r/r0rrrr�rsrrrrr�s&

�
�
z_BaseExitStack.callback�#($self, callback, /, *args, **kwds)cCs|�||�}|�|d�dS)NT)rnrz�rrlrmrsrrrr{�sz_BaseExitStack._push_cm_exitTcCs|j�||f�dSr)rvr\)rrr�is_syncrrrrz�sz"_BaseExitStack._push_exit_callbackN)T)r%r&r'�staticmethodrnrur;rxr�r�rr�__text_signature__r{rzrrrrrjts

rjc@s$eZdZdd�Zdd�Zdd�ZdS)rcCs|Srrrrrrr�szExitStack.__enter__c
s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z||�rVd}d}d}Wq,t��}||d|d�d}|}Yq,Xq,|r�z|dj}	|d�Wn tk
r�|	|d_�YnX|o�|S)NrrCcs4|j}||krdS|dks*|�kr$q*|}q||_dSr��__context__��new_exc�old_exc�exc_context��	frame_excrr�_fix_exception_context�sz2ExitStack.__exit__.<locals>._fix_exception_contextFT�NNN�rFrGrvr_r�rO)
r�exc_details�received_excr��suppressed_exc�
pending_raiser��cb�new_exc_details�	fixed_ctxrr�rr�s2

zExitStack.__exit__cCs|�ddd�dSr)rrrrrrVszExitStack.closeN)r%r&r'rrrVrrrrr�s1c@sbeZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zde_	dd
�Z
dd�Zdd�Zdd�Z
dS)r
cCs
t||�Srrrkrrr�_create_async_exit_wrapper&sz)AsyncExitStack._create_async_exit_wrappercs���fdd�}|S)Nc�s����IdHdSrrrorqrrrs,sz>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperrrtrrqr�_create_async_cb_wrapper*sz'AsyncExitStack._create_async_cb_wrapperc�s.t|�}|j}|�|�IdH}|�||�|Sr)r9r,r+�_push_async_cm_exitr�rrr�enter_async_context0s
z"AsyncExitStack.enter_async_contextcCsDt|�}z
|j}Wn tk
r2|�|d�YnX|�||�|S�NF)r9r,ryrzr�r|rrr�push_async_exit<s
zAsyncExitStack.push_async_exitcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j|f|�|�}||_|�|d	�|S)
Nr�zMdescriptor 'push_async_callback' of 'AsyncExitStack' object needs an argumentrrrr�r�zCpush_async_callback expected at least 1 positional argument, got %drCF)	r�r�r_r�r�r�r�r�rzr�rrr�push_async_callbackNs&

�
�z"AsyncExitStack.push_async_callbackr�c�s|�ddd�IdHdSr)r,rrrr�aclosekszAsyncExitStack.aclosecCs|�||�}|�|d�dSr�)r�rzr�rrrr�osz"AsyncExitStack._push_async_cm_exitc�s|Srrrrrrr+uszAsyncExitStack.__aenter__c�s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z0|rP||�}n||�IdH}|rnd}d}d}Wq,t��}	||	d|d�d}|	}Yq,Xq,|r�z|dj}
|d�Wn tk
r�|
|d_�YnX|o�|S)NrrCcs4|j}||krdS|dks*|�kr$q*|}q||_dSrr�r�r�rrr�~sz8AsyncExitStack.__aexit__.<locals>._fix_exception_contextFTr�r�)rr�r�r�r�r�r�r��cb_suppressr�r�rr�rr,xs8


zAsyncExitStack.__aexit__N)r%r&r'r�r�r�r�r�r�r�r�r�r+r,rrrrr
s


c@s&eZdZddd�Zdd�Zdd�ZdS)	r
NcCs
||_dSr��enter_result)rr�rrrr;�sznullcontext.__init__cCs|jSrr�rrrrr�sznullcontext.__enter__cGsdSrr)r�excinforrrr�sznullcontext.__exit__)NrWrrrrr
�s
)r(rFr�collectionsr�	functoolsr�typesr�__all__�ABCrr�objectrr5r<rJrrr	rXrrrrjrr
r
rrrr�<module>sL��D�.!!`Enntplib.cpython-38.opt-1.pyc000064400000102270151450073350011606 0ustar00U

e5d���@s�dZddlZddlZddlZddlZddlZddlZzddlZWnek
rXdZ	YnXdZ	ddl
mZddlm
Z
ddd	d
ddd
dgZdZGdd�de�ZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd
�d
e�ZdZdZddddddddd d!d"d#hZd$d%d&d'd(d)d*gZd)d*d+�Zd,Ze�d-d.d/d0d1g�Ze�d2d3d4d5g�Zd6d�Zd7d8�Z dmd9d:�Z!dnd;d<�Z"dod=d>�Z#e	�r�d?d@�Z$GdAdB�dB�Z%GdCd�de%�Z&e	�r�GdDdE�dEe%�Z'e�(dE�e)dFk�r�ddl*Z*e*j+dGdH�Z,e,j-dIdJdKdLdM�e,j-dNdOdPdQdM�e,j-dRdSdTe.dUeefdV�e,j-dWdXdYe.dZdV�e,j-d[d\d]dd^d_�e,�/�Z0e0j1Z1e0j�s�e1dTk�r|eZ1e&e0j2e1d`�Z3ne1dTk�r�eZ1e'e0j2e1d`�Z3e3�4�Z5dae5k�r�e3�6�e3�7e0j7�\Z8Z9Z:Z;Z<e=dbe<dce9dde:dee;�dfdg�Z>e?e.e;�e0j@dh�Z:e3�Ae:e;�\Z8ZBeBD]Z\ZCZDeeDd%��Edidh�dZFeeDd$�ZGe.eDd*�ZHe=dj�IeCe>eFdk�e>eGdl�eH���q e3�J�dS)pa�An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)

Example:

>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print('Group', name, 'has', count, 'articles, range', first, 'to', last)
Group comp.lang.python has 51 articles, range 5770 to 5821
>>> resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last))
>>> resp = s.quit()
>>>

Here 'resp' is the server response line.
Error responses are turned into exceptions.

To post an article from a file:
>>> f = open(filename, 'rb') # file containing article, including header
>>> resp = s.post(f)
>>>

For descriptions of all methods, read the comments in the code below.
Note that all arguments and return values representing article numbers
are strings, not numbers, since they are rarely used for calculations.
�NFT)�
decode_header)�_GLOBAL_DEFAULT_TIMEOUT�NNTP�	NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError�
NNTPDataErrorric@seZdZdZdd�ZdS)rz%Base class for all nntplib exceptionscGs>tj|f|��z|d|_Wntk
r8d|_YnXdS)NrzNo response given)�	Exception�__init__�response�
IndexError)�self�args�r�/usr/lib64/python3.8/nntplib.pyrcs
zNNTPError.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrrrasc@seZdZdZdS)rzUnexpected [123]xx replyN�rrrrrrrrrjsc@seZdZdZdS)rz
4xx errorsNrrrrrrnsc@seZdZdZdS)rz
5xx errorsNrrrrrrrsc@seZdZdZdS)r	z"Response does not begin with [1-5]Nrrrrrr	vsc@seZdZdZdS)r
zError in response dataNrrrrrr
zs�wi3Z100Z101�211�215Z220Z221Z222Z224Z225Z230Z231Z282�subject�from�datez
message-idZ
referencesz:bytesz:lines)�bytes�lines�
�	GroupInfo�group�last�first�flag�ArticleInfoZnumber�
message_idrcCsJg}t|�D]2\}}t|t�r4|�|�|p,d��q|�|�qd�|�S)zvTakes a unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value.�ascii�)�_email_decode_header�
isinstancer�append�decode�join)Z
header_str�parts�v�encrrrr�s
cCs�g}|D]`}|ddkr:|dd��d�\}}}d|}n|�d�\}}}|��}t�||�}|�|�qt}t|�t|�kr�td��|dt|��|kr�td��|S)z�Parse a list of string representing the response to LIST OVERVIEW.FMT
    and return a list of header/metadata names.
    Raises NNTPDataError if the response is not compliant
    (cf. RFC 3977, section 8.4).r�:�Nz$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)�	partition�lower�_OVERVIEW_FMT_ALTERNATIVES�getr,�_DEFAULT_OVERVIEW_FMT�lenr
)r�fmt�line�name�_�suffix�defaultsrrr�_parse_overview_fmt�s
r@cCs�tt�}g}|D]�}i}|�d�^}}t|�}t|�D]�\}	}
|	t|�krLq6||	}|�d�}|	|kr�|s�|d}
|
r�|
dt|
����|
kr�td��|
r�|
t|
�d�nd}
|
|||	<q6|�||f�q|S)zZParse the response to an OVER or XOVER command according to the
    overview format `fmt`.�	r2z: Nz?OVER/XOVER response doesn't include names of additional headers)	r9r8�split�int�	enumerate�
startswithr5r
r,)rr:Zdata_process_funcZ
n_defaultsZoverviewr;ZfieldsZarticle_number�tokens�i�tokenZ
field_nameZis_metadata�hrrr�_parse_overview�s&
rJcCs�|dkr |dd�}|dd�}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}|dkr�|d7}n|d	kr�|d
7}t�||||||�S)z�Parse a pair of (date, time) strings, and return a datetime object.
    If only the date is given, it is assumed to be date and time
    concatenated together (e.g. response to the DATE command).
    Ni�������������Fi��dil)rC�datetime)�date_str�time_strZhoursZminutesZseconds�yearZmonthZdayrrr�_parse_datetime�s
rUcCsPt|tj�sd}n
d�|�}|j}|r<|d}d�||�}nd�||�}||fS)aPFormat a date or datetime object as a pair of (date, time) strings
    in the format required by the NEWNEWS and NEWGROUPS commands.  If a
    date object is passed, the time is assumed to be midnight (00h00).

    The returned representation depends on the legacy flag:
    * if legacy is False (the default):
      date has the YYYYMMDD format and time the HHMMSS format
    * if legacy is True:
      date has the YYMMDD format and time the HHMMSS format.
    RFC 3977 compliant servers should understand both formats; therefore,
    legacy is only needed when talking to old servers.
    Z000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rPz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})r+rQ�formatrT)ZdtZlegacyrS�yrRrrr�_unparse_datetime�s

rXcCs|dkrt��}|j||d�S)z�Wrap a socket in SSL/TLS. Arguments:
        - sock: Socket to wrap
        - context: SSL context to use for the encrypted connection
        Returns:
        - sock: New, encrypted socket.
        N)Zserver_hostname)�sslZ_create_stdlib_contextZwrap_socket)�sock�contextZhostnamerrr�_encrypt_onsr\c@seZdZdZdZdefdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZeZdd�Z
dd�Zdhdd�Zdd�Zdidd�Zdd�Zdjdd�Zdkdd �Zd!d"�Zd#d$�Zd%d&�Zdd'�d(d)�Zdd'�d*d+�Zdldd'�d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zdd'�d6d7�Zd8d9�Z d:d;�Z!dmd<d=�Z"d>d?�Z#d@dA�Z$dndBdC�Z%dodd'�dDdE�Z&dpdd'�dFdG�Z'dqdd'�dHdI�Z(dJdK�Z)dd'�dLdM�Z*dd'�dNdO�Z+dd'�dPdQ�Z,dd'�dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4drdbdc�Z5ddde�Z6e7�rdsdfdg�Z8dS)t�	_NNTPBasezutf-8�surrogateescapeNcCsj||_||_d|_|��|_d|_|��d|_|rZd|jkrZ|��|jsZd|_|��d|_	d|_
dS)aSInitialize an instance.  Arguments:
        - file: file-like object (open for read/write in binary mode)
        - host: hostname of the server
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        rNF�READER)�host�file�	debugging�_getresp�welcome�_caps�getcapabilities�readermode_afterauth�_setreadermode�tls_on�
authenticated)rrar`�
readermode�timeoutrrrr9s
	z_NNTPBase.__init__cCs|S�Nr�rrrr�	__enter__hsz_NNTPBase.__enter__c	sR�fdd�}|�rNz*z���Wnttfk
r8YnXW5|�rL���XdS)Ncs
t�d�S)Nra)�hasattrrrnrr�<lambda>l�z$_NNTPBase.__exit__.<locals>.<lambda>)�_close�quit�OSError�EOFError)rrZis_connectedrrnr�__exit__ks
z_NNTPBase.__exit__cCs|jrtdt|j��|jS)z�Get the welcome message from the server
        (this is read and squirreled away by __init__()).
        If the response code is 200, posting is allowed;
        if it 201, posting is not allowed.z	*welcome*)rb�print�reprrdrnrrr�
getwelcomevsz_NNTPBase.getwelcomec	Cs�|jdkr�d|_d|_z|��\}}Wnttfk
rDi|_Yn<X||_d|krhttt|d��|_d|kr�d�	|d�|_|jS)z�Get the server capabilities, as read by __init__().
        If the CAPABILITIES command is not supported, an empty dict is
        returned.Nr3ZVERSIONZIMPLEMENTATION� )
re�nntp_versionZnntp_implementation�capabilitiesrr�max�maprCr.)r�resp�capsrrrrfs
z_NNTPBase.getcapabilitiescCs
||_dS)z�Set the debugging level.  Argument 'level' means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)rb)r�levelrrr�set_debuglevel�sz_NNTPBase.set_debuglevelcCsHt�d||�|t}|jdkr.tdt|��|j�|�|j��dS)zfInternal: send one line to the server, appending CRLF.
        The `line` must be a bytes-like object.znntplib.putliner3z*put*N)	�sys�audit�_CRLFrbrxryra�write�flush�rr;rrr�_putline�s
z_NNTPBase._putlinecCs2|jrtdt|��|�|j|j�}|�|�dS)zkInternal: send one command to the server (through _putline()).
        The `line` must be a unicode string.z*cmd*N)rbrxry�encode�encoding�errorsr�r�rrr�_putcmd�sz_NNTPBase._putcmdTcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sDt�|r�|dd�t	krf|dd�}n|dd�t	kr�|dd�}|S)z�Internal: return one line from the server, stripping _CRLF.
        Raise EOFError if the connection is closed.
        Returns a bytes object.r3z
line too longz*get*rNN���)
ra�readline�_MAXLINEr9r
rbrxryrvr�)rZ
strip_crlfr;rrr�_getline�s
z_NNTPBase._getlinecCsl|��}|jrtdt|��|�|j|j�}|dd�}|dkrHt|��|dkrXt|��|dkrht	|��|S)z�Internal: get a response from the server.
        Raise various errors if the response indicates an error.
        Returns a unicode string.z*resp*Nr3�4�5Z123)
r�rbrxryr-r�r�rrr	)rr��crrrrc�sz_NNTPBase._getrespcCs�d}z�t|ttf�r"t|d�}}|��}|dd�tkrBt|��g}|dk	r�dtdf}|�	d�}||krnq�|�
d�r�|dd�}|�|�qZn8d}|�	�}||kr�q�|�
d�r�|dd�}|�|�q�W5|r�|��X||fS)	aPInternal: get a response plus following text from the server.
        Raise various errors if the response indicates an error.

        Returns a (response, lines) tuple where `response` is a unicode
        string and `lines` is a list of bytes objects.
        If `file` is a file-like object, it must be open in binary mode.
        N�wb��.s.
Fs..r3)
�closer+�strr�openrc�	_LONGRESPrr�r�rEr�r,)rraZ
openedFiler�rZterminatorsr;�
terminatorrrr�_getlongresp�s4	



z_NNTPBase._getlongrespcCs|�|�|��S)zWInternal: send a command and get the response.
        Same return value as _getresp().)r�rcr�rrr�	_shortcmd�s
z_NNTPBase._shortcmdcCs|�|�|�|�S)zoInternal: send a command and get the response plus following text.
        Same return value as _getlongresp().�r�r�)rr;rarrr�_longcmds
z_NNTPBase._longcmdcs.��|���|�\}}|�fdd�|D�fS)z�Internal: send a command and get the response plus following text.
        Same as _longcmd() and _getlongresp(), except that the returned `lines`
        are unicode strings rather than bytes objects.
        csg|]}|��j�j��qSr)r-r�r���.0r;rnrr�
<listcomp>s�z,_NNTPBase._longcmdstring.<locals>.<listcomp>r�)rr;rar��listrrnr�_longcmdstring	s

�z_NNTPBase._longcmdstringcCsdz|jWStk
rYnXz|�d�\}}Wn tk
rPtdd�}Yn
Xt|�}||_|S)zqInternal: get the overview format. Queries the server if not
        already done, else returns the cached value.zLIST OVERVIEW.FMTN)Z_cachedoverviewfmt�AttributeErrorr�rr8r@)rr�rr:rrr�_getoverviewfmtsz_NNTPBase._getoverviewfmtcCsdd�|D�S)NcSsg|]}t|����qSr)r!rBr�rrrr�&sz(_NNTPBase._grouplist.<locals>.<listcomp>r)rrrrr�
_grouplist$sz_NNTPBase._grouplistcCs8i}|�d�\}}|D]}|��^}}|||<q||fS)a!Process a CAPABILITIES command.  Not supported by all servers.
        Return:
        - resp: server response if successful
        - caps: a dictionary mapping capability names to lists of tokens
        (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })
        ZCAPABILITIES)r�rB)rr�r�rr;r<rFrrrr}(s
z_NNTPBase.capabilities)racCsbt|tjtjf�s$td�|jj���t||jdk�\}}d�||�}|�	||�\}}||�
|�fS)z�Process a NEWGROUPS command.  Arguments:
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of newsgroup names
        �Athe date parameter must be a date or datetime object, not '{:40}'rKzNEWGROUPS {0} {1})r+rQr�	TypeErrorrV�	__class__rrXr|r�r�)rrrarRrS�cmdr�rrrr�	newgroups6s��z_NNTPBase.newgroupscCsRt|tjtjf�s$td�|jj���t||jdk�\}}d�|||�}|�	||�S)z�Process a NEWNEWS command.  Arguments:
        - group: group name or '*'
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of message ids
        r�rKzNEWNEWS {0} {1} {2})
r+rQrr�rVr�rrXr|r�)rr"rrarRrSr�rrr�newnewsFs��z_NNTPBase.newnewscCs4|dk	rd|}nd}|�||�\}}||�|�fS)a@Process a LIST or LIST ACTIVE command. Arguments:
        - group_pattern: a pattern indicating which groups to query
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (group, last, first, flag) (strings)
        NzLIST ACTIVE ZLIST)r�r�)r�
group_patternra�commandr�rrrrr�Vs

z_NNTPBase.listcCs�t�d�}|�d|�\}}|�d�s8|�d|�\}}i}|D]:}|�|���}|r@|�dd�\}	}
|sr|
S|
||	<q@|r�||fSdSdS)Nz^(?P<group>[^ 	]+)[ 	]+(.*)$zLIST NEWSGROUPS r�XGTITLE r3rKr))�re�compiler�rE�search�stripr")rr�Z
return_all�line_patr�r�groups�raw_line�matchr<Zdescrrr�_getdescriptionses


z_NNTPBase._getdescriptionscCs|�|d�S)a�Get a description for a single group.  If more than one
        group matches ('group' is a pattern), return the first.  If no
        group matches, return an empty string.

        This elides the response code from the server, since it can
        only be '215' or '285' (for xgtitle) anyway.  If the response
        code is needed, use the 'descriptions' method.

        NOTE: This neither checks for a wildcard in 'group' nor does
        it check whether the group actually exists.F�r�)rr"rrr�description|sz_NNTPBase.descriptioncCs|�|d�S)z'Get descriptions for a range of groups.Tr�)rr�rrr�descriptions�sz_NNTPBase.descriptionscCs�|�d|�}|�d�s t|��|��}d}}}t|�}|dkr�|d}|dkr�|d}|dkr�|d}|dkr�|d��}|t|�t|�t|�|fS)aProcess a GROUP command.  Argument:
        - group: the group name
        Returns:
        - resp: server response if successful
        - count: number of articles
        - first: first article number
        - last: last article number
        - name: the group name
        zGROUP rrr3rKr�rL)r�rErrBr9r5rC)rr<r��words�countr$r#�nrrrr"�s

z_NNTPBase.groupcCs|�d|�S)aProcess a HELP command. Argument:
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of strings returned by the server in response to the
                HELP command
        ZHELP)r�)rrarrr�help�sz_NNTPBase.helpcCs8|�d�st|��|��}t|d�}|d}|||fS)z_Internal: parse the response line of a STAT, NEXT, LAST,
        ARTICLE, HEAD or BODY command.Z22r3rK)rErrBrC)rr�r��art_numr'rrr�
_statparse�s
z_NNTPBase._statparsecCs|�|�}|�|�S)z/Internal: process a STAT, NEXT or LAST command.)r�r�)rr;r�rrr�_statcmd�s
z_NNTPBase._statcmdcCs"|r|�d�|��S|�d�SdS)a(Process a STAT command.  Argument:
        - message_spec: article number or message id (if not specified,
          the current article is selected)
        Returns:
        - resp: server response if successful
        - art_num: the article number
        - message_id: the message id
        zSTAT {0}ZSTATN)r�rV)r�message_specrrr�stat�s	z_NNTPBase.statcCs
|�d�S)z;Process a NEXT command.  No arguments.  Return as for STAT.ZNEXT�r�rnrrr�next�sz_NNTPBase.nextcCs
|�d�S)z;Process a LAST command.  No arguments.  Return as for STAT.ZLASTr�rnrrrr#�sz_NNTPBase.lastcCs0|�||�\}}|�|�\}}}|t|||�fS)z2Internal: process a HEAD, BODY or ARTICLE command.)r�r�r&)rr;rar�rr�r'rrr�_artcmd�sz_NNTPBase._artcmdcCs$|dk	rd�|�}nd}|�||�S)a0Process a HEAD command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the headers in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of header lines)
        NzHEAD {0}ZHEAD�rVr��rr�rar�rrr�head�sz_NNTPBase.headcCs$|dk	rd�|�}nd}|�||�S)a+Process a BODY command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the body in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of body lines)
        NzBODY {0}ZBODYr�r�rrr�body�sz_NNTPBase.bodycCs$|dk	rd�|�}nd}|�||�S)a5Process an ARTICLE command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the article in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of article lines)
        NzARTICLE {0}ZARTICLEr�r�rrr�article�sz_NNTPBase.articlecCs
|�d�S)zYProcess a SLAVE command.  Returns:
        - resp: server response if successful
        ZSLAVE)r�rnrrr�slavesz_NNTPBase.slavecsDt�d��|�d�||�|�\}}�fdd��|�fdd�|D�fS)aiProcess an XHDR command (optional server extension).  Arguments:
        - hdr: the header type (e.g. 'subject')
        - str: an article nr, a message id, or a range nr1-nr2
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (nr, value) strings
        z^([0-9]+) ?(.*)
?zXHDR {0} {1}cs��|�}|r|�dd�S|S)Nr3rK)r�r")r;�m)�patrr�
remove_numbers
z%_NNTPBase.xhdr.<locals>.remove_numbercsg|]}�|��qSrrr�)r�rrr�sz"_NNTPBase.xhdr.<locals>.<listcomp>)r�r�r�rV)rZhdrr�rar�rr)r�r�r�xhdrs	
z_NNTPBase.xhdrcCs.|�d�||�|�\}}|��}|t||�fS)aFProcess an XOVER command (optional server extension) Arguments:
        - start: start of range
        - end: end of range
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields
        z
XOVER {0}-{1})r�rVr�rJ)r�start�endrar�rr:rrr�xovers
	�z_NNTPBase.xoverc	Csxd|jkrdnd}t|ttf�r>|\}}|d�||p6d�7}n|dk	rR|d|}|�||�\}}|��}|t||�fS)a�Process an OVER command.  If the command isn't supported, fall
        back to XOVER. Arguments:
        - message_spec:
            - either a message id, indicating the article to fetch
              information about
            - or a (start, end) tuple, indicating a range of article numbers;
              if end is None, information up to the newest message will be
              retrieved
            - or None, indicating the current article number must be used
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields

        NOTE: the "message id" form isn't supported by XOVER
        ZOVERZXOVERz {0}-{1}r)Nr{)rer+�tupler�rVr�r�rJ)	rr�rar�r�r�r�rr:rrr�over*sz_NNTPBase.overc	Csft�dtd�t�d�}|�d||�\}}g}|D](}|�|���}|r4|�|�	dd��q4||fS)z�Process an XGTITLE command (optional server extension) Arguments:
        - group: group name wildcard (i.e. news.*)
        Returns:
        - resp: server response if successful
        - list: list of (name,title) stringszFThe XGTITLE extension is not actively used, use descriptions() insteadrKz^([^ 	]+)[ 	]+(.*)$r�r3)
�warnings�warn�DeprecationWarningr�r�r�r�r�r,r")	rr"rar�r�Z	raw_linesrr�r�rrr�xgtitleEs�
z_NNTPBase.xgtitlecCslt�dtd�|�d�|��}|�d�s0t|��z|��\}}Wntk
r^t|�d�Yn
X||fSdS)z�Process an XPATH command (optional server extension) Arguments:
        - id: Message id of article
        Returns:
        resp: server response if successful
        path: directory path to article
        z(The XPATH extension is not actively usedrKz	XPATH {0}Z223N)	r�r�r�r�rVrErrB�
ValueError)r�idr�Zresp_num�pathrrr�xpathWs�
z_NNTPBase.xpathcCsb|�d�}|�d�st|��|��}t|�dkr8t|��|d}t|�dkrTt|��|t|d�fS)z�Process the DATE command.
        Returns:
        - resp: server response if successful
        - date: datetime object
        ZDATEZ111rKr3�N)r�rErrBr9r
rU)rr��elemrrrrrks

z_NNTPBase.datecCs�|�|�}|�d�st|��t|ttf�r2|��}|D]:}|�t�sR|�	d�t}|�d�rdd|}|j
�|�q6|j
�d�|j
��|�
�S)N�3r r�s.
)r�rErr+r�	bytearray�
splitlines�endswithr��rstriprar�r�rc)rr��fr�r;rrr�_post|s




z_NNTPBase._postcCs|�d|�S)z�Process a POST command.  Arguments:
        - data: bytes object, iterable or file containing the article
        Returns:
        - resp: server response if successfulZPOST)r�)r�datarrr�post�sz_NNTPBase.postcCs|�d�|�|�S)aProcess an IHAVE command.  Arguments:
        - message_id: message-id of the article
        - data: file containing the article
        Returns:
        - resp: server response if successful
        Note that if the server refuses the article an exception is raised.z	IHAVE {0})r�rV)rr'r�rrr�ihave�sz_NNTPBase.ihavecCs|j��|`dSrm)rar�rnrrrrs�s
z_NNTPBase._closecCsz|�d�}W5|��X|S)zdProcess a QUIT command and close the socket.  Returns:
        - resp: server response if successfulZQUIT)rsr�)rr�rrrrt�s
z_NNTPBase.quitcCs�|jrtd��|s|std��z<|rX|sXddl}|��}|�|j�}|rX|d}|d}Wntk
rnYnX|sxdS|�d|�}|�d�r�|s�t|��n |�d|�}|�d�s�t	|��d|_
|��|jr�d	|j
kr�|�
�d|_
|��dS)
NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrKzauthinfo user Z381zauthinfo pass Z281r_)rjr��netrcZauthenticatorsr`rur�rErrrerfrgrh)r�user�password�usenetrcr�ZcredentialsZauthr�rrr�login�s>�


z_NNTPBase.loginc
Cs`z|�d�|_WnJtk
r$Yn8tk
rZ}z|j�d�rHd|_n�W5d}~XYnXdS)Nzmode readerZ480T)r�rdrrr
rErg)r�errrrh�sz_NNTPBase._setreadermodecCs||jrtd��|jrtd��|�d�}|�d�rp|j��t|j||j	�|_|j�
d�|_d|_d|_|��nt
d��dS)	zzProcess a STARTTLS command. Arguments:
            - context: SSL context to use for the encrypted connection
            zTLS is already enabled.z+TLS cannot be started after authentication.�STARTTLSZ382�rwbTNzTLS failed to start.)rir�rjr�rErar�r\rZr`�makefilererfr)rr[r�rrr�starttls�s



z_NNTPBase.starttls)T)N)N)N)N)N)N)N)N)N)NNT)N)9rrrr�r�rrrorwrzrfr��debugr�r�r�rcr�r�r�r�r�r�r}r�r�r�r�r�r�r"r�r�r�r�r�r#r�r�r�r�r�r�r�r�r�r�rr�r�r�rsrtr�rh�	_have_sslr�rrrrr])sn
�
/		

.







		
)
r]c@s*eZdZeddddefdd�Zdd�ZdS)rNFc	Cs�||_||_t�d|||�t�||f|�|_d}z8|j�d�}t�	|||||�|sZ|rh|�
|||�Wn$|r~|��|j���YnXdS)a,Initialize an instance.  Arguments:
        - host: hostname to connect to
        - port: port to connect to (default the standard NNTP port)
        - user: username to authenticate with
        - password: password to use with username
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - usenetrc: allow loading username and password from ~/.netrc file
                    if not specified explicitly
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        �nntplib.connectNr�)r`�portr�r��socket�create_connectionrZr�r]rr�r�)	rr`r�r�r�rkr�rlrarrrr�s$
�
z
NNTP.__init__cCs zt�|�W5|j��XdSrm�rZr�r]rsrnrrrrs$szNNTP._close)rrr�	NNTP_PORTrrrsrrrrr�s�
%c@s,eZdZedddddefdd�Zdd�ZdS)�NNTP_SSLNFc	
Cs�t�d|||�t�||f|�|_d}	zJt|j||�|_|j�d�}	tj||	|||d�|s`|rn|�	|||�Wn$|	r�|	�
�|j�
��YnXdS)z�This works identically to NNTP.__init__, except for the change
            in default port and the `ssl_context` argument for SSL connections.
            r�Nr�)rkrl)r�r�r�r�rZr\r�r]rr�r�)
rr`r�r�r�Zssl_contextrkr�rlrarrrr.s"
�
zNNTP_SSL.__init__cCs zt�|�W5|j��XdSrmr�rnrrrrsEszNNTP_SSL._close)rrr�
NNTP_SSL_PORTrrrsrrrrr,s�
r�__main__zJ        nntplib built-in demo - display the latest articles in a newsgroup)r�z-gz--groupzgmane.comp.python.generalz3group to fetch messages from (default: %(default)s))�defaultr�z-sz--serverz
news.gmane.ioz+NNTP server hostname (default: %(default)s)z-pz--portr�z#NNTP port number (default: %s / %s))r�typer�z-nz
--nb-articles�
z2number of articles to fetch (default: %(default)s)z-Sz--ssl�
store_truezuse NNTP over SSL)�actionrr�)r`r�r�ZGroupZhaszarticles, range�tocCs$t|�|kr |d|d�d}|S)NrLz...)r9)�sZlimrrr�cutpsr
r3�<z{:7} {:20} {:42} ({})��*)N)N)F)Krr�r��collectionsrQr�r�rY�ImportErrorr�Zemail.headerrr*r�__all__r�rrrrrr	r
r�rr�r8r6r��
namedtupler!r&r@rJrUrXr\r]rrr,r�argparse�ArgumentParser�parser�add_argumentrC�
parse_argsrr�Zserverr	rfr�r�r"r�r�r$r#r<rxr
r�Znb_articlesr�Z	overviewsZartnumr�rBZauthorrrrVrtrrrr�<module>s�A
�
	���
��


Y.


�
�
���


�
imaplib.cpython-38.opt-1.pyc000064400000114371151450073350011562 0ustar00U

e5df��*@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZmZm
Z
ddlmZzddlZdZWnek
r�dZYnXdd	d
ddd
gZdZdZdZdZdZdZdddddddddddddddddddddddddddddddddddddddddd�)Ze�d�Ze�d�Ze�d�Ze�dej�Z e�d�Z!e�d�Z"e�d�Z#e�d ej�Z$dZ%d Z&Gd!d�d�Z'e�r�Gd"d#�d#e'�Z(e�)d#�Gd$d	�d	e'�Z*Gd%d&�d&�Z+d'�,d(�Z-d)d*�e.e-d+d��D�Z/d,d
�Z0d-d�Z1d.d�Z2d/d
�Z3e4d0k�r�ddl5Z5ddl6Z6ze5�5ej7d+d�d1�\Z8Z9Wn.e5j:k
�rpZ;zd2\Z8Z9W5dZ;[;XYnXdZ<e8D]8\Z=Z;e=d3k�r�e>e;�Zne=d4k�rze;Z<e9�sze<fZ9�qze9�s�d5Z9e9dZ?e6�@�ZAe6�6d6eAe?�p�d7f�ZBd8eAd9d:�ZCd;eAeBffd<d=d>d?d@ddeCffdAdBdCdDdEdFdGdHdIfZDdJdKdLdMd?dddeCffdHdNfZEdOdP�ZF�ze<�rbe*e<�ZGne'e?�ZGeGjHdQk�r�eDd+d�ZDeG�IdReGjJ�eG�IdSeGjKf�eDD]\ZLZ9eFeLe9��q�eFdTdU�D]<ZMe�NdVeM�ZOeO�r�eO�Pd+�ZQneM�,�dWZQeFdXeQf��q�eED]T\ZLZ9eFeLe9�ZReLe9fdLk�r.�q
eRdW�,�ZSeS�sD�q
eFdYdZd[eSdWd\f��q
eTd]�Wn.eTd^�e�s�eTd_ej7d��YnXdS)`z�IMAP4 client.

Based on RFC 2060.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
z2.58�N)�datetime�timezone�	timedelta)�DEFAULT_BUFFER_SIZETF�IMAP4�IMAP4_stream�Internaldate2tuple�Int2AP�
ParseFlags�Time2Internaldate�
�i�)Z	IMAP4REV1ri@B)�AUTH�SELECTED)�NONAUTH)rrr�LOGOUT)r)r))�APPEND�AUTHENTICATE�
CAPABILITY�CHECK�CLOSE�COPY�CREATE�DELETE�	DELETEACL�ENABLE�EXAMINE�EXPUNGE�FETCH�GETACL�
GETANNOTATION�GETQUOTA�GETQUOTAROOT�MYRIGHTS�LIST�LOGINr�LSUBZMOVE�	NAMESPACE�NOOP�PARTIAL�	PROXYAUTH�RENAME�SEARCH�SELECT�SETACL�
SETANNOTATION�SETQUOTA�SORT�STARTTLS�STATUS�STORE�	SUBSCRIBE�THREAD�UID�UNSUBSCRIBEs\+( (?P<data>.*))?s.*FLAGS \((?P<flags>[^\)]*)\)s�.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])"s.*{(?P<size>\d+)}$s
\r\n|\r|\ns%\[(?P<type>[A-Z-]+)( (?P<data>.*))?\]s$\* (?P<type>[A-Z-]+)( (?P<data>.*))?s3\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?c@s�eZdZdZGdd�de�ZGdd�de�ZGdd�de�Zdefd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdefdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dEdF�Z'dGdH�Z(d�dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-d�dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5d�dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9dodp�Z:d�drds�Z;dtdu�Z<dvdw�Z=dxdy�Z>dzd{�Z?d|d}�Z@d~d�ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOdqS)�ra�IMAP4 client class.

    Instantiate with: IMAP4([host[, port]])

            host - host's name (default: localhost);
            port - port number (default: standard IMAP4 port).

    All IMAP4rev1 commands are supported by methods of the same
    name (in lower-case).

    All arguments to commands are converted to strings, except for
    AUTHENTICATE, and the last argument to APPEND which is passed as
    an IMAP4 literal.  If necessary (the string contains any
    non-printing characters or white-space and isn't enclosed with
    either parentheses or double quotes) each string is quoted.
    However, the 'password' argument to the LOGIN command is always
    quoted.  If you want to avoid having an argument string quoted
    (eg: the 'flags' argument to STORE) then enclose the string in
    parentheses (eg: "(\Deleted)").

    Each command returns a tuple: (type, [data, ...]) where 'type'
    is usually 'OK' or 'NO', and 'data' is either the text from the
    tagged response, or untagged results from command. Each 'data'
    is either a string, or a tuple. If a tuple, then the first part
    is the header of the response, and the second part contains
    the data (ie: 'literal' value).

    Errors raise the exception class <instance>.error("<reason>").
    IMAP4 server errors raise <instance>.abort("<reason>"),
    which is a sub-class of 'error'. Mailbox status changes
    from READ-WRITE to READ-ONLY raise the exception class
    <instance>.readonly("<reason>"), which is a sub-class of 'abort'.

    "error" exceptions imply a program error.
    "abort" exceptions imply the connection should be reset, and
            the command re-tried.
    "readonly" exceptions imply the command should be re-tried.

    Note: to use this module, you must read the RFCs pertaining to the
    IMAP4 protocol, as the semantics of the arguments to each IMAP4
    command are left to the invoker, not to mention the results. Also,
    most IMAP servers implement a sub-set of the commands available here.
    c@seZdZdS)zIMAP4.errorN��__name__�
__module__�__qualname__�r=r=�/usr/lib64/python3.8/imaplib.py�error�sr?c@seZdZdS)zIMAP4.abortNr9r=r=r=r>�abort�sr@c@seZdZdS)zIMAP4.readonlyNr9r=r=r=r>�readonly�srA�cCs�t|_d|_d|_i|_i|_d|_d|_d|_d|_	|�
�|�||�z|��Wn8t
k
r�z|��Wntk
r�YnX�YnXdS)NrrBFr)�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�is_readonly�tagnum�_tls_established�_mode_ascii�open�_connect�	Exception�shutdown�OSError��self�host�portr=r=r>�__init__�s&zIMAP4.__init__cCs0d|_d|_t�ttj�|_t�ttj�|_dS)NF�ascii)	�utf8_enabled�	_encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rTr=r=r>rM�szIMAP4._mode_asciicCs(d|_d|_t�t�|_t�t�|_dS)NT�utf-8)rYrZr[r\r]r_r`rarbr=r=r>�
_mode_utf8�szIMAP4._mode_utf8cCs�tt�dd��|_t�d|jdtj�|_|�	�|_
d|jkrHd|_nd|jkrZd|_n|�
|j
��|��tD]}||jkr�qr||_dS|�
d	��dS)
Nii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)ZPREAUTHr�OKrzserver not IMAP4 compliant)r	�randomZrandint�tagprer[r\r^�tagre�__version__�
_get_responseZwelcomerHrEr?�_get_capabilities�AllowedVersions�capabilities�PROTOCOL_VERSION)rT�versionr=r=r>rO�s*���



zIMAP4._connectcCs&|tkrt||���Std|��dS)NzUnknown IMAP4 command: '%s')�Commands�getattr�lower�AttributeError)rT�attrr=r=r>�__getattr__	szIMAP4.__getattr__cCs|S�Nr=rbr=r=r>�	__enter__szIMAP4.__enter__cGs4|jdkrdSz|��Wntk
r.YnXdS)Nr)rE�logoutrR)rT�argsr=r=r>�__exit__s
zIMAP4.__exit__cCs4|js
dn|j}t�d||j|j�t�||jf�S)Nzimaplib.open)rU�sys�auditrV�socketZcreate_connection)rTrUr=r=r>�_create_socketszIMAP4._create_socketcCs(||_||_|��|_|j�d�|_dS)z�Setup connection to remote server on "host:port"
            (default: localhost:standard IMAP4 port).
        This connection will be used by the routines:
            read, readline, send, shutdown.
        �rbN)rUrVr~�sock�makefile�filerSr=r=r>rN's
z
IMAP4.opencCs|j�|�S�zRead 'size' bytes from remote.)r��read�rT�sizer=r=r>r�3sz
IMAP4.readcCs.|j�td�}t|�tkr*|�dt��|S)�Read line from remote.�zgot more than %d bytes)r��readline�_MAXLINE�lenr?�rT�liner=r=r>r�8szIMAP4.readlinecCst�d||�|j�|�dS)�Send data to remote.zimaplib.sendN)r{r|r�Zsendall�rT�datar=r=r>�send@sz
IMAP4.sendc
Cst|j��zXz|j�tj�Wn@tk
r^}z"|jtjkrNt	|dd�dkrN�W5d}~XYnXW5|j��XdS)� Close I/O established in "open".Zwinerrorri&'N)
r��closer�rQr}Z	SHUT_RDWRrR�errnoZENOTCONNrq)rT�excr=r=r>rQFs
�zIMAP4.shutdowncCs|jS)zfReturn socket instance used to connect to IMAP4 server.

        socket = <instance>.socket()
        )r�rbr=r=r>r}VszIMAP4.socketcCsBd}|�ddg|�\}}|dr(||fS|��\}}|�|||�S)aReturn most recent 'RECENT' responses if any exist,
        else prompt server for an update using the 'NOOP' command.

        (typ, [data]) = <instance>.recent()

        'data' is None if no new messages,
        else list of RECENT responses, most recent last.
        ZRECENTreN���)�_untagged_response�noop�rT�name�typ�datr=r=r>�recentbs	zIMAP4.recentcCs|�|dg|���S)z�Return data for response 'code' if received, or None.

        Old value for response 'code' is cleared.

        (code, [data]) = <instance>.response(code)
        N)r��upper)rT�coder=r=r>�responsesszIMAP4.responsecCsxd}|sd}|r.|d|dfdkr2d|}nd}|r@t|�}nd}t�t|�}|jrbd|d	}||_|�||||�S)
z�Append message to named mailbox.

        (typ, [data]) = <instance>.append(mailbox, flags, date_time, message)

                All args except `message' can be None.
        r�INBOXrr���(�)�(%s)NsUTF8 (�))r�MapCRLF�sub�CRLFrYrF�_simple_command)rT�mailbox�flags�	date_time�messager�rFr=r=r>�append�s

zIMAP4.appendcCsP|��}t|�j|_|�d|�\}}|dkrB|�|d�dd���d|_||fS)asAuthenticate command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - it must appear in <instance>.capabilities in the
        form AUTH=<mechanism>.

        'authobject' must be a callable object:

                data = authobject(response)

        It will be called to process server continuation responses; the
        response argument it is passed will be a bytes.  It should return bytes
        data that will be base64 encoded and sent to the server.  It should
        return None if the client abort response '*' should be sent instead.
        rrer�rc�replacer)r��_Authenticator�processrFr�r?�decoderE)rTZ	mechanismZ
authobject�mechr�r�r=r=r>�authenticate�szIMAP4.authenticatecCs d}|�|�\}}|�|||�S)zT(typ, [data]) = <instance>.capability()
        Fetch capabilities list from server.r�r�r�r�r=r=r>�
capability�szIMAP4.capabilitycCs
|�d�S)zRCheckpoint mailbox on server.

        (typ, [data]) = <instance>.check()
        r�r�rbr=r=r>�check�szIMAP4.checkcCs$z|�d�\}}W5d|_X||fS)z�Close currently selected mailbox.

        Deleted messages are removed from writable mailbox.
        This is the recommended command before 'LOGOUT'.

        (typ, [data]) = <instance>.close()
        rr)rEr��rTr�r�r=r=r>r��szIMAP4.closecCs|�d||�S)z�Copy 'message_set' messages onto end of 'new_mailbox'.

        (typ, [data]) = <instance>.copy(message_set, new_mailbox)
        rr�)rT�message_setZnew_mailboxr=r=r>�copy�sz
IMAP4.copycCs|�d|�S)zPCreate new mailbox.

        (typ, [data]) = <instance>.create(mailbox)
        rr��rTr�r=r=r>�create�szIMAP4.createcCs|�d|�S)zPDelete old mailbox.

        (typ, [data]) = <instance>.delete(mailbox)
        rr�r�r=r=r>�delete�szIMAP4.deletecCs|�d||�S)z�Delete the ACLs (remove any rights) set for who on mailbox.

        (typ, [data]) = <instance>.deleteacl(mailbox, who)
        rr�)rTr��whor=r=r>�	deleteacl�szIMAP4.deleteaclcCsHd|jkrt�d��|�d|�\}}|dkr@d|��kr@|��||fS)zkSend an RFC5161 enable string to the server.

        (typ, [data]) = <intance>.enable(capability)
        rzServer does not support ENABLErezUTF8=ACCEPT)rmrr?r�r�rd)rTr�r�r�r=r=r>�enable�s

zIMAP4.enablecCs d}|�|�\}}|�|||�S)z�Permanently remove deleted items from selected mailbox.

        Generates 'EXPUNGE' response for each deleted message.

        (typ, [data]) = <instance>.expunge()

        'data' is list of 'EXPUNGE'd message numbers in order received.
        rr�r�r=r=r>�expunges	z
IMAP4.expungecCs$d}|�|||�\}}|�|||�S)a#Fetch (parts of) messages.

        (typ, [data, ...]) = <instance>.fetch(message_set, message_parts)

        'message_parts' should be a string of selected parts
        enclosed in parentheses, eg: "(UID BODY[TEXT])".

        'data' are tuples of message part envelope and data.
        rr�)rTr�Z
message_partsr�r�r�r=r=r>�fetchs
zIMAP4.fetchcCs|�d|�\}}|�||d�S)zXGet the ACLs for a mailbox.

        (typ, [data]) = <instance>.getacl(mailbox)
        rZACLr��rTr�r�r�r=r=r>�getaclszIMAP4.getaclcCs"|�d|||�\}}|�||d�S)za(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs.r �
ANNOTATIONr�)rTr��entryZ	attributer�r�r=r=r>�
getannotation(szIMAP4.getannotationcCs|�d|�\}}|�||d�S)z�Get the quota root's resource usage and limits.

        Part of the IMAP4 QUOTA extension defined in rfc2087.

        (typ, [data]) = <instance>.getquota(root)
        r!�QUOTAr�)rT�rootr�r�r=r=r>�getquota0szIMAP4.getquotacCs@|�d|�\}}|�||d�\}}|�||d�\}}|||gfS)z�Get the list of quota roots for the named mailbox.

        (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
        r"r�Z	QUOTAROOTr�)rTr�r�r�ZquotaZ	quotarootr=r=r>�getquotaroot;szIMAP4.getquotaroot�""�*cCs$d}|�|||�\}}|�|||�S)z�List mailbox names in directory matching pattern.

        (typ, [data]) = <instance>.list(directory='""', pattern='*')

        'data' is list of LIST responses.
        r$r��rTZ	directory�patternr�r�r�r=r=r>�listFsz
IMAP4.listcCs<|�d||�|��\}}|dkr.|�|d��d|_||fS)z�Identify client using plaintext password.

        (typ, [data]) = <instance>.login(user, password)

        NB: 'password' will be quoted.
        r%rer�r)r��_quoter?rE)rT�user�passwordr�r�r=r=r>�loginRs
zIMAP4.logincCs|||_|_|�d|j�S)zr Force use of CRAM-MD5 authentication.

        (typ, [data]) = <instance>.login_cram_md5(user, password)
        zCRAM-MD5)r�r�r��_CRAM_MD5_AUTH)rTr�r�r=r=r>�login_cram_md5`szIMAP4.login_cram_md5cCsBddl}t|jt�r |j�d�n|j}|jd|�||d���S)z1 Authobject to use with CRAM-MD5 authentication. rNrc� Zmd5)�hmac�
isinstancer��str�encoder�ZHMACZ	hexdigest)rTZ	challenger��pwdr=r=r>r�is
�zIMAP4._CRAM_MD5_AUTHcCs$d|_|�d�\}}|��||fS)z|Shutdown connection to server.

        (typ, [data]) = <instance>.logout()

        Returns server 'BYE' response.
        r)rEr�rQr�r=r=r>rxqszIMAP4.logoutcCs$d}|�|||�\}}|�|||�S)z�List 'subscribed' mailbox names in directory matching pattern.

        (typ, [data, ...]) = <instance>.lsub(directory='""', pattern='*')

        'data' are tuples of message part envelope and data.
        r&r�r�r=r=r>�lsub~sz
IMAP4.lsubcCs|�d|�\}}|�||d�S)z�Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).

        (typ, [data]) = <instance>.myrights(mailbox)
        r#r�r�r=r=r>�myrights�szIMAP4.myrightscCs d}|�|�\}}|�|||�S)zb Returns IMAP namespaces ala rfc2342

        (typ, [data, ...]) = <instance>.namespace()
        r'r�r�r=r=r>�	namespace�szIMAP4.namespacecCs
|�d�S)zFSend NOOP command.

        (typ, [data]) = <instance>.noop()
        r(r�rbr=r=r>r��sz
IMAP4.noopcCs(d}|�|||||�\}}|�||d�S)z�Fetch truncated part of a message.

        (typ, [data, ...]) = <instance>.partial(message_num, message_part, start, length)

        'data' is tuple of message part envelope and data.
        r)rr�)rTZmessage_numZmessage_part�startZlengthr�r�r�r=r=r>�partial�sz
IMAP4.partialcCsd}|�d|�S)z�Assume authentication as "user".

        Allows an authorised administrator to proxy into any user's
        mailbox.

        (typ, [data]) = <instance>.proxyauth(user)
        r*r�)rTr�r�r=r=r>�	proxyauth�s	zIMAP4.proxyauthcCs|�d||�S)zkRename old mailbox name to new.

        (typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
        r+r�)rTZ
oldmailboxZ
newmailboxr=r=r>�rename�szIMAP4.renamecGsTd}|r2|jrt�d��|j|d|f|��\}}n|j|f|��\}}|�|||�S)z�Search mailbox for matching messages.

        (typ, [data]) = <instance>.search(charset, criterion, ...)

        'data' is space separated list of matching message numbers.
        If UTF8 is enabled, charset MUST be None.
        r,z'Non-None charset not valid in UTF8 mode�CHARSET)rYrr?r�r�)rT�charsetZcriteriar�r�r�r=r=r>�search�s
zIMAP4.searchr�FcCsvi|_||_|rd}nd}|�||�\}}|dkr@d|_||fSd|_d|jkrb|sb|�d|��||j�dd	g�fS)
atSelect a mailbox.

        Flush all untagged responses.

        (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)

        'data' is count of messages in mailbox ('EXISTS' response).

        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via <instance>.response('FLAGS') etc.
        rr-rerr�	READ-ONLYz%s is not writable�EXISTSN)rHrJr�rErA�get)rTr�rAr�r�r�r=r=r>�select�s
�zIMAP4.selectcCs|�d|||�S)zZSet a mailbox acl.

        (typ, [data]) = <instance>.setacl(mailbox, who, what)
        r.r�)rTr�r�Zwhatr=r=r>�setacl�szIMAP4.setaclcGs |jd|��\}}|�||d�S)z_(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs.r/r�)r/r�)rTryr�r�r=r=r>�
setannotationszIMAP4.setannotationcCs |�d||�\}}|�||d�S)ziSet the quota root's resource limits.

        (typ, [data]) = <instance>.setquota(root, limits)
        r0r�r�)rTr�Zlimitsr�r�r=r=r>�setquota	szIMAP4.setquotacGsFd}|d|dfdkr d|}|j|||f|��\}}|�|||�S)z�IMAP4rev1 extension SORT command.

        (typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
        r1rr�r�r�r�)rTZ
sort_criteriar��search_criteriar�r�r�r=r=r>�sorts
z
IMAP4.sortNcCs�d}ts|�d��|jr"|�d��||jkr6|�d��|dkrFt��}|�|�\}}|dkr�|j|j	|j
d�|_	|j	�d�|_d|_|�
�n
|�d	��|�|||�S)
Nr2zSSL support missingzTLS session already establishedzTLS not supported by serverre�Zserver_hostnamerTzCouldn't establish TLS session)�HAVE_SSLr?rLr@rm�ssl�_create_stdlib_contextr��wrap_socketr�rUr�r�rkr�)rT�ssl_contextr�r�r�r=r=r>�starttls s&



�

zIMAP4.starttlscCs$d}|�|||�\}}|�|||�S)zpRequest named status conditions for mailbox.

        (typ, [data]) = <instance>.status(mailbox, names)
        r3r�)rTr��namesr�r�r�r=r=r>�status7szIMAP4.statuscCs>|d|dfdkrd|}|�d|||�\}}|�||d�S)z�Alters flag dispositions for messages in mailbox.

        (typ, [data]) = <instance>.store(message_set, command, flags)
        rr�r�r�r4rr�)rTr��commandr�r�r�r=r=r>�storeCszIMAP4.storecCs|�d|�S)zYSubscribe to new mailbox.

        (typ, [data]) = <instance>.subscribe(mailbox)
        r5r�r�r=r=r>�	subscribeNszIMAP4.subscribecGs*d}|j|||f|��\}}|�|||�S)z�IMAPrev1 extension THREAD command.

        (type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
        r6r�)rTZthreading_algorithmr�r�r�r�r�r=r=r>�threadVszIMAP4.threadc	Gs�|��}|tkr|�d|��|jt|krL|�d||jd�t|�f��d}|j||f|��\}}|dkrt|}nd}|�|||�S)z�Execute "command arg ..." with messages identified by UID,
                rather than message number.

        (typ, [data]) = <instance>.uid(command, arg1, arg2, ...)

        Returns response appropriate to 'command'.
        zUnknown IMAP4 UID command: %s�9command %s illegal in state %s, only allowed in states %s�, r7)r,r1r6r)r�rpr?rE�joinr�r�)rTr�ryr�r�r�r=r=r>�uid`s��z	IMAP4.uidcCs|�d|�S)z_Unsubscribe from old mailbox.

        (typ, [data]) = <instance>.unsubscribe(mailbox)
        r8r�r�r=r=r>�unsubscribeyszIMAP4.unsubscribecGs,|��}|tkr|jft|<|j|f|��S)aAllow simple extension commands
                notified by server in CAPABILITY response.

        Assumes command is legal in current state.

        (typ, [data]) = <instance>.xatom(name, arg, ...)

        Returns response appropriate to extension command `name'.
        )r�rprEr��rTr�ryr=r=r>�xatom�s
zIMAP4.xatomcCs8|dkrd}|j}||kr*||�|�n
|g||<dS�N�)rHr�r�)rTr�r�Zurr=r=r>�_append_untagged�szIMAP4._append_untaggedcCs,|j�d�}|r(|�|d�|jd���dS)N�BYEr�r�)rHr�r@r�rZ)rT�byer=r=r>�
_check_bye�szIMAP4._check_byec

Gs�|jt|kr4d|_|�d||jd�t|�f��dD]}||jkr8|j|=q8d|jkrj|jsj|�d��|��}t	||j
�}|d|}|D]0}|dkr�q�t|t�r�t	||j
�}|d|}q�|j}|dk	�r
d|_t
|�t
|j�kr�|}nd}|t	dt|�|j
�}z|�|t�Wn2tk
�rN}	z|�d|	��W5d}	~	XYnX|dk�r^|S|���r||j|�r^|S�q^|�r�||j�}z|�|�|�t�Wn2tk
�r�}	z|�d|	��W5d}	~	XYnX|�s^�q�q^|S)	Nr�r�re�NO�BADr�z#mailbox status changed to READ-ONLY� z {%s}zsocket error: %s)rErprFr?rrHrJrA�_new_tag�bytesrZr�r��type�_commandr�r�r�rRr@rjrGrI)
rTr�ryr��tagr��argrFZ	literator�valr=r=r>r�sb��


�


 



 zIMAP4._commandc
Cs�|dk}|s|��z|j||d�\}}Wnj|jk
r`}z|�d||f��W5d}~XYn6|jk
r�}z|�d||f��W5d}~XYnX|s�|��|dkr�|�d|||f��||fS)Nr)�
expect_byezcommand: %s => %srz%s command error: %s %s)r�_get_tagged_responser@r?)rTr�rrxr�r�rr=r=r>�_command_complete�s"$zIMAP4._command_completecCsJ|��\}}|dgkr |�d��t|d|j�}|��}t|���|_dS)Nz"no CAPABILITY response from serverr�)r�r?r�rZr��tuple�splitrmr�r=r=r>rk
s

zIMAP4._get_capabilitiescCs�|��}|�|j|�rp|j�d�}||jkr:|�d|��|j�d�}t||j�}|j�d�}||gf|j|<n�d}|�t	|�s�|�|j
|�r�|j�d�}|jdkr�|�t|�r�|j�d�|_dS|�d|��|j�d�}t||j�}|j�d�}|dk�rd}|�r|d|}|�|j
|��rZt|j�d	��}|�|�}|�|||f�|��}�q|�||�|d
k�r�|�t|��r�|j�d�}t||j�}|�||j�d��|S)Nrzunexpected tagged response: %rrr�Zdata2zunexpected response: %rrrr�r)�	_get_line�_matchrh�mo�grouprGr@r�rZ�Untagged_responsera�ContinuationrIr_�intr�r�
Response_code)rT�resprr�r�Zdat2r�r�r=r=r>rjsH



zIMAP4._get_responsec
Cs�|j|}|dk	r|j|=|S|rDd}|j�|d�}|dk	rD||fS|��z|��Wq|jk
r~}z�W5d}~XYqXqdS)Nr	)rGrH�poprrjr@)rTrr�resultr�r
rr=r=r>rcs
zIMAP4._get_tagged_responsecCs>|��}|s|�d��|�d�s.|�d|��|dd�}|S)Nzsocket error: EOFrz#socket error: unterminated line: %r���)r�r@�endswithr�r=r=r>r�s

zIMAP4._get_linecCs|�|�|_|jdk	Srv)�matchr)rTZcre�sr=r=r>r�szIMAP4._matchcCs2|jtt|j�|j�}|jd|_d|j|<|S)Nr�)rgrr�rKrZrG)rTrr=r=r>r�s
zIMAP4._new_tagcCs$|�dd�}|�dd�}d|dS)N�\z\\�"z\")r�)rTrr=r=r>r��szIMAP4._quotecGs|�||j|f|���Srv)rrrr=r=r>r��szIMAP4._simple_commandcCs8|dkr||fS||jkr$|dgfS|j�|�}||fS)Nr
)rHr%)rTr�r�r�r�r=r=r>r��s

zIMAP4._untagged_response)r�r�)r�r�)r�F)N)F)Tr:r;r<�__doc__rPr?r@rA�
IMAP4_PORTrWrMrdrOrurwrzr~rNr�r�r�rQr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrkrjrrrrr�r�r��_mesgZ_dump_urZ_logZ	print_logr=r=r=r>r�s�,*
		
	



 	

M	P
!$c@s:eZdZdZdedddfdd�Zdd�Zdefdd	�ZdS)
�	IMAP4_SSLa3IMAP4 client class over SSL connection

        Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile[, ssl_context]]]]])

                host - host's name (default: localhost);
                port - port number (default: standard IMAP4 SSL port);
                keyfile - PEM formatted file that contains your private key (default: None);
                certfile - PEM formatted certificate chain file (default: None);
                ssl_context - a SSLContext object that contains your certificate chain
                              and private key (default: None)
                Note: if ssl_context is provided, then parameters keyfile or
                certfile should not be set otherwise ValueError is raised.

        for more documentation see the docstring of the parent class IMAP4.
        rBNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
|||�dS)Nz8ssl_context and keyfile arguments are mutually exclusivez9ssl_context and certfile arguments are mutually exclusiverzEkeyfile and certfile are deprecated, use a custom ssl_context instead�)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningr3r2r�r�r�rrW)rTrUrVr3r2r�r5r=r=r>rW�s$��zIMAP4_SSL.__init__cCst�|�}|jj||jd�S)Nr�)rr~r�r�rU)rTr�r=r=r>r~s
�zIMAP4_SSL._create_socketcCst�|||�dS)z�Setup connection to remote server on "host:port".
                (default: localhost:standard IMAP4 SSL port).
            This connection will be used by the routines:
                read, readline, send, shutdown.
            N)rrNrSr=r=r>rNszIMAP4_SSL.open)r:r;r<r-�IMAP4_SSL_PORTrWr~rNr=r=r=r>r0�s�
r0c@sBeZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)rz�IMAP4 client class over a stream

    Instantiate with: IMAP4_stream(command)

            "command" - a string that can be passed to subprocess.Popen()

    for more documentation see the docstring of the parent class IMAP4.
    cCs||_t�|�dSrv)r�rrW)rTr�r=r=r>rW/szIMAP4_stream.__init__NcCsNd|_d|_d|_d|_tj|jttjtjddd�|_	|j	j
|_|j	j|_
dS)z�Setup a stream connection.
        This connection will be used by the routines:
            read, readline, send, shutdown.
        NT)�bufsize�stdin�stdout�shellZ	close_fds)rUrVr�r��
subprocess�Popenr�r�PIPEr�r:�	writefiler;�readfilerSr=r=r>rN4s�
zIMAP4_stream.opencCs|j�|�Sr�)rAr�r�r=r=r>r�DszIMAP4_stream.readcCs
|j��S)r�)rAr�rbr=r=r>r�IszIMAP4_stream.readlinecCs|j�|�|j��dS)r�N)r@�write�flushr�r=r=r>r�NszIMAP4_stream.sendcCs"|j��|j��|j��dS)r�N)rAr�r@r��waitrbr=r=r>rQTs

zIMAP4_stream.shutdown)NN)
r:r;r<r-rWrNr�r�r�rQr=r=r=r>r#s

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zcPrivate class to provide en/decoding
            for base64-based authentication conversation.
    cCs
||_dSrv)r�)rTZmechinstr=r=r>rWbsz_Authenticator.__init__cCs&|�|�|��}|dkrdS|�|�S)N�*)r�r�r�)rTr�Zretr=r=r>r�esz_Authenticator.processcCsnd}t|t�r|�d�}|rjt|�dkrB|dd�}|dd�}n|}d}t�|�}|r||dd�}q|S)Nrrc�0r�)r�r�r�r��binasciiZ
b2a_base64)rT�inpZoup�t�er=r=r>r�ks	


z_Authenticator.encodecCs|sdSt�|�Sr)rGZ
a2b_base64)rTrHr=r=r>r��sz_Authenticator.decodeN)r:r;r<r-rWr�r�r�r=r=r=r>r�\s
r�z0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decr�cCsi|]\}}|��|d�qS)r�)r�)�.0�nr*r=r=r>�
<dictcomp>�srMr�c	Cs�t�|�}|sdSt|�d�}|�d�}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}t|�d	��}	t|�d
��}
|	d|
d}|dkr�|}||||||d
d
d
f	}t�|�|}
t�|
�S)z�Parse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time tuple or None if the string has wrong format.
    N�mon�zonen�day�year�hour�min�sec�zoneh�zonem�<�-r�)	�InternalDater)�Mon2numrr"�calendarZtimegm�time�	localtime)r$rrNrOrPrQrRrSrTrUrVZzoneZtt�utcr=r=r>r�s$

cCs@d}d}tt|��}|r<t|d�\}}|||d�|}q|S)z-Convert integer to A-P string representation.rsABCDEFGHIJKLMNOP�r�)r"�abs�divmod)ZnumrZAP�modr=r=r>r	�scCs$t�|�}|sdSt|�d����S)z-Convert IMAP4 flags response to python tuple.r=r�)�Flagsr)rrr)r$rr=r=r>r
�s
cCst|ttf�r"t�|tj���}n�t|t�r�z
|j	}WnZt
k
r�tjr�|d}|dkrpt�
t�|��d}tjtjf|}ntj}YnXt|d�}t|dd�dt|�i�}nLt|t�r�|jdkr�td��|}n*t|t�r�|d|dfd	kr�|Std
��d�t|j�}|�|�S)a�Convert date_time to IMAP4 INTERNALDATE representation.

    Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'.  The
    date_time argument can be a number (int or float) representing
    seconds since epoch (as returned by time.time()), a 9-tuple
    representing local time, an instance of time.struct_time (as
    returned by time.localtime()), an aware datetime instance or a
    double-quoted string.  In the last case, it is assumed to already
    be in the correct format.
    �r�)ZsecondsN��tzinfozdate_time must be awarer)r,r,zdate_time not of a known typez"%d-{}-%Y %H:%M:%S %z")r�r"�floatrZ
fromtimestamprr^Z
astimezoner�	tm_gmtoffrsr\�daylightr]�mktime�altzonerrfr4r��format�MonthsZmonth�strftime)r�ZdtZgmtoffZdstZdeltaZfmtr=r=r>r�s2�





�__main__zd:s:)r=r=z-dz-s)rBzIMAP password for %s on %s: Z	localhostzJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s�
)r�Zlfr�)r�)�
/tmp/xxx 1)r�)rqz/tmp/yyy)r��
/tmp/yyz 2r�rs)r�)z/tmpzyy*)r�rr)r�)NZSUBJECTZtest)r�)�1z(FLAGS INTERNALDATE RFC822))r�)rt�FLAGSz
(\Deleted))r�r=)r�r=)r�r=)r�r=)r�r=)r�)ZUIDVALIDITY)r)r,ZALL)r�)r�)rxr=cCsLt�d||f�tt|�|�\}}t�d|||f�|dkrH|d�|S)Nz%s %sz%s => %s %sr
r)�Mr/rq)�cmdryr�r�r=r=r>�run'srxrzPROTOCOL_VERSION = %szCAPABILITIES = %rr�)z/tmp/zyy%z.*"([^"]+)"$r�r�rrz%sz:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)z
All tests OK.z
Tests failed.z8
If you would like to see debugging output,
try: %s -d5
)Ur-rirGr�rfr[r}r=r{r\r[rrr�iorr�r��ImportError�__all__r�rCr.r8rlr�rpr\r!rcrYr^r_r�r#r rar]r`rr0r�rr�rrm�	enumeraterZrr	r
rr:ZgetoptZgetpass�argvZoptlistryr?rZstream_command�optr"rUZgetuserZUSERZPASSWDZ	test_mesgZ	test_seq1Z	test_seq2rxrvrEr/rnrmrwZmlr)rr�pathr�r�printr=r=r=r>�<module>sZH
�	�/



	

�l4
9,
#
)





��


�
�random.cpython-38.pyc000064400000047216151450073350010471 0ustar00U

e5d�p�@sdZddlmZddlmZmZm	Z
mZm
ZddlmZmZmZmZddlmZddlmZmZddlm Z!m"Z#ddl$m$Z%dd	lZ&zdd
l'm(Z'Wn e)k
r�dd
l*m(Z'YnXddd
ddddddddddddddddddd d!d"gZ+d#ed$�ed%�Z,d%e
Z-ed&�Z.d'ed(�Z/d)Z0d*e0Z1dd	l2Z2Gd+d�de2j3�Z3Gd,d"�d"e3�Z4d-d.�Z5d5d0d1�Z6e3�Z7e7j8Z8e7j9Z9e7j:Z:e7j;Z;e7j<Z<e7j=Z=e7j>Z>e7j?Z?e7j@Z@e7jAZAe7jBZBe7jCZCe7jDZDe7jEZEe7jFZFe7jGZGe7jHZHe7jIZIe7jJZJe7jKZKe7jLZLe7jMZMeNe&d2��re&jOe7j8d3�ePd4k�re6�d	S)6a�Random variable generators.

    integers
    --------
           uniform within range

    sequences
    ---------
           pick random element
           pick random sample
           pick weighted random sample
           generate random permutation

    distributions on the real line:
    ------------------------------
           uniform
           triangular
           normal (Gaussian)
           lognormal
           negative exponential
           gamma
           beta
           pareto
           Weibull

    distributions on the circle (angles 0 to 2pi)
    ---------------------------------------------
           circular uniform
           von Mises

General notes on the underlying Mersenne Twister core generator:

* The period is 2**19937-1.
* It is one of the most extensively tested generators in existence.
* The random() method is implemented in C, executes in a single Python step,
  and is, therefore, threadsafe.

�)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�urandom)�Set�Sequence)�
accumulate�repeat)�bisectN)�sha512�Random�seed�random�uniform�randint�choice�sample�	randrange�shuffle�
normalvariate�lognormvariate�expovariate�vonmisesvariate�gammavariate�
triangular�gauss�betavariate�
paretovariate�weibullvariate�getstate�setstate�getrandbits�choices�SystemRandom�g��@�@��?�@�5�cs$eZdZdZdZd?dd�Zdd�Zd@�fd	d
�	Z�fdd�Z�fd
d�Z	dd�Z
dd�Zdd�Zdde
fdd�Zdd�Zdd�Ze
de>fdd�ZeZdd�ZdAd d!�Zd"d#�ZdBddd$�d%d&�Zd'd(�ZdCd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"�Z#S)Dra�Random number generator base class used by bound module functions.

    Used to instantiate instances of Random to get generators that don't
    share state.

    Class Random can also be subclassed if you want to use a different basic
    generator of your own devising: in that case, override the following
    methods:  random(), seed(), getstate(), and setstate().
    Optionally, implement a getrandbits() method so that randrange()
    can cover arbitrarily large ranges.

    �NcCs|�|�d|_dS)zeInitialize an instance.

        Optional argument x controls seeding, as for Random.seed().
        N)r�
gauss_next)�self�x�r6�/usr/lib64/python3.8/random.py�__init__^s
zRandom.__init__cKsJ|jD]>}d|jkrqFd|jkr.|j|_qFd|jkr|j|_qFqdS)aControl how subclasses generate random integers.

        The algorithm a subclass can use depends on the random() and/or
        getrandbits() implementation available to it and determines
        whether it can generate random integers from arbitrarily large
        ranges.
        �
_randbelowr(rN)�__mro__�__dict__�_randbelow_with_getrandbitsr9�_randbelow_without_getrandbits)�cls�kwargs�cr6r6r7�__init_subclass__gs	



zRandom.__init_subclass__r1cs�|dkr�t|ttf�r�t|t�r*|�d�n|}|rBt|d�d>nd}tt|�D]}d||Ad@}qP|t|�N}|dkr~dn|}|d	kr�t|tttf�r�t|t�r�|��}|t	|��
�7}t�|d
�}t
��|�d|_dS)aInitialize internal state from hashable object.

        None or no argument seeds from current time or from an operating
        system specific randomness source if available.

        If *a* is an int, all bits are used.

        For version 2 (the default), all of the bits are used if *a* is a str,
        bytes, or bytearray.  For version 1 (provided for reproducing random
        sequences from older versions of Python), the algorithm for str and
        bytes generates a narrower range of seeds.

        �zlatin-1r�iCBl����������r1�bigN)�
isinstance�str�bytes�decode�ord�map�len�	bytearray�encode�_sha512Zdigest�int�
from_bytes�superrr3)r4�a�versionr5r@��	__class__r6r7r{s
zRandom.seedcs|jt���|jfS)z9Return internal state; can be passed to setstate() later.)�VERSIONrSr&r3�r4rVr6r7r&�szRandom.getstatec
s�|d}|dkr*|\}}|_t��|�nt|dkr�|\}}|_ztdd�|D��}Wn(tk
r|}z
t|�W5d}~XYnXt��|�ntd||jf��dS)z:Restore internal state from object returned by getstate().rr2r1css|]}|dVqdS)lNr6)�.0r5r6r6r7�	<genexpr>�sz"Random.setstate.<locals>.<genexpr>Nz?state with version %s passed to Random.setstate() of version %s)r3rSr'�tuple�
ValueError�	TypeErrorrX)r4�staterUZ
internalstaterrVr6r7r'�s�zRandom.setstatecCs|��S�N)r&rYr6r6r7�__getstate__�szRandom.__getstate__cCs|�|�dSr`)r')r4r_r6r6r7�__setstate__�szRandom.__setstate__cCs|jd|��fS)Nr6)rWr&rYr6r6r7�
__reduce__�szRandom.__reduce__rBc
Cs||�}||krtd��|dkr:|dkr2|�|�Std��||�}||krRtd��||}|dkrx|dkrx||�|�S|dkr�td|||f��||�}||kr�td��|dkr�||d|}	n"|dkr�||d|}	ntd	��|	dkr�td��|||�|	�S)
z�Choose a random item from range(start, stop[, step]).

        This fixes the problem with randint() which includes the
        endpoint; in Python this is usually not what you want.

        z!non-integer arg 1 for randrange()Nrzempty range for randrange()z non-integer stop for randrange()rBz(empty range for randrange() (%d, %d, %d)z non-integer step for randrange()zzero step for randrange())r]r9)
r4�start�stop�step�_intZistartZistop�widthZistep�nr6r6r7r�s4

zRandom.randrangecCs|�||d�S)zJReturn random integer in range [a, b], including both end points.
        rB)r�r4rT�br6r6r7r�szRandom.randintcCs,|j}|��}||�}||kr(||�}q|S)zCReturn a random int in the range [0,n).  Raises ValueError if n==0.)r(�
bit_length)r4rir(�k�rr6r6r7r<�s
z"Random._randbelow_with_getrandbitscCsn|j}||kr$td�||�|�S|dkr4td��||}|||}|�}||kr^|�}qN|||�|S)z�Return a random int in the range [0,n).  Raises ValueError if n==0.

        The implementation does not use getrandbits, but only random.
        z�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.rzBoundary cannot be zero)r�_warnr])r4rirQ�maxsizerZrem�limitrnr6r6r7r=sz%Random._randbelow_without_getrandbitscCs:z|�t|��}Wntk
r0td�d�YnX||S)z2Choose a random element from a non-empty sequence.z$Cannot choose from an empty sequenceN)r9rMr]�
IndexError)r4�seq�ir6r6r7rs
z
Random.choicecCs�|dkrN|j}ttdt|���D]*}||d�}||||||<||<q nHt}ttdt|���D]0}||�|d�}||||||<||<qddS)z�Shuffle list x in place, and return None.

        Optional argument random is a 0-argument function returning a
        random float in [0.0, 1.0); if it is the default None, the
        standard random.random will be used.

        NrB)r9�reversed�rangerMrQ)r4r5r�	randbelowrt�jrgr6r6r7r%s	zRandom.shufflecCst|t�rt|�}t|t�s$td��|j}t|�}d|krF|ksPntd��dg|}d}|dkr�|dtt	|dd��7}||kr�t
|�}t|�D]0}|||�}	||	||<|||d	||	<q�nHt�}
|
j
}t|�D]2}||�}	|	|
kr�||�}	q�||	�||	||<q�|S)
a=Chooses k unique random elements from a population sequence or set.

        Returns a new list containing elements from the population while
        leaving the original population unchanged.  The resulting list is
        in selection order so that all sub-slices will also be valid random
        samples.  This allows raffle winners (the sample) to be partitioned
        into grand prize and second place winners (the subslices).

        Members of the population need not be hashable or unique.  If the
        population contains repeats, then each occurrence is a possible
        selection in the sample.

        To choose a sample in a range of integers, use range as an argument.
        This is especially fast and space efficient for sampling from a
        large population:   sample(range(10000000), 60)
        z>Population must be a sequence or set.  For dicts, use list(d).rz,Sample larger than population or is negativeN��r+r2rB)rG�_Setr\�	_Sequencer^r9rMr]�_ceil�_log�listrv�set�add)r4�
populationrmrwri�resultZsetsizeZpoolrtrxZselectedZselected_addr6r6r7r;s6)



z
Random.sample)�cum_weightsrmcs�|j�t����dkrV|dkrHt��d7�����fdd�td|�D�Stt|���n|dk	rftd��t���krztd��t��dd��d�������fd	d�td|�D�S)
z�Return a k sized list of population elements chosen with replacement.

        If the relative weights or cumulative weights are not specified,
        the selections are made with equal probability.

        N�csg|]}�������qSr6r6�rZrt)rgrir�rr6r7�
<listcomp>�sz"Random.choices.<locals>.<listcomp>z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrDrBcs$g|]}������d���qS)rr6r�)rr��hir�r�totalr6r7r��s�)	rrMrQ�_repeatr�_accumulater^r]�_bisect)r4r�Zweightsr�rmr6)rgrr�r�rir�rr�r7r)�s$�zRandom.choicescCs||||��S)zHGet a random number in the range [a, b) or [a, b] depending on rounding.�rrjr6r6r7r�szRandom.uniformr�r.cCs||��}z |dkrdn||||}Wntk
r@|YSX||krdd|}d|}||}}|||t||�S)z�Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution

        N��?r.)r�ZeroDivisionError�_sqrt)r4ZlowZhigh�mode�ur@r6r6r7r!�s	 

zRandom.triangularcCsP|j}|�}d|�}t|d|}||d}|t|�krqDq|||S)z\Normal distribution.

        mu is the mean, and sigma is the standard deviation.

        r.r�r-)r�
NV_MAGICCONSTr~)r4�mu�sigmar�u1�u2�zZzzr6r6r7r�s

zRandom.normalvariatecCst|�||��S)z�Log normal distribution.

        If you take the natural logarithm of this distribution, you'll get a
        normal distribution with mean mu and standard deviation sigma.
        mu can have any value, and sigma must be greater than zero.

        )�_expr)r4r�r�r6r6r7r�szRandom.lognormvariatecCstd|���|S)a^Exponential distribution.

        lambd is 1.0 divided by the desired mean.  It should be
        nonzero.  (The parameter would be called "lambda", but that is
        a reserved word in Python.)  Returned values range from 0 to
        positive infinity if lambd is positive, and from negative
        infinity to 0 if lambd is negative.

        r.)r~r)r4Zlambdr6r6r7r�szRandom.expovariatecCs�|j}|dkrt|�Sd|}|td||�}|�}tt|�}|||}|�}	|	d||ks�|	d|t|�kr4q�q4d|}
|
|d|
|}|�}|dkr�|t|�t}
n|t|�t}
|
S)aFCircular data distribution.

        mu is the mean angle, expressed in radians between 0 and 2*pi, and
        kappa is the concentration parameter, which must be greater than or
        equal to zero.  If kappa is equal to zero, this distribution reduces
        to a uniform random angle over the range 0 to 2*pi.

        g���ư>r�r.)r�TWOPIr��_cos�_pir��_acos)r4r�Zkappar�srnr�r��dr��q�fZu3Zthetar6r6r7r�s$
$zRandom.vonmisesvariatecCs~|dks|dkrtd��|j}|dkr�td|d�}|t}||}|�}d|kr`dksdqFqFd|�}t|d|�|}	|t|	�}
|||}|||	|
}|td|dks�|t|�krF|
|SqFn�|dkr�td|��|S|�}
t|t}||
}|dk�r$|d|}
nt|||�}
|�}|dk�r^||
|dk�rp�qrq�|t|
�kr�qrq�|
|SdS)	aZGamma distribution.  Not the gamma function!

        Conditions on the parameters are alpha > 0 and beta > 0.

        The probability distribution function is:

                    x ** (alpha - 1) * math.exp(-x / beta)
          pdf(x) =  --------------------------------------
                      math.gamma(alpha) * beta ** alpha

        r�z*gammavariate: alpha and beta must be > 0.0r.r,gH�����z>g�P���?r/N)r]rr��LOG4r~r��
SG_MAGICCONST�_e)r4�alpha�betarZainvZbbbZcccr�r��vr5r�rnr�rk�pr6r6r7r #s@
 

zRandom.gammavariatecCs`|j}|j}d|_|dkrT|�t}tdtd|���}t|�|}t|�||_|||S)z�Gaussian distribution.

        mu is the mean, and sigma is the standard deviation.  This is
        slightly faster than the normalvariate() function.

        Not thread-safe without a lock around calls.

        Ng�r.)rr3r�r�r~r��_sin)r4r�r�rr�Zx2piZg2radr6r6r7r"hs
zRandom.gausscCs0|�|d�}|dkrdS|||�|d�SdS)z�Beta distribution.

        Conditions on the parameters are alpha > 0 and beta > 0.
        Returned values range between 0 and 1.

        r.rr�N)r )r4r�r��yr6r6r7r#�s
zRandom.betavariatecCsd|��}d|d|S)z3Pareto distribution.  alpha is the shape parameter.r.r�)r4r�r�r6r6r7r$�szRandom.paretovariatecCs"d|��}|t|�d|S)zfWeibull distribution.

        alpha is the scale parameter and beta is the shape parameter.

        r.)rr~)r4r�r�r�r6r6r7r%�szRandom.weibullvariate)N)Nr1)N)N)r�r.N)$�__name__�
__module__�__qualname__�__doc__rXr8rArr&r'rarbrcrQrrr<�BPFr=r9rrrr)rr!rrrrr r"r#r$r%�
__classcell__r6r6rVr7rNs<

	 ,

G
0E5	c@s8eZdZdZdd�Zdd�Zdd�Zdd	�ZeZZ	d
S)r*z�Alternate random number generator using sources provided
    by the operating system (such as /dev/urandom on Unix or
    CryptGenRandom on Windows).

     Not available on all systems (see os.urandom() for details).
    cCst�td�d�d?tS)z3Get the next random number in the range [0.0, 1.0).rCrFr2)rQrR�_urandom�	RECIP_BPFrYr6r6r7r�szSystemRandom.randomcCs<|dkrtd��|dd}t�t|�d�}||d|?S)z:getrandbits(k) -> x.  Generates an int with k random bits.rz(number of bits must be greater than zerorC�rF)r]rQrRr�)r4rmZnumbytesr5r6r6r7r(�s
zSystemRandom.getrandbitscOsdS)z<Stub method.  Not used for a system random number generator.Nr6�r4�args�kwdsr6r6r7r�szSystemRandom.seedcOstd��dS)zAMethod should not be called for a system random number generator.z*System entropy source does not have state.N)�NotImplementedErrorr�r6r6r7�_notimplemented�szSystemRandom._notimplementedN)
r�r�r�r�rr(rr�r&r'r6r6r6r7r*�scCs�ddl}t|d|j�d}d}d}d}|��}t|�D]4}	||�}
||
7}||
|
}t|
|�}t|
|�}q6|��}tt||d�ddd	�||}t||||�}
td
||
||f�dS)Nr�timesr�g _�Bg _��r2zsec,� )�endz"avg %g, stddev %g, min %g, max %g
)	�time�printr��perf_counterrv�min�max�roundr�)ri�funcr�r�r�ZsqsumZsmallestZlargestZt0rtr5�t1ZavgZstddevr6r6r7�_test_generator�s(

�r���cCs�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td	�t|td
�t|td�t|td�t|td�t|td
�dS)Nr6)r�r.)g{�G�z�?r.)皙�����?r.)r�r,)r�r.)g�������?r.)r.r.)r,r.)g4@r.)gi@r.)�@r�)r�r.gUUUUUU�?)	r�rrrrr r"r#r!)�Nr6r6r7�_test�s r��fork)Zafter_in_child�__main__)r�)Qr��warningsrroZmathrr~rr�rr�rr�rr}rr�r	r�r
r�rr��osrr��_collections_abcr
r{rr|�	itertoolsrr�rr�rr��_osrPr�ImportErrorZhashlib�__all__r�r�r�r�r�r�Z_randomrr*r�r�Z_instrrrr!rrrrrr)rrrrr r"r#r$r%r&r'r(�hasattr�register_at_forkr�r6r6r6r7�<module>s�'�
{

nturl2path.cpython-38.pyc000064400000003322151450073350011302 0ustar00U

e5dG�@sdZdd�Zdd�ZdS)z�Convert a NT pathname to a file URL and vice versa.

This module only exists to provide OS-specific code
for urllib.requests, thus do not use directly.
cCs�ddl}ddl}|�dd�}d|kr\|dd�dkr@|dd�}|�d�}|j�d	�|��S|�d�}t|�dks�|dd
|jkr�d|}t	|��|dd
�
�}|d�d�}|d}|D]}|r�|d	|j�|�}q�|�d�r�|�d�r�|d	7}|S)
z{OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use.�N�:�|�z////��/�\���z	Bad URL: �)�string�urllib.parse�replace�split�parseZunquote�join�lenZ
ascii_letters�OSError�upper�endswith)Zurlr
�urllib�
components�comp�error�drive�path�r�"/usr/lib64/python3.8/nturl2path.py�url2pathnames(	

rcCs4ddl}|dd�dkrf|dd�}|dd���dkrJd|dd�}n|dd�d	krftd
|��d	|kr�|dd�dkr�d|}|�d�}|j�d�|��S|jd	dd
�}t|�dks�t|d�dkr�d
|}t|��|j�|d���}|d�d�}d|d	}|D] }|�r|d|j�|�}�q|S)z{OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use.rNrz\\?\zUNC\rr	rrz
Bad path: z\\r)�maxsplitz///)rrrr
rZquoterr)�prrrrrrrrr�pathname2url-s.
rN)�__doc__rrrrrr�<module>s%opcode.cpython-38.opt-1.pyc000064400000012456151450073350011417 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZzddlmZe�d�Wnek
rPYnXdZgZgZgZ	gZ
gZgZgZ
gZiZdd�ed�D�Zdd�Zdd�Zdd�Zdd�Zedd�edd �ed!d"�ed#d$�ed%d&�ed'd(�ed)d*�ed+d,�ed-d.�ed/d0�ed1d2�ed3d4�ed5d6�ed7d8�ed9d:�ed;d<�ed=d>�ed?d@�edAdB�edCdD�edEdF�edGdH�edIdJ�edKdL�edMdN�edOdP�edQdR�edSdT�edUdV�edWdX�edYdZ�ed[d\�ed]d^�ed_d`�edadb�edcdd�ededf�edgdh�edidj�edkdl�edmdn�edodp�edqdr�edsdt�edudv�edwdx�edydz�ed{d|�ed}d~�edd��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��d�Zed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�dƒed�dăed�dƃed�dȃed�dʃed�d̃e�d̡ed�d΃e�dΡed�dЃe�dСed�d҃ed�dԃed�dփed�d؃ed�dڃe
�dڡed�d܃e
�dܡed�dރe
�dޡed�d�e
�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�e
�d�edd�d�Zed�d�ed�d�ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d�d�e�d�d�e�d�d�e�d�d�e�d�d	�e�d
�d�[[[[�dS(
zy
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
�cmp_op�hasconst�hasname�hasjrel�hasjabs�haslocal�
hascompare�hasfree�opname�opmap�
HAVE_ARGUMENT�EXTENDED_ARG�hasnargs�)�stack_effectr)�<z<=z==z!=�>z>=�inznot in�iszis notzexception matchZBADcCsg|]}d|f�qS)z<%r>�)�.0�oprr�/usr/lib64/python3.8/opcode.py�
<listcomp>%sr�cCs|t|<|t|<dS�N)r	r
��namerrrr�def_op'srcCst||�t�|�dSr)rr�appendrrrr�name_op+s
rcCst||�t�|�dSr)rrrrrrr�jrel_op/s
r cCst||�t�|�dSr)rrrrrrr�jabs_op3s
r!ZPOP_TOP�ZROT_TWO�Z	ROT_THREE�ZDUP_TOP�ZDUP_TOP_TWO�ZROT_FOUR�ZNOP�	ZUNARY_POSITIVE�
ZUNARY_NEGATIVE�Z	UNARY_NOT�ZUNARY_INVERT�ZBINARY_MATRIX_MULTIPLY�ZINPLACE_MATRIX_MULTIPLY�ZBINARY_POWER�ZBINARY_MULTIPLY�Z
BINARY_MODULO�Z
BINARY_ADD�ZBINARY_SUBTRACT�Z
BINARY_SUBSCR�ZBINARY_FLOOR_DIVIDE�ZBINARY_TRUE_DIVIDE�ZINPLACE_FLOOR_DIVIDE�ZINPLACE_TRUE_DIVIDE�Z	GET_AITER�2Z	GET_ANEXT�3ZBEFORE_ASYNC_WITH�4Z
BEGIN_FINALLY�5Z
END_ASYNC_FOR�6ZINPLACE_ADD�7ZINPLACE_SUBTRACT�8ZINPLACE_MULTIPLY�9ZINPLACE_MODULO�;ZSTORE_SUBSCR�<Z
DELETE_SUBSCR�=Z
BINARY_LSHIFT�>Z
BINARY_RSHIFT�?Z
BINARY_AND�@Z
BINARY_XOR�AZ	BINARY_OR�BZ
INPLACE_POWER�CZGET_ITER�DZGET_YIELD_FROM_ITER�EZ
PRINT_EXPR�FZLOAD_BUILD_CLASS�GZ
YIELD_FROM�HZ
GET_AWAITABLE�IZINPLACE_LSHIFT�KZINPLACE_RSHIFT�LZINPLACE_AND�MZINPLACE_XOR�NZ
INPLACE_OR�OZWITH_CLEANUP_START�QZWITH_CLEANUP_FINISH�RZRETURN_VALUE�SZIMPORT_STAR�TZSETUP_ANNOTATIONS�UZYIELD_VALUE�VZ	POP_BLOCK�WZEND_FINALLY�XZ
POP_EXCEPT�Y�ZZ
STORE_NAMEZDELETE_NAME�[ZUNPACK_SEQUENCE�\ZFOR_ITER�]Z	UNPACK_EX�^Z
STORE_ATTR�_ZDELETE_ATTR�`ZSTORE_GLOBAL�aZ
DELETE_GLOBAL�bZ
LOAD_CONST�dZ	LOAD_NAME�eZBUILD_TUPLE�fZ
BUILD_LIST�gZ	BUILD_SET�hZ	BUILD_MAP�iZ	LOAD_ATTR�jZ
COMPARE_OP�kZIMPORT_NAME�lZIMPORT_FROM�mZJUMP_FORWARD�nZJUMP_IF_FALSE_OR_POP�oZJUMP_IF_TRUE_OR_POP�pZ
JUMP_ABSOLUTE�qZPOP_JUMP_IF_FALSE�rZPOP_JUMP_IF_TRUE�sZLOAD_GLOBAL�tZ
SETUP_FINALLY�zZ	LOAD_FAST�|Z
STORE_FAST�}ZDELETE_FAST�~Z
RAISE_VARARGS�Z
CALL_FUNCTION�Z
MAKE_FUNCTION�ZBUILD_SLICE�ZLOAD_CLOSURE�Z
LOAD_DEREF�ZSTORE_DEREF�ZDELETE_DEREF�ZCALL_FUNCTION_KW�ZCALL_FUNCTION_EX�Z
SETUP_WITH�ZLIST_APPEND�ZSET_ADD�ZMAP_ADD�ZLOAD_CLASSDEREF��ZBUILD_LIST_UNPACK�ZBUILD_MAP_UNPACK�ZBUILD_MAP_UNPACK_WITH_CALL�ZBUILD_TUPLE_UNPACK�ZBUILD_SET_UNPACK�ZSETUP_ASYNC_WITH�ZFORMAT_VALUE�ZBUILD_CONST_KEY_MAP�ZBUILD_STRING�ZBUILD_TUPLE_UNPACK_WITH_CALL�ZLOAD_METHOD�ZCALL_METHOD�ZCALL_FINALLY�ZPOP_FINALLY�N)�__doc__�__all__Z_opcoderr�ImportErrorrrrrrrrrr
r
�ranger	rrr r!rrrrrr�<module>sF
�



























































































































threading.cpython-38.opt-2.pyc000064400000054502151450073350012112 0ustar00U

e5d���@s.ddlZddlZddlZddlmZddlm	Z	ddl
mZm
ZzddlmZWn ek
rpddlmZYnXdddd	d
ddd
dddddddddddddddgZejZejZejZejZzejZdZe�d�Wnek
r�dZYnXejZ z
ej!Z"Wnek
�rdZ"YnXej#Z#[da$da%d d�Z&d!d�Z'eZ(d"d�Z!Gd#d$�d$�Z)e)Z*Gd%d�d�Z+Gd&d�d�Z,Gd'd�de,�Z-Gd(d
�d
�Z.Gd)d�d�Z/Gd*d�de0�Z1e�j2Z3e3�dKd,d-�Z4e�a5iZ6iZ7e	�Z8e�a9e:�a;Gd.d�d�Z<zdd/lm=a>m?Z@WnHek
�rRdd0lAmBZCdd1lmDZDeDdd2�Z?d3d�Z@d4d�a>YnXd5d6�ZEGd7d�de<�ZFGd8d9�d9e<�ZGGd:d;�d;e<�ZHd<d	�ZIeIZJd=d�ZKeKZLd>d?�ZMd@d
�ZNddAlmOZOeG�aPdBdC�ZQdDd�ZRzddElmSZTWn"ek
�rddFlUmTZTYnXdGdH�ZVeWedI��r*ejXeVdJ�dS)L�N)�	monotonic)�WeakSet)�islice�count)�deque�	get_ident�active_count�	Condition�current_thread�	enumerate�main_thread�TIMEOUT_MAX�Event�Lock�RLock�	Semaphore�BoundedSemaphore�Thread�Barrier�BrokenBarrierError�Timer�ThreadError�
setprofile�settrace�local�
stack_size�
excepthook�ExceptHookArgsT�
get_native_idFcCs|adS�N)�
_profile_hook��func�r#�!/usr/lib64/python3.8/threading.pyr9scCs|adSr)�_trace_hookr!r#r#r$rCscOstdkrt||�St||�Sr)�_CRLock�_PyRLock)�args�kwargsr#r#r$rQs	
c@sReZdZdd�Zdd�Zddd�ZeZd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_RLockcCst�|_d|_d|_dS�Nr)�_allocate_lock�_block�_owner�_count��selfr#r#r$�__init__hsz_RLock.__init__c	Cs^|j}zt|j}Wntk
r(YnXd|j��r:dnd|jj|jj||j	t
t|��fS)Nz)<%s %s.%s object owner=%r count=%d at %s>�lockedZunlocked)r.�_active�name�KeyErrorr-r3�	__class__�
__module__�__qualname__r/�hex�id)r1�ownerr#r#r$�__repr__ms
�z_RLock.__repr__T���cCsDt�}|j|kr"|jd7_dS|j�||�}|r@||_d|_|S�N�)rr.r/r-�acquire)r1�blocking�timeout�me�rcr#r#r$rA|s
z_RLock.acquirecCs<|jt�krtd��|jd|_}|s8d|_|j��dS)N�cannot release un-acquired lockr@)r.r�RuntimeErrorr/r-�release)r1rr#r#r$rH�sz_RLock.releasecCs|��dSr�rH�r1�t�v�tbr#r#r$�__exit__�sz_RLock.__exit__cCs|j��|\|_|_dSr)r-rAr/r.)r1�stater#r#r$�_acquire_restore�s
z_RLock._acquire_restorecCs<|jdkrtd��|j}d|_|j}d|_|j��||fS)NrrF)r/rGr.r-rH)r1rr<r#r#r$�
_release_save�s

z_RLock._release_savecCs|jt�kSr)r.rr0r#r#r$�	_is_owned�sz_RLock._is_ownedN)Tr>)�__name__r8r9r2r=rA�	__enter__rHrNrPrQrRr#r#r#r$r*^s

$
r*c@speZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
ddd�Zddd�Zdd�Z
e
ZdS)r	NcCs�|dkrt�}||_|j|_|j|_z|j|_Wntk
rDYnXz|j|_Wntk
rfYnXz|j|_Wntk
r�YnXt�|_	dSr)
r�_lockrArHrQ�AttributeErrorrPrR�_deque�_waiters�r1�lockr#r#r$r2�s$zCondition.__init__cCs
|j��Sr)rUrTr0r#r#r$rT�szCondition.__enter__cGs|jj|�Sr)rUrN)r1r(r#r#r$rN�szCondition.__exit__cCsd|jt|j�fS)Nz<Condition(%s, %d)>)rU�lenrXr0r#r#r$r=�szCondition.__repr__cCs|j��dSr)rUrHr0r#r#r$rQ�szCondition._release_savecCs|j��dSr)rUrA)r1�xr#r#r$rPszCondition._acquire_restorecCs"|j�d�r|j��dSdSdS)NrFT)rUrArHr0r#r#r$rRs
zCondition._is_ownedcCs�|��std��t�}|��|j�|�|��}d}z>|dkrN|��d}n |dkrd|�d|�}n
|�d�}|W�S|�|�|s�z|j�|�Wnt	k
r�YnXXdS)Nzcannot wait on un-acquired lockFTr)
rRrGr,rArX�appendrQrP�remove�
ValueError)r1rC�waiterZsaved_stateZgotitr#r#r$�waits*

zCondition.waitcCsXd}|}|�}|sT|dk	rB|dkr.t�|}n|t�}|dkrBqT|�|�|�}q|Sr+)�_timera)r1Z	predicaterC�endtimeZwaittime�resultr#r#r$�wait_for>s

zCondition.wait_forr@c	Csf|��std��|j}tt||��}|s,dS|D]0}|��z|�|�Wq0tk
r^Yq0Xq0dS)Nz!cannot notify on un-acquired lock)rRrGrXrW�_islicerHr^r_)r1�nZall_waitersZwaiters_to_notifyr`r#r#r$�notifyUs
zCondition.notifycCs|�t|j��dSr)rhr[rXr0r#r#r$�
notify_alllszCondition.notify_all)N)N)N)r@)rSr8r9r2rTrNr=rQrPrRrarerhriZ	notifyAllr#r#r#r$r	�s
	
0

	c@s4eZdZddd�Zd
dd�ZeZdd	�Zd
d�ZdS)rr@cCs&|dkrtd��tt��|_||_dS)Nrz$semaphore initial value must be >= 0)r_r	r�_cond�_value�r1�valuer#r#r$r2�szSemaphore.__init__TNc	Cs�|s|dk	rtd��d}d}|j�f|jdkrr|s4q�|dk	rd|dkrPt�|}n|t�}|dkrdq�|j�|�q$|jd8_d}W5QRX|S)Nz.can't specify timeout for non-blocking acquireFrr@T)r_rjrkrbra)r1rBrCrErcr#r#r$rA�s$

zSemaphore.acquirec	Cs.|j�|jd7_|j��W5QRXdSr?)rjrkrhr0r#r#r$rH�szSemaphore.releasecCs|��dSrrIrJr#r#r$rN�szSemaphore.__exit__)r@)TN)rSr8r9r2rArTrHrNr#r#r#r$rxs


-c@seZdZddd�Zdd�ZdS)rr@cCst�||�||_dSr)rr2�_initial_valuerlr#r#r$r2�szBoundedSemaphore.__init__c	CsB|j�2|j|jkrtd��|jd7_|j��W5QRXdS)Nz!Semaphore released too many timesr@)rjrkrnr_rhr0r#r#r$rH�s

zBoundedSemaphore.releaseN)r@)rSr8r9r2rHr#r#r#r$r�s
c@sBeZdZdd�Zdd�Zdd�ZeZdd�Zd	d
�Zddd
�Z	dS)rcCstt��|_d|_dS�NF)r	rrj�_flagr0r#r#r$r2�szEvent.__init__cCs|j�t��dSr)rjr2rr0r#r#r$�_reset_internal_locks�szEvent._reset_internal_lockscCs|jSr)rpr0r#r#r$�is_setszEvent.is_setc	Cs&|j�d|_|j��W5QRXdS�NT)rjrprir0r#r#r$�setsz	Event.setc	Cs|j�d|_W5QRXdSro)rjrpr0r#r#r$�clearszEvent.clearNc
Cs8|j�(|j}|s|j�|�}|W5QR�SQRXdSr)rjrpra)r1rCZsignaledr#r#r$ras
z
Event.wait)N)
rSr8r9r2rqrrZisSetrtrurar#r#r#r$r�s
c@s|eZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��ZdS)rNcCs.tt��|_||_||_||_d|_d|_dSr+)r	rrj�_action�_timeout�_parties�_stater/)r1�parties�actionrCr#r#r$r2Fs	zBarrier.__init__c
Cs�|dkr|j}|j�r|��|j}|jd7_z6|d|jkrL|��n
|�|�|W�W5QR�S|jd8_|��XW5QRXdSr?)rwrj�_enterr/�_exitrx�_release�_wait)r1rC�indexr#r#r$raVs	

zBarrier.waitcCs(|jdkr|j��q|jdkr$t�dS)N�r>r@r)ryrjrarr0r#r#r$r|ts


zBarrier._entercCs>z"|jr|��d|_|j��Wn|���YnXdSr?)rvryrjri�_breakr0r#r#r$r~szBarrier._releasecs4�j��fdd�|�s"���t��jdkr0t�dS)Ncs
�jdkSr+�ryr#r0r#r$�<lambda>��zBarrier._wait.<locals>.<lambda>r)rjrer�rry�r1rCr#r0r$r�s
z
Barrier._waitcCs(|jdkr$|jdkr$d|_|j��dS)Nrr�)r/ryrjrir0r#r#r$r}�s

z
Barrier._exitc	CsT|j�D|jdkr6|jdkr$d|_q<|jdkr<d|_nd|_|j��W5QRXdS)Nrr>���)rjr/ryrir0r#r#r$�reset�s


z
Barrier.resetc	Cs|j�|��W5QRXdSr)rjr�r0r#r#r$�abort�sz
Barrier.abortcCsd|_|j��dS�Nr�)ryrjrir0r#r#r$r��szBarrier._breakcCs|jSr)rxr0r#r#r$rz�szBarrier.partiescCs|jdkr|jSdSr+)ryr/r0r#r#r$�	n_waiting�s
zBarrier.n_waitingcCs
|jdkSr�r�r0r#r#r$�broken�szBarrier.broken)NN)N)rSr8r9r2rar|r~rr}r�r�r��propertyrzr�r�r#r#r#r$r=s	




c@seZdZdS)rN)rSr8r9r#r#r#r$r�s�	Thread-%dcCs
|t�Sr)�_counter)�templater#r#r$�_newname�sr�c@seZdZdZd9dd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
erXdd�Zdd�Z
dd�Zdd�Zdd�Zd:dd�Zd;d!d"�Zed#d$��Zejd%d$��Zed&d'��Zer�ed(d)��Zd*d+�Zd,d-�Zed.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�ZdS)<rFNr#��daemoncCs�|dkri}||_t|pt��|_||_||_|dk	r>||_n
t�j|_d|_	t
rXd|_d|_t
�|_d|_d|_tj|_t�|_t�|�dS)NFT)�_target�strr��_name�_args�_kwargs�	_daemonicr
r��_ident�_HAVE_THREAD_NATIVE_ID�
_native_id�_tstate_lockr�_started�_is_stopped�_initialized�_sys�stderr�_stderr�_make_invoke_excepthook�_invoke_excepthook�	_dangling�add)r1�group�targetr5r(r)r�r#r#r$r2�s&
zThread.__init__cCs(|j��|r|��nd|_d|_dSrs)r�rq�_set_tstate_lockr�r�)r1�is_aliver#r#r$rq(s


zThread._reset_internal_lockscCs^d}|j��rd}|��|jr$d}|jr2|d7}|jdk	rJ|d|j7}d|jj|j|fS)N�initialZstartedZstoppedz daemonz %sz<%s(%s, %s)>)	r�rrr�r�r�r�r7rSr�)r1Zstatusr#r#r$r=4s

zThread.__repr__cCs�|jstd��|j��r td��t�|t|<W5QRXzt|jd�Wn,tk
rtt�t|=W5QRX�YnX|j�	�dS)Nzthread.__init__() not calledz threads can only be started oncer#)
r�rGr�rr�_active_limbo_lock�_limbo�_start_new_thread�
_bootstrap�	Exceptionrar0r#r#r$�startBs

zThread.startcCs.z|jr|j|j|j�W5|`|`|`XdSr)r�r�r�r0r#r#r$�run[s	z
Thread.runcCs4z|��Wn"|jr(tdkr(YdS�YnXdSr)�_bootstrap_innerr�r�r0r#r#r$r�ls
zThread._bootstrapcCst�|_dSr)rr�r0r#r#r$�
_set_ident�szThread._set_identcCst�|_dSr)rr�r0r#r#r$�_set_native_id�szThread._set_native_idc	Cs8t�|_|j��|js4t�t�|j�W5QRXdSr)�
_set_sentinelr�rAr��_shutdown_locks_lock�_shutdown_locksr�r0r#r#r$r��s

zThread._set_tstate_lockcCs�z�|��|��tr|��|j��t�|t|j	<t
|=W5QRXtrVt�
t�trdt�t�z|��Wn|�|�YnXW5t� ztt�=WnYnXW5QRXXdSr)r�r4rr�r�r�r�r�rtr�r�r%r�rr rr�r�r0r#r#r$r��s,



zThread._bootstrap_innerc	Cs>|j}|dk	rd|_d|_|js:t�t�|�W5QRXdSrs)r�r�r�r�r��discardrYr#r#r$�_stop�szThread._stopc	Cst�tt�=W5QRXdSr)r�r4rr0r#r#r$�_delete�szThread._deletecCsZ|jstd��|j��s td��|t�kr2td��|dkrD|��n|jt|d�d�dS)N�Thread.__init__() not calledz'cannot join thread before it is startedzcannot join current threadr)rC)r�rGr�rrr
�_wait_for_tstate_lock�maxr�r#r#r$�join�s


zThread.joinTr>cCs0|j}|dkrn|�||�r,|��|��dSr)r�rArHr�)r1�blockrCrZr#r#r$r��szThread._wait_for_tstate_lockcCs|jSr)r�r0r#r#r$r5s	zThread.namecCst|�|_dSr)r�r��r1r5r#r#r$r5scCs|jSr)r�r0r#r#r$�idents
zThread.identcCs|jSr)r�r0r#r#r$�	native_id$s	zThread.native_idcCs&|js|j��sdS|�d�|jSro)r�r�rrr�r0r#r#r$r�/s	
zThread.is_alivecCs ddl}|jdtdd�|��S)Nrz/isAlive() is deprecated, use is_alive() instead�)�
stacklevel)�warnings�warn�DeprecationWarningr�)r1r�r#r#r$�isAlive=s�zThread.isAlivecCs|jSr)r�r0r#r#r$r�Gs
z
Thread.daemoncCs*|jstd��|j��r td��||_dS)Nr�z)cannot set daemon status of active thread)r�rGr�rrr��r1Zdaemonicr#r#r$r�Vs

cCs|jSrr�r0r#r#r$�isDaemon^szThread.isDaemoncCs
||_dSrr�r�r#r#r$�	setDaemonaszThread.setDaemoncCs|jSr�r5r0r#r#r$�getNamedszThread.getNamecCs
||_dSrr�r�r#r#r$�setNamegszThread.setName)NNNr#N)N)Tr>)rSr8r9r�r2rqr=r�r�r�r�r�r�r�r�r�r�r�r�r�r5�setterr�r�r�r�r�r�r�r�r�r#r#r#r$r�sP	��/	
&









)�_excepthook�_ExceptHookArgs)�print_exception)�
namedtuplez'exc_type exc_value exc_traceback threadcCst|�Sr)r�)r(r#r#r$rwscCs�|jtkrdStdk	r(tjdk	r(tj}n$|jdk	rH|jj}|dkrLdSndS|jdk	r`|jj}nt�}td|�d�|dd�t	|j|j
|j|d�|��dS)NzException in thread �:T��file�flush)r�)
�exc_type�
SystemExitr�r��threadr�r5r�print�_print_exception�	exc_value�
exc_tracebackr�)r(r�r5r#r#r$rzs(



��csPt�tj��dkrtd���dkr*td��tj�t�t������fdd�}|S)Nzthreading.excepthook is Nonezsys.excepthook is Nonec
s�z�z,t}|dkr�}t��|f��}||�Wn�tk
r�}zbd|_~�dk	rb�jdk	rb�j}n|j}�d|dd��dk	r��jdk	r��j}n�}|���W5d}~XYnXW5d}XdS)NTz"Exception in threading.excepthook:r�)rrr��__suppress_context__r�r�)r�r(�hook�excr�Zsys_excepthook�Zlocal_printZ	local_sysZold_excepthookZold_sys_excepthookZsys_exc_infor#r$�invoke_excepthook�s*� z2_make_invoke_excepthook.<locals>.invoke_excepthook)rr�rG�exc_infor�)r�r#r�r$r��s r�c@s&eZdZddd�Zdd�Zdd�ZdS)	rNcCsFt�|�||_||_|dk	r"|ng|_|dk	r4|ni|_t�|_dSr)rr2�interval�functionr(r)r�finished)r1r�r�r(r)r#r#r$r2�s
zTimer.__init__cCs|j��dSr)r�rtr0r#r#r$�cancel�szTimer.cancelcCs6|j�|j�|j��s(|j|j|j�|j��dSr)r�rar�rrr�r(r)rtr0r#r#r$r��s
z	Timer.run)NN)rSr8r9r2r�r�r#r#r#r$r�s	
c@seZdZdd�ZdS)�_MainThreadc	CsTtj|ddd�|��|j��|��tr6|��t�|t	|j
<W5QRXdS)NZ
MainThreadF�r5r�)rr2r�r�rtr�r�r�r�r4r�r0r#r#r$r2�s
z_MainThread.__init__N)rSr8r9r2r#r#r#r$r��sr�c@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)�_DummyThreadc	CsPtj|td�dd�|j��|��tr2|��t�|t	|j
<W5QRXdS)NzDummy-%dTr�)rr2r�r�rtr�r�r�r�r4r�r0r#r#r$r2s
z_DummyThread.__init__cCsdSrr#r0r#r#r$r�
sz_DummyThread._stopcCsdSrsr#r0r#r#r$r�sz_DummyThread.is_aliveNcCsdSrr#r�r#r#r$r�sz_DummyThread.join)N)rSr8r9r2r�r�r�r#r#r#r$r�s
r�cCs,ztt�WStk
r&t�YSXdSr)r4rr6r�r#r#r#r$r
sc
Cs,t�tt�tt�W5QR�SQRXdSr)r�r[r4r�r#r#r#r$r(scCstt���tt���Sr)�listr4�valuesr�r#r#r#r$�
_enumerate4sr�c
Cs4t�&tt���tt���W5QR�SQRXdSr)r�r�r4r�r�r#r#r#r$r8s)rc	Csftjr
dStj}|��t��t�tt�}t��W5QRX|sFqb|D]}|�	�|��qJq dSr)
�_main_threadr�r�rHr�r�r�r�rurA)ZtlockZlocksrZr#r#r$�	_shutdownKs	r�cCstSr)r�r#r#r#r$rss)�_local)rc	Cs�t�ai}ztt�}Wntk
r2t�}YnX|at�at�a	t�xtt
��}|�t�|D]>}||kr�|�
d�t�}||_|||<qb|�
d�|��qbt��t��t�|�W5QRXdS)NTF)r,r�r4rr6r�r�r�rtr�r��updater�rqr�r�r�ru)Z
new_activeZcurrentZthreadsr�r�r#r#r$�_after_fork�s0






r��register_at_fork)Zafter_in_child)r�)Y�os�_os�sysr��_thread�timerrbZ_weakrefsetr�	itertoolsrrfrr/�_collectionsrrW�ImportError�collections�__all__�start_new_threadr��
allocate_lockr,r�rrr�r]rV�errorrrr&r
r r%rrrr*r'r	rrrrrGr�__next__r�r�r�r4r�r�r�rtr�rr�rr�r�	tracebackr�r�r�r�rr�r�r
Z
currentThreadrZactiveCountr�rrr�r�rr�rZ_threading_localr��hasattrr�r#r#r#r$�<module>s��




q'P&O
�5
(5sunau.cpython-38.opt-1.pyc000064400000041272151450073350011277 0ustar00U

e5d�G�@s�dZddlmZddlZedd�ZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZdZeeee	e
egZGdd�de�Zdd�Zdd�ZGdd�d�ZGdd�d�Zd"dd�Zd#d d!�ZdS)$a�Stuff to parse Sun and NeXT audio files.

An audio file consists of a header followed by the data.  The structure
of the header is as follows.

        +---------------+
        | magic word    |
        +---------------+
        | header size   |
        +---------------+
        | data size     |
        +---------------+
        | encoding      |
        +---------------+
        | sample rate   |
        +---------------+
        | # of channels |
        +---------------+
        | info          |
        |               |
        +---------------+

The magic word consists of the 4 characters '.snd'.  Apart from the
info field, all header fields are 4 bytes in size.  They are all
32-bit unsigned integers encoded in big-endian byte order.

The header size really gives the start of the data.
The data size is the physical size of the data.  From the other
parameters the number of frames can be calculated.
The encoding gives the way in which audio samples are encoded.
Possible values are listed below.
The info field currently consists of an ASCII string giving a
human-readable description of the audio file.  The info field is
padded with NUL bytes to the header size.

Usage.

Reading audio files:
        f = sunau.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
        getnchannels()  -- returns number of audio channels (1 for
                           mono, 2 for stereo)
        getsampwidth()  -- returns sample width in bytes
        getframerate()  -- returns sampling frequency
        getnframes()    -- returns number of audio frames
        getcomptype()   -- returns compression type ('NONE' or 'ULAW')
        getcompname()   -- returns human-readable version of
                           compression type ('not compressed' matches 'NONE')
        getparams()     -- returns a namedtuple consisting of all of the
                           above in the above order
        getmarkers()    -- returns None (for compatibility with the
                           aifc module)
        getmark(id)     -- raises an error since the mark does not
                           exist (for compatibility with the aifc module)
        readframes(n)   -- returns at most n frames of audio
        rewind()        -- rewind to the beginning of the audio stream
        setpos(pos)     -- seek to the specified position
        tell()          -- return the current position
        close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing audio files:
        f = sunau.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
        setnchannels(n) -- set the number of channels
        setsampwidth(n) -- set the sample width
        setframerate(n) -- set the frame rate
        setnframes(n)   -- set the number of frames
        setcomptype(type, name)
                        -- set the compression type and the
                           human-readable compression type
        setparams(tuple)-- set all parameters at once
        tell()          -- return current position in output file
        writeframesraw(data)
                        -- write audio frames without pathing up the
                           file header
        writeframes(data)
                        -- write audio frames and patch up the file header
        close()         -- patch up the file header and close the
                           output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�)�
namedtupleN�
_sunau_paramsz7nchannels sampwidth framerate nframes comptype compnameidns.������������l��c@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/sunau.pyr�srcCs8d}td�D]&}|�d�}|s"t�|dt|�}q|S)Nrrr�)�range�read�EOFError�ord)�file�x�iZbyterrr�	_read_u32�s
rcCsFg}td�D]&}t|d�\}}|�dt|��|}q|�t|��dS)Nrrr)r�divmod�insert�int�write�bytes)rr�datar�d�mrrr�
_write_u32�sr'c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�Au_readcCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)N�r�rbTF��type�builtins�open�_opened�initfp��self�fr-rrr�__init__�szAu_read.__init__cCs|jr|��dS�N��_file�close�r2rrr�__del__�szAu_read.__del__cCs|Sr5rr9rrr�	__enter__�szAu_read.__enter__cGs|��dSr5�r8�r2�argsrrr�__exit__�szAu_read.__exit__c	Cs�||_d|_tt|��}|tkr(td��tt|��|_|jdkrHtd��|jdkrZtd��t|�|_|jtkrzt|j�|_tt|��|_	|j	t
kr�td��|j	ttfkr�d|_
d	|_nj|j	tkr�d	|_|_
nR|j	tkr�d|_|_
n:|j	tkr�d
|_|_
n"|j	tk�rd|_|_
ntd��tt|��|_tt|��|_|j�sLtd
��|j|j|_|jdk�r�|�|jd�|_|j�d�\|_}}nd|_z|��|_Wn ttfk
�r�d|_YnXdS)Nrzbad magic numberrzheader size too small�dzheader size ridiculously largezencoding not (yet) supportedrrrrzunknown encodingzbad # of channels��)r7�	_soundposr!r�AUDIO_FILE_MAGICrZ	_hdr_size�
_data_size�AUDIO_UNKNOWN_SIZE�	_encoding�_simple_encodings�AUDIO_FILE_ENCODING_MULAW_8�AUDIO_FILE_ENCODING_ALAW_8�
_sampwidth�
_framesize�AUDIO_FILE_ENCODING_LINEAR_8�AUDIO_FILE_ENCODING_LINEAR_16�AUDIO_FILE_ENCODING_LINEAR_24�AUDIO_FILE_ENCODING_LINEAR_32�
_framerate�
_nchannelsr�_info�	partition�tell�	_data_pos�AttributeError�OSError)r2r�magic�_rrrr0�sV




�


zAu_read.initfpcCs|jSr5)r7r9rrr�getfp�sz
Au_read.getfpcCs|jSr5)rRr9rrr�getnchannels�szAu_read.getnchannelscCs|jSr5)rKr9rrr�getsampwidth�szAu_read.getsampwidthcCs|jSr5)rQr9rrr�getframerate�szAu_read.getframeratecCs(|jtkrtS|jtkr$|j|jSdS�Nr)rErFrGrHrLr9rrr�
getnframes�s


zAu_read.getnframescCs$|jtkrdS|jtkrdSdSdS)N�ULAW�ALAW�NONE�rGrIrJr9rrr�getcomptype�s


zAu_read.getcomptypecCs$|jtkrdS|jtkrdSdSdS)N�CCITT G.711 u-law�CCITT G.711 A-law�not compressedrdr9rrr�getcompname�s


zAu_read.getcompnamecCs*t|��|��|��|��|��|���Sr5�rr\r]r^r`rerir9rrr�	getparamss�zAu_read.getparamscCsdSr5rr9rrr�
getmarkersszAu_read.getmarkerscCstd��dS)Nzno marks)r)r2�idrrr�getmarkszAu_read.getmarkcCsp|jtkrl|tkr|j��}n|j�||j�}|jt|�|j7_|jtkrhddl	}|�
||j�}|SdSr_)rGrHrFr7rrLrC�lenrI�audioopZulaw2linrK)r2�nframesr$rprrr�
readframess

zAu_read.readframescCs*|jdkrtd��|j�|j�d|_dS)N�cannot seekr)rVrXr7�seekrCr9rrr�rewinds
zAu_read.rewindcCs|jSr5)rCr9rrrrU!szAu_read.tellcCsP|dks||��krtd��|jdkr.td��|j�|j||j�||_dS)Nrzposition not in rangers)r`rrVrXr7rtrLrC)r2�posrrr�setpos$s
zAu_read.setposcCs"|j}|rd|_|jr|��dSr5)r7r/r8�r2rrrrr8,s
z
Au_read.closeN)rrrr4r:r;r?r0r[r\r]r^r`rerirkrlrnrrrurUrwr8rrrrr(�s(	.
r(c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3S)4�Au_writecCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)Nr)r�wbTFr+r1rrrr45szAu_write.__init__cCs|jr|��d|_dSr5r6r9rrrr:>szAu_write.__del__cCs|Sr5rr9rrrr;CszAu_write.__enter__cGs|��dSr5r<r=rrrr?FszAu_write.__exit__cCsF||_d|_d|_d|_d|_t|_d|_d|_d|_	d|_
d|_dS)NrrBra)r7rQrRrKrLrF�_nframes�_nframeswritten�_datawritten�_datalengthrS�	_comptyperxrrrr0IszAu_write.initfpcCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to write)rrrz"only 1, 2, or 4 channels supported)r|rrR)r2�	nchannelsrrr�setnchannelsVs
zAu_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rRrr9rrrr\]szAu_write.getnchannelscCs(|jrtd��|dkrtd��||_dS)Nr�)rrrrzbad sample width)r|rrK)r2�	sampwidthrrr�setsampwidthbs
zAu_write.setsampwidthcCs|jstd��|jS)N�sample width not specified)rQrrKr9rrrr]iszAu_write.getsampwidthcCs|jrtd��||_dS)Nr�)r|rrQ)r2�	frameraterrr�setframeratenszAu_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rQrr9rrrr^sszAu_write.getframeratecCs(|jrtd��|dkrtd��||_dS)Nr�rz# of frames cannot be negative)r|rr{)r2rqrrr�
setnframesxs
zAu_write.setnframescCs|jSr5�r|r9rrrr`szAu_write.getnframescCs|dkr||_ntd��dS)N)rcrazunknown compression type)rr)r2r,�namerrr�setcomptype�szAu_write.setcomptypecCs|jSr5�rr9rrrre�szAu_write.getcomptypecCs$|jdkrdS|jdkrdSdSdS)Nrarfrbrgrhr�r9rrrri�s


zAu_write.getcompnamecCsH|\}}}}}}|�|�|�|�|�|�|�|�|�||�dSr5)r�r�r�r�r�)r2Zparamsr�r�r�rqZcomptypeZcompnamerrr�	setparams�s



zAu_write.setparamscCs*t|��|��|��|��|��|���Sr5rjr9rrrrk�s�zAu_write.getparamscCs|jSr5r�r9rrrrU�sz
Au_write.tellcCs~t|ttf�st|��d�}|��|jdkrDddl}|�||j	�}t
|�|j}|j�
|�|j||_|jt
|�|_dS)N�Brar)�
isinstancer#�	bytearray�
memoryview�cast�_ensure_header_writtenrrpZlin2ulawrKrorLr7r"r|r})r2r$rprqrrr�writeframesraw�s
zAu_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSr5)r�r|r{r~r}�_patchheader)r2r$rrr�writeframes�s


�zAu_write.writeframescCs^|jrZz6|��|j|jks(|j|jkr0|��|j�	�W5|j}d|_|jrX|��XdSr5)
r7r/r8r�r|r{r~r}r��flushrxrrrr8�s
�zAu_write.closecCs<|js8|jstd��|js"td��|js0td��|��dS)Nz# of channels not specifiedr�zframe rate not specified)r|rRrrKrQ�
_write_headerr9rrrr��szAu_write._ensure_header_writtenc	Cs�|jdkrl|jdkr t}d|_q�|jdkr6t}d|_q�|jdkrLt}d|_q�|jdkrbt}d|_q�td��n|jdkr�t}d|_ntd��|j|j	|_t
|jt�dt
|j�}|d	d
@}t
|j|�|jtkr�t}n|j|j}z|j��|_Wn ttfk
�rd|_YnXt
|j|�||_t
|j|�t
|j|j�t
|j|j	�|j�|j�|j�d|t
|j�d�dS)
Nrcrrrrzinternal errorrar
r
i����rAr)rrKrMrLrNrOrPrrIrRr'r7rDrorSr{rFrU�_form_length_posrWrXr~rQr")r2�encoding�header_sizeZlengthrrrr��sJ







zAu_write._write_headercCsH|jdkrtd��|j�|j�t|j|j�|j|_|j�dd�dS)Nrsrr)r�rXr7rtr'r}r~r9rrrr��s
zAu_write._patchheaderN)rrrr4r:r;r?r0r�r\r�r]r�r^r�r`r�rerir�rkrUr�r�r8r�r�r�rrrrry3s2	

*rycCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder*)�rr*)�wrzz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�r(ryr�r3r�rrrr.s
r.cCstjdtdd�t||d�S)NzDsunau.openfp is deprecated since Python 3.7. Use sunau.open instead.r)�
stacklevel)r�)�warnings�warn�DeprecationWarningr.r�rrr�openfps
�r�)N)N)�__doc__�collectionsrr�rrDrIrMrNrOrPZAUDIO_FILE_ENCODING_FLOATZAUDIO_FILE_ENCODING_DOUBLEZAUDIO_FILE_ENCODING_ADPCM_G721ZAUDIO_FILE_ENCODING_ADPCM_G722Z AUDIO_FILE_ENCODING_ADPCM_G723_3Z AUDIO_FILE_ENCODING_ADPCM_G723_5rJrFrH�	Exceptionrrr'r(ryr.r�rrrr�<module>sFi��	Q

optparse.cpython-38.pyc000064400000135673151450073350011053 0ustar00U

e5d���@s�dZdZdddddddd	d
ddd
dddddgZdZddlZddlZddlZdd�ZzddlmZm	Z	Wn$e
k
r�dd�Zdd�Z	YnXeZGdd
�d
e�Z
Gdd�de
�ZGdd�de�ZGd d�de
�ZGd!d�de
�ZGd"d#�d#e�ZGd$d
�d
�ZGd%d�de�ZGd&d�de�Zd'd(�Zd)d*�Zeed+�feed+�feed,�feed-�fd.�Zd/d0�Zd1d�Zd2ZGd3d�d�Zd4Zd5Z Gd6d�d�Z!Gd7d�d�Z"Gd8d�de"�Z#Gd9d	�d	e"�Z$d:d;�Z%eZ&dS)<a�A powerful, extensible, and easy-to-use option parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).

Simple usage example:

   from optparse import OptionParser

   parser = OptionParser()
   parser.add_option("-f", "--file", dest="filename",
                     help="write report to FILE", metavar="FILE")
   parser.add_option("-q", "--quiet",
                     action="store_false", dest="verbose", default=True,
                     help="don't print status messages to stdout")

   (options, args) = parser.parse_args()
z1.5.3�Option�make_option�
SUPPRESS_HELP�SUPPRESS_USAGE�Values�OptionContainer�OptionGroup�OptionParser�
HelpFormatter�IndentedHelpFormatter�TitledHelpFormatter�
OptParseError�OptionError�OptionConflictError�OptionValueError�BadOptionError�check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
�NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��self�r� /usr/lib64/python3.8/optparse.py�_reprOsr)�gettext�ngettextcCs|S�Nr)�messagerrrr\srcCs|dkr|S|S�N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)rcCs
||_dSr��msg�rr#rrr�__init__hszOptParseError.__init__cCs|jSrr"rrrr�__str__kszOptParseError.__str__N)r�
__module__�__qualname__r%r&rrrrrgsc@s eZdZdZdd�Zdd�ZdS)r
z]
    Raised if an Option instance is created with invalid or
    inconsistent arguments.
    cCs||_t|�|_dSr)r#�str�	option_id)rr#�optionrrrr%uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz
option %s: %s)r*r#rrrrr&yszOptionError.__str__N�rr'r(�__doc__r%r&rrrrr
osc@seZdZdZdS)rzE
    Raised if conflicting options are added to an OptionParser.
    N�rr'r(r-rrrrrsc@seZdZdZdS)rzS
    Raised if an invalid option value is encountered on the command
    line.
    Nr.rrrrr�sc@s eZdZdZdd�Zdd�ZdS)rzB
    Raised if an invalid option is seen on the command line.
    cCs
||_dSr)�opt_str�rr/rrrr%�szBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r/rrrrr&�szBadOptionError.__str__Nr,rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�AmbiguousOptionErrorzD
    Raised if an ambiguous option is seen on the command line.
    cCst�||�||_dSr)rr%�
possibilities)rr/r3rrrr%�szAmbiguousOptionError.__init__cCstd�|jd�|j�fS)Nzambiguous option: %s (%s?)�, )r1r/�joinr3rrrrr&�s�zAmbiguousOptionError.__str__Nr,rrrrr2�sr2c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"r	a�
    Abstract base class for formatting option help.  OptionParser
    instances should use one of the HelpFormatter subclasses for
    formatting help; by default IndentedHelpFormatter is used.

    Instance attributes:
      parser : OptionParser
        the controlling OptionParser instance
      indent_increment : int
        the number of columns to indent per nesting level
      max_help_position : int
        the maximum starting column for option help text
      help_position : int
        the calculated starting column for option help text;
        initially the same as the maximum
      width : int
        total number of columns for output (pass None to constructor for
        this value to be taken from the $COLUMNS environment variable)
      level : int
        current indentation level
      current_indent : int
        current indentation level (in columns)
      help_width : int
        number of columns available for option help text (calculated)
      default_tag : str
        text to replace with each option's default value, "%default"
        by default.  Set to false value to disable default value expansion.
      option_strings : { Option : str }
        maps Option instances to the snippet of help text explaining
        the syntax of that option, e.g. "-h, --help" or
        "-fFILE, --file=FILE"
      _short_opt_fmt : str
        format string controlling how short options with values are
        printed in help text.  Must be either "%s%s" ("-fFILE") or
        "%s %s" ("-f FILE"), because those are the two syntaxes that
        Optik supports.
      _long_opt_fmt : str
        similar but for long options; must be either "%s %s" ("--file FILE")
        or "%s=%s" ("--file=FILE").
    Znonec	Cs�d|_||_|dkrLzttjd�}Wnttfk
rBd}YnX|d8}||_t|t	|d|d��|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	NZCOLUMNS�P��rz%defaultz%s %sz%s=%s)�parser�indent_increment�int�os�environ�KeyError�
ValueError�width�min�max�
help_position�max_help_position�current_indent�level�
help_width�short_first�default_tag�option_strings�_short_opt_fmt�
_long_opt_fmt�rr:rDr@rHrrrr%�s&
�
zHelpFormatter.__init__cCs
||_dSr)r9�rr9rrr�
set_parser�szHelpFormatter.set_parsercCs&|dkrtd|��d|d|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)r?rK�rZdelimrrr�set_short_opt_delimiter�s
�z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|��d|d|_dS)N)�=rQz.invalid metavar delimiter for long options: %rrR)r?rLrSrrr�set_long_opt_delimiter�s
�z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSr)rEr:rFrrrr�indent�szHelpFormatter.indentcCs4|j|j8_|jdks"td��|jd8_dS)NrzIndent decreased below 0.r )rEr:�AssertionErrorrFrrrr�dedent�szHelpFormatter.dedentcCstd��dS�Nzsubclasses must implement��NotImplementedError�r�usagerrr�format_usage�szHelpFormatter.format_usagecCstd��dSrZr[�rZheadingrrr�format_headingszHelpFormatter.format_headingcCs.t|j|jd�}d|j}tj||||d�S)z�
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        �rQ)Zinitial_indentZsubsequent_indent)rBr@rE�textwrapZfill)r�textZ
text_widthrWrrr�_format_texts
�zHelpFormatter._format_textcCs|r|�|�dSdSdS�N�
rP�re�r�descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|�|�dSdSdSrfrh)r�epilogrrr�
format_epilogszHelpFormatter.format_epilogcCsP|jdks|js|jS|jj�|j�}|tks6|dkr<|j}|j�|jt	|��Sr)
r9rI�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer))rr+Z
default_valuerrr�expand_defaultszHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|krBd�jd|f}�j}nd�jd||f}d}|�|�|jr���|�}t�|�j	�}|�d|d|df�|�
�fdd�|dd�D��n|d	d
kr�|�d
�d�|�S)Nr7�%*s%s
rPz	%*s%-*s  rcsg|]}d�jd|f�qS)rvrP)rC)�.0�linerrr�
<listcomp>Es�z/HelpFormatter.format_option.<locals>.<listcomp>r ���rg)rJrCrE�len�appendrnrurcZwraprG�extendr5)rr+�result�optsZ	opt_widthZindent_firstZ	help_textZ
help_linesrrr�
format_option(s&



�

zHelpFormatter.format_optioncCs�|��d}|jD],}|�|�}||j|<t|t|�|j�}q|��|jD]8}|jD],}|�|�}||j|<t|t|�|j�}qXqN|��|��t	|d|j
�|_t|j|jd�|_
dS)Nrr7rb)rW�option_list�format_option_stringsrJrBr{rE�
option_groupsrYrArDrCr@rG)rr9Zmax_len�optZstrings�grouprrr�store_option_stringsKs 






z"HelpFormatter.store_option_stringscst|��rF|jp|j�����fdd�|jD�}��fdd�|jD�}n|j}|j}�jrb||}n||}d�|�S)z@Return a comma-separated list of option strings & metavariables.csg|]}�j|�f�qSr)rK)rwZsopt��metavarrrrryas�z7HelpFormatter.format_option_strings.<locals>.<listcomp>csg|]}�j|�f�qSr)rL)rwZloptr�rrrycs�r4)�takes_valuer�rq�upper�_short_opts�
_long_optsrHr5)rr+Z
short_optsZ	long_optsrrr�rr�]s��
z#HelpFormatter.format_option_stringsN)rr'r(r-rsr%rOrTrVrWrYr_rarerkrmrur�r�r�rrrrr	�s")
#c@s*eZdZdZddd�Zdd	�Zd
d�ZdS)
r
z.Format help with indented section bodies.
    r7�Nr cCst�|||||�dSr�r	r%rMrrrr%ts�zIndentedHelpFormatter.__init__cCstd�|S)Nz
Usage: %s
)r1r]rrrr_|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s:
rP)rEr`rrrrasz$IndentedHelpFormatter.format_heading)r7r�Nr �rr'r(r-r%r_rarrrrr
ps�
c@s*eZdZdZddd�Zdd�Zd	d
�ZdS)rz1Format help with underlined section headers.
    rr�NcCst�|||||�dSrr�rMrrrr%�s�zTitledHelpFormatter.__init__cCsd|�td��|fS)Nz%s  %s
ZUsage)rar1r]rrrr_�sz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s
%s
z=-)rFr{r`rrrra�sz"TitledHelpFormatter.format_heading)rr�Nrr�rrrrr�s�
cCsh|dd���dkrd}nD|dd���dkrDd}|dd�p@d}n|dd�dkrZd}nd}|||�S)	Nr7Z0x�Z0b�0r ��
)�lower)�val�type�radixrrr�
_parse_num�sr�cCs
t|t�Sr)r�r;)r�rrr�
_parse_int�sr�Zintegerzfloating-point�complex)r;�long�floatr�cCsHt|j\}}z
||�WStk
rBttd�|||f��YnXdS)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�r?rr1)r+r��valueZcvtZwhatrrr�
check_builtin�s
�r�cCs:||jkr|Sd�tt|j��}ttd�|||f��dS)Nr4z.option %s: invalid choice: %r (choose from %s))�choicesr5�map�reprrr1)r+r�r�r�rrrr�s
��)ZNOZDEFAULTc@s�eZdZdZdddddddd	d
ddd
gZdZdZdZdZdZ	dZ
eeeeed�Z
dZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZeeeeeeegZd,d-�ZeZd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"dS):rar
    Instance attributes:
      _short_opts : [string]
      _long_opts : [string]

      action : string
      type : string
      dest : string
      default : any
      nargs : int
      const : any
      choices : [string]
      callback : function
      callback_args : (any*)
      callback_kwargs : { string : any }
      help : string
      metavar : string
    �actionr�rq�default�nargs�constr��callback�
callback_args�callback_kwargsrnr�)
�store�store_const�
store_true�store_falser|�append_const�countr�rn�version)r�r�r�r�r|r�r�)r�r|r�)r�r|)r�r�)�stringr;r�r�r��choice)r;r�r�r�r�NcOsBg|_g|_|�|�}|�|�|�|�|jD]}||�q0dSr)r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr�attrs�checkerrrrr%4s



zOption.__init__cCsdd�|D�}|std��|S)NcSsg|]}|r|�qSrr)rwr�rrrryKsz-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)�	TypeError)rrrrrr�GszOption._check_opt_stringscCs�|D]�}t|�dkr$td||��qt|�dkrd|ddkrH|ddksVtd||��|j�|�q|dd�dkr�|ddks�td||��|j�|�qdS)	Nr7z>invalid option string %r: must be at least two characters longr�-r zMinvalid short option string %r: must be of the form -x, (x any non-dash char)�--zGinvalid long option string %r: must start with --, followed by non-dash)r{r
r�r|r�)rrr�rrrr�Ps2������zOption._set_opt_stringscCsv|jD]F}||kr*t||||�||=q|dkr@t||t�qt||d�q|rrt|���}tdd�|�|��dS)Nr�zinvalid keyword arguments: %sr4)�ATTRS�setattrrr�sorted�keysr
r5)rr��attrrrrr�es
�zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr
rrrr�
_check_actionxs
zOption._check_actioncCs�|jdkr0|j|jkr�|jdk	r(d|_q�d|_n^t|jt�rF|jj|_|jdkrVd|_|j|jkrrtd|j|��|j|jkr�td|j|��dS)Nr�r�r)zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr
�
TYPED_ACTIONSrrrr�_check_type~s 



�zOption._check_typecCsr|jdkrT|jdkr td|��qnt|jttf�sntdtt|j���d�d|��n|jdk	rntd|j|��dS)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'r z#must not supply choices for type %r)r�r�r
r��tuple�listr)�splitrrrr�
_check_choice�s$

���
�zOption._check_choicecCs\|j|jkp|jdk	}|jdkrX|rX|jrH|jddd��dd�|_n|jdd|_dS)Nrr7r�r1r )r��
STORE_ACTIONSr�rqr�rtr�)rr�rrr�_check_dest�s�zOption._check_destcCs*|j|jkr&|jdk	r&td|j|��dS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�r
rrrr�_check_const�s
�zOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk	r8td|j|��dS)Nr z*'nargs' must not be supplied for action %r)r�r�r�r
rrrr�_check_nargs�s

�zOption._check_nargscCs�|jdkrrt|j�s$td|j|��|jdk	rJt|jt�sJtd|j|��|jdk	r�t|jt�s�td|j|��nB|jdk	r�td|j|��|jdk	r�td|��|jdk	r�td|��dS)Nr�zcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option)	r��callabler�r
r�r�r�r��dictrrrr�_check_callback�sR

�

���

���
��
�
�zOption._check_callbackcCsd�|j|j�S)N�/)r5r�r�rrrrr&�szOption.__str__cCs
|jdk	Sr)r�rrrrr��szOption.takes_valuecCs|jr|jdS|jdSdS�Nr)r�r�rrrr�get_opt_string�s
zOption.get_opt_stringcCs*|j�|j�}|dkr|S||||�SdSr)�TYPE_CHECKERrpr�)rr�r�r�rrr�check_value�szOption.check_valuecs:|dk	r6�jdkr���|�St��fdd�|D��SdS)Nr csg|]}���|��qSr)r�)rw�v�r�rrrrysz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rr�r�rr�r�
convert_values
zOption.convert_valuecCs$|�||�}|�|j|j||||�Sr)r��take_actionr�rq)rr�r��valuesr9rrr�processs�zOption.processc	Cs:|dkrt|||��n|dkr2t|||j��n|dkrHt||d�n�|dkr^t||d�n�|dkrz|�|g��|�n�|dkr�|�|g��|j�n�|d	kr�t|||�|d
�d�n||dkr�|jp�d
}|jp�i}|j||||f|�|�nF|dk�r|��|��n*|dk�r(|�	�|��nt
d|j��dS)Nr�r�r�Tr�Fr|r�r�rr r�rrnr�zunknown action %r)r�r��ensure_valuer|r�r�r��
print_help�exit�
print_versionr?r�)	rr�rqr�r�r�r9�args�kwargsrrrr�s4





zOption.take_action)#rr'r(r-r�r�r�r�r�r�r�r�rr�r�r%r�r�r�r�r�r�r�r�r�r�r&r�__repr__r�r�r�r�r�r�rrrrr�sl�
�	
	�	ZSUPPRESSHELPZ
SUPPRESSUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
dS)rNcCs&|r"|��D]\}}t|||�qdSr)�itemsr�)rror�r�rrrr%9szValues.__init__cCs
t|j�Sr)r)�__dict__rrrrr&>szValues.__str__cCs2t|t�r|j|jkSt|t�r*|j|kStSdSr)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs



z
Values.__eq__cCs6t|�D](}||kr||}|dk	rt|||�qdS)z�
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        N)�dirr�)rr�r�Zdvalrrr�_update_carefulKs
zValues._update_carefulcCs|j�|�dS)z�
        Update the option values from an arbitrary dictionary,
        using all keys from the dictionary regardless of whether
        they have a corresponding attribute in self or not.
        N)r��update)rr�rrr�
_update_looseXszValues._update_loosecCs8|dkr|�|�n |dkr(|�|�ntd|��dS)N�carefulZloosezinvalid update mode: %r)r�r�r?)rr��moderrr�_update`s
zValues._updater�cCs&t|�tj|}|�t|�|�dSr)�
__import__�sys�modulesr��vars)r�modnamer��modrrr�read_modulehs
zValues.read_modulecCs&i}tt|���|�|�||�dSr)�exec�open�readr�)r�filenamer�r�rrr�	read_filemszValues.read_filecCs.t||�rt||�dkr$t|||�t||�Sr)�hasattr�getattrr�)rr�r�rrrr�rszValues.ensure_value)N)r�)r�)rr'r(r%r&rr�r�r�r�r�r�r�r�rrrrr7s



c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)#ra�
    Abstract base class.

    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      option_list : [Option]
        the list of Option objects contained by this OptionContainer
      _short_opt : { string : Option }
        dictionary mapping short option strings, eg. "-f" or "-X",
        to the Option instances that implement them.  If an Option
        has multiple short option strings, it will appear in this
        dictionary multiple times. [1]
      _long_opt : { string : Option }
        dictionary mapping long option strings, eg. "--file" or
        "--exclude", to the Option instances that implement them.
        Again, a given Option can occur multiple times in this
        dictionary. [1]
      defaults : { string : any }
        dictionary mapping option destination names to default
        values for each destination [1]

    [1] These mappings are common to (shared by) all components of the
        controlling OptionParser, where they are initially created.

    cCs&|��||_|�|�|�|�dSr)�_create_option_list�option_class�set_conflict_handler�set_description)rr�conflict_handlerrjrrrr%�s
zOptionContainer.__init__cCsi|_i|_i|_dSr��
_short_opt�	_long_optrorrrr�_create_option_mappings�sz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrNrrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dkrtd|��||_dS)N)�error�resolvez$invalid conflict_resolution value %r)r?r)r�handlerrrrr�sz$OptionContainer.set_conflict_handlercCs
||_dSr�rjrirrrr�szOptionContainer.set_descriptioncCs|jSrrrrrr�get_description�szOptionContainer.get_descriptioncCs|`|`|`dS�zsee OptionParser.destroy().Nrrrrr�destroy�szOptionContainer.destroycCs�g}|jD]"}||jkr
|�||j|f�q
|jD]"}||jkr4|�||j|f�q4|r�|j}|dkr�tdd�dd�|D��|��nd|dkr�|D]V\}}|�d�r�|j�	|�|j|=n|j�	|�|j|=|js�|js�|j
j�	|�q�dS)Nrz conflicting option string(s): %sr4cSsg|]}|d�qS)rr)rw�corrrry�sz3OptionContainer._check_conflict.<locals>.<listcomp>rr�)r�rr|r�rrrr5�
startswith�remove�	containerr�)rr+Z
conflict_optsr�r
Zc_optionrrr�_check_conflict�s2



��

zOptionContainer._check_conflictcOs�t|dt�r|j||�}n8t|�dkrL|sL|d}t|t�sTtd|��ntd��|�|�|j�|�||_	|j
D]}||j|<qv|jD]}||j
|<q�|jdk	r�|jtk	r�|j|j|j<n|j|jkr�d|j|j<|S)zOadd_option(Option)
           add_option(opt_str, ..., kwarg=val, ...)
        rr znot an Option instance: %r�invalid argumentsN)r�r)rr{rr�rr�r|rr�rr�rrqr�rrro)rr�r�r+r�rrr�
add_option�s(





zOptionContainer.add_optioncCs|D]}|�|�qdSr)r)rr�r+rrr�add_optionsszOptionContainer.add_optionscCs|j�|�p|j�|�Sr)rrprr0rrr�
get_options
�zOptionContainer.get_optioncCs||jkp||jkSr)rrr0rrr�
has_options
�zOptionContainer.has_optioncCsn|j�|�}|dkr |j�|�}|dkr4td|��|jD]}|j|=q:|jD]}|j|=qN|jj�|�dS)Nzno such option %r)	rrprr?r�r�rr�r)rr/r+r�rrr�
remove_options



zOptionContainer.remove_optioncCs>|js
dSg}|jD]}|jtk	r|�|�|��qd�|�S�NrP)r�rnrr|r�r5)r�	formatterr~r+rrr�format_option_helps

z"OptionContainer.format_option_helpcCs|�|���Sr)rkr�rrrrrrk(sz"OptionContainer.format_descriptioncCs:g}|jr|�|�|��|jr0|�|�|��d�|�S)Nrg)rjr|rkr�rr5�rrr~rrr�format_help+szOptionContainer.format_helpN)rr'r(r-r%r	r
rrrrrrrrrrrrkr"rrrrrxs"			c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs$||_t�||j|j|�||_dSr)r9rr%rr�title)rr9r#rjrrrr%6s�zOptionGroup.__init__cCsg|_|�|j�dSr)r�r
r9rrrrr<szOptionGroup._create_option_listcCs
||_dSr)r#)rr#rrr�	set_title@szOptionGroup.set_titlecCst�|�|`dSr)rrr�rrrrrCs
zOptionGroup.destroycCs0|�|j�}|��|t�||�7}|��|Sr)rar#rWrr"rYr!rrrr"Js
zOptionGroup.format_help)N)rr'r(r%rr$rr"rrrrr4s

c
@sbeZdZdZgZddedddddddf
dd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dPdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdQd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z dRd<d=�Z!d>d?�Z"d@dA�Z#dSdBdC�Z$dDdE�Z%dTdFdG�Z&dUdHdI�Z'dJdK�Z(dVdLdM�Z)dWdNdO�Z*dS)Xra$
    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      usage : string
        a usage string for your program.  Before it is displayed
        to the user, "%prog" will be expanded to the name of
        your program (self.prog or os.path.basename(sys.argv[0])).
      prog : string
        the name of the current program (to override
        os.path.basename(sys.argv[0])).
      description : string
        A paragraph of text giving a brief overview of your program.
        optparse reformats this paragraph to fit the current terminal
        width and prints it when the user requests help (after usage,
        but before the list of options).
      epilog : string
        paragraph of help text to print after option help

      option_groups : [OptionGroup]
        list of option groups in this parser (option groups are
        irrelevant for parsing the command-line, but very useful
        for generating help)

      allow_interspersed_args : bool = true
        if true, positional arguments may be interspersed with options.
        Assuming -a and -b each take a single argument, the command-line
          -ablah foo bar -bboo baz
        will be interpreted the same as
          -ablah -bboo -- foo bar baz
        If this flag were false, that command line would be interpreted as
          -ablah -- foo bar -bboo baz
        -- ie. we stop processing options as soon as we see the first
        non-option argument.  (This is the tradition followed by
        Python's getopt module, Perl's Getopt::Std, and other argument-
        parsing libraries, but it is generally annoying to users.)

      process_default_values : bool = true
        if true, option default values are processed similarly to option
        values from the command line: that is, they are passed to the
        type-checking function for the option's type (as long as the
        default value is a string).  (This really only matters if you
        have defined custom types; see SF bug #955889.)  Set it to false
        to restore the behaviour of Optik 1.4.1 and earlier.

      rargs : [string]
        the argument list currently being parsed.  Only set when
        parse_args() is active, and continually trimmed down as
        we consume arguments.  Mainly there for the benefit of
        callback options.
      largs : [string]
        the list of leftover arguments that we have skipped while
        parsing options.  If allow_interspersed_args is false, this
        list is always empty.
      values : Values
        the set of option values currently being accumulated.  Only
        set when parse_args() is active.  Also mainly for callbacks.

    Because of the 'rargs', 'largs', and 'values' attributes,
    OptionParser is not thread-safe.  If, for some perverse reason, you
    need to parse command-line arguments simultaneously in different
    threads, use different OptionParser instances.

    NrTcCsrt�||||�|�|�|	|_||_d|_d|_|dkr@t�}||_|j�	|�|
|_
|j||d�|��dS)NT)�add_help)
rr%�	set_usage�progr��allow_interspersed_args�process_default_valuesr
rrOrl�_populate_option_list�_init_parsing_state)rr^r�rr�rrjrZadd_help_optionr'rlrrrr%�s(�
�zOptionParser.__init__cCs.t�|�|jD]}|��q|`|`|`dS)a
        Declare that you are done with this OptionParser.  This cleans up
        reference cycles so the OptionParser (and all objects referenced by
        it) can be garbage-collected promptly.  After calling destroy(), the
        OptionParser is unusable.
        N)rrr�r�r)rr�rrrr�s


zOptionParser.destroycCsg|_g|_|��dSr)r�r�r	rrrrr�sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helprnzshow this help message and exit�r�rn�rr1rrrr�_add_help_option�s�zOptionParser._add_help_optioncCs|jddtd�d�dS)Nz	--versionr�z&show program's version number and exitr,r-rrrr�_add_version_option�s�z OptionParser._add_version_optioncCs>|jr|�|j�|r |�|�|jr.|��|r:|��dSr)�standard_option_listrr�r/r.)rr�r%rrrr*�s
z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)�rargs�largsr�rrrrr+�sz OptionParser._init_parsing_statecCsL|dkrtd�|_n4|tkr$d|_n$|���d�rB|dd�|_n||_dS)Nz%prog [options]zusage: �)r1r^rr�rr]rrrr&�szOptionParser.set_usagecCs
d|_dS)aSet parsing to not stop on the first non-option, allowing
        interspersing switches with command arguments. This is the
        default behavior. See also disable_interspersed_args() and the
        class documentation description of the attribute
        allow_interspersed_args.TN�r(rrrr�enable_interspersed_args�sz%OptionParser.enable_interspersed_argscCs
d|_dS)z�Set parsing to stop on the first non-option. Use this if
        you have a command processor which runs another command that
        has options of its own and you want to make sure these options
        don't get confused.
        FNr4rrrr�disable_interspersed_argssz&OptionParser.disable_interspersed_argscCs
||_dSr)r))rr�rrr�set_process_default_valuessz'OptionParser.set_process_default_valuescCs||j|<dSr)ro)rrqr�rrr�set_defaultszOptionParser.set_defaultcKs|j�|�dSr)ror�)rr�rrr�set_defaultsszOptionParser.set_defaultscCs*|jdd�}|jD]}|�|j�q|Sr)r�r�r})rZoptionsr�rrr�_get_all_optionss
zOptionParser._get_all_optionscCs`|jst|j�S|j��}|��D]4}|�|j�}t|t�r"|�	�}|�
||�||j<q"t|�Sr)r)rro�copyr:rprqr�r)r�r�)rror+r�r/rrr�get_default_valuess


zOptionParser.get_default_valuescOszt|dt�r t|f|�|�}nJt|�dkrb|sb|d}t|t�sNtd|��|j|k	rjtd��ntd��|j�|�|S)Nrr znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r)	r�r)rr{r�r9r?r�r|)rr�r�r�rrr�add_option_group+s


zOptionParser.add_option_groupcCs0|j�|�p|j�|�}|r,|j|k	r,|jSdSr)rrprr)rr/r+rrr�get_option_group;s
�zOptionParser.get_option_groupcCs&|dkrtjdd�S|dd�SdSr)r��argv)rr�rrr�	_get_argsEszOptionParser._get_argsc
Cs�|�|�}|dkr|��}||_g|_}||_z|�|||�}Wn4ttfk
rv}z|�t	|��W5d}~XYnX||}|�
||�S)aR
        parse_args(args : [string] = sys.argv[1:],
                   values : Values = None)
        -> (values : Values, args : [string])

        Parse the command-line options found in 'args' (default:
        sys.argv[1:]).  Any errors result in a call to 'error()', which
        by default prints the usage message to stderr and calls
        sys.exit() with an error message.  On success returns a pair
        (values, args) where 'values' is a Values instance (with all
        your option values) and 'args' is the list of arguments left
        over after parsing options.
        N)r@r<r1r2r��
_process_argsrrrr)�check_values)rr�r�r1r2�stop�errrrr�
parse_argsKs

 zOptionParser.parse_argscCs||fS)a�
        check_values(values : Values, args : [string])
        -> (values : Values, args : [string])

        Check that the supplied option values and leftover arguments are
        valid.  Returns the option values and leftover arguments
        (possibly adjusted, possibly completely new -- whatever you
        like).  Default implementation just returns the passed-in
        values; subclasses may override as desired.
        r)rr�r�rrrrBrszOptionParser.check_valuescCs�|r�|d}|dkr|d=dS|dd�dkr<|�||�q|dd�dkrft|�dkrf|�||�q|jr~|�|�|d=qdSqdS)a�_process_args(largs : [string],
                         rargs : [string],
                         values : Values)

        Process command-line arguments and populate 'values', consuming
        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
        false, stop at the first non-option argument.  If true, accumulate any
        interspersed non-option arguments in 'largs'.
        rr�Nr7r r�)�_process_long_optr{�_process_short_optsr(r|)rr2r1r��argrrrrAs

zOptionParser._process_argscCst||j�S)a_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbreviation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.
        )�
_match_abbrevr)rr�rrr�_match_long_opt�szOptionParser._match_long_optc
Cs�|�d�}d|kr4|�dd�\}}|�d|�d}n|}d}|�|�}|j|}|��r�|j}t|�|kr�|�t	dd|�||d��q�|dkr�|�d�}	q�t
|d|��}	|d|�=n|r�|�td	�|�nd}	|�||	||�dS)
NrrUr TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r+Znumberz%s option does not take a value)
�popr��insertrJrr�r�r{rrr�r1r�)
rr1r�rHr�Znext_argZhad_explicit_valuer+r�r�rrrrF�s6


��zOptionParser._process_long_optcCs�|�d�}d}d}|dd�D]�}d|}|j�|�}|d7}|sJt|��|��r�|t|�krv|�d||d��d}|j}	t|�|	kr�|�t	dd|	�||	d��q�|	dkr�|�d�}
q�t
|d|	��}
|d|	�=nd}
|�||
||�|rq�qdS)	NrFr r�TrKrLrM)rNrrprr�r{rOr�rrr�r�)rr1r�rHrC�iZchr�r+r�r�rrrrG�s<
��z OptionParser._process_short_optscCs&|jdkrtj�tjd�S|jSdSr�)r'r<�path�basenamer�r?rrrr�
get_prog_names
zOptionParser.get_prog_namecCs|�d|���S)Nz%prog)rtrS)r�srrr�expand_prog_nameszOptionParser.expand_prog_namecCs|�|j�Sr)rUrjrrrrrszOptionParser.get_descriptionrcCs|rtj�|�t�|�dSr)r��stderr�writer�)rZstatusr#rrrr�szOptionParser.exitcCs(|�tj�|�dd|��|f�dS)z�error(msg : string)

        Print a usage message incorporating 'msg' to stderr and exit.
        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        r7z%s: error: %s
N)�print_usager�rVr�rSr$rrrrszOptionParser.errorcCs"|jr|j�|�|j��SdSdSr)r^rr_rUrrrr�	get_usage#s

�zOptionParser.get_usagecCs|jrt|��|d�dS)aaprint_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.
        ��fileN)r^�printrY�rr[rrrrX*s	zOptionParser.print_usagecCs|jr|�|j�SdSdSr)r�rUrrrr�get_version6szOptionParser.get_versioncCs|jrt|��|d�dS)aEprint_version(file : file = stdout)

        Print the version message for this program (self.version) to
        'file' (default stdout).  As with print_usage(), any occurrence
        of "%prog" in self.version is replaced by the current program's
        name.  Does nothing if self.version is empty or undefined.
        rZN)r�r\r^r]rrrr�<szOptionParser.print_versioncCs�|dkr|j}|�|�g}|�|�td���|��|jrZ|�t�||��|�d�|j	D]}|�|�
|��|�d�q`|��d�|dd��S)NZOptionsrgrPrz)
rr�r|rar1rWr�rrr�r"rYr5)rrr~r�rrrrGs


zOptionParser.format_option_helpcCs|�|j�Sr)rmrlr rrrrmXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*|�|��d�|jrD|�|�|�d�|�|�|��|�|�|��d�|�Srf)	rr^r|rYrjrkrrmr5r!rrrr"[szOptionParser.format_helpcCs |dkrtj}|�|���dS)z�print_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).
        N)r��stdoutrWr"r]rrrr�gszOptionParser.print_help)T)NN)rN)N)N)N)N)N)+rr'r(r-r0rr%rrr.r/r*r+r&r5r6r7r8r9r:r<r=r>r@rErBrArJrFrGrSrUrr�rrYrXr^r�rrmr"r�rrrrrRsbD�
"

	

'
3	$)





csZ�|kr�S�fdd�|��D�}t|�dkr6|dS|sDt���n|��t�|��dS)z�_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.
    csg|]}|���r|�qSr)r)rwZword�rTrrry�s
�z!_match_abbrev.<locals>.<listcomp>r rN)r�r{r�sortr2)rTZwordmapr3rr`rrIts
rI)'r-�__version__�__all__Z
__copyright__r�r<rcrrr�ImportErrorr1�	Exceptionrr
rrrr2r	r
rr�r�r�r�r�r�rrrrrrrrrrrIrrrrr�<module>s�� 


P




�uA=&contextvars.cpython-38.pyc000064400000000365151450073350011563 0ustar00U

e5d��@s ddlmZmZmZmZdZdS)�)�Context�
ContextVar�Token�copy_contextN)Z_contextvarsrrrr�__all__�rr�#/usr/lib64/python3.8/contextvars.py�<module>sthis.cpython-38.pyc000064400000002357151450073350010155 0ustar00U

e5d��@s\dZiZdD]2Zed�D]$Zeedde�eeee�<qqed�dd�eD���dS)aXGur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!)�A�a��
�cCsg|]}t�||��qS�)�d�get)�.0�crr�/usr/lib64/python3.8/this.py�
<listcomp>srN)�srr
�range�i�chr�print�joinrrrr�<module>s
$webbrowser.cpython-38.opt-1.pyc000064400000041301151450073350012316 0ustar00U

e5d^�@s�dZddlZddlZddlZddlZddlZddlZddddddgZGd	d�de�Z	e�
�ZiZda
dad<d
d�dd�Zd=d
d�Zd>dd�Zdd�Zdd�Zd
d�dd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e�ZeZGd$d%�d%e�ZGd&d'�d'e�Z Gd(d)�d)e�Z!Gd*d+�d+e�Z"d,d-�Z#d.d/�Z$ej%dd0�d1k�r�Gd2d3�d3e�Z&ej%d4k�r�Gd5d6�d6e�Z'Gd7d8�d8e�Z(d9d:�Z)e*d;k�r�e)�dS)?z?Interfaces for launching and remotely controlling Web browsers.�N�Error�open�open_new�open_new_tab�get�registerc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�"/usr/lib64/python3.8/webbrowser.pyrsF��	preferredc	CsZt�Ltdkrt�||gt|��<|s4trB|tkrBt�d|�n
t�|�W5QRXdS)zRegister a browser connector.Nr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancerrrrrsc	Cs�tdkr&t�tdkrt�W5QRX|dk	r6|g}nt}|D]�}d|kr�t�|�}|ddkrtt|dd��St|�Sq>zt|��}Wnt	k
r�t
|�}YnX|ddk	r�|dS|ddk	r>|d�Sq>td��dS)zCReturn a browser launcher instance appropriate for the environment.N�%s����&�rz!could not locate runnable browser)rrr�shlex�split�BackgroundBrowser�GenericBrowserrr�KeyError�_synthesizer)ZusingZalternatives�browser�commandrrrr%s,
Tc	CsPtdkr&t�tdkrt�W5QRXtD] }t|�}|�|||�r*dSq*dS)aDisplay url using the default browser.

    If possible, open url in a location determined by new.
    - 0: the same browser window (the default).
    - 1: a new browser window.
    - 2: a new browser page ("tab").
    If possible, autoraise raises the window (the default) or not.
    NTF)rrrrr)�url�new�	autoraiserr$rrrrGs	cCs
t|d�S)zuOpen url in a new window of the default browser.

    If not possible, then open url in the only browser window.
    r�r�r&rrrrZscCs
t|d�S)z�Open url in a new page ("tab") of the default browser.

    If not possible, then the behavior becomes equivalent to open_new().
    �r)r*rrrrascCs�|��d}t�|�sddgStj�|�}zt|��}Wntk
rVddgYSX|d}|r�|��|jkr�ddl	}|�	|�}||_
tj�|�|_t|d||d�d|gSddgS)a�Attempt to synthesize a controller based on existing controllers.

    This is useful to create a controller when a user specifies a path to
    an entry in the BROWSER environment variable -- we can copy a general
    controller to operate using a specific installation of the desired
    browser in this way.

    If we can't create a controller in this way, or if there is no
    executable for the requested browser, return [None, None].

    rNr)rr)r�shutil�which�os�path�basenamerrr"�copyrr)r$r�cmdrr%Z
controllerr1rrrr#is"

r#c@s:eZdZdZdgZddd�Zddd	�Zd
d�Zdd
�ZdS)�BaseBrowserz3Parent class for all browsers. Do not use directly.r�cCs||_||_dS�N)rr0��selfrrrr�__init__�szBaseBrowser.__init__rTcCst�dSr5)�NotImplementedError�r7r&r'r(rrrr�szBaseBrowser.opencCs|�|d�S)Nrr)�r7r&rrrr�szBaseBrowser.open_newcCs|�|d�S)Nr+r)r;rrrr�szBaseBrowser.open_new_tabN)r4)rT)	rr	r
�__doc__�argsr8rrrrrrrr3�s

r3c@s"eZdZdZdd�Zd	dd�ZdS)
r!zVClass for all browsers started with a command
       and without remote functionality.cCsFt|t�r||_dg|_n|d|_|dd�|_tj�|j�|_dS)Nrrr)�
isinstance�strrr=r.r/r0r6rrrr8�s


zGenericBrowser.__init__rTcs|t�d��|jg�fdd�|jD�}z8tjdd�dkrHt�|�}ntj|dd�}|��WStk
rvYdSXdS)	N�webbrowser.opencsg|]}|�d���qS�r��replace��.0�argr*rr�
<listcomp>�s�z'GenericBrowser.open.<locals>.<listcomp>��winT)�	close_fdsF)	�sys�auditrr=�platform�
subprocess�Popen�wait�OSError�r7r&r'r(�cmdline�prr*rr�s�zGenericBrowser.openN)rT�rr	r
r<r8rrrrrr!�s
r!c@seZdZdZddd�ZdS)r zHClass for all browsers which are to be started in the
       background.rTcs�|jg�fdd�|jD�}t�d��z<tjdd�dkrHt�|�}ntj|ddd�}|��dkWStk
rzYdSXdS)	Ncsg|]}|�d���qSrArBrDr*rrrG�s�z*BackgroundBrowser.open.<locals>.<listcomp>r@rHrIT)rJ�start_new_sessionF)	rr=rKrLrMrNrO�pollrQrRrr*rr�s��zBackgroundBrowser.openN)rT�rr	r
r<rrrrrr �sr c@sDeZdZdZdZdZdZddgZdZdZ	dZ
ddd�Zd
d
d�ZdS)�UnixBrowserz=Parent class for all Unix browsers with remote functionality.NFT�%actionrcCs�g}|r*|jr*t|�}|j|}|r*|g}|jg||}|sD|jrLtj}nd}tj|d||jrd|pfd|dd�}	|r�z|	�d�}
|
WStj	k
r�YdSXn&|jr�|	�
�dkr�dSdSn
|	��SdS)NT�rJ�stdin�stdout�stderrrV�F)�
raise_opts�intr�
backgroundrN�DEVNULLrO�redirect_stdoutrPZTimeoutExpiredrW)r7r=Zremoter(r&Z	raise_opt�optrSZinoutrT�rcrrr�_invoke�s4



�

zUnixBrowser._invokercs�t�d��|dkr|j�nB|dkr,|j�n2|dkrN|jdkrF|j�q^|j�ntdd|����fdd�|jD�}d	d�|D�}|�|d
|��}|s��fdd�|jD�}|�|dd�Sd
SdS)
Nr@rrr+zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %scs g|]}|�d���d���qS)rrZrBrD��actionr&rrrGs�z$UnixBrowser.open.<locals>.<listcomp>cSsg|]}|r|�qSrrrDrrrrGsTcsg|]}|�d���qSrArBrDr*rrrGsF)	rKrL�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsrgr=)r7r&r'r(r=Zsuccessrrhrrs*
��zUnixBrowser.open)N)rT)
rr	r
r<r`rbrdrmrjrkrlrgrrrrrrY�s
#rYc@s(eZdZdZddgZdZdZdZdZdS)	�Mozillaz$Launcher class for Mozilla browsers.rZrr4z-new-windowz-new-tabTN�	rr	r
r<rmrjrkrlrbrrrrrnsrnc@s0eZdZdZddgZddgZdZdZdZd	Z	d
S)�Netscapez$Launcher class for Netscape browser.�-noraisez-raise�-remote�openURL(%s%action)r4�,new-window�,new-tabTN)
rr	r
r<r`rmrjrkrlrbrrrrrp&srpc@s,eZdZdZddgZddgZdZdZdZd	S)
�Galeonz,Launcher class for Galeon/Epiphany browsers.rqr4rZr�-nz-wTN)	rr	r
r<r`rmrjrkrbrrrrrv1srvc@s(eZdZdZddgZdZdZdZdZdS)�Chromez)Launcher class for Google Chrome browser.rZrr4�--new-windowTNrorrrrrx;srxc@s(eZdZdZddgZdZdZdZdZdS)�Operaz!Launcher class for Opera browser.rZrr4ryTNrorrrrrzGsrzc@s,eZdZdZddgZdZdZdZdZdZ	dS)	�Elinksz#Launcher class for Elinks browsers.rrrsr4rtruFN)
rr	r
r<rmrjrkrlrbrdrrrrr{Qsr{c@seZdZdZddd�ZdS)�	Konquerorz�Controller for the KDE File Manager (kfm, or Konqueror).

    See the output of ``kfmclient --commands``
    for more information on the Konqueror remote-control interface.
    rTcCs�t�d|�|dkrd}nd}tj}ztjd||gd|||d�}Wntk
rVYnX|��dSz tjdd	|gd|||dd
�}Wntk
r�YnX|��dkr�dSz tjdd|gd|||dd
�}Wntk
r�Yd
SX|��dkSdS)Nr@r+ZnewTabZopenURL�	kfmclientT)rJr\r]r^�	konquerorz--silentr[�kfmz-dF)rKrLrNrcrOrQrPrW)r7r&r'r(ri�devnullrTrrrrfsN�
�
�
zKonqueror.openN)rTrXrrrrr|_sr|c@s&eZdZdd�Zdd�Zd
dd�Zd	S)�GrailcCs�ddl}ddl}ddl}ddl}tj�|��d�}|�t�	��d}tj�|�
|�|�
|�d�}|�|�}|stdS|�|j|j�}	|D]T}
z|	�
|
�Wn8tk
r�zt�|
�Wntk
r�YnXYq�X|	Sq�dS)Nrz.grail-unixz-*)�glob�pwd�socket�tempfiler.r/�joinZ
gettempdir�getpwuid�getuid�escapeZAF_UNIXZSOCK_STREAMZconnectrQ�unlink)r7r�r�r�r�Ztempdir�user�filenameZmaybes�s�fnrrr�_find_grail_rc�s,�
zGrail._find_grail_rccCs&|��}|sdS|�|�|��dS)Nrr)r��send�close)r7rir�rrr�_remote�s
z
Grail._remoterTcCs2t�d|�|r |�d|�}n|�d|�}|S)Nr@zLOADNEW zLOAD )rKrLr�)r7r&r'r(�okrrrr�s
z
Grail.openN)rT)rr	r
r�r�rrrrrr��sr�cCs�t�d�rtddtd��dtjkr>t�d�r>tddtd��dtjkrbt�d�rbtddtd��dtjkr�t�d�r�tdttd��t�d�r�tddtd��dD]}t�|�r�t|dt|��q�d	D]}t�|�r�t|dt|��q�t�d
��rtd
ttd
��nt�d��r"tdttd��dD]"}t�|��r&t|dt	|���q&t�d
��rftd
dtd
��dD]"}t�|��rjt|dt
|���qjt�d��r�tddtd��t�d��r�tddtd��t�d��r�tdtd�dS)Nzxdg-openZGNOME_DESKTOP_SESSION_IDz	gvfs-openz
gnome-openZKDE_FULL_SESSIONr}z
x-www-browser)�firefoxZ	iceweaselZiceape�	seamonkey)zmozilla-firefoxzmozilla-firebird�firebird�mozilla�netscaperr~)ZgaleonZepiphanyZ	skipstone)z
google-chrome�chromeZchromiumzchromium-browser�operaZmosaicZgrail)
r,r-rr r.�environr|rnrprvrxrzr�)r$rrr�register_X_browsers�sD



r�cCs.gatjdkrNtddtd��tddtd��tddtd��tddtd��tjdd�dkr�td	t�tj�tj	�
d
d�d�}dd
dddd|fD]}t�|�r�t|dt
|��q��ntj	�
d�s�tj	�
d��r&z(d��}tj|tjd�}|����}Wn ttjttfk
�rYnX|at�tj	�
d��r�t�d��rPtddtd��t�d��rltddtd��t�d��r�tddtd��t�d��r�tddtd��t�d��r�tddtd��dtj	k�r*tj	d�tj�}|��|D]>}|dk�r�t|dd�}|d dk�r�t|dt|�dd��q�dS)!N�darwin�MacOSX�defaultr�r�ZsafarirHrIzwindows-defaultZPROGRAMFILESzC:\Program FileszInternet Explorer\IEXPLORE.EXEr�r�r�r�r�ZDISPLAYZWAYLAND_DISPLAYz$xdg-settings get default-web-browser)r^ZTERMzwww-browserZlinksZelinksZlynxZw3mZBROWSERr4Tr
r)rrKrMr�MacOSXOSAScript�WindowsDefaultr.r/r�r�rr,r-r rrNZcheck_outputrc�decode�strip�FileNotFoundErrorZCalledProcessError�PermissionError�NotADirectoryErrorrr�r!r{�pathsep�reverser#)Ziexplorer$r2Z
raw_result�resultZuserchoicesrSrrrrs\

��

rrHrIc@seZdZddd�ZdS)r�rTcCs:t�d|�zt�|�Wntk
r0YdSXdSdS)Nr@FT)rKrLr.Z	startfilerQr:rrrrXszWindowsDefault.openN)rT)rr	r
rrrrrr�Wsr�r�c@s"eZdZdZdd�Zd	dd�ZdS)
r�a{Launcher class for Aqua browsers on Mac OS X

        Optionally specify a browser name on instantiation.  Note that this
        will not work for Aqua browsers if the user has moved the application
        package after installation.

        If no browser is specified, the default browser, as specified in the
        Internet System Preferences panel, will be used.
        cCs
||_dSr5)rr6rrrr8sszMacOSX.__init__rTc	Cs�t�d|�d|krd|}tt|��}|jdkrDd|�dd�}n<|jdkrTd	}nd
|d}d|�dd�}d
|j||f}t�dd�}|dkr�dS|�|�|�	�}|S)Nr@�:zfile:r��open location "%s"�"�%22ZOmniWebr4ztoWindow %drzOpenURL "%s"z�tell application "%s"
                                activate
                                %s %s
                            end tell�	osascript�wF)
rKrLra�boolrrCr.�popen�writer�)	r7r&r'r(�scriptZtoWindowr2�osapiperfrrrrvs&


�
zMacOSX.openN)rTrUrrrrr�is	r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr5)�_namer6rrrr8�szMacOSXOSAScript.__init__rTcCsb|jdkrd|�dd�}nd|j|�dd�f}t�dd�}|dkrJdS|�|�|��}|S)	Nr�r�r�r�z�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   r�r�F)r�rCr.r�r�r�)r7r&r'r(r�r�rfrrrr�s
�
zMacOSXOSAScript.openN)rT)rr	r
r8rrrrrr��sr�c	
Cs�ddl}dtjd}z|�tjdd�d�\}}WnJ|jk
r~}z*t|tjd�t|tjd�t�d�W5d}~XYnXd}|D]"\}}|dkr�d}q�|dkr�d}q�t|�dkr�t|tjd�t�d�|d}t||�td	�dS)
NrzDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabrZntd)�filerwz-tr+�)	�getoptrK�argv�error�printr^�exit�lenr)	r�ZusageZoptsr=�msgZnew_win�o�ar&rrr�main�s,�

r��__main__)N)N)rT)+r<r.rr,rKrNZ	threading�__all__�	Exceptionr�RLockrrrrrrrrrr#�objectr3r!r rYrnrprvrxZChromiumrzr{r|r�r�rrMr�r�r�r�rrrrr�<module>sR
"
"O

	
56AK/
subprocess.cpython-38.opt-1.pyc000064400000122200151450073350012323 0ustar00U

e5d�1�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZdddddd	d
ddd
ddddgZ
zddlZddlZdZWn0ek
r�dZddlZddlZddlZYn�XddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&e
�'dddddddddddd d!d"d#d$d%d&d'g�Gd(d�de(�Z)Gd)d
�d
e)�Z*Gd*d�de)�Z+e�r�Gd+d�d�Z,Gd,d-�d-e-�Z.n&e/ed.d/�Z0e1ed0��r�ej2Z3nej4Z3e�r�dZ5d1d2�Z6ngZ5d3d2�Z6d4Z7d5Z8d6Z9d7d8�Z:d9d:�Z;dd;�d<d�Z<d=d�Z=dd;�d>d�Z>Gd?d�de?�Z@ddddd@�dAd�ZAdBdC�ZBdDd	�ZCdEd
�ZDdFdG�ZEeE�ZFGdHd�de?�ZGdS)Ia�Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API
========
run(...): Runs a command, waits for it to complete, then returns a
          CompletedProcess instance.
Popen(...): A class for flexibly executing a command in a new process

Constants
---------
DEVNULL: Special value that indicates that os.devnull should be used
PIPE:    Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout


Older API
=========
call(...): Runs a command, waits for it to complete, then returns
    the return code.
check_call(...): Same as call() but raises CalledProcessError()
    if return code is not 0
check_output(...): Same as check_call() but returns the contents of
    stdout instead of a return code
getoutput(...): Runs a command in the shell, waits for it to complete,
    then returns the output
getstatusoutput(...): Runs a command in the shell, waits for it to complete,
    then returns a (exitcode, output) tuple
�N)�	monotonic�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOBrrrrrrrr�STARTUPINFOrrrrrrrr r!r"c@seZdZdS)rN)�__name__�
__module__�__qualname__�r'r'�"/usr/lib64/python3.8/subprocess.pyr`sc@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�Raised when run() is called with check=True and the process
    returns a non-zero exit status.

    Attributes:
      cmd, returncode, stdout, stderr, output
    NcCs||_||_||_||_dS�N)�
returncode�cmd�output�stderr)�selfr*r+r,r-r'r'r(�__init__jszCalledProcessError.__init__cCsh|jrT|jdkrTzd|jt�|j�fWStk
rPd|j|jfYSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r*r+�signalZSignals�
ValueError�r.r'r'r(�__str__ps���zCalledProcessError.__str__cCs|jS)z+Alias for output attribute, to match stderr�r,r2r'r'r(�stdout|szCalledProcessError.stdoutcCs
||_dSr)r4�r.�valuer'r'r(r5�s)NN�	r$r%r&�__doc__r/r3�propertyr5�setterr'r'r'r(rcs

c@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�This exception is raised when the timeout expires while waiting for a
    child process.

    Attributes:
        cmd, output, stdout, stderr, timeout
    NcCs||_||_||_||_dSr))r+�timeoutr,r-)r.r+r<r,r-r'r'r(r/�szTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r+r<r2r'r'r(r3�s
�zTimeoutExpired.__str__cCs|jSr)r4r2r'r'r(r5�szTimeoutExpired.stdoutcCs
||_dSr)r4r6r'r'r(r5�s)NNr8r'r'r'r(r�s

c@s,eZdZddddddd�dd�Zdd�ZdS)r#rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)N�handle_listr=)r.r>r?r@rArBrCr'r'r(r/�szSTARTUPINFO.__init__cCs@|j��}d|kr"t|d�|d<t|j|j|j|j|j|d�S)NrDr=)	rC�copy�listr#r>r?r@rArB)r.Z	attr_listr'r'r(rE�s
�zSTARTUPINFO.copy)r$r%r&r/rEr'r'r'r(r#�s�	c@s2eZdZdZejfdd�Zdd�Zdd�ZeZ	dS)	�HandleFcCs|jsd|_||�dS)NT)�closed)r.�CloseHandler'r'r(�Close�szHandle.ClosecCs |jsd|_t|�Std��dS)NTzalready closed)rH�intr1r2r'r'r(�Detach�sz
Handle.DetachcCsd|jjt|�fS)Nz%s(%d))�	__class__r$rKr2r'r'r(�__repr__�szHandle.__repr__N)
r$r%r&rH�_winapirIrJrLrN�__del__r'r'r'r(rG�s
rGZPIPE_BUFi�PollSelectorcCsdSr)r'r'r'r'r(�_cleanup�srRc	Cs\tdkrdStdd�D]>}|jtjd�}|dk	rzt�|�Wqtk
rTYqXqdS)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover1)�inst�resr'r'r(rR�s���������cCs*g}tjj}|dkr&|�dd|�|S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r�-�O)rW�flags�optimize�append)�argsr7r'r'r(�"_optim_args_from_interpreter_flagss
recCsVddddddd�}t�}|��D].\}}ttj|�}|dkr |�d	||�q tjjrd|�d
�n$tjjrv|�d�tjjr�|�d�tj	d
d
�}tjj
}ttdi�}d|k}|dkr�|�d�n|r�|�d�|r�|�d�|D]}|�d|�q�|�r
|�d�dD]B}||k�r||}	|	dk�r4|}
nd||	f}
|�d|
f��q|S)z}Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrr_z-Iz-Ez-sN�	_xoptions�dev�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-Xrs)Zfaulthandler�tracemallocZ
importtimeZshowalloccountZshowrefcount�utf8Tz%s=%srv)
re�items�getattrrWrarc�isolated�ignore_environment�no_user_site�warnoptionsrprY�extend)Zflag_opt_maprd�flag�optriZwarnoptsrpZxoptions�dev_moder7�argr'r'r(�_args_from_interpreter_flagssP�






r��r<c
OsLt||��8}z|j|d�WW5QR�S|���YnXW5QRXdS)z�Run command with arguments.  Wait for command to complete or
    timeout, then return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    r�N)r�wait�kill)r<�	popenargs�kwargs�pr'r'r(rLscOs6t||�}|r2|�d�}|dkr(|d}t||��dS)aORun command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    rdNr)r�getr)r�r��retcoder+r'r'r(r]s



cOsbd|krtd��d|krJ|ddkrJ|�d�s8|�d�r>d}nd}||d<t|t|d	d
�|��jS)aRun command with arguments and return its output.

    If the exit code was non-zero it raises a CalledProcessError.  The
    CalledProcessError object will have the return code in the returncode
    attribute and output in the output attribute.

    The arguments are the same as for the Popen constructor.  Example:

    >>> check_output(["ls", "-l", "/dev/null"])
    b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

    The stdout argument is not allowed as it is used internally.
    To capture standard error in the result, use stderr=STDOUT.

    >>> check_output(["/bin/sh", "-c",
    ...               "ls -l non_existent_file ; exit 0"],
    ...              stderr=STDOUT)
    b'ls: non_existent_file: No such file or directory\n'

    There is an additional optional argument, "input", allowing you to
    pass a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it too will be used internally.  Example:

    >>> check_output(["sed", "-e", "s/foo/bar/"],
    ...              input=b"when in the course of fooman events\n")
    b'when in the course of barman events\n'

    By default, all communication is in bytes, and therefore any "input"
    should be bytes, and the return value will be bytes.  If in text mode,
    any "input" should be a string, and the return value will be a string
    decoded according to locale encoding, or by "encoding" if set. Text mode
    is triggered by setting any of text, encoding, errors or universal_newlines.
    r5z3stdout argument not allowed, it will be overridden.�inputN�universal_newlines�text��T)r5r<�check)r1r�rrr5)r<r�r��emptyr'r'r(r
ps#�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
raEA process that has finished running.

    This is returned by run().

    Attributes:
      args: The list or str args passed to run().
      returncode: The exit code of the process, negative for signals.
      stdout: The standard output (None if not captured).
      stderr: The standard error (None if not captured).
    NcCs||_||_||_||_dSr))rdr*r5r-)r.rdr*r5r-r'r'r(r/�szCompletedProcess.__init__cCshd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�t|�jd�|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatrdr*r5rcr-�typer$�join)r.rdr'r'r(rN�s

�

zCompletedProcess.__repr__cCs |jrt|j|j|j|j��dS)z6Raise CalledProcessError if the exit code is non-zero.N)r*rrdr5r-r2r'r'r(�check_returncode�s�z!CompletedProcess.check_returncode)NN)r$r%r&r9r/rNr�r'r'r'r(r�s

	)r��capture_outputr<r�cOs |dk	r&|�d�dk	rtd��t|d<|r^|�d�dk	sF|�d�dk	rNtd��t|d<t|d<t||���}z|j||d�\}}Wn^tk
r�}	z,|��tr�|��\|	_|	_	n|�
��W5d}	~	XYn|���YnX|��}
|�r|
�rt|
|j
||d��W5QRXt|j
|
||�S)	aKRun command with arguments and return a CompletedProcess instance.

    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.

    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.

    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.

    There is an optional argument "input", allowing you to
    pass bytes or a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.

    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.

    The other arguments are the same as for the Popen constructor.
    N�stdinz/stdin and input arguments may not both be used.r5r-z@stdout and stderr arguments may not be used with capture_output.r��r,r-)r�r1rr�communicaterr��
_mswindowsr5r-r��pollrrdr)r�r�r<r�r�r�Zprocessr5r-�excr�r'r'r(r�s8�cCs�g}d}ttj|�D]�}g}|r*|�d�d|kp>d|kp>|}|rN|�d�|D]b}|dkrj|�|�qR|dkr�|�dt|�d�g}|�d�qR|r�|�|�g}|�|�qR|r�|�|�|r|�|�|�d�qd�|�S)	a�
    Translate a sequence of arguments into a command line
    string, using the same rules as the MS C runtime:

    1) Arguments are delimited by white space, which is either a
       space or a tab.

    2) A string surrounded by double quotation marks is
       interpreted as a single argument, regardless of white space
       contained within.  A quoted string can be embedded in an
       argument.

    3) A double quotation mark preceded by a backslash is
       interpreted as a literal double quotation mark.

    4) Backslashes are interpreted literally, unless they
       immediately precede a double quotation mark.

    5) If backslashes immediately precede a double quotation mark,
       every pair of backslashes is interpreted as a literal
       backslash.  If the number of backslashes is odd, the last
       backslash escapes the next double quotation mark as
       described in rule 3.
    F� �	�"�\�z\"r�)�map�os�fsdecoderc�lenrr�)�seq�resultZ	needquoter�Zbs_buf�cr'r'r(�list2cmdline	s4




r�c
Cslzt|ddtd�}d}Wn.tk
rF}z|j}|j}W5d}~XYnX|dd�dkrd|dd�}||fS)a�Return (exitcode, output) of executing cmd in a shell.

    Execute the string 'cmd' in a shell with 'check_output' and
    return a 2-tuple (status, output). The locale encoding is used
    to decode the output and process newlines.

    A trailing newline is stripped from the output.
    The exit status for the command can be interpreted
    according to the rules for the function 'wait'. Example:

    >>> import subprocess
    >>> subprocess.getstatusoutput('ls /bin/ls')
    (0, '/bin/ls')
    >>> subprocess.getstatusoutput('cat /bin/junk')
    (1, 'cat: /bin/junk: No such file or directory')
    >>> subprocess.getstatusoutput('/bin/junk')
    (127, 'sh: /bin/junk: not found')
    >>> subprocess.getstatusoutput('/bin/kill $$')
    (-15, '')
    T)�shellr�r-rNr\�
)r
rrr,r*)r+�dataZexitcodeZexr'r'r(rRscCst|�dS)a%Return output (stdout or stderr) of executing cmd in a shell.

    Like getstatusoutput(), except the exit status is ignored and the return
    value is a string containing the command's output.  Example:

    >>> import subprocess
    >>> subprocess.getoutput('ls /bin/ls')
    '/bin/ls'
    rt)r)r+r'r'r(r	qs
c
Cs�tsttd�sdStjdkr dSzjt�d�}|jdd�}t|�dkrHt�|d	}t	t
t|d�d
���}tjdkr�|dkr�|d
kr�WdSWnttt
fk
r�YnXdS)a�Check if posix_spawn() can be used for subprocess.

    subprocess requires a posix_spawn() implementation that properly reports
    errors to the parent process, & sets errno on the following failures:

    * Process attribute actions failed.
    * File actions failed.
    * exec() failed.

    Prefer an implementation which can use vfork() in some cases for best
    performance.
    �posix_spawnF�darwinT�CS_GNU_LIBC_VERSIONrt)�maxsplitr�r�.ZlinuxZglibc)r��)r��hasattrr�rW�platform�confstr�splitr�r1�tupler�rK�AttributeError�OSError)Zver�partsZlibc�versionr'r'r(�_use_posix_spawn~s 



r�c@s�eZdZdZdZdKdddd�d	d
�Zedd��Zejd
d��Zdd�Z	dd�Z
dd�Zej
ejfdd�Zdd�Zdd�ZdLdd�Zdd�Zdd�ZdMd d!�ZdNd"d#�Zd$d%�Ze�rd&d'�Zd(d)�Zd*d+�Zd,d-�Zdejej ej!fd.d/�Z"d0d1�Z#d2d3�Z$d4d5�Z%d6d7�Z&d8d9�Z'e'Z(n�d:d'�Zd;d<�Z)d=d-�Ze*j+e*j,e*j-e*j.e*j/e*j0fd>d?�Z1de*j2e*j3e4j5fd@d/�Z"dAdB�Z6dCd1�Z#dDd5�Z%dEdF�Z7dGd7�Z&dHd9�Z'dIdJ�Z(dS)Ora� Execute a child program in a new process.

    For a complete description of the arguments see the Python documentation.

    Arguments:
      args: A string, or a sequence of program arguments.

      bufsize: supplied as the buffering argument to the open() function when
          creating the stdin/stdout/stderr pipe file objects

      executable: A replacement program to execute.

      stdin, stdout and stderr: These specify the executed programs' standard
          input, standard output and standard error file handles, respectively.

      preexec_fn: (POSIX only) An object to be called in the child process
          just before the child is executed.

      close_fds: Controls closing or inheriting of file descriptors.

      shell: If true, the command will be executed through the shell.

      cwd: Sets the current directory before the child is executed.

      env: Defines the environment variables for the new process.

      text: If true, decode stdin, stdout and stderr using the given encoding
          (if set) or the system default otherwise.

      universal_newlines: Alias of text, provided for backwards compatibility.

      startupinfo and creationflags (Windows only)

      restore_signals (POSIX only)

      start_new_session (POSIX only)

      pass_fds (POSIX only)

      encoding and errors: Text mode encoding and error handling to use for
          file objects stdin, stdout and stderr.

    Attributes:
        stdin, stdout, stderr, pid, returncode
    Fr\NTrr')�encoding�errorsr�cCslt�t��|_d|_d|_|dkr(d}t|t�s:td��t	rP|dk	r�t
d��n8|rh|sht�dt
�d}|
dk	rxt
d��|d	kr�t
d
��||_d|_d|_d|_d|_d|_||_||_|dk	r�|dk	r�t|�t|�kr�td��|�|||�\}}}}}}t	�rN|dk�rt�|��d	�}|dk�r4t�|��d	�}|dk�rNt�|��d	�}|�pb|�pb|�pb||_d|_d|_|j�r�|d
k�r�d}d}nd}z�|dk�r�t� |d|�|_|j�r�tj!|jd|||d�|_|dk�rt� |d|�|_|j�rtj!|j||d�|_|dk�r:t� |d|�|_|j�r:tj!|j||d�|_|�"||||||
||
||	||||||||�Wn�t#d|j|j|jf�D]*}z|�$�Wnt%k
�r�YnX�q�|j�s`g}|t&k�r�|�'|�|t&k�r�|�'|�|t&k�r�|�'|�t(|d��r|�'|j)�|D]H}z*t	�r8t|t*��r8|�+�n
t,�$|�Wnt%k
�rZYnX�q�YnXdS)zCreate new Popen instance.NFr\zbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?rt�wb)�
write_through�line_bufferingr�r��rb)r�r��_devnull)-rR�	threadingZLock�
_waitpid_lock�_input�_communication_started�
isinstancerK�	TypeErrorr�r1�warnings�warn�RuntimeWarningrdr�r5r-�pidr*r�r��boolr�_get_handles�msvcrtZopen_osfhandlerL�	text_mode�_sigint_wait_secs�_closed_child_pipe_fds�io�open�
TextIOWrapper�_execute_child�filter�closer�rrcr�r�rGrJr�)r.rd�bufsize�
executabler�r5r-�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsr�r�r��p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��fZto_close�fdr'r'r(r/�s�


��





�
�
��








zPopen.__init__cCs|jSr))r�r2r'r'r(r�~szPopen.universal_newlinescCst|�|_dSr))r�r�)r.r�r'r'r(r��scCs |�||�}|�dd��dd�S)Nz
r��
)�decode�replace)r.r�r�r�r'r'r(�_translate_newlines�szPopen._translate_newlinescCs|Sr)r'r2r'r'r(�	__enter__�szPopen.__enter__cCs�|jr|j��|jr |j��dz|jr4|j��W5|tkr�|jdkrrz|j|jd�Wntk
rpYnXd|_�dS|��XdS)Nrr�)	r5r�r-�KeyboardInterruptr��_waitrr�r�)r.�exc_typer7�	tracebackr'r'r(�__exit__�s 


zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d�|j|d�|jdkrPtdk	rPt�|�dS)Nzsubprocess %s is still running)�sourcerS)�_child_createdr*r��ResourceWarningrVrUrc)r.Z_maxsizeZ_warnr'r'r(rP�s

�z
Popen.__del__cCs"t|d�st�tjtj�|_|jS)Nr�)r�r�r��devnull�O_RDWRr�r2r'r'r(�_get_devnull�s
zPopen._get_devnullc
Cs�|rZz|j�|�WnDtk
r(Yn2tk
rX}z|jtjkrFn�W5d}~XYnXz|j��WnDtk
r|Yn2tk
r�}z|jtjkr�n�W5d}~XYnXdSr))r��write�BrokenPipeErrorr��errnoZEINVALr�)r.r�r�r'r'r(�_stdin_write�s"zPopen._stdin_writecCsT|jr|rtd��|dkr�|js�|j|j|jg�d�dkr�d}d}|jrT|�|�n6|jrp|j��}|j��n|jr�|j��}|j��|�	�n�|dk	r�t
�|}nd}z�z|�|||�\}}Wnhtk
�r,|dk	r�t
|j|�|��}n|j}d|_z|j|d�Wntk
�r$YnX�YnXW5d|_X|j	|�|�d�}||fS)a9Interact with process: Send data to stdin and close it.
        Read data from stdout and stderr, until end-of-file is
        reached.  Wait for process to terminate.

        The optional "input" argument should be data to be sent to the
        child process, or None, if no data should be sent to the child.
        communicate() returns a tuple (stdout, stderr).

        By default, all communication is in bytes, and therefore any
        "input" should be bytes, and the (stdout, stderr) will be bytes.
        If in text mode (indicated by self.text_mode), any "input" should
        be a string, and (stdout, stderr) will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode
        is triggered by setting any of text, encoding, errors or
        universal_newlines.
        z.Cannot send input after starting communicationNr�Trr�)r�r1r�r5r-�countr�readr�r��_time�_communicater��minr��_remaining_timer�r)r.r�r<r5r-�endtime�sigint_timeout�stsr'r'r(r��sH
�



�zPopen.communicatecCs|��S)zSCheck if child process has terminated. Set and return returncode
        attribute.)rVr2r'r'r(r�sz
Popen.pollcCs|dkrdS|t�SdS)z5Convenience for _communicate when computing timeouts.N)r)r.r	r'r'r(r"szPopen._remaining_timecCsL|dkrdS|st�|krHt|j||r0d�|�nd|r@d�|�ndd��dS)z2Convenience for checking if a timeout has expired.Nr�r�)rrrdr�)r.r	�orig_timeoutZ
stdout_seqZ
stderr_seq�skip_check_and_raiser'r'r(�_check_timeout*s�zPopen._check_timeoutcCs�|dk	rt�|}z|j|d�WStk
r�|dk	rLt|j|�|��}n|j}d|_z|j|d�Wntk
r|YnX�YnXdS)z=Wait for child process to terminate; returns self.returncode.Nr�r)rr�r�rr�rr)r.r<r	r
r'r'r(r�6s 
�z
Popen.waitc		Cs�t|dd�}t����}trX|dkr.|�|j�|dkrB|�|j�|dkr�|�|j�nr|dkr~|dkr~||kr~|�tj|�|dkr�|dkr�||kr�|�tj|�|dkr�|dkr�||kr�|�tj|�|dk	r�|�tj|�W5QRXd|_dS)Nr�r\T)	rz�
contextlib�	ExitStackr��callbackrJr�r�r�)	r.r�r�r�r�r�r�Z
devnull_fd�stackr'r'r(�_close_pipe_fdsMs$
zPopen._close_pipe_fdscCs~|dkr|dkr|dkrdSd\}}d\}}d\}}	|dkrtt�tj�}|dkr�t�dd�\}}
t|�}t�|
�nh|tkr�t�dd�\}}t|�t|�}}n<|tkr�t�	|�
��}n$t|t�r�t�	|�}nt�	|�
��}|�|�}|dk�r*t�tj�}|dk�r�t�dd�\}
}t|�}t�|
�nn|tk�rXt�dd�\}}t|�t|�}}n@|tk�rrt�	|�
��}n&t|t��r�t�	|�}nt�	|�
��}|�|�}|dk�r�t�tj�}	|	dk�rdt�dd�\}
}	t|	�}	t�|
�n~|tk�rt�dd�\}}	t|�t|	�}}	nP|tk�r$|}	n@|tk�r>t�	|�
��}	n&t|t��rVt�	|�}	nt�	|�
��}	|�|	�}	||||||	fS)�|Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            N)r\r\r\r\r\r\�r\r\r)rOZGetStdHandlerZ
CreatePiperGrIrr
r�Z
get_osfhandler�r�rK�fileno�_make_inheritablerrr)r.r�r5r-r�r�r�r�r�r��_r'r'r(r�nst












�zPopen._get_handlescCs&t�t��|t��ddtj�}t|�S)z2Return a duplicate of handle, which is inheritablerrt)rOZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrG)r.�handle�hr'r'r(r�s�zPopen._make_inheritablecCstdd�|D��S)z�Filter out console handles that can't be used
            in lpAttributeList["handle_list"] and make sure the list
            isn't empty. This also removes duplicate handles.cSs,h|]$}|d@dks$t�|�tjkr|�qS)�)rOZGetFileTypeZFILE_TYPE_CHAR)�.0rr'r'r(�	<setcomp>�s��z,Popen._filter_handle_list.<locals>.<setcomp>)rF)r.rDr'r'r(�_filter_handle_list�szPopen._filter_handle_listcCszt|t�rnNt|t�r.|
r"td��t|g�}n,t|tj�rR|
rFtd��t|g�}nt|�}|dk	rlt�|�}|dkr|t�}n|�	�}d|||fk}|r�|j
tjO_
||_
||_||_|j}t|o�d|ko�|d�}|s�|�r^|�r^|dkr�i}|_t|�dg��}|d<|�r0|t|�t|�t|�g7}|�|�|dd�<|�r^|�sZt�dt�d}|
�r�|j
tjO_
tj|_|�s�tj�d�}|�s�tj�d	d
�}tj�|dd�}tj�|��s�t d
��tj�|��r�|}n|}d�!||�}|dk	�rt�|�}t"�#d||||�z,t�%||ddt|�|	|||�	\}}}}W5|�$|||
|||�Xd|_&t'|�|_(||_)t�*|�dS)z$Execute program (MS Windows version)z$bytes args is not allowed on Windows�0path-like args is not allowed when shell is trueNr\rDz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZComSpecZ
SystemRootr�ZSystem32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz
{} /c "{}"�subprocess.PopenT)+r��str�bytesr�r�r��PathLiker�r#rEr>rOrr?r@rArCr�rFr�rKrr�r�r�rrrB�environ�pathr��isabs�FileNotFoundErrorr�rW�auditrZ
CreateProcessr�rG�_handler�rI)r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listrDZcomspecZsystem_rootZhpZhtr��tidr'r'r(r��s�


��
�
�

��
zPopen._execute_childcCs,|jdkr&||jd�|kr&||j�|_|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it can only refer to objects
            in its local scope.

            Nr)r*r))r.rTZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessr'r'r(rVHs
zPopen._internal_pollcCs^|dkrtj}nt|d�}|jdkrXt�|j|�}|tjkrJt|j|��t�	|j�|_|jS)z-Internal implementation of wait() on Windows.Ni�)
rOZINFINITErKr*�WaitForSingleObjectr)ZWAIT_TIMEOUTrrd�GetExitCodeProcess)r.r<Ztimeout_millisr�r'r'r(r�Ys
�
zPopen._waitcCs|�|���|��dSr))rcrr�)r.Zfh�bufferr'r'r(�
_readerthreadiszPopen._readerthreadcCs\|jrBt|d�sBg|_tj|j|j|jfd�|_d|j_|j��|j	r�t|d�s�g|_
tj|j|j	|j
fd�|_d|j_|j��|jr�|�
|�|jdk	r�|j�|�|��|j��r�t|j|��|j	dk	r�|j�|�|��|j��r�t|j|��d}d}|j�r|j}|j��|j	�r0|j
}|j	��|�r>|dnd}|�rP|dnd}||fS)N�_stdout_buff)�targetrdT�_stderr_buffr)r5r�r/r�ZThreadr.Z
stdout_threadZdaemon�startr-r1Z
stderr_threadr�rr�rZis_aliverrdr�)r.r�r	rr5r-r'r'r(rnsJ
��

��







zPopen._communicatecCsl|jdk	rdS|tjkr"|��nF|tjkr>t�|jtj�n*|tjkrZt�|jtj�nt	d�
|���dS)�Send a signal to the process.NzUnsupported signal: {})r*r0�SIGTERM�	terminateZCTRL_C_EVENTr�r�r�ZCTRL_BREAK_EVENTr1r��r.Zsigr'r'r(�send_signal�s




zPopen.send_signalcCsX|jdk	rdSzt�|jd�Wn2tk
rRt�|j�}|tjkrH�||_YnXdS)zTerminates the process.Nrt)r*rOZTerminateProcessr)�PermissionErrorr,ZSTILL_ACTIVE)r.Zrcr'r'r(r5�s

zPopen.terminatec
Cs,d\}}d\}}d\}}	|dkr"n@|tkr8t��\}}n*|tkrJ|��}nt|t�rZ|}n|��}|dkrln@|tkr�t��\}}n*|tkr�|��}nt|t�r�|}n|��}|dkr�nf|tkr�t��\}}	nP|tkr�|dkr�|}	n
t	j
��}	n.|tk�r|��}	nt|t��r|}	n|��}	||||||	fS)rrNr\)rr��piper
r�r�rKrrrW�
__stdout__)
r.r�r5r-r�r�r�r�r�r�r'r'r(r��sP





�cCs�|dkrtj}i}|rJg}dD]"}
tt|
d�}|dk	r|�|�q||d<g}|||	fD]}|dkrX|�tj|f�qX|df|df|
dffD]"\}}|dkr�|�tj||f�q�|r�||d<tj|||f|�|_d	|_	|�
|||||	|
�dS)
z'Execute program using os.posix_spawn().N)�SIGPIPEZSIGXFZ�SIGXFSZZ	setsigdefr\rrtr��file_actionsT)r�r$rzr0rc�POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2r�r�r�r)r.rdr�r�r�r�r�r�r�r�r�r�ZsigsetZsignameZsignumr=r�Zfd2r'r'r(�_posix_spawn�s<��zPopen._posix_spawnc)s�t|ttf�r|g}n(t|tj�r6|
r.td��|g}nt|�}|
rlttd�rPdnd}|dg|}�rl�|d<�dkr||d�t�	d�|||�t
�rtj����r|dk�r|�s|�s|dk�r|d	ks�|d
k�r|d	ks�|d
k�r|d	ks�|d
k�r|�s|�
|�|||||
|||�
dS�}t��\}}g}|dk�rT|�|�t�|�}�q2|D]}t�|��qX�zJz�|dk	�r�g}|��D]>\}}t�|�}d|k�r�td
��|�|dt�|���q�nd}t����tj����r�f}nt�fdd�t�|�D��}t|�}|�|�t�|||tttt|���|||||
||||||||�|_d|_W5t�|�X|� |||
|||�t!�}t�"|d�}||7}|�r�t#|�dk�r��q��q�W5t�|�X|�r�z6t�$|jd�\} }!| |jk�r�|�%|!�ntj&|_'Wnt(k
�rYnXz|�)dd
�\}"}#}$|$�*�}$Wn,tk
�rbd}"d}#d�+t|��}$YnXt,t-|"�*d�t.�}%t/|%t0��r�|#�r�t|#d�}&|$dk}'|'�r�d}$|}(n|}(|&dk�r�t�1|&�}$|%|&|$|(��|%|$��dS)zExecute program (POSIX version)rZgetandroidapilevelz/system/bin/shz/bin/shz-crNr r\r�r�=z!illegal environment variable namec3s"|]}tj�t�|���VqdSr))r�r%r��fsencode)r�dir�r�r'r(�	<genexpr>rs�z'Popen._execute_child.<locals>.<genexpr>TiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�Znoexecr�)2r�r!r"r�r#r�rFr�rWr(�_USE_POSIX_SPAWNr%�dirnamer@r9rc�dupr�ryrBr1r��
get_exec_path�set�add�_posixsubprocessZ	fork_exec�sortedr�rKr�r�r�	bytearrayrr��waitpid�_handle_exitstatusrXr*�ChildProcessErrorr�r�r�rz�builtinsr�
issubclassr��strerror))r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
unix_shellZorig_executableZerrpipe_readZ
errpipe_writeZlow_fds_to_closeZlow_fdZenv_list�kriZexecutable_listZfds_to_keepZerrpipe_data�partr�rZexception_nameZ	hex_errno�err_msgZchild_exception_typeZ	errno_numZchild_exec_never_calledZerr_filenamer'rDr(r� s"	��
�����������	�
�





�
�
�
��
�


cCsL||�r||�|_n2||�r*||�|_n||�r@||�|_ntd��dS)�:All callers to this function MUST hold self._waitpid_lock.zUnknown child exit status!N)r*r)r.rZ_WIFSIGNALEDZ	_WTERMSIGZ
_WIFEXITEDZ_WEXITSTATUSZ_WIFSTOPPEDZ	_WSTOPSIGr'r'r(rT�szPopen._handle_exitstatusc
Cs�|jdkr�|j�d�sdSz�z>|jdk	r4|jWW�pS||j|�\}}||jkrX|�|�WnBtk
r�}z$|dk	r|||_n|j|kr�d|_W5d}~XYnXW5|j��X|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it cannot reference anything
            outside of the local scope (nor can any methods it calls).

            NFr)r*r��acquire�releaser�rTr�r)r.rTZ_waitpidZ_WNOHANGZ_ECHILDr�r�er'r'r(rV�s 	



cCs>zt�|j|�\}}Wntk
r4|j}d}YnX||fS)r\r)r�rSr�rU)r.Z
wait_flagsr�rr'r'r(�	_try_wait�s
zPopen._try_waitc	Cs|jdk	r|jS|dk	r�t�|}d}|j�d�r~z>|jdk	rDW�0q�|�tj�\}}||jkrn|�	|�W�q�W5|j��X|�
|�}|dkr�t|j|��t
|d|d�}t�|�q&n\|jdk�r|j�B|jdk	r�W5QR��q|�d�\}}||jk�r
|�	|�W5QRXq�|jS)z+Internal implementation of wait() on POSIX.Ng����Mb@?Frr�g�������?)r*rr�r]r^r`r��WNOHANGr�rTrrrdr�time�sleep)r.r<r	Zdelayr�rZ	remainingr'r'r(r��s6







c
Cs"|jrX|jsXz|j��Wntk
r.YnX|sXz|j��Wntk
rVYnXd}d}|js�i|_|jr~g|j|j<|jr�g|j|j<|jr�|j|j}|jr�|j|j}|�|�|j	r�t
|j	�}t����}|jr�|r�|�|jt
j�|j�r|jj�s|�|jt
j�|j�r6|jj�s6|�|jt
j�|���r�|�|�}|dk	�rz|dk�rz|j||||dd�td��|�|�}	|�||||�|	D]�\}
}|
j|jk�r6||j|jt�}z|jt�|
j|�7_Wn,tk
�r
|�|
j�|
j��Yn*X|jt|j	�k�r�|�|
j�|
j��nP|
j|j|jfk�r�t�|
jd�}
|
�st|�|
j�|
j��|j|
j�|
��q��q6W5QRX|j |�|�d�|dk	�r�d�!|�}|dk	�r�d�!|�}|j"�r|dk	�r�|�#||jj$|jj%�}|dk	�r|�#||jj$|jj%�}||fS)NrT)r
zN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r�)&r�r��flushrr�Z_fileobj2outputr5r-�_save_inputr��
memoryview�_PopenSelector�register�	selectorsZEVENT_WRITErHZ
EVENT_READZget_maprr�RuntimeError�selectZfileobj�
_input_offset�	_PIPE_BUFr�r�r�Z
unregisterr�rrcr�r�r�r�r�r�)r.r�r	rr5r-Z
input_viewZselectorr<Zready�keyZevents�chunkr�r'r'r(r's�





��
�
$




�
�cCsF|jrB|jdkrBd|_||_|dk	rB|jrB|j�|jj|jj�|_dS)Nr)r�r�rlr��encoder�r�)r.r�r'r'r(re�s�zPopen._save_inputcCs|jdkrt�|j|�dS)r3N)r*r�r�r�r6r'r'r(r7�s
cCs|�tj�dS)z/Terminate the process with SIGTERM
            N)r7r0r4r2r'r'r(r5�scCs|�tj�dS)z*Kill the process with SIGKILL
            N)r7r0�SIGKILLr2r'r'r(r��sz
Popen.kill)r\NNNNNTFNNNNrTFr')NN)F)N)8r$r%r&r9r�r/r:r�r;r�r�r�rWrXr�r�rPr�rr�r�rrr�rr�r�rrr�rOr+Z
WAIT_OBJECT_0r,rVr�r.rr7r5r�r@r��WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED�WSTOPSIGrTrSrarZECHILDr`rer'r'r'r(r�s�-��


D	�

H	
|�
26'�
�
#
)f)Hr9rVrr�r�rbr0rWr�r�rrr�__all__r�rOr��ModuleNotFoundErrorrPrkrirrrrrrrrrrrrrrrr r!r"r�	Exceptionrrrr#rKrGrzrmr�rQrgZSelectSelectorrUrRrrr
rer�rrr
�objectrrr�rr	r�rJrr'r'r'r(�<module>
s�"�P
�
%	


;3"�EI
/mailcap.cpython-38.opt-1.pyc000064400000016050151450073350011546 0ustar00U

e5dk#�@s�dZddlZddlZddlZddgZdd�Ze�d�jZGdd	�d	e	�Z
d
d�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zddgfdd�Zd#dd�Zgfdd�Zdd�Zdd�Zd d!�Zed"kr�e�dS)$z%Mailcap file handling.  See RFC 1524.�N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor)�r�)�entryrr�/usr/lib64/python3.8/mailcap.py�lineno_sort_key
sr	z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdZdS)�UnsafeMailcapInputz)Warning raised when refusing unsafe inputN)�__name__�
__module__�__qualname__�__doc__rrrrr
sr
c
Cs�i}d}t�D]~}zt|d�}Wntk
r8YqYnX|�t||�\}}W5QRX|��D]*\}}||krz|||<q`|||||<q`q|S)a�Return a dictionary containing the mailcap database.

    The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
    to a list of dictionaries corresponding to mailcap entries.  The list
    collects all the entries for that MIME type from all available mailcap
    files.  Each dictionary contains key-value pairs for that MIME type,
    where the viewing command is stored with the key "view".

    r�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs



cCsPdtjkr"tjd}|�tj�}n*dtjkr8tjd}nd}|ddddg}|S)z7Return a list of all mailcap files found on the system.ZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr3s


�rcCs t�dtd�t|d�\}}|S)z?Read a mailcap file and return a dictionary keyed by MIME type.z2readmailcapfile is deprecated, use getcaps instead�N)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfileEs�r%c	Cs�i}|��}|sq�|ddks|��dkr,q|}|dd�dkrb|��}|sPd}|dd�|}q0t|�\}}|r|sxq|dk	r�||d<|d	7}|�d
�}tt|��D]}||��||<q�d
�|���}||kr�||�|�q|g||<q||fS)a�Read a mailcap file and return a dictionary keyed by MIME type.

    Each MIME type is mapped to an entry consisting of a list of
    dictionaries; the list will contain more than one such dictionary
    if a given MIME type appears more than once in the mailcap file.
    Each dictionary contains key-value pairs for that MIME type, where
    the viewing command is stored with the key "view".
    r�#����Nz\
�
rr�/)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrMs4	
rc
Cs�g}dt|�}}||kr>t|||�\}}|�|�|d}qt|�dkrNdS|d|d|dd�}}}d|i}|D]V}|�d�}|dkr�|}d}	n$|d|���}||dd���}	||kr�qz|	||<qz||fS)	z�Parse one entry in a mailcap file and return a dictionary.

    The viewing command is stored as the value with the key "view",
    and the rest of the fields produce key-value pairs in the dict.
    rrr �NNN�view�=r')r/�
parsefieldr2�findr,)
r3r4�i�n�fieldrr8�restZfkeyZfvaluerrrr-vs*

 

r-cCsP|}||kr<||}|dkr q<q|dkr2|d}q|d}q|||���|fS)z/Separate one key-value pair in a mailcap entry.�;�\r r)r,)r3r<r=�start�crrrr:�s

r:r8z	/dev/nullc
Cs�t|�r"d|f}t�|t�dSt|||�}|D]`}d|krlt|d||�}|dkrXq2|rlt�|�dkrlq2t|||||�}	|	dk	r2|	|fSq2dS)aFind a match for a mailcap entry.

    Return a tuple containing the command line, and the mailcap entry
    used; (None, None) if no match is found.  This may invoke the
    'test' command of several matching entries before deciding which
    entry to use.

    zHRefusing to use mailcap with filename %r. Use a safe temporary filename.r7�testNr)�_find_unsafer!r"r
�lookup�substr�system)
r�MIMEtyper�filename�plist�msg�entries�erD�commandrrrr�s 	
cslg}||kr|||}|�d�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr*rz/*csg|]}�|kr|�qSrr)�.0rN�rrr�
<listcomp>�szlookup.<locals>.<listcomp>rQ)r�sortedr	)rrIrrMZ	MIMEtypesrrQrrF�s
rFcCsRd}dt|�}}||k�rN||}|d}|dkr^|dkrT|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�t|�r�d|f}t�|t�dS||}q|d	k�r@|}	||kr�||d
kr�|d}q�||	|�}
|d}t|
|�}t|��r6d||
f}t�|t�dS||}q|d|}q|S)Nr'rr�%rA�s�tz9Refusing to substitute MIME type %r into a shell command.�{�}z=Refusing to substitute parameter %r (%s) into a shell command)r/rEr!r"r
�	findparam)r>rIrJrK�resr<r=rCrLrB�nameZparamrrrrG�sH










rGcCsF|��d}t|�}|D](}|d|���|kr||d�SqdS)Nr9r')r1r/)r[rKr=�prrrrY�srYc	Cs�ddl}t�}|jdd�s(t|�dStdt|j�d�D]�}|j||d�}t|�dkrjtd�dS|d}|d}t||d|�\}}|s�tdt�q:td|�t	�
|�}|r:td|�q:dS)	Nrrr z"usage: mailcap [MIMEtype file] ...r8zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr.r/�printr�typerrH)	r]rr<�argsrI�filerOrN�stsrrrrDs&

rDcCs�td�t�D]}td|�qt�|s0t�}td�t�t|�}|D]H}t|�||}|D].}t|�}|D]}td|||�qrt�qbqJdS)NzMailcap files:�	zMailcap entries:z  %-15s)r`rrrS)r�fnZckeysrarMrN�keys�krrrr_s"
r_�__main__)N)rrr!�re�__all__r	�compile�searchrE�Warningr
rrr%rr-r:rrFrGrYrDr_rrrrr�<module>s*)

)_pydecimal.cpython-38.opt-2.pyc000064400000232420151450073350012250 0ustar00U

e5d:}�%@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g%ZeZd%Zd&Zd'Zd(d)lZd(d)lZd(d)l	Z	zd(d*l
mZedd+�Z
Wnek
r�d,d-�Z
YnXdZdZdZdZdZdZdZdZd.Zd.Ze	jd/kr�d0Zd0Zd1Znd2Zd2Zd3Zeed4ZGd5d�de�ZGd6d�de�Z Gd7d�de�Z!Gd8d�de!�Z"Gd9d	�d	ee#�Z$Gd:d�de!�Z%Gd;d�de!e#�Z&Gd<d
�d
e�Z'Gd=d�de!�Z(Gd>d�de�Z)Gd?d�de�Z*Gd@d
�d
e'e)�Z+GdAd�de'e)e*�Z,GdBd�dee-�Z.e e$e'e+e)e,e!e*e.g	Z/e"e!e%e!e&e!e(e!iZ0eeeeeeeefZ1d(d)l2Z2e2�3dC�Z4dDd�Z5dEd�Z6[2d�dFd�Z7GdGd�de8�Z9d�dIdJ�Z:ej;�<e9�GdKdL�dLe8�Z=GdMd�de8�Z>GdNdO�dOe8�Z?d�dPdQ�Z@eAjBZCdRdS�ZDdTdU�ZEdVdW�ZFdXdY�ZGd�d[d\�ZHd]d^�ZId_d`�ZJGdadb�dbe8�ZKeK�jLZMd�dcdd�ZNdedf�ZOdgdh�ZPdidjdkdldmdndodpdqdr�	fdsdt�ZQd�dudv�ZRd�dwdx�ZSe>dyee$e+e!ggdzd{d4d(d|�ZTe>d}ee$e+e!e e,ggd~�ZUe>d}eggd~�ZVd(d)lWZWeW�XdeWjYeWjZB�j[Z\eW�Xd��j[Z]eW�Xd��j[Z^eW�Xd�eWjYeWj_B�Z`[Wzd(d)laZbWnek
�rYnXd�d�d��Zcd�d��Zdd�d��Zed�d�d��Zfd�d��Zgd�d��Zhe9d��Zie9d��Zje9d��Zke9d(�Zle9d4�Zme9d��ZneiejfZoe	jpjqZre	jpjsZte	jpjuZvewdperd�er�Zx[	d)S)��Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�HAVE_THREADS�HAVE_CONTEXTVARZdecimalz1.70z2.4.2�N)�
namedtuplezsign digits exponentcGs|S�N�)�argsr)r)�"/usr/lib64/python3.8/_pydecimal.py�<lambda>��r,Tl����l��N�Zol������N�Zoi@�Ti����c@seZdZdd�ZdS)rcGsdSr(r)��self�contextr*r)r)r+�handle�szDecimalException.handleN��__name__�
__module__�__qualname__r2r)r)r)r+r�sc@seZdZdS)rN�r4r5r6r)r)r)r+r�sc@seZdZdd�ZdS)r	cGs,|r(t|dj|djdd�}|�|�StS)Nr&�nT)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r0r1r*�ansr)r)r+r2�s
zInvalidOperation.handleNr3r)r)r)r+r	�sc@seZdZdd�ZdS)rcGstSr(�r=r/r)r)r+r2szConversionSyntax.handleNr3r)r)r)r+rsc@seZdZdd�ZdS)r
cGst|Sr()�_SignedInfinity�r0r1�signr*r)r)r+r2szDivisionByZero.handleNr3r)r)r)r+r

s
c@seZdZdd�ZdS)rcGstSr(r?r/r)r)r+r2"szDivisionImpossible.handleNr3r)r)r)r+rsc@seZdZdd�ZdS)rcGstSr(r?r/r)r)r+r2-szDivisionUndefined.handleNr3r)r)r)r+r%sc@seZdZdS)rNr7r)r)r)r+r0sc@seZdZdd�ZdS)rcGstSr(r?r/r)r)r+r2GszInvalidContext.handleNr3r)r)r)r+r<sc@seZdZdS)rNr7r)r)r)r+rJsc@seZdZdS)r
Nr7r)r)r)r+r
Vsc@seZdZdd�ZdS)rcGs�|jttttfkrt|S|dkrR|jtkr4t|St|d|j|j	|jd�S|dkr�|jt
krlt|St|d|j|j	|jd�SdS)Nr&�9r.)�roundingrrrrr@rr9�prec�EmaxrrAr)r)r+r2ws"�
�
�zOverflow.handleNr3r)r)r)r+rasc@seZdZdS)rNr7r)r)r)r+r�sc@seZdZdS)rNr7r)r)r)r+r�sZdecimal_contextcCs8z
t��WStk
r2t�}t�|�|YSXdSr()�_current_context_var�get�LookupErrorr�set�r1r)r)r+r�s

cCs,|tttfkr|��}|��t�|�dSr()rrr�copy�clear_flagsrGrJrKr)r)r+r�scCs|dkrt�}t|�Sr()r�_ContextManager)Zctxr)r)r+r�s$c
@s�eZdZdZd�dd�Zedd��Zdd	�Zd
d�Zd�dd
�Z	dd�Z
dd�Zdd�Zd�dd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd�d)d*�Zd�d+d,�Zd�d-d.�Zd�d/d0�Zd�d2d3�Zd�d4d5�ZeZd�d6d7�Z�dd8d9�Z�dd:d;�Z e Z!�dd<d=�Z"d>d?�Z#�dd@dA�Z$�ddBdC�Z%�ddDdE�Z&�ddFdG�Z'�ddHdI�Z(�ddJdK�Z)�d	dLdM�Z*�d
dNdO�Z+dPdQ�Z,dRdS�Z-e-Z.e/dTdU��Z0e/dVdW��Z1dXdY�Z2dZd[�Z3d\d]�Z4d^d_�Z5d`da�Z6dbdc�Z7ddde�Z8dfdg�Z9dhdi�Z:djdk�Z;dldm�Z<dndo�Z=e>e6e7e8e9e:e;e<e=dp�Z?�ddqdr�Z@dsdt�ZAdudv�ZB�ddwdx�ZC�d
dydz�ZDd{d|�ZE�dd}d~�ZF�ddd��ZG�dd�d��ZH�dd�d��ZI�dd�d��ZJd�d��ZKd�d��ZL�dd�d��ZM�dd�d��ZNeNZO�dd�d��ZP�dd�d��ZQ�dd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZV�dd�d��ZW�dd�d��ZX�dd�d��ZYd�d��ZZd�d��Z[�dd�d��Z\�dd�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Za�dd�d��Zbd�d��Zcd�d��Zdd�d��Ze�dd�d��Zfd�d��Zgd�d��Zh�dd�d„Zid�dĄZj�d d�dƄZk�d!d�dȄZld�dʄZmd�d̄Zn�d"d�d΄Zo�d#d�dЄZp�d$d�d҄Zq�d%d�dԄZr�d&d�dքZs�d'd�d؄Zt�d(d�dڄZu�d)d�d܄Zv�d*d�dބZw�d+d�d�Zxd�d�Zy�d,d�d�Zz�d-d�d�Z{�d.d�d�Z|d�d�Z}d�d�Z~d�d�Z�d/d�d�Z�dS(0r)�_expr;r:�_is_special�0NcCs�t�|�}t|t��r$t|���dd��}|dkrP|dkr@t�}|�t	d|�S|�
d�dkrfd|_nd|_|�
d�}|dk	r�|�
d	�p�d}t|�
d
�p�d�}tt||��|_
|t|�|_d|_nZ|�
d
�}|dk	�rtt|p�d���d�|_
|�
d��rd|_nd|_nd|_
d|_d|_|St|t��rf|dk�rBd|_nd|_d|_tt|��|_
d|_|St|t��r�|j|_|j|_|j
|_
|j|_|St|t��r�|j|_t|j�|_
t|j�|_d|_|St|ttf��r"t|�dk�r�td��t|dt��r|ddk�std��|d|_|ddk�rHd|_
|d|_d|_n�g}	|dD]R}
t|
t��r�d|
k�r|dk�r�nn|	�s�|
dk�r�|	�|
�ntd���qT|ddk�r�d�tt|	��|_
|d|_d|_nDt|dt��rd�tt|	�p�dg��|_
|d|_d|_ntd��|St|t��rx|dk�r>t�}|�td�t�|�}|j|_|j|_|j
|_
|j|_|St d|��dS)N�_�zInvalid literal for Decimal: %rrB�-r.r&�intZfrac�exprQF�diag�signal�Nr8�FT�ztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.�r&r.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.��	zTThe second value in the tuple must be composed of integers in the range 0 through 9.�r8rYzUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabledzCannot convert %r to Decimal)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�groupr:rUr;�lenrOrP�lstrip�absr�_WorkReprBrV�list�tuple�
ValueError�append�join�map�floatr�
from_float�	TypeError)�cls�valuer1r0�m�intpart�fracpartrVrW�digitsZdigitr)r)r+rb
s�
�





(


�
zDecimal.__new__cCs�t|t�r,|dkrdnd}d}tt|��}nzt|t�r�t�|�sJt�|�rV|t|��St�	d|�dkrld}nd}t|��
�\}}|��d}t|d|�}ntd��t
|||�}|tkr�|S||�SdS)Nr&r.g�?�zargument must be int or float.)rcrUrdrlrt�_mathZisinfZisnan�reprZcopysign�as_integer_ratio�
bit_lengthrvr9r)rw�frB�k�coeffr8�d�resultr)r)r+ru�s$

zDecimal.from_floatcCs(|jr$|j}|dkrdS|dkr$dSdS)Nr8r.rYr]r&)rPrO)r0rVr)r)r+�_isnan�szDecimal._isnancCs|jdkr|jrdSdSdS)NrZ���r.r&)rOr:�r0r)r)r+�_isinfinity�s

zDecimal._isinfinitycCs||��}|dkrd}n|��}|s&|rx|dkr4t�}|dkrJ|�td|�S|dkr`|�td|�S|rn|�|�S|�|�SdS)NFr]�sNaNr&)r�rrhr	r<)r0�otherr1�self_is_nan�other_is_nanr)r)r+�_check_nans�s&
��

zDecimal._check_nanscCsv|dkrt�}|js|jrr|��r0|�td|�S|��rF|�td|�S|��r\|�td|�S|��rr|�td|�SdS)Nzcomparison involving sNaNzcomparison involving NaNr&)rrP�is_snanrhr	�is_qnan�r0r�r1r)r)r+�_compare_check_nans	s0����zDecimal._compare_check_nanscCs|jp|jdkS�NrQ�rPr;r�r)r)r+�__bool__*szDecimal.__bool__cCs|js|jr8|��}|��}||kr(dS||kr4dSdS|sP|sDdSd|jS|s^d|jS|j|jkrndS|j|jkr~dS|��}|��}||kr�|jd|j|j}|jd|j|j}||kr�dS||kr�d|jSd|jSn ||k�rd|jSd|jSdS)Nr&r�r.rQ)rPr�r:�adjustedr;rO)r0r�Zself_infZ	other_inf�
self_adjustedZother_adjusted�self_paddedZother_paddedr)r)r+�_cmp1s>


zDecimal._cmpcCs<t||dd�\}}|tkr|S|�||�r.dS|�|�dkS)NT)�equality_opFr&)�_convert_for_comparison�NotImplementedr�r�r�r)r)r+�__eq__qszDecimal.__eq__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkS�NFr&�r�r�r�r��r0r�r1r>r)r)r+�__lt__yszDecimal.__lt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__le__�szDecimal.__le__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__gt__�szDecimal.__gt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__ge__�szDecimal.__ge__cCs>t|dd�}|js|r0|jr0|�||�}|r0|St|�|��S�NT��raiseit)�_convert_otherrPr�rr�r�r)r)r+�compare�szDecimal.comparecCs�|jr4|��rtd��n|��r$tS|jr0tStS|jdkrNtd|jt	�}ntt
|jt	�}t|j�|t	}|dkr||n|}|dkr�dS|S)Nz"Cannot hash a signaling NaN value.r&�
r����)
rPr�rv�is_nan�_PyHASH_NANr:�_PyHASH_INFrO�pow�_PyHASH_MODULUS�
_PyHASH_10INVrUr;)r0Zexp_hashZhash_r>r)r)r+�__hash__�s

zDecimal.__hash__cCst|jttt|j��|j�Sr()rr:rorsrUr;rOr�r)r)r+�as_tuple�szDecimal.as_tuplecCs�|jr |��rtd��ntd��|s(dSt|j�}|jdkrR|d|jd}}nn|j}|dkr�|ddkr�|d}|d8}qZ|j}t||@��d|�}|r�||L}||8}d||>}|j	r�|}||fS)Nz#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior\r&r�r.r})
rPr�rp�
OverflowErrorrUr;rO�minr�r:)r0r8r�Zd5Zd2Zshift2r)r)r+r��s,



zDecimal.as_integer_ratiocCsdt|�S)Nz
Decimal('%s'))rdr�r)r)r+�__repr__szDecimal.__repr__Fc	Csbddg|j}|jrL|jdkr&|dS|jdkr>|d|jS|d|jS|jt|j�}|jdkrt|d	krt|}n6|s~d
}n,|jdkr�|d
dd
}n|d
dd
}|dkr�d}d
d||j}nL|t|j�kr�|jd|t|j�}d}n |jd|�}d
|j|d�}||k�r(d}n*|dk�r8t�}ddg|jd||}||||S)NrSrTrZZInfinityr8�NaNr�r&���r.rQr[�.�e�Ez%+d)r:rPrOr;rjr�capitals)	r0�engr1rB�
leftdigits�dotplacerzr{rVr)r)r+�__str__s:




zDecimal.__str__cCs|jd|d�S)NT)r�r1)r��r0r1r)r)r+�
to_eng_string;szDecimal.to_eng_stringcCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}n|��}|�|�S�NrK)rPr�rrDr�copy_abs�copy_negate�_fix�r0r1r>r)r)r+�__neg__Ds
zDecimal.__neg__cCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}nt|�}|�|�Sr�)rPr�rrDrr�rr�r�r)r)r+�__pos__Zs
zDecimal.__pos__TcCsJ|s|��S|jr&|j|d�}|r&|S|jr:|j|d�}n|j|d�}|Sr�)r�rPr�r:r�r�)r0�roundr1r>r)r)r+�__abs__oszDecimal.__abs__c
Csht|�}|tkr|S|dkr"t�}|js.|jr�|�||�}|rB|S|��rr|j|jkrj|��rj|�td�St	|�S|��r�t	|�St
|j|j�}d}|jt
kr�|j|jkr�d}|s�|s�t
|j|j�}|r�d}t|d|�}|�|�}|S|�st||j|jd�}|�||j�}|�|�}|S|�sVt||j|jd�}|�||j�}|�|�}|St|�}t|�}t|||j�\}}t�}	|j|jk�r�|j|jk�r�t|d|�}|�|�}|S|j|jk�r�||}}|jdk�r�d|	_|j|j|_|_nd|	_n&|jdk�rd|	_d\|_|_nd|	_|jdk�r<|j|j|	_n|j|j|	_|j|	_t	|	�}|�|�}|S)Nz
-INF + INFr&r.rQ)r&r&)r�r�rrPr�r�r:rhr	rr�rOrDrr9r��maxrE�_rescalerm�
_normalizerBrUrV)
r0r�r1r>rVZnegativezerorB�op1�op2r�r)r)r+�__add__�s|





zDecimal.__add__cCsHt|�}|tkr|S|js |jr6|j||d�}|r6|S|j|��|d�Sr�)r�r�rPr�r�r�r�r)r)r+�__sub__�szDecimal.__sub__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rsub__�szDecimal.__rsub__cCs@t|�}|tkr|S|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rn|sf|�td�St	|S|��r�|s�|�td�St	|S|j
|j
}|r�|s�t|d|�}|�|�}|S|j
dkr�t||j
|�}|�|�}|S|j
dk�r
t||j
|�}|�|�}|St|�}t|�}t|t|j|j�|�}|�|�}|S)Nz(+-)INF * 0z0 * (+-)INFrQ�1)r�r�rr:rPr�r�rhr	r@rOr9r�r;rmrdrU)r0r�r1Z
resultsignr>Z	resultexpr�r�r)r)r+�__mul__�sH




zDecimal.__mul__cCs�t|�}|tkrtS|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rj|��rj|�td�S|��rzt	|S|��r�|�t
d�t|d|���S|s�|s�|�t
d�S|�td|�S|s�|j|j}d}n�t|j�t|j�|jd}|j|j|}t|�}t|�}	|dk�r:t|jd||	j�\}}
nt|j|	jd|�\}}
|
�rt|d	dk�r�|d7}n8|j|j}||k�r�|ddk�r�|d}|d7}�q�t|t|�|�}|�|�S)
Nz(+-)INF/(+-)INFzDivision by infinityrQz0 / 0zx / 0r&r.r�r})r�r�rr:rPr�r�rhr	r@rr9�Etinyrr
rOrjr;rErm�divmodrUrdr�)r0r�r1rBr>rVr��shiftr�r��	remainder�	ideal_expr)r)r+�__truediv__,sP

zDecimal.__truediv__cCs|j|jA}|��r|j}nt|j|j�}|��|��}|rN|��sN|dkrht|dd�|�||j�fS||jk�r
t	|�}t	|�}|j
|j
kr�|jd|j
|j
9_n|jd|j
|j
9_t|j|j�\}}	|d|jk�r
t|t
|�d�t|jt
|	�|�fS|�td�}
|
|
fS)Nr�rQr&r�z%quotient too large in //, % or divmod)r:r�rOr�r�r9r�rDrErmrVrUr�rdrhr)r0r�r1rBr��expdiffr�r��q�rr>r)r)r+�_dividegs0
���zDecimal._dividecCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rtruediv__�szDecimal.__rtruediv__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r:||fS|j|jA}|��r~|��rj|�td�}||fSt||�td�fS|s�|s�|�t	d�}||fS|�t
d|�|�td�fS|�||�\}}|�|�}||fS)Nzdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
r�r�rr�r:r�rhr	r@rr
r�r�)r0r�r1r>rBZquotientr�r)r)r+�
__divmod__�s4
�
�
zDecimal.__divmod__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rdivmod__�szDecimal.__rdivmod__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rJ|�td�S|sj|r^|�td�S|�td�S|�||�d}|�	|�}|S)Nr�r�z0 % 0r.)
r�r�rr�r�rhr	rr�r�)r0r�r1r>r�r)r)r+�__mod__�s"
zDecimal.__mod__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rmod__�szDecimal.__rmod__cCs�|dkrt�}t|dd�}|�||�}|r.|S|��rB|�td�S|sb|rV|�td�S|�td�S|��r|t|�}|�|�St	|j
|j
�}|s�t|jd|�}|�|�S|�
�|�
�}||jdkr�|�t�S|dkr�|�||j�}|�|�St|�}t|�}|j|jk�r(|jd	|j|j9_n|jd	|j|j9_t|j|j�\}}	d
|	|d@|jk�r~|	|j8}	|d7}|d	|jk�r�|�t�S|j}
|	dk�r�d|
}
|	}	t|
t|	�|�}|�|�S)NTr�zremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)rQr.r�r�r]r&)rr�r�r�rhr	rrr�r�rOr9r:r�rErr�rDrmrVrUr�rd)r0r�r1r>�ideal_exponentr�r�r�r�r�rBr)r)r+�remainder_near�s`���






zDecimal.remainder_nearcCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rb|��rR|�td�St|j|jAS|s�|r�|�t	d|j|jA�S|�t
d�S|�||�dS)Nz
INF // INFr�z0 // 0r&)r�r�rr�r�rhr	r@r:r
rr�r�r)r)r+�__floordiv__'s&
�zDecimal.__floordiv__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�
__rfloordiv__CszDecimal.__rfloordiv__cCs8|��r(|��rtd��|jr"dnd}nt|�}t|�S)Nz%Cannot convert signaling NaN to floatz-nan�nan)r�r�rpr:rdrt�r0�sr)r)r+�	__float__JszDecimal.__float__cCst|jr(|��rtd��n|��r(td��d|j}|jdkrT|t|j�d|jS|t|jd|j�pjd�SdS)NzCannot convert NaN to integerz"Cannot convert infinity to integerr�r&r�rQ)	rPr�rpr�r�r:rOrUr;r�r)r)r+�__int__Ts


zDecimal.__int__cCs|Sr(r)r�r)r)r+�realcszDecimal.realcCstd�S�Nr&�rr�r)r)r+�imaggszDecimal.imagcCs|Sr(r)r�r)r)r+�	conjugatekszDecimal.conjugatecCstt|��Sr()�complexrtr�r)r)r+�__complex__nszDecimal.__complex__cCsR|j}|j|j}t|�|krJ|t|�|d��d�}t|j||jd�St|�S)NrQT)	r;rE�clamprjrkr9r:rOr)r0r1ZpayloadZmax_payload_lenr)r)r+r<qszDecimal._fix_nancCsX|jr |��r|�|�St|�S|��}|��}|s�|j|g|j}tt	|j
|�|�}||j
krx|�t�t
|jd|�St|�St|j�|j
|j}||kr�|�td|j�}|�t�|�t�|S||k}|r�|}|j
|k�r�t|j�|j
|}	|	dk�rt
|jd|d�}d}	|j|j}
|
||	�}|jd|	��p>d}|dk�r~tt|�d�}t|�|jk�r~|dd�}|d7}||k�r�|�td|j�}nt
|j||�}|�r�|�r�|�t�|�r�|�t�|�r�|�t�|�t�|�s�|�t�|S|�r|�t�|jdk�rP|j
|k�rP|�t�|jd|j
|}
t
|j|
|�St|�S)NrQ�
above Emaxr&r�r.r�)rPr�r<rr��EtoprFr�r�r�rOrhrr9r:rjr;rErrr�_pick_rounding_functionrDrdrUrr
)r0r1r�r��exp_maxZnew_expZexp_minr>Zself_is_subnormalr|Zrounding_method�changedr�r�r)r)r+r�}sn
















zDecimal._fixcCst|j|�rdSdSdS)Nr&r�)�
_all_zerosr;�r0rEr)r)r+�_round_down�szDecimal._round_downcCs|�|�Sr()rrr)r)r+�	_round_up�szDecimal._round_upcCs*|j|dkrdSt|j|�r"dSdSdS)NZ56789r.r&r�)r;r�rr)r)r+�_round_half_up�s
zDecimal._round_half_upcCst|j|�rdS|�|�SdS)Nr���_exact_halfr;rrr)r)r+�_round_half_down�szDecimal._round_half_downcCs8t|j|�r*|dks&|j|ddkr*dS|�|�SdS)Nr&r.�02468r�rrr)r)r+�_round_half_even�s��zDecimal._round_half_evencCs |jr|�|�S|�|�SdSr(�r:rrr)r)r+�_round_ceilings
zDecimal._round_ceilingcCs |js|�|�S|�|�SdSr(r	rr)r)r+�_round_floor
s
zDecimal._round_floorcCs0|r |j|ddkr |�|�S|�|�SdS)Nr.Z05)r;rrr)r)r+�_round_05ups
zDecimal._round_05up)rrrrrrrrcCsb|dk	r2t|t�std��tdd|�}|�|�S|jrR|��rJtd��ntd��t|�	dt
��S)Nz+Second argument to round should be integralr&r��cannot round a NaN�cannot round an infinity)rcrUrvr9�quantizerPr�rpr�r�r)r0r8rVr)r)r+�	__round__&s/


zDecimal.__round__cCs0|jr |��rtd��ntd��t|�dt��S�Nr
rr&)rPr�rpr�rUr�rr�r)r)r+�	__floor__ds

zDecimal.__floor__cCs0|jr |��rtd��ntd��t|�dt��Sr)rPr�rpr�rUr�rr�r)r)r+�__ceil__ss

zDecimal.__ceil__cCst|dd�}t|dd�}|js$|jr�|dkr2t�}|jdkrJ|�td|�S|jdkrb|�td|�S|jdkrr|}nf|jdkr�|}nV|jdkr�|s�|�td�St|j|jA}n*|jdkr�|s�|�td�St|j|jA}n0t|j|jAt	t
|j�t
|j��|j|j�}|�||�S)	NTr�rYr�r8rZzINF * 0 in fmaz0 * INF in fma)
r�rPrrOrhr	r@r:r9rdrUr;r�)r0r�Zthirdr1�productr)r)r+�fma�s<




�
�
�zDecimal.fmacCs�t|�}|tkr|St|�}|tkr(|S|dkr6t�}|��}|��}|��}|sZ|sZ|r�|dkrp|�td|�S|dkr�|�td|�S|dkr�|�td|�S|r�|�|�S|r�|�|�S|�|�S|��r�|��r�|��s�|�td�S|dkr�|�td�S|�s|�td�S|��|j	k�r(|�td�S|�s@|�s@|�td�S|�
��rPd}n|j}tt
|��}t|���}t|���}	|j
|td	|j|�|}t|	j�D]}
t|d	|�}�q�t||	j
|�}t|t|�d�S)
Nr]r�z@pow() 3rd argument not allowed unless all arguments are integersr&zApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not definedr�)r�r�rr�rhr	r<�
_isintegerr�rE�_isevenr:rlrUrm�to_integral_valuer�rV�ranger9rd)r0r��modulor1r�r�Z
modulo_is_nanrB�base�exponent�ir)r)r+�
_power_modulo�s����


�������
zDecimal._power_modulocCs�t|�}|j|j}}|ddkr4|d}|d7}qt|�}|j|j}}|ddkrh|d}|d7}qJ|dk�r||9}|ddkr�|d}|d7}qz|dkr�dS|d|}	|jdkr�|	}	|��r�|jdkr�|jt|�}
t|	|
|d�}nd}tddd||	|�S|jdk�r�|d}|dk�r�||@|k�rBdSt	|�d}
|dd}|t
t|��k�rpdSt|
||�}
t|||�}|
dk�s�|dk�r�dS|
|k�r�dSd	|
}n�|d	k�r�t	|�d
d}
t
d	|
|�\}}|�r�dS|d	dk�r|d	}|
d8}
�q�|dd}|t
t|��k�r6dSt|
||�}
t|||�}|
dk�sf|dk�rjdS|
|k�rxdSd|
}ndS|d|k�r�dS|
|}tdt|�|�S|dk�r�|d|d}}n�|dk�r�t
tt||���|k�r�dSt	|�}|dk�r,t
tt|�|��|k�r,dS|d|}}|d|dk�r\dk�rtnn|d}|d}�q<|d	|d	k�r�dk�r�nn|d	}|d	}�qt|dk�rX|dk�r�||k�r�dSt
||�\}}|dk�r�dSdt	|�|>}t
|||d�\}}||k�r$�q<n||d||}�q�||k�rP|dk�sTdS|}|dk�r|||d
t|�k�r|dS||}||9}|d|k�r�dSt|�}|���r�|jdk�r�|jt|�}
t||
|t
|��}nd}td|d|||�S)Nr�r&r.r�rQ)r]����]�Ar}�r[r]�d)rmrUrVrBrr:rOr�r9�_nbitsrjrd�_decimal_lshift_exactr�rl�	_log10_lb)r0r��p�x�xc�xe�y�yc�yerr�ZzerosZ
last_digitr�Zemaxr�ryr8Zxc_bits�rem�ar�r�Zstr_xcr)r)r+�_power_exacts�:












&&$$


 zDecimal._power_exactcCs4|dk	r|�|||�St|�}|tkr*|S|dkr8t�}|�||�}|rL|S|sd|s`|�td�StSd}|jdkr�|�	�r�|�
�s�d}n|r�|�td�S|��}|s�|jdkr�t|dd�St
|S|��r�|jdkr�t
|St|dd�S|tk�r�|�	��rZ|jdk�rd}n||jk�r"|j}nt|�}|j|}|d|jk�rxd|j}|�t�n|�t�|�t�d|j}t|dd||�S|��}|���r�|jdk|dkk�r�t|dd�St
|Sd}d}	|��|��}
|dk|jdkk�r|
tt|j��k�rHt|d|jd�}n,|��}|
tt|��k�rHt|d|d�}|dk�r�|�||jd�}|dk	�r�|dk�r�td|j|j�}d}	|dk�r8|j}t|�}
|
j|
j}}t|�}|j|j}}|jdk�r�|}d	}t||||||�\}}|d
dtt|��|d�r�q(|d	7}�q�t|t|�|�}|	�r&|�	��s&t|j�|jk�r�|jdt|j�}t|j|jd||j|�}|� �}|�!�t"D]}d|j#|<�q�|�$|�}|�t�|j%t&�r�|�t'�|j%t(�r�|�t(d|j�t't&ttt)fD]}|j%|�r|�|��qn
|�$|�}|S)
Nz0 ** 0r&r.z+x ** y with x negative and y not an integerrQr�FTr[r}r�r�)*rr�r�rr�rhr	�_Oner:rrr�r9r@r�rErUrOrrr��_log10_exp_boundrjrdrFr�r2r;rmrVrB�_dpowerrLrM�_signals�trapsr��flagsr
rrr)r0r�rr1r>Zresult_signZ
multiplierrVZself_adj�exactZboundr�r)r*r+r,r-r.r/�extrar�r�Z
newcontextZ	exceptionr)r)r+�__pow__�s�
�













"�



zDecimal.__pow__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r;r�r)r)r+�__rpow__�	szDecimal.__rpow__cCs�|dkrt�}|jr(|j|d�}|r(|S|�|�}|��r>|S|sPt|jdd�S|j|��g|j	}t
|j�}|j}|j|ddkr�||kr�|d7}|d8}qtt|j|jd|�|�S)NrKrQr&r.)
rrPr�r�r�r9r:rFr�r�rjr;rO)r0r1r>�dupr��endrVr)r)r+�	normalize�	s$


zDecimal.normalizecCs�t|dd�}|dkrt�}|dkr(|j}|js4|jr||�||�}|rH|S|��sX|��r||��rp|��rpt|�S|�td�S|�	�|j
kr�|jks�n|�td�S|s�t|j
d|j
�}|�|�S|��}||jkr�|�td�S||j
d|jk�r|�td�S|�|j
|�}|��|jk�r.|�td�St|j�|jk�rL|�td�S|�rl|��|jk�rl|�t�|j
|j
k�r�||k�r�|�t�|�t�|�|�}|S)	NTr�zquantize with one INFz)target exponent out of bounds in quantizerQz9exponent of quantize result too large for current contextr.z7quantize result has too many digits for current context)r�rrDrPr�r�rrhr	r�rOrFr9r:r�r�rEr�rjr;�Eminr
rr)r0rVrDr1r>r�r)r)r+r�	s`��

����




zDecimal.quantizecCsDt|dd�}|js|jr8|��r(|��p6|��o6|��S|j|jkSr�)r�rPr��is_infiniterOr�r)r)r+�same_quantum%
s	�zDecimal.same_quantumcCs�|jrt|�S|s t|jd|�S|j|krHt|j|jd|j||�St|j�|j|}|dkrzt|jd|d�}d}|j|}|||�}|jd|�p�d}|dkr�tt	|�d�}t|j||�S)NrQr&r�r.)
rPrr9r:rOr;rjr�rdrU)r0rVrDr|Z
this_functionr�r�r)r)r+r�4
s&
�

zDecimal._rescalecCsf|dkrtd��|js|s"t|�S|�|��d||�}|��|��krb|�|��d||�}|S)Nr&z'argument should be at least 1 in _roundr.)rprPrr�r�)r0�placesrDr>r)r)r+�_roundV
s

zDecimal._roundcCs�|jr"|j|d�}|r|St|�S|jdkr4t|�S|sFt|jdd�S|dkrTt�}|dkrb|j}|�d|�}||kr�|�	t
�|�	t�|S)NrKr&rQ)rPr�rrOr9r:rrDr�rhrr�r0rDr1r>r)r)r+�to_integral_exactm
s$



zDecimal.to_integral_exactcCs`|dkrt�}|dkr|j}|jr>|j|d�}|r6|St|�S|jdkrPt|�S|�d|�SdS)NrKr&)rrDrPr�rrOr�rEr)r)r+r�
s
zDecimal.to_integral_valuecCs�|dkrt�}|jrB|j|d�}|r(|S|��rB|jdkrBt|�S|sdt|jd|jd�}|�|�S|jdkrz|�	t
d�S|jd}t|�}|j
d?}|j
d@r�|jd}t|j�d?d}n|j}t|j�dd?}||}|dkr�|d|9}d	}	nt|d|�\}}
|
}	||8}d|}||}||k�r:�qJn||d?}�q"|	�oZ|||k}	|	�r�|dk�rz|d|}n|d|9}||7}n|d
dk�r�|d7}tdt|�|�}|��}|�t�}
|�|�}|
|_|S)NrKr&rQr]r.zsqrt(-x), x > 0r�r%Tr})rrPr�r�r:rr9rOr�rhr	rErmrVrUrjr;r�rd�
_shallow_copy�
_set_roundingrrD)r0r1r>rE�opr��c�lr�r9r�r8r�rDr)r)r+�sqrt�
s^










zDecimal.sqrtcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S�NTr�r.r&r��r�rrPr�r�r�r��
compare_total�r0r�r1ZsnZonrJr>r)r)r+r�s&


	
zDecimal.maxcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�SrMrNrPr)r)r+r�*s&



zDecimal.mincCs8|jr
dS|jdkrdS|j|jd�}|dt|�kS)NFr&TrQ)rPrOr;rj)r0�restr)r)r+rLs
zDecimal._isintegercCs&|r|jdkrdS|jd|jdkS)Nr&Tr�r)rOr;r�r)r)r+rUszDecimal._isevencCs2z|jt|j�dWStk
r,YdSXdS)Nr.r&)rOrjr;rvr�r)r)r+r�[szDecimal.adjustedcCs|Sr(r)r�r)r)r+�	canonicalcszDecimal.canonicalcCs.t|dd�}|�||�}|r |S|j||d�S�NTr�rK)r�r�r�r�r)r)r+�compare_signalks
zDecimal.compare_signalcCs`t|dd�}|jr|jstS|js,|jr,tS|j}|��}|��}|sL|�r||kr�t|j�|jf}t|j�|jf}||kr�|r�tStS||kr�|r�tStStS|r�|dkr�tS|dkr�tS|dkr�tS|dkr�tSn2|dkr�tS|dkr�tS|dkr�tS|dk�rtS||k�rtS||k�r$tS|j|jk�r@|�r<tStS|j|jk�r\|�rXtStStS)NTr�r.r])	r�r:�_NegativeOner3r�rjr;�_ZerorO)r0r�r1rBZself_nanZ	other_nanZself_keyZ	other_keyr)r)r+rOwsf



zDecimal.compare_totalcCs&t|dd�}|��}|��}|�|�Sr�)r�r�rO)r0r�r1r��or)r)r+�compare_total_mag�szDecimal.compare_total_magcCstd|j|j|j�Sr�)r9r;rOrPr�r)r)r+r��szDecimal.copy_abscCs2|jrtd|j|j|j�Std|j|j|j�SdS)Nr&r.)r:r9r;rOrPr�r)r)r+r��szDecimal.copy_negatecCs"t|dd�}t|j|j|j|j�Sr�)r�r9r:r;rOrPr�r)r)r+�	copy_sign�s

�zDecimal.copy_signcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|s:tS|��dkrNt|�S|j}|��}|jdkr�|t	t
|jdd��kr�tdd|jd�}�n0|jdkr�|t	t
|�
�dd��kr�tdd|�
�d�}n�|jdk�r||k�rtddd|dd|�}n�|jdk�rD||dk�rDtdd|d|d�}n�t|�}|j|j}}|jdk�rl|}d}t||||�\}	}
|	d	d
t	t
|	��|d�r��q�|d7}�qptdt
|	�|
�}|��}|�t�}|�|�}||_|S)NrKr�r.r&r[r�rQrCr}r�)rr�r�rVr3rrEr�r:rjrdrFr9r�rmrUrVrB�_dexprGrHrr�rD)r0r1r>r)�adjrIrJr�r:r�rVrDr)r)r+rV�sH$( "

zDecimal.expcCsdS)NTr)r�r)r)r+�is_canonical'szDecimal.is_canonicalcCs|jSr()rPr�r)r)r+�	is_finite/szDecimal.is_finitecCs
|jdkS)NrZ�rOr�r)r)r+rA7szDecimal.is_infinitecCs
|jdkS)Nr_r^r�r)r)r+r�;szDecimal.is_nancCs*|js
|sdS|dkrt�}|j|��kS�NF)rPrr@r�r�r)r)r+�	is_normal?s

zDecimal.is_normalcCs
|jdkS)Nr8r^r�r)r)r+r�GszDecimal.is_qnancCs
|jdkS�Nr.)r:r�r)r)r+�	is_signedKszDecimal.is_signedcCs
|jdkS)NrYr^r�r)r)r+r�OszDecimal.is_snancCs*|js
|sdS|dkrt�}|��|jkSr_)rPrr�r@r�r)r)r+�is_subnormalSs

zDecimal.is_subnormalcCs|jo|jdkSr�r�r�r)r)r+�is_zero[szDecimal.is_zerocCs�|jt|j�d}|dkr4tt|dd��dS|dkrXttd|dd��dSt|�}|j|j}}|dkr�t|d|�}t|�}t|�t|�||kS|ttd||��dS)Nr.�r�r�r�r&�rOrjr;rdrmrUrV�r0r[rIrJr��numZdenr)r)r+�
_ln_exp_bound_szDecimal._ln_exp_boundc
Cs|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|tkrFtS|jdkr\|�t	d�St
|�}|j|j}}|j
}||��d}t|||�}|ddttt|���|dr�q�|d7}q�tt|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)	NrKr.zln of a negative valuer]r}r�r[r&)rr��_NegativeInfinityr��	_Infinityr3rVr:rhr	rmrUrVrEri�_dlogrjrdrlr9rGrHrr�rD�
r0r1r>rIrJr�r)rCr�rDr)r)r+�lnxs:
�$


z
Decimal.lncCs�|jt|j�d}|dkr,tt|��dS|dkrHttd|��dSt|�}|j|j}}|dkr�t|d|�}td|�}t|�t|�||kdStd||�}t|�||dkdS)	Nr.r�r�r&r���r]Z231rfrgr)r)r+r4�szDecimal._log10_exp_boundc
CsF|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|jdkrP|�td�S|jddkr�|jdd�dt	|j�dkr�t
|jt	|j�d�}n�t|�}|j
|j}}|j}||��d}t|||�}|dd	t	tt|���|dr��q|d
7}q�tt
|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)NrKr.zlog10 of a negative valuer&r�rQr]r}r�r[)rr�rjr�rkr:rhr	r;rjrrOrmrUrVrEr4�_dlog10rdrlr9rGrHrr�rDrmr)r)r+�log10�s:
�.$


z
Decimal.log10cCsV|j|d�}|r|S|dkr"t�}|��r.tS|s@|�tdd�St|���}|�|�S)NrKzlogb(0)r.)	r�rr�rkrhr
rr�r�r�r)r)r+�logb�s	zDecimal.logbcCs6|jdks|jdkrdS|jD]}|dkrdSqdS)Nr&FZ01T)r:rOr;)r0�digr)r)r+�
_islogical
s
zDecimal._islogicalcCs�|jt|�}|dkr$d||}n|dkr<||jd�}|jt|�}|dkr`d||}n|dkrx||jd�}||fS)Nr&rQ)rErj)r0r1�opa�opbZdifr)r)r+�
_fill_logical'
szDecimal._fill_logicalcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)NTr�rScSs$g|]\}}tt|�t|�@��qSr)�rdrU��.0r1�br)r)r+�
<listcomp>B
sz'Decimal.logical_and.<locals>.<listcomp>r&rQ�rr�rtrhr	rwr;rr�zipr9rk�r0r�r1rurvr�r)r)r+�logical_and4
s
zDecimal.logical_andcCs(|dkrt�}|�tdd|jd�|�S)Nr&r�)r�logical_xorr9rEr�r)r)r+�logical_invertE
s
�zDecimal.logical_invertcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)NTr�rScSs$g|]\}}tt|�t|�B��qSr)rxryr)r)r+r|Z
sz&Decimal.logical_or.<locals>.<listcomp>r&rQr}rr)r)r+�
logical_orL
s
zDecimal.logical_orcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)NTr�rScSs$g|]\}}tt|�t|�A��qSr)rxryr)r)r+r|k
sz'Decimal.logical_xor.<locals>.<listcomp>r&rQr}rr)r)r+r�]
s
zDecimal.logical_xorcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�SrM�	r�rrPr�r�r�r�r�rOrPr)r)r+�max_magn
s&


zDecimal.max_magcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�SrMr�rPr)r)r+�min_mag�
s&


zDecimal.min_magcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)NrKr�r.r&rCr�)rr�r�rjr9rEr�rLrHr�_ignore_all_flagsr�r�r��r0r1r>Znew_selfr)r)r+�
next_minus�
s$

�zDecimal.next_minuscCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)NrKr.r�rCr&r�)rr�r�rkr9rEr�rLrHrr�r�r�r�r�r)r)r+�	next_plus�
s$

�zDecimal.next_pluscCs�t|dd�}|dkrt�}|�||�}|r.|S|�|�}|dkrJ|�|�S|dkr^|�|�}n
|�|�}|��r�|�t	d|j
�|�t�|�t�nD|�
�|jkr�|�t�|�t�|�t�|�t�|s�|�t�|S)NTr�r&r�z Infinite result from next_toward)r�rr�r�rYr�r�r�rhrr:rrr�r@rr
r)r0r�r1r>Z
comparisonr)r)r+�next_toward�
s6	


�





zDecimal.next_towardcCs�|��rdS|��rdS|��}|dkr,dS|dkr8dS|��rN|jrJdSdS|dkr\t�}|j|d	�rv|jrrd
SdS|jr�dSd
SdS)Nr�r�r.z	+Infinityr�z	-Infinityz-Zeroz+ZerorKz
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�rdr:rrc)r0r1�infr)r)r+�number_classs,zDecimal.number_classcCstd�S�Nr�r�r�r)r)r+�radix0sz
Decimal.radixcCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}||d�|d|�}t|j
|�d�p�d|j�S�NTr�r&rQ�rr�r�rOrhr	rErUr�rr;rjr9r:rk)r0r�r1r>�torot�rotdig�topadZrotatedr)r)r+�rotate4s0

 
�zDecimal.rotatecCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�Sd|j|j}d|j|j}|t|�krz|ks�n|�t�S|�	�r�t
|�St|j|j
|jt|��}|�|�}|S)NTr�r&r�r])rr�r�rOrhr	rFrErUr�rr9r:r;r�)r0r�r1r>ZliminfZlimsupr�r)r)r+�scalebUs"



zDecimal.scalebcCs|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}|dkr�|d|�}n|d|}||jd�}t|j
|�d��p
d|j�Sr�r�)r0r�r1r>r�r�r�Zshiftedr)r)r+r�ns6

 
�z
Decimal.shiftcCs|jt|�ffSr()�	__class__rdr�r)r)r+�
__reduce__�szDecimal.__reduce__cCst|�tkr|S|�t|��Sr(��typerr�rdr�r)r)r+�__copy__�szDecimal.__copy__cCst|�tkr|S|�t|��Sr(r�)r0Zmemor)r)r+�__deepcopy__�szDecimal.__deepcopy__cCsJ|dkrt�}t||d�}|jrXt|j|�}t|���}|ddkrL|d7}t|||�S|ddkrvddg|j|d<|ddkr�t	|j|j
|jd�}|j}|d}|dk	�r|ddkr�|�
|d	|�}nF|dd
kr�|�||�}n*|ddk�rt|j
�|k�r|�
||�}|�s@|jdk�r@|dd
k�r@|�d|�}|jt|j
�}	|ddk�r~|�sx|dk	�rxd	|}
nd	}
nB|dd
k�r�|	}
n.|ddk�r�|jdk�r�|	d
k�r�|	}
nd	}
|
dk�r�d}d|
|j
}nP|
t|j
�k�r|j
d|
t|j
�}d}n"|j
d|
��p d}|j
|
d�}|	|
}
t|j|||
|�S)N)�_localeconvr��%�g�Gr]�	precision�eEr.zfF%ZgGr&r�rQrS)r�_parse_format_specifierrP�_format_signr:rdr��
_format_alignr�r9r;rOrDrDr�rj�_format_number)r0Z	specifierr1r��specrB�bodyrDr�r�r�rzr{rVr)r)r+�
__format__�sZ
 

zDecimal.__format__)rQN)NN)N)N)N)N)N)N)FN)N)N)N)TN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)N)N)NN)N)NN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)�r4r5r6�	__slots__rb�classmethodrur�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__radd__r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�r<r�rrrrrr
rr�dictr�rrrrrr2r;r<r?rrBr�rDrFr�to_integralrLr�r�rrr�rRrTrOrXr�r�rYrVr\r]rAr�r`r�rbr�rcrdrirnr4rqrrrtrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)r)r)r+rs

,
 !@

	
	
	
	
2
4
	



V
7;!$K



f	�>,UnY="c*"	IK23
.*!'FcCs&t�t�}||_||_||_||_|Sr()rarbrr:r;rOrP)rBZcoefficientrZspecialr0r)r)r+r9�s
r9c@s$eZdZdd�Zdd�Zdd�ZdS)rNcCs|��|_dSr()rL�new_context)r0r�r)r)r+�__init__sz_ContextManager.__init__cCst�|_t|j�|jSr()r�
saved_contextrr�r�r)r)r+�	__enter__s
z_ContextManager.__enter__cCst|j�dSr()rr�)r0�t�v�tbr)r)r+�__exit__sz_ContextManager.__exit__N)r4r5r6r�r�r�r)r)r)r+rNsrNc	@s�eZdZd�dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
e
Zd�dd�Zdd�Zdd�Zdd�ZdZd d!�Zd"d#�Zd$d%�Zd�d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"d?d@�Z#dAdB�Z$dCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5dedf�Z6dgdh�Z7didj�Z8dkdl�Z9dmdn�Z:dodp�Z;dqdr�Z<dsdt�Z=dudv�Z>dwdx�Z?dydz�Z@d{d|�ZAd}d~�ZBdd��ZCd�d��ZDd�d��ZEd�d��ZFd�d�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUeUZVdS)�rNc
s>zt}
Wntk
rYnX|dk	r*|n|
j|_|dk	r>|n|
j|_|dk	rR|n|
j|_|dk	rf|n|
j|_|dk	rz|n|
j|_|dk	r�|n|
j|_|	dkr�g|_n|	|_�dkr�|
j	�
�|_	n.t�t�s�t�fdd�t
�D��|_	n�|_	�dk�r
t�t
d�|_n0t�t��s4t�fdd�t
�D��|_n�|_dS)Nc3s|]}|t|�k�fVqdSr(�rU�rzr��r7r)r+�	<genexpr>Isz#Context.__init__.<locals>.<genexpr>r&c3s|]}|t|�k�fVqdSr(r�r��r8r)r+r�Ps)r�	NameErrorrErDr@rFr�r��_ignored_flagsr7rLrcr�r6�fromkeysr8)r0rErDr@rFr�r�r8r7r�Zdcr))r8r7r+r�0s.

zContext.__init__cCs�t|t�std|��|dkr<||kr�td||||f��nJ|dkrb||kr�td||||f��n$||ksr||kr�td||||f��t�|||�S)Nz%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)rcrUrvrpra�__setattr__)r0�namerxZvminZvmaxr)r)r+�_set_integer_checkTs
zContext._set_integer_checkcCs`t|t�std|��|D]}|tkrtd|��qtD]}||kr8td|��q8t�|||�S)Nz%s must be a signal dictz%s is not a valid signal dict)rcr�rvr6�KeyErrorrar�)r0r�r��keyr)r)r+�_set_signal_dictbs
zContext._set_signal_dictcCs�|dkr|�||dd�S|dkr0|�||dd�S|dkrH|�||dd�S|dkr`|�||dd�S|d	krx|�||dd�S|d
kr�|tkr�td|��t�|||�S|dks�|d
kr�|�||�S|dkr�t�|||�Std|��dS)NrEr.r�r@r�r&rFr�r�rDz%s: invalid rounding moder8r7r�z.'decimal.Context' object has no attribute '%s')r��_rounding_modesrvrar�r��AttributeError)r0r�rxr)r)r+r�ms*�zContext.__setattr__cCstd|��dS)Nz%s cannot be deleted)r�)r0r�r)r)r+�__delattr__�szContext.__delattr__c	CsNdd�|j��D�}dd�|j��D�}|j|j|j|j|j|j|j	||ffS)NcSsg|]\}}|r|�qSr)r)�rzZsigr�r)r)r+r|�sz&Context.__reduce__.<locals>.<listcomp>cSsg|]\}}|r|�qSr)r)r�r)r)r+r|�s)
r8�itemsr7r�rErDr@rFr�r�)r0r8r7r)r)r+r��s��zContext.__reduce__cCs|g}|�dt|��dd�|j��D�}|�dd�|�d�dd�|j��D�}|�dd�|�d�d�|�d	S)
NzrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dcSsg|]\}}|r|j�qSr)�r4)rzr�r�r)r)r+r|�sz$Context.__repr__.<locals>.<listcomp>zflags=[z, �]cSsg|]\}}|r|j�qSr)r�)rzr�r�r)r)r+r|�sztraps=[�))rq�varsr8r�rrr7)r0r��namesr)r)r+r��s�zContext.__repr__cCs|jD]}d|j|<qdSr�r��r0�flagr)r)r+rM�s
zContext.clear_flagscCs|jD]}d|j|<qdSr�r�r�r)r)r+�clear_traps�s
zContext.clear_trapsc
Cs.t|j|j|j|j|j|j|j|j|j	�	}|Sr()
rrErDr@rFr�r�r8r7r��r0Zncr)r)r+rG�s�zContext._shallow_copyc
Cs6t|j|j|j|j|j|j|j��|j	��|j
�	}|Sr()rrErDr@rFr�r�r8rLr7r�r�r)r)r+rL�s�zContext.copycGsZt�||�}||jkr(|�j|f|��Sd|j|<|j|sN|�j|f|��S||��dSra)�_condition_maprHr�r2r8r7)r0Z	conditionZexplanationr*�errorr)r)r+rh�s


zContext._raise_errorcCs
|jt�Sr()�
_ignore_flagsr6r�r)r)r+r��szContext._ignore_all_flagscGs|jt|�|_t|�Sr()r�rn)r0r8r)r)r+r��szContext._ignore_flagscGs8|rt|dttf�r|d}|D]}|j�|�q"dSr�)rcrornr��remove)r0r8r�r)r)r+�
_regard_flags�szContext._regard_flagscCst|j|jd�Sra)rUr@rEr�r)r)r+r��sz
Context.EtinycCst|j|jd�Sra)rUrFrEr�r)r)r+r��szContext.EtopcCs|j}||_|Sr()rD)r0r�rDr)r)r+rH�szContext._set_roundingrQcCsjt|t�r*||��ksd|kr*|�td�St||d�}|��r`t|j�|j	|j
kr`|�td�S|�|�S)NrRzAtrailing or leading whitespace and underscores are not permitted.rKzdiagnostic info too long in NaN)rcrdrfrhrrr�rjr;rEr�r�)r0rhr�r)r)r+�create_decimal�s��zContext.create_decimalcCst�|�}|�|�Sr()rrur�)r0r�r�r)r)r+�create_decimal_from_floats
z!Context.create_decimal_from_floatcCst|dd�}|j|d�SrS)r�r��r0r1r)r)r+rl!szContext.abscCs8t|dd�}|j||d�}|tkr0td|��n|SdS�NTr�rK�Unable to convert %s to Decimal)r�r�r�rv�r0r1r{r�r)r)r+�add6s
zContext.addcCst|�|��Sr()rdr�r�r)r)r+�_applyKszContext._applycCst|t�std��|��S)Nz,canonical requires a Decimal as an argument.)rcrrvrRr�r)r)r+rRNs	
zContext.canonicalcCst|dd�}|j||d�SrS)r�r��r0r1r{r)r)r+r�[s!zContext.comparecCst|dd�}|j||d�SrS)r�rTr�r)r)r+rTs zContext.compare_signalcCst|dd�}|�|�Sr�)r�rOr�r)r)r+rO�szContext.compare_totalcCst|dd�}|�|�Sr�)r�rXr�r)r)r+rX�szContext.compare_total_magcCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.copy_abscCst|dd�}t|�Sr�)r�rr�r)r)r+�copy_decimal�s
zContext.copy_decimalcCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.copy_negatecCst|dd�}|�|�Sr�)r�rYr�r)r)r+rY�szContext.copy_signcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�divides
zContext.dividecCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�
divide_int+s
zContext.divide_intcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+r�Bs
zContext.divmodcCst|dd�}|j|d�SrS)r�rVr�r)r)r+rVWszContext.expcCst|dd�}|j|||d�SrS)r�r)r0r1r{rJr)r)r+roszContext.fmacCst|t�std��|��S)Nz/is_canonical requires a Decimal as an argument.)rcrrvr\r�r)r)r+r\�s	
zContext.is_canonicalcCst|dd�}|��Sr�)r�r]r�r)r)r+r]�szContext.is_finitecCst|dd�}|��Sr�)r�rAr�r)r)r+rA�szContext.is_infinitecCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.is_nancCst|dd�}|j|d�SrS)r�r`r�r)r)r+r`�szContext.is_normalcCst|dd�}|��Sr�)r�r�r�r)r)r+r��szContext.is_qnancCst|dd�}|��Sr�)r�rbr�r)r)r+rb�szContext.is_signedcCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.is_snancCst|dd�}|j|d�SrS)r�rcr�r)r)r+rcszContext.is_subnormalcCst|dd�}|��Sr�)r�rdr�r)r)r+rd%szContext.is_zerocCst|dd�}|j|d�SrS)r�rnr�r)r)r+rn6sz
Context.lncCst|dd�}|j|d�SrS)r�rqr�r)r)r+rqLsz
Context.log10cCst|dd�}|j|d�SrS)r�rrr�r)r)r+rrhszContext.logbcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.logical_andcCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��szContext.logical_invertcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.logical_orcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.logical_xorcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.maxcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�szContext.max_magcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�szContext.mincCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�-szContext.min_magcCst|dd�}|j|d�SrS)r�r�r�r)r)r+�minus>sz
Context.minuscCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�multiplyOs
zContext.multiplycCst|dd�}|j|d�SrS)r�r�r�r)r)r+r�oszContext.next_minuscCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��szContext.next_pluscCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��s zContext.next_towardcCst|dd�}|j|d�SrS)r�r?r�r)r)r+r?�szContext.normalizecCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��s/zContext.number_classcCst|dd�}|j|d�SrS)r�r�r�r)r)r+�plusszContext.pluscCs:t|dd�}|j|||d�}|tkr2td|��n|SdSr�)r�r;r�rv)r0r1r{rr�r)r)r+�powers
Iz
Context.powercCst|dd�}|j||d�SrS)r�rr�r)r)r+res7zContext.quantizecCstd�Sr�r�r�r)r)r+r��sz
Context.radixcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+r��s
zContext.remaindercCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.remainder_nearcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.rotatecCst|dd�}|�|�Sr�)r�rBr�r)r)r+rBszContext.same_quantumcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�$szContext.scalebcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�7sz
Context.shiftcCst|dd�}|j|d�SrS)r�rLr�r)r)r+rLUszContext.sqrtcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�subtractus
zContext.subtractcCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��szContext.to_eng_stringcCst|dd�}|j|d�SrS)r�r�r�r)r)r+�
to_sci_string�szContext.to_sci_stringcCst|dd�}|j|d�SrS)r�rFr�r)r)r+rF�szContext.to_integral_exactcCst|dd�}|j|d�SrS)r�rr�r)r)r+r�szContext.to_integral_value)	NNNNNNNNN)N)rQ)N)Wr4r5r6r�r�r�r�r�r�r�rMr�rGrLr�rhr�r�r�r�r�r�rHr�r�rlr�r�rRr�rTrOrXr�r�r�rYr�r�r�rVrr\r]rAr�r`r�rbr�rcrdrnrqrrr�r�r�r�r�r�r�r�r�r�r�r�r�r?r�r�r�rr�r�r�r�rBr�r�rLr�r�r�rFrr�r)r)r)r+rs��
$



$#


%
 #2
P:&" c@s"eZdZdZddd�Zdd�ZdS)rm�rBrUrVNcCsf|dkrd|_d|_d|_nFt|t�rD|j|_t|j�|_|j|_n|d|_|d|_|d|_dS)Nr&r.r])rBrUrVrcrr:r;rO)r0rxr)r)r+r��s



z_WorkRep.__init__cCsd|j|j|jfS)Nz(%r, %r, %r)r�r�r)r)r+r�sz_WorkRep.__repr__)N)r4r5r6r�r�r�r)r)r)r+rm�s
rmcCs�|j|jkr|}|}n|}|}tt|j��}tt|j��}|jtd||d�}||jd|krpd|_||_|jd|j|j9_|j|_||fS)Nr�r]r.r�)rVrjrdrUr�)r�r�rEZtmpr�Ztmp_lenZ	other_lenrVr)r)r+r�sr�cCsb|dkrdS|dkr |d|Stt|��}t|�t|�d��}||krPdS|d|SdS)Nr&r�rQ)rdrlrj�rstrip)r8r�Zstr_nZval_nr)r)r+r'(sr'cCsB|dks|dkrtd��d}||kr>||||d?}}q|S)Nr&z3Both arguments to _sqrt_nearest should be positive.r.)rp)r8r1r{r)r)r+�
_sqrt_nearest=sr�cCs2d|>||?}}|d||d@|d@|kS)Nr.r]r))r*r�r{r�r)r)r+�_rshift_nearestLsr�cCs&t||�\}}|d||d@|kS)Nr]r.)r�)r1r{r�r�r)r)r+�_div_nearestTsr�r!c		Cs�||}d}||kr(t|�||>|ksD||krxt|�||?|krxt||d>|t||t||�|��}|d7}qtdtt|��d|�}t||�}t||�}t|ddd�D]}t||�t|||�}q�t|||�S)Nr&r.���r[r�)rlr�r�r�rUrjrdr)	r*�M�Lr-�R�TZyshift�wr�r)r)r+�_ilog\s"���


r�c
Cs�|d7}tt|��}||||dk}|dkr�d|}|||}|dkrZ|d|9}nt|d|�}t||�}t|�}t|||�}||}	nd}t|d|�}	t|	|d�S�Nr]r.r&r�r%)rjrdr�r��
_log10_digits)
rJr�r)rKr�r�r��log_dZlog_10Zlog_tenpowerr)r)r+rp�s 

rpc	Cs�|d7}tt|��}||||dk}|dkrr|||}|dkrR|d|9}nt|d|�}t|d|�}nd}|r�ttt|���d}||dkr�t|t||�d|�}q�d}nd}t||d�Sr�)rjrdr�r�rlr�)	rJr�r)rKr�r�r�r:Z	f_log_tenr)r)r+rl�s"rlc@seZdZdd�Zdd�ZdS)�
_Log10MemoizecCs
d|_dS)NZ/23025850929940456840179914546843642076011014886)r|r�r)r)r+r��sz_Log10Memoize.__init__cCs�|dkrtd��|t|j�kr�d}d||d}tttd||�d��}||d�d|krbql|d7}q"|�d�dd�|_t|jd|d	��S)
Nr&zp should be nonnegativer[r�r]r%rQr�r.)rprjr|rdr�r�r�rU)r0r)r:r�r|r)r)r+�	getdigits�s	
z_Log10Memoize.getdigitsN)r4r5r6r�r�r)r)r)r+r��sr�c	Cs�t||>|�}tdtt|��d|�}t||�}||>}t|ddd�D]}t|||||�}qPt|ddd�D]"}||d>}t||||�}q|||S)Nr�r[r.r&r�r])r&rUrjrdr�r)	r*r�r�r�r�r-ZMshiftrr�r)r)r+�_iexp�s
r�c	Cs�|d7}td|tt|��d�}||}||}|dkrH|d|}n|d|}t|t|��\}}t|d|�}tt|d|�d�||dfS)Nr]r&r.r�i�r[)r�rjrdr�r�r�r�)	rJr�r)r:r�r�ZcshiftZquotr0r)r)r+rZ$srZcCs�ttt|���|}t||||d�}||}|dkrJ||d|}nt||d|�}|dkr�tt|��|dk|dkkr�d|ddd|}	}
q�d|d|}	}
n,t||d|d�\}	}
t|	d�}	|
d7}
|	|
fS)Nr.r&r�)rjrdrlrlr�rZ)r+r,r.r/r)r{Zlxcr�Zpcr�rVr)r)r+r5Hs
r5r%�F�5�(�re�r�r})	r��2�3�4�5�6�7�8rCcCs0|dkrtd��t|�}dt|�||dS)Nr&z0The argument to _log10_lb should be nonnegative.r%)rprdrj)rJZ
correctionZstr_cr)r)r+r(rsr(cCsLt|t�r|St|t�r t|�S|r8t|t�r8t�|�S|rHtd|��tS)Nr�)rcrrUrtrurvr�)r�r�Zallow_floatr)r)r+r�}s


r�cCs�t|t�r||fSt|tj�rR|jsDt|jtt|j	�|j
�|j�}|t|j�fS|rrt|tj
�rr|jdkrr|j}t|t�r�t�}|r�d|jt<n|�td�|t�|�fSttfS)Nr&r.r`)rcr�_numbersZRationalrPr9r:rdrUr;�denominatorrO�	numeratorZComplexr�r�rtrr8rrhrur�)r0r�r�r1r)r)r+r��s(
�
�r�r$i?Bi���)rErDr7r8rFr@r�r�r^)rErDr7r8a�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
z0*$z50*$z�\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
cCs�t�|�}|dkrtd|��|��}|d}|d}|ddk	|d<|drv|dk	rbtd|��|dk	rvtd|��|p|d|d<|p�d|d<|d	dkr�d
|d	<t|dp�d�|d<|d
dk	r�t|d
�|d
<|d
dkr�|ddks�|ddkr�d|d
<|ddk�rfd|d<|dk�r&t��}|ddk	�r@td|��|d|d<|d|d<|d|d<n*|ddk�r|d|d<ddg|d<d|d<|S)NzInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>rBrT�minimumwidthrQr�r&r�ZgGnr.r8r��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointrSr[r�)�_parse_format_specifier_regex�matchrp�	groupdictrU�_locale�
localeconv)�format_specr�ryZformat_dictrrr)r)r+r�sT
��
�r�c	Cs�|d}|d}||t|�t|�}|d}|dkrF|||}nj|dkr\|||}nT|dkrr|||}n>|dkr�t|�d}|d|�||||d�}ntd	��|S)
Nrrr�<r�=�^r]zUnrecognised alignment field)rjrp)	rBr�r�rrZpaddingrr�Zhalfr)r)r+r�ms"r�cCspddlm}m}|sgS|ddkrJt|�dkrJ||dd�||d��S|dtjkrd|dd�Std��dS)Nr&)�chain�repeatr�r]r�z unrecognised format for grouping)�	itertoolsr!r"rjr�CHAR_MAXrp)rr!r"r)r)r+�_group_lengths�s
r%cCs�|d}|d}g}t|�D]�}|dkr0td��ttt|�|d�|�}|�d|t|�||d��|d|�}||8}|s�|dkr�q�|t|�8}qtt|�|d�}|�d|t|�||d��|�t|��S)Nrrr&zgroup length should be positiver.rQ)r%rpr�r�rjrqrr�reversed)r|r��	min_width�sepr�groupsrKr)r)r+�_insert_thousands_sep�s $$r*cCs$|rdS|ddkr|dSdSdS)NrTrBz +rSr))�is_negativer�r)r)r+r��s
r�cCs�t||�}|s|dr"|d|}|dks6|ddkr\ddddd�|d}|d	�||�7}|dd
krp|d
7}|dr�|dt|�t|�}nd}t|||�}t||||�S)
NZaltrr&r�r�r�r�)r�r�r�r�z{0}{1:+}r�rr)r��formatrjr*r�)r+rzr{rVr�rBZecharr'r)r)r+r��s
r�ZInfz-Infr�r�r])N)F)r&)r!)r!)FF)F)N)r.)y�__all__r4Z	__xname__�__version__Z__libmpdec_version__Zmathr~Znumbersr�sys�collectionsr'Z_namedtupler�ImportErrorrrrrrrrrr$r%�maxsizer r!r"r#�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrrvrr6r�r�ZcontextvarsZ
ContextVarrGrrrrarr9�Number�registerrNrrmr�rUr�r&r'r�r�r�r�rprlr�r�r�r�rZr5r(r�r�rrr�re�compile�VERBOSE�
IGNORECASErrer�r�DOTALLrZlocalerr�r�r%r*r�r�rkrjr=rVr3rUr@�	hash_info�modulusr�r�r�r�r�r�r�r)r)r)r+�<module>us��#

&
���

.
^

0",#
%$+�

*���
�
�
P
%
)poplib.cpython-38.opt-1.pyc000064400000032225151450073350011427 0ustar00U

e5d�:�@sldZddlZddlZddlZddlZzddlZdZWnek
rLdZYnXddgZGdd�de	�Z
dZd	Zd
Z
dZe
eZdZGd
d�d�Zer�Gdd�de�Ze�d�edk�rhddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]BZ e�!e �\Z"Z#Z$ede �e#D]Z%ede%��q@ed��qe�&�dS)z@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/poplib.pyrs�ni��
�
ic@seZdZdZdZeejfdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd=d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Ze�d0�Z d1d2�Z!d3d4�Z"d>d5d6�Z#d7d8�Z$d9d:�Z%d?d;d<�Z&dS)@raPThis class supports both the minimal and optional command sets.
    Arguments can be strings or integers (where appropriate)
    (e.g.: retr(1) and retr('1') both work equally well.

    Minimal Command Set:
            USER name               user(name)
            PASS string             pass_(string)
            STAT                    stat()
            LIST [msg]              list(msg = None)
            RETR msg                retr(msg)
            DELE msg                dele(msg)
            NOOP                    noop()
            RSET                    rset()
            QUIT                    quit()

    Optional Commands (some servers support these):
            RPOP name               rpop(name)
            APOP name digest        apop(name, digest)
            TOP msg n               top(msg, n)
            UIDL [msg]              uidl(msg = None)
            CAPA                    capa()
            STLS                    stls()
            UTF8                    utf8()

    Raises one exception: 'error_proto'.

    Instantiate with:
            POP3(hostname, port=110)

    NB:     the POP protocol locks the mailbox from user
            authorization until QUIT, so be sure to get in, suck
            the messages, and quit, each time you access the
            mailbox.

            POP is a line-based protocol, which means large mail
            messages consume lots of python cycles reading them
            line-by-line.

            If it's available on your mail server, use IMAP4
            instead, it doesn't suffer from the two problems
            above.
    zUTF-8cCsP||_||_d|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCst�|j|jf|�S�N)�socketZcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlineps
z
POP3._putlinecCs.|jrtdt|��t||j�}|�|�dS)Nz*cmd*)rrr �bytes�encodingr$r"rrr�_putcmdxszPOP3._putcmdcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sHtd��t|�}|dd�tkrp|dd�|fS|dd�t	kr�|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrrr r!�CR)rr#�octetsrrr�_getline�s
z
POP3._getlinecCs:|��\}}|jdkr$tdt|��|�d�s6t|��|S)Nrz*resp*�+)r/rrr �
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsl|��}g}d}|��\}}|dkrb|�d�rB|d}|dd�}||}|�|�|��\}}q|||fS)Nr�.s..r)rr/r1�append)rr2�listr.r#r3rrr�_getlongresp�s

zPOP3._getlongrespcCs|�|�|��Sr)r'rr"rrr�	_shortcmd�s
zPOP3._shortcmdcCs|�|�|��Sr)r'r7r"rrr�_longcmd�s
z
POP3._longcmdcCs|jSr)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|�d|�S)zVSend user name, return response

        (should indicate password required).
        zUSER %s�r8�r�userrrrr@�sz	POP3.usercCs|�d|�S)z�Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        zPASS %sr>)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jr&tdt|��t|d�}t|d�}||fS)z]Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        ZSTATz*stat*r�)r8�splitrrr �int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dk	r|�d|�S|�d�S)aRequest listing, return result.

        Result without a message number argument is in form
        ['response', ['mesg_num octets', ...], octets].

        Result when a message number argument is given is a
        single response: the "scan listing" for that message.
        NzLIST %sZLIST�r8r9�r�whichrrrr6�s	z	POP3.listcCs|�d|�S)zoRetrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        zRETR %s�r9rGrrr�retr�sz	POP3.retrcCs|�d|�S)zFDelete message number 'which'.

        Result is 'response'.
        zDELE %sr>rGrrr�dele�sz	POP3.delecCs
|�d�S)zXDoes nothing.

        One supposes the response indicates the server is alive.
        ZNOOPr>r:rrr�noopsz	POP3.noopcCs
|�d�S)z(Unmark all messages marked for deletion.ZRSETr>r:rrr�rsetsz	POP3.rsetcCs|�d�}|��|S)zDSignoff: commit changes on server, unlock mailbox, close connection.ZQUIT)r8�close)rr2rrr�quits
z	POP3.quitcCs�z |j	}d|_	|dk	r|��W5|j}d|_|dk	r�zVz|�tj�Wn@tk
r�}z"|jtjkrxt|dd�dkrx�W5d}~XYnXW5|��XXdS)z8Close the connection without assuming anything about it.NZwinerrorri&')
rrNZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattrr)rr�excrrrrrNs �z
POP3.closecCs|�d|�S)zNot sure what this does.zRPOP %sr>r?rrr�rpop5sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|s&td��ddl}|�d�|}|�|��	�}|�
d||f�S)aAuthorisation

        - only possible if server has supplied a timestamp in initial greeting.

        Args:
                user     - mailbox user;
                password - mailbox password.

        NB: mailbox is locked by server from here to 'quit()'
        z!-ERR APOP not supported by serverrNrz
APOP %s %s)r%r&�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr8)rr@ZpasswordZsecret�mrWZdigestrrr�apop<sz	POP3.apopcCs|�d||f�S)z�Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        z	TOP %s %srI)rrHZhowmuchrrr�topQszPOP3.topcCs |dk	r|�d|�S|�d�S)z�Return message digest (unique id) list.

        If 'which', result contains unique id for that message
        in the form 'response mesgnum uid', otherwise result is
        the list ['response', ['mesgnum uid', ...], octets]
        NzUIDL %sZUIDLrFrGrrr�uidlZsz	POP3.uidlcCs
|�d�S)zITry to enter UTF-8 mode (see RFC 6856). Returns server response.
        ZUTF8r>r:rrr�utf8fsz	POP3.utf8c	
Cspdd�}i}z4|�d�}|d}|D]}||�\}}|||<q$Wn*tk
rj}ztd��W5d}~XYnX|S)aReturn server capabilities (RFC 2449) as a dictionary
        >>> c=poplib.POP3('localhost')
        >>> c.capa()
        {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
         'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
         'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
         'UIDL': [], 'RESP-CODES': []}
        >>>

        Really, according to RFC 2449, the cyrus folks should avoid
        having the implementation split into multiple arguments...
        cSs"|�d���}|d|dd�fS)N�asciirr)�decoderC)r#Zlstrrr�	_parsecapyszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by serverN)r9r)	rr`�capsr2ZrawcapsZcaplineZcapnmZcapargsZ_errrrr�capals

z	POP3.capacCsxtstd��|jrtd��|��}d|kr2td��|dkrBt��}|�d�}|j|j|j	d�|_|j�
d�|_d|_|S)	z{Start a TLS session on the active connection as specified in RFC 2595.

                context - a ssl.SSLContext
        z-ERR TLS support missing�$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by serverN�Zserver_hostnamerT)�HAVE_SSLrrrb�ssl�_create_stdlib_contextr8�wrap_socketrr
rr)r�contextrar2rrr�stls�s 
�z	POP3.stls)N)N)N)'rrr�__doc__r&�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr$r'r/rr7r8r9r;r=r@rArEr6rJrKrLrMrOrNrT�re�compilerUrZr[r\r]rbrjrrrrr3sB+�





	
c@s8eZdZdZeddejdfdd�Zdd�Zd	dd�Z	dS)
�POP3_SSLaPOP3 client class over SSL connection

        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
                                   context=None)

               hostname - the hostname of the pop3 over ssl server
               port - port number
               keyfile - PEM formatted file that contains your private key
               certfile - PEM formatted certificate chain file
               context - a ssl.SSLContext

        See the methods of the parent class POP3 for more documentation.
        NcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrB)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrrrqrfrgrirr)rr
rrrrqrrirtrrrr�s$��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrd)rrrirhr
)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��dS)z�The method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            rcN)r)rrrrqrirrrrj�sz
POP3_SSL.stls)NNN)
rrrrk�
POP3_SSL_PORTrrmrrrjrrrrrp�s�
rp�__main__rrB�zMessage %d:z   z-----------------------)'rkrQrnrrrfre�ImportError�__all__�	Exceptionrrlrwr-ZLFr!r+rrpr5r�argv�arr;r@rAr6rEZnumMsgsZ	totalSize�range�irJ�header�msgr.r#rOrrrr�<module>sL
n0

codeop.cpython-38.opt-2.pyc000064400000004467151450073350011423 0ustar00U

e5d��@shddlZddlZdd�ejD�ZdddgZdZdd	�Zd
d�Zddd�ZGdd�d�Z	Gdd�d�Z
dS)�NcCsg|]}tt|��qS�)�getattr�
__future__)�.0Zfnamerr�/usr/lib64/python3.8/codeop.py�
<listcomp>>s�r�compile_command�Compile�CommandCompilericCsZ|�d�D] }|��}|r
|ddkr
q8q
|dkr8d}d}}}d}}	}
z||||�}Wn"tk
r�}zW5d}~XYnXt����t�d�z||d||�}	Wn&tk
r�}z|}W5d}~XYnXz||d||�}
Wn(tk
�r}z|}W5d}~XYnXW5QRXz.|�r,|W�"S|	�sHt|�t|�k�rH|�W5d}}XdS)N�
r�#�eval�pass�errorz

)�split�strip�SyntaxError�warnings�catch_warnings�simplefilter�repr)�compiler�source�filename�symbol�line�errZerr1Zerr2�code�code1�code2�errr�_maybe_compileEs8

 r!cCst|||t�S�N)�compile�PyCF_DONT_IMPLY_DEDENT�rrrrrr�_compilensr&�<input>�singlecCstt|||�Sr")r!r&r%rrrrqsc@seZdZdd�Zdd�ZdS)r	cCs
t|_dSr")r$�flags��selfrrr�__init__�szCompile.__init__cCs<t||||jd�}tD] }|j|j@r|j|jO_q|S)N�)r#r)�	_features�co_flagsZ
compiler_flag)r+rrrZcodeobZfeaturerrr�__call__�s
zCompile.__call__N��__name__�
__module__�__qualname__r,r0rrrrr	�sc@seZdZdd�Zddd�ZdS)	r
cCst�|_dSr")r	rr*rrrr,�szCommandCompiler.__init__r'r(cCst|j|||�Sr")r!r)r+rrrrrrr0�szCommandCompiler.__call__N)r'r(r1rrrrr
�s)r'r()rrZall_feature_namesr.�__all__r$r!r&rr	r
rrrr�<module>;s�
)
webbrowser.cpython-38.pyc000064400000041342151450073350011364 0ustar00U

e5d^�@s�dZddlZddlZddlZddlZddlZddlZddddddgZGd	d�de�Z	e�
�ZiZda
dad<d
d�dd�Zd=d
d�Zd>dd�Zdd�Zdd�Zd
d�dd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e�ZeZGd$d%�d%e�ZGd&d'�d'e�Z Gd(d)�d)e�Z!Gd*d+�d+e�Z"d,d-�Z#d.d/�Z$ej%dd0�d1k�r�Gd2d3�d3e�Z&ej%d4k�r�Gd5d6�d6e�Z'Gd7d8�d8e�Z(d9d:�Z)e*d;k�r�e)�dS)?z?Interfaces for launching and remotely controlling Web browsers.�N�Error�open�open_new�open_new_tab�get�registerc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�"/usr/lib64/python3.8/webbrowser.pyrsF��	preferredc	CsZt�Ltdkrt�||gt|��<|s4trB|tkrBt�d|�n
t�|�W5QRXdS)zRegister a browser connector.Nr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancerrrrrsc	Cs�tdkr&t�tdkrt�W5QRX|dk	r6|g}nt}|D]�}d|kr�t�|�}|ddkrtt|dd��St|�Sq>zt|��}Wnt	k
r�t
|�}YnX|ddk	r�|dS|ddk	r>|d�Sq>td��dS)zCReturn a browser launcher instance appropriate for the environment.N�%s����&�rz!could not locate runnable browser)rrr�shlex�split�BackgroundBrowser�GenericBrowserrr�KeyError�_synthesizer)ZusingZalternatives�browser�commandrrrr%s,
Tc	CsPtdkr&t�tdkrt�W5QRXtD] }t|�}|�|||�r*dSq*dS)aDisplay url using the default browser.

    If possible, open url in a location determined by new.
    - 0: the same browser window (the default).
    - 1: a new browser window.
    - 2: a new browser page ("tab").
    If possible, autoraise raises the window (the default) or not.
    NTF)rrrrr)�url�new�	autoraiserr$rrrrGs	cCs
t|d�S)zuOpen url in a new window of the default browser.

    If not possible, then open url in the only browser window.
    r�r�r&rrrrZscCs
t|d�S)z�Open url in a new page ("tab") of the default browser.

    If not possible, then the behavior becomes equivalent to open_new().
    �r)r*rrrrascCs�|��d}t�|�sddgStj�|�}zt|��}Wntk
rVddgYSX|d}|r�|��|jkr�ddl	}|�	|�}||_
tj�|�|_t|d||d�d|gSddgS)a�Attempt to synthesize a controller based on existing controllers.

    This is useful to create a controller when a user specifies a path to
    an entry in the BROWSER environment variable -- we can copy a general
    controller to operate using a specific installation of the desired
    browser in this way.

    If we can't create a controller in this way, or if there is no
    executable for the requested browser, return [None, None].

    rNr)rr)r�shutil�which�os�path�basenamerrr"�copyrr)r$r�cmdrr%Z
controllerr1rrrr#is"

r#c@s:eZdZdZdgZddd�Zddd	�Zd
d�Zdd
�ZdS)�BaseBrowserz3Parent class for all browsers. Do not use directly.r�cCs||_||_dS�N)rr0��selfrrrr�__init__�szBaseBrowser.__init__rTcCst�dSr5)�NotImplementedError�r7r&r'r(rrrr�szBaseBrowser.opencCs|�|d�S)Nrr)�r7r&rrrr�szBaseBrowser.open_newcCs|�|d�S)Nr+r)r;rrrr�szBaseBrowser.open_new_tabN)r4)rT)	rr	r
�__doc__�argsr8rrrrrrrr3�s

r3c@s"eZdZdZdd�Zd	dd�ZdS)
r!zVClass for all browsers started with a command
       and without remote functionality.cCsFt|t�r||_dg|_n|d|_|dd�|_tj�|j�|_dS)Nrrr)�
isinstance�strrr=r.r/r0r6rrrr8�s


zGenericBrowser.__init__rTcs|t�d��|jg�fdd�|jD�}z8tjdd�dkrHt�|�}ntj|dd�}|��WStk
rvYdSXdS)	N�webbrowser.opencsg|]}|�d���qS�r��replace��.0�argr*rr�
<listcomp>�s�z'GenericBrowser.open.<locals>.<listcomp>��winT)�	close_fdsF)	�sys�auditrr=�platform�
subprocess�Popen�wait�OSError�r7r&r'r(�cmdline�prr*rr�s�zGenericBrowser.openN)rT�rr	r
r<r8rrrrrr!�s
r!c@seZdZdZddd�ZdS)r zHClass for all browsers which are to be started in the
       background.rTcs�|jg�fdd�|jD�}t�d��z<tjdd�dkrHt�|�}ntj|ddd�}|��dkWStk
rzYdSXdS)	Ncsg|]}|�d���qSrArBrDr*rrrG�s�z*BackgroundBrowser.open.<locals>.<listcomp>r@rHrIT)rJ�start_new_sessionF)	rr=rKrLrMrNrO�pollrQrRrr*rr�s��zBackgroundBrowser.openN)rT�rr	r
r<rrrrrr �sr c@sDeZdZdZdZdZdZddgZdZdZ	dZ
ddd�Zd
d
d�ZdS)�UnixBrowserz=Parent class for all Unix browsers with remote functionality.NFT�%actionrcCs�g}|r*|jr*t|�}|j|}|r*|g}|jg||}|sD|jrLtj}nd}tj|d||jrd|pfd|dd�}	|r�z|	�d�}
|
WStj	k
r�YdSXn&|jr�|	�
�dkr�dSdSn
|	��SdS)NT�rJ�stdin�stdout�stderrrV�F)�
raise_opts�intr�
backgroundrN�DEVNULLrO�redirect_stdoutrPZTimeoutExpiredrW)r7r=Zremoter(r&Z	raise_opt�optrSZinoutrT�rcrrr�_invoke�s4



�

zUnixBrowser._invokercs�t�d��|dkr|j�nB|dkr,|j�n2|dkrN|jdkrF|j�q^|j�ntdd|����fdd�|jD�}d	d�|D�}|�|d
|��}|s��fdd�|jD�}|�|dd�Sd
SdS)
Nr@rrr+zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %scs g|]}|�d���d���qS)rrZrBrD��actionr&rrrGs�z$UnixBrowser.open.<locals>.<listcomp>cSsg|]}|r|�qSrrrDrrrrGsTcsg|]}|�d���qSrArBrDr*rrrGsF)	rKrL�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsrgr=)r7r&r'r(r=Zsuccessrrhrrs*
��zUnixBrowser.open)N)rT)
rr	r
r<r`rbrdrmrjrkrlrgrrrrrrY�s
#rYc@s(eZdZdZddgZdZdZdZdZdS)	�Mozillaz$Launcher class for Mozilla browsers.rZrr4z-new-windowz-new-tabTN�	rr	r
r<rmrjrkrlrbrrrrrnsrnc@s0eZdZdZddgZddgZdZdZdZd	Z	d
S)�Netscapez$Launcher class for Netscape browser.�-noraisez-raise�-remote�openURL(%s%action)r4�,new-window�,new-tabTN)
rr	r
r<r`rmrjrkrlrbrrrrrp&srpc@s,eZdZdZddgZddgZdZdZdZd	S)
�Galeonz,Launcher class for Galeon/Epiphany browsers.rqr4rZr�-nz-wTN)	rr	r
r<r`rmrjrkrbrrrrrv1srvc@s(eZdZdZddgZdZdZdZdZdS)�Chromez)Launcher class for Google Chrome browser.rZrr4�--new-windowTNrorrrrrx;srxc@s(eZdZdZddgZdZdZdZdZdS)�Operaz!Launcher class for Opera browser.rZrr4ryTNrorrrrrzGsrzc@s,eZdZdZddgZdZdZdZdZdZ	dS)	�Elinksz#Launcher class for Elinks browsers.rrrsr4rtruFN)
rr	r
r<rmrjrkrlrbrdrrrrr{Qsr{c@seZdZdZddd�ZdS)�	Konquerorz�Controller for the KDE File Manager (kfm, or Konqueror).

    See the output of ``kfmclient --commands``
    for more information on the Konqueror remote-control interface.
    rTcCs�t�d|�|dkrd}nd}tj}ztjd||gd|||d�}Wntk
rVYnX|��dSz tjdd	|gd|||dd
�}Wntk
r�YnX|��dkr�dSz tjdd|gd|||dd
�}Wntk
r�Yd
SX|��dkSdS)Nr@r+ZnewTabZopenURL�	kfmclientT)rJr\r]r^�	konquerorz--silentr[�kfmz-dF)rKrLrNrcrOrQrPrW)r7r&r'r(ri�devnullrTrrrrfsN�
�
�
zKonqueror.openN)rTrXrrrrr|_sr|c@s&eZdZdd�Zdd�Zd
dd�Zd	S)�GrailcCs�ddl}ddl}ddl}ddl}tj�|��d�}|�t�	��d}tj�|�
|�|�
|�d�}|�|�}|stdS|�|j|j�}	|D]T}
z|	�
|
�Wn8tk
r�zt�|
�Wntk
r�YnXYq�X|	Sq�dS)Nrz.grail-unixz-*)�glob�pwd�socket�tempfiler.r/�joinZ
gettempdir�getpwuid�getuid�escapeZAF_UNIXZSOCK_STREAMZconnectrQ�unlink)r7r�r�r�r�Ztempdir�user�filenameZmaybes�s�fnrrr�_find_grail_rc�s,�
zGrail._find_grail_rccCs&|��}|sdS|�|�|��dS)Nrr)r��send�close)r7rir�rrr�_remote�s
z
Grail._remoterTcCs2t�d|�|r |�d|�}n|�d|�}|S)Nr@zLOADNEW zLOAD )rKrLr�)r7r&r'r(�okrrrr�s
z
Grail.openN)rT)rr	r
r�r�rrrrrr��sr�cCs�t�d�rtddtd��dtjkr>t�d�r>tddtd��dtjkrbt�d�rbtddtd��dtjkr�t�d�r�tdttd��t�d�r�tddtd��dD]}t�|�r�t|dt|��q�d	D]}t�|�r�t|dt|��q�t�d
��rtd
ttd
��nt�d��r"tdttd��dD]"}t�|��r&t|dt	|���q&t�d
��rftd
dtd
��dD]"}t�|��rjt|dt
|���qjt�d��r�tddtd��t�d��r�tddtd��t�d��r�tdtd�dS)Nzxdg-openZGNOME_DESKTOP_SESSION_IDz	gvfs-openz
gnome-openZKDE_FULL_SESSIONr}z
x-www-browser)�firefoxZ	iceweaselZiceape�	seamonkey)zmozilla-firefoxzmozilla-firebird�firebird�mozilla�netscaperr~)ZgaleonZepiphanyZ	skipstone)z
google-chrome�chromeZchromiumzchromium-browser�operaZmosaicZgrail)
r,r-rr r.�environr|rnrprvrxrzr�)r$rrr�register_X_browsers�sD



r�cCs.gatjdkrNtddtd��tddtd��tddtd��tddtd��tjdd�dkr�td	t�tj�tj	�
d
d�d�}dd
dddd|fD]}t�|�r�t|dt
|��q��ntj	�
d�s�tj	�
d��r&z(d��}tj|tjd�}|����}Wn ttjttfk
�rYnX|at�tj	�
d��r�t�d��rPtddtd��t�d��rltddtd��t�d��r�tddtd��t�d��r�tddtd��t�d��r�tddtd��dtj	k�r*tj	d�tj�}|��|D]>}|dk�r�t|dd�}|d dk�r�t|dt|�dd��q�dS)!N�darwin�MacOSX�defaultr�r�ZsafarirHrIzwindows-defaultZPROGRAMFILESzC:\Program FileszInternet Explorer\IEXPLORE.EXEr�r�r�r�r�ZDISPLAYZWAYLAND_DISPLAYz$xdg-settings get default-web-browser)r^ZTERMzwww-browserZlinksZelinksZlynxZw3mZBROWSERr4Tr
r)rrKrMr�MacOSXOSAScript�WindowsDefaultr.r/r�r�rr,r-r rrNZcheck_outputrc�decode�strip�FileNotFoundErrorZCalledProcessError�PermissionError�NotADirectoryErrorrr�r!r{�pathsep�reverser#)Ziexplorer$r2Z
raw_result�resultZuserchoicesrSrrrrs\

��

rrHrIc@seZdZddd�ZdS)r�rTcCs:t�d|�zt�|�Wntk
r0YdSXdSdS)Nr@FT)rKrLr.Z	startfilerQr:rrrrXszWindowsDefault.openN)rT)rr	r
rrrrrr�Wsr�r�c@s"eZdZdZdd�Zd	dd�ZdS)
r�a{Launcher class for Aqua browsers on Mac OS X

        Optionally specify a browser name on instantiation.  Note that this
        will not work for Aqua browsers if the user has moved the application
        package after installation.

        If no browser is specified, the default browser, as specified in the
        Internet System Preferences panel, will be used.
        cCs
||_dSr5)rr6rrrr8sszMacOSX.__init__rTc	Cs�t�d|�d|kst�d|kr(d|}tt|��}|jdkrPd|�dd�}n<|jd	kr`d
}nd|d}d
|�dd�}d|j||f}t�dd�}|dkr�dS|�	|�|�
�}|S)Nr@�'�:zfile:r��open location "%s"�"�%22ZOmniWebr4ztoWindow %drzOpenURL "%s"z�tell application "%s"
                                activate
                                %s %s
                            end tell�	osascript�wF)rKrL�AssertionErrorra�boolrrCr.�popen�writer�)	r7r&r'r(�scriptZtoWindowr2�osapiperfrrrrvs(


�
zMacOSX.openN)rTrUrrrrr�is	r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr5)�_namer6rrrr8�szMacOSXOSAScript.__init__rTcCsb|jdkrd|�dd�}nd|j|�dd�f}t�dd�}|dkrJdS|�|�|��}|S)	Nr�r�r�r�z�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   r�r�F)r�rCr.r�r�r�)r7r&r'r(r�r�rfrrrr�s
�
zMacOSXOSAScript.openN)rT)rr	r
r8rrrrrr��sr�c	
Cs�ddl}dtjd}z|�tjdd�d�\}}WnJ|jk
r~}z*t|tjd�t|tjd�t�d�W5d}~XYnXd}|D]"\}}|dkr�d}q�|dkr�d}q�t|�dkr�t|tjd�t�d�|d}t||�td	�dS)
NrzDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabrZntd)�filerwz-tr+�)	�getoptrK�argv�error�printr^�exit�lenr)	r�ZusageZoptsr=�msgZnew_win�o�ar&rrr�main�s,�

r��__main__)N)N)rT)+r<r.rr,rKrNZ	threading�__all__�	Exceptionr�RLockrrrrrrrrrr#�objectr3r!r rYrnrprvrxZChromiumrzr{r|r�r�rrMr�r�r�r�rrrrr�<module>sR
"
"O

	
56AK/
zipimport.cpython-38.opt-1.pyc000064400000041425151450073350012201 0ustar00U

e5d-x�@sRdZddlZddlmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddgZej
Z
ejdd�ZGdd�de�ZiZee
�ZdZd	Zd
ZGdd�d�Ze
dd
d
fe
ddd
fddfZdd�Zdd�Zdd�Zdd�ZdZdadd�Z dd�Z!dd �Z"d!d"�Z#ee#j$�Z%d#d$�Z&d%d&�Z'd'd(�Z(d)d*�Z)d+d,�Z*d-d.�Z+Gd/d0�d0�Z,dS)1aPzipimport provides support for importing Python modules from Zip archives.

This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
  subclass of ImportError, so it can be caught as ImportError, too.
- _zip_directory_cache: a dict, mapping archive paths to zip directory
  info dicts, as used in zipimporter._files.

It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
�N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter�c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�!/usr/lib64/python3.8/zipimport.pyr!s�sPKi��c@sleZdZdZdd�Zddd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra�zipimporter(archivepath) -> zipimporter object

    Create a new zipimporter instance. 'archivepath' must be a path to
    a zipfile, or to a specific path inside a zipfile. For example, it can be
    '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
    valid directory inside the archive.

    'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
    archive.

    The 'archive' attribute of zipimporter objects contains the name of the
    zipfile targeted.
    c	Cs$t|t�sddl}|�|�}|s,td|d��tr<|�tt�}g}zt�	|�}WnHt
tfk
r�t�|�\}}||kr�td|d��|}|�
|�Yq@X|jd@dkr�td|d��q�q@zt|}Wn$tk
r�t|�}|t|<YnX||_||_tj|ddd��|_|j�r |jt7_dS)Nrzarchive path is empty��pathznot a Zip filei�i����)�
isinstance�str�os�fsdecoder�alt_path_sep�replace�path_sep�_bootstrap_external�
_path_stat�OSError�
ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive�
_path_join�prefix)�selfrrr$�st�dirname�basename�filesr
r
r�__init__?s:

zzipimporter.__init__NcCsNt||�}|dk	r|gfSt||�}t||�rFd|j�t�|��gfSdgfS)a�find_loader(fullname, path=None) -> self, str or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, a string containing the
        full path name if it's possibly a portion of a namespace package,
        or None otherwise. The optional 'path' argument is ignored -- it's
        there for compatibility with the importer protocol.
        N)�_get_module_info�_get_module_path�_is_dirr"r)r%�fullnamer�mi�modpathr
r
r�find_loaderms



zzipimporter.find_loadercCs|�||�dS)a�find_module(fullname, path=None) -> self or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, or None if it wasn't.
        The optional 'path' argument is ignored -- it's there for compatibility
        with the importer protocol.
        r)r1)r%r.rr
r
r�find_module�s	zzipimporter.find_modulecCst||�\}}}|S)z�get_code(fullname) -> code object.

        Return the code object for the specified module. Raise ZipImportError
        if the module couldn't be found.
        ��_get_module_code�r%r.�code�	ispackager0r
r
r�get_code�szzipimporter.get_codecCsvtr|�tt�}|}|�|jt�r:|t|jt�d�}z|j|}Wn tk
rhtdd|��YnXt	|j|�S)z�get_data(pathname) -> string with file data.

        Return the data associated with 'pathname'. Raise OSError if
        the file wasn't found.
        Nr�)
rrr�
startswithr"�lenr!rr�	_get_data)r%�pathname�key�	toc_entryr
r
r�get_data�szzipimporter.get_datacCst||�\}}}|S)zjget_filename(fullname) -> filename string.

        Return the filename for the specified module.
        r3r5r
r
r�get_filename�szzipimporter.get_filenamecCs�t||�}|dkr$td|��|d��t||�}|r@t�|d�}n
|�d�}z|j|}Wntk
rnYdSXt|j|��	�S)z�get_source(fullname) -> source string.

        Return the source code for the specified module. Raise ZipImportError
        if the module couldn't be found, return None if the archive does
        contain the module, but has no source for it.
        N�can't find module ��name�__init__.py�.py)
r+rr,rr#r!rr<r"�decode)r%r.r/r�fullpathr?r
r
r�
get_source�s


zzipimporter.get_sourcecCs(t||�}|dkr$td|��|d��|S)z�is_package(fullname) -> bool.

        Return True if the module specified by fullname is a package.
        Raise ZipImportError if the module couldn't be found.
        NrBrC)r+r)r%r.r/r
r
r�
is_package�s
zzipimporter.is_packagecCs�t||�\}}}tj�|�}|dks.t|t�s@t|�}|tj|<||_zT|rlt||�}t�	|j
|�}|g|_t|d�s|t
|_
t�|j||�t||j�Wntj|=�YnXztj|}Wn$tk
r�td|�d���YnXt�d||�|S)z�load_module(fullname) -> module.

        Load the module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the imported
        module, or raises ZipImportError if it wasn't found.
        N�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r4�sys�modules�getr�_module_type�
__loader__r,rr#r"�__path__�hasattrrK�_fix_up_module�__dict__�execr�ImportError�
_bootstrap�_verbose_message)r%r.r6r7r0�modrrHr
r
r�load_module�s0


zzipimporter.load_modulecCsXz|�|�sWdSWntk
r*YdSXtjsNddlm}|�t�dt_t||�S)z�Return the ResourceReader for a package in a zip file.

        If 'fullname' is a package within the zip file, return the
        'ResourceReader' object for the package.  Otherwise return None.
        Nr)�ResourceReaderT)rJr�_ZipImportResourceReader�_registered�
importlib.abcr[�register)r%r.r[r
r
r�get_resource_readers


zzipimporter.get_resource_readercCsd|j�t�|j�d�S)Nz<zipimporter object "z">)r"rr$)r%r
r
r�__repr__"szzipimporter.__repr__)N)N)rrr	�__doc__r*r1r2r8r@rArIrJrZr`rar
r
r
rr-s.
 


&z__init__.pycTrEF)z.pycTF)rFFFcCs|j|�d�dS)N�.�)r$�
rpartition)r%r.r
r
rr,4sr,cCs|t}||jkS�N)rr!)r%r�dirpathr
r
rr-8sr-cCs8t||�}tD]$\}}}||}||jkr|SqdSrf)r,�_zip_searchorderr!)r%r.r�suffix�
isbytecoder7rHr
r
rr+As


r+c	Cs�zt�|�}Wn&tk
r4td|��|d��YnX|���z$|�td�|��}|�t�}Wn&tk
r�td|��|d��YnXt|�tkr�td|��|d��|dd�t	k�r�z|�dd�|��}Wn&tk
r�td|��|d��YnXt
|ttd�}z|�|�|��}Wn(tk
�rJtd|��|d��YnX|�t	�}|dk�rrtd|��|d��|||t�}t|�tk�r�td|��|d��|t|�|}t
|d	d
��}t
|d
d��}	||k�r�td|��|d��||	k�r
td
|��|d��||8}||	}
|
dk�r6td|��|d��i}d}z|�|�Wn(tk
�rttd|��|d��YnX|�d�}t|�dk�r�td��|dd�dk�r��q�t|�dk�r�td��t|dd��}
t|dd	��}t|d	d��}t|dd
��}t
|d
d��}t
|dd��}t
|dd��}t|dd��}t|dd��}t|dd��}t
|dd��}|||}||	k�r�td|��|d��||
7}z|�|�}Wn(tk
�r�td|��|d��YnXt|�|k�r�td|��|d��z2t|�||��||k�r*td|��|d��Wn(tk
�rTtd|��|d��YnX|
d@�rj|��}n6z|�d�}Wn&tk
�r�|�d��t�}YnX|�dt�}t�||�}||||||||f}|||<|d 7}�qvW5QRXt�d!||�|S)"Nzcan't open Zip file: r
rd�can't read Zip file: �rznot a Zip file: zcorrupt Zip file: ���zbad central directory size: zbad central directory offset: z&bad central directory size or offset: �.�EOF read where not expectedsPK��
����� �"�*zbad local header offset: i�ascii�latin1�/rz!zipimport: found {} names in {!r})�_io�	open_coderr�seek�END_CENTRAL_DIR_SIZE�tell�readr;�STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr�EOFErrorrrG�UnicodeDecodeError�	translate�cp437_tablerrrr#rWrX)r"�fp�header_position�buffer�	file_size�max_comment_start�data�pos�header_size�
header_offset�
arc_offsetr)�count�flags�compress�time�date�crc�	data_size�	name_size�
extra_size�comment_size�file_offsetrDr�tr
r
rr `s�
���

�


�
�






r u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsltrt�d�td��daz<zddlm}Wn&tk
rRt�d�td��YnXW5daXt�d�|S)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTFr��
decompresszzipimport: zlib available)�_importing_zlibrWrXr�zlibr��	Exceptionr�r
r
r�_get_decompress_func�s


r�c	Cs�|\}}}}}}}}	|dkr$td��t�|���}
z|
�|�Wn&tk
rftd|��|d��YnX|
�d�}t|�dkr�td��|dd�dkr�td	|��|d��t|d
d��}t|dd��}
d||
}||7}z|
�|�Wn(tk
�rtd|��|d��YnX|
�|�}t|�|k�r4td��W5QRX|dk�rL|Sz
t	�}Wnt
k
�rttd
��YnX||d�S)Nrznegative data sizerkr
rwrqrlsPKzbad local file header: �rvzzipimport: can't read datar�i�)rr~rr�rr�r;r�rr�r�)r"r?�datapathr�r�r�r�r�r�r�r�r�r�r�r��raw_datar�r
r
rr<s>



r<cCst||�dkS)Nr)�abs)�t1�t2r
r
r�	_eq_mtimeAsr�cCs<||d�}zt�|||�}Wntk
r2YdSX|d@dk}|r�|d@dk}tjdkr�|shtjdkr�t||�}	|	dk	r�t�tj|	�}
zt�||
||�Wntk
r�YdSXnTt	||�\}}|�r
t
t|dd��|�r�t|dd	��|k�r
t�
d
|���dSt�|d	d��}
t|
t��s8td|�d���|
S)
N)rDrrrrd�never�alwaysrrrmrnzbytecode is stale for zcompiled module z is not a code object)r�
_classify_pycrV�_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer�rrWrX�marshal�loadsr�
_code_type�	TypeError)r%r=rHr.r��exc_detailsr��
hash_based�check_source�source_bytesr��source_mtime�source_sizer6r
r
r�_unmarshal_codeKsX�
��
��
���r�cCs|�dd�}|�dd�}|S)Ns
�
�
)r)�sourcer
r
r�_normalize_line_endings~sr�cCst|�}t||ddd�S)NrUT)�dont_inherit)r��compile)r=r�r
r
r�_compile_source�sr�cCsDt�|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	�S)
N�	i������?rdr)r��mktime)�dr�r
r
r�_parse_dostime�s



�r�c
Cs`z>|dd�}|j|}|d}|d}|d}t||�|fWStttfk
rZYdSXdS)Nrr���)rr)r!r�r�
IndexErrorr�)r%rr?r�r��uncompressed_sizer
r
rr��s
r�cCsB|dd�}z|j|}Wntk
r0YdSXt|j|�SdS)Nr)r!rr<r")r%rr?r
r
rr��sr�c	Cs�t||�}tD]�\}}}||}tjd|jt|dd�z|j|}Wntk
rXYqX|d}t|j|�}	|r�t	|||||	�}
n
t
||	�}
|
dkr�q|d}|
||fSqtd|��|d��dS)Nz
trying {}{}{}rd)�	verbosityrrBrC)r,rhrWrXr"rr!rr<r�r�r)r%r.rrirjr7rHr?r0r�r6r
r
rr4�s$

r4c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r\z�Private class used to support ZipImport.get_resource_reader().

    This class is allowed to reference all the innards and private parts of
    the zipimporter.
    FcCs||_||_dSrf)rr.)r%rr.r
r
rr*�sz!_ZipImportResourceReader.__init__cCs\|j�dd�}|�d|��}ddlm}z||j�|��WStk
rVt|��YnXdS)Nrcr}r)�BytesIO)r.r�ior�rr@r�FileNotFoundError)r%�resource�fullname_as_pathrr�r
r
r�
open_resource�sz&_ZipImportResourceReader.open_resourcecCst�dSrf)r�)r%r�r
r
r�
resource_path�sz&_ZipImportResourceReader.resource_pathcCsH|j�dd�}|�d|��}z|j�|�Wntk
rBYdSXdS)Nrcr}FT)r.rrr@r)r%rDr�rr
r
r�is_resource�sz$_ZipImportResourceReader.is_resourcec		cs�ddlm}||j�|j��}|�|jj�}|j}t�}|jj	D]f}z||��|�}Wnt
k
rnYq@YnX|jj}t|�dkr�|jVq@||kr@|�
|�|Vq@dS)Nr)�Path)�pathlibr�rrAr.�relative_tor"�parent�setr!rrDr;�add)	r%r��
fullname_path�
relative_path�package_path�subdirs_seen�filename�relative�parent_namer
r
r�contents�s 


z!_ZipImportResourceReader.contentsN)
rrr	rbr]r*r�r�r�r�r
r
r
rr\�s	r\)-rb�_frozen_importlib_externalrrr�_frozen_importlibrWr�r~r�rLr��__all__r�path_separatorsrrVrr�typerOr�r�r�rrhr,r-r+r r�r�r�r<r�r��__code__r�r�r�r�r�r�r4r\r
r
r
r�<module>sX�		~�.
.

wave.cpython-38.opt-1.pyc000064400000043265151450073350011112 0ustar00U

e5d6G�@s�dZddlZdddddgZGdd�de�Zd	Zd
ZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZe
d
d�ZGdd�d�ZGdd�d�Zddd�Zddd�ZdS)a%
Stuff to parse WAVE files.

Usage.

Reading WAVE files:
      f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
      getnchannels()  -- returns number of audio channels (1 for
                         mono, 2 for stereo)
      getsampwidth()  -- returns sample width in bytes
      getframerate()  -- returns sampling frequency
      getnframes()    -- returns number of audio frames
      getcomptype()   -- returns compression type ('NONE' for linear samples)
      getcompname()   -- returns human-readable version of
                         compression type ('not compressed' linear samples)
      getparams()     -- returns a namedtuple consisting of all of the
                         above in the above order
      getmarkers()    -- returns None (for compatibility with the
                         aifc module)
      getmark(id)     -- raises an error since the mark does not
                         exist (for compatibility with the aifc module)
      readframes(n)   -- returns at most n frames of audio
      rewind()        -- rewind to the beginning of the audio stream
      setpos(pos)     -- seek to the specified position
      tell()          -- return the current position
      close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing WAVE files:
      f = wave.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
      setnchannels(n) -- set the number of channels
      setsampwidth(n) -- set the sample width
      setframerate(n) -- set the frame rate
      setnframes(n)   -- set the number of frames
      setcomptype(type, name)
                      -- set the compression type and the
                         human-readable compression type
      setparams(tuple)
                      -- set all parameters at once
      tell()          -- return current position in output file
      writeframesraw(data)
                      -- write audio frames without patching up the
                         file header
      writeframes(data)
                      -- write audio frames and patch up the file header
      close()         -- patch up the file header and close the
                         output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�N�open�openfp�Error�	Wave_read�
Wave_writec@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/wave.pyrNs�)N�b�hN�i)�Chunk)�
namedtuple�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,S)-raPVariables used in this class:

    These variables are available to the user though appropriate
    methods of this class:
    _file -- the open file with methods read(), close(), and seek()
              set through the __init__() method
    _nchannels -- the number of audio channels
              available through the getnchannels() method
    _nframes -- the number of audio frames
              available through the getnframes() method
    _sampwidth -- the number of bytes per audio sample
              available through the getsampwidth() method
    _framerate -- the sampling frequency
              available through the getframerate() method
    _comptype -- the AIFF-C compression type ('NONE' if AIFF)
              available through the getcomptype() method
    _compname -- the human-readable AIFF-C compression type
              available through the getcomptype() method
    _soundpos -- the position in the audio stream
              available through the tell() method, set through the
              setpos() method

    These variables are used internally only:
    _fmt_chunk_read -- 1 iff the FMT chunk has been read
    _data_seek_needed -- 1 iff positioned correctly in audio
              file for readframes()
    _data_chunk -- instantiation of a chunk class for the DATA chunk
    _framesize -- size of one frame in the file
    cCs�d|_d|_t|dd�|_|j��dkr0td��|j�d�dkrHtd��d|_d|_d|_	zt|jdd�}Wnt
k
r�Yq�YnX|��}|d	kr�|�|�d|_n2|d
kr�|js�td��||_|j|j
|_d|_	q�|��qT|jr�|js�td��dS)
Nr)Z	bigendian�RIFFz file does not start with RIFF id��WAVEznot a WAVE filer�fmt �datazdata chunk before fmt chunkz#fmt chunk and/or data chunk missing)�_convert�	_soundposr�_fileZgetnamer�readZ_fmt_chunk_read�_data_chunk�_data_seek_needed�EOFError�_read_fmt_chunkZ	chunksize�
_framesize�_nframes�skip)�self�file�chunkZ	chunknamer
r
r�initfp~s8


zWave_read.initfpcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�rb��_i_opened_the_file�
isinstance�str�builtinsrr&�close�r#�fr
r
r�__init__�s
zWave_read.__init__cCs|��dS�N�r-�r#r
r
r�__del__�szWave_read.__del__cCs|Sr1r
r3r
r
r�	__enter__�szWave_read.__enter__cGs|��dSr1r2�r#�argsr
r
r�__exit__�szWave_read.__exit__cCs|jSr1)rr3r
r
r�getfp�szWave_read.getfpcCsd|_d|_dS)Nrr)rrr3r
r
r�rewind�szWave_read.rewindcCs"d|_|j}|rd|_|��dSr1)rr)r-�r#r$r
r
rr-�s
zWave_read.closecCs|jSr1)rr3r
r
r�tell�szWave_read.tellcCs|jSr1)�
_nchannelsr3r
r
r�getnchannels�szWave_read.getnchannelscCs|jSr1)r!r3r
r
r�
getnframes�szWave_read.getnframescCs|jSr1)�
_sampwidthr3r
r
r�getsampwidth�szWave_read.getsampwidthcCs|jSr1)�
_framerater3r
r
r�getframerate�szWave_read.getframeratecCs|jSr1��	_comptyper3r
r
r�getcomptype�szWave_read.getcomptypecCs|jSr1��	_compnamer3r
r
r�getcompname�szWave_read.getcompnamecCs*t|��|��|��|��|��|���Sr1)rr>rArCr?rFrIr3r
r
r�	getparams�s�zWave_read.getparamscCsdSr1r
r3r
r
r�
getmarkers�szWave_read.getmarkerscCstd��dS�Nzno marks�r�r#�idr
r
r�getmark�szWave_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)r!rrr)r#�posr
r
r�setpos�szWave_read.setposcCs�|jr8|j�dd�|j|j}|r2|j�|d�d|_|dkrDdS|j�||j�}|jdkrxtjdkrxt	�
||j�}|jr�|r�|�|�}|jt|�|j
|j|_|S)Nr�r�big)rr�seekrr rr@�sys�	byteorder�audioop�byteswapr�lenr=)r#�nframesrQ�datar
r
r�
readframes�s

zWave_read.readframescCs�z$t�d|�d��\}|_|_}}Wntjk
r@td�YnX|tkr�zt�d|�d��d}Wntjk
r�td�YnX|dd|_|js�t	d��nt	d	|f��|js�t	d
��|j|j|_
d|_d|_dS)
Nz<HHLLH�z<H�r���bad sample widthzunknown format: %r�bad # of channels�NONEznot compressed)
�structZunpack_fromrr=rB�errorr�WAVE_FORMAT_PCMr@rr rErH)r#r%Z
wFormatTagZdwAvgBytesPerSecZwBlockAlign�	sampwidthr
r
rr�s$$
zWave_read._read_fmt_chunkN)rrr	�__doc__r&r0r4r5r8r9r:r-r<r>r?rArCrFrIrJrKrPrRr]rr
r
r
rr_s,
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:S);ra�Variables used in this class:

    These variables are user settable through appropriate methods
    of this class:
    _file -- the open file with methods write(), close(), tell(), seek()
              set through the __init__() method
    _comptype -- the AIFF-C compression type ('NONE' in AIFF)
              set through the setcomptype() or setparams() method
    _compname -- the human-readable AIFF-C compression type
              set through the setcomptype() or setparams() method
    _nchannels -- the number of audio channels
              set through the setnchannels() or setparams() method
    _sampwidth -- the number of bytes per audio sample
              set through the setsampwidth() or setparams() method
    _framerate -- the sampling frequency
              set through the setframerate() or setparams() method
    _nframes -- the number of audio frames written to the header
              set through the setnframes() or setparams() method

    These variables are used internally only:
    _datalength -- the size of the audio samples written to the header
    _nframeswritten -- the number of frames actually written
    _datawritten -- the size of the audio samples actually written
    cCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�wbr(r.r
r
rr0.s
zWave_write.__init__cCs@||_d|_d|_d|_d|_d|_d|_d|_d|_d|_	dS)NrF)
rrr=r@rBr!�_nframeswritten�_datawritten�_datalength�_headerwrittenr;r
r
rr&:szWave_write.initfpcCs|��dSr1r2r3r
r
rr4FszWave_write.__del__cCs|Sr1r
r3r
r
rr5IszWave_write.__enter__cGs|��dSr1r2r6r
r
rr8LszWave_write.__exit__cCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to writerrc)rlrr=)r#�	nchannelsr
r
r�setnchannelsRs
zWave_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)r=rr3r
r
rr>YszWave_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nrorrrb)rlrr@)r#rhr
r
r�setsampwidth^s
zWave_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)r@rr3r
r
rrAeszWave_write.getsampwidthcCs0|jrtd��|dkrtd��tt|��|_dS)Nrorzbad frame rate)rlr�int�roundrB)r#�	framerater
r
r�setframeratejs
zWave_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rBrr3r
r
rrCqszWave_write.getframeratecCs|jrtd��||_dS�Nro)rlrr!)r#r[r
r
r�
setnframesvszWave_write.setnframescCs|jSr1�rkr3r
r
rr?{szWave_write.getnframescCs.|jrtd��|dkrtd��||_||_dS)Nro)rdzunsupported compression type)rlrrErH)r#�comptype�compnamer
r
r�setcomptype~szWave_write.setcomptypecCs|jSr1rDr3r
r
rrF�szWave_write.getcomptypecCs|jSr1rGr3r
r
rrI�szWave_write.getcompnamecCsV|\}}}}}}|jrtd��|�|�|�|�|�|�|�|�|�||�dSrw)rlrrqrrrvrxr|)r#Zparamsrprhrur[rzr{r
r
r�	setparams�s



zWave_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)r=r@rBrrr!rErHr3r
r
rrJ�s�zWave_write.getparamscCstd��dS)Nzsetmark() not supportedrM)r#rOrQ�namer
r
r�setmark�szWave_write.setmarkcCstd��dSrLrMrNr
r
rrP�szWave_write.getmarkcCsdSr1r
r3r
r
rrK�szWave_write.getmarkerscCs|jSr1ryr3r
r
rr<�szWave_write.tellcCs�t|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|jdkrpt
jdkrpt�
||j�}|j�|�|jt|�7_|j||_dS)N�BrrT)r*�bytes�	bytearray�
memoryview�cast�_ensure_header_writtenrZr@r=rrVrWrXrYr�writerlrk)r#r\r[r
r
r�writeframesraw�s
zWave_write.writeframesrawcCs"|�|�|j|jkr|��dSr1)r�rmrl�_patchheader)r#r\r
r
r�writeframes�s
zWave_write.writeframescCsXz2|jr0|�d�|j|jkr&|��|j��W5d|_|j}|rRd|_|��XdS)Nr)rr)r-r�rmrlr��flushr;r
r
rr-�s
zWave_write.closecCs>|js:|jstd��|js"td��|js0td��|�|�dS)Nz# channels not specifiedzsample width not specifiedzsampling rate not specified)rnr=rr@rB�
_write_header)r#Zdatasizer
r
rr��sz!Wave_write._ensure_header_writtencCs�|j�d�|js$||j|j|_|j|j|j|_z|j��|_Wntt	fk
rfd|_YnX|j�t
�dd|jdddt|j|j
|j|j
|j|j|j|jdd��|jdk	r�|j��|_|j�t
�d	|j��d
|_dS)Nrz<L4s4sLHHLLHH4s�$rr�rar�<LT)rr�r!r=r@rmr<�_form_length_pos�AttributeError�OSErrorre�packrgrB�_data_length_posrn)r#Z
initlengthr
r
rr��s2
�
zWave_write._write_headercCs�|j|jkrdS|j��}|j�|jd�|j�t�dd|j��|j�|j	d�|j�t�d|j��|j�|d�|j|_dS)Nrr�r�)
rlrmrr<rUr�r�rer�r�)r#Zcurposr
r
rr��s
zWave_write._patchheaderN) rrr	rir0r&r4r5r8rqr>rrrArvrCrxr?r|rFrIr}rJrrPrKr<r�r�r-r�r�r�r
r
r
rrs:


cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder')�rr')�wrjz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�rrr�r/r�r
r
rr�s
cCstjdtdd�t||d�S)NzBwave.openfp is deprecated since Python 3.7. Use wave.open instead.r_)�
stacklevel)r�)�warnings�warn�DeprecationWarningrr�r
r
rrs
�)N)N)rir,�__all__�	ExceptionrrgZ_array_fmtsrXrerVr%r�collectionsrr�rrrrrr
r
r
r�<module>s(I�6d

fnmatch.cpython-38.opt-2.pyc000064400000004145151450073350011563 0ustar00U

e5d��@sfddlZddlZddlZddlZddddgZdd�Zejddd	�d
d��Zdd�Zd
d�Z	dd�Z
dS)�N�filter�fnmatch�fnmatchcase�	translatecCs"tj�|�}tj�|�}t||�S�N)�os�path�normcaser)�name�pat�r�/usr/lib64/python3.8/fnmatch.pyrs�T)�maxsize�typedcCs<t|t�r(t|d�}t|�}t|d�}nt|�}t�|�jS)Nz
ISO-8859-1)�
isinstance�bytes�strr�re�compile�match)rZpat_strZres_str�resrrr
�_compile_pattern&s

rcCshg}tj�|�}t|�}tjtkr@|D]}||�r&|�|�q&n$|D]}|tj�|��rD|�|�qD|Sr)rrr	r�	posixpath�append)�namesr�resultrr
rrr
r0s
cCst|�}||�dk	Sr)r)r
rrrrr
r@sc	Cs�dt|�}}d}||k�r�||}|d}|dkr>|d}q|dkrP|d}q|dk�r�|}||krz||d	krz|d}||kr�||d
kr�|d}||kr�||d
kr�|d}q�||kr�|d}�q�|||�}d|kr�|�d
d�}n�g}||d	k�r|dn|d}|�d||�}|dk�r(�qN|�|||��|d}|d}�q|�|||��d�dd�|D��}t�dd|�}|d}|dd	k�r�d|dd�}n|ddk�r�d
|}d||f}q|t�|�}qd|S)Nr���*z.*�?�.�[�!�]z\[z--�\�\\��-�css"|]}|�dd��dd�VqdS)r%r&r(z\-N)�replace)�.0�srrr
�	<genexpr>ts�ztranslate.<locals>.<genexpr>z([&~|])z\\\1�^)r.r"z%s[%s]z	(?s:%s)\Z)�lenr*�findr�joinr�sub�escape)	r�i�nr�c�jZstuffZchunks�krrr
rJsV






�)rrr�	functools�__all__r�	lru_cacherrrrrrrr
�<module>s
	
pty.cpython-38.pyc000064400000007565151450073350010030 0ustar00U

e5d��@s�dZddlmZddlZddlZddlZdddgZdZdZdZdZ	d	d�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zeefdd�Zeefdd�ZdS)zPseudo terminal utilities.�)�selectN�openpty�fork�spawn��c	Cs>z
t��WSttfk
r"YnXt�\}}t|�}||fS)zdopenpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible.)�osr�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fd�r�/usr/lib64/python3.8/pty.pyrs

c	CsLzt��\}}Wnttfk
r(YnXt�|�}t�|�||fSt�S)z�master_open() -> (master_fd, slave_name)
    Open a pty master and return the fd, and the filename of the slave end.
    Deprecated, use openpty() instead.)rrr	r
�ttyname�closer)r
rrrrr�master_open"s

rc
CsndD]\}dD]R}d||}zt�|tj�}Wntk
rFYqYnX|d||fSqtd��dS)z1Open pty master and return (master_fd, tty_name).ZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devicesN)r�open�O_RDWRr
)�x�yZpty_name�fdrrrr2s
rcCsrt�|tj�}zddlm}m}Wntk
r:|YSXz|||d�|||d�Wntk
rlYnX|S)z�slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead.r)�ioctl�I_PUSHZptemZldterm)rrrZfcntlrr�ImportErrorr
)Ztty_name�resultrrrrrr>s
rc	Cs�zt��\}}Wnttfk
r(Yn4X|tkrTzt��Wntk
rRYnX||fSt�\}}t��}|tkr�t��t�|�t�	|t
�t�	|t�t�	|t�|tkr�t�|�t�
t�t�tj�}t�|�n
t�|�||fS)zdfork() -> (pid, master_fd)
    Fork and make the child a session leader with a controlling terminal.)r�forkptyr	r
�CHILD�setsidrrr�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidrr
rZtmp_fdrrrrPs0



cCs"|rt�||�}||d�}qdS)z#Write all the data to a descriptor.N)r�write)r�data�nrrr�_writenxsr)cCst�|d�S)zDefault read function.i)r�read)rrrr�_read~sr+cCsv|tg}t|gg�\}}}||krF||�}|s:|�|�nt�t|�t|kr|t�}|sf|�t�qt||�qdS)z�Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)N)r"r�removerr&r#r))r
�master_read�
stdin_readZfdsZrfdsZwfdsZxfdsr'rrr�_copy�sr/cCs�t|�td�kr|f}t�d|�t�\}}|tkrHtj|df|��zt�t	�}t�
t	�d}Wntjk
r~d}YnXzt|||�Wn(t
k
r�|r�t�t	tj|�YnXt�|�t�|d�dS)zCreate a spawned process.�z	pty.spawnrr)�type�sys�auditrrr�execlp�ttyZ	tcgetattrr"Zsetraw�errorr/r
Z	tcsetattrZ	TCSAFLUSHr�waitpid)�argvr-r.r%r
�modeZrestorerrrr�s&




)�__doc__rrr2r5�__all__r"r#r$rrrrrrr)r+r/rrrrr�<module>s$
(_strptime.cpython-38.opt-2.pyc000064400000030036151450073350012147 0ustar00U

e5d�b�@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
ZmZ
mZddlmZgZdd�ZGd	d
�d
e�ZGdd�de�Ze�Ze�ad
Ziadd�Zdd�Zddd�Zddd�Z ddd�Z!dS)�N)�compile)�
IGNORECASE)�escape)�date�	timedelta�timezone)�
allocate_lockcCst�tj�S�N)�localeZ	getlocale�LC_TIME�rr�!/usr/lib64/python3.8/_strptime.py�_getlangsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�
LocaleTimecCsht�|_|��|��|��|��|��t�|jkrDtd��tj	|j	ks\tj
|j
krdtd��dS)Nz$locale changed during initializationz&timezone changed during initialization)r�lang�_LocaleTime__calc_weekday�_LocaleTime__calc_month�_LocaleTime__calc_am_pm�_LocaleTime__calc_timezone�_LocaleTime__calc_date_time�
ValueError�time�tzname�daylight)�selfrrr
�__init__1szLocaleTime.__init__cCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)�calendarZday_abbr�lower��.0�irrr
�
<listcomp>Ssz-LocaleTime.__calc_weekday.<locals>.<listcomp>�cSsg|]}tj|���qSr)rZday_namerrrrr
r!Ts)�range�	a_weekday�	f_weekday)rr$r%rrr
Z__calc_weekdayPszLocaleTime.__calc_weekdaycCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)rZ
month_abbrrrrrr
r!Zsz+LocaleTime.__calc_month.<locals>.<listcomp>�
cSsg|]}tj|���qSr)rZ
month_namerrrrr
r![s)r#�a_month�f_month)rr'r(rrr
Z__calc_monthXszLocaleTime.__calc_monthcCsJg}dD]6}t�ddd|ddddd	f	�}|�t�d
|����q||_dS)N)�������,�7��Lr�%p)r�struct_time�append�strftimer�am_pm)rr6�hour�
time_tuplerrr
Z__calc_am_pm_s
zLocaleTime.__calc_am_pmc
CsJt�d�}dddg}t�d|���|d<t�d|���|d<t�d|���|d<d|jdd	f|jd
df|jddf|jd
d
f|jddfdddddddddddg}|�	dd�|j
D��dD]d\}}||}|D]\}}|r�|�||�}q�t�d�}dt�||�k�rd}	nd }	|�d!|	�||<q�|d|_|d|_
|d|_dS)"N)	r+r,r-r*r.r/r0r1r�%cr�%xr)�%Xr0)�%z%%z%Ar,z%Bz%az%br2)Z1999z%Y)Z99z%y)Z22z%H)Z44z%M)Z55z%S)Z76z%j)Z17z%d)Z03�%m)�3r=)�2z%w)Z10z%IcSsg|]}|D]}|df�qqS)z%Zr)r�	tz_values�tzrrr
r!�s�z/LocaleTime.__calc_date_time.<locals>.<listcomp>))rr9)r)r:)r0r;)	r+r)r,r)r)r)�r,rZ00z%Wz%UZ11)rr3r5rr%r(r$r'r6�extendr�replace�LC_date_time�LC_date�LC_time)
rr8Z	date_timeZreplacement_pairs�offset�	directiveZcurrent_format�old�newZU_Wrrr
Z__calc_date_timeksH

�


zLocaleTime.__calc_date_timecCszzt��Wntk
r YnXtj|_tj|_tdd|jd��h�}|jrft|jd��h�}nt�}||f|_dS)N�utc�gmtrr))r�tzset�AttributeErrorrr�	frozensetrr)rZ	no_savingZ
has_savingrrr
Z__calc_timezone�szLocaleTime.__calc_timezoneN)	�__name__�
__module__�__qualname__rrrrrrrrrr
rs-rcs6eZdZd
�fdd�	Zdd�Zdd�Zdd	�Z�ZS)�TimeRENcs|r||_nt�|_t�}|�ddddddddd	d
ddd
ddd|�|jjd�|�|jjd�|�|jjdd�d�|�|jjdd�d�|�|jj	d�|�dd�|jj
D�d�dd��|�d|�d��
dd��|�d|�|jj��|�d|�|jj��|�d |�|jj��dS)!Nz)(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])z(?P<f>[0-9]{1,6})z(?P<H>2[0-3]|[0-1]\d|\d)z(?P<I>1[0-2]|0[1-9]|[1-9])z(?P<G>\d\d\d\d)zG(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])z(?P<m>1[0-2]|0[1-9]|[1-9])z(?P<M>[0-5]\d|\d)z(?P<S>6[0-1]|[0-5]\d|\d)z(?P<U>5[0-3]|[0-4]\d|\d)z(?P<w>[0-6])z(?P<u>[1-7])z(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)z(?P<y>\d\d)z(?P<Y>\d\d\d\d)z2(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)�A�ar)�B�b�pcss|]}|D]
}|Vq
qdSr	r)rZtz_namesrArrr
�	<genexpr>�s�z"TimeRE.__init__.<locals>.<genexpr>�Zr<)�d�f�H�I�G�j�m�M�S�U�w�u�V�y�Y�zrUrVrWrXrYr[r<�Wre�c�x�X)�locale_timer�superr�_TimeRE__seqToREr%r$r(r'r6r�__setitem__�__getitem__rD�patternrErFrG)rrp�base��	__class__rr
r�sF��zTimeRE.__init__cCsPt|tdd�}|D]}|dkrq(qdSd�dd�|D��}d||f}d|S)	NT)�key�reverse��|css|]}t|�VqdSr	)�	re_escape)rZstuffrrr
rZ�sz#TimeRE.__seqToRE.<locals>.<genexpr>z	(?P<%s>%sz%s))�sorted�len�join)rZ
to_convertrI�valueZregexrrr
Z	__seqToRE�s	zTimeRE.__seqToREcCs�d}td�}|�d|�}td�}|�d|�}d|krv|�d�d}d||d|d�|||f}||dd�}q,d	||fS)
Nr{z([\\.^$*+?\(\){}\[\]|])z\\\1z\s+z\\s+r<r)z%s%s%sz%s%s)�
re_compile�sub�index)r�formatZprocessed_formatZregex_charsZwhitespace_replacementZdirective_indexrrr
ru�s
�zTimeRE.patterncCst|�|�t�Sr	)r�rur)rr�rrr
rszTimeRE.compile)N)rQrRrSrrrrur�
__classcell__rrrwr
rT�s.rT�cCslt|dd���}|s,|dd}|dd}d|d}|dkrLd||S|d|d}d||SdS)Nr)r"r)�
datetime_date�weekday)�year�week_of_yearZday_of_week�week_starts_MonZ
first_weekdayZ
week_0_lengthZdays_to_weekrrr
�_calc_julian_from_U_or_Wsr�cCsdt|dd���d}|d||}|dkr\|t|dd���7}|d8}|t|dd���8}||fS)Nr)�r,r")r�Z
isoweekday�	toordinal)�iso_year�iso_weekZiso_weekdayZ
correctionZordinalrrr
�_calc_julian_from_V%sr��%a %b %d %H:%M:%S %Yc,Cs.t||g�D]*\}}t|t�sd}t|�|t|����qt��tj}t	�|j
kshtj|jkshtj
|j
kr|t�at��tj}tt�tkr�t��t�|�}|�s&zt�|�}Wnntk
r�}z.|jd}|dkr�d}~td||f�d�W5d}~XYn$tk
�rtd|�d�YnX|t|<W5QRX|�|�}	|	�sPtd||f��t|�|	��k�rztd||	��d���d}
}d	}}
d}}}}d
}d}d}d}}d}d}}|	��}|��D�]d}|dk�rt|d�}|dk�r�|d
7}n|d7}�q�|dk�r t|d�}�q�|dk�r:t|d�}
�q�|dk�rTt|d�}�q�|dk�rv|j�|d� ��}�q�|dk�r�|j!�|d� ��}�q�|dk�r�t|d�}
�q�|dk�r�t|d�}�q�|dk�r<t|d�}|�dd�� �}|d|j"dfk�r|dk�r8d}n"||j"d	k�r.|dk�r.|d7}�q�|dk�rVt|d�}�q�|dk�rpt|d�}�q�|dk�r�|d}|ddt|�7}t|�}�q�|dk�r�|j#�|d� ��}�q�|d k�r�|j$�|d � ��}�q�|d!k�rt|d!�}|dk�rd}n|d	8}�q�|d"k�r:t|d"�}|d	8}�q�|d#k�rTt|d#�}�q�|d$k�r�t||�}|d%k�rzd}nd}�q�|d&k�r�t|d&�}�q�|d'k�r�|d'}|d(k�r�d}n�|d)d*k�r.|dd)�|d+d�}t|�d,k�r.|d,d*k�rd-|d'��}t|��|dd,�|dd�}t|d	d)��}t|d)d,��} t|d,d.��p`d�}!|d/d/| d/|!}|d0d�}"ddt|"�}#t|"|#�}|�%d1��r.|}|}np|d(k�r�|d(� �}$t|j&�D]N\}%}&|$|&k�r�tjdtjd	k�r tj
�r |$d2k�r �q�n
|%}�qʐqސq�|dk�rv|
dk	�rv|dk�sZ|dk�rbtd3��|dk	�r�td4��n0|dk�r�|dk	�r�|dk�r�td5��ntd6��d7}'|dk�r�|d8k�r�|
d9k�r�d:}d;}'n|dk�r�d}|dk�r�|dk	�r�|dk	�r |dk�rd;nd7}(t'||||(�}n(|
dk	�rH|dk	�rHt(|
||d	�\}}|dk	�r�|dk�r�|d	8}t)�*|��rtd<nd=})||)7}|dk�r�t+|||
��,�t+|d	d	��,�d	}n0t+�-|d	t+|d	d	��,��}*|*j.}|*j/}|*j0}
|dk�r�t+|||
��1�}|�d(�}+|'�rd}|||
|||||||+|f||fS)>Nz*strptime() argument {} must be str, not {}r�\r<z&'%s' is a bad directive in format '%s'zstray %% in format '%s'z%time data %r does not match format %rzunconverted data remains: %sr)���ri�Di�ilrjr`rbrWrXr\r^r_rYr{�rcrdr]�0rBrUrVrfrgra)rerlrerhrkr[r,�:r�r�zInconsistent use of : in r"�<��-)rLrMzzISO year directive '%G' must be used with the ISO week directive '%V' and a weekday directive ('%A', '%a', '%w', or '%u').z`Day of the year directive '%j' is not compatible with ISO year directive '%G'. Use '%Y' instead.zzISO week directive '%V' must be used with the ISO year directive '%G' and a weekday directive ('%A', '%a', '%w', or '%u').zdISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G' instead.Fr0�ipTinim)2�	enumerate�
isinstance�str�	TypeErrorr��type�_cache_lock�
_TimeRE_cacherprrrrrrT�_regex_cache�clearr�_CACHE_MAX_SIZE�getr�KeyError�argsr�
IndexError�match�end�	groupdict�keys�intr(r�rr'r6r%r$�
startswithrr�r�rZisleapr�r�Zfromordinalr��month�dayr�),�data_stringr�r��arg�msgrpZformat_regex�errZ
bad_directive�foundr�r�r�r�r7Zminute�second�fractionrA�gmtoff�gmtoff_fractionr�r�Zweek_of_year_startr�ZjulianZ
found_dictZ	group_keyZampm�srkZhoursZminutes�secondsZgmtoff_remainderZgmtoff_remainder_paddingZ
found_zoner�r@Z
leap_year_fixr�ZydayZdatetime_resultrrrr
�	_strptime5s�

�
�

��
��




























��





�
����

��r�cCs"t||�d}t�|dtj��S)Nr)r�rr3�_STRUCT_TM_ITEMS)r�r��ttrrr
�_strptime_time/sr�cCspt||�\}}}|dd�\}}|dd�|f}|dk	rht||d�}	|rVt|	|�}
nt|	�}
||
f7}||�S)N���rB)r�Zmicroseconds)r��datetime_timedelta�datetime_timezone)�clsr�r�r�r�r�rr�r�ZtzdeltarArrr
�_strptime_datetime5s
r�)r�)r�)r�)"rr
r�rerr�rrr}Zdatetimerr�rr�rr��_threadrZ_thread_allocate_lock�__all__r�objectr�dictrTr�r�r�r�r�r�r�r�r�rrrr
�<module>
s,
_
{
threading.cpython-38.opt-1.pyc000064400000115003151450073350012103 0ustar00U

e5d���@s2dZddlZddlZddlZddlmZddl	m
Z
ddlmZ
mZzddlmZWn ek
rtddlmZYnXddd	d
ddd
ddddddddddddddddgZejZejZejZejZzejZdZe�d�Wnek
r�d ZYnXej Z!z
ej"Z#Wnek
�rdZ#YnXej$Z$[da%da&d!d�Z'd"d�Z(eZ)d#d�Z"Gd$d%�d%�Z*e*Z+Gd&d	�d	�Z,Gd'd�d�Z-Gd(d�de-�Z.Gd)d�d�Z/Gd*d�d�Z0Gd+d�de1�Z2e�j3Z4e4�dLd-d.�Z5e�a6iZ7iZ8e
�Z9e�a:e;�a<Gd/d�d�Z=zdd0lm>a?m@ZAWnHek
�rVdd1lBmCZDdd2lmEZEeEdd3�Z@d4d�ZAd5d�a?YnXd6d7�ZFGd8d�de=�ZGGd9d:�d:e=�ZHGd;d<�d<e=�ZId=d
�ZJeJZKd>d�ZLeLZMd?d@�ZNdAd�ZOddBlmPZPeH�aQdCdD�ZRdEd�ZSzddFlmTZUWn"ek
�rddGlVmUZUYnXdHdI�ZWeXedJ��r.ejYeWdK�dS)Mz;Thread module emulating a subset of Java's threading model.�N)�	monotonic)�WeakSet)�islice�count)�deque�	get_ident�active_count�	Condition�current_thread�	enumerate�main_thread�TIMEOUT_MAX�Event�Lock�RLock�	Semaphore�BoundedSemaphore�Thread�Barrier�BrokenBarrierError�Timer�ThreadError�
setprofile�settrace�local�
stack_size�
excepthook�ExceptHookArgsT�
get_native_idFcCs|adS)z�Set a profile function for all threads started from the threading module.

    The func will be passed to sys.setprofile() for each thread, before its
    run() method is called.

    N)�
_profile_hook��func�r"�!/usr/lib64/python3.8/threading.pyr9scCs|adS)z�Set a trace function for all threads started from the threading module.

    The func will be passed to sys.settrace() for each thread, before its run()
    method is called.

    N)�_trace_hookr r"r"r#rCscOstdkrt||�St||�S)a2Factory function that returns a new reentrant lock.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it again
    without blocking; the thread must release it once for each time it has
    acquired it.

    N)�_CRLock�_PyRLock)�args�kwargsr"r"r#rQs	
c@sVeZdZdZdd�Zdd�Zddd	�ZeZd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�_RLocka,This class implements reentrant lock objects.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it
    again without blocking; the thread must release it once for each time it
    has acquired it.

    cCst�|_d|_d|_dS�Nr)�_allocate_lock�_block�_owner�_count��selfr"r"r#�__init__hsz_RLock.__init__c	Cs^|j}zt|j}Wntk
r(YnXd|j��r:dnd|jj|jj||j	t
t|��fS)Nz)<%s %s.%s object owner=%r count=%d at %s>�lockedZunlocked)r-�_active�name�KeyErrorr,r2�	__class__�
__module__�__qualname__r.�hex�id)r0�ownerr"r"r#�__repr__ms
�z_RLock.__repr__T���cCsDt�}|j|kr"|jd7_dS|j�||�}|r@||_d|_|S)aAcquire a lock, blocking or non-blocking.

        When invoked without arguments: if this thread already owns the lock,
        increment the recursion level by one, and return immediately. Otherwise,
        if another thread owns the lock, block until the lock is unlocked. Once
        the lock is unlocked (not owned by any thread), then grab ownership, set
        the recursion level to one, and return. If more than one thread is
        blocked waiting until the lock is unlocked, only one at a time will be
        able to grab ownership of the lock. There is no return value in this
        case.

        When invoked with the blocking argument set to true, do the same thing
        as when called without arguments, and return true.

        When invoked with the blocking argument set to false, do not block. If a
        call without an argument would block, return false immediately;
        otherwise, do the same thing as when called without arguments, and
        return true.

        When invoked with the floating-point timeout argument set to a positive
        value, block for at most the number of seconds specified by timeout
        and as long as the lock cannot be acquired.  Return true if the lock has
        been acquired, false if the timeout has elapsed.

        �)rr-r.r,�acquire)r0�blocking�timeout�me�rcr"r"r#r?|s
z_RLock.acquirecCs<|jt�krtd��|jd|_}|s8d|_|j��dS)amRelease a lock, decrementing the recursion level.

        If after the decrement it is zero, reset the lock to unlocked (not owned
        by any thread), and if any other threads are blocked waiting for the
        lock to become unlocked, allow exactly one of them to proceed. If after
        the decrement the recursion level is still nonzero, the lock remains
        locked and owned by the calling thread.

        Only call this method when the calling thread owns the lock. A
        RuntimeError is raised if this method is called when the lock is
        unlocked.

        There is no return value.

        �cannot release un-acquired lockr>N)r-r�RuntimeErrorr.r,�release)r0rr"r"r#rF�sz_RLock.releasecCs|��dS�N�rF�r0�t�v�tbr"r"r#�__exit__�sz_RLock.__exit__cCs|j��|\|_|_dSrG)r,r?r.r-)r0�stater"r"r#�_acquire_restore�s
z_RLock._acquire_restorecCs<|jdkrtd��|j}d|_|j}d|_|j��||fS)NrrD)r.rEr-r,rF)r0rr;r"r"r#�
_release_save�s

z_RLock._release_savecCs|jt�kSrG)r-rr/r"r"r#�	_is_owned�sz_RLock._is_ownedN)Tr=)
�__name__r7r8�__doc__r1r<r?�	__enter__rFrMrOrPrQr"r"r"r#r)^s	
$
r)c@steZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zddd�Zddd�Z
dd�ZeZdS)r	ajClass that implements a condition variable.

    A condition variable allows one or more threads to wait until they are
    notified by another thread.

    If the lock argument is given and not None, it must be a Lock or RLock
    object, and it is used as the underlying lock. Otherwise, a new RLock object
    is created and used as the underlying lock.

    NcCs�|dkrt�}||_|j|_|j|_z|j|_Wntk
rDYnXz|j|_Wntk
rfYnXz|j|_Wntk
r�YnXt�|_	dSrG)
r�_lockr?rFrP�AttributeErrorrOrQ�_deque�_waiters�r0�lockr"r"r#r1�s$zCondition.__init__cCs
|j��SrG)rUrTr/r"r"r#rT�szCondition.__enter__cGs|jj|�SrG)rUrM)r0r'r"r"r#rM�szCondition.__exit__cCsd|jt|j�fS)Nz<Condition(%s, %d)>)rU�lenrXr/r"r"r#r<�szCondition.__repr__cCs|j��dSrG)rUrFr/r"r"r#rP�szCondition._release_savecCs|j��dSrG)rUr?)r0�xr"r"r#rOszCondition._acquire_restorecCs"|j�d�r|j��dSdSdS)NrFT)rUr?rFr/r"r"r#rQs
zCondition._is_ownedcCs�|��std��t�}|��|j�|�|��}d}z>|dkrN|��d}n |dkrd|�d|�}n
|�d�}|W�S|�|�|s�z|j�|�Wnt	k
r�YnXXdS)akWait until notified or until a timeout occurs.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks until it is
        awakened by a notify() or notify_all() call for the same condition
        variable in another thread, or until the optional timeout occurs. Once
        awakened or timed out, it re-acquires the lock and returns.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        When the underlying lock is an RLock, it is not released using its
        release() method, since this may not actually unlock the lock when it
        was acquired multiple times recursively. Instead, an internal interface
        of the RLock class is used, which really unlocks it even when it has
        been recursively acquired several times. Another internal interface is
        then used to restore the recursion level when the lock is reacquired.

        zcannot wait on un-acquired lockFNTr)
rQrEr+r?rX�appendrPrO�remove�
ValueError)r0rA�waiterZsaved_stateZgotitr"r"r#�waits*

zCondition.waitcCsXd}|}|�}|sT|dk	rB|dkr.t�|}n|t�}|dkrBqT|�|�|�}q|S)z�Wait until a condition evaluates to True.

        predicate should be a callable which result will be interpreted as a
        boolean value.  A timeout may be provided giving the maximum time to
        wait.

        Nr)�_timera)r0Z	predicaterA�endtimeZwaittime�resultr"r"r#�wait_for>s

zCondition.wait_forr>c	Csf|��std��|j}tt||��}|s,dS|D]0}|��z|�|�Wq0tk
r^Yq0Xq0dS)aKWake up one or more threads waiting on this condition, if any.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method wakes up at most n of the threads waiting for the condition
        variable; it is a no-op if no threads are waiting.

        z!cannot notify on un-acquired lockN)rQrErXrW�_islicerFr^r_)r0�nZall_waitersZwaiters_to_notifyr`r"r"r#�notifyUs
zCondition.notifycCs|�t|j��dS)z�Wake up all threads waiting on this condition.

        If the calling thread has not acquired the lock when this method
        is called, a RuntimeError is raised.

        N)rhr[rXr/r"r"r#�
notify_alllszCondition.notify_all)N)N)N)r>)rRr7r8rSr1rTrMr<rPrOrQrarerhriZ	notifyAllr"r"r"r#r	�s
	
0

	c@s8eZdZdZd
dd�Zddd�ZeZd	d
�Zdd�ZdS)raGThis class implements semaphore objects.

    Semaphores manage a counter representing the number of release() calls minus
    the number of acquire() calls, plus an initial value. The acquire() method
    blocks if necessary until it can return without making the counter
    negative. If not given, value defaults to 1.

    r>cCs&|dkrtd��tt��|_||_dS)Nrz$semaphore initial value must be >= 0)r_r	r�_cond�_value�r0�valuer"r"r#r1�szSemaphore.__init__TNc	Cs�|s|dk	rtd��d}d}|j�f|jdkrr|s4q�|dk	rd|dkrPt�|}n|t�}|dkrdq�|j�|�q$|jd8_d}W5QRX|S)a�Acquire a semaphore, decrementing the internal counter by one.

        When invoked without arguments: if the internal counter is larger than
        zero on entry, decrement it by one and return immediately. If it is zero
        on entry, block, waiting until some other thread has called release() to
        make it larger than zero. This is done with proper interlocking so that
        if multiple acquire() calls are blocked, release() will wake exactly one
        of them up. The implementation may pick one at random, so the order in
        which blocked threads are awakened should not be relied on. There is no
        return value in this case.

        When invoked with blocking set to true, do the same thing as when called
        without arguments, and return true.

        When invoked with blocking set to false, do not block. If a call without
        an argument would block, return false immediately; otherwise, do the
        same thing as when called without arguments, and return true.

        When invoked with a timeout other than None, it will block for at
        most timeout seconds.  If acquire does not complete successfully in
        that interval, return false.  Return true otherwise.

        Nz.can't specify timeout for non-blocking acquireFrr>T)r_rjrkrbra)r0r@rArCrcr"r"r#r?�s$

zSemaphore.acquirec	Cs.|j�|jd7_|j��W5QRXdS)z�Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        r>N)rjrkrhr/r"r"r#rF�szSemaphore.releasecCs|��dSrGrHrIr"r"r#rM�szSemaphore.__exit__)r>)TN)	rRr7r8rSr1r?rTrFrMr"r"r"r#rxs

-c@s"eZdZdZddd�Zdd�ZdS)	ra�Implements a bounded semaphore.

    A bounded semaphore checks to make sure its current value doesn't exceed its
    initial value. If it does, ValueError is raised. In most situations
    semaphores are used to guard resources with limited capacity.

    If the semaphore is released too many times it's a sign of a bug. If not
    given, value defaults to 1.

    Like regular semaphores, bounded semaphores manage a counter representing
    the number of release() calls minus the number of acquire() calls, plus an
    initial value. The acquire() method blocks if necessary until it can return
    without making the counter negative. If not given, value defaults to 1.

    r>cCst�||�||_dSrG)rr1�_initial_valuerlr"r"r#r1�szBoundedSemaphore.__init__c	CsB|j�2|j|jkrtd��|jd7_|j��W5QRXdS)a6Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.

        z!Semaphore released too many timesr>N)rjrkrnr_rhr/r"r"r#rF�s

zBoundedSemaphore.releaseN)r>)rRr7r8rSr1rFr"r"r"r#r�s
c@sFeZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
d�Z	dd
d�Z
dS)rz�Class implementing event objects.

    Events manage a flag that can be set to true with the set() method and reset
    to false with the clear() method. The wait() method blocks until the flag is
    true.  The flag is initially false.

    cCstt��|_d|_dS)NF)r	rrj�_flagr/r"r"r#r1�szEvent.__init__cCs|j�t��dSrG)rjr1rr/r"r"r#�_reset_internal_locks�szEvent._reset_internal_lockscCs|jS)z5Return true if and only if the internal flag is true.)ror/r"r"r#�is_setszEvent.is_setc	Cs&|j�d|_|j��W5QRXdS)z�Set the internal flag to true.

        All threads waiting for it to become true are awakened. Threads
        that call wait() once the flag is true will not block at all.

        TN)rjrorir/r"r"r#�setsz	Event.setc	Cs|j�d|_W5QRXdS)z�Reset the internal flag to false.

        Subsequently, threads calling wait() will block until set() is called to
        set the internal flag to true again.

        FN)rjror/r"r"r#�clearszEvent.clearNc
Cs8|j�(|j}|s|j�|�}|W5QR�SQRXdS)aHBlock until the internal flag is true.

        If the internal flag is true on entry, return immediately. Otherwise,
        block until another thread calls set() to set the flag to true, or until
        the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        This method returns the internal flag on exit, so it will always return
        True except if a timeout is given and the operation times out.

        N)rjrora)r0rAZsignaledr"r"r#ras
z
Event.wait)N)rRr7r8rSr1rprqZisSetrrrsrar"r"r"r#r�s

c@s�eZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Ze
dd��ZdS)rz�Implements a Barrier.

    Useful for synchronizing a fixed number of threads at known synchronization
    points.  Threads block on 'wait()' and are simultaneously awoken once they
    have all made that call.

    NcCs.tt��|_||_||_||_d|_d|_dS)aWCreate a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.

        rN)r	rrj�_action�_timeout�_parties�_stater.)r0�parties�actionrAr"r"r#r1Fs	zBarrier.__init__c
Cs�|dkr|j}|j�r|��|j}|jd7_z6|d|jkrL|��n
|�|�|W�W5QR�S|jd8_|��XW5QRXdS)aNWait for the barrier.

        When the specified number of threads have started waiting, they are all
        simultaneously awoken. If an 'action' was provided for the barrier, one
        of the threads will have executed that callback prior to returning.
        Returns an individual index number from 0 to 'parties-1'.

        Nr>)rurj�_enterr.�_exitrv�_release�_wait)r0rA�indexr"r"r#raVs	

zBarrier.waitcCs(|jdkr|j��q|jdkr$t�dS)N�r=r>r)rwrjrarr/r"r"r#rzts


zBarrier._entercCs>z"|jr|��d|_|j��Wn|���YnXdS)Nr>)rtrwrjri�_breakr/r"r"r#r|szBarrier._releasecs4�j��fdd�|�s"���t��jdkr0t�dS)Ncs
�jdkSr*�rwr"r/r"r#�<lambda>��zBarrier._wait.<locals>.<lambda>r)rjrer�rrw�r0rAr"r/r#r}�s
z
Barrier._waitcCs(|jdkr$|jdkr$d|_|j��dS)Nrr)r.rwrjrir/r"r"r#r{�s

z
Barrier._exitc	CsT|j�D|jdkr6|jdkr$d|_q<|jdkr<d|_nd|_|j��W5QRXdS)z�Reset the barrier to the initial state.

        Any threads currently waiting will get the BrokenBarrier exception
        raised.

        rr=���N)rjr.rwrir/r"r"r#�reset�s


z
Barrier.resetc	Cs|j�|��W5QRXdS)z�Place the barrier into a 'broken' state.

        Useful in case of error.  Any currently waiting threads and threads
        attempting to 'wait()' will have BrokenBarrierError raised.

        N)rjr�r/r"r"r#�abort�sz
Barrier.abortcCsd|_|j��dS)Nr�)rwrjrir/r"r"r#r��szBarrier._breakcCs|jS)z:Return the number of threads required to trip the barrier.)rvr/r"r"r#rx�szBarrier.partiescCs|jdkr|jSdS)z>Return the number of threads currently waiting at the barrier.r)rwr.r/r"r"r#�	n_waiting�s
zBarrier.n_waitingcCs
|jdkS)z0Return True if the barrier is in a broken state.r�r�r/r"r"r#�broken�szBarrier.broken)NN)N)rRr7r8rSr1rarzr|r}r{r�r�r��propertyrxr�r�r"r"r"r#r=s 




c@seZdZdS)rN)rRr7r8r"r"r"r#r�s�	Thread-%dcCs
|t�SrG)�_counter)�templater"r"r#�_newname�sr�c@seZdZdZdZd:dd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zer\dd�Z
dd�Zdd�Zdd�Zdd�Zd;dd�Zd<d"d#�Zed$d%��Zejd&d%��Zed'd(��Zer�ed)d*��Zd+d,�Zd-d.�Zed/d0��Zejd1d0��Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)=raA class that represents a thread of control.

    This class can be safely subclassed in a limited fashion. There are two ways
    to specify the activity: by passing a callable object to the constructor, or
    by overriding the run() method in a subclass.

    FNr"��daemoncCs�|dkri}||_t|pt��|_||_||_|dk	r>||_n
t�j|_d|_	t
rXd|_d|_t
�|_d|_d|_tj|_t�|_t�|�dS)aKThis constructor should always be called with keyword arguments. Arguments are:

        *group* should be None; reserved for future extension when a ThreadGroup
        class is implemented.

        *target* is the callable object to be invoked by the run()
        method. Defaults to None, meaning nothing is called.

        *name* is the thread name. By default, a unique name is constructed of
        the form "Thread-N" where N is a small decimal number.

        *args* is the argument tuple for the target invocation. Defaults to ().

        *kwargs* is a dictionary of keyword arguments for the target
        invocation. Defaults to {}.

        If a subclass overrides the constructor, it must make sure to invoke
        the base class constructor (Thread.__init__()) before doing anything
        else to the thread.

        NFT)�_target�strr��_name�_args�_kwargs�	_daemonicr
r��_ident�_HAVE_THREAD_NATIVE_ID�
_native_id�_tstate_lockr�_started�_is_stopped�_initialized�_sys�stderr�_stderr�_make_invoke_excepthook�_invoke_excepthook�	_dangling�add)r0�group�targetr4r'r(r�r"r"r#r1�s&
zThread.__init__cCs(|j��|r|��nd|_d|_dS�NT)r�rp�_set_tstate_lockr�r�)r0�is_aliver"r"r#rp(s


zThread._reset_internal_lockscCs^d}|j��rd}|��|jr$d}|jr2|d7}|jdk	rJ|d|j7}d|jj|j|fS)N�initialZstartedZstoppedz daemonz %sz<%s(%s, %s)>)	r�rqr�r�r�r�r6rRr�)r0Zstatusr"r"r#r<4s

zThread.__repr__cCs�|jstd��|j��r td��t�|t|<W5QRXzt|jd�Wn,tk
rtt�t|=W5QRX�YnX|j�	�dS)a-Start the thread's activity.

        It must be called at most once per thread object. It arranges for the
        object's run() method to be invoked in a separate thread of control.

        This method will raise a RuntimeError if called more than once on the
        same thread object.

        zthread.__init__() not calledz threads can only be started oncer"N)
r�rEr�rq�_active_limbo_lock�_limbo�_start_new_thread�
_bootstrap�	Exceptionrar/r"r"r#�startBs

zThread.startcCs.z|jr|j|j|j�W5|`|`|`XdS)aXMethod representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        N)r�r�r�r/r"r"r#�run[s	z
Thread.runcCs4z|��Wn"|jr(tdkr(YdS�YnXdSrG)�_bootstrap_innerr�r�r/r"r"r#r�ls
zThread._bootstrapcCst�|_dSrG)rr�r/r"r"r#�
_set_ident�szThread._set_identcCst�|_dSrG)rr�r/r"r"r#�_set_native_id�szThread._set_native_idc	Cs8t�|_|j��|js4t�t�|j�W5QRXdS)z�
        Set a lock object which will be released by the interpreter when
        the underlying thread state (see pystate.h) gets deleted.
        N)�
_set_sentinelr�r?r��_shutdown_locks_lock�_shutdown_locksr�r/r"r"r#r��s

zThread._set_tstate_lockcCs�z�|��|��tr|��|j��t�|t|j	<t
|=W5QRXtrVt�
t�trdt�t�z|��Wn|�|�YnXW5t� ztt�=WnYnXW5QRXXdSrG)r�r3rr�r�r�r�r�rrr�r�r$r�rrrr�r�r/r"r"r#r��s,



zThread._bootstrap_innerc	Cs>|j}|dk	rd|_d|_|js:t�t�|�W5QRXdSr�)r�r�r�r�r��discardrYr"r"r#�_stop�szThread._stopc	Cst�tt�=W5QRXdS)zARemove current thread from the dict of currently running threads.N)r�r3rr/r"r"r#�_delete�szThread._deletecCsZ|jstd��|j��s td��|t�kr2td��|dkrD|��n|jt|d�d�dS)aWait until the thread terminates.

        This blocks the calling thread until the thread whose join() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As join() always returns None, you must call
        is_alive() after join() to decide whether a timeout happened -- if the
        thread is still alive, the join() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be join()ed many times.

        join() raises a RuntimeError if an attempt is made to join the current
        thread as that would cause a deadlock. It is also an error to join() a
        thread before it has been started and attempts to do so raises the same
        exception.

        �Thread.__init__() not calledz'cannot join thread before it is startedzcannot join current threadNr)rA)r�rEr�rqr
�_wait_for_tstate_lock�maxr�r"r"r#�join�s


zThread.joinTr=cCs0|j}|dkrn|�||�r,|��|��dSrG)r�r?rFr�)r0�blockrArZr"r"r#r��szThread._wait_for_tstate_lockcCs|jS)z�A string used for identification purposes only.

        It has no semantics. Multiple threads may be given the same name. The
        initial name is set by the constructor.

        )r�r/r"r"r#r4s	zThread.namecCst|�|_dSrG)r�r��r0r4r"r"r#r4scCs|jS)a4Thread identifier of this thread or None if it has not been started.

        This is a nonzero integer. See the get_ident() function. Thread
        identifiers may be recycled when a thread exits and another thread is
        created. The identifier is available even after the thread has exited.

        )r�r/r"r"r#�idents
zThread.identcCs|jS)z�Native integral thread ID of this thread, or None if it has not been started.

            This is a non-negative integer. See the get_native_id() function.
            This represents the Thread ID as reported by the kernel.

            )r�r/r"r"r#�	native_id$s	zThread.native_idcCs&|js|j��sdS|�d�|jS)z�Return whether the thread is alive.

        This method returns True just before the run() method starts until just
        after the run() method terminates. The module function enumerate()
        returns a list of all alive threads.

        F)r�r�rqr�r/r"r"r#r�/s	
zThread.is_alivecCs ddl}|jdtdd�|��S)zhReturn whether the thread is alive.

        This method is deprecated, use is_alive() instead.
        rNz/isAlive() is deprecated, use is_alive() instead�)�
stacklevel)�warnings�warn�DeprecationWarningr�)r0r�r"r"r#�isAlive=s�zThread.isAlivecCs|jS)a�A boolean value indicating whether this thread is a daemon thread.

        This must be set before start() is called, otherwise RuntimeError is
        raised. Its initial value is inherited from the creating thread; the
        main thread is not a daemon thread and therefore all threads created in
        the main thread default to daemon = False.

        The entire Python program exits when only daemon threads are left.

        )r�r/r"r"r#r�Gs
z
Thread.daemoncCs*|jstd��|j��r td��||_dS)Nr�z)cannot set daemon status of active thread)r�rEr�rqr��r0Zdaemonicr"r"r#r�Vs

cCs|jSrGr�r/r"r"r#�isDaemon^szThread.isDaemoncCs
||_dSrGr�r�r"r"r#�	setDaemonaszThread.setDaemoncCs|jSrG�r4r/r"r"r#�getNamedszThread.getNamecCs
||_dSrGr�r�r"r"r#�setNamegszThread.setName)NNNr"N)N)Tr=) rRr7r8rSr�r1rpr<r�r�r�r�r�r�r�r�r�r�r�r�r�r4�setterr�r�r�r�r�r�r�r�r�r"r"r"r#r�sR��/	
&









)�_excepthook�_ExceptHookArgs)�print_exception)�
namedtuplez'exc_type exc_value exc_traceback threadcCst|�SrG)r�)r'r"r"r#rwscCs�|jtkrdStdk	r(tjdk	r(tj}n$|jdk	rH|jj}|dkrLdSndS|jdk	r`|jj}nt�}td|�d�|dd�t	|j|j
|j|d�|��dS)z9
        Handle uncaught Thread.run() exception.
        NzException in thread �:T��file�flush)r�)
�exc_type�
SystemExitr�r��threadr�r4r�print�_print_exception�	exc_value�
exc_tracebackr�)r'r�r4r"r"r#rzs(



��csPt�tj��dkrtd���dkr*td��tj�t�t������fdd�}|S)Nzthreading.excepthook is Nonezsys.excepthook is Nonec
s�z�z,t}|dkr�}t��|f��}||�Wn�tk
r�}zbd|_~�dk	rb�jdk	rb�j}n|j}�d|dd��dk	r��jdk	r��j}n�}|���W5d}~XYnXW5d}XdS)NTz"Exception in threading.excepthook:r�)rrr��__suppress_context__r�r�)r�r'�hook�excr�Zsys_excepthook�Zlocal_printZ	local_sysZold_excepthookZold_sys_excepthookZsys_exc_infor"r#�invoke_excepthook�s*� z2_make_invoke_excepthook.<locals>.invoke_excepthook)rr�rE�exc_infor�)r�r"r�r#r��s r�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz�Call a function after a specified number of seconds:

            t = Timer(30.0, f, args=None, kwargs=None)
            t.start()
            t.cancel()     # stop the timer's action if it's still waiting

    NcCsFt�|�||_||_|dk	r"|ng|_|dk	r4|ni|_t�|_dSrG)rr1�interval�functionr'r(r�finished)r0r�r�r'r(r"r"r#r1�s
zTimer.__init__cCs|j��dS)z)Stop the timer if it hasn't finished yet.N)r�rrr/r"r"r#�cancel�szTimer.cancelcCs6|j�|j�|j��s(|j|j|j�|j��dSrG)r�rar�rqr�r'r(rrr/r"r"r#r��s
z	Timer.run)NN)rRr7r8rSr1r�r�r"r"r"r#r�s
c@seZdZdd�ZdS)�_MainThreadc	CsTtj|ddd�|��|j��|��tr6|��t�|t	|j
<W5QRXdS)NZ
MainThreadF�r4r�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1�s
z_MainThread.__init__N)rRr7r8r1r"r"r"r#r��sr�c@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)�_DummyThreadc	CsPtj|td�dd�|j��|��tr2|��t�|t	|j
<W5QRXdS)NzDummy-%dTr�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1s
z_DummyThread.__init__cCsdSrGr"r/r"r"r#r�
sz_DummyThread._stopcCsdSr�r"r/r"r"r#r�sz_DummyThread.is_aliveNcCsdSrGr"r�r"r"r#r�sz_DummyThread.join)N)rRr7r8r1r�r�r�r"r"r"r#r�s
r�cCs,ztt�WStk
r&t�YSXdS)z�Return the current Thread object, corresponding to the caller's thread of control.

    If the caller's thread of control was not created through the threading
    module, a dummy thread object with limited functionality is returned.

    N)r3rr5r�r"r"r"r#r
sc
Cs,t�tt�tt�W5QR�SQRXdS)z�Return the number of Thread objects currently alive.

    The returned count is equal to the length of the list returned by
    enumerate().

    N)r�r[r3r�r"r"r"r#r(scCstt���tt���SrG)�listr3�valuesr�r"r"r"r#�
_enumerate4sr�c
Cs4t�&tt���tt���W5QR�SQRXdS)z�Return a list of all Thread objects currently alive.

    The list includes daemonic threads, dummy thread objects created by
    current_thread(), and the main thread. It excludes terminated threads and
    threads that have not yet been started.

    N)r�r�r3r�r�r"r"r"r#r8s)rc	Csftjr
dStj}|��t��t�tt�}t��W5QRX|sFqb|D]}|�	�|��qJq dS)zS
    Wait until the Python thread state of all non-daemon threads get deleted.
    N)
�_main_threadr�r�rFr�r�r�r�rsr?)ZtlockZlocksrZr"r"r#�	_shutdownKs	r�cCstS)z�Return the main thread object.

    In normal conditions, the main thread is the thread from which the
    Python interpreter was started.
    )r�r"r"r"r#rss)�_local)rc	Cs�t�ai}ztt�}Wntk
r2t�}YnX|at�at�a	t�xtt
��}|�t�|D]>}||kr�|�
d�t�}||_|||<qb|�
d�|��qbt��t��t�|�W5QRXdS)zL
    Cleanup threading module state that should not exist after a fork.
    TFN)r+r�r3rr5r�r�r�rrr�r��updater�rpr�r�r�rs)Z
new_activeZcurrentZthreadsr�r�r"r"r#�_after_fork�s0






r��register_at_fork)Zafter_in_child)r�)ZrS�os�_os�sysr��_thread�timerrbZ_weakrefsetr�	itertoolsrrfrr.�_collectionsrrW�ImportError�collections�__all__�start_new_threadr��
allocate_lockr+r�rrr�r]rV�errorrrr%r
rr$rrrr)r&r	rrrrrEr�__next__r�r�r�r3r�r�r�rrr�rr�rr�r�	tracebackr�r�r�r�rr�r�r
Z
currentThreadrZactiveCountr�rrr�r�rr�rZ_threading_localr��hasattrr�r"r"r"r#�<module>s��




q'P&O
�5
(5xdrlib.cpython-38.opt-2.pyc000064400000017072151450073350011432 0ustar00U

e5d�@stddlZddlmZddlmZddddgZGdd�de�ZGd	d�de�Zd
d�Z	Gdd�d�Z
Gd
d�d�ZdS)�N)�BytesIO��wraps�Error�Packer�Unpacker�ConversionErrorc@s$eZdZdd�Zdd�Zdd�ZdS)rcCs
||_dS�N)�msg)�selfr
�r�/usr/lib64/python3.8/xdrlib.py�__init__szError.__init__cCs
t|j�Sr	)�reprr
�rrrr
�__repr__szError.__repr__cCs
t|j�Sr	)�strr
rrrr
�__str__sz
Error.__str__N)�__name__�
__module__�__qualname__rrrrrrr
rs
c@seZdZdS)rN)rrrrrrr
r scst���fdd��}|S)Nc
sFz�||�WStjk
r@}zt|jd�d�W5d}~XYnXdS�Nr)�struct�errorr�args)r�value�e��functionrr
�result&sz&raise_conversion_error.<locals>.resultr)rrrrr
�raise_conversion_error#sr c@s�eZdZdd�Zdd�Zdd�ZeZedd��Zed	d
��Z	e	Z
dd�Zd
d�ZeZ
edd��Zedd��Zdd�ZeZdd�ZeZeZdd�Zdd�Zdd�ZdS)rcCs|��dSr	��resetrrrr
r2szPacker.__init__cCst�|_dSr	)r�_Packer__bufrrrr
r"5szPacker.resetcCs
|j��Sr	)r#�getvaluerrrr
�
get_buffer8szPacker.get_buffercCs|j�t�d|��dS)N�>L�r#�writerZpack�r�xrrr
�	pack_uint=szPacker.pack_uintcCs|j�t�d|��dS)N�>lr'r)rrr
�pack_intAszPacker.pack_intcCs"|r|j�d�n|j�d�dS)Nss)r#r(r)rrr
�	pack_boolGszPacker.pack_boolc
Cs�z|�|d?d@�Wn8ttjfk
rN}zt|jd�d�W5d}~XYnXz|�|d@�Wn8ttjfk
r�}zt|jd�d�W5d}~XYnXdS)N� l��r)r+�	TypeErrorrrrr)rr*rrrr
�pack_uhyperKs"zPacker.pack_uhypercCs|j�t�d|��dS)N�>fr'r)rrr
�
pack_floatWszPacker.pack_floatcCs|j�t�d|��dS)N�>dr'r)rrr
�pack_double[szPacker.pack_doublecCsP|dkrtd��|d|�}|ddd}||t|�d}|j�|�dS)Nr� fstring size must be nonnegative���)�
ValueError�lenr#r()r�n�s�datarrr
�pack_fstring_szPacker.pack_fstringcCs"t|�}|�|�|�||�dSr	)r;r+r?)rr=r<rrr
�pack_stringis
zPacker.pack_stringcCs*|D]}|�d�||�q|�d�dS)N�r)r+)r�list�	pack_item�itemrrr
�	pack_listqs

zPacker.pack_listcCs*t|�|krtd��|D]}||�qdS)Nzwrong array size)r;r:)rr<rBrCrDrrr
�pack_farraywszPacker.pack_farraycCs$t|�}|�|�|�|||�dSr	)r;r+rF)rrBrCr<rrr
�
pack_array}s
zPacker.pack_arrayN)rrrrr"r%Zget_bufr r+r-Z	pack_enumr.r1Z
pack_hyperr3r5r?Zpack_fopaquer@Zpack_opaqueZ
pack_bytesrErFrGrrrr
r/s0




c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
e
Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZdd�ZeZeZdd �Zd!d"�Zd#d$�Zd%S)&rcCs|�|�dSr	r!�rr>rrr
r�szUnpacker.__init__cCs||_d|_dSr)�_Unpacker__buf�_Unpacker__posrHrrr
r"�szUnpacker.resetcCs|jSr	�rJrrrr
�get_position�szUnpacker.get_positioncCs
||_dSr	rK)rZpositionrrr
�set_position�szUnpacker.set_positioncCs|jSr	)rIrrrr
r%�szUnpacker.get_buffercCs|jt|j�krtd��dS)Nzunextracted data remains)rJr;rIrrrrr
�done�sz
Unpacker.donecCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr8r&r�rJrIr;�EOFErrorrZunpack�r�i�jr>rrr
�unpack_uint�szUnpacker.unpack_uintcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr8r,rrOrQrrr
�
unpack_int�szUnpacker.unpack_intcCst|���Sr	)�boolrUrrrr
�unpack_bool�szUnpacker.unpack_boolcCs |��}|��}t|�d>|BS)Nr/)rT�int)r�hi�lorrr
�
unpack_uhyper�szUnpacker.unpack_uhypercCs|��}|dkr|d}|S)Nll)r[r)rrr
�unpack_hyper�szUnpacker.unpack_hypercCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr8r2rrOrQrrr
�unpack_float�szUnpacker.unpack_floatcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)N�r4rrOrQrrr
�
unpack_double�szUnpacker.unpack_doublecCsT|dkrtd��|j}||ddd}|t|j�kr<t�||_|j|||�S)Nrr6r7r8)r:rJr;rIrP)rr<rRrSrrr
�unpack_fstring�szUnpacker.unpack_fstringcCs|��}|�|�Sr	)rTr`)rr<rrr
�
unpack_string�szUnpacker.unpack_stringcCsBg}|��}|dkrq>|dkr,td|f��|�}|�|�q|S)NrrAz0 or 1 expected, got %r)rTr�append)r�unpack_itemrBr*rDrrr
�unpack_list�szUnpacker.unpack_listcCs"g}t|�D]}|�|��q|Sr	)�rangerb)rr<rcrBrRrrr
�
unpack_farray�szUnpacker.unpack_farraycCs|��}|�||�Sr	)rTrf)rrcr<rrr
�unpack_array�szUnpacker.unpack_arrayN)rrrrr"rLrMr%rNrTrUZunpack_enumrWr[r\r]r_r`Zunpack_fopaqueraZ
unpack_opaqueZunpack_bytesrdrfrgrrrr
r�s,
)r�ior�	functoolsr�__all__�	Exceptionrrr rrrrrr
�<module>sUsched.cpython-38.opt-2.pyc000064400000006663151450073350011240 0ustar00U

e5d*�@s�ddlZddlZddlmZddlZddlmZdgZGdd�dedd��Zdej_	d	ej
_	d
ej_	dej_	dej
_	e�ZGd
d�d�ZdS)�N)�
namedtuple)�	monotonic�	schedulerc@s8eZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�EventcCs|j|jf|j|jfkS�N��time�priority��s�o�r
�/usr/lib64/python3.8/sched.py�__eq__$�zEvent.__eq__cCs|j|jf|j|jfkSrrr
r
r
r�__lt__%rzEvent.__lt__cCs|j|jf|j|jfkSrrr
r
r
r�__le__&rzEvent.__le__cCs|j|jf|j|jfkSrrr
r
r
r�__gt__'rzEvent.__gt__cCs|j|jf|j|jfkSrrr
r
r
r�__ge__(rzEvent.__ge__N)	�__name__�
__module__�__qualname__�	__slots__rrrrrr
r
r
rr"srz(time, priority, action, argument, kwargszaNumeric type compatible with the return value of the
timefunc function passed to the constructor.zSEvents scheduled for the same time will be executed
in the order of their priority.z?Executing the event means executing
action(*argument, **kwargs)zGargument is a sequence holding the positional
arguments for the action.zDkwargs is a dictionary holding the keyword
arguments for the action.c@s^eZdZeejfdd�Zdefdd�Zdefdd�Z	dd	�Z
d
d�Zdd
d�Ze
dd��ZdS)rcCs g|_t��|_||_||_dSr)�_queue�	threading�RLock�_lock�timefunc�	delayfunc)�selfrrr
r
r�__init__9s
zscheduler.__init__r
c	Cs@|tkri}t|||||�}|j�t�|j|�W5QRX|Sr)�	_sentinelrr�heapq�heappushr)rrr	�action�argument�kwargs�eventr
r
r�enterabsAszscheduler.enterabscCs|��|}|�|||||�Sr)rr()r�delayr	r$r%r&rr
r
r�enterOszscheduler.enterc	Cs.|j�|j�|�t�|j�W5QRXdSr)rr�remover"�heapify)rr'r
r
r�cancelXszscheduler.cancelc
Cs&|j�|jW5QR�SQRXdSr)rr)rr
r
r�emptycszscheduler.emptyTc	Cs�|j}|j}|j}|j}tj}|�H|s4W5QR�q�|d\}}}	}
}|�}||krZd}
nd}
||�W5QRX|
r�|s�||S|||�q|	|
|�|d�qdS)NrTF)rrrrr"�heappop)rZblocking�lock�qrr�poprr	r$r%r&Znowr)r
r
r�runhs(
z
scheduler.runc	Cs:|j�|jdd�}W5QRXtttj|gt|���Sr)rr�list�mapr"r/�len)rZeventsr
r
r�queue�szscheduler.queueN)T)rrr�_timer�sleepr r!r(r*r-r.r3�propertyr7r
r
r
rr7s	
2)rr"�collectionsrrrr8�__all__r�__doc__r	r$r%r&�objectr!rr
r
r
r�<module>ssysconfig.cpython-38.opt-1.pyc000064400000036751151450073350012156 0ustar00U

��.e@a�
@sdZddlZddlZddlmZmZdddddd	d
ddd
dgZdhZddddddddd�ddddddddd�ddddddd dd�d!d!d"d"d#d$d%d&�d'd'd(d)d*d+d%d&�d,d,d-d-d.d+d%d&�d/�Zd&Z	ej
��dZd0ej
dd1�Zd2ej
dd1�Zej�ej�Zej�ej�Zej�ej�Zej�ej�ZdadZd3d4�Zej�rVej�eej��Znee� ��Zej!d5k�r�e�"��#d6��r�eej�$eee��Zd7ej%k�r�eej%d7�Zd8d9�Z&e'ed:d�Z(ej!d5k�r�d;d<�Z)e)e�Ze)e(�Z(djd>d?�Z*e*d@�Z+e+�r dAD]Z,dBee,dC<dDee,dE<�qdFdG�Z-dHdI�Z.dJdK�Z/dLdM�Z0dNdO�Z1dkdPdQ�Z2dRd�Z3dSdT�Z4dUdV�Z5dWdX�Z6dYdZ�Z7dld[d�Z8d\d�Z9d]d
�Z:d^d	�Z;e0�dd@fd_d
�Z<e0�dd@fd`d�Z=dad�Z>dbd�Z?dcd�Z@ddd�ZAdedf�ZBdgdh�ZCeDdik�reC�dS)mz-Access to Python's configuration information.�N)�pardir�realpath�get_config_h_filename�get_config_var�get_config_vars�get_makefile_filename�get_path�get_path_names�	get_paths�get_platform�get_python_version�get_scheme_names�parse_config_hZMACOSX_DEPLOYMENT_TARGETz/{installed_base}/lib64/python{py_version_short}z){platbase}/lib64/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz7{platbase}/lib64/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z
{base}/binz{base})�stdlib�
platstdlib�purelib�platlib�include�platinclude�scripts�dataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz
{base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scriptsz#{userbase}/Python{py_version_nodot}z1{userbase}/Python{py_version_nodot}/site-packagesz+{userbase}/Python{py_version_nodot}/Includez+{userbase}/Python{py_version_nodot}/Scriptsz
{userbase})rrrrrrrz){userbase}/lib64/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz7{userbase}/lib64/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packagesz{userbase}/include)�posix_prefix�
posix_home�ntZnt_userZ
posix_userZosx_framework_user�%d.%d�z%d%dcCs(z
t|�WStk
r"|YSXdS�N)r�OSError)�path�r�!/usr/lib64/python3.8/sysconfig.py�_safe_realpathis
r!r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�osr�isfile�join)�d�fnrrr �_is_python_source_dir~sr'�_homecCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)r"r�normcase�
startswithr$�_PREFIX)r%rrr �_fix_pcbuild�s
�r,FcCs|rtrtt�Stt�Sr)�	_sys_homer'�
_PROJECT_BASE)Z
check_homerrr �is_python_build�sr/T)rrz{srcdir}/Includerz{projectbase}/.rc
Csnz|jf|�WStk
rhz|jftj�WYStk
rb}ztd|�d�W5d}~XYnXYnXdS)Nz{%s})�format�KeyErrorr"�environ�AttributeError)�sZ
local_vars�varrrr �_subst_vars�sr6cCs0|��}|��D]\}}||kr"q|||<qdSr)�keys�items)Ztarget_dictZ
other_dictZtarget_keys�key�valuerrr �_extend_dict�s
r;cCsbi}|dkri}t|t��t|��D]4\}}tjdkrFtj�|�}tj�t	||��||<q(|S)N)�posixr)
r;r�_INSTALL_SCHEMESr8r"�namer�
expanduser�normpathr6)�scheme�vars�resr9r:rrr �_expand_vars�s
rDcCstjdkrdStjS)Nr<r)r"r>rrrr �_get_default_scheme�s
rEcCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)r"rr?r$)�argsrrr �joinuser�sz_getuserbase.<locals>.joinuserr�APPDATA�~�Python�darwin�Libraryrrz.local)r"r2�getr>�sys�platform�
_framework�version_info)�env_baserH�baserrr �_getuserbase�s


�rUc	Cs`ddl}|�d�}|�d�}|�d�}|dkr2i}i}i}t|dd��}|��}	W5QRX|	D]�}
|
�d�s^|
��d	krzq^|�|
�}|r^|�d
d�\}}
|
��}
|
�dd	�}d
|kr�|
||<q^z|t	kr�t
�t|
�}
Wn$t
k
r�|
�dd
�||<Yq^X|
||<q^t|�
��}d}t|�dk�r&t|�D�]�}||}|�|�}|�|�}|�rv|�rv|��|��k�rp|n|}n|�r�|n|}|dk	�r|�d
�}d}||k�r�t||�}n�||k�r�d}nx|tjk�r�tj|}n`||k�r0|�d��r
|dd�|k�r
d	}n$d||k�rd}nt|d|�}nd	||<}|�r||��d�}|d|���||}d
|k�r~|||<n�z|t	k�r�t
�t|�}Wn"t
k
�r�|��||<Yn
X|||<|�|�|�d��r|dd�|k�r|dd�}||k�r|||<n|||<|�|��q,�q|��D]"\}}
t|
t��r.|
��||<�q.|�|�|S)z�Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    rNz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}�surrogateescape)�errors�#��rz$$�$)ZCFLAGSZLDFLAGSZCPPFLAGSTFZPY_�)�re�compile�open�	readlinesr*�strip�match�group�replace�_ALWAYS_STR�
ValueError�int�listr7�len�tuple�search�start�strr"r2�end�remover8�
isinstance�update)�filenamerBr]Z_variable_rxZ_findvar1_rxZ_findvar2_rxZdoneZnotdone�f�lines�line�m�n�vZtmpvZ	variablesZrenamed_variablesr>r:Zm1Zm2�found�itemZafter�krrr �_parse_makefile�s�	












�



�


r|cCsdtrtj�tptd�Sttd�r0dttj	f}nd}ttj
d�rP|dtj
j7}tj�td�|d�S)z Return the path of the Makefile.ZMakefile�abiflagszconfig-%s%sZconfig�
_multiarchz-%sr)
�
_PYTHON_BUILDr"rr$r-r.�hasattrrO�_PY_VERSION_SHORTr}�implementationr~r)Zconfig_dir_namerrr rWs
c
Cs(tj�ddjtjtjttjdd�d��S)NZ_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}r~rY)ZabirPZ	multiarch)	r"r2rNr0rOr}rP�getattrr�rrrr �_get_sysconfigdata_nameds��r�c
Cs�ddl}i}t�}zt||�WnJtk
rj}z,d|}t|d�rR|d|j}t|��W5d}~XYnXt�}z"t|��}t||�W5QRXWnJtk
r�}z,d|}t|d�r�|d|j}t|��W5d}~XYnXt	r�|d|d<t
�}dtjk�r$ddl
}|�|�}	||	_|	tj|<d	t�tf}
ttd
��rF|
d7}
tj|
dd
�tj�|
|d�}t|ddd��(}|�d�|�d�|j||d�W5QRXtdddd��}|�|
�W5QRXdS)z;Generate the Python module containing build-time variables.rNz.invalid Python installation: unable to open %s�strerrorz (%s)ZLDSHAREDZ	BLDSHAREDrLzbuild/lib.%s-%sZgettotalrefcountz-pydebugT)�exist_okz.py�w�utf8)�encodingzB# system configuration generated and used by the sysconfig module
zbuild_time_vars = )�streamzpybuilddir.txt)�pprintrr|rr�r�rr_rrr�rOrP�types�
ModuleType�build_time_vars�modulesrr�r"�makedirsrr$�write)r�rBZmakefile�e�msgZconfig_hrsr>r��moduleZ
pybuilddirZdestfilerrr �_generate_posix_varsmsL







r�cCs0t�}t|t�t�dgd�}|j}|�|�dS)z7Initialize the module as appropriate for POSIX systems.r�rN)r��
__import__�globals�localsr�rq)rBr>Z_tempr�rrr �_init_posix�sr�cCsfddl}td�|d<td�|d<td�|d<|��d|d	<d
|d<t|d<tj�ttj	��|d
<dS)z+Initialize the module as appropriate for NTrNrZLIBDESTrZ
BINLIBDESTrZ	INCLUDEPY�
EXT_SUFFIXz.exeZEXEZVERSIONZBINDIR)
�_impr�extension_suffixes�_PY_VERSION_SHORT_NO_DOTr"r�dirnamer!rO�
executable)rBr�rrr �_init_non_posix�sr�c	Cs�|dkri}ddl}|�d�}|�d�}|��}|s6q�|�|�}|r�|�dd�\}}z|tkrbt�t|�}Wntk
r�YnX|||<q(|�|�}|r(d||�d�<q(|S)z�Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nrz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rZr)r]r^�readlinerbrcrerfrg)	�fprBr]Z	define_rxZundef_rxrurvrwrxrrr r�s,




cCsBtr,tjdkr"tj�tptd�}q4tp(t}ntd�}tj�|d�S)zReturn the path of pyconfig.h.rZPCrz
pyconfig-64.h)rr"r>rr$r-r.r)Zinc_dirrrr r�s

cCsttt��S)z,Return a tuple containing the schemes names.)rj�sortedr=rrrr r
�scCstS)z*Return a tuple containing the paths names.)�_SCHEME_KEYSrrrr r	�scCs|rt||�St|SdS)z�Return a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    N)rDr=)rArB�expandrrr r
�s
cCst|||�|S)z[Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    )r
)r>rArBr�rrr r	scGsxtdk�rFiattd<ttd<ttd<ttd<ttd<ttd<ttd<ttd	<ttd
<ttd<zt	j
td<Wntk
r�d
td<YnXtj
dkr�tt�tj
dkr�tt�t�d�}|dk	r�|td<t�td<t�dt�}tj
dk�rt�rtj�t��}tj�||�}ntj�t��}t|�td<t	jdk�rFddl}|�t�|�rpg}|D]}|�t�|���qT|StSdS)anWith no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    N�prefix�exec_prefixZ
py_versionZpy_version_shortZpy_version_nodotZinstalled_baserTZinstalled_platbaseZplatbaseZprojectbaser}rYrr<r��SO�userbase�srcdirrLr)�_CONFIG_VARSr+�_EXEC_PREFIX�_PY_VERSIONr�r��_BASE_PREFIX�_BASE_EXEC_PREFIXr.rOr}r3r"r>r�r�rNrUrrr�rr$r!rP�_osx_supportZcustomize_config_vars�append)rGr�r�rTr�Zvalsr>rrr rsP





cCs*|dkrddl}|�dtd�t��|�S)z�Return the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    r�rNz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningrrN)r>r�rrr r^sc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjStjdksZttd	�s`tjSd
tjkrttjd
St��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd |||fS|dd!�d"k�r�d"}ddl}|�
d#�}|�|�}|�r�|��}n2|dd!�d$k�r�ddl}	|	�t�|||�\}}}d%|||fS)&a�Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name and
    version and the architecture (as supplied by 'os.uname()'), although the
    exact information included depends on the OS; on Linux, the kernel version
    isn't particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    rZamd64z	win-amd64z(arm)z	win-arm32z(arm64)z	win-arm64r<�unameZ_PYTHON_HOST_PLATFORM�/rY� �_�-N�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%sr\rZ32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+rLz%s-%s-%s)r"r>rO�version�lowerrPr�r2r�rdrg�maxsizer]r^rbrcr�Zget_platform_osxr)
ZosnameZhost�releaser��machineZbitnessr]Zrel_rervr�rrr rjsT


 



�
cCstSr)r�rrrr r�scCsFtt|����D]0\}\}}|dkr0td|�td||f�qdS)Nrz%s: z
	%s = "%s")�	enumerater�r8�print)�titler�indexr9r:rrr �_print_dict�sr�cCsfdtjkrt�dStdt��tdt��tdt��t�tdt��t�tdt	��dS)z*Display all information sysconfig detains.z--generate-posix-varsNzPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ	Variables)
rO�argvr�r�rrrEr�r
rrrrr �_main�s
r��__main__)F)N)N)E�__doc__r"rOZos.pathrr�__all__rer=r�r��splitr�rRr�r�rr@r�r+�base_prefixr�r�r��base_exec_prefixr�r�Z
_USER_BASEr!r�r�r.�getcwdr>r��endswithr$r2r'r�r-r,r/rrAr6r;rDrErUr|rr�r�r�r�rrr
r	r
rrrrrr�r��__name__rrrr �<module>s����
���
�
��?�
	
	

	?
"MP
filecmp.cpython-38.opt-1.pyc000064400000020355151450073350011562 0ustar00U

e5df&�@s�dZddlZddlZddlmZdddddgZiZd	Zd
ddd
ddddgZdd�Z	d"dd�Z
dd�Zdd�ZGdd�d�Z
d#dd�Zee
fdd�Zdd�Zdd �Zed!kr�e�dS)$z�Utilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=True) -> int
    cmpfiles(a, b, common) -> ([], [], [])
    clear_cache()

�N)�filterfalse�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCst��dS)zClear the filecmp cache.N)�_cache�clear�rr�/usr/lib64/python3.8/filecmp.pyrsTcCs�tt�|��}tt�|��}|dtjks8|dtjkr<dS|rL||krLdS|d|dkr`dSt�||||f�}|dkr�t||�}tt�dkr�t�|t||||f<|S)a�Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to True.

    Return value:

    True if the files are the same, False otherwise.

    This function uses a cache for past comparisons and the results,
    with cache entries invalidated if their stat information
    changes.  The cache may be cleared by calling clear_cache().

    rFT�N�d)	�_sig�os�stat�S_IFREGr	�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomerrrrs
cCst�|j�|j|jfS�N)r�S_IFMT�st_mode�st_size�st_mtime)�strrrrDs
�rc
Cs�t}t|d��n}t|d��X}|�|�}|�|�}||krPW5QR�W5QR�dS|sW5QR�W5QR�dSqW5QRXW5QRXdS)N�rbFT)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2rrrrIs

rc@s�eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
ee	eeeeeeeeeeed�Zdd�ZdS)raMA class that manages the comparison of 2 directories.

    dircmp(a, b, ignore=None, hide=None)
      A and B are directories.
      IGNORE is a list of names to ignore,
        defaults to DEFAULT_IGNORES.
      HIDE is a list of names to hide,
        defaults to [os.curdir, os.pardir].

    High level usage:
      x = dircmp(dir1, dir2)
      x.report() -> prints a report on the differences between dir1 and dir2
       or
      x.report_partial_closure() -> prints report on differences between dir1
            and dir2, and reports on common immediate subdirectories.
      x.report_full_closure() -> like report_partial_closure,
            but fully recursive.

    Attributes:
     left_list, right_list: The files in dir1 and dir2,
        filtered by hide and ignore.
     common: a list of names in both dir1 and dir2.
     left_only, right_only: names only in dir1, dir2.
     common_dirs: subdirectories in both dir1 and dir2.
     common_files: files in both dir1 and dir2.
     common_funny: names in both dir1 and dir2 where the type differs between
        dir1 and dir2, or the name is not stat-able.
     same_files: list of identical files.
     diff_files: list of filenames which differ.
     funny_files: list of files which could not be compared.
     subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.
     NcCsD||_||_|dkr$tjtjg|_n||_|dkr:t|_n||_dSr)�left�rightr�curdir�pardir�hider�ignore)�self�a�br-r,rrr�__init__xszdircmp.__init__cCsPtt�|j�|j|j�|_tt�|j�|j|j�|_|j�	�|j�	�dSr)
�_filterr�listdirr(r,r-�	left_listr)�
right_list�sort�r.rrr�phase0�s
�
�
z
dircmp.phase0cCs�ttttjj|j�|j��}ttttjj|j�|j��}tt|j	t
|j|���|_tt|j	t
|j|���|_tt|j	t
|j|���|_dSr)�dict�zip�mapr�path�normcaser4r5�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r.r/r0rrr�phase1�s
z
dircmp.phase1c
Cs4g|_g|_g|_|jD�]}tj�|j|�}tj�|j|�}d}zt�	|�}Wn&t
k
rv}zd}W5d}~XYnXzt�	|�}Wn&t
k
r�}zd}W5d}~XYnX|�r"t	�|j�}t	�|j�}	||	kr�|j�
|�n>t	�|�r�|j�
|�n&t	�|��r|j�
|�n|j�
|�q|j�
|�qdS)Nr
r)�common_dirs�common_files�common_funnyrBrr<�joinr(r)r�OSErrorrr�append�S_ISDIR�S_ISREG)
r.�xZa_pathZb_path�okZa_statZwhyZb_statZa_typeZb_typerrr�phase2�s4
z
dircmp.phase2cCs&t|j|j|j�}|\|_|_|_dSr)rr(r)rG�
same_files�
diff_files�funny_files)r.Zxxrrr�phase3�sz
dircmp.phase3cCsNi|_|jD]<}tj�|j|�}tj�|j|�}t|||j|j	�|j|<qdSr)
�subdirsrFrr<rIr(r)rr-r,)r.rNZa_xZb_xrrr�phase4�s

z
dircmp.phase4cCs$|��|j��D]}|��qdSr)rVrU�values�phase4_closure�r.ZsdrrrrX�szdircmp.phase4_closurecCs�td|j|j�|jr2|j��td|jd|j�|jrT|j��td|jd|j�|jrp|j��td|j�|jr�|j��td|j�|jr�|j��td|j�|j	r�|j	��td|j	�|j
r�|j
��td|j
�dS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr(r)rCr6rDrQrRrSrFrHr7rrr�report�s,






z
dircmp.reportcCs*|��|j��D]}t�|��qdSr)r\rUrWr[rYrrr�report_partial_closure�szdircmp.report_partial_closurecCs*|��|j��D]}t�|��qdSr)r\rUrWr[�report_full_closurerYrrrr^�szdircmp.report_full_closure)rUrQrRrSrFrGrHrBrCrDr4r5cCs*||jkrt|��|j||�t||�Sr)�	methodmap�AttributeError�getattr)r.�attrrrr�__getattr__�s
zdircmp.__getattr__)NN)�__name__�
__module__�__qualname__�__doc__r1r8rErPrTrVrXr\r]r^r9r_rcrrrrrVs2!
#
�cCsJgggf}|D]6}tj�||�}tj�||�}|t|||��|�q|S)a]Compare common files in two directories.

    a, b -- directory names
    common -- list of file names found in both directories
    shallow -- if true, do comparison based solely on stat() information

    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.

    )rr<rI�_cmprK)r/r0rBr�resrNZaxZbxrrrr�s
cCs0z|||||��WStk
r*YdSXdS)N�)rJ)r/r0Zsh�absrrrrrhsrhcCstt|j|��Sr)r>rrA)Zflist�skiprrrr2sr2cCsrddl}ddl}|�|jdd�d�\}}t|�dkrB|�dd��t|d|d�}d|krf|��n|��dS)Nrr
�rrjzneed exactly two args)z-r�)�sys�getopt�argvrZGetoptErrorrr^r\)rorpZoptions�argsZddrrr�demo$s
rs�__main__)T)T)rgrr�	itertoolsr�__all__r	r"rrrrrrrrkrhr2rsrdrrrr�<module>s6�
'
%
	reprlib.cpython-38.opt-1.pyc000064400000012271151450073350011600 0ustar00U

e5d��@s^dZdddgZddlZddlmZddlmZd
d	d�ZGd
d�d�Zdd�Z	e�Z
e
jZdS)zGRedo the builtin repr() (representation) but with limits on most sizes.�Repr�repr�recursive_repr�N)�islice)�	get_ident�...cs�fdd�}|S)zGDecorator to make a repr function return fillvalue for a recursive callcsXt�����fdd�}t�d�|_t�d�|_t�d�|_t�d�|_t�di�|_|S)Nc	sBt|�t�f}|�kr�S��|�z�|�}W5��|�X|S�N)�idr�add�discard)�self�key�result)�	fillvalue�repr_running�
user_function��/usr/lib64/python3.8/reprlib.py�wrappers
z<recursive_repr.<locals>.decorating_function.<locals>.wrapper�
__module__�__doc__�__name__�__qualname__�__annotations__)�set�getattrrrrrr)rr�r)rrr�decorating_functionsz+recursive_repr.<locals>.decorating_functionr)rrrrrr	sc@s~eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)N�����()�maxlevel�maxtuple�maxlist�maxarray�maxdict�maxset�maxfrozenset�maxdeque�	maxstring�maxlong�maxother)rrrr�__init__&sz
Repr.__init__cCs|�||j�Sr)�repr1r#)r�xrrrr3sz	Repr.reprcCsVt|�j}d|kr$|��}d�|�}t|d|�rFt|d|�||�S|�||�SdS)N� �_�repr_)�typer�split�join�hasattrr�
repr_instance)rr0�level�typename�partsrrrr/6s

z
Repr.repr1�c
s�t|�}|dkr|rd}nX|d�|j���fdd�t||�D�}	||krT|	�d�d�|	�}|dkrr|rr||}d|||fS)Nrr�csg|]}�|���qSrr)�.0�elem��newlevelr/rr�
<listcomp>Gsz'Repr._repr_iterable.<locals>.<listcomp>�, z%s%s%s)�lenr/r�appendr6)
rr0r9�left�right�maxiter�trail�n�s�piecesrr@r�_repr_iterable@s

zRepr._repr_iterablecCs|�||dd|jd�S)N�(�)�,)rMr$�rr0r9rrr�
repr_tupleMszRepr.repr_tuplecCs|�||dd|j�S)N�[�])rMr%rQrrr�	repr_listPszRepr.repr_listcCs,|sd|jSd|j}|�|||d|j�S)Nzarray('%s')z
array('%s', [�]))�typecoderMr&)rr0r9�headerrrr�
repr_arraySs

zRepr.repr_arraycCs$|sdSt|�}|�||dd|j�S)Nzset()�{�})�_possibly_sortedrMr(rQrrr�repr_setYsz
Repr.repr_setcCs$|sdSt|�}|�||dd|j�S)Nzfrozenset()zfrozenset({z}))r\rMr)rQrrr�repr_frozenset_s�zRepr.repr_frozensetcCs|�||dd|j�S)Nzdeque([rV)rMr*rQrrr�
repr_dequefszRepr.repr_dequecCs�t|�}|dkrdS|dkr dS|d}|j}g}tt|�|j�D].}|||�}||||�}	|�d||	f�qB||jkr�|�d�d�|�}
d|
fS)	Nrz{}z{...}r=z%s: %srrCz{%s})rDr/rr\r'rEr6)rr0r9rJrAr/rLr
�keyrepr�valreprrKrrr�	repr_dictis 



zRepr.repr_dictcCs�t�|d|j��}t|�|jkr�td|jdd�}td|jd|�}t�|d|�|t|�|d��}|d|�d|t|�|d�}|S�Nr��r)�builtinsrr+rD�max�rr0r9rK�i�jrrr�repr_strxs&$z
Repr.repr_strcCsht�|�}t|�|jkrdtd|jdd�}td|jd|�}|d|�d|t|�|d�}|Src)rfrrDr,rgrhrrr�repr_int�s
$z
Repr.repr_intcCs�zt�|�}Wn(tk
r6d|jjt|�fYSXt|�|jkr�td|jdd�}td|jd|�}|d|�d|t|�|d�}|S)Nz<%s instance at %#x>rrdrer)	rfr�	Exception�	__class__rr	rDr-rgrhrrrr8�s$zRepr.repr_instanceN)r<)rrrr.rr/rMrRrUrYr]r^r_rbrkrlr8rrrrr$s



	cCs,z
t|�WStk
r&t|�YSXdSr)�sortedrm�list)r0rrrr\�s
r\)r)r�__all__rf�	itertoolsr�_threadrrrr\�aReprrrrrr�<module>s

s	chunk.cpython-38.pyc000064400000011351151450073350010310 0ustar00U

e5d;�@sdZGdd�d�ZdS)aSimple class to read IFF chunks.

An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:

+----------------+
| ID (4 bytes)   |
+----------------+
| size (4 bytes) |
+----------------+
| data           |
| ...            |
+----------------+

The ID is a 4-byte string which identifies the type of chunk.

The size field (a 32-bit value, encoded using big-endian byte order)
gives the size of the whole chunk, including the 8-byte header.

Usually an IFF-type file consists of one or more chunks.  The proposed
usage of the Chunk class defined here is to instantiate an instance at
the start of each chunk and read from the instance until it reaches
the end, after which a new instance can be instantiated.  At the end
of the file, creating a new instance will fail with an EOFError
exception.

Usage:
while True:
    try:
        chunk = Chunk(file)
    except EOFError:
        break
    chunktype = chunk.getname()
    while True:
        data = chunk.read(nbytes)
        if not data:
            pass
        # do something with data

The interface is file-like.  The implemented methods are:
read, close, seek, tell, isatty.
Extra methods are: skip() (called by close, skips to the end of the chunk),
getname() (returns the name (ID) of the chunk)

The __init__ method has one required argument, a file-like object
(including a chunk instance), and one optional argument, a flag which
specifies whether or not chunks are aligned on 2-byte boundaries.  The
default is 1, i.e. aligned.
c@sZeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Zdd�Z	ddd�Z
dd�ZdS)�ChunkTFc	Cs�ddl}d|_||_|rd}nd}||_|�d�|_t|j�dkrFt�z |�|d|�d��d|_	Wn|j
k
r�td�YnX|r�|j	d|_	d|_z|j��|_
Wnttfk
r�d|_YnXd|_dS)	N�F�>�<��L�T)�struct�closed�align�file�read�	chunkname�len�EOFErrorZunpack_from�	chunksize�error�	size_read�tell�offset�AttributeError�OSError�seekable)�selfrr
Z	bigendianZ
inclheaderrZstrflag�r�/usr/lib64/python3.8/chunk.py�__init__4s, zChunk.__init__cCs|jS)z*Return the name (ID) of the current chunk.)r
�rrrr�getnameNsz
Chunk.getnamecCs|jS)z%Return the size of the current chunk.)rrrrr�getsizeRsz
Chunk.getsizecCs |jsz|��W5d|_XdS)NT)r	�skiprrrr�closeVszChunk.closecCs|jrtd��dS)N�I/O operation on closed fileF)r	�
ValueErrorrrrr�isatty]szChunk.isattyrcCsv|jrtd��|jstd��|dkr0||j}n|dkrB||j}|dksT||jkrXt�|j�|j	|d�||_dS)z�Seek to specified position into the chunk.
        Default position is 0 (start of chunk).
        If the file is not seekable, this will result in an error.
        r!zcannot seek��rN)
r	r"rrrr�RuntimeErrorr�seekr)r�pos�whencerrrr'bs
z
Chunk.seekcCs|jrtd��|jS)Nr!)r	r"rrrrrrusz
Chunk.tell���cCs�|jrtd��|j|jkrdS|dkr2|j|j}||j|jkrN|j|j}|j�|�}|jt|�|_|j|jkr�|jr�|jd@r�|j�d�}|jt|�|_|S)z�Read at most size bytes from the chunk.
        If size is omitted or negative, read until the end
        of the chunk.
        r!�rr$)r	r"rrrrrr
)r�size�data�dummyrrrrzs$��z
Chunk.readcCs�|jrtd��|jrnzD|j|j}|jr:|jd@r:|d}|j�|d�|j||_WdStk
rlYnX|j|jkr�t	d|j|j�}|�
|�}|snt�qndS)z�Skip the rest of the chunk.
        If you are not interested in the contents of the chunk,
        this method should be called so that the file points to
        the start of the next chunk.
        r!r$Ni )r	r"rrrr
rr'r�minrr)r�nr.rrrr�s"
z
Chunk.skipN)TTF)r)r*)�__name__�
__module__�__qualname__rrrr r#r'rrrrrrrr3s


rN)�__doc__rrrrr�<module>s2socket.cpython-38.pyc000064400000066215151450073350010501 0ustar00U

e5d���@sdZddlZddlTddlZddlZddlZddlZddlmZmZzddl	Z	Wne
k
rhdZ	YnXee	dd�Zee	dd�Z
ee	d	d�Zd
ddd
dddgZe�e�e��e�dedd��e�dedd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r$iZded<ded <d!ed"<d#ed$<d%ed&<d'ed(<d)ed*<d+ed,<d-ed.<d/ed0<d1ed2<d3ed4<d5ed6<d7ed8<d9ed:<d;ed<<d=ed><d?ed@<dAedB<dCedD<dEedF<dGedH<dIedJ<dKedL<dMedN<dOedP<dQedR<dSedT<dUedV<dWedX<dYedZ<d[ed\<d]ed^<d_ed`<daedb<dcedd<deedf<dgedh<diedj<dkedl<dmedn<doedp<dqedr<dsedt<duedv<dwedx<dyedz<d{ed|<d}ed~<ded�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<e�d١Gd�dۄd�e�ZGd�d݄d�ej�Zd�d�d
�Z e!ejd߃�rpd�d�Z"e�d�e!ed��r�de#dfd�d�Z$ne%e#dfd�d�Z$e�d�d�e$_e
ehZ&Gd�d�d�ej'�Z(d�d�d�Z)e*�Z+e+dfd�d�Z,d�d�Z-e%dd�d�d�d�d
�Z.d�d�d�Z/dS)�a0This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available as methods of the socket object.

Functions:

socket() -- create a new socket object
socketpair() -- create a pair of new socket objects [*]
fromfd() -- create a socket object from an open file descriptor [*]
fromshare() -- create a socket object from data received from socket.share() [*]
gethostname() -- return the current hostname
gethostbyname() -- map a hostname to its IP number
gethostbyaddr() -- map an IP number or hostname to DNS info
getservbyname() -- map a service name and a protocol name to a port number
getprotobyname() -- map a protocol name (e.g. 'tcp') to a number
ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order
htons(), htonl() -- convert 16, 32 bit int from host to network byte order
inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format
inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
create_connection() -- connects to an address, with an optional timeout and
                       optional source address.

 [*] not available on all platforms!

Special objects:

SocketType -- type object for socket objects
error -- exception raised for I/O errors
has_ipv6 -- boolean value indicating if IPv6 is supported

IntEnum constants:

AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)

Integer constants:

Many other constants may be defined; these may be used in calls to
the setsockopt() and getsockopt() methods.
�N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�/usr/lib64/python3.8/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_rrrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrVrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr[rz	127.0.0.1z::1cCs(z
||�WStk
r"|YSXdS)z{Convert a numeric family value to an IntEnum member.

    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converteras
r�winz)Specified event object handle is invalid.�zInsufficient memory available.�z#One or more parameters are invalid.�WzOverlapped operation aborted.i�z2Overlapped I/O event object not in signaled state.i�z)Overlapped operation will complete later.i�zThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i�'zHost not found.i�*z Nonauthoritative host not found.i�*zThis is a nonrecoverable error.i�*z*Valid name, no data record requested type.i�*zQoS receivers.i�*zQoS senders.i�*zNo QoS senders.i�*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i	+zInvalid QoS provider buffer.i
+zInvalid QoS filter style.i+i+zIncorrect QoS filter count.i
+zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+�errorTabc@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr"�sr"cs,eZdZdZdddgZd9dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zd:dddd�dd�Ze
ed�rzd;dd�Zn
d<dd�Zd=dd�Zd d!�Zd>d"d#�Zd$d%�Zejfd&d'�Zd(d)�Z�fd*d+�Ze�fd,d-��Ze�fd.d/��Zejd0k�rd1d2�Zd3d4�Znd5d2�Zd6d4�Zd7e_d8e_�ZS)?�socketz:A subclass of _socket.socket adding the makefile() method.�__weakref__�_io_refs�_closed���NcCsP|dkr,|dkrt}|dkr t}|dkr,d}tj�|||||�d|_d|_dS)Nr*rF)�AF_INET�SOCK_STREAM�_socketr&�__init__r(r))�self�family�type�proto�filenorrrr.�szsocket.__init__cCs|S�Nr�r/rrr�	__enter__�szsocket.__enter__cGs|js|��dSr4)r)�close)r/�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�z |��}|r^|dt	|�7}Wnt
k
rtYnXz |��}|r�|dt	|�7}Wnt
k
r�YnX|d7}|S)	zVWrap __repr__() to reveal the real class name and socket
        address(es).
        r)Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)�getattr�	__class__r$r%r3r0r1r2�getsockname�str�errorZgetpeername)r/�closed�sZladdrZraddrrrr�__repr__�s4
��zsocket.__repr__cCstd|jj�d���dS)Nzcannot pickle z object)�	TypeErrorr=r#r5rrr�__getstate__szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)z�dup() -> socket object

        Duplicate the socket. Return a new socket object connected to the same
        system resource. The new socket is non-inheritable.
        �r3)�dupr3r=r0r1r2�
settimeout�
gettimeout)r/�fd�sockrrrrGsz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dkr>|��r>|�d�||fS)z�accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket
        representing the connection, and the address of the client.
        For IP sockets, the address info is a pair (hostaddr, port).
        rFNT)Z_acceptr&r0r1r2ZgetdefaulttimeoutrI�setblocking)r/rJ�addrrKrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cst|�dddhks td|f��d|k}d|kp4|}|sB|sBt�d|k}d}	|rZ|	d7}	|rf|	d7}	t||	�}
|jd7_|dkr�d}|d	kr�tj}|d	kr�|s�td
��|
S|r�|r�t�|
|
|�}n&|r�t�|
|�}n|s�t�t�	|
|�}|r�|St�
||||�}||_|S)z�makefile(...) -> an I/O stream connected to the socket

        The arguments are as for io.open() after the filename, except the only
        supported mode values are 'r' (default), 'w' and 'b'.
        rO�w�bz&invalid mode %r (only r, w, b allowed)r:�Nr*rz!unbuffered streams must be binary)�setr�AssertionError�SocketIOr(�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r/r_�	bufferingrPrQrRZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile-s@
zsocket.makefile�sendfilerc
Cs�|�|||�|��}z|��}Wn0ttjfk
rR}zt|��W5d}~XYnXzt�|�j}Wn*t	k
r�}zt|��W5d}~XYnX|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
z�|	�r||	��st�d��|�r0||}|dk�r0�q�z|
||||�}Wn`tk
�rh|	�s`|�Yq�Yq�t	k
�r�}z|dk�r�t|��|d�W5d}~XYq�X|dk�r��q�||7}||7}q�|W�S|dk�r�t
|d��r�|�|�XdS)Nri@�&non-blocking sockets are not supported�PollSelector�seekz	timed out)�_check_sendfile_paramsr3�AttributeErrorrY�UnsupportedOperationr"�os�fstat�st_size�OSError�minrIr�hasattr�	selectorsrgZSelectSelector�registerZEVENT_WRITEZselectrerhr-�timeout�BlockingIOError)r/�file�offset�countZsocknor3�errZfsize�	blocksizertZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileYs^






zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r"�r/rvrwrxrrrr}�s�c

Cs�|�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�|rpt|||�}|dkrpq�t||��}|s�q�z||�}	Wnt	k
r�Yq�Yq�X||	7}|	t
|�kr�||	d�}q�qTq�qT|W�S|dkr�t|d�r�|�||�XdS)Nrrfi rh)rirIrrhrp�read�sendrq�
memoryviewru�len)
r/rvrwrxrzr{Z	file_readZ	sock_send�datar|rrr�_sendfile_use_send�s8

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`t|t�sJtd�|���|dkr`td�|���dS)NrTr_z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr1r,�
isinstance�intrD�formatr~rrrri�s

��zsocket._check_sendfile_paramscCs8z|�|||�WStk
r2|�|||�YSXdS)a_sendfile(file[, offset[, count]]) -> sent

        Send a file until EOF is reached by using high-performance
        os.sendfile() and return the total number of bytes which
        were sent.
        *file* must be a regular file object opened in binary mode.
        If os.sendfile() is not available (e.g. Windows) or file is
        not a regular file socket.send() will be used instead.
        *offset* tells from where to start reading the file.
        If specified, *count* is the total number of bytes to transmit
        as opposed to sending the file until EOF is reached.
        File position is updated on return or also in case of error in
        which case file.tell() can be used to figure out the number of
        bytes which were sent.
        The socket must be of SOCK_STREAM type.
        Non-blocking sockets are not supported.
        N)r}r"r�r~rrrre�szsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrU)r(r)r7r5rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dSr4)r7)r/Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r)r(r�r5rrrr7�s
zsocket.closecsd|_t���S)adetach() -> file descriptor

        Close the socket object without closing the underlying file descriptor.
        The object cannot be used after this call, but the file descriptor
        can be reused for other purposes.  The file descriptor is returned.
        T)r)�super�detachr5�r=rrr��sz
socket.detachcstt�jt�S)z@Read-only access to the address family for this socket.
        )rr�r0rr5r�rrr0sz
socket.familycstt�jt�S)z-Read-only access to the socket type.
        )rr�r1rr5r�rrr1szsocket.type�ntcCst�|���Sr4)rlZget_handle_inheritabler3r5rrr�get_inheritable
szsocket.get_inheritablecCst�|��|�dSr4)rlZset_handle_inheritabler3�r/Zinheritablerrr�set_inheritableszsocket.set_inheritablecCst�|���Sr4)rlr�r3r5rrrr�scCst�|��|�dSr4)rlr�r3r�rrrr�sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r*r*r*N)rON)rN)rN)rN)rN) r#r$r%�__doc__�	__slots__r.r6r9rCrErGrNrdrqrlr}r�rirer�r-r&r�r7r��propertyr0r1�namer�r��
__classcell__rrr�rr&�sF

�*
A

$


r&cCst|�}t||||�S)z� fromfd(fd, family, type[, proto]) -> socket object

    Create a socket object from a duplicate of the given file
    descriptor.  The remaining arguments are the same as for socket().
    )rGr&)rJr0r1r2Znfdrrrr
sZsharecCstddd|�S)z� fromshare(info) -> socket object

        Create a socket object from the bytes object returned by
        socket.share(pid).
        r)r&)�inforrr�	fromshare#sr��
socketpaircCsh|dkr*zt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fS)aasocketpair([family[, type[, proto]]]) -> (socket object, socket object)

        Create a pair of socket objects from the sockets returned by the platform
        socketpair() function.
        The arguments are the same as for socket() except the default family is
        AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
        N)ZAF_UNIX�	NameErrorr+r-r�r&r�)r0r1r2�arTrrrr�.s
c
	Cs|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|�	�|�
�dd�\}}t|||�}zP|�d�z|�||f�Wnt
tfk
r�YnX|�d�|��\}}	Wn|���YnXW5|��X||fS)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FT)r+�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6rr,r&r7�bind�listenr>rL�connectru�InterruptedErrorrN)
r0r1r2�hostZlsockrM�portZcsockZssock�_rrrr�Cs8


a8socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
cspeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Z�fdd
�Z	dd�Z
edd��Zedd��Z
dd�Z�ZS)rXz�Raw I/O implementation for stream sockets.

    This class supports the makefile() method on sockets.  It provides
    the raw I/O interface on top of a socket object.
    cCsZ|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_d|_dS)N)rOrSZrw�rb�wbZrwbzinvalid mode: %rrTrOrSF)	rrY�	RawIOBaser.�_sock�_mode�_reading�_writing�_timeout_occurred)r/rKr_rrrr.�s

zSocketIO.__init__c
Cs�|��|��|jrtd��z|j�|�WStk
rHd|_�Yqtk
r�}z|jdt	krpWY�
dS�W5d}~XYqXqdS)a3Read up to len(b) bytes into the writable buffer *b* and return
        the number of bytes read.  If the socket is non-blocking and no bytes
        are available, None is returned.

        If *b* is non-empty, a 0 return value indicates that the connection
        was shutdown at the other end.
        z!cannot read from timed out objectTrN)
�_checkClosed�_checkReadabler�ror�Z	recv_intortr@r8�_blocking_errnos�r/rT�errr�readinto�s
zSocketIO.readintoc
Cs`|��|��z|j�|�WStk
rZ}z|jdtkrHWY�
dS�W5d}~XYnXdS)aWrite the given bytes or bytearray object *b* to the socket
        and return the number of bytes written.  This can be less than
        len(b) if not all data could be written.  If the socket is
        non-blocking and no bytes could be written None is returned.
        rN)r��_checkWritabler�r�r@r8r�r�rrr�write�s
zSocketIO.writecCs|jrtd��|jS)z2True if the SocketIO is open for reading.
        �I/O operation on closed socket.)rArr�r5rrr�readable�szSocketIO.readablecCs|jrtd��|jS)z2True if the SocketIO is open for writing.
        r�)rArr�r5rrr�writable�szSocketIO.writablecs|jrtd��t���S)z2True if the SocketIO is open for seeking.
        r�)rArr��seekabler5r�rrr��szSocketIO.seekablecCs|��|j��S)z=Return the file descriptor of the underlying socket.
        )r�r�r3r5rrrr3�szSocketIO.filenocCs|js|��SdSdS)Nr*)rAr3r5rrrr��sz
SocketIO.namecCs|jSr4)r�r5rrrr_�sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dS)z�Close the SocketIO object.  This doesn't close the underlying
        socket, except if all references to it have disappeared.
        N)rArYr�r7r�r�r5rrrr7�s

zSocketIO.close)r#r$r%r�r.r�r�r�r�r�r3r�r�r_r7r�rrr�rrXrs

rXr:cCsl|��}|r|dkrt�}zt|�\}}}Wntk
r@Yn(X|�d|�|D]}d|krRqhqR|}|S)aGet fully qualified domain name from name.

    An empty argument is interpreted as meaning the local host.

    First the hostname returned by gethostbyaddr() is checked, then
    possibly existing aliases. In case no FQDN is available, hostname
    from gethostname() is returned.
    z0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrr�s	cCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|tk	rP|�|�|r^|�|�|�|�d}|WStk
r�}
z|
}|dk	r�|��W5d}
~
XYqXq|dk	r�z|�W5d}Xntd��dS)acConnect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    A host of '' or port 0 tells the OS to use the default.
    Nrz!getaddrinfo returns an empty list)	�getaddrinfor,r&�_GLOBAL_DEFAULT_TIMEOUTrHr�r�r@r7)�addressrtZsource_addressr�r�ry�res�af�socktyper2�	canonname�sarKr�rrrrs.



c	Csltrttd�rttd�sdSz4ttt�� }|�ttd�W5QR�WdSQRXWnt	k
rfYdSXdS)z�Return True if the platform supports creating a SOCK_STREAM socket
    which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections.
    �IPPROTO_IPV6�IPV6_V6ONLYFrTN)
�has_ipv6rqr-r&r�r,�
setsockoptr�r�r@)rKrrrr0s��F)r0�backlog�
reuse_port�dualstack_ipv6c
Csn|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdkr�ttd�r�z|�	t
td�Wntk
r�YnX|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�Wn@tk
�r$}z d|j|f}t|j|�d�W5d}~XYnX|dk�r:|��n
|�|�|WStk
�rh|���YnXdS)
a�Convenience function which creates a SOCK_STREAM type socket
    bound to *address* (a 2-tuple (host, port)) and return the socket
    object.

    *family* should be either AF_INET or AF_INET6.
    *backlog* is the queue size passed to socket.listen().
    *reuse_port* dictates whether to use the SO_REUSEPORT socket option.
    *dualstack_ipv6*: if true and the platform supports it, it will
    create an AF_INET6 socket able to accept both IPv4 or IPv6
    connections. When false it will explicitly disable this option on
    platforms that enable it by default (e.g. Linux).

    >>> with create_server(('', 8000)) as server:
    ...     while True:
    ...         conn, addr = server.accept()
    ...         # handle new connection
    �SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)r��cygwin�SO_REUSEADDRrUrr�r�z+%s (while attempting to bind on address %r)N)rqr-rrr�r&r,rlr�r�Z
SOL_SOCKETr�r@r�r�r�r�r��strerror�errnor�r7)r�r0r�r�r�rKry�msgrrrr
@sN


�
�� 


cCsPg}t�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�q|S)a�Resolve host and port into list of address info entries.

    Translate the host/port argument into a sequence of 5-tuples that contain
    all the necessary arguments for creating a socket connected to that service.
    host is a domain name, a string representation of an IPv4/v6 address or
    None. port is a string service name such as 'http', a numeric port number or
    None. By passing None as the value of host and port, you can pass NULL to
    the underlying C API.

    The family, type and proto arguments can be optionally specified in order to
    narrow the list of addresses returned. Passing zero as a value for each of
    these arguments selects the full range of results.
    )r-r��appendrrr)r�r�r0r1r2�flagsZaddrlistr�r�r�r�r�rrrr��s�r�)r)r:)rrrr)0r�r-rl�sysrYrr�enumrrr��ImportErrorr<rrr	�__all__�extend�_get_exports_list�	_convert_r#r�r�rr&Z_realsocket�platform�lowerrr!r��	Exceptionr"r
rqr�r,r�r+r�r�rXr�objectr�rrr
r�rrrr�<module>sH- 
�����

F
	
$
u
�
-�Esysconfig.cpython-38.pyc000064400000036751151450073350011217 0ustar00U

��.e@a�
@sdZddlZddlZddlmZmZdddddd	d
ddd
dgZdhZddddddddd�ddddddddd�ddddddd dd�d!d!d"d"d#d$d%d&�d'd'd(d)d*d+d%d&�d,d,d-d-d.d+d%d&�d/�Zd&Z	ej
��dZd0ej
dd1�Zd2ej
dd1�Zej�ej�Zej�ej�Zej�ej�Zej�ej�ZdadZd3d4�Zej�rVej�eej��Znee� ��Zej!d5k�r�e�"��#d6��r�eej�$eee��Zd7ej%k�r�eej%d7�Zd8d9�Z&e'ed:d�Z(ej!d5k�r�d;d<�Z)e)e�Ze)e(�Z(djd>d?�Z*e*d@�Z+e+�r dAD]Z,dBee,dC<dDee,dE<�qdFdG�Z-dHdI�Z.dJdK�Z/dLdM�Z0dNdO�Z1dkdPdQ�Z2dRd�Z3dSdT�Z4dUdV�Z5dWdX�Z6dYdZ�Z7dld[d�Z8d\d�Z9d]d
�Z:d^d	�Z;e0�dd@fd_d
�Z<e0�dd@fd`d�Z=dad�Z>dbd�Z?dcd�Z@ddd�ZAdedf�ZBdgdh�ZCeDdik�reC�dS)mz-Access to Python's configuration information.�N)�pardir�realpath�get_config_h_filename�get_config_var�get_config_vars�get_makefile_filename�get_path�get_path_names�	get_paths�get_platform�get_python_version�get_scheme_names�parse_config_hZMACOSX_DEPLOYMENT_TARGETz/{installed_base}/lib64/python{py_version_short}z){platbase}/lib64/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz7{platbase}/lib64/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z
{base}/binz{base})�stdlib�
platstdlib�purelib�platlib�include�platinclude�scripts�dataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz
{base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scriptsz#{userbase}/Python{py_version_nodot}z1{userbase}/Python{py_version_nodot}/site-packagesz+{userbase}/Python{py_version_nodot}/Includez+{userbase}/Python{py_version_nodot}/Scriptsz
{userbase})rrrrrrrz){userbase}/lib64/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz7{userbase}/lib64/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packagesz{userbase}/include)�posix_prefix�
posix_home�ntZnt_userZ
posix_userZosx_framework_user�%d.%d�z%d%dcCs(z
t|�WStk
r"|YSXdS�N)r�OSError)�path�r�!/usr/lib64/python3.8/sysconfig.py�_safe_realpathis
r!r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�osr�isfile�join)�d�fnrrr �_is_python_source_dir~sr'�_homecCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)r"r�normcase�
startswithr$�_PREFIX)r%rrr �_fix_pcbuild�s
�r,FcCs|rtrtt�Stt�Sr)�	_sys_homer'�
_PROJECT_BASE)Z
check_homerrr �is_python_build�sr/T)rrz{srcdir}/Includerz{projectbase}/.rc
Csnz|jf|�WStk
rhz|jftj�WYStk
rb}ztd|�d�W5d}~XYnXYnXdS)Nz{%s})�format�KeyErrorr"�environ�AttributeError)�sZ
local_vars�varrrr �_subst_vars�sr6cCs0|��}|��D]\}}||kr"q|||<qdSr)�keys�items)Ztarget_dictZ
other_dictZtarget_keys�key�valuerrr �_extend_dict�s
r;cCsbi}|dkri}t|t��t|��D]4\}}tjdkrFtj�|�}tj�t	||��||<q(|S)N)�posixr)
r;r�_INSTALL_SCHEMESr8r"�namer�
expanduser�normpathr6)�scheme�vars�resr9r:rrr �_expand_vars�s
rDcCstjdkrdStjS)Nr<r)r"r>rrrr �_get_default_scheme�s
rEcCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)r"rr?r$)�argsrrr �joinuser�sz_getuserbase.<locals>.joinuserr�APPDATA�~�Python�darwin�Libraryrrz.local)r"r2�getr>�sys�platform�
_framework�version_info)�env_baserH�baserrr �_getuserbase�s


�rUc	Cs`ddl}|�d�}|�d�}|�d�}|dkr2i}i}i}t|dd��}|��}	W5QRX|	D]�}
|
�d�s^|
��d	krzq^|�|
�}|r^|�d
d�\}}
|
��}
|
�dd	�}d
|kr�|
||<q^z|t	kr�t
�t|
�}
Wn$t
k
r�|
�dd
�||<Yq^X|
||<q^t|�
��}d}t|�dk�r&t|�D�]�}||}|�|�}|�|�}|�rv|�rv|��|��k�rp|n|}n|�r�|n|}|dk	�r|�d
�}d}||k�r�t||�}n�||k�r�d}nx|tjk�r�tj|}n`||k�r0|�d��r
|dd�|k�r
d	}n$d||k�rd}nt|d|�}nd	||<}|�r||��d�}|d|���||}d
|k�r~|||<n�z|t	k�r�t
�t|�}Wn"t
k
�r�|��||<Yn
X|||<|�|�|�d��r|dd�|k�r|dd�}||k�r|||<n|||<|�|��q,�q|��D]"\}}
t|
t��r.|
��||<�q.|�|�|S)z�Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    rNz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}�surrogateescape)�errors�#��rz$$�$)ZCFLAGSZLDFLAGSZCPPFLAGSTFZPY_�)�re�compile�open�	readlinesr*�strip�match�group�replace�_ALWAYS_STR�
ValueError�int�listr7�len�tuple�search�start�strr"r2�end�remover8�
isinstance�update)�filenamerBr]Z_variable_rxZ_findvar1_rxZ_findvar2_rxZdoneZnotdone�f�lines�line�m�n�vZtmpvZ	variablesZrenamed_variablesr>r:Zm1Zm2�found�itemZafter�krrr �_parse_makefile�s�	












�



�


r|cCsdtrtj�tptd�Sttd�r0dttj	f}nd}ttj
d�rP|dtj
j7}tj�td�|d�S)z Return the path of the Makefile.ZMakefile�abiflagszconfig-%s%sZconfig�
_multiarchz-%sr)
�
_PYTHON_BUILDr"rr$r-r.�hasattrrO�_PY_VERSION_SHORTr}�implementationr~r)Zconfig_dir_namerrr rWs
c
Cs(tj�ddjtjtjttjdd�d��S)NZ_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}r~rY)ZabirPZ	multiarch)	r"r2rNr0rOr}rP�getattrr�rrrr �_get_sysconfigdata_nameds��r�c
Cs�ddl}i}t�}zt||�WnJtk
rj}z,d|}t|d�rR|d|j}t|��W5d}~XYnXt�}z"t|��}t||�W5QRXWnJtk
r�}z,d|}t|d�r�|d|j}t|��W5d}~XYnXt	r�|d|d<t
�}dtjk�r$ddl
}|�|�}	||	_|	tj|<d	t�tf}
ttd
��rF|
d7}
tj|
dd
�tj�|
|d�}t|ddd��(}|�d�|�d�|j||d�W5QRXtdddd��}|�|
�W5QRXdS)z;Generate the Python module containing build-time variables.rNz.invalid Python installation: unable to open %s�strerrorz (%s)ZLDSHAREDZ	BLDSHAREDrLzbuild/lib.%s-%sZgettotalrefcountz-pydebugT)�exist_okz.py�w�utf8)�encodingzB# system configuration generated and used by the sysconfig module
zbuild_time_vars = )�streamzpybuilddir.txt)�pprintrr|rr�r�rr_rrr�rOrP�types�
ModuleType�build_time_vars�modulesrr�r"�makedirsrr$�write)r�rBZmakefile�e�msgZconfig_hrsr>r��moduleZ
pybuilddirZdestfilerrr �_generate_posix_varsmsL







r�cCs0t�}t|t�t�dgd�}|j}|�|�dS)z7Initialize the module as appropriate for POSIX systems.r�rN)r��
__import__�globals�localsr�rq)rBr>Z_tempr�rrr �_init_posix�sr�cCsfddl}td�|d<td�|d<td�|d<|��d|d	<d
|d<t|d<tj�ttj	��|d
<dS)z+Initialize the module as appropriate for NTrNrZLIBDESTrZ
BINLIBDESTrZ	INCLUDEPY�
EXT_SUFFIXz.exeZEXEZVERSIONZBINDIR)
�_impr�extension_suffixes�_PY_VERSION_SHORT_NO_DOTr"r�dirnamer!rO�
executable)rBr�rrr �_init_non_posix�sr�c	Cs�|dkri}ddl}|�d�}|�d�}|��}|s6q�|�|�}|r�|�dd�\}}z|tkrbt�t|�}Wntk
r�YnX|||<q(|�|�}|r(d||�d�<q(|S)z�Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nrz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rZr)r]r^�readlinerbrcrerfrg)	�fprBr]Z	define_rxZundef_rxrurvrwrxrrr r�s,




cCsBtr,tjdkr"tj�tptd�}q4tp(t}ntd�}tj�|d�S)zReturn the path of pyconfig.h.rZPCrz
pyconfig-64.h)rr"r>rr$r-r.r)Zinc_dirrrr r�s

cCsttt��S)z,Return a tuple containing the schemes names.)rj�sortedr=rrrr r
�scCstS)z*Return a tuple containing the paths names.)�_SCHEME_KEYSrrrr r	�scCs|rt||�St|SdS)z�Return a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    N)rDr=)rArB�expandrrr r
�s
cCst|||�|S)z[Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    )r
)r>rArBr�rrr r	scGsxtdk�rFiattd<ttd<ttd<ttd<ttd<ttd<ttd<ttd	<ttd
<ttd<zt	j
td<Wntk
r�d
td<YnXtj
dkr�tt�tj
dkr�tt�t�d�}|dk	r�|td<t�td<t�dt�}tj
dk�rt�rtj�t��}tj�||�}ntj�t��}t|�td<t	jdk�rFddl}|�t�|�rpg}|D]}|�t�|���qT|StSdS)anWith no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    N�prefix�exec_prefixZ
py_versionZpy_version_shortZpy_version_nodotZinstalled_baserTZinstalled_platbaseZplatbaseZprojectbaser}rYrr<r��SO�userbase�srcdirrLr)�_CONFIG_VARSr+�_EXEC_PREFIX�_PY_VERSIONr�r��_BASE_PREFIX�_BASE_EXEC_PREFIXr.rOr}r3r"r>r�r�rNrUrrr�rr$r!rP�_osx_supportZcustomize_config_vars�append)rGr�r�rTr�Zvalsr>rrr rsP





cCs*|dkrddl}|�dtd�t��|�S)z�Return the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    r�rNz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningrrN)r>r�rrr r^sc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjStjdksZttd	�s`tjSd
tjkrttjd
St��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd |||fS|dd!�d"k�r�d"}ddl}|�
d#�}|�|�}|�r�|��}n2|dd!�d$k�r�ddl}	|	�t�|||�\}}}d%|||fS)&a�Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name and
    version and the architecture (as supplied by 'os.uname()'), although the
    exact information included depends on the OS; on Linux, the kernel version
    isn't particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    rZamd64z	win-amd64z(arm)z	win-arm32z(arm64)z	win-arm64r<�unameZ_PYTHON_HOST_PLATFORM�/rY� �_�-N�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%sr\rZ32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+rLz%s-%s-%s)r"r>rO�version�lowerrPr�r2r�rdrg�maxsizer]r^rbrcr�Zget_platform_osxr)
ZosnameZhost�releaser��machineZbitnessr]Zrel_rervr�rrr rjsT


 



�
cCstSr)r�rrrr r�scCsFtt|����D]0\}\}}|dkr0td|�td||f�qdS)Nrz%s: z
	%s = "%s")�	enumerater�r8�print)�titler�indexr9r:rrr �_print_dict�sr�cCsfdtjkrt�dStdt��tdt��tdt��t�tdt��t�tdt	��dS)z*Display all information sysconfig detains.z--generate-posix-varsNzPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ	Variables)
rO�argvr�r�rrrEr�r
rrrrr �_main�s
r��__main__)F)N)N)E�__doc__r"rOZos.pathrr�__all__rer=r�r��splitr�rRr�r�rr@r�r+�base_prefixr�r�r��base_exec_prefixr�r�Z
_USER_BASEr!r�r�r.�getcwdr>r��endswithr$r2r'r�r-r,r/rrAr6r;rDrErUr|rr�r�r�r�rrr
r	r
rrrrrr�r��__name__rrrr �<module>s����
���
�
��?�
	
	

	?
"MP
netrc.cpython-38.opt-2.pyc000064400000006725151450073350011264 0ustar00U

e5d��@sTddlZddlZddlZddgZGdd�de�ZGdd�d�ZedkrPee��dS)�N�netrc�NetrcParseErrorc@seZdZddd�Zdd�ZdS)rNcCs"||_||_||_t�||�dS)N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r
�/usr/lib64/python3.8/netrc.pyrszNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r	r
r
r�__str__szNetrcParseError.__str__)NN)�__name__�
__module__�__qualname__rrr
r
r
rr
s
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNc	CsX|dk}|dkr&tj�tj�d�d�}i|_i|_t|��}|�|||�W5QRXdS)N�~z.netrc)�os�path�join�
expanduser�hosts�macros�open�_parse)r	�file�
default_netrc�fpr
r
rrs
znetrc.__init__cCs�t�|�}|jd7_|j�dd�|_|j}|��}}|sD�q�n�|ddkrt|j|kr(t|�dkr(|j��q(n�|dkr�|��}nt|dkr�d}nf|dkr�|��}g|j	|<d	|_
|j��}	|	r�|	d
kr�d|_
q(|j	|�|	�q�q(ntd|||j��d}
d}}i|j
|<|��}|�d��s.|d
k�rr|�rR|
||f|j
|<|�|�q(ntd||t|�f||j���q|dk�s�|dk�r�|��}
�q|dk�r�|��}�q|dk�r�tjdk�r�|�r�t�|���}
|
jt��k�rpddl}z|�|
j�d}Wn tk
�rd|
j}YnXz|�t���d}Wn"tk
�rXdt��}YnXtd||f||j��|
jtjtjB@�r�td||j��|��}ntd|||j���qq(dS)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#�r��machine�default�macdefz 	�
z 	
zbad toplevel token %r>rr!r rz&malformed %s entry %s terminated by %s�login�user�account�password�posixzuid %sz9~/.netrc file owner (%s) does not match current user (%s)zY~/.netrc access too permissive: access permissions must restrict access to only the ownerzbad follower token %r)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuid�KeyError�st_mode�stat�S_IRWXG�S_IRWXO)r	rrrZlexerZsaved_linenoZtoplevelZttZ	entryname�liner#r%r&Zpropr4Zfownerr$r
r
rr s�




�
�
��

���
�znetrc._parsecCs0||jkr|j|Sd|jkr(|jdSdSdS)Nr )r)r	�hostr
r
r�authenticatorsqs




znetrc.authenticatorscCs�d}|j��D]X}|j|}|d|�d|d�d�7}|drR|d|d�d�7}|d|d	�d�7}q|j��D]4}|d
|�d�7}|j|D]}||7}q�|d7}qr|S)Nrzmachine z
	login rr"rz		account z
	password �zmacdef )r�keysr)r	Zrepr<�attrsZmacror;r
r
r�__repr__zs


znetrc.__repr__)N)r
rrrrr=rAr
r
r
rrs
	Q	�__main__)	rr(r8�__all__rrrr
�printr
r
r
r�<module>s
tasyncore.cpython-38.pyc000064400000037236151450073350011035 0ustar00U

e5d~N�@shdZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZeee
eeeeh�ZzeWnek
r�iZYnXdd�ZGdd�de�ZeeefZdd	�Zd
d�Z dd
�Z!dd�Z"d&dd�Z#d'dd�Z$e$Z%d(dd�Z&Gdd�d�Z'Gdd�de'�Z(dd�Z)d)dd �Z*ej+d!k�rdGd"d#�d#�Z,Gd$d%�d%e'�Z-dS)*a�Basic infrastructure for asynchronous socket service clients and servers.

There are only two ways to have a program on a single processor do "more
than one thing at a time".  Multi-threaded programming is the simplest and
most popular way to do it, but there is another very different technique,
that lets you have nearly all the advantages of multi-threading, without
actually using multiple threads. it's really only practical if your program
is largely I/O bound. If your program is CPU bound, then pre-emptive
scheduled threads are probably what you really need. Network servers are
rarely CPU-bound, however.

If your operating system supports the select() system call in its I/O
library (and nearly all do), then you can use it to juggle multiple
communication channels at once; doing other work while your I/O is taking
place in the "background."  Although this strategy can seem strange and
complex, especially at first, it is in many ways easier to understand and
control than multi-threaded programming. The module documented here solves
many of the difficult problems for you, making the task of building
sophisticated high-performance network servers and clients a snap.
�N)
�EALREADY�EINPROGRESS�EWOULDBLOCK�
ECONNRESET�EINVAL�ENOTCONN�	ESHUTDOWN�EISCONN�EBADF�ECONNABORTED�EPIPE�EAGAIN�	errorcodec
CsHzt�|�WStttfk
rB|tkr6t|YSd|YSXdS)NzUnknown error %s)�os�strerror�
ValueError�
OverflowError�	NameErrorr)�err�r� /usr/lib64/python3.8/asyncore.py�	_strerrorDsrc@seZdZdS)�ExitNowN)�__name__�
__module__�__qualname__rrrrrLsrcCs:z|��Wn(tk
r"�Yn|��YnXdS�N)�handle_read_event�_reraised_exceptions�handle_error��objrrr�readQsr"cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_write_eventrrr rrr�writeYsr$cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_expt_eventrrr rrr�
_exceptionasr&c
Cs�zX|tj@r|��|tj@r&|��|tj@r8|��|tjtjBtj	B@rV|�
�Wnhtk
r�}z$|jdt
kr�|��n|�
�W5d}~XYn(tk
r��Yn|��YnXdS�Nr)�select�POLLINr�POLLOUTr#�POLLPRIr%ZPOLLHUPZPOLLERRZPOLLNVAL�handle_close�OSError�args�
_DISCONNECTEDrr)r!�flags�errr�	readwriteis"



r2�c	Cs<|dkrt}|�r8g}g}g}t|���D]L\}}|��}|��}|rP|�|�|rd|jsd|�|�|sl|r*|�|�q*g|kr�|kr�|kr�nnt�|�dSt	�	||||�\}}}|D] }|�
|�}|dkr�q�t|�q�|D]"}|�
|�}|dk�rq�t|�q�|D]&}|�
|�}|dk�r,�qt
|��qdSr)�
socket_map�list�items�readable�writable�append�	accepting�time�sleepr(�getr"r$r&)	�timeout�map�r�wr1�fdr!Zis_rZis_wrrr�poll}sD


"







rCcCs�|dkrt}|dk	r t|d�}t��}|r�t|���D]L\}}d}|��r\|tjtjBO}|�	�rt|j
st|tjO}|r8|�||�q8|�|�}|D]&\}}|�
|�}|dkr�q�t||�q�dS)Ni�r)r4�intr(rCr5r6r7r)r+r8r:r*�registerr=r2)r>r?ZpollsterrBr!r0r@rrr�poll2�s(


rF�>@FcCsb|dkrt}|r ttd�r t}nt}|dkr>|r^|||�q,n |r^|dkr^|||�|d}q>dS)NrCr�)r4�hasattrr(rFrC)r>Zuse_pollr?�countZpoll_funrrr�loop�s
rKc@s2eZdZdZdZdZdZdZdZe	dh�Z
dAdd�Zdd�ZdBdd	�Z
dCd
d�Zejejfdd
�ZdDdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdEd'd(�Zd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#d1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'd9d:�Z(d;d<�Z)d=d>�Z*d?d@�Z+dS)F�
dispatcherFN�warningc
Cs�|dkrt|_n||_d|_|r�|�d�|�||�d|_z|��|_Wq�tk
r�}z*|j	dt
tfkrvd|_n|�|��W5d}~XYq�Xnd|_
dS�NrTF)r4�_map�_fileno�setblocking�
set_socket�	connectedZgetpeername�addrr-r.rr�del_channel�socket)�self�sockr?rrrr�__init__�s 

zdispatcher.__init__cCs�|jjd|jjg}|jr.|jr.|�d�n|jr>|�d�|jdk	r�z|�d|j�Wn$tk
r�|�t|j��YnXdd�	|�t
|�fS)N�.Z	listeningrSz%s:%dz<%s at %#x>� )�	__class__rrr:rTr9rS�	TypeError�repr�join�id)rWZstatusrrr�__repr__�s

zdispatcher.__repr__cCs|dkr|j}|||j<dSr)rOrP)rWr?rrr�add_channel	szdispatcher.add_channelcCs,|j}|dkr|j}||kr"||=d|_dSr)rPrO)rWr?rBrrrrUszdispatcher.del_channelcCs.||f|_t�||�}|�d�|�|�dSr')Zfamily_and_typerVrQrR)rWZfamily�typerXrrr�
create_sockets

zdispatcher.create_socketcCs||_|��|_|�|�dSr)rV�filenorPrb�rWrXr?rrrrRs
zdispatcher.set_socketcCsDz*|j�tjtj|j�tjtj�dB�Wntk
r>YnXdS)NrH)rVZ
setsockopt�
SOL_SOCKETZSO_REUSEADDR�
getsockoptr-�rWrrr�set_reuse_addr#s
���zdispatcher.set_reuse_addrcCsdS�NTrrirrrr74szdispatcher.readablecCsdSrkrrirrrr87szdispatcher.writablecCs(d|_tjdkr|dkrd}|j�|�S)NT�nt�)r:r�namerV�listen)rWZnumrrrro>szdispatcher.listencCs||_|j�|�Sr)rTrV�bind)rWrTrrrrpDszdispatcher.bindcCspd|_d|_|j�|�}|tttfks8|tkrBtj	dkrB||_
dS|dtfkr^||_
|��nt
|t|��dS)NFTrlr)rS�
connectingrVZ
connect_exrrrrrrnrTr	�handle_connect_eventr-r)rWZaddressrrrr�connectHs��
zdispatcher.connectc
Csvz|j��\}}WnVtk
r(YdStk
rh}z$|jdtttfkrVWY�
dS�W5d}~XYn
X||fSdSr')rV�acceptr]r-r.rrr
)rWZconnrT�whyrrrrtVs
zdispatcher.acceptc
Cstz|j�|�}|WStk
rn}z>|jdtkr<WY�*dS|jdtkr\|��WY�
dS�W5d}~XYnXdSr')rV�sendr-r.rr/r,)rW�data�resultrurrrrvds

zdispatcher.sendc
Csrz(|j�|�}|s |��WdS|WSWnDtk
rl}z&|jdtkrZ|��WY�
dS�W5d}~XYnXdS)N�r)rV�recvr,r-r.r/)rWZbuffer_sizerwrurrrrzqs

zdispatcher.recvc
Csnd|_d|_d|_|��|jdk	rjz|j��Wn6tk
rh}z|jdtt	fkrX�W5d}~XYnXdS)NFr)
rSr:rqrUrV�closer-r.rr
)rWrurrrr{�s
zdispatcher.closecCstj�dt|��dS)Nzlog: %s
)�sys�stderrr$�str)rW�messagerrr�log�szdispatcher.log�infocCs||jkrtd||f�dS)Nz%s: %s)�ignore_log_types�print)rWrrcrrr�log_info�s
zdispatcher.log_infocCs:|jr|��n&|js.|jr$|��|��n|��dSr)r:�
handle_acceptrSrqrr�handle_readrirrrr�s

zdispatcher.handle_read_eventcCs@|j�tjtj�}|dkr(t|t|���|��d|_d|_dSrN)	rVrhrg�SO_ERRORr-r�handle_connectrSrq�rWrrrrrr�szdispatcher.handle_connect_eventcCs*|jr
dS|js|jr|��|��dSr)r:rSrqrr�handle_writerirrrr#�szdispatcher.handle_write_eventcCs0|j�tjtj�}|dkr$|��n|��dSr')rVrhrgr�r,�handle_exptr�rrrr%�s
zdispatcher.handle_expt_eventcCsXt�\}}}}zt|�}Wndt|�}YnX|�d||||fd�|��dS)Nz)<__repr__(self) failed for object at %0x>z:uncaptured python exception, closing channel %s (%s:%s %s)�error)�compact_tracebackr^r`r�r,)rWZnil�t�v�tbinfoZ	self_reprrrrr�s��	zdispatcher.handle_errorcCs|�dd�dS)Nz!unhandled incoming priority eventrM�r�rirrrr��szdispatcher.handle_exptcCs|�dd�dS)Nzunhandled read eventrMr�rirrrr��szdispatcher.handle_readcCs|�dd�dS)Nzunhandled write eventrMr�rirrrr��szdispatcher.handle_writecCs|�dd�dS)Nzunhandled connect eventrMr�rirrrr��szdispatcher.handle_connectcCs|��}|dk	r|j|�dSr)rt�handle_accepted)rWZpairrrrr��szdispatcher.handle_acceptcCs|��|�dd�dS)Nzunhandled accepted eventrM)r{r�)rWrXrTrrrr��szdispatcher.handle_acceptedcCs|�dd�|��dS)Nzunhandled close eventrM)r�r{rirrrr,�szdispatcher.handle_close)NN)N)N)N)r�),rrr�debugrSr:rq�closingrT�	frozensetr�rYrarbrUrVZAF_INETZSOCK_STREAMrdrRrjr7r8rorprsrtrvrzr{r�r�rrrr#r%rr�r�r�r�r�r�r,rrrrrL�sJ

 

	


rLc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�dispatcher_with_sendNcCst�|||�d|_dS)Nry)rLrY�
out_bufferrfrrrrY�szdispatcher_with_send.__init__cCs.d}t�||jdd��}|j|d�|_dS)Nri)rLrvr�)rWZnum_sentrrr�
initiate_sendsz"dispatcher_with_send.initiate_sendcCs|��dSr)r�rirrrr�sz!dispatcher_with_send.handle_writecCs|jpt|j�Sr)rS�lenr�rirrrr8szdispatcher_with_send.writablecCs0|jr|�dt|��|j||_|��dS)Nz
sending %s)r�r�r^r�r�)rWrwrrrrvszdispatcher_with_send.send)NN)rrrrYr�r�r8rvrrrrr��s

r�cCs�t��\}}}g}|std��|rL|�|jjj|jjjt|j	�f�|j
}q~|d\}}}d�dd�|D��}|||f|||fS)Nztraceback does not exist���r[cSsg|]}d|�qS)z
[%s|%s|%s]r)�.0�xrrr�
<listcomp>&sz%compact_traceback.<locals>.<listcomp>)r|�exc_info�AssertionErrorr9�tb_frame�f_code�co_filename�co_namer~�	tb_lineno�tb_nextr_)r�r��tbr��fileZfunction�liner�rrrr�s�r�cCs�|dkrt}t|���D]n}z|��Wqtk
r`}z|jdtkrJn|sP�W5d}~XYqtk
rt�Yq|s��YqXq|��dSr')	r4r5�valuesr{r-r.r
r�clear)r?Z
ignore_allr�rrr�	close_all)s 
r��posixc@sNeZdZdd�Zdd�Zdd�Zdd�Zdd
d�ZeZeZ	dd
�Z
dd�Zd	S)�file_wrappercCst�|�|_dSr)r�duprB�rWrBrrrrYNszfile_wrapper.__init__cCs*|jdkrtjd|t|d�|��dS)Nrzunclosed file %r)�source)rB�warnings�warn�ResourceWarningr{rirrr�__del__Qs

�zfile_wrapper.__del__cGstj|jf|��Sr)rr"rB�rWr.rrrrzWszfile_wrapper.recvcGstj|jf|��Sr)rr$rBr�rrrrvZszfile_wrapper.sendNcCs(|tjkr|tjkr|sdStd��dS)Nrz-Only asyncore specific behaviour implemented.)rVrgr��NotImplementedError)rW�levelZoptnameZbuflenrrrrh]s
��zfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t�|�dS)Nrr�)rBrr{r�rrrr{hs

zfile_wrapper.closecCs|jSr)rBrirrrreoszfile_wrapper.fileno)N)rrrrYr�rzrvrhr"r$r{rerrrrr�Is
r�c@seZdZddd�Zdd�ZdS)�file_dispatcherNcCsPt�|d|�d|_z|��}Wntk
r4YnX|�|�t�|d�dS)NTF)rLrYrSre�AttributeError�set_filer�set_blocking)rWrBr?rrrrYts
zfile_dispatcher.__init__cCs"t|�|_|j��|_|��dSr)r�rVrerPrbr�rrrr�s
zfile_dispatcher.set_file)N)rrrrYr�rrrrr�rs
r�)r3N)r3N)rGFNN)NF).�__doc__r(rVr|r;r�r�errnorrrrrrrr	r
rrr
rr�r/r4rr�	Exceptionr�KeyboardInterrupt�
SystemExitrr"r$r&r2rCrFZpoll3rKrLr�r�r�rnr�r�rrrr�<module>sD<�


'

*
)chunk.cpython-38.opt-1.pyc000064400000011351151450073350011247 0ustar00U

e5d;�@sdZGdd�d�ZdS)aSimple class to read IFF chunks.

An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:

+----------------+
| ID (4 bytes)   |
+----------------+
| size (4 bytes) |
+----------------+
| data           |
| ...            |
+----------------+

The ID is a 4-byte string which identifies the type of chunk.

The size field (a 32-bit value, encoded using big-endian byte order)
gives the size of the whole chunk, including the 8-byte header.

Usually an IFF-type file consists of one or more chunks.  The proposed
usage of the Chunk class defined here is to instantiate an instance at
the start of each chunk and read from the instance until it reaches
the end, after which a new instance can be instantiated.  At the end
of the file, creating a new instance will fail with an EOFError
exception.

Usage:
while True:
    try:
        chunk = Chunk(file)
    except EOFError:
        break
    chunktype = chunk.getname()
    while True:
        data = chunk.read(nbytes)
        if not data:
            pass
        # do something with data

The interface is file-like.  The implemented methods are:
read, close, seek, tell, isatty.
Extra methods are: skip() (called by close, skips to the end of the chunk),
getname() (returns the name (ID) of the chunk)

The __init__ method has one required argument, a file-like object
(including a chunk instance), and one optional argument, a flag which
specifies whether or not chunks are aligned on 2-byte boundaries.  The
default is 1, i.e. aligned.
c@sZeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Zdd�Z	ddd�Z
dd�ZdS)�ChunkTFc	Cs�ddl}d|_||_|rd}nd}||_|�d�|_t|j�dkrFt�z |�|d|�d��d|_	Wn|j
k
r�td�YnX|r�|j	d|_	d|_z|j��|_
Wnttfk
r�d|_YnXd|_dS)	N�F�>�<��L�T)�struct�closed�align�file�read�	chunkname�len�EOFErrorZunpack_from�	chunksize�error�	size_read�tell�offset�AttributeError�OSError�seekable)�selfrr
Z	bigendianZ
inclheaderrZstrflag�r�/usr/lib64/python3.8/chunk.py�__init__4s, zChunk.__init__cCs|jS)z*Return the name (ID) of the current chunk.)r
�rrrr�getnameNsz
Chunk.getnamecCs|jS)z%Return the size of the current chunk.)rrrrr�getsizeRsz
Chunk.getsizecCs |jsz|��W5d|_XdS)NT)r	�skiprrrr�closeVszChunk.closecCs|jrtd��dS)N�I/O operation on closed fileF)r	�
ValueErrorrrrr�isatty]szChunk.isattyrcCsv|jrtd��|jstd��|dkr0||j}n|dkrB||j}|dksT||jkrXt�|j�|j	|d�||_dS)z�Seek to specified position into the chunk.
        Default position is 0 (start of chunk).
        If the file is not seekable, this will result in an error.
        r!zcannot seek��rN)
r	r"rrrr�RuntimeErrorr�seekr)r�pos�whencerrrr'bs
z
Chunk.seekcCs|jrtd��|jS)Nr!)r	r"rrrrrrusz
Chunk.tell���cCs�|jrtd��|j|jkrdS|dkr2|j|j}||j|jkrN|j|j}|j�|�}|jt|�|_|j|jkr�|jr�|jd@r�|j�d�}|jt|�|_|S)z�Read at most size bytes from the chunk.
        If size is omitted or negative, read until the end
        of the chunk.
        r!�rr$)r	r"rrrrrr
)r�size�data�dummyrrrrzs$��z
Chunk.readcCs�|jrtd��|jrnzD|j|j}|jr:|jd@r:|d}|j�|d�|j||_WdStk
rlYnX|j|jkr�t	d|j|j�}|�
|�}|snt�qndS)z�Skip the rest of the chunk.
        If you are not interested in the contents of the chunk,
        this method should be called so that the file points to
        the start of the next chunk.
        r!r$Ni )r	r"rrrr
rr'r�minrr)r�nr.rrrr�s"
z
Chunk.skipN)TTF)r)r*)�__name__�
__module__�__qualname__rrrr r#r'rrrrrrrr3s


rN)�__doc__rrrrr�<module>s2symtable.cpython-38.pyc000064400000026074151450073350011030 0ustar00U

e5dU�	@sJdZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlZdddddgZd	d�ZGd
d�d�Ze�ZGdd�d�ZGd
d�de�ZGdd�de�ZGdd�d�Zedk�rFddlZddlZeejd��Ze� �Z!W5QRXee!ej"�#ejd�dd�Z$e$�%�D]$Z&e$�'e&�Z(e)e(e(�*�e(�+���q dS)z2Interface to the compiler's internal symbol tables�N)�USE�
DEF_GLOBAL�DEF_NONLOCAL�	DEF_LOCAL�	DEF_PARAM�
DEF_IMPORT�	DEF_BOUND�	DEF_ANNOT�	SCOPE_OFF�
SCOPE_MASK�FREE�LOCAL�GLOBAL_IMPLICIT�GLOBAL_EXPLICIT�CELL�symtable�SymbolTable�Class�Function�SymbolcCst�|||�}t||�S�N)�	_symtabler�_newSymbolTable)�code�filenameZcompile_type�top�r� /usr/lib64/python3.8/symtable.pyrsc@s$eZdZdd�Zdd�Zdd�ZdS)�SymbolTableFactorycCst��|_dSr)�weakrefZWeakValueDictionary�_SymbolTableFactory__memo��selfrrr�__init__szSymbolTableFactory.__init__cCs6|jtjkrt||�S|jtjkr,t||�St||�Sr)�typer�
TYPE_FUNCTIONr�
TYPE_CLASSrr)r"�tablerrrr�news


zSymbolTableFactory.newcCs8||f}|j�|d�}|dkr4|�||�}|j|<|Sr)r �getr()r"r'r�key�objrrr�__call__s
zSymbolTableFactory.__call__N)�__name__�
__module__�__qualname__r#r(r,rrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) rcCs||_||_i|_dSr)�_table�	_filename�_symbols)r"Z	raw_tablerrrrr#'szSymbolTable.__init__cCsN|jtkrd}nd|jj}|jjdkr6d�||j�Sd�||jj|j�SdS)N�z%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)�	__class__rr-r0�name�formatr1)r"Zkindrrr�__repr__,s
�zSymbolTable.__repr__cCsX|jjtjkrdS|jjtjkr$dS|jjtjkr6dS|jjdksTtd�|jj���dS)N�moduleZfunction�class)���zunexpected type: {0})r0r$rZTYPE_MODULEr%r&�AssertionErrorr6r!rrr�get_type9s�zSymbolTable.get_typecCs|jjSr)r0�idr!rrr�get_idCszSymbolTable.get_idcCs|jjSr)r0r5r!rrr�get_nameFszSymbolTable.get_namecCs|jjSr)r0�linenor!rrr�
get_linenoIszSymbolTable.get_linenocCst|jjtjk�Sr)�boolr0r$rr%r!rrr�is_optimizedLszSymbolTable.is_optimizedcCst|jj�Sr)rDr0�nestedr!rrr�	is_nestedOszSymbolTable.is_nestedcCst|jj�Sr)rDr0�childrenr!rrr�has_childrenRszSymbolTable.has_childrencCsdS)z7Return true if the scope uses exec.  Deprecated method.Frr!rrr�has_execUszSymbolTable.has_execcCs|jj��Sr)r0�symbols�keysr!rrr�get_identifiersYszSymbolTable.get_identifierscCsT|j�|�}|dkrP|jj|}|�|�}|jjdk}t||||d�}|j|<|S)Nr��module_scope)r2r)r0rK�_SymbolTable__check_childrenr5r)r"r5Zsym�flags�
namespacesrOrrr�lookup\s
�zSymbolTable.lookupcs�fdd����D�S)Ncsg|]}��|��qSr)rS��.0�identr!rr�
<listcomp>gsz+SymbolTable.get_symbols.<locals>.<listcomp>)rMr!rr!r�get_symbolsfszSymbolTable.get_symbolscs��fdd��jjD�S)Ncs"g|]}|j�krt|�j��qSr)r5rr1�rU�st�r5r"rrrWjs
�z0SymbolTable.__check_children.<locals>.<listcomp>�r0rH)r"r5rr[rZ__check_childrenis�zSymbolTable.__check_childrencs�fdd��jjD�S)Ncsg|]}t|�j��qSr)rr1rYr!rrrWos�z,SymbolTable.get_children.<locals>.<listcomp>r\r!rr!r�get_childrenns
�zSymbolTable.get_childrenN)r-r.r/r#r7r>r@rArCrErGrIrJrMrSrXrPr]rrrrr%s


c@sPeZdZdZdZdZdZdZdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dS)rNcst��fdd����D��S)Nc3s"|]}��jj|�r|VqdSr)r0rKrT�r"Z	test_funcrr�	<genexpr>}s�z-Function.__idents_matching.<locals>.<genexpr>)�tuplerMr^rr^rZ__idents_matching|szFunction.__idents_matchingcCs |jdkr|�dd��|_|jS)NcSs|t@Sr)r��xrrr�<lambda>��z)Function.get_parameters.<locals>.<lambda>)�_Function__params�_Function__idents_matchingr!rrr�get_parameters�s
zFunction.get_parameterscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSr�r
rra�Zlocsrrrc�rdz%Function.get_locals.<locals>.<lambda>)�_Function__localsr
rrf�r"Ztestrrir�
get_locals�s

zFunction.get_localscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSrrhra�Zglobrrrc�rdz&Function.get_globals.<locals>.<lambda>)�_Function__globalsrrrfrkrrmr�get_globals�s

zFunction.get_globalscCs |jdkr|�dd��|_|jS)NcSs|t@Sr)rrarrrrc�rdz(Function.get_nonlocals.<locals>.<lambda>)�_Function__nonlocalsrfr!rrr�
get_nonlocals�s
zFunction.get_nonlocalscCs$|jdkrdd�}|�|�|_|jS)NcSs|t?t@tkSr)r
rrrarrrrc�rdz$Function.get_frees.<locals>.<lambda>)�_Function__freesrf)r"�is_freerrr�	get_frees�s
zFunction.get_frees)r-r.r/rerjrrrnrprfrgrlrorqrtrrrrrssc@seZdZdZdd�ZdS)rNcCs6|jdkr0i}|jjD]}d||j<qt|�|_|jS)Nr:)�_Class__methodsr0rHr5r`)r"�drZrrr�get_methods�s

zClass.get_methods)r-r.r/rurwrrrrr�sc@s�eZdZd$dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%rNFrNcCs.||_||_|t?t@|_|p d|_||_dS)Nr)�
_Symbol__name�_Symbol__flagsr
r�_Symbol__scope�_Symbol__namespaces�_Symbol__module_scope)r"r5rQrRrOrrrr#�s

zSymbol.__init__cCsd�|j�S)Nz<symbol {0!r}>)r6rxr!rrrr7�szSymbol.__repr__cCs|jSr)rxr!rrrrA�szSymbol.get_namecCst|jtj@�Sr)rDryrrr!rrr�
is_referenced�szSymbol.is_referencedcCst|jt@�Sr)rDryrr!rrr�is_parameter�szSymbol.is_parametercCs"t|jttfkp|jo|jt@�S)z0Return *True* if the sysmbol is global.
        )rDrzrrr|ryrr!rrr�	is_global�s�zSymbol.is_globalcCst|jt@�Sr)rDryrr!rrr�is_nonlocal�szSymbol.is_nonlocalcCst|jtk�Sr)rDrzrr!rrr�is_declared_global�szSymbol.is_declared_globalcCs"t|jttfkp|jo|jt@�S)z.Return *True* if the symbol is local.
        )rDrzr
rr|ryrr!rrr�is_local�s�zSymbol.is_localcCst|jt@�Sr)rDryr	r!rrr�is_annotated�szSymbol.is_annotatedcCst|jtk�Sr)rDrzrr!rrrrs�szSymbol.is_freecCst|jt@�Sr)rDryrr!rrr�is_imported�szSymbol.is_importedcCst|jt@�Sr)rDryrr!rrr�is_assigned�szSymbol.is_assignedcCs
t|j�S)a�Returns true if name binding introduces new namespace.

        If the name is used as the target of a function or class
        statement, this will be true.

        Note that a single name can be bound to multiple objects.  If
        is_namespace() is true, the name may also be bound to other
        objects, like an int or list, that does not introduce a new
        namespace.
        )rDr{r!rrr�is_namespace�szSymbol.is_namespacecCs|jS)z.Return a list of namespaces bound to this name)r{r!rrr�get_namespaces�szSymbol.get_namespacescCs t|j�dkrtd��|jdS)z�Returns the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces.
        r:z$name is bound to multiple namespacesr)�lenr{�
ValueErrorr!rrr�
get_namespace�szSymbol.get_namespace)N)r-r.r/r#r7rAr}r~rr�r�r�r�rsr�r�r�r�r�rrrrr�s 
�__main__r:�exec),�__doc__rrrrrrrrr	r
rrr
rrrr�__all__rrrrrrrr-�os�sys�open�argv�f�read�src�path�split�modrMrVrS�info�printr�r�rrrr�<module>s&DN,
M

glob.cpython-38.opt-2.pyc000064400000006534151450073350011072 0ustar00U

e5dA�@s�ddlZddlZddlZddlZdddgZdd�dd�Zdd�dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Ze�d�Ze�d�Zdd�Zdd�Zdd �Zd!d�ZdS)"�N�glob�iglob�escapeF��	recursivecCstt||d��S)Nr)�listr)�pathnamer�r	�/usr/lib64/python3.8/glob.pyr
scCs2t�d||�t||d�}|r.t|�r.t|�}|S)Nz	glob.globF)�sys�audit�_iglob�_isrecursive�next)rr�it�sr	r	r
rs
ccs�tj�|�\}}t|�sF|r0tj�|�rB|Vntj�|�rB|VdS|s�|rjt|�rjt|||�EdHnt|||�EdHdS||kr�t|�r�t	||d�}n|g}t|�r�|r�t|�r�t}q�t}nt
}|D]&}||||�D]}tj�||�Vq�q�dS)NT)�os�path�split�	has_magic�lexists�isdirr�_glob2�_glob1r
�_glob0�join)rr�dironly�dirname�basename�dirsZglob_in_dir�namer	r	r
r
)s0r
cCs0tt||��}t|�s$dd�|D�}t�||�S)Ncss|]}t|�s|VqdS�N)�	_ishidden)�.0�xr	r	r
�	<genexpr>Tsz_glob1.<locals>.<genexpr>)r�_iterdirr"�fnmatch�filter)r�patternr�namesr	r	r
rQsrcCs8|stj�|�r4|gSntj�tj�||��r4|gSgSr!)rrrrr)rrrr	r	r
rWsrcCst||d�S�NF)r�rr)r	r	r
�glob0dsr-cCst||d�Sr+)rr,r	r	r
�glob1gsr.ccs"|dd�Vt||�EdHdS)Nr)�	_rlistdir)rr)rr	r	r
rmsrc
cs�|s"t|t�rttjd�}ntj}zRt�|��>}|D]2}z|rF|��rN|jVWq4tk
rdYq4Xq4W5QRXWntk
r�YdSXdS)N�ASCII)�
isinstance�bytesr�curdir�scandir�is_dirr �OSError)rrr�entryr	r	r
r&ts
r&ccs`tt||��}|D]H}t|�s|V|r6tj�||�n|}t||�D]}tj�||�VqDqdSr!)rr&r"rrrr/)rrr*r$r�yr	r	r
r/�sr/z([*?[])s([*?[])cCs(t|t�rt�|�}n
t�|�}|dk	Sr!)r1r2�magic_check_bytes�search�magic_check)r�matchr	r	r
r�s

rcCs|ddkS)Nr)�.�.r	)rr	r	r
r"�sr"cCst|t�r|dkS|dkSdS)Ns**z**)r1r2)r)r	r	r
r�s
rcCs<tj�|�\}}t|t�r(t�d|�}nt�d|�}||S)Ns[\1]z[\1])rr�
splitdriver1r2r9�subr;)rZdriver	r	r
r�s

)r�rer'r�__all__rrr
rrr-r.rr&r/�compiler;r9rr"rrr	r	r	r
�<module>s(

(



code.cpython-38.opt-2.pyc000064400000011044151450073350011051 0ustar00U

e5d~)�@s�ddlZddlZddlmZmZddddgZGdd�d�ZGdd�de�Zdd	d�Ze	d
kr�ddl
Z
e
��Zej
ddd
d�e��Zejs�ejjr�dZndZee�dS)�N)�CommandCompiler�compile_command�InteractiveInterpreter�InteractiveConsole�interactrc@sBeZdZddd�Zddd�Zdd	�Zdd
d�Zdd
�Zdd�ZdS)rNcCs$|dkrddd�}||_t�|_dS)NZ__console__)�__name__�__doc__)�localsr�compile)�selfr	�r�/usr/lib64/python3.8/code.py�__init__s	
zInteractiveInterpreter.__init__�<input>�singlec
CsTz|�|||�}Wn&tttfk
r8|�|�YdSX|dkrFdS|�|�dS)NFT)r
�
OverflowError�SyntaxError�
ValueError�showsyntaxerror�runcode)r�source�filenameZsymbol�coderrr
�	runsource&s

z InteractiveInterpreter.runsourcecCs>zt||j�Wn(tk
r&�Yn|��YnXdS�N)�execr	�
SystemExit�
showtraceback)rrrrr
rMszInteractiveInterpreter.runcodecCs�t��\}}}|t_|t_|t_|rp|tkrpz|j\}\}}}}	Wntk
rVYnXt|||||	f�}|t_tjtj	kr�t
�||�}
|�d�
|
��nt�|||�dS)N�)�sys�exc_info�	last_type�
last_value�last_tracebackr�argsr�
excepthook�__excepthook__�	traceback�format_exception_only�write�join)rr�type�value�tb�msgZdummy_filename�lineno�offset�line�linesrrr
r`sz&InteractiveInterpreter.showsyntaxerrorcCs|t��\t_t_}}|t_zPt�|d|d|j�}tjtj	krT|�
d�|��nt�|d|d|�W5d}}XdS)Nr�r)rr r!r"r#r'�format_exception�tb_nextr%r&r)r*)rZlast_tbZeir2rrr
r�sz$InteractiveInterpreter.showtracebackcCstj�|�dSr)r�stderrr))r�datarrr
r)�szInteractiveInterpreter.write)N)rr)N)	r�
__module__�__qualname__rrrrrr)rrrr
rs	

'
#c@s:eZdZddd�Zdd�Zddd�Zd	d
�Zddd
�ZdS)rN�	<console>cCst�||�||_|��dSr)rrr�resetbuffer)rr	rrrr
r�s
zInteractiveConsole.__init__cCs
g|_dSr)�buffer)rrrr
r;�szInteractiveConsole.resetbuffercCsRz
tjWntk
r$dt_YnXz
tjWntk
rJdt_YnXd}|dkrx|�dtjtj||jjf�n|r�|�dt	|��d}zV|r�tj}ntj}z|�
|�}Wn&tk
r�|�d�YW�qYnX|�|�}Wq�t
k
�r|�d�|��d}Yq�Xq�|dk�r6|�d	|jj�n|d
k�rN|�d|�dS)Nz>>> z... zFType "help", "copyright", "credits" or "license" for more information.zPython %s on %s
%s
(%s)
z%s
r�
z
KeyboardInterrupt
znow exiting %s...
r)rZps1�AttributeErrorZps2r)�version�platform�	__class__r�str�	raw_input�EOFError�push�KeyboardInterruptr;)r�banner�exitmsgZcprt�more�promptr1rrr
r�sH


��



zInteractiveConsole.interactcCs6|j�|�d�|j�}|�||j�}|s2|��|S)Nr=)r<�appendr*rrr;)rr1rrIrrr
rE�szInteractiveConsole.pushrcCst|�Sr)�input)rrJrrr
rCszInteractiveConsole.raw_input)Nr:)NN)r)rr8r9rr;rrErCrrrr
r�s


6cCsJt|�}|dk	r||_n"zddl}Wntk
r8YnX|�||�dS)Nr)rrC�readline�ImportErrorr)rGZreadfuncZlocalrHZconsolerMrrr
rs�__main__z-q�
store_truez*don't print version and copyright messages)�action�helpr)NNNN)rr'Zcodeoprr�__all__rrrr�argparse�ArgumentParser�parser�add_argument�
parse_argsr$�q�flags�quietrGrrrr
�<module>s(�t
�compileall.cpython-38.opt-1.pyc000064400000022304151450073350012260 0ustar00U

e5dn5�	@s�dZddlZddlZddlZddlZddlZddlmZdddgZ	ddd	�Z
dd
d�Zdd�Zddd�Z
ddd�Zdd�Zedkr�ee��Ze�e�dS)a�Module/script to byte-compile all .py files to .pyc files.

When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.

Without arguments, if compiles all modules on sys.path, without
recursing into subdirectories.  (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.
�N)�partial�compile_dir�compile_file�compile_path�
ccs|dkrt|tj�rt�|�}|s0td�|��zt�|�}Wn.tk
rl|dkrdtd�|��g}YnX|��|D]�}|dkr�qztj	�
||�}|dk	r�tj	�
||�}nd}tj	�|�s�||fVqz|dkrz|tjkrz|tj
krztj	�|�rztj	�|�szt|||d|d�EdHqzdS)N�zListing {!r}...zCan't list {!r}�__pycache__r�)�ddir�	maxlevels�quiet)�
isinstance�os�PathLike�fspath�print�format�listdir�OSError�sort�path�join�isdir�curdir�pardir�islink�	_walk_dir)�dirr
rr�names�name�fullname�dfile�r"�"/usr/lib64/python3.8/compileall.pyrs:


�
��rF���r	c
Cs�d}
|dkrtd��|dkrFzddlm}
Wntk
rDd}YnXt||||d�}d}|dkr�|
dk	r�|ppd}|
|d��0}
|
�tt||||||	d	�|�}t|dd
�}W5QRXn(|D]"\}}t	||||||||	�s�d}q�|S)aByte-compile all modules in the given directory tree.

    Arguments (only dir is required):

    dir:       the directory to byte-compile
    maxlevels: maximum recursion level (default 10)
    ddir:      the directory that will be prepended to the path to the
               file as it is compiled into each byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    workers:   maximum number of parallel workers
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    Nrz%workers must be greater or equal to 0r	)�ProcessPoolExecutor)rrr
T)Zmax_workers)�force�rxr�legacy�optimize�invalidation_mode)�defaultF)
�
ValueErrorZconcurrent.futuresr%�ImportErrorr�mapr�_compile_file_tuple�minr)rrr
r&r'rr(r)�workersr*r%Zfiles_and_ddirs�successZexecutorZresults�filer!r"r"r#r2sF
����cKs|\}}t||f|�S)z-Needs to be toplevel for ProcessPoolExecutor.)r)Zfile_and_dfile�kwargsr3r!r"r"r#r/esr/c
Cs�d}|dkr"t|tj�r"t�|�}tj�|�}	|dk	rFtj�||	�}
nd}
|dk	rd|�|�}|rd|Stj�|��r�|r�|d}nB|dkr�|dkr�|nd}
t	j
j||
d�}nt	j
�|�}tj�|�}|	dd	�|	d	d�}}|d
k�r�|�s\zXt
t�|�j�}t�dt	j
jd|�}t|d��}|�d
�}W5QRX||k�rB|WSWntk
�rZYnX|�sptd�|��ztj|||
d||d�}W�ntjk
�r}zjd}|dk�r�|WY�RS|�r�td�|��ntddd�|jjtjjdd�}|� tjj�}t|�W5d}~XYn�t!t"tfk
�r�}zRd}|dk�rJ|WY�:S|�r`td�|��ntddd�t|j#j$d|�W5d}~XYnX|dk�r�d}|S)aTByte-compile one file.

    Arguments (only fullname is required):

    fullname:  the file to byte-compile
    ddir:      if given, the directory name compiled in to the
               byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    TrN�crr	�)�optimization���z.pyz<4sll�rb�zCompiling {!r}...)r)r*Fz*** Error compiling {!r}...z*** )�end�backslashreplace)�errors�:)%r
rrrr�basenamer�search�isfile�	importlib�util�cache_from_source�dirname�int�stat�st_mtime�structZpack�MAGIC_NUMBER�open�readrrr�
py_compile�compile�PyCompileError�msg�encode�sys�stdout�encoding�decode�SyntaxError�UnicodeError�	__class__�__name__)r r
r&r'rr(r)r*r2rr!Zmo�cfile�optZ	cache_dir�head�tail�mtimeZexpectZchandleZactual�ok�errrP�er"r"r#rjs�


�
�

�
�
$
c	CsTd}tjD]D}|r|tjkr2|r2|dkrNtd�q
|oLt||d|||||d�}q
|S)a�Byte-compile all module on sys.path.

    Arguments (all optional):

    skip_curdir: if true, skip current directory (default True)
    maxlevels:   max recursion level (default 0)
    force: as for compile_dir() (default False)
    quiet: as for compile_dir() (default 0)
    legacy: as for compile_dir() (default False)
    optimize: as for compile_dir() (default -1)
    invalidation_mode: as for compiler_dir()
    TrzSkipping current directoryN)rr(r)r*)rRrrrrr)	Zskip_curdirrr&rr(r)r*r2rr"r"r#r�s 

�
c
Cs�ddl}|jdd�}|jdddddd	d
�|jdtdd
d�|jddddd�|jdddddd�|jddddd�|jdddddd �|jd!d"d#dd$d �|jd%d&d'd(d)�|jd*d+d,d-d.�|jd/d0d1td2d3�d4d5�tjD�}|jd6t|�d7d8�|��}|j}|j	�r$ddl
}|�|j	�|_	|jdk	�r8|j}n|j
}|j�r�zF|jd9k�rZtjnt|j�� }|D]}|�|����qjW5QRXWn4tk
�r�|jd:k�r�td;�|j��Yd<SX|j�r�|j�d9d=���}	tj|	}
nd}
d>}z�|�rl|D]h}tj�|��r6t||j|j |j	|j|j!|
d?��sbd<}n,t"|||j|j |j	|j|j!|j#|
d@�	�s�d<}�q�|WSt$|j!|j |j|
dA�WSWn,t%k
�r�|jd:k�r�tdB�Yd<SXd>S)CzScript main program.rNz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrrz!don't recurse into subdirectories)�actionZconstr+�dest�helpz-r�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)�typercrdz-f�
store_truer&z/force rebuild even if timestamps are up to date)rbrcrdz-q�countrzIoutput only error messages; -qq will suppress the error messages as well.)rbrcr+rdz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)�metavarrcr+rdz-xZREGEXPr'zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILE�flistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rircrd�compile_destzFILE|DIR�*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)ri�nargsrdz-jz	--workersr	zRun compileall concurrently)r+rfrdcSsg|]}|j���dd��qS)�_�-)r�lower�replace)�.0�moder"r"r#�
<listcomp>	s�zmain.<locals>.<listcomp>z--invalidation-modez�set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)�choicesrdrorzError reading file list {}FrnT)r*)r1r*)r(r&rr*z
[interrupted])&�argparse�ArgumentParser�add_argumentrFrM�PycInvalidationMode�sorted�
parse_argsrkr'�rerNrerrjrR�stdinrK�append�striprrrrr*rq�upperrrrArr
r&r(rr1r�KeyboardInterrupt)
rv�parserZinvalidation_modes�argsZ
compile_destsr|r�f�lineZivl_moder*r2rcr"r"r#�main�s��
�
�
��
���
�
�
��� �
�
�r��__main__)Nrr)	rNFNrFr$r	N)NFNrFr$N)r	rFrFr$N)�__doc__rrR�importlib.utilrBrMrI�	functoolsr�__all__rrr/rrr�rYrFZexit_status�exitr"r"r"r#�<module>s<

�
3�
V�
"idummy_threading.cpython-38.pyc000064400000002130151450073350012353 0ustar00U

e5d�
�	@sdZddlmZddlZdZdZdZz�dekr:edZ
dZed	ed<dekr`edZdZed=dekrzedZ	dZed=ddlZeded
<ed=eded<ed=ddlTdd
lm
Z
W5er�eed<[[er�e	ed<[	[er�e
ed<[
ned=[[[XdS)aaFaux ``threading`` version using ``dummy_thread`` instead of ``thread``.

The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported.  Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``_thread`` was available which is not desired.

�)�modulesNF�	threadingZ_threading_local�_threadT�
_dummy_thread�_dummy_threadingZ_dummy__threading_local)�*)�__all__)�__doc__�sysrZsys_modulesrZholding_threadZholding_threadingZholding__threading_localZheld_threadingZheld__threading_localZheld_threadrrr�rr�'/usr/lib64/python3.8/dummy_threading.py�<module>sPoptparse.cpython-38.opt-2.pyc000064400000105515151450073350012003 0ustar00U

e5d���@s�dZddddddddd	d
ddd
ddddgZdZddlZddlZddlZdd�ZzddlmZmZWn$e	k
r�dd�Zdd�ZYnXeZ
Gdd�de�ZGdd
�d
e�Z
Gdd�de
�ZGdd�de�ZGd d�de�ZGd!d"�d"e�ZGd#d	�d	�ZGd$d
�d
e�ZGd%d�de�Zd&d'�Zd(d)�Zee
d*�fee
d*�fee
d+�fee
d,�fd-�Zd.d/�Zd0d�Zd1ZGd2d�d�Zd3Zd4ZGd5d�d�Z Gd6d�d�Z!Gd7d�de!�Z"Gd8d�de!�Z#d9d:�Z$eZ%dS);z1.5.3�Option�make_option�
SUPPRESS_HELP�SUPPRESS_USAGE�Values�OptionContainer�OptionGroup�OptionParser�
HelpFormatter�IndentedHelpFormatter�TitledHelpFormatter�
OptParseError�OptionError�OptionConflictError�OptionValueError�BadOptionError�check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
�NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��self�r� /usr/lib64/python3.8/optparse.py�_reprOsr)�gettext�ngettextcCs|S�Nr)�messagerrrr\srcCs|dkr|S|S�N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)rcCs
||_dSr��msg�rr#rrr�__init__hszOptParseError.__init__cCs|jSrr"rrrr�__str__kszOptParseError.__str__N�r�
__module__�__qualname__r%r&rrrrrgsc@seZdZdd�Zdd�ZdS)r
cCs||_t|�|_dSr)r#�str�	option_id)rr#�optionrrrr%uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz
option %s: %s)r+r#rrrrr&yszOptionError.__str__Nr'rrrrr
osc@seZdZdS)rN�rr(r)rrrrrsc@seZdZdS)rNr-rrrrr�sc@seZdZdd�Zdd�ZdS)rcCs
||_dSr)�opt_str�rr.rrrr%�szBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r.rrrrr&�szBadOptionError.__str__Nr'rrrrr�sc@seZdZdd�Zdd�ZdS)�AmbiguousOptionErrorcCst�||�||_dSr)rr%�
possibilities)rr.r2rrrr%�szAmbiguousOptionError.__init__cCstd�|jd�|j�fS)Nzambiguous option: %s (%s?)�, )r0r.�joinr2rrrrr&�s�zAmbiguousOptionError.__str__Nr'rrrrr1�sr1c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!r	Znonec	Cs�d|_||_|dkrLzttjd�}Wnttfk
rBd}YnX|d8}||_t|t	|d|d��|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	NZCOLUMNS�P��rz%defaultz%s %sz%s=%s)�parser�indent_increment�int�os�environ�KeyError�
ValueError�width�min�max�
help_position�max_help_position�current_indent�level�
help_width�short_first�default_tag�option_strings�_short_opt_fmt�
_long_opt_fmt�rr9rCr?rGrrrr%�s&
�
zHelpFormatter.__init__cCs
||_dSr)r8�rr8rrr�
set_parser�szHelpFormatter.set_parsercCs&|dkrtd|��d|d|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)r>rJ�rZdelimrrr�set_short_opt_delimiter�s
�z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|��d|d|_dS)N)�=rPz.invalid metavar delimiter for long options: %rrQ)r>rKrRrrr�set_long_opt_delimiter�s
�z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSr�rDr9rErrrr�indent�szHelpFormatter.indentcCs"|j|j8_|jd8_dSrrVrrrr�dedent�szHelpFormatter.dedentcCstd��dS�Nzsubclasses must implement��NotImplementedError�r�usagerrr�format_usage�szHelpFormatter.format_usagecCstd��dSrYrZ�rZheadingrrr�format_headingszHelpFormatter.format_headingcCs.t|j|jd�}d|j}tj||||d�S)N�rP)Zinitial_indentZsubsequent_indent)rAr?rD�textwrapZfill)r�textZ
text_widthrWrrr�_format_texts
�zHelpFormatter._format_textcCs|r|�|�dSdSdS�N�
rO�rd�r�descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|�|�dSdSdSrerg)r�epilogrrr�
format_epilogszHelpFormatter.format_epilogcCsP|jdks|js|jS|jj�|j�}|tks6|dkr<|j}|j�|jt	|��Sr)
r8rH�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer*)rr,Z
default_valuerrr�expand_defaultszHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|krBd�jd|f}�j}nd�jd||f}d}|�|�|jr���|�}t�|�j	�}|�d|d|df�|�
�fdd�|dd�D��n|d	d
kr�|�d
�d�|�S)Nr6�%*s%s
rOz	%*s%-*s  rcsg|]}d�jd|f�qS)rurO)rB)�.0�linerrr�
<listcomp>Es�z/HelpFormatter.format_option.<locals>.<listcomp>r ���rf)rIrBrD�len�appendrmrtrbZwraprF�extendr4)rr,�result�optsZ	opt_widthZindent_firstZ	help_textZ
help_linesrrr�
format_option(s&



�

zHelpFormatter.format_optioncCs�|��d}|jD],}|�|�}||j|<t|t|�|j�}q|��|jD]8}|jD],}|�|�}||j|<t|t|�|j�}qXqN|��|��t	|d|j
�|_t|j|jd�|_
dS)Nrr6ra)rW�option_list�format_option_stringsrIrArzrD�
option_groupsrXr@rCrBr?rF)rr8Zmax_len�optZstrings�grouprrr�store_option_stringsKs 






z"HelpFormatter.store_option_stringscst|��rF|jp|j�����fdd�|jD�}��fdd�|jD�}n|j}|j}�jrb||}n||}d�|�S)Ncsg|]}�j|�f�qSr)rJ)rvZsopt��metavarrrrrxas�z7HelpFormatter.format_option_strings.<locals>.<listcomp>csg|]}�j|�f�qSr)rK)rvZloptr�rrrxcs�r3)�takes_valuer�rp�upper�_short_opts�
_long_optsrGr4)rr,Z
short_optsZ	long_optsr~rr�rr�]s��
z#HelpFormatter.format_option_stringsN)rr(r)rrr%rNrSrUrWrXr^r`rdrjrlrtrr�r�rrrrr	�s +
#c@s&eZdZddd�Zdd�Zd	d
�ZdS)r
r6�Nr cCst�|||||�dSr�r	r%rLrrrr%ts�zIndentedHelpFormatter.__init__cCstd�|S)Nz
Usage: %s
)r0r\rrrr^|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s:
rO)rDr_rrrr`sz$IndentedHelpFormatter.format_heading)r6r�Nr �rr(r)r%r^r`rrrrr
ps�
c@s&eZdZd
dd�Zdd�Zdd	�ZdS)rrr�NcCst�|||||�dSrr�rLrrrr%�s�zTitledHelpFormatter.__init__cCsd|�td��|fS)Nz%s  %s
ZUsage)r`r0r\rrrr^�sz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s
%s
z=-)rErzr_rrrr`�sz"TitledHelpFormatter.format_heading)rr�Nrr�rrrrr�s�
cCsh|dd���dkrd}nD|dd���dkrDd}|dd�p@d}n|dd�dkrZd}nd}|||�S)	Nr6Z0x�Z0b�0r ��
)�lower)�val�type�radixrrr�
_parse_num�sr�cCs
t|t�Sr)r�r:)r�rrr�
_parse_int�sr�Zintegerzfloating-point�complex)r:�long�floatr�cCsHt|j\}}z
||�WStk
rBttd�|||f��YnXdS)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�r>rr0)r,r��valueZcvtZwhatrrr�
check_builtin�s
�r�cCs:||jkr|Sd�tt|j��}ttd�|||f��dS)Nr3z.option %s: invalid choice: %r (choose from %s))�choicesr4�map�reprrr0)r,r�r�r�rrrr�s
��)ZNOZDEFAULTc@s�eZdZddddddddd	d
ddgZd
ZdZdZdZdZdZ	e
e
e
e
ed�ZdZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZeeeeeeegZ
d+d,�ZeZd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Z d7d8�Z!dS)9r�actionr�rp�default�nargs�constr��callback�
callback_args�callback_kwargsrmr�)
�store�store_const�
store_true�store_falser{�append_const�countr�rm�version)r�r�r�r�r{r�r�)r�r{r�)r�r{)r�r�)�stringr:r�r�r��choice)r:r�r�r�r�NcOsBg|_g|_|�|�}|�|�|�|�|jD]}||�q0dSr)r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr~�attrs�checkerrrrr%4s



zOption.__init__cCsdd�|D�}|std��|S)NcSsg|]}|r|�qSrr)rvr�rrrrxKsz-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)�	TypeError)rr~rrrr�GszOption._check_opt_stringscCs�|D]�}t|�dkr$td||��qt|�dkrd|ddkrH|ddksVtd||��|j�|�q|dd�dkr�|ddks�td||��|j�|�qdS)	Nr6z>invalid option string %r: must be at least two characters longr�-r zMinvalid short option string %r: must be of the form -x, (x any non-dash char)�--zGinvalid long option string %r: must start with --, followed by non-dash)rzr
r�r{r�)rr~r�rrrr�Ps2������zOption._set_opt_stringscCsv|jD]F}||kr*t||||�||=q|dkr@t||t�qt||d�q|rrt|���}tdd�|�|��dS)Nr�zinvalid keyword arguments: %sr3)�ATTRS�setattrrq�sorted�keysr
r4)rr��attrrrrr�es
�zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr
rrrr�
_check_actionxs
zOption._check_actioncCs�|jdkr0|j|jkr�|jdk	r(d|_q�d|_n^t|jt�rF|jj|_|jdkrVd|_|j|jkrrtd|j|��|j|jkr�td|j|��dS)Nr�r�r*zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr
�
TYPED_ACTIONSrrrr�_check_type~s 



�zOption._check_typecCsr|jdkrT|jdkr td|��qnt|jttf�sntdtt|j���d�d|��n|jdk	rntd|j|��dS)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'r z#must not supply choices for type %r)r�r�r
r��tuple�listr*�splitrrrr�
_check_choice�s$

���
�zOption._check_choicecCs\|j|jkp|jdk	}|jdkrX|rX|jrH|jddd��dd�|_n|jdd|_dS)Nrr6r�r0r )r��
STORE_ACTIONSr�rpr�rsr�)rr�rrr�_check_dest�s�zOption._check_destcCs*|j|jkr&|jdk	r&td|j|��dS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�r
rrrr�_check_const�s
�zOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk	r8td|j|��dS)Nr z*'nargs' must not be supplied for action %r)r�r�r�r
rrrr�_check_nargs�s

�zOption._check_nargscCs�|jdkrrt|j�s$td|j|��|jdk	rJt|jt�sJtd|j|��|jdk	r�t|jt�s�td|j|��nB|jdk	r�td|j|��|jdk	r�td|��|jdk	r�td|��dS)Nr�zcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option)	r��callabler�r
r�r�r�r��dictrrrr�_check_callback�sR

�

���

���
��
�
�zOption._check_callbackcCsd�|j|j�S)N�/)r4r�r�rrrrr&�szOption.__str__cCs
|jdk	Sr)r�rrrrr��szOption.takes_valuecCs|jr|jdS|jdSdS�Nr)r�r�rrrr�get_opt_string�s
zOption.get_opt_stringcCs*|j�|j�}|dkr|S||||�SdSr)�TYPE_CHECKERror�)rr�r�r�rrr�check_value�szOption.check_valuecs:|dk	r6�jdkr���|�St��fdd�|D��SdS)Nr csg|]}���|��qSr)r�)rv�v�r�rrrrxsz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rr�r�rr�r�
convert_values
zOption.convert_valuecCs$|�||�}|�|j|j||||�Sr)r��take_actionr�rp)rr�r��valuesr8rrr�processs�zOption.processc	Cs:|dkrt|||��n|dkr2t|||j��n|dkrHt||d�n�|dkr^t||d�n�|dkrz|�|g��|�n�|dkr�|�|g��|j�n�|d	kr�t|||�|d
�d�n||dkr�|jp�d
}|jp�i}|j||||f|�|�nF|dk�r|��|��n*|dk�r(|�	�|��nt
d|j��dS)Nr�r�r�Tr�Fr{r�r�rr r�rrmr�zunknown action %r)r�r��ensure_valuer{r�r�r��
print_help�exit�
print_versionr>r�)	rr�rpr�r�r�r8�args�kwargsrrrr�s4





zOption.take_action)"rr(r)r�r�r�r�r�r�r�r�rr�r�r%r�r�r�r�r�r�r�r�r�r�r&r�__repr__r�r�r�r�r�r�rrrrr�sj�
�	
	�	ZSUPPRESSHELPZ
SUPPRESSUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
dS)rNcCs&|r"|��D]\}}t|||�qdSr)�itemsr�)rrnr�r�rrrr%9szValues.__init__cCs
t|j�Sr)r*�__dict__rrrrr&>szValues.__str__cCs2t|t�r|j|jkSt|t�r*|j|kStSdSr)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs



z
Values.__eq__cCs6t|�D](}||kr||}|dk	rt|||�qdSr)�dirr�)rr�r�Zdvalrrr�_update_carefulKs
zValues._update_carefulcCs|j�|�dSr)r��update)rr�rrr�
_update_looseXszValues._update_loosecCs8|dkr|�|�n |dkr(|�|�ntd|��dS)N�carefulZloosezinvalid update mode: %r)r�r�r>)rr��moderrr�_update`s
zValues._updater�cCs&t|�tj|}|�t|�|�dSr)�
__import__�sys�modulesr��vars)r�modnamer��modrrr�read_modulehs
zValues.read_modulecCs&i}tt|���|�|�||�dSr)�exec�open�readr�)r�filenamer�r�rrr�	read_filemszValues.read_filecCs.t||�rt||�dkr$t|||�t||�Sr)�hasattr�getattrr�)rr�r�rrrr�rszValues.ensure_value)N)r�)r�)rr(r)r%r&rr�r�r�r�r�r�r�r�rrrrr7s



c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"rcCs&|��||_|�|�|�|�dSr)�_create_option_list�option_class�set_conflict_handler�set_description)rr�conflict_handlerrirrrr%�s
zOptionContainer.__init__cCsi|_i|_i|_dSr��
_short_opt�	_long_optrnrrrr�_create_option_mappings�sz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrMrrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dkrtd|��||_dS)N)�error�resolvez$invalid conflict_resolution value %r)r>r)r�handlerrrrr�sz$OptionContainer.set_conflict_handlercCs
||_dSr�rirhrrrr�szOptionContainer.set_descriptioncCs|jSrr
rrrr�get_description�szOptionContainer.get_descriptioncCs|`|`|`dSrrrrrr�destroy�szOptionContainer.destroycCs�g}|jD]"}||jkr
|�||j|f�q
|jD]"}||jkr4|�||j|f�q4|r�|j}|dkr�tdd�dd�|D��|��nd|dkr�|D]V\}}|�d�r�|j�	|�|j|=n|j�	|�|j|=|js�|js�|j
j�	|�q�dS)Nr
z conflicting option string(s): %sr3cSsg|]}|d�qS)rr)rv�corrrrx�sz3OptionContainer._check_conflict.<locals>.<listcomp>rr�)r�rr{r�rrrr4�
startswith�remove�	containerr�)rr,Z
conflict_optsr�rZc_optionrrr�_check_conflict�s2



��

zOptionContainer._check_conflictcOs�t|dt�r|j||�}n8t|�dkrL|sL|d}t|t�sTtd|��ntd��|�|�|j�|�||_	|j
D]}||j|<qv|jD]}||j
|<q�|jdk	r�|jtk	r�|j|j|j<n|j|jkr�d|j|j<|S)Nrr znot an Option instance: %r�invalid arguments)r�r*rrzrr�rr�r{rr�rr�rrpr�rqrn)rr�r�r,r�rrr�
add_option�s(





zOptionContainer.add_optioncCs|D]}|�|�qdSr)r)rr�r,rrr�add_optionsszOptionContainer.add_optionscCs|j�|�p|j�|�Sr)rrorr/rrr�
get_options
�zOptionContainer.get_optioncCs||jkp||jkSr)rrr/rrr�
has_options
�zOptionContainer.has_optioncCsn|j�|�}|dkr |j�|�}|dkr4td|��|jD]}|j|=q:|jD]}|j|=qN|jj�|�dS)Nzno such option %r)	rrorr>r�r�rr�r)rr.r,r�rrr�
remove_options



zOptionContainer.remove_optioncCs>|js
dSg}|jD]}|jtk	r|�|�|��qd�|�S�NrO)r�rmrr{rr4)r�	formatterr}r,rrr�format_option_helps

z"OptionContainer.format_option_helpcCs|�|���Sr)rjr�rrrrrrj(sz"OptionContainer.format_descriptioncCs:g}|jr|�|�|��|jr0|�|�|��d�|�S)Nrf)rir{rjr�rr4�rrr}rrr�format_help+szOptionContainer.format_helpN)rr(r)r%rr	rrrrrrrrrrrrjr rrrrrxs  			c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs$||_t�||j|j|�||_dSr)r8rr%rr�title)rr8r!rirrrr%6s�zOptionGroup.__init__cCsg|_|�|j�dSr)r�r	r8rrrrr<szOptionGroup._create_option_listcCs
||_dSr)r!)rr!rrr�	set_title@szOptionGroup.set_titlecCst�|�|`dSr)rrr�rrrrrCs
zOptionGroup.destroycCs0|�|j�}|��|t�||�7}|��|Sr)r`r!rWrr rXrrrrr Js
zOptionGroup.format_help)N)rr(r)r%rr"rr rrrrr4s

c
@s^eZdZgZddedddddddf
dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dOdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdPd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdQd;d<�Z d=d>�Z!d?d@�Z"dRdAdB�Z#dCdD�Z$dSdEdF�Z%dTdGdH�Z&dIdJ�Z'dUdKdL�Z(dVdMdN�Z)dS)WrNr
TcCsrt�||||�|�|�|	|_||_d|_d|_|dkr@t�}||_|j�	|�|
|_
|j||d�|��dS)NT)�add_help)
rr%�	set_usage�progr��allow_interspersed_args�process_default_valuesr
rrNrk�_populate_option_list�_init_parsing_state)rr]r�rr�rrirZadd_help_optionr%rkrrrr%�s(�
�zOptionParser.__init__cCs.t�|�|jD]}|��q|`|`|`dSr)rrr�r�r)rr�rrrr�s


zOptionParser.destroycCsg|_g|_|��dSr)r�r�rrrrrr�sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helprmzshow this help message and exit�r�rm�rr0rrrr�_add_help_option�s�zOptionParser._add_help_optioncCs|jddtd�d�dS)Nz	--versionr�z&show program's version number and exitr*r+rrrr�_add_version_option�s�z OptionParser._add_version_optioncCs>|jr|�|j�|r |�|�|jr.|��|r:|��dSr)�standard_option_listrr�r-r,)rr�r#rrrr(�s
z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)�rargs�largsr�rrrrr)�sz OptionParser._init_parsing_statecCsL|dkrtd�|_n4|tkr$d|_n$|���d�rB|dd�|_n||_dS)Nz%prog [options]zusage: �)r0r]rr�rr\rrrr$�szOptionParser.set_usagecCs
d|_dS)NT�r&rrrr�enable_interspersed_args�sz%OptionParser.enable_interspersed_argscCs
d|_dS)NFr2rrrr�disable_interspersed_argssz&OptionParser.disable_interspersed_argscCs
||_dSr)r')rr�rrr�set_process_default_valuessz'OptionParser.set_process_default_valuescCs||j|<dSr)rn)rrpr�rrr�set_defaultszOptionParser.set_defaultcKs|j�|�dSr)rnr�)rr�rrr�set_defaultsszOptionParser.set_defaultscCs*|jdd�}|jD]}|�|j�q|Sr)r�r�r|)rZoptionsr�rrr�_get_all_optionss
zOptionParser._get_all_optionscCs`|jst|j�S|j��}|��D]4}|�|j�}t|t�r"|�	�}|�
||�||j<q"t|�Sr)r'rrn�copyr8rorpr�r*r�r�)rrnr,r�r.rrr�get_default_valuess


zOptionParser.get_default_valuescOszt|dt�r t|f|�|�}nJt|�dkrb|sb|d}t|t�sNtd|��|j|k	rjtd��ntd��|j�|�|S)Nrr znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r)	r�r*rrzr�r8r>r�r{)rr�r�r�rrr�add_option_group+s


zOptionParser.add_option_groupcCs0|j�|�p|j�|�}|r,|j|k	r,|jSdSr)rrorr)rr.r,rrr�get_option_group;s
�zOptionParser.get_option_groupcCs&|dkrtjdd�S|dd�SdSr)r��argv)rr�rrr�	_get_argsEszOptionParser._get_argsc
Cs�|�|�}|dkr|��}||_g|_}||_z|�|||�}Wn4ttfk
rv}z|�t	|��W5d}~XYnX||}|�
||�Sr)r>r:r/r0r��
_process_argsrrr
r*�check_values)rr�r�r/r0�stop�errrrr�
parse_argsKs

 zOptionParser.parse_argscCs||fSrr)rr�r�rrrr@rszOptionParser.check_valuescCs�|r�|d}|dkr|d=dS|dd�dkr<|�||�q|dd�dkrft|�dkrf|�||�q|jr~|�|�|d=qdSqdS)Nrr�r6r r�)�_process_long_optrz�_process_short_optsr&r{)rr0r/r��argrrrr?s

zOptionParser._process_argscCst||j�Sr)�
_match_abbrevr)rr�rrr�_match_long_opt�szOptionParser._match_long_optc
Cs�|�d�}d|kr4|�dd�\}}|�d|�d}n|}d}|�|�}|j|}|��r�|j}t|�|kr�|�t	dd|�||d��q�|dkr�|�d�}	q�t
|d|��}	|d|�=n|r�|�td	�|�nd}	|�||	||�dS)
NrrTr TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r,Znumberz%s option does not take a value)
�popr��insertrHrr�r�rzr
rr�r0r�)
rr/r�rFr�Znext_argZhad_explicit_valuer,r�r�rrrrD�s6


��zOptionParser._process_long_optcCs�|�d�}d}d}|dd�D]�}d|}|j�|�}|d7}|sJt|��|��r�|t|�krv|�d||d��d}|j}	t|�|	kr�|�t	dd|	�||	d��q�|	dkr�|�d�}
q�t
|d|	��}
|d|	�=nd}
|�||
||�|rq�qdS)	NrFr r�TrIrJrK)rLrrorr�rzrMr�r
rr�r�)rr/r�rFrA�iZchr�r,r�r�rrrrE�s<
��z OptionParser._process_short_optscCs&|jdkrtj�tjd�S|jSdSr�)r%r;�path�basenamer�r=rrrr�
get_prog_names
zOptionParser.get_prog_namecCs|�d|���S)Nz%prog)rsrQ)r�srrr�expand_prog_nameszOptionParser.expand_prog_namecCs|�|j�Sr)rSrirrrrrszOptionParser.get_descriptionrcCs|rtj�|�t�|�dSr)r��stderr�writer�)rZstatusr#rrrr�szOptionParser.exitcCs(|�tj�|�dd|��|f�dS)Nr6z%s: error: %s
)�print_usager�rTr�rQr$rrrr
szOptionParser.errorcCs"|jr|j�|�|j��SdSdSr)r]rr^rSrrrr�	get_usage#s

�zOptionParser.get_usagecCs|jrt|��|d�dS�N)�file)r]�printrW�rrYrrrrV*s	zOptionParser.print_usagecCs|jr|�|j�SdSdSr)r�rSrrrr�get_version6szOptionParser.get_versioncCs|jrt|��|d�dSrX)r�rZr\r[rrrr�<szOptionParser.print_versioncCs�|dkr|j}|�|�g}|�|�td���|��|jrZ|�t�||��|�d�|j	D]}|�|�
|��|�d�q`|��d�|dd��S)NZOptionsrfrOry)
rr�r{r`r0rWr�rrr�r rXr4)rrr}r�rrrrGs


zOptionParser.format_option_helpcCs|�|j�Sr)rlrkrrrrrlXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*|�|��d�|jrD|�|�|�d�|�|�|��|�|�|��d�|�Sre)	rr]r{rWrirjrrlr4rrrrr [szOptionParser.format_helpcCs |dkrtj}|�|���dSr)r��stdoutrUr r[rrrr�gszOptionParser.print_help)T)NN)rN)N)N)N)N)N)*rr(r)r.rr%rrr,r-r(r)r$r3r4r5r6r7r8r:r;r<r>rCr@r?rHrDrErQrSrr�r
rWrVr\r�rrlr r�rrrrrRs`F�
"

	

'
3	$)





csZ�|kr�S�fdd�|��D�}t|�dkr6|dS|sDt���n|��t�|��dS)Ncsg|]}|���r|�qSr)r)rvZword�rRrrrx�s
�z!_match_abbrev.<locals>.<listcomp>r r)r�rzr�sortr1)rRZwordmapr2rr^rrGts
rG)&�__version__�__all__Z
__copyright__r�r;rbrrr�ImportErrorr0�	Exceptionrr
rrrr1r	r
rr�r�r�r�r�r�rrqrrrrrrrrGrrrrr�<module>s�� 


P




�uA=&ssl.cpython-38.opt-2.pyc000064400000101524151450073350010743 0ustar00U

e5dH��
@s�ddlZddlZddlmZddlmZmZm	Z
ddlZddlmZm
Z
mZddlmZmZmZddlmZmZmZmZmZmZmZddlmZmZddlmZmZmZm Z zdd	lm!Z!Wne"k
r�YnXdd
lm#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,ddlm-Z-m.Z.ej/de0d
d�ed�e
j/de0dd�ed�ej/de0dd�ed�ej/de0dd�ed�e
j/de0dd�ed�ej/de0dd�ed�e1j2Z3e1_3dd�e1j4�5�D�Z6e7e1dd�Z8Gdd�de�Z9Gdd �d e�Z:Gd!d"�d"e�Z;Gd#d$�d$e�Z<ej=d%k�rdd&lm>Z>m?Z?dd'l@m@Z@mAZAmBZBmCZCdd(l@mDZDmEZEddl@ZFddlGZGddlHZHddlIZIeJZKd)gZLeMed*�ZNe-ZOeZPd+d,�ZQd-d.�ZRd/d0�ZSd1d2�ZTed3d4�ZUd5d6�ZVGd7d8�d8ed8d9��ZWGd:d;�d;eWe�ZXGd<d=�d=e�ZYeXjZfdddd>�d?d@�Z[e2fe\dAeXjZddddddB�dCdD�Z]e[Z^e]Z_GdEdF�dF�Z`dGdH�ZaGdIdJ�dJe@�ZbebeY_ce`eY_ddddAe\e2ddKdKdf	dLdM�ZedNdO�ZfdPZgdQZhdRdS�ZidTdU�Zje2dfdVdW�ZkdXdY�ZldS)Z�N)�
namedtuple)�Enum�IntEnum�IntFlag)�OPENSSL_VERSION_NUMBER�OPENSSL_VERSION_INFO�OPENSSL_VERSION)�_SSLContext�	MemoryBIO�
SSLSession)�SSLError�SSLZeroReturnError�SSLWantReadError�SSLWantWriteError�SSLSyscallError�SSLEOFError�SSLCertVerificationError)�txt2obj�nid2obj)�RAND_status�RAND_add�
RAND_bytes�RAND_pseudo_bytes)�RAND_egd)
�HAS_SNI�HAS_ECDH�HAS_NPN�HAS_ALPN�	HAS_SSLv2�	HAS_SSLv3�	HAS_TLSv1�HAS_TLSv1_1�HAS_TLSv1_2�HAS_TLSv1_3)�_DEFAULT_CIPHERS�_OPENSSL_API_VERSION�
_SSLMethodcCs|�d�o|dkS)NZ	PROTOCOL_�PROTOCOL_SSLv23��
startswith��name�r,�/usr/lib64/python3.8/ssl.py�<lambda>|�r.)�source�OptionscCs
|�d�S)NZOP_r(r*r,r,r-r.�r/ZAlertDescriptioncCs
|�d�S)NZALERT_DESCRIPTION_r(r*r,r,r-r.�r/ZSSLErrorNumbercCs
|�d�S)NZ
SSL_ERROR_r(r*r,r,r-r.�r/�VerifyFlagscCs
|�d�S)NZVERIFY_r(r*r,r,r-r.�r/�
VerifyModecCs
|�d�S)NZCERT_r(r*r,r,r-r.�r/cCsi|]\}}||�qSr,r,)�.0r+�valuer,r,r-�
<dictcomp>�sr6ZPROTOCOL_SSLv2c@s6eZdZejZejZejZ	ej
ZejZ
ejZejZdS)�
TLSVersionN)�__name__�
__module__�__qualname__�_sslZPROTO_MINIMUM_SUPPORTEDZMINIMUM_SUPPORTEDZPROTO_SSLv3�SSLv3ZPROTO_TLSv1ZTLSv1Z
PROTO_TLSv1_1ZTLSv1_1Z
PROTO_TLSv1_2ZTLSv1_2Z
PROTO_TLSv1_3ZTLSv1_3ZPROTO_MAXIMUM_SUPPORTEDZMAXIMUM_SUPPORTEDr,r,r,r-r7�sr7c@s$eZdZdZdZdZdZdZdZdS)�_TLSContentType������N)	r8r9r:�CHANGE_CIPHER_SPEC�ALERTZ	HANDSHAKEZAPPLICATION_DATA�HEADERZINNER_CONTENT_TYPEr,r,r,r-r=�sr=c@s�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#S)$�
_TLSAlertTyper�
r>r?r@��(�)�*�+�,�-�.�/�0�1�2�3�<�F�G�P�V�Z�d�m�n�o�p�q�r�s�t�xN)%r8r9r:ZCLOSE_NOTIFYZUNEXPECTED_MESSAGEZBAD_RECORD_MACZDECRYPTION_FAILEDZRECORD_OVERFLOWZDECOMPRESSION_FAILUREZHANDSHAKE_FAILUREZNO_CERTIFICATEZBAD_CERTIFICATEZUNSUPPORTED_CERTIFICATEZCERTIFICATE_REVOKEDZCERTIFICATE_EXPIREDZCERTIFICATE_UNKNOWNZILLEGAL_PARAMETERZ
UNKNOWN_CAZ
ACCESS_DENIEDZDECODE_ERRORZ
DECRYPT_ERRORZEXPORT_RESTRICTIONZPROTOCOL_VERSIONZINSUFFICIENT_SECURITYZINTERNAL_ERRORZINAPPROPRIATE_FALLBACKZ
USER_CANCELEDZNO_RENEGOTIATIONZMISSING_EXTENSIONZUNSUPPORTED_EXTENSIONZCERTIFICATE_UNOBTAINABLEZUNRECOGNIZED_NAMEZBAD_CERTIFICATE_STATUS_RESPONSEZBAD_CERTIFICATE_HASH_VALUEZUNKNOWN_PSK_IDENTITYZCERTIFICATE_REQUIREDZNO_APPLICATION_PROTOCOLr,r,r,r-rG�sDrGc@sdeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdS)�_TLSMessageTyper����������
���r>r?r@rA��C�rCN)r8r9r:Z
HELLO_REQUESTZCLIENT_HELLOZSERVER_HELLOZHELLO_VERIFY_REQUESTZNEWSESSION_TICKETZEND_OF_EARLY_DATAZHELLO_RETRY_REQUESTZENCRYPTED_EXTENSIONSZCERTIFICATEZSERVER_KEY_EXCHANGEZCERTIFICATE_REQUESTZSERVER_DONEZCERTIFICATE_VERIFYZCLIENT_KEY_EXCHANGEZFINISHEDZCERTIFICATE_URLZCERTIFICATE_STATUSZSUPPLEMENTAL_DATAZ
KEY_UPDATEZ
NEXT_PROTOZMESSAGE_HASHrDr,r,r,r-rf�s,rf�win32)�enum_certificates�	enum_crls)�socket�AF_INET�SOCK_STREAM�create_connection)�
SOL_SOCKET�SO_TYPE�
tls-unique�HOSTFLAG_NEVER_CHECK_SUBJECTcCs�|sdS|�d�}|s&|��|��kS|dkr<td�|���|�d�\}}}d|krbtd�|���|sttd�|���|dkr�td�|���|�d�\}}}|r�|s�dS|��|��kS)	NF�*rgz1too many wildcards in certificate DNS name: {!r}.�.z9wildcard can only be present in the leftmost label: {!r}.z>sole wildcard without additional labels are not support: {!r}.z<partial wildcards in leftmost label are not supported: {!r}.)�count�lower�CertificateError�format�	partition)Zdn�hostnameZ	wildcardsZdn_leftmost�sepZdn_remainderZhostname_leftmostZhostname_remainderr,r,r-�_dnsname_matchs@

�������r�cCs�zt�|�}Wntk
r"Yn"Xt�|�|kr6|Std�|���zt�tj|�WStk
rvtd�|���Yntk
r�YnXtd�|���dS)Nz'{!r} is not a quad-dotted IPv4 address.z+{!r} is neither an IPv4 nor an IP6 address.z{!r} is not an IPv4 address.)	�_socketZ	inet_aton�OSErrorZ	inet_ntoa�
ValueErrorr�Z	inet_ptonZAF_INET6�AttributeError)Zipname�addrr,r,r-�_inet_patonDs$��
r�cCst|���}||kS�N)r��rstrip)Zcert_ipaddress�host_ipZipr,r,r-�_ipaddress_matchgsr�cCsJ|std��zt|�}Wntk
r0d}YnXg}|�dd�}|D]^\}}|dkrz|dkrnt||�rndS|�|�qF|dkrF|dk	r�t||�r�dS|�|�qF|s�|�dd�D]6}|D],\}}|dkr�t||�r�dS|�|�q�q�t|�dk�rtd	|d
�t	t
|��f��n,t|�dk�r>td||df��ntd
��dS)Nztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNamer,ZDNSz
IP AddressZsubjectZ
commonNamergz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)r�r��getr��appendr��lenr��join�map�repr)�certr�r�ZdnsnamesZsan�keyr5�subr,r,r-�match_hostnamessB


�
�r��DefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcCsdt��}tj�|d|d�}tj�|d|d�}ttj�|�rF|ndtj�|�rX|ndf|��S)Nrrgrhri)	r;�get_default_verify_paths�os�environr�r��path�isfile�isdir)�parts�cafile�capathr,r,r-r��s��r�cs@eZdZdZ�fdd�Ze�fdd��Ze�fdd��Z�ZS)�_ASN1Objectr,cst�j|ft|dd���S)NFr*��super�__new__�_txt2obj)�cls�oid��	__class__r,r-r��sz_ASN1Object.__new__cst�j|ft|���Sr�)r�r��_nid2obj)r�Znidr�r,r-�fromnid�sz_ASN1Object.fromnidcst�j|ft|dd���S)NTr*r�)r�r+r�r,r-�fromname�sz_ASN1Object.fromname)	r8r9r:�	__slots__r��classmethodr�r��
__classcell__r,r,r�r-r��sr�znid shortname longname oidc@seZdZdZdZdS)�Purposez1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)r8r9r:�SERVER_AUTHZCLIENT_AUTHr,r,r,r-r��sr�cs�eZdZdZdZdZefdd�Zdd�Zd1d	d
�Z	d2dd�Z
d
d�Zdd�Zdd�Z
dd�Zejfdd�Zeed�r�e�fdd��Zej�fdd��Ze�fdd��Zej�fdd��Ze�fdd��Zej�fd d��Zeed!��red"d#��Zejd$d#��Zned%d#��Ze�fd&d'��Zej�fd(d'��Ze�fd)d*��Ze�fd+d,��Zej�fd-d,��Ze�fd.d/��Zej�fd0d/��Z�ZS)3�
SSLContext)ZCAZROOTNcOst�||�}|Sr�)r	r�)r��protocol�args�kwargs�selfr,r,r-r��szSSLContext.__new__cCs4|dkrdSt|t�r&|�d��d�S|�d�SdS)NZidna�ascii)�
isinstance�str�encode�decode)r�r�r,r,r-�_encode_hostname�s

zSSLContext._encode_hostnameFTc	Cs|jj|||||||d�S)N)�sock�server_side�do_handshake_on_connect�suppress_ragged_eofs�server_hostname�context�session)�sslsocket_class�_create)r�r�r�r�r�r�r�r,r,r-�wrap_socket�s�zSSLContext.wrap_socketcCs|jj||||�|�||d�S)N)r�r�r�r�)�sslobject_classr�r�)r��incoming�outgoingr�r�r�r,r,r-�wrap_bio�s�zSSLContext.wrap_biocCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�r�z(NPN protocols must be 1 to 255 in length)�	bytearray�bytesr�rr��extendZ_set_npn_protocols)r�Z
npn_protocols�protosr��br,r,r-�set_npn_protocolss
zSSLContext.set_npn_protocolscs8�dkrd�_n$t��s td����fdd�}|�_dS)Nznot a callable objectcs��|�}�|||�Sr�)r�)�sslobjZ
servernameZsslctx�r��server_name_callbackr,r-�shim_cbs
z3SSLContext.set_servername_callback.<locals>.shim_cb)Zsni_callback�callable�	TypeError)r�r�r�r,r�r-�set_servername_callbacksz"SSLContext.set_servername_callbackcCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�rr�z)ALPN protocols must be 1 to 255 in length)r�r�r�rr�r�Z_set_alpn_protocols)r�Zalpn_protocolsr�r�r�r,r,r-�set_alpn_protocols s
zSSLContext.set_alpn_protocolscCsvt�}z<t|�D].\}}}|dkr|dks4|j|kr|�|�qWntk
r`t�d�YnX|rr|j|d�|S)NZx509_asnTz-unable to enumerate Windows certificate store)�cadata)r�rxr�r��PermissionError�warnings�warn�load_verify_locations)r��	storename�purposeZcertsr��encodingZtrustr,r,r-�_load_windows_store_certs+sz$SSLContext._load_windows_store_certscCs@t|t�st|��tjdkr4|jD]}|�||�q"|��dS)Nrw)r�r�r��sys�platform�_windows_cert_storesr�Zset_default_verify_paths)r�r�r�r,r,r-�load_default_certs9s


zSSLContext.load_default_certs�minimum_versioncstt�j�Sr�)r7r�r��r�r�r,r-r�BszSSLContext.minimum_versioncs4|tjkr|jtjM_ttt�j�||�dSr�)	r7r<�optionsr1ZOP_NO_SSLv3r�r�r��__set__�r�r5r�r,r-r�Fs
cstt�j�Sr�)r7r��maximum_versionr�r�r,r-r�LszSSLContext.maximum_versioncsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Pscstt�j�Sr�)r1r�r�r�r�r,r-r�TszSSLContext.optionscsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Xsr�cCs|jtj@}|tjkSr��Z_host_flagsr;r�)r�Zncsr,r,r-�hostname_checks_common_name]sz&SSLContext.hostname_checks_common_namecCs,|r|jtjM_n|jtjO_dSr�r�r�r,r,r-r�bscCsdS�NTr,r�r,r,r-r�iscst�j}|dk	r|jSdSdSr�)r��
_msg_callback�
user_function)r��innerr�r,r-r�ms!zSSLContext._msg_callbackcsb�dkr ttt�j�|d�dSt�d�s8t��d����fdd�}�|_ttt�j�||�dS)N�__call__z is not callable.cs�zt|�}Wntk
r YnXzt|�}Wntk
rBYnX|tjkrTt}n|tjkrdt}nt}z||�}Wntk
r�YnX�||||||�Sr�)r7r�r=rFrErGrf)Zconn�	direction�versionZcontent_typeZmsg_type�dataZmsg_enum��callbackr,r-r��s,

�z'SSLContext._msg_callback.<locals>.inner)r�r�r�r��hasattrr�r�)r�rr�r�rr-r��s
cstt�j�Sr�)r&r�r�r�r�r,r-r��szSSLContext.protocolcstt�j�Sr�)r2r��verify_flagsr�r�r,r-r�szSSLContext.verify_flagscsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�scs0t�j}z
t|�WStk
r*|YSXdSr�)r��verify_moder3r�r�r�r,r-r�s

zSSLContext.verify_modecsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�s)FTTNN)FNN) r8r9r:r�r�r��PROTOCOL_TLSr�r�r�r�r�r�r�r�r�r�r�rr	�propertyr��setterr�r�r;r�r�r�rrr�r,r,r�r-r��sl�
�





&%r�)r�r�r�cCs�t|t�st|��tt�}|tjkr0t|_d|_	|s<|s<|rL|�
|||�n|jtkr`|�|�t
|d�r�tj�d�}|r�tjjs�||_|S)NT�keylog_filename�
SSLKEYLOGFILE)r�r�r�r�rr�r��
CERT_REQUIREDr�check_hostnamer��	CERT_NONEr�rr�r�r�r��flags�ignore_environmentr)r�r�r�r�r��
keylogfiler,r,r-�create_default_context�s




rF)�	cert_reqsrr��certfile�keyfiler�r�r�cCs�t|t�st|��t|�}	|s$d|	_|dk	r2||	_|r<d|	_|rL|sLtd��|sT|r`|	�||�|sl|sl|r||	�|||�n|	jt	kr�|	�
|�t|	d�r�tj
�d�}
|
r�tjjs�|
|	_|	S)NFT�certfile must be specifiedrr	)r�r�r�r�rrr��load_cert_chainr�rr�rr�r�r�r�r
rr)r�rrr�rrr�r�r�r�rr,r,r-�_create_unverified_context�s,



rc@s�eZdZdd�Zed1dd��Zedd��Zejd	d��Zed
d��Z	e	jdd��Z	ed
d��Z
edd��Zedd��Zd2dd�Z
dd�Zd3dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd4d+d,�Zd-d.�Zd/d0�ZdS)5�	SSLObjectcOst|jj�d���dS)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().�r�r�r8�r�r�r�r,r,r-�__init__;s�zSSLObject.__init__FNc	Cs*|�|�}|j||||||d�}||_|S)N)r�r��ownerr�)r�Z	_wrap_bio�_sslobj)	r�r�r�r�r�r�r�r�r�r,r,r-r�As
�zSSLObject._createcCs|jjSr��rr�r�r,r,r-r�MszSSLObject.contextcCs||j_dSr�r�r�Zctxr,r,r-r�RscCs|jjSr��rr�r�r,r,r-r�VszSSLObject.sessioncCs||j_dSr�r�r�r�r,r,r-r�[scCs|jjSr��r�session_reusedr�r,r,r-r"_szSSLObject.session_reusedcCs|jjSr�)rr�r�r,r,r-r�dszSSLObject.server_sidecCs|jjSr�)rr�r�r,r,r-r�iszSSLObject.server_hostname�cCs(|dk	r|j�||�}n|j�|�}|Sr�)r�read)r�r��buffer�vr,r,r-r$oszSSLObject.readcCs|j�|�Sr�)r�write�r�r�r,r,r-r'{szSSLObject.writecCs|j�|�Sr�)r�getpeercert�r�Zbinary_formr,r,r-r)�szSSLObject.getpeercertcCstjr|j��SdSr�)r;rr�selected_npn_protocolr�r,r,r-r+�szSSLObject.selected_npn_protocolcCstjr|j��SdSr�)r;rr�selected_alpn_protocolr�r,r,r-r,�sz SSLObject.selected_alpn_protocolcCs
|j��Sr�)r�cipherr�r,r,r-r-�szSSLObject.ciphercCs
|j��Sr�)r�shared_ciphersr�r,r,r-r.�szSSLObject.shared_cipherscCs
|j��Sr�)r�compressionr�r,r,r-r/�szSSLObject.compressioncCs
|j��Sr�)r�pendingr�r,r,r-r0�szSSLObject.pendingcCs|j��dSr�)r�do_handshaker�r,r,r-r1�szSSLObject.do_handshakecCs
|j��Sr�)r�shutdownr�r,r,r-�unwrap�szSSLObject.unwrapr�cCs|j�|�Sr�)r�get_channel_binding�r�Zcb_typer,r,r-r4�szSSLObject.get_channel_bindingcCs
|j��Sr��rr�r�r,r,r-r��szSSLObject.versioncCs
|j��Sr�)r�verify_client_post_handshaker�r,r,r-r7�sz&SSLObject.verify_client_post_handshake)FNNN)r#N)F)r�)r8r9r:rr�r�rr�rr�r"r�r�r$r'r)r+r,r-r.r/r0r1r3r4r�r7r,r,r,r-r,sF�








	
rcCstt|j�j|_|Sr�)�getattrrr8�__doc__)�funcr,r,r-�_sslcopydoc�sr;cseZdZdd�ZedW�fdd�	�Zeedd	���Zej	d
d	��Zeedd���Z
e
j	d
d��Z
eedd���Zdd�ZdXdd�Z
dd�ZdYdd�Zdd�ZedZdd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zd[�fd(d)�	Zd\�fd*d+�	Zd,d-�Zd]�fd.d/�	Zd^�fd0d1�	Zd_�fd2d3�	Zd`�fd4d5�	Zda�fd6d7�	Zdb�fd8d9�	Zd:d;�Z d<d=�Z!ed>d?��Z"�fd@dA�Z#edBdC��Z$edDdE��Z%�fdFdG�Z&edcdHdI��Z'�fdJdK�Z(dLdM�Z)dNdO�Z*�fdPdQ�Z+edddSdT��Z,edUdV��Z-�Z.S)e�	SSLSocketcOst|jj�d���dS)NzX does not have a public constructor. Instances are returned by SSLContext.wrap_socket().rrr,r,r-r�s�zSSLSocket.__init__FTNc

s�|�tt�tkrtd��|r8|r(td��|dk	r8td��|jrJ|sJtd��t|j|j	|j
|��d�}|j|f|�}	t
t|	�jf|�|	�|���|��||	_||	_d|	_d|	_||	_|�|�|	_||	_||	_z|	��Wn6tk
�r}
z|
jtjkr��d}W5d}
~
XYnXd}||	_ |�r�zH|	jj!|	||	j|	|	jd�|	_|�rj|	��}|d	k�rbtd
��|	�"�Wn$ttfk
�r�|	�#��YnX|	S)Nz!only stream sockets are supportedz4server_hostname can only be specified in client modez,session can only be specified in client modez'check_hostname requires server_hostname)�family�type�proto�filenoFT�rr��zHdo_handshake_on_connect should not be specified for non-blocking sockets)$Z
getsockoptr~rr|�NotImplementedErrorr�r�dictr=r>r?r@r�r�r<r�
settimeout�
gettimeout�detach�_context�_sessionZ_closedrr�r�r�r�r��getpeernamer��errnoZENOTCONN�
_connected�_wrap_socketr1�close)
r�r�r�r�r�r�r�r�r�r��eZ	connected�timeoutr�r,r-r��sj
��
zSSLSocket._createcCs|jSr�)rHr�r,r,r-r�szSSLSocket.contextcCs||_||j_dSr�)rHrr�rr,r,r-r�scCs|jdk	r|jjSdSr�rr�r,r,r-r� s
zSSLSocket.sessioncCs||_|jdk	r||j_dSr�)rIrr�r r,r,r-r�&s
cCs|jdk	r|jjSdSr�r!r�r,r,r-r",s
zSSLSocket.session_reusedcCstd|jj��dS)NzCan't dup() %s instances)rCr�r8r�r,r,r-�dup2s�z
SSLSocket.dupcCsdSr�r,)r��msgr,r,r-�_checkClosed6szSSLSocket._checkClosedcCs|js|��dSr�)rLrJr�r,r,r-�_check_connected:szSSLSocket._check_connectedr#c
Cs�|��|jdkrtd��z*|dk	r4|j�||�WS|j�|�WSWnVtk
r�}z8|jdtkr�|jr�|dk	r|WY�dSWY�dSn�W5d}~XYnXdS)Nz'Read on closed or unwrapped SSL socket.rr/)rSrr�r$rr�Z
SSL_ERROR_EOFr�)r�r�r%�xr,r,r-r$Bs

zSSLSocket.readcCs&|��|jdkrtd��|j�|�S)Nz(Write on closed or unwrapped SSL socket.)rSrr�r'r(r,r,r-r'Ws
zSSLSocket.writecCs|��|��|j�|�Sr�)rSrTrr)r*r,r,r-r)`szSSLSocket.getpeercertcCs*|��|jdkstjsdS|j��SdSr�)rSrr;rr+r�r,r,r-r+fszSSLSocket.selected_npn_protocolcCs*|��|jdkstjsdS|j��SdSr�)rSrr;rr,r�r,r,r-r,nsz SSLSocket.selected_alpn_protocolcCs$|��|jdkrdS|j��SdSr�)rSrr-r�r,r,r-r-vs
zSSLSocket.ciphercCs$|��|jdkrdS|j��SdSr�)rSrr.r�r,r,r-r.~s
zSSLSocket.shared_cipherscCs$|��|jdkrdS|j��SdSr�)rSrr/r�r,r,r-r/�s
zSSLSocket.compressionrcsF|��|jdk	r4|dkr(td|j��|j�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to send() on %s)rSrr�r�r'r��send)r�r�r
r�r,r-rV�s
��zSSLSocket.sendcsL|��|jdk	r"td|j��n&|dkr8t��||�St��|||�SdS)Nz%sendto not allowed on instances of %s)rSrr�r�r��sendto)r�r�Z
flags_or_addrr�r�r,r-rW�s
�zSSLSocket.sendtocOstd|j��dS)Nz&sendmsg not allowed on instances of %s�rCr�rr,r,r-�sendmsg�s�zSSLSocket.sendmsgc
s�|��|jdk	r�|dkr(td|j��d}t|��H}|�d��2}t|�}||krn|�||d��}||7}qJW5QRXW5QRXnt��	||�SdS)Nrz6non-zero flags not allowed in calls to sendall() on %s�B)
rSrr�r��
memoryview�castr�rVr��sendall)r�r�r
r�ZviewZ	byte_viewZamountr&r�r,r-r]�s
�� zSSLSocket.sendallcs,|jdk	r|�|||�St��|||�SdSr�)rZ_sendfile_use_sendr��sendfile)r��file�offsetr�r�r,r-r^�s
zSSLSocket.sendfilecsD|��|jdk	r2|dkr(td|j��|�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to recv() on %s)rSrr�r�r$r��recv�r�Zbuflenr
r�r,r-ra�s
��
zSSLSocket.recvcsj|��|r|dkrt|�}n|dkr*d}|jdk	rV|dkrJtd|j��|�||�St��|||�SdS)Nr#rz8non-zero flags not allowed in calls to recv_into() on %s)rSr�rr�r�r$r��	recv_into�r�r%�nbytesr
r�r,r-rc�s

��zSSLSocket.recv_intocs4|��|jdk	r"td|j��nt��||�SdS)Nz'recvfrom not allowed on instances of %s)rSrr�r�r��recvfromrbr�r,r-rf�s
�zSSLSocket.recvfromcs6|��|jdk	r"td|j��nt��|||�SdS)Nz,recvfrom_into not allowed on instances of %s)rSrr�r�r��
recvfrom_intordr�r,r-rg�s
�zSSLSocket.recvfrom_intocOstd|j��dS)Nz&recvmsg not allowed on instances of %srXrr,r,r-�recvmsg�s�zSSLSocket.recvmsgcOstd|j��dS)Nz+recvmsg_into not allowed on instances of %srXrr,r,r-�recvmsg_into�s�zSSLSocket.recvmsg_intocCs$|��|jdk	r|j��SdSdS)Nr)rSrr0r�r,r,r-r0�s

zSSLSocket.pendingcs|��d|_t��|�dSr�)rSrr�r2)r�Zhowr�r,r-r2�szSSLSocket.shutdowncCs.|jr|j��}d|_|Stdt|���dS�NzNo SSL wrapper around )rr2r�r�)r��sr,r,r-r3s

zSSLSocket.unwrapcCs$|jr|j��Stdt|���dSrj)rr7r�r�r�r,r,r-r7s
z&SSLSocket.verify_client_post_handshakecsd|_t���dSr�)rr��_real_closer�r�r,r-rlszSSLSocket._real_closec	CsF|��|��}z$|dkr(|r(|�d�|j��W5|�|�XdS)NrB)rTrFrErr1)r��blockrPr,r,r-r1s
zSSLSocket.do_handshakec	s�|jrtd��|js|jdk	r&td��|jj|d|j||jd�|_z@|rVt��	|�}nd}t��
|�|s~d|_|jr~|��|WSt
tfk
r�d|_�YnXdS)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!FrAT)r�r�rLrr�rMr�rIr��
connect_ex�connectr�r1r�)r�r�rnZrcr�r,r-�
_real_connect!s0�zSSLSocket._real_connectcCs|�|d�dS)NF�rp�r�r�r,r,r-ro;szSSLSocket.connectcCs|�|d�Sr�rqrrr,r,r-rn@szSSLSocket.connect_excs.t���\}}|jj||j|jdd�}||fS)NT)r�r�r�)r��acceptr�r�r�r�)r�Znewsockr�r�r,r-rsEs�zSSLSocket.acceptr�cCs4|jdk	r|j�|�S|tkr,td�|���dSdS)Nz({0} channel binding type not implemented)rr4�CHANNEL_BINDING_TYPESr�r�r5r,r,r-r4Qs
�zSSLSocket.get_channel_bindingcCs|jdk	r|j��SdSdSr�r6r�r,r,r-r�\s

zSSLSocket.version)FTTNNN)N)r#N)F)r)N)r)rN)r#r)Nr)r#r)Nr)F)r�)/r8r9r:rr�r�rr;r�rr�r"rQrSrTr$r'r)r+r,r-r.r/rVrWrYr]r^rarcrfrgrhrir0r2r3r7rlr1rprornrsr4r�r�r,r,r�r-r<�s��>



	











r<Tc
Csl|r|std��|r |s td��t|�}
||
_|r<|
�|�|rL|
�||�|	rZ|
�|	�|
j||||d�S)Nz5certfile must be specified for server-side operationsr)r�r�r�r�)r�r�rr�rZset_ciphersr�)r�rrr�r�ssl_version�ca_certsr�r�Zciphersr�r,r,r-r�is$

�r�cCs�ddlm}ddlm}d}d}z|�|dd����d}Wn$tk
rbtd||f��Yn0X||dd�|�}||d|f|d	d
��SdS)Nr)�strptime)�timegm)ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecz %d %H:%M:%S %Y GMTrirgz*time data %r does not match format "%%b%s"rhrl)�timerwZcalendarrx�index�titler�)Z	cert_timerwrxZmonthsZtime_formatZmonth_numberZttr,r,r-�cert_time_to_seconds�s
�r|z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----csRtt�|�dd��tg}|�fdd�tdt��d�D�7}|�td�d�|�S)N�ASCII�strictcsg|]}�||d��qS)�@r,)r4�i��fr,r-�
<listcomp>�sz(DER_cert_to_PEM_cert.<locals>.<listcomp>rr�
)	r��base64Zstandard_b64encode�
PEM_HEADER�ranger�r��
PEM_FOOTERr�)Zder_cert_bytesZssr,r�r-�DER_cert_to_PEM_cert�s
"r�cCs\|�t�stdt��|���t�s0tdt��|��tt�tt��}t�|�	dd��S)Nz(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %sr}r~)
r)r�r��strip�endswithr�r�r�Zdecodebytesr�)Zpem_cert_string�dr,r,r-�PEM_cert_to_DER_cert�s
��r�c

Csd|\}}|dk	rt}nt}t|||d�}t|��&}|�|��}|�d�}	W5QRXW5QRXt|	�S)N)rr�T)r
r�_create_stdlib_contextr}r�r)r�)
r�rurvZhostZportrr�r�ZsslsockZdercertr,r,r-�get_server_certificate�s�
r�cCst�|d�S)Nz	<unknown>)�_PROTOCOL_NAMESr�)Z
protocol_coder,r,r-�get_protocol_name�sr�)mr�r��collectionsr�enumrZ_EnumrZ_IntEnumrZ_IntFlagr;rrrr	r
rrr
rrrrrrr�rr�rrrrr�ImportErrorrrrrrrr r!r"r#r$r%�	_convert_r8r&rr'�__members__�itemsr�r8Z_SSLv2_IF_EXISTSr7r=rGrfr�rxryrzr{r|r}r~rr�r�rKr�r�Zsocket_errorrtrZHAS_NEVER_CHECK_COMMON_NAMEZ_RESTRICTED_SERVER_CIPHERSr�r�r�r�r�r�r�r�r�r�r�rrrZ_create_default_https_contextr�rr;r<r�r�r�r|r�r�r�r�r�r�r,r,r,r-�<module>]s�$0������
)
1#9�z�#�/�


_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.opt-1.pyc000064400000070732151450073350017464 0ustar00U

��.en���@s`dddddddddddddd	dd
ddd
dddddddddddddddddddddddddd d!d"d#dddd$d%dd&d'd(d$d)dddd*d+dddddddd,d$d$d$d$dd$dd$d$d$d$d$dddddddddd$dd$d$d$d$d$d$d$d$dd$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$dd$dd$dd$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$ddd$d$dd$dddd$d$d$ddd$d$dddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$dd$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$d$d$d$d$ddd$d$d$dd$d$ddd$d$d$d$d$d$d$dddddd$dd$d$dddddd$ddd$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$ddd$d$d$ddd$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd-ddd.d/d.d.d0d1d2dd3d4d5dd	d6ddd7dd8d9dd:d;dd<ddd=d>d?d@ddd)ddAdBddCdddd
dd$dDdEdFdGdddHddIdJd$dKddddLdMdddddddddNdOdPdddQd$d$dRdd
ddSddddTdUdddVddWd$dXdYddZd4d[d\dd]dd$ddd^d_d`dadbd7ddcddd=ded$dddfdgdhdgdfdhdfdfdgdgdfd\dfdfdfdfdgd$didjdkd$dldmddnd8d$dddddoddpdqdd$ddddrd$d6dsd$d$d$d$dddd$d$ddtdudsdvdwdwdsdx���ZdyS)z��ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPythonz/usr/binz/usr/lib64/python3.8z-L. -lpython3.8zOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8zA/builddir/build/BUILD/Python-3.8.17/build/optimized/coverage.infoz?/builddir/build/BUILD/Python-3.8.17/build/optimized/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz.cpython-38-x86_64-linux-gnu.soi�ZyeszG/usr/include /usr/include /usr/include/python3.8 /usr/include/python3.8z/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8.soz3.8z
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz0/usr/lib64/python3.8/config-3.8-x86_64-linux-gnuzlibpython3.8.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa:-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgoz
libpython3.sozno-frameworkz./python -Ez	python3.8a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa.-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internala-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidzCLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimizedz	@SGI_ABI@z/bin/shz.so���zcpython-38-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczLLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz3/builddir/build/BUILD/Python-3.8.17/build/optimizedz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�>/usr/lib64/python3.8/_sysconfigdata__linux_x86_64-linux-gnu.py�<module>sb2,/��������sre_constants.cpython-38.opt-1.pyc000064400000014331151450073350013025 0ustar00U

e5d��@sDdZdZddlmZmZGdd�de�ZGdd�de�Zeed�Zd	d
�Z	e	d�Z
e
dd
�=e	d�Ze	d�Ze
eeeiZe
eeeiZe
eeeiZeeeeiZeeee iZ!ee"ee#iZ$e%e%e&e&e'e'e(e(e)e*e+e,e-e-e.e.iZ/e%e0e&e1e'e2e(e3e)e4e+e5e-e6e.e7iZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCdZDeEdk�r@dd�ZFeGdd���ZHeH�Id�eH�Ide�eFeHe
d �eFeHed!�eFeHed!�eH�Id"e9�eH�Id#e:�eH�Id$e;�eH�Id%e<�eH�Id&e=�eH�Id'e>�eH�Id(e?�eH�Id)e@�eH�Id*eA�eH�Id+eB�eH�Id,eC�eH�Id-eD�W5QRXeJd.�d
S)/zInternal support module for srei��3�)�	MAXREPEAT�	MAXGROUPScs&eZdZdZdZd�fdd�	Z�ZS)�erroraiException raised for invalid regular expressions.

    Attributes:

        msg: The unformatted error message
        pattern: The regular expression pattern
        pos: The index in the pattern where compilation failed (may be None)
        lineno: The line corresponding to pos (may be None)
        colno: The column corresponding to pos (may be None)
    �reNcs�||_||_||_|dk	r�|dk	r�d||f}t|t�r>d}nd}|�|d|�d|_||�|d|�|_||kr�d||j|jf}nd|_|_t	��
|�dS)Nz%s at position %d�
�
r�z%s (line %d, column %d))�msg�pattern�pos�
isinstance�str�count�lineno�rfind�colno�super�__init__)�selfr	r
r�newline��	__class__��%/usr/lib64/python3.8/sre_constants.pyr%s
zerror.__init__)NN)�__name__�
__module__�__qualname__�__doc__r�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�_NamedIntConstantcstt|��||�}||_|S�N)rr�__new__�name)�cls�valuer"rrrrr!9sz_NamedIntConstant.__new__cCs|jSr �r")rrrr�__repr__>sz_NamedIntConstant.__repr__)rrrr!r&rrrrrr8srrcCs8|����}dd�t|�D�}t��dd�|D��|S)NcSsg|]\}}t||��qSr)r)�.0�ir"rrr�
<listcomp>Esz_makecodes.<locals>.<listcomp>cSsi|]}|j|�qSrr%)r'�itemrrr�
<dictcomp>Fsz_makecodes.<locals>.<dictcomp>)�strip�split�	enumerate�globals�update)�names�itemsrrr�
_makecodesCsr3az
    FAILURE SUCCESS

    ANY ANY_ALL
    ASSERT ASSERT_NOT
    AT
    BRANCH
    CALL
    CATEGORY
    CHARSET BIGCHARSET
    GROUPREF GROUPREF_EXISTS
    IN
    INFO
    JUMP
    LITERAL
    MARK
    MAX_UNTIL
    MIN_UNTIL
    NOT_LITERAL
    NEGATE
    RANGE
    REPEAT
    REPEAT_ONE
    SUBPATTERN
    MIN_REPEAT_ONE

    GROUPREF_IGNORE
    IN_IGNORE
    LITERAL_IGNORE
    NOT_LITERAL_IGNORE

    GROUPREF_LOC_IGNORE
    IN_LOC_IGNORE
    LITERAL_LOC_IGNORE
    NOT_LITERAL_LOC_IGNORE

    GROUPREF_UNI_IGNORE
    IN_UNI_IGNORE
    LITERAL_UNI_IGNORE
    NOT_LITERAL_UNI_IGNORE
    RANGE_UNI_IGNORE

    MIN_REPEAT MAX_REPEAT
���Nz�
    AT_BEGINNING AT_BEGINNING_LINE AT_BEGINNING_STRING
    AT_BOUNDARY AT_NON_BOUNDARY
    AT_END AT_END_LINE AT_END_STRING

    AT_LOC_BOUNDARY AT_LOC_NON_BOUNDARY

    AT_UNI_BOUNDARY AT_UNI_NON_BOUNDARY
a�
    CATEGORY_DIGIT CATEGORY_NOT_DIGIT
    CATEGORY_SPACE CATEGORY_NOT_SPACE
    CATEGORY_WORD CATEGORY_NOT_WORD
    CATEGORY_LINEBREAK CATEGORY_NOT_LINEBREAK

    CATEGORY_LOC_WORD CATEGORY_LOC_NOT_WORD

    CATEGORY_UNI_DIGIT CATEGORY_UNI_NOT_DIGIT
    CATEGORY_UNI_SPACE CATEGORY_UNI_NOT_SPACE
    CATEGORY_UNI_WORD CATEGORY_UNI_NOT_WORD
    CATEGORY_UNI_LINEBREAK CATEGORY_UNI_NOT_LINEBREAK
r����� �@���__main__cCs*t|�}|D]}|�d|||f�qdS)Nz#define %s_%s %d
)�sorted�write)�f�d�prefixr2r*rrr�dump�srCzsre_constants.h�wao/*
 * Secret Labs' Regular Expression Engine
 *
 * regular expression matching engine
 *
 * NOTE: This file is generated by sre_constants.py.  If you need
 * to change anything in here, edit sre_constants.py and run it.
 *
 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
 *
 * See the _sre.c file for information on usage and redistribution.
 */

z#define SRE_MAGIC %d
ZSRE_OPZSREz#define SRE_FLAG_TEMPLATE %d
z#define SRE_FLAG_IGNORECASE %d
z#define SRE_FLAG_LOCALE %d
z#define SRE_FLAG_MULTILINE %d
z#define SRE_FLAG_DOTALL %d
z#define SRE_FLAG_UNICODE %d
z#define SRE_FLAG_VERBOSE %d
z#define SRE_FLAG_DEBUG %d
z#define SRE_FLAG_ASCII %d
z#define SRE_INFO_PREFIX %d
z#define SRE_INFO_LITERAL %d
z#define SRE_INFO_CHARSET %d
Zdone)Kr�MAGIC�_srerr�	Exceptionr�intrr3�OPCODES�ATCODES�CHCODES�LITERAL�LITERAL_IGNORE�NOT_LITERAL�NOT_LITERAL_IGNORE�	OP_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�OP_LOCALE_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�OP_UNICODE_IGNORE�AT_BEGINNINGZAT_BEGINNING_LINE�AT_ENDZAT_END_LINE�AT_MULTILINEZAT_BOUNDARYZAT_LOC_BOUNDARYZAT_NON_BOUNDARYZAT_LOC_NON_BOUNDARY�	AT_LOCALEZAT_UNI_BOUNDARYZAT_UNI_NON_BOUNDARY�
AT_UNICODEZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_LOC_WORDZCATEGORY_NOT_WORDZCATEGORY_LOC_NOT_WORDZCATEGORY_LINEBREAKZCATEGORY_NOT_LINEBREAK�	CH_LOCALEZCATEGORY_UNI_DIGITZCATEGORY_UNI_NOT_DIGITZCATEGORY_UNI_SPACEZCATEGORY_UNI_NOT_SPACEZCATEGORY_UNI_WORDZCATEGORY_UNI_NOT_WORDZCATEGORY_UNI_LINEBREAKZCATEGORY_UNI_NOT_LINEBREAK�
CH_UNICODE�SRE_FLAG_TEMPLATE�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALL�SRE_FLAG_UNICODE�SRE_FLAG_VERBOSE�SRE_FLAG_DEBUG�SRE_FLAG_ASCII�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSETrrC�openr@r?�printrrrr�<module>s�!	
,
��������

pprint.cpython-38.opt-2.pyc000064400000033377151450073350011470 0ustar00U

e5d�S�
@s�ddlZddlZddlZddlZddlmZ	ddddddd	gZ
d$dd
d�dd�Zd%dd
d�dd�Zdd�dd	�Z
dd�Zdd�Zdd�ZGdd�d�Zdd�ZGdd�d�Zdd�Zeeeeeeeeed�h�Zdd�Zd&dd �Z d!d"�Z!e"d#k�r�e �dS)'�N)�StringIO�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp��PFT��compact�
sort_dictscCs"t||||||d�}|�|�dS)N)�stream�indent�width�depthr
r)rr)�objectrrrrr
rZprinter�r�/usr/lib64/python3.8/pprint.pyr/s�cCst|||||d��|�S)N)rrrr
r)rr)rrrrr
rrrrr7s��)rcOst|f|�d|i|��dS)Nr)r)rr�args�kwargsrrrr	=scCst|iddd�dS)NrT��
_safe_repr�rrrrrAscCst|iddd�dS)NrTr
rrrrrrEscCst|iddd�dS)NrT�rrrrrrIsc@s"eZdZdgZdd�Zdd�ZdS)�	_safe_key�objcCs
||_dS�N)r)�selfrrrr�__init__Ysz_safe_key.__init__cCsXz|j|jkWStk
rRtt|j��t|j�ftt|j��t|j�fkYSXdSr)r�	TypeError�str�type�id)r�otherrrr�__lt__\s�z_safe_key.__lt__N)�__name__�
__module__�__qualname__�	__slots__r r&rrrrrMs
rcCst|d�t|d�fS)Nrr
)r)�trrr�_safe_tuplecsr,c@s�eZdZd;ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�ZiZ	dd�Z
e
e	ej<dd�Z
e
e	ejj<dd�Zee	ej<dd�Zee	ej<dd�Zee	ej<ee	ej<dd�Zee	ej<dd �Zee	ej<d!d"�Zee	ej<d#d$�Zee	ejj<d%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$e$e	ej%j<d/d0�Z&e&e	ej'j<d1d2�Z(e(e	ej)j<d3d4�Z*e*e	ej+j<d5d6�Z,e,e	ej-j<d7d8�Z.e.e	ej/j<d9d:�Z0e0e	ej1j<dS)<rr
rNFTrcCs�t|�}t|�}|dkr td��|dk	r8|dkr8td��|sDtd��||_||_||_|dk	rf||_ntj|_t|�|_	||_
dS)Nrzindent must be >= 0zdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts)rrrrrr
rrrrr hs 
zPrettyPrinter.__init__cCs&|�||jddid�|j�d�dS)Nr�
)�_formatr2�write�rrrrrr�szPrettyPrinter.pprintcCs"t�}|�||ddid�|��S�Nr)�	_StringIOr9�getvalue)rrZsiorrrr�szPrettyPrinter.pformatcCs|�|idd�dS)Nrr��formatr;rrrr�szPrettyPrinter.isrecursivecCs |�|idd�\}}}|o|Sr<r?)rr�s�readable�	recursiverrrr�szPrettyPrinter.isreadablec	Cs�t|�}||kr.|�t|��d|_d|_dS|�|||�}|j||}	t|�|	kr�|j�	t
|�jd�}
|
dk	r�d||<|
|||||||d�||=dSt|t
�r�d||<|�||||||d�||=dS|�|�dS)NTFr
)r$r:�
_recursion�
_recursive�	_readable�_reprr1�len�	_dispatch�getr#�__repr__�
isinstance�dict�_pprint_dict)rrrr�	allowance�context�level�objid�rep�	max_width�prrrr9�s0
�zPrettyPrinter._formatc
Csz|j}|d�|jdkr*||jdd�t|�}|rn|jrNt|��td�}	n|��}	|�|	|||d||�|d�dS)N�{r
� ��key�})r:r0rHr7�sorted�itemsr,�_format_dict_items)
rrrrrOrPrQr:Zlengthr\rrrrN�s
�zPrettyPrinter._pprint_dictcCslt|�s|�t|��dS|j}|�|jd�|�t|���||t|j�d|d||�|�d�dS)N�(r
�))rHr:�repr�	__class__r'r9�listr\)rrrrrOrPrQ�clsrrr�_pprint_ordered_dict�s�z"PrettyPrinter._pprint_ordered_dictcCs0|�d�|�||||d||�|�d�dS)N�[r
�])r:�
_format_items�rrrrrOrPrQrrr�_pprint_list�s
�zPrettyPrinter._pprint_listcCsH|�d�t|�dkrdnd}|�||||t|�||�|�|�dS)Nr^r
z,)r_)r:rHrg)rrrrrOrPrQ�endcharrrr�
_pprint_tuple�s
�zPrettyPrinter._pprint_tuplec	Cs�t|�s|�t|��dS|j}|tkr8|�d�d}n&|�|jd�d}|t|j�d7}t|td�}|�||||t|�||�|�|�dS)NrVrZ�({�})r
rX)	rHr:r`ra�setr'r[rrg)	rrrrrOrPrQ�typrjrrr�_pprint_set�s 
�zPrettyPrinter._pprint_setcCs�|j}t|�s|t|��dSg}|�d�}	|dkrD|d7}|d7}|j|}
}t|	�D]�\}}
t|
�}|t|	�dkr�|
|8}
t|�|
kr�|�|�qZt�d|
�}|�	�|}d}t|�D]h\}}||}|t|�dkr�|t|	�dkr�||8}tt|��|k�r"|�r|�t|��|}q�|}q�|rZ|�t|��qZt|�dk�rV||�dS|dk�rh|d�t|�D],\}}|dk�r�|dd|�||��qp|dk�r�|d	�dS)
NTr
z\S*\s*�r^rr8rWr_)
r:rHr`�
splitlinesr1�	enumerate�append�re�findall�pop)rrrrrOrPrQr:Zchunks�linesZ
max_width1rT�i�linerS�partsZ
max_width2�current�j�part�	candidaterrr�_pprint_strsT
 


zPrettyPrinter._pprint_strcCs�|j}t|�dkr"|t|��dS|dk}|rF|d7}|d7}|d�d}	t||j||�D]$}
||	�||
�|	s\dd|}	q\|r�|d�dS)N�r
r^rqr8rWr_)r:rHr`�_wrap_bytes_reprr1)rrrrrOrPrQr:Zparens�delimrSrrr�
_pprint_bytes3s"zPrettyPrinter._pprint_bytesc	Cs>|j}|d�|�t|�||d|d||d�|d�dS)Nz
bytearray(�
r
r_)r:r��bytes)rrrrrOrPrQr:rrr�_pprint_bytearrayHs�zPrettyPrinter._pprint_bytearraycCs8|�d�|�|��||d|d||�|�d�dS)Nz
mappingproxy(�
r
r_)r:r9�copyrhrrr�_pprint_mappingproxyQs
�z"PrettyPrinter._pprint_mappingproxyc	Cs�|j}||j7}dd|}t|�d}	t|�D]f\}
\}}|
|	k}
|�|||�}||�|d�|�|||t|�d|
r�|nd||�|
s0||�q0dS)N�,
rWr
z: r)r:r0rHrsrGr9)rr\rrrOrPrQr:�delimnlZ
last_indexryrY�ent�lastrSrrrr]Ys 

�z PrettyPrinter._format_dict_itemscCsL|j}||j7}|jdkr,||jdd�dd|}d}	|j|d}
}t|�}zt|�}
Wntk
rxYdSXd}|�sH|
}zt|�}
Wn(tk
r�d}||8}|
|8}
YnX|j�r|�|||�}t|�d}|
|kr�|}
|	r�|}	|
|k�r|
|8}
||	�d}	||�q~||	�|}	|�	||||�r<|nd||�q~dS)	Nr
rWr�rqFTr�, )
r:r0r1�iter�next�
StopIterationr6rGrHr9)rr\rrrOrPrQr:r�r�rrT�itZnext_entr�r�rS�wrrrrgjsR



�zPrettyPrinter._format_itemscCs4|�||��|j|�\}}}|s&d|_|r0d|_|S)NFT)r@r�r/rFrE)rrrPrQr`rBrCrrrrG�s�
zPrettyPrinter._reprcCst|||||j�Sr)rr7)rrrP�	maxlevelsrQrrrr@�szPrettyPrinter.formatc	Cs�t|�s|�t|��dS|�|j||�}|j}|t|j�d7}|�d|j|d|f�|�||||d||�|�d�dS)Nr
z	%s(%s,
%srWr_)rHr:r`rG�default_factoryrar'rN)	rrrrrOrPrQZrdfrcrrr�_pprint_default_dict�sz"PrettyPrinter._pprint_default_dictc	Cs�t|�s|�t|��dS|j}|�|jd�|jdkrN|�|jdd�|��}|�|||t|j�d|d||�|�d�dS)Nrlr
rWrrm)rHr:r`rar'r0�most_commonr])	rrrrrOrPrQrcr\rrr�_pprint_counter�s
�zPrettyPrinter._pprint_counterc
	Cs�t|j�s|�t|��dS|j}|�|jd�|t|j�d7}t|j�D]d\}}	|t|j�dkr�|�|	|||d||�|�d�qN|�|	||d||�|�dd|�qNdS)Nr^r
r_r�rW)rH�mapsr:r`rar'rsr9)
rrrrrOrPrQrcry�mrrr�_pprint_chain_map�s
zPrettyPrinter._pprint_chain_mapc	Cs�t|�s|�t|��dS|j}|�|jd�|t|j�d7}|�d�|jdkrz|�||||d||�|�d�n:|�|||d||�|�|j||�}|�dd||f�dS)Nr^r
rerz])z],
%smaxlen=%s)rW)rHr:r`rar'�maxlenrgrG)	rrrrrOrPrQrcZrmlrrr�
_pprint_deque�s&

��zPrettyPrinter._pprint_dequec	Cs|�|j|||||d�dS�Nr
�r9�datarhrrr�_pprint_user_dict�szPrettyPrinter._pprint_user_dictc	Cs|�|j|||||d�dSr�r�rhrrr�_pprint_user_list�szPrettyPrinter._pprint_user_listc	Cs|�|j|||||d�dSr�r�rhrrr�_pprint_user_string�sz!PrettyPrinter._pprint_user_string)r
rNN)2r'r(r)r rrrrr9rIrNrMrKrd�_collections�OrderedDictrirbrk�tuplerprn�	frozensetr�r"r�r�r��	bytearrayr��_types�MappingProxyTyper]rgrGr@r��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrrrrrgs^�+




1


)	cCs�t|�}|tkrt|�ddfSt|dd�}t|t��rD|tjk�rD|sJdSt|�}|rl||krldd||kfS||kr�t|�ddfSd||<d}d}	g}
|
j	}|d7}|r�t
|��td�}n|��}|D]b\}
}t
|
||||�\}}}t
|||||�\}}}|d||f�|�o|�o|}|�s$|r�d}	q�||=d	d
�|
�||	fSt|t��r\|tjk�stt|t��rn|tjk�rnt|t��r�|�s�dSd}n"t|�dk�r�d
}n|�s�dSd}t|�}|�r�||k�r�|dd||kfS||k�r�t|�ddfSd||<d}d}	g}
|
j	}|d7}|D]8}t
|||||�\}}}||�|�sFd}|�rd}	�q||=|d
�|
�||	fSt|�}||�o�|�d�dfS)NTFrK)z{}TFz{...}r
rXz%s: %sz{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)z...�<)r#�_builtin_scalarsr`�getattr�
issubclassrMrKr$rDrtr[r\r,r�joinrbr�rH�
startswith)rrPr�rQrro�rrRrBrCZ
componentsrtr\�k�vZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurr@�oZoreprZ	oreadableZorecurrSrrrr�s�
��
rcCsdt|�jt|�fS)Nz<Recursion on %s with id=%s>)r#r'r$rrrrrD?s�rDcCs�ddl}|dkr,ddddgddd�fgd	}t�}|��}t|iddd
�|��}|�|�|��}td||�td||�dS)
Nr�string)r
r�r���)��i��Tz_safe_repr:zpformat:)�timer�perf_counterrr�print)rr�rU�t1�t2Zt3rrr�
_perfcheckDs
r�ccs�d}t|�dd}tdt|�d�D]T}|||d�}||}||krP||8}tt|��|krt|rnt|�V|}q$|}q$|r�t|�VdS)N�r�r)rH�ranger`)rrrOr|r�ryr~rrrrr�Qs
r��__main__)Nr
rN)r
rN)N)#�collectionsr�ru�sysr3�typesr��iorr=�__all__rrr	rrrrr,rrr�r"r�r�r-�float�complexr5r#r�rDr�r�r'rrrr�<module>%sH
���F�


sysconfig.cpython-38.opt-2.pyc000064400000032237151450073350012152 0ustar00U

��.e@a�
@sddlZddlZddlmZmZddddddd	d
ddd
gZdhZddddddddd�ddddddddd�ddddddddd�d d d!d!d"d#d$d%�d&d&d'd(d)d*d$d%�d+d+d,d,d-d*d$d%�d.�Zd%Zej	�
�dZd/ejdd0�Z
d1ejdd0�Zej�ej�Zej�ej�Zej�ej�Zej�ej�ZdadZd2d3�Zej�rRej�eej��Znee���Zej d4k�r�e�!��"d5��r�eej�#eee��Zd6ej$k�r�eej$d6�Zd7d8�Z%e&ed9d�Z'ej d4k�r�d:d;�Z(e(e�Ze(e'�Z'did=d>�Z)e)d?�Z*e*�rd@D]Z+dAee+dB<dCee+dD<�q�dEdF�Z,dGdH�Z-dIdJ�Z.dKdL�Z/dMdN�Z0djdOdP�Z1dQd�Z2dRdS�Z3dTdU�Z4dVdW�Z5dXdY�Z6dkdZd
�Z7d[d�Z8d\d�Z9d]d�Z:e/�dd?fd^d	�Z;e/�dd?fd_d�Z<d`d�Z=dad�Z>dbd
�Z?dcd�Z@ddde�ZAdfdg�ZBeCdhk�r�eB�dS)l�N)�pardir�realpath�get_config_h_filename�get_config_var�get_config_vars�get_makefile_filename�get_path�get_path_names�	get_paths�get_platform�get_python_version�get_scheme_names�parse_config_hZMACOSX_DEPLOYMENT_TARGETz/{installed_base}/lib64/python{py_version_short}z){platbase}/lib64/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz7{platbase}/lib64/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z
{base}/binz{base})�stdlib�
platstdlib�purelib�platlib�include�platinclude�scripts�dataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz
{base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scriptsz#{userbase}/Python{py_version_nodot}z1{userbase}/Python{py_version_nodot}/site-packagesz+{userbase}/Python{py_version_nodot}/Includez+{userbase}/Python{py_version_nodot}/Scriptsz
{userbase})rrrrrrrz){userbase}/lib64/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz7{userbase}/lib64/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packagesz{userbase}/include)�posix_prefix�
posix_home�ntZnt_userZ
posix_userZosx_framework_user�%d.%d�z%d%dcCs(z
t|�WStk
r"|YSXdS�N)r�OSError)�path�r�!/usr/lib64/python3.8/sysconfig.py�_safe_realpathis
r!r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�osr�isfile�join)�d�fnrrr �_is_python_source_dir~sr'�_homecCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)r"r�normcase�
startswithr$�_PREFIX)r%rrr �_fix_pcbuild�s
�r,FcCs|rtrtt�Stt�Sr)�	_sys_homer'�
_PROJECT_BASE)Z
check_homerrr �is_python_build�sr/T)rrz{srcdir}/Includerz{projectbase}/.rc
Csnz|jf|�WStk
rhz|jftj�WYStk
rb}ztd|�d�W5d}~XYnXYnXdS)Nz{%s})�format�KeyErrorr"�environ�AttributeError)�sZ
local_vars�varrrr �_subst_vars�sr6cCs0|��}|��D]\}}||kr"q|||<qdSr)�keys�items)Ztarget_dictZ
other_dictZtarget_keys�key�valuerrr �_extend_dict�s
r;cCsbi}|dkri}t|t��t|��D]4\}}tjdkrFtj�|�}tj�t	||��||<q(|S)N)�posixr)
r;r�_INSTALL_SCHEMESr8r"�namer�
expanduser�normpathr6)�scheme�vars�resr9r:rrr �_expand_vars�s
rDcCstjdkrdStjS)Nr<r)r"r>rrrr �_get_default_scheme�s
rEcCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)r"rr?r$)�argsrrr �joinuser�sz_getuserbase.<locals>.joinuserr�APPDATA�~�Python�darwin�Libraryrrz.local)r"r2�getr>�sys�platform�
_framework�version_info)�env_baserH�baserrr �_getuserbase�s


�rUc	Cs`ddl}|�d�}|�d�}|�d�}|dkr2i}i}i}t|dd��}|��}	W5QRX|	D]�}
|
�d�s^|
��dkrzq^|�|
�}|r^|�d	d
�\}}
|
��}
|
�dd�}d|kr�|
||<q^z|t	kr�t
�t|
�}
Wn$t
k
r�|
�dd�||<Yq^X|
||<q^t|�
��}d
}t|�dk�r&t|�D�]�}||}|�|�}|�|�}|�rv|�rv|��|��k�rp|n|}n|�r�|n|}|dk	�r|�d	�}d}||k�r�t||�}n�||k�r�d}nx|tjk�r�tj|}n`||k�r0|�d��r
|dd�|k�r
d}n$d||k�rd}nt|d|�}nd||<}|�r||��d�}|d|���||}d|k�r~|||<n�z|t	k�r�t
�t|�}Wn"t
k
�r�|��||<Yn
X|||<|�|�|�d��r|dd�|k�r|dd�}||k�r|||<n|||<|�|��q,�q|��D]"\}}
t|
t��r.|
��||<�q.|�|�|S)Nrz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}�surrogateescape)�errors�#��rz$$�$)ZCFLAGSZLDFLAGSZCPPFLAGSTFZPY_�)�re�compile�open�	readlinesr*�strip�match�group�replace�_ALWAYS_STR�
ValueError�int�listr7�len�tuple�search�start�strr"r2�end�remover8�
isinstance�update)�filenamerBr]Z_variable_rxZ_findvar1_rxZ_findvar2_rxZdoneZnotdone�f�lines�line�m�n�vZtmpvZ	variablesZrenamed_variablesr>r:Zm1Zm2�found�itemZafter�krrr �_parse_makefile�s�	












�



�


r|cCsdtrtj�tptd�Sttd�r0dttj	f}nd}ttj
d�rP|dtj
j7}tj�td�|d�S)NZMakefile�abiflagszconfig-%s%sZconfig�
_multiarchz-%sr)
�
_PYTHON_BUILDr"rr$r-r.�hasattrrO�_PY_VERSION_SHORTr}�implementationr~r)Zconfig_dir_namerrr rWs
c
Cs(tj�ddjtjtjttjdd�d��S)NZ_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}r~rY)ZabirPZ	multiarch)	r"r2rNr0rOr}rP�getattrr�rrrr �_get_sysconfigdata_nameds��r�c
Cs�ddl}i}t�}zt||�WnJtk
rj}z,d|}t|d�rR|d|j}t|��W5d}~XYnXt�}z"t|��}t||�W5QRXWnJtk
r�}z,d|}t|d�r�|d|j}t|��W5d}~XYnXt	r�|d|d<t
�}dtjk�r$ddl
}|�|�}	||	_|	tj|<dt�tf}
ttd	��rF|
d
7}
tj|
dd�tj�|
|d
�}t|ddd��(}|�d�|�d�|j||d�W5QRXtdddd��}|�|
�W5QRXdS)Nrz.invalid Python installation: unable to open %s�strerrorz (%s)ZLDSHAREDZ	BLDSHAREDrLzbuild/lib.%s-%sZgettotalrefcountz-pydebugT)�exist_okz.py�w�utf8)�encodingzB# system configuration generated and used by the sysconfig module
zbuild_time_vars = )�streamzpybuilddir.txt)�pprintrr|rr�r�rr_rrr�rOrP�types�
ModuleType�build_time_vars�modulesrr�r"�makedirsrr$�write)r�rBZmakefile�e�msgZconfig_hrsr>r��moduleZ
pybuilddirZdestfilerrr �_generate_posix_varsmsL







r�cCs0t�}t|t�t�dgd�}|j}|�|�dS)Nr�r)r��
__import__�globals�localsr�rq)rBr>Z_tempr�rrr �_init_posix�sr�cCsfddl}td�|d<td�|d<td�|d<|��d|d<d	|d
<t|d<tj�ttj	��|d<dS)
NrrZLIBDESTrZ
BINLIBDESTrZ	INCLUDEPY�
EXT_SUFFIXz.exeZEXEZVERSIONZBINDIR)
�_impr�extension_suffixes�_PY_VERSION_SHORT_NO_DOTr"r�dirnamer!rO�
executable)rBr�rrr �_init_non_posix�sr�c	Cs�|dkri}ddl}|�d�}|�d�}|��}|s6q�|�|�}|r�|�dd�\}}z|tkrbt�t|�}Wntk
r�YnX|||<q(|�|�}|r(d||�d�<q(|S)Nrz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rZr)r]r^�readlinerbrcrerfrg)	�fprBr]Z	define_rxZundef_rxrurvrwrxrrr r�s,




cCsBtr,tjdkr"tj�tptd�}q4tp(t}ntd�}tj�|d�S)NrZPCrz
pyconfig-64.h)rr"r>rr$r-r.r)Zinc_dirrrr r�s

cCsttt��Sr)rj�sortedr=rrrr r
�scCstSr)�_SCHEME_KEYSrrrr r	�scCs|rt||�St|SdSr)rDr=)rArB�expandrrr r
�s
cCst|||�|Sr)r
)r>rArBr�rrr r	scGsxtdk�rFiattd<ttd<ttd<ttd<ttd<ttd<ttd<ttd<ttd	<ttd
<zt	j
td<Wntk
r�dtd<YnXtj
d
kr�tt�tj
dkr�tt�t�d�}|dk	r�|td<t�td<t�dt�}tj
dk�rt�rtj�t��}tj�||�}ntj�t��}t|�td<t	jdk�rFddl}|�t�|�rpg}|D]}|�t�|���qT|StSdS)N�prefix�exec_prefixZ
py_versionZpy_version_shortZpy_version_nodotZinstalled_baserTZinstalled_platbaseZplatbaseZprojectbaser}rYrr<r��SO�userbase�srcdirrLr)�_CONFIG_VARSr+�_EXEC_PREFIX�_PY_VERSIONr�r��_BASE_PREFIX�_BASE_EXEC_PREFIXr.rOr}r3r"r>r�r�rNrUrrr�rr$r!rP�_osx_supportZcustomize_config_vars�append)rGr�r�rTr�Zvalsr>rrr rsP





cCs*|dkrddl}|�dtd�t��|�S)Nr�rz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningrrN)r>r�rrr r^sc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjStjdksZttd	�s`tjSd
tjkrttjd
St��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd|||fS|dd �d!k�r�d!}ddl}|�
d"�}|�|�}|�r�|��}n2|dd �d#k�r�ddl}	|	�t�|||�\}}}d$|||fS)%NrZamd64z	win-amd64z(arm)z	win-arm32z(arm64)z	win-arm64r<�unameZ_PYTHON_HOST_PLATFORM�/rY� �_�-�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%sr\rZ32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+rLz%s-%s-%s)r"r>rO�version�lowerrPr�r2r�rdrg�maxsizer]r^rbrcr�Zget_platform_osxr)
ZosnameZhost�releaser��machineZbitnessr]Zrel_rervr�rrr rjsT


 



�
cCstSr)r�rrrr r�scCsFtt|����D]0\}\}}|dkr0td|�td||f�qdS)Nrz%s: z
	%s = "%s")�	enumerater�r8�print)�titler�indexr9r:rrr �_print_dict�sr�cCsfdtjkrt�dStdt��tdt��tdt��t�tdt��t�tdt	��dS)Nz--generate-posix-varszPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ	Variables)
rO�argvr�r�rrrEr�r
rrrrr �_main�s
r��__main__)F)N)N)Dr"rOZos.pathrr�__all__rer=r�r��splitr�rRr�r�rr@r�r+�base_prefixr�r�r��base_exec_prefixr�r�Z
_USER_BASEr!r�r�r.�getcwdr>r��endswithr$r2r'r�r-r,r/rrAr6r;rDrErUr|rr�r�r�r�rrr
r	r
rrrrrr�r��__name__rrrr �<module>s����
���
�
��?�
	
	

	?
"MP
subprocess.cpython-38.opt-2.pyc000064400000072746151450073350012347 0ustar00U

e5d�1�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddlm
Zddddddd	d
ddd
dddgZzddl
Z
ddlZdZWn0ek
r�dZddlZddlZddlZYn�XddlmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%e�&ddddddddddddd d!d"d#d$d%d&g�Gd'd�de'�Z(Gd(d�de(�Z)Gd)d�de(�Z*e�r�Gd*d�d�Z+Gd+d,�d,e,�Z-n&e.ed-d.�Z/e0ed/��r�ej1Z2nej3Z2e�r�dZ4d0d1�Z5ngZ4d2d1�Z5d3Z6d4Z7d5Z8d6d7�Z9d8d9�Z:dd:�d;d�Z;d<d�Z<dd:�d=d
�Z=Gd>d�de>�Z?ddddd?�d@d�Z@dAdB�ZAdCd�ZBdDd	�ZCdEdF�ZDeD�ZEGdGd�de>�ZFdS)H�N)�	monotonic�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOBrrrrrrrr�STARTUPINFOrrrrrrrr r!r"c@seZdZdS)rN)�__name__�
__module__�__qualname__�r'r'�"/usr/lib64/python3.8/subprocess.pyr`sc@s8eZdZd	dd�Zdd�Zedd��Zejdd��ZdS)
rNcCs||_||_||_||_dS�N)�
returncode�cmd�output�stderr)�selfr*r+r,r-r'r'r(�__init__jszCalledProcessError.__init__cCsh|jrT|jdkrTzd|jt�|j�fWStk
rPd|j|jfYSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r*r+�signalZSignals�
ValueError�r.r'r'r(�__str__ps���zCalledProcessError.__str__cCs|jSr)�r,r2r'r'r(�stdout|szCalledProcessError.stdoutcCs
||_dSr)r4�r.�valuer'r'r(r5�s)NN�r$r%r&r/r3�propertyr5�setterr'r'r'r(rcs

c@s8eZdZd	dd�Zdd�Zedd��Zejdd��ZdS)
rNcCs||_||_||_||_dSr))r+�timeoutr,r-)r.r+r;r,r-r'r'r(r/�szTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r+r;r2r'r'r(r3�s
�zTimeoutExpired.__str__cCs|jSr)r4r2r'r'r(r5�szTimeoutExpired.stdoutcCs
||_dSr)r4r6r'r'r(r5�s)NNr8r'r'r'r(r�s

c@s,eZdZddddddd�dd�Zdd�ZdS)r#rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)N�handle_listr<)r.r=r>r?r@rArBr'r'r(r/�szSTARTUPINFO.__init__cCs@|j��}d|kr"t|d�|d<t|j|j|j|j|j|d�S)NrCr<)	rB�copy�listr#r=r>r?r@rA)r.Z	attr_listr'r'r(rD�s
�zSTARTUPINFO.copy)r$r%r&r/rDr'r'r'r(r#�s�	c@s2eZdZdZejfdd�Zdd�Zdd�ZeZ	dS)	�HandleFcCs|jsd|_||�dS)NT)�closed)r.�CloseHandler'r'r(�Close�szHandle.ClosecCs |jsd|_t|�Std��dS)NTzalready closed)rG�intr1r2r'r'r(�Detach�sz
Handle.DetachcCsd|jjt|�fS)Nz%s(%d))�	__class__r$rJr2r'r'r(�__repr__�szHandle.__repr__N)
r$r%r&rG�_winapirHrIrKrM�__del__r'r'r'r(rF�s
rFZPIPE_BUFi�PollSelectorcCsdSr)r'r'r'r'r(�_cleanup�srQc	Cs\tdkrdStdd�D]>}|jtjd�}|dk	rzt�|�Wqtk
rTYqXqdS)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover1)�inst�resr'r'r(rQ�s���������cCs*g}tjj}|dkr&|�dd|�|S)Nr�-�O)rV�flags�optimize�append)�argsr7r'r'r(�"_optim_args_from_interpreter_flagss
rdcCsVddddddd�}t�}|��D].\}}ttj|�}|dkr |�d	||�q tjjrd|�d
�n$tjjrv|�d�tjjr�|�d�tj	dd�}tjj
}ttd
i�}d|k}|dkr�|�d�n|r�|�d�|r�|�d�|D]}|�d|�q�|�r
|�d�dD]B}||k�r||}	|	dk�r4|}
nd||	f}
|�d|
f��q|S)N�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrr^z-Iz-Ez-s�	_xoptions�dev�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-Xrr)Zfaulthandler�tracemallocZ
importtimeZshowalloccountZshowrefcount�utf8Tz%s=%sru)
rd�items�getattrrVr`rb�isolated�ignore_environment�no_user_site�warnoptionsrorX�extend)Zflag_opt_maprc�flag�optrhZwarnoptsroZxoptions�dev_moder7�argr'r'r(�_args_from_interpreter_flagssP�






r��r;c
OsLt||��8}z|j|d�WW5QR�S|���YnXW5QRXdS)Nr�)r�wait�kill)r;�	popenargs�kwargs�pr'r'r(rLscOs6t||�}|r2|�d�}|dkr(|d}t||��dS)Nrcr)r�getr)r�r��retcoder+r'r'r(r]s



cOsbd|krtd��d|krJ|ddkrJ|�d�s8|�d�r>d}nd}||d<t|t|dd	�|��jS)
Nr5z3stdout argument not allowed, it will be overridden.�input�universal_newlines�text��T)r5r;�check)r1r�rrr5)r;r�r��emptyr'r'r(r
ps#�c@s&eZdZddd�Zdd�Zdd�ZdS)	rNcCs||_||_||_||_dSr))rcr*r5r-)r.rcr*r5r-r'r'r(r/�szCompletedProcess.__init__cCshd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�t|�jd�|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatrcr*r5rbr-�typer$�join)r.rcr'r'r(rM�s

�

zCompletedProcess.__repr__cCs |jrt|j|j|j|j��dSr))r*rrcr5r-r2r'r'r(�check_returncode�s�z!CompletedProcess.check_returncode)NN)r$r%r&r/rMr�r'r'r'r(r�s
	)r��capture_outputr;r�cOs |dk	r&|�d�dk	rtd��t|d<|r^|�d�dk	sF|�d�dk	rNtd��t|d<t|d<t||���}z|j||d�\}}Wn^tk
r�}	z,|��tr�|��\|	_|	_	n|�
��W5d}	~	XYn|���YnX|��}
|�r|
�rt|
|j
||d��W5QRXt|j
|
||�S)N�stdinz/stdin and input arguments may not both be used.r5r-z@stdout and stderr arguments may not be used with capture_output.r��r,r-)r�r1rr�communicaterr��
_mswindowsr5r-r��pollrrcr)r�r�r;r�r�r�Zprocessr5r-�excr�r'r'r(r�s8�cCs�g}d}ttj|�D]�}g}|r*|�d�d|kp>d|kp>|}|rN|�d�|D]b}|dkrj|�|�qR|dkr�|�dt|�d�g}|�d�qR|r�|�|�g}|�|�qR|r�|�|�|r|�|�|�d�qd�|�S)	NF� �	�"�\�z\"r�)�map�os�fsdecoderb�lenr~r�)�seq�resultZ	needquoter�Zbs_buf�cr'r'r(�list2cmdline	s4




r�c
Cslzt|ddtd�}d}Wn.tk
rF}z|j}|j}W5d}~XYnX|dd�dkrd|dd�}||fS)NT)�shellr�r-rr[�
)r
rrr,r*)r+�dataZexitcodeZexr'r'r(rRscCst|�dS�Nrs)r)r+r'r'r(r	qs
c
Cs�tsttd�sdStjdkr dSzjt�d�}|jdd�}t|�dkrHt�|d	}t	t
t|d�d
���}tjdkr�|dkr�|d
kr�WdSWnttt
fk
r�YnXdS)N�posix_spawnF�darwinT�CS_GNU_LIBC_VERSIONrs)�maxsplitr�r�.ZlinuxZglibc)r��)r��hasattrr�rV�platform�confstr�splitr�r1�tupler�rJ�AttributeError�OSError)Zver�partsZlibc�versionr'r'r(�_use_posix_spawn~s 



r�c@s�eZdZdZdJdddd�dd	�Zed
d��Zejdd��Zd
d�Zdd�Z	dd�Z
eje
jfdd�Zdd�Zdd�ZdKdd�Zdd�Zdd�ZdLdd �ZdMd!d"�Zd#d$�Ze�rd%d&�Zd'd(�Zd)d*�Zd+d,�Zdejejej fd-d.�Z!d/d0�Z"d1d2�Z#d3d4�Z$d5d6�Z%d7d8�Z&e&Z'n�d9d&�Zd:d;�Z(d<d,�Ze)j*e)j+e)j,e)j-e)j.e)j/fd=d>�Z0de)j1e)j2e3j4fd?d.�Z!d@dA�Z5dBd0�Z"dCd4�Z$dDdE�Z6dFd6�Z%dGd8�Z&dHdI�Z'dS)NrFr[NTrr')�encoding�errorsr�cCslt�t��|_d|_d|_|dkr(d}t|t�s:td��t	rP|dk	r�t
d��n8|rh|sht�dt
�d}|
dk	rxt
d��|dkr�t
d	��||_d|_d|_d|_d|_d|_||_||_|dk	r�|dk	r�t|�t|�kr�td
��|�|||�\}}}}}}t	�rN|dk�rt�|��d�}|dk�r4t�|��d�}|dk�rNt�|��d�}|�pb|�pb|�pb||_d|_d|_|j�r�|dk�r�d}d}nd}z�|dk�r�t� |d
|�|_|j�r�tj!|jd|||d�|_|dk�rt� |d|�|_|j�rtj!|j||d�|_|dk�r:t� |d|�|_|j�r:tj!|j||d�|_|�"||||||
||
||	||||||||�Wn�t#d|j|j|jf�D]*}z|�$�Wnt%k
�r�YnX�q�|j�s`g}|t&k�r�|�'|�|t&k�r�|�'|�|t&k�r�|�'|�t(|d��r|�'|j)�|D]H}z*t	�r8t|t*��r8|�+�n
t,�$|�Wnt%k
�rZYnX�q�YnXdS)NFr[zbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?rs�wb)�
write_through�line_bufferingr�r��rb)r�r��_devnull)-rQ�	threadingZLock�
_waitpid_lock�_input�_communication_started�
isinstancerJ�	TypeErrorr�r1�warnings�warn�RuntimeWarningrcr�r5r-�pidr*r�r��boolr�_get_handles�msvcrtZopen_osfhandlerK�	text_mode�_sigint_wait_secs�_closed_child_pipe_fds�io�open�
TextIOWrapper�_execute_child�filter�closer�rrbr�r�rFrIr�)r.rc�bufsize�
executabler�r5r-�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsr�r�r��p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��fZto_close�fdr'r'r(r/�s�


��





�
�
��








zPopen.__init__cCs|jSr))r�r2r'r'r(r�~szPopen.universal_newlinescCst|�|_dSr))r�r�)r.r�r'r'r(r��scCs |�||�}|�dd��dd�S)Nz
r��
)�decode�replace)r.r�r�r�r'r'r(�_translate_newlines�szPopen._translate_newlinescCs|Sr)r'r2r'r'r(�	__enter__�szPopen.__enter__cCs�|jr|j��|jr |j��dz|jr4|j��W5|tkr�|jdkrrz|j|jd�Wntk
rpYnXd|_�dS|��XdS)Nrr�)	r5r�r-�KeyboardInterruptr��_waitrr�r�)r.�exc_typer7�	tracebackr'r'r(�__exit__�s 


zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d�|j|d�|jdkrPtdk	rPt�|�dS)Nzsubprocess %s is still running)�sourcerR)�_child_createdr*r��ResourceWarningrUrTrb)r.Z_maxsizeZ_warnr'r'r(rO�s

�z
Popen.__del__cCs"t|d�st�tjtj�|_|jS)Nr�)r�r�r��devnull�O_RDWRr�r2r'r'r(�_get_devnull�s
zPopen._get_devnullc
Cs�|rZz|j�|�WnDtk
r(Yn2tk
rX}z|jtjkrFn�W5d}~XYnXz|j��WnDtk
r|Yn2tk
r�}z|jtjkr�n�W5d}~XYnXdSr))r��write�BrokenPipeErrorr��errnoZEINVALr�)r.r�r�r'r'r(�_stdin_write�s"zPopen._stdin_writecCsT|jr|rtd��|dkr�|js�|j|j|jg�d�dkr�d}d}|jrT|�|�n6|jrp|j��}|j��n|jr�|j��}|j��|�	�n�|dk	r�t
�|}nd}z�z|�|||�\}}Wnhtk
�r,|dk	r�t
|j|�|��}n|j}d|_z|j|d�Wntk
�r$YnX�YnXW5d|_X|j	|�|�d�}||fS)Nz.Cannot send input after starting communicationr�Trr�)r�r1r�r5r-�countr�readr�r��_time�_communicater��minr��_remaining_timer�r)r.r�r;r5r-�endtime�sigint_timeout�stsr'r'r(r��sH
�



�zPopen.communicatecCs|��Sr))rUr2r'r'r(r�sz
Popen.pollcCs|dkrdS|t�SdSr))r)r.r	r'r'r(r"szPopen._remaining_timecCsL|dkrdS|st�|krHt|j||r0d�|�nd|r@d�|�ndd��dS)Nr�r�)rrrcr�)r.r	�orig_timeoutZ
stdout_seqZ
stderr_seq�skip_check_and_raiser'r'r(�_check_timeout*s�zPopen._check_timeoutcCs�|dk	rt�|}z|j|d�WStk
r�|dk	rLt|j|�|��}n|j}d|_z|j|d�Wntk
r|YnX�YnXdS)Nr�r)rr�r�rr�rr)r.r;r	r
r'r'r(r�6s 
�z
Popen.waitc		Cs�t|dd�}t����}trX|dkr.|�|j�|dkrB|�|j�|dkr�|�|j�nr|dkr~|dkr~||kr~|�tj|�|dkr�|dkr�||kr�|�tj|�|dkr�|dkr�||kr�|�tj|�|dk	r�|�tj|�W5QRXd|_dS)Nr�r[T)	ry�
contextlib�	ExitStackr��callbackrIr�r�r�)	r.r�r�r�r�r�r�Z
devnull_fd�stackr'r'r(�_close_pipe_fdsMs$
zPopen._close_pipe_fdscCs~|dkr|dkr|dkrdSd\}}d\}}d\}}	|dkrtt�tj�}|dkr�t�dd�\}}
t|�}t�|
�nh|tkr�t�dd�\}}t|�t|�}}n<|tkr�t�	|�
��}n$t|t�r�t�	|�}nt�	|�
��}|�|�}|dk�r*t�tj�}|dk�r�t�dd�\}
}t|�}t�|
�nn|tk�rXt�dd�\}}t|�t|�}}n@|tk�rrt�	|�
��}n&t|t��r�t�	|�}nt�	|�
��}|�|�}|dk�r�t�tj�}	|	dk�rdt�dd�\}
}	t|	�}	t�|
�n~|tk�rt�dd�\}}	t|�t|	�}}	nP|tk�r$|}	n@|tk�r>t�	|�
��}	n&t|t��rVt�	|�}	nt�	|�
��}	|�|	�}	||||||	fS)N)r[r[r[r[r[r[�r[r[r)rNZGetStdHandlerZ
CreatePiperFrHrr
r�Z
get_osfhandler�r�rJ�fileno�_make_inheritablerrr)r.r�r5r-r�r�r�r�r�r��_r'r'r(r�nst












�zPopen._get_handlescCs&t�t��|t��ddtj�}t|�S)Nrrs)rNZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrF)r.�handle�hr'r'r(r�s�zPopen._make_inheritablecCstdd�|D��S)NcSs,h|]$}|d@dks$t�|�tjkr|�qS)�)rNZGetFileTypeZFILE_TYPE_CHAR)�.0rr'r'r(�	<setcomp>�s��z,Popen._filter_handle_list.<locals>.<setcomp>)rE)r.rCr'r'r(�_filter_handle_list�szPopen._filter_handle_listcCszt|t�rnNt|t�r.|
r"td��t|g�}n,t|tj�rR|
rFtd��t|g�}nt|�}|dk	rlt�|�}|dkr|t�}n|�	�}d|||fk}|r�|j
tjO_
||_
||_||_|j}t|o�d|ko�|d�}|s�|�r^|�r^|dkr�i}|_t|�dg��}|d<|�r0|t|�t|�t|�g7}|�|�|dd�<|�r^|�sZt�dt�d}|
�r�|j
tjO_
tj|_|�s�tj�d�}|�s�tj�dd	�}tj�|d
d�}tj�|��s�t d��tj�|��r�|}n|}d
�!||�}|dk	�rt�|�}t"�#d||||�z,t�%||ddt|�|	|||�	\}}}}W5|�$|||
|||�Xd|_&t'|�|_(||_)t�*|�dS)Nz$bytes args is not allowed on Windows�0path-like args is not allowed when shell is truer[rCz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZComSpecZ
SystemRootr�ZSystem32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz
{} /c "{}"�subprocess.PopenT)+r��str�bytesr�r�r��PathLiker�r#rDr=rNrr>r?r@rBr�rEr�rJrr�r�r�rrrA�environ�pathr��isabs�FileNotFoundErrorr�rV�auditrZ
CreateProcessr�rF�_handler�rH)r.rcr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listrCZcomspecZsystem_rootZhpZhtr��tidr'r'r(r��s�


��
�
�

��
zPopen._execute_childcCs,|jdkr&||jd�|kr&||j�|_|jS�Nr)r*r()r.rSZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessr'r'r(rUHs
zPopen._internal_pollcCs^|dkrtj}nt|d�}|jdkrXt�|j|�}|tjkrJt|j|��t�	|j�|_|jS)Ni�)
rNZINFINITErJr*�WaitForSingleObjectr(ZWAIT_TIMEOUTrrc�GetExitCodeProcess)r.r;Ztimeout_millisr�r'r'r(r�Ys
�
zPopen._waitcCs|�|���|��dSr))rbrr�)r.Zfh�bufferr'r'r(�
_readerthreadiszPopen._readerthreadcCs\|jrBt|d�sBg|_tj|j|j|jfd�|_d|j_|j��|j	r�t|d�s�g|_
tj|j|j	|j
fd�|_d|j_|j��|jr�|�
|�|jdk	r�|j�|�|��|j��r�t|j|��|j	dk	r�|j�|�|��|j��r�t|j|��d}d}|j�r|j}|j��|j	�r0|j
}|j	��|�r>|dnd}|�rP|dnd}||fS)N�_stdout_buff)�targetrcT�_stderr_buffr)r5r�r/r�ZThreadr.Z
stdout_threadZdaemon�startr-r1Z
stderr_threadr�rr�rZis_aliverrcr�)r.r�r	rr5r-r'r'r(rnsJ
��

��







zPopen._communicatecCsl|jdk	rdS|tjkr"|��nF|tjkr>t�|jtj�n*|tjkrZt�|jtj�nt	d�
|���dS)NzUnsupported signal: {})r*r0�SIGTERM�	terminateZCTRL_C_EVENTr�r�r�ZCTRL_BREAK_EVENTr1r��r.Zsigr'r'r(�send_signal�s




zPopen.send_signalcCsX|jdk	rdSzt�|jd�Wn2tk
rRt�|j�}|tjkrH�||_YnXdSr�)r*rNZTerminateProcessr(�PermissionErrorr,ZSTILL_ACTIVE)r.Zrcr'r'r(r4�s

zPopen.terminatec
Cs,d\}}d\}}d\}}	|dkr"n@|tkr8t��\}}n*|tkrJ|��}nt|t�rZ|}n|��}|dkrln@|tkr�t��\}}n*|tkr�|��}nt|t�r�|}n|��}|dkr�nf|tkr�t��\}}	nP|tkr�|dkr�|}	n
t	j
��}	n.|tk�r|��}	nt|t��r|}	n|��}	||||||	fS)Nrr[)rr��piper
r�r�rJrrrV�
__stdout__)
r.r�r5r-r�r�r�r�r�r�r'r'r(r��sP





�cCs�|dkrtj}i}|rJg}dD]"}
tt|
d�}|dk	r|�|�q||d<g}|||	fD]}|dkrX|�tj|f�qX|df|df|
dffD]"\}}|dkr�|�tj||f�q�|r�||d<tj|||f|�|_d|_	|�
|||||	|
�dS)	N)�SIGPIPEZSIGXFZ�SIGXFSZZ	setsigdefr[rrsr��file_actionsT)r�r#ryr0rb�POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2r�r�r�r)r.rcr�r�r�r�r�r�r�r�r�r�ZsigsetZsignameZsignumr<r�Zfd2r'r'r(�_posix_spawn�s<��zPopen._posix_spawnc)s�t|ttf�r|g}n(t|tj�r6|
r.td��|g}nt|�}|
rlttd�rPdnd}|dg|}�rl�|d<�dkr||d�t�	d�|||�t
�rtj����r|dk�r|�s|�s|dk�r|dks�|d	k�r|dks�|d	k�r|dks�|d	k�r|�s|�
|�|||||
|||�
dS�}t��\}}g}|d
k�rT|�|�t�|�}�q2|D]}t�|��qX�zJz�|dk	�r�g}|��D]>\}}t�|�}d|k�r�td��|�|dt�|���q�nd}t����tj����r�f}nt�fd
d�t�|�D��}t|�}|�|�t�|||tttt|���|||||
||||||||�|_d|_W5t�|�X|� |||
|||�t!�}t�"|d�}||7}|�r�t#|�dk�r��q��q�W5t�|�X|�r�z6t�$|jd�\} }!| |jk�r�|�%|!�ntj&|_'Wnt(k
�rYnXz|�)dd	�\}"}#}$|$�*�}$Wn,tk
�rbd}"d}#d�+t|��}$YnXt,t-|"�*d�t.�}%t/|%t0��r�|#�r�t|#d�}&|$dk}'|'�r�d}$|}(n|}(|&dk�r�t�1|&�}$|%|&|$|(��|%|$��dS)NrZgetandroidapilevelz/system/bin/shz/bin/shz-crrr[r�r�=z!illegal environment variable namec3s"|]}tj�t�|���VqdSr))r�r$r��fsencode)r�dir�r�r'r(�	<genexpr>rs�z'Popen._execute_child.<locals>.<genexpr>TiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�Znoexecr�)2r�r r!r�r"r�rEr�rVr'�_USE_POSIX_SPAWNr$�dirnamer?r8rb�dupr�rxrAr1r��
get_exec_path�set�add�_posixsubprocessZ	fork_exec�sortedr�rJr�r�r�	bytearrayrr��waitpid�_handle_exitstatusrWr*�ChildProcessErrorr�r�r�ry�builtinsr�
issubclassr��strerror))r.rcr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
unix_shellZorig_executableZerrpipe_readZ
errpipe_writeZlow_fds_to_closeZlow_fdZenv_list�krhZexecutable_listZfds_to_keepZerrpipe_data�partr�rZexception_nameZ	hex_errno�err_msgZchild_exception_typeZ	errno_numZchild_exec_never_calledZerr_filenamer'rCr(r� s"	��
�����������	�
�





�
�
�
��
�


cCsL||�r||�|_n2||�r*||�|_n||�r@||�|_ntd��dS)NzUnknown child exit status!)r*r)r.rZ_WIFSIGNALEDZ	_WTERMSIGZ
_WIFEXITEDZ_WEXITSTATUSZ_WIFSTOPPEDZ	_WSTOPSIGr'r'r(rS�szPopen._handle_exitstatusc
Cs�|jdkr�|j�d�sdSz�z>|jdk	r4|jWW�pS||j|�\}}||jkrX|�|�WnBtk
r�}z$|dk	r|||_n|j|kr�d|_W5d}~XYnXW5|j��X|jS)NFr)r*r��acquire�releaser�rSr�r)r.rSZ_waitpidZ_WNOHANGZ_ECHILDr�r�er'r'r(rU�s 	



cCs>zt�|j|�\}}Wntk
r4|j}d}YnX||fSr*)r�rRr�rT)r.Z
wait_flagsr�rr'r'r(�	_try_wait�s
zPopen._try_waitc	Cs|jdk	r|jS|dk	r�t�|}d}|j�d�r~z>|jdk	rDW�0q�|�tj�\}}||jkrn|�	|�W�q�W5|j��X|�
|�}|dkr�t|j|��t
|d|d�}t�|�q&n\|jdk�r|j�B|jdk	r�W5QR��q|�d�\}}||jk�r
|�	|�W5QRXq�|jS)Ng����Mb@?Frr�g�������?)r*rr�r[r\r^r��WNOHANGr�rSrrrcr�time�sleep)r.r;r	Zdelayr�rZ	remainingr'r'r(r��s6







c
Cs"|jrX|jsXz|j��Wntk
r.YnX|sXz|j��Wntk
rVYnXd}d}|js�i|_|jr~g|j|j<|jr�g|j|j<|jr�|j|j}|jr�|j|j}|�|�|j	r�t
|j	�}t����}|jr�|r�|�|jt
j�|j�r|jj�s|�|jt
j�|j�r6|jj�s6|�|jt
j�|���r�|�|�}|dk	�rz|dk�rz|j||||dd�td��|�|�}	|�||||�|	D]�\}
}|
j|jk�r6||j|jt�}z|jt�|
j|�7_Wn,tk
�r
|�|
j�|
j��Yn*X|jt|j	�k�r�|�|
j�|
j��nP|
j|j|jfk�r�t�|
jd�}
|
�st|�|
j�|
j��|j|
j�|
��q��q6W5QRX|j |�|�d�|dk	�r�d�!|�}|dk	�r�d�!|�}|j"�r|dk	�r�|�#||jj$|jj%�}|dk	�r|�#||jj$|jj%�}||fS)NrT)r
zN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r�)&r�r��flushrr�Z_fileobj2outputr5r-�_save_inputr��
memoryview�_PopenSelector�register�	selectorsZEVENT_WRITErGZ
EVENT_READZget_maprr�RuntimeError�selectZfileobj�
_input_offset�	_PIPE_BUFr�r�r�Z
unregisterr�rrbr�r�r�r�r�r�)r.r�r	rr5r-Z
input_viewZselectorr;Zready�keyZevents�chunkr�r'r'r(r's�





��
�
$




�
�cCsF|jrB|jdkrBd|_||_|dk	rB|jrB|j�|jj|jj�|_dSr*)r�r�rjr��encoder�r�)r.r�r'r'r(rc�s�zPopen._save_inputcCs|jdkrt�|j|�dSr))r*r�r�r�r5r'r'r(r6�s
cCs|�tj�dSr))r6r0r3r2r'r'r(r4�scCs|�tj�dSr))r6r0�SIGKILLr2r'r'r(r��sz
Popen.kill)r[NNNNNTFNNNNrTFr')NN)F)N)7r$r%r&r�r/r9r�r:r�r�r�rVrWr�r�rOr�rr�r�rrr�rr�r�rrr�rNr+Z
WAIT_OBJECT_0r,rUr�r.rr6r4r�r?r��WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED�WSTOPSIGrSrRr_rZECHILDr^rcr'r'r'r(r�s�.��


D	�

H	
|�
26'�
�
#
)f)GrUrr�r�r`r0rVr�r�rrr�__all__r�rNr��ModuleNotFoundErrorrOrirgrrrrrrrrrrrrrrrr r!r"r~�	Exceptionrrrr#rJrFryrkr�rPreZSelectSelectorrTrQrrr
rdr�rrr
�objectrrr�rr	r�rIrr'r'r'r(�<module>,s��P
�
%	


;3"�EI
/py_compile.cpython-38.opt-2.pyc000064400000007100151450073350012275 0ustar00U

&�.e �@s�ddlZddlZddlZddlZddlZddlZddlZddlZddddgZ	Gdd�de
�ZGdd�dej�Z
dd	�Zddd�Zdd
d�Zedkr�e�e��dS)�N�compile�main�PyCompileError�PycInvalidationModec@seZdZddd�Zdd�ZdS)r�cCst|j}|tkr2d�t�||��}|�dd|�}nd||f}t�||pJ||||�||_||_	||_
|pl||_dS)NrzFile "<string>"z	File "%s"z
Sorry: %s: %s)�__name__�SyntaxError�join�	traceback�format_exception_only�replace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�self�exc_typerrrr�tbtext�errmsg�r�"/usr/lib64/python3.8/py_compile.pyr.s�zPyCompileError.__init__cCs|jS)N)r)rrrr�__str__>szPyCompileError.__str__N)r)r�
__module__�__qualname__rrrrrrrs
c@seZdZdZdZdZdS)r���N)rrr�	TIMESTAMP�CHECKED_HASH�UNCHECKED_HASHrrrrrBscCs(tj�d�rtj�d�stjStjSdS)N�SOURCE_DATE_EPOCH�RPM_BUILD_ROOT)�os�environ�getrr rrrrr�_get_default_invalidation_modeHs

�r'F���c
Cs�|dkrt�}|dkrL|dkr@|dkr*|nd}tjj||d�}ntj�|�}tj�|�rld}t|�|���n*tj�	|�r�tj�
|�s�d}t|�|���tj�d|�}	|	�
|�}
z|	j|
|p�||d�}Wndtk
�r*}zDt|j||p�|�}
|d	k�r|�r|
�ntj�|
jd
�WY�dSd}~XYnXz tj�|�}|�rJt�|�Wntk
�rbYnX|tjk�r�|	�|�}tj�||d|d�}n"tj�|
�}tj�|||tjk�}tj� |�}tj�!|||�|S)
Nrrr)�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)�	_optimizer�
�mtime�size)"r'�	importlib�util�cache_from_sourcer$�path�islink�FileExistsError�format�exists�isfile�	machinery�SourceFileLoader�get_data�source_to_coder
r�	__class__�sys�stderr�writer�dirname�makedirsrr�
path_stats�_bootstrap_external�_code_to_timestamp_pyc�source_hash�_code_to_hash_pycr �
_calc_mode�
_write_atomic)r�cfile�dfile�doraise�optimize�invalidation_mode�quietr)r�loader�source_bytes�code�err�py_excr?�source_stats�bytecoderD�moderrrrPsd-�
�


��cCs|dkrtjdd�}d}|dgkr�tj��}|s4q�|�d�}zt|dd�Wq$tk
r�}zd}tj�d|j	�W5d}~XYq$t
k
r�}zd}tj�d|�W5d}~XYq$Xq$nV|D]P}zt|dd�Wq�tk
�r}zd}tj�d|j	�W5d}~XYq�Xq�|S)Nrr�-r+T)rJz%s
)r<�argv�stdin�readline�rstriprrr=r>r�OSError)�args�rv�filename�errorrrrr�s.


"&&�__main__)NNFr(Nr)N)�enumZimportlib._bootstrap_externalr.�importlib.machinery�importlib.utilr$Zos.pathr<r
�__all__r
r�Enumrr'rrr�exitrrrr�<module>s$0�
a
&tempfile.cpython-38.pyc000064400000055547151450073350011024 0ustar00U

e5d�k�
@s�dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZ	ddl
ZddlZ
ddlmZddlZddlZddlZejZe	je	jBe	jBZee	d�r�ee	jOZeZee	d�r�ee	jOZee	d�r�e	j Z ndZ dZ!e�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&dd�Z'dd �Z(da)d!d"�Z*d#d$�Z+d%d	�Z,d&d�Z-da.d'd�Z/d(d
�Z0d=d*d�Z1d>d+d�Z2d,e!dfd-d�Z3Gd.d/�d/�Z4Gd0d1�d1�Z5d?dd5�d6d�Z6e	j7d7k�s�ej8d8k�r�e6Z9nee	d9�a:d@dd5�d:d�Z9Gd;d�d�Z;Gd<d�de<�Z=dS)Aa�Temporary files.

This module provides generic, low- and high-level interfaces for
creating temporary files and directories.  All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'.  'mktemp' is subject to race conditions and
should not be used; it is provided for backward compatibility only.

The default path names are returned as str.  If you supply bytes as
input, all return values will be in bytes.  Ex:

    >>> tempfile.mkstemp()
    (4, '/tmp/tmptpu9nin8')
    >>> tempfile.mkdtemp(suffix=b'')
    b'/tmp/tmppbi8f0hy'

This module also provides some data items to the user:

  TMP_MAX  - maximum number of names that will be tried before
             giving up.
  tempdir  - If this is set to a string before the first use of
             any routine from this module, it will be considered as
             another candidate location to store temporary files.
�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�N)�Random�
O_NOFOLLOW�O_BINARYi'ZtmpcCs.zt�|�Wntk
r$YdSXdSdS)NFT)�_os�lstat�OSError)�fn�r� /usr/lib64/python3.8/tempfile.py�_existsKs
rcGs\d}|D]B}|dkrqt|t�r6|tkr0td��t}q|tkrFtd��t}q|dkrXtS|S)zBLook at the type of all args and divine their implied return type.Nz1Can't mix bytes and non-bytes in path components.)�
isinstance�bytes�str�	TypeError)�argsZreturn_type�argrrr�_infer_return_typeTs
rcCsdt|||�}|dkr|�}|dkr:|tkr0t}n
t�t�}|dkrX|tkrRt�}nt�}||||fS)z9Common parameter processing for most APIs in this module.N)rr�templater�fsencoderr
)�prefix�suffix�dir�output_typerrr�_sanitize_paramsis
r&c@s0eZdZdZdZedd��Zdd�Zdd�Zd	S)
�_RandomNameSequencea,An instance of _RandomNameSequence generates an endless
    sequence of unpredictable strings which can safely be incorporated
    into file names.  Each string is eight characters long.  Multiple
    threads can safely use the same instance at the same time.

    _RandomNameSequence is an iterator.Z%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t��}|t|dd�kr&t�|_||_|jS)N�_rng_pid)r�getpid�getattr�_RandomZ_rngr()�selfZcur_pidrrr�rng�s
z_RandomNameSequence.rngcCs|S�Nr�r,rrr�__iter__�sz_RandomNameSequence.__iter__cs0|j�|jj���fdd�td�D�}d�|�S)Ncsg|]}����qSrr)�.0Zdummy��cZchooserr�
<listcomp>�sz0_RandomNameSequence.__next__.<locals>.<listcomp>��)�
charactersr-Zchoice�range�join)r,Zlettersrr2r�__next__�sz_RandomNameSequence.__next__N)	�__name__�
__module__�__qualname__�__doc__r7�propertyr-r0r:rrrrr'{s
r'c	Cs�g}dD]}t�|�}|r|�|�qtjdkrX|�tj�d�tj�d�ddddg�n|�d	d
dg�z|�t���Wn$t	t
fk
r�|�tj�YnX|S)z[Generate a list of candidate temporary directories which
    _get_default_tempdir will try.)ZTMPDIRZTEMPZTMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmpz/tmpz/var/tmpz/usr/tmp)r�getenv�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlistZenvname�dirnamerrr�_candidate_tempdir_list�s&


�rMcCsFt�}t�}|D�]}|tjkr,tj�|�}td�D�]�}t|�}tj�||�}zft�	|t
d�}z<z*t
j	|ddd��}|�d�W5QRXW5t�|�XW5t�|�X|WStk
r�Yq4tk
�rtjdk�rtj�|��rt�|tj��rYq4YqYq4tk
�r,YqYq4Xq4qttjd|��d	S)
aqCalculate the default directory to use for temporary files.
    This routine should be called exactly once.

    We determine whether or not a candidate temp dir is usable by
    trying to create and write to a file in that directory.  If this
    is successful, the test file is deleted.  To prevent denial of
    service, the name of the test file must be randomized.�d��wbF)�closefdsblatr@z)No usable temporary directory found in %sN)r'rMrrJrE�abspathr8�nextr9�open�_bin_openflags�unlink�close�_io�write�FileExistsError�PermissionErrorrC�isdir�access�W_OKr�FileNotFoundError�_errnoZENOENT)ZnamerrKr$�seqrC�filename�fd�fprrr�_get_default_tempdir�s@	

�
��recCs2tdkr.t��ztdkr t�aW5t��XtS)z7Common setup sequence for all user-callable interfaces.N)�_name_sequence�
_once_lock�acquire�releaser'rrrr�_get_candidate_names�s

rjc
	Cs�t�}|tkrttj|�}tt�D]�}t|�}tj�	||||�}t
�d|�zt�||d�}	WnVt
k
rzYq"Yn@tk
r�tjdkr�tj�|�r�t�|tj�r�Yq"n�YnX|	tj�|�fSt
tjd��dS)z>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.ztempfile.mkstemprOr@z#No usable temporary file name foundN)rjr�maprr!r8rrSrEr9�_sys�auditrTrZr[rCr\r]r^rRr`�EEXIST)
r$ZpreZsuf�flagsr%�namesrarC�filercrrr�_mkstemp_inner�s*��rrcCstS)z-The default prefix for temporary directories.)r rrrrr	
scCst�t��S)z6The default prefix for temporary directories as bytes.)rr!r	rrrrrscCs2tdkr.t��ztdkr t�aW5t��XtS)zAccessor for tempfile.tempdir.N)r
rgrhrirerrrrrs

cCst�t��S)z)A bytes version of tempfile.gettempdir().)rr!rrrrrr
#sFcCs2t|||�\}}}}|rt}nt}t|||||�S)a�User-callable function to create and return a unique temporary
    file.  The return value is a pair (fd, name) where fd is the
    file descriptor returned by os.open, and name is the filename.

    If 'suffix' is not None, the file name will end with that suffix,
    otherwise there will be no suffix.

    If 'prefix' is not None, the file name will begin with that prefix,
    otherwise a default prefix is used.

    If 'dir' is not None, the file will be created in that directory,
    otherwise a default directory is used.

    If 'text' is specified and true, the file is opened in text
    mode.  Else (the default) the file is opened in binary mode.

    If any of 'suffix', 'prefix' and 'dir' are not None, they must be the
    same type.  If they are bytes, the returned name will be bytes; str
    otherwise.

    The file is readable and writable only by the creating user ID.
    If the operating system uses permission bits to indicate whether a
    file is executable, the file is executable by no one. The file
    descriptor is not inherited by children of this process.

    Caller is responsible for deleting the file when done with it.
    )r&�_text_openflagsrUrr)r#r"r$�textr%rorrrr's
c	Cs�t|||�\}}}}t�}|tkr.ttj|�}tt�D]�}t|�}tj	�
||||�}t�d|�zt�
|d�WnVtk
r�Yq6Yn@tk
r�tjdkr�tj	�|�r�t�|tj�r�Yq6n�YnX|Sttjd��dS)aUser-callable function to create and return a unique temporary
    directory.  The return value is the pathname of the directory.

    Arguments are as for mkstemp, except that the 'text' argument is
    not accepted.

    The directory is readable, writable, and searchable only by the
    creating user.

    Caller is responsible for deleting the directory when done with it.
    ztempfile.mkdtemp�r@z(No usable temporary directory name foundN)r&rjrrkrr!r8rrSrEr9rlrm�mkdirrZr[rCr\r]r^r`rn)r#r"r$r%rprarCrqrrrrNs,
��r6cCs`|dkrt�}t�}tt�D]2}t|�}tj�||||�}t|�s|Sqt	t
jd��dS)a�User-callable function to return a unique temporary file name.  The
    file is not created.

    Arguments are similar to mkstemp, except that the 'text' argument is
    not accepted, and suffix=None, prefix=None and bytes file names are not
    supported.

    THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED.  The file name may
    refer to a file that did not exist at some point, but by the time
    you get around to creating it, someone else may have beaten you to
    the punch.
    Nz"No usable temporary filename found)rrjr8rrSrrEr9rrZr`rn)r#r"r$rprarCrqrrrrvs
�c@sLeZdZdZdZdZd
dd�Zejdkr@ej	fdd	�Z
d
d�Zndd	�Z
dS)�_TemporaryFileCloserz�A separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file.NFTcCs||_||_||_dSr.)rqrC�delete�r,rqrCrxrrr�__init__�sz_TemporaryFileCloser.__init__r@cCs<|js8|jdk	r8d|_z|j��W5|jr6||j�XdS�NT)�close_calledrqrxrCrW)r,rVrrrrW�sz_TemporaryFileCloser.closecCs|��dSr.)rWr/rrr�__del__�sz_TemporaryFileCloser.__del__cCs|jsd|_|j��dSr{)r|rqrWr/rrrrW�s)T)r;r<r=r>rqr|rzrrCrVrWr}rrrrrw�s



rwc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�_TemporaryFileWrapperz�Temporary file wrapper

    This class provides a wrapper around files opened for
    temporary use.  In particular, it seeks to automatically
    remove the file when it is no longer needed.
    TcCs$||_||_||_t|||�|_dSr.)rqrCrxrw�_closerryrrrrz�sz_TemporaryFileWrapper.__init__cs^|jd}t||�}t|d�rD|�t����fdd��}|j|_|}t|t�sZt|||�|S)Nrq�__call__cs
�||�Sr.r)r�kwargs��funcrr�func_wrapper�sz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	�__dict__r*�hasattr�
_functools�wrapsrr�int�setattr)r,rCrq�ar�rr�r�__getattr__�s



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr.)rq�	__enter__r/rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr.)rq�__exit__rW)r,�exc�value�tb�resultrrrr��sz_TemporaryFileWrapper.__exit__cCs|j��dS)zA
        Close the temporary file, possibly deleting it.
        N)rrWr/rrrrW�sz_TemporaryFileWrapper.closeccs|jD]
}|VqdSr.)rq)r,�linerrrr0�s
z_TemporaryFileWrapper.__iter__N)T)
r;r<r=r>rzr�r�r�rWr0rrrrr~�s
r~�w+b���T��errorscCs�t|||�\}}}}	t}
tjdkr0|r0|
tjO}
t||||
|	�\}}z$tj||||||d�}
t|
||�WSt	k
r�t�
|�t�|��YnXdS)a�Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
    r@��	buffering�newline�encodingr�N)r&rUrrCZO_TEMPORARYrrrXrTr~�
BaseExceptionrVrW)�moder�r�r�r#r"r$rxr�r%rorcrCrqrrrrs 

�

�posix�cygwin�	O_TMPFILEc
Cs�t|||�\}}}}t}	tr�z$|	tjBtj@}
t�||
d�}Wn*tk
rXdaYnFtk
rjYn4Xzt	j||||||d�WSt�
|��YnXt||||	|�\}}z"t�|�t	j||||||d�WSt�
|��YnXdS)a�Create and return a temporary file.
        Arguments:
        'prefix', 'suffix', 'dir' -- as for mkstemp.
        'mode' -- the mode argument to io.open (default "w+b").
        'buffering' -- the buffer size argument to io.open (default -1).
        'encoding' -- the encoding argument to io.open (default None)
        'newline' -- the newline argument to io.open (default None)
        'errors' -- the errors argument to io.open (default None)
        The file is created as mkstemp() would do it.

        Returns an object with a file-like interface.  The file has no
        name, and will cease to exist when it is closed.
        rOFr�N)
r&rU�_O_TMPFILE_WORKSrr��O_CREATrT�IsADirectoryErrorrrXrWrrrV)
r�r�r�r�r#r"r$r�r%roZflags2rcrCrrrr2s<
�


�
c@seZdZdZdZd:dd�dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zed0d1��Zd2d3�Zd;d4d5�Zd6d7�Zd8d9�ZdS)<rz�Temporary file wrapper, specialized to switch from BytesIO
    or StringIO to a real file when it exceeds a certain size or
    when a fileno is needed.
    Frr�r�Nr�c	
	CsTd|krt��|_ntjt��||	|d�|_||_d|_||||||||	d�|_dS)N�b)r�r�r�F)r�r�r#r"r�r�r$r�)rX�BytesIO�_file�
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r,�max_sizer�r�r�r�r#r"r$r�rrrrzus"
��zSpooledTemporaryFile.__init__cCs,|jr
dS|j}|r(|��|kr(|��dSr.)r�r��tell�rollover)r,rqr�rrr�_check�s
zSpooledTemporaryFile._checkcCsr|jr
dS|j}tf|j�}|_|`|��}t|d�rN|j�|���	��n|�|�	��|�
|d�d|_dS)N�bufferrT)r�r�rr�r�r�r�rY�detach�getvalue�seek)r,rqZnewfile�posrrrr��s
zSpooledTemporaryFile.rollovercCs|jjrtd��|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr/rrrr��szSpooledTemporaryFile.__enter__cCs|j��dSr.�r�rW�r,r�r�r�rrrr��szSpooledTemporaryFile.__exit__cCs
|j��Sr.)r�r0r/rrrr0�szSpooledTemporaryFile.__iter__cCs|j��dSr.r�r/rrrrW�szSpooledTemporaryFile.closecCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.closedcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.encodingcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.errorscCs|��|j��Sr.)r�r��filenor/rrrr��szSpooledTemporaryFile.filenocCs|j��dSr.)r��flushr/rrrr��szSpooledTemporaryFile.flushcCs
|j��Sr.)r��isattyr/rrrr��szSpooledTemporaryFile.isattycCs.z
|jjWStk
r(|jdYSXdS)Nr�)r�r�rIr�r/rrrr��s
zSpooledTemporaryFile.modecCs&z
|jjWStk
r YdSXdSr.)r�rCrIr/rrrrC�s
zSpooledTemporaryFile.namecCs|jjSr.)r��newlinesr/rrrr��szSpooledTemporaryFile.newlinescGs|jj|�Sr.)r��read�r,rrrrr��szSpooledTemporaryFile.readcGs|jj|�Sr.)r��readliner�rrrr��szSpooledTemporaryFile.readlinecGs|jj|�Sr.)r��	readlinesr�rrrr��szSpooledTemporaryFile.readlinescGs|jj|�Sr.)r�r�r�rrrr��szSpooledTemporaryFile.seekcCs|jjSr.)r��	softspacer/rrrr��szSpooledTemporaryFile.softspacecCs
|j��Sr.)r�r�r/rrrr��szSpooledTemporaryFile.tellcCs6|dkr|j��n||jkr&|��|j�|�dSr.)r��truncater�r�)r,�sizerrrr��s

zSpooledTemporaryFile.truncatecCs|j}|�|�}|�|�|Sr.)r�rYr�)r,�srq�rvrrrrY�s

zSpooledTemporaryFile.writecCs|j}|�|�}|�|�|Sr.)r��
writelinesr�)r,�iterablerqr�rrrr��s

zSpooledTemporaryFile.writelines)rr�r�NNNNN)N)r;r<r=r>r�rzr�r�r�r�r0rWr?r�r�r�r�r�r�r�rCr�r�r�r�r�r�r�r�rYr�rrrrrnsT��







c@sReZdZdZddd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)ra+Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everything contained
    in it are removed.
    NcCs0t|||�|_tj||j|jd�|�d�|_dS)NzImplicitly cleaning up {!r})�warn_message)rrC�_weakrefZfinalize�_cleanup�format�
_finalizer)r,r#r"r$rrrrzs�zTemporaryDirectory.__init__cs ��fdd�}tj�|d�dS)Nc	s�t|dt�r�dd�}zV|�kr0|tj�|��||�zt�|�Wn"ttfk
rh��|�YnXWq�tk
r�Yq�Xnt|dt�r�n�dS)NrcSs6zt�|d�Wntk
r$YnXt�|d�dS)Nrru)rZchflagsrI�chmod)rErrr�
resetpermss
z?TemporaryDirectory._rmtree.<locals>.onerror.<locals>.resetperms)	�
issubclassr[rrErLrVr��_rmtreer_)r�rE�exc_infor���clsrCrr�onerrorsz+TemporaryDirectory._rmtree.<locals>.onerror)r�)�_shutilZrmtree)r�rCr�rr�rr�szTemporaryDirectory._rmtreecCs|�|�t�|t�dSr.)r��	_warnings�warn�ResourceWarning)r�rCr�rrrr�/s
zTemporaryDirectory._cleanupcCsd�|jj|j�S)Nz	<{} {!r}>)r��	__class__r;rCr/rrr�__repr__4szTemporaryDirectory.__repr__cCs|jSr.)rCr/rrrr�7szTemporaryDirectory.__enter__cCs|��dSr.)�cleanupr�rrrr�:szTemporaryDirectory.__exit__cCs|j��r|�|j�dSr.)r�r�r�rCr/rrrr�=s
zTemporaryDirectory.cleanup)NNN)r;r<r=r>rz�classmethodr�r�r�r�r�r�rrrrr�s


)NNNF)NNN)r�r�NNNNNT)r�r�NNNNN)>r>�__all__�	functoolsr��warningsr��iorX�osrZshutilr��errnor`Zrandomrr+�sysrl�weakrefr��_thread�
allocate_lockZ_allocate_lock�O_RDWRr��O_EXCLrsr�rrUrrr rgrrr&r'rMrerfrjrrr	rr
rr
rrrrwr~rrC�platformrr�r�objectrrrrr�<module>s��





	-
'
( +?��'
��<queue.cpython-38.opt-2.pyc000064400000014223151450073350011265 0ustar00U

e5d\,�@s�ddlZddlmZddlmZmZddlmZzddlm	Z	Wne
k
rXdZ	YnXdddd	d
dgZzddlmZWn$e
k
r�Gd
d�de
�ZYnXGdd�de
�ZGdd�d�ZGdd	�d	e�ZGdd
�d
e�ZGdd�d�Ze	dkr�eZ	dS)�N)�deque)�heappush�heappop)�	monotonic)�SimpleQueue�Empty�Full�Queue�
PriorityQueue�	LifoQueuer)rc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/queue.pyrsc@seZdZdS)rNrrrrrrsc@s�eZdZd dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zd!dd�Z	d"dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)#r	rcCsN||_|�|�t��|_t�|j�|_t�|j�|_t�|j�|_d|_	dS�Nr)
�maxsize�_init�	threadingZLock�mutexZ	Condition�	not_empty�not_full�all_tasks_done�unfinished_tasks��selfrrrr�__init__!s

zQueue.__init__c	CsH|j�8|jd}|dkr4|dkr*td��|j��||_W5QRXdS)N�rz!task_done() called too many times)rr�
ValueErrorZ
notify_all)rZ
unfinishedrrr�	task_done8s

zQueue.task_donec	Cs(|j�|jr|j��qW5QRXdS�N)rr�wait�rrrr�joinNs	z
Queue.joinc
Cs&|j�|��W5QR�SQRXdSr!�r�_qsizer#rrr�qsize[szQueue.qsizec
Cs(|j�|��W5QR�SQRXdSr!r%r#rrr�empty`szQueue.emptyc
Cs<|j�,d|jko |��knW5QR�SQRXdSr)rrr&r#rrr�fullnsz
Queue.fullTNc	Cs�|j��|jdkr�|s*|��|jkr�t�nr|dkrN|��|jkr�|j��q2nN|dkr`td��n<t�|}|��|jkr�|t�}|dkr�t�|j�|�qj|�|�|jd7_|j	�
�W5QRXdS)Nr�''timeout' must be a non-negative number�r)rrr&rr"r�time�_putrr�notify)r�item�block�timeout�endtime�	remainingrrr�putys&




z	Queue.putc
Cs�|j��|s|��s�t�nf|dkr8|��s�|j��q"nH|dkrJtd��n6t�|}|��s�|t�}|dkrrt�|j�|�qT|��}|j��|W5QR�SQRXdS)Nrr*r+)	rr&rr"rr,�_getrr.)rr0r1r2r3r/rrr�get�s$



z	Queue.getcCs|j|dd�S�NF)r0�r4�rr/rrr�
put_nowait�szQueue.put_nowaitcCs|jdd�Sr7�r6r#rrr�
get_nowait�szQueue.get_nowaitcCst�|_dSr!)r�queuerrrrr�szQueue._initcCs
t|j�Sr!��lenr=r#rrrr&�szQueue._qsizecCs|j�|�dSr!�r=�appendr9rrrr-�sz
Queue._putcCs
|j��Sr!)r=�popleftr#rrrr5�sz
Queue._get)r)TN)TN)r
rrrr r$r'r(r)r4r6r:r<rr&r-r5rrrrr	s


 

c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r
cCs
g|_dSr!�r=rrrrr�szPriorityQueue._initcCs
t|j�Sr!r>r#rrrr&�szPriorityQueue._qsizecCst|j|�dSr!)rr=r9rrrr-�szPriorityQueue._putcCs
t|j�Sr!)rr=r#rrrr5�szPriorityQueue._getN�r
rrrr&r-r5rrrrr
�sc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs
g|_dSr!rCrrrrr�szLifoQueue._initcCs
t|j�Sr!r>r#rrrr&�szLifoQueue._qsizecCs|j�|�dSr!r@r9rrrr-�szLifoQueue._putcCs
|j��Sr!)r=�popr#rrrr5�szLifoQueue._getNrDrrrrr�sc@sHeZdZdd�Zddd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)�_PySimpleQueuecCst�|_t�d�|_dSr)r�_queuerZ	Semaphore�_countr#rrrr	sz_PySimpleQueue.__init__TNcCs|j�|�|j��dSr!)rGrArH�release)rr/r0r1rrrr4
sz_PySimpleQueue.putcCs4|dk	r|dkrtd��|j�||�s*t�|j��S)Nrr*)rrH�acquirerrGrB)rr0r1rrrr6s
z_PySimpleQueue.getcCs|j|dd�Sr7r8r9rrrr:'sz_PySimpleQueue.put_nowaitcCs|jdd�Sr7r;r#rrrr</sz_PySimpleQueue.get_nowaitcCst|j�dkSr�r?rGr#rrrr(7sz_PySimpleQueue.emptycCs
t|j�Sr!rKr#rrrr';sz_PySimpleQueue.qsize)TN)TN)
r
rrrr4r6r:r<r(r'rrrrrF�s

	
rF)r�collectionsr�heapqrrr,rrGr�ImportError�__all__r�	Exceptionrr	r
rrFrrrr�<module>s(
BA_markupbase.cpython-38.opt-1.pyc000064400000016704151450073350012437 0ustar00U

e5d9�@sVdZddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd	�d	�Z	dS)
z�Shared support for scanning document type declarations in HTML and XHTML.

This module is used as a foundation for the html.parser module.  It has no
documented public API and should not be used directly.

�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZ	d
d�Z
d#dd�Zd$dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)%�
ParserBaseziParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs|jtkrtd��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�#/usr/lib64/python3.8/_markupbase.py�__init__s
�zParserBase.__init__cCstd��dS)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error s�zParserBase.errorcCsd|_d|_dS)N�r��lineno�offsetrrrr�reset$szParserBase.resetcCs|j|jfS)z&Return current line number and offset.rrrrr�getpos(szParserBase.getposcCsb||kr|S|j}|�d||�}|rN|j||_|�d||�}||d|_n|j|||_|S)N�
r
)�rawdata�countr�rindexr)r�i�jrZnlines�posrrr�	updatepos0szParserBase.updatepos�c
Cs�|j}|d}|||d�dkr*|dS|||d�dkrBdSt|�}|||d�dkrh|�|�S||dkr~|�|�S|�||�\}}|dkr�|S|d	kr�d
|_||k�r�||}|dkr�||d|�}|d	kr�|�|�n
|�|�|dS|dk�r t||�}|�sdS|�	�}n�|dk�r<|�||�\}	}nt||jk�rR|d}n^|dk�r�|d	k�rx|�
|d|�}n$|d
k�r�|�d|�n
|�d�n|�d||�|dkr�|Sq�dS)N�r
�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�linktype�attlist�element�linkz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)r�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subsetr)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration@sZ












�zParserBase.parse_declarationr
cCs�|j}|�|d|�\}}|dkr&|S|dkr@t�||d�}n4|dkrZt�||d�}n|�d||d|��|s|dS|r�|�d�}|�||d|��|�d�S)N�r>�rcdata�temp�ignore�cdata�include>�endif�else�ifz+unknown status keyword %r in marked sectionr)	rr(�_markedsectionclose�search�_msmarkedsectioncloser�startr*r,)rr�reportrZsectNamer�matchrrrr'�s
zParserBase.parse_marked_sectioncCsj|j}|||d�dkr$|�d�t�||d�}|s<dS|r`|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()rr)rr�
_commentcloser>r@Zhandle_commentr,)rrrArrBrrrrr&�s

zParserBase.parse_commentc
Cs*|j}t|�}|}||k�r&||}|dk�r0|||d�}|dkrJdS|dkrp|�||d�|�d|�|d|kr�dS|d|kr�dS|||d�dkr�|j|d	d
�}|d	kr|Sq|�|d|�\}}|dkr�dS|dk�r|�||d�|�d|�t|d
|�}	|	||�}|d	k�r$|Sq|dk�r�|d|k�rLdS|�|d|�\}}|d	k�rn|S||dk�r$|d}q|dk�r�|d}||k�r�||���r�|d}�q�||k�r�||dk�r�|S|�||�|�d�ndSq|���r
|d}q|�||�|�d|�qdS)N�<rrz<!r
z*unexpected char in internal subset (in %r)rCrDr)rA>r#r"�notation�entityz)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr%rrr&r(�getattr�isspace)
rr�declstartposrr.rr/�sr2Zmethrrrr-�sp


�








z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�krB|�d|�dSdS)Nrrr
)r(r�find)rrrNr2rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkr2dS|dkrB|dS|�||�\}}|dkr^|S|||d�}|dkrzdS|dkr�d||d�kr�|�d|�d}ndS|||d���r�|d}q�||d�s�dSn|�||�\}}|||d�}|�sdS|dk�rDt||�}|�r&|��}ndS|||d�}|�sDdS|d	k�r�||d�d	k�rddS|�|d|�\}}|dk�r�|S|||d�}|�s�dS|dkrB|dSqBdS)
Nr
rrrr�(�)�'"�#)rr(rPrMr+r,)rrrNrr2rr/r1rrr�_parse_doctype_attlistsX





z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}|||d�}|s:dS|dkrJ|dS|dkrnt||�}|sddS|��}q"|�||�\}}|dkr"|Sq"dS)Nrr
rrrT)r(rr+r,)rrrNr2rrr/r1rrr�_parse_doctype_notation=s"

z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkrR|d}|||d�}|s:dS|��rP|d}q"qVq"n|}|�||�\}}|dkrr|S|j||d�}|s�dS|dkr�t||�}|r�|��}q�dSqr|dkr�|dS|�||�\}}|dkrr|SqrdS)Nr
rIrrrTr)rrMr(r+r,)rrrNrrr/r2r1rrr�_parse_doctype_entityTs4


z ParserBase._parse_doctype_entitycCs�|j}t|�}||krdSt||�}|r\|��}|��}|t|�|krLdS|��|��fS|�||�|�d|||d��dS)N)Nrzexpected name token at %r�)	rr%�_declname_match�group�strip�lowerr,rr)rrrNrr.r1rOr2rrrr(xs
�zParserBase._scan_namecCsdS)Nr)rr0rrrr*�szParserBase.unknown_declN)r
)r
)�__name__�
__module__�__qualname__�__doc__r	rrrrr)r3r'r&r-rQrVrWrXr(r*rrrrrs"
R

C9$r)
ra�re�compilerBrZr+rEr=r?rrrrr�<module>s


_markupbase.cpython-38.opt-2.pyc000064400000016112151450073350012431 0ustar00U

e5d9�@sRddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd�d�ZdS)	�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdZdd
�Z	d"dd�Z
d#dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)$�
ParserBasecCs|jtkrtd��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�#/usr/lib64/python3.8/_markupbase.py�__init__s
�zParserBase.__init__cCstd��dS)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error s�zParserBase.errorcCsd|_d|_dS)N�r��lineno�offsetrrrr�reset$szParserBase.resetcCs|j|jfS�Nrrrrr�getpos(szParserBase.getposcCsb||kr|S|j}|�d||�}|rN|j||_|�d||�}||d|_n|j|||_|S)N�
r
)�rawdata�countr�rindexr)r�i�jrZnlines�posrrr�	updatepos0szParserBase.updatepos�c
Cs�|j}|d}|||d�dkr*|dS|||d�dkrBdSt|�}|||d�dkrh|�|�S||dkr~|�|�S|�||�\}}|dkr�|S|d	kr�d
|_||k�r�||}|dkr�||d|�}|d	kr�|�|�n
|�|�|dS|dk�r t||�}|�sdS|�	�}n�|dk�r<|�||�\}	}nt||jk�rR|d}n^|dk�r�|d	k�rx|�
|d|�}n$|d
k�r�|�d|�n
|�d�n|�d||�|dkr�|Sq�dS)N�r
�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�linktype�attlist�element�linkz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)r�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subsetr)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration@sZ












�zParserBase.parse_declarationr
cCs�|j}|�|d|�\}}|dkr&|S|dkr@t�||d�}n4|dkrZt�||d�}n|�d||d|��|s|dS|r�|�d�}|�||d|��|�d�S)N�r>�rcdata�temp�ignore�cdata�include>�endif�else�ifz+unknown status keyword %r in marked sectionr )	rr)�_markedsectionclose�search�_msmarkedsectioncloser�startr+r-)rr�reportrZsectNamer�matchrrrr(�s
zParserBase.parse_marked_sectioncCsj|j}|||d�dkr$|�d�t�||d�}|s<dS|r`|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()r r)rr�
_commentcloser?rAZhandle_commentr-)rrrBrrCrrrrr'�s

zParserBase.parse_commentc
Cs*|j}t|�}|}||k�r&||}|dk�r0|||d�}|dkrJdS|dkrp|�||d�|�d|�|d|kr�dS|d|kr�dS|||d�dkr�|j|d	d
�}|d	kr|Sq|�|d|�\}}|dkr�dS|dk�r|�||d�|�d|�t|d
|�}	|	||�}|d	k�r$|Sq|dk�r�|d|k�rLdS|�|d|�\}}|d	k�rn|S||dk�r$|d}q|dk�r�|d}||k�r�||���r�|d}�q�||k�r�||dk�r�|S|�||�|�d�ndSq|���r
|d}q|�||�|�d|�qdS)N�<rr z<!r
z*unexpected char in internal subset (in %r)rDrEr)rB>r$r#�notation�entityz)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr&rrr'r)�getattr�isspace)
rr�declstartposrr/rr0�sr3Zmethrrrr.�sp


�








z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�krB|�d|�dSdS)Nr rr
)r)r�find)rrrOr3rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkr2dS|dkrB|dS|�||�\}}|dkr^|S|||d�}|dkrzdS|dkr�d||d�kr�|�d|�d}ndS|||d���r�|d}q�||d�s�dSn|�||�\}}|||d�}|�sdS|dk�rDt||�}|�r&|��}ndS|||d�}|�sDdS|d	k�r�||d�d	k�rddS|�|d|�\}}|dk�r�|S|||d�}|�s�dS|dkrB|dSqBdS)
Nr
rr rr�(�)�'"�#)rr)rQrNr,r-)rrrOrr3rr0r2rrr�_parse_doctype_attlistsX





z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}|||d�}|s:dS|dkrJ|dS|dkrnt||�}|sddS|��}q"|�||�\}}|dkr"|Sq"dS)Nrr
r rrU)r)rr,r-)rrrOr3rrr0r2rrr�_parse_doctype_notation=s"

z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkrR|d}|||d�}|s:dS|��rP|d}q"qVq"n|}|�||�\}}|dkrr|S|j||d�}|s�dS|dkr�t||�}|r�|��}q�dSqr|dkr�|dS|�||�\}}|dkrr|SqrdS)Nr
rJr rrUr)rrNr)r,r-)rrrOrrr0r3r2rrr�_parse_doctype_entityTs4


z ParserBase._parse_doctype_entitycCs�|j}t|�}||krdSt||�}|r\|��}|��}|t|�|krLdS|��|��fS|�||�|�d|||d��dS)N)Nr zexpected name token at %r�)	rr&�_declname_match�group�strip�lowerr-rr)rrrOrr/r2rPr3rrrr)xs
�zParserBase._scan_namecCsdSrr)rr1rrrr+�szParserBase.unknown_declN)r
)r
)�__name__�
__module__�__qualname__r	rrrrr*r4r(r'r.rRrWrXrYr)r+rrrrrs 
R

C9$r)	�re�compilerCr[r,rFr>r@rrrrr�<module>s


tabnanny.cpython-38.pyc000064400000015570151450073350011021 0ustar00U

e5d�,�@s�dZdZddlZddlZddlZeed�s2ed��dddgZdada	d	d
�Z
dd�ZGd
d�de�Z
dd�ZGdd�d�Zdd�Zdd�Zedkr�e�dS)a�The Tab Nanny despises ambiguous indentation.  She knows no mercy.

tabnanny -- Detection of ambiguous indentation

For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.

Warning: The API provided by this module is likely to change in future
releases; such changes may not be backward compatible.
�6�N�NLz4tokenize.NL doesn't exist -- tokenize module too old�check�NannyNag�process_tokenscGs6d}|D]}tj�|t|��d}qtj�d�dS)N�� �
)�sys�stderr�write�str)�args�sep�arg�r� /usr/lib64/python3.8/tabnanny.py�errprint"s
rc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnX|D](\}}|dkrvtda|dkr^tdaq^|s�tdtjdd�dS|D]}t|�q�dS)Nr�Zqvz-qz-vzUsage:z[-v] file_or_directory ...)�getoptr
�argv�errorr�
filename_only�verboser)rZoptsr�msg�o�arrrr�main)s 
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzk
    Raised by process_tokens() if detecting an ambiguous indent.
    Captured and handled in check().
    cCs||||_|_|_dS�N)�linenor�line)�selfrrr rrr�__init__BszNannyNag.__init__cCs|jSr)r�r!rrr�
get_linenoDszNannyNag.get_linenocCs|jSr)rr#rrr�get_msgFszNannyNag.get_msgcCs|jSr)r r#rrr�get_lineHszNannyNag.get_lineN)�__name__�
__module__�__qualname__�__doc__r"r$r%r&rrrrr=s
c	
CsHtj�|�r�tj�|�s�tr*td|f�t�|�}|D]J}tj�||�}tj�|�rbtj�|�rztj�|dd��dkr8t	|�q8dSzt
�|�}Wn8tk
r�}zt
d||f�WY�dSd}~XYnXtdkr�td|��z>ztt
�|j��W�n"t
jk
�r@}z t
d||f�WY�
W���dSd}~XYn�tk
�r|}zt
d	||f�WY�W��dSd}~XYn�tk
�r }z�|��}|��}t�r�td
||f�td|f�t|���n6d|k�r�d
|d
}t�r�t|�nt||t|��WY�W�dSd}~XYnXW5|��Xt�rDtd|f�dS)a~check(file_or_dir)

    If file_or_dir is a directory and not a symbolic link, then recursively
    descend the directory tree named by file_or_dir, checking all .py files
    along the way. If file_or_dir is an ordinary Python source file, it is
    checked for whitespace related problems. The diagnostic messages are
    written to standard output using the print statement.
    z%r: listing directory���Nz.pyz%r: I/O Error: %srzchecking %r ...z%r: Token Error: %sz%r: Indentation Error: %sz)%r: *** Line %d: trouble in tab city! ***zoffending line: %rr�"z%r: Clean bill of health.)�os�path�isdir�islinkr�print�listdir�join�normcaser�tokenize�open�OSErrorr�closer�generate_tokens�readline�
TokenError�IndentationErrorrr$r&r%r�repr)	�file�names�name�fullname�frZnag�badliner rrrrKsX


��


 
c@sLeZdZd\ZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
Whitespacez 	c	Cs�||_tjtj}}g}d}}}|jD]v}||krH|d}|d}q*||kr�|d}|d}|t|�kr�|dg|t|�d}||d||<d}q*q�q*||_||_t|�|f|_t|�dk|_	dS)Nrr)
�rawrD�S�T�len�n�nt�tuple�norm�	is_simple)	r!ZwsrFrG�count�brIrJZchrrrr"�s(

zWhitespace.__init__cCs|j\}}tt|�d|�S�Nr)rL�maxrH)r!rN�trailingrrr�longest_run_of_spaces�s
z Whitespace.longest_run_of_spacescCsH|j\}}d}t|t|��D]}|||||}q||||jS)Nr)rL�rangerHrJ)r!�tabsizerNrRZil�irrr�indent_level�s

zWhitespace.indent_levelcCs|j|jkSr)rL)r!�otherrrr�equal�szWhitespace.equalcCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrP�rQrSrTrW�append�r!rXrIr�tsrrr�not_equal_witness�s���zWhitespace.not_equal_witnesscCsp|j|jkrdS|jr(|jr(|j|jkSt|��|���d}td|d�D]}|�|�|�|�krLdSqLdS)NFr�T)rIrMrJrQrSrTrW)r!rXrIr]rrr�less�s��zWhitespace.lesscCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrPrZr\rrr�not_less_witnesss���zWhitespace.not_less_witnessN)r'r(r)rFrGr"rSrWrYr^r`rarrrrrD�srDcCs8dd�|D�}d}t|�dkr&|d}|dd�|�S)Ncss|]}t|d�VqdS)rN)r
)�.0�tuprrr�	<genexpr>sz#format_witnesses.<locals>.<genexpr>zat tab sizer�srz, )rHr3)�wZfirsts�prefixrrr�format_witnessess
rhcCstj}tj}tj}tjtjf}td�g}d}|D]�\}}}	}
}||krLd}q0||kr�d}t|�}|d�|�s�|d�|�}
dt	|
�}t
|	d||��|�|�q0||kr�d}|d=q0|r0||kr0d}t|�}|d�|�s0|d�
|�}
dt	|
�}t
|	d||��q0dS)Nrrr���zindent not greater e.g. zindent not equal e.g. )r5�INDENT�DEDENT�NEWLINE�COMMENTrrDr`rarhrr[rYr^)�tokensrjrkrlZJUNK�indentsZcheck_equal�type�token�start�endr ZthisguyZwitnessrrrrrs6

�__main__)r*�__version__r-r
r5�hasattr�
ValueError�__all__rrrr�	ExceptionrrrDrhrr'rrrr�<module>s&

=7stat.cpython-38.opt-1.pyc000064400000010426151450073350011114 0ustar00U

e5dm�
@sLdZdZdZdZdZdZdZdZdZd	Z	d
Z
dd�Zd
d�ZdZ
dZdZdZdZdZdZdZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z d*Z!d+Z"e"Z#d,Z$d-Z%d.Z&d/Z'd0Z(d-Z)d.Z*d/Z+d1Z,d2Z-d3Z.d	Z/dZ0dZ1dZ2dZ3dZ4dZ5dZ6d	Z7d3Z8d2Z9dZ:d4Z;d5Z<d6Z=d7Z>d8Z?ed9fed:fed;fed<fe
d=fed>fed?ffe)d@ffe*dAffe+e!Bd:fe!dBfe+dCffe-d@ffe.dAffe/e"Bd:fe"dBfe/dCffe1d@ffe2dAffe3e$BdDfe$dEfe3dCfff
Z@dFdG�ZAd2ZBd*ZCd/ZDd3ZEdZFdZGdZHd.ZIdZJd5ZKdZLdZMd+ZNd,ZOdZPd-ZQd4ZRzddHlSTWneTk
�rFYnXdIS)JzoConstants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *
����������	cCs|d@S)zMReturn the portion of the file's mode that can be set by
    os.chmod().
    i����moderr�/usr/lib64/python3.8/stat.py�S_IMODEsrcCs|d@S)zLReturn the portion of the file's mode that describes the
    file type.
    i�rrrrr�S_IFMTsri@i i`i�ii�i�cCst|�tkS)z(Return True if mode is from a directory.)r�S_IFDIRrrrr�S_ISDIR2srcCst|�tkS)z<Return True if mode is from a character special device file.)r�S_IFCHRrrrr�S_ISCHR6srcCst|�tkS)z8Return True if mode is from a block special device file.)r�S_IFBLKrrrr�S_ISBLK:srcCst|�tkS)z+Return True if mode is from a regular file.)r�S_IFREGrrrr�S_ISREG>srcCst|�tkS)z0Return True if mode is from a FIFO (named pipe).)r�S_IFIFOrrrr�S_ISFIFOBsrcCst|�tkS)z,Return True if mode is from a symbolic link.)r�S_IFLNKrrrr�S_ISLNKFsrcCst|�tkS)z%Return True if mode is from a socket.)r�S_IFSOCKrrrr�S_ISSOCKJsrcCsdS)z#Return True if mode is from a door.Frrrrr�S_ISDOORNsrcCsdS)z*Return True if mode is from an event port.Frrrrr�S_ISPORTRsr cCsdS)z'Return True if mode is from a whiteout.Frrrrr�S_ISWHTVsr!iii���@i��8� �iiiii �l�s�-�b�d�c�p�r�w�S�x�t�TcCsJg}tD]6}|D]"\}}||@|kr|�|�qq|�d�qd�|�S)z;Convert a file's mode to a string of the form '-rwxrwxrwx'.r*�)�_filemode_table�append�join)r
Zperm�table�bit�charrrr�filemode�s
r<)�*N)U�__doc__�ST_MODE�ST_INO�ST_DEV�ST_NLINK�ST_UID�ST_GID�ST_SIZE�ST_ATIME�ST_MTIME�ST_CTIMErrrrrrrrr�S_IFDOOR�S_IFPORT�S_IFWHTrrrrrrrrr r!�S_ISUID�S_ISGID�S_ENFMT�S_ISVTX�S_IREAD�S_IWRITE�S_IEXEC�S_IRWXU�S_IRUSR�S_IWUSR�S_IXUSR�S_IRWXG�S_IRGRP�S_IWGRP�S_IXGRP�S_IRWXO�S_IROTH�S_IWOTH�S_IXOTH�	UF_NODUMP�UF_IMMUTABLE�	UF_APPEND�	UF_OPAQUE�UF_NOUNLINK�
UF_COMPRESSED�	UF_HIDDEN�SF_ARCHIVED�SF_IMMUTABLE�	SF_APPEND�SF_NOUNLINK�SF_SNAPSHOTr6r<�FILE_ATTRIBUTE_ARCHIVE�FILE_ATTRIBUTE_COMPRESSED�FILE_ATTRIBUTE_DEVICE�FILE_ATTRIBUTE_DIRECTORY�FILE_ATTRIBUTE_ENCRYPTED�FILE_ATTRIBUTE_HIDDEN�FILE_ATTRIBUTE_INTEGRITY_STREAM�FILE_ATTRIBUTE_NORMAL�"FILE_ATTRIBUTE_NOT_CONTENT_INDEXED�FILE_ATTRIBUTE_NO_SCRUB_DATA�FILE_ATTRIBUTE_OFFLINE�FILE_ATTRIBUTE_READONLY�FILE_ATTRIBUTE_REPARSE_POINT�FILE_ATTRIBUTE_SPARSE_FILE�FILE_ATTRIBUTE_SYSTEM�FILE_ATTRIBUTE_TEMPORARY�FILE_ATTRIBUTE_VIRTUAL�_stat�ImportErrorrrrr�<module>s�	�
�
�
��fileinput.cpython-38.opt-1.pyc000064400000032077151450073350012146 0ustar00U

e5du9�@s�dZddlZddlZddddddd	d
ddd
dgZdad"ddd�dd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�Zdd�Z
Gdd�d�Zdd
�Zd#dd�Zdd �Zed!kr�e�dS)$a
Helper class to quickly write a loop over all standard input files.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty.  If a filename is '-' it
is also replaced by sys.stdin and the optional arguments mode and
openhook are ignored.  To specify an alternative list of filenames,
pass it as the argument to input().  A single file name is also allowed.

Functions filename(), lineno() return the filename and cumulative line
number of the line that has just been read; filelineno() returns its
line number in the current file; isfirstline() returns true iff the
line just read is the first line of its file; isstdin() returns true
iff the line was read from sys.stdin.  Function nextfile() closes the
current file so that the next iteration will read the first line from
the next file (if any); lines not read from the file will not count
towards the cumulative line count; the filename is not changed until
after the first line of the next file has been read.  Function close()
closes the sequence.

Before any lines have been read, filename() returns None and both line
numbers are zero; nextfile() has no effect.  After all lines have been
read, filename() and the line number functions return the values
pertaining to the last line read; nextfile() has no effect.

All files are opened in text mode by default, you can override this by
setting the mode parameter to input() or FileInput.__init__().
If an I/O error occurs during opening or reading a file, the OSError
exception is raised.

If sys.stdin is used more than once, the second and further use will
return no lines, except perhaps for interactive use, or if it has been
explicitly reset (e.g. using sys.stdin.seek(0)).

Empty files are opened and immediately closed; the only time their
presence in the list of filenames is noticeable at all is when the
last file opened is empty.

It is possible that the last line of a file doesn't end in a newline
character; otherwise lines are returned including the trailing
newline.

Class FileInput is the implementation; its methods filename(),
lineno(), fileline(), isfirstline(), isstdin(), nextfile() and close()
correspond to the functions in the module.  In addition it has a
readline() method which returns the next input line, and a
__getitem__() method which implements the sequence behavior.  The
sequence must be accessed in strictly sequential order; sequence
access and readline() cannot be mixed.

Optional in-place filtering: if the keyword argument inplace=1 is
passed to input() or to the FileInput constructor, the file is moved
to a backup file and standard output is directed to the input file.
This makes it possible to write a filter that rewrites its input file
in place.  If the keyword argument backup=".<some extension>" is also
given, it specifies the extension for the backup file, and the backup
file remains around; by default, the extension is ".bak" and it is
deleted when the output file is closed.  In-place filtering is
disabled when standard input is read.  XXX The current implementation
does not work for MS-DOS 8+3 filesystems.

XXX Possible additions:

- optional getopt argument processing
- isatty()
- read(), read(size), even readlines()

�N�input�close�nextfile�filename�lineno�
filelineno�fileno�isfirstline�isstdin�	FileInput�hook_compressed�hook_encodedF��r��mode�openhookcCs(trtjrtd��t|||||d�atS)aReturn an instance of the FileInput class, which can be iterated.

    The parameters are passed to the constructor of the FileInput class.
    The returned instance, in addition to being an iterator,
    keeps global state for the functions of this module,.
    zinput() already activer)�_state�_file�RuntimeErrorr)�files�inplace�backuprr�r�!/usr/lib64/python3.8/fileinput.pyrSs
cCst}da|r|��dS)zClose the sequence.N)rr)�staterrrr`scCststd��t��S)a�
    Close the current file so that the next iteration will read the first
    line from the next file (if any); lines not read from the file will
    not count towards the cumulative line count. The filename is not
    changed until after the first line of the next file has been read.
    Before the first line has been read, this function has no effect;
    it cannot be used to skip the first file. After the last line of the
    last file has been read, this function has no effect.
    �no active input())rrrrrrrrhs
cCststd��t��S)zr
    Return the name of the file currently being read.
    Before the first line has been read, returns None.
    r)rrrrrrrrvscCststd��t��S)z�
    Return the cumulative line number of the line that has just been read.
    Before the first line has been read, returns 0. After the last line
    of the last file has been read, returns the line number of that line.
    r)rrrrrrrrscCststd��t��S)z�
    Return the line number in the current file. Before the first line
    has been read, returns 0. After the last line of the last file has
    been read, returns the line number of that line within the file.
    r)rrrrrrrr�scCststd��t��S)zg
    Return the file number of the current file. When no file is currently
    opened, returns -1.
    r)rrrrrrrr�scCststd��t��S)ze
    Returns true the line just read is the first line of its file,
    otherwise returns false.
    r)rrr	rrrrr	�scCststd��t��S)z]
    Returns true if the last line was read from sys.stdin,
    otherwise returns false.
    r)rrr
rrrrr
�sc@s�eZdZdZd)ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)*ra;FileInput([files[, inplace[, backup]]], *, mode=None, openhook=None)

    Class FileInput is the implementation of the module; its methods
    filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),
    nextfile() and close() correspond to the functions of the same name
    in the module.
    In addition it has a readline() method which returns the next
    input line, and a __getitem__() method which implements the
    sequence behavior. The sequence must be accessed in strictly
    sequential order; random access and readline() cannot be mixed.
    NFrrrcCst|t�r|f}nBt|tj�r,t�|�f}n(|dkrBtjdd�}|sLd}nt|�}||_||_	||_
d|_d|_d|_
d|_d|_d|_d|_d|_|dkr�td��d|kr�ddl}|�dtd	�||_d|kr�|�d
d�nd|_|�r|r�td��t|��std
��||_dS)N�)�-rF)rZrU�U�rbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'rz'U' mode is deprecated�r�wz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)�
isinstance�str�os�PathLike�fspath�sys�argv�tuple�_files�_inplace�_backup�_savestdout�_output�	_filename�_startlineno�_filelinenor�_isstdin�_backupfilename�
ValueError�warnings�warn�DeprecationWarning�_mode�replace�_write_mode�callable�	_openhook)�selfrrrrrr6rrr�__init__�sH
�
zFileInput.__init__cCs|��dS�N�r�r>rrr�__del__�szFileInput.__del__cCsz|��W5d|_XdS)Nr)r+rrBrrrr�szFileInput.closecCs|Sr@rrBrrr�	__enter__�szFileInput.__enter__cCs|��dSr@rA)r>�type�value�	tracebackrrr�__exit__�szFileInput.__exit__cCs|Sr@rrBrrr�__iter__�szFileInput.__iter__cCs6|��}|r|jd7_|S|js(t�|��qdS�Nr)�	_readliner2r�
StopIterationr�r>�linerrr�__next__�szFileInput.__next__cCsXddl}|jdtdd�||��kr,td��z
|��WStk
rRtd��YnXdS)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r!)�
stacklevelzaccessing lines out of orderzend of input reached)r6r7r8rrrOrL�
IndexError)r>�ir6rrr�__getitem__s�
zFileInput.__getitem__cCs�|j}d|_|r|t_|j}d|_z|r0|�
�W5|j}d|_z|`Wntk
r\YnXz|rr|jsr|�
�W5|j}d|_|r�|js�zt	�
|�Wntk
r�YnXd|_XXdS)NF)r.r(�stdoutr/rrK�AttributeErrorr4r-r%�unlink�OSErrorr3r)r>Z
savestdout�output�fileZbackupfilenamerrrrs4

zFileInput.nextfilecCs6|��}|r|jd7_|S|js(|S|��qdSrJ)rKr2rrrMrrr�readline.szFileInput.readlinecCs�|jsd|jkrdSdS|jd|_|jdd�|_|��|_d|_d|_d|_d|_|jdkr�d|_d|jkr�t	t
jd	t
j�|_nt
j|_d
|_�nT|j�r�t
�|j�|jp�d|_zt
�|j�Wntk
r�YnXt
�|j|j�t|j|j�|_zt
�|j���j}Wn&tk
�r8t|j|j�|_YntXt
jt
jBt
jB}tt
d��rb|t
jO}t
�|j||�}t
�||j�|_zt
�|j|�Wntk
�r�YnXt
j |_!|jt
_ n,|j"�r�|�"|j|j�|_nt|j|j�|_|jj#|_$|�$�S)
N�b�rrrFrz<stdin>�bufferTz.bak�O_BINARY)%r+r9r0rr1r2rr3r4�getattrr(�stdinr,r%r'r-rVrW�rename�open�fstatr�st_moder;r/�O_CREAT�O_WRONLY�O_TRUNC�hasattrr^�fdopen�chmodrTr.r=rZrK)r>Zpermr�fdrrrrK9s\




�


zFileInput._readlinecCs|jSr@)r0rBrrrrrszFileInput.filenamecCs|j|jSr@)r1r2rBrrrruszFileInput.linenocCs|jSr@�r2rBrrrrxszFileInput.filelinenocCs4|jr,z|j��WStk
r(YdSXndSdS)N���)rrr5rBrrrr{s
zFileInput.filenocCs
|jdkSrJrlrBrrrr	�szFileInput.isfirstlinecCs|jSr@)r3rBrrrr
�szFileInput.isstdin)NFr)�__name__�
__module__�__qualname__�__doc__r?rCrrDrHrIrOrSrrZrKrrrrr	r
rrrrr�s*�)9	cCsVtj�|�d}|dkr,ddl}|�||�S|dkrHddl}|�||�St||�SdS)Nrz.gzrz.bz2)r%�path�splitext�gziprb�bz2ZBZ2File)rrZextrtrurrrr�scs��fdd�}|S)Ncst||��d�S)N��encoding�errors)rb)rrrvrrr�szhook_encoded.<locals>.openhookr)rwrxrrrvrr
�scCs�ddl}d}d}|�tjdd�d�\}}|D] \}}|dkrBd}|dkr.|}q.t|||d�D]b}|d	d�d
kr~|dd	�}|d	d�dkr�|dd	�}tdt�t�t�t�r�d
p�d|f�q^tdt�t�t�f�dS)NrFrzib:z-iTz-b)rrrm�
�
z%d: %s[%d]%s %s�*rz
%d: %s[%d])	�getoptr(r)r�printrrrr	)r|rrZopts�args�o�arNrrr�_test�s&�
r��__main__)NFr)N)rqr(r%�__all__rrrrrrrrr	r
rrr
r�rnrrrr�<module>s4J�
	

			^
pickle.cpython-38.pyc000064400000133476151450073350010464 0ustar00U

e5d��	@shdZddlmZddlmZddlmZmZmZddlm	Z	ddl
mZddlZddlm
Z
dd	lmZmZddlZddlZddlZddlZd
ddd
dddddg	ZzddlmZe�d�dZWnek
r�dZYnXeefZdZddddddddgZdZ d Z!Gd!d
�d
e"�Z#Gd"d�de#�Z$Gd#d�de#�Z%Gd$d%�d%e"�Z&zdd&l'm(Z(Wnek
�rldZ(YnXd'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^d]Z_eOeYeZe[gZ`d^Zad_Zbd`ZcdaZddbZedcZfddZgdeZhdfZidgZjdhZkdiZldjZmdkZndlZoe�pdmdn�eq�D��Gdodp�dp�ZrGdqdr�dr�Zsdsdt�Ztdudv�Zudwdx�Zvdydz�ZwGd{d|�d|�ZxGd}d~�d~�Zyd�ddd�d�d��Zzd�ddd�d�d��Z{dd�d�dd��d�d��Z|dd�d�dd��d�d��Z}z0dd�lm#Z#m$Z$m%Z%m~Z~mZm�Z�m�Z�m�Z�m�Z�Wn4ek
�r�exeyZ~Zeze{e|e}f\Z�Z�Z�Z�YnXd�d��Z�e�d�k�rdddl�Z�e�j�d�d��Z�e�j�d�e���d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e����Z�e�j��r*e��n:e�j��s<e����n(ddl�Z�e�j�D]Z�e�e��Z�e���e���qJdS)�a�Create portable serialized representations of Python objects.

See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

�)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loads)�PickleBufferrTFz4.0z1.0z1.1z1.2z1.3z2.0z3.0z5.0��c@seZdZdZdS)rz6A common base class for the other pickling exceptions.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pickle.pyrIsc@seZdZdZdS)r
z]This exception is raised when an unpicklable object is passed to the
    dump() method.

    Nrrrrrr
Msc@seZdZdZdS)raThis exception is raised when there is a problem unpickling an object,
    such as a security violation.

    Note that other exceptions may also be raised during unpickling, including
    (but not necessarily limited to) AttributeError, EOFError, ImportError,
    and IndexError.

    NrrrrrrTsc@seZdZdd�ZdS)�_StopcCs
||_dS�N)�value��selfr!rrr�__init__bsz_Stop.__init__N)rrrr$rrrrrasr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
�������������������������B�C��������������������������cCsg|]}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srnc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dSr )�
file_write�
current_frame)r#rprrrr$�sz_Framer.__init__cCst��|_dSr )�io�BytesIOrq�r#rrr�
start_framing�sz_Framer.start_framingcCs*|jr&|j��dkr&|jdd�d|_dS)NrT��force)rq�tell�commit_framertrrr�end_framing�sz_Framer.end_framingFcCsf|jrb|j}|��|jks|rb|��}|j}t|�|jkrP|ttdt|���||�t	�
�|_dS)N�<Q)rqrx�_FRAME_SIZE_TARGET�	getbufferrp�len�_FRAME_SIZE_MIN�FRAMEr
rrrs)r#rw�f�data�writerrrry�sz_Framer.commit_framecCs |jr|j�|�S|�|�SdSr )rqr�rp�r#r�rrrr��sz
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NTrv)rprqry)r#�headerZpayloadr�rrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrrr|r$rurzryr�r�rrrrro�s
roc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	_UnframerNcCs||_||_d|_dSr )�	file_read�
file_readlinerq)r#r�r�Z	file_tellrrrr$	sz_Unframer.__init__cCs�|jrb|j�|�}|dkrJt|�dkrJd|_t|�}|�|�|dd�<|S|t|�kr^td��|St|�}|�|�|dd�<|SdS�Nr�$pickle exhausted before end of frame)rq�readintor~r�r)r#�buf�nrrrr�s�z_Unframer.readintocCsT|jrF|j�|�}|s.|dkr.d|_|�|�St|�|krBtd��|S|�|�SdSr�)rq�readr�r~r�r#r�r�rrrr�s
�z_Unframer.readcCsF|jr:|j��}|s"d|_|��S|ddkr6td��|S|��SdS)N����
r�)rq�readliner�rr�rrrr�,s
�z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rqr�rrrrsr��r#Z
frame_sizerrr�
load_frame9s
�z_Unframer.load_frame)N)rrrr$r�r�r�r�rrrrr�s



r�c	Csj|�d�D]V}|dkr&td�||���z|}t||�}Wq
tk
r^td�||��d�Yq
Xq
||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributeBs"���
r�c	Cs�t|dd�}|dk	r|Stj����D]X\}}|dks&|dks&|dkrHq&z t||�d|krf|WSWq&tk
r|Yq&Xq&dS)z$Find the module an object belong to.rN�__main__Z__mp_main__r)r��sys�modules�copy�itemsr�r�)r�r��module_name�modulerrr�whichmoduleOs ��r�cCsh|dkrdS|��d?d}|j|ddd�}|dkrd|dkrd|dd	krd|d
d@dkrd|dd�}|S)
a�Encode a long to a two's complement little-endian binary string.
    Note that 0 is a special case, returning an empty string, to save a
    byte in the LONG1 pickling context.

    >>> encode_long(0)
    b''
    >>> encode_long(255)
    b'\xff\x00'
    >>> encode_long(32767)
    b'\xff\x7f'
    >>> encode_long(-256)
    b'\x00\xff'
    >>> encode_long(-32768)
    b'\x00\x80'
    >>> encode_long(-128)
    b'\x80'
    >>> encode_long(127)
    b'\x7f'
    >>>
    rr����littleT��	byteorderZsignedr������N)�
bit_length�to_bytes)rm�nbytes�resultrrr�encode_longbsr�cCstj|ddd�S)a\Decode a long from a two's complement little-endian binary string.

    >>> decode_long(b'')
    0
    >>> decode_long(b"\xff\x00")
    255
    >>> decode_long(b"\xff\x7f")
    32767
    >>> decode_long(b"\x00\xff")
    -256
    >>> decode_long(b"\x00\x80")
    -32768
    >>> decode_long(b"\x80")
    -128
    >>> decode_long(b"\x7f")
    127
    r�Tr�)�int�
from_bytes)r�rrr�decode_long�sr�c@s�eZdZd;ddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd<dd�Z	dd�Z
dd�Zd=dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<er�d$d%�Zee
e<d&d'�Zee
e<d(d)�Zee
e <d*d+�Z!e!e
e"<d,Z#d-d.�Z$d/d0�Z%e%e
e&<e'dk	�r@e%e
e'<d1d2�Z(d3d4�Z)e)e
e*<d5d6�Z+e+e
e,<d>d7d8�Z-d9d:�Z.e-e
e/<e.e
e<dS)?�_PicklerNT��fix_imports�buffer_callbackcCs�|dkrt}|dkrt}n"d|kr.tks<ntdt��|dk	rT|dkrTtd��||_z|j|_Wntk
r�td��YnXt|j�|_	|j	j|_|j	j
|_i|_t
|�|_|dk|_d|_|o�|dk|_dS)	a!This takes a binary file for writing a pickle data stream.

        The optional *protocol* argument tells the pickler to use the
        given protocol; supported protocols are 0, 1, 2, 3, 4 and 5.
        The default protocol is 4. It was introduced in Python 3.4, and
        is incompatible with previous versions.

        Specifying a negative protocol version selects the highest
        protocol version supported.  The higher the protocol used, the
        more recent the version of Python needed to read the pickle
        produced.

        The *file* argument must have a write() method that accepts a
        single bytes argument. It can thus be a file object opened for
        binary writing, an io.BytesIO instance, or any other custom
        object that meets this interface.

        If *fix_imports* is True and *protocol* is less than 3, pickle
        will try to map the new Python 3 names to the old module names
        used in Python 2, so that the pickle data stream is readable
        with Python 2.

        If *buffer_callback* is None (the default), buffer views are
        serialized into *file* as part of the pickle stream.

        If *buffer_callback* is not None, then it can be called any number
        of times with a buffer view.  If the callback returns a false value
        (such as None), the given buffer is out-of-band; otherwise the
        buffer is serialized in-band, i.e. inside the pickle stream.

        It is an error if *buffer_callback* is not None and *protocol*
        is None or smaller than 5.
        Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributer�r�)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueError�_buffer_callbackr��_file_writer��	TypeErrorro�framerr��_write_large_bytes�memor��proto�bin�fastr�)r#�file�protocolr�r�rrrr$�s*#



z_Pickler.__init__cCs|j��dS)aClears the pickler's "memo".

        The memo is the data structure that remembers which objects the
        pickler has already seen, so that shared or recursive objects
        are pickled by reference and not by value.  This method is
        useful when re-using picklers.
        N)r��clearrtrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|�ttd|j��|jdkrP|j�	�|�
|�|�t�|j��dS)z7Write a pickled representation of obj to the open file.r�z2Pickler.__init__() was not called by %s.__init__()��<BrN)
�hasattrr
�	__class__rr�r��PROTOr
r�ru�save�STOPrz�r#r�rrrr�s
�




z
_Pickler.dumpcCsL|jr
dSt|�|jkst�t|j�}|�|�|��||f|jt|�<dS)zStore an object in the memo.N)r��idr��AssertionErrorr~r��put)r#r��idxrrr�memoize�s
z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|��d�dSdS)Nr�r��<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)r#r�rrrr�s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|��d�dS)Nr�r�r�r�r�)r��BINGETr
�LONG_BINGET�GETr�r��r#�irrr�gets
z_Pickler.getc
Cs�|j��|�|�}|dk	r.|r.|�|�dS|j�t|��}|dk	r^|�|�|d��dSt}t	|dd�}|dk	r~||�}|tk�r@t
|�}|j�|�}|dk	r�|||�dSt	|dt��|�}|dk	r�||�}njt
|t
�r�|�|�dSt	|dd�}|dk	�r||j�}n0t	|dd�}|dk	�r.|�}ntd|j|f��t|t��r\|�||�dSt|t��sttd|��t|�}	d|	k�r�d	k�s�ntd
|��|j|d|i�dS)NrZreducer_overrider�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z2Tuple returned by %s must have two to six elementsr�)r�ry�
persistent_id�	save_persr�r�r�r��NotImplementedr��type�dispatchr�
issubclass�save_globalr�r
r�
isinstance�str�tupler~�save_reduce)
r#r��save_persistent_id�pidrm�rv�reduce�tr��lrrrr�sZ









��z
_Pickler.savecCsdSr rr�rrrr�]sz_Pickler.persistent_idcCsb|jr |j|dd�|�t�n>z |�tt|��d�d�Wntk
r\td��YnXdS)NF)r�r�r��2persistent IDs in protocol 0 must be ASCII strings)	r�r�r��	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
�r#r�rrrr�as �z_Pickler.save_persc
Cs>t|t�std��t|�s"td��|j}|j}	t|dd�}
|jdkr�|
dkr�|\}}}t|d�sntd�	|
���|dk	r�||j
k	r�td	�	|
���|jd
kr�||�||�||�|	t�n,t|j
|f|�|�}||�|d�|	t�n�|jdk�r^|
dk�r^|d
}t|d��std��|dk	�r8||j
k	�r8td��|dd�}||�||�|	t�n||�||�|	t�|dk	�r�t|�|jk�r�|	t|�|jt|�d
��n
|�|�|dk	�r�|�|�|dk	�r�|�|�|dk	�r:|dk�r
||�|	t�n0||�||�||�|	t�|	t�|	t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r��
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classrr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�r�r�r�r�r�r��	NEWOBJ_EXrr�REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD�TUPLE2)
r#�func�args�stateZ	listitemsZ	dictitemsZstate_setterr�r�r�Z	func_name�cls�kwargsrrrr�msz


��


��

"







z_Pickler.save_reducecCs|�t�dSr )r��NONEr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|�|rtnt�n|�|r*tnt�dS)Nr�)r�r��NEWTRUE�NEWFALSE�TRUE�FALSEr�rrr�	save_bool�s
z_Pickler.save_boolcCs.|jr~|dkrN|dkr.|�ttd|��dS|dkrN|�ttd|��dSd|krbdkr~nn|�ttd|��dS|jd	kr�t|�}t|�}|d
kr�|�t	td|�|�n|�t
td|�|�dSd|kr�dk�rnn|�tt|��
d�d�n|�tt|��
d�d
�dS)Nrr�r���<Hi�i����<ir�r�r�r�sL
)r�r��BININT1r
�BININT2�BININTr�r�r~�LONG1�LONG4�INTr�r��LONG�r#r�Zencodedr�rrr�	save_long�s*
z_Pickler.save_longcCs<|jr|�ttd|��n|�tt|��d�d�dS)N�>dr�r�)r�r��BINFLOATr
�FLOATr�r�r�rrr�
save_floatsz_Pickler.save_floatcCs�|jdkr@|s |jtd|d�n|jtjt|d�df|d�dSt|�}|dkrj|�tt	d|�|�nf|dkr�|jdkr�|�
tt	d	|�|�n<||jj
kr�|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nr�r�r��latin1r�r����rr{r�)r�r��bytes�codecsr�r�r~r��SHORT_BINBYTESr
r��	BINBYTES8r�r|�BINBYTESr��r#r�r�rrr�
save_bytess"
�z_Pickler.save_bytescCs�|jdkr:|s |jtd|d�n|jtt|�f|d�dSt|�}||jjkrf|�tt	d|�|�n|�
tt	d|�|�dS)Nrrr+r{)r�r��	bytearrayr.r~r�r|r��
BYTEARRAY8r
r�r3rrr�save_bytearray)s
z_Pickler.save_bytearrayc	Cs�|jdkrtd��|���t}|js*td��d}|jdk	rFt|�|��}|rp|jr`|�|���q�|�	|���n|�
t�|jr�|�
t�W5QRXdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT)
r�r
�raw�
contiguousr��bool�readonlyr4�tobytesr7r��NEXT_BUFFER�READONLY_BUFFER)r#r��mZin_bandrrr�save_picklebuffer8s



z_Pickler.save_picklebuffercCs|jr�|�dd�}t|�}|dkrF|jdkrF|�ttd|�|�nf|dkrp|jdkrp|�ttd|�|�n<||j	j
kr�|�ttd|�|�n|�ttd|�|�nT|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)N�utf-8�
surrogatepassr�rr�r-r{r��\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001a�raw-unicode-escaper�)r�r�r~r�r��SHORT_BINUNICODEr
r��BINUNICODE8r�r|�
BINUNICODE�replace�UNICODEr�r%rrr�save_strRs&�z_Pickler.save_strcCs:|s(|jr|�t�n|�tt�dSt|�}|j}|j}|dkr�|jdkr�|D]}||�qRt	|�|kr�|�
|t	|�d�}|�t||�n|�t|�|�
|�dS|j}|t�|D]}||�q�t	|�|k�r$|�
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|�
|�dS)Nr�r�rr�)r�r��EMPTY_TUPLE�MARK�TUPLEr~r�r�r�r�r�r
�_tuplesize2coder��POP_MARK)r#r�r�r�r�Zelementr�r�rrr�
save_tupleis:


z_Pickler.save_tuplecCs8|jr|�t�n|�tt�|�|�|�|�dSr )r�r��
EMPTY_LISTrP�LISTr�rr�rrr�	save_list�s

z_Pickler.save_listi�cCs�|j}|j}|js0|D]}||�|t�qdSt|�}tt||j��}t|�}|dkr||t	�|D]}||�qd|t
�n|r�||d�|t�||jkr8dSq8dS�Nr�r)r�r�r��APPEND�iter�listr�
_BATCHSIZEr~rP�APPENDS)r#r�r�r�rm�it�tmpr�rrrr�s(



z_Pickler._batch_appendscCs<|jr|�t�n|�tt�|�|�|�|���dSr )r�r��
EMPTY_DICTrP�DICTr�rr�r�rrr�	save_dict�s

z_Pickler.save_dictc	Cs�|j}|j}|js<|D] \}}||�||�|t�qdSt|�}tt||j��}t|�}|dkr�|t	�|D]\}}||�||�qp|t
�n(|r�|d\}}||�||�|t�||jkrDdSqDdSrX)r�r�r��SETITEMrZr[rr\r~rP�SETITEMS)	r#r�r�r��k�vr^r_r�rrrr�s0



z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|�|�t|�}tt	||j
��}t|�}|dkr�|t�|D]}||�qv|t
�||j
krJdSqJdS�Nrr+r)r�r�r�r��setr[�	EMPTY_SETr�rZrr\r~rP�ADDITEMS)r#r�r�r�r^Zbatchr��itemrrr�save_set�s"



z_Pickler.save_setcCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|D]}||�q<t|�|jkr||t	|�
|jt|�d��dS|t�|�|�dSrg)
r�r�r�r��	frozensetr[rPr�r�rSr��	FROZENSETr�)r#r�r�r�rkrrr�save_frozensets

 z_Pickler.save_frozensetc

Csd|j}|j}|dkr t|dd�}|dkr.|j}t||�}z(t|dd�tj|}t||�\}}Wn.t	t
tfk
r�td|||f�d�YnX||k	r�td|||f��|j
dk�r&t�||f�}	|	�r&|	dks�t�|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|�d�d}
||k�rB|
}|j
d
k�rl|�|�|�|�|t�n�||k	�r�|�t||
f�n�|j
dk�r�|tt|d�dt|d�d�n�|j�rtj}tj}||f|k�r�|||f\}}n||k�r||}z(|tt|d�dt|d�d�Wn,tk
�rTtd|||j
f�d�YnX|� |�dS)Nrr��levelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�r�rrrr�rr�rAr�r�z?can't pickle global identifier '%s.%s' using pickle protocol %i)!r�r�r�rr��
__import__r�r�r��ImportError�KeyErrorr�r
r�rr�r��EXT1r
�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr.r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGrr�)
r#r�r�r�r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr�s�

�����





��
��

���z_Pickler.save_globalcCs`|td�kr|jtd|d�S|tt�kr:|jttf|d�S|td�krV|jtd|d�S|�|�S)Nr r+.).)r�r�r�r�r�rrr�	save_typeasz_Pickler.save_type)N)T)NNNNN)N)0rrrr$r�rr�r�r�r�r�r�r�r�rr�rr:r&r�r*�floatr4r.r7r5�_HAVE_PICKLE_BUFFERr@rrNr�rTr�rWr[r\rrb�dictr%rrlrhrormr�r}rrrrrr��sj�9
	
F�
u1		

B	r�c@s�eZdZddddd�dd�Zdd	�Zd
d�Zdd
�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd �Zeeed<d!d"�Zeeed<d#d$�Zeeed<d%d&�Zeeed<d'd(�Z e ee!d<d)d*�Z"e"ee#d<d+d,�Z$e$ee%d<d-d.�Z&e&ee'd<d/d0�Z(d1d2�Z)e)ee*d<d3d4�Z+e+ee,d<d5d6�Z-e-ee.d<d7d8�Z/e/ee0d<d9d:�Z1e1ee2d<d;d<�Z3e3ee4d<d=d>�Z5e5ee6d<d?d@�Z7e7ee8d<dAdB�Z9e9ee:d<dCdD�Z;e;ee<d<dEdF�Z=e=ee>d<dGdH�Z?e?ee@d<dIdJ�ZAeAeeBd<dKdL�ZCeCeeDd<dMdN�ZEeEeeFd<dOdP�ZGeGeeHd<dQdR�ZIeIeeJd<dSdT�ZKeKeeLd<dUdV�ZMeMeeNd<dWdX�ZOeOeePd<dYdZ�ZQeQeeRd<d[d\�ZSeSeeTd<d]d^�ZUeUeeVd<d_d`�ZWeWeeXd<dadb�ZYdcdd�ZZeZee[d<dedf�Z\e\ee]d<dgdh�Z^e^ee_d<didj�Z`e`eead<dkdl�Zbebeecd<dmdn�Zdedeeed<dodp�Zfefeegd<dqdr�Zheheeid<dsdt�Zjejeekd<dudv�Zldwdx�Zmdydz�Zneneeod<d{d|�Zpepeeqd<d}d~�Zrereesd<dd��Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<dS)��
_UnpicklerT�ASCII�strictN�r��encoding�errors�bufferscCsH|dk	rt|�nd|_|j|_|j|_i|_||_||_d|_	||_
dS)a�This takes a binary file for reading a pickle data stream.

        The protocol version of the pickle is detected automatically, so
        no proto argument is needed.

        The argument *file* must have two methods, a read() method that
        takes an integer argument, and a readline() method that requires
        no arguments.  Both methods should return bytes.  Thus *file*
        can be a binary file object opened for reading, an io.BytesIO
        object, or any other custom object that meets this interface.

        The file-like object must have two methods, a read() method
        that takes an integer argument, and a readline() method that
        requires no arguments.  Both methods should return bytes.
        Thus file-like object can be a binary file object opened for
        reading, a BytesIO object, or any other custom object that
        meets this interface.

        If *buffers* is not None, it should be an iterable of buffer-enabled
        objects that is consumed each time the pickle stream references
        an out-of-band buffer view.  Such buffers have been given in order
        to the *buffer_callback* of a Pickler object.

        If *buffers* is None (the default), then the buffers are taken
        from the pickle stream, assuming they are serialized there.
        It is an error for *buffers* to be None if the pickle stream
        was produced with a non-None *buffer_callback*.

        Other optional arguments are *fix_imports*, *encoding* and
        *errors*, which are used to control compatibility support for
        pickle stream generated by Python 2.  If *fix_imports* is True,
        pickle will try to map the old Python 2 names to the new names
        used in Python 3.  The *encoding* and *errors* tell pickle how
        to decode 8-bit string instances pickled by Python 2; these
        default to 'ASCII' and 'strict', respectively. *encoding* can be
        'bytes' to read theses 8-bit string instances as bytes objects.
        Nr)rZ�_buffersr��_file_readliner��
_file_readr�r�r�r�r�)r#r�r�r�r�r�rrrr$rs'z_Unpickler.__init__c
Cs�t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	|jj
|_
g|_g|_|jj
|_
d|_|j}|j}z4|d�}|s�t�t|t�s�t�||d|�qtWn,tk
r�}z|jWY�Sd}~XYnXdS)z�Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        r�z4Unpickler.__init__() was not called by %s.__init__()rr�N)r�rr�rr�r�r��	_unframerr�r�r��	metastack�stack�appendr�r��EOFErrorr��bytes_typesr�rr!)r#r�r��keyZstopinstrrrr�s,
�



z_Unpickler.loadcCs |j}|j��|_|jj|_|Sr )r�r��popr��r#r�rrr�pop_mark�s
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)rrrrr�persistent_load�sz_Unpickler.persistent_loadcCs:|�d�d}d|kr"tks0ntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)r#r�rrr�
load_proto�sz_Unpickler.load_protorcCs8td|�d��\}|tjkr(td|��|j�|�dS)Nr{�zframe size > sys.maxsize: %d)rr�r�r	r�r�r�r�rrrr��s
z_Unpickler.load_framecCsLz|��dd��d�}Wntk
r6td��YnX|�|�|��dS)Nr�r�r�)r��decode�UnicodeDecodeErrorrr�r�rrrr�load_persid�s�
z_Unpickler.load_persidcCs|j��}|�|�|��dSr )r�r�r�r�rrrr�load_binpersid�s
z_Unpickler.load_binpersidcCs|�d�dSr �r�rtrrr�	load_none�sz_Unpickler.load_nonecCs|�d�dS)NFr�rtrrr�
load_false�sz_Unpickler.load_falsecCs|�d�dS)NTr�rtrrr�	load_true�sz_Unpickler.load_truecCsL|��}|tdd�krd}n |tdd�kr4d}n
t|d�}|�|�dS)Nr�FTr)r�rrr�r�)r#r��valrrr�load_int�s
z_Unpickler.load_intcCs|�td|�d��d�dS)Nrrr�r�rr�rtrrr�load_binint�sz_Unpickler.load_binintcCs|�|�d�d�dSrX)r�r�rtrrr�load_binint1sz_Unpickler.load_binint1cCs|�td|�d��d�dS)Nrr�rr�rtrrr�load_binint2sz_Unpickler.load_binint2cCs@|��dd�}|r,|ddkr,|dd�}|�t|d��dS)Nr��Lr)r�r�r�)r#r�rrr�	load_longsz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dSrX)r�r�r�r�rrr�
load_long1s
z_Unpickler.load_long1cCs>td|�d��\}|dkr"td��|�|�}|�t|��dS)Nrrrz#LONG pickle has negative byte count)rr�rr�r�r�rrr�
load_long4s

z_Unpickler.load_long4cCs|�t|��dd���dS�Nr�)r�r~r�rtrrr�
load_float!sz_Unpickler.load_floatcCs|�td|�d��d�dS)Nr'r�rr�rtrrr�
load_binfloat%sz_Unpickler.load_binfloatcCs"|jdkr|S|�|j|j�SdS)Nr.)r�r�r�r"rrr�_decode_string)s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�r~rr�r�r/�
escape_decoder�rrr�load_string2s
(z_Unpickler.load_stringcCs@td|�d��\}|dkr"td��|�|�}|�|�|��dS)Nrrrz(BINSTRING pickle has negative byte count)rr�rr�r��r#r~r�rrr�load_binstring<s

z_Unpickler.load_binstringcCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr�rz2BINBYTES exceeds system's maximum size of %d bytes�rr�r	rr��r#r~rrr�
load_binbytesEs�z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�rH)r�r�r�rtrrr�load_unicodeMsz_Unpickler.load_unicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr�rz4BINUNICODE exceeds system's maximum size of %d bytesrArB�rr�r	rr�r�r�rrr�load_binunicodeQs�z_Unpickler.load_binunicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr{r�z5BINUNICODE8 exceeds system's maximum size of %d bytesrArBr�r�rrr�load_binunicode8Ys�z_Unpickler.load_binunicode8cCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr{r�z3BINBYTES8 exceeds system's maximum size of %d bytesr�r�rrr�load_binbytes8as�z_Unpickler.load_binbytes8cCsFtd|�d��\}|tkr&tdt��t|�}|�|�|�|�dS)Nr{r�z4BYTEARRAY8 exceeds system's maximum size of %d bytes)rr�r	rr5r�r�)r#r~�brrr�load_bytearray8is�
z_Unpickler.load_bytearray8cCsL|jdkrtd��zt|j�}Wntk
r<td��YnX|�|�dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)r�r�next�
StopIterationr�)r#r�rrr�load_next_bufferss
z_Unpickler.load_next_bufferc	Cs6|jd}t|��}|js(|��|jd<W5QRXdSr�)r��
memoryviewr;�
toreadonly)r#r�r?rrr�load_readonly_buffer~s

z_Unpickler.load_readonly_buffercCs,|�d�d}|�|�}|�|�|��dSrX)r�r�r�r�rrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dSrX)r�r�r�rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rrArB)r�r�r�r�rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|��}|�t|��dSr )r�r�r�r�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|�d�dS)Nrr�rtrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dSr��r�rtrrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�rtrrr�load_tuple2�sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�r�rtrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|�g�dSr r�rtrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|�i�dSr r�rtrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|�t��dSr )r�rhrtrrr�load_empty_set�sz_Unpickler.load_empty_setcCs|��}|�t|��dSr )r�r�rmr�rrr�load_frozenset�sz_Unpickler.load_frozensetcCs|��}|�|�dSr )r�r�r�rrr�	load_list�sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|�|d�qS)r�r)rlr��r�rr�
<dictcomp>�s�z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r��ranger~r�)r#�drr�r�	load_dict�s

�z_Unpickler.load_dictc
Cs�|st|t�rt|d�rjz||�}Wqttk
rf}z$td|jt|�ft��d��W5d}~XYqtXn
|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_inforr�)r#�klassrr!�errrrr�_instantiate�s��
�
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r��
find_classr�r��r#r�r�r�rrr�	load_inst�sz_Unpickler.load_instcCs"|��}|�d�}|�||�dS�Nr)r�r�r�)r#rrrrr�load_obj�s
z_Unpickler.load_objcCs2|j��}|j��}|j|f|��}|�|�dSr �r�r�rr�)r#rrr�rrr�load_newobj�s

z_Unpickler.load_newobjcCs>|j��}|j��}|j��}|j|f|�|�}|�|�dSr r�)r#rrrr�rrr�load_newobj_ex�s



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�rA)r�r�r�r�r�rrr�load_global�sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tk	s,t|�tk	r4td��|�|�||��dS)NzSTACK_GLOBAL requires str)r�r�r�r�rr�r�)r#r�r�rrr�load_stack_global�s


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dSrX)r��
get_extension�r#r|rrr�	load_ext1sz_Unpickler.load_ext1cCs td|�d��\}|�|�dS)Nrr��rr�r�r�rrr�	load_ext2	sz_Unpickler.load_ext2cCs td|�d��\}|�|�dS)Nrrr�r�rrr�	load_ext4sz_Unpickler.load_ext4cCspg}t�||�}||k	r&|�|�dSt�|�}|sP|dkrDtd��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r�rrr�r�)r#r|Znilr�r�rrrr�s


z_Unpickler.get_extensioncCs�t�d||�|jdkrT|jrT||ftjkr@tj||f\}}n|tjkrTtj|}t|dd�|jdkr~ttj	||�dSt
tj	||�SdS)Nzpickle.find_classr�rrpr)r��auditr�r�r{ZNAME_MAPPINGZIMPORT_MAPPINGrrr�r�r�)r#r�r�rrrr�#s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dSr��r�r�)r#r�rrrrr�load_reduce1sz_Unpickler.load_reducecCs|jr|jd=n|��dSr�)r�r�rtrrr�load_pop8s
z_Unpickler.load_popcCs|��dSr )r�rtrrr�
load_pop_mark?sz_Unpickler.load_pop_markcCs|�|jd�dSr�)r�r�rtrrr�load_dupCsz_Unpickler.load_dupcCs(t|��dd��}|�|j|�dSr�)r�r�r�r�r�rrr�load_getGsz_Unpickler.load_getcCs"|�d�d}|�|j|�dSrX)r�r�r�r�rrr�load_bingetLsz_Unpickler.load_bingetcCs&td|�d��\}|�|j|�dS)Nr�r)rr�r�r�r�rrr�load_long_bingetQsz_Unpickler.load_long_bingetcCs8t|��dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�r�r�r�rrr�load_putVsz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�r�r�r�rrr�load_binput]sz_Unpickler.load_binputcCs6td|�d��\}|tkr"td��|jd|j|<dS)Nr�rznegative LONG_BINPUT argumentr�)rr�r	r�r�r�r�rrr�load_long_binputdsz_Unpickler.load_long_binputcCs|j}|jd|t|�<dSr�)r�r�r~)r#r�rrr�load_memoizeksz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dSr�)r�r�r�)r#r�r!r[rrr�load_appendpsz_Unpickler.load_appendcCsZ|��}|jd}z
|j}Wntk
r0YnX||�dS|j}|D]}||�qHdSr�)r�r��extendr�r�)r#r�Zlist_objr�r�rkrrr�load_appendsws

z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dSr�r�)r#r�r!r�r�rrr�load_setitem�s
z_Unpickler.load_setitemcCs@|��}|jd}tdt|�d�D]}||d|||<q"dS)Nr�rr�r�)r�r�r�r~)r#r�r�r�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsD|��}|jd}t|t�r(|�|�n|j}|D]}||�q2dSr�)r�r�r�rh�update�add)r#r�Zset_objr�rkrrr�
load_additems�s

z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}|�	�D]*\}}	t
|�tkr�|	|||�<qp|	||<qp|r�|�	�D]\}}	t|||	�q�dS)Nr��__setstate__r�)
r�r�r�r�r�r~�__dict__r��internr�r�r��setattr)
r#r�r�inst�setstateZ	slotstateZ	inst_dictrrerfrrr�
load_build�s(
z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dSr )r�r�r�rtrrr�	load_mark�sz_Unpickler.load_markcCs|j��}t|��dSr )r�r�rr"rrr�	load_stop�s
z_Unpickler.load_stop)�rrrr$rr�r�r�r�r�r�r�r�r�r�r�r�rr�rr�rr�r#r�r r�rr�rr�r$r�r!r�r"r�r)r�r(r�r��STRINGr��	BINSTRINGr�r2r�rMr�rKr�rJr�r1r�r6r�r=r�r>r��SHORT_BINSTRINGr�r0r�rIr�rQr�rOr��TUPLE1r�rr��TUPLE3r�rUr�r`r�rir�rnr�rVr�rar�r��INSTr��OBJr�r	r�rr�rzr�ryr�rur�rvr�rwr�r�r�rr�r
r�rSr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rYr�r]r�rcr�rdr�rjrr
rrPrr�rrrrr�ps*�0				r�r�cCst||||d��|�dS�Nr�)r�r)r�r�r�r�r�rrr�_dump�s
��rcCs8t��}t||||d��|�|��}t|t�s4t�|Sr)rrrsr�r�getvaluer�r�r�)r�r�r�r�r��resrrr�_dumps�s��rr�r�r�cCst|||||d���S)N�r�r�r�r�)r�r)r�r�r�r�r�rrr�_load�s�rcCs2t|t�rtd��t�|�}t|||||d���S)Nz%Can't load pickle from unicode stringr)r�r�r�rrrsr�r)�sr�r�r�r�r�rrr�_loads�s

�r)	rr
rrrrrrrcCsddl}|��Sr�)�doctestZtestmod)rrrr�_test�srr�z$display contents of the pickle files)Zdescription�pickle_file�br�*zthe pickle file)r��nargs�helpz-tz--test�
store_truezrun self-test suite)�actionrz-vz)run verbosely; only affects self-test run)N)N)�r�typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrjrrr/r{�__all__�_picklerr�rrsr.r5r�Zformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer%rPr�r
rSrr)r#r rr$rrr�r�rrr	r
rMrKrYr
rzrar`r]r�r�r
r�rVrUrr�r�r�rcrQrOrdr(rrr�r	rurvrwrrrrrr!r"rRr2r0rIrJr1rirjrnrryr�r�r6r=r>r��dirror�r�r�r�r�r�r�rrrrrrrrrrrr�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsrZtestrZ
print_helpZpprintr�r�rrrr�<module>sh�

�

?;
^]��	0

����

enum.cpython-38.pyc000064400000062554151450073350010157 0ustar00U

e5d���@s�ddlZddlmZmZddddddd	gZd
d�Zdd
�Zdd�Zdd�Ze	�Z
Gdd�d�ZGdd�de�Z
dZGdd�de�ZGdd�ded�ZGdd�dee�Zdd�ZGdd�de�ZGdd�dee�Zdd�Zdd	�Zd d!�Zd"d#�ZdS)$�N)�MappingProxyType�DynamicClassAttribute�EnumMeta�Enum�IntEnum�Flag�IntFlag�auto�uniquecCst|d�pt|d�pt|d�S)z?
    Returns True if obj is a descriptor, False otherwise.
    �__get__�__set__�
__delete__)�hasattr)�obj�r�/usr/lib64/python3.8/enum.py�_is_descriptors

��rcCsLt|�dkoJ|dd�|dd�ko.dknoJ|ddkoJ|ddkS)z=
    Returns True if a __dunder__ name, False otherwise.
    �N�����__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dkoJ|d|dko&dknoJ|dd�dkoJ|dd�dkS)z;
    Returns True if a _sunder_ name, False otherwise.
    rr���r�rrrrrr�
_is_sunder!s���r cCsdd�}||_d|_dS)z,
    Make the given class un-picklable.
    cSstd|��dS)Nz%r cannot be pickled)�	TypeError��self�protorrr�_break_on_call_reduce0sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>N)�
__reduce_ex__�
__module__)�clsr%rrr�_make_class_unpicklable,sr)c@seZdZdZeZdS)r	zP
    Instances are replaced with an appropriate value in Enum class suites.
    N)�__name__r'�__qualname__�__doc__�
_auto_null�valuerrrrr	6scs,eZdZdZ�fdd�Z�fdd�Z�ZS)�	_EnumDictz�
    Track enum member order and ensure member names are not reused.

    EnumMeta will use the names found in self._member_names as the
    enumeration member names.
    cs&t���g|_g|_g|_d|_dS)NF)�super�__init__�
_member_names�_last_values�_ignore�_auto_called�r#��	__class__rrr1Ds

z_EnumDict.__init__csdt|�r�|dkrtd��|dkr<|jr.td��t|d|�nV|dkr�t|t�r`|�dd���}nt	|�}||_
t|�t|j�@}|r�td	|f��n�t
|�r�|d
kr�d}n�||jkr�td|��n�||j
kr�n�t|��sR||kr�td
|||f��t|t��r:|jtk�r4|�|dt|j�|jdd��|_d|_|j}|j�|�|j�|�t��||�dS)z�
        Changes anything not dundered or not a descriptor.

        If an enum member name is used twice, an error is raised; duplicate
        values are not checked for.

        Single underscore (sunder) names are reserved.
        )�_order_�_create_pseudo_member_�_generate_next_value_�	_missing_�_ignore_z(_names_ are reserved for future Enum user;z4_generate_next_value_ must be defined before members�_generate_next_valuer=�,� z-_ignore_ cannot specify already set names: %r�	__order__r9zAttempted to reuse key: %rz%r already defined as: %rrNT)r �
ValueErrorr5r!�setattr�
isinstance�str�replace�split�listr4�setr2rrr	r.r-r>rr3�appendr0�__setitem__)r#�keyr.�alreadyr7rrrKKsT	
��


�z_EnumDict.__setitem__)r*r'r+r,r1rK�
__classcell__rrr7rr/=sr/cs�eZdZdZedd��Z�fdd�Zdd�Zd/dddd	d
�dd�Zd
d�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��Zdd�Zdd �Z�fd!d"�Zdddd	d
�d#d$�Zd0d%d&�Zd'd(�Zed)d*��Zed+d,��Zed-d.��Z�ZS)1rz
    Metaclass for Enum
    cCs>|�||�t�}|�||�\}}|dk	r:t|dd�|d<|S)Nr;)�_check_for_existing_membersr/�_get_mixins_�getattr)�metaclsr(�bases�	enum_dict�member_type�
first_enumrrr�__prepare__�s�zEnumMeta.__prepare__c	s��dg��d��d}|D]}��|d�q|�||�\�}|���|�\}}}	�fdd��jD�}
�jD]
}�|=qn��dd�}t|
�ddh@}
|
r�td�d�	|
����d	�kr�d
�d	<t
��|||��}g|_i|_
�|_dd�|��D�}i|_d
�k�r2�tk	�r2d}t�fdd�|D���s2t|��jD�]*}|
|}t|t��sZ|f}n|}�tk�rn|f}|	�s�||�}t|d��s�||_n6||f|��}t|d��sƈtk�r�||_n
�|�|_|j}||_||_|j|�|j
��D]"\}}|j|jk�r�|}�q�q�|j�|�||k�r2t|||�||j
|<z||j|<Wntk
�r`YnX�q8dD]V}|�k�r|�qjt||�}t�|d�}t||d�}|dk	�rj||k�rjt|||��qjtdk	�r�|�r�||_ tj|_|dk	�rt|t!��r|�"dd��#�}||jk�rtd��|S)Nr=csi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>�sz$EnumMeta.__new__.<locals>.<dictcomp>r9�mro�zInvalid enum member name: {0}r?r,zAn enumeration.cSs.h|]&}|j��D]\}}t|t�r|�qqSr)�__dict__�itemsrDr)rX�crY�vrrr�	<setcomp>�s

�z#EnumMeta.__new__.<locals>.<setcomp>r&)�__getnewargs_ex__�__getnewargs__r&�
__reduce__c3s|]}|�jkVqdS�N)r^�rX�m)rUrr�	<genexpr>�sz#EnumMeta.__new__.<locals>.<genexpr>�_value_)�__repr__�__str__�
__format__r&r@z#member order does not match _order_)$�
setdefaultrJ�poprP�
_find_new_r2rIrB�format�joinr0�__new__�_member_names_�_member_map_�
_member_type_r\�_value2member_map_�object�anyr)rD�tuplerrj�_name_�__objclass__r1r_rCr!rQr�__new_member__rErFrG)rRr(rSrZ�ignorerLrVrs�save_new�use_args�enum_membersrr9�
invalid_names�
enum_class�dynamic_attributes�methods�member_namer.�args�enum_member�canonical_member�class_method�
obj_method�enum_methodr7)rZrUrrs�s��

��













zEnumMeta.__new__cCsdS)z6
        classes/types should always be True.
        Trr6rrr�__bool__3szEnumMeta.__bool__Nr��module�qualname�type�startcCs*|dkr|�||�S|j||||||d�S)a!
        Either returns an existing member, or creates a new enum class.

        This method is used both when an enum class is given a value to match
        to an enumeration member (i.e. Color(3)) and for the functional API
        (i.e. Color = Enum('Color', names='RED GREEN BLUE')).

        When used for the functional API:

        `value` will be the name of the new class.

        `names` should be either a string of white-space/comma delimited names
        (values will start at `start`), or an iterator/mapping of name, value pairs.

        `module` should be set to the module this class is being created in;
        if it is not set, an attempt to find that module will be made, but if
        it fails the class will not be picklable.

        `qualname` should be set to the actual location this class can be found
        at in its module; by default it is set to the global scope.  If this is
        not correct, unpickling will fail in some circumstances.

        `type`, if set, will be mixed in as the first base class.
        Nr�)rs�_create_)r(r.�namesr�r�r�r�rrr�__call__9s�zEnumMeta.__call__cCs:t|t�s$tdt|�j|jjf��t||�o8|j|jkS)N�3unsupported operand type(s) for 'in': '%s' and '%s')rDrr!r�r+r8r{ru)r(�memberrrr�__contains__^s
��zEnumMeta.__contains__cs(||jkrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)ru�AttributeErrorr*r0�__delattr__)r(�attrr7rrr�es
zEnumMeta.__delattr__cCsddddg|jS)Nr8r,�__members__r'�rtr6rrr�__dir__ls
��zEnumMeta.__dir__cCs@t|�rt|��z|j|WStk
r:t|�d�YnXdS)a=
        Return the enum member matching `name`

        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.
        N)rr�ru�KeyError�r(rrrr�__getattr__rs	zEnumMeta.__getattr__cCs
|j|Srf�rur�rrr�__getitem__�szEnumMeta.__getitem__cs�fdd��jD�S)z6
        Returns members in definition order.
        c3s|]}�j|VqdSrfr��rXr�r(rrri�sz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cCs
t|j�Srf)rrtr�rrr�__len__�szEnumMeta.__len__cCs
t|j�S)z�
        Returns a mapping of member name->value.

        This mapping lists all enum members, including aliases. Note that this
        is a read-only view of the internal mapping.
        )rrur�rrrr��szEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r*r�rrrrk�szEnumMeta.__repr__cs�fdd�t�j�D�S)z>
        Returns members in reverse definition order.
        c3s|]}�j|VqdSrfr�r�r�rrri�sz(EnumMeta.__reversed__.<locals>.<genexpr>)�reversedrtr�rr�r�__reversed__�szEnumMeta.__reversed__cs0|j�di�}||krtd��t��||�dS)a
        Block attempts to reassign Enum members.

        A simple assignment to the class namespace only changes one of the
        several possible ways to get an Enum member from the Enum class,
        resulting in an inconsistent Enumeration.
        ruzCannot reassign members.N)r^�getr�r0�__setattr__)r(rr.�
member_mapr7rrr��szEnumMeta.__setattr__c
Cs~|j}|dkr|fn||f}|�||�\}	}
|�||�}t|t�rR|�dd���}t|ttf�r�|r�t|dt�r�|g}}g}
t	|�D]8\}}|
�
||||
dd��}|
�|�|�||f�q�|D].}t|t�r�|||}}n|\}}|||<q�|�||||�}|dk�rPzt
�d�jd}Wn*tttfk
�rN}zW5d}~XYnX|dk�rdt|�n||_|dk	�rz||_|S)a�
        Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are incremented by 1 from `start`.
        * An iterable of member names.  Values are incremented by 1 from `start`.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value pairs.
        Nr?r@rrr*)r8rPrWrDrErFrGrzrH�	enumerater;rJrs�sys�	_getframe�	f_globalsr�rBr�r)r'r+)r(�
class_namer�r�r�r�r�rRrSrrVrZ�original_names�last_values�countrr.�itemr��member_valuer��excrrrr��s<
 







zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z|jdd�d�Wn$tk
rn|jdd�d�YnX||||d�}t|_|�|j	�|||<|S)z[
        Create a new Enum subclass that replaces a collection of global constants
        cs g|]\}}�|�r||f�qSrr)rXrr.��filterrr�
<listcomp>�s�z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>��z$EnumMeta._convert_.<locals>.<lambda>)rLcSs|dS�Nrrr�rrrr��r�)r�)
�varsr��modulesr_�sortr!�_reduce_ex_by_namer&�updater�)r(rr�r��source�module_globals�membersrr�r�	_convert_�s 	

�zEnumMeta._convert_cOs$ddl}|jdtdd�|j||�S)NrzI_convert is deprecated and will be removed in 3.9, use _convert_ instead.r)�
stacklevel)�warnings�warn�DeprecationWarningr�)r(r��kwargsr�rrr�_converts�zEnumMeta._convertcCs<|D]2}|jD]&}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)�__mro__�
issubclassrrtr!r*)r�rS�chain�baserrrrO
s
��z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�s2td��||�p<t}|jrLtd��||fS)z�
        Returns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__
        cs�g}|D]t}d}|jD]d}|tkr&qqt|t�rL|jtk	rz|�|j�qqd|jkrvt|t�rbq|�|pl|�qq|}qqt|�dkr�td�|f��n|r�|dSdSdS)Nrsrz%r: too many data types: %rr)	r�rxr�rrvrJr^rr!)rS�
data_typesr��	candidater��r�rr�_find_data_types*




z.EnumMeta._get_mixins_.<locals>._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rxrr�r!rt)r�rSr�rVrUrr�rrPs
zEnumMeta._get_mixins_c	Cs�|�dd�}|dk	}|dkrpdD]H}||fD].}t||d�}|ddjtjtjhkr,|}q\q,|dk	r qpq tj}|tjkr�d}nd}|||fS)a
        Returns the __new__ to be used for creating the enum members.

        classdict: the class dictionary given to __new__
        member_type: the data type whose __new__ will be used by default
        first_enum: enumeration to check for an overriding __new__
        rsN)r}rsFT)r�rQrsrxr)	rZrUrVrsr�method�possible�targetr�rrrrpCs*�
zEnumMeta._find_new_)N)N)r*r'r+r,�classmethodrWrsr�r�r�r�r�r�r�r�r��propertyr�rkr�r�r�r�r��staticmethodrOrPrprNrrr7rr�s8

%
	
5
!
	
.c@steZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
edd��Zedd��ZdS)rzV
    Generic enumeration.

    Derive from this class to define new enumerations.
    c
Cst|�|kr|Sz|j|WStk
r0Yn:tk
rh|j��D]}|j|krH|YSqHYnXzd}|�|�}Wn*tk
r�}z|}d}W5d}~XYnXzdt	||�r�|W�TSt
d||jf�}|dkr�|dkr�|�n|dk�rtd|j|f�}||_|�W5d}d}XdS)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)
r�rwr�r!ru�valuesrjr<�	ExceptionrDrBr*�__context__)r(r.r�r��result�e�ve_excrrrrsws@


��zEnum.__new__c	Cs6t|�D](}z|dWStk
r.YqXq|S)��
        Generate the next value when not given.

        name: the name of the member
        start: the initial start value or None
        count: the number of existing members
        last_value: the last value assigned or None
        rN)r�r!)rr�r�r��
last_valuerrrr;�s	zEnum._generate_next_value_cCsdSrfr)r(r.rrrr<�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r8r*r{rjr6rrrrk�s
�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r8r*r{r6rrrrl�szEnum.__str__cs6�fdd��j��D�dd��jD�}dddg|S)z<
        Returns all members and all public methods
        cs2g|]*}|jD]}|ddkr|�jkr|�qqS�rr)r^ru)rXr(rhr6rrr��s
�z Enum.__dir__.<locals>.<listcomp>cSsg|]}|ddkr|�qSr�rrgrrrr��sr8r,r')r8r\r^)r#�added_behaviorrr6rr��s
��zEnum.__dir__cCsJt|�jtjtjfk}|jtks$|r2t}t|�}n|j}|j}|�||�S)z\
        Returns format using actual value type unless __str__ has been overridden.
        )	r�rlrrrvrxrErjrm)r#�format_spec�str_overriddenr(�valrrrrm�s	
zEnum.__format__cCs
t|j�Srf)�hashr{r6rrr�__hash__�sz
Enum.__hash__cCs|j|jffSrf�r8rjr"rrrr&�szEnum.__reduce_ex__cCs|jS)zThe name of the Enum member.)r{r6rrrr�sz	Enum.namecCs|jS)zThe value of the Enum member.�rjr6rrrr.�sz
Enum.valueN)r*r'r+r,rsr;r�r<rkrlr�rmr�r&rrr.rrrrrqs-


)�	metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r*r'r+r,rrrrr�scCs|jSrfrr"rrrr��sr�c@speZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz
    Support for flags
    c	Csd|s|dk	r|SdSt|�D]:}zt|�}WqXWqtk
rTtd|�d�YqXqd|dS)r�NrzInvalid Flag value: %rr)r��	_high_bitr�r!)rr�r�r�r��high_bitrrrr;s	
zFlag._generate_next_value_cCs.|}|dkr|}|�|�}|dkr*|}|S)�V
        Returns member (possibly creating it) if one can be found for value.
        r)r:)r(r.�original_value�possible_memberrrrr<s
zFlag._missing_cCsb|j�|d�}|dkr^t||�\}}|r:td||jf��t�|�}d|_||_|j�	||�}|S)�L
        Create a composite member iff value contains only members.
        Nr�)
rwr��
_decomposerBr*rxrsr{rjrn)r(r.�
pseudo_memberr�extra_flagsrrrr:#s
zFlag._create_pseudo_member_cCs8t||j�s&tdt|�j|jjf��|j|j@|jkS)zP
        Returns True if self has at least the same flags set as other.
        r�)rDr8r!r�r+rj�r#�otherrrrr�7s��zFlag.__contains__cCsV|j}|jdk	r$d|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cSsg|]}t|jp|j��qSr�rEr{rjrgrrrr�Hsz!Flag.__repr__.<locals>.<listcomp>)r8r{r*rjr�rr�r#r(r��	uncoveredrrrrkAs
�z
Flag.__repr__cCs�|j}|jdk	r d|j|jfSt||j�\}}t|�dkr^|djdkr^d|j|djfSd|jd�dd�|D��fSdS)Nr�rrz%s.%rr�cSsg|]}t|jp|j��qSrr�rgrrrr�Vsz Flag.__str__.<locals>.<listcomp>)r8r{r*r�rjrrrr�rrrrlLs
�zFlag.__str__cCs
t|j�Srf)�boolrjr6rrrr�Ysz
Flag.__bool__cCs"t||j�stS|�|j|jB�Srf�rDr8�NotImplementedrjr�rrr�__or__\szFlag.__or__cCs"t||j�stS|�|j|j@�Srfrr�rrr�__and__aszFlag.__and__cCs"t||j�stS|�|j|jA�Srfrr�rrr�__xor__fszFlag.__xor__cCsNt|j|j�\}}|�d�}|jD] }||kr"|j|j@s"||B}q"|�|�Sr�)r�r8rj)r#r�r�invertedrhrrr�
__invert__ks


zFlag.__invert__N)r*r'r+r,r;r�r<r:r�rkrlr�rrrrrrrrr�s



c@sTeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	eZ
eZe	Zdd
�Z
dS)rz)
    Support for integer-based Flags
    cCs*t|t�std||jf��|�|�}|S)r�r�)rD�intrBr*r:)r(r.�
new_memberrrrr<ys

zIntFlag._missing_cCs�|j�|d�}|dkr�|g}t||�\}}|rtt|�}d|}||jkrZ||krZ|�|�||krjd}q*||N}q*t|�D]*}t�||�}d|_||_	|j�
||�}q||S)r�Nrr)rwr�r�r�rJr�r	rsr{rjrn)r(r.r��need_to_createrr��bit�
flag_valuerrrr:�s(
�


zIntFlag._create_pseudo_member_cCs0t||jtf�stS|�|j|�|�jB�}|Srf�rDr8r	rrj)r#r�r�rrrr�szIntFlag.__or__cCs,t||jtf�stS|�|j|�|�j@�Srfrr�rrrr�szIntFlag.__and__cCs,t||jtf�stS|�|j|�|�jA�Srfrr�rrrr�szIntFlag.__xor__cCs|�|j�}|Srfr�)r#r�rrrr�szIntFlag.__invert__N)r*r'r+r,r�r<r:rrr�__ror__�__rand__�__rxor__rrrrrrts
	
 cCs|��dS)zJ
    returns index of highest bit, or -1 if value is zero or negative
    r)�
bit_length�r.rrrr��sr�cCs^g}|j��D]"\}}||jkr|�||jf�q|rZd�dd�|D��}td||f��|S)zI
    Class decorator for enumerations ensuring unique member values.
    z, cSsg|]\}}d||f�qS)z%s -> %sr)rX�aliasrrrrr��szunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�r_rrJrrrB)�enumeration�
duplicatesrr��
alias_detailsrrrr
�s
��cCs�|}|dk}|r*dd�t|j���D�}ndd�t|j���D�}g}|D],\}}|rJ||@|krJ|�|�||M}qJ|s�||jkr�|�|j|�|jdd�dd�t|�d	kr�|dj|kr�|�d�||fS)
z-
    Extract all members from the value.
    rcSs"g|]\}}|jdk	r||f�qSrfr�rXrarhrrrr��s
�z_decompose.<locals>.<listcomp>cSs*g|]"\}}|jdk	st|�r||f�qSrf)r�
_power_of_tworrrrr��s
�cSs|jSrfr�)rhrrrr��r�z_decompose.<locals>.<lambda>T)rL�reverser)rHrwr_rJr�rr.ro)�flagr.�not_covered�negative�flags_to_checkr�r�r�rrrr��s(��

r�cCs|dkrdS|dt|�kS)NrFr)r�rrrrr�sr)r��typesrr�__all__rrr r)rxr-r	�dictr/rr�rr	rr�rrr�r
r�rrrrr�<module>s>�
	LivI%webbrowser.cpython-38.opt-2.pyc000064400000034527151450073350012333 0ustar00U

e5d^�@s�ddlZddlZddlZddlZddlZddlZddddddgZGdd�de�Ze�	�Z
iZdada
d;d	d
�dd�Zd<dd�Zd=dd�Zdd�Zdd�Zd	d
�dd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZeZGd#d$�d$e�ZGd%d&�d&e�ZGd'd(�d(e�Z Gd)d*�d*e�Z!d+d,�Z"d-d.�Z#ej$dd/�d0k�r�Gd1d2�d2e�Z%ej$d3k�r�Gd4d5�d5e�Z&Gd6d7�d7e�Z'd8d9�Z(e)d:k�r�e(�dS)>�N�Error�open�open_new�open_new_tab�get�registerc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�"/usr/lib64/python3.8/webbrowser.pyrsF��	preferredc	CsZt�Ltdkrt�||gt|��<|s4trB|tkrBt�d|�n
t�|�W5QRXdS)Nr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancerrrrrsc	Cs�tdkr&t�tdkrt�W5QRX|dk	r6|g}nt}|D]�}d|kr�t�|�}|ddkrtt|dd��St|�Sq>zt|��}Wnt	k
r�t
|�}YnX|ddk	r�|dS|ddk	r>|d�Sq>td��dS)N�%s����&�rz!could not locate runnable browser)rrr�shlex�split�BackgroundBrowser�GenericBrowserrr�KeyError�_synthesizer)ZusingZalternatives�browser�commandrrrr%s,
Tc	CsPtdkr&t�tdkrt�W5QRXtD] }t|�}|�|||�r*dSq*dS)NTF)rrrrr)�url�new�	autoraiserr$rrrrGs	cCs
t|d�S�Nr�r�r&rrrrZscCs
t|d�S�N�r*r+rrrrascCs�|��d}t�|�sddgStj�|�}zt|��}Wntk
rVddgYSX|d}|r�|��|jkr�ddl	}|�	|�}||_
tj�|�|_t|d||d�d|gSddgS)Nrr)rr)r�shutil�which�os�path�basenamerrr"�copyrr)r$r�cmdrr%Z
controllerr3rrrr#is"

r#c@s6eZdZdgZddd�Zddd�Zd	d
�Zdd�Zd
S)�BaseBrowserr�cCs||_||_dS�N)rr2��selfrrrr�__init__�szBaseBrowser.__init__rTcCst�dSr7)�NotImplementedError�r9r&r'r(rrrr�szBaseBrowser.opencCs|�|d�Sr)r*�r9r&rrrr�szBaseBrowser.open_newcCs|�|d�Sr,r*r=rrrr�szBaseBrowser.open_new_tabN)r6)rT)rr	r
�argsr:rrrrrrrr5�s


r5c@seZdZdd�Zddd�ZdS)	r!cCsFt|t�r||_dg|_n|d|_|dd�|_tj�|j�|_dS)Nrrr)�
isinstance�strrr>r0r1r2r8rrrr:�s


zGenericBrowser.__init__rTcs|t�d��|jg�fdd�|jD�}z8tjdd�dkrHt�|�}ntj|dd�}|��WStk
rvYdSXdS)	N�webbrowser.opencsg|]}|�d���qS�r��replace��.0�argr+rr�
<listcomp>�s�z'GenericBrowser.open.<locals>.<listcomp>��winT)�	close_fdsF)	�sys�auditrr>�platform�
subprocess�Popen�wait�OSError�r9r&r'r(�cmdline�prr+rr�s�zGenericBrowser.openN)rT�rr	r
r:rrrrrr!�s
r!c@seZdZddd�ZdS)r rTcs�|jg�fdd�|jD�}t�d��z<tjdd�dkrHt�|�}ntj|ddd�}|��dkWStk
rzYdSXdS)	Ncsg|]}|�d���qSrBrCrEr+rrrH�s�z*BackgroundBrowser.open.<locals>.<listcomp>rArIrJT)rK�start_new_sessionF)	rr>rLrMrNrOrP�pollrRrSrr+rr�s��zBackgroundBrowser.openN)rT�rr	r
rrrrrr �sr c@s@eZdZdZdZdZddgZdZdZdZ	ddd�Z
dd	d
�ZdS)
�UnixBrowserNFT�%actionrcCs�g}|r*|jr*t|�}|j|}|r*|g}|jg||}|sD|jrLtj}nd}tj|d||jrd|pfd|dd�}	|r�z|	�d�}
|
WStj	k
r�YdSXn&|jr�|	�
�dkr�dSdSn
|	��SdS)NT�rK�stdin�stdout�stderrrW�F)�
raise_opts�intr�
backgroundrO�DEVNULLrP�redirect_stdoutrQZTimeoutExpiredrX)r9r>Zremoter(r&Z	raise_opt�optrTZinoutrU�rcrrr�_invoke�s4



�

zUnixBrowser._invokercs�t�d��|dkr|j�nB|dkr,|j�n2|dkrN|jdkrF|j�q^|j�ntdd|����fdd�|jD�}d	d�|D�}|�|d
|��}|s��fdd�|jD�}|�|dd�Sd
SdS)
NrArrr-zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %scs g|]}|�d���d���qS)rr[rCrE��actionr&rrrHs�z$UnixBrowser.open.<locals>.<listcomp>cSsg|]}|r|�qSrrrErrrrHsTcsg|]}|�d���qSrBrCrEr+rrrHsF)	rLrM�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsrhr>)r9r&r'r(r>Zsuccessrrirrs*
��zUnixBrowser.open)N)rT)rr	r
rarcrernrkrlrmrhrrrrrrZ�s
#rZc@s$eZdZddgZdZdZdZdZdS)�Mozillar[rr6z-new-windowz-new-tabTN�rr	r
rnrkrlrmrcrrrrros
roc@s,eZdZddgZddgZdZdZdZdZd	S)
�Netscape�-noraisez-raise�-remote�openURL(%s%action)r6�,new-window�,new-tabTN)	rr	r
rarnrkrlrmrcrrrrrq&srqc@s(eZdZddgZddgZdZdZdZdS)	�Galeonrrr6r[r�-nz-wTN)rr	r
rarnrkrlrcrrrrrw1s
rwc@s$eZdZddgZdZdZdZdZdS)�Chromer[rr6�--new-windowTNrprrrrry;s
ryc@s$eZdZddgZdZdZdZdZdS)�Operar[rr6rzTNrprrrrr{Gs
r{c@s(eZdZddgZdZdZdZdZdZdS)�Elinksrsrtr6rurvFN)	rr	r
rnrkrlrmrcrerrrrr|Qsr|c@seZdZddd�ZdS)�	KonquerorrTcCs�t�d|�|dkrd}nd}tj}ztjd||gd|||d�}Wntk
rVYnX|��dSz tjdd	|gd|||dd
�}Wntk
r�YnX|��dkr�dSz tjdd|gd|||dd
�}Wntk
r�Yd
SX|��dkSdS)NrAr-ZnewTabZopenURL�	kfmclientT)rKr]r^r_�	konquerorz--silentr\�kfmz-dF)rLrMrOrdrPrRrQrX)r9r&r'r(rj�devnullrUrrrrfsN�
�
�
zKonqueror.openN)rTrYrrrrr}_sr}c@s&eZdZdd�Zdd�Zd
dd�Zd	S)�GrailcCs�ddl}ddl}ddl}ddl}tj�|��d�}|�t�	��d}tj�|�
|�|�
|�d�}|�|�}|stdS|�|j|j�}	|D]T}
z|	�
|
�Wn8tk
r�zt�|
�Wntk
r�YnXYq�X|	Sq�dS)Nrz.grail-unixz-*)�glob�pwd�socket�tempfiler0r1�joinZ
gettempdir�getpwuid�getuid�escapeZAF_UNIXZSOCK_STREAMZconnectrR�unlink)r9r�r�r�r�Ztempdir�user�filenameZmaybes�s�fnrrr�_find_grail_rc�s,�
zGrail._find_grail_rccCs&|��}|sdS|�|�|��dS)Nrr)r��send�close)r9rjr�rrr�_remote�s
z
Grail._remoterTcCs2t�d|�|r |�d|�}n|�d|�}|S)NrAzLOADNEW zLOAD )rLrMr�)r9r&r'r(�okrrrr�s
z
Grail.openN)rT)rr	r
r�r�rrrrrr��sr�cCs�t�d�rtddtd��dtjkr>t�d�r>tddtd��dtjkrbt�d�rbtddtd��dtjkr�t�d�r�tdttd��t�d�r�tddtd��dD]}t�|�r�t|dt|��q�d	D]}t�|�r�t|dt|��q�t�d
��rtd
ttd
��nt�d��r"tdttd��dD]"}t�|��r&t|dt	|���q&t�d
��rftd
dtd
��dD]"}t�|��rjt|dt
|���qjt�d��r�tddtd��t�d��r�tddtd��t�d��r�tdtd�dS)Nzxdg-openZGNOME_DESKTOP_SESSION_IDz	gvfs-openz
gnome-openZKDE_FULL_SESSIONr~z
x-www-browser)�firefoxZ	iceweaselZiceape�	seamonkey)zmozilla-firefoxzmozilla-firebird�firebird�mozilla�netscaper�r)ZgaleonZepiphanyZ	skipstone)z
google-chrome�chromeZchromiumzchromium-browser�operaZmosaicZgrail)
r.r/rr r0�environr}rorqrwryr{r�)r$rrr�register_X_browsers�sD



r�cCs.gatjdkrNtddtd��tddtd��tddtd��tddtd��tjdd�dkr�td	t�tj�tj	�
d
d�d�}dd
dddd|fD]}t�|�r�t|dt
|��q��ntj	�
d�s�tj	�
d��r&z(d��}tj|tjd�}|����}Wn ttjttfk
�rYnX|at�tj	�
d��r�t�d��rPtddtd��t�d��rltddtd��t�d��r�tddtd��t�d��r�tddtd��t�d��r�tddtd��dtj	k�r*tj	d�tj�}|��|D]>}|dk�r�t|dd�}|d dk�r�t|dt|�dd��q�dS)!N�darwin�MacOSX�defaultr�r�ZsafarirIrJzwindows-defaultZPROGRAMFILESzC:\Program FileszInternet Explorer\IEXPLORE.EXEr�r�r�r�r�ZDISPLAYZWAYLAND_DISPLAYz$xdg-settings get default-web-browser)r_ZTERMzwww-browserZlinksZelinksZlynxZw3mZBROWSERr6Tr
r)rrLrNr�MacOSXOSAScript�WindowsDefaultr0r1r�r�rr.r/r rrOZcheck_outputrd�decode�strip�FileNotFoundErrorZCalledProcessError�PermissionError�NotADirectoryErrorrr�r!r|�pathsep�reverser#)Ziexplorer$r4Z
raw_result�resultZuserchoicesrTrrrrs\

��

rrIrJc@seZdZddd�ZdS)r�rTcCs:t�d|�zt�|�Wntk
r0YdSXdSdS)NrAFT)rLrMr0Z	startfilerRr<rrrrXszWindowsDefault.openN)rTrYrrrrr�Wsr�r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr7)rr8rrrr:sszMacOSX.__init__rTc	Cs�t�d|�d|krd|}tt|��}|jdkrDd|�dd�}n<|jdkrTd	}nd
|d}d|�dd�}d
|j||f}t�dd�}|dkr�dS|�|�|�	�}|S)NrA�:zfile:r��open location "%s"�"�%22ZOmniWebr6ztoWindow %drzOpenURL "%s"z�tell application "%s"
                                activate
                                %s %s
                            end tell�	osascript�wF)
rLrMrb�boolrrDr0�popen�writer�)	r9r&r'r(�scriptZtoWindowr4�osapipergrrrrvs&


�
zMacOSX.openN)rTrVrrrrr�is
r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr7)�_namer8rrrr:�szMacOSXOSAScript.__init__rTcCsb|jdkrd|�dd�}nd|j|�dd�f}t�dd�}|dkrJdS|�|�|��}|S)	Nr�r�r�r�z�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   r�r�F)r�rDr0r�r�r�)r9r&r'r(r�r�rgrrrr�s
�
zMacOSXOSAScript.openN)rTrVrrrrr��sr�c	
Cs�ddl}dtjd}z|�tjdd�d�\}}WnJ|jk
r~}z*t|tjd�t|tjd�t�d�W5d}~XYnXd}|D]"\}}|dkr�d}q�|dkr�d}q�t|�dkr�t|tjd�t�d�|d}t||�td	�dS)
NrzDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabrZntd)�filerxz-tr-�)	�getoptrL�argv�error�printr_�exit�lenr)	r�ZusageZoptsr>�msgZnew_win�o�ar&rrr�main�s,�

r��__main__)N)N)rT)*r0rr.rLrOZ	threading�__all__�	Exceptionr�RLockrrrrrrrrrr#�objectr5r!r rZrorqrwryZChromiumr{r|r}r�r�rrNr�r�r�r�rrrrr�<module>sP
"
"O

	
56AK/
signal.cpython-38.opt-1.pyc000064400000005435151450073350011422 0ustar00U

e5d��@s&ddlZddlTddlmZddlmZe�Ze�	de
dd��e�	de
d	d��d
ekrle�	de
dd��d
d�Zdd�Zeej
�dd��Z
eej�dd��Zd
ekr�eej�dd
��Zejje_dekr�eej�dd��Zdek�reej�dd��Zeje_dek�reej�dd��Z[[dS)�N)�*)�wraps)�IntEnum�SignalscCs(|��r|�d�r|�d�p&|�d�S)NZSIGZSIG_ZCTRL_)�isupper�
startswith��name�r
�/usr/lib64/python3.8/signal.py�<lambda>
s�r�HandlerscCs|dkS)N)�SIG_DFL�SIG_IGNr
rr
r
rr��pthread_sigmaskZSigmaskscCs|dkS)N)�	SIG_BLOCK�SIG_UNBLOCK�SIG_SETMASKr
rr
r
rrrcCs(z
||�WStk
r"|YSXdS)zsConvert a numeric value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassr
r
r�_int_to_enums
rc	Cs,z
t|�WSttfk
r&|YSXdS)zmConvert an IntEnum member to a numeric value.
    If it's not an IntEnum member return the value itself.
    N)�intr�	TypeError)rr
r
r�_enum_to_int#s
rcCst�t|�t|��}t|t�S�N)�_signal�signalrrr
�Z	signalnumZhandlerr
r
rr-srcCst�|�}t|t�Sr)r�	getsignalrr
rr
r
rr3s
rcCst�||�}tdd�|D��S)Ncss|]}t|t�VqdSr�rr��.0�xr
r
r�	<genexpr>=sz"pthread_sigmask.<locals>.<genexpr>)rr�set)Zhow�maskZsigs_setr
r
rr:s�
sigpendingcCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
r�	<setcomp>Dszsigpending.<locals>.<setcomp>)rr'r
r
r
rr'Bs�sigwaitcCst�|�}t|t�Sr)rr)rr)ZsigsetZretsigr
r
rr)Hs
�
valid_signalscCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
rr(Rsz valid_signals.<locals>.<setcomp>)rr*r
r
r
rr*Ps)r�	functoolsrZ_wraps�enumrZ_IntEnum�globalsZ_globals�	_convert_�__name__rrrrr�__doc__r'r)r*r
r
r
r�<module>sR���










pkgutil.cpython-38.opt-2.pyc000064400000025512151450073350011623 0ustar00U

e5d�S�@stddlmZddlmZddlZddlZddlZddlZddl	Zddl
Z
ddlmZddl
Z
ddddd	d
ddd
dddgZedd�Zde_dd�Zdd�Zd*dd	�Zd+dd
�Zed,dd��Zd-dd�Ze�ejje�dd�ZGdd�d�ZGd d
�d
�Zz.ddlZdd!lmZd.d"d#�Ze�ee�Wne k
�r<YnXd$d�Z!d/d%d�Z"d&d�Z#d'd�Z$d(d�Z%d)d�Z&dS)0�)�
namedtuple)�singledispatchN)�
ModuleType�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsRz
|j}Wn:tk
rD|�|�}|dkr2YdStj�||�YSX||�SdS�N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�/usr/lib64/python3.8/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr �magicrrrr(s

�c	#s�ifdd��t||�D]�}|V|jrzt|j�WnNtk
rZ|dk	rV||j�Yqtk
r�|dk	r|||j�n�YqXttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqdS)NcSs||krdSd||<dS)NTr)�p�mrrr�seenRszwalk_packages.<locals>.seen�__path__csg|]}�|�s|�qSrr)�.0r'�r)rr�
<listcomp>isz!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�inforr,rr	5s ccsr|dkrt�}nt|t�r$td��n
tt|�}i}|D]6}t||�D]&\}}||krDd||<t|||�VqDq6dS)Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r6r7Z	importers�yielded�irr/rrrr
ns



cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr7rrrr?�s
r?c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dS�Nr�__init__Fr.Tr:�	r6�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rCr7r@rI�	filenames�fn�modnamer6r/�dircontents�subnamerrr�_iter_file_finder_modules�s<



rTc	Cs.t���t�dt�t�d�aW5QRXdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerVrrrr�_import_imp�s
r\c@s*eZdZd	dd�Zd
dd�Zddd�ZdS)rNcCst�dt�t�||_dS�Nz5This emulation is deprecated, use 'importlib' instead)rW�warnrZr\r6)�selfr6rrrrE�s
�zImpImporter.__init__cCs�|�d�d}||kr$|jdkr$dS|jdkr4d}ntj�|j�g}zt�||�\}}}Wntk
rpYdSXt||||�S)Nr.���)�splitr6rG�realpathrVrr1r
)r_�fullnamer6rS�file�filename�etcrrrr�s
zImpImporter.find_moduler&c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dSrDrF)r_r7r@rIrOrPrQr6r/rRrSrrrr
�s<



zImpImporter.iter_modules)N)N)r&)�__name__�
__module__�__qualname__rErr
rrrrr�s

c@sjeZdZdZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
ddd�ZdS)r
NcCs.t�dt�t�||_||_||_||_dSr])rWr^rZr\rdrercrf)r_rcrdrerfrrrrEs�zImpLoader.__init__cCs:|��zt�||j|j|j�}W5|jr4|j��X|Sr)�_reopenrd�closerV�load_modulererf)r_rc�modrrrrlszImpLoader.load_modulec
Cs*t|d��}|��W5QR�SQRXdS)N�rb)�openr!)r_�pathnamerdrrrr%szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfkrPt|jd�|_dS)N��rrn)	rd�closedrfrV�	PY_SOURCErore�PY_COMPILED�C_EXTENSION)r_�mod_typerrrrj)s

zImpLoader._reopencCs0|dkr|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)rcr1�r_rcrrr�	_fix_name1s
�zImpLoader._fix_namecCs|�|�}|jdtjkS�Nrq)ryrfrV�
PKG_DIRECTORYrxrrr�
is_package9s
zImpLoader.is_packagecCs�|�|�}|jdkr�|jd}|tjkrD|�|�}t||jd�|_nJ|tjkrv|�	�zt|j
�|_W5|j
��Xn|tj
kr�|����|_|jS)Nrq�exec)ry�coderfrVrt�
get_source�compilererurjrdrkrr{�
_get_delegate�get_code)r_rcrw�sourcerrrr�=s






zImpLoader.get_codec	Cs�|�|�}|jdkr�|jd}|tjkrP|��z|j��|_W5|j��Xnd|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_W5QRXn|tjkr�|����|_|jS)Nrqr`rr)ryr�rfrVrtrjrdrkr!rurGr6�existsreror{r�r)r_rcrw�frrrrNs





zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrE)rrerr)r_r�specrrrr�`s

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfkrD|j	SdSrz)
ryrfrVr{r��get_filenamertrurvre)r_rcrwrrrr�es


zImpLoader.get_filename)N)N)N)rgrhrir~r�rErlrrjryr|r�rr�r�rrrrr
s	

)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}|D]�}|�|�s>q.||d��t	j
�}t|�dkr�|d�d�r�|d|kr�d||d<||ddfVt|�dkr�q.|�|d�}|dkr�q.|r.d|kr.||kr.d||<||dfVq.dS)	Nrrqr:z__init__.pyTrEr.F)�sorted�	zipimport�_zip_directory_cache�archiver7�lenrI�
startswithrarG�seprM)	rCr7Zdirlist�_prefixZplenr@rIrPrQrrr�iter_zipimport_modulesss*
r�cCsxt�|�}ztj|}WnZtk
rrtjD]:}z ||�}tj�||�WqnWq.tk
rfYq.Xq.d}YnX|Sr)rG�fsdecoder4�path_importer_cache�KeyError�
path_hooks�
setdefaultr1)Z	path_itemrC�	path_hookrrrr�s	



ccs�|�d�rd�|�}t|��d|krV|�d�d}t�|�}t|dd�}|dkrhdSntjEdHtj	}|D]}t
|�VqldS)Nr.�'Relative module name {!r} not supportedrr*)r��formatr1�
rpartitionrr[r3r4�	meta_pathr6r)rc�msgZpkg_nameZpkgr6�itemrrrr�s


cCsn|tjkr tj|}|dkr dSt|t�rb|}t|dd�}|dk	rF|St|dd�dkrZdS|j}n|}t|�S)N�
__loader__�__spec__)r4r5r;rr3rgr)Zmodule_or_name�modulerrcrrrr�s


cCs�|�d�rd�|�}t|��ztj�|�}WnFttttfk
rr}z d}t|�|t	|�|��|�W5d}~XYnX|dk	r�|j
SdS)Nr.r�z,Error while finding loader for {!r} ({}: {}))r�r�r1rrrr�	TypeErrorr=�typer)rcr�r�Zexrrrr�s

*cCs�t|t�s|S|d}|dd�}|�d�\}}}|rfztj|j}Wqlttfk
rb|YSXntj}|D�]&}t|t	�s�qpt
|�}|dk	r�g}	t|d�r�|�|�}
|
dk	r�|
j
p�g}	nt|d�r�|�|�\}}	|	D]}||kr�|�|�q�tj�||�}tj�|�rpzt|�}
Wn8tk
�rP}ztj�d||f�W5d}~XYqpX|
�<|
D]0}|�d�}|�r\|�d��r��q\|�|��q\W5QRXqp|S)Nz.pkgr.rrzCan't open %s: %s
�
�#)r;�listr�r4r5r*r�rr6r<rrBr�submodule_search_locationsr�appendrGrN�isfilerorK�stderr�write�rstripr�)r6rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsr�ZportionZpkgfiler�r��linerrrr�sR!





�
cCs�tj�|�}|dkrdS|j}|dks0t|d�s4dStj�|�pJtj�	|�}|dks^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)Nr�__file__�/r)rrrrrBr4r5�get�
_bootstrap�_loadra�insertrGr6�dirnamer�rNr)�package�resourcer�rrm�partsZ
resource_namerrrrVs
�
)Nr&N)Nr&)r&)r&)r&)r&)'�collectionsr�	functoolsrZ
simplegenericr�importlib.util�importlib.machineryrGZos.pathr4�typesrrW�__all__r�__doc__rrr	r
r?rT�register�	machinery�
FileFinderr\rr
r�r�r�r1rrrrrrrrrr�<module>sf�

9

(�Jc

^copy.cpython-38.opt-1.pyc000064400000015515151450073350011117 0ustar00U

e5d�!�@sTdZddlZddlZddlmZGdd�de�ZeZzddlm	Z	Wne
k
r\dZ	YnXdddgZd	d�ZiZ
Zd
d�Zed�eeeeeeeeeeeeejee�ee�ejej fD]Z!eee!<q�e"edd�Z!e!dk	r�eee!<e#jee#<e$jee$<e%jee%<e&jee&<e	dk	�r e	jee	<[[!dgfd
d�Z'iZ(Zdd�Z)e)eed�<e)eee�<e)eee�<e)ee<e)ee<e)ee<e)ee<e)ee<e)ee<e)eej*<e)ee<e)eej<e)eej<e)eej <e)ee<e'fdd�Z+e+ee#<e'fdd�Z,e,ee<e'fdd�Z-e-ee$<e	dk	�re-ee	<dd�Z.e.eej/<[dd�Z0ddde'fdd�Z1[[[	dS)a�Generic (shallow and deep) copying operations.

Interface summary:

        import copy

        x = copy.copy(y)        # make a shallow copy of y
        x = copy.deepcopy(y)    # make a deep copy of y

For module specific errors, copy.Error is raised.

The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).

- A shallow copy constructs a new compound object and then (to the
  extent possible) inserts *the same objects* into it that the
  original contains.

- A deep copy constructs a new compound object and then, recursively,
  inserts *copies* into it of the objects found in the original.

Two problems often exist with deep copy operations that don't exist
with shallow copy operations:

 a) recursive objects (compound objects that, directly or indirectly,
    contain a reference to themselves) may cause a recursive loop

 b) because deep copy copies *everything* it may copy too much, e.g.
    administrative data structures that should be shared even between
    copies

Python's deep copy operation avoids these problems by:

 a) keeping a table of objects already copied during the current
    copying pass

 b) letting user-defined classes override the copying operation or the
    set of components copied

This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor array, nor
any similar types.

Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called __getinitargs__(),
__getstate__() and __setstate__().  See the documentation for module
"pickle" for information on these methods.
�N)�dispatch_tablec@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/copy.pyr7sr)�PyStringMap�copy�deepcopycCs�t|�}t�|�}|r||�St|t�r0t|�St|dd�}|dk	rL||�St�|�}|dk	rh||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t|t	�r�|St
|df|��S)zlShallow copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    �__copy__N�
__reduce_ex__��
__reduce__z%un(shallow)copyable object of type %s)�type�_copy_dispatch�get�
issubclass�_copy_immutable�getattrrr�
isinstance�str�_reconstruct)�x�cls�copier�reductor�rvrrrr
Bs,





cCs|S�Nr)rrrrrksr�CodeTypec	Cs |dkri}t|�}|�||�}||k	r,|St|�}t�|�}|dk	rR|||�}n�t|t�rht||�}n�t|dd�}|dk	r�||�}nzt�|�}|r�||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t	|t
�r�|}nt||f|��}||k	�r|||<t||�|S)ziDeep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    N�__deepcopy__r
rrz"un(deep)copyable object of type %s)
�idrr�_deepcopy_dispatchr�_deepcopy_atomicrrrrrr�_keep_alive)	r�memoZ_nil�d�yrrrrrrrr�sD





�


cCs|Srr�rr%rrrr#�sr#cCs2g}||t|�<|j}|D]}||||��q|Sr)r!�append)rr%rr'r)�arrr�_deepcopy_list�sr+csh��fdd�|D�}z�t|�WStk
r6YnXt||�D]\}}||k	rBt|�}qdqB|}|S)Ncsg|]}�|���qSrr)�.0r*�rr%rr�
<listcomp>�sz#_deepcopy_tuple.<locals>.<listcomp>)r!�KeyError�zip�tuple)rr%rr'�k�jrr-r�_deepcopy_tuple�sr4cCs:i}||t|�<|��D]\}}|||�||||�<q|Sr)r!�items)rr%rr'�key�valuerrr�_deepcopy_dict�s
r8cCst|�|jt|j|��Sr)r�__func__r�__self__r(rrr�_deepcopy_method�sr;cCs>z|t|��|�Wn"tk
r8|g|t|�<YnXdS)aMKeeps a reference to the object x in the memo.

    Because we remember objects by their id, we have
    to assure that possibly temporary objects are kept
    alive by referencing them.
    We store a reference at the id of the memo, which should
    normally not be used unless someone tries to deepcopy
    the memo itself...
    N)r!r)r/r(rrrr$�s
r$csb�dk	}|r$|r$��fdd�|D�}||�}	|r<|	�t|�<|dk	r�|rR�|��}t|	d�rh|	�|�n^t|t�r�t|�dkr�|\}}
nd}
|dk	r�|	j�|�|
dk	r�|
��D]\}}t	|	||�q�|dk	�r|r�|D]}
�|
��}
|	�
|
�q�n|D]}
|	�
|
�q�|dk	�r^|�rF|D]&\}}�|��}�|��}||	|<�qn|D]\}}||	|<�qJ|	S)Nc3s|]}�|��VqdSrr)r,�argr-rr�	<genexpr>sz_reconstruct.<locals>.<genexpr>�__setstate__�)r!�hasattrr>rr1�len�__dict__�updater5�setattrr))rr%�func�args�stateZlistiterZdictiterrZdeepr'Z	slotstater6r7�itemrr-rrsF







r)2�__doc__�types�weakref�copyregr�	Exceptionr�errorZorg.python.corer	�ImportError�__all__r
rr&rr�int�float�bool�complexrr1�bytes�	frozenset�range�slice�property�BuiltinFunctionType�Ellipsis�NotImplemented�FunctionType�ref�tr�list�dict�set�	bytearrayrr"r#rr+r4r8r;�
MethodTyper$rrrrr�<module>s�2

'�






4





�
-crypt.cpython-38.opt-2.pyc000064400000005247151450073350011310 0ustar00U

e5d�@s,ddlZzddlZWn0ek
rDejdkr8ed��ned��YnXddlZddlm	Z
ddlmZ
ejejdZe
�ZGdd	�d	e
d	d
��Zd%dd�dd
�Zd&dd�ZgZdd�dd�Zedddd�edddd�dD](Zeddeddee�dd�r��qq�eddd d!�ed"dd#d$�[[dS)'�NZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuplez./c@seZdZdd�ZdS)�_MethodcCsd�|j�S)Nz<crypt.METHOD_{}>)�format�name)�self�r�/usr/lib64/python3.8/crypt.py�__repr__sz_Method.__repr__N)�__name__�
__module__�__qualname__r
rrrr	rsrz name ident salt_chars total_size��roundscCsB|dkrtd}|dk	r4t|t�s4t|jj�d���|js@d}nd|j�d�}|jr�|jddkr�|dkrpd}n@t�|d�}|d|>kr�td��d	|kr�d
ks�ntd��||d�d�7}n^|jd
k�r|dk	�r d|kr�dks�ntd��|d|�d�7}n|dk	�r t|�d���|d�	dd�t
|j�D��7}|S)Nrz+ object cannot be interpreted as an integer��$�2��zrounds must be a power of 2��z%rounds out of the range 2**4 to 2**31Z02d)�5�6i�i�ɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}t�t�VqdS�N)�_srZchoice�
_saltchars)�.0�charrrr	�	<genexpr>Aszmksalt.<locals>.<genexpr>)�methods�
isinstance�int�	TypeError�	__class__rZident�
bit_length�
ValueError�join�rangeZ
salt_chars)�methodr�sZ
log_roundsrrr	�mksalts2

r*cCs&|dkst|t�rt|�}t�||�Sr)r rr*�_crypt�crypt)Zword�saltrrr	r,Es
r,cGsVt|f|��}|t�d|<t||d�}td|�}|rRt|�|jkrRt�|�dSdS)NZMETHOD_rrTF)r�globalsr*r,�lenZ
total_sizer�append)rr�argsr(r-�resultrrr	�_add_methodWs

r3ZSHA512r��jZSHA256r�?)�b�y�arZBLOWFISHr��;ZMD5�1��"ZCRYPT��
)N)N)�sys�_sysr+�ModuleNotFoundError�platform�ImportError�stringZ_stringZrandomrZ
_SystemRandom�collectionsrZ_namedtupleZ
ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr	�<module>s0

	&

bz2.cpython-38.opt-1.pyc000064400000026267151450073350010650 0ustar00U

e5d1�@s�dZddddddgZdZdd	lmZdd
lZdd
lZdd
lZdd
l	Z	ddl
mZddlm
Z
mZdZd
ZdZe�ZGdd�de	j�Zddd�Zddd�Zdd�Zd
S)z�Interface to the libbzip2 compression library.

This module provides a file interface, classes for incremental
(de)compression, and functions for one-shot (de)compression.
�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>�)rN)�RLock)rr��c@s�eZdZdZdedfdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zd)dd�Z
d*dd�Zd+dd�Zdd�Zd,dd�Zd-dd�Zd d!�Zd"d#�Zejfd$d%�Zd&d'�Zd(S).ra@A file object providing transparent bzip2 (de)compression.

    A BZ2File can act as a wrapper for an existing file object, or refer
    directly to a named file on disk.

    Note that BZ2File provides a *binary* file interface - data read is
    returned as bytes, and data to be written should be given as bytes.
    �r�	cCsTt�|_d|_d|_t|_|tk	r2tjdt	dd�d|krFdksPnt
d��|d	krbd
}t}nb|dkr~d}t}t
|�|_nF|d
kr�d}t}t
|�|_n*|dkr�d}t}t
|�|_nt
d|f��t|tttjf�r�t||�|_d|_||_n.t|d��st|d��r||_||_ntd��|jtk�rJtj|jttd�}t�|�|_nd|_dS)aOOpen a bzip2-compressed file.

        If filename is a str, bytes, or PathLike object, it gives the
        name of the file to be opened. Otherwise, it should be a file
        object, which will be used to read or write the compressed data.

        mode can be 'r' for reading (default), 'w' for (over)writing,
        'x' for creating exclusively, or 'a' for appending. These can
        equivalently be given as 'rb', 'wb', 'xb', and 'ab'.

        buffering is ignored since Python 3.0. Its use is deprecated.

        If mode is 'w', 'x' or 'a', compresslevel can be a number between 1
        and 9 specifying the level of compression: 1 produces the least
        compression, and 9 (default) produces the most compression.

        If mode is 'r', the input file may be the concatenation of
        multiple compressed streams.
        NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.�)�
stacklevelr	rz%compresslevel must be between 1 and 9)�r�rbr)�w�wbr)�x�xbr)�a�abr�Invalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r�_lock�_fp�_closefp�_MODE_CLOSED�_mode�	_sentinel�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr�_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeError�_compressionZDecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode�	buffering�
compresslevelZ	mode_code�raw�r;�/usr/lib64/python3.8/bz2.py�__init__)sT��zBZ2File.__init__cCs�|j��|jtkr W5QR�dSz<|jtkr8|j��n"|jtkrZ|j�	|j
���d|_
W5z|jrp|j��W5d|_d|_t|_d|_XXW5QRXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)rrrrrr3�closer$r%rr&�flush�r5r;r;r<r>ps 



z
BZ2File.closecCs
|jtkS)zTrue if this file is closed.)rrr@r;r;r<�closed�szBZ2File.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor@r;r;r<rC�szBZ2File.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler@r;r;r<rE�szBZ2File.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)rBrr$r@r;r;r<rD�szBZ2File.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)rBrr%r@r;r;r<�writable�szBZ2File.writablerc
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        N)r�_check_can_readr3�peek)r5�nr;r;r<rH�szBZ2File.peek���c
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b'' if the file is already at EOF.
        N)rrGr3r�r5�sizer;r;r<r�szBZ2File.readc
Cs@|j�0|��|dkrtj}|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b'' if the file is at EOF.
        rN)rrGr1�DEFAULT_BUFFER_SIZEr3�read1rKr;r;r<rN�s
z
BZ2File.read1c
Cs2|j�"|��|j�|�W5QR�SQRXdS)zRRead bytes into b.

        Returns the number of bytes read (0 for EOF).
        N)rrGr3�readinto)r5�br;r;r<rO�szBZ2File.readintoc
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        �	__index__�Integer argument expectedN)	r'�intr-r.rQrrGr3�readlinerKr;r;r<rT�s

zBZ2File.readlinec
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)z�Read a list of lines of uncompressed bytes from the file.

        size can be specified to control the number of lines read: no
        further lines will be read once the total size of the lines read
        so far equals or exceeds size.
        rQrRN)	r'rSr-r.rQrrGr3�	readlinesrKr;r;r<rU�s

zBZ2File.readlinesc
CsX|j�H|��|j�|�}|j�|�|jt|�7_t|�W5QR�SQRXdS)z�Write a byte string to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        N)rZ_check_can_writer&rrrr4�len)r5�dataZ
compressedr;r;r<r�sz
BZ2File.writec
Cs,|j�tj�||�W5QR�SQRXdS)z�Write a sequence of byte strings to the file.

        Returns the number of uncompressed bytes written.
        seq can be any iterable yielding byte strings.

        Line separators are not added between the written byte strings.
        N)rr/�
BaseStream�
writelines)r5�seqr;r;r<rY�szBZ2File.writelinesc
Cs4|j�$|��|j�||�W5QR�SQRXdS)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Values for whence are:

            0: start of stream (default); offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        N)rZ_check_can_seekr3�seek)r5�offset�whencer;r;r<r[szBZ2File.seekc
CsL|j�<|��|jtkr0|j��W5QR�S|jW5QR�SQRXdS)z!Return the current file position.N)rrBrr$r3�tellr4r@r;r;r<r^s

zBZ2File.tellN)r)rJ)rJ)rJ)rJ)�__name__�
__module__�__qualname__�__doc__rr=r>�propertyrArCrErDrFrHrrNrOrTrUrrYr1�SEEK_SETr[r^r;r;r;r<rs&	G





	

rrcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|||d	�}d|kr�t�||||�S|SdS)
aOpen a bzip2-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str, bytes, or
    PathLike object), or an existing file object to read from or write
    to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or
    "ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode.
    The default mode is "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the BZ2File
    constructor: BZ2File(filename, mode, compresslevel). In this case,
    the encoding, errors and newline arguments must not be provided.

    For text mode, a BZ2File object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trPrNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r9)r#�replacerr1�
TextIOWrapper)r6r7r9�encoding�errors�newlineZbz_modeZbinary_filer;r;r<r!scCst|�}|�|�|��S)z�Compress a block of data.

    compresslevel, if given, must be a number between 1 and 9.

    For incremental compression, use a BZ2Compressor object instead.
    )rrr?)rWr9�compr;r;r<rJscCshg}|r^t�}z|�|�}Wn tk
r<|r6Yq^n�YnX|�|�|jsVtd��|j}qd�|�S)zjDecompress a block of data.

    For incremental decompression, use a BZ2Decompressor object instead.
    zACompressed data ended before the end-of-stream marker was reached�)rrr0�append�eofr#Zunused_data�join)rWZresultsZdecomp�resr;r;r<rUs
)rrNNN)r)rb�__all__�
__author__�builtinsrr,r1r*r r/Z	threadingrZ_bz2rrrr$r%�objectrrXrrrr;r;r;r<�<module>s6��
)
pydoc.cpython-38.pyc000064400000243037151450073350010326 0ustar00U

��.e̠�@s�dZdgZdZdZdZddlZddlZddlZddl	Zddl
ZddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd	lmZd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$e�%dej&�Z'dd�Z(dd�Z)dd�Z*dd �Z+dxd!d"�Z,d#d$�Z-d%d&�Z.d'd(�Z/d)d*�Z0ifd+d,�Z1Gd-d.�d.e2�Z3d/d0�Z4difd1d2�Z5Gd3d4�d4�Z6Gd5d6�d6e�Z7Gd7d8�d8e6�Z8Gd9d:�d:e�Z9Gd;d<�d<e6�Z:Gd=d>�d>e:�Z;d?d@�a<dAdB�Z=dCdD�Z>dEdF�Z?dGdH�Z@dIdJ�ZAdKdL�ZBdMdN�ZCdOdP�ZDdydQdR�ZEe:�ZFe;�ZGe8�ZHdzdSdT�ZId{dVdW�ZJd|dXdY�ZKd}dZd[�ZLd~d]d^�ZMGd_d`�d`�ZNeN�ZOGdadb�db�ZPdcdd�ZQdedf�ZRddhdi�ZSd�djdkdl�dmdn�ZTdodp�ZUdqdr�ZVdsdt�ZWdudv�ZXeYdwk�r�eX�dS)�aGenerate Python documentation in HTML or text for interactive use.

At the Python interactive prompt, calling help(thing) on a Python object
documents the object, and calling help() starts up an interactive
help session.

Or, at the shell command line outside of Python:

Run "pydoc <name>" to show documentation on something.  <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package.  If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.

Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.

Run "pydoc -n <hostname>" to start an HTTP server with the given
hostname (default: localhost) on the local machine.

Run "pydoc -p <port>" to start an HTTP server on the given port on the
local machine.  Port number 0 can be used to get an arbitrary unused port.

Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
open a Web browser to interactively browse documentation.  Combine with
the -n and -p options to control the hostname and port used.

Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".

Module docs for core modules are assumed to be in

    https://docs.python.org/X.Y/library/

This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
�helpzKa-Ping Yee <ping@lfw.org>z26 February 2001z�Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
�N)�deque)�Repr)�format_exception_onlycCs\g}g}tjD]H}tj�|pd�}tj�|�}||krtj�|�r|�|�|�|�q|S)zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir�r�/usr/lib64/python3.8/pydoc.py�pathdirsPs

rcCs.t�|�pt�|�}|r*t�dd|���p,dS)z-Get the doc string or comments for an object.z^ *
�)�inspect�getdocZgetcomments�re�sub�rstrip)�object�resultrrrr\srcCsf|���d�}t|�dkr&|ddfSt|�dkrX|d��sX|dd�|dd��fSdd�|�fS)z>Split a doc string into a synopsis line (if any) and the rest.�
�rr�N)�strip�split�lenr�join)�doc�linesrrr�splitdocasr$cCs"|j}|j|kr|jd|}|S)z@Get a class name and qualify it with a module name if necessary.r)�__name__�
__module__)r�modname�namerrr�	classnamejs
r)cCs>t�|�p:t�|�p:t�|�p:t�|�p:t�|�p:t�|�S)z>Check if an object is of a type that probably means it's data.)r�ismodule�isclass�	isroutineZisframeZistracebackZiscode�rrrr�isdataqs����r.cGs.|r*|d�|�|d��}|dd�}q|S)z/Do a series of global replacements on a string.rrrN)r!r)�textZpairsrrr�replacewsr0cCsXt|�|krTtd|dd�}td|d|�}|d|�d|t|�|d�S|S)zCOmit part of a string if needed to make it fit in a maximum length.r�rN�...)r �max)r/�maxlenZpreZpostrrr�cram~s
$r5z at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)z>Remove the hexadecimal id from a Python object representation.z\1)�_re_stripidr�r/rrr�stripid�sr8cCs<t�|�rdSt�|�r8t|dd�}t�|�p4|dkSdS)zo
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    T�__self__NF)r�ismethod�	isbuiltin�getattrr*)�fn�selfrrr�_is_bound_method�s

r?cCs^i}t�|tj�D]\}}d||<q|jD]}|�t|��q*|��D]}t||�||<qF|S�Nr)r�
getmembersr,�	__bases__�update�
allmethods�keysr<)�cl�methods�key�value�baserrrrD�s

rDcCs8g}g}|D]"}||�r$|�|�q|�|�q||fS)z�Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    �r
)�s�	predicateZyesZno�xrrr�_split_list�srOcCs\|dkrdS|�d�r$|�d�r$dS|�d�r<t|d�r<dS|dk	rL||kS|�d�SdS)	z3Decide whether to show documentation on a variable.>�	__slots__�__date__�__path__�__qualname__�__builtins__�__credits__�__doc__�
__author__�__version__�__file__r%�
__cached__r&�
__loader__�__spec__�__package__r�__r�_�_fieldsTN)�
startswith�endswith�hasattr)r(�all�objrrr�visiblename�srfcCsXg}t�|�D]D\}}}}t�|�r@d}t|t�r@|jdkr@d}|�||||f�q|S)zCWrap inspect.classify_class_attrs, with fixup for data descriptors.�data descriptorN�readonly property)r�classify_class_attrs�isdatadescriptor�
isinstance�property�fsetr
)r�resultsr(�kind�clsrIrrrri�s
rics\t|dg��z�fdd�t��D��Wntk
r>i�YnX�fdd�}|j|d�dS)zGSort the attrs list in-place by _fields and then alphabetically by namer`csi|]\}}||t���qSr)r )�.0�ir()�fieldsrr�
<dictcomp>�sz#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)�get)�attr)�field_orderrr�<lambda>��z!sort_attributes.<locals>.<lambda>�rHN)r<�	enumerate�	TypeError�sort)�attrsrZkeyfuncr)rxrsr�sort_attributes�s
r�cCs:tj�|�r6dD]$}tj�tj�|d|��rdSqdS)z3Guess whether a path refers to a package directory.)z.pyz.pyc�__init__TF)r	rr�isfiler!)r�extrrr�	ispackage�s
r�cCs�|��}|dd�dks |��s0|��}|sq0q|��}|dd�dkrT|dd�}|dd�dkr�|dd�}|dd�dkr�|dd�}|��s�|��}|s�q�q�|�d�d	��}nd}|S)
Nr�#�zr"""r1�"""����\r)�readlinerr)�file�linerrrr�source_synopsis�s&r�c
	Cs t�|�j}|�|d�\}}|dks.||k�r|�ttjj��rJtjj	}n |�ttjj
��rftjj}nd}|dkr�zt�
|�}Wntk
r�YdSX|�t|�}W5QRXn^|d|�}tjjd||d�}ztj�|�}	WnYdSXtjd=|	j�r|	j��dnd}||f||<|S)z.Get the one-line summary out of a module file.)NNNZ__temp__��loaderr)r	�stat�st_mtimervrb�tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr�modulesrV�
splitlines)
�filename�cache�mtimeZ
lastupdaterZ
loader_clsr�r��spec�modulerrr�synopsis�s6



�r�c@s eZdZdZdd�Zdd�ZdS)�ErrorDuringImportzEErrors that occurred while trying to import something to document it.cCs||_|\|_|_|_dS�N)r��excrI�tb)r>r��exc_inforrrr�#szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r%r�rI)r>r�rrr�__str__'szErrorDuringImport.__str__N)r%r&rSrVr�r�rrrrr�!sr�c		Cs�tjj}t|d��}||�t|��k}W5QRXtj�|�}tj�	|�\}}|r`tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����YnXdS)z<Import a Python source file or compiled file given its path.�rbr�N)r�r��MAGIC_NUMBERr��readr r	r�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r�magicr�Zis_bytecoder�r(r�r�r�rrr�
importfile+sr�c	s z^|rT�tjkrT�tjkrT�fdd�tjD�}�g|D]}tj|||<tj|=q8t��}Wnzt��\}}}}	�tjkr�ttj�j|	��n>|tkr�t|j|	��n(t	|t
�r�|j�kr�YdSt�t����YnX��d�dd�D].}
zt
||
�}Wq�tk
�rYdSXq�|S)a�Import a module; handle errors; return None if the module isn't found.

    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning.  If the optional 'forceload' argument
    is 1, we reload the module from disk (unless it's a dynamic extension).csg|]}|��d�r|�qS)r)ra)rq�m�rrr�
<listcomp>Qszsafeimport.<locals>.<listcomp>Nrr)rr��builtin_module_names�
__import__r�r�rY�SyntaxErrorr��
issubclass�ImportErrorr(rr<�AttributeError)r�	forceloadr�ZsubsrHr�r�rIr��info�partrr�r�
safeimport=s.


r�c@sfeZdZej�ddejdd��Zddd�Z	d
dd�Z
e
ZZZ
ZZZe�d	�fd
d�ZdS)�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrcGs�||f|}zFt�|�r$|j|�WSt�|�r:|j|�WSt�|�rP|j|�WSWntk
rfYnXt�|�r||j	|�S|j
|�S)z%Generate documentation for an object.)rr*�	docmoduler+�docclassr,�
docroutiner�rj�docdata�docother)r>rr(�argsrrr�documentss




zDoc.documentcGs*d|odt|�t|�jf}t|��dS)z+Raise an exception for unimplemented types.z.don't know how to document object%s of type %s� N)�repr�typer%r})r>rr(r��messagerrr�fail�s
�zDoc.failZstdlibcCs�zt�|�}Wntk
r&d}YnXtj�d|j�}tj�|�}t	|t
t��r�|jdksz|�|�r�|�tj�
|d��s�|jdkr�|�d�r�d|�d�|j��f}q�tj�
||j��d	�}nd
}|S)z*Return the location of module docs or None�
(built-in)r�)
�errno�
exceptionsZgcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z%s/%s�/�.htmlN)r�
getabsfiler}r	�environrvr�rrrkr�r%rar!r�lower)r>rZbasedirr��doclocrrr�	getdocloc�s(
����
z
Doc.getdocloc)N)N)r%r&rSr	r�rvr�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfigZget_pathr�rrrrr�ms��

r�c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZeZ	dd
�Z
eZdS)�HTMLReprzBClass for safely making an HTML representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r>rrrr��s
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)r0�r>r/rrr�escape�szHTMLRepr.escapecCst�||�Sr�)rr��r>rrrrr��sz
HTMLRepr.reprcCsZtt|�d�r@dd�t|�j���}t||�r@t||�||�S|�ttt	|��|j
��S�Nr%�repr_r_)rcr�r!r%rr<r�r5r8r�r��r>rN�levelZ
methodnamerrr�repr1�s

zHTMLRepr.repr1cCs^t||j�}t|�}d|krJdt|dd�krJd|d|�|�|dSt�dd|�|��S)Nr��\\r�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r5r�r�r0r�rr�r>rNr�ZtestZtestreprrrr�repr_string�s�zHTMLRepr.repr_stringcCs@z|�ttt|��|j��WS|�d|jj�YSXdS�Nz
<%s instance>)r�r5r8r�r��	__class__r%�r>rNr�rrr�
repr_instance�szHTMLRepr.repr_instanceN)r%r&rSrVr�r�r�r�r��repr_strrZrepr_unicoderrrrr��sr�c@seZdZdZe�ZejZejZdd�Zd1dd�Z	d2d
d�Z
dd
�Zdd�Zd3dd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd �Zd4d!d"�Zd5d#d$�Zddiifd%d&�Zd'd(�Zddiiidfd)d*�Zd6d+d,�ZeZd7d-d.�Zd8d/d0�ZdS)9�HTMLDocz'Formatter class for HTML documentation.cCsd||fS)�Format an HTML page.z�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>r)r>�title�contentsrrr�page�s�zHTMLDoc.pagercCsd|||||pdfS)zFormat a page heading.a'
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    �&nbsp;r)r>r�fgcol�bgcolZextrasrrr�heading�s�zHTMLDoc.heading�Nrc	
Cs^|dkrdd|d}d|||f}	|r@|	d||||f}	n|	d|||f}	|	d|S)	z Format a section with a heading.Nz<tt>rz</tt>z�<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r>rr	r
r�widthZpreludeZ
marginaliaZgaprrrr�section�s�
��zHTMLDoc.sectioncGsd|}|j|f|��S)z$Format a section with a big heading.z<big><strong>%s</strong></big>)r)r>rr�rrr�
bigsectionszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)z!Format literal preformatted text.�

z
 
r�rr�<br>
)r��
expandtabsr0r�rrr�	preformat
s�zHTMLDoc.preformatr�cCs�d}t|�|d|}t|�D]X}|dd|}t|||||�D]$}|t|�krJ||||�d}qJ|d}q d|S)z0Format a list of items into a multi-column list.rrz<td width="%d%%" valign=top>r�rz</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r �range)r>�list�formatZcolsr�rows�colrrrrr�multicolumns
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rr�rrr�greyrzzHTMLDoc.greycGs*|D] }||krd|||fSq|S)z:Make a link for an identifier, given name-to-URL mappings.�<a href="%s">%s</a>r)r>r(Zdicts�dictrrr�namelinkszHTMLDoc.namelinkcCsN|jtj�|j�}}t||�rDt||�|krDd|j|t||�fSt||�S)zMake a link for a class.z<a href="%s.html#%s">%s</a>)r%rr�rvr&rcr<r))r>rr'r(r�rrr�	classlink%s�zHTMLDoc.classlinkcCsd|j|jfS)zMake a link for a module.�<a href="%s.html">%s</a>)r%r�rrr�
modulelink-szHTMLDoc.modulelinkcCsR|\}}}}|r|�|�S|r,d||f}nd|}|rBd|}n|}d||fS)z;Make a link for a module or package to display in an index.z
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)r)r)r>Z
modpkginfor(rr��shadowed�urlr/rrr�
modpkglink1s

zHTMLDoc.modpkglinkcCsd||fS)zMake a link to source file.z<a href="file:%s">%s</a>r)r>r"rrrr�filelink@szHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}|�||�}	|	s0�qh|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n�|r�dt|�}|�d|||�f�n�|�r"|||d�d	k�r|�d
|�	||��n|�d|�n@|||d�d	k�rP|�|�	||||��n|�|�	||��|}q|�|||d���d
�
|�S)z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;rz'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r�(zself.zself.<strong>%s</strong>Nr)r�r�compile�search�spanr
�groupsr0�intrr!)r>r/r��funcs�classesrGrn�here�pattern�match�start�endrdZschemeZrfcZpepZselfdotr(r"rrr�markupDs:

zHTMLDoc.markupc
Cs�d}|D]�}t|�td�kr�|\}}|d}||�||�}|r�||fkr�g}|D]}	|�|�|	|��qR|dd�|�d}|d}qt|�tg�kr|d|�|||�}qd	|S)
zAProduce HTML for a class tree as given by inspect.getclasstree().rrz"<dt><font face="helvetica, arial">r&�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r�rr
r!�
formattree)
r>�treer'�parentr�entry�c�bases�parentsrJrrrr6os&
�
zHTMLDoc.formattreec#
s�|j}z
|j}Wntk
r(d}YnX|�d�}g}tt|�d�D],}|�dd�|d|d��||f�qHd�||dd��}	d|	}
z&t�	|�}t
j�|�}��
||�}
Wntk
r�d}
YnXg}t|d��r6t|j�}|dd	�d
k�r"|dd�dk�r"|d	d���}|�d��|��t|d
��rX|���t|j���|�rp|
dd�|�}
��|�}|dk	�r�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|tj�D]Z\}}|dk	�s�t�|��p�||k�r�t|||��r�|�||f�d|||<||<�q�|D]�\}}|jD]n}|j|j}}tj �!|�}||k�r@|�r@t||��r@t"||�|k�r@||k�r@|d|||<||<�q@�q2gi}}t�|tj#�D]p\}}|dk	�s�t�$|��s�t�|�|k�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q�g}t�|t&�D]&\}}t|||��rN|�||f��qN��'t(|��j)||�}|�o�d|}|d|}t|d��rg}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n.|�r<��.|�fdd��}!|��0d dd|!�}|�r�d!d"�|D�}"��1t�2|"d�|�g}!|D]"\}}|!���3|||||���qj|��0d#dd$d%�|!��}|�r�g}!|D]"\}}|!���3|||||���q�|��0d&dd'd%�|!��}|�r:g}!|D]\}}|!���3||���q|��0d(dd)d*�|!��}t|d+��rn��'t|j4��j)�}!|��0d,dd|!�}t|d-��r���'t|j5��j)�}!|��0d.dd|!�}|S)/z/Produce HTML documentation for a module object.Nrrz5<a href="%s.html"><font color="#ffffff">%s</font></a>r��)<big><big><strong>%s</strong></big></big>r�rX��$Revision: �$z
version %srQz (%s)r4z-<br><a href="%(docloc)s">Module Reference</a>r�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
rRrzPackage Contentsz#aa55cccs��|d�Sr@)r ��tr�rrry�rzz#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|�qSrr�rqrHrIrrrr��sz%HTMLDoc.docmodule.<locals>.<listcomp>ZClasses�#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55rrWZAuthorrUZCredits)6r%�__all__r�rrr r
r!rr��urllib�parseZquoter$r}rc�strrXrr�rQr��localsrrAr*r+�	getmodulerfrBr&rr�rvr<r,r;�
isfunctionr.r3rr�pkgutil�iter_modulesrRr~rr#rr6�getclasstreer�rWrU)#r>rr(�mod�ignoredrd�partsZlinksrrZ
linkedname�headrr"r$r��versionr�rr�r-ZcdictrHrIrJr'r�r,Zfdict�datar"�modpkgs�importer�ispkgr�	classlistrr�rr��s*


��


$


�

�

 

���
��������zHTMLDoc.docmodulec	s��j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkr�����d�|D]}�d��|�j	��qd�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]n\}}}}d|d|�|<}zt�|�}Wntk
�r4YnXz|�|<Wq�t
k
�rXYq�Xq�|�rx|�rr|���n|dd�t|�fdd��\}}�tjk	�r��tjk�r�|}�q\n"��k�r�d}nd����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|gk�spt�|}�q\d#�|	�}	||k�r�d$||f}nd%|||f}|�r�g}|D]}|���|�j	���q�|d&d'�|�}d#}zt���}Wntt
fk
�rd(}YnX|�rFt|�}|�rF|d)k�rF|��|�d*}t��}|�rb||�p^d#}��|�j����}|�o�d+|}��|d,d-|	d.|�S)/z.Produce HTML documentation for a class object.cs eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dSru�Zneedoner�rrrr�sz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)Nz<hr>
rr[r���pushrr�maybe	sz.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r%r&rSr�r^rr\rr�HorizontalRulesr`rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|r�����|�|D]d\}}}}zt�|�}Wn&tk
rf���||���YnX���||��������d�q&|S)Nr�rOr^r<�	Exceptionr�r���msgrrM�okr(ro�homeclsrI�r-r,�hr�mdictrQrr]r>rr�spills"�
zHTMLDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr��rOr^r�rd�rirQr]r>rr�spilldescriptors+sz*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|r�����|�|D]�\}}}}��t�|�|��}t|�sXt�|�rft|dd�}	nd}	|	dkr��d|�n0��t|��j	����}	d|	}	�d||	f��d�q&|S)NrVz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rOr^r�r<�callablerrjr3rr)
rerrMrfr(rorgrIrJr"rhrr�	spilldata4s(�
z#HTMLDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS�)re�rf�rqr(rorprIr-rrr�Is
�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rcs|d�kS�NrrrC��	thisclassrrrybrzz"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scSs|ddkS�Nr�methodrrCrrrryrrzzClass methods %scSs|ddkS�Nrzclass methodrrCrrrrytrzzStatic methods %scSs|ddkS�Nrz
static methodrrCrrrryvrzzReadonly properties %scSs|ddkS�NrrhrrCrrrryxrzzData descriptors %scSs|ddkS�NrrgrrCrrrryzrzzData and other attributes %scSs|ddkS�NrrVrrCrrrry|rzrz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)r4N�()rz<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r1)r%rBr
rr�getmror r^rr&rir<rcr}�popleftrO�builtinsrr��AssertionErrorr!�	signature�
ValueErrorrJr�rr3rr)r>rr(rQr,r-rR�realnamer;rr`�mrorJrkrnrprrHrorgrI�anchor�	inherited�tagrr<�declr��argspecr"r)	r-r,rirjrQrr]r>rwrr��s�
�
	
�

�

�
�
�
�
�
�

��
zHTMLDoc.docclasscCs|�d|�|��S�z)Format an argument default value as text.�=)rr�r�rrr�formatvalue�szHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jpdd|}	d}
d}t|�r�|jj}|rZ||k	r�d|�||�}
n0|jdk	rzd|�|jj|�}
nd|�||�}
t�|�s�t�|�r�d}
nd}
||kr�d	|	|f}nD|r�t�||g�|kr�d
|jd||f}d}n|}d|	||f}d}t�	|��rlzt�
|�}Wnttfk
�r>d}YnX|�rlt
|�}|d
k�rld|}|dd�}|�svd}|
||�|�|
�o�|�d|
�}|�r�d|S|�t|�|j|||�}|�o�d|}d||fSdS)z;Produce HTML documentation for a function or method object.rrtr� from N� method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %s�<lambda>z$<strong>%s</strong> <em>lambda</em> r��(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r%r?r9r�rr�iscoroutinefunction�isasyncgenfunction�getattr_staticr,r�r�r}rJr�rr3rr)r>rr(rQr,r-rGrFr�r��note�skipdocs�imclass�asyncqualifierrZreallinkr�r�r�r"rrrr��s|
�
���

��zHTMLDoc.docroutinecCsNg}|j}|r|d|�|�t|�|j�}|r<|d|�|d�d�|�S)z1Produce html documentation for a data descriptor.z!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
rar)r
r3rrr!�r>rr(rQrFrnr]r"rrrr��szHTMLDoc.docdatacGs|rd|pd}||�|�S)z-Produce HTML documentation for a data object.z<strong>%s</strong> = r�r�)r>rr(rQrRZlhsrrrr��szHTMLDoc.docothercCs�g}|dkri}t�|g�D]<\}}}tdd�|D��r:q|�|d|||kf�d||<q|��|�||j�}|�|dd|�S)z2Generate an HTML index for a directory of modules.Ncss*|]"}dt|�kodknVqdS)i�i��N)�ord�rqZchrrr�	<genexpr>�sz HTMLDoc.index.<locals>.<genexpr>rrrArF)rNrO�anyr
r~rr#r)r>rr!rWrXr(rYrrrr�index�s
z
HTMLDoc.index)r)rrNr)r�)N)NN)NNN)NN)N)r%r&rSrVr��_repr_instancer�r�rrrrrrrrrr r#r$r3r6r�r�r�r�r�r�r�r�rrrrr�sH

�

+

y&�
A

rc@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�TextReprzAClass for safely making a text representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dSr�r�r�rrrr�
s
zTextRepr.__init__cCsTtt|�d�r@dd�t|�j���}t||�r@t||�||�Sttt|��|j	�Sr�)
rcr�r!r%rr<r5r8r�r�r�rrrr�s

zTextRepr.repr1cCsHt||j�}t|�}d|krDdt|dd�krDd|d||dS|S)Nr�r�rr�r)r5r�r�r0r�rrrr�s
zTextRepr.repr_stringcCs4zttt|��|j�WSd|jjYSXdSr�)r5r8r�r�r�r%rrrrr%szTextRepr.repr_instanceN)	r%r&rSrVr�r�r�rrrrrrr�s	r�c@s~eZdZdZe�ZejZdd�Zddd�Zdd�Z	ddd�Z
dd
d�Zddd�Zdd�Z
ddd�Zddd�ZeZddd�Zd	S) �TextDocz'Formatter class for text documentation.cCsd�dd�|D��S)z(Format a string in bold by overstriking.rcss|]}|d|VqdS)�Nrr�rrrr�5szTextDoc.bold.<locals>.<genexpr>)r!r�rrr�bold3szTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r4|d��|d<d�|�S)z6Indent text by prepending a given prefix to each line.rcsg|]}�|�qSrr�rqr���prefixrrr�:sz"TextDoc.indent.<locals>.<listcomp>rr�)rrr!)r>r/r�r#rr�r�indent7szTextDoc.indentcCs$|�|���}|�|�d|dS)z&Format a section with a given heading.rr)r�rr�)r>rrZclean_contentsrrrr>szTextDoc.sectionNrc
	s�d}|D]�}t|�td�krr|\}}||t|��}|rh||fkrh�fdd�|D�}	|dd�|	�}|d}qt|�tg�kr||�|�||d�}q|S)	zBRender in text a class tree as returned by inspect.getclasstree().rrc3s|]}t|��VqdSr��r))rqr:�r'rrr�Msz%TextDoc.formattree.<locals>.<genexpr>r�r4rr�)r�r)r!r6)
r>r7r'r8r�rr9r:r;r<rr�rr6Es"
�zTextDoc.formattreec	Cs$|j}tt|��\}}|�d||o(d|�}t|dd�}|�|�}|dk	r`||�d|d�}|rt||�d|�}g}	t�|tj�D]<\}
}|dk	s�t�	|�p�||kr�t
|
||�r�|	�|
|f�q�g}t�|tj�D]F\}
}|dk	�st�
|��st�	|�|kr�t
|
||�r�|�|
|f�q�g}
t�|t�D]&\}
}t
|
||��r.|
�|
|f��q.g}t�}t|d��r�t�|j�D]6\}}}|�|�|�r�|�|d	�n
|�|��qx|��||�d
d�|��}g}t�|tj�D]0\}
}|j�|d��r�|
|k�r�|�|
��q�|�r6|��||�d
d�|��}|	�r�dd�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���qd||�dd�|��}|�r�g}|D]\}
}|�|�||
|���q�||�dd�|��}|
�r&g}|
D]"\}
}|�|j||
|dd���q�||�dd�|��}t|d��r�t|j�}|dd�dk�rp|dd�dk�rp|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d ��r�||�d!t|j"��}zt�#|�}Wnt$k
�rd"}YnX||�d#|�}|S)$z5Produce text documentation for a given module object.�NAME� - rGNzMODULE REFERENCEa.

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
ZDESCRIPTIONrR�
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|�qSrrrErrrr��sz%TextDoc.docmodule.<locals>.<listcomp>r�CLASSES�	FUNCTIONS�F)r4ZDATArXr>r?r�r@ZVERSIONrQZDATErWZAUTHORrUZCREDITSr�ZFILE)%r%r$rrr<r�rrAr+rLrfr
r,r;r.�setrcrNrOrR�addr~r!r*rar6rPr�r�rJrXrrQrWrUr�r})r>rr(rQZsynop�descrrdr�r-rHrIr,rVrWZ
modpkgs_namesrXr'rYZ
submodulesrZrrUr�rrrr�Us�
	�
��
��
�
$
zTextDoc.docmodulec	sZ�j}|p|}�j}�jfdd�}||kr:d��|�}n��|�d|}|rlt||�}	|dd�|	�}g}
|
j�zt���}Wnt	t
fk
r�d}YnX|r�t|�}|r�|dkrʈ||d	�t��}
|
r�|
d	�t
t����}t|�d
k�r*�d�|D]}�d||���q
�d
�tdd�t���D�tjd�}t|�}d}|�r��d�|d|�D]}�d|��qn||k�r��dt||�d��d
�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r&|�r*|���n|dd
�t|�fd d!��\}}�tjk	�rn�tjk�rn|}�qn ��k�r~d"}nd#t��j�}t|��|d$||d%d!��}|d&||d'd!��}|d(||d)d!��}|d*||d+d!��}|d,||d-d!��}|d.||d/d!��}|gk�st�|}�qd	�|
�}
|
�s>|d	S|d	��|
��d0�d	S)1z4Produce text documentation for a given class object.cSs
t||�Sr�r�)r:r�rrr�makename�sz"TextDoc.docclass.<locals>.makename�class z	 = class r�r4Nr�rrzMethod resolution order:r�rcss.|]&}|j�d�s|jdkrt|j�VqdS)r_r�N)r%rar&rJ)rqrprrrr��s
�z#TextDoc.docclass.<locals>.<genexpr>r{r�zBuilt-in subclasses:z    ... and z other subclassescs eZdZdd�Z�fdd�ZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrur[r�rrrr��sz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)NzF----------------------------------------------------------------------rr[r�r\rrr^�sz.TextDoc.docclass.<locals>.HorizontalRule.maybeNr_rr\rrr`�sr`c
s�t||�\}}|r~����|�|D]V\}}}}zt�|�}Wn&tk
rf���||���Yq&X���||����q&|Sr�rbrd�rirQrr]r>rrrk�s�zTextDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr�rlrdrmrrrnsz*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|r�����|�|D]v\}}}}t|�sDt�|�rNt|�}nd}zt�|�}	Wntk
r~|j|}	YnX��j	|	|�d|d�d�q&|S)Nr�)r4r"r)
rOr^rorrjrr<r��__dict__r�)
rerrMrfr(rorgrIr"rer�rrrps 
�z#TextDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qSrqrrrsr-rrr�+s
�z$TextDoc.docclass.<locals>.<listcomp>rcs|d�kSrurrCrvrrry4rzz"TextDoc.docclass.<locals>.<lambda>rxryzMethods %s:
cSs|ddkSrzrrCrrrryCrzzClass methods %s:
cSs|ddkSr|rrCrrrryErzzStatic methods %s:
cSs|ddkSr}rrCrrrryGrzzReadonly properties %s:
cSs|ddkSr~rrCrrrryIrzzData descriptors %s:
cSs|ddkSrrrCrrrryKrzzData and other attributes %s:
cSs|ddkSr�rrCrrrryMrzz |  )r%rBr&r��mapr!r
rr�r�r}rJrrr�r �sortedr��__subclasses__r�rir�rOr�rr)r�r�r�r)r>rr(rQrRr�r;r�rr<rr�r�r"r�rJZ
subclassesZno_of_subclassesZMAX_SUBCLASSES_TO_DISPLAYZsubclassnamer`rkrnrprr�r�r)rirQrr]r>rwrr��s�

�

��	
�

�

�
�
�
�
�
�
zTextDoc.docclasscCsd|�|�Sr�r�r�rrrr�WszTextDoc.formatvaluec	Cs�|j}|p|}d}d}t|�rn|jj}|rB||k	rndt||�}n,|jdk	r`dt|jj|�}ndt||�}t�|�s�t�|�r�d}	nd}	||kr�|�|�}
n,|r�t�	||g�|kr�d}|�|�d	|}
d}t�
|��r<zt�|�}Wntt
fk
�rd}YnX|�r<t|�}|d
k�r<|�|�d}
|dd�}|�sFd
}|	|
||}
|�rd|
dSt|��ppd}|
d|�o�|�|���dSdS)z;Produce text documentation for a function or method object.rrr�Nr�r�r�r� = r�z lambda r�r�r)r%r?r9r�r)rr�r�r�r�r,r�r�r}rJrr�r)r>rr(rQrFr�r�r�r�r�rr�r�r�r"rrrr�[sV
�
�

zTextDoc.docroutinecCsTg}|j}|r$||�|��|d�t|�p.d}|rJ||�|��|d�d�|�S)z1Produce text documentation for a data descriptor.rr)r
r�rr�r!r�rrrr��szTextDoc.docdatac
Cs�|�|�}|rF|r|dpd|}|t|�}	|	dkrF|d|	�d}|rX|�|�dpZd|}|dk	r~|d|�t|��7}|S)z-Produce text documentation for a data object.r�rrNr2r)r�r r�r�rJ)
r>rr(rQr8r4r"r�r�Zchoprrrr��s
zTextDoc.docother)r�)Nr)NN)NN)NNN)NNN)NNNNN)r%r&rSrVr�r�r�r�r�rr6r�r�r�r�r�r�r�rrrrr�+s


e

7
r�c@seZdZdZdd�ZdS)�
_PlainTextDocz2Subclass of TextDoc which overrides string stylingcCs|Sr�rr�rrrr��sz_PlainTextDoc.boldN)r%r&rSrVr�rrrrr��sr�cCst�at|�dS)zCThe first time this is called, determine what kind of pager to use.N)�getpager�pagerr7rrrr��sr�c	s@ttjd�stSttjd�s tStj��r4tj��s8tStj�d�pNtj�d���r�tj	dkrj�fdd�Stj�d�dkr��fd	d�S�fd
d�Stj�d�dkr�tStj	dkr�dd�Sttd�r�t�
d
�dkr�dd�Sddl}|��\}}t�
|�z8ttd��r$t�
d|�dk�r$dd�W�StW�SW5t�|�XdS)z2Decide what method to use for paging through text.�isattyZMANPAGERZPAGER�win32cstt|���Sr���
tempfilepager�plainr7�Z	use_pagerrrry�rzzgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscstt|���Sr�)�	pipepagerr�r7r�rrry�rzcs
t|��Sr��r�r7r�rrry�rzcSstt|�d�S)Nzmore <r�r7rrrry�rz�systemz(less) 2>/dev/nullrcSs
t|d�S)NZlessr�r7rrrry�rzNz	more "%s"cSs
t|d�S)NZmorer�r7rrrry�rz)rcr�stdin�
plainpager�stdoutr�r	r�rv�platformr��tempfileZmkstemp�close�unlink�ttypager)r��fdr�rr�rr��s6


 r�cCst�dd|�S)z%Remove boldface formatting from text.z.r)rrr7rrrr��sr�c	Cs�ddl}|j|d|jd�}zDtj|jdd��*}z|�|�Wntk
rPYnXW5QRXWntk
rrYnXz|�	�Wq�Wqttk
r�YqtXqtdS)z3Page through text by feeding it to another program.rNT)�shellr��backslashreplace)�errors)
�
subprocess�Popen�PIPE�io�
TextIOWrapperr��write�KeyboardInterruptr��wait)r/�cmdr��proc�piperrrr��sr�c
Cs~ddl}|���d}tj�|d�}t|ddtjdkr<t�d�ndd��}|�	|�W5QRXt�
|d|d	�W5QRXdS)
z<Page through text by invoking a program on a temporary file.rNz	pydoc.out�wr�r�)r��encodingz "r%)r�ZTemporaryDirectoryr	rr!r�rr��device_encodingr�r�)r/r�r�Ztempdirr�r�rrrr��s
��r�cCs$ttjdd�pd}|�|d��|�S)Nr��utf-8r�)r<rr��encode�decode)r/r�rrr�_escape_stdoutsr�c
Cs�tt|���d�}z2ddl}tj��}|�|�}|�|�dd�}Wn(t	t
tjfk
rld}dd�}YnX�z0zttj�dd��}Wntk
r�d}YnX|dkr�d	}|d}}tj�d�|d|��d�||d��r�tj�d
�tj��|�}	|	dk�rtj�d��q�n,|	d
k�rJtj�d||d�|d}q�|	dk�rn|||}|dk�rnd}tj�dd�||||��d�||}q�W5|�r�|�
||j|�XdS)z%Page through text on a text terminal.rrNcSstj�d�Sr@)rr�r�rrrrryrzzttypager.<locals>.<lambda>cSstj��dd�dd�S)Nr�r)rr�r�rrrrryrzZLINESr�z
-- more --)�q�Qz
          
)�
r)�b�B�)r�r�r�ttyrr��filenoZ	tcgetattrZ	setcbreakr�r�r��UnsupportedOperationZ	tcsetattrZ	TCSAFLUSHr+r	r�rvr�r�r�r!�flush)
r/r#r�r��oldZgetchar�hr�Zincr:rrrr�	sL








&r�cCstj�tt|���dS)z>Simply print unformatted text.  This is the ultimate fallback.N)rr�r�r�r�r7rrrr�5sr�cCs�t�|�r>|jtjkr d|jSt|d�r4d|jSd|jSt�|�rRd|jSt�|�rtd|jj	|jj|jfSt�
|�r�d|jj	|jj|jfSt�|�r�d|jSt�|�r�d	|jSt�
|�r�d
|jSt|�jS)z/Produce a short description of the given thing.zbuilt-in module rRzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr�z	function zmethod )rr*r%rr�rcr;Zisgetsetdescriptor�__objclass__r&Zismemberdescriptorr+rMr:r�)�thingrrr�describe9s6







�
�





r�c	Cs�dd�|�d�D�}d\}}|t|�kr\td�|d|d��|�}|r\||d}}qq\q|rf|}nt}||d�D],}zt||�}Wqvtk
r�YdSXqv|S)z@Locate an object by name or dotted path, importing as necessary.cSsg|]}|r|�qSrr)rqr�rrrr�Vszlocate.<locals>.<listcomp>rruNr)rr r�r!r�r<r�)rr�rSr��nZ
nextmodulerr�rrr�locateTs r�cCsVt|t�r0t||�}|dkr(td|��||fSt|dd�}|t|t�rL|ndfSdS)zDGiven an object or a path to an object, get the object and its name.Nz~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.r%)rkrJr�r�r<)r�r�rr(rrr�resolvems

�r� Python Library Documentation: %scCs�|dkrt}t||�\}}t|�}t�|�}|rTd|krT|d|d|�d��7}n|rn||k	rn|d|j7}t�|�s�t�|�s�t�	|�s�t�
|�s�t|�}|d7}||d|�||�S)zBRender text documentation, given an object or a path to an object.Nrz in z in module z objectr)
r/rr�rrL�rfindr%r*r+r,rjr�r�)r�rr�Zrendererrr(r�r�rrr�
render_doc{s&

���rc
Csfz2|dkrtt|||��n|�t|||t��Wn.ttfk
r`}zt|�W5d}~XYnXdS)zCDisplay text documentation, given an object or a path to an object.N)r�rr��	plaintextr�r��print)r�rr��outputrIrrrr"�sr"c
Cs�z`t||�\}}t�t|�t�||��}t|dddd��}|�|�W5QRXtd|d�Wn.tt	fk
r�}zt|�W5d}~XYnXdS)z<Write HTML documentation to a file in the current directory.r�r�r�)r�ZwroteN)
r�htmlrr�r�r�r�rr�r�)r�r�rr(rr�rIrrr�writedoc�srrcCs2|dkri}t�|g|�D]\}}}t|�qdS)zAWrite out HTML documentation for all modules in a directory tree.N)rN�
walk_packagesr)r�pkgpathZdonerXr'rYrrr�	writedocs�s

rcJ@s"eZdZddddddddddd	d
ddd
ddddddddddddddddddddd�#Zd d!�d"D�Zd�e�d'd(d)d*d+d,d-�Zd.d/d0d1d2d3d4d5d6d7d8d9d9d:d:d;�Ze��D]:\ZZ	e	D],Z
e�e
e�Zeekr�ed<eZeee
<q�q�d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdLdMdNdOdPdQddRdSdSdTdUdVdWdXdYdZd[d\d]d^d_d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{ddd|d}d~dd��IZd�d�d��Z
ed�d���Zed�d���Zd�d��Ze�Zefd�d��Zd�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d�d��Zd�d��Zd�d�d��Z d�S)��Helperr�BOOLEAN�with)�assertr)�asyncr)�awaitr)�break�	while for)�classzCLASSES SPECIALMETHODS)�continuer)Zfunctionr)�del�BASICMETHODS�if)�elser�try)�forzbreak continue while�import)�globalznonlocal NAMESPACES)r�
TRUTHVALUE)r�MODULES)�in�SEQUENCEMETHODS�
COMPARISON)�lambdar�)�nonlocalzglobal NAMESPACES)�passr)�raise�
EXCEPTIONS)�returnr�)rr')�whilezbreak continue if TRUTHVALUE)rz CONTEXTMANAGERS EXCEPTIONS yield)�yieldr)#�False�None�True�and�asrrrrrr�defr�elifr�except�finallyr�fromrrrr �isr#r$�not�orr%r&r(rr)rr*cCsg|]}dD]}||�qqS)��'r%r)rq�pr�rrrr��szHelper.<listcomp>)r��fr��ur9�'''r%r�)�+rt�*�**r�z//�%�<<�>>r��|�^�~r�r��<=�>=�==�!=�<>)r�r�rGrHrIrJrK)rtrF)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rBrCr�rDrErF)�j�J)�STRINGS�	OPERATORSr"�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classrN�PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)rAr@�,rr2�:�@r�r_r^�`r&r5�[�]r�)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES)zstring-methodszSTRINGS FORMATTING)Z
formatstringsrO)r^z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES)ZnumberszINTEGER FLOAT COMPLEX TYPES)Zintegersz	int range)Zfloatingz
float math)Z	imaginaryz
complex cmath)Ztypesseqz$STRINGMETHODS FORMATTING range LISTS�DICTIONARIES)Ztypesfunctionsz	def TYPES)Ztypesmethodszclass def CLASSES TYPES)zbltin-code-objectszcompile FUNCTIONS TYPES)zbltin-type-objectsztypes TYPES�TYPES)zbltin-null-objectr)zbltin-ellipsis-object�SLICINGS)Zspecialattrsr)r]z!class SPECIALMETHODS PRIVATENAMES)Ztypesmodulesr)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES�EXPRESSIONS)Zobjectsr`)ZspecialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES)Z
customizationzhash repr str SPECIALMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS)zcallable-typeszCALLS SPECIALMETHODS)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS)rczMAPPINGS SPECIALMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS)Z	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS)Znamingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES)zdynamic-featuresr�
NAMESPACES)r�ztry except finally raise)Zconversionsr)Zidentifierszkeywords SPECIALIDENTIFIERS)z
id-classesr)zatom-identifiersr)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�	SEQUENCES)Z	exprlistszTUPLES LITERALS)ztypesseq-mutable�LISTLITERALS)ZlistszLISTS LITERALS)Ztypesmapping�DICTIONARYLITERALS)rzDICTIONARIES LITERALS)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS)Z
subscriptionsr!)Zslicingsr!)Zcallsrb)Zpowerrb)Zunaryrb)Zbinaryrb)Zshiftingrb)Zbitwiserb)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEr)Z
assignmentrQ)Z	augassign�
NUMBERMETHODSrr()Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersr)Ir`rNZ
STRINGMETHODSZ
FORMATTING�UNICODEZNUMBERSZINTEGERZFLOATrSreZMAPPINGSr�ZMETHODSZCODEOBJECTSZTYPEOBJECTSZFRAMEOBJECTSZ
TRACEBACKSZNONErUZSPECIALATTRIBUTESr�rZPACKAGESrbrOZ
PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSr!ZMAPPINGMETHODSrhZ	EXECUTIONrdZDYNAMICFEATURESZSCOPINGZFRAMESr'ZCONVERSIONSZIDENTIFIERSZSPECIALIDENTIFIERSrVZLITERALSZTUPLESZ
TUPLELITERALSZLISTSrfr_rgZ
ATTRIBUTESZ
SUBSCRIPTSraZCALLSrTrPZBINARYZSHIFTINGrRr"r
Z	ASSERTIONZ
ASSIGNMENTrQZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGrZ	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dSr�)�_input�_output)r>�inputrrrrr�^szHelper.__init__cCs|jp
tjSr�)rkrr�r�rrrrmbszHelper.inputcCs|jp
tjSr�)rlrr�r�rrrrfsz
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)Nrr1�?rz<%s.%s instance>)r�stackr�r&rSr�rrr�__repr__js�zHelper.__repr__cCs6||jk	r|�|�n|��|��|j�d�dS)Na
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
)�_GoInteractiver�intro�interactrr��r>Zrequestrrr�__call__rs

zHelper.__call__c	Cs�|j�d�z|�d�}|s Wq�Wnttfk
r>Yq�YnX|��}t|�dkr�|d|dkrpdkr�nn |d|dd�kr�|dd�}|��dkr�q�|d	kr�|��q|�	|�qdS)
Nrzhelp> rrr�r8r)r��quitr)
rr��getliner��EOFErrorrr r�rrrrtrrrrss"

,�
zHelper.interactcCs8|jtjkrt|�S|j�|�|j��|j��SdS)z.Read one line, using input() when appropriate.N)rmrr�rr�r�r�)r>�promptrrrrw�s

zHelper.getlinecCs<t|�td�k�r|��}|dkr,|��n�|dkr>|��n�|dkrP|��n�|dkrb|��n�|dd�dkr�|�|��d�n�||jkr�|�|�nj|d	kr�t	t
|�d
�nR||jkr�|�|�n<||j
kr�|�|�n&|r�t	|d
|jd�nt	td
|jd�n$t|t��r|�nt	|d
|jd�|j�d�dS)
Nr�keywords�symbols�topicsr��zmodules r)r-r+r,zHelp on %s:)rr)r�r�listkeywords�listsymbols�
listtopics�listmodulesrr{�
showsymbolr"�evalrz�	showtopicr|rlrJrkrrr�rtrrrr�s6






zHelper.helpcCs$|j�d�dtjdd���dS)Na�
Welcome to Python {0}'s help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/{0}/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
z%d.%dr)rr�rrr�r�rrrrr�s
�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D]v}t|�D]\}|||}|t|�kr<|j�||�||dkr<|j�dd|dt||��q<|j�d�q0dS)Nrr�r)rr�r rrr�)	r>�items�columnsr
Zcolwr�rowrrrrrrr�s&zHelper.listcCs |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rr�rrzrEr�rrrr~�szHelper.listkeywordscCs |j�d�|�|j���dS)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rr�rr{rEr�rrrr�szHelper.listsymbolscCs |j�d�|�|j���dS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rr�rr|rEr�rrrr��szHelper.listtopicscCs0zddl}Wn"tk
r.|j�d�YdSX|j�||j�|��}|sb|j�dt|��dSt|�td�kr~|�	||�S|\}}z|jj|}Wn*t
k
r�|j�dt|��YdSX|��d}|r�|p�dd|}|�r$ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nr�t
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrr��Related help topics: r4�Hz
%s
)�pydoc_data.topicsr�rr�r|rvrzr�r�r��KeyErrorr�textwrapr!rZwrapr�)r>�topic�
more_xrefs�
pydoc_data�target�label�xrefsr"r�r/Zwrapped_textrrrr��s4zHelper.showtopiccCs�zddl}Wntk
r"YdSX|j�||j�|��}|sFtd��t|t�r\|�||�S|\}}|jj|}|r�|pzdd|}||fS)a*Return unbuffered tuple of (topic, xrefs).

        If an error occurs here, the exception is caught and displayed by
        the url handler.

        This function duplicates the showtopic method but returns its
        result directly so it can be formatted for display in an html page.
        rN)r�rzcould not find topicrr�)	r�r�r|rvrzr�rkrJ�	_gettopic)r>r�r�r�r�r�r�r"rrrr�s	
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)r{�	partitionr�)r>�symbolr�r�r_r�rrrr�!s
zHelper.showsymbolcsv|r |j�d�|��t|�nR|j�d�i}|fdd���fdd�}t�j�|d�|�|���|j�d�dS)	Nzy
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

zI
Please wait a moment while I gather a list of all available modules...

cSs>|r$|dd�dkr$|dd�d}|�d�dkr:d||<dS)N����	.__init__r�rrr)�find)rr'r�r�rrr�callback4sz$Helper.listmodules.<locals>.callbackcs�d|d�dSr�rr��r�rr�onerror9sz#Helper.listmodules.<locals>.onerror�r�z�
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
)rr�r�apropos�
ModuleScanner�runrrE)r>rHr�r�rr�rr�&s
�
zHelper.listmodules)r9r=r%r�)NN)r�r�)r)r)r)!r%r&rSrzZ_strprefixesZ_symbols_inverser{r�r�Zsymbols_r�rvr|r�rlrmrrprrqrursrwrrrrr~rr�r�r�r�r�rrrrr�sB�'���W



	


 
rc@seZdZdZddd�ZdS)r�z7An interruptible scanner that searches module synopses.Nc	Cs
|r|��}d|_i}tjD]p}|dkrd||<|dkrF|d|d�qt|�jpRd}|�d�d}|d|}|���|�dkr|d||�qtj	|d�D�]\\}	}}
|jr��q�|dkr�|d|d�q�zt�
|	|�}Wntk
r�Yq�YnX|j}t
|d	��rnz|�|�}
Wn(tk
�r:|�r2||�Yq�YnXtt�|
���pNd}t
|d
��rh|�|�}nd}n`ztj�|�}Wn(tk
�r�|�r�||�Yq�YnX|j�r�|j��dnd}t|dd�}|d|}|���|�dkr�||||�q�|�r|�dS)NF�__main__rrrrr�r��
get_source�get_filenamerY)r�rvrr�r�rVrr�rNr	�	_get_specr�r�rcr�rcr�r��StringIOr�r�r�r�r�r�r<)r>r�rHZ	completerr��seenr'r(r�rXrYr�r��sourcerr�rrrr�Gs`



zModuleScanner.run)NNN)r%r&rSrVr�rrrrr�Dsr�c	CsDdd�}dd�}t���"t�d�t�j|||d�W5QRXdS)zAPrint all the one-line module summaries that contain a substring.cSs6|dd�dkr |dd�d}t||o.d|�dS�Nr�r�r�z- )r�rr'r�rrrr��szapropos.<locals>.callbackcSsdSr�rr�rrrr��szapropos.<locals>.onerror�ignorer�N)�warnings�catch_warnings�filterwarningsr�r�)rHr�r�rrrr��s


r�cs�ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	s�|j
s�t�d	�q~|S)
aAStart an HTTP server thread on a specific port.

    Start an HTML/text server thread, so HTML or text documents can be
    browsed dynamically and interactively with a Web browser.  Example use:

        >>> import time
        >>> import pydoc

        Define a URL handler.  To determine what the client is asking
        for, check the URL and content_type.

        Then get or generate some text or HTML code and return it.

        >>> def my_url_handler(url, content_type):
        ...     text = 'the URL sent was: (%s, %s)' % (url, content_type)
        ...     return text

        Start server thread on port 0.
        If you use port 0, the server will pick a random port number.
        You can then use serverthread.port to get the port number.

        >>> port = 0
        >>> serverthread = pydoc._start_server(my_url_handler, port)

        Check that the server is really started.  If it is, open browser
        and get first page.  Use serverthread.url as the starting page.

        >>> if serverthread.serving:
        ...    import webbrowser

        The next two lines are commented out so a browser doesn't open if
        doctest is run on this module.

        #...    webbrowser.open(serverthread.url)
        #True

        Let the server do its thing. We just need to monitor its status.
        Use time.sleep so the loop doesn't hog the CPU.

        >>> starttime = time.monotonic()
        >>> timeout = 1                    #seconds

        This is a short timeout for testing purposes.

        >>> while serverthread.serving:
        ...     time.sleep(.01)
        ...     if serverthread.serving and time.monotonic() - starttime > timeout:
        ...          serverthread.stop()
        ...          break

        Print any errors that may have occurred.

        >>> print(serverthread.error)
        None
   rNc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsX|j�d�rd}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)	z�Process a request from an HTML browser.

            The URL received is in self.path.
            Get an HTML page from self.urlhandler and send it.
            z.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8r�N)	rrbZ
send_responseZsend_headerZend_headersZwfiler��
urlhandlerr�)r>�content_typerrr�do_GET�s

��z(_start_server.<locals>.DocHandler.do_GETcWsdSr�r)r>r�rrr�log_message�sz-_start_server.<locals>.DocHandler.log_messageN)r%r&rSr�r�rrrr�
DocHandler�sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�hostZaddressr�rJr��handlerrv)r>r��portr�rrrr��s
z)_start_server.<locals>.DocServer.__init__cs>|js2��|j��gggd�\}}}|r|��q|��dSr@)rv�selectZsocketr�Zhandle_requestZserver_close)r>ZrdZwrZex�r�rr�serve_until_quit�s

z1_start_server.<locals>.DocServer.serve_until_quitcSs |j�|�|jr|�|�dSr�)rJ�server_activater�r�rrrr��sz0_start_server.<locals>.DocServer.server_activateN)r%r&rSr�r�r�rr�rr�	DocServer�sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�r+r��Threadr��serving�error)r>r�r�r�)�	threadingrrr��s
z,_start_server.<locals>.ServerThread.__init__c
sxzJ�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�Wn(tk
rr}z
||_W5d}~XYnXdS)zStart the server.N)�server�
HTTPServerrJr�r�ZMessageZMessageClass�staticmethodr�r�r��ready�	docserverr�rcr�)r>Zdocsvr�e)r�r��email�httprrr�	s

z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r�r�Zserver_portr�r")r>r�rrrr�	sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)z&Stop the server and this thread nicelyTNF)r�rvr!r�r"r�rrr�stop	s
z(_start_server.<locals>.ServerThread.stopN)r%r&rSr�r�r�r�r)r�r�r�r�r�rr�ServerThread�s
r�g{�G�z�?)
Zhttp.serverZ
email.messager�r�r�ZBaseHTTPRequestHandlerr�r�r1r�r��time�sleep)r��hostnamer�r��threadr)r�r�r�r�r�r�r�
_start_server�s8'r�r�c
s(G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�r�|dd�}|dk�rtj�tj�t��}tj�||�}t|��}d�|�	��W5QR�SQRXn|dk�r||�St
d||f��dS)aThe pydoc url handler for use with the pydoc server.

    If the content_type is 'text/css', the _pydoc.css style
    sheet is read and returned if it exits.

    If the content_type is 'text/html', then the result of
    get_html_page(url) is returned.
    cseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccsd}d|}d||��|fS)rzpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">a<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>r)r>rr�css_pathZcss_link��html_navbarrrr2	s���z#_url_handler.<locals>._HTMLDoc.pageN)r%r&rSrrr�rr�_HTMLDoc0	sr�cs>��dt��t��dt��f�}d|��tjdd��fS)Nz%s [%s, %s]raZ
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            T)Zterse)r�r�Zpython_versionZpython_buildZpython_compiler)rU�rrrr�B	s
��z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��qT|�d�dd
�|�fS)zModule Index page.cSsd||fS�Nrr�r(rrr�	bltinlink`	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>rArBcSsg|]}|dkr|�qS)r�r)rqr(rrrr�f	s�z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in ModulesrFz|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</font>zIndex of Modulesr)	rrr�rrrr
r�r!)r�r�namesrr�rr�rr�
html_index]	s*��
�z _url_handler.<locals>.html_indexc		s�g��fdd�}t���*t�d�dd�}t�j|||d�W5QRXdd�}g}��d	d
d�}�D]\}}|�||�|�qf|��d|d
d
d�|��}d|fS)zSearch results page.cs:|dd�dkr |dd�d}��||o0d|f�dSr�rKr��Z
search_resultrrr�{	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSsdSr�rr�rrrr��	sz2_url_handler.<locals>.html_search.<locals>.onerrorr�cSsd||fSr�rr�rrrr��	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>rArBzkey = %srF�<br>zSearch Results)	r�r�r�r�r�rr
rr!)	rHr�r�r�rnrr(r�rr�r�r�html_searchv	s,

��z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)zIndex of topic texts available.cSsd||fS�Nz<a href="topic?key=%s">%s</a>rr�rrrr��	sz4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>rArBZTopicsrF)rr�rr|rErr)r�rr�rr�rr�html_topics�	s��z!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)zIndex of keywords.r�rArBcSsd||fSr�rr�rrrr��	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsrF)rr�rrzrErr)rr�r�rr�rr�
html_keywords�	s��z#_url_handler.<locals>.html_keywordscs�t��}t||�}|�|�\}}||jkr0d}nd}��d|dd�}d��|�}��|dd|�}|r�t|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
zTopic or keyword help page.ZKEYWORDZTOPICr=rArBz
<pre>%s</pre>rFcSsd||fSr�rr�rrrr��	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkr�z%s %sr)
r�r�rr�rzrr3rr�rrrr!)r�ZbufZhtmlhelprr�rrr�r�rr�html_topicpage�	s2

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dkr$|dkr$td��t|�}��||�}||fS)Nr)r�r,zcould not find object)r�r�r�r�)r"rer�contentr�rr�html_getobj�	sz!_url_handler.<locals>.html_getobjcsP��ddd�}d��fdd�tt|�|�D��}|��|dd|�}d||fS)	Nz,<big><big><strong>Error</strong></big></big>rArBr�c3s|]}��|�VqdSr�)r�r�r�rrr��	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rr!rr�r)r"r�rrr�rr�
html_error�	s���z _url_handler.<locals>.html_errorc
sr|}|�d�r|dd�}�z|dkr2��\}}n�|dkrF��\}}n�|dkrZ��\}}n�d|k�r$|�d�\}}}|dkr��|�\}}n�|d	kr�z�|�\}}Wn tk
r��|�\}}YnXn\|d
k�r|dkr��\}}n4z�|�\}}Wn"tk
�r�|�\}}YnXntd��n�|�\}}Wn2tk
�rd}z�||�\}}W5d}~XYnX��||�S)zGenerate an HTML page for url.r�N���)rr�r|rzr�z
search?keyz	topic?keyzget?keyz
bad pydoc url)rbr�r�rcr)r"Zcomplete_urlrr��opr_r�)rr�r�r�r�r�r�r�rr�
get_html_page�	s>



 z#_url_handler.<locals>.get_html_pager�rNr�rr�z"unknown content type %r for url %s)rrar	r�dirname�realpathrYr!r��	readlinesr})r"r�r�r�Z	path_herer��fpr)	rr�r�r�r�r�r�r�r�r�_url_handler'	s*	
(


"
r�T�	localhost)�open_browserr�c	Cs�ddl}tt||�}|jr(t|j�dS|jr�d}|rB|�|j�z~zZtd|j�t|�|jr�t	d�}|�
�}|dkr|q�qZ|dkr�|�|j�qZt|�qZWnttfk
r�t�YnXW5|jr�|��td�XdS)	z�Start the enhanced pydoc Web server and open a Web browser.

    Use port '0' to start the server on an arbitrary port.
    Set open_browser to False to suppress opening a browser.
    rNz"Server commands: [b]rowser, [q]uitzServer stoppedzServer ready atzserver> r�r�)
�
webbrowserr�r�r�rr�r�r"r�rmr�r�rx)r�r�r�r�ZserverthreadZserver_help_msgr�rrr�browse
s2
r�cCst|t�o|�tj�dkSru)rkrJr�r	�sep)rNrrr�ispath9
sr�cCsvd|kstj|kst��|kr"dStj�t�}tj�|�}|��}||krbtj�||�sb|�|�|�	dt���|S)z�Ensures current directory is on returned path, and argv0 directory is not

    Exception: argv0 dir is left alone if it's also pydoc's directory.

    Returns a new path entry list, or None if no adjustment is needed.
    rNr)
r	�curdir�getcwdrr�rY�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path<
s

r�cCs,ttjtjd�}|dk	r(|tjdd�<dS)z�Ensures current directory is on sys.path, and __main__ directory is not.

    Exception: __main__ dir is left alone if it's also pydoc's directory.
    rN)r�rr�argv)r�rrr�_adjust_cli_sys_pathX
sr�cCs�ddl}Gdd�dt�}t��zv|�tjdd�d�\}}d}d}d}d}d}|D]\\}	}
|	d	krld
}d
}|	dkr�t|
�WdS|	dkr�d
}|
}|	d
kr�d
}|	dkrTd
}|
}qT|r�t|||d�WdS|s�|�|D]�}t|��rtj	�
|��std|��q�z`t|��r&tj	�|��r&t
|�}|�rXt|��rNtj	�|��rNt|�nt|�n
t�|�Wq�tk
�r�}zt|�W5d}~XYq�Xq�WnN|j|fk
�r�tj	�tj	�tjd��d}
tdj|
tjd��YnXdS)z@Command-line interface (looks at sys.argv to decide what to do).rNc@seZdZdS)zcli.<locals>.BadUsageN)r%r&rSrrrr�BadUsagee
srrzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exista�pydoc - the Python documentation tool

{cmd} <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '{sep}', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

{cmd} -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

{cmd} -n <hostname>
    Start an HTTP server with the given hostname (default: localhost).

{cmd} -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

{cmd} -b
    Start an HTTP server on an arbitrary unused port and open a Web browser
    to interactively browse documentation.  This option can be used in
    combination with -n and/or -p.

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
)r�r�)�getoptrcr�rr�r�r�r�r	r�existsrr�r�rrrrr�r�r�r�rr�)rrZoptsr�ZwritingZstart_serverr�r�r��opt�val�argrIr�rrr�clib
sd

 �rr�)NN)r)r)rrN)rrN)r)rN)r�)r)ZrVrGrWrQrUr�Zimportlib._bootstrapr�Zimportlib._bootstrap_external�importlib.machinery�importlib.utilrr�r	rNr�rrr�r�r�Zurllib.parserHr��collectionsr�reprlibr�	tracebackrrrr$r)r.r0r5r'�
IGNORECASEr6r8r?rDrOrfrir�r�r�r�rcr�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r/rrrrr"rrrrr�r�r�r�r�r�r�r�rr%rrrr�<module>s�&
	


'
0:*> ",

�
�


=
n%
U
telnetlib.cpython-38.opt-1.pyc000064400000043477151450073350012137 0ustar00U

e5d�Z�@sJdZddlZddlZddlZddlmZdgZdZdZ	e
dg�Ze
dg�Ze
dg�Z
e
d	g�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Z e
dg�Z!e
dg�Z"e
dg�Z#e
dg�Z$e
dg�Z%e
dg�Z&e
d g�Z'e
d!g�Z(e
d"g�Z)e
d#g�Z*e
d$g�Z+e
d%g�Z,e
d&g�Z-e
d'g�Z.e
d(g�Z/e
d)g�Z0e
d*g�Z1e
d+g�Z2e
dg�Z3e
d,g�Z4e
d-g�Z5e
d.g�Z6e
d/g�Z7e
d0g�Z8e
d1g�Z9e
d2g�Z:e
d3g�Z;e
d4g�Z<e
d5g�Z=e
d6g�Z>e
d7g�Z?e
d8g�Z@e
d9g�ZAe
d:g�ZBe
d;g�ZCe
d<g�ZDe
d=g�ZEe
d>g�ZFe
d?g�ZGe
d@g�ZHe
dAg�ZIe
dBg�ZJe
dCg�ZKe
dDg�ZLe
dEg�ZMe
dFg�ZNe
dGg�ZOe
dHg�ZPe
dg�ZQe
dg�ZReSedI��rejTZUnejVZUGdJd�d�ZWdKdL�ZXeYdMk�rFeX�dS)NaQTELNET client class.

Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds

Example:

>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79)   # connect to finger port
>>> tn.write(b'guido\r\n')
>>> print(tn.read_all())
Login       Name               TTY         Idle    When    Where
guido    Guido van Rossum      pts/2        <Dec  2 11:10> snag.cnri.reston..

>>>

Note that read_all() won't read until eof -- it just reads some data
-- but it guarantees to read at least one byte unless EOF is hit.

It is possible to pass a Telnet object to a selector in order to wait until
more data is available.  Note that in this case, read_eager() may return b''
even if there was data on the socket, because the protocol negotiation may have
eaten the data.  This is why EOFError is needed in some cases to distinguish
between "no data" and "connection closed" (since the socket also appears ready
for reading when it is closed).

To do:
- option negotiation
- timeout should be intrinsic to the connection object instead of an
  option on one of the read calls only

�N)�	monotonic�Telnet�������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1����PollSelectorc@seZdZdZddejfdd�Zdejfdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zd<dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd=d6d7�Zd8d9�Z d:d;�Z!dS)>ra�Telnet interface class.

    An instance of this class represents a connection to a telnet
    server.  The instance is initially not connected; the open()
    method must be used to establish a connection.  Alternatively, the
    host name and optional port number can be passed to the
    constructor, too.

    Don't try to reopen an already connected instance.

    This class has many read_*() methods.  Note that some of them
    raise EOFError when the end of the connection is read, because
    they can return an empty string for other reasons.  See the
    individual doc strings.

    read_until(expected, [timeout])
        Read until the expected string has been seen, or a timeout is
        hit (default is no timeout); may block.

    read_all()
        Read all data until EOF; may block.

    read_some()
        Read at least one byte or EOF; may block.

    read_very_eager()
        Read all data available already queued or on the socket,
        without blocking.

    read_eager()
        Read either data already queued or some data available on the
        socket, without blocking.

    read_lazy()
        Read all data in the raw queue (processing it first), without
        doing any socket I/O.

    read_very_lazy()
        Reads all data in the cooked queue, without doing any socket
        I/O.

    read_sb_data()
        Reads available data between SB ... SE sequence. Don't block.

    set_option_negotiation_callback(callback)
        Each time a telnet option is read on the input flow, this callback
        (if set) is called with the following parameters :
        callback(telnet socket, command, option)
            option will be chr(0) when there is no option.
        No other action is done afterwards by telnetlib.

    NrcCsht|_||_||_||_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
|dk	rd|�|||�dS)z�Constructor.

        When called without arguments, create an unconnected instance.
        With a hostname argument, it connects the instance; port number
        and timeout are optional.
        N�r)�
DEBUGLEVEL�
debuglevel�host�port�timeout�sock�rawq�irawq�cookedq�eof�iacseq�sb�sbdataq�option_callback�open��selfrLrMrN�r[�!/usr/lib64/python3.8/telnetlib.py�__init__�szTelnet.__init__cCsFd|_|st}||_||_||_t�d|||�t�||f|�|_	dS)z�Connect to a host.

        The optional second argument is the port number, which
        defaults to the standard telnet port (23).

        Don't try to reopen an already connected instance.
        rztelnetlib.Telnet.openN)
rS�TELNET_PORTrLrMrN�sys�audit�socketZcreate_connectionrOrYr[r[r\rX�szTelnet.opencCs|��dS)z#Destructor -- close the connection.N��close�rZr[r[r\�__del__�szTelnet.__del__cGs@|jdkr<td|j|jfdd�|r4t||�nt|�dS)z�Print a debug message, when the debug level is > 0.

        If extra arguments are present, they are substituted in the
        message using the standard string formatting operator.

        rzTelnet(%s,%s):� )�endN)rK�printrLrM)rZ�msg�argsr[r[r\ri�s

z
Telnet.msgcCs
||_dS)zhSet the debug level.

        The higher it is, the more debug output you get (on sys.stdout).

        N)rK)rZrKr[r[r\�set_debuglevel�szTelnet.set_debuglevelcCs.|j}d|_d|_d|_d|_|r*|��dS)zClose the connection.NTrIr)rOrSrTrUrc)rZrOr[r[r\rcszTelnet.closecCs|jS)z)Return the socket object used internally.)rOrdr[r[r\�
get_socketszTelnet.get_socketcCs
|j��S)z9Return the fileno() of the socket object used internally.)rO�filenordr[r[r\rmsz
Telnet.filenocCsBt|kr|�ttt�}t�d||�|�d|�|j�|�dS)z�Write a string to the socket, doubling any IAC characters.

        Can block if the connection is blocked.  May raise
        OSError if the connection is closed.

        ztelnetlib.Telnet.writezsend %rN)�IAC�replacer_r`rirO�sendall)rZ�bufferr[r[r\�writes
zTelnet.writec
Cs*t|�}|��|j�|�}|dkrN||}|jd|�}|j|d�|_|S|dk	r`t�|}t���}|�|tj�|j	�s|�
|�r�tdt|j�|�}|��|��|j�||�}|dkr�||}|jd|�}|j|d�|_|W5QR�S|dk	rv|t�}|dkrv�qqvW5QRX|�
�S)aRead until a given string is encountered or until timeout.

        When no match is found, return whatever is available instead,
        possibly the empty string.  Raise EOFError if the connection
        is closed and no cooked data is available.

        rN)�len�process_rawqrR�find�_time�_TelnetSelector�register�	selectors�
EVENT_READrS�select�max�	fill_rawq�read_very_lazy)rZ�matchrN�n�i�buf�deadline�selectorr[r[r\�
read_until&s8


zTelnet.read_untilcCs0|��|js |��|��q|j}d|_|S)z7Read all data until EOF; block until connection closed.rI)rtrSr}rR�rZr�r[r[r\�read_allKs
zTelnet.read_allcCs6|��|js&|js&|��|��q|j}d|_|S)z�Read at least one byte of cooked data unless EOF is hit.

        Return b'' if EOF is hit.  Block if no data is immediately
        available.

        rI)rtrRrSr}r�r[r[r\�	read_someUs
zTelnet.read_somecCs0|��|js(|��r(|��|��q|��S)aRead everything that's possible without blocking in I/O (eager).

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrS�
sock_availr}r~rdr[r[r\�read_very_eagerds

zTelnet.read_very_eagercCs6|��|js.|js.|��r.|��|��q|��S)z�Read readily available data.

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrRrSr�r}r~rdr[r[r\�
read_eagerrs

zTelnet.read_eagercCs|��|��S)aProcess and return data that's already in the queues (lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block
        unless in the midst of an IAC sequence.

        )rtr~rdr[r[r\�	read_lazy�szTelnet.read_lazycCs(|j}d|_|s$|jr$|js$td��|S)z�Return any data available in the cooked queue (very lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block.

        rIztelnet connection closed)rRrSrP�EOFErrorr�r[r[r\r~�s
zTelnet.read_very_lazycCs|j}d|_|S)aReturn any data available in the SB ... SE queue.

        Return b'' if no SB ... SE available. Should only be called
        after seeing a SB or SE command. When a new SB command is
        found, old unread SB data will be discarded. Don't block.

        rI)rVr�r[r[r\�read_sb_data�szTelnet.read_sb_datacCs
||_dS)zIProvide a callback function called after each receipt of a telnet option.N)rW)rZ�callbackr[r[r\�set_option_negotiation_callback�sz&Telnet.set_option_negotiation_callbackcCsRddg}�z|j�r|��}|jsf|tkr,q|dkr6q|tkrV||j|||j<qn|j|7_qt|j�dk�r$|ttt	t
fkr�|j|7_qd|_|tkr�||j|||j<nh|tkr�d|_d|_n&|t
kr�d|_|j|d|_d|d<|j�r|�|j|t�n|�dt|��qt|j�dkr|jdd�}d|_|}|ttfk�r�|�d|tk�rnd�ppd	t|��|j�r�|�|j||�n|j�tt
|�q|t	t
fkr|�d|t	k�r�d
�p�dt|��|j�r�|�|j||�q|j�tt|�qWn"tk
�r,d|_d|_YnX|j|d|_|j|d|_dS)
z�Transfer from raw queue to cooked queue.

        Set self.eof when connection is closed.  Don't block unless in
        the midst of an IAC sequence.

        rI�rrzIAC %d not recognizedrz	IAC %s %d�DO�DONT�WILL�WONTN)rP�rawq_getcharrT�theNULLrnrUrsr�r�r�r��SBrV�SErWrO�NOOPTri�ordrpr�rR)rZr��c�cmd�optr[r[r\rt�sp��zTelnet.process_rawqcCsZ|js|��|jrt�|j|j|jd�}|jd|_|jt|j�krVd|_d|_|S)z�Get next char from raw queue.

        Block if no data is immediately available.  Raise EOFError
        when connection is closed.

        rrIr)rPr}rSr�rQrs)rZr�r[r[r\r��szTelnet.rawq_getcharcCsL|jt|j�krd|_d|_|j�d�}|�d|�||_|j||_dS)z�Fill raw queue from exactly one recv() system call.

        Block if no data is immediately available.  Set self.eof when
        connection is closed.

        rIr�2zrecv %rN)rQrsrPrOZrecvrirSr�r[r[r\r}szTelnet.fill_rawqc
Cs:t��*}|�|tj�t|�d��W5QR�SQRXdS)z-Test whether data is available on the socket.rN)rwrxryrz�boolr{)rZr�r[r[r\r�szTelnet.sock_availc
Cs�tjdkr|��dSt���}|�|tj�|�tjtj�|��D]�\}}|j	|kr�z|�
�}Wn*tk
r�td�YW5QR�dSX|r�tj
�|�d��tj
��qD|j	tjkrDtj���d�}|s�W5QR�dS|�|�qDq<W5QRXdS)z9Interaction function, emulates a very dumb telnet client.Zwin32N�(*** Connection closed by remote host ***�ascii)r_�platform�mt_interactrwrxryrz�stdinr{Zfileobjr�r�rh�stdoutrr�decode�flush�readline�encode)rZr��keyZevents�text�liner[r[r\�interacts*

zTelnet.interactcCs<ddl}|�|jd�tj��}|s&q8|�|�d��qdS)z$Multithreaded version of interact().rNr[r�)�_thread�start_new_thread�listenerr_r�r�rrr�)rZr�r�r[r[r\r�3s
zTelnet.mt_interactcCsTz|��}Wntk
r*td�YdSX|rDtj�|�d��qtj��qdS)z>Helper for mt_interact() -- this executes in the other thread.r�Nr�)r�r�rhr_r�rrr�r�)rZ�datar[r[r\r�=szTelnet.listenerc
CsTd}|dd�}tt|��}|D]0}t||d�s |s>ddl}|�||�||<q |dk	rdt�|}t���}|�|tj	�|j
�s&|��|D]X}||�|j
�}|r�|��}	|j
d|	�}
|j
|	d�|_
|||
fW5QR�Sq�|dk	�r|�|�}|t�}|�s|dkrz�q&nqz|��qzW5QRX|��}
|
�sJ|j
�rJt�dd|
fS)a�Read until one from a list of a regular expressions matches.

        The first argument is a list of regular expressions, either
        compiled (re.Pattern instances) or uncompiled (strings).
        The optional second argument is a timeout, in seconds; default
        is no timeout.

        Return a tuple of three items: the index in the list of the
        first regular expression that matches; the re.Match object
        returned; and the text read up till and including the match.

        If EOF is read and no text was read, raise EOFError.
        Otherwise, when nothing matches, return (-1, None, text) where
        text is the text received so far (may be the empty string if a
        timeout happened).

        If a regular expression ends with a greedy match (e.g. '.*')
        or if more than one expression can match the same input, the
        results are undeterministic, and may depend on the I/O timing.

        N�searchr���)�rangers�hasattr�re�compilervrwrxryrzrSrtr�rRrgr{r}r~r�)rZ�listrNr��indicesr�r�r��m�er�Zreadyr[r[r\�expectJsB



z
Telnet.expectcCs|S�Nr[rdr[r[r\�	__enter__�szTelnet.__enter__cCs|��dSr�rb)rZ�type�value�	tracebackr[r[r\�__exit__�szTelnet.__exit__)N)N)"�__name__�
__module__�__qualname__�__doc__raZ_GLOBAL_DEFAULT_TIMEOUTr]rXrerirkrcrlrmrrr�r�r�r�r�r�r~r�r�rtr�r}r�r�r�r�r�r�r�r[r[r[r\r�s>5�


%

H

8c	Cs�d}tjdd�r2tjddkr2|d}tjd=qd}tjdd�rNtjd}d}tjdd�r�tjd}zt|�}Wn tk
r�t�|d�}YnXt��(}|�|�|j||dd	�|�	�W5QRXdS)
z�Test program for telnetlib.

    Usage: python telnetlib.py [-d] ... [host [port]]

    Default host is localhost; default port is 23.

    rrNz-dZ	localhostrZtcpg�?)rN)
r_�argv�int�
ValueErrorraZ
getservbynamerrkrXr�)rKrLrMZportstrZtnr[r[r\�test�s$



r��__main__)Zr�r_rary�timerrv�__all__rJr^�bytesrnr�r�r�r�r�r�ZNOPZDMZBRKZIPZAOZAYTZECZELZGAr�ZBINARYZECHOZRCPZSGAZNAMSZSTATUSZTMZRCTEZNAOLZNAOPZNAOCRDZNAOHTSZNAOHTDZNAOFFDZNAOVTSZNAOVTDZNAOLFDZXASCIIZLOGOUTZBMZDETZSUPDUPZSUPDUPOUTPUTZSNDLOCZTTYPEZEORZTUIDZOUTMRKZTTYLOCZVT3270REGIMEZX3PADZNAWSZTSPEEDZLFLOWZLINEMODEZXDISPLOCZOLD_ENVIRONZAUTHENTICATIONZENCRYPTZNEW_ENVIRONZTN3270EZXAUTH�CHARSETZRSPZCOM_PORT_OPTIONZSUPPRESS_LOCAL_ECHOZTLSZKERMITZSEND_URLZ	FORWARD_XZPRAGMA_LOGONZ
SSPI_LOGONZPRAGMA_HEARTBEATZEXOPLr�r�rHrwZSelectSelectorrr�r�r[r[r[r\�<module>s�#








































































re.cpython-38.opt-1.pyc000064400000034130151450073350010545 0ustar00U

e5d�=�@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddddddddddddddddddgZd ZGd!d"�d"ej	�Z
e��e
j
�ejZd@d#d�ZdAd$d�ZdBd%d�ZdCd&d�ZdDd'd�ZdEd(d�ZdFd)d	�ZdGd*d
�ZdHd+d�Zd,d�ZdId-d
�Zd.d/�d0D�Zd1d�Zee�d2d��Zee�d2d��d2��ZiZd3Z d4d5�Z!e�"e �d6d7��Z#d8d9�Z$d:d;�Z%ddl&Z&d<d=�Z'e&�(ee'e!�Gd>d?�d?�Z)dS)Ja�Support for regular expressions (RE).

This module provides regular expression matching operations similar to
those found in Perl.  It supports both 8-bit and Unicode strings; both
the pattern and the strings being processed can contain null bytes and
characters outside the US ASCII range.

Regular expressions can contain both special and ordinary characters.
Most ordinary characters, like "A", "a", or "0", are the simplest
regular expressions; they simply match themselves.  You can
concatenate ordinary characters, so last matches the string 'last'.

The special characters are:
    "."      Matches any character except a newline.
    "^"      Matches the start of the string.
    "$"      Matches the end of the string or just before the newline at
             the end of the string.
    "*"      Matches 0 or more (greedy) repetitions of the preceding RE.
             Greedy means that it will match as many repetitions as possible.
    "+"      Matches 1 or more (greedy) repetitions of the preceding RE.
    "?"      Matches 0 or 1 (greedy) of the preceding RE.
    *?,+?,?? Non-greedy versions of the previous three special characters.
    {m,n}    Matches from m to n repetitions of the preceding RE.
    {m,n}?   Non-greedy version of the above.
    "\\"     Either escapes special characters or signals a special sequence.
    []       Indicates a set of characters.
             A "^" as the first character indicates a complementing set.
    "|"      A|B, creates an RE that will match either A or B.
    (...)    Matches the RE inside the parentheses.
             The contents can be retrieved or matched later in the string.
    (?aiLmsux) The letters set the corresponding flags defined below.
    (?:...)  Non-grouping version of regular parentheses.
    (?P<name>...) The substring matched by the group is accessible by name.
    (?P=name)     Matches the text matched earlier by the group named name.
    (?#...)  A comment; ignored.
    (?=...)  Matches if ... matches next, but doesn't consume the string.
    (?!...)  Matches if ... doesn't match next.
    (?<=...) Matches if preceded by ... (must be fixed length).
    (?<!...) Matches if not preceded by ... (must be fixed length).
    (?(id/name)yes|no) Matches yes pattern if the group with id/name matched,
                       the (optional) no pattern otherwise.

The special sequences consist of "\\" and a character from the list
below.  If the ordinary character is not on the list, then the
resulting RE will match the second character.
    \number  Matches the contents of the group of the same number.
    \A       Matches only at the start of the string.
    \Z       Matches only at the end of the string.
    \b       Matches the empty string, but only at the start or end of a word.
    \B       Matches the empty string, but not at the start or end of a word.
    \d       Matches any decimal digit; equivalent to the set [0-9] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode digits.
    \D       Matches any non-digit character; equivalent to [^\d].
    \s       Matches any whitespace character; equivalent to [ \t\n\r\f\v] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode whitespace characters.
    \S       Matches any non-whitespace character; equivalent to [^\s].
    \w       Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]
             in bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the
             range of Unicode alphanumeric characters (letters plus digits
             plus underscore).
             With LOCALE, it will match the set [0-9_] plus characters defined
             as letters for the current locale.
    \W       Matches the complement of \w.
    \\       Matches a literal backslash.

This module exports the following functions:
    match     Match a regular expression pattern to the beginning of a string.
    fullmatch Match a regular expression pattern to all of a string.
    search    Search a string for the presence of a pattern.
    sub       Substitute occurrences of a pattern found in a string.
    subn      Same as sub, but also return the number of substitutions made.
    split     Split a string by the occurrences of a pattern.
    findall   Find all occurrences of a pattern in a string.
    finditer  Return an iterator yielding a Match object for each match.
    compile   Compile a pattern into a Pattern object.
    purge     Clear the regular expression cache.
    escape    Backslash all non-alphanumerics in a string.

Each function other than purge and escape can take an optional 'flags' argument
consisting of one or more of the following module constants, joined by "|".
A, L, and U are mutually exclusive.
    A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
                   match the corresponding ASCII character categories
                   (rather than the whole Unicode categories, which is the
                   default).
                   For bytes patterns, this flag is the only available
                   behaviour and needn't be specified.
    I  IGNORECASE  Perform case-insensitive matching.
    L  LOCALE      Make \w, \W, \b, \B, dependent on the current locale.
    M  MULTILINE   "^" matches the beginning of lines (after a newline)
                   as well as the string.
                   "$" matches the end of lines (before a newline) as well
                   as the end of the string.
    S  DOTALL      "." matches any character at all, including the newline.
    X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.
    U  UNICODE     For compatibility only. Ignored for string patterns (it
                   is the default), and forbidden for bytes patterns.

This module also defines an exception 'error'.

�N�match�	fullmatch�search�sub�subn�split�findall�finditer�compile�purge�template�escape�error�Pattern�Match�A�I�L�M�S�X�U�ASCII�
IGNORECASE�LOCALE�	MULTILINE�DOTALL�VERBOSE�UNICODEz2.2.1c@speZdZejZZejZZ	ej
ZZej
ZZejZZejZZejZZejZZejZdd�Zej Z dS)�	RegexFlagcCs�|jdk	rd|j��S|j}g}|dk}|r2|}|jD],}||j@r8||jM}|�d|j���q8|rx|�t|��d�|�}|r�t|�dkr�d|�d�}n
d|��}|S)Nzre.r�|�z~(�)�~)�_name_�_value_�	__class__�append�hex�join�len)�self�value�members�negative�m�res�r1�/usr/lib64/python3.8/re.py�__repr__�s&




zRegexFlag.__repr__N)!�__name__�
__module__�__qualname__�sre_compile�SRE_FLAG_ASCIIrr�SRE_FLAG_IGNORECASErr�SRE_FLAG_LOCALErr�SRE_FLAG_UNICODErr�SRE_FLAG_MULTILINErr�SRE_FLAG_DOTALLrr�SRE_FLAG_VERBOSErr�SRE_FLAG_TEMPLATE�TEMPLATE�T�SRE_FLAG_DEBUG�DEBUGr3�object�__str__r1r1r1r2r�s







rcCst||��|�S)zqTry to apply the pattern at the start of the string, returning
    a Match object, or None if no match was found.)�_compiler��pattern�string�flagsr1r1r2r�scCst||��|�S)zkTry to apply the pattern to all of the string, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|�S)ztScan through string looking for a match to the pattern, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|||�S)aZReturn the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in string by the
    replacement repl.  repl can be either a string or a callable;
    if a string, backslash escapes in it are processed.  If it is
    a callable, it's passed the Match object and must return
    a replacement string to be used.)rFr�rH�replrI�countrJr1r1r2r�scCst||��|||�S)a�Return a 2-tuple containing (new_string, number).
    new_string is the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in the source
    string by the replacement repl.  number is the number of
    substitutions that were made. repl can be either a string or a
    callable; if a string, backslash escapes in it are processed.
    If it is a callable, it's passed the Match object and must
    return a replacement string to be used.)rFrrKr1r1r2r�s	cCst||��||�S)a�Split the source string by the occurrences of the pattern,
    returning a list containing the resulting substrings.  If
    capturing parentheses are used in pattern, then the text of all
    groups in the pattern are also returned as part of the resulting
    list.  If maxsplit is nonzero, at most maxsplit splits occur,
    and the remainder of the string is returned as the final element
    of the list.)rFr)rHrI�maxsplitrJr1r1r2r�scCst||��|�S)aReturn a list of all non-overlapping matches in the string.

    If one or more capturing groups are present in the pattern, return
    a list of groups; this will be a list of tuples if the pattern
    has more than one group.

    Empty matches are included in the result.)rFrrGr1r1r2r�scCst||��|�S)z�Return an iterator over all non-overlapping matches in the
    string.  For each match, the iterator returns a Match object.

    Empty matches are included in the result.)rFr	rGr1r1r2r	�scCs
t||�S)zACompile a regular expression pattern, returning a Pattern object.)rF�rHrJr1r1r2r
�scCst��t��dS)z#Clear the regular expression cachesN)�_cache�clear�
_compile_repl�cache_clearr1r1r1r2r�scCst||tB�S)z6Compile a template pattern, returning a Pattern object)rFrArOr1r1r2rscCsi|]}|dt|��qS)�\)�chr)�.0�ir1r1r2�
<dictcomp>srXs()[]{}?*+-|^$\.&~# 	

cCs2t|t�r|�t�St|d�}|�t��d�SdS)z0
    Escape special characters in a string.
    �latin1N)�
isinstance�str�	translate�_special_chars_map�encode)rHr1r1r2r
s


�ic
Cs�t|t�r|j}ztt|�||fWStk
r8YnXt|t�rT|rPtd��|St�	|�sft
d��t�||�}|t@s�t
t�tkr�ztttt��=Wntttfk
r�YnX|tt|�||f<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled pattern)rZrr,rP�type�KeyErrorr�
ValueErrorr7�isstring�	TypeErrorr
rCr*�	_MAXCACHE�next�iter�
StopIteration�RuntimeError)rHrJ�pr1r1r2rF!s.

�
rFcCst�||�S�N)�	sre_parse�parse_template)rLrHr1r1r2rR;srRcCst�||�}t�||�Srk)rlrm�expand_template)rHrrr1r1r2�_expand@srocCs>t||�}|ds.t|d�dkr.|ddS|fdd�}|S)Nrr!cSst�||�Srk)rlrn)rrr1r1r2�filterKsz_subx.<locals>.filter)rRr*)rHrrpr1r1r2�_subxEs

rqcCst|j|jffSrk)rFrHrJ)rjr1r1r2�_pickleSsrrc@seZdZddd�Zdd�ZdS)�Scannerrc
Cs�ddlm}m}t|t�r |j}||_g}t��}||_	|D]H\}}|�
�}	|�t�|||	ddt�
||�ffg��|�|	|d�q<t�||d|ffg�}t�|�|_dS)Nr)�BRANCH�
SUBPATTERN���)�
sre_constantsrtrurZrr,�lexiconrl�StaterJ�	opengroupr'�
SubPattern�parse�
closegroupr7r
�scanner)
r+rxrJrtrurj�s�phrase�action�gidr1r1r2�__init__\s

�zScanner.__init__c	Cs�g}|j}|j�|�j}d}|�}|s(q�|��}||kr:q�|j|jdd}t|�rj||_|||���}|dk	rz||�|}q|||d�fS)Nrr!)r'r~r�endrx�	lastindex�callable�group)	r+rI�resultr'rrWr/�jr�r1r1r2�scanms$zScanner.scanN)r)r4r5r6r�r�r1r1r1r2rs[s
rs)r)r)r)rr)rr)rr)r)r)r)r)*�__doc__�enumr7rl�	functools�_locale�ImportError�__all__�__version__�IntFlagr�globals�update�__members__rrrrrrrrr	r
rrr]r
r`rrrPrerF�	lru_cacherRrorq�copyregrr�picklersr1r1r1r2�<module>s�k
�#



	







	

rlcompleter.cpython-38.opt-2.pyc000064400000006026151450073350012473 0ustar00U

e5d��@s~ddlZddlZddlZdgZGdd�d�Zdd�ZzddlZWnek
rXdZYn"Xe�	e�j
�e�dd��d	ZdS)
�N�	Completerc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs6|rt|t�std��|dkr&d|_nd|_||_dS)Nznamespace must be a dictionary�r)�
isinstance�dict�	TypeError�use_main_ns�	namespace)�selfr�r
�#/usr/lib64/python3.8/rlcompleter.py�__init__'szCompleter.__init__cCs�|jrtj|_|��sB|dkr>tr8t�d�t��dSdSndS|dkrld|kr`|�	|�|_
n|�|�|_
z|j
|WStk
r�YdSXdS)Nr�	��.)
r�__main__�__dict__r�strip�_readline_available�readlineZinsert_textZ	redisplay�attr_matches�matches�global_matches�
IndexError)r	�text�stater
r
r�completeBs$
zCompleter.completecCst|�r|d}|S)N�()�callable)r	�val�wordr
r
r�_callable_postfixaszCompleter._callable_postfixc	Cs�ddl}g}dh}t|�}|jD]J}|d|�|kr |�|�|dkrP|d}n|dkr`|d}|�|�q |jtjfD]J}|��D]<\}}|d|�|kr�||kr�|�|�|�|�	||��q�qx|S)Nr�__builtins__>�try�finally�:>�break�None�pass�continue�False�True�else� )
�keyword�len�kwlist�add�appendr�builtinsr�itemsr )	r	rr-r�seen�nrZnspacerr
r
rrfs$



zCompleter.global_matchesc	Cshddl}|�d|�}|sgS|�dd�\}}zt||j�}Wntk
rTgYSXtt|��}|�d�t	|d�r�|�
d�|�t|j
��g}t|�}	|dkr�d}
n|dkr�d	}
nd}
|D]t}|d|	�|kr�|
r�|d|	d�|
ks�d
||f}zt||�}
Wntk
�rYnX|�|
|�}|�|�q�|�s\|
�sF�q\|
dk�rVd	}
q�d}
q�|��|S)Nrz(\w+(\.\w+)*)\.(\w*)r�r!�	__class__r�_�__z%s.%s)�re�match�group�evalr�	Exception�set�dir�discard�hasattrr0�update�get_class_membersr7r.�getattrr r1�sort)r	rr:�m�expr�attrZ
thisobjectZwordsrr5Znoprefixrr;rr
r
rr�sR



��
zCompleter.attr_matches)N)�__name__�
__module__�__qualname__rrr rrr
r
r
rr&s

cCs.t|�}t|d�r*|jD]}|t|�}q|S)N�	__bases__)r@rBrMrD)�klassZret�baser
r
rrD�s


rDFcCs
t�d�S)N)r�
set_completerr
r
r
r�<lambda>��rQT)�atexitr2r�__all__rrDr�ImportErrorrrPr�registerr
r
r
r�<module> s
sre_constants.cpython-38.opt-2.pyc000064400000013460151450073350013030 0ustar00U

e5d��@s@dZddlmZmZGdd�de�ZGdd�de�Zeed�Zdd	�Zed
�Z	e	dd�=ed
�Z
ed�Zee
eeiZeeeeiZeeeeiZeeeeiZeeeeiZ ee!ee"iZ#e$e$e%e%e&e&e'e'e(e)e*e+e,e,e-e-iZ.e$e/e%e0e&e1e'e2e(e3e*e4e,e5e-e6iZ7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCeDdk�r<dd�ZEeFdd���ZGeG�Hd�eG�Hde�eEeGe	d�eEeGe
d �eEeGed �eG�Hd!e8�eG�Hd"e9�eG�Hd#e:�eG�Hd$e;�eG�Hd%e<�eG�Hd&e=�eG�Hd'e>�eG�Hd(e?�eG�Hd)e@�eG�Hd*eA�eG�Hd+eB�eG�Hd,eC�W5QRXeId-�dS).i��3�)�	MAXREPEAT�	MAXGROUPScs"eZdZdZd�fdd�	Z�ZS)�error�reNcs�||_||_||_|dk	r�|dk	r�d||f}t|t�r>d}nd}|�|d|�d|_||�|d|�|_||kr�d||j|jf}nd|_|_t	��
|�dS)Nz%s at position %d�
�
r�z%s (line %d, column %d))�msg�pattern�pos�
isinstance�str�count�lineno�rfind�colno�super�__init__)�selfr	r
r�newline��	__class__��%/usr/lib64/python3.8/sre_constants.pyr%s
zerror.__init__)NN)�__name__�
__module__�__qualname__r�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�_NamedIntConstantcstt|��||�}||_|S�N)rr�__new__�name)�cls�valuer!rrrrr 9sz_NamedIntConstant.__new__cCs|jSr�r!)rrrr�__repr__>sz_NamedIntConstant.__repr__)rrrr r%rrrrrr8srrcCs8|����}dd�t|�D�}t��dd�|D��|S)NcSsg|]\}}t||��qSr)r)�.0�ir!rrr�
<listcomp>Esz_makecodes.<locals>.<listcomp>cSsi|]}|j|�qSrr$)r&�itemrrr�
<dictcomp>Fsz_makecodes.<locals>.<dictcomp>)�strip�split�	enumerate�globals�update)�names�itemsrrr�
_makecodesCsr2az
    FAILURE SUCCESS

    ANY ANY_ALL
    ASSERT ASSERT_NOT
    AT
    BRANCH
    CALL
    CATEGORY
    CHARSET BIGCHARSET
    GROUPREF GROUPREF_EXISTS
    IN
    INFO
    JUMP
    LITERAL
    MARK
    MAX_UNTIL
    MIN_UNTIL
    NOT_LITERAL
    NEGATE
    RANGE
    REPEAT
    REPEAT_ONE
    SUBPATTERN
    MIN_REPEAT_ONE

    GROUPREF_IGNORE
    IN_IGNORE
    LITERAL_IGNORE
    NOT_LITERAL_IGNORE

    GROUPREF_LOC_IGNORE
    IN_LOC_IGNORE
    LITERAL_LOC_IGNORE
    NOT_LITERAL_LOC_IGNORE

    GROUPREF_UNI_IGNORE
    IN_UNI_IGNORE
    LITERAL_UNI_IGNORE
    NOT_LITERAL_UNI_IGNORE
    RANGE_UNI_IGNORE

    MIN_REPEAT MAX_REPEAT
���Nz�
    AT_BEGINNING AT_BEGINNING_LINE AT_BEGINNING_STRING
    AT_BOUNDARY AT_NON_BOUNDARY
    AT_END AT_END_LINE AT_END_STRING

    AT_LOC_BOUNDARY AT_LOC_NON_BOUNDARY

    AT_UNI_BOUNDARY AT_UNI_NON_BOUNDARY
a�
    CATEGORY_DIGIT CATEGORY_NOT_DIGIT
    CATEGORY_SPACE CATEGORY_NOT_SPACE
    CATEGORY_WORD CATEGORY_NOT_WORD
    CATEGORY_LINEBREAK CATEGORY_NOT_LINEBREAK

    CATEGORY_LOC_WORD CATEGORY_LOC_NOT_WORD

    CATEGORY_UNI_DIGIT CATEGORY_UNI_NOT_DIGIT
    CATEGORY_UNI_SPACE CATEGORY_UNI_NOT_SPACE
    CATEGORY_UNI_WORD CATEGORY_UNI_NOT_WORD
    CATEGORY_UNI_LINEBREAK CATEGORY_UNI_NOT_LINEBREAK
r����� �@���__main__cCs*t|�}|D]}|�d|||f�qdS)Nz#define %s_%s %d
)�sorted�write)�f�d�prefixr1r)rrr�dump�srBzsre_constants.h�wao/*
 * Secret Labs' Regular Expression Engine
 *
 * regular expression matching engine
 *
 * NOTE: This file is generated by sre_constants.py.  If you need
 * to change anything in here, edit sre_constants.py and run it.
 *
 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
 *
 * See the _sre.c file for information on usage and redistribution.
 */

z#define SRE_MAGIC %d
ZSRE_OPZSREz#define SRE_FLAG_TEMPLATE %d
z#define SRE_FLAG_IGNORECASE %d
z#define SRE_FLAG_LOCALE %d
z#define SRE_FLAG_MULTILINE %d
z#define SRE_FLAG_DOTALL %d
z#define SRE_FLAG_UNICODE %d
z#define SRE_FLAG_VERBOSE %d
z#define SRE_FLAG_DEBUG %d
z#define SRE_FLAG_ASCII %d
z#define SRE_INFO_PREFIX %d
z#define SRE_INFO_LITERAL %d
z#define SRE_INFO_CHARSET %d
Zdone)J�MAGIC�_srerr�	Exceptionr�intrr2�OPCODES�ATCODES�CHCODES�LITERAL�LITERAL_IGNORE�NOT_LITERAL�NOT_LITERAL_IGNORE�	OP_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�OP_LOCALE_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�OP_UNICODE_IGNORE�AT_BEGINNINGZAT_BEGINNING_LINE�AT_ENDZAT_END_LINE�AT_MULTILINEZAT_BOUNDARYZAT_LOC_BOUNDARYZAT_NON_BOUNDARYZAT_LOC_NON_BOUNDARY�	AT_LOCALEZAT_UNI_BOUNDARYZAT_UNI_NON_BOUNDARY�
AT_UNICODEZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_LOC_WORDZCATEGORY_NOT_WORDZCATEGORY_LOC_NOT_WORDZCATEGORY_LINEBREAKZCATEGORY_NOT_LINEBREAK�	CH_LOCALEZCATEGORY_UNI_DIGITZCATEGORY_UNI_NOT_DIGITZCATEGORY_UNI_SPACEZCATEGORY_UNI_NOT_SPACEZCATEGORY_UNI_WORDZCATEGORY_UNI_NOT_WORDZCATEGORY_UNI_LINEBREAKZCATEGORY_UNI_NOT_LINEBREAK�
CH_UNICODE�SRE_FLAG_TEMPLATE�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALL�SRE_FLAG_UNICODE�SRE_FLAG_VERBOSE�SRE_FLAG_DEBUG�SRE_FLAG_ASCII�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSETrrB�openr?r>�printrrrr�<module>s�!	
,
��������

enum.cpython-38.opt-2.pyc000064400000051062151450073350011107 0ustar00U

e5d���@s�ddlZddlmZmZddddddd	gZd
d�Zdd
�Zdd�Zdd�Ze	�Z
Gdd�d�ZGdd�de�Z
dZGdd�de�ZGdd�ded�ZGdd�dee�Zdd�ZGdd�de�ZGdd�dee�Zdd�Zdd	�Zd d!�Zd"d#�ZdS)$�N)�MappingProxyType�DynamicClassAttribute�EnumMeta�Enum�IntEnum�Flag�IntFlag�auto�uniquecCst|d�pt|d�pt|d�S)N�__get__�__set__�
__delete__)�hasattr)�obj�r�/usr/lib64/python3.8/enum.py�_is_descriptors

��rcCsLt|�dkoJ|dd�|dd�ko.dknoJ|ddkoJ|ddkS)N������__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dkoJ|d|dko&dknoJ|dd�dkoJ|dd�dkS)Nrr���r�rrrrrr�
_is_sunder!s���r cCsdd�}||_d|_dS)NcSstd|��dS)Nz%r cannot be pickled)�	TypeError��self�protorrr�_break_on_call_reduce0sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>)�
__reduce_ex__�
__module__)�clsr%rrr�_make_class_unpicklable,sr)c@seZdZeZdS)r	N)�__name__r'�__qualname__�
_auto_null�valuerrrrr	6scs(eZdZ�fdd�Z�fdd�Z�ZS)�	_EnumDictcs&t���g|_g|_g|_d|_dS)NF)�super�__init__�
_member_names�_last_values�_ignore�_auto_called�r#��	__class__rrr0Ds

z_EnumDict.__init__csdt|�r�|dkrtd��|dkr<|jr.td��t|d|�nV|dkr�t|t�r`|�dd���}nt	|�}||_
t|�t|j�@}|r�td	|f��n�t
|�r�|d
kr�d}n�||jkr�td|��n�||j
kr�n�t|��sR||kr�td
|||f��t|t��r:|jtk�r4|�|dt|j�|jdd��|_d|_|j}|j�|�|j�|�t��||�dS)N)�_order_�_create_pseudo_member_�_generate_next_value_�	_missing_�_ignore_z(_names_ are reserved for future Enum user:z4_generate_next_value_ must be defined before members�_generate_next_valuer<�,� z-_ignore_ cannot specify already set names: %r�	__order__r8zAttempted to reuse key: %rz%r already defined as: %rrT)r �
ValueErrorr4r!�setattr�
isinstance�str�replace�split�listr3�setr1rrr	r-r,r=rr2�appendr/�__setitem__)r#�keyr-�alreadyr6rrrJKsT	
��


�z_EnumDict.__setitem__)r*r'r+r0rJ�
__classcell__rrr6rr.=sr.cs�eZdZedd��Z�fdd�Zdd�Zd.ddddd	�d
d�Zdd
�Z�fdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zedd��Zdd�Zdd�Z�fd d!�Zddddd	�d"d#�Zd/d$d%�Zd&d'�Zed(d)��Zed*d+��Zed,d-��Z�ZS)0rcCs>|�||�t�}|�||�\}}|dk	r:t|dd�|d<|S)Nr:)�_check_for_existing_membersr.�_get_mixins_�getattr)�metaclsr(�bases�	enum_dict�member_type�
first_enumrrr�__prepare__�s�zEnumMeta.__prepare__c	s��dg��d��d}|D]}��|d�q|�||�\�}|���|�\}}}	�fdd��jD�}
�jD]
}�|=qn��dd�}t|
�ddh@}
|
r�td�d�	|
����d	�kr�d
�d	<t
��|||��}g|_i|_
�|_dd�|��D�}i|_d
�k�r2�tk	�r2d}t�fdd�|D���s2t|��jD�]*}|
|}t|t��sZ|f}n|}�tk�rn|f}|	�s�||�}t|d��s�||_n6||f|��}t|d��sƈtk�r�||_n
�|�|_|j}||_||_|j|�|j
��D]"\}}|j|jk�r�|}�q�q�|j�|�||k�r2t|||�||j
|<z||j|<Wntk
�r`YnX�q8dD]V}|�k�r|�qjt||�}t�|d�}t||d�}|dk	�rj||k�rjt|||��qjtdk	�r�|�r�||_ tj|_|dk	�rt|t!��r|�"dd��#�}||jk�rtd��|S)Nr<csi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>�sz$EnumMeta.__new__.<locals>.<dictcomp>r8�mro�zInvalid enum member name: {0}r>�__doc__zAn enumeration.cSs.h|]&}|j��D]\}}t|t�r|�qqSr)�__dict__�itemsrCr)rW�crX�vrrr�	<setcomp>�s

�z#EnumMeta.__new__.<locals>.<setcomp>r&)�__getnewargs_ex__�__getnewargs__r&�
__reduce__c3s|]}|�jkVqdS�N)r^�rW�m)rTrr�	<genexpr>�sz#EnumMeta.__new__.<locals>.<genexpr>�_value_)�__repr__�__str__�
__format__r&r?z#member order does not match _order_)$�
setdefaultrI�poprO�
_find_new_r1rHrA�format�joinr/�__new__�_member_names_�_member_map_�
_member_type_r[�_value2member_map_�object�anyr)rC�tuplerrj�_name_�__objclass__r0r_rBr!rPr�__new_member__rDrErF)rQr(rRrY�ignorerKrUrs�save_new�use_args�enum_membersrr8�
invalid_names�
enum_class�dynamic_attributes�methods�member_namer-�args�enum_member�canonical_member�class_method�
obj_method�enum_methodr6)rYrTrrs�s��

��













zEnumMeta.__new__cCsdS)NTrr5rrr�__bool__3szEnumMeta.__bool__Nr��module�qualname�type�startcCs*|dkr|�||�S|j||||||d�S)Nr�)rs�_create_)r(r-�namesr�r�r�r�rrr�__call__9s�zEnumMeta.__call__cCs:t|t�s$tdt|�j|jjf��t||�o8|j|jkS�Nz3unsupported operand type(s) for 'in': '%s' and '%s')rCrr!r�r+r7r{ru)r(�memberrrr�__contains__^s
��zEnumMeta.__contains__cs(||jkrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)ru�AttributeErrorr*r/�__delattr__)r(�attrr6rrr�es
zEnumMeta.__delattr__cCsddddg|jS)Nr7r]�__members__r'�rtr5rrr�__dir__ls
��zEnumMeta.__dir__cCs@t|�rt|��z|j|WStk
r:t|�d�YnXdSrf)rr�ru�KeyError�r(rrrr�__getattr__rs	zEnumMeta.__getattr__cCs
|j|Srf�rur�rrr�__getitem__�szEnumMeta.__getitem__cs�fdd��jD�S)Nc3s|]}�j|VqdSrfr��rWr�r(rrri�sz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cCs
t|j�Srf)rrtr�rrr�__len__�szEnumMeta.__len__cCs
t|j�Srf)rrur�rrrr��szEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r*r�rrrrk�szEnumMeta.__repr__cs�fdd�t�j�D�S)Nc3s|]}�j|VqdSrfr�r�r�rrri�sz(EnumMeta.__reversed__.<locals>.<genexpr>)�reversedrtr�rr�r�__reversed__�szEnumMeta.__reversed__cs0|j�di�}||krtd��t��||�dS)NruzCannot reassign members.)r^�getr�r/�__setattr__)r(rr-�
member_mapr6rrr��szEnumMeta.__setattr__c
Cs~|j}|dkr|fn||f}|�||�\}	}
|�||�}t|t�rR|�dd���}t|ttf�r�|r�t|dt�r�|g}}g}
t	|�D]8\}}|
�
||||
dd��}|
�|�|�||f�q�|D].}t|t�r�|||}}n|\}}|||<q�|�||||�}|dk�rPzt
�d�jd}Wn*tttfk
�rN}zW5d}~XYnX|dk�rdt|�n||_|dk	�rz||_|S)Nr>r?rrr*)r7rOrVrCrDrErFrzrG�	enumerater:rIrs�sys�	_getframe�	f_globalsr�rAr�r)r'r+)r(�
class_namer�r�r�r�r�rQrRrrUrY�original_names�last_values�countrr-�itemr��member_valuer��excrrrr��s<
 







zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z|jdd�d�Wn$tk
rn|jdd�d�YnX||||d�}t|_|�|j	�|||<|S)Ncs g|]\}}�|�r||f�qSrr)rWrr-��filterrr�
<listcomp>�s�z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>��z$EnumMeta._convert_.<locals>.<lambda>)rKcSs|dS�Nrrr�rrrr��r�)r�)
�varsr��modulesr_�sortr!�_reduce_ex_by_namer&�updater�)r(rr�r��source�module_globals�membersrr�r�	_convert_�s 	

�zEnumMeta._convert_cOs$ddl}|jdtdd�|j||�S)NrzI_convert is deprecated and will be removed in 3.9, use _convert_ instead.r)�
stacklevel)�warnings�warn�DeprecationWarningr�)r(r��kwargsr�rrr�_converts�zEnumMeta._convertcCs<|D]2}|jD]&}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)�__mro__�
issubclassrrtr!r*)r�rR�chain�baserrrrN
s
��z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�s2td��||�p<t}|jrLtd��||fS)Ncs�g}|D]t}d}|jD]d}|tkr&qqt|t�rL|jtk	rz|�|j�qqd|jkrvt|t�rbq|�|pl|�qq|}qqt|�dkr�td�|f��n|r�|dSdSdS)Nrsrz%r: too many data types: %rr)	r�rxr�rrvrIr^rr!)rR�
data_typesr��	candidater��r�rr�_find_data_types*




z.EnumMeta._get_mixins_.<locals>._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rxrr�r!rt)r�rRr�rUrTrr�rrOs
zEnumMeta._get_mixins_c	Cs�|�dd�}|dk	}|dkrpdD]H}||fD].}t||d�}|ddjtjtjhkr,|}q\q,|dk	r qpq tj}|tjkr�d}nd}|||fS)Nrs)r}rsFT)r�rPrsrxr)	rYrTrUrsr�method�possible�targetr�rrrrpCs*�
zEnumMeta._find_new_)N)N)r*r'r+�classmethodrVrsr�r�r�r�r�r�r�r�r��propertyr�rkr�r�r�r�r��staticmethodrNrOrprMrrr6rr�s6

%
	
5
!
	
.c@speZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Ze
dd��Ze
dd��ZdS)rc
Cst|�|kr|Sz|j|WStk
r0Yn:tk
rh|j��D]}|j|krH|YSqHYnXzd}|�|�}Wn*tk
r�}z|}d}W5d}~XYnXzdt	||�r�|W�TSt
d||jf�}|dkr�|dkr�|�n|dk�rtd|j|f�}||_|�W5d}d}XdS)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)
r�rwr�r!ru�valuesrjr;�	ExceptionrCrAr*�__context__)r(r-r�r��result�e�ve_excrrrrsws@


��zEnum.__new__c	Cs6t|�D](}z|dWStk
r.YqXq|S�Nr)r�r!)rr�r�r��
last_valuerrrr:�s	zEnum._generate_next_value_cCsdSrfr)r(r-rrrr;�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r7r*r{rjr5rrrrk�s
�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r7r*r{r5rrrrl�szEnum.__str__cs6�fdd��j��D�dd��jD�}dddg|S)Ncs2g|]*}|jD]}|ddkr|�jkr|�qqS�rr)r^ru)rWr(rhr5rrr��s
�z Enum.__dir__.<locals>.<listcomp>cSsg|]}|ddkr|�qSr�rrgrrrr��sr7r]r')r7r[r^)r#�added_behaviorrr5rr��s
��zEnum.__dir__cCsJt|�jtjtjfk}|jtks$|r2t}t|�}n|j}|j}|�||�Srf)	r�rlrrrvrxrDrjrm)r#�format_spec�str_overriddenr(�valrrrrm�s	
zEnum.__format__cCs
t|j�Srf)�hashr{r5rrr�__hash__�sz
Enum.__hash__cCs|j|jffSrf�r7rjr"rrrr&�szEnum.__reduce_ex__cCs|jSrf)r{r5rrrr�sz	Enum.namecCs|jSrf�rjr5rrrr-�sz
Enum.valueN)r*r'r+rsr:r�r;rkrlr�rmr�r&rrr-rrrrrqs-


)�	metaclassc@seZdZdS)rN)r*r'r+rrrrr�scCs|jSrfrr"rrrr��sr�c@sleZdZdd�Zedd��Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)rc	Csd|s|dk	r|SdSt|�D]:}zt|�}WqXWqtk
rTtd|�d�YqXqd|dS)NrzInvalid Flag value: %rr)r��	_high_bitr�r!)rr�r�r�r��high_bitrrrr:s	
zFlag._generate_next_value_cCs.|}|dkr|}|�|�}|dkr*|}|Sr�)r9)r(r-�original_value�possible_memberrrrr;s
zFlag._missing_cCsb|j�|d�}|dkr^t||�\}}|r:td||jf��t�|�}d|_||_|j�	||�}|S�Nr�)
rwr��
_decomposerAr*rxrsr{rjrn)r(r-�
pseudo_memberr�extra_flagsrrrr9#s
zFlag._create_pseudo_member_cCs8t||j�s&tdt|�j|jjf��|j|j@|jkSr�)rCr7r!r�r+rj�r#�otherrrrr�7s��zFlag.__contains__cCsV|j}|jdk	r$d|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cSsg|]}t|jp|j��qSr�rDr{rjrgrrrr�Hsz!Flag.__repr__.<locals>.<listcomp>)r7r{r*rjr�rr�r#r(r��	uncoveredrrrrkAs
�z
Flag.__repr__cCs�|j}|jdk	r d|j|jfSt||j�\}}t|�dkr^|djdkr^d|j|djfSd|jd�dd�|D��fSdS)Nr�rrz%s.%rr�cSsg|]}t|jp|j��qSrr�rgrrrr�Vsz Flag.__str__.<locals>.<listcomp>)r7r{r*r�rjrrrr�rrrrlLs
�zFlag.__str__cCs
t|j�Srf)�boolrjr5rrrr�Ysz
Flag.__bool__cCs"t||j�stS|�|j|jB�Srf�rCr7�NotImplementedrjr�rrr�__or__\szFlag.__or__cCs"t||j�stS|�|j|j@�Srfrr�rrr�__and__aszFlag.__and__cCs"t||j�stS|�|j|jA�Srfrr�rrr�__xor__fszFlag.__xor__cCsNt|j|j�\}}|�d�}|jD] }||kr"|j|j@s"||B}q"|�|�Sr�)r�r7rj)r#r�r��invertedrhrrr�
__invert__ks


zFlag.__invert__N)r*r'r+r:r�r;r9r�rkrlr�rrrrrrrrr�s



c@sPeZdZedd��Zedd��Zdd�Zdd�Zd	d
�ZeZ	eZ
eZdd�Zd
S)rcCs*t|t�std||jf��|�|�}|Sr�)rC�intrAr*r9)r(r-�
new_memberrrrr;ys

zIntFlag._missing_cCs�|j�|d�}|dkr�|g}t||�\}}|rtt|�}d|}||jkrZ||krZ|�|�||krjd}q*||N}q*t|�D]*}t�||�}d|_||_	|j�
||�}q||S)Nrr)rwr�r�r�rIr�rrsr{rjrn)r(r-r��need_to_createrr��bit�
flag_valuerrrr9�s(
�


zIntFlag._create_pseudo_member_cCs0t||jtf�stS|�|j|�|�jB�}|Srf�rCr7rrrj)r#r�r�rrrr�szIntFlag.__or__cCs,t||jtf�stS|�|j|�|�j@�Srfr
r�rrrr�szIntFlag.__and__cCs,t||jtf�stS|�|j|�|�jA�Srfr
r�rrrr�szIntFlag.__xor__cCs|�|j�}|Srfr�)r#r�rrrr�szIntFlag.__invert__N)
r*r'r+r�r;r9rrr�__ror__�__rand__�__rxor__rrrrrrts
	
 cCs|��dSr�)�
bit_length�r-rrrr��sr�cCs^g}|j��D]"\}}||jkr|�||jf�q|rZd�dd�|D��}td||f��|S)Nz, cSsg|]\}}d||f�qS)z%s -> %sr)rW�aliasrrrrr��szunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�r_rrIrrrA)�enumeration�
duplicatesrr��
alias_detailsrrrr
�s
��cCs�|}|dk}|r*dd�t|j���D�}ndd�t|j���D�}g}|D],\}}|rJ||@|krJ|�|�||M}qJ|s�||jkr�|�|j|�|jdd�dd�t|�d	kr�|dj|kr�|�d�||fS)
NrcSs"g|]\}}|jdk	r||f�qSrfr�rWrarhrrrr��s
�z_decompose.<locals>.<listcomp>cSs*g|]"\}}|jdk	st|�r||f�qSrf)r�
_power_of_tworrrrr��s
�cSs|jSrfr�)rhrrrr��r�z_decompose.<locals>.<lambda>T)rK�reverser)rGrwr_rIr�rr-ro)�flagr-�not_covered�negative�flags_to_checkr�r�r�rrrr��s(��

r�cCs|dkrdS|dt|�kS)NrFr)r�rrrrr�sr)r��typesrr�__all__rrr r)rxr,r	�dictr.rr�rrrr�rrr�r
r�rrrrr�<module>s>�
	LivI%plistlib.cpython-38.pyc000064400000065037151450073350011034 0ustar00U

e5d�}�
@s>dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZejdded�Ze��ej�ejdd��Zdd�Zdd�Zdd�Zdd�ZGdd�d�ZGdd
�d
�ZdZe� d�Z!dLd!d"�Z"d#d$�Z#e� d%ej$�Z%d&d'�Z&d(d)�Z'd*d+�Z(Gd,d-�d-�Z)Gd.d/�d/�Z*Gd0d1�d1e*�Z+d2d3�Z,Gd4d�de-�Z.d5d6d7d8d9�Z/e0�Z1Gd:d;�d;�Z2d<d=�Z3e4e5e6eje7fZ8Gd>d?�d?e0�Z9d@dA�Z:e;e<e,e)e+dB�e=e<e:e2e9dB�iZ>ddCe<dD�dEd	�Z?ddCe<dD�dFd�Z@e;dCdGdH�dId
�ZAe;dGdCdJ�dKd�ZBdS)Ma�plistlib.py -- a tool to generate and parse MacOSX .plist files.

The property list (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.

To write out a plist file, use the dump(value, file)
function. 'value' is the top level object, 'file' is
a (writable) file object.

To parse a plist from a file, use the load(file) function,
with a (readable) file object as the only argument. It
returns the top level object (again, usually a dictionary).

To work with plist data in bytes objects, you can use loads()
and dumps().

Values can be strings, integers, floats, booleans, tuples, lists,
dictionaries (but only with string keys), Data, bytes, bytearray, or
datetime.datetime objects.

Generate Plist example:

    pl = dict(
        aString = "Doodah",
        aList = ["A", "B", 12, 32.1, [1, 2, 3]],
        aFloat = 0.1,
        anInt = 728,
        aDict = dict(
            anotherString = "<hello & hi there!>",
            aUnicodeValue = "M\xe4ssig, Ma\xdf",
            aTrueValue = True,
            aFalseValue = False,
        ),
        someData = b"<binary gunk>",
        someMoreData = b"<lots of binary gunk>" * 10,
        aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
    )
    with open(fileName, 'wb') as fp:
        dump(pl, fp)

Parse Plist example:

    with open(fileName, 'rb') as fp:
        pl = load(fp)
    print(pl["aKey"])
�	readPlist�
writePlist�readPlistFromBytes�writePlistToBytes�Data�InvalidFileException�FMT_XML�
FMT_BINARY�load�dump�loads�dumps�UID�N)�BytesIO)�warn)�ParserCreate�PlistFormatzFMT_XML FMT_BINARY)�modulec	cs2t|t�r(t||��}|VW5QRXn|VdS�N)�
isinstance�str�open)�
pathOrFile�mode�fp�r� /usr/lib64/python3.8/plistlib.py�_maybe_openOs
rc
Cs<tdtd�t|d��}t|ddd�W5QR�SQRXdS)z�
    Read a .plist from a path or file. pathOrFile should either
    be a file name, or a readable binary file object.

    This function is deprecated, use load instead.
    z8The readPlist function is deprecated, use load() instead��rbNF��fmt�use_builtin_types)r�DeprecationWarningrr	)rrrrrrYs�c	Cs8tdtd�t|d��}t||tddd�W5QRXdS)z�
    Write 'value' to a .plist file. 'pathOrFile' may either be a
    file name or a (writable) file object.

    This function is deprecated, use dump instead.
    z9The writePlist function is deprecated, use dump() insteadr�wbTF�r!�	sort_keys�skipkeysN)rr#rr
r)�valuerrrrrrfs�cCstdtd�tt|�ddd�S)z}
    Read a plist data from a bytes object. Return the root object.

    This function is deprecated, use loads instead.
    zBThe readPlistFromBytes function is deprecated, use loads() insteadrNFr )rr#r	r��datarrrrss
�cCs,tdtd�t�}t||tddd�|��S)zp
    Return 'value' as a plist-formatted bytes object.

    This function is deprecated, use dumps instead.
    zAThe writePlistToBytes function is deprecated, use dumps() insteadrTFr%)rr#rr
r�getvalue)r(�frrrr~s�c@s>eZdZdZdd�Zedd��Zddd�Zd	d
�Zdd�Z	d
S)rz]
    Wrapper for binary data.

    This class is deprecated, use a bytes object instead.
    cCst|t�std��||_dS)Nzdata must be as bytes)r�bytes�	TypeErrorr*��selfr*rrr�__init__�s
z
Data.__init__cCs|t|��Sr)�_decode_base64)�clsr*rrr�
fromBase64�szData.fromBase64�LcCst|j|�Sr)�_encode_base64r*)r0�
maxlinelengthrrr�asBase64�sz
Data.asBase64cCs4t||j�r|j|jkSt|t�r,|j|kStSdSr)r�	__class__r*r-�NotImplemented�r0�otherrrr�__eq__�s


zData.__eq__cCsd|jjt|j�fS�Nz%s(%s)�r9�__name__�reprr*�r0rrr�__repr__�sz
Data.__repr__N)r5)
r@�
__module__�__qualname__�__doc__r1�classmethodr4r8r=rCrrrrr�s

c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r
cCs<t|t�std��|dkr"td��|dkr2td��||_dS)Nzdata must be an int�zUIDs cannot be >= 2**64r�UIDs must be positive)r�intr.�
ValueErrorr*r/rrrr1�s
zUID.__init__cCs|jSrr)rBrrr�	__index__�sz
UID.__index__cCsd|jjt|j�fSr>r?rBrrrrC�szUID.__repr__cCs|j|jffSr)r9r*rBrrr�
__reduce__�szUID.__reduce__cCst|t�stS|j|jkSr)rr
r:r*r;rrrr=�s
z
UID.__eq__cCs
t|j�Sr)�hashr*rBrrr�__hash__�szUID.__hash__N)	r@rDrEr1rLrCrMr=rOrrrrr
�s	s�<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
zv[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]r5cCsP|dd}g}tdt|�|�D]$}||||�}|�t�|��q d�|�S)N��r�)�range�len�append�binasciiZ
b2a_base64�join)�sr7Z
maxbinsize�pieces�i�chunkrrrr6�sr6cCs(t|t�rt�|�d��St�|�SdS)N�utf-8)rrrVZ
a2b_base64�encode)rXrrrr2�s
r2z{(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?ZcCsLd}t�|���}g}|D]&}||}|dkr2qB|�t|��qtj|�S)N�ZyearZmonthZdayZhourZminute�second)�_dateParser�match�	groupdictrUrJ�datetime)rX�orderZgdZlst�key�valrrr�_date_from_string�srgcCs d|j|j|j|j|j|jfS)Nz%04d-%02d-%02dT%02d:%02d:%02dZr^)�drrr�_date_to_strings�ricCsZt�|�}|dk	rtd��|�dd�}|�dd�}|�dd�}|�dd�}|�d	d
�}|S)Nz<strings can't contains control characters; use bytes insteadz
�
�
�&z&amp;�<z&lt;�>z&gt;)�_controlCharPat�searchrK�replace)�text�mrrr�_escapes
rtc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�_PlistParsercCs"g|_d|_d|_||_||_dSr)�stack�current_key�root�_use_builtin_types�
_dict_type�r0r"�	dict_typerrrr1s
z_PlistParser.__init__cCsBt�|_|j|j_|j|j_|j|j_|j|j_	|j�
|�|jSr)r�parser�handle_begin_elementZStartElementHandler�handle_end_elementZEndElementHandler�handle_dataZCharacterDataHandler�handle_entity_declZEntityDeclHandlerZ	ParseFilerx)r0Zfileobjrrr�parses



z_PlistParser.parsecCstd��dS)Nz8XML entity declarations are not supported in plist files)r)r0Zentity_nameZis_parameter_entityr(�baseZ	system_idZ	public_idZ
notation_namerrrr�$sz_PlistParser.handle_entity_declcCs*g|_t|d|d�}|dk	r&||�dS)NZbegin_)r*�getattr)r0�element�attrs�handlerrrrr~*sz!_PlistParser.handle_begin_elementcCs"t|d|d�}|dk	r|�dS)NZend_)r�)r0r�r�rrrr0sz_PlistParser.handle_end_elementcCs|j�|�dSr)r*rUr/rrrr�5sz_PlistParser.handle_datacCs�|jdk	rFt|jdti��s.td|jj��||jd|j<d|_nB|jsT||_n4t|jdtg��sxtd|jj��|jd�|�dS)N���zunexpected element at line %d)	rwrrv�typerKr}�CurrentLineNumberrxrU�r0r(rrr�
add_object8s
��z_PlistParser.add_objectcCsd�|j�}g|_|S)N�)rWr*r/rrr�get_dataHsz_PlistParser.get_datacCs"|��}|�|�|j�|�dSr)rzr�rvrU)r0r�rhrrr�
begin_dictOs
z_PlistParser.begin_dictcCs*|jrtd|j|jjf��|j��dS)Nz%missing value for key '%s' at line %d)rwrKr}r�rv�poprBrrr�end_dictTs
�z_PlistParser.end_dictcCs8|jst|jdti��s*td|jj��|��|_dS)Nr�zunexpected key at line %d)rwrrvr�rKr}r�r�rBrrr�end_keyZs
�z_PlistParser.end_keycCsg}|�|�|j�|�dSr)r�rvrU)r0r��arrr�begin_array`s
z_PlistParser.begin_arraycCs|j��dSr)rvr�rBrrr�	end_arrayesz_PlistParser.end_arraycCs|�d�dS)NT�r�rBrrr�end_truehsz_PlistParser.end_truecCs|�d�dS)NFr�rBrrr�	end_falseksz_PlistParser.end_falsecCs@|��}|�d�s|�d�r.|�t|d��n|�t|��dS)NZ0xZ0X�)r��
startswithr�rJ)r0�rawrrr�end_integernsz_PlistParser.end_integercCs|�t|����dSr)r��floatr�rBrrr�end_realusz_PlistParser.end_realcCs|�|���dSr)r�r�rBrrr�
end_stringxsz_PlistParser.end_stringcCs2|jr|�t|����n|�t�|����dSr)ryr�r2r�rr4rBrrr�end_data{sz_PlistParser.end_datacCs|�t|����dSr)r�rgr�rBrrr�end_date�sz_PlistParser.end_dateN)r@rDrEr1r�r�r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrus(	ruc@s8eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zd	S)�_DumbXMLWriterr�	cCs||_g|_||_||_dSr)�filerv�
_indent_level�indent)r0r��indent_levelr�rrrr1�sz_DumbXMLWriter.__init__cCs,|j�|�|�d|�|jd7_dS)Nz<%s>�)rvrU�writelnr��r0r�rrr�
begin_element�sz_DumbXMLWriter.begin_elementcCs@|jdkst�|j��|ks t�|jd8_|�d|�dS)Nrr�z</%s>)r��AssertionErrorrvr�r�r�rrr�end_element�sz_DumbXMLWriter.end_elementNcCs8|dk	r&t|�}|�d|||f�n|�d|�dS)Nz<%s>%s</%s>z<%s/>)rtr�)r0r�r(rrr�simple_element�sz_DumbXMLWriter.simple_elementcCsH|r8t|t�r|�d�}|j�|j|j�|j�|�|j�d�dS)Nr\�
)rrr]r��writer�r�)r0�linerrrr��s

z_DumbXMLWriter.writeln)rr�)N)r@rDrEr1r�r�r�r�rrrrr��s


r�c@sFeZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dS)�_PlistWriterr�	r�TFcCs.|r|�t�t�||||�||_||_dSr)r��PLISTHEADERr�r1�
_sort_keys�	_skipkeys)r0r�r�r�ZwriteHeaderr&r'rrrr1�s

z_PlistWriter.__init__cCs"|�d�|�|�|�d�dS)Nz<plist version="1.0">z</plist>)r��write_valuer�rrrr��s

z_PlistWriter.writecCs4t|t�r|�d|��n|dkr0|�d��n|dkrD|�d�n�t|t�r�d|krbdkrxnn|�dd	|�nt|��n�t|t�r�|�d
t|��n�t|t�r�|�|�n|t|t	�r�|�
|�nft|ttf�r�|�
|�nLt|tj��r|�dt|��n,t|ttf��r |�|�ntdt|���dS)
N�stringT�trueFZfalsel����rHZintegerz%d�real�datezunsupported type: %s)rrr�rJ�
OverflowErrorr�rA�dict�
write_dictr�
write_datar-�	bytearray�write_bytesrcri�tuple�list�write_arrayr.r�r�rrrr��s.





z_PlistWriter.write_valuecCs|�|j�dSr)r�r*r/rrrr��sz_PlistWriter.write_datacCsz|�d�|jd8_tddt|j�dd�|j��}t||��d�D]}|rJ|�|�qJ|jd7_|�	d�dS)Nr*r�r�r5r�s        r�)
r�r��maxrTr�rqr6�splitr�r�)r0r*r7r�rrrr��s
�z_PlistWriter.write_bytescCs�|rt|�d�|jr"t|���}n|��}|D]8\}}t|t�sP|jrHq.td��|�d|�|�	|�q.|�
d�n
|�d�dS)Nr��keys must be stringsre)r�r��sorted�itemsrrr�r.r�r�r�)r0rhr�rer(rrrr��s

z_PlistWriter.write_dictcCs<|r.|�d�|D]}|�|�q|�d�n
|�d�dS)N�array)r�r�r�r�)r0r�r(rrrr�s
z_PlistWriter.write_arrayN)rr�r�TF)
r@rDrEr1r�r�r�r�r�r�rrrrr��s�

%
r�cCs�d}|D]}|�|�rdSqtjdftjdftjdffD]N\}}|�|�sNq:|D]4}||�d��|�}|dt|��|krRdSqRq:dS)N)s<?xmls<plistTr\z	utf-16-bez	utf-16-le�asciiF)r��codecs�BOM_UTF8�BOM_UTF16_BE�BOM_UTF16_LE�decoder]rT)�header�prefixesZpfxZbom�encoding�start�prefixrrr�_is_fmt_xmls
�
r�c@seZdZddd�ZdS)r�Invalid filecCst�||�dSr)rKr1)r0�messagerrrr12szInvalidFileException.__init__N)r�)r@rDrEr1rrrrr1s�B�H�L�Q)r�rrP�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�_BinaryPlistParsera
    Read or write a binary plist file, following the description of the binary
    format.  Raise InvalidFileException in case of error, otherwise return the
    root object.

    see also: http://opensource.apple.com/source/CF/CF-744.18/CFBinaryPList.c
    cCs||_||_dSr)ryrzr{rrrr1Asz_BinaryPlistParser.__init__cCs�z~||_|j�dtj�|j�d�}t|�dkr6t��t�d|�\}|_	}}}|j�|�|�
||�|_tg||_
|�|�WStttjttfk
r�t��YnXdS)Ni��� z>6xBBQQQ)�_fp�seek�os�SEEK_END�readrTr�struct�unpack�	_ref_size�
_read_ints�_object_offsets�
_undefined�_objects�_read_object�OSError�
IndexError�errorr�rK)r0r�trailer�offset_size�num_objects�
top_object�offset_table_offsetrrrr�Es*
��z_BinaryPlistParser.parsecCsL|dkrH|j�d�dd@}d|>}dt|}t�||j�|��dS|S)z$ return the size of the next object.�r�rrQrn)r�r��_BINARY_FORMATr�r�)r0�tokenLrsrXr,rrr�	_get_size^sz_BinaryPlistParser._get_sizecst|j��|���tkr2t�d|�t�����S�rFt���|krLt��t��fdd�td�|��D��SdS)Nrnc3s&|]}t��||��d�VqdS)�bigN)rJ�
from_bytes)�.0rZ�r*�sizerr�	<genexpr>os�z0_BinaryPlistParser._read_ints.<locals>.<genexpr>r)	r�r�r�r�r�rTrr�rS)r0�nr�rr�rr�hs�z_BinaryPlistParser._read_intscCs|�||j�Sr)r�r�)r0r�rrr�
_read_refsrsz_BinaryPlistParser._read_refscs�j|}|tk	r|S�j|}�j�|��j�d�d}|d@|d@}}|dkr^d}�n�|dkrnd}�n�|dkr~d	}�n�|dkr�d
}�n�|dkr�tj�j�d|>�d|d
kd�}�nT|dkr�t�	d�j�d��d}�n0|dk�rt�	d�j�d��d}�n
|dk�rDt�	d�j�d��d}t
�
ddd�t
j|d�}�n�|dk�r���|�}�j�|�}t
|�|k�rxt���j�st|�}�n�|dk�rΈ�|�}�j�|�}	t
|	�|k�r�t��|	�d�}�n@|dk�r��|�d}�j�|�}	t
|	�|k�rt��|	�d�}n�|dk�r:tt��j�d|�d��}n�|dk�r���|�}��|�}
g}|�j|<|��fdd �|
D��n�|d!k�r��|�}��|�}��|�}
���}|�j|<z.t||
�D]\}}
��|
�|��|�<�q�Wntk
�rt��YnXnt��|�j|<|S)"zx
        read the object by reference.

        May recursively read sub-objects (content of an array/dict/set)
        r�r��r�Nr�F�	TrRr�r�rQ�Zsigned�"z>frP�#z>d�3��)Zseconds�@�Pr��`r�utf-16be��c3s|]}��|�VqdSr)r�)r��xrBrrr��sz2_BinaryPlistParser._read_object.<locals>.<genexpr>��)r�r�r�r�r�r�rJr�r�r�rcZ	timedeltar�rTrryrr�r
r�extendrz�zipr�r.)r0�ref�result�offset�tokenZtokenHr�r,rXr*Zobj_refsZkey_refs�k�orrBrr�us�

�



�















z_BinaryPlistParser._read_objectN)
r@rDrErFr1r�r�r�rr�rrrrr�9s

r�cCs,|dkrdS|dkrdS|dkr$dSdSdS)N�r��r�rPr�r)�countrrr�_count_to_size�src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistWritercCs||_||_||_dSr)r�r�r�)r0rr&r'rrrr1�sz_BinaryPlistWriter.__init__c
Cs�g|_i|_i|_|�|�t|j�}dg||_t|�|_t|j|_	|j
�d�|jD]}|�|�qZ|�
|�}|j
��}t|�}dt||}|j
�tj|f|j���d}|||j|||f}	|j
�tjd|	���dS)Nr�bplist00rn�	>5xBBBQQQ)r)�_objlist�	_objtable�_objidtable�_flattenrTr�rr�r��_ref_formatr�r��
_write_object�
_getrefnum�tellr��pack)
r0r(r��objr�r�r�Z
offset_formatZsort_versionr�rrrr��s2





�z_BinaryPlistWriter.writec	Csrt|t�r"t|�|f|jkrZdSn8t|t�rHt|j�|jf|jkrZdSnt|�|jkrZdSt|j	�}|j	�
|�t|t�r�||jt|�|f<n0t|t�r�||jt|j�|jf<n||jt|�<t|t��rHg}g}|��}|j
r�t|�}|D]:\}}t|t��s|j�r
q�td��|�
|�|�
|�q�t�||�D]}|�|��q4n&t|ttf��rn|D]}|�|��q\dS)Nr�)r�_scalarsr�r!rr*�idr"rTr rUr�r�r�r�rr�r.�	itertools�chainr#r�r�)	r0r(Zrefnum�keys�valuesr�r�vrrrrr#sB





z_BinaryPlistWriter._flattencCsNt|t�r|jt|�|fSt|t�r<|jt|j�|jfS|jt|�SdSr)rr*r!r�rr*r"r+r�rrrr&Ns


z_BinaryPlistWriter._getrefnumcCs�|dkr"|j�t�d||B��n�|dkrH|j�t�d|dBd|��nh|dkrn|j�t�d|dBd|��nB|d	kr�|j�t�d
|dBd|��n|j�t�d|dBd
|��dS)Nr�z>Brz>BBBr�rz>BBH�rz>BBL�z>BBQ�)r�r�r�r()r0rr�rrr�_write_sizeVsz_BinaryPlistWriter._write_sizecs���|�}�j���j|<|dkr2�j�d��nl|dkrJ�j�d��nT|dkrb�j�d��n<t|t��rl|dkr�z�j�t�dd|��Wn tj	k
r�t
|�d�YnXn�|d	krԈj�t�d
d|��n�|dkr�j�t�d
d|��nt|dk�r�j�t�dd|��nR|dk�r8�j�t�dd|��n0|dk�r`�j�d|jdddd��nt
|���n2t|t��r��j�t�dd|���nt|t
j
��r�|t
�
ddd���}�j�t�dd|���n�t|t��r��dt|j���j�|j��n�t|ttf��r0��dt|���j�|��nnt|t��r�z|�d�}��dt|��Wn4tk
�r�|�d �}��d!t|�d"�YnX�j�|��n�t|t��r^|jdk�r�td#��n�|jd	k�r�j�t�d
d$|��nt|jdk�r
�j�t�d
d%|��nP|jdk�r.�j�t�dd&|��n,|jdk�rR�j�t�dd'|��nt
|���n@t|ttf��r��fd(d)�|D�}t|�}��d*|��j�tjd+�j|f|���n�t|t��r�gg}}�j�r�t|� ��}	n|� �}	|	D]J\}
}t|
t��s�j!�r�q�t"d,��|�#��|
��|�#��|���q�t|�}��d-|��j�tjd+�j|f|����j�tjd+�j|f|���nt"|��dS).N�F�Tr�rz>Bqr3rz>BBr�rz>BHr1rz>BLr2lz>BQrH�r�rz>Bdrrr�rrr�r	rr
rrIr���csg|]}��|��qSr)r&)r�rrBrr�
<listcomp>�sz4_BinaryPlistWriter._write_object.<locals>.<listcomp>r
rnr�r)$r&r�r'r�r�rrJr�r(r�r��to_bytesr�rcZ
total_secondsrr4rTr*r-r�rr]�UnicodeEncodeErrorr
rKr�r�r$r�r�r�r�r�r.rU)r0r(rr,�tZrefsrXZkeyRefsZvalRefsZ	rootItemsrr0rrBrr%fs�






$
"$z _BinaryPlistWriter._write_objectN)	r@rDrEr1r�r#r&r4r%rrrrr�s-0rcCs|dd�dkS)Nr�rr)r�rrr�_is_fmt_binary�sr?)�detectr}�writerT�r!r"r|cCsl|dkrJ|�d�}|�d�t��D]}|d|�r$|d}qVq$t��nt|d}|||d�}|�|�S)z�Read a .plist file. 'fp' should be a readable and binary file object.
    Return the unpacked root object (which usually is a dictionary).
    Nr�rr@r})r"r|)r�r��_FORMATSr/rr�)rr!r"r|r��info�P�prrrr	�s

cCst|�}t||||d�S)zqRead a .plist file from a bytes object.
    Return the unpacked root object (which usually is a dictionary).
    rB)rr	)r(r!r"r|rrrrr�s�Fr%cCs:|tkrtd|f��t|d|||d�}|�|�dS)zWWrite 'value' to a .plist file. 'fp' should be a writable,
    binary file object.
    zUnsupported format: %rrA)r&r'N)rCrKr�)r(rr!r&r'rArrrr
s�r!r'r&cCs t�}t|||||d�|��S)z?Return a bytes object with the contents for a .plist file.
    rG)rr
r+)r(r!r'r&rrrrrs)r5)CrF�__all__rVr��
contextlibrc�enum�iorr,r��rer��warningsrZxml.parsers.expatr�Enumr@r�globals�update�__members__�contextmanagerrrrrrrr
r��compileror6r2�ASCIIr`rgrirtrur�r�r�rKrr��objectr�r�rrrJr�r-r*rr?rr�rrCr	rr
rrrrr�<module>s�0�

	


'"�
	
s&d!$
a	���	io.cpython-38.pyc000064400000006600151450073350007610 0ustar00U

e5d�
�@sjdZdZdddddddd	d
ddd
dddddddgZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZejZde_dZdZdZGdd�dejejd�ZGdd�deje�ZGdd
�d
eje�ZGdd�deje�Z e�!e
�ee
eeefD]Z"e�!e"��qeefD]Z"e �!e"��q ["zdd lm#Z#Wne$k
�rZYnXe�!e#�dS)!a�The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.

At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; implementations are
allowed to raise an OSError if they do not support a given operation.

Extending IOBase is RawIOBase which deals simply with the reading and
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
an interface to OS files.

BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
streams that are readable, writable, and both respectively.
BufferedRandom provides a buffered interface to random access
streams. BytesIO is a simple stream of in-memory bytes.

Another IOBase subclass, TextIOBase, deals with the encoding and decoding
of streams into text. TextIOWrapper, which extends it, is a buffered text
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
is an in-memory stream for text.

Argument names are not part of the specification, and only the arguments
of open() are intended to be used as keyword arguments.

data:

DEFAULT_BUFFER_SIZE

   An int containing the default buffer size used by the module's buffered
   I/O classes. open() uses the file's blksize (as obtained by os.stat) if
   possible.
z�Guido van Rossum <guido@python.org>, Mike Verdone <mike.verdone@gmail.com>, Mark Russell <mark.russell@zen.co.uk>, Antoine Pitrou <solipsis@pitrou.net>, Amaury Forgeot d'Arc <amauryfa@gmail.com>, Benjamin Peterson <benjamin@python.org>�BlockingIOError�open�	open_code�IOBase�	RawIOBase�FileIO�BytesIO�StringIO�BufferedIOBase�BufferedReader�BufferedWriter�BufferedRWPair�BufferedRandom�
TextIOBase�
TextIOWrapper�UnsupportedOperation�SEEK_SET�SEEK_CUR�SEEK_END�N)�DEFAULT_BUFFER_SIZErrrrrrrr
rrr
�IncrementalNewlineDecoderr�io��c@seZdZejjZdS)rN)�__name__�
__module__�__qualname__�_io�_IOBase�__doc__�r r �/usr/lib64/python3.8/io.pyrHs)�	metaclassc@seZdZejjZdS)rN)rrrr�
_RawIOBaserr r r r!rKsc@seZdZejjZdS)r	N)rrrr�_BufferedIOBaserr r r r!r	Nsc@seZdZejjZdS)rN)rrrr�_TextIOBaserr r r r!rQs)�_WindowsConsoleIO)%r�
__author__�__all__r�abcrrrrrrrrr
rrr
rr�OpenWrapperrrrrr�ABCMetarr#rr$r	r%r�register�klassr&�ImportErrorr r r r!�<module>sT$
�@
�fileinput.cpython-38.opt-2.pyc000064400000017127151450073350012146 0ustar00U

e5du9�@s�ddlZddlZdddddddd	d
ddd
gZdad!ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�ZGdd�d�Z
dd�Zd"dd
�Zdd�Zed kr�e�dS)#�N�input�close�nextfile�filename�lineno�
filelineno�fileno�isfirstline�isstdin�	FileInput�hook_compressed�hook_encodedF��r��mode�openhookcCs(trtjrtd��t|||||d�atS)Nzinput() already activer)�_state�_file�RuntimeErrorr)�files�inplace�backuprr�r�!/usr/lib64/python3.8/fileinput.pyrSs
cCst}da|r|��dS�N)rr)�staterrrr`scCststd��t��S�Nzno active input())rrrrrrrrhs
cCststd��t��Sr)rrrrrrrrvscCststd��t��Sr)rrrrrrrrscCststd��t��Sr)rrrrrrrr�scCststd��t��Sr)rrrrrrrr�scCststd��t��Sr)rrr	rrrrr	�scCststd��t��Sr)rrr
rrrrr
�sc@s�eZdZd(ddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))rNFrrrcCst|t�r|f}nBt|tj�r,t�|�f}n(|dkrBtjdd�}|sLd}nt|�}||_||_	||_
d|_d|_d|_
d|_d|_d|_d|_d|_|dkr�td��d|kr�ddl}|�dtd	�||_d|kr�|�d
d�nd|_|�r|r�td��t|��std
��||_dS)N�)�-rF)rZrU�U�rbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'r z'U' mode is deprecated�r�wz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)�
isinstance�str�os�PathLike�fspath�sys�argv�tuple�_files�_inplace�_backup�_savestdout�_output�	_filename�_startlineno�_filelinenor�_isstdin�_backupfilename�
ValueError�warnings�warn�DeprecationWarning�_mode�replace�_write_mode�callable�	_openhook)�selfrrrrrr7rrr�__init__�sH
�
zFileInput.__init__cCs|��dSr�r�r?rrr�__del__�szFileInput.__del__cCsz|��W5d|_XdS)Nr)r,rrBrrrr�szFileInput.closecCs|SrrrBrrr�	__enter__�szFileInput.__enter__cCs|��dSrrA)r?�type�value�	tracebackrrr�__exit__�szFileInput.__exit__cCs|SrrrBrrr�__iter__�szFileInput.__iter__cCs6|��}|r|jd7_|S|js(t�|��qdS�Nr)�	_readliner3r�
StopIterationr�r?�linerrr�__next__�szFileInput.__next__cCsXddl}|jdtdd�||��kr,td��z
|��WStk
rRtd��YnXdS)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r")�
stacklevelzaccessing lines out of orderzend of input reached)r7r8r9rrrOrL�
IndexError)r?�ir7rrr�__getitem__s�
zFileInput.__getitem__cCs�|j}d|_|r|t_|j}d|_z|r0|�
�W5|j}d|_z|`Wntk
r\YnXz|rr|jsr|�
�W5|j}d|_|r�|js�zt	�
|�Wntk
r�YnXd|_XXdS)NF)r/r)�stdoutr0rrK�AttributeErrorr5r.r&�unlink�OSErrorr4r)r?Z
savestdout�output�fileZbackupfilenamerrrrs4

zFileInput.nextfilecCs6|��}|r|jd7_|S|js(|S|��qdSrJ)rKr3rrrMrrr�readline.szFileInput.readlinecCs�|jsd|jkrdSdS|jd|_|jdd�|_|��|_d|_d|_d|_d|_|jdkr�d|_d|jkr�t	t
jd	t
j�|_nt
j|_d
|_�nT|j�r�t
�|j�|jp�d|_zt
�|j�Wntk
r�YnXt
�|j|j�t|j|j�|_zt
�|j���j}Wn&tk
�r8t|j|j�|_YntXt
jt
jBt
jB}tt
d��rb|t
jO}t
�|j||�}t
�||j�|_zt
�|j|�Wntk
�r�YnXt
j |_!|jt
_ n,|j"�r�|�"|j|j�|_nt|j|j�|_|jj#|_$|�$�S)
N�b�rrrFrz<stdin>�bufferTz.bak�O_BINARY)%r,r:r1rr2r3rr4r5�getattrr)�stdinr-r&r(r.rVrW�rename�open�fstatr�st_moder<r0�O_CREAT�O_WRONLY�O_TRUNC�hasattrr^�fdopen�chmodrTr/r>rZrK)r?Zpermr�fdrrrrK9s\




�


zFileInput._readlinecCs|jSr)r1rBrrrrrszFileInput.filenamecCs|j|jSr)r2r3rBrrrruszFileInput.linenocCs|jSr�r3rBrrrrxszFileInput.filelinenocCs4|jr,z|j��WStk
r(YdSXndSdS)N���)rrr6rBrrrr{s
zFileInput.filenocCs
|jdkSrJrlrBrrrr	�szFileInput.isfirstlinecCs|jSr)r4rBrrrr
�szFileInput.isstdin)NFr)�__name__�
__module__�__qualname__r@rCrrDrHrIrOrSrrZrKrrrrr	r
rrrrr�s(
�)9	cCsVtj�|�d}|dkr,ddl}|�||�S|dkrHddl}|�||�St||�SdS)Nrz.gzrz.bz2)r&�path�splitext�gziprb�bz2ZBZ2File)rrZextrsrtrrrr�scs��fdd�}|S)Ncst||��d�S)N��encoding�errors)rb)rrrurrr�szhook_encoded.<locals>.openhookr)rvrwrrrurr
�scCs�ddl}d}d}|�tjdd�d�\}}|D] \}}|dkrBd}|dkr.|}q.t|||d�D]b}|d	d�d
kr~|dd	�}|d	d�dkr�|dd	�}tdt�t�t�t�r�d
p�d|f�q^tdt�t�t�f�dS)NrFrzib:z-iTz-b)rrrm�
�
z%d: %s[%d]%s %s�*rz
%d: %s[%d])	�getoptr)r*r�printrrrr	)r{rrZopts�args�o�arNrrr�_test�s&�
r��__main__)NFr)N)r)r&�__all__rrrrrrrrr	r
rrr
r�rnrrrr�<module>Ks2�
	

			^
_strptime.cpython-38.opt-1.pyc000064400000037256151450073350012161 0ustar00U

e5d�b�@s�dZddlZddlZddlZddlmZddlmZddlmZ	ddl
mZm
ZmZddlmZgZdd	�ZGd
d�de�ZGdd
�d
e�Ze�Ze�adZiadd�Zdd�Zddd�Z ddd�Z!ddd�Z"dS)a�Strptime-related classes and functions.

CLASSES:
    LocaleTime -- Discovers and stores locale-specific time information
    TimeRE -- Creates regexes for pattern matching a string of text containing
                time information

FUNCTIONS:
    _getlang -- Figure out what language is being used for the locale
    strptime -- Calculates the time struct represented by the passed-in string

�N)�compile)�
IGNORECASE)�escape)�date�	timedelta�timezone)�
allocate_lockcCst�tj�S�N)�localeZ	getlocale�LC_TIME�rr�!/usr/lib64/python3.8/_strptime.py�_getlangsrc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
LocaleTimeakStores and handles locale-specific information related to time.

    ATTRIBUTES:
        f_weekday -- full weekday names (7-item list)
        a_weekday -- abbreviated weekday names (7-item list)
        f_month -- full month names (13-item list; dummy value in [0], which
                    is added by code)
        a_month -- abbreviated month names (13-item list, dummy value in
                    [0], which is added by code)
        am_pm -- AM/PM representation (2-item list)
        LC_date_time -- format string for date/time representation (string)
        LC_date -- format string for date representation (string)
        LC_time -- format string for time representation (string)
        timezone -- daylight- and non-daylight-savings timezone representation
                    (2-item list of sets)
        lang -- Language used by instance (2-item tuple)
    cCsht�|_|��|��|��|��|��t�|jkrDtd��tj	|j	ks\tj
|j
krdtd��dS)a�Set all attributes.

        Order of methods called matters for dependency reasons.

        The locale language is set at the offset and then checked again before
        exiting.  This is to make sure that the attributes were not set with a
        mix of information from more than one locale.  This would most likely
        happen when using threads where one thread calls a locale-dependent
        function while another thread changes the locale while the function in
        the other thread is still running.  Proper coding would call for
        locks to prevent changing the locale while locale-dependent code is
        running.  The check here is done in case someone does not think about
        doing this.

        Only other possible issue is if someone changed the timezone and did
        not call tz.tzset .  That is an issue for the programmer, though,
        since changing the timezone is worthless without that call.

        z$locale changed during initializationz&timezone changed during initializationN)r�lang�_LocaleTime__calc_weekday�_LocaleTime__calc_month�_LocaleTime__calc_am_pm�_LocaleTime__calc_timezone�_LocaleTime__calc_date_time�
ValueError�time�tzname�daylight)�selfrrr
�__init__1szLocaleTime.__init__cCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)�calendarZday_abbr�lower��.0�irrr
�
<listcomp>Ssz-LocaleTime.__calc_weekday.<locals>.<listcomp>�cSsg|]}tj|���qSr)rZday_namerrrrr
r!Ts)�range�	a_weekday�	f_weekday)rr$r%rrr
Z__calc_weekdayPszLocaleTime.__calc_weekdaycCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)rZ
month_abbrrrrrr
r!Zsz+LocaleTime.__calc_month.<locals>.<listcomp>�
cSsg|]}tj|���qSr)rZ
month_namerrrrr
r![s)r#�a_month�f_month)rr'r(rrr
Z__calc_monthXszLocaleTime.__calc_monthcCsJg}dD]6}t�ddd|ddddd	f	�}|�t�d
|����q||_dS)N)�������,�7��Lr�%p)r�struct_time�append�strftimer�am_pm)rr6�hour�
time_tuplerrr
Z__calc_am_pm_s
zLocaleTime.__calc_am_pmc
CsJt�d�}dddg}t�d|���|d<t�d|���|d<t�d|���|d<d|jdd	f|jd
df|jddf|jd
d
f|jddfdddddddddddg}|�	dd�|j
D��dD]d\}}||}|D]\}}|r�|�||�}q�t�d�}dt�||�k�rd}	nd }	|�d!|	�||<q�|d|_|d|_
|d|_dS)"N)	r+r,r-r*r.r/r0r1r�%cr�%xr)�%Xr0)�%z%%z%Ar,z%Bz%az%br2)Z1999z%Y)Z99z%y)Z22z%H)Z44z%M)Z55z%S)Z76z%j)Z17z%d)Z03�%m)�3r=)�2z%w)Z10z%IcSsg|]}|D]}|df�qqS)z%Zr)r�	tz_values�tzrrr
r!�s�z/LocaleTime.__calc_date_time.<locals>.<listcomp>))rr9)r)r:)r0r;)	r+r)r,r)r)r)�r,rZ00z%Wz%UZ11)rr3r5rr%r(r$r'r6�extendr�replace�LC_date_time�LC_date�LC_time)
rr8Z	date_timeZreplacement_pairs�offset�	directiveZcurrent_format�old�newZU_Wrrr
Z__calc_date_timeksH

�


zLocaleTime.__calc_date_timecCszzt��Wntk
r YnXtj|_tj|_tdd|jd��h�}|jrft|jd��h�}nt�}||f|_dS)N�utc�gmtrr))r�tzset�AttributeErrorrr�	frozensetrr)rZ	no_savingZ
has_savingrrr
Z__calc_timezone�szLocaleTime.__calc_timezoneN)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrr
rs-rcs:eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Z�ZS)�TimeREz4Handle conversion from format directives to regexes.Ncs|r||_nt�|_t�}|�ddddddddd	d
ddd
ddd|�|jjd�|�|jjd�|�|jjdd�d�|�|jjdd�d�|�|jj	d�|�dd�|jj
D�d�dd��|�d|�d��
dd��|�d|�|jj��|�d |�|jj��|�d!|�|jj��dS)"z^Create keys/values.

        Order of execution is important for dependency reasons.

        z)(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])z(?P<f>[0-9]{1,6})z(?P<H>2[0-3]|[0-1]\d|\d)z(?P<I>1[0-2]|0[1-9]|[1-9])z(?P<G>\d\d\d\d)zG(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])z(?P<m>1[0-2]|0[1-9]|[1-9])z(?P<M>[0-5]\d|\d)z(?P<S>6[0-1]|[0-5]\d|\d)z(?P<U>5[0-3]|[0-4]\d|\d)z(?P<w>[0-6])z(?P<u>[1-7])z(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)z(?P<y>\d\d)z(?P<Y>\d\d\d\d)z2(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)�A�ar)N�B�b�pcss|]}|D]
}|Vq
qdSr	r)rZtz_namesrArrr
�	<genexpr>�s�z"TimeRE.__init__.<locals>.<genexpr>�Zr<)�d�f�H�I�G�j�m�M�S�U�w�u�V�y�Y�zrVrWrXrYrZr\r<�Wrf�c�x�X)�locale_timer�superr�_TimeRE__seqToREr%r$r(r'r6r�__setitem__�__getitem__rD�patternrErFrG)rrq�base��	__class__rr
r�sF��zTimeRE.__init__cCsPt|tdd�}|D]}|dkrq(qdSd�dd�|D��}d||f}d|S)	aeConvert a list to a regex string for matching a directive.

        Want possible matching values to be from longest to shortest.  This
        prevents the possibility of a match occurring for a value that also
        a substring of a larger value that should have matched (e.g., 'abc'
        matching when 'abcdef' should have been the match).

        T)�key�reverse��|css|]}t|�VqdSr	)�	re_escape)rZstuffrrr
r[�sz#TimeRE.__seqToRE.<locals>.<genexpr>z	(?P<%s>%sz%s))�sorted�len�join)rZ
to_convertrI�valueZregexrrr
Z	__seqToRE�s	zTimeRE.__seqToREcCs�d}td�}|�d|�}td�}|�d|�}d|krv|�d�d}d||d	|d�|||f}||dd	�}q,d
||fS)z�Return regex pattern for the format string.

        Need to make sure that any characters that might be interpreted as
        regex syntax are escaped.

        r|z([\\.^$*+?\(\){}\[\]|])z\\\1z\s+z\\s+r<r)z%s%s%sNz%s%s)�
re_compile�sub�index)r�formatZprocessed_formatZregex_charsZwhitespace_replacementZdirective_indexrrr
rv�s
�zTimeRE.patterncCst|�|�t�S)z2Return a compiled re object for the format string.)r�rvr)rr�rrr
rszTimeRE.compile)N)	rQrRrSrTrrsrvr�
__classcell__rrrxr
rU�s
.rU�cCslt|dd���}|s,|dd}|dd}d|d}|dkrLd||S|d|d}d||SdS)z�Calculate the Julian day based on the year, week of the year, and day of
    the week, with week_start_day representing whether the week of the year
    assumes the week starts on Sunday or Monday (6 or 0).r)r"rN)�
datetime_date�weekday)�year�week_of_yearZday_of_week�week_starts_MonZ
first_weekdayZ
week_0_lengthZdays_to_weekrrr
�_calc_julian_from_U_or_Wsr�cCsdt|dd���d}|d||}|dkr\|t|dd���7}|d8}|t|dd���8}||fS)z�Calculate the Julian day based on the ISO 8601 year, week, and weekday.
    ISO weeks start on Mondays, with week 01 being the week containing 4 Jan.
    ISO week days range from 1 (Monday) to 7 (Sunday).
    r)�r,r")r�Z
isoweekday�	toordinal)�iso_year�iso_weekZiso_weekdayZ
correctionZordinalrrr
�_calc_julian_from_V%sr��%a %b %d %H:%M:%S %Yc,Cs.t||g�D]*\}}t|t�sd}t|�|t|����qt��tj}t	�|j
kshtj|jkshtj
|j
kr|t�at��tj}tt�tkr�t��t�|�}|�s&zt�|�}Wnntk
r�}z.|jd}|dkr�d}~td||f�d�W5d}~XYn$tk
�rtd|�d�YnX|t|<W5QRX|�|�}	|	�sPtd||f��t|�|	��k�rztd	||	��d���d}
}d
}}
d}}}}d}d}d}d}}d}d}}|	��}|��D�]d}|dk�rt|d�}|d
k�r�|d7}n|d7}�q�|dk�r t|d�}�q�|dk�r:t|d�}
�q�|dk�rTt|d�}�q�|dk�rv|j�|d� ��}�q�|dk�r�|j!�|d� ��}�q�|dk�r�t|d�}
�q�|dk�r�t|d�}�q�|dk�r<t|d�}|�dd�� �}|d|j"dfk�r|dk�r8d}n"||j"d
k�r.|dk�r.|d7}�q�|dk�rVt|d�}�q�|dk�rpt|d�}�q�|dk�r�|d}|ddt|�7}t|�}�q�|d k�r�|j#�|d � ��}�q�|d!k�r�|j$�|d!� ��}�q�|d"k�rt|d"�}|dk�rd}n|d
8}�q�|d#k�r:t|d#�}|d
8}�q�|d$k�rTt|d$�}�q�|d%k�r�t||�}|d&k�rzd}nd}�q�|d'k�r�t|d'�}�q�|d(k�r�|d(}|d)k�r�d}n�|d*d+k�r.|dd*�|d,d�}t|�d-k�r.|d-d+k�rd.|d(��}t|��|dd-�|dd�}t|d
d*��}t|d*d-��} t|d-d/��p`d�}!|d0d0| d0|!}|d1d�}"ddt|"�}#t|"|#�}|�%d2��r.|}|}np|d)k�r�|d)� �}$t|j&�D]N\}%}&|$|&k�r�tjdtjd
k�r tj
�r |$d3k�r �q�n
|%}�qʐqސq�|dk�rv|
dk	�rv|dk�sZ|dk�rbtd4��|dk	�r�td5��n0|dk�r�|dk	�r�|dk�r�td6��ntd7��d8}'|dk�r�|d9k�r�|
d:k�r�d;}d<}'n|dk�r�d}|dk�r�|dk	�r�|dk	�r |dk�rd<nd8}(t'||||(�}n(|
dk	�rH|dk	�rHt(|
||d
�\}}|dk	�r�|dk�r�|d
8}t)�*|��rtd=nd>})||)7}|dk�r�t+|||
��,�t+|d
d
��,�d
}n0t+�-|d
t+|d
d
��,��}*|*j.}|*j/}|*j0}
|dk�r�t+|||
��1�}|�d)�}+|'�rd}|||
|||||||+|f||fS)?z�Return a 2-tuple consisting of a time struct and an int containing
    the number of microseconds based on the input string and the
    format string.z*strptime() argument {} must be str, not {}r�\r<z&'%s' is a bad directive in format '%s'Nzstray %% in format '%s'z%time data %r does not match format %rzunconverted data remains: %sr)���rj�Di�ilrkrarcrXrYr]r_r`rZr|�rdrer^�0rBrVrWrgrhrb)rfrmrfrirlr\r,�:r�r�zInconsistent use of : in r"�<��-)rLrMzzISO year directive '%G' must be used with the ISO week directive '%V' and a weekday directive ('%A', '%a', '%w', or '%u').z`Day of the year directive '%j' is not compatible with ISO year directive '%G'. Use '%Y' instead.zzISO week directive '%V' must be used with the ISO year directive '%G' and a weekday directive ('%A', '%a', '%w', or '%u').zdISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G' instead.Fr0�ipTinim)2�	enumerate�
isinstance�str�	TypeErrorr��type�_cache_lock�
_TimeRE_cacherqrrrrrrU�_regex_cache�clearr��_CACHE_MAX_SIZE�getr�KeyError�argsr�
IndexError�match�end�	groupdict�keys�intr(r�rr'r6r%r$�
startswithrr�r�rZisleapr�r�Zfromordinalr��month�dayr�),�data_stringr�r��arg�msgrqZformat_regex�errZ
bad_directive�foundr�r�r�r�r7Zminute�second�fractionrA�gmtoff�gmtoff_fractionr�r�Zweek_of_year_startr�ZjulianZ
found_dictZ	group_keyZampm�srlZhoursZminutes�secondsZgmtoff_remainderZgmtoff_remainder_paddingZ
found_zoner�r@Z
leap_year_fixr�ZydayZdatetime_resultrrrr
�	_strptime5s�

�
�

��
��




























��





�
����

��r�cCs"t||�d}t�|dtj��S)zIReturn a time struct based on the input string and the
    format string.rN)r�rr3�_STRUCT_TM_ITEMS)r�r��ttrrr
�_strptime_time/sr�cCspt||�\}}}|dd�\}}|dd�|f}|dk	rht||d�}	|rVt|	|�}
nt|	�}
||
f7}||�S)zPReturn a class cls instance based on the input string and the
    format string.���NrB)r�Zmicroseconds)r��datetime_timedelta�datetime_timezone)�clsr�r�r�r�r�rr�r�ZtzdeltarArrr
�_strptime_datetime5s
r�)r�)r�)r�)#rTrr
r�rerr�rrr~Zdatetimerr�rr�rr��_threadrZ_thread_allocate_lock�__all__r�objectr�dictrUr�r�r�r�r�r�r�r�r�rrrr
�<module>s.
_
{
netrc.cpython-38.opt-1.pyc000064400000007303151450073350011254 0ustar00U

e5d��@sXdZddlZddlZddlZddgZGdd�de�ZGdd�d�ZedkrTe	e��dS)z-An object-oriented interface to .netrc files.�N�netrc�NetrcParseErrorc@s"eZdZdZddd�Zdd�ZdS)rz5Exception raised on syntax errors in the .netrc file.NcCs"||_||_||_t�||�dS)N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r
�/usr/lib64/python3.8/netrc.pyrszNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r	r
r
r�__str__szNetrcParseError.__str__)NN)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rr
s
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNc	CsX|dk}|dkr&tj�tj�d�d�}i|_i|_t|��}|�|||�W5QRXdS)N�~z.netrc)�os�path�join�
expanduser�hosts�macros�open�_parse)r	�file�
default_netrc�fpr
r
rrs
znetrc.__init__cCs�t�|�}|jd7_|j�dd�|_|j}|��}}|sD�q�n�|ddkrt|j|kr(t|�dkr(|j��q(n�|dkr�|��}nt|dkr�d}nf|dkr�|��}g|j	|<d	|_
|j��}	|	r�|	d
kr�d|_
q(|j	|�|	�q�q(ntd|||j��d}
d}}i|j
|<|��}|�d��s.|d
k�rr|�rR|
||f|j
|<|�|�q(ntd||t|�f||j���q|dk�s�|dk�r�|��}
�q|dk�r�|��}�q|dk�r�tjdk�r�|�r�t�|���}
|
jt��k�rpddl}z|�|
j�d}Wn tk
�rd|
j}YnXz|�t���d}Wn"tk
�rXdt��}YnXtd||f||j��|
jtjtjB@�r�td||j��|��}ntd|||j���qq(dS)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#�r��machine�default�macdefz 	�
z 	
zbad toplevel token %r>rr"r!r z&malformed %s entry %s terminated by %s�login�user�account�password�posixzuid %sz9~/.netrc file owner (%s) does not match current user (%s)zY~/.netrc access too permissive: access permissions must restrict access to only the ownerzbad follower token %r)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuid�KeyError�st_mode�stat�S_IRWXG�S_IRWXO)r	rrrZlexerZsaved_linenoZtoplevelZttZ	entryname�liner$r&r'Zpropr5Zfownerr%r
r
rr s�




�
�
��

���
�znetrc._parsecCs0||jkr|j|Sd|jkr(|jdSdSdS)z8Return a (user, account, password) tuple for given host.r!N)r)r	�hostr
r
r�authenticatorsqs




znetrc.authenticatorscCs�d}|j��D]X}|j|}|d|�d|d�d�7}|drR|d|d�d�7}|d|d	�d�7}q|j��D]4}|d
|�d�7}|j|D]}||7}q�|d7}qr|S)z3Dump the class data in the format of a .netrc file.rzmachine z
	login rr#rz		account z
	password �zmacdef )r�keysr)r	Zrepr=�attrsZmacror<r
r
r�__repr__zs


znetrc.__repr__)N)r
rrrrr>rBr
r
r
rrs
	Q	�__main__)
rrr)r9�__all__rrrr
�printr
r
r
r�<module>stabc.cpython-38.pyc000064400000012330151450073350007723 0ustar00U

e5d��@s�dZdd�ZGdd�de�ZGdd�de�ZGdd�de�Zz,d	d
lm	Z	m
Z
mZmZm
Z
mZmZmZWn*ek
r�d	dlmZm	Z	de_YnXGd
d�de�ZGdd�ded�ZdS)z3Abstract Base Classes (ABCs) according to PEP 3119.cCs
d|_|S)a<A decorator indicating abstract methods.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract methods are overridden.
    The abstract methods can be called using any of the normal
    'super' call mechanisms.  abstractmethod() may be used to declare
    abstract methods for properties and descriptors.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractmethod
            def my_abstract_method(self, ...):
                ...
    T)�__isabstractmethod__)�funcobj�r�/usr/lib64/python3.8/abc.py�abstractmethodsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractclassmethodztA decorator indicating abstract classmethods.

    Deprecated, use 'classmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dS�NT�r�super�__init__��self�callable��	__class__rrr
$szabstractclassmethod.__init__��__name__�
__module__�__qualname__�__doc__rr
�
__classcell__rrrrrsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractstaticmethodzvA decorator indicating abstract staticmethods.

    Deprecated, use 'staticmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dSrrrrrrr
1szabstractstaticmethod.__init__rrrrrr)src@seZdZdZdZdS)�abstractpropertyzoA decorator indicating abstract properties.

    Deprecated, use 'property' with 'abstractmethod' instead.
    TN)rrrrrrrrrr6sr�)�get_cache_token�	_abc_init�
_abc_register�_abc_instancecheck�_abc_subclasscheck�	_get_dump�_reset_registry�
_reset_caches)�ABCMetar�abccsReZdZdZ�fdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	dd�Z
�ZS)r!a�Metaclass for defining Abstract Base Classes (ABCs).

        Use this metaclass to create an ABC.  An ABC can be subclassed
        directly, and then acts as a mix-in class.  You can also register
        unrelated concrete classes (even built-in classes) and unrelated
        ABCs as 'virtual subclasses' -- these and their descendants will
        be considered subclasses of the registering ABC by the built-in
        issubclass() function, but the registering ABC won't show up in
        their MRO (Method Resolution Order) nor will method
        implementations defined by the registering ABC be callable (not
        even via super()).
        cs"t�j||||f|�}t|�|S)N)r	�__new__r)�mcls�name�bases�	namespace�kwargs�clsrrrr#TszABCMeta.__new__cCs
t||�S)z{Register a virtual subclass of an ABC.

            Returns the subclass, to allow usage as a class decorator.
            )r�r)�subclassrrr�registerYszABCMeta.registercCs
t||�S)z'Override for isinstance(instance, cls).)r)r)�instancerrr�__instancecheck__`szABCMeta.__instancecheck__cCs
t||�S)z'Override for issubclass(subclass, cls).)rr*rrr�__subclasscheck__dszABCMeta.__subclasscheck__NcCs�td|j�d|j��|d�tdt���|d�t|�\}}}}td|��|d�td|��|d�td|��|d�td|��|d�d	S)
z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: z_abc_registry: z_abc_cache: z_abc_negative_cache: z_abc_negative_cache_version: N)�printrrrr)r)r1�
_abc_registry�
_abc_cache�_abc_negative_cache�_abc_negative_cache_versionrrr�_dump_registryhs�
�zABCMeta._dump_registrycCst|�dS)z.Clear the registry (for debugging or testing).N)r�r)rrr�_abc_registry_cleartszABCMeta._abc_registry_clearcCst|�dS)z,Clear the caches (for debugging or testing).N)r r8rrr�_abc_caches_clearxszABCMeta._abc_caches_clear)N)rrrrr#r,r.r/r7r9r:rrrrrr!Gs
r!c@seZdZdZdZdS)�ABCzVHelper class that provides a standard way to create an ABC using
    inheritance.
    rN)rrrr�	__slots__rrrrr;}sr;)�	metaclassN)rr�classmethodr�staticmethodr�propertyr�_abcrrrrrrrr �ImportErrorZ_py_abcr!r�typer;rrrr�<module>s

	,6cmd.cpython-38.opt-2.pyc000064400000016043151450073350010706 0ustar00U

e5d:�@s<ddlZddlZdgZdZejejdZGdd�d�ZdS)�N�Cmdz(Cmd) �_c@s�eZdZeZeZdZdZdZ	dZ
dZdZdZ
dZdZd/d
d�Zd0dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Z d1d-d.�Z!dS)2r�=�Nz(Documented commands (type help <topic>):zMiscellaneous help topics:zUndocumented commands:z*** No help on %s��tabcCs@|dk	r||_ntj|_|dk	r(||_ntj|_g|_||_dS�N)�stdin�sys�stdout�cmdqueue�completekey)�selfr
r	r�r�/usr/lib64/python3.8/cmd.py�__init__LszCmd.__init__cCs�|��|jr\|jr\z2ddl}|��|_|�|j�|�|jd�Wnt	k
rZYnXz�|dk	rl||_
|j
r�|j�t
|j
�d�d}|�s4|jr�|j�d�}nl|jr�zt|j�}Wntk
r�d}YnXn<|j�|j�|j��|j��}t|��sd}n
|�d�}|�|�}|�|�}|�||�}q�|��W5|j�r�|j�r�zddl}|�|j�Wnt	k
�r~YnXXdS)Nrz
: complete�
�EOFz
)�preloop�use_rawinputr
�readlineZ
get_completerZ
old_completerZ
set_completer�complete�parse_and_bind�ImportError�intror�write�strr�pop�input�prompt�EOFError�flushr	�len�rstrip�precmd�onecmd�postcmd�postloop)rrr�stop�linerrr�cmdloopbsN






zCmd.cmdloopcCs|Srr�rr)rrrr$�sz
Cmd.precmdcCs|Srr)rr(r)rrrr&�szCmd.postcmdcCsdSrr�rrrrr�szCmd.preloopcCsdSrrr,rrrr'�szCmd.postloopcCs�|��}|sdd|fS|ddkr4d|dd�}n2|ddkrft|d�r\d|dd�}n
dd|fSdt|�}}||kr�|||jkr�|d}qt|d|�||d���}}|||fS)Nr�?zhelp r�!Zdo_shellzshell )�strip�hasattrr"�
identchars)rr)�i�n�cmd�argrrr�	parseline�s



z
Cmd.parselinecCs�|�|�\}}}|s|��S|dkr.|�|�S||_|dkrBd|_|dkrT|�|�Szt|d|�}Wntk
r�|�|�YSX||�SdS)Nrr�do_)r6�	emptyline�default�lastcmd�getattr�AttributeError)rr)r4r5�funcrrrr%�s


z
Cmd.onecmdcCs|jr|�|j�SdSr)r:r%r,rrrr8�sz
Cmd.emptylinecCs|j�d|�dS)Nz*** Unknown syntax: %s
)rrr+rrrr9�szCmd.defaultcGsgSrr)r�ignoredrrr�completedefault�szCmd.completedefaultcsd|��fdd�|��D�S)Nr7cs"g|]}|���r|dd��qS)�N��
startswith��.0�a�Zdotextrr�
<listcomp>�s
z%Cmd.completenames.<locals>.<listcomp>)�	get_names)r�textr>rrFr�
completenames�szCmd.completenamesc
Cs�|dkr�ddl}|��}|��}t|�t|�}|��|}|��|}|dkr�|�|�\}	}
}|	dkrp|j}q�zt|d|	�}Wq�t	k
r�|j}Yq�Xn|j
}|||||�|_z|j|WStk
r�YdSXdS)NrrZ	complete_)
rZget_line_buffer�lstripr"Z
get_begidxZ
get_endidxr6r?r;r<rJZcompletion_matches�
IndexError)
rrI�staterZorigliner)�strippedZbegidxZendidxr4�argsZfooZcompfuncrrrr�s*zCmd.completecCs
t|j�Sr)�dir�	__class__r,rrrrHsz
Cmd.get_namescs4t|j���}t�fdd�|��D��}t||B�S)Nc3s,|]$}|�d�d�r|dd�VqdS)�help_r�NrArC�rOrr�	<genexpr> s�z$Cmd.complete_help.<locals>.<genexpr>)�setrJrH�list)rrOZcommandsZtopicsrrTr�
complete_helpszCmd.complete_helpcCs�|r�zt|d|�}Wn|tk
r�z4t|d|�j}|rX|j�dt|��WYdSWntk
rnYnX|j�dt|j|f��YdSX|��n|��}g}g}i}|D]$}|dd�dkr�d||dd�<q�|��d}	|D]p}|dd�dkr�||	k�rq�|}	|dd�}
|
|k�r8|�	|
�||
=q�t||�j�rR|�	|
�q�|�	|
�q�|j�dt|j
��|�|j|dd	�|�|j
t|���dd	�|�|j|dd	�dS)
NrRr7�%s
rSrrr@��P)r;r<�__doc__rrr�nohelprH�sort�append�
doc_leader�print_topics�
doc_header�misc_headerrW�keys�undoc_header)rr5r=�doc�namesZcmds_docZ
cmds_undoc�help�nameZprevnamer4rrr�do_help$sN



zCmd.do_helpcCs\|rX|j�dt|��|jr<|j�dt|jt|���|�||d�|j�d�dS)NrYrr)rrr�rulerr"�	columnize)r�headerZcmdsZcmdlenZmaxcolrrrraRszCmd.print_topicsr[cs��s|j�d�dS�fdd�tt���D�}|rJtdd�tt|����t��}|dkrv|j�dt�d��dStdt���D]�}||d|}g}d	}t|�D]h}	d}
t|�D]2}|||	}||kr�q�|}
t|
t|
��}
q�|�	|
�||
d
7}||kr��qq�||kr��q4q�t��}d}dg}t|�D]�}g}t|�D]4}	|||	}||k�rld}
n�|}
|�	|
��qL|�r�|d�s�|d=�q�tt|��D]}	||	�
||	�||	<�q�|j�dtd
�|����q<dS)Nz<empty>
csg|]}t�|t�s|�qSr)�
isinstancer)rDr2�rWrrrGds�z!Cmd.columnize.<locals>.<listcomp>z list[i] not a string for i in %sz, rrYr����r���z  )rr�ranger"�	TypeError�join�mapr�maxr_�ljust)rrWZdisplaywidthZ
nonstrings�sizeZnrowsZncolsZ	colwidthsZtotwidth�colZcolwidth�rowr2�xZtextsrrorrlZs\�


z
Cmd.columnize)rNN)N)r[)"�__name__�
__module__�__qualname__�PROMPTr�
IDENTCHARSr1rkr:rr`rbrcrer]rrr*r$r&rr'r6r%r8r9r?rJrrHrXrjrarlrrrrr4s:

4
		.)�stringr
�__all__r�Z
ascii_lettersZdigitsr�rrrrr�<module>-spickletools.cpython-38.opt-2.pyc000064400000157607151450073350012507 0ustar00U

e5d.m�L@s�
ddlZddlZddlZddlZddlZdddgZejZdZdZdZ	dZ
d	ZGd
d�de�Z
ddlmZd
d�Ze
ddedd�Zdd�Ze
ddedd�Zdd�Ze
ddedd�Zdd�Ze
dded d�Zd!d"�Ze
d#d$ed%d�Z�d�d'd(�Ze
d)eed*d�Zd+d,�Ze
d-eed.d�Zd/d0�Ze
d1eed2d�Z d3d4�Z!e
d5ee!d6d�Z"d7d8�Z#e
d9e	e#d:d�Z$d;d<�Z%e
d=ee%d>d�Z&d?d@�Z'e
dAe
e'dBd�Z(dCdD�Z)e
dEee)dFd�Z*dGdH�Z+e
dIee+dJd�Z,dKdL�Z-e
dMee-dNd�Z.dOdP�Z/e
dQee/dRd�Z0dSdT�Z1e
dUe
e1dVd�Z2dWdX�Z3e
dYee3dZd�Z4d[d\�Z5d]d^�Z6e
d_ee5d`d�Z7e
daee6dbd�Z8dcdd�Z9e
deee9dfd�Z:dgdh�Z;e
did$e;djd�Z<ddklm=Z=dldm�Z>e
dnee>dod�Z?dpdq�Z@e
dre	e@dsd�ZAGdtdu�due�ZBeBdveCdwdx�ZDZEeBdyeCeFfdzdx�ZGeBd{eFd|dx�ZHeBd}eId~dx�ZJeBdeKeLfd�dx�ZMZNeBd�eKd�dx�ZOeBd�ePd�dx�ZQeBd�eLd�dx�ZReBd�eSd�d�dx�ZTeBd�eUd�dx�ZVeBd�eWd�dx�ZXeBd�eYd�dx�ZZeBd�e[d�dx�Z\eBd�e[d�dx�Z]eBd�ed�dx�Z^eBd�ed�dx�Z_eBd�eBd�dx�Z`eBd�eBd�dx�ZaGd�d��d�e�ZbebZcecd�d�e7geGgdd�d��ecd�d�egeDgdd�d��ecd�d�egeDgdd�d��ecd�d�egeDgdd�d��ecd�d�e8geDgdd�d��ecd�d�e?geDgdd�d��ecd�d�eAgeDgdd�d��ecd�d�egeMgdd�d��ecd�d�e$geMgdd�d��ecd�d�e"geMgdd�d��ecd�d�e(geOgd�d�d��ecd�d�e&geOgd�d�d��ecd�d�e*geOgdd�d��ecd�d�e,geQgd�d�d��ecd�d�dge^gd�d�d��ecd�d�de^ge^gd�d�d��ecd�d�dgeTgdd�d��ecd�d�dgeHgdd�d��ecd�d�dgeHgdd�d��ecd�d�e.geRgdd�d��ecd�d�e0geRgdd�d��ecd�d�e2geRgdd�d��ecd�d�e4geRgdd�d��ecd�d�e:geJgdd�d��ecd�d�e<geJgdd�d��ecd�d�dgeXgdd�d��ecd�d�deXe_geXgdd�d��ecd�d�deXe`eageXgdd�d��ecd�d�de`eageXgdd�d��ecd�d�dgeVgdd�d��ecd�d�de`eageVgdd�d��ecd�d�de_geVgdd�d��ec�d�dde_e_geVgd�dd��ec�d�dde_e_e_geVgd�dd��ec�d�ddgeZgd�dd��ec�d	�d
de`eageZgd�dd��ec�d�d
deZe_e_geZgd�dd��ec�d�ddeZe`eageZgd�dd��ec�d�ddge\gd�dd��ec�d�dde\e`eage\gd�dd��ec�d�dde`eage]gd�dd��ec�d�dde_ggd�dd��ec�d�dde_ge_e_gd�d d��ec�d!�d"dge`gd�d#d��ec�d$�d%de`eaggd�d&d��ec�d'�d(e7ge_gd�d)d��ec�d*�d+ege_gd�d,d��ec�d-�d.ege_gd�d/d��ec�d0�d1e7ggd�d2d��ec�d3�d4eggd�d5d��ec�d6�d7eggd�d8d��ec�d9�d:de_ge_gd�d;d��ec�d<�d=ege_gd�d>d��ec�d?�d@ege_gd�dAd��ec�dB�dCege_gd�dDd��ec�dE�dFe ge_gd�dGd��ec�dH�dIdeReRge_gd�dJd��ec�dK�dLde_e_ge_gd�dMd��ec�dN�dOde_e_ge_gd�dPd��ec�dQ�dRe e`eage_gd�dSd��ec�dT�dUde`e_eage_gd�dVd��ec�dW�dXde_e_ge_gd�dYd��ec�dZ�d[de_e_e_ge_gd�d\d��ec�d]�d^eggd�d_d��ec�d`�dade_ggd�dbd��ec�dc�ddeggd�ded��ec�df�dgege_gd�dhd��ec�di�djde_ge_gd�dkd��gDZd[ciZeiZfeged�D]n\ZhZieijjeek�r<ek�dleijjeeeijjehf��eijlefk�rdek�dmeijlefeijlehf��eheeeijj<ehefeijl<�q[e[f[h[iiZmedD]Zieiemeijl<�q�[i�d��do�dp�Znen�[n�d��dq�dr�Zo�dsd�Zp�dtd�Zq�d��dud�ZrG�dv�dw��dw�Zs�dxZt�dyZueteu�dz�Zv�d{�d|�Zwex�d}k�
r�ddlyZyeyjz�d~�d�Z{e{j|�d�ey�}�d���d��d��d��e{j|�d��d�ej~ey�}�d���d��d��e{j|�d��d��d��d��d��e{j|�d��d�deC�d��d��e{j|�d��d��d��d��d��e{j|�d��d��d��d��d��e{j|�d��d��d��d��d��e{j|�d��d��d��d��e{��Z�e�j��
rJew�n�e�j��
rX�d�ndZ�e�j��
sne{���n�e�e�j��dk�
r�ere�j�de�j�de�j�e��nVe�j��
r�indZ�e�j�D]>Z�e�j�j�e�jj�d��Z�e�j���e��d��ere�e�j�e�e�j�e���
q�dS(��N�dis�genops�optimize���������������c@seZdZdZdd�ZdS)�ArgumentDescriptor��name�n�reader�doccCs||_||_||_||_dS�Nr)�selfrr
rr�r�#/usr/lib64/python3.8/pickletools.py�__init__�szArgumentDescriptor.__init__N��__name__�
__module__�__qualname__�	__slots__rrrrrr
�sr
)�unpackcCs"|�d�}|r|dStd��dS)N�rz'not enough data in stream to read uint1)�read�
ValueError��f�datarrr�
read_uint1�s
r!�uint1rzOne-byte unsigned integer.rcCs0|�d�}t|�dkr$td|�dStd��dS)N�z<Hrz'not enough data in stream to read uint2�r�len�_unpackrrrrr�
read_uint2�s	
r'�uint2r#z)Two-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)N�z<irz&not enough data in stream to read int4r$rrrr�	read_int4�s	
r*�int4r)z8Four-byte signed integer, little-endian, 2's complement.cCs0|�d�}t|�dkr$td|�dStd��dS)Nr)z<Irz'not enough data in stream to read uint4r$rrrr�
read_uint4s	
r,�uint4z*Four-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)N�z<Qrz'not enough data in stream to read uint8r$rrrr�
read_uint8&s	
r/�uint8r.z+Eight-byte unsigned integer, little-endian.TcCs�|��}|�d�std��|dd�}|rtdD]8}|�|�r.|�|�sVtd||f��|dd�}qtq.td|��|r�t�|�d�d	�}|S)
N�
z-no newline found when trying to read stringnlr)�"�'z,strinq quote %r not found at both ends of %rrzno string quotes around %rr�ascii)�readline�endswithr�
startswith�codecs�
escape_decode�decode)rr:�stripquotesr �qrrr�
read_stringnl;s"


�r=�stringnlz�A newline-terminated string.

                   This is a repr-style string, with embedded escapes, and
                   bracketing quotes.
                   cCst|dd�S)NF)r;)r=�rrrr�read_stringnl_noescapetsr@�stringnl_noescapeaA newline-terminated string.

                        This is a str-style string, without embedded escapes,
                        or bracketing quotes.  It should consist solely of
                        printable ASCII characters.
                        cCsdt|�t|�fS)Nz%s %s)r@r?rrr�read_stringnl_noescape_pair�srB�stringnl_noescape_paira�A pair of newline-terminated strings.

                             These are str-style strings, without embedded
                             escapes, or bracketing quotes.  They should
                             consist solely of printable ASCII characters.
                             The pair is returned as a single string, with
                             a single blank separating the two strings.
                             cCs@t|�}|�|�}t|�|kr(|�d�Std|t|�f��dS)N�latin-1z2expected %d bytes in a string1, but only %d remain)r!rr%r:r�rr
r rrr�read_string1�s	


�rF�string1z�A counted string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes in the string, and the second argument is that many
              bytes.
              cCsTt|�}|dkrtd|��|�|�}t|�|kr<|�d�Std|t|�f��dS)Nrzstring4 byte count < 0: %drDz2expected %d bytes in a string4, but only %d remain)r*rrr%r:rErrr�read_string4�s



�rH�string4z�A counted string.

              The first argument is a 4-byte little-endian signed int giving
              the number of bytes in the string, and the second argument is
              that many bytes.
              cCs:t|�}|�|�}t|�|kr"|Std|t|�f��dS)Nz1expected %d bytes in a bytes1, but only %d remain)r!rr%rrErrr�read_bytes1�s	

�rJ�bytes1z�A counted bytes string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)Nz#bytes4 byte count > sys.maxsize: %dz1expected %d bytes in a bytes4, but only %d remain)r,�sys�maxsizerrr%rErrr�read_bytes4�s



�rN�bytes4z�A counted bytes string.

              The first argument is a 4-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)Nz#bytes8 byte count > sys.maxsize: %dz1expected %d bytes in a bytes8, but only %d remain)r/rLrMrrr%rErrr�read_bytes8s


�rP�bytes8z�A counted bytes string.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsTt|�}|tjkrtd|��|�|�}t|�|kr<t|�Std|t|�f��dS)Nz'bytearray8 byte count > sys.maxsize: %dz5expected %d bytes in a bytearray8, but only %d remain)r/rLrMrrr%�	bytearrayrErrr�read_bytearray89s


�rS�
bytearray8z�A counted bytearray.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs0|��}|�d�std��|dd�}t|d�S)Nr1z4no newline found when trying to read unicodestringnlrzraw-unicode-escape)r5r6r�strrrrr�read_unicodestringnl[s

rV�unicodestringnlz�A newline-terminated Unicode string.

                      This is raw-unicode-escape encoded, so consists of
                      printable ASCII characters, and may contain embedded
                      escape sequences.
                      cCsBt|�}|�|�}t|�|kr*t|dd�Std|t|�f��dS)N�utf-8�
surrogatepassz9expected %d bytes in a unicodestring1, but only %d remain)r!rr%rUrrErrr�read_unicodestring1us

�rZ�unicodestring1aAA counted Unicode string.

                    The first argument is a 1-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)Nz+unicodestring4 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring4, but only %d remain)r,rLrMrrr%rUrErrr�read_unicodestring4�s


�r\�unicodestring4aAA counted Unicode string.

                    The first argument is a 4-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)Nz+unicodestring8 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring8, but only %d remain)r/rLrMrrr%rUrErrr�read_unicodestring8�s


�r^�unicodestring8aBA counted Unicode string.

                    The first argument is an 8-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCs.t|ddd�}|dkrdS|dkr&dSt|�S)NF�r:r;s00s01T�r=�int�r�srrr�read_decimalnl_short�srecCs2t|ddd�}|dd�dkr*|dd�}t|�S)NFr`r�Lrarcrrr�read_decimalnl_longsrg�decimalnl_shorta�A newline-terminated decimal integer literal.

                          This never has a trailing 'L', and the integer fit
                          in a short Python int on the box where the pickle
                          was written -- but there's no guarantee it will fit
                          in a short Python int on the box where the pickle
                          is read.
                          �decimalnl_longz�A newline-terminated decimal integer literal.

                         This has a trailing 'L', and can represent integers
                         of any size.
                         cCst|ddd�}t|�S)NFr`)r=�floatrcrrr�read_floatnl-srk�floatnla�A newline-terminated decimal floating literal.

              In general this requires 17 significant digits for roundtrip
              identity, and pickling then unpickling infinities, NaNs, and
              minus zero doesn't work across boxes, or on some boxes even
              on itself (e.g., Windows can't read the strings it produces
              for infinities or NaNs).
              cCs0|�d�}t|�dkr$td|�dStd��dS)Nr.z>drz(not enough data in stream to read float8r$rrrr�read_float8Cs

rm�float8aAn 8-byte binary representation of a float, big-endian.

             The format is unique to Python, and shared with the struct
             module (format string '>d') "in theory" (the struct and pickle
             implementations don't share the code -- they should).  It's
             strongly related to the IEEE-754 double format, and, in normal
             cases, is in fact identical to the big-endian 754 double format.
             On other boxes the dynamic range is limited to that of a 754
             double, and "add a half and chop" rounding is used to reduce
             the precision to 53 bits.  However, even on a 754 box,
             infinities, NaNs, and minus zero may not be handled correctly
             (may not survive roundtrip pickling intact).
             )�decode_longcCs.t|�}|�|�}t|�|kr&td��t|�S)Nz'not enough data in stream to read long1)r!rr%rrorErrr�
read_long1is

rp�long1aA binary long, little-endian, using 1-byte size.

    This first reads one byte as an unsigned size, then reads that
    many bytes and interprets them as a little-endian 2's-complement long.
    If the size is 0, that's taken as a shortcut for the long 0L.
    cCsBt|�}|dkrtd|��|�|�}t|�|kr:td��t|�S)Nrzlong4 byte count < 0: %dz'not enough data in stream to read long4)r*rrr%rorErrr�
read_long4�s
rr�long4a�A binary representation of a long, little-endian.

    This first reads four bytes as a signed size (but requires the
    size to be >= 0), then reads that many bytes and interprets them
    as a little-endian 2's-complement long.  If the size is 0, that's taken
    as a shortcut for the int 0, although LONG1 should really be used
    then instead (and in any case where # of bytes < 256).
    c@s eZdZdZdd�Zdd�ZdS)�StackObject�r�obtypercCs*||_t|t�r|D]}q||_||_dSr)r�
isinstance�tuplervr)rrrvrZ	containedrrrr�s
zStackObject.__init__cCs|jSr�r)rrrr�__repr__�szStackObject.__repr__N)rrrrrrzrrrrrt�s
rtrbzA Python integer object.ruZint_or_boolz#A Python integer or boolean object.�boolzA Python boolean object.rjzA Python float object.Zbytes_or_strz*A Python bytes or (Unicode) string object.�byteszA Python bytes object.rRzA Python bytearray object.rUz!A Python (Unicode) string object.�NonezThe Python None object.rxzA Python tuple object.�listzA Python list object.�dictzA Python dict object.�setzA Python set object.�	frozensetzA Python frozenset object.�bufferzA Python buffer-like object.�anyzAny kind of object whatsoever.Zmarkaz'The mark' is a unique object.

Opcodes that operate on a variable number of objects
generally don't embed the count of objects in the opcode,
or pull it off the stack.  Instead the MARK opcode is used
to push a special marker object on the stack, and then
some other opcodes grab all the objects from the top of
the stack down to (but not including) the topmost marker
object.
�
stackslicea�An object representing a contiguous slice of the stack.

This is used in conjunction with markobject, to represent all
of the stack following the topmost markobject.  For example,
the POP_MARK opcode changes the stack from

    [..., markobject, stackslice]
to
    [...]

No matter how many object are on the stack after the topmost
markobject, POP_MARK gets rid of all of them (including the
topmost markobject too).
c@seZdZdZdd�ZdS)�
OpcodeInfo�r�code�arg�stack_before�stack_after�protorc	CsB||_||_||_|D]}q||_|D]}q&||_||_||_dSrr�)	rrr�r�r�r�r�r�xrrrrdszOpcodeInfo.__init__Nrrrrrr�Esr�ZINT�Ia�Push an integer or bool.

      The argument is a newline-terminated decimal literal string.

      The intent may have been that this always fit in a short Python int,
      but INT can be generated in pickles written on a 64-bit box that
      require a Python long on a 32-bit box.  The difference between this
      and LONG then is that INT skips a trailing 'L', and produces a short
      int whenever possible.

      Another difference is due to that, when bool was introduced as a
      distinct type in 2.3, builtin names True and False were also added to
      2.2.2, mapping to ints 1 and 0.  For compatibility in both directions,
      True gets pickled as INT + "I01\n", and False as INT + "I00\n".
      Leading zeroes are never produced for a genuine integer.  The 2.3
      (and later) unpicklers special-case these and return bool instead;
      earlier unpicklers ignore the leading "0" and return the int.
      r�ZBININT�Ja1Push a four-byte signed integer.

      This handles the full range of Python (short) integers on a 32-bit
      box, directly as binary bytes (1 for the opcode and 4 for the integer).
      If the integer is non-negative and fits in 1 or 2 bytes, pickling via
      BININT1 or BININT2 saves space.
      ZBININT1�Kz�Push a one-byte unsigned integer.

      This is a space optimization for pickling very small non-negative ints,
      in range(256).
      ZBININT2�Mz�Push a two-byte unsigned integer.

      This is a space optimization for pickling small positive ints, in
      range(256, 2**16).  Integers in range(256) can also be pickled via
      BININT2, but BININT1 instead saves a byte.
      ZLONG�La�Push a long integer.

      The same as INT, except that the literal ends with 'L', and always
      unpickles to a Python long.  There doesn't seem a real purpose to the
      trailing 'L'.

      Note that LONG takes time quadratic in the number of digits when
      unpickling (this is simply due to the nature of decimal->binary
      conversion).  Proto 2 added linear-time (in C; still quadratic-time
      in Python) LONG1 and LONG4 opcodes.
      ZLONG1�Šz|Long integer using one-byte length.

      A more efficient encoding of a Python long; the long1 encoding
      says it all.ZLONG4�‹z~Long integer using found-byte length.

      A more efficient encoding of a Python long; the long4 encoding
      says it all.�STRING�Sa�Push a Python string object.

      The argument is a repr-style string, with bracketing quote characters,
      and perhaps embedded escapes.  The argument extends until the next
      newline character.  These are usually decoded into a str instance
      using the encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      Z	BINSTRING�Ta�Push a Python string object.

      There are two arguments: the first is a 4-byte little-endian
      signed int giving the number of bytes in the string, and the
      second is that many bytes, which are taken literally as the string
      content.  These are usually decoded into a str instance using the
      encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      ZSHORT_BINSTRING�Ua�Push a Python string object.

      There are two arguments: the first is a 1-byte unsigned int giving
      the number of bytes in the string, and the second is that many
      bytes, which are taken literally as the string content.  These are
      usually decoded into a str instance using the encoding given to
      the Unpickler constructor. or the default, 'ASCII'.  If the
      encoding given was 'bytes' however, they will be decoded as bytes
      object instead.
      ZBINBYTES�B�z�Push a Python bytes object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes, and the second is that many bytes, which are
      taken literally as the bytes content.
      ZSHORT_BINBYTES�Cz�Push a Python bytes object.

      There are two arguments:  the first is a 1-byte unsigned int giving
      the number of bytes, and the second is that many bytes, which are taken
      literally as the string content.
      Z	BINBYTES8�Žz�Push a Python bytes object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the string, and the second is that many bytes,
      which are taken literally as the string content.
      Z
BYTEARRAY8�–�z�Push a Python bytearray object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the bytearray, and the second is that many bytes,
      which are taken literally as the bytearray content.
      ZNEXT_BUFFER�—z"Push an out-of-band buffer object.ZREADONLY_BUFFER�˜z,Make an out-of-band buffer object read-only.ZNONE�NzPush None on the stack.ZNEWTRUE�ˆzPush True onto the stack.ZNEWFALSE�‰zPush False onto the stack.�UNICODE�Vz�Push a Python Unicode string object.

      The argument is a raw-unicode-escape encoding of a Unicode string,
      and so may contain embedded escape sequences.  The argument extends
      until the next newline character.
      ZSHORT_BINUNICODE�ŒaPush a Python Unicode string object.

      There are two arguments:  the first is a 1-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      Z
BINUNICODE�XaPush a Python Unicode string object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZBINUNICODE8�aPush a Python Unicode string object.

      There are two arguments:  the first is an 8-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZFLOAT�Fa�Newline-terminated decimal float literal.

      The argument is repr(a_float), and in general requires 17 significant
      digits for roundtrip conversion to be an identity (this is so for
      IEEE-754 double precision values, which is what Python float maps to
      on most boxes).

      In general, FLOAT cannot be used to transport infinities, NaNs, or
      minus zero across boxes (or even on a single box, if the platform C
      library can't read the strings it produces for such things -- Windows
      is like that), but may do less damage than BINFLOAT on boxes with
      greater precision or dynamic range than IEEE-754 double.
      ZBINFLOAT�Ga�Float stored in binary form, with 8 bytes of data.

      This generally requires less than half the space of FLOAT encoding.
      In general, BINFLOAT cannot be used to transport infinities, NaNs, or
      minus zero, raises an exception if the exponent exceeds the range of
      an IEEE-754 double, and retains no more than 53 bits of precision (if
      there are more than that, "add a half and chop" rounding is used to
      cut it back to 53 significant bits).
      Z
EMPTY_LIST�]zPush an empty list.ZAPPEND�az�Append an object to a list.

      Stack before:  ... pylist anyobject
      Stack after:   ... pylist+[anyobject]

      although pylist is really extended in-place.
      ZAPPENDS�ez�Extend a list by a slice of stack objects.

      Stack before:  ... pylist markobject stackslice
      Stack after:   ... pylist+stackslice

      although pylist is really extended in-place.
      ZLIST�lasBuild a list out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python list, which single list object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... [1, 2, 3, 'abc']
      ZEMPTY_TUPLE�)zPush an empty tuple.ZTUPLE�tavBuild a tuple out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python tuple, which single tuple object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... (1, 2, 3, 'abc')
      ZTUPLE1�…z�Build a one-tuple out of the topmost item on the stack.

      This code pops one value off the stack and pushes a tuple of
      length 1 whose one item is that value back onto it.  In other
      words:

          stack[-1] = tuple(stack[-1:])
      ZTUPLE2�†aBuild a two-tuple out of the top two items on the stack.

      This code pops two values off the stack and pushes a tuple of
      length 2 whose items are those values back onto it.  In other
      words:

          stack[-2:] = [tuple(stack[-2:])]
      ZTUPLE3�‡aBuild a three-tuple out of the top three items on the stack.

      This code pops three values off the stack and pushes a tuple of
      length 3 whose items are those values back onto it.  In other
      words:

          stack[-3:] = [tuple(stack[-3:])]
      Z
EMPTY_DICT�}zPush an empty dict.ZDICT�da�Build a dict out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python dict, which single dict object replaces all of the
      stack from the topmost markobject onward.  The stack slice alternates
      key, value, key, value, ....  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... {1: 2, 3: 'abc'}
      ZSETITEMrdz�Add a key+value pair to an existing dict.

      Stack before:  ... pydict key value
      Stack after:   ... pydict

      where pydict has been modified via pydict[key] = value.
      ZSETITEMS�ua\Add an arbitrary number of key+value pairs to an existing dict.

      The slice of the stack following the topmost markobject is taken as
      an alternating sequence of keys and values, added to the dict
      immediately under the topmost markobject.  Everything at and after the
      topmost markobject is popped, leaving the mutated dict at the top
      of the stack.

      Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
      Stack after:   ... pydict

      where pydict has been modified via pydict[key_i] = value_i for i in
      1, 2, ..., n, and in that order.
      Z	EMPTY_SET�zPush an empty set.ZADDITEMS�a$Add an arbitrary number of items to an existing set.

      The slice of the stack following the topmost markobject is taken as
      a sequence of items, added to the set immediately under the topmost
      markobject.  Everything at and after the topmost markobject is popped,
      leaving the mutated set at the top of the stack.

      Stack before:  ... pyset markobject item_1 ... item_n
      Stack after:   ... pyset

      where pyset has been modified via pyset.add(item_i) = item_i for i in
      1, 2, ..., n, and in that order.
      Z	FROZENSET�‘azBuild a frozenset out of the topmost slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python frozenset, which single frozenset object replaces all
      of the stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3
      Stack after:  ... frozenset({1, 2, 3})
      �POP�0z<Discard the top stack item, shrinking the stack by one item.ZDUP�2z=Push the top stack item onto the stack again, duplicating it.�MARK�(z�Push markobject onto the stack.

      markobject is a unique object, used by other opcodes to identify a
      region of the stack containing a variable number of objects for them
      to work on.  See markobject.doc for more detail.
      ZPOP_MARK�1aPop all the stack objects at and above the topmost markobject.

      When an opcode using a variable number of stack objects is done,
      POP_MARK is used to remove those objects, and to remove the markobject
      that delimited their starting position on the stack.
      �GET�gz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the newline-terminated
      decimal string following.  BINGET and LONG_BINGET are space-optimized
      versions.
      �BINGET�hz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 1-byte unsigned
      integer following.
      �LONG_BINGET�jz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 4-byte unsigned
      little-endian integer following.
      �PUT�pz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the newline-
      terminated decimal string following.  BINPUT and LONG_BINPUT are
      space-optimized versions.
      �BINPUTr<z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 1-byte
      unsigned integer following.
      �LONG_BINPUT�rz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 4-byte
      unsigned little-endian integer following.
      �MEMOIZE�”z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write is the number of
      elements currently present in the memo.
      ZEXT1�‚a�Extension code.

      This code and the similar EXT2 and EXT4 allow using a registry
      of popular objects that are pickled by name, typically classes.
      It is envisioned that through a global negotiation and
      registration process, third parties can set up a mapping between
      ints and object names.

      In order to guarantee pickle interchangeability, the extension
      code registry ought to be global, although a range of codes may
      be reserved for private use.

      EXT1 has a 1-byte integer argument.  This is used to index into the
      extension registry, and the object at that index is pushed on the stack.
      ZEXT2�ƒzNExtension code.

      See EXT1.  EXT2 has a two-byte integer argument.
      ZEXT4�„zOExtension code.

      See EXT1.  EXT4 has a four-byte integer argument.
      ZGLOBAL�ca�Push a global object (module.attr) on the stack.

      Two newline-terminated strings follow the GLOBAL opcode.  The first is
      taken as a module name, and the second as a class name.  The class
      object module.class is pushed on the stack.  More accurately, the
      object returned by self.find_class(module, class) is pushed on the
      stack, so unpickling subclasses can override this form of lookup.
      ZSTACK_GLOBAL�“z7Push a global object (module.attr) on the stack.
      ZREDUCE�RaLPush an object built from a callable and an argument tuple.

      The opcode is named to remind of the __reduce__() method.

      Stack before: ... callable pytuple
      Stack after:  ... callable(*pytuple)

      The callable and the argument tuple are the first two items returned
      by a __reduce__ method.  Applying the callable to the argtuple is
      supposed to reproduce the original object, or at least get it started.
      If the __reduce__ method returns a 3-tuple, the last component is an
      argument to be passed to the object's __setstate__, and then the REDUCE
      opcode is followed by code to create setstate's argument, and then a
      BUILD opcode to apply  __setstate__ to that argument.

      If not isinstance(callable, type), REDUCE complains unless the
      callable has been registered with the copyreg module's
      safe_constructors dict, or the callable has a magic
      '__safe_for_unpickling__' attribute with a true value.  I'm not sure
      why it does this, but I've sure seen this complaint often enough when
      I didn't want to <wink>.
      ZBUILD�ba�Finish building an object, via __setstate__ or dict update.

      Stack before: ... anyobject argument
      Stack after:  ... anyobject

      where anyobject may have been mutated, as follows:

      If the object has a __setstate__ method,

          anyobject.__setstate__(argument)

      is called.

      Else the argument must be a dict, the object must have a __dict__, and
      the object is updated via

          anyobject.__dict__.update(argument)
      ZINST�iaqBuild a class instance.

      This is the protocol 0 version of protocol 1's OBJ opcode.
      INST is followed by two newline-terminated strings, giving a
      module and class name, just as for the GLOBAL opcode (and see
      GLOBAL for more details about that).  self.find_class(module, name)
      is used to get a class object.

      In addition, all the objects on the stack following the topmost
      markobject are gathered into a tuple and popped (along with the
      topmost markobject), just as for the TUPLE opcode.

      Now it gets complicated.  If all of these are true:

        + The argtuple is empty (markobject was at the top of the stack
          at the start).

        + The class object does not have a __getinitargs__ attribute.

      then we want to create an old-style class instance without invoking
      its __init__() method (pickle has waffled on this over the years; not
      calling __init__() is current wisdom).  In this case, an instance of
      an old-style dummy class is created, and then we try to rebind its
      __class__ attribute to the desired class object.  If this succeeds,
      the new instance object is pushed on the stack, and we're done.

      Else (the argtuple is not empty, it's not an old-style class object,
      or the class object does have a __getinitargs__ attribute), the code
      first insists that the class object have a __safe_for_unpickling__
      attribute.  Unlike as for the __safe_for_unpickling__ check in REDUCE,
      it doesn't matter whether this attribute has a true or false value, it
      only matters whether it exists (XXX this is a bug).  If
      __safe_for_unpickling__ doesn't exist, UnpicklingError is raised.

      Else (the class object does have a __safe_for_unpickling__ attr),
      the class object obtained from INST's arguments is applied to the
      argtuple obtained from the stack, and the resulting instance object
      is pushed on the stack.

      NOTE:  checks for __safe_for_unpickling__ went away in Python 2.3.
      NOTE:  the distinction between old-style and new-style classes does
             not make sense in Python 3.
      ZOBJ�oa�Build a class instance.

      This is the protocol 1 version of protocol 0's INST opcode, and is
      very much like it.  The major difference is that the class object
      is taken off the stack, allowing it to be retrieved from the memo
      repeatedly if several instances of the same class are created.  This
      can be much more efficient (in both time and space) than repeatedly
      embedding the module and class names in INST opcodes.

      Unlike INST, OBJ takes no arguments from the opcode stream.  Instead
      the class object is taken off the stack, immediately above the
      topmost markobject:

      Stack before: ... markobject classobject stackslice
      Stack after:  ... new_instance_object

      As for INST, the remainder of the stack above the markobject is
      gathered into an argument tuple, and then the logic seems identical,
      except that no __safe_for_unpickling__ check is done (XXX this is
      a bug).  See INST for the gory details.

      NOTE:  In Python 2.3, INST and OBJ are identical except for how they
      get the class object.  That was always the intent; the implementations
      had diverged for accidental reasons.
      ZNEWOBJ�aLBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple (the tuple being the stack
      top).  Call these cls and args.  They are popped off the stack,
      and the value returned by cls.__new__(cls, *args) is pushed back
      onto the stack.
      Z	NEWOBJ_EX�’auBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple and by a keyword argument dict
      (the dict being the stack top).  Call these cls and args.  They are
      popped off the stack, and the value returned by
      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
      �PROTO�€z�Protocol version indicator.

      For protocol 2 and above, a pickle must start with this opcode.
      The argument is the protocol version, an int in range(2, 256).
      ZSTOP�.z�Stop the unpickling machine.

      Every pickle ends with this opcode.  The object at the top of the stack
      is popped, and that's the result of unpickling.  The stack should be
      empty then.
      �FRAME�•z�Indicate the beginning of a new frame.

      The unpickler may use this opcode to safely prefetch data from its
      underlying stream.
      ZPERSID�PaPush an object identified by a persistent ID.

      The pickle module doesn't define what a persistent ID means.  PERSID's
      argument is a newline-terminated str-style (no embedded escapes, no
      bracketing quote characters) string, which *is* "the persistent ID".
      The unpickler passes this string to self.persistent_load().  Whatever
      object that returns is pushed on the stack.  There is no implementation
      of persistent_load() in Python's unpickler:  it must be supplied by an
      unpickler subclass.
      Z	BINPERSID�QaXPush an object identified by a persistent ID.

      Like PERSID, except the persistent ID is popped off the stack (instead
      of being a string embedded in the opcode bytestream).  The persistent
      ID is passed to self.persistent_load(), and whatever object that
      returns is pushed on the stack.  See PERSID for more detail.
      z%repeated name %r at indices %d and %dz%repeated code %r at indices %d and %dFcCst��}tjD]�}t�d|�s0|rtd|�qtt|�}t|t	�rPt
|�dkrf|rtd||f�q|�d�}||kr�|r�td||f�||}|j|kr�t
d|||jf��||=qt
d||f��q|�rd	g}|��D]\}}|�d
|j|f�q�t
d�|���dS)Nz[A-Z][A-Z0-9_]+$z0skipping %r: it doesn't look like an opcode namerz5skipping %r: value %r doesn't look like a pickle coderDz+checking name %r w/ code %r for consistencyzBfor pickle code %r, pickle.py uses name %r but we're using name %rzPpickle.py appears to have a pickle opcode with name %r and code %r, but we don'tz=we appear to have pickle opcodes that pickle.py doesn't have:z    name %r with code %r�
)�code2op�copy�pickle�__all__�re�match�print�getattrrwr|r%r:rr�items�append�join)�verboser�rZ
picklecoder��msgr�rrr�assure_pickle_consistency�sJ

�
�
���r�ccs�t|t�rt�|�}t|d�r&|j}ndd�}|�}|�d�}t�|�	d��}|dkr�|dkrht
d��nt
d|dkrxd	n||f��|jdkr�d}n|j�|�}|r�||||�fVn|||fV|d
kr.q�q.dS)N�tellcSsdSrrrrrr�<lambda>��z_genops.<locals>.<lambda>rrDr�z#pickle exhausted before seeing STOPz!at position %s, opcode %r unknownz	<unknown>�.)
rw�bytes_types�io�BytesIO�hasattrr�rr��getr:rr�r)r �
yield_end_posZgetpos�posr��opcoder�rrr�_genops�s.




�
r�cCst|�Sr)r�)r�rrrr�scCsd}d}t�}i}g}d}d}t|dd�D]�\}}	}
}d|jkrZ|�|	�|�||	f�q*|jdkr�t|�}|�|�|�||f�q*d|jkr�q*d|jkr�|j|kr�|j}d||	<|�||	f�q*|jd	k�r|	|kr�|	}|
dkr�||
|�}n|�|
|f�q*|�|
|f�q*~t��}
|
�	|�t
�|
|�}|d
k�rF|j�
�d}|D]�\}}	d}||k�r�|	|k�rr�qN|�|�}|||	<|d7}n6||k�r�|�||	�}n|||	�}t|�|jjk}|jj|d
�|�r�|j�|�n
|�	|��qN|j��|
��S)Nr�r�rr�T)r�r�r�r�r)Fr)Zforce)r�r�r�addr�r%r�r�r��writer�Z_PicklerZframerZ
start_framing�putr�Z_FRAME_SIZE_TARGETZcommit_frameZ
file_writeZend_framing�getvalue)r�r�r�ZoldidsZnewids�opcodesr�Zprotoheaderr�r�r�Zend_pos�idx�outZpickler�opZ	framelessr rrrr	sl















c	Csg}|dkri}d}g}d|}d}	|}
t|�D�]�\}}}
|
dk	rVtd|
d|d�dt|j�dd�|t|�|jf}t||j�}|j}|j	}t|�}d}t
|ks�|jdk�r@|�r@|dt
k�r@|�r8|��}|dkr�d}nd	|}|dt
k	�r|��q�|��z|�t
�}Wnt
k
�r4d
}YnXnd}	}|jdk�r�|jd
k�rjt|�}d|}n|}||k�r�d|}	n,|�s�d}	n |dt
k�r�d}	n|d||<n*|jdk�r�||k�r�||g}nd|}	|dk	�s�|�r,|ddt|j�7}|dk	�r|dt|�7}|�r,|d|7}|�rv|d|
t|�7}t|�}
|
dk�r\|}
|d|j�dd�d
7}t||d�|	�r�t
|	��t|�|k�r�t
d|t|�f��|�r�||d�=t
|k�r�|�|
�|�|�q0td||d�|�rt
d|��dS)Nr� z%5d:)�end�filez	%-4s %s%srr�z(MARK at unknown opcode offset)z(MARK at %d)rzno MARK exists on stack)r�r�r�r�r�z(as %d)zmemo key %r already definedz'stack is empty -- can't store into memoz"can't store markobject in the memo)r�r�r�z&memo key %r has never been stored into�
�2r�)rz3tries to pop %d items from stack with only %d itemsz highest protocol among opcodes =zstack not empty after STOP: %r)rr��reprr�r%r�maxr�r�r��
markobject�pop�indexrr�splitr��extend)r�r�memo�indentlevel�annotate�stackZmaxprotoZ	markstackZindentchunkZerrormsgZannocolr�r�r��lineZbeforeZafterZnumtopopZmarkmsgZmarkposZmemo_idxrrrr[	s�-
��
�







�

c@seZdZdd�ZdS)�_ExamplecCs
||_dSr)�value)rrrrrr�	sz_Example.__init__N)rrrrrrrrr�	sra�
>>> import pickle
>>> x = [1, 2, (3, 4), {b'abc': "def"}]
>>> pkl0 = pickle.dumps(x, 0)
>>> dis(pkl0)
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: I    INT        1
    8: a    APPEND
    9: I    INT        2
   12: a    APPEND
   13: (    MARK
   14: I        INT        3
   17: I        INT        4
   20: t        TUPLE      (MARK at 13)
   21: p    PUT        1
   24: a    APPEND
   25: (    MARK
   26: d        DICT       (MARK at 25)
   27: p    PUT        2
   30: c    GLOBAL     '_codecs encode'
   46: p    PUT        3
   49: (    MARK
   50: V        UNICODE    'abc'
   55: p        PUT        4
   58: V        UNICODE    'latin1'
   66: p        PUT        5
   69: t        TUPLE      (MARK at 49)
   70: p    PUT        6
   73: R    REDUCE
   74: p    PUT        7
   77: V    UNICODE    'def'
   82: p    PUT        8
   85: s    SETITEM
   86: a    APPEND
   87: .    STOP
highest protocol among opcodes = 0

Try again with a "binary" pickle.

>>> pkl1 = pickle.dumps(x, 1)
>>> dis(pkl1)
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: K        BININT1    1
    6: K        BININT1    2
    8: (        MARK
    9: K            BININT1    3
   11: K            BININT1    4
   13: t            TUPLE      (MARK at 8)
   14: q        BINPUT     1
   16: }        EMPTY_DICT
   17: q        BINPUT     2
   19: c        GLOBAL     '_codecs encode'
   35: q        BINPUT     3
   37: (        MARK
   38: X            BINUNICODE 'abc'
   46: q            BINPUT     4
   48: X            BINUNICODE 'latin1'
   59: q            BINPUT     5
   61: t            TUPLE      (MARK at 37)
   62: q        BINPUT     6
   64: R        REDUCE
   65: q        BINPUT     7
   67: X        BINUNICODE 'def'
   75: q        BINPUT     8
   77: s        SETITEM
   78: e        APPENDS    (MARK at 3)
   79: .    STOP
highest protocol among opcodes = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
>>> dis(pickle.dumps(pickletools.dis, 0))
    0: c    GLOBAL     'pickletools dis'
   17: p    PUT        0
   20: .    STOP
highest protocol among opcodes = 0

>>> from pickletools import _Example
>>> x = [_Example(42)] * 2
>>> dis(pickle.dumps(x, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: c    GLOBAL     'copy_reg _reconstructor'
   30: p    PUT        1
   33: (    MARK
   34: c        GLOBAL     'pickletools _Example'
   56: p        PUT        2
   59: c        GLOBAL     '__builtin__ object'
   79: p        PUT        3
   82: N        NONE
   83: t        TUPLE      (MARK at 33)
   84: p    PUT        4
   87: R    REDUCE
   88: p    PUT        5
   91: (    MARK
   92: d        DICT       (MARK at 91)
   93: p    PUT        6
   96: V    UNICODE    'value'
  103: p    PUT        7
  106: I    INT        42
  110: s    SETITEM
  111: b    BUILD
  112: a    APPEND
  113: g    GET        5
  116: a    APPEND
  117: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(x, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: c        GLOBAL     'copy_reg _reconstructor'
   29: q        BINPUT     1
   31: (        MARK
   32: c            GLOBAL     'pickletools _Example'
   54: q            BINPUT     2
   56: c            GLOBAL     '__builtin__ object'
   76: q            BINPUT     3
   78: N            NONE
   79: t            TUPLE      (MARK at 31)
   80: q        BINPUT     4
   82: R        REDUCE
   83: q        BINPUT     5
   85: }        EMPTY_DICT
   86: q        BINPUT     6
   88: X        BINUNICODE 'value'
   98: q        BINPUT     7
  100: K        BININT1    42
  102: s        SETITEM
  103: b        BUILD
  104: h        BINGET     5
  106: e        APPENDS    (MARK at 3)
  107: .    STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-object test.

>>> L = []
>>> T = L,
>>> L.append(T)
>>> L[0] is T
True
>>> T[0] is L
True
>>> L[0][0] is L
True
>>> T[0][0] is T
True
>>> dis(pickle.dumps(L, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: (    MARK
    6: g        GET        0
    9: t        TUPLE      (MARK at 5)
   10: p    PUT        1
   13: a    APPEND
   14: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(L, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: h        BINGET     0
    6: t        TUPLE      (MARK at 3)
    7: q    BINPUT     1
    9: a    APPEND
   10: .    STOP
highest protocol among opcodes = 1

Note that, in the protocol 0 pickle of the recursive tuple, the disassembler
has to emulate the stack in order to realize that the POP opcode at 16 gets
rid of the MARK at 0.

>>> dis(pickle.dumps(T, 0))
    0: (    MARK
    1: (        MARK
    2: l            LIST       (MARK at 1)
    3: p        PUT        0
    6: (        MARK
    7: g            GET        0
   10: t            TUPLE      (MARK at 6)
   11: p        PUT        1
   14: a        APPEND
   15: 0        POP
   16: 0        POP        (MARK at 0)
   17: g    GET        1
   20: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(T, 1))
    0: (    MARK
    1: ]        EMPTY_LIST
    2: q        BINPUT     0
    4: (        MARK
    5: h            BINGET     0
    7: t            TUPLE      (MARK at 4)
    8: q        BINPUT     1
   10: a        APPEND
   11: 1        POP_MARK   (MARK at 0)
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 1

Try protocol 2.

>>> dis(pickle.dumps(L, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: .    STOP
highest protocol among opcodes = 2

>>> dis(pickle.dumps(T, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: 0    POP
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 2

Try protocol 3 with annotations:

>>> dis(pickle.dumps(T, 3), annotate=1)
    0: \x80 PROTO      3 Protocol version indicator.
    2: ]    EMPTY_LIST   Push an empty list.
    3: q    BINPUT     0 Store the stack top into the memo.  The stack is not popped.
    5: h    BINGET     0 Read an object from the memo and push it on the stack.
    7: \x85 TUPLE1       Build a one-tuple out of the topmost item on the stack.
    8: q    BINPUT     1 Store the stack top into the memo.  The stack is not popped.
   10: a    APPEND       Append an object to a list.
   11: 0    POP          Discard the top stack item, shrinking the stack by one item.
   12: h    BINGET     1 Read an object from the memo and push it on the stack.
   14: .    STOP         Stop the unpickling machine.
highest protocol among opcodes = 2

a=
>>> import pickle
>>> import io
>>> f = io.BytesIO()
>>> p = pickle.Pickler(f, 2)
>>> x = [1, 2, 3]
>>> p.dump(x)
>>> p.dump(x)
>>> f.seek(0)
0
>>> memo = {}
>>> dis(f, memo=memo)
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: K        BININT1    1
    8: K        BININT1    2
   10: K        BININT1    3
   12: e        APPENDS    (MARK at 5)
   13: .    STOP
highest protocol among opcodes = 2
>>> dis(f, memo=memo)
   14: \x80 PROTO      2
   16: h    BINGET     0
   18: .    STOP
highest protocol among opcodes = 2
)Zdisassembler_testZdisassembler_memo_testcCsddl}|��S)Nr)�doctestZtestmod)rrrr�_testsr�__main__z$disassemble one or more pickle files)Zdescription�pickle_file�br�*zthe pickle file)�type�nargs�helpz-oz--output�wz+the file where the output should be written)�defaultrrz-mz--memo�
store_truez#preserve memo between disassemblies)�actionrz-lz
--indentlevelz8the number of blanks by which to indent a new MARK levelz-az
--annotatez2annotate each line with a short opcode descriptionz-pz
--preamblez==> {name} <==zMif more than one pickle file is specified, print this before each disassembly)rrz-tz--testzrun self-test suitez-vz)run verbosely; only affects self-test run�ryr�)TT)F)F)NNr)r)�r8r�r�r�rLr�r�Z
UP_TO_NEWLINEZTAKEN_FROM_ARGUMENT1ZTAKEN_FROM_ARGUMENT4ZTAKEN_FROM_ARGUMENT4UZTAKEN_FROM_ARGUMENT8U�objectr
Zstructrr&r!r"r'r(r*r+r,r-r/r0r=r>r@rArBrCrFrGrHrIrJrKrNrOrPrQrSrTrVrWrZr[r\r]r^r_rergrhrirkrlrmrnrorprqrrrsrtrbZpyintZpylongr{Zpyinteger_or_boolZpyboolrjZpyfloatr|rUZpybytes_or_strZpystringZpybytesrRZpybytearrayZ	pyunicoderZpynonerxZpytupler~ZpylistrZpydictr�ZpysetZpyfrozensetZpybufferZ	anyobjectr	r�r�r�r�Zname2iZcode2i�	enumerater�r�rrr�r�r�r�rrrrZ	_dis_testZ
_memo_testZ__test__rr�argparse�ArgumentParser�parser�add_argumentZFileType�stdout�
parse_args�argsZtestrrZ
print_helpr%�outputrrrZpreamble�formatr�rrrr�<module>
s^
$�����/�
�	�������
��
�
�
�
�	�
����
����
�������������;����
���
����
�
����
���
�
�
�
����������������������
��
���
�����������2� ������������������
& 

C��
�
�������
�
sunau.cpython-38.pyc000064400000041272151450073350010340 0ustar00U

e5d�G�@s�dZddlmZddlZedd�ZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZdZeeee	e
egZGdd�de�Zdd�Zdd�ZGdd�d�ZGdd�d�Zd"dd�Zd#d d!�ZdS)$a�Stuff to parse Sun and NeXT audio files.

An audio file consists of a header followed by the data.  The structure
of the header is as follows.

        +---------------+
        | magic word    |
        +---------------+
        | header size   |
        +---------------+
        | data size     |
        +---------------+
        | encoding      |
        +---------------+
        | sample rate   |
        +---------------+
        | # of channels |
        +---------------+
        | info          |
        |               |
        +---------------+

The magic word consists of the 4 characters '.snd'.  Apart from the
info field, all header fields are 4 bytes in size.  They are all
32-bit unsigned integers encoded in big-endian byte order.

The header size really gives the start of the data.
The data size is the physical size of the data.  From the other
parameters the number of frames can be calculated.
The encoding gives the way in which audio samples are encoded.
Possible values are listed below.
The info field currently consists of an ASCII string giving a
human-readable description of the audio file.  The info field is
padded with NUL bytes to the header size.

Usage.

Reading audio files:
        f = sunau.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
        getnchannels()  -- returns number of audio channels (1 for
                           mono, 2 for stereo)
        getsampwidth()  -- returns sample width in bytes
        getframerate()  -- returns sampling frequency
        getnframes()    -- returns number of audio frames
        getcomptype()   -- returns compression type ('NONE' or 'ULAW')
        getcompname()   -- returns human-readable version of
                           compression type ('not compressed' matches 'NONE')
        getparams()     -- returns a namedtuple consisting of all of the
                           above in the above order
        getmarkers()    -- returns None (for compatibility with the
                           aifc module)
        getmark(id)     -- raises an error since the mark does not
                           exist (for compatibility with the aifc module)
        readframes(n)   -- returns at most n frames of audio
        rewind()        -- rewind to the beginning of the audio stream
        setpos(pos)     -- seek to the specified position
        tell()          -- return the current position
        close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing audio files:
        f = sunau.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
        setnchannels(n) -- set the number of channels
        setsampwidth(n) -- set the sample width
        setframerate(n) -- set the frame rate
        setnframes(n)   -- set the number of frames
        setcomptype(type, name)
                        -- set the compression type and the
                           human-readable compression type
        setparams(tuple)-- set all parameters at once
        tell()          -- return current position in output file
        writeframesraw(data)
                        -- write audio frames without pathing up the
                           file header
        writeframes(data)
                        -- write audio frames and patch up the file header
        close()         -- patch up the file header and close the
                           output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�)�
namedtupleN�
_sunau_paramsz7nchannels sampwidth framerate nframes comptype compnameidns.������������l��c@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/sunau.pyr�srcCs8d}td�D]&}|�d�}|s"t�|dt|�}q|S)Nrrr�)�range�read�EOFError�ord)�file�x�iZbyterrr�	_read_u32�s
rcCsFg}td�D]&}t|d�\}}|�dt|��|}q|�t|��dS)Nrrr)r�divmod�insert�int�write�bytes)rr�datar�d�mrrr�
_write_u32�sr'c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�Au_readcCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)N�r�rbTF��type�builtins�open�_opened�initfp��self�fr-rrr�__init__�szAu_read.__init__cCs|jr|��dS�N��_file�close�r2rrr�__del__�szAu_read.__del__cCs|Sr5rr9rrr�	__enter__�szAu_read.__enter__cGs|��dSr5�r8�r2�argsrrr�__exit__�szAu_read.__exit__c	Cs�||_d|_tt|��}|tkr(td��tt|��|_|jdkrHtd��|jdkrZtd��t|�|_|jtkrzt|j�|_tt|��|_	|j	t
kr�td��|j	ttfkr�d|_
d	|_nj|j	tkr�d	|_|_
nR|j	tkr�d|_|_
n:|j	tkr�d
|_|_
n"|j	tk�rd|_|_
ntd��tt|��|_tt|��|_|j�sLtd
��|j|j|_|jdk�r�|�|jd�|_|j�d�\|_}}nd|_z|��|_Wn ttfk
�r�d|_YnXdS)Nrzbad magic numberrzheader size too small�dzheader size ridiculously largezencoding not (yet) supportedrrrrzunknown encodingzbad # of channels��)r7�	_soundposr!r�AUDIO_FILE_MAGICrZ	_hdr_size�
_data_size�AUDIO_UNKNOWN_SIZE�	_encoding�_simple_encodings�AUDIO_FILE_ENCODING_MULAW_8�AUDIO_FILE_ENCODING_ALAW_8�
_sampwidth�
_framesize�AUDIO_FILE_ENCODING_LINEAR_8�AUDIO_FILE_ENCODING_LINEAR_16�AUDIO_FILE_ENCODING_LINEAR_24�AUDIO_FILE_ENCODING_LINEAR_32�
_framerate�
_nchannelsr�_info�	partition�tell�	_data_pos�AttributeError�OSError)r2r�magic�_rrrr0�sV




�


zAu_read.initfpcCs|jSr5)r7r9rrr�getfp�sz
Au_read.getfpcCs|jSr5)rRr9rrr�getnchannels�szAu_read.getnchannelscCs|jSr5)rKr9rrr�getsampwidth�szAu_read.getsampwidthcCs|jSr5)rQr9rrr�getframerate�szAu_read.getframeratecCs(|jtkrtS|jtkr$|j|jSdS�Nr)rErFrGrHrLr9rrr�
getnframes�s


zAu_read.getnframescCs$|jtkrdS|jtkrdSdSdS)N�ULAW�ALAW�NONE�rGrIrJr9rrr�getcomptype�s


zAu_read.getcomptypecCs$|jtkrdS|jtkrdSdSdS)N�CCITT G.711 u-law�CCITT G.711 A-law�not compressedrdr9rrr�getcompname�s


zAu_read.getcompnamecCs*t|��|��|��|��|��|���Sr5�rr\r]r^r`rerir9rrr�	getparamss�zAu_read.getparamscCsdSr5rr9rrr�
getmarkersszAu_read.getmarkerscCstd��dS)Nzno marks)r)r2�idrrr�getmarkszAu_read.getmarkcCsp|jtkrl|tkr|j��}n|j�||j�}|jt|�|j7_|jtkrhddl	}|�
||j�}|SdSr_)rGrHrFr7rrLrC�lenrI�audioopZulaw2linrK)r2�nframesr$rprrr�
readframess

zAu_read.readframescCs*|jdkrtd��|j�|j�d|_dS)N�cannot seekr)rVrXr7�seekrCr9rrr�rewinds
zAu_read.rewindcCs|jSr5)rCr9rrrrU!szAu_read.tellcCsP|dks||��krtd��|jdkr.td��|j�|j||j�||_dS)Nrzposition not in rangers)r`rrVrXr7rtrLrC)r2�posrrr�setpos$s
zAu_read.setposcCs"|j}|rd|_|jr|��dSr5)r7r/r8�r2rrrrr8,s
z
Au_read.closeN)rrrr4r:r;r?r0r[r\r]r^r`rerirkrlrnrrrurUrwr8rrrrr(�s(	.
r(c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3S)4�Au_writecCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)Nr)r�wbTFr+r1rrrr45szAu_write.__init__cCs|jr|��d|_dSr5r6r9rrrr:>szAu_write.__del__cCs|Sr5rr9rrrr;CszAu_write.__enter__cGs|��dSr5r<r=rrrr?FszAu_write.__exit__cCsF||_d|_d|_d|_d|_t|_d|_d|_d|_	d|_
d|_dS)NrrBra)r7rQrRrKrLrF�_nframes�_nframeswritten�_datawritten�_datalengthrS�	_comptyperxrrrr0IszAu_write.initfpcCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to write)rrrz"only 1, 2, or 4 channels supported)r|rrR)r2�	nchannelsrrr�setnchannelsVs
zAu_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rRrr9rrrr\]szAu_write.getnchannelscCs(|jrtd��|dkrtd��||_dS)Nr�)rrrrzbad sample width)r|rrK)r2�	sampwidthrrr�setsampwidthbs
zAu_write.setsampwidthcCs|jstd��|jS)N�sample width not specified)rQrrKr9rrrr]iszAu_write.getsampwidthcCs|jrtd��||_dS)Nr�)r|rrQ)r2�	frameraterrr�setframeratenszAu_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rQrr9rrrr^sszAu_write.getframeratecCs(|jrtd��|dkrtd��||_dS)Nr�rz# of frames cannot be negative)r|rr{)r2rqrrr�
setnframesxs
zAu_write.setnframescCs|jSr5�r|r9rrrr`szAu_write.getnframescCs|dkr||_ntd��dS)N)rcrazunknown compression type)rr)r2r,�namerrr�setcomptype�szAu_write.setcomptypecCs|jSr5�rr9rrrre�szAu_write.getcomptypecCs$|jdkrdS|jdkrdSdSdS)Nrarfrbrgrhr�r9rrrri�s


zAu_write.getcompnamecCsH|\}}}}}}|�|�|�|�|�|�|�|�|�||�dSr5)r�r�r�r�r�)r2Zparamsr�r�r�rqZcomptypeZcompnamerrr�	setparams�s



zAu_write.setparamscCs*t|��|��|��|��|��|���Sr5rjr9rrrrk�s�zAu_write.getparamscCs|jSr5r�r9rrrrU�sz
Au_write.tellcCs~t|ttf�st|��d�}|��|jdkrDddl}|�||j	�}t
|�|j}|j�
|�|j||_|jt
|�|_dS)N�Brar)�
isinstancer#�	bytearray�
memoryview�cast�_ensure_header_writtenrrpZlin2ulawrKrorLr7r"r|r})r2r$rprqrrr�writeframesraw�s
zAu_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSr5)r�r|r{r~r}�_patchheader)r2r$rrr�writeframes�s


�zAu_write.writeframescCs^|jrZz6|��|j|jks(|j|jkr0|��|j�	�W5|j}d|_|jrX|��XdSr5)
r7r/r8r�r|r{r~r}r��flushrxrrrr8�s
�zAu_write.closecCs<|js8|jstd��|js"td��|js0td��|��dS)Nz# of channels not specifiedr�zframe rate not specified)r|rRrrKrQ�
_write_headerr9rrrr��szAu_write._ensure_header_writtenc	Cs�|jdkrl|jdkr t}d|_q�|jdkr6t}d|_q�|jdkrLt}d|_q�|jdkrbt}d|_q�td��n|jdkr�t}d|_ntd��|j|j	|_t
|jt�dt
|j�}|d	d
@}t
|j|�|jtkr�t}n|j|j}z|j��|_Wn ttfk
�rd|_YnXt
|j|�||_t
|j|�t
|j|j�t
|j|j	�|j�|j�|j�d|t
|j�d�dS)
Nrcrrrrzinternal errorrar
r
i����rAr)rrKrMrLrNrOrPrrIrRr'r7rDrorSr{rFrU�_form_length_posrWrXr~rQr")r2�encoding�header_sizeZlengthrrrr��sJ







zAu_write._write_headercCsH|jdkrtd��|j�|j�t|j|j�|j|_|j�dd�dS)Nrsrr)r�rXr7rtr'r}r~r9rrrr��s
zAu_write._patchheaderN)rrrr4r:r;r?r0r�r\r�r]r�r^r�r`r�rerir�rkrUr�r�r8r�r�r�rrrrry3s2	

*rycCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder*)�rr*)�wrzz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�r(ryr�r3r�rrrr.s
r.cCstjdtdd�t||d�S)NzDsunau.openfp is deprecated since Python 3.7. Use sunau.open instead.r)�
stacklevel)r�)�warnings�warn�DeprecationWarningr.r�rrr�openfps
�r�)N)N)�__doc__�collectionsrr�rrDrIrMrNrOrPZAUDIO_FILE_ENCODING_FLOATZAUDIO_FILE_ENCODING_DOUBLEZAUDIO_FILE_ENCODING_ADPCM_G721ZAUDIO_FILE_ENCODING_ADPCM_G722Z AUDIO_FILE_ENCODING_ADPCM_G723_3Z AUDIO_FILE_ENCODING_ADPCM_G723_5rJrFrH�	Exceptionrrr'r(ryr.r�rrrr�<module>sFi��	Q

opcode.cpython-38.pyc000064400000012456151450073350010460 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZzddlmZe�d�Wnek
rPYnXdZgZgZgZ	gZ
gZgZgZ
gZiZdd�ed�D�Zdd�Zdd�Zdd�Zdd�Zedd�edd �ed!d"�ed#d$�ed%d&�ed'd(�ed)d*�ed+d,�ed-d.�ed/d0�ed1d2�ed3d4�ed5d6�ed7d8�ed9d:�ed;d<�ed=d>�ed?d@�edAdB�edCdD�edEdF�edGdH�edIdJ�edKdL�edMdN�edOdP�edQdR�edSdT�edUdV�edWdX�edYdZ�ed[d\�ed]d^�ed_d`�edadb�edcdd�ededf�edgdh�edidj�edkdl�edmdn�edodp�edqdr�edsdt�edudv�edwdx�edydz�ed{d|�ed}d~�edd��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��d�Zed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�dƒed�dăed�dƃed�dȃed�dʃed�d̃e�d̡ed�d΃e�dΡed�dЃe�dСed�d҃ed�dԃed�dփed�d؃ed�dڃe
�dڡed�d܃e
�dܡed�dރe
�dޡed�d�e
�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�e
�d�edd�d�Zed�d�ed�d�ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d�d�e�d�d�e�d�d�e�d�d�e�d�d	�e�d
�d�[[[[�dS(
zy
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
�cmp_op�hasconst�hasname�hasjrel�hasjabs�haslocal�
hascompare�hasfree�opname�opmap�
HAVE_ARGUMENT�EXTENDED_ARG�hasnargs�)�stack_effectr)�<z<=z==z!=�>z>=�inznot in�iszis notzexception matchZBADcCsg|]}d|f�qS)z<%r>�)�.0�oprr�/usr/lib64/python3.8/opcode.py�
<listcomp>%sr�cCs|t|<|t|<dS�N)r	r
��namerrrr�def_op'srcCst||�t�|�dSr)rr�appendrrrr�name_op+s
rcCst||�t�|�dSr)rrrrrrr�jrel_op/s
r cCst||�t�|�dSr)rrrrrrr�jabs_op3s
r!ZPOP_TOP�ZROT_TWO�Z	ROT_THREE�ZDUP_TOP�ZDUP_TOP_TWO�ZROT_FOUR�ZNOP�	ZUNARY_POSITIVE�
ZUNARY_NEGATIVE�Z	UNARY_NOT�ZUNARY_INVERT�ZBINARY_MATRIX_MULTIPLY�ZINPLACE_MATRIX_MULTIPLY�ZBINARY_POWER�ZBINARY_MULTIPLY�Z
BINARY_MODULO�Z
BINARY_ADD�ZBINARY_SUBTRACT�Z
BINARY_SUBSCR�ZBINARY_FLOOR_DIVIDE�ZBINARY_TRUE_DIVIDE�ZINPLACE_FLOOR_DIVIDE�ZINPLACE_TRUE_DIVIDE�Z	GET_AITER�2Z	GET_ANEXT�3ZBEFORE_ASYNC_WITH�4Z
BEGIN_FINALLY�5Z
END_ASYNC_FOR�6ZINPLACE_ADD�7ZINPLACE_SUBTRACT�8ZINPLACE_MULTIPLY�9ZINPLACE_MODULO�;ZSTORE_SUBSCR�<Z
DELETE_SUBSCR�=Z
BINARY_LSHIFT�>Z
BINARY_RSHIFT�?Z
BINARY_AND�@Z
BINARY_XOR�AZ	BINARY_OR�BZ
INPLACE_POWER�CZGET_ITER�DZGET_YIELD_FROM_ITER�EZ
PRINT_EXPR�FZLOAD_BUILD_CLASS�GZ
YIELD_FROM�HZ
GET_AWAITABLE�IZINPLACE_LSHIFT�KZINPLACE_RSHIFT�LZINPLACE_AND�MZINPLACE_XOR�NZ
INPLACE_OR�OZWITH_CLEANUP_START�QZWITH_CLEANUP_FINISH�RZRETURN_VALUE�SZIMPORT_STAR�TZSETUP_ANNOTATIONS�UZYIELD_VALUE�VZ	POP_BLOCK�WZEND_FINALLY�XZ
POP_EXCEPT�Y�ZZ
STORE_NAMEZDELETE_NAME�[ZUNPACK_SEQUENCE�\ZFOR_ITER�]Z	UNPACK_EX�^Z
STORE_ATTR�_ZDELETE_ATTR�`ZSTORE_GLOBAL�aZ
DELETE_GLOBAL�bZ
LOAD_CONST�dZ	LOAD_NAME�eZBUILD_TUPLE�fZ
BUILD_LIST�gZ	BUILD_SET�hZ	BUILD_MAP�iZ	LOAD_ATTR�jZ
COMPARE_OP�kZIMPORT_NAME�lZIMPORT_FROM�mZJUMP_FORWARD�nZJUMP_IF_FALSE_OR_POP�oZJUMP_IF_TRUE_OR_POP�pZ
JUMP_ABSOLUTE�qZPOP_JUMP_IF_FALSE�rZPOP_JUMP_IF_TRUE�sZLOAD_GLOBAL�tZ
SETUP_FINALLY�zZ	LOAD_FAST�|Z
STORE_FAST�}ZDELETE_FAST�~Z
RAISE_VARARGS�Z
CALL_FUNCTION�Z
MAKE_FUNCTION�ZBUILD_SLICE�ZLOAD_CLOSURE�Z
LOAD_DEREF�ZSTORE_DEREF�ZDELETE_DEREF�ZCALL_FUNCTION_KW�ZCALL_FUNCTION_EX�Z
SETUP_WITH�ZLIST_APPEND�ZSET_ADD�ZMAP_ADD�ZLOAD_CLASSDEREF��ZBUILD_LIST_UNPACK�ZBUILD_MAP_UNPACK�ZBUILD_MAP_UNPACK_WITH_CALL�ZBUILD_TUPLE_UNPACK�ZBUILD_SET_UNPACK�ZSETUP_ASYNC_WITH�ZFORMAT_VALUE�ZBUILD_CONST_KEY_MAP�ZBUILD_STRING�ZBUILD_TUPLE_UNPACK_WITH_CALL�ZLOAD_METHOD�ZCALL_METHOD�ZCALL_FINALLY�ZPOP_FINALLY�N)�__doc__�__all__Z_opcoderr�ImportErrorrrrrrrrrr
r
�ranger	rrr r!rrrrrr�<module>sF
�



























































































































ntpath.cpython-38.opt-2.pyc000064400000030500151450073350011433 0ustar00U

e5dVl�&@s$dZdZdZdZdZdZdZdZddlZddl	Z	ddl
Z
ddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Zd0d1�Z
d2d
�Zd3d�Zd4d�Zd5d
�Zd6d�Zd7d�Zejje_d8d�Zd9d�Zd:d�Zd;d�Zzdd<lmZWnek
�r$dZYnXd=d�Zd>d�Zd?d�Zd@d�Z dAdB�Z!zddClm"Z"Wnek
�rxe!Z#Yn
XdDd �Z#zddElm$Z$m%Z&Wnek
�r�e#Z'YnXdFdG�Z(dHdI�Z)dJd)�Z'e*e	dK��o�e	�+�dLdMkZ,dQdNd+�Z-dOd/�Z.zddPlm/Z0Wnek
�rYnXdS)R�.�..�\�;�/z.;C:\binZnul�N)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat�
commonpathcCst|t�rdSdSdS)N�\/�\/)�
isinstance�bytes��path�r4�/usr/lib64/python3.8/ntpath.py�
_get_bothseps"s
r6cCs8t�|�}t|t�r$|�dd���S|�dd���SdS)N�/�\rr)�os�fspathr0r1�replace�lower��sr4r4r5r,s

cCsjt�|�}t|t�r,|�dd��d�rBdSn|�dd��d�rBdSt|�d}t|�d	koh|d	t|�kS)
Nr7r8�\\?\Trr�\\?\�r)	r9r:r0r1r;�
startswithr�lenr6r=r4r4r5r	=s

c

GsTt�|�}t|t�r"d}d}d}nd}d}d}z�|sD|dd�|t|�\}}ttj|�D]~}t|�\}}	|	r�|	d|kr�|s�|s�|}|	}q\n*|r�||kr�|��|��kr�|}|	}q\|}|r�|d|kr�||}||	}q\|�r|d|k�r|�r|dd�|k�r|||WS||WSttt	fk
�rNt
jd	|f|���YnXdS)
Nr8r.�:rr/�:r���r
)r9r:r0r1r�mapr<�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)
r3�pathsr!�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr4r4r5r
MsL


��
cCst�|�}t|�dk�rt|t�r0d}d}d}nd}d}d}|�||�}|dd�|dkr�|dd	�|kr�|�|d�}|d
kr�|dd�|fS|�||d�}||dkr�|dd�|fS|d
kr�t|�}|d|�||d�fS|dd�|k�r|dd�|dd�fS|dd�|fS)N�r8r7rDrrrEr�rFrA)r9r:rCr0r1r;�find)rPr!r$rOZnormp�indexZindex2r4r4r5r|s.

$cCsxt�|�}t|�}t|�\}}t|�}|rD||d|krD|d8}q&|d|�||d�}}|�|�pj|}|||fS�NrA)r9r:r6rrC�rstrip)rPrN�d�i�head�tailr4r4r5r�s

cCs8t�|�}t|t�r$t�|ddd�St�|ddd�SdS)Nr8r7�.rrr)r9r:r0r1rK�	_splitext�rPr4r4r5r
�s

cCst|�dSrU�rr]r4r4r5r�scCst|�dS)Nrr^r]r4r4r5r�sc
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)NF)r9�lstat�OSError�
ValueErrorrI�stat�S_ISLNK�st_mode�r3�str4r4r5r�s
c	Cs.zt�|�}Wnttfk
r(YdSXdS)NFT)r9r_r`rarer4r4r5r�s
)�_getvolumepathnamecCstt�|�}t|�}t|�}t|�\}}|rD|d|krD|pB||kS||krPdStrl|�|�t|��|�kSdSdS)NrTF)r9r:r6rrrgrV)r3rN�root�restr4r4r5rs
cCs�t�|�}t|t�rd}nd}|�|�s,|Sdt|�}}||kr\||t|�kr\|d7}q:dtjkrrtjd}nFdtjkr�|Sztjd}Wntk
r�d}YnXt	|tjd�}t|t�r�t�
|�}|dkr�t	t|�|d|��}|||d�S)N�~�~rAZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�)r9r:r0r1rBrCr6�environ�KeyErrorr
�fsencoder)r3�tilderX�n�userhome�driver4r4r5r!s.








cCs2t�|�}t|t�rhd|kr(d|kr(|Sddl}t|j|jdd�}d}d}d}d}d}ttd	d�}nFd
|kr|d|kr||Sddl}|j|jd}d}d}d
}d}d
}tj}|dd�}	d}
t	|�}|
|k�r.||
|
d�}||k�rX||
dd�}t	|�}z&|�
|�}
|	||d|
d�7}	Wn*tk
�rR|	||7}	|d}
YnX�n�||k�rJ||
d|
d�|k�r�|	|7}	|
d7}
n�||
dd�}t	|�}z|�
|�}
Wn*tk
�r�|	||7}	|d}
YnhX|d|
�}
z.|dk�rt�tjt�
|
��}n||
}Wn"tk
�r<||
|}YnX|	|7}	�n�||k�r||
d|
d�|k�r�|	|7}	|
d7}
�q$||
d|
d�|k�r^||
dd�}t	|�}z|�
|�}
Wn.tk
�r�|	|||7}	|d}
YnlX|d|
�}
z.|dk�r"t�tjt�
|
��}n||
}Wn&tk
�rR|||
|}YnX|	|7}	n�|dd�}
|
d7}
||
|
d�}|�r�||k�r�|
|7}
|
d7}
||
|
d�}�q�z.|dk�r�t�tjt�
|
��}n||
}Wntk
�r||
}YnX|	|7}	|�r$|
d8}
n|	|7}	|
d7}
q�|	S)N�$�%rz_-�ascii�'�{�}�environb�$�%�'�{�}rArQ)r9r:r0r1�stringZ
ascii_lettersZdigits�getattrrmrCrTraro�fsdecodern)r3r�ZvarcharsZquoteZpercentZbraceZrbraceZdollarrm�resrTZpathlen�c�var�valuer4r4r5rQs�













c	CsPt�|�}t|t�r*d}d}d}d}d}nd}d}d}d	}d
}|�|�rL|S|�||�}t|�\}}|�|�r�||7}|�|�}|�|�}d}|t	|�k�r,||r�|||kr�||=q�|||k�r"|dkr�||d|kr�||d|d�=|d8}n&|dk�r|�
|��r||=n|d7}q�|d7}q�|�sB|�sB|�|�||�|�S)
Nr8r7r[�..)s\\.\r?rrrr)z\\.\r@rrA)
r9r:r0r1rBr;r�lstriprrC�endswith�appendr
)	r3r!r$rr Zspecial_prefixes�prefix�compsrXr4r4r5r�sF









cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S�N)	r9r:r	r0r1�getcwdb�getcwdr
r)r3�cwdr4r4r5�_abspath_fallback�s



r�)�_getfullpathnamec	Cs4ztt|��WSttfk
r.t|�YSXdSr�)rr�r`rar�r2r4r4r5rs)�_getfinalpathname�readlinkc
Cs�d}t�}t|�|kr�|�t|��z:|}t|�}t|�s\t|�sJ|}Wq�ttt|�|��}Wq
t	k
r�}z|j
|kr�WY�q��W5d}~XYq
tk
r�Yq�Yq
Xq
|S)N)rArQrR��� �2�C�Wi&i(i))�setr�add�_nt_readlinkr	rrr
rr`�winerrorra)r3�allowed_winerror�seenZold_path�exr4r4r5�_readlink_deeps&
r�cCs�d}d}|r�zt|�}|r$t||�n|WStk
r�}z�|j|krF�z0t|�}||krt|rft||�n|WWY�TSWntk
r�YnXt|�\}}|r�|s�||WY�S|r�t||�n|}W5d}~XYqXq|S)N)rArQrRr�r�r�r�r�r��{i�i�rl)r�r
r`r�r�r)r3r�rZr��new_path�namer4r4r5�_getfinalpathname_nonstrictCs(
 &r�c	
Cs^t|�}t|t�rBd}d}d}t��}t|�tt�t��krjdSn(d}d}d}t��}t|�tt�krjdS|�	|�}|s�t
|�s�t||�}zt|�}d	}Wn0t
k
r�}z|j}t|�}W5d}~XYnX|�sZ|�	|��rZ|�	|�r�||t|�d�}n|t|�d�}zt|�|k�r"|}Wn4t
k
�rX}z|j|k�rH|}W5d}~XYnX|S)
Nr?s\\?\UNC\s\\s\\.\NULr@z\\?\UNC\z\\z\\.\NULr)rr0r1r9r�rror&r�rBr	r
r�r`r�r�rC)	r3r�Z
unc_prefixZnew_unc_prefixr�Z
had_prefixZinitial_winerrorr�Zspathr4r4r5r'qsD



�getwindowsversionrRrQcCsft�|�}t|t�r"d}d}d}nd}d}d}|dkr:|}|sFtd��t�|�}z�tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td|	|f��d	d
�|�	|�D�}dd
�|
�	|�D�}d}
t
||�D]$\}}t|�t|�kr�q�|
d
7}
q�|gt|�|
||
d�}|�s(|WSt|�WSt
ttttfk
�r`t�d||��YnXdS)Nr8r[r�rrrzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr4r4��.0�xr4r4r5�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr4r4r�r4r4r5r��srrAr))r9r:r0r1rarrrrr�ziprCr
rHrIrJ�DeprecationWarningrKrL)r3�startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrXZe1Ze2�rel_listr4r4r5r)�sJ


�

c	s�|std��tttj|��}t|dt�r8d�d�d�nd�d�d��z@��fd	d
�|D�}�fdd
�|D�}zt�fdd
�|D��\}Wntk
r�td�d�YnXttdd
�|D���dkr�td��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}t|�D]*\}	}
|
||	k�r*|d|	�}�qf�q*|dt|��}|�rt|�n|}|��|�WSttfk
�r�tjd|���YnXdS)Nz%commonpath() arg is an empty sequencerr8r7r[rrrcs g|]}t|��������qSr4)rr;r<)r�rP)r$r!r4r5r��szcommonpath.<locals>.<listcomp>csg|]\}}|����qSr4r^�r�rWrP�r!r4r5r��sc3s"|]\}}|dd��kVqdSrUr4r�r�r4r5�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathscss|]\}}|VqdSr�r4r�r4r4r5r��srAzPaths don't have the same drivecsg|]}|r|�kr|�qSr4r4�r�r��rr4r5r��scsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr4r4r�r�r4r5r�sz)commonpath.<locals>.<listcomp>.<listcomp>r4)r�r>r�r4r5r�sr-)r-)ra�tuplerGr9r:r0r1r�rCrr;r�min�max�	enumerater
rHrIrKrL)rMZdrivesplits�split_pathsr	rsr3�common�s1�s2rXr�r�r4)r$rr!r5r-�sF

)�_isdir)N)1rr r%r!r"r$r#r&r9�sysrbrK�__all__r6rr	r
rrr
r\�__doc__rrrr�ntrg�ImportErrorrrrrr�r�rr�r�r�r'r�r��hasattrr�r(r)r-r�rr4r4r4r5�<module>s��
/8

0q2

*.2�
84doctest.cpython-38.pyc000064400000224310151450073350010646 0ustar00U

e5d_��!@stdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"g!Zd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$l	Z	d#d$l
Z
d#d$lZd#d$lZd#d%l
mZd#d&lmZed'd(�ZiZd)d�Zed�Zed�Zed�Zed�Zed�Zed�ZeeBeBeBeBeBZed
�Zed�Zed�Zed
�Zed�ZeeBeBeBeBZ d*Z!d+Z"d,d-�Z#dsd/d0�Z$d1d2�Z%d3d4�Z&dtd6d7�Z'd8d9�Z(Gd:d;�d;e�Z)d<d=�Z*d>d?�Z+d@dA�Z,GdBdC�dCej-�Z.dDdE�Z/GdFd�d�Z0GdGd�d�Z1GdHd�d�Z2GdId�d�Z3GdJd�d�Z4GdKd�d�Z5GdLd�de6�Z7GdMd�de6�Z8GdNd�de4�Z9d$a:dudQd�Z;dOd$d$d$d$dOd#d$dPe2�d$fdRd�Z<dvdTd�Z=d#a>dUd�Z?GdVdW�dWej@�ZAGdXdY�dYeA�ZBGdZd[�d[ejC�ZDdwd\d�ZEGd]d^�d^eA�ZFdOd$d$e2�d$fd_d`�ZGdad�ZHdbd�ZIdcd �ZJdxddd!�ZKdydedf�ZLdzdgd"�ZMGdhdi�di�ZNeNdjdkdldmdndo�ZOdpdq�ZPeQdrk�rpe
�ReP��d$S){a�Module doctest -- a framework for running examples in docstrings.

In simplest use, end each module M to be tested with:

def _test():
    import doctest
    doctest.testmod()

if __name__ == "__main__":
    _test()

Then running the module as a script will cause the examples in the
docstrings to get executed and verified:

python M.py

This won't display anything unless an example fails, in which case the
failing example(s) and the cause(s) of the failure(s) are printed to stdout
(why not stderr? because stderr is a lame hack <0.2 wink>), and the final
line of output is "Test failed.".

Run it with the -v switch instead:

python M.py -v

and a detailed report of all examples tried is printed to stdout, along
with assorted summaries at the end.

You can force verbose mode by passing "verbose=True" to testmod, or prohibit
it by passing "verbose=False".  In either of those cases, sys.argv is not
examined by testmod.

There are a variety of other ways to run doctests, including integration
with the unittest framework, and support for running non-Python text
files containing doctests.  There are also many ways to override parts
of doctest's default behaviors.  See the Library Reference Manual for
details.
zreStructuredText en�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS�	FAIL_FAST�Example�DocTest�
DocTestParser�
DocTestFinder�
DocTestRunner�
OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples�
testsource�	debug_src�debug�N)�StringIO)�
namedtuple�TestResultszfailed attemptedcCst�|dtt�>�S)N�)�OPTIONFLAGS_BY_NAME�
setdefault�len��name�r,�/usr/lib64/python3.8/doctest.pyr�sz<BLANKLINE>z...cCs8d}tjD](}|�|d�}|tt|�kr
||jO}q
|S)z�
    Return the compiler-flags associated with the future features that
    have been imported into the given namespace (globs).
    r"N)�
__future__Zall_feature_names�get�getattrZ
compiler_flag)�globs�flagsZfnameZfeaturer,r,r-�_extract_future_flags�s
r3�cCsVt�|�r|St|t�r,t|t�t�dg�S|dkrJtjt�	|�j
dStd��dS)a�
    Return the module specified by `module`.  In particular:
      - If `module` is a module, then return module.
      - If `module` is a string, then import and return the
        module with that name.
      - If `module` is None, then return the calling module.
        The calling module is assumed to be the module of
        the stack frame at the given depth in the call stack.
    �*N�__name__z"Expected a module, string, or None)�inspect�ismodule�
isinstance�str�
__import__�globals�locals�sys�modules�	_getframe�	f_globals�	TypeError)�moduleZdepthr,r,r-�_normalize_module�s


rDcCsdD]}|�|d�}q|S)N)z
�
�
)�replace)�data�newliner,r,r-�_newline_convert�srJc
Cs�|rVt|d�}t||�}t|dd�dk	rVt|jd�rV|j�|�}|�|�}t|�|fSt||d��}|�	�|fW5QR�SQRXdS)N��
__loader__�get_data)�encoding)
rD�_module_relative_pathr0�hasattrrLrM�decoderJ�open�read)�filename�package�module_relativerNZ
file_contents�fr,r,r-�_load_testfile�s


rX�cCst�d|d|�S)z~
    Add the given number of space characters to the beginning of
    every non-blank line in `s`, and return the result.
    z
(?m)^(?!$)� )�re�sub)�s�indentr,r,r-�_indent�sr_cCs*t�}|\}}}tj||||d�|��S)zz
    Return a string containing a traceback message for the given
    exc_info tuple (as returned by sys.exc_info()).
    )�file)r#�	traceback�print_exception�getvalue)�exc_infoZexcout�exc_typeZexc_valZexc_tbr,r,r-�_exception_traceback�s
rfc@seZdZdd�Zddd�ZdS)�	_SpoofOutcCs$t�|�}|r |�d�s |d7}|S�NrF)r#rc�endswith)�self�resultr,r,r-rcs
z_SpoofOut.getvalueNcCs|�|�t�|�dS�N)�seekr#�truncate)rj�sizer,r,r-rn	s
z_SpoofOut.truncate)N)r6�
__module__�__qualname__rcrnr,r,r,r-rg�s	rgcCs�t|kr||kS|�t�}t|�dks*t�dt|�}}|d}|rb|�|�r^t|�}|d=ndS|d}|r�|�|�r�|t|�8}|d=ndS||kr�dS|D],}|�|||�}|dkr�dS|t|�7}q�dS)z_
    Essentially the only subtle case:
    >>> _ellipsis_match('aa...aa', 'aaa')
    False
    r4r"F���T)�ELLIPSIS_MARKER�splitr)�AssertionError�
startswithri�find)�want�gotZws�startpos�endpos�wr,r,r-�_ellipsis_matchs2


r}cCs|��}|rd|SdSdS)z)Return a commented form of the given linez# �#N)�rstrip)�liner,r,r-�
_comment_line?sr�cCshdt|�}}|�d�}|dkr$|}|�dd|�}|dkr>|}|�dd|�}|dkr\|d}|||�S)Nr"rF�:�.r&)r)rw�rfind)�msg�start�end�ir,r,r-�_strip_exception_detailsGs
r�c@s2eZdZdZdd�Zddd�Zdd�Zd	d
�ZdS)�_OutputRedirectingPdbz�
    A specialized version of the python debugger that redirects stdout
    to a given stream when interacting with the user.  Stdout is *not*
    redirected when traced code is executed.
    cCs(||_d|_tjj||dd�d|_dS)NFT)�stdout�nosigintr&)�_OutputRedirectingPdb__out�$_OutputRedirectingPdb__debugger_used�pdb�Pdb�__init__Zuse_rawinput)rj�outr,r,r-r�gsz_OutputRedirectingPdb.__init__NcCs*d|_|dkrt��j}tj�||�dS)NT)r�r>r@�f_backr�r��	set_trace)rj�framer,r,r-r�os
z_OutputRedirectingPdb.set_tracecCs|jrtj�|�dSrl)r�r�r��set_continue�rjr,r,r-r�usz"_OutputRedirectingPdb.set_continuecGs2tj}|jt_ztjj|f|��W�S|t_XdSrl)r>r�r�r�r��trace_dispatch)rj�args�save_stdoutr,r,r-r�{s
z$_OutputRedirectingPdb.trace_dispatch)N)r6rprq�__doc__r�r�r�r�r,r,r,r-r�as

r�cCs�t�|�std|��|�d�r(td��tjj|�d��}t	|d�rXtj�|j
�d}n�|jdkr�tt
j�dkr�t
jddkr�tj�t
jd�d}q�tj}nFt	|d�r�|jD]&}tj�||�}tj�|�r�|Sq�td	|j��tj�||�S)
NzExpected a module: %r�/z1Module-relative files may not have absolute paths�__file__r"�__main__��__path__zBCan't resolve paths relative to the module %r (it has no __file__))r7r8rBrv�
ValueError�os�path�joinrtrPr�r6r)r>�argv�curdirr��exists)rCZ	test_pathZbasedirZ	directory�fullpathr,r,r-rO�s(






�rOc@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ran
    A single doctest example, consisting of source code and expected
    output.  `Example` defines the following attributes:

      - source: A single Python statement, always ending with a newline.
        The constructor adds a newline if needed.

      - want: The expected output from running the source code (either
        from stdout, or a traceback in case of exception).  `want` ends
        with a newline unless it's empty, in which case it's an empty
        string.  The constructor adds a newline if needed.

      - exc_msg: The exception message generated by the example, if
        the example is expected to generate an exception; or `None` if
        it is not expected to generate an exception.  This exception
        message is compared against the return value of
        `traceback.format_exception_only()`.  `exc_msg` ends with a
        newline unless it's `None`.  The constructor adds a newline
        if needed.

      - lineno: The line number within the DocTest string containing
        this Example where the Example begins.  This line number is
        zero-based, with respect to the beginning of the DocTest.

      - indent: The example's indentation in the DocTest string.
        I.e., the number of space characters that precede the
        example's first prompt.

      - options: A dictionary mapping from option flags to True or
        False, which is used to override default options for this
        example.  Any option flags not contained in this dictionary
        are left at their default value (as specified by the
        DocTestRunner's optionflags).  By default, no options are set.
    Nr"cCsv|�d�s|d7}|r(|�d�s(|d7}|dk	rB|�d�sB|d7}||_||_||_||_|dkrfi}||_||_dSrh)ri�sourcerx�linenor^�options�exc_msg)rjr�rxr�r�r^r�r,r,r-r��s
zExample.__init__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)�type�NotImplementedr�rxr�r^r�r��rj�otherr,r,r-�__eq__�s
�
�
�
�
�zExample.__eq__cCst|j|j|j|j|jf�Srl)�hashr�rxr�r^r�r�r,r,r-�__hash__�s�zExample.__hash__)Nr"r"N)r6rprqr�r�r�r�r,r,r,r-r�s"�
c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rae
    A collection of doctest examples that should be run in a single
    namespace.  Each `DocTest` defines the following attributes:

      - examples: the list of examples.

      - globs: The namespace (aka globals) that the examples should
        be run in.

      - name: A name identifying the DocTest (typically, the name of
        the object whose docstring this DocTest was extracted from).

      - filename: The name of the file that this DocTest was extracted
        from, or `None` if the filename is unknown.

      - lineno: The line number within filename where this DocTest
        begins, or `None` if the line number is unavailable.  This
        line number is zero-based, with respect to the beginning of
        the file.

      - docstring: The string that the examples were extracted from,
        or `None` if the string is unavailable.
    cCs>t|t�rtd��||_||_|��|_||_||_||_	dS)z�
        Create a new DocTest containing the given examples.  The
        DocTest's globals are initialized with a copy of `globs`.
        z8DocTest no longer accepts str; use DocTestParser insteadN)
r9r:ru�examples�	docstring�copyr1r+rTr�)rjr�r1r+rTr�r�r,r,r-r�s�
zDocTest.__init__cCsRt|j�dkrd}n"t|j�dkr(d}ndt|j�}d|jj|j|j|j|fS)Nr"zno examplesr&z	1 examplez%d examplesz<%s %s from %s:%s (%s)>)r)r��	__class__r6r+rTr�)rjr�r,r,r-�__repr__s��zDocTest.__repr__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)r�r�r�r�r1r+rTr�r�r,r,r-r�)s
�
�
�
�
�zDocTest.__eq__cCst|j|j|j|jf�Srl)r�r�r+rTr�r�r,r,r-r�4szDocTest.__hash__cCs:t|t�stS|j|j|jt|�f|j|j|jt|�fkSrl)r9rr�r+rTr��idr�r,r,r-�__lt__8s

�zDocTest.__lt__N)	r6rprqr�r�r�r�r�r�r,r,r,r-r�sc@s�eZdZdZe�dejejB�Ze�dejejBej	B�Z
e�d�jZddd�Z
dd	�Zdd
d�Zdd
�Ze�dej�Zdd�Ze�dej�Zdd�Zdd�Zdd�ZdS)rzD
    A class used to parse strings containing doctest examples.
    a�
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a�
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$�<string>c
s|��}|�|���dkr8d��fdd�|�d�D��}g}d\}}|j�|�D]�}|�|||����||�d||���7}|�	|||�\}}}	}
|�
|�s�|�t||	|
|�t|�
d��|d��||�d|��|���7}|��}qP|�||d��|S)	a=
        Divide the given string into examples and intervening text,
        and return them as a list of alternating Examples and strings.
        Line numbers for the Examples are 0-based.  The optional
        argument `name` is a name identifying this string, and is only
        used for error messages.
        r"rFcsg|]}|�d��qSrlr,��.0�l�Z
min_indentr,r-�
<listcomp>sz'DocTestParser.parse.<locals>.<listcomp>�r"r"r^)r�r^r�N)�
expandtabs�_min_indentr�rt�_EXAMPLE_RE�finditer�appendr��count�_parse_example�_IS_BLANK_OR_COMMENTrr)�groupr�)rj�stringr+�outputZcharnor��mr�r�rxr�r,r�r-�parsess*
�

�
zDocTestParser.parsecCst|�||�|||||�S)a"
        Extract all doctest examples from the given string, and
        collect them into a `DocTest` object.

        `globs`, `name`, `filename`, and `lineno` are attributes for
        the new `DocTest` object.  See the documentation for `DocTest`
        for more information.
        )r�get_examples)rjr�r1r+rTr�r,r,r-�get_doctest�s	�zDocTestParser.get_doctestcCsdd�|�||�D�S)a�
        Extract all doctest examples from the given string, and return
        them as a list of `Example` objects.  Line numbers are
        0-based, because it's most common in doctests that nothing
        interesting appears on the same line as opening triple-quote,
        and so the first interesting line is called "line 1" then.

        The optional argument `name` is a name identifying this
        string, and is only used for error messages.
        cSsg|]}t|t�r|�qSr,)r9r)r��xr,r,r-r��s
�z.DocTestParser.get_examples.<locals>.<listcomp>)r�)rjr�r+r,r,r-r��szDocTestParser.get_examplesc
s
t|�d���|�d��d�}|�|�||�|�|dd�d�d||�d��fdd	�|D��}|�d
�}|�d�}t|�dkr�t�d|d�r�|d=|�|d�||t|��d��fd
d	�|D��}|j�|�}|r�|�d�}nd}|�	|||�}	||	||fS)a�
        Given a regular expression match from `_EXAMPLE_RE` (`m`),
        return a pair `(source, want)`, where `source` is the matched
        example's source code (with prompts and indentation stripped);
        and `want` is the example's expected output (with indentation
        stripped).

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r^r�rFr&NrZr�csg|]}|�dd��qS)rYNr,)r�Zsl�r^r,r-r��sz0DocTestParser._parse_example.<locals>.<listcomp>rxz *$rrcsg|]}|�d��qSrlr,)r�Zwlr�r,r-r��sr�)
r)r�rt�_check_prompt_blank�
_check_prefixr�r[�match�
_EXCEPTION_RE�
_find_options)
rjr�r+r��source_linesr�rx�
want_linesr�r�r,r�r-r��s& 


�zDocTestParser._parse_examplez#\s*doctest:\s*([^\n\'"]*)$c	Cs�i}|j�|�D]v}|�d��dd���}|D]V}|ddksN|dd�tkrdtd|d||f��t|dd�}|ddk||<q.q|r�|�|�r�td	|||f��|S)
a
        Return a dictionary containing option overrides extracted from
        option directives in the given source string.

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r&�,rZr"z+-Nz7line %r of the doctest for %s has an invalid option: %r�+zSline %r of the doctest for %s has an option directive on a line with no example: %r)�_OPTION_DIRECTIVE_REr�r�rGrtr'r�r�)	rjr�r+r�r�r�Zoption_strings�option�flagr,r,r-r��s"���zDocTestParser._find_optionsz
^([ ]*)(?=\S)cCs2dd�|j�|�D�}t|�dkr*t|�SdSdS)z;Return the minimum indentation of any non-blank line in `s`cSsg|]}t|��qSr,)r))r�r^r,r,r-r�
sz-DocTestParser._min_indent.<locals>.<listcomp>r"N)�
_INDENT_RE�findallr)�min)rjr]�indentsr,r,r-r�szDocTestParser._min_indentc	Cs^t|�D]P\}}t|�|dkr||ddkrtd||d||||d�|f��qdS)a

        Given the lines of a source string (including prompts and
        leading indentation), check to make sure that every prompt is
        followed by a space character.  If any line is not followed by
        a space character, then raise ValueError.
        rYrKrZz8line %r of the docstring for %s lacks blank after %s: %rr&N)�	enumerater)r�)rj�linesr^r+r�r�r�r,r,r-r�s ��z!DocTestParser._check_prompt_blankcCs>t|�D]0\}}|r|�|�std||d||f��qdS)z�
        Check that every line in the given list starts with the given
        prefix; if any line does not, then raise a ValueError.
        zGline %r of the docstring for %s has inconsistent leading whitespace: %rr&N)r�rvr�)rjr��prefixr+r�r�r�r,r,r-r�s
�zDocTestParser._check_prefixN)r�)r�)r6rprqr�r[�compile�	MULTILINE�VERBOSEr��DOTALLr�r�r�r�r�r�r�r�r�r�r�r�r�r,r,r,r-rCs(
��
'
3�c@sNeZdZdZde�ddfdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra<
    A class used to extract the DocTests that are relevant to a given
    object, from its docstring and the docstrings of its contained
    objects.  Doctests can currently be extracted from the following
    object types: modules, functions, classes, methods, staticmethods,
    classmethods, and properties.
    FTcCs||_||_||_||_dS)at
        Create a new doctest finder.

        The optional argument `parser` specifies a class or
        function that should be used to create new DocTest objects (or
        objects that implement the same interface as DocTest).  The
        signature for this factory function should match the signature
        of the DocTest constructor.

        If the optional argument `recurse` is false, then `find` will
        only examine the given object, and not any contained objects.

        If the optional argument `exclude_empty` is false, then `find`
        will include tests for objects with empty docstrings.
        N)�_parser�_verbose�_recurse�_exclude_empty)rj�verbose�parser�recurse�
exclude_emptyr,r,r-r�7szDocTestFinder.__init__Nc		CsN|dkr.t|dd�}|dkr.tdt|�f��|dkr<d}n|dkrNt�|�}zt�|�}Wntk
rtd}YndX|s�t�|�}|d|dd�dks�d}|dkr�d}n*|dk	r�t�	||j
�}n
t�	|�}|s�d}|dkr�|dkr�i}n
|j
��}n|��}|dk	�r|�|�d|k�r(d|d<g}|�
||||||i�|��|S)	aj
        Return a list of the DocTests that are defined by the given
        object's docstring, or by any of its contained objects'
        docstrings.

        The optional parameter `module` is the module that contains
        the given object.  If the module is not specified or is None, then
        the test finder will attempt to automatically determine the
        correct module.  The object's module is used:

            - As a default namespace, if `globs` is not specified.
            - To prevent the DocTestFinder from extracting DocTests
              from objects that are imported from other modules.
            - To find the name of the file containing the object.
            - To help find the line number of the object within its
              file.

        Contained objects whose module does not match `module` are ignored.

        If `module` is False, no attempt to find the module will be made.
        This is obscure, of use mostly in tests:  if `module` is False, or
        is None but cannot be found automatically, then all objects are
        considered to belong to the (non-existent) module, so all contained
        objects will (recursively) be searched for doctests.

        The globals for each DocTest is formed by combining `globs`
        and `extraglobs` (bindings in `extraglobs` override bindings
        in `globs`).  A new copy of the globals dictionary is created
        for each DocTest.  If `globs` is not specified, then it
        defaults to the module's `__dict__`, if specified, or {}
        otherwise.  If `extraglobs` is not specified, then it defaults
        to {}.

        Nr6zJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rFr"���z<]>r�)r0r�r�r7�	getmoduleZ
getsourcefilerBZgetfile�	linecache�getlines�__dict__r��update�_find�sort)	rj�objr+rCr1�
extraglobsr`r��testsr,r,r-rwMsL$�






zDocTestFinder.findcCs�|dkrdSt�|�dk	r(|t�|�kSt�|�r>|j|jkSt�|�r|t|d�r\|jj}nt|d�rn|j}ndS|j	|kSt�
|�r�|j	|jkSt|d�r�|j	|jkSt|t�r�dSt
d��dS)zY
        Return true if the given object is defined in the given
        module.
        NT�__objclass__rpz"object must be a class or function)r7r��
isfunctionr��__globals__ZismethoddescriptorrPr�rpr6�isclassr9�propertyr�)rjrC�objectZobj_modr,r,r-�_from_module�s(








zDocTestFinder._from_modulec
Cs|jrtd|�t|�|kr"dSd|t|�<|�|||||�}|dk	rR|�|�t�|�r�|jr�|j�	�D]P\}	}
d||	f}	t�
t�|
��s�t�|
�rl|�
||
�rl|�||
|	||||�qlt�|��rn|j�rnt|di��	�D]�\}	}
t|	t��stdt|	�f��t�
|
��sJt�|
��sJt�|
��sJt|
t��sJtdt|
�f��d||	f}	|�||
|	||||�q�t�|��r|j�r|j�	�D]�\}	}
t|
t��r�t||	�}
t|
t��r�t||	�j}
t�
|
��s�t�|
��s�t|
t��r�|�
||
��r�d||	f}	|�||
|	||||��q�dS)	zm
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        zFinding tests in %sNr&z%s.%s�__test__z5DocTestFinder.find: __test__ keys must be strings: %rz`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rz%s.__test__.%s)r��printr��	_get_testr�r7r8r�r��itemsZ	isroutineZunwraprrr�r0r9r:r�r��staticmethod�classmethod�__func__r)rjr�r�r+rCr�r1�seen�testZvalname�valr,r,r-r��sn
�
�������
�
��zDocTestFinder._findc		Cs�t|t�r|}nJz,|jdkr"d}n|j}t|t�s:t|�}Wnttfk
rXd}YnX|�||�}|jrt|stdS|dkr�d}n.t|dd�p�|j}|dd�dkr�|dd�}|j	�
|||||�S)zs
        Return a DocTest for the given object, if it defines a docstring;
        otherwise, return None.
        Nr�r�����.pycrr)r9r:r�rB�AttributeError�_find_linenor�r0r6r�r�)	rjr�r+rCr1r�r�r�rTr,r,r-rs,




�zDocTestFinder._get_testcCsd}t�|�rd}t�|�rb|dkr(dSt�dt|dd��}t|�D]\}}|�|�rF|}qbqFt�|�rr|j	}t�
|�r�|j}t�|�r�|j
}t�|�r�|j}t�|�r�t|dd�d}|dk	�r
|dkr�|dSt�d�}t|t|��D]}|�||�r�|Sq�dS)	z�
        Return a line number of the given object's docstring.  Note:
        this method assumes that the object has a docstring.
        Nr"z^\s*class\s*%s\br6�-�co_firstlinenor&z(^|.*:)\s*\w*("|\'))r7r8rr[r�r0r�r�Zismethodr
r��__code__Zistraceback�tb_frameZisframe�f_codeZiscode�ranger))rjr�r�r�Zpatr�r�r,r,r-r4s>


�








zDocTestFinder._find_lineno)NNNN)r6rprqr�rr�rwrr�rrr,r,r,r-r.s�

f?&c@s�eZdZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
�d�Zd dd�Zd!dd�Zd"dd�Zdd�ZdS)#ra3	
    A class used to run DocTest test cases, and accumulate statistics.
    The `run` method is used to process a single DocTest case.  It
    returns a tuple `(f, t)`, where `t` is the number of test cases
    tried, and `f` is the number of test cases that failed.

        >>> tests = DocTestFinder().find(_TestClass)
        >>> runner = DocTestRunner(verbose=False)
        >>> tests.sort(key = lambda test: test.name)
        >>> for test in tests:
        ...     print(test.name, '->', runner.run(test))
        _TestClass -> TestResults(failed=0, attempted=2)
        _TestClass.__init__ -> TestResults(failed=0, attempted=2)
        _TestClass.get -> TestResults(failed=0, attempted=2)
        _TestClass.square -> TestResults(failed=0, attempted=1)

    The `summarize` method prints a summary of all the test cases that
    have been run by the runner, and returns an aggregated `(f, t)`
    tuple:

        >>> runner.summarize(verbose=1)
        4 items passed all tests:
           2 tests in _TestClass
           2 tests in _TestClass.__init__
           2 tests in _TestClass.get
           1 tests in _TestClass.square
        7 tests in 4 items.
        7 passed and 0 failed.
        Test passed.
        TestResults(failed=0, attempted=7)

    The aggregated number of tried examples and failed examples is
    also available via the `tries` and `failures` attributes:

        >>> runner.tries
        7
        >>> runner.failures
        0

    The comparison between expected outputs and actual outputs is done
    by an `OutputChecker`.  This comparison may be customized with a
    number of option flags; see the documentation for `testmod` for
    more information.  If the option flags are insufficient, then the
    comparison may also be customized by passing a subclass of
    `OutputChecker` to the constructor.

    The test runner's display output can be controlled in two ways.
    First, an output function (`out) can be passed to
    `TestRunner.run`; this function will be called with strings that
    should be displayed.  It defaults to `sys.stdout.write`.  If
    capturing the output is not sufficient, then the display output
    can be also customized by subclassing DocTestRunner, and
    overriding the methods `report_start`, `report_success`,
    `report_unexpected_exception`, and `report_failure`.
    zF**********************************************************************Nr"cCsN|pt�|_|dkrdtjk}||_||_||_d|_d|_i|_	t
�|_dS)ac
        Create a new test runner.

        Optional keyword arg `checker` is the `OutputChecker` that
        should be used to compare the expected outputs and actual
        outputs of doctest examples.

        Optional keyword arg 'verbose' prints lots of stuff if true,
        only failures if false; by default, it's true iff '-v' is in
        sys.argv.

        Optional argument `optionflags` can be used to control how the
        test runner compares expected output to actual output, and how
        it displays failures.  See the documentation for `testmod` for
        more information.
        N�-vr")r�_checkerr>r�r��optionflags�original_optionflags�tries�failures�_name2ftrg�_fakeout)rj�checkerr�rr,r,r-r��s
zDocTestRunner.__init__cCsH|jrD|jr.|dt|j�dt|j��n|dt|j�d�dS)z�
        Report that the test runner is about to process the given
        example.  (Only displays a message if verbose=True)
        zTrying:
zExpecting:
zExpecting nothing
N)r�rxr_r�)rjr�r�exampler,r,r-�report_start�s���zDocTestRunner.report_startcCs|jr|d�dS)zt
        Report that the given example ran successfully.  (Only
        displays a message if verbose=True)
        zok
N)r��rjr�rr!ryr,r,r-�report_success�szDocTestRunner.report_successcCs&||�||�|j�|||j��dS)z7
        Report that the given example failed.
        N)�_failure_headerr�output_differencerr#r,r,r-�report_failure�s�zDocTestRunner.report_failurecCs$||�||�dtt|���dS)zO
        Report that the given example raised an unexpected exception.
        zException raised:
N)r%r_rf�rjr�rr!rdr,r,r-�report_unexpected_exception�s
�
�z)DocTestRunner.report_unexpected_exceptioncCs�|jg}|jrR|jdk	r4|jdk	r4|j|jd}nd}|�d|j||jf�n|�d|jd|jf�|�d�|j}|�t|��d�|�S)Nr&�?zFile "%s", line %s, in %szLine %s, in %szFailed example:rF)�DIVIDERrTr�r�r+r�r_r�)rjrr!r�r�r�r,r,r-r%�s�
zDocTestRunner._failure_headerc	Cs�d}}|j}td�\}}}	|jj}
t|j�D�]H\}}|jt@oH|dk}
||_|jr�|j��D],\}}|r||j|O_q`|j|M_q`|jt	@r�q.|d7}|
s�|�
|||�d|j|f}z,tt
|j|d|d�|j�|j��d}Wn4tk
�r�Ynt��}|j��YnX|j��}|j�d�|}|dk�r`|
|j||j��r�|}n|tj|dd��d}|
�s�|t|�7}|jdk�r�|	}nB|
|j||j��r�|}n*|jt@�r�|
t|j�t|�|j��r�|}||k�r�|
�sd|�||||�nf||k�r(|
�s|� ||||�|d7}n<||	k�rR|
�sH|�!||||�|d7}nd	�sdt"d
|f��|r.|jt#@r.�qzq.||_|�$|||�t%||�S)a�
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
        flags that should be used to execute examples.  Return a tuple
        `(f, t)`, where `t` is the number of examples tried, and `f`
        is the number of examples that failed.  The examples are run
        in the namespace `test.globs`.
        r"rKr&z<doctest %s[%d]>ZsingleNr4rrFzunknown outcome)&rrr�check_outputr�r�rr�rrr"r+�execr�r�r1�debuggerr��KeyboardInterruptr>rdrrcrnrxra�format_exception_onlyrfr�rr�r$r'r)rur�_DocTestRunner__record_outcomer%)rjr�compileflagsr�rrr�SUCCESS�FAILUREZBOOMZcheck�
examplenumr!�quietZ
optionflagr
rTZ	exceptionryZoutcomer�r,r,r-Z__run�s�
�
��



�




�
zDocTestRunner.__runcCsL|j�|jd�\}}||||f|j|j<|j|7_|j|7_dS)z{
        Record the fact that the given DocTest (`test`) generated `f`
        failures out of `t` tried examples.
        r�N)rr/r+rr)rjrrW�t�f2�t2r,r,r-Z__record_outcome|szDocTestRunner.__record_outcomez.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$cCsV|j�|�}|rF|�d�|jjkrF|jjt|�d��}|jjdd�S|�	||�SdS)Nr+r5T��keepends)
�%_DocTestRunner__LINECACHE_FILENAME_REr�r�rr+r��intr��
splitlines�save_linecache_getlines)rjrT�module_globalsr�r!r,r,r-Z__patched_linecache_getlines�s
z*DocTestRunner.__patched_linecache_getlinesTc		s||_|dkrt|j�}tj�|dkrV�j��dks@���dkrH�j}n��fdd�}|jt_t�	�}t
j}t��|_
|j
��|j
jt
_tj|_|jt_tj}tjt_z|�|||�W�S�t_|t
_t�|�|jt_|t_|�r�|j��ddl}d|_XdS)aJ
        Run the examples in `test`, and display the results using the
        writer function `out`.

        The examples are run in the namespace `test.globs`.  If
        `clear_globs` is true (the default), then this namespace will
        be cleared after the test runs, to help with garbage
        collection.  If you would like to examine the namespace after
        the test completes, then use `clear_globs=False`.

        `compileflags` gives the set of flags that should be used by
        the Python compiler when running the examples.  If not
        specified, then it will default to the set of future-import
        flags that apply to `globs`.

        The output of each example is checked using
        `DocTestRunner.check_output`, and the results are formatted by
        the `DocTestRunner.report_*` methods.
        N�utf-8cs t|��d���}��|�dS)N�backslashreplace)r:�encode�write)r]�rNr�r,r-r��szDocTestRunner.run.<locals>.outr")rr3r1r>r�rN�lowerrDr�gettracer�r�r�r.�resetr�r�r?�*_DocTestRunner__patched_linecache_getlines�displayhook�__displayhook__�settrace�clear�builtins�_�_DocTestRunner__run)	rjrr2r��clear_globsZ
save_traceZsave_set_traceZsave_displayhookrNr,rEr-�run�s<





zDocTestRunner.runc
Cs�|dkr|j}g}g}g}d}}|j��D]b}|\}\}	}
|	|
ksHt�||
7}||	7}|
dkrl|�|�q,|	dkr�|�||
f�q,|�|�q,|r�|r�tt|�d�|��|D]}td|�q�|r�tt|�d�|��|D]\}}td||f�q�|�rFt|j�tt|�d�|��|D] \}\}	}
td|	|
|f��q$|�rrt|d	t|j�d
�t||d|d�|�r�td
|d�n|�r�td�t	||�S)a�
        Print a summary of all the test cases that have been run by
        this DocTestRunner, and return a tuple `(f, t)`, where `f` is
        the total number of failed examples, and `t` is the total
        number of tried examples.

        The optional `verbose` argument controls how detailed the
        summary is.  If the verbosity is not specified, then the
        DocTestRunner's verbosity is used.
        Nr"zitems had no tests:z   zitems passed all tests:z %3d tests in %szitems had failures:z %3d of %3d in %sztests inzitems.z
passed andzfailed.z***Test Failed***z	failures.zTest passed.)
r�rrrur�rr)r�r+r%)
rjr�ZnotestsZpassedZfailedZtotaltZtotalfr�r+rWr7�thingr�r,r,r-�	summarize�sR
zDocTestRunner.summarizecCsR|j}|j��D]<\}\}}||kr@||\}}||}||}||f||<qdSrl)rr)rjr��dr+rWr7r8r9r,r,r-�mergeszDocTestRunner.merge)NNr")N)NNT)N)r6rprqr�r+r�r"r$r'r)r%rPr1r[r�r<rIrRrTrVr,r,r,r-rhs9
$
}



I
9c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)ra_
    A class used to check the whether the actual output from a doctest
    example matches the expected output.  `OutputChecker` defines two
    methods: `check_output`, which compares a given pair of outputs,
    and returns true if they match; and `output_difference`, which
    returns a string describing the differences between two outputs.
    cCst|�dd�d�S)z=
        Convert string to hex-escaped ASCII string.
        �ASCIIrB)r:rC)rjr]r,r,r-�_toAscii(szOutputChecker._toAsciicCs�|�|�}|�|�}||kr dS|t@sH||fdkr8dS||fdkrHdS|t@s�t�dt�t�d|�}t�dd|�}||kr�dS|t@r�d�|�	��}d�|�	��}||kr�dS|t
@r�t||�r�dSdS)	a�
        Return True iff the actual output from an example (`got`)
        matches the expected output (`want`).  These strings are
        always considered to match if they are identical; but
        depending on what option flags the test runner is using,
        several non-exact match types are also possible.  See the
        documentation for `TestRunner` for more information about
        option flags.
        T)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r�z(?m)^[^\S\n]+$rZF)rXrrr[r\�escape�BLANKLINE_MARKERrr�rtrr}�rjrxryrr,r,r-r,.s4

�
zOutputChecker.check_outputcCs<|ttBtB@sdS|t@r dS|�d�dko:|�d�dkS)NFTrFr4)r	r
rr�r[r,r,r-�_do_a_fancy_diffms��zOutputChecker._do_a_fancy_diffc
Cs8|j}|t@st�dt|�}|�|||�r�|jdd�}|jdd�}|t@rptj	||dd�}t
|�dd�}d}nf|t@r�tj||dd�}t
|�dd�}d}n8|t
@r�tjtjd	�}	t
|	�||��}d
}nds�td��d
|td�|��S|�r|�rdt|�t|�fS|�rdt|�S|�r0dt|�SdSdS)z�
        Return a string describing the differences between the
        expected output for a given example (`example`) and the actual
        output (`got`).  `optionflags` is the set of option flags used
        to compare `want` and `got`.
        z(?m)^[ ]*(?=
)Tr:r4)�nNz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualr"zBad diff optionzDifferences (%s):
r�zExpected:
%sGot:
%szExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rxrr[r\rZr\r>r	�difflibZunified_diff�listr
Zcontext_diffrZDifferZIS_CHARACTER_JUNKZcomparerur_r�)
rjr!ryrrxr�Z	got_linesZdiffZkindZenginer,r,r-r&�s6zOutputChecker.output_differenceN)r6rprqr�rXr,r\r&r,r,r,r-r s
?c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has failed in debugging mode.

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - got: the actual output
    cCs||_||_||_dSrl)rr!ry)rjrr!ryr,r,r-r��szDocTestFailure.__init__cCs
t|j�Srl�r:rr�r,r,r-�__str__�szDocTestFailure.__str__N�r6rprqr�r�rar,r,r,r-r�s
c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has encountered an unexpected exception

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - exc_info: the exception info
    cCs||_||_||_dSrl)rr!rd)rjrr!rdr,r,r-r��szUnexpectedException.__init__cCs
t|j�Srlr`r�r,r,r-ra�szUnexpectedException.__str__Nrbr,r,r,r-r�s
c@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ra�	Run doc tests but raise an exception as soon as there is a failure.

       If an unexpected exception occurs, an UnexpectedException is raised.
       It contains the test, the example, and the original exception:

         >>> runner = DebugRunner(verbose=False)
         >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
         ...                                    {}, 'foo', 'foo.py', 0)
         >>> try:
         ...     runner.run(test)
         ... except UnexpectedException as f:
         ...     failure = f

         >>> failure.test is test
         True

         >>> failure.example.want
         '42\n'

         >>> exc_info = failure.exc_info
         >>> raise exc_info[1] # Already has the traceback
         Traceback (most recent call last):
         ...
         KeyError

       We wrap the original exception to give the calling application
       access to the test and example information.

       If the output doesn't match, then a DocTestFailure is raised:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 1
         ...      >>> x
         ...      2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> try:
         ...    runner.run(test)
         ... except DocTestFailure as f:
         ...    failure = f

       DocTestFailure objects provide access to the test:

         >>> failure.test is test
         True

       As well as to the example:

         >>> failure.example.want
         '2\n'

       and the actual output:

         >>> failure.got
         '1\n'

       If a failure or error occurs, the globals are left intact:

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 1}

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      >>> raise KeyError
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         Traceback (most recent call last):
         ...
         doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 2}

       But the globals are cleared if there is no error:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         TestResults(failed=0, attempted=1)

         >>> test.globs
         {}

       NTcCs$t�||||d�}|r |j��|S)NF)rrRr1rM)rjrr2r�rQ�rr,r,r-rR3s
zDebugRunner.runcCst|||��dSrl)rr(r,r,r-r)9sz'DebugRunner.report_unexpected_exceptioncCst|||��dSrl)rr#r,r,r-r'<szDebugRunner.report_failure)NNT)r6rprqr�rRr)r'r,r,r,r-r�sZ
TFc	Cs�|dkrtj�d�}t�|�s,td|f��|dkr:|j}t|d�}	|rVt||d�}
nt	||d�}
|	j
||||d�D]}|
�|�qt|r�|
��t
dkr�|
a
n
t
�|
�t|
j|
j�S)a*
m=None, name=None, globs=None, verbose=None, report=True,
       optionflags=0, extraglobs=None, raise_on_error=False,
       exclude_empty=False

    Test examples in docstrings in functions and classes reachable
    from module m (or the current module if m is not supplied), starting
    with m.__doc__.

    Also test examples reachable from dict m.__test__ if it exists and is
    not None.  m.__test__ maps names to functions, classes and strings;
    function and class docstrings are tested even if the name is private;
    strings are tested directly, as if they were docstrings.

    Return (#failures, #tests).

    See help(doctest) for an overview.

    Optional keyword arg "name" gives the name of the module; by default
    use m.__name__.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use m.__dict__.  A copy of this
    dict is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.  This is new in 2.4.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  This is new in 2.3.  Possible values (see the
    docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    Nr�ztestmod: module required; %r)r��r�r�r1r�)r>r?r/r7r8rBr6rrrrwrRrT�masterrVr%rr)r�r+r1r��reportrr��raise_on_errorr��finder�runnerrr,r,r-rHs$E


cCs�|r|std��t||||pd�\}}|dkr:tj�|�}|dkrHi}n|��}|dk	rb|�|�d|krrd|d<|	r�t||d�}
nt||d�}
|
�	||||d�}|
�
|�|r�|
��tdkr�|
an
t�
|
�t|
j|
j�S)a


    Test examples in the given file.  Return (#failures, #tests).

    Optional keyword arg "module_relative" specifies how filenames
    should be interpreted:

      - If "module_relative" is True (the default), then "filename"
         specifies a module-relative path.  By default, this path is
         relative to the calling module's directory; but if the
         "package" argument is specified, then it is relative to that
         package.  To ensure os-independence, "filename" should use
         "/" characters to separate path segments, and should not
         be an absolute path (i.e., it may not begin with "/").

      - If "module_relative" is False, then "filename" specifies an
        os-specific path.  The path may be absolute or relative (to
        the current working directory).

    Optional keyword arg "name" gives the name of the test; by default
    use the file's basename.

    Optional keyword argument "package" is a Python package or the
    name of a Python package whose directory should be used as the
    base directory for a module relative filename.  If no package is
    specified, then the calling module's directory is used as the base
    directory for module relative filenames.  It is an error to
    specify "package" if "module_relative" is False.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use {}.  A copy of this dict
    is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  Possible values (see the docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Optional keyword arg "parser" specifies a DocTestParser (or
    subclass) that should be used to extract tests from the files.

    Optional keyword arg "encoding" specifies an encoding that should
    be used to convert the file to unicode.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    �8Package may only be specified for module-relative paths.rANr6r�rdr")r�rXr�r��basenamer�r�rrr�rRrTrfrVr%rr)rTrVr+rUr1r�rgrr�rhr�rN�textrjrr,r,r-r�s2R�


�NoNamec	Cs@t|dd�}t||d�}|j|||d�D]}|j||d�q(dS)ar
    Test examples in the given object's docstring (`f`), using `globs`
    as globals.  Optional argument `name` is used in failure messages.
    If the optional argument `verbose` is true, then generate output
    even if there are no failures.

    `compileflags` gives the set of flags that should be used by the
    Python compiler when running the examples.  If not specified, then
    it will default to the set of future-import flags that apply to
    `globs`.

    Optional keyword arg `optionflags` specifies options for the
    testing and output.  See the documentation for `testmod` for more
    information.
    F)r�r�rd)r1)r2N)rrrwrR)	rWr1r�r+r2rrirjrr,r,r-r+scCs"|t@|krtd|��t}|a|S)a?Sets the unittest option flags.

    The old flag is returned so that a runner could restore the old
    value if it wished to:

      >>> import doctest
      >>> old = doctest._unittest_reportflags
      >>> doctest.set_unittest_reportflags(REPORT_NDIFF |
      ...                          REPORT_ONLY_FIRST_FAILURE) == old
      True

      >>> doctest._unittest_reportflags == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True

    Only reporting flags can be set:

      >>> doctest.set_unittest_reportflags(ELLIPSIS)
      Traceback (most recent call last):
      ...
      ValueError: ('Only reporting flags allowed', 8)

      >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True
    zOnly reporting flags allowed)r
r��_unittest_reportflags)r2�oldr,r,r-rHs

c@sleZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
jZdd�ZdS)�DocTestCaser"NcCs.tj�|�||_||_||_||_||_dSrl)�unittest�TestCaser��_dt_optionflags�_dt_checker�_dt_test�	_dt_setUp�_dt_tearDown)rjrr�setUp�tearDownr r,r,r-r�nszDocTestCase.__init__cCs|j}|jdk	r|�|�dSrl)rvrw�rjrr,r,r-ryxs
zDocTestCase.setUpcCs(|j}|jdk	r|�|�|j��dSrl)rvrxr1rMr{r,r,r-rz~s

zDocTestCase.tearDowncCs~|j}tj}t�}|j}|t@s(|tO}t||jdd�}z d|_	|j
||jdd�\}}W5|t_X|rz|�|�
|�����dS)NF�rr r�zF----------------------------------------------------------------------)r�rQ)rvr>r�r#rtr
rorrur+rRrDZfailureException�format_failurerc)rjrrp�newrrjrrr,r,r-�runTest�s(��zDocTestCase.runTestcCsP|j}|jdkrd}n
d|j}d�|j�d�dd��}d|j|j|||fS)Nzunknown line numberz%sr�rrz:Failed doctest test for %s
  File "%s", line %s, in %s

%s)rvr�r�r+rtrT)rj�errrr�Zlnamer,r,r-r}�s

�zDocTestCase.format_failurecCs6|��t|j|jdd�}|j|jdd�|��dS)a�Run the test case without results and without catching exceptions

           The unit test framework includes a debug method on test cases
           and test suites to support post-mortem debugging.  The test code
           is run in such a way that errors are not caught.  This way a
           caller can catch the errors and initiate post-mortem debugging.

           The DocTestCase provides a debug method that raises
           UnexpectedException errors if there is an unexpected
           exception:

             >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
             ...                {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)
             >>> try:
             ...     case.debug()
             ... except UnexpectedException as f:
             ...     failure = f

           The UnexpectedException contains the test, the example, and
           the original exception:

             >>> failure.test is test
             True

             >>> failure.example.want
             '42\n'

             >>> exc_info = failure.exc_info
             >>> raise exc_info[1] # Already has the traceback
             Traceback (most recent call last):
             ...
             KeyError

           If the output doesn't match, then a DocTestFailure is raised:

             >>> test = DocTestParser().get_doctest('''
             ...      >>> x = 1
             ...      >>> x
             ...      2
             ...      ''', {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)

             >>> try:
             ...    case.debug()
             ... except DocTestFailure as f:
             ...    failure = f

           DocTestFailure objects provide access to the test:

             >>> failure.test is test
             True

           As well as to the example:

             >>> failure.example.want
             '2\n'

           and the actual output:

             >>> failure.got
             '1\n'

           Fr|)rQN)ryrrtrurRrvrz)rjrjr,r,r-r!�sB�zDocTestCase.debugcCs|jjSrl�rvr+r�r,r,r-r��szDocTestCase.idcCsPt|�t|�k	rtS|j|jkoN|j|jkoN|j|jkoN|j|jkoN|j|jkSrl)r�r�rvrtrwrxrur�r,r,r-r��s
�
�
�
�zDocTestCase.__eq__cCst|j|j|j|jf�Srl)r�rtrwrxrur�r,r,r-r��s�zDocTestCase.__hash__cCs,|jj�d�}d|dd�|dd��fS)Nr�z%s (%s)rr)rvr+rtr�)rjr+r,r,r-r�	szDocTestCase.__repr__cCsd|jjS)Nz	Doctest: r�r�r,r,r-�shortDescription		szDocTestCase.shortDescription)r"NNN)r6rprqr�ryrzrr}r!r�r�r�r�rrar�r,r,r,r-rqls�

H
rqc@s0eZdZdd�Zdd�Zdd�Zdd�ZeZd	S)
�SkipDocTestCasecCs||_t�|d�dSrl)rCrqr�)rjrCr,r,r-r�
	szSkipDocTestCase.__init__cCs|�d�dS)Nz-DocTestSuite will not work with -O2 and above)ZskipTestr�r,r,r-ry	szSkipDocTestCase.setUpcCsdSrlr,r�r,r,r-�	test_skip	szSkipDocTestCase.test_skipcCsd|jjS)NzSkipping tests from %s)rCr6r�r,r,r-r�	sz SkipDocTestCase.shortDescriptionN)r6rprqr�ryr�r�rar,r,r,r-r�	s
r�c@seZdZdd�ZdS)�
_DocTestSuitecCsdSrlr,)rj�indexr,r,r-�_removeTestAtIndex	sz _DocTestSuite._removeTestAtIndexN)r6rprqr�r,r,r,r-r�	sr�c	Ks�|dkrt�}t|�}|j|||d�}|sNtjjdkrNt�}|�t|��|S|�	�t�}|D]T}t
|j�dkrtq`|js�|j
}|dd�dkr�|dd�}||_|�t|f|��q`|S)a
    Convert doctest tests for a module to a unittest test suite.

    This converts each documentation string in a module that
    contains doctest tests to a unittest test case.  If any of the
    tests in a doc string fail, then the test case fails.  An exception
    is raised showing the name of the file containing the test and a
    (sometimes approximate) line number.

    The `module` argument provides the module to be tested.  The argument
    can be either a module or a module name.

    If no argument is given, the calling module is used.

    A number of options may be provided as keyword arguments:

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
       A set of doctest option flags expressed as an integer.
    Nrer4r"rrrr)rrDrwr>r2�optimizer��addTestr�r�r)r�rTr�rq)	rCr1r�Ztest_finderr�r��suiterrTr,r,r-r#	s(%c@s$eZdZdd�Zdd�Zdd�ZdS)�DocFileCasecCsd�|jj�d��S)NrOr�)r�rvr+rtr�r,r,r-r�e	szDocFileCase.idcCs|jjSrl)rvrTr�r,r,r-r�h	szDocFileCase.__repr__cCsd|jj|jj|fS)Nz2Failed doctest test for %s
  File "%s", line 0

%s)rvr+rT)rjr�r,r,r-r}k	s�zDocFileCase.format_failureN)r6rprqr�r�r}r,r,r,r-r�c	sr�c
Ksv|dkri}n|��}|r&|s&td��t||||p4d�\}}d|krL||d<tj�|�}|�||||d�}	t|	f|�S)NrkrAr�r")r�r�rXr�r�rlr�r�)
r�rVrUr1r�rNr��docr+rr,r,r-�DocFileTestp	s�r�cOsDt�}|�dd�r$t|�d��|d<|D]}|�t|f|��q(|S)a�A unittest suite for one or more doctest files.

    The path to each doctest file is given as a string; the
    interpretation of that string depends on the keyword argument
    "module_relative".

    A number of options may be provided as keyword arguments:

    module_relative
      If "module_relative" is True, then the given file paths are
      interpreted as os-independent module-relative paths.  By
      default, these paths are relative to the calling module's
      directory; but if the "package" argument is specified, then
      they are relative to that package.  To ensure os-independence,
      "filename" should use "/" characters to separate path
      segments, and may not be an absolute path (i.e., it may not
      begin with "/").

      If "module_relative" is False, then the given file paths are
      interpreted as os-specific paths.  These paths may be absolute
      or relative (to the current working directory).

    package
      A Python package or the name of a Python package whose directory
      should be used as the base directory for module relative paths.
      If "package" is not specified, then the calling module's
      directory is used as the base directory for module relative
      filenames.  It is an error to specify "package" if
      "module_relative" is False.

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
      A set of doctest option flags expressed as an integer.

    parser
      A DocTestParser (or subclass) that should be used to extract
      tests from the files.

    encoding
      An encoding that will be used to convert the files to unicode.
    rVTrU)r�r/rDr�r�)�paths�kwr�r�r,r,r-r�	s8cCs�g}t��|�D]x}t|t�rh|�|jdd��|j}|r�|�d�|dd�|�d�dd�D�7}q|dd�|�d�dd�D�7}q|r�|ddkr�|��q�|r�|d	dkr�|�d	�q�d�	|�dS)
awExtract script from text with examples.

       Converts text with examples to a Python script.  Example input is
       converted to regular code.  Example output and all other words
       are converted to comments:

       >>> text = '''
       ...       Here are examples of simple math.
       ...
       ...           Python has super accurate integer addition
       ...
       ...           >>> 2 + 2
       ...           5
       ...
       ...           And very friendly error messages:
       ...
       ...           >>> 1/0
       ...           To Infinity
       ...           And
       ...           Beyond
       ...
       ...           You can use logic if you want:
       ...
       ...           >>> if 0:
       ...           ...    blah
       ...           ...    blah
       ...           ...
       ...
       ...           Ho hum
       ...           '''

       >>> print(script_from_examples(text))
       # Here are examples of simple math.
       #
       #     Python has super accurate integer addition
       #
       2 + 2
       # Expected:
       ## 5
       #
       #     And very friendly error messages:
       #
       1/0
       # Expected:
       ## To Infinity
       ## And
       ## Beyond
       #
       #     You can use logic if you want:
       #
       if 0:
          blah
          blah
       #
       #     Ho hum
       <BLANKLINE>
       Nrrz# Expected:cSsg|]}d|�qS)z## r,r�r,r,r-r�
sz(script_from_examples.<locals>.<listcomp>rFcSsg|]}t|��qSr,)r�r�r,r,r-r�
s�r~r")
rr�r9rr�r�rxrt�popr�)r]r�Zpiecerxr,r,r-r�	s :

"�

csJt|�}t��|�}�fdd�|D�}|s4t�d��|d}t|j�}|S)aExtract the test sources from a doctest docstring as a script.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the doc string with tests to be debugged.
    csg|]}|j�kr|�qSr,r*)r�r7r*r,r-r�.
s
ztestsource.<locals>.<listcomp>znot found in testsr")rDrrwr�rr�)rCr+r�r�testsrcr,r*r-r%
s

cCst|�}t|||�dS)z4Debug a single doctest docstring, in argument `src`'N)r�debug_script)�src�pmr1r�r,r,r-r 5
scCs�ddl}|r|��}ni}|rvzt|||�Wq�tt��d�|jdd�}|��|�dt��d�Yq�Xn|jdd��	d|||�dS)z7Debug a test script.  `src` is the script, as a string.r"Nr&T)r�r4zexec(%r))
r�r�r-rr>rdr�rHZinteractionrR)r�r�r1r��pr,r,r-r�:
s
r�cCs$t|�}t||�}t|||j�dS)z�Debug a single doctest docstring.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the docstring with tests to be debugged.
    N)rDrr�r�)rCr+r�r�r,r,r-r!N
s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
_TestClassz�
    A pointless class, for sanity-checking of docstring testing.

    Methods:
        square()
        get()

    >>> _TestClass(13).get() + _TestClass(-12).get()
    1
    >>> hex(_TestClass(13).square().get())
    '0xa9'
    cCs
||_dS)z�val -> _TestClass object with associated value val.

        >>> t = _TestClass(123)
        >>> print(t.get())
        123
        N�r
)rjr
r,r,r-r�j
sz_TestClass.__init__cCs|jd|_|S)zosquare() -> square TestClass's associated value

        >>> _TestClass(13).square().get()
        169
        r4r�r�r,r,r-�squaret
sz_TestClass.squarecCs|jS)z~get() -> return TestClass's associated value.

        >>> x = _TestClass(-42)
        >>> print(x.get())
        -42
        r�r�r,r,r-r/~
sz_TestClass.getN)r6rprqr�r�r�r/r,r,r,r-r�\
s


r�z�
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      a�
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    z�
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            z�
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            a�
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r�r�zbool-int equivalencezblank linesZellipsiszwhitespace normalizationcCs"ddl}|jdd�}|jdddddd	�|jd
ddt��gd
d�|jddddd�|jdddd�|��}|j}|j}d}|jD]}|t|O}q�|j	r�|t
O}|D]v}|�d�r�tj
�|�\}}tj
�d|�t|dd��}	tj
d=t|	||d�\}
}nt|d||d�\}
}|
r�dSq�dS)Nr"zdoctest runner)Zdescriptionrz	--verbose�
store_trueFz'print very verbose output for all tests)�action�default�helpz-oz--optionr�zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r��choicesr�r�z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r�r�r`r�z file containing the tests to run)�nargsr�z.py���rd)rVr�rr&)�argparse�ArgumentParser�add_argumentr'�keys�
parse_argsr`r�r�Z	fail_fastrrir�r�rtr>�insertr;rr)r�r�r�Z	testfilesr�r�r�rT�dirnamer�rrOr,r,r-�_test�
sL�
�
��

�
r�r�)r4)rY)	NNNNTr"NFF)FrnNr")NNNN)FN)FN)F)Sr�Z
__docformat__�__all__r.r^r7r�r�r�r[r>rarr�ior#�collectionsr$r%r'rrrrrrrrr	r
rrrr
rZrsr3rDrJrXr_rfrgr}r�r�r�r�rOrrrrrr�	Exceptionrrrrfrrrrorrsrqr�Z	TestSuiter�rr�r�rrrr r�r!r�rr�r6�exitr,r,r,r-�<module>	sF'�-
���������

1%.DKl<;n�
h�
{�
$!
@
�
IR


,	�3-
numbers.cpython-38.opt-1.pyc000064400000027654151450073350011627 0ustar00U

e5d(�@s�dZddlmZmZdddddgZGdd�ded	�ZGd
d�de�Ze�e�Gdd�de�Z	e	�e
�Gdd�de	�ZGd
d�de�Ze�e
�dS)z~Abstract Base Classes (ABCs) for numbers, according to PEP 3141.

TODO: Fill out more detailed documentation on the operators.�)�ABCMeta�abstractmethod�Number�Complex�Real�Rational�Integralc@seZdZdZdZdZdS)rz�All numbers inherit from this class.

    If you just want to check if an argument x is a number, without
    caring what kind, use isinstance(x, Number).
    �N)�__name__�
__module__�__qualname__�__doc__�	__slots__�__hash__r	r	r	�/usr/lib64/python3.8/numbers.pyrs)�	metaclassc@s�eZdZdZdZedd��Zdd�Zeedd���Z	eed	d
���Z
edd��Zed
d��Zedd��Z
edd��Zdd�Zdd�Zedd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zd)S)*rabComplex defines the operations that work on the builtin complex type.

    In short, those are: a conversion to complex, .real, .imag, +, -,
    *, /, abs(), .conjugate, ==, and !=.

    If it is given heterogeneous arguments, and doesn't have special
    knowledge about them, it should fall back to the builtin complex
    type as described below.
    r	cCsdS)z<Return a builtin complex instance. Called for complex(self).Nr	��selfr	r	r�__complex__-szComplex.__complex__cCs|dkS)z)True if self != 0. Called for bool(self).rr	rr	r	r�__bool__1szComplex.__bool__cCst�dS)zXRetrieve the real component of this number.

        This should subclass Real.
        N��NotImplementedErrorrr	r	r�real5szComplex.realcCst�dS)z]Retrieve the imaginary component of this number.

        This should subclass Real.
        Nrrr	r	r�imag>szComplex.imagcCst�dS)zself + otherNr�r�otherr	r	r�__add__GszComplex.__add__cCst�dS)zother + selfNrrr	r	r�__radd__LszComplex.__radd__cCst�dS)z-selfNrrr	r	r�__neg__QszComplex.__neg__cCst�dS)z+selfNrrr	r	r�__pos__VszComplex.__pos__cCs
||S)zself - otherr	rr	r	r�__sub__[szComplex.__sub__cCs
||S)zother - selfr	rr	r	r�__rsub___szComplex.__rsub__cCst�dS)zself * otherNrrr	r	r�__mul__cszComplex.__mul__cCst�dS)zother * selfNrrr	r	r�__rmul__hszComplex.__rmul__cCst�dS)z5self / other: Should promote to float when necessary.Nrrr	r	r�__truediv__mszComplex.__truediv__cCst�dS)zother / selfNrrr	r	r�__rtruediv__rszComplex.__rtruediv__cCst�dS)zBself**exponent; should promote to float or complex when necessary.Nr)r�exponentr	r	r�__pow__wszComplex.__pow__cCst�dS)zbase ** selfNr)r�baser	r	r�__rpow__|szComplex.__rpow__cCst�dS)z7Returns the Real distance from 0. Called for abs(self).Nrrr	r	r�__abs__�szComplex.__abs__cCst�dS)z$(x+y*i).conjugate() returns (x-y*i).Nrrr	r	r�	conjugate�szComplex.conjugatecCst�dS)z
self == otherNrrr	r	r�__eq__�szComplex.__eq__N)r
rrr
rrrr�propertyrrrrrrr r!r"r#r$r%r'r)r*r+r,r	r	r	rr sN













c@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	ed&dd
��Z
dd�Zdd�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�Zed d!��Zed"d#��Zd$d%�ZdS)'rz�To Complex, Real adds the operations that work on real numbers.

    In short, those are: a conversion to float, trunc(), divmod,
    %, <, <=, >, and >=.

    Real also provides defaults for the derived operations.
    r	cCst�dS)zTAny Real can be converted to a native float object.

        Called for float(self).Nrrr	r	r�	__float__�szReal.__float__cCst�dS)aGtrunc(self): Truncates self to an Integral.

        Returns an Integral i such that:
          * i>0 iff self>0;
          * abs(i) <= abs(self);
          * for any Integral j satisfying the first two conditions,
            abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
        i.e. "truncate towards 0".
        Nrrr	r	r�	__trunc__�szReal.__trunc__cCst�dS)z$Finds the greatest Integral <= self.Nrrr	r	r�	__floor__�szReal.__floor__cCst�dS)z!Finds the least Integral >= self.Nrrr	r	r�__ceil__�sz
Real.__ceil__NcCst�dS)z�Rounds self to ndigits decimal places, defaulting to 0.

        If ndigits is omitted or None, returns an Integral, otherwise
        returns a Real. Rounds half toward even.
        Nr)rZndigitsr	r	r�	__round__�szReal.__round__cCs||||fS)z�divmod(self, other): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�
__divmod__�szReal.__divmod__cCs||||fS)z�divmod(other, self): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�__rdivmod__�szReal.__rdivmod__cCst�dS)z)self // other: The floor() of self/other.Nrrr	r	r�__floordiv__�szReal.__floordiv__cCst�dS)z)other // self: The floor() of other/self.Nrrr	r	r�
__rfloordiv__�szReal.__rfloordiv__cCst�dS)zself % otherNrrr	r	r�__mod__�szReal.__mod__cCst�dS)zother % selfNrrr	r	r�__rmod__�sz
Real.__rmod__cCst�dS)zRself < other

        < on Reals defines a total ordering, except perhaps for NaN.Nrrr	r	r�__lt__�szReal.__lt__cCst�dS)z
self <= otherNrrr	r	r�__le__�szReal.__le__cCstt|��S)z(complex(self) == complex(float(self), 0))�complex�floatrr	r	rr�szReal.__complex__cCs|
S)z&Real numbers are their real component.r	rr	r	rr�sz	Real.realcCsdS)z)Real numbers have no imaginary component.rr	rr	r	rr�sz	Real.imagcCs|
S)zConjugate is a no-op for Reals.r	rr	r	rr+szReal.conjugate)N)r
rrr
rrr.r/r0r1r2r3r4r5r6r7r8r9r:rr-rrr+r	r	r	rr�s@











c@s<eZdZdZdZeedd���Zeedd���Zdd�Z	d	S)
rz6.numerator and .denominator should be in lowest terms.r	cCst�dS�Nrrr	r	r�	numeratorszRational.numeratorcCst�dSr=rrr	r	r�denominatorszRational.denominatorcCs|j|jS)afloat(self) = self.numerator / self.denominator

        It's important that this conversion use the integer's "true"
        division rather than casting one side to float before dividing
        so that ratios of huge integers convert without overflowing.

        )r>r?rr	r	rr.szRational.__float__N)
r
rrr
rr-rr>r?r.r	r	r	rrsc@s�eZdZdZdZedd��Zdd�Zed&dd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��Zd d!�Zed"d#��Zed$d%��ZdS)'rz@Integral adds a conversion to int and the bit-string operations.r	cCst�dS)z	int(self)Nrrr	r	r�__int__+szIntegral.__int__cCst|�S)z6Called whenever an index is needed, such as in slicing)�intrr	r	r�	__index__0szIntegral.__index__NcCst�dS)a4self ** exponent % modulus, but maybe faster.

        Accept the modulus argument if you want to support the
        3-argument version of pow(). Raise a TypeError if exponent < 0
        or any argument isn't Integral. Otherwise, just implement the
        2-argument version described in Complex.
        Nr)rr&�modulusr	r	rr'4s	zIntegral.__pow__cCst�dS)z
self << otherNrrr	r	r�
__lshift__?szIntegral.__lshift__cCst�dS)z
other << selfNrrr	r	r�__rlshift__DszIntegral.__rlshift__cCst�dS)z
self >> otherNrrr	r	r�
__rshift__IszIntegral.__rshift__cCst�dS)z
other >> selfNrrr	r	r�__rrshift__NszIntegral.__rrshift__cCst�dS)zself & otherNrrr	r	r�__and__SszIntegral.__and__cCst�dS)zother & selfNrrr	r	r�__rand__XszIntegral.__rand__cCst�dS)zself ^ otherNrrr	r	r�__xor__]szIntegral.__xor__cCst�dS)zother ^ selfNrrr	r	r�__rxor__bszIntegral.__rxor__cCst�dS)zself | otherNrrr	r	r�__or__gszIntegral.__or__cCst�dS)zother | selfNrrr	r	r�__ror__lszIntegral.__ror__cCst�dS)z~selfNrrr	r	r�
__invert__qszIntegral.__invert__cCstt|��S)zfloat(self) == float(int(self)))r<rArr	r	rr.wszIntegral.__float__cCs|
S)z"Integers are their own numerators.r	rr	r	rr>{szIntegral.numeratorcCsdS)z!Integers have a denominator of 1.�r	rr	r	rr?�szIntegral.denominator)N)r
rrr
rrr@rBr'rDrErFrGrHrIrJrKrLrMrNr.r-r>r?r	r	r	rr&sD













N)r
�abcrr�__all__rr�registerr;rr<rrrAr	r	r	r�<module>sp
u
_gzip.cpython-38.opt-2.pyc000064400000033756151450073350011126 0ustar00U

e5d�S�@sddlZddlZddlZddlZddlZddlZddlZddlZdddddgZd\Z	Z
ZZZ
d\ZZd	Zd
ZdZdedddfd
d�Zdd�ZGdd�d�ZGdd�de�ZGdd�dej�ZGdd�dej�Zefdd�dd�Zdd�Zdd�Zedkr�e�dS)�N�BadGzipFile�GzipFile�open�compress�
decompress)�����)rrr��	�rbcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|tttjf�r|t|||�}n,t|d�s�t|d	�r�td|||�}nt	d
��d|kr�t
�||||�S|SdS)N�t�bzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newlineZgz_modeZbinary_file�r%�/usr/lib64/python3.8/gzip.pyrs$cCs|�t�d|��dS)Nz<L)r�structZpack)�output�valuer%r%r&�write32uEsr*c@s8eZdZd
dd�Zdd�Zddd�Zdd	�Zd
d�ZdS)�_PaddedFile�cCs ||_t|�|_||_d|_dS�Nr)�_buffer�len�_length�file�_read)�self�f�prependr%r%r&�__init__Os
z_PaddedFile.__init__cCs~|jdkr|j�|�S|j||jkrJ|j}|j|7_|j||j�S|j}d|_|j|d�|j�||j|�SdS�N)r2r1rr0r.)r3�sizerr%r%r&rUs
�z_PaddedFile.readcCs>|jdkr||_n|jt|�8_dSt|j�|_d|_dSr-)r2r.r/r0)r3r5r%r%r&r5bs
z_PaddedFile.prependcCsd|_d|_|j�|�Sr7)r2r.r1�seek)r3Zoffr%r%r&r9ksz_PaddedFile.seekcCsdS�NTr%�r3r%r%r&�seekablepsz_PaddedFile.seekableN)r,)r,)�__name__�
__module__�__qualname__r6rr5r9r<r%r%r%r&r+Js


	r+c@seZdZdS)rN)r=r>r?r%r%r%r&rtsc@s�eZdZdZddeddfdd�Zedd��Zedd��Zdd	�Z	d
d�Z
dd
�Zdd�Zd+dd�Z
d,dd�Zdd�Zedd��Zdd�Zejfdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zejfd'd(�Zd-d)d*�ZdS).rNcCs4|r"d|ksd|kr"td�|���|r6d|kr6|d7}|dkrTt�||pJd�}|_|dkr|t|dd�}t|ttf�s�d}n
t	�
|�}|dkr�t|dd�}|�d	�r�t|_
t|�}t�|�|_||_nN|�d
��rt|_
|�|�t�|tjtjtjd�|_||_ntd�|���||_|j
tk�r0|�|�dS)Nr�UzInvalid mode: {!r}rr�namerr �r)�w�a�xr)r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr �_GzipReaderr�BufferedReaderr.rA�WRITE�_init_write�zlibZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�_write_mtime�fileobj�_write_gzip_header)r3rr r!rT�mtime�rawr%r%r&r6�s@#


�zGzipFile.__init__cCsBddl}|�dtd�|jtkr<|jdd�dkr<|jdS|jS)Nrzuse the name attributer����.gz)�warnings�warn�DeprecationWarningr rOrA)r3rZr%r%r&r�s

zGzipFile.filenamecCs
|jjjSr7)r.rW�_last_mtimer;r%r%r&rV�szGzipFile.mtimecCs.t|j�}d|dd�dtt|��dS)Nz<gzip r���� �>)�reprrT�hex�id)r3�sr%r%r&�__repr__�s
zGzipFile.__repr__cCs.||_t�d�|_d|_g|_d|_d|_dS�Nr,r)rArQ�crc32�crcr8Zwritebuf�bufsize�offset)r3rr%r%r&rP�szGzipFile._init_writecCs|j�d�|j�d�z<tj�|j�}t|t�s<|�d�}|�	d�rR|dd�}Wnt
k
rld}YnXd}|rzt}|j�t|��d��|j
}|dkr�t��}t|jt|��|tkr�d}n|tkr�d	}nd
}|j�|�|j�d�|�r|j�|d
�dS)N���zlatin-1s.gzrXr,r�����)rTrr�path�basenamerArr�encode�endswith�UnicodeEncodeError�FNAME�chrrS�timer*�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r3r!Zfname�flagsrVZxflr%r%r&rU�s6



zGzipFile._write_gzip_headercCs�|��|jtkr&ddl}t|jd��|jdkr8td��t|t	�rLt
|�}nt|�}|j}|dkr�|j�
|j�|��|j|7_t�||j�|_|j|7_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)�_check_not_closedr rO�errno�OSError�EBADFrTrrrr/�
memoryview�nbytesrrr8rQrgrhrj)r3�datar~Zlengthr%r%r&rs 



zGzipFile.writer^cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$read() on write-only GzipFile object)r}r rLr~rr�r.r�r3r8r~r%r%r&rs

z
GzipFile.readcCs@|��|jtkr&ddl}t|jd��|dkr4tj}|j�	|�S)Nrz%read1() on write-only GzipFile object)
r}r rLr~rr�r�DEFAULT_BUFFER_SIZEr.�read1r�r%r%r&r�&s
zGzipFile.read1cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$peek() on write-only GzipFile object)r}r rLr~rr�r.�peek)r3�nr~r%r%r&r�3s

z
GzipFile.peekcCs
|jdkSr7�rTr;r%r%r&�closed:szGzipFile.closedcCs�|j}|dkrdSd|_zP|jtkrR|�|j���t||j	�t||j
d@�n|jtkrf|j��W5|j}|r�d|_|��XdS)N���)
rTrH�closer rOrr�flushr*rhr8rLr.)r3rTrHr%r%r&r�>s

zGzipFile.closecCs4|��|jtkr0|j�|j�|��|j��dSr7)r}r rOrTrrr�)r3Z	zlib_moder%r%r&r�Qs
zGzipFile.flushcCs
|j��Sr7)rT�filenor;r%r%r&r�XszGzipFile.filenocCs"|jtkrtd��|j�d�dS)NzCan't rewind in write moder)r rLrr.r9r;r%r%r&�rewind`s
zGzipFile.rewindcCs
|jtkSr7)r rLr;r%r%r&�readablegszGzipFile.readablecCs
|jtkSr7)r rOr;r%r%r&�writablejszGzipFile.writablecCsdSr:r%r;r%r%r&r<mszGzipFile.seekablecCs�|jtkr�|tjkr2|tjkr*|j|}ntd��||jkrDtd��||j}d}t|d�D]}|�	|�q^|�	d|d�n |jt
kr�|��|j�
||�S|jS)NzSeek from end not supportedzNegative seek in write modes�ro)r rOr�SEEK_SET�SEEK_CURrjrr�rangerrLr}r.r9)r3rj�whence�count�chunk�ir%r%r&r9ps 





z
GzipFile.seekcCs|��|j�|�Sr7)r}r.�readline)r3r8r%r%r&r��szGzipFile.readline)r^)r^)r^)r=r>r?rHrzr6�propertyrrVrerPrUrrr�r�r�r�rQZZ_SYNC_FLUSHr�r�r�r�r�r<rr�r9r�r%r%r%r&rxs8�
I

 



csZeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�fdd�Z
�ZS)rMcs,t�jt|�tjtjd�d|_d|_dS)N)ZwbitsT)�superr6r+rQZ
decompressobjrR�_new_memberr])r3�fp��	__class__r%r&r6�s
�z_GzipReader.__init__cCst�d�|_d|_dSrf)rQrg�_crc�_stream_sizer;r%r%r&�
_init_read�sz_GzipReader._init_readcCsF|j�|�}t|�|krB|j�|t|��}|s8td��||7}q|S)N�ACompressed file ended before the end-of-stream marker was reached)�_fprr/�EOFError)r3r�r�rr%r%r&�_read_exact�s
z_GzipReader._read_exactcCs�|j�d�}|dkrdS|dkr,td|��t�d|�d��\}}|_|dkrVtd��|t@r|t�d	|�d��\}|�|�|t@r�|j�d
�}|r�|dkr�q�q�|t	@r�|j�d
�}|r�|dkr�q�q�|t
@r�|�d�dS)
Nrr,FrkzNot a gzipped file (%r)z<BBIxxr
zUnknown compression methodz<HrroT)r�rrr'�unpackr�r]�FEXTRArv�FCOMMENT�FHCRC)r3�magic�method�flagZ	extra_lenrdr%r%r&�_read_gzip_header�s0�

z_GzipReader._read_gzip_headerr^cCs�|dkr|��S|sdS|jjr>|��d|_|jf|j�|_|jrf|��|��s`|j	|_
dSd|_|j�t
j�}|j�||�}|jjdkr�|j�|jj�n|jjdkr�|j�|jj�|dkr�q�|dkrtd��q|�|�|j	t|�7_	|S)Nrr,TFr�)�readallZ
_decompressor�eof�	_read_eofr�Z_decomp_factoryZ_decomp_argsr�r�Z_posZ_sizer�rrr�rZunconsumed_tailr5Zunused_datar��_add_read_datar/)r3r8�bufZ
uncompressr%r%r&r�s:�

z_GzipReader.readcCs$t�||j�|_|jt|�|_dSr7)rQrgr�r�r/)r3r�r%r%r&r��sz_GzipReader._add_read_datacCs�t�d|�d��\}}||jkr<tdt|�t|j�f��n||jd@krRtd��d}|dkrl|j�d�}qV|r||j�	|�dS)Nz<IIr
zCRC check failed %s != %sr�z!Incorrect length of data producedror)
r'r�r�r�rrbr�r�rr5)r3rgZisize�cr%r%r&r��s

�
z_GzipReader._read_eofcst���d|_dSr:)r��_rewindr�r;r�r%r&r�s
z_GzipReader._rewind)r^)r=r>r?r6r�r�r�rr�r�r��
__classcell__r%r%r�r&rM�s!
3rM)rVc	Cs6t��}t|d||d��}|�|�W5QRX|��S)N�wb)rTr r!rV)r�BytesIOrr�getvalue)r�r!rVr�r4r%r%r&rsc
Cs0tt�|�d��}|��W5QR�SQRXdS)Nr�)rrr�r)r�r4r%r%r&rsc	Cs�ddlm}|dd�}|��}|jdddd�|jd	dd
d�|jdddd
d�|jdddgdd�|��}t}|jr|t}n
|jr�t	}|j
D]�}|jr�|dkr�tddt
jjd�}t
jj}n>|dd�dkr�t
�d|���t|d�}t�|dd�d�}nB|dk�r"t
jj}tddt
jj|d�}nt�|d�}t|dd�}|�d�}|�sP�q^|�|��q<|t
jjk	�rt|��|t
jjk	r�|��q�dS)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)Zdescriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r1)�nargs�default�metavarrr)rr rTrXrYzfilename doesn't end in .gz: r�)rr rTr!r�)�argparser�Zadd_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFFZfastr{Zbestrzr�rr�sys�stdin�buffer�stdout�exitrrGrrr�)	r��parser�groupr�r!�argr4�gr�r%r%r&�main'sR�
�



�
r��__main__) r'r�rxrrQrGrZ_compression�__all__ZFTEXTr�r�rvr�rLrOr{r�rzrr*r+rrZ
BaseStreamrZDecompressReaderrMrrr�r=r%r%r%r&�<module>s8 �
,*	0_threading_local.cpython-38.opt-1.pyc000064400000014460151450073350013421 0ustar00U

e5d4�@s^dZddlmZddlmZdgZGdd�d�Zedd��ZGd	d�d�Zdd
l	m
Z
mZdS)a(Thread-local objects.

(Note that this module provides a Python version of the threading.local
 class.  Depending on the version of Python you're using, there may be a
 faster one available.  You should always import the `local` class from
 `threading`.)

Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
a thread-local object and use its attributes:

  >>> mydata = local()
  >>> mydata.number = 42
  >>> mydata.number
  42

You can also access the local-object's dictionary:

  >>> mydata.__dict__
  {'number': 42}
  >>> mydata.__dict__.setdefault('widgets', [])
  []
  >>> mydata.widgets
  []

What's important about thread-local objects is that their data are
local to a thread. If we access the data in a different thread:

  >>> log = []
  >>> def f():
  ...     items = sorted(mydata.__dict__.items())
  ...     log.append(items)
  ...     mydata.number = 11
  ...     log.append(mydata.number)

  >>> import threading
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[], 11]

we get different data.  Furthermore, changes made in the other thread
don't affect data seen in this thread:

  >>> mydata.number
  42

Of course, values you get from a local object, including a __dict__
attribute, are for whatever thread was current at the time the
attribute was read.  For that reason, you generally don't want to save
these values across threads, as they apply only to the thread they
came from.

You can create custom local objects by subclassing the local class:

  >>> class MyLocal(local):
  ...     number = 2
  ...     def __init__(self, /, **kw):
  ...         self.__dict__.update(kw)
  ...     def squared(self):
  ...         return self.number ** 2

This can be useful to support default values, methods and
initialization.  Note that if you define an __init__ method, it will be
called each time the local object is used in a separate thread.  This
is necessary to initialize each thread's dictionary.

Now if we create a local object:

  >>> mydata = MyLocal(color='red')

Now we have a default number:

  >>> mydata.number
  2

an initial color:

  >>> mydata.color
  'red'
  >>> del mydata.color

And a method that operates on the data:

  >>> mydata.squared()
  4

As before, we can access the data in a separate thread:

  >>> log = []
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[('color', 'red')], 11]

without affecting this thread's data:

  >>> mydata.number
  2
  >>> mydata.color
  Traceback (most recent call last):
  ...
  AttributeError: 'MyLocal' object has no attribute 'color'

Note that subclasses can define slots, but they are not thread
local. They are shared across threads:

  >>> class MyLocal(local):
  ...     __slots__ = 'number'

  >>> mydata = MyLocal()
  >>> mydata.number = 42
  >>> mydata.color = 'red'

So, the separate thread:

  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()

affects what we see:

  >>> mydata.number
  11

>>> del mydata
�)�ref)�contextmanager�localc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�
_localimplz#A class managing thread-local dicts)�key�dicts�	localargs�	locallock�__weakref__cCsdtt|��|_i|_dS)Nz_threading_local._localimpl.)�str�idrr)�self�r�(/usr/lib64/python3.8/_threading_local.py�__init__�sz_localimpl.__init__cCst�}|jt|�dS)zPReturn the dict for the current thread. Raises KeyError if none
        defined.�)�current_threadrr)r
�threadrrr�get_dict�sz_localimpl.get_dictcshi}|j}t�}t|�}|f�fdd�	}|f�fdd�	}t||��t||���|j|<�|f|j|<|S)z8Create a new dict for the current thread, and return it.cs��}|dk	r|j|=dS�N)�__dict__)�_rr)�wrthreadrr�
local_deleted�sz-_localimpl.create_dict.<locals>.local_deletedcs��}|dk	r|j�|�}dSr)r�pop)r�idtr�dct)�wrlocalrr�thread_deleted�sz._localimpl.create_dict.<locals>.thread_deleted)rrrrrr)r
Z	localdictrrrrrr)rrr�create_dict�s


z_localimpl.create_dictN)�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrrr�s
rc	csvt�|d�}z|��}Wn2tk
rJ|��}|j\}}|j||�YnX|j�t�|d|�dVW5QRXdS)N�_local__implr)	�object�__getattribute__r�KeyErrorrrrr	�__setattr__)r
�implr�args�kwrrr�_patch�s
r-c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)r%rcOsX|s|r|jtjkrtd��t�|�}t�}||f|_t�|_t�|d|�|�	�|S)Nz*Initialization arguments are not supportedr%)
rr&�	TypeError�__new__rr�RLockr	r)r)�clsr+r,r
r*rrrr/�s

z
local.__new__c
Cs,t|��t�||�W5QR�SQRXdSr)r-r&r'�r
�namerrrr'�s
zlocal.__getattribute__c
CsF|dkrtd|jj��t|��t�|||�W5QR�SQRXdS�Nrz+%r object attribute '__dict__' is read-only)�AttributeError�	__class__r r-r&r))r
r3�valuerrrr)�s��
zlocal.__setattr__c
CsD|dkrtd|jj��t|��t�||�W5QR�SQRXdSr4)r5r6r r-r&�__delattr__r2rrrr8�s��
zlocal.__delattr__N)r r!r"r$r/r'r)r8rrrrr�s
)rr0N)r#�weakrefr�
contextlibr�__all__rr-rZ	threadingrr0rrrr�<module>s,

&tty.cpython-38.opt-1.pyc000064400000002066151450073350010762 0ustar00U

e5do�@sLdZddlTddgZdZdZdZdZdZd	Zd
Z	e
fdd�Ze
fdd�Zd
S)zTerminal utilities.�)�*�setraw�	setcbreak������cCs�t|�}|tttBtBtBtB@|t<|tt@|t<|t	t
tB@|t	<|t	tB|t	<|t
ttBtBtB@|t
<d|tt<d|tt<t|||�dS)zPut terminal into a raw mode.rrN)�	tcgetattr�IFLAGZBRKINTZICRNLZINPCKZISTRIPZIXON�OFLAGZOPOST�CFLAGZCSIZEZPARENBZCS8�LFLAG�ECHO�ICANONZIEXTENZISIG�CC�VMIN�VTIME�	tcsetattr��fdZwhen�mode�r�/usr/lib64/python3.8/tty.pyrs"cCsFt|�}|tttB@|t<d|tt<d|tt<t|||�dS)z Put terminal into a cbreak mode.rrN)rrrrrrrrrrrrrs
N)
�__doc__Ztermios�__all__rr
rrZISPEEDZOSPEEDrZ	TCSAFLUSHrrrrrr�<module>spipes.cpython-38.pyc000064400000017165151450073350010331 0ustar00U

e5d�"�@spdZddlZddlZddlZddlmZdgZdZdZdZ	dZ
d	Zd
Zeee	e
eegZ
Gdd�d�Zdd
�ZdS)a�Conversion pipeline templates.

The problem:
------------

Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format.  Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode).  Some of the conversion steps may require that their input
is a disk file, others may be able to read standard input; similar for
their output.  The input to the entire conversion may also be read
from a disk file or from an open file, and similar for its output.

The module lets you construct a pipeline template by sticking one or
more conversion steps together.  It will take care of creating and
removing temporary files if they are necessary to hold intermediate
data.  You can then use the template to do conversions from many
different sources to many different destinations.  The temporary
file names used are different each time the template is used.

The templates are objects so you can create templates for many
different conversion steps and store them in a dictionary, for
instance.


Directions:
-----------

To create a template:
    t = Template()

To add a conversion step to a template:
   t.append(command, kind)
where kind is a string of two characters: the first is '-' if the
command reads its standard input or 'f' if it requires a file; the
second likewise for the output. The command must be valid /bin/sh
syntax.  If input or output files are required, they are passed as
$IN and $OUT; otherwise, it must be  possible to use the command in
a pipeline.

To add a conversion step at the beginning:
   t.prepend(command, kind)

To convert a file to another file using a template:
  sts = t.copy(infile, outfile)
If infile or outfile are the empty string, standard input is read or
standard output is written, respectively.  The return value is the
exit status of the conversion pipeline.

To open a file for reading or writing through a conversion pipeline:
   fp = t.open(file, mode)
where mode is 'r' to read the file, or 'w' to write it -- just like
for the built-in function open() or for os.popen().

To create a new template object initialized to a given one:
   t2 = t.clone()
�N)�quote�TemplateZffz-fzf-�--z.-z-.c@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz'Class representing a pipeline template.cCsd|_|��dS)z-Template() returns a fresh pipeline template.rN)�	debugging�reset��self�r	�/usr/lib64/python3.8/pipes.py�__init__UszTemplate.__init__cCsd|jfS)z t.__repr__() implements repr(t).z<Template instance, steps=%r>��stepsrr	r	r
�__repr__ZszTemplate.__repr__cCs
g|_dS)z<t.reset() restores a pipeline template to its initial state.Nrrr	r	r
r^szTemplate.resetcCs"t�}|jdd�|_|j|_|S)zbt.clone() returns a new pipeline template with identical
        initial state as the current one.N)rr
r)r�tr	r	r
�clonebszTemplate.clonecCs
||_dS)z(t.debug(flag) turns debugging on or off.N)r)r�flagr	r	r
�debugjszTemplate.debugcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|dd	kr~t�d
|�s~td��|dd	kr�t�d|�s�td
��|j�	||f�dS)z/t.append(cmd, kind) adds a new step at the end.�z%Template.append: cmd must be a stringzTemplate.append: bad kind %rz-Template.append: SOURCE can only be prepended����z'Template.append: already ends with SINKr�f�\$IN\bz#Template.append: missing $IN in cmd�\$OUT\bz$Template.append: missing $OUT in cmdN)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append�r�cmd�kindr	r	r
r!nszTemplate.appendcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|ddkr~t�d	|�s~td
��|ddkr�t�d|�s�td��|j�	d||f�d
S)z2t.prepend(cmd, kind) adds a new step at the front.rz&Template.prepend: cmd must be a stringzTemplate.prepend: bad kind %rz+Template.prepend: SINK can only be appendedrrz,Template.prepend: already begins with SOURCErrz$Template.prepend: missing $IN in cmdrz%Template.prepend: missing $OUT in cmdN)
rrrrrr
rrr �insertr"r	r	r
�prepend~szTemplate.prependcCs6|dkr|�|�S|dkr$|�|�Std|f��dS)z~t.open(file, rw) returns a pipe or file object open for
        reading or writing; the file is the other end of the pipeline.�r�wz,Template.open: rw must be 'r' or 'w', not %rN)�open_r�open_wr)r�fileZrwr	r	r
�open�s

�z
Template.opencCsB|jst|d�S|jddtkr*td��|�|d�}t�|d�S)zit.open_r(file) and t.open_w(file) implement
        t.open(file, 'r') and t.open(file, 'w') respectively.r'rrz)Template.open_r: pipeline ends width SINKr)r
r,rr�makepipeline�os�popen�rr+r#r	r	r
r)�s
zTemplate.open_rcCsB|jst|d�S|jddtkr*td��|�d|�}t�|d�S)Nr(rrz,Template.open_w: pipeline begins with SOURCEr)r
r,rrr-r.r/r0r	r	r
r*�s
zTemplate.open_wcCst�|�||��S)N)r.�systemr-)r�infile�outfiler	r	r
�copy�sz
Template.copycCs(t||j|�}|jr$t|�d|}|S)Nzset -x; )r-r
r�print)rr2r3r#r	r	r
r-�s
zTemplate.makepipelineN)�__name__�
__module__�__qualname__�__doc__rrrrrr!r&r,r)r*r4r-r	r	r	r
rRs

cCs�g}|D]\}}|�d||dg�q|s:|�ddddg�|ddd�\}}|ddkrr|sr|�dddddg�||dd<|ddd�\}}|ddkr�|s�|�ddddg�||dd<g}tdt|��D]v}||dd	}||d	}	|ddk�s|	ddkr�t��\}
}t�|
�|�|�|||dd<||d<q�|D]�}|\}
}}}|ddk�r�d
t|�d|}|ddk�r�dt|
�d|}|dd
k�r�|
�r�|dt|
�}|dd
k�r�|�r�|dt|�}||d<�qN|dd}|dd�D]T}|dd�\}}|ddk�rTd|k�rFd|d}|d|}n|d|}�q|�r�d}|D]}|dt|�}�qrdt|d�d}|d|d|}|S)Nr�catrrr�rr�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15)	r!r%�range�len�tempfileZmkstempr.�closer)r2r
r3�listr#r$Zgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr+Ztrapcmdr	r	r
r-�s`


r-)r9rr.rBZshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr-r	r	r	r
�<module>s";�cargparse.cpython-38.pyc000064400000171507151450073350011016 0ustar00U

e5dw�@s0dZdZdddddddd	d
ddd
dddddgZddlZddlZddlZddl	Z
ddlmZm
Z
dZdZdZdZdZdZdZGdd�de�Zdd �ZGd!d�de�ZGd"d�de�ZGd#d	�d	e�ZGd$d�de�ZGd%d
�d
e�Zd&d'�ZGd(d�de�ZGd)d�de�Z Gd*d�de�Z!Gd+d,�d,e!�Z"Gd-d.�d.e!�Z#Gd/d0�d0e#�Z$Gd1d2�d2e#�Z%Gd3d4�d4e!�Z&Gd5d6�d6e!�Z'Gd7d8�d8e!�Z(Gd9d:�d:e!�Z)Gd;d<�d<e!�Z*Gd=d>�d>e!�Z+Gd?d@�d@e&�Z,GdAd�de�Z-GdBd�de�Z.GdCdD�dDe�Z/GdEdF�dFe/�Z0GdGdH�dHe0�Z1GdId�dee/�Z2dS)Ja�
Command-line parsing library

This module is an optparse-inspired command-line parsing library that:

    - handles both optional and positional arguments
    - produces highly informative usage messages
    - supports parsers that dispatch to sub-parsers

The following is a simple usage example that sums integers from the
command-line and writes the result to a file::

    parser = argparse.ArgumentParser(
        description='sum the integers at the command line')
    parser.add_argument(
        'integers', metavar='int', nargs='+', type=int,
        help='an integer to be summed')
    parser.add_argument(
        '--log', default=sys.stdout, type=argparse.FileType('w'),
        help='the file where the sum should be written')
    args = parser.parse_args()
    args.log.write('%s' % sum(args.integers))
    args.log.close()

The module contains the following public classes:

    - ArgumentParser -- The main entry point for command-line parsing. As the
        example above shows, the add_argument() method is used to populate
        the parser with actions for optional and positional arguments. Then
        the parse_args() method is invoked to convert the args at the
        command-line into an object with attributes.

    - ArgumentError -- The exception raised by ArgumentParser objects when
        there are errors with the parser's actions. Errors raised while
        parsing the command-line are caught by ArgumentParser and emitted
        as command-line messages.

    - FileType -- A factory for defining types of files to be created. As the
        example above shows, instances of FileType are typically passed as
        the type= argument of add_argument() calls.

    - Action -- The base class for parser actions. Typically actions are
        selected by passing strings like 'store_true' or 'append_const' to
        the action= argument of add_argument(). However, for greater
        customization of ArgumentParser actions, subclasses of Action may
        be defined and passed as the action= argument.

    - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
        ArgumentDefaultsHelpFormatter -- Formatter classes which
        may be passed as the formatter_class= argument to the
        ArgumentParser constructor. HelpFormatter is the default,
        RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
        not to change the formatting for help text, and
        ArgumentDefaultsHelpFormatter adds information about argument defaults
        to the help.

All other classes in this module are considered implementation details.
(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
considered public as object names -- the API of the formatter objects is
still considered an implementation detail.)
z1.1�ArgumentParser�
ArgumentError�ArgumentTypeError�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...Z_unrecognized_argsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_AttributeHolderaAbstract base class that provides __repr__.

    The __repr__ method returns a string in the format::
        ClassName(attr=name, attr=name, ...)
    The attributes are determined either by a class-level attribute,
    '_kwarg_names', or by inspecting the instance __dict__.
    cCs�t|�j}g}i}|��D]}|�t|��q|��D],\}}|��rZ|�d||f�q6|||<q6|rz|�dt|��d|d�|�fS)N�%s=%rz**%s�%s(%s)�, )�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�selfZ	type_name�arg_stringsZ	star_args�arg�name�value�r*� /usr/lib64/python3.8/argparse.py�__repr__ts

z_AttributeHolder.__repr__cCst|j���S�N)�sorted�__dict__�items�r%r*r*r+r"�sz_AttributeHolder._get_kwargscCsgSr-r*r1r*r*r+r�sz_AttributeHolder._get_argsN)r�
__module__�__qualname__�__doc__r,r"rr*r*r*r+rksrcCs6|dkrgSt|�tkr$|dd�Sddl}|�|�S)Nr)r�list�copy)r0r6r*r*r+�_copy_items�sr7c@s�eZdZdZd;dd�Zdd�Zd	d
�ZGdd�de�Zd
d�Z	dd�Z
dd�Zdd�Zd<dd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)=rz�Formatter for generating usage messages and argument help strings.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    ��NcCs�|dkrt��j}|d8}||_||_t|t|d|d��|_||_d|_	d|_
d|_|�|d�|_
|j
|_t�dtj�|_t�d�|_dS)Nr8�rz\s+z\n\n\n+)�_shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r%�progZindent_incrementZmax_help_position�widthr*r*r+�__init__�s 
�zHelpFormatter.__init__cCs"|j|j7_|jd7_dS�N�)rDr?rEr1r*r*r+�_indent�szHelpFormatter._indentcCs4|j|j8_|jdks"td��|jd8_dS)NrzIndent decreased below 0.rS)rDr?�AssertionErrorrEr1r*r*r+�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dSr-)�	formatter�parent�headingr0)r%rWrXrYr*r*r+rQ�szHelpFormatter._Section.__init__cCs�|jdk	r|j��|jj}|dd�|jD��}|jdk	rD|j��|sLdS|jtk	rz|jdk	rz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr*r*)�.0�func�argsr*r*r+�
<listcomp>�sz6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s:
�
)	rXrWrT�_join_partsr0rVrYrrD)r%r$Z	item_helpZcurrent_indentrYr*r*r+�format_help�s



z"HelpFormatter._Section.format_help)N)rr2r3rQrar*r*r*r+rG�s
rGcCs|jj�||f�dSr-)rIr0r )r%r[r\r*r*r+�	_add_item�szHelpFormatter._add_itemcCs0|��|�||j|�}|�|jg�||_dSr-)rTrGrIrbra)r%rYZsectionr*r*r+�
start_section�szHelpFormatter.start_sectioncCs|jj|_|��dSr-)rIrXrVr1r*r*r+�end_section�s
zHelpFormatter.end_sectioncCs$|tk	r |dk	r |�|j|g�dSr-)rrb�_format_text)r%�textr*r*r+�add_text�szHelpFormatter.add_textcCs&|tk	r"||||f}|�|j|�dSr-)rrb�
_format_usage)r%�usage�actions�groups�prefixr\r*r*r+�	add_usage�szHelpFormatter.add_usagecCsv|jtk	rr|j}||�g}|�|�D]}|�||��q$tdd�|D��}||j}t|j|�|_|�|j	|g�dS)NcSsg|]}t|��qSr*��len�rZ�sr*r*r+r]
sz.HelpFormatter.add_argument.<locals>.<listcomp>)
�helpr�_format_action_invocation�_iter_indented_subactionsr rArDrFrb�_format_action)r%�actionZget_invocationZinvocations�	subactionZinvocation_lengthZ
action_lengthr*r*r+�add_arguments


�zHelpFormatter.add_argumentcCs|D]}|�|�qdSr-)rx)r%rjrvr*r*r+�
add_argumentsszHelpFormatter.add_argumentscCs.|j��}|r*|j�d|�}|�d�d}|S)N�

r_)rHrarN�sub�strip)r%rrr*r*r+ras

zHelpFormatter.format_helpcCsd�dd�|D��S)Nr^cSsg|]}|r|tk	r|�qSr*)r)rZ�partr*r*r+r]!s�z-HelpFormatter._join_parts.<locals>.<listcomp>)r$)r%Zpart_stringsr*r*r+r` s
�zHelpFormatter._join_partscs6|dkrtd�}|dk	r,|t|jd�}�n�|dkrL|sLdt|jd�}�n�|dk�r*dt|jd�}g}g}|D] }|jr�|�|�qr|�|�qr|j}	|	|||�}
d�dd�||
fD��}|j|j�t	|�t	|��k�r*d}|	||�}|	||�}
t
�||�}t
�||
�}d�|�|k�s&t�d�|�|
k�s:t�d�fdd	�	}t	|�t	|�d
�k�r�dt	|�t	|�d}|�r�||g|||�}|�
|||��n |�r�||g|||�}n|g}nZdt	|�}||}|||�}t	|�dk�rg}|�
|||��|�
|||��|g|}d�|�}d
||fS)Nzusage: �rOz%(prog)s� cSsg|]}|r|�qSr*r*rpr*r*r+r]Asz/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|dk	rt|�d}nt|�d}|D]Z}|dt|��krn|rn|�|d�|��g}t|�d}|�|�|t|�d7}q.|r�|�|d�|��|dk	r�|dt|�d�|d<|S)NrSrr)ror r$)�parts�indentrl�lines�lineZline_lenr}��
text_widthr*r+�	get_linesUs"
z.HelpFormatter._format_usage.<locals>.get_linesg�?rSr_z%s%s

)N)�_�dictr>�option_stringsr �_format_actions_usager$rCrDrorJ�findallrU�extend)r%rirjrkrlrO�	optionals�positionalsrv�formatZaction_usageZpart_regexpZ	opt_usageZ	pos_usageZ	opt_partsZ	pos_partsr�r�r�r�r*r�r+rh%s\
�




zHelpFormatter._format_usagec	Cs�t�}i}|D�]}z|�|jd�}Wntk
r@YqYqX|t|j�}|||�|jkr|jD]}|�|�qh|js�||kr�||d7<nd||<||kr�||d7<nd||<nF||kr�||d7<nd||<||k�r||d7<nd||<t|d|�D]}	d	||	<�qqg}
t|�D�]"\}	}|j	t
k�r�|
�d�|�|	�d	k�rr|�
|	�n"|�|	d�d	k�rX|�
|	d�n�|j�s�|�|�}|�||�}||k�r�|ddk�r�|d
dk�r�|dd
�}|
�|�nf|jd}
|jdk�rd|
}n"|�|�}|�||�}d|
|f}|j�sN||k�rNd
|}|
�|��q6t|dd�D]}	||	g|
|	|	�<�qhd�dd�|
D��}d}d}t�d|d|�}t�d|d|�}t�d||fd|�}t�dd|�}|��}|S)Nrz [�[�]z (�(�)rS�|����%s�%s %s�[%s]T)�reversercSsg|]}|dk	r|�qSr-r*)rZ�itemr*r*r+r]�sz7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1� (%s)z%s *%sr^z\(([^|]*)\))�set�index�_group_actions�
ValueErrorro�add�required�range�	enumeraterrrr �get�popr��#_get_default_metavar_for_positional�_format_args�nargs�!_get_default_metavar_for_optionalr.r$rJr{r|)r%rjrk�
group_actionsZinserts�group�start�endrv�ir��defaultr}�
option_string�args_stringrf�open�closer*r*r+r��sz










z#HelpFormatter._format_actions_usagecCsFd|kr|t|jd�}t|j|jd�}d|j}|�|||�dS)Nz%(prog)r~�rrz)r�r>rArCrD�
_fill_text)r%rfr�r�r*r*r+re�s

zHelpFormatter._format_textc
Cs:t|jd|j�}t|j|d�}||jd}|�|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|jr�|�	|�}	|�
|	|�}
|�d|d|
df�|
dd�D]}|�d|d|f�q�n|�d��s|�d�|�
|�D]}|�|�|���q|�|�S)	Nr8r�r^z%*s%s
z	%*s%-*s  rrSr_)r@rFrBrArCrDrsrrro�_expand_help�_split_linesr �endswithrtrur`)
r%rvZ
help_positionZ
help_widthZaction_widthZ
action_header�tupZindent_firstr�Z	help_textZ
help_linesr�rwr*r*r+ru�s8
�



zHelpFormatter._format_actioncCs�|js&|�|�}|�||�d�\}|Sg}|jdkrB|�|j�n4|�|�}|�||�}|jD]}|�d||f�q^d�|�SdS)NrSrr�r)	r�r��_metavar_formatterr�r�r�r�r r$)r%rvr��metavarr�r�r�r*r*r+rs"s



z'HelpFormatter._format_action_invocationcsP|jdk	r|j�n.|jdk	r<dd�|jD�}dd�|��n|��fdd�}|S)NcSsg|]}t|��qSr*��str)rZZchoicer*r*r+r]>sz4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdSr-)�
isinstance�tuple)Z
tuple_size��resultr*r+r�Cs
z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr$)r%rv�default_metavarZchoice_strsr�r*r�r+r�:s

z HelpFormatter._metavar_formattercCs�|�||�}|jdkr$d|d�}n�|jtkr<d|d�}n�|jtkrTd|d�}n�|jtkrld|d�}n�|jtkr|d}nt|jtkr�d|d�}n\|jtkr�d	}nLzd
d�t|j�D�}Wnt	k
r�t
d�d�YnXd
�|�||j�}|S)Nr�rSr�z
[%s [%s ...]]r8z%s [%s ...]rz%s ...r^cSsg|]}d�qS)r�r*)rZr�r*r*r+r]\sz.HelpFormatter._format_args.<locals>.<listcomp>zinvalid nargs valuer)r�r�r
rrrrrr��	TypeErrorr�r$)r%rvr�Zget_metavarr�Zformatsr*r*r+r�Js*






zHelpFormatter._format_argscCs�tt|�|jd�}t|�D]}||tkr||=qt|�D] }t||d�r:||j||<q:|�d�dk	r�d�dd�|dD��}||d<|�	|�|S)Nr~rr�rcSsg|]}t|��qSr*r�)rZ�cr*r*r+r]ksz.HelpFormatter._expand_help.<locals>.<listcomp>)
r��varsr>r5r�hasattrrr�r$�_get_help_string)r%rvZparamsr(Zchoices_strr*r*r+r�bszHelpFormatter._expand_helpccs@z
|j}Wntk
rYnX|��|�EdH|��dSr-)�_get_subactions�AttributeErrorrTrV)r%rvZget_subactionsr*r*r+rtos
z'HelpFormatter._iter_indented_subactionscCs&|j�d|���}ddl}|�||�S)Nrr)rMr{r|�textwrapZwrap)r%rfrPr�r*r*r+r�yszHelpFormatter._split_linescCs,|j�d|���}ddl}|j||||d�S)Nrr)Zinitial_indentZsubsequent_indent)rMr{r|r�Zfill)r%rfrPr�r�r*r*r+r��s�zHelpFormatter._fill_textcCs|jSr-)rr�r%rvr*r*r+r��szHelpFormatter._get_help_stringcCs
|j��Sr-)�dest�upperr�r*r*r+r��sz/HelpFormatter._get_default_metavar_for_optionalcCs|jSr-)r�r�r*r*r+r��sz1HelpFormatter._get_default_metavar_for_positional)r8r9N)N) rr2r3r4rQrTrV�objectrGrbrcrdrgrmrxryrar`rhr�rerursr�r�r�rtr�r�r�r�r�r*r*r*r+r�s>�

`g/

c@seZdZdZdd�ZdS)rz�Help message formatter which retains any formatting in descriptions.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cs d��fdd�|jdd�D��S)Nr^c3s|]}�|VqdSr-r*)rZr��r�r*r+�	<genexpr>�sz9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r$�
splitlines)r%rfrPr�r*r�r+r��sz&RawDescriptionHelpFormatter._fill_textN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which retains formatting of all help text.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|��Sr-)r�)r%rfrPr*r*r+r��sz!RawTextHelpFormatter._split_linesN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which adds default values to argument help.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs>|j}d|jkr:|jtk	r:ttg}|js2|j|kr:|d7}|S)Nz
%(default)z (default: %(default)s))rrr�rr
rr�r�)r%rvrrZdefaulting_nargsr*r*r+r��s

z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr2r3r4r�r*r*r*r+r�sc@s eZdZdZdd�Zdd�ZdS)r	aHelp message formatter which uses the argument 'type' as the default
    metavar value (instead of the argument 'dest')

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|jjSr-�rrr�r*r*r+r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjSr-r�r�r*r*r+r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr2r3r4r�r�r*r*r*r+r	�scCsN|dkrdS|jrd�|j�S|jdtfkr2|jS|jdtfkrF|jSdSdS)N�/)r�r$r�rr�)�argumentr*r*r+�_get_action_name�sr�c@s eZdZdZdd�Zdd�ZdS)rz�An error from creating or using an argument (optional or positional).

    The string value of this exception is the message, augmented with
    information about the argument that caused it.
    cCst|�|_||_dSr-)r��
argument_name�message)r%r�r�r*r*r+rQ�s
zArgumentError.__init__cCs(|jdkrd}nd}|t|j|jd�S)Nz%(message)sz'argument %(argument_name)s: %(message)s)r�r�)r�r�r�)r%r�r*r*r+�__str__�s
�zArgumentError.__str__N)rr2r3r4rQr�r*r*r*r+r�sc@seZdZdZdS)rz@An error from trying to convert a command line string to a type.N)rr2r3r4r*r*r*r+r�sc@s,eZdZdZd
dd�Zdd�Zddd	�ZdS)ra\	Information about how to convert command line strings to Python objects.

    Action objects are used by an ArgumentParser to represent the information
    needed to parse a single argument from one or more strings from the
    command line. The keyword arguments to the Action constructor are also
    all attributes of Action instances.

    Keyword Arguments:

        - option_strings -- A list of command-line option strings which
            should be associated with this action.

        - dest -- The name of the attribute to hold the created object(s)

        - nargs -- The number of command-line arguments that should be
            consumed. By default, one argument will be consumed and a single
            value will be produced.  Other values include:
                - N (an integer) consumes N arguments (and produces a list)
                - '?' consumes zero or one arguments
                - '*' consumes zero or more arguments (and produces a list)
                - '+' consumes one or more arguments (and produces a list)
            Note that the difference between the default and nargs=1 is that
            with the default, a single value will be produced, while with
            nargs=1, a list containing a single value will be produced.

        - const -- The value to be produced if the option is specified and the
            option uses an action that takes no values.

        - default -- The value to be produced if the option is not specified.

        - type -- A callable that accepts a single string argument, and
            returns the converted value.  The standard Python types str, int,
            float, and complex are useful examples of such callables.  If None,
            str is used.

        - choices -- A container of values that should be allowed. If not None,
            after a command-line argument has been converted to the appropriate
            type, an exception will be raised if it is not a member of this
            collection.

        - required -- True if the action must always be specified at the
            command line. This is only meaningful for optional command-line
            arguments.

        - help -- The help string describing the argument.

        - metavar -- The name to be used for the option's argument with the
            help string. If None, the 'dest' value will be used as the name.
    NFcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr-�
r�r�r��constr�rr�r�rrr��r%r�r�r�r�r�rr�r�rrr�r*r*r+rQ)szAction.__init__c	s(ddddddddd	g	}�fd
d�|D�S)Nr�r�r�r�r�rr�rrr�csg|]}|t�|�f�qSr*��getattr�rZr(r1r*r+r]Ksz&Action._get_kwargs.<locals>.<listcomp>r*�r%�namesr*r1r+r"?s�zAction._get_kwargscCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr��r%�parser�	namespace�valuesr�r*r*r+�__call__MszAction.__call__)NNNNNFNN)N)rr2r3r4rQr"r�r*r*r*r+r�s5�
cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr�)r�r
�superr�rQr���	__class__r*r+rQSs 
�z_StoreAction.__init__cCst||j|�dSr-)�setattrr�r�r*r*r+r�psz_StoreAction.__call__)NNNNNFNN)N�rr2r3rQr��
__classcell__r*r*r�r+r�Qs�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreConstActionNFc	s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�r�rrr�r�r*r+rQvs
�z_StoreConstAction.__init__cCst||j|j�dSr-)r�r�r�r�r*r*r+r��sz_StoreConstAction.__call__)NFNN)Nr�r*r*r�r+r�ts�r�cseZdZd�fdd�	Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�rrr�r*r+rQ�s
�z_StoreTrueAction.__init__)FFN�rr2r3rQr�r*r*r�r+r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NFr�)r�r�rQr�r�r*r+rQ�s
�z_StoreFalseAction.__init__)TFNr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�
_AppendActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriater�r�)r�r
r�r�rQr�r�r*r+rQ�s 
�z_AppendAction.__init__cCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r r��r%r�r�r�r�r0r*r*r+r��s
z_AppendAction.__call__)NNNNNFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_AppendConstActionNFc
s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�rrr�)r�r�rQr�r�r*r+rQ�s
�z_AppendConstAction.__init__cCs4t||jd�}t|�}|�|j�t||j|�dSr-)r�r�r7r r�r�r�r*r*r+r��sz_AppendConstAction.__call__)NFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�rr)r�r�rQr�r�r*r+rQ�s
�z_CountAction.__init__cCs0t||jd�}|dkrd}t||j|d�dS�NrrS)r�r�r�)r%r�r�r�r��countr*r*r+r��sz_CountAction.__call__)NFN)Nr�r*r*r�r+r��s
�r�cs.eZdZeedf�fdd�	Zddd�Z�ZS)�_HelpActionNcstt|�j|||d|d�dS�Nr)r�r�r�r�rr)r�r�rQ)r%r�r�r�rrr�r*r+rQs
�z_HelpAction.__init__cCs|��|��dSr-)�
print_help�exitr�r*r*r+r�sz_HelpAction.__call__)N�rr2r3rrQr�r�r*r*r�r+r�s
�r�cs0eZdZdeedf�fdd�	Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dSr)r�rrQ�version)r%r�rr�r�rrr�r*r+rQs
�z_VersionAction.__init__cCsD|j}|dkr|j}|��}|�|�|�|��tj�|��dSr-)r�_get_formatterrg�_print_messagera�_sys�stdoutr)r%r�r�r�r�rrWr*r*r+r�(s
z_VersionAction.__call__)Nrr*r*r�r+rs�rcsPeZdZGdd�de�Zedddf�fdd�	Zdd�Zd	d
�Zd
dd�Z	�Z
S)�_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|dd�|�7}ttj|�}|jg|||d�dS)Nr�r)r�r�rrr�)r$r�r
�_ChoicesPseudoActionrQ)r%r(�aliasesrrr�r�Zsupr�r*r+rQ6s
�z/_SubParsersAction._ChoicesPseudoAction.__init__r�r*r*r�r+r4srFNc	s<||_||_i|_g|_tt|�j||t|j|||d�dS)N)r�r�r�r�r�rrr�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr�r
rQr)r%r�rO�parser_classr�r�rrr�r�r*r+rQ>s	
�z_SubParsersAction.__init__cKs�|�d�dkr d|j|f|d<|�dd�}d|krX|�d�}|�|||�}|j�|�|jf|�}||j|<|D]}||j|<qr|S)NrOr�rr*rr)r�r
r�rrr rr)r%r(�kwargsrrrZ
choice_actionr��aliasr*r*r+�
add_parserUs

z_SubParsersAction.add_parsercCs|jSr-)rr1r*r*r+r�lsz!_SubParsersAction._get_subactionscCs�|d}|dd�}|jtk	r,t||j|�z|j|}Wn<tk
rv|d�|j�d�}td�|}t||��YnX|�|d�\}	}t	|	��
�D]\}
}t||
|�q�|r�t	|��tg�t
|t��|�dS)NrrSr)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr�r�KeyErrorr$r�r�parse_known_argsr�r0�
setdefault�_UNRECOGNIZED_ARGS_ATTRr�r�)r%r�r�r�r�rr&r\�msgZsubnamespace�keyr)r*r*r+r�os$

�	z_SubParsersAction.__call__)N)rr2r3rrrrQrr�r�r�r*r*r�r+r
2s�r
c@seZdZddd�ZdS)�
_ExtendActionNcCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r�r�r�r*r*r+r��s
z_ExtendAction.__call__)N)rr2r3r�r*r*r*r+r�src@s*eZdZdZddd�Zdd�Zd	d
�ZdS)ra�Factory for creating file object types

    Instances of FileType are typically passed as type= arguments to the
    ArgumentParser add_argument() method.

    Keyword Arguments:
        - mode -- A string indicating how the file is to be opened. Accepts the
            same values as the builtin open() function.
        - bufsize -- The file's desired buffer size. Accepts the same values as
            the builtin open() function.
        - encoding -- The file's encoding. Accepts the same values as the
            builtin open() function.
        - errors -- A string indicating how encoding and decoding errors are to
            be handled. Accepts the same value as the builtin open() function.
    �rr�NcCs||_||_||_||_dSr-)�_mode�_bufsize�	_encoding�_errors)r%�mode�bufsize�encoding�errorsr*r*r+rQ�szFileType.__init__c
Cs�|dkr>d|jkrtjSd|jkr(tjStd�|j}t|��zt||j|j|j|j	�WSt
k
r�}z"||d�}td�}t||��W5d}~XYnXdS)N�-r�wzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)rr�stdinr	r�r�r�rr r!�OSErrorr)r%�stringr�er\r�r*r*r+r��s

�
zFileType.__call__cCsT|j|jf}d|jfd|jfg}d�dd�|D�dd�|D��}dt|�j|fS)Nr$r%rcSsg|]}|dkrt|��qS)r�)r!)rZr'r*r*r+r]�sz%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|dk	rd||f�qS)Nrr*)rZ�kwr'r*r*r+r]�s�r)rrr r!r$rr)r%r\rZargs_strr*r*r+r,�s�zFileType.__repr__)rr�NN)rr2r3r4rQr�r,r*r*r*r+r�s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r
z�Simple object for storing attributes.

    Implements equality by attribute names and values, and provides a simple
    string representation.
    cKs|D]}t||||�qdSr-)r�)r%rr(r*r*r+rQ�szNamespace.__init__cCst|t�stSt|�t|�kSr-)r�r
�NotImplementedr�)r%�otherr*r*r+�__eq__�s
zNamespace.__eq__cCs
||jkSr-)r/)r%rr*r*r+�__contains__�szNamespace.__contains__N)rr2r3r4rQr1r2r*r*r*r+r
�scs�eZdZ�fdd�Zdd�Zd&dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|���||_||_||_||_i|_|�ddt	�|�ddt	�|�ddt
�|�ddt�|�ddt�|�ddt
�|�ddt�|�ddt�|�dd	t�|�dd
t�|�ddt�|�ddt�|��g|_i|_g|_g|_i|_t�d
�|_g|_dS)NrvZstoreZstore_const�
store_trueZstore_falser Zappend_constr�rrr�parsersr�z^-\d+$|^-\d*\.\d+$)r�r3rQ�description�argument_default�prefix_chars�conflict_handler�_registries�registerr�r�r�r�r�r�r�r�rr
r�_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrJrK�_negative_number_matcher�_has_negative_number_optionals)r%r6r8r7r9r�r*r+rQ�s4z_ActionsContainer.__init__cCs|j�|i�}|||<dSr-)r:r)r%�
registry_namer)r��registryr*r*r+r;sz_ActionsContainer.registerNcCs|j|�||�Sr-)r:r�)r%rDr)r�r*r*r+�
_registry_get sz_ActionsContainer._registry_getcKs2|j�|�|jD]}|j|kr||j|_qdSr-)rA�updater=r�r�)r%rrvr*r*r+�set_defaults&s

z_ActionsContainer.set_defaultscCs8|jD]"}|j|kr|jdk	r|jSq|j�|d�Sr-)r=r�r�rAr�)r%r�rvr*r*r+�get_default/s
z_ActionsContainer.get_defaultcOsD|j}|r&t|�dkrH|dd|krH|r:d|kr:td��|j||�}n|j||�}d|kr�|d}||jkr~|j||d<n|jdk	r�|j|d<|�|�}t|�s�td|f��|f|�}|�	d|j
|j
�}t|�s�td	|f��|tkr�td
|f��t|d��r:z|�
��|d�Wntk
�r8td��YnX|�|�S)
z�
        add_argument(dest, ..., name=value, ...)
        add_argument(option_string, option_string, ..., name=value, ...)
        rSrr�z+dest supplied twice for positional argumentr�Nzunknown action "%s"r�%r is not callablez<%r is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargs)r8ror��_get_positional_kwargs�_get_optional_kwargsrAr7�_pop_action_class�callablerFrrr�rr�r��_add_action)r%r\r�charsr�Zaction_classrv�	type_funcr*r*r+rx9s:	 




�z_ActionsContainer.add_argumentcOs t|f|�|�}|j�|�|Sr-)�_ArgumentGroupr?r )r%r\rr�r*r*r+�add_argument_grouplsz$_ActionsContainer.add_argument_groupcKst|f|�}|j�|�|Sr-)�_MutuallyExclusiveGroupr@r )r%rr�r*r*r+�add_mutually_exclusive_groupqsz._ActionsContainer.add_mutually_exclusive_groupcCs`|�|�|j�|�||_|jD]}||j|<q"|jD]"}|j�|�r8|js8|j�d�q8|S)NT)	�_check_conflictr=r �	containerr�r>rB�matchrC)r%rvr�r*r*r+rOvs


z_ActionsContainer._add_actioncCs|j�|�dSr-)r=�remover�r*r*r+�_remove_action�sz _ActionsContainer._remove_actioncCs�i}|jD].}|j|kr.td�}t||j��|||j<q
i}|jD]D}|j|krn|j|j|j|jd�||j<|jD]}||j||<qtqD|jD]&}|j	|j
d�}|jD]}|||<q�q�|jD]}|�||��
|�q�dS)Nz.cannot merge actions - two groups are named %r)�titler6r9)r�)r?r[r�r�rSr6r9r�r@rUr�r=r�rO)r%rWZtitle_group_mapr�rZ	group_maprv�mutex_groupr*r*r+�_add_container_actions�s0



�

�

z(_ActionsContainer._add_container_actionscKs^d|krtd�}t|��|�d�ttfkr2d|d<|�d�tkrPd|krPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r�r�)r�r�r�r
rr�)r%r�rrr*r*r+rK�sz(_ActionsContainer._get_positional_kwargsc	Os�g}g}|D]n}|d|jkr>||jd�}td�}t||��|�|�|d|jkrt|�dkr|d|jkr|�|�q|�dd�}|dkr�|r�|d}n|d}|�|j�}|s�td�}t||��|�dd�}t|||d	�S)
Nr)�optionr8zNinvalid option string %(option)r: must start with a character %(prefix_chars)rrSr�z%dest= is required for options like %rr&r�r^)	r8r�r�r ror��lstrip�replacer�)	r%r\rr�Zlong_option_stringsr�rr�Zdest_option_stringr*r*r+rL�s2�

z&_ActionsContainer._get_optional_kwargscCs|�d|�}|�d||�S)Nrv)r�rF)r%rr�rvr*r*r+rM�sz#_ActionsContainer._pop_action_classcCsFd|j}zt||�WStk
r@td�}t||j��YnXdS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r9r�r�r�r�)r%Zhandler_func_namerr*r*r+r<�s
z_ActionsContainer._get_handlercCsLg}|jD]&}||jkr
|j|}|�||f�q
|rH|��}|||�dSr-)r�r>r r<)r%rvZconfl_optionalsr�Zconfl_optionalr9r*r*r+rV�s


z!_ActionsContainer._check_conflictcCs6tddt|��}d�dd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %srcSsg|]\}}|�qSr*r*)rZr�rvr*r*r+r]	s�z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rror$r)r%rv�conflicting_actionsr�Zconflict_stringr*r*r+�_handle_conflict_errors�
�z(_ActionsContainer._handle_conflict_errorcCs>|D]4\}}|j�|�|j�|d�|js|j�|�qdSr-)r�rYr>r�rWrZ)r%rvrbr�r*r*r+�_handle_conflict_resolves
z*_ActionsContainer._handle_conflict_resolve)N)N)rr2r3rQr;rFrHrIrxrSrUrOrZr]rKrLrMr<rVrcrdr�r*r*r�r+r3�s$5
	
3($
		r3cs6eZdZd�fdd�	Z�fdd�Z�fdd�Z�ZS)	rRNcs�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)Nr9r8r7r6)rr9r8r7r�rRrQr[r�r:r=r>rArCr@)r%rWr[r6rrGZ
super_initr�r*r+rQs�z_ArgumentGroup.__init__cs tt|��|�}|j�|�|Sr-)r�rRrOr�r r�r�r*r+rO5sz_ArgumentGroup._add_actioncs tt|��|�|j�|�dSr-)r�rRrZr�rYr�r�r*r+rZ:sz_ArgumentGroup._remove_action)NN�rr2r3rQrOrZr�r*r*r�r+rRsrRcs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	rTFcs tt|��|�||_||_dSr-)r�rTrQr��
_container)r%rWr�r�r*r+rQAsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|j�|�}|j�|�|S)Nz-mutually exclusive arguments must be optional)r�r�r�rfrOr�r )r%rvrr*r*r+rOFsz#_MutuallyExclusiveGroup._add_actioncCs|j�|�|j�|�dSr-)rfrZr�rYr�r*r*r+rZNsz&_MutuallyExclusiveGroup._remove_action)Frer*r*r�r+rT?srTcs*eZdZdZddddgeddddddf�fdd�	Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dAdd�ZdBdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdCd&d'�ZdDd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEd6d7�ZdFd8d9�ZdGd:d;�ZdHd=d>�Z d?d@�Z!�Z"S)Ira�Object for parsing command line strings into Python objects.

    Keyword Arguments:
        - prog -- The name of the program (default: sys.argv[0])
        - usage -- A usage message (default: auto-generated from arguments)
        - description -- A description of what the program does
        - epilog -- Text following the argument descriptions
        - parents -- Parsers whose arguments should be copied into this one
        - formatter_class -- HelpFormatter class for printing help messages
        - prefix_chars -- Characters that prefix optional arguments
        - fromfile_prefix_chars -- Characters that prefix files containing
            additional arguments
        - argument_default -- The default value for all arguments
        - conflict_handler -- String indicating how to handle conflicts
        - add_help -- Add a -h/-help option
        - allow_abbrev -- Allow long options to be abbreviated unambiguously
    Nr&r)Tc
	s"tt|�j}
|
|||	|
d�|dkr6tj�tjd�}||_||_	||_
||_||_||_
||_|j}|td��|_|td��|_d|_dd�}|�dd|�d|kr�dn|d}|j
r�|j|d	|d
ddttd�d
�|D]<}|�|�z
|j}Wntk
�rYq�X|j�|�q�dS)N)r6r8r7r9rzpositional argumentszoptional argumentscSs|Sr-r*)r,r*r*r+�identity�sz)ArgumentParser.__init__.<locals>.identityrr&�hr8rrzshow this help message and exit)rvr�rr)r�rrQ�_os�path�basenamer�argvrOri�epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrevrSr��_positionals�
_optionals�_subparsersr;rxrr]rAr�rG)r%rOrir6rm�parentsrnr8ror7r9rprqZ	superinitZ	add_grouprgZdefault_prefixrX�defaultsr�r*r+rQfsJ�
�

zArgumentParser.__init__cs"ddddddg}�fdd�|D�S)	NrOrir6rnr9rpcsg|]}|t�|�f�qSr*r�r�r1r*r+r]�sz.ArgumentParser._get_kwargs.<locals>.<listcomp>r*r�r*r1r+r"�s�zArgumentParser._get_kwargsc	Ks�|jdk	r|�td��|�dt|��d|ks8d|krht|�dd��}t|�dd��}|�||�|_n|j|_|�d�dkr�|�	�}|�
�}|j}|�|j
||d�|����|d<|�|d�}|fd	gi|��}|j�|�|S)
Nz(cannot have multiple subparser argumentsrr[r6ZsubcommandsrOr^r5r�)rtr)r�rrr�rSrrr�r�_get_positional_actionsr@rmrirar|rMrO)	r%rr[r6rWr�rkZ
parsers_classrvr*r*r+�add_subparsers�s$
zArgumentParser.add_subparserscCs$|jr|j�|�n|j�|�|Sr-)r�rsrOrrr�r*r*r+rO�szArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr*�r��rZrvr*r*r+r]�s�z8ArgumentParser._get_optional_actions.<locals>.<listcomp>�r=r1r*r*r+�_get_optional_actions�s�z$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr*ryrzr*r*r+r]�s�z:ArgumentParser._get_positional_actions.<locals>.<listcomp>r{r1r*r*r+rw�s�z&ArgumentParser._get_positional_actionscCs4|�||�\}}|r0td�}|�|d�|��|S�Nzunrecognized arguments: %sr)rr�r)r$�r%r\r�rlrr*r*r+�
parse_args�s
zArgumentParser.parse_argscCs|dkrtjdd�}nt|�}|dkr.t�}|jD]4}|jtk	r4t||j�s4|jtk	r4t	||j|j�q4|j
D] }t||�spt	|||j
|�qpz>|�||�\}}t|t�r�|�
t|t��t|t�||fWStk
�rt��d}|�t|��YnXdSrR)rrlr5r
r=r�rr�r�r�rA�_parse_known_argsrr�r��delattrr�exc_infor)r�)r%r\r�rvr��errr*r*r+r�s,







zArgumentParser.parse_known_argscs�	jdk	r�	����i��	jD]R}|j}t|j�D]<\}}��|g�}|�|d|��|�||dd��q2qi�g}t��}	t|	�D]^\}}
|
dkr�|�d�|	D]}
|�d�q�q��	�	|
�}|dkr�d}n|�|<d}|�|�q�d�
|��t��t��d�����	fdd�	������	�fd	d
�}
�	�������	�fdd�}g�d
�
��r`t
��}nd}�
|k�r�t�
fdd��D��}�
|k�r�|�
�}|�
k�r�|�
�qdn|�
�
�k�r҈�
|�}��|�|�
|
�
��
�qd|�
�}���|d��g}�	jD]|}|�k�r|j�r(|�t|��nT|jdk	�rt|jt��rt�|j��r|jt�|j�k�rt�|j�	�||j���q|�r��	�td�d�
|���	jD]X}|j�r�|jD]}|�k�r��q��q�dd�|jD�}td�}�	�|d�
|���q���fS)NrS�--r&�A�Or^cs|��|���||�}||jk	rb��|���|g�D]*}|�kr6td�}t|�}t|||��q6|tk	rx|��||�dS)Nznot allowed with argument %s)r��_get_valuesr�r�r�r�rr)rvZargument_stringsr�Zargument_valuesZconflict_actionrZaction_name)�action_conflictsr��seen_actions�seen_non_default_actionsr%r*r+�take_action@s


z5ArgumentParser._parse_known_args.<locals>.take_actioncs��|}|\}}}�j}g}|dkr:���|�|dS|dk	�r||d�}�j}|dkr�|d|kr�|�|g|f�|d}	|	|d}|dd�p�d}
�j}||kr�||}|
}ntd�}t|||��nB|dkr�|d}
|g}|�|||f��q\ntd�}t|||��q|d}�|d�}|||�}||}
�||
�}|�|||f��q\q|�sft�|D]\}}}�|||��qj|
S)NrSr�rzignored explicit argument %r)�_match_argumentr r8r>r�rrU)�start_index�option_tuplervr��explicit_argZmatch_argumentZ
action_tuples�	arg_countrP�charZnew_explicit_argZ
optionals_mapr�stopr\r�Zselected_patterns)r&�arg_strings_pattern�extras�option_string_indicesr%r�r*r+�consume_optionalUsN




z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsn�j}�|d�}|�|�}t�|�D]*\}}�|||�}||7}�||�q&�t|�d��dd�<|Sr-)�_match_arguments_partial�zipro)r�Z
match_partialZselected_patternZ
arg_countsrvr�r\)r&r�r�r%r�r*r+�consume_positionals�s
z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrr�csg|]}|�kr|�qSr*r*)rZr�)r�r*r+r]�s�z4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %srcSsg|]}|jtk	rt|��qSr*)rrrr�rzr*r*r+r]�s
�z#one of the arguments %s is requiredr)N)ro�_read_args_from_filesr@r�r�rr��iterr �_parse_optionalr$r�rwrAr@r=r�r�r�r�r�r�r�r�r��
_get_valuer)r�)r%r&r�r\r�r�Zmutex_actionZ	conflictsZarg_string_pattern_partsZarg_strings_iter�
arg_stringr��patternr�r�Zmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ
stop_indexZrequired_actionsrvr�r�rr*)r�r&r�r�r�r�r�r�r�r%r�r�r+r�s�





J

�






�
���
�



�z ArgumentParser._parse_known_argsc
Cs�g}|D]�}|r|d|jkr*|�|�qzdt|dd���J}g}|����D]}|�|�D]}|�|�q\qN|�|�}|�|�W5QRXWqtk
r�t	�
�d}|�t|��YqXq|Sr�)
ror r��readr��convert_arg_line_to_argsr�r�r+rr�r)r�)r%r&Znew_arg_stringsr�Z	args_file�arg_liner'r�r*r*r+r�s 
z$ArgumentParser._read_args_from_filescCs|gSr-r*)r%r�r*r*r+r�!sz'ArgumentParser.convert_arg_line_to_argscCsz|�|�}t�||�}|dkrldtd�ttd�ttd�i}|�|j�}|dkrbtdd|j�|j}t	||��t
|�d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrS)�_get_nargs_patternrJrXr�r
rr�r�rrror�)r%rvr��
nargs_patternrXZnargs_errorsrr*r*r+r�$s(
���
zArgumentParser._match_argumentcsrg}tt|�dd�D]X}|d|�}d��fdd�|D��}t�||�}|dk	r|�dd�|��D��qnq|S)Nrr�r^csg|]}��|��qSr*)r�rzr1r*r+r]@s�z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|]}t|��qSr*rn)rZr,r*r*r+r]Ds)r�ror$rJrXr�rk)r%rjr�r�r�Z
actions_slicer�rXr*r1r+r�:s�z'ArgumentParser._match_arguments_partialc
Cs|sdS|d|jkrdS||jkr8|j|}||dfSt|�dkrHdSd|kr~|�dd�\}}||jkr~|j|}|||fS|�|�}t|�dkr�d�dd�|D��}||d�}td�}|�||�nt|�dkr�|\}	|	S|j�	|�r�|j
s�dSd	|k�rdSd|dfS)
NrrS�=rcSsg|]\}}}|�qSr*r*)rZrvr�r�r*r*r+r]is�z2ArgumentParser._parse_optional.<locals>.<listcomp>)r_Zmatchesz4ambiguous option: %(option)s could match %(matches)sr)r8r>ro�split�_get_option_tuplesr$r�r)rBrXrC)
r%r�rvr�r�Z
option_tuplesZoptionsr\rr�r*r*r+r�Js>







�

zArgumentParser._parse_optionalc
Cs0g}|j}|d|kr�|d|kr�|jr~d|krB|�dd�\}}n|}d}|jD],}|�|�rP|j|}|||f}|�|�qPn�|d|k�r|d|k�r|}d}|dd�}|dd�}	|jD]T}||kr�|j|}|||	f}|�|�q�|�|�r�|j|}|||f}|�|�q�n|�td�|�|S)NrrSr�r8zunexpected option string: %s)r8rqr�r>�
startswithr r)r�)
r%r�r�rPZ
option_prefixr�rvr�Zshort_option_prefixZshort_explicit_argr*r*r+r��s:









z!ArgumentParser._get_option_tuplescCs�|j}|dkrd}nf|tkr"d}nX|tkr0d}nJ|tkr>d}n<|tkrLd}n.|tkrZd}n |tkrhd}ndd	�d
|�}|jr�|�	d	d�}|�	dd�}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�r^r&)
r�r
rrrrrr$r�ra)r%rvr�r�r*r*r+r��s(z!ArgumentParser._get_nargs_patterncCs4|�||�\}}|r0td�}|�|d�|��|Sr})�parse_known_intermixed_argsr�r)r$r~r*r*r+�parse_intermixed_args�s
z$ArgumentParser.parse_intermixed_argsc	s�|���dd��D�}|r,td|dj���fdd�|jD�rHtd���zN|j}z�|jdkrp|��dd�|_�D] }|j|_t	|_|j|_t	|_qt|�
||�\}}�D]J}t||j�r�t
||j�gkr�ddlm}|d	|j|f�t||j�q�W5�D]}|j|_|j|_q�X|��}zJ|D]}|j|_d
|_�q$|jD]}	|	j|	_d
|	_�q@|�
||�\}}
W5|D]}|j|_�qn|jD]}	|	j|	_�q�XW5||_X||
fS)NcSsg|]}|jttfkr|�qSr*)r�rrrzr*r*r+r]�s�z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>z3parse_intermixed_args: positional arg with nargs=%srcs&g|]}|jD]}|�kr|j�qqSr*)r�r�)rZr�rv�r�r*r+r]�s
�z;parse_intermixed_args: positional in mutuallyExclusiveGroup�)�warnzDo not expect %s in %sF)rwr�r�r@riZ
save_nargsZsave_defaultr��format_usagerrr�r�r��warningsr�r�r|Z
save_requiredr�)r%r\r��aZ
save_usagervZremaining_argsr�r�r�r�r*r�r+r��s`
�
��


�
z*ArgumentParser.parse_known_intermixed_argscs��jttfkr2z|�d�Wntk
r0YnX|sz�jtkrz�jrN�j}n�j}t	|t
�rv���|�}���|��n|s��jt
kr��js��jdk	r��j}n|}���|�n�t|�dkr�jdtfkr�|\}���|�}���|�n��jtk�r��fdd�|D�}np�jtk�r@��fdd�|D�}���|d�n>�jtk�rRt}n,��fdd�|D�}|D]}���|��qj|S)Nr�rScsg|]}���|��qSr*�r��rZ�v�rvr%r*r+r]Z	sz.ArgumentParser._get_values.<locals>.<listcomp>csg|]}���|��qSr*r�r�r�r*r+r]^	srcsg|]}���|��qSr*r�r�r�r*r+r]g	s)r�rrrYr�r
r�r�r�r�r�r��_check_valuerror)r%rvr&r)r�r�r*r�r+r�6	sD
�
zArgumentParser._get_valuesc	Cs�|�d|j|j�}t|�s0td�}t|||��z||�}Wn�tk
r~t|jdt|j��}tt	�
�d�}t||��YnLttfk
r�t|jdt|j��}||d�}td�}t|||��YnX|S)NrrJrrS)rr)z!invalid %(type)s value: %(value)r)
rFrrNr�rrr�r!r�rr�r�r�)r%rvr�rQrr�r(r\r*r*r+r�n	s 
zArgumentParser._get_valuecCsF|jdk	rB||jkrB|d�tt|j��d�}td�}t|||��dS)Nr)r)r�z3invalid choice: %(value)r (choose from %(choices)s))r�r$�mapr!r�r)r%rvr)r\rr*r*r+r��	s�zArgumentParser._check_valuecCs$|��}|�|j|j|j�|��Sr-)rrmrir=r@ra)r%rWr*r*r+r��	s
�zArgumentParser.format_usagecCst|��}|�|j|j|j�|�|j�|jD]0}|�|j	�|�|j�|�
|j�|��q.|�|j
�|��Sr-)rrmrir=r@rgr6r?rcr[ryr�rdrmra)r%rWZaction_groupr*r*r+ra�	s�

zArgumentParser.format_helpcCs|j|jd�S)Nr~)rnrOr1r*r*r+r�	szArgumentParser._get_formattercCs"|dkrtj}|�|��|�dSr-)rr	rr��r%�filer*r*r+�print_usage�	szArgumentParser.print_usagecCs"|dkrtj}|�|��|�dSr-)rr	rrar�r*r*r+r�	szArgumentParser.print_helpcCs |r|dkrtj}|�|�dSr-)r�stderr�write)r%r�r�r*r*r+r�	szArgumentParser._print_messagercCs |r|�|tj�t�|�dSr-)rrr�r)r%Zstatusr�r*r*r+r�	szArgumentParser.exitcCs0|�tj�|j|d�}|�dtd�|�dS)z�error(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        )rOr�r8z%(prog)s: error: %(message)s
N)r�rr�rOrr�)r%r�r\r*r*r+r)�	s	zArgumentParser.error)NN)NN)NN)NN)N)N)N)rN)#rr2r3r4rrQr"rxrOr|rwrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�rarr�rrrr)r�r*r*r�r+rSsV�@

#w:-1

M8


	
)3r4�__version__�__all__�osri�rerJZshutilr;�sysrrr�rrr
rrrrrr�rr7rrrrr	r��	Exceptionrrrr�r�r�r�r�r�r�r�rr
rrr
r3rRrTrr*r*r*r+�<module>s�=�z
	[#&]7:"ftplib.cpython-38.opt-2.pyc000064400000043447151450073350011433 0ustar00U

e5d9��@sRddlZddlZddlmZddddddgZd	Zd
ZdZGdd
�d
e�ZGdd�de�Z	Gdd�de�Z
Gdd�de�ZGdd�de�Zee
efZdZdZGdd�d�ZzddlZWnek
r�dZYn0XejZGdd�de�Ze�d�ee
eejfZdadd�Zdadd�Zdd�Zdd�Zdd �Z d(d#d$�Z!d%d&�Z"e#d'k�rNe"�dS))�N)�_GLOBAL_DEFAULT_TIMEOUT�FTP�error_reply�
error_temp�
error_perm�error_proto�
all_errors��� c@seZdZdS)�ErrorN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/ftplib.pyr9src@seZdZdS)rNr
rrrrr:sc@seZdZdS)rNr
rrrrr;sc@seZdZdS)rNr
rrrrr<sc@seZdZdS)rNr
rrrrr=s�
s
c@s�eZdZdZdZeZeZdZ	dZ
dZdZdZ
dZddddedfdd�Zd	d
�Zdd�Zd[dd�Zdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Z d(d)�Z!d*d+�Z"d,d-�Z#d.d/�Z$d0d1�Z%d\d2d3�Z&d]d4d5�Z'd^d6d7�Z(d_d9d:�Z)d`d;d<�Z*dad=d>�Z+dbd?d@�Z,dAdB�Z-dCdD�Z.dEdF�Z/dgfdGdH�Z0dIdJ�Z1dKdL�Z2dMdN�Z3dOdP�Z4dQdR�Z5dSdT�Z6dUdV�Z7dWdX�Z8dYdZ�Z9dS)crr�Nr	zlatin-1FcCs0||_||_|r,|�|�|r,|�|||�dS�N)�source_address�timeout�connect�login)�self�host�user�passwd�acctrrrrr�__init__rs
zFTP.__init__cCs|Srr�rrrr�	__enter__{sz
FTP.__enter__c	GsN|jdk	rJz*z|��Wnttfk
r0YnXW5|jdk	rH|��XdSr)�sock�close�quit�OSError�EOFError)r�argsrrr�__exit__s


zFTP.__exit__����cCs�|dkr||_|dkr||_|dkr*||_|dk	r8||_t�d||j|j�tj|j|jf|j|jd�|_|jj	|_
|jjd|jd�|_
|��|_|jS)Nrrr)zftplib.connect�r�r��encoding)r�portrr�sys�audit�socket�create_connectionr"�family�af�makefiler-�file�getresp�welcome)rrr.rrrrrr�s �

zFTP.connectcCs|jrtd|�|j��|jS)Nz	*welcome*)�	debugging�print�sanitizer8r rrr�
getwelcome�szFTP.getwelcomecCs
||_dSr)r9)r�levelrrr�set_debuglevel�szFTP.set_debuglevelcCs
||_dSr)�
passiveserver)r�valrrr�set_pasv�szFTP.set_pasvcCsJ|dd�dkrBt|�d��}|dd�d|d||d�}t|�S)N�>�PASS �pass r�*)�len�rstrip�repr)r�s�irrrr;�s$zFTP.sanitizecCs`d|ksd|krtd��t�d||�|t}|jdkrHtd|�|��|j�|�	|j
��dS)N�
�
z4an illegal newline character should not be containedzftplib.sendcmdr	z*put*)�
ValueErrorr/r0�CRLFr9r:r;r"�sendall�encoder-�r�linerrr�putline�s
zFTP.putlinecCs$|jrtd|�|��|�|�dS)Nz*cmd*)r9r:r;rSrQrrr�putcmd�sz
FTP.putcmdcCs�|j�|jd�}t|�|jkr.td|j��|jdkrHtd|�|��|sPt�|dd�t	krn|dd�}n|dd�t	kr�|dd�}|S)Nr	�got more than %d bytesz*get*������)
r6�readline�maxlinerFrr9r:r;r&rNrQrrr�getline�s
zFTP.getlinecCs`|��}|dd�dkr\|dd�}|��}|d|}|dd�|kr$|dd�dkr$q\q$|S)N���-rL)rZ)rrR�codeZnextlinerrr�getmultiline�s�zFTP.getmultilinecCsp|��}|jrtd|�|��|dd�|_|dd�}|dkrD|S|dkrTt|��|dkrdt|��t|��dS)Nz*resp*r[r	>�1�3�2�4�5)r_r9r:r;Zlastresprrr)r�resp�crrrr7�szFTP.getrespcCs$|��}|dd�dkr t|��|S)Nr	rb)r7r�rrerrr�voidresp�szFTP.voidrespcCsTdt}|jdkr"td|�|��|j�|t�|��}|dd�dkrPt|��|S)N�ABORr	z*put urgent*r[��225�426�226)	�B_CRLFr9r:r;r"rO�MSG_OOBr_r�rrRrerrr�aborts
z	FTP.abortcCs|�|�|��Sr)rTr7�r�cmdrrr�sendcmds
zFTP.sendcmdcCs|�|�|��Sr)rTrhrrrrr�voidcmds
zFTP.voidcmdcCsB|�d�}t|d�t|d�g}||}dd�|�}|�|�S)N�.�zPORT �,)�splitrH�joinru)rrr.ZhbytesZpbytes�bytesrsrrr�sendports

zFTP.sendportcCsbd}|jtjkrd}|jtjkr$d}|dkr4td��dt|�|t|�dg}dd�|�}|�|�S)Nrr	�zunsupported address familyrzEPRT �|)r4r1�AF_INETZAF_INET6rrHrzru)rrr.r4Zfieldsrsrrr�sendeprt&szFTP.sendeprtcCsltjd|jdd�}|��d}|j��d}|jtjkrF|�||�}n|�||�}|jt	k	rh|�
|j�|S)N)rrr	)r3Zbacklogr)r1Z
create_serverr4Zgetsocknamer"rr|r�rr�
settimeout)rr"r.rrerrr�makeport3s
zFTP.makeportcCs\|jtjkr:t|�d��\}}|jr*|}qT|j��d}nt|�d�|j���\}}||fS)N�PASVrZEPSV)	r4r1r�parse227rt�trust_server_pasv_ipv4_addressr"Zgetpeername�parse229)rZuntrusted_hostr.rrrr�makepasv@szFTP.makepasvc
	Cs6d}|jr�|��\}}tj||f|j|jd�}zL|dk	rF|�d|�|�|�}|ddkrd|��}|ddkrxt|��Wn|�	��YnXn�|�
��r}|dk	r�|�d|�|�|�}|ddkr�|��}|ddkr�t|��|��\}}	|jtk	�r
|�
|j�W5QRX|dd�dk�r.t|�}||fS)Nr*zREST %srrbr`r[�150)r?r�r1r2rrrtr7rr#r�Zacceptrr��parse150)
rrs�rest�sizerr.�connrer"Zsockaddrrrr�ntransfercmdLs>�



zFTP.ntransfercmdcCs|�||�dS)Nr)r�)rrsr�rrr�transfercmd�szFTP.transfercmdcCs�|sd}|sd}|sd}|dkr0|dkr0|d}|�d|�}|ddkrX|�d|�}|ddkrr|�d	|�}|dd
kr�t|��|S)NZ	anonymousr>rr]z
anonymous@zUSER rrarC�ACCT rb�rtr)rrrrrerrrr�s z	FTP.loginrc	Cs^|�d�|�||��:}|�|�}|s(q2||�qtdk	rLt|t�rL|��W5QRX|��S�NzTYPE I)rur�Zrecv�
_SSLSocket�
isinstance�unwraprh)rrs�callback�	blocksizer�r��datarrr�
retrbinary�s


zFTP.retrbinaryc
Cs�|dkrt}|�d�}|�|���}|jd|jd���}|�|jd�}t|�|jkr`td|j��|j	dkrxt
dt|��|s~q�|dd�tkr�|dd�}n|d	d�d
kr�|dd	�}||�q4t
dk	r�t|t
�r�|��W5QRXW5QRX|��S)N�TYPE Ar+r,r	rUr}z*retr*rVrWrL)�
print_linertr�r5r-rXrYrFrr9r:rHrNr�r�r�rh)rrsr�rer��fprRrrr�	retrlines�s,
�

z
FTP.retrlinesc	Csl|�d�|�||��H}|�|�}|s(q@|�|�|r||�qtdk	rZt|t�rZ|��W5QRX|��Sr�)rur��readrOr�r�r�rh)rrsr�r�r�r�r��bufrrr�
storbinary�s



zFTP.storbinaryc	Cs�|�d�|�|���}|�|jd�}t|�|jkrBtd|j��|sHq�|dd�tkrx|dtkrp|dd�}|t}|�|�|r||�qtdk	r�t	|t�r�|�
�W5QRX|��S)Nr�r	rUrVrW)rur�rXrYrFrrnrOr�r�r�rh)rrsr�r�r�r�rrr�	storlines�s"


z
FTP.storlinescCsd|}|�|�S)Nr��ru)rZpasswordrsrrrrszFTP.acctcGs0d}|D]}|d|}qg}|�||j�|S)NZNLST� )r��append)rr'rs�arg�filesrrr�nlstszFTP.nlstcGshd}d}|dd�r>t|d�td�kr>|dd�|d}}|D]}|rB|d|}qB|�||�dS)NZLISTrWrr�)�typer�)rr'rs�funcr�rrr�dir(s zFTP.dirc
cs�|r|�dd�|�d�|r*d|}nd}g}|�||j�|D]\}|�t��d�\}}}i}	|dd��d�D] }
|
�d�\}}}||	|��<qt||	fVqDdS)Nz
OPTS MLST �;zMLSD %sZMLSDr�rW�=)	rtrzr�r�rGrN�	partitionry�lower)
r�pathZfactsrs�linesrRZfacts_found�_�name�entryZfact�key�valuerrr�mlsd7s
zFTP.mlsdcCs0|�d|�}|ddkr"t|��|�d|�S)NzRNFR rrazRNTO )rtrru)rZfromnameZtonamererrr�renameSsz
FTP.renamecCs.|�d|�}|dd�dkr"|St|��dS)NzDELE r[>�250�200r�)r�filenamererrr�deleteZsz
FTP.deletec
Csp|dkrRz|�d�WStk
rN}z|jddd�dkr>�W5d}~XYq^Xn|dkr^d}d|}|�|�S)	Nz..ZCDUPrr[�500rrvzCWD )rurr')r�dirname�msgrsrrr�cwdbszFTP.cwdcCs:|�d|�}|dd�dkr6|dd���}t|�SdS)NzSIZE r[Z213)rt�strip�int)rr�rerIrrrr�oszFTP.sizecCs$|�d|�}|�d�sdSt|�S)NzMKD �257r�ru�
startswith�parse257)rr�rerrr�mkdws
zFTP.mkdcCs|�d|�S)NzRMD r�)rr�rrr�rmd�szFTP.rmdcCs |�d�}|�d�sdSt|�S)NZPWDr�rr�rgrrr�pwd�s

zFTP.pwdcCs|�d�}|��|S)NZQUIT)rur#rgrrrr$�s
zFTP.quitcCsDz |j}d|_|dk	r|��W5|j}d|_|dk	r>|��XdSr)r"r#r6)rr"r6rrrr#�sz	FTP.close)rrr)N)N)N)rrr)rN)N)rNN)N):rrrr9r�FTP_PORTr.�MAXLINErYr"r6r8r?r-r�rrr!r(rr<r>�debugrAr;rSrTrZr_r7rhrqrtrur|r�r�r�r�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r$r#rrrrrJsn�
	






7



#

	
		c	@sjeZdZejZdddddddedf	dd�Zddd�Zdd	�Z	d
d�Z
dd
�Zdd�Zddd�Z
dd�ZdS)�FTP_TLSrNc
	Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}
|
�dtd�||_||_|dkr|tj|j||d�}||_	d|_
t�|||||||	�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr})�certfile�keyfileF)
rM�warnings�warn�DeprecationWarningr�r��sslZ_create_stdlib_context�ssl_version�context�_prot_prr)rrrrrr�r�r�rrr�rrrr�s(��zFTP_TLS.__init__TcCs*|rt|jtj�s|��t�||||�Sr)r�r"r��	SSLSocket�authrr)rrrrZsecurerrrr�sz
FTP_TLS.logincCsft|jtj�rtd��|jtjkr.|�d�}n
|�d�}|jj	|j|j
d�|_|jjd|jd�|_
|S)NzAlready using TLSzAUTH TLSzAUTH SSL�Zserver_hostnamer+)�moder-)r�r"r�r�rMr�ZPROTOCOL_TLSrur��wrap_socketrr5r-r6rgrrrr��s

�zFTP_TLS.authcCs0t|jtj�std��|�d�}|j��|_|S)Nz
not using TLSZCCC)r�r"r�r�rMrur�rgrrr�ccc�s

zFTP_TLS.ccccCs|�d�|�d�}d|_|S)NzPBSZ 0zPROT PT�rur�rgrrr�prot_p�s

zFTP_TLS.prot_pcCs|�d�}d|_|S)NzPROT CFr�rgrrr�prot_cs
zFTP_TLS.prot_ccCs2t�|||�\}}|jr*|jj||jd�}||fS)Nr�)rr�r�r�r�r)rrsr�r�r�rrrr�s�zFTP_TLS.ntransfercmdcCs8dt}|j�|�|��}|dd�dkr4t|��|S)Nrir[rj)rnr"rOr_rrprrrrqsz
FTP_TLS.abort)rrrT)N)rrrr�ZPROTOCOL_TLS_CLIENTr�rrrr�r�r�r�r�rqrrrrr��s!
�



r�cCs\|dd�dkrt|��tdkr<ddl}|�d|j|jB�at�|�}|sNdSt|�d��S)Nr[r�rz150 .* \((\d+) bytes\)r	)	r�_150_re�re�compile�
IGNORECASE�ASCII�matchr��group)rer��mrrrr�)s
�
r�cCs�|dd�dkrt|��tdkr6ddl}|�d|j�at�|�}|sLt|��|��}d�|dd��}t	|d�d>t	|d�}||fS)	Nr[Z227rz#(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)rvr\�rB)
r�_227_rer�r�r��searchr�groupsrzr�)rer�r�Znumbersrr.rrrr�=s
r�cCs�|dd�dkrt|��|�d�}|dkr2t|��|�d|d�}|dkrRt|��||d||dkrrt|��||d|��||d�}t|�dkr�t|��|d}t|d�}||fS)Nr[Z229�(r�)r	rB)r�findrryrFr�)reZpeer�left�right�partsrr.rrrr�Qs 
r�cCs�|dd�dkrt|��|dd�dkr,dSd}d}t|�}||kr�||}|d}|dkrz||ks�||dkrrq�|d}||}q<|S)Nr[r�rBz "rr	�")rrF)rer�rJ�nrfrrrr�gs 
r�cCst|�dSr)r:)rRrrrr�~sr�r�Ic	Cs�|s|}d|}|�|�|�|�t|�d��\}}|�||�|�d|�}|dd�dkrdt�|�d|�}|dd�dkr�t�|��|��dS)NzTYPE r�zSTOR r[>�125r��RETR )rur�rtr|rrh)	�sourceZ
sourcename�targetZ
targetnamer�Z
sourcehostZ
sourceportZtreplyZsreplyrrr�ftpcp�s

r�cCs�ttj�dkr"ttj�t�d�ddl}d}d}tjddkrR|d}tjd=q2tjddd�dkr�tjddd�}tjd=tjd}t|�}|�	|�d}}}z|�|�}Wn(t
k
r�|dk	r�tj�d�Yn:Xz|�
|�\}}}Wn"tk
�rtj�d�YnX|�|||�tjdd�D]�}	|	dd�d	k�r`|�|	dd��nt|	dd�dk�r�d
}
|	dd��r�|
d|	dd�}
|�|
�}n0|	dk�r�|�|j�n|�d
|	tjjd��q6|��dS)Nr}rr	z-dz-rrz5Could not open account file -- using anonymous login.z$No account -- using anonymous login.z-lZCWDr�z-pr�i)rFr/�argvr:�test�__doc__�exit�netrcrr>r%�stderr�writeZauthenticators�KeyErrorrr�rtrAr?r��stdoutr$)r�r9ZrcfilerZftpZuseridrrZnetrcobjr6rsrerrrr��sV	




�


�r��__main__)rr�)$r/r1r�__all__ror�r��	Exceptionrrrrrr%r&rrNrnrr��ImportErrorr�r�r�r�ZSSLErrorr�r�r�r�r�r�r�r�r�rrrrr�<module>'sP
�
Z
|

9
contextvars.cpython-38.opt-2.pyc000064400000000365151450073350012523 0ustar00U

e5d��@s ddlmZmZmZmZdZdS)�)�Context�
ContextVar�Token�copy_contextN)Z_contextvarsrrrr�__all__�rr�#/usr/lib64/python3.8/contextvars.py�<module>srandom.cpython-38.opt-1.pyc000064400000047216151450073350011430 0ustar00U

e5d�p�@sdZddlmZddlmZmZm	Z
mZm
ZddlmZmZmZmZddlmZddlmZmZddlm Z!m"Z#ddl$m$Z%dd	lZ&zdd
l'm(Z'Wn e)k
r�dd
l*m(Z'YnXddd
ddddddddddddddddddd d!d"gZ+d#ed$�ed%�Z,d%e
Z-ed&�Z.d'ed(�Z/d)Z0d*e0Z1dd	l2Z2Gd+d�de2j3�Z3Gd,d"�d"e3�Z4d-d.�Z5d5d0d1�Z6e3�Z7e7j8Z8e7j9Z9e7j:Z:e7j;Z;e7j<Z<e7j=Z=e7j>Z>e7j?Z?e7j@Z@e7jAZAe7jBZBe7jCZCe7jDZDe7jEZEe7jFZFe7jGZGe7jHZHe7jIZIe7jJZJe7jKZKe7jLZLe7jMZMeNe&d2��re&jOe7j8d3�ePd4k�re6�d	S)6a�Random variable generators.

    integers
    --------
           uniform within range

    sequences
    ---------
           pick random element
           pick random sample
           pick weighted random sample
           generate random permutation

    distributions on the real line:
    ------------------------------
           uniform
           triangular
           normal (Gaussian)
           lognormal
           negative exponential
           gamma
           beta
           pareto
           Weibull

    distributions on the circle (angles 0 to 2pi)
    ---------------------------------------------
           circular uniform
           von Mises

General notes on the underlying Mersenne Twister core generator:

* The period is 2**19937-1.
* It is one of the most extensively tested generators in existence.
* The random() method is implemented in C, executes in a single Python step,
  and is, therefore, threadsafe.

�)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�urandom)�Set�Sequence)�
accumulate�repeat)�bisectN)�sha512�Random�seed�random�uniform�randint�choice�sample�	randrange�shuffle�
normalvariate�lognormvariate�expovariate�vonmisesvariate�gammavariate�
triangular�gauss�betavariate�
paretovariate�weibullvariate�getstate�setstate�getrandbits�choices�SystemRandom�g��@�@��?�@�5�cs$eZdZdZdZd?dd�Zdd�Zd@�fd	d
�	Z�fdd�Z�fd
d�Z	dd�Z
dd�Zdd�Zdde
fdd�Zdd�Zdd�Ze
de>fdd�ZeZdd�ZdAd d!�Zd"d#�ZdBddd$�d%d&�Zd'd(�ZdCd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"�Z#S)Dra�Random number generator base class used by bound module functions.

    Used to instantiate instances of Random to get generators that don't
    share state.

    Class Random can also be subclassed if you want to use a different basic
    generator of your own devising: in that case, override the following
    methods:  random(), seed(), getstate(), and setstate().
    Optionally, implement a getrandbits() method so that randrange()
    can cover arbitrarily large ranges.

    �NcCs|�|�d|_dS)zeInitialize an instance.

        Optional argument x controls seeding, as for Random.seed().
        N)r�
gauss_next)�self�x�r6�/usr/lib64/python3.8/random.py�__init__^s
zRandom.__init__cKsJ|jD]>}d|jkrqFd|jkr.|j|_qFd|jkr|j|_qFqdS)aControl how subclasses generate random integers.

        The algorithm a subclass can use depends on the random() and/or
        getrandbits() implementation available to it and determines
        whether it can generate random integers from arbitrarily large
        ranges.
        �
_randbelowr(rN)�__mro__�__dict__�_randbelow_with_getrandbitsr9�_randbelow_without_getrandbits)�cls�kwargs�cr6r6r7�__init_subclass__gs	



zRandom.__init_subclass__r1cs�|dkr�t|ttf�r�t|t�r*|�d�n|}|rBt|d�d>nd}tt|�D]}d||Ad@}qP|t|�N}|dkr~dn|}|d	kr�t|tttf�r�t|t�r�|��}|t	|��
�7}t�|d
�}t
��|�d|_dS)aInitialize internal state from hashable object.

        None or no argument seeds from current time or from an operating
        system specific randomness source if available.

        If *a* is an int, all bits are used.

        For version 2 (the default), all of the bits are used if *a* is a str,
        bytes, or bytearray.  For version 1 (provided for reproducing random
        sequences from older versions of Python), the algorithm for str and
        bytes generates a narrower range of seeds.

        �zlatin-1r�iCBl����������r1�bigN)�
isinstance�str�bytes�decode�ord�map�len�	bytearray�encode�_sha512Zdigest�int�
from_bytes�superrr3)r4�a�versionr5r@��	__class__r6r7r{s
zRandom.seedcs|jt���|jfS)z9Return internal state; can be passed to setstate() later.)�VERSIONrSr&r3�r4rVr6r7r&�szRandom.getstatec
s�|d}|dkr*|\}}|_t��|�nt|dkr�|\}}|_ztdd�|D��}Wn(tk
r|}z
t|�W5d}~XYnXt��|�ntd||jf��dS)z:Restore internal state from object returned by getstate().rr2r1css|]}|dVqdS)lNr6)�.0r5r6r6r7�	<genexpr>�sz"Random.setstate.<locals>.<genexpr>Nz?state with version %s passed to Random.setstate() of version %s)r3rSr'�tuple�
ValueError�	TypeErrorrX)r4�staterUZ
internalstaterrVr6r7r'�s�zRandom.setstatecCs|��S�N)r&rYr6r6r7�__getstate__�szRandom.__getstate__cCs|�|�dSr`)r')r4r_r6r6r7�__setstate__�szRandom.__setstate__cCs|jd|��fS)Nr6)rWr&rYr6r6r7�
__reduce__�szRandom.__reduce__rBc
Cs||�}||krtd��|dkr:|dkr2|�|�Std��||�}||krRtd��||}|dkrx|dkrx||�|�S|dkr�td|||f��||�}||kr�td��|dkr�||d|}	n"|dkr�||d|}	ntd	��|	dkr�td��|||�|	�S)
z�Choose a random item from range(start, stop[, step]).

        This fixes the problem with randint() which includes the
        endpoint; in Python this is usually not what you want.

        z!non-integer arg 1 for randrange()Nrzempty range for randrange()z non-integer stop for randrange()rBz(empty range for randrange() (%d, %d, %d)z non-integer step for randrange()zzero step for randrange())r]r9)
r4�start�stop�step�_intZistartZistop�widthZistep�nr6r6r7r�s4

zRandom.randrangecCs|�||d�S)zJReturn random integer in range [a, b], including both end points.
        rB)r�r4rT�br6r6r7r�szRandom.randintcCs,|j}|��}||�}||kr(||�}q|S)zCReturn a random int in the range [0,n).  Raises ValueError if n==0.)r(�
bit_length)r4rir(�k�rr6r6r7r<�s
z"Random._randbelow_with_getrandbitscCsn|j}||kr$td�||�|�S|dkr4td��||}|||}|�}||kr^|�}qN|||�|S)z�Return a random int in the range [0,n).  Raises ValueError if n==0.

        The implementation does not use getrandbits, but only random.
        z�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.rzBoundary cannot be zero)r�_warnr])r4rirQ�maxsizerZrem�limitrnr6r6r7r=sz%Random._randbelow_without_getrandbitscCs:z|�t|��}Wntk
r0td�d�YnX||S)z2Choose a random element from a non-empty sequence.z$Cannot choose from an empty sequenceN)r9rMr]�
IndexError)r4�seq�ir6r6r7rs
z
Random.choicecCs�|dkrN|j}ttdt|���D]*}||d�}||||||<||<q nHt}ttdt|���D]0}||�|d�}||||||<||<qddS)z�Shuffle list x in place, and return None.

        Optional argument random is a 0-argument function returning a
        random float in [0.0, 1.0); if it is the default None, the
        standard random.random will be used.

        NrB)r9�reversed�rangerMrQ)r4r5r�	randbelowrt�jrgr6r6r7r%s	zRandom.shufflecCst|t�rt|�}t|t�s$td��|j}t|�}d|krF|ksPntd��dg|}d}|dkr�|dtt	|dd��7}||kr�t
|�}t|�D]0}|||�}	||	||<|||d	||	<q�nHt�}
|
j
}t|�D]2}||�}	|	|
kr�||�}	q�||	�||	||<q�|S)
a=Chooses k unique random elements from a population sequence or set.

        Returns a new list containing elements from the population while
        leaving the original population unchanged.  The resulting list is
        in selection order so that all sub-slices will also be valid random
        samples.  This allows raffle winners (the sample) to be partitioned
        into grand prize and second place winners (the subslices).

        Members of the population need not be hashable or unique.  If the
        population contains repeats, then each occurrence is a possible
        selection in the sample.

        To choose a sample in a range of integers, use range as an argument.
        This is especially fast and space efficient for sampling from a
        large population:   sample(range(10000000), 60)
        z>Population must be a sequence or set.  For dicts, use list(d).rz,Sample larger than population or is negativeN��r+r2rB)rG�_Setr\�	_Sequencer^r9rMr]�_ceil�_log�listrv�set�add)r4�
populationrmrwri�resultZsetsizeZpoolrtrxZselectedZselected_addr6r6r7r;s6)



z
Random.sample)�cum_weightsrmcs�|j�t����dkrV|dkrHt��d7�����fdd�td|�D�Stt|���n|dk	rftd��t���krztd��t��dd��d�������fd	d�td|�D�S)
z�Return a k sized list of population elements chosen with replacement.

        If the relative weights or cumulative weights are not specified,
        the selections are made with equal probability.

        N�csg|]}�������qSr6r6�rZrt)rgrir�rr6r7�
<listcomp>�sz"Random.choices.<locals>.<listcomp>z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrDrBcs$g|]}������d���qS)rr6r�)rr��hir�r�totalr6r7r��s�)	rrMrQ�_repeatr�_accumulater^r]�_bisect)r4r�Zweightsr�rmr6)rgrr�r�rir�rr�r7r)�s$�zRandom.choicescCs||||��S)zHGet a random number in the range [a, b) or [a, b] depending on rounding.�rrjr6r6r7r�szRandom.uniformr�r.cCs||��}z |dkrdn||||}Wntk
r@|YSX||krdd|}d|}||}}|||t||�S)z�Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution

        N��?r.)r�ZeroDivisionError�_sqrt)r4ZlowZhigh�mode�ur@r6r6r7r!�s	 

zRandom.triangularcCsP|j}|�}d|�}t|d|}||d}|t|�krqDq|||S)z\Normal distribution.

        mu is the mean, and sigma is the standard deviation.

        r.r�r-)r�
NV_MAGICCONSTr~)r4�mu�sigmar�u1�u2�zZzzr6r6r7r�s

zRandom.normalvariatecCst|�||��S)z�Log normal distribution.

        If you take the natural logarithm of this distribution, you'll get a
        normal distribution with mean mu and standard deviation sigma.
        mu can have any value, and sigma must be greater than zero.

        )�_expr)r4r�r�r6r6r7r�szRandom.lognormvariatecCstd|���|S)a^Exponential distribution.

        lambd is 1.0 divided by the desired mean.  It should be
        nonzero.  (The parameter would be called "lambda", but that is
        a reserved word in Python.)  Returned values range from 0 to
        positive infinity if lambd is positive, and from negative
        infinity to 0 if lambd is negative.

        r.)r~r)r4Zlambdr6r6r7r�szRandom.expovariatecCs�|j}|dkrt|�Sd|}|td||�}|�}tt|�}|||}|�}	|	d||ks�|	d|t|�kr4q�q4d|}
|
|d|
|}|�}|dkr�|t|�t}
n|t|�t}
|
S)aFCircular data distribution.

        mu is the mean angle, expressed in radians between 0 and 2*pi, and
        kappa is the concentration parameter, which must be greater than or
        equal to zero.  If kappa is equal to zero, this distribution reduces
        to a uniform random angle over the range 0 to 2*pi.

        g���ư>r�r.)r�TWOPIr��_cos�_pir��_acos)r4r�Zkappar�srnr�r��dr��q�fZu3Zthetar6r6r7r�s$
$zRandom.vonmisesvariatecCs~|dks|dkrtd��|j}|dkr�td|d�}|t}||}|�}d|kr`dksdqFqFd|�}t|d|�|}	|t|	�}
|||}|||	|
}|td|dks�|t|�krF|
|SqFn�|dkr�td|��|S|�}
t|t}||
}|dk�r$|d|}
nt|||�}
|�}|dk�r^||
|dk�rp�qrq�|t|
�kr�qrq�|
|SdS)	aZGamma distribution.  Not the gamma function!

        Conditions on the parameters are alpha > 0 and beta > 0.

        The probability distribution function is:

                    x ** (alpha - 1) * math.exp(-x / beta)
          pdf(x) =  --------------------------------------
                      math.gamma(alpha) * beta ** alpha

        r�z*gammavariate: alpha and beta must be > 0.0r.r,gH�����z>g�P���?r/N)r]rr��LOG4r~r��
SG_MAGICCONST�_e)r4�alpha�betarZainvZbbbZcccr�r��vr5r�rnr�rk�pr6r6r7r #s@
 

zRandom.gammavariatecCs`|j}|j}d|_|dkrT|�t}tdtd|���}t|�|}t|�||_|||S)z�Gaussian distribution.

        mu is the mean, and sigma is the standard deviation.  This is
        slightly faster than the normalvariate() function.

        Not thread-safe without a lock around calls.

        Ng�r.)rr3r�r�r~r��_sin)r4r�r�rr�Zx2piZg2radr6r6r7r"hs
zRandom.gausscCs0|�|d�}|dkrdS|||�|d�SdS)z�Beta distribution.

        Conditions on the parameters are alpha > 0 and beta > 0.
        Returned values range between 0 and 1.

        r.rr�N)r )r4r�r��yr6r6r7r#�s
zRandom.betavariatecCsd|��}d|d|S)z3Pareto distribution.  alpha is the shape parameter.r.r�)r4r�r�r6r6r7r$�szRandom.paretovariatecCs"d|��}|t|�d|S)zfWeibull distribution.

        alpha is the scale parameter and beta is the shape parameter.

        r.)rr~)r4r�r�r�r6r6r7r%�szRandom.weibullvariate)N)Nr1)N)N)r�r.N)$�__name__�
__module__�__qualname__�__doc__rXr8rArr&r'rarbrcrQrrr<�BPFr=r9rrrr)rr!rrrrr r"r#r$r%�
__classcell__r6r6rVr7rNs<

	 ,

G
0E5	c@s8eZdZdZdd�Zdd�Zdd�Zdd	�ZeZZ	d
S)r*z�Alternate random number generator using sources provided
    by the operating system (such as /dev/urandom on Unix or
    CryptGenRandom on Windows).

     Not available on all systems (see os.urandom() for details).
    cCst�td�d�d?tS)z3Get the next random number in the range [0.0, 1.0).rCrFr2)rQrR�_urandom�	RECIP_BPFrYr6r6r7r�szSystemRandom.randomcCs<|dkrtd��|dd}t�t|�d�}||d|?S)z:getrandbits(k) -> x.  Generates an int with k random bits.rz(number of bits must be greater than zerorC�rF)r]rQrRr�)r4rmZnumbytesr5r6r6r7r(�s
zSystemRandom.getrandbitscOsdS)z<Stub method.  Not used for a system random number generator.Nr6�r4�args�kwdsr6r6r7r�szSystemRandom.seedcOstd��dS)zAMethod should not be called for a system random number generator.z*System entropy source does not have state.N)�NotImplementedErrorr�r6r6r7�_notimplemented�szSystemRandom._notimplementedN)
r�r�r�r�rr(rr�r&r'r6r6r6r7r*�scCs�ddl}t|d|j�d}d}d}d}|��}t|�D]4}	||�}
||
7}||
|
}t|
|�}t|
|�}q6|��}tt||d�ddd	�||}t||||�}
td
||
||f�dS)Nr�timesr�g _�Bg _��r2zsec,� )�endz"avg %g, stddev %g, min %g, max %g
)	�time�printr��perf_counterrv�min�max�roundr�)ri�funcr�r�r�ZsqsumZsmallestZlargestZt0rtr5�t1ZavgZstddevr6r6r7�_test_generator�s(

�r���cCs�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td	�t|td
�t|td�t|td�t|td�t|td
�dS)Nr6)r�r.)g{�G�z�?r.)皙�����?r.)r�r,)r�r.)g�������?r.)r.r.)r,r.)g4@r.)gi@r.)�@r�)r�r.gUUUUUU�?)	r�rrrrr r"r#r!)�Nr6r6r7�_test�s r��fork)Zafter_in_child�__main__)r�)Qr��warningsrroZmathrr~rr�rr�rr�rr}rr�r	r�r
r�rr��osrr��_collections_abcr
r{rr|�	itertoolsrr�rr�rr��_osrPr�ImportErrorZhashlib�__all__r�r�r�r�r�r�Z_randomrr*r�r�Z_instrrrr!rrrrrr)rrrrr r"r#r$r%r&r'r(�hasattr�register_at_forkr�r6r6r6r7�<module>s�'�
{

pprint.cpython-38.pyc000064400000037633151450073350010527 0ustar00U

e5d�S�
@sdZddlZddlZddlZddlZddlm	Z
dddddd	d
gZd%d
dd�dd�Zd&d
dd�dd�Z
d
d�dd
�Zdd�Zdd�Zdd�ZGdd�d�Zdd�ZGdd	�d	�Zdd�Zeeeeeeeeed�h�Zdd�Z d'd d!�Z!d"d#�Z"e#d$k�r�e!�dS)(a/Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

�N)�StringIO�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp��PFT��compact�
sort_dictscCs"t||||||d�}|�|�dS)zAPretty-print a Python object to a stream [default is sys.stdout].)�stream�indent�width�depthr
rN)rr)�objectrrrrr
rZprinter�r�/usr/lib64/python3.8/pprint.pyr/s�cCst|||||d��|�S)z<Format a Python object into a pretty-printed representation.)rrrr
r)rr)rrrrr
rrrrr7s��)rcOst|f|�d|i|��dS)zPretty-print a Python objectrN)r)rr�args�kwargsrrrr	=scCst|iddd�dS)z=Version of repr() which can handle recursive data structures.NrT��
_safe_repr�rrrrrAscCst|iddd�dS)z4Determine if saferepr(object) is readable by eval().NrTr
rrrrrrEscCst|iddd�dS)z8Determine if object requires a recursive representation.NrT�rrrrrrIsc@s&eZdZdZdgZdd�Zdd�ZdS)�	_safe_keyaUHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    �objcCs
||_dS�N)r)�selfrrrr�__init__Ysz_safe_key.__init__cCsXz|j|jkWStk
rRtt|j��t|j�ftt|j��t|j�fkYSXdSr)r�	TypeError�str�type�id)r�otherrrr�__lt__\s�z_safe_key.__lt__N)�__name__�
__module__�__qualname__�__doc__�	__slots__r r&rrrrrMs	rcCst|d�t|d�fS)z&Helper function for comparing 2-tuplesrr
)r)�trrr�_safe_tuplecsr-c@s�eZdZd;ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�ZiZ	dd�Z
e
e	ej<dd�Z
e
e	ejj<dd�Zee	ej<dd�Zee	ej<dd�Zee	ej<ee	ej<dd�Zee	ej<dd �Zee	ej<d!d"�Zee	ej<d#d$�Zee	ejj<d%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$e$e	ej%j<d/d0�Z&e&e	ej'j<d1d2�Z(e(e	ej)j<d3d4�Z*e*e	ej+j<d5d6�Z,e,e	ej-j<d7d8�Z.e.e	ej/j<d9d:�Z0e0e	ej1j<dS)<rr
rNFTrcCs�t|�}t|�}|dkr td��|dk	r8|dkr8td��|sDtd��||_||_||_|dk	rf||_ntj|_t|�|_	||_
dS)a�Handle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts)rrrrrr
rrrrr hs 
zPrettyPrinter.__init__cCs&|�||jddid�|j�d�dS)Nr�
)�_formatr3�write�rrrrrr�szPrettyPrinter.pprintcCs"t�}|�||ddid�|��S�Nr)�	_StringIOr:�getvalue)rrZsiorrrr�szPrettyPrinter.pformatcCs|�|idd�dS)Nrr��formatr<rrrr�szPrettyPrinter.isrecursivecCs |�|idd�\}}}|o|Sr=r@)rr�s�readable�	recursiverrrr�szPrettyPrinter.isreadablec	Cs�t|�}||kr.|�t|��d|_d|_dS|�|||�}|j||}	t|�|	kr�|j�	t
|�jd�}
|
dk	r�d||<|
|||||||d�||=dSt|t
�r�d||<|�||||||d�||=dS|�|�dS)NTFr
)r$r;�
_recursion�
_recursive�	_readable�_reprr2�len�	_dispatch�getr#�__repr__�
isinstance�dict�_pprint_dict)rrrr�	allowance�context�level�objid�rep�	max_width�prrrr:�s0
�zPrettyPrinter._formatc
Csz|j}|d�|jdkr*||jdd�t|�}|rn|jrNt|��td�}	n|��}	|�|	|||d||�|d�dS)N�{r
� ��key�})r;r1rIr8�sorted�itemsr-�_format_dict_items)
rrrrrPrQrRr;Zlengthr]rrrrO�s
�zPrettyPrinter._pprint_dictcCslt|�s|�t|��dS|j}|�|jd�|�t|���||t|j�d|d||�|�d�dS)N�(r
�))rIr;�repr�	__class__r'r:�listr])rrrrrPrQrR�clsrrr�_pprint_ordered_dict�s�z"PrettyPrinter._pprint_ordered_dictcCs0|�d�|�||||d||�|�d�dS)N�[r
�])r;�
_format_items�rrrrrPrQrRrrr�_pprint_list�s
�zPrettyPrinter._pprint_listcCsH|�d�t|�dkrdnd}|�||||t|�||�|�|�dS)Nr_r
z,)r`)r;rIrh)rrrrrPrQrR�endcharrrr�
_pprint_tuple�s
�zPrettyPrinter._pprint_tuplec	Cs�t|�s|�t|��dS|j}|tkr8|�d�d}n&|�|jd�d}|t|j�d7}t|td�}|�||||t|�||�|�|�dS)NrWr[�({�})r
rY)	rIr;rarb�setr'r\rrh)	rrrrrPrQrR�typrkrrr�_pprint_set�s 
�zPrettyPrinter._pprint_setcCs�|j}t|�s|t|��dSg}|�d�}	|dkrD|d7}|d7}|j|}
}t|	�D]�\}}
t|
�}|t|	�dkr�|
|8}
t|�|
kr�|�|�qZt�d|
�}|s�t	�|dr�t	�|�
�|}d}t|�D]l\}}||}|t|�dk�r|t|	�dk�r||8}tt|��|k�r:|�r4|�t|��|}q�|}q�|rZ|�t|��qZt|�dk�rn||�dS|dk�r�|d�t|�D],\}}|dk�r�|dd	|�||��q�|dk�r�|d
�dS)NTr
z\S*\s*����r_rr9rXr`)r;rIra�
splitlinesr2�	enumerate�append�re�findall�AssertionError�pop)rrrrrPrQrRr;Zchunks�linesZ
max_width1rU�i�linerT�partsZ
max_width2�current�j�part�	candidaterrr�_pprint_strsX
$


zPrettyPrinter._pprint_strcCs�|j}t|�dkr"|t|��dS|dk}|rF|d7}|d7}|d�d}	t||j||�D]$}
||	�||
�|	s\dd|}	q\|r�|d�dS)N�r
r_rsr9rXr`)r;rIra�_wrap_bytes_reprr2)rrrrrPrQrRr;Zparens�delimrTrrr�
_pprint_bytes3s"zPrettyPrinter._pprint_bytesc	Cs>|j}|d�|�t|�||d|d||d�|d�dS)Nz
bytearray(�
r
r`)r;r��bytes)rrrrrPrQrRr;rrr�_pprint_bytearrayHs�zPrettyPrinter._pprint_bytearraycCs8|�d�|�|��||d|d||�|�d�dS)Nz
mappingproxy(�
r
r`)r;r:�copyrirrr�_pprint_mappingproxyQs
�z"PrettyPrinter._pprint_mappingproxyc	Cs�|j}||j7}dd|}t|�d}	t|�D]f\}
\}}|
|	k}
|�|||�}||�|d�|�|||t|�d|
r�|nd||�|
s0||�q0dS)N�,
rXr
z: r)r;r1rIrurHr:)rr]rrrPrQrRr;�delimnlZ
last_indexr|rZ�ent�lastrTrrrr^Ys 

�z PrettyPrinter._format_dict_itemscCsL|j}||j7}|jdkr,||jdd�dd|}d}	|j|d}
}t|�}zt|�}
Wntk
rxYdSXd}|�sH|
}zt|�}
Wn(tk
r�d}||8}|
|8}
YnX|j�r|�|||�}t|�d}|
|kr�|}
|	r�|}	|
|k�r|
|8}
||	�d}	||�q~||	�|}	|�	||||�r<|nd||�q~dS)	Nr
rXr�rsFTr�, )
r;r1r2�iter�next�
StopIterationr7rHrIr:)rr]rrrPrQrRr;r�r�rrU�itZnext_entr�r�rT�wrrrrhjsR



�zPrettyPrinter._format_itemscCs4|�||��|j|�\}}}|s&d|_|r0d|_|S)NFT)rAr�r0rGrF)rrrQrRrarCrDrrrrH�s�
zPrettyPrinter._reprcCst|||||j�S)z�Format object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        )rr8)rrrQ�	maxlevelsrRrrrrA�szPrettyPrinter.formatc	Cs�t|�s|�t|��dS|�|j||�}|j}|t|j�d7}|�d|j|d|f�|�||||d||�|�d�dS)Nr
z	%s(%s,
%srXr`)rIr;rarH�default_factoryrbr'rO)	rrrrrPrQrRZrdfrdrrr�_pprint_default_dict�sz"PrettyPrinter._pprint_default_dictc	Cs�t|�s|�t|��dS|j}|�|jd�|jdkrN|�|jdd�|��}|�|||t|j�d|d||�|�d�dS)Nrmr
rXrrn)rIr;rarbr'r1�most_commonr^)	rrrrrPrQrRrdr]rrr�_pprint_counter�s
�zPrettyPrinter._pprint_counterc
	Cs�t|j�s|�t|��dS|j}|�|jd�|t|j�d7}t|j�D]d\}}	|t|j�dkr�|�|	|||d||�|�d�qN|�|	||d||�|�dd|�qNdS)Nr_r
r`r�rX)rI�mapsr;rarbr'rur:)
rrrrrPrQrRrdr|�mrrr�_pprint_chain_map�s
zPrettyPrinter._pprint_chain_mapc	Cs�t|�s|�t|��dS|j}|�|jd�|t|j�d7}|�d�|jdkrz|�||||d||�|�d�n:|�|||d||�|�|j||�}|�dd||f�dS)Nr_r
rfrz])z],
%smaxlen=%s)rX)rIr;rarbr'�maxlenrhrH)	rrrrrPrQrRrdZrmlrrr�
_pprint_deque�s&

��zPrettyPrinter._pprint_dequec	Cs|�|j|||||d�dS�Nr
�r:�datarirrr�_pprint_user_dict�szPrettyPrinter._pprint_user_dictc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_list�szPrettyPrinter._pprint_user_listc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_string�sz!PrettyPrinter._pprint_user_string)r
rNN)2r'r(r)r rrrrr:rJrOrNrLre�_collections�OrderedDictrjrcrl�tuplerqro�	frozensetr�r"r�r�r��	bytearrayr��_types�MappingProxyTyper^rhrHrAr��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrrrrrgs^�+




1


)	cCs�t|�}|tkrt|�ddfSt|dd�}t|t��rD|tjk�rD|sJdSt|�}|rl||krldd||kfS||kr�t|�ddfSd||<d}d}	g}
|
j	}|d7}|r�t
|��td�}n|��}|D]b\}
}t
|
||||�\}}}t
|||||�\}}}|d||f�|�o|�o|}|�s$|r�d}	q�||=d	d
�|
�||	fSt|t��r\|tjk�stt|t��rn|tjk�rnt|t��r�|�s�dSd}n"t|�dk�r�d
}n|�s�dSd}t|�}|�r�||k�r�|dd||kfS||k�r�t|�ddfSd||<d}d}	g}
|
j	}|d7}|D]8}t
|||||�\}}}||�|�sFd}|�rd}	�q||=|d
�|
�||	fSt|�}||�o�|�d�dfS)NTFrL)z{}TFz{...}r
rYz%s: %sz{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)z...�<)r#�_builtin_scalarsra�getattr�
issubclassrNrLr$rErvr\r]r-r�joinrcr�rI�
startswith)rrQr�rRrrp�rrSrCrDZ
componentsrvr]�k�vZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurrA�oZoreprZ	oreadableZorecurrTrrrr�s�
��
rcCsdt|�jt|�fS)Nz<Recursion on %s with id=%s>)r#r'r$rrrrrE?s�rEcCs�ddl}|dkr,ddddgddd�fgd	}t�}|��}t|iddd
�|��}|�|�|��}td||�td||�dS)
Nr�string)r
r�r���)��i��Tz_safe_repr:zpformat:)�timer�perf_counterrr�print)rr�rV�t1�t2Zt3rrr�
_perfcheckDs
r�ccs�d}t|�dd}tdt|�d�D]T}|||d�}||}||krP||8}tt|��|krt|rnt|�V|}q$|}q$|r�t|�VdS)N�r�r)rI�rangera)rrrPrr�r|r�r�rrrr�Qs
r��__main__)Nr
rN)r
rN)N)$r*�collectionsr�rw�sysr4�typesr��iorr>�__all__rrr	rrrrr-rrr�r"r�r�r.�float�complexr6r#r�rEr�r�r'rrrr�<module>sJ
���F�


crypt.cpython-38.pyc000064400000006475151450073350010354 0ustar00U

e5d�@s0dZddlZzddlZWn0ek
rHejdkr<ed��ned��YnXddlZddl	m
Zddlm
ZejejdZe�ZGd	d
�d
ed
d��Zd&dd�d
d�Zd'dd�ZgZdd�dd�Zedddd�edddd�dD](Zeddeddee�dd�r��qq�edd d!d"�ed#dd$d%�[[dS)(zEWrapper to the POSIX crypt library call and associated functionality.�NZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuplez./c@seZdZdZdd�ZdS)�_MethodziClass representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.cCsd�|j�S)Nz<crypt.METHOD_{}>)�format�name)�self�r�/usr/lib64/python3.8/crypt.py�__repr__sz_Method.__repr__N)�__name__�
__module__�__qualname__�__doc__r
rrrr	rsrz name ident salt_chars total_size��roundscCsB|dkrtd}|dk	r4t|t�s4t|jj�d���|js@d}nd|j�d�}|jr�|jddkr�|dkrpd}n@t�|d�}|d|>kr�td	��d
|kr�dks�ntd��||d
�d�7}n^|jdk�r|dk	�r d|kr�dks�ntd��|d|�d�7}n|dk	�r t|�d���|d�	dd�t
|j�D��7}|S)zsGenerate a salt for the specified method.

    If not specified, the strongest available method will be used.

    Nrz+ object cannot be interpreted as an integer��$�2��zrounds must be a power of 2��z%rounds out of the range 2**4 to 2**31Z02d)�5�6i�i�ɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}t�t�VqdS)N)�_srZchoice�
_saltchars)�.0�charrrr	�	<genexpr>Aszmksalt.<locals>.<genexpr>)�methods�
isinstance�int�	TypeError�	__class__rZident�
bit_length�
ValueError�join�rangeZ
salt_chars)�methodr�sZ
log_roundsrrr	�mksalts2

r*cCs&|dkst|t�rt|�}t�||�S)aRReturn a string representing the one-way hash of a password, with a salt
    prepended.

    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.

    N)r rr*�_crypt�crypt)Zword�saltrrr	r,Es
r,cGsVt|f|��}|t�d|<t||d�}td|�}|rRt|�|jkrRt�|�dSdS)NZMETHOD_rrTF)r�globalsr*r,�lenZ
total_sizer�append)rr�argsr(r-�resultrrr	�_add_methodWs

r3ZSHA512r��jZSHA256r�?)�b�y�arZBLOWFISHr��;ZMD5�1��"ZCRYPT��
)N)N)r�sys�_sysr+�ModuleNotFoundError�platform�ImportError�stringZ_stringZrandomrZ
_SystemRandom�collectionsrZ_namedtupleZ
ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr	�<module>s2

	&

_pydecimal.cpython-38.opt-1.pyc000064400000471741151450073350012262 0ustar00U

e5d:}�%@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g%ZeZd&Zd'Zd(Zd)d*lZd)d*lZ	d)d*l
Z
zd)d+lmZ
e
dd,�ZWnek
r�d-d.�ZYnXdZdZdZdZdZdZdZdZd/Zd/Ze
jd0kr�d1Zd1Zd2Znd3Zd3Zd4Zeed5ZGd6d�de�Z Gd7d�de �Z!Gd8d	�d	e �Z"Gd9d�de"�Z#Gd:d
�d
e e$�Z%Gd;d�de"�Z&Gd<d�de"e$�Z'Gd=d�de �Z(Gd>d�de"�Z)Gd?d�de �Z*Gd@d
�d
e �Z+GdAd�de(e*�Z,GdBd�de(e*e+�Z-GdCd�de e.�Z/e!e%e(e,e*e-e"e+e/g	Z0e#e"e&e"e'e"e)e"iZ1eeeeeeeefZ2d)d*l3Z3e3�4dD�Z5dEd�Z6dFd�Z7[3d�dGd�Z8GdHd�de9�Z:d�dJdK�Z;e	j<�=e:�GdLdM�dMe9�Z>GdNd�de9�Z?GdOdP�dPe9�Z@d�dQdR�ZAeBjCZDdSdT�ZEdUdV�ZFdWdX�ZGdYdZ�ZHd�d\d]�ZId^d_�ZJd`da�ZKGdbdc�dce9�ZLeL�jMZNd�ddde�ZOdfdg�ZPdhdi�ZQdjdkdldmdndodpdqdrds�	fdtdu�ZRd�dvdw�ZSd�dxdy�ZTe?dzee%e,e"ggd{d|d5d)d}�ZUe?d~ee%e,e"e!e-ggd�ZVe?d~eggd�ZWd)d*lXZXeX�Yd�eXjZeXj[B�j\Z]eX�Yd��j\Z^eX�Yd��j\Z_eX�Yd�eXjZeXj`B�Za[Xzd)d*lbZcWnek
�rYnXd�d�d��Zdd�d��Zed�d��Zfd�d�d��Zgd�d��Zhd�d��Zie:d��Zje:d��Zke:d��Zle:d)�Zme:d5�Zne:d��ZoejekfZpe
jqjrZse
jqjtZue
jqjvZwexdqesd�es�Zy[
d*S)�a�	
This is an implementation of decimal floating point arithmetic based on
the General Decimal Arithmetic Specification:

    http://speleotrove.com/decimal/decarith.html

and IEEE standard 854-1987:

    http://en.wikipedia.org/wiki/IEEE_854-1987

Decimal floating point has finite precision with arbitrarily large bounds.

The purpose of this module is to support arithmetic using familiar
"schoolhouse" rules and to avoid some of the tricky representation
issues associated with binary floating point.  The package is especially
useful for financial applications or for contexts where users have
expectations that are at odds with binary floating point (for instance,
in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead
of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected
Decimal('0.00')).

Here are some examples of using the decimal module:

>>> from decimal import *
>>> setcontext(ExtendedContext)
>>> Decimal(0)
Decimal('0')
>>> Decimal('1')
Decimal('1')
>>> Decimal('-.0123')
Decimal('-0.0123')
>>> Decimal(123456)
Decimal('123456')
>>> Decimal('123.45e12345678')
Decimal('1.2345E+12345680')
>>> Decimal('1.33') + Decimal('1.27')
Decimal('2.60')
>>> Decimal('12.34') + Decimal('3.87') - Decimal('18.41')
Decimal('-2.20')
>>> dig = Decimal(1)
>>> print(dig / Decimal(3))
0.333333333
>>> getcontext().prec = 18
>>> print(dig / Decimal(3))
0.333333333333333333
>>> print(dig.sqrt())
1
>>> print(Decimal(3).sqrt())
1.73205080756887729
>>> print(Decimal(3) ** 123)
4.85192780976896427E+58
>>> inf = Decimal(1) / Decimal(0)
>>> print(inf)
Infinity
>>> neginf = Decimal(-1) / Decimal(0)
>>> print(neginf)
-Infinity
>>> print(neginf + inf)
NaN
>>> print(neginf * inf)
-Infinity
>>> print(dig / 0)
Infinity
>>> getcontext().traps[DivisionByZero] = 1
>>> print(dig / 0)
Traceback (most recent call last):
  ...
  ...
  ...
decimal.DivisionByZero: x / 0
>>> c = Context()
>>> c.traps[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.divide(Decimal(0), Decimal(0))
Decimal('NaN')
>>> c.traps[InvalidOperation] = 1
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> print(c.divide(Decimal(0), Decimal(0)))
Traceback (most recent call last):
  ...
  ...
  ...
decimal.InvalidOperation: 0 / 0
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> c.traps[InvalidOperation] = 0
>>> print(c.divide(Decimal(0), Decimal(0)))
NaN
>>> print(c.flags[InvalidOperation])
1
>>>
�Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�HAVE_THREADS�HAVE_CONTEXTVARZdecimalz1.70z2.4.2�N)�
namedtuplezsign digits exponentcGs|S�N�)�argsr)r)�"/usr/lib64/python3.8/_pydecimal.py�<lambda>��r,Tl����l��N�Zol������N�Zoi@�Ti����c@seZdZdZdd�ZdS)ra1Base exception class.

    Used exceptions derive from this.
    If an exception derives from another exception besides this (such as
    Underflow (Inexact, Rounded, Subnormal) that indicates that it is only
    called if the others are present.  This isn't actually used for
    anything, though.

    handle  -- Called when context._raise_error is called and the
               trap_enabler is not set.  First argument is self, second is the
               context.  More arguments can be given, those being after
               the explanation in _raise_error (For example,
               context._raise_error(NewError, '(-x)!', self._sign) would
               call NewError().handle(context, self._sign).)

    To define a new exception, it should be sufficient to have it derive
    from DecimalException.
    cGsdSr(r)��self�contextr*r)r)r+�handle�szDecimalException.handleN��__name__�
__module__�__qualname__�__doc__r2r)r)r)r+r�sc@seZdZdZdS)ra)Exponent of a 0 changed to fit bounds.

    This occurs and signals clamped if the exponent of a result has been
    altered in order to fit the constraints of a specific concrete
    representation.  This may occur when the exponent of a zero result would
    be outside the bounds of a representation, or when a large normal
    number would have an encoded exponent that cannot be represented.  In
    this latter case, the exponent is reduced to fit and the corresponding
    number of zero digits are appended to the coefficient ("fold-down").
    N�r4r5r6r7r)r)r)r+r�sc@seZdZdZdd�ZdS)r	a0An invalid operation was performed.

    Various bad things cause this:

    Something creates a signaling NaN
    -INF + INF
    0 * (+-)INF
    (+-)INF / (+-)INF
    x % 0
    (+-)INF % x
    x._rescale( non-integer )
    sqrt(-x) , x > 0
    0 ** 0
    x ** (non-integer)
    x ** (+-)INF
    An operand is invalid

    The result of the operation after these is a quiet positive NaN,
    except when the cause is a signaling NaN, in which case the result is
    also a quiet NaN, but with the original sign, and an optional
    diagnostic information.
    cGs,|r(t|dj|djdd�}|�|�StS)Nr&�nT)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r0r1r*�ansr)r)r+r2�s
zInvalidOperation.handleNr3r)r)r)r+r	�sc@seZdZdZdd�ZdS)rz�Trying to convert badly formed string.

    This occurs and signals invalid-operation if a string is being
    converted to a number and it does not conform to the numeric string
    syntax.  The result is [0,qNaN].
    cGstSr(�r>r/r)r)r+r2szConversionSyntax.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)r
a�Division by 0.

    This occurs and signals division-by-zero if division of a finite number
    by zero was attempted (during a divide-integer or divide operation, or a
    power operation with negative right-hand operand), and the dividend was
    not zero.

    The result of the operation is [sign,inf], where sign is the exclusive
    or of the signs of the operands for divide, or is 1 for an odd power of
    -0, for power.
    cGst|Sr()�_SignedInfinity�r0r1�signr*r)r)r+r2szDivisionByZero.handleNr3r)r)r)r+r

sc@seZdZdZdd�ZdS)rz�Cannot perform the division adequately.

    This occurs and signals invalid-operation if the integer result of a
    divide-integer or remainder operation had too many digits (would be
    longer than precision).  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2"szDivisionImpossible.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)rz�Undefined result of division.

    This occurs and signals invalid-operation if division by zero was
    attempted (during a divide-integer, divide, or remainder operation), and
    the dividend is also zero.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2-szDivisionUndefined.handleNr3r)r)r)r+r%sc@seZdZdZdS)ra�Had to round, losing information.

    This occurs and signals inexact whenever the result of an operation is
    not exact (that is, it needed to be rounded and any discarded digits
    were non-zero), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The inexact signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) was inexact.
    Nr8r)r)r)r+r0sc@seZdZdZdd�ZdS)ra�Invalid context.  Unknown rounding, for example.

    This occurs and signals invalid-operation if an invalid context was
    detected during an operation.  This can occur if contexts are not checked
    on creation and either the precision exceeds the capability of the
    underlying concrete representation or an unknown or unsupported rounding
    was specified.  These aspects of the context need only be checked when
    the values are required to be used.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2GszInvalidContext.handleNr3r)r)r)r+r<s
c@seZdZdZdS)ra�Number got rounded (not  necessarily changed during rounding).

    This occurs and signals rounded whenever the result of an operation is
    rounded (that is, some zero or non-zero digits were discarded from the
    coefficient), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The rounded signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) caused a loss of precision.
    Nr8r)r)r)r+rJsc@seZdZdZdS)r
a�Exponent < Emin before rounding.

    This occurs and signals subnormal whenever the result of a conversion or
    operation is subnormal (that is, its adjusted exponent is less than
    Emin, before any rounding).  The result in all cases is unchanged.

    The subnormal signal may be tested (or trapped) to determine if a given
    or operation (or sequence of operations) yielded a subnormal result.
    Nr8r)r)r)r+r
Vsc@seZdZdZdd�ZdS)raNumerical overflow.

    This occurs and signals overflow if the adjusted exponent of a result
    (from a conversion or from an operation that is not an attempt to divide
    by zero), after rounding, would be greater than the largest value that
    can be handled by the implementation (the value Emax).

    The result depends on the rounding mode:

    For round-half-up and round-half-even (and for round-half-down and
    round-up, if implemented), the result of the operation is [sign,inf],
    where sign is the sign of the intermediate result.  For round-down, the
    result is the largest finite number that can be represented in the
    current precision, with the sign of the intermediate result.  For
    round-ceiling, the result is the same as for round-down if the sign of
    the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
    the result is the same as for round-down if the sign of the intermediate
    result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
    will also be raised.
    cGs�|jttttfkrt|S|dkrR|jtkr4t|St|d|j|j	|jd�S|dkr�|jt
krlt|St|d|j|j	|jd�SdS)Nr&�9r.)�roundingrrrrrArr:�prec�EmaxrrBr)r)r+r2ws"�
�
�zOverflow.handleNr3r)r)r)r+rasc@seZdZdZdS)raxNumerical underflow with result rounded to 0.

    This occurs and signals underflow if a result is inexact and the
    adjusted exponent of the result would be smaller (more negative) than
    the smallest value that can be handled by the implementation (the value
    Emin).  That is, the result is both inexact and subnormal.

    The result after an underflow will be a subnormal number rounded, if
    necessary, so that its exponent is not less than Etiny.  This may result
    in 0 with the sign of the intermediate result and an exponent of Etiny.

    In all cases, Inexact, Rounded, and Subnormal will also be raised.
    Nr8r)r)r)r+r�sc@seZdZdZdS)ra�Enable stricter semantics for mixing floats and Decimals.

    If the signal is not trapped (default), mixing floats and Decimals is
    permitted in the Decimal() constructor, context.create_decimal() and
    all comparison operators. Both conversion and comparisons are exact.
    Any occurrence of a mixed operation is silently recorded by setting
    FloatOperation in the context flags.  Explicit conversions with
    Decimal.from_float() or context.create_decimal_from_float() do not
    set the flag.

    Otherwise (the signal is trapped), only equality comparisons and explicit
    conversions are silent. All other mixed operations raise FloatOperation.
    Nr8r)r)r)r+r�sZdecimal_contextcCs8z
t��WStk
r2t�}t�|�|YSXdS)z�Returns this thread's context.

    If this thread does not yet have a context, returns
    a new context and sets this thread's context.
    New contexts are copies of DefaultContext.
    N)�_current_context_var�get�LookupErrorr�set�r1r)r)r+r�s

cCs,|tttfkr|��}|��t�|�dS)z%Set this thread's context to context.N)rrr�copy�clear_flagsrHrKrLr)r)r+r�scCs|dkrt�}t|�S)abReturn a context manager for a copy of the supplied context

    Uses a copy of the current context if no context is specified
    The returned context manager creates a local decimal context
    in a with statement:
        def sin(x):
             with localcontext() as ctx:
                 ctx.prec += 2
                 # Rest of sin calculation algorithm
                 # uses a precision 2 greater than normal
             return +s  # Convert result to normal precision

         def sin(x):
             with localcontext(ExtendedContext):
                 # Rest of sin calculation algorithm
                 # uses the Extended Context from the
                 # General Decimal Arithmetic Specification
             return +s  # Convert result to normal context

    >>> setcontext(DefaultContext)
    >>> print(getcontext().prec)
    28
    >>> with localcontext():
    ...     ctx = getcontext()
    ...     ctx.prec += 2
    ...     print(ctx.prec)
    ...
    30
    >>> with localcontext(ExtendedContext):
    ...     print(getcontext().prec)
    ...
    9
    >>> print(getcontext().prec)
    28
    N)r�_ContextManager)Zctxr)r)r+r�s$c
@s�eZdZdZdZd�dd�Zedd��Zd	d
�Zdd�Z	d�d
d�Z
dd�Zdd�Zdd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd�d*d+�Zd�d,d-�Zd�d.d/�Zd�d0d1�Zd�d3d4�Zd�d5d6�ZeZ�dd7d8�Z�dd9d:�Z �dd;d<�Z!e!Z"�dd=d>�Z#d?d@�Z$�ddAdB�Z%�ddCdD�Z&�ddEdF�Z'�ddGdH�Z(�ddIdJ�Z)�d	dKdL�Z*�d
dMdN�Z+�ddOdP�Z,dQdR�Z-dSdT�Z.e.Z/e0dUdV��Z1e0dWdX��Z2dYdZ�Z3d[d\�Z4d]d^�Z5d_d`�Z6dadb�Z7dcdd�Z8dedf�Z9dgdh�Z:didj�Z;dkdl�Z<dmdn�Z=dodp�Z>e?e7e8e9e:e;e<e=e>dq�Z@�ddrds�ZAdtdu�ZBdvdw�ZC�d
dxdy�ZD�ddzd{�ZEd|d}�ZF�dd~d�ZG�dd�d��ZH�dd�d��ZI�dd�d��ZJ�dd�d��ZKd�d��ZLd�d��ZM�dd�d��ZN�dd�d��ZOeOZP�dd�d��ZQ�dd�d��ZR�dd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZW�dd�d��ZX�dd�d��ZY�dd�d��ZZd�d��Z[d�d��Z\�dd�d��Z]�dd�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zb�dd�d��Zcd�d��Zdd�d��Zed�d��Zf�dd�d��Zgd�d��Zhd�d��Zi�d d�dÄZjd�dńZk�d!d�dDŽZl�d"d�dɄZmd�d˄Znd�d̈́Zo�d#d�dτZp�d$d�dфZq�d%d�dӄZr�d&d�dՄZs�d'd�dׄZt�d(d�dلZu�d)d�dۄZv�d*d�d݄Zw�d+d�d߄Zx�d,d�d�Zyd�d�Zz�d-d�d�Z{�d.d�d�Z|�d/d�d�Z}d�d�Z~d�d�Zd�d�Z��d0d�d�Z�dS(1rz,Floating point class for decimal arithmetic.)�_expr<r;�_is_special�0NcCs�t�|�}t|t��r$t|���dd��}|dkrP|dkr@t�}|�t	d|�S|�
d�dkrfd|_nd|_|�
d	�}|dk	r�|�
d
�p�d}t|�
d�p�d�}tt||��|_
|t|�|_d
|_nZ|�
d�}|dk	�rtt|p�d���d�|_
|�
d��rd|_nd|_nd|_
d|_d|_|St|t��rf|dk�rBd|_nd|_d|_tt|��|_
d
|_|St|t��r�|j|_|j|_|j
|_
|j|_|St|t��r�|j|_t|j�|_
t|j�|_d
|_|St|ttf��r"t|�dk�r�td��t|dt��r|ddk�std��|d|_|ddk�rHd|_
|d|_d|_n�g}	|dD]R}
t|
t��r�d|
k�r|dk�r�nn|	�s�|
dk�r�|	�|
�ntd���qT|ddk�r�d�tt|	��|_
|d|_d|_nDt|dt��rd�tt|	�p�dg��|_
|d|_d
|_ntd��|St|t��rx|dk�r>t�}|�td�t�|�}|j|_|j|_|j
|_
|j|_|St d|��dS)a�Create a decimal point instance.

        >>> Decimal('3.14')              # string input
        Decimal('3.14')
        >>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
        Decimal('3.14')
        >>> Decimal(314)                 # int
        Decimal('314')
        >>> Decimal(Decimal(314))        # another decimal instance
        Decimal('314')
        >>> Decimal('  3.14  \n')        # leading and trailing whitespace okay
        Decimal('3.14')
        �_�NzInvalid literal for Decimal: %rrC�-r.r&�intZfrac�exprRF�diag�signal�Nr9�FT�ztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.�r&r.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.��	zTThe second value in the tuple must be composed of integers in the range 0 through 9.�r9rZzUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabledzCannot convert %r to Decimal)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�groupr;rVr<�lenrPrQ�lstrip�absr�_WorkReprCrW�list�tuple�
ValueError�append�join�map�floatr�
from_float�	TypeError)�cls�valuer1r0�m�intpart�fracpartrWrX�digitsZdigitr)r)r+rc
s�
�





(


�
zDecimal.__new__cCs�t|t�r,|dkrdnd}d}tt|��}nzt|t�r�t�|�sJt�|�rV|t|��St�	d|�dkrld}nd}t|��
�\}}|��d}t|d|�}ntd��t
|||�}|tkr�|S||�SdS)a.Converts a float to a decimal number, exactly.

        Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
        Since 0.1 is not exactly representable in binary floating point, the
        value is stored as the nearest representable value which is
        0x1.999999999999ap-4.  The exact equivalent of the value in decimal
        is 0.1000000000000000055511151231257827021181583404541015625.

        >>> Decimal.from_float(0.1)
        Decimal('0.1000000000000000055511151231257827021181583404541015625')
        >>> Decimal.from_float(float('nan'))
        Decimal('NaN')
        >>> Decimal.from_float(float('inf'))
        Decimal('Infinity')
        >>> Decimal.from_float(-float('inf'))
        Decimal('-Infinity')
        >>> Decimal.from_float(-0.0)
        Decimal('-0')

        r&r.g�?�zargument must be int or float.N)rdrVrermru�_mathZisinfZisnan�reprZcopysign�as_integer_ratio�
bit_lengthrwr:r)rx�frC�k�coeffr9�d�resultr)r)r+rv�s$

zDecimal.from_floatcCs(|jr$|j}|dkrdS|dkr$dSdS)zrReturns whether the number is not actually one.

        0 if a number
        1 if NaN
        2 if sNaN
        r9r.rZr^r&)rQrP)r0rWr)r)r+�_isnan�szDecimal._isnancCs|jdkr|jrdSdSdS)zyReturns whether the number is infinite

        0 if finite or not a number
        1 if +INF
        -1 if -INF
        r[���r.r&)rPr;�r0r)r)r+�_isinfinity�s

zDecimal._isinfinitycCs||��}|dkrd}n|��}|s&|rx|dkr4t�}|dkrJ|�td|�S|dkr`|�td|�S|rn|�|�S|�|�SdS)z�Returns whether the number is not actually one.

        if self, other are sNaN, signal
        if self, other are NaN return nan
        return 0

        Done before operations.
        NFr^�sNaNr&)r�rrir	r=)r0�otherr1�self_is_nan�other_is_nanr)r)r+�_check_nans�s&
��

zDecimal._check_nanscCsv|dkrt�}|js|jrr|��r0|�td|�S|��rF|�td|�S|��r\|�td|�S|��rr|�td|�SdS)aCVersion of _check_nans used for the signaling comparisons
        compare_signal, __le__, __lt__, __ge__, __gt__.

        Signal InvalidOperation if either self or other is a (quiet
        or signaling) NaN.  Signaling NaNs take precedence over quiet
        NaNs.

        Return 0 if neither operand is a NaN.

        Nzcomparison involving sNaNzcomparison involving NaNr&)rrQ�is_snanrir	�is_qnan�r0r�r1r)r)r+�_compare_check_nans	s0����zDecimal._compare_check_nanscCs|jp|jdkS)zuReturn True if self is nonzero; otherwise return False.

        NaNs and infinities are considered nonzero.
        rR�rQr<r�r)r)r+�__bool__*szDecimal.__bool__cCs|js|jr8|��}|��}||kr(dS||kr4dSdS|sP|sDdSd|jS|s^d|jS|j|jkrndS|j|jkr~dS|��}|��}||kr�|jd|j|j}|jd|j|j}||kr�dS||kr�d|jSd|jSn ||k�rd|jSd|jSdS)z�Compare the two non-NaN decimal instances self and other.

        Returns -1 if self < other, 0 if self == other and 1
        if self > other.  This routine is for internal use only.r&r�r.rRN)rQr�r;�adjustedr<rP)r0r�Zself_infZ	other_inf�
self_adjustedZother_adjusted�self_paddedZother_paddedr)r)r+�_cmp1s>


zDecimal._cmpcCs<t||dd�\}}|tkr|S|�||�r.dS|�|�dkS)NT)�equality_opFr&)�_convert_for_comparison�NotImplementedr�r�r�r)r)r+�__eq__qszDecimal.__eq__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkS�NFr&�r�r�r�r��r0r�r1r?r)r)r+�__lt__yszDecimal.__lt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__le__�szDecimal.__le__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__gt__�szDecimal.__gt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__ge__�szDecimal.__ge__cCs>t|dd�}|js|r0|jr0|�||�}|r0|St|�|��S)z�Compare self to other.  Return a decimal value:

        a or b is a NaN ==> Decimal('NaN')
        a < b           ==> Decimal('-1')
        a == b          ==> Decimal('0')
        a > b           ==> Decimal('1')
        T��raiseit)�_convert_otherrQr�rr�r�r)r)r+�compare�szDecimal.comparecCs�|jr4|��rtd��n|��r$tS|jr0tStS|jdkrNtd|jt	�}ntt
|jt	�}t|j�|t	}|dkr||n|}|dkr�dS|S)zx.__hash__() <==> hash(x)z"Cannot hash a signaling NaN value.r&�
r����)
rQr�rw�is_nan�_PyHASH_NANr;�_PyHASH_INFrP�pow�_PyHASH_MODULUS�
_PyHASH_10INVrVr<)r0Zexp_hashZhash_r?r)r)r+�__hash__�s

zDecimal.__hash__cCst|jttt|j��|j�S)zeRepresents the number as a triple tuple.

        To show the internals exactly as they are.
        )rr;rprtrVr<rPr�r)r)r+�as_tuple�szDecimal.as_tuplecCs�|jr |��rtd��ntd��|s(dSt|j�}|jdkrR|d|jd}}nn|j}|dkr�|ddkr�|d}|d8}qZ|j}t||@��d|�}|r�||L}||8}d||>}|j	r�|}||fS)a�Express a finite Decimal instance in the form n / d.

        Returns a pair (n, d) of integers.  When called on an infinity
        or NaN, raises OverflowError or ValueError respectively.

        >>> Decimal('3.14').as_integer_ratio()
        (157, 50)
        >>> Decimal('-123e5').as_integer_ratio()
        (-12300000, 1)
        >>> Decimal('0.00').as_integer_ratio()
        (0, 1)

        z#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior]r&r�r.r~)
rQr�rq�
OverflowErrorrVr<rP�minr�r;)r0r9r�Zd5Zd2Zshift2r)r)r+r��s,



zDecimal.as_integer_ratiocCsdt|�S)z0Represents the number as an instance of Decimal.z
Decimal('%s'))rer�r)r)r+�__repr__szDecimal.__repr__Fc	Csbddg|j}|jrL|jdkr&|dS|jdkr>|d|jS|d|jS|jt|j�}|jdkrt|d	krt|}n6|s~d
}n,|jdkr�|d
dd
}n|d
dd
}|dkr�d}d
d||j}nL|t|j�kr�|jd|t|j�}d}n |jd|�}d
|j|d�}||k�r(d}n*|dk�r8t�}ddg|jd||}||||S)z�Return string representation of the number in scientific notation.

        Captures all of the information in the underlying representation.
        rTrUr[ZInfinityr9�NaNr�r&���r.rRr\�.N�e�Ez%+d)r;rQrPr<rkr�capitals)	r0�engr1rC�
leftdigits�dotplacer{r|rWr)r)r+�__str__s:




zDecimal.__str__cCs|jd|d�S)a,Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.
        T)r�r1)r��r0r1r)r)r+�
to_eng_string;szDecimal.to_eng_stringcCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}n|��}|�|�S)zRReturns a copy with the sign switched.

        Rounds, if it has reason.
        rLN)rQr�rrEr�copy_abs�copy_negate�_fix�r0r1r?r)r)r+�__neg__Ds
zDecimal.__neg__cCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}nt|�}|�|�S)zhReturns a copy, unless it is a sNaN.

        Rounds the number (if more than precision digits)
        rLN)rQr�rrErr�rr�r�r)r)r+�__pos__Zs
zDecimal.__pos__TcCsJ|s|��S|jr&|j|d�}|r&|S|jr:|j|d�}n|j|d�}|S)z�Returns the absolute value of self.

        If the keyword argument 'round' is false, do not round.  The
        expression self.__abs__(round=False) is equivalent to
        self.copy_abs().
        rL)r�rQr�r;r�r�)r0�roundr1r?r)r)r+�__abs__oszDecimal.__abs__c
Csht|�}|tkr|S|dkr"t�}|js.|jr�|�||�}|rB|S|��rr|j|jkrj|��rj|�td�St	|�S|��r�t	|�St
|j|j�}d}|jt
kr�|j|jkr�d}|s�|s�t
|j|j�}|r�d}t|d|�}|�|�}|S|�st||j|jd�}|�||j�}|�|�}|S|�sVt||j|jd�}|�||j�}|�|�}|St|�}t|�}t|||j�\}}t�}	|j|jk�r�|j|jk�r�t|d|�}|�|�}|S|j|jk�r�||}}|jdk�r�d|	_|j|j|_|_nd|	_n&|jdk�rd|	_d\|_|_nd|	_|jdk�r<|j|j|	_n|j|j|	_|j|	_t	|	�}|�|�}|S)zbReturns self + other.

        -INF + INF (or the reverse) cause InvalidOperation errors.
        Nz
-INF + INFr&r.rR)r&r&)r�r�rrQr�r�r;rir	rr�rPrErr:r��maxrF�_rescalern�
_normalizerCrVrW)
r0r�r1r?rWZnegativezerorC�op1�op2r�r)r)r+�__add__�s|





zDecimal.__add__cCsHt|�}|tkr|S|js |jr6|j||d�}|r6|S|j|��|d�S)zReturn self - otherrL)r�r�rQr�r�r�r�r)r)r+�__sub__�szDecimal.__sub__cCs"t|�}|tkr|S|j||d�S)zReturn other - selfrL)r�r�r�r�r)r)r+�__rsub__�szDecimal.__rsub__cCs@t|�}|tkr|S|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rn|sf|�td�St	|S|��r�|s�|�td�St	|S|j
|j
}|r�|s�t|d|�}|�|�}|S|j
dkr�t||j
|�}|�|�}|S|j
dk�r
t||j
|�}|�|�}|St|�}t|�}t|t|j|j�|�}|�|�}|S)z\Return self * other.

        (+-) INF * 0 (or its reverse) raise InvalidOperation.
        Nz(+-)INF * 0z0 * (+-)INFrR�1)r�r�rr;rQr�r�rir	rArPr:r�r<rnrerV)r0r�r1Z
resultsignr?Z	resultexpr�r�r)r)r+�__mul__�sH




zDecimal.__mul__cCs�t|�}|tkrtS|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rj|��rj|�td�S|��rzt	|S|��r�|�t
d�t|d|���S|s�|s�|�t
d�S|�td|�S|s�|j|j}d}n�t|j�t|j�|jd}|j|j|}t|�}t|�}	|dk�r:t|jd	||	j�\}}
nt|j|	jd	|�\}}
|
�rt|d
dk�r�|d7}n8|j|j}||k�r�|d	dk�r�|d	}|d7}�q�t|t|�|�}|�|�S)zReturn self / other.Nz(+-)INF/(+-)INFzDivision by infinityrRz0 / 0zx / 0r&r.r�r~)r�r�rr;rQr�r�rir	rArr:�Etinyrr
rPrkr<rFrn�divmodrVrer�)r0r�r1rCr?rWr��shiftr�r��	remainder�	ideal_expr)r)r+�__truediv__,sP

zDecimal.__truediv__cCs|j|jA}|��r|j}nt|j|j�}|��|��}|rN|��sN|dkrht|dd�|�||j�fS||jk�r
t	|�}t	|�}|j
|j
kr�|jd|j
|j
9_n|jd|j
|j
9_t|j|j�\}}	|d|jk�r
t|t
|�d�t|jt
|	�|�fS|�td�}
|
|
fS)z�Return (self // other, self % other), to context.prec precision.

        Assumes that neither self nor other is a NaN, that self is not
        infinite and that other is nonzero.
        r�rRr&r�z%quotient too large in //, % or divmod)r;r�rPr�r�r:r�rErFrnrWrVr�rerir)r0r�r1rCr��expdiffr�r��q�rr?r)r)r+�_dividegs0
���zDecimal._dividecCs"t|�}|tkr|S|j||d�S)z)Swaps self/other and returns __truediv__.rL)r�r�r�r�r)r)r+�__rtruediv__�szDecimal.__rtruediv__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r:||fS|j|jA}|��r~|��rj|�td�}||fSt||�td�fS|s�|s�|�t	d�}||fS|�t
d|�|�td�fS|�||�\}}|�|�}||fS)z6
        Return (self // other, self % other)
        Nzdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
r�r�rr�r;r�rir	rArr
r�r�)r0r�r1r?rCZquotientr�r)r)r+�
__divmod__�s4
�
�
zDecimal.__divmod__cCs"t|�}|tkr|S|j||d�S)z(Swaps self/other and returns __divmod__.rL)r�r�r�r�r)r)r+�__rdivmod__�szDecimal.__rdivmod__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rJ|�td�S|sj|r^|�td�S|�td�S|�||�d}|�	|�}|S)z
        self % other
        Nr�r�z0 % 0r.)
r�r�rr�r�rir	rr�r�)r0r�r1r?r�r)r)r+�__mod__�s"
zDecimal.__mod__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __mod__.rL)r�r�r�r�r)r)r+�__rmod__�szDecimal.__rmod__cCs�|dkrt�}t|dd�}|�||�}|r.|S|��rB|�td�S|sb|rV|�td�S|�td�S|��r|t|�}|�|�St	|j
|j
�}|s�t|jd|�}|�|�S|�
�|�
�}||jdkr�|�t�S|d	kr�|�||j�}|�|�St|�}t|�}|j|jk�r(|jd
|j|j9_n|jd
|j|j9_t|j|j�\}}	d|	|d@|jk�r~|	|j8}	|d7}|d
|jk�r�|�t�S|j}
|	dk�r�d|
}
|	}	t|
t|	�|�}|�|�S)
zI
        Remainder nearest to 0-  abs(remainder-near) <= other/2
        NTr�zremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)rRr.r�r�r^r&)rr�r�r�rir	rrr�r�rPr:r;r�rFrr�rErnrWrVr�re)r0r�r1r?�ideal_exponentr�r�r�r�r�rCr)r)r+�remainder_near�s`���






zDecimal.remainder_nearcCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rb|��rR|�td�St|j|jAS|s�|r�|�t	d|j|jA�S|�t
d�S|�||�dS)z
self // otherNz
INF // INFr�z0 // 0r&)r�r�rr�r�rir	rAr;r
rr�r�r)r)r+�__floordiv__'s&
�zDecimal.__floordiv__cCs"t|�}|tkr|S|j||d�S)z*Swaps self/other and returns __floordiv__.rL)r�r�r�r�r)r)r+�
__rfloordiv__CszDecimal.__rfloordiv__cCs8|��r(|��rtd��|jr"dnd}nt|�}t|�S)zFloat representation.z%Cannot convert signaling NaN to floatz-nan�nan)r�r�rqr;reru�r0�sr)r)r+�	__float__JszDecimal.__float__cCst|jr(|��rtd��n|��r(td��d|j}|jdkrT|t|j�d|jS|t|jd|j�pjd�SdS)z1Converts self to an int, truncating if necessary.zCannot convert NaN to integerz"Cannot convert infinity to integerr�r&r�NrR)	rQr�rqr�r�r;rPrVr<r�r)r)r+�__int__Ts


zDecimal.__int__cCs|Sr(r)r�r)r)r+�realcszDecimal.realcCstd�S)Nr&�rr�r)r)r+�imaggszDecimal.imagcCs|Sr(r)r�r)r)r+�	conjugatekszDecimal.conjugatecCstt|��Sr()�complexrur�r)r)r+�__complex__nszDecimal.__complex__cCsR|j}|j|j}t|�|krJ|t|�|d��d�}t|j||jd�St|�S)z2Decapitate the payload of a NaN to fit the contextNrRT)	r<rF�clamprkrlr:r;rPr)r0r1ZpayloadZmax_payload_lenr)r)r+r=qszDecimal._fix_nancCsX|jr |��r|�|�St|�S|��}|��}|s�|j|g|j}tt	|j
|�|�}||j
krx|�t�t
|jd|�St|�St|j�|j
|j}||kr�|�td|j�}|�t�|�t�|S||k}|r�|}|j
|k�r�t|j�|j
|}	|	dk�rt
|jd|d�}d}	|j|j}
|
||	�}|jd|	��p>d}|dk�r~tt|�d�}t|�|jk�r~|dd�}|d7}||k�r�|�td|j�}nt
|j||�}|�r�|�r�|�t�|�r�|�t�|�r�|�t�|�t�|�s�|�t�|S|�r|�t�|jdk�rP|j
|k�rP|�t�|jd|j
|}
t
|j|
|�St|�S)z�Round if it is necessary to keep self within prec precision.

        Rounds and fixes the exponent.  Does not raise on a sNaN.

        Arguments:
        self - Decimal instance
        context - context used.
        rR�
above Emaxr&r�r.Nr�)rQr�r=rr��EtoprGr�r�r�rPrirr:r;rkr<rFrrr�_pick_rounding_functionrErerVrr
)r0r1r�r��exp_maxZnew_expZexp_minr?Zself_is_subnormalr}Zrounding_method�changedr�r�r)r)r+r�}sn
















zDecimal._fixcCst|j|�rdSdSdS)z(Also known as round-towards-0, truncate.r&r�N)�
_all_zerosr<�r0rFr)r)r+�_round_down�szDecimal._round_downcCs|�|�S)zRounds away from 0.)r�r�r)r)r+�	_round_up�szDecimal._round_upcCs*|j|dkrdSt|j|�r"dSdSdS)zRounds 5 up (away from 0)Z56789r.r&r�N)r<r�r�r)r)r+�_round_half_up�s
zDecimal._round_half_upcCst|j|�rdS|�|�SdS)zRound 5 downr�N��_exact_halfr<rr�r)r)r+�_round_half_down�szDecimal._round_half_downcCs8t|j|�r*|dks&|j|ddkr*dS|�|�SdS)z!Round 5 to even, rest to nearest.r&r.�02468r�Nrr�r)r)r+�_round_half_even�s��zDecimal._round_half_evencCs |jr|�|�S|�|�SdS)z(Rounds up (not away from 0 if negative.)N�r;r�r�r)r)r+�_round_ceilings
zDecimal._round_ceilingcCs |js|�|�S|�|�SdS)z'Rounds down (not towards 0 if negative)Nrr�r)r)r+�_round_floor
s
zDecimal._round_floorcCs0|r |j|ddkr |�|�S|�|�SdS)z)Round down unless digit prec-1 is 0 or 5.r.Z05N)r<r�r�r)r)r+�_round_05ups
zDecimal._round_05up)rrrrrrrrcCsb|dk	r2t|t�std��tdd|�}|�|�S|jrR|��rJtd��ntd��t|�	dt
��S)a�Round self to the nearest integer, or to a given precision.

        If only one argument is supplied, round a finite Decimal
        instance self to the nearest integer.  If self is infinite or
        a NaN then a Python exception is raised.  If self is finite
        and lies exactly halfway between two integers then it is
        rounded to the integer with even last digit.

        >>> round(Decimal('123.456'))
        123
        >>> round(Decimal('-456.789'))
        -457
        >>> round(Decimal('-3.0'))
        -3
        >>> round(Decimal('2.5'))
        2
        >>> round(Decimal('3.5'))
        4
        >>> round(Decimal('Inf'))
        Traceback (most recent call last):
          ...
        OverflowError: cannot round an infinity
        >>> round(Decimal('NaN'))
        Traceback (most recent call last):
          ...
        ValueError: cannot round a NaN

        If a second argument n is supplied, self is rounded to n
        decimal places using the rounding mode for the current
        context.

        For an integer n, round(self, -n) is exactly equivalent to
        self.quantize(Decimal('1En')).

        >>> round(Decimal('123.456'), 0)
        Decimal('123')
        >>> round(Decimal('123.456'), 2)
        Decimal('123.46')
        >>> round(Decimal('123.456'), -2)
        Decimal('1E+2')
        >>> round(Decimal('-Infinity'), 37)
        Decimal('NaN')
        >>> round(Decimal('sNaN123'), 0)
        Decimal('NaN123')

        Nz+Second argument to round should be integralr&r��cannot round a NaN�cannot round an infinity)rdrVrwr:�quantizerQr�rqr�r�r)r0r9rWr)r)r+�	__round__&s/


zDecimal.__round__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the floor of self, as an integer.

        For a finite Decimal instance self, return the greatest
        integer n such that n <= self.  If self is infinite or a NaN
        then a Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�	__floor__ds

zDecimal.__floor__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the ceiling of self, as an integer.

        For a finite Decimal instance self, return the least integer n
        such that n >= self.  If self is infinite or a NaN then a
        Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�__ceil__ss

zDecimal.__ceil__cCst|dd�}t|dd�}|js$|jr�|dkr2t�}|jdkrJ|�td|�S|jdkrb|�td|�S|jdkrr|}nf|jdkr�|}nV|jdkr�|s�|�td�St|j|jA}n*|jdkr�|s�|�td	�St|j|jA}n0t|j|jAt	t
|j�t
|j��|j|j�}|�||�S)
a:Fused multiply-add.

        Returns self*other+third with no rounding of the intermediate
        product self*other.

        self and other are multiplied together, with no rounding of
        the result.  The third operand is then added to the result,
        and a single final rounding is performed.
        Tr�NrZr�r9r[zINF * 0 in fmaz0 * INF in fma)
r�rQrrPrir	rAr;r:rerVr<r�)r0r�Zthirdr1�productr)r)r+�fma�s<




�
�
�zDecimal.fmacCs�t|�}|tkr|St|�}|tkr(|S|dkr6t�}|��}|��}|��}|sZ|sZ|r�|dkrp|�td|�S|dkr�|�td|�S|dkr�|�td|�S|r�|�|�S|r�|�|�S|�|�S|��r�|��r�|��s�|�td�S|dkr�|�td�S|�s|�td�S|��|j	k�r(|�td�S|�s@|�s@|�td	�S|�
��rPd}n|j}tt
|��}t|���}t|���}	|j
|td
|j|�|}t|	j�D]}
t|d
|�}�q�t||	j
|�}t|t|�d�S)z!Three argument version of __pow__Nr^r�z@pow() 3rd argument not allowed unless all arguments are integersr&zApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not definedr�)r�r�rr�rir	r=�
_isintegerr�rF�_isevenr;rmrVrn�to_integral_valuer�rW�ranger:re)r0r��modulor1r�r�Z
modulo_is_nanrC�base�exponent�ir)r)r+�
_power_modulo�s����


�������
zDecimal._power_modulocCs�t|�}|j|j}}|ddkr4|d}|d7}qt|�}|j|j}}|ddkrh|d}|d7}qJ|dk�r||9}|ddkr�|d}|d7}qz|dkr�dS|d|}	|jdkr�|	}	|��r�|jdkr�|jt|�}
t|	|
|d�}nd}tddd||	|�S|jdk�r�|d}|dk�r�||@|k�rBdSt	|�d}
|dd	}|t
t|��k�rpdSt|
||�}
t|||�}|
dk�s�|dk�r�dS|
|k�r�dSd
|
}n�|d
k�r�t	|�dd	}
t
d
|
|�\}}|�r�dS|d
dk�r|d
}|
d8}
�q�|dd}|t
t|��k�r6dSt|
||�}
t|||�}|
dk�sf|dk�rjdS|
|k�rxdSd
|
}ndS|d|k�r�dS|
|}tdt|�|�S|dk�r�|d|d}}n�|dk�r�t
tt||���|k�r�dSt	|�}|dk�r,t
tt|�|��|k�r,dS|d|}}|d
|d
k�r\dk�rtnn|d
}|d
}�q<|d
|d
k�r�dk�r�nn|d
}|d
}�qt|dk�rX|dk�r�||k�r�dSt
||�\}}|dk�r�dSdt	|�|>}t
|||d�\}}||k�r$�q<n||d||}�q�||k�rP|dk�sTdS|}|dk�r|||dt|�k�r|dS||}||9}|d|k�r�dSt|�}|���r�|jdk�r�|jt|�}
t||
|t
|��}nd}td|d|||�S)ahAttempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
        digits of precision.  Return None if self**other is not
        exactly representable in p digits.

        Assumes that elimination of special cases has already been
        performed: self and other must both be nonspecial; self must
        be positive and not numerically equal to 1; other must be
        nonzero.  For efficiency, other._exp should not be too large,
        so that 10**abs(other._exp) is a feasible calculation.r�r&r.Nr�rR)r^����]�Ar~�r\r^�d)rnrVrWrCrr;rPr�r:�_nbitsrkre�_decimal_lshift_exactr�rm�	_log10_lb)r0r��p�x�xc�xe�y�yc�yerr�ZzerosZ
last_digitr�Zemaxr�rzr9Zxc_bits�rem�ar�r�Zstr_xcr)r)r+�_power_exacts�:












&&$$


 zDecimal._power_exactcCs4|dk	r|�|||�St|�}|tkr*|S|dkr8t�}|�||�}|rL|S|sd|s`|�td�StSd}|jdkr�|�	�r�|�
�s�d}n|r�|�td�S|��}|s�|jdkr�t|dd�St
|S|��r�|jdkr�t
|St|dd�S|tk�r�|�	��rZ|jdk�rd}n||jk�r"|j}nt|�}|j|}|d|jk�rxd|j}|�t�n|�t�|�t�d|j}t|dd||�S|��}|���r�|jdk|dkk�r�t|dd�St
|Sd}d}	|��|��}
|dk|jdkk�r|
tt|j��k�rHt|d|jd�}n,|��}|
tt|��k�rHt|d|d�}|dk�r�|�||jd�}|dk	�r�|dk�r�td|j|j�}d	}	|dk�r8|j}t|�}
|
j|
j}}t|�}|j|j}}|jdk�r�|}d
}t||||||�\}}|ddtt|��|d�r�q(|d
7}�q�t|t|�|�}|	�r&|�	��s&t|j�|jk�r�|jdt|j�}t|j|jd||j|�}|� �}|�!�t"D]}d|j#|<�q�|�$|�}|�t�|j%t&�r�|�t'�|j%t(�r�|�t(d
|j�t't&ttt)fD]}|j%|�r|�|��qn
|�$|�}|S)aHReturn self ** other [ % modulo].

        With two arguments, compute self**other.

        With three arguments, compute (self**other) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - other must be nonnegative
         - either self or other (or both) must be nonzero
         - modulo must be nonzero and must have at most p digits,
           where p is the context precision.

        If any of these restrictions is violated the InvalidOperation
        flag is raised.

        The result of pow(self, other, modulo) is identical to the
        result that would be obtained by computing (self**other) %
        modulo with unbounded precision, but is computed more
        efficiently.  It is always exact.
        Nz0 ** 0r&r.z+x ** y with x negative and y not an integerrRr�FTr\r~r�r�)*rr�r�rr�rir	�_Oner;rrr�r:rAr�rFrVrPrrr��_log10_exp_boundrkrerGr�r.r<rnrWrC�_dpowerrMrN�_signals�trapsr��flagsr
rrr)r0r�rr1r?Zresult_signZ
multiplierrWZself_adj�exactZboundr�r%r&r'r(r)r*r+�extrar�r�Z
newcontextZ	exceptionr)r)r+�__pow__�s�
�













"�



zDecimal.__pow__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __pow__.rL)r�r�r7r�r)r)r+�__rpow__�	szDecimal.__rpow__cCs�|dkrt�}|jr(|j|d�}|r(|S|�|�}|��r>|S|sPt|jdd�S|j|��g|j	}t
|j�}|j}|j|ddkr�||kr�|d7}|d8}qtt|j|jd|�|�S)z?Normalize- strip trailing 0s, change anything equal to 0 to 0e0NrLrRr&r.)
rrQr�r�r�r:r;rGr�r�rkr<rP)r0r1r?�dupr��endrWr)r)r+�	normalize�	s$


zDecimal.normalizecCs�t|dd�}|dkrt�}|dkr(|j}|js4|jr||�||�}|rH|S|��sX|��r||��rp|��rpt|�S|�td�S|�	�|j
kr�|jks�n|�td�S|s�t|j
d|j
�}|�|�S|��}||jkr�|�td�S||j
d|jk�r|�td	�S|�|j
|�}|��|jk�r.|�td�St|j�|jk�rL|�td	�S|�rl|��|jk�rl|�t�|j
|j
k�r�||k�r�|�t�|�t�|�|�}|S)
z�Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        Tr�Nzquantize with one INFz)target exponent out of bounds in quantizerRz9exponent of quantize result too large for current contextr.z7quantize result has too many digits for current context)r�rrErQr�r�rrir	r�rPrGr:r;r�r�rFr�rkr<�Eminr
rr)r0rWrEr1r?r�r)r)r+r�	s`��

����




zDecimal.quantizecCsDt|dd�}|js|jr8|��r(|��p6|��o6|��S|j|jkS)a=Return True if self and other have the same exponent; otherwise
        return False.

        If either operand is a special value, the following rules are used:
           * return True if both operands are infinities
           * return True if both operands are NaNs
           * otherwise, return False.
        Tr�)r�rQr��is_infiniterPr�r)r)r+�same_quantum%
s	�zDecimal.same_quantumcCs�|jrt|�S|s t|jd|�S|j|krHt|j|jd|j||�St|j�|j|}|dkrzt|jd|d�}d}|j|}|||�}|jd|�p�d}|dkr�tt	|�d�}t|j||�S)asRescale self so that the exponent is exp, either by padding with zeros
        or by truncating digits, using the given rounding mode.

        Specials are returned without change.  This operation is
        quiet: it raises no flags, and uses no information from the
        context.

        exp = exp to scale to (an integer)
        rounding = rounding mode
        rRr&r�r.N)
rQrr:r;rPr<rkr�rerV)r0rWrEr}Z
this_functionr�r�r)r)r+r�4
s&
�

zDecimal._rescalecCsf|dkrtd��|js|s"t|�S|�|��d||�}|��|��krb|�|��d||�}|S)a"Round a nonzero, nonspecial Decimal to a fixed number of
        significant figures, using the given rounding mode.

        Infinities, NaNs and zeros are returned unaltered.

        This operation is quiet: it raises no flags, and uses no
        information from the context.

        r&z'argument should be at least 1 in _roundr.)rqrQrr�r�)r0�placesrEr?r)r)r+�_roundV
s

zDecimal._roundcCs�|jr"|j|d�}|r|St|�S|jdkr4t|�S|sFt|jdd�S|dkrTt�}|dkrb|j}|�d|�}||kr�|�	t
�|�	t�|S)aVRounds to a nearby integer.

        If no rounding mode is specified, take the rounding mode from
        the context.  This method raises the Rounded and Inexact flags
        when appropriate.

        See also: to_integral_value, which does exactly the same as
        this method except that it doesn't raise Inexact or Rounded.
        rLr&rRN)rQr�rrPr:r;rrEr�rirr�r0rEr1r?r)r)r+�to_integral_exactm
s$



zDecimal.to_integral_exactcCs`|dkrt�}|dkr|j}|jr>|j|d�}|r6|St|�S|jdkrPt|�S|�d|�SdS)z@Rounds to the nearest integer, without raising inexact, rounded.NrLr&)rrErQr�rrPr�rAr)r)r+r�
s
zDecimal.to_integral_valuecCs�|dkrt�}|jrB|j|d�}|r(|S|��rB|jdkrBt|�S|sdt|jd|jd�}|�|�S|jdkrz|�	t
d�S|jd}t|�}|j
d?}|j
d@r�|jd}t|j�d?d}n|j}t|j�dd?}||}|dkr�|d	|9}d
}	nt|d	|�\}}
|
}	||8}d|}||}||k�r:�qJn||d?}�q"|	�oZ|||k}	|	�r�|dk�rz|d|}n|d|9}||7}n|ddk�r�|d7}tdt|�|�}|��}|�t�}
|�|�}|
|_|S)zReturn the square root of self.NrLr&rRr^r.zsqrt(-x), x > 0r�r!Tr~)rrQr�r�r;rr:rPr�rir	rFrnrWrVrkr<r�re�
_shallow_copy�
_set_roundingrrE)r0r1r?rF�opr��c�lr�r5r�r9r�rEr)r)r+�sqrt�
s^










zDecimal.sqrtcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the larger value.

        Like max(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r��r�rrQr�r�r�r��
compare_total�r0r�r1ZsnZonrFr?r)r)r+r�s&


	
zDecimal.maxcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the smaller value.

        Like min(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r�rIrKr)r)r+r�*s&



zDecimal.mincCs8|jr
dS|jdkrdS|j|jd�}|dt|�kS)z"Returns whether self is an integerFr&TNrR)rQrPr<rk)r0�restr)r)r+rLs
zDecimal._isintegercCs&|r|jdkrdS|jd|jdkS)z:Returns True if self is even.  Assumes self is an integer.r&Tr�r)rPr<r�r)r)r+rUszDecimal._isevencCs2z|jt|j�dWStk
r,YdSXdS)z$Return the adjusted exponent of selfr.r&N)rPrkr<rwr�r)r)r+r�[szDecimal.adjustedcCs|S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.
        r)r�r)r)r+�	canonicalcszDecimal.canonicalcCs.t|dd�}|�||�}|r |S|j||d�S)z�Compares self to the other operand numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.
        Tr�rL)r�r�r�r�r)r)r+�compare_signalks
zDecimal.compare_signalcCs`t|dd�}|jr|jstS|js,|jr,tS|j}|��}|��}|sL|�r||kr�t|j�|jf}t|j�|jf}||kr�|r�tStS||kr�|r�tStStS|r�|dkr�tS|dkr�tS|dkr�tS|dkr�tSn2|dkr�tS|dkr�tS|dkr�tS|dk�rtS||k�rtS||k�r$tS|j|jk�r@|�r<tStS|j|jk�r\|�rXtStStS)z�Compares self to other using the abstract representations.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.
        Tr�r.r^)	r�r;�_NegativeOner/r�rkr<�_ZerorP)r0r�r1rCZself_nanZ	other_nanZself_keyZ	other_keyr)r)r+rJwsf



zDecimal.compare_totalcCs&t|dd�}|��}|��}|�|�S)z�Compares self to other using abstract repr., ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�r�rJ)r0r�r1r��or)r)r+�compare_total_mag�szDecimal.compare_total_magcCstd|j|j|j�S)z'Returns a copy with the sign set to 0. r&)r:r<rPrQr�r)r)r+r��szDecimal.copy_abscCs2|jrtd|j|j|j�Std|j|j|j�SdS)z&Returns a copy with the sign inverted.r&r.N)r;r:r<rPrQr�r)r)r+r��szDecimal.copy_negatecCs"t|dd�}t|j|j|j|j�S)z$Returns self with the sign of other.Tr�)r�r:r;r<rPrQr�r)r)r+�	copy_sign�s

�zDecimal.copy_signcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|s:tS|��dkrNt|�S|j}|��}|jdkr�|t	t
|jdd��kr�tdd|jd�}�n0|jdkr�|t	t
|�
�dd��kr�tdd|�
�d�}n�|jdk�r||k�rtddd|dd|�}n�|jdk�rD||dk�rDtdd	|d|d�}n�t|�}|j|j}}|jdk�rl|}d}t||||�\}	}
|	d
dt	t
|	��|d�r��q�|d7}�qptdt
|	�|
�}|��}|�t�}|�|�}||_|S)zReturns e ** self.NrLr�r.r&r\r�rRrDr~r�)rr�r�rPr/rrFr�r;rkrerGr:r�rnrVrWrC�_dexprCrDrr�rE)r0r1r?r%�adjrErFr�r6r�rWrEr)r)r+rW�sH$( "

zDecimal.expcCsdS)z�Return True if self is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.
        Tr)r�r)r)r+�is_canonical'szDecimal.is_canonicalcCs|jS)z�Return True if self is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.
        )rQr�r)r)r+�	is_finite/szDecimal.is_finitecCs
|jdkS)z8Return True if self is infinite; otherwise return False.r[�rPr�r)r)r+r=7szDecimal.is_infinitecCs
|jdkS)z>Return True if self is a qNaN or sNaN; otherwise return False.r`rXr�r)r)r+r�;szDecimal.is_nancCs*|js
|sdS|dkrt�}|j|��kS)z?Return True if self is a normal number; otherwise return False.FN)rQrr<r�r�r)r)r+�	is_normal?s

zDecimal.is_normalcCs
|jdkS)z;Return True if self is a quiet NaN; otherwise return False.r9rXr�r)r)r+r�GszDecimal.is_qnancCs
|jdkS)z8Return True if self is negative; otherwise return False.r.)r;r�r)r)r+�	is_signedKszDecimal.is_signedcCs
|jdkS)z?Return True if self is a signaling NaN; otherwise return False.rZrXr�r)r)r+r�OszDecimal.is_snancCs*|js
|sdS|dkrt�}|��|jkS)z9Return True if self is subnormal; otherwise return False.FN)rQrr�r<r�r)r)r+�is_subnormalSs

zDecimal.is_subnormalcCs|jo|jdkS)z6Return True if self is a zero; otherwise return False.rRr�r�r)r)r+�is_zero[szDecimal.is_zerocCs�|jt|j�d}|dkr4tt|dd��dS|dkrXttd|dd��dSt|�}|j|j}}|dkr�t|d|�}t|�}t|�t|�||kS|ttd||��dS)z�Compute a lower bound for the adjusted exponent of self.ln().
        In other words, compute r such that self.ln() >= 10**r.  Assumes
        that self is finite and positive and that self != 1.
        r.�r�r�r�r&�rPrkr<rernrVrW�r0rUrErFr��numZdenr)r)r+�
_ln_exp_bound_szDecimal._ln_exp_boundc
Cs|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|tkrFtS|jdkr\|�t	d�St
|�}|j|j}}|j
}||��d}t|||�}|ddttt|���|dr�q�|d7}q�tt|d	k�tt|��|�}|��}|�t�}	|�|�}|	|_|S)
z/Returns the natural (base e) logarithm of self.NrLr.zln of a negative valuer^r~r�r\r&)rr��_NegativeInfinityr��	_Infinityr/rPr;rir	rnrVrWrFra�_dlogrkrermr:rCrDrr�rE�
r0r1r?rErFr�r%r?r�rEr)r)r+�lnxs:
�$


z
Decimal.lncCs�|jt|j�d}|dkr,tt|��dS|dkrHttd|��dSt|�}|j|j}}|dkr�t|d|�}td|�}t|�t|�||kdStd||�}t|�||dkdS)	z�Compute a lower bound for the adjusted exponent of self.log10().
        In other words, find r such that self.log10() >= 10**r.
        Assumes that self is finite and positive and that self != 1.
        r.r�r�r&r���r^Z231r^r_r)r)r+r0�szDecimal._log10_exp_boundc
CsF|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|jdkrP|�td�S|jddkr�|jdd�dt	|j�dkr�t
|jt	|j�d�}n�t|�}|j
|j}}|j}||��d}t|||�}|d	d
t	tt|���|dr��q|d7}q�tt
|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)z&Returns the base 10 logarithm of self.NrLr.zlog10 of a negative valuer&r�rRr^r~r�r\)rr�rbr�rcr;rir	r<rkrrPrnrVrWrFr0�_dlog10rermr:rCrDrr�rErer)r)r+�log10�s:
�.$


z
Decimal.log10cCsV|j|d�}|r|S|dkr"t�}|��r.tS|s@|�tdd�St|���}|�|�S)aM Returns the exponent of the magnitude of self's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of self (as though it were truncated
        to a single digit while maintaining the value of that digit and
        without limiting the resulting exponent).
        rLNzlogb(0)r.)	r�rr�rcrir
rr�r�r�r)r)r+�logb�s	zDecimal.logbcCs6|jdks|jdkrdS|jD]}|dkrdSqdS)z�Return True if self is a logical operand.

        For being logical, it must be a finite number with a sign of 0,
        an exponent of 0, and a coefficient whose digits must all be
        either 0 or 1.
        r&FZ01T)r;rPr<)r0�digr)r)r+�
_islogical
s
zDecimal._islogicalcCs�|jt|�}|dkr$d||}n|dkr<||jd�}|jt|�}|dkr`d||}n|dkrx||jd�}||fS)Nr&rR)rFrk)r0r1�opa�opbZdifr)r)r+�
_fill_logical'
szDecimal._fill_logicalcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'and' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�@��qSr)�rerV��.0r-�br)r)r+�
<listcomp>B
sz'Decimal.logical_and.<locals>.<listcomp>r&rR�rr�rlrir	ror<rs�zipr:rl�r0r�r1rmrnr�r)r)r+�logical_and4
s
zDecimal.logical_andcCs(|dkrt�}|�tdd|jd�|�S)zInvert all its digits.Nr&r�)r�logical_xorr:rFr�r)r)r+�logical_invertE
s
�zDecimal.logical_invertcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z:Applies an 'or' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�B��qSr)rprqr)r)r+rtZ
sz&Decimal.logical_or.<locals>.<listcomp>r&rRrurwr)r)r+�
logical_orL
s
zDecimal.logical_orcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'xor' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�A��qSr)rprqr)r)r+rtk
sz'Decimal.logical_xor.<locals>.<listcomp>r&rRrurwr)r)r+ry]
s
zDecimal.logical_xorcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�S�z8Compares the values numerically with their sign ignored.Tr�Nr.r&r��	r�rrQr�r�r�r�r�rJrKr)r)r+�max_magn
s&


zDecimal.max_magcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�Sr|r}rKr)r)r+�min_mag�
s&


zDecimal.min_magcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the largest representable number smaller than itself.NrLr�r.r&rDr�)rr�r�rbr:rFr�rMrDr�_ignore_all_flagsr�r�r��r0r1r?Znew_selfr)r)r+�
next_minus�
s$

�zDecimal.next_minuscCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the smallest representable number larger than itself.NrLr.r�rDr&r�)rr�r�rcr:rFr�rMrDrr�r�r�r�r�r)r)r+�	next_plus�
s$

�zDecimal.next_pluscCs�t|dd�}|dkrt�}|�||�}|r.|S|�|�}|dkrJ|�|�S|dkr^|�|�}n
|�|�}|��r�|�t	d|j
�|�t�|�t�nD|�
�|jkr�|�t�|�t�|�t�|�t�|s�|�t�|S)a�Returns the number closest to self, in the direction towards other.

        The result is the closest representable number to self
        (excluding self) that is in the direction towards other,
        unless both have the same value.  If the two operands are
        numerically equal, then the result is a copy of self with the
        sign set to be the same as the sign of other.
        Tr�Nr&r�z Infinite result from next_toward)r�rr�r�rSr�r�r�rirr;rrr�r<rr
r)r0r�r1r?Z
comparisonr)r)r+�next_toward�
s6	


�





zDecimal.next_towardcCs�|��rdS|��rdS|��}|dkr,dS|dkr8dS|��rN|jrJdSdS|d	kr\t�}|j|d
�rv|jrrdSdS|jr�d
SdSd	S)aReturns an indication of the class of self.

        The class is one of the following strings:
          sNaN
          NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity
        r�r�r.z	+Infinityr�z	-Infinityz-Zeroz+ZeroNrLz
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�r\r;rr[)r0r1�infr)r)r+�number_classs,zDecimal.number_classcCstd�S)z'Just returns 10, as this is Decimal, :)r�r�r�r)r)r+�radix0sz
Decimal.radixcCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}||d�|d|�}t|j
|�d�p�d|j�S)z5Returns a rotated copy of self, value-of-other times.NTr�r&rR�rr�r�rPrir	rFrVr�rr<rkr:r;rl)r0r�r1r?�torot�rotdig�topadZrotatedr)r)r+�rotate4s0

 
�zDecimal.rotatecCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�Sd|j|j}d|j|j}|t|�krz|ks�n|�t�S|�	�r�t
|�St|j|j
|jt|��}|�|�}|S)z>Returns self operand after adding the second value to its exp.NTr�r&r�r^)rr�r�rPrir	rGrFrVr�rr:r;r<r�)r0r�r1r?ZliminfZlimsupr�r)r)r+�scalebUs"



zDecimal.scalebcCs|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}|dkr�|d|�}n|d|}||jd�}t|j
|�d��p
d|j�S)z5Returns a shifted copy of self, value-of-other times.NTr�r&rRr�)r0r�r1r?r�r�r�Zshiftedr)r)r+r�ns6

 
�z
Decimal.shiftcCs|jt|�ffSr()�	__class__rer�r)r)r+�
__reduce__�szDecimal.__reduce__cCst|�tkr|S|�t|��Sr(��typerr�rer�r)r)r+�__copy__�szDecimal.__copy__cCst|�tkr|S|�t|��Sr(r�)r0Zmemor)r)r+�__deepcopy__�szDecimal.__deepcopy__cCsJ|dkrt�}t||d�}|jrXt|j|�}t|���}|ddkrL|d7}t|||�S|ddkrvddg|j|d<|ddkr�t	|j|j
|jd�}|j}|d}|dk	�r|dd	kr�|�
|d
|�}nF|ddkr�|�||�}n*|ddk�rt|j
�|k�r|�
||�}|�s@|jd
k�r@|ddk�r@|�d
|�}|jt|j
�}	|dd	k�r~|�sx|dk	�rxd
|}
nd
}
nB|ddk�r�|	}
n.|ddk�r�|jd
k�r�|	dk�r�|	}
nd
}
|
d
k�r�d}d|
|j
}nP|
t|j
�k�r|j
d|
t|j
�}d}n"|j
d|
��p d}|j
|
d�}|	|
}
t|j|||
|�S)a|Format a Decimal instance according to the given specifier.

        The specifier should be a standard format specifier, with the
        form described in PEP 3101.  Formatting types 'e', 'E', 'f',
        'F', 'g', 'G', 'n' and '%' are supported.  If the formatting
        type is omitted it defaults to 'g' or 'G', depending on the
        value of context.capitals.
        N)�_localeconvr��%�g�Gr^�	precision�eEr.zfF%ZgGr&r�rRrT)r�_parse_format_specifierrQ�_format_signr;rer��
_format_alignr�r:r<rPrEr@r�rk�_format_number)r0Z	specifierr1r��specrC�bodyrEr�r�r�r{r|rWr)r)r+�
__format__�sZ
 

zDecimal.__format__)rRN)NN)N)N)N)N)N)N)FN)N)N)N)TN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)N)N)NN)N)NN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)�r4r5r6r7�	__slots__rc�classmethodrvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__radd__r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�r=r�r�r�rrrrrr	�dictr�r
rrrrr.r7r8r;rr>r�r@rBr�to_integralrHr�r�rrr�rMrNrJrRr�r�rSrWrVrWr=r�rYr�rZr�r[r\rarfr0rirjrlrorxrzr{ryr~rr�r�r�r�r�r�r�r�r�r�r�r�r)r)r)r+rs

,
 !@

	
	
	
	
2
4
	



V7;!$K



f	�>,UnY="c*"	IK23
.*!'FcCs&t�t�}||_||_||_||_|S)z�Create a decimal instance directly, without any validation,
    normalization (e.g. removal of leading zeros) or argument
    conversion.

    This function is for *internal use only*.
    )rbrcrr;r<rPrQ)rCZcoefficientrZspecialr0r)r)r+r:�s
r:c@s(eZdZdZdd�Zdd�Zdd�ZdS)	rOz�Context manager class to support localcontext().

      Sets a copy of the supplied context in __enter__() and restores
      the previous decimal context in __exit__()
    cCs|��|_dSr()rM�new_context)r0r�r)r)r+�__init__sz_ContextManager.__init__cCst�|_t|j�|jSr()r�
saved_contextrr�r�r)r)r+�	__enter__s
z_ContextManager.__enter__cCst|j�dSr()rr�)r0�t�v�tbr)r)r+�__exit__sz_ContextManager.__exit__N)r4r5r6r7r�r�r�r)r)r)r+rOsrOc	@s�eZdZdZd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZd�dd�Zdd�Zdd�Zdd �ZdZd!d"�Zd#d$�Zd%d&�Zd�d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4dbdc�Z5ddde�Z6dfdg�Z7dhdi�Z8djdk�Z9dldm�Z:dndo�Z;dpdq�Z<drds�Z=dtdu�Z>dvdw�Z?dxdy�Z@dzd{�ZAd|d}�ZBd~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVeVZWdS)�ra�Contains the context for a Decimal instance.

    Contains:
    prec - precision (for use in rounding, division, square roots..)
    rounding - rounding type (how you round)
    traps - If traps[exception] = 1, then the exception is
                    raised when it is caused.  Otherwise, a value is
                    substituted in.
    flags  - When an exception is caused, flags[exception] is set.
             (Whether or not the trap_enabler is set)
             Should be reset by user of Decimal instance.
    Emin -   Minimum exponent
    Emax -   Maximum exponent
    capitals -      If 1, 1*10^1 is printed as 1E+1.
                    If 0, printed as 1e1
    clamp -  If 1, change exponents if too high (Default 0)
    Nc
s>zt}
Wntk
rYnX|dk	r*|n|
j|_|dk	r>|n|
j|_|dk	rR|n|
j|_|dk	rf|n|
j|_|dk	rz|n|
j|_|dk	r�|n|
j|_|	dkr�g|_n|	|_�dkr�|
j	�
�|_	n.t�t�s�t�fdd�t
�D��|_	n�|_	�dk�r
t�t
d�|_n0t�t��s4t�fdd�t
�D��|_n�|_dS)Nc3s|]}|t|�k�fVqdSr(�rV�rrr��r3r)r+�	<genexpr>Isz#Context.__init__.<locals>.<genexpr>r&c3s|]}|t|�k�fVqdSr(r�r��r4r)r+r�Ps)r�	NameErrorrFrEr<rGr�r��_ignored_flagsr3rMrdr�r2�fromkeysr4)r0rFrEr<rGr�r�r4r3r�Zdcr))r4r3r+r�0s.

zContext.__init__cCs�t|t�std|��|dkr<||kr�td||||f��nJ|dkrb||kr�td||||f��n$||ksr||kr�td||||f��t�|||�S)Nz%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)rdrVrwrqrb�__setattr__)r0�nameryZvminZvmaxr)r)r+�_set_integer_checkTs
zContext._set_integer_checkcCs`t|t�std|��|D]}|tkrtd|��qtD]}||kr8td|��q8t�|||�S)Nz%s must be a signal dictz%s is not a valid signal dict)rdr�rwr2�KeyErrorrbr�)r0r�r��keyr)r)r+�_set_signal_dictbs
zContext._set_signal_dictcCs�|dkr|�||dd�S|dkr0|�||dd�S|dkrH|�||dd�S|dkr`|�||dd�S|d	krx|�||dd�S|d
kr�|tkr�td|��t�|||�S|dks�|d
kr�|�||�S|dkr�t�|||�Std|��dS)NrFr.r�r<r�r&rGr�r�rEz%s: invalid rounding moder4r3r�z.'decimal.Context' object has no attribute '%s')r��_rounding_modesrwrbr�r��AttributeError)r0r�ryr)r)r+r�ms*�zContext.__setattr__cCstd|��dS)Nz%s cannot be deleted)r�)r0r�r)r)r+�__delattr__�szContext.__delattr__c	CsNdd�|j��D�}dd�|j��D�}|j|j|j|j|j|j|j	||ffS)NcSsg|]\}}|r|�qSr)r)�rrZsigr�r)r)r+rt�sz&Context.__reduce__.<locals>.<listcomp>cSsg|]\}}|r|�qSr)r)r�r)r)r+rt�s)
r4�itemsr3r�rFrEr<rGr�r�)r0r4r3r)r)r+r��s��zContext.__reduce__cCs|g}|�dt|��dd�|j��D�}|�dd�|�d�dd�|j��D�}|�dd�|�d�d�|�d	S)
zShow the current context.zrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dcSsg|]\}}|r|j�qSr)�r4)rrr�r�r)r)r+rt�sz$Context.__repr__.<locals>.<listcomp>zflags=[z, �]cSsg|]\}}|r|j�qSr)r�)rrr�r�r)r)r+rt�sztraps=[�))rr�varsr4r�rsr3)r0r��namesr)r)r+r��s�zContext.__repr__cCs|jD]}d|j|<qdS)zReset all flags to zeror&Nr��r0�flagr)r)r+rN�s
zContext.clear_flagscCs|jD]}d|j|<qdS)zReset all traps to zeror&Nr�r�r)r)r+�clear_traps�s
zContext.clear_trapsc
Cs.t|j|j|j|j|j|j|j|j|j	�	}|S)z!Returns a shallow copy from self.)
rrFrEr<rGr�r�r4r3r��r0Zncr)r)r+rC�s�zContext._shallow_copyc
Cs6t|j|j|j|j|j|j|j��|j	��|j
�	}|S)zReturns a deep copy from self.)rrFrEr<rGr�r�r4rMr3r�r�r)r)r+rM�s�zContext.copycGsZt�||�}||jkr(|�j|f|��Sd|j|<|j|sN|�j|f|��S||��dS)a#Handles an error

        If the flag is in _ignored_flags, returns the default response.
        Otherwise, it sets the flag, then, if the corresponding
        trap_enabler is set, it reraises the exception.  Otherwise, it returns
        the default value after setting the flag.
        r.N)�_condition_maprIr�r2r4r3)r0Z	conditionZexplanationr*�errorr)r)r+ri�s


zContext._raise_errorcCs
|jt�S)z$Ignore all flags, if they are raised)�
_ignore_flagsr2r�r)r)r+r��szContext._ignore_all_flagscGs|jt|�|_t|�S)z$Ignore the flags, if they are raised)r�ro)r0r4r)r)r+r��szContext._ignore_flagscGs8|rt|dttf�r|d}|D]}|j�|�q"dS)z+Stop ignoring the flags, if they are raisedr&N)rdrpror��remove)r0r4r�r)r)r+�
_regard_flags�szContext._regard_flagscCst|j|jd�S)z!Returns Etiny (= Emin - prec + 1)r.)rVr<rFr�r)r)r+r��sz
Context.EtinycCst|j|jd�S)z,Returns maximum exponent (= Emax - prec + 1)r.)rVrGrFr�r)r)r+r��szContext.EtopcCs|j}||_|S)a�Sets the rounding type.

        Sets the rounding type, and returns the current (previous)
        rounding type.  Often used like:

        context = context.copy()
        # so you don't change the calling context
        # if an error occurs in the middle.
        rounding = context._set_rounding(ROUND_UP)
        val = self.__sub__(other, context=context)
        context._set_rounding(rounding)

        This will make it round up for that operation.
        )rE)r0r�rEr)r)r+rD�szContext._set_roundingrRcCsjt|t�r*||��ksd|kr*|�td�St||d�}|��r`t|j�|j	|j
kr`|�td�S|�|�S)z�Creates a new Decimal instance but using self as context.

        This method implements the to-number operation of the
        IBM Decimal specification.rSzAtrailing or leading whitespace and underscores are not permitted.rLzdiagnostic info too long in NaN)rdrergrirrr�rkr<rFr�r�)r0r`r�r)r)r+�create_decimal�s��zContext.create_decimalcCst�|�}|�|�S)a�Creates a new Decimal instance from a float but rounding using self
        as the context.

        >>> context = Context(prec=5, rounding=ROUND_DOWN)
        >>> context.create_decimal_from_float(3.1415926535897932)
        Decimal('3.1415')
        >>> context = Context(prec=5, traps=[Inexact])
        >>> context.create_decimal_from_float(3.1415926535897932)
        Traceback (most recent call last):
            ...
        decimal.Inexact: None

        )rrvr�)r0r�r�r)r)r+�create_decimal_from_floats
z!Context.create_decimal_from_floatcCst|dd�}|j|d�S)a[Returns the absolute value of the operand.

        If the operand is negative, the result is the same as using the minus
        operation on the operand.  Otherwise, the result is the same as using
        the plus operation on the operand.

        >>> ExtendedContext.abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.abs(Decimal('101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(-1)
        Decimal('1')
        Tr�rL)r�r��r0r-r)r)r+rm!szContext.abscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return the sum of the two operands.

        >>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
        Decimal('19.00')
        >>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
        Decimal('1.02E+4')
        >>> ExtendedContext.add(1, Decimal(2))
        Decimal('3')
        >>> ExtendedContext.add(Decimal(8), 5)
        Decimal('13')
        >>> ExtendedContext.add(5, 5)
        Decimal('10')
        Tr�rL�Unable to convert %s to DecimalN)r�r�r�rw�r0r-rsr�r)r)r+�add6s
zContext.addcCst|�|��Sr()rer�r�r)r)r+�_applyKszContext._applycCst|t�std��|��S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.

        >>> ExtendedContext.canonical(Decimal('2.50'))
        Decimal('2.50')
        z,canonical requires a Decimal as an argument.)rdrrwrMr�r)r)r+rMNs	
zContext.canonicalcCst|dd�}|j||d�S)a�Compares values numerically.

        If the signs of the operands differ, a value representing each operand
        ('-1' if the operand is less than zero, '0' if the operand is zero or
        negative zero, or '1' if the operand is greater than zero) is used in
        place of that operand for the comparison instead of the actual
        operand.

        The comparison is then effected by subtracting the second operand from
        the first and then returning a value according to the result of the
        subtraction: '-1' if the result is less than zero, '0' if the result is
        zero or negative zero, or '1' if the result is greater than zero.

        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('3'), Decimal('2.1'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
        Decimal('-1')
        >>> ExtendedContext.compare(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare(1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�r��r0r-rsr)r)r+r�[s!zContext.comparecCst|dd�}|j||d�S)aCompares the values of the two operands numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.

        >>> c = ExtendedContext
        >>> c.compare_signal(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.compare_signal(-1, 2)
        Decimal('-1')
        >>> c.compare_signal(Decimal(-1), 2)
        Decimal('-1')
        >>> c.compare_signal(-1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�rNr�r)r)r+rNs zContext.compare_signalcCst|dd�}|�|�S)a+Compares two operands using their abstract representation.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.

        >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
        Decimal('0')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
        Decimal('1')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, Decimal(2))
        Decimal('-1')
        Tr�)r�rJr�r)r)r+rJ�szContext.compare_totalcCst|dd�}|�|�S)z�Compares two operands using their abstract representation ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�rRr�r)r)r+rR�szContext.compare_total_magcCst|dd�}|��S)aReturns a copy of the operand with the sign set to 0.

        >>> ExtendedContext.copy_abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.copy_abs(-1)
        Decimal('1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_abscCst|dd�}t|�S)aReturns a copy of the decimal object.

        >>> ExtendedContext.copy_decimal(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_decimal(Decimal('-1.00'))
        Decimal('-1.00')
        >>> ExtendedContext.copy_decimal(1)
        Decimal('1')
        Tr�)r�rr�r)r)r+�copy_decimal�s
zContext.copy_decimalcCst|dd�}|��S)a(Returns a copy of the operand with the sign inverted.

        >>> ExtendedContext.copy_negate(Decimal('101.5'))
        Decimal('-101.5')
        >>> ExtendedContext.copy_negate(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.copy_negate(1)
        Decimal('-1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_negatecCst|dd�}|�|�S)aCopies the second operand's sign to the first one.

        In detail, it returns a copy of the first operand with the sign
        equal to the sign of the second operand.

        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(1, -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(Decimal(1), -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(1, Decimal(-2))
        Decimal('-1')
        Tr�)r�rSr�r)r)r+rS�szContext.copy_signcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Decimal division in a specified context.

        >>> ExtendedContext.divide(Decimal('1'), Decimal('3'))
        Decimal('0.333333333')
        >>> ExtendedContext.divide(Decimal('2'), Decimal('3'))
        Decimal('0.666666667')
        >>> ExtendedContext.divide(Decimal('5'), Decimal('2'))
        Decimal('2.5')
        >>> ExtendedContext.divide(Decimal('1'), Decimal('10'))
        Decimal('0.1')
        >>> ExtendedContext.divide(Decimal('12'), Decimal('12'))
        Decimal('1')
        >>> ExtendedContext.divide(Decimal('8.00'), Decimal('2'))
        Decimal('4.00')
        >>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0'))
        Decimal('1.20')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('1'))
        Decimal('1000')
        >>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
        Decimal('1.20E+6')
        >>> ExtendedContext.divide(5, 5)
        Decimal('1')
        >>> ExtendedContext.divide(Decimal(5), 5)
        Decimal('1')
        >>> ExtendedContext.divide(5, Decimal(5))
        Decimal('1')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�divides
zContext.dividecCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a/Divides two numbers and returns the integer part of the result.

        >>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
        Decimal('0')
        >>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(10, 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal(10), 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(10, Decimal(3))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�
divide_int+s
zContext.divide_intcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return (a // b, a % b).

        >>> ExtendedContext.divmod(Decimal(8), Decimal(3))
        (Decimal('2'), Decimal('2'))
        >>> ExtendedContext.divmod(Decimal(8), Decimal(4))
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(Decimal(8), 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, Decimal(4))
        (Decimal('2'), Decimal('0'))
        Tr�rLr�N)r�r�r�rwr�r)r)r+r�Bs
zContext.divmodcCst|dd�}|j|d�S)a#Returns e ** a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.exp(Decimal('-Infinity'))
        Decimal('0')
        >>> c.exp(Decimal('-1'))
        Decimal('0.367879441')
        >>> c.exp(Decimal('0'))
        Decimal('1')
        >>> c.exp(Decimal('1'))
        Decimal('2.71828183')
        >>> c.exp(Decimal('0.693147181'))
        Decimal('2.00000000')
        >>> c.exp(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.exp(10)
        Decimal('22026.4658')
        Tr�rL)r�rWr�r)r)r+rWWszContext.expcCst|dd�}|j|||d�S)aReturns a multiplied by b, plus c.

        The first two operands are multiplied together, using multiply,
        the third operand is then added to the result of that
        multiplication, using add, all with only one final rounding.

        >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
        Decimal('22')
        >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
        Decimal('-8')
        >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
        Decimal('1.38435736E+12')
        >>> ExtendedContext.fma(1, 3, 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, Decimal(3), 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, 3, Decimal(4))
        Decimal('7')
        Tr�rL)r�r)r0r-rsrFr)r)r+roszContext.fmacCst|t�std��|��S)aReturn True if the operand is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.

        >>> ExtendedContext.is_canonical(Decimal('2.50'))
        True
        z/is_canonical requires a Decimal as an argument.)rdrrwrVr�r)r)r+rV�s	
zContext.is_canonicalcCst|dd�}|��S)a,Return True if the operand is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.

        >>> ExtendedContext.is_finite(Decimal('2.50'))
        True
        >>> ExtendedContext.is_finite(Decimal('-0.3'))
        True
        >>> ExtendedContext.is_finite(Decimal('0'))
        True
        >>> ExtendedContext.is_finite(Decimal('Inf'))
        False
        >>> ExtendedContext.is_finite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_finite(1)
        True
        Tr�)r�rWr�r)r)r+rW�szContext.is_finitecCst|dd�}|��S)aUReturn True if the operand is infinite; otherwise return False.

        >>> ExtendedContext.is_infinite(Decimal('2.50'))
        False
        >>> ExtendedContext.is_infinite(Decimal('-Inf'))
        True
        >>> ExtendedContext.is_infinite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_infinite(1)
        False
        Tr�)r�r=r�r)r)r+r=�szContext.is_infinitecCst|dd�}|��S)aOReturn True if the operand is a qNaN or sNaN;
        otherwise return False.

        >>> ExtendedContext.is_nan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_nan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_nan(Decimal('-sNaN'))
        True
        >>> ExtendedContext.is_nan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_nancCst|dd�}|j|d�S)a�Return True if the operand is a normal number;
        otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_normal(Decimal('2.50'))
        True
        >>> c.is_normal(Decimal('0.1E-999'))
        False
        >>> c.is_normal(Decimal('0.00'))
        False
        >>> c.is_normal(Decimal('-Inf'))
        False
        >>> c.is_normal(Decimal('NaN'))
        False
        >>> c.is_normal(1)
        True
        Tr�rL)r�rYr�r)r)r+rY�szContext.is_normalcCst|dd�}|��S)aHReturn True if the operand is a quiet NaN; otherwise return False.

        >>> ExtendedContext.is_qnan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_qnan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_qnan(Decimal('sNaN'))
        False
        >>> ExtendedContext.is_qnan(1)
        False
        Tr�)r�r�r�r)r)r+r��szContext.is_qnancCst|dd�}|��S)a�Return True if the operand is negative; otherwise return False.

        >>> ExtendedContext.is_signed(Decimal('2.50'))
        False
        >>> ExtendedContext.is_signed(Decimal('-12'))
        True
        >>> ExtendedContext.is_signed(Decimal('-0'))
        True
        >>> ExtendedContext.is_signed(8)
        False
        >>> ExtendedContext.is_signed(-8)
        True
        Tr�)r�rZr�r)r)r+rZ�szContext.is_signedcCst|dd�}|��S)aTReturn True if the operand is a signaling NaN;
        otherwise return False.

        >>> ExtendedContext.is_snan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_snan(Decimal('NaN'))
        False
        >>> ExtendedContext.is_snan(Decimal('sNaN'))
        True
        >>> ExtendedContext.is_snan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_snancCst|dd�}|j|d�S)a�Return True if the operand is subnormal; otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_subnormal(Decimal('2.50'))
        False
        >>> c.is_subnormal(Decimal('0.1E-999'))
        True
        >>> c.is_subnormal(Decimal('0.00'))
        False
        >>> c.is_subnormal(Decimal('-Inf'))
        False
        >>> c.is_subnormal(Decimal('NaN'))
        False
        >>> c.is_subnormal(1)
        False
        Tr�rL)r�r[r�r)r)r+r[szContext.is_subnormalcCst|dd�}|��S)auReturn True if the operand is a zero; otherwise return False.

        >>> ExtendedContext.is_zero(Decimal('0'))
        True
        >>> ExtendedContext.is_zero(Decimal('2.50'))
        False
        >>> ExtendedContext.is_zero(Decimal('-0E+2'))
        True
        >>> ExtendedContext.is_zero(1)
        False
        >>> ExtendedContext.is_zero(0)
        True
        Tr�)r�r\r�r)r)r+r\%szContext.is_zerocCst|dd�}|j|d�S)a�Returns the natural (base e) logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.ln(Decimal('0'))
        Decimal('-Infinity')
        >>> c.ln(Decimal('1.000'))
        Decimal('0')
        >>> c.ln(Decimal('2.71828183'))
        Decimal('1.00000000')
        >>> c.ln(Decimal('10'))
        Decimal('2.30258509')
        >>> c.ln(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.ln(1)
        Decimal('0')
        Tr�rL)r�rfr�r)r)r+rf6sz
Context.lncCst|dd�}|j|d�S)a�Returns the base 10 logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.log10(Decimal('0'))
        Decimal('-Infinity')
        >>> c.log10(Decimal('0.001'))
        Decimal('-3')
        >>> c.log10(Decimal('1.000'))
        Decimal('0')
        >>> c.log10(Decimal('2'))
        Decimal('0.301029996')
        >>> c.log10(Decimal('10'))
        Decimal('1')
        >>> c.log10(Decimal('70'))
        Decimal('1.84509804')
        >>> c.log10(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.log10(0)
        Decimal('-Infinity')
        >>> c.log10(1)
        Decimal('0')
        Tr�rL)r�rir�r)r)r+riLsz
Context.log10cCst|dd�}|j|d�S)a4 Returns the exponent of the magnitude of the operand's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of the operand (as though the
        operand were truncated to a single digit while maintaining the
        value of that digit and without limiting the resulting exponent).

        >>> ExtendedContext.logb(Decimal('250'))
        Decimal('2')
        >>> ExtendedContext.logb(Decimal('2.50'))
        Decimal('0')
        >>> ExtendedContext.logb(Decimal('0.03'))
        Decimal('-2')
        >>> ExtendedContext.logb(Decimal('0'))
        Decimal('-Infinity')
        >>> ExtendedContext.logb(1)
        Decimal('0')
        >>> ExtendedContext.logb(10)
        Decimal('1')
        >>> ExtendedContext.logb(100)
        Decimal('2')
        Tr�rL)r�rjr�r)r)r+rjhszContext.logbcCst|dd�}|j||d�S)a�Applies the logical operation 'and' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
        Decimal('1000')
        >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
        Decimal('10')
        >>> ExtendedContext.logical_and(110, 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(Decimal(110), 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(110, Decimal(1101))
        Decimal('100')
        Tr�rL)r�rxr�r)r)r+rx�szContext.logical_andcCst|dd�}|j|d�S)aInvert all the digits in the operand.

        The operand must be a logical number.

        >>> ExtendedContext.logical_invert(Decimal('0'))
        Decimal('111111111')
        >>> ExtendedContext.logical_invert(Decimal('1'))
        Decimal('111111110')
        >>> ExtendedContext.logical_invert(Decimal('111111111'))
        Decimal('0')
        >>> ExtendedContext.logical_invert(Decimal('101010101'))
        Decimal('10101010')
        >>> ExtendedContext.logical_invert(1101)
        Decimal('111110010')
        Tr�rL)r�rzr�r)r)r+rz�szContext.logical_invertcCst|dd�}|j||d�S)a�Applies the logical operation 'or' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(110, 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(Decimal(110), 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(110, Decimal(1101))
        Decimal('1111')
        Tr�rL)r�r{r�r)r)r+r{�szContext.logical_orcCst|dd�}|j||d�S)a�Applies the logical operation 'xor' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
        Decimal('110')
        >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
        Decimal('1101')
        >>> ExtendedContext.logical_xor(110, 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(Decimal(110), 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(110, Decimal(1101))
        Decimal('1011')
        Tr�rL)r�ryr�r)r)r+ry�szContext.logical_xorcCst|dd�}|j||d�S)a�max compares two values numerically and returns the maximum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the maximum (closer to positive
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.max(Decimal('3'), Decimal('2'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('-10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('1.0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max(1, 2)
        Decimal('2')
        >>> ExtendedContext.max(Decimal(1), 2)
        Decimal('2')
        >>> ExtendedContext.max(1, Decimal(2))
        Decimal('2')
        Tr�rL)r�r�r�r)r)r+r��szContext.maxcCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
        Decimal('-10')
        >>> ExtendedContext.max_mag(1, -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(Decimal(1), -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(1, Decimal(-2))
        Decimal('-2')
        Tr�rL)r�r~r�r)r)r+r~szContext.max_magcCst|dd�}|j||d�S)a�min compares two values numerically and returns the minimum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the minimum (closer to negative
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.min(Decimal('3'), Decimal('2'))
        Decimal('2')
        >>> ExtendedContext.min(Decimal('-10'), Decimal('3'))
        Decimal('-10')
        >>> ExtendedContext.min(Decimal('1.0'), Decimal('1'))
        Decimal('1.0')
        >>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.min(1, 2)
        Decimal('1')
        >>> ExtendedContext.min(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.min(1, Decimal(29))
        Decimal('1')
        Tr�rL)r�r�r�r)r)r+r�szContext.mincCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
        Decimal('-2')
        >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
        Decimal('-3')
        >>> ExtendedContext.min_mag(1, -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(Decimal(1), -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(1, Decimal(-2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+r-szContext.min_magcCst|dd�}|j|d�S)a�Minus corresponds to unary prefix minus in Python.

        The operation is evaluated using the same rules as subtract; the
        operation minus(a) is calculated as subtract('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.minus(Decimal('1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.minus(Decimal('-1.3'))
        Decimal('1.3')
        >>> ExtendedContext.minus(1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�minus>sz
Context.minuscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�multiply multiplies two operands.

        If either operand is a special value then the general rules apply.
        Otherwise, the operands are multiplied together
        ('long multiplication'), resulting in a number which may be as long as
        the sum of the lengths of the two operands.

        >>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
        Decimal('3.60')
        >>> ExtendedContext.multiply(Decimal('7'), Decimal('3'))
        Decimal('21')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8'))
        Decimal('0.72')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0'))
        Decimal('-0.0')
        >>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
        Decimal('4.28135971E+11')
        >>> ExtendedContext.multiply(7, 7)
        Decimal('49')
        >>> ExtendedContext.multiply(Decimal(7), 7)
        Decimal('49')
        >>> ExtendedContext.multiply(7, Decimal(7))
        Decimal('49')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�multiplyOs
zContext.multiplycCst|dd�}|j|d�S)a"Returns the largest representable number smaller than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_minus(Decimal('1'))
        Decimal('0.999999999')
        >>> c.next_minus(Decimal('1E-1007'))
        Decimal('0E-1007')
        >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
        Decimal('-1.00000004')
        >>> c.next_minus(Decimal('Infinity'))
        Decimal('9.99999999E+999')
        >>> c.next_minus(1)
        Decimal('0.999999999')
        Tr�rL)r�r�r�r)r)r+r�oszContext.next_minuscCst|dd�}|j|d�S)aReturns the smallest representable number larger than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_plus(Decimal('1'))
        Decimal('1.00000001')
        >>> c.next_plus(Decimal('-1E-1007'))
        Decimal('-0E-1007')
        >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
        Decimal('-1.00000002')
        >>> c.next_plus(Decimal('-Infinity'))
        Decimal('-9.99999999E+999')
        >>> c.next_plus(1)
        Decimal('1.00000001')
        Tr�rL)r�r�r�r)r)r+r��szContext.next_pluscCst|dd�}|j||d�S)a�Returns the number closest to a, in direction towards b.

        The result is the closest representable number from the first
        operand (but not the first operand) that is in the direction
        towards the second operand, unless the operands have the same
        value.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.next_toward(Decimal('1'), Decimal('2'))
        Decimal('1.00000001')
        >>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
        Decimal('-0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
        Decimal('-1.00000002')
        >>> c.next_toward(Decimal('1'), Decimal('0'))
        Decimal('0.999999999')
        >>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
        Decimal('0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
        Decimal('-1.00000004')
        >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
        Decimal('-0.00')
        >>> c.next_toward(0, 1)
        Decimal('1E-1007')
        >>> c.next_toward(Decimal(0), 1)
        Decimal('1E-1007')
        >>> c.next_toward(0, Decimal(1))
        Decimal('1E-1007')
        Tr�rL)r�r�r�r)r)r+r��s zContext.next_towardcCst|dd�}|j|d�S)a�normalize reduces an operand to its simplest form.

        Essentially a plus operation with all trailing zeros removed from the
        result.

        >>> ExtendedContext.normalize(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.normalize(Decimal('-2.0'))
        Decimal('-2')
        >>> ExtendedContext.normalize(Decimal('1.200'))
        Decimal('1.2')
        >>> ExtendedContext.normalize(Decimal('-120'))
        Decimal('-1.2E+2')
        >>> ExtendedContext.normalize(Decimal('120.00'))
        Decimal('1.2E+2')
        >>> ExtendedContext.normalize(Decimal('0.00'))
        Decimal('0')
        >>> ExtendedContext.normalize(6)
        Decimal('6')
        Tr�rL)r�r;r�r)r)r+r;�szContext.normalizecCst|dd�}|j|d�S)a�Returns an indication of the class of the operand.

        The class is one of the following strings:
          -sNaN
          -NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.number_class(Decimal('Infinity'))
        '+Infinity'
        >>> c.number_class(Decimal('1E-10'))
        '+Normal'
        >>> c.number_class(Decimal('2.50'))
        '+Normal'
        >>> c.number_class(Decimal('0.1E-999'))
        '+Subnormal'
        >>> c.number_class(Decimal('0'))
        '+Zero'
        >>> c.number_class(Decimal('-0'))
        '-Zero'
        >>> c.number_class(Decimal('-0.1E-999'))
        '-Subnormal'
        >>> c.number_class(Decimal('-1E-10'))
        '-Normal'
        >>> c.number_class(Decimal('-2.50'))
        '-Normal'
        >>> c.number_class(Decimal('-Infinity'))
        '-Infinity'
        >>> c.number_class(Decimal('NaN'))
        'NaN'
        >>> c.number_class(Decimal('-NaN'))
        'NaN'
        >>> c.number_class(Decimal('sNaN'))
        'sNaN'
        >>> c.number_class(123)
        '+Normal'
        Tr�rL)r�r�r�r)r)r+r��s/zContext.number_classcCst|dd�}|j|d�S)a�Plus corresponds to unary prefix plus in Python.

        The operation is evaluated using the same rules as add; the
        operation plus(a) is calculated as add('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.plus(Decimal('1.3'))
        Decimal('1.3')
        >>> ExtendedContext.plus(Decimal('-1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.plus(-1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�plusszContext.pluscCs:t|dd�}|j|||d�}|tkr2td|��n|SdS)aRaises a to the power of b, to modulo if given.

        With two arguments, compute a**b.  If a is negative then b
        must be integral.  The result will be inexact unless b is
        integral and the result is finite and can be expressed exactly
        in 'precision' digits.

        With three arguments, compute (a**b) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - b must be nonnegative
         - at least one of a or b must be nonzero
         - modulo must be nonzero and have at most 'precision' digits

        The result of pow(a, b, modulo) is identical to the result
        that would be obtained by computing (a**b) % modulo with
        unbounded precision, but is computed more efficiently.  It is
        always exact.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.power(Decimal('2'), Decimal('3'))
        Decimal('8')
        >>> c.power(Decimal('-2'), Decimal('3'))
        Decimal('-8')
        >>> c.power(Decimal('2'), Decimal('-3'))
        Decimal('0.125')
        >>> c.power(Decimal('1.7'), Decimal('8'))
        Decimal('69.7575744')
        >>> c.power(Decimal('10'), Decimal('0.301029996'))
        Decimal('2.00000000')
        >>> c.power(Decimal('Infinity'), Decimal('-1'))
        Decimal('0')
        >>> c.power(Decimal('Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('Infinity'), Decimal('1'))
        Decimal('Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('-1'))
        Decimal('-0')
        >>> c.power(Decimal('-Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('-Infinity'), Decimal('1'))
        Decimal('-Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('2'))
        Decimal('Infinity')
        >>> c.power(Decimal('0'), Decimal('0'))
        Decimal('NaN')

        >>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
        Decimal('11')
        >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
        Decimal('-11')
        >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
        Decimal('1')
        >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
        Decimal('11')
        >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
        Decimal('11729830')
        >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
        Decimal('-0')
        >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
        Decimal('1')
        >>> ExtendedContext.power(7, 7)
        Decimal('823543')
        >>> ExtendedContext.power(Decimal(7), 7)
        Decimal('823543')
        >>> ExtendedContext.power(7, Decimal(7), 2)
        Decimal('1')
        Tr�rLr�N)r�r7r�rw)r0r-rsrr�r)r)r+�powers
Iz
Context.powercCst|dd�}|j||d�S)a
Returns a value equal to 'a' (rounded), having the exponent of 'b'.

        The coefficient of the result is derived from that of the left-hand
        operand.  It may be rounded using the current rounding setting (if the
        exponent is being increased), multiplied by a positive power of ten (if
        the exponent is being decreased), or is unchanged (if the exponent is
        already equal to that of the right-hand operand).

        Unlike other operations, if the length of the coefficient after the
        quantize operation would be greater than precision then an Invalid
        operation condition is raised.  This guarantees that, unless there is
        an error condition, the exponent of the result of a quantize is always
        equal to that of the right-hand operand.

        Also unlike other operations, quantize will never raise Underflow, even
        if the result is subnormal and inexact.

        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001'))
        Decimal('2.170')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01'))
        Decimal('2.17')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1'))
        Decimal('2.2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0'))
        Decimal('2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1'))
        Decimal('0E+1')
        >>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity'))
        Decimal('-Infinity')
        >>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1'))
        Decimal('-0')
        >>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5'))
        Decimal('-0E+5')
        >>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1'))
        Decimal('217.0')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0'))
        Decimal('217')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1'))
        Decimal('2.2E+2')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
        Decimal('2E+2')
        >>> ExtendedContext.quantize(1, 2)
        Decimal('1')
        >>> ExtendedContext.quantize(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.quantize(1, Decimal(2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+res7zContext.quantizecCstd�S)zkJust returns 10, as this is Decimal, :)

        >>> ExtendedContext.radix()
        Decimal('10')
        r�r�r�r)r)r+r��sz
Context.radixcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)aReturns the remainder from integer division.

        The result is the residue of the dividend after the operation of
        calculating integer division as described for divide-integer, rounded
        to precision digits if necessary.  The sign of the result, if
        non-zero, is the same as that of the original dividend.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3'))
        Decimal('2.1')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
        Decimal('1.0')
        >>> ExtendedContext.remainder(22, 6)
        Decimal('4')
        >>> ExtendedContext.remainder(Decimal(22), 6)
        Decimal('4')
        >>> ExtendedContext.remainder(22, Decimal(6))
        Decimal('4')
        Tr�rLr�N)r�r�r�rwr�r)r)r+r��s
zContext.remaindercCst|dd�}|j||d�S)aGReturns to be "a - b * n", where n is the integer nearest the exact
        value of "x / b" (if two integers are equally near then the even one
        is chosen).  If the result is equal to 0 then its sign will be the
        sign of a.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3'))
        Decimal('-0.9')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6'))
        Decimal('-2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
        Decimal('-0.3')
        >>> ExtendedContext.remainder_near(3, 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(Decimal(3), 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(3, Decimal(11))
        Decimal('3')
        Tr�rL)r�r�r�r)r)r+r��szContext.remainder_nearcCst|dd�}|j||d�S)aNReturns a rotated copy of a, b times.

        The coefficient of the result is a rotated copy of the digits in
        the coefficient of the first operand.  The number of places of
        rotation is taken from the absolute value of the second operand,
        with the rotation being to the left if the second operand is
        positive or to the right otherwise.

        >>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
        Decimal('400000003')
        >>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
        Decimal('12')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
        Decimal('891234567')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
        Decimal('345678912')
        >>> ExtendedContext.rotate(1333333, 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(Decimal(1333333), 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(1333333, Decimal(1))
        Decimal('13333330')
        Tr�rL)r�r�r�r)r)r+r��szContext.rotatecCst|dd�}|�|�S)a�Returns True if the two operands have the same exponent.

        The result is never affected by either the sign or the coefficient of
        either operand.

        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001'))
        False
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01'))
        True
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1'))
        False
        >>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
        True
        >>> ExtendedContext.same_quantum(10000, -1)
        True
        >>> ExtendedContext.same_quantum(Decimal(10000), -1)
        True
        >>> ExtendedContext.same_quantum(10000, Decimal(-1))
        True
        Tr�)r�r>r�r)r)r+r>szContext.same_quantumcCst|dd�}|j||d�S)a3Returns the first operand after adding the second value its exp.

        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
        Decimal('0.0750')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
        Decimal('7.50')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
        Decimal('7.50E+3')
        >>> ExtendedContext.scaleb(1, 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(Decimal(1), 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(1, Decimal(4))
        Decimal('1E+4')
        Tr�rL)r�r�r�r)r)r+r�$szContext.scalebcCst|dd�}|j||d�S)a{Returns a shifted copy of a, b times.

        The coefficient of the result is a shifted copy of the digits
        in the coefficient of the first operand.  The number of places
        to shift is taken from the absolute value of the second operand,
        with the shift being to the left if the second operand is
        positive or to the right otherwise.  Digits shifted into the
        coefficient are zeros.

        >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
        Decimal('400000000')
        >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
        Decimal('0')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
        Decimal('1234567')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
        Decimal('345678900')
        >>> ExtendedContext.shift(88888888, 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(Decimal(88888888), 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(88888888, Decimal(2))
        Decimal('888888800')
        Tr�rL)r�r�r�r)r)r+r�7sz
Context.shiftcCst|dd�}|j|d�S)a�Square root of a non-negative number to context precision.

        If the result must be inexact, it is rounded using the round-half-even
        algorithm.

        >>> ExtendedContext.sqrt(Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.sqrt(Decimal('-0'))
        Decimal('-0')
        >>> ExtendedContext.sqrt(Decimal('0.39'))
        Decimal('0.624499800')
        >>> ExtendedContext.sqrt(Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.sqrt(Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.sqrt(Decimal('1.0'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('1.00'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('7'))
        Decimal('2.64575131')
        >>> ExtendedContext.sqrt(Decimal('10'))
        Decimal('3.16227766')
        >>> ExtendedContext.sqrt(2)
        Decimal('1.41421356')
        >>> ExtendedContext.prec
        9
        Tr�rL)r�rHr�r)r)r+rHUszContext.sqrtcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a&Return the difference between the two operands.

        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07'))
        Decimal('0.23')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30'))
        Decimal('0.00')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
        Decimal('-0.77')
        >>> ExtendedContext.subtract(8, 5)
        Decimal('3')
        >>> ExtendedContext.subtract(Decimal(8), 5)
        Decimal('3')
        >>> ExtendedContext.subtract(8, Decimal(5))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�subtractus
zContext.subtractcCst|dd�}|j|d�S)a�Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.

        The operation is not affected by the context.

        >>> ExtendedContext.to_eng_string(Decimal('123E+1'))
        '1.23E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E+3'))
        '123E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E-10'))
        '12.3E-9'
        >>> ExtendedContext.to_eng_string(Decimal('-123E-12'))
        '-123E-12'
        >>> ExtendedContext.to_eng_string(Decimal('7E-7'))
        '700E-9'
        >>> ExtendedContext.to_eng_string(Decimal('7E+1'))
        '70'
        >>> ExtendedContext.to_eng_string(Decimal('0E+1'))
        '0.00E+3'

        Tr�rL)r�r�r�r)r)r+r��szContext.to_eng_stringcCst|dd�}|j|d�S)zyConverts a number to a string, using scientific notation.

        The operation is not affected by the context.
        Tr�rL)r�r�r�r)r)r+�
to_sci_string�szContext.to_sci_stringcCst|dd�}|j|d�S)akRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting; Inexact and Rounded flags
        are allowed in this operation.  The rounding mode is taken from the
        context.

        >>> ExtendedContext.to_integral_exact(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_exact(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rBr�r)r)r+rB�szContext.to_integral_exactcCst|dd�}|j|d�S)aLRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting, except that no flags will
        be set.  The rounding mode is taken from the context.

        >>> ExtendedContext.to_integral_value(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_value(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_value(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_value(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_value(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rr�r)r)r+r�szContext.to_integral_value)	NNNNNNNNN)N)rR)N)Xr4r5r6r7r�r�r�r�r�r�r�rNr�rCrMr�rir�r�r�r�r�r�rDr�r�rmr�r�rMr�rNrJrRr�r�r�rSr�r�r�rWrrVrWr=r�rYr�rZr�r[r\rfrirjrxrzr{ryr�r~r�rr�r�r�r�r�r;r�r�r�rr�r�r�r�r>r�r�rHr�r�r�rBrr�r)r)r)r+rs��
$



$#


%
 #2
P:&" c@s"eZdZdZddd�Zdd�ZdS)rn�rCrVrWNcCsf|dkrd|_d|_d|_nFt|t�rD|j|_t|j�|_|j|_n|d|_|d|_|d|_dS)Nr&r.r^)rCrVrWrdrr;r<rP)r0ryr)r)r+r��s



z_WorkRep.__init__cCsd|j|j|jfS)Nz(%r, %r, %r)r�r�r)r)r+r�sz_WorkRep.__repr__)N)r4r5r6r�r�r�r)r)r)r+rn�s
rncCs�|j|jkr|}|}n|}|}tt|j��}tt|j��}|jtd||d�}||jd|krpd|_||_|jd|j|j9_|j|_||fS)zcNormalizes op1, op2 to have the same exp and length of coefficient.

    Done during addition.
    r�r^r.r�)rWrkrerVr�)r�r�rFZtmpr�Ztmp_lenZ	other_lenrWr)r)r+r�sr�cCsb|dkrdS|dkr |d|Stt|��}t|�t|�d��}||krPdS|d|SdS)a Given integers n and e, return n * 10**e if it's an integer, else None.

    The computation is designed to avoid computing large powers of 10
    unnecessarily.

    >>> _decimal_lshift_exact(3, 4)
    30000
    >>> _decimal_lshift_exact(300, -999999999)  # returns None

    r&r�rRN)rermrk�rstrip)r9r�Zstr_nZval_nr)r)r+r#(sr#cCsB|dks|dkrtd��d}||kr>||||d?}}q|S)z�Closest integer to the square root of the positive integer n.  a is
    an initial approximation to the square root.  Any positive integer
    will do for a, but the closer a is to the square root of n the
    faster convergence will be.

    r&z3Both arguments to _sqrt_nearest should be positive.r.)rq)r9r-rsr)r)r+�
_sqrt_nearest=sr�cCs2d|>||?}}|d||d@|d@|kS)z�Given an integer x and a nonnegative integer shift, return closest
    integer to x / 2**shift; use round-to-even in case of a tie.

    r.r^r))r&r�rsr�r)r)r+�_rshift_nearestLsr�cCs&t||�\}}|d||d@|kS)zaClosest integer to a/b, a and b positive integers; rounds to even
    in the case of a tie.

    r^r.)r�)r-rsr�r�r)r)r+�_div_nearestTsr�rc		Cs�||}d}||kr(t|�||>|ksD||krxt|�||?|krxt||d>|t||t||�|��}|d7}qtdtt|��d|�}t||�}t||�}t|ddd�D]}t||�t|||�}q�t|||�S)a�Integer approximation to M*log(x/M), with absolute error boundable
    in terms only of x/M.

    Given positive integers x and M, return an integer approximation to
    M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
    between the approximation and the exact result is at most 22.  For
    L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
    both cases these are upper bounds on the error; it will usually be
    much smaller.r&r.���r\r�)rmr�r�r�rVrkrer)	r&�M�Lr)�R�TZyshift�wr�r)r)r+�_ilog\s"���


r�c
Cs�|d7}tt|��}||||dk}|dkr�d|}|||}|dkrZ|d|9}nt|d|�}t||�}t|�}t|||�}||}	nd}t|d|�}	t|	|d�S)z�Given integers c, e and p with c > 0, p >= 0, compute an integer
    approximation to 10**p * log10(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r��
_log10_digits)
rFr�r%rGr�r�r��log_dZlog_10Zlog_tenpowerr)r)r+rh�s 

rhc	Cs�|d7}tt|��}||||dk}|dkrr|||}|dkrR|d|9}nt|d|�}t|d|�}nd}|r�ttt|���d}||dkr�t|t||�d|�}q�d}nd}t||d�S)z�Given integers c, e and p with c > 0, compute an integer
    approximation to 10**p * log(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r�rmr�)	rFr�r%rGr�r�r�r6Z	f_log_tenr)r)r+rd�s"rdc@s eZdZdZdd�Zdd�ZdS)�
_Log10Memoizez�Class to compute, store, and allow retrieval of, digits of the
    constant log(10) = 2.302585....  This constant is needed by
    Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__.cCs
d|_dS)NZ/23025850929940456840179914546843642076011014886)r}r�r)r)r+r��sz_Log10Memoize.__init__cCs�|dkrtd��|t|j�kr�d}d||d}tttd||�d��}||d�d|krbql|d7}q"|�d�dd	�|_t|jd|d
��S)ztGiven an integer p >= 0, return floor(10**p)*log(10).

        For example, self.getdigits(3) returns 2302.
        r&zp should be nonnegativer\r�r^r!NrRr�r.)rqrkr}rer�r�r�rV)r0r%r6r�r}r)r)r+�	getdigits�s	
z_Log10Memoize.getdigitsN)r4r5r6r7r�r�r)r)r)r+r��sr�c	Cs�t||>|�}tdtt|��d|�}t||�}||>}t|ddd�D]}t|||||�}qPt|ddd�D]"}||d>}t||||�}q|||S)z�Given integers x and M, M > 0, such that x/M is small in absolute
    value, compute an integer approximation to M*exp(x/M).  For 0 <=
    x/M <= 2.4, the absolute error in the result is bounded by 60 (and
    is usually much smaller).r�r\r.r&r�r^)r"rVrkrer�r)	r&r�r�r�r�r)ZMshiftrr�r)r)r+�_iexp�s
r�c	Cs�|d7}td|tt|��d�}||}||}|dkrH|d|}n|d|}t|t|��\}}t|d|�}tt|d|�d�||dfS)a�Compute an approximation to exp(c*10**e), with p decimal places of
    precision.

    Returns integers d, f such that:

      10**(p-1) <= d <= 10**p, and
      (d-1)*10**f < exp(c*10**e) < (d+1)*10**f

    In other words, d*10**f is an approximation to exp(c*10**e) with p
    digits of precision, and with an error in d of at most 1.  This is
    almost, but not quite, the same as the error being < 1ulp: when d
    = 10**(p-1) the error could be up to 10 ulp.r^r&r.r�i�r\)r�rkrer�r�r�r�)	rFr�r%r6r�r�ZcshiftZquotr,r)r)r+rT$srTcCs�ttt|���|}t||||d�}||}|dkrJ||d|}nt||d|�}|dkr�tt|��|dk|dkkr�d|ddd|}	}
q�d|d|}	}
n,t||d|d�\}	}
t|	d�}	|
d7}
|	|
fS)a5Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
    y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:

      10**(p-1) <= c <= 10**p, and
      (c-1)*10**e < x**y < (c+1)*10**e

    in other words, c*10**e is an approximation to x**y with p digits
    of precision, and with an error in c of at most 1.  (This is
    almost, but not quite, the same as the error being < 1ulp: when c
    == 10**(p-1) we can only guarantee error < 10ulp.)

    We assume that: x is positive and not equal to 1, and y is nonzero.
    r.r&r�)rkrermrdr�rT)r'r(r*r+r%rsZlxcr�Zpcr�rWr)r)r+r1Hs
r1r!�F�5�(�r]�r�r~)	r��2�3�4�5�6�7�8rDcCs0|dkrtd��t|�}dt|�||dS)z@Compute a lower bound for 100*log10(c) for a positive integer c.r&z0The argument to _log10_lb should be nonnegative.r!)rqrerk)rFZ
correctionZstr_cr)r)r+r$rsr$cCsLt|t�r|St|t�r t|�S|r8t|t�r8t�|�S|rHtd|��tS)z�Convert other to Decimal.

    Verifies that it's ok to use in an implicit construction.
    If allow_float is true, allow conversion from float;  this
    is used in the comparison methods (__eq__ and friends).

    r�)rdrrVrurvrwr�)r�r�Zallow_floatr)r)r+r�}s


r�cCs�t|t�r||fSt|tj�rR|jsDt|jtt|j	�|j
�|j�}|t|j�fS|rrt|tj
�rr|jdkrr|j}t|t�r�t�}|r�d|jt<n|�td�|t�|�fSttfS)z�Given a Decimal instance self and a Python object other, return
    a pair (s, o) of Decimal instances such that "s op o" is
    equivalent to "self op other" for any of the 6 comparison
    operators "op".

    r&r.ra)rdr�_numbersZRationalrQr:r;rerVr<�denominatorrP�	numeratorZComplexr�r�rurr4rrirvr�)r0r�r�r1r)r)r+r��s(
�
�r�r i?Bi���)rFrEr3r4rGr<r�r�r_)rFrEr3r4a�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
z0*$z50*$z�\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
cCs�t�|�}|dkrtd|��|��}|d}|d}|ddk	|d<|drv|dk	rbtd|��|dk	rvtd|��|p|d|d<|p�d	|d<|d
dkr�d|d
<t|dp�d
�|d<|ddk	r�t|d�|d<|ddkr�|ddks�|ddkr�d|d<|ddk�rfd|d<|dk�r&t��}|ddk	�r@td|��|d|d<|d|d<|d|d<n*|ddk�r|d|d<ddg|d<d|d<|S)a�Parse and validate a format specifier.

    Turns a standard numeric format specifier into a dict, with the
    following entries:

      fill: fill character to pad field to minimum width
      align: alignment type, either '<', '>', '=' or '^'
      sign: either '+', '-' or ' '
      minimumwidth: nonnegative integer giving minimum width
      zeropad: boolean, indicating whether to pad with zeros
      thousands_sep: string to use as thousands separator, or ''
      grouping: grouping for thousands separators, in format
        used by localeconv
      decimal_point: string to use for decimal point
      precision: nonnegative integer giving precision, or None
      type: one of the characters 'eEfFgG%', or None

    NzInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>rCrU�minimumwidthrRr�r&r�ZgGnr.r9r��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointrTr\r�)�_parse_format_specifier_regex�matchrq�	groupdictrV�_locale�
localeconv)�format_specr�rzZformat_dictrrr)r)r+r�sT
��
�r�c	Cs�|d}|d}||t|�t|�}|d}|dkrF|||}nj|dkr\|||}nT|dkrr|||}n>|dkr�t|�d}|d	|�||||d	�}ntd
��|S)z�Given an unpadded, non-aligned numeric string 'body' and sign
    string 'sign', add padding and alignment conforming to the given
    format specifier dictionary 'spec' (as produced by
    parse_format_specifier).

    r	rr�<r�=�^r^NzUnrecognised alignment field)rkrq)	rCr�r�r	rZpaddingrr�Zhalfr)r)r+r�ms"r�cCspddlm}m}|sgS|ddkrJt|�dkrJ||dd�||d��S|dtjkrd|dd�Std��dS)zyConvert a localeconv-style grouping into a (possibly infinite)
    iterable of integers representing group lengths.

    r&)�chain�repeatr�r^Nr�z unrecognised format for grouping)�	itertoolsrrrkr�CHAR_MAXrq)rrrr)r)r+�_group_lengths�s
rcCs�|d}|d}g}t|�D]�}|dkr0td��ttt|�|d�|�}|�d|t|�||d��|d|�}||8}|s�|dkr�q�|t|�8}qtt|�|d�}|�d|t|�||d��|�t|��S)anInsert thousands separators into a digit string.

    spec is a dictionary whose keys should include 'thousands_sep' and
    'grouping'; typically it's the result of parsing the format
    specifier using _parse_format_specifier.

    The min_width keyword argument gives the minimum length of the
    result, which will be padded on the left with zeros if necessary.

    If necessary, the zero padding adds an extra '0' on the left to
    avoid a leading thousands separator.  For example, inserting
    commas every three digits in '123456', with min_width=8, gives
    '0,123,456', even though that has length 9.

    r
rr&zgroup length should be positiver.rRN)rrqr�r�rkrrrs�reversed)r}r��	min_width�sepr�groupsrGr)r)r+�_insert_thousands_sep�s $$rcCs$|rdS|ddkr|dSdSdS)zDetermine sign character.rUrCz +rTNr))�is_negativer�r)r)r+r��s
r�cCs�t||�}|s|dr"|d|}|dks6|ddkr\ddddd�|d}|d	�||�7}|dd
krp|d
7}|dr�|dt|�t|�}nd}t|||�}t||||�S)
acFormat a number, given the following data:

    is_negative: true if the number is negative, else false
    intpart: string of digits that must appear before the decimal point
    fracpart: string of digits that must come after the point
    exp: exponent, as an integer
    spec: dictionary resulting from parsing the format specifier

    This function uses the information in spec to:
      insert separators (decimal separator and thousands separators)
      format the sign
      format the exponent
      add trailing '%' for the '%' type
      zero-pad if necessary
      fill and align if necessary
    Zaltrr&r�r�r�r�)r�r�r�r�z{0}{1:+}r�rr	)r��formatrkrr�)r r{r|rWr�rCZecharrr)r)r+r��s
r�ZInfz-Infr�r�r^)N)F)r&)r)r)FF)F)N)r.)zr7�__all__r4Z	__xname__�__version__Z__libmpdec_version__ZmathrZnumbersr�sys�collectionsr'Z_namedtupler�ImportErrorrrrrrrrrr$r%�maxsizer r!r"r#�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrrwrr2r�r�ZcontextvarsZ
ContextVarrHrrrrbrr:�Number�registerrOrrnr�rVr�r"r#r�r�r�r�rhrdr�r�r�r�rTr1r$r�r�rrr�re�compile�VERBOSE�
IGNORECASErrfr�r�DOTALLr
Zlocalerr�r�rrr�r�rcrbr>rPr/rOrA�	hash_info�modulusr�r�r�r�r�r�r�r)r)r)r+�<module>s�e�#

&
���

.
^

0",#
%$+�

*���
�
�
P
%
)traceback.cpython-38.pyc000064400000046744151450073350011135 0ustar00U

e5d;\�@s:dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddgZd3dd�Zdd�Zd4dd�Zd5dd	�Z	d6dd�Z
dZdZd7dd�Z
d8d d�Zd!d�Zd"d#�Zd$d%�Zd9d&d
�Zd:d'd�Zd;d(d
�Zd<d)d�Zd=d*d�Zd>d+d�Zd,d�ZGd-d�d�Zd.d�Zd/d�Zd0ZGd1d�de�ZGd2d�d�ZdS)?z@Extract, format and print information about Python stack traces.�N�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbcCs4|dkrtj}t�|���D]}t||dd�qdS)zyPrint the list of tuples as returned by extract_tb() or
    extract_stack() as a formatted stack trace to the given file.N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�item�r �!/usr/lib64/python3.8/traceback.py�
print_listsr"cCst�|���S)a�Format a list of tuples or FrameSummary objects for printing.

    Given a list of tuples or FrameSummary objects as returned by
    extract_tb() or extract_stack(), return a list of strings ready
    for printing.

    Each string in the resulting list corresponds to the item with the
    same index in the argument list.  Each string ends in a newline;
    the strings may contain internal newlines as well, for those items
    whose source text line is not None.
    )rrr)rr r r!rscCstt||d�|d�dS)aPrint up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    ��limit�rN)r"r)�tbr$rr r r!r-scCst||d���S)z5A shorthand for 'format_list(extract_tb(tb, limit))'.r#)rr�r&r$r r r!r7scCstjt|�|d�S)a#
    Return a StackSummary object representing a list of
    pre-processed entries from traceback.

    This is useful for alternate formatting of stack traces.  If
    'limit' is omitted or None, all entries are extracted.  A
    pre-processed stack trace entry is a FrameSummary object
    containing attributes filename, lineno, name, and line
    representing the information that is usually printed for a stack
    trace.  The line is a string with leading and trailing
    whitespace stripped; if the source is not available it is None.
    r#)r�extractrr'r r r!r;s
zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

TcCsB|dkrtj}tt|�|||d�j|d�D]}t||dd�q*dS)a�Print exception up to 'limit' stack trace entries from 'tb' to 'file'.

    This differs from print_tb() in the following ways: (1) if
    traceback is not None, it prints a header "Traceback (most recent
    call last):"; (2) it prints the exception type and value after the
    stack trace; (3) if type is SyntaxError and value has the
    appropriate format, it prints the line where the syntax error
    occurred with a caret on the next line indicating the approximate
    position of the error.
    Nr#��chainrr)rrr�typerr)�etype�valuer&r$rr*�liner r r!rWs��
cCs ttt|�|||d�j|d��S)azFormat a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    r#r))�listrr+r)r,r-r&r$r*r r r!rls��cCstt||d����S)aFormat the exception part of a traceback.

    The arguments are the exception type and value such as given by
    sys.last_type and sys.last_value. The return value is a list of
    strings, each ending in a newline.

    Normally, the list contains a single string; however, for
    SyntaxError exceptions, it contains several lines that (when
    printed) display detailed information about where the syntax
    error occurred.

    The message indicating which exception occurred is always the last
    string in the list.

    N)r/rr)r,r-r r r!r|scCs.t|�}|dks|sd|}nd||f}|S)Nz%s
z%s: %s
)�	_some_str)r,r-�valuestrr.r r r!�_format_final_exc_line�s

r2cCs*z
t|�WSdt|�jYSXdS)Nz<unprintable %s object>)�strr+�__name__)r-r r r!r0�s
r0cCstt��|||d��dS)z>Shorthand for 'print_exception(*sys.exc_info(), limit, file)'.�r$rr*N)rr�exc_infor5r r r!r	�scCsd�tt��||d���S)z%Like print_exc() but return a string.r�r$r*)�joinrrr6r7r r r!r
�scCs.ttd�std��ttjtjtj|||�dS)znThis is a shorthand for 'print_exception(sys.last_type,
    sys.last_value, sys.last_traceback, limit, file)'.�	last_typezno last exceptionN)�hasattrr�
ValueErrorrr9�
last_value�last_tracebackr5r r r!r�s
�cCs*|dkrt��j}tt||d�|d�dS)z�Print a stack trace from its invocation point.

    The optional 'f' argument can be used to specify an alternate
    stack frame at which to start. The optional 'limit' and 'file'
    arguments have the same meaning as for print_exception().
    Nr#r%)r�	_getframe�f_backr"r)�fr$rr r r!r
�s
cCs"|dkrt��j}tt||d��S)z5Shorthand for 'format_list(extract_stack(f, limit))'.Nr#)rr>r?rr)r@r$r r r!r�s
cCs0|dkrt��j}tjt|�|d�}|��|S)asExtract the raw traceback from the current stack frame.

    The return value has the same format as for extract_tb().  The
    optional 'f' and 'limit' arguments have the same meaning as for
    print_stack().  Each item in the list is a quadruple (filename,
    line number, function name, text), and the entries are in order
    from oldest to newest stack frame.
    Nr#)rr>r?rr(r�reverse)r@r$�stackr r r!r�s
	
cCs8|dk	r4z|j��Wntk
r*YnX|j}qdS)zEClear all references to local variables in the frames of a traceback.N)�tb_frame�clear�RuntimeError�tb_next�r&r r r!r�sc@sZeZdZdZdZdddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
edd��ZdS)ra,A single frame from a traceback.

    - :attr:`filename` The filename for the frame.
    - :attr:`lineno` The line within filename for the frame that was
      active when the frame was captured.
    - :attr:`name` The name of the function or method that was executing
      when the frame was captured.
    - :attr:`line` The text from the linecache module for the
      of code that was running when the frame was captured.
    - :attr:`locals` Either None if locals were not supplied, or a dict
      mapping the name to the repr() of the variable.
    )�filename�lineno�name�_line�localsTN)�lookup_linerLr.cCsB||_||_||_||_|r"|j|r8dd�|��D�nd|_dS)a�Construct a FrameSummary.

        :param lookup_line: If True, `linecache` is consulted for the source
            code line. Otherwise, the line will be looked up when first needed.
        :param locals: If supplied the frame locals, which will be captured as
            object representations.
        :param line: If provided, use this instead of looking up the line in
            the linecache.
        cSsi|]\}}|t|��qSr )�repr)�.0�k�vr r r!�
<dictcomp>sz)FrameSummary.__init__.<locals>.<dictcomp>N)rHrIrJrKr.�itemsrL)�selfrHrIrJrMrLr.r r r!�__init__�szFrameSummary.__init__cCs`t|t�r:|j|jko8|j|jko8|j|jko8|j|jkSt|t�r\|j|j|j|jf|kStS�N)	�
isinstancerrHrIrJrL�tupler.�NotImplemented�rT�otherr r r!�__eq__s

�
�
�
zFrameSummary.__eq__cCs|j|j|j|jf|SrV)rHrIrJr.)rT�posr r r!�__getitem__szFrameSummary.__getitem__cCst|j|j|j|jg�SrV)�iterrHrIrJr.�rTr r r!�__iter__szFrameSummary.__iter__cCsdj|j|j|jd�S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)rHrIrJ)rrHrIrJr`r r r!�__repr__s
�zFrameSummary.__repr__cCsdS)N�r r`r r r!�__len__szFrameSummary.__len__cCs&|jdkr t�|j|j���|_|jSrV)rK�	linecache�getlinerHrI�stripr`r r r!r.s
zFrameSummary.line)
r4�
__module__�__qualname__�__doc__�	__slots__rUr\r^rarbrd�propertyr.r r r r!r�s
�
ccs4|dkrt��jj}|dk	r0||jfV|j}qdS)z�Walk a stack yielding the frame and line number for each frame.

    This will follow f.f_back from the given frame. If no frame is given, the
    current stack is used. Usually used with StackSummary.extract.
    N)rr>r?�f_lineno)r@r r r!r$s
ccs"|dk	r|j|jfV|j}qdS)z�Walk a traceback yielding the frame and line number for each frame.

    This will follow tb.tb_next (and thus is in the opposite order to
    walk_stack). Usually used with StackSummary.extract.
    N)rC�	tb_linenorFrGr r r!r1s�c@s:eZdZdZedddd�dd��Zedd	��Zd
d�ZdS)rzA stack of frames.NTF�r$�lookup_lines�capture_localsc

Cs�|dkr(ttdd�}|dk	r(|dkr(d}|dk	rV|dkrFt�||�}ntj||d�}|�}t�}|D]Z\}}|j}	|	j}
|	j	}|�
|
�t�|
|j
�|r�|j}nd}|�t|
||d|d��qf|D]}
t�|
�q�|r�|D]
}|jq�|S)a?Create a StackSummary from a traceback or stack object.

        :param frame_gen: A generator that yields (frame, lineno) tuples to
            include in the stack.
        :param limit: None to include all frames or the number of frames to
            include.
        :param lookup_lines: If True, lookup lines for each frame immediately,
            otherwise lookup is deferred until the frame is rendered.
        :param capture_locals: If True, the local variables from each frame will
            be captured as object representations into the FrameSummary.
        N�tracebacklimitr)�maxlenF)rMrL)�getattrr�	itertools�islice�collections�deque�set�f_code�co_filename�co_name�addre�	lazycache�	f_globals�f_locals�appendr�
checkcacher.)
�klass�	frame_genr$rqrr�result�fnamesr@rI�corHrJr�r r r!r(As@
�
zStackSummary.extractc	CsLt�}|D]<}t|t�r$|�|�q
|\}}}}|�t||||d��q
|S)z�
        Create a StackSummary object from a supplied list of
        FrameSummary objects or old-style list of tuples.
        )r.)rrWrr�)r��a_listr��framerHrIrJr.r r r!rqs

zStackSummary.from_listc
Csng}d}d}d}d}|D�]}|dksT||jksT|dksT||jksT|dksT||jkr�|tkr�|t8}|�d|�d|dkr|dnd�d��|j}|j}|j}d}|d7}|tkr�qg}|�d	�|j|j|j��|jr�|�d
�|j����|j�r t	|j�
��D]\}}	|�dj||	d���q|�d�|��q|tk�rj|t8}|�d|�d|dk�r^dnd�d��|S)
aFormat the stack ready for printing.

        Returns a list of strings ready for printing.  Each string in the
        resulting list corresponds to a single frame from the stack.
        Each string ends in a newline; the strings may contain internal
        newlines as well, for those items with source text lines.

        For long sequences of the same frame and line, the first few
        repetitions are shown, followed by a summary line stating the exact
        number of further repetitions.
        Nrz  [Previous line repeated z
 more time��srz]
z  File "{}", line {}, in {}
�    {}
z    {name} = {value}
)rJr-)rHrIrJ�_RECURSIVE_CUTOFFr�rr.rgrL�sortedrSr8)
rTr��	last_file�	last_line�	last_name�countr��rowrJr-r r r!r�sZ
������
�zStackSummary.format)r4rhrirj�classmethodr(rrr r r r!r>s�/
c@s^eZdZdZddddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�dd�ZdS)ra�An exception ready for rendering.

    The traceback module captures enough attributes from the original exception
    to this intermediary form to ensure that no references are held, while
    still being able to fully print or format it.

    Use `from_exception` to create TracebackException instances from exception
    objects, or the constructor to create TracebackException instances from
    individual components.

    - :attr:`__cause__` A TracebackException of the original *__cause__*.
    - :attr:`__context__` A TracebackException of the original *__context__*.
    - :attr:`__suppress_context__` The *__suppress_context__* value from the
      original exception.
    - :attr:`stack` A `StackSummary` representing the traceback.
    - :attr:`exc_type` The class of the original traceback.
    - :attr:`filename` For syntax errors - the filename where the error
      occurred.
    - :attr:`lineno` For syntax errors - the linenumber where the error
      occurred.
    - :attr:`text` For syntax errors - the text where the error
      occurred.
    - :attr:`offset` For syntax errors - the offset into the text where the
      error occurred.
    - :attr:`msg` For syntax errors - the compiler error message.
    NTF�r$rqrr�_seenc	CsJ|dkrt�}|�t|��|r\|jdk	r\t|j�|kr\tt|j�|j|jj|d||d�}nd}|r�|jdk	r�t|j�|kr�tt|j�|j|jj|d||d�}	nd}	||_|	|_|r�|jnd|_t	j
t|�|||d�|_||_
t|�|_|�r8t|t��r8|j|_|j}
|
dk	�rt|
�nd|_|j|_|j|_|j|_|�rF|��dS)NFr�rp)rzr~�id�	__cause__rr+�
__traceback__�__context__�__suppress_context__rr(rrB�exc_typer0�_str�
issubclass�SyntaxErrorrHrIr3�text�offset�msg�_load_lines)rTr��	exc_value�
exc_tracebackr$rqrrr��cause�context�lnor r r!rU�sd��	��	��
zTracebackException.__init__cOs|t|�||jf|�|�S)z.Create a TracebackException from an exception.)r+r�)�cls�exc�args�kwargsr r r!�from_exceptionsz!TracebackException.from_exceptioncCs6|jD]
}|jq|jr"|j��|jr2|j��dS)z7Private API. force all lines in the stack to be loaded.N)rBr.r�r�r�)rTr�r r r!r�s

zTracebackException._load_linescCs|j|jkSrV)�__dict__rZr r r!r\szTracebackException.__eq__cCs|jSrV)r�r`r r r!�__str__szTracebackException.__str__ccs6|jdkrtd|j�VdS|jj}|jj}|dkr@|d|}t|jt�s^t||j�VdSd}|jdk	r�d�|j	pxd|j�Vn|j	dk	r�d�|j	�}|j
}|j}|dk	�rd�|���V|dk	�r|�
d	�}tt|�|�d
}|d|���}dd�|D�}d
�d�|��V|j�p d}d�|||�VdS)a�Format the exception part of the traceback.

        The return value is a generator of strings, each ending in a newline.

        Normally, the generator emits a single string; however, for
        SyntaxError exceptions, it emits several lines that (when
        printed) display detailed information about where the syntax
        error occurred.

        The message indicating which exception occurred is always the last
        string in the output.
        N)�__main__�builtins�.rz  File "{}", line {}
z<string>z ({})r��
r�css|]}|��r|pdVqdS)� N)�isspace)rO�cr r r!�	<genexpr>Msz;TracebackException.format_exception_only.<locals>.<genexpr>z    {}^
z<no detail available>z	{}: {}{}
)r�r2r�rirhr�r�rIrrHr�r�rg�rstrip�min�len�lstripr8r�)rT�stype�smod�filename_suffix�badliner��
caretspacer�r r r!r"s<

�



z(TracebackException.format_exception_onlyr)ccs�|rT|jdk	r*|jj|d�EdHtVn*|jdk	rT|jsT|jj|d�EdHtV|jrpdV|j��EdH|��EdHdS)a�Format the exception.

        If chain is not *True*, *__cause__* and *__context__* will not be formatted.

        The return value is a generator of strings, each ending in a newline and
        some containing internal newlines. `print_exception` is a wrapper around
        this method which just prints the lines to a file.

        The message indicating which exception occurred is always the last
        string in the output.
        Nr)z#Traceback (most recent call last):
)r�r�_cause_messager�r��_context_messagerBr)rTr*r r r!rRs

�zTracebackException.format)r4rhrirjrUr�r�r�r\r�rrr r r r!r�s�:
	0)N)NN)N)N)NNT)NT)NNT)NT)NNT)NNN)NN)NN) rjrxrvrer�__all__r"rrrrr�r�rrrr2r0r	r
rr
rrrrrrr�r/rrr r r r!�<module>sb�




��







A
zpty.cpython-38.opt-2.pyc000064400000006050151450073350010754 0ustar00U

e5d��@s�ddlmZddlZddlZddlZdddgZdZdZdZdZdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zeefdd�Zeefdd�ZdS)�)�selectN�openpty�fork�spawn��c	Cs>z
t��WSttfk
r"YnXt�\}}t|�}||fS�N)�osr�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fd�r�/usr/lib64/python3.8/pty.pyrs

c	CsLzt��\}}Wnttfk
r(YnXt�|�}t�|�||fSt�Sr)r	rr
r�ttyname�closer)rrrrrr�master_open"s

rc
CsndD]\}dD]R}d||}zt�|tj�}Wntk
rFYqYnX|d||fSqtd��dS)NZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devices)r	�open�O_RDWRr)�x�yZpty_name�fdrrrr2s
rcCsrt�|tj�}zddlm}m}Wntk
r:|YSXz|||d�|||d�Wntk
rlYnX|S)Nr)�ioctl�I_PUSHZptemZldterm)r	rrZfcntlrr�ImportErrorr)Ztty_name�resultrrrrrr
>s
r
c	Cs�zt��\}}Wnttfk
r(Yn4X|tkrTzt��Wntk
rRYnX||fSt�\}}t��}|tkr�t��t�|�t�	|t
�t�	|t�t�	|t�|tkr�t�|�t�
t�t�tj�}t�|�n
t�|�||fSr)r	�forkptyr
r�CHILD�setsidrrr�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidrrrZtmp_fdrrrrPs0



cCs"|rt�||�}||d�}qdSr)r	�write)r�data�nrrr�_writenxsr*cCst�|d�S)Ni)r	�read)rrrr�_read~sr,cCsv|tg}t|gg�\}}}||krF||�}|s:|�|�nt�t|�t|kr|t�}|sf|�t�qt||�qdSr)r#r�remover	r'r$r*)r�master_read�
stdin_readZfdsZrfdsZwfdsZxfdsr(rrr�_copy�sr0cCs�t|�td�kr|f}t�d|�t�\}}|tkrHtj|df|��zt�t	�}t�
t	�d}Wntjk
r~d}YnXzt|||�Wn(t
k
r�|r�t�t	tj|�YnXt�|�t�|d�dS)N�z	pty.spawnrr)�type�sys�auditrr r	�execlp�ttyZ	tcgetattrr#Zsetraw�errorr0rZ	tcsetattrZ	TCSAFLUSHr�waitpid)�argvr.r/r&r�modeZrestorerrrr�s&




)rr	r3r6�__all__r#r$r%r rrrr
rr*r,r0rrrrr�<module>	s"
(tarfile.cpython-38.opt-1.pyc000064400000211624151450073350011572 0ustar00U

&�.e��@sdZdZdZdZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXeefZzeef7ZWnek
r�YnXddd	d
ddd
ddddddddgZdZdZdZdZedZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2dZ3d-Z4d.Z5e5Z6e$e%e&e'e*e+e,e(e)e-e.e/fZ7e$e%e,e/fZ8e-e.e/fZ9d/Z:d0d1d2d3hZ;e<e<e<e=e=e=d4�Z>ej?d5k�r�d6Z@ne�A�Z@d7d8�ZBd9d:�ZCd;d<�ZDd=e6fd>d?�ZEd@dA�ZFdedfdBdC�ZGdDdE�ZHGdFd
�d
eI�ZJGdGd�deJ�ZKGdHd�deJ�ZLGdId�deJ�ZMGdJd
�d
eJ�ZNGdKd�deJ�ZOGdLdM�dMeO�ZPGdNdO�dOeO�ZQGdPdQ�dQeO�ZRGdRdS�dSeO�ZSGdTdU�dUeO�ZTGdVdW�dW�ZUGdXdY�dY�ZVGdZd[�d[eW�ZXGd\d]�d]eW�ZYGd^d_�d_e	jZ�Z[Gd`da�daeJ�Z\Gdbdc�dce\�Z]Gddde�dee\�Z^Gdfdg�dge\�Z_Gdhdi�die\�Z`Gdjdk�dke\�Zad{dldm�Zbdndo�Zcdpdq�Zddrds�Zeecedeedt�ZfeW�ZgGdud�deW�ZhGdvd�deW�Zidwd	�ZjeijZdxdy�Zkeldzk�r
ek�dS)|z,Read from and write to tar format archives.
z0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.�)�openN�TarFile�TarInfo�
is_tarfile�TarError�	ReadError�CompressionError�StreamError�ExtractError�HeaderError�ENCODING�USTAR_FORMAT�
GNU_FORMAT�
PAX_FORMAT�DEFAULT_FORMATrTz/etc/python/tarfile.cfg�i�sustar  sustar00�d��0�1�2�3�4�5�6�7�L�K�S�x�g�X��)�path�linkpath�size�mtime�uid�gid�uname�gnamer%r&r+r,)Zatime�ctimer(r)r*r'�nt�utf-8cCs8|dkrtd��|�||�}|d|�|t|�tS)z8Convert a string to a null-terminated bytes object.
    Nzmetadata cannot contain None)�
ValueError�encode�len�NUL)�s�length�encoding�errors�r8�/usr/lib64/python3.8/tarfile.py�stn�sr:cCs*|�d�}|dkr|d|�}|�||�S)z8Convert a null-terminated bytes object to a string.
    r���N)�find�decode)r4r6r7�pr8r8r9�nts�s
r?cCs�|ddkrbd}tt|�d�D]}|dK}|||d7}q |ddkr�dt|�d|}n@z"t|dd�}t|��p|d	d�}Wntk
r�td
��YnX|S)z/Convert a number field to a python number.
    r)��r#�rA��ascii�strict�0�invalid header)�ranger2r?�int�stripr0�InvalidHeaderError)r4�n�ir8r8r9�nti�srNrBcCs�t|�}d|kr$d|dkrDnntd|d|fd�t}n�|tkr�d|d|krrd|dkr�nnV|dkr�tdg�}ntdg�}d||}t|d�D]}|�d|d@�|dL}q�ntd	��|S)
z/Convert a python number to a number field.
    rrBr#z%0*orDrCr@rAzoverflow in number field)rI�bytesr3r�	bytearrayrH�insertr0)rL�digits�formatr4rMr8r8r9�itn�s 2
rTcCs0dtt�d|��}dtt�d|��}||fS)a�Calculate the checksum for a member's header by summing up all
       characters except for the chksum field which is treated as if
       it was filled with spaces. According to the GNU tar sources,
       some tars (Sun and NeXT) calculate chksum with signed char,
       which will be different if there are chars in the buffer with
       the high bit set. So we calculate two checksums, unsigned and
       signed.
    rCZ
148B8x356BZ
148b8x356b)�sum�structZunpack_from)�bufZunsigned_chksumZ
signed_chksumr8r8r9�calc_chksums�s	rXc	Cs�|pd}|dkrdS|dkr.t�|||�dSt||�\}}t|�D],}|�|�}t|�|krf|d��|�|�qD|dkr�|�|�}t|�|kr�|d��|�|�dS)zjCopy length bytes from fileobj src to fileobj dst.
       If length is None, copy the entire content.
    i@rN�unexpected end of data)�shutil�copyfileobj�divmodrH�readr2�write)	�srcZdstr5�	exception�bufsize�blocks�	remainder�brWr8r8r9r[�s$


r[cCs8ttjdd�}|dk	r(|�|d��|�}t|dd�dS)Nr6�backslashreplace� )�end)�getattr�sys�stdoutr1r=�print)r4r6r8r8r9�_safe_printsrlc@seZdZdZdS)rzBase exception.N��__name__�
__module__�__qualname__�__doc__r8r8r8r9rsc@seZdZdZdS)r
z%General exception for extract errors.Nrmr8r8r8r9r
sc@seZdZdZdS)rz&Exception for unreadable tar archives.Nrmr8r8r8r9rsc@seZdZdZdS)rz.Exception for unavailable compression methods.Nrmr8r8r8r9rsc@seZdZdZdS)r	z=Exception for unsupported operations on stream-like TarFiles.Nrmr8r8r8r9r	!sc@seZdZdZdS)rz!Base exception for header errors.Nrmr8r8r8r9r$sc@seZdZdZdS)�EmptyHeaderErrorzException for empty headers.Nrmr8r8r8r9rr'srrc@seZdZdZdS)�TruncatedHeaderErrorz Exception for truncated headers.Nrmr8r8r8r9rs*srsc@seZdZdZdS)�EOFHeaderErrorz"Exception for end of file headers.Nrmr8r8r8r9rt-srtc@seZdZdZdS)rKzException for invalid headers.Nrmr8r8r8r9rK0srKc@seZdZdZdS)�SubsequentHeaderErrorz3Exception for missing and invalid extended headers.Nrmr8r8r8r9ru3sruc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
_LowLevelFilez�Low-level file object. Supports reading and writing.
       It is used instead of a regular file object for streaming
       access.
    cCsFtjtjtjBtjBd�|}ttd�r2|tjO}t�||d�|_dS)N��r�w�O_BINARYi�)	�os�O_RDONLY�O_WRONLY�O_CREAT�O_TRUNC�hasattrrzr�fd)�self�name�moder8r8r9�__init__@s��

z_LowLevelFile.__init__cCst�|j�dS�N)r{�closer��r�r8r8r9r�Isz_LowLevelFile.closecCst�|j|�Sr�)r{r]r��r�r'r8r8r9r]Lsz_LowLevelFile.readcCst�|j|�dSr�)r{r^r��r�r4r8r8r9r^Osz_LowLevelFile.writeN)rnrorprqr�r�r]r^r8r8r8r9rv:s
	rvc@sreZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS)�_Streama�Class that serves as an adapter between TarFile and
       a stream-like object.  The stream-like object only
       needs to have a read() or write() method and is accessed
       blockwise.  Use of gzip or bzip2 compression is possible.
       A stream-like object could be for example: sys.stdin,
       sys.stdout, a socket, a tape device etc.

       _Stream is intended to be used only internally.
    c	Cs�d|_|dkrt||�}d|_|dkr6t|�}|��}|p<d|_||_||_||_||_d|_	d|_
d|_�zL|dkr�zddl}Wnt
k
r�td	��YnX||_|�d�|_|d
kr�|��|j|_n|��n�|dk�r:zddl}Wnt
k
�r
td��YnX|d
k�r.d|_|��|_t|_n
|��|_n||d
k�r�zddl}Wnt
k
�rntd��YnX|d
k�r�d|_|��|_|j|_n
|��|_n|dk�r�td|��Wn&|j�s�|j��d|_�YnXdS)z$Construct a _Stream object.
        TNF�*��r�gzzzlib module is not availablerx�bz2�bz2 module is not available�xz�lzma module is not available�tar�unknown compression type %r) �_extfileobjrv�_StreamProxy�getcomptyper�r��comptype�fileobjrarW�pos�closed�zlib�ImportErrorr�crc32�crc�
_init_read_gz�errorr`�_init_write_gzr��dbufZBZ2Decompressor�cmp�OSErrorZ
BZ2Compressor�lzmaZLZMADecompressor�	LZMAErrorZLZMACompressorr�)	r�r�r�r�r�rar�r�r�r8r8r9r�]sl












z_Stream.__init__cCst|d�r|js|��dS)Nr�)r�r�r�r�r8r8r9�__del__�sz_Stream.__del__cCs�|j�d|jj|jj|jjd�|_t�dtt	�	���}|�
d|d�|j�d�rf|jdd�|_t
j�|j�|_|�
|j�d	d
�t�dS)z6Initialize for writing with gzip compression.
        �	r�<Ls�s��.gzN���z
iso-8859-1�replace)r�ZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�rV�packrI�time�_Stream__writer��endswithr{r%�basenamer1r3)r�Z	timestampr8r8r9r��s�z_Stream._init_write_gzcCsR|jdkr|j�||j�|_|jt|�7_|jdkrD|j�|�}|�|�dS)z&Write string s to the stream.
        r�r�N)	r�r�r�r�r�r2r��compressr�r�r8r8r9r^�s

z
_Stream.writecCsN|j|7_t|j�|jkrJ|j�|jd|j��|j|jd�|_qdS)z]Write string s to the stream if a whole new block
           is ready to be written.
        N)rWr2rar�r^r�r8r8r9Z__write�sz_Stream.__writecCs�|jr
dSd|_z�|jdkr:|jdkr:|j|j��7_|jdkr�|jr�|j�	|j�d|_|jdkr�|j�	t
�d|j��|j�	t
�d|j
d@��W5|js�|j��XdS)	z[Close the _Stream object. No operation should be
           done on it afterwards.
        NTryr�r�r�r�l��)r�r�r�r�r�r�rWr��flushr^rVr�r�r�r�r8r8r9r��s
z
_Stream.closecCs�|j�|jj�|_d|_|�d�dkr0td��|�d�dkrFtd��t|�d��}|�d�|d	@r�t|�d��d
t|�d��}|�	|�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�d
S)z:Initialize for reading a gzip compressed fileobj.
        r�r$s��not a gzip filer#�zunsupported compression method��rCrB�N)r�Z
decompressobjr�r�r��
_Stream__readrr�ordr]r3)r��flagZxlenr4r8r8r9r��s*
 


z_Stream._init_read_gzcCs|jS)z3Return the stream's file pointer position.
        )r�r�r8r8r9�tell�sz_Stream.tellrcCsX||jdkrJt||j|j�\}}t|�D]}|�|j�q,|�|�ntd��|jS)zXSet the stream's file pointer to pos. Negative seeking
           is forbidden.
        rz seeking backwards is not allowed)r�r\rarHr]r	)r�r�rbrcrMr8r8r9�seeksz_Stream.seekcCs |�|�}|jt|�7_|S)z5Return the next size number of bytes from the stream.)�_readr�r2)r�r'rWr8r8r9r]s
z_Stream.readcCs�|jdkr|�|�St|j�}|jg}||kr�|jrB|j}d|_n|j�|j�}|sVq�z|j�	|�}Wn|j
k
r�td��YnX|�|�|t|�7}q&d�
|�}||d�|_|d|�S)z+Return size bytes from the stream.
        r�r�zinvalid compressed dataN)r�r�r2r�rWr�r]rar��
decompressr`r�append�join�r�r'�c�trWr8r8r9r�s(




z
_Stream._readcCsjt|j�}|jg}||krF|j�|j�}|s.qF|�|�|t|�7}qd�|�}||d�|_|d|�S)zsReturn size bytes from stream. If internal buffer is empty,
           read another block from the stream.
        r�N)r2rWr�r]rar�r�r�r8r8r9Z__read3s


z_Stream.__readN)r)rnrorprqr�r�r�r^r�r�r�r�r�r]r�r�r8r8r8r9r�Rs
F
	

r�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zsSmall proxy class that enables transparent compression
       detection for the Stream interface (mode 'r|*').
    cCs||_|j�t�|_dSr�)r�r]�	BLOCKSIZErW)r�r�r8r8r9r�Isz_StreamProxy.__init__cCs|jj|_|jSr�)r�r]rWr�r8r8r9r]Ms
z_StreamProxy.readcCsP|j�d�rdS|jdd�dkr8|jdd�dkr8d	S|j�d
�rHdSdSdS)
Ns�r�r�sBZhr��
s1AY&SYr�)s]�s�7zXZr�r�)rW�
startswithr�r8r8r9r�Qs$z_StreamProxy.getcomptypecCs|j��dSr�)r�r�r�r8r8r9r�[sz_StreamProxy.closeN)rnrorprqr�r]r�r�r8r8r8r9r�Ds

r�c@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
jfdd�Zddd�Z
dd�Zdd�ZdS)�_FileInFilezA thin wrapper around an existing file object that
       provides a part of its data as an individual file
       object.
    NcCs�||_||_||_d|_t|dd�|_d|_|dkr>d|fg}d|_g|_d}|j}|D]L\}}||kr||j�	d||df�|j�	d||||f�||7}||}qX||jkr�|j�	d||jdf�dS)Nrr�FT)
r��offsetr'�positionrhr�r��	map_index�mapr�)r�r�r�r'Z	blockinfoZlastposZrealposr8r8r9r�hs(


z_FileInFile.__init__cCsdSr�r8r�r8r8r9r��sz_FileInFile.flushcCsdS�NTr8r�r8r8r9�readable�sz_FileInFile.readablecCsdS)NFr8r�r8r8r9�writable�sz_FileInFile.writablecCs
|j��Sr�)r��seekabler�r8r8r9r��sz_FileInFile.seekablecCs|jS)z*Return the current file position.
        )r�r�r8r8r9r��sz_FileInFile.tellcCs�|tjkr tt|d�|j�|_nj|tjkr\|dkrFt|j|d�|_q�t|j||j�|_n.|tjkr�tt|j||j�d�|_ntd��|jS)z(Seek to a position in the file.
        rzInvalid argument)	�io�SEEK_SET�min�maxr'r��SEEK_CUR�SEEK_ENDr0)r�r��whencer8r8r9r��s


z_FileInFile.seekc	Cs
|dkr|j|j}nt||j|j�}d}|dk�r|j|j\}}}}||jkr`|krhq�nq�q6|jd7_|jt|j�kr6d|_q6t|||j�}|r�|j�||j|�|j�|�}t|�|kr�t	d��||7}n|t
|7}||8}|j|7_q,|S)z!Read data from the file.
        Nr�rr#rY)r'r�r�r�r�r2r�r�r]rr3)	r�r'rW�data�start�stopr�r5rdr8r8r9r]�s,

z_FileInFile.readcCs&|�t|��}||dt|��<t|�Sr�)r]r2)r�rdrWr8r8r9�readinto�sz_FileInFile.readintocCs
d|_dSr�)r�r�r8r8r9r��sz_FileInFile.close)N)N)rnrorprqr�r�r�r�r�r�r�r�r�r]r�r�r8r8r8r9r�bs

r�cseZdZ�fdd�Z�ZS)�ExFileObjectcs&t|j|j|j|j�}t��|�dSr�)r�r��offset_datar'�sparse�superr�)r��tarfile�tarinfor���	__class__r8r9r��s

�zExFileObject.__init__�rnrorpr��
__classcell__r8r8r�r9r��sr�c@seZdZdS)�FilterErrorN)rnrorpr8r8r8r9r��sr�cseZdZ�fdd�Z�ZS)�AbsolutePathErrorcs ||_t��d|j�d��dS)Nzmember z has an absolute path�r�r�r�r��r�r�r�r8r9r��szAbsolutePathError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�OutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would be extracted to �, � which is outside the destination�r��_pathr�r�r��r�r�r%r�r8r9r��s
�z OutsideDestinationError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�SpecialFileErrorcs||_t��|j�d��dS)Nz is a special filer�r�r�r8r9r��szSpecialFileError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�AbsoluteLinkErrorcs||_t��|j�d��dS)Nz! is a symlink to an absolute pathr�r�r�r8r9r��szAbsoluteLinkError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�LinkOutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would link to r�r�r�r�r�r8r9r��s
�z$LinkOutsideDestinationError.__init__r�r8r8r�r9r��sr�cCs�i}|j}tj�|�}|�dtjf�r@|j�dtj�}|d<tj�|�rTt|��tj�tj�	||��}tj�
||g�|kr�t||��|j}|dk	r�|d@}|r�|�
�s�|��r�|d@s�|dM}|dO}n|��s�|��r�d}nt|��||jkr�||d<|�r�|jdk	�rd|d<|jdk	�r*d|d	<|jdk	�r>d|d
<|jdk	�rRd|d<|���sf|���r�tj�|j��r~t|��|���r�tj�	|tj�|�|j�}ntj�	||j�}tj�|�}tj�
||g�|k�r�t||��|S)N�/r�i��@i�����r�r)r*r+r,)r�r{r%�realpathr��sep�lstrip�isabsr�r��
commonpathr�r��isreg�islnk�isdir�issymr�r)r*r+r,�linknamer��dirnamer�)�member�	dest_pathZfor_data�	new_attrsr�Ztarget_pathr�r8r8r9�_get_filtered_attrs�s^




��
rcCs|Sr�r8)rrr8r8r9�fully_trusted_filter6sr	cCs(t||d�}|r$|jf|ddi��S|S)NF�deep�rr��rrrr8r8r9�
tar_filter9sr
cCs(t||d�}|r$|jf|ddi��S|S)NTr
Frrr8r8r9�data_filter?sr)Z
fully_trustedr�r�c@s�eZdZdZedddddddd	d
ddd
ddddddddd�Zdidd�Zedd��Zej	dd��Zedd��Z
e
j	dd��Z
dd�Zeeeeeeeed ed!�
d"d#�Z
d$d%�Zeed&fd'd(�Zd)d*�Zd+d,�Zd-d.�Zed/d0��Zd1d2�Zed3d4��Zed5d6��Zed7d8��Zed9d:��Zed;d<��Zed=d>��Zd?d@�ZdAdB�Z dCdD�Z!dEdF�Z"dGdH�Z#dIdJ�Z$dKdL�Z%dMdN�Z&dOdP�Z'dQdR�Z(dSdT�Z)dUdV�Z*dWdX�Z+dYdZ�Z,d[d\�Z-d]d^�Z.d_d`�Z/dadb�Z0dcdd�Z1dedf�Z2dgdh�Z3dS)jraInformational class which holds the details about an
       archive member given by a tar header block.
       TarInfo objects are returned by TarFile.getmember(),
       TarFile.getmembers() and TarFile.gettarinfo() and are
       usually created internally.
    zName of the archive member.zPermission bits.z6User ID of the user who originally stored this member.z7Group ID of the user who originally stored this member.zSize in bytes.zTime of last modification.zHeader checksum.z�File type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.zcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.z
User name.zGroup name.zDevice major number.zDevice minor number.zThe tar header starts here.zThe file's data starts here.zMA dictionary containing key-value pairs of an associated pax extended header.zSparse member information.N)r�r�r)r*r'r(�chksum�typerr+r,�devmajor�devminorr�r��pax_headersr�r��_sparse_structs�_link_targetr�cCsj||_d|_d|_d|_d|_d|_d|_t|_d|_	d|_
d|_d|_d|_
d|_d|_d|_i|_dS)zXConstruct a TarInfo object. name is the optional name
           of the member.
        i�rr�N)r�r�r)r*r'r(r�REGTYPErrr+r,rrr�r�r�r�r�r�r8r8r9r�us"zTarInfo.__init__cCs|jS)z(In pax headers, "name" is called "path".�r�r�r8r8r9r%�szTarInfo.pathcCs
||_dSr�rrr8r8r9r%�scCs|jS)z0In pax headers, "linkname" is called "linkpath".�rr�r8r8r9r&�szTarInfo.linkpathcCs
||_dSr�r)r�rr8r8r9r&�scCsd|jj|jt|�fS)Nz<%s %r at %#x>)r�rnr��idr�r8r8r9�__repr__�szTarInfo.__repr__T)
r�r(r�rr)r*r+r,r
�_KEEPc
Cs�|	rt�|�}n
t�|�}||
k	r(||_||
k	r6||_||
k	rD||_||
k	rR||_||
k	r`||_||
k	rn||_||
k	r|||_||
k	r�||_	|S)zGReturn a deep copy of self with the given attributes replaced.
        )
�copyZdeepcopyr�r(r�rr)r*r+r,)r�r�r(r�rr)r*r+r,r
r�resultr8r8r9r��s(
zTarInfo.replacecCs�|jdkrd}n
|jd@}|j||j|j|j|j|j|j|j|j	|j
|j|jd�
}|dt
kr||d�d�s||dd7<|S)z9Return the TarInfo's attributes as a dictionary.
        N�)
r�r�r)r*r'r(rrrr+r,rrrr�r�)r�r�r)r*r'r(rrrr+r,rr�DIRTYPEr�)r�r��infor8r8r9�get_info�s(

�zTarInfo.get_info�surrogateescapecCsz|��}|��D]\}}|dkrtd|��q|tkrD|�|||�S|tkrZ|�|||�S|tkrn|�||�Std��dS)z<Return a tar header as a string of 512 byte blocks.
        Nz%s may not be Nonezinvalid format)	r"�itemsr0r
�create_ustar_headerr�create_gnu_headerr�create_pax_header)r�rSr6r7r!r��valuer8r8r9�tobuf�sz
TarInfo.tobufcCsnt|d<t|d�||��tkr(td��t|d�||��tkr^|�|d||�\|d<|d<|�|t||�S)z3Return the object as a ustar header block.
        �magicrzlinkname is too longr��prefix)	�POSIX_MAGICr2r1�LENGTH_LINKr0�LENGTH_NAME�_posix_split_name�_create_headerr
)r�r!r6r7r8r8r9r%�szTarInfo.create_ustar_headercCs�t|d<d}t|d�||��tkr<||�|dt||�7}t|d�||��tkrl||�|dt||�7}||�|t	||�S)z:Return the object as a GNU header block sequence.
        r*r�rr�)
�	GNU_MAGICr2r1r-�_create_gnu_long_header�GNUTYPE_LONGLINKr.�GNUTYPE_LONGNAMEr0r)r�r!r6r7rWr8r8r9r&�szTarInfo.create_gnu_headerc
	Cs*t|d<|j��}ddtfddtfddfD]j\}}}||kr>q*z||�dd	�Wn$tk
rv||||<Yq*YnXt||�|kr*||||<q*d
D]`\}}||kr�d||<q�||}d|kr�d|d
kr�nn
t|t	�r�t
|�||<d||<q�|�r|�|t|�}	nd}	|	|�
|tdd�S)z�Return the object as a ustar header block. If it cannot be
           represented this way, prepend a pax extended header sequence
           with supplement information.
        r*r�r%rr&)r+r+� )r,r,r5rDrE))r)rB)r*rB)r'�)r(r6rrBr#r�r�)r,rrr.r-r1�UnicodeEncodeErrorr2�
isinstance�float�str�_create_pax_generic_header�XHDTYPEr0r
)
r�r!r6rr�Zhnamer5rR�valrWr8r8r9r's8
�
*
zTarInfo.create_pax_headercCs|�|td�S)zAReturn the object as a pax global header block sequence.
        r/)r;�XGLTYPE)�clsrr8r8r9�create_pax_global_header7sz TarInfo.create_pax_global_headercCs~|�d�}tdt|��D]T}d�|d|��}d�||d��}t|�||��tkrt|�||��tkrqvqtd��||fS)zUSplit a name longer than 100 chars into a prefix
           and a name part.
        r�r#Nzname is too long)�splitrHr2r�r1�
LENGTH_PREFIXr.r0)r�r�r6r7Z
componentsrMr+r8r8r9r/=s
�zTarInfo._posix_split_namecCs�|�d�ttfk}|r@t|�dd�d|�}t|�dd�d|�}ntdd||�}tdd||�}|�dt�}|dkrxtd��t|�d	d�d
||�t|�dd�d@d|�t|�d
d�d|�t|�dd�d|�t|�dd�d|�t|�dd�d|�d|t|�dd�d
||�|�dt�t|�dd�d||�t|�dd�d||�t|�dd�d|�t|�dd�d|�t|�dd�d||�g}t�	dt
d�|��}	t|	t
d��d}
|	dd�t
d|
d�|	dd�}	|	S) z�Return a header block. info is a dictionary with file
           information, format must be one of the *_FORMAT constants.
        rrrrBrr�NzTarInfo.type must not be Noner�rr�rr)r*r'r6r(s        rr*r+r5r,r+rz%dsr�i����z%06orDi����)�get�CHRTYPE�BLKTYPErTr:rr0r,rVr�r�r�rXrO)r!rSr6r7Zhas_device_fieldsrrZfiletype�partsrWrr8r8r9r0Ms:
�&zTarInfo._create_headercCs.tt|�t�\}}|dkr*|t|t7}|S)zdReturn the string payload filled with zero bytes
           up to the next 512 byte border.
        r)r\r2r�r3)Zpayloadrbrcr8r8r9�_create_payloadwszTarInfo._create_payloadcCsR|�||�t}i}d|d<||d<t|�|d<t|d<|�|t||�|�|�S)zTReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence
           for name.
        z
././@LongLinkr�rr'r*)r1r3r2r1r0r
rG)r?r�rr6r7r!r8r8r9r2�s�zTarInfo._create_gnu_long_headerc	Cs2d}|��D]8\}}z|�dd�Wqtk
rBd}YqFYqXqd}|rV|d7}|��D]�\}}|�d�}|r�|�|d�}n
|�d�}t|�t|�d}d	}	}
|tt|
��}	|	|
kr�q�|	}
q�|tt|
�d
�d|d|d
7}q^i}d|d<||d<t|�|d<t|d<|�|td
d�|�	|�S)z�Return a POSIX.1-2008 extended or global header sequence
           that contains a list of keyword, value pairs. The values
           must be strings.
        Fr/rETr�s21 hdrcharset=BINARY
r#r�rrD� �=�
z././@PaxHeaderr�rr'r*r�)
r$r1r7r2r:rOr,r0r
rG)r?rrr6Zbinary�keywordr(Zrecords�lrLr>r!r8r8r9r;�s<

(�z"TarInfo._create_pax_generic_headerc	Csvt|�dkrtd��t|�tkr(td��|�t�tkr>td��t|dd��}|t|�krbt	d��|�}t
|dd�||�|_t|dd	��|_t|d	d
��|_
t|d
d��|_t|dd��|_t|dd��|_||_|dd
�|_t
|d
d�||�|_t
|dd�||�|_t
|dd�||�|_t|dd��|_t|dd��|_t
|dd�||�}|jtk�r�|j�d��r�t|_|jtk�r8d}g}td�D]l}	z0t|||d��}
t||d|d��}Wntk
�r�Y�qYnX|�|
|f�|d7}�q�t|d�}t|dd��}
|||
f|_ |�!��rP|j�"d�|_|�rr|jt#k�rr|d|j|_|S)zAConstruct a TarInfo object from a 512 byte bytes object.
        rzempty headerztruncated headerzend of file header��zbad checksumr�l�t�|��ii	i)iIiQiYi�r�i�r�r6�i�i�i�)$r2rrr�rs�countr3rtrNrXrKr?r�r�r)r*r'r(rrrr+r,rr�AREGTYPEr�r �GNUTYPE_SPARSErHr0r��boolrr�rstrip�	GNU_TYPES)r?rWr6r7r�objr+r��structsrMr��numbytes�
isextended�origsizer8r8r9�frombuf�sZ
zTarInfo.frombufcCs8|j�t�}|�||j|j�}|j��t|_|�|�S)zOReturn the next TarInfo object from TarFile object
           tarfile.
        )	r�r]r�r`r6r7r�r��_proc_member)r?r�rWr[r8r8r9�fromtarfileszTarInfo.fromtarfilecCsT|jttfkr|�|�S|jtkr,|�|�S|jtttfkrF|�	|�S|�
|�SdS)zYChoose the right processing method depending on
           the type and call it.
        N)rr4r3�
_proc_gnulongrW�_proc_sparser<r>�SOLARIS_XHDTYPE�	_proc_pax�
_proc_builtin)r�r�r8r8r9ras



zTarInfo._proc_membercCsR|j��|_|j}|��s$|jtkr4||�|j�7}||_|�	|j
|j|j�|S)zfProcess a builtin type or an unknown type which
           will be treated as a regular file.
        )
r�r�r�r�r�SUPPORTED_TYPES�_blockr'r��_apply_pax_inforr6r7)r�r�r�r8r8r9rg&szTarInfo._proc_builtincCs�|j�|�|j��}z|�|�}Wntk
r>td��YnX|j|_|jt	krft
||j|j�|_
n|jtkr�t
||j|j�|_|S)zSProcess the blocks that hold a GNU longname
           or longlink member.
        � missing or bad subsequent header)r�r]rir'rbrrur�rr4r?r6r7r�r3r)r�r�rW�nextr8r8r9rc7s

zTarInfo._proc_gnulongc
	Cs�|j\}}}|`|r�|j�t�}d}td�D]n}z0t|||d��}t||d|d��}	Wntk
rzYq�YnX|r�|	r�|�||	f�|d7}q,t|d�}q||_	|j�
�|_|j|�|j
�|_||_
|S)z8Process a GNU sparse header plus extra headers.
        r�r6rTi�)rr�r]r�rHrNr0r�rXr�r�r�rir'r�)
r�r�r\r^r_rWr�rMr�r]r8r8r9rdMs(
zTarInfo._proc_sparsecCs.|j�|�|j��}|jtkr&|j}n
|j��}t�	d|�}|dk	rX|�
d��d�|d<|�d�}|dkrr|j
}nd}t�d�}d}|�||�}|s��q6|��\}	}
t|	�}	|	dkr�td	��||�d
�d|�d�|	d�}|�|
dd|j�}
|
tk�r|�|||j
|j�}n|�|dd|j�}|||
<||	7}q�z|�|�}Wntk
�rbtd��YnXd|k�r||�||�nHd
|k�r�|�|||�n.|�d�dk�r�|�d�dk�r�|�|||�|jttfk�r*|� ||j
|j�|j!|_!d|k�r*|j"}
|�#��s|jt$k�r$|
|�|j�7}
|
|_!|S)zVProcess an extended or global header as described in
           POSIX.1-2008.
        s\d+ hdrcharset=([^\n]+)\nNr#r/�
hdrcharsetZBINARYs(\d+) ([^=]+)=rrGr$rk�GNU.sparse.map�GNU.sparse.sizezGNU.sparse.major�1zGNU.sparse.minorrFr')%r�r]rir'rr>rr�re�search�groupr=rCr6�compile�match�groupsrIrKrgr��_decode_pax_fieldr7�PAX_NAME_FIELDSrbrru�_proc_gnusparse_01�_proc_gnusparse_00�_proc_gnusparse_10r<rerjr�r�r�rh)r�r�rWrrvrnr6Zregexr�r5rKr(rlr�r8r8r9rfish



$	
�
�
�


 
zTarInfo._proc_paxcCshg}t�d|�D]}|�t|�d���qg}t�d|�D]}|�t|�d���q:tt||��|_dS)z?Process a GNU tar extended sparse header, version 0.0.
        s\d+ GNU.sparse.offset=(\d+)\nr#s\d+ GNU.sparse.numbytes=(\d+)\nN)rr�finditerr�rIrt�list�zipr�)r�rlrrWZoffsetsrvr]r8r8r9r{�szTarInfo._proc_gnusparse_00cCs@dd�|d�d�D�}tt|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 0.1.
        cSsg|]}t|��qSr8)rI)�.0�xr8r8r9�
<listcomp>�sz.TarInfo._proc_gnusparse_01.<locals>.<listcomp>ro�,Nr$r#)rAr~rr�)r�rlrr�r8r8r9rz�szTarInfo._proc_gnusparse_01cCs�d}g}|j�t�}|�dd�\}}t|�}t|�|dkrtd|krT||j�t�7}|�dd�\}}|�t|��q,|j��|_t	t
|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 1.0.
        NrJr#r$)r�r]r�rArIr2r�r�r�r~rr�)r�rlrr�Zfieldsr�rWZnumberr8r8r9r|�szTarInfo._proc_gnusparse_10c	Cs�|��D]�\}}|dkr&t|d|�q|dkr@t|dt|��q|dkrZt|dt|��q|tkr|tkr�zt||�}Wntk
r�d}YnX|dkr�|�d�}t|||�q|��|_dS)	zoReplace fields with supplemental information from a previous
           pax extended or global header.
        zGNU.sparse.namer%rpr'zGNU.sparse.realsizerr�N)	r$�setattrrI�
PAX_FIELDS�PAX_NUMBER_FIELDSr0rYrr)r�rr6r7rKr(r8r8r9rj�s"

zTarInfo._apply_pax_infocCs4z|�|d�WStk
r.|�||�YSXdS)z1Decode a single field from a pax record.
        rEN)r=�UnicodeDecodeError)r�r(r6Zfallback_encodingZfallback_errorsr8r8r9rx	szTarInfo._decode_pax_fieldcCs"t|t�\}}|r|d7}|tS)z_Round up a byte count by BLOCKSIZE and return it,
           e.g. _block(834) => 1024.
        r#)r\r�)r�rUrbrcr8r8r9riszTarInfo._blockcCs
|jtkS�z4Return True if the Tarinfo object is a regular file.)r�
REGULAR_TYPESr�r8r8r9r�sz
TarInfo.isregcCs|��Sr�)r�r�r8r8r9�isfileszTarInfo.isfilecCs
|jtkS)z!Return True if it is a directory.)rr r�r8r8r9r"sz
TarInfo.isdircCs
|jtkS)z%Return True if it is a symbolic link.)r�SYMTYPEr�r8r8r9r&sz
TarInfo.issymcCs
|jtkS)z!Return True if it is a hard link.)r�LNKTYPEr�r8r8r9r*sz
TarInfo.islnkcCs
|jtkS)z(Return True if it is a character device.)rrDr�r8r8r9�ischr.sz
TarInfo.ischrcCs
|jtkS)z$Return True if it is a block device.)rrEr�r8r8r9�isblk2sz
TarInfo.isblkcCs
|jtkS)zReturn True if it is a FIFO.)r�FIFOTYPEr�r8r8r9�isfifo6szTarInfo.isfifocCs
|jdk	Sr�)r�r�r8r8r9�issparse:szTarInfo.issparsecCs|jtttfkS)zCReturn True if it is one of character device, block device or FIFO.)rrDrEr�r�r8r8r9�isdev=sz
TarInfo.isdev)r�)4rnrorprq�dict�	__slots__r��propertyr%�setterr&rrr�r"rrr)r%r&r'�classmethodr@r/�staticmethodr0rGr2r;r`rbrargrcrdrfr{rzr|rjrxrir�r�rrrr�r�r�r�r�r8r8r8r9rRs��




�
1

)
	

2
>

h	c
@s�eZdZdZdZdZdZdZeZ	e
ZdZe
ZeZdZdfdd	�Zedddefd
d��Zedgdd
��Zedhdd��Zedidd��Zedjdd��Zddddd�Zdd�Zdd�Zdd�Zd d!�Zdkd"d#�Zdldd%�d&d'�Z dmdd(�d)d*�Z!dnd+d,�Z"d-d.�Z#doddd0�d1d2�Z$dpddd0�d4d5�Z%d6d7�Z&d8d9�Z'd:d;�Z(d<d=�Z)d>d?�Z*dqd@dA�Z+dBdC�Z,dDdE�Z-dFdG�Z.dHdI�Z/dJdK�Z0dLdM�Z1dNdO�Z2dPdQ�Z3dRdS�Z4dTdU�Z5drdVdW�Z6dXdY�Z7dsdZd[�Z8d\d]�Z9d^d_�Z:d`da�Z;dbdc�Z<ddde�Z=dS)trz=The TarFile Class provides an interface to tar archives.
    rFr#Nrxr#c
Cs�ddddd�}||krtd��||_|||_|sh|jdkrTtj�|�sTd|_d|_t||j�}d	|_n@|d
kr�t|d�r�t	|j
ttf�r�|j
}t|d�r�|j|_d
|_|r�tj�
|�nd
|_
||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	�r||_|	|_|
d
k	�r0|jtk�r0|
|_ni|_|d
k	�rF||_|d
k	�rV||_|
|_d	|_g|_d	|_|j��|_i|_z�|jdk�r�d
|_ |�!�|_ |jdk�r2|j�"|j�z|j�#|�}|j�$|�WnXt%k
�r�|j�"|j�Y�q2Yn0t&k
�r,}zt't|���W5d
}~XYnX�q�|jdk�r|d
|_|j�r||j�(|j�)��}|j�*|�|jt+|�7_Wn&|j�s�|j�,�d
|_�YnXd
S)a�Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        �rbzr+b�wbZxb�rx�aryr��!mode must be 'r', 'a', 'w' or 'x'r�ryFNr�r�Trx�r�ryr�)-r0r��_moder{r%�exists�	bltn_openr�r�r8r�r:rO�abspathr�rSr��dereference�ignore_zerosr6r7rr�debug�
errorlevel�copybufsizer��members�_loadedr�r��inodes�firstmemberrlr�rbr�rtrrr@rr^r2r�)r�r�r�r�rSr�r�r�r6r7rr�r�r�Zmodes�erWr8r8r9r�^s�
�





"
zTarFile.__init__c

s�|s|std��|dkr��fdd�}t�j|d�D]j}t��j|�}|dk	rV|��}	z||d|f|�WSttfk
r�|dk	r�|�|	�Yq2Yq2Xq2td���nd	|k�r|�d	d
�\}
}|
p�d}
|p�d}|�jkr�t��j|�}ntd|��|||
|f|�Sd
|k�r�|�d
d
�\}
}|
�p.d}
|�p8d}|
dk�rLtd��t	||
|||�}z�||
|f|�}Wn|�
��YnXd|_|S|dk�r��j|||f|�Std��dS)a�Open a tar archive for reading, writing or appending. Return
           an appropriate TarFile class.

           mode:
           'r' or 'r:*' open for reading with transparent compression
           'r:'         open for reading exclusively uncompressed
           'r:gz'       open for reading with gzip compression
           'r:bz2'      open for reading with bzip2 compression
           'r:xz'       open for reading with lzma compression
           'a' or 'a:'  open for appending, creating the file if necessary
           'w' or 'w:'  open for writing without compression
           'w:gz'       open for writing with gzip compression
           'w:bz2'      open for writing with bzip2 compression
           'w:xz'       open for writing with lzma compression

           'x' or 'x:'  create a tarfile exclusively without compression, raise
                        an exception if the file is already created
           'x:gz'       create a gzip compressed tarfile, raise an exception
                        if the file is already created
           'x:bz2'      create a bzip2 compressed tarfile, raise an exception
                        if the file is already created
           'x:xz'       create an lzma compressed tarfile, raise an exception
                        if the file is already created

           'r|*'        open a stream of tar blocks with transparent compression
           'r|'         open an uncompressed stream of tar blocks for reading
           'r|gz'       open a gzip compressed stream of tar blocks
           'r|bz2'      open a bzip2 compressed stream of tar blocks
           'r|xz'       open an lzma compressed stream of tar blocks
           'w|'         open an uncompressed stream for writing
           'w|gz'       open a gzip compressed stream for writing
           'w|bz2'      open a bzip2 compressed stream for writing
           'w|xz'       open an lzma compressed stream for writing
        znothing to open)rx�r:*cs�j|dkS)N�taropen)�	OPEN_METH)r��r?r8r9�not_compressed�sz$TarFile.open.<locals>.not_compressed)�keyNrxz%file could not be opened successfully�:r#r�r��|rwzmode must be 'r' or 'w'Fr�zundiscernible mode)
r0�sortedr�rhr�rrr�rAr�r�r�r�)
r?r�r�r�ra�kwargsr�r��funcZ	saved_pos�filemode�streamr�r8r�r9r�sP%







zTarFile.opencKs |dkrtd��||||f|�S)zCOpen uncompressed tar archive name for reading or writing.
        r�r�)r0)r?r�r�r�r�r8r8r9r�(szTarFile.taropenr�cKs�|dkrtd��zddlm}Wntk
r<td��YnXz|||d||�}Wn.tk
r�|dk	r||dkr|td	���YnXz|j|||f|�}WnBtk
r�|��|dkr�td	���Yn|���YnXd
|_	|S)zkOpen gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        �rxryr��mode must be 'r', 'w' or 'x'r)�GzipFilezgzip module is not availablerdNrxr�F)
r0Zgzipr�r�rr�rr�r�r�)r?r�r�r��
compresslevelr�r�r�r8r8r9�gzopen0s0zTarFile.gzopenc	Ks�|dkrtd��zddlm}Wntk
r<td��YnX||pF|||d�}z|j|||f|�}WnFttfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zlOpen bzip2 compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�BZ2Filer�)r�rxznot a bzip2 fileF)r0r�r�r�rr�r��EOFErrorr�rr�)r?r�r�r�r�r�r�r�r8r8r9�bz2openQs&zTarFile.bz2openc		Ks�|dkrtd��zddlm}m}Wntk
r@td��YnX||pJ|||d�}z|j|||f|�}WnF|tfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zkOpen lzma compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�LZMAFiler�r�)�presetrxznot an lzma fileF)r0r�r�r�r�rr�r�r�rr�)	r?r�r�r�r�r�r�r�r�r8r8r9�xzopenms&zTarFile.xzopenr�r�r�r�)r�r�r�r�cCs�|jr
dSd|_z`|jdkrn|j�ttd�|jtd7_t	|jt
�\}}|dkrn|j�tt
|�W5|js�|j��XdS)zlClose the TarFile. In write-mode, two finishing zero blocks are
           appended to the archive.
        NTr�r$r)r�r�r�r�r�r^r3r�r�r\�
RECORDSIZE)r�rbrcr8r8r9r��s
z
TarFile.closecCs"|�|�}|dkrtd|��|S)aReturn a TarInfo object for member `name'. If `name' can not be
           found in the archive, KeyError is raised. If a member occurs more
           than once in the archive, its last occurrence is assumed to be the
           most up-to-date version.
        Nzfilename %r not found)�
_getmember�KeyError)r�r�r�r8r8r9�	getmember�s
zTarFile.getmembercCs|��|js|��|jS)z�Return the members of the archive as a list of TarInfo objects. The
           list has the same order as the members in the archive.
        )�_checkr��_loadr�r�r8r8r9�
getmembers�szTarFile.getmemberscCsdd�|��D�S)z�Return the members of the archive as a list of their names. It has
           the same order as the list returned by getmembers().
        cSsg|]
}|j�qSr8r)r�r�r8r8r9r��sz$TarFile.getnames.<locals>.<listcomp>)r�r�r8r8r9�getnames�szTarFile.getnamescCs^|�d�|dk	r|j}|dkr$|}tj�|�\}}|�tjd�}|�d�}|��}||_	|dkr�|j
stt�|�}q�t�|�}nt�
|���}d}|j}t�|�r�|j|jf}	|j
s�|jdkr�|	|jkr�||j|	kr�t}
|j|	}nt}
|	dr�||j|	<nht�|��rt}
nVt�|��r"t}
nDt�|��r>t}
t�|�}n(t�|��rPt}
nt� |��rbt!}
ndS||_||_"|j#|_$|j%|_&|
tk�r�|j'|_(nd|_(|j)|_*|
|_+||_,t-�r�zt-�.|j$�d|_/Wnt0k
�r�YnXt1�rzt1�2|j&�d|_3Wnt0k
�rYnX|
tt!fk�rZt4td��rZt4td��rZt�5|j6�|_7t�8|j6�|_9|S)	a�Create a TarInfo object from the result of os.stat or equivalent
           on an existing file. The file is either named by `name', or
           specified as a file object `fileobj' with a file descriptor. If
           given, `arcname' specifies an alternative name for the file in the
           archive, otherwise, the name is taken from the 'name' attribute of
           'fileobj', or the 'name' argument. The name should be a text
           string.
        �awxNr�r�r#r�major�minor):r�r�r{r%�
splitdriver�r�r�r�r�r��lstat�stat�fstat�fileno�st_mode�S_ISREG�st_ino�st_dev�st_nlinkr�r�r�S_ISDIRr �S_ISFIFOr��S_ISLNKr��readlink�S_ISCHRrD�S_ISBLKrEr��st_uidr)�st_gidr*�st_sizer'�st_mtimer(rr�pwd�getpwuidr+r��grpZgetgrgidr,r�r��st_rdevrr�r)r�r��arcnamer�Zdrvr�ZstatresrZstmd�inoderr8r8r9�
gettarinfo�s�	


��

zTarFile.gettarinfoT)r�cCs*|��|dkr|}|D�]
}|r�|jdkr6td�ntt�|j��td|jpT|j|jp^|jf�|�	�sv|�
�r�tdd|j|jf�ntd|j
�|jdkr�td�ntdt�|j�dd	��t|j|��r�d
nd�|�r|���rtd|j�|���rtd
|j�t�qdS)aPrint a table of contents to sys.stdout. If `verbose' is False, only
           the names of the members are printed. If it is True, an `ls -l'-like
           output is produced. `members' is optional and must be a subset of the
           list returned by getmembers().
        Nz
??????????z%s/%sz%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02dr�r�r�z-> zlink to )r�r�rlr�r�r+r)r,r*r�r�rrr'r(r��	localtimer�rrrrrk)r��verboser�r�r8r8r9r~'s8



��

�

zTarFile.list��filterc	Cs6|�d�|dkr|}|jdk	rFtj�|�|jkrF|�dd|�dS|�d|�|�||�}|dkrz|�dd|�dS|dk	r�||�}|dkr�|�dd|�dS|��r�t|d��}|�	||�W5QRXn`|�
��r(|�	|�|�r2tt�|��D]*}|j
tj�||�tj�||�||d	�q�n
|�	|�dS)
a!Add the file `name' to the archive. `name' may be any type of file
           (directory, fifo, symbolic link, etc.). If given, `arcname'
           specifies an alternative name for the file in the archive.
           Directories are added recursively by default. This can be avoided by
           setting `recursive' to False. `filter' is a function
           that expects a TarInfo object argument and returns the changed
           TarInfo object, if it returns None the TarInfo object will be
           excluded from the archive.
        r�Nr$ztarfile: Skipped %rr#ztarfile: Unsupported type %r�tarfile: Excluded %rr�r�)r�r�r{r%r��_dbgr�r�r��addfilerr��listdir�addr�)r�r�r��	recursiver�r��fr8r8r9r�Ms8



�
zTarFile.addcCs�|�d�t�|�}|�|j|j|j�}|j�|�|jt	|�7_|j
}|dk	r�t||j|j|d�t
|jt�\}}|dkr�|j�tt|�|d7}|j|t7_|j�|�dS)aAdd the TarInfo object `tarinfo' to the archive. If `fileobj' is
           given, it should be a binary file, and tarinfo.size bytes are read
           from it and added to the archive. You can create TarInfo objects
           directly, or by using gettarinfo().
        r�N)rarr#)r�rr)rSr6r7r�r^r�r2r�r[r'r\r�r3r�r�)r�r�r�rWrarbrcr8r8r9r��s

zTarFile.addfilec	CsB|dkr�|j}|dkr�tj�d�}|dkr�ztt�}Wntk
rJYnBXddl}|jddd�}|�|�	|�W5QRX|jdddd�}|r�zt
|}Wn&tk
r�td|�d	��d�YnX||_|St
r�t�d
t�tStSt|t�r�td��|St|��r
|Sz
t
|WStk
�r<td|�d	��d�YnXdS)NZ PYTHON_TARFILE_EXTRACTION_FILTERr)�#)Z
interpolationZcomment_prefixesr�r�)Zfallbackzfilter z
 not foundaThe default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.zrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.)�extraction_filterr{�environrCr��_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�_NAMED_FILTERSr�r0�_RH_SAFER_DEFAULT�warnings�warn�RuntimeWarningr
r	r8r:�	TypeError�callable)r�r�r��filer�Zconfr8r8r9�_get_filter_function�sZ���	
�

zTarFile._get_filter_function�.)�
numeric_ownerr�cCs�g}|�|�}|dkr|}|D]F}|�|||�}|dkr:q|��rL|�|�|j|||��|d�q|jdd�dd�|D]n}tj�||j	�}	z,|j
||	|d�|�||	�|�||	�Wq|t
k
r�}
z|�|
�W5d}
~
XYq|Xq|dS)a�Extract all members from the archive to the current working
           directory and set owner, modification time and permissions on
           directories afterwards. `path' specifies a different directory
           to extract to. `members' is optional and must be a subset of the
           list returned by getmembers(). If `numeric_owner` is True, only
           the numbers for user/group names are used and not the names.

           The `filter` function will be called on each member just
           before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N��	set_attrsrcSs|jSr�r)r�r8r8r9�<lambda>�r�z$TarFile.extractall.<locals>.<lambda>T)r��reverse)r)r�_get_extract_tarinforr��_extract_one�sortr{r%r�r��chown�utime�chmodr
�_handle_nonfatal_error)r�r%r�rr�Zdirectories�filter_functionrr��dirpathr�r8r8r9�
extractall�s,

�zTarFile.extractallr�cCs4|�|�}|�|||�}|dk	r0|�||||�dS)a�Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a TarInfo object. You can
           specify a different directory using `path'. File attributes (owner,
           mtime, mode) are set unless `set_attrs' is False. If `numeric_owner`
           is True, only the numbers for user/group names are used and not
           the names.

           The `filter` function will be called before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N)rrr)r�rr%rrr�rr�r8r8r9�extract�s
zTarFile.extractc
Cs�t|t�r|�|�}n|}|}z|||�}WnZttfk
r\}z|�|�W5d}~XYn,tk
r�}z|�|�W5d}~XYnX|dkr�|�dd|j	�dS|�
�r�t�|�}tj
�||j�|_|S)z@Get filtered TarInfo (or None) from member, which might be a strNr$r�)r8r:r�r�r��_handle_fatal_errorr
rr�r�rrr{r%r�rr)r�rrr%r�Z
unfilteredr�r8r8r9r	s"

zTarFile._get_extract_tarinfoc
Cs�|�d�z"|j|tj�||j�||d�WnVtk
rX}z|�|�W5d}~XYn,tk
r�}z|�	|�W5d}~XYnXdS)z%Extract from filtered tarinfo to diskrxrN)
r��_extract_memberr{r%r�r�r�rr
r)r�r�r%rrr�r8r8r9r%	s
�
zTarFile._extract_onecCs"|jdkr�n|�dd|�dS)z=Handle non-fatal error (ExtractError) according to errorlevelr#�tarfile: %sN)r�r��r�r�r8r8r9r2	s
zTarFile._handle_nonfatal_errorcCsn|jdkr�n\t|t�rP|jdkr6|�dd|j�qj|�dd|j|jf�n|�ddt|�j|f�dS)z1Handle "fatal" error according to self.errorlevelrNr#rztarfile: %s %rztarfile: %s %s)r�r8r��filenamer��strerrorrrnrr8r8r9r9	s


zTarFile._handle_fatal_errorcCs�|�d�t|t�r |�|�}n|}|��s6|jtkrB|�||�S|��sR|�	�rzt|j
t�rhtd��q~|�
|�|��SndSdS)z�Extract a member from the archive as a file object. `member' may be
           a filename or a TarInfo object. If `member' is a regular file or a
           link, an io.BufferedReader object is returned. Otherwise, None is
           returned.
        rxz'cannot extract (sym)link as file objectN)r�r8r:r�r�rrh�
fileobjectrrr�r�r	�extractfile�_find_link_target)r�rr�r8r8r9rE	s


zTarFile.extractfilecCsT|�d�}|�dtj�}tj�|�}|r>tj�|�s>t�|�|��sN|�	�rh|�
dd|j|jf�n|�
d|j�|�
�r�|�||�n�|��r�|�||�nx|��r�|�||�nb|��s�|��r�|�||�nD|��s�|�	�r�|�||�n&|jtk�r|�||�n|�||�|�rP|�|||�|�	��sP|�||�|�||�dS)z\Extract the TarInfo object tarinfo to a physical
           file called targetpath.
        r�r#z%s -> %sN)rYr�r{r�r%rr��makedirsrrr�r�rr��makefiler�makedirr��makefifor�r��makedev�makelinkrrh�makeunknownrrr)r�r��
targetpathrrZ	upperdirsr8r8r9rd	s4


zTarFile._extract_membercCs@z&|jdkrt�|�nt�|d�Wntk
r:YnXdS)z,Make a directory called targetpath.
        Ni�)r�r{�mkdir�FileExistsError�r�r�r&r8r8r9r!�	s
zTarFile.makedirc	Cs�|j}|�|j�|j}t|d��b}|jdk	rn|jD]"\}}|�|�t|||t|�q4|�|j�|�	�nt|||jt|�W5QRXdS)z'Make a file called targetpath.
        r�N)
r�r�r�r�r�r�r[rr'�truncate)r�r�r&�sourcera�targetr�r'r8r8r9r �	s


zTarFile.makefilecCs"|�||�|�dd|j�dS)zYMake a file from a TarInfo object with an unknown type
           at targetpath.
        r#z9tarfile: Unknown file type %r, extracted as regular file.N)r r�rr)r8r8r9r%�	s�zTarFile.makeunknowncCs"ttd�rt�|�ntd��dS)z'Make a fifo called targetpath.
        �mkfifozfifo not supported by systemN)r�r{r-r
r)r8r8r9r"�	s
zTarFile.makefifocCsjttd�rttd�std��|j}|dkr.d}|��rB|tjO}n
|tjO}t�||t�	|j
|j��dS)z<Make a character or block device called targetpath.
        �mknodr#z'special devices not supported by systemNr�)r�r{r
r�r�r��S_IFBLK�S_IFCHRr.r#rr)r�r�r&r�r8r8r9r#�	s
�zTarFile.makedevcCs�zb|��r0tj�|�r t�|�t�|j|�n0tj�|j�rNt�	|j|�n|�
|�|�|�WnHtk
r�z|�
|�|�|�Wnt
k
r�td��YnXYnXdS)z�Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
        z%unable to resolve link inside archiveN)rr{r%�lexists�unlink�symlinkrr�r�linkrr�symlink_exceptionr�r
r)r8r8r9r$�	s"
��zTarFile.makelinkcCs�ttd�r�t��dkr�|j}|j}|s�ztrB|jrBt�|j�d}Wntk
rXYnXzt	rv|j
rvt	�|j
�d}Wntk
r�YnX|dkr�d}|dkr�d}z4|��r�ttd�r�t�
|||�nt�|||�Wntk
r�td��YnXdS)z�Set owner of targetpath according to tarinfo. If numeric_owner
           is True, use .gid/.uid instead of .gname/.uname. If numeric_owner
           is False, fall back to .gid/.uid when the search based on name
           fails.
        �geteuidrr$Nr;�lchownzcould not change owner)r�r{r6r*r)r�r,Zgetgrnamr�r�r+�getpwnamrr7rr�r
)r�r�r&r�g�ur8r8r9r�	s0

z
TarFile.chowncCsB|jdkrdSzt�||j�Wntk
r<td��YnXdS)zASet file permissions of targetpath according to tarinfo.
        Nzcould not change mode)r�r{rr�r
r)r8r8r9r
s
z
TarFile.chmodcCsV|j}|dkrdSttd�s dSzt�|||f�Wntk
rPtd��YnXdS)zBSet modification time of targetpath according to tarinfo.
        Nrz"could not change modification time)r(r�r{rr�r
)r�r�r&r(r8r8r9r
s
z
TarFile.utimec
Cs�|�d�|jdk	r$|j}d|_|S|j|j��krZ|j�|jd�|j�d�sZtd��d}z|j�	|�}W�q�t
k
r�}z6|jr�|�dd|j|f�|jt
7_WY�q^W5d}~XY�q�tk
�r6}zR|j�r|�dd|j|f�|jt
7_WY� q^n|jdk�r&tt|���W5d}~XYn�tk
�r^|jdk�rZtd��Ynjtk
�r�}z|jdk�r�tt|���W5d}~XYn0tk
�r�}ztt|���W5d}~XYnX�q�q^|dk	�r�|j�|�nd	|_|S)
z�Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        ZraNr#rYr$z0x%X: %srz
empty fileT)r�r�r�r�r�r�r]rr�rbrtr�r�r�rKr:rrrsrur�r�r�)r��mr�r�r8r8r9rl'
sJ



zTarFile.nextc	Cs�|��}d}|dk	rHz|�|�}Wntk
r:d}YnX|d|�}|rXtj�|�}t|�D]D}|rz|j|jkr`d}q`|r�tj�|j�}n|j}||kr`|Sq`|r�t|��dS)z}Find an archive member by name from bottom to top.
           If tarinfo is given, it is used as the starting point.
        FNT)	r��indexr0r{r%�normpath�reversedr�r�)	r�r�r��	normalizer�Zskippingr<r�member_namer8r8r9r�]
s,

zTarFile._getmembercCs|��}|dkrqqd|_dS)zWRead through the entire archive file and look for readable
           members.
        NT)rlr�r�r8r8r9r��
sz
TarFile._loadcCs:|jrtd|jj��|dk	r6|j|kr6td|j��dS)znCheck if TarFile is still open, and if the operation's mode
           corresponds to TarFile's mode.
        z%s is closedNzbad operation for mode %r)r�r�r�rnr�)r�r�r8r8r9r��
szTarFile._checkcCs`|��r.d�tdtj�|j�|jf��}d}n
|j}|}|j||dd�}|dkr\t	d|��|S)zZFind the target member of a symlink or hardlink member in the
           archive.
        r�NT)r�r?zlinkname %r not found)
rr�r�r{r%rr�rr�r�)r�r�r�limitrr8r8r9r�
s zTarFile._find_link_targetccs�|jr|jEdHdSd}|jdk	r:|��}|d7}|V|t|j�krT|j|}n"|jsr|��}|svd|_dSndS|d7}|Vq:dS)z$Provide an iterator object.
        Nrr#T)r�r�r�rlr2)r�r<r�r8r8r9�__iter__�
s$
zTarFile.__iter__cCs||jkrt|tjd�dS)z.Write debugging output to sys.stderr.
        �rN)r�rkri�stderr)r��level�msgr8r8r9r��
s
zTarFile._dbgcCs|��|Sr�)r�r�r8r8r9�	__enter__�
szTarFile.__enter__cCs,|dkr|��n|js"|j��d|_dSr�)r�r�r�r�)r�rr(�	tracebackr8r8r9�__exit__�
s


zTarFile.__exit__)
NrxNNNNNNr#NNNN)rxN)rxNr�)rxNr�)rxNN)NNN)T)NT)N)rN)r�T)TF)NF)N)>rnrorprqr�r�r�r�rrSrr6r7rr�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r~r�r�rrrrrrrrrr!r r%r"r#r$rrrrlr�r�r�rrBr�rGrIr8r8r8r9rBs��
oZ �


c&3
5�-�
�
1!
6
(

	cCs2zt|�}|��WdStk
r,YdSXdS)zfReturn True if name points to a tar archive that we
       are able to handle, else return False.
    TFN)rr�r)r�r�r8r8r9r�
sc	Csddl}d}|j|d�}|jdddddd	�|jd
dtdd
�|jdd�}|jddddd�|jdddddd�|jdddddd�|jdd dd!d�|��}|jr�|jdkr�|�d"d#�|j	dk	�r4|j	}t
|��rt|d$�� }|��t
|��tjd%�W5QRX|j�r0t
d&�|��n|�d"d'�|���n�|jdk	�r�|j}t
|��rxt�|d(��}|j|jd)�W5QRXn|�d"d'�|���nv|jdk	�rbt|j�d"k�r�|jd}tj}n,t|j�d*k�r�|j\}}n|�d"|���t
|��rNt�|d(��}|j||jd+�W5QRX|j�r`|d,k�r8d-�|�}	nd.�||�}	t
|	�n|�d"d'�|��n�|jdk	�r|j�d�}
tj�|
�\}}d/d/d0d0d1d1d1d1d2�}
||
k�r�d3|
|nd4}|j}t�|
|��}|D]}|�|��q�W5QRX|j�rt
d5�|
��dS)6Nrz3A simple command-line interface for tarfile module.)�descriptionz-vz	--verbose�
store_trueFzVerbose output)�action�default�helpz--filterz<filtername>zFilter for extraction)�metavar�choicesrNT)Zrequiredz-lz--list�	<tarfile>zShow listing of a tarfile)rOrNz-ez	--extract�+)rQz<output_dir>zExtract tarfile into target dir)�nargsrOrNz-cz--create)z<name>z<file>zCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr#z&--filter is only valid for extraction
rxrCz{!r} is a tar archive.z{!r} is not a tar archive.
r�)r�r$)r%r�rz{!r} file is extracted.z+{!r} file is extracted into {!r} directory.r�r�r�)r�z.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:ryz{!r} file created.)�argparse�ArgumentParser�add_argumentr�Zadd_mutually_exclusive_group�
parse_argsr�r�exitZtestrrr�rkrirDr�rSr~rr2r{�curdirZformat_helprZcreate�popr%�splitextr�)rTrJ�parserrt�argsr_r�ZtfrYrFZtar_name�_ZextZcompressionsZtar_modeZ	tar_files�	file_namer8r8r9�main�
s���
�
�
�
�




�
�
r`�__main__)T)mrq�version�
__author__�__credits__�builtinsrr�rir{r�rZr�r�rVrrrr�r�r�r��AttributeError�NotImplementedErrorr5r��	NameError�__all__r�r�r3r�r�r1r,r.r-rBrrVr�r�rDrEr r�ZCONTTYPEr4r3rWr<r>rer
rrrrhr�rZr�ryr9rIr�r�r�getfilesystemencodingr:r?rNrTrXr[rl�	Exceptionrr
rrr	rrrrsrtrKrurvr��objectr�r��BufferedReaderr�r�r�r�r�r�r�rr	r
rr�rrrrr`rnr8r8r8r9�<module>s<


�����
sh

?�u)_
locale.cpython-38.opt-1.pyc000064400000103603151450073350011400 0ustar00U

e5do1�M@s0dZddlZddlZddlZddlZddlZddlmZddl	Z	dddddd	d
ddd
dddddddddddddgZ
dd�Zdd�Zzddl
TWnLek
r�d Zd!Zd"ZdZd#Zd$Zd%Zd&ZeZd'd
�Z�d�d(d�ZYnXde�kr�eZde�kr�eZeZiZe	� e�d)d
��Zd*d+�Z!�d�d-d.�Z"d/d0�Z#e�$d1�Z%�d�d2d3�Z&�d�d4d�Z'�d�d5d�Z(�d�d7d�Z)d8d
�Zd9d:�Z*e+fd;d�Z,d<d�Z-d=d>�Z.eZ/d?d@�Z0dAdB�Z1dCd�Z2dDdE�Z3dFdG�Z4�d�dId�Z5efdJd�Z6�d�dKd�ZefdLd	�Z7ej8�9dM��r�d�dNd�Z:nRze;Wn<e<k
�rPe=edO��r@�d�dPd�Z:n�d�dQd�Z:YnX�d�dRd�Z:dSdSdTdUdUdVdWdXdYdZdTd[d\d]dTdTdTd^d_d`dad]dbd[dcddd\dedfdgdhdUdidjdVdkdldmdndodpdXdYdZdq�,Z>e?e>�@��D]"\ZAZBeA�Cdrds�ZAe>�DeAeB��q�dtdtdtdudvdwdxdxdydzd{d{d|d}d~ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dSd�dSdSd|d�dSdSd�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d|d�d|dSd|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��dd͐d�d�d�d�d�d�d�d�d�d�d�d�d	�d
�d
�d�dd��d
�d�d�d�d�d�d
�d�d�d�d�d�d�d�d�d�dd�d�d�d��d�d�d�ddΐd�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d��d�d �d!�d!�d!�d"�d#�d$�d%�d&�d'�d'�d(�d)�d'�d'�d&�d&d|d�d|d�d|d�d*�d+�d*�d*�d,�d,�d,�d�d�d-�d.�d.�d.�d/�d/�d.�d.�d.�d.�d.�d0�d0�d0�d1�d0�d2�d3�d4�d4�d5�d6�d6�d7�d7�d7�d8�d7�d7�d9�d9�d:�d;�d<�d<�d=�d=�d>�d?�d@�dA�dB�dC�dD�dE�dE�dF�dF�dE�dC�dC�dG�dG�dH�dI�dJ�dJ�dK�dL�dM�dN�dO�dO�dP�dQ�dR�dR�dS�dS�dT�dU�dV�dV�dW�dW�dX�dX�dY�dZd�d��d[�d\�d]�d^�d_�d`dȐdad�dȐdb�db�dc�dd�dc�dc�dc�dc�de�de�df�df�dd�dd�db�dg�dg�dh�di�dj�dj�dk�dl�dl�dm�dn�do�dp�dq�dr�dq�ds�ds�dt�dt�dt�du�dvdSdS�dw�dw�dx�du�dv�du�dy�dz�d{�d{�d{�d|�d|�d}�d{�d~�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��dddÐdÐdÐdÐdĐdĐdŐdŐdƐdǐdȐdɐdɐdʐdʐdːd̐d�d��dΐd�d��dАdАdѐdҐd�d�d��dӐdӐdԐ�LZE�dՐd֐dאdؐdِdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�df�dg�dh�di�dj�dk�dl�dm�dn�dm�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���ZF�d��d��ZGzeWne<k
�
r�YnXe
�H�d��eI�d�k�r,eJ�d��eJ�eG�eJ�eJ�d��eJ�e.�dS(�a�Locale support module.

The module provides low-level access to the C lib's locale APIs and adds high
level number formatting APIs as well as a locale aliasing engine to complement
these.

The aliasing engine includes support for many commonly used locale names and
maps them to values suitable for passing to the C lib's setlocale() function. It
also includes default encodings for all supported locale names.

�N)�str�	getlocale�getdefaultlocale�getpreferredencoding�Error�	setlocale�resetlocale�
localeconv�strcoll�strxfrmr�atof�atoi�format�
format_string�currency�	normalize�LC_CTYPE�
LC_COLLATE�LC_TIME�LC_MONETARY�
LC_NUMERIC�LC_ALL�CHAR_MAXcCs||k||kS)zZ strcoll(string,string) -> int.
        Compares two strings according to the locale.
    �)�a�brr�/usr/lib64/python3.8/locale.py�_strcoll!srcCs|S)z\ strxfrm(string) -> string.
        Returns a string that behaves for cmp locale-aware.
    r)�srrr�_strxfrm'sr)�*�������cCs,dgddddgddddddddddddd�S)zd localeconv() -> dict.
            Returns numeric and monetary locale-specific parameters.
        r!��.)�grouping�currency_symbol�n_sign_posn�
p_cs_precedes�
n_cs_precedes�mon_grouping�n_sep_by_space�
decimal_point�
negative_sign�
positive_sign�p_sep_by_space�int_curr_symbol�p_sign_posn�
thousands_sep�mon_thousands_sep�frac_digits�mon_decimal_point�int_frac_digitsrrrrrr	?s&�cCs|dkrtd��dS)zd setlocale(integer,string=None) -> string.
            Activates/queries locale processing.
        )Nr(�Cz*_locale emulation only supports "C" localer<)r)�category�valuerrrrWscCst�}tr|�t�|S)N)�_localeconv�_override_localeconv�update)�drrrr	ls
ccsJd}|D]<}|tkrdS|dkr:|dkr2td��|Vq2|V|}qdS)Nrzinvalid grouping)r�
ValueError)r*Z
last_interval�intervalrrr�_grouping_intervalszsrEFc
Cs�t�}||rdpd}||r dp"d}|s2|dfS|ddkr\|��}|t|�d�}|}nd}d}g}t|�D]B}	|r�|dd	kr�|}d}q�|�||	d��|d|	�}qp|r�|�|�|��||�|�|t|�t|�d
fS)Nr8r7r/r*r���� r(�
0123456789r&)r	�rstrip�lenrE�append�reverse�join)
r�monetary�convr7r*�strippedZright_spacesZleft_spaces�groupsrDrrr�_group�s2
�rRcCsdd}|r&||dkr&|d7}|d8}qt|�d}|rT||dkrT|d8}|d8}q2|||d�S)NrrGr&)rJ)rZamountZlposZrposrrr�_strip_padding�s

rSzG%(?:\((?P<key>.*?)\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]c	Gs�|r||f|}n||}|ddkr~d}|�d�}|rRt|d|d�\|d<}t�|r^dp`d}|�|�}|r�t||�}n2|ddkr�d}|r�t||d�\}}|r�t||�}|S)	NrFZeEfFgGrr)�rNr:r1Zdiu)�splitrRr	rMrS)	�percentr>r*rN�
additionalZ	formattedZseps�partsr1rrr�_format�s*
�

rYc
	Cs
tt�|��}t�d|�}t|tj�rjg}|D]8}|��ddkrN|�d�q.|�t	|��|||��q.n�t|t
�sz|f}g}d}|D]r}|��ddkr�|�d�q�|�d��d�}	|�t	|��||||f||d|d|	����|d|	7}q�t
|�}||S)aFormats a string in the same way that the % formatting would use,
    but takes the current locale into account.

    Grouping is applied if the third parameter is true.
    Conversion uses monetary thousands separator and grouping strings if
    forth parameter monetary is true.z%srF�%rZ	modifiersr r&)�list�_percent_re�finditer�sub�
isinstance�_collections_abc�Mapping�grouprKrY�tuple�count)
�f�valr*rNZpercentsZnew_fZnew_valZperc�iZ	starcountrrrr�s4
��cGs^ddl}|jdtdd�t�|�}|r:t|���t|�krJtdt|���t	||||f|��S)z&Deprecated, use format_string instead.rNz`This method will be removed in a future version of Python. Use 'locale.format_string()' instead.r')�
stacklevelzHformat() must be given exactly one %%char format specifier, %s not valid)
�warnings�warn�DeprecationWarningr\�matchrJrbrC�reprrY)rVr>r*rNrWrirlrrrr�s�
�TcCsft�}||rdpd}|dkr&td��td|t|�|dd�}d|d	}|r�||rXd
pZd}||dkrld
pnd}||dkr�dp�d}	|r�||	r�dp�d|}n||	r�dp�d|}||dkr�dp�d}
||dkr�dp�d}|
dkr�d|d}n`|
dk�r||}nL|
dk�r||}n8|
dk�r2|�d|�}n |
dk�rJ|�d	|�}n||}|�dd��d	d�S)zIFormats val according to the currency settings
    in the current locale.r;r9r!z9Currency formatting is not possible using the 'C' locale.z%%.%ifTrT�<�>r5r+rr.r-r0r4rGr(r,r6r2r3�(�)r&r'r#r%)r	rCrY�abs�replace)rfZsymbolr*Z
internationalrOZdigitsrZsmbZprecedesZ	separatedZsign_posZsignrrrrs6





cCs
td|�S)z8Convert float to string, taking the locale into account.z%.12g)rY)rfrrrr0scCs:t�}|d}|r|�|d�}|d}|r6|�|d�}|S)zHParses a string as a normalized number according to the locale settings.r7r(r1r))r	rs)�stringrO�tsZddrrr�
delocalize4srvcCs|t|��S)z<Parses a string as a float according to the locale settings.)rv)rt�funcrrrrDscCstt|��S)zAConverts a string to an integer according to the locale settings.)�intrv)rtrrrr
HscCsBttd�tddd�}t|dt|��td�}t|dt|��dS)Nr(z%di�[r&�isg��Q�	@)rrr�printr
rr)�s1rrr�_testLs

r|cCs�d|kr|d|�d��}n|}t�|�}tjj�|��|�}|}|��}|tkr\t|}n(|�dd�}|�dd�}|tkr�t|}|d|S)Nr)�_r(�-)�index�	encodings�normalize_encoding�aliases�get�lower�locale_encoding_aliasrs)�code�encoding�langname�
norm_encodingrrr�_replace_encoding^s 
�
r�cCsR|dkrFd|kr|dS|�d�\}}}|dkr4|S|dkrFt|d�S|d|S)N�euror)z.ISO8859-15)�
ISO8859-15�UTF-8�	ISO8859-1r��@)�	partitionr�)r��modifierr}r�rrr�_append_modifierus
r�c	Cs�|��}d|kr|�dd�}d|kr6|�dd�\}}nd}d|krZ|�d�dd�\}}n|}d}|}|r�|�dd�}|�d	d�}|d|7}|}|r�|d|7}t�|d�}|dk	r�|S|�rt�|d�}|dk	�rd|kr�t||�S|�dd�d��|k�r|S|�r�|}|�r"|d|7}t�|d�}|dk	�rnd|k�rLt||�S|�dd�\}}t||�d|S|�r�t�|d�}|dk	�r�d|k�r�t||�}t||�S|�dd�\}}|��|k�r�t||�d|S|S)
a� Returns a normalized locale code for the given locale
        name.

        The returned locale code is formatted for use with
        setlocale().

        If normalization fails, the original name is returned
        unchanged.

        If the given encoding is not known, the function defaults to
        the default encoding for the locale code just like setlocale()
        does.

    �:r)r�r&r(Nr'r~r})r�rsrU�locale_aliasr�r�r�)	�
localenamer�r�r�r�Zlang_encr�Zlookup_nameZdefmodrrrr�s`








cCs~t|�}d|kr8|�dd�\}}|dkr8d|kr8|dfSd|krVt|�d�dd��S|dkrbd	S|d
krndStd|��dS)
a� Parses the locale code for localename and returns the
        result as tuple (language code, encoding).

        The localename is normalized and passed through the locale
        alias engine. A ValueError is raised in case the locale name
        cannot be parsed.

        The language code corresponds to RFC 1766.  code and encoding
        can be None in case the values cannot be determined or are
        unknown to this implementation.

    r�r&r�r)�iso-8859-15Nr'r<)NNr��Nr�zunknown locale: %s)rrUrcrC)r�r�r�rrr�_parse_localename�sr�c	Cs\z4|\}}|dkrd}|dkr$|WS|d|WSWn"ttfk
rVtd�d�YnXdS)z� Builds a locale code from the given tuple (language code,
        encoding).

        No aliasing or normalizing takes place.

    Nr<r)zXLocale must be None, a string, or an iterable of two strings -- language code, encoding.)�	TypeErrorrC)ZlocaletupleZlanguager�rrr�_build_localename�s�r��rrZLANG�LANGUAGEc	Cs�zddl}|��\}}Wnttfk
r0Yn8Xtjdkr`|r`|dd�dkr`t�t|d��}||fSddl	}|j
j}|D],}||d�}|r||dkr�|�d�d}q�q|d}t|�S)	a� Tries to determine the default locale settings and returns
        them as tuple (language code, encoding).

        According to POSIX, a program which has not called
        setlocale(LC_ALL, "") runs using the portable 'C' locale.
        Calling setlocale(LC_ALL, "") lets it use the default locale as
        defined by the LANG variable. Since we don't want to interfere
        with the current locale setting we thus emulate the behavior
        in the way described above.

        To maintain compatibility with other platforms, not only the
        LANG variable is tested, but a list of variables given as
        envvars parameter. The first found to be defined will be
        used. envvars defaults to the search path used in GNU gettext;
        it must always contain the variable name 'LANG'.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    rNZwin32r'Z0xr�r�r<)
�_localeZ_getdefaultlocale�ImportError�AttributeError�sys�platform�windows_localer�rx�os�environrUr�)Zenvvarsr�r�r�r��lookupZvariabler�rrrr
s$
cCs(t|�}|tkr d|kr td��t|�S)ap Returns the current setting for the given locale category as
        tuple (language code, encoding).

        category may be one of the LC_* value except LC_ALL. It
        defaults to LC_CTYPE.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    �;z category LC_ALL is not supported)�
_setlocalerr�r�)r=r�rrrr?s
cCs$|rt|t�stt|��}t||�S)a^ Set the locale for the given category.  The locale can be
        a string, an iterable of two strings (language code and encoding),
        or None.

        Iterables are converted to strings using the locale aliasing
        engine.  Locale strings are passed directly to the C lib.

        category may be given as one of the LC_* values.

    )r_�_builtin_strrr�r�)r=ZlocalerrrrQscCst|tt���dS)z� Sets the locale for category to the default setting.

        The default setting is determined by calling
        getdefaultlocale(). category defaults to LC_ALL.

    N)r�r�r)r=rrrrbs�wincCstjjrdSddl}|�d�S)z1Return the charset that the user is likely using.r�rNF)r��flags�	utf8_mode�_bootlocaler)�do_setlocaler�rrrrnsZgetandroidapilevelcCsdSr�r)r�rrrr|scCs&tjjrdSt�d}|dkr"d}|S)zfReturn the charset that the user is likely using,
                by looking at environment variables.r�r&N�ascii)r�r�r�r)r��resrrrr�s
cCs`tjjrdSddl}|rDtt�}zttd�Wntk
rBYnX|�d�}|r\tt|�|S)zdReturn the charset that the user is likely using,
            according to the system configuration.r�rNr(F)r�r�r�r�rrrr)r�r�Zoldloc�resultrrrr�s

r<r�ZJIS7ZeucJPzKOI8-CZCP1251ZCP1255ZCP1256z	ISO8859-2z	ISO8859-5r�z
ISO8859-10z
ISO8859-11z
ISO8859-13z
ISO8859-14z
ISO8859-16z	ISO8859-3z	ISO8859-4z	ISO8859-6z	ISO8859-7z	ISO8859-8z	ISO8859-9ZSJISZTACTISZeucKRr�zKOI8-RzKOI8-TzKOI8-UZRK1048),�437�c�enZjisZjis7ZajecZkoi8cZmicrosoftcp1251Zmicrosoftcp1255Zmicrosoftcp1256Z88591Z88592Z88595Z885915r��latin_1�	iso8859_1�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�
iso2022_jp�	shift_jis�tactis�euc_jp�euc_kr�utf_8�koi8_rZkoi8_tZkoi8_u�kz1048�cp1251�cp1255�cp1256r}r(zaz_AZ.KOI8-Czaa_DJ.ISO8859-1zaa_ER.UTF-8zaa_ET.UTF-8zaf_ZA.ISO8859-1zagr_PE.UTF-8zak_GH.UTF-8zam_ET.UTF-8zen_US.ISO8859-1zan_ES.ISO8859-15zanp_IN.UTF-8zar_AA.ISO8859-6zar_AE.ISO8859-6zar_BH.ISO8859-6zar_DZ.ISO8859-6zar_EG.ISO8859-6zar_IN.UTF-8zar_IQ.ISO8859-6zar_JO.ISO8859-6zar_KW.ISO8859-6zar_LB.ISO8859-6zar_LY.ISO8859-6zar_MA.ISO8859-6zar_OM.ISO8859-6zar_QA.ISO8859-6zar_SA.ISO8859-6zar_SD.ISO8859-6zar_SS.UTF-8zar_SY.ISO8859-6zar_TN.ISO8859-6zar_YE.ISO8859-6zas_IN.UTF-8zast_ES.ISO8859-15zayc_PE.UTF-8zaz_AZ.ISO8859-9Ezaz_IR.UTF-8zbe_BY.CP1251zbe_BY.UTF-8@latinzbg_BG.UTF-8zbem_ZM.UTF-8zber_DZ.UTF-8zber_MA.UTF-8zbg_BG.CP1251zbhb_IN.UTF-8zbho_IN.UTF-8zbho_NP.UTF-8zbi_VU.UTF-8zbn_BD.UTF-8zbn_IN.UTF-8zbo_CN.UTF-8zbo_IN.UTF-8znb_NO.ISO8859-1zbr_FR.ISO8859-1zbrx_IN.UTF-8zbs_BA.ISO8859-2zbyn_ER.UTF-8zfr_CA.ISO8859-1zen_US.UTF-8zca_ES.ISO8859-1zca_AD.ISO8859-1zca_ES.UTF-8@valenciazca_FR.ISO8859-1zca_IT.ISO8859-1zce_RU.UTF-8zzh_CN.eucCNzzh_TW.eucTWzchr_US.UTF-8zckb_IQ.UTF-8zcmn_TW.UTF-8zcrh_UA.UTF-8zhr_HR.ISO8859-2zcs_CZ.ISO8859-2zcsb_PL.UTF-8zcv_RU.UTF-8zcy_GB.ISO8859-1zda_DK.ISO8859-1zde_DE.ISO8859-1zde_AT.ISO8859-1zde_BE.ISO8859-1zde_CH.ISO8859-1zde_IT.ISO8859-1zde_LI.UTF-8zde_LU.ISO8859-1zdoi_IN.UTF-8znl_NL.ISO8859-1znl_BE.ISO8859-1zdv_MV.UTF-8zdz_BT.UTF-8zee_EE.ISO8859-4zet_EE.ISO8859-1zel_GR.ISO8859-7zel_CY.ISO8859-7zel_GR.ISO8859-15zen_AG.UTF-8zen_AU.ISO8859-1zen_BE.ISO8859-1zen_BW.ISO8859-1zen_CA.ISO8859-1zen_DK.ISO8859-1zen_DL.UTF-8zen_GB.ISO8859-1zen_HK.ISO8859-1zen_IE.ISO8859-1zen_IL.UTF-8zen_IN.ISO8859-1zen_NG.UTF-8zen_NZ.ISO8859-1zen_PH.ISO8859-1zen_SC.UTF-8zen_SG.ISO8859-1zen_US.ISO8859-15zen_ZA.ISO8859-1zen_ZM.UTF-8zen_ZW.ISO8859-1zen_ZS.UTF-8zen_EN.ISO8859-1zeo_XX.ISO8859-3zeo.UTF-8zeo_EO.ISO8859-3zeo_US.UTF-8zes_ES.ISO8859-1zes_AR.ISO8859-1zes_BO.ISO8859-1zes_CL.ISO8859-1zes_CO.ISO8859-1zes_CR.ISO8859-1zes_CU.UTF-8zes_DO.ISO8859-1zes_EC.ISO8859-1zes_GT.ISO8859-1zes_HN.ISO8859-1zes_MX.ISO8859-1zes_NI.ISO8859-1zes_PA.ISO8859-1zes_PE.ISO8859-1zes_PR.ISO8859-1zes_PY.ISO8859-1zes_SV.ISO8859-1zes_US.ISO8859-1zes_UY.ISO8859-1zes_VE.ISO8859-1zet_EE.ISO8859-15zeu_ES.ISO8859-1zeu_FR.ISO8859-1zfa_IR.UTF-8zfa_IR.ISIRI-3342zff_SN.UTF-8zfi_FI.ISO8859-15zfil_PH.UTF-8zfi_FI.ISO8859-1zfo_FO.ISO8859-1zfr_FR.ISO8859-1zfr_BE.ISO8859-1zfr_CH.ISO8859-1zfr_LU.ISO8859-1zfur_IT.UTF-8zfy_DE.UTF-8zfy_NL.UTF-8zga_IE.ISO8859-1zgl_ES.ISO8859-1zgd_GB.ISO8859-1zgez_ER.UTF-8zgez_ET.UTF-8zgu_IN.UTF-8zgv_GB.ISO8859-1zha_NG.UTF-8zhak_TW.UTF-8zhe_IL.ISO8859-8zhi_IN.ISCII-DEVzhif_FJ.UTF-8zhne_IN.UTF-8zhsb_DE.ISO8859-2zht_HT.UTF-8zhu_HU.ISO8859-2zhy_AM.UTF-8zhy_AM.ARMSCII_8zia.UTF-8zia_FR.UTF-8zis_IS.ISO8859-1zid_ID.ISO8859-1zig_NG.UTF-8zik_CA.UTF-8zit_IT.ISO8859-1zit_CH.ISO8859-1ziu_CA.NUNACOM-8ziw_IL.UTF-8zja_JP.eucJPz
ja_JP.SJISzka_GE.GEORGIAN-ACADEMYzka_GE.GEORGIAN-PSzkab_DZ.UTF-8z
kk_KZ.ptcp154zkl_GL.ISO8859-1zkm_KH.UTF-8zkn_IN.UTF-8zko_KR.eucKRzkok_IN.UTF-8zks_IN.UTF-8zks_IN.UTF-8@devanagarizku_TR.ISO8859-9zkw_GB.ISO8859-1zky_KG.UTF-8zlb_LU.UTF-8zlg_UG.ISO8859-10zli_BE.UTF-8zli_NL.UTF-8zlij_IT.UTF-8zlt_LT.ISO8859-13zln_CD.UTF-8zlo_LA.MULELAO-1zlo_LA.IBM-CP1133zlv_LV.ISO8859-13zlzh_TW.UTF-8zmag_IN.UTF-8zmai_IN.UTF-8zmai_NP.UTF-8zmfe_MU.UTF-8zmg_MG.ISO8859-15zmhr_RU.UTF-8zmi_NZ.ISO8859-1zmiq_NI.UTF-8zmjw_IN.UTF-8zmk_MK.ISO8859-5zml_IN.UTF-8zmn_MN.UTF-8zmni_IN.UTF-8zmr_IN.UTF-8zms_MY.ISO8859-1zmt_MT.ISO8859-3zmy_MM.UTF-8znan_TW.UTF-8znds_DE.UTF-8znds_NL.UTF-8zne_NP.UTF-8znhn_MX.UTF-8zniu_NU.UTF-8zniu_NZ.UTF-8znl_AW.UTF-8znn_NO.ISO8859-1zno_NO.ISO8859-1zny_NO.ISO8859-1znr_ZA.ISO8859-1znso_ZA.ISO8859-15zoc_FR.ISO8859-1zom_ET.UTF-8zom_KE.ISO8859-1zor_IN.UTF-8zos_RU.UTF-8zpa_IN.UTF-8zpa_PK.UTF-8zpap_AN.UTF-8zpap_AW.UTF-8zpap_CW.UTF-8zpd_US.ISO8859-1zpd_DE.ISO8859-1zph_PH.ISO8859-1zpl_PL.ISO8859-2zpt_PT.ISO8859-1zpt_BR.ISO8859-1zpp_AN.ISO8859-1zps_AF.UTF-8zquz_PE.UTF-8zraj_IN.UTF-8zro_RO.ISO8859-2zru_RU.UTF-8zru_UA.KOI8-Uzru_RU.KOI8-Rzrw_RW.ISO8859-1zsa_IN.UTF-8zsat_IN.UTF-8zsc_IT.UTF-8zsd_IN.UTF-8zsd_IN.UTF-8@devanagarizsd_PK.UTF-8zse_NO.UTF-8zsr_RS.UTF-8@latinzsgs_LT.UTF-8zsr_CS.ISO8859-2zsh_HR.ISO8859-2zshn_MM.UTF-8zshs_CA.UTF-8zsi_LK.UTF-8zsid_ET.UTF-8zsk_SK.ISO8859-2zsl_SI.ISO8859-2zsl_CS.ISO8859-2zsm_WS.UTF-8zso_DJ.ISO8859-1zso_ET.UTF-8zso_KE.ISO8859-1zso_SO.ISO8859-1zsr_CS.ISO8859-5zsq_AL.ISO8859-2zsq_MK.UTF-8zsr_RS.UTF-8zsr_CS.UTF-8@latinzsr_CS.UTF-8zsr_ME.UTF-8zsr_CS.CP1251zss_ZA.ISO8859-1zst_ZA.ISO8859-1zsv_SE.ISO8859-1zsv_FI.ISO8859-1zsw_KE.UTF-8zsw_TZ.UTF-8zszl_PL.UTF-8z
ta_IN.TSCII-0zta_LK.UTF-8ztcy_IN.UTF-8zte_IN.UTF-8ztg_TJ.KOI8-Czth_TH.ISO8859-11zth_TH.TIS620zthe_NP.UTF-8zti_ER.UTF-8zti_ET.UTF-8ztig_ER.UTF-8ztk_TM.UTF-8ztl_PH.ISO8859-1ztn_ZA.ISO8859-15zto_TO.UTF-8ztpi_PG.UTF-8ztr_TR.ISO8859-9ztr_CY.ISO8859-9zts_ZA.ISO8859-1ztt_RU.TATAR-CYRztt_RU.UTF-8@iqtelifzug_CN.UTF-8zuk_UA.KOI8-Uz	en_US.utfzunm_US.UTF-8zur_PK.CP1256zur_IN.UTF-8zuz_UZ.UTF-8zve_ZA.UTF-8z
vi_VN.TCVNzvi_VN.VISCIIzwa_BE.ISO8859-1zwae_CH.UTF-8zwal_ET.UTF-8zwo_SN.UTF-8zxh_ZA.ISO8859-1zyi_US.CP1255zyo_NG.UTF-8zyue_HK.UTF-8zyuw_PG.UTF-8zzh_CN.gb2312z
zh_TW.big5zzh_HK.big5hkscszzh_SG.GB2312z	zh_SG.GBKzzu_ZA.ISO8859-1(LZa3Za3_azz
a3_az.koicZaa_djZaa_erZaa_etZafZaf_zaZagr_peZak_ghZamZam_etZamericanZan_esZanp_inZarZar_aaZar_aeZar_bhZar_dzZar_egZar_inZar_iqZar_joZar_kwZar_lbZar_lyZar_maZar_omZar_qaZar_saZar_sdZar_ssZar_syZar_tnZar_ye�arabic�asZas_inZast_esZayc_peZazZaz_azzaz_az.iso88599eZaz_irZbezbe@latinz
be_bg.utf8Zbe_byzbe_by@latinZbem_zmZber_dzZber_maZbgZbg_bgzbhb_in.utf8Zbho_inZbho_npZbi_vuZbn_bdZbn_inZbo_cnZbo_inZbokmalubokmål�brZbr_frZbrx_inZbsZbs_baZ	bulgarianZbyn_err�zc-frenchzc.asciizc.enz
c.iso88591zc.utf8Zc_czc_c.cZcaZca_adZca_eszca_es@valenciaZca_frZca_itZcatalanZce_ruZcextendz	chinese-sz	chinese-tZchr_usZckb_iqZcmn_twZcrh_uaZcroatianZcsZcs_csZcs_czZcsb_plZcv_ruZcyZcy_gbZczZcz_czZczechZdaZda_dkZdanishZdanskZdeZde_atZde_beZde_chZde_deZde_itz
de_li.utf8Zde_luZdeutschZdoi_inZdutchzdutch.iso88591Zdv_mvZdz_btZeeZee_eeZeestiZelZel_cyZel_grz
el_gr@euror�Zen_agZen_auZen_beZen_bwZen_caZen_dkz
en_dl.utf8Zen_gbZen_hkZen_ieZen_ilZen_inZen_ngZen_nzZen_phz
en_sc.utf8Zen_sgZen_ukZen_uszen_us@euro@euroZen_zaZen_zmZen_zwz
en_zw.utf8Zeng_gbZenglishzenglish.iso88591Z
english_ukzenglish_united-stateszenglish_united-states.437Z
english_usZeozeo.utf8Zeo_eoz
eo_us.utf8Zeo_xxZesZes_arZes_boZes_clZes_coZes_crZes_cuZes_doZes_ecZes_esZes_gtZes_hnZes_mxZes_niZes_paZes_peZes_prZes_pyZes_svZes_usZes_uyZes_veZestonianZetZet_eeZeuZeu_esZeu_frZfaZfa_irzfa_ir.isiri3342Zff_snZfiZfi_fiZfil_phZfinnishZfoZfo_fo�frZfr_beZfr_caZfr_chZfr_frZfr_luu	françaisZfre_frZfrenchzfrench.iso88591Z
french_franceZfur_itZfy_deZfy_nlZgaZga_ieZgalegoZgalicianZgdZgd_gbZger_deZgermanzgerman.iso88591Zgerman_germanyZgez_erZgez_etZglZgl_es�greekZgu_inZgvZgv_gbZha_ngZhak_twZheZhe_il�hebrew�hiZhi_inzhi_in.isciidevZhif_fjZhneZhne_inZhrZhr_hrZhrvatskiZhsb_deZht_htZhuZhu_huZ	hungarianZhy_amzhy_am.armscii8ZiaZia_frZ	icelandic�idZid_idZig_ngZik_ca�inZin_idryZis_isz
iso-8859-1r�z	iso8859-1z
iso8859-15�
iso_8859_1�iso_8859_15�itZit_chZit_itZitalianZiuZiu_caziu_ca.nunacom8ZiwZiw_ilz
iw_il.utf8ZjaZja_jpz	ja_jp.euczja_jp.mscodez	ja_jp.pckZjapanZjapanesezjapanese-euczjapanese.eucZjp_jpZkaZka_gezka_ge.georgianacademyzka_ge.georgianpszka_ge.georgianrsZkab_dzZkk_kzZklZkl_glZkm_khZknZkn_inZkoZko_krz	ko_kr.eucZkok_in�koreanz
korean.eucZksZks_inzks_in@devanagari.utf8Zku_tr�kwZkw_gbZkyZky_kgZlb_luZlg_ugZli_beZli_nlZlij_itZ
lithuanianZln_cd�loZlo_lazlo_la.cp1133zlo_la.ibmcp1133zlo_la.mulelao1�ltZlt_ltZlvZlv_lvZlzh_twZmag_inZmaiZmai_inZmai_npZmfe_muZmg_mgZmhr_ru�miZmi_nzZmiq_niZmjw_inZmkZmk_mkZmlZml_inZmn_mnZmni_inZmrZmr_inZmsZms_myZmtZmt_mtZmy_mmZnan_twZnbZnb_noZnds_deZnds_nlZne_npZnhn_mxZniu_nuZniu_nz�nlZnl_awZnl_beZnl_nlZnnZnn_noZnoz
no@nynorskZno_nozno_no.iso88591@bokmalzno_no.iso88591@nynorskZ	norwegianZnrZnr_zaZnsoZnso_zaZnyZny_noZnynorskZocZoc_frZom_etZom_ke�orZor_inZos_ruZpaZpa_inZpa_pkZpap_anZpap_awZpap_cwZpdZpd_deZpd_usZphZph_phZplZpl_plZpolishZ
portugueseZportuguese_brazil�posixz
posix-utf2ZppZpp_anZps_afZptZpt_brZpt_ptZquz_peZraj_inZroZro_roZromanianZruZru_ruZru_uaZrumanianZrussianZrwZrw_rwZsa_inZsat_inZsc_itZsdZsd_inzsd_in@devanagari.utf8Zsd_pkZse_noZ
serbocroatianZsgs_ltZshzsh_ba.iso88592@bosniaZsh_hrzsh_hr.iso88592Zsh_spZsh_yuZshn_mmZshs_caZsiZsi_lkZsid_etZsinhalaZskZsk_skZslZsl_csZsl_siZslovakZsloveneZ	slovenianZsm_wsZso_djZso_etZso_keZso_soZspZsp_yuZspanishZ
spanish_spainZsqZsq_alZsq_mk�srzsr@cyrilliczsr@latnZsr_cszsr_cs.iso88592@latnz
sr_cs@latnZsr_meZsr_rsz
sr_rs@latnZsr_spZsr_yuzsr_yu.cp1251@cyrilliczsr_yu.iso88592zsr_yu.iso88595zsr_yu.iso88595@cyrilliczsr_yu.microsoftcp1251@cyrillicz
sr_yu.utf8zsr_yu.utf8@cyrilliczsr_yu@cyrillicZssZss_za�stZst_zaZsvZsv_fiZsv_seZsw_keZsw_tzZswedishZszl_plZtaZta_inzta_in.tsciizta_in.tscii0Zta_lkztcy_in.utf8ZteZte_inZtgZtg_tjZthZth_thzth_th.tactiszth_th.tis620�thaiZthe_npZti_erZti_etZtig_erZtk_tmZtlZtl_phZtnZtn_zaZto_toZtpi_pgZtrZtr_cyZtr_trruZts_zaZttZtt_ruztt_ru.tatarcyrz
tt_ru@iqtelifZturkishZug_cnZukZuk_uaZunivZ	universalzuniversal.utf8@ucs4Zunm_usZurZur_inZur_pkZuzZuz_uzzuz_uz@cyrillicZveZve_zaZviZvi_vnz
vi_vn.tcvnzvi_vn.tcvn5712zvi_vn.visciizvi_vn.viscii111ZwaZwa_beZwae_chZwal_etZwo_snZxhZxh_zaZyiZyi_usZyo_ngZyue_hkZyuw_pgZzhZzh_cnz
zh_cn.big5z	zh_cn.eucZzh_hkzzh_hk.big5hkZzh_sgz	zh_sg.gbkZzh_twz	zh_tw.euczzh_tw.euctwZzuZzu_zaZaf_ZAZsq_ALZgsw_FRZam_ETZar_SAZar_IQZar_EGZar_LYZar_DZZar_MAZar_TNZar_OMZar_YEZar_SYZar_JOZar_LBZar_KWZar_AEZar_BHZar_QAZhy_AMZas_INZaz_AZZba_RUZeu_ESZbe_BYZbn_INZbs_BAZbr_FRZbg_BGZca_ESZzh_CHSZzh_TWZzh_CNZzh_HKZzh_SGZzh_MOZzh_CHTZco_FRZhr_HRZhr_BAZcs_CZZda_DKZgbz_AFZdiv_MVZnl_NLZnl_BEZen_USZen_GBZen_AUZen_CAZen_NZZen_IEZen_ZAZen_JAZen_CBZen_BZZen_TTZen_ZWZen_PHZen_INZen_MYZet_EEZfo_FOZfil_PHZfi_FIZfr_FRZfr_BEZfr_CAZfr_CHZfr_LUZfr_MCZfy_NLZgl_ESZka_GEZde_DEZde_CHZde_ATZde_LUZde_LIZel_GRZkl_GLZgu_INZha_NGZhe_ILZhi_INZhu_HUZis_ISZid_IDZiu_CAZga_IEZit_ITZit_CHZja_JPZkn_INZkk_KZZkh_KHZqut_GTZrw_RWZkok_INZko_KRZky_KGZlo_LAZlv_LVZlt_LTZdsb_DEZlb_LUZmk_MKZms_MYZms_BNZml_INZmt_MTZmi_NZZarn_CLZmr_INZmoh_CAZmn_MNZmn_CNZne_NPZnb_NOZnn_NOZoc_FRZor_INZps_AFZfa_IRZpl_PLZpt_BRZpt_PTZpa_INZquz_BOZquz_ECZquz_PEZro_ROZrm_CHZru_RUZsmn_FIZsmj_NOZsmj_SEZse_NOZse_SEZse_FIZsms_FIZsma_NOZsma_SEZsa_INZsr_SPZsr_BAZsi_LKZns_ZAZtn_ZAZsk_SKZsl_SIZes_ESZes_MXZes_GTZes_CRZes_PAZes_DOZes_VEZes_COZes_PEZes_ARZes_ECZes_CLZes_URZes_PYZes_BOZes_SVZes_HNZes_NIZes_PRZes_USZsw_KEZsv_SEZsv_FIZsyr_SYZtg_TJZtmz_DZZta_INZtt_RUZte_INZth_THZbo_BTZbo_CNZtr_TRZtk_TMZug_CNZuk_UAZwen_DEZur_PKZur_INZuz_UZZvi_VNZcy_GBZwo_SNZxh_ZAZsah_RUZii_CNZyo_NGZzu_ZA)�i6ii�i^iiiiiiii i$i(i,i0i4i8i<i@i+iMi,i,imi-i#iEi ii~iir%iiiiii|i�iiiii�ieiii	i	i	i	i	i	i	i	 i	$i	(i	,i	0i	4i	@i	Di	Hi%i8idiiiiiiiibiVi7iiiiiiioiGihi
i9iii!i]i]i<iiiiKi?iSi�i�iWii@iTi&i'i.ini/i>i>iLi:i�iziNi|iPiPiaiii�iHici)iiiiFikikikiiii;$i;i;i;i;i;i; i;i;iOiiiii[ili2ii$i
i
i
i
i
i
i
i
 i
$i
(i
,i
0i
4i
8i
<i
@i
Di
Hi
Li
Pi
TiAiiiZi(i_iIiDiJiiQiQiiBi�i"i.i i iCiCi*iRi�i4i�ixiji5cCs�i}|fdd�}|�|d=td�td�t�\}}td|p@d�td|pNd�t�td	�td�|��D]@\}}t|d
�t|�\}}td|p�d�td|p�d�t�qpt�td
�td�t�|��D]B\}}t|d
�t|�\}}td|p�d�td|�pd�t�q�zttd�Wn$td�td�td�YnhXt�td�td�|��D]F\}}t|d
�t|�\}}td|�p�d�td|�p�d�t��qldS)z Test function.
    cSs0t���D] \}}|dd�dkr
|||<q
dS)Nr#ZLC_)�globals�items)�
categories�k�vrrr�_init_categories�sz'_print_locale.<locals>._init_categoriesrz4Locale defaults as determined by getdefaultlocale():zH------------------------------------------------------------------------z
Language: z(undefined)z
Encoding: zLocale settings on startup:z...z
   Language: z
   Encoding: z,Locale settings after calling resetlocale():r(zNOTE:z9setlocale(LC_ALL, "") does not support the default localez&given in the OS environment variables.z4Locale settings after calling setlocale(LC_ALL, ""):N)rzrr�rrrr)r�r�Zlang�enc�namer=rrr�
_print_locale�sV



r��LC_MESSAGES�__main__zLocale aliasing:zNumber formatting:)N)F)FF)FF)FF)TFF)r�)N)T)T)T)T)K�__doc__r�r�Zencodings.aliases�rer`�builtinsrr��	functools�__all__rrr�r�rrrrr�rrrrCrr	rr�rr
r?r@�wrapsrErRrS�compiler\rYrrrrv�floatrr
r|r�r�r�rr�r�rrrr��
startswithr�CODESET�	NameError�hasattrr��sortedr�r�r�rs�
setdefaultr�r�r�rK�__name__rzrrrr�<module>st�	




%-S"5
$�6}�����
a��V:

pdb.cpython-38.opt-2.pyc000064400000100516151450073350010707 0ustar00U

e5d��"@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZGdd�de�Zdddddd	d
ddg	Zd
d�Zdd�Zdd�ZGdd�de�ZdZGdd�dejej�Zedk	�rjddddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g"ZeD]"Zeeed7e�j��d87Z�q6eej j7Z[[dId9d�Z!dJd:d�Z"d;d�Z#d<d	�Z$dd=�d>d
�Z%dKd?d�Z&d@d�Z'dAZ(dBdC�Z)dDd�Z*dEZ+dFdG�Z,e-dHk�r�ddl.Z.e.�,�dS)L�Nc@seZdZdS)�RestartN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/pdb.pyrWsr�run�pm�Pdb�runeval�runctx�runcall�	set_trace�post_mortem�helpc
Cs�t�dt�|��}zt�|�}Wntk
r8YdSX|�@t|dd�D],\}}|�|�rL|||fW5QR�SqLW5QRXdS)Nzdef\s+%s\s*[(]�)�start)�re�compile�escape�tokenize�open�OSError�	enumerate�match)�funcname�filenameZcre�fp�lineno�linerrr�
find_function^s
&r cCsXt�|�\}}t�|�r,|j|jkr,|dfSt�|�r>|dfSt�||d��|dfS�Nr)�inspectZ
findsourceZisframe�	f_globals�f_localsZismoduleZgetblock)�obj�linesrrrr�getsourcelinesks
r'cCs8tt�|��}|��|D]\}}||kr|SqdS�Nr)�list�disZfindlinestarts�reverse)�codeZlastiZ
linestarts�irrrr�lasti2linenots
r.c@seZdZdd�ZdS)�_rstrcCs|S�Nr��selfrrr�__repr__sz_rstr.__repr__N)rrrr3rrrrr/}sr/z
-> c@seZdZdZd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZeZd�d8d9�Zd:d;�ZeZ eZ!eZ"d<d=�Z#eZ$d>d?�Z%d@dA�Z&dBdC�Z'eZ(dDdE�Z)eZ*dFdG�Z+eZ,dHdI�Z-eZ.dJdK�Z/e/Z0eZ1eZ2dLdM�Z3e3Z4e3Z5dNdO�Z6dPdQ�Z7e7Z8dRdS�Z9e9Z:dTdU�Z;e;Z<dVdW�Z=e=Z>dXdY�Z?e?Z@dZd[�ZAeAZBd\d]�ZCeCZDd^d_�ZEeEZFZGd`da�ZHeHZIdbdc�ZJeZKddde�ZLeLZMeLZNdfdg�ZOdhdi�ZPePZQdjdk�ZReRZSdldm�ZTd�dndo�ZUdpdq�ZVdrds�ZWeZXeZYeZZdtdu�Z[e[Z\dvdw�Z]e]Z^dxdy�Z_eZ`d�d{d|�Zad}d~�ZbeZcdd��ZdeZed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d�d�d�d�d�gZld�d��Zmenfd�d��Zod�d��ZpepZqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��ZvdS)�r
N�tabFTc		Cs>tjj||d�tj�||||�t�d�|r6d|_d|_i|_	i|_
d|_d|_i|_
zddl}|�d�Wntk
r�YnXd|_||_g|_|�rz,ttj�d���}|j�|�W5QRXWntk
r�YnXz$td	��}|j�|�W5QRXWntk
�rYnXi|_i|_i|_d|_d|_dS)
N)�skipzpdb.Pdbrz(Pdb) �Fz 	
`@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)�bdb�Bdb�__init__�cmd�Cmd�sys�auditZuse_rawinput�prompt�aliases�
displaying�
mainpyfile�_wait_for_mainpyfile�	tb_lineno�readlineZset_completer_delims�ImportError�allow_kbdint�nosigint�rcLinesr�os�path�
expanduser�extendr�commands�commands_doprompt�commands_silent�commands_defining�
commands_bnum)	r2�completekey�stdin�stdoutr5rGZreadrcrDZrcFilerrrr9�sF

zPdb.__init__cCs*|jr
t�|�d�|��|�|�dS)Nz-
Program interrupted. (Use 'cont' to resume).)rF�KeyboardInterrupt�message�set_stepr)r2Zsignum�framerrr�sigint_handler�s

zPdb.sigint_handlercCstj�|�|��dSr0)r7r8�reset�forgetr1rrrrZ�sz	Pdb.resetcCs&d|_g|_d|_d|_|j��dSr()r�stack�curindex�curframerC�clearr1rrrr[�s
z
Pdb.forgetcCsh|��|�||�\|_|_|rDt|jj|j�}||j|j<|j	}q|j|jd|_
|j
j|_|�
�Sr()r[Z	get_stackr\r]r.�tb_frame�f_code�tb_lastirC�tb_nextr^r$�curframe_locals�execRcLines)r2�f�tbrrrr�setup�s
z	Pdb.setupcCsd|js
dS|j}|��g|_|r`|����}|r|ddkr|�|�r|jt|�7_dSqdS)Nr�#T)rHr+�pop�strip�onecmd�reversed)r2rHrrrrre�s
zPdb.execRcLinescCs.|jr
dS|�|�r*|�d�|�|d�dS)Nz--Call--)rBZ	stop_hererV�interaction)r2rXZ
argument_listrrr�	user_call�s


z
Pdb.user_callcCsH|jr.|j|�|jj�ks$|jdkr(dSd|_|�|�rD|�|d�dS)NrF)rBrA�canonicra�co_filename�f_lineno�bp_commandsrn)r2rXrrr�	user_line�s�
z
Pdb.user_linecCs�t|dd�r�|j|jkr�|j}d|_|j}|�|d�|j|D]}|�|�q@||_|j|sr|�|j|j	�|j
|r�|��|��dSdS)N�	currentbpFrr)
�getattrrurM�lastcmdrhrlrO�print_stack_entryr\r]rN�_cmdloopr[)r2rXruZlastcmd_backrrrrrss"
�

zPdb.bp_commandscCs.|jr
dS||jd<|�d�|�|d�dS)N�
__return__z
--Return--)rBr$rVrn)r2rXZreturn_valuerrr�user_return s


zPdb.user_returncCsh|jr
dS|\}}}||f|jd<|s2|tkr2dnd}|�d|t�||�d��f�|�||�dS)NZ
__exception__z	Internal r6z%s%s���)rBr$�
StopIterationrV�	traceback�format_exception_onlyrkrn)r2rX�exc_info�exc_type�	exc_value�
exc_traceback�prefixrrr�user_exception(s
���zPdb.user_exceptioncCsBzd|_|��d|_Wq>Wqtk
r:|�d�YqXqdS)NTFz--KeyboardInterrupt--)rF�cmdlooprUrVr1rrrry<szPdb._cmdloopcCs^|j�|j�}|rZ|��D]>\}}|�|�}||k	r||kr|||<|�d|||f�qdS)Nzdisplay %s: %r  [old: %r])r@�getr^�items�_getval_exceptrV)r2r@�exprZoldvalueZnewvaluerrr�preloopIs
�zPdb.preloopcCsttjr6zt�tjtj�Wntk
r.YnXdt_|�||�rN|��dS|�|j|j	�|�
�|��dSr0)r
�_previous_sigint_handler�signal�SIGINT�
ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVszPdb.interactioncCs|dk	r|�t|��dSr0)rV�repr)r2r%rrr�displayhookhszPdb.displayhookc	Cs�|dd�dkr|dd�}|j}|jj}zdt|ddd�}tj}tj}tj}z(|jt_|jt_|jt_t|||�W5|t_|t_|t_XWn4t�	�dd�}|�
tj|�d�
��YnXdS)Nr�!�
z<stdin>Zsingle�r|)rdr^r#rr<rTrSr��execr��errorr~rrk)	r2r�locals�globalsr,Zsave_stdoutZ
save_stdinZsave_displayhookr�rrr�defaultps(zPdb.defaultcCs�|��s|S|��}|d|jkr�|j|d}d}|dd�D] }|�dt|�|�}|d7}q@|�dd�|dd���}|��}q|ddkr�|�d�}|dkr�||dd���}|j�	|�|d|��
�}|S)	Nrr�%z%*� �aliasz;;r�)rk�splitr?�replace�str�join�find�lstrip�cmdqueue�append�rstrip)r2r�argsZiiZtmpArgZmarker�nextrrr�precmd�s(�


z
Pdb.precmdcCs"|jstj�||�S|�|�SdSr0)rPr:r;rl�handle_command_def)r2rrrrrl�sz
Pdb.onecmdcCs�|�|�\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf|�|d|�n
|�|�zt|d|�}Wntk
r�|j}YnX|j	|j
kr�d|j|j<g|_dSdS)NZsilentT�endrr��do_F)Z	parselinerOrQr�rMr�rv�AttributeErrorr�r�commands_resumingrN)r2rr:�argZcmdlist�funcrrrr��s,
zPdb.handle_command_defcCst||jd�dS)N��file��printrT�r2�msgrrrrV�szPdb.messagecCstd||jd�dS)Nz***r�r�r�rrrr��sz	Pdb.errorcCs�|���d�rgSz|�||||�}Wntk
r>g}YnXt�t�|�d�}|D]H}tj�|�rx|�	|d�qXtj�
|�rX|���d�rX|�	|d�qX|S)N)�:�,�*�/)�.pyz.pywr�)rk�endswith�_complete_expression�	Exception�globrrIrJ�isdirr��isfile�lower)r2�textr�begidx�endidxZret�globs�fnrrr�_complete_location�s
zPdb._complete_locationcs�fdd�ttjj�D�S)Ncs.g|]&\}}|dk	rt|����rt|��qSr0)r��
startswith)�.0r-�bp�r�rr�
<listcomp>�s�z*Pdb._complete_bpnumber.<locals>.<listcomp>)rr7�
Breakpoint�
bpbynumber�r2r�rr�r�rr�r�_complete_bpnumber�szPdb._complete_bpnumberc	s�|js
gS|jj|j�}d�kr���d��z,|�d}�dd�D]}t||�}qDWnttfk
rrgYSXd��dd��d���fdd�t|�D�S�fdd�|�	�D�SdS)N�.rrr|cs"g|]}|��d�r�|�qS)r|�r��r��n)�dottedr�rrr�sz,Pdb._complete_expression.<locals>.<listcomp>csg|]}|���r|�qSrr�r�r�rrr�s
)
r^r#rdr�rv�KeyErrorr�r��dir�keys)r2r�rr�r��nsr%�partr)r�r�r�rr��s

zPdb._complete_expressioncCs,|sttjj�d}n&zt|�}Wn|�d�YdSX||_||jkrj|j||j||j	|f}nd}g|j|<d|j|<d|j	|<|j
}d|_
d|_zzz|��Wnht
k
�r|r�|d|j|<|d|j|<|d|j	|<n|j|=|j|=|j	|=|�d�YnXW5d|_||_
XdS)	Nrz.Usage: commands [bnum]
        ...
        endTFz(com) rr�z1command definition aborted, old commands restored)�lenr7r�r��intr�rQrMrNrOr>rPr�rU)r2r�ZbnumZold_command_defsZprompt_backrrr�do_commands	sB%

�


zPdb.do_commandsrc
CsB|s8|jr4|�d�tjjD]}|r|�|���qdSd}d}d}|�d�}|dkrz||dd���}|d|���}|�	d�}d}	|dk�r|d|���}|�
|�}
|
s�|�d|�dS|
}||dd���}zt|�}Wn&t
k
�r|�d|�YdSXn�zt|�}Wn�t
k
�r�zt||jj|j�}Wn|}YnXz.t|d��rj|j}|j}|j}	|j}|j}WnD|�|�\}
}}|
�s�|�d	|�YYdS|
}	t|�}YnXYnX|�s�|��}|�||�}|�r>|�|||||	�}|�r|�|�n*|�||�d
}|�d|j|j|jf�dS)Nz!Num Type         Disp Enb   Wherer�rrr�z%r not found from sys.pathzBad lineno: %s�__func__zJThe specified object %r is not a function or was not found along sys.path.r|zBreakpoint %d at %s:%d) �breaksrVr7r�r�Zbpformatr�r�r��rfind�lookupmoduler�r�r��evalr^r#rd�hasattrr��__code__�co_name�co_firstlinenorq�lineinfo�defaultFile�	checklineZ	set_break�
get_breaks�numberr�r)r2r�Z	temporaryr�rr�condZcommaZcolonrrfr�r,�okZlnr�errrrr�do_breakXs�





�

��zPdb.do_breakcCs"|jjj}|dkr|jr|j}|S)Nz<string>)r^rarqrA)r2rrrrr��s
zPdb.defaultFilecCs|�|d�dSr!)r��r2r�rrr�	do_tbreak�sz
Pdb.do_tbreakc
Cs�d}|�d�}t|�dkr(|d��}nt|�dkrB|d��}n|S|dkrR|S|�d�}|ddkr~|d=t|�dkr~|S|��}t|�dkr�|d}n|�|d�}|r�|}|d}t||�}	|	p�|S)	N)NNN�'rr�r6r�r2)r�r�rkr�r�r )
r2Z
identifierZfailedZidstring�id�partsZfname�itemrfZanswerrrrr��s.



zPdb.lineinfocCs�t|d�r|jjnd}t�|||�}|s6|�d�dS|��}|rn|ddksn|dd�dksn|dd�dkr||�d�dS|S)	Nr^zEnd of filerrir�z"""z'''zBlank or comment)r�r^r#�	linecache�getlinerVrkr�)r2rrr�rrrrr��s
��
z
Pdb.checklinecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)Nz
Enabled %s)r��get_bpbynumberr�r��enablerV�r2r�r�r-r�r�rrr�	do_enablesz
Pdb.do_enablecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)NzDisabled %s)r�r�r�r��disablerVr�rrr�
do_disableszPdb.do_disablec
Cs�|�dd�}z|d}Wntk
r0d}YnXz|�|d���}WnHtk
rf|�d�YnXtk
r�}z|�|�W5d}~XYn.X||_|s�|�d|j�n|�d|j�dS)Nr�rr�Breakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.)	r��
IndexErrorr�rkr�r�r�rVr�)r2r�r�r�r�r�rrr�do_condition%s
zPdb.do_conditionc
Cs�|��}zt|d���}Wnd}YnXz|�|d���}WnHtk
rb|�d�Ynvtk
r�}z|�|�W5d}~XYnLX||_|dkr�|dkr�d|}nd}|�d||j	f�n|�d|j	�dS)Nrrr�z%d crossingsz
1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.)
r�r�rkr�rr�r��ignorerVr�)r2r�r��countr�r�Zcountstrrrr�	do_ignore@s,	

��z
Pdb.do_ignorec
Cs�|stztd�}Wntk
r(d}YnX|����}|dkrpdd�tjjD�}|��|D]}|�d|�q\dSd|k�r|�	d�}|d|�}||dd�}zt
|�}Wntk
r�d	|}YnX|�||�}|�
||�}|r�|�|�n|D]}|�d|�q�dS|��}	|	D]\}z|�|�}Wn.tk
�r^}z|�|�W5d}~XYnX|�|�|�d|��qdS)
NzClear all breaks? Zno)�yZyescSsg|]}|r|�qSrr)r�r�rrrr�qsz Pdb.do_clear.<locals>.<listcomp>z
Deleted %sr�rzInvalid line number (%s))�input�EOFErrorrkr�r7r�r�Zclear_all_breaksrVr�r�r�r�Zclear_breakr�r�r�Zclear_bpbynumber)
r2r�ZreplyZbplistr�r-rrr�Z
numberlistrrr�do_clearcsF



zPdb.do_clearcCs|��dSr0)�print_stack_tracer�rrr�do_where�szPdb.do_wherecCs>||_|j|jd|_|jj|_|�|j|j�d|_dSr()r]r\r^r$rdrxr)r2r�rrr�
_select_frame�s

zPdb._select_framecCsz|jdkr|�d�dSzt|p"d�}Wn$tk
rL|�d|�YdSX|dkr\d}ntd|j|�}|�|�dS)NrzOldest framer�Invalid frame count (%s))r]r�r�r��maxr�r2r�rZnewframerrr�do_up�s

z	Pdb.do_upcCs�|jdt|j�kr"|�d�dSzt|p,d�}Wn$tk
rV|�d|�YdSX|dkrpt|j�d}ntt|j�d|j|�}|�|�dS)NrzNewest framerr)r]r�r\r�r�r��minrrrrr�do_down�s
zPdb.do_downcCsh|rRzt|�}Wn$tk
r4|�d|�YdSX||jjkrV|�d�dSnd}|�|j|�dS)N�Error in argument: %rz7"until" line number is smaller than current line numberr)r�r�r�r^rrZ	set_until)r2r�rrrr�do_until�s
zPdb.do_untilcCs|��dSr!)rWr�rrr�do_step�szPdb.do_stepcCs|�|j�dSr!)Zset_nextr^r�rrr�do_next�szPdb.do_nextcCs<|r4ddl}tjdd�}|�|�t_|tjdd�<t�dS)Nrr)�shlexr<�argvr�r)r2r�rZargv0rrr�do_run�sz
Pdb.do_runcCs|�|j�dSr!)Z
set_returnr^r�rrr�	do_returnsz
Pdb.do_returncCs>|js2zt�tj|j�t_Wntk
r0YnX|��dSr!)rGr�r�rYr
r�r�Zset_continuer�rrr�do_continues�zPdb.do_continuec
Cs�|jdt|j�kr"|�d�dSzt|�}Wntk
rL|�d�YnnXz:||j_|j|jd|f|j|j<|�|j|j�Wn0tk
r�}z|�d|�W5d}~XYnXdS)Nrz)You can only jump within the bottom framez)The 'jump' command requires a line numberrzJump failed: %s)	r]r�r\r�r�r�r^rrrx)r2r��errr�do_jump&s
zPdb.do_jumpcCs�t�d�|jj}|j}t|j|j|j�}d|j	�
�|_	|�d�zt�|j
|||f�Wn<tk
r�t��dd�}|�tj|�d�
��YnX|�d�t�|j�|j|_dS)Nz(%s) zENTERING RECURSIVE DEBUGGERr�r|zLEAVING RECURSIVE DEBUGGER)r<�settracer^r#rdr
rRrSrTr>rkrV�call_tracingrr�r�r�r~rZtrace_dispatchrw)r2r�r�r��pr�rrr�do_debugCs


zPdb.do_debugcCsd|_|��dS)NTr)�_user_requested_quit�set_quitr�rrr�do_quitZszPdb.do_quitcCs|�d�d|_|��dS)Nr6Tr)rVr!r"r�rrr�do_EOFes
z
Pdb.do_EOFcCs�|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t	|�D]>}|j
|}||krx|�d|||f�qJ|�d|f�qJdS)Nrz%s = %rz%s = *** undefined ***)r^rard�co_argcount�co_kwonlyargcount�co_flagsr"Z
CO_VARARGSZCO_VARKEYWORDS�range�co_varnamesrV)r2r��co�dictr�r-�namerrr�do_argsns
zPdb.do_argscCs.d|jkr |�t|jd��n
|�d�dS)NrzzNot yet returned!)rdrVr�r�r�rrr�	do_retvals
z
Pdb.do_retvalcCsPzt||jj|j�WSt��dd�}|�tj|�d�	���YnXdS)Nr�r|)
r�r^r#rdr<r�r�r~rrk)r2r�r�rrr�_getval�szPdb._getvalcCsrz2|dkrt||jj|j�WSt||j|j�WSWn:t��dd�}tj|�d�	�}t
d|�YSXdS)Nr�r|z** raised %s **)r�r^r#rdr$r<r�r~rrkr/)r2r�rXr�r�rrrr��szPdb._getval_exceptcCs*z|�t|�|���WnYnXdSr0)rVr�r/r�rrr�do_p�szPdb.do_pcCs,z|�t�|�|���WnYnXdSr0)rV�pprintZpformatr/r�rrr�do_pp�sz	Pdb.do_ppcCsfd|_d}|r�|dkr�z^d|krX|�d�\}}t|���}t|���}||krr||}nt|���}td|d�}Wq�tk
r�|�d|�YdSXn0|jdks�|dkr�td|jj	d�}n
|jd}|dkr�|d}|jj
j}|�|�}zZt
�||jj�}|�||d|�|||j�t|t|��|_t|�|k�rH|�d�Wntk
�r`YnXdS)	Nr)r�r�r�r�
z[EOF])rwr�r�rkr
r�r�rr^rrrarq�get_file_breaksr��getlinesr#�_print_linesrr�rVrU)r2r�Zlast�firstr�	breaklistr&rrr�do_list�s@




�zPdb.do_listc
Csp|jjj}|�|�}zt|j�\}}Wn2tk
rX}z|�|�WY�dSd}~XYnX|�||||j�dSr0)r^rarqr5r'rr�r7)r2r�rr9r&rr�rrr�do_longlist�s


zPdb.do_longlistc
Csvz|�|�}WnYdSXzt|�\}}Wn6ttfk
rd}z|�|�WY�dSd}~XYnX|�||�dSr0)r/r'r�	TypeErrorr�r7)r2r�r%r&rr�rrr�	do_source�s
z
Pdb.do_sourcerc
Cs�|r|j}|j�|d�}nd}}t||�D]|\}}t|��d�}	t|	�dkrV|	d7}	||krh|	d7}	n|	d7}	||kr�|	d7}	n||kr�|	d7}	|�|	d|���q,dS)	Nr|r��r��Bz->z>>�	)	rrrCr�rr��rjustr�rVr�)
r2r&rr�rXZcurrent_linenoZ
exc_linenorr�srrrr7s 

zPdb._print_linescCs�z|�|�}WnYdSXd}z|jj}Wntk
rBYnX|r\|�d|j�dSz
|j}Wntk
rzYnX|r�|�d|j�dS|jtkr�|�d|j|j	f�dS|�t|��dS)Nz	Method %szFunction %szClass %s.%s)
r/r�r�r�rVr��	__class__�typerr)r2r��valuer,rrr�	do_whatiss.

z
Pdb.do_whatiscCsl|s8|�d�|j�|ji���D]}|�d|�q"n0|�|�}||j�|ji�|<|�d||f�dS)NzCurrently displaying:z%s: %rzdisplay %s: %r)rVr@r�r^r�r��
setdefault)r2r�r��valrrr�
do_display<s

zPdb.do_displaycCsT|r@z|j�|ji�|=WqPtk
r<|�d|�YqPXn|j�|jd�dS)Nznot displaying %s)r@r�r^r�r�rjr�rrr�do_undisplayOszPdb.do_undisplaycs�fdd�|j�|ji�D�S)Ncsg|]}|���r|�qSrr�)r�rr�rrr�_s
�z*Pdb.complete_undisplay.<locals>.<listcomp>)r@r�r^r�rr�r�complete_undisplay^szPdb.complete_undisplaycCs |jj|j�}tjd|d�dS)Nz
*interactive*)Zlocal)r^r#rdr,�interact)r2r�r�rrr�do_interactbszPdb.do_interactcCs�|��}t|�dkrHt|j���}|D]}|�d||j|f�q&dS|d|jkr�t|�dkr�|�d|d|j|df�nd�|dd��|j|d<dS)Nrz%s = %srr�)r�r��sortedr?r�rVr�)r2r�r�r�r�rrr�do_aliasks"zPdb.do_aliascCs6|��}t|�dkrdS|d|jkr2|j|d=dSr()r�r�r?)r2r�r�rrr�
do_unalias�s
zPdb.do_unaliascs�fdd�|jD�S)Ncsg|]}|���r|�qSrr�)r��ar�rrr��s
z(Pdb.complete_unalias.<locals>.<listcomp>)r?r�rr�r�complete_unalias�szPdb.complete_unaliasrrrrr#rcCs4z|jD]}|�|�qWntk
r.YnXdSr0)r\rxrU)r2�frame_linenorrrr	�s

zPdb.print_stack_tracecCs6|\}}||jkrd}nd}|�||�||��dS)Nz> z  )r^rVZformat_stack_entry)r2rSZ
prompt_prefixrXrr�rrrrx�s

�zPdb.print_stack_entrycCs�|stj�||�Sz@zt|d|�}|�WWStk
rNt|d|�}YnXWn"tk
rt|�d|�Yn0Xtjjdkr�|�d|�dS|�	|j
���dS)NZhelp_r�zNo help for %rr�zJNo help for %r; please do not run Python with -OO if you need command help)r:r;�do_helprvr�r�r<�flags�optimizerV�__doc__r�)r2r�ZtopicZcommandrrrrT�s 
�zPdb.do_helpcCs|�|jjpd���dS)Nr6)rV�	help_execrWrkr1rrrrX�s
z
Pdb.help_execcCs
t�dSr0)rr1rrr�help_pdb�szPdb.help_pdbcCs�tj�|�rtj�|�r|Stj�tjd|�}tj�|�rP|�|�|jkrP|Stj�|�\}}|dkrp|d}tj�|�r�|StjD]>}tj�	|�r�t�
|�}q�tj�||�}tj�|�r�|Sq�dS)Nrr6r�)rIrJ�isabs�existsr�r<rprA�splitext�islink�readlink)r2rrf�rootZext�dirname�fullnamerrrr��s"

zPdb.lookupmodulec	Csrd|_d|_ddl}|�|�\}}}|�|j�|_ddl}|j�	�|j�
d|j|j|j|t
d��|�|�dS)NTFr�__main__)r�__file__�__package__�
__loader__�__spec__�__builtins__)rBr!�runpyZ_get_module_detailsrprqrArb�__dict__r_�update�parent�loaderrgr)r2Zmodule_namerhZmod_nameZmod_specr,rbrrr�
_runmodule�s 
�zPdb._runmodulec	Cstddl}|j��|j�d|td��d|_|�|�|_d|_t	�
|��}d|��|jf}W5QRX|�|�dS)Nrrb)rrcrgTFzexec(compile(%r, %r, 'exec')))
rbrir_rjrgrBrprAr!�io�	open_code�readr)r2rrbr�	statementrrr�
_runscript
s
�
�zPdb._runscript)r4NNNFT)r)N)rN)wrrrr�r9rYrZr[rhrerortrsr{r�ryr�rnr�r�r�rlr�rVr�r�r�r�r�Zcomplete_commandsr�r�Zdo_bZcomplete_breakZ
complete_br�Zcomplete_tbreakr�r�r�Zcomplete_enabler�Zcomplete_disablerZcomplete_conditionrZcomplete_ignorerZdo_clZcomplete_clearZcomplete_clr
Zdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ
do_restartrZdo_rrZdo_cZdo_contrZdo_jr Zcomplete_debugr#Zdo_qZdo_exitr$r-Zdo_ar.Zdo_rvr/r�r0r2Zcomplete_printZ
complete_pZcomplete_ppr:Zdo_lr;Zdo_llr=Zcomplete_sourcer7rFZcomplete_whatisrIZcomplete_displayrJrKrMrOrPrRr�r	�line_prefixrxrTZdo_hrXrYr�rmrrrrrrr
�s��
/	


M
]!!.	
		1
!	#	��whereZdownZup�breakZtbreakr_r�r�rZ	conditionrM�stepr�ZuntilZjump�returnZretval�continuer)Zlonglistr�rZppZwhatis�sourceZdisplayZ	undisplayrLr�Zunalias�debug�quitr�z

cCst��|||�dSr0)r
r�rqr�r�rrrr<scCst��|||�Sr0)r
r)Z
expressionr�r�rrrr?scCst|||�dSr0)rr|rrrrBscOst�j||�Sr0)r
r
)r��kwdsrrrr
Fs)�headercCs,t�}|dk	r|�|�|�t��j�dSr0)r
rVrr<�	_getframe�f_back)r~�pdbrrrrIs
cCsB|dkrt��d}|dkr$td��t�}|��|�d|�dS)Nr�zAA valid traceback must be passed if no exception is being handled)r<r�r�r
rZrn)�trrrrrQscCsttj�dSr0)rr<�last_tracebackrrrrr	_szimport x; x.main()cCstt�dSr0)r�TESTCMDrrrr�testgsr�cCsddl}|�t�dSr()�pydocZpagerrW)r�rrrrksausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...

Debug the Python program given by pyfile. Alternatively,
an executable module or package to debug can be specified using
the -m switch.

Initial commands are read from .pdbrc files in your home directory
and in the current directory, if they exist.  Commands supplied with
-c are executed after commands from .pdbrc files.

To let the script run until an exception occurs, use "-c continue".
To let the script run up to a given line X in the debugged file, use
"-c 'until X'".c

Csddl}|�tjdd�dddg�\}}|s>tt�t�d�g}d}|D]B\}}|dkrltt�t��qJ|d	kr�|�|�qJ|d
krJd}qJ|d}|s�tj�	|�s�td|d
�t�d�|tjdd�<|s�tj�
|�}tj�|�tjd<t�}|j
�|�z6|�r|�|�n
|�|�|j�r*W�qtd�Wq�tk
�rrtd|d�tdd�tjdd���Yq�tk
�r�tddd�tt��d�Yq�tk
�r�t��t�d�Yq�t��td�td�t��d}	|�d|	�td|d�Yq�Xq�dS)Nrrzmhc:rzcommand=r�F)z-hz--help)z-cz	--command)z-mTzError:zdoes not existz*The program finished and will be restartedZ
Restartingzwith arguments:r@r�z/The program exited via sys.exit(). Exit status:)r�z2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)�getoptr<rr��_usage�exitr�rIrJr[�realpathr`r
rHrLrmrrr!rr��
SystemExitr��SyntaxErrorr~�	print_excrn)
r�Zoptsr�rMZ
run_as_module�optZoptargrAr�r�rrr�main~sd 



 �r�rb)NN)NN)N)/rIrnrr<r:r7r*r,r�r1r�r"rr~r�r�r�__all__r r'r.r�r/rsr8r;r
rWZ_help_orderZ_commandrvrkrXrrrr
rrr	r�r�rr�r�rr�rrrr�<module>Fs��
		*
� 


D
_pydecimal.cpython-38.pyc000064400000471741151450073350011323 0ustar00U

e5d:}�%@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g%ZeZd&Zd'Zd(Zd)d*lZd)d*lZ	d)d*l
Z
zd)d+lmZ
e
dd,�ZWnek
r�d-d.�ZYnXdZdZdZdZdZdZdZdZd/Zd/Ze
jd0kr�d1Zd1Zd2Znd3Zd3Zd4Zeed5ZGd6d�de�Z Gd7d�de �Z!Gd8d	�d	e �Z"Gd9d�de"�Z#Gd:d
�d
e e$�Z%Gd;d�de"�Z&Gd<d�de"e$�Z'Gd=d�de �Z(Gd>d�de"�Z)Gd?d�de �Z*Gd@d
�d
e �Z+GdAd�de(e*�Z,GdBd�de(e*e+�Z-GdCd�de e.�Z/e!e%e(e,e*e-e"e+e/g	Z0e#e"e&e"e'e"e)e"iZ1eeeeeeeefZ2d)d*l3Z3e3�4dD�Z5dEd�Z6dFd�Z7[3d�dGd�Z8GdHd�de9�Z:d�dJdK�Z;e	j<�=e:�GdLdM�dMe9�Z>GdNd�de9�Z?GdOdP�dPe9�Z@d�dQdR�ZAeBjCZDdSdT�ZEdUdV�ZFdWdX�ZGdYdZ�ZHd�d\d]�ZId^d_�ZJd`da�ZKGdbdc�dce9�ZLeL�jMZNd�ddde�ZOdfdg�ZPdhdi�ZQdjdkdldmdndodpdqdrds�	fdtdu�ZRd�dvdw�ZSd�dxdy�ZTe?dzee%e,e"ggd{d|d5d)d}�ZUe?d~ee%e,e"e!e-ggd�ZVe?d~eggd�ZWd)d*lXZXeX�Yd�eXjZeXj[B�j\Z]eX�Yd��j\Z^eX�Yd��j\Z_eX�Yd�eXjZeXj`B�Za[Xzd)d*lbZcWnek
�rYnXd�d�d��Zdd�d��Zed�d��Zfd�d�d��Zgd�d��Zhd�d��Zie:d��Zje:d��Zke:d��Zle:d)�Zme:d5�Zne:d��ZoejekfZpe
jqjrZse
jqjtZue
jqjvZwexdqesd�es�Zy[
d*S)�a�	
This is an implementation of decimal floating point arithmetic based on
the General Decimal Arithmetic Specification:

    http://speleotrove.com/decimal/decarith.html

and IEEE standard 854-1987:

    http://en.wikipedia.org/wiki/IEEE_854-1987

Decimal floating point has finite precision with arbitrarily large bounds.

The purpose of this module is to support arithmetic using familiar
"schoolhouse" rules and to avoid some of the tricky representation
issues associated with binary floating point.  The package is especially
useful for financial applications or for contexts where users have
expectations that are at odds with binary floating point (for instance,
in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead
of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected
Decimal('0.00')).

Here are some examples of using the decimal module:

>>> from decimal import *
>>> setcontext(ExtendedContext)
>>> Decimal(0)
Decimal('0')
>>> Decimal('1')
Decimal('1')
>>> Decimal('-.0123')
Decimal('-0.0123')
>>> Decimal(123456)
Decimal('123456')
>>> Decimal('123.45e12345678')
Decimal('1.2345E+12345680')
>>> Decimal('1.33') + Decimal('1.27')
Decimal('2.60')
>>> Decimal('12.34') + Decimal('3.87') - Decimal('18.41')
Decimal('-2.20')
>>> dig = Decimal(1)
>>> print(dig / Decimal(3))
0.333333333
>>> getcontext().prec = 18
>>> print(dig / Decimal(3))
0.333333333333333333
>>> print(dig.sqrt())
1
>>> print(Decimal(3).sqrt())
1.73205080756887729
>>> print(Decimal(3) ** 123)
4.85192780976896427E+58
>>> inf = Decimal(1) / Decimal(0)
>>> print(inf)
Infinity
>>> neginf = Decimal(-1) / Decimal(0)
>>> print(neginf)
-Infinity
>>> print(neginf + inf)
NaN
>>> print(neginf * inf)
-Infinity
>>> print(dig / 0)
Infinity
>>> getcontext().traps[DivisionByZero] = 1
>>> print(dig / 0)
Traceback (most recent call last):
  ...
  ...
  ...
decimal.DivisionByZero: x / 0
>>> c = Context()
>>> c.traps[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.divide(Decimal(0), Decimal(0))
Decimal('NaN')
>>> c.traps[InvalidOperation] = 1
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> print(c.divide(Decimal(0), Decimal(0)))
Traceback (most recent call last):
  ...
  ...
  ...
decimal.InvalidOperation: 0 / 0
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> c.traps[InvalidOperation] = 0
>>> print(c.divide(Decimal(0), Decimal(0)))
NaN
>>> print(c.flags[InvalidOperation])
1
>>>
�Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�HAVE_THREADS�HAVE_CONTEXTVARZdecimalz1.70z2.4.2�N)�
namedtuplezsign digits exponentcGs|S�N�)�argsr)r)�"/usr/lib64/python3.8/_pydecimal.py�<lambda>��r,Tl����l��N�Zol������N�Zoi@�Ti����c@seZdZdZdd�ZdS)ra1Base exception class.

    Used exceptions derive from this.
    If an exception derives from another exception besides this (such as
    Underflow (Inexact, Rounded, Subnormal) that indicates that it is only
    called if the others are present.  This isn't actually used for
    anything, though.

    handle  -- Called when context._raise_error is called and the
               trap_enabler is not set.  First argument is self, second is the
               context.  More arguments can be given, those being after
               the explanation in _raise_error (For example,
               context._raise_error(NewError, '(-x)!', self._sign) would
               call NewError().handle(context, self._sign).)

    To define a new exception, it should be sufficient to have it derive
    from DecimalException.
    cGsdSr(r)��self�contextr*r)r)r+�handle�szDecimalException.handleN��__name__�
__module__�__qualname__�__doc__r2r)r)r)r+r�sc@seZdZdZdS)ra)Exponent of a 0 changed to fit bounds.

    This occurs and signals clamped if the exponent of a result has been
    altered in order to fit the constraints of a specific concrete
    representation.  This may occur when the exponent of a zero result would
    be outside the bounds of a representation, or when a large normal
    number would have an encoded exponent that cannot be represented.  In
    this latter case, the exponent is reduced to fit and the corresponding
    number of zero digits are appended to the coefficient ("fold-down").
    N�r4r5r6r7r)r)r)r+r�sc@seZdZdZdd�ZdS)r	a0An invalid operation was performed.

    Various bad things cause this:

    Something creates a signaling NaN
    -INF + INF
    0 * (+-)INF
    (+-)INF / (+-)INF
    x % 0
    (+-)INF % x
    x._rescale( non-integer )
    sqrt(-x) , x > 0
    0 ** 0
    x ** (non-integer)
    x ** (+-)INF
    An operand is invalid

    The result of the operation after these is a quiet positive NaN,
    except when the cause is a signaling NaN, in which case the result is
    also a quiet NaN, but with the original sign, and an optional
    diagnostic information.
    cGs,|r(t|dj|djdd�}|�|�StS)Nr&�nT)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r0r1r*�ansr)r)r+r2�s
zInvalidOperation.handleNr3r)r)r)r+r	�sc@seZdZdZdd�ZdS)rz�Trying to convert badly formed string.

    This occurs and signals invalid-operation if a string is being
    converted to a number and it does not conform to the numeric string
    syntax.  The result is [0,qNaN].
    cGstSr(�r>r/r)r)r+r2szConversionSyntax.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)r
a�Division by 0.

    This occurs and signals division-by-zero if division of a finite number
    by zero was attempted (during a divide-integer or divide operation, or a
    power operation with negative right-hand operand), and the dividend was
    not zero.

    The result of the operation is [sign,inf], where sign is the exclusive
    or of the signs of the operands for divide, or is 1 for an odd power of
    -0, for power.
    cGst|Sr()�_SignedInfinity�r0r1�signr*r)r)r+r2szDivisionByZero.handleNr3r)r)r)r+r

sc@seZdZdZdd�ZdS)rz�Cannot perform the division adequately.

    This occurs and signals invalid-operation if the integer result of a
    divide-integer or remainder operation had too many digits (would be
    longer than precision).  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2"szDivisionImpossible.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)rz�Undefined result of division.

    This occurs and signals invalid-operation if division by zero was
    attempted (during a divide-integer, divide, or remainder operation), and
    the dividend is also zero.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2-szDivisionUndefined.handleNr3r)r)r)r+r%sc@seZdZdZdS)ra�Had to round, losing information.

    This occurs and signals inexact whenever the result of an operation is
    not exact (that is, it needed to be rounded and any discarded digits
    were non-zero), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The inexact signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) was inexact.
    Nr8r)r)r)r+r0sc@seZdZdZdd�ZdS)ra�Invalid context.  Unknown rounding, for example.

    This occurs and signals invalid-operation if an invalid context was
    detected during an operation.  This can occur if contexts are not checked
    on creation and either the precision exceeds the capability of the
    underlying concrete representation or an unknown or unsupported rounding
    was specified.  These aspects of the context need only be checked when
    the values are required to be used.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2GszInvalidContext.handleNr3r)r)r)r+r<s
c@seZdZdZdS)ra�Number got rounded (not  necessarily changed during rounding).

    This occurs and signals rounded whenever the result of an operation is
    rounded (that is, some zero or non-zero digits were discarded from the
    coefficient), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The rounded signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) caused a loss of precision.
    Nr8r)r)r)r+rJsc@seZdZdZdS)r
a�Exponent < Emin before rounding.

    This occurs and signals subnormal whenever the result of a conversion or
    operation is subnormal (that is, its adjusted exponent is less than
    Emin, before any rounding).  The result in all cases is unchanged.

    The subnormal signal may be tested (or trapped) to determine if a given
    or operation (or sequence of operations) yielded a subnormal result.
    Nr8r)r)r)r+r
Vsc@seZdZdZdd�ZdS)raNumerical overflow.

    This occurs and signals overflow if the adjusted exponent of a result
    (from a conversion or from an operation that is not an attempt to divide
    by zero), after rounding, would be greater than the largest value that
    can be handled by the implementation (the value Emax).

    The result depends on the rounding mode:

    For round-half-up and round-half-even (and for round-half-down and
    round-up, if implemented), the result of the operation is [sign,inf],
    where sign is the sign of the intermediate result.  For round-down, the
    result is the largest finite number that can be represented in the
    current precision, with the sign of the intermediate result.  For
    round-ceiling, the result is the same as for round-down if the sign of
    the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
    the result is the same as for round-down if the sign of the intermediate
    result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
    will also be raised.
    cGs�|jttttfkrt|S|dkrR|jtkr4t|St|d|j|j	|jd�S|dkr�|jt
krlt|St|d|j|j	|jd�SdS)Nr&�9r.)�roundingrrrrrArr:�prec�EmaxrrBr)r)r+r2ws"�
�
�zOverflow.handleNr3r)r)r)r+rasc@seZdZdZdS)raxNumerical underflow with result rounded to 0.

    This occurs and signals underflow if a result is inexact and the
    adjusted exponent of the result would be smaller (more negative) than
    the smallest value that can be handled by the implementation (the value
    Emin).  That is, the result is both inexact and subnormal.

    The result after an underflow will be a subnormal number rounded, if
    necessary, so that its exponent is not less than Etiny.  This may result
    in 0 with the sign of the intermediate result and an exponent of Etiny.

    In all cases, Inexact, Rounded, and Subnormal will also be raised.
    Nr8r)r)r)r+r�sc@seZdZdZdS)ra�Enable stricter semantics for mixing floats and Decimals.

    If the signal is not trapped (default), mixing floats and Decimals is
    permitted in the Decimal() constructor, context.create_decimal() and
    all comparison operators. Both conversion and comparisons are exact.
    Any occurrence of a mixed operation is silently recorded by setting
    FloatOperation in the context flags.  Explicit conversions with
    Decimal.from_float() or context.create_decimal_from_float() do not
    set the flag.

    Otherwise (the signal is trapped), only equality comparisons and explicit
    conversions are silent. All other mixed operations raise FloatOperation.
    Nr8r)r)r)r+r�sZdecimal_contextcCs8z
t��WStk
r2t�}t�|�|YSXdS)z�Returns this thread's context.

    If this thread does not yet have a context, returns
    a new context and sets this thread's context.
    New contexts are copies of DefaultContext.
    N)�_current_context_var�get�LookupErrorr�set�r1r)r)r+r�s

cCs,|tttfkr|��}|��t�|�dS)z%Set this thread's context to context.N)rrr�copy�clear_flagsrHrKrLr)r)r+r�scCs|dkrt�}t|�S)abReturn a context manager for a copy of the supplied context

    Uses a copy of the current context if no context is specified
    The returned context manager creates a local decimal context
    in a with statement:
        def sin(x):
             with localcontext() as ctx:
                 ctx.prec += 2
                 # Rest of sin calculation algorithm
                 # uses a precision 2 greater than normal
             return +s  # Convert result to normal precision

         def sin(x):
             with localcontext(ExtendedContext):
                 # Rest of sin calculation algorithm
                 # uses the Extended Context from the
                 # General Decimal Arithmetic Specification
             return +s  # Convert result to normal context

    >>> setcontext(DefaultContext)
    >>> print(getcontext().prec)
    28
    >>> with localcontext():
    ...     ctx = getcontext()
    ...     ctx.prec += 2
    ...     print(ctx.prec)
    ...
    30
    >>> with localcontext(ExtendedContext):
    ...     print(getcontext().prec)
    ...
    9
    >>> print(getcontext().prec)
    28
    N)r�_ContextManager)Zctxr)r)r+r�s$c
@s�eZdZdZdZd�dd�Zedd��Zd	d
�Zdd�Z	d�d
d�Z
dd�Zdd�Zdd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd�d*d+�Zd�d,d-�Zd�d.d/�Zd�d0d1�Zd�d3d4�Zd�d5d6�ZeZ�dd7d8�Z�dd9d:�Z �dd;d<�Z!e!Z"�dd=d>�Z#d?d@�Z$�ddAdB�Z%�ddCdD�Z&�ddEdF�Z'�ddGdH�Z(�ddIdJ�Z)�d	dKdL�Z*�d
dMdN�Z+�ddOdP�Z,dQdR�Z-dSdT�Z.e.Z/e0dUdV��Z1e0dWdX��Z2dYdZ�Z3d[d\�Z4d]d^�Z5d_d`�Z6dadb�Z7dcdd�Z8dedf�Z9dgdh�Z:didj�Z;dkdl�Z<dmdn�Z=dodp�Z>e?e7e8e9e:e;e<e=e>dq�Z@�ddrds�ZAdtdu�ZBdvdw�ZC�d
dxdy�ZD�ddzd{�ZEd|d}�ZF�dd~d�ZG�dd�d��ZH�dd�d��ZI�dd�d��ZJ�dd�d��ZKd�d��ZLd�d��ZM�dd�d��ZN�dd�d��ZOeOZP�dd�d��ZQ�dd�d��ZR�dd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZW�dd�d��ZX�dd�d��ZY�dd�d��ZZd�d��Z[d�d��Z\�dd�d��Z]�dd�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zb�dd�d��Zcd�d��Zdd�d��Zed�d��Zf�dd�d��Zgd�d��Zhd�d��Zi�d d�dÄZjd�dńZk�d!d�dDŽZl�d"d�dɄZmd�d˄Znd�d̈́Zo�d#d�dτZp�d$d�dфZq�d%d�dӄZr�d&d�dՄZs�d'd�dׄZt�d(d�dلZu�d)d�dۄZv�d*d�d݄Zw�d+d�d߄Zx�d,d�d�Zyd�d�Zz�d-d�d�Z{�d.d�d�Z|�d/d�d�Z}d�d�Z~d�d�Zd�d�Z��d0d�d�Z�dS(1rz,Floating point class for decimal arithmetic.)�_expr<r;�_is_special�0NcCs�t�|�}t|t��r$t|���dd��}|dkrP|dkr@t�}|�t	d|�S|�
d�dkrfd|_nd|_|�
d	�}|dk	r�|�
d
�p�d}t|�
d�p�d�}tt||��|_
|t|�|_d
|_nZ|�
d�}|dk	�rtt|p�d���d�|_
|�
d��rd|_nd|_nd|_
d|_d|_|St|t��rf|dk�rBd|_nd|_d|_tt|��|_
d
|_|St|t��r�|j|_|j|_|j
|_
|j|_|St|t��r�|j|_t|j�|_
t|j�|_d
|_|St|ttf��r"t|�dk�r�td��t|dt��r|ddk�std��|d|_|ddk�rHd|_
|d|_d|_n�g}	|dD]R}
t|
t��r�d|
k�r|dk�r�nn|	�s�|
dk�r�|	�|
�ntd���qT|ddk�r�d�tt|	��|_
|d|_d|_nDt|dt��rd�tt|	�p�dg��|_
|d|_d
|_ntd��|St|t��rx|dk�r>t�}|�td�t�|�}|j|_|j|_|j
|_
|j|_|St d|��dS)a�Create a decimal point instance.

        >>> Decimal('3.14')              # string input
        Decimal('3.14')
        >>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
        Decimal('3.14')
        >>> Decimal(314)                 # int
        Decimal('314')
        >>> Decimal(Decimal(314))        # another decimal instance
        Decimal('314')
        >>> Decimal('  3.14  \n')        # leading and trailing whitespace okay
        Decimal('3.14')
        �_�NzInvalid literal for Decimal: %rrC�-r.r&�intZfrac�exprRF�diag�signal�Nr9�FT�ztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.�r&r.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.��	zTThe second value in the tuple must be composed of integers in the range 0 through 9.�r9rZzUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabledzCannot convert %r to Decimal)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�groupr;rVr<�lenrPrQ�lstrip�absr�_WorkReprCrW�list�tuple�
ValueError�append�join�map�floatr�
from_float�	TypeError)�cls�valuer1r0�m�intpart�fracpartrWrX�digitsZdigitr)r)r+rc
s�
�





(


�
zDecimal.__new__cCs�t|t�r,|dkrdnd}d}tt|��}nzt|t�r�t�|�sJt�|�rV|t|��St�	d|�dkrld}nd}t|��
�\}}|��d}t|d|�}ntd��t
|||�}|tkr�|S||�SdS)a.Converts a float to a decimal number, exactly.

        Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
        Since 0.1 is not exactly representable in binary floating point, the
        value is stored as the nearest representable value which is
        0x1.999999999999ap-4.  The exact equivalent of the value in decimal
        is 0.1000000000000000055511151231257827021181583404541015625.

        >>> Decimal.from_float(0.1)
        Decimal('0.1000000000000000055511151231257827021181583404541015625')
        >>> Decimal.from_float(float('nan'))
        Decimal('NaN')
        >>> Decimal.from_float(float('inf'))
        Decimal('Infinity')
        >>> Decimal.from_float(-float('inf'))
        Decimal('-Infinity')
        >>> Decimal.from_float(-0.0)
        Decimal('-0')

        r&r.g�?�zargument must be int or float.N)rdrVrermru�_mathZisinfZisnan�reprZcopysign�as_integer_ratio�
bit_lengthrwr:r)rx�frC�k�coeffr9�d�resultr)r)r+rv�s$

zDecimal.from_floatcCs(|jr$|j}|dkrdS|dkr$dSdS)zrReturns whether the number is not actually one.

        0 if a number
        1 if NaN
        2 if sNaN
        r9r.rZr^r&)rQrP)r0rWr)r)r+�_isnan�szDecimal._isnancCs|jdkr|jrdSdSdS)zyReturns whether the number is infinite

        0 if finite or not a number
        1 if +INF
        -1 if -INF
        r[���r.r&)rPr;�r0r)r)r+�_isinfinity�s

zDecimal._isinfinitycCs||��}|dkrd}n|��}|s&|rx|dkr4t�}|dkrJ|�td|�S|dkr`|�td|�S|rn|�|�S|�|�SdS)z�Returns whether the number is not actually one.

        if self, other are sNaN, signal
        if self, other are NaN return nan
        return 0

        Done before operations.
        NFr^�sNaNr&)r�rrir	r=)r0�otherr1�self_is_nan�other_is_nanr)r)r+�_check_nans�s&
��

zDecimal._check_nanscCsv|dkrt�}|js|jrr|��r0|�td|�S|��rF|�td|�S|��r\|�td|�S|��rr|�td|�SdS)aCVersion of _check_nans used for the signaling comparisons
        compare_signal, __le__, __lt__, __ge__, __gt__.

        Signal InvalidOperation if either self or other is a (quiet
        or signaling) NaN.  Signaling NaNs take precedence over quiet
        NaNs.

        Return 0 if neither operand is a NaN.

        Nzcomparison involving sNaNzcomparison involving NaNr&)rrQ�is_snanrir	�is_qnan�r0r�r1r)r)r+�_compare_check_nans	s0����zDecimal._compare_check_nanscCs|jp|jdkS)zuReturn True if self is nonzero; otherwise return False.

        NaNs and infinities are considered nonzero.
        rR�rQr<r�r)r)r+�__bool__*szDecimal.__bool__cCs|js|jr8|��}|��}||kr(dS||kr4dSdS|sP|sDdSd|jS|s^d|jS|j|jkrndS|j|jkr~dS|��}|��}||kr�|jd|j|j}|jd|j|j}||kr�dS||kr�d|jSd|jSn ||k�rd|jSd|jSdS)z�Compare the two non-NaN decimal instances self and other.

        Returns -1 if self < other, 0 if self == other and 1
        if self > other.  This routine is for internal use only.r&r�r.rRN)rQr�r;�adjustedr<rP)r0r�Zself_infZ	other_inf�
self_adjustedZother_adjusted�self_paddedZother_paddedr)r)r+�_cmp1s>


zDecimal._cmpcCs<t||dd�\}}|tkr|S|�||�r.dS|�|�dkS)NT)�equality_opFr&)�_convert_for_comparison�NotImplementedr�r�r�r)r)r+�__eq__qszDecimal.__eq__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkS�NFr&�r�r�r�r��r0r�r1r?r)r)r+�__lt__yszDecimal.__lt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__le__�szDecimal.__le__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__gt__�szDecimal.__gt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__ge__�szDecimal.__ge__cCs>t|dd�}|js|r0|jr0|�||�}|r0|St|�|��S)z�Compare self to other.  Return a decimal value:

        a or b is a NaN ==> Decimal('NaN')
        a < b           ==> Decimal('-1')
        a == b          ==> Decimal('0')
        a > b           ==> Decimal('1')
        T��raiseit)�_convert_otherrQr�rr�r�r)r)r+�compare�szDecimal.comparecCs�|jr4|��rtd��n|��r$tS|jr0tStS|jdkrNtd|jt	�}ntt
|jt	�}t|j�|t	}|dkr||n|}|dkr�dS|S)zx.__hash__() <==> hash(x)z"Cannot hash a signaling NaN value.r&�
r����)
rQr�rw�is_nan�_PyHASH_NANr;�_PyHASH_INFrP�pow�_PyHASH_MODULUS�
_PyHASH_10INVrVr<)r0Zexp_hashZhash_r?r)r)r+�__hash__�s

zDecimal.__hash__cCst|jttt|j��|j�S)zeRepresents the number as a triple tuple.

        To show the internals exactly as they are.
        )rr;rprtrVr<rPr�r)r)r+�as_tuple�szDecimal.as_tuplecCs�|jr |��rtd��ntd��|s(dSt|j�}|jdkrR|d|jd}}nn|j}|dkr�|ddkr�|d}|d8}qZ|j}t||@��d|�}|r�||L}||8}d||>}|j	r�|}||fS)a�Express a finite Decimal instance in the form n / d.

        Returns a pair (n, d) of integers.  When called on an infinity
        or NaN, raises OverflowError or ValueError respectively.

        >>> Decimal('3.14').as_integer_ratio()
        (157, 50)
        >>> Decimal('-123e5').as_integer_ratio()
        (-12300000, 1)
        >>> Decimal('0.00').as_integer_ratio()
        (0, 1)

        z#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior]r&r�r.r~)
rQr�rq�
OverflowErrorrVr<rP�minr�r;)r0r9r�Zd5Zd2Zshift2r)r)r+r��s,



zDecimal.as_integer_ratiocCsdt|�S)z0Represents the number as an instance of Decimal.z
Decimal('%s'))rer�r)r)r+�__repr__szDecimal.__repr__Fc	Csbddg|j}|jrL|jdkr&|dS|jdkr>|d|jS|d|jS|jt|j�}|jdkrt|d	krt|}n6|s~d
}n,|jdkr�|d
dd
}n|d
dd
}|dkr�d}d
d||j}nL|t|j�kr�|jd|t|j�}d}n |jd|�}d
|j|d�}||k�r(d}n*|dk�r8t�}ddg|jd||}||||S)z�Return string representation of the number in scientific notation.

        Captures all of the information in the underlying representation.
        rTrUr[ZInfinityr9�NaNr�r&���r.rRr\�.N�e�Ez%+d)r;rQrPr<rkr�capitals)	r0�engr1rC�
leftdigits�dotplacer{r|rWr)r)r+�__str__s:




zDecimal.__str__cCs|jd|d�S)a,Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.
        T)r�r1)r��r0r1r)r)r+�
to_eng_string;szDecimal.to_eng_stringcCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}n|��}|�|�S)zRReturns a copy with the sign switched.

        Rounds, if it has reason.
        rLN)rQr�rrEr�copy_abs�copy_negate�_fix�r0r1r?r)r)r+�__neg__Ds
zDecimal.__neg__cCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}nt|�}|�|�S)zhReturns a copy, unless it is a sNaN.

        Rounds the number (if more than precision digits)
        rLN)rQr�rrErr�rr�r�r)r)r+�__pos__Zs
zDecimal.__pos__TcCsJ|s|��S|jr&|j|d�}|r&|S|jr:|j|d�}n|j|d�}|S)z�Returns the absolute value of self.

        If the keyword argument 'round' is false, do not round.  The
        expression self.__abs__(round=False) is equivalent to
        self.copy_abs().
        rL)r�rQr�r;r�r�)r0�roundr1r?r)r)r+�__abs__oszDecimal.__abs__c
Csht|�}|tkr|S|dkr"t�}|js.|jr�|�||�}|rB|S|��rr|j|jkrj|��rj|�td�St	|�S|��r�t	|�St
|j|j�}d}|jt
kr�|j|jkr�d}|s�|s�t
|j|j�}|r�d}t|d|�}|�|�}|S|�st||j|jd�}|�||j�}|�|�}|S|�sVt||j|jd�}|�||j�}|�|�}|St|�}t|�}t|||j�\}}t�}	|j|jk�r�|j|jk�r�t|d|�}|�|�}|S|j|jk�r�||}}|jdk�r�d|	_|j|j|_|_nd|	_n&|jdk�rd|	_d\|_|_nd|	_|jdk�r<|j|j|	_n|j|j|	_|j|	_t	|	�}|�|�}|S)zbReturns self + other.

        -INF + INF (or the reverse) cause InvalidOperation errors.
        Nz
-INF + INFr&r.rR)r&r&)r�r�rrQr�r�r;rir	rr�rPrErr:r��maxrF�_rescalern�
_normalizerCrVrW)
r0r�r1r?rWZnegativezerorC�op1�op2r�r)r)r+�__add__�s|





zDecimal.__add__cCsHt|�}|tkr|S|js |jr6|j||d�}|r6|S|j|��|d�S)zReturn self - otherrL)r�r�rQr�r�r�r�r)r)r+�__sub__�szDecimal.__sub__cCs"t|�}|tkr|S|j||d�S)zReturn other - selfrL)r�r�r�r�r)r)r+�__rsub__�szDecimal.__rsub__cCs@t|�}|tkr|S|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rn|sf|�td�St	|S|��r�|s�|�td�St	|S|j
|j
}|r�|s�t|d|�}|�|�}|S|j
dkr�t||j
|�}|�|�}|S|j
dk�r
t||j
|�}|�|�}|St|�}t|�}t|t|j|j�|�}|�|�}|S)z\Return self * other.

        (+-) INF * 0 (or its reverse) raise InvalidOperation.
        Nz(+-)INF * 0z0 * (+-)INFrR�1)r�r�rr;rQr�r�rir	rArPr:r�r<rnrerV)r0r�r1Z
resultsignr?Z	resultexpr�r�r)r)r+�__mul__�sH




zDecimal.__mul__cCs�t|�}|tkrtS|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rj|��rj|�td�S|��rzt	|S|��r�|�t
d�t|d|���S|s�|s�|�t
d�S|�td|�S|s�|j|j}d}n�t|j�t|j�|jd}|j|j|}t|�}t|�}	|dk�r:t|jd	||	j�\}}
nt|j|	jd	|�\}}
|
�rt|d
dk�r�|d7}n8|j|j}||k�r�|d	dk�r�|d	}|d7}�q�t|t|�|�}|�|�S)zReturn self / other.Nz(+-)INF/(+-)INFzDivision by infinityrRz0 / 0zx / 0r&r.r�r~)r�r�rr;rQr�r�rir	rArr:�Etinyrr
rPrkr<rFrn�divmodrVrer�)r0r�r1rCr?rWr��shiftr�r��	remainder�	ideal_expr)r)r+�__truediv__,sP

zDecimal.__truediv__cCs|j|jA}|��r|j}nt|j|j�}|��|��}|rN|��sN|dkrht|dd�|�||j�fS||jk�r
t	|�}t	|�}|j
|j
kr�|jd|j
|j
9_n|jd|j
|j
9_t|j|j�\}}	|d|jk�r
t|t
|�d�t|jt
|	�|�fS|�td�}
|
|
fS)z�Return (self // other, self % other), to context.prec precision.

        Assumes that neither self nor other is a NaN, that self is not
        infinite and that other is nonzero.
        r�rRr&r�z%quotient too large in //, % or divmod)r;r�rPr�r�r:r�rErFrnrWrVr�rerir)r0r�r1rCr��expdiffr�r��q�rr?r)r)r+�_dividegs0
���zDecimal._dividecCs"t|�}|tkr|S|j||d�S)z)Swaps self/other and returns __truediv__.rL)r�r�r�r�r)r)r+�__rtruediv__�szDecimal.__rtruediv__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r:||fS|j|jA}|��r~|��rj|�td�}||fSt||�td�fS|s�|s�|�t	d�}||fS|�t
d|�|�td�fS|�||�\}}|�|�}||fS)z6
        Return (self // other, self % other)
        Nzdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
r�r�rr�r;r�rir	rArr
r�r�)r0r�r1r?rCZquotientr�r)r)r+�
__divmod__�s4
�
�
zDecimal.__divmod__cCs"t|�}|tkr|S|j||d�S)z(Swaps self/other and returns __divmod__.rL)r�r�r�r�r)r)r+�__rdivmod__�szDecimal.__rdivmod__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rJ|�td�S|sj|r^|�td�S|�td�S|�||�d}|�	|�}|S)z
        self % other
        Nr�r�z0 % 0r.)
r�r�rr�r�rir	rr�r�)r0r�r1r?r�r)r)r+�__mod__�s"
zDecimal.__mod__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __mod__.rL)r�r�r�r�r)r)r+�__rmod__�szDecimal.__rmod__cCs�|dkrt�}t|dd�}|�||�}|r.|S|��rB|�td�S|sb|rV|�td�S|�td�S|��r|t|�}|�|�St	|j
|j
�}|s�t|jd|�}|�|�S|�
�|�
�}||jdkr�|�t�S|d	kr�|�||j�}|�|�St|�}t|�}|j|jk�r(|jd
|j|j9_n|jd
|j|j9_t|j|j�\}}	d|	|d@|jk�r~|	|j8}	|d7}|d
|jk�r�|�t�S|j}
|	dk�r�d|
}
|	}	t|
t|	�|�}|�|�S)
zI
        Remainder nearest to 0-  abs(remainder-near) <= other/2
        NTr�zremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)rRr.r�r�r^r&)rr�r�r�rir	rrr�r�rPr:r;r�rFrr�rErnrWrVr�re)r0r�r1r?�ideal_exponentr�r�r�r�r�rCr)r)r+�remainder_near�s`���






zDecimal.remainder_nearcCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rb|��rR|�td�St|j|jAS|s�|r�|�t	d|j|jA�S|�t
d�S|�||�dS)z
self // otherNz
INF // INFr�z0 // 0r&)r�r�rr�r�rir	rAr;r
rr�r�r)r)r+�__floordiv__'s&
�zDecimal.__floordiv__cCs"t|�}|tkr|S|j||d�S)z*Swaps self/other and returns __floordiv__.rL)r�r�r�r�r)r)r+�
__rfloordiv__CszDecimal.__rfloordiv__cCs8|��r(|��rtd��|jr"dnd}nt|�}t|�S)zFloat representation.z%Cannot convert signaling NaN to floatz-nan�nan)r�r�rqr;reru�r0�sr)r)r+�	__float__JszDecimal.__float__cCst|jr(|��rtd��n|��r(td��d|j}|jdkrT|t|j�d|jS|t|jd|j�pjd�SdS)z1Converts self to an int, truncating if necessary.zCannot convert NaN to integerz"Cannot convert infinity to integerr�r&r�NrR)	rQr�rqr�r�r;rPrVr<r�r)r)r+�__int__Ts


zDecimal.__int__cCs|Sr(r)r�r)r)r+�realcszDecimal.realcCstd�S)Nr&�rr�r)r)r+�imaggszDecimal.imagcCs|Sr(r)r�r)r)r+�	conjugatekszDecimal.conjugatecCstt|��Sr()�complexrur�r)r)r+�__complex__nszDecimal.__complex__cCsR|j}|j|j}t|�|krJ|t|�|d��d�}t|j||jd�St|�S)z2Decapitate the payload of a NaN to fit the contextNrRT)	r<rF�clamprkrlr:r;rPr)r0r1ZpayloadZmax_payload_lenr)r)r+r=qszDecimal._fix_nancCsX|jr |��r|�|�St|�S|��}|��}|s�|j|g|j}tt	|j
|�|�}||j
krx|�t�t
|jd|�St|�St|j�|j
|j}||kr�|�td|j�}|�t�|�t�|S||k}|r�|}|j
|k�r�t|j�|j
|}	|	dk�rt
|jd|d�}d}	|j|j}
|
||	�}|jd|	��p>d}|dk�r~tt|�d�}t|�|jk�r~|dd�}|d7}||k�r�|�td|j�}nt
|j||�}|�r�|�r�|�t�|�r�|�t�|�r�|�t�|�t�|�s�|�t�|S|�r|�t�|jdk�rP|j
|k�rP|�t�|jd|j
|}
t
|j|
|�St|�S)z�Round if it is necessary to keep self within prec precision.

        Rounds and fixes the exponent.  Does not raise on a sNaN.

        Arguments:
        self - Decimal instance
        context - context used.
        rR�
above Emaxr&r�r.Nr�)rQr�r=rr��EtoprGr�r�r�rPrirr:r;rkr<rFrrr�_pick_rounding_functionrErerVrr
)r0r1r�r��exp_maxZnew_expZexp_minr?Zself_is_subnormalr}Zrounding_method�changedr�r�r)r)r+r�}sn
















zDecimal._fixcCst|j|�rdSdSdS)z(Also known as round-towards-0, truncate.r&r�N)�
_all_zerosr<�r0rFr)r)r+�_round_down�szDecimal._round_downcCs|�|�S)zRounds away from 0.)r�r�r)r)r+�	_round_up�szDecimal._round_upcCs*|j|dkrdSt|j|�r"dSdSdS)zRounds 5 up (away from 0)Z56789r.r&r�N)r<r�r�r)r)r+�_round_half_up�s
zDecimal._round_half_upcCst|j|�rdS|�|�SdS)zRound 5 downr�N��_exact_halfr<rr�r)r)r+�_round_half_down�szDecimal._round_half_downcCs8t|j|�r*|dks&|j|ddkr*dS|�|�SdS)z!Round 5 to even, rest to nearest.r&r.�02468r�Nrr�r)r)r+�_round_half_even�s��zDecimal._round_half_evencCs |jr|�|�S|�|�SdS)z(Rounds up (not away from 0 if negative.)N�r;r�r�r)r)r+�_round_ceilings
zDecimal._round_ceilingcCs |js|�|�S|�|�SdS)z'Rounds down (not towards 0 if negative)Nrr�r)r)r+�_round_floor
s
zDecimal._round_floorcCs0|r |j|ddkr |�|�S|�|�SdS)z)Round down unless digit prec-1 is 0 or 5.r.Z05N)r<r�r�r)r)r+�_round_05ups
zDecimal._round_05up)rrrrrrrrcCsb|dk	r2t|t�std��tdd|�}|�|�S|jrR|��rJtd��ntd��t|�	dt
��S)a�Round self to the nearest integer, or to a given precision.

        If only one argument is supplied, round a finite Decimal
        instance self to the nearest integer.  If self is infinite or
        a NaN then a Python exception is raised.  If self is finite
        and lies exactly halfway between two integers then it is
        rounded to the integer with even last digit.

        >>> round(Decimal('123.456'))
        123
        >>> round(Decimal('-456.789'))
        -457
        >>> round(Decimal('-3.0'))
        -3
        >>> round(Decimal('2.5'))
        2
        >>> round(Decimal('3.5'))
        4
        >>> round(Decimal('Inf'))
        Traceback (most recent call last):
          ...
        OverflowError: cannot round an infinity
        >>> round(Decimal('NaN'))
        Traceback (most recent call last):
          ...
        ValueError: cannot round a NaN

        If a second argument n is supplied, self is rounded to n
        decimal places using the rounding mode for the current
        context.

        For an integer n, round(self, -n) is exactly equivalent to
        self.quantize(Decimal('1En')).

        >>> round(Decimal('123.456'), 0)
        Decimal('123')
        >>> round(Decimal('123.456'), 2)
        Decimal('123.46')
        >>> round(Decimal('123.456'), -2)
        Decimal('1E+2')
        >>> round(Decimal('-Infinity'), 37)
        Decimal('NaN')
        >>> round(Decimal('sNaN123'), 0)
        Decimal('NaN123')

        Nz+Second argument to round should be integralr&r��cannot round a NaN�cannot round an infinity)rdrVrwr:�quantizerQr�rqr�r�r)r0r9rWr)r)r+�	__round__&s/


zDecimal.__round__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the floor of self, as an integer.

        For a finite Decimal instance self, return the greatest
        integer n such that n <= self.  If self is infinite or a NaN
        then a Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�	__floor__ds

zDecimal.__floor__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the ceiling of self, as an integer.

        For a finite Decimal instance self, return the least integer n
        such that n >= self.  If self is infinite or a NaN then a
        Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�__ceil__ss

zDecimal.__ceil__cCst|dd�}t|dd�}|js$|jr�|dkr2t�}|jdkrJ|�td|�S|jdkrb|�td|�S|jdkrr|}nf|jdkr�|}nV|jdkr�|s�|�td�St|j|jA}n*|jdkr�|s�|�td	�St|j|jA}n0t|j|jAt	t
|j�t
|j��|j|j�}|�||�S)
a:Fused multiply-add.

        Returns self*other+third with no rounding of the intermediate
        product self*other.

        self and other are multiplied together, with no rounding of
        the result.  The third operand is then added to the result,
        and a single final rounding is performed.
        Tr�NrZr�r9r[zINF * 0 in fmaz0 * INF in fma)
r�rQrrPrir	rAr;r:rerVr<r�)r0r�Zthirdr1�productr)r)r+�fma�s<




�
�
�zDecimal.fmacCs�t|�}|tkr|St|�}|tkr(|S|dkr6t�}|��}|��}|��}|sZ|sZ|r�|dkrp|�td|�S|dkr�|�td|�S|dkr�|�td|�S|r�|�|�S|r�|�|�S|�|�S|��r�|��r�|��s�|�td�S|dkr�|�td�S|�s|�td�S|��|j	k�r(|�td�S|�s@|�s@|�td	�S|�
��rPd}n|j}tt
|��}t|���}t|���}	|j
|td
|j|�|}t|	j�D]}
t|d
|�}�q�t||	j
|�}t|t|�d�S)z!Three argument version of __pow__Nr^r�z@pow() 3rd argument not allowed unless all arguments are integersr&zApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not definedr�)r�r�rr�rir	r=�
_isintegerr�rF�_isevenr;rmrVrn�to_integral_valuer�rW�ranger:re)r0r��modulor1r�r�Z
modulo_is_nanrC�base�exponent�ir)r)r+�
_power_modulo�s����


�������
zDecimal._power_modulocCs�t|�}|j|j}}|ddkr4|d}|d7}qt|�}|j|j}}|ddkrh|d}|d7}qJ|dk�r||9}|ddkr�|d}|d7}qz|dkr�dS|d|}	|jdkr�|	}	|��r�|jdkr�|jt|�}
t|	|
|d�}nd}tddd||	|�S|jdk�r�|d}|dk�r�||@|k�rBdSt	|�d}
|dd	}|t
t|��k�rpdSt|
||�}
t|||�}|
dk�s�|dk�r�dS|
|k�r�dSd
|
}n�|d
k�r�t	|�dd	}
t
d
|
|�\}}|�r�dS|d
dk�r|d
}|
d8}
�q�|dd}|t
t|��k�r6dSt|
||�}
t|||�}|
dk�sf|dk�rjdS|
|k�rxdSd
|
}ndS|d|k�r�dS|
|}tdt|�|�S|dk�r�|d|d}}n�|dk�r�t
tt||���|k�r�dSt	|�}|dk�r,t
tt|�|��|k�r,dS|d|}}|d
|d
k�r\dk�rtnn|d
}|d
}�q<|d
|d
k�r�dk�r�nn|d
}|d
}�qt|dk�rX|dk�r�||k�r�dSt
||�\}}|dk�r�dSdt	|�|>}t
|||d�\}}||k�r$�q<n||d||}�q�||k�rP|dk�sTdS|}|dk�r|||dt|�k�r|dS||}||9}|d|k�r�dSt|�}|���r�|jdk�r�|jt|�}
t||
|t
|��}nd}td|d|||�S)ahAttempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
        digits of precision.  Return None if self**other is not
        exactly representable in p digits.

        Assumes that elimination of special cases has already been
        performed: self and other must both be nonspecial; self must
        be positive and not numerically equal to 1; other must be
        nonzero.  For efficiency, other._exp should not be too large,
        so that 10**abs(other._exp) is a feasible calculation.r�r&r.Nr�rR)r^����]�Ar~�r\r^�d)rnrVrWrCrr;rPr�r:�_nbitsrkre�_decimal_lshift_exactr�rm�	_log10_lb)r0r��p�x�xc�xe�y�yc�yerr�ZzerosZ
last_digitr�Zemaxr�rzr9Zxc_bits�rem�ar�r�Zstr_xcr)r)r+�_power_exacts�:












&&$$


 zDecimal._power_exactcCs4|dk	r|�|||�St|�}|tkr*|S|dkr8t�}|�||�}|rL|S|sd|s`|�td�StSd}|jdkr�|�	�r�|�
�s�d}n|r�|�td�S|��}|s�|jdkr�t|dd�St
|S|��r�|jdkr�t
|St|dd�S|tk�r�|�	��rZ|jdk�rd}n||jk�r"|j}nt|�}|j|}|d|jk�rxd|j}|�t�n|�t�|�t�d|j}t|dd||�S|��}|���r�|jdk|dkk�r�t|dd�St
|Sd}d}	|��|��}
|dk|jdkk�r|
tt|j��k�rHt|d|jd�}n,|��}|
tt|��k�rHt|d|d�}|dk�r�|�||jd�}|dk	�r�|dk�r�td|j|j�}d	}	|dk�r8|j}t|�}
|
j|
j}}t|�}|j|j}}|jdk�r�|}d
}t||||||�\}}|ddtt|��|d�r�q(|d
7}�q�t|t|�|�}|	�r&|�	��s&t|j�|jk�r�|jdt|j�}t|j|jd||j|�}|� �}|�!�t"D]}d|j#|<�q�|�$|�}|�t�|j%t&�r�|�t'�|j%t(�r�|�t(d
|j�t't&ttt)fD]}|j%|�r|�|��qn
|�$|�}|S)aHReturn self ** other [ % modulo].

        With two arguments, compute self**other.

        With three arguments, compute (self**other) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - other must be nonnegative
         - either self or other (or both) must be nonzero
         - modulo must be nonzero and must have at most p digits,
           where p is the context precision.

        If any of these restrictions is violated the InvalidOperation
        flag is raised.

        The result of pow(self, other, modulo) is identical to the
        result that would be obtained by computing (self**other) %
        modulo with unbounded precision, but is computed more
        efficiently.  It is always exact.
        Nz0 ** 0r&r.z+x ** y with x negative and y not an integerrRr�FTr\r~r�r�)*rr�r�rr�rir	�_Oner;rrr�r:rAr�rFrVrPrrr��_log10_exp_boundrkrerGr�r.r<rnrWrC�_dpowerrMrN�_signals�trapsr��flagsr
rrr)r0r�rr1r?Zresult_signZ
multiplierrWZself_adj�exactZboundr�r%r&r'r(r)r*r+�extrar�r�Z
newcontextZ	exceptionr)r)r+�__pow__�s�
�













"�



zDecimal.__pow__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __pow__.rL)r�r�r7r�r)r)r+�__rpow__�	szDecimal.__rpow__cCs�|dkrt�}|jr(|j|d�}|r(|S|�|�}|��r>|S|sPt|jdd�S|j|��g|j	}t
|j�}|j}|j|ddkr�||kr�|d7}|d8}qtt|j|jd|�|�S)z?Normalize- strip trailing 0s, change anything equal to 0 to 0e0NrLrRr&r.)
rrQr�r�r�r:r;rGr�r�rkr<rP)r0r1r?�dupr��endrWr)r)r+�	normalize�	s$


zDecimal.normalizecCs�t|dd�}|dkrt�}|dkr(|j}|js4|jr||�||�}|rH|S|��sX|��r||��rp|��rpt|�S|�td�S|�	�|j
kr�|jks�n|�td�S|s�t|j
d|j
�}|�|�S|��}||jkr�|�td�S||j
d|jk�r|�td	�S|�|j
|�}|��|jk�r.|�td�St|j�|jk�rL|�td	�S|�rl|��|jk�rl|�t�|j
|j
k�r�||k�r�|�t�|�t�|�|�}|S)
z�Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        Tr�Nzquantize with one INFz)target exponent out of bounds in quantizerRz9exponent of quantize result too large for current contextr.z7quantize result has too many digits for current context)r�rrErQr�r�rrir	r�rPrGr:r;r�r�rFr�rkr<�Eminr
rr)r0rWrEr1r?r�r)r)r+r�	s`��

����




zDecimal.quantizecCsDt|dd�}|js|jr8|��r(|��p6|��o6|��S|j|jkS)a=Return True if self and other have the same exponent; otherwise
        return False.

        If either operand is a special value, the following rules are used:
           * return True if both operands are infinities
           * return True if both operands are NaNs
           * otherwise, return False.
        Tr�)r�rQr��is_infiniterPr�r)r)r+�same_quantum%
s	�zDecimal.same_quantumcCs�|jrt|�S|s t|jd|�S|j|krHt|j|jd|j||�St|j�|j|}|dkrzt|jd|d�}d}|j|}|||�}|jd|�p�d}|dkr�tt	|�d�}t|j||�S)asRescale self so that the exponent is exp, either by padding with zeros
        or by truncating digits, using the given rounding mode.

        Specials are returned without change.  This operation is
        quiet: it raises no flags, and uses no information from the
        context.

        exp = exp to scale to (an integer)
        rounding = rounding mode
        rRr&r�r.N)
rQrr:r;rPr<rkr�rerV)r0rWrEr}Z
this_functionr�r�r)r)r+r�4
s&
�

zDecimal._rescalecCsf|dkrtd��|js|s"t|�S|�|��d||�}|��|��krb|�|��d||�}|S)a"Round a nonzero, nonspecial Decimal to a fixed number of
        significant figures, using the given rounding mode.

        Infinities, NaNs and zeros are returned unaltered.

        This operation is quiet: it raises no flags, and uses no
        information from the context.

        r&z'argument should be at least 1 in _roundr.)rqrQrr�r�)r0�placesrEr?r)r)r+�_roundV
s

zDecimal._roundcCs�|jr"|j|d�}|r|St|�S|jdkr4t|�S|sFt|jdd�S|dkrTt�}|dkrb|j}|�d|�}||kr�|�	t
�|�	t�|S)aVRounds to a nearby integer.

        If no rounding mode is specified, take the rounding mode from
        the context.  This method raises the Rounded and Inexact flags
        when appropriate.

        See also: to_integral_value, which does exactly the same as
        this method except that it doesn't raise Inexact or Rounded.
        rLr&rRN)rQr�rrPr:r;rrEr�rirr�r0rEr1r?r)r)r+�to_integral_exactm
s$



zDecimal.to_integral_exactcCs`|dkrt�}|dkr|j}|jr>|j|d�}|r6|St|�S|jdkrPt|�S|�d|�SdS)z@Rounds to the nearest integer, without raising inexact, rounded.NrLr&)rrErQr�rrPr�rAr)r)r+r�
s
zDecimal.to_integral_valuecCs�|dkrt�}|jrB|j|d�}|r(|S|��rB|jdkrBt|�S|sdt|jd|jd�}|�|�S|jdkrz|�	t
d�S|jd}t|�}|j
d?}|j
d@r�|jd}t|j�d?d}n|j}t|j�dd?}||}|dkr�|d	|9}d
}	nt|d	|�\}}
|
}	||8}d|}||}||k�r:�qJn||d?}�q"|	�oZ|||k}	|	�r�|dk�rz|d|}n|d|9}||7}n|ddk�r�|d7}tdt|�|�}|��}|�t�}
|�|�}|
|_|S)zReturn the square root of self.NrLr&rRr^r.zsqrt(-x), x > 0r�r!Tr~)rrQr�r�r;rr:rPr�rir	rFrnrWrVrkr<r�re�
_shallow_copy�
_set_roundingrrE)r0r1r?rF�opr��c�lr�r5r�r9r�rEr)r)r+�sqrt�
s^










zDecimal.sqrtcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the larger value.

        Like max(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r��r�rrQr�r�r�r��
compare_total�r0r�r1ZsnZonrFr?r)r)r+r�s&


	
zDecimal.maxcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the smaller value.

        Like min(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r�rIrKr)r)r+r�*s&



zDecimal.mincCs8|jr
dS|jdkrdS|j|jd�}|dt|�kS)z"Returns whether self is an integerFr&TNrR)rQrPr<rk)r0�restr)r)r+rLs
zDecimal._isintegercCs&|r|jdkrdS|jd|jdkS)z:Returns True if self is even.  Assumes self is an integer.r&Tr�r)rPr<r�r)r)r+rUszDecimal._isevencCs2z|jt|j�dWStk
r,YdSXdS)z$Return the adjusted exponent of selfr.r&N)rPrkr<rwr�r)r)r+r�[szDecimal.adjustedcCs|S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.
        r)r�r)r)r+�	canonicalcszDecimal.canonicalcCs.t|dd�}|�||�}|r |S|j||d�S)z�Compares self to the other operand numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.
        Tr�rL)r�r�r�r�r)r)r+�compare_signalks
zDecimal.compare_signalcCs`t|dd�}|jr|jstS|js,|jr,tS|j}|��}|��}|sL|�r||kr�t|j�|jf}t|j�|jf}||kr�|r�tStS||kr�|r�tStStS|r�|dkr�tS|dkr�tS|dkr�tS|dkr�tSn2|dkr�tS|dkr�tS|dkr�tS|dk�rtS||k�rtS||k�r$tS|j|jk�r@|�r<tStS|j|jk�r\|�rXtStStS)z�Compares self to other using the abstract representations.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.
        Tr�r.r^)	r�r;�_NegativeOner/r�rkr<�_ZerorP)r0r�r1rCZself_nanZ	other_nanZself_keyZ	other_keyr)r)r+rJwsf



zDecimal.compare_totalcCs&t|dd�}|��}|��}|�|�S)z�Compares self to other using abstract repr., ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�r�rJ)r0r�r1r��or)r)r+�compare_total_mag�szDecimal.compare_total_magcCstd|j|j|j�S)z'Returns a copy with the sign set to 0. r&)r:r<rPrQr�r)r)r+r��szDecimal.copy_abscCs2|jrtd|j|j|j�Std|j|j|j�SdS)z&Returns a copy with the sign inverted.r&r.N)r;r:r<rPrQr�r)r)r+r��szDecimal.copy_negatecCs"t|dd�}t|j|j|j|j�S)z$Returns self with the sign of other.Tr�)r�r:r;r<rPrQr�r)r)r+�	copy_sign�s

�zDecimal.copy_signcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|s:tS|��dkrNt|�S|j}|��}|jdkr�|t	t
|jdd��kr�tdd|jd�}�n0|jdkr�|t	t
|�
�dd��kr�tdd|�
�d�}n�|jdk�r||k�rtddd|dd|�}n�|jdk�rD||dk�rDtdd	|d|d�}n�t|�}|j|j}}|jdk�rl|}d}t||||�\}	}
|	d
dt	t
|	��|d�r��q�|d7}�qptdt
|	�|
�}|��}|�t�}|�|�}||_|S)zReturns e ** self.NrLr�r.r&r\r�rRrDr~r�)rr�r�rPr/rrFr�r;rkrerGr:r�rnrVrWrC�_dexprCrDrr�rE)r0r1r?r%�adjrErFr�r6r�rWrEr)r)r+rW�sH$( "

zDecimal.expcCsdS)z�Return True if self is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.
        Tr)r�r)r)r+�is_canonical'szDecimal.is_canonicalcCs|jS)z�Return True if self is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.
        )rQr�r)r)r+�	is_finite/szDecimal.is_finitecCs
|jdkS)z8Return True if self is infinite; otherwise return False.r[�rPr�r)r)r+r=7szDecimal.is_infinitecCs
|jdkS)z>Return True if self is a qNaN or sNaN; otherwise return False.r`rXr�r)r)r+r�;szDecimal.is_nancCs*|js
|sdS|dkrt�}|j|��kS)z?Return True if self is a normal number; otherwise return False.FN)rQrr<r�r�r)r)r+�	is_normal?s

zDecimal.is_normalcCs
|jdkS)z;Return True if self is a quiet NaN; otherwise return False.r9rXr�r)r)r+r�GszDecimal.is_qnancCs
|jdkS)z8Return True if self is negative; otherwise return False.r.)r;r�r)r)r+�	is_signedKszDecimal.is_signedcCs
|jdkS)z?Return True if self is a signaling NaN; otherwise return False.rZrXr�r)r)r+r�OszDecimal.is_snancCs*|js
|sdS|dkrt�}|��|jkS)z9Return True if self is subnormal; otherwise return False.FN)rQrr�r<r�r)r)r+�is_subnormalSs

zDecimal.is_subnormalcCs|jo|jdkS)z6Return True if self is a zero; otherwise return False.rRr�r�r)r)r+�is_zero[szDecimal.is_zerocCs�|jt|j�d}|dkr4tt|dd��dS|dkrXttd|dd��dSt|�}|j|j}}|dkr�t|d|�}t|�}t|�t|�||kS|ttd||��dS)z�Compute a lower bound for the adjusted exponent of self.ln().
        In other words, compute r such that self.ln() >= 10**r.  Assumes
        that self is finite and positive and that self != 1.
        r.�r�r�r�r&�rPrkr<rernrVrW�r0rUrErFr��numZdenr)r)r+�
_ln_exp_bound_szDecimal._ln_exp_boundc
Cs|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|tkrFtS|jdkr\|�t	d�St
|�}|j|j}}|j
}||��d}t|||�}|ddttt|���|dr�q�|d7}q�tt|d	k�tt|��|�}|��}|�t�}	|�|�}|	|_|S)
z/Returns the natural (base e) logarithm of self.NrLr.zln of a negative valuer^r~r�r\r&)rr��_NegativeInfinityr��	_Infinityr/rPr;rir	rnrVrWrFra�_dlogrkrermr:rCrDrr�rE�
r0r1r?rErFr�r%r?r�rEr)r)r+�lnxs:
�$


z
Decimal.lncCs�|jt|j�d}|dkr,tt|��dS|dkrHttd|��dSt|�}|j|j}}|dkr�t|d|�}td|�}t|�t|�||kdStd||�}t|�||dkdS)	z�Compute a lower bound for the adjusted exponent of self.log10().
        In other words, find r such that self.log10() >= 10**r.
        Assumes that self is finite and positive and that self != 1.
        r.r�r�r&r���r^Z231r^r_r)r)r+r0�szDecimal._log10_exp_boundc
CsF|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|jdkrP|�td�S|jddkr�|jdd�dt	|j�dkr�t
|jt	|j�d�}n�t|�}|j
|j}}|j}||��d}t|||�}|d	d
t	tt|���|dr��q|d7}q�tt
|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)z&Returns the base 10 logarithm of self.NrLr.zlog10 of a negative valuer&r�rRr^r~r�r\)rr�rbr�rcr;rir	r<rkrrPrnrVrWrFr0�_dlog10rermr:rCrDrr�rErer)r)r+�log10�s:
�.$


z
Decimal.log10cCsV|j|d�}|r|S|dkr"t�}|��r.tS|s@|�tdd�St|���}|�|�S)aM Returns the exponent of the magnitude of self's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of self (as though it were truncated
        to a single digit while maintaining the value of that digit and
        without limiting the resulting exponent).
        rLNzlogb(0)r.)	r�rr�rcrir
rr�r�r�r)r)r+�logb�s	zDecimal.logbcCs6|jdks|jdkrdS|jD]}|dkrdSqdS)z�Return True if self is a logical operand.

        For being logical, it must be a finite number with a sign of 0,
        an exponent of 0, and a coefficient whose digits must all be
        either 0 or 1.
        r&FZ01T)r;rPr<)r0�digr)r)r+�
_islogical
s
zDecimal._islogicalcCs�|jt|�}|dkr$d||}n|dkr<||jd�}|jt|�}|dkr`d||}n|dkrx||jd�}||fS)Nr&rR)rFrk)r0r1�opa�opbZdifr)r)r+�
_fill_logical'
szDecimal._fill_logicalcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'and' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�@��qSr)�rerV��.0r-�br)r)r+�
<listcomp>B
sz'Decimal.logical_and.<locals>.<listcomp>r&rR�rr�rlrir	ror<rs�zipr:rl�r0r�r1rmrnr�r)r)r+�logical_and4
s
zDecimal.logical_andcCs(|dkrt�}|�tdd|jd�|�S)zInvert all its digits.Nr&r�)r�logical_xorr:rFr�r)r)r+�logical_invertE
s
�zDecimal.logical_invertcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z:Applies an 'or' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�B��qSr)rprqr)r)r+rtZ
sz&Decimal.logical_or.<locals>.<listcomp>r&rRrurwr)r)r+�
logical_orL
s
zDecimal.logical_orcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'xor' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�A��qSr)rprqr)r)r+rtk
sz'Decimal.logical_xor.<locals>.<listcomp>r&rRrurwr)r)r+ry]
s
zDecimal.logical_xorcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�S�z8Compares the values numerically with their sign ignored.Tr�Nr.r&r��	r�rrQr�r�r�r�r�rJrKr)r)r+�max_magn
s&


zDecimal.max_magcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�Sr|r}rKr)r)r+�min_mag�
s&


zDecimal.min_magcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the largest representable number smaller than itself.NrLr�r.r&rDr�)rr�r�rbr:rFr�rMrDr�_ignore_all_flagsr�r�r��r0r1r?Znew_selfr)r)r+�
next_minus�
s$

�zDecimal.next_minuscCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the smallest representable number larger than itself.NrLr.r�rDr&r�)rr�r�rcr:rFr�rMrDrr�r�r�r�r�r)r)r+�	next_plus�
s$

�zDecimal.next_pluscCs�t|dd�}|dkrt�}|�||�}|r.|S|�|�}|dkrJ|�|�S|dkr^|�|�}n
|�|�}|��r�|�t	d|j
�|�t�|�t�nD|�
�|jkr�|�t�|�t�|�t�|�t�|s�|�t�|S)a�Returns the number closest to self, in the direction towards other.

        The result is the closest representable number to self
        (excluding self) that is in the direction towards other,
        unless both have the same value.  If the two operands are
        numerically equal, then the result is a copy of self with the
        sign set to be the same as the sign of other.
        Tr�Nr&r�z Infinite result from next_toward)r�rr�r�rSr�r�r�rirr;rrr�r<rr
r)r0r�r1r?Z
comparisonr)r)r+�next_toward�
s6	


�





zDecimal.next_towardcCs�|��rdS|��rdS|��}|dkr,dS|dkr8dS|��rN|jrJdSdS|d	kr\t�}|j|d
�rv|jrrdSdS|jr�d
SdSd	S)aReturns an indication of the class of self.

        The class is one of the following strings:
          sNaN
          NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity
        r�r�r.z	+Infinityr�z	-Infinityz-Zeroz+ZeroNrLz
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�r\r;rr[)r0r1�infr)r)r+�number_classs,zDecimal.number_classcCstd�S)z'Just returns 10, as this is Decimal, :)r�r�r�r)r)r+�radix0sz
Decimal.radixcCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}||d�|d|�}t|j
|�d�p�d|j�S)z5Returns a rotated copy of self, value-of-other times.NTr�r&rR�rr�r�rPrir	rFrVr�rr<rkr:r;rl)r0r�r1r?�torot�rotdig�topadZrotatedr)r)r+�rotate4s0

 
�zDecimal.rotatecCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�Sd|j|j}d|j|j}|t|�krz|ks�n|�t�S|�	�r�t
|�St|j|j
|jt|��}|�|�}|S)z>Returns self operand after adding the second value to its exp.NTr�r&r�r^)rr�r�rPrir	rGrFrVr�rr:r;r<r�)r0r�r1r?ZliminfZlimsupr�r)r)r+�scalebUs"



zDecimal.scalebcCs|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}|dkr�|d|�}n|d|}||jd�}t|j
|�d��p
d|j�S)z5Returns a shifted copy of self, value-of-other times.NTr�r&rRr�)r0r�r1r?r�r�r�Zshiftedr)r)r+r�ns6

 
�z
Decimal.shiftcCs|jt|�ffSr()�	__class__rer�r)r)r+�
__reduce__�szDecimal.__reduce__cCst|�tkr|S|�t|��Sr(��typerr�rer�r)r)r+�__copy__�szDecimal.__copy__cCst|�tkr|S|�t|��Sr(r�)r0Zmemor)r)r+�__deepcopy__�szDecimal.__deepcopy__cCsJ|dkrt�}t||d�}|jrXt|j|�}t|���}|ddkrL|d7}t|||�S|ddkrvddg|j|d<|ddkr�t	|j|j
|jd�}|j}|d}|dk	�r|dd	kr�|�
|d
|�}nF|ddkr�|�||�}n*|ddk�rt|j
�|k�r|�
||�}|�s@|jd
k�r@|ddk�r@|�d
|�}|jt|j
�}	|dd	k�r~|�sx|dk	�rxd
|}
nd
}
nB|ddk�r�|	}
n.|ddk�r�|jd
k�r�|	dk�r�|	}
nd
}
|
d
k�r�d}d|
|j
}nP|
t|j
�k�r|j
d|
t|j
�}d}n"|j
d|
��p d}|j
|
d�}|	|
}
t|j|||
|�S)a|Format a Decimal instance according to the given specifier.

        The specifier should be a standard format specifier, with the
        form described in PEP 3101.  Formatting types 'e', 'E', 'f',
        'F', 'g', 'G', 'n' and '%' are supported.  If the formatting
        type is omitted it defaults to 'g' or 'G', depending on the
        value of context.capitals.
        N)�_localeconvr��%�g�Gr^�	precision�eEr.zfF%ZgGr&r�rRrT)r�_parse_format_specifierrQ�_format_signr;rer��
_format_alignr�r:r<rPrEr@r�rk�_format_number)r0Z	specifierr1r��specrC�bodyrEr�r�r�r{r|rWr)r)r+�
__format__�sZ
 

zDecimal.__format__)rRN)NN)N)N)N)N)N)N)FN)N)N)N)TN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)N)N)NN)N)NN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)�r4r5r6r7�	__slots__rc�classmethodrvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__radd__r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�r=r�r�r�rrrrrr	�dictr�r
rrrrr.r7r8r;rr>r�r@rBr�to_integralrHr�r�rrr�rMrNrJrRr�r�rSrWrVrWr=r�rYr�rZr�r[r\rarfr0rirjrlrorxrzr{ryr~rr�r�r�r�r�r�r�r�r�r�r�r�r)r)r)r+rs

,
 !@

	
	
	
	
2
4
	



V7;!$K



f	�>,UnY="c*"	IK23
.*!'FcCs&t�t�}||_||_||_||_|S)z�Create a decimal instance directly, without any validation,
    normalization (e.g. removal of leading zeros) or argument
    conversion.

    This function is for *internal use only*.
    )rbrcrr;r<rPrQ)rCZcoefficientrZspecialr0r)r)r+r:�s
r:c@s(eZdZdZdd�Zdd�Zdd�ZdS)	rOz�Context manager class to support localcontext().

      Sets a copy of the supplied context in __enter__() and restores
      the previous decimal context in __exit__()
    cCs|��|_dSr()rM�new_context)r0r�r)r)r+�__init__sz_ContextManager.__init__cCst�|_t|j�|jSr()r�
saved_contextrr�r�r)r)r+�	__enter__s
z_ContextManager.__enter__cCst|j�dSr()rr�)r0�t�v�tbr)r)r+�__exit__sz_ContextManager.__exit__N)r4r5r6r7r�r�r�r)r)r)r+rOsrOc	@s�eZdZdZd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZd�dd�Zdd�Zdd�Zdd �ZdZd!d"�Zd#d$�Zd%d&�Zd�d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4dbdc�Z5ddde�Z6dfdg�Z7dhdi�Z8djdk�Z9dldm�Z:dndo�Z;dpdq�Z<drds�Z=dtdu�Z>dvdw�Z?dxdy�Z@dzd{�ZAd|d}�ZBd~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVeVZWdS)�ra�Contains the context for a Decimal instance.

    Contains:
    prec - precision (for use in rounding, division, square roots..)
    rounding - rounding type (how you round)
    traps - If traps[exception] = 1, then the exception is
                    raised when it is caused.  Otherwise, a value is
                    substituted in.
    flags  - When an exception is caused, flags[exception] is set.
             (Whether or not the trap_enabler is set)
             Should be reset by user of Decimal instance.
    Emin -   Minimum exponent
    Emax -   Maximum exponent
    capitals -      If 1, 1*10^1 is printed as 1E+1.
                    If 0, printed as 1e1
    clamp -  If 1, change exponents if too high (Default 0)
    Nc
s>zt}
Wntk
rYnX|dk	r*|n|
j|_|dk	r>|n|
j|_|dk	rR|n|
j|_|dk	rf|n|
j|_|dk	rz|n|
j|_|dk	r�|n|
j|_|	dkr�g|_n|	|_�dkr�|
j	�
�|_	n.t�t�s�t�fdd�t
�D��|_	n�|_	�dk�r
t�t
d�|_n0t�t��s4t�fdd�t
�D��|_n�|_dS)Nc3s|]}|t|�k�fVqdSr(�rV�rrr��r3r)r+�	<genexpr>Isz#Context.__init__.<locals>.<genexpr>r&c3s|]}|t|�k�fVqdSr(r�r��r4r)r+r�Ps)r�	NameErrorrFrEr<rGr�r��_ignored_flagsr3rMrdr�r2�fromkeysr4)r0rFrEr<rGr�r�r4r3r�Zdcr))r4r3r+r�0s.

zContext.__init__cCs�t|t�std|��|dkr<||kr�td||||f��nJ|dkrb||kr�td||||f��n$||ksr||kr�td||||f��t�|||�S)Nz%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)rdrVrwrqrb�__setattr__)r0�nameryZvminZvmaxr)r)r+�_set_integer_checkTs
zContext._set_integer_checkcCs`t|t�std|��|D]}|tkrtd|��qtD]}||kr8td|��q8t�|||�S)Nz%s must be a signal dictz%s is not a valid signal dict)rdr�rwr2�KeyErrorrbr�)r0r�r��keyr)r)r+�_set_signal_dictbs
zContext._set_signal_dictcCs�|dkr|�||dd�S|dkr0|�||dd�S|dkrH|�||dd�S|dkr`|�||dd�S|d	krx|�||dd�S|d
kr�|tkr�td|��t�|||�S|dks�|d
kr�|�||�S|dkr�t�|||�Std|��dS)NrFr.r�r<r�r&rGr�r�rEz%s: invalid rounding moder4r3r�z.'decimal.Context' object has no attribute '%s')r��_rounding_modesrwrbr�r��AttributeError)r0r�ryr)r)r+r�ms*�zContext.__setattr__cCstd|��dS)Nz%s cannot be deleted)r�)r0r�r)r)r+�__delattr__�szContext.__delattr__c	CsNdd�|j��D�}dd�|j��D�}|j|j|j|j|j|j|j	||ffS)NcSsg|]\}}|r|�qSr)r)�rrZsigr�r)r)r+rt�sz&Context.__reduce__.<locals>.<listcomp>cSsg|]\}}|r|�qSr)r)r�r)r)r+rt�s)
r4�itemsr3r�rFrEr<rGr�r�)r0r4r3r)r)r+r��s��zContext.__reduce__cCs|g}|�dt|��dd�|j��D�}|�dd�|�d�dd�|j��D�}|�dd�|�d�d�|�d	S)
zShow the current context.zrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dcSsg|]\}}|r|j�qSr)�r4)rrr�r�r)r)r+rt�sz$Context.__repr__.<locals>.<listcomp>zflags=[z, �]cSsg|]\}}|r|j�qSr)r�)rrr�r�r)r)r+rt�sztraps=[�))rr�varsr4r�rsr3)r0r��namesr)r)r+r��s�zContext.__repr__cCs|jD]}d|j|<qdS)zReset all flags to zeror&Nr��r0�flagr)r)r+rN�s
zContext.clear_flagscCs|jD]}d|j|<qdS)zReset all traps to zeror&Nr�r�r)r)r+�clear_traps�s
zContext.clear_trapsc
Cs.t|j|j|j|j|j|j|j|j|j	�	}|S)z!Returns a shallow copy from self.)
rrFrEr<rGr�r�r4r3r��r0Zncr)r)r+rC�s�zContext._shallow_copyc
Cs6t|j|j|j|j|j|j|j��|j	��|j
�	}|S)zReturns a deep copy from self.)rrFrEr<rGr�r�r4rMr3r�r�r)r)r+rM�s�zContext.copycGsZt�||�}||jkr(|�j|f|��Sd|j|<|j|sN|�j|f|��S||��dS)a#Handles an error

        If the flag is in _ignored_flags, returns the default response.
        Otherwise, it sets the flag, then, if the corresponding
        trap_enabler is set, it reraises the exception.  Otherwise, it returns
        the default value after setting the flag.
        r.N)�_condition_maprIr�r2r4r3)r0Z	conditionZexplanationr*�errorr)r)r+ri�s


zContext._raise_errorcCs
|jt�S)z$Ignore all flags, if they are raised)�
_ignore_flagsr2r�r)r)r+r��szContext._ignore_all_flagscGs|jt|�|_t|�S)z$Ignore the flags, if they are raised)r�ro)r0r4r)r)r+r��szContext._ignore_flagscGs8|rt|dttf�r|d}|D]}|j�|�q"dS)z+Stop ignoring the flags, if they are raisedr&N)rdrpror��remove)r0r4r�r)r)r+�
_regard_flags�szContext._regard_flagscCst|j|jd�S)z!Returns Etiny (= Emin - prec + 1)r.)rVr<rFr�r)r)r+r��sz
Context.EtinycCst|j|jd�S)z,Returns maximum exponent (= Emax - prec + 1)r.)rVrGrFr�r)r)r+r��szContext.EtopcCs|j}||_|S)a�Sets the rounding type.

        Sets the rounding type, and returns the current (previous)
        rounding type.  Often used like:

        context = context.copy()
        # so you don't change the calling context
        # if an error occurs in the middle.
        rounding = context._set_rounding(ROUND_UP)
        val = self.__sub__(other, context=context)
        context._set_rounding(rounding)

        This will make it round up for that operation.
        )rE)r0r�rEr)r)r+rD�szContext._set_roundingrRcCsjt|t�r*||��ksd|kr*|�td�St||d�}|��r`t|j�|j	|j
kr`|�td�S|�|�S)z�Creates a new Decimal instance but using self as context.

        This method implements the to-number operation of the
        IBM Decimal specification.rSzAtrailing or leading whitespace and underscores are not permitted.rLzdiagnostic info too long in NaN)rdrergrirrr�rkr<rFr�r�)r0r`r�r)r)r+�create_decimal�s��zContext.create_decimalcCst�|�}|�|�S)a�Creates a new Decimal instance from a float but rounding using self
        as the context.

        >>> context = Context(prec=5, rounding=ROUND_DOWN)
        >>> context.create_decimal_from_float(3.1415926535897932)
        Decimal('3.1415')
        >>> context = Context(prec=5, traps=[Inexact])
        >>> context.create_decimal_from_float(3.1415926535897932)
        Traceback (most recent call last):
            ...
        decimal.Inexact: None

        )rrvr�)r0r�r�r)r)r+�create_decimal_from_floats
z!Context.create_decimal_from_floatcCst|dd�}|j|d�S)a[Returns the absolute value of the operand.

        If the operand is negative, the result is the same as using the minus
        operation on the operand.  Otherwise, the result is the same as using
        the plus operation on the operand.

        >>> ExtendedContext.abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.abs(Decimal('101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(-1)
        Decimal('1')
        Tr�rL)r�r��r0r-r)r)r+rm!szContext.abscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return the sum of the two operands.

        >>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
        Decimal('19.00')
        >>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
        Decimal('1.02E+4')
        >>> ExtendedContext.add(1, Decimal(2))
        Decimal('3')
        >>> ExtendedContext.add(Decimal(8), 5)
        Decimal('13')
        >>> ExtendedContext.add(5, 5)
        Decimal('10')
        Tr�rL�Unable to convert %s to DecimalN)r�r�r�rw�r0r-rsr�r)r)r+�add6s
zContext.addcCst|�|��Sr()rer�r�r)r)r+�_applyKszContext._applycCst|t�std��|��S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.

        >>> ExtendedContext.canonical(Decimal('2.50'))
        Decimal('2.50')
        z,canonical requires a Decimal as an argument.)rdrrwrMr�r)r)r+rMNs	
zContext.canonicalcCst|dd�}|j||d�S)a�Compares values numerically.

        If the signs of the operands differ, a value representing each operand
        ('-1' if the operand is less than zero, '0' if the operand is zero or
        negative zero, or '1' if the operand is greater than zero) is used in
        place of that operand for the comparison instead of the actual
        operand.

        The comparison is then effected by subtracting the second operand from
        the first and then returning a value according to the result of the
        subtraction: '-1' if the result is less than zero, '0' if the result is
        zero or negative zero, or '1' if the result is greater than zero.

        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('3'), Decimal('2.1'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
        Decimal('-1')
        >>> ExtendedContext.compare(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare(1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�r��r0r-rsr)r)r+r�[s!zContext.comparecCst|dd�}|j||d�S)aCompares the values of the two operands numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.

        >>> c = ExtendedContext
        >>> c.compare_signal(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.compare_signal(-1, 2)
        Decimal('-1')
        >>> c.compare_signal(Decimal(-1), 2)
        Decimal('-1')
        >>> c.compare_signal(-1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�rNr�r)r)r+rNs zContext.compare_signalcCst|dd�}|�|�S)a+Compares two operands using their abstract representation.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.

        >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
        Decimal('0')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
        Decimal('1')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, Decimal(2))
        Decimal('-1')
        Tr�)r�rJr�r)r)r+rJ�szContext.compare_totalcCst|dd�}|�|�S)z�Compares two operands using their abstract representation ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�rRr�r)r)r+rR�szContext.compare_total_magcCst|dd�}|��S)aReturns a copy of the operand with the sign set to 0.

        >>> ExtendedContext.copy_abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.copy_abs(-1)
        Decimal('1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_abscCst|dd�}t|�S)aReturns a copy of the decimal object.

        >>> ExtendedContext.copy_decimal(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_decimal(Decimal('-1.00'))
        Decimal('-1.00')
        >>> ExtendedContext.copy_decimal(1)
        Decimal('1')
        Tr�)r�rr�r)r)r+�copy_decimal�s
zContext.copy_decimalcCst|dd�}|��S)a(Returns a copy of the operand with the sign inverted.

        >>> ExtendedContext.copy_negate(Decimal('101.5'))
        Decimal('-101.5')
        >>> ExtendedContext.copy_negate(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.copy_negate(1)
        Decimal('-1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_negatecCst|dd�}|�|�S)aCopies the second operand's sign to the first one.

        In detail, it returns a copy of the first operand with the sign
        equal to the sign of the second operand.

        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(1, -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(Decimal(1), -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(1, Decimal(-2))
        Decimal('-1')
        Tr�)r�rSr�r)r)r+rS�szContext.copy_signcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Decimal division in a specified context.

        >>> ExtendedContext.divide(Decimal('1'), Decimal('3'))
        Decimal('0.333333333')
        >>> ExtendedContext.divide(Decimal('2'), Decimal('3'))
        Decimal('0.666666667')
        >>> ExtendedContext.divide(Decimal('5'), Decimal('2'))
        Decimal('2.5')
        >>> ExtendedContext.divide(Decimal('1'), Decimal('10'))
        Decimal('0.1')
        >>> ExtendedContext.divide(Decimal('12'), Decimal('12'))
        Decimal('1')
        >>> ExtendedContext.divide(Decimal('8.00'), Decimal('2'))
        Decimal('4.00')
        >>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0'))
        Decimal('1.20')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('1'))
        Decimal('1000')
        >>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
        Decimal('1.20E+6')
        >>> ExtendedContext.divide(5, 5)
        Decimal('1')
        >>> ExtendedContext.divide(Decimal(5), 5)
        Decimal('1')
        >>> ExtendedContext.divide(5, Decimal(5))
        Decimal('1')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�divides
zContext.dividecCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a/Divides two numbers and returns the integer part of the result.

        >>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
        Decimal('0')
        >>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(10, 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal(10), 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(10, Decimal(3))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�
divide_int+s
zContext.divide_intcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return (a // b, a % b).

        >>> ExtendedContext.divmod(Decimal(8), Decimal(3))
        (Decimal('2'), Decimal('2'))
        >>> ExtendedContext.divmod(Decimal(8), Decimal(4))
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(Decimal(8), 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, Decimal(4))
        (Decimal('2'), Decimal('0'))
        Tr�rLr�N)r�r�r�rwr�r)r)r+r�Bs
zContext.divmodcCst|dd�}|j|d�S)a#Returns e ** a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.exp(Decimal('-Infinity'))
        Decimal('0')
        >>> c.exp(Decimal('-1'))
        Decimal('0.367879441')
        >>> c.exp(Decimal('0'))
        Decimal('1')
        >>> c.exp(Decimal('1'))
        Decimal('2.71828183')
        >>> c.exp(Decimal('0.693147181'))
        Decimal('2.00000000')
        >>> c.exp(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.exp(10)
        Decimal('22026.4658')
        Tr�rL)r�rWr�r)r)r+rWWszContext.expcCst|dd�}|j|||d�S)aReturns a multiplied by b, plus c.

        The first two operands are multiplied together, using multiply,
        the third operand is then added to the result of that
        multiplication, using add, all with only one final rounding.

        >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
        Decimal('22')
        >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
        Decimal('-8')
        >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
        Decimal('1.38435736E+12')
        >>> ExtendedContext.fma(1, 3, 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, Decimal(3), 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, 3, Decimal(4))
        Decimal('7')
        Tr�rL)r�r)r0r-rsrFr)r)r+roszContext.fmacCst|t�std��|��S)aReturn True if the operand is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.

        >>> ExtendedContext.is_canonical(Decimal('2.50'))
        True
        z/is_canonical requires a Decimal as an argument.)rdrrwrVr�r)r)r+rV�s	
zContext.is_canonicalcCst|dd�}|��S)a,Return True if the operand is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.

        >>> ExtendedContext.is_finite(Decimal('2.50'))
        True
        >>> ExtendedContext.is_finite(Decimal('-0.3'))
        True
        >>> ExtendedContext.is_finite(Decimal('0'))
        True
        >>> ExtendedContext.is_finite(Decimal('Inf'))
        False
        >>> ExtendedContext.is_finite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_finite(1)
        True
        Tr�)r�rWr�r)r)r+rW�szContext.is_finitecCst|dd�}|��S)aUReturn True if the operand is infinite; otherwise return False.

        >>> ExtendedContext.is_infinite(Decimal('2.50'))
        False
        >>> ExtendedContext.is_infinite(Decimal('-Inf'))
        True
        >>> ExtendedContext.is_infinite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_infinite(1)
        False
        Tr�)r�r=r�r)r)r+r=�szContext.is_infinitecCst|dd�}|��S)aOReturn True if the operand is a qNaN or sNaN;
        otherwise return False.

        >>> ExtendedContext.is_nan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_nan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_nan(Decimal('-sNaN'))
        True
        >>> ExtendedContext.is_nan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_nancCst|dd�}|j|d�S)a�Return True if the operand is a normal number;
        otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_normal(Decimal('2.50'))
        True
        >>> c.is_normal(Decimal('0.1E-999'))
        False
        >>> c.is_normal(Decimal('0.00'))
        False
        >>> c.is_normal(Decimal('-Inf'))
        False
        >>> c.is_normal(Decimal('NaN'))
        False
        >>> c.is_normal(1)
        True
        Tr�rL)r�rYr�r)r)r+rY�szContext.is_normalcCst|dd�}|��S)aHReturn True if the operand is a quiet NaN; otherwise return False.

        >>> ExtendedContext.is_qnan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_qnan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_qnan(Decimal('sNaN'))
        False
        >>> ExtendedContext.is_qnan(1)
        False
        Tr�)r�r�r�r)r)r+r��szContext.is_qnancCst|dd�}|��S)a�Return True if the operand is negative; otherwise return False.

        >>> ExtendedContext.is_signed(Decimal('2.50'))
        False
        >>> ExtendedContext.is_signed(Decimal('-12'))
        True
        >>> ExtendedContext.is_signed(Decimal('-0'))
        True
        >>> ExtendedContext.is_signed(8)
        False
        >>> ExtendedContext.is_signed(-8)
        True
        Tr�)r�rZr�r)r)r+rZ�szContext.is_signedcCst|dd�}|��S)aTReturn True if the operand is a signaling NaN;
        otherwise return False.

        >>> ExtendedContext.is_snan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_snan(Decimal('NaN'))
        False
        >>> ExtendedContext.is_snan(Decimal('sNaN'))
        True
        >>> ExtendedContext.is_snan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_snancCst|dd�}|j|d�S)a�Return True if the operand is subnormal; otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_subnormal(Decimal('2.50'))
        False
        >>> c.is_subnormal(Decimal('0.1E-999'))
        True
        >>> c.is_subnormal(Decimal('0.00'))
        False
        >>> c.is_subnormal(Decimal('-Inf'))
        False
        >>> c.is_subnormal(Decimal('NaN'))
        False
        >>> c.is_subnormal(1)
        False
        Tr�rL)r�r[r�r)r)r+r[szContext.is_subnormalcCst|dd�}|��S)auReturn True if the operand is a zero; otherwise return False.

        >>> ExtendedContext.is_zero(Decimal('0'))
        True
        >>> ExtendedContext.is_zero(Decimal('2.50'))
        False
        >>> ExtendedContext.is_zero(Decimal('-0E+2'))
        True
        >>> ExtendedContext.is_zero(1)
        False
        >>> ExtendedContext.is_zero(0)
        True
        Tr�)r�r\r�r)r)r+r\%szContext.is_zerocCst|dd�}|j|d�S)a�Returns the natural (base e) logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.ln(Decimal('0'))
        Decimal('-Infinity')
        >>> c.ln(Decimal('1.000'))
        Decimal('0')
        >>> c.ln(Decimal('2.71828183'))
        Decimal('1.00000000')
        >>> c.ln(Decimal('10'))
        Decimal('2.30258509')
        >>> c.ln(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.ln(1)
        Decimal('0')
        Tr�rL)r�rfr�r)r)r+rf6sz
Context.lncCst|dd�}|j|d�S)a�Returns the base 10 logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.log10(Decimal('0'))
        Decimal('-Infinity')
        >>> c.log10(Decimal('0.001'))
        Decimal('-3')
        >>> c.log10(Decimal('1.000'))
        Decimal('0')
        >>> c.log10(Decimal('2'))
        Decimal('0.301029996')
        >>> c.log10(Decimal('10'))
        Decimal('1')
        >>> c.log10(Decimal('70'))
        Decimal('1.84509804')
        >>> c.log10(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.log10(0)
        Decimal('-Infinity')
        >>> c.log10(1)
        Decimal('0')
        Tr�rL)r�rir�r)r)r+riLsz
Context.log10cCst|dd�}|j|d�S)a4 Returns the exponent of the magnitude of the operand's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of the operand (as though the
        operand were truncated to a single digit while maintaining the
        value of that digit and without limiting the resulting exponent).

        >>> ExtendedContext.logb(Decimal('250'))
        Decimal('2')
        >>> ExtendedContext.logb(Decimal('2.50'))
        Decimal('0')
        >>> ExtendedContext.logb(Decimal('0.03'))
        Decimal('-2')
        >>> ExtendedContext.logb(Decimal('0'))
        Decimal('-Infinity')
        >>> ExtendedContext.logb(1)
        Decimal('0')
        >>> ExtendedContext.logb(10)
        Decimal('1')
        >>> ExtendedContext.logb(100)
        Decimal('2')
        Tr�rL)r�rjr�r)r)r+rjhszContext.logbcCst|dd�}|j||d�S)a�Applies the logical operation 'and' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
        Decimal('1000')
        >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
        Decimal('10')
        >>> ExtendedContext.logical_and(110, 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(Decimal(110), 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(110, Decimal(1101))
        Decimal('100')
        Tr�rL)r�rxr�r)r)r+rx�szContext.logical_andcCst|dd�}|j|d�S)aInvert all the digits in the operand.

        The operand must be a logical number.

        >>> ExtendedContext.logical_invert(Decimal('0'))
        Decimal('111111111')
        >>> ExtendedContext.logical_invert(Decimal('1'))
        Decimal('111111110')
        >>> ExtendedContext.logical_invert(Decimal('111111111'))
        Decimal('0')
        >>> ExtendedContext.logical_invert(Decimal('101010101'))
        Decimal('10101010')
        >>> ExtendedContext.logical_invert(1101)
        Decimal('111110010')
        Tr�rL)r�rzr�r)r)r+rz�szContext.logical_invertcCst|dd�}|j||d�S)a�Applies the logical operation 'or' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(110, 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(Decimal(110), 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(110, Decimal(1101))
        Decimal('1111')
        Tr�rL)r�r{r�r)r)r+r{�szContext.logical_orcCst|dd�}|j||d�S)a�Applies the logical operation 'xor' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
        Decimal('110')
        >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
        Decimal('1101')
        >>> ExtendedContext.logical_xor(110, 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(Decimal(110), 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(110, Decimal(1101))
        Decimal('1011')
        Tr�rL)r�ryr�r)r)r+ry�szContext.logical_xorcCst|dd�}|j||d�S)a�max compares two values numerically and returns the maximum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the maximum (closer to positive
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.max(Decimal('3'), Decimal('2'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('-10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('1.0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max(1, 2)
        Decimal('2')
        >>> ExtendedContext.max(Decimal(1), 2)
        Decimal('2')
        >>> ExtendedContext.max(1, Decimal(2))
        Decimal('2')
        Tr�rL)r�r�r�r)r)r+r��szContext.maxcCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
        Decimal('-10')
        >>> ExtendedContext.max_mag(1, -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(Decimal(1), -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(1, Decimal(-2))
        Decimal('-2')
        Tr�rL)r�r~r�r)r)r+r~szContext.max_magcCst|dd�}|j||d�S)a�min compares two values numerically and returns the minimum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the minimum (closer to negative
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.min(Decimal('3'), Decimal('2'))
        Decimal('2')
        >>> ExtendedContext.min(Decimal('-10'), Decimal('3'))
        Decimal('-10')
        >>> ExtendedContext.min(Decimal('1.0'), Decimal('1'))
        Decimal('1.0')
        >>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.min(1, 2)
        Decimal('1')
        >>> ExtendedContext.min(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.min(1, Decimal(29))
        Decimal('1')
        Tr�rL)r�r�r�r)r)r+r�szContext.mincCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
        Decimal('-2')
        >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
        Decimal('-3')
        >>> ExtendedContext.min_mag(1, -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(Decimal(1), -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(1, Decimal(-2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+r-szContext.min_magcCst|dd�}|j|d�S)a�Minus corresponds to unary prefix minus in Python.

        The operation is evaluated using the same rules as subtract; the
        operation minus(a) is calculated as subtract('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.minus(Decimal('1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.minus(Decimal('-1.3'))
        Decimal('1.3')
        >>> ExtendedContext.minus(1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�minus>sz
Context.minuscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�multiply multiplies two operands.

        If either operand is a special value then the general rules apply.
        Otherwise, the operands are multiplied together
        ('long multiplication'), resulting in a number which may be as long as
        the sum of the lengths of the two operands.

        >>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
        Decimal('3.60')
        >>> ExtendedContext.multiply(Decimal('7'), Decimal('3'))
        Decimal('21')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8'))
        Decimal('0.72')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0'))
        Decimal('-0.0')
        >>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
        Decimal('4.28135971E+11')
        >>> ExtendedContext.multiply(7, 7)
        Decimal('49')
        >>> ExtendedContext.multiply(Decimal(7), 7)
        Decimal('49')
        >>> ExtendedContext.multiply(7, Decimal(7))
        Decimal('49')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�multiplyOs
zContext.multiplycCst|dd�}|j|d�S)a"Returns the largest representable number smaller than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_minus(Decimal('1'))
        Decimal('0.999999999')
        >>> c.next_minus(Decimal('1E-1007'))
        Decimal('0E-1007')
        >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
        Decimal('-1.00000004')
        >>> c.next_minus(Decimal('Infinity'))
        Decimal('9.99999999E+999')
        >>> c.next_minus(1)
        Decimal('0.999999999')
        Tr�rL)r�r�r�r)r)r+r�oszContext.next_minuscCst|dd�}|j|d�S)aReturns the smallest representable number larger than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_plus(Decimal('1'))
        Decimal('1.00000001')
        >>> c.next_plus(Decimal('-1E-1007'))
        Decimal('-0E-1007')
        >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
        Decimal('-1.00000002')
        >>> c.next_plus(Decimal('-Infinity'))
        Decimal('-9.99999999E+999')
        >>> c.next_plus(1)
        Decimal('1.00000001')
        Tr�rL)r�r�r�r)r)r+r��szContext.next_pluscCst|dd�}|j||d�S)a�Returns the number closest to a, in direction towards b.

        The result is the closest representable number from the first
        operand (but not the first operand) that is in the direction
        towards the second operand, unless the operands have the same
        value.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.next_toward(Decimal('1'), Decimal('2'))
        Decimal('1.00000001')
        >>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
        Decimal('-0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
        Decimal('-1.00000002')
        >>> c.next_toward(Decimal('1'), Decimal('0'))
        Decimal('0.999999999')
        >>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
        Decimal('0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
        Decimal('-1.00000004')
        >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
        Decimal('-0.00')
        >>> c.next_toward(0, 1)
        Decimal('1E-1007')
        >>> c.next_toward(Decimal(0), 1)
        Decimal('1E-1007')
        >>> c.next_toward(0, Decimal(1))
        Decimal('1E-1007')
        Tr�rL)r�r�r�r)r)r+r��s zContext.next_towardcCst|dd�}|j|d�S)a�normalize reduces an operand to its simplest form.

        Essentially a plus operation with all trailing zeros removed from the
        result.

        >>> ExtendedContext.normalize(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.normalize(Decimal('-2.0'))
        Decimal('-2')
        >>> ExtendedContext.normalize(Decimal('1.200'))
        Decimal('1.2')
        >>> ExtendedContext.normalize(Decimal('-120'))
        Decimal('-1.2E+2')
        >>> ExtendedContext.normalize(Decimal('120.00'))
        Decimal('1.2E+2')
        >>> ExtendedContext.normalize(Decimal('0.00'))
        Decimal('0')
        >>> ExtendedContext.normalize(6)
        Decimal('6')
        Tr�rL)r�r;r�r)r)r+r;�szContext.normalizecCst|dd�}|j|d�S)a�Returns an indication of the class of the operand.

        The class is one of the following strings:
          -sNaN
          -NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.number_class(Decimal('Infinity'))
        '+Infinity'
        >>> c.number_class(Decimal('1E-10'))
        '+Normal'
        >>> c.number_class(Decimal('2.50'))
        '+Normal'
        >>> c.number_class(Decimal('0.1E-999'))
        '+Subnormal'
        >>> c.number_class(Decimal('0'))
        '+Zero'
        >>> c.number_class(Decimal('-0'))
        '-Zero'
        >>> c.number_class(Decimal('-0.1E-999'))
        '-Subnormal'
        >>> c.number_class(Decimal('-1E-10'))
        '-Normal'
        >>> c.number_class(Decimal('-2.50'))
        '-Normal'
        >>> c.number_class(Decimal('-Infinity'))
        '-Infinity'
        >>> c.number_class(Decimal('NaN'))
        'NaN'
        >>> c.number_class(Decimal('-NaN'))
        'NaN'
        >>> c.number_class(Decimal('sNaN'))
        'sNaN'
        >>> c.number_class(123)
        '+Normal'
        Tr�rL)r�r�r�r)r)r+r��s/zContext.number_classcCst|dd�}|j|d�S)a�Plus corresponds to unary prefix plus in Python.

        The operation is evaluated using the same rules as add; the
        operation plus(a) is calculated as add('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.plus(Decimal('1.3'))
        Decimal('1.3')
        >>> ExtendedContext.plus(Decimal('-1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.plus(-1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�plusszContext.pluscCs:t|dd�}|j|||d�}|tkr2td|��n|SdS)aRaises a to the power of b, to modulo if given.

        With two arguments, compute a**b.  If a is negative then b
        must be integral.  The result will be inexact unless b is
        integral and the result is finite and can be expressed exactly
        in 'precision' digits.

        With three arguments, compute (a**b) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - b must be nonnegative
         - at least one of a or b must be nonzero
         - modulo must be nonzero and have at most 'precision' digits

        The result of pow(a, b, modulo) is identical to the result
        that would be obtained by computing (a**b) % modulo with
        unbounded precision, but is computed more efficiently.  It is
        always exact.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.power(Decimal('2'), Decimal('3'))
        Decimal('8')
        >>> c.power(Decimal('-2'), Decimal('3'))
        Decimal('-8')
        >>> c.power(Decimal('2'), Decimal('-3'))
        Decimal('0.125')
        >>> c.power(Decimal('1.7'), Decimal('8'))
        Decimal('69.7575744')
        >>> c.power(Decimal('10'), Decimal('0.301029996'))
        Decimal('2.00000000')
        >>> c.power(Decimal('Infinity'), Decimal('-1'))
        Decimal('0')
        >>> c.power(Decimal('Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('Infinity'), Decimal('1'))
        Decimal('Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('-1'))
        Decimal('-0')
        >>> c.power(Decimal('-Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('-Infinity'), Decimal('1'))
        Decimal('-Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('2'))
        Decimal('Infinity')
        >>> c.power(Decimal('0'), Decimal('0'))
        Decimal('NaN')

        >>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
        Decimal('11')
        >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
        Decimal('-11')
        >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
        Decimal('1')
        >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
        Decimal('11')
        >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
        Decimal('11729830')
        >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
        Decimal('-0')
        >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
        Decimal('1')
        >>> ExtendedContext.power(7, 7)
        Decimal('823543')
        >>> ExtendedContext.power(Decimal(7), 7)
        Decimal('823543')
        >>> ExtendedContext.power(7, Decimal(7), 2)
        Decimal('1')
        Tr�rLr�N)r�r7r�rw)r0r-rsrr�r)r)r+�powers
Iz
Context.powercCst|dd�}|j||d�S)a
Returns a value equal to 'a' (rounded), having the exponent of 'b'.

        The coefficient of the result is derived from that of the left-hand
        operand.  It may be rounded using the current rounding setting (if the
        exponent is being increased), multiplied by a positive power of ten (if
        the exponent is being decreased), or is unchanged (if the exponent is
        already equal to that of the right-hand operand).

        Unlike other operations, if the length of the coefficient after the
        quantize operation would be greater than precision then an Invalid
        operation condition is raised.  This guarantees that, unless there is
        an error condition, the exponent of the result of a quantize is always
        equal to that of the right-hand operand.

        Also unlike other operations, quantize will never raise Underflow, even
        if the result is subnormal and inexact.

        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001'))
        Decimal('2.170')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01'))
        Decimal('2.17')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1'))
        Decimal('2.2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0'))
        Decimal('2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1'))
        Decimal('0E+1')
        >>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity'))
        Decimal('-Infinity')
        >>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1'))
        Decimal('-0')
        >>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5'))
        Decimal('-0E+5')
        >>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1'))
        Decimal('217.0')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0'))
        Decimal('217')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1'))
        Decimal('2.2E+2')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
        Decimal('2E+2')
        >>> ExtendedContext.quantize(1, 2)
        Decimal('1')
        >>> ExtendedContext.quantize(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.quantize(1, Decimal(2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+res7zContext.quantizecCstd�S)zkJust returns 10, as this is Decimal, :)

        >>> ExtendedContext.radix()
        Decimal('10')
        r�r�r�r)r)r+r��sz
Context.radixcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)aReturns the remainder from integer division.

        The result is the residue of the dividend after the operation of
        calculating integer division as described for divide-integer, rounded
        to precision digits if necessary.  The sign of the result, if
        non-zero, is the same as that of the original dividend.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3'))
        Decimal('2.1')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
        Decimal('1.0')
        >>> ExtendedContext.remainder(22, 6)
        Decimal('4')
        >>> ExtendedContext.remainder(Decimal(22), 6)
        Decimal('4')
        >>> ExtendedContext.remainder(22, Decimal(6))
        Decimal('4')
        Tr�rLr�N)r�r�r�rwr�r)r)r+r��s
zContext.remaindercCst|dd�}|j||d�S)aGReturns to be "a - b * n", where n is the integer nearest the exact
        value of "x / b" (if two integers are equally near then the even one
        is chosen).  If the result is equal to 0 then its sign will be the
        sign of a.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3'))
        Decimal('-0.9')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6'))
        Decimal('-2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
        Decimal('-0.3')
        >>> ExtendedContext.remainder_near(3, 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(Decimal(3), 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(3, Decimal(11))
        Decimal('3')
        Tr�rL)r�r�r�r)r)r+r��szContext.remainder_nearcCst|dd�}|j||d�S)aNReturns a rotated copy of a, b times.

        The coefficient of the result is a rotated copy of the digits in
        the coefficient of the first operand.  The number of places of
        rotation is taken from the absolute value of the second operand,
        with the rotation being to the left if the second operand is
        positive or to the right otherwise.

        >>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
        Decimal('400000003')
        >>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
        Decimal('12')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
        Decimal('891234567')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
        Decimal('345678912')
        >>> ExtendedContext.rotate(1333333, 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(Decimal(1333333), 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(1333333, Decimal(1))
        Decimal('13333330')
        Tr�rL)r�r�r�r)r)r+r��szContext.rotatecCst|dd�}|�|�S)a�Returns True if the two operands have the same exponent.

        The result is never affected by either the sign or the coefficient of
        either operand.

        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001'))
        False
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01'))
        True
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1'))
        False
        >>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
        True
        >>> ExtendedContext.same_quantum(10000, -1)
        True
        >>> ExtendedContext.same_quantum(Decimal(10000), -1)
        True
        >>> ExtendedContext.same_quantum(10000, Decimal(-1))
        True
        Tr�)r�r>r�r)r)r+r>szContext.same_quantumcCst|dd�}|j||d�S)a3Returns the first operand after adding the second value its exp.

        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
        Decimal('0.0750')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
        Decimal('7.50')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
        Decimal('7.50E+3')
        >>> ExtendedContext.scaleb(1, 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(Decimal(1), 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(1, Decimal(4))
        Decimal('1E+4')
        Tr�rL)r�r�r�r)r)r+r�$szContext.scalebcCst|dd�}|j||d�S)a{Returns a shifted copy of a, b times.

        The coefficient of the result is a shifted copy of the digits
        in the coefficient of the first operand.  The number of places
        to shift is taken from the absolute value of the second operand,
        with the shift being to the left if the second operand is
        positive or to the right otherwise.  Digits shifted into the
        coefficient are zeros.

        >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
        Decimal('400000000')
        >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
        Decimal('0')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
        Decimal('1234567')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
        Decimal('345678900')
        >>> ExtendedContext.shift(88888888, 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(Decimal(88888888), 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(88888888, Decimal(2))
        Decimal('888888800')
        Tr�rL)r�r�r�r)r)r+r�7sz
Context.shiftcCst|dd�}|j|d�S)a�Square root of a non-negative number to context precision.

        If the result must be inexact, it is rounded using the round-half-even
        algorithm.

        >>> ExtendedContext.sqrt(Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.sqrt(Decimal('-0'))
        Decimal('-0')
        >>> ExtendedContext.sqrt(Decimal('0.39'))
        Decimal('0.624499800')
        >>> ExtendedContext.sqrt(Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.sqrt(Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.sqrt(Decimal('1.0'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('1.00'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('7'))
        Decimal('2.64575131')
        >>> ExtendedContext.sqrt(Decimal('10'))
        Decimal('3.16227766')
        >>> ExtendedContext.sqrt(2)
        Decimal('1.41421356')
        >>> ExtendedContext.prec
        9
        Tr�rL)r�rHr�r)r)r+rHUszContext.sqrtcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a&Return the difference between the two operands.

        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07'))
        Decimal('0.23')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30'))
        Decimal('0.00')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
        Decimal('-0.77')
        >>> ExtendedContext.subtract(8, 5)
        Decimal('3')
        >>> ExtendedContext.subtract(Decimal(8), 5)
        Decimal('3')
        >>> ExtendedContext.subtract(8, Decimal(5))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�subtractus
zContext.subtractcCst|dd�}|j|d�S)a�Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.

        The operation is not affected by the context.

        >>> ExtendedContext.to_eng_string(Decimal('123E+1'))
        '1.23E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E+3'))
        '123E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E-10'))
        '12.3E-9'
        >>> ExtendedContext.to_eng_string(Decimal('-123E-12'))
        '-123E-12'
        >>> ExtendedContext.to_eng_string(Decimal('7E-7'))
        '700E-9'
        >>> ExtendedContext.to_eng_string(Decimal('7E+1'))
        '70'
        >>> ExtendedContext.to_eng_string(Decimal('0E+1'))
        '0.00E+3'

        Tr�rL)r�r�r�r)r)r+r��szContext.to_eng_stringcCst|dd�}|j|d�S)zyConverts a number to a string, using scientific notation.

        The operation is not affected by the context.
        Tr�rL)r�r�r�r)r)r+�
to_sci_string�szContext.to_sci_stringcCst|dd�}|j|d�S)akRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting; Inexact and Rounded flags
        are allowed in this operation.  The rounding mode is taken from the
        context.

        >>> ExtendedContext.to_integral_exact(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_exact(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rBr�r)r)r+rB�szContext.to_integral_exactcCst|dd�}|j|d�S)aLRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting, except that no flags will
        be set.  The rounding mode is taken from the context.

        >>> ExtendedContext.to_integral_value(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_value(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_value(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_value(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_value(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rr�r)r)r+r�szContext.to_integral_value)	NNNNNNNNN)N)rR)N)Xr4r5r6r7r�r�r�r�r�r�r�rNr�rCrMr�rir�r�r�r�r�r�rDr�r�rmr�r�rMr�rNrJrRr�r�r�rSr�r�r�rWrrVrWr=r�rYr�rZr�r[r\rfrirjrxrzr{ryr�r~r�rr�r�r�r�r�r;r�r�r�rr�r�r�r�r>r�r�rHr�r�r�rBrr�r)r)r)r+rs��
$



$#


%
 #2
P:&" c@s"eZdZdZddd�Zdd�ZdS)rn�rCrVrWNcCsf|dkrd|_d|_d|_nFt|t�rD|j|_t|j�|_|j|_n|d|_|d|_|d|_dS)Nr&r.r^)rCrVrWrdrr;r<rP)r0ryr)r)r+r��s



z_WorkRep.__init__cCsd|j|j|jfS)Nz(%r, %r, %r)r�r�r)r)r+r�sz_WorkRep.__repr__)N)r4r5r6r�r�r�r)r)r)r+rn�s
rncCs�|j|jkr|}|}n|}|}tt|j��}tt|j��}|jtd||d�}||jd|krpd|_||_|jd|j|j9_|j|_||fS)zcNormalizes op1, op2 to have the same exp and length of coefficient.

    Done during addition.
    r�r^r.r�)rWrkrerVr�)r�r�rFZtmpr�Ztmp_lenZ	other_lenrWr)r)r+r�sr�cCsb|dkrdS|dkr |d|Stt|��}t|�t|�d��}||krPdS|d|SdS)a Given integers n and e, return n * 10**e if it's an integer, else None.

    The computation is designed to avoid computing large powers of 10
    unnecessarily.

    >>> _decimal_lshift_exact(3, 4)
    30000
    >>> _decimal_lshift_exact(300, -999999999)  # returns None

    r&r�rRN)rermrk�rstrip)r9r�Zstr_nZval_nr)r)r+r#(sr#cCsB|dks|dkrtd��d}||kr>||||d?}}q|S)z�Closest integer to the square root of the positive integer n.  a is
    an initial approximation to the square root.  Any positive integer
    will do for a, but the closer a is to the square root of n the
    faster convergence will be.

    r&z3Both arguments to _sqrt_nearest should be positive.r.)rq)r9r-rsr)r)r+�
_sqrt_nearest=sr�cCs2d|>||?}}|d||d@|d@|kS)z�Given an integer x and a nonnegative integer shift, return closest
    integer to x / 2**shift; use round-to-even in case of a tie.

    r.r^r))r&r�rsr�r)r)r+�_rshift_nearestLsr�cCs&t||�\}}|d||d@|kS)zaClosest integer to a/b, a and b positive integers; rounds to even
    in the case of a tie.

    r^r.)r�)r-rsr�r�r)r)r+�_div_nearestTsr�rc		Cs�||}d}||kr(t|�||>|ksD||krxt|�||?|krxt||d>|t||t||�|��}|d7}qtdtt|��d|�}t||�}t||�}t|ddd�D]}t||�t|||�}q�t|||�S)a�Integer approximation to M*log(x/M), with absolute error boundable
    in terms only of x/M.

    Given positive integers x and M, return an integer approximation to
    M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
    between the approximation and the exact result is at most 22.  For
    L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
    both cases these are upper bounds on the error; it will usually be
    much smaller.r&r.���r\r�)rmr�r�r�rVrkrer)	r&�M�Lr)�R�TZyshift�wr�r)r)r+�_ilog\s"���


r�c
Cs�|d7}tt|��}||||dk}|dkr�d|}|||}|dkrZ|d|9}nt|d|�}t||�}t|�}t|||�}||}	nd}t|d|�}	t|	|d�S)z�Given integers c, e and p with c > 0, p >= 0, compute an integer
    approximation to 10**p * log10(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r��
_log10_digits)
rFr�r%rGr�r�r��log_dZlog_10Zlog_tenpowerr)r)r+rh�s 

rhc	Cs�|d7}tt|��}||||dk}|dkrr|||}|dkrR|d|9}nt|d|�}t|d|�}nd}|r�ttt|���d}||dkr�t|t||�d|�}q�d}nd}t||d�S)z�Given integers c, e and p with c > 0, compute an integer
    approximation to 10**p * log(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r�rmr�)	rFr�r%rGr�r�r�r6Z	f_log_tenr)r)r+rd�s"rdc@s eZdZdZdd�Zdd�ZdS)�
_Log10Memoizez�Class to compute, store, and allow retrieval of, digits of the
    constant log(10) = 2.302585....  This constant is needed by
    Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__.cCs
d|_dS)NZ/23025850929940456840179914546843642076011014886)r}r�r)r)r+r��sz_Log10Memoize.__init__cCs�|dkrtd��|t|j�kr�d}d||d}tttd||�d��}||d�d|krbql|d7}q"|�d�dd	�|_t|jd|d
��S)ztGiven an integer p >= 0, return floor(10**p)*log(10).

        For example, self.getdigits(3) returns 2302.
        r&zp should be nonnegativer\r�r^r!NrRr�r.)rqrkr}rer�r�r�rV)r0r%r6r�r}r)r)r+�	getdigits�s	
z_Log10Memoize.getdigitsN)r4r5r6r7r�r�r)r)r)r+r��sr�c	Cs�t||>|�}tdtt|��d|�}t||�}||>}t|ddd�D]}t|||||�}qPt|ddd�D]"}||d>}t||||�}q|||S)z�Given integers x and M, M > 0, such that x/M is small in absolute
    value, compute an integer approximation to M*exp(x/M).  For 0 <=
    x/M <= 2.4, the absolute error in the result is bounded by 60 (and
    is usually much smaller).r�r\r.r&r�r^)r"rVrkrer�r)	r&r�r�r�r�r)ZMshiftrr�r)r)r+�_iexp�s
r�c	Cs�|d7}td|tt|��d�}||}||}|dkrH|d|}n|d|}t|t|��\}}t|d|�}tt|d|�d�||dfS)a�Compute an approximation to exp(c*10**e), with p decimal places of
    precision.

    Returns integers d, f such that:

      10**(p-1) <= d <= 10**p, and
      (d-1)*10**f < exp(c*10**e) < (d+1)*10**f

    In other words, d*10**f is an approximation to exp(c*10**e) with p
    digits of precision, and with an error in d of at most 1.  This is
    almost, but not quite, the same as the error being < 1ulp: when d
    = 10**(p-1) the error could be up to 10 ulp.r^r&r.r�i�r\)r�rkrer�r�r�r�)	rFr�r%r6r�r�ZcshiftZquotr,r)r)r+rT$srTcCs�ttt|���|}t||||d�}||}|dkrJ||d|}nt||d|�}|dkr�tt|��|dk|dkkr�d|ddd|}	}
q�d|d|}	}
n,t||d|d�\}	}
t|	d�}	|
d7}
|	|
fS)a5Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
    y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:

      10**(p-1) <= c <= 10**p, and
      (c-1)*10**e < x**y < (c+1)*10**e

    in other words, c*10**e is an approximation to x**y with p digits
    of precision, and with an error in c of at most 1.  (This is
    almost, but not quite, the same as the error being < 1ulp: when c
    == 10**(p-1) we can only guarantee error < 10ulp.)

    We assume that: x is positive and not equal to 1, and y is nonzero.
    r.r&r�)rkrermrdr�rT)r'r(r*r+r%rsZlxcr�Zpcr�rWr)r)r+r1Hs
r1r!�F�5�(�r]�r�r~)	r��2�3�4�5�6�7�8rDcCs0|dkrtd��t|�}dt|�||dS)z@Compute a lower bound for 100*log10(c) for a positive integer c.r&z0The argument to _log10_lb should be nonnegative.r!)rqrerk)rFZ
correctionZstr_cr)r)r+r$rsr$cCsLt|t�r|St|t�r t|�S|r8t|t�r8t�|�S|rHtd|��tS)z�Convert other to Decimal.

    Verifies that it's ok to use in an implicit construction.
    If allow_float is true, allow conversion from float;  this
    is used in the comparison methods (__eq__ and friends).

    r�)rdrrVrurvrwr�)r�r�Zallow_floatr)r)r+r�}s


r�cCs�t|t�r||fSt|tj�rR|jsDt|jtt|j	�|j
�|j�}|t|j�fS|rrt|tj
�rr|jdkrr|j}t|t�r�t�}|r�d|jt<n|�td�|t�|�fSttfS)z�Given a Decimal instance self and a Python object other, return
    a pair (s, o) of Decimal instances such that "s op o" is
    equivalent to "self op other" for any of the 6 comparison
    operators "op".

    r&r.ra)rdr�_numbersZRationalrQr:r;rerVr<�denominatorrP�	numeratorZComplexr�r�rurr4rrirvr�)r0r�r�r1r)r)r+r��s(
�
�r�r i?Bi���)rFrEr3r4rGr<r�r�r_)rFrEr3r4a�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
z0*$z50*$z�\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
cCs�t�|�}|dkrtd|��|��}|d}|d}|ddk	|d<|drv|dk	rbtd|��|dk	rvtd|��|p|d|d<|p�d	|d<|d
dkr�d|d
<t|dp�d
�|d<|ddk	r�t|d�|d<|ddkr�|ddks�|ddkr�d|d<|ddk�rfd|d<|dk�r&t��}|ddk	�r@td|��|d|d<|d|d<|d|d<n*|ddk�r|d|d<ddg|d<d|d<|S)a�Parse and validate a format specifier.

    Turns a standard numeric format specifier into a dict, with the
    following entries:

      fill: fill character to pad field to minimum width
      align: alignment type, either '<', '>', '=' or '^'
      sign: either '+', '-' or ' '
      minimumwidth: nonnegative integer giving minimum width
      zeropad: boolean, indicating whether to pad with zeros
      thousands_sep: string to use as thousands separator, or ''
      grouping: grouping for thousands separators, in format
        used by localeconv
      decimal_point: string to use for decimal point
      precision: nonnegative integer giving precision, or None
      type: one of the characters 'eEfFgG%', or None

    NzInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>rCrU�minimumwidthrRr�r&r�ZgGnr.r9r��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointrTr\r�)�_parse_format_specifier_regex�matchrq�	groupdictrV�_locale�
localeconv)�format_specr�rzZformat_dictrrr)r)r+r�sT
��
�r�c	Cs�|d}|d}||t|�t|�}|d}|dkrF|||}nj|dkr\|||}nT|dkrr|||}n>|dkr�t|�d}|d	|�||||d	�}ntd
��|S)z�Given an unpadded, non-aligned numeric string 'body' and sign
    string 'sign', add padding and alignment conforming to the given
    format specifier dictionary 'spec' (as produced by
    parse_format_specifier).

    r	rr�<r�=�^r^NzUnrecognised alignment field)rkrq)	rCr�r�r	rZpaddingrr�Zhalfr)r)r+r�ms"r�cCspddlm}m}|sgS|ddkrJt|�dkrJ||dd�||d��S|dtjkrd|dd�Std��dS)zyConvert a localeconv-style grouping into a (possibly infinite)
    iterable of integers representing group lengths.

    r&)�chain�repeatr�r^Nr�z unrecognised format for grouping)�	itertoolsrrrkr�CHAR_MAXrq)rrrr)r)r+�_group_lengths�s
rcCs�|d}|d}g}t|�D]�}|dkr0td��ttt|�|d�|�}|�d|t|�||d��|d|�}||8}|s�|dkr�q�|t|�8}qtt|�|d�}|�d|t|�||d��|�t|��S)anInsert thousands separators into a digit string.

    spec is a dictionary whose keys should include 'thousands_sep' and
    'grouping'; typically it's the result of parsing the format
    specifier using _parse_format_specifier.

    The min_width keyword argument gives the minimum length of the
    result, which will be padded on the left with zeros if necessary.

    If necessary, the zero padding adds an extra '0' on the left to
    avoid a leading thousands separator.  For example, inserting
    commas every three digits in '123456', with min_width=8, gives
    '0,123,456', even though that has length 9.

    r
rr&zgroup length should be positiver.rRN)rrqr�r�rkrrrs�reversed)r}r��	min_width�sepr�groupsrGr)r)r+�_insert_thousands_sep�s $$rcCs$|rdS|ddkr|dSdSdS)zDetermine sign character.rUrCz +rTNr))�is_negativer�r)r)r+r��s
r�cCs�t||�}|s|dr"|d|}|dks6|ddkr\ddddd�|d}|d	�||�7}|dd
krp|d
7}|dr�|dt|�t|�}nd}t|||�}t||||�S)
acFormat a number, given the following data:

    is_negative: true if the number is negative, else false
    intpart: string of digits that must appear before the decimal point
    fracpart: string of digits that must come after the point
    exp: exponent, as an integer
    spec: dictionary resulting from parsing the format specifier

    This function uses the information in spec to:
      insert separators (decimal separator and thousands separators)
      format the sign
      format the exponent
      add trailing '%' for the '%' type
      zero-pad if necessary
      fill and align if necessary
    Zaltrr&r�r�r�r�)r�r�r�r�z{0}{1:+}r�rr	)r��formatrkrr�)r r{r|rWr�rCZecharrr)r)r+r��s
r�ZInfz-Infr�r�r^)N)F)r&)r)r)FF)F)N)r.)zr7�__all__r4Z	__xname__�__version__Z__libmpdec_version__ZmathrZnumbersr�sys�collectionsr'Z_namedtupler�ImportErrorrrrrrrrrr$r%�maxsizer r!r"r#�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrrwrr2r�r�ZcontextvarsZ
ContextVarrHrrrrbrr:�Number�registerrOrrnr�rVr�r"r#r�r�r�r�rhrdr�r�r�r�rTr1r$r�r�rrr�re�compile�VERBOSE�
IGNORECASErrfr�r�DOTALLr
Zlocalerr�r�rrr�r�rcrbr>rPr/rOrA�	hash_info�modulusr�r�r�r�r�r�r�r)r)r)r+�<module>s�e�#

&
���

.
^

0",#
%$+�

*���
�
�
P
%
)sndhdr.cpython-38.opt-1.pyc000064400000015517151450073350011431 0ustar00U

e5d��@s2dZddgZddlmZedd�Zdej_dej_d	ej_d
ej_dej	_dd�Z
d
d�ZgZdd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zed*k�r.e�d+S),a�Routines to help recognizing sound files.

Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.

The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- number of channels (0 if unknown or hard to decode)
- number of frames in the file (-1 if unknown or hard to decode)
- number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW

If the file doesn't have a recognizable type, it returns None.
If the file can't be opened, OSError is raised.

To compute the total time, divide the number of frames by the
sampling rate (a frame contains a sample for each channel).

Function what() calls whathdr().  (It used to also use some
heuristics for raw data, but this doesn't work very well.)

Finally, the function test() is a simple main program that calls
what() for all files mentioned on the argument list.  For directory
arguments it calls what() for all files in that directory.  Default
argument is "." (testing all files in the current directory).  The
option -r tells it to recurse down directories found inside
explicitly given directories.
�what�whathdr�)�
namedtuple�
SndHeadersz.filetype framerate nchannels nframes sampwidthz�The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.zYThe sampling_rate will be either the actual
value or 0 if unknown or difficult to decode.z^The number of channels or 0 if it cannot be
determined or if the value is difficult to decode.z?The value for frames will be either the number
of frames or -1.zAEither the sample size in bits or
'A' for A-LAW or 'U' for u-LAW.cCst|�}|S)zGuess the type of a sound file.)r)�filename�res�r�/usr/lib64/python3.8/sndhdr.pyr4sc
Cs^t|d��J}|�d�}tD]*}|||�}|rt|�W5QR�SqW5QR�dSQRXdS)zRecognize sound headers.�rbiN)�open�read�testsr)r�f�hZtfrrrr	r:s

c	Cs�ddl}|�d�sdS|dd�dkr,d}n|dd�dkrBd}ndS|�d�z|�|d	�}Wnt|jfk
r|YdSX||��|��|��d|�	�fS)
Nr�FORM��sAIFC�aifcsAIFFZaiff�r)
r�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrrZfmt�arrr	�	test_aifcKs"


�rc
Cs�|�d�rt}n|dd�dkr&t}ndSd}||dd��}||dd��}||dd��}||dd��}||dd	��}d
}	|d
kr�d}
n$|dkr�d}
n|d
kr�d}
d}	nd}
|	|}|r�||}nd}|||||
fS)Ns.snd�)sds.sdns.Zaurr�����U���?���)r�get_long_be�get_long_le)
rr�func�filetypeZhdr_size�	data_size�encoding�rate�	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	�test_au`s2

r1cCsT|dd�dks |dd�dkr$dSt|dd��}|rBd	|}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"VrZhcomr#r(r)r))rrZdivisorr/rrr	�	test_hcom�s 
r8cCst|�d�sdSt|dd��}d}d|kr6dkrfnn,||dkrfd||d}|rftd	|�}d
|dddfS)
NsCreative Voice Filer!�ri�r#�rg��.AZvocr(r)r�get_short_le�int)rrZsbseekr/Zratecoderrr	�test_voc�s
$r=c	Cs�ddl}|�d�r2|dd�dks2|dd�dkr6dS|�d�z|�|d�}Wnt|jfk
rlYdSXd	|��|��|��d|�	�fS)
NrsRIFFrrsWAVEr sfmt rZwav)
�waverrrrrrrrr)rrr>�wrrr	�test_wav�s*

�r@cCs"|�d�r|dd�dkrdSdS)Nrrrs8SVX)Z8svxrr#rr)r)rrrrr	�	test_8svx�srAcCs<|�d�r8t|dd��}t|dd��}d|d|dfSdS)NsSOUNDrrr!r9Zsndtr#)rr*r;)rrZnsamplesr/rrr	�	test_sndt�s
rBcCsD|�d�r@t|dd��}d|kr.dkr@nnd|ddd	fSdS)
Nsr%ri�i�aZsndrr#r(r)rr;)rrr/rrr	�	test_sndr�s
rCcCs,|dd>|dd>B|dd>B|dBS)Nrr"r#r r%rr&r��brrr	r)�sr)cCs,|dd>|dd>B|dd>B|dBS)Nr&r"r%r r#rrrrDrrr	r*�sr*cCs|dd>|dBS)Nrrr#rrDrrr	�get_short_be�srFcCs|dd>|dBS)Nr#rrrrDrrr	r;�sr;cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr#z-rr%�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rH�	recursiverrr	�test�srPc	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rH�os�path�isdir�print�glob�join�escaperJ�stdout�flushr�OSError)�listrOZtoplevelrHrUrrY�namesrrr	rJ�s"

rJ�__main__N)�__doc__�__all__�collectionsrrr,Z	framerater0ZnframesZ	sampwidthrrr
r�appendr1r8r=r@rArBrCr)r*rFr;rPrJ�__name__rrrr	�<module>sJ �









glob.cpython-38.opt-1.pyc000064400000010270151450073350011061 0ustar00U

e5dA�@s�dZddlZddlZddlZddlZdddgZdd�dd�Zdd�d	d�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Ze�d�Ze�d�Zdd�Zdd�Zd d!�Zd"d�ZdS)#zFilename globbing utility.�N�glob�iglob�escapeF��	recursivecCstt||d��S)ayReturn a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    r)�listr)�pathnamer�r	�/usr/lib64/python3.8/glob.pyr
scCs2t�d||�t||d�}|r.t|�r.t|�}|S)a�Return an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    z	glob.globF)�sys�audit�_iglob�_isrecursive�next)rr�it�sr	r	r
rs
ccs�tj�|�\}}t|�sF|r0tj�|�rB|Vntj�|�rB|VdS|s�|rjt|�rjt|||�EdHnt|||�EdHdS||kr�t|�r�t	||d�}n|g}t|�r�|r�t|�r�t}q�t}nt
}|D]&}||||�D]}tj�||�Vq�q�dS)NT)�os�path�split�	has_magic�lexists�isdirr�_glob2�_glob1r
�_glob0�join)rr�dironly�dirname�basename�dirsZglob_in_dir�namer	r	r
r
)s0r
cCs0tt||��}t|�s$dd�|D�}t�||�S)Ncss|]}t|�s|VqdS�N)�	_ishidden)�.0�xr	r	r
�	<genexpr>Tsz_glob1.<locals>.<genexpr>)r�_iterdirr"�fnmatch�filter)r�patternr�namesr	r	r
rQsrcCs8|stj�|�r4|gSntj�tj�||��r4|gSgSr!)rrrrr)rrrr	r	r
rWsrcCst||d�S�NF)r�rr)r	r	r
�glob0dsr-cCst||d�Sr+)rr,r	r	r
�glob1gsr.ccs"|dd�Vt||�EdHdS)Nr)�	_rlistdir)rr)rr	r	r
rmsrc
cs�|s"t|t�rttjd�}ntj}zRt�|��>}|D]2}z|rF|��rN|jVWq4tk
rdYq4Xq4W5QRXWntk
r�YdSXdS)N�ASCII)�
isinstance�bytesr�curdir�scandir�is_dirr �OSError)rrr�entryr	r	r
r&ts
r&ccs`tt||��}|D]H}t|�s|V|r6tj�||�n|}t||�D]}tj�||�VqDqdSr!)rr&r"rrrr/)rrr*r$r�yr	r	r
r/�sr/z([*?[])s([*?[])cCs(t|t�rt�|�}n
t�|�}|dk	Sr!)r1r2�magic_check_bytes�search�magic_check)r�matchr	r	r
r�s

rcCs|ddkS)Nr)�.�.r	)rr	r	r
r"�sr"cCst|t�r|dkS|dkSdS)Ns**z**)r1r2)r)r	r	r
r�s
rcCs<tj�|�\}}t|t�r(t�d|�}nt�d|�}||S)z#Escape all special characters.
    s[\1]z[\1])rr�
splitdriver1r2r9�subr;)rZdriver	r	r
r�s

)�__doc__r�rer'r�__all__rrr
rrr-r.rr&r/�compiler;r9rr"rrr	r	r	r
�<module>s*

(



_compat_pickle.cpython-38.opt-2.pyc000064400000012505151450073350013113 0ustar00U

e5d-"�+@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�*Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdL�!ZdMZzeWnek
r�Yn
XedN7ZeD]ZdefedOef<q�dPZeD]ZdQefedRef<q�edSdT�e��D��Z	edUdT�e��D��Z
e�dVdWdddd"d"dXdXdXd(dYdYdZ�
�e	�d[d(d\d]dVd^��e�d/d_d6d`da��e
�dbdcdddedfdgdhdidjdkdldmdndo�
�dpZeD]Zdqe
def<�q�drZ
e
D]Zdse
def<�q�dtS)u�builtins�copyregZqueueZsocketserverZconfigparser�reprlib�tkinter.filedialog�tkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.client�
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejar�http.serverztest.support�
subprocess�urllib.parsezurllib.robotparser�urllib.request�dbmzcollections.abc)*�__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZtkFileDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmr
�gdbmZ	xmlrpclibZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerztest.test_supportZcommandsZurlparseZrobotparser�urllib2ZanydbmZ_abcoll)r�range)�	functools�reduce)�sys�intern)r�chr)r�str)r�int)r�zip)r�map)r�filter)�	itertools�filterfalse)r�zip_longest)�collections�UserDict)r"�UserList)r"�
UserString)r
�whichdb)�socket�fromfd)zmultiprocessing.connection�
Connection)�multiprocessing.context�Process)zmultiprocessing.popen_fork�Popen)�urllib.error�ContentTooShortError)r�
getproxies)r�pathname2url)r�
quote_plus)r�quote)r�unquote_plus)r�unquote)r�url2pathname)r�
urlcleanup)r�	urlencode)r�urlopen)r�urlretrieve)r-�	HTTPError)r-�URLError)!)rZxrange�rr)rr)rZunichr)rZunicode)rZlong)rZizip)rZimap)rZifilter)rZifilterfalse)rZizip_longest)r#ZIterableUserDict)r$r$)r%r%)r&r&)�_socketr()Z_multiprocessingr))zmultiprocessing.processr+)zmultiprocessing.forkingr,)�urllibr.)r>r/)r>r0)r>r1)r>r2)r>r3)r>r4)r>r5)r>r6)r>r7)r>r8)r>r9)rr:)rr;)/�ArithmeticError�AssertionError�AttributeError�
BaseException�BufferError�BytesWarning�DeprecationWarning�EOFError�EnvironmentError�	Exception�FloatingPointError�
FutureWarning�
GeneratorExit�IOError�ImportError�
ImportWarning�IndentationError�
IndexError�KeyError�KeyboardInterrupt�LookupError�MemoryError�	NameError�NotImplementedError�OSError�
OverflowError�PendingDeprecationWarning�ReferenceError�RuntimeError�RuntimeWarning�
StopIteration�SyntaxError�
SyntaxWarning�SystemError�
SystemExit�TabError�	TypeError�UnboundLocalError�UnicodeDecodeError�UnicodeEncodeError�UnicodeError�UnicodeTranslateError�UnicodeWarning�UserWarning�
ValueError�Warning�ZeroDivisionError)�WindowsError�
exceptions)ZAuthenticationErrorZBufferTooShortZProcessError�TimeoutErrorr*Zmultiprocessingccs|]\}}||fVqdS�N���.0�k�vrrrr�&/usr/lib64/python3.8/_compat_pickle.py�	<genexpr>�srxccs|]\}}||fVqdSrqrrrsrrrrrwrx�s�picklezxml.etree.ElementTreer"�io)
ZcPickleZ_elementtree�
FileDialog�SimpleDialog�DocXMLRPCServer�SimpleHTTPServer�
CGIHTTPServerr#r$r%r&�StringIOZ	cStringIO�bz2rr)Z_bz2Z_dbm�
_functoolsZ_gdbm�_pickle)rrH)r'Z
SocketType))rZ
basestring)roZ
StandardError)r#r#�r'Z
_socketobjectr<)r{r{)r{�LoadFileDialog)r{�SaveFileDialog)r|r|)r}�
ServerHTMLDoc)r}�XMLRPCDocGenerator)r}�DocXMLRPCRequestHandler)r}r})r}�DocCGIXMLRPCRequestHandler)r~�SimpleHTTPRequestHandler)r�CGIHTTPRequestHandlerr�)
)r�r)rr{)rr�)rr�)rr|)rr�)rr�)rr�)rr})rr�)r	r�)r	r�)r=r')�BrokenPipeError�ChildProcessError�ConnectionAbortedError�ConnectionError�ConnectionRefusedError�ConnectionResetError�FileExistsError�FileNotFoundError�InterruptedError�IsADirectoryError�NotADirectoryError�PermissionError�ProcessLookupErrorrp)rorW)�ModuleNotFoundError)rorMN)ZIMPORT_MAPPINGZNAME_MAPPINGZPYTHON2_EXCEPTIONSrnrUZexcnameZMULTIPROCESSING_EXCEPTIONS�dict�itemsZREVERSE_IMPORT_MAPPINGZREVERSE_NAME_MAPPING�updateZPYTHON3_OSERROR_EXCEPTIONSZPYTHON3_IMPORTERROR_EXCEPTIONSrrrrrrrw�<module>	s�2�$3����sre_parse.cpython-38.pyc000064400000052221151450073350011164 0ustar00U

e5d&��@s�dZddlTdZdZed�Zed�Zed�Zed�Zed	�Z	ee
eh�Zee
eeeeeh�Zeed
�feed�feed�feed
�feed�feed�feed�feed�fd�Zeefeefeefeeefgfeeefgfeeefgfeeefgfeeefgfeeefgfee fd�
Z!e"e#e$e%e&e'e(e)d�Z*e'e#Be)BZ+e,e(BZ-Gdd�de.�Z/Gdd�d�Z0Gdd�d�Z1Gdd�d�Z2dd�Z3dd �Z4d!d"�Z5d#d$�Z6d3d&d'�Z7d(d)�Z8d*d+�Z9d4d-d.�Z:d/d0�Z;d1d2�Z<d,S)5zInternal support module for sre�)�*z.\[{()*+?^$|z*+?{�
0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz 	

����
�
�	��\)z\a�\bz\fz\nz\rz\tz\vz\\)
z\Arz\Bz\dz\Dz\sz\Sz\wz\Wz\Z)�i�L�m�s�x�a�t�uc@seZdZdS)�VerboseN)�__name__�
__module__�__qualname__�rr�!/usr/lib64/python3.8/sre_parse.pyrGsrc@sBeZdZdd�Zedd��Zddd�Zdd	�Zd
d�Zdd
�Z	dS)�StatecCsd|_i|_dg|_d|_dS)Nr)�flags�	groupdict�groupwidths�lookbehindgroups��selfrrr�__init__LszState.__init__cCs
t|j�S�N)�lenrr rrr�groupsQszState.groupsNcCsb|j}|j�d�|jtkr$td��|dk	r^|j�|d�}|dk	rTtd|||f��||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)r%r�append�	MAXGROUPS�errorr�get)r!�name�gid�ogidrrr�	opengroupTs
�
zState.opengroupcCs|��|j|<dSr#)�getwidthr)r!r+�prrr�
closegroup`szState.closegroupcCs||jko|j|dk	Sr#)r%r)r!r+rrr�
checkgroupbszState.checkgroupcCs6|jdk	r2|�|�s|�d��||jkr2|�d��dS)N�cannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr1r()r!r+�sourcerrr�checklookbehindgroupes




zState.checklookbehindgroup)N)
rrrr"�propertyr%r-r0r1r4rrrrrJs

rc@s`eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
SubPatternNcCs"||_|dkrg}||_d|_dSr#)�state�data�width)r!r7r8rrrr"os
zSubPattern.__init__rcCs�d}ttf}|jD�]t\}}t|dt|�dd�|tkrlt�|D]"\}}t|ddt|�|�qFq|tkr�t�t|d�D]*\}}|r�t|dd�|�|d�q�q|t	k�r|\}}	}
td|�|	�|d�|
�r�t|dd�|
�|d�qt
||��r~d}|D]T}t
|t��rJ|�s6t�|�|d�d}n"|�s\td	dd�t|dd�d}�q|�s�t�qtd|�qdS)
NTz  �)�end��OR�ELSEF� )�tuple�listr8�print�str�IN�BRANCH�	enumerate�dump�GROUPREF_EXISTS�
isinstancer6)r!�level�nl�seqtypes�op�avrr
�	condgroup�item_yes�item_norrrrGvsH


zSubPattern.dumpcCs
t|j�Sr#)�reprr8r rrr�__repr__�szSubPattern.__repr__cCs
t|j�Sr#)r$r8r rrr�__len__�szSubPattern.__len__cCs|j|=dSr#�r8�r!�indexrrr�__delitem__�szSubPattern.__delitem__cCs&t|t�rt|j|j|�S|j|Sr#)rI�slicer6r7r8rVrrr�__getitem__�s
zSubPattern.__getitem__cCs||j|<dSr#rU�r!rW�coderrr�__setitem__�szSubPattern.__setitem__cCs|j�||�dSr#)r8�insertr[rrrr^�szSubPattern.insertcCs|j�|�dSr#)r8r&)r!r\rrrr&�szSubPattern.appendc	Cs�|jdk	r|jSd}}|jD�]�\}}|tkr|td}d}|dD]$}|��\}}t||�}t||�}qD||}||}q|tkr�|��\}}||}||}q|tkr�|d��\}}||}||}q|t	k�r|d��\}}|||d}|||d}q|t
k�r$|d}|d}q|tk�rP|jj
|\}}||}||}q|tk�r�|d��\}}|ddk	�r�|d��\}}t||�}t||�}nd}||}||}q|tkr�q�qt|td�t|t�f|_|jS)Nrr<����)r9r8rE�	MAXREPEATr.�min�max�CALL�
SUBPATTERN�_REPEATCODES�
_UNITCODES�GROUPREFr7rrH�SUCCESS)	r!�lo�hirMrNr
�j�l�hrrrr.�sZ












zSubPattern.getwidth)N)r)
rrrr"rGrSrTrXrZr]r^r&r.rrrrr6ms

(r6c@sbeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	d
d��Z
dd�Zdd�Zddd�Z
dS)�	TokenizercCs@t|t�|_||_|js"t|d�}||_d|_d|_|��dS)N�latin1r)rIrC�istext�string�decoded_stringrW�next�_Tokenizer__next)r!rrrrrr"�s
zTokenizer.__init__cCs�|j}z|j|}Wntk
r0d|_YdSX|dkr�|d7}z||j|7}Wn.tk
r�td|jt|j�d�d�YnX|d|_||_dS)Nrr<zbad escape (end of pattern))rWrs�
IndexErrorrtr(rrr$)r!rW�charrrr�__next�s&��
zTokenizer.__nextcCs||jkr|��dSdS)NTF�rtru)r!rwrrr�match�s
zTokenizer.matchcCs|j}|��|Sr#ry)r!�thisrrrr)�sz
Tokenizer.getcCs8d}t|�D]&}|j}||kr"q4||7}|��q|S�Nr:)�rangertru)r!�n�charset�result�_�crrr�getwhiles
zTokenizer.getwhilecCsld}|j}|��|dkr@|s,|�d|��|�d|t|���||kr^|sh|�d|d��qh||7}q|S)Nr:zmissing zmissing %s, unterminated namer<)rtrur(r$)r!�
terminatorr*r�r�rrr�getuntils
�
zTokenizer.getuntilcCs|jt|jpd�Sr|�rWr$rtr rrr�possz
Tokenizer.poscCs|jt|jpd�Sr|r�r rrr�tellszTokenizer.tellcCs||_|��dSr#)rWrurVrrr�seek szTokenizer.seekrcCst||j|��|�Sr#)r(rrr�)r!�msg�offsetrrrr($szTokenizer.errorN)r)rrrr"rurzr)r�r�r5r�r�r�r(rrrrro�s		
roc	Cs�t�|�}|r|St�|�}|r0|dtkr0|S�zJ|dd�}|dkr�||�dt�7}t|�dkrx|�d|t|���tt	|dd�d�fWS|dkr�|j
r�||�dt�7}t|�d	kr�|�d|t|���tt	|dd�d�fWS|d
k�rN|j
�rN||�dt�7}t|�dk�r*|�d|t|���t	|dd�d�}t|�t|fWS|d
k�r�|j
�r�ddl}|�
d��s~|�d��|�dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|tk�r.||�dt�7}t	|dd�d�}|dk�r$|�d|t|���t|fWS|tk�r<t�t|�dk�rz|tk�rh|�d|t|���tt|d�fWSWntk
�r�YnX|�d|t|���dS)Nrr<r`r��incomplete escape %s�r��U��
�N�{�	missing {�}�character name�undefined character name %r�\N{}��.octal escape value %s outside of range 0-0o377�
bad escape %s)�ESCAPESr)�
CATEGORIESrDr��	HEXDIGITSr$r(�LITERAL�intrq�chr�unicodedatarzr��ord�lookup�KeyError�	OCTDIGITS�DIGITS�
ValueError�ASCIILETTERS)r3�escaper\r�r��charnamerrr�
_class_escape'sp




�



��


r�c	Csft�|�}|r|St�|�}|r$|S�z|dd�}|dkr�||�dt�7}t|�dkrl|�d|t|���tt|dd�d�fWS|dkr�|j	r�||�dt�7}t|�dkr�|�d|t|���tt|dd�d�fWS|d	k�rB|j	�rB||�d
t�7}t|�dk�r|�d|t|���t|dd�d�}t
|�t|fWS|dk�r�|j	�r�d
dl}|�d��sr|�d��|�
dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|dk�r||�dt�7}tt|dd�d
�fWS|tk�r�|jtk�r�||��7}|dtk�r�|dtk�r�|jtk�r�||��7}t|dd�d
�}|dk�r�|�d|t|���t|fWSt|dd��}||jk�r�|�|��s�|�dt|���|�||�t|fWS|�d|t|�d��t|�dk�r4|tk�r"|�d|t|���tt|d�fWSWntk
�rLYnX|�d|t|���dS)Nr<r`rr�r�r�rr�r�r�r�r�rr�r�r�r�r�r��0r�r�r2�invalid group reference %dr�)r�r)r�r�r�r$r(r�r�rqr�r�rzr�r�r�r�r�r�rtr%r1r4rhr�r�)r3r�r7r\r�r�r��grouprrr�_escapecs�




�



�
��
�

r�cCstt�|��Sr#)rA�dict�fromkeys)�itemsrrr�_uniq�sr�cCsVg}|j}|j}|��}|t||||d|o2|��|d�sqDqt|�dkrX|dSt|�}d}	|D].}
|
stq�|	dkr�|
d}	qh|
d|	krhq�qh|D]
}
|
d=q�|�|	�q`q�q`g}|D]h}
t|
�dkr��q@|
d\}}
|tkr�|�||
f�q�|tk�r"|
ddtk	�r"|�	|
�q��q@q�|�tt
|�f�|S|�td|ff�|S)Nr<�|r)r&rzr��_parser$r6r�rD�NEGATE�extendr�rE)r3r7�verbose�nestedr��itemsappend�sourcematch�start�
subpattern�prefix�item�setrMrNrrr�
_parse_sub�sN
�

r�Fc/
Cs�t|�}|j}|j}|j}t}	t}
|j}|dkr4�q*|dkr@�q*|�|rx|tkrTq"|dkrx|�}|dksv|dkr\q"q\q"|ddkr�t|||�}||�q"|t	kr�|t
|
|�f�q"|dk�r�|��d}
g}|j}|jdk�rddl}|j
d|��t|d	d
�|d�}|�}|dk�r0|�d|��|
��|d
k�rF|�rF�qbn�|ddk�r`t||�}n~|�r�|dk�r�|j|k�r�ddl}|j
d|dk�r�dn|dk�r�dn|dk�r�dnd|��dft|d	d
�t
|
|�f}|d��r<|�}|dk�r|�d|��|
��|d
k�rL|dtk�r0|dd}||�|t
|
d�f��qb|ddk�rft||�}n>|dk�r�ddl}|j
d|��dt|d	d
�t
|
|�f}|dt
k�s�|dt
k�r�d||f}|�|t|�dt|���|d}|d}||k�r*d||f}|�|t|�dt|���|t||ff�n"|dtk�rV|dd}||��qt|�}|	|�dk�r�|ddt
k�r�|�r�|t|ddf�n||d�n"|�r�|�dtdf�|t|f�q"|tk�r.|��}
|dk�rd\}}�nB|dk�rdt}}�n*|dk�r0dt}}�n|dk�r4|jdk�rX|t
|
|�f�q"dt}}d }}|jtk�r�||�7}�qj|d!��r�|jtk�r�||�7}�q�n|}|d��s�|t
|
|�f�|�|
�q"|�r�t|�}|tk�r�td"��|�rBt|�}|tk�rtd"��||k�rB|�d#|��|
��ntd$|f��|�rV|d%d�}nd}|�rr|ddtk�r�|�d&|��|
t|���|ddtk�r�|�d'|��|
t|���|ddt k�r�|dd\}}}}|dk�r�|�s�|�s�|}|d��rt!|||ff|d%<nt"|||ff|d%<q"|d(k�rF|t#df�q"|d)k�r�|��d} d*}d}!d}d}|d��r|�}|dk�r�|�d+��|d,k�r�|d-��r�|�$d.d/�}!|!�%��s�d0|!}|�|t|!�d��n�|d1��r�|�$d2d/�}!|!�%��sd0|!}|�|t|!�d��|j&�|!�}"|"dk�rFd3|!}|�|t|!�d��|�'|"��sf|�d4t|!�d��|�(|"|�|t)|"f�q"n2|�}|dk�r�|�d+��|�d5|t|�d���nd|d6k�r�d}�nR|dk�r|jdk�r�|�d7|��| ��|�d2k�r�q"�q�q"�n|d8k�r�d}#|d-k�r||�}|dk�r>|�d+��|d9k�r`|�d:|t|�d��d%}#|j*}$|$dk�r||j+|_*t,||||d�}|#dk�r�|$dk�r�d|_*|d2��s�|�d;|��| ��|d1k�r�|t-|#|ff�q"|t.|#|ff�q"�n$|d)k�
rj|�$d2d/�}%|%�%��	rL|j&�|%�}&|&dk�	r�d3|%}|�|t|%�d��n�zt|%�}&|&dk�	rdt/�Wn4t/k
�	r�d0|%}|�|t|%�d�d�YnX|&�	s�|�d<t|%�d��|&t0k�	r�d=|&}|�|t|%�d��|�(|&|�t1||||d�}'|�d>��
r0t1||||d�}(|jd>k�
r4|�d?��nd}(|�d2��
sT|�d;|��| ��|t2|&|'|(ff�q"n�|t3k�
s~|dk�rt4|||�})|)dk�
r�|�
r�|�
r�ddl}|j
d@|j5ddA�t|j5�dAk�
r�dBnd ft6|d	d
�|j7t8@r"|s"t9�q"|)\}}d}n|�dC|t|�d��|dk	�rrz|�:|!�}Wn<tk
�rp}*z|�|*j;t|!�d�d�W5d}*~*XYnX|�s�|t8@�o�|t8@}+t,|||+|d�}|�d2��s�|�d;|��| ��|dk	�r�|�<||�|t ||||ff�q"|dk�r|tt=f�q"|dDk�r|tt>f�q"tdE|f��q"t?t|��ddd%�D]N},||,\}-}.|-t k�r@|.\}}}}|dk�r@|�s@|�s@|||,|,d�<�q@|S)FNz|)�#rrr�[r<z"Possible nested set at position %dr�)�
stacklevel�^zunterminated character set�]z-&~|zPossible set %s at position %d�-�
difference�&�intersection�~zsymmetric difference�unionz&Possible set difference at position %dr`zbad character range %s-%s�?)rr<r�+r�r�r:�,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rr_znothing to repeatzmultiple repeat�.�(Tzunexpected end of pattern�P�<�>�
group name�bad character in group name %r�=�)�unknown group name %rr2zunknown extension ?P�:zmissing ), unterminated commentz=!<z=!zunknown extension ?<z"missing ), unterminated subpatternzbad group numberr�r�z/conditional backref with more than two branchesz-Flags not at the start of the expression %r%s�z (truncated)zunknown extension ?�$z unsupported special character %r)@r6r&r)rzr$r�rt�
WHITESPACEr��
SPECIAL_CHARSr�r��warnings�warn�
FutureWarningr(r�rD�RANGEr��NOT_LITERALr^r��REPEAT_CHARSrar�r�r��
OverflowError�AssertionError�ATrfre�
MIN_REPEAT�
MAX_REPEAT�ANYr��isidentifierrr1r4rhrr%r��ASSERT�
ASSERT_NOTr�r'r�rH�FLAGS�_parse_flagsrr�DeprecationWarningr�SRE_FLAG_VERBOSErr-r�r0�AT_BEGINNING�AT_ENDr})/r3r7r�r��firstr��subpatternappend�	sourcegetr��_len�_ordr{r\�herer��	setappendr��negate�code1�that�code2r�rjrkrbrcrwr�r��	add_flags�	del_flagsr/r�r*r+�dirr�condnamerOrPrQr�err�sub_verboser
rMrNrrrr��s|


�

�
��	


�


��
 












���












�



�


�






�




�





�

�
��

�
*�
�



r�cCs|j}d}d}|dkr�t|}|jr<|dkrRd}|�|��n|dkrRd}|�|��||O}|t@r||t@|kr|d}|�|��|�}|dkr�|�d��|d	kr�q�|tkr|��r�d
nd}|�|t|���q|dkr�|j|O_dS|t@r�|�dd
��|dk�r�|�}|dk�r|�d��|tk�rF|���r2d
nd}|�|t|���t|}|t@�rfd}|�|��||O}|�}|dk�r�|�d��|dk�r��q�|tk�rF|���r�d
nd}|�|t|����qF|dk�s�t	�|t@�r�|�dd
��||@�r|�dd
��||fS)Nrr�rz8bad inline flags: cannot use 'L' flag with a str patternrz:bad inline flags: cannot use 'u' flag with a bytes patternz9bad inline flags: flags 'a', 'u' and 'L' are incompatiblezmissing -, : or )z)-:zunknown flagr�z,bad inline flags: cannot turn on global flagr<zmissing flagz8bad inline flags: cannot turn off flags 'a', 'u' and 'L'z	missing :r�z-bad inline flags: cannot turn off global flagz(bad inline flags: flag turned on and off)
r)r�rqr(�
TYPE_FLAGS�isalphar$r�GLOBAL_FLAGSr�)r3r7rwr�rr�flagr�rrrr�]sn














r�cCsjt|t�r>|t@rtd��|t@s,|tO}qf|t@rftd��n(|t@rNtd��|t@rf|t@rftd��|S)Nz)cannot use LOCALE flag with a str patternz(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz'ASCII and LOCALE flags are incompatible)rIrC�SRE_FLAG_LOCALEr��SRE_FLAG_ASCII�SRE_FLAG_UNICODE)�srcrrrr�	fix_flags�s


rNcCs�t|�}|dkrt�}||_||_zt|||t@d�}WnBtk
rzt�}|tB|_||_|�d�t||dd�}YnXt||j	j�|j	_|j
dk	r�|j
dks�t�|�d��|t
@r�|��|S)NrTr�zunbalanced parenthesis)rorrrCr�r�rr�rr7rtr�r(�SRE_FLAG_DEBUGrG)rCrr7r3r/rrr�parse�s(



rcs�t|���j}g�g�g��j}�����fdd�}�j}|�}|dkrL�q�|ddk�r�|d}|dk�rJd}��d�s���d	����d
d�}|��r�z||}	Wn tk
r�t	d|��YnXnlzt
|�}	|	dkr�t�Wn0tk
�r��d
|t|�d�d�YnX|	t
k�r4��d|	t|�d��||	t|�d��q�|dk�r��jtk�r�||�7}�jtk�r�||�7}|tt
|dd�d�d@���q�|tk�rZd}
�jtk�r4||�7}|tk�r4|dtk�r4�jtk�r4||�7}d}
t
|dd�d�}|dk�r(��d|t|���|t|��|
�s�|t
|dd��t|�d�nRztt|d�}Wn4tk
�r�|tk�r���d|t|���YnX||�q:||�q:��rΈ�d����t|t��s�dd��D����fS)NcsX|�jkr��d||���r8��d�����dd�=��t��|f���d�dS)Nr�r:)r%r(r&�joinr$)rWr��r%�literal�literalsrr7rr�addgroup�s

z parse_template.<locals>.addgrouprrr<�gr:r�z	missing <r�r�r�r�r�r�r�r�Fr`Tr�r�cSs"g|]}|dkrdn|�d��qS)Nzlatin-1)�encode)�.0rrrr�
<listcomp>sz"parse_template.<locals>.<listcomp>)ror)r&�
groupindexrzr(r�r�r�rvr�r�r$r'rtr�r�r�r�r�rrIrC)r3r7�sget�lappendrrr{r�r*rW�isoctalrrr�parse_template�s�




��


�


"

�

�� 


rcCsv|j}|jdd�}|\}}|dd�}z"|D]\}}||�p@|||<q.Wn tk
rjtd|��YnX|�|�S)Nrr�)r�rrrvr(r)�templaterzr�emptyr%rrWr�rrr�expand_templatesr")F)rN)=�__doc__�
sre_constantsr�r��	frozensetr�r�r�r�r�r�r�rfr�r�rDr�r��CATEGORYrgr�r�r�ZAT_BEGINNING_STRINGZAT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_NOT_WORDZ
AT_END_STRINGr��SRE_FLAG_IGNORECASEr�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALLr�r�SRE_FLAG_TEMPLATEr
r�rrr	�	Exceptionrrr6ror�r�r�r�r�r�rrrr"rrrr�<module>sr







���
#rH<M:
r<
 Uaifc.cpython-38.opt-1.pyc000064400000061604151450073350011047 0ustar00U

e5d.��
@sBdZddlZddlZddlZdddgZGdd�de�ZdZdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zdd!lmZdd"lmZed#d$�Zd%ej_d&ej_d'ej_d(ej_d)ej_d*ej_Gd+d,�d,�Z Gd-d.�d.�Z!dAd/d�Z"dBd0d�Z#e$d1k�r>ddl%Z%e%j&d2d��sNe%j&�'d3�e%j&d2Z(e"e(d4���Z)e*d5e(�e*d6e)�+��e*d7e)�,��e*d8e)�-��e*d9e)�.��e*d:e)�/��e*d;e)�0��e%j&d<d��r4e%j&d<Z1e*d=e1�e"e1d>��6Z2e2�3e)�4��e)�5d?�Z6e6�s�q"e2�7e6��qW5QRXe*d@�W5QRXdS)CaJStuff to parse AIFF-C and AIFF files.

Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.

An AIFF-C file has the following structure.

  +-----------------+
  | FORM            |
  +-----------------+
  | <size>          |
  +----+------------+
  |    | AIFC       |
  |    +------------+
  |    | <chunks>   |
  |    |    .       |
  |    |    .       |
  |    |    .       |
  +----+------------+

An AIFF file has the string "AIFF" instead of "AIFC".

A chunk consists of an identifier (4 bytes) followed by a size (4 bytes,
big endian order), followed by the data.  The size field does not include
the size of the 8 byte header.

The following chunk types are recognized.

  FVER
      <version number of AIFF-C defining document> (AIFF-C only).
  MARK
      <# of markers> (2 bytes)
      list of markers:
          <marker ID> (2 bytes, must be > 0)
          <position> (4 bytes)
          <marker name> ("pstring")
  COMM
      <# of channels> (2 bytes)
      <# of sound frames> (4 bytes)
      <size of the samples> (2 bytes)
      <sampling frequency> (10 bytes, IEEE 80-bit extended
          floating point)
      in AIFF-C files only:
      <compression type> (4 bytes)
      <human-readable version of compression type> ("pstring")
  SSND
      <offset> (4 bytes, not used by this program)
      <blocksize> (4 bytes, not used by this program)
      <sound data>

A pstring consists of 1 byte length, a string of characters, and 0 or 1
byte pad to make the total length even.

Usage.

Reading AIFF files:
  f = aifc.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
In some types of audio files, if the setpos() method is not used,
the seek() method is not necessary.

This returns an instance of a class with the following public methods:
  getnchannels()  -- returns number of audio channels (1 for
             mono, 2 for stereo)
  getsampwidth()  -- returns sample width in bytes
  getframerate()  -- returns sampling frequency
  getnframes()    -- returns number of audio frames
  getcomptype()   -- returns compression type ('NONE' for AIFF files)
  getcompname()   -- returns human-readable version of
             compression type ('not compressed' for AIFF files)
  getparams() -- returns a namedtuple consisting of all of the
             above in the above order
  getmarkers()    -- get the list of marks in the audio file or None
             if there are no marks
  getmark(id) -- get mark with the specified id (raises an error
             if the mark does not exist)
  readframes(n)   -- returns at most n frames of audio
  rewind()    -- rewind to the beginning of the audio stream
  setpos(pos) -- seek to the specified position
  tell()      -- return the current position
  close()     -- close the instance (make it unusable)
The position returned by tell(), the position given to setpos() and
the position of marks are all compatible and have nothing to do with
the actual position in the file.
The close() method is called automatically when the class instance
is destroyed.

Writing AIFF files:
  f = aifc.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
  aiff()      -- create an AIFF file (AIFF-C default)
  aifc()      -- create an AIFF-C file
  setnchannels(n) -- set the number of channels
  setsampwidth(n) -- set the sample width
  setframerate(n) -- set the frame rate
  setnframes(n)   -- set the number of frames
  setcomptype(type, name)
          -- set the compression type and the
             human-readable compression type
  setparams(tuple)
          -- set all parameters at once
  setmark(id, pos, name)
          -- add specified mark to the list of marks
  tell()      -- return current position in output file (useful
             in combination with setmark())
  writeframesraw(data)
          -- write audio frames without pathing up the
             file header
  writeframes(data)
          -- write audio frames and patch up the file header
  close()     -- patch up the file header and close the
             output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
Marks can be added anytime.  If there are any marks, you must call
close() after all frames have been written.
The close() method is called automatically when the class instance
is destroyed.

When a file is opened with the extension '.aiff', an AIFF file is
written, otherwise an AIFF-C file is written.  This default can be
changed by calling aiff() or aifc() before the first writeframes or
writeframesraw.
�N�Error�open�openfpc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/aifc.pyr�sl@QEcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>l�r��structZunpack�read�error�EOFError��filerrr	�
_read_long�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Lrrrrrrr	�_read_ulong�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>h�rrrrrr	�_read_short�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Hrrrrrrr	�_read_ushort�srcCs@t|�d��}|dkrd}n
|�|�}|d@dkr<|�d�}|S)N�r�)�ordr)r�length�data�dummyrrr	�_read_string�s

r!g�����cCs�t|�}d}|dkr d}|d}t|�}t|�}||krN|krNdkrXnnd}n0|dkrft}n"|d}|d|td	|d
�}||S)Nrr�����g�i�?lg@�?)rr�	_HUGE_VAL�pow)�f�expon�sign�himant�lomantrrr	�_read_float�s"r-cCs|�t�d|��dS)Nr��writer
�pack�r(�xrrr	�_write_short�sr3cCs|�t�d|��dS)Nrr.r1rrr	�
_write_ushort�sr4cCs|�t�d|��dS)Nr
r.r1rrr	�_write_long�sr5cCs|�t�d|��dS)Nrr.r1rrr	�_write_ulong�sr6cCsRt|�dkrtd��|�t�dt|���|�|�t|�d@dkrN|�d�dS)N�z%string exceeds maximum pstring length�Brr�)�len�
ValueErrorr/r
r0)r(�srrr	�
_write_string�s
r=c	Cs�ddl}|dkrd}|d}nd}|dkr8d}d}d}n�|�|�\}}|dks^|dks^||krp|dB}d}d}nh|d}|dkr�|�||�}d}||B}|�|d�}|�|�}t|�}|�||d�}|�|�}t|�}t||�t||�t||�dS)	Nrr#r"i@rr$i�?� )�mathZfrexpZldexpZfloor�intr4r6)	r(r2r?r*r)r+r,ZfmantZfsmantrrr	�_write_float�s8




rA)�Chunk)�
namedtuple�_aifc_paramsz7nchannels sampwidth framerate nframes comptype compnamez3Number of audio channels (1 for mono, 2 for stereo)zSample width in byteszSampling frequencyzNumber of audio framesz(Compression type ("NONE" for AIFF files)zRA human-readable version of the compression type
('not compressed' for AIFF files)c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�ZdS)2�	Aifc_readNcCs8d|_d|_g|_d|_||_t|�}|��dkr:td��|�d�}|dkrTd|_	n|dkrdd|_	ntd��d|_
d|_d|_zt|j�}Wnt
k
r�Y�qYnX|��}|d	kr�|�|�d|_
nH|d
kr�||_|�d�}d|_n(|dkr�t|�|_n|d
k�r|�|�|��qx|j
�r,|j�s4td��dS)Nr�FORMz file does not start with FORM idr�AIFF�AIFCrznot an AIFF or AIFF-C file�COMM�SSND��FVER�MARKz$COMM chunk and/or SSND chunk missing)�_version�_convert�_markers�	_soundpos�_filerBZgetnamerr�_aifcZ_comm_chunk_read�_ssnd_chunk�_ssnd_seek_neededr�_read_comm_chunkr�	_readmark�skip)�selfr�chunkZformdataZ	chunknamer rrr	�initfp4sH





zAifc_read.initfpcCsLt|t�r>t�|d�}z|�|�WqH|���YqHXn
|�|�dS)N�rb)�
isinstance�str�builtinsrr[�close�rYr(Zfile_objectrrr	�__init__\s

zAifc_read.__init__cCs|S�Nr�rYrrr	�	__enter__hszAifc_read.__enter__cGs|��dSrc�r`�rY�argsrrr	�__exit__kszAifc_read.__exit__cCs|jSrc)rRrdrrr	�getfpqszAifc_read.getfpcCsd|_d|_dS)Nrr)rUrQrdrrr	�rewindtszAifc_read.rewindcCs |j}|dk	rd|_|��dSrc)rRr`�rYrrrr	r`xszAifc_read.closecCs|jSrc)rQrdrrr	�tell~szAifc_read.tellcCs|jSrc)�
_nchannelsrdrrr	�getnchannels�szAifc_read.getnchannelscCs|jSrc)�_nframesrdrrr	�
getnframes�szAifc_read.getnframescCs|jSrc)�
_sampwidthrdrrr	�getsampwidth�szAifc_read.getsampwidthcCs|jSrc)�
_frameraterdrrr	�getframerate�szAifc_read.getframeratecCs|jSrc��	_comptyperdrrr	�getcomptype�szAifc_read.getcomptypecCs|jSrc��	_compnamerdrrr	�getcompname�szAifc_read.getcompnamecCs*t|��|��|��|��|��|���Src)rDrorsrurqrxr{rdrrr	�	getparams�s�zAifc_read.getparamscCst|j�dkrdS|jS�Nr�r:rPrdrrr	�
getmarkers�szAifc_read.getmarkerscCs2|jD]}||dkr|Sqtd�|���dS�Nrzmarker {0!r} does not exist�rPr�format�rY�id�markerrrr	�getmark�s

zAifc_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)rprrQrU)rY�posrrr	�setpos�szAifc_read.setposcCs�|jrD|j�d�|j�d�}|j|j}|r>|j�|d�d|_|dkrPdS|j�||j�}|jrv|rv|�|�}|jt|�|j|j	|_|S)NrrKr)
rUrT�seekrrQ�
_framesizerOr:rnrr)rY�nframesr r�rrrr	�
readframes�s 

�
zAifc_read.readframescCsddl}|�|d�S�Nrr)�audioopZalaw2lin�rYrr�rrr	�	_alaw2lin�szAifc_read._alaw2lincCsddl}|�|d�Sr�)r�Zulaw2linr�rrr	�	_ulaw2lin�szAifc_read._ulaw2lincCs2ddl}t|d�sd|_|�|d|j�\}|_|S�Nr�_adpcmstater)r��hasattrr�Z	adpcm2linr�rrr	�
_adpcm2lin�s

zAifc_read._adpcm2lincCsVt|�|_t|�|_t|�dd|_tt|��|_|jdkrFtd��|jdkrXtd��|j|j|_	|j
�rFd}|jdkr�d}t�
d�d	|_|�d
�|_|r�t|j�d��}|d@dkr�|d}|j||_|j�dd�t|�|_|jdk�rR|jd
k�r
|j|_n4|jdk�r |j|_n|jdk�r6|j|_ntd��d|_nd|_d|_dS)N�rKr�bad sample width�bad # of channels�rzWarning: bad COMM chunk size�rr"�NONE�G722��ulaw�ULAW��alaw�ALAW�unsupported compression typer�not compressed)rrnrrprrr@r-rtrr�rSZ	chunksize�warnings�warnrrwrrr�r!rzr�rOr�r�)rYrZZkludgerrrr	rV�sD









zAifc_read._read_comm_chunkcCs�t|�}zDt|�D]6}t|�}t|�}t|�}|s6|r|j�|||f�qWnDtk
r�dt|j�t|j�dkrxdnd|f}t�	|�YnXdS)Nz;Warning: MARK chunk contains only %s marker%s instead of %sr�r<)
r�rangerr!rP�appendrr:r�r�)rYrZZnmarkers�ir�r��name�wrrr	rW�s��zAifc_read._readmark)rrrrRr[rbrerirjrkr`rmrorqrsrurxr{r|rr�r�r�r�r�r�rVrWrrrr	rEs2$(*rEc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dS)J�
Aifc_writeNcCs\t|t�rNt�|d�}z|�|�Wn|���YnX|�d�rXd|_n
|�|�dS)N�wbz.aiffr)r]r^r_rr[r`�endswithrSrarrr	rb/s

zAifc_write.__init__cCs^||_t|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_g|_
d|_d|_dS)Nr�r�rr)rR�
_AIFC_versionrNrwrzrOrnrrrtrp�_nframeswritten�_datawritten�_datalengthrP�_marklengthrSrlrrr	r[?szAifc_write.initfpcCs|��dSrcrfrdrrr	�__del__PszAifc_write.__del__cCs|Srcrrdrrr	reSszAifc_write.__enter__cGs|��dSrcrfrgrrr	riVszAifc_write.__exit__cCs|jrtd��d|_dS)N�0cannot change parameters after starting to writer�r�rrSrdrrr	�aiff\szAifc_write.aiffcCs|jrtd��d|_dS)Nr�rr�rdrrr	�aifcaszAifc_write.aifccCs(|jrtd��|dkrtd��||_dS)Nr�rr�)r�rrn)rY�	nchannelsrrr	�setnchannelsfs
zAifc_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rnrrdrrr	romszAifc_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nr�rrr�)r�rrr)rY�	sampwidthrrr	�setsampwidthrs
zAifc_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)rrrrdrrr	rsyszAifc_write.getsampwidthcCs(|jrtd��|dkrtd��||_dS)Nr�rzbad frame rate)r�rrt)rY�	frameraterrr	�setframerate~s
zAifc_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rtrrdrrr	ru�szAifc_write.getframeratecCs|jrtd��||_dS)Nr�)r�rrp)rYr�rrr	�
setnframes�szAifc_write.setnframescCs|jSrc�r�rdrrr	rq�szAifc_write.getnframescCs.|jrtd��|dkrtd��||_||_dS�Nr�)r�r�r�r�r�r�r�)r�rrwrz)rY�comptype�compnamerrr	�setcomptype�szAifc_write.setcomptypecCs|jSrcrvrdrrr	rx�szAifc_write.getcomptypecCs|jSrcryrdrrr	r{�szAifc_write.getcompnamecCsf|\}}}}}}|jrtd��|dkr.td��|�|�|�|�|�|�|�|�|�||�dSr�)r�rr�r�r�r�r�)rYZparamsr�r�r�r�r�r�rrr	�	setparams�s



zAifc_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)rnrrrtrrDrprwrzrdrrr	r|�s�zAifc_write.getparamscCs�|dkrtd��|dkr td��t|t�s2td��tt|j��D],}||j|dkr@|||f|j|<dSq@|j�|||f�dS)Nrzmarker ID must be > 0zmarker position must be >= 0zmarker name must be bytes)rr]�bytesr�r:rPr�)rYr�r�r�r�rrr	�setmark�s
zAifc_write.setmarkcCs2|jD]}||dkr|Sqtd�|���dSr�r�r�rrr	r��s

zAifc_write.getmarkcCst|j�dkrdS|jSr}r~rdrrr	r�szAifc_write.getmarkerscCs|jSrcr�rdrrr	rm�szAifc_write.tellcCszt|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|j
�|�|j||_|j
t|�|_
dS)Nr8)r]r��	bytearray�
memoryview�cast�_ensure_header_writtenr:rrrnrOrRr/r�r�)rYrr�rrr	�writeframesraw�s
zAifc_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSrc)r�r�rpr�r��_patchheader)rYrrrr	�writeframes�s


�zAifc_write.writeframescCs�|jdkrdSz^|�d�|jd@r<|j�d�|jd|_|��|j|jksb|j	|jksb|j
rj|��W5d|_|j}d|_|��XdS)Nrrr9)rRrOr`r�r�r/�
_writemarkersr�rpr�r�r�)rYr(rrr	r`�s$



��zAifc_write.closecCsddl}|�|d�Sr�)r�Zlin2alawr�rrr	�	_lin2alaw�szAifc_write._lin2alawcCsddl}|�|d�Sr�)r�Zlin2ulawr�rrr	�	_lin2ulawszAifc_write._lin2ulawcCs2ddl}t|d�sd|_|�|d|j�\}|_|Sr�)r�r�r�Z	lin2adpcmr�rrr	�
_lin2adpcms

zAifc_write._lin2adpcmcCsf|jsb|jdkr.|jsd|_|jdkr.td��|js<td��|jsJtd��|jsXtd��|�|�dS)N�r�r�r�r�r�rzRsample width must be 2 when compressing with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)z# channels not specifiedzsample width not specifiedzsampling rate not specified)r�rwrrrrnrt�
_write_header)rYZdatasizerrr	r�
s

z!Aifc_write._ensure_header_writtencCs>|jdkr|j|_n&|jdkr(|j|_n|jdkr:|j|_dS)Nr�r�r�)rwr�rOr�r�rdrrr	�_init_compressions




zAifc_write._init_compressionc	CsJ|jr|jdkr|��|j�d�|js<||j|j|_|j|j|j|_|jd@rf|jd|_|jr�|jdkr�|jd|_|jd@r�|jd|_n0|jdkr�|jdd|_|jd@r�|jd|_z|j�	�|_
Wnttfk
r�d|_
YnX|�
|j�}|j�rB|j�d	�|j�d
�t|jd�t|j|j�n|j�d�|j�d�t|j|�t|j|j�|j
dk	�r�|j�	�|_t|j|j�|jd
k�r�t|jd�nt|j|jd�t|j|j�|j�r�|j�|j�t|j|j�|j�d�|j
dk	�r|j�	�|_t|j|jd�t|jd�t|jd�dS)Nr�rFr)r�r�r�r�rr��rrHrLrGrIr�rKrJr)rSrwr�rRr/rprnrrr�rm�_form_length_pos�AttributeError�OSError�_write_form_lengthr6rNr3�_nframes_posrArtr=rz�_ssnd_length_pos)rYZ
initlength�
commlengthrrr	r�%s^




zAifc_write._write_headercCs\|jr*dt|j�}|d@r$|d}d}nd}d}t|jd||jd|d|�|S)	Nr�r�r�rrrK�)rSr:rzr6rRr�)rY�
datalengthr�Z
verslengthrrr	r�Xs"����zAifc_write._write_form_lengthcCs�|j��}|jd@r,|jd}|j�d�n|j}||jkrd|j|jkrd|jdkrd|j�|d�dS|j�|j	d�|�
|�}|j�|jd�t|j|j�|j�|j
d�t|j|d�|j�|d�|j|_||_dS)Nrr9rrK)rRrmr�r/r�rpr�r�r�r�r�r�r6r�)rYZcurposr�r rrr	r�es*




��
zAifc_write._patchheadercCs�t|j�dkrdS|j�d�d}|jD]:}|\}}}|t|�dd}t|�d@dkr(|d}q(t|j|�|d|_t|jt|j��|jD]2}|\}}}t|j|�t|j|�t|j|�q�dS)NrrMrr�rK)r:rPrRr/r6r�r3r=)rYrr�r�r�r�rrr	r�{s"





zAifc_write._writemarkers)(rrrrRrbr[r�rerir�r�r�ror�rsr�rur�rqr�rxr{r�r|r�r�rrmr�r�r`r�r�r�r�r�r�r�r�r�rrrr	r�sJ	

3
r�cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder\)�rr\)r�r�z$mode must be 'r', 'rb', 'w', or 'wb')r�r�rEr�r�r(r�rrr	r�s
cCstjdtdd�t||d�S)NzBaifc.openfp is deprecated since Python 3.7. Use aifc.open instead.r)�
stacklevel)r�)r�r��DeprecationWarningrr�rrr	r�s
��__main__rz/usr/demos/data/audio/bach.aiffr�ZReadingznchannels =znframes   =zsampwidth =zframerate =zcomptype  =zcompname  =rZWritingr�izDone.)N)N)8�__doc__r
r_r��__all__�	Exceptionrr�rrrrr!r&r-r3r4r5r6r=rArZrB�collectionsrCrDr�r�r�r�r�r�rEr�rrr�sys�argvr��fnr(�printrorqrsrurxr{Zgn�gr�r|r�rr�rrrr	�<module>s~	

!�







cProfile.cpython-38.opt-1.pyc000064400000012577151450073350011715 0ustar00U

e5db�@s�dZdddgZddlZddlZddlZddd�Zddd�Zejje_ejje_Gd	d�dej�Z	d
d�Z
dd
�Zedkr~e�dS)zUPython interface for the 'lsprof' profiler.
   Compatible with the 'profile' module.
�run�runctx�Profile�N���cCst�t��|||�S�N)�
_pyprofile�_Utilsrr)�	statement�filename�sort�r� /usr/lib64/python3.8/cProfile.pyrscCst�t��|||||�Sr)rrrr)r	�globals�localsr
rrrr
rs�c@s`eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
de
_dd�Zdd�Z
dS)ra`Profile(timer=None, timeunit=None, subcalls=True, builtins=True)

    Builds a profiler object using the specified timer function.
    The default timer is a fast built-in one based on real time.
    For custom timer functions returning integers, timeunit can
    be a float specifying a scale (i.e. how long each integer unit
    is, in seconds).
    rcCs$ddl}|�|����|���dS�Nr)�pstats�StatsZ
strip_dirsZ
sort_stats�print_stats)�selfrrrrr
r)szProfile.print_statsc	Cs8ddl}t|d��}|��|�|j|�W5QRXdS)Nr�wb)�marshal�open�create_stats�dump�stats)r�filer�frrr
�
dump_stats-szProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rrrr
r3szProfile.create_statsc
Cs,|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i}	|	|t|j�<|||||	f|j|<q|D]�}|j	rlt|j�}|j	D]�}
z|t|
j�}	Wnt
k
r�Yq�YnX|
j}||
j}|
j}|
j}||	k�r|	|}||d7}||d7}||d7}||d7}||||f|	|<q�qldS)Nr���)Zgetstatsr�label�codeZ	callcountZreccallcountZ
inlinetimeZ	totaltime�idZcalls�KeyError)r�entriesZcallersdicts�entry�funcZncZccZttZctZcallersZsubentry�prevrrr
r7s>






zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr,�dictrrr
r]szProfile.runcCs(|��zt|||�W5|��X|Sr)�enabler�exec)rr.rrrrr
rbs

zProfile.runctxcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��z|||�W�S|��XdS)	Nr"z:descriptor 'runcall' of 'Profile' object needs an argumentr*rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr!)�len�	TypeError�pop�warnings�warn�DeprecationWarningr0r)�args�kwrr*r6rrr
�runcallks&

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs|��|Sr)r0r rrr
�	__enter__�szProfile.__enter__cGs|��dSr)r)r�exc_inforrr
�__exit__�szProfile.__exit__N)r)�__name__�
__module__�__qualname__�__doc__rrrrrrr;�__text_signature__r<r>rrrr
rs
&	cCs(t|t�rdd|fS|j|j|jfSdS)N�~r)�
isinstance�str�co_filename�co_firstlineno�co_name)r%rrr
r$�s

r$c
Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddt|j	j
�d�|jdddddd�|jdd�s�|��|�
d�|��\}}||jdd�<|jdk	r�|j�|j�|_t|�dk�r�|j�rd}	|j|dd�}
nR|d}|j�d|j�|��t�|��}t|��|d�}	W5QRX|dddd�}
zt|	|
d|j|j�Wn6tk
�r�}
zd|_|�
|
j�W5d}
~
XYnXn|��|S)Nr)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr)rMrNrO�choicesz-m�module�
store_truezProfile a library module)rM�actionrNrOr!r"z(run_module(modname, run_name='__main__'))�
run_module�modnamer1r,)�__file__r?�__package__�
__cached__) �os�sys�runpyrZoptparserJZallow_interspersed_argsZ
add_option�sortedrZsort_arg_dict_default�argvZprint_usage�exit�
parse_argsrL�path�abspathr3rQrT�insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)rYrZr[rrJrK�parserZoptionsr9r%ZglobsZprogname�fp�excrrr
�main�sd

�

�
�

�� rnr,)Nr)Nr)
rB�__all__Z_lsprofrdZprofilerrrZProfilerrr$rnr?rrrr
�<module>s




o;antigravity.cpython-38.pyc000064400000001437151450073350011545 0ustar00U

e5d��@s&ddlZddlZe�d�dd�ZdS)�Nzhttps://xkcd.com/353/cCs\t�|���}dd�|dd�|dd�fD�\}}td||dd�||dd�f�dS)z�Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    cSsg|]}dt�d|��qS)z%fz0.)�float�fromhex)�.0�x�r�#/usr/lib64/python3.8/antigravity.py�
<listcomp>szgeohash.<locals>.<listcomp>N�� z	%d%s %d%s�)�hashlibZmd5Z	hexdigest�print)ZlatitudeZ	longitudeZdatedow�h�p�qrrr�geohashs&r)Z
webbrowserr�openrrrrr�<module>s
sre_parse.cpython-38.opt-2.pyc000064400000052062151450073350012127 0ustar00U

e5d&��@s�ddlTdZdZed�Zed�Zed�Zed�Zed�Zee	e
h�Zeee
eeeeh�Zeed	�feed
�feed�feed�feed
�feed�feed�feed�fd�Zeefeefeefeeefgfeeefgfeeefgfeeefgfeeefgfeeefgfeefd�
Z e!e"e#e$e%e&e'e(d�Z)e&e"Be(BZ*e+e'BZ,Gdd�de-�Z.Gdd�d�Z/Gdd�d�Z0Gdd�d�Z1dd�Z2dd�Z3d d!�Z4d"d#�Z5d2d%d&�Z6d'd(�Z7d)d*�Z8d3d,d-�Z9d.d/�Z:d0d1�Z;d+S)4�)�*z.\[{()*+?^$|z*+?{�
0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz 	

����
�
�	��\)z\a�\bz\fz\nz\rz\tz\vz\\)
z\Arz\Bz\dz\Dz\sz\Sz\wz\Wz\Z)�i�L�m�s�x�a�t�uc@seZdZdS)�VerboseN)�__name__�
__module__�__qualname__�rr�!/usr/lib64/python3.8/sre_parse.pyrGsrc@sBeZdZdd�Zedd��Zddd�Zdd	�Zd
d�Zdd
�Z	dS)�StatecCsd|_i|_dg|_d|_dS)Nr)�flags�	groupdict�groupwidths�lookbehindgroups��selfrrr�__init__LszState.__init__cCs
t|j�S�N)�lenrr rrr�groupsQszState.groupsNcCsb|j}|j�d�|jtkr$td��|dk	r^|j�|d�}|dk	rTtd|||f��||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)r%r�append�	MAXGROUPS�errorr�get)r!�name�gid�ogidrrr�	opengroupTs
�
zState.opengroupcCs|��|j|<dSr#)�getwidthr)r!r+�prrr�
closegroup`szState.closegroupcCs||jko|j|dk	Sr#)r%r)r!r+rrr�
checkgroupbszState.checkgroupcCs6|jdk	r2|�|�s|�d��||jkr2|�d��dS)N�cannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr1r()r!r+�sourcerrr�checklookbehindgroupes




zState.checklookbehindgroup)N)
rrrr"�propertyr%r-r0r1r4rrrrrJs

rc@s`eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
SubPatternNcCs"||_|dkrg}||_d|_dSr#)�state�data�width)r!r7r8rrrr"os
zSubPattern.__init__rcCs�d}ttf}|jD�]t\}}t|dt|�dd�|tkrlt�|D]"\}}t|ddt|�|�qFq|tkr�t�t|d�D]*\}}|r�t|dd�|�|d�q�q|t	k�r|\}}	}
td|�|	�|d�|
�r�t|dd�|
�|d�qt
||��r~d}|D]T}t
|t��rJ|�s6t�|�|d�d}n"|�s\td	dd�t|dd�d}�q|�s�t�qtd|�qdS)
NTz  �)�end��OR�ELSEF� )�tuple�listr8�print�str�IN�BRANCH�	enumerate�dump�GROUPREF_EXISTS�
isinstancer6)r!�level�nl�seqtypes�op�avrr
�	condgroup�item_yes�item_norrrrGvsH


zSubPattern.dumpcCs
t|j�Sr#)�reprr8r rrr�__repr__�szSubPattern.__repr__cCs
t|j�Sr#)r$r8r rrr�__len__�szSubPattern.__len__cCs|j|=dSr#�r8�r!�indexrrr�__delitem__�szSubPattern.__delitem__cCs&t|t�rt|j|j|�S|j|Sr#)rI�slicer6r7r8rVrrr�__getitem__�s
zSubPattern.__getitem__cCs||j|<dSr#rU�r!rW�coderrr�__setitem__�szSubPattern.__setitem__cCs|j�||�dSr#)r8�insertr[rrrr^�szSubPattern.insertcCs|j�|�dSr#)r8r&)r!r\rrrr&�szSubPattern.appendc	Cs�|jdk	r|jSd}}|jD�]�\}}|tkr|td}d}|dD]$}|��\}}t||�}t||�}qD||}||}q|tkr�|��\}}||}||}q|tkr�|d��\}}||}||}q|t	k�r|d��\}}|||d}|||d}q|t
k�r$|d}|d}q|tk�rP|jj
|\}}||}||}q|tk�r�|d��\}}|ddk	�r�|d��\}}t||�}t||�}nd}||}||}q|tkr�q�qt|td�t|t�f|_|jS)Nrr<����)r9r8rE�	MAXREPEATr.�min�max�CALL�
SUBPATTERN�_REPEATCODES�
_UNITCODES�GROUPREFr7rrH�SUCCESS)	r!�lo�hirMrNr
�j�l�hrrrr.�sZ












zSubPattern.getwidth)N)r)
rrrr"rGrSrTrXrZr]r^r&r.rrrrr6ms

(r6c@sbeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	d
d��Z
dd�Zdd�Zddd�Z
dS)�	TokenizercCs@t|t�|_||_|js"t|d�}||_d|_d|_|��dS)N�latin1r)rIrC�istext�string�decoded_stringrW�next�_Tokenizer__next)r!rrrrrr"�s
zTokenizer.__init__cCs�|j}z|j|}Wntk
r0d|_YdSX|dkr�|d7}z||j|7}Wn.tk
r�td|jt|j�d�d�YnX|d|_||_dS)Nrr<zbad escape (end of pattern))rWrs�
IndexErrorrtr(rrr$)r!rW�charrrr�__next�s&��
zTokenizer.__nextcCs||jkr|��dSdS)NTF�rtru)r!rwrrr�match�s
zTokenizer.matchcCs|j}|��|Sr#ry)r!�thisrrrr)�sz
Tokenizer.getcCs8d}t|�D]&}|j}||kr"q4||7}|��q|S�Nr:)�rangertru)r!�n�charset�result�_�crrr�getwhiles
zTokenizer.getwhilecCsld}|j}|��|dkr@|s,|�d|��|�d|t|���||kr^|sh|�d|d��qh||7}q|S)Nr:zmissing zmissing %s, unterminated namer<)rtrur(r$)r!�
terminatorr*r�r�rrr�getuntils
�
zTokenizer.getuntilcCs|jt|jpd�Sr|�rWr$rtr rrr�possz
Tokenizer.poscCs|jt|jpd�Sr|r�r rrr�tellszTokenizer.tellcCs||_|��dSr#)rWrurVrrr�seek szTokenizer.seekrcCst||j|��|�Sr#)r(rrr�)r!�msg�offsetrrrr($szTokenizer.errorN)r)rrrr"rurzr)r�r�r5r�r�r�r(rrrrro�s		
roc	Cs�t�|�}|r|St�|�}|r0|dtkr0|S�zJ|dd�}|dkr�||�dt�7}t|�dkrx|�d|t|���tt	|dd�d�fWS|dkr�|j
r�||�dt�7}t|�d	kr�|�d|t|���tt	|dd�d�fWS|d
k�rN|j
�rN||�dt�7}t|�dk�r*|�d|t|���t	|dd�d�}t|�t|fWS|d
k�r�|j
�r�ddl}|�
d��s~|�d��|�dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|tk�r.||�dt�7}t	|dd�d�}|dk�r$|�d|t|���t|fWS|tk�r<t�t|�dk�rz|tk�rh|�d|t|���tt|d�fWSWntk
�r�YnX|�d|t|���dS)Nrr<r`r��incomplete escape %s�r��U��
�N�{�	missing {�}�character name�undefined character name %r�\N{}��.octal escape value %s outside of range 0-0o377�
bad escape %s)�ESCAPESr)�
CATEGORIESrDr��	HEXDIGITSr$r(�LITERAL�intrq�chr�unicodedatarzr��ord�lookup�KeyError�	OCTDIGITS�DIGITS�
ValueError�ASCIILETTERS)r3�escaper\r�r��charnamerrr�
_class_escape'sp




�



��


r�c	Csft�|�}|r|St�|�}|r$|S�z|dd�}|dkr�||�dt�7}t|�dkrl|�d|t|���tt|dd�d�fWS|dkr�|j	r�||�dt�7}t|�dkr�|�d|t|���tt|dd�d�fWS|d	k�rB|j	�rB||�d
t�7}t|�dk�r|�d|t|���t|dd�d�}t
|�t|fWS|dk�r�|j	�r�d
dl}|�d��sr|�d��|�
dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|dk�r||�dt�7}tt|dd�d
�fWS|tk�r�|jtk�r�||��7}|dtk�r�|dtk�r�|jtk�r�||��7}t|dd�d
�}|dk�r�|�d|t|���t|fWSt|dd��}||jk�r�|�|��s�|�dt|���|�||�t|fWS|�d|t|�d��t|�dk�r4|tk�r"|�d|t|���tt|d�fWSWntk
�rLYnX|�d|t|���dS)Nr<r`rr�r�r�rr�r�r�r�r�rr�r�r�r�r�r��0r�r�r2�invalid group reference %dr�)r�r)r�r�r�r$r(r�r�rqr�r�rzr�r�r�r�r�r�rtr%r1r4rhr�r�)r3r�r7r\r�r�r��grouprrr�_escapecs�




�



�
��
�

r�cCstt�|��Sr#)rA�dict�fromkeys)�itemsrrr�_uniq�sr�cCsVg}|j}|j}|��}|t||||d|o2|��|d�sqDqt|�dkrX|dSt|�}d}	|D].}
|
stq�|	dkr�|
d}	qh|
d|	krhq�qh|D]
}
|
d=q�|�|	�q`q�q`g}|D]h}
t|
�dkr��q@|
d\}}
|tkr�|�||
f�q�|tk�r"|
ddtk	�r"|�	|
�q��q@q�|�tt
|�f�|S|�td|ff�|S)Nr<�|r)r&rzr��_parser$r6r�rD�NEGATE�extendr�rE)r3r7�verbose�nestedr��itemsappend�sourcematch�start�
subpattern�prefix�item�setrMrNrrr�
_parse_sub�sN
�

r�Fc/
Cs�t|�}|j}|j}|j}t}	t}
|j}|dkr4�q*|dkr@�q*|�|rx|tkrTq"|dkrx|�}|dksv|dkr\q"q\q"|ddkr�t|||�}||�q"|t	kr�|t
|
|�f�q"|dk�r�|��d}
g}|j}|jdk�rddl}|j
d|��t|d	d
�|d�}|�}|dk�r0|�d|��|
��|d
k�rF|�rF�qbn�|ddk�r`t||�}n~|�r�|dk�r�|j|k�r�ddl}|j
d|dk�r�dn|dk�r�dn|dk�r�dnd|��dft|d	d
�t
|
|�f}|d��r<|�}|dk�r|�d|��|
��|d
k�rL|dtk�r0|dd}||�|t
|
d�f��qb|ddk�rft||�}n>|dk�r�ddl}|j
d|��dt|d	d
�t
|
|�f}|dt
k�s�|dt
k�r�d||f}|�|t|�dt|���|d}|d}||k�r*d||f}|�|t|�dt|���|t||ff�n"|dtk�rV|dd}||��qt|�}|	|�dk�r�|ddt
k�r�|�r�|t|ddf�n||d�n"|�r�|�dtdf�|t|f�q"|tk�r.|��}
|dk�rd\}}�nB|dk�rdt}}�n*|dk�r0dt}}�n|dk�r4|jdk�rX|t
|
|�f�q"dt}}d }}|jtk�r�||�7}�qj|d!��r�|jtk�r�||�7}�q�n|}|d��s�|t
|
|�f�|�|
�q"|�r�t|�}|tk�r�td"��|�rBt|�}|tk�rtd"��||k�rB|�d#|��|
��ntd$|f��|�rV|d%d�}nd}|�rr|ddtk�r�|�d&|��|
t|���|ddtk�r�|�d'|��|
t|���|ddt k�r�|dd\}}}}|dk�r�|�s�|�s�|}|d��rt!|||ff|d%<nt"|||ff|d%<q"|d(k�rF|t#df�q"|d)k�r�|��d} d*}d}!d}d}|d��r|�}|dk�r�|�d+��|d,k�r�|d-��r�|�$d.d/�}!|!�%��s�d0|!}|�|t|!�d��n�|d1��r�|�$d2d/�}!|!�%��sd0|!}|�|t|!�d��|j&�|!�}"|"dk�rFd3|!}|�|t|!�d��|�'|"��sf|�d4t|!�d��|�(|"|�|t)|"f�q"n2|�}|dk�r�|�d+��|�d5|t|�d���nd|d6k�r�d}�nR|dk�r|jdk�r�|�d7|��| ��|�d2k�r�q"�q�q"�n|d8k�r�d}#|d-k�r||�}|dk�r>|�d+��|d9k�r`|�d:|t|�d��d%}#|j*}$|$dk�r||j+|_*t,||||d�}|#dk�r�|$dk�r�d|_*|d2��s�|�d;|��| ��|d1k�r�|t-|#|ff�q"|t.|#|ff�q"�n$|d)k�
rj|�$d2d/�}%|%�%��	rL|j&�|%�}&|&dk�	r�d3|%}|�|t|%�d��n�zt|%�}&|&dk�	rdt/�Wn4t/k
�	r�d0|%}|�|t|%�d�d�YnX|&�	s�|�d<t|%�d��|&t0k�	r�d=|&}|�|t|%�d��|�(|&|�t1||||d�}'|�d>��
r0t1||||d�}(|jd>k�
r4|�d?��nd}(|�d2��
sT|�d;|��| ��|t2|&|'|(ff�q"n�|t3k�
s~|dk�rt4|||�})|)dk�
r�|�
r�|�
r�ddl}|j
d@|j5ddA�t|j5�dAk�
r�dBnd ft6|d	d
�|j7t8@r"|s"t9�q"|)\}}d}n|�dC|t|�d��|dk	�rrz|�:|!�}Wn<tk
�rp}*z|�|*j;t|!�d�d�W5d}*~*XYnX|�s�|t8@�o�|t8@}+t,|||+|d�}|�d2��s�|�d;|��| ��|dk	�r�|�<||�|t ||||ff�q"|dk�r|tt=f�q"|dDk�r|tt>f�q"tdE|f��q"t?t|��ddd%�D]N},||,\}-}.|-t k�r@|.\}}}}|dk�r@|�s@|�s@|||,|,d�<�q@|S)FNz|)�#rrr�[r<z"Possible nested set at position %dr�)�
stacklevel�^zunterminated character set�]z-&~|zPossible set %s at position %d�-�
difference�&�intersection�~zsymmetric difference�unionz&Possible set difference at position %dr`zbad character range %s-%s�?)rr<r�+r�r�r:�,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rr_znothing to repeatzmultiple repeat�.�(Tzunexpected end of pattern�P�<�>�
group name�bad character in group name %r�=�)�unknown group name %rr2zunknown extension ?P�:zmissing ), unterminated commentz=!<z=!zunknown extension ?<z"missing ), unterminated subpatternzbad group numberr�r�z/conditional backref with more than two branchesz-Flags not at the start of the expression %r%s�z (truncated)zunknown extension ?�$z unsupported special character %r)@r6r&r)rzr$r�rt�
WHITESPACEr��
SPECIAL_CHARSr�r��warnings�warn�
FutureWarningr(r�rD�RANGEr��NOT_LITERALr^r��REPEAT_CHARSrar�r�r��
OverflowError�AssertionError�ATrfre�
MIN_REPEAT�
MAX_REPEAT�ANYr��isidentifierrr1r4rhrr%r��ASSERT�
ASSERT_NOTr�r'r�rH�FLAGS�_parse_flagsrr�DeprecationWarningr�SRE_FLAG_VERBOSErr-r�r0�AT_BEGINNING�AT_ENDr})/r3r7r�r��firstr��subpatternappend�	sourcegetr��_len�_ordr{r\�herer��	setappendr��negate�code1�that�code2r�rjrkrbrcrwr�r��	add_flags�	del_flagsr/r�r*r+�dirr�condnamerOrPrQr�err�sub_verboser
rMrNrrrr��s|


�

�
��	


�


��
 












���












�



�


�






�




�





�

�
��

�
*�
�



r�cCs�|j}d}d}|dkr�t|}|jr<|dkrRd}|�|��n|dkrRd}|�|��||O}|t@r||t@|kr|d}|�|��|�}|dkr�|�d��|d	kr�q�|tkr|��r�d
nd}|�|t|���q|dkr�|j|O_dS|t@r�|�dd
��|dk�r�|�}|dk�r|�d��|tk�rF|���r2d
nd}|�|t|���t|}|t@�rfd}|�|��||O}|�}|dk�r�|�d��|dk�r��q�|tk�rF|���r�d
nd}|�|t|����qF|t@�r�|�dd
��||@�r�|�dd
��||fS)Nrr�rz8bad inline flags: cannot use 'L' flag with a str patternrz:bad inline flags: cannot use 'u' flag with a bytes patternz9bad inline flags: flags 'a', 'u' and 'L' are incompatiblezmissing -, : or )z)-:zunknown flagr�z,bad inline flags: cannot turn on global flagr<zmissing flagz8bad inline flags: cannot turn off flags 'a', 'u' and 'L'z	missing :r�z-bad inline flags: cannot turn off global flagz(bad inline flags: flag turned on and off)	r)r�rqr(�
TYPE_FLAGS�isalphar$r�GLOBAL_FLAGS)r3r7rwr�rr�flagr�rrrr�]sl














r�cCsjt|t�r>|t@rtd��|t@s,|tO}qf|t@rftd��n(|t@rNtd��|t@rf|t@rftd��|S)Nz)cannot use LOCALE flag with a str patternz(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz'ASCII and LOCALE flags are incompatible)rIrC�SRE_FLAG_LOCALEr��SRE_FLAG_ASCII�SRE_FLAG_UNICODE)�srcrrrr�	fix_flags�s


rNcCs�t|�}|dkrt�}||_||_zt|||t@d�}WnBtk
rzt�}|tB|_||_|�d�t||dd�}YnXt||j	j�|j	_|j
dk	r�|�d��|t@r�|�
�|S)NrTzunbalanced parenthesis)rorrrCr�r�rr�rr7rtr(�SRE_FLAG_DEBUGrG)rCrr7r3r/rrr�parse�s&



rcs�t|���j}g�g�g��j}�����fdd�}�j}|�}|dkrL�q�|ddk�r�|d}|dk�rJd}��d�s���d	����d
d�}|��r�z||}	Wn tk
r�t	d|��YnXnlzt
|�}	|	dkr�t�Wn0tk
�r��d
|t|�d�d�YnX|	t
k�r4��d|	t|�d��||	t|�d��q�|dk�r��jtk�r�||�7}�jtk�r�||�7}|tt
|dd�d�d@���q�|tk�rZd}
�jtk�r4||�7}|tk�r4|dtk�r4�jtk�r4||�7}d}
t
|dd�d�}|dk�r(��d|t|���|t|��|
�s�|t
|dd��t|�d�nRztt|d�}Wn4tk
�r�|tk�r���d|t|���YnX||�q:||�q:��rΈ�d����t|t��s�dd��D����fS)NcsX|�jkr��d||���r8��d�����dd�=��t��|f���d�dS)Nr�r:)r%r(r&�joinr$)rWr��r%�literal�literalsrr7rr�addgroup�s

z parse_template.<locals>.addgrouprrr<�gr:r�z	missing <r�r�r�r�r�r�r�r�Fr`Tr�r�cSs"g|]}|dkrdn|�d��qS)Nzlatin-1)�encode)�.0rrrr�
<listcomp>sz"parse_template.<locals>.<listcomp>)ror)r&�
groupindexrzr(r�r�r�rvr�r�r$r'rtr�r�r�r�r�rrIrC)r3r7�sget�lappendrrr{r�r*rW�isoctalrrr�parse_template�s�




��


�


"

�

�� 


rcCsv|j}|jdd�}|\}}|dd�}z"|D]\}}||�p@|||<q.Wn tk
rjtd|��YnX|�|�S)Nrr�)r�rrrvr(r)�templaterzr�emptyr%rrWr�rrr�expand_templatesr")F)rN)<�
sre_constantsr�r��	frozensetr�r�r�r�r�r�r�rfr�r�rDr�r��CATEGORYrgr�r�r�ZAT_BEGINNING_STRINGZAT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_NOT_WORDZ
AT_END_STRINGr��SRE_FLAG_IGNORECASEr�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALLr�r�SRE_FLAG_TEMPLATEr
r�rrr	�	Exceptionrrr6ror�r�r�r�r�r�rrrr"rrrr�<module>sp







���
#rH<M:
r<
 Ubinhex.cpython-38.opt-2.pyc000064400000026523151450073350011424 0ustar00U

e5d�6�@s�ddlZddlZddlZddlZdddgZGdd�de�ZdZdZdZ	dZ
d	ZGd
d�d�Zdd
�Z
Gdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZdS)�N�binhex�hexbin�Errorc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/binhex.pyrs�i��@��c@seZdZdd�ZdS)�FInfocCsd|_d|_d|_dS)Nz????r)�Type�Creator�Flags��selfrrr	�__init__0szFInfo.__init__N)rrrrrrrr	r
/sr
c	Cstt�}t�|d��2}|�d�}d|kr,d|_|�dd�|��}W5QRXtj�	|�\}}|�
ddd�}|||dfS)	N�rbirZTEXT��:�-r
)r
�io�open�readr�seek�tell�os�path�split�replace)�name�finfo�fp�dataZdsize�dir�filerrr	�getfileinfo5s
r'c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�openrsrccGsdS�Nr�r�argsrrr	rCszopenrsrc.__init__cGsdS�N�rr*rrr	rFsz
openrsrc.readcGsdSr)rr*rrr	�writeIszopenrsrc.writecCsdSr)rrrrr	�closeLszopenrsrc.closeN)rrrrrr.r/rrrr	r(Bsr(c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_HqxcoderenginecCs ||_d|_d|_td|_dS)Nr-r
)�ofpr$�hqxdata�LINELEN�linelen�rr1rrr	rRsz_Hqxcoderengine.__init__cCsh|j||_t|j�}|dd}|jd|�}|j|d�|_|sHdS|jt�|�|_|�d�dS)N�r)r$�lenr2�binascii�b2a_hqx�_flush)rr$ZdatalenZtodorrr	r.Xs
z_Hqxcoderengine.writecCsrd}|t|j�|jkrH||j}|j�|j||�d�t|_|}q|j|d�|_|rn|j�|jd�dS)Nr�
s:
)r7r2r4r1r.r3)rZforce�firstZlastrrr	r:cs
z_Hqxcoderengine._flushcCs6|jr|jt�|j�|_|�d�|j��|`dS)Nr
)r$r2r8r9r:r1r/rrrr	r/ns


z_Hqxcoderengine.closeN)rrrrr.r:r/rrrr	r0Osr0c@s$eZdZdd�Zdd�Zdd�ZdS)�_RlecoderenginecCs||_d|_dSr,)r1r$r5rrr	rxsz_Rlecoderengine.__init__cCs@|j||_t|j�tkrdSt�|j�}|j�|�d|_dSr,)r$r7�REASONABLY_LARGEr8�rlecode_hqxr1r.)rr$�rledatarrr	r.|sz_Rlecoderengine.writecCs0|jrt�|j�}|j�|�|j��|`dSr))r$r8r?r1r.r/)rr@rrr	r/�s

z_Rlecoderengine.closeN)rrrrr.r/rrrr	r=usr=c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BinHexc
Cs�|\}}}}d}t|t�r.|}t�|d�}d}zR|�d�t|�}	t|	�|_d|_|dkr`t	�}||_
||_|�||�t
|_Wn|r�|���YnXdS)NF�wbTs0(This file must be converted with BinHex 4.0)

:r)�
isinstance�strrrr.r0r=r1�crcr
�dlen�rlen�
_writeinfo�_DID_HEADER�stater/)
rZname_finfo_dlen_rlenr1r!r"rFrGZclose_on_errorZofnameZhqxerrrr	r�s*



zBinHex.__init__cCs�t|�}|dkrtd��t|g�|�d�d}|j|j}}t|t�rR|�d�}t|t�rf|�d�}||}t�	d|j
�}t�	d|j|j�}	||||	}
|�
|
�|��dS)N�?zFilename too longzlatin-1��>hz>ii)r7r�bytes�encoderrrCrD�struct�packrrFrG�_write�	_writecrc)rr!r"�nl�d�tpZcrZd2Zd3Zd4�inforrr	rH�s




zBinHex._writeinfocCs t�||j�|_|j�|�dSr))r8�crc_hqxrEr1r.�rr$rrr	rR�sz
BinHex._writecCs4|jdkrd}nd}|j�t�||j��d|_dS)NrrMz>H)rEr1r.rPrQ)rZfmtrrr	rS�s

zBinHex._writecrccCs0|jtkrtd��|jt|�|_|�|�dS)NzWriting data at the wrong time)rJrIrrFr7rRrYrrr	r.�s
zBinHex.writecCs,|jdkrtd|jf��|��t|_dS)NrzIncorrect data size, diff=%r)rFrrGrS�	_DID_DATArJrrrr	�
close_data�s
zBinHex.close_datacCsB|jtkr|��|jtkr$td��|jt|�|_|�|�dS)Nz'Writing resource data at the wrong time)rJrZr[rrGr7rRrYrrr	�
write_rsrc�s

zBinHex.write_rsrccCsx|jdkrdSzJ|jtkr"|��|jtkr4td��|jdkrNtd|jf��|��W5d|_|j}|`|��XdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rJr1r/rZr[rrGrSr5rrr	r/�s



zBinHex.closeN)rrrrrHrRrSr.r[r\r/rrrr	rA�s
rAc	Cs�t|�}t||�}t�|d��*}|�d�}|s0q<|�|�q |��W5QRXt|d�}|�d�}|shqt|�|�qX|�	�|�	�dS)Nr��)
r'rArrrr.r[r(r\r/)�inp�outr"r1�ifprUrrr	r�s



c@s$eZdZdd�Zdd�Zdd�ZdS)�_HqxdecoderenginecCs||_d|_dS)Nr)r`�eof�rr`rrr	rsz_Hqxdecoderengine.__init__cCs�d}|}|dkr�|jr|S|ddd}|j�|�}zt�|�\}|_Wq�Wntjk
rdYnX|j�d�}|s~td��||}q6||}|t|�}|s|jstd��q|S)Nr-rrr6�r
zPremature EOF on binhex file)rbr`rr8Za2b_hqxZ
Incompleterr7)rZtotalwtdZdecdata�wtdr$Z
decdatacur�newdatarrr	rs*


z_Hqxdecoderengine.readcCs|j��dSr)�r`r/rrrr	r/%sz_Hqxdecoderengine.closeN)rrrrrr/rrrr	ra�s rac@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_RledecoderenginecCs||_d|_d|_d|_dS)Nr-r)r`�
pre_buffer�post_bufferrbrcrrr	r+sz_Rledecoderengine.__init__cCsD|t|j�kr"|�|t|j��|jd|�}|j|d�|_|Sr))r7rj�_fill)rre�rvrrr	r1s
z_Rledecoderengine.readcCs�|j|j�|d�|_|jjr>|jt�|j�|_d|_dSt|j�}|jdd�tdtkrl|d}nX|jdd�tkr�|d}n<|jdd�tdkr�|d}n|jdd�tkr�n|d	}|jt�|jd|��|_|j|d�|_dS)
Nrdr-���rLr6���r���r
)	rir`rrbrjr8Z
rledecode_hqxr7�RUNCHAR)rreZmarkrrr	rk8s*
�



�z_Rledecoderengine._fillcCs|j��dSr)rgrrrr	r/[sz_Rledecoderengine.closeN)rrrrrrkr/rrrr	rh(s#rhc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HexBincCsft|t�rt�|d�}|�d�}|s,td��|dkr6q|dkrqBqt|�}t|�|_d|_	|�
�dS)Nrr
zNo binhex data foundr;�:r)rCrDrrrrrarhr`rE�_readheader)rr`ZchZhqxifprrr	r_s


zHexBin.__init__cCs |j�|�}t�||j�|_|Sr))r`rr8rXrE)rr7r$rrr	�_readuszHexBin._readcCsNt�d|j�d��dd@}|jd@|_||jkrDtd|j|f��d|_dS)NrMrri��zCRC error, computed %x, read %x)rP�unpackr`rrEr)rZfilecrcrrr	�	_checkcrczs
�zHexBin._checkcrccCs�|�d�}|�t|��}|�d�}|��|dd�}|dd�}t�d|dd��d}t�d|dd	��d|_t�d|d	d��d|_||_t�|_||j_	||j_
||j_t|_
dS)
Nr
���	rM�rz>l�)rt�ordrvrPrurFrG�FNamer
rrrrIrJ)rr7Zfname�rest�typeZcreator�flagsrrr	rs�s

zHexBin._readheadercGsj|jtkrtd��|r,|d}t||j�}n|j}d}t|�|krZ||�|t|��}q6|j||_|S)NzRead data at wrong timerr-)rJrIr�minrFr7rt)r�nrlrrr	r�s
zHexBin.readcCs6|jtkrtd��|jr$|�|j�}|��t|_dS)Nzclose_data at wrong time)rJrIrrFrtrvrZ�rZdummyrrr	r[�s
zHexBin.close_datacGsZ|jtkr|��|jtkr$td��|r>|d}t||j�}n|j}|j||_|�|�S)Nz Read resource data at wrong timer)rJrIr[rZrr�rGrt)rr�rrr	�	read_rsrc�s

zHexBin.read_rsrccCsD|jdkrdSz|jr"|�|j�}|��W5d|_|j��XdSr))rJr`r/rGr�rvr�rrr	r/�s
zHexBin.closeN)rrrrrtrvrsrr[r�r/rrrr	rq^s

rqc	Cs�t|�}|j}|s|j}t�|d��"}|�d�}|s6qB|�|�q&W5QRX|��|�d�}|r�t	|d�}|�|�|�d�}|s�q�|�|�qv|�
�|�
�dS)NrBr])rqr
r}rrrr.r[r�r(r/)r^r_r`r"r1rUrrr	r�s(




)rrrPr8�__all__�	ExceptionrrIrZr>r3rpr
r'r(r0r=rArrarhrqrrrrr	�<module>s*


&^*6hpstats.cpython-38.opt-1.pyc000064400000053064151450073350011464 0ustar00U

e5d�j�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddgZ
Gdd�dee�ZGdd�d�Z
Gd	d
�d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedk�r�ddlZzddlZWnek
r�YnXGdd�dej�Zeej�dk�rejdZndZzPee�Zejdd�D]Z e�!e ��q0e"dej#d�e�$�e"d ej#d�Wne%k
�r~YnXdS)!z3Class for printing reports on profiled python code.�N)�Enum)�
cmp_to_key�Stats�SortKeyc@s8eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
d�ZdS)
r)�calls�ncalls)�
cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimecGs@|d}t�||�}||_|dd�D]}||j|<q&||_|S�Nr�)�str�__new__�_value_�_value2member_map_Z_all_values)�cls�values�value�objZother_value�r�/usr/lib64/python3.8/pstats.pyr-szSortKey.__new__N)
�__name__�
__module__�__qualname__ZCALLSZ
CUMULATIVEZFILENAMEZLINE�NAMEZNFLZPCALLSZSTDNAMEZTIMErrrrrr"sc@s�eZdZdZdd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dddddddddddddd�
Z
dd�Zdd�Zdd�Z
d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd7d1d2�Zd3d4�Zd5d6�ZdS)8ra�This class is used for creating reports from data generated by the
    Profile class.  It is a "friend" of that class, and imports data either
    by direct access to members of Profile class, or by reading in a dictionary
    that was emitted (via marshal) from the Profile class.

    The big change from the previous Profiler (in terms of raw functionality)
    is that an "add()" method has been provided to combine Stats from
    several distinct profile runs.  Both the constructor and the add()
    method now take arbitrarily many file names as arguments.

    All the print methods now take an argument that indicates how many lines
    to print.  If the arg is a floating point number between 0 and 1.0, then
    it is taken as a decimal percentage of the available lines to be printed
    (e.g., .1 means print 10% of all available lines).  If it is an integer,
    it is taken to mean the number of lines of data that you wish to have
    printed.

    The sort_stats() method now processes some additional options (i.e., in
    addition to the old -1, 0, 1, or 2 that are respectively interpreted as
    'stdname', 'calls', 'time', and 'cumulative').  It takes either an
    arbitrary number of quoted strings or SortKey enum to select the sort
    order.

    For example sort_stats('time', 'name') or sort_stats(SortKey.TIME,
    SortKey.NAME) sorts on the major key of 'internal function time', and on
    the minor key of 'the name of the function'.  Look at the two tables in
    sort_stats() and get_sort_arg_defs(self) for more examples.

    All methods return self, so you can string together commands like:
        Stats('foo', 'goo').strip_dirs().sort_stats('calls').                            print_stats(5).print_callers(5)
    N)�streamcGsF|ptj|_t|�sd}n|d}|dd�}|�|�|j|�dSr)�sys�stdoutr#�len�init�add)�selfr#�args�argrrr�__init__Ys
zStats.__init__cCs�d|_g|_d|_d|_d|_d|_d|_t�|_i|_	i|_
|�|�z|��Wn8t
k
r�td|jrx|jdnd|jd��YnXdS)NrzInvalid timing data %s������file)�all_callees�files�fcn_list�total_tt�total_calls�
prim_calls�max_name_len�set�	top_level�stats�
sort_arg_dict�
load_stats�get_top_level_stats�	Exception�printr#)r)r+rrrr'cs(
��z
Stats.initc	Cs�|dkri|_dSt|t�rxt|d��}t�|�|_W5QRXz"t�|�}t�	|j
�d|}WnYnX|g|_n t|d�r�|�
�|j|_i|_|js�td|j|f��dS)N�rbz    �create_statsz.Cannot create or construct a %r object from %r)r:�
isinstancer�open�marshal�load�os�statr�ctime�st_mtimer2�hasattrrA�	TypeError�	__class__)r)r+�fZ
file_statsrrrr<vs*



�zStats.load_statscCs�|j��D]p\}\}}}}}|j|7_|j|7_|j|7_d|krZ|j�|�tt|��|j	kr
tt|��|_	q
dS)N)ZjprofilerZprofiler)
r:�itemsr5r6r4r9r(r&�func_std_stringr7)r)�func�cc�nc�tt�ct�callersrrrr=�szStats.get_top_level_statscGs�|s|St|�D]�}t|�t|�kr,t|�}|j|j7_|j|j7_|j|j7_|j|j7_|jD]}|j�|�qr|j	|j	kr�|j	|_	d|_
|j��D]<\}}||jkr�|j|}nddddif}t
||�|j|<q�q|S�Nr)�reversed�typerr2r5r6r4r9r(r7r3r:rN�add_func_stats)r)�arg_list�itemrPrGZ
old_func_statrrrr(�s(

z	Stats.addc	Cs(t|d��}t�|j|�W5QRXdS)z:Write the profile data to a file we know how to load back.�wbN)rCrD�dumpr:)r)r
rMrrr�
dump_stats�szStats.dump_stats)))rr-z
call count)))�r-zcumulative time))��rz	file name))��rzline number))��rz
function name))rdr`rbzname/file/line)))rr-zprimitive call count)))�rz
standard name)))�r-z
internal time)
rrr	rr
rrr
rrrrrcCst|jsni|_}i}|j��D]>\}}|}|r|s4q||krFd||<q|||<|dd�}q*q|D]
}||=qb|jS)z)Expand all abbreviations that are unique.rNr-)r;�sort_arg_dict_defaultrN)r)�dictZbad_list�word�tupZfragmentrrr�get_sort_arg_defs�s 
zStats.get_sort_arg_defscGs\|sd|_|St|�dkrBt|dt�rBddddd�|dg}n:t|�dkr||dd�D] }t|�t|d�krZtd	��qZ|��}d
}d|_d}|D]B}t|t�r�|j	}|||d}|j|||d7_d}q�g}|j
��D]4\}\}	}
}}}
|�|	|
||f|t
|�|f�q�|jtt|�j�d
�g|_}|D]}|�|d��qB|S)Nrrrrrr)r-rrrgrgzCan't have mixed argument typerr.z, )�keyr-)r3r&rB�intrXrKrl�	sort_typerrr:rN�appendrO�sortr�	TupleComp�compare)r)Zfieldr+Z
sort_arg_defsZ
sort_tupleZ	connectorrjZ
stats_listrPrQrRrSrTrUr3�tuplerrr�
sort_stats�sF��


�
zStats.sort_statscCs|jr|j��|S�N)r3�reverse�r)rrr�
reverse_orders
zStats.reverse_ordercCs�|j}i|_}d}|��D]�\}\}}}}}	t|�}
tt|
��|krRtt|
��}i}|	��D]\}}
|
|t|�<q^|
|kr�t||
|||||f�||
<q|||||f||
<q|j}t�|_}|D]}|�t|��q�||_	d|_
d|_|SrV)r:rN�func_strip_pathr&rOrYr9r8r(r7r3r1)r)ZoldstatsZnewstatsr7rPrQrRrSrTrUZnewfuncZ
newcallers�func2�callerZold_topZnew_toprrr�
strip_dirss0
�
zStats.strip_dirsc
Cst|jr
dSi|_}|j��D]P\}\}}}}}||kr@i||<|��D]$\}}	||kr`i||<|	|||<qHqdSrv)r1r:rN)
r)r1rPrQrRrSrTrUr{r|rrr�calc_callees#s
zStats.calc_calleescCs|}t|t�rpzt�|�}Wn*tjk
rF|d|7}||fYSXg}|D]}|�t|��rP|�|�qPnzt|�}t|t	�r�d|kr�dkr�nnt
||d�}|d|�}n2t|t
�r�d|kr�|kr�nn|}|d|�}t|�t|�k�r|dt|�t|�|f7}||fS)Nz#   <Invalid regular expression %r>
gg�?g�?rz6   List reduced from %r to %r due to restriction <%r>
)rBr�re�compile�error�searchrOrpr&�floatrn)r)Zsel�list�msgZnew_listZrexrP�countrrr�eval_print_amount6s2
""�zStats.eval_print_amountcCs�|j}|jr*|jdd�}d|jd}nt|j���}d}|D]}|�|||�\}}q@t|�}|sld|fSt||j	d�|t|j�kr�d}|D] }tt
|��|kr�tt
|��}q�|d|fS)Nz   Ordered by: �
z!   Random listing order was used
rr/rg)r7r3ror�r:�keysr�r&r?r#rO)r)Zsel_list�widthZ	stat_listr�Z	selectionr�rPrrr�get_print_listPs$zStats.get_print_listcGs�|jD]}t||jd�q|jr,t|jd�d}|jD]}t|t|�|jd�q6t||jdd|jd�|j|jkr�td|jd|jd�td|j|jd�t|jd�|�|�\}}|r�|�	�|D]}|�
|�q�t|jd�t|jd�|S)Nr/�        zfunction calls� ��endr0z(%d primitive calls)zin %.3f seconds)r2r?r#r9�func_get_function_namer5r6r4r��print_title�
print_line)r)�amountr
�indentrPr�r�rrr�print_statshs(

zStats.print_statscGsz|�|�\}}|rv|��|�|d�|D]2}||jkrN|�|||j|�q*|�||i�q*t|jd�t|jd�|S)Nz	called...r/)r�r~�print_call_headingr1�print_call_liner?r#)r)r�r�r�rPrrr�
print_calleess
zStats.print_calleesc
Gsh|�|�\}}|rd|�|d�|D](}|j|\}}}}}	|�|||	d�q"t|jd�t|jd�|S)Nzwas called by...z<-r/)r�r�r:r�r?r#)
r)r�r�r�rPrQrRrSrTrUrrr�
print_callers�szStats.print_callersc
Csvtd�|�||jd�d}|j��D]0\}}}}}|r&tt|����}	t|	t�}qXq&|rrtd|d|jd�dS)Nz	Function r/Fr�z    ncalls  tottime  cumtime)	r?�ljustr#r:r�next�iterrBrt)
r)�	name_sizeZcolumn_titleZ	subheaderrQrRrSrTrUrrrrr��s
zStats.print_call_heading�->cCstt|��|�|d|jd�|s2t|jd�dSt|���}d}|D]�}t|�}||}	t|	t�r�|	\}
}}}
|
|kr�d|
|f}n
d|
f}d|�dd	t	|��t
|�t
|
�|f}|d
}n$d||	t
|j|d�f}|d}t||||jd�d}qFdS)
Nr�r�r/r.z%d/%dz%dz%s %s %s  %srfrgrz	%s(%r) %sr_)r?rOr�r#�sortedr�rBrt�rjustr&�f8r:)r)r��sourceZ	call_dictZarrowZclistr�rPr
rrRrQrSrTZsubstatsZ
left_widthrrrr��s0

�
zStats.print_call_linecCs"tdd|jd�td|jd�dS)Nz-   ncalls  tottime  percall  cumtime  percallr�r�zfilename:lineno(function)r/�r?r#rxrrrr��szStats.print_titlecCs�|j|\}}}}}t|�}||kr4|dt|�}t|�d�d|jd�tt|�d|jd�|dkrxtdd|jd�ntt||�d|jd�tt|�d|jd�|dkr�tdd|jd�ntt||�d|jd�tt|�|jd�dS)N�/�	r�r�rr�r/)r:rr?r�r#r�rO)r)rPrQrRrSrTrU�crrrr��szStats.print_line)r�)rr r!�__doc__r,r'r<r=r(r^rhrlruryr}r~r�r�r�r�r�r�r�r�r�rrrrr7sF!

�'
c@s eZdZdZdd�Zdd�ZdS)rra�This class provides a generic function for comparing any two tuples.
    Each instance records a list of tuple-indices (from most significant
    to least significant), and sort direction (ascending or decending) for
    each tuple-index.  The compare functions can then be used as the function
    argument to the system sort() function when a list of tuples need to be
    sorted in the instances order.cCs
||_dSrv��comp_select_list)r)r�rrrr,�szTupleComp.__init__cCsF|jD]:\}}||}||}||kr0|S||kr|SqdSrVr�)r)�left�right�index�	direction�l�rrrrrs�s

zTupleComp.compareN)rr r!r�r,rsrrrrrr�srrcCs|\}}}tj�|�||fSrv)rF�path�basename)�	func_namer
rr
rrrrz�s
rzcCs|dS)Nrgr)rPrrrr��sr�cCsN|dd�dkrB|d}|�d�r<|�d�r<d|dd�S|Snd|SdS)	Nrg)�~r�<�>z{%s}rr-z	%s:%d(%s))�
startswith�endswith)r�r
rrrrO�srOcCs@|\}}}}}|\}}}	}
}||||||	||
t||�fS)z3Add together all the stats for two profile entries.)�add_callers)�targetr�rQrRrSrTrUZt_ccZt_ncZt_ttZt_ctZ	t_callersrrrrYs
�rYcCs�i}|��D]\}}|||<q|��D]V\}}||krtt|t�rbtdd�t|||�D��||<q||||7<q&|||<q&|S)z*Combine two caller lists in a single list.css|]\}}||VqdSrvr)�.0�i�jrrr�	<genexpr>szadd_callers.<locals>.<genexpr>)rNrBrt�zip)r�r�Znew_callersrPr|rrrr�s

"
r�cCsd}|��D]}||7}q|S)z@Sum the caller statistics to get total number of calls received.r)r)rUrRrrrr�count_callss
r�cCsd|S)Nz%8.3fr)�xrrrr�(sr��__main__c@s�eZdZd6dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7�ProfileBrowserNcCs6tj�|�d|_d|_tj|_|dk	r2|�|�dS)N�% )	�cmd�Cmdr,�promptr:r$r%r#�do_read)r)�profilerrrr,7szProfileBrowser.__init__c	Cs�|��}g}|D]�}z|�t|��WqWntk
r>YnXz<t|�}|dksZ|dkrltd|jd�Wq|�|�WqWntk
r�YnX|�|�q|jr�t|j|�|�ntd|jd�dS)Nrrz#Fraction argument must be in [0, 1]r/�No statistics object is loaded.)	�splitrprn�
ValueErrorr�r?r#r:�getattr)r)�fnrr*Z	processedZtermZfracrrr�generic?s,
zProfileBrowser.genericcCsXtd|jd�td|jd�td|jd�td|jd�td|jd�td|jd�dS)NzArguments may be:r/z0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz-  what fraction of selected entries to print.z8* A regular expression; only entries with function namesz  that match it are printed.r�rxrrr�generic_helpWszProfileBrowser.generic_helpc
Csd|jrRz|j�|�Wq`tk
rN}ztd||f|jd�W5d}~XYq`Xntd|jd�dS)Nz$Failed to load statistics for %s: %sr/r�r)r:r(�OSErrorr?r#)r)r�errr�do_add_s*zProfileBrowser.do_addcCstd|jd�dS)Nz>Add profile info from given file to current statistics object.r/r�rxrrr�help_addhszProfileBrowser.help_addcCs|�d|�S)Nr��r��r)rrrr�
do_calleeskszProfileBrowser.do_calleescCstd|jd�|��dS)Nz6Print callees statistics from the current stat object.r/�r?r#r�rxrrr�help_calleesmszProfileBrowser.help_calleescCs|�d|�S)Nr�r�r�rrr�
do_callersqszProfileBrowser.do_callerscCstd|jd�|��dS)Nz6Print callers statistics from the current stat object.r/r�rxrrr�help_callerssszProfileBrowser.help_callerscCstd|jd�dS)Nr.r/rr�r�rrr�do_EOFwszProfileBrowser.do_EOFcCstd|jd�dS�NzLeave the profile browser.r/r�rxrrr�help_EOFzszProfileBrowser.help_EOFcCsdS)Nrrr�rrr�do_quit}szProfileBrowser.do_quitcCstd|jd�dSr�r�rxrrr�	help_quitszProfileBrowser.help_quitc
Cs�|r�zt|�|_Wnztk
rN}zt|jd|jd�WY�dSd}~XYn@tk
r�}z"t|jjd||jd�WY�dSd}~XYnX|d|_	n6t
|j	�dkr�|j	dd�}|�|�ntd|jd�dS)	Nrr/�:r�rg���z1No statistics object is current -- cannot reload.r)rr:r�r?r*r#r>rLrr�r&r�)r)r�errrrrr��szProfileBrowser.do_readcCs td|jd�td|jd�dS)Nz+Read in profile data from a specified file.r/z*Without argument, reload the current file.r�rxrrr�	help_read�szProfileBrowser.help_readcCs$|jr|j��ntd|jd�dS)Nr�r/r)r:ryr?r#r�rrr�
do_reverse�szProfileBrowser.do_reversecCstd|jd�dS)Nz/Reverse the sort order of the profiling report.r/r�rxrrr�help_reverse�szProfileBrowser.help_reversecs�|jstd|jd�dS|j���|rRt�fdd�|��D��rR|jj|���n<td|jd�tj�	�D]"\}}td||df|jd�qjdS)	Nr�r/c3s|]}|�kVqdSrvr)r�r��Zabbrevsrrr��sz)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %srr)
r:r?r#rl�allr�rurrhrN)r)rrmrrr�r�do_sort�s
zProfileBrowser.do_sortcCs td|jd�td|jd�dS)Nz.Sort profile data according to specified keys.r/z3(Typing `sort' without arguments lists valid keys.)r�rxrrr�	help_sort�szProfileBrowser.help_sortcs�fdd�tjD�S)Ncsg|]}|���r|�qSr)r�)r��a��textrr�
<listcomp>�s
z0ProfileBrowser.complete_sort.<locals>.<listcomp>)rrh)r)r�r*rr�r�
complete_sort�szProfileBrowser.complete_sortcCs|�d|�S)Nr�r�r�rrr�do_stats�szProfileBrowser.do_statscCstd|jd�|��dS)Nz.Print statistics from the current stat object.r/r�rxrrr�
help_stats�szProfileBrowser.help_statscCs$|jr|j��ntd|jd�dS)Nr�r/)r:r}r?r#r�rrr�do_strip�szProfileBrowser.do_stripcCstd|jd�dS)Nz<Strip leading path information from filenames in the report.r/r�rxrrr�
help_strip�szProfileBrowser.help_stripcCstd|jd�dS)NzShow help for a given command.r/r�rxrrr�	help_help�szProfileBrowser.help_helpcCs|r|SdSrvr)r)�stoprrrr�postcmd�szProfileBrowser.postcmd)N)rr r!r,r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�6s4
	r�rrgz*Welcome to the profile statistics browser.r/zGoodbye.)&r�r$rFrrDr�enumr�	functoolsr�__all__rrrrrrzr�rOrYr�r�r�rr��readline�ImportErrorr�r�r&�argvZinitprofileZbrowserr�r�r?r#Zcmdloop�KeyboardInterruptrrrr�<module>sR 
weakref.cpython-38.opt-1.pyc000064400000046042151450073350011570 0ustar00U

e5d�S�
@s�dZddlmZmZmZmZmZmZmZm	Z	ddl
mZmZddl
Z
ddlZddlZeefZddddd	d
ddd
ddddg
ZGdd�de�ZGdd�de
j�ZGdd�de�ZGdd	�d	e
j�ZGdd�d�ZdS)z{Weak reference support for Python.

This module is an implementation of PEP 205:

http://www.python.org/dev/peps/pep-0205/
�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr
�
WeakMethod�finalizecsDeZdZdZdZddd�Z�fdd�Zdd	�Zd
d�Ze	j
Z
�ZS)
rz�
    A custom `weakref.ref` subclass which simulates a weak reference to
    a bound method, working around the lifetime problem of bound methods.
    )�	_func_ref�
_meth_type�_alive�__weakref__Ncs~z|j}|j}Wn(tk
r8td�t|���d�YnX��fdd�}t�|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs&��}|jr"d|_�dk	r"�|�dS�NF)r)�arg�self��callbackZself_wr��/usr/lib64/python3.8/weakref.py�_cb3s
zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�clsZmethr�obj�funcrrrrrr#,s 
��
zWeakMethod.__new__cs2t���}|��}|dks"|dkr&dS|�||�S�N)�super�__call__rr)rr%r&��	__class__rrr)Bs

zWeakMethod.__call__cCs:t|t�r6|jr|js||kSt�||�o4|j|jkSdSr)�
isinstancerrr�__eq__r�r�otherrrrr-Is

zWeakMethod.__eq__cCs:t|t�r6|jr|js||k	St�||�p4|j|jkSdS�NT)r,rrr�__ne__rr.rrrr1Ps

zWeakMethod.__ne__)N)�__name__�
__module__�__qualname__�__doc__�	__slots__r#r)r-r1r�__hash__�
__classcell__rrr*rr$s
c@s�eZdZdZd,dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd-dd�Zdd�Zdd�ZeZdd�Zd d!�Zd"d#�Zd$d%�Zd.d&d'�Zd/d(d)�Zd*d+�ZdS)0rz�Mapping class that references values weakly.

    Entries in the dictionary will be discarded when no strong
    reference to the value exists anymore
    rcKs>t|�tfdd�}||_g|_t�|_i|_|j|f|�dS)NcSs6|�}|dk	r2|jr$|j�|j�n||j|j�dSr')�
_iterating�_pending_removals�append�key�data)�wr�selfrefZ_atomic_removalrrrr�removegs
z,WeakValueDictionary.__init__.<locals>.remove)rr	�_remover:�setr9r=�update)rr/�kwr@rrr�__init__fs	zWeakValueDictionary.__init__cCs(|j}|j}|r$|��}t||�qdSr')r:r=�popr	)r�l�dr<rrr�_commit_removalsws
z$WeakValueDictionary._commit_removalscCs4|jr|��|j|�}|dkr,t|��n|SdSr'�r:rIr=�KeyError�rr<�orrr�__getitem__�s
zWeakValueDictionary.__getitem__cCs|jr|��|j|=dSr')r:rIr=�rr<rrr�__delitem__�szWeakValueDictionary.__delitem__cCs|jr|��t|j�Sr')r:rI�lenr=�rrrr�__len__�szWeakValueDictionary.__len__cCs>|jr|��z|j|�}Wntk
r4YdSX|dk	SrrJrLrrr�__contains__�sz WeakValueDictionary.__contains__cCsd|jjt|�fS�Nz<%s at %#x>�r+r2�idrRrrr�__repr__�szWeakValueDictionary.__repr__cCs&|jr|��t||j|�|j|<dSr')r:rI�KeyedRefrAr=�rr<�valuerrr�__setitem__�szWeakValueDictionary.__setitem__c	CsV|jr|��t�}t|��0|j��D]\}}|�}|dk	r(|||<q(W5QRX|Sr')r:rIrrr=�items)r�newr<r>rMrrr�copy�s
zWeakValueDictionary.copyc	Csjddlm}|jr|��|��}t|��6|j��D]$\}}|�}|dk	r6|||||�<q6W5QRX|S�Nr)�deepcopy)r_rar:rIr+rr=r])r�memorar^r<r>rMrrr�__deepcopy__�s
z WeakValueDictionary.__deepcopy__NcCsP|jr|��z|j|}Wntk
r4|YSX|�}|dkrH|S|SdSr'rJ)rr<�defaultr>rMrrr�get�s
zWeakValueDictionary.getc	csR|jr|��t|��2|j��D] \}}|�}|dk	r"||fVq"W5QRXdSr'�r:rIrr=r])r�kr>�vrrrr]�s
zWeakValueDictionary.itemsc	csJ|jr|��t|��*|j��D]\}}|�dk	r"|Vq"W5QRXdSr'rf)rrgr>rrr�keys�s

zWeakValueDictionary.keysc	cs6|jr|��t|��|j��EdHW5QRXdS)a�Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        N�r:rIrr=�valuesrRrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc	csJ|jr|��t|��*|j��D]}|�}|dk	r"|Vq"W5QRXdSr'rj�rr>r%rrrrk�s
zWeakValueDictionary.valuescCs8|jr|��|j��\}}|�}|dk	r||fSqdSr')r:rIr=�popitem)rr<r>rMrrrrn�szWeakValueDictionary.popitemcGs`|jr|��z|j�|��}Wntk
r8d}YnX|dkrX|rN|dSt|��n|SdS)Nr)r:rIr=rFrK)rr<�argsrMrrrrFs

zWeakValueDictionary.popcCs`z|j|�}Wntk
r(d}YnX|dkrX|jr@|��t||j|�|j|<|S|SdSr')r=rKr:rIrYrA)rr<rdrMrrr�
setdefaults
zWeakValueDictionary.setdefaultcKsz|jr|��|j}|dk	rRt|d�s.t|�}|��D]\}}t||j|�||<q6|��D]\}}t||j|�||<qZdS�Nr])r:rIr=�hasattr�dictr]rYrA)rr/�kwargsrHr<rMrrrrCs
zWeakValueDictionary.updatecCs|jr|��t|j���S)a~Return a list of weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        )r:rI�listr=rkrRrrr�	valuerefs(s
zWeakValueDictionary.valuerefs)r)N)N)N)r2r3r4r5rErIrNrPrSrTrXr\r_�__copy__rcrer]ri�__iter__rlrkrnrFrprCrvrrrrrZs.
			
			

cs,eZdZdZdZdd�Z�fdd�Z�ZS)rYa[Specialized reference that includes a key corresponding to the value.

    This is used in the WeakValueDictionary to avoid having to create
    a function object for each key stored in the mapping.  A shared
    callback object can use the 'key' attribute of a KeyedRef instead
    of getting a reference to the key from an enclosing scope.

    �r<cCst�|||�}||_|Sr')rr#r<)r"�obrr<rrrrr#CszKeyedRef.__new__cst��||�dSr')r(rE)rrzrr<r*rrrEHszKeyedRef.__init__)r2r3r4r5r6r#rEr8rrr*rrY7s	rYc@s�eZdZdZd+dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd,dd�Zdd�Zdd�Zdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zd-d'd(�Zd.d)d*�ZdS)/ra� Mapping class that references keys weakly.

    Entries in the dictionary will be discarded when there is no
    longer a strong reference to the key. This can be used to
    associate additional data with an object owned by other parts of
    an application without adding attributes to those objects. This
    can be especially useful with objects that override attribute
    accesses.
    NcCsFi|_t|�fdd�}||_g|_t�|_d|_|dk	rB|�|�dS)NcSs.|�}|dk	r*|jr"|j�|�n|j|=dSr')r9r:r;r=)rgr?rrrrr@Ys
z*WeakKeyDictionary.__init__.<locals>.removeF)r=rrAr:rBr9�
_dirty_lenrC)rrsr@rrrrEWszWeakKeyDictionary.__init__cCs:|j}|j}|r6z||��=Wqtk
r2YqXqdSr')r:r=rFrK)rrGrHrrrrIhsz"WeakKeyDictionary._commit_removalscs&|j��fdd�|jD�|_d|_dS)Ncsg|]}|�kr|�qSrr)�.0rg�rHrr�
<listcomp>wsz5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r=r:r{rRrr}r�_scrub_removalsusz!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dSr0)r{r=rrOrrrrPzszWeakKeyDictionary.__delitem__cCs|jt|�Sr')r=rrOrrrrN~szWeakKeyDictionary.__getitem__cCs(|jr|jr|��t|j�t|j�Sr')r{r:rrQr=rRrrrrS�szWeakKeyDictionary.__len__cCsd|jjt|�fSrUrVrRrrrrX�szWeakKeyDictionary.__repr__cCs||jt||j�<dSr')r=rrArZrrrr\�szWeakKeyDictionary.__setitem__c	CsHt�}t|��0|j��D]\}}|�}|dk	r|||<qW5QRX|Sr')rrr=r])rr^r<r[rMrrrr_�s
zWeakKeyDictionary.copyc	Cs\ddlm}|��}t|��6|j��D]$\}}|�}|dk	r(|||�||<q(W5QRX|Sr`)r_rar+rr=r])rrbrar^r<r[rMrrrrc�s
zWeakKeyDictionary.__deepcopy__cCs|j�t|�|�Sr')r=rer�rr<rdrrrre�szWeakKeyDictionary.getcCs.zt|�}Wntk
r"YdSX||jkSr)rr r=)rr<r>rrrrT�s
zWeakKeyDictionary.__contains__c	csDt|��2|j��D] \}}|�}|dk	r||fVqW5QRXdSr'�rr=r])rr>r[r<rrrr]�s

zWeakKeyDictionary.itemsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr')rr=rmrrrri�s


zWeakKeyDictionary.keysc	cs<t|��*|j��D]\}}|�dk	r|VqW5QRXdSr'r�)rr>r[rrrrk�s

zWeakKeyDictionary.valuescCs
t|j�S)azReturn a list of weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        )rur=rRrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCs0d|_|j��\}}|�}|dk	r||fSqdSr0)r{r=rn)rr<r[rMrrrrn�s
zWeakKeyDictionary.popitemcGsd|_|jjt|�f|��Sr0)r{r=rFr)rr<rorrrrF�szWeakKeyDictionary.popcCs|j�t||j�|�Sr')r=rprrAr�rrrrp�szWeakKeyDictionary.setdefaultcKs\|j}|dk	rFt|d�s$ti�|�}|��D]\}}||t||j�<q,t|�rX|�|�dSrq)r=rrr"r]rrArQrC)rrsrtrHr<r[rrrrC�s
zWeakKeyDictionary.update)N)N)N)N)r2r3r4r5rErIrrPrNrSrXr\r_rwrcrerTr]rirxrkr�rnrFrprCrrrrrLs.


	


c@s�eZdZdZdZiZdZe��Z	dZ
dZGdd�d�Zdd�Z
de
_dd
d�Zdd
�Zdd�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��Zd	S)raClass for finalization of weakrefable objects

    finalize(obj, func, *args, **kwargs) returns a callable finalizer
    object which will be called when obj is garbage collected. The
    first time the finalizer is called it evaluates func(*arg, **kwargs)
    and returns the result. After this the finalizer is dead, and
    calling it just returns None.

    When the program exits any remaining finalizers for which the
    atexit attribute is true will be run in reverse order of creation.
    By default atexit is true.
    rFc@seZdZdZdS)zfinalize._Info)�weakrefr&rort�atexit�indexN)r2r3r4r6rrrr�_Infosr�cOs>t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|js�ddl}|�	|j
�dt_|��}t
||�|_||_||_|�pd|_d|_t|j�|_||j|<dt_dS)
N�z<descriptor '__init__' of 'finalize' object needs an argumentr&z9finalize expected at least 2 positional arguments, got %d��rz0Passing 'func' as keyword argument is deprecated)�
stacklevelr%z/Passing 'obj' as keyword argument is deprecatedT)rQr rF�warnings�warn�DeprecationWarning�tuple�_registered_with_atexitr��register�	_exitfuncrr�rr�r&rort�next�_index_iterr��	_registry�_dirty)rortrr%r&r�r��inforrrrEsR

�

�
�
�
zfinalize.__init__z&($self, obj, func, /, *args, **kwargs)NcCs0|j�|d�}|r,|js,|j|j|jp(i�SdS)zZIf alive then mark as dead and return func(*args, **kwargs);
        otherwise return NoneN)r�rF�	_shutdownr&rort)r�_r�rrrr)1s
zfinalize.__call__cCsH|j�|�}|o|��}|dk	rD|j�|d�rD||j|j|jp@ifSdS)z^If alive then mark as dead and return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�rFr&rort�rr�r%rrr�detach8szfinalize.detachcCs:|j�|�}|o|��}|dk	r6||j|j|jp2ifSdS)zMIf alive then return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�r&rortr�rrr�peek@sz
finalize.peekcCs
||jkS)zWhether finalizer is alive)r�rRrrr�aliveHszfinalize.alivecCs|j�|�}t|�o|jS)z*Whether finalizer should be called at exit�r�re�boolr�)rr�rrrr�Mszfinalize.atexitcCs|j�|�}|rt|�|_dSr'r�)rr[r�rrrr�SscCs^|j�|�}|o|��}|dkr6dt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)r�rer�r"r2rWr�rrrrXYs�zfinalize.__repr__cCs2dd�|j��D�}|jdd�d�dd�|D�S)NcSsg|]\}}|jr||f�qSr)r��r|�f�irrrr~esz-finalize._select_for_exit.<locals>.<listcomp>cSs
|djS)Nr�)r�)�itemrrr�<lambda>f�z+finalize._select_for_exit.<locals>.<lambda>rycSsg|]\}}|�qSrrr�rrrr~gs)r�r]�sort)r$�Lrrr�_select_for_exitbszfinalize._select_for_exitcCs�d}z�|jr�ddl}|��r(d}|��d}|dks:tjrH|��}dt_|sNq�|�	�}z
|�Wq,t
k
r�tjt�
��Yq,Xq,W5dt_|r�|��XdS)NFTr)rr�Zenabler��gcZ	isenabledZdisabler�r�rF�	Exception�sys�
excepthook�exc_info)r$Zreenable_gcr�Zpendingr�rrrr�is,
zfinalize._exitfunc)N)r2r3r4r5r6r�r��	itertools�countr�r�r�r�rE�__text_signature__r)r�r��propertyr�r��setterrX�classmethodr�r�rrrrr�s0*



	
)r5�_weakrefrrrrrrrr	Z_weakrefsetr
r�_collections_abcr�r�r
�__all__r�MutableMappingrrYrrrrrr�<module>s0(
�6^socket.cpython-38.opt-1.pyc000064400000066145151450073350011442 0ustar00U

e5d���@sdZddlZddlTddlZddlZddlZddlZddlmZmZzddl	Z	Wne
k
rhdZ	YnXee	dd�Zee	dd�Z
ee	d	d�Zd
ddd
dddgZe�e�e��e�dedd��e�dedd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r$iZded<ded <d!ed"<d#ed$<d%ed&<d'ed(<d)ed*<d+ed,<d-ed.<d/ed0<d1ed2<d3ed4<d5ed6<d7ed8<d9ed:<d;ed<<d=ed><d?ed@<dAedB<dCedD<dEedF<dGedH<dIedJ<dKedL<dMedN<dOedP<dQedR<dSedT<dUedV<dWedX<dYedZ<d[ed\<d]ed^<d_ed`<daedb<dcedd<deedf<dgedh<diedj<dkedl<dmedn<doedp<dqedr<dsedt<duedv<dwedx<dyedz<d{ed|<d}ed~<ded�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<e�d١Gd�dۄd�e�ZGd�d݄d�ej�Zd�d�d
�Z e!ejd߃�rpd�d�Z"e�d�e!ed��r�de#dfd�d�Z$ne%e#dfd�d�Z$e�d�d�e$_e
ehZ&Gd�d�d�ej'�Z(d�d�d�Z)e*�Z+e+dfd�d�Z,d�d�Z-e%dd�d�d�d�d
�Z.d�d�d�Z/dS)�a0This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available as methods of the socket object.

Functions:

socket() -- create a new socket object
socketpair() -- create a pair of new socket objects [*]
fromfd() -- create a socket object from an open file descriptor [*]
fromshare() -- create a socket object from data received from socket.share() [*]
gethostname() -- return the current hostname
gethostbyname() -- map a hostname to its IP number
gethostbyaddr() -- map an IP number or hostname to DNS info
getservbyname() -- map a service name and a protocol name to a port number
getprotobyname() -- map a protocol name (e.g. 'tcp') to a number
ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order
htons(), htonl() -- convert 16, 32 bit int from host to network byte order
inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format
inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
create_connection() -- connects to an address, with an optional timeout and
                       optional source address.

 [*] not available on all platforms!

Special objects:

SocketType -- type object for socket objects
error -- exception raised for I/O errors
has_ipv6 -- boolean value indicating if IPv6 is supported

IntEnum constants:

AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)

Integer constants:

Many other constants may be defined; these may be used in calls to
the setsockopt() and getsockopt() methods.
�N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�/usr/lib64/python3.8/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_rrrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrVrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr[rz	127.0.0.1z::1cCs(z
||�WStk
r"|YSXdS)z{Convert a numeric family value to an IntEnum member.

    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converteras
r�winz)Specified event object handle is invalid.�zInsufficient memory available.�z#One or more parameters are invalid.�WzOverlapped operation aborted.i�z2Overlapped I/O event object not in signaled state.i�z)Overlapped operation will complete later.i�zThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i�'zHost not found.i�*z Nonauthoritative host not found.i�*zThis is a nonrecoverable error.i�*z*Valid name, no data record requested type.i�*zQoS receivers.i�*zQoS senders.i�*zNo QoS senders.i�*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i	+zInvalid QoS provider buffer.i
+zInvalid QoS filter style.i+i+zIncorrect QoS filter count.i
+zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+�errorTabc@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr"�sr"cs,eZdZdZdddgZd9dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zd:dddd�dd�Ze
ed�rzd;dd�Zn
d<dd�Zd=dd�Zd d!�Zd>d"d#�Zd$d%�Zejfd&d'�Zd(d)�Z�fd*d+�Ze�fd,d-��Ze�fd.d/��Zejd0k�rd1d2�Zd3d4�Znd5d2�Zd6d4�Zd7e_d8e_�ZS)?�socketz:A subclass of _socket.socket adding the makefile() method.�__weakref__�_io_refs�_closed���NcCsP|dkr,|dkrt}|dkr t}|dkr,d}tj�|||||�d|_d|_dS)Nr*rF)�AF_INET�SOCK_STREAM�_socketr&�__init__r(r))�self�family�type�proto�filenorrrr.�szsocket.__init__cCs|S�Nr�r/rrr�	__enter__�szsocket.__enter__cGs|js|��dSr4)r)�close)r/�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�z |��}|r^|dt	|�7}Wnt
k
rtYnXz |��}|r�|dt	|�7}Wnt
k
r�YnX|d7}|S)	zVWrap __repr__() to reveal the real class name and socket
        address(es).
        r)Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)�getattr�	__class__r$r%r3r0r1r2�getsockname�str�errorZgetpeername)r/�closed�sZladdrZraddrrrr�__repr__�s4
��zsocket.__repr__cCstd|jj�d���dS)Nzcannot pickle z object)�	TypeErrorr=r#r5rrr�__getstate__szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)z�dup() -> socket object

        Duplicate the socket. Return a new socket object connected to the same
        system resource. The new socket is non-inheritable.
        �r3)�dupr3r=r0r1r2�
settimeout�
gettimeout)r/�fd�sockrrrrGsz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dkr>|��r>|�d�||fS)z�accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket
        representing the connection, and the address of the client.
        For IP sockets, the address info is a pair (hostaddr, port).
        rFNT)Z_acceptr&r0r1r2ZgetdefaulttimeoutrI�setblocking)r/rJ�addrrKrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cs�t|�dddhks td|f��d|k}d|kp4|}d|k}d}	|rN|	d7}	|rZ|	d7}	t||	�}
|jd7_|dkr~d}|d	kr�tj}|d	kr�|s�td
��|
S|r�|r�t�|
|
|�}n|r�t�|
|�}nt�|
|�}|r�|St�	||||�}||_
|S)z�makefile(...) -> an I/O stream connected to the socket

        The arguments are as for io.open() after the filename, except the only
        supported mode values are 'r' (default), 'w' and 'b'.
        rO�w�bz&invalid mode %r (only r, w, b allowed)r:�Nr*rz!unbuffered streams must be binary)�setr�SocketIOr(�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r/r^�	bufferingrPrQrRZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile-s<
zsocket.makefile�sendfilerc
Cs�|�|||�|��}z|��}Wn0ttjfk
rR}zt|��W5d}~XYnXzt�|�j}Wn*t	k
r�}zt|��W5d}~XYnX|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
z�|	�r||	��st�d��|�r0||}|dk�r0�q�z|
||||�}Wn`tk
�rh|	�s`|�Yq�Yq�t	k
�r�}z|dk�r�t|��|d�W5d}~XYq�X|dk�r��q�||7}||7}q�|W�S|dk�r�t
|d��r�|�|�XdS)Nri@�&non-blocking sockets are not supported�PollSelector�seekz	timed out)�_check_sendfile_paramsr3�AttributeErrorrX�UnsupportedOperationr"�os�fstat�st_size�OSError�minrIr�hasattr�	selectorsrfZSelectSelector�registerZEVENT_WRITEZselectrdrgr-�timeout�BlockingIOError)r/�file�offset�countZsocknor3�errZfsize�	blocksizersZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileYs^






zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r"�r/rurvrwrrrr|�s�c

Cs�|�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�|rpt|||�}|dkrpq�t||��}|s�q�z||�}	Wnt	k
r�Yq�Yq�X||	7}|	t
|�kr�||	d�}q�qTq�qT|W�S|dkr�t|d�r�|�||�XdS)Nrrei rg)rhrIrrgro�read�sendrp�
memoryviewrt�len)
r/rurvrwryrzZ	file_readZ	sock_send�datar{rrr�_sendfile_use_send�s8

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`t|t�sJtd�|���|dkr`td�|���dS)NrTr^z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr1r,�
isinstance�intrD�formatr}rrrrh�s

��zsocket._check_sendfile_paramscCs8z|�|||�WStk
r2|�|||�YSXdS)a_sendfile(file[, offset[, count]]) -> sent

        Send a file until EOF is reached by using high-performance
        os.sendfile() and return the total number of bytes which
        were sent.
        *file* must be a regular file object opened in binary mode.
        If os.sendfile() is not available (e.g. Windows) or file is
        not a regular file socket.send() will be used instead.
        *offset* tells from where to start reading the file.
        If specified, *count* is the total number of bytes to transmit
        as opposed to sending the file until EOF is reached.
        File position is updated on return or also in case of error in
        which case file.tell() can be used to figure out the number of
        bytes which were sent.
        The socket must be of SOCK_STREAM type.
        Non-blocking sockets are not supported.
        N)r|r"r�r}rrrrd�szsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrU)r(r)r7r5rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dSr4)r7)r/Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r)r(r�r5rrrr7�s
zsocket.closecsd|_t���S)adetach() -> file descriptor

        Close the socket object without closing the underlying file descriptor.
        The object cannot be used after this call, but the file descriptor
        can be reused for other purposes.  The file descriptor is returned.
        T)r)�super�detachr5�r=rrr��sz
socket.detachcstt�jt�S)z@Read-only access to the address family for this socket.
        )rr�r0rr5r�rrr0sz
socket.familycstt�jt�S)z-Read-only access to the socket type.
        )rr�r1rr5r�rrr1szsocket.type�ntcCst�|���Sr4)rkZget_handle_inheritabler3r5rrr�get_inheritable
szsocket.get_inheritablecCst�|��|�dSr4)rkZset_handle_inheritabler3�r/Zinheritablerrr�set_inheritableszsocket.set_inheritablecCst�|���Sr4)rkr�r3r5rrrr�scCst�|��|�dSr4)rkr�r3r�rrrr�sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r*r*r*N)rON)rN)rN)rN)rN) r#r$r%�__doc__�	__slots__r.r6r9rCrErGrNrcrprkr|r�rhrdr�r-r&r�r7r��propertyr0r1�namer�r��
__classcell__rrr�rr&�sF

�*
A

$


r&cCst|�}t||||�S)z� fromfd(fd, family, type[, proto]) -> socket object

    Create a socket object from a duplicate of the given file
    descriptor.  The remaining arguments are the same as for socket().
    )rGr&)rJr0r1r2Znfdrrrr
sZsharecCstddd|�S)z� fromshare(info) -> socket object

        Create a socket object from the bytes object returned by
        socket.share(pid).
        r)r&)�inforrr�	fromshare#sr��
socketpaircCsh|dkr*zt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fS)aasocketpair([family[, type[, proto]]]) -> (socket object, socket object)

        Create a pair of socket objects from the sockets returned by the platform
        socketpair() function.
        The arguments are the same as for socket() except the default family is
        AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
        N)ZAF_UNIX�	NameErrorr+r-r�r&r�)r0r1r2�arTrrrr�.s
c
	Cs|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|�	�|�
�dd�\}}t|||�}zP|�d�z|�||f�Wnt
tfk
r�YnX|�d�|��\}}	Wn|���YnXW5|��X||fS)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FT)r+�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6rr,r&r7�bind�listenr>rL�connectrt�InterruptedErrorrN)
r0r1r2�hostZlsockrM�portZcsockZssock�_rrrr�Cs8


a8socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
cspeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Z�fdd
�Z	dd�Z
edd��Zedd��Z
dd�Z�ZS)rWz�Raw I/O implementation for stream sockets.

    This class supports the makefile() method on sockets.  It provides
    the raw I/O interface on top of a socket object.
    cCsZ|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_d|_dS)N)rOrSZrw�rb�wbZrwbzinvalid mode: %rrTrOrSF)	rrX�	RawIOBaser.�_sock�_mode�_reading�_writing�_timeout_occurred)r/rKr^rrrr.�s

zSocketIO.__init__c
Cs�|��|��|jrtd��z|j�|�WStk
rHd|_�Yqtk
r�}z|jdt	krpWY�
dS�W5d}~XYqXqdS)a3Read up to len(b) bytes into the writable buffer *b* and return
        the number of bytes read.  If the socket is non-blocking and no bytes
        are available, None is returned.

        If *b* is non-empty, a 0 return value indicates that the connection
        was shutdown at the other end.
        z!cannot read from timed out objectTrN)
�_checkClosed�_checkReadabler�rnr�Z	recv_intorsr@r8�_blocking_errnos�r/rT�errr�readinto�s
zSocketIO.readintoc
Cs`|��|��z|j�|�WStk
rZ}z|jdtkrHWY�
dS�W5d}~XYnXdS)aWrite the given bytes or bytearray object *b* to the socket
        and return the number of bytes written.  This can be less than
        len(b) if not all data could be written.  If the socket is
        non-blocking and no bytes could be written None is returned.
        rN)r��_checkWritabler�rr@r8r�r�rrr�write�s
zSocketIO.writecCs|jrtd��|jS)z2True if the SocketIO is open for reading.
        �I/O operation on closed socket.)rArr�r5rrr�readable�szSocketIO.readablecCs|jrtd��|jS)z2True if the SocketIO is open for writing.
        r�)rArr�r5rrr�writable�szSocketIO.writablecs|jrtd��t���S)z2True if the SocketIO is open for seeking.
        r�)rArr��seekabler5r�rrr��szSocketIO.seekablecCs|��|j��S)z=Return the file descriptor of the underlying socket.
        )r�r�r3r5rrrr3�szSocketIO.filenocCs|js|��SdSdS)Nr*)rAr3r5rrrr��sz
SocketIO.namecCs|jSr4)r�r5rrrr^�sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dS)z�Close the SocketIO object.  This doesn't close the underlying
        socket, except if all references to it have disappeared.
        N)rArXr�r7r�r�r5rrrr7�s

zSocketIO.close)r#r$r%r�r.r�r�r�r�r�r3r�r�r^r7r�rrr�rrWrs

rWr:cCsl|��}|r|dkrt�}zt|�\}}}Wntk
r@Yn(X|�d|�|D]}d|krRqhqR|}|S)aGet fully qualified domain name from name.

    An empty argument is interpreted as meaning the local host.

    First the hostname returned by gethostbyaddr() is checked, then
    possibly existing aliases. In case no FQDN is available, hostname
    from gethostname() is returned.
    z0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrr�s	cCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|tk	rP|�|�|r^|�|�|�|�d}|WStk
r�}
z|
}|dk	r�|��W5d}
~
XYqXq|dk	r�z|�W5d}Xntd��dS)acConnect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    A host of '' or port 0 tells the OS to use the default.
    Nrz!getaddrinfo returns an empty list)	�getaddrinfor,r&�_GLOBAL_DEFAULT_TIMEOUTrHr�r�r@r7)�addressrsZsource_addressr�r�rx�res�af�socktyper2�	canonname�sarKr�rrrrs.



c	Csltrttd�rttd�sdSz4ttt�� }|�ttd�W5QR�WdSQRXWnt	k
rfYdSXdS)z�Return True if the platform supports creating a SOCK_STREAM socket
    which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections.
    �IPPROTO_IPV6�IPV6_V6ONLYFrTN)
�has_ipv6rpr-r&r�r,�
setsockoptr�r�r@)rKrrrr0s��F)r0�backlog�
reuse_port�dualstack_ipv6c
Csn|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdkr�ttd�r�z|�	t
td�Wntk
r�YnX|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�Wn@tk
�r$}z d|j|f}t|j|�d�W5d}~XYnX|dk�r:|��n
|�|�|WStk
�rh|���YnXdS)
a�Convenience function which creates a SOCK_STREAM type socket
    bound to *address* (a 2-tuple (host, port)) and return the socket
    object.

    *family* should be either AF_INET or AF_INET6.
    *backlog* is the queue size passed to socket.listen().
    *reuse_port* dictates whether to use the SO_REUSEPORT socket option.
    *dualstack_ipv6*: if true and the platform supports it, it will
    create an AF_INET6 socket able to accept both IPv4 or IPv6
    connections. When false it will explicitly disable this option on
    platforms that enable it by default (e.g. Linux).

    >>> with create_server(('', 8000)) as server:
    ...     while True:
    ...         conn, addr = server.accept()
    ...         # handle new connection
    �SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)r��cygwin�SO_REUSEADDRrUrr�r�z+%s (while attempting to bind on address %r)N)rpr-rrr�r&r,rkr�r�Z
SOL_SOCKETr�r@r�r�r�r�r��strerror�errnor�r7)r�r0r�r�r�rKrx�msgrrrr
@sN


�
�� 


cCsPg}t�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�q|S)a�Resolve host and port into list of address info entries.

    Translate the host/port argument into a sequence of 5-tuples that contain
    all the necessary arguments for creating a socket connected to that service.
    host is a domain name, a string representation of an IPv4/v6 address or
    None. port is a string service name such as 'http', a numeric port number or
    None. By passing None as the value of host and port, you can pass NULL to
    the underlying C API.

    The family, type and proto arguments can be optionally specified in order to
    narrow the list of addresses returned. Passing zero as a value for each of
    these arguments selects the full range of results.
    )r-r��appendrrr)r�r�r0r1r2�flagsZaddrlistr�r�r�r�r�rrrr��s�r�)r)r:)rrrr)0r�r-rk�sysrXrq�enumrrr��ImportErrorr<rrr	�__all__�extend�_get_exports_list�	_convert_r#r�r�rr&Z_realsocket�platform�lowerrr!r��	Exceptionr"r
rpr�r,r�r+r�r�rWr�objectr�rrr
r�rrrr�<module>sH- 
�����

F
	
$
u
�
-�Edoctest.cpython-38.opt-1.pyc000064400000223725151450073350011616 0ustar00U

e5d_��!@stdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"g!Zd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$l	Z	d#d$l
Z
d#d$lZd#d$lZd#d%l
mZd#d&lmZed'd(�ZiZd)d�Zed�Zed�Zed�Zed�Zed�Zed�ZeeBeBeBeBeBZed
�Zed�Zed�Zed
�Zed�ZeeBeBeBeBZ d*Z!d+Z"d,d-�Z#dsd/d0�Z$d1d2�Z%d3d4�Z&dtd6d7�Z'd8d9�Z(Gd:d;�d;e�Z)d<d=�Z*d>d?�Z+d@dA�Z,GdBdC�dCej-�Z.dDdE�Z/GdFd�d�Z0GdGd�d�Z1GdHd�d�Z2GdId�d�Z3GdJd�d�Z4GdKd�d�Z5GdLd�de6�Z7GdMd�de6�Z8GdNd�de4�Z9d$a:dudQd�Z;dOd$d$d$d$dOd#d$dPe2�d$fdRd�Z<dvdTd�Z=d#a>dUd�Z?GdVdW�dWej@�ZAGdXdY�dYeA�ZBGdZd[�d[ejC�ZDdwd\d�ZEGd]d^�d^eA�ZFdOd$d$e2�d$fd_d`�ZGdad�ZHdbd�ZIdcd �ZJdxddd!�ZKdydedf�ZLdzdgd"�ZMGdhdi�di�ZNeNdjdkdldmdndo�ZOdpdq�ZPeQdrk�rpe
�ReP��d$S){a�Module doctest -- a framework for running examples in docstrings.

In simplest use, end each module M to be tested with:

def _test():
    import doctest
    doctest.testmod()

if __name__ == "__main__":
    _test()

Then running the module as a script will cause the examples in the
docstrings to get executed and verified:

python M.py

This won't display anything unless an example fails, in which case the
failing example(s) and the cause(s) of the failure(s) are printed to stdout
(why not stderr? because stderr is a lame hack <0.2 wink>), and the final
line of output is "Test failed.".

Run it with the -v switch instead:

python M.py -v

and a detailed report of all examples tried is printed to stdout, along
with assorted summaries at the end.

You can force verbose mode by passing "verbose=True" to testmod, or prohibit
it by passing "verbose=False".  In either of those cases, sys.argv is not
examined by testmod.

There are a variety of other ways to run doctests, including integration
with the unittest framework, and support for running non-Python text
files containing doctests.  There are also many ways to override parts
of doctest's default behaviors.  See the Library Reference Manual for
details.
zreStructuredText en�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS�	FAIL_FAST�Example�DocTest�
DocTestParser�
DocTestFinder�
DocTestRunner�
OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples�
testsource�	debug_src�debug�N)�StringIO)�
namedtuple�TestResultszfailed attemptedcCst�|dtt�>�S)N�)�OPTIONFLAGS_BY_NAME�
setdefault�len��name�r,�/usr/lib64/python3.8/doctest.pyr�sz<BLANKLINE>z...cCs8d}tjD](}|�|d�}|tt|�kr
||jO}q
|S)z�
    Return the compiler-flags associated with the future features that
    have been imported into the given namespace (globs).
    r"N)�
__future__Zall_feature_names�get�getattrZ
compiler_flag)�globs�flagsZfnameZfeaturer,r,r-�_extract_future_flags�s
r3�cCsVt�|�r|St|t�r,t|t�t�dg�S|dkrJtjt�	|�j
dStd��dS)a�
    Return the module specified by `module`.  In particular:
      - If `module` is a module, then return module.
      - If `module` is a string, then import and return the
        module with that name.
      - If `module` is None, then return the calling module.
        The calling module is assumed to be the module of
        the stack frame at the given depth in the call stack.
    �*N�__name__z"Expected a module, string, or None)�inspect�ismodule�
isinstance�str�
__import__�globals�locals�sys�modules�	_getframe�	f_globals�	TypeError)�moduleZdepthr,r,r-�_normalize_module�s


rDcCsdD]}|�|d�}q|S)N)z
�
�
)�replace)�data�newliner,r,r-�_newline_convert�srJc
Cs�|rVt|d�}t||�}t|dd�dk	rVt|jd�rV|j�|�}|�|�}t|�|fSt||d��}|�	�|fW5QR�SQRXdS)N��
__loader__�get_data)�encoding)
rD�_module_relative_pathr0�hasattrrLrM�decoderJ�open�read)�filename�package�module_relativerNZ
file_contents�fr,r,r-�_load_testfile�s


rX�cCst�d|d|�S)z~
    Add the given number of space characters to the beginning of
    every non-blank line in `s`, and return the result.
    z
(?m)^(?!$)� )�re�sub)�s�indentr,r,r-�_indent�sr_cCs*t�}|\}}}tj||||d�|��S)zz
    Return a string containing a traceback message for the given
    exc_info tuple (as returned by sys.exc_info()).
    )�file)r#�	traceback�print_exception�getvalue)�exc_infoZexcout�exc_typeZexc_valZexc_tbr,r,r-�_exception_traceback�s
rfc@seZdZdd�Zddd�ZdS)�	_SpoofOutcCs$t�|�}|r |�d�s |d7}|S�NrF)r#rc�endswith)�self�resultr,r,r-rcs
z_SpoofOut.getvalueNcCs|�|�t�|�dS�N)�seekr#�truncate)rj�sizer,r,r-rn	s
z_SpoofOut.truncate)N)r6�
__module__�__qualname__rcrnr,r,r,r-rg�s	rgcCs�t|kr||kS|�t�}dt|�}}|d}|rR|�|�rNt|�}|d=ndS|d}|r�|�|�r||t|�8}|d=ndS||kr�dS|D],}|�|||�}|dkr�dS|t|�7}q�dS)z_
    Essentially the only subtle case:
    >>> _ellipsis_match('aa...aa', 'aaa')
    False
    r"F���T)�ELLIPSIS_MARKER�splitr)�
startswithri�find)�want�gotZws�startpos�endpos�wr,r,r-�_ellipsis_matchs0


r|cCs|��}|rd|SdSdS)z)Return a commented form of the given linez# �#N)�rstrip)�liner,r,r-�
_comment_line?sr�cCshdt|�}}|�d�}|dkr$|}|�dd|�}|dkr>|}|�dd|�}|dkr\|d}|||�S)Nr"rF�:�.r&)r)rv�rfind)�msg�start�end�ir,r,r-�_strip_exception_detailsGs
r�c@s2eZdZdZdd�Zddd�Zdd�Zd	d
�ZdS)�_OutputRedirectingPdbz�
    A specialized version of the python debugger that redirects stdout
    to a given stream when interacting with the user.  Stdout is *not*
    redirected when traced code is executed.
    cCs(||_d|_tjj||dd�d|_dS)NFT)�stdout�nosigintr&)�_OutputRedirectingPdb__out�$_OutputRedirectingPdb__debugger_used�pdb�Pdb�__init__Zuse_rawinput)rj�outr,r,r-r�gsz_OutputRedirectingPdb.__init__NcCs*d|_|dkrt��j}tj�||�dS)NT)r�r>r@�f_backr�r��	set_trace)rj�framer,r,r-r�os
z_OutputRedirectingPdb.set_tracecCs|jrtj�|�dSrl)r�r�r��set_continue�rjr,r,r-r�usz"_OutputRedirectingPdb.set_continuecGs2tj}|jt_ztjj|f|��W�S|t_XdSrl)r>r�r�r�r��trace_dispatch)rj�args�save_stdoutr,r,r-r�{s
z$_OutputRedirectingPdb.trace_dispatch)N)r6rprq�__doc__r�r�r�r�r,r,r,r-r�as

r�cCs�t�|�std|��|�d�r(td��tjj|�d��}t	|d�rXtj�|j
�d}n�|jdkr�tt
j�dkr�t
jddkr�tj�t
jd�d}q�tj}nFt	|d�r�|jD]&}tj�||�}tj�|�r�|Sq�td	|j��tj�||�S)
NzExpected a module: %r�/z1Module-relative files may not have absolute paths�__file__r"�__main__��__path__zBCan't resolve paths relative to the module %r (it has no __file__))r7r8rBru�
ValueError�os�path�joinrtrPr�r6r)r>�argv�curdirr��exists)rCZ	test_pathZbasedirZ	directory�fullpathr,r,r-rO�s(






�rOc@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ran
    A single doctest example, consisting of source code and expected
    output.  `Example` defines the following attributes:

      - source: A single Python statement, always ending with a newline.
        The constructor adds a newline if needed.

      - want: The expected output from running the source code (either
        from stdout, or a traceback in case of exception).  `want` ends
        with a newline unless it's empty, in which case it's an empty
        string.  The constructor adds a newline if needed.

      - exc_msg: The exception message generated by the example, if
        the example is expected to generate an exception; or `None` if
        it is not expected to generate an exception.  This exception
        message is compared against the return value of
        `traceback.format_exception_only()`.  `exc_msg` ends with a
        newline unless it's `None`.  The constructor adds a newline
        if needed.

      - lineno: The line number within the DocTest string containing
        this Example where the Example begins.  This line number is
        zero-based, with respect to the beginning of the DocTest.

      - indent: The example's indentation in the DocTest string.
        I.e., the number of space characters that precede the
        example's first prompt.

      - options: A dictionary mapping from option flags to True or
        False, which is used to override default options for this
        example.  Any option flags not contained in this dictionary
        are left at their default value (as specified by the
        DocTestRunner's optionflags).  By default, no options are set.
    Nr"cCsv|�d�s|d7}|r(|�d�s(|d7}|dk	rB|�d�sB|d7}||_||_||_||_|dkrfi}||_||_dSrh)ri�sourcerw�linenor^�options�exc_msg)rjr�rwr�r�r^r�r,r,r-r��s
zExample.__init__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)�type�NotImplementedr�rwr�r^r�r��rj�otherr,r,r-�__eq__�s
�
�
�
�
�zExample.__eq__cCst|j|j|j|j|jf�Srl)�hashr�rwr�r^r�r�r,r,r-�__hash__�s�zExample.__hash__)Nr"r"N)r6rprqr�r�r�r�r,r,r,r-r�s"�
c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rae
    A collection of doctest examples that should be run in a single
    namespace.  Each `DocTest` defines the following attributes:

      - examples: the list of examples.

      - globs: The namespace (aka globals) that the examples should
        be run in.

      - name: A name identifying the DocTest (typically, the name of
        the object whose docstring this DocTest was extracted from).

      - filename: The name of the file that this DocTest was extracted
        from, or `None` if the filename is unknown.

      - lineno: The line number within filename where this DocTest
        begins, or `None` if the line number is unavailable.  This
        line number is zero-based, with respect to the beginning of
        the file.

      - docstring: The string that the examples were extracted from,
        or `None` if the string is unavailable.
    cCs,||_||_|��|_||_||_||_dS)z�
        Create a new DocTest containing the given examples.  The
        DocTest's globals are initialized with a copy of `globs`.
        N)�examples�	docstring�copyr1r+rTr�)rjr�r1r+rTr�r�r,r,r-r�s
zDocTest.__init__cCsRt|j�dkrd}n"t|j�dkr(d}ndt|j�}d|jj|j|j|j|fS)Nr"zno examplesr&z	1 examplez%d examplesz<%s %s from %s:%s (%s)>)r)r��	__class__r6r+rTr�)rjr�r,r,r-�__repr__s��zDocTest.__repr__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)r�r�r�r�r1r+rTr�r�r,r,r-r�)s
�
�
�
�
�zDocTest.__eq__cCst|j|j|j|jf�Srl)r�r�r+rTr�r�r,r,r-r�4szDocTest.__hash__cCs:t|t�stS|j|j|jt|�f|j|j|jt|�fkSrl)r9rr�r+rTr��idr�r,r,r-�__lt__8s

�zDocTest.__lt__N)	r6rprqr�r�r�r�r�r�r,r,r,r-r�sc@s�eZdZdZe�dejejB�Ze�dejejBej	B�Z
e�d�jZddd�Z
dd	�Zdd
d�Zdd
�Ze�dej�Zdd�Ze�dej�Zdd�Zdd�Zdd�ZdS)rzD
    A class used to parse strings containing doctest examples.
    a�
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a�
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$�<string>c
s|��}|�|���dkr8d��fdd�|�d�D��}g}d\}}|j�|�D]�}|�|||����||�d||���7}|�	|||�\}}}	}
|�
|�s�|�t||	|
|�t|�
d��|d��||�d|��|���7}|��}qP|�||d��|S)	a=
        Divide the given string into examples and intervening text,
        and return them as a list of alternating Examples and strings.
        Line numbers for the Examples are 0-based.  The optional
        argument `name` is a name identifying this string, and is only
        used for error messages.
        r"rFcsg|]}|�d��qSrlr,��.0�l�Z
min_indentr,r-�
<listcomp>sz'DocTestParser.parse.<locals>.<listcomp>�r"r"r^)r�r^r�N)�
expandtabs�_min_indentr�rt�_EXAMPLE_RE�finditer�appendr��count�_parse_example�_IS_BLANK_OR_COMMENTrr)�groupr�)rj�stringr+�outputZcharnor��mr�r�rwr�r,r�r-�parsess*
�

�
zDocTestParser.parsecCst|�||�|||||�S)a"
        Extract all doctest examples from the given string, and
        collect them into a `DocTest` object.

        `globs`, `name`, `filename`, and `lineno` are attributes for
        the new `DocTest` object.  See the documentation for `DocTest`
        for more information.
        )r�get_examples)rjr�r1r+rTr�r,r,r-�get_doctest�s	�zDocTestParser.get_doctestcCsdd�|�||�D�S)a�
        Extract all doctest examples from the given string, and return
        them as a list of `Example` objects.  Line numbers are
        0-based, because it's most common in doctests that nothing
        interesting appears on the same line as opening triple-quote,
        and so the first interesting line is called "line 1" then.

        The optional argument `name` is a name identifying this
        string, and is only used for error messages.
        cSsg|]}t|t�r|�qSr,)r9r)r��xr,r,r-r��s
�z.DocTestParser.get_examples.<locals>.<listcomp>)r�)rjr�r+r,r,r-r��szDocTestParser.get_examplesc
s
t|�d���|�d��d�}|�|�||�|�|dd�d�d||�d��fdd	�|D��}|�d
�}|�d�}t|�dkr�t�d|d�r�|d=|�|d�||t|��d��fd
d	�|D��}|j�|�}|r�|�d�}nd}|�	|||�}	||	||fS)a�
        Given a regular expression match from `_EXAMPLE_RE` (`m`),
        return a pair `(source, want)`, where `source` is the matched
        example's source code (with prompts and indentation stripped);
        and `want` is the example's expected output (with indentation
        stripped).

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r^r�rFr&NrZr�csg|]}|�dd��qS)rYNr,)r�Zsl�r^r,r-r��sz0DocTestParser._parse_example.<locals>.<listcomp>rwz *$rrcsg|]}|�d��qSrlr,)r�Zwlr�r,r-r��sr�)
r)r�rt�_check_prompt_blank�
_check_prefixr�r[�match�
_EXCEPTION_RE�
_find_options)
rjr�r+r��source_linesr�rw�
want_linesr�r�r,r�r-r��s& 


�zDocTestParser._parse_examplez#\s*doctest:\s*([^\n\'"]*)$c	Cs�i}|j�|�D]v}|�d��dd���}|D]V}|ddksN|dd�tkrdtd|d||f��t|dd�}|ddk||<q.q|r�|�|�r�td	|||f��|S)
a
        Return a dictionary containing option overrides extracted from
        option directives in the given source string.

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r&�,rZr"z+-Nz7line %r of the doctest for %s has an invalid option: %r�+zSline %r of the doctest for %s has an option directive on a line with no example: %r)�_OPTION_DIRECTIVE_REr�r�rGrtr'r�r�)	rjr�r+r�r�r�Zoption_strings�option�flagr,r,r-r��s"���zDocTestParser._find_optionsz
^([ ]*)(?=\S)cCs2dd�|j�|�D�}t|�dkr*t|�SdSdS)z;Return the minimum indentation of any non-blank line in `s`cSsg|]}t|��qSr,)r))r�r^r,r,r-r�
sz-DocTestParser._min_indent.<locals>.<listcomp>r"N)�
_INDENT_RE�findallr)�min)rjr]�indentsr,r,r-r�szDocTestParser._min_indentc	Cs^t|�D]P\}}t|�|dkr||ddkrtd||d||||d�|f��qdS)a

        Given the lines of a source string (including prompts and
        leading indentation), check to make sure that every prompt is
        followed by a space character.  If any line is not followed by
        a space character, then raise ValueError.
        rYrKrZz8line %r of the docstring for %s lacks blank after %s: %rr&N)�	enumerater)r�)rj�linesr^r+r�r�rr,r,r-r�s ��z!DocTestParser._check_prompt_blankcCs>t|�D]0\}}|r|�|�std||d||f��qdS)z�
        Check that every line in the given list starts with the given
        prefix; if any line does not, then raise a ValueError.
        zGline %r of the docstring for %s has inconsistent leading whitespace: %rr&N)r�rur�)rjr��prefixr+r�r�rr,r,r-r�s
�zDocTestParser._check_prefixN)r�)r�)r6rprqr�r[�compile�	MULTILINE�VERBOSEr��DOTALLr�r�r�r�r�r�r�r�r�r�r�r�r�r,r,r,r-rCs(
��
'
3�c@sNeZdZdZde�ddfdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra<
    A class used to extract the DocTests that are relevant to a given
    object, from its docstring and the docstrings of its contained
    objects.  Doctests can currently be extracted from the following
    object types: modules, functions, classes, methods, staticmethods,
    classmethods, and properties.
    FTcCs||_||_||_||_dS)at
        Create a new doctest finder.

        The optional argument `parser` specifies a class or
        function that should be used to create new DocTest objects (or
        objects that implement the same interface as DocTest).  The
        signature for this factory function should match the signature
        of the DocTest constructor.

        If the optional argument `recurse` is false, then `find` will
        only examine the given object, and not any contained objects.

        If the optional argument `exclude_empty` is false, then `find`
        will include tests for objects with empty docstrings.
        N)�_parser�_verbose�_recurse�_exclude_empty)rj�verbose�parser�recurse�
exclude_emptyr,r,r-r�7szDocTestFinder.__init__Nc		CsN|dkr.t|dd�}|dkr.tdt|�f��|dkr<d}n|dkrNt�|�}zt�|�}Wntk
rtd}YndX|s�t�|�}|d|dd�dks�d}|dkr�d}n*|dk	r�t�	||j
�}n
t�	|�}|s�d}|dkr�|dkr�i}n
|j
��}n|��}|dk	�r|�|�d|k�r(d|d<g}|�
||||||i�|��|S)	aj
        Return a list of the DocTests that are defined by the given
        object's docstring, or by any of its contained objects'
        docstrings.

        The optional parameter `module` is the module that contains
        the given object.  If the module is not specified or is None, then
        the test finder will attempt to automatically determine the
        correct module.  The object's module is used:

            - As a default namespace, if `globs` is not specified.
            - To prevent the DocTestFinder from extracting DocTests
              from objects that are imported from other modules.
            - To find the name of the file containing the object.
            - To help find the line number of the object within its
              file.

        Contained objects whose module does not match `module` are ignored.

        If `module` is False, no attempt to find the module will be made.
        This is obscure, of use mostly in tests:  if `module` is False, or
        is None but cannot be found automatically, then all objects are
        considered to belong to the (non-existent) module, so all contained
        objects will (recursively) be searched for doctests.

        The globals for each DocTest is formed by combining `globs`
        and `extraglobs` (bindings in `extraglobs` override bindings
        in `globs`).  A new copy of the globals dictionary is created
        for each DocTest.  If `globs` is not specified, then it
        defaults to the module's `__dict__`, if specified, or {}
        otherwise.  If `extraglobs` is not specified, then it defaults
        to {}.

        Nr6zJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rFr"���z<]>r�)r0r�r�r7�	getmoduleZ
getsourcefilerBZgetfile�	linecache�getlines�__dict__r��update�_find�sort)	rj�objr+rCr1�
extraglobsr`r��testsr,r,r-rvMsL$�






zDocTestFinder.findcCs�|dkrdSt�|�dk	r(|t�|�kSt�|�r>|j|jkSt�|�r|t|d�r\|jj}nt|d�rn|j}ndS|j	|kSt�
|�r�|j	|jkSt|d�r�|j	|jkSt|t�r�dSt
d��dS)zY
        Return true if the given object is defined in the given
        module.
        NT�__objclass__rpz"object must be a class or function)r7r��
isfunctionr��__globals__ZismethoddescriptorrPr�rpr6�isclassr9�propertyr�)rjrC�objectZobj_modr,r,r-�_from_module�s(








zDocTestFinder._from_modulec
Cs|jrtd|�t|�|kr"dSd|t|�<|�|||||�}|dk	rR|�|�t�|�r�|jr�|j�	�D]P\}	}
d||	f}	t�
t�|
��s�t�|
�rl|�
||
�rl|�||
|	||||�qlt�|��rn|j�rnt|di��	�D]�\}	}
t|	t��stdt|	�f��t�
|
��sJt�|
��sJt�|
��sJt|
t��sJtdt|
�f��d||	f}	|�||
|	||||�q�t�|��r|j�r|j�	�D]�\}	}
t|
t��r�t||	�}
t|
t��r�t||	�j}
t�
|
��s�t�|
��s�t|
t��r�|�
||
��r�d||	f}	|�||
|	||||��q�dS)	zm
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        zFinding tests in %sNr&z%s.%s�__test__z5DocTestFinder.find: __test__ keys must be strings: %rz`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rz%s.__test__.%s)r��printr��	_get_testr�r7r8r�r��itemsZ	isroutineZunwrapr�rr�r0r9r:r�r��staticmethod�classmethod�__func__r)rjr�r�r+rCr�r1�seen�testZvalname�valr,r,r-r��sn
�
�������
�
��zDocTestFinder._findc		Cs�t|t�r|}nJz,|jdkr"d}n|j}t|t�s:t|�}Wnttfk
rXd}YnX|�||�}|jrt|stdS|dkr�d}n.t|dd�p�|j}|dd�dkr�|dd�}|j	�
|||||�S)zs
        Return a DocTest for the given object, if it defines a docstring;
        otherwise, return None.
        Nr�r�����.pycrr)r9r:r�rB�AttributeError�_find_linenor�r0r6r�r�)	rjr�r+rCr1r�r�r�rTr,r,r-rs,




�zDocTestFinder._get_testcCsd}t�|�rd}t�|�rb|dkr(dSt�dt|dd��}t|�D]\}}|�|�rF|}qbqFt�|�rr|j	}t�
|�r�|j}t�|�r�|j
}t�|�r�|j}t�|�r�t|dd�d}|dk	�r
|dkr�|dSt�d�}t|t|��D]}|�||�r�|Sq�dS)	z�
        Return a line number of the given object's docstring.  Note:
        this method assumes that the object has a docstring.
        Nr"z^\s*class\s*%s\br6�-�co_firstlinenor&z(^|.*:)\s*\w*("|\'))r7r8r�r[r�r0r�r�Zismethodr	r��__code__Zistraceback�tb_frameZisframe�f_codeZiscode�ranger))rjr�r�r�Zpatr�rr,r,r-r4s>


�








zDocTestFinder._find_lineno)NNNN)r6rprqr�rr�rvrr�rrr,r,r,r-r.s�

f?&c@s�eZdZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
�d�Zd dd�Zd!dd�Zd"dd�Zdd�ZdS)#ra3	
    A class used to run DocTest test cases, and accumulate statistics.
    The `run` method is used to process a single DocTest case.  It
    returns a tuple `(f, t)`, where `t` is the number of test cases
    tried, and `f` is the number of test cases that failed.

        >>> tests = DocTestFinder().find(_TestClass)
        >>> runner = DocTestRunner(verbose=False)
        >>> tests.sort(key = lambda test: test.name)
        >>> for test in tests:
        ...     print(test.name, '->', runner.run(test))
        _TestClass -> TestResults(failed=0, attempted=2)
        _TestClass.__init__ -> TestResults(failed=0, attempted=2)
        _TestClass.get -> TestResults(failed=0, attempted=2)
        _TestClass.square -> TestResults(failed=0, attempted=1)

    The `summarize` method prints a summary of all the test cases that
    have been run by the runner, and returns an aggregated `(f, t)`
    tuple:

        >>> runner.summarize(verbose=1)
        4 items passed all tests:
           2 tests in _TestClass
           2 tests in _TestClass.__init__
           2 tests in _TestClass.get
           1 tests in _TestClass.square
        7 tests in 4 items.
        7 passed and 0 failed.
        Test passed.
        TestResults(failed=0, attempted=7)

    The aggregated number of tried examples and failed examples is
    also available via the `tries` and `failures` attributes:

        >>> runner.tries
        7
        >>> runner.failures
        0

    The comparison between expected outputs and actual outputs is done
    by an `OutputChecker`.  This comparison may be customized with a
    number of option flags; see the documentation for `testmod` for
    more information.  If the option flags are insufficient, then the
    comparison may also be customized by passing a subclass of
    `OutputChecker` to the constructor.

    The test runner's display output can be controlled in two ways.
    First, an output function (`out) can be passed to
    `TestRunner.run`; this function will be called with strings that
    should be displayed.  It defaults to `sys.stdout.write`.  If
    capturing the output is not sufficient, then the display output
    can be also customized by subclassing DocTestRunner, and
    overriding the methods `report_start`, `report_success`,
    `report_unexpected_exception`, and `report_failure`.
    zF**********************************************************************Nr"cCsN|pt�|_|dkrdtjk}||_||_||_d|_d|_i|_	t
�|_dS)ac
        Create a new test runner.

        Optional keyword arg `checker` is the `OutputChecker` that
        should be used to compare the expected outputs and actual
        outputs of doctest examples.

        Optional keyword arg 'verbose' prints lots of stuff if true,
        only failures if false; by default, it's true iff '-v' is in
        sys.argv.

        Optional argument `optionflags` can be used to control how the
        test runner compares expected output to actual output, and how
        it displays failures.  See the documentation for `testmod` for
        more information.
        N�-vr")r�_checkerr>r�r��optionflags�original_optionflags�tries�failures�_name2ftrg�_fakeout)rj�checkerr�rr,r,r-r��s
zDocTestRunner.__init__cCsH|jrD|jr.|dt|j�dt|j��n|dt|j�d�dS)z�
        Report that the test runner is about to process the given
        example.  (Only displays a message if verbose=True)
        zTrying:
zExpecting:
zExpecting nothing
N)r�rwr_r�)rjr�r�exampler,r,r-�report_start�s���zDocTestRunner.report_startcCs|jr|d�dS)zt
        Report that the given example ran successfully.  (Only
        displays a message if verbose=True)
        zok
N)r��rjr�rr rxr,r,r-�report_success�szDocTestRunner.report_successcCs&||�||�|j�|||j��dS)z7
        Report that the given example failed.
        N)�_failure_headerr�output_differencerr"r,r,r-�report_failure�s�zDocTestRunner.report_failurecCs$||�||�dtt|���dS)zO
        Report that the given example raised an unexpected exception.
        zException raised:
N)r$r_rf�rjr�rr rdr,r,r-�report_unexpected_exception�s
�
�z)DocTestRunner.report_unexpected_exceptioncCs�|jg}|jrR|jdk	r4|jdk	r4|j|jd}nd}|�d|j||jf�n|�d|jd|jf�|�d�|j}|�t|��d�|�S)Nr&�?zFile "%s", line %s, in %szLine %s, in %szFailed example:rF)�DIVIDERrTr�r�r+r�r_r�)rjrr r�r�r�r,r,r-r$�s�
zDocTestRunner._failure_headerc	Cs�d}}|j}td�\}}}	|jj}
t|j�D�]6\}}|jt@oH|dk}
||_|jr�|j��D],\}}|r||j|O_q`|j|M_q`|jt	@r�q.|d7}|
s�|�
|||�d|j|f}z,tt
|j|d|d�|j�|j��d}Wn4tk
�r�Ynt��}|j��YnX|j��}|j�d�|}|dk�r`|
|j||j��r�|}n|tj|dd��d}|
�s�|t|�7}|jdk�r�|	}nB|
|j||j��r�|}n*|jt@�r�|
t|j�t|�|j��r�|}||k�r�|
�sR|�||||�nT||k�r(|
�s|� ||||�|d7}n*||	k�rR|
�sH|�!||||�|d7}n|r.|jt"@r.�qhq.||_|�#|||�t$||�S)	a�
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
        flags that should be used to execute examples.  Return a tuple
        `(f, t)`, where `t` is the number of examples tried, and `f`
        is the number of examples that failed.  The examples are run
        in the namespace `test.globs`.
        r"rKr&z<doctest %s[%d]>ZsingleNr4rr)%rrr�check_outputr�r�rr�rrr!r+�execr�r�r1�debuggerr��KeyboardInterruptr>rdrrcrnrwra�format_exception_onlyrfr�rr�r#r&r(r�_DocTestRunner__record_outcomer%)rjr�compileflagsr�rrr�SUCCESS�FAILUREZBOOMZcheck�
examplenumr �quietZ
optionflagrrTZ	exceptionrxZoutcomer�r,r,r-Z__run�s�
�
��



�




�
zDocTestRunner.__runcCsL|j�|jd�\}}||||f|j|j<|j|7_|j|7_dS)z{
        Record the fact that the given DocTest (`test`) generated `f`
        failures out of `t` tried examples.
        r�N)rr/r+rr)rjrrW�t�f2�t2r,r,r-Z__record_outcome|szDocTestRunner.__record_outcomez.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$cCsV|j�|�}|rF|�d�|jjkrF|jjt|�d��}|jjdd�S|�	||�SdS)Nr+r4T��keepends)
�%_DocTestRunner__LINECACHE_FILENAME_REr�r�rr+r��intr��
splitlines�save_linecache_getlines)rjrT�module_globalsr�r r,r,r-Z__patched_linecache_getlines�s
z*DocTestRunner.__patched_linecache_getlinesTc		s||_|dkrt|j�}tj�|dkrV�j��dks@���dkrH�j}n��fdd�}|jt_t�	�}t
j}t��|_
|j
��|j
jt
_tj|_|jt_tj}tjt_z|�|||�W�S�t_|t
_t�|�|jt_|t_|�r�|j��ddl}d|_XdS)aJ
        Run the examples in `test`, and display the results using the
        writer function `out`.

        The examples are run in the namespace `test.globs`.  If
        `clear_globs` is true (the default), then this namespace will
        be cleared after the test runs, to help with garbage
        collection.  If you would like to examine the namespace after
        the test completes, then use `clear_globs=False`.

        `compileflags` gives the set of flags that should be used by
        the Python compiler when running the examples.  If not
        specified, then it will default to the set of future-import
        flags that apply to `globs`.

        The output of each example is checked using
        `DocTestRunner.check_output`, and the results are formatted by
        the `DocTestRunner.report_*` methods.
        N�utf-8cs t|��d���}��|�dS)N�backslashreplace)r:�encode�write)r]�rNr�r,r-r��szDocTestRunner.run.<locals>.outr")rr3r1r>r�rN�lowerrCr�gettracer�r�r�r-�resetr�r�r>�*_DocTestRunner__patched_linecache_getlines�displayhook�__displayhook__�settrace�clear�builtins�_�_DocTestRunner__run)	rjrr1r��clear_globsZ
save_traceZsave_set_traceZsave_displayhookrMr,rDr-�run�s<





zDocTestRunner.runc
Cs�|dkr|j}g}g}g}d}}|j��D]V}|\}\}	}
||
7}||	7}|
dkr`|�|�q,|	dkrx|�||
f�q,|�|�q,|r�|r�tt|�d�|��|D]}td|�q�|r�tt|�d�|��|D]\}}td||f�q�|�r:t|j�tt|�d�|��|D] \}\}	}
td|	|
|f��q|�rft|d	t|j�d
�t||d|d�|�rztd
|d�n|�r�td�t||�S)a�
        Print a summary of all the test cases that have been run by
        this DocTestRunner, and return a tuple `(f, t)`, where `f` is
        the total number of failed examples, and `t` is the total
        number of tried examples.

        The optional `verbose` argument controls how detailed the
        summary is.  If the verbosity is not specified, then the
        DocTestRunner's verbosity is used.
        Nr"zitems had no tests:z   zitems passed all tests:z %3d tests in %szitems had failures:z %3d of %3d in %sztests inzitems.z
passed andzfailed.z***Test Failed***z	failures.zTest passed.)	r�rrr�rr)r�r*r%)
rjr�ZnotestsZpassedZfailedZtotaltZtotalfr�r+rWr6�thingr�r,r,r-�	summarize�sP
zDocTestRunner.summarizecCsR|j}|j��D]<\}\}}||kr@||\}}||}||}||f||<qdSrl)rr)rjr��dr+rWr6r7r8r,r,r-�mergeszDocTestRunner.merge)NNr")N)NNT)N)r6rprqr�r*r�r!r#r&r(r$rOr0r[r�r;rHrQrSrUr,r,r,r-rhs9
$
}



I
9c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)ra_
    A class used to check the whether the actual output from a doctest
    example matches the expected output.  `OutputChecker` defines two
    methods: `check_output`, which compares a given pair of outputs,
    and returns true if they match; and `output_difference`, which
    returns a string describing the differences between two outputs.
    cCst|�dd�d�S)z=
        Convert string to hex-escaped ASCII string.
        �ASCIIrA)r:rB)rjr]r,r,r-�_toAscii(szOutputChecker._toAsciicCs�|�|�}|�|�}||kr dS|t@sH||fdkr8dS||fdkrHdS|t@s�t�dt�t�d|�}t�dd|�}||kr�dS|t@r�d�|�	��}d�|�	��}||kr�dS|t
@r�t||�r�dSdS)	a�
        Return True iff the actual output from an example (`got`)
        matches the expected output (`want`).  These strings are
        always considered to match if they are identical; but
        depending on what option flags the test runner is using,
        several non-exact match types are also possible.  See the
        documentation for `TestRunner` for more information about
        option flags.
        T)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r�z(?m)^[^\S\n]+$rZF)rWrrr[r\�escape�BLANKLINE_MARKERrr�rtrr|�rjrwrxrr,r,r-r+.s4

�
zOutputChecker.check_outputcCs<|ttBtB@sdS|t@r dS|�d�dko:|�d�dkS)NFTrFr4)r	r
rr�rZr,r,r-�_do_a_fancy_diffms��zOutputChecker._do_a_fancy_diffc
Cs(|j}|t@st�dt|�}|�|||�r�|jdd�}|jdd�}|t@rptj	||dd�}t
|�dd�}d}nZ|t@r�tj||dd�}t
|�dd�}d}n,|t
@r�tjtjd	�}	t
|	�||��}d
}nd|td�|��S|r�|r�d
t|�t|�fS|�rdt|�S|�r dt|�SdSdS)z�
        Return a string describing the differences between the
        expected output for a given example (`example`) and the actual
        output (`got`).  `optionflags` is the set of option flags used
        to compare `want` and `got`.
        z(?m)^[ ]*(?=
)Tr9r4)�nNz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualzDifferences (%s):
r�zExpected:
%sGot:
%szExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rwrr[r\rYr[r=r	�difflibZunified_diff�listr
Zcontext_diffrZDifferZIS_CHARACTER_JUNKZcomparer_r�)
rjr rxrrwr�Z	got_linesZdiffZkindZenginer,r,r-r%�s4zOutputChecker.output_differenceN)r6rprqr�rWr+r[r%r,r,r,r-r s
?c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has failed in debugging mode.

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - got: the actual output
    cCs||_||_||_dSrl)rr rx)rjrr rxr,r,r-r��szDocTestFailure.__init__cCs
t|j�Srl�r:rr�r,r,r-�__str__�szDocTestFailure.__str__N�r6rprqr�r�r`r,r,r,r-r�s
c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has encountered an unexpected exception

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - exc_info: the exception info
    cCs||_||_||_dSrl)rr rd)rjrr rdr,r,r-r��szUnexpectedException.__init__cCs
t|j�Srlr_r�r,r,r-r`�szUnexpectedException.__str__Nrar,r,r,r-r�s
c@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ra�	Run doc tests but raise an exception as soon as there is a failure.

       If an unexpected exception occurs, an UnexpectedException is raised.
       It contains the test, the example, and the original exception:

         >>> runner = DebugRunner(verbose=False)
         >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
         ...                                    {}, 'foo', 'foo.py', 0)
         >>> try:
         ...     runner.run(test)
         ... except UnexpectedException as f:
         ...     failure = f

         >>> failure.test is test
         True

         >>> failure.example.want
         '42\n'

         >>> exc_info = failure.exc_info
         >>> raise exc_info[1] # Already has the traceback
         Traceback (most recent call last):
         ...
         KeyError

       We wrap the original exception to give the calling application
       access to the test and example information.

       If the output doesn't match, then a DocTestFailure is raised:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 1
         ...      >>> x
         ...      2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> try:
         ...    runner.run(test)
         ... except DocTestFailure as f:
         ...    failure = f

       DocTestFailure objects provide access to the test:

         >>> failure.test is test
         True

       As well as to the example:

         >>> failure.example.want
         '2\n'

       and the actual output:

         >>> failure.got
         '1\n'

       If a failure or error occurs, the globals are left intact:

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 1}

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      >>> raise KeyError
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         Traceback (most recent call last):
         ...
         doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 2}

       But the globals are cleared if there is no error:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         TestResults(failed=0, attempted=1)

         >>> test.globs
         {}

       NTcCs$t�||||d�}|r |j��|S)NF)rrQr1rL)rjrr1r�rP�rr,r,r-rQ3s
zDebugRunner.runcCst|||��dSrl)rr'r,r,r-r(9sz'DebugRunner.report_unexpected_exceptioncCst|||��dSrl)rr"r,r,r-r&<szDebugRunner.report_failure)NNT)r6rprqr�rQr(r&r,r,r,r-r�sZ
TFc	Cs�|dkrtj�d�}t�|�s,td|f��|dkr:|j}t|d�}	|rVt||d�}
nt	||d�}
|	j
||||d�D]}|
�|�qt|r�|
��t
dkr�|
a
n
t
�|
�t|
j|
j�S)a*
m=None, name=None, globs=None, verbose=None, report=True,
       optionflags=0, extraglobs=None, raise_on_error=False,
       exclude_empty=False

    Test examples in docstrings in functions and classes reachable
    from module m (or the current module if m is not supplied), starting
    with m.__doc__.

    Also test examples reachable from dict m.__test__ if it exists and is
    not None.  m.__test__ maps names to functions, classes and strings;
    function and class docstrings are tested even if the name is private;
    strings are tested directly, as if they were docstrings.

    Return (#failures, #tests).

    See help(doctest) for an overview.

    Optional keyword arg "name" gives the name of the module; by default
    use m.__name__.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use m.__dict__.  A copy of this
    dict is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.  This is new in 2.4.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  This is new in 2.3.  Possible values (see the
    docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    Nr�ztestmod: module required; %r)r��r�r�r1r�)r>r?r/r7r8rBr6rrrrvrQrS�masterrUr%rr)r�r+r1r��reportrr��raise_on_errorr��finder�runnerrr,r,r-rHs$E


cCs�|r|std��t||||pd�\}}|dkr:tj�|�}|dkrHi}n|��}|dk	rb|�|�d|krrd|d<|	r�t||d�}
nt||d�}
|
�	||||d�}|
�
|�|r�|
��tdkr�|
an
t�
|
�t|
j|
j�S)a


    Test examples in the given file.  Return (#failures, #tests).

    Optional keyword arg "module_relative" specifies how filenames
    should be interpreted:

      - If "module_relative" is True (the default), then "filename"
         specifies a module-relative path.  By default, this path is
         relative to the calling module's directory; but if the
         "package" argument is specified, then it is relative to that
         package.  To ensure os-independence, "filename" should use
         "/" characters to separate path segments, and should not
         be an absolute path (i.e., it may not begin with "/").

      - If "module_relative" is False, then "filename" specifies an
        os-specific path.  The path may be absolute or relative (to
        the current working directory).

    Optional keyword arg "name" gives the name of the test; by default
    use the file's basename.

    Optional keyword argument "package" is a Python package or the
    name of a Python package whose directory should be used as the
    base directory for a module relative filename.  If no package is
    specified, then the calling module's directory is used as the base
    directory for module relative filenames.  It is an error to
    specify "package" if "module_relative" is False.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use {}.  A copy of this dict
    is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  Possible values (see the docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Optional keyword arg "parser" specifies a DocTestParser (or
    subclass) that should be used to extract tests from the files.

    Optional keyword arg "encoding" specifies an encoding that should
    be used to convert the file to unicode.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    �8Package may only be specified for module-relative paths.r@Nr6r�rcr")r�rXr�r��basenamer�r�rrr�rQrSrerUr%rr)rTrVr+rUr1r�rfrr�rgr�rN�textrirr,r,r-r�s2R�


�NoNamec	Cs@t|dd�}t||d�}|j|||d�D]}|j||d�q(dS)ar
    Test examples in the given object's docstring (`f`), using `globs`
    as globals.  Optional argument `name` is used in failure messages.
    If the optional argument `verbose` is true, then generate output
    even if there are no failures.

    `compileflags` gives the set of flags that should be used by the
    Python compiler when running the examples.  If not specified, then
    it will default to the set of future-import flags that apply to
    `globs`.

    Optional keyword arg `optionflags` specifies options for the
    testing and output.  See the documentation for `testmod` for more
    information.
    F)r�r�rc)r1)r1N)rrrvrQ)	rWr1r�r+r1rrhrirr,r,r-r+scCs"|t@|krtd|��t}|a|S)a?Sets the unittest option flags.

    The old flag is returned so that a runner could restore the old
    value if it wished to:

      >>> import doctest
      >>> old = doctest._unittest_reportflags
      >>> doctest.set_unittest_reportflags(REPORT_NDIFF |
      ...                          REPORT_ONLY_FIRST_FAILURE) == old
      True

      >>> doctest._unittest_reportflags == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True

    Only reporting flags can be set:

      >>> doctest.set_unittest_reportflags(ELLIPSIS)
      Traceback (most recent call last):
      ...
      ValueError: ('Only reporting flags allowed', 8)

      >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True
    zOnly reporting flags allowed)r
r��_unittest_reportflags)r2�oldr,r,r-rHs

c@sleZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
jZdd�ZdS)�DocTestCaser"NcCs.tj�|�||_||_||_||_||_dSrl)�unittest�TestCaser��_dt_optionflags�_dt_checker�_dt_test�	_dt_setUp�_dt_tearDown)rjrr�setUp�tearDownrr,r,r-r�nszDocTestCase.__init__cCs|j}|jdk	r|�|�dSrl)rurv�rjrr,r,r-rxxs
zDocTestCase.setUpcCs(|j}|jdk	r|�|�|j��dSrl)rurwr1rLrzr,r,r-ry~s

zDocTestCase.tearDowncCs~|j}tj}t�}|j}|t@s(|tO}t||jdd�}z d|_	|j
||jdd�\}}W5|t_X|rz|�|�
|�����dS)NF�rrr�zF----------------------------------------------------------------------)r�rP)rur>r�r#rsr
rnrrtr*rQrCZfailureException�format_failurerc)rjrro�newrrirrr,r,r-�runTest�s(��zDocTestCase.runTestcCsP|j}|jdkrd}n
d|j}d�|j�d�dd��}d|j|j|||fS)Nzunknown line numberz%sr�rrz:Failed doctest test for %s
  File "%s", line %s, in %s

%s)rur�r�r+rtrT)rj�errrr�Zlnamer,r,r-r|�s

�zDocTestCase.format_failurecCs6|��t|j|jdd�}|j|jdd�|��dS)a�Run the test case without results and without catching exceptions

           The unit test framework includes a debug method on test cases
           and test suites to support post-mortem debugging.  The test code
           is run in such a way that errors are not caught.  This way a
           caller can catch the errors and initiate post-mortem debugging.

           The DocTestCase provides a debug method that raises
           UnexpectedException errors if there is an unexpected
           exception:

             >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
             ...                {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)
             >>> try:
             ...     case.debug()
             ... except UnexpectedException as f:
             ...     failure = f

           The UnexpectedException contains the test, the example, and
           the original exception:

             >>> failure.test is test
             True

             >>> failure.example.want
             '42\n'

             >>> exc_info = failure.exc_info
             >>> raise exc_info[1] # Already has the traceback
             Traceback (most recent call last):
             ...
             KeyError

           If the output doesn't match, then a DocTestFailure is raised:

             >>> test = DocTestParser().get_doctest('''
             ...      >>> x = 1
             ...      >>> x
             ...      2
             ...      ''', {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)

             >>> try:
             ...    case.debug()
             ... except DocTestFailure as f:
             ...    failure = f

           DocTestFailure objects provide access to the test:

             >>> failure.test is test
             True

           As well as to the example:

             >>> failure.example.want
             '2\n'

           and the actual output:

             >>> failure.got
             '1\n'

           Fr{)rPN)rxrrsrtrQrury)rjrir,r,r-r!�sB�zDocTestCase.debugcCs|jjSrl�rur+r�r,r,r-r��szDocTestCase.idcCsPt|�t|�k	rtS|j|jkoN|j|jkoN|j|jkoN|j|jkoN|j|jkSrl)r�r�rursrvrwrtr�r,r,r-r��s
�
�
�
�zDocTestCase.__eq__cCst|j|j|j|jf�Srl)r�rsrvrwrtr�r,r,r-r��s�zDocTestCase.__hash__cCs,|jj�d�}d|dd�|dd��fS)Nr�z%s (%s)rr)rur+rtr�)rjr+r,r,r-r�	szDocTestCase.__repr__cCsd|jjS)Nz	Doctest: r�r�r,r,r-�shortDescription		szDocTestCase.shortDescription)r"NNN)r6rprqr�rxryr~r|r!r�r�r�r�rr`r�r,r,r,r-rpls�

H
rpc@s0eZdZdd�Zdd�Zdd�Zdd�ZeZd	S)
�SkipDocTestCasecCs||_t�|d�dSrl)rCrpr�)rjrCr,r,r-r�
	szSkipDocTestCase.__init__cCs|�d�dS)Nz-DocTestSuite will not work with -O2 and above)ZskipTestr�r,r,r-rx	szSkipDocTestCase.setUpcCsdSrlr,r�r,r,r-�	test_skip	szSkipDocTestCase.test_skipcCsd|jjS)NzSkipping tests from %s)rCr6r�r,r,r-r�	sz SkipDocTestCase.shortDescriptionN)r6rprqr�rxr�r�r`r,r,r,r-r�	s
r�c@seZdZdd�ZdS)�
_DocTestSuitecCsdSrlr,)rj�indexr,r,r-�_removeTestAtIndex	sz _DocTestSuite._removeTestAtIndexN)r6rprqr�r,r,r,r-r�	sr�c	Ks�|dkrt�}t|�}|j|||d�}|sNtjjdkrNt�}|�t|��|S|�	�t�}|D]T}t
|j�dkrtq`|js�|j
}|dd�dkr�|dd�}||_|�t|f|��q`|S)a
    Convert doctest tests for a module to a unittest test suite.

    This converts each documentation string in a module that
    contains doctest tests to a unittest test case.  If any of the
    tests in a doc string fail, then the test case fails.  An exception
    is raised showing the name of the file containing the test and a
    (sometimes approximate) line number.

    The `module` argument provides the module to be tested.  The argument
    can be either a module or a module name.

    If no argument is given, the calling module is used.

    A number of options may be provided as keyword arguments:

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
       A set of doctest option flags expressed as an integer.
    Nrdr4r"r
rrr)rrDrvr>r2�optimizer��addTestr�r�r)r�rTr�rp)	rCr1r�Ztest_finderr�r��suiterrTr,r,r-r#	s(%c@s$eZdZdd�Zdd�Zdd�ZdS)�DocFileCasecCsd�|jj�d��S)NrNr�)r�rur+rtr�r,r,r-r�e	szDocFileCase.idcCs|jjSrl)rurTr�r,r,r-r�h	szDocFileCase.__repr__cCsd|jj|jj|fS)Nz2Failed doctest test for %s
  File "%s", line 0

%s)rur+rT)rjrr,r,r-r|k	s�zDocFileCase.format_failureN)r6rprqr�r�r|r,r,r,r-r�c	sr�c
Ksv|dkri}n|��}|r&|s&td��t||||p4d�\}}d|krL||d<tj�|�}|�||||d�}	t|	f|�S)Nrjr@r�r")r�r�rXr�r�rkr�r�)
r�rVrUr1r�rNr��docr+rr,r,r-�DocFileTestp	s�r�cOsDt�}|�dd�r$t|�d��|d<|D]}|�t|f|��q(|S)a�A unittest suite for one or more doctest files.

    The path to each doctest file is given as a string; the
    interpretation of that string depends on the keyword argument
    "module_relative".

    A number of options may be provided as keyword arguments:

    module_relative
      If "module_relative" is True, then the given file paths are
      interpreted as os-independent module-relative paths.  By
      default, these paths are relative to the calling module's
      directory; but if the "package" argument is specified, then
      they are relative to that package.  To ensure os-independence,
      "filename" should use "/" characters to separate path
      segments, and may not be an absolute path (i.e., it may not
      begin with "/").

      If "module_relative" is False, then the given file paths are
      interpreted as os-specific paths.  These paths may be absolute
      or relative (to the current working directory).

    package
      A Python package or the name of a Python package whose directory
      should be used as the base directory for module relative paths.
      If "package" is not specified, then the calling module's
      directory is used as the base directory for module relative
      filenames.  It is an error to specify "package" if
      "module_relative" is False.

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
      A set of doctest option flags expressed as an integer.

    parser
      A DocTestParser (or subclass) that should be used to extract
      tests from the files.

    encoding
      An encoding that will be used to convert the files to unicode.
    rVTrU)r�r/rDr�r�)�paths�kwr�r�r,r,r-r�	s8cCs�g}t��|�D]x}t|t�rh|�|jdd��|j}|r�|�d�|dd�|�d�dd�D�7}q|dd�|�d�dd�D�7}q|r�|ddkr�|��q�|r�|d	dkr�|�d	�q�d�	|�dS)
awExtract script from text with examples.

       Converts text with examples to a Python script.  Example input is
       converted to regular code.  Example output and all other words
       are converted to comments:

       >>> text = '''
       ...       Here are examples of simple math.
       ...
       ...           Python has super accurate integer addition
       ...
       ...           >>> 2 + 2
       ...           5
       ...
       ...           And very friendly error messages:
       ...
       ...           >>> 1/0
       ...           To Infinity
       ...           And
       ...           Beyond
       ...
       ...           You can use logic if you want:
       ...
       ...           >>> if 0:
       ...           ...    blah
       ...           ...    blah
       ...           ...
       ...
       ...           Ho hum
       ...           '''

       >>> print(script_from_examples(text))
       # Here are examples of simple math.
       #
       #     Python has super accurate integer addition
       #
       2 + 2
       # Expected:
       ## 5
       #
       #     And very friendly error messages:
       #
       1/0
       # Expected:
       ## To Infinity
       ## And
       ## Beyond
       #
       #     You can use logic if you want:
       #
       if 0:
          blah
          blah
       #
       #     Ho hum
       <BLANKLINE>
       Nrrz# Expected:cSsg|]}d|�qS)z## r,r�r,r,r-r�
sz(script_from_examples.<locals>.<listcomp>rFcSsg|]}t|��qSr,)r�r�r,r,r-r�
s�r}r")
rr�r9rr�r�rwrt�popr�)r]r�Zpiecerwr,r,r-r�	s :

"�

csJt|�}t��|�}�fdd�|D�}|s4t�d��|d}t|j�}|S)aExtract the test sources from a doctest docstring as a script.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the doc string with tests to be debugged.
    csg|]}|j�kr|�qSr,r*)r�r6r*r,r-r�.
s
ztestsource.<locals>.<listcomp>znot found in testsr")rDrrvr�rr�)rCr+r�r�testsrcr,r*r-r%
s

cCst|�}t|||�dS)z4Debug a single doctest docstring, in argument `src`'N)r�debug_script)�src�pmr1r�r,r,r-r 5
scCs�ddl}|r|��}ni}|rvzt|||�Wq�tt��d�|jdd�}|��|�dt��d�Yq�Xn|jdd��	d|||�dS)z7Debug a test script.  `src` is the script, as a string.r"Nr&T)r�r4zexec(%r))
r�r�r,rr>rdr�rGZinteractionrQ)r�r�r1r��pr,r,r-r�:
s
r�cCs$t|�}t||�}t|||j�dS)z�Debug a single doctest docstring.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the docstring with tests to be debugged.
    N)rDrr�r�)rCr+r�r�r,r,r-r!N
s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
_TestClassz�
    A pointless class, for sanity-checking of docstring testing.

    Methods:
        square()
        get()

    >>> _TestClass(13).get() + _TestClass(-12).get()
    1
    >>> hex(_TestClass(13).square().get())
    '0xa9'
    cCs
||_dS)z�val -> _TestClass object with associated value val.

        >>> t = _TestClass(123)
        >>> print(t.get())
        123
        N�r)rjrr,r,r-r�j
sz_TestClass.__init__cCs|jd|_|S)zosquare() -> square TestClass's associated value

        >>> _TestClass(13).square().get()
        169
        r4r�r�r,r,r-�squaret
sz_TestClass.squarecCs|jS)z~get() -> return TestClass's associated value.

        >>> x = _TestClass(-42)
        >>> print(x.get())
        -42
        r�r�r,r,r-r/~
sz_TestClass.getN)r6rprqr�r�r�r/r,r,r,r-r�\
s


r�z�
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      a�
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    z�
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            z�
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            a�
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r�r�zbool-int equivalencezblank linesZellipsiszwhitespace normalizationcCs"ddl}|jdd�}|jdddddd	�|jd
ddt��gd
d�|jddddd�|jdddd�|��}|j}|j}d}|jD]}|t|O}q�|j	r�|t
O}|D]v}|�d�r�tj
�|�\}}tj
�d|�t|dd��}	tj
d=t|	||d�\}
}nt|d||d�\}
}|
r�dSq�dS)Nr"zdoctest runner)Zdescriptionrz	--verbose�
store_trueFz'print very verbose output for all tests)�action�default�helpz-oz--optionr�zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r��choicesr�r�z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r�r�r`r�z file containing the tests to run)�nargsr�z.py���rc)rVr�rr&)�argparse�ArgumentParser�add_argumentr'�keys�
parse_argsr`r�r�Z	fail_fastrrir�r�rtr>�insertr;rr)r�r�r�Z	testfilesr�r�r�rT�dirnamer�rrNr,r,r-�_test�
sL�
�
��

�
r�r�)r4)rY)	NNNNTr"NFF)FrmNr")NNNN)FN)FN)F)Sr�Z
__docformat__�__all__r.r]r7r�r�r�r[r>rarq�ior#�collectionsr$r%r'rrrrrrrrr	r
rrrr
rYrsr3rDrJrXr_rfrgr|r�r�r�r�rOrrrrrr�	Exceptionrrrrerrrrnrrrrpr�Z	TestSuiter�rr�r�rrrr r�r!r�rr�r6�exitr,r,r,r-�<module>	sF'�-
���������

1%.DKl<;n�
h�
{�
$!
@
�
IR


,	�3-
pathlib.cpython-38.opt-1.pyc000064400000126263151450073350011573 0ustar00U

e5d���@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe� �dd	�d
kr�ddlm!Z!q�dZdZ!ndZd
dddddgZ"ee
eefZ#dZ$dd�Z%dd�Z&Gdd�de'�Z(Gdd�de(�Z)Gdd�de(�Z*e)�Z+e*�Z,Gdd�d�Z-Gd d!�d!e-�Z.e.�Z/d"d#�Z0e1ed$��r�e�2�e0�Z0Gd%d&�d&�Z3Gd'd(�d(�Z4Gd)d*�d*e3�Z5Gd+d,�d,e3�Z6Gd-d.�d.e3�Z7Gd/d0�d0e	�Z8Gd1d
�d
e'�Z9ej:�;e9�Gd2d�de9�Z<Gd3d�de9�Z=Gd4d�de9�Z>Gd5d�de>e<�Z?Gd6d�de>e=�Z@dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF�ELOOP)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt�)�r)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPath)��{i�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r!�/usr/lib64/python3.8/pathlib.py�
_ignore_error.s�r#cCsd|kpd|kpd|kS)N�*�?�[r!)�patr!r!r"�_is_wildcard_pattern3sr(c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_FlavourzPA flavour implements a particular (platform-specific) set of path
    semantics.cCs|jj|_dS�N)�sep�join��selfr!r!r"�__init__=sz_Flavour.__init__cCsg}|j}|j}d}}t|�}|D]�}|s.q$|r>|�||�}|�|�\}}}	||	kr�t|	�|��D] }
|
rd|
dkrd|�t�|
��qdn|	r�|	dkr�|�t�|	��|s�|r$|s�|D]0}|s�q�|r�|�||�}|�|�d}|r�q�q�q�q$|s�|�r|�||�|�	�|||fS)N��.r)
r+�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r.�partsZparsedr+r2�drv�root�it�partZrel�xr!r!r"�parse_parts@s@
z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS)z�
        Join the two paths represented by the respective
        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
        �N)�casefold)r.r<r=r;Zdrv2Zroot2Zparts2r!r!r"�join_parsed_partsfsz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__�__doc__r/rArDr!r!r!r"r)9s&r)c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zdd�Zd&dd�Ze
fdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)'�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr!��.0�ir!r!r"�	<setcomp>�sz_WindowsFlavour.<setcomp>rB�
cCsh|]}d|�qS)zLPT%dr!rLr!r!r"rO�scCs\|dd�}|dd�}||krP||krP|�|�\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d�}|dkr�|�||d�}||dkr�|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r6||jk�r6|dd�}	|dd�}|}||k�rN|}
|�|�}||	|
|fS)NrrBrr0�����:)�_split_extended_path�find�len�
drive_letters�lstrip)r.r?r+�first�second�prefixZthird�indexZindex2r<r=r!r!r"r5�s6"

z_WindowsFlavour.splitrootcCs|��Sr*��lower�r.�sr!r!r"rC�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr!r])rM�pr!r!r"�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r!�r.r;r!r!r"�casefold_parts�sz_WindowsFlavour.casefold_partscCst�t�|�tj�jSr*)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch�r.�patternr!r!r"�compile_pattern�sz_WindowsFlavour.compile_patternFcCs�t|�}|st��Sd}tdk	r�|r2|�t|��Sg}z|�t|��}WnBtk
r�|}tj�|�\}}|�|�||kr�|YSYq6Xtjj	|ft
|���Sq6dSr*)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr6r7r,r3)r.rs�strictr`Z
previous_sZ
tail_parts�tailr!r!r"�resolve�s$
z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr0�zUNC\rQrJ)�
startswith)r.r`Z
ext_prefixr[r!r!r"rT�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dS�NrB)rTr_r!r!r"rq�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rRr1)rx�	partition�upper�reserved_namesrcr!r!r"�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|��dd��d�}d|t|�d��fSdt|���d��SdS)NrrBrSrKz
file:///%s/%szutf-8zfile:)�driverV�as_posixrX�urlquote_from_bytes�encode)r.rsr~�restr!r!r"�make_uri�s�z_WindowsFlavour.make_uricCs�dtjkrtjd}nJdtjkrXztjd}Wntk
rFd}YnX|tjd}ntd��|r�tjd|kr�|�|f�\}}}|dtjdkr�td|��||d<|s�|r�|||�|d	d��}n
|�|�}|S)
NZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr0zCan't determine home directoryZUSERNAMErR�%Can't determine home directory for %rrB)ro�environ�KeyError�RuntimeErrorrAr,)r.�username�userhomer<r=r;r!r!r"�
gethomedirs*


�
z_WindowsFlavour.gethomedirN)F)rErFrGr+r2�has_drv�ntpath�pathmodro�name�is_supported�setrWZext_namespace_prefix�ranger|r5rCrdrmrvrTrqr}r�r�r!r!r!r"rIxs.

���'

rIc@sleZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
dd�Zdd
d�Zdd�Zdd�Zdd�ZdS)�
_PosixFlavourrKr0FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr0)rXrV)r.r?r+Z
stripped_partr!r!r"r5%s
z_PosixFlavour.splitrootcCs|Sr*r!r_r!r!r"rC4sz_PosixFlavour.casefoldcCs|Sr*r!rcr!r!r"rd7sz_PosixFlavour.casefold_partscCst�t�|��jSr*)rerfrgrhrjrkr!r!r"rm:sz_PosixFlavour.compile_patterncsJ|j�|j�i������fdd��|��r0dnt��}�|t|��pH�S)Ncs�|���rd}|���D]�}|r|dkr*q|dkrD|���\}}}q|���rX||}n|�|}|�kr��|}|dk	r~qtd|��z��|�}Wn6tk
r�}z|jtkr��r��|}W5d}~XYqXd�|<�||�}|�|<q|S)Nr0r1�..zSymlink loop from %r)	rxr6�
rpartition�endswithr��readlink�OSErrorrr)rsr�r��_�newpath�target�e��_resolveZaccessor�seenr+rtr!r"r�As4




z'_PosixFlavour.resolve.<locals>._resolver0)r+�	_accessor�is_absoluterorprn)r.rsrt�baser!r�r"rv=s)z_PosixFlavour.resolvecCsdS�NFr!rcr!r!r"r}msz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesr�)r.rsZbpathr!r!r"r�psz_PosixFlavour.make_uricCs||s@ztjdWStk
r<ddl}|�t���jYSXn8ddl}z|�|�jWStk
rvtd|��YnXdS)N�HOMErr�)	ror�r��pwd�getpwuid�getuid�pw_dir�getpwnamr�)r.r�r�r!r!r"r�vs�z_PosixFlavour.gethomedirN)F)rErFrGr+r2r��	posixpathr�ror�r�r5rCrdrmrvr}r�r�r!r!r!r"r�s

0r�c@seZdZdZdS)�	_AccessorzjAn accessor implements a particular (system-specific or not) way of
    accessing paths on the filesystem.N)rErFrGrHr!r!r!r"r��sr�c@s�eZdZejZejZejZejZejZej	Z	e
ed�r>ejZndd�ZejZej
Z
e
ed�rdejZnedd��ZejZejZejZer�er�ejZq�dd�Zned	d��ZejZd
d�ZdS)
�_NormalAccessor�lchmodcCstd��dS)Nz%lchmod() not available on this system��NotImplementedError)r.Zpathobj�moder!r!r"r��sz_NormalAccessor.lchmod�linkcCstd��dS)Nz&os.link() not available on this systemr��r.r�r!r!r"�link_to�sz_NormalAccessor.link_tocCstd��dS)Nz&symlink() not available on this systemr���a�b�target_is_directoryr!r!r"�symlink�sz_NormalAccessor.symlinkcCst�||�Sr*)ror�r�r!r!r"r��scCs
t�|�Sr*)ror��r.rsr!r!r"r��sz_NormalAccessor.readlinkN)rErFrGro�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlinkr�r��staticmethod�rmdir�renamer4r�supports_symlinksr��utimer�r!r!r!r"r��s4




r�cCsR|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}||||�S)NrrB�**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr(�_WildcardSelector�_PreciseSelector)�
pattern_parts�flavourr'�child_parts�clsr!r!r"�_make_selector�s
r��	lru_cachec@s eZdZdZdd�Zdd�ZdS)�	_SelectorzYA selector matches a specific glob pattern part against the children
    of a given path.cCs0||_|rt||�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r.r�r�r!r!r"r/�sz_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�S)zuIterate over all child paths of `parent_path` matched by this
        selector.  This can contain parent_path itself.)�type�is_dir�existsr�r��iter�_select_from)r.�parent_pathZpath_clsr�r�r�r!r!r"�select_from�sz_Selector.select_fromN)rErFrGrHr/r�r!r!r!r"r��s	r�c@seZdZdd�ZdS)r�ccs
|VdSr*r!)r.r�r�r�r�r!r!r"r��sz!_TerminatingSelector._select_fromN)rErFrGr�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�|||�dSr*)r�r�r/)r.r�r�r�r!r!r"r/sz_PreciseSelector.__init__ccs\z@|�|j�}|jr|n||�r>|j�||||�D]
}|Vq2Wntk
rVYdSXdSr*)�_make_child_relpathr�r�r�r��PermissionError)r.r�r�r�r�rsrar!r!r"r�sz_PreciseSelector._select_fromN�rErFrGr/r�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs|�|�|_t�|||�dSr*)rm�matchr�r/�r.r'r�r�r!r!r"r/sz_WildcardSelector.__init__ccs�z�||��}t|�}W5QRX|D]�}|jrrz|��s:Wq"Wn4tk
rp}zt|�sX�WY�q"W5d}~XYnX|j}	|�|	�r"|�|	�}
|j�	|
|||�D]
}|Vq�q"Wnt
k
r�YdSXdSr*)�listr�r�r�r#r�r�r�r�r�r�)r.r�r�r�r��
scandir_it�entries�entryr�r�rsrar!r!r"r�s&


z_WildcardSelector._select_fromNr�r!r!r!r"r�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�|||�dSr*)r�r/r�r!r!r"r//sz#_RecursiveWildcardSelector.__init__ccs�|Vz�||��}t|�}W5QRX|D]t}d}z|��}Wn,tk
rh}zt|�sX�W5d}~XYnX|r(|��s(|�|j�}	|�|	||�D]
}
|
Vq�q(Wntk
r�YdSXdSr�)	r�r�r�r#�
is_symlinkr�r��_iterate_directoriesr�)r.r�r�r�r�r�r�Zentry_is_dirr�rsrar!r!r"r�2s"
z/_RecursiveWildcardSelector._iterate_directoriesc	cs~zbt�}zL|jj}|�|||�D]0}|||||�D]}||kr2|V|�|�q2q W5|��XWntk
rxYdSXdSr*)r��clearr�r�r��addr�)	r.r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrar!r!r"r�Esz'_RecursiveWildcardSelector._select_fromN)rErFrGr/r�r�r!r!r!r"r�-sr�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�_PathParentszvThis object provides sequence-like access to the logical ancestors
    of a path.  Don't try to construct it yourself.)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dSr*)r�r�r�r�r�r�r!r!r"r/^s
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdSry)r�r�rVr�r-r!r!r"�__len__esz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)NrrB)rV�
IndexErrorr��_from_parsed_partsr�r�r�)r.�idxr!r!r"�__getitem__ks
�z_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rEr-r!r!r"�__repr__qsz_PathParents.__repr__N)	rErFrGrH�	__slots__r/r�r�r�r!r!r!r"r�Ysr�c@s�eZdZdZdZdd�Zdd�Zedd��ZedVd
d��Z	edWdd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zeed.�d/d0�Zeed1�d2d0�Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#d=d>�Z$d?d@�Z%dAdB�Z&edCdD��Z'dEdF�Z(dGdH�Z)dIdJ�Z*edKdL��Z+edMdN��Z,dOdP�Z-dQdR�Z.dSdT�Z/dUS)Xra|Base class for manipulating paths without I/O.

    PurePath represents a filesystem path and offers operations which
    don't imply any actual filesystem I/O.  Depending on your system,
    instantiating a PurePath will return either a PurePosixPath or a
    PureWindowsPath object.  You can also instantiate either of these classes
    directly, regardless of your system.
    )r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)z�Construct a PurePath from one or several strings and or existing
        PurePath objects.  The strings and path objects are combined so as
        to yield a canonicalized path, which is incorporated into the
        new PurePath object.
        r)rror�rr�_from_parts)r��argsr!r!r"�__new__�szPurePath.__new__cCs|jt|j�fSr*)�	__class__�tupler�r-r!r!r"�
__reduce__�szPurePath.__reduce__cCsdg}|D]N}t|t�r"||j7}qt�|�}t|t�rF|�t|��qtdt|���q|j	�
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�ro�fspathrnr7�	TypeErrorr��_flavourrA)r�r�r;r�r!r!r"�_parse_args�s


��zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|Sr*)�objectr�rr�r�r��_init)r�r��initr.r<r=r;r!r!r"r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|Sr*)rr�r�r�r�r)r�r<r=r;r	r.r!r!r"r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdSry)rr,)r�r<r=r;r!r!r"�_format_parsed_parts�szPurePath._format_parsed_partscCsdSr*r!r-r!r!r"r�szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�Sr*)rrrDr�r�r�r�)r.r�r<r=r;r!r!r"�_make_child�s�
zPurePath._make_childcCsBz|jWStk
r<|�|j|j|j�p.d|_|jYSXdS)z[Return the string representation of the path, suitable for
        passing to system calls.r1N)r��AttributeErrorr
r�r�r�r-r!r!r"�__str__�s��zPurePath.__str__cCst|�Sr*)rnr-r!r!r"�
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)zNReturn the string representation of the path with forward (/)
        slashes.rK)rrnr4r+�r.�fr!r!r"r�szPurePath.as_posixcCs
t�|�S)zaReturn the bytes representation of the path.  This is only
        recommended to use under Unix.)ro�fsencoder-r!r!r"�	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rErr-r!r!r"r��szPurePath.__repr__cCs|��std��|j�|�S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)r�r�rr�r-r!r!r"�as_uri�szPurePath.as_uricCs8z|jWStk
r2|j�|j�|_|jYSXdSr*)r�rrrdr�r-r!r!r"�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkSr*)rr�NotImplementedrr�r.�otherr!r!r"�__eq__�s
zPurePath.__eq__cCs8z|jWStk
r2tt|j��|_|jYSXdSr*)r�r�hashrrr-r!r!r"�__hash__�s
zPurePath.__hash__cCs&t|t�r|j|jk	rtS|j|jkSr*�rrrrrrr!r!r"�__lt__szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__le__	szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__gt__szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__ge__szPurePath.__ge__r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.cCs|j|j}|S)z/The concatenation of the drive and root, or ''.)r�r�)r.�anchorr!r!r"r!szPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)z!The final path component, if any.rBrr0rR)r�rVr�r�rcr!r!r"r�$sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)z{
        The final component's last suffix, if any.

        This includes the leading period. For example: '.txt'
        r1rrBNr0�r��rfindrV�r.r�rNr!r!r"�suffix,s

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)z�
        A list of the final component's suffixes, if any.

        These include the leading periods. For example: ['.tar', '.gz']
        r1cSsg|]}d|�qS)r1r!)rMr%r!r!r"rbEsz%PurePath.suffixes.<locals>.<listcomp>rBN)r�r�rXr6�r.r�r!r!r"�suffixes:s


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)z0The final path component, minus its last suffix.r1rrBNr"r$r!r!r"�stemGs

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjfksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)z-Return a new path with the file name changed.�%r has an empty namerRrBzInvalid name %rN)r�r�rrAr+r2rVr�r�r�r�)r.r�r<r=r;r!r!r"�	with_nameQs��
��zPurePath.with_namecCs�|j}|j|ks |jr.|j|kr.td|f��|r<|�d�rD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|�|j	|j
|jdd�|g�S)z�Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        zInvalid suffix %rr1r)NrR)rr+r2r�rxr�r%rVr�r�r�r�)r.r%rr�Z
old_suffixr!r!r"�with_suffix\s
�zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|�|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|s�|r�n||d|
��||	�kr�|�|||�}t	d�
t|�t|����|�d|
dkr�|nd||
d��S)z�Return the relative path to another path identified by the passed
        arguments.  If the operation is not possible (because this is not
        a subpath of the other path), raise ValueError.
        zneed at least one argumentrBNrz{!r} does not start with {!r}r0)
rr�r�r�rrVrrdr
r�r�rnr�)
r.rr;r<r=Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�n�cfZ	formattedr!r!r"�relative_toqs.	*�
�zPurePath.relative_tocCs4z|jWStk
r.t|j�|_|jYSXdS)zZAn object providing sequence-like access to the
        components in the filesystem path.N)r�rrr�r-r!r!r"r;�s
zPurePath.partscGs
|�|�S)z�Combine this path with one or several arguments, and return a
        new path representing either a subpath (if all arguments are relative
        paths) or a totally different path (if one of the arguments is
        anchored).
        )r)r.r�r!r!r"�joinpath�szPurePath.joinpathcCs,z|�|f�WStk
r&tYSXdSr*)rrr�r.�keyr!r!r"�__truediv__�szPurePath.__truediv__cCs2z|�|g|j�WStk
r,tYSXdSr*)r�r�rrr0r!r!r"�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)zThe logical parent of the path.rBNrR)r�r�r�rVr�)r.r<r=r;r!r!r"�parent�szPurePath.parentcCst|�S)z*A sequence of this path's logical parents.)r�r-r!r!r"�parents�szPurePath.parentscCs|js
dS|jjpt|j�S)zSTrue if the path is absolute (has both a root and, if applicable,
        a drive).F)r�rr��boolr�r-r!r!r"r��szPurePath.is_absolutecCs|j�|j�S)zaReturn True if the path contains one of the special names reserved
        by the system, if any.)rr}r�r-r!r!r"r}�szPurePath.is_reservedc	Cs�|jj}||�}|j�|f�\}}}|s0td��|rF|||j�krFdS|r\|||j�kr\dS|j}|sj|r�t|�t|�kr~dS|dd�}nt|�t|�kr�dStt	|�t	|��D]\}}t
�||�s�dSq�dS)zE
        Return True if this path matches the given pattern.
        z
empty patternFrBNT)rrCrAr�r�r�rrV�zipr3rgZfnmatchcase)	r.Zpath_patternr-r<r=Z	pat_partsr;r?r'r!r!r"r��s(zPurePath.matchN)T)T)0rErFrGrHr�r�r�classmethodrr�r�r
rrr
rrrr�r�propertyrrrrrrrrr~r=r!r�r%r'r(r*r+r.r;r/r2r3r4r5r�r}r�r!r!r!r"rusv

	


��





	 

	
c@seZdZdZeZdZdS)rz�PurePath subclass for non-Windows systems.

    On a POSIX system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_posix_flavourrr�r!r!r!r"r�sc@seZdZdZeZdZdS)rz�PurePath subclass for Windows systems.

    On a Windows system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_windows_flavourrr�r!r!r!r"r�sc@s�eZdZdZdZdd�Zdddd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dedd�Zdfdd�Ze
dd��Ze
dd��Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zdgd%d&�Zd'd(�Zd)d*�Zd+d,�Zdhd/d0�Zd1d2�Zdid3d4�Zd5d6�Zdjd7d8�Zdkd:d;�Zdld<d=�Zd>d?�Z d@dA�Z!dmdBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dndLdM�Z'dNdO�Z(dPdQ�Z)dRdS�Z*dTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0d`da�Z1dbdc�Z2dS)ora�PurePath subclass that can make system calls.

    Path represents a filesystem path but unlike PurePath, also offers
    methods to do system calls on path objects. Depending on your system,
    instantiating a Path will return either a PosixPath or a WindowsPath
    object. You can also instantiate a PosixPath or WindowsPath directly,
    but cannot instantiate a WindowsPath on a POSIX system or vice versa.
    )r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF�r	z$cannot instantiate %r on your system)rror�rrr�rr�r�rEr)r�r��kwargsr.r!r!r"r�s�zPath.__new__NcCs"d|_|dk	r|j|_nt|_dSr�)r<r��_normal_accessor)r.�templater!r!r"rs
z
Path._initcCs|j|g}|�|j|j|�Sr*)r�r�r�r�)r.r?r;r!r!r"r�#szPath._make_child_relpathcCs|jr|��|Sr*)r<�
_raise_closedr-r!r!r"�	__enter__)szPath.__enter__cCs
d|_dS)NT)r<)r.�t�v�tbr!r!r"�__exit__.sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�r-r!r!r"rA1szPath._raise_closed�cCs|j�|||�Sr*)r�r�)r.r��flagsr�r!r!r"�_opener4szPath._opener�cCs|jr|��|j�|||�S)zm
        Open the file pointed by this path and return a file descriptor,
        as os.open() does.
        )r<rAr�r�)r.rHr�r!r!r"�	_raw_open8szPath._raw_opencCs|t���S)zjReturn a new path pointing to the current working directory
        (as returned by os.getcwd()).
        )rorp�r�r!r!r"�cwdCszPath.cwdcCs||�j�d��S)zrReturn a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        N)rr�rLr!r!r"�homeJsz	Path.homecCsB|��}z|��}Wntk
r2t�|�}YnXtj�||�S)zoReturn whether other_path is the same or not as this file
        (as returned by os.path.samefile()).
        )r�rrors�samestat)r.Z
other_path�stZother_str!r!r"�samefileQsz
Path.samefileccsH|jr|��|j�|�D](}|dkr(q|�|�V|jr|��qdS)zyIterate over the files in this directory.  Does not yield any
        result for the special paths '.' and '..'.
        >r1r�N)r<rAr�r�r�r&r!r!r"�iterdir\szPath.iterdirccs`|std�|���|j�|f�\}}}|s.|r6td��tt|�|j�}|�|�D]
}|VqPdS)z�Iterate over this subtree and yield all existing files (of any
        kind, including directories) matching the given relative pattern.
        zUnacceptable pattern: {!r}�%Non-relative patterns are unsupportedN)r�r�rrAr�r�rr��r.rlr<r=r�Zselectorrar!r!r"�globjsz	Path.globccsR|j�|f�\}}}|s|r$td��tdt|�|j�}|�|�D]
}|VqBdS)z�Recursively yield all existing files (of any kind, including
        directories) matching the given relative pattern, anywhere in
        this subtree.
        rS)r�N)rrAr�r�rr�rTr!r!r"�rglobwsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)aReturn an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
        Fr=�r@)r<rAr�r�rorpr�r)r.�objr!r!r"�absolute�sz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)z�
        Make the path absolute, resolving all symlinks on the way and also
        normalizing it (for example turning slashes into backslashes under
        Windows).
        )rtNFr=rW)r<rArrvr�rnrYr��normpathr�r)r.rtr`ZnormedrXr!r!r"rv�szPath.resolvecCs|j�|�S)zh
        Return the result of the stat() system call on this path, like
        os.stat() does.
        )r�r�r-r!r!r"r��sz	Path.statcCsddl}|�|��j�jS)z:
        Return the login name of the file owner.
        rN)r�r�r��st_uidZpw_name)r.r�r!r!r"�owner�sz
Path.ownercCsddl}|�|��j�jS)z8
        Return the group name of the file gid.
        rN)�grpZgetgrgidr��st_gidZgr_name)r.r]r!r!r"�group�sz
Path.group�rrRc	Cs(|jr|��tj|||||||jd�S)z|
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        )Zopener)r<rA�ior�rI)r.r��	buffering�encoding�errors�newliner!r!r"r��s
�z	Path.openc
Cs,|jdd��}|��W5QR�SQRXdS)zK
        Open the file in bytes mode, read it, and close the file.
        �rb�r�N�r��readrr!r!r"�
read_bytes�szPath.read_bytesc
Cs0|jd||d��}|��W5QR�SQRXdS)zJ
        Open the file in text mode, read it, and close the file.
        r`�r�rcrdNrh)r.rcrdrr!r!r"�	read_text�szPath.read_textc
Cs6t|�}|jdd��}|�|�W5QR�SQRXdS)zO
        Open the file in bytes mode, write to it, and close the file.
        �wbrgN)�
memoryviewr��write)r.�dataZviewrr!r!r"�write_bytes�szPath.write_bytesc
CsLt|t�std|jj��|jd||d��}|�|�W5QR�SQRXdS)zN
        Open the file in text mode, write to it, and close the file.
        zdata must be str, not %s�wrkN)rrnrr�rEr�ro)r.rprcrdrr!r!r"�
write_text�s
�zPath.write_textTcCsr|jr|��|r>z|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dS)zS
        Create this file with the given access mode, if it doesn't exist.
        N)r<rAr�r�r�ro�O_CREAT�O_WRONLY�O_EXCLrK�close)r.r��exist_okrH�fdr!r!r"�touch�s
z
Path.touchcCs�|jr|��z|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)z<
        Create a new directory at this given path.
        T)r5rxFN)r<rAr�r�rrr4r�r�)r.r�r5rxr!r!r"r�sz
Path.mkdircCs |jr|��|j�||�dS)zF
        Change the permissions of the path, like os.chmod().
        N)r<rAr�r��r.r�r!r!r"r�sz
Path.chmodcCs |jr|��|j�||�dS)z�
        Like chmod(), except if the path points to a symlink, the symlink's
        permissions are changed, rather than its target's.
        N)r<rAr�r�r{r!r!r"r�szPath.lchmodcCs>|jr|��z|j�|�Wntk
r8|s4�YnXdS)zd
        Remove this file or link.
        If the path is a directory, use rmdir() instead.
        N)r<rAr�r�rr)r.Z
missing_okr!r!r"r�%szPath.unlinkcCs|jr|��|j�|�dS)zF
        Remove this directory.  The directory must be empty.
        N)r<rAr�r�r-r!r!r"r�2sz
Path.rmdircCs|jr|��|j�|�S)z�
        Like stat(), except if the path points to a symlink, the symlink's
        status information is returned, rather than its target's.
        )r<rAr�r�r-r!r!r"r�:sz
Path.lstatcCs&|jr|��|j�||�|�|�S)a2
        Rename this path to the target path.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r�r�r�r!r!r"r�Cs
zPath.renamecCs&|jr|��|j�||�|�|�S)aS
        Rename this path to the target path, overwriting if that path exists.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r4r�r�r!r!r"r4Rs
zPath.replacecCs"|jr|��|j�|||�dS)z�
        Make this path a symlink pointing to the target path.
        Note the order of arguments (link, target) is the reverse of os.symlink.
        N)r<rAr�r�)r.r�r�r!r!r"�
symlink_toaszPath.symlink_tocCs |jr|��|j�||�dS)aQ
        Make the target path a hard link pointing to this path.

        Note this function does not make this path a hard link to *target*,
        despite the implication of the function and argument names. The order
        of arguments (target, link) is the reverse of Path.symlink_to, but
        matches that of os.link.

        N)r<rAr�r�r�r!r!r"r�js
zPath.link_toc
CsXz|��WnFtk
r>}zt|�s(�WY�dSd}~XYntk
rRYdSXdS)z+
        Whether this path exists.
        FNT)r�r�r#r��r.r�r!r!r"r�zszPath.existsc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z3
        Whether this path is a directory.
        FN)r	r��st_moder�r#r�r}r!r!r"r��szPath.is_dirc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)zq
        Whether this path is a regular file (also True for symlinks pointing
        to regular files).
        FN)rr�r~r�r#r�r}r!r!r"�is_file�szPath.is_filecCsv|��r|��sdSt|j�}z|��j}Wntk
rBYdSX|��j}||krZdS|��j}|��j}||kS)z;
        Check if this path is a POSIX mount point
        FT)r�r�rr4r��st_devr��st_ino)r.r4Z
parent_devZdevZinoZ
parent_inor!r!r"�is_mount�s



z
Path.is_mountc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z7
        Whether this path is a symbolic link.
        FN)r
r�r~r�r#r�r}r!r!r"r��szPath.is_symlinkc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z6
        Whether this path is a block device.
        FN)r
r�r~r�r#r�r}r!r!r"�is_block_device�szPath.is_block_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z:
        Whether this path is a character device.
        FN)rr�r~r�r#r�r}r!r!r"�is_char_device�szPath.is_char_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z.
        Whether this path is a FIFO.
        FN)rr�r~r�r#r�r}r!r!r"�is_fifo�szPath.is_fifoc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z0
        Whether this path is a socket.
        FN)rr�r~r�r#r�r}r!r!r"�	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)zl Return a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        rNrB�~)r�r�r�rr�r�)r.Zhomedirr!r!r"�
expandusers��zPath.expanduser)N)rG)rJ)F)r`rRNNN)NN)NN)rGT)rJFF)F)F)3rErFrGrHr�r�rr�rBrFrArIrKr8rMrNrQrRrUrVrYrvr�r\r_r�rjrlrqrsrzr�r�r�r�r�r�r�r4r|r�r�r�rr�r�r�r�r�r�r�r!r!r!r"rsj�







�

	



	

	
	c@seZdZdZdZdS)rzsPath subclass for non-Windows systems.

    On a POSIX system, instantiating a Path should return this object.
    r!N)rErFrGrHr�r!r!r!r"rsc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rzqPath subclass for Windows systems.

    On a Windows system, instantiating a Path should return this object.
    r!cCstd��dS)Nz*Path.owner() is unsupported on this systemr�r-r!r!r"r\(szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this systemr�r-r!r!r"r_+szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this systemr�r-r!r!r"r�.szWindowsPath.is_mountN)rErFrGrHr�r\r_r�r!r!r!r"r!s
)Arg�	functoolsrar�ror�rer8�_collections_abcrrrrrrr�operatorrr�r	r
rrr
rrZurllib.parserr�r�r�rZgetwindowsversionr�__all__rr r#r(rr)rIr�r;r:r�r�r?r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrr!r!r!r"�<module>s|$
�
?&i8
,t

stringprep.cpython-38.pyc000064400000025413151450073350011401 0ustar00U

e5du2��@s�dZddlmZejdkst�dd�Zedddd	d
ddd
dddgeedd���Z	dd�Z
dddddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdEdFdGdHdIdJdKdLdMdNdOdPdQdNddRdSdTdUdVdSdWddXdYdZdd[d\d]d^d_d`dadbd_dcdddedfdgdhdhdhdididjdkdldmdndodododpdqdrdsdsdtdddudvdwdxd&dydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d}d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dddyd�d�d�dkd�dmdndd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdydudvd�d�d�djdwdkd�dmdndd�d�d�d�d�d�d�dtdydudvd�did�d�djdwd�dd�d�d�d�d�d�d�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�ddː��Zd�d̈́Zd�dτZ
d�dфZd�dӄZd�dՄZd�dׄZed�d�d�d
dd�d�dgeedd݃�eed�d߃�eed�d��eed�d���Zd�d�Zd�d�Zd�d�Zd�d�Zd�d�Zeed�d��Zd�d�Zeed�d��Zd�d�Zed�d�d�d�geed�d���eed�d߃��Zd�d��Zed�geed�d����Z�d�d�Z�d�d�Z �d�d�Z!�dS(z�Library that exposes various tables found in the StringPrep RFC 3454.

There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
�)�	ucd_3_2_0z3.2.0cCsBt�|�dkrdSt|�}d|kr.dkr6nndS|d@dkS)NZCnF�������r)�unicodedata�category�ord��code�c�r�"/usr/lib64/python3.8/stringprep.py�in_table_a1sr�iOiiii
i i i
 i` i��i�i�cCst|�tkS�N)r
�b1_set�rrrr�in_table_b1sruμZssui̇uʼn�suǰuιu ιuΐuΰuσuβuθuυuύuϋuφuπuκuρuεuեւuẖuẗuẘuẙuaʾuṡuὐuὒuὔuὖuἀιuἁιuἂιuἃιuἄιuἅιuἆιuἇιuἠιuἡιuἢιuἣιuἤιuἥιuἦιuἧιuὠιuὡιuὢιuὣιuὤιuὥιuὦιuὧιuὰιuαιuάιuᾶuᾶιuὴιuηιuήιuῆuῆιuῒuῖuῗuῢuῤuῦuῧuὼιuωιuώιuῶuῶιZrsr
u°cuɛu°f�h�i�l�nZno�p�q�rZsmZtelZtm�z�b�e�f�muγ�dZhpaZauZovZpaZnauμaZmaZkaZkbZmbZgbZpfZnfuμf�hzZkhzZmhzZghzZthzZkpaZmpaZgpaZpvZnvuμvZmvZkvZpwZnwuμwZmw�kwukωumωZbquc∕kgzco.ZdbZgyZhpZkkZkmZphZppmZprZsv�wbZffZfiZflZffiZffl�stuմնuմեuմիuվնuմխ�a�g�j�k�o�t�u�v�w�x�yuαuδuζuηuλuνuξuοuτuχuψuω(����i0iIii�iEizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iPiRiTiVi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i� i!i!i!i	!i!i!i
!i!i!i!i!i!i!i!i!i!i!i !i!!i"!i$!i(!i,!i-!i0!i1!i3!i>!i?!iE!iq3is3iu3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i4�i5�i6�i7�i8�i9�i:�i;�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�ih�ii�ij�ik�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i�i�i�i	�i
�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i8�i9�i;�i<�i=�i>�i@�iA�iB�iC�iD�iF�iJ�iK�iL�iM�iN�iO�iP�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i �i!�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�iN�iO�iP�iQ�iR�iS�iT�iU�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i
�i�i�i�i�i �i!�i"�i#�i$�i%�i&�i'�i(�i)�i*�i+�i,�i-�i.�i/�i0�i1�i2�i3�i4�iG�iV�iW�iX�iY�iZ�i[�i\�i]�i^�i_�i`�ia�ib�ic�id�ie�if�ig�ih�ii�ij�ik�il�im�in�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��cCs"t�t|��}|dk	r|S|��Sr)�
b3_exceptions�getr
�lower)rrrrr�map_table_b3�sr8cCsHt|�}t�d|�}d�dd�|D��}t�d|�}||kr@|S|SdS)NZNFKC�cSsg|]}t|��qSr)r8)�.0Zchrrr�
<listcomp>�sz map_table_b2.<locals>.<listcomp>)r8rZ	normalize�join)r(ZalrZblr
rrr�map_table_b2�sr=cCs|dkS)N� rrrrr�in_table_c11�sr?cCst�|�dko|dkS)N�Zsr>�rr	rrrr�in_table_c12�srBcCst�|�dkS)Nr@rArrrr�in_table_c11_c12�srCcCst|�dkot�|�dkS)N��Cc)r
rr	rrrr�in_table_c21�srFi�iii( i) id ij ip i��i��is�i{�cCs.t|�}|dkrdSt�|�dkr&dS|tkS)NrDFrET)r
rr	�c22_specialsrrrr�in_table_c22�srHcCst�|�dkpt|�tkS)NrE)rr	r
rGrrrr�in_table_c21_c22�s
�rIcCst�|�dkS)NZCorArrrr�in_table_c3�srJcCs0t|�}|dkrdS|dkr dSt|�d@dkS)NrFrTrr)r
rrrr�in_table_c4�srKcCst�|�dkS)NZCsrArrrr�in_table_c5�srLrcCst|�tkSr)r
�c6_setrrrr�in_table_c6�srNi�/i�/cCst|�tkSr)r
�c7_setrrrr�in_table_c7�srPi@iAi i i* i/ cCst|�tkSr)r
�c8_setrrrr�in_table_c8srRii i�cCst|�tkSr)r
�c9_setrrrr�in_table_c9srTcCst�|�dkS)N)�RZAL�rZ
bidirectionalrrrr�in_table_d1srWcCst�|�dkS)N�LrVrrrr�in_table_d2srYN)"�__doc__rrZunidata_version�AssertionErrorr�set�list�rangerrr5r8r=r?rBrCrFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrWrYrrrr�<module>sP,��&P,_sitebuiltins.cpython-38.opt-1.pyc000064400000006633151450073350013023 0ustar00U

e5d+�@s@dZddlZGdd�de�ZGdd�de�ZGdd�de�ZdS)	z=
The objects used by the site module to add custom builtins.
�Nc@s&eZdZdd�Zdd�Zddd�ZdS)	�QuittercCs||_||_dS�N��name�eof)�selfrr�r�%/usr/lib64/python3.8/_sitebuiltins.py�__init__szQuitter.__init__cCsd|j|jfS)NzUse %s() or %s to exitr�rrrr	�__repr__szQuitter.__repr__NcCs(ztj��WnYnXt|��dSr)�sys�stdin�close�
SystemExit)r�coderrr	�__call__s
zQuitter.__call__)N)�__name__�
__module__�__qualname__r
rrrrrr	r
src@s6eZdZdZdZd
dd�Zdd�Zdd	�Zd
d�ZdS)�_Printerzninteractive prompt objects for printing the license text, a list of
    contributors and the copyright notice.�rcs4ddl�||_||_d|_��fdd�|D�|_dS)Nrcs$g|]}�D]}�j�||��qqSr)�path�join)�.0�dir�filename��files�osrr	�
<listcomp>(s�z%_Printer.__init__.<locals>.<listcomp>)r�_Printer__name�_Printer__data�_Printer__lines�_Printer__filenames)rr�datar�dirsrrr	r
#s�z_Printer.__init__c
Cs~|jr
dSd}|jD]B}z(t|d��}|��}W5QRXWqXWqtk
rTYqXq|sb|j}|�d�|_t|j�|_dS)N�r�
)	r#r$�open�read�OSErrorr"�split�len�_Printer__linecnt)rr%r�fprrr	�__setup,s

z_Printer.__setupcCs8|��t|j�|jkr$d�|j�Sd|jfdSdS)Nr(z!Type %s() to see the full %s text�)�_Printer__setupr-r#�MAXLINESrr!rrrr	r<sz_Printer.__repr__cCs�|��d}d}z(t|||j�D]}t|j|�q"Wntk
rPYq�YqX||j7}d}|dkr~t|�}|dkr`d}q`|dkrq�qdS)Nz0Hit Return for more, or q (and Return) to quit: r)��qr5)r2�ranger3�printr#�
IndexError�input)r�prompt�lineno�i�keyrrr	rCs 

z_Printer.__call__N)rr)	rrr�__doc__r3r
r2rrrrrr	rs
	rc@s eZdZdZdd�Zdd�ZdS)�_Helpera3Define the builtin 'help'.

    This is a wrapper around pydoc.help that provides a helpful message
    when 'help' is typed at the Python interactive prompt.

    Calling help() at the Python prompt starts an interactive help session.
    Calling help(thing) prints help for the python object 'thing'.
    cCsdS)NzHType help() for interactive help, or help(object) for help about object.rrrrr	rbsz_Helper.__repr__cOsddl}|j||�S)Nr)�pydoc�help)r�args�kwdsr@rrr	resz_Helper.__call__N)rrrr>rrrrrr	r?Xs	r?)r>r
�objectrrr?rrrr	�<module>s
;cgi.cpython-38.pyc000064400000063655151450073350007760 0ustar00U

&�.e���@sjdZdZddlmZmZmZddlmZddlZddl	Z	ddl
Zddlm
Z
ddlmZddlZddlZddlZdd	d
ddd
ddddddgZdadadd�Zdd�Zdd�Zdd�Zeadade	jdddfdd
�Zd1d!d�Zd"d#�Zd$d�Z Gd%d�d�Z!Gd&d	�d	�Z"e	jfd'd
�Z#d2d(d�Z$e	jfd)d�Z%d*d�Z&d+d�Z'd,d�Z(d-d�Z)d.d/�Z*e+d0k�rfe#�dS)3z�Support module for CGI (Common Gateway Interface) scripts.

This module defines a number of utilities for use by CGI scripts
written in Python.
z2.6�)�StringIO�BytesIO�
TextIOWrapper)�MappingN)�
FeedParser)�Message�MiniFieldStorage�FieldStorage�parse�parse_multipart�parse_header�test�print_exception�
print_environ�
print_form�print_directory�print_arguments�print_environ_usage�cGsFtr,ts,zttd�aWntk
r*YnXts6tantat|�dS)a�Write a log message, if there is a log file.

    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).

    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.

    If the global logfp is not None, it should be a file object to
    which log data is written.

    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).

    �aN)�logfile�logfp�open�OSError�nolog�log�dolog�Zallargs�r�/usr/lib64/python3.8/cgi.py�initlog8sr cGst�||d�dS)z=Write a log message to the log file.  See initlog() for docs.�
N)r�write)Zfmt�argsrrrr[srcGsdS)z9Dummy function, assigned to log when logging is disabled.Nrrrrrr_srcCsdatrt��datadS)zClose the log file.rN)rr�closer rrrrr�closelogcs
r%c
Cs^|dkrtj}t|d�r |j}nd}t|t�r4|j}d|krDd|d<|ddk�rt|d�\}}|dkrxt|||d	�S|d
kr�t	|d�}t
r�|t
kr�td��|�|��
|�}	nd
}	d|kr�|	r�|	d}	|	|d}	n*tjdd��r|	r�|	d}	|	tjd}	|	|d<n<d|k�r |d}	n(tjdd��r<tjd}	nd
}	|	|d<tjj|	||||d�S)a�Parse a query in the environment or from a file (default stdin)

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.
    N�encodingzlatin-1�REQUEST_METHOD�GET�POST�CONTENT_TYPEzmultipart/form-data)�	separator�!application/x-www-form-urlencoded�CONTENT_LENGTH�Maximum content length exceededr�QUERY_STRING�&�)r&r+)�sys�stdin�hasattrr&�
isinstancer�bufferrr�int�maxlen�
ValueError�read�decode�argv�urllibr
Zparse_qs)
�fp�environ�keep_blank_values�strict_parsingr+r&�ctype�pdictZclength�qsrrrr
vsL




��utf-8�replacer0csx|d�d�}d�|�}t�}|�|�z|d|d<Wntk
rLYnXt||||ddi|d���fd	d
��D�S)a�Parse multipart input.

    Arguments:
    fp   : input file
    pdict: dictionary containing other parameters of content-type header
    encoding, errors: request encoding and error handler, passed to
        FieldStorage

    Returns a dictionary just like parse_qs(): keys are the field names, each
    value is a list of values for that field. For non-file fields, the value
    is a list of strings.
    �boundary�asciiz multipart/form-data; boundary={}zCONTENT-LENGTHzContent-Lengthr'r))�headersr&�errorsr?r+csi|]}|��|��qSr)�getlist)�.0�k�Zfsrr�
<dictcomp>�sz#parse_multipart.<locals>.<dictcomp>)r;�formatrZset_type�KeyErrorr	)r>rCr&rJr+rGrBrIrrNrr�s


�ccs�|dd�dkr�|dd�}|�d�}|dkr`|�dd|�|�dd|�dr`|�d|d�}q&|dkrpt|�}|d|�}|��V||d�}qdS)Nr1�;r�"�\"�)�find�count�len�strip)�s�end�frrr�_parseparam�s
(
r]cCs�td|�}|��}i}|D]�}|�d�}|dkr|d|�����}||dd���}t|�dkr�|d|dkr�dkr�nn |dd�}|�d	d
��dd�}|||<q||fS)zfParse a Content-type like header.

    Return the main content-type and a dictionary of options.

    rR�=rNr1rU���rSz\\�\rT)r]�__next__rVrY�lowerrXrF)�line�parts�keyrC�p�i�name�valuerrrr�s
,
c@s@eZdZdZdZdZdZdZiZdZ	iZ
iZdd�Zdd�Z
dS)rz=Like FieldStorage, for use when no file uploads are possible.NcCs||_||_dS)z&Constructor from field name and value.N�rhri��selfrhrirrr�__init__	szMiniFieldStorage.__init__cCsd|j|jfS)z Return printable representation.zMiniFieldStorage(%r, %r)rj�rlrrr�__repr__szMiniFieldStorage.__repr__)�__name__�
__module__�__qualname__�__doc__�filename�list�type�file�type_options�disposition�disposition_optionsrIrmrorrrrr�sc@s�eZdZdZdddejdddddddfdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d:dd�Zd;dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdZd'd(�Zd)d*�Zd+Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z dS)<r	a�Store a sequence of fields, reading multipart/form-data.

    This class provides naming, typing, files stored on disk, and
    more.  At the top level, it is accessible like a dictionary, whose
    keys are the field names.  (Note: None can occur as a field name.)
    The items are either a Python list (if there's multiple values) or
    another FieldStorage or MiniFieldStorage object.  If it's a single
    object, it has the following attributes:

    name: the field name, if specified; otherwise None

    filename: the filename, if specified; otherwise None; this is the
        client side filename, *not* the file name on which it is
        stored (that's a temporary file you don't deal with)

    value: the value as a *string*; for file uploads, this
        transparently reads the file every time you request the value
        and returns *bytes*

    file: the file(-like) object from which you can read the data *as
        bytes* ; None if the data is stored a simple string

    type: the content-type, or None if not specified

    type_options: dictionary of options specified on the content-type
        line

    disposition: content-disposition, or None if not specified

    disposition_options: dictionary of corresponding options

    headers: a dictionary(-like) object (sometimes email.message.Message or a
        subclass thereof) containing *all* headers

    The class is subclassable, mostly for the purpose of overriding
    the make_file() method, which is called internally to come up with
    a file open for reading and writing.  This makes it possible to
    override the default choice of storing all files in a temporary
    directory and unlinking them as soon as they have been opened.

    N�rrErFcCsZd}||_||_|
|_||_d|kr0|d��}d|_|dksF|dkr�d|krX|d}
ntjdd�rrtjd}
nd}
|
�t	�
�d�}
t|
�}|dkr�d	d
i}|dkr�i}|dkr�d
|d	<d|kr�|d|d	<d|kr�|d|_d
|kr�|d
|d<nt|t
tf��std��||_|dk�r*tjj|_n<t|t��r@|j|_n&t|d��rXt|d��s`td��||_||_|	|_t|t��s�tdt|�j��||_d|_||_di}}d|jk�r�t|jd�\}}||_||_ d|_!d|k�r�|d|_!d|_"d|k�r
|d|_"|j"dk	|_#d	|jk�r6t|jd	�\}}n(|j�sH|dk�rTdi}}n
d
i}}||_||_$d|k�r�|d�|j|j�|_%nd|_%d}d|jk�r�zt&|jd�}Wnt'k
�r�YnXt(�r�|t(k�r�t'd��||_)|jdk�r|dk�r||_d|_*|_+d|_,|d
k�r,|�-�n*|dd�dk�rN|�.|||�n|�/�dS)a$Constructor.  Read multipart/* until last part.

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer
            (not used when the request method is GET)
            Can be :
            1. a TextIOWrapper object
            2. an object whose read() and readline() methods return bytes

        headers         : header dictionary-like object; default:
            taken from environ as per CGI spec

        outerboundary   : terminating multipart boundary
            (for internal use only)

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        limit : used internally to read parts of multipart/form-data forms,
            to exit from the reading loop when reached. It is the difference
            between the form content-length and the number of bytes already
            read

        encoding, errors : the encoding and error handler used to decode the
            binary stream to strings. Must be the same as the charset defined
            for the page sending the form (content-type : meta http-equiv or
            header)

        max_num_fields: int. If set, then __init__ throws a ValueError
            if there are more than n fields read by parse_qsl().

        r(r'NZHEADr/r1r�surrogateescapezcontent-typer,r)r*r-�content-lengthz?headers must be mapping or an instance of email.message.Messager:�readlinezfp must be file pointerz#outerboundary must be bytes, not %srzcontent-dispositionrhrtz
text/plainrGr{r_r.�
z
multipart/)0r@rA�max_num_fieldsr+�upper�
qs_on_postr2r<�encode�localeZgetpreferredencodingrr5rr�	TypeErrorrIr3r6r>rr4r&rJ�bytesrvrp�
outerboundary�
bytes_read�limitrryrzrhrt�_binary_filerx�
innerboundaryr7r9r8�lengthrurw�done�read_urlencoded�
read_multi�read_single)rlr>rIr�r?r@rAr�r&rJr�r+�methodrDZcdisprCrBZclenrrrrm?s�/
�


�






�

zFieldStorage.__init__cCs(z|j��Wntk
r"YnXdS�N)rwr$�AttributeErrorrnrrr�__del__�szFieldStorage.__del__cCs|Sr�rrnrrr�	__enter__�szFieldStorage.__enter__cGs|j��dSr�)rwr$)rlr#rrr�__exit__�szFieldStorage.__exit__cCsd|j|j|jfS)z"Return a printable representation.zFieldStorage(%r, %r, %r))rhrtrirnrrrro�s
�zFieldStorage.__repr__cCst|���Sr�)�iter�keysrnrrr�__iter__�szFieldStorage.__iter__cCsT|dkrt|��|jr:|j�d�|j��}|j�d�n|jdk	rL|j}nd}|S)Nrir)r�rw�seekr:rurkrrr�__getattr__�s

zFieldStorage.__getattr__cCs^|jdkrtd��g}|jD]}|j|kr|�|�q|sBt|��t|�dkrV|dS|SdS)zDictionary style indexing.N�
not indexabler1r)rur�rh�appendrQrX)rlre�found�itemrrr�__getitem__s


zFieldStorage.__getitem__cCs8||kr0||}t|t�r(dd�|D�S|jSn|SdS)z8Dictionary style get() method, including 'value' lookup.cSsg|]
}|j�qSr�ri�rL�xrrr�
<listcomp>sz)FieldStorage.getvalue.<locals>.<listcomp>N�r5ruri�rlre�defaultrirrr�getvalues
zFieldStorage.getvaluecCs4||kr,||}t|t�r$|djS|jSn|SdS)z! Return the first value received.rNr�r�rrr�getfirsts

zFieldStorage.getfirstcCs:||kr2||}t|t�r(dd�|D�S|jgSngSdS)z  Return list of received values.cSsg|]
}|j�qSrr�r�rrrr�.sz(FieldStorage.getlist.<locals>.<listcomp>Nr�)rlrerirrrrK)s

zFieldStorage.getlistcCs*|jdkrtd��ttdd�|jD���S)zDictionary style keys() method.Nr�css|]}|jVqdSr��rh�rLr�rrr�	<genexpr>8sz$FieldStorage.keys.<locals>.<genexpr>)rur��setrnrrrr�4s
zFieldStorage.keyscs*|jdkrtd��t�fdd�|jD��S)z%Dictionary style __contains__ method.Nr�c3s|]}|j�kVqdSr�r�r��rerrr�>sz,FieldStorage.__contains__.<locals>.<genexpr>)rur��any)rlrerr�r�__contains__:s
zFieldStorage.__contains__cCst|���S)z Dictionary style len(x) support.)rXr�rnrrr�__len__@szFieldStorage.__len__cCs|jdkrtd��t|j�S)NzCannot be converted to bool.)rur��boolrnrrr�__bool__Ds
zFieldStorage.__bool__c	Cs�|j�|j�}t|t�s0td|jt|�jf��|�|j	|j
�}|jrT|d|j7}tj
j||j|j|j	|j
|j|jd�}dd�|D�|_|��dS)z+Internal: read data in query string format.�%s should return bytes, got %sr0�r&rJr�r+cSsg|]\}}t||��qSr�r�rLrerirrrr�Vsz0FieldStorage.read_urlencoded.<locals>.<listcomp>N)r>r:r�r5r�r9rvrpr;r&rJr�r=r
�	parse_qslr@rAr�r+ru�
skip_lines)rlrD�queryrrrr�Is&
��zFieldStorage.read_urlencodedcCsL|j}t|�std|f��g|_|jrftjj|j|j|j	|j
|j|j|j
d�}|j�dd�|D��|jpp|j}|j��}t|t�s�td|jt|�jf��|jt|�7_|��d|jkr�|r�|j��}|jt|�7_q�|j}|dk	�r|t|j�8}t�}	d}
|j��}|
|7}
|���s�q0�q|
�s:�q@|jt|
�7_|	�|
�|j
|j��|	��}d	|k�rz|d	=|jdk�r�dn
|j|j}
||j||||||
|j
|j||j
�}|dk	�r�|d
8}|j�r�|t|j�8}|dk�r�td��|j|j7_|j�|�|j �s@|j|j!k�r4dk�rnn�q@�q|�"�dS)
z/Internal: read a part that is itself multipart.z&Invalid boundary in multipart form: %rr�css|]\}}t||�VqdSr�r�r�rrrr�fsz*FieldStorage.read_multi.<locals>.<genexpr>r��--Nr{r}r1rzMax number of fields exceeded)#r��valid_boundaryr9rur�r=r
r�r@rAr&rJr�r+�extend�FieldStorageClass�	__class__r>r~r5r�rvrpr�rXrYrZfeedr;r$r�r�r�r�r�)rlr?r@rAZibr��klassZ
first_liner��parserZhdr_text�datarIr��partrrrr�[s��

��





��

(zFieldStorage.read_multicCs4|jdkr|��|��n|��|j�d�dS)zInternal: read an atomic part.rN)r��read_binaryr��
read_linesrwr�rnrrrr��s


zFieldStorage.read_singlei cCs�|��|_|j}|dkr�|dkr�|j�t||j��}t|t�sVt	d|jt
|�jf��|jt
|�7_|std|_q�|j�|�|t
|�}qdS)zInternal: read binary data.rr�r_N)�	make_filerwr�r>r:�min�bufsizer5r�r9rvrpr�rXr�r")rlZtodor�rrrr��s

�zFieldStorage.read_binarycCs@|jrt�|_|_nt�|_|_|jr4|��n|��dS)z0Internal: read lines until EOF or outerboundary.N)r�rrw�_FieldStorage__filerr��read_lines_to_outerboundary�read_lines_to_eofrnrrrr��s
zFieldStorage.read_linescCsv|jdk	rF|j��t|�dkrF|��|_|j��}|j�|�d|_|jrZ|j�|�n|j�|�|j	|j
��dS)z line is always bytes, not stringNi�)r��tellrXr�rwr�r"r�r;r&rJ)rlrcr�rrrZ__write�s


zFieldStorage.__writecCs:|j�d�}|jt|�7_|s*d|_q6|�|�qdS)zInternal: read lines until EOF.�r_N)r>r~r�rXr��_FieldStorage__write)rlrcrrrr��szFieldStorage.read_lines_to_eofc	CsJd|j}|d}d}d}d}|jdk	rFd|jkr>|krFnn�qF|j�d�}|jt|�7_|t|�7}|s~d|_�qF|dkr�||}d}|�d�r�|r�|��}||kr��qF||kr�d	|_�qF|}|�	d
�r�d
}|dd�}d}nL|�	d��rd}|dd�}d}n*|�	d��r.d}|dd�}d
}nd}d
}|�
||�qdS)z�Internal: read lines until outerboundary.
        Data is read as bytes: boundaries and line ends must be converted
        to bytes for comparisons.
        r�r{TrNr�r_�
r1s
����
F)r�r�r>r~r�rXr��
startswith�rstrip�endswithr�)	rl�
next_boundary�
last_boundaryZdelim�last_line_lfendZ_readrc�strippedlineZodelimrrrr��sN
$
z(FieldStorage.read_lines_to_outerboundarycCs�|jr|jrdSd|j}|d}d}|j�d�}|jt|�7_|sPd|_q�|�d�r�|r�|��}||krpq�||kr�d|_q�|�d�}q&dS)z5Internal: skip lines until outer boundary if defined.Nr�Tr�r_r1r�)r�r�r>r~r�rXr�rY)rlr�r�r�rcr�rrrr�s$
zFieldStorage.skip_linescCs&|jrt�d�Stjd|jdd�SdS)a�Overridable: return a readable & writable file.

        The file will be used as follows:
        - data is written to it
        - seek(0)
        - data is read from it

        The file is opened in binary mode for files, in text mode
        for other fields

        This version opens a temporary file for reading and writing,
        and immediately deletes (unlinks) it.  The trick (on Unix!) is
        that the file can still be used, but it can't be opened by
        another process, and it will automatically be deleted when it
        is closed or when the current process terminates.

        If you want a more permanent file, you derive a class which
        overrides this method.  If you want a visible temporary file
        that is nevertheless automatically deleted when the script
        terminates, try defining a __del__ method in a derived class
        which unlinks the temporary files you have created.

        zwb+zw+r!)r&�newlineN)r��tempfileZ
TemporaryFiler&rnrrrr�(s
�zFieldStorage.make_file)N)N)!rprqrrrs�osr?rmr�r�r�ror�r�r�r�r�rKr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	sL)�
&


E	
2cCs�td�t�tjt_zNt�}t�t�t|�t|�t	�dd�}|fdd�}td�|�Wnt
�YnXtd�daz&t�}t�t�t|�t|�Wnt
�YnXd	S)
z�Robust test CGI script, usable as main program.

    Write minimal HTTP headers and dump all information provided to
    the script in HTML form.

    zContent-type: text/htmlcSstd�dS)Nz,testing print_exception() -- <I>italics?</I>)�execrrrrr\[sztest.<locals>.fcSs
|�dSr�r)r\rrr�g]sztest.<locals>.gz9<H3>What follows is a test, not an actual exception:</H3>z*<H1>Second try with a small maxlen...</H1>�2N)�printr2�stdout�stderrr	rrrrrrr8)r?�formr\r�rrrr
Js4
c	Csx|dkrt��\}}}ddl}t�td�|�||�|�||�}tdt�d�|dd���t�|d�f�~dS)Nrz+<H3>Traceback (most recent call last):</H3>z<PRE>%s<B>%s</B></PRE>rr_)	r2�exc_info�	tracebackr��	format_tb�format_exception_only�html�escape�join)rvri�tbr�r�rurrrrqs

��c	Cs\t|���}t�td�td�|D]"}tdt�|�dt�||��q&td�t�dS)z#Dump the shell environment as HTML.z<H3>Shell Environment:</H3>�<DL>�<DT>�<DD>�</DL>N)�sortedr�r�r�r�)r?r�rerrrrs cCs�t|���}t�td�|s&td�td�|D]Z}tdt�|�ddd�||}tdt�tt|���d	�td
t�t|���q2td�t�dS)
z$Dump the contents of a form as HTML.z<H3>Form Contents:</H3>z<P>No form fields.r�r��:� )r[z<i>z</i>r�r�N)r�r�r�r�r��reprrv)r�r�rerirrrr�sc
Csjt�td�zt��}Wn6tk
rP}ztdt�t|���W5d}~XYnXtt�|��t�dS)z#Dump the current directory as HTML.z#<H3>Current Working Directory:</H3>zOSError:N)r�r��getcwdrr�r��str)�pwd�msgrrrr�s&cCs(t�td�t�ttj�t�dS)Nz <H3>Command Line Arguments:</H3>)r�r2r<rrrrr�s

cCstd�dS)z9Dump a list of environment variables used by CGI as HTML.a�
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
N)r�rrrrr�scCs(ddl}t|t�rd}nd}|�||�S)Nrs^[ -~]{0,200}[!-~]$z^[ -~]{0,200}[!-~]$)�rer5r��match)rZr�Z_vb_patternrrrr��s

r��__main__)rErFr0)NNNN),rs�__version__�iorrrZcollections.abcrr2r�Zurllib.parser=Zemail.parserrZ
email.messagerr�r�r��__all__rrr rrr%rr8r?r
rr]rrr	r
rrrrrrr�rprrrr�<module>sh�#	�
F
:'
/
formatter.cpython-38.opt-1.pyc000064400000042213151450073350012143 0ustar00U

e5d';�@s�dZddlZddlZejdedd�dZGdd�d�ZGdd	�d	�ZGd
d�d�ZGdd
�d
e�Z	Gdd�de�Z
ddd�Zedkr�e�dS)aGeneric output formatting.

Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor any sort
of ``change back'' operation. Specific writer properties which may be
controlled via formatter objects are horizontal alignment, font, and left
margin indentations. A mechanism is provided which supports providing
arbitrary, non-exclusive style settings to a writer as well. Additional
interfaces facilitate formatting events which are not reversible, such as
paragraph separation.

Writer objects encapsulate device interfaces. Abstract devices, such as
file formats, are supported as well as physical devices. The provided
implementations all work with abstract devices. The interface makes
available mechanisms for setting the properties which formatter objects
manage and inserting data into the output.
�Nz"the formatter module is deprecated�)�
stacklevelc@s�eZdZdZd(dd�Zdd�Zdd�Zd	d
�Zd)dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd*d$d%�Zd+d&d'�ZdS),�
NullFormattera=A formatter which does nothing.

    If the writer parameter is omitted, a NullWriter instance is created.
    No methods of the writer are called by NullFormatter instances.

    Implementations should inherit from this class if implementing a writer
    interface but don't need to inherit any implementation.

    NcCs|dkrt�}||_dS�N)�
NullWriter�writer��selfr�r
�!/usr/lib64/python3.8/formatter.py�__init__)szNullFormatter.__init__cCsdSrr
�r	�	blankliner
r
r�
end_paragraph-�zNullFormatter.end_paragraphcCsdSrr
�r	r
r
r�add_line_break.rzNullFormatter.add_line_breakcOsdSrr
�r	�args�kwr
r
r�add_hor_rule/rzNullFormatter.add_hor_rulecCsdSrr
�r	�format�counterrr
r
r�add_label_data0rzNullFormatter.add_label_datacCsdSrr
�r	�datar
r
r�add_flowing_data1rzNullFormatter.add_flowing_datacCsdSrr
rr
r
r�add_literal_data2rzNullFormatter.add_literal_datacCsdSrr
rr
r
r�flush_softspace3rzNullFormatter.flush_softspacecCsdSrr
�r	�alignr
r
r�push_alignment4rzNullFormatter.push_alignmentcCsdSrr
rr
r
r�
pop_alignment5rzNullFormatter.pop_alignmentcCsdSrr
)r	�xr
r
r�	push_font6rzNullFormatter.push_fontcCsdSrr
rr
r
r�pop_font7rzNullFormatter.pop_fontcCsdSrr
)r	�marginr
r
r�push_margin8rzNullFormatter.push_margincCsdSrr
rr
r
r�
pop_margin9rzNullFormatter.pop_margincCsdSrr
�r	�spacingr
r
r�set_spacing:rzNullFormatter.set_spacingcGsdSrr
�r	�stylesr
r
r�
push_style;rzNullFormatter.push_style�cCsdSrr
�r	�nr
r
r�	pop_style<rzNullFormatter.pop_stylecCsdSrr
�r	�flagr
r
r�assert_line_data=rzNullFormatter.assert_line_data)N)N)r0)r0)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rrs&



rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd.dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd/d*d+�Zd0d,d-�Zd
S)1�AbstractFormatterz�The standard formatter.

    This implementation has demonstrated wide applicability to many writers,
    and may be used directly in most circumstances.  It has been used to
    implement a full-featured World Wide Web browser.

    cCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_	d|_
d|_d|_dS�Nr0r)
rr!�align_stack�
font_stack�margin_stackr+�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_labelrr
r
rrNszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS�Nrr0)	rEr�send_line_breakrFrD�send_paragraphrArCrBr
r
r
rr]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dSrG)rErCrrHrFrDrArBrr
r
rrhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dSr<)	rErrH�
send_hor_rulerArFrCrBrDrr
r
rros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dSr<)
rFrErrHrCrI�
isinstance�str�send_label_data�format_counterrArBrDrr
r
rrvs

z AbstractFormatter.add_label_datacCstd}|D]f}|dkr"|d|}q|dkrD|dkrn||�||�}q|dkrf|dkrn||�||�}q||}q|S)N��1z%dZaArZiI)�
format_letter�format_roman)r	rr�label�cr
r
rrN�s
z AbstractFormatter.format_countercCs<d}|dkr8t|dd�\}}tt|�|�}||}q|S)NrOrr0�)�divmod�chr�ord)r	�caserrSr$�sr
r
rrQ�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}|d	kr�t|d
�\}}|dkrV||||d|}nT|d
krt|||||}n6|dkr�||}|d}nd}||||}||}|d}q|dkr�|��S|S)N�ir$rT�m�v�l�d)rOrr�
�	r0��rO�I)rV�upper)	r	rYrZonesZfivesrS�indexr$rZr
r
rrR�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr0���� r)�isspace�join�splitrArBrDrErCrFr�send_flowing_data)r	rZprespaceZ	postspacer
r
rr�s*

�z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)Nrhrg�
r)	rBrrlrErArCrDrF�send_literal_datarr
r
rr�s�z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS�Nrr0rh)rBrErCrDrFrArrlrr
r
rr�s�z!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dSr)r!r�
new_alignmentr=�appendr r
r
rr"�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS�Nrg)r=r!rrpr r
r
rr#�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr0rhrg)
rBrErCrArrlr>�AS_ISrq�new_font)
r	�font�sizer[�bZttZcsizeZci�cbZcttr
r
rr%�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dSrr)r>rrt�r	rur
r
rr&�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSr
r
��.0r\r
r
r�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rg)r?rqr�
new_margin�len)r	r'�fstackr
r
rr(s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrgcSsg|]}|r|�qSr
r
rzr
r
rr|
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r?rr}r~)r	rr'r
r
rr)
s
zAbstractFormatter.pop_margincCs||_|j�|�dSr)r+r�new_spacingr*r
r
rr,szAbstractFormatter.set_spacingcGsV|jr*d|_|_|_d|_|j�d�|D]}|j�|�q.|j�t	|j��dSro)
rBrErCrArrlr@rq�
new_styles�tuple)r	r.Zstyler
r
rr/szAbstractFormatter.push_styler0cCs$|j|d�=|j�t|j��dSr)r@rr�r�r1r
r
rr3!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS�Nr)rArErCrDrFr4r
r
rr6%sz"AbstractFormatter.assert_line_data)N)r0)r0)r7r8r9r:rrrrrrNrQrRrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rr;@s,

	
	
	
r;c@sxeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)raMinimal writer interface to use in testing & inheritance.

    A writer which only provides the interface definition; no actions are
    taken on any methods.  This should be the base class for all writers
    which do not need to inherit any implementation methods.

    cCsdSrr
rr
r
rr2rzNullWriter.__init__cCsdSrr
rr
r
r�flush3rzNullWriter.flushcCsdSrr
r r
r
rrp4rzNullWriter.new_alignmentcCsdSrr
ryr
r
rrt5rzNullWriter.new_fontcCsdSrr
�r	r'�levelr
r
rr}6rzNullWriter.new_margincCsdSrr
r*r
r
rr�7rzNullWriter.new_spacingcCsdSrr
r-r
r
rr�8rzNullWriter.new_stylescCsdSrr
r
r
r
rrI9rzNullWriter.send_paragraphcCsdSrr
rr
r
rrH:rzNullWriter.send_line_breakcOsdSrr
rr
r
rrJ;rzNullWriter.send_hor_rulecCsdSrr
rr
r
rrM<rzNullWriter.send_label_datacCsdSrr
rr
r
rrl=rzNullWriter.send_flowing_datacCsdSrr
rr
r
rrn>rzNullWriter.send_literal_dataN)r7r8r9r:rr�rprtr}r�r�rIrHrJrMrlrnr
r
r
rr*src@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�AbstractWriterz�A writer which can be used in debugging formatters, but not much else.

    Each method simply announces itself by printing its name and
    arguments on standard output.

    cCstd|f�dS)Nznew_alignment(%r)��printr r
r
rrpIszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r)r�ryr
r
rrtLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d)r�r�r
r
rr}OszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r)r�r*r
r
rr�RszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r)r�r-r
r
rr�UszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r)r�r
r
r
rrIXszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break()r�rr
r
rrH[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule()r�rr
r
rrJ^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r)r�rr
r
rrMaszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r)r�rr
r
rrldsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r)r�rr
r
rrngsz AbstractWriter.send_literal_dataN)r7r8r9r:rprtr}r�r�rIrHrJrMrlrnr
r
r
rr�Asr�c@sJeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�
DumbWritera;Simple writer class which writes output on the file object passed in
    as the file parameter or, if file is omitted, on standard output.  The
    output is simply word-wrapped to the number of columns specified by
    the maxcol parameter.  This class is suitable for reflowing a sequence
    of paragraphs.

    N�HcCs(|ptj|_||_t�|�|��dSr)�sys�stdout�file�maxcolrr�reset)r	r�r�r
r
rrts
zDumbWriter.__init__cCsd|_d|_dSr�)�col�atbreakrr
r
rr�zszDumbWriter.resetcCs |j�d|�d|_d|_dS�Nrmr�r��writer�r�r
r
r
rrI~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dSr�r�rr
r
rrH�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nrm�-r)r�r�r�r�r�rr
r
rrJ�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nrmrr0)r�r��rfindr��
expandtabsr~r�)r	rr[r
r
rrn�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}|��D]N}|rl|t|�|kr\|d�d}n|d�|d}||�|t|�}d}q6||_|d��|_dS)Nrrmrhr0rg)r�rir�r�r�r�rkr~)r	rr�r�r�r�Zwordr
r
rrl�s$zDumbWriter.send_flowing_data)Nr�)r7r8r9r:rr�rIrHrJrnrlr
r
r
rr�ks

r�cCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z,|D]"}|dkrb|�d�qJ|�|�qJW5|tjk	r�|��X|�d�dS)Nr0rmr)	r�r;�openr��argv�stdin�closerr)r��w�f�fp�liner
r
r�test�s


r��__main__)N)
r:r��warnings�warn�DeprecationWarningrsrr;rr�r�r�r7r
r
r
r�<module>s�"k*C
difflib.cpython-38.pyc000064400000164060151450073350010605 0ustar00U

e5dZH�@s8dZddddddddd	d
ddgZd
dlmZd
dlmZedd�Zdd�Z	Gdd�d�Z
d8dd�Zdd�ZGdd�d�Z
d
dlZe�d�jfdd�Zd9dd�Zdd �Zd:d#d	�Zd$d%�Zd;d&d�Zd'd(�Zd<d+d
�Zdefd,d�Zddefd-d.�Zd/Zd0Zd1Zd2ZGd3d�de�Z [d4d�Z!d5d6�Z"e#d7k�r4e"�dS)=ae
Module difflib -- helpers for computing deltas between objects.

Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
    Use SequenceMatcher to return list of the best "good enough" matches.

Function context_diff(a, b):
    For two lists of strings, return a delta in context diff format.

Function ndiff(a, b):
    Return a delta: the difference between `a` and `b` (lists of strings).

Function restore(delta, which):
    Return one of the two sequences that generated an ndiff delta.

Function unified_diff(a, b):
    For two lists of strings, return a delta in unified diff format.

Class SequenceMatcher:
    A flexible class for comparing pairs of sequences of any type.

Class Differ:
    For producing human-readable deltas from sequences of lines of text.

Class HtmlDiff:
    For producing HTML side by side comparison with change highlights.
�get_close_matches�ndiff�restore�SequenceMatcher�Differ�IS_CHARACTER_JUNK�IS_LINE_JUNK�context_diff�unified_diff�
diff_bytes�HtmlDiff�Match�)�nlargest)�
namedtupleza b sizecCs|rd||SdS)Ng@��?�)�matches�lengthrr�/usr/lib64/python3.8/difflib.py�_calculate_ratio&src@steZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS) ra�
    SequenceMatcher is a flexible class for comparing pairs of sequences of
    any type, so long as the sequence elements are hashable.  The basic
    algorithm predates, and is a little fancier than, an algorithm
    published in the late 1980's by Ratcliff and Obershelp under the
    hyperbolic name "gestalt pattern matching".  The basic idea is to find
    the longest contiguous matching subsequence that contains no "junk"
    elements (R-O doesn't address junk).  The same idea is then applied
    recursively to the pieces of the sequences to the left and to the right
    of the matching subsequence.  This does not yield minimal edit
    sequences, but does tend to yield matches that "look right" to people.

    SequenceMatcher tries to compute a "human-friendly diff" between two
    sequences.  Unlike e.g. UNIX(tm) diff, the fundamental notion is the
    longest *contiguous* & junk-free matching subsequence.  That's what
    catches peoples' eyes.  The Windows(tm) windiff has another interesting
    notion, pairing up elements that appear uniquely in each sequence.
    That, and the method here, appear to yield more intuitive difference
    reports than does diff.  This method appears to be the least vulnerable
    to synching up on blocks of "junk lines", though (like blank lines in
    ordinary text files, or maybe "<P>" lines in HTML files).  That may be
    because this is the only method of the 3 that has a *concept* of
    "junk" <wink>.

    Example, comparing two strings, and considering blanks to be "junk":

    >>> s = SequenceMatcher(lambda x: x == " ",
    ...                     "private Thread currentThread;",
    ...                     "private volatile Thread currentThread;")
    >>>

    .ratio() returns a float in [0, 1], measuring the "similarity" of the
    sequences.  As a rule of thumb, a .ratio() value over 0.6 means the
    sequences are close matches:

    >>> print(round(s.ratio(), 3))
    0.866
    >>>

    If you're only interested in where the sequences match,
    .get_matching_blocks() is handy:

    >>> for block in s.get_matching_blocks():
    ...     print("a[%d] and b[%d] match for %d elements" % block)
    a[0] and b[0] match for 8 elements
    a[8] and b[17] match for 21 elements
    a[29] and b[38] match for 0 elements

    Note that the last tuple returned by .get_matching_blocks() is always a
    dummy, (len(a), len(b), 0), and this is the only case in which the last
    tuple element (number of elements matched) is 0.

    If you want to know how to change the first sequence into the second,
    use .get_opcodes():

    >>> for opcode in s.get_opcodes():
    ...     print("%6s a[%d:%d] b[%d:%d]" % opcode)
     equal a[0:8] b[0:8]
    insert a[8:8] b[8:17]
     equal a[8:29] b[17:38]

    See the Differ class for a fancy human-friendly file differencer, which
    uses SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    See also function get_close_matches() in this module, which shows how
    simple code building on SequenceMatcher can be used to do useful work.

    Timing:  Basic R-O is cubic time worst case and quadratic time expected
    case.  SequenceMatcher is quadratic time for the worst case and has
    expected-case behavior dependent in a complicated way on how many
    elements the sequences have in common; best case time is linear.

    Methods:

    __init__(isjunk=None, a='', b='')
        Construct a SequenceMatcher.

    set_seqs(a, b)
        Set the two sequences to be compared.

    set_seq1(a)
        Set the first sequence to be compared.

    set_seq2(b)
        Set the second sequence to be compared.

    find_longest_match(alo, ahi, blo, bhi)
        Find longest matching block in a[alo:ahi] and b[blo:bhi].

    get_matching_blocks()
        Return list of triples describing matching subsequences.

    get_opcodes()
        Return list of 5-tuples describing how to turn a into b.

    ratio()
        Return a measure of the sequences' similarity (float in [0,1]).

    quick_ratio()
        Return an upper bound on .ratio() relatively quickly.

    real_quick_ratio()
        Return an upper bound on ratio() very quickly.
    N�TcCs(||_d|_|_||_|�||�dS)a!Construct a SequenceMatcher.

        Optional arg isjunk is None (the default), or a one-argument
        function that takes a sequence element and returns true iff the
        element is junk.  None is equivalent to passing "lambda x: 0", i.e.
        no elements are considered to be junk.  For example, pass
            lambda x: x in " \t"
        if you're comparing lines as sequences of characters, and don't
        want to synch up on blanks or hard tabs.

        Optional arg a is the first of two sequences to be compared.  By
        default, an empty string.  The elements of a must be hashable.  See
        also .set_seqs() and .set_seq1().

        Optional arg b is the second of two sequences to be compared.  By
        default, an empty string.  The elements of b must be hashable. See
        also .set_seqs() and .set_seq2().

        Optional arg autojunk should be set to False to disable the
        "automatic junk heuristic" that treats popular elements as junk
        (see module documentation for more information).
        N)�isjunk�a�b�autojunk�set_seqs)�selfrrrrrrr�__init__�s;zSequenceMatcher.__init__cCs|�|�|�|�dS)z�Set the two sequences to be compared.

        >>> s = SequenceMatcher()
        >>> s.set_seqs("abcd", "bcde")
        >>> s.ratio()
        0.75
        N)�set_seq1�set_seq2)rrrrrrr�s	
zSequenceMatcher.set_seqscCs$||jkrdS||_d|_|_dS)aMSet the first sequence to be compared.

        The second sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq1("bcde")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq2().
        N)r�matching_blocks�opcodes)rrrrrr�s
zSequenceMatcher.set_seq1cCs2||jkrdS||_d|_|_d|_|��dS)aMSet the second sequence to be compared.

        The first sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq2("abcd")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq1().
        N)rr r!�
fullbcount�_SequenceMatcher__chain_b)rrrrrr�s
zSequenceMatcher.set_seq2cCs�|j}i|_}t|�D]\}}|�|g�}|�|�qt�|_}|j}|r~|��D]}||�rV|�	|�qV|D]
}||=qrt�|_
}t|�}	|jr�|	dkr�|	dd}
|�
�D]\}}t|�|
kr�|�	|�q�|D]
}||=q�dS)N���d�)r�b2j�	enumerate�
setdefault�append�set�bjunkr�keys�addZbpopular�lenr�items)rrr'�i�elt�indicesZjunkrZpopular�nZntestZidxsrrrZ	__chain_b)s,
zSequenceMatcher.__chain_bcCs4|j|j|j|jjf\}}}}||d}	}
}i}g}
t||�D]�}|j}i}|�|||
�D]\}||krlq^||krxq�||dd�d}||<||kr^||d||d|}	}
}q^|}q@|	|k�r |
|k�r |||
d��s ||	d||
dk�r |	d|
d|d}	}
}q�|	||k�rt|
||k�rt|||
|��st||	|||
|k�rt|d7}�q |	|k�r�|
|k�r�|||
d��r�||	d||
dk�r�|	d|
d|d}	}
}�qt|	||k�r(|
||k�r(|||
|��r(||	|||
|k�r(|d}�q�t|	|
|�S)a�Find longest matching block in a[alo:ahi] and b[blo:bhi].

        If isjunk is not defined:

        Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
            alo <= i <= i+k <= ahi
            blo <= j <= j+k <= bhi
        and for all (i',j',k') meeting those conditions,
            k >= k'
            i <= i'
            and if i == i', j <= j'

        In other words, of all maximal matching blocks, return one that
        starts earliest in a, and of all those maximal matching blocks that
        start earliest in a, return the one that starts earliest in b.

        >>> s = SequenceMatcher(None, " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=0, b=4, size=5)

        If isjunk is defined, first the longest matching block is
        determined as above, but with the additional restriction that no
        junk element appears in the block.  Then that block is extended as
        far as possible by matching (only) junk elements on both sides.  So
        the resulting block never matches on junk except as identical junk
        happens to be adjacent to an "interesting" match.

        Here's the same example as before, but considering blanks to be
        junk.  That prevents " abcd" from matching the " abcd" at the tail
        end of the second sequence directly.  Instead only the "abcd" can
        match, and matches the leftmost "abcd" in the second sequence:

        >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=1, b=0, size=4)

        If no blocks match, return (alo, blo, 0).

        >>> s = SequenceMatcher(None, "ab", "c")
        >>> s.find_longest_match(0, 2, 0, 1)
        Match(a=0, b=0, size=0)
        r
r&)rrr'r,�__contains__�range�getr)r�alo�ahi�blo�bhirrr'ZisbjunkZbestiZbestjZbestsizeZj2lenZnothingr1Zj2lengetZnewj2len�j�krrr�find_longest_matchPsR8"����	�� ��z"SequenceMatcher.find_longest_matchcCs||jdk	r|jSt|j�t|j�}}d|d|fg}g}|r�|��\}}}}|�||||�\}	}
}}|r8|�|�||	kr�||
kr�|�||	||
f�|	||kr8|
||kr8|�|	|||
||f�q8|��d}
}}g}|D]V\}}}|
||k�r|||k�r||7}q�|�r,|�|
||f�|||}
}}q�|�rT|�|
||f�|�||df�tt	t
j|��|_|jS)aReturn list of triples describing matching subsequences.

        Each triple is of the form (i, j, n), and means that
        a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in
        i and in j.  New in Python 2.5, it's also guaranteed that if
        (i, j, n) and (i', j', n') are adjacent triples in the list, and
        the second is not the last triple in the list, then i+n != i' or
        j+n != j'.  IOW, adjacent triples never describe adjacent equal
        blocks.

        The last triple is a dummy, (len(a), len(b), 0), and is the only
        triple with n==0.

        >>> s = SequenceMatcher(None, "abxcd", "abcd")
        >>> list(s.get_matching_blocks())
        [Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
        Nr
)r r/rr�popr>r*�sort�list�mapr�_make)r�la�lbZqueuer r8r9r:r;r1r<r=�x�i1�j1Zk1Znon_adjacent�i2�j2Zk2rrr�get_matching_blocks�s8


z#SequenceMatcher.get_matching_blockscCs�|jdk	r|jSd}}g|_}|��D]�\}}}d}||krN||krNd}n||kr\d}n||krhd}|r�|�|||||f�||||}}|r*|�d||||f�q*|S)a[Return list of 5-tuples describing how to turn a into b.

        Each tuple is of the form (tag, i1, i2, j1, j2).  The first tuple
        has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
        tuple preceding it, and likewise for j1 == the previous j2.

        The tags are strings, with these meanings:

        'replace':  a[i1:i2] should be replaced by b[j1:j2]
        'delete':   a[i1:i2] should be deleted.
                    Note that j1==j2 in this case.
        'insert':   b[j1:j2] should be inserted at a[i1:i1].
                    Note that i1==i2 in this case.
        'equal':    a[i1:i2] == b[j1:j2]

        >>> a = "qabxcd"
        >>> b = "abycdf"
        >>> s = SequenceMatcher(None, a, b)
        >>> for tag, i1, i2, j1, j2 in s.get_opcodes():
        ...    print(("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
        ...           (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2])))
         delete a[0:1] (q) b[0:0] ()
          equal a[1:3] (ab) b[0:2] (ab)
        replace a[3:4] (x) b[2:3] (y)
          equal a[4:6] (cd) b[3:5] (cd)
         insert a[6:6] () b[5:6] (f)
        Nr
r�replace�delete�insert�equal)r!rKr*)rr1r<Zanswer�ai�bj�size�tagrrr�get_opcodess$

zSequenceMatcher.get_opcodes�c
csn|��}|sdg}|dddkrZ|d\}}}}}|t|||�|t|||�|f|d<|dddkr�|d\}}}}}||t|||�|t|||�f|d<||}g}	|D]�\}}}}}|dk�r(|||k�r(|	�||t|||�|t|||�f�|	Vg}	t|||�t|||�}}|	�|||||f�q�|	�rjt|	�dk�rd|	dddk�sj|	VdS)a� Isolate change clusters by eliminating ranges with no changes.

        Return a generator of groups with up to n lines of context.
        Each group is in the same format as returned by get_opcodes().

        >>> from pprint import pprint
        >>> a = list(map(str, range(1,40)))
        >>> b = a[:]
        >>> b[8:8] = ['i']     # Make an insertion
        >>> b[20] += 'x'       # Make a replacement
        >>> b[23:28] = []      # Make a deletion
        >>> b[30] += 'y'       # Make another replacement
        >>> pprint(list(SequenceMatcher(None,a,b).get_grouped_opcodes()))
        [[('equal', 5, 8, 5, 8), ('insert', 8, 8, 8, 9), ('equal', 8, 11, 9, 12)],
         [('equal', 16, 19, 17, 20),
          ('replace', 19, 20, 20, 21),
          ('equal', 20, 22, 21, 23),
          ('delete', 22, 27, 23, 23),
          ('equal', 27, 30, 23, 26)],
         [('equal', 31, 34, 27, 30),
          ('replace', 34, 35, 30, 31),
          ('equal', 35, 38, 31, 34)]]
        )rOr
r&r
r&r
rO���r&N)rT�max�minr*r/)
rr4ZcodesrSrGrIrHrJZnn�grouprrr�get_grouped_opcodes<s(&&(&z#SequenceMatcher.get_grouped_opcodescCs0tdd�|��D��}t|t|j�t|j��S)a�Return a measure of the sequences' similarity (float in [0,1]).

        Where T is the total number of elements in both sequences, and
        M is the number of matches, this is 2.0*M / T.
        Note that this is 1 if the sequences are identical, and 0 if
        they have nothing in common.

        .ratio() is expensive to compute if you haven't already computed
        .get_matching_blocks() or .get_opcodes(), in which case you may
        want to try .quick_ratio() or .real_quick_ratio() first to get an
        upper bound.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.quick_ratio()
        0.75
        >>> s.real_quick_ratio()
        1.0
        css|]}|dVqdS)rVNr)�.0Ztriplerrr�	<genexpr>�sz(SequenceMatcher.ratio.<locals>.<genexpr>)�sumrKrr/rr)rrrrr�rationszSequenceMatcher.ratiocCs�|jdkr4i|_}|jD]}|�|d�d||<q|j}i}|jd}}|jD]>}||�rf||}n|�|d�}|d||<|dkrP|d}qPt|t|j�t|j��S)z�Return an upper bound on ratio() relatively quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute.
        Nr
r&)r"rr7r5rrr/)rr"r2ZavailZavailhasrZnumbrrr�quick_ratio�s






zSequenceMatcher.quick_ratiocCs*t|j�t|j�}}tt||�||�S)z�Return an upper bound on ratio() very quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute than either .ratio() or .quick_ratio().
        )r/rrrrX)rrDrErrr�real_quick_ratio�sz SequenceMatcher.real_quick_ratio)NrrT)rU)�__name__�
__module__�__qualname__�__doc__rrrrr#r>rKrTrZr^r_r`rrrrr+sj
@,'nG7
2rU�333333�?cCs�|dkstd|f��d|kr*dks:ntd|f��g}t�}|�|�|D]D}|�|�|��|krR|��|krR|��|krR|�|��|f�qRt||�}dd�|D�S)a�Use SequenceMatcher to return list of the best "good enough" matches.

    word is a sequence for which close matches are desired (typically a
    string).

    possibilities is a list of sequences against which to match word
    (typically a list of strings).

    Optional arg n (default 3) is the maximum number of close matches to
    return.  n must be > 0.

    Optional arg cutoff (default 0.6) is a float in [0, 1].  Possibilities
    that don't score at least that similar to word are ignored.

    The best (no more than n) matches among the possibilities are returned
    in a list, sorted by similarity score, most similar first.

    >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
    ['apple', 'ape']
    >>> import keyword as _keyword
    >>> get_close_matches("wheel", _keyword.kwlist)
    ['while']
    >>> get_close_matches("Apple", _keyword.kwlist)
    []
    >>> get_close_matches("accept", _keyword.kwlist)
    ['except']
    r
zn must be > 0: %rgrz cutoff must be in [0.0, 1.0]: %rcSsg|]\}}|�qSrr)r[ZscorerFrrr�
<listcomp>�sz%get_close_matches.<locals>.<listcomp>)	�
ValueErrorrrrr`r_r^r*�	_nlargest)ZwordZ
possibilitiesr4�cutoff�result�srFrrrr�s"


�
�
cCsd�dd�t||�D��S)zAReplace whitespace with the original whitespace characters in `s`rcss*|]"\}}|dkr|��r|n|VqdS)� N)�isspace)r[�cZtag_crrrr\�s�z$_keep_original_ws.<locals>.<genexpr>)�join�zip)rkZtag_srrr�_keep_original_ws�s
�rqc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra�

    Differ is a class for comparing sequences of lines of text, and
    producing human-readable differences or deltas.  Differ uses
    SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    Each line of a Differ delta begins with a two-letter code:

        '- '    line unique to sequence 1
        '+ '    line unique to sequence 2
        '  '    line common to both sequences
        '? '    line not present in either input sequence

    Lines beginning with '? ' attempt to guide the eye to intraline
    differences, and were not present in either input sequence.  These lines
    can be confusing if the sequences contain tab characters.

    Note that Differ makes no claim to produce a *minimal* diff.  To the
    contrary, minimal diffs are often counter-intuitive, because they synch
    up anywhere possible, sometimes accidental matches 100 pages apart.
    Restricting synch points to contiguous matches preserves some notion of
    locality, at the occasional cost of producing a longer diff.

    Example: Comparing two texts.

    First we set up the texts, sequences of individual single-line strings
    ending with newlines (such sequences can also be obtained from the
    `readlines()` method of file-like objects):

    >>> text1 = '''  1. Beautiful is better than ugly.
    ...   2. Explicit is better than implicit.
    ...   3. Simple is better than complex.
    ...   4. Complex is better than complicated.
    ... '''.splitlines(keepends=True)
    >>> len(text1)
    4
    >>> text1[0][-1]
    '\n'
    >>> text2 = '''  1. Beautiful is better than ugly.
    ...   3.   Simple is better than complex.
    ...   4. Complicated is better than complex.
    ...   5. Flat is better than nested.
    ... '''.splitlines(keepends=True)

    Next we instantiate a Differ object:

    >>> d = Differ()

    Note that when instantiating a Differ object we may pass functions to
    filter out line and character 'junk'.  See Differ.__init__ for details.

    Finally, we compare the two:

    >>> result = list(d.compare(text1, text2))

    'result' is a list of strings, so let's pretty-print it:

    >>> from pprint import pprint as _pprint
    >>> _pprint(result)
    ['    1. Beautiful is better than ugly.\n',
     '-   2. Explicit is better than implicit.\n',
     '-   3. Simple is better than complex.\n',
     '+   3.   Simple is better than complex.\n',
     '?     ++\n',
     '-   4. Complex is better than complicated.\n',
     '?            ^                     ---- ^\n',
     '+   4. Complicated is better than complex.\n',
     '?           ++++ ^                      ^\n',
     '+   5. Flat is better than nested.\n']

    As a single multi-line string it looks like this:

    >>> print(''.join(result), end="")
        1. Beautiful is better than ugly.
    -   2. Explicit is better than implicit.
    -   3. Simple is better than complex.
    +   3.   Simple is better than complex.
    ?     ++
    -   4. Complex is better than complicated.
    ?            ^                     ---- ^
    +   4. Complicated is better than complex.
    ?           ++++ ^                      ^
    +   5. Flat is better than nested.

    Methods:

    __init__(linejunk=None, charjunk=None)
        Construct a text differencer, with optional filters.

    compare(a, b)
        Compare two sequences of lines; generate the resulting delta.
    NcCs||_||_dS)a�
        Construct a text differencer, with optional filters.

        The two optional keyword parameters are for filter functions:

        - `linejunk`: A function that should accept a single string argument,
          and return true iff the string is junk. The module-level function
          `IS_LINE_JUNK` may be used to filter out lines without visible
          characters, except for at most one splat ('#').  It is recommended
          to leave linejunk None; the underlying SequenceMatcher class has
          an adaptive notion of "noise" lines that's better than any static
          definition the author has ever been able to craft.

        - `charjunk`: A function that should accept a string of length 1. The
          module-level function `IS_CHARACTER_JUNK` may be used to filter out
          whitespace characters (a blank or tab; **note**: bad idea to include
          newline in this!).  Use of IS_CHARACTER_JUNK is recommended.
        N��linejunk�charjunk)rrsrtrrrrHszDiffer.__init__c
	cs�t|j||�}|��D]�\}}}}}|dkrB|�||||||�}	n\|dkr\|�d|||�}	nB|dkrv|�d|||�}	n(|dkr�|�d|||�}	ntd|f��|	Ed	Hqd	S)
a�
        Compare two sequences of lines; generate the resulting delta.

        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.

        Example:

        >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(True),
        ...                                'ore\ntree\nemu\n'.splitlines(True))),
        ...       end="")
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu
        rLrM�-rN�+rOrl�unknown tag %rN)rrsrT�_fancy_replace�_dumprg)
rrr�cruncherrSr8r9r:r;�grrr�compare_szDiffer.compareccs&t||�D]}d|||fVq
dS)z4Generate comparison results for a same-tagged range.z%s %sN)r6)rrSrF�lo�hir1rrrry�szDiffer._dumpc
cs�||kr||kst�||||krF|�d|||�}|�d|||�}n |�d|||�}|�d|||�}||fD]}	|	EdHqndS)Nrvru)�AssertionErrorry)
rrr8r9rr:r;�first�secondr{rrr�_plain_replace�szDiffer._plain_replaceccs:d\}}t|j�}	d\}
}t||�D]�}||}
|	�|
�t||�D]j}||}||
krl|
dkrD||}
}qD|	�|�|	��|krD|	��|krD|	��|krD|	��||}}}qDq$||kr�|
dkr�|�||||||�EdHdS|
|d}}}nd}
|�	||||||�EdH||||}}|
dk�r
d}}|	�
||�|	��D]�\}}}}}||||}}|dk�r�|d|7}|d|7}nb|dk�r�|d	|7}nJ|d
k�r�|d|7}n2|dk�r�|d
|7}|d
|7}ntd|f���qH|�
||||�EdHn
d|V|�	||d|||d|�EdHdS)aL
        When replacing one block of lines with another, search the blocks
        for *similar* lines; the best-matching pair (if any) is used as a
        synch point, and intraline difference marking is done on the
        similar pair. Lots of work, but often worth it.

        Example:

        >>> d = Differ()
        >>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,
        ...                            ['abcdefGhijkl\n'], 0, 1)
        >>> print(''.join(results), end="")
        - abcDefghiJkl
        ?    ^  ^  ^
        + abcdefGhijkl
        ?    ^  ^  ^
        )g�G�z��?g�?)NNNrrrL�^rMrurNrvrOrlrw�  r&)rrtr6rrr`r_r^r��
_fancy_helperrrTrg�_qformat)rrr8r9rr:r;Z
best_ratiorirzZeqiZeqjr<rQr1rPZbest_iZbest_jZaeltZbelt�atags�btagsrSZai1Zai2Zbj1Zbj2rDrErrrrx�s\




�
�





zDiffer._fancy_replaceccsbg}||kr<||kr*|�||||||�}qT|�d|||�}n||krT|�d|||�}|EdHdS)Nrurv)rxry)rrr8r9rr:r;r{rrrr��szDiffer._fancy_helperccsXt||���}t||���}d|V|r8d|�d�Vd|V|rTd|�d�VdS)a�
        Format "?" output and deal with tabs.

        Example:

        >>> d = Differ()
        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print(repr(line))
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'
        �- z? �
�+ N)rq�rstrip)rZalineZbliner�r�rrrr�s

zDiffer._qformat)NN)rarbrcrdrr|ryr�rxr�r�rrrrr�s]
)^Nz
\s*(?:#\s*)?$cCs||�dk	S)z�
    Return True for ignorable line: iff `line` is blank or contains a single '#'.

    Examples:

    >>> IS_LINE_JUNK('\n')
    True
    >>> IS_LINE_JUNK('  #   \n')
    True
    >>> IS_LINE_JUNK('hello\n')
    False
    Nr)�lineZpatrrrr3s� 	cCs||kS)z�
    Return True for ignorable character: iff `ch` is a space or tab.

    Examples:

    >>> IS_CHARACTER_JUNK(' ')
    True
    >>> IS_CHARACTER_JUNK('\t')
    True
    >>> IS_CHARACTER_JUNK('\n')
    False
    >>> IS_CHARACTER_JUNK('x')
    False
    r)ZchZwsrrrrCscCs:|d}||}|dkr"d�|�S|s.|d8}d�||�S�z Convert range to the "ed" formatr&z{}z{},{}��format��start�stopZ	beginningrrrr�_format_range_unifiedZs
r�rr�ccsPt|||||||�d}td||��|�D�]}	|s|d}|rFd�|�nd}
|rXd�|�nd}d�||
|�Vd�|||�V|	d|	d	}}
t|d
|
d�}t|d|
d
�}d�|||�V|	D]�\}}}}}|dkr�|||�D]}d|Vq�q�|dk�r"|||�D]}d|V�q|dkr�|||�D]}d|V�q6q�q*dS)a�
    Compare two sequences of lines; generate the delta as a unified diff.

    Unified diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with ---, +++, or @@) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The unidiff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for
    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.

    Example:

    >>> for line in unified_diff('one two three four'.split(),
    ...             'zero one tree four'.split(), 'Original', 'Current',
    ...             '2005-01-26 23:30:50', '2010-04-02 10:20:52',
    ...             lineterm=''):
    ...     print(line)                 # doctest: +NORMALIZE_WHITESPACE
    --- Original        2005-01-26 23:30:50
    +++ Current         2010-04-02 10:20:52
    @@ -1,4 +1,4 @@
    +zero
     one
    -two
    -three
    +tree
     four
    FNT�	{}r�
--- {}{}{}z
+++ {}{}{}r
rVr&�rU�z@@ -{} +{} @@{}rOrl>rMrLru>rLrNrv)�_check_typesrrZr�r�)rr�fromfile�tofile�fromfiledate�
tofiledater4�lineterm�startedrY�fromdate�todater��last�file1_range�file2_rangerSrGrIrHrJr�rrrr	es0)
cCsB|d}||}|s|d8}|dkr.d�|�Sd�|||d�Sr�r�r�rrr�_format_range_context�s
r�ccs�t|||||||�tddddd�}d}	td||��|�D�]R}
|	s�d}	|rVd	�|�nd
}|rhd	�|�nd
}d�|||�Vd�|||�V|
d
|
d}
}d|Vt|
d|d�}d�||�Vtdd�|
D���r|
D]8\}}}}}|dkr�|||�D]}|||V�qq�t|
d|d�}d�||�Vtdd�|
D��r:|
D]<\}}}}}|dk�rP|||�D]}|||V�qt�qPq:dS)ah
    Compare two sequences of lines; generate the delta as a context diff.

    Context diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with *** or ---) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The context diff format normally has a header for filenames and
    modification times.  Any or all of these may be specified using
    strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.
    If not specified, the strings default to blanks.

    Example:

    >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True),
    ...       'zero\none\ntree\nfour\n'.splitlines(True), 'Original', 'Current')),
    ...       end="")
    *** Original
    --- Current
    ***************
    *** 1,4 ****
      one
    ! two
    ! three
      four
    --- 1,4 ----
    + zero
      one
    ! tree
      four
    r�r�z! r�)rNrMrLrOFNTr�rz
*** {}{}{}r�r
rVz***************r&r�z
*** {} ****{}css |]\}}}}}|dkVqdS)>rMrLNr�r[rS�_rrrr\�szcontext_diff.<locals>.<genexpr>rNrUr�z
--- {} ----{}css |]\}}}}}|dkVqdS)>rLrNNrr�rrrr\srM)r��dictrrZr�r��any)rrr�r�r�r�r4r��prefixr�rYr�r�r�r�r�rSrGrIr�r�r�rHrJrrrr�s4,

cGs�|r0t|dt�s0tdt|d�j|df��|r`t|dt�s`tdt|d�j|df��|D]}t|t�sdtd|f��qddS)Nr
z)lines to compare must be str, not %s (%r)z"all arguments must be str, not: %r)�
isinstance�str�	TypeError�typera)rr�args�argrrrr�s��
r���
c		cs~dd�}	tt|	|��}tt|	|��}|	|�}|	|�}|	|�}|	|�}|	|�}|||||||||�}
|
D]}|�dd�VqfdS)a�
    Compare `a` and `b`, two sequences of lines represented as bytes rather
    than str. This is a wrapper for `dfunc`, which is typically either
    unified_diff() or context_diff(). Inputs are losslessly converted to
    strings so that `dfunc` only has to worry about strings, and encoded
    back to bytes on return. This is necessary to compare files with
    unknown or inconsistent encoding. All other inputs (except `n`) must be
    bytes rather than str.
    c
SsRz|�dd�WStk
rL}z dt|�j|f}t|�|�W5d}~XYnXdS)N�ascii�surrogateescapez(all arguments must be bytes, not %s (%r))�decode�AttributeErrorr�rar�)rk�err�msgrrrr�"s�zdiff_bytes.<locals>.decoder�r�N)rArB�encode)Zdfuncrrr�r�r�r�r4r�r��linesr�rrrr
scCst||��||�S)aJ
    Compare `a` and `b` (lists of strings); return a `Differ`-style delta.

    Optional keyword parameters `linejunk` and `charjunk` are for filter
    functions, or can be None:

    - linejunk: A function that should accept a single string argument and
      return true iff the string is junk.  The default is None, and is
      recommended; the underlying SequenceMatcher class has an adaptive
      notion of "noise" lines.

    - charjunk: A function that accepts a character (string of length
      1), and returns true iff the character is junk. The default is
      the module-level function IS_CHARACTER_JUNK, which filters out
      whitespace characters (a blank or tab; note: it's a bad idea to
      include newline in this!).

    Tools/scripts/ndiff.py is a command-line front-end to this function.

    Example:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> print(''.join(diff), end="")
    - one
    ?  ^
    + ore
    ?  ^
    - two
    - three
    ?  -
    + tree
    + emu
    )rr|)rrrsrtrrrr5s#c#s�ddl}|�d��t||||��ddgf�fdd�	���fdd���fdd	�}|�}|dkrj|EdH�n|d
7}d}ddg|}	}
d}|dkr�zt|�\}}
}Wntk
r�YdSX|	|}||
|f|
|<|	d
7}	q�|	|kr�dV|}n|	}d}	|�r"|	|}|	d
7}	|
|V|d
8}q�|d
}z@|�rht|�\}}
}|�rP|d
}n|d
8}||
|fV�q,Wqvtk
�r�YdSXqvdS)
a�Returns generator yielding marked up from/to side by side differences.

    Arguments:
    fromlines -- list of text lines to compared to tolines
    tolines -- list of text lines to be compared to fromlines
    context -- number of context lines to display on each side of difference,
               if None, all from/to text lines will be generated.
    linejunk -- passed on to ndiff (see ndiff documentation)
    charjunk -- passed on to ndiff (see ndiff documentation)

    This function returns an iterator which returns a tuple:
    (from line tuple, to line tuple, boolean flag)

    from/to line tuple -- (line num, line text)
        line num -- integer or None (to indicate a context separation)
        line text -- original line text with following markers inserted:
            '\0+' -- marks start of added text
            '\0-' -- marks start of deleted text
            '\0^' -- marks start of changed text
            '\1' -- marks end of added/deleted/changed text

    boolean flag -- None indicates context separation, True indicates
        either "from" or "to" line contains a change, otherwise False.

    This function/iterator was originally developed to generate side by side
    file difference for making HTML pages (see HtmlDiff class for example
    usage).

    Note, this function utilizes the ndiff function to generate the side by
    side difference markup.  Optional ndiff arguments may be passed to this
    function and they in turn will be passed to ndiff.
    r
Nz
(\++|\-+|\^+)cs�||d7<|dkr2|||�d�dd�fS|dkr�|�d�|�d�}}g}|fdd�}��||�t|�D]<\}\}	}
|d|	�d|||	|
�d	||
d�}qt|dd�}n*|�d�dd�}|s�d
}d||d	}|||fS)aReturns line of text with user's change markup and line formatting.

        lines -- list of lines from the ndiff generator to produce a line of
                 text from.  When producing the line of text to return, the
                 lines used are removed from this list.
        format_key -- '+' return first line in list with "add" markup around
                          the entire line.
                      '-' return first line in list with "delete" markup around
                          the entire line.
                      '?' return first line in list with add/delete/change
                          intraline markup (indices obtained from second line)
                      None return first line in list with no markup
        side -- indice into the num_lines list (0=from,1=to)
        num_lines -- from/to current line number.  This is NOT intended to be a
                     passed parameter.  It is present as a keyword argument to
                     maintain memory of the current line numbers between calls
                     of this function.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r&Nr
r��?cSs&|�|�d�d|��g�|�d�S)Nr&r
)r*rY�span)Zmatch_object�sub_inforrr�record_sub_info�sz3_mdiff.<locals>._make_line.<locals>.record_sub_info��rl)r?�sub�reversed)r�Z
format_key�sideZ	num_lines�textZmarkersr�r��keyZbegin�end)�	change_rerr�
_make_line�s 2z_mdiff.<locals>._make_linec3sng}d\}}t|�dkr*|�t�d��qd�dd�|D��}|�d�rP|}�n�|�d�r|�|dd	��|dd
�dfVq�n�|�d�r�|d
8}�|d
d	�ddfVq�nl|�d�rֈ|d
d	�d}}|d
d	}}�n>|�d��r�|dd	��|dd
�dfVq�n|�d��r0�|dd	��|dd
�dfVqn�|�d
��r\|d
8}�|d
d	�ddfVqn�|�d��r�|d
7}d�|dd
�dfVqn�|�d��r�d�|dd
�}}|d
d	}}n^|�d��r�|d
7}d�|dd
�dfVqn2|�d��r�|dd�dd	��|dd
�dfVq|d	k�r0|d
7}dV�q|d	k�rL|d
8}dV�q0|�d��r\dS||dfVqdS)a�Yields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from a
        differencing iterator, processes them and yields them.  When it can
        it yields both a "from" and a "to" line, otherwise it will yield one
        or the other.  In addition to yielding the lines of from/to text, a
        boolean flag is yielded to indicate if the text line(s) have
        differences in them.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        )r
r
r��XrcSsg|]}|d�qS)r
r�r[r�rrrrf�sz2_mdiff.<locals>._line_iterator.<locals>.<listcomp>z-?+?r�r
r&Tz--++ruN)z--?+z--+r�z-+?z-?+z+--rv)r�z+-rlF)N�rr�T)r�NT)r/r*�nextro�
startswith)r�Znum_blanks_pendingZnum_blanks_to_yieldrk�	from_line�to_line)r��diff_lines_iteratorrr�_line_iterator�sd



$



z_mdiff.<locals>._line_iteratorc3s���}gg}}t|�dks(t|�dkr�zt|�\}}}Wntk
rPYdSX|dk	rh|�||f�|dk	r|�||f�q|�d�\}}|�d�\}}|||p�|fVqdS)atYields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from the line
        iterator.  Its difference from that iterator is that this function
        always yields a pair of from/to text lines (with the change
        indication).  If necessary it will collect single from/to lines
        until it has a matching pair from/to pair to yield.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r
N)r/r��
StopIterationr*r?)Z
line_iterator�	fromlines�tolinesr�r��
found_diffZfromDiffZto_diff)r�rr�_line_pair_iterators

z#_mdiff.<locals>._line_pair_iteratorr&F)NNN)�re�compilerr�r�)r�r��contextrsrtr�r�Zline_pair_iteratorZlines_to_write�indexZcontextLinesr�r�r�r1r)r�r�r�r�r�_mdiffZsR"
8X!



r�an
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>aH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}aZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>a�
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>c@s�eZdZdZeZeZeZeZdZddde	fdd�Z
dd
d�dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zddd�ZdS) ra{For producing HTML side by side comparison with change highlights.

    This class can be used to create an HTML table (or a complete HTML file
    containing the table) showing a side by side, line by line comparison
    of text with inter-line and intra-line change highlights.  The table can
    be generated in either full or contextual difference mode.

    The following methods are provided for HTML generation:

    make_table -- generates HTML for a single side by side table
    make_file -- generates complete HTML file with a single side by side table

    See tools/scripts/diff.py for an example usage of this class.
    r
�NcCs||_||_||_||_dS)a�HtmlDiff instance initializer

        Arguments:
        tabsize -- tab stop spacing, defaults to 8.
        wrapcolumn -- column number where lines are broken and wrapped,
            defaults to None where lines are not wrapped.
        linejunk,charjunk -- keyword arguments passed into ndiff() (used by
            HtmlDiff() to generate the side by side HTML differences).  See
            ndiff() documentation for argument default values and descriptions.
        N)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r�tabsizeZ
wrapcolumnrsrtrrrr�szHtmlDiff.__init__rF�zutf-8)�charsetcCs:|jt|j|j|j||||||d�|d��|d��|�S)aReturns HTML file of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        charset -- charset of the HTML document
        )r��numlines)ZstylesZlegend�tabler��xmlcharrefreplace)�_file_templater��_styles�_legend�
make_tabler�r�)rr�r��fromdesc�todescr�r�r�rrr�	make_file�s����zHtmlDiff.make_filecs8�fdd���fdd�|D�}�fdd�|D�}||fS)aReturns from/to line lists with tabs expanded and newlines removed.

        Instead of tab characters being replaced by the number of spaces
        needed to fill in to the next tab stop, this function will fill
        the space with tab characters.  This is done so that the difference
        algorithms can identify changes in a file when tabs are replaced by
        spaces and vice versa.  At the end of the HTML generation, the tab
        characters will be replaced with a nonbreakable space.
        cs6|�dd�}|��j�}|�dd�}|�dd��d�S)Nrlr��	r�)rL�
expandtabsr�r�)r�)rrr�expand_tabs�sz2HtmlDiff._tab_newline_replace.<locals>.expand_tabscsg|]}�|��qSrrr��r�rrrf�sz1HtmlDiff._tab_newline_replace.<locals>.<listcomp>csg|]}�|��qSrrr�r�rrrf�sr)rr�r�r)r�rr�_tab_newline_replace�s
	zHtmlDiff._tab_newline_replacecCs|s|�||f�dSt|�}|j}||ksB||�d�d|krT|�||f�dSd}d}d}||kr�||kr�||dkr�|d7}||}|d7}q`||dkr�|d7}d}q`|d7}|d7}q`|d|�}	||d�}
|r�|	d}	d||
}
|�||	f�|�|d|
�dS)	a�Builds list of text lines by splitting text lines at wrap point

        This function will determine if the input text line needs to be
        wrapped (split) into separate lines.  If so, the first wrap point
        will be determined and the first line appended to the output
        text line list.  This function is used recursively to handle
        the second part of the split line to further split it.
        Nr�rUr
rr&r��>)r*r/r��count�_split_line)rZ	data_listZline_numr�rRrWr1r4ZmarkZline1Zline2rrrr��s8


zHtmlDiff._split_lineccs�|D]�\}}}|dkr$|||fVq||\}}\}}gg}	}
|�|	||�|�|
||�|	sd|
r|	rt|	�d�}nd}|
r�|
�d�}nd}|||fVq\qdS)z5Returns iterator that splits (wraps) mdiff text linesNr
)rrl)r�r?)r�diffs�fromdata�todata�flagZfromlineZfromtextZtolineZtotext�fromlist�tolistrrr�
_line_wrapper0s 
zHtmlDiff._line_wrapperc	Cs�ggg}}}|D]r\}}}z4|�|jd|f|���|�|jd|f|���Wn(tk
rz|�d�|�d�YnX|�|�q|||fS)z�Collects mdiff output into separate lists

        Before storing the mdiff from/to data into a list, it is converted
        into a single line of text with HTML markup.
        r
r&N)r*�_format_liner�)rr�r�r��flaglistr�r�r�rrr�_collect_linesLs
zHtmlDiff._collect_linescCsrzd|}d|j||f}Wntk
r6d}YnX|�dd��dd��dd	�}|�d
d���}d|||fS)
aReturns HTML markup of "from" / "to" text lines

        side -- 0 or 1 indicating "from" or "to" text
        flag -- indicates if difference on line
        linenum -- line number (used for line number column)
        text -- line text to be marked up
        z%dz
 id="%s%s"r�&z&amp;r�z&gt;�<z&lt;rl�&nbsp;z<<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>)�_prefixr�rLr�)rr�r�Zlinenumr��idrrrr�as
�zHtmlDiff._format_linecCs0dtj}dtj}tjd7_||g|_dS)zCreate unique anchor prefixeszfrom%d_zto%d_r&N)r�_default_prefixr)rZ
fromprefix�toprefixrrr�_make_prefixxs

zHtmlDiff._make_prefixcCs�|jd}dgt|�}dgt|�}d\}	}
d}t|�D]V\}}
|
r�|
s�d}
|}td||g�}d||	f||<|	d7}	d||	f||<q:d}
q:|s�dg}dg}dg}d}|r�d	g}|}n
d
g}}|ds�d||d<d|||<|||||fS)
zMakes list of "next" linksr&r)r
Fr
Tz id="difflib_chg_%s_%d"z"<a href="#difflib_chg_%s_%d">n</a>Fz2<td></td><td>&nbsp;No Differences Found&nbsp;</td>z(<td></td><td>&nbsp;Empty File&nbsp;</td>z!<a href="#difflib_chg_%s_0">f</a>z#<a href="#difflib_chg_%s_top">t</a>)rr/r(rW)rr�r�r�r�r�r�next_id�	next_hrefZnum_chgZ	in_changer�r1r�rrr�_convert_flags�s>
�
zHtmlDiff._convert_flagsc
CsR|��|�||�\}}|r"|}nd}t||||j|jd�}|jrL|�|�}|�|�\}	}
}|�|	|
|||�\}	}
}}}
g}d}t	t
|��D]P}||dkr�|dkr�|�d�q�|�||
||||	||||
|f�q�|s�|�rddd|dd|f}nd	}|jt
d	�|�||jd
d�}|�dd
��dd��dd��dd��dd�S)a�Returns HTML table of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        NrrzV            <tr><td class="diff_next"%s>%s</td>%s<td class="diff_next">%s</td>%s</tr>
r
z)        </tbody>        
        <tbody>
z <thead><tr>%s%s%s%s</tr></thead>z!<th class="diff_next"><br /></th>z+<th colspan="2" class="diff_header">%s</th>rr&)Z	data_rows�
header_rowr�z+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r�z</span>r�r)rr�r�r�r�r�r�rrr6r/r*�_table_templater�rorrL)rr�r�r�r�r�r�Z
context_linesr�r�r�r�r
r	rkZfmtr1rr�rrrr��sl�
��

������zHtmlDiff.make_table)rrFr�)rrFr�)rarbrcrdr�r�r
r�rrrr�r�r�r�rr�rrr�rrrrr�s2�
��7/�ccsnzddd�t|�}Wn"tk
r8td|�d�YnXd|f}|D]"}|dd�|krF|dd�VqFdS)a0
    Generate one of the two sequences that generated a delta.

    Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract
    lines originating from file 1 or 2 (parameter `which`), stripping off line
    prefixes.

    Examples:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> diff = list(diff)
    >>> print(''.join(restore(diff, 1)), end="")
    one
    two
    three
    >>> print(''.join(restore(diff, 2)), end="")
    ore
    tree
    emu
    r�r�)r&r�z)unknown delta choice (must be 1 or 2): %rNr�r�)�int�KeyErrorrg)ZdeltaZwhichrS�prefixesr�rrrrs��cCsddl}ddl}|�|�S)Nr
)�doctest�difflibZtestmod)rrrrr�_test!sr�__main__)rUre)r�)rrrrrUr�)rrrrrUr�)r�r�r�r�rUr�)$rd�__all__�heapqrrh�collectionsrZ_namedtuplerrrrrqrr�r��matchrrr�r	r�rr�r
rr�r�r�r
r��objectrrrrarrrr�<module>s��


1	I
�
I�
L�
%�
	
a 
runpy.cpython-38.pyc000064400000017767151450073350010376 0ustar00U

e5d/�@sdZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddgZGdd�de�Z
Gdd	�d	e�Zd d
d�Zd!dd
�Zefdd�ZGdd�de�Zd"dd�Zd#dd�Zefdd�Zdd�Zd$dd�Zedk�reej�dk�r�edejd�nejd=eejd�dS)%aZrunpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
�N)�	read_code�get_importer�
run_module�run_pathc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_TempModulezCTemporarily replace a module in sys.modules with an empty namespacecCs||_t�|�|_g|_dS�N)�mod_name�types�
ModuleType�module�
_saved_module��selfr�r�/usr/lib64/python3.8/runpy.py�__init__sz_TempModule.__init__cCsB|j}z|j�tj|�Wntk
r0YnX|jtj|<|Sr)rr�append�sys�modules�KeyErrorrr
rrr�	__enter__ sz_TempModule.__enter__cGs.|jr|jdtj|j<n
tj|j=g|_dS�Nr)rrrr�r�argsrrr�__exit__)s
z_TempModule.__exit__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrrs	rc@s$eZdZdd�Zdd�Zdd�ZdS)�_ModifiedArgv0cCs||_t�|_|_dSr)�value�object�_saved_value�	_sentinel)rr rrrr1sz_ModifiedArgv0.__init__cCs0|j|jk	rtd��tjd|_|jtjd<dS)NzAlready preserving saved valuer)r"r#�RuntimeErrorr�argvr )rrrrr5sz_ModifiedArgv0.__enter__cGs|j|_|jtjd<dSr)r#r r"rr%rrrrr;sz_ModifiedArgv0.__exit__N)rrrrrrrrrrr0src
	Csn|dk	r|�|�|dkr(d}|}d}	n |j}|j}|j}	|dkrH|j}|j|||	d|||d�t||�|S)z)Helper to run code in nominated namespaceN)r�__file__�
__cached__r�
__loader__�__package__�__spec__)�update�loader�origin�cached�parent�exec)
�codeZrun_globals�init_globalsr�mod_spec�pkg_name�script_namer,�fnamer.rrr�	_run_code@s*
�
r7c	
Cs^|dkr|n|j}t|��6}t|��"|jj}t|||||||�W5QRXW5QRX|��S)z5Helper to run code in new namespace with sys modifiedN)r-rrr�__dict__r7�copy)	r1r2rr3r4r5r6�temp_module�mod_globalsrrr�_run_module_codeZs�r<c
Cs2|�d�r|d��|�d�\}}}|r�zt|�WnHtk
rz}z*|jdksh|j|krj|�|jd�sj�W5d}~XYnXtj�|�}|dk	r�t|d�s�ddl	m
}dj||d�}|t|��zt
j�|�}WnJttttfk
�r}	z"d}||�|t|	�j|	��|	�W5d}	~	XYnX|dk�r2|d	|��|jdk	�r�|d
k�sT|�d��r\|d��z|d}
t|
|�WS|k
�r�}z"|tjk�r��|d
||f��W5d}~XYnX|j}|dk�r�|d|��z|�|�}Wn2tk
�r}z|t|��|�W5d}~XYnX|dk�r(|d|��|||fS)N�.z#Relative module names not supported�__path__r)�warnz�{mod_name!r} found in sys.modules after import of package {pkg_name!r}, but prior to execution of {mod_name!r}; this may result in unpredictable behaviour)rr4z:Error while finding module specification for {!r} ({}: {})zNo module named %s�__main__z	.__main__z%Cannot use package as __main__ modulez3%s; %r is a package and cannot be directly executedz0%r is a namespace package and cannot be executedzNo code object available for %s)�
startswith�
rpartition�
__import__�ImportError�namerr�get�hasattr�warningsr?�format�RuntimeWarning�	importlib�util�	find_spec�AttributeError�	TypeError�
ValueError�typer�submodule_search_locations�endswith�_get_module_detailsr,�get_code)
r�errorr4�_�eZexistingr?�msg�specZexZ
pkg_main_namer,r1rrrrThsd
��,
�
� 
rTc@seZdZdZdS)�_ErrorzBError that _run_module_as_main() should report without a tracebackN)rrrrrrrrr[�sr[Tc
Cs�z0|s|dkr t|t�\}}}ntt�\}}}Wn:tk
rj}zdtj|f}t�|�W5d}~XYnXtjdj}|r�|jtj	d<t
||dd|�S)a�Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __cached__
           __loader__
           __package__
    r@z%s: %sNr)rTr[�_get_main_module_detailsr�
executable�exitrr8r-r%r7)rZ
alter_argvr3r1�excrYZmain_globalsrrr�_run_module_as_main�s�r`FcCs@t|�\}}}|dkr|}|r,t||||�St|i|||�SdS)znExecute a module's code without importing it

       Returns the resulting top level namespace dictionary
    N)rTr<r7)rr2�run_nameZ	alter_sysr3r1rrrr�sc
Cs�d}tj|}tj|=z\zt|�WW�NStk
rn}z*|t|�kr\|d|tjdf�|��W5d}~XYnXW5|tj|<XdS)Nr@zcan't find %r module in %rr)rrrTrD�str�path)rVZ	main_nameZ
saved_mainr_rrrr\�s
��r\c	Csftj�t�|��}t�|��}t|�}W5QRX|dkr^t�|��}t|��|d�}W5QRX||fS)Nr0)	�osrc�abspath�fsdecode�io�	open_coder�compile�read)rar6Zdecoded_path�fr1rrr�_get_code_from_file�srlcCs$|dkrd}|�d�d}t|�}d}t|�jdkrFt|�jdkrFd}t|td��sX|rxt||�\}}t|||||d	�Stj	�
d|�znt
�\}}	}t|��P}
t|��<|
jj}t|||||	|���W5QR�W5QR�W�SQRXW5QRXW5ztj	�|�Wntk
�rYnXXdS)
a_Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    Nz
<run_path>r=rFZimpZNullImporterT)r4r5)rBrrQrr�
isinstancerlr<rrc�insert�removerPr\rrrr8r7r9)Z	path_namer2rar4ZimporterZis_NullImporterr1r6rr3r:r;rrrr�s<
�
��8r@�z!No module specified for execution)�file)NNNNN)NNNNN)T)NNF)NN)rr�importlib.machineryrK�importlib.utilrgr	rdZpkgutilrr�__all__r!rrr7r<rDrT�	Exceptionr[r`rr\rlrr�lenr%�print�stderrrrrr�<module>sN��
�
:
�

1
mailbox.cpython-38.opt-2.pyc000064400000150520151450073350011575 0ustar00U

e5dE3�@sNddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
Z
ddlZzddlZWne
k
r�dZYnXdddddddd	d
ddd
dddddgZej�d�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�dejj�ZGdd	�d	e�ZGd d!�d!e�ZGd"d
�d
e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�Z Gd&d'�d'�Z!Gd(d)�d)e!�Z"d<d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(Gd7d�de)�Z*Gd8d�de*�Z+Gd9d�de*�Z,Gd:d�de*�Z-Gd;d�de*�Z.dS)=�N�Mailbox�Maildir�mbox�MH�Babyl�MMDF�Message�MaildirMessage�mboxMessage�	MHMessage�BabylMessage�MMDFMessage�Error�NoSuchMailboxError�
NotEmptyError�ExternalClashError�FormatError�asciic@seZdZdBdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�ZdCdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�ZdDd/d0�Zd1d2�ZdEd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Z d?Z!dFd@dA�Z"dS)GrNTcCs tj�tj�|��|_||_dS�N)�os�path�abspath�
expanduser�_path�_factory��selfr�factory�create�r�/usr/lib64/python3.8/mailbox.py�__init__$szMailbox.__init__cCstd��dS�Nz&Method must be implemented by subclass��NotImplementedError�r�messagerrr �add)szMailbox.addcCstd��dSr"r#�r�keyrrr �remove-szMailbox.removecCs|�|�dSr)r*r(rrr �__delitem__1szMailbox.__delitem__cCs(z|�|�Wntk
r"YnXdSr)r*�KeyErrorr(rrr �discard4szMailbox.discardcCstd��dSr"r#�rr)r&rrr �__setitem__;szMailbox.__setitem__cCs*z|�|�WStk
r$|YSXdSr)�__getitem__r,)rr)�defaultrrr �get?szMailbox.getc
CsB|js|�|�St�|�|���}|�|�W5QR�SQRXdSr)r�get_message�
contextlib�closing�get_file)rr)�filerrr r0Fs
zMailbox.__getitem__cCstd��dSr"r#r(rrr r3NszMailbox.get_messagecCst�|�|����Sr��email�message_from_bytes�	get_bytesZ	as_stringr(rrr �
get_stringRszMailbox.get_stringcCstd��dSr"r#r(rrr r;YszMailbox.get_bytescCstd��dSr"r#r(rrr r6]szMailbox.get_filecCstd��dSr"r#�rrrr �iterkeysaszMailbox.iterkeyscCst|���Sr)�listr>r=rrr �keyseszMailbox.keysc	cs>|��D]0}z||}Wntk
r0YqYnX|VqdSr�r>r,�rr)�valuerrr �
itervaluesis
zMailbox.itervaluescCs|��Sr)rDr=rrr �__iter__rszMailbox.__iter__cCst|���Sr)r?rDr=rrr �valuesuszMailbox.valuesc	csB|��D]4}z||}Wntk
r0YqYnX||fVqdSrrArBrrr �	iteritemsys
zMailbox.iteritemscCst|���Sr)r?rGr=rrr �items�sz
Mailbox.itemscCstd��dSr"r#r(rrr �__contains__�szMailbox.__contains__cCstd��dSr"r#r=rrr �__len__�szMailbox.__len__cCs|��D]}|�|�qdSr)r@r-r(rrr �clear�sz
Mailbox.clearcCs4z||}Wntk
r$|YSX|�|�|Sr)r,r-)rr)r1�resultrrr �pop�s

zMailbox.popcCs*|��D]}||�|�fStd��dS)NzNo messages in mailbox)r>rMr,r(rrr �popitem�szMailbox.popitemc	Cstt|d�r|��}nt|d�r(|��}n|}d}|D].\}}z|||<Wq4tk
r`d}Yq4Xq4|rptd��dS)NrGrHFTzNo message with key(s))�hasattrrGrHr,)r�arg�sourceZbad_keyr)r&rrr �update�s



zMailbox.updatecCstd��dSr"r#r=rrr �flush�sz
Mailbox.flushcCstd��dSr"r#r=rrr �lock�szMailbox.lockcCstd��dSr"r#r=rrr �unlock�szMailbox.unlockcCstd��dSr"r#r=rrr �close�sz
Mailbox.closecCs.z|�d�WStk
r(td��YnXdS)Nrz?String input must be ASCII-only; use bytes or a Message instead)�encode�UnicodeError�
ValueErrorr%rrr �_string_to_bytes�szMailbox._string_to_bytesFc	Cs�t|tjj�rvt��}tj�||d�}|�|�|�	d�|�
�}|�dt�}|�
|�|jrr|�t�sr|�
t��n�t|tttjf��rt|tj�r�t�dtd�|��}t|t�r�|�|�}|r�|�dd�}|�dt�}|�
|�|j�r�|�t��s�|�
t�n�t|d��r�t|d��r2t�d	td�|j}d}|��}|�d
��r\|dd�d}n|�d��rx|dd
�d}|�s��q�|�r�|�d��r�d|dd�}|�dt�}|�
|�|}�q6|j�r�|�r�|�t��s�|�
t�ntdt|���dS)Nr�
�8Use of StringIO input is deprecated, use BytesIO instead�s
From s
>From �read�buffer�DUse of text mode files is deprecated, use a binary mode file instead�
����
����From s>From ��Invalid message type: %s)�
isinstancer9r&r�io�BytesIO�	generator�BytesGenerator�flatten�seekr^�replace�linesep�write�_append_newline�endswith�str�bytes�StringIO�warnings�warn�DeprecationWarning�getvaluerZrOr_�readline�
startswith�	TypeError�type)	rr&�targetZmangle_from_r_�gen�dataZlastline�linerrr �
_dump_message�s`


�


�
zMailbox._dump_message)NT)N)N)N)F)#�__name__�
__module__�__qualname__r!r'r*r+r-r/r2r0r3r<r;r6r>r@rDrErFrGrHrIrJrKrMrNrRrSrTrUrVrZrrr�rrrr r!s@

		
	
c@s�eZdZdZd5dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdS)6r�:NTcCs�t�||||�tj�|jd�tj�|jd�tj�|jd�d�|_tj�|j�s�|r�t�|jd�|j�	�D]}t�|d�qln
t
|j��i|_ddd�|_d|_
d|_dS)	N�tmp�new�cur)r�r�r��r)r�r�g�������?)rr!rr�joinr�_paths�exists�mkdirrFr�_toc�_toc_mtimes�
_last_read�_skewfactor)r�dirnamerrrrrr r!
s�
zMaildir.__init__c
Cs~|��}z|�||�Wn*tk
rB|��t�|j��YnXt|�t|t	�r||�
�}|j|��}||jkr�d}nd}d}tj
�|j��|j�d}tj
�|j|||�}t|t	�r�t�|jtj
�|j�|��f�zLzt�|j|�Wn(ttfk
�rt�|j|�YnXt�|j�WnNtk
�rx}z.t�|j�|jtjk�rftd|��n�W5d}~XYnX|S)N�r�rz$Name clash with existing message: %s)�_create_tmpr��
BaseExceptionrVrr*�name�_sync_closerhr	�
get_subdir�colon�get_infor�basename�splitr�r�utime�getatime�get_date�link�AttributeError�PermissionError�rename�OSError�errnoZEEXISTr)rr&Ztmp_file�subdir�suffix�uniq�dest�errr r'!sF


��zMaildir.addcCs t�tj�|j|�|���dSr)rr*rr�r�_lookupr(rrr r*KszMaildir.removec	Cs,z|�|�Wnttfk
r&YnXdSr)r*r,�FileNotFoundErrorr(rrr r-OszMaildir.discardcCs�|�|�}|�|�}|�|�}t|t�r.|}n|}tj�|�}|j|kr`|j|�|j�d}nd}|�	|�tj�
|j|�}	tj�
|j|||�}
t|t�r�t�|	tj�
|	�|��f�t�|	|
�dS)Nrdr�)r�r'rhr	rrr�r�r�r-r�rr�r�r�r�)rr)r&Zold_subpathZtemp_keyZtemp_subpathZdominant_subpathr�r�Ztmp_path�new_pathrrr r/Ws$






�zMaildir.__setitem__c	Cs�|�|�}ttj�|j|�d�� }|jr4|�|�}nt|�}W5QRXtj�|�\}}|�	|�|j
|kr�|�|�|j
�d�|�tj�
tj�|j|���|S)N�rbrd)r��openrrr�rrr	r��
set_subdirr��set_info�set_date�getmtime)rr)Zsubpath�f�msgr�r�rrr r3rs


zMaildir.get_messagec
CsDttj�|j|�|��d��}|���td�W5QR�SQRXdS)Nr�r[)	r�rrr�rr�r^rorp�rr)r�rrr r;�szMaildir.get_bytescCs$ttj�|j|�|��d�}t|�S)Nr�)r�rrr�rr��
_ProxyFiler�rrr r6�szMaildir.get_filec	csF|��|jD]2}z|�|�Wntk
r8YqYnX|VqdSr)�_refreshr�r�r,r(rrr r>�s

zMaildir.iterkeyscCs|��||jkSr)r�r�r(rrr rI�szMaildir.__contains__cCs|��t|j�Sr)r��lenr�r=rrr rJ�szMaildir.__len__cCsdSrrr=rrr rS�sz
Maildir.flushcCsdSrrr=rrr rT�szMaildir.lockcCsdSrrr=rrr rU�szMaildir.unlockcCsdSrrr=rrr rV�sz
Maildir.closecCs\g}t�|j�D]F}t|�dkr|ddkrtj�tj�|j|��r|�|dd��q|S)N�r�.)r�listdirrr�r�isdirr��append�rrL�entryrrr �list_folders�s�zMaildir.list_folderscCs ttj�|jd|�|jdd�S)Nr�F�rr)rrrr�rr�r�folderrrr �
get_folder�s�zMaildir.get_foldercCs\tj�|jd|�}t||jd�}tj�|d�}tj�|�sXt�t�|tj	tj
Bd��|S)Nr��rZ
maildirfolder�)rrr�rrrr�rVr��O_CREAT�O_WRONLY)rr�rrLZmaildirfolder_pathrrr �
add_folder�s�zMaildir.add_foldercCstj�|jd|�}t�tj�|d��t�tj�|d��D](}t|�dksX|ddkr<td|��q<t�|�D]B}|dkrp|dkrp|dkrptj�tj�||��rptd||f��qptj|d	d
�D]F\}}}|D]}t�	tj�||��q�|D]}t�
tj�||��q�q�t�
|�dS)Nr�r�r�r�rzFolder contains message(s): %sr�z%Folder contains subdirectory '%s': %sF)�topdown)rrr�rr�r�rr��walkr*�rmdir)rr�rr��root�dirs�filesrrr �
remove_folder�s&���zMaildir.remove_foldercCsXt��}t�tj�|jd��D]4}tj�|jd|�}|tj�|�dkrt�|�qdS)Nr�i@�)�timerr�rr�rr�r*)r�nowr�rrrr �clean�s
z
Maildir.cleanr�cCs�t��}t��}d|kr$|�dd�}d|kr8|�dd�}dt|�t|dd�t��tj|f}tj	�
|jd|�}zt�|�WnFt
k
r�tjd7_zt|�WYStk
r�YnXYnXtd	|��dS)
N�/z\057r�z\072z%s.M%sP%sQ%s.%sr�g��.Ar�z&Name clash prevented file creation: %s)r��socket�gethostnamero�intr�getpidr�_countrr�r�statr��_create_carefully�FileExistsErrorr)rr�Zhostnamer�rrrr r��s,��zMaildir._create_tmpcCs�t��|jd|jkr^d}|jD]2}tj�|j|�}||j|krJd}||j|<q"|s^dSi|_|jD]^}|j|}t�	|�D]D}tj�
||�}tj�|�r�q�|�|j
�d}tj�
||�|j|<q�qjt��|_dS)N�FTr)r�r�r�r�rrr�r�r�r�r�r�r�r�)rZrefreshr��mtimerr��pr�rrr r��s&


zMaildir._refreshcCs�z.tj�tj�|j|j|��r,|j|WSWntk
rBYnX|��z|j|WStk
rztd|�d�YnXdS�N�No message with key: %s)rrr�r�rr�r,r�r(rrr r�#szMaildir._lookupcCsXt|d�s|��|_z|t|j�WStk
r:YdStk
rPYqYqXqdS)N�
_onetime_keys)rOr>r��next�
StopIterationr,r=rrr r�1s

zMaildir.next)NT)r�r�r�r�r!r'r*r-r/r3r;r6r>rIrJrSrTrUrVr�r�r�r�r�r�r�r�r�r�rrrr rs4
*
	
$c@s�eZdZd#dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd$dd �Zd!d"�ZdS)%�_singlefileMailboxNTc
Cs�t�||||�zt|jd�}Wnntk
r�}zP|jtjkr\|rPt|jd�}q~t|j��n"|jtjtj	fkr|t|jd�}n�W5d}~XYnX||_
d|_d|_d|_
d|_d|_d|_dS)N�rb+zwb+r�rF)rr!r�rr�r��ENOENTr�EACCES�EROFS�_filer��	_next_key�_pending�
_pending_sync�_locked�_file_length)rrrrr�r�rrr r!As$z_singlefileMailbox.__init__cCs8|��|�|�|j|j<|jd7_d|_|jdS)Nr�T)r��_append_messager�r�r�r%rrr r'Xs
z_singlefileMailbox.addcCs|�|�|j|=d|_dS�NT)r�r�r�r(rrr r*bs
z_singlefileMailbox.removecCs$|�|�|�|�|j|<d|_dSr�)r�r�r�r�r.rrr r/hs
z_singlefileMailbox.__setitem__ccs|��|j��EdHdSr)r�r�r@r=rrr r>nsz_singlefileMailbox.iterkeyscCs|��||jkSr)r�r�r(rrr rIssz_singlefileMailbox.__contains__cCs|��t|j�Sr)r�r�r�r=rrr rJxsz_singlefileMailbox.__len__cCs|jst|j�d|_dSr�)r��
_lock_filer�r=rrr rT}s
z_singlefileMailbox.lockcCs|jrt|j�d|_dS�NF)r��_unlock_filer�r=rrr rU�s
z_singlefileMailbox.unlockc
Cs�|js |jrt|j�d|_dS|j�dd�|j��}||jkrTtd|j|f��t|j	�}z�i}|�
|�t|j�
��D]x}|j|\}}|j�|�|�|�|��}|j�td||j����}|s�q�|�|�q�||��f||<|�|�q||��|_Wn"|��t�|j��YnXt|�|j��t�|j	�j}	t�|j|	�zt�|j|j	�Wn2tk
�r�t�|j	�t�|j|j	�YnXt|j	d�|_||_d|_d|_|j�r�t|jdd�dS)NFrr�z4Size of mailbox file changed (expected %i, found %i)�r�)�dotlock) r�r��_sync_flushr�rn�tellr�r�_create_temporaryr�_pre_mailbox_hook�sortedr�r@�_pre_message_hookr^�minrq�_post_message_hookrVrr*r�r�r��st_mode�chmodr�r�r�r�r�)
rZcur_lenZnew_fileZnew_tocr)�start�stopZ	new_startr_�moderrr rS�s`
	

�



�
z_singlefileMailbox.flushcCsdSrr�rr�rrr r��sz$_singlefileMailbox._pre_mailbox_hookcCsdSrrrrrr r��sz$_singlefileMailbox._pre_message_hookcCsdSrrrrrr r�sz%_singlefileMailbox._post_message_hookcCs4z|��W5z|jr|��W5|j��XXdSr)r�rVr�rUrSr=rrr rV�sz_singlefileMailbox.closecCsN|jdkr|��|dk	rJz|j|WStk
rHtd|�d�YnXdSr�)r��
_generate_tocr,r(rrr r��s
z_singlefileMailbox._lookupcCs�|j�dd�|j��}t|j�dkr8|js8|�|j�z&|�|j�|�|�}|�	|j�Wn"t
k
r�|j�|��YnX|j��|j��|_
|S)Nrr�)r�rnr�r�r�r�r�r��_install_messagerr��truncaterSr�)rr&ZbeforeZoffsetsrrr r��s


z"_singlefileMailbox._append_message)NT)N)r�r�r�r!r'r*r/r>rIrJrTrUrSr�r�rrVr�r�rrrr r�>s 

@

r�c@s>eZdZdZdd�Zddd�Zddd�Zdd	d
�Zdd�Zd
S)�	_mboxMMDFTcCsp|�|�\}}|j�|�|j���td�}|j�||j���}|�|�td��}|�	|dd��
d��|S)N�r[rfr)r�r�rnr{rorpr^r��_message_factory�set_from�decode)rr)rr�	from_line�stringr�rrr r3sz_mboxMMDF.get_messageFcCst�|�||��j|d�S)N)�unixfromr8)rr)�from_rrr r<s

��z_mboxMMDF.get_stringcCsJ|�|�\}}|j�|�|s(|j��|j�||j���}|�td�S�Nr[)r�r�rnr{r^r�rorp)rr)rrrrrrr r;s
z_mboxMMDF.get_bytescCs<|�|�\}}|j�|�|s(|j��t|j|j��|�Sr)r�r�rnr{�_PartialFiler�)rr)rrrrrr r6s

z_mboxMMDF.get_filecCsd}t|t�r|�|�}t|t�rf|�d�rf|�d�}|dkr\|d|�}||dd�}q�|}d}nJt|t�r�|���d�}d|}n(t|t	j
j�r�|��}|dk	r�|�d�}|dkr�dt
�t
�����}|j��}|j�|t�|�||j|j�|j��}||fS)Nrer[rdr�rrsFrom MAILER-DAEMON )rhrtrZrur|�find�_mboxMMDFMessage�get_fromrWr9r&r�get_unixfromr��asctime�gmtimer�r�rqrpr��
_mangle_from_)rr&r�newlineZauthorrrrrr r	&s0







z_mboxMMDF._install_messageN)F)F)F)	r�r�r�rr3r<r;r6r	rrrr rs


	
rc@s.eZdZdZdZd	dd�Zdd�Zdd�ZdS)
rTNcCst|_t�||||�dSr)r
r
rr!rrrr r!Lsz
mbox.__init__cCs|�t�dSr�rqrprrrr rQszmbox._post_message_hookcCs�gg}}d}|j�d�|j��}|j��}|�d�rzt|�t|�krj|r`|�|tt��n
|�|�|�|�d}q|s�|r�|�|tt��q�|�|�q�q|tkr�d}qd}qtt	t
||���|_t|j�|_|j��|_
dS)NFrreT)r�rnr�r{r|r�r�rp�dict�	enumerate�zipr�r�r�)r�starts�stopsZlast_was_empty�line_posr�rrr rUs.






zmbox._generate_toc)NT)r�r�r�rrrr!rrrrrr rCs

c@s.eZdZddd�Zdd�Zdd�Zd	d
�ZdS)rNTcCst|_t�||||�dSr)r
r
rr!rrrr r!zsz
MMDF.__init__cCs|�dt�dS�N�rrrrr r�szMMDF._pre_message_hookcCs|�tdt�dSr%rrrrr r�szMMDF._post_message_hookcCs�gg}}|j�d�d}|}|j��}|j��}|�dt�r�|�|�|}|j��}|j��}|dtkr�|�|tt��q�qJ|sJ|�|�q�qJq|sq�qtt	t
||���|_t|j�|_|j�dd�|j��|_
dS)Nrr&r�)r�rnr{r�r|rpr�r�rr r!r�r�r�)rr"r#�next_posr$r�rrr r�s.






zMMDF._generate_toc)NT)r�r�r�r!r�rrrrrr rws
c@s�eZdZd/dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�ZdS)0rNTcCstt�||||�tj�|j�sj|r`t�|jd�t�t�tj�	|jd�tj
tjBtjBd��n
t
|j��d|_dS)Nr��
.mh_sequencesi�F)rr!rrr�rr�rVr�r�r��O_EXCLr�rr�rrrr r!�s�
zMH.__init__cCs�|��}t|�dkrd}nt|�d}tj�|jt|��}t|�}d}z�|j
rVt|�zfz|�
||�Wn:tk
r�|j
r�t|�t	|�d}t�|��YnXt|t�r�|�||�W5|j
r�t|�XW5|s�t	|�X|S)Nrr�FT)r@r��maxrrr�rrtr�r�r�r�r�r�r�r*rhr�_dump_sequences)rr&r@Znew_keyr�r��closedrrr r'�s6


zMH.addc
Csxtj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnX|�
�t�|�dS�Nr�r�)rrr�rrtr�r�r�r�r,rVr*)rr)rr�r�rrr r*�sz	MH.removec
Cs�tj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnXzd|jrrt|�z@t�t�|tjtjB��|�||�t|t�r�|�||�W5|jr�t
|�XW5t
|�XdSr-)rrr�rrtr�r�r�r�r,r�r�r�r�rVr��O_TRUNCr�rhrr+)rr)r&rr�r�rrr r/�s$
zMH.__setitem__c
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�2|jr�t|�zt
|�}W5|jr�t|�XW5QRX|����D]\}}||kr�|�|�q�|S)Nr�r�r�)r�r�rrr�rrtr�r�r�r,r�r�r�
get_sequencesrH�add_sequence)rr)r�r�r�r��key_listrrr r3�s&zMH.get_messagec
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�F|jr�t|�z |�
��td�W�W5QR�S|jr�t|�XW5QRXdS)Nr�r�r�r[)r�r�rrr�rrtr�r�r�r,r�r�r^rorp�rr)r�r�rrr r;s zMH.get_bytesc
Csfzttj�|jt|��d�}Wn>tk
r\}z |jtjkrJt	d|��n�W5d}~XYnXt
|�S)Nr�r�)r�rrr�rrtr�r�r�r,r�r2rrr r6)szMH.get_filecCsttdd�t�|j�D���S)Ncss|]}|��rt|�VqdSr)�isdigitr�)�.0r�rrr �	<genexpr>6s�zMH.iterkeys.<locals>.<genexpr>)�iterr�rr�rr=rrr r>4szMH.iterkeyscCstj�tj�|jt|���Sr)rrr�r�rrtr(rrr rI9szMH.__contains__cCstt|����Sr)r�r?r>r=rrr rJ=sz
MH.__len__cCs2|js.ttj�|jd�d�|_t|j�d|_dS)Nr(r�T)r�r�rrr�rr�r�r=rrr rTAs
zMH.lockcCs(|jr$t|j�t|j�|`d|_dSr�)r�r�r�r�r=rrr rUHs


z	MH.unlockcCsdSrrr=rrr rSPszMH.flushcCs|jr|��dSr)r�rUr=rrr rVTszMH.closecCs<g}t�|j�D]&}tj�tj�|j|��r|�|�q|Sr)rr�rrr�r�r�r�rrr r�Ys
zMH.list_folderscCsttj�|j|�|jdd�S)NFr��rrrr�rrr�rrr r�as�z
MH.get_foldercCsttj�|j|�|jd�S)Nr�r7r�rrr r�fs�z
MH.add_foldercCs`tj�|j|�}t�|�}|dgkr:t�tj�|d��n|gkrDntd|j��t�|�dS)Nr(zFolder not empty: %s)rrr�rr�r*rr�)rr�r�entriesrrr r�ks

zMH.remove_folderc

si}ttj�|jd�ddd���}t|����|D]�}z�|�d�\}}t�}|��D]H}|��rn|�	t
|��qRdd�|�d�D�\}}	|�t||	d	��qR�fd
d�t
|�D�||<t||�dkr�||=Wq0tk
r�td
|����Yq0Xq0W5QRX|S)Nr(�r�ASCII��encodingr�css|]}t|�VqdSr)r�)r4�xrrr r5�sz#MH.get_sequences.<locals>.<genexpr>�-r�csg|]}|�kr|�qSrr)r4r)�Zall_keysrr �
<listcomp>�s�z$MH.get_sequences.<locals>.<listcomp>rz"Invalid sequence specification: %s)r�rrr�r�setr@r�r3r'r�rR�ranger�r�rYr�rstrip)
rZresultsr�r�r��contentsr@�specrrrr?r r/ws(
�zMH.get_sequencescCsttj�|jd�ddd�}z�t�t�|jtjtj	B��|�
�D]�\}}t|�dkrVq@|�|d�d}d}t
t|��D]R}|d|kr�|s�d	}|�d
�n*|r�d}|�d||f�n|�d|�|}qx|r�|�t|�d
�q@|�d
�q@W5t|�XdS)Nr(zr+r:r;rr�Fr�Tr>z%s %sz %s�
)r�rrr�rr�rVr�r�r.rHr�rqr�rArt)r�	sequencesr�r�r@�prevZ
completingr)rrr �
set_sequences�s.zMH.set_sequencesc	
Cs>|��}d}g}|��D]�}|d|kr�|�||df�z4t�tj�|jt|��tj�|jt|d���WnHt	t
fk
r�t�tj�|jt|��tj�|jt|d���YnXt�tj�|jt|���|d7}q|d|_
t|�dkr�dS|��D]0\}}|D]"\}}||k�r
|||�|�<�q
q�|�|�dS)Nrr�)r/r>r�rr�rr�rrtr�r�r��unlinkr�r�rH�indexrI)	rrGrHZchangesr)r�r1�oldr�rrr �pack�s0��



zMH.packcCst|��}|��}|��D]0\}}||kr4|�|�q||kr||�|�=q|D]}||krN|g||<qN|�|�dSr)r/rHr�rKrI)rr&r)Zpending_sequencesZ
all_sequencesr�r1�sequencerrr r+�szMH._dump_sequences)NT)r�r�r�r!r'r*r/r3r;r6r>rIrJrTrUrSrVr�r�r�r�r/rIrMr+rrrr r�s,
"c@s�eZdZedddddddh�Zd$d
d�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd d!�Zd"d#�ZdS)%r�unseen�deletedZfiled�answered�	forwardedZedited�resentNTcCst�||||�i|_dSr)r�r!�_labelsrrrr r!�szBabyl.__init__cCs(t�||�}t|t�r$|��|j|<|Sr)r�r'rhr�
get_labelsrT)rr&r)rrr r'�s
z	Babyl.addcCs"t�||�||jkr|j|=dSr)r�r*rTr(rrr r*�s
zBabyl.removecCs*t�|||�t|t�r&|��|j|<dSr)r�r/rhrrUrTr.rrr r/�s
zBabyl.__setitem__c
Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,t��}|j��}|tks�|s|q�|�|�td��qd||j�	�}|j�
|�}|�td�}t|��|�}	|	�
|���||jkr�|	�|j|�|	S�N�*** EOOH ***r[)r�r�rnr{rirjrprqror�r^rrz�set_visiblerT�
set_labels)
rr)rr�original_headersr�Zvisible_headers�nZbodyr�rrr r3�s*



zBabyl.get_messagec	Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,|j��}|tksv|s\qvq\|�	�}||j�
�}|j�|�}|�td�}||SrV)r�r�rnr{rirjrprqrorzr�r^)	rr)rrrZr�Zheadersr[r�rrr r;s 


zBabyl.get_bytescCst�|�|��dt��Sr)rirjr;rorpr(rrr r6%szBabyl.get_filecCs<|��t�}|j��D]}|�|�q|�|j�t|�Sr)r�rArTrFrR�difference_update�_special_labelsr?)r�labelsZ
label_listrrr rU)szBabyl.get_labelscCs:gg}}|j�d�d}g}|}|j��}|j��}|dtkr�t|�t|�krd|�|tt��|�|�dd�|j��dd��d�D�}|�|�q|dks�|dtkr�t|�t|�kr�|�|tt��q|s|�|tt��q�qtt	t
||���|_tt	|��|_t|j�|_
|j�dd�|j��|_dS)	NrscSsg|]}|��r|���qSr)�strip�r4�labelrrr r@@s�z'Babyl._generate_toc.<locals>.<listcomp>r��,�r�)r�rnr{r�rpr�r�r�rr r!r�rTr�r�)rr"r#r'Zlabel_listsr$r�r^rrr r2s4



�zBabyl._generate_toccCsVdt}|dt7}|��}dd�|D�}|dd�|�t7}|d7}|�|�dS)NsBABYL OPTIONS:s
Version: 5css|]}|��VqdSr)rWr`rrr r5Usz*Babyl._pre_mailbox_hook.<locals>.<genexpr>sLabels:rbrc)rprUr�rq)rr�Zbabylr^rrr r�PszBabyl._pre_mailbox_hookcCs|�dt�dS)N�rrrrr r�ZszBabyl._pre_message_hookcCs|�td�dS)Nrcrrrrr r^szBabyl._post_message_hookcCsx|j��}t|t�r�g}g}|��D]$}||jkr>|�|�q$|�|�q$|j�d�|D]}|j�d|���qZ|j�d�|D]}|j�d|��d�q�|j�t	�n|j�dt	�t|t
jj��rt
��}t
j�|dd�}|�|�|�d�|��}|j�|�d	t	��|d	k�s,|s��q,q�|j�d
t	�t|t��r�t
��}	t
j�|	dd�}
|
�|���|	��}|j�|�d	t	��|d	k�s�|�sn�q�qnn>|�d�|��}|j�|�d	t	��|d	k�s�|�s��q�q�|�d�}|�s��qf|j�|�d	t	���q�nTt|ttt
jf��rt|t
j��rJt�dtd
�|��}t|t��r`|�|�}|�d�d}|ddk�r�|j�|d|��d	t	��|j�d
t	�|j�|d|��d	t	��|j�||d��d	t	��n(|j�d
t	t	�|j�|�d	t	���nXt |d��rVt |d��r:t�dtd
�|j!}|��}
d}|��}|�"d��rl|dd�d	}n|�"d��r�|dd�d	}|j�|�d	t	��|d	k�s�|�sF|�r�d}|j�d
t	�|�|
�n�qڐqF|��}|�s�qf|�"d��r
|dd�t	}n:|�"d��r(|dd�t	}n|�"d	��rD|dd�t	}|j�|��q�nt#dt$|���|j��}||fS)N�1s, s,,� rbs1,,Frr[rWr�r\r]s

r�rdr{r_r`Trarbrcrg)%r�r�rhrrUr]r�rqrWrpr9r&rrirjrkrlrmrnr{ro�get_visibler^rurtrvrwrxryrzrZrrOr_rsr}r~)rr&rZspecial_labelsr^raZorig_bufferZorig_generatorr�Z
vis_bufferZ
vis_generatorr_Z
body_startZoriginal_posZ
first_passrrrr r	bs�







�
�
zBabyl._install_message)NT)r�r�r��	frozensetr]r!r'r*r/r3r;r6rUrr�r�rr	rrrr r�s$
�
	
c@s&eZdZddd�Zdd�Zdd�ZdS)	rNcCs�t|tjj�r4|�t�|��t|t�r�|�|�n�t|t�rP|�t�	|��n~t|t
�rl|�t�|��nbt|tj
�r�|�t�|��nDt|d�r�|�t�|��n(|dkr�tjj�|�ntdt|���dS)Nr^rg)rhr9r&r�_become_message�copyZdeepcopy�_explain_torur:rtZmessage_from_stringri�
TextIOWrapperZmessage_from_filerOZmessage_from_binary_filer!r}r~r%rrr r!�s



zMessage.__init__cCs4t|dg�}|jD]}||kr|j||j|<qdS)N�_type_specific_attributes)�getattr�__dict__)rr&Z
type_specificr�rrr ri�s
zMessage._become_messagecCst|t�rdStd��dS)Nz Cannot convert to specified type)rhrr}r%rrr rk�s
zMessage._explain_to)N)r�r�r�r!rirkrrrr r�s
c@sxeZdZdddgZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)r	�_subdir�_info�_dateNcCs&d|_d|_t��|_t�||�dS)Nr�r�)rprqr�rrrr!r%rrr r!�s
zMaildirMessage.__init__cCs|jSr)rpr=rrr r��szMaildirMessage.get_subdircCs(|dks|dkr||_ntd|��dS)Nr�r�z!subdir must be 'new' or 'cur': %s)rprY)rr�rrr r�szMaildirMessage.set_subdircCs"|j�d�r|jdd�SdSdS)N�2,r�r�)rqr|r=rrr �	get_flags
szMaildirMessage.get_flagscCsdd�t|��|_dS)Nrsr�)r�r�rq)r�flagsrrr �	set_flagsszMaildirMessage.set_flagscCs$|�d�t|���t|�B��dS�Nr��rvr�rArt�r�flagrrr �add_flagszMaildirMessage.add_flagcCs,|��r(|�d�t|���t|���dSrw)rtrvr�rAryrrr �remove_flagszMaildirMessage.remove_flagcCs|jSr)rrr=rrr r�szMaildirMessage.get_datecCs6zt|�|_Wn"tk
r0td|�d�YnXdS)Nzcan't convert to float: %s)�floatrrrYr})r�daterrr r�"szMaildirMessage.set_datecCs|jSr)rqr=rrr r�)szMaildirMessage.get_infocCs&t|t�r||_ntdt|���dS)Nzinfo must be a string: %s)rhrtrqr}r~)r�inforrr r�-s
zMaildirMessage.set_infocCs�t|t�r8|�|���|�|���|�|����nht|t�r�t	|���}d|kr`|�
d�|��dkrv|�
d�d|kr�|�
d�d|kr�|�
d�d|kr�|�
d�|�d	t�
|����n�t|t��rt	|���}d|kr�|�d
�d|k�r|�d�d|k�r�|�d�n�t|t��r�t	|���}d|k�rD|�d
�d|k�rX|�d
�d|k�rl|�d�d|k�r�|�d�nt|t��r�ntdt|���dS)N�S�Rr��O�T�D�F�A�
MAILER-DAEMONrO�replied�flaggedrPrQ�PrR�$Cannot convert to specified type: %s)rhr	rvrtr�r�r�r�rrAr{rr�rrr0r�	add_labelrr}r~)rr&rurrr rk4sP

















�zMaildirMessage._explain_to)N)r�r�r�rmr!r�r�rtrvr{r|r�r�r�r�rkrrrr r	�s

c@sVeZdZdgZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)r�_fromNcCsV|�dd�t|tjj�rF|��}|dk	rF|�d�rF|�|dd��t�||�dS)Nr�TzFrom rf)rrhr9r&rrr|r!)rr&rrrr r!esz_mboxMMDFMessage.__init__cCs|jSr)r�r=rrr rnsz_mboxMMDFMessage.get_fromcCs4|dk	r*|dkrt��}|dt�|�7}||_dS)NT� )r�rrr�)rrZtime_rrr rrs
z_mboxMMDFMessage.set_fromcCs|�dd�|�dd�S)N�Statusr��X-Status)r2r=rrr rtzsz_mboxMMDFMessage.get_flagscCs�t|�}d\}}dD]}||kr||7}|�|�qdD]}||kr8||7}|�|�q8|d�t|��7}z|�d|�Wn tk
r�|�d|�YnXz|�d|�Wn tk
r�|�d|�YnXdS)N)r�r�)r�r�)r�r�r�r�r�r�)rAr*r�r��replace_headerr,Z
add_header)rruZstatus_flagsZ
xstatus_flagsrzrrr rv~s&z_mboxMMDFMessage.set_flagscCs$|�d�t|���t|�B��dSrwrxryrrr r{�sz_mboxMMDFMessage.add_flagcCs4d|ksd|kr0|�d�t|���t|���dS)Nr�r�r�rxryrrr r|�sz_mboxMMDFMessage.remove_flagc	Cs�t|t�r�t|���}d|kr(|�d�d|kr:|�d�d|krL|�d�d|kr^|�d�d|krp|�d�|d	=|d
=d�|����dd��}z|�	t
�t�
|d
���Wnttfk
r�YnX�n
t|t�r�|�|���|�|���n�t|t��rZt|���}d|k�r$|�d�d|k�r8|�d�d|k�rL|�d�|d	=|d
=n�t|t��r�t|���}d|k�r�|�d�d|k�r�|�d�d|k�r�|�d�|d	=|d
=nt|t��r�ntdt|���dS)Nr�r�r�r�r�r�r�r�Zstatuszx-statusr����z%a %b %d %H:%M:%S %YrOr�r�rPrQr�)rhr	rArtr�r{r�rr�r��calendarZtimegmr��strptimerY�
OverflowErrorrrvrrr0rr�rr}r~)rr&ruZ
maybe_daterrr rk�sb





�













�z_mboxMMDFMessage._explain_to)N)N)r�r�r�rmr!rrrtrvr{r|rkrrrr r`s
	
rc@seZdZdS)r
N�r�r�r�rrrr r
�sc@sDeZdZdgZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)r�
_sequencesNcCsg|_t�||�dSr)r�rr!r%rrr r!�szMHMessage.__init__cCs|jdd�Sr)r�r=rrr r/�szMHMessage.get_sequencescCst|�|_dSr)r?r�)rrGrrr rI�szMHMessage.set_sequencescCs6t|t�r"||jkr2|j�|�ntdt|���dS)Nzsequence type must be str: %s)rhrtr�r�r}r~�rrNrrr r0�s

zMHMessage.add_sequencecCs*z|j�|�Wntk
r$YnXdSr)r�r*rYr�rrr �remove_sequence�szMHMessage.remove_sequencecCsFt|t�rdt|���}d|kr*|�d�n|�d�|�d�d|krP|�d�d|krb|�d�n�t|t�r�t|���}d|kr�|�d�n
|�d	�d|kr�|�d�d|kr�|�d
�n�t|t�r�|��D]}|�|�q�n`t|t	��r$t|���}d|k�r|�
d�d|k�rB|�
d�nt|t��r2ntdt
|���dS)
NrOr�r�r�r�r�r��ROr�r�rQr�)rhr	rAr/r�r{rrr0rr�rr}r~)rr&rGrNrrr rk�sB










�zMHMessage._explain_to)N)
r�r�r�rmr!r/rIr0r�rkrrrr r�s
c@s^eZdZddgZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)rrT�_visibleNcCsg|_t�|_t�||�dSr)rTrr�r!r%rrr r!"szBabylMessage.__init__cCs|jdd�Sr)rTr=rrr rU(szBabylMessage.get_labelscCst|�|_dSr)r?rT)rr^rrr rY,szBabylMessage.set_labelscCs6t|t�r"||jkr2|j�|�ntdt|���dS)Nzlabel must be a string: %s)rhrtrTr�r}r~�rrarrr r�0s

zBabylMessage.add_labelcCs*z|j�|�Wntk
r$YnXdSr)rTr*rYr�rrr �remove_label8szBabylMessage.remove_labelcCs
t|j�Sr�rr�r=rrr rg?szBabylMessage.get_visiblecCst|�|_dSrr�)rZvisiblerrr rXCszBabylMessage.set_visiblecCsb|j��D](}||kr*|j�|||�q
|j|=q
dD]$}||kr8||jkr8|||j|<q8dS)N)ZDateZFromzReply-ToZToZCCZSubject)r�r@r�)r�headerrrr �update_visibleGs
zBabylMessage.update_visiblecCsrt|t�r~t|���}d|kr*|�d�n|�d�|�d�d|ksNd|krX|�d�d|krj|�d�d	|kr||�d
�n�t|t�r�t|���}d|kr�|�d�n
|�d�d	|kr�|�d
�d|kr�|�d�n�t|t��rt|���}d|k�r|�d�d|k�rn|�d�nTt|t	��rP|�
|���|��D]}|�|��q<nt|t
��r^ntdt|���dS)NrOr�r�rRrSr�rQr�rPr�r�r�r�r�r�r�)rhr	rArUr�r{rrr0rrXrgr�rr}r~)rr&r^rarrr rkRsH










�zBabylMessage._explain_to)N)
r�r�r�rmr!rUrYr�r�rgrXr�rkrrrr rs
c@seZdZdS)r
Nr�rrrr r
|sc@s�eZdZd%dd�Zd&dd�Zd'dd�Zd(dd	�Zd)d
d�Zdd
�Zdd�Z	d*dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zed#d$��ZdS)+r�NcCs$||_|dkr|��|_n||_dSr)r�r��_pos)rr��posrrr r!�sz_ProxyFile.__init__cCs|�||jj�Sr)�_readr�r^�r�sizerrr r^�sz_ProxyFile.readcCs|�||jj�Sr)r�r��read1r�rrr r��sz_ProxyFile.read1cCs|�||jj�Sr)r�r�r{r�rrr r{�sz_ProxyFile.readlinecCs<g}|D].}|�|�|dk	r|t|�8}|dkrq8q|S)Nr)r�r�)r�sizehintrLr�rrr �	readlines�s
z_ProxyFile.readlinesccs|��}|sdS|VqdSr)r{)rr�rrr rE�sz_ProxyFile.__iter__cCs|jSr)r�r=rrr r��sz_ProxyFile.tellrcCs4|dkr|j�|j�|j�||�|j��|_dS)Nr��r�rnr�r��r�offset�whencerrr rn�sz_ProxyFile.seekcCs0t|d�r,zt|jd�r"|j��W5|`XdS)Nr�rV)rOr�rVr=rrr rV�s

z_ProxyFile.closecCs2|dkrd}|j�|j�||�}|j��|_|S)Nrdr�)rr��read_methodrLrrr r��sz_ProxyFile._readcCs|Srrr=rrr �	__enter__�sz_ProxyFile.__enter__cGs|��dSr)rV)r�excrrr �__exit__�sz_ProxyFile.__exit__cCs
|j��Sr)r��readabler=rrr r��sz_ProxyFile.readablecCs
|j��Sr)r��writabler=rrr r��sz_ProxyFile.writablecCs
|j��Sr)r��seekabler=rrr r��sz_ProxyFile.seekablecCs
|j��Sr)r�rSr=rrr rS�sz_ProxyFile.flushcCs&t|d�sdSt|jd�sdS|jjS)Nr�Tr,F)rOr�r,r=rrr r,�s

z_ProxyFile.closed)N)N)N)N)N)r)r�r�r�r!r^r�r{r�rEr�rnrVr�r�r�r�r�r�rS�propertyr,rrrr r��s$





		r�c@s8eZdZd
dd�Zdd�Zddd�Zd	d
�Zdd�ZdS)rNcCst�|||�||_||_dSr)r�r!�_start�_stop)rr�rrrrr r!�sz_PartialFile.__init__cCst�|�|jSr)r�r�r�r=rrr r��sz_PartialFile.tellrcCs<|dkr|j|_d}n|dkr*|j|_d}t�|||�dS)Nrr�r�)r�r�r�r�rnr�rrr rn�sz_PartialFile.seekcCsB|j|j}|dkrdS|dks0|dks0||kr4|}t�|||�S)Nrr)r�r�r�r�)rr�r�Z	remainingrrr r��sz_PartialFile._readcCst|d�r|`dS)Nr�)rOr�r=rrr rVs
z_PartialFile.close)NN)r)r�r�r�r!r�rnr�rVrrrr r�s



	rTc
Cs�d}�zbtrpzt�|tjtjB�WnJtk
rn}z,|jtjtjtjfkr\t	d|j
��n�W5d}~XYnX|�rfzt|j
d�}|��WnBtk
r�}z$|jtjtjfkr�WY�WdS�W5d}~XYnXz`zt
�|j
|j
d�d}Wn2ttfk
�r$t
�|j
|j
d�d}YnXt
�|j
�Wn0tk
�rdt
�|j
�t	d|j
��YnXWn8t�r�t�|tj�|�r�t
�|j
d��YnXdS)NFzlockf: lock unavailable: %s�.lockTzdot lock unavailable: %s)�fcntl�lockfZLOCK_EXZLOCK_NBr�r�ZEAGAINr�r�rr�r�rVrr�r�r�r�rJr�r*�LOCK_UN)r�r�Zdotlock_doner�Zpre_lockrrr r�
sL�
�r�cCs8trt�|tj�tj�|jd�r4t�|jd�dS)Nr�)r�r�r�rrr�r�r*�r�rrr r�4sr�c	Cs<t�|tjtjBtjBd�}zt|d�W�St�|�XdS)Nr�r�)rr�r�r)�O_RDWRrV)r�fdrrr r�;sr�cCs$td|tt���t��t��f�S)Nz%s.%s.%s.%s)r�r�r�r�r�rr�)rrrr r�Cs�r�cCs$|��ttd�r t�|���dS)N�fsync)rSrOrr��filenor�rrr r�Is
r�cCst|�|��dSr)r�rVr�rrr r�Osr�c@seZdZdS)rNr�rrrr rUsc@seZdZdS)rNr�rrrr rXsc@seZdZdS)rNr�rrrr r[sc@seZdZdS)rNr�rrrr r^sc@seZdZdS)rNr�rrrr ras)T)/rr�r�r�r�rjrwr9Z
email.messageZemail.generatorrir4r��ImportError�__all__rprWrrr�rrrrrr&rr	rr
rrr
r�rr�r�r�r�r�r��	Exceptionrrrrrrrrr �<module>	s�
�h8DB4-3z%mqH_c'
*trace.cpython-38.opt-2.pyc000064400000041212151450073350011235 0ustar00U

e5d�t�@s�ddgZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
ZddlZdZGdd�d�Zdd	�Zd
d�ZGdd�d�Zd
d�Zdd�Zddd�Zdd�ZGdd�d�Zdd�Zedkr�e�dS)�Trace�CoverageResults�N)�	monotonicz#pragma NO COVERc@seZdZddd�Zdd�ZdS)�_IgnoreNcCs:|s
t�nt|�|_|sgndd�|D�|_ddi|_dS)NcSsg|]}tj�|��qS�)�os�path�normpath��.0�drr�/usr/lib64/python3.8/trace.py�
<listcomp>Hs�z$_Ignore.__init__.<locals>.<listcomp>z<string>�)�set�_mods�_dirs�_ignore)�self�modules�dirsrrr
�__init__Fs
�z_Ignore.__init__cCs�||jkr|j|S||jkr,d|j|<dS|jD]"}|�|d�r2d|j|<dSq2|dkrld|j|<dS|jD]$}|�|tj�rrd|j|<dSqrd|j|<dS)Nr�.r)rr�
startswithrr�sep)r�filename�
modulename�modrrrr
�namesLs$









z
_Ignore.names)NN)�__name__�
__module__�__qualname__rrrrrr
rEs
rcCs tj�|�}tj�|�\}}|S�N)rr�basename�splitext)r�baser�extrrr
�_modnamewsr'cCs�tj�|�}d}tjD]@}tj�|�}|�|�r|t|�tjkrt|�t|�kr|}q|rr|t|�dd�}n|}tj�|�\}}|�tjd�}tj	r�|�tj	d�}tj�
|�\}}|�d�S)N�rr)rr�normcase�sysr�lenr�
splitdrive�replace�altsepr$�lstrip)rZcomparepathZlongest�dirr%Zdriverr&rrr
�_fullmodname~s 
r1c@s:eZdZddd�Zdd�Zdd�Zdd
d�Zddd
�ZdS)rNc
Cs�||_|jdkri|_|j��|_||_|jdkr8i|_|j��|_||_|jdkrZi|_|j��|_||_||_|jr�z@t|jd��}t�	|�\}}}W5QRX|�
|�|||��Wn@tt
tfk
r�}ztd|j|ftjd�W5d}~XYnXdS)N�rbzSkipping counts file %r: %s��file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update�	__class__�OSError�EOFError�
ValueError�printr*�stderr)rr5r7r9r8r:�f�errrrr
r�s2


��zCoverageResults.__init__cCs|�d�o|�d�S)N�<�>)r�endswith)rrrrr
�is_ignored_filename�sz#CoverageResults.is_ignored_filenamec	Csn|j}|j}|j}|j}|j}|j}|D]}|�|d�||||<q(|D]}d||<qJ|D]}d||<q\dS�Nrr)r5r7r8�get)	r�otherr5r7r8Zother_countsZother_calledfuncsZ
other_callers�keyrrr
r>�s
zCoverageResults.updateTFc"
Cs�|jr@t�td�|j}t|�D]\}}}td|||f�q"|jr�t�td�d}}	t|j�D]h\\}
}}\}
}}|
|kr�t�td|
d�|
}d}	|
|
kr�|	|
kr�td|
�|
}	td||||f�qfi}|jD].\}}|�|i�}||<|j||f||<q�i}|��D�]\}}|�|��r0�q|�d��rH|dd	�}|dk�rpt	j
�t	j
�|��}t
|�}n$|}t	j
�|��s�t	�|�t|�}|�r�t|�}ni}t�|�}t	j
�||d
�}t|d��}t�|j�\}}W5QRX|�|||||�\}}|�r|�rtd||�}||||f||<�q|�rt|�rttd
�t|�D]&}||\}}}}td||��qL|j�r�z6t|jd�� } t�|j|j|jf| d�W5QRXWn6tk
�r�}!ztd|!tj d�W5d}!~!XYnXdS)Nzfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r(z***z  -->z    %s.%s -> %s.%sz.pyc���z.coverr2�dzlines   cov%   module   (path)z%5d   %3d%%   %s   (%s)�wbrz"Can't save counts files because %sr3)!r7rC�sortedr8r5rL�itemsrJrIrr�dirname�abspathr'�exists�makedirsr1�_find_executable_linenos�	linecache�getlines�joinr;�tokenize�detect_encoding�readline�write_results_file�intr:r<�dumpr@r*rD)"rZshow_missing�summary�coverdirZcallsrr�funcnameZlastfileZ	lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno�	lines_hitZsums�countr0�lnotab�sourceZ	coverpath�fp�encoding�_�n_hits�n_linesZpercent�mrErFrrr
�
write_results�s�
��





��zCoverageResults.write_resultsc
Cs�zt|d|d�}Wn>tk
rP}z td||ftjd�WY�dSd}~XYnXd}d}	|��t|d�D]r\}
}|
|kr�|�d||
�|	d7}	|d7}n.|
|kr�t|kr�|�d	�|d7}n
|�d
�|�|�d��qjW5QRX|	|fS)N�w�rlz3trace: Could not open %r for writing: %s - skippingr3)rrrrz%5d: z>>>>>> z       �)	r;r@rCr*rD�	enumerate�write�PRAGMA_NOCOVER�
expandtabs)rr�linesrirgrlr:rFrornrf�linerrr
r_)s.��



z"CoverageResults.write_results_file)NNNNN)TFN)N)rr r!rrJr>rqr_rrrr
r�s�

\cCs,i}t�|�D]\}}||krd||<q|S)Nr)�disZfindlinestarts)�code�strs�linenosrmrfrrr
�_find_lines_from_codeIs

rcCs4t||�}|jD]}t�|�r|�t||��q|Sr")r�	co_consts�inspectZiscoder>�_find_lines)r|r}r~�crrr
r�Ss



r�c	Cs�i}tj}t||d��j}t�|j�}|D]R\}}}}	}
|tjkrv|tjkrv|\}}|	\}
}t||
d�D]}d||<qh|}q(W5QRX|S)Nrsr)�token�INDENTr;r\�generate_tokensr^�STRING�range)rrlrZ
prev_ttyperE�tokZttypeZtstr�start�endrzZslineZscolZelineZecol�irrr
�
_find_strings_s


r�c
Cs�z(t�|��}|��}|j}W5QRXWn@tk
rh}z"td||ftjd�iWY�Sd}~XYnXt||d�}t	||�}t
||�S)Nz%Not printing coverage data for %r: %sr3�exec)r\r;�readrlr@rCr*rD�compiler�r�)rrE�progrlrFr|r}rrr
rXvs��
rXc	@sveZdZddd�Zdd	�Zd d
d�Zdd
�Zde_dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)!rrrrNFc

Cs�||_||_t||�|_i|_i|_d|_||_i|_i|_	i|_
d|_|	rTt�|_|rb|j
|_nZ|rp|j|_nL|r�|r�|j|_|j|_n2|r�|j|_|j|_n|r�|j|_|j|_nd|_dSrK)r9r:r�ignorer5Zpathtobasename�	donothing�trace�_calledfuncs�_callers�
_caller_cache�
start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count�
localtrace�localtrace_trace�localtrace_count)
rrhr��
countfuncs�countcallers�
ignoremods�
ignoredirsr9r:�timingrrr
r�s6




zTrace.__init__cCs ddl}|j}|�|||�dS)Nr)�__main__�__dict__�runctx)r�cmdr��dictrrr
�run�sz	Trace.runc	Csh|dkri}|dkri}|js6t�|j�t�|j�zt|||�W5|jsbt�d�t�d�XdSr")r��	threading�settracer�r*r�)rr��globals�localsrrr
r��s
zTrace.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��d}|js�t�|j	�z|||�}W5|js�t�d�X|S)	N�z8descriptor 'runfunc' of 'Trace' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runfunc expected at least 1 positional argument, got %dr)
r+�	TypeError�pop�warnings�warn�DeprecationWarningr�r*r�r�)�args�kwrr�r��resultrrr
�runfunc�s.

�
�z
Trace.runfuncz($self, func, /, *args, **kw)c
Cs�|j}|j}|rt|�}nd}|j}d}||jkrL|j|dk	r�|j|}n�d|j|<dd�t�|�D�}t|�dkr�dd�t�|d�D�}t|�dkr�dd�t�|d�D�}	t|	�dkr�|	dj}||j|<|dk	r�d||f}|||fS)NcSsg|]}t�|�r|�qSr)r�Z
isfunction)rrErrr
r�s
�z1Trace.file_module_function_of.<locals>.<listcomp>rcSsg|]}t|t�r|�qSr)�
isinstancer�r
rrr
r�s
�rcSsg|]}t|d�r|�qS)�	__bases__)�hasattr)rr�rrr
r�s
�z%s.%s)	�f_code�co_filenamer'�co_namer��gcZ
get_referrersr+r)
r�framer|rrrdZclsnameZfuncsZdicts�classesrrr
�file_module_function_of�s,




zTrace.file_module_function_ofcCs0|dkr,|�|�}|�|j�}d|j||f<dS�N�callr)r��f_backr�)rr��why�arg�	this_funcZparent_funcrrr
r�
s
zTrace.globaltrace_trackcallerscCs |dkr|�|�}d|j|<dSr�)r�r�)rr�r�r�r�rrr
r�s
zTrace.globaltrace_countfuncscCsj|dkrf|j}|j�dd�}|rbt|�}|dk	rf|j�||�}|sf|jrZtd||jf�|j	SndSdS)Nr��__file__z! --- modulename: %s, funcname: %s)
r��	f_globalsrLr'r�rr�rCr�r�)rr�r�r�r|rrZ	ignore_itrrr
r�!s�zTrace.globaltrace_ltcCs�|dkr~|jj}|j}||f}|j�|d�d|j|<|jrTtdt�|jdd�tj	�
|�}td||t�||�fdd�|j
S)	Nrzrr�%.2f� �r��
%s(%d): %sr()r�r��f_linenor5rLr�rCr�rrr#rY�getliner�)rr�r�r�rrfrN�bnamerrr
r�8s
��z Trace.localtrace_trace_and_countcCsd|dkr^|jj}|j}|jr4tdt�|jdd�tj�|�}td||t	�
||�fdd�|jS)Nrzr�r�r�r�r()r�r�r�r�rCr�rrr#rYr�r�)rr�r�r�rrfr�rrr
r�Gs
��zTrace.localtrace_tracecCs<|dkr6|jj}|j}||f}|j�|d�d|j|<|jS)Nrzrr)r�r�r�r5rLr�)rr�r�r�rrfrNrrr
r�TszTrace.localtrace_countcCst|j|j|j|j|jd�S)N)r9r:r7r8)rr5r9r:r�r�)rrrr
�results\s

�z
Trace.results)	rrrrrrNNF)NN)rr r!rr�r�r��__text_signature__r�r�r�r�r�r�r�r�rrrr
r�s&�
2

)	
cs�ddl}|��}|jdddd�|�dd�}|jdd	d
dd�|jd
dd
dd�|jddd
dd�|jddd
dd�|�d�}|��}|jddd
dd�|jddd
dd�|jdddd �|jd!d"d#d �|jd$d%d
d&d�|jd'd(d
d)d�|jd*d+d
d,d�|�d-d.�}|jd/d0gd1d2�|jd3d0gd4d2�|jd5d
d6d7d2�|jd8d9d:d;�|jd<|jd=d;�|��}|j�r�t�	d>��t�	d?����fd@dA��dBdC�|j
D�|_
�fdDdC�|jD�|_|j�r�|j�s�|�
dE�t|j|jdF�}|�|j|j|j�St|j|j|j|jg��s |�
dG�|j�rB|j�s8|j�rB|�
dH�|j�r\|j�s\|�
dI�|jdk�rr|�
dJ�t|j|j|j|j|j
|j|j|j|jdK�	}z�|j�r�ddl}|j}|�|�\}	}
}|jf|j�t _!dL|j|
j"|
j#|
ddM�}n^|jf|j�t _!t$j%�&|j�t j%d<t'�(|j��}
t)|
�*�|jdN�}W5QRX|jdLdddO�}|�+|||�WnPt,k
�r�}zt �-dPt j!d|f�W5d}~XYnt.k
�r�YnX|�/�}|j0�s�|�|j|j|j�dS)QNrz	--version�versionz	trace 2.0)�actionr�zMain optionsz(One of these (or --report) must be givenz-cz--count�
store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r��helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z	Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r�z-Cz
--coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz	--missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz	--summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r��defaultr�z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).z--moduleFzTrace a module. �progname�?zfile to run as main program)�nargsr��	argumentszarguments to the programZstdlibZ
platstdlibcs4tj�tj�|��}|�d���d��}tj�|�S)Nz$prefixz$exec_prefix)rr�
expanduser�
expandvarsr-r	)�s)�_exec_prefix�_prefixrr
�parse_ignore_dir�szmain.<locals>.parse_ignore_dircSs$g|]}|�d�D]}|���qqS)�,)�split�strip)rr�rrrr
r�s�zmain.<locals>.<listcomp>cs&g|]}|�tj�D]}�|��qqSr)r�r�pathsep)rr�r�)r�rr
r�s�z-r/--report requires -f/--file)r9r:zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3progname is missing: required with the main options)r�r�r�r�r9r:r�r�)rr��__package__�
__loader__�__spec__�
__cached__r�)r�rr�r�zCannot run file %r because: %s)1�argparse�ArgumentParser�add_argumentZadd_argument_groupZadd_mutually_exclusive_groupZ	REMAINDER�
parse_argsZ
ignore_dir�	sysconfigZget_pathZ
ignore_moduleZreportr4�errorrrqZmissingrbrc�anyr�rhZ	listfuncsZ
trackcallsr�rr��module�runpyZ_get_module_detailsr�r�r*�argv�parent�loaderrrrT�io�	open_coder�r�r�r@�exit�
SystemExitr�Z	no_report)r��parserZgrpZ_grpZoptsr��tr�Zmodule_nameZmod_nameZmod_specr|ZglobsrkrFr)r�r�r�r
�mainbs��
�
�
�
�

�
���
�
�
��
�
�
��
�

�
�




��	�(rr�)N)�__all__r�rYrr*r�r�r\r�r�r{r<�timerr�r�rwrr'r1rrr�r�rXrrrrrrr
�<module>2s:20

_inspect.cpython-38.opt-1.pyc000064400000234666151450073350011624 0ustar00U

e5d��@s�dZdZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlmZddlmZmZe�Zej��D]\ZZeede<q�dZdd	�Zd
d�Z dd
�Z!dd�Z"dd�Z#e$ed��rdd�Z%ndd�Z%e$ed��r*dd�Z&ndd�Z&dd�Z'dd�Z(dd�Z)d d!�Z*d"d#�Z+d$d%�Z,d&d'�Z-d(d)�Z.d*d+�Z/d,d-�Z0d.d/�Z1d0d1�Z2d2d3�Z3d4d5�Z4d6d7�Z5d�d8d9�Z6ed:d;�Z7d<d=�Z8d>d?�Z9dd@�dAdB�Z:dCdD�Z;dEdF�Z<dGdH�Z=dIdJ�Z>dKdL�Z?dMdN�Z@dOdP�ZAdQdR�ZBd�dSdT�ZCiZDiZEd�dUdV�ZFdWdX�ZGdYdZ�ZHGd[d\�d\eI�ZJGd]d^�d^�ZKd_d`�ZLdadb�ZMdcdd�ZNdedf�ZOd�dhdi�ZPedjdk�ZQdldm�ZRedndo�ZSdpdq�ZTedrds�ZUdtdu�ZVedvdw�ZWdxdy�ZXd�dzd{�ZYd|d}�ZZdddd~iie[dd��d�d��d�d��d�d��eYfd�d��Z\e[d�d��d�d��d�d��fd�d��Z]d�d��Z^d�d��Z_d�d��Z`ed�d��Zad�d��Zbed�d��Zcd�d�d��Zdd�d��Zeed�d�ecjf�Zgd�d�d��Zhd�d�d��Zid�d��Zjd�d�d��Zkd�d�d��Zlem�Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsenfd�d��Ztd�Zud�Zvd�Zwd�Zxd�d��Zyd�d��Zzd�Z{d�Z|d�Z}d�Z~d�d��Zd�dÄZ�e�e�j��Z�e�e�j��Z�e�e�j�d��Z�e�e�e�ej�fZ�d�dƄZ�d�d�dȄZ�d�dʄZ�d�d̄Z�d�d΄Z�d�dЄZ�d�d҄Z�d�d�dՄZ��dd�dׄZ��dd�dلZ�d�d�dڜd�d܄Z�Gd�dބdރZ�Gd�d�d�Z�Gd�d�d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�d�e�d�e�d�e�d�e�d�iZ�Gd�d�d�Z�Gd�d�d�Z�Gd�d�d�Z�d�d�d�d�Z�d�d�Z�e�d�k�r�e��dS(aGet useful information from live Python objects.

This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.

Here are some of the useful functions provided by this module:

    ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
        isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
        isroutine() - check object types
    getmembers() - get members of an object that satisfy a given condition

    getfile(), getsourcefile(), getsource() - find an object's source code
    getdoc(), getcomments() - get documentation on an object
    getmodule() - determine the module that an object came from
    getclasstree() - arrange classes so as to represent their hierarchy

    getargvalues(), getcallargs() - get info about function arguments
    getfullargspec() - same, with support for Python 3 features
    formatargvalues() - format an argument spec
    getouterframes(), getinnerframes() - get info about frames
    currentframe() - get the current stack frame
    stack(), trace() - get info about frames on the stack or in a traceback

    signature() - get a Signature object for the callable
)zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�N)�
attrgetter)�
namedtuple�OrderedDictZCO_icCst|tj�S)z�Return true if the object is a module.

    Module objects provide these attributes:
        __cached__      pathname to byte compiled file
        __doc__         documentation string
        __file__        filename (missing for built-in modules))�
isinstance�types�
ModuleType��object�r
�/usr/lib64/python3.8/inspect.py�ismodule?srcCs
t|t�S)z�Return true if the object is a class.

    Class objects provide these attributes:
        __doc__         documentation string
        __module__      name of module in which this class was defined)r�typerr
r
r�isclassHsrcCst|tj�S)a_Return true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        __func__        function object containing implementation of method
        __self__        instance to which this method is bound)rr�
MethodTyperr
r
r�ismethodPsrcCs:t|�st|�st|�rdSt|�}t|d�o8t|d�S)a�Return true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    __func__ attribute (etc) when an object passes ismethod().F�__get__�__set__�rr�
isfunctionr
�hasattr�r	�tpr
r
r�ismethoddescriptorZsrcCs8t|�st|�st|�rdSt|�}t|d�p6t|d�S)a}Return true if the object is a data descriptor.

    Data descriptors have a __set__ or a __delete__ attribute.  Examples are
    properties (defined in Python) and getsets and members (defined in C).
    Typically, data descriptors will also have __name__ and __doc__ attributes
    (properties, getsets, and members have both of these attributes), but this
    is not guaranteed.Fr�
__delete__rrr
r
r�isdatadescriptornsr�MemberDescriptorTypecCst|tj�S)��Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�ismemberdescriptor~srcCsdS)rFr
rr
r
rr�s�GetSetDescriptorTypecCst|tj�S)��Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�isgetsetdescriptor�sr cCsdS)rFr
rr
r
rr �scCst|tj�S)a(Return true if the object is a user-defined function.

    Function objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this function was defined
        __code__        code object containing compiled function bytecode
        __defaults__    tuple of any default values for arguments
        __globals__     global namespace in which this function was defined
        __annotations__ dict of parameter annotations
        __kwdefaults__  dict of keyword only parameters with defaults)rr�FunctionTyperr
r
rr�srcCs6t|�r|j}qt�|�}t|�s&dSt|jj|@�S)z�Return true if ``f`` is a function (or a method or functools.partial
    wrapper wrapping a function) whose code object has the given ``flag``
    set in its flags.F)r�__func__�	functools�_unwrap_partialr�bool�__code__�co_flags)�f�flagr
r
r�_has_code_flag�s
r*cCs
t|t�S)z�Return true if the object is a user-defined generator function.

    Generator function objects provide the same attributes as functions.
    See help(isfunction) for a list of attributes.)r*ZCO_GENERATOR��objr
r
r�isgeneratorfunction�sr-cCs
t|t�S)zuReturn true if the object is a coroutine function.

    Coroutine functions are defined with "async def" syntax.
    )r*ZCO_COROUTINEr+r
r
r�iscoroutinefunction�sr.cCs
t|t�S)z�Return true if the object is an asynchronous generator function.

    Asynchronous generator functions are defined with "async def"
    syntax and have "yield" expressions in their body.
    )r*ZCO_ASYNC_GENERATORr+r
r
r�isasyncgenfunction�sr/cCst|tj�S)z7Return true if the object is an asynchronous generator.)rr�AsyncGeneratorTyperr
r
r�
isasyncgen�sr1cCst|tj�S)aReturn true if the object is a generator.

    Generator objects provide these attributes:
        __iter__        defined to support iteration over container
        close           raises a new GeneratorExit exception inside the
                        generator to terminate the iteration
        gi_code         code object
        gi_frame        frame object or possibly None once the generator has
                        been exhausted
        gi_running      set to 1 when generator is executing, 0 otherwise
        next            return the next item from the container
        send            resumes the generator and "sends" a value that becomes
                        the result of the current yield-expression
        throw           used to raise an exception inside the generator)rr�
GeneratorTyperr
r
r�isgenerator�sr3cCst|tj�S)z)Return true if the object is a coroutine.)rr�
CoroutineTyperr
r
r�iscoroutine�sr5cCs6t|tj�p4t|tj�r(t|jjt@�p4t|tj	j
�S)z?Return true if object can be passed to an ``await`` expression.)rrr4r2r%�gi_coder'ZCO_ITERABLE_COROUTINE�collections�abc�	Awaitablerr
r
r�isawaitable�s��r:cCst|tj�S)abReturn true if the object is a traceback.

    Traceback objects provide these attributes:
        tb_frame        frame object at this level
        tb_lasti        index of last attempted instruction in bytecode
        tb_lineno       current line number in Python source code
        tb_next         next inner traceback object (called by this level))rr�
TracebackTyperr
r
r�istraceback�sr<cCst|tj�S)a`Return true if the object is a frame object.

    Frame objects provide these attributes:
        f_back          next outer frame object (this frame's caller)
        f_builtins      built-in namespace seen by this frame
        f_code          code object being executed in this frame
        f_globals       global namespace seen by this frame
        f_lasti         index of last attempted instruction in bytecode
        f_lineno        current line number in Python source code
        f_locals        local namespace seen by this frame
        f_trace         tracing function for this frame, or None)rr�	FrameTyperr
r
r�isframe�sr>cCst|tj�S)a�Return true if the object is a code object.

    Code objects provide these attributes:
        co_argcount         number of arguments (not including *, ** args
                            or keyword only arguments)
        co_code             string of raw compiled bytecode
        co_cellvars         tuple of names of cell variables
        co_consts           tuple of constants used in the bytecode
        co_filename         name of file in which this code object was created
        co_firstlineno      number of first line in Python source code
        co_flags            bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
                            | 16=nested | 32=generator | 64=nofree | 128=coroutine
                            | 256=iterable_coroutine | 512=async_generator
        co_freevars         tuple of names of free variables
        co_posonlyargcount  number of positional only arguments
        co_kwonlyargcount   number of keyword only arguments (not including ** arg)
        co_lnotab           encoded mapping of line numbers to bytecode indices
        co_name             name with which this code object was defined
        co_names            tuple of names of local variables
        co_nlocals          number of local variables
        co_stacksize        virtual machine stack space required
        co_varnames         tuple of names of arguments and local variables)rr�CodeTyperr
r
r�iscodesr@cCst|tj�S)a,Return true if the object is a built-in function or method.

    Built-in functions and methods provide these attributes:
        __doc__         documentation string
        __name__        original name of this function or method
        __self__        instance to which a method is bound, or None)rr�BuiltinFunctionTyperr
r
r�	isbuiltinsrBcCs t|�pt|�pt|�pt|�S)z<Return true if the object is any kind of function or method.)rBrrrrr
r
r�	isroutine&s���rCcCs�t|t�sdS|jt@rdStt|�tj�s0dSt|d�r>dS|j�	�D]\}}t
|dd�rHdSqH|jD]6}t
|dd�D]$}t
||d�}t
|dd�rzdSqzqjdS)z:Return true if the object is an abstract base class (ABC).FT�__abstractmethods__�__isabstractmethod__r
N)rr
�	__flags__�TPFLAGS_IS_ABSTRACT�
issubclassr8�ABCMetar�__dict__�items�getattr�	__bases__)r	�name�value�baser
r
r�
isabstract-s"



rQc	Cst|�r|ft|�}nd}g}t�}t|�}z:|jD].}|j��D]\}}t|tj	�rD|�
|�qDq6Wntk
r|YnX|D]~}	zt||	�}
|	|kr�t�Wn:tk
r�|D]}|	|jkr�|j|	}
q�q�Yq�YnX|r�||
�r�|�
|	|
f�|�
|	�q�|jdd�d�|S)z�Return all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate.r
cSs|dS)Nrr
)Zpairr
r
r�<lambda>n�zgetmembers.<locals>.<lambda>��key)r�getmro�set�dirrMrJrKrr�DynamicClassAttribute�append�AttributeErrorrL�add�sort)r	Z	predicate�mro�results�	processed�namesrP�k�vrUrOr
r
r�
getmembersEs:




rd�	Attributezname kind defining_class objectcCsTt|�}tt|��}tdd�|D��}|f|}||}t|�}|D].}|j��D]\}}t|tj�rR|�	|�qRqDg}	t
�}
|D�]�}d}d}
d}||
k�rzz|dkr�td��t||�}
Wn"tk
r�}zW5d}~XYn�Xt|
d|�}||k�rzd}d}|D] }t||d�}||
k�r|}�q|D]B}z|�
||�}Wntk
�rXY�q(YnX||
k�r(|}�q(|dk	�rz|}|D]0}||jk�r~|j|}||k�r�|}�q��q~|dk�r�q�|
dk	�r�|
n|}t|ttjf��r�d}|}nFt|ttjf��rd}|}n*t|t��rd	}|}nt|��r,d
}nd}|	�	t||||��|
�|�q�|	S)aNReturn list of attribute-descriptor tuples.

    For each name in dir(cls), the return list contains a 4-tuple
    with these elements:

        0. The name (a string).

        1. The kind of attribute this is, one of these strings:
               'class method'    created via classmethod()
               'static method'   created via staticmethod()
               'property'        created via property()
               'method'          any other flavor of method or descriptor
               'data'            not a method

        2. The class which defined this attribute (a class).

        3. The object as obtained by calling getattr; if this fails, or if the
           resulting object does not live anywhere in the class' mro (including
           metaclasses) then the object is looked up in the defining class's
           dict (found by walking the mro).

    If one of the items in dir(cls) is stored in the metaclass it will now
    be discovered and not have None be listed as the class in which it was
    defined.  Any items whose home class cannot be discovered are skipped.
    css|]}|ttfkr|VqdS�N)r
r	)�.0�clsr
r
r�	<genexpr>�sz'classify_class_attrs.<locals>.<genexpr>NrJz)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)rVr
�tuplerXrJrKrrrYrZrW�	ExceptionrL�__getattr__r[�staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyperkrCrer\)rhr^ZmetamroZclass_basesZ	all_basesrarPrbrc�resultr`rNZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_objr,�kindr
r
r�classify_class_attrsss�












rxcCs|jS)zHReturn tuple of base classes (including cls) in method resolution order.)�__mro__)rhr
r
rrV�srV��stopcs|�dkrdd�}n�fdd�}|}t|�|i}t��}||�rx|j}t|�}||ks`t|�|krntd�|���|||<q6|S)anGet the object wrapped by *func*.

   Follows the chain of :attr:`__wrapped__` attributes returning the last
   object in the chain.

   *stop* is an optional callback accepting an object in the wrapper chain
   as its sole argument that allows the unwrapping to be terminated early if
   the callback returns a true value. If the callback never returns a true
   value, the last object in the chain is returned as usual. For example,
   :func:`signature` uses this to stop unwrapping if any object in the
   chain has a ``__signature__`` attribute defined.

   :exc:`ValueError` is raised if a cycle is encountered.

    NcSs
t|d�S�N�__wrapped__�r�r(r
r
r�_is_wrapper�szunwrap.<locals>._is_wrappercst|d�o�|�Sr|r~rrzr
rr�sz!wrapper loop when unwrapping {!r})�id�sys�getrecursionlimitr}�len�
ValueError�format)�funcr{r�r(ZmemoZrecursion_limitZid_funcr
rzr�unwrap�s

r�cCs|��}t|�t|���S)zBReturn the indent size, in spaces, at the start of a line of text.)�
expandtabsr��lstrip)�lineZexpliner
r
r�
indentsizesr�cCsNtj�|j�}|dkrdS|j�d�dd�D]}t||�}q.t|�sJdS|S)N�.���)r��modules�get�
__module__�__qualname__�splitrLr)r�rhrNr
r
r�
_findclasssr�c	Cst|�rT|jD]@}|tk	rz
|j}Wntk
r<YqYnX|dk	r|SqdSt|�r�|jj}|j}t|�r�t	t	||d�d�|jkr�|}n|j
}�n$t|�r�|j}t|�}|dks�t	||�|k	r�dSn�t
|��r|j}|j}t|��r|jd||jk�r|}n|j
}n�t|t��rP|j}|j}t|�}|dk�sJt	||�|k	�r�dSnnt|��sdt|��r�|j}|j}t	||�|k	�r�dSt|��r�t	|dd�}t|t��r�||k�r�||SndS|jD]F}zt	||�j}Wntk
�r�Y�q�YnX|dk	�r�|S�q�dS)Nr"r��	__slots__)rryr	�__doc__r[rr"�__name__�__self__rL�	__class__rr�rBr�rrk�fgetrrrjr�dict)r,rP�docrN�selfrhr��slotsr
r
r�_finddoc sn



�


�



r�c	Cshz
|j}Wntk
r YdSX|dkrRzt|�}Wnttfk
rPYdSXt|t�s`dSt|�S)z�Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed.N)r�r[r��	TypeErrorr�str�cleandoc)r	r�r
r
r�getdoc^s

r�cCs�z|���d�}Wntk
r(YdSXtj}|dd�D]*}t|���}|r<t|�|}t||�}q<|r||d��|d<|tjkr�tdt|��D]}|||d�||<q�|r�|ds�|�	�q�|r�|ds�|�	d�q�d�
|�SdS)z�Clean up indentation from docstrings.

    Any whitespace that can be uniformly removed from the second line
    onwards is removed.�
N�rr�)r�r��UnicodeErrorr��maxsizer�r��min�range�pop�join)r��linesZmarginr�Zcontent�indent�ir
r
rr�qs(

r�cCs�t|�r(t|dd�r|jStd�|���t|�rht|d�rZtj�	|j
�}t|dd�rZ|jStd�|���t|�rv|j}t
|�r�|j}t|�r�|j}t|�r�|j}t|�r�|jStd�t|�j���dS)z@Work out which source or compiled file an object was defined in.�__file__Nz{!r} is a built-in moduler�z{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})rrLr�r�r�rrr�r�r�r�rr"rr&r<�tb_framer>�f_coder@�co_filenamer
r�)r	�moduler
r
r�getfile�s.
�r�cCsTtj�|�}dd�tj��D�}|��|D]"\}}|�|�r,|d|�Sq,dS)z1Return the module name for a given file, or None.cSsg|]}t|�|f�qSr
)r�)rg�suffixr
r
r�
<listcomp>�s�z!getmodulename.<locals>.<listcomp>N)�os�path�basename�	importlib�	machinery�all_suffixesr]�endswith)r�Zfname�suffixesZneglenr�r
r
r�
getmodulename�s�
r�cs�t|��tjjdd�}|tjjdd�7}t�fdd�|D��r`tj���dtjj	d�nt�fdd�tjj
D��r~dStj���r��Stt
|��dd�dk	r��S�tjkr��SdS)z�Return the filename that can be used to locate an object's source.
    Return None if no way can be identified to get the source.
    Nc3s|]}��|�VqdSrf�r��rg�s��filenamer
rri�sz getsourcefile.<locals>.<genexpr>rc3s|]}��|�VqdSrfr�r�r�r
rri�s�
__loader__)r�r�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr�r��splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrL�	getmodule�	linecache�cache)r	Zall_bytecode_suffixesr
r�r�
getsourcefile�s"
��
r�cCs,|dkrt|�pt|�}tj�tj�|��S)z�Return an absolute path to the source or compiled file for an object.

    The idea is for each object to have a unique origin, so this routine
    normalizes the result as much as possible.N)r�r�r�r��normcase�abspath)r	�	_filenamer
r
r�
getabsfile�sr�c
Cs�t|�r|St|d�r$tj�|j�S|dk	rD|tkrDtj�t|�Szt||�}Wntk
rhYdSX|tkr�tj�t|�Stj�	��
�D]\\}}t|�r�t|d�r�|j}|t�|d�kr�q�|t|<t|�}|j
t|<ttj�|�<q�|tk�rtj�t|�Stjd}t|d��s"dSt||j
��rJt||j
�}||k�rJ|Stjd}t||j
��r|t||j
�}	|	|k�r||SdS)zAReturn the module an object was defined in, or None if not found.r�Nr��__main__r��builtins)rrr�r�r�r��
modulesbyfiler�r��copyrKr��_filesbymodnamer�r�r��realpathrL)
r	r��file�modnamer�r(�mainZ
mainobjectZbuiltinZ
builtinobjectr
r
rr��sJ
�

�




r�cCs�t|�}|rt�|�n$t|�}|�d�r4|�d�s<td��t||�}|rZt�||j	�}n
t�|�}|sptd��t
|�r�|dfSt|��r |j}t
�d|d�}g}tt|��D]F}|�||�}|r�||ddkr�||fS|�|�d	�|f�q�|�r|��||dd	fStd
��t|��r0|j}t|��r@|j}t|��rP|j}t|��r`|j}t|��r�t|d��s~td��|jd	}	t
�d
�}|	dk�r�z||	}
Wnt k
�r�td��YnX|�|
��rؐq�|	d	}	�q�||	fStd��dS)abReturn the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
    in the file and the line number indexes a line in that list.  An OSError
    is raised if the source code cannot be retrieved.�<�>zsource code not availablezcould not get source coderz^(\s*)class\s*z\b�cr�zcould not find class definition�co_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code objectN)!r�r��
checkcacher��
startswithr��OSErrorr��getlinesrJrrr��re�compiler�r��matchrZ�groupr]rr"rr&r<r�r>r�r@rr��
IndexError)r	r�r�r�rNZpatZ
candidatesr�r��lnumr�r
r
r�
findsourcesf










r�c	Cs.zt|�\}}Wnttfk
r*YdSXt|�r�d}|rT|ddd�dkrTd}|t|�krz||��dkrz|d}qT|t|�kr�||dd�dkr�g}|}|t|�kr�||dd�dkr�|�||���|d}q�d�|�S�n>|dk�r*t	||�}|d}|dk�r*||�
�dd�dk�r*t	||�|k�r*||���
�g}|dk�r�|d}||���
�}|dd�dk�r�t	||�|k�r�|g|dd�<|d}|dk�r��q�||���
�}�qt|�r�|d��dk�r�g|dd�<�q�|�r |d	��dk�r g|d	d�<�q�d�|�SdS)
zwGet lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    Nr�z#!r�)��#r�r�r�)r�r�r�rr��striprZr�r�r�r�)r	r�r��startZcomments�endr�Zcommentr
r
r�getcommentsRsL
  

$�
$
r�c@seZdZdS)�
EndOfBlockN)r�r�r�r
r
r
rr�sr�c@s eZdZdZdd�Zdd�ZdS)�BlockFinderz@Provide a tokeneater() method to detect the end of a code block.cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrFr�)r��islambda�started�passline�indecorator�decoratorhasargs�last�	body_col0�r�r
r
r�__init__�szBlockFinder.__init__cCsr|jsB|jsB|dkrd|_n|dkr8|dkr2d|_d|_d|_�n,|dkrZ|jrVd|_�n|dkrv|jrtd|_d|_n�|tjkr�d|_|d|_|jr�t�|jr�|js�d|_n�|jr�n�|tj	kr�|j
dkr�|jr�|d	|_
|jd	|_d|_n�|tjk�r|jd	|_|jdk�rnt�nV|tj
k�rL|j
dk	�rn|d	|j
k�rn|d|_n"|jdk�rn|tj
tjfk�rnt�dS)
N�@T)�def�class�lambdar�(�)Frr�)r�r�r�r�r��tokenize�NEWLINEr�r��INDENTr�r��DEDENT�COMMENT�NL)r�r
�tokenZsrowcolZerowcolr�r
r
r�
tokeneater�sL





zBlockFinder.tokeneaterN)r�r�r�r�r�rr
r
r
rr��s
r�c	CsVt�}z(t�t|�j�}|D]}|j|�qWnttfk
rFYnX|d|j�S)z@Extract the block of code at the top of the given list of lines.N)	r�r�generate_tokens�iter�__next__rr��IndentationErrorr�)r�Zblockfinder�tokensZ_tokenr
r
r�getblock�srcCsbt|�}t|�\}}t|�r"|j}t|�s>t|�rF|jjdkrF|dfSt||d��|dfSdS)a�Return a list of source lines and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of the lines
    corresponding to the object and the line number indicates where in the
    original source file the first line of code was found.  An OSError is
    raised if the source code cannot be retrieved.z<module>rNr�)	r�r�r<r�rr>r��co_namer�r	r�r�r
r
r�getsourcelines�s�
�rcCst|�\}}d�|�S)aReturn the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    OSError is raised if the source code cannot be retrieved.r�)rr�rr
r
r�	getsource�srcCsRg}|jtdd�d�|D]2}|�||jf�||kr|�t||||��q|S)z-Recursive helper function for getclasstree().r�r�rT)r]rrZrM�walktree)�classes�children�parentr_r�r
r
rr�srFcCs�i}g}|D]d}|jr^|jD]>}||kr0g||<|||krJ||�|�|r||krqpqq||kr|�|�q|D]}||krv|�|�qvt||d�S)a�Arrange the given list of classes into a hierarchy of nested lists.

    Where a nested list appears, it contains classes derived from the class
    whose entry immediately precedes the list.  Each entry is a 2-tuple
    containing a class and a tuple of its base classes.  If the 'unique'
    argument is true, exactly one entry appears in the returned structure
    for each class in the given list.  Otherwise, classes using multiple
    inheritance and their descendants will appear multiple times.N)rMrZr)r�uniquer�rootsr�rr
r
r�getclasstree�s"	
r�	Argumentszargs, varargs, varkwc	Cs�t|�std�|���|j}|j}|j}t|d|��}t||||��}d}||7}d}|jt@rx|j|}|d}d}|jt	@r�|j|}t
||||�S)aGet information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where
    'args' is the list of argument names. Keyword-only arguments are
    appended. 'varargs' and 'varkw' are the names of the * and **
    arguments or None.z{!r} is not a code objectNrr�)r@r�r��co_varnames�co_argcount�co_kwonlyargcount�listr'�
CO_VARARGS�CO_VARKEYWORDSr)	�cora�nargsZnkwargs�args�
kwonlyargs�step�varargs�varkwr
r
r�getargss"



r,�ArgSpeczargs varargs keywords defaultscCsDtjdtdd�t|�\}}}}}}}|s.|r6td��t||||�S)aeGet the names and default values of a function's parameters.

    A tuple of four things is returned: (args, varargs, keywords, defaults).
    'args' is a list of the argument names, including keyword-only argument names.
    'varargs' and 'keywords' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.

    This function is deprecated, as it does not support annotations or
    keyword-only parameters and will raise ValueError if either is present
    on the supplied callable.

    For a more structured introspection API, use inspect.signature() instead.

    Alternatively, use getfullargspec() for an API with a similar namedtuple
    based interface, but full support for annotations and keyword-only
    parameters.

    Deprecated since Python 3.5, use `inspect.getfullargspec()`.
    zhinspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()r���
stacklevelzgFunction has keyword-only parameters or annotations, use inspect.signature() API which can support them)�warnings�warn�DeprecationWarning�getfullargspecr�r-)r�r'r*r+�defaultsr(�kwonlydefaults�annr
r
r�
getargspec-s��r7�FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc
Cs|zt|ddtd�}Wn,tk
r@}ztd�|�W5d}~XYnXg}d}d}g}g}d}i}	d}i}
|j|jk	r||j|	d<|j��D]�}|j}|j	}
|t
kr�|�|
�|j|jk	r�||jf7}nv|t
kr�|�|
�|j|jk	r�||jf7}nJ|tkr�|
}n<|tk�r*|�|
�|j|jk	�r8|j|
|
<n|tk�r8|
}|j|jk	r�|j|	|
<q�|
�sZd}
|�sdd}t|||||||
|	�S)a$Get the names and default values of a callable object's parameters.

    A tuple of seven things is returned:
    (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
    'args' is a list of the parameter names.
    'varargs' and 'varkw' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.
    'kwonlyargs' is a list of keyword-only parameter names.
    'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
    'annotations' is a dictionary mapping parameter names to annotations.

    Notable differences from inspect.signature():
      - the "self" parameter is always reported, even for bound methods
      - wrapper chains defined by __wrapped__ *not* unwrapped automatically
    F��follow_wrapper_chains�skip_bound_arg�sigclszunsupported callableNr
�return)�_signature_from_callable�	Signatureror��return_annotation�empty�
parameters�valuesrwrN�_POSITIONAL_ONLYrZ�default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr8)r��sig�exr'r*r+Zposonlyargsr(r4�annotations�
kwdefaults�paramrwrNr
r
rr3Nsb�






�r3�ArgInfozargs varargs keywords localscCs t|j�\}}}t||||j�S)a9Get information about arguments passed into a particular frame.

    A tuple of four things is returned: (args, varargs, varkw, locals).
    'args' is a list of the argument names.
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'locals' is the locals dictionary of the given frame.)r,r�rP�f_locals)�framer'r*r+r
r
r�getargvalues�srScCsVt|dd�dkr t|��dd�St|t�rN|jd|fkr>|jS|jd|jSt|�S)Nr��typingztyping.r�r�r�)rL�repr�replacerr
r�r�)rJZbase_moduler
r
r�formatannotation�s
rWcst|dd���fdd�}|S)Nr�cs
t|��Srf)rW)rJ�r�r
r�_formatannotation�sz5formatannotationrelativeto.<locals>._formatannotation)rL)r	rYr
rXr�formatannotationrelativeto�srZr
cCsd|S�N�*r
�rNr
r
rrR�rSrRcCsd|S�N�**r
r]r
r
rrR�rScCsdt|�S�N�=�rU�rOr
r
rrR�rScCsd|S)Nz -> r
)�textr
r
rrR�rSc
s<ddlm}
|
dtdd����fdd�}g}|rBt|�t|�}t|�D]:\}}||�}|rz||krz||
|||�}|�|�qJ|dk	r�|�|||���n|r�|�d	�|r�|D]2}||�}|r�||kr�||
||�7}|�|�q�|dk	�r|�|	||���d
d�|�d}d
�k�r8||��d
��7}|S)a�Format an argument spec from the values returned by getfullargspec.

    The first seven arguments are (args, varargs, varkw, defaults,
    kwonlyargs, kwonlydefaults, annotations).  The other five arguments
    are the corresponding optional formatting functions that are called to
    turn names and values into strings.  The last argument is an optional
    function to format the sequence of arguments.

    Deprecated since Python 3.5: use the `signature` function and `Signature`
    objects.
    r)r1zc`formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directlyr�r.cs(�|�}|�kr$|d��|�7}|S)Nz: r
)�argru�rMrW�	formatargr
r�formatargandannotation�sz-formatargspec.<locals>.formatargandannotationNr\r�, rr=)r0r1r2r��	enumeraterZr�)r'r*r+r4r(r5rMrg�
formatvarargs�formatvarkw�formatvalueZ
formatreturnsrWr1rh�specsZfirstdefaultr�re�specZ	kwonlyargrur
rfr�
formatargspec�s<�


rpcCsd|Sr[r
r]r
r
rrRrScCsd|Sr^r
r]r
r
rrRrScCsdt|�Sr`rbrcr
r
rrRrScCs�|||fdd�}g}	tt|��D]}
|	�|||
��q |rV|	�||�|||��|rt|	�||�|||��dd�|	�dS)afFormat an argument spec from the 4 values returned by getargvalues.

    The first four arguments are (args, varargs, varkw, locals).  The
    next four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.cSs||�|||�Srfr
)rN�localsrgrmr
r
r�convertsz formatargvalues.<locals>.convertrrir)r�r�rZr�)r'r*r+rqrgrkrlrmrrrnr�r
r
r�formatargvaluess�
rscs��fdd�|D�}t|�}|dkr,|d}n>|dkr@dj|�}n*dj|dd��}|dd�=d	�|�|}td
|||rzdnd|dkr�d
nd|f��dS)Ncsg|]}|�krt|��qSr
rb)rgrN�rCr
rr�sz&_missing_arguments.<locals>.<listcomp>r�rr�z	{} and {}z, {} and {}���riz*%s() missing %i required %s argument%s: %s�
positional�keyword-onlyr�r�)r�r�r�r�)�f_nameZargnames�posrCra�missingr��tailr
rtr�_missing_argumentss 


��r|c
	s�t|�|}t�fdd�|D��}|r:|dk}	d|f}
n2|rTd}	d|t|�f}
nt|�dk}	tt|��}
d}|r�d}||dkr�d	nd||dkr�d	ndf}td
||
|	r�d	nd|||dkr�|s�dndf��dS)
Ncsg|]}|�kr|�qSr
r
)rgrertr
rr�)sz_too_many.<locals>.<listcomp>r�zat least %dTz
from %d to %dr�z7 positional argument%s (and %d keyword-only argument%s)r�z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)r�r�r�)
rxr'Zkwonlyr*ZdefcountZgivenrCZatleastZkwonly_givenZpluralrKZ
kwonly_sig�msgr
rtr�	_too_many's*���r~cOst|�}|\}}}}}}	}
|j}i}t|�rB|jdk	rB|jf|}t|�}
t|�}|r^t|�nd}t|
|�}t|�D]}|||||<qt|r�t||d��||<t||�}|r�i||<|�	�D]T\}}||kr�|s�t
d||f��||||<q�||k�rt
d||f��|||<q�|
|k�r<|�s<t||||||
|�|
|k�r�|d||�}|D]}||k�rZt||d|��qZt
|||d��D] \}}||k�r�||||<�q�d}|D]6}||k�r�|	�r�||	k�r�|	|||<n|d7}�q�|�rt||d|�|S)z�Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
    values from 'positional' and 'named'.Nrz*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTr�F)r3r�rr�r�r�r�rnrWrKr�r~r|rj)r�rvZnamedror'r*r+r4r(r5r6rxZ	arg2valueZnum_posZnum_argsZnum_defaults�nr�Zpossible_kwargs�kwrOZreqrerz�kwargr
r
r�getcallargs<sh
�
�
�



r��ClosureVarsz"nonlocals globals builtins unboundc	Cs�t|�r|j}t|�s$td�|���|j}|jdkr:i}ndd�t|j|j�D�}|j	}|�
dtj�}t
|�rt|j}i}i}t�}|jD]d}|dkr�q�z||||<Wq�tk
r�z||||<Wntk
r�|�|�YnXYq�Xq�t||||�S)a
    Get the mapping of free variables to their current values.

    Returns a named tuple of dicts mapping the current nonlocal, global
    and builtin references as seen by the body of the function. A final
    set of unbound names that could not be resolved is also provided.
    �{!r} is not a Python functionNcSsi|]\}}||j�qSr
)�
cell_contents)rg�varZcellr
r
r�
<dictcomp>�s�z"getclosurevars.<locals>.<dictcomp>�__builtins__)�None�True�False)rr"rr�r�r&�__closure__�zip�co_freevars�__globals__r�r�rJrrW�co_names�KeyErrorr\r�)	r��codeZ
nonlocal_varsZ	global_nsZ
builtin_nsZglobal_varsZbuiltin_varsZ
unbound_namesrNr
r
r�getclosurevarszs>	
�
�r��	Tracebackz+filename lineno function code_context indexr�cCs�t|�r|j}|j}n|j}t|�s2td�|���t|�p@t|�}|dkr�|d|d}zt	|�\}}Wnt
k
r�d}}Yq�Xtdt|t
|�|��}||||�}|d|}nd}}t|||jj||�S)a�Get information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line.z'{!r} is not a frame or traceback objectrr�r�N)r<�	tb_linenor��f_linenor>r�r�r�r�r�r��maxr�r�r�r�r)rR�context�linenor�r�r�r��indexr
r
r�getframeinfo�s$r�cCs|jS)zCGet the line number from a frame object, allowing for optimization.)r��rRr
r
r�	getlineno�sr��	FrameInfor�cCs2g}|r.|ft||�}|�t|��|j}q|S)z�Get a list of records for a frame and all higher (calling) frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�rZr��f_back)rRr��	framelist�	frameinfor
r
r�getouterframes�sr�cCs4g}|r0|jft||�}|�t|��|j}q|S)z�Get a list of records for a traceback's frame and all lower frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�r�rZr��tb_next)�tbr�r�r�r
r
r�getinnerframes�sr�cCsttd�rt�d�SdS)z?Return the frame of the caller or None if this is not possible.�	_getframer�N)rr�r�r
r
r
r�currentframe�sr�cCstt�d�|�S)z@Return a list of records for the stack above the caller's frame.r�)r�r�r��r�r
r
r�stack�sr�cCstt��d|�S)zCReturn a list of records for the stack below the current exception.r�)r�r��exc_infor�r
r
r�trace�sr�cCstjd�|�S)Nry)r
rJr)�klassr
r
r�_static_getmrosr�cCs8i}zt�|d�}Wntk
r(YnXt�||t�S�NrJ)r	�__getattribute__r[r�r��	_sentinel)r,�attrZ
instance_dictr
r
r�_check_instancesr�c	CsHt|�D]:}tt|��tkrz|j|WStk
r@YqXqtSrf)r��_shadowed_dictr
r�rJr�)r�r��entryr
r
r�_check_class
sr�cCs(zt|�Wntk
r"YdSXdS�NFT)r�r�r+r
r
r�_is_types
r�c	Csntjd}t|�D]V}z|�|�d}Wntk
r<YqXt|�tjkr`|jdkr`|j|ks|Sqt	Sr�)
r
rJr�rr�rrr�rjr�)r��	dict_attrr�Z
class_dictr
r
rr�s
��
r�c	Cst}t|�s>t|�}t|�}|tks2t|�tjkrBt||�}n|}t||�}|tk	r�|tk	r�tt|�d�tk	r�tt|�d�tk	r�|S|tk	r�|S|tk	r�|S||kr�tt|��D]:}tt|��tkr�z|j	|WSt
k
r�Yq�Xq�|tk	r�|St|��dS)a�Retrieve attributes without triggering dynamic lookup via the
       descriptor protocol,  __getattr__ or __getattribute__.

       Note: this function may not be able to retrieve all attributes
       that getattr can fetch (like dynamically created attributes)
       and may find attributes that getattr can't (like descriptors
       that raise AttributeError). It can also return descriptor objects
       instead of instance members in some cases. See the
       documentation for details.
    rrN)r�r�r
r�rrr�r�r�rJr�r[)r,r�rEZinstance_resultr�r�Zklass_resultr�r
r
r�getattr_static+s:�
�r��GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�
GEN_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a#Get current state of a generator-iterator.

    Possible states are:
      GEN_CREATED: Waiting to start execution.
      GEN_RUNNING: Currently being executed by the interpreter.
      GEN_SUSPENDED: Currently suspended at a yield expression.
      GEN_CLOSED: Execution has completed.
    Nr�)�
gi_runningr��gi_framer��f_lastir�r�)�	generatorr
r
r�getgeneratorstate`s	
r�cCs:t|�std�|���t|dd�}|dk	r2|jjSiSdS)z�
    Get the mapping of generator local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.z{!r} is not a Python generatorr�N)r3r�r�rLr�rQ)r�rRr
r
r�getgeneratorlocalsrsr��CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a&Get current state of a coroutine object.

    Possible states are:
      CORO_CREATED: Waiting to start execution.
      CORO_RUNNING: Currently being executed by the interpreter.
      CORO_SUSPENDED: Currently suspended at an await expression.
      CORO_CLOSED: Execution has completed.
    Nr�)�
cr_runningr��cr_framer�r�r�r�)�	coroutiner
r
r�getcoroutinestate�s	
r�cCs"t|dd�}|dk	r|jSiSdS)z�
    Get the mapping of coroutine local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.r�N)rLrQ)r�rRr
r
r�getcoroutinelocals�sr��
from_bytescCs8zt||�}Wntk
r$YdSXt|t�s4|SdS)z�Private helper. Checks if ``cls`` has an attribute
    named ``method_name`` and returns it only if it is a
    pure python function.
    N)rLr[r�_NonUserDefinedCallables)rhZmethod_nameZmethr
r
r�"_signature_get_user_defined_method�s
r�c
Cs�|j}t|���}|jpd}|jp$i}|r2||}z|j||�}Wn6tk
rx}zd�|�}	t|	�|�W5d}~XYnXd}
|��D]�\}}z|j	|}
Wnt
k
r�YnjX|jtkr�|�
|�q�|jtkr�||kr�d}
|j|
d�||<n|�
|j�q�|jtk�r|j|
d�||<|
r�|jtk�rN||jtd�}|||<|�|�q�|jttfk�rj|�|�q�|jtkr�|�
|j�q�|j|��d�S)	z�Private helper to calculate how 'wrapped_sig' signature will
    look like after applying a 'functools.partial' object (or alike)
    on it.
    r
z+partial object {!r} has incorrect argumentsNFT)rE�rw�rB)rBrrKr'�keywords�bind_partialr�r�r��	argumentsr�rwrDr�rFrVrNrH�move_to_endrIrGrC)�wrapped_sig�partialZ
extra_argsZ
old_params�
new_paramsZpartial_argsZpartial_keywordsZbarLr}Ztransform_to_kwonly�
param_namerOZ	arg_valueZ	new_paramr
r
r�_signature_get_partial�sL







r�cCslt|j���}|r$|djttfkr,td��|dj}|ttfkrP|dd�}n|t	k	r`td��|j
|d�S)zWPrivate helper to transform signatures for unbound
    functions to bound methods.
    rzinvalid method signaturer�Nzinvalid argument typer�)rnrBrCrwrIrHr�rFrDrGrV)rK�paramsrwr
r
r�_signature_bound_methods
r�cCs&t|�p$t|�p$t|t�p$|ttfkS)zxPrivate helper to test if `obj` is a callable that might
    support Argument Clinic's __text_signature__ protocol.
    )rBrrr�r
r	r+r
r
r�_signature_is_builtin.s��
�r�cCs�t|�rt|�rdSt|dd�}t|dd�}t|dt�}t|dt�}t|dd�}t|tj�o�t|t�o�|dksxt|t�o�|dks�t|t	�o�t|t	�S)z�Private helper to test if `obj` is a duck type of FunctionType.
    A good example of such objects are functions compiled with
    Cython, which have all attributes that a pure Python function
    would have, but have their code statically compiled.
    Fr�Nr&�__defaults__�__kwdefaults__�__annotations__)
�callablerrL�_voidrrr?r�rnr�)r,rNr�r4rNrMr
r
r�_signature_is_functionlike:s ����r�cCs<|�d�}|dkr|�d�}|�d�}|�d�}|d|�S)z� Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
    �,r�r�:rar�)�find)roryZcposr
r
r�_signature_get_bound_paramSs




r�cCs |s|ddfSd}d}dd�|�d�D�}t|�j}t�|�}d}d}g}|j}	d}
tj}tj}t|�}
|D]�}
|
j	|
j
}}||kr�|dkr�|r�d}qld}|
d	7}
ql|d
kr�d}|
d	}ql||kr�|dkr�|
}ql|r�d}||kr�|dks�|	d
�|	|�|dkrl|	d�qld�|�}|||fS)a�
    Private helper function. Takes a signature in Argument Clinic's
    extended signature format.

    Returns a tuple of three things:
      * that signature re-rendered in standard Python syntax,
      * the index of the "self" parameter (generally 0), or None if
        the function does not have a "self" parameter, and
      * the index of the last "positional only" parameter,
        or None if the signature has no positional-only parameters.
    NcSsg|]}|�d��qS)�ascii)�encode)rg�lr
r
rr�}sz6_signature_strip_non_python_syntax.<locals>.<listcomp>r�Frr�Tr��/�$rri� r�)r�rrrrZr�OP�
ERRORTOKEN�nextr
�stringr�)�	signature�self_parameter�last_positional_onlyr�r�Ztoken_streamZ
delayed_commaZskip_next_commardr\Zcurrent_parameterr�r��tr
r��clean_signaturer
r
r�"_signature_strip_non_python_syntaxjsP





r�Tc	s`ddl�|j�t|�\}}}d|d}z��|�}Wntk
rNd}YnXt|�j�sjtd�|���|j	d}	g��j
�t��d}i�t|dd�}
|
r�t
j�|
d�}|r�|j�t
j���	�fdd�����	fd	d
��
G��
fdd�d�j���f��������fd
d�	}t|	jj�}t|	jj�}
tj||
dd�}|dk	�rJ�j�n�j�ttt|���D](\}\}}|||�||k�r`�j��q`|	jj�r��j�||	jj���j�t|	jj |	jj!�D]\}}|||��q�|	jj"�r�j#�||	jj"��|dk	�rRt|dd�}|dk	}t$|�}|�r8|�s,|�r8��%d�n�dj&�jd�}|�d<|�|j
d�S)zdPrivate helper to parse content of '__text_signature__'
    and return a Signature based on it.
    rNzdef fooz: passz"{!r} builtin has invalid signaturer�cs|jdk	rtd��|jS)Nz'Annotations are not currently supported)rJr�re)�node)�astr
r�
parse_name�s
z&_signature_fromstr.<locals>.parse_namecs|zt|��}Wn>tk
rLzt|��}Wntk
rFt��YnXYnXt|tttttt	d�f�rr��
|�St��dSrf)�eval�	NameError�RuntimeErrorrr��int�float�bytesr%r
ZConstant)r�rO)r��module_dict�sys_module_dictr
r�
wrap_value�s
z&_signature_fromstr.<locals>.wrap_valuecs(eZdZ��fdd�Z��fdd�ZdS)z,_signature_fromstr.<locals>.RewriteSymbolicscs\g}|}t|�j�r(|�|j�|j}qt|�j�s:t��|�|j�d�t	|��}�|�S)Nr�)
rrerZr�rO�Namer�r�r��reversed)r�r��arrO�r�rr
r�visit_Attribute�sz<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributecst|j�j�st���|j�Srf)rZctxZLoadr�r�)r�r�rr
r�
visit_Name�sz7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r�r�r�rr	r
rr
r�RewriteSymbolics�sr
cs��|�}|�krdS|rp|tk	rpz���|�}��|�}Wntk
rR�}YnX|�kr`dS|�k	rl|n|}���|�|�d��dS)N�rErJ)�_emptyZvisitZliteral_evalr�rZ)Z	name_nodeZdefault_noderErN�o)�	Parameterr
r�rA�invalidrwrBr�r
r�p�s
z_signature_fromstr.<locals>.p)�	fillvaluer�r��r@)'r��_parameter_clsr��parse�SyntaxErrorrZModuler�r�ZbodyrAr	rLr�r�r�rJr�ZNodeTransformerrr'r4�	itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDrjr"Zvararg�VAR_POSITIONAL�KEYWORD_ONLYr�r(Zkw_defaultsr��VAR_KEYWORDrr�rV)rhr,r�r;r�r�r�Zprogramr�r(Zmodule_namerr'r4rr�rNrEZ_selfZself_isboundZ
self_ismoduler
)rr
r�rArrwrrBr�rrr�_signature_fromstr�sn�










rcCsBt|�std�|���t|dd�}|s4td�|���t||||�S)zHPrivate helper function to get signature for
    builtin callables.
    z%{!r} is not a Python builtin function�__text_signature__Nz#no signature found for builtin {!r})r�r�r�rLr�r)rhr�r;r�r
r
r�_signature_from_builtin<s�rc	CsHd}t|�s(t|�rd}ntd�|���t|dd�}|rFt||||�S|j}|j}|j}|j	}|j
}	|d|�}
|j}||||�}|j}
|j
}|j}|r�t|�}nd}g}||}|	}|
d|�D]<}|r�tnt}|
�|t�}|�||||d��|r�|d8}q�t|
|d��D]L\}}|�r&tnt}|
�|t�}|�||||||d	��|�r|d8}�q|jt@�r�|||}|
�|t�}|�|||td��|D]B}t}|dk	�r�|�|t�}|
�|t�}|�|||t|d	���q�|jt@�r2||}|jt@�r
|d7}||}|
�|t�}|�|||td��|||
�d
t�|d�S)zCPrivate helper: constructs Signature for the given python function.FTr�rNr)rJrwr�)rJrwrEr=�r@�__validate_parameters__)rr�r�r�rLrrr&r r�co_posonlyargcountr!r�r�r�r�rDrFr�rrZrjr'r#rGrHr$rI)rhr�r;Zis_duck_functionr�rZ	func_codeZ	pos_countZ	arg_namesZ
posonly_countrvZkeyword_only_countZkeyword_onlyrMr4rNZpos_default_countrBZnon_default_countZposonly_leftrNrwrJ�offsetrEr�r
r
r�_signature_from_functionLs�

�

�
�

�
�
�r$)r:r;c
Cs�t|�std�|���t|tj�rDt|j|||d�}|r@t|�S|S|rtt	|dd�d�}t|tj�rtt||||d�Sz
|j
}Wntk
r�Yn&X|dk	r�t|t�s�td�|���|Sz
|j
}Wntk
r�YnvXt|tj��rLt|j|||d�}t||d�}t|j���d	}|jtjk�r(|St|j���}|f|}	|j|	d
�St|��s`t|��rnt|||d�St|��r�t|||d�St|tj��r�t|j|||d�}t||�Sd}t|t��r�t t|�d�}
|
dk	�r�t|
|||d�}nJt |d
�}|dk	�rt||||d�}n$t |d�}|dk	�r4t||||d�}|dk�r@|j!dd�D]>}
z
|
j"}Wntk
�rpYnX|�rLt#|||�S�qLt|j!k�r@|j$t%j$k�r�|j&t%j&k�r�|�'t%�St(d�|���nrt|t)��s@t t|�d�}
|
dk	�r@zt|
|||d�}Wn8t(k
�r>}zd�|�}t(|�|�W5d}~XYnX|dk	�r\|�rXt|�S|St|tj*��r|d�|�}t(|��t(d�|���dS)zQPrivate helper function to get signature for arbitrary
    callable objects.
    z{!r} is not a callable objectr9cSs
t|d�S)N�
__signature__r~rr
r
rrR�rSz*_signature_from_callable.<locals>.<lambda>rzNz1unexpected object {!r} in __signature__ attributerfrr�)r;�__call__�__new__r�r�z(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature)+r�r�r�rrrr>r"r�r�r%r[r?�_partialmethodr#�
partialmethodr�r�rnrBrCrwrrrVrr�r$r�rr�r
r�ryrrr�r	r'�
from_callabler�r�rA)r,r:r;r<rKr)r�Zfirst_wrapped_paramZ
sig_paramsr�Zcall�newZinitrPZtext_sigrLr}r
r
rr>�s	��

��
�
�
��

�

�

�


�
�
�



r>c@seZdZdZdS)r�z1A private marker - used in Parameter & Signature.N�r�r�r�r�r
r
r
rr�t	sr�c@seZdZdZdS)rz6Marker object for Signature.empty and Parameter.empty.Nr,r
r
r
rrx	src@s4eZdZdZdZdZdZdZdd�Ze	dd	��Z
d
S)�_ParameterKindrr�r���cCs|jSrf)�_name_r�r
r
r�__str__�	sz_ParameterKind.__str__cCst|Srf)�_PARAM_NAME_MAPPINGr�r
r
r�description�	sz_ParameterKind.descriptionN)r�r�r�rrrrrr1rkr3r
r
r
rr-|	sr-zpositional-onlyzpositional or keywordzvariadic positionalrwzvariadic keywordc@s�eZdZdZdZeZeZe	Z
eZe
ZeZeed�dd�Zdd�Zdd	�Zed
d��Zedd
��Zedd��Zedd��Zeeeed�dd�Zdd�Zdd�Zdd�Zdd�ZdS)raRepresents a parameter in a function signature.

    Has the following public attributes:

    * name : str
        The name of the parameter as a string.
    * default : object
        The default value for the parameter if specified.  If the
        parameter has no default value, this attribute is set to
        `Parameter.empty`.
    * annotation
        The annotation for the parameter if specified.  If the
        parameter has no annotation, this attribute is set to
        `Parameter.empty`.
    * kind : str
        Describes how argument values are bound to the parameter.
        Possible values: `Parameter.POSITIONAL_ONLY`,
        `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
        `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
    )�_name�_kind�_default�_annotationrcCszt|�|_Wn$tk
r2td|�d���YnX|tk	rd|jttfkrdd}|�|jj�}t|��||_||_	|tkr�td��t
|t�s�d�t|�j
�}t|��|ddkr�|dd���r�|jtkr�d	}|�|jj�}t|��t|_d
�|dd��}|���std�|���||_dS)Nzvalue z is not a valid Parameter.kindz({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {}rr�r�zLimplicit arguments must be passed as positional or keyword arguments, not {}z
implicit{}z"{!r} is not a valid parameter name)r-r5r�rrGrIr�r3r6r7rr�r
r�r��isdigitrFrD�isidentifierr4)r�rNrwrErJr}r
r
rr��	s6

�
zParameter.__init__cCs t|�|j|jf|j|jd�fS)N�r6r7)r
r4r5r6r7r�r
r
r�
__reduce__�	s
��zParameter.__reduce__cCs|d|_|d|_dS)Nr6r7r:�r��stater
r
r�__setstate__�	s
zParameter.__setstate__cCs|jSrf)r4r�r
r
rrN�	szParameter.namecCs|jSrf)r6r�r
r
rrE�	szParameter.defaultcCs|jSrf)r7r�r
r
rrJ�	szParameter.annotationcCs|jSrf)r5r�r
r
rrw�	szParameter.kind)rNrwrJrEcCsL|tkr|j}|tkr|j}|tkr*|j}|tkr8|j}t|�||||d�S)z+Creates a customized copy of the Parameter.r)r�r4r5r7r6r
)r�rNrwrJrEr
r
rrV�	szParameter.replacecCs�|j}|j}|jtk	r(d�|t|j��}|jtk	rb|jtk	rPd�|t|j��}nd�|t|j��}|tkrtd|}n|t	kr�d|}|S)Nz{}: {}z{} = {}z{}={}r\r_)
rwr4r7rr�rWr6rUrGrI)r�rw�	formattedr
r
rr1
s
�


zParameter.__str__cCsd�|jj|�S)Nz	<{} "{}">�r�r�r�r�r
r
r�__repr__#
szParameter.__repr__cCst|j|j|j|jf�Srf)�hashrNrwrJrEr�r
r
r�__hash__&
szParameter.__hash__cCsJ||krdSt|t�stS|j|jkoH|j|jkoH|j|jkoH|j|jkS�NT)rr�NotImplementedr4r5r6r7�r��otherr
r
r�__eq__)
s

�
�
�zParameter.__eq__N)r�r�r�r�r�rDrrFrrGrrHrrIrrrAr�r;r>rkrNrErJrwr�rVr1rArCrHr
r
r
rr�	s6(



�rc@sheZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)�BoundArgumentsaResult of `Signature.bind` call.  Holds the mapping of arguments
    to the function's parameters.

    Has the following public attributes:

    * arguments : OrderedDict
        An ordered mutable mapping of parameters' names to arguments' values.
        Does not contain arguments' default values.
    * signature : Signature
        The Signature object that created this instance.
    * args : tuple
        Tuple of positional arguments values.
    * kwargs : dict
        Dict of keyword arguments values.
    )r��
_signature�__weakref__cCs||_||_dSrf)r�rJ)r�r�r�r
r
rr�G
szBoundArguments.__init__cCs|jSrf)rJr�r
r
rr�K
szBoundArguments.signaturec	Cs~g}|jj��D]d\}}|jttfkr*qvz|j|}Wntk
rRYqvYqX|jtkrj|�	|�q|�
|�qt|�Srf)rJrBrKrwrIrHr�r�rG�extendrZrn)r�r'r�rOrer
r
rr'O
s
zBoundArguments.argsc	Cs�i}d}|jj��D]x\}}|sD|jttfkr4d}n||jkrDd}q|sJqz|j|}Wntk
rlYqX|jtkr�|�|�q|||<q|Sr�)	rJrBrKrwrIrHr�r��update)r��kwargsZkwargs_startedr�rOrer
r
rrNf
s&


zBoundArguments.kwargsc	Cs�|j}g}|jj��D]x\}}z|�|||f�Wqtk
r�|jtk	rV|j}n$|jt	krfd}n|jt
krvi}nYq|�||f�YqXqt|�|_dS)z�Set default values for missing arguments.

        For variable-positional arguments (*args) the default is an
        empty tuple.

        For variable-keyword arguments (**kwargs) the default is an
        empty dict.
        r
N)r�rJrBrKrZr�rErrwrGrIr)r�r�Z
new_argumentsrNrO�valr
r
r�apply_defaults�
s	


zBoundArguments.apply_defaultscCs2||krdSt|t�stS|j|jko0|j|jkSrD)rrIrEr�r�rFr
r
rrH�
s

�zBoundArguments.__eq__cCs|d|_|d|_dS)NrJr��rJr�r<r
r
rr>�
s
zBoundArguments.__setstate__cCs|j|jd�S)NrQrQr�r
r
r�__getstate__�
szBoundArguments.__getstate__cCs@g}|j��D]\}}|�d�||��qd�|jjd�|��S)Nz{}={!r}z	<{} ({})>ri)r�rKrZr�r�r�r�)r�r'rerOr
r
rrA�
szBoundArguments.__repr__N)r�r�r�r�r�r�rkr�r'rNrPrHr>rRrAr
r
r
rrI4
s


rIc@s�eZdZdZdZeZeZe	Z
d,e	dd�dd�Zedd	��Z
ed
d��Zedd�d
d��Zedd��Zedd��Zeed�dd�Zdd�Zdd�Zdd�Zdd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdS)-r?aA Signature object represents the overall signature of a function.
    It stores a Parameter object for each parameter accepted by the
    function, as well as information specific to the function itself.

    A Signature object has the following public attributes and methods:

    * parameters : OrderedDict
        An ordered mapping of parameters' names to the corresponding
        Parameter objects (keyword-only arguments are in the same order
        as listed in `code.co_varnames`).
    * return_annotation : object
        The annotation for the return type of the function if specified.
        If the function has no annotation for its return type, this
        attribute is set to `Signature.empty`.
    * bind(*args, **kwargs) -> BoundArguments
        Creates a mapping from positional and keyword arguments to
        parameters.
    * bind_partial(*args, **kwargs) -> BoundArguments
        Creates a partial mapping from positional and keyword arguments
        to parameters (simulating 'functools.partial' behavior.)
    )�_return_annotation�_parametersNTr cCs�|dkrt�}n�|r�t�}t}d}t|�D]�\}}|j}	|j}
|	|krdd}|�|j|	j�}t|��n|	|krtd}|	}|	ttfkr�|j	t
kr�|r�d}t|��nd}|
|kr�d�|
�}t|��|||
<q*ntdd�|D��}t�|�|_
||_dS)	z�Constructs Signature from the given list of Parameter
        objects and 'return_annotation'.  All arguments are optional.
        NFz7wrong parameter order: {} parameter before {} parameterz-non-default argument follows default argumentTzduplicate parameter name: {!r}css|]}|j|fVqdSrfr]�rgrOr
r
rris�z%Signature.__init__.<locals>.<genexpr>)rrDrjrwrNr�r3r�rFrErr�MappingProxyTyperTrS)r�rBr@r!r�Ztop_kindZ
kind_defaults�idxrOrwrNr}r
r
rr��
sD��



�zSignature.__init__cCstjdtdd�t||�S)z�Constructs Signature for the given python function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z_inspect.Signature.from_function() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r$�rhr�r
r
r�
from_functions
�zSignature.from_functioncCstjdtdd�t||�S)z�Constructs Signature for the given builtin function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z^inspect.Signature.from_builtin() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2rrXr
r
r�from_builtins
�zSignature.from_builtin��follow_wrappedcCst|||d�S)z3Constructs Signature for the given callable object.)r<r:)r>)rhr,r\r
r
rr*#s�zSignature.from_callablecCs|jSrf)rTr�r
r
rrB)szSignature.parameterscCs|jSrf�rSr�r
r
rr@-szSignature.return_annotation)rBr@cCs0|tkr|j��}|tkr |j}t|�||d�S)z�Creates a customized copy of the Signature.
        Pass 'parameters' and/or 'return_annotation' arguments
        to override them in the new copy.
        r)r�rBrCrSr
)r�rBr@r
r
rrV1s
�zSignature.replacecCs8tdd�|j��D��}dd�|j��D�}|||jfS)Ncss|]}|jtkr|VqdSrf)rwrHrUr
r
rriAs
�z(Signature._hash_basis.<locals>.<genexpr>cSsi|]}|jtkr|j|�qSr
)rwrHrNrUr
r
rr�Ds
�z)Signature._hash_basis.<locals>.<dictcomp>)rnrBrCr@)r�r��
kwo_paramsr
r
r�_hash_basis@szSignature._hash_basiscCs(|��\}}}t|���}t|||f�Srf)r_�	frozensetrCrB)r�r�r^r@r
r
rrCIszSignature.__hash__cCs*||krdSt|t�stS|��|��kSrD)rr?rEr_rFr
r
rrHNs

zSignature.__eq__F�r�cCs�t�}t|j���}d}t|�}zt|�}Wn�tk
�rzt|�}	Wntk
rfYY�q�Yn�X|	jtkrzY�q�n�|	j|kr�|	jt	kr�d}
|
j
|	jd�}
t|
�d�|	f}Y�q�nP|	jtks�|	j
tk	r�|	f}Y�q�n.|r�|	f}Y�q�nd}
|
j
|	jd�}
t|
�d�Yq Xzt|�}	Wn tk
�r:td�d�Yq X|	jttfk�rVtd�d�|	jtk�r�|g}|�|�t|�||	j<�q�|	j|k�r�|	jt	k�r�tdj
|	jd��d�|||	j<q d}t�||�D]�}	|	jtk�r�|	}�q�|	jtk�r�q�|	j}
z|�|
�}WnFtk
�rN|�sJ|	jtk�rJ|	j
tk�rJtdj
|
d��d�Yn(X|	jt	k�rntdj
|	jd���|||
<�q�|�r�|dk	�r�|||j<ntdj
tt|��d���|�||�S)	z#Private method. Don't use directly.r
zA{arg!r} parameter is positional only, but was passed as a keyword)reNz$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rrrBrCr��
StopIterationrwrGrNrDr�r�rIrErrHrLrnr�chainr�r��_bound_arguments_cls)r�r'rNr�r�rBZ
parameters_exZarg_valsZarg_valrOr}rCZkwargs_paramr�r
r
r�_bindUs�




���
�������

��zSignature._bindcOs|�||�S)z�Get a BoundArguments object, that maps the passed `args`
        and `kwargs` to the function's signature.  Raises `TypeError`
        if the passed arguments can not be bound.
        �re�r�r'rNr
r
r�bind�szSignature.bindcOs|j||dd�S)z�Get a BoundArguments object, that partially maps the
        passed `args` and `kwargs` to the function's signature.
        Raises `TypeError` if the passed arguments can not be bound.
        Trarfrgr
r
rr��szSignature.bind_partialcCs t|�t|j���fd|jifS�NrS)r
rnrTrCrSr�r
r
rr;�s�zSignature.__reduce__cCs|d|_dSrir]r<r
r
rr>�szSignature.__setstate__cCsd�|jj|�S)Nz<{} {}>r@r�r
r
rrA�szSignature.__repr__c	Cs�g}d}d}|j��D]d}t|�}|j}|tkr6d}n|rH|�d�d}|tkrVd}n|tkrp|rp|�d�d}|�|�q|r�|�d�d�d�	|��}|j
tk	r�t|j
�}|d�|�7}|S)NFTr�r\z({})riz -> {})
rBrCr�rwrDrZrGrHr�r�r@rrW)	r�ruZrender_pos_only_separatorZrender_kw_only_separatorrOr?rwZrenderedZannor
r
rr1�s0




zSignature.__str__)N)r�r�r�r�r�rrrIrdrrAr�rsrYrZr*rkrBr@r�rVr_rCrHrerhr�r;r>rAr1r
r
r
rr?�
s<�7



	r?r[cCstj||d�S)z/Get a signature object for the passed callable.r[)r?r*)r,r\r
r
rr�sr�c
Cs�ddl}ddl}|��}|jddd�|jdddd	d
�|��}|j}|�d�\}}}z|�|�}}	WnNtk
r�}
z0d�	|t
|
�j|
�}t|t
jd
�t
�d�W5d}
~
XYnX|r�|�d�}|	}|D]}
t||
�}q�|	jt
jk�rtdt
jd
�t
�d�|j�r�td�	|��td�	t|	���td�	|	j��||	k�rxtd�	t|	j���t|	d��r�td�	|	j��n6zt|�\}}Wntk
�r�YnXtd�	|��td�ntt|��dS)z6 Logic for inspecting an object given at command line rNr	zCThe object to be analysed. It supports the 'module:qualname' syntax)�helpz-dz	--details�
store_truez9Display info about the module rather than its source code)�actionrjr�zFailed to import {} ({}: {}))r�r�r�z#Can't get info for builtin modules.r�z
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r�)�argparser��ArgumentParser�add_argument�
parse_argsr	�	partition�
import_moduleror�r
r��printr��stderr�exitr�rL�builtin_module_namesZdetailsr��
__cached__rUr�rrmr�r)rnr��parserr'�targetZmod_nameZ	has_attrs�attrsr,r�rvr}�parts�part�__r�r
r
r�_main$s`���



rr�)N)N)N)F)N)r�)r�)r�)r�)r�)r
)T)T)T)�r��
__author__r8�disZcollections.abcr7�enum�importlib.machineryr�rr�r�r�r�rrrr0r#r��operatorrrr�globalsZmod_dictZCOMPILER_FLAG_NAMESrKrbrcrGrrrrrrrr rr*r-r.r/r1r3r5r:r<r>r@rBrCrQrdrerxrVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ror�r�rrrrrrr,r-r7r8r3rPrSrWrZr�rprsr|r~r�r�r�r�r�r��_fieldsr�r�r�r�r�r�r	r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r&Z_WrapperDescriptor�allZ_MethodWrapperr�rJZ_ClassMethodWrapperrAr�r�r�r�r�r�r�r�rrr$r>r�r�IntEnumr-rrDrrFrrGrrHrrIr2rrIr?r�rr�r
r
r
r�<module>sz	




	
,
t$
>
	
.N->




�]


	�
;�
<
5

 



		0

�
LH
_�K�	k:
_weakrefset.cpython-38.opt-2.pyc000064400000016662151450073350012451 0ustar00U

e5dg�@s2ddlmZdgZGdd�d�ZGdd�d�ZdS)���ref�WeakSetc@s$eZdZdd�Zdd�Zdd�ZdS)�_IterationGuardcCst|�|_dS�N)r�
weakcontainer)�selfr�r	�#/usr/lib64/python3.8/_weakrefset.py�__init__sz_IterationGuard.__init__cCs |��}|dk	r|j�|�|Sr)r�
_iterating�add)r�wr	r	r
�	__enter__sz_IterationGuard.__enter__cCs0|��}|dk	r,|j}|�|�|s,|��dSr)rr�remove�_commit_removals)r�e�t�br�sr	r	r
�__exit__s
z_IterationGuard.__exit__N)�__name__�
__module__�__qualname__rrrr	r	r	r
r
src@seZdZd@dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�ZeZd&d'�Zd(d)�Zd*d+�ZeZd,d-�Zd.d/�ZeZd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$e$Z%d<d=�Z&d>d?�Z'dS)ArNcCsBt�|_t|�fdd�}||_g|_t�|_|dk	r>|�|�dS)NcSs2|�}|dk	r.|jr"|j�|�n|j�|�dSr)r�_pending_removals�append�data�discard)�itemZselfrefrr	r	r
�_remove&s
z!WeakSet.__init__.<locals>._remove)�setrrrrr�update)rrrr	r	r
r$szWeakSet.__init__cCs$|j}|jj}|r ||���qdSr)rrr�pop)r�lrr	r	r
r4szWeakSet._commit_removalsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr)rr�rZitemrefrr	r	r
�__iter__:s


zWeakSet.__iter__cCst|j�t|j�Sr)�lenrr�rr	r	r
�__len__CszWeakSet.__len__cCs.zt|�}Wntk
r"YdSX||jkS)NF)r�	TypeErrorr)rrZwrr	r	r
�__contains__Fs
zWeakSet.__contains__cCs|jt|�ft|dd�fS)N�__dict__)�	__class__�list�getattrr'r	r	r
�
__reduce__Ms
�zWeakSet.__reduce__cCs&|jr|��|j�t||j��dSr)rrrr
rr�rrr	r	r
r
QszWeakSet.addcCs|jr|��|j��dSr)rrr�clearr'r	r	r
r1Vsz
WeakSet.clearcCs
|�|�Sr�r,r'r	r	r
�copy[szWeakSet.copycCsT|jr|��z|j��}Wntk
r:td�d�YnX|�}|dk	r|SqdS)Nzpop from empty WeakSet)rrrr"�KeyErrorr$r	r	r
r"^szWeakSet.popcCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
rjszWeakSet.removecCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
roszWeakSet.discardcCs&|jr|��|D]}|�|�qdSr)rrr
)r�otherZelementr	r	r
r!tszWeakSet.updatecCs|�|�|Sr)r!�rr5r	r	r
�__ior__zs
zWeakSet.__ior__cCs|��}|�|�|Sr)r3�difference_update�rr5Znewsetr	r	r
�
difference~s
zWeakSet.differencecCs|�|�dSr)�__isub__r6r	r	r
r8�szWeakSet.difference_updatecCs<|jr|��||kr"|j��n|j�dd�|D��|S)Ncss|]}t|�VqdSrr��.0rr	r	r
�	<genexpr>�sz#WeakSet.__isub__.<locals>.<genexpr>)rrrr1r8r6r	r	r
r;�szWeakSet.__isub__cs���fdd�|D��S)Nc3s|]}|�kr|VqdSrr	r<r'r	r
r>�sz'WeakSet.intersection.<locals>.<genexpr>r2r6r	r'r
�intersection�szWeakSet.intersectioncCs|�|�dSr)�__iand__r6r	r	r
�intersection_update�szWeakSet.intersection_updatecCs(|jr|��|j�dd�|D��|S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.__iand__.<locals>.<genexpr>)rrrrAr6r	r	r
r@�szWeakSet.__iand__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.issubset.<locals>.<genexpr>)r�issubsetr6r	r	r
rB�szWeakSet.issubsetcCs|jttt|��kSr�rr �maprr6r	r	r
�__lt__�szWeakSet.__lt__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz%WeakSet.issuperset.<locals>.<genexpr>)r�
issupersetr6r	r	r
rF�szWeakSet.issupersetcCs|jttt|��kSrrCr6r	r	r
�__gt__�szWeakSet.__gt__cCs$t||j�stS|jttt|��kSr)�
isinstancer,�NotImplementedrr rDrr6r	r	r
�__eq__�szWeakSet.__eq__cCs|��}|�|�|Sr)r3�symmetric_difference_updater9r	r	r
�symmetric_difference�s
zWeakSet.symmetric_differencecCs|�|�dSr)�__ixor__r6r	r	r
rK�sz#WeakSet.symmetric_difference_updatecs@�jr����|kr"�j��n�j��fdd�|D���S)Nc3s|]}t|�j�VqdSr)rrr<r'r	r
r>�sz#WeakSet.__ixor__.<locals>.<genexpr>)rrrr1rKr6r	r'r
rM�szWeakSet.__ixor__cCs|�dd�||fD��S)Ncss|]}|D]
}|Vq
qdSrr	)r=rrr	r	r
r>�sz WeakSet.union.<locals>.<genexpr>r2r6r	r	r
�union�sz
WeakSet.unioncCst|�|��dkS)Nr)r&r?r6r	r	r
�
isdisjoint�szWeakSet.isdisjointcCs
t|j�Sr)�reprrr'r	r	r
�__repr__�szWeakSet.__repr__)N)(rrrrrr%r(r*r/r
r1r3r"rrr!r7r:�__sub__r8r;r?�__and__rAr@rB�__le__rErF�__ge__rGrJrL�__xor__rKrMrN�__or__rOrQr	r	r	r
r#sJ
			N)�_weakrefr�__all__rrr	r	r	r
�<module>snumbers.cpython-38.pyc000064400000027654151450073350010670 0ustar00U

e5d(�@s�dZddlmZmZdddddgZGdd�ded	�ZGd
d�de�Ze�e�Gdd�de�Z	e	�e
�Gdd�de	�ZGd
d�de�Ze�e
�dS)z~Abstract Base Classes (ABCs) for numbers, according to PEP 3141.

TODO: Fill out more detailed documentation on the operators.�)�ABCMeta�abstractmethod�Number�Complex�Real�Rational�Integralc@seZdZdZdZdZdS)rz�All numbers inherit from this class.

    If you just want to check if an argument x is a number, without
    caring what kind, use isinstance(x, Number).
    �N)�__name__�
__module__�__qualname__�__doc__�	__slots__�__hash__r	r	r	�/usr/lib64/python3.8/numbers.pyrs)�	metaclassc@s�eZdZdZdZedd��Zdd�Zeedd���Z	eed	d
���Z
edd��Zed
d��Zedd��Z
edd��Zdd�Zdd�Zedd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zd)S)*rabComplex defines the operations that work on the builtin complex type.

    In short, those are: a conversion to complex, .real, .imag, +, -,
    *, /, abs(), .conjugate, ==, and !=.

    If it is given heterogeneous arguments, and doesn't have special
    knowledge about them, it should fall back to the builtin complex
    type as described below.
    r	cCsdS)z<Return a builtin complex instance. Called for complex(self).Nr	��selfr	r	r�__complex__-szComplex.__complex__cCs|dkS)z)True if self != 0. Called for bool(self).rr	rr	r	r�__bool__1szComplex.__bool__cCst�dS)zXRetrieve the real component of this number.

        This should subclass Real.
        N��NotImplementedErrorrr	r	r�real5szComplex.realcCst�dS)z]Retrieve the imaginary component of this number.

        This should subclass Real.
        Nrrr	r	r�imag>szComplex.imagcCst�dS)zself + otherNr�r�otherr	r	r�__add__GszComplex.__add__cCst�dS)zother + selfNrrr	r	r�__radd__LszComplex.__radd__cCst�dS)z-selfNrrr	r	r�__neg__QszComplex.__neg__cCst�dS)z+selfNrrr	r	r�__pos__VszComplex.__pos__cCs
||S)zself - otherr	rr	r	r�__sub__[szComplex.__sub__cCs
||S)zother - selfr	rr	r	r�__rsub___szComplex.__rsub__cCst�dS)zself * otherNrrr	r	r�__mul__cszComplex.__mul__cCst�dS)zother * selfNrrr	r	r�__rmul__hszComplex.__rmul__cCst�dS)z5self / other: Should promote to float when necessary.Nrrr	r	r�__truediv__mszComplex.__truediv__cCst�dS)zother / selfNrrr	r	r�__rtruediv__rszComplex.__rtruediv__cCst�dS)zBself**exponent; should promote to float or complex when necessary.Nr)r�exponentr	r	r�__pow__wszComplex.__pow__cCst�dS)zbase ** selfNr)r�baser	r	r�__rpow__|szComplex.__rpow__cCst�dS)z7Returns the Real distance from 0. Called for abs(self).Nrrr	r	r�__abs__�szComplex.__abs__cCst�dS)z$(x+y*i).conjugate() returns (x-y*i).Nrrr	r	r�	conjugate�szComplex.conjugatecCst�dS)z
self == otherNrrr	r	r�__eq__�szComplex.__eq__N)r
rrr
rrrr�propertyrrrrrrr r!r"r#r$r%r'r)r*r+r,r	r	r	rr sN













c@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	ed&dd
��Z
dd�Zdd�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�Zed d!��Zed"d#��Zd$d%�ZdS)'rz�To Complex, Real adds the operations that work on real numbers.

    In short, those are: a conversion to float, trunc(), divmod,
    %, <, <=, >, and >=.

    Real also provides defaults for the derived operations.
    r	cCst�dS)zTAny Real can be converted to a native float object.

        Called for float(self).Nrrr	r	r�	__float__�szReal.__float__cCst�dS)aGtrunc(self): Truncates self to an Integral.

        Returns an Integral i such that:
          * i>0 iff self>0;
          * abs(i) <= abs(self);
          * for any Integral j satisfying the first two conditions,
            abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
        i.e. "truncate towards 0".
        Nrrr	r	r�	__trunc__�szReal.__trunc__cCst�dS)z$Finds the greatest Integral <= self.Nrrr	r	r�	__floor__�szReal.__floor__cCst�dS)z!Finds the least Integral >= self.Nrrr	r	r�__ceil__�sz
Real.__ceil__NcCst�dS)z�Rounds self to ndigits decimal places, defaulting to 0.

        If ndigits is omitted or None, returns an Integral, otherwise
        returns a Real. Rounds half toward even.
        Nr)rZndigitsr	r	r�	__round__�szReal.__round__cCs||||fS)z�divmod(self, other): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�
__divmod__�szReal.__divmod__cCs||||fS)z�divmod(other, self): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�__rdivmod__�szReal.__rdivmod__cCst�dS)z)self // other: The floor() of self/other.Nrrr	r	r�__floordiv__�szReal.__floordiv__cCst�dS)z)other // self: The floor() of other/self.Nrrr	r	r�
__rfloordiv__�szReal.__rfloordiv__cCst�dS)zself % otherNrrr	r	r�__mod__�szReal.__mod__cCst�dS)zother % selfNrrr	r	r�__rmod__�sz
Real.__rmod__cCst�dS)zRself < other

        < on Reals defines a total ordering, except perhaps for NaN.Nrrr	r	r�__lt__�szReal.__lt__cCst�dS)z
self <= otherNrrr	r	r�__le__�szReal.__le__cCstt|��S)z(complex(self) == complex(float(self), 0))�complex�floatrr	r	rr�szReal.__complex__cCs|
S)z&Real numbers are their real component.r	rr	r	rr�sz	Real.realcCsdS)z)Real numbers have no imaginary component.rr	rr	r	rr�sz	Real.imagcCs|
S)zConjugate is a no-op for Reals.r	rr	r	rr+szReal.conjugate)N)r
rrr
rrr.r/r0r1r2r3r4r5r6r7r8r9r:rr-rrr+r	r	r	rr�s@











c@s<eZdZdZdZeedd���Zeedd���Zdd�Z	d	S)
rz6.numerator and .denominator should be in lowest terms.r	cCst�dS�Nrrr	r	r�	numeratorszRational.numeratorcCst�dSr=rrr	r	r�denominatorszRational.denominatorcCs|j|jS)afloat(self) = self.numerator / self.denominator

        It's important that this conversion use the integer's "true"
        division rather than casting one side to float before dividing
        so that ratios of huge integers convert without overflowing.

        )r>r?rr	r	rr.szRational.__float__N)
r
rrr
rr-rr>r?r.r	r	r	rrsc@s�eZdZdZdZedd��Zdd�Zed&dd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��Zd d!�Zed"d#��Zed$d%��ZdS)'rz@Integral adds a conversion to int and the bit-string operations.r	cCst�dS)z	int(self)Nrrr	r	r�__int__+szIntegral.__int__cCst|�S)z6Called whenever an index is needed, such as in slicing)�intrr	r	r�	__index__0szIntegral.__index__NcCst�dS)a4self ** exponent % modulus, but maybe faster.

        Accept the modulus argument if you want to support the
        3-argument version of pow(). Raise a TypeError if exponent < 0
        or any argument isn't Integral. Otherwise, just implement the
        2-argument version described in Complex.
        Nr)rr&�modulusr	r	rr'4s	zIntegral.__pow__cCst�dS)z
self << otherNrrr	r	r�
__lshift__?szIntegral.__lshift__cCst�dS)z
other << selfNrrr	r	r�__rlshift__DszIntegral.__rlshift__cCst�dS)z
self >> otherNrrr	r	r�
__rshift__IszIntegral.__rshift__cCst�dS)z
other >> selfNrrr	r	r�__rrshift__NszIntegral.__rrshift__cCst�dS)zself & otherNrrr	r	r�__and__SszIntegral.__and__cCst�dS)zother & selfNrrr	r	r�__rand__XszIntegral.__rand__cCst�dS)zself ^ otherNrrr	r	r�__xor__]szIntegral.__xor__cCst�dS)zother ^ selfNrrr	r	r�__rxor__bszIntegral.__rxor__cCst�dS)zself | otherNrrr	r	r�__or__gszIntegral.__or__cCst�dS)zother | selfNrrr	r	r�__ror__lszIntegral.__ror__cCst�dS)z~selfNrrr	r	r�
__invert__qszIntegral.__invert__cCstt|��S)zfloat(self) == float(int(self)))r<rArr	r	rr.wszIntegral.__float__cCs|
S)z"Integers are their own numerators.r	rr	r	rr>{szIntegral.numeratorcCsdS)z!Integers have a denominator of 1.�r	rr	r	rr?�szIntegral.denominator)N)r
rrr
rrr@rBr'rDrErFrGrHrIrJrKrLrMrNr.r-r>r?r	r	r	rr&sD













N)r
�abcrr�__all__rr�registerr;rr<rrrAr	r	r	r�<module>sp
u
_zipapp.cpython-38.pyc000064400000013340151450073350010503 0ustar00U

e5do�@s�ddlZddlZddlZddlZddlZddlZddlZdddgZdZej	�
d�rXdZne��ZGdd�de
�Zejd	d
��Zdd�Zdd
d�Zddd�Zdd�Zddd�Zedkr�e�dS)�N�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�win�utf-8c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/zipapp.pyr!sc	cs8t|ttjf�r.t||��}|VW5QRXn|VdS�N)�
isinstance�str�os�PathLike�open)�archive�mode�fr
r
r�_maybe_open%srcCs$|r d|�t�d}|�|�dS)zWrite a shebang line.�#!�
N)�encode�shebang_encoding�write)r�interpreterZshebangr
r
r�_write_file_prefix.src
Cs�t|d��Z}|�d�}|dkr*d}|��t|d��&}t||�|�|�t�||�W5QRXW5QRX|r�t|t�r�t	�
|t	�|�jtj
B�dS)z8Copy an application archive, modifying the shebang line.�rb�r��wbN)r�read�readlinerr�shutilZcopyfileobjr
rr�chmod�stat�st_mode�S_IEXEC)rZnew_archiver�srcZfirst_2Zdstr
r
r�
_copy_archive5s


 r)Fc
Cs�d}t|d�rt|d�rd}nt�|�}|��r4d}|rHt|||�dS|��sXtd��|d��}|rt|rttd��|s�|s�td	��d}|r�|�d
�\}	}
}tdd�|	�	d
�D��}tdd�|�	d
�D��}
|
d
kr�|r�|
s�td|��t
j|	|d�}|dk�r|�d�}nt|d��s"t�|�}t
|d���}t||�|�rDtjntj}tj|d|d��^}|�d�D]4}|�|�}|dk�s�||��rf|�||����qf|�r�|�d|�d��W5QRXW5QRX|�r�t|d��s�|�|��jtjB�dS)abCreate an application archive from SOURCE.

    The SOURCE can be the name of a directory, or a filename or a file-like
    object referring to an existing archive.

    The content of SOURCE is packed into an application archive in TARGET,
    which can be a filename or a file-like object.  If SOURCE is a directory,
    TARGET can be omitted and will default to the name of SOURCE with .pyz
    appended.

    The created application archive will have a shebang line specifying
    that it should run with INTERPRETER (there will be no shebang line if
    INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
    not specified, an existing __main__.py will be used).  It is an error
    to specify MAIN for anything other than a directory source with no
    __main__.py, and it is an error to omit MAIN if the directory has no
    __main__.py.
    Fr!r"TNzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry point�:css|]}|��VqdSr��isidentifier��.0�partr
r
r�	<genexpr>{sz!create_archive.<locals>.<genexpr>�.css|]}|��VqdSrr+r-r
r
rr0|szInvalid entry point: )�module�fnz.pyzrr �w)�compression�*r)�hasattr�pathlib�Path�is_filer)�existsr�	partition�all�split�
MAIN_TEMPLATE�formatZwith_suffixrr�zipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglob�relative_torZas_posixZwritestrrr$r%r&r')�source�targetr�main�filter�
compressedZsource_is_fileZhas_mainZmain_py�mod�sepr3Zmod_okZfn_ok�fdr5�zZchildZarcnamer
r
rrLsX
�


�
&c
CsFt|d��2}|�d�dkr8|�����t�W5QR�SW5QRXdS)Nrrr)rr!r"�strip�decoder)rrr
r
rr�scCs<ddl}|��}|jddddd�|jdddd	d�|jd
dddd�|jd
dddd�|jddddd�|jddd�|�|�}|jr�tj�|j�s�t	d��t
|j�}td�|p�d��t
�d�tj�|j��r|jdk�stj�|j��rtj�|j|j��rt	d��|j�rt	d��t|j|j|j|j|jd�dS)z�Run the zipapp command line interface.

    The ARGS parameter lets you specify the argument list directly.
    Omitting ARGS (or setting it to None) works as for argparse, using
    sys.argv[1:] as the argument list.
    rNz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)�default�helpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-c�
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)�actionrOz--infoFz)Display the interpreter from the archive.)rNrQrOrCz'Source directory (or existing archive).)rOz%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)rrErG)�argparse�ArgumentParser�add_argument�
parse_args�infor�path�isfilerC�
SystemExitr�printr@�sys�exit�outputr;�samefilerEr�python�compress)�argsrR�parserrr
r
rrE�sN
�
�
�
�
��


�
�rE�__main__)N)NNNNF)N)�
contextlibrr8r#r%r[rA�__all__r?�platform�
startswithr�getfilesystemencoding�
ValueErrorr�contextmanagerrrr)rrrErr
r
r
r�<module>s0



�
J
1stat.cpython-38.opt-2.pyc000064400000007007151450073350011116 0ustar00U

e5dm�
@sHdZdZdZdZdZdZdZdZdZd	Z	d
d�Z
dd
�ZdZdZ
dZdZdZdZdZdZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)Z d*Z!e!Z"d+Z#d,Z$d-Z%d.Z&d/Z'd,Z(d-Z)d.Z*d0Z+d1Z,d2Z-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6d2Z7d1Z8dZ9d3Z:d4Z;d5Z<d6Z=d7Z>ed8fed9fed:fed;fed<fe
d=fed>ffe(d?ffe)d@ffe*e Bd9fe dAfe*dBffe,d?ffe-d@ffe.e!Bd9fe!dAfe.dBffe0d?ffe1d@ffe2e#BdCfe#dDfe2dBfff
Z?dEdF�Z@d1ZAd)ZBd.ZCd2ZDdZEdZFdZGd-ZHdZId4ZJdZKdZLd*ZMd+ZNdZOd,ZPd3ZQzddGlRTWneSk
�rBYnXdHS)I����������	cCs|d@S)Ni����moderr�/usr/lib64/python3.8/stat.py�S_IMODEsrcCs|d@S)Ni�rrrrr�S_IFMTsri@i i`i�ii�i�cCst|�tkS�N)r�S_IFDIRrrrr�S_ISDIR2srcCst|�tkSr)r�S_IFCHRrrrr�S_ISCHR6srcCst|�tkSr)r�S_IFBLKrrrr�S_ISBLK:srcCst|�tkSr)r�S_IFREGrrrr�S_ISREG>srcCst|�tkSr)r�S_IFIFOrrrr�S_ISFIFOBsrcCst|�tkSr)r�S_IFLNKrrrr�S_ISLNKFsrcCst|�tkSr)r�S_IFSOCKrrrr�S_ISSOCKJsrcCsdS�NFrrrrr�S_ISDOORNsr!cCsdSr rrrrr�S_ISPORTRsr"cCsdSr rrrrr�S_ISWHTVsr#iii���@i��8� �iiiii �l�s�-�b�d�c�p�r�w�S�x�t�TcCsJg}tD]6}|D]"\}}||@|kr|�|�qq|�d�qd�|�S)Nr,�)�_filemode_table�append�join)r
Zperm�table�bit�charrrr�filemode�s
r>)�*N)T�ST_MODE�ST_INO�ST_DEV�ST_NLINK�ST_UID�ST_GID�ST_SIZE�ST_ATIME�ST_MTIME�ST_CTIMErrrrrrrrr�S_IFDOOR�S_IFPORT�S_IFWHTrrrrrrrr!r"r#�S_ISUID�S_ISGID�S_ENFMT�S_ISVTX�S_IREAD�S_IWRITE�S_IEXEC�S_IRWXU�S_IRUSR�S_IWUSR�S_IXUSR�S_IRWXG�S_IRGRP�S_IWGRP�S_IXGRP�S_IRWXO�S_IROTH�S_IWOTH�S_IXOTH�	UF_NODUMP�UF_IMMUTABLE�	UF_APPEND�	UF_OPAQUE�UF_NOUNLINK�
UF_COMPRESSED�	UF_HIDDEN�SF_ARCHIVED�SF_IMMUTABLE�	SF_APPEND�SF_NOUNLINK�SF_SNAPSHOTr8r>�FILE_ATTRIBUTE_ARCHIVE�FILE_ATTRIBUTE_COMPRESSED�FILE_ATTRIBUTE_DEVICE�FILE_ATTRIBUTE_DIRECTORY�FILE_ATTRIBUTE_ENCRYPTED�FILE_ATTRIBUTE_HIDDEN�FILE_ATTRIBUTE_INTEGRITY_STREAM�FILE_ATTRIBUTE_NORMAL�"FILE_ATTRIBUTE_NOT_CONTENT_INDEXED�FILE_ATTRIBUTE_NO_SCRUB_DATA�FILE_ATTRIBUTE_OFFLINE�FILE_ATTRIBUTE_READONLY�FILE_ATTRIBUTE_REPARSE_POINT�FILE_ATTRIBUTE_SPARSE_FILE�FILE_ATTRIBUTE_SYSTEM�FILE_ATTRIBUTE_TEMPORARY�FILE_ATTRIBUTE_VIRTUAL�_stat�ImportErrorrrrr�<module>s�	�
�
�
��crypt.cpython-38.opt-1.pyc000064400000006475151450073350011313 0ustar00U

e5d�@s0dZddlZzddlZWn0ek
rHejdkr<ed��ned��YnXddlZddl	m
Zddlm
ZejejdZe�ZGd	d
�d
ed
d��Zd&dd�d
d�Zd'dd�ZgZdd�dd�Zedddd�edddd�dD](Zeddeddee�dd�r��qq�edd d!d"�ed#dd$d%�[[dS)(zEWrapper to the POSIX crypt library call and associated functionality.�NZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuplez./c@seZdZdZdd�ZdS)�_MethodziClass representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.cCsd�|j�S)Nz<crypt.METHOD_{}>)�format�name)�self�r�/usr/lib64/python3.8/crypt.py�__repr__sz_Method.__repr__N)�__name__�
__module__�__qualname__�__doc__r
rrrr	rsrz name ident salt_chars total_size��roundscCsB|dkrtd}|dk	r4t|t�s4t|jj�d���|js@d}nd|j�d�}|jr�|jddkr�|dkrpd}n@t�|d�}|d|>kr�td	��d
|kr�dks�ntd��||d
�d�7}n^|jdk�r|dk	�r d|kr�dks�ntd��|d|�d�7}n|dk	�r t|�d���|d�	dd�t
|j�D��7}|S)zsGenerate a salt for the specified method.

    If not specified, the strongest available method will be used.

    Nrz+ object cannot be interpreted as an integer��$�2��zrounds must be a power of 2��z%rounds out of the range 2**4 to 2**31Z02d)�5�6i�i�ɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}t�t�VqdS)N)�_srZchoice�
_saltchars)�.0�charrrr	�	<genexpr>Aszmksalt.<locals>.<genexpr>)�methods�
isinstance�int�	TypeError�	__class__rZident�
bit_length�
ValueError�join�rangeZ
salt_chars)�methodr�sZ
log_roundsrrr	�mksalts2

r*cCs&|dkst|t�rt|�}t�||�S)aRReturn a string representing the one-way hash of a password, with a salt
    prepended.

    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.

    N)r rr*�_crypt�crypt)Zword�saltrrr	r,Es
r,cGsVt|f|��}|t�d|<t||d�}td|�}|rRt|�|jkrRt�|�dSdS)NZMETHOD_rrTF)r�globalsr*r,�lenZ
total_sizer�append)rr�argsr(r-�resultrrr	�_add_methodWs

r3ZSHA512r��jZSHA256r�?)�b�y�arZBLOWFISHr��;ZMD5�1��"ZCRYPT��
)N)N)r�sys�_sysr+�ModuleNotFoundError�platform�ImportError�stringZ_stringZrandomrZ
_SystemRandom�collectionsrZ_namedtupleZ
ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr	�<module>s2

	&

ntpath.cpython-38.opt-1.pyc000064400000034503151450073350011441 0ustar00U

e5dVl�&@s(dZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g&Z
d1d2�Zd3d�Zd4d�Zd5d
�Zd6d�Zd7d�Zd8d�Zejje_d9d�Zd:d�Zd;d�Zd<d�Zzdd=lmZWnek
�r(d	ZYnXd>d�Zd?d�Zd@d�ZdAd �Z dBdC�Z!zddDlm"Z"Wnek
�r|e!Z#Yn
XdEd!�Z#zddFlm$Z$m%Z&Wnek
�r�e#Z'YnXdGdH�Z(dIdJ�Z)dKd*�Z'e*e
dL��o�e
�+�dMdNkZ,dRdOd,�Z-dPd0�Z.zddQlm/Z0Wnek
�r"YnXd	S)Sz�Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
�.�..�\�;�/z.;C:\binZnul�N)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat�
commonpathcCst|t�rdSdSdS)N�\/�\/)�
isinstance�bytes��path�r4�/usr/lib64/python3.8/ntpath.py�
_get_bothseps"s
r6cCs8t�|�}t|t�r$|�dd���S|�dd���SdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.�/�\rrN)�os�fspathr0r1�replace�lower��sr4r4r5r,s

cCsjt�|�}t|t�r,|�dd��d�rBdSn|�dd��d�rBdSt|�d}t|�d	koh|d	t|�kS)
zTest whether a path is absoluter7r8�\\?\Trr�\\?\�r)	r9r:r0r1r;�
startswithr�lenr6r=r4r4r5r	=s

c

GsTt�|�}t|t�r"d}d}d}nd}d}d}z�|sD|dd�|t|�\}}ttj|�D]~}t|�\}}	|	r�|	d|kr�|s�|s�|}|	}q\n*|r�||kr�|��|��kr�|}|	}q\|}|r�|d|kr�||}||	}q\|�r|d|k�r|�r|dd�|k�r|||WS||WSttt	fk
�rNt
jd	|f|���YnXdS)
Nr8r.�:rr/�:r���r
)r9r:r0r1r�mapr<�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)
r3�pathsr!�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr4r4r5r
MsL


��
cCst�|�}t|�dk�rt|t�r0d}d}d}nd}d}d}|�||�}|dd�|dkr�|dd	�|kr�|�|d�}|d
kr�|dd�|fS|�||d�}||dkr�|dd�|fS|d
kr�t|�}|d|�||d�fS|dd�|k�r|dd�|dd�fS|dd�|fS)
a�Split a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    �r8r7rDrrrEr�rFNrA)r9r:rCr0r1r;�find)rPr!r$rOZnormp�indexZindex2r4r4r5r|s.

$cCsxt�|�}t|�}t|�\}}t|�}|rD||d|krD|d8}q&|d|�||d�}}|�|�pj|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.rAN)r9r:r6rrC�rstrip)rPrN�d�i�head�tailr4r4r5r�s

cCs8t�|�}t|t�r$t�|ddd�St�|ddd�SdS)Nr8r7�.rrr)r9r:r0r1rK�	_splitext�rPr4r4r5r
�s

cCst|�dS)z)Returns the final component of a pathnamerA�rr\r4r4r5r�scCst|�dS)z-Returns the directory component of a pathnamerr]r\r4r4r5r�sc
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)r9�lstat�OSError�
ValueErrorrI�stat�S_ISLNK�st_mode�r3�str4r4r5r�s
c	Cs.zt�|�}Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r9r^r_r`rdr4r4r5r�s
)�_getvolumepathnamecCstt�|�}t|�}t|�}t|�\}}|rD|d|krD|pB||kS||krPdStrl|�|�t|��|�kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r9r:r6rrrfrU)r3rN�root�restr4r4r5rs
cCs�t�|�}t|t�rd}nd}|�|�s,|Sdt|�}}||kr\||t|�kr\|d7}q:dtjkrrtjd}nFdtjkr�|Sztjd}Wntk
r�d}YnXt	|tjd�}t|t�r�t�
|�}|dkr�t	t|�|d|��}|||d�S)	zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.�~�~rAZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�N)r9r:r0r1rBrCr6�environ�KeyErrorr
�fsencoder)r3�tilderW�n�userhome�driver4r4r5r!s.








cCs2t�|�}t|t�rhd|kr(d|kr(|Sddl}t|j|jdd�}d}d}d}d	}d}ttd
d�}nFd|kr|d|kr||Sddl}|j|jd}d
}d}d}d}d}tj}|dd�}	d}
t	|�}|
|k�r.||
|
d�}||k�rX||
dd�}t	|�}z&|�
|�}
|	||d|
d�7}	Wn*tk
�rR|	||7}	|d}
YnX�n�||k�rJ||
d|
d�|k�r�|	|7}	|
d7}
n�||
dd�}t	|�}z|�
|�}
Wn*tk
�r�|	||7}	|d}
YnhX|d|
�}
z.|dk�rt�tjt�
|
��}n||
}Wn"tk
�r<||
|}YnX|	|7}	�n�||k�r||
d|
d�|k�r�|	|7}	|
d7}
�q$||
d|
d�|k�r^||
dd�}t	|�}z|�
|�}
Wn.tk
�r�|	|||7}	|d}
YnlX|d|
�}
z.|dk�r"t�tjt�
|
��}n||
}Wn&tk
�rR|||
|}YnX|	|7}	n�|dd�}
|
d7}
||
|
d�}|�r�||k�r�|
|7}
|
d7}
||
|
d�}�q�z.|dk�r�t�tjt�
|
��}n||
}Wntk
�r||
}YnX|	|7}	|�r$|
d8}
n|	|7}	|
d7}
q�|	S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rNz_-�ascii�'�{�}�environb�$�%�'�{�}rArQ)r9r:r0r1�stringZ
ascii_lettersZdigits�getattrrlrCrTr`rn�fsdecoderm)r3rZvarcharsZquoteZpercentZbraceZrbraceZdollarrl�resrTZpathlen�c�var�valuer4r4r5rQs�













c	CsPt�|�}t|t�r*d}d}d}d}d}nd}d}d}d	}d
}|�|�rL|S|�||�}t|�\}}|�|�r�||7}|�|�}|�|�}d}|t	|�k�r,||r�|||kr�||=q�|||k�r"|dkr�||d|kr�||d|d�=|d8}n&|dk�r|�
|��r||=n|d7}q�|d7}q�|�sB|�sB|�|�||�|�S)
z0Normalize path, eliminating double slashes, etc.r8r7rZ�..)s\\.\r?rrrr)z\\.\r@rrA)
r9r:r0r1rBr;r�lstriprrC�endswith�appendr
)	r3r!r$rr Zspecial_prefixes�prefix�compsrWr4r4r5r�sF









cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)z�Return the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    )	r9r:r	r0r1�getcwdb�getcwdr
r)r3�cwdr4r4r5�_abspath_fallback�s



r�)�_getfullpathnamec	Cs4ztt|��WSttfk
r.t|�YSXdS)z&Return the absolute version of a path.N)rr�r_r`r�r2r4r4r5rs)�_getfinalpathname�readlinkc
Cs�d}t�}t|�|kr�|�t|��z:|}t|�}t|�s\t|�sJ|}Wq�ttt|�|��}Wq
t	k
r�}z|j
|kr�WY�q��W5d}~XYq
tk
r�Yq�Yq
Xq
|S)N)rArQrR��� �2�C�Wi&i(i))�setr�add�_nt_readlinkr	rrr
rr_�winerrorr`)r3�allowed_winerror�seenZold_path�exr4r4r5�_readlink_deeps&
r�cCs�d}d}|r�zt|�}|r$t||�n|WStk
r�}z�|j|krF�z0t|�}||krt|rft||�n|WWY�TSWntk
r�YnXt|�\}}|r�|s�||WY�S|r�t||�n|}W5d}~XYqXq|S)N)rArQrRr�r�r�r�r�r��{i�i�rk)r�r
r_r�r�r)r3r�rYr��new_path�namer4r4r5�_getfinalpathname_nonstrictCs(
 &r�c	
Cs^t|�}t|t�rBd}d}d}t��}t|�tt�t��krjdSn(d}d}d}t��}t|�tt�krjdS|�	|�}|s�t
|�s�t||�}zt|�}d	}Wn0t
k
r�}z|j}t|�}W5d}~XYnX|�sZ|�	|��rZ|�	|�r�||t|�d�}n|t|�d�}zt|�|k�r"|}Wn4t
k
�rX}z|j|k�rH|}W5d}~XYnX|S)
Nr?s\\?\UNC\s\\s\\.\NULr@z\\?\UNC\z\\z\\.\NULr)rr0r1r9r�rrnr&r�rBr	r
r�r_r�r�rC)	r3r�Z
unc_prefixZnew_unc_prefixr�Z
had_prefixZinitial_winerrorr�Zspathr4r4r5r'qsD



�getwindowsversionrRrQcCsft�|�}t|t�r"d}d}d}nd}d}d}|dkr:|}|sFtd��t�|�}z�tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td	|	|f��d
d�|�	|�D�}dd�|
�	|�D�}d
}
t
||�D]$\}}t|�t|�kr�q�|
d7}
q�|gt|�|
||
d�}|�s(|WSt|�WSt
ttttfk
�r`t�d||��YnXdS)z#Return a relative version of a pathr8rZr�rrrNzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr4r4��.0�xr4r4r5�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr4r4r�r4r4r5r��srrAr))r9r:r0r1r`rrrrr�ziprCr
rHrIrJ�DeprecationWarningrKrL)r3�startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrWZe1Ze2�rel_listr4r4r5r)�sJ


�

c	s�|std��tttj|��}t|dt�r8d�d�d�nd�d�d��z@��fd	d
�|D�}�fdd
�|D�}zt�fdd
�|D��\}Wntk
r�td�d�YnXttdd
�|D���dkr�td��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}t|�D]*\}	}
|
||	k�r*|d|	�}�qf�q*|dt|��}|�rt|�n|}|��|�WSttfk
�r�tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr8r7rZrrrcs g|]}t|��������qSr4)rr;r<)r�rP)r$r!r4r5r��szcommonpath.<locals>.<listcomp>csg|]\}}|����qSr4r]�r�rVrP�r!r4r5r��sc3s"|]\}}|dd��kVqdS)NrAr4r�r�r4r5�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr4r�r4r4r5r��srAzPaths don't have the same drivecsg|]}|r|�kr|�qSr4r4�r�r��rr4r5r��scsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr4r4r�r�r4r5r�sz)commonpath.<locals>.<listcomp>.<listcomp>r4)r�r>r�r4r5r�sr-)r-)r`�tuplerGr9r:r0r1r�rCrr;r�min�max�	enumerater
rHrIrKrL)rMZdrivesplits�split_pathsr	rrr3�common�s1�s2rWr�r�r4)r$rr!r5r-�sF

)�_isdir)N)1�__doc__rr r%r!r"r$r#r&r9�sysrarK�__all__r6rr	r
rrr
r[rrrr�ntrf�ImportErrorrrrrr�r�rr�r�r�r'r�r��hasattrr�r(r)r-r�rr4r4r4r5�<module>s�	�
/8

0q2

*.2�
84modulefinder.cpython-38.opt-2.pyc000064400000035452151450073350012625 0ustar00U

e5dn_�@sddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ej
dZej
dZej
dZ
ej
dZe
efZejZdZdZdZdZd	Zd
ZdZiZdd
�ZiZdd�Zddd�ZGdd�d�ZGdd�d�Zdd�Ze dk�rz
e�Z!Wne"k
�re#d�YnXdS)�N�
LOAD_CONST�IMPORT_NAME�
STORE_NAME�STORE_GLOBAL������cCst�|g��|�dS�N)�packagePathMap�
setdefault�append)Zpackagename�path�r�$/usr/lib64/python3.8/modulefinder.py�AddPackagePath(srcCs|t|<dSr)�replacePackageMap)Zoldname�newnamerrr�ReplacePackage3srcCstjj��tjj�||�}|dkr8tdj|d�|d��|jtjjkrVddddt	ffS|jtjj
krtddddtffS|j}|j�
|�r�dtj�|�ddtffSt|jtjj�r�t}n<t|jtjj�r�t}n&t|jtjj�r�t}nddddtffSt�|�}tj�|�d}|||d|ffS)NzNo module named {name!r})�name�����rb)�	importlib�	machinery�
PathFinder�invalidate_caches�	find_spec�ImportError�format�loader�BuiltinImporter�
_C_BUILTIN�FrozenImporter�
_PY_FROZEN�origin�
is_package�osr�dirname�_PKG_DIRECTORY�
isinstance�SourceFileLoader�
_PY_SOURCE�ExtensionFileLoader�_C_EXTENSION�SourcelessFileLoader�_PY_COMPILED�
_SEARCH_ERROR�io�	open_code�splitext)rr�specZ	file_pathZkind�file�suffixrrr�_find_module7s*
r:c@seZdZddd�Zdd�ZdS)�ModuleNcCs(||_||_||_d|_i|_i|_dSr)�__name__�__file__�__path__�__code__�globalnames�starimports)�selfrr8rrrr�__init__fszModule.__init__cCsLd|jf}|jdk	r&|d|jf}|jdk	r@|d|jf}|d}|S)Nz	Module(%rz, %r�))r<r=r>)rB�srrr�__repr__ss

zModule.__repr__)NN)r<�
__module__�__qualname__rCrFrrrrr;ds

r;c@s�eZdZd6dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zd7dd�Z	d8dd�Z
dd�Zdd�Zd9dd�Z
dd�Zdd�Zdd�Zd d!�Zd:d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd;d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)<�ModuleFinderNrcCsZ|dkrtj}||_i|_i|_||_d|_|dk	r8|ng|_|dk	rJ|ng|_g|_dS)Nr)	�sysr�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rBrrMrOrPrrrrC~szModuleFinder.__init__cGsV||jkrRt|j�D]}tddd�qt|dd�|D]}tt|�dd�q6t�dS)N�   � ��end)rM�rangerN�print�repr)rB�level�str�args�i�argrrr�msg�s
zModuleFinder.msgcGs,|d}||jkr(|jd|_|j|�dS�Nrr�rMrNr^�rBr[rYrrr�msgin�s
zModuleFinder.msgincGs,|d}||jkr(|jd|_|j|�dSr_r`rarrr�msgout�s
zModuleFinder.msgoutc	CsB|�dd|�t�|�� }ddtf}|�d|||�W5QRXdS)Nr�
run_scriptrr�__main__)r^r4r5r.�load_module)rB�pathname�fp�stuffrrrrd�s
zModuleFinder.run_scriptc	CsTtj�|�\}}tj�|�\}}t�|�� }|dtf}|�||||�W5QRXdS)Nr)r)r�splitr6r4r5r.rf)rBrg�dirrZextrhrirrr�	load_file�s

zModuleFinder.load_filerc	Cs\|�dd||||�|j||d�}|�||�\}}|�||�}|sF|S|jrX|�||�dS)Nr�import_hook�rY)r^�determine_parent�find_head_package�	load_tailr>�ensure_fromlist)	rBr�caller�fromlistrY�parent�q�tail�mrrrrm�szModuleFinder.import_hookcCs&|�dd||�|r|dkr,|�dd�dS|j}|dkr�|jrH|d8}|dkrl|j|}|�dd|�|S|�d�|kr�td��d�|�d�d|��}|j|}|�dd|�|S|jr�|j|}|�dd|�|Sd|k�r|�	d�}|d|�}|j|}|�dd|�|S|�dd�dS)	N�rorzdetermine_parent -> Nonerzdetermine_parent ->�.zrelative importpath too deep)
rbrcr<r>rK�countr �joinrj�rfind)rBrsrYZpnamerur\rrrro�s<





zModuleFinder.determine_parentcCs�|�dd||�d|kr@|�d�}|d|�}||dd�}n|}d}|r\d|j|f}n|}|�|||�}|r�|�dd||f�||fS|r�|}d}|�|||�}|r�|�dd||f�||fS|�dd|�td	|��dS)
Nryrprzrr�%s.%szfind_head_package ->�"raise ImportError: No module named�No module named )rb�findr<�
import_modulercr )rBrurr\�headrwZqnamervrrrrp�s.
zModuleFinder.find_head_packagecCs�|�dd||�|}|r�|�d�}|dkr2t|�}|d|�||dd�}}d|j|f}|�|||�}|s|�dd|�td|��q|�dd	|�|S)
Nryrqrzrrr~rr�zload_tail ->)rbr��lenr<r�rcr )rBrvrwrxr\r�Zmnamerrrrq�s
zModuleFinder.load_tailcCs�|�dd|||�|D]d}|dkrD|sz|�|�}|rz|�||d�qt||�sd|j|f}|�|||�}|std|��qdS)Nryrr�*rr~r�)r^�find_all_submodulesrr�hasattrr<r�r )rBrxrt�	recursive�sub�all�subnameZsubmodrrrrrs

zModuleFinder.ensure_fromlistc
	Cs�|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}|jD]�}zt�|�}Wn&tk
r�|�	dd|�YqTYnX|D]R}d}|D]0}t
|�}	||	d�|kr�|d|	�}q�q�|r�|dkr�|||<q�qT|��S)Nrzcan't list directoryrC)r>rr�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr)�listdir�OSErrorr^r��keys)
rBrxrK�suffixesrk�namesr�modZsuff�nrrrr�s.

z ModuleFinder.find_all_submodulescCs
|�dd|||�z|j|}Wntk
r4YnX|�dd|�|S||jkrb|�dd�dS|r�|jdkr�|�dd�dSz|�||o�|j|�\}}}Wn$tk
r�|�ddd�YdSXz|�	||||�}W5|r�|��X|r�t
|||�|�dd|�|S)Nrr�zimport_module ->zimport_module -> None)rbrK�KeyErrorrcrLr>�find_moduler �closerf�setattr)rBZpartname�fqnamerurxrhrgrirrrr�.s:
�
zModuleFinder.import_modulec
Cs(|\}}}|�dd||od|�|tkrF|�||�}|�dd|�|S|tkr`t|��|d�}	n||tkr�z|��}
tj	�
|
|i�Wn:tk
r�}z|�ddt|�|��W5d}~XYnXt
�t|
�dd��}	nd}	|�|�}||_|	�r|j�r|�|	�}	|	|_|�|	|�|�dd|�|S)Nrrfrhzload_module ->�execzraise ImportError: �)rbr+�load_packagercr.�compile�readr2r�_bootstrap_external�
_classify_pycr rZ�marshal�loads�
memoryview�
add_moduler=rP�replace_paths_in_coder?�	scan_code)rBr�rhrg�	file_infor9�mode�typerx�co�data�excrrrrfNs4


zModuleFinder.load_modulecCs<||jkri|j|<|r*d|j||j<nd|j|d<dS)Nr�-)rLr<)rBrrsrrr�_add_badmoduleks


zModuleFinder._add_badmodulecCsB||jkr|�||�dSz|j|||d�Wn~tk
rn}z"|�ddt|��|�||�W5d}~XYn�tk
r�}z"|�ddt|��|�||�W5d}~XYn�X|�r>|D]�}|d|}||jkr�|�||�q�z|j|||g|d�Wq�tk
�r:}z"|�ddt|��|�||�W5d}~XYq�Xq�dS)NrnrzImportError:zSyntaxError:rz)rLr�rmr r^rZ�SyntaxError)rBrrsrtrYr^r��fullnamerrr�_safe_import_hookss,

zModuleFinder._safe_import_hookccs�|j}|j}|j}dd�t�|�D�}t|�D]�\}\}}|tkrTd||ffVq.|tkr.|dkr.||dd||ddkr�tkr.nq.|||dd}	|||dd}
|	dkr�d|
||ffVq.d|	|
||ffVq.q.dS)	NcSs"g|]\}}}|tkr||f�qSr)�EXTENDED_ARG)�.0�_�opr]rrr�
<listcomp>�s�z-ModuleFinder.scan_opcodes.<locals>.<listcomp>�storerrr�absolute_import�relative_import)	�co_code�co_names�	co_consts�disZ_unpack_opargs�	enumerate�	STORE_OPSrr)rBr��coder��constsZopargsr\r�ZopargrYrtrrr�scan_opcodes�s(��
zModuleFinder.scan_opcodescCs�|j}|j}||�D�]F\}}|dkr8|\}d|j|<q|dk�r|\}}d}	|dk	rpd|krbd}	dd�|D�}|j|||dd�|	�r\d}
|jr�|j�|jd	|�}
|
dkr�|j�|�}
|
dk	r�|j�|
j�|j	�|
j	�|
j
dkr�d|j	|<n
d|j	|<q|d
k�rT|\}}}|�r0|j||||d�n"|j||d�}|j|jd|dd�qt|��q|j
D]"}
t|
t|���rd|�|
|��qddS)Nr�rr�rr�cSsg|]}|dkr|�qS)r�r)r��frrrr��sz*ModuleFinder.scan_code.<locals>.<listcomp>rnrzr�)r�r�r@r�r>rK�getr<�updaterAr?ro�RuntimeErrorr�r,r�r�)rBr�rxr��scannerZwhatr[rrtZ	have_starZmmrYru�crrrr��sH





zModuleFinder.scan_codecCs�|�dd||�t�|�}|r"|}|�|�}||_|g|_|jt�|g�|_|�d|j�\}}}z&|�	||||�|�
dd|�|W�S|r�|��XdS)Nrr�rCzload_package ->)rbrr�r�r=r>r
r�r�rfrc)rBr�rgrrxrhZbufrirrrr��s

zModuleFinder.load_packagecCs*||jkr|j|St|�|j|<}|Sr)rKr;)rBr�rxrrrr��s

zModuleFinder.add_modulecCsn|dk	r|jd|}n|}||jkr<|�dd|�t|��|dkrd|tjkr^ddddtffS|j}t||�S)Nrzrzfind_module -> Excludedr)	r<rOrcr rJ�builtin_module_namesr$rr:)rBrrrur�rrrr��s

zModuleFinder.find_modulecCst�tdd�tdd�t|j���}|D]B}|j|}|jrRtddd�ntddd�td||jpnd	�q0|��\}}|r�t�td
�|D]*}t|j|���}td|dd
�|��q�|�rt�tddd�td�|D]*}t|j|���}td|dd
�|��q�dS)Nz
  %-25s %s)�NameZFile)�----r��PrSrTrxz%-25srzMissing modules:�?z
imported fromz, z7Submodules that appear to be missing, but could also bez#global names in the parent package:)	rW�sortedrKr�r>r=�any_missing_mayberLr|)rBr��keyrx�missing�mayberZmodsrrr�reports0
zModuleFinder.reportcCs|��\}}||Sr)r�)rBr�r�rrr�any_missing"szModuleFinder.any_missingcCs�g}g}|jD]�}||jkrq|�d�}|dkr<|�|�q||dd�}|d|�}|j�|�}|dk	r�||j|kr�|�|�q�||jkr�q�|jr�|�|�q�|�|�q|�|�q|��|��||fS)Nrzrr)	rLrOr}rrKr�r@rA�sort)rBr�r�rr\r�ZpkgnameZpkgrrrr�*s0	




zModuleFinder.any_missing_maybecCs�tj�|j�}}|jD]*\}}|�|�r||t|�d�}qDq|jr�||jkr�||krr|�	dd||f�n|�	dd|f�|j�
|�t|j�}t
t|��D](}t||t|��r�|�||�||<q�|jt|�|d�S)Nrzco_filename %r changed to %rz co_filename %r remains unchanged)r��co_filename)r)r�normpathr�rP�
startswithr�rMrQrcr�listr�rVr,r�r��replace�tuple)rBr�Znew_filenameZoriginal_filenamer��rr�r\rrrr�Xs&
��
z"ModuleFinder.replace_paths_in_code)NrNN)NNr)r)r)r)N)r<rGrHrCr^rbrcrdrlrmrorprqrrr�r�rfr�r�r�r�r�r�r�r�r�r�r�rrrrrI|s2
	

#
 
1
".rIc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnXd}d}g}g}|D]Z\}}	|dkr�|d}|dkr�d}|dkr�||	�tj�}|dkr�d}|dkrn|�|	�qn|s�d	}
n|d}
tj	dd�}tj	�
|
�|d<||}|dk�r.td
�|D]}tdt|���qt|||�}
|dd�D]`}|dk�r\d}�qF|�r�|dd�d
k�r�|
�
|dd�ddg�n
|
�
|�n
|
�|��qF|
�|
�|
��|
S)Nrrzdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:rR���z.*r�)�getoptrJ�argv�errorrWrjr)�pathseprrr*rXrIrmrlrdr�)r�Zoptsr[r^rMZdomodsZaddpathZexclude�o�aZscriptr�item�mfr]rrr�testpsX


r�rez
[interrupted])N)$r�Zimportlib._bootstrap_externalr�importlib.machineryr�r)r4rJ�types�warningsZopmaprrrrr�r�r3r.r2r0r+r$r&r
rrrr:r;rIr�r<r��KeyboardInterruptrWrrrr�<module>sJ




-w;

_osx_support.cpython-38.opt-2.pyc000064400000021310151450073350012700 0ustar00U

e5dU�@s�ddlZddlZddlZddddgZdZdZdZd,d	d
�Zd-dd
�Zdd�Z	da
dd�Zdadd�Z
dd�Zdd�Zdadd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d�Zd)d�Zd*d�Zd+d�ZdS).�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|�tj�}tj�|�\}}tjdkrH|dkrH|d}tj�|�s�|D]&}tj�	||�}tj�|�rX|SqXdS|SdS)N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�$/usr/lib64/python3.8/_osx_support.py�_find_executables

rFc
Cs�ddl}zddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��P}|rfd||jf}nd||jf}t�	|�s�|�
��d���ndW5QR�SQRXdS)Nrz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr�fp�cmdrrr�_read_output7s��
r+cCst|�ptd|f�pdS)Nz/usr/bin/xcrun -find %s�)rr+)Ztoolnamerrr�_find_build_toolMs
��r-cCsxtdkrtdaztd�}Wntk
r,YnHXzt�d|���}W5|��X|dk	rtd�|�d��	d�dd��atS)Nr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�close�re�searchr&r�groupr)r�mrrr�_get_system_versionVs
�
r8cCsLtdkrHt�}|rHztdd�|�d�D��aWntk
rFdaYnXtS)Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>�sz,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rDcCs"t|�D]}|�t�r||=qdSr9)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rJcCs8|�|d�}||kr,t||kr,||t|<|||<dS)Nr,)�getrG)rH�cvZnewvalueZoldvaluerrr�_save_modified_value�srMcCs�tdk	rtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d�r(|dd	�aq(tdkr�datS)
Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrFr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rUcCst�}|rt|dk�SdS)N��
�F)rD�boolrCrrr�_supports_universal_builds�srZcCst�}|r|dkSdS)N)�rF)rDrCrrr�_supports_arm64_builds�sr\cCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�tD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
Nr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerFr+�replace�SystemError�_COMPILER_CONFIG_VARSrMr)rHrRZoldcc�datarLZcv_splitrrr�_find_appropriate_compiler�s,

��recCsVtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�q|S)N�
-arch\s+\w+\sr_)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r4�sub�ASCIIrM)rHrLrgrrr�_remove_universal_flagssrkcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�tD]8}||krF|tjkrF||}t�dd|�}t|||�qF|S)	Nr	z-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullr]r^z-arch\s+ppc\w*\sr_)	rr
r4r5r%rarhrirM)rHZstatusrLrgrrr�_remove_unsupported_archss
��	rlcCsddtjkr`tjd}tD]F}||krd||kr||}t�dd|�}|d|}t|||�q|S)N�	ARCHFLAGS�-archrfr_)rr
rhr4rirM)rHZarchrLrgrrr�_override_all_archs:s

rocCsx|�dd�}t�d|�}|dk	rt|�d�}tj�|�sttD]8}||kr:|tjkr:||}t�	dd|�}t
|||�q:|S)Nrr,z-isysroot\s*(\S+)r/z-isysroot\s*\S+(?:\s|$)r_)rKr4r5r6rr�existsrhr
rirM)rH�cflagsr7ZsdkrLrgrrr�_check_for_unavailable_sdkKs
rrc
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�z|�d�}|||d�=WqHtk
r|Yq�YqHXqHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjkr�|s�|tjd��}|�r@d
d�t|�D�}|�s
�q@|d}||d
k�r0|||d�=q�|||d�=q�d}|}dd�t|�D�}|�sv|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qz|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)NFTrncss|]}|�d�r|VqdS)�	-isysrootN�rF)r=�argrrrr?ys
z!compiler_fixup.<locals>.<genexpr>rmr0r/�arm64cSsg|]\}}|�d�r|�qS�rsrt�r=r>�xrrr�
<listcomp>�s
z"compiler_fixup.<locals>.<listcomp>rrscSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
cSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rErZ�anyrr
�indexrBr\�reversed�range�lenr�	enumerater�isdirZ	distutilsr{�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr}�idx�indicesZsysrootZargvarr{rrrrfsZ	


�
cCs"t�st|�t|�t|�|Sr9)rZrkrorr�rHrrrr�s
cCst|�t|�t|�|Sr9)rerlror�rrrr�s	cCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�rFd|��k�rFd
}t�d|�}tt	t
|���}t|�dkr�|d}nj|dkr�d}n\|dkr�d
}nN|dk�rd}n>|dk�rd}n.|dk�r&d}n|dk�r6d}ntd|f��n<|dk�rbtj
dk�r�d}n |dk�r�tj
dk�r~d }nd!}|||fS)"NZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?sz#get_platform_osx.<locals>.<genexpr>r.rr0)rWrrVrnZfatz
-arch\s+(\S+)r/)rv�x86_64Z
universal2)�i386�ppc)r�r�Zintel)r�r�r�Zfat3)�ppc64r�Zfat64)r�r�r�r�Z	universalz%Don't know machine value for archs=%rr�lr�)ZPowerPCZPower_Macintoshr�r�)rKr8rGrArrBr(r4�findall�sorted�setr�r�maxsize)rHZosname�release�machineZmacverZ
macreleaserqZarchsrrrr�sX



�$




�

)N)F)rr4r�__all__rhrcrGrr+r-r1r8r@rDrJrMrOrUrZr\rerkrlrorrrrrrrrrr�<module>s@�


	

>(Q)_compat_pickle.cpython-38.opt-1.pyc000064400000012505151450073350013112 0ustar00U

e5d-"�+@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�*Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdL�!ZdMZzeWnek
r�Yn
XedN7ZeD]ZdefedOef<q�dPZeD]ZdQefedRef<q�edSdT�e��D��Z	edUdT�e��D��Z
e�dVdWdddd"d"dXdXdXd(dYdYdZ�
�e	�d[d(d\d]dVd^��e�d/d_d6d`da��e
�dbdcdddedfdgdhdidjdkdldmdndo�
�dpZeD]Zdqe
def<�q�drZ
e
D]Zdse
def<�q�dtS)u�builtins�copyregZqueueZsocketserverZconfigparser�reprlib�tkinter.filedialog�tkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.client�
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejar�http.serverztest.support�
subprocess�urllib.parsezurllib.robotparser�urllib.request�dbmzcollections.abc)*�__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZtkFileDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmr
�gdbmZ	xmlrpclibZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerztest.test_supportZcommandsZurlparseZrobotparser�urllib2ZanydbmZ_abcoll)r�range)�	functools�reduce)�sys�intern)r�chr)r�str)r�int)r�zip)r�map)r�filter)�	itertools�filterfalse)r�zip_longest)�collections�UserDict)r"�UserList)r"�
UserString)r
�whichdb)�socket�fromfd)zmultiprocessing.connection�
Connection)�multiprocessing.context�Process)zmultiprocessing.popen_fork�Popen)�urllib.error�ContentTooShortError)r�
getproxies)r�pathname2url)r�
quote_plus)r�quote)r�unquote_plus)r�unquote)r�url2pathname)r�
urlcleanup)r�	urlencode)r�urlopen)r�urlretrieve)r-�	HTTPError)r-�URLError)!)rZxrange�rr)rr)rZunichr)rZunicode)rZlong)rZizip)rZimap)rZifilter)rZifilterfalse)rZizip_longest)r#ZIterableUserDict)r$r$)r%r%)r&r&)�_socketr()Z_multiprocessingr))zmultiprocessing.processr+)zmultiprocessing.forkingr,)�urllibr.)r>r/)r>r0)r>r1)r>r2)r>r3)r>r4)r>r5)r>r6)r>r7)r>r8)r>r9)rr:)rr;)/�ArithmeticError�AssertionError�AttributeError�
BaseException�BufferError�BytesWarning�DeprecationWarning�EOFError�EnvironmentError�	Exception�FloatingPointError�
FutureWarning�
GeneratorExit�IOError�ImportError�
ImportWarning�IndentationError�
IndexError�KeyError�KeyboardInterrupt�LookupError�MemoryError�	NameError�NotImplementedError�OSError�
OverflowError�PendingDeprecationWarning�ReferenceError�RuntimeError�RuntimeWarning�
StopIteration�SyntaxError�
SyntaxWarning�SystemError�
SystemExit�TabError�	TypeError�UnboundLocalError�UnicodeDecodeError�UnicodeEncodeError�UnicodeError�UnicodeTranslateError�UnicodeWarning�UserWarning�
ValueError�Warning�ZeroDivisionError)�WindowsError�
exceptions)ZAuthenticationErrorZBufferTooShortZProcessError�TimeoutErrorr*Zmultiprocessingccs|]\}}||fVqdS�N���.0�k�vrrrr�&/usr/lib64/python3.8/_compat_pickle.py�	<genexpr>�srxccs|]\}}||fVqdSrqrrrsrrrrrwrx�s�picklezxml.etree.ElementTreer"�io)
ZcPickleZ_elementtree�
FileDialog�SimpleDialog�DocXMLRPCServer�SimpleHTTPServer�
CGIHTTPServerr#r$r%r&�StringIOZ	cStringIO�bz2rr)Z_bz2Z_dbm�
_functoolsZ_gdbm�_pickle)rrH)r'Z
SocketType))rZ
basestring)roZ
StandardError)r#r#�r'Z
_socketobjectr<)r{r{)r{�LoadFileDialog)r{�SaveFileDialog)r|r|)r}�
ServerHTMLDoc)r}�XMLRPCDocGenerator)r}�DocXMLRPCRequestHandler)r}r})r}�DocCGIXMLRPCRequestHandler)r~�SimpleHTTPRequestHandler)r�CGIHTTPRequestHandlerr�)
)r�r)rr{)rr�)rr�)rr|)rr�)rr�)rr�)rr})rr�)r	r�)r	r�)r=r')�BrokenPipeError�ChildProcessError�ConnectionAbortedError�ConnectionError�ConnectionRefusedError�ConnectionResetError�FileExistsError�FileNotFoundError�InterruptedError�IsADirectoryError�NotADirectoryError�PermissionError�ProcessLookupErrorrp)rorW)�ModuleNotFoundError)rorMN)ZIMPORT_MAPPINGZNAME_MAPPINGZPYTHON2_EXCEPTIONSrnrUZexcnameZMULTIPROCESSING_EXCEPTIONS�dict�itemsZREVERSE_IMPORT_MAPPINGZREVERSE_NAME_MAPPING�updateZPYTHON3_OSERROR_EXCEPTIONSZPYTHON3_IMPORTERROR_EXCEPTIONSrrrrrrrw�<module>	s�2�$3����codecs.cpython-38.opt-2.pyc000064400000043730151450073350011406 0ustar00U

e5d;��,@s�ddlZddlZzddlTWn.ek
rJZzede��W5dZ[XYnXdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g,Zd0Zd1ZZ	d2Z
Zd3Zd4Z
ejd5kr�e	ZZeZneZZe
Ze	ZeZeZe
ZGd6d�de�ZGd7d�d�ZGd8d�de�ZGd9d:�d:e�ZGd;d�de�ZGd<d=�d=e�ZGd>d�de�ZGd?d�de�ZGd@d�d�Z GdAd�d�Z!d[dEd�Z"d\dFd�Z#dGd�Z$dHd�Z%dId �Z&dJd!�Z'dKd"�Z(dLd#�Z)d]dMd&�Z*d^dNd'�Z+dOdP�Z,dQdR�Z-z4e.dC�Z/e.dS�Z0e.dT�Z1e.dU�Z2e.dV�Z3e.dW�Z4Wn.e5k
�r\dZ/dZ0dZ1dZ2dZ3dZ4YnXdZ6e6�rpddl7Z7e8dXk�r�e#ej9dYdZ�e_9e#ej:dZdY�e_:dS)_�N)�*z%Failed to load the builtin codecs: %s�register�lookup�open�EncodedFile�BOM�BOM_BE�BOM_LE�BOM32_BE�BOM32_LE�BOM64_BE�BOM64_LE�BOM_UTF8�	BOM_UTF16�BOM_UTF16_LE�BOM_UTF16_BE�	BOM_UTF32�BOM_UTF32_LE�BOM_UTF32_BE�	CodecInfo�Codec�IncrementalEncoder�IncrementalDecoder�StreamReader�StreamWriter�StreamReaderWriter�
StreamRecoder�
getencoder�
getdecoder�getincrementalencoder�getincrementaldecoder�	getreader�	getwriter�encode�decode�
iterencode�
iterdecode�
strict_errors�
ignore_errors�replace_errors�xmlcharrefreplace_errors�backslashreplace_errors�namereplace_errors�register_error�lookup_errorss��s��s��s���littlec@s(eZdZdZddd�dd�Zdd�ZdS)	rTN)�_is_text_encodingc
CsPt�|||||f�}	||	_||	_||	_||	_||	_||	_||	_|dk	rL||	_	|	S�N)
�tuple�__new__�namer#r$�incrementalencoder�incrementaldecoder�streamwriter�streamreaderr0)
�clsr#r$r8r7r5r6r4r0�self�r;�/usr/lib64/python3.8/codecs.pyr3^szCodecInfo.__new__cCsd|jj|jj|jt|�fS)Nz%<%s.%s object for encoding %s at %#x>)�	__class__�
__module__�__qualname__r4�id�r:r;r;r<�__repr__ms��zCodecInfo.__repr__)NNNNN)�__name__r>r?r0r3rBr;r;r;r<rSs	��c@s eZdZddd�Zddd�ZdS)	r�strictcCst�dSr1��NotImplementedError�r:�input�errorsr;r;r<r#�szCodec.encodecCst�dSr1rErGr;r;r<r$�szCodec.decodeN)rD)rD)rCr>r?r#r$r;r;r;r<rrs
c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)rrDcCs||_d|_dS�N�)rI�buffer�r:rIr;r;r<�__init__�szIncrementalEncoder.__init__FcCst�dSr1rE�r:rH�finalr;r;r<r#�szIncrementalEncoder.encodecCsdSr1r;rAr;r;r<�reset�szIncrementalEncoder.resetcCsdS�Nrr;rAr;r;r<�getstate�szIncrementalEncoder.getstatecCsdSr1r;�r:�stater;r;r<�setstate�szIncrementalEncoder.setstateN)rD)F)rCr>r?rNr#rQrSrVr;r;r;r<r�s


c@s@eZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�ZdS)�BufferedIncrementalEncoderrDcCst�||�d|_dSrJ)rrNrLrMr;r;r<rN�sz#BufferedIncrementalEncoder.__init__cCst�dSr1rE�r:rHrIrPr;r;r<�_buffer_encode�sz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrYrI�r:rHrP�data�result�consumedr;r;r<r#�s
z!BufferedIncrementalEncoder.encodecCst�|�d|_dSrJ)rrQrLrAr;r;r<rQ�s
z BufferedIncrementalEncoder.resetcCs
|jpdSrR�rLrAr;r;r<rS�sz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrJr^rTr;r;r<rV�sz#BufferedIncrementalEncoder.setstateN)rD)F)	rCr>r?rNrYr#rQrSrVr;r;r;r<rW�s

rWc@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)rrDcCs
||_dSr1)rIrMr;r;r<rNszIncrementalDecoder.__init__FcCst�dSr1rErOr;r;r<r$szIncrementalDecoder.decodecCsdSr1r;rAr;r;r<rQszIncrementalDecoder.resetcCsdS)N)�rr;rAr;r;r<rSszIncrementalDecoder.getstatecCsdSr1r;rTr;r;r<rV'szIncrementalDecoder.setstateN)rD)F)rCr>r?rNr$rQrSrVr;r;r;r<r�s



c@s@eZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�ZdS)�BufferedIncrementalDecoderrDcCst�||�d|_dS�Nr_)rrNrLrMr;r;r<rN5sz#BufferedIncrementalDecoder.__init__cCst�dSr1rErXr;r;r<�_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrbrIrZr;r;r<r$?s
z!BufferedIncrementalDecoder.decodecCst�|�d|_dSra)rrQrLrAr;r;r<rQGs
z BufferedIncrementalDecoder.resetcCs
|jdfSrRr^rAr;r;r<rSKsz#BufferedIncrementalDecoder.getstatecCs|d|_dSrRr^rTr;r;r<rVOsz#BufferedIncrementalDecoder.setstateN)rD)F)	rCr>r?rNrbr$rQrSrVr;r;r;r<r`/s

r`c@sTeZdZddd�Zdd�Zdd�Zdd	�Zddd�Zefd
d�Z	dd�Z
dd�ZdS)rrDcCs||_||_dSr1)�streamrI�r:rcrIr;r;r<rN\szStreamWriter.__init__cCs"|�||j�\}}|j�|�dSr1)r#rIrc�write)r:�objectr[r]r;r;r<reuszStreamWriter.writecCs|�d�|��dSrJ)re�join�r:�listr;r;r<�
writelines|szStreamWriter.writelinescCsdSr1r;rAr;r;r<rQ�s
zStreamWriter.resetrcCs*|j�||�|dkr&|dkr&|��dSrR�rc�seekrQ�r:�offset�whencer;r;r<rl�szStreamWriter.seekcCs||j|�Sr1�rc�r:r4�getattrr;r;r<�__getattr__�szStreamWriter.__getattr__cCs|Sr1r;rAr;r;r<�	__enter__�szStreamWriter.__enter__cCs|j��dSr1�rc�close�r:�type�value�tbr;r;r<�__exit__�szStreamWriter.__exit__N)rD)r)rCr>r?rNrerjrQrlrrrsrtr{r;r;r;r<rZs

�
c@s�eZdZeZddd�Zd dd�Zd!dd	�Zd"dd
�Zd#dd�Z	dd�Z
d$dd�Zdd�Zdd�Z
efdd�Zdd�Zdd�Zd
S)%rrDcCs.||_||_d|_|��|_|j|_d|_dSra)rcrI�
bytebuffer�charbuffertype�_empty_charbuffer�
charbuffer�
linebufferrdr;r;r<rN�s
zStreamReader.__init__cCst�dSr1rErGr;r;r<r$�szStreamReader.decode���Fc
CsN|jr|j�|j�|_d|_|dkr(|}|dkrBt|j�|krB�q|dkrV|j��}n|j�|�}|j|}|st�qz|�||j	�\}}Wn`t
k
r�}zB|r�|�|d|j�|j	�\}}|jdd�}	t|	�dkrڂn�W5d}~XYnX||d�|_|j|7_|s(�qq(|dk�r,|j}
|j|_n|jd|�}
|j|d�|_|
S)NrT��keepends�)
r�r~rgr�lenrc�readr|r$rI�UnicodeDecodeError�start�
splitlines)r:�size�chars�	firstline�newdatar[�newchars�decodedbytes�exc�linesr\r;r;r<r��sD
�

zStreamReader.readNTc	Cs�|jrP|jd}|jd=t|j�dkr8|jd|_d|_|sL|jdd�d}|S|pVd}|j}|j|dd�}|r�t|t�r�|�d�s�t|t	�r�|�d	�r�||jddd
�7}||7}|jdd�}|�r�t|�dk�r8|d}|d=t|�dk�r|d|j7<||_d|_n|d|j|_|�s�|jdd�d}�q�|d}|djdd�d}||k�r�|j�
|dd��|j|_|�r�|}n|}�q�|�r�|dk	�r�|�r�|�s�|jdd�d}�q�|dkr^|d
9}q^|S)Nrr�Fr��HT)r��
�
)r�r�r�i@�)r�r�rr�r~r��
isinstance�str�endswith�bytesrg)	r:r�r��line�readsizer[r��line0withend�line0withoutendr;r;r<�readlinesd
��
�
zStreamReader.readlinecCs|��}|�|�Sr1)r�r�)r:�sizehintr�r[r;r;r<�	readlines^szStreamReader.readlinescCsd|_|j|_d|_dSra)r|r~rr�rAr;r;r<rQms	zStreamReader.resetrcCs|j�||�|��dSr1rkrmr;r;r<rlzszStreamReader.seekcCs|��}|r|St�dSr1)r��
StopIteration)r:r�r;r;r<�__next__�szStreamReader.__next__cCs|Sr1r;rAr;r;r<�__iter__�szStreamReader.__iter__cCs||j|�Sr1rprqr;r;r<rs�szStreamReader.__getattr__cCs|Sr1r;rAr;r;r<rt�szStreamReader.__enter__cCs|j��dSr1rurwr;r;r<r{�szStreamReader.__exit__)rD)rD)r�r�F)NT)NT)r)rCr>r?r�r}rNr$r�r�r�rQrlr�r�rrrsrtr{r;r;r;r<r�s


P
K

�
c@s�eZdZdZd dd�Zd!dd�Zd"d	d
�Zd#dd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zd$dd�Z
efdd�Zdd�Zdd�ZdS)%r�unknownrDcCs(||_|||�|_|||�|_||_dSr1)rc�reader�writerrI)r:rc�Reader�WriterrIr;r;r<rN�s
zStreamReaderWriter.__init__r�cCs|j�|�Sr1)r�r��r:r�r;r;r<r��szStreamReaderWriter.readNcCs|j�|�Sr1)r�r�r�r;r;r<r��szStreamReaderWriter.readlinecCs|j�|�Sr1)r�r�)r:r�r;r;r<r��szStreamReaderWriter.readlinescCs
t|j�Sr1)�nextr�rAr;r;r<r��szStreamReaderWriter.__next__cCs|Sr1r;rAr;r;r<r��szStreamReaderWriter.__iter__cCs|j�|�Sr1)r�re)r:r[r;r;r<re�szStreamReaderWriter.writecCs|j�|�Sr1)r�rjrhr;r;r<rj�szStreamReaderWriter.writelinescCs|j��|j��dSr1�r�rQr�rAr;r;r<rQ�s
zStreamReaderWriter.resetrcCs6|j�||�|j��|dkr2|dkr2|j��dSrR)rcrlr�rQr�rmr;r;r<rl�s
zStreamReaderWriter.seekcCs||j|�Sr1rprqr;r;r<rs�szStreamReaderWriter.__getattr__cCs|Sr1r;rAr;r;r<rt�szStreamReaderWriter.__enter__cCs|j��dSr1rurwr;r;r<r{�szStreamReaderWriter.__exit__)rD)r�)N)N)r)rCr>r?�encodingrNr�r�r�r�r�rerjrQrlrrrsrtr{r;r;r;r<r�s




�
	c@s�eZdZdZdZd dd�Zd!dd�Zd"d	d
�Zd#dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d$dd�Zefdd�Zdd�Zdd�ZdS)%rr�rDcCs4||_||_||_|||�|_|||�|_||_dSr1)rcr#r$r�r�rI)r:rcr#r$r�r�rIr;r;r<rNszStreamRecoder.__init__r�cCs"|j�|�}|�||j�\}}|Sr1)r�r�r#rI�r:r�r[�bytesencodedr;r;r<r�#szStreamRecoder.readNcCs6|dkr|j��}n|j�|�}|�||j�\}}|Sr1)r�r�r#rIr�r;r;r<r�)s
zStreamRecoder.readlinecCs(|j��}|�||j�\}}|jdd�S)NTr�)r�r�r#rIr�)r:r�r[r�r;r;r<r�2s
zStreamRecoder.readlinescCs t|j�}|�||j�\}}|Sr1)r�r�r#rI)r:r[r�r;r;r<r�8s
zStreamRecoder.__next__cCs|Sr1r;rAr;r;r<r�?szStreamRecoder.__iter__cCs|�||j�\}}|j�|�Sr1)r$rIr�re)r:r[�bytesdecodedr;r;r<reBszStreamRecoder.writecCs(d�|�}|�||j�\}}|j�|�Sra)rgr$rIr�re)r:rir[r�r;r;r<rjGs
zStreamRecoder.writelinescCs|j��|j��dSr1r�rAr;r;r<rQMs
zStreamRecoder.resetrcCs |j�||�|j�||�dSr1)r�rlr�rmr;r;r<rlRszStreamRecoder.seekcCs||j|�Sr1rprqr;r;r<rsXszStreamRecoder.__getattr__cCs|Sr1r;rAr;r;r<rt_szStreamRecoder.__enter__cCs|j��dSr1rurwr;r;r<r{bszStreamRecoder.__exit__)rD)r�)N)N)r)rCr>r?�
data_encoding�
file_encodingrNr�r�r�r�r�rerjrQrlrrrsrtr{r;r;r;r<r�s"�


	

�
�rrDr�cCst|dk	rd|kr|d}t�|||�}|dkr2|Sz&t|�}t||j|j|�}||_|WS|���YnXdS)N�b)�builtinsrrrr8r7r�rv)�filename�moder�rI�	buffering�file�info�srwr;r;r<rgs�cCsF|dkr|}t|�}t|�}t||j|j|j|j|�}||_||_|Sr1)rrr#r$r8r7r�r�)r�r�r�rI�	data_info�	file_info�srr;r;r<r�s�cCs
t|�jSr1)rr#�r�r;r;r<r�scCs
t|�jSr1)rr$r�r;r;r<r�scCst|�j}|dkrt|��|Sr1)rr5�LookupError)r��encoderr;r;r<r�s	
cCst|�j}|dkrt|��|Sr1)rr6r�)r��decoderr;r;r<r �s	
cCs
t|�jSr1)rr8r�r;r;r<r!�scCs
t|�jSr1)rr7r�r;r;r<r"�scksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)NrKT)rr#)�iteratorr�rI�kwargsr�rH�outputr;r;r<r%s	
cksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)Nr_T)r r$)r�r�rIr�r�rHr�r;r;r<r&s	
cCsdd�|D�S)NcSsi|]
}||�qSr;r;)�.0�ir;r;r<�
<dictcomp>/sz&make_identity_dict.<locals>.<dictcomp>r;)�rngr;r;r<�make_identity_dict'sr�cCs4i}|��D]"\}}||kr&|||<qd||<q|Sr1)�items)�decoding_map�m�k�vr;r;r<�make_encoding_map1s


r��ignore�replace�xmlcharrefreplace�backslashreplace�namereplace�__main__zlatin-1zutf-8)r�NrDr�)NrD)rD)rD);r��sys�_codecs�ImportErrorZwhy�SystemError�__all__rr	rrrrr�	byteorderrrrrr
r
rr2rrrfrrWrr`rrrrrrrrrr r!r"r%r&r�r�r.r'r(r)r*r+r,r��_falseZ	encodingsrC�stdout�stdinr;r;r;r<�<module>
s��
B("1+IzWt
0
&








enum.cpython-38.opt-1.pyc000064400000062554151450073350011116 0ustar00U

e5d���@s�ddlZddlmZmZddddddd	gZd
d�Zdd
�Zdd�Zdd�Ze	�Z
Gdd�d�ZGdd�de�Z
dZGdd�de�ZGdd�ded�ZGdd�dee�Zdd�ZGdd�de�ZGdd�dee�Zdd�Zdd	�Zd d!�Zd"d#�ZdS)$�N)�MappingProxyType�DynamicClassAttribute�EnumMeta�Enum�IntEnum�Flag�IntFlag�auto�uniquecCst|d�pt|d�pt|d�S)z?
    Returns True if obj is a descriptor, False otherwise.
    �__get__�__set__�
__delete__)�hasattr)�obj�r�/usr/lib64/python3.8/enum.py�_is_descriptors

��rcCsLt|�dkoJ|dd�|dd�ko.dknoJ|ddkoJ|ddkS)z=
    Returns True if a __dunder__ name, False otherwise.
    �N�����__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dkoJ|d|dko&dknoJ|dd�dkoJ|dd�dkS)z;
    Returns True if a _sunder_ name, False otherwise.
    rr���r�rrrrrr�
_is_sunder!s���r cCsdd�}||_d|_dS)z,
    Make the given class un-picklable.
    cSstd|��dS)Nz%r cannot be pickled)�	TypeError��self�protorrr�_break_on_call_reduce0sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>N)�
__reduce_ex__�
__module__)�clsr%rrr�_make_class_unpicklable,sr)c@seZdZdZeZdS)r	zP
    Instances are replaced with an appropriate value in Enum class suites.
    N)�__name__r'�__qualname__�__doc__�
_auto_null�valuerrrrr	6scs,eZdZdZ�fdd�Z�fdd�Z�ZS)�	_EnumDictz�
    Track enum member order and ensure member names are not reused.

    EnumMeta will use the names found in self._member_names as the
    enumeration member names.
    cs&t���g|_g|_g|_d|_dS)NF)�super�__init__�
_member_names�_last_values�_ignore�_auto_called�r#��	__class__rrr1Ds

z_EnumDict.__init__csdt|�r�|dkrtd��|dkr<|jr.td��t|d|�nV|dkr�t|t�r`|�dd���}nt	|�}||_
t|�t|j�@}|r�td	|f��n�t
|�r�|d
kr�d}n�||jkr�td|��n�||j
kr�n�t|��sR||kr�td
|||f��t|t��r:|jtk�r4|�|dt|j�|jdd��|_d|_|j}|j�|�|j�|�t��||�dS)z�
        Changes anything not dundered or not a descriptor.

        If an enum member name is used twice, an error is raised; duplicate
        values are not checked for.

        Single underscore (sunder) names are reserved.
        )�_order_�_create_pseudo_member_�_generate_next_value_�	_missing_�_ignore_z(_names_ are reserved for future Enum user;z4_generate_next_value_ must be defined before members�_generate_next_valuer=�,� z-_ignore_ cannot specify already set names: %r�	__order__r9zAttempted to reuse key: %rz%r already defined as: %rrNT)r �
ValueErrorr5r!�setattr�
isinstance�str�replace�split�listr4�setr2rrr	r.r-r>rr3�appendr0�__setitem__)r#�keyr.�alreadyr7rrrKKsT	
��


�z_EnumDict.__setitem__)r*r'r+r,r1rK�
__classcell__rrr7rr/=sr/cs�eZdZdZedd��Z�fdd�Zdd�Zd/dddd	d
�dd�Zd
d�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��Zdd�Zdd �Z�fd!d"�Zdddd	d
�d#d$�Zd0d%d&�Zd'd(�Zed)d*��Zed+d,��Zed-d.��Z�ZS)1rz
    Metaclass for Enum
    cCs>|�||�t�}|�||�\}}|dk	r:t|dd�|d<|S)Nr;)�_check_for_existing_membersr/�_get_mixins_�getattr)�metaclsr(�bases�	enum_dict�member_type�
first_enumrrr�__prepare__�s�zEnumMeta.__prepare__c	s��dg��d��d}|D]}��|d�q|�||�\�}|���|�\}}}	�fdd��jD�}
�jD]
}�|=qn��dd�}t|
�ddh@}
|
r�td�d�	|
����d	�kr�d
�d	<t
��|||��}g|_i|_
�|_dd�|��D�}i|_d
�k�r2�tk	�r2d}t�fdd�|D���s2t|��jD�]*}|
|}t|t��sZ|f}n|}�tk�rn|f}|	�s�||�}t|d��s�||_n6||f|��}t|d��sƈtk�r�||_n
�|�|_|j}||_||_|j|�|j
��D]"\}}|j|jk�r�|}�q�q�|j�|�||k�r2t|||�||j
|<z||j|<Wntk
�r`YnX�q8dD]V}|�k�r|�qjt||�}t�|d�}t||d�}|dk	�rj||k�rjt|||��qjtdk	�r�|�r�||_ tj|_|dk	�rt|t!��r|�"dd��#�}||jk�rtd��|S)Nr=csi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>�sz$EnumMeta.__new__.<locals>.<dictcomp>r9�mro�zInvalid enum member name: {0}r?r,zAn enumeration.cSs.h|]&}|j��D]\}}t|t�r|�qqSr)�__dict__�itemsrDr)rX�crY�vrrr�	<setcomp>�s

�z#EnumMeta.__new__.<locals>.<setcomp>r&)�__getnewargs_ex__�__getnewargs__r&�
__reduce__c3s|]}|�jkVqdS�N)r^�rX�m)rUrr�	<genexpr>�sz#EnumMeta.__new__.<locals>.<genexpr>�_value_)�__repr__�__str__�
__format__r&r@z#member order does not match _order_)$�
setdefaultrJ�poprP�
_find_new_r2rIrB�format�joinr0�__new__�_member_names_�_member_map_�
_member_type_r\�_value2member_map_�object�anyr)rD�tuplerrj�_name_�__objclass__r1r_rCr!rQr�__new_member__rErFrG)rRr(rSrZ�ignorerLrVrs�save_new�use_args�enum_membersrr9�
invalid_names�
enum_class�dynamic_attributes�methods�member_namer.�args�enum_member�canonical_member�class_method�
obj_method�enum_methodr7)rZrUrrs�s��

��













zEnumMeta.__new__cCsdS)z6
        classes/types should always be True.
        Trr6rrr�__bool__3szEnumMeta.__bool__Nr��module�qualname�type�startcCs*|dkr|�||�S|j||||||d�S)a!
        Either returns an existing member, or creates a new enum class.

        This method is used both when an enum class is given a value to match
        to an enumeration member (i.e. Color(3)) and for the functional API
        (i.e. Color = Enum('Color', names='RED GREEN BLUE')).

        When used for the functional API:

        `value` will be the name of the new class.

        `names` should be either a string of white-space/comma delimited names
        (values will start at `start`), or an iterator/mapping of name, value pairs.

        `module` should be set to the module this class is being created in;
        if it is not set, an attempt to find that module will be made, but if
        it fails the class will not be picklable.

        `qualname` should be set to the actual location this class can be found
        at in its module; by default it is set to the global scope.  If this is
        not correct, unpickling will fail in some circumstances.

        `type`, if set, will be mixed in as the first base class.
        Nr�)rs�_create_)r(r.�namesr�r�r�r�rrr�__call__9s�zEnumMeta.__call__cCs:t|t�s$tdt|�j|jjf��t||�o8|j|jkS)N�3unsupported operand type(s) for 'in': '%s' and '%s')rDrr!r�r+r8r{ru)r(�memberrrr�__contains__^s
��zEnumMeta.__contains__cs(||jkrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)ru�AttributeErrorr*r0�__delattr__)r(�attrr7rrr�es
zEnumMeta.__delattr__cCsddddg|jS)Nr8r,�__members__r'�rtr6rrr�__dir__ls
��zEnumMeta.__dir__cCs@t|�rt|��z|j|WStk
r:t|�d�YnXdS)a=
        Return the enum member matching `name`

        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.
        N)rr�ru�KeyError�r(rrrr�__getattr__rs	zEnumMeta.__getattr__cCs
|j|Srf�rur�rrr�__getitem__�szEnumMeta.__getitem__cs�fdd��jD�S)z6
        Returns members in definition order.
        c3s|]}�j|VqdSrfr��rXr�r(rrri�sz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cCs
t|j�Srf)rrtr�rrr�__len__�szEnumMeta.__len__cCs
t|j�S)z�
        Returns a mapping of member name->value.

        This mapping lists all enum members, including aliases. Note that this
        is a read-only view of the internal mapping.
        )rrur�rrrr��szEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r*r�rrrrk�szEnumMeta.__repr__cs�fdd�t�j�D�S)z>
        Returns members in reverse definition order.
        c3s|]}�j|VqdSrfr�r�r�rrri�sz(EnumMeta.__reversed__.<locals>.<genexpr>)�reversedrtr�rr�r�__reversed__�szEnumMeta.__reversed__cs0|j�di�}||krtd��t��||�dS)a
        Block attempts to reassign Enum members.

        A simple assignment to the class namespace only changes one of the
        several possible ways to get an Enum member from the Enum class,
        resulting in an inconsistent Enumeration.
        ruzCannot reassign members.N)r^�getr�r0�__setattr__)r(rr.�
member_mapr7rrr��szEnumMeta.__setattr__c
Cs~|j}|dkr|fn||f}|�||�\}	}
|�||�}t|t�rR|�dd���}t|ttf�r�|r�t|dt�r�|g}}g}
t	|�D]8\}}|
�
||||
dd��}|
�|�|�||f�q�|D].}t|t�r�|||}}n|\}}|||<q�|�||||�}|dk�rPzt
�d�jd}Wn*tttfk
�rN}zW5d}~XYnX|dk�rdt|�n||_|dk	�rz||_|S)a�
        Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are incremented by 1 from `start`.
        * An iterable of member names.  Values are incremented by 1 from `start`.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value pairs.
        Nr?r@rrr*)r8rPrWrDrErFrGrzrH�	enumerater;rJrs�sys�	_getframe�	f_globalsr�rBr�r)r'r+)r(�
class_namer�r�r�r�r�rRrSrrVrZ�original_names�last_values�countrr.�itemr��member_valuer��excrrrr��s<
 







zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z|jdd�d�Wn$tk
rn|jdd�d�YnX||||d�}t|_|�|j	�|||<|S)z[
        Create a new Enum subclass that replaces a collection of global constants
        cs g|]\}}�|�r||f�qSrr)rXrr.��filterrr�
<listcomp>�s�z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>��z$EnumMeta._convert_.<locals>.<lambda>)rLcSs|dS�Nrrr�rrrr��r�)r�)
�varsr��modulesr_�sortr!�_reduce_ex_by_namer&�updater�)r(rr�r��source�module_globals�membersrr�r�	_convert_�s 	

�zEnumMeta._convert_cOs$ddl}|jdtdd�|j||�S)NrzI_convert is deprecated and will be removed in 3.9, use _convert_ instead.r)�
stacklevel)�warnings�warn�DeprecationWarningr�)r(r��kwargsr�rrr�_converts�zEnumMeta._convertcCs<|D]2}|jD]&}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)�__mro__�
issubclassrrtr!r*)r�rS�chain�baserrrrO
s
��z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�s2td��||�p<t}|jrLtd��||fS)z�
        Returns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__
        cs�g}|D]t}d}|jD]d}|tkr&qqt|t�rL|jtk	rz|�|j�qqd|jkrvt|t�rbq|�|pl|�qq|}qqt|�dkr�td�|f��n|r�|dSdSdS)Nrsrz%r: too many data types: %rr)	r�rxr�rrvrJr^rr!)rS�
data_typesr��	candidater��r�rr�_find_data_types*




z.EnumMeta._get_mixins_.<locals>._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rxrr�r!rt)r�rSr�rVrUrr�rrPs
zEnumMeta._get_mixins_c	Cs�|�dd�}|dk	}|dkrpdD]H}||fD].}t||d�}|ddjtjtjhkr,|}q\q,|dk	r qpq tj}|tjkr�d}nd}|||fS)a
        Returns the __new__ to be used for creating the enum members.

        classdict: the class dictionary given to __new__
        member_type: the data type whose __new__ will be used by default
        first_enum: enumeration to check for an overriding __new__
        rsN)r}rsFT)r�rQrsrxr)	rZrUrVrsr�method�possible�targetr�rrrrpCs*�
zEnumMeta._find_new_)N)N)r*r'r+r,�classmethodrWrsr�r�r�r�r�r�r�r�r��propertyr�rkr�r�r�r�r��staticmethodrOrPrprNrrr7rr�s8

%
	
5
!
	
.c@steZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
edd��Zedd��ZdS)rzV
    Generic enumeration.

    Derive from this class to define new enumerations.
    c
Cst|�|kr|Sz|j|WStk
r0Yn:tk
rh|j��D]}|j|krH|YSqHYnXzd}|�|�}Wn*tk
r�}z|}d}W5d}~XYnXzdt	||�r�|W�TSt
d||jf�}|dkr�|dkr�|�n|dk�rtd|j|f�}||_|�W5d}d}XdS)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)
r�rwr�r!ru�valuesrjr<�	ExceptionrDrBr*�__context__)r(r.r�r��result�e�ve_excrrrrsws@


��zEnum.__new__c	Cs6t|�D](}z|dWStk
r.YqXq|S)��
        Generate the next value when not given.

        name: the name of the member
        start: the initial start value or None
        count: the number of existing members
        last_value: the last value assigned or None
        rN)r�r!)rr�r�r��
last_valuerrrr;�s	zEnum._generate_next_value_cCsdSrfr)r(r.rrrr<�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r8r*r{rjr6rrrrk�s
�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r8r*r{r6rrrrl�szEnum.__str__cs6�fdd��j��D�dd��jD�}dddg|S)z<
        Returns all members and all public methods
        cs2g|]*}|jD]}|ddkr|�jkr|�qqS�rr)r^ru)rXr(rhr6rrr��s
�z Enum.__dir__.<locals>.<listcomp>cSsg|]}|ddkr|�qSr�rrgrrrr��sr8r,r')r8r\r^)r#�added_behaviorrr6rr��s
��zEnum.__dir__cCsJt|�jtjtjfk}|jtks$|r2t}t|�}n|j}|j}|�||�S)z\
        Returns format using actual value type unless __str__ has been overridden.
        )	r�rlrrrvrxrErjrm)r#�format_spec�str_overriddenr(�valrrrrm�s	
zEnum.__format__cCs
t|j�Srf)�hashr{r6rrr�__hash__�sz
Enum.__hash__cCs|j|jffSrf�r8rjr"rrrr&�szEnum.__reduce_ex__cCs|jS)zThe name of the Enum member.)r{r6rrrr�sz	Enum.namecCs|jS)zThe value of the Enum member.�rjr6rrrr.�sz
Enum.valueN)r*r'r+r,rsr;r�r<rkrlr�rmr�r&rrr.rrrrrqs-


)�	metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r*r'r+r,rrrrr�scCs|jSrfrr"rrrr��sr�c@speZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz
    Support for flags
    c	Csd|s|dk	r|SdSt|�D]:}zt|�}WqXWqtk
rTtd|�d�YqXqd|dS)r�NrzInvalid Flag value: %rr)r��	_high_bitr�r!)rr�r�r�r��high_bitrrrr;s	
zFlag._generate_next_value_cCs.|}|dkr|}|�|�}|dkr*|}|S)�V
        Returns member (possibly creating it) if one can be found for value.
        r)r:)r(r.�original_value�possible_memberrrrr<s
zFlag._missing_cCsb|j�|d�}|dkr^t||�\}}|r:td||jf��t�|�}d|_||_|j�	||�}|S)�L
        Create a composite member iff value contains only members.
        Nr�)
rwr��
_decomposerBr*rxrsr{rjrn)r(r.�
pseudo_memberr�extra_flagsrrrr:#s
zFlag._create_pseudo_member_cCs8t||j�s&tdt|�j|jjf��|j|j@|jkS)zP
        Returns True if self has at least the same flags set as other.
        r�)rDr8r!r�r+rj�r#�otherrrrr�7s��zFlag.__contains__cCsV|j}|jdk	r$d|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cSsg|]}t|jp|j��qSr�rEr{rjrgrrrr�Hsz!Flag.__repr__.<locals>.<listcomp>)r8r{r*rjr�rr�r#r(r��	uncoveredrrrrkAs
�z
Flag.__repr__cCs�|j}|jdk	r d|j|jfSt||j�\}}t|�dkr^|djdkr^d|j|djfSd|jd�dd�|D��fSdS)Nr�rrz%s.%rr�cSsg|]}t|jp|j��qSrr�rgrrrr�Vsz Flag.__str__.<locals>.<listcomp>)r8r{r*r�rjrrrr�rrrrlLs
�zFlag.__str__cCs
t|j�Srf)�boolrjr6rrrr�Ysz
Flag.__bool__cCs"t||j�stS|�|j|jB�Srf�rDr8�NotImplementedrjr�rrr�__or__\szFlag.__or__cCs"t||j�stS|�|j|j@�Srfrr�rrr�__and__aszFlag.__and__cCs"t||j�stS|�|j|jA�Srfrr�rrr�__xor__fszFlag.__xor__cCsNt|j|j�\}}|�d�}|jD] }||kr"|j|j@s"||B}q"|�|�Sr�)r�r8rj)r#r�r�invertedrhrrr�
__invert__ks


zFlag.__invert__N)r*r'r+r,r;r�r<r:r�rkrlr�rrrrrrrrr�s



c@sTeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	eZ
eZe	Zdd
�Z
dS)rz)
    Support for integer-based Flags
    cCs*t|t�std||jf��|�|�}|S)r�r�)rD�intrBr*r:)r(r.�
new_memberrrrr<ys

zIntFlag._missing_cCs�|j�|d�}|dkr�|g}t||�\}}|rtt|�}d|}||jkrZ||krZ|�|�||krjd}q*||N}q*t|�D]*}t�||�}d|_||_	|j�
||�}q||S)r�Nrr)rwr�r�r�rJr�r	rsr{rjrn)r(r.r��need_to_createrr��bit�
flag_valuerrrr:�s(
�


zIntFlag._create_pseudo_member_cCs0t||jtf�stS|�|j|�|�jB�}|Srf�rDr8r	rrj)r#r�r�rrrr�szIntFlag.__or__cCs,t||jtf�stS|�|j|�|�j@�Srfrr�rrrr�szIntFlag.__and__cCs,t||jtf�stS|�|j|�|�jA�Srfrr�rrrr�szIntFlag.__xor__cCs|�|j�}|Srfr�)r#r�rrrr�szIntFlag.__invert__N)r*r'r+r,r�r<r:rrr�__ror__�__rand__�__rxor__rrrrrrts
	
 cCs|��dS)zJ
    returns index of highest bit, or -1 if value is zero or negative
    r)�
bit_length�r.rrrr��sr�cCs^g}|j��D]"\}}||jkr|�||jf�q|rZd�dd�|D��}td||f��|S)zI
    Class decorator for enumerations ensuring unique member values.
    z, cSsg|]\}}d||f�qS)z%s -> %sr)rX�aliasrrrrr��szunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�r_rrJrrrB)�enumeration�
duplicatesrr��
alias_detailsrrrr
�s
��cCs�|}|dk}|r*dd�t|j���D�}ndd�t|j���D�}g}|D],\}}|rJ||@|krJ|�|�||M}qJ|s�||jkr�|�|j|�|jdd�dd�t|�d	kr�|dj|kr�|�d�||fS)
z-
    Extract all members from the value.
    rcSs"g|]\}}|jdk	r||f�qSrfr�rXrarhrrrr��s
�z_decompose.<locals>.<listcomp>cSs*g|]"\}}|jdk	st|�r||f�qSrf)r�
_power_of_tworrrrr��s
�cSs|jSrfr�)rhrrrr��r�z_decompose.<locals>.<lambda>T)rL�reverser)rHrwr_rJr�rr.ro)�flagr.�not_covered�negative�flags_to_checkr�r�r�rrrr��s(��

r�cCs|dkrdS|dt|�kS)NrFr)r�rrrrr�sr)r��typesrr�__all__rrr r)rxr-r	�dictr/rr�rr	rr�rrr�r
r�rrrrr�<module>s>�
	LivI%shlex.cpython-38.opt-2.pyc000064400000015505151450073350011270 0ustar00U

e5d
4�	@s�ddlZddlZddlZddlmZddlmZddddgZGdd�d�Zddd�Z	dd�Z
e�d
ej�j
Zdd�Zdd�Zedkr�eej�dkr�ee��n,ejdZee��Zeeee��W5QRXdS)�N)�deque)�StringIO�shlex�split�quote�joinc@sneZdZddd�Zedd��Zdd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zddd�Zdd�Z
dd�ZdS)rNFcCst|t�rt|�}|dk	r(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
|jrn|j
d7_
d|_d|_d|_
d|_d	|_d
|_t�|_d|_d|_d|_t�|_d|_|s�d}n|d
kr�d}||_|�rt�|_|j
d7_
|j
�t�|��}|j
�|�|_
dS)N��#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"�\�"� �rTz();<>|&z~-./*?=)�
isinstance�strr�instream�infile�sys�stdin�posix�eof�
commenters�	wordchars�
whitespace�whitespace_split�quotes�escape�
escapedquotes�stater�pushback�lineno�debug�token�	filestack�source�_punctuation_chars�_pushback_chars�	maketrans�dict�fromkeys�	translate)�selfrrr�punctuation_chars�t�r-�/usr/lib64/python3.8/shlex.py�__init__sJ
zshlex.__init__cCs|jS�N)r$�r*r-r-r.r+Dszshlex.punctuation_charscCs*|jdkrtdt|��|j�|�dS)Nr
zshlex: pushing token )r �print�reprr�
appendleft)r*�tokr-r-r.�
push_tokenHs
zshlex.push_tokencCspt|t�rt|�}|j�|j|j|jf�||_||_d|_|jrl|dk	r\t	d|jf�nt	d|jf�dS)Nr
zshlex: pushing to file %szshlex: pushing to stream %s)
rrrr"r4rrrr r2)r*�	newstream�newfiler-r-r.�push_sourceNs
zshlex.push_sourcecCsD|j��|j��\|_|_|_|jr:td|j|jf�d|_dS)Nzshlex: popping to %s, line %dr)	r�closer"�popleftrrr r2rr1r-r-r.�
pop_source\s

�zshlex.pop_sourcecCs�|jr.|j��}|jdkr*tdt|��|S|��}|jdk	rz||jkrz|�|���}|rp|\}}|�||�|�	�}q@||j
kr�|js�|j
S|��|�	�}qz|jdkr�||j
kr�tdt|��ntd�|S)Nr
zshlex: popping token z
shlex: token=zshlex: token=EOF)
rr;r r2r3�
read_tokenr#�
sourcehookr9�	get_tokenrr"r<)r*r5�raw�specr8r7r-r-r.r?es.








zshlex.get_tokencCs�d}d}|jr |jr |j��}n|j�d�}|dkrB|jd7_|jdkr^td|j|f�|jdkrtd|_	�q�q|jdk�r�|s�d|_�q��q�||j
kr�|jdkr�td	�|j	s�|jr|r�q�nqn�||jkr�|j�
�|jd7_n�|j�r||jk�rd
}||_n�||jk�r&||_	d
|_nr||jk�r@||_	d|_nX||jk�rb|j�sZ||_	||_n6|j�rx||_	d
|_n ||_	|j	�s�|jr|r�q�nqq|j|jk�rDd}|�s�|jdk�r�td
�td��||jk�r|j�s�|j	|7_	d|_�q�nd
|_n>|j�r4||jk�r4|j|jk�r4|j}||_n|j	|7_	q|j|jk�r�|�st|jdk�rltd�td��||jk�r�||jk�r�||k�r�|j	|j7_	|j	|7_	||_q|jdkr|�s�d|_�q�q||j
k�r|jdk�r�td�d|_|j	�s�|jr|r�q�nqq||jk�rh|j�
�|jd7_|j�r�d|_|j	�s�|jr|r�q�nqq|jdk�r�||jk�r�|j	|7_	n"||j
k�r�|j�|�d|_�q�q|j�r�||jk�r�||_q|j�r�||jk�r�d
}||_q||jk�s||jk�s|j�r,||jk�r,|j	|7_	q|j�rB|j�|�n|j�|�|jdk�rbtd�d|_|j	�s�|jr|r�q�qqq|j	}d|_	|j�r�|�s�|dk�r�d}|jdk�r�|�r�tdt|��ntd�|S)NFrr
�
�z&shlex: in state %r I see character: %rr�z+shlex: I see whitespace in whitespace state�a�cTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rErFz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r+r%�popr�readrr r2rr!rrr�readlinerrrr�
ValueErrorr�appendrr4r3)r*ZquotedZescapedstateZnextchar�resultr-r-r.r=�s

�




���

��zshlex.read_tokencCsV|ddkr|dd�}t|jt�rHtj�|�sHtj�tj�|j�|�}|t|d�fS)Nrrr
����r)	rrr�os�path�isabsr�dirname�open)r*r8r-r-r.r>s
zshlex.sourcehookcCs(|dkr|j}|dkr|j}d||fS)Nz"%s", line %d: )rr)r*rrr-r-r.�error_leader s
zshlex.error_leadercCs|Sr0r-r1r-r-r.�__iter__(szshlex.__iter__cCs|��}||jkrt�|Sr0)r?r�
StopIteration)r*r!r-r-r.�__next__+s
zshlex.__next__)NNFF)N)NN)�__name__�
__module__�__qualname__r/�propertyr+r6r9r<r?r=r>rTrUrWr-r-r-r.rs�
/

	 	
FTcCs$t||d�}d|_|sd|_t|�S)N)rTr)rrr�list)�sZcommentsrZlexr-r-r.r1s
cCsd�dd�|D��S)Nrcss|]}t|�VqdSr0)r)�.0�argr-r-r.�	<genexpr><szjoin.<locals>.<genexpr>)r)Z
split_commandr-r-r.r:sz[^\w@%+=:,./-]cCs,|sdSt|�dkr|Sd|�dd�dS)Nz''�'z'"'"')�_find_unsafe�replace)r]r-r-r.rAs
cCs$|��}|sq tdt|��qdS)NzToken: )r?r2r3)ZlexerZttr-r-r.�
_print_tokensMsrd�__main__r
)FT)rO�rer�collectionsr�ior�__all__rrr�compile�ASCII�searchrbrrdrX�len�argv�fnrS�fr-r-r-r.�<module>
s& 
	

sched.cpython-38.opt-1.pyc000064400000014606151450073350011233 0ustar00U

e5d*�@s�dZddlZddlZddlmZddlZddlmZdgZGdd�dedd��Z	d	e	j_d
e	j
_de	j_de	j_d
e	j
_e�ZGdd�d�ZdS)a�A generally useful event scheduler class.

Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.

Each instance is parametrized with two functions, one that is
supposed to return the current time, one that is supposed to
implement a delay.  You can implement real-time scheduling by
substituting time and sleep from built-in module time, or you can
implement simulated time by writing your own functions.  This can
also be used to integrate scheduling with STDWIN events; the delay
function is allowed to modify the queue.  Time can be expressed as
integers or floating point numbers, as long as it is consistent.

Events are specified by tuples (time, priority, action, argument, kwargs).
As in UNIX, lower priority numbers mean higher priority; in this
way the queue can be maintained as a priority queue.  Execution of the
event means calling the action function, passing it the argument
sequence in "argument" (remember that in Python, multiple function
arguments are be packed in a sequence) and keyword parameters in "kwargs".
The action function may be an instance method so it
has another way to reference private data (besides global variables).
�N)�
namedtuple)�	monotonic�	schedulerc@s8eZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�EventcCs|j|jf|j|jfkS�N��time�priority��s�o�r
�/usr/lib64/python3.8/sched.py�__eq__$�zEvent.__eq__cCs|j|jf|j|jfkSrrr
r
r
r�__lt__%rzEvent.__lt__cCs|j|jf|j|jfkSrrr
r
r
r�__le__&rzEvent.__le__cCs|j|jf|j|jfkSrrr
r
r
r�__gt__'rzEvent.__gt__cCs|j|jf|j|jfkSrrr
r
r
r�__ge__(rzEvent.__ge__N)	�__name__�
__module__�__qualname__�	__slots__rrrrrr
r
r
rr"srz(time, priority, action, argument, kwargszaNumeric type compatible with the return value of the
timefunc function passed to the constructor.zSEvents scheduled for the same time will be executed
in the order of their priority.z?Executing the event means executing
action(*argument, **kwargs)zGargument is a sequence holding the positional
arguments for the action.zDkwargs is a dictionary holding the keyword
arguments for the action.c@s^eZdZeejfdd�Zdefdd�Zdefdd�Z	dd	�Z
d
d�Zdd
d�Ze
dd��ZdS)rcCs g|_t��|_||_||_dS)zGInitialize a new instance, passing the time and delay
        functionsN)�_queue�	threading�RLock�_lock�timefunc�	delayfunc)�selfrrr
r
r�__init__9s
zscheduler.__init__r
c	Cs@|tkri}t|||||�}|j�t�|j|�W5QRX|S)z�Enter a new event in the queue at an absolute time.

        Returns an ID for the event which can be used to remove it,
        if necessary.

        )�	_sentinelrr�heapq�heappushr)rrr	�action�argument�kwargs�eventr
r
r�enterabsAszscheduler.enterabscCs|��|}|�|||||�S)z{A variant that specifies the time as a relative time.

        This is actually the more commonly used interface.

        )rr()r�delayr	r$r%r&rr
r
r�enterOszscheduler.enterc	Cs.|j�|j�|�t�|j�W5QRXdS)z�Remove an event from the queue.

        This must be presented the ID as returned by enter().
        If the event is not in the queue, this raises ValueError.

        N)rr�remover"�heapify)rr'r
r
r�cancelXszscheduler.cancelc
Cs&|j�|jW5QR�SQRXdS)z!Check whether the queue is empty.N)rr)rr
r
r�emptycszscheduler.emptyTc	Cs�|j}|j}|j}|j}tj}|�H|s4W5QR�q�|d\}}}	}
}|�}||krZd}
nd}
||�W5QRX|
r�|s�||S|||�q|	|
|�|d�qdS)aExecute events until the queue is empty.
        If blocking is False executes the scheduled events due to
        expire soonest (if any) and then return the deadline of the
        next scheduled call in the scheduler.

        When there is a positive delay until the first event, the
        delay function is called and the event is left in the queue;
        otherwise, the event is removed from the queue and executed
        (its action function is called, passing it the argument).  If
        the delay function returns prematurely, it is simply
        restarted.

        It is legal for both the delay function and the action
        function to modify the queue or to raise an exception;
        exceptions are not caught but the scheduler's state remains
        well-defined so run() may be called again.

        A questionable hack is added to allow other threads to run:
        just after an event is executed, a delay of 0 is executed, to
        avoid monopolizing the CPU when other threads are also
        runnable.

        rTFN)rrrrr"�heappop)rZblocking�lock�qrr�poprr	r$r%r&Znowr)r
r
r�runhs(
z
scheduler.runc	Cs:|j�|jdd�}W5QRXtttj|gt|���S)z�An ordered list of upcoming events.

        Events are named tuples with fields for:
            time, priority, action, arguments, kwargs

        N)rr�list�mapr"r/�len)rZeventsr
r
r�queue�szscheduler.queueN)T)rrr�_timer�sleepr r!r(r*r-r.r3�propertyr7r
r
r
rr7s	
2)�__doc__rr"�collectionsrrrr8�__all__rr	r$r%r&�objectr!rr
r
r
r�<module>sstringprep.cpython-38.opt-1.pyc000064400000025321151450073350012336 0ustar00U

e5du2��@s�dZddlmZdd�Zeddddd	d
ddd
ddgeedd���Zdd�Zddddddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCd<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdDdEdFdGdHdIdJdKdLdMdNdOdPdMddQdRdSdTdUdRdVddWdXdYddZd[d\d]d^d_d`dad^dbdcdddedfdgdgdgdhdhdidjdkdldmdndndndodpdqdrdrdsdcdtdudvdwd%dxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dcdxd�d�d�djd�dldmdd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdxdtdud�d�d�didvdjd�dldmdd�d�d�d�d�d�d�dsdxdtdud�dhd�d�didvd�dd�d�d�d�d�d�d�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�ddʐ��Z	d�d̄Z
d�d΄Zd�dЄZd�d҄Z
d�dԄZd�dքZed�d�d�dd
d�d�dgeedd܃�eed�dރ�eed�d��eed�d���Zd�d�Zd�d�Zd�d�Zd�d�Zd�d�Zeed�d��Zd�d�Zeed�d��Zd�d�Zed�d�d�d�geed�d���eed�dރ��Zd�d��Zed�geed�d����Zd��d�Z�d�d�Z�d�d�Z�dS(z�Library that exposes various tables found in the StringPrep RFC 3454.

There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
�)�	ucd_3_2_0cCsBt�|�dkrdSt|�}d|kr.dkr6nndS|d@dkS)NZCnF�������r)�unicodedata�category�ord��code�c�r�"/usr/lib64/python3.8/stringprep.py�in_table_a1sr�iOiiii
i i i
 i` i��i�i�cCst|�tkS�N)r
�b1_set�rrrr�in_table_b1sruμZssui̇uʼn�suǰuιu ιuΐuΰuσuβuθuυuύuϋuφuπuκuρuεuեւuẖuẗuẘuẙuaʾuṡuὐuὒuὔuὖuἀιuἁιuἂιuἃιuἄιuἅιuἆιuἇιuἠιuἡιuἢιuἣιuἤιuἥιuἦιuἧιuὠιuὡιuὢιuὣιuὤιuὥιuὦιuὧιuὰιuαιuάιuᾶuᾶιuὴιuηιuήιuῆuῆιuῒuῖuῗuῢuῤuῦuῧuὼιuωιuώιuῶuῶιZrsr
u°cuɛu°f�h�i�l�nZno�p�q�rZsmZtelZtm�z�b�e�f�muγ�dZhpaZauZovZpaZnauμaZmaZkaZkbZmbZgbZpfZnfuμf�hzZkhzZmhzZghzZthzZkpaZmpaZgpaZpvZnvuμvZmvZkvZpwZnwuμwZmw�kwukωumωZbquc∕kgzco.ZdbZgyZhpZkkZkmZphZppmZprZsv�wbZffZfiZflZffiZffl�stuմնuմեuմիuվնuմխ�a�g�j�k�o�t�u�v�w�x�yuαuδuζuηuλuνuξuοuτuχuψuω(����i0iIii�iEizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iPiRiTiVi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i� i!i!i!i	!i!i!i
!i!i!i!i!i!i!i!i!i!i!i !i!!i"!i$!i(!i,!i-!i0!i1!i3!i>!i?!iE!iq3is3iu3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i4�i5�i6�i7�i8�i9�i:�i;�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�ih�ii�ij�ik�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i�i�i�i	�i
�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i8�i9�i;�i<�i=�i>�i@�iA�iB�iC�iD�iF�iJ�iK�iL�iM�iN�iO�iP�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i �i!�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�iN�iO�iP�iQ�iR�iS�iT�iU�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i
�i�i�i�i�i �i!�i"�i#�i$�i%�i&�i'�i(�i)�i*�i+�i,�i-�i.�i/�i0�i1�i2�i3�i4�iG�iV�iW�iX�iY�iZ�i[�i\�i]�i^�i_�i`�ia�ib�ic�id�ie�if�ig�ih�ii�ij�ik�il�im�in�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��cCs"t�t|��}|dk	r|S|��Sr)�
b3_exceptions�getr
�lower)rrrrr�map_table_b3�sr8cCsHt|�}t�d|�}d�dd�|D��}t�d|�}||kr@|S|SdS)NZNFKC�cSsg|]}t|��qSr)r8)�.0Zchrrr�
<listcomp>�sz map_table_b2.<locals>.<listcomp>)r8rZ	normalize�join)r(ZalrZblr
rrr�map_table_b2�sr=cCs|dkS)N� rrrrr�in_table_c11�sr?cCst�|�dko|dkS)N�Zsr>�rr	rrrr�in_table_c12�srBcCst�|�dkS)Nr@rArrrr�in_table_c11_c12�srCcCst|�dkot�|�dkS)N��Cc)r
rr	rrrr�in_table_c21�srFi�iii( i) id ij ip i��i��is�i{�cCs.t|�}|dkrdSt�|�dkr&dS|tkS)NrDFrET)r
rr	�c22_specialsrrrr�in_table_c22�srHcCst�|�dkpt|�tkS)NrE)rr	r
rGrrrr�in_table_c21_c22�s
�rIcCst�|�dkS)NZCorArrrr�in_table_c3�srJcCs0t|�}|dkrdS|dkr dSt|�d@dkS)NrFrTrr)r
rrrr�in_table_c4�srKcCst�|�dkS)NZCsrArrrr�in_table_c5�srLrcCst|�tkSr)r
�c6_setrrrr�in_table_c6�srNi�/i�/cCst|�tkSr)r
�c7_setrrrr�in_table_c7�srPi@iAi i i* i/ cCst|�tkSr)r
�c8_setrrrr�in_table_c8srRii i�cCst|�tkSr)r
�c9_setrrrr�in_table_c9srTcCst�|�dkS)N)�RZAL�rZ
bidirectionalrrrr�in_table_d1srWcCst�|�dkS)N�LrVrrrr�in_table_d2srYN) �__doc__rrr�set�list�rangerrr5r8r=r?rBrCrFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrWrYrrrr�<module>sN,��&P,
hashlib.cpython-38.opt-2.pyc000064400000011736151450073350011561 0ustar00U

&�.e� �	@svdZdZee�Zee�ZedZddddddd	d
hZzddlmZ	Wne
k
r`d
d�Z	YnXe	�stiZdd�Zdd�Z
e	�s�ddd�Zddd�Zz ddlZeZe
Ze�ej�ZWn$e
k
r�e	�r΂eZeZYnXddlmZzddlmZWne
k
�rYnXeD]DZzee�e�e<Wn*ek
�rTddlZe�de�YnX�q[[[[[
e���sp[[	dS)a3hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
                                given hash function; initializing the hash
                                using the given binary data.

Named constructor functions are also available, these are faster
than using new(name):

md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(data): Update the hash object with the bytes in data. Repeated calls
                 are equivalent to a single call with the concatenation of all
                 the arguments.
 - digest():     Return the digest of the bytes passed to the update() method
                 so far as a bytes object.
 - hexdigest():  Like digest() except the digest is returned as a string
                 of double length, containing only hexadecimal digits.
 - copy():       Return a copy (clone) of the hash object. This can be used to
                 efficiently compute the digests of datas that share a common
                 initial substring.

For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update(b"Nobody inspects")
    >>> m.update(b" the spammish repetition")
    >>> m.digest()
    b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:

    >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

)�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512�	shake_128�	shake_256)�new�algorithms_guaranteed�algorithms_available�pbkdf2_hmacr	r
rrr
rrr�)�
get_fips_modecCsdS)Nr�rrr�/usr/lib64/python3.8/hashlib.py�_hashlib_get_fips_modeQsrc	Cs�t}|�|�}|dk	r|S�zB|dkrDddl}|j|d<|d<�n|dkrhddl}|j|d<|d<n�|dkr�ddl}|j|d	<|d
<|j|d<|d<n�|d
kr�ddl	}|j
|d<|d<|j|d<|d<n�|dkr�ddl}|j
|d<|j|d<nb|dk�r6ddl}|j|d<|j|d<|j|d<|j|d<n&|dk�r\ddl}|j|d<|j|d<Wntk
�rtYnX|�|�}|dk	�r�|Std|��dS)N>r�SHA1rrr>�MD5rrr>r�SHA224r�SHA256rrrr>r�SHA512�SHA384rrrrr>rrrr>rr	rr
r	r
rr>r
rr
rzunsupported hash type )�__builtin_constructor_cache�get�_sha1r�_md5r�_sha256rr�_sha512rr�_blake2rr�_sha3r	r
rrr
r�ImportError�
ValueError)	�name�cache�constructorr r!r"r#r$r%rrr�__get_builtin_constructorWsN









r+c	Cs^t�s|tkrt|�Sz"ttd|�}t��s4|�|WSttfk
rXt|�YSXdS)NZopenssl_)r�__block_openssl_constructorr+�getattr�_hashlibr�AttributeErrorr')r(�frrr�__get_openssl_constructor�sr1�cKst|�|f|�S�N)r+�r(�data�kwargsrrr�__py_new�sr7cKsft��s |tkr t|�|f|�Sztj||f|�WStk
r`t��rL�t|�|f|�YSXdSr3)r.rr,r+rr'r4rrr�
__hash_new�sr8N)r)�scryptzcode for hash %s was not found.)r2)r2)�__doc__Z__always_supported�setrr�__all__r,r.rrr&rr+r1r7r8rZ
__get_hash�unionZopenssl_md_meth_namesrr9Z__func_name�globalsr'ZloggingZ	exceptionrrrr�<module>sh5�,

�

genericpath.cpython-38.opt-2.pyc000064400000005463151450073350012440 0ustar00U

e5do�@s�ddlZddlZdddddddd	d
ddgZd
d�Zdd	�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd
�Zdd�Z
dd�Zdd�ZdS)�N�commonprefix�exists�getatime�getctime�getmtime�getsize�isdir�isfile�samefile�sameopenfile�samestatc	Cs.zt�|�Wnttfk
r(YdSXdS)NFT)�os�stat�OSError�
ValueError)�path�r�#/usr/lib64/python3.8/genericpath.pyrs
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S�NF)r
rrr�S_ISREG�st_mode)r�strrrr	s
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�Sr)r
rrr�S_ISDIRr)�srrrrr's
cCst�|�jS�N)r
r�st_size��filenamerrrr0scCst�|�jSr)r
r�st_mtimerrrrr5scCst�|�jSr)r
r�st_atimerrrrr:scCst�|�jSr)r
r�st_ctimerrrrr?scCsl|sdSt|dttf�s*tttj|��}t|�}t|�}t|�D]$\}}|||krB|d|�SqB|S)N�r)	�
isinstance�list�tuple�mapr
�fspath�min�max�	enumerate)�m�s1�s2�i�crrrrEscCs|j|jko|j|jkSr)�st_ino�st_dev)r+r,rrrrWs
�cCst�|�}t�|�}t||�Sr)r
rr)�f1�f2r+r,rrrr
^s

cCst�|�}t�|�}t||�Sr)r
�fstatr)�fp1�fp2r+r,rrrrks

cCs�|�|�}|r"|�|�}t||�}|�|�}||krz|d}||krz|||d�|krp|d|�||d�fS|d7}q<||dd�fS)N�r)�rfindr()�p�sep�altsep�extsep�sepIndex�altsepIndex�dotIndex�
filenameIndexrrr�	_splitextys




r@cGs`d}}|D]<}t|t�r d}qt|t�r0d}qt|�d|jj���d�q|r\|r\td�d�dS)NFTz;() argument must be str, bytes, or os.PathLike object, not z.Can't mix strings and bytes in path components)r"�str�bytes�	TypeError�	__class__�__name__)�funcname�args�hasstr�hasbytesrrrr�_check_arg_types�s

�rJ)r
r�__all__rr	rrrrrrrr
rr@rJrrrr�<module>s,
�	
socket.cpython-38.opt-2.pyc000064400000045742151450073350011443 0ustar00U

e5d���@sddlZddlTddlZddlZddlZddlZddlmZmZzddlZWne	k
rddZYnXe
edd�Ze
edd�Ze
edd�Z
d	d
ddd
ddgZe�e�e��e�dedd��e�dedd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r iZded<ded<d ed!<d"ed#<d$ed%<d&ed'<d(ed)<d*ed+<d,ed-<d.ed/<d0ed1<d2ed3<d4ed5<d6ed7<d8ed9<d:ed;<d<ed=<d>ed?<d@edA<dBedC<dDedE<dFedG<dHedI<dJedK<dLedM<dNedO<dPedQ<dRedS<dTedU<dVedW<dXedY<dZed[<d\ed]<d^ed_<d`eda<dbedc<ddede<dfedg<dhedi<djedk<dledm<dnedo<dpedq<dreds<dtedu<dvedw<dxedy<dzed{<d|ed}<d~ed<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<e�dءGd�dڄd�e�ZGd�d܄d�ej�Zd�d�d	�Ze ejdރ�rld�d�Z!e�d�e ed��r�de"dfd�d�Z#ne$e"dfd�d�Z#e�d�d�e#_%ee
hZ&Gd�d�d�ej'�Z(d�d�d
�Z)e*�Z+e+dfd�d�Z,d�d
�Z-e$dd�d�d�d�d�Z.d�d�d�Z/dS)��N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�/usr/lib64/python3.8/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_rrrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrVrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr[rz	127.0.0.1z::1cCs(z
||�WStk
r"|YSXdS�N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converteras
r�winz)Specified event object handle is invalid.�zInsufficient memory available.�z#One or more parameters are invalid.�WzOverlapped operation aborted.i�z2Overlapped I/O event object not in signaled state.i�z)Overlapped operation will complete later.i�zThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i�'zHost not found.i�*z Nonauthoritative host not found.i�*zThis is a nonrecoverable error.i�*z*Valid name, no data record requested type.i�*zQoS receivers.i�*zQoS senders.i�*zNo QoS senders.i�*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i	+zInvalid QoS provider buffer.i
+zInvalid QoS filter style.i+i+zIncorrect QoS filter count.i
+zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+�errorTabc@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr#�sr#cs(eZdZdddgZd8dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
d9dddd�dd�Zee
d�rvd:dd�Zn
d;dd�Zd<dd�Zdd �Zd=d!d"�Zd#d$�Zejfd%d&�Zd'd(�Z�fd)d*�Ze�fd+d,��Ze�fd-d.��Ze
jd/k�rd0d1�Zd2d3�Znd4d1�Zd5d3�Zd6e_d7e_�ZS)>�socket�__weakref__�_io_refs�_closed���NcCsP|dkr,|dkrt}|dkr t}|dkr,d}tj�|||||�d|_d|_dS)Nr+rF)�AF_INET�SOCK_STREAM�_socketr'�__init__r)r*)�self�family�type�proto�filenorrrr/�szsocket.__init__cCs|Srr�r0rrr�	__enter__�szsocket.__enter__cGs|js|��dSr)r*�close)r0�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�z |��}|r^|dt	|�7}Wnt
k
rtYnXz |��}|r�|dt	|�7}Wnt
k
r�YnX|d7}|S)	Nr*Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)�getattr�	__class__r%r&r4r1r2r3�getsockname�str�errorZgetpeername)r0�closed�sZladdrZraddrrrr�__repr__�s4
��zsocket.__repr__cCstd|jj�d���dS)Nzcannot pickle z object)�	TypeErrorr=r$r5rrr�__getstate__szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)N�r4)�dupr4r=r1r2r3�
settimeout�
gettimeout)r0�fd�sockrrrrGsz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dkr>|��r>|�d�||fS)NrFT)Z_acceptr'r1r2r3ZgetdefaulttimeoutrI�setblocking)r0rJ�addrrKrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cs�t|�dddhks td|f��d|k}d|kp4|}d|k}d}	|rN|	d7}	|rZ|	d7}	t||	�}
|jd7_|dkr~d}|dkr�tj}|dkr�|s�td	��|
S|r�|r�t�|
|
|�}n|r�t�|
|�}nt�|
|�}|r�|St�	||||�}||_
|S)
NrO�w�bz&invalid mode %r (only r, w, b allowed)r:�r+rz!unbuffered streams must be binary)�setr�SocketIOr)�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r0r^�	bufferingrPrQrRZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile-s<
zsocket.makefile�sendfilerc
Cs�|�|||�|��}z|��}Wn0ttjfk
rR}zt|��W5d}~XYnXzt�|�j}Wn*t	k
r�}zt|��W5d}~XYnX|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
z�|	�r||	��st�d��|�r0||}|dk�r0�q�z|
||||�}Wn`tk
�rh|	�s`|�Yq�Yq�t	k
�r�}z|dk�r�t|��|d�W5d}~XYq�X|dk�r��q�||7}||7}q�|W�S|dk�r�t
|d��r�|�|�XdS)Nri@�&non-blocking sockets are not supported�PollSelector�seekz	timed out)�_check_sendfile_paramsr4�AttributeErrorrX�UnsupportedOperationr#�os�fstat�st_size�OSError�minrIr�hasattr�	selectorsrfZSelectSelector�registerZEVENT_WRITEZselectrdrgr.�timeout�BlockingIOError)r0�file�offset�countZsocknor4�errZfsize�	blocksizersZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileYs^






zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r#�r0rurvrwrrrr|�s�c

Cs�|�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�|rpt|||�}|dkrpq�t||��}|s�q�z||�}	Wnt	k
r�Yq�Yq�X||	7}|	t
|�kr�||	d�}q�qTq�qT|W�S|dkr�t|d�r�|�||�XdS)Nrrei rg)rhrIrrgro�read�sendrp�
memoryviewrt�len)
r0rurvrwryrzZ	file_readZ	sock_send�datar{rrr�_sendfile_use_send�s8

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`t|t�sJtd�|���|dkr`td�|���dS)NrTr^z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr2r-�
isinstance�intrD�formatr}rrrrh�s

��zsocket._check_sendfile_paramscCs8z|�|||�WStk
r2|�|||�YSXdSr)r|r#r�r}rrrrd�szsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrU)r)r*r7r5rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dSr)r7)r0Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r*r)r�r5rrrr7�s
zsocket.closecsd|_t���S)NT)r*�super�detachr5�r=rrr��sz
socket.detachcstt�jt�Sr)rr�r1rr5r�rrr1sz
socket.familycstt�jt�Sr)rr�r2rr5r�rrr2szsocket.type�ntcCst�|���Sr)rkZget_handle_inheritabler4r5rrr�get_inheritable
szsocket.get_inheritablecCst�|��|�dSr)rkZset_handle_inheritabler4�r0Zinheritablerrr�set_inheritableszsocket.set_inheritablecCst�|���Sr)rkr�r4r5rrrr�scCst�|��|�dSr)rkr�r4r�rrrr�sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r+r+r+N)rON)rN)rN)rN)rN) r$r%r&�	__slots__r/r6r9rCrErGrNrcrprkr|r�rhrdr�r.r'r�r7r��propertyr1r2�namer�r��__doc__�
__classcell__rrr�rr'�sD

�*
A

$


r'cCst|�}t||||�Sr)rGr')rJr1r2r3Znfdrrrr
sZsharecCstddd|�S�Nr)r')�inforrr�	fromshare#sr��
socketpaircCsh|dkr*zt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fSr)ZAF_UNIX�	NameErrorr,r.r�r'r�)r1r2r3�arTrrrr�.s
c
	Cs|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|�	�|�
�dd�\}}t|||�}zP|�d�z|�||f�Wnt
tfk
r�YnX|�d�|��\}}	Wn|���YnXW5|��X||fS)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FT)r,�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6rr-r'r7�bind�listenr>rL�connectrt�InterruptedErrorrN)
r1r2r3�hostZlsockrM�portZcsockZssock�_rrrr�Cs8


a8socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
csleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Z�fdd�Zd
d�Z	e
dd��Ze
dd��Zdd�Z
�ZS)rWcCsZ|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_d|_dS)N)rOrSZrw�rb�wbZrwbzinvalid mode: %rrTrOrSF)	rrX�	RawIOBaser/�_sock�_mode�_reading�_writing�_timeout_occurred)r0rKr^rrrr/�s

zSocketIO.__init__c
Cs�|��|��|jrtd��z|j�|�WStk
rHd|_�Yqtk
r�}z|jdt	krpWY�
dS�W5d}~XYqXqdS)Nz!cannot read from timed out objectTr)
�_checkClosed�_checkReadabler�rnr�Z	recv_intorsr@r8�_blocking_errnos�r0rT�errr�readinto�s
zSocketIO.readintoc
Cs`|��|��z|j�|�WStk
rZ}z|jdtkrHWY�
dS�W5d}~XYnXdSr�)r��_checkWritabler�rr@r8r�r�rrr�write�s
zSocketIO.writecCs|jrtd��|jS�NzI/O operation on closed socket.)rArr�r5rrr�readable�szSocketIO.readablecCs|jrtd��|jSr�)rArr�r5rrr�writable�szSocketIO.writablecs|jrtd��t���Sr�)rArr��seekabler5r�rrr��szSocketIO.seekablecCs|��|j��Sr)r�r�r4r5rrrr4�szSocketIO.filenocCs|js|��SdSdS)Nr+)rAr4r5rrrr��sz
SocketIO.namecCs|jSr)r�r5rrrr^�sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dSr)rArXr�r7r�r�r5rrrr7�s

zSocketIO.close)r$r%r&r/r�r�r�r�r�r4r�r�r^r7r�rrr�rrWrs

rWr:cCsl|��}|r|dkrt�}zt|�\}}}Wntk
r@Yn(X|�d|�|D]}d|krRqhqR|}|S)Nz0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrr�s	cCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|tk	rP|�|�|r^|�|�|�|�d}|WStk
r�}
z|
}|dk	r�|��W5d}
~
XYqXq|dk	r�z|�W5d}Xntd��dS)Nrz!getaddrinfo returns an empty list)	�getaddrinfor-r'�_GLOBAL_DEFAULT_TIMEOUTrHr�r�r@r7)�addressrsZsource_addressr�r�rx�res�af�socktyper3�	canonname�sarKr�rrrrs.



c	Csltrttd�rttd�sdSz4ttt�� }|�ttd�W5QR�WdSQRXWnt	k
rfYdSXdS)N�IPPROTO_IPV6�IPV6_V6ONLYFrT)
�has_ipv6rpr.r'r�r-�
setsockoptr�r�r@)rKrrrr0s��F)r1�backlog�
reuse_port�dualstack_ipv6c
Csn|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdkr�ttd�r�z|�	t
td�Wntk
r�YnX|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�Wn@tk
�r$}z d|j|f}t|j|�d�W5d}~XYnX|dk�r:|��n
|�|�|WStk
�rh|���YnXdS)N�SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)r��cygwin�SO_REUSEADDRrUrr�r�z+%s (while attempting to bind on address %r))rpr.rrr�r'r-rkr�r�Z
SOL_SOCKETr�r@r�r�r�r�r��strerror�errnor�r7)r�r1r�r�r�rKrx�msgrrrr
@sN


�
�� 


cCsPg}t�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�q|Sr)r.r��appendrrr)r�r�r1r2r3�flagsZaddrlistr�r�r�r�r�rrrr��s�r�)r)r:)rrrr)0r.rk�sysrXrq�enumrrr��ImportErrorr<rrr	�__all__�extend�_get_exports_list�	_convert_r$r�r�rr'Z_realsocket�platform�lowerrr"r��	Exceptionr#r
rpr�r-r�r,r�r�r�rWr�objectr�rrr
r�rrrr�<module>1sF 
�����

F
	
$
u
�
-�Etrace.cpython-38.pyc000064400000047120151450073350010301 0ustar00U

e5d�t�@s�dZddgZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlZdZGdd�d�Zd	d
�Zdd�ZGd
d�d�Zdd�Zdd�Zddd�Zdd�ZGdd�d�Zdd�Zedkr�e�dS)a�program/module to trace Python program or function execution

Sample use, command line:
  trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs
  trace.py -t --ignore-dir '$prefix' spam.py eggs
  trace.py --trackcalls spam.py eggs

Sample use, programmatically
  import sys

  # create a Trace object, telling it what to ignore, and whether to
  # do tracing or line-counting or both.
  tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
                       trace=0, count=1)
  # run the new command using the given tracer
  tracer.run('main()')
  # make a report, placing output in /tmp
  r = tracer.results()
  r.write_results(show_missing=True, coverdir="/tmp")
�Trace�CoverageResults�N)�	monotonicz#pragma NO COVERc@seZdZddd�Zdd�ZdS)�_IgnoreNcCs:|s
t�nt|�|_|sgndd�|D�|_ddi|_dS)NcSsg|]}tj�|��qS�)�os�path�normpath��.0�drr�/usr/lib64/python3.8/trace.py�
<listcomp>Hs�z$_Ignore.__init__.<locals>.<listcomp>z<string>�)�set�_mods�_dirs�_ignore)�self�modules�dirsrrr
�__init__Fs
�z_Ignore.__init__cCs�||jkr|j|S||jkr,d|j|<dS|jD]"}|�|d�r2d|j|<dSq2|dkrld|j|<dS|jD]$}|�|tj�rrd|j|<dSqrd|j|<dS)Nr�.r)rr�
startswithrr�sep)r�filename�
modulename�modrrrr
�namesLs$









z
_Ignore.names)NN)�__name__�
__module__�__qualname__rrrrrr
rEs
rcCs tj�|�}tj�|�\}}|S)z-Return a plausible module name for the patch.)rr�basename�splitext)r�baser�extrrr
�_modnamewsr&cCs�tj�|�}d}tjD]@}tj�|�}|�|�r|t|�tjkrt|�t|�kr|}q|rr|t|�dd�}n|}tj�|�\}}|�tjd�}tj	r�|�tj	d�}tj�
|�\}}|�d�S)z,Return a plausible module name for the path.�rNr)rr�normcase�sysr�lenr�
splitdrive�replace�altsepr#�lstrip)rZcomparepathZlongest�dirr$Zdriverr%rrr
�_fullmodname~s 
r0c@s:eZdZddd�Zdd�Zdd�Zdd
d�Zddd
�ZdS)rNc
Cs�||_|jdkri|_|j��|_||_|jdkr8i|_|j��|_||_|jdkrZi|_|j��|_||_||_|jr�z@t|jd��}t�	|�\}}}W5QRX|�
|�|||��Wn@tt
tfk
r�}ztd|j|ftjd�W5d}~XYnXdS)N�rbzSkipping counts file %r: %s��file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update�	__class__�OSError�EOFError�
ValueError�printr)�stderr)rr4r6r8r7r9�f�errrrr
r�s2


��zCoverageResults.__init__cCs|�d�o|�d�S)z_Return True if the filename does not refer to a file
        we want to have reported.
        �<�>)r�endswith)rrrrr
�is_ignored_filename�sz#CoverageResults.is_ignored_filenamec	Csn|j}|j}|j}|j}|j}|j}|D]}|�|d�||||<q(|D]}d||<qJ|D]}d||<q\dS)z.Merge in the data from another CoverageResultsrrN)r4r6r7�get)	r�otherr4r6r7Zother_countsZother_calledfuncsZ
other_callers�keyrrr
r=�s
zCoverageResults.updateTFc"
Cs�|jr@t�td�|j}t|�D]\}}}td|||f�q"|jr�t�td�d}}	t|j�D]h\\}
}}\}
}}|
|kr�t�td|
d�|
}d}	|
|
kr�|	|
kr�td|
�|
}	td||||f�qfi}|jD].\}}|�|i�}||<|j||f||<q�i}|��D�]\}}|�|��r0�q|�d��rH|d	d
�}|d	k�rpt	j
�t	j
�|��}t
|�}n$|}t	j
�|��s�t	�|�t|�}|�r�t|�}ni}t�|�}t	j
�||d�}t|d��}t�|j�\}}W5QRX|�|||||�\}}|�r|�rtd
||�}||||f||<�q|�rt|�rttd�t|�D]&}||\}}}}td||��qL|j�r�z6t|jd�� } t�|j|j|jf| d�W5QRXWn6tk
�r�}!ztd|!tj d�W5d	}!~!XYnXd	S)af
        Write the coverage results.

        :param show_missing: Show lines that had no hits.
        :param summary: Include coverage summary per module.
        :param coverdir: If None, the results of each module are placed in its
                         directory, otherwise it is included in the directory
                         specified.
        zfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r'z***z  -->z    %s.%s -> %s.%sz.pycN���z.coverr1�dzlines   cov%   module   (path)z%5d   %3d%%   %s   (%s)�wbrz"Can't save counts files because %sr2)!r6rB�sortedr7r4rJ�itemsrIrHrr�dirname�abspathr&�exists�makedirsr0�_find_executable_linenos�	linecache�getlines�joinr:�tokenize�detect_encoding�readline�write_results_file�intr9r;�dumpr?r)rC)"rZshow_missing�summary�coverdirZcallsrr�funcnameZlastfileZ	lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno�	lines_hitZsums�countr/�lnotab�sourceZ	coverpath�fp�encoding�_�n_hits�n_linesZpercent�mrDrErrr
�
write_results�s�
��





��zCoverageResults.write_resultsc
Cs�zt|d|d�}Wn>tk
rP}z td||ftjd�WY�dSd}~XYnXd}d}	|��t|d�D]r\}
}|
|kr�|�d	||
�|	d7}	|d7}n.|
|kr�t|kr�|�d
�|d7}n
|�d�|�|�d��qjW5QRX|	|fS)
z'Return a coverage results file in path.�w�rjz3trace: Could not open %r for writing: %s - skippingr2)rrNrrz%5d: z>>>>>> z       �)	r:r?rBr)rC�	enumerate�write�PRAGMA_NOCOVER�
expandtabs)rr�linesrgrerjr9rErmrlrd�linerrr
r])s.��



z"CoverageResults.write_results_file)NNNNN)TFN)N)rr r!rrIr=ror]rrrr
r�s�

\cCs,i}t�|�D]\}}||krd||<q|S)z:Return dict where keys are lines in the line number table.r)�disZfindlinestarts)�code�strs�linenosrkrdrrr
�_find_lines_from_codeIs

r}cCs4t||�}|jD]}t�|�r|�t||��q|S)z<Return lineno dict for all code objects reachable from code.)r}�	co_consts�inspectZiscoder=�_find_lines)rzr{r|�crrr
r�Ss



r�c	Cs�i}tj}t||d��j}t�|j�}|D]R\}}}}	}
|tjkrv|tjkrv|\}}|	\}
}t||
d�D]}d||<qh|}q(W5QRX|S)z�Return a dict of possible docstring positions.

    The dict maps line numbers to strings.  There is an entry for
    line that contains only a string or a part of a triple-quoted
    string.
    rqr)�token�INDENTr:rZ�generate_tokensr\�STRING�range)rrjrZ
prev_ttyperD�tokZttypeZtstr�start�endrxZslineZscolZelineZecol�irrr
�
_find_strings_s


r�c
Cs�z(t�|��}|��}|j}W5QRXWn@tk
rh}z"td||ftjd�iWY�Sd}~XYnXt||d�}t	||�}t
||�S)zAReturn dict where keys are line numbers in the line number table.z%Not printing coverage data for %r: %sr2N�exec)rZr:�readrjr?rBr)rC�compiler�r�)rrD�progrjrErzr{rrr
rVvs��
rVc	@sveZdZddd�Zdd	�Zd d
d�Zdd
�Zde_dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)!rrrrNFc

Cs�||_||_t||�|_i|_i|_d|_||_i|_i|_	i|_
d|_|	rTt�|_|rb|j
|_nZ|rp|j|_nL|r�|r�|j|_|j|_n2|r�|j|_|j|_n|r�|j|_|j|_nd|_dS)ax
        @param count true iff it should count number of times each
                     line is executed
        @param trace true iff it should print out each line that is
                     being counted
        @param countfuncs true iff it should just output a list of
                     (filename, modulename, funcname,) for functions
                     that were called at least once;  This overrides
                     `count' and `trace'
        @param ignoremods a list of the names of modules to ignore
        @param ignoredirs a list of the names of directories to ignore
                     all of the (recursive) contents of
        @param infile file from which to read stored counts to be
                     added into the results
        @param outfile file in which to write the results
        @param timing true iff timing information be displayed
        rNr)r8r9r�ignorer4Zpathtobasename�	donothing�trace�_calledfuncs�_callers�
_caller_cache�
start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count�
localtrace�localtrace_trace�localtrace_count)
rrfr��
countfuncs�countcallers�
ignoremods�
ignoredirsr8r9�timingrrr
r�s6




zTrace.__init__cCs ddl}|j}|�|||�dS)Nr)�__main__�__dict__�runctx)r�cmdr��dictrrr
�run�sz	Trace.runc	Csh|dkri}|dkri}|js6t�|j�t�|j�zt|||�W5|jsbt�d�t�d�XdS)N)r��	threading�settracer�r)r�)rr��globals�localsrrr
r��s
zTrace.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��d}|js�t�|j	�z|||�}W5|js�t�d�X|S)	N�z8descriptor 'runfunc' of 'Trace' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runfunc expected at least 1 positional argument, got %dr)
r*�	TypeError�pop�warnings�warn�DeprecationWarningr�r)r�r�)�args�kwrr�r��resultrrr
�runfunc�s.

�
�z
Trace.runfuncz($self, func, /, *args, **kw)c
Cs�|j}|j}|rt|�}nd}|j}d}||jkrL|j|dk	r�|j|}n�d|j|<dd�t�|�D�}t|�dkr�dd�t�|d�D�}t|�dkr�dd�t�|d�D�}	t|	�dkr�|	dj}||j|<|dk	r�d||f}|||fS)NcSsg|]}t�|�r|�qSr)rZ
isfunction)rrDrrr
r�s
�z1Trace.file_module_function_of.<locals>.<listcomp>rcSsg|]}t|t�r|�qSr)�
isinstancer�r
rrr
r�s
�rcSsg|]}t|d�r|�qS)�	__bases__)�hasattr)rr�rrr
r�s
�z%s.%s)	�f_code�co_filenamer&�co_namer��gcZ
get_referrersr*r)
r�framerzrrrbZclsnameZfuncsZdicts�classesrrr
�file_module_function_of�s,




zTrace.file_module_function_ofcCs0|dkr,|�|�}|�|j�}d|j||f<dS)zkHandler for call events.

        Adds information about who called who to the self._callers dict.
        �callrN)r��f_backr�)rr��why�arg�	this_funcZparent_funcrrr
r�
s
zTrace.globaltrace_trackcallerscCs |dkr|�|�}d|j|<dS)zoHandler for call events.

        Adds (filename, modulename, funcname) to the self._calledfuncs dict.
        r�rN)r�r�)rr�r�r�r�rrr
r�s
zTrace.globaltrace_countfuncscCsj|dkrf|j}|j�dd�}|rbt|�}|dk	rf|j�||�}|sf|jrZtd||jf�|j	SndSdS)z�Handler for call events.

        If the code block being entered is to be ignored, returns `None',
        else returns self.localtrace.
        r��__file__Nz! --- modulename: %s, funcname: %s)
r��	f_globalsrJr&r�rr�rBr�r�)rr�r�r�rzrrZ	ignore_itrrr
r�!s�zTrace.globaltrace_ltcCs�|dkr~|jj}|j}||f}|j�|d�d|j|<|jrTtdt�|jdd�tj	�
|�}td||t�||�fdd�|j
S)	Nrxrr�%.2f� �r��
%s(%d): %sr')r�r��f_linenor4rJr�rBr�rrr"rW�getliner�)rr�r�r�rrdrL�bnamerrr
r�8s
��z Trace.localtrace_trace_and_countcCsd|dkr^|jj}|j}|jr4tdt�|jdd�tj�|�}td||t	�
||�fdd�|jS)Nrxr�r�r�r�r')r�r�r�r�rBr�rrr"rWr�r�)rr�r�r�rrdr�rrr
r�Gs
��zTrace.localtrace_tracecCs<|dkr6|jj}|j}||f}|j�|d�d|j|<|jS)Nrxrr)r�r�r�r4rJr�)rr�r�r�rrdrLrrr
r�TszTrace.localtrace_countcCst|j|j|j|j|jd�S)N)r8r9r6r7)rr4r8r9r�r�)rrrr
�results\s

�z
Trace.results)	rrrrrrNNF)NN)rr r!rr�r�r��__text_signature__r�r�r�r�r�r�r�r�rrrr
r�s&�
2

)	
cs�ddl}|��}|jdddd�|�dd�}|jdd	d
dd�|jd
dd
dd�|jddd
dd�|jddd
dd�|�d�}|��}|jddd
dd�|jddd
dd�|jdddd �|jd!d"d#d �|jd$d%d
d&d�|jd'd(d
d)d�|jd*d+d
d,d�|�d-d.�}|jd/d0gd1d2�|jd3d0gd4d2�|jd5d
d6d7d2�|jd8d9d:d;�|jd<|jd=d;�|��}|j�r�t�	d>��t�	d?����fd@dA��dBdC�|j
D�|_
�fdDdC�|jD�|_|j�r�|j�s�|�
dE�t|j|jdF�}|�|j|j|j�St|j|j|j|jg��s |�
dG�|j�rB|j�s8|j�rB|�
dH�|j�r\|j�s\|�
dI�|jdk�rr|�
dJ�t|j|j|j|j|j
|j|j|j|jdK�	}z�|j�r�ddl}|j}|�|�\}	}
}|jf|j�t _!dL|j|
j"|
j#|
ddM�}n^|jf|j�t _!t$j%�&|j�t j%d<t'�(|j��}
t)|
�*�|jdN�}W5QRX|jdLdddO�}|�+|||�WnPt,k
�r�}zt �-dPt j!d|f�W5d}~XYnt.k
�r�YnX|�/�}|j0�s�|�|j|j|j�dS)QNrz	--version�versionz	trace 2.0)�actionr�zMain optionsz(One of these (or --report) must be givenz-cz--count�
store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r��helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z	Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r�z-Cz
--coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz	--missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz	--summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r��defaultr�z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).z--moduleFzTrace a module. �progname�?zfile to run as main program)�nargsr��	argumentszarguments to the programZstdlibZ
platstdlibcs4tj�tj�|��}|�d���d��}tj�|�S)Nz$prefixz$exec_prefix)rr�
expanduser�
expandvarsr,r	)�s)�_exec_prefix�_prefixrr
�parse_ignore_dir�szmain.<locals>.parse_ignore_dircSs$g|]}|�d�D]}|���qqS)�,)�split�strip)rr�rrrr
r�s�zmain.<locals>.<listcomp>cs&g|]}|�tj�D]}�|��qqSr)r�r�pathsep)rr�r�)r�rr
r�s�z-r/--report requires -f/--file)r8r9zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3progname is missing: required with the main options)r�r�r�r�r8r9r�r�)rr��__package__�
__loader__�__spec__�
__cached__r�)r�rr�r�zCannot run file %r because: %s)1�argparse�ArgumentParser�add_argumentZadd_argument_groupZadd_mutually_exclusive_groupZ	REMAINDER�
parse_argsZ
ignore_dir�	sysconfigZget_pathZ
ignore_moduleZreportr3�errorrroZmissingr`ra�anyr�rfZ	listfuncsZ
trackcallsr�rr��module�runpyZ_get_module_detailsr�r�r)�argv�parent�loaderrrrR�io�	open_coder�r�r�r?�exit�
SystemExitr�Z	no_report)r��parserZgrpZ_grpZoptsr��tr�Zmodule_nameZmod_nameZmod_specrzZglobsrirEr)r�r�r�r
�mainbs��
�
�
�
�

�
���
�
�
��
�
�
��
�

�
�




��	�(r�r�)N)�__doc__�__all__r�rWrr)r�r�rZrr�ryr;�timerr�r�rurr&r0rr}r�r�rVrr�rrrrr
�<module>s<20

_os.cpython-38.opt-2.pyc000064400000045350151450073350010567 0ustar00U

e5dS��@s�ddlZddlZddlZddlmZejZddddddd	d
ddd
ddddddddgZdd�Z	dd�Z
dekr�dZdZddl
Tzddl
mZe�d�Wnek
r�YnXddlZzddl
mZWnek
r�YnXddl
Z
e�e
e
��[
n�d ek�r�d Zd!ZddlTzddlmZe�d�Wnek
�r>YnXddlZddlZe�e
e��[zddlmZWnek
�r�YnXned"��eejd#<dd$lmZmZmZmZmZmZmZm Z [e	d%��r�e!�Z"d&d'�Z#e$�Z%e#d(d)�e#d*d+�e#d,d-�e#d.d/�e#d0d1�e#d2d3�e#d4d5�e#d6d7�e#d8d9�e#d:d;�e#d<d=�e#d>d?�e#d@dA�e#dBdC�e#dBdD�e#dEd1�e%Z&e$�Z%e#d(d)�e%Z'e$�Z%e#dFdG�e#dHd+�e#dId-�e#dJdK�e#dJdL�e#dMdN�e%�(e�e#dOdP�e#dQd1�e#dRd1�e#dSdT�e	dU��r.e	dV��r.e#dWdU�e%Z)e$�Z%e#d(d)�e#d,d-�e#d.d/�e#dXdY�e#dZd+�e	d[��r~e#d\d-�e#d2d3�e#d]d1�e#d^d/�e#d.d/�e#dEd1�e#d_d/�e%Z*[%[["[#dZ+d`Z,daZ-d�ddde�Z.dfdg�Z/dhdi�Z0e�dedgdig�d�dkdl�Z1e�dl�e2ehe&k�rPe3ehe)k�rPd�dcddn�dodp�Z4dqdr�Z5e�dp�dsdt�Z6dudv�Z7dwdx�Z8dydz�Z9d{d|�Z:d}d~�Z;e�dtdvdxdzd|d~g�d�dd��Z<d�d�d�Z=dd�lm>Z>Gd�d��d�e>�Z?ze@ZAWneBk
�r�d�d��ZAYnXd�ek�re�d��zeCZDWneBk
�r(d�d��ZDYnXd�ek�r>e�d��d�d��ZEeE�ZF[Ed�d�d��ZGed kZHe�d��eH�r�d�d��ZIe?eFjJeIeKeIeKeAeD�ZL[Id�d�d��ZMe�d��d�d��ZNeN�\ZOZP[Ne	d���r,e	d���s,e	d���r,dZQd`ZRZSe�d�d�d�g�d�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXe�d�d�d�d�g�e	d���rTd�d��ZYd�d��ZZe�d�d�g�e	d���r|d�d��Z[d�d��Z\e�d�d�g�d�d�d�Z]Gd�d��d��Z^d�d�Z_d�d��Z`e	d���s�e`Zad�ea_bGd�d��d�ejc�Zded k�r�Gd�d��d��Zed�d��ZfdS)��N)�_check_methods�altsep�curdir�pardir�sep�pathsep�linesep�defpath�name�path�devnull�SEEK_SET�SEEK_CUR�SEEK_END�fsencode�fsdecode�
get_exec_path�fdopen�popen�extsepcCs
|t�kS�N)�globals)r
�r�/usr/lib64/python3.8/os.py�_exists'srcCs8zt|j�WStk
r2dd�t|�D�YSXdS)NcSsg|]}|ddkr|�qS)r�_r)�.0�nrrr�
<listcomp>.sz%_get_exports_list.<locals>.<listcomp>)�list�__all__�AttributeError�dir)�modulerrr�_get_exports_list*sr$�posix�
)�*)�_exitr()�_have_functions�ntz
zno os specific module foundzos.path)rrrrr	rrrr)cCs"|tkr|tkrt�t|�dSr)�_globalsr)�_set�add)�str�fnrrr�_addfsr0ZHAVE_FACCESSAT�accessZ
HAVE_FCHMODAT�chmodZ
HAVE_FCHOWNAT�chownZHAVE_FSTATAT�statZHAVE_FUTIMESAT�utimeZHAVE_LINKAT�linkZHAVE_MKDIRAT�mkdirZ
HAVE_MKFIFOAT�mkfifoZHAVE_MKNODAT�mknodZHAVE_OPENAT�openZHAVE_READLINKAT�readlinkZ
HAVE_RENAMEAT�renameZHAVE_SYMLINKAT�symlinkZ
HAVE_UNLINKAT�unlink�rmdirZHAVE_UTIMENSATZHAVE_FCHDIR�chdirZHAVE_FCHMODZHAVE_FCHOWNZHAVE_FDOPENDIR�listdir�scandirZHAVE_FEXECVE�execveZHAVE_FTRUNCATE�truncateZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FPATHCONF�pathconf�statvfs�fstatvfsZ
HAVE_FSTATVFSZ
HAVE_LCHFLAGSZchflagsZHAVE_LCHMOD�lchownZHAVE_LCHOWNZHAVE_LUTIMESZ
HAVE_LSTATZ
MS_WINDOWS���FcCs�t�|�\}}|s t�|�\}}|r||r|t�|�s|zt||d�Wntk
rVYnXt}t|t�rpttd�}||kr|dSzt||�Wn$t	k
r�|r�t�
|�s��YnXdS)N)�exist_ok�ASCII)r�split�exists�makedirs�FileExistsErrorr�
isinstance�bytesr7�OSError�isdir)r
�moderL�head�tail�cdirrrrrP�s$


rPcCsjt|�t�|�\}}|s(t�|�\}}|rf|rfzt|�Wntk
rTYqfYnXt�|�\}}q(dSr)r?rrNrT)r
rWrXrrr�
removedirs�s
rZcCsnt�|�\}}|r(|r(t�|�s(t|�t||�t�|�\}}|rj|rjzt|�Wntk
rhYnXdSr)rrNrOrPr<rZrT)�old�newrWrXrrr�renames�s
r]Tccst|�}g}g}g}zt|�}Wn8tk
rX}z|dk	rB||�WY�dSd}~XYnX|��z.zt|�}	Wntk
r�YW�qpYnXWnBtk
r�}z$|dk	r�||�WY�W5QR�dSd}~XYnXz|	��}
Wntk
�r�d}
YnX|
�r|�|	j�n|�|	j�|sb|
rb|�r0d}n.z|	��}Wntk
�rVd}YnX|}|rb|�|	j	�qbW5QRX|�r�|||fVt	j
t	j}
}|D]4}|||�}|�s�|
|��s�t||||�EdH�q�n,|D]}t||||�EdH�q�|||fVdS)NFT)
�fspathrBrT�next�
StopIteration�is_dir�appendr
�
is_symlinkr�islink�join�walk)�top�topdown�onerror�followlinks�dirs�nondirs�	walk_dirs�
scandir_it�error�entryra�	walk_intorcrdre�dirname�new_pathrrrrfs^;"


rf�.��follow_symlinks�dir_fdccs�t|t�rt|d�st|�}|s.t|d|d�}t|t|d�}zB|s^t�	|j
�r|t�|t|��r|t
||t|t�|||�EdHW5t|�XdS)N�	__index__Fru�rw)rR�int�hasattrr^r4r:�O_RDONLY�close�st�S_ISDIR�st_moder�samestat�_fwalkrS)rgrhrirvrw�orig_st�topfdrrr�fwalk�s!��r�ccs�t|�}g}g}|s|rdng}	|D]�}
|
j}|r:t|�}z4|
��rb|�|�|	dk	rl|	�|
�n
|�|�Wq$tk
r�z|
��r�|�|�Wntk
r�YnXYq$Xq$|r�||||fV|	dkr�|nt||	�D]�}z@|�s|r�t||dd�}n|\}}
|
jdd�}t	|t
|d�}
Wn>tk
�r\}z|dk	�rD||�WY�q�W5d}~XYnXz@|�sxt�
|t|
���r�t�||�}t|
|||||�EdHW5t|
�Xq�|�s�||||fVdS)NF)rwrv)rvry)rBr
rrarbrTrc�zipr4r:r|r}rr�rer�)r��toppath�isbytesrhrirvrnrkrl�entriesrpr
r��dirfd�err�dirpathrrrr��sZ

�r�cGst||�dSr)�execv��file�argsrrr�execlsr�cGs |d}t||dd�|�dS�N���)rC�r�r��envrrr�execlesr�cGst||�dSr)�execvpr�rrr�execlp"sr�cGs |d}t||dd�|�dSr�)�execvper�rrr�execlpe)sr�cCst||�dSr��_execvper�rrrr�2sr�cCst|||�dSrr�r�rrrr�:sr�cCs�|dk	rt}||f}nt}|f}t}t�|�r@||f|��dSd}t|�}tdkrft|�}tt|�}|D]~}t�	||�}z||f|��Wqjt
tfk
r�}	z|	}
W5d}	~	XYqjtk
r�}	z|	}
|dkr�|	}W5d}	~	XYqjXqj|dk	r�|�|
�dS)Nr*)
rCr��environrrrrr
r�mapre�FileNotFoundError�NotADirectoryErrorrT)r�r�r��	exec_func�argrest�	saved_exc�	path_listr"�fullname�e�last_excrrrr�Es6


r�c
Cs�ddl}|dkrt}|����|�dt�z|�d�}Wntk
rPd}YnXtr�z|d}Wnttfk
rzYnX|dk	r�t	d��|}|dk	r�t
|t�r�t|�}W5QRX|dkr�t
}|�t�S)Nr�ignore�PATHsPATHz*env cannot contain 'PATH' and b'PATH' keys)�warningsr��catch_warnings�simplefilter�BytesWarning�get�	TypeError�supports_bytes_environ�KeyError�
ValueErrorrRrSrr	rNr)r�r�r��
path_listbrrrres0


�)�MutableMappingc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_EnvironcCs.||_||_||_||_||_||_||_dSr)�	encodekey�	decodekey�encodevalue�decodevalue�putenv�unsetenv�_data)�self�datar�r�r�r�r�r�rrr�__init__�sz_Environ.__init__cCs>z|j|�|�}Wntk
r2t|�d�YnX|�|�Sr)r�r�r�r��r��key�valuerrr�__getitem__�s
z_Environ.__getitem__cCs.|�|�}|�|�}|�||�||j|<dSr)r�r�r�r�r�rrr�__setitem__�s

z_Environ.__setitem__cCsD|�|�}|�|�z|j|=Wntk
r>t|�d�YnXdSr)r�r�r�r�)r�r��
encodedkeyrrr�__delitem__�s

z_Environ.__delitem__ccs$t|j�}|D]}|�|�VqdSr)rr�r�)r��keysr�rrr�__iter__�s
z_Environ.__iter__cCs
t|j�Sr)�lenr��r�rrr�__len__�sz_Environ.__len__cs$d�d��fdd��j��D���S)Nzenviron({{{}}})z, c3s*|]"\}}d���|���|��VqdS)z
{!r}: {!r}N)�formatr�r�)rr�r�r�rr�	<genexpr>�s�z$_Environ.__repr__.<locals>.<genexpr>)r�rer��itemsr�rr�r�__repr__�s

��z_Environ.__repr__cCst|�Sr)�dictr�rrr�copy�sz
_Environ.copycCs||kr|||<||Srrr�rrr�
setdefault�sz_Environ.setdefaultN)�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�rrrrr��s		r�cCsdSrr)r�r�rrr�<lambda>��r�r�cCs
t|d�S)N�)�_putenv�r�rrrr��r�r�cs�tdkrHdd�}|�t}�fdd�}i}t��D]\}}||||�<q0n(t����fdd���fdd	�}�}t}t|||�|tt�S)
Nr*cSs t|t�stdt|�j��|S)N�str expected, not %s)rRr.r��typer��r�rrr�	check_str�s
z!_createenviron.<locals>.check_strcs�|���Sr)�upperr�)�encoderrr��sz!_createenviron.<locals>.encodekeycs(t|t�stdt|�j��|��d�S)Nr��surrogateescape)rRr.r�r�r�r�r���encodingrrr��s
z_createenviron.<locals>.encodecs|��d�S)Nr�)�decoder�r�rrr��sz_createenviron.<locals>.decode)	r
r.r�r��sys�getfilesystemencodingr�r��	_unsetenv)r�r�r�r�r�r�r)r�r�r�_createenviron�s*�r�cCst�||�Sr)r�r��r��defaultrrr�getenv�sr�)r�r�cCs t|t�stdt|�j��|S)Nzbytes expected, not %s)rRrSr�r�r�r�rrr�_check_bytess
r�cCst�||�Sr)�environbr�r�rrr�getenvbsr�)r�r�cs4t���t�����fdd�}��fdd�}||fS)Ncs&t|�}t|t�r|����S|SdSr)r^rRr.r���filename�r��errorsrrr s
z_fscodec.<locals>.fsencodecs&t|�}t|t�r|����S|SdSr)r^rRrSr�r�r�rrr,s
z_fscodec.<locals>.fsdecode)r�r��getfilesystemencodeerrors)rrrr�r�_fscodecs
r��fork�spawnvr��P_WAIT�P_NOWAIT�	P_NOWAITOcCs�t|ttf�std��|r"|ds*td��t�}|spz$|dkrJ|||�n||||�Wq�td�Yq�XnR|tkr||St|d�\}}t	|�r�q|q|t
|�r�t|�St|�r�t
|�Std��q|dS)Nzargv must be a tuple or a listrz"argv first element cannot be empty�z"Not stopped, signaled or exited???)rR�tuplerr�r�r�r(r��waitpid�
WIFSTOPPED�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUSrT)rVr�r�r��func�pid�wpid�stsrrr�	_spawnvefIs,
rcCst|||dt�Sr)rr��rVr�r�rrrr�hscCst||||t�Sr)rrC�rVr�r�r�rrr�spawnveqsr	cCst|||dt�Sr)rr�rrrr�spawnvp}sr
cCst||||t�Sr)rr�rrrr�spawnvpe�srcGst|||�Sr)r�rrrr�spawnl�srcGs|d}t|||dd�|�Sr�)r	rrrr�spawnle�sr
cGst|||�Sr)r
rrrr�spawnlp�srcGs|d}t|||dd�|�Sr�)rrrrr�spawnlpe�sr�rr�cCs�t|t�stdt|���|dkr.td|��|dks>|dkrFtd��ddl}ddl}|dkr�|j|d|j|d�}t	|�
|j�|�S|j|d|j|d	�}t	|�
|j�|�SdS)
Nz&invalid cmd type (%s, expected string))r�wzinvalid mode %rrz+popen() does not support unbuffered streamsrT)�shell�stdout�bufsize)r�stdinr)
rRr.r�r�r��
subprocess�io�Popen�PIPE�_wrap_close�
TextIOWrapperrr)�cmdrV�	bufferingrr�procrrrr�s(
��c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCs||_||_dSr)�_stream�_proc)r��streamrrrrr��sz_wrap_close.__init__cCs8|j��|j��}|dkr dStdkr,|S|d>SdS)Nrr*�)rr}r �waitr
)r��
returncoderrrr}�s

z_wrap_close.closecCs|Srrr�rrr�	__enter__�sz_wrap_close.__enter__cGs|��dSr�r}�r�r�rrr�__exit__�sz_wrap_close.__exit__cCst|j|�Sr)�getattrr)r�r
rrr�__getattr__�sz_wrap_close.__getattr__cCs
t|j�Sr)�iterrr�rrrr��sz_wrap_close.__iter__N)	r�r�r�r�r}r%r(r*r�rrrrr�s	rcOs4t|t�stdt|���ddl}|j|f|�|�S)Nz&invalid fd type (%s, expected integer)r)rRrzr�r�rr:)�fdr��kwargsrrrrr�s
cCs�t|ttf�r|St|�}z|�|�}Wn0tk
rXt|d�rF�ntd|j��YnXt|ttf�rl|Std�	|jt|�j���dS)N�
__fspath__z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {})
rRr.rSr�r.r!r{r�r�r�)r�	path_type�	path_reprrrr�_fspaths"
��r1r^c@s&eZdZejdd��Zedd��ZdS)�PathLikecCst�dSr)�NotImplementedErrorr�rrrr.,szPathLike.__fspath__cCs|tkrt|d�StS)Nr.)r2r�NotImplemented)�cls�subclassrrr�__subclasshook__1s
zPathLike.__subclasshook__N)r�r�r��abc�abstractmethodr.�classmethodr7rrrrr2(s
r2c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_AddedDllDirectorycCs||_||_||_dSr)r�_cookie�_remove_dll_directory)r�r�cookieZremove_dll_directoryrrrr�:sz_AddedDllDirectory.__init__cCs|�|j�d|_dSr)r=r<rr�rrrr}>sz_AddedDllDirectory.closecCs|Srrr�rrrr%Asz_AddedDllDirectory.__enter__cGs|��dSrr&r'rrrr(Csz_AddedDllDirectory.__exit__cCs|jrd�|j�SdS)Nz<AddedDllDirectory({!r})>z<AddedDllDirectory()>)rr�r�rrrr�Esz_AddedDllDirectory.__repr__N)r�r�r�r�r}r%r(r�rrrrr;9s
r;cCs ddl}|�|�}t|||j�S)Nr)r*Z_add_dll_directoryr;r=)rr*r>rrr�add_dll_directoryJs

�r?)rKF)TNF)rtTN)N)N)N)N)rr�)gr8r�r4r~�_collections_abcr�builtin_module_namesZ_namesr rr$r
rr%r(rb�ImportError�	posixpathrr)�extendr*Zntpath�modulesZos.pathrrrrr	rrrrr+r0�setr,�supports_dir_fd�supports_effective_idsr-�supports_fd�supports_follow_symlinksr
rrrPrZr]rfr:rBr�r�r�r�r�r�r�r�r�rr�r�r�r��	NameErrorr�r�r�r�r�r�r�r�rSr�r�r�rrr�r�r�rr�r	r
rrr
rrrrrr1r^r��ABCr2r;r?rrrr�<module>s��

(











































 

08
		
 
-7





�


	

	


	

bdb.cpython-38.opt-1.pyc000064400000060533151450073350010674 0ustar00U

e5d8}�@s�dZddlZddlZddlZddlmZmZmZdddgZeeBeBZ	Gdd�de
�ZGdd�d�Zd	d
�Z
Gdd�d�Zdd
�Zdd�ZGdd�de�Zdd�Zdd�Zdd�ZdS)zDebugger basics�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�
Breakpointc@seZdZdZdS)rz Exception to give up completely.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/bdb.pyr
sc@sveZdZdZd[dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd\d&d'�Zd]d(d)�Zd*d+�Zd,d-�Zd.d/�Zd^d0d1�Zd2d3�Zd4d5�Zd_d7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dMdN�Z(d`dPdQ�Z)dadRdS�Z*dbdTdU�Z+dVdW�Z,dXdY�Z-dZe-_.dS)craGeneric Python debugger base class.

    This class takes care of details of the trace facility;
    a derived class should implement user interaction.
    The standard debugger class (pdb.Pdb) is an example.

    The optional skip argument must be an iterable of glob-style
    module name patterns.  The debugger will not step into frames
    that originate in a module that matches one of these patterns.
    Whether a frame is considered to originate in a certain module
    is determined by the __name__ in the frame globals.
    NcCs(|rt|�nd|_i|_i|_d|_dS)N)�set�skip�breaks�fncache�frame_returning)�selfrrrr
�__init__szBdb.__init__cCsR|d|dd�dkr|S|j�|�}|sNtj�|�}tj�|�}||j|<|S)a%Return canonical form of filename.

        For real filenames, the canonical form is a case-normalized (on
        case insensitive filesystems) absolute path.  'Filenames' with
        angle brackets, such as "<stdin>", generated in interactive
        mode, are returned unchanged.
        �<�����>)r�get�os�path�abspath�normcase)r�filename�canonicrrr
r%s
zBdb.canoniccCs&ddl}|��d|_|�dd�dS)z5Set values of attributes as ready to start debugging.rN)�	linecache�
checkcache�botframe�
_set_stopinfo)rr rrr
�reset6sz	Bdb.resetcCs�|jr
dS|dkr|�|�S|dkr0|�||�S|dkrD|�||�S|dkrX|�||�S|dkrf|jS|dkrt|jS|dkr�|jStd	t|��|jS)
aODispatch a trace function for debugged frames based on the event.

        This function is installed as the trace function for debugged
        frames. Its return value is the new trace function, which is
        usually itself. The default implementation decides how to
        dispatch a frame, depending on the type of event (passed in as a
        string) that is about to be executed.

        The event can be one of the following:
            line: A new line of code is going to be executed.
            call: A function is about to be called or another code block
                  is entered.
            return: A function or other code block is about to return.
            exception: An exception has occurred.
            c_call: A C function is about to be called.
            c_return: A C function has returned.
            c_exception: A C function has raised an exception.

        For the Python events, specialized functions (see the dispatch_*()
        methods) are called.  For the C events, no action is taken.

        The arg parameter depends on the previous event.
        N�lineZcall�returnZ	exceptionZc_callZc_exceptionZc_returnz*bdb.Bdb.dispatch: unknown debugging event:)�quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exception�trace_dispatch�print�repr)r�frameZevent�argrrr
r,=s$
zBdb.trace_dispatchcCs.|�|�s|�|�r(|�|�|jr(t�|jS)a	Invoke user function and return trace function for line event.

        If the debugger stops on the current line, invoke
        self.user_line(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        )�	stop_here�
break_here�	user_liner'rr,�rr/rrr
r(hs

zBdb.dispatch_linecCsd|jdkr|j|_|jS|�|�s0|�|�s0dS|jrH|jjt@rH|jS|�	||�|j
r^t�|jS)aInvoke user function and return trace function for call event.

        If the debugger stops on this function call, invoke
        self.user_call(). Raise BbdQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        N)r"�f_backr,r1�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr'r�rr/r0rrr
r)ts
zBdb.dispatch_callcCs||�|�s||jkrv|jr,|jjt@r,|jSz||_|�||�W5d|_X|j	rVt
�|j|krv|jdkrv|�dd�|jS)aInvoke user function and return trace function for return event.

        If the debugger stops on this function return, invoke
        self.user_return(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        Nr)
r1�returnframer7r8r9r:r,r�user_returnr'r�
stoplinenor#r<rrr
r*�szBdb.dispatch_returncCs�|�|�rF|jjt@r.|dtkr.|ddks�|�||�|jr�t�nD|jr�||jk	r�|jjjt@r�|dtt	fkr�|�||�|jr�t�|j
S)aInvoke user function and return trace function for exception event.

        If the debugger stops on this exception, invoke
        self.user_exception(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        r�N)r1r8r9r:�
StopIteration�user_exceptionr'rr7�
GeneratorExitr,r<rrr
r+�s$

�
���zBdb.dispatch_exceptioncCs.|dkrdS|jD]}t�||�rdSqdS)z4Return True if module_name matches any skip pattern.NFT)r�fnmatch)rZmodule_name�patternrrr
�is_skipped_module�s
zBdb.is_skipped_modulecCsN|jr|�|j�d��rdS||jkr@|jdkr4dS|j|jkS|jsJdSdS)z>Return True if frame is below the starting frame in the stack.rFrT)rrF�	f_globalsrr7r?�f_linenor4rrr
r1�s�

z
Bdb.stop_herecCs�|�|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j	r�|�
t|j��dSdSdS)z�Return True if there is an effective breakpoint for this line.

        Check for line or function breakpoint and if in effect.
        Delete temporary breakpoints if effective() says to.
        FTN)rr8�co_filenamerrH�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr/r�lineno�bp�flagrrr
r2�s

zBdb.break_herecCstd��dS)zlRemove temporary breakpoint.

        Must implement in derived classes or get NotImplementedError.
        z)subclass of bdb must implement do_clear()N)�NotImplementedError)rr0rrr
rN�szBdb.do_clearcCs|�|jj�|jkS)zEReturn True if there is any breakpoint for frame's filename.
        )rr8rIrr4rrr
r6�szBdb.break_anywherecCsdS)z&Called if we might stop in a function.Nr)rr/Z
argument_listrrr
r;sz
Bdb.user_callcCsdS)z'Called when we stop or break at a line.Nrr4rrr
r3sz
Bdb.user_linecCsdS)z&Called when a return trap is set here.Nr)rr/Zreturn_valuerrr
r>	szBdb.user_returncCsdS)z$Called when we stop on an exception.Nr)rr/�exc_inforrr
rB
szBdb.user_exceptionrcCs||_||_d|_||_dS)z�Set the attributes for stopping.

        If stoplineno is greater than or equal to 0, then stop at line
        greater than or equal to the stopline.  If stoplineno is -1, then
        don't stop at all.
        FN)r7r=r'r?)rr7r=r?rrr
r#szBdb._set_stopinfocCs$|dkr|jd}|�|||�dS)zxStop when the line with the lineno greater than the current one is
        reached or when returning from current frame.Nr)rHr#)rr/rPrrr
�	set_until"s
z
Bdb.set_untilcCs0|jr |jj}|r |js |j|_|�dd�dS)zStop after one line of code.N)rr5�f_tracer,r#)rZcaller_framerrr
�set_step*s

zBdb.set_stepcCs|�|d�dS)z2Stop on the next line in or below the given frame.N)r#r4rrr
�set_next6szBdb.set_nextcCs.|jjt@r|�|dd�n|�|j|�dS)z)Stop when returning from the given frame.Nr)r8r9r:r#r5r4rrr
�
set_return:szBdb.set_returncCsL|dkrt��j}|��|r4|j|_||_|j}q|��t�|j�dS)znStart debugging from frame.

        If frame is not specified, debugging starts from caller's frame.
        N)	�sys�	_getframer5r$r,rVr"rW�settracer4rrr
�	set_traceAs
z
Bdb.set_tracecCsH|�|jdd�|jsDt�d�t��j}|rD||jk	rD|`|j}q*dS)z�Stop only at breakpoints or when finished.

        If there are no breakpoints, set the system trace function to None.
        Nr)r#r"rrZr\r[r5rVr4rrr
�set_continuePs

zBdb.set_continuecCs"|j|_d|_d|_t�d�dS)zuSet quitting attribute to True.

        Raises BdbQuit exception in the next call to a dispatch_*() method.
        NT)r"r7r=r'rZr\�rrrr
�set_quit_szBdb.set_quitFc
Csb|�|�}ddl}|�||�}|s.d||fS|j�|g�}||krN|�|�t|||||�}	dS)z�Set a new breakpoint for filename:lineno.

        If lineno doesn't exist for the filename, return an error message.
        The filename should be in canonical form.
        rNzLine %s:%d does not exist)rr �getliner�
setdefault�appendr)
rrrPrM�cond�funcnamer r%�listrQrrr
�	set_breakps

z
Bdb.set_breakcCs4||ftjkr|j|�|�|j|s0|j|=dS)aPrune breakpoints for filename:lineno.

        A list of breakpoints is maintained in the Bdb instance and in
        the Breakpoint class.  If a breakpoint in the Bdb instance no
        longer exists in the Breakpoint class, then it's removed from the
        Bdb instance.
        N)r�bplistr�remove�rrrPrrr
�
_prune_breaks�s
zBdb._prune_breakscCsj|�|�}||jkrd|S||j|kr6d||fStj||fdd�D]}|��qL|�||�dS)znDelete breakpoints for filename:lineno.

        If no breakpoints were set, return an error message.
        �There are no breakpoints in %szThere is no breakpoint at %s:%dN)rrrrh�deleteMerk)rrrPrQrrr
�clear_break�s


zBdb.clear_breakc
CsZz|�|�}Wn.tk
r<}zt|�WY�Sd}~XYnX|��|�|j|j�dS)zxDelete a breakpoint by its index in Breakpoint.bpbynumber.

        If arg is invalid, return an error message.
        N)�get_bpbynumber�
ValueErrorrOrmrk�filer%)rr0rQ�errrrr
�clear_bpbynumber�szBdb.clear_bpbynumbercCsX|�|�}||jkrd|S|j|D]$}tj||f}|D]}|��q<q&|j|=dS)z`Delete all breakpoints in filename.

        If none were set, return an error message.
        rlN)rrrrhrm)rrr%ZblistrQrrr
�clear_all_file_breaks�s

zBdb.clear_all_file_breakscCs,|js
dStjD]}|r|��qi|_dS)z]Delete all existing breakpoints.

        If none were set, return an error message.
        zThere are no breakpointsN)rr�
bpbynumberrm)rrQrrr
�clear_all_breaks�s

zBdb.clear_all_breakscCs�|std��zt|�}Wn"tk
r:td|�d�YnXztj|}Wn"tk
rltd|�d�YnX|dkr�td|��|S)z�Return a breakpoint by its index in Breakpoint.bybpnumber.

        For invalid arg values or if the breakpoint doesn't exist,
        raise a ValueError.
        zBreakpoint number expectedz Non-numeric breakpoint number %sNz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rp�intrru�
IndexError)rr0rLrQrrr
ro�szBdb.get_bpbynumbercCs"|�|�}||jko ||j|kS)z9Return True if there is a breakpoint for filename:lineno.�rrrjrrr
�	get_break�s

�z
Bdb.get_breakcCs4|�|�}||jkr0||j|kr0tj||fp2gS)znReturn all breakpoints for filename:lineno.

        If no breakpoints are set, return an empty list.
        )rrrrhrjrrr
�
get_breaks�s

���zBdb.get_breakscCs&|�|�}||jkr|j|SgSdS)zrReturn all lines with breakpoints for filename.

        If no breakpoints are set, return an empty list.
        Nry)rrrrr
�get_file_breaks�s


zBdb.get_file_breakscCs|jS)z$Return all breakpoints that are set.)rr_rrr
�get_all_breaks�szBdb.get_all_breakscCs�g}|r|j|kr|j}|dk	rD|�||jf�||jkr<qD|j}q|��tdt|�d�}|dk	r�|�|j|j	f�|j}q^|dkr�tdt|�d�}||fS)z�Return a list of (frame, lineno) in a stack trace and a size.

        List starts with original calling frame, if there is one.
        Size may be number of frames above or below f.
        Nrr)
�tb_frame�tb_nextrcrHr"r5�reverse�max�len�	tb_lineno)r�f�t�stack�irrr
�	get_stack�s 
z
Bdb.get_stack�: cCs�ddl}ddl}|\}}|�|jj�}d||f}|jjrH||jj7}n|d7}|d7}d|jkr�|jd}	|d7}||�|	�7}|�|||j	�}
|
r�|||
�
�7}|S)a:Return a string with information about a stack entry.

        The stack entry frame_lineno is a (frame, lineno) tuple.  The
        return string contains the canonical filename, the function name
        or '<lambda>', the input arguments, the return value, and the
        line of code (if it exists).

        rNz%s(%r)z<lambda>z()Z
__return__z->)r �reprlibrr8rI�co_name�f_localsr.rarG�strip)rZframe_linenoZlprefixr r�r/rPr�s�rvr%rrr
�format_stack_entrys 	

zBdb.format_stack_entryc	Cs�|dkrddl}|j}|dkr"|}|��t|t�r@t|dd�}t�|j�z*zt
|||�Wntk
rrYnXW5d|_	t�d�XdS)z�Debug a statement executed via the exec() function.

        globals defaults to __main__.dict; locals defaults to globals.
        Nrz<string>�execT)�__main__�__dict__r$�
isinstancerO�compilerZr\r,r'r�r)r�cmd�globals�localsr�rrr
�run5s

zBdb.runc	Csz|dkrddl}|j}|dkr"|}|��t�|j�z,zt|||�WW�Stk
r^YnXW5d|_t�d�XdS)z�Debug an expression executed via the eval() function.

        globals defaults to __main__.dict; locals defaults to globals.
        NrT)	r�r�r$rZr\r,r'�evalr)r�exprr�r�r�rrr
�runevalKs
zBdb.runevalcCs|�|||�dS)z.For backwards-compatibility.  Defers to run().N)r�)rr�r�r�rrr
�runctx_sz
Bdb.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|��t�|j	�d}z(z|||�}Wntk
r�YnXW5d
|_
t�d�X|S)zWDebug a single function call.

        Return the result of the function call.
        r@z6descriptor 'runcall' of 'Bdb' object needs an argument�funcrNz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %drT)r��	TypeError�pop�warnings�warn�DeprecationWarningr$rZr\r,r'r)�args�kwdsrr�r��resrrr
�runcallfs2

�
�
zBdb.runcallz($self, func, /, *args, **kwds))N)r)N)N)FNN)r�)NN)NN)/rr	r
rrrr$r,r(r)r*r+rFr1r2rNr6r;r3r>rBr#rUrWrXrYr]r^r`rgrkrnrsrtrvrorzr{r|r}r�r�r�r�r�r��__text_signature__rrrr
rs\
+	


�







cCst���dS)z<Start debugging with a Bdb instance from the caller's frame.N)rr]rrrr
r]�sr]c@sZeZdZdZdZiZdgZddd�Zdd�Zd	d
�Z	dd�Z
dd
d�Zdd�Zdd�Z
dS)ra�Breakpoint class.

    Implements temporary breakpoints, ignore counts, disabling and
    (re)-enabling, and conditionals.

    Breakpoints are indexed by number through bpbynumber and by
    the (file, line) tuple using bplist.  The former points to a
    single instance of class Breakpoint.  The latter points to a
    list of such instances since there may be more than one
    breakpoint per line.

    When creating a breakpoint, its associated filename should be
    in canonical form.  If funcname is defined, a breakpoint hit will be
    counted when the first line of that function is executed.  A
    conditional breakpoint always counts a hit.
    rNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|j�
|�||f|jkr||j||f�
|�n|g|j||f<dS)NTrr)re�func_first_executable_linerqr%rMrd�enabled�ignore�hitsr�nextrLrurcrh)rrqr%rMrdrerrr
r�szBreakpoint.__init__cCs>|j|jf}d|j|j<|j|�|�|j|s:|j|=dS)z�Delete the breakpoint from the list associated to a file:line.

        If it is the last breakpoint in that position, it also deletes
        the entry for the file:line.
        N)rqr%rurLrhri)r�indexrrr
rm�s

zBreakpoint.deleteMecCs
d|_dS)zMark the breakpoint as enabled.TN�r�r_rrr
�enable�szBreakpoint.enablecCs
d|_dS)z Mark the breakpoint as disabled.FNr�r_rrr
�disable�szBreakpoint.disablecCs"|dkrtj}t|��|d�dS)z�Print the output of bpformat().

        The optional out argument directs where the output is sent
        and defaults to standard output.
        N)rq)rZ�stdoutr-�bpformat)r�outrrr
�bpprint�szBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d	}nd
}|d|j|f7}|S)z�Return a string with information about the breakpoint.

        The information includes the breakpoint number, temporary
        status, file:line position, break condition, number of times to
        ignore, and number of times hit.

        zdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz
	stop only if %sz
	ignore next %d hitsrr��z"
	breakpoint already hit %d time%s)rMr�rLrqr%rdr�r�)rZdispZretZssrrr
r��s(
�
zBreakpoint.bpformatcCsd|j|j|jfS)z1Return a condensed description of the breakpoint.zbreakpoint %s at %s:%s)rLrqr%r_rrr
�__str__�szBreakpoint.__str__)FNN)N)rr	r
rr�rhrurrmr�r�r�r�r�rrrr
r�s


cCsN|js|j|jkrdSdS|jj|jkr,dS|js:|j|_|j|jkrJdSdS)aVReturn True if break should happen here.

    Whether a break should happen depends on the way that b (the breakpoint)
    was set.  If it was set via line number, check if b.line is the same as
    the one in the frame.  If it was set via function name, check if this is
    the right function and if it is on the first executable line.
    FT)rer%rHr8r�r�)�br/rrr
�
checkfuncnamesr�cCs�tj||f}|D]�}|jsqt||�s*q|jd7_|jsh|jdkrZ|jd8_qq�|dfSqzBt|j|j|j	�}|r�|jdkr�|jd8_n|dfWSWq|dfYSXqdS)aEDetermine which breakpoint for this file:line is to be acted upon.

    Called only if we know there is a breakpoint at this location.  Return
    the breakpoint that was triggered and a boolean that indicates if it is
    ok to delete a temporary breakpoint.  Return (None, None) if there is no
    matching breakpoint.
    rrTF)NN)
rrhr�r�r�rdr�r�rGr�)rqr%r/Z	possiblesr��valrrr
rK#s*


rKc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)N�???z+++ call)r8r�r-)rr/r��namerrr
r;Tsz
Tdb.user_callcCsTddl}|jj}|sd}|�|jj�}|�||j|j�}td||j|d|�	��dS)Nrr�z+++�:)
r r8r�rrIrarHrGr-r�)rr/r r��fnr%rrr
r3Xsz
Tdb.user_linecCstd|�dS)Nz
+++ return�r-)rr/Zretvalrrr
r>_szTdb.user_returncCstd|�|��dS)Nz
+++ exception)r-r^)rr/Z	exc_stuffrrr
rBas
zTdb.user_exceptionN)rr	r
r;r3r>rBrrrr
r�Ssr�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r-�bar)�n�xrrr
�fooesr�cCstd|d�|dS)Nzbar(r�r@r�)�arrr
r�jsr�cCst�}|�d�dS)Nzimport bdb; bdb.foo(10))r�r�)r�rrr
�testnsr�)rrDrZr�inspectrrr�__all__r:�	Exceptionrrr]rr�rKr�r�r�r�rrrr
�<module>s(
{t"0wave.cpython-38.opt-2.pyc000064400000027515151450073350011113 0ustar00U

e5d6G�@s�ddlZdddddgZGdd�de�ZdZd	ZddlZddlZddlZdd
l	m
Z
ddlmZddl
Z
edd
�ZGdd�d�ZGdd�d�Zddd�Zddd�ZdS)�N�open�openfp�Error�	Wave_read�
Wave_writec@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/wave.pyrNs�)N�b�hN�i)�Chunk)�
namedtuple�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+S),rcCs�d|_d|_t|dd�|_|j��dkr0td��|j�d�dkrHtd��d|_d|_d|_	zt|jdd�}Wnt
k
r�Yq�YnX|��}|d	kr�|�|�d|_n2|d
kr�|js�td��||_|j|j
|_d|_	q�|��qT|jr�|js�td��dS)
Nr)Z	bigendian�RIFFz file does not start with RIFF id��WAVEznot a WAVE filer�fmt �datazdata chunk before fmt chunkz#fmt chunk and/or data chunk missing)�_convert�	_soundposr�_fileZgetnamer�readZ_fmt_chunk_read�_data_chunk�_data_seek_needed�EOFError�_read_fmt_chunkZ	chunksize�
_framesize�_nframes�skip)�self�file�chunkZ	chunknamer
r
r�initfp~s8


zWave_read.initfpcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�rb��_i_opened_the_file�
isinstance�str�builtinsrr&�close�r#�fr
r
r�__init__�s
zWave_read.__init__cCs|��dS�N�r-�r#r
r
r�__del__�szWave_read.__del__cCs|Sr1r
r3r
r
r�	__enter__�szWave_read.__enter__cGs|��dSr1r2�r#�argsr
r
r�__exit__�szWave_read.__exit__cCs|jSr1)rr3r
r
r�getfp�szWave_read.getfpcCsd|_d|_dS)Nrr)rrr3r
r
r�rewind�szWave_read.rewindcCs"d|_|j}|rd|_|��dSr1)rr)r-�r#r$r
r
rr-�s
zWave_read.closecCs|jSr1)rr3r
r
r�tell�szWave_read.tellcCs|jSr1)�
_nchannelsr3r
r
r�getnchannels�szWave_read.getnchannelscCs|jSr1)r!r3r
r
r�
getnframes�szWave_read.getnframescCs|jSr1)�
_sampwidthr3r
r
r�getsampwidth�szWave_read.getsampwidthcCs|jSr1)�
_framerater3r
r
r�getframerate�szWave_read.getframeratecCs|jSr1��	_comptyper3r
r
r�getcomptype�szWave_read.getcomptypecCs|jSr1��	_compnamer3r
r
r�getcompname�szWave_read.getcompnamecCs*t|��|��|��|��|��|���Sr1)rr>rArCr?rFrIr3r
r
r�	getparams�s�zWave_read.getparamscCsdSr1r
r3r
r
r�
getmarkers�szWave_read.getmarkerscCstd��dS�Nzno marks�r�r#�idr
r
r�getmark�szWave_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)r!rrr)r#�posr
r
r�setpos�szWave_read.setposcCs�|jr8|j�dd�|j|j}|r2|j�|d�d|_|dkrDdS|j�||j�}|jdkrxtjdkrxt	�
||j�}|jr�|r�|�|�}|jt|�|j
|j|_|S)Nr�r�big)rr�seekrr rr@�sys�	byteorder�audioop�byteswapr�lenr=)r#�nframesrQ�datar
r
r�
readframes�s

zWave_read.readframescCs�z$t�d|�d��\}|_|_}}Wntjk
r@td�YnX|tkr�zt�d|�d��d}Wntjk
r�td�YnX|dd|_|js�t	d��nt	d	|f��|js�t	d
��|j|j|_
d|_d|_dS)
Nz<HHLLH�z<H�r���bad sample widthzunknown format: %r�bad # of channels�NONEznot compressed)
�structZunpack_fromrr=rB�errorr�WAVE_FORMAT_PCMr@rr rErH)r#r%Z
wFormatTagZdwAvgBytesPerSecZwBlockAlign�	sampwidthr
r
rr�s$$
zWave_read._read_fmt_chunkN)rrr	r&r0r4r5r8r9r:r-r<r>r?rArCrFrIrJrKrPrRr]rr
r
r
rr_s*
c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9S):rcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�wbr(r.r
r
rr0.s
zWave_write.__init__cCs@||_d|_d|_d|_d|_d|_d|_d|_d|_d|_	dS)NrF)
rrr=r@rBr!�_nframeswritten�_datawritten�_datalength�_headerwrittenr;r
r
rr&:szWave_write.initfpcCs|��dSr1r2r3r
r
rr4FszWave_write.__del__cCs|Sr1r
r3r
r
rr5IszWave_write.__enter__cGs|��dSr1r2r6r
r
rr8LszWave_write.__exit__cCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to writerrc)rkrr=)r#�	nchannelsr
r
r�setnchannelsRs
zWave_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)r=rr3r
r
rr>YszWave_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nrnrrrb)rkrr@)r#rhr
r
r�setsampwidth^s
zWave_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)r@rr3r
r
rrAeszWave_write.getsampwidthcCs0|jrtd��|dkrtd��tt|��|_dS)Nrnrzbad frame rate)rkr�int�roundrB)r#�	framerater
r
r�setframeratejs
zWave_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rBrr3r
r
rrCqszWave_write.getframeratecCs|jrtd��||_dS�Nrn)rkrr!)r#r[r
r
r�
setnframesvszWave_write.setnframescCs|jSr1�rjr3r
r
rr?{szWave_write.getnframescCs.|jrtd��|dkrtd��||_||_dS)Nrn)rdzunsupported compression type)rkrrErH)r#�comptype�compnamer
r
r�setcomptype~szWave_write.setcomptypecCs|jSr1rDr3r
r
rrF�szWave_write.getcomptypecCs|jSr1rGr3r
r
rrI�szWave_write.getcompnamecCsV|\}}}}}}|jrtd��|�|�|�|�|�|�|�|�|�||�dSrv)rkrrprqrurwr{)r#Zparamsrorhrtr[ryrzr
r
r�	setparams�s



zWave_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)r=r@rBrrr!rErHr3r
r
rrJ�s�zWave_write.getparamscCstd��dS)Nzsetmark() not supportedrM)r#rOrQ�namer
r
r�setmark�szWave_write.setmarkcCstd��dSrLrMrNr
r
rrP�szWave_write.getmarkcCsdSr1r
r3r
r
rrK�szWave_write.getmarkerscCs|jSr1rxr3r
r
rr<�szWave_write.tellcCs�t|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|jdkrpt
jdkrpt�
||j�}|j�|�|jt|�7_|j||_dS)N�BrrT)r*�bytes�	bytearray�
memoryview�cast�_ensure_header_writtenrZr@r=rrVrWrXrYr�writerkrj)r#r\r[r
r
r�writeframesraw�s
zWave_write.writeframesrawcCs"|�|�|j|jkr|��dSr1)r�rlrk�_patchheader)r#r\r
r
r�writeframes�s
zWave_write.writeframescCsXz2|jr0|�d�|j|jkr&|��|j��W5d|_|j}|rRd|_|��XdS)Nr)rr)r-r�rlrkr��flushr;r
r
rr-�s
zWave_write.closecCs>|js:|jstd��|js"td��|js0td��|�|�dS)Nz# channels not specifiedzsample width not specifiedzsampling rate not specified)rmr=rr@rB�
_write_header)r#Zdatasizer
r
rr��sz!Wave_write._ensure_header_writtencCs�|j�d�|js$||j|j|_|j|j|j|_z|j��|_Wntt	fk
rfd|_YnX|j�t
�dd|jdddt|j|j
|j|j
|j|j|j|jdd��|jdk	r�|j��|_|j�t
�d	|j��d
|_dS)Nrz<L4s4sLHHLLHH4s�$rr�rar�<LT)rr�r!r=r@rlr<�_form_length_pos�AttributeError�OSErrorre�packrgrB�_data_length_posrm)r#Z
initlengthr
r
rr��s2
�
zWave_write._write_headercCs�|j|jkrdS|j��}|j�|jd�|j�t�dd|j��|j�|j	d�|j�t�d|j��|j�|d�|j|_dS)Nrr�r�)
rkrlrr<rUr�r�rer�r�)r#Zcurposr
r
rr��s
zWave_write._patchheaderN)rrr	r0r&r4r5r8rpr>rqrArurCrwr?r{rFrIr|rJr~rPrKr<r�r�r-r�r�r�r
r
r
rrs8


cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder')�rr')�wriz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�rrr�r/r�r
r
rr�s
cCstjdtdd�t||d�S)NzBwave.openfp is deprecated since Python 3.7. Use wave.open instead.r_)�
stacklevel)r�)�warnings�warn�DeprecationWarningrr�r
r
rrs
�)N)N)r,�__all__�	ExceptionrrgZ_array_fmtsrXrerVr%r�collectionsrr�rrrrrr
r
r
r�<module>Js&�6d

quopri.cpython-38.opt-1.pyc000064400000012707151450073350011464 0ustar00U

e5dT�@s�dZddddgZdZdZdZdZzd	d
lmZmZWne	k
rPdZdZYnXdd
�Z
dd�Zddd�Zddd�Z
ddd�Zddd�Zdd�Zdd�Zdd�Zedkr�e�dS) zHConversions to/from quoted-printable transport encoding as per RFC 1521.�encode�decode�encodestring�decodestring�=�Ls0123456789ABCDEF��)�a2b_qp�b2a_qpNcCs:|dkr|S|dkr|S|tkp8d|ko2dknS)z�Decide whether a particular byte ordinal needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    � 	�_� �~)�ESCAPE)�c�	quotetabs�header�r�/usr/lib64/python3.8/quopri.py�needsquotings
rcCs(t|�}ttt|dt|df�S)zQuote a single character.�)�ordr�bytes�HEX�rrrr�quote$srFc
Cs2tdk	r,|��}t|||d�}|�|�dS|dfdd�}d}|��}|sN�qg}	d}
|dd�dkrv|dd�}d}
|D]D}t|f�}t|||�r�t|�}|r�|dkr�|	�d	�qz|	�|�qz|dk	r�||�t�	|	�}t
|�tk�r||dtd
�dd�|td
d�}q�|}q>|dk	�r.|||
d�dS)
avRead 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are binary file objects. The 'quotetabs' flag
    indicates whether embedded tabs and spaces should be quoted. Note that
    line-ending tabs and spaces are always encoded, as per RFC 1521.
    The 'header' flag indicates whether we are encoding spaces as _ as per RFC
    1522.N�rr�
cSsj|r<|dd�dkr<|�|dd�t|dd��|�n*|dkrX|�t|�|�n|�||�dS)N���r�.)�writer)�s�output�lineEndrrrr ;s
(zencode.<locals>.writerrr
r�s=
)r#)r
�readr �readlinerrr�append�EMPTYSTRING�join�len�MAXLINESIZE)
�inputr"rr�data�odatar Zprevline�lineZoutline�strippedrZthislinerrrr,s>	




cCsFtdk	rt|||d�Sddlm}||�}|�}t||||�|��S)Nrr��BytesIO)r
�ior2r�getvalue)r!rrr2�infp�outfprrrrjscCs�tdk	r*|��}t||d�}|�|�dSd}|��}|s>�q�dt|�}}|dkr�||d|�dkr�d}	|d}|dkr�||d|�dkr�|d}qtnd}	||k�r�|||d�}
|
dkr�|r�|d	}|d}q�|
tkr�||
}|d}q�|d|k�r|	�sd}	�q�q�|d|k�rJ||d|d
�tk�rJ|t}|d
}q�|d
|k�r�t||d|d
���r�t||d
|d���r�|tt||d|d��f�}|d}q�||
}|d}q�|	s.|�|d�d}q.|�r�|�|�dS)z�Read 'input', apply quoted-printable decoding, and write to 'output'.
    'input' and 'output' are binary file objects.
    If 'header' is true, decode underscore as space (per RFC 1522).N�rrrr$rs 	
rr
��)	r	r%r r&r*r�ishexr�unhex)r,r"rr-r.�newr/�i�n�partialrrrrrusP



(
B"

cCsDtdk	rt||d�Sddlm}||�}|�}t|||d�|��S)Nr7rr1)r	r3r2rr4)r!rr2r5r6rrrr�scCsHd|kodknpFd|ko*dknpFd|koBdkSS)zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.�0�9�a�f�A�Frrrrrr:�sr:cCs�d}|D]�}t|f�}d|kr*dkr8nn
td�}nLd|krLdkr^nntd�d}n&d	|krrd
kr�nntd	�d}n|dt|�|}q|S)z.Get the integer value of a hexadecimal number.rr@rA�0rBrC�a�
rDrEr)rr)r!�bitsrr=rrrr;�s

r;cCs�ddl}ddl}z|�|jdd�d�\}}WnV|jk
r�}z6|j|_t|�td�td�td�|�d�W5d}~XYnXd}d}|D] \}}|dkr�d}|d	kr�d}q�|r�|r�|j|_td
�|�d�|s�dg}d}	|D]�}
|
dkr�|jj	}nTzt
|
d�}WnDtk
�rP}z$|j�d
|
|f�d}	WY�q�W5d}~XYnXz*|�rjt||jj	�nt||jj	|�W5|
dk�r�|�
�Xq�|	�r�|�|	�dS)Nrr$Ztdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder8z-tz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s)
)�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr �closerr)rLrMZopts�args�msgZdecoZtabs�orG�sts�file�fprrr�main�sT


r_�__main__)F)FF)F)F)�__doc__�__all__rr+rr(Zbinasciir	r
�ImportErrorrrrrrrr:r;r_�__name__rrrr�<module>s*

>

+
.token.cpython-38.opt-2.pyc000064400000004626151450073350011267 0ustar00U

e5d@	�0@s�ddddgZdZdZdZdZdZd	Zd
ZdZdZ	d
Z
dZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d,Z)d-Z*d.Z+d/Z,d0Z-d1Z.d2Z/d3Z0d4Z1d5Z2d6Z3d7Z4d8Z5d9Z6d:Z7d;Z8d<Z9d=Z:d>Z;d?Z<d@Z=dAZ>dBZ?dCZ@dDZAdEdF�eB��C�D�ZDe�EeD�F��eee)ee*ee	ee$e/e'ee%e
ee&e4ee5ee0e1e(ee6eee"e-eeeeee#e.e2e3e
ee!e,eee+ee dG�/ZGdHd�ZHdId�ZIdJd�ZJdKS)L�tok_name�
ISTERMINAL�
ISNONTERMINAL�ISEOF����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�cCs*i|]"\}}t|t�r|�d�s||�qS)�_)�
isinstance�int�
startswith)�.0�name�value�rM�/usr/lib64/python3.8/token.py�
<dictcomp>Js


�rO)/z!=�%z%=�&z&=�(�)�*z**z**=z*=�+z+=�,�-z-=z->�.z...�/z//z//=z/=�:z:=�;�<z<<z<<=z<=�=z==�>z>=z>>z>>=�@z@=�[�]�^z^=�{�|z|=�}�~cCs|tkS�N��	NT_OFFSET��xrMrMrNr�scCs|tkSrgrhrjrMrMrNr�scCs|tkSrg)�	ENDMARKERrjrMrMrNr�sN)K�__all__rl�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENT�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�RARROW�ELLIPSIS�
COLONEQUAL�OP�AWAIT�ASYNC�TYPE_IGNORE�TYPE_COMMENT�
ERRORTOKEN�COMMENT�NL�ENCODING�N_TOKENSri�globals�itemsr�extend�values�EXACT_TOKEN_TYPESrrrrMrMrMrN�<module>s���2pyclbr.cpython-38.opt-2.pyc000064400000015304151450073350011435 0ustar00U

e5d�;�@s�ddlZddlZddlZddlZddlmZmZmZddddgZ	iZ
Gdd�d�ZGd	d�de�ZGd
d�de�Z
dd�Zdd
d�Zddd�Zddd�Zddd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�dS) �N)�NAME�DEDENT�OP�
readmodule�
readmodule_ex�Class�Functionc@seZdZdd�Zdd�ZdS)�_ObjectcCs(||_||_||_||_||_i|_dS�N)�module�name�file�lineno�parent�children��selfrrr
rr�r�/usr/lib64/python3.8/pyclbr.py�__init__6sz_Object.__init__cCs||j|<dSr
)r)rr�objrrr�	_addchild>sz_Object._addchildN)�__name__�
__module__�__qualname__rrrrrrr	4sr	c@seZdZddd�ZdS)rNcCst�||||||�dSr
)r	rrrrrrDszFunction.__init__)N)rrrrrrrrrBscs&eZdZd�fdd�	Zdd�Z�ZS)rNcs0t�||||||�|dkr gn||_i|_dSr
)r	r�super�methods)rrrrr
rr��	__class__rrrJszClass.__init__cCs||j|<dSr
)r)rrrrrr�
_addmethodOszClass._addmethod)N)rrrrr�
__classcell__rrrrrHscCs:t|j||j||�}|�||�t|t�r6|�||�|Sr
)rrr
r�
isinstancerr)�ob�	func_namerZnewfuncrrr�_nest_functionSs

r$cCs&t|j|||j||�}|�||�|Sr
)rrr
r)r"�
class_namerrZnewclassrrr�_nest_class[sr&cCs6i}t||pg���D]\}}t|t�r|||<q|Sr
)�_readmodule�itemsr!r)r�path�res�key�valuerrrras


cCst||p
g�Sr
)r')rr)rrrrmsc	Cs�|dk	rd||f}n|}|tkr*t|Si}|tjkrL|dkrL|t|<|S|�d�}|dkr�|d|�}||dd�}t|||�}|dk	r�d||f}d|kr�td�|���t||d|�Sd}	|dk	r�|}
n
|tj}
tj	�
||
�}|dk�rtd|��|d��|t|<|jdk	�r$|j|d<z|j
�|�}Wnttfk
�rR|YSX|dk�rb|S|j
�|�}
t|||
|||�S)	Nz%s.%s�.r��__path__zNo package named {}zno module named )r)�_modules�sys�builtin_module_names�rfindr'�ImportError�formatr)�	importlib�util�_find_spec_from_path�ModuleNotFoundError�submodule_search_locations�loader�
get_source�AttributeError�get_filename�_create_tree)rr)�	inpackage�
fullmodule�tree�i�packageZ	submoduler�fZsearch_path�spec�source�fnamerrrr'vsJ	





r'c!
CsHt�|�}g}t�|j�}�z|D�]�\}	}
}}}
|	tkr`|\}}|r^|dd|kr^|d=qBq"|
dkr�|\}}|r�|dd|kr�|d=qpt|�dd�\}	}}|	tkr�q"d}|r�|dd}t|||�}nt	||||�}|||<|�
||f�q"|
dk�r�|\}}|�r(|dd|k�r(|d=�qt|�dd�\}	}}|	tk�rJq"t|�dd�\}	}
}d}|
dk�r�g}d}g}t|�dd�\}	}
}|
dk�r|dk�rd	�|�}||k�r�||}nL|�d
�}t
|�dk�r|d}|d}|tk�rt|}||k�r||}|�
|�g}|
dk�r0|d7}nZ|
dk�rR|d8}|dk�r��q�n8|
d
k�rh|dk�rhn"|	ttfk�rz|dk�rz|�
|
��qz|}|�r�|dd}t||||�}nt|||||�}|||<|�
||f�q"|
dk�rh|ddk�rht|�}|D]d\}}zL|dk�r t||�n2zt|||�Wn tk
�rPt|g�YnXWnYnX�qq"|
dkr"|ddkr"t|�\}}
|r"|
dk�r�q"t|�}zt|||�}WnYq"YnX|D]X\}} ||k�r�|||| �p�|<n0|dk�r�|D] }|ddk�r�||||<�q��q�q"Wntk
�r:YnX|��|S)N���r.�defr��class�()�)�,�r-���rNrO�import�from�*�_)�io�StringIO�tokenize�generate_tokens�readliner�nextrr$r�append�join�split�lenr0rr&r�_getnamelistr'r4�_getname�
StopIteration�close)!rAr)rHrGrBr@rE�stack�g�	tokentype�token�startZ_end�_linerZ
thisindentr#Zcur_funcZcur_objr%Zinherit�names�levelr�n�c�m�dZ	cur_class�modules�modZ_mod2Zn2rrrr?�s�
















��



r?cCslg}t|�\}}|sqh|dkr,t|�\}}nd}|�||f�|dkr\d|kr\t|�d}q>|dkrqhq|S)N�asrO�
r.)rar\r[)rerjrrgZname2rrrr`Esr`cCs�g}t|�dd�\}}|tkr0|dkr0d|fS|�|�t|�dd�\}}|dkrXq�t|�dd�\}}|tkrvq�|�|�q:d�|�|fS)Nr�rTr-)r[rr\r])re�partsrfrgrrrra[s
rac
CsXddl}ztjd}Wnt}YnX|j�|�rj|j�|�g}|j�|�}|���	d�rn|dd�}ng}t
||�}dd�}t|��|dd�}d	}|�rT|�
�}t|t�r�q�t|d
�s�d|_t|t�r�t|j��|dd�}|D]}	|j||	_q�|�|�t|t��r,td�d|j|j|j|j��q�t|t�r�td
�d|j|j|j��q�dS)Nrr.z.py���cSst|dd�S)Nrr)�getattr)�arrr�<lambda>|�z_main.<locals>.<lambda>T)r+�reversert�indentz{}class {} {} {}� z{}def {} {})�osr1�argv�__file__r)�exists�dirname�basename�lower�endswithr�sorted�values�popr!�list�hasattrr|r	r�extendr�printr5rrrr)
r~rqr)rBZ
lineno_keyZobjsZindent_levelrZnew_objsr"rrr�_mainmsL





�
�
r��__main__)N)N)N)N)rVr1�importlib.utilr6rXrgrrr�__all__r0r	rrr$r&rrr'r?r`rar�rrrrr�<module>)s*


	
@&random.cpython-38.opt-2.pyc000064400000031516151450073350011425 0ustar00U

e5d�p�@sddlmZddlmZmZmZ	m
ZmZ
ddlmZmZmZmZddlmZddlmZmZddlmZ m!Z"ddl#m#Z$ddlZ%zdd	l&m'Z&Wn e(k
r�dd	l)m'Z&YnXd
ddd
ddddddddddddddddddd d!gZ*d"ed#�ed$�Z+d$e	Z,ed%�Z-d&ed'�Z.d(Z/d)e/Z0ddl1Z1Gd*d
�d
e1j2�Z2Gd+d!�d!e2�Z3d,d-�Z4d4d/d0�Z5e2�Z6e6j7Z7e6j8Z8e6j9Z9e6j:Z:e6j;Z;e6j<Z<e6j=Z=e6j>Z>e6j?Z?e6j@Z@e6jAZAe6jBZBe6jCZCe6jDZDe6jEZEe6jFZFe6jGZGe6jHZHe6jIZIe6jJZJe6jKZKe6jLZLeMe%d1��re%jNe6j7d2�eOd3k�re5�dS)5�)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�urandom)�Set�Sequence)�
accumulate�repeat)�bisectN)�sha512�Random�seed�random�uniform�randint�choice�sample�	randrange�shuffle�
normalvariate�lognormvariate�expovariate�vonmisesvariate�gammavariate�
triangular�gauss�betavariate�
paretovariate�weibullvariate�getstate�setstate�getrandbits�choices�SystemRandom�g��@�@��?�@�5�cs eZdZdZd>dd�Zdd�Zd?�fdd	�	Z�fd
d�Z�fdd
�Zdd�Z	dd�Z
dd�Zddefdd�Z
dd�Zdd�Zede>fdd�ZeZdd�Zd@dd �Zd!d"�ZdAddd#�d$d%�Zd&d'�ZdBd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!�Z"S)Cr�NcCs|�|�d|_dS�N)r�
gauss_next)�self�x�r7�/usr/lib64/python3.8/random.py�__init__^s
zRandom.__init__cKsJ|jD]>}d|jkrqFd|jkr.|j|_qFd|jkr|j|_qFqdS)N�
_randbelowr(r)�__mro__�__dict__�_randbelow_with_getrandbitsr:�_randbelow_without_getrandbits)�cls�kwargs�cr7r7r8�__init_subclass__gs	



zRandom.__init_subclass__r1cs�|dkr�t|ttf�r�t|t�r*|�d�n|}|rBt|d�d>nd}tt|�D]}d||Ad@}qP|t|�N}|dkr~dn|}|d	kr�t|tttf�r�t|t�r�|��}|t	|��
�7}t�|d
�}t
��|�d|_dS)N�zlatin-1r�iCBl����������r1�big)�
isinstance�str�bytes�decode�ord�map�len�	bytearray�encode�_sha512Zdigest�int�
from_bytes�superrr4)r5�a�versionr6rA��	__class__r7r8r{s
zRandom.seedcs|jt���|jfSr3)�VERSIONrTr&r4�r5rWr7r8r&�szRandom.getstatec
s�|d}|dkr*|\}}|_t��|�nt|dkr�|\}}|_ztdd�|D��}Wn(tk
r|}z
t|�W5d}~XYnXt��|�ntd||jf��dS)Nrr2r1css|]}|dVqdS)lNr7)�.0r6r7r7r8�	<genexpr>�sz"Random.setstate.<locals>.<genexpr>z?state with version %s passed to Random.setstate() of version %s)r4rTr'�tuple�
ValueError�	TypeErrorrY)r5�staterVZ
internalstaterrWr7r8r'�s�zRandom.setstatecCs|��Sr3)r&rZr7r7r8�__getstate__�szRandom.__getstate__cCs|�|�dSr3)r')r5r`r7r7r8�__setstate__�szRandom.__setstate__cCs|jd|��fS)Nr7)rXr&rZr7r7r8�
__reduce__�szRandom.__reduce__rCc
Cs||�}||krtd��|dkr:|dkr2|�|�Std��||�}||krRtd��||}|dkrx|dkrx||�|�S|dkr�td|||f��||�}||kr�td��|dkr�||d|}	n"|dkr�||d|}	ntd��|	dkr�td��|||�|	�S)	Nz!non-integer arg 1 for randrange()rzempty range for randrange()z non-integer stop for randrange()rCz(empty range for randrange() (%d, %d, %d)z non-integer step for randrange()zzero step for randrange())r^r:)
r5�start�stop�step�_intZistartZistop�widthZistep�nr7r7r8r�s4

zRandom.randrangecCs|�||d�S�NrC)r�r5rU�br7r7r8r�szRandom.randintcCs,|j}|��}||�}||kr(||�}q|Sr3)r(�
bit_length)r5rir(�k�rr7r7r8r=�s
z"Random._randbelow_with_getrandbitscCsn|j}||kr$td�||�|�S|dkr4td��||}|||}|�}||kr^|�}qN|||�|S)Nz�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.rzBoundary cannot be zero)r�_warnr^)r5rirR�maxsizerZrem�limitror7r7r8r>sz%Random._randbelow_without_getrandbitscCs:z|�t|��}Wntk
r0td�d�YnX||S)Nz$Cannot choose from an empty sequence)r:rNr^�
IndexError)r5�seq�ir7r7r8rs
z
Random.choicecCs�|dkrN|j}ttdt|���D]*}||d�}||||||<||<q nHt}ttdt|���D]0}||�|d�}||||||<||<qddSrj)r:�reversed�rangerNrR)r5r6r�	randbelowru�jrgr7r7r8r%s	zRandom.shufflecCst|t�rt|�}t|t�s$td��|j}t|�}d|krF|ksPntd��dg|}d}|dkr�|dtt	|dd��7}||kr�t
|�}t|�D]0}|||�}	||	||<|||d||	<q�nHt�}
|
j
}t|�D]2}||�}	|	|
kr�||�}	q�||	�||	||<q�|S)	Nz>Population must be a sequence or set.  For dicts, use list(d).rz,Sample larger than population or is negative��r+r2rC)rH�_Setr]�	_Sequencer_r:rNr^�_ceil�_log�listrw�set�add)r5�
populationrnrxri�resultZsetsizeZpoolruryZselectedZselected_addr7r7r8r;s6)



z
Random.sample)�cum_weightsrncs�|j�t����dkrV|dkrHt��d7�����fdd�td|�D�Stt|���n|dk	rftd��t���krztd��t��dd��d�������fdd�td|�D�S)	N�csg|]}�������qSr7r7�r[ru)rgrir�rr7r8�
<listcomp>�sz"Random.choices.<locals>.<listcomp>z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrErCcs$g|]}������d���qS)rr7r�)rr��hir�r�totalr7r8r��s�)	rrNrR�_repeatr��_accumulater_r^�_bisect)r5r�Zweightsr�rnr7)rgrr�r�rir�rr�r8r)�s$�zRandom.choicescCs||||��Sr3�rrkr7r7r8r�szRandom.uniformr�r.cCs||��}z |dkrdn||||}Wntk
r@|YSX||krdd|}d|}||}}|||t||�S)N��?r.)r�ZeroDivisionError�_sqrt)r5ZlowZhigh�mode�urAr7r7r8r!�s	 

zRandom.triangularcCsP|j}|�}d|�}t|d|}||d}|t|�krqDq|||S)Nr.r�r-)r�
NV_MAGICCONSTr)r5�mu�sigmar�u1�u2�zZzzr7r7r8r�s

zRandom.normalvariatecCst|�||��Sr3)�_expr)r5r�r�r7r7r8r�szRandom.lognormvariatecCstd|���|S�Nr.)rr)r5Zlambdr7r7r8r�szRandom.expovariatecCs�|j}|dkrt|�Sd|}|td||�}|�}tt|�}|||}|�}	|	d||ks�|	d|t|�kr4q�q4d|}
|
|d|
|}|�}|dkr�|t|�t}
n|t|�t}
|
S)Ng���ư>r�r.)r�TWOPIr��_cos�_pir��_acos)r5r�Zkappar�sror�r��dr��q�fZu3Zthetar7r7r8r�s$
$zRandom.vonmisesvariatecCs~|dks|dkrtd��|j}|dkr�td|d�}|t}||}|�}d|kr`dksdqFqFd|�}t|d|�|}	|t|	�}
|||}|||	|
}|td|dks�|t|�krF|
|SqFn�|dkr�td|��|S|�}
t|t}||
}|dk�r$|d|}
nt|||�}
|�}|dk�r^||
|dk�rp�qrq�|t|
�kr�qrq�|
|SdS)Nr�z*gammavariate: alpha and beta must be > 0.0r.r,gH�����z>g�P���?r/)r^rr��LOG4rr��
SG_MAGICCONST�_e)r5�alpha�betarZainvZbbbZcccr�r��vr6r�ror�rl�pr7r7r8r #s@
 

zRandom.gammavariatecCs`|j}|j}d|_|dkrT|�t}tdtd|���}t|�|}t|�||_|||S)Ng�r.)rr4r�r�rr��_sin)r5r�r�rr�Zx2piZg2radr7r7r8r"hs
zRandom.gausscCs0|�|d�}|dkrdS|||�|d�SdS)Nr.rr�)r )r5r�r��yr7r7r8r#�s
zRandom.betavariatecCsd|��}d|d|Sr�r�)r5r�r�r7r7r8r$�szRandom.paretovariatecCs"d|��}|t|�d|Sr�)rr)r5r�r�r�r7r7r8r%�szRandom.weibullvariate)N)Nr1)N)N)r�r.N)#�__name__�
__module__�__qualname__rYr9rBrr&r'rarbrcrRrrr=�BPFr>r:rrrr)rr!rrrrr r"r#r$r%�
__classcell__r7r7rWr8rNs:
	 ,

G
0E5	c@s4eZdZdd�Zdd�Zdd�Zdd�ZeZZd	S)
r*cCst�td�d�d?tS)NrDrGr2)rRrS�_urandom�	RECIP_BPFrZr7r7r8r�szSystemRandom.randomcCs<|dkrtd��|dd}t�t|�d�}||d|?S)Nrz(number of bits must be greater than zerorD�rG)r^rRrSr�)r5rnZnumbytesr6r7r7r8r(�s
zSystemRandom.getrandbitscOsdSr3r7�r5�args�kwdsr7r7r8r�szSystemRandom.seedcOstd��dS)Nz*System entropy source does not have state.)�NotImplementedErrorr�r7r7r8�_notimplemented�szSystemRandom._notimplementedN)	r�r�r�rr(rr�r&r'r7r7r7r8r*�s
cCs�ddl}t|d|j�d}d}d}d}|��}t|�D]4}	||�}
||
7}||
|
}t|
|�}t|
|�}q6|��}tt||d�ddd	�||}t||||�}
td
||
||f�dS)Nr�timesr�g _�Bg _��r2zsec,� )�endz"avg %g, stddev %g, min %g, max %g
)	�time�printr��perf_counterrw�min�max�roundr�)ri�funcr�r�r�ZsqsumZsmallestZlargestZt0rur6�t1ZavgZstddevr7r7r8�_test_generator�s(

�r���cCs�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td	�t|td
�t|td�t|td�t|td�t|td
�dS)Nr7)r�r.)g{�G�z�?r.)皙�����?r.)r�r,)r�r.)g�������?r.)r.r.)r,r.)g4@r.)gi@r.)�@r�)r�r.gUUUUUU�?)	r�rrrrr r"r#r!)�Nr7r7r8�_test�s r��fork)Zafter_in_child�__main__)r�)P�warningsrrpZmathrrrr�rr�rr�rr~rr�r	r�r
r�rr��osrr��_collections_abcr
r|rr}�	itertoolsrr�rr�rr��_osrQr�ImportErrorZhashlib�__all__r�r�r�r�r�r�Z_randomrr*r�r�Z_instrrrr!rrrrrr)rrrrr r"r#r$r%r&r'r(�hasattr�register_at_forkr�r7r7r7r8�<module>(s��
{

_py_abc.cpython-38.pyc000064400000011100151450073350010564 0ustar00U

e5d-�@s(ddlmZdd�ZGdd�de�ZdS)�)�WeakSetcCstjS)z�Returns the current ABC cache token.

    The token is an opaque object (supporting equality testing) identifying the
    current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.
    )�ABCMeta�_abc_invalidation_counter�rr�/usr/lib64/python3.8/_py_abc.py�get_cache_tokensrcsVeZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)rahMetaclass for defining Abstract Base Classes (ABCs).

    Use this metaclass to create an ABC.  An ABC can be subclassed
    directly, and then acts as a mix-in class.  You can also register
    unrelated concrete classes (even built-in classes) and unrelated
    ABCs as 'virtual subclasses' -- these and their descendants will
    be considered subclasses of the registering ABC by the built-in
    issubclass() function, but the registering ABC won't show up in
    their MRO (Method Resolution Order) nor will method
    implementations defined by the registering ABC be callable (not
    even via super()).
    rc	s�t�j||||f|�}dd�|��D�}|D]:}t|dt��D]&}t||d�}t|dd�r>|�|�q>q,t|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)�__isabstractmethod__F)�getattr)�.0�name�valuerrr�	<setcomp>&s�z"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__rF)�super�__new__�itemsr	�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacherr�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�clsZ	abstracts�baser��	__class__rrr#s�
zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|j�|�tjd7_|S)zsRegister a virtual subclass of an ABC.

        Returns the subclass, to allow usage as a class decorator.
        zCan only register classesz'Refusing to create an inheritance cycle�)	�
isinstance�type�	TypeError�
issubclass�RuntimeErrorrrrr)r�subclassrrr�register6s


zABCMeta.registerNcCs|td|j�d|j��|d�tdt���|d�|jD]@}|�d�r6t||�}t|t�r`t	|�}t|�d|��|d�q6dS)z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: Z_abc_z: N)
�print�
__module__�__qualname__r�__dict__�
startswithr	r"rr)rr*rrrrr�_dump_registryHs



zABCMeta._dump_registrycCs|j��dS)z.Clear the registry (for debugging or testing).N)r�clear�rrrr�_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j��|j��dS)z,Clear the caches (for debugging or testing).N)rr1rr2rrr�_abc_caches_clearWs
zABCMeta._abc_caches_clearcsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS��|�St�fdd�||fD��S)z'Override for isinstance(instance, cls).TFc3s|]}��|�VqdS)N)�__subclasscheck__)r
�cr2rr�	<genexpr>jsz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r rr#rrrrr5�any)r�instancer'Zsubtyperr2r�__instancecheck__\s
��
zABCMeta.__instancecheck__cCst|t�std��||jkr dS|jtjkr>t�|_tj|_n||jkrLdS|�	|�}|t
k	r�t|t�slt�|r~|j�
|�n|j�
|�|S|t|dd�kr�|j�
|�dS|jD] }t||�r�|j�
|�dSq�|��D] }t||�r�|j�
|�dSq�|j�
|�dS)z'Override for issubclass(subclass, cls).z"issubclass() arg 1 must be a classTF�__mro__r)r"r#r$rrrrrr�__subclasshook__�NotImplemented�bool�AssertionErrorrr	rr%�__subclasses__)rr'�okZrclsZsclsrrrr5ls:







zABCMeta.__subclasscheck__)N)
�__name__r,r-�__doc__rrr(r0r3r4r:r5�
__classcell__rrrrrs
rN)Z_weakrefsetrrr#rrrrr�<module>s
traceback.cpython-38.opt-1.pyc000064400000046744151450073350012074 0ustar00U

e5d;\�@s:dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddgZd3dd�Zdd�Zd4dd�Zd5dd	�Z	d6dd�Z
dZdZd7dd�Z
d8d d�Zd!d�Zd"d#�Zd$d%�Zd9d&d
�Zd:d'd�Zd;d(d
�Zd<d)d�Zd=d*d�Zd>d+d�Zd,d�ZGd-d�d�Zd.d�Zd/d�Zd0ZGd1d�de�ZGd2d�d�ZdS)?z@Extract, format and print information about Python stack traces.�N�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbcCs4|dkrtj}t�|���D]}t||dd�qdS)zyPrint the list of tuples as returned by extract_tb() or
    extract_stack() as a formatted stack trace to the given file.N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�item�r �!/usr/lib64/python3.8/traceback.py�
print_listsr"cCst�|���S)a�Format a list of tuples or FrameSummary objects for printing.

    Given a list of tuples or FrameSummary objects as returned by
    extract_tb() or extract_stack(), return a list of strings ready
    for printing.

    Each string in the resulting list corresponds to the item with the
    same index in the argument list.  Each string ends in a newline;
    the strings may contain internal newlines as well, for those items
    whose source text line is not None.
    )rrr)rr r r!rscCstt||d�|d�dS)aPrint up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    ��limit�rN)r"r)�tbr$rr r r!r-scCst||d���S)z5A shorthand for 'format_list(extract_tb(tb, limit))'.r#)rr�r&r$r r r!r7scCstjt|�|d�S)a#
    Return a StackSummary object representing a list of
    pre-processed entries from traceback.

    This is useful for alternate formatting of stack traces.  If
    'limit' is omitted or None, all entries are extracted.  A
    pre-processed stack trace entry is a FrameSummary object
    containing attributes filename, lineno, name, and line
    representing the information that is usually printed for a stack
    trace.  The line is a string with leading and trailing
    whitespace stripped; if the source is not available it is None.
    r#)r�extractrr'r r r!r;s
zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

TcCsB|dkrtj}tt|�|||d�j|d�D]}t||dd�q*dS)a�Print exception up to 'limit' stack trace entries from 'tb' to 'file'.

    This differs from print_tb() in the following ways: (1) if
    traceback is not None, it prints a header "Traceback (most recent
    call last):"; (2) it prints the exception type and value after the
    stack trace; (3) if type is SyntaxError and value has the
    appropriate format, it prints the line where the syntax error
    occurred with a caret on the next line indicating the approximate
    position of the error.
    Nr#��chainrr)rrr�typerr)�etype�valuer&r$rr*�liner r r!rWs��
cCs ttt|�|||d�j|d��S)azFormat a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    r#r))�listrr+r)r,r-r&r$r*r r r!rls��cCstt||d����S)aFormat the exception part of a traceback.

    The arguments are the exception type and value such as given by
    sys.last_type and sys.last_value. The return value is a list of
    strings, each ending in a newline.

    Normally, the list contains a single string; however, for
    SyntaxError exceptions, it contains several lines that (when
    printed) display detailed information about where the syntax
    error occurred.

    The message indicating which exception occurred is always the last
    string in the list.

    N)r/rr)r,r-r r r!r|scCs.t|�}|dks|sd|}nd||f}|S)Nz%s
z%s: %s
)�	_some_str)r,r-�valuestrr.r r r!�_format_final_exc_line�s

r2cCs*z
t|�WSdt|�jYSXdS)Nz<unprintable %s object>)�strr+�__name__)r-r r r!r0�s
r0cCstt��|||d��dS)z>Shorthand for 'print_exception(*sys.exc_info(), limit, file)'.�r$rr*N)rr�exc_infor5r r r!r	�scCsd�tt��||d���S)z%Like print_exc() but return a string.r�r$r*)�joinrrr6r7r r r!r
�scCs.ttd�std��ttjtjtj|||�dS)znThis is a shorthand for 'print_exception(sys.last_type,
    sys.last_value, sys.last_traceback, limit, file)'.�	last_typezno last exceptionN)�hasattrr�
ValueErrorrr9�
last_value�last_tracebackr5r r r!r�s
�cCs*|dkrt��j}tt||d�|d�dS)z�Print a stack trace from its invocation point.

    The optional 'f' argument can be used to specify an alternate
    stack frame at which to start. The optional 'limit' and 'file'
    arguments have the same meaning as for print_exception().
    Nr#r%)r�	_getframe�f_backr"r)�fr$rr r r!r
�s
cCs"|dkrt��j}tt||d��S)z5Shorthand for 'format_list(extract_stack(f, limit))'.Nr#)rr>r?rr)r@r$r r r!r�s
cCs0|dkrt��j}tjt|�|d�}|��|S)asExtract the raw traceback from the current stack frame.

    The return value has the same format as for extract_tb().  The
    optional 'f' and 'limit' arguments have the same meaning as for
    print_stack().  Each item in the list is a quadruple (filename,
    line number, function name, text), and the entries are in order
    from oldest to newest stack frame.
    Nr#)rr>r?rr(r�reverse)r@r$�stackr r r!r�s
	
cCs8|dk	r4z|j��Wntk
r*YnX|j}qdS)zEClear all references to local variables in the frames of a traceback.N)�tb_frame�clear�RuntimeError�tb_next�r&r r r!r�sc@sZeZdZdZdZdddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
edd��ZdS)ra,A single frame from a traceback.

    - :attr:`filename` The filename for the frame.
    - :attr:`lineno` The line within filename for the frame that was
      active when the frame was captured.
    - :attr:`name` The name of the function or method that was executing
      when the frame was captured.
    - :attr:`line` The text from the linecache module for the
      of code that was running when the frame was captured.
    - :attr:`locals` Either None if locals were not supplied, or a dict
      mapping the name to the repr() of the variable.
    )�filename�lineno�name�_line�localsTN)�lookup_linerLr.cCsB||_||_||_||_|r"|j|r8dd�|��D�nd|_dS)a�Construct a FrameSummary.

        :param lookup_line: If True, `linecache` is consulted for the source
            code line. Otherwise, the line will be looked up when first needed.
        :param locals: If supplied the frame locals, which will be captured as
            object representations.
        :param line: If provided, use this instead of looking up the line in
            the linecache.
        cSsi|]\}}|t|��qSr )�repr)�.0�k�vr r r!�
<dictcomp>sz)FrameSummary.__init__.<locals>.<dictcomp>N)rHrIrJrKr.�itemsrL)�selfrHrIrJrMrLr.r r r!�__init__�szFrameSummary.__init__cCs`t|t�r:|j|jko8|j|jko8|j|jko8|j|jkSt|t�r\|j|j|j|jf|kStS�N)	�
isinstancerrHrIrJrL�tupler.�NotImplemented�rT�otherr r r!�__eq__s

�
�
�
zFrameSummary.__eq__cCs|j|j|j|jf|SrV)rHrIrJr.)rT�posr r r!�__getitem__szFrameSummary.__getitem__cCst|j|j|j|jg�SrV)�iterrHrIrJr.�rTr r r!�__iter__szFrameSummary.__iter__cCsdj|j|j|jd�S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)rHrIrJ)rrHrIrJr`r r r!�__repr__s
�zFrameSummary.__repr__cCsdS)N�r r`r r r!�__len__szFrameSummary.__len__cCs&|jdkr t�|j|j���|_|jSrV)rK�	linecache�getlinerHrI�stripr`r r r!r.s
zFrameSummary.line)
r4�
__module__�__qualname__�__doc__�	__slots__rUr\r^rarbrd�propertyr.r r r r!r�s
�
ccs4|dkrt��jj}|dk	r0||jfV|j}qdS)z�Walk a stack yielding the frame and line number for each frame.

    This will follow f.f_back from the given frame. If no frame is given, the
    current stack is used. Usually used with StackSummary.extract.
    N)rr>r?�f_lineno)r@r r r!r$s
ccs"|dk	r|j|jfV|j}qdS)z�Walk a traceback yielding the frame and line number for each frame.

    This will follow tb.tb_next (and thus is in the opposite order to
    walk_stack). Usually used with StackSummary.extract.
    N)rC�	tb_linenorFrGr r r!r1s�c@s:eZdZdZedddd�dd��Zedd	��Zd
d�ZdS)rzA stack of frames.NTF�r$�lookup_lines�capture_localsc

Cs�|dkr(ttdd�}|dk	r(|dkr(d}|dk	rV|dkrFt�||�}ntj||d�}|�}t�}|D]Z\}}|j}	|	j}
|	j	}|�
|
�t�|
|j
�|r�|j}nd}|�t|
||d|d��qf|D]}
t�|
�q�|r�|D]
}|jq�|S)a?Create a StackSummary from a traceback or stack object.

        :param frame_gen: A generator that yields (frame, lineno) tuples to
            include in the stack.
        :param limit: None to include all frames or the number of frames to
            include.
        :param lookup_lines: If True, lookup lines for each frame immediately,
            otherwise lookup is deferred until the frame is rendered.
        :param capture_locals: If True, the local variables from each frame will
            be captured as object representations into the FrameSummary.
        N�tracebacklimitr)�maxlenF)rMrL)�getattrr�	itertools�islice�collections�deque�set�f_code�co_filename�co_name�addre�	lazycache�	f_globals�f_locals�appendr�
checkcacher.)
�klass�	frame_genr$rqrr�result�fnamesr@rI�corHrJr�r r r!r(As@
�
zStackSummary.extractc	CsLt�}|D]<}t|t�r$|�|�q
|\}}}}|�t||||d��q
|S)z�
        Create a StackSummary object from a supplied list of
        FrameSummary objects or old-style list of tuples.
        )r.)rrWrr�)r��a_listr��framerHrIrJr.r r r!rqs

zStackSummary.from_listc
Csng}d}d}d}d}|D�]}|dksT||jksT|dksT||jksT|dksT||jkr�|tkr�|t8}|�d|�d|dkr|dnd�d��|j}|j}|j}d}|d7}|tkr�qg}|�d	�|j|j|j��|jr�|�d
�|j����|j�r t	|j�
��D]\}}	|�dj||	d���q|�d�|��q|tk�rj|t8}|�d|�d|dk�r^dnd�d��|S)
aFormat the stack ready for printing.

        Returns a list of strings ready for printing.  Each string in the
        resulting list corresponds to a single frame from the stack.
        Each string ends in a newline; the strings may contain internal
        newlines as well, for those items with source text lines.

        For long sequences of the same frame and line, the first few
        repetitions are shown, followed by a summary line stating the exact
        number of further repetitions.
        Nrz  [Previous line repeated z
 more time��srz]
z  File "{}", line {}, in {}
�    {}
z    {name} = {value}
)rJr-)rHrIrJ�_RECURSIVE_CUTOFFr�rr.rgrL�sortedrSr8)
rTr��	last_file�	last_line�	last_name�countr��rowrJr-r r r!r�sZ
������
�zStackSummary.format)r4rhrirj�classmethodr(rrr r r r!r>s�/
c@s^eZdZdZddddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�dd�ZdS)ra�An exception ready for rendering.

    The traceback module captures enough attributes from the original exception
    to this intermediary form to ensure that no references are held, while
    still being able to fully print or format it.

    Use `from_exception` to create TracebackException instances from exception
    objects, or the constructor to create TracebackException instances from
    individual components.

    - :attr:`__cause__` A TracebackException of the original *__cause__*.
    - :attr:`__context__` A TracebackException of the original *__context__*.
    - :attr:`__suppress_context__` The *__suppress_context__* value from the
      original exception.
    - :attr:`stack` A `StackSummary` representing the traceback.
    - :attr:`exc_type` The class of the original traceback.
    - :attr:`filename` For syntax errors - the filename where the error
      occurred.
    - :attr:`lineno` For syntax errors - the linenumber where the error
      occurred.
    - :attr:`text` For syntax errors - the text where the error
      occurred.
    - :attr:`offset` For syntax errors - the offset into the text where the
      error occurred.
    - :attr:`msg` For syntax errors - the compiler error message.
    NTF�r$rqrr�_seenc	CsJ|dkrt�}|�t|��|r\|jdk	r\t|j�|kr\tt|j�|j|jj|d||d�}nd}|r�|jdk	r�t|j�|kr�tt|j�|j|jj|d||d�}	nd}	||_|	|_|r�|jnd|_t	j
t|�|||d�|_||_
t|�|_|�r8t|t��r8|j|_|j}
|
dk	�rt|
�nd|_|j|_|j|_|j|_|�rF|��dS)NFr�rp)rzr~�id�	__cause__rr+�
__traceback__�__context__�__suppress_context__rr(rrB�exc_typer0�_str�
issubclass�SyntaxErrorrHrIr3�text�offset�msg�_load_lines)rTr��	exc_value�
exc_tracebackr$rqrrr��cause�context�lnor r r!rU�sd��	��	��
zTracebackException.__init__cOs|t|�||jf|�|�S)z.Create a TracebackException from an exception.)r+r�)�cls�exc�args�kwargsr r r!�from_exceptionsz!TracebackException.from_exceptioncCs6|jD]
}|jq|jr"|j��|jr2|j��dS)z7Private API. force all lines in the stack to be loaded.N)rBr.r�r�r�)rTr�r r r!r�s

zTracebackException._load_linescCs|j|jkSrV)�__dict__rZr r r!r\szTracebackException.__eq__cCs|jSrV)r�r`r r r!�__str__szTracebackException.__str__ccs6|jdkrtd|j�VdS|jj}|jj}|dkr@|d|}t|jt�s^t||j�VdSd}|jdk	r�d�|j	pxd|j�Vn|j	dk	r�d�|j	�}|j
}|j}|dk	�rd�|���V|dk	�r|�
d	�}tt|�|�d
}|d|���}dd�|D�}d
�d�|��V|j�p d}d�|||�VdS)a�Format the exception part of the traceback.

        The return value is a generator of strings, each ending in a newline.

        Normally, the generator emits a single string; however, for
        SyntaxError exceptions, it emits several lines that (when
        printed) display detailed information about where the syntax
        error occurred.

        The message indicating which exception occurred is always the last
        string in the output.
        N)�__main__�builtins�.rz  File "{}", line {}
z<string>z ({})r��
r�css|]}|��r|pdVqdS)� N)�isspace)rO�cr r r!�	<genexpr>Msz;TracebackException.format_exception_only.<locals>.<genexpr>z    {}^
z<no detail available>z	{}: {}{}
)r�r2r�rirhr�r�rIrrHr�r�rg�rstrip�min�len�lstripr8r�)rT�stype�smod�filename_suffix�badliner��
caretspacer�r r r!r"s<

�



z(TracebackException.format_exception_onlyr)ccs�|rT|jdk	r*|jj|d�EdHtVn*|jdk	rT|jsT|jj|d�EdHtV|jrpdV|j��EdH|��EdHdS)a�Format the exception.

        If chain is not *True*, *__cause__* and *__context__* will not be formatted.

        The return value is a generator of strings, each ending in a newline and
        some containing internal newlines. `print_exception` is a wrapper around
        this method which just prints the lines to a file.

        The message indicating which exception occurred is always the last
        string in the output.
        Nr)z#Traceback (most recent call last):
)r�r�_cause_messager�r��_context_messagerBr)rTr*r r r!rRs

�zTracebackException.format)r4rhrirjrUr�r�r�r\r�rrr r r r!r�s�:
	0)N)NN)N)N)NNT)NT)NNT)NT)NNT)NNN)NN)NN) rjrxrvrer�__all__r"rrrrr�r�rrrr2r0r	r
rr
rrrrrrr�r/rrr r r r!�<module>sb�




��







A
zcontextlib.cpython-38.pyc000064400000047407151450073350011366 0ustar00U

e5d�a�@sjdZddlZddlZddlZddlmZddlmZddlm	Z	dddd	d
ddd
ddddgZ
Gdd
�d
ej�ZGdd�dej�Z
Gdd
�d
e�ZGdd�d�ZGdd�deee�ZGdd�dee
�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d$�d$�ZGd%d�dee�ZGd&d�dee
�ZGd'd	�d	e�ZdS)(z4Utilities for with-statement contexts.  See PEP 343.�N)�deque��wraps��
MethodType�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppressc@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz,An abstract base class for context managers.cCs|S�z0Return `self` upon entering the runtime context.���selfrr�"/usr/lib64/python3.8/contextlib.py�	__enter__sz AbstractContextManager.__enter__cCsdS�z9Raise any exception triggered within the runtime context.Nr�r�exc_type�	exc_value�	tracebackrrr�__exit__szAbstractContextManager.__exit__cCs|tkrt�|dd�StS)Nrr)r�_collections_abc�_check_methods�NotImplemented��cls�Crrr�__subclasshook__sz'AbstractContextManager.__subclasshook__N)
�__name__�
__module__�__qualname__�__doc__r�abc�abstractmethodr�classmethodr%rrrrrs
c@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz9An abstract base class for asynchronous context managers.c�s|Srrrrrr�
__aenter__'sz&AbstractAsyncContextManager.__aenter__c�sdSrrrrrr�	__aexit__+sz%AbstractAsyncContextManager.__aexit__cCs|tkrt�|dd�StS)Nr-r.)rrr r!r"rrrr%0s
�z,AbstractAsyncContextManager.__subclasshook__N)
r&r'r(r)r-r*r+r.r,r%rrrrr#s
c@s eZdZdZdd�Zdd�ZdS)rzJA base class or mixin that enables context managers to work as decorators.cCs|S)a6Return a recreated instance of self.

        Allows an otherwise one-shot context manager like
        _GeneratorContextManager to support use as
        a decorator via implicit recreation.

        This is a private interface just for _GeneratorContextManager.
        See issue #11647 for details.
        rrrrr�_recreate_cm;s
zContextDecorator._recreate_cmcst����fdd��}|S)Nc
s*�����||�W5QR�SQRXdS�N)r/��args�kwds��funcrrr�innerHs
z(ContextDecorator.__call__.<locals>.innerr)rr5r6rr4r�__call__GszContextDecorator.__call__N)r&r'r(r)r/r7rrrrr8sc@seZdZdZdd�ZdS)�_GeneratorContextManagerBasezBShared functionality for @contextmanager and @asynccontextmanager.cCsJ|||�|_||||_|_|_t|dd�}|dkr@t|�j}||_dS)Nr))�genr5r2r3�getattr�typer))rr5r2r3�docrrr�__init__Rs
z%_GeneratorContextManagerBase.__init__N)r&r'r(r)r=rrrrr8Osr8c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_GeneratorContextManagerz%Helper for @contextmanager decorator.cCs|�|j|j|j�Sr0)�	__class__r5r2r3rrrrr/fsz%_GeneratorContextManager._recreate_cmcCs<|`|`|`zt|j�WStk
r6td�d�YnXdS�Nzgenerator didn't yield)r2r3r5�nextr9�
StopIteration�RuntimeErrorrrrrrls
z"_GeneratorContextManager.__enter__c
Cs|dkr8zt|j�Wntk
r,YdSXtd��n�|dkrF|�}z|j�|||�Wn�tk
r�}z||k	WY�Sd}~XYnttk
r�}z4||kr�WY�&dS|tkr�|j|kr�WY�
dS�W5d}~XYn$t��d|kr�YdS�YnXtd��dS)NF�generator didn't stop�z#generator didn't stop after throw())rAr9rBrC�throw�	__cause__�sys�exc_info)rr;�valuer�excrrrrus.


z!_GeneratorContextManager.__exit__N)r&r'r(r)r/rrrrrrr>as	r>c@s eZdZdZdd�Zdd�ZdS)�_AsyncGeneratorContextManagerz Helper for @asynccontextmanager.c�s6z|j��IdHWStk
r0td�d�YnXdSr@)r9�	__anext__�StopAsyncIterationrCrrrrr-�sz(_AsyncGeneratorContextManager.__aenter__c
�s&|dkr>z|j��IdHWntk
r2YdSXtd��n�|dkrL|�}z"|j�|||�IdHtd��Wn�tk
r�}z||k	WY�Sd}~XYn�tk
r�}z:||kr�WY�,dSt|ttf�r�|j|kr�WY�
dS�W5d}~XYn0tk
�r }z||k	�r�W5d}~XYnXdS)NrDz$generator didn't stop after athrow()F)	r9rMrNrC�athrow�
isinstancerBrG�
BaseException)r�typrJrrKrrrr.�s.




z'_AsyncGeneratorContextManager.__aexit__N)r&r'r(r)r-r.rrrrrL�srLcst���fdd��}|S)a�@contextmanager decorator.

    Typical usage:

        @contextmanager
        def some_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        with some_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)r>r1�r5rr�helper�szcontextmanager.<locals>.helperr�r5rTrrSrr�scst���fdd��}|S)a�@asynccontextmanager decorator.

    Typical usage:

        @asynccontextmanager
        async def some_async_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        async with some_async_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)rLr1rSrrrTsz#asynccontextmanager.<locals>.helperrrUrrSrr�sc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r	a2Context to automatically close something at the end of a block.

    Code like this:

        with closing(<module>.open(<arguments>)) as f:
            <block>

    is equivalent to this:

        f = <module>.open(<arguments>)
        try:
            <block>
        finally:
            f.close()

    cCs
||_dSr0��thing)rrWrrrr=&szclosing.__init__cCs|jSr0rVrrrrr(szclosing.__enter__cGs|j��dSr0)rW�close)rrIrrrr*szclosing.__exit__N�r&r'r(r)r=rrrrrrr	sc@s(eZdZdZdd�Zdd�Zdd�ZdS)�_RedirectStreamNcCs||_g|_dSr0)�_new_target�_old_targets)r�
new_targetrrrr=2sz_RedirectStream.__init__cCs*|j�tt|j��tt|j|j�|jSr0)r\�appendr:rH�_stream�setattrr[rrrrr7sz_RedirectStream.__enter__cCstt|j|j���dSr0)r`rHr_r\�pop�r�exctype�excinst�exctbrrrr<sz_RedirectStream.__exit__)r&r'r(r_r=rrrrrrrZ.srZc@seZdZdZdZdS)raAContext manager for temporarily redirecting stdout to another file.

        # How to send help() to stderr
        with redirect_stdout(sys.stderr):
            help(dir)

        # How to write help() to a file
        with open('help.txt', 'w') as f:
            with redirect_stdout(f):
                help(pow)
    �stdoutN�r&r'r(r)r_rrrrr@sc@seZdZdZdZdS)rzCContext manager for temporarily redirecting stderr to another file.�stderrNrgrrrrrPsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra?Context manager to suppress specified exceptions

    After the exception is suppressed, execution proceeds with the next
    statement following the with statement.

         with suppress(FileNotFoundError):
             os.remove(somefile)
         # Execution still resumes here if the file was already removed
    cGs
||_dSr0)�_exceptions)r�
exceptionsrrrr=aszsuppress.__init__cCsdSr0rrrrrrdszsuppress.__enter__cCs|dk	ot||j�Sr0)�
issubclassrirbrrrrgs
zsuppress.__exit__NrYrrrrrVs
c@sheZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zde_dd�Z
ddd�ZdS)�_BaseExitStackz.A base class for ExitStack and AsyncExitStack.cCs
t||�Sr0r��cm�cm_exitrrr�_create_exit_wrapperwsz#_BaseExitStack._create_exit_wrappercs���fdd�}|S)Ncs����dSr0r�rrK�tb�r2�callbackr3rr�
_exit_wrapper}sz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapperr�rtr2r3rurrsr�_create_cb_wrapper{sz!_BaseExitStack._create_cb_wrappercCst�|_dSr0)r�_exit_callbacksrrrrr=�sz_BaseExitStack.__init__cCst|��}|j|_t�|_|S)z@Preserve the context stack by transferring it to a new instance.)r;rxr)r�	new_stackrrr�pop_all�s
z_BaseExitStack.pop_allcCsBt|�}z
|j}Wntk
r0|�|�YnX|�||�|S)aRegisters a callback with the standard __exit__ method signature.

        Can suppress exceptions the same way __exit__ method can.
        Also accepts any object with an __exit__ method (registering a call
        to the method instead of the object itself).
        )r;r�AttributeError�_push_exit_callback�
_push_cm_exit�r�exit�_cb_type�exit_methodrrr�push�s	
z_BaseExitStack.pushcCs(t|�}|j}|�|�}|�||�|S)z�Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        )r;rrr}�rrn�_cm_type�_exit�resultrrr�
enter_context�s

z_BaseExitStack.enter_contextcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|�|S)
z\Registers an arbitrary callback and arguments.

        Cannot suppress exceptions.
        �zBdescriptor 'callback' of '_BaseExitStack' object needs an argumentrtrN�4Passing 'callback' as keyword argument is deprecated��
stacklevelz8callback expected at least 1 positional argument, got %drE)	�len�	TypeErrorra�warnings�warn�DeprecationWarningrw�__wrapped__r|�r2r3rrtr�rurrrrt�s&

�
�
z_BaseExitStack.callback�#($self, callback, /, *args, **kwds)cCs|�||�}|�|d�dS)z;Helper to correctly register callbacks to __exit__ methods.TN)rpr|�rrnrorurrrr}�sz_BaseExitStack._push_cm_exitTcCs|j�||f�dSr0)rxr^)rrt�is_syncrrrr|�sz"_BaseExitStack._push_exit_callbackN)T)r&r'r(r)�staticmethodrprwr=rzr�r�rt�__text_signature__r}r|rrrrrlts

rlc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�Context manager for dynamic management of a stack of exit callbacks.

    For example:
        with ExitStack() as stack:
            files = [stack.enter_context(open(fname)) for fname in filenames]
            # All opened files will automatically be closed at the end of
            # the with statement, even if attempts to open files later
            # in the list raise an exception.
    cCs|Sr0rrrrrr�szExitStack.__enter__c
s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}|sHt�z||�r^d}d}d}Wq,t��}||d|d�d}|}Yq,Xq,|r�z|dj}	|d�Wn tk
r�|	|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0��__context__��new_exc�old_exc�exc_context��	frame_excrr�_fix_exception_context�sz2ExitStack.__exit__.<locals>._fix_exception_contextFT�NNN)rHrIrxra�AssertionErrorr�rQ)
r�exc_details�received_excr��suppressed_exc�
pending_raiser��cb�new_exc_details�	fixed_ctxrr�rr�s4

zExitStack.__exit__cCs|�ddd�dS�z%Immediately unwind the context stack.N)rrrrrrXszExitStack.closeN)r&r'r(r)rrrXrrrrr�s
1c@sfeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	de	_
d
d�Zdd�Zdd�Z
dd�ZdS)r
a�Async context manager for dynamic management of a stack of exit
    callbacks.

    For example:
        async with AsyncExitStack() as stack:
            connections = [await stack.enter_async_context(get_connection())
                for i in range(5)]
            # All opened connections will automatically be released at the
            # end of the async with statement, even if attempts to open a
            # connection later in the list raise an exception.
    cCs
t||�Sr0rrmrrr�_create_async_exit_wrapper&sz)AsyncExitStack._create_async_exit_wrappercs���fdd�}|S)Nc�s����IdHdSr0rrqrsrrru,sz>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperrrvrrsr�_create_async_cb_wrapper*sz'AsyncExitStack._create_async_cb_wrapperc�s.t|�}|j}|�|�IdH}|�||�|S)z�Enters the supplied async context manager.

        If successful, also pushes its __aexit__ method as a callback and
        returns the result of the __aenter__ method.
        N)r;r.r-�_push_async_cm_exitr�rrr�enter_async_context0s
z"AsyncExitStack.enter_async_contextcCsDt|�}z
|j}Wn tk
r2|�|d�YnX|�||�|S)a#Registers a coroutine function with the standard __aexit__ method
        signature.

        Can suppress exceptions the same way __aexit__ method can.
        Also accepts any object with an __aexit__ method (registering a call
        to the method instead of the object itself).
        F)r;r.r{r|r�r~rrr�push_async_exit<s
zAsyncExitStack.push_async_exitcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|d
�|S)zfRegisters an arbitrary coroutine function and arguments.

        Cannot suppress exceptions.
        r�zMdescriptor 'push_async_callback' of 'AsyncExitStack' object needs an argumentrtrNr�r�zCpush_async_callback expected at least 1 positional argument, got %drEF)	r�r�rar�r�r�r�r�r|r�rrr�push_async_callbackNs&

�
�z"AsyncExitStack.push_async_callbackr�c�s|�ddd�IdHdSr�)r.rrrr�aclosekszAsyncExitStack.aclosecCs|�||�}|�|d�dS)zLHelper to correctly register coroutine function to __aexit__
        method.FN)r�r|r�rrrr�osz"AsyncExitStack._push_async_cm_exitc�s|Sr0rrrrrr-uszAsyncExitStack.__aenter__c�s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z0|rP||�}n||�IdH}|rnd}d}d}Wq,t��}	||	d|d�d}|	}Yq,Xq,|r�z|dj}
|d�Wn tk
r�|
|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0r�r�r�rrr�~sz8AsyncExitStack.__aexit__.<locals>._fix_exception_contextFTr�)rHrIrxrar�rQ)rr�r�r�r�r�r�r��cb_suppressr�r�rr�rr.xs8


zAsyncExitStack.__aexit__N)r&r'r(r)r�r�r�r�r�r�r�r�r�r-r.rrrrr
s

c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
r
aOContext manager that does no additional processing.

    Used as a stand-in for a normal context manager, when a particular
    block of code is only sometimes used with a normal context manager:

    cm = optional_cm if condition else nullcontext()
    with cm:
        # Perform operation, using optional_cm if condition is True
    NcCs
||_dSr0��enter_result)rr�rrrr=�sznullcontext.__init__cCs|jSr0r�rrrrr�sznullcontext.__enter__cGsdSr0r)r�excinforrrr�sznullcontext.__exit__)NrYrrrrr
�s

)r)r*rHr�collectionsr�	functoolsr�typesr�__all__�ABCrr�objectrr8r>rLrrr	rZrrrrlrr
r
rrrr�<module>sN��D�.!!`Esched.cpython-38.pyc000064400000014606151450073350010274 0ustar00U

e5d*�@s�dZddlZddlZddlmZddlZddlmZdgZGdd�dedd��Z	d	e	j_d
e	j
_de	j_de	j_d
e	j
_e�ZGdd�d�ZdS)a�A generally useful event scheduler class.

Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.

Each instance is parametrized with two functions, one that is
supposed to return the current time, one that is supposed to
implement a delay.  You can implement real-time scheduling by
substituting time and sleep from built-in module time, or you can
implement simulated time by writing your own functions.  This can
also be used to integrate scheduling with STDWIN events; the delay
function is allowed to modify the queue.  Time can be expressed as
integers or floating point numbers, as long as it is consistent.

Events are specified by tuples (time, priority, action, argument, kwargs).
As in UNIX, lower priority numbers mean higher priority; in this
way the queue can be maintained as a priority queue.  Execution of the
event means calling the action function, passing it the argument
sequence in "argument" (remember that in Python, multiple function
arguments are be packed in a sequence) and keyword parameters in "kwargs".
The action function may be an instance method so it
has another way to reference private data (besides global variables).
�N)�
namedtuple)�	monotonic�	schedulerc@s8eZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�EventcCs|j|jf|j|jfkS�N��time�priority��s�o�r
�/usr/lib64/python3.8/sched.py�__eq__$�zEvent.__eq__cCs|j|jf|j|jfkSrrr
r
r
r�__lt__%rzEvent.__lt__cCs|j|jf|j|jfkSrrr
r
r
r�__le__&rzEvent.__le__cCs|j|jf|j|jfkSrrr
r
r
r�__gt__'rzEvent.__gt__cCs|j|jf|j|jfkSrrr
r
r
r�__ge__(rzEvent.__ge__N)	�__name__�
__module__�__qualname__�	__slots__rrrrrr
r
r
rr"srz(time, priority, action, argument, kwargszaNumeric type compatible with the return value of the
timefunc function passed to the constructor.zSEvents scheduled for the same time will be executed
in the order of their priority.z?Executing the event means executing
action(*argument, **kwargs)zGargument is a sequence holding the positional
arguments for the action.zDkwargs is a dictionary holding the keyword
arguments for the action.c@s^eZdZeejfdd�Zdefdd�Zdefdd�Z	dd	�Z
d
d�Zdd
d�Ze
dd��ZdS)rcCs g|_t��|_||_||_dS)zGInitialize a new instance, passing the time and delay
        functionsN)�_queue�	threading�RLock�_lock�timefunc�	delayfunc)�selfrrr
r
r�__init__9s
zscheduler.__init__r
c	Cs@|tkri}t|||||�}|j�t�|j|�W5QRX|S)z�Enter a new event in the queue at an absolute time.

        Returns an ID for the event which can be used to remove it,
        if necessary.

        )�	_sentinelrr�heapq�heappushr)rrr	�action�argument�kwargs�eventr
r
r�enterabsAszscheduler.enterabscCs|��|}|�|||||�S)z{A variant that specifies the time as a relative time.

        This is actually the more commonly used interface.

        )rr()r�delayr	r$r%r&rr
r
r�enterOszscheduler.enterc	Cs.|j�|j�|�t�|j�W5QRXdS)z�Remove an event from the queue.

        This must be presented the ID as returned by enter().
        If the event is not in the queue, this raises ValueError.

        N)rr�remover"�heapify)rr'r
r
r�cancelXszscheduler.cancelc
Cs&|j�|jW5QR�SQRXdS)z!Check whether the queue is empty.N)rr)rr
r
r�emptycszscheduler.emptyTc	Cs�|j}|j}|j}|j}tj}|�H|s4W5QR�q�|d\}}}	}
}|�}||krZd}
nd}
||�W5QRX|
r�|s�||S|||�q|	|
|�|d�qdS)aExecute events until the queue is empty.
        If blocking is False executes the scheduled events due to
        expire soonest (if any) and then return the deadline of the
        next scheduled call in the scheduler.

        When there is a positive delay until the first event, the
        delay function is called and the event is left in the queue;
        otherwise, the event is removed from the queue and executed
        (its action function is called, passing it the argument).  If
        the delay function returns prematurely, it is simply
        restarted.

        It is legal for both the delay function and the action
        function to modify the queue or to raise an exception;
        exceptions are not caught but the scheduler's state remains
        well-defined so run() may be called again.

        A questionable hack is added to allow other threads to run:
        just after an event is executed, a delay of 0 is executed, to
        avoid monopolizing the CPU when other threads are also
        runnable.

        rTFN)rrrrr"�heappop)rZblocking�lock�qrr�poprr	r$r%r&Znowr)r
r
r�runhs(
z
scheduler.runc	Cs:|j�|jdd�}W5QRXtttj|gt|���S)z�An ordered list of upcoming events.

        Events are named tuples with fields for:
            time, priority, action, arguments, kwargs

        N)rr�list�mapr"r/�len)rZeventsr
r
r�queue�szscheduler.queueN)T)rrr�_timer�sleepr r!r(r*r-r.r3�propertyr7r
r
r
rr7s	
2)�__doc__rr"�collectionsrrrr8�__all__rr	r$r%r&�objectr!rr
r
r
r�<module>sconfigparser.cpython-38.opt-2.pyc000064400000074112151450073350012626 0ustar00U

e5df��@s�ddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZdddddd	d
ddd
dddddddddddgZe
ZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d
�d
e�ZGd#d�de�ZGd$d	�d	e�ZGd%d�de�ZGd&d
�d
e�Ze�ZGd'd�d�ZGd(d�de�Z Gd)d�de�Z!Gd*d�de�Z"Gd+d�de�Z#Gd,d�de#�Z$Gd-d�de$�Z%Gd.d�de�Z&Gd/d�de�Z'dS)0�)�MutableMapping)�ChainMapN�NoSectionError�DuplicateOptionError�DuplicateSectionError�
NoOptionError�InterpolationError�InterpolationDepthError�InterpolationMissingOptionError�InterpolationSyntaxError�ParsingError�MissingSectionHeaderError�ConfigParser�SafeConfigParser�RawConfigParser�
Interpolation�BasicInterpolation�ExtendedInterpolation�LegacyInterpolation�SectionProxy�ConverterMapping�DEFAULTSECT�MAX_INTERPOLATION_DEPTHZDEFAULT�
c@s"eZdZddd�Zdd�ZeZdS)�Error�cCs||_t�||�dS�N)�message�	Exception�__init__)�self�msg�r"�$/usr/lib64/python3.8/configparser.pyr�szError.__init__cCs|jSr)r�r r"r"r#�__repr__�szError.__repr__N)r)�__name__�
__module__�__qualname__rr%�__str__r"r"r"r#r�s
rc@seZdZdd�ZdS)rcCs$t�|d|f�||_|f|_dS)NzNo section: %r)rr�section�args�r r*r"r"r#r�szNoSectionError.__init__N�r&r'r(rr"r"r"r#r�sc@seZdZddd�ZdS)rNcCs�t|�dg}|dk	rRdt|�g}|dk	r8|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
|||f|_dS)N� already exists�While reading from � [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr*�source�linenor+)r r*r7r8r!rr"r"r#r�s

zDuplicateSectionError.__init__)NNr-r"r"r"r#r�sc@seZdZddd�ZdS)rNcCs�t|�dt|�dg}|dk	rZdt|�g}|dk	r@|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
||_||||f|_dS)	Nz in section r.r/r0z	: option rzOption r)
r1r2r3r4r5rrr6r*�optionr7r8r+)r r*r9r7r8r!rr"r"r#r�s"�

zDuplicateOptionError.__init__)NNr-r"r"r"r#r�sc@seZdZdd�ZdS)rcCs.t�|d||f�||_||_||f|_dS)NzNo option %r in section: %r�rrr9r*r+)r r9r*r"r"r#r�s�zNoOptionError.__init__Nr-r"r"r"r#r�sc@seZdZdd�ZdS)rcCs(t�||�||_||_|||f|_dSrr:)r r9r*r!r"r"r#rszInterpolationError.__init__Nr-r"r"r"r#r�sc@seZdZdd�ZdS)r
cCs8d�||||�}t�||||�||_||||f|_dS)Nz�Bad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})r3rr�	referencer+)r r9r*�rawvalr;r!r"r"r#rs�z(InterpolationMissingOptionError.__init__Nr-r"r"r"r#r
sc@seZdZdS)rN)r&r'r(r"r"r"r#rsc@seZdZdd�ZdS)r	cCs0d�||t|�}t�||||�|||f|_dS)Nz�Recursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})r3rrrr+)r r9r*r<r!r"r"r#rs�z InterpolationDepthError.__init__Nr-r"r"r"r#r	sc@s8eZdZd	dd�Zedd��Zejdd��Zdd�ZdS)
rNcCsT|r|rtd��n|s$|s$td��n|r,|}t�|d|�||_g|_|f|_dS)Nz:Cannot specify both `filename' and `source'. Use `source'.z%Required argument `source' not given.z"Source contains parsing errors: %r)�
ValueErrorrrr7�errorsr+)r r7�filenamer"r"r#r,s

zParsingError.__init__cCstjdtdd�|jS�NzSThe 'filename' attribute will be removed in future versions.  Use 'source' instead.���
stacklevel��warnings�warn�DeprecationWarningr7r$r"r"r#r?;s�zParsingError.filenamecCstjdtdd�||_dSr@rD�r �valuer"r"r#r?Es�cCs*|j�||f�|jd||f7_dS)Nz
	[line %2d]: %s)r>r2r)r r8�liner"r"r#r2OszParsingError.append)NN)r&r'r(r�propertyr?�setterr2r"r"r"r#r)s

	
	c@seZdZdd�ZdS)r
cCs8t�|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr7r8rJr+)r r?r8rJr"r"r#rWs��z"MissingSectionHeaderError.__init__Nr-r"r"r"r#r
Tsc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|Srr")r �parserr*r9rI�defaultsr"r"r#�
before_getkszInterpolation.before_getcCs|Srr"�r rMr*r9rIr"r"r#�
before_setnszInterpolation.before_setcCs|Srr"rPr"r"r#�before_readqszInterpolation.before_readcCs|Srr"rPr"r"r#�before_writetszInterpolation.before_writeN)r&r'r(rOrQrRrSr"r"r"r#rhsc@s.eZdZe�d�Zdd�Zdd�Zdd�ZdS)	rz
%\(([^)]+)\)sc	Cs$g}|�||||||d�d�|�S�N�r��_interpolate_somer6�r rMr*r9rIrN�Lr"r"r#rO�szBasicInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz%%r�%�1invalid interpolation syntax in %r at position %d��replace�_KEYCRE�subr=�find�r rMr*r9rIZ	tmp_valuer"r"r#rQ�s�zBasicInterpolation.before_setc
Csj|j||d|d�}|tkr&t|||��|�rf|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rR|j�|�}|dkr�t||d|��|�|�	d��}||�
�d�}z||}
Wn&tk
�rt||||�d�YnXd|
k�rF|�
||||
|||d�n
|�|
�q&t||d	|f��q&dS)
NT��raw�fallbackrZrrUrA�(�'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr	r`r2r^�matchr�optionxform�group�end�KeyErrorr
rW)r rMr9�accum�restr*�map�depthr<�p�c�m�var�vr"r"r#rW�s`



���
���z$BasicInterpolation._interpolate_someN�	r&r'r(�re�compiler^rOrQrWr"r"r"r#rxs
c@s.eZdZe�d�Zdd�Zdd�Zdd�ZdS)	rz
\$\{([^}]+)\}c	Cs$g}|�||||||d�d�|�SrTrVrXr"r"r#rO�sz ExtendedInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz$$r�$r[r\rar"r"r#rQ�s�z ExtendedInterpolation.before_setcCs�|j||d|d�}|tkr&t|||��|�r�|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�r�|j�|�}|dkr�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn2t
ttfk
�r�t|||d	�|��d�YnXd|k�r�|�|||||
t|j|
dd
��|d�n
|�|�q&t||d|f��q&dS)
NTrbryrrUrA�{rf�:)rczMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rgrr	r`r2r^rhrrj�splitrk�lenrirlrrr
r6rW�dict�items)r rMr9rmrnr*rorpr<rqrrrs�pathZsect�optrur"r"r#rW�sx



�
���
���z'ExtendedInterpolation._interpolate_someNrvr"r"r"r#r�s
c@s2eZdZe�d�Zdd�Zdd�Zedd��Z	dS)	rz%\(([^)]*)\)s|.c

Cs�|}t}|r�|d8}|r�d|kr�tj|j|d�}|j�||�}z||}Wq�tk
r�}	zt||||	jd�d�W5d}	~	XYq�Xqq�q|r�d|kr�t	|||��|S)NrUz%()rMr)
r�	functools�partial�_interpolation_replacer^r_rlr
r+r	)
r rMr*r9rI�varsr<rpr]�er"r"r#rOs0���zLegacyInterpolation.before_getcCs|Srr"rPr"r"r#rQ$szLegacyInterpolation.before_setcCs,|�d�}|dkr|��Sd|�|�SdS)NrUz%%(%s)s)rjri)rhrM�sr"r"r#r�'s
z*LegacyInterpolation._interpolation_replaceN)
r&r'r(rwrxr^rOrQ�staticmethodr�r"r"r"r#r
s

c
s2eZdZdZdZdZe�Ze�	eej
�Ze�	ejdd�ej
�Z
e�	ejdd�ej
�Ze�	d�Zddddddddd	�Zd
edfddd
ddeeed
�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdcdd�Zdddd�Zdedd �Zdfd"d#�Zdgd$d%�Zdd
ed&�d'd(�Zd)d*�Z dd
ed&�d+d,�Z!dd
ed&�d-d.�Z"dd
ed&�d/d0�Z#dd
ed&�d1d2�Z$edd
f�fd3d4�	Z%d5d6�Z&d7d8�Z'd9d:�Z(dhd;d<�Z)did=d>�Z*d?d@�Z+dAdB�Z,dCdD�Z-dEdF�Z.dGdH�Z/dIdJ�Z0dKdL�Z1dMdN�Z2dOdP�Z3dQdR�Z4dSdT�Z5dUdV�Z6dWdX�Z7dYdZ�Z8d[d\�Z9d]d]d]d^�d_d`�Z:e;dadb��Z<�Z=S)jrz�
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        z=|:�Zdelimz\STF)�1Zyes�trueZon�0ZnoZfalseZoffN��=r{)�#�;)�
delimiters�comment_prefixes�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
convertersc
Cs<||_|��|_|��|_t|�|_|��|_t||	�|j|	<t|�|_|dkrd|rZ|j	n|j
|_nNd�dd�|D��}|r�t
�|jj|d�t
j�|_nt
�|jj|d�t
j�|_t|p�d�|_t|p�d�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdk�rt�|_|tk	�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rw�escape)�.0�dr"r"r#�	<genexpr>jsz+RawConfigParser.__init__.<locals>.<genexpr>r�r")�_dict�	_sections�	_defaultsr�_converters�_proxiesr�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer6rwrx�_OPT_NV_TMPLr3�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update�_read_defaults)
r rNZ	dict_typeZallow_no_valuer�r�r�r�r�r�r�r�r�r"r"r#rYs@




��

zRawConfigParser.__init__cCs|jSr)r�r$r"r"r#rN�szRawConfigParser.defaultscCst|j���Sr)�listr��keysr$r"r"r#�sections�szRawConfigParser.sectionscCsJ||jkrtd|��||jkr(t|��|��|j|<t||�|j|<dS)NzInvalid section name: %r)r�r=r�rr�rr�r,r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jkSr)r�r,r"r"r#�has_section�szRawConfigParser.has_sectioncCsJz|j|��}Wntk
r0t|�d�YnX|�|j�t|���Sr)r��copyrlrr�r�r�r�)r r*Zoptsr"r"r#�options�szRawConfigParser.optionsc
Cs�t|tttjf�r|g}g}|D]f}z(t||d��}|�||�W5QRXWntk
rdYq YnXt|tj�r|t�|�}|�	|�q |S)N)�encoding)
�
isinstance�str�bytes�os�PathLike�open�_read�OSError�fspathr2)r �	filenamesr�Zread_okr?�fpr"r"r#�read�s

zRawConfigParser.readcCs<|dkr,z
|j}Wntk
r*d}YnX|�||�dS)Nz<???>)�name�AttributeErrorr�)r �fr7r"r"r#�	read_file�s

zRawConfigParser.read_file�<string>cCst�|�}|�||�dSr)�io�StringIOr�)r �stringr7Zsfiler"r"r#�read_string�s
zRawConfigParser.read_string�<dict>c
Cs�t�}|��D]�\}}t|�}z|�|�Wn(ttfk
rT|jrP||krP�YnX|�|�|��D]`\}}|�t|��}|dk	r�t|�}|jr�||f|kr�t	|||��|�||f�|�|||�qhqdSr)
�setrr�r�rr=r��addrir)r Z
dictionaryr7�elements_addedr*r��keyrIr"r"r#�	read_dict�s"

zRawConfigParser.read_dictcCs"tjdtdd�|j||d�dS)NzRThis method will be removed in future versions.  Use 'parser.read_file()' instead.rArB)r7)rErFrGr�)r r�r?r"r"r#�readfp�s�zRawConfigParser.readfp�rcr�rdcCs�z|�||�}Wn(tk
r8|tkr,�n|YSYnX|�|�}z||}Wn0tk
r�|tkrtt||��n|YSYnX|s�|dkr�|S|j�|||||�SdSr)�
_unify_valuesrr�rirlrr�rO)r r*r9rcr�rdr�rIr"r"r#rg�s$
�zRawConfigParser.getcKs||j||f|��Sr)rg)r r*�convr9�kwargsr"r"r#�_get"szRawConfigParser._getc	KsJz|j|||f||d�|��WSttfk
rD|tkr<�|YSXdS)N)rcr�)r�rrr�)r r*r9r�rcr�rdr�r"r"r#�	_get_conv%s�zRawConfigParser._get_convcKs|j||tf|||d�|��S�Nr�)r��int�r r*r9rcr�rdr�r"r"r#�getint0s
��zRawConfigParser.getintcKs|j||tf|||d�|��Sr�)r��floatr�r"r"r#�getfloat5s
��zRawConfigParser.getfloatcKs |j|||jf|||d�|��Sr�)r��_convert_to_booleanr�r"r"r#�
getboolean:s��zRawConfigParser.getbooleancs��tkrt���S�j���z���j��Wn&tk
rV��jkrRt	���YnXt
����}|r�|��D]\}}|���|�<qp���fdd��|r��fdd���fdd�|D�S)Ncs�j���|�|��Sr)r�rO�r9)r�r*r r"r#�<lambda>Ws
�z'RawConfigParser.items.<locals>.<lambda>cs�|Srr"r�)r�r"r#r�Z�csg|]}|�|�f�qSr"r")r�r9)�value_getterr"r#�
<listcomp>[sz)RawConfigParser.items.<locals>.<listcomp>)
r��superrr�r�r�r�rlr�rr�r�ri)r r*rcr�Z	orig_keysr�rI��	__class__)r�r*r r�r#r?s 


zRawConfigParser.itemscCs.|��D]}||}||=||fSt�dSr)r�rl�r r�rIr"r"r#�popitem]s
zRawConfigParser.popitemcCs|��Sr)�lower)r Z	optionstrr"r"r#rijszRawConfigParser.optionxformcCsV|r||jkr"|�|�}||jkS||jkr0dS|�|�}||j|kpP||jkSdS)NF)r�rir�r�)r r*r9r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsl|r|j�||||�}|r$||jkr,|j}n.z|j|}Wntk
rXt|�d�YnX|||�|�<dSr)r�rQr�r�r�rlrri)r r*r9rI�sectdictr"r"r#r�{s�zRawConfigParser.setcCsh|rd�|jd�}n
|jd}|jr>|�||j|j��|�|jD]}|�|||j|��|�qDdS)Nz {} r)r3r�r��_write_sectionr�rr�)r r�Zspace_around_delimitersr�r*r"r"r#�write�s

�
�zRawConfigParser.writecCsx|�d�|��|D]T\}}|j�||||�}|dk	s<|jsR|t|��dd�}nd}|�d�||��q|�d�dS)Nz[{}]
�
z
	rz{}{}
)r�r3r�rSr�r�r])r r�Zsection_nameZ
section_itemsZ	delimiterr�rIr"r"r#r��s�zRawConfigParser._write_sectioncCsd|r||jkr|j}n.z|j|}Wntk
rBt|�d�YnX|�|�}||k}|r`||=|Sr)r�r�r�rlrri)r r*r9r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jk}|r|j|=|j|=|Sr)r�r�)r r*r�r"r"r#�remove_section�s

zRawConfigParser.remove_sectioncCs&||jkr|�|�st|��|j|Sr)r�r�rlr��r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsX||kr|||krdS||jkr.|j��n||jkrF|j|��|�||i�dSr)r�r��clearr�r�r�r"r"r#�__setitem__�s

zRawConfigParser.__setitem__cCs2||jkrtd��|�|�s$t|��|�|�dS)Nz"Cannot remove the default section.)r�r=r�rlr�r�r"r"r#�__delitem__�s


zRawConfigParser.__delitem__cCs||jkp|�|�Sr)r�r�r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrU)r}r�r$r"r"r#�__len__�szRawConfigParser.__len__cCst�|jf|j���Sr)�	itertools�chainr�r�r�r$r"r"r#�__iter__�szRawConfigParser.__iter__cCs t�}d}d}d}d}d}d}	t|dd�D�]�\}}
tj}dd�|jD�}|tjkr�|r�i}
|��D]T\}}|
�||d�}|dkr�qd||
|<|dks�|dkrd|
|d��rdt||�}qd|
}qJ|j	D]}|
�
��|�r�d}q�q�|tjkr�d}|
d|��
�}|�sN|j�rF|dk�rL|dk	�rL|�rL||dk	�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|dk	�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d�}||jk�r�|j�r�||k�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|dk�rTt|||
��q*|j�|�}|�r�|�d	d
d�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|k�r�t"||||��|�||f�|dk	�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)NrrU)�startcSsi|]
}|d�qS)���r")r�rqr"r"r#�
<dictcomp>�sz)RawConfigParser._read.<locals>.<dictcomp>rr�headerr9�virI)$r��	enumerate�sys�maxsizer�rr`�isspace�minr��strip�
startswithr�r2�NONSPACECRE�searchr�SECTCRErhrjr�r�rr�r�r�r�rr�r
r��
_handle_errorri�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer8Zindent_levelr�rJZ
comment_startZinline_prefixesZ
next_prefixes�prefix�indexrIZfirst_nonspaceZcur_indent_levelZmorZoptvalr"r"r#r��s� 


��
��
�




��

zRawConfigParser._readcCsr|j|jf}t�|f|j���}|D]H\}}|��D]6\}}t|t�rTd�|��	�}|j
�||||�||<q4q$dS)Nr�)r�r�rrr�rr�r�r6rr�rR)r rNZall_sectionsr*r�r��valr"r"r#r[s�
�z&RawConfigParser._join_multiline_valuescCs&|��D]\}}||j|�|�<qdSr)rr�ri)r rNr�rIr"r"r#r�gszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr2r1)r �excrr8rJr"r"r#rmszRawConfigParser._handle_errorcCs�i}z|j|}Wn(tk
r:||jkr6t|�d�YnXi}|rt|��D]&\}}|dk	rdt|�}|||�|�<qLt|||j�Sr)	r�rlr�rrr�ri�	_ChainMapr�)r r*r�ZsectiondictZvardictr�rIr"r"r#r�ss
zRawConfigParser._unify_valuescCs(|��|jkrtd|��|j|��S)NzNot a boolean: %s)r��BOOLEAN_STATESr=rHr"r"r#r��sz#RawConfigParser._convert_to_booleanr)r*r9rIcCsDt|t�std��t|t�s$td��|jr.|r@t|t�s@td��dS)Nzsection names must be stringszoption keys must be stringszoption values must be strings)r�r��	TypeErrorr��r r*r9rIr"r"r#�_validate_value_types�s



z%RawConfigParser._validate_value_typescCs|jSr)r�r$r"r"r#r��szRawConfigParser.converters)N)N)r�)r�)N)N)T)>r&r'r(Z
_SECT_TMPLr�r�rr�rwrxr�rr3r�r�rr�
_default_dictrr�rrNr�r�r�r�r�r�r�r�r�rgr�r�r�r�r�rr�rir�r�r�r�r�r�r�r�r�r�rrr�rr�rr�r�rrKr��
__classcell__r"r"r�r#r0s�

���(	




	%����




zcs8eZdZe�Zd�fdd�	Z�fdd�Zdd�Z�ZS)	rNcs"|j||d�t��|||�dS�N)r9rI)rr�r�rr�r"r#r��szConfigParser.setcs|j|d�t��|�dS)N)r*)rr�r�r,r�r"r#r��szConfigParser.add_sectioncCs0z"|j}t�|_|�|j|i�W5||_XdSr)r�rr�r�)r rNZhold_interpolationr"r"r#r��s
zConfigParser._read_defaults)N)	r&r'r(rr�r�r�r�r!r"r"r�r#r�scseZdZ�fdd�Z�ZS)rcs"t�j||�tjdtdd�dS)Nz�The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.rArB)r�rrErFrG)r r+r�r�r"r#r�s�zSafeConfigParser.__init__)r&r'r(rr!r"r"r�r#r�sc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zedd��Z
edd��Zddddd�dd�ZdS)rcCsF||_||_|jD].}d|}tj|jt||�d�}t|||�qdS)Nrg��_impl)�_parser�_namer�r�r�rg�getattr�setattr)r rMr�r�r��getterr"r"r#r�s
zSectionProxy.__init__cCsd�|j�S)Nz
<Section: {}>)r3r&r$r"r"r#r%�szSectionProxy.__repr__cCs(|j�|j|�st|��|j�|j|�Sr)r%r�r&rlrgr�r"r"r#r��szSectionProxy.__getitem__cCs"|jj||d�|j�|j||�Sr")r%rr�r&r�r"r"r#r��szSectionProxy.__setitem__cCs,|j�|j|�r |j�|j|�s(t|��dSr)r%r�r&r�rlr�r"r"r#r��s�zSectionProxy.__delitem__cCs|j�|j|�Sr)r%r�r&r�r"r"r#r��szSectionProxy.__contains__cCst|���Sr)r}�_optionsr$r"r"r#r�szSectionProxy.__len__cCs|����Sr)r*rr$r"r"r#r�szSectionProxy.__iter__cCs*|j|jjkr|j�|j�S|j��SdSr)r&r%r�r�rNr$r"r"r#r*�szSectionProxy._optionscCs|jSr)r%r$r"r"r#rMszSectionProxy.parsercCs|jSr)r&r$r"r"r#r�szSectionProxy.nameNF)rcr�r$cKs(|s|jj}||j|f|||d�|��Sr�)r%rgr&)r r9rdrcr�r$r�r"r"r#rgs
��zSectionProxy.get)N)r&r'r(rr%r�r�r�r�rrr*rKrMr�rgr"r"r"r#r�s 	

�c@sFeZdZe�d�Zdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�ZdS)rz^get(?P<name>.+)$cCsR||_i|_t|j�D]6}|j�|�}|rtt|j|��s<qd|j|�d�<qdS)Nr�)r%�_data�dir�	GETTERCRErh�callabler'rj)r rMr)rsr"r"r#r%szConverterMapping.__init__cCs
|j|Sr)r+r�r"r"r#r�.szConverterMapping.__getitem__c	Cs�zd|}Wn(tk
r4td�|t|����YnX|dkrFtd��||j|<tj|jj|d�}||_	t
|j||�|j��D] }tj|j|d�}t
|||�q�dS)NrgzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a name)r�r#)
rr=r3�typer+r�r�r%r�Z	converterr(�valuesrg)r r�rI�k�func�proxyr)r"r"r#r�1s �
zConverterMapping.__setitem__c	Cs~zd|p
d}Wntk
r,t|��YnX|j|=t�|jf|j���D],}zt||�WqLtk
rvYqLYqLXqLdS)Nrg)	rrlr+rrr%r0�delattrr�)r r�r1�instr"r"r#r�AszConverterMapping.__delitem__cCs
t|j�Sr)�iterr+r$r"r"r#rOszConverterMapping.__iter__cCs
t|j�Sr)r}r+r$r"r"r#rRszConverterMapping.__len__N)r&r'r(rwrxr-rr�r�r�rrr"r"r"r#rs
	)(Zcollections.abcr�collectionsrrr�r�rr�rwr
rE�__all__r~r rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>�sp�	
	

+HJ&| 
Fnturl2path.cpython-38.opt-2.pyc000064400000002457151450073350012252 0ustar00U

e5dG�@sdd�Zdd�ZdS)cCs�ddl}ddl}|�dd�}d|kr\|dd�dkr@|dd�}|�d�}|j�d�|��S|�d�}t|�dks�|dd	|jkr�d
|}t	|��|dd	�
�}|d�d�}|d}|D]}|r�|d|j�|�}q�|�d�r�|�d�r�|d7}|S)N��:�|�z////��/�\���z	Bad URL: �)�string�urllib.parse�replace�split�parseZunquote�join�lenZ
ascii_letters�OSError�upper�endswith)Zurlr
�urllib�
components�comp�error�drive�path�r�"/usr/lib64/python3.8/nturl2path.py�url2pathnames(	

rcCs4ddl}|dd�dkrf|dd�}|dd���dkrJd|dd�}n|dd�dkrftd	|��d|kr�|dd�d
kr�d
|}|�d�}|j�d�|��S|jddd�}t|�dks�t|d�dkr�d	|}t|��|j�|d���}|d�d�}d
|d}|D] }|�r|d|j�|�}�q|S)Nrrz\\?\zUNC\rr	rrz
Bad path: z\\r)�maxsplitz///)rrrr
rZquoterr)�prrrrrrrrr�pathname2url-s.
rN)rrrrrr�<module>s%secrets.cpython-38.opt-2.pyc000064400000002156151450073350011613 0ustar00U

e5d��@s�ddddddddgZdd	lZdd	lZdd	lZdd
lmZddlmZe�Zej	Z
ejZdd�Zd
Z
ddd�Zddd�Zddd�Zd	S)�choice�	randbelow�randbits�SystemRandom�token_bytes�	token_hex�
token_urlsafe�compare_digest�N)r)rcCs|dkrtd��t�|�S)Nr	zUpper bound must be positive.)�
ValueError�_sysrandZ
_randbelow)Zexclusive_upper_bound�r�/usr/lib64/python3.8/secrets.pyrs� cCs|dkrt}t�|�S)N)�DEFAULT_ENTROPY�os�urandom��nbytesrrr
r#s
cCst�t|���d�S)N�ascii)�binasciiZhexlifyr�decoderrrr
r1scCst|�}t�|��d��d�S)N�=r)r�base64Zurlsafe_b64encode�rstripr)r�tokrrr
r>s
)N)N)N)�__all__rrrZhmacrZrandomrrZgetrandbitsrrrrrrrrrrr
�<module>	s$�


_pyio.cpython-38.opt-1.pyc000064400000220515151450073350011262 0ustar00U

e5d�k�@s|dZddlZddlZddlZddlZddlZddlZddlmZ	ej
dkrXddlmZ
ndZ
ddlZddlmZmZmZmZdddhZeed	�r�e�ej�e�ej�d
ZeZeed�p�ejjZd7dd�Zdd�Zz
ejZWne k
�r�eZYnXGdd�d�Z!Gdd�d�Z"z
ej#Z#Wn(e k
�rHGdd�de$e%�Z#YnXGdd�dej&d�Z'ej'�(e'�Gdd�de'�Z)ej)�(e)�ddl*m+Z+e)�(e+�Gdd �d e'�Z,ej,�(e,�Gd!d"�d"e,�Z-Gd#d$�d$e,�Z.Gd%d&�d&e-�Z/Gd'd(�d(e-�Z0Gd)d*�d*e,�Z1Gd+d,�d,e0e/�Z2Gd-d.�d.e)�Z+Gd/d0�d0e'�Z3ej3�(e3�Gd1d2�d2ej4�Z5Gd3d4�d4e3�Z6Gd5d6�d6e6�Z7dS)8z)
Python implementation of the io module.
�N)�
allocate_lock>�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END���	SEEK_HOLEi Zgettotalrefcount�r���Tc	Cs�t|t�st�|�}t|tttf�s0td|��t|t�sFtd|��t|t�s\td|��|dk	rzt|t�sztd|��|dk	r�t|t�s�td|��t|�}|td�s�t|�t|�kr�t	d|��d|k}	d	|k}
d
|k}d|k}d|k}
d
|k}d|k}d|k�rD|	�s"|�s"|�s"|
�r*t	d��ddl
}|�dtd�d}
|�rX|�rXt	d��|	|
||dk�rvt	d��|	�s�|
�s�|�s�|�s�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r|dk�rddl
}|�dt
d�t||	�rd�pd|
�r"d	�p$d|�r2d
�p4d|�rBd�pDd|
�rRd�pTd||d�}|}�z$d}|dk�s�|dk�r�|���r�d }d}|dk�r�t}zt�|���j}Wnttfk
�r�YnX|dk�r�|}|dk�r�t	d!��|dk�r|�r|WSt	d"��|
�r t||�}n<|	�s2|�s2|�r>t||�}n|
�rPt||�}nt	d#|��|}|�rl|WSt|||||�}|}||_|WS|���YnXdS)$a�Open file and return a stream.  Raise OSError upon failure.

    file is either a text or byte string giving the name (and the path
    if the file isn't in the current working directory) of the file to
    be opened or an integer file descriptor of the file to be
    wrapped. (If a file descriptor is given, it is closed when the
    returned I/O object is closed, unless closefd is set to False.)

    mode is an optional string that specifies the mode in which the file is
    opened. It defaults to 'r' which means open for reading in text mode. Other
    common values are 'w' for writing (truncating the file if it already
    exists), 'x' for exclusive creation of a new file, and 'a' for appending
    (which on some Unix systems, means that all writes append to the end of the
    file regardless of the current seek position). In text mode, if encoding is
    not specified the encoding used is platform dependent. (For reading and
    writing raw bytes use binary mode and leave encoding unspecified.) The
    available modes are:

    ========= ===============================================================
    Character Meaning
    --------- ---------------------------------------------------------------
    'r'       open for reading (default)
    'w'       open for writing, truncating the file first
    'x'       create a new file and open it for writing
    'a'       open for writing, appending to the end of the file if it exists
    'b'       binary mode
    't'       text mode (default)
    '+'       open a disk file for updating (reading and writing)
    'U'       universal newline mode (deprecated)
    ========= ===============================================================

    The default mode is 'rt' (open for reading text). For binary random
    access, the mode 'w+b' opens and truncates the file to 0 bytes, while
    'r+b' opens the file without truncation. The 'x' mode implies 'w' and
    raises an `FileExistsError` if the file already exists.

    Python distinguishes between files opened in binary and text modes,
    even when the underlying operating system doesn't. Files opened in
    binary mode (appending 'b' to the mode argument) return contents as
    bytes objects without any decoding. In text mode (the default, or when
    't' is appended to the mode argument), the contents of the file are
    returned as strings, the bytes having been first decoded using a
    platform-dependent encoding or using the specified encoding if given.

    'U' mode is deprecated and will raise an exception in future versions
    of Python.  It has no effect in Python 3.  Use newline to control
    universal newlines mode.

    buffering is an optional integer used to set the buffering policy.
    Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
    line buffering (only usable in text mode), and an integer > 1 to indicate
    the size of a fixed-size chunk buffer.  When no buffering argument is
    given, the default buffering policy works as follows:

    * Binary files are buffered in fixed-size chunks; the size of the buffer
      is chosen using a heuristic trying to determine the underlying device's
      "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
      On many systems, the buffer will typically be 4096 or 8192 bytes long.

    * "Interactive" text files (files for which isatty() returns True)
      use line buffering.  Other text files use the policy described above
      for binary files.

    encoding is the str name of the encoding used to decode or encode the
    file. This should only be used in text mode. The default encoding is
    platform dependent, but any encoding supported by Python can be
    passed.  See the codecs module for the list of supported encodings.

    errors is an optional string that specifies how encoding errors are to
    be handled---this argument should not be used in binary mode. Pass
    'strict' to raise a ValueError exception if there is an encoding error
    (the default of None has the same effect), or pass 'ignore' to ignore
    errors. (Note that ignoring encoding errors can lead to data loss.)
    See the documentation for codecs.register for a list of the permitted
    encoding error strings.

    newline is a string controlling how universal newlines works (it only
    applies to text mode). It can be None, '', '\n', '\r', and '\r\n'.  It works
    as follows:

    * On input, if newline is None, universal newlines mode is
      enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
      these are translated into '\n' before being returned to the
      caller. If it is '', universal newline mode is enabled, but line
      endings are returned to the caller untranslated. If it has any of
      the other legal values, input lines are only terminated by the given
      string, and the line ending is returned to the caller untranslated.

    * On output, if newline is None, any '\n' characters written are
      translated to the system default line separator, os.linesep. If
      newline is '', no translation takes place. If newline is any of the
      other legal values, any '\n' characters written are translated to
      the given string.

    closedfd is a bool. If closefd is False, the underlying file descriptor will
    be kept open when the file is closed. This does not work when a file name is
    given and must be True in that case.

    The newly created file is non-inheritable.

    A custom opener can be used by passing a callable as *opener*. The
    underlying file descriptor for the file object is then obtained by calling
    *opener* with (*file*, *flags*). *opener* must return an open file
    descriptor (passing os.open as *opener* results in functionality similar to
    passing None).

    open() returns a file object whose type depends on the mode, and
    through which the standard file operations such as reading and writing
    are performed. When open() is used to open a file in a text mode ('w',
    'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
    a file in a binary mode, the returned class varies: in read binary
    mode, it returns a BufferedReader; in write binary and append binary
    modes, it returns a BufferedWriter, and in read/write mode, it returns
    a BufferedRandom.

    It is also possible to use a string or bytearray as a file for both
    reading and writing. For strings StringIO can be used like a file
    opened in a text mode, and for bytes a BytesIO can be used like a file
    opened in a binary mode.
    zinvalid file: %rzinvalid mode: %rzinvalid buffering: %rN�invalid encoding: %r�invalid errors: %rzaxrwb+tU�xr
�w�a�+�t�b�Uz4mode U cannot be combined with 'x', 'w', 'a', or '+'rz'U' mode is deprecatedrTz'can't have text and binary mode at oncer
z)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argumentzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used�)�openerFrzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)�
isinstance�int�os�fspath�str�bytes�	TypeError�set�len�
ValueError�warnings�warn�DeprecationWarning�RuntimeWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno�
st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader�
TextIOWrapper�mode�close)�filer4�	buffering�encoding�errors�newline�closefdrZmodesZcreatingZreadingZwritingZ	appendingZupdating�textZbinaryr$�raw�result�line_bufferingZbs�buffer�rA�/usr/lib64/python3.8/_pyio.py�open)s�{




�������



rCcCs ddl}|�dtd�t|d�S)azOpens the provided file with mode ``'rb'``. This function
    should be used when the intent is to treat the contents as
    executable code.

    ``path`` should be an absolute path.

    When supported by the runtime, this function can be hooked
    in order to allow embedders more control over code files.
    This functionality is not supported on the current runtime.
    rNz(_pyio.open_code() may not be using hooksr�rb)r$r%r'rC)�pathr$rArArB�_open_code_with_warnings�rFc@seZdZdZddd�ZdS)�
DocDescriptorz%Helper for builtins.open.__doc__
    NcCs
dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)

)rC�__doc__)�self�obj�typrArArB�__get__s��zDocDescriptor.__get__)N)�__name__�
__module__�__qualname__rHrLrArArArBrGsrGc@seZdZdZe�Zdd�ZdS)�OpenWrapperz�Wrapper for builtins.open

    Trick so that open won't become a bound method when stored
    as a class variable (as dbm.dumb does).

    See initstdio() in Python/pylifecycle.c.
    cOs
t||�S�N)rC)�cls�args�kwargsrArArB�__new__,szOpenWrapper.__new__N)rMrNrOrHrGrUrArArArBrP"srPc@seZdZdS)�UnsupportedOperationN)rMrNrOrArArArBrV5srVc@s�eZdZdZdd�Zd6dd�Zdd�Zd7d
d�Zdd
�ZdZ	dd�Z
dd�Zdd�Zd8dd�Z
dd�Zd9dd�Zdd�Zd:dd�Zedd ��Zd;d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd<d,d-�Zd.d/�Zd0d1�Zd=d2d3�Zd4d5�Zd	S)>�IOBaseaThe abstract base class for all I/O classes, acting on streams of
    bytes. There is no public constructor.

    This class provides dummy implementations for many methods that
    derived classes can override selectively; the default implementations
    represent a file that cannot be read, written or seeked.

    Even though IOBase does not declare read or write because
    their signatures will vary, implementations and clients should
    consider those methods part of the interface. Also, implementations
    may raise UnsupportedOperation when operations they do not support are
    called.

    The basic type used for binary data read from or written to a file is
    bytes. Other bytes-like objects are accepted as method arguments too.
    Text I/O classes work with str data.

    Note that calling any method (even inquiries) on a closed stream is
    undefined. Implementations may raise OSError in this case.

    IOBase (and its subclasses) support the iterator protocol, meaning
    that an IOBase object can be iterated over yielding the lines in a
    stream.

    IOBase also supports the :keyword:`with` statement. In this example,
    fp is closed after the suite of the with statement is complete:

    with open('spam.txt', 'r') as fp:
        fp.write('Spam and eggs!')
    cCstd|jj|f��dS)z@Internal: raise an OSError exception for unsupported operations.z%s.%s() not supportedN)rV�	__class__rM)rI�namerArArB�_unsupported\s
�zIOBase._unsupportedrcCs|�d�dS)a$Change stream position.

        Change the stream position to byte offset pos. Argument pos is
        interpreted relative to the position indicated by whence.  Values
        for whence are ints:

        * 0 -- start of stream (the default); offset should be zero or positive
        * 1 -- current stream position; offset may be negative
        * 2 -- end of stream; offset is usually negative
        Some operating systems / file systems could provide additional values.

        Return an int indicating the new absolute position.
        �seekN�rZ�rI�pos�whencerArArBr[cszIOBase.seekcCs|�dd�S)z5Return an int indicating the current stream position.rr
)r[�rIrArArB�tellsszIOBase.tellNcCs|�d�dS)z�Truncate file to size bytes.

        Size defaults to the current IO position as reported by tell().  Return
        the new size.
        �truncateNr\�rIr^rArArBrbwszIOBase.truncatecCs|��dS)zuFlush write buffers, if applicable.

        This is not implemented for read-only and non-blocking streams.
        N��_checkClosedr`rArArB�flush�szIOBase.flushFcCs |jsz|��W5d|_XdS)ziFlush and close the IO object.

        This method has no effect if the file is already closed.
        TN)�_IOBase__closedrfr`rArArBr5�szIOBase.closecCsVz
|j}Wntk
r YdSX|r*dStr8|��nz|��WnYnXdS)zDestructor.  Calls close().N)�closedr/�_IOBASE_EMITS_UNRAISABLEr5)rIrhrArArB�__del__�s

zIOBase.__del__cCsdS)z�Return a bool indicating whether object supports random access.

        If False, seek(), tell() and truncate() will raise OSError.
        This method may need to do a test seek().
        FrAr`rArArB�seekable�szIOBase.seekablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not seekable
        NzFile or stream is not seekable.)rkrV�rI�msgrArArB�_checkSeekable�s��zIOBase._checkSeekablecCsdS)zvReturn a bool indicating whether object was opened for reading.

        If False, read() will raise OSError.
        FrAr`rArArB�readable�szIOBase.readablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not readable
        NzFile or stream is not readable.)rorVrlrArArB�_checkReadable�s��zIOBase._checkReadablecCsdS)z�Return a bool indicating whether object was opened for writing.

        If False, write() and truncate() will raise OSError.
        FrAr`rArArB�writable�szIOBase.writablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not writable
        NzFile or stream is not writable.)rqrVrlrArArB�_checkWritable�s��zIOBase._checkWritablecCs|jS)z�closed: bool.  True iff the file has been closed.

        For backwards compatibility, this is a property, not a predicate.
        )rgr`rArArBrh�sz
IOBase.closedcCs|jrt|dkrdn|��dS)z7Internal: raise a ValueError if file is closed
        N�I/O operation on closed file.�rhr#rlrArArBre�s��zIOBase._checkClosedcCs|��|S)zCContext management protocol.  Returns self (an instance of IOBase).rdr`rArArB�	__enter__�szIOBase.__enter__cGs|��dS)z+Context management protocol.  Calls close()N)r5)rIrSrArArB�__exit__�szIOBase.__exit__cCs|�d�dS)z�Returns underlying file descriptor (an int) if one exists.

        An OSError is raised if the IO object does not use a file descriptor.
        r,Nr\r`rArArBr,�sz
IOBase.filenocCs|��dS)z{Return a bool indicating whether this is an 'interactive' stream.

        Return False if it can't be determined.
        Frdr`rArArBr)sz
IOBase.isattyrcs�t�d�r��fdd�}ndd�}�dkr0d�n4z
�j}Wn"tk
r\t��d���YnX|��t�}�dks~t|��kr���|��}|s�q�||7}|�d	�rjq�qjt|�S)
aNRead and return a line of bytes from the stream.

        If size is specified, at most size bytes will be read.
        Size should be an int.

        The line terminator is always b'\n' for binary files; for text
        files, the newlines argument to open can be used to select the line
        terminator(s) recognized.
        �peekcs>��d�}|sdS|�d�dp&t|�}�dkr:t|��}|S)Nr
�
r)rw�findr"�min)Z	readahead�n�rI�sizerArB�
nreadaheads

z#IOBase.readline.<locals>.nreadaheadcSsdS�Nr
rArArArArBr~ sNr� is not an integerrrx)	�hasattr�	__index__r/r �	bytearrayr"�read�endswithr)rIr}r~�
size_index�resrrAr|rB�readlines&
	

zIOBase.readlinecCs|��|SrQrdr`rArArB�__iter__5szIOBase.__iter__cCs|��}|st�|SrQ)r��
StopIteration�rI�linerArArB�__next__9szIOBase.__next__cCsP|dks|dkrt|�Sd}g}|D]&}|�|�|t|�7}||kr$qLq$|S)z�Return a list of lines from the stream.

        hint can be specified to control the number of lines read: no more
        lines will be read if the total size (in bytes/characters) of all
        lines so far exceeds hint.
        Nr)�list�appendr")rIZhintr{�linesr�rArArB�	readlines?s
zIOBase.readlinescCs |��|D]}|�|�qdS)z�Write a list of lines to the stream.

        Line separators are not added, so it is usual for each of the lines
        provided to have a line separator at the end.
        N)re�write)rIr�r�rArArB�
writelinesQszIOBase.writelines)r)N)N)N)N)N)r)N)rMrNrOrHrZr[rarbrfrgr5rjrkrnrorprqrr�propertyrhrerurvr,r)r�r�r�r�r�rArArArBrW9s6!







	

*
rW)�	metaclassc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
�	RawIOBasezBase class for raw binary I/O.rcCsP|dkrd}|dkr|��St|���}|�|�}|dkr>dS||d�=t|�S)z�Read and return up to size bytes, where size is an int.

        Returns an empty bytes object on EOF, or None if the object is
        set not to block and has no data to read.
        Nrr)�readallr�r��readintor)rIr}rr{rArArBr�ls

zRawIOBase.readcCs4t�}|�t�}|sq ||7}q|r,t|�S|SdS)z+Read until EOF, using multiple read() call.N)r�r�r*r)rIr��datarArArBr�}s

zRawIOBase.readallcCs|�d�dS)z�Read bytes into a pre-allocated bytes-like object b.

        Returns an int representing the number of bytes read (0 for EOF), or
        None if the object is set not to block and has no data to read.
        r�Nr\�rIrrArArBr��szRawIOBase.readintocCs|�d�dS)z�Write the given buffer to the IO stream.

        Returns the number of bytes written, which may be less than the
        length of b in bytes.
        r�Nr\r�rArArBr��szRawIOBase.writeN)r)rMrNrOrHr�r�r�r�rArArArBr�^s

r�)r(c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BufferedIOBaseaBase class for buffered IO objects.

    The main difference with RawIOBase is that the read() method
    supports omitting the size argument, and does not have a default
    implementation that defers to readinto().

    In addition, read(), readinto() and write() may raise
    BlockingIOError if the underlying raw stream is in non-blocking
    mode and not ready; unlike their raw counterparts, they will never
    return None.

    A typical implementation should not inherit from a RawIOBase
    implementation, but wrap one.
    rcCs|�d�dS)a�Read and return up to size bytes, where size is an int.

        If the argument is omitted, None, or negative, reads and
        returns all data until EOF.

        If the argument is positive, and the underlying raw stream is
        not 'interactive', multiple raw reads may be issued to satisfy
        the byte count (unless EOF is reached first).  But for
        interactive raw streams (XXX and for pipes?), at most one raw
        read will be issued, and a short result does not imply that
        EOF is imminent.

        Returns an empty bytes array on EOF.

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        r�Nr\r|rArArBr��szBufferedIOBase.readcCs|�d�dS)zaRead up to size bytes with at most one read() system call,
        where size is an int.
        �read1Nr\r|rArArBr��szBufferedIOBase.read1cCs|j|dd�S)afRead bytes into a pre-allocated bytes-like object b.

        Like read(), this may issue multiple reads to the underlying raw
        stream, unless the latter is 'interactive'.

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        F�r���	_readintor�rArArBr��szBufferedIOBase.readintocCs|j|dd�S)z�Read bytes into buffer *b*, using at most one system call

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        Tr�r�r�rArArB�	readinto1�s	zBufferedIOBase.readinto1cCsVt|t�st|�}|�d�}|r0|�t|��}n|�t|��}t|�}||d|�<|S)N�B)r�
memoryview�castr�r"r�)rIrr�r�r{rArArBr��s

zBufferedIOBase._readintocCs|�d�dS)aWrite the given bytes buffer to the IO stream.

        Return the number of bytes written, which is always the length of b
        in bytes.

        Raises BlockingIOError if the buffer is full and the
        underlying raw stream cannot accept more data at the moment.
        r�Nr\r�rArArBr��s	zBufferedIOBase.writecCs|�d�dS)z�
        Separate the underlying raw stream from the buffer and return it.

        After the raw stream has been detached, the buffer is in an unusable
        state.
        �detachNr\r`rArArBr��szBufferedIOBase.detachN)r)r)rMrNrOrHr�r�r�r�r�r�r�rArArArBr��s

r�c@s�eZdZdZdd�Zd$dd�Zdd�Zd%d
d�Zdd
�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zedd��Zdd�Zdd�Zd d!�Zd"d#�Zd	S)&�_BufferedIOMixinz�A mixin implementation of BufferedIOBase with an underlying raw stream.

    This passes most requests on to the underlying raw stream.  It
    does *not* provide implementations of read(), readinto() or
    write().
    cCs
||_dSrQ��_raw�rIr=rArArB�__init__sz_BufferedIOMixin.__init__rcCs"|j�||�}|dkrtd��|S)Nrz#seek() returned an invalid position)r=r[r.)rIr^r_Znew_positionrArArBr[sz_BufferedIOMixin.seekcCs|j��}|dkrtd��|S)Nrz#tell() returned an invalid position)r=rar.rcrArArBras
z_BufferedIOMixin.tellNcCs$|��|dkr|��}|j�|�SrQ)rfrar=rbrcrArArBrb$sz_BufferedIOMixin.truncatecCs|jrtd��|j��dS)N�flush on closed file)rhr#r=rfr`rArArBrf2sz_BufferedIOMixin.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r=rhr5rfr`rArArBr57sz_BufferedIOMixin.closecCs*|jdkrtd��|��|j}d|_|S)Nzraw stream already detached)r=r#rfr�r�rArArBr�?s
z_BufferedIOMixin.detachcCs
|j��SrQ)r=rkr`rArArBrkIsz_BufferedIOMixin.seekablecCs|jSrQr�r`rArArBr=Lsz_BufferedIOMixin.rawcCs|jjSrQ)r=rhr`rArArBrhPsz_BufferedIOMixin.closedcCs|jjSrQ)r=rYr`rArArBrYTsz_BufferedIOMixin.namecCs|jjSrQ)r=r4r`rArArBr4Xsz_BufferedIOMixin.modecCstd|jj�d���dS�Nzcannot pickle z object�r rXrMr`rArArB�__getstate__\sz_BufferedIOMixin.__getstate__cCsN|jj}|jj}z
|j}Wn tk
r:d�||�YSXd�|||�SdS)Nz<{}.{}>z<{}.{} name={!r}>)rXrNrOrYr/�format)rI�modnameZclsnamerYrArArB�__repr___s
z_BufferedIOMixin.__repr__cCs
|j��SrQ)r=r,r`rArArBr,ksz_BufferedIOMixin.filenocCs
|j��SrQ)r=r)r`rArArBr)nsz_BufferedIOMixin.isatty)r)N)rMrNrOrHr�r[rarbrfr5r�rkr�r=rhrYr4r�r�r,r)rArArArBr�
s*






r�cs�eZdZdZdZd!dd�Zdd�Zdd�Zd	d
�Z�fdd�Z	d"dd�Z
d#dd�Zdd�Zd$dd�Z
dd�Zd%dd�Zdd�Zdd�Zdd �Z�ZS)&�BytesIOz<Buffered I/O implementation using an in-memory bytes buffer.NcCs&t�}|dk	r||7}||_d|_dS�Nr)r��_buffer�_pos)rIZ
initial_bytes�bufrArArBr�zs
zBytesIO.__init__cCs|jrtd��|j��S)Nz__getstate__ on closed file)rhr#�__dict__�copyr`rArArBr��szBytesIO.__getstate__cCs|jrtd��t|j�S)z8Return the bytes value (contents) of the buffer
        zgetvalue on closed file)rhr#rr�r`rArArB�getvalue�szBytesIO.getvaluecCs|jrtd��t|j�S)z;Return a readable and writable view of the buffer.
        zgetbuffer on closed file)rhr#r�r�r`rArArB�	getbuffer�szBytesIO.getbuffercs"|jdk	r|j��t���dSrQ)r��clear�superr5r`�rXrArBr5�s

z
BytesIO.closercCs�|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|dkrbt|j�}t|j�|jkrvdStt|j�|j|�}|j|j|�}||_t	|�S)N�read from closed filerr�r�)
rhr#r�r/r r"r�r�rzr)rIr}r�ZnewposrrArArBr��s"

zBytesIO.readcCs
|�|�S)z"This is the same as read.
        )r�r|rArArBr��sz
BytesIO.read1c	Cs�|jrtd��t|t�r td��t|��}|j}W5QRX|dkrFdS|j}|t|j	�krzd|t|j	�}|j	|7_	||j	|||�<|j|7_|S)N�write to closed file� can't write str to binary streamr�)
rhr#rrr r��nbytesr�r"r�)rIrZviewr{r^ZpaddingrArArBr��s

z
BytesIO.writercCs�|jrtd��z
|j}Wn"tk
r:t|�d���YnX|�}|dkrh|dkr`td|f��||_nD|dkr�td|j|�|_n(|dkr�tdt|j�|�|_ntd��|jS)Nzseek on closed filer�r�negative seek position %rr
rzunsupported whence value)	rhr#r�r/r r��maxr"r�)rIr^r_�	pos_indexrArArBr[�s"
zBytesIO.seekcCs|jrtd��|jS)N�tell on closed file)rhr#r�r`rArArBra�szBytesIO.tellcCsx|jrtd��|dkr|j}nJz
|j}Wn"tk
rJt|�d���YnX|�}|dkrhtd|f��|j|d�=|S)Nztruncate on closed filer�rznegative truncate position %r)rhr#r�r�r/r r�)rIr^r�rArArBrb�s
zBytesIO.truncatecCs|jrtd��dS�NrsTrtr`rArArBro�szBytesIO.readablecCs|jrtd��dSr�rtr`rArArBrq�szBytesIO.writablecCs|jrtd��dSr�rtr`rArArBrk�szBytesIO.seekable)N)r)r)r)N)rMrNrOrHr�r�r�r�r�r5r�r�r�r[rarbrorqrk�
__classcell__rArAr�rBr�rs 




r�c@sxeZdZdZefdd�Zdd�Zdd�Zdd	d
�Zddd�Z	ddd�Z
ddd�Zddd�Zdd�Z
dd�Zd dd�ZdS)!r2aBufferedReader(raw[, buffer_size])

    A buffer for a readable, sequential BaseRawIO object.

    The constructor creates a BufferedReader for the given readable raw
    stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE
    is used.
    cCsF|��std��t�||�|dkr,td��||_|��t�|_dS)zMCreate a new buffered reader using the given readable raw IO object.
        z "raw" argument must be readable.r�invalid buffer sizeN)	ror.r�r�r#�buffer_size�_reset_read_buf�Lock�
_read_lock�rIr=r�rArArBr�szBufferedReader.__init__cCs
|j��SrQ)r=ror`rArArBroszBufferedReader.readablecCsd|_d|_dS)Nr�r)�	_read_buf�	_read_posr`rArArBr�szBufferedReader._reset_read_bufNc
Cs@|dk	r|dkrtd��|j�|�|�W5QR�SQRXdS)z�Read size bytes.

        Returns exactly size bytes of data unless the underlying raw IO
        stream reaches EOF or if the call would block in non-blocking
        mode. If size is negative, read until EOF or until read() would
        block.
        Nrzinvalid number of bytes to read)r#r��_read_unlockedr|rArArBr� szBufferedReader.readcCs�d}d}|j}|j}|dks$|dkr�|��t|jd�rj|j��}|dkrZ||d�pXdS||d�|S||d�g}d}|j��}||kr�|}q�|t|�7}|�|�q|d�	|�p�|St|�|}	||	kr�|j|7_||||�S||d�g}t
|j|�}
|	|k�rH|j�|
�}||k�r.|}�qH|	t|�7}	|�|��qt||	�}d�	|�}||d�|_d|_|�r�|d|�S|S)Nr�)r�Nrr�r)
r�r�r�r�r=r�r�r"r��joinr�r�rz)rIr{Z
nodata_valZempty_valuesr�r^�chunkZchunksZcurrent_size�availZwanted�outrArArBr�-sL





zBufferedReader._read_unlockedrc
Cs(|j�|�|�W5QR�SQRXdS)z�Returns buffered bytes without advancing the position.

        The argument indicates a desired minimal number of bytes; we
        do at most one raw read to satisfy it.  We never return more
        than self.buffer_size.
        N)r��_peek_unlockedr|rArArBrwaszBufferedReader.peekcCsrt||j�}t|j�|j}||ks,|dkrb|j|}|j�|�}|rb|j|jd�||_d|_|j|jd�Sr�)rzr�r"r�r�r=r�)rIr{ZwantZhaveZto_readZcurrentrArArBr�ks
zBufferedReader._peek_unlockedrc
Cs^|dkr|j}|dkrdS|j�4|�d�|�t|t|j�|j��W5QR�SQRXdS)z<Reads up to size bytes, with at most one read() system call.rr�r
N)r�r�r�r�rzr"r�r�r|rArArBr�vs
�zBufferedReader.read1c	Cs
t|t�st|�}|jdkr dS|�d�}d}|j��|t|�kr�tt|j�|jt|��}|r�|j|j|j|�||||�<|j|7_||7}|t|�kr�q�t|�||j	kr�|j
�||d��}|s�q�||7}n|r�|s�|�d�s�q�|r6|r6q�q6W5QRX|S)z2Read data into *buf* with at most one system call.rr�Nr
)
rr�r�r�r�r"rzr�r�r�r=r�r�)rIr�r��writtenr�r{rArArBr��s6


�

zBufferedReader._readintocCst�|�t|j�|jSrQ)r�rar"r�r�r`rArArBra�szBufferedReader.tellc
Csd|tkrtd��|j�D|dkr4|t|j�|j8}t�|||�}|��|W5QR�SQRXdS)N�invalid whence valuer
)	�valid_seek_flagsr#r�r"r�r�r�r[r�r]rArArBr[�szBufferedReader.seek)N)N)r)r)r)r)rMrNrOrHr*r�ror�r�r�rwr�r�r�rar[rArArArBr2s	


4



.r2c@s`eZdZdZefdd�Zdd�Zdd�Zdd	d
�Zdd�Z	d
d�Z
dd�Zddd�Zdd�Z
dS)r1z�A buffer for a writeable sequential RawIO object.

    The constructor creates a BufferedWriter for the given writeable raw
    stream. If the buffer_size is not given, it defaults to
    DEFAULT_BUFFER_SIZE.
    cCsF|��std��t�||�|dkr,td��||_t�|_t�|_	dS)Nz "raw" argument must be writable.rr�)
rqr.r�r�r#r�r��
_write_bufr��_write_lockr�rArArBr��szBufferedWriter.__init__cCs
|j��SrQ)r=rqr`rArArBrq�szBufferedWriter.writablecCst|t�rtd��|j��|jr(td��t|j�|jkr@|�	�t|j�}|j�
|�t|j�|}t|j�|jkr�z|�	�Wnltk
r�}zNt|j�|jkr�t|j�|j}||8}|jd|j�|_t|j|j
|��W5d}~XYnX|W5QR�SQRXdS)Nr�r�)rrr r�rhr#r"r�r��_flush_unlocked�extend�BlockingIOError�errno�strerror)rIrZbeforer��eZoveragerArArBr��s(

"zBufferedWriter.writeNc
CsD|j�4|��|dkr"|j��}|j�|�W5QR�SQRXdSrQ)r�r�r=rarbrcrArArBrb�s

zBufferedWriter.truncatec	Cs|j�|��W5QRXdSrQ)r�r�r`rArArBrf�szBufferedWriter.flushcCs�|jrtd��|jr�z|j�|j�}Wntk
rBtd��YnX|dkrZttjdd��|t	|j�ksp|dkrxt
d��|jd|�=qdS)Nr�zHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes)rhr#r�r=r�r��RuntimeErrorr�ZEAGAINr"r.�rIr{rArArBr�s �zBufferedWriter._flush_unlockedcCst�|�t|j�SrQ)r�rar"r�r`rArArBraszBufferedWriter.tellrc
CsD|tkrtd��|j�$|��t�|||�W5QR�SQRXdS)Nr�)r�r#r�r�r�r[r]rArArBr[s
zBufferedWriter.seekcCs`|j�$|jdks|jr&W5QR�dSW5QRXz|��W5|j�|j��W5QRXXdSrQ)r�r=rhr5rfr`rArArBr5szBufferedWriter.close)N)r)rMrNrOrHr*r�rqr�rbrfr�rar[r5rArArArBr1�s

r1c@s�eZdZdZefdd�Zddd�Zdd�Zd	d
�Zd dd
�Z	d!dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zedd��ZdS)"�BufferedRWPaira�A buffered reader and writer object together.

    A buffered reader object and buffered writer object put together to
    form a sequential IO object that can read and write. This is typically
    used with a socket or two-way pipe.

    reader and writer are RawIOBase objects that are readable and
    writeable respectively. If the buffer_size is omitted it defaults to
    DEFAULT_BUFFER_SIZE.
    cCs<|��std��|��s td��t||�|_t||�|_dS)zEConstructor.

        The arguments are two RawIO instances.
        z#"reader" argument must be readable.z#"writer" argument must be writable.N)ror.rqr2�readerr1�writer)rIr�r�r�rArArBr�<szBufferedRWPair.__init__rcCs|dkrd}|j�|�S�Nr)r�r�r|rArArBr�JszBufferedRWPair.readcCs|j�|�SrQ)r�r�r�rArArBr�OszBufferedRWPair.readintocCs|j�|�SrQ)r�r�r�rArArBr�RszBufferedRWPair.writercCs|j�|�SrQ)r�rwr|rArArBrwUszBufferedRWPair.peekcCs|j�|�SrQ)r�r�r|rArArBr�XszBufferedRWPair.read1cCs|j�|�SrQ)r�r�r�rArArBr�[szBufferedRWPair.readinto1cCs
|j��SrQ)r�ror`rArArBro^szBufferedRWPair.readablecCs
|j��SrQ)r�rqr`rArArBrqaszBufferedRWPair.writablecCs
|j��SrQ)r�rfr`rArArBrfdszBufferedRWPair.flushcCs z|j��W5|j��XdSrQ)r�r5r�r`rArArBr5gszBufferedRWPair.closecCs|j��p|j��SrQ)r�r)r�r`rArArBr)mszBufferedRWPair.isattycCs|jjSrQ)r�rhr`rArArBrhpszBufferedRWPair.closedN)r)r)r)rMrNrOrHr*r�r�r�r�rwr�r�rorqrfr5r)r�rhrArArArBr�,s


r�c@sneZdZdZefdd�Zddd�Zdd�Zdd
d�Zddd
�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�Zd	S)r0z�A buffered interface to random access streams.

    The constructor creates a reader and writer for a seekable stream,
    raw, given in the first argument. If the buffer_size is omitted it
    defaults to DEFAULT_BUFFER_SIZE.
    cCs(|��t�|||�t�|||�dSrQ)rnr2r�r1r�rArArBr�~szBufferedRandom.__init__rc	Cs�|tkrtd��|��|jrJ|j� |j�|jt|j�d�W5QRX|j�||�}|j�|�	�W5QRX|dkr�t
d��|S)Nr�r
rz seek() returned invalid position)r�r#rfr�r�r=r[r�r"r�r.r]rArArBr[�s$zBufferedRandom.seekcCs|jrt�|�St�|�SdSrQ)r�r1rar2r`rArArBra�s
zBufferedRandom.tellNcCs|dkr|��}t�||�SrQ)rar1rbrcrArArBrb�szBufferedRandom.truncatecCs |dkrd}|��t�||�Sr�)rfr2r�r|rArArBr��szBufferedRandom.readcCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readintocCs|��t�||�SrQ)rfr2rwr|rArArBrw�szBufferedRandom.peekrcCs|��t�||�SrQ)rfr2r�r|rArArBr��szBufferedRandom.read1cCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readinto1c	CsF|jr:|j�(|j�|jt|j�d�|��W5QRXt�||�Sr)	r�r�r=r[r�r"r�r1r�r�rArArBr��s
zBufferedRandom.write)r)N)N)r)r)rMrNrOrHr*r�r[rarbr�r�rwr�r�r�rArArArBr0us




r0cs�eZdZdZdZdZdZdZdZdZ	d0dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zd1dd�Zd2dd�Zdd�Zdd�Zdd�Zefdd�Zdd�Zd3dd�Z�fd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zed,d-��Zed.d/��Z �Z!S)4r(rFNTr
c
CsB|jdkr*z|jrt�|j�W5d|_Xt|t�r<td��t|t�r\|}|dkr`td��nd}t|t	�sxtd|f��t
|�t
d�ks�td|f��tdd�|D��d	ks�|�d
�d	kr�td��d|kr�d
|_
d
|_tjtjB}nTd|kr�d
|_d}n@d|k�rd
|_tjtjB}n"d|k�r8d
|_d
|_tjtjB}d
|k�rNd
|_d
|_|j�rj|j�rj|tjO}n|j�r~|tjO}n
|tjO}|ttdd�O}ttdd��p�ttdd�}||O}d}�zT|dk�r:|�s�td��|dk�r�t�||d�}n0|||�}t|t��std��|dk�r$td��|}|�s:t�|d�||_t�|�}	z(t�|	j��rpt t!j"t�#t!j"�|��Wnt$k
�r�YnXt|	dd�|_%|j%d	k�r�t&|_%t'�r�t'|tj(�||_)|j�rzt�*|dt+�Wn4tk
�r}
z|
j!t!j,k�r�W5d}
~
XYnXWn"|dk	�r0t�|��YnX||_dS)adOpen a file.  The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
        writing, exclusive creation or appending.  The file will be created if it
        doesn't exist when opened for writing or appending; it will be truncated
        when opened for writing.  A FileExistsError will be raised if it already
        exists when opened for creating. Opening a file for creating implies
        writing so this mode behaves in a similar way to 'w'. Add a '+' to the mode
        to allow simultaneous reading and writing. A custom opener can be used by
        passing a callable as *opener*. The underlying file descriptor for the file
        object is then obtained by calling opener with (*name*, *flags*).
        *opener* must return an open file descriptor (passing os.open as *opener*
        results in functionality similar to passing None).
        rrz$integer argument expected, got floatznegative file descriptorzinvalid mode: %szxrwab+css|]}|dkVqdS)ZrwaxNrA)�.0�crArArB�	<genexpr>�sz"FileIO.__init__.<locals>.<genexpr>r
rzKMust have exactly one of create/read/write/append mode and at most one plusrTr
rr�O_BINARYZO_NOINHERIT�	O_CLOEXECNz'Cannot use closefd=False with file namei�zexpected integer from openerzNegative file descriptorFr-)-�_fd�_closefdrr5r�floatr rr#rr!�sum�count�_created�	_writable�O_EXCL�O_CREAT�	_readable�O_TRUNC�
_appending�O_APPEND�O_RDWR�O_RDONLY�O_WRONLY�getattrrCr.�set_inheritabler+�stat�S_ISDIR�st_mode�IsADirectoryErrorr�ZEISDIRr�r/�_blksizer*�_setmoder�rY�lseekr	ZESPIPE)rIr6r4r;r�fd�flagsZnoinherit_flagZowned_fdZfdfstatr�rArArBr��s�




$




�





�

zFileIO.__init__cCsB|jdkr>|jr>|js>ddl}|jd|ftd|d�|��dS)Nrzunclosed file %rr)�
stacklevel�source)r�r�rhr$r%�ResourceWarningr5)rIr$rArArBrjAs�zFileIO.__del__cCstd|jj�d���dSr�r�r`rArArBr�HszFileIO.__getstate__cCspd|jj|jjf}|jr"d|Sz
|j}Wn*tk
rVd||j|j|jfYSXd|||j|jfSdS)Nz%s.%sz
<%s [closed]>z<%s fd=%d mode=%r closefd=%r>z<%s name=%r mode=%r closefd=%r>)	rXrNrOrhrYr/r�r4r�)rI�
class_namerYrArArBr�Ks�
�
�zFileIO.__repr__cCs|jstd��dS)NzFile not open for reading)r�rVr`rArArBrpYszFileIO._checkReadablecCs|jstd��dS)NzFile not open for writing)r�rVrlrArArBrr]szFileIO._checkWritablecCsT|��|��|dks |dkr(|��Szt�|j|�WStk
rNYdSXdS)z�Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
        Nr)rerpr�rr�r�r�r|rArArBr�aszFileIO.readcCs�|��|��t}z6t�|jdt�}t�|j�j}||krH||d}Wnt	k
r^YnXt
�}t|�|kr�t|�}|t|t�7}|t|�}zt�
|j|�}Wntk
r�|r�Yq�YdSX|s�q�||7}qft|�S)z�Read all data from the file, returned as bytes.

        In non-blocking mode, returns as much as is immediately available,
        or None if no data is available.  Return an empty bytes object at EOF.
        rr
N)rerpr*rrr�rr+�st_sizer.r�r"r�r�r�r)rI�bufsizer^�endr>r{r�rArArBr�qs2
zFileIO.readallcCs4t|��d�}|�t|��}t|�}||d|�<|S)zSame as RawIOBase.readinto().r�N)r�r�r�r")rIr�mr�r{rArArBr��s
zFileIO.readintocCs<|��|��zt�|j|�WStk
r6YdSXdS)aWrite bytes b to file, return number written.

        Only makes one system call, so not all of the data may be written.
        The number of bytes actually written is returned.  In non-blocking mode,
        returns None if the write would block.
        N)rerrrr�r�r�r�rArArBr��szFileIO.writecCs*t|t�rtd��|��t�|j||�S)a�Move to new file position.

        Argument offset is a byte count.  Optional argument whence defaults to
        SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
        are SEEK_CUR or 1 (move relative to current position, positive or negative),
        and SEEK_END or 2 (move relative to end of file, usually negative, although
        many platforms allow seeking beyond the end of a file).

        Note that not all file objects are seekable.
        zan integer is required)rr�r rerrr�r]rArArBr[�s
zFileIO.seekcCs|��t�|jdt�S)zYtell() -> int.  Current file position.

        Can raise OSError for non seekable files.r)rerrr�rr`rArArBra�szFileIO.tellcCs2|��|��|dkr |��}t�|j|�|S)z�Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
        N)rerrrar�	ftruncater�r|rArArBrb�szFileIO.truncatecs.|js*z|jrt�|j�W5t���XdS)z�Close the file.

        A closed file cannot be used for further I/O operations.  close() may be
        called more than once without error.
        N)rhr�r5r�rr�r`r�rArBr5�s
zFileIO.closecCsF|��|jdkr@z|��Wntk
r8d|_YnXd|_|jS)z$True if file supports random-access.NFT)re�	_seekablerar.r`rArArBrk�s
zFileIO.seekablecCs|��|jS)z'True if file was opened in a read mode.)rer�r`rArArBro�szFileIO.readablecCs|��|jS)z(True if file was opened in a write mode.)rer�r`rArArBrq�szFileIO.writablecCs|��|jS)z3Return the underlying file descriptor (an integer).)rer�r`rArArBr,�sz
FileIO.filenocCs|��t�|j�S)z.True if the file is connected to a TTY device.)rerr)r�r`rArArBr)�sz
FileIO.isattycCs|jS)z6True if the file descriptor will be closed by close().)r�r`rArArBr;�szFileIO.closefdcCsJ|jr|jrdSdSn0|jr,|jr&dSdSn|jrB|jr<dSdSndSdS)	zString giving the file modezxb+Zxbzab+Zabzrb+rD�wbN)r�r�r�r�r`rArArBr4szFileIO.mode)r
TN)N)N)N)"rMrNrOr�r�r�r�r�rr�r�rjr�r�rprrr�r�r�r�rr[rarbr5rkrorqr,r)r�r;r4r�rArAr�rBr(�s<
y

#



r(c@s`eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Ze	dd��Z
e	dd��Ze	dd��ZdS)�
TextIOBasez�Base class for text I/O.

    This class provides a character and line based interface to stream
    I/O. There is no public constructor.
    rcCs|�d�dS)z�Read at most size characters from stream, where size is an int.

        Read from underlying buffer until we have size characters or we hit EOF.
        If size is negative or omitted, read until EOF.

        Returns a string.
        r�Nr\r|rArArBr�szTextIOBase.readcCs|�d�dS)z.Write string s to stream and returning an int.r�Nr\)rI�srArArBr�(szTextIOBase.writeNcCs|�d�dS)z*Truncate size to pos, where pos is an int.rbNr\rcrArArBrb,szTextIOBase.truncatecCs|�d�dS)z_Read until newline or EOF.

        Returns an empty string if EOF is hit immediately.
        r�Nr\r`rArArBr�0szTextIOBase.readlinecCs|�d�dS)z�
        Separate the underlying buffer from the TextIOBase and return it.

        After the underlying buffer has been detached, the TextIO is in an
        unusable state.
        r�Nr\r`rArArBr�7szTextIOBase.detachcCsdS)zSubclasses should override.NrAr`rArArBr8@szTextIOBase.encodingcCsdS)z�Line endings translated so far.

        Only line endings translated during reading are considered.

        Subclasses should override.
        NrAr`rArArB�newlinesEszTextIOBase.newlinescCsdS)zMError setting of the decoder or encoder.

        Subclasses should override.NrAr`rArArBr9OszTextIOBase.errors)r)N)
rMrNrOrHr�r�rbr�r�r�r8rr9rArArArBrs


	

	rc@sTeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdZ	dZ
dZedd��Z
dS)�IncrementalNewlineDecodera+Codec used when reading a file in universal newlines mode.  It wraps
    another incremental decoder, translating \r\n and \r into \n.  It also
    records the types of newlines encountered.  When used with
    translate=False, it ensures that the newline sequence is returned in
    one piece.
    �strictcCs,tjj||d�||_||_d|_d|_dS)N)r9rF)�codecs�IncrementalDecoderr��	translate�decoder�seennl�	pendingcr)rIrrr9rArArBr�`s
z"IncrementalNewlineDecoder.__init__FcCs�|jdkr|}n|jj||d�}|jr<|s.|r<d|}d|_|�d�r\|s\|dd�}d|_|�d�}|�d�|}|�d�|}|j|o�|j|o�|jB|o�|jBO_|j	r�|r�|�
dd�}|r�|�
dd�}|S)N��final�
FrT�
�
)r�decoderr�r�r�_LF�_CR�_CRLFr�replace)rI�inputr�outputZcrlfZcrZlfrArArBr#gs*

�z IncrementalNewlineDecoder.decodecCs@|jdkrd}d}n|j��\}}|dK}|jr8|dO}||fS)Nr�rr
)r�getstater)rIr��flagrArArBr*�s
z"IncrementalNewlineDecoder.getstatecCs8|\}}t|d@�|_|jdk	r4|j�||d?f�dSr)�boolrr�setstate)rI�stater�r+rArArBr-�s
z"IncrementalNewlineDecoder.setstatecCs$d|_d|_|jdk	r |j��dS)NrF)rrr�resetr`rArArBr/�s
zIncrementalNewlineDecoder.resetr
r�cCs
d|jS)N)Nr"r )r r"r!)r"r!)r r!)r r"r!)rr`rArArBr�s�z"IncrementalNewlineDecoder.newlinesN)r)F)rMrNrOrHr�r#r*r-r/r$r%r&r�rrArArArBrYs

rc@sveZdZdZdZdZdOdd�Zdd�ZdPd	d
�Zdd�Z	e
d
d��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Zddeddd�dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Ze
d$d%��Ze
d&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdQd4d5�Zd6d7�Z d8d9�Z!dRd;d<�Z"d=d>�Z#d?d@�Z$dSdAdB�Z%dCdD�Z&dTdEdF�Z'dUdGdH�Z(dIdJ�Z)dVdKdL�Z*e
dMdN��Z+dS)Wr3aCharacter and line based layer over a BufferedIOBase object, buffer.

    encoding gives the name of the encoding that the stream will be
    decoded or encoded with. It defaults to locale.getpreferredencoding(False).

    errors determines the strictness of encoding and decoding (see the
    codecs.register) and defaults to "strict".

    newline can be None, '', '\n', '\r', or '\r\n'.  It controls the
    handling of line endings. If it is None, universal newlines is
    enabled.  With this enabled, on input, the lines endings '\n', '\r',
    or '\r\n' are translated to '\n' before being returned to the
    caller. Conversely, on output, '\n' is translated to the system
    default line separator, os.linesep. If newline is any other of its
    legal values, that newline becomes the newline when the file is read
    and it is returned untranslated. On output, '\n' is converted to the
    newline.

    If line_buffering is True, a call to flush is implied when a call to
    write contains a newline character.
    iNFc		Cs|�|�|dkrvzt�|���}Wnttfk
r<YnX|dkrvzddl}Wntk
rjd}YnX|�d�}t	|t
�s�td|��t�
|�js�d}t||��|dkr�d}nt	|t
�s�td|��||_d|_d|_d|_|j��|_|_t|jd	�|_|�|||||�dS)
Nr�asciiFrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsrrrr�)�_check_newliner�device_encodingr,r/rV�locale�ImportErrorZgetpreferredencodingrrr#r�lookup�_is_text_encoding�LookupErrorr��_decoded_chars�_decoded_chars_used�	_snapshotr@rkr�_tellingr��
_has_read1�
_configure)	rIr@r8r9r:r?�
write_throughr4rmrArArBr��s>





�zTextIOWrapper.__init__cCs>|dk	r$t|t�s$tdt|�f��|dkr:td|f��dS)Nzillegal newline type: %r)Nrr"r r!zillegal newline value: %r)rrr �typer#)rIr:rArArBr2�szTextIOWrapper._check_newlinecCs�||_||_d|_d|_d|_||_|dk|_||_|dk|_|pHt	j
|_||_||_
|jr�|��r�|j��}|dkr�z|���d�Wntk
r�YnXdS)N�rr)�	_encoding�_errors�_encoder�_decoder�	_b2cratio�_readuniversal�_readtranslate�_readnl�_writetranslater�linesep�_writenl�_line_buffering�_write_throughrrqr@ra�_get_encoderr-r8)rIr8r9r:r?r?�positionrArArBr>�s&


zTextIOWrapper._configurecCs�d�|jj|jj�}z
|j}Wntk
r2YnX|d�|�7}z
|j}Wntk
r`YnX|d�|�7}|d�|j�S)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)r�rXrNrOrYr/r4r8)rIr>rYr4rArArBr�!s
�

zTextIOWrapper.__repr__cCs|jSrQ)rBr`rArArBr82szTextIOWrapper.encodingcCs|jSrQ)rCr`rArArBr96szTextIOWrapper.errorscCs|jSrQ)rMr`rArArBr?:szTextIOWrapper.line_bufferingcCs|jSrQ)rNr`rArArBr?>szTextIOWrapper.write_throughcCs|jSrQ)r�r`rArArBr@BszTextIOWrapper.buffer)r8r9r:r?r?cCs�|jdk	r*|dk	s"|dk	s"|tk	r*td��|dkrH|dkrB|j}q^d}nt|t�s^td|��|dkrn|j}nt|t�s�td|��|tkr�|j}|�	|�|dkr�|j
}|dkr�|j}|��|�
|||||�dS)z`Reconfigure the text stream with new parameters.

        This also flushes the stream.
        NzPIt is not possible to set the encoding or newline of stream after the first readrrr)rE�EllipsisrVrCrrr rBrIr2r?r?rfr>)rIr8r9r:r?r?rArArB�reconfigureFs@
����



�zTextIOWrapper.reconfigurecCs|jrtd��|jS)Nrs)rhr#rr`rArArBrkoszTextIOWrapper.seekablecCs
|j��SrQ)r@ror`rArArBrotszTextIOWrapper.readablecCs
|j��SrQ)r@rqr`rArArBrqwszTextIOWrapper.writablecCs|j��|j|_dSrQ)r@rfrr<r`rArArBrfzs
zTextIOWrapper.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r@rhr5rfr`rArArBr5~szTextIOWrapper.closecCs|jjSrQ)r@rhr`rArArBrh�szTextIOWrapper.closedcCs|jjSrQ)r@rYr`rArArBrY�szTextIOWrapper.namecCs
|j��SrQ)r@r,r`rArArBr,�szTextIOWrapper.filenocCs
|j��SrQ)r@r)r`rArArBr)�szTextIOWrapper.isattycCs�|jrtd��t|t�s(td|jj��t|�}|js<|j	oBd|k}|rf|jrf|j
dkrf|�d|j
�}|jpr|�
�}|�|�}|j�|�|j	r�|s�d|kr�|��|�d�d|_|jr�|j��|S)zWrite data, where s is a strr�zcan't write %s to text streamr"r rN)rhr#rrr rXrMr"rJrMrLr'rDrO�encoder@r�rf�_set_decoded_charsr;rEr/)rIrZlengthZhaslf�encoderrrArArBr��s(
�


zTextIOWrapper.writecCst�|j�}||j�|_|jSrQ)r�getincrementalencoderrBrCrD)rIZmake_encoderrArArBrO�szTextIOWrapper._get_encodercCs2t�|j�}||j�}|jr(t||j�}||_|SrQ)r�getincrementaldecoderrBrCrGrrHrE)rIZmake_decoderrrArArB�_get_decoder�s
zTextIOWrapper._get_decodercCs||_d|_dS)zSet the _decoded_chars buffer.rN)r9r:)rI�charsrArArBrT�sz TextIOWrapper._set_decoded_charscCsF|j}|dkr|j|d�}n|j|||�}|jt|�7_|S)z'Advance into the _decoded_chars buffer.N)r:r9r")rIr{�offsetrYrArArB�_get_decoded_chars�sz TextIOWrapper._get_decoded_charscCs$|j|krtd��|j|8_dS)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)r:�AssertionErrorr�rArArB�_rewind_decoded_chars�s
z#TextIOWrapper._rewind_decoded_charscCs�|jdkrtd��|jr&|j��\}}|jr<|j�|j�}n|j�|j�}|}|j�	||�}|�
|�|r�t|�t|j�|_
nd|_
|jr�|||f|_|S)zQ
        Read and decode the next chunk of data from the BufferedReader.
        Nz
no decoderrA)rEr#r<r*r=r@r��_CHUNK_SIZEr�r#rTr"r9rFr;)rI�
dec_buffer�	dec_flags�input_chunk�eofZ
decoded_charsrArArB�_read_chunk�s 

zTextIOWrapper._read_chunkrcCs(||d>B|d>B|d>Bt|�d>BS)N�@���)r,)rIrPr`�
bytes_to_feed�need_eof�
chars_to_skiprArArB�_pack_cookie�s
�
�zTextIOWrapper._pack_cookiecCsFt|d�\}}t|d�\}}t|d�\}}t|d�\}}|||||fS)Nl)�divmod)rIZbigint�restrPr`rhrirjrArArB�_unpack_cookie	s
zTextIOWrapper._unpack_cookiec	Cs@|jstd��|jstd��|��|j��}|j}|dksF|jdkrX|j	rTt
d��|S|j\}}|t|�8}|j}|dkr�|�
||�S|��}�z�t|j|�}d}|dk�r"|�d|f�t|�|d|���}	|	|k�r|��\}
}|
s�|}||	8}�q4|t|
�8}d}q�||8}|d}q�d}|�d|f�||}|}
|dk�rZ|�
||
�W��Sd}d}d}t|t|��D]x}|d7}|t|�|||d���7}|��\}}|�s�||k�r�||7}||8}|dd}
}}||k�rt�q�qt|t|jddd	��7}d}||k�rtd
��|�
||
|||�W�S|�|�XdS)N�!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrr
r�rTrz'can't reconstruct logical file position)rrVr<r.rfr@rarEr;r9r\r"r:rkr*r-rrFr#�range)rIrPrr`Z
next_inputrjZsaved_stateZ
skip_bytesZ	skip_backr{r�d�	start_posZstart_flagsZ	bytes_fedriZ
chars_decoded�ir_rArArBra
	s�








�zTextIOWrapper.tellcCs$|��|dkr|��}|j�|�SrQ)rfrar@rbrcrArArBrbm	szTextIOWrapper.truncatecCs*|jdkrtd��|��|j}d|_|S)Nzbuffer is already detached)r@r#rfr�)rIr@rArArBr�s	s
zTextIOWrapper.detachcs��fdd�}�jrtd���js(td��|tkrN|dkr@td��d}���}nZ|tkr�|dkrftd������j�	d|�}��
d�d�_�jr��j�
�||�|S|dkr�td	|f��|dkr�td
|f�������|�\}}}}}	�j�	|���
d�d�_|dk�r*�j�r*�j�
�n@�j�s>|�s>|	�rj�j�pL����_�j�d|f�|df�_|	�r��j�|�}
��
�j�|
|��||
f�_t�j�|	k�r�td��|	�_||�|S)
NcsHz�jp���}Wntk
r&YnX|dkr<|�d�n|��dS)z9Reset the encoder (merely useful for proper BOM handling)rN)rDrOr8r-r/)rPrUr`rArB�_reset_encoder|	sz*TextIOWrapper.seek.<locals>._reset_encoderr�rorz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksrzunsupported whence (%r)r�r�z#can't restore logical file position)rhr#rrVrrar	rfr@r[rTr;rEr/rnrXr-r�r#r"r9r.r:)rIZcookier_rtrPrrr`rhrirjrarAr`rBr[{	s`



�

�
zTextIOWrapper.seekcCs�|��|dkrd}n4z
|j}Wn"tk
rBt|�d���YnX|�}|jpV|��}|dkr�|��|j|j�	�dd�}|�
d�d|_|Sd}|�|�}t|�|kr�|s�|�
�}||�|t|��7}q�|SdS)Nrr�rTrrF)rpr�r/r rErXr[r#r@r�rTr;r"rc)rIr}r�rr>rbrArArBr��	s,
�


zTextIOWrapper.readcCs(d|_|��}|s$d|_|j|_t�|S)NF)r<r�r;rr�r�rArArBr��	szTextIOWrapper.__next__c	Cs
|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|��}d}|jsj|��d}}|jr�|�	d|�}|dkr�|d}�q�nt
|�}n�|j�rF|�	d|�}|�	d|�}|dkr�|dkr�t
|�}n|d}�q�nX|dk�r|d}�q�n@||k�r|d}�q�n(||dk�r8|d}�q�n|d}�q�n(|�	|j�}|dk�rn|t
|j�}�q�|dk�r�t
|�|k�r�|}�q�|�
��r�|j�r��q��q�|j�r�||��7}qr|�d	�d|_|Sqr|dk�r�||k�r�|}|�t
|�|�|d|�S)
Nr�rr�rr"r
r rr)rhr#r�r/r r[rErXrHryr"rGrIrcr9rTr;r])	rIr}r�r��startr^�endposZnlposZcrposrArArBr��	st







zTextIOWrapper.readlinecCs|jr|jjSdSrQ)rErr`rArArBrH
szTextIOWrapper.newlines)NNNFF)NNNFF)N)rrrr)N)r)N)N),rMrNrOrHr^r�r�r2r>r�r�r8r9r?r?r@rQrRrkrorqrfr5rhrYr,r)r�rOrXrTr[r]rcrkrnrarbr�r[r�r�r�rrArArArBr3�s|�
(�
$




�)



*�

c

K
	
]r3csReZdZdZd�fdd�	Zdd�Zdd	�Zed
d��Zedd
��Z	dd�Z
�ZS)�StringIOz�Text I/O implementation using an in-memory buffer.

    The initial_value argument sets the value of object.  The newline
    argument is like the one of TextIOWrapper's constructor.
    rr"csftt|�jt�dd|d�|dkr(d|_|dk	rbt|t�sNtd�t	|�j
���|�|�|�d�dS)Nzutf-8�
surrogatepass)r8r9r:Fz*initial_value must be str or None, not {0}r)
r�rwr�r�rJrrr r�r@rMr�r[)rIZ
initial_valuer:r�rArBr�T
s�
�
zStringIO.__init__c	CsP|��|jp|��}|��}|��z|j|j��dd�W�S|�|�XdS)NTr)	rfrErXr*r/r-r#r@r�)rIrZ	old_staterArArBr�d
szStringIO.getvaluecCs
t�|�SrQ)�objectr�r`rArArBr�n
szStringIO.__repr__cCsdSrQrAr`rArArBr9s
szStringIO.errorscCsdSrQrAr`rArArBr8w
szStringIO.encodingcCs|�d�dS)Nr�r\r`rArArBr�{
szStringIO.detach)rr")rMrNrOrHr�r�r�r�r9r8r�r�rArAr�rBrwM
s


rw)r
rNNNTN)8rHr�abcrr�r��sys�_threadrr��platformZmsvcrtrr�iorrrr	r�r��addr�	SEEK_DATAr*r�r�dev_moderirCrF�	open_coder/rGrPrVr.r#�ABCMetarW�registerr��_ior(r�r�r�r2r1r�r0rrrr3rwrArArArB�<module>s�


�
[

	
$=
ghCiIJY@U$weakref.cpython-38.pyc000064400000046100151450073350010624 0ustar00U

e5d�S�
@s�dZddlmZmZmZmZmZmZmZm	Z	ddl
mZmZddl
Z
ddlZddlZeefZddddd	d
ddd
ddddg
ZGdd�de�ZGdd�de
j�ZGdd�de�ZGdd	�d	e
j�ZGdd�d�ZdS)z{Weak reference support for Python.

This module is an implementation of PEP 205:

http://www.python.org/dev/peps/pep-0205/
�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr
�
WeakMethod�finalizecsDeZdZdZdZddd�Z�fdd�Zdd	�Zd
d�Ze	j
Z
�ZS)
rz�
    A custom `weakref.ref` subclass which simulates a weak reference to
    a bound method, working around the lifetime problem of bound methods.
    )�	_func_ref�
_meth_type�_alive�__weakref__Ncs~z|j}|j}Wn(tk
r8td�t|���d�YnX��fdd�}t�|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs&��}|jr"d|_�dk	r"�|�dS�NF)r)�arg�self��callbackZself_wr��/usr/lib64/python3.8/weakref.py�_cb3s
zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�clsZmethr�obj�funcrrrrrr#,s 
��
zWeakMethod.__new__cs2t���}|��}|dks"|dkr&dS|�||�S�N)�super�__call__rr)rr%r&��	__class__rrr)Bs

zWeakMethod.__call__cCs:t|t�r6|jr|js||kSt�||�o4|j|jkSdSr)�
isinstancerrr�__eq__r�r�otherrrrr-Is

zWeakMethod.__eq__cCs:t|t�r6|jr|js||k	St�||�p4|j|jkSdS�NT)r,rrr�__ne__rr.rrrr1Ps

zWeakMethod.__ne__)N)�__name__�
__module__�__qualname__�__doc__�	__slots__r#r)r-r1r�__hash__�
__classcell__rrr*rr$s
c@s�eZdZdZd,dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd-dd�Zdd�Zdd�ZeZdd�Zd d!�Zd"d#�Zd$d%�Zd.d&d'�Zd/d(d)�Zd*d+�ZdS)0rz�Mapping class that references values weakly.

    Entries in the dictionary will be discarded when no strong
    reference to the value exists anymore
    rcKs>t|�tfdd�}||_g|_t�|_i|_|j|f|�dS)NcSs6|�}|dk	r2|jr$|j�|j�n||j|j�dSr')�
_iterating�_pending_removals�append�key�data)�wr�selfrefZ_atomic_removalrrrr�removegs
z,WeakValueDictionary.__init__.<locals>.remove)rr	�_remover:�setr9r=�update)rr/�kwr@rrr�__init__fs	zWeakValueDictionary.__init__cCs(|j}|j}|r$|��}t||�qdSr')r:r=�popr	)r�l�dr<rrr�_commit_removalsws
z$WeakValueDictionary._commit_removalscCs4|jr|��|j|�}|dkr,t|��n|SdSr'�r:rIr=�KeyError�rr<�orrr�__getitem__�s
zWeakValueDictionary.__getitem__cCs|jr|��|j|=dSr')r:rIr=�rr<rrr�__delitem__�szWeakValueDictionary.__delitem__cCs|jr|��t|j�Sr')r:rI�lenr=�rrrr�__len__�szWeakValueDictionary.__len__cCs>|jr|��z|j|�}Wntk
r4YdSX|dk	SrrJrLrrr�__contains__�sz WeakValueDictionary.__contains__cCsd|jjt|�fS�Nz<%s at %#x>�r+r2�idrRrrr�__repr__�szWeakValueDictionary.__repr__cCs&|jr|��t||j|�|j|<dSr')r:rI�KeyedRefrAr=�rr<�valuerrr�__setitem__�szWeakValueDictionary.__setitem__c	CsV|jr|��t�}t|��0|j��D]\}}|�}|dk	r(|||<q(W5QRX|Sr')r:rIrrr=�items)r�newr<r>rMrrr�copy�s
zWeakValueDictionary.copyc	Csjddlm}|jr|��|��}t|��6|j��D]$\}}|�}|dk	r6|||||�<q6W5QRX|S�Nr)�deepcopy)r_rar:rIr+rr=r])r�memorar^r<r>rMrrr�__deepcopy__�s
z WeakValueDictionary.__deepcopy__NcCsP|jr|��z|j|}Wntk
r4|YSX|�}|dkrH|S|SdSr'rJ)rr<�defaultr>rMrrr�get�s
zWeakValueDictionary.getc	csR|jr|��t|��2|j��D] \}}|�}|dk	r"||fVq"W5QRXdSr'�r:rIrr=r])r�kr>�vrrrr]�s
zWeakValueDictionary.itemsc	csJ|jr|��t|��*|j��D]\}}|�dk	r"|Vq"W5QRXdSr'rf)rrgr>rrr�keys�s

zWeakValueDictionary.keysc	cs6|jr|��t|��|j��EdHW5QRXdS)a�Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        N�r:rIrr=�valuesrRrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc	csJ|jr|��t|��*|j��D]}|�}|dk	r"|Vq"W5QRXdSr'rj�rr>r%rrrrk�s
zWeakValueDictionary.valuescCs8|jr|��|j��\}}|�}|dk	r||fSqdSr')r:rIr=�popitem)rr<r>rMrrrrn�szWeakValueDictionary.popitemcGs`|jr|��z|j�|��}Wntk
r8d}YnX|dkrX|rN|dSt|��n|SdS)Nr)r:rIr=rFrK)rr<�argsrMrrrrFs

zWeakValueDictionary.popcCs`z|j|�}Wntk
r(d}YnX|dkrX|jr@|��t||j|�|j|<|S|SdSr')r=rKr:rIrYrA)rr<rdrMrrr�
setdefaults
zWeakValueDictionary.setdefaultcKsz|jr|��|j}|dk	rRt|d�s.t|�}|��D]\}}t||j|�||<q6|��D]\}}t||j|�||<qZdS�Nr])r:rIr=�hasattr�dictr]rYrA)rr/�kwargsrHr<rMrrrrCs
zWeakValueDictionary.updatecCs|jr|��t|j���S)a~Return a list of weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        )r:rI�listr=rkrRrrr�	valuerefs(s
zWeakValueDictionary.valuerefs)r)N)N)N)r2r3r4r5rErIrNrPrSrTrXr\r_�__copy__rcrer]ri�__iter__rlrkrnrFrprCrvrrrrrZs.
			
			

cs,eZdZdZdZdd�Z�fdd�Z�ZS)rYa[Specialized reference that includes a key corresponding to the value.

    This is used in the WeakValueDictionary to avoid having to create
    a function object for each key stored in the mapping.  A shared
    callback object can use the 'key' attribute of a KeyedRef instead
    of getting a reference to the key from an enclosing scope.

    �r<cCst�|||�}||_|Sr')rr#r<)r"�obrr<rrrrr#CszKeyedRef.__new__cst��||�dSr')r(rE)rrzrr<r*rrrEHszKeyedRef.__init__)r2r3r4r5r6r#rEr8rrr*rrY7s	rYc@s�eZdZdZd+dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd,dd�Zdd�Zdd�Zdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zd-d'd(�Zd.d)d*�ZdS)/ra� Mapping class that references keys weakly.

    Entries in the dictionary will be discarded when there is no
    longer a strong reference to the key. This can be used to
    associate additional data with an object owned by other parts of
    an application without adding attributes to those objects. This
    can be especially useful with objects that override attribute
    accesses.
    NcCsFi|_t|�fdd�}||_g|_t�|_d|_|dk	rB|�|�dS)NcSs.|�}|dk	r*|jr"|j�|�n|j|=dSr')r9r:r;r=)rgr?rrrrr@Ys
z*WeakKeyDictionary.__init__.<locals>.removeF)r=rrAr:rBr9�
_dirty_lenrC)rrsr@rrrrEWszWeakKeyDictionary.__init__cCs:|j}|j}|r6z||��=Wqtk
r2YqXqdSr')r:r=rFrK)rrGrHrrrrIhsz"WeakKeyDictionary._commit_removalscs&|j��fdd�|jD�|_d|_dS)Ncsg|]}|�kr|�qSrr)�.0rg�rHrr�
<listcomp>wsz5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r=r:r{rRrr}r�_scrub_removalsusz!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dSr0)r{r=rrOrrrrPzszWeakKeyDictionary.__delitem__cCs|jt|�Sr')r=rrOrrrrN~szWeakKeyDictionary.__getitem__cCs(|jr|jr|��t|j�t|j�Sr')r{r:rrQr=rRrrrrS�szWeakKeyDictionary.__len__cCsd|jjt|�fSrUrVrRrrrrX�szWeakKeyDictionary.__repr__cCs||jt||j�<dSr')r=rrArZrrrr\�szWeakKeyDictionary.__setitem__c	CsHt�}t|��0|j��D]\}}|�}|dk	r|||<qW5QRX|Sr')rrr=r])rr^r<r[rMrrrr_�s
zWeakKeyDictionary.copyc	Cs\ddlm}|��}t|��6|j��D]$\}}|�}|dk	r(|||�||<q(W5QRX|Sr`)r_rar+rr=r])rrbrar^r<r[rMrrrrc�s
zWeakKeyDictionary.__deepcopy__cCs|j�t|�|�Sr')r=rer�rr<rdrrrre�szWeakKeyDictionary.getcCs.zt|�}Wntk
r"YdSX||jkSr)rr r=)rr<r>rrrrT�s
zWeakKeyDictionary.__contains__c	csDt|��2|j��D] \}}|�}|dk	r||fVqW5QRXdSr'�rr=r])rr>r[r<rrrr]�s

zWeakKeyDictionary.itemsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr')rr=rmrrrri�s


zWeakKeyDictionary.keysc	cs<t|��*|j��D]\}}|�dk	r|VqW5QRXdSr'r�)rr>r[rrrrk�s

zWeakKeyDictionary.valuescCs
t|j�S)azReturn a list of weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        )rur=rRrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCs0d|_|j��\}}|�}|dk	r||fSqdSr0)r{r=rn)rr<r[rMrrrrn�s
zWeakKeyDictionary.popitemcGsd|_|jjt|�f|��Sr0)r{r=rFr)rr<rorrrrF�szWeakKeyDictionary.popcCs|j�t||j�|�Sr')r=rprrAr�rrrrp�szWeakKeyDictionary.setdefaultcKs\|j}|dk	rFt|d�s$ti�|�}|��D]\}}||t||j�<q,t|�rX|�|�dSrq)r=rrr"r]rrArQrC)rrsrtrHr<r[rrrrC�s
zWeakKeyDictionary.update)N)N)N)N)r2r3r4r5rErIrrPrNrSrXr\r_rwrcrerTr]rirxrkr�rnrFrprCrrrrrLs.


	


c@s�eZdZdZdZiZdZe��Z	dZ
dZGdd�d�Zdd�Z
de
_dd
d�Zdd
�Zdd�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��Zd	S)raClass for finalization of weakrefable objects

    finalize(obj, func, *args, **kwargs) returns a callable finalizer
    object which will be called when obj is garbage collected. The
    first time the finalizer is called it evaluates func(*arg, **kwargs)
    and returns the result. After this the finalizer is dead, and
    calling it just returns None.

    When the program exits any remaining finalizers for which the
    atexit attribute is true will be run in reverse order of creation.
    By default atexit is true.
    rFc@seZdZdZdS)zfinalize._Info)�weakrefr&rort�atexit�indexN)r2r3r4r6rrrr�_Infosr�cOs>t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|js�ddl}|�	|j
�dt_|��}t
||�|_||_||_|�pd|_d|_t|j�|_||j|<dt_dS)
N�z<descriptor '__init__' of 'finalize' object needs an argumentr&z9finalize expected at least 2 positional arguments, got %d��rz0Passing 'func' as keyword argument is deprecated)�
stacklevelr%z/Passing 'obj' as keyword argument is deprecatedT)rQr rF�warnings�warn�DeprecationWarning�tuple�_registered_with_atexitr��register�	_exitfuncrr�rr�r&rort�next�_index_iterr��	_registry�_dirty)rortrr%r&r�r��inforrrrEsR

�

�
�
�
zfinalize.__init__z&($self, obj, func, /, *args, **kwargs)NcCs0|j�|d�}|r,|js,|j|j|jp(i�SdS)zZIf alive then mark as dead and return func(*args, **kwargs);
        otherwise return NoneN)r�rF�	_shutdownr&rort)r�_r�rrrr)1s
zfinalize.__call__cCsH|j�|�}|o|��}|dk	rD|j�|d�rD||j|j|jp@ifSdS)z^If alive then mark as dead and return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�rFr&rort�rr�r%rrr�detach8szfinalize.detachcCs:|j�|�}|o|��}|dk	r6||j|j|jp2ifSdS)zMIf alive then return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�r&rortr�rrr�peek@sz
finalize.peekcCs
||jkS)zWhether finalizer is alive)r�rRrrr�aliveHszfinalize.alivecCs|j�|�}t|�o|jS)z*Whether finalizer should be called at exit�r�re�boolr�)rr�rrrr�Mszfinalize.atexitcCs|j�|�}|rt|�|_dSr'r�)rr[r�rrrr�SscCs^|j�|�}|o|��}|dkr6dt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)r�rer�r"r2rWr�rrrrXYs�zfinalize.__repr__cCs2dd�|j��D�}|jdd�d�dd�|D�S)NcSsg|]\}}|jr||f�qSr)r��r|�f�irrrr~esz-finalize._select_for_exit.<locals>.<listcomp>cSs
|djS)Nr�)r�)�itemrrr�<lambda>f�z+finalize._select_for_exit.<locals>.<lambda>rycSsg|]\}}|�qSrrr�rrrr~gs)r�r]�sort)r$�Lrrr�_select_for_exitbszfinalize._select_for_exitcCs�d}z�|jr�ddl}|��r(d}|��d}|dks:tjrH|��}dt_|sNq�|�	�}z
|�Wn"t
k
r�tjt�
��YnX||jks,t�q,W5dt_|r�|��XdS)NFTr)rr�Zenabler��gcZ	isenabledZdisabler�r�rF�	Exception�sys�
excepthook�exc_info�AssertionError)r$Zreenable_gcr�Zpendingr�rrrr�is,
zfinalize._exitfunc)N)r2r3r4r5r6r�r��	itertools�countr�r�r�r�rE�__text_signature__r)r�r��propertyr�r��setterrX�classmethodr�r�rrrrr�s0*



	
)r5�_weakrefrrrrrrrr	Z_weakrefsetr
r�_collections_abcr�r�r
�__all__r�MutableMappingrrYrrrrrr�<module>s0(
�6^quopri.cpython-38.opt-2.pyc000064400000010673151450073350011465 0ustar00U

e5dT�@s�ddddgZdZdZdZdZzdd	lmZmZWnek
rLd
Zd
ZYnXdd�Z	d
d�Z
ddd�Zddd�Zddd�Z
ddd�Zdd�Zdd�Zdd�Zedkr�e�d
S)�encode�decode�encodestring�decodestring�=�Ls0123456789ABCDEF��)�a2b_qp�b2a_qpNcCs:|dkr|S|dkr|S|tkp8d|ko2dknS)N� 	�_� �~)�ESCAPE)�c�	quotetabs�header�r�/usr/lib64/python3.8/quopri.py�needsquotings
rcCs(t|�}ttt|dt|df�S)N�)�ordr�bytes�HEX�rrrr�quote$srFc
Cs2tdk	r,|��}t|||d�}|�|�dS|dfdd�}d}|��}|sN�qg}	d}
|dd�dkrv|dd�}d}
|D]D}t|f�}t|||�r�t|�}|r�|dkr�|	�d�qz|	�|�qz|dk	r�||�t�	|	�}t
|�tk�r||dtd	�d
d�|td	d�}q�|}q>|dk	�r.|||
d�dS)N�rr�
cSsj|r<|dd�dkr<|�|dd�t|dd��|�n*|dkrX|�t|�|�n|�||�dS)N���r�.)�writer)�s�output�lineEndrrrr ;s
(zencode.<locals>.writerrr
r�s=
)r#)r
�readr �readlinerrr�append�EMPTYSTRING�join�len�MAXLINESIZE)
�inputr"rr�data�odatar Zprevline�lineZoutline�strippedrZthislinerrrr,s>	




cCsFtdk	rt|||d�Sddlm}||�}|�}t||||�|��S)Nrr��BytesIO)r
�ior2r�getvalue)r!rrr2�infp�outfprrrrjscCs�tdk	r*|��}t||d�}|�|�dSd}|��}|s>�q�dt|�}}|dkr�||d|�dkr�d}	|d}|dkr�||d|�dkr�|d}qtnd}	||k�r�|||d�}
|
dkr�|r�|d}|d}q�|
tkr�||
}|d}q�|d|k�r|	�sd}	�q�q�|d|k�rJ||d|d	�tk�rJ|t}|d	}q�|d	|k�r�t||d|d	���r�t||d	|d
���r�|tt||d|d
��f�}|d
}q�||
}|d}q�|	s.|�|d�d}q.|�r�|�|�dS)N�rrrr$rs 	
rr
��)	r	r%r r&r*r�ishexr�unhex)r,r"rr-r.�newr/�i�n�partialrrrrrusP



(
B"

cCsDtdk	rt||d�Sddlm}||�}|�}t|||d�|��S)Nr7rr1)r	r3r2rr4)r!rr2r5r6rrrr�scCsHd|kodknpFd|ko*dknpFd|koBdkSS)N�0�9�a�f�A�Frrrrrr:�sr:cCs�d}|D]�}t|f�}d|kr*dkr8nn
td�}nLd|krLdkr^nntd�d}n&d	|krrd
kr�nntd	�d}n|dt|�|}q|S)Nrr@rA�0rBrC�a�
rDrEr)rr)r!�bitsrr=rrrr;�s

r;cCs�ddl}ddl}z|�|jdd�d�\}}WnV|jk
r�}z6|j|_t|�td�td�td�|�d�W5d}~XYnXd}d}|D] \}}|dkr�d}|d	kr�d}q�|r�|r�|j|_td
�|�d�|s�dg}d}	|D]�}
|
dkr�|jj	}nTzt
|
d�}WnDtk
�rP}z$|j�d
|
|f�d}	WY�q�W5d}~XYnXz*|�rjt||jj	�nt||jj	|�W5|
dk�r�|�
�Xq�|	�r�|�|	�dS)Nrr$Ztdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder8z-tz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s)
)�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr �closerr)rLrMZopts�args�msgZdecoZtabs�orG�sts�file�fprrr�main�sT


r_�__main__)F)FF)F)F)�__all__rr+rr(Zbinasciir	r
�ImportErrorrrrrrrr:r;r_�__name__rrrr�<module>s(

>

+
.reprlib.cpython-38.pyc000064400000012271151450073350010641 0ustar00U

e5d��@s^dZdddgZddlZddlmZddlmZd
d	d�ZGd
d�d�Zdd�Z	e�Z
e
jZdS)zGRedo the builtin repr() (representation) but with limits on most sizes.�Repr�repr�recursive_repr�N)�islice)�	get_ident�...cs�fdd�}|S)zGDecorator to make a repr function return fillvalue for a recursive callcsXt�����fdd�}t�d�|_t�d�|_t�d�|_t�d�|_t�di�|_|S)Nc	sBt|�t�f}|�kr�S��|�z�|�}W5��|�X|S�N)�idr�add�discard)�self�key�result)�	fillvalue�repr_running�
user_function��/usr/lib64/python3.8/reprlib.py�wrappers
z<recursive_repr.<locals>.decorating_function.<locals>.wrapper�
__module__�__doc__�__name__�__qualname__�__annotations__)�set�getattrrrrrr)rr�r)rrr�decorating_functionsz+recursive_repr.<locals>.decorating_functionr)rrrrrr	sc@s~eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)N�����()�maxlevel�maxtuple�maxlist�maxarray�maxdict�maxset�maxfrozenset�maxdeque�	maxstring�maxlong�maxother)rrrr�__init__&sz
Repr.__init__cCs|�||j�Sr)�repr1r#)r�xrrrr3sz	Repr.reprcCsVt|�j}d|kr$|��}d�|�}t|d|�rFt|d|�||�S|�||�SdS)N� �_�repr_)�typer�split�join�hasattrr�
repr_instance)rr0�level�typename�partsrrrr/6s

z
Repr.repr1�c
s�t|�}|dkr|rd}nX|d�|j���fdd�t||�D�}	||krT|	�d�d�|	�}|dkrr|rr||}d|||fS)Nrr�csg|]}�|���qSrr)�.0�elem��newlevelr/rr�
<listcomp>Gsz'Repr._repr_iterable.<locals>.<listcomp>�, z%s%s%s)�lenr/r�appendr6)
rr0r9�left�right�maxiter�trail�n�s�piecesrr@r�_repr_iterable@s

zRepr._repr_iterablecCs|�||dd|jd�S)N�(�)�,)rMr$�rr0r9rrr�
repr_tupleMszRepr.repr_tuplecCs|�||dd|j�S)N�[�])rMr%rQrrr�	repr_listPszRepr.repr_listcCs,|sd|jSd|j}|�|||d|j�S)Nzarray('%s')z
array('%s', [�]))�typecoderMr&)rr0r9�headerrrr�
repr_arraySs

zRepr.repr_arraycCs$|sdSt|�}|�||dd|j�S)Nzset()�{�})�_possibly_sortedrMr(rQrrr�repr_setYsz
Repr.repr_setcCs$|sdSt|�}|�||dd|j�S)Nzfrozenset()zfrozenset({z}))r\rMr)rQrrr�repr_frozenset_s�zRepr.repr_frozensetcCs|�||dd|j�S)Nzdeque([rV)rMr*rQrrr�
repr_dequefszRepr.repr_dequecCs�t|�}|dkrdS|dkr dS|d}|j}g}tt|�|j�D].}|||�}||||�}	|�d||	f�qB||jkr�|�d�d�|�}
d|
fS)	Nrz{}z{...}r=z%s: %srrCz{%s})rDr/rr\r'rEr6)rr0r9rJrAr/rLr
�keyrepr�valreprrKrrr�	repr_dictis 



zRepr.repr_dictcCs�t�|d|j��}t|�|jkr�td|jdd�}td|jd|�}t�|d|�|t|�|d��}|d|�d|t|�|d�}|S�Nr��r)�builtinsrr+rD�max�rr0r9rK�i�jrrr�repr_strxs&$z
Repr.repr_strcCsht�|�}t|�|jkrdtd|jdd�}td|jd|�}|d|�d|t|�|d�}|Src)rfrrDr,rgrhrrr�repr_int�s
$z
Repr.repr_intcCs�zt�|�}Wn(tk
r6d|jjt|�fYSXt|�|jkr�td|jdd�}td|jd|�}|d|�d|t|�|d�}|S)Nz<%s instance at %#x>rrdrer)	rfr�	Exception�	__class__rr	rDr-rgrhrrrr8�s$zRepr.repr_instanceN)r<)rrrr.rr/rMrRrUrYr]r^r_rbrkrlr8rrrrr$s



	cCs,z
t|�WStk
r&t|�YSXdSr)�sortedrm�list)r0rrrr\�s
r\)r)r�__all__rf�	itertoolsr�_threadrrrr\�aReprrrrrr�<module>s

s	linecache.cpython-38.opt-1.pyc000064400000007435151450073350012062 0ustar00U

e5d��@sndZddlZddlZddlZddlZdddgZddd�Ziadd�Zddd	�Z	dd
d�Z
ddd�Zd
d�ZdS)z�Cache lines from Python source files.

This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
�N�getline�
clearcache�
checkcachecCs:t||�}d|kr"t|�kr2nn||dSdSdS)N��)�getlines�len)�filename�lineno�module_globals�lines�r
�!/usr/lib64/python3.8/linecache.pyrs
cCsiadS)zClear the cache entirely.N)�cacher
r
r
rrscCsX|tkr(t|}t|�dkr(t|dSzt||�WStk
rRt�gYSXdS)z�Get the lines for a Python source file from the cache.
    Update the cache if it doesn't contain an entry for this file already.r�N)rr�updatecache�MemoryErrorr)r	r�entryr
r
rr%src	Cs�|dkrtt���}n|tkr&|g}ndS|D]�}t|}t|�dkrHq.|\}}}}|dkr^q.zt�|�}Wn$tk
r�t�|d�Yq.YnX||jks�||j	kr.t�|d�q.dS)zUDiscard cache entries that are out of date.
    (This is not checked upon each call!)Nr)
�listr�keysr�os�stat�OSError�pop�st_size�st_mtime)r	�	filenamesr�size�mtimer�fullnamerr
r
rr5s&
c
Cs�|tkr$tt|�dkr$t�|d�|r<|�d�r@|�d�r@gS|}zt�|�}W�ntk
�rn|}t||�r�zt|d�}Wnt	tfk
r�YnDX|dkr�gYSt|�ddd�|�
�D�|ft|<t|dYStj�|�r�gYSt
jD]d}ztj�||�}Wnttfk
�r0Yq�YnXzt�|�}W�qjWq�tk
�r^Yq�Xq�gYSYnXz"t�|��}|��}W5QRXWntk
�r�gYSX|�r�|d	�d
��s�|d	d
7<|j|j}	}
|	|
||ft|<|S)z�Update a cache entry and return its list of lines.
    If something's wrong, print a message, discard the cache entry,
    and return an empty list.rN�<�>rcSsg|]}|d�qS)�
r
)�.0�liner
r
r�
<listcomp>qszupdatecache.<locals>.<listcomp>r���r")rrr�
startswith�endswithrrr�	lazycache�ImportError�
splitlines�path�isabs�sys�join�	TypeError�AttributeError�tokenize�open�	readlinesrr)r	rrr�basename�data�dirname�fprrrr
r
rrRs\
�



rcCs�|tkr tt|�dkrdSdS|r8|�d�r<|�d�r<dS|r�d|kr�|�d�}|d}t|dd	�}|r�|r�t�||�}|ft|<dSdS)
a�Seed the cache for filename with module_globals.

    The module loader will be asked for the source only when getlines is
    called, not immediately.

    If there is an entry in the cache already, it is not altered.

    :return: True if a lazy load is registered in the cache,
        otherwise False. To register such a load a module loader with a
        get_source method must be found, the filename must be a cachable
        filename, and the filename must not be already cached.
    rTFr r!�
__loader__�__name__�
get_sourceN)rrr'r(�get�getattr�	functools�partial)r	r�name�loaderr;�	get_linesr
r
rr)�s


r))N)N)N)N)
�__doc__r>r.rr2�__all__rrrrrrr)r
r
r
r�<module>s




Asymtable.cpython-38.opt-1.pyc000064400000025736151450073350011773 0ustar00U

e5dU�	@sJdZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlZdddddgZd	d�ZGd
d�d�Ze�ZGdd�d�ZGd
d�de�ZGdd�de�ZGdd�d�Zedk�rFddlZddlZeejd��Ze� �Z!W5QRXee!ej"�#ejd�dd�Z$e$�%�D]$Z&e$�'e&�Z(e)e(e(�*�e(�+���q dS)z2Interface to the compiler's internal symbol tables�N)�USE�
DEF_GLOBAL�DEF_NONLOCAL�	DEF_LOCAL�	DEF_PARAM�
DEF_IMPORT�	DEF_BOUND�	DEF_ANNOT�	SCOPE_OFF�
SCOPE_MASK�FREE�LOCAL�GLOBAL_IMPLICIT�GLOBAL_EXPLICIT�CELL�symtable�SymbolTable�Class�Function�SymbolcCst�|||�}t||�S�N)�	_symtabler�_newSymbolTable)�code�filenameZcompile_type�top�r� /usr/lib64/python3.8/symtable.pyrsc@s$eZdZdd�Zdd�Zdd�ZdS)�SymbolTableFactorycCst��|_dSr)�weakrefZWeakValueDictionary�_SymbolTableFactory__memo��selfrrr�__init__szSymbolTableFactory.__init__cCs6|jtjkrt||�S|jtjkr,t||�St||�Sr)�typer�
TYPE_FUNCTIONr�
TYPE_CLASSrr)r"�tablerrrr�news


zSymbolTableFactory.newcCs8||f}|j�|d�}|dkr4|�||�}|j|<|Sr)r �getr()r"r'r�key�objrrr�__call__s
zSymbolTableFactory.__call__N)�__name__�
__module__�__qualname__r#r(r,rrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) rcCs||_||_i|_dSr)�_table�	_filename�_symbols)r"Z	raw_tablerrrrr#'szSymbolTable.__init__cCsN|jtkrd}nd|jj}|jjdkr6d�||j�Sd�||jj|j�SdS)N�z%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)�	__class__rr-r0�name�formatr1)r"Zkindrrr�__repr__,s
�zSymbolTable.__repr__cCs:|jjtjkrdS|jjtjkr$dS|jjtjkr6dSdS)N�moduleZfunction�class)r0r$rZTYPE_MODULEr%r&r!rrr�get_type9szSymbolTable.get_typecCs|jjSr)r0�idr!rrr�get_idCszSymbolTable.get_idcCs|jjSr)r0r5r!rrr�get_nameFszSymbolTable.get_namecCs|jjSr)r0�linenor!rrr�
get_linenoIszSymbolTable.get_linenocCst|jjtjk�Sr)�boolr0r$rr%r!rrr�is_optimizedLszSymbolTable.is_optimizedcCst|jj�Sr)r@r0�nestedr!rrr�	is_nestedOszSymbolTable.is_nestedcCst|jj�Sr)r@r0�childrenr!rrr�has_childrenRszSymbolTable.has_childrencCsdS)z7Return true if the scope uses exec.  Deprecated method.Frr!rrr�has_execUszSymbolTable.has_execcCs|jj��Sr)r0�symbols�keysr!rrr�get_identifiersYszSymbolTable.get_identifierscCsT|j�|�}|dkrP|jj|}|�|�}|jjdk}t||||d�}|j|<|S)Nr��module_scope)r2r)r0rG�_SymbolTable__check_childrenr5r)r"r5Zsym�flags�
namespacesrKrrr�lookup\s
�zSymbolTable.lookupcs�fdd����D�S)Ncsg|]}��|��qSr)rO��.0�identr!rr�
<listcomp>gsz+SymbolTable.get_symbols.<locals>.<listcomp>)rIr!rr!r�get_symbolsfszSymbolTable.get_symbolscs��fdd��jjD�S)Ncs"g|]}|j�krt|�j��qSr)r5rr1�rQ�st�r5r"rrrSjs
�z0SymbolTable.__check_children.<locals>.<listcomp>�r0rD)r"r5rrWrZ__check_childrenis�zSymbolTable.__check_childrencs�fdd��jjD�S)Ncsg|]}t|�j��qSr)rr1rUr!rrrSos�z,SymbolTable.get_children.<locals>.<listcomp>rXr!rr!r�get_childrenns
�zSymbolTable.get_childrenN)r-r.r/r#r7r:r<r=r?rArCrErFrIrOrTrLrYrrrrr%s


c@sPeZdZdZdZdZdZdZdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dS)rNcst��fdd����D��S)Nc3s"|]}��jj|�r|VqdSr)r0rGrP�r"Z	test_funcrr�	<genexpr>}s�z-Function.__idents_matching.<locals>.<genexpr>)�tuplerIrZrrZrZ__idents_matching|szFunction.__idents_matchingcCs |jdkr|�dd��|_|jS)NcSs|t@Sr)r��xrrr�<lambda>��z)Function.get_parameters.<locals>.<lambda>)�_Function__params�_Function__idents_matchingr!rrr�get_parameters�s
zFunction.get_parameterscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSr�r
rr]�Zlocsrrr_�r`z%Function.get_locals.<locals>.<lambda>)�_Function__localsr
rrb�r"Ztestrrer�
get_locals�s

zFunction.get_localscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSrrdr]�Zglobrrr_�r`z&Function.get_globals.<locals>.<lambda>)�_Function__globalsrrrbrgrrir�get_globals�s

zFunction.get_globalscCs |jdkr|�dd��|_|jS)NcSs|t@Sr)rr]rrrr_�r`z(Function.get_nonlocals.<locals>.<lambda>)�_Function__nonlocalsrbr!rrr�
get_nonlocals�s
zFunction.get_nonlocalscCs$|jdkrdd�}|�|�|_|jS)NcSs|t?t@tkSr)r
rrr]rrrr_�r`z$Function.get_frees.<locals>.<lambda>)�_Function__freesrb)r"�is_freerrr�	get_frees�s
zFunction.get_frees)r-r.r/rarfrnrjrlrbrcrhrkrmrprrrrrssc@seZdZdZdd�ZdS)rNcCs6|jdkr0i}|jjD]}d||j<qt|�|_|jS)N�)�_Class__methodsr0rDr5r\)r"�drVrrr�get_methods�s

zClass.get_methods)r-r.r/rrrtrrrrr�sc@s�eZdZd$dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%rNFrJcCs.||_||_|t?t@|_|p d|_||_dS)Nr)�
_Symbol__name�_Symbol__flagsr
r�_Symbol__scope�_Symbol__namespaces�_Symbol__module_scope)r"r5rMrNrKrrrr#�s

zSymbol.__init__cCsd�|j�S)Nz<symbol {0!r}>)r6rur!rrrr7�szSymbol.__repr__cCs|jSr)rur!rrrr=�szSymbol.get_namecCst|jtj@�Sr)r@rvrrr!rrr�
is_referenced�szSymbol.is_referencedcCst|jt@�Sr)r@rvrr!rrr�is_parameter�szSymbol.is_parametercCs"t|jttfkp|jo|jt@�S)z0Return *True* if the sysmbol is global.
        )r@rwrrryrvrr!rrr�	is_global�s�zSymbol.is_globalcCst|jt@�Sr)r@rvrr!rrr�is_nonlocal�szSymbol.is_nonlocalcCst|jtk�Sr)r@rwrr!rrr�is_declared_global�szSymbol.is_declared_globalcCs"t|jttfkp|jo|jt@�S)z.Return *True* if the symbol is local.
        )r@rwr
rryrvrr!rrr�is_local�s�zSymbol.is_localcCst|jt@�Sr)r@rvr	r!rrr�is_annotated�szSymbol.is_annotatedcCst|jtk�Sr)r@rwrr!rrrro�szSymbol.is_freecCst|jt@�Sr)r@rvrr!rrr�is_imported�szSymbol.is_importedcCst|jt@�Sr)r@rvrr!rrr�is_assigned�szSymbol.is_assignedcCs
t|j�S)a�Returns true if name binding introduces new namespace.

        If the name is used as the target of a function or class
        statement, this will be true.

        Note that a single name can be bound to multiple objects.  If
        is_namespace() is true, the name may also be bound to other
        objects, like an int or list, that does not introduce a new
        namespace.
        )r@rxr!rrr�is_namespace�szSymbol.is_namespacecCs|jS)z.Return a list of namespaces bound to this name)rxr!rrr�get_namespaces�szSymbol.get_namespacescCs t|j�dkrtd��|jdS)z�Returns the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces.
        rqz$name is bound to multiple namespacesr)�lenrx�
ValueErrorr!rrr�
get_namespace�szSymbol.get_namespace)N)r-r.r/r#r7r=rzr{r|r}r~rr�ror�r�r�r�r�rrrrr�s 
�__main__rq�exec),�__doc__rrrrrrrrr	r
rrr
rrrr�__all__rrrrrrrr-�os�sys�open�argv�f�read�src�path�split�modrIrRrO�info�printrr�rrrr�<module>s&DN,
M

dataclasses.cpython-38.opt-1.pyc000064400000056147151450073350012442 0ustar00U

e5d5��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZdddddddd	d
ddd
gZ	Gdd�de
�ZGdd�d�Ze�Z
Gdd�d�Ze�Ze�i�ZGdd�d�Zed�Zed�Zed�ZdZdZdZe�d�ZGdd�de�ZGdd�ded�ZGd d�d�ZGd!d"�d"�Zeed#d#dd#dd$�d%d�Z d&d'�Z!d(d)�Z"dded*�d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(d7d8�Z)d9d:�Z*d;d<�Z+d=d>�Z,d?d@�Z-dAdB�Z.dCdD�Z/dEdF�Z0dGdH�Z1dIdJ�Z2dKdL�Z3dddde1de2de2e3e2e3e2e3e2e3dM�Z4dNdO�Z5ddd#d#d#dPdPdPdQ�dRd�Z6dSd�Z7dTdU�Z8dVd
�Z9e:dW�dXd	�Z;dYdZ�Z<e=d[�d\d
�Z>d]d^�Z?d_dd#d#d#dPdPdPd`�dad�Z@dbd�ZAdceA_BdS)e�N�	dataclass�field�Field�FrozenInstanceError�InitVar�MISSING�fields�asdict�astuple�make_dataclass�replace�is_dataclassc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�#/usr/lib64/python3.8/dataclasses.pyr�sc@seZdZdd�ZdS)�_HAS_DEFAULT_FACTORY_CLASScCsdS)Nz	<factory>r��selfrrr�__repr__�sz#_HAS_DEFAULT_FACTORY_CLASS.__repr__N)rrrrrrrrr�src@seZdZdS)�
_MISSING_TYPENrrrrrr�src@seZdZdd�Zdd�ZdS)�_FIELD_BASEcCs
||_dS�N��name�rrrrr�__init__�sz_FIELD_BASE.__init__cCs|jSrrrrrrr�sz_FIELD_BASE.__repr__N)rrrrrrrrrr�sr�_FIELD�_FIELD_CLASSVAR�_FIELD_INITVARZ__dataclass_fields__Z__dataclass_params__Z
__post_init__z^(?:\s*(\w+)\s*\.)?\s*(\w+)c@seZdZdd�ZdS)�_InitVarMetacCst|�Sr)r)rZparamsrrr�__getitem__�sz_InitVarMeta.__getitem__N)rrrr#rrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)r��typecCs
||_dSrr$)rr%rrrr�szInitVar.__init__cCs,t|jt�r|jj}n
t|j�}d|�d�S)Nzdataclasses.InitVar[�])�
isinstancer%r�repr)rZ	type_namerrrr�s

zInitVar.__repr__N�rrr�	__slots__rrrrrrr�s)�	metaclassc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r)
rr%�default�default_factoryr(�hash�init�compare�metadata�_field_typecCsRd|_d|_||_||_||_||_||_||_|dkr<tnt	�
|�|_d|_dSr)
rr%r,r-r/r(r.r0�_EMPTY_METADATA�types�MappingProxyTyper1r2)rr,r-r/r(r.r0r1rrrr�s��zField.__init__cCsVd|j�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d	|j�d
|j	�d�S)NzField(name=z,type=z	,default=z,default_factory=z,init=�,repr=z,hash=z	,compare=z
,metadata=z
,_field_type=�))
rr%r,r-r/r(r.r0r1r2rrrrrszField.__repr__cCs(tt|j�dd�}|r$||j||�dS)N�__set_name__)�getattrr%r,)r�ownerr�funcrrrr8szField.__set_name__N)rrrr*rrr8rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�_DataclassParams�r/r(�eq�order�unsafe_hash�frozencCs(||_||_||_||_||_||_dSrr=)rr/r(r>r?r@rArrrr*sz_DataclassParams.__init__c
Cs6d|j�d|j�d|j�d|j�d|j�d|j�d�
S)Nz_DataclassParams(init=r6z,eq=z,order=z
,unsafe_hash=z,frozen=r7r=rrrrr2sz_DataclassParams.__repr__Nr)rrrrr<!sr<T�r,r-r/r(r.r0r1cCs,|tk	r|tk	rtd��t|||||||�S)a�Return an object to identify dataclass fields.

    default is the default value of the field.  default_factory is a
    0-argument function called to initialize a field's value.  If init
    is True, the field will be a parameter to the class's __init__()
    function.  If repr is True, the field will be included in the
    object's repr().  If hash is True, the field will be included in
    the object's hash().  If compare is True, the field will be used
    in comparison functions.  metadata, if specified, must be a
    mapping which is stored but not otherwise examined by dataclass.

    It is an error to specify both default and default_factory.
    z/cannot specify both default and default_factory)r�
ValueErrorrrBrrrr@s
�cs(|sdSdd��fdd�|D���d�S)N�()�(�,csg|]}��d|j���qS)�.r��.0�f��obj_namerr�
<listcomp>_sz_tuple_str.<locals>.<listcomp>�,))�join)rLrrrKr�
_tuple_strVsrPcs"t��t�����fdd��}|S)Nc	sDt|�t��f}|�krdS��|�z�|�}W5��|�X|S)Nz...)�id�_thread�	get_ident�add�discard)r�key�result��repr_running�
user_functionrr�wrapperis
z _recursive_repr.<locals>.wrapper)�set�	functools�wraps)rZr[rrXr�_recursive_reprds
r_)�globals�locals�return_typec
Cs�|dkri}d|krt|d<d}|tk	r4||d<d}d�|�}d�dd�|D��}d	|�d
|�d|�d|��}d
�|���}d|�d|�d|��}i}	t|||	�|	df|�S)NZBUILTINS�Z_return_typez->_return_typerF�
css|]}d|��VqdS)z  Nr)rI�brrr�	<genexpr>�sz_create_fn.<locals>.<genexpr>z def rEr7z:
�, zdef __create_fn__(z):
z	
 return Z
__create_fn__)�builtinsrrO�keys�exec)
r�argsZbodyr`rarbZreturn_annotationZtxtZ
local_vars�nsrrr�
_create_fnws 
rmcCs0|rd|�d|�d|�d�S|�d|�d|��S)NzBUILTINS.object.__setattr__(rFr7rG�=r)rAr�value�	self_namerrr�
_field_assign�srqcCs�d|j��}|jtk	rV|jr@|j||<|�d|j�d|j��}q�|j||<|�d�}n8|jr�|jtkrn|j}q�|jtk	r�|j||<|j}ndS|jtkr�dSt||j||�S)NZ_dflt_z() if z is _HAS_DEFAULT_FACTORY else rD)rr-rr/r,r2r!rq)rJrAr`rpZdefault_namerorrr�_field_init�s"






rrcCsV|jtkr|jtkrd}n&|jtk	r2d|j��}n|jtk	r@d}|j�d|j�|��S)Nrcz=_dflt_z=_HAS_DEFAULT_FACTORYz:_type_)r,rr-r)rJr,rrr�_init_param�s

rscCs�d}|D]:}|jr|jtkr&|jtks,d}q|rtd|j�d���qdd�|D�}|�ttd��g}|D] }t||||�}	|	rj|�	|	�qj|r�d�
d	d
�|D��}
|�	|�dt�d|
�d
��|s�dg}td|gdd�|D�|||dd�S)NFTznon-default argument z follows default argumentcSsi|]}d|j��|j�qS)Z_type_)rr%rHrrr�
<dictcomp>�s
z_init_fn.<locals>.<dictcomp>)r�_HAS_DEFAULT_FACTORYrFcss|]}|jtkr|jVqdSr)r2r!rrHrrrrf	s
�z_init_fn.<locals>.<genexpr>rGrEr7�passrcSsg|]}|jrt|��qSr)r/rsrHrrrrMsz_init_fn.<locals>.<listcomp>)rar`rb)
r/r,rr-�	TypeErrorr�updaterurr�appendrO�_POST_INIT_NAMErm)rrA�
has_post_initrpr`Zseen_defaultrJraZ
body_lines�lineZ
params_strrrr�_init_fn�s:��r}cCs2tdddd�dd�|D��dg|d�}t|�S)	Nrrz(return self.__class__.__qualname__ + f"(rgcSs g|]}|j�d|j�d��qS)z={self.z!r}rrHrrrrMs�z_repr_fn.<locals>.<listcomp>z)"�r`)rmrOr_)rr`�fnrrr�_repr_fns
����r�cCsp|td�}|r,dd�dd�|D��d}nd}tdd	d
|�d�dd
f||d�tddd
|�d�ddf||d�fS)N)�clsrrErFcss|]}t|j�VqdSr)r(rrHrrrrf(sz'_frozen_get_del_attr.<locals>.<genexpr>rNrD�__setattr__)rrroz if type(self) is cls or name in �:z> raise FrozenInstanceError(f"cannot assign to field {name!r}")z)super(cls, self).__setattr__(name, value))rar`�__delattr__rz; raise FrozenInstanceError(f"cannot delete field {name!r}")z"super(cls, self).__delattr__(name))rrOrm)r�rr`raZ
fields_strrrr�_frozen_get_del_attr$s2�
��
���r�cCs$t|ddd|�|�|��dg|d�S)N)r�otherz%if other.__class__ is self.__class__:z return zreturn NotImplementedr~)rm)r�op�
self_tuple�other_tupler`rrr�_cmp_fn=s��r�cCs$td|�}tddd|�d�g|d�S)Nr�__hash__rzreturn hash(r7r~)rPrm)rr`r�rrr�_hash_fnKs
�r�cCs$||jkp"t|�|jko"|j|jkSr)�ClassVarr%Z
_GenericAliasZ
__origin__)�a_type�typingrrr�_is_classvarSs

�r�cCs||jkpt|�|jkSr)rr%)r��dataclassesrrr�_is_initvar[s
�r�c	Cs�t�|�}|r�d}|�d�}|s2tj�|j�j}n2tj�|j�}|rd|j�|�|krdtj�|j�j}|r�||�|�d��|�r�dSdS)N��TF)�_MODULE_IDENTIFIER_RE�match�group�sys�modules�getr�__dict__)	Z
annotationr�Za_moduler�Zis_type_predicater�rlZmodule_name�modulerrr�_is_typebs)

r�cCs8t||t�}t|t�r|}nt|tj�r,t}t|d�}||_||_t	|_
tj�
d�}|r�t||�s�t|jt�r�t|j|||jt�r�t|_
|j
t	kr�tjt}t||�s�t|jt�r�t|j|||jt�r�t|_
|j
ttfkr�|jtk	r�td|j�d���|j
t	k�r4t|jtttf��r4tdt|j��d|j�d���|S)N)r,r��field z cannot have a default factoryzmutable default z for field z$ is not allowed: use default_factory)r9rr'rr4�MemberDescriptorTyperrr%rr2r�r�r�r��strr�r�r rr�rr!r-rwr,�list�dictr\rC)r�Za_namer�r,rJr�r�rrr�
_get_field�sF



���



���
	 r�cCs||jkrdSt|||�dS)NTF)r��setattr)r�rrorrr�_set_new_attribute�s
r�cCsdSrr�r�rr`rrr�_hash_set_none�sr�cCsdd�|D�}t||�S)NcSs(g|] }|jdkr|jrn|jr|�qSr)r.r0rHrrrrMs

z_hash_add.<locals>.<listcomp>)r�)r�rr`�fldsrrr�	_hash_addsr�cCstd|j����dS)Nz-Cannot overwrite attribute __hash__ in class )rwrr�rrr�_hash_exceptionsr�))FFFF)FFFT)FFTF)FFTT)FTFF)FTFT)FTTF)FTTT)TFFF)TFFT)TFTF)TFTT)TTFF)TTFT)TTTF)TTTTcs�i}�jtjkr tj�jj}ni}t�tt||||||��d}	d}
�jddd�D]D}t|t	d�}|dk	rVd}
|�
�D]}
|
||
j<qzt|t�jrVd}	qV�j�
di�}�fdd�|��D�}|D]L}
|
||
j<tt�|
jd�t�r�|
jtk�rt�|
j�q�t�|
j|
j�qĈj��D].\}}t|t��r||k�rt|�d����q|
�rz|	�rf|�sftd	��|	�sz|�rztd
��t�t	|��j�
dt�}|tk�p�|dk�o�d�jk}|�r�|�s�td
��|�rt�t�}dd�|�
�D�}t�dt|||d|k�rdnd|��dd�|�
�D�}|�rHdd�|D�}t�dt||��|�r�dd�|D�}td|�}td|�}t�dtdd|||d��|�r�dd�|D�}td|�}td|�}dD]>\}}t�|t|||||d���r�td|�d�j�d����q�|�r8t�||�D].}t�|j|��rtd|j�d�j�����qtt |�t |�t |�|f}|�rh|�||��_!t�d��s��jt"t#�$����%dd ��_&�S)!NF���rT�__annotations__csg|]\}}t�||��qSr)r�)rIrr%�r�rrrM]s�z"_process_class.<locals>.<listcomp>z& is a field but has no type annotationz5cannot inherit non-frozen dataclass from a frozen onez5cannot inherit frozen dataclass from a non-frozen oner��__eq__z eq must be true if order is truecSsg|]}|jttfkr|�qSr)r2rr!rHrrrrM�s�rrZ__dataclass_self__cSsg|]}|jtkr|�qSr�r2rrHrrrrM�s
cSsg|]}|jr|�qSr)r(rHrrrrM�srcSsg|]}|jr|�qSr�r0rHrrrrM�sr�z==r~cSsg|]}|jr|�qSrr�rHrrrrM�s))�__lt__�<)�__le__z<=)�__gt__�>)�__ge__z>=zCannot overwrite attribute z
 in class z). Consider using functools.total_ordering�__doc__z -> Nonerc)'rr�r�r�r��_PARAMSr<�__mro__r9�_FIELDS�valuesrrAr��itemsr'rr,r�delattrrwrC�hasattrrzr�r}r�rPr�rr��_hash_action�boolr�r��inspectZ	signaturerr�)r�r/r(r>r?r@rArr`Zany_frozen_baseZhas_dataclass_basesreZbase_fieldsrJZcls_annotationsZ
cls_fieldsrroZ
class_hashZhas_explicit_hashr{r�Z
field_listr�r�r�rZhash_actionrr�r�_process_class's��
�

�
��

��


����r�Fr=cs*������fdd�}|dkr"|S||�S)a�Returns the same class as was passed in, with dunder methods
    added based on the fields defined in the class.

    Examines PEP 526 __annotations__ to determine fields.

    If init is true, an __init__() method is added to the class. If
    repr is true, a __repr__() method is added. If order is true, rich
    comparison dunder methods are added. If unsafe_hash is true, a
    __hash__() method function is added. If frozen is true, fields may
    not be assigned to after instance creation.
    cst|�������Sr)r�r��r>rAr/r?r(r@rr�wrap�szdataclass.<locals>.wrapNr)r�r/r(r>r?r@rAr�rr�rr�scCsBzt|t�}Wntk
r*td��YnXtdd�|��D��S)z�Return a tuple describing the fields of this dataclass.

    Accepts a dataclass or an instance of one. Tuple elements are of
    type Field.
    z0must be called with a dataclass type or instancecss|]}|jtkr|VqdSrr�rHrrrrf
s
zfields.<locals>.<genexpr>)r9r��AttributeErrorrw�tupler�)Zclass_or_instancerrrrr�s
cCstt|�t�S)z2Returns True if obj is an instance of a dataclass.)r�r%r�)�objrrr�_is_dataclass_instancesr�cCs t|t�r|nt|�}t|t�S)zEReturns True if obj is a dataclass or an instance of a
    dataclass.)r'r%r�r�)r�r�rrrr
s��dict_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new dictionary mapping
    field names to field values.

    Example usage:

      @dataclass
      class C:
          x: int
          y: int

      c = C(1, 2)
      assert asdict(c) == {'x': 1, 'y': 2}

    If given, 'dict_factory' will be used instead of built-in dict.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z0asdict() should be called on dataclass instances)r�rw�
_asdict_inner)r�r�rrrr	scs�t|�rDg}t|�D]&}tt||j���}|�|j|f�q�|�St|t�rrt|d�rrt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)N�_fieldscsg|]}t|���qSr�r��rI�vr�rrrMOsz!_asdict_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrfTsz _asdict_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr��rI�kr�r�rrrfVs��)r�rr�r9rryr'r�r�r%r�r�r��copy�deepcopy)r�r�rWrJrorr�rr�4s
�r���
tuple_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new tuple of field values.

    Example usage::

      @dataclass
      class C:
          x: int
          y: int

    c = C(1, 2)
    assert astuple(c) == (1, 2)

    If given, 'tuple_factory' will be used instead of built-in tuple.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z1astuple() should be called on dataclass instances)r�rw�_astuple_inner)r�r�rrrr
]scs�t|�r>g}t|�D] }tt||j���}|�|�q�|�St|t�rlt|d�rlt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)Nr�csg|]}t|���qSr�r�r�r�rrrM�sz"_astuple_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrf�sz!_astuple_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr�r�r�rrrf�s�)r�rr�r9rryr'r�r�r%r�r�r�r�r�)r�r�rWrJrorr�rr�us
�r�r)�bases�	namespacer/r(r>r?r@rAc	s�dkri�n����t�}
i}|D]�}t|t�r<|}
d}nDt|�dkrR|\}
}n.t|�dkrr|\}
}}|�|
<ntd|����t|
t�r�|
��s�td|
����t�|
�r�td|
����|
|
kr�td|
����|
�	|
�|||
<q$|�d	<t
�||i�fd
d��}t|||||||	d�S)
a�Return a new dynamically created dataclass.

    The dataclass name will be 'cls_name'.  'fields' is an iterable
    of either (name), (name, type) or (name, type, Field) objects. If type is
    omitted, use the string 'typing.Any'.  Field objects are created by
    the equivalent of calling 'field(name, type [, Field-info])'.

      C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))

    is equivalent to:

      @dataclass
      class C(Base):
          x: 'typing.Any'
          y: int
          z: int = field(init=False)

    For the bases and namespace parameters, see the builtin type() function.

    The parameters init, repr, eq, order, unsafe_hash, and frozen are passed to
    dataclass().
    Nz
typing.Anyr��zInvalid field: z'Field names must be valid identifiers: z"Field names must not be keywords: zField name duplicated: r�cs
|���Sr)rx)rl�r�rr�<lambda>��z make_dataclass.<locals>.<lambda>r=)
r�r\r'r��lenrw�isidentifier�keyword�	iskeywordrTr4�	new_classr)Zcls_namerr�r�r/r(r>r?r@rA�seenZanns�itemr�tp�specr�rr�rr�s:






�cOst|�dkr tdt|��d���|r,|\}n4d|krX|�d�}ddl}|jdtdd	�ntd
��t|�sptd��t|t��	�D]v}|j
tkr�q~|js�|j
|kr~td|j
�d
���q~|j
|kr~|j
tkr�|jtkr�td|j
�d���t||j
�||j
<q~|jf|�S)a,Return a new object replacing specified fields with new values.

    This is especially useful for frozen classes.  Example usage:

      @dataclass(frozen=True)
      class C:
          x: int
          y: int

      c = C(1, 2)
      c1 = replace(c, x=3)
      assert c1.x == 3 and c1.y == 2
      r�z*replace() takes 1 positional argument but z were givenr�rNz/Passing 'obj' as keyword argument is deprecatedr�)�
stacklevelz7replace() missing 1 required positional argument: 'obj'z1replace() should be called on dataclass instancesr�zC is declared with init=False, it cannot be specified with replace()zInitVar z! must be specified with replace())r�rw�pop�warnings�warn�DeprecationWarningr�r9r�r�r2r r/rrCr!r,r�	__class__)rkZchangesr�r�rJrrrr�s4
�


z(obj, /, **kwargs))N)C�rer�r�r4r�r�rhr]rR�__all__r�rrrurrr5r3rrr r!r�r�rz�compiler�r%r"rrr<rrPr_rmrqrrrsr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r
r�r	r�r�r
r�rr�__text_signature__rrrr�<module>s��

:��62;R�>
�)�B<_py_abc.cpython-38.opt-2.pyc000064400000006535151450073350011544 0ustar00U

e5d-�@s(ddlmZdd�ZGdd�de�ZdS)�)�WeakSetcCstjS�N)�ABCMeta�_abc_invalidation_counter�rr�/usr/lib64/python3.8/_py_abc.py�get_cache_tokensrcsReZdZdZ�fdd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)rrc	s�t�j||||f|�}dd�|��D�}|D]:}t|dt��D]&}t||d�}t|dd�r>|�|�q>q,t|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)�__isabstractmethod__F)�getattr)�.0�name�valuerrr�	<setcomp>&s�z"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__r	F)�super�__new__�itemsr
�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacherr�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�clsZ	abstracts�baser
��	__class__rrr#s�
zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|j�|�tjd7_|S)NzCan only register classesz'Refusing to create an inheritance cycle�)	�
isinstance�type�	TypeError�
issubclass�RuntimeErrorrrrr)r�subclassrrr�register6s


zABCMeta.registerNcCs|td|j�d|j��|d�tdt���|d�|jD]@}|�d�r6t||�}t|t�r`t	|�}t|�d|��|d�q6dS)NzClass: �.)�filezInv. counter: Z_abc_z: )
�print�
__module__�__qualname__r�__dict__�
startswithr
r#rr)rr+rr
rrr�_dump_registryHs



zABCMeta._dump_registrycCs|j��dSr)r�clear�rrrr�_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j��|j��dSr)rr2rr3rrr�_abc_caches_clearWs
zABCMeta._abc_caches_clearcsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS��|�St�fdd�||fD��S)NTFc3s|]}��|�VqdSr)�__subclasscheck__)r�cr3rr�	<genexpr>jsz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r!rr$rrrrr6�any)r�instancer(Zsubtyperr3r�__instancecheck__\s
��
zABCMeta.__instancecheck__cCst|t�std��||jkr dS|jtjkr>t�|_tj|_n||jkrLdS|�	|�}|t
k	r�|rp|j�|�n|j�|�|S|t|dd�kr�|j�|�dS|j
D] }t||�r�|j�|�dSq�|��D] }t||�r�|j�|�dSq�|j�|�dS)Nz"issubclass() arg 1 must be a classTF�__mro__r)r#r$r%rrrrrr�__subclasshook__�NotImplementedrr
rr&�__subclasses__)rr(�okZrclsZsclsrrrr6ls8







zABCMeta.__subclasscheck__)N)�__name__r-r.rrr)r1r4r5r;r6�
__classcell__rrr rrs
rN)Z_weakrefsetrrr$rrrrr�<module>s
textwrap.cpython-38.pyc000064400000032321151450073350011056 0ustar00U

e5d�K�@s�dZddlZddddddgZd	ZGd
d�d�Zddd�Zdd
d�Zdd�Ze�dej	�Z
e�dej	�Zdd�Zddd�Z
edkr�eed��dS)zText wrapping and filling.
�N�TextWrapper�wrap�fill�dedent�indent�shortenz	

 c
@s�eZdZdZiZed�ZeD]Zeeee�<qdZ	dZ
de�e�Z
de
dd�Ze�d	e	e
e
ed
�ej�Z[	[
[e�de
�Z[
e�d�Zd&ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra	
    Object for wrapping/filling text.  The public interface consists of
    the wrap() and fill() methods; the other methods are just there for
    subclasses to override in order to tweak the default behaviour.
    If you want to completely replace the main wrapping algorithm,
    you'll probably have to override _wrap_chunks().

    Several instance attributes control various aspects of wrapping:
      width (default: 70)
        the maximum width of wrapped lines (unless break_long_words
        is false)
      initial_indent (default: "")
        string that will be prepended to the first line of wrapped
        output.  Counts towards the line's width.
      subsequent_indent (default: "")
        string that will be prepended to all lines save the first
        of wrapped output; also counts towards each line's width.
      expand_tabs (default: true)
        Expand tabs in input text to spaces before further processing.
        Each tab will become 0 .. 'tabsize' spaces, depending on its position
        in its line.  If false, each tab is treated as a single character.
      tabsize (default: 8)
        Expand tabs in input text to 0 .. 'tabsize' spaces, unless
        'expand_tabs' is false.
      replace_whitespace (default: true)
        Replace all whitespace characters in the input text by spaces
        after tab expansion.  Note that if expand_tabs is false and
        replace_whitespace is true, every tab will be converted to a
        single space!
      fix_sentence_endings (default: false)
        Ensure that sentence-ending punctuation is always followed
        by two spaces.  Off by default because the algorithm is
        (unavoidably) imperfect.
      break_long_words (default: true)
        Break words longer than 'width'.  If false, those words will not
        be broken, and some lines might be longer than 'width'.
      break_on_hyphens (default: true)
        Allow breaking hyphenated words. If true, wrapping will occur
        preferably on whitespaces and right after hyphens part of
        compound words.
      drop_whitespace (default: true)
        Drop leading and trailing whitespace from lines.
      max_lines (default: None)
        Truncate wrapped lines.
      placeholder (default: ' [...]')
        Append to the last line of truncated text.
    � z[\w!"\'&.,?]z[^\d\W]z[%s]z[^�Na�
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        ))Zwp�ltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\Z�F�TF�z [...])�	max_lines�placeholderc
CsL||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS�N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizerr)
�selfrrrrrrrrrrrr�r� /usr/lib64/python3.8/textwrap.py�__init__sszTextWrapper.__init__cCs(|jr|�|j�}|jr$|�|j�}|S)z�_munge_whitespace(text : string) -> string

        Munge whitespace in text: expand tabs and convert all other
        whitespace characters to spaces.  Eg. " foo\tbar\n\nbaz"
        becomes " foo    bar  baz".
        )r�
expandtabsrr�	translate�unicode_whitespace_trans�r�textrrr�_munge_whitespace�s
zTextWrapper._munge_whitespacecCs6|jdkr|j�|�}n|j�|�}dd�|D�}|S)aN_split(text : string) -> [string]

        Split the text to wrap into indivisible chunks.  Chunks are
        not quite the same as words; see _wrap_chunks() for full
        details.  As an example, the text
          Look, goof-ball -- use the -b option!
        breaks into the following chunks:
          'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', 'option!'
        if break_on_hyphens is True, or in:
          'Look,', ' ', 'goof-ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', option!'
        otherwise.
        TcSsg|]}|r|�qSrr)�.0�crrr�
<listcomp>�sz&TextWrapper._split.<locals>.<listcomp>)r�
wordsep_re�split�wordsep_simple_re�rr#�chunksrrr�_split�s

zTextWrapper._splitcCs\d}|jj}|t|�dkrX||ddkrN|||�rNd||d<|d7}q|d7}qdS)ag_fix_sentence_endings(chunks : [string])

        Correct for sentence endings buried in 'chunks'.  Eg. when the
        original text contains "... foo.\nBar ...", munge_whitespace()
        and split() will convert that to [..., "foo.", " ", "Bar", ...]
        which has one too few spaces; this method simply changes the one
        space to two.
        rr	rz  �N)�sentence_end_re�search�len)rr,�iZ	patsearchrrr�_fix_sentence_endings�s	
z!TextWrapper._fix_sentence_endingscCs^|dkrd}n||}|jrH|�|dd|��|d|d�|d<n|sZ|�|���dS)a
_handle_long_word(chunks : [string],
                             cur_line : [string],
                             cur_len : int, width : int)

        Handle a chunk of text (most likely a word, not whitespace) that
        is too long to fit in any line.
        r	���N)r�append�pop)rZreversed_chunks�cur_line�cur_lenrZ
space_leftrrr�_handle_long_word�s
zTextWrapper._handle_long_wordc	Cs�g}|jdkrtd|j��|jdk	rb|jdkr8|j}n|j}t|�t|j���|jkrbtd��|��|�r�g}d}|r�|j}n|j}|jt|�}|j	r�|d�
�dkr�|r�|d=|r�t|d�}|||kr�|�|���||7}q�q�q�|�r&t|d�|k�r&|�
||||�ttt|��}|j	�r\|�r\|d�
�dk�r\|t|d�8}|d=|rj|jdk�s�t|�d|jk�s�|�r�|j	�r�t|�dk�r�|d�
��s�||k�r�|�|d�|��qj|�r0|d�
��r|t|j�|k�r|�|j�|�|d�|���q�|t|d�8}|d=�q�|�rn|d��}t|�t|j�|jk�rn||j|d<�q�|�||j����q�qj|S)a�_wrap_chunks(chunks : [string]) -> [string]

        Wrap a sequence of text chunks and return a list of lines of
        length 'self.width' or less.  (If 'break_long_words' is false,
        some lines may be longer than this.)  Chunks correspond roughly
        to words and the whitespace between them: each chunk is
        indivisible (modulo 'break_long_words'), but a line break can
        come between any two chunks.  Chunks should not have internal
        whitespace; ie. a chunk is either all whitespace or a "word".
        Whitespace chunks will be removed from the beginning and end of
        lines, but apart from that whitespace is preserved.
        rzinvalid width %r (must be > 0)Nr	z#placeholder too large for max widthr4r)r�
ValueErrorrrrr1r�lstrip�reverser�stripr5r6r9�sum�map�join�rstrip)	rr,�linesrr7r8r�lZ	prev_linerrr�_wrap_chunks�s�




 ���
�
���
�zTextWrapper._wrap_chunkscCs|�|�}|�|�Sr)r$r-r"rrr�
_split_chunksPs
zTextWrapper._split_chunkscCs$|�|�}|jr|�|�|�|�S)a^wrap(text : string) -> [string]

        Reformat the single paragraph in 'text' so it fits in lines of
        no more than 'self.width' columns, and return a list of wrapped
        lines.  Tabs in 'text' are expanded with string.expandtabs(),
        and all other whitespace characters (including newline) are
        converted to space.
        )rErr3rDr+rrrrVs	

zTextWrapper.wrapcCsd�|�|��S)z�fill(text : string) -> string

        Reformat the single paragraph in 'text' to fit in lines of no
        more than 'self.width' columns, and return a new string
        containing the entire wrapped paragraph.
        �
)r@rr"rrrrdszTextWrapper.fill)
rrrTTFTTTr
)�__name__�
__module__�__qualname__�__doc__r!�ordZuspace�_whitespace�xZ
word_punctZletter�re�escapeZ
whitespaceZnowhitespace�compile�VERBOSEr(r*r/rr$r-r3r9rDrErrrrrrrsV0���
��!grcKstfd|i|��}|�|�S)a�Wrap a single paragraph of text, returning a list of wrapped lines.

    Reformat the single paragraph in 'text' so it fits in lines of no
    more than 'width' columns, and return a list of wrapped lines.  By
    default, tabs in 'text' are expanded with string.expandtabs(), and
    all other whitespace characters (including newline) are converted to
    space.  See TextWrapper class for available keyword args to customize
    wrapping behaviour.
    r)rr�r#r�kwargs�wrrrrps
cKstfd|i|��}|�|�S)a�Fill a single paragraph of text, returning a new string.

    Reformat the single paragraph in 'text' to fit in lines of no more
    than 'width' columns, and return a new string containing the entire
    wrapped paragraph.  As with wrap(), tabs are expanded and other
    whitespace characters converted to space.  See TextWrapper class for
    available keyword args to customize wrapping behaviour.
    r)rrrRrrrr}s	cKs,tf|dd�|��}|�d�|������S)a�Collapse and truncate the given text to fit in the given width.

    The text first has its whitespace collapsed.  If it then fits in
    the *width*, it is returned as is.  Otherwise, as many words
    as possible are joined and then the placeholder is appended::

        >>> textwrap.shorten("Hello  world!", width=12)
        'Hello world!'
        >>> textwrap.shorten("Hello  world!", width=11)
        'Hello [...]'
    r	)rrr)rrr@r=r)rRrrrr�sz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCs�d}t�d|�}t�|�}|D]b}|dkr0|}q|�|�r<q|�|�rL|}qtt||��D]$\}\}}||krZ|d|�}qqZqdr�|r�|�d�D]"}|r�|�|�s�td||f��q�|r�t	�d|d|�}|S)a�Remove any common leading whitespace from every line in `text`.

    This can be used to make triple-quoted strings line up with the left
    edge of the display, while still presenting them in the source code
    in indented form.

    Note that tabs and spaces are both treated as whitespace, but they
    are not equal: the lines "  hello" and "\thello" are
    considered to have no common leading whitespace.

    Entirely blank lines are normalized to a newline character.
    NrrrFzline = %r, margin = %rz(?m)^)
�_whitespace_only_re�sub�_leading_whitespace_re�findall�
startswith�	enumerate�zipr)�AssertionErrorrN)r#Zmargin�indentsrr2rM�y�linerrrr�s,



�cs,�dkrdd�����fdd�}d�|��S)aFAdds 'prefix' to the beginning of selected lines in 'text'.

    If 'predicate' is provided, 'prefix' will only be added to the lines
    where 'predicate(line)' is True. If 'predicate' is not provided,
    it will default to adding 'prefix' to all non-empty lines that do not
    consist solely of whitespace characters.
    NcSs|��Sr)r=�r_rrr�	predicate�szindent.<locals>.predicatec3s*��d�D]}�|�r�|n|Vq
dS)NT)�
splitlinesr`�ra�prefixr#rr�prefixed_lines�szindent.<locals>.prefixed_linesr)r@)r#rdrarerrcrr�s�__main__z Hello there.
  This is indented.)r)r)N)rJrN�__all__rLrrrrrP�	MULTILINErUrWrrrG�printrrrr�<module>sa

3
signal.cpython-38.opt-2.pyc000064400000005075151450073350011423 0ustar00U

e5d��@s&ddlZddlTddlmZddlmZe�Ze�	de
dd��e�	de
d	d��d
ekrle�	de
dd��d
d�Zdd�Zeej
�dd��Z
eej�dd��Zd
ekr�eej�dd
��Zejje_dekr�eej�dd��Zdek�reej�dd��Zeje_dek�reej�dd��Z[[dS)�N)�*)�wraps)�IntEnum�SignalscCs(|��r|�d�r|�d�p&|�d�S)NZSIGZSIG_ZCTRL_)�isupper�
startswith��name�r
�/usr/lib64/python3.8/signal.py�<lambda>
s�r�HandlerscCs|dkS)N)�SIG_DFL�SIG_IGNr
rr
r
rr��pthread_sigmaskZSigmaskscCs|dkS)N)�	SIG_BLOCK�SIG_UNBLOCK�SIG_SETMASKr
rr
r
rrrcCs(z
||�WStk
r"|YSXdS�N)�
ValueError)�valueZ
enum_klassr
r
r�_int_to_enums
rc	Cs,z
t|�WSttfk
r&|YSXdSr)�intr�	TypeError)rr
r
r�_enum_to_int#s
rcCst�t|�t|��}t|t�Sr)�_signal�signalrrr
�Z	signalnumZhandlerr
r
rr-srcCst�|�}t|t�Sr)r�	getsignalrr
rr
r
rr3s
rcCst�||�}tdd�|D��S)Ncss|]}t|t�VqdSr�rr��.0�xr
r
r�	<genexpr>=sz"pthread_sigmask.<locals>.<genexpr>)rr�set)Zhow�maskZsigs_setr
r
rr:s�
sigpendingcCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
r�	<setcomp>Dszsigpending.<locals>.<setcomp>)rr'r
r
r
rr'Bs�sigwaitcCst�|�}t|t�Sr)rr)rr)ZsigsetZretsigr
r
rr)Hs
�
valid_signalscCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
rr(Rsz valid_signals.<locals>.<setcomp>)rr*r
r
r
rr*Ps)r�	functoolsrZ_wraps�enumrZ_IntEnum�globalsZ_globals�	_convert_�__name__rrrrr�__doc__r'r)r*r
r
r
r�<module>sR���










textwrap.cpython-38.opt-1.pyc000064400000032207151450073350012020 0ustar00U

e5d�K�@s�dZddlZddddddgZd	ZGd
d�d�Zddd�Zdd
d�Zdd�Ze�dej	�Z
e�dej	�Zdd�Zddd�Z
edkr�eed��dS)zText wrapping and filling.
�N�TextWrapper�wrap�fill�dedent�indent�shortenz	

 c
@s�eZdZdZiZed�ZeD]Zeeee�<qdZ	dZ
de�e�Z
de
dd�Ze�d	e	e
e
ed
�ej�Z[	[
[e�de
�Z[
e�d�Zd&ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra	
    Object for wrapping/filling text.  The public interface consists of
    the wrap() and fill() methods; the other methods are just there for
    subclasses to override in order to tweak the default behaviour.
    If you want to completely replace the main wrapping algorithm,
    you'll probably have to override _wrap_chunks().

    Several instance attributes control various aspects of wrapping:
      width (default: 70)
        the maximum width of wrapped lines (unless break_long_words
        is false)
      initial_indent (default: "")
        string that will be prepended to the first line of wrapped
        output.  Counts towards the line's width.
      subsequent_indent (default: "")
        string that will be prepended to all lines save the first
        of wrapped output; also counts towards each line's width.
      expand_tabs (default: true)
        Expand tabs in input text to spaces before further processing.
        Each tab will become 0 .. 'tabsize' spaces, depending on its position
        in its line.  If false, each tab is treated as a single character.
      tabsize (default: 8)
        Expand tabs in input text to 0 .. 'tabsize' spaces, unless
        'expand_tabs' is false.
      replace_whitespace (default: true)
        Replace all whitespace characters in the input text by spaces
        after tab expansion.  Note that if expand_tabs is false and
        replace_whitespace is true, every tab will be converted to a
        single space!
      fix_sentence_endings (default: false)
        Ensure that sentence-ending punctuation is always followed
        by two spaces.  Off by default because the algorithm is
        (unavoidably) imperfect.
      break_long_words (default: true)
        Break words longer than 'width'.  If false, those words will not
        be broken, and some lines might be longer than 'width'.
      break_on_hyphens (default: true)
        Allow breaking hyphenated words. If true, wrapping will occur
        preferably on whitespaces and right after hyphens part of
        compound words.
      drop_whitespace (default: true)
        Drop leading and trailing whitespace from lines.
      max_lines (default: None)
        Truncate wrapped lines.
      placeholder (default: ' [...]')
        Append to the last line of truncated text.
    � z[\w!"\'&.,?]z[^\d\W]z[%s]z[^�Na�
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        ))Zwp�ltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\Z�F�TF�z [...])�	max_lines�placeholderc
CsL||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS�N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizerr)
�selfrrrrrrrrrrrr�r� /usr/lib64/python3.8/textwrap.py�__init__sszTextWrapper.__init__cCs(|jr|�|j�}|jr$|�|j�}|S)z�_munge_whitespace(text : string) -> string

        Munge whitespace in text: expand tabs and convert all other
        whitespace characters to spaces.  Eg. " foo\tbar\n\nbaz"
        becomes " foo    bar  baz".
        )r�
expandtabsrr�	translate�unicode_whitespace_trans�r�textrrr�_munge_whitespace�s
zTextWrapper._munge_whitespacecCs6|jdkr|j�|�}n|j�|�}dd�|D�}|S)aN_split(text : string) -> [string]

        Split the text to wrap into indivisible chunks.  Chunks are
        not quite the same as words; see _wrap_chunks() for full
        details.  As an example, the text
          Look, goof-ball -- use the -b option!
        breaks into the following chunks:
          'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', 'option!'
        if break_on_hyphens is True, or in:
          'Look,', ' ', 'goof-ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', option!'
        otherwise.
        TcSsg|]}|r|�qSrr)�.0�crrr�
<listcomp>�sz&TextWrapper._split.<locals>.<listcomp>)r�
wordsep_re�split�wordsep_simple_re�rr#�chunksrrr�_split�s

zTextWrapper._splitcCs\d}|jj}|t|�dkrX||ddkrN|||�rNd||d<|d7}q|d7}qdS)ag_fix_sentence_endings(chunks : [string])

        Correct for sentence endings buried in 'chunks'.  Eg. when the
        original text contains "... foo.\nBar ...", munge_whitespace()
        and split() will convert that to [..., "foo.", " ", "Bar", ...]
        which has one too few spaces; this method simply changes the one
        space to two.
        rr	rz  �N)�sentence_end_re�search�len)rr,�iZ	patsearchrrr�_fix_sentence_endings�s	
z!TextWrapper._fix_sentence_endingscCs^|dkrd}n||}|jrH|�|dd|��|d|d�|d<n|sZ|�|���dS)a
_handle_long_word(chunks : [string],
                             cur_line : [string],
                             cur_len : int, width : int)

        Handle a chunk of text (most likely a word, not whitespace) that
        is too long to fit in any line.
        r	���N)r�append�pop)rZreversed_chunks�cur_line�cur_lenrZ
space_leftrrr�_handle_long_word�s
zTextWrapper._handle_long_wordc	Cs�g}|jdkrtd|j��|jdk	rb|jdkr8|j}n|j}t|�t|j���|jkrbtd��|��|�r�g}d}|r�|j}n|j}|jt|�}|j	r�|d�
�dkr�|r�|d=|r�t|d�}|||kr�|�|���||7}q�q�q�|�r&t|d�|k�r&|�
||||�ttt|��}|j	�r\|�r\|d�
�dk�r\|t|d�8}|d=|rj|jdk�s�t|�d|jk�s�|�r�|j	�r�t|�dk�r�|d�
��s�||k�r�|�|d�|��qj|�r0|d�
��r|t|j�|k�r|�|j�|�|d�|���q�|t|d�8}|d=�q�|�rn|d��}t|�t|j�|jk�rn||j|d<�q�|�||j����q�qj|S)a�_wrap_chunks(chunks : [string]) -> [string]

        Wrap a sequence of text chunks and return a list of lines of
        length 'self.width' or less.  (If 'break_long_words' is false,
        some lines may be longer than this.)  Chunks correspond roughly
        to words and the whitespace between them: each chunk is
        indivisible (modulo 'break_long_words'), but a line break can
        come between any two chunks.  Chunks should not have internal
        whitespace; ie. a chunk is either all whitespace or a "word".
        Whitespace chunks will be removed from the beginning and end of
        lines, but apart from that whitespace is preserved.
        rzinvalid width %r (must be > 0)Nr	z#placeholder too large for max widthr4r)r�
ValueErrorrrrr1r�lstrip�reverser�stripr5r6r9�sum�map�join�rstrip)	rr,�linesrr7r8r�lZ	prev_linerrr�_wrap_chunks�s�




 ���
�
���
�zTextWrapper._wrap_chunkscCs|�|�}|�|�Sr)r$r-r"rrr�
_split_chunksPs
zTextWrapper._split_chunkscCs$|�|�}|jr|�|�|�|�S)a^wrap(text : string) -> [string]

        Reformat the single paragraph in 'text' so it fits in lines of
        no more than 'self.width' columns, and return a list of wrapped
        lines.  Tabs in 'text' are expanded with string.expandtabs(),
        and all other whitespace characters (including newline) are
        converted to space.
        )rErr3rDr+rrrrVs	

zTextWrapper.wrapcCsd�|�|��S)z�fill(text : string) -> string

        Reformat the single paragraph in 'text' to fit in lines of no
        more than 'self.width' columns, and return a new string
        containing the entire wrapped paragraph.
        �
)r@rr"rrrrdszTextWrapper.fill)
rrrTTFTTTr
)�__name__�
__module__�__qualname__�__doc__r!�ordZuspace�_whitespace�xZ
word_punctZletter�re�escapeZ
whitespaceZnowhitespace�compile�VERBOSEr(r*r/rr$r-r3r9rDrErrrrrrrsV0���
��!grcKstfd|i|��}|�|�S)a�Wrap a single paragraph of text, returning a list of wrapped lines.

    Reformat the single paragraph in 'text' so it fits in lines of no
    more than 'width' columns, and return a list of wrapped lines.  By
    default, tabs in 'text' are expanded with string.expandtabs(), and
    all other whitespace characters (including newline) are converted to
    space.  See TextWrapper class for available keyword args to customize
    wrapping behaviour.
    r)rr�r#r�kwargs�wrrrrps
cKstfd|i|��}|�|�S)a�Fill a single paragraph of text, returning a new string.

    Reformat the single paragraph in 'text' to fit in lines of no more
    than 'width' columns, and return a new string containing the entire
    wrapped paragraph.  As with wrap(), tabs are expanded and other
    whitespace characters converted to space.  See TextWrapper class for
    available keyword args to customize wrapping behaviour.
    r)rrrRrrrr}s	cKs,tf|dd�|��}|�d�|������S)a�Collapse and truncate the given text to fit in the given width.

    The text first has its whitespace collapsed.  If it then fits in
    the *width*, it is returned as is.  Otherwise, as many words
    as possible are joined and then the placeholder is appended::

        >>> textwrap.shorten("Hello  world!", width=12)
        'Hello world!'
        >>> textwrap.shorten("Hello  world!", width=11)
        'Hello [...]'
    r	)rrr)rrr@r=r)rRrrrr�sz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCs�d}t�d|�}t�|�}|D]b}|dkr0|}q|�|�r<q|�|�rL|}qtt||��D]$\}\}}||krZ|d|�}qqZqdr�|r�|�d�D]}q�|r�t�d|d|�}|S)a�Remove any common leading whitespace from every line in `text`.

    This can be used to make triple-quoted strings line up with the left
    edge of the display, while still presenting them in the source code
    in indented form.

    Note that tabs and spaces are both treated as whitespace, but they
    are not equal: the lines "  hello" and "\thello" are
    considered to have no common leading whitespace.

    Entirely blank lines are normalized to a newline character.
    NrrrFz(?m)^)	�_whitespace_only_re�sub�_leading_whitespace_re�findall�
startswith�	enumerate�zipr)rN)r#Zmargin�indentsrr2rM�y�linerrrr�s(


cs,�dkrdd�����fdd�}d�|��S)aFAdds 'prefix' to the beginning of selected lines in 'text'.

    If 'predicate' is provided, 'prefix' will only be added to the lines
    where 'predicate(line)' is True. If 'predicate' is not provided,
    it will default to adding 'prefix' to all non-empty lines that do not
    consist solely of whitespace characters.
    NcSs|��Sr)r=�r^rrr�	predicate�szindent.<locals>.predicatec3s*��d�D]}�|�r�|n|Vq
dS)NT)�
splitlinesr_�r`�prefixr#rr�prefixed_lines�szindent.<locals>.prefixed_linesr)r@)r#rcr`rdrrbrr�s�__main__z Hello there.
  This is indented.)r)r)N)rJrN�__all__rLrrrrrP�	MULTILINErUrWrrrG�printrrrr�<module>sa

3
abc.cpython-38.opt-1.pyc000064400000012330151450073350010662 0ustar00U

e5d��@s�dZdd�ZGdd�de�ZGdd�de�ZGdd�de�Zz,d	d
lm	Z	m
Z
mZmZm
Z
mZmZmZWn*ek
r�d	dlmZm	Z	de_YnXGd
d�de�ZGdd�ded�ZdS)z3Abstract Base Classes (ABCs) according to PEP 3119.cCs
d|_|S)a<A decorator indicating abstract methods.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract methods are overridden.
    The abstract methods can be called using any of the normal
    'super' call mechanisms.  abstractmethod() may be used to declare
    abstract methods for properties and descriptors.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractmethod
            def my_abstract_method(self, ...):
                ...
    T)�__isabstractmethod__)�funcobj�r�/usr/lib64/python3.8/abc.py�abstractmethodsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractclassmethodztA decorator indicating abstract classmethods.

    Deprecated, use 'classmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dS�NT�r�super�__init__��self�callable��	__class__rrr
$szabstractclassmethod.__init__��__name__�
__module__�__qualname__�__doc__rr
�
__classcell__rrrrrsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractstaticmethodzvA decorator indicating abstract staticmethods.

    Deprecated, use 'staticmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dSrrrrrrr
1szabstractstaticmethod.__init__rrrrrr)src@seZdZdZdZdS)�abstractpropertyzoA decorator indicating abstract properties.

    Deprecated, use 'property' with 'abstractmethod' instead.
    TN)rrrrrrrrrr6sr�)�get_cache_token�	_abc_init�
_abc_register�_abc_instancecheck�_abc_subclasscheck�	_get_dump�_reset_registry�
_reset_caches)�ABCMetar�abccsReZdZdZ�fdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	dd�Z
�ZS)r!a�Metaclass for defining Abstract Base Classes (ABCs).

        Use this metaclass to create an ABC.  An ABC can be subclassed
        directly, and then acts as a mix-in class.  You can also register
        unrelated concrete classes (even built-in classes) and unrelated
        ABCs as 'virtual subclasses' -- these and their descendants will
        be considered subclasses of the registering ABC by the built-in
        issubclass() function, but the registering ABC won't show up in
        their MRO (Method Resolution Order) nor will method
        implementations defined by the registering ABC be callable (not
        even via super()).
        cs"t�j||||f|�}t|�|S)N)r	�__new__r)�mcls�name�bases�	namespace�kwargs�clsrrrr#TszABCMeta.__new__cCs
t||�S)z{Register a virtual subclass of an ABC.

            Returns the subclass, to allow usage as a class decorator.
            )r�r)�subclassrrr�registerYszABCMeta.registercCs
t||�S)z'Override for isinstance(instance, cls).)r)r)�instancerrr�__instancecheck__`szABCMeta.__instancecheck__cCs
t||�S)z'Override for issubclass(subclass, cls).)rr*rrr�__subclasscheck__dszABCMeta.__subclasscheck__NcCs�td|j�d|j��|d�tdt���|d�t|�\}}}}td|��|d�td|��|d�td|��|d�td|��|d�d	S)
z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: z_abc_registry: z_abc_cache: z_abc_negative_cache: z_abc_negative_cache_version: N)�printrrrr)r)r1�
_abc_registry�
_abc_cache�_abc_negative_cache�_abc_negative_cache_versionrrr�_dump_registryhs�
�zABCMeta._dump_registrycCst|�dS)z.Clear the registry (for debugging or testing).N)r�r)rrr�_abc_registry_cleartszABCMeta._abc_registry_clearcCst|�dS)z,Clear the caches (for debugging or testing).N)r r8rrr�_abc_caches_clearxszABCMeta._abc_caches_clear)N)rrrrr#r,r.r/r7r9r:rrrrrr!Gs
r!c@seZdZdZdZdS)�ABCzVHelper class that provides a standard way to create an ABC using
    inheritance.
    rN)rrrr�	__slots__rrrrr;}sr;)�	metaclassN)rr�classmethodr�staticmethodr�propertyr�_abcrrrrrrrr �ImportErrorZ_py_abcr!r�typer;rrrr�<module>s

	,6operator.cpython-38.opt-2.pyc000064400000026074151450073350012003 0ustar00U

e5d�)�6@s$dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5g6Zd6d7lmZd8d%�Zd9d"�Zd:d�Zd;d*�Zd<d
�Zd=d�Z	d>d,�Z
d?d4�Zd@d�ZdAd�Z
dBd�ZdCd�ZdDd�ZdEd	�ZdFd�ZdGd�ZeZdHd$�ZdId(�ZdJd)�ZdKd&�ZdLd+�ZdMd-�ZdNd.�ZdOd/�ZdPd0�ZdQd2�ZdRd3�ZdSd5�ZdTd�Z dUd�Z!dVd�Z"dWd�Z#dXd�Z$dYd�Z%dZd1�Z&dpd[d#�Z'Gd\d�d�Z(Gd]d�d�Z)Gd^d'�d'�Z*d_d
�Z+d`d�Z,dad�Z-dbd�Z.dcd�Z/ddd�Z0ded�Z1dfd�Z2dgd�Z3dhd�Z4did�Z5djd�Z6dkd �Z7dld!�Z8zd6dml9TWne:k
�r^YnXd6dnl9m;Z;eZ<eZ=eZ>eZ?eZ@e	ZAe
ZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTeZUe ZVe!ZWe#ZXe$ZYe&ZZe+Z[e,Z\e-Z]e.Z^e/Z_e0Z`e1Zae2Zbe3Zce4Zde5Zee6Zfe7Zge8ZhdoS)q�abs�add�and_�
attrgetter�concat�contains�countOf�delitem�eq�floordiv�ge�getitem�gt�iadd�iand�iconcat�	ifloordiv�ilshift�imatmul�imod�imul�index�indexOf�inv�invert�ior�ipow�irshift�is_�is_not�isub�
itemgetter�itruediv�ixor�le�length_hint�lshift�lt�matmul�methodcaller�mod�mul�ne�neg�not_�or_�pos�pow�rshift�setitem�sub�truediv�truth�xor�)rcCs||kS�N���a�br9r9� /usr/lib64/python3.8/operator.pyr&scCs||kSr8r9r:r9r9r=r#scCs||kSr8r9r:r9r9r=r	#scCs||kSr8r9r:r9r9r=r+'scCs||kSr8r9r:r9r9r=r+scCs||kSr8r9r:r9r9r=r
/scCs|Sr8r9�r;r9r9r=r-5scCs|rdSdS)NTFr9r>r9r9r=r59scCs||kSr8r9r:r9r9r=r=scCs||k	Sr8r9r:r9r9r=rAscCst|�Sr8)�_absr>r9r9r=rGscCs||Sr8r9r:r9r9r=rKscCs||@Sr8r9r:r9r9r=rOscCs||Sr8r9r:r9r9r=r
SscCs|��Sr8)�	__index__r>r9r9r=rWscCs|Sr8r9r>r9r9r=r[scCs||>Sr8r9r:r9r9r=r%`scCs||Sr8r9r:r9r9r=r)dscCs||Sr8r9r:r9r9r=r*hscCs||Sr8r9r:r9r9r=r'lscCs|Sr8r9r>r9r9r=r,pscCs||BSr8r9r:r9r9r=r.tscCs|
Sr8r9r>r9r9r=r/xscCs||Sr8r9r:r9r9r=r0|scCs||?Sr8r9r:r9r9r=r1�scCs||Sr8r9r:r9r9r=r3�scCs||Sr8r9r:r9r9r=r4�scCs||ASr8r9r:r9r9r=r6�scCs(t|d�s dt|�j}t|��||S�N�__getitem__z!'%s' object can't be concatenated��hasattr�type�__name__�	TypeError�r;r<�msgr9r9r=r�s
cCs||kSr8r9r:r9r9r=r�scCs"d}|D]}||kr|d7}q|S)Nr7�r9)r;r<�count�ir9r9r=r�s

cCs
||=dSr8r9r:r9r9r=r�scCs||Sr8r9r:r9r9r=r�scCs.t|�D]\}}||kr|Sqtd��dS)Nz$sequence.index(x): x not in sequence)�	enumerate�
ValueError)r;r<rL�jr9r9r=r�s
cCs|||<dSr8r9)r;r<�cr9r9r=r2�scCs�t|t�s dt|�j}t|��z
t|�WStk
r>YnXzt|�j}Wntk
rf|YSXz||�}Wntk
r�|YSX|tkr�|St|t�s�dt|�j}t|��|dkr�d}t	|��|S)Nz/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr7z$__length_hint__() should return >= 0)
�
isinstance�intrErFrG�len�__length_hint__�AttributeError�NotImplementedrN)�obj�defaultrIZhint�valr9r9r=r$�s8	
�



�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)�_attrs�_callcsn|s<t|t�std��|f|_|�d���fdd�}||_n.|f||_ttt|j����fdd�}||_dS)Nzattribute name must be a string�.cs�D]}t||�}q|Sr8)�getattr)rW�name)�namesr9r=�func�sz!attrgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}|��VqdSr8r9)�.0�getter�rWr9r=�	<genexpr>�sz4attrgetter.__init__.<locals>.func.<locals>.<genexpr>��tuplerc)�gettersrcr=r`�s)	rQ�strrGrZ�splitr[rf�mapr)�self�attr�attrsr`r9)rgr_r=�__init__�s

zattrgetter.__init__cCs
|�|�Sr8�r[�rkrWr9r9r=�__call__�szattrgetter.__call__cCs$d|jj|jjd�tt|j��fS�N�	%s.%s(%s)�, )�	__class__�
__module__�__qualname__�joinrj�reprrZ�rkr9r9r=�__repr__s�zattrgetter.__repr__cCs|j|jfSr8)rurZrzr9r9r=�
__reduce__szattrgetter.__reduce__N�rFrvrw�	__slots__rnrqr{r|r9r9r9r=r�s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r ��_itemsr[csF�s �f|_�fdd�}||_n"�f�|_��fdd�}||_dS)Ncs|�Sr8r9rc)�itemr9r=r`sz!itemgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}�|VqdSr8r9)rarLrcr9r=rdsz4itemgetter.__init__.<locals>.func.<locals>.<genexpr>rerc)�itemsrcr=r`sr)rkr�r�r`r9)r�r�r=rnszitemgetter.__init__cCs
|�|�Sr8rorpr9r9r=rqszitemgetter.__call__cCs$d|jj|jjd�tt|j��fSrr)rurvrFrxrjryr�rzr9r9r=r{ s�zitemgetter.__repr__cCs|j|jfSr8)rur�rzr9r9r=r|%szitemgetter.__reduce__Nr}r9r9r9r=r 	s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r()�_name�_args�_kwargscOs*||_t|jt�std��||_||_dS)Nzmethod name must be a string)r�rQrhrGr�r�)rkr^�args�kwargsr9r9r=rn1s
zmethodcaller.__init__cCst||j�|j|j�Sr8)r]r�r�r�rpr9r9r=rq8szmethodcaller.__call__cCsTt|j�g}|�tt|j��|�dd�|j��D��d|jj|jj	d�
|�fS)Ncss|]\}}d||fVqdS)z%s=%rNr9)ra�k�vr9r9r=rd>sz(methodcaller.__repr__.<locals>.<genexpr>rsrt)ryr��extendrjr�r�r�rurvrFrx)rkr�r9r9r=r{;s�zmethodcaller.__repr__cCsD|js|j|jf|jfSddlm}||j|jf|j�|jfSdS)Nr7)�partial)r�rur�r��	functoolsr�)rkr�r9r9r=r|Cszmethodcaller.__reduce__Nr}r9r9r9r=r((s
cCs||7}|Sr8r9r:r9r9r=rMscCs||M}|Sr8r9r:r9r9r=rRscCs,t|d�s dt|�j}t|��||7}|SrArCrHr9r9r=rWs

cCs||}|Sr8r9r:r9r9r=r_scCs||K}|Sr8r9r:r9r9r=rdscCs||;}|Sr8r9r:r9r9r=riscCs||9}|Sr8r9r:r9r9r=rnscCs||}|Sr8r9r:r9r9r=rsscCs||O}|Sr8r9r:r9r9r=rxscCs||C}|Sr8r9r:r9r9r=r}scCs||L}|Sr8r9r:r9r9r=r�scCs||8}|Sr8r9r:r9r9r=r�scCs||}|Sr8r9r:r9r9r=r!�scCs||N}|Sr8r9r:r9r9r=r"�s)�*)�__doc__N)r7)i�__all__�builtinsrr?r&r#r	r+rr
r-r5rrrrr
rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrrrr2r$rr r(rrrrrrrrrrrrr!r"�	_operator�ImportErrorr��__lt__�__le__�__eq__�__ne__�__ge__�__gt__�__not__�__abs__�__add__�__and__�__floordiv__r@�__inv__�
__invert__�
__lshift__�__mod__�__mul__�
__matmul__�__neg__�__or__�__pos__�__pow__�
__rshift__�__sub__�__truediv__�__xor__�
__concat__�__contains__�__delitem__rB�__setitem__�__iadd__�__iand__�__iconcat__�
__ifloordiv__�__ilshift__�__imod__�__imul__�__imatmul__�__ior__�__ipow__�__irshift__�__isub__�__itruediv__�__ixor__r9r9r9r=�<module>
s2�	
)'%_pyio.cpython-38.pyc000064400000220541151450073350010322 0ustar00U

e5d�k�@s|dZddlZddlZddlZddlZddlZddlZddlmZ	ej
dkrXddlmZ
ndZ
ddlZddlmZmZmZmZdddhZeed	�r�e�ej�e�ej�d
ZeZeed�p�ejjZd7dd�Zdd�Zz
ejZWne k
�r�eZYnXGdd�d�Z!Gdd�d�Z"z
ej#Z#Wn(e k
�rHGdd�de$e%�Z#YnXGdd�dej&d�Z'ej'�(e'�Gdd�de'�Z)ej)�(e)�ddl*m+Z+e)�(e+�Gdd �d e'�Z,ej,�(e,�Gd!d"�d"e,�Z-Gd#d$�d$e,�Z.Gd%d&�d&e-�Z/Gd'd(�d(e-�Z0Gd)d*�d*e,�Z1Gd+d,�d,e0e/�Z2Gd-d.�d.e)�Z+Gd/d0�d0e'�Z3ej3�(e3�Gd1d2�d2ej4�Z5Gd3d4�d4e3�Z6Gd5d6�d6e6�Z7dS)8z)
Python implementation of the io module.
�N)�
allocate_lock>�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END���	SEEK_HOLEi Zgettotalrefcount�r���Tc	Cs�t|t�st�|�}t|tttf�s0td|��t|t�sFtd|��t|t�s\td|��|dk	rzt|t�sztd|��|dk	r�t|t�s�td|��t|�}|td�s�t|�t|�kr�t	d|��d|k}	d	|k}
d
|k}d|k}d|k}
d
|k}d|k}d|k�rD|	�s"|�s"|�s"|
�r*t	d��ddl
}|�dtd�d}
|�rX|�rXt	d��|	|
||dk�rvt	d��|	�s�|
�s�|�s�|�s�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r|dk�rddl
}|�dt
d�t||	�rd�pd|
�r"d	�p$d|�r2d
�p4d|�rBd�pDd|
�rRd�pTd||d�}|}�z$d}|dk�s�|dk�r�|���r�d }d}|dk�r�t}zt�|���j}Wnttfk
�r�YnX|dk�r�|}|dk�r�t	d!��|dk�r|�r|WSt	d"��|
�r t||�}n<|	�s2|�s2|�r>t||�}n|
�rPt||�}nt	d#|��|}|�rl|WSt|||||�}|}||_|WS|���YnXdS)$a�Open file and return a stream.  Raise OSError upon failure.

    file is either a text or byte string giving the name (and the path
    if the file isn't in the current working directory) of the file to
    be opened or an integer file descriptor of the file to be
    wrapped. (If a file descriptor is given, it is closed when the
    returned I/O object is closed, unless closefd is set to False.)

    mode is an optional string that specifies the mode in which the file is
    opened. It defaults to 'r' which means open for reading in text mode. Other
    common values are 'w' for writing (truncating the file if it already
    exists), 'x' for exclusive creation of a new file, and 'a' for appending
    (which on some Unix systems, means that all writes append to the end of the
    file regardless of the current seek position). In text mode, if encoding is
    not specified the encoding used is platform dependent. (For reading and
    writing raw bytes use binary mode and leave encoding unspecified.) The
    available modes are:

    ========= ===============================================================
    Character Meaning
    --------- ---------------------------------------------------------------
    'r'       open for reading (default)
    'w'       open for writing, truncating the file first
    'x'       create a new file and open it for writing
    'a'       open for writing, appending to the end of the file if it exists
    'b'       binary mode
    't'       text mode (default)
    '+'       open a disk file for updating (reading and writing)
    'U'       universal newline mode (deprecated)
    ========= ===============================================================

    The default mode is 'rt' (open for reading text). For binary random
    access, the mode 'w+b' opens and truncates the file to 0 bytes, while
    'r+b' opens the file without truncation. The 'x' mode implies 'w' and
    raises an `FileExistsError` if the file already exists.

    Python distinguishes between files opened in binary and text modes,
    even when the underlying operating system doesn't. Files opened in
    binary mode (appending 'b' to the mode argument) return contents as
    bytes objects without any decoding. In text mode (the default, or when
    't' is appended to the mode argument), the contents of the file are
    returned as strings, the bytes having been first decoded using a
    platform-dependent encoding or using the specified encoding if given.

    'U' mode is deprecated and will raise an exception in future versions
    of Python.  It has no effect in Python 3.  Use newline to control
    universal newlines mode.

    buffering is an optional integer used to set the buffering policy.
    Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
    line buffering (only usable in text mode), and an integer > 1 to indicate
    the size of a fixed-size chunk buffer.  When no buffering argument is
    given, the default buffering policy works as follows:

    * Binary files are buffered in fixed-size chunks; the size of the buffer
      is chosen using a heuristic trying to determine the underlying device's
      "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
      On many systems, the buffer will typically be 4096 or 8192 bytes long.

    * "Interactive" text files (files for which isatty() returns True)
      use line buffering.  Other text files use the policy described above
      for binary files.

    encoding is the str name of the encoding used to decode or encode the
    file. This should only be used in text mode. The default encoding is
    platform dependent, but any encoding supported by Python can be
    passed.  See the codecs module for the list of supported encodings.

    errors is an optional string that specifies how encoding errors are to
    be handled---this argument should not be used in binary mode. Pass
    'strict' to raise a ValueError exception if there is an encoding error
    (the default of None has the same effect), or pass 'ignore' to ignore
    errors. (Note that ignoring encoding errors can lead to data loss.)
    See the documentation for codecs.register for a list of the permitted
    encoding error strings.

    newline is a string controlling how universal newlines works (it only
    applies to text mode). It can be None, '', '\n', '\r', and '\r\n'.  It works
    as follows:

    * On input, if newline is None, universal newlines mode is
      enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
      these are translated into '\n' before being returned to the
      caller. If it is '', universal newline mode is enabled, but line
      endings are returned to the caller untranslated. If it has any of
      the other legal values, input lines are only terminated by the given
      string, and the line ending is returned to the caller untranslated.

    * On output, if newline is None, any '\n' characters written are
      translated to the system default line separator, os.linesep. If
      newline is '', no translation takes place. If newline is any of the
      other legal values, any '\n' characters written are translated to
      the given string.

    closedfd is a bool. If closefd is False, the underlying file descriptor will
    be kept open when the file is closed. This does not work when a file name is
    given and must be True in that case.

    The newly created file is non-inheritable.

    A custom opener can be used by passing a callable as *opener*. The
    underlying file descriptor for the file object is then obtained by calling
    *opener* with (*file*, *flags*). *opener* must return an open file
    descriptor (passing os.open as *opener* results in functionality similar to
    passing None).

    open() returns a file object whose type depends on the mode, and
    through which the standard file operations such as reading and writing
    are performed. When open() is used to open a file in a text mode ('w',
    'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
    a file in a binary mode, the returned class varies: in read binary
    mode, it returns a BufferedReader; in write binary and append binary
    modes, it returns a BufferedWriter, and in read/write mode, it returns
    a BufferedRandom.

    It is also possible to use a string or bytearray as a file for both
    reading and writing. For strings StringIO can be used like a file
    opened in a text mode, and for bytes a BytesIO can be used like a file
    opened in a binary mode.
    zinvalid file: %rzinvalid mode: %rzinvalid buffering: %rN�invalid encoding: %r�invalid errors: %rzaxrwb+tU�xr
�w�a�+�t�b�Uz4mode U cannot be combined with 'x', 'w', 'a', or '+'rz'U' mode is deprecatedrTz'can't have text and binary mode at oncer
z)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argumentzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used�)�openerFrzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)�
isinstance�int�os�fspath�str�bytes�	TypeError�set�len�
ValueError�warnings�warn�DeprecationWarning�RuntimeWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno�
st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader�
TextIOWrapper�mode�close)�filer4�	buffering�encoding�errors�newline�closefdrZmodesZcreatingZreadingZwritingZ	appendingZupdating�textZbinaryr$�raw�result�line_bufferingZbs�buffer�rA�/usr/lib64/python3.8/_pyio.py�open)s�{




�������



rCcCs ddl}|�dtd�t|d�S)azOpens the provided file with mode ``'rb'``. This function
    should be used when the intent is to treat the contents as
    executable code.

    ``path`` should be an absolute path.

    When supported by the runtime, this function can be hooked
    in order to allow embedders more control over code files.
    This functionality is not supported on the current runtime.
    rNz(_pyio.open_code() may not be using hooksr�rb)r$r%r'rC)�pathr$rArArB�_open_code_with_warnings�rFc@seZdZdZddd�ZdS)�
DocDescriptorz%Helper for builtins.open.__doc__
    NcCs
dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)

)rC�__doc__)�self�obj�typrArArB�__get__s��zDocDescriptor.__get__)N)�__name__�
__module__�__qualname__rHrLrArArArBrGsrGc@seZdZdZe�Zdd�ZdS)�OpenWrapperz�Wrapper for builtins.open

    Trick so that open won't become a bound method when stored
    as a class variable (as dbm.dumb does).

    See initstdio() in Python/pylifecycle.c.
    cOs
t||�S�N)rC)�cls�args�kwargsrArArB�__new__,szOpenWrapper.__new__N)rMrNrOrHrGrUrArArArBrP"srPc@seZdZdS)�UnsupportedOperationN)rMrNrOrArArArBrV5srVc@s�eZdZdZdd�Zd6dd�Zdd�Zd7d
d�Zdd
�ZdZ	dd�Z
dd�Zdd�Zd8dd�Z
dd�Zd9dd�Zdd�Zd:dd�Zedd ��Zd;d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd<d,d-�Zd.d/�Zd0d1�Zd=d2d3�Zd4d5�Zd	S)>�IOBaseaThe abstract base class for all I/O classes, acting on streams of
    bytes. There is no public constructor.

    This class provides dummy implementations for many methods that
    derived classes can override selectively; the default implementations
    represent a file that cannot be read, written or seeked.

    Even though IOBase does not declare read or write because
    their signatures will vary, implementations and clients should
    consider those methods part of the interface. Also, implementations
    may raise UnsupportedOperation when operations they do not support are
    called.

    The basic type used for binary data read from or written to a file is
    bytes. Other bytes-like objects are accepted as method arguments too.
    Text I/O classes work with str data.

    Note that calling any method (even inquiries) on a closed stream is
    undefined. Implementations may raise OSError in this case.

    IOBase (and its subclasses) support the iterator protocol, meaning
    that an IOBase object can be iterated over yielding the lines in a
    stream.

    IOBase also supports the :keyword:`with` statement. In this example,
    fp is closed after the suite of the with statement is complete:

    with open('spam.txt', 'r') as fp:
        fp.write('Spam and eggs!')
    cCstd|jj|f��dS)z@Internal: raise an OSError exception for unsupported operations.z%s.%s() not supportedN)rV�	__class__rM)rI�namerArArB�_unsupported\s
�zIOBase._unsupportedrcCs|�d�dS)a$Change stream position.

        Change the stream position to byte offset pos. Argument pos is
        interpreted relative to the position indicated by whence.  Values
        for whence are ints:

        * 0 -- start of stream (the default); offset should be zero or positive
        * 1 -- current stream position; offset may be negative
        * 2 -- end of stream; offset is usually negative
        Some operating systems / file systems could provide additional values.

        Return an int indicating the new absolute position.
        �seekN�rZ�rI�pos�whencerArArBr[cszIOBase.seekcCs|�dd�S)z5Return an int indicating the current stream position.rr
)r[�rIrArArB�tellsszIOBase.tellNcCs|�d�dS)z�Truncate file to size bytes.

        Size defaults to the current IO position as reported by tell().  Return
        the new size.
        �truncateNr\�rIr^rArArBrbwszIOBase.truncatecCs|��dS)zuFlush write buffers, if applicable.

        This is not implemented for read-only and non-blocking streams.
        N��_checkClosedr`rArArB�flush�szIOBase.flushFcCs |jsz|��W5d|_XdS)ziFlush and close the IO object.

        This method has no effect if the file is already closed.
        TN)�_IOBase__closedrfr`rArArBr5�szIOBase.closecCsVz
|j}Wntk
r YdSX|r*dStr8|��nz|��WnYnXdS)zDestructor.  Calls close().N)�closedr/�_IOBASE_EMITS_UNRAISABLEr5)rIrhrArArB�__del__�s

zIOBase.__del__cCsdS)z�Return a bool indicating whether object supports random access.

        If False, seek(), tell() and truncate() will raise OSError.
        This method may need to do a test seek().
        FrAr`rArArB�seekable�szIOBase.seekablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not seekable
        NzFile or stream is not seekable.)rkrV�rI�msgrArArB�_checkSeekable�s��zIOBase._checkSeekablecCsdS)zvReturn a bool indicating whether object was opened for reading.

        If False, read() will raise OSError.
        FrAr`rArArB�readable�szIOBase.readablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not readable
        NzFile or stream is not readable.)rorVrlrArArB�_checkReadable�s��zIOBase._checkReadablecCsdS)z�Return a bool indicating whether object was opened for writing.

        If False, write() and truncate() will raise OSError.
        FrAr`rArArB�writable�szIOBase.writablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not writable
        NzFile or stream is not writable.)rqrVrlrArArB�_checkWritable�s��zIOBase._checkWritablecCs|jS)z�closed: bool.  True iff the file has been closed.

        For backwards compatibility, this is a property, not a predicate.
        )rgr`rArArBrh�sz
IOBase.closedcCs|jrt|dkrdn|��dS)z7Internal: raise a ValueError if file is closed
        N�I/O operation on closed file.�rhr#rlrArArBre�s��zIOBase._checkClosedcCs|��|S)zCContext management protocol.  Returns self (an instance of IOBase).rdr`rArArB�	__enter__�szIOBase.__enter__cGs|��dS)z+Context management protocol.  Calls close()N)r5)rIrSrArArB�__exit__�szIOBase.__exit__cCs|�d�dS)z�Returns underlying file descriptor (an int) if one exists.

        An OSError is raised if the IO object does not use a file descriptor.
        r,Nr\r`rArArBr,�sz
IOBase.filenocCs|��dS)z{Return a bool indicating whether this is an 'interactive' stream.

        Return False if it can't be determined.
        Frdr`rArArBr)sz
IOBase.isattyrcs�t�d�r��fdd�}ndd�}�dkr0d�n4z
�j}Wn"tk
r\t��d���YnX|��t�}�dks~t|��kr���|��}|s�q�||7}|�d	�rjq�qjt|�S)
aNRead and return a line of bytes from the stream.

        If size is specified, at most size bytes will be read.
        Size should be an int.

        The line terminator is always b'\n' for binary files; for text
        files, the newlines argument to open can be used to select the line
        terminator(s) recognized.
        �peekcs>��d�}|sdS|�d�dp&t|�}�dkr:t|��}|S)Nr
�
r)rw�findr"�min)Z	readahead�n�rI�sizerArB�
nreadaheads

z#IOBase.readline.<locals>.nreadaheadcSsdS�Nr
rArArArArBr~ sNr� is not an integerrrx)	�hasattr�	__index__r/r �	bytearrayr"�read�endswithr)rIr}r~�
size_index�resrrAr|rB�readlines&
	

zIOBase.readlinecCs|��|SrQrdr`rArArB�__iter__5szIOBase.__iter__cCs|��}|st�|SrQ)r��
StopIteration�rI�linerArArB�__next__9szIOBase.__next__cCsP|dks|dkrt|�Sd}g}|D]&}|�|�|t|�7}||kr$qLq$|S)z�Return a list of lines from the stream.

        hint can be specified to control the number of lines read: no more
        lines will be read if the total size (in bytes/characters) of all
        lines so far exceeds hint.
        Nr)�list�appendr")rIZhintr{�linesr�rArArB�	readlines?s
zIOBase.readlinescCs |��|D]}|�|�qdS)z�Write a list of lines to the stream.

        Line separators are not added, so it is usual for each of the lines
        provided to have a line separator at the end.
        N)re�write)rIr�r�rArArB�
writelinesQszIOBase.writelines)r)N)N)N)N)N)r)N)rMrNrOrHrZr[rarbrfrgr5rjrkrnrorprqrr�propertyrhrerurvr,r)r�r�r�r�r�rArArArBrW9s6!







	

*
rW)�	metaclassc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
�	RawIOBasezBase class for raw binary I/O.rcCsP|dkrd}|dkr|��St|���}|�|�}|dkr>dS||d�=t|�S)z�Read and return up to size bytes, where size is an int.

        Returns an empty bytes object on EOF, or None if the object is
        set not to block and has no data to read.
        Nrr)�readallr�r��readintor)rIr}rr{rArArBr�ls

zRawIOBase.readcCs4t�}|�t�}|sq ||7}q|r,t|�S|SdS)z+Read until EOF, using multiple read() call.N)r�r�r*r)rIr��datarArArBr�}s

zRawIOBase.readallcCs|�d�dS)z�Read bytes into a pre-allocated bytes-like object b.

        Returns an int representing the number of bytes read (0 for EOF), or
        None if the object is set not to block and has no data to read.
        r�Nr\�rIrrArArBr��szRawIOBase.readintocCs|�d�dS)z�Write the given buffer to the IO stream.

        Returns the number of bytes written, which may be less than the
        length of b in bytes.
        r�Nr\r�rArArBr��szRawIOBase.writeN)r)rMrNrOrHr�r�r�r�rArArArBr�^s

r�)r(c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BufferedIOBaseaBase class for buffered IO objects.

    The main difference with RawIOBase is that the read() method
    supports omitting the size argument, and does not have a default
    implementation that defers to readinto().

    In addition, read(), readinto() and write() may raise
    BlockingIOError if the underlying raw stream is in non-blocking
    mode and not ready; unlike their raw counterparts, they will never
    return None.

    A typical implementation should not inherit from a RawIOBase
    implementation, but wrap one.
    rcCs|�d�dS)a�Read and return up to size bytes, where size is an int.

        If the argument is omitted, None, or negative, reads and
        returns all data until EOF.

        If the argument is positive, and the underlying raw stream is
        not 'interactive', multiple raw reads may be issued to satisfy
        the byte count (unless EOF is reached first).  But for
        interactive raw streams (XXX and for pipes?), at most one raw
        read will be issued, and a short result does not imply that
        EOF is imminent.

        Returns an empty bytes array on EOF.

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        r�Nr\r|rArArBr��szBufferedIOBase.readcCs|�d�dS)zaRead up to size bytes with at most one read() system call,
        where size is an int.
        �read1Nr\r|rArArBr��szBufferedIOBase.read1cCs|j|dd�S)afRead bytes into a pre-allocated bytes-like object b.

        Like read(), this may issue multiple reads to the underlying raw
        stream, unless the latter is 'interactive'.

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        F�r���	_readintor�rArArBr��szBufferedIOBase.readintocCs|j|dd�S)z�Read bytes into buffer *b*, using at most one system call

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        Tr�r�r�rArArB�	readinto1�s	zBufferedIOBase.readinto1cCsVt|t�st|�}|�d�}|r0|�t|��}n|�t|��}t|�}||d|�<|S)N�B)r�
memoryview�castr�r"r�)rIrr�r�r{rArArBr��s

zBufferedIOBase._readintocCs|�d�dS)aWrite the given bytes buffer to the IO stream.

        Return the number of bytes written, which is always the length of b
        in bytes.

        Raises BlockingIOError if the buffer is full and the
        underlying raw stream cannot accept more data at the moment.
        r�Nr\r�rArArBr��s	zBufferedIOBase.writecCs|�d�dS)z�
        Separate the underlying raw stream from the buffer and return it.

        After the raw stream has been detached, the buffer is in an unusable
        state.
        �detachNr\r`rArArBr��szBufferedIOBase.detachN)r)r)rMrNrOrHr�r�r�r�r�r�r�rArArArBr��s

r�c@s�eZdZdZdd�Zd$dd�Zdd�Zd%d
d�Zdd
�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zedd��Zdd�Zdd�Zd d!�Zd"d#�Zd	S)&�_BufferedIOMixinz�A mixin implementation of BufferedIOBase with an underlying raw stream.

    This passes most requests on to the underlying raw stream.  It
    does *not* provide implementations of read(), readinto() or
    write().
    cCs
||_dSrQ��_raw�rIr=rArArB�__init__sz_BufferedIOMixin.__init__rcCs"|j�||�}|dkrtd��|S)Nrz#seek() returned an invalid position)r=r[r.)rIr^r_Znew_positionrArArBr[sz_BufferedIOMixin.seekcCs|j��}|dkrtd��|S)Nrz#tell() returned an invalid position)r=rar.rcrArArBras
z_BufferedIOMixin.tellNcCs$|��|dkr|��}|j�|�SrQ)rfrar=rbrcrArArBrb$sz_BufferedIOMixin.truncatecCs|jrtd��|j��dS)N�flush on closed file)rhr#r=rfr`rArArBrf2sz_BufferedIOMixin.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r=rhr5rfr`rArArBr57sz_BufferedIOMixin.closecCs*|jdkrtd��|��|j}d|_|S)Nzraw stream already detached)r=r#rfr�r�rArArBr�?s
z_BufferedIOMixin.detachcCs
|j��SrQ)r=rkr`rArArBrkIsz_BufferedIOMixin.seekablecCs|jSrQr�r`rArArBr=Lsz_BufferedIOMixin.rawcCs|jjSrQ)r=rhr`rArArBrhPsz_BufferedIOMixin.closedcCs|jjSrQ)r=rYr`rArArBrYTsz_BufferedIOMixin.namecCs|jjSrQ)r=r4r`rArArBr4Xsz_BufferedIOMixin.modecCstd|jj�d���dS�Nzcannot pickle z object�r rXrMr`rArArB�__getstate__\sz_BufferedIOMixin.__getstate__cCsN|jj}|jj}z
|j}Wn tk
r:d�||�YSXd�|||�SdS)Nz<{}.{}>z<{}.{} name={!r}>)rXrNrOrYr/�format)rI�modnameZclsnamerYrArArB�__repr___s
z_BufferedIOMixin.__repr__cCs
|j��SrQ)r=r,r`rArArBr,ksz_BufferedIOMixin.filenocCs
|j��SrQ)r=r)r`rArArBr)nsz_BufferedIOMixin.isatty)r)N)rMrNrOrHr�r[rarbrfr5r�rkr�r=rhrYr4r�r�r,r)rArArArBr�
s*






r�cs�eZdZdZdZd!dd�Zdd�Zdd�Zd	d
�Z�fdd�Z	d"dd�Z
d#dd�Zdd�Zd$dd�Z
dd�Zd%dd�Zdd�Zdd�Zdd �Z�ZS)&�BytesIOz<Buffered I/O implementation using an in-memory bytes buffer.NcCs&t�}|dk	r||7}||_d|_dS�Nr)r��_buffer�_pos)rIZ
initial_bytes�bufrArArBr�zs
zBytesIO.__init__cCs|jrtd��|j��S)Nz__getstate__ on closed file)rhr#�__dict__�copyr`rArArBr��szBytesIO.__getstate__cCs|jrtd��t|j�S)z8Return the bytes value (contents) of the buffer
        zgetvalue on closed file)rhr#rr�r`rArArB�getvalue�szBytesIO.getvaluecCs|jrtd��t|j�S)z;Return a readable and writable view of the buffer.
        zgetbuffer on closed file)rhr#r�r�r`rArArB�	getbuffer�szBytesIO.getbuffercs"|jdk	r|j��t���dSrQ)r��clear�superr5r`�rXrArBr5�s

z
BytesIO.closercCs�|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|dkrbt|j�}t|j�|jkrvdStt|j�|j|�}|j|j|�}||_t	|�S)N�read from closed filerr�r�)
rhr#r�r/r r"r�r�rzr)rIr}r�ZnewposrrArArBr��s"

zBytesIO.readcCs
|�|�S)z"This is the same as read.
        )r�r|rArArBr��sz
BytesIO.read1c	Cs�|jrtd��t|t�r td��t|��}|j}W5QRX|dkrFdS|j}|t|j	�krzd|t|j	�}|j	|7_	||j	|||�<|j|7_|S)N�write to closed file� can't write str to binary streamr�)
rhr#rrr r��nbytesr�r"r�)rIrZviewr{r^ZpaddingrArArBr��s

z
BytesIO.writercCs�|jrtd��z
|j}Wn"tk
r:t|�d���YnX|�}|dkrh|dkr`td|f��||_nD|dkr�td|j|�|_n(|dkr�tdt|j�|�|_ntd��|jS)Nzseek on closed filer�r�negative seek position %rr
rzunsupported whence value)	rhr#r�r/r r��maxr"r�)rIr^r_�	pos_indexrArArBr[�s"
zBytesIO.seekcCs|jrtd��|jS)N�tell on closed file)rhr#r�r`rArArBra�szBytesIO.tellcCsx|jrtd��|dkr|j}nJz
|j}Wn"tk
rJt|�d���YnX|�}|dkrhtd|f��|j|d�=|S)Nztruncate on closed filer�rznegative truncate position %r)rhr#r�r�r/r r�)rIr^r�rArArBrb�s
zBytesIO.truncatecCs|jrtd��dS�NrsTrtr`rArArBro�szBytesIO.readablecCs|jrtd��dSr�rtr`rArArBrq�szBytesIO.writablecCs|jrtd��dSr�rtr`rArArBrk�szBytesIO.seekable)N)r)r)r)N)rMrNrOrHr�r�r�r�r�r5r�r�r�r[rarbrorqrk�
__classcell__rArAr�rBr�rs 




r�c@sxeZdZdZefdd�Zdd�Zdd�Zdd	d
�Zddd�Z	ddd�Z
ddd�Zddd�Zdd�Z
dd�Zd dd�ZdS)!r2aBufferedReader(raw[, buffer_size])

    A buffer for a readable, sequential BaseRawIO object.

    The constructor creates a BufferedReader for the given readable raw
    stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE
    is used.
    cCsF|��std��t�||�|dkr,td��||_|��t�|_dS)zMCreate a new buffered reader using the given readable raw IO object.
        z "raw" argument must be readable.r�invalid buffer sizeN)	ror.r�r�r#�buffer_size�_reset_read_buf�Lock�
_read_lock�rIr=r�rArArBr�szBufferedReader.__init__cCs
|j��SrQ)r=ror`rArArBroszBufferedReader.readablecCsd|_d|_dS)Nr�r)�	_read_buf�	_read_posr`rArArBr�szBufferedReader._reset_read_bufNc
Cs@|dk	r|dkrtd��|j�|�|�W5QR�SQRXdS)z�Read size bytes.

        Returns exactly size bytes of data unless the underlying raw IO
        stream reaches EOF or if the call would block in non-blocking
        mode. If size is negative, read until EOF or until read() would
        block.
        Nrzinvalid number of bytes to read)r#r��_read_unlockedr|rArArBr� szBufferedReader.readcCs�d}d}|j}|j}|dks$|dkr�|��t|jd�rj|j��}|dkrZ||d�pXdS||d�|S||d�g}d}|j��}||kr�|}q�|t|�7}|�|�q|d�	|�p�|St|�|}	||	kr�|j|7_||||�S||d�g}t
|j|�}
|	|k�rH|j�|
�}||k�r.|}�qH|	t|�7}	|�|��qt||	�}d�	|�}||d�|_d|_|�r�|d|�S|S)Nr�)r�Nrr�r)
r�r�r�r�r=r�r�r"r��joinr�r�rz)rIr{Z
nodata_valZempty_valuesr�r^�chunkZchunksZcurrent_size�availZwanted�outrArArBr�-sL





zBufferedReader._read_unlockedrc
Cs(|j�|�|�W5QR�SQRXdS)z�Returns buffered bytes without advancing the position.

        The argument indicates a desired minimal number of bytes; we
        do at most one raw read to satisfy it.  We never return more
        than self.buffer_size.
        N)r��_peek_unlockedr|rArArBrwaszBufferedReader.peekcCsrt||j�}t|j�|j}||ks,|dkrb|j|}|j�|�}|rb|j|jd�||_d|_|j|jd�Sr�)rzr�r"r�r�r=r�)rIr{ZwantZhaveZto_readZcurrentrArArBr�ks
zBufferedReader._peek_unlockedrc
Cs^|dkr|j}|dkrdS|j�4|�d�|�t|t|j�|j��W5QR�SQRXdS)z<Reads up to size bytes, with at most one read() system call.rr�r
N)r�r�r�r�rzr"r�r�r|rArArBr�vs
�zBufferedReader.read1c	Cs
t|t�st|�}|jdkr dS|�d�}d}|j��|t|�kr�tt|j�|jt|��}|r�|j|j|j|�||||�<|j|7_||7}|t|�kr�q�t|�||j	kr�|j
�||d��}|s�q�||7}n|r�|s�|�d�s�q�|r6|r6q�q6W5QRX|S)z2Read data into *buf* with at most one system call.rr�Nr
)
rr�r�r�r�r"rzr�r�r�r=r�r�)rIr�r��writtenr�r{rArArBr��s6


�

zBufferedReader._readintocCst�|�t|j�|jSrQ)r�rar"r�r�r`rArArBra�szBufferedReader.tellc
Csd|tkrtd��|j�D|dkr4|t|j�|j8}t�|||�}|��|W5QR�SQRXdS)N�invalid whence valuer
)	�valid_seek_flagsr#r�r"r�r�r�r[r�r]rArArBr[�szBufferedReader.seek)N)N)r)r)r)r)rMrNrOrHr*r�ror�r�r�rwr�r�r�rar[rArArArBr2s	


4



.r2c@s`eZdZdZefdd�Zdd�Zdd�Zdd	d
�Zdd�Z	d
d�Z
dd�Zddd�Zdd�Z
dS)r1z�A buffer for a writeable sequential RawIO object.

    The constructor creates a BufferedWriter for the given writeable raw
    stream. If the buffer_size is not given, it defaults to
    DEFAULT_BUFFER_SIZE.
    cCsF|��std��t�||�|dkr,td��||_t�|_t�|_	dS)Nz "raw" argument must be writable.rr�)
rqr.r�r�r#r�r��
_write_bufr��_write_lockr�rArArBr��szBufferedWriter.__init__cCs
|j��SrQ)r=rqr`rArArBrq�szBufferedWriter.writablecCst|t�rtd��|j��|jr(td��t|j�|jkr@|�	�t|j�}|j�
|�t|j�|}t|j�|jkr�z|�	�Wnltk
r�}zNt|j�|jkr�t|j�|j}||8}|jd|j�|_t|j|j
|��W5d}~XYnX|W5QR�SQRXdS)Nr�r�)rrr r�rhr#r"r�r��_flush_unlocked�extend�BlockingIOError�errno�strerror)rIrZbeforer��eZoveragerArArBr��s(

"zBufferedWriter.writeNc
CsD|j�4|��|dkr"|j��}|j�|�W5QR�SQRXdSrQ)r�r�r=rarbrcrArArBrb�s

zBufferedWriter.truncatec	Cs|j�|��W5QRXdSrQ)r�r�r`rArArBrf�szBufferedWriter.flushcCs�|jrtd��|jr�z|j�|j�}Wntk
rBtd��YnX|dkrZttjdd��|t	|j�ksp|dkrxt
d��|jd|�=qdS)Nr�zHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes)rhr#r�r=r�r��RuntimeErrorr�ZEAGAINr"r.�rIr{rArArBr�s �zBufferedWriter._flush_unlockedcCst�|�t|j�SrQ)r�rar"r�r`rArArBraszBufferedWriter.tellrc
CsD|tkrtd��|j�$|��t�|||�W5QR�SQRXdS)Nr�)r�r#r�r�r�r[r]rArArBr[s
zBufferedWriter.seekcCs`|j�$|jdks|jr&W5QR�dSW5QRXz|��W5|j�|j��W5QRXXdSrQ)r�r=rhr5rfr`rArArBr5szBufferedWriter.close)N)r)rMrNrOrHr*r�rqr�rbrfr�rar[r5rArArArBr1�s

r1c@s�eZdZdZefdd�Zddd�Zdd�Zd	d
�Zd dd
�Z	d!dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zedd��ZdS)"�BufferedRWPaira�A buffered reader and writer object together.

    A buffered reader object and buffered writer object put together to
    form a sequential IO object that can read and write. This is typically
    used with a socket or two-way pipe.

    reader and writer are RawIOBase objects that are readable and
    writeable respectively. If the buffer_size is omitted it defaults to
    DEFAULT_BUFFER_SIZE.
    cCs<|��std��|��s td��t||�|_t||�|_dS)zEConstructor.

        The arguments are two RawIO instances.
        z#"reader" argument must be readable.z#"writer" argument must be writable.N)ror.rqr2�readerr1�writer)rIr�r�r�rArArBr�<szBufferedRWPair.__init__rcCs|dkrd}|j�|�S�Nr)r�r�r|rArArBr�JszBufferedRWPair.readcCs|j�|�SrQ)r�r�r�rArArBr�OszBufferedRWPair.readintocCs|j�|�SrQ)r�r�r�rArArBr�RszBufferedRWPair.writercCs|j�|�SrQ)r�rwr|rArArBrwUszBufferedRWPair.peekcCs|j�|�SrQ)r�r�r|rArArBr�XszBufferedRWPair.read1cCs|j�|�SrQ)r�r�r�rArArBr�[szBufferedRWPair.readinto1cCs
|j��SrQ)r�ror`rArArBro^szBufferedRWPair.readablecCs
|j��SrQ)r�rqr`rArArBrqaszBufferedRWPair.writablecCs
|j��SrQ)r�rfr`rArArBrfdszBufferedRWPair.flushcCs z|j��W5|j��XdSrQ)r�r5r�r`rArArBr5gszBufferedRWPair.closecCs|j��p|j��SrQ)r�r)r�r`rArArBr)mszBufferedRWPair.isattycCs|jjSrQ)r�rhr`rArArBrhpszBufferedRWPair.closedN)r)r)r)rMrNrOrHr*r�r�r�r�rwr�r�rorqrfr5r)r�rhrArArArBr�,s


r�c@sneZdZdZefdd�Zddd�Zdd�Zdd
d�Zddd
�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�Zd	S)r0z�A buffered interface to random access streams.

    The constructor creates a reader and writer for a seekable stream,
    raw, given in the first argument. If the buffer_size is omitted it
    defaults to DEFAULT_BUFFER_SIZE.
    cCs(|��t�|||�t�|||�dSrQ)rnr2r�r1r�rArArBr�~szBufferedRandom.__init__rc	Cs�|tkrtd��|��|jrJ|j� |j�|jt|j�d�W5QRX|j�||�}|j�|�	�W5QRX|dkr�t
d��|S)Nr�r
rz seek() returned invalid position)r�r#rfr�r�r=r[r�r"r�r.r]rArArBr[�s$zBufferedRandom.seekcCs|jrt�|�St�|�SdSrQ)r�r1rar2r`rArArBra�s
zBufferedRandom.tellNcCs|dkr|��}t�||�SrQ)rar1rbrcrArArBrb�szBufferedRandom.truncatecCs |dkrd}|��t�||�Sr�)rfr2r�r|rArArBr��szBufferedRandom.readcCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readintocCs|��t�||�SrQ)rfr2rwr|rArArBrw�szBufferedRandom.peekrcCs|��t�||�SrQ)rfr2r�r|rArArBr��szBufferedRandom.read1cCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readinto1c	CsF|jr:|j�(|j�|jt|j�d�|��W5QRXt�||�Sr)	r�r�r=r[r�r"r�r1r�r�rArArBr��s
zBufferedRandom.write)r)N)N)r)r)rMrNrOrHr*r�r[rarbr�r�rwr�r�r�rArArArBr0us




r0cs�eZdZdZdZdZdZdZdZdZ	d0dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zd1dd�Zd2dd�Zdd�Zdd�Zdd�Zefdd�Zdd�Zd3dd�Z�fd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zed,d-��Zed.d/��Z �Z!S)4r(rFNTr
c
CsB|jdkr*z|jrt�|j�W5d|_Xt|t�r<td��t|t�r\|}|dkr`td��nd}t|t	�sxtd|f��t
|�t
d�ks�td|f��tdd�|D��d	ks�|�d
�d	kr�td��d|kr�d
|_
d
|_tjtjB}nTd|kr�d
|_d}n@d|k�rd
|_tjtjB}n"d|k�r8d
|_d
|_tjtjB}d
|k�rNd
|_d
|_|j�rj|j�rj|tjO}n|j�r~|tjO}n
|tjO}|ttdd�O}ttdd��p�ttdd�}||O}d}�zT|dk�r:|�s�td��|dk�r�t�||d�}n0|||�}t|t��std��|dk�r$td��|}|�s:t�|d�||_t�|�}	z(t�|	j��rpt t!j"t�#t!j"�|��Wnt$k
�r�YnXt|	dd�|_%|j%d	k�r�t&|_%t'�r�t'|tj(�||_)|j�rzt�*|dt+�Wn4tk
�r}
z|
j!t!j,k�r�W5d}
~
XYnXWn"|dk	�r0t�|��YnX||_dS)adOpen a file.  The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
        writing, exclusive creation or appending.  The file will be created if it
        doesn't exist when opened for writing or appending; it will be truncated
        when opened for writing.  A FileExistsError will be raised if it already
        exists when opened for creating. Opening a file for creating implies
        writing so this mode behaves in a similar way to 'w'. Add a '+' to the mode
        to allow simultaneous reading and writing. A custom opener can be used by
        passing a callable as *opener*. The underlying file descriptor for the file
        object is then obtained by calling opener with (*name*, *flags*).
        *opener* must return an open file descriptor (passing os.open as *opener*
        results in functionality similar to passing None).
        rrz$integer argument expected, got floatznegative file descriptorzinvalid mode: %szxrwab+css|]}|dkVqdS)ZrwaxNrA)�.0�crArArB�	<genexpr>�sz"FileIO.__init__.<locals>.<genexpr>r
rzKMust have exactly one of create/read/write/append mode and at most one plusrTr
rr�O_BINARYZO_NOINHERIT�	O_CLOEXECNz'Cannot use closefd=False with file namei�zexpected integer from openerzNegative file descriptorFr-)-�_fd�_closefdrr5r�floatr rr#rr!�sum�count�_created�	_writable�O_EXCL�O_CREAT�	_readable�O_TRUNC�
_appending�O_APPEND�O_RDWR�O_RDONLY�O_WRONLY�getattrrCr.�set_inheritabler+�stat�S_ISDIR�st_mode�IsADirectoryErrorr�ZEISDIRr�r/�_blksizer*�_setmoder�rY�lseekr	ZESPIPE)rIr6r4r;r�fd�flagsZnoinherit_flagZowned_fdZfdfstatr�rArArBr��s�




$




�





�

zFileIO.__init__cCsB|jdkr>|jr>|js>ddl}|jd|ftd|d�|��dS)Nrzunclosed file %rr)�
stacklevel�source)r�r�rhr$r%�ResourceWarningr5)rIr$rArArBrjAs�zFileIO.__del__cCstd|jj�d���dSr�r�r`rArArBr�HszFileIO.__getstate__cCspd|jj|jjf}|jr"d|Sz
|j}Wn*tk
rVd||j|j|jfYSXd|||j|jfSdS)Nz%s.%sz
<%s [closed]>z<%s fd=%d mode=%r closefd=%r>z<%s name=%r mode=%r closefd=%r>)	rXrNrOrhrYr/r�r4r�)rI�
class_namerYrArArBr�Ks�
�
�zFileIO.__repr__cCs|jstd��dS)NzFile not open for reading)r�rVr`rArArBrpYszFileIO._checkReadablecCs|jstd��dS)NzFile not open for writing)r�rVrlrArArBrr]szFileIO._checkWritablecCsT|��|��|dks |dkr(|��Szt�|j|�WStk
rNYdSXdS)z�Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
        Nr)rerpr�rr�r�r�r|rArArBr�aszFileIO.readcCs�|��|��t}z6t�|jdt�}t�|j�j}||krH||d}Wnt	k
r^YnXt
�}t|�|kr�t|�}|t|t�7}|t|�}zt�
|j|�}Wntk
r�|r�Yq�YdSX|s�q�||7}qft|�S)z�Read all data from the file, returned as bytes.

        In non-blocking mode, returns as much as is immediately available,
        or None if no data is available.  Return an empty bytes object at EOF.
        rr
N)rerpr*rrr�rr+�st_sizer.r�r"r�r�r�r)rI�bufsizer^�endr>r{r�rArArBr�qs2
zFileIO.readallcCs4t|��d�}|�t|��}t|�}||d|�<|S)zSame as RawIOBase.readinto().r�N)r�r�r�r")rIr�mr�r{rArArBr��s
zFileIO.readintocCs<|��|��zt�|j|�WStk
r6YdSXdS)aWrite bytes b to file, return number written.

        Only makes one system call, so not all of the data may be written.
        The number of bytes actually written is returned.  In non-blocking mode,
        returns None if the write would block.
        N)rerrrr�r�r�r�rArArBr��szFileIO.writecCs*t|t�rtd��|��t�|j||�S)a�Move to new file position.

        Argument offset is a byte count.  Optional argument whence defaults to
        SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
        are SEEK_CUR or 1 (move relative to current position, positive or negative),
        and SEEK_END or 2 (move relative to end of file, usually negative, although
        many platforms allow seeking beyond the end of a file).

        Note that not all file objects are seekable.
        zan integer is required)rr�r rerrr�r]rArArBr[�s
zFileIO.seekcCs|��t�|jdt�S)zYtell() -> int.  Current file position.

        Can raise OSError for non seekable files.r)rerrr�rr`rArArBra�szFileIO.tellcCs2|��|��|dkr |��}t�|j|�|S)z�Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
        N)rerrrar�	ftruncater�r|rArArBrb�szFileIO.truncatecs.|js*z|jrt�|j�W5t���XdS)z�Close the file.

        A closed file cannot be used for further I/O operations.  close() may be
        called more than once without error.
        N)rhr�r5r�rr�r`r�rArBr5�s
zFileIO.closecCsF|��|jdkr@z|��Wntk
r8d|_YnXd|_|jS)z$True if file supports random-access.NFT)re�	_seekablerar.r`rArArBrk�s
zFileIO.seekablecCs|��|jS)z'True if file was opened in a read mode.)rer�r`rArArBro�szFileIO.readablecCs|��|jS)z(True if file was opened in a write mode.)rer�r`rArArBrq�szFileIO.writablecCs|��|jS)z3Return the underlying file descriptor (an integer).)rer�r`rArArBr,�sz
FileIO.filenocCs|��t�|j�S)z.True if the file is connected to a TTY device.)rerr)r�r`rArArBr)�sz
FileIO.isattycCs|jS)z6True if the file descriptor will be closed by close().)r�r`rArArBr;�szFileIO.closefdcCsJ|jr|jrdSdSn0|jr,|jr&dSdSn|jrB|jr<dSdSndSdS)	zString giving the file modezxb+Zxbzab+Zabzrb+rD�wbN)r�r�r�r�r`rArArBr4szFileIO.mode)r
TN)N)N)N)"rMrNrOr�r�r�r�r�rr�r�rjr�r�rprrr�r�r�r�rr[rarbr5rkrorqr,r)r�r;r4r�rArAr�rBr(�s<
y

#



r(c@s`eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Ze	dd��Z
e	dd��Ze	dd��ZdS)�
TextIOBasez�Base class for text I/O.

    This class provides a character and line based interface to stream
    I/O. There is no public constructor.
    rcCs|�d�dS)z�Read at most size characters from stream, where size is an int.

        Read from underlying buffer until we have size characters or we hit EOF.
        If size is negative or omitted, read until EOF.

        Returns a string.
        r�Nr\r|rArArBr�szTextIOBase.readcCs|�d�dS)z.Write string s to stream and returning an int.r�Nr\)rI�srArArBr�(szTextIOBase.writeNcCs|�d�dS)z*Truncate size to pos, where pos is an int.rbNr\rcrArArBrb,szTextIOBase.truncatecCs|�d�dS)z_Read until newline or EOF.

        Returns an empty string if EOF is hit immediately.
        r�Nr\r`rArArBr�0szTextIOBase.readlinecCs|�d�dS)z�
        Separate the underlying buffer from the TextIOBase and return it.

        After the underlying buffer has been detached, the TextIO is in an
        unusable state.
        r�Nr\r`rArArBr�7szTextIOBase.detachcCsdS)zSubclasses should override.NrAr`rArArBr8@szTextIOBase.encodingcCsdS)z�Line endings translated so far.

        Only line endings translated during reading are considered.

        Subclasses should override.
        NrAr`rArArB�newlinesEszTextIOBase.newlinescCsdS)zMError setting of the decoder or encoder.

        Subclasses should override.NrAr`rArArBr9OszTextIOBase.errors)r)N)
rMrNrOrHr�r�rbr�r�r�r8rr9rArArArBrs


	

	rc@sTeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdZ	dZ
dZedd��Z
dS)�IncrementalNewlineDecodera+Codec used when reading a file in universal newlines mode.  It wraps
    another incremental decoder, translating \r\n and \r into \n.  It also
    records the types of newlines encountered.  When used with
    translate=False, it ensures that the newline sequence is returned in
    one piece.
    �strictcCs,tjj||d�||_||_d|_d|_dS)N)r9rF)�codecs�IncrementalDecoderr��	translate�decoder�seennl�	pendingcr)rIrrr9rArArBr�`s
z"IncrementalNewlineDecoder.__init__FcCs�|jdkr|}n|jj||d�}|jr<|s.|r<d|}d|_|�d�r\|s\|dd�}d|_|�d�}|�d�|}|�d�|}|j|o�|j|o�|jB|o�|jBO_|j	r�|r�|�
dd�}|r�|�
dd�}|S)N��final�
FrT�
�
)r�decoderr�r�r�_LF�_CR�_CRLFr�replace)rI�inputr�outputZcrlfZcrZlfrArArBr#gs*

�z IncrementalNewlineDecoder.decodecCs@|jdkrd}d}n|j��\}}|dK}|jr8|dO}||fS)Nr�rr
)r�getstater)rIr��flagrArArBr*�s
z"IncrementalNewlineDecoder.getstatecCs8|\}}t|d@�|_|jdk	r4|j�||d?f�dSr)�boolrr�setstate)rI�stater�r+rArArBr-�s
z"IncrementalNewlineDecoder.setstatecCs$d|_d|_|jdk	r |j��dS)NrF)rrr�resetr`rArArBr/�s
zIncrementalNewlineDecoder.resetr
r�cCs
d|jS)N)Nr"r )r r"r!)r"r!)r r!)r r"r!)rr`rArArBr�s�z"IncrementalNewlineDecoder.newlinesN)r)F)rMrNrOrHr�r#r*r-r/r$r%r&r�rrArArArBrYs

rc@sveZdZdZdZdZdOdd�Zdd�ZdPd	d
�Zdd�Z	e
d
d��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Zddeddd�dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Ze
d$d%��Ze
d&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdQd4d5�Zd6d7�Z d8d9�Z!dRd;d<�Z"d=d>�Z#d?d@�Z$dSdAdB�Z%dCdD�Z&dTdEdF�Z'dUdGdH�Z(dIdJ�Z)dVdKdL�Z*e
dMdN��Z+dS)Wr3aCharacter and line based layer over a BufferedIOBase object, buffer.

    encoding gives the name of the encoding that the stream will be
    decoded or encoded with. It defaults to locale.getpreferredencoding(False).

    errors determines the strictness of encoding and decoding (see the
    codecs.register) and defaults to "strict".

    newline can be None, '', '\n', '\r', or '\r\n'.  It controls the
    handling of line endings. If it is None, universal newlines is
    enabled.  With this enabled, on input, the lines endings '\n', '\r',
    or '\r\n' are translated to '\n' before being returned to the
    caller. Conversely, on output, '\n' is translated to the system
    default line separator, os.linesep. If newline is any other of its
    legal values, that newline becomes the newline when the file is read
    and it is returned untranslated. On output, '\n' is converted to the
    newline.

    If line_buffering is True, a call to flush is implied when a call to
    write contains a newline character.
    iNFc		Cs|�|�|dkrvzt�|���}Wnttfk
r<YnX|dkrvzddl}Wntk
rjd}YnX|�d�}t	|t
�s�td|��t�
|�js�d}t||��|dkr�d}nt	|t
�s�td|��||_d|_d|_d|_|j��|_|_t|jd	�|_|�|||||�dS)
Nr�asciiFrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsrrrr�)�_check_newliner�device_encodingr,r/rV�locale�ImportErrorZgetpreferredencodingrrr#r�lookup�_is_text_encoding�LookupErrorr��_decoded_chars�_decoded_chars_used�	_snapshotr@rkr�_tellingr��
_has_read1�
_configure)	rIr@r8r9r:r?�
write_throughr4rmrArArBr��s>





�zTextIOWrapper.__init__cCs>|dk	r$t|t�s$tdt|�f��|dkr:td|f��dS)Nzillegal newline type: %r)Nrr"r r!zillegal newline value: %r)rrr �typer#)rIr:rArArBr2�szTextIOWrapper._check_newlinecCs�||_||_d|_d|_d|_||_|dk|_||_|dk|_|pHt	j
|_||_||_
|jr�|��r�|j��}|dkr�z|���d�Wntk
r�YnXdS)N�rr)�	_encoding�_errors�_encoder�_decoder�	_b2cratio�_readuniversal�_readtranslate�_readnl�_writetranslater�linesep�_writenl�_line_buffering�_write_throughrrqr@ra�_get_encoderr-r8)rIr8r9r:r?r?�positionrArArBr>�s&


zTextIOWrapper._configurecCs�d�|jj|jj�}z
|j}Wntk
r2YnX|d�|�7}z
|j}Wntk
r`YnX|d�|�7}|d�|j�S)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)r�rXrNrOrYr/r4r8)rIr>rYr4rArArBr�!s
�

zTextIOWrapper.__repr__cCs|jSrQ)rBr`rArArBr82szTextIOWrapper.encodingcCs|jSrQ)rCr`rArArBr96szTextIOWrapper.errorscCs|jSrQ)rMr`rArArBr?:szTextIOWrapper.line_bufferingcCs|jSrQ)rNr`rArArBr?>szTextIOWrapper.write_throughcCs|jSrQ)r�r`rArArBr@BszTextIOWrapper.buffer)r8r9r:r?r?cCs�|jdk	r*|dk	s"|dk	s"|tk	r*td��|dkrH|dkrB|j}q^d}nt|t�s^td|��|dkrn|j}nt|t�s�td|��|tkr�|j}|�	|�|dkr�|j
}|dkr�|j}|��|�
|||||�dS)z`Reconfigure the text stream with new parameters.

        This also flushes the stream.
        NzPIt is not possible to set the encoding or newline of stream after the first readrrr)rE�EllipsisrVrCrrr rBrIr2r?r?rfr>)rIr8r9r:r?r?rArArB�reconfigureFs@
����



�zTextIOWrapper.reconfigurecCs|jrtd��|jS)Nrs)rhr#rr`rArArBrkoszTextIOWrapper.seekablecCs
|j��SrQ)r@ror`rArArBrotszTextIOWrapper.readablecCs
|j��SrQ)r@rqr`rArArBrqwszTextIOWrapper.writablecCs|j��|j|_dSrQ)r@rfrr<r`rArArBrfzs
zTextIOWrapper.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r@rhr5rfr`rArArBr5~szTextIOWrapper.closecCs|jjSrQ)r@rhr`rArArBrh�szTextIOWrapper.closedcCs|jjSrQ)r@rYr`rArArBrY�szTextIOWrapper.namecCs
|j��SrQ)r@r,r`rArArBr,�szTextIOWrapper.filenocCs
|j��SrQ)r@r)r`rArArBr)�szTextIOWrapper.isattycCs�|jrtd��t|t�s(td|jj��t|�}|js<|j	oBd|k}|rf|jrf|j
dkrf|�d|j
�}|jpr|�
�}|�|�}|j�|�|j	r�|s�d|kr�|��|�d�d|_|jr�|j��|S)zWrite data, where s is a strr�zcan't write %s to text streamr"r rN)rhr#rrr rXrMr"rJrMrLr'rDrO�encoder@r�rf�_set_decoded_charsr;rEr/)rIrZlengthZhaslf�encoderrrArArBr��s(
�


zTextIOWrapper.writecCst�|j�}||j�|_|jSrQ)r�getincrementalencoderrBrCrD)rIZmake_encoderrArArBrO�szTextIOWrapper._get_encodercCs2t�|j�}||j�}|jr(t||j�}||_|SrQ)r�getincrementaldecoderrBrCrGrrHrE)rIZmake_decoderrrArArB�_get_decoder�s
zTextIOWrapper._get_decodercCs||_d|_dS)zSet the _decoded_chars buffer.rN)r9r:)rI�charsrArArBrT�sz TextIOWrapper._set_decoded_charscCsF|j}|dkr|j|d�}n|j|||�}|jt|�7_|S)z'Advance into the _decoded_chars buffer.N)r:r9r")rIr{�offsetrYrArArB�_get_decoded_chars�sz TextIOWrapper._get_decoded_charscCs$|j|krtd��|j|8_dS)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)r:�AssertionErrorr�rArArB�_rewind_decoded_chars�s
z#TextIOWrapper._rewind_decoded_charscCs�|jdkrtd��|jr&|j��\}}|jr<|j�|j�}n|j�|j�}|}|j�	||�}|�
|�|r�t|�t|j�|_
nd|_
|jr�|||f|_|S)zQ
        Read and decode the next chunk of data from the BufferedReader.
        Nz
no decoderrA)rEr#r<r*r=r@r��_CHUNK_SIZEr�r#rTr"r9rFr;)rI�
dec_buffer�	dec_flags�input_chunk�eofZ
decoded_charsrArArB�_read_chunk�s 

zTextIOWrapper._read_chunkrcCs(||d>B|d>B|d>Bt|�d>BS)N�@���)r,)rIrPr`�
bytes_to_feed�need_eof�
chars_to_skiprArArB�_pack_cookie�s
�
�zTextIOWrapper._pack_cookiecCsFt|d�\}}t|d�\}}t|d�\}}t|d�\}}|||||fS)Nl)�divmod)rIZbigint�restrPr`rhrirjrArArB�_unpack_cookie	s
zTextIOWrapper._unpack_cookiec	CsR|jstd��|jstd��|��|j��}|j}|dksF|jdkrX|j	rTt
d��|S|j\}}|t|�8}|j}|dkr�|�
||�S|��}�z�t|j|�}d}|t|�ks�t
�|dk�r4|�d|f�t|�|d|���}	|	|k�r"|��\}
}|
�s|}||	8}�qF|t|
�8}d}q�||8}|d}q�d}|�d|f�||}|}
|dk�rl|�
||
�W��Sd}d}d}t|t|��D]x}|d7}|t|�|||d���7}|��\}}|�s�||k�r�||7}||8}|dd}
}}||k�r��q,�q�|t|jddd	��7}d}||k�r,td
��|�
||
|||�W�S|�|�XdS)N�!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrr
r�rTrz'can't reconstruct logical file position)rrVr<r.rfr@rarEr;r9r\r"r:rkr*r-rrFr#�range)rIrPrr`Z
next_inputrjZsaved_stateZ
skip_bytesZ	skip_backr{r�d�	start_posZstart_flagsZ	bytes_fedriZ
chars_decoded�ir_rArArBra
	s�








�zTextIOWrapper.tellcCs$|��|dkr|��}|j�|�SrQ)rfrar@rbrcrArArBrbm	szTextIOWrapper.truncatecCs*|jdkrtd��|��|j}d|_|S)Nzbuffer is already detached)r@r#rfr�)rIr@rArArBr�s	s
zTextIOWrapper.detachcs��fdd�}�jrtd���js(td��|tkrN|dkr@td��d}���}nZ|tkr�|dkrftd������j�	d|�}��
d�d�_�jr��j�
�||�|S|dkr�td	|f��|dkr�td
|f�������|�\}}}}}	�j�	|���
d�d�_|dk�r*�j�r*�j�
�n@�j�s>|�s>|	�rj�j�pL����_�j�d|f�|df�_|	�r��j�|�}
��
�j�|
|��||
f�_t�j�|	k�r�td��|	�_||�|S)
NcsHz�jp���}Wntk
r&YnX|dkr<|�d�n|��dS)z9Reset the encoder (merely useful for proper BOM handling)rN)rDrOr8r-r/)rPrUr`rArB�_reset_encoder|	sz*TextIOWrapper.seek.<locals>._reset_encoderr�rorz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksrzunsupported whence (%r)r�r�z#can't restore logical file position)rhr#rrVrrar	rfr@r[rTr;rEr/rnrXr-r�r#r"r9r.r:)rIZcookier_rtrPrrr`rhrirjrarAr`rBr[{	s`



�

�
zTextIOWrapper.seekcCs�|��|dkrd}n4z
|j}Wn"tk
rBt|�d���YnX|�}|jpV|��}|dkr�|��|j|j�	�dd�}|�
d�d|_|Sd}|�|�}t|�|kr�|s�|�
�}||�|t|��7}q�|SdS)Nrr�rTrrF)rpr�r/r rErXr[r#r@r�rTr;r"rc)rIr}r�rr>rbrArArBr��	s,
�


zTextIOWrapper.readcCs(d|_|��}|s$d|_|j|_t�|S)NF)r<r�r;rr�r�rArArBr��	szTextIOWrapper.__next__c	Cs
|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|��}d}|jsj|��d}}|jr�|�	d|�}|dkr�|d}�q�nt
|�}n�|j�rF|�	d|�}|�	d|�}|dkr�|dkr�t
|�}n|d}�q�nX|dk�r|d}�q�n@||k�r|d}�q�n(||dk�r8|d}�q�n|d}�q�n(|�	|j�}|dk�rn|t
|j�}�q�|dk�r�t
|�|k�r�|}�q�|�
��r�|j�r��q��q�|j�r�||��7}qr|�d	�d|_|Sqr|dk�r�||k�r�|}|�t
|�|�|d|�S)
Nr�rr�rr"r
r rr)rhr#r�r/r r[rErXrHryr"rGrIrcr9rTr;r])	rIr}r�r��startr^�endposZnlposZcrposrArArBr��	st







zTextIOWrapper.readlinecCs|jr|jjSdSrQ)rErr`rArArBrH
szTextIOWrapper.newlines)NNNFF)NNNFF)N)rrrr)N)r)N)N),rMrNrOrHr^r�r�r2r>r�r�r8r9r?r?r@rQrRrkrorqrfr5rhrYr,r)r�rOrXrTr[r]rcrkrnrarbr�r[r�r�r�rrArArArBr3�s|�
(�
$




�)



*�

c

K
	
]r3csReZdZdZd�fdd�	Zdd�Zdd	�Zed
d��Zedd
��Z	dd�Z
�ZS)�StringIOz�Text I/O implementation using an in-memory buffer.

    The initial_value argument sets the value of object.  The newline
    argument is like the one of TextIOWrapper's constructor.
    rr"csftt|�jt�dd|d�|dkr(d|_|dk	rbt|t�sNtd�t	|�j
���|�|�|�d�dS)Nzutf-8�
surrogatepass)r8r9r:Fz*initial_value must be str or None, not {0}r)
r�rwr�r�rJrrr r�r@rMr�r[)rIZ
initial_valuer:r�rArBr�T
s�
�
zStringIO.__init__c	CsP|��|jp|��}|��}|��z|j|j��dd�W�S|�|�XdS)NTr)	rfrErXr*r/r-r#r@r�)rIrZ	old_staterArArBr�d
szStringIO.getvaluecCs
t�|�SrQ)�objectr�r`rArArBr�n
szStringIO.__repr__cCsdSrQrAr`rArArBr9s
szStringIO.errorscCsdSrQrAr`rArArBr8w
szStringIO.encodingcCs|�d�dS)Nr�r\r`rArArBr�{
szStringIO.detach)rr")rMrNrOrHr�r�r�r�r9r8r�r�rArAr�rBrwM
s


rw)r
rNNNTN)8rHr�abcrr�r��sys�_threadrr��platformZmsvcrtrr�iorrrr	r�r��addr�	SEEK_DATAr*r�r�dev_moderirCrF�	open_coder/rGrPrVr.r#�ABCMetarW�registerr��_ior(r�r�r�r2r1r�r0rrrr3rwrArArArB�<module>s�


�
[

	
$=
ghCiIJY@U$gettext.cpython-38.opt-1.pyc000064400000042735151450073350011635 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddddgZej�ejdd�Z	e�
dejejB�Z
dd�Zdd�ZdZd d!�eed"�D�Zd#d$d%d&�ZdGd(d)�Zd*d+�Zd,d-�Zd.d/�ZGd0d�d�ZGd1d�de�ZdHd3d�ZiZd4gZdddd2efd5d�Zdedfd6d�Ziaiad7a dId8d	�Z!dJd9d
�Z"dKd:d�Z#d;d�Z$d<d�Z%d=d
�Z&d>d�Z'd?d�Z(d@d�Z)dAd�Z*dBd�Z+dCd�Z,dDd�Z-dEd�Z.dFd�Z/eZ0dS)La�Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.

I18N refers to the operation by which a program is made aware of multiple
languages.  L10N refers to the adaptation of your program, once
internationalized, to the local language and cultural habits.

�N�NullTranslations�GNUTranslations�Catalog�find�translation�install�
textdomain�bindtextdomain�bind_textdomain_codeset�dgettext�	dngettext�gettext�lgettext�	ldgettext�
ldngettext�	lngettext�ngettext�pgettext�	dpgettext�	npgettext�
dnpgettextZshare�localea�
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccsPt�t|�D]8}|j}|dkr q|�|�}|dkr>td|��|VqdVdS)NZWHITESPACESZINVALIDz invalid token in plural form: %s�)�re�finditer�_token_pattern�	lastgroup�group�
ValueError)�pluralZmoZkind�value�r!�/usr/lib64/python3.8/gettext.py�	_tokenizeWs
r#cCs|rtd|�Std�SdS)Nz#unexpected token in plural form: %szunexpected end of plural form)r)r r!r!r"�_errorbsr$))�||)�&&)z==z!=)�<�>z<=z>=)�+�-)�*�/�%cCs i|]\}}|D]
}||�qqSr!r!)�.0�iZops�opr!r!r"�
<dictcomp>ps
r1��or�andz//)r%r&r,���cCs�d}t|�}|dkr&|d7}t|�}q|dkrXt|�\}}d||f}|dkr�td��nP|dkrnd	||f}n:zt|d
�}Wntk
r�t|�d�YnXd||f}t|�}d}|tk�rt|}||krҐq|d
kr�|d
kr�d|}t�||�}t||d�\}	}d|||	f}|}q�||k�r4dk�r@nnd|}|dk�r�|dk�r�t|d�\}
}|dk�rtt|��t|�\}}d|
||f}|dk�r�d|}||fS)Nr�!znot �(z%s(%s)�)z%unbalanced parenthesis in plural form�nz%s%s�
z%s%d�d)��z(%s)r2z%s %s %sr=�?r�:z%s if %s else %s)�next�_parser�intr$�_binary_ops�	_c2py_ops�get)�tokensZpriority�result�nexttok�subr �jr/r0�rightZif_trueZif_falser!r!r"rAssP




rAcCsZzt|�}Wn(tk
r4td|jjf�d�YnXddl}|�d|jjftd�|S)Nz'Plural value must be an integer, got %srr=)�round�	TypeError�	__class__�__name__�warnings�warn�DeprecationWarning)r9r/rPr!r!r"�_as_int�s ����rScCs�t|�dkrtd��z|tt|��\}}|r2t|��d}|D]6}|dkr`|d7}|dkrptd��q:|dkr:|d8}q:d	ti}td
||�|dWStk
r�td��YnXdS)
z�Gets a C expression as used in PO files for plural forms and returns a
    Python function that implements an equivalent expression.
    i�z"plural form expression is too longrr7r2�z%plural form expression is too complexr8rSz�if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            �funcN)�lenrrAr#r$rS�exec�RecursionError)rrGrHZdepth�c�nsr!r!r"�c2py�s.

��
r[c
Cs4t�|�}d}d}d}d}|�d�}|dkrN||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|}	g}
t|d�D]P}||@s�|	}||@r�||7}||@�r
||7}||@�r||7}|
�|�q�|
��|
S)	Nr2�r=r�@r�.�_)rZ	normalizer�range�append�reverse)
ZlocZCOMPONENT_CODESETZCOMPONENT_TERRITORYZCOMPONENT_MODIFIER�mask�posZmodifier�codesetZ	territoryZlanguageZretr/�valr!r!r"�_expand_lang�sJ









rgc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zddd�ZdS) rNcCs.i|_d|_d|_d|_|dk	r*|�|�dS�N)�_info�_charset�_output_charset�	_fallbackrA��self�fpr!r!r"�__init__�szNullTranslations.__init__cCsdSrhr!rmr!r!r"rAszNullTranslations._parsecCs|jr|j�|�n||_dSrh)rl�add_fallback)rn�fallbackr!r!r"rq
szNullTranslations.add_fallbackcCs|jr|j�|�S|Srh)rlr
)rn�messager!r!r"r
szNullTranslations.gettextc
Csrddl}|�dtd�|jrR|���(|�ddt�|j�|�W5QR�SQRX|jrd|�|j�S|�t	�
��S)Nr�/lgettext() is deprecated, use gettext() insteadr\�ignore�.*\blgettext\b.*)rPrQrRrl�catch_warnings�filterwarningsrrk�encoder�getpreferredencoding)rnrsrPr!r!r"rs�
�zNullTranslations.lgettextcCs*|jr|j�|||�S|dkr"|S|SdS�Nr2)rlr)rn�msgid1�msgid2r9r!r!r"r"s
zNullTranslations.ngettextc
Cs�ddl}|�dtd�|jrV|���,|�ddt�|j�|||�W5QR�SQRX|dkrd|}n|}|jrz|�|j�S|�t	�
��S)Nr�1lngettext() is deprecated, use ngettext() insteadr\ru�.*\blngettext\b.*r2)rPrQrRrlrwrxrrkryrrz�rnr|r}r9rP�tmsgr!r!r"r*s"�
�"zNullTranslations.lngettextcCs|jr|j�||�S|Srh)rlr)rn�contextrsr!r!r"r;szNullTranslations.pgettextcCs,|jr|j�||||�S|dkr$|S|SdSr{)rlr)rnr�r|r}r9r!r!r"r@s
zNullTranslations.npgettextcCs|jSrh)ri�rnr!r!r"�infoHszNullTranslations.infocCs|jSrh)rjr�r!r!r"�charsetKszNullTranslations.charsetcCsddl}|�dtd�|jS)Nrzoutput_charset() is deprecatedr\�rPrQrRrk)rnrPr!r!r"�output_charsetNs�zNullTranslations.output_charsetcCs ddl}|�dtd�||_dS)Nrz"set_output_charset() is deprecatedr\r�)rnr�rPr!r!r"�set_output_charsetTs�z#NullTranslations.set_output_charsetcCsRddl}|j|jd<|dk	rNddddddh}|t|�@D]}t||�|j|<q8dS)	Nrr_r
rrrrr)�builtinsr
�__dict__�set�getattr)rn�namesr�Zallowed�namer!r!r"rZs�zNullTranslations.install)N)N)rO�
__module__�__qualname__rprArqr
rrrrrr�r�r�r�rr!r!r!r"r�s

c@s\eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)rl�*l�$<z%s%s)rr2cCs|d?|d@fS)z/Returns a tuple of major version, minor version�i��r!)rn�versionr!r!r"�
_get_versionspszGNUTranslations._get_versionsc"Cs�ddlm}t|dd�}i|_}dd�|_|��}t|�}|d|dd	��d}||jkr||d
|d	d��\}}	}
}d}n6||jkr�|d
|d	d��\}}	}
}d}nt	dd|��|�
|�\}
}|
|jkr�t	ddt|
�|��t
d|	�D�]}||||
|
d��\}}||}|||||d��\}}||}||k�r`||k�r`|||�}|||�}nt	dd|��|dk�rld}|�d�D]�}|����}|�s��q�|�d��r�|�d��r��q�d}}d|k�r|�dd�\}}|����}|��}||j|<|}n|�r|j|d|7<|dk�r8|�d�d|_n0|dk�r�|�d�}|d�d�d}t|�|_�q�|j�pvd}d|k�r�|�d�\}} |�d�}t||�}t|�D]\}}!t|!|�|||f<�q�nt||�|t||�<|
d7}
|d7}q�dS)z8Override this method to support alternative .mo formats.r)�unpackr�rcSst|dk�Sr{)rB)r9r!r!r"�<lambda>}�z(GNUTranslations._parse.<locals>.<lambda>z<INr=z<4IrTz<IIz>4Iz>IIzBad magic numberzBad version number �zFile is corrupt�
z	#-#-#-#-#r?r2�
zcontent-typezcharset=zplural-forms�;zplural=�ascii�)Zstructr�r��_catalogr�readrV�LE_MAGIC�BE_MAGIC�OSErrorr��VERSIONS�strr`�split�decode�strip�
startswith�endswith�lowerrirjr[�	enumerate)"rnror��filenameZcatalogZbufZbuflen�magicr�ZmsgcountZ	masteridxZtransidxZiiZ
major_versionZ
minor_versionr/ZmlenZmoffZmendZtlenZtoffZtend�msgr�ZlastkZb_item�item�k�vrr�r|r}�xr!r!r"rAtsv














zGNUTranslations._parsecCshddl}|�dtd�t�}|j�||�}||krH|jrD|j�|�S|}|jrZ|�	|j�S|�	t
���S)Nrrtr\)rPrQrR�objectr�rErlrrkryrrz)rnrsrP�missingr�r!r!r"r�s�zGNUTranslations.lgettextcCs�ddl}|�dtd�z|j||�|�f}Wn@tk
rn|jrX|j�|||�YS|dkrf|}n|}YnX|jr�|�	|j�S|�	t
���S)Nrr~r\r2)rPrQrRr�r�KeyErrorrlrrkryrrzr�r!r!r"r�s �
zGNUTranslations.lngettextcCs6t�}|j�||�}||kr2|jr.|j�|�S|S|Srh)r�r�rErlr
)rnrsr�r�r!r!r"r
�szGNUTranslations.gettextcCs^z|j||�|�f}Wn@tk
rX|jrB|j�|||�YS|dkrP|}n|}YnX|Sr{)r�rr�rlr)rnr|r}r9r�r!r!r"r�s
zGNUTranslations.ngettextcCsF|j||f}t�}|j�||�}||krB|jr>|j�||�S|S|Srh)�CONTEXTr�r�rErlr)rnr�rs�ctxt_msg_idr�r�r!r!r"rszGNUTranslations.pgettextc	Csn|j||f}z|j||�|�f}WnBtk
rh|jrR|j�||||�YS|dkr`|}n|}YnX|Sr{)r�r�rr�rlr)rnr�r|r}r9r�r�r!r!r"rs
zGNUTranslations.npgettextN)rOr�r�r�r�r�r�r�rArrr
rrrr!r!r!r"rdsY	
FcCs�|dkrt}|dkrRg}dD]"}tj�|�}|r|�d�}q@qd|krR|�d�g}|D]$}t|�D]}||krf|�|�qfqZ|r�g}	nd}	|D]J}|dkr�q�tj�||dd|�}
tj�	|
�r�|r�|	�|
�q�|
Sq�|	S)N)ZLANGUAGE�LC_ALL�LC_MESSAGESZLANGr?�Cr�z%s.mo)
�_default_localedir�os�environrEr�rarg�path�join�exists)�domain�	localedir�	languages�allZenvarrfZnelangsZlangZnelangrG�mofiler!r!r"rs8


Zunspecifiedc
Cs|dkrt}t|||dd�}|sB|r*t�Sddlm}t|d|��d}|D]�}	|tj�|	�f}
t	�
|
�}|dkr�t|	d��}t	�|
||��}W5QRXddl
}
|
�
|�}|tk	r�ddl}|�dtd�|r�|���|�d	d
t�|�|�W5QRX|dk�r|}qJ|�|�qJ|S)NT)r�r)�ENOENTz$No translation file found for domain�rbzparameter codeset is deprecatedr\ruz.*\bset_output_charset\b.*)rrr�errnor��FileNotFoundErrorr�r��abspath�
_translationsrE�open�
setdefault�copy�_unspecifiedrPrQrRrwrxr�rq)r�r�r�Zclass_rrreZmofilesr�rGr��key�tror�rPr!r!r"rCsH�

�
�
cCst||d|d�}|�|�dS)NT)rrre)rr)r�r�rer�r�r!r!r"rnsZmessagescCs|dk	r|atSrh)�_current_domain)r�r!r!r"r|scCs|dk	r|t|<t�|t�Srh)�_localedirsrEr�)r�r�r!r!r"r	�scCs0ddl}|�dtd�|dk	r&|t|<t�|�S)Nrz'bind_textdomain_codeset() is deprecatedr\)rPrQrR�_localecodesetsrE)r�rerPr!r!r"r
�s�cCs:zt|t�|d��}Wntk
r.|YSX|�|�Srh)rr�rEr�r
)r�rsr�r!r!r"r�s

c
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn&t	k
r�|�
|pzt���YSX|���&|�ddt�|�
|�W5QR�SQRXdS)Nrz1ldgettext() is deprecated, use dgettext() insteadr\ru�.*\bparameter codeset\b.*�rerv)rPrQrRr�rErwrxrr�r�ryrrzr)r�rsrPrer�r!r!r"r�s&�

�$
�cCsRzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�|||�Sr{)rr�rEr�r)r�r|r}r9r�r!r!r"r�sc
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn8t	k
r�|dkrz|}n|}|�
|p�t���YSX|���*|�ddt�|�
|||�W5QR�SQRXdS)	Nrz3ldngettext() is deprecated, use dngettext() insteadr\rur�r�r2r)rPrQrRr�rErwrxrr�r�ryrrzr)r�r|r}r9rPrer�r�r!r!r"r�s,�

�$
�cCs<zt|t�|d��}Wntk
r.|YSX|�||�Srh)rr�rEr�r)r�r�rsr�r!r!r"r�s

cCsTzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�||||�Sr{)rr�rEr�r)r�r�r|r}r9r�r!r!r"r�scCs
tt|�Srh)rr�)rsr!r!r"r
�sc
CsNddl}|�dtd�|���&|�ddt�tt|�W5QR�SQRXdS)Nrrtr\ruz.*\bldgettext\b.*)rPrQrRrwrxrr�)rsrPr!r!r"r�s�
�cCstt|||�Srh)rr�)r|r}r9r!r!r"r�sc
CsRddl}|�dtd�|���*|�ddt�tt|||�W5QR�SQRXdS)Nrr~r\ruz.*\bldngettext\b.*)rPrQrRrwrxrr�)r|r}r9rPr!r!r"r�s�
�cCstt||�Srh)rr�)r�rsr!r!r"r�scCstt||||�Srh)rr�)r�r|r}r9r!r!r"r�s)r5)NNF)N)N)N)1�__doc__rr�r�sys�__all__r�r��base_prefixr��compile�VERBOSE�DOTALLrr#r$rCr�rDrArSr[rgrrrr�r�rrr�r�r�rr	r
rrrrrrr
rrrrrrr!r!r!r"�<module>s�0�
�

1$*f7
&�
+




	
calendar.cpython-38.pyc000064400000064672151450073350010767 0ustar00U

e5da�@s4dZddlZddlZddlZddlmZdddddd	d
ddd
ddddddddddddddgZeZ	Gdd�de�Z
Gdd�de�ZdZdZ
dd d!d d"d d"d d d"d d"d g
ZGd#d$�d$�ZGd%d&�d&�Zed'�Zed(�Zed)�Zed*�Zed+�\ZZZZZZZd,d�Zd-d	�Zd.d
�Zd/d�Z d0d1�Z!d2d3�Z"d4d5�Z#Gd6d�de$�Z%Gd7d�de%�Z&Gd8d�de%�Z'Gd9d:�d:�Z(Gd;d�de&�Z)Gd<d�de'�Z*e&�Z+e+j,Z-d=d�Z.e+j/Z0e+j1Z1e+j2Z3e+j4Z5e+j6Z6e+j7Z8e+j9Z:e+j;Z<d>Z=d?Z>e=e>fd@dA�Z?e=e>fdBdC�Z@dDZAe�BeAdd��C�ZDdEd�ZEdFdG�ZFeGdHk�r0eFejH�dS)Ia$Calendar printing functions

Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday).�N)�repeat�IllegalMonthError�IllegalWeekdayError�setfirstweekday�firstweekday�isleap�leapdays�weekday�
monthrange�
monthcalendar�prmonth�month�prcal�calendar�timegm�
month_name�
month_abbr�day_name�day_abbr�Calendar�TextCalendar�HTMLCalendar�LocaleTextCalendar�LocaleHTMLCalendar�
weekheaderc@seZdZdd�Zdd�ZdS)rcCs
||_dS�N�r
)�selfr
�r� /usr/lib64/python3.8/calendar.py�__init__szIllegalMonthError.__init__cCs
d|jS)Nz!bad month number %r; must be 1-12r�rrrr�__str__szIllegalMonthError.__str__N��__name__�
__module__�__qualname__r r"rrrrrsc@seZdZdd�Zdd�ZdS)rcCs
||_dSr�r	)rr	rrrr  szIllegalWeekdayError.__init__cCs
d|jS)Nz7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)r'r!rrrr""szIllegalWeekdayError.__str__Nr#rrrrrs�����c@sFeZdZdd�ed�D�Ze�ddd��dd�Zd	d
�Zdd�Zd
S)�_localized_monthcCs g|]}t�d|dd�j�qS�i�r(��datetime�date�strftime��.0�irrr�
<listcomp>4sz_localized_month.<listcomp>�rcCsdS)N�r)�xrrr�<lambda>5�z_localized_month.<lambda>cCs
||_dSr��format�rr=rrrr 7sz_localized_month.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<�r4�fr!rrr6=sz0_localized_month.__getitem__.<locals>.<listcomp>)�_months�
isinstance�slicer=�rr5Zfuncsrr!r�__getitem__:s

z_localized_month.__getitem__cCsdS)N�
rr!rrr�__len__Asz_localized_month.__len__N)	r$r%r&�rangerA�insertr rErGrrrrr-2s
r-c@s6eZdZdd�ed�D�Zdd�Zdd�Zdd	�Zd
S)�_localized_daycCs g|]}t�dd|d�j�qSr.r/r3rrrr6Hsz_localized_day.<listcomp>�cCs
||_dSrr<r>rrrr Jsz_localized_day.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<r?r!rrr6Psz._localized_day.__getitem__.<locals>.<listcomp>)�_daysrBrCr=rDrr!rrEMs

z_localized_day.__getitem__cCsdS�NrKrr!rrrrGTsz_localized_day.__len__N)r$r%r&rHrLr rErGrrrrrJEsrJz%Az%az%Bz%brKcCs$|ddko"|ddkp"|ddkS)z5Return True for leap years, False for non-leap years.�r�d�r)�yearrrrrdscCs@|d8}|d8}|d|d|d|d|d|dS)zFReturn number of leap years in range [y1, y2).
       Assume y1 <= y2.r(rNrOrPr)Zy1Zy2rrrriscCs8tj|krtjks&nd|d}t�|||���S)zBReturn weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).i�rP)r0ZMINYEARZMAXYEARr1r	)rQr
�dayrrrr	qscCsJd|krdksnt|��t||d�}t||tko>t|�}||fS)zQReturn weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
       year, month.r(r7)rr	�mdays�Februaryr)rQr
�day1�ndaysrrrr
xs
cCst||tkot|�Sr)rSrTr�rQr
rrr�	_monthlen�srXcCs$|dkr|ddfS||dfSdS)Nr(r7rrWrrr�
_prevmonth�srYcCs$|dkr|ddfS||dfSdS)Nr7r(rrWrrr�
_nextmonth�srZc@s�eZdZdZd#dd�Zdd�Zdd�Zeee�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd$dd�Zd%dd�Zd&d d!�Zd"S)'rzo
    Base calendar class. This class doesn't do any formatting. It simply
    provides data to subclasses.
    rcCs
||_dSr�r�rrrrrr �szCalendar.__init__cCs
|jdSrM�Z
_firstweekdayr!rrr�getfirstweekday�szCalendar.getfirstweekdaycCs
||_dSrr]r\rrrr�szCalendar.setfirstweekdayccs&t|j|jd�D]}|dVqdS)zt
        Return an iterator for one week of weekday numbers starting with the
        configured first one.
        rKN)rHr)rr5rrr�iterweekdays�szCalendar.iterweekdaysccs,|�||�D]\}}}t�|||�VqdS)z�
        Return an iterator for one month. The iterator will yield datetime.date
        values and will always iterate through complete weeks, so it will yield
        dates outside the specified month.
        N)�itermonthdays3r0r1)rrQr
�y�m�drrr�itermonthdates�szCalendar.itermonthdatesccsft||�\}}||jd}td|�EdHtd|d�EdH|j||d}td|�EdHdS)z�
        Like itermonthdates(), but will yield day numbers. For days outside
        the specified month the day number is 0.
        rKrNr()r
rrrH)rrQr
rUrV�days_before�
days_afterrrr�
itermonthdays�szCalendar.itermonthdaysccs0t|�||�|j�D]\}}||dfVqdS)z�
        Like itermonthdates(), but will yield (day number, weekday number)
        tuples. For days outside the specified month the day number is 0.
        rKN)�	enumeratergr)rrQr
r5rcrrr�itermonthdays2�szCalendar.itermonthdays2ccs�t||�\}}||jd}|j||d}t||�\}}t||�d}	t|	||	�D]}
|||
fVqXtd|d�D]}
|||
fVqxt||�\}}td|d�D]}
|||
fVq�dS)z�
        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
        used for dates outside of datetime.date range.
        rKr(N)r
rrYrXrHrZ)rrQr
rUrVrerfrarb�endrcrrrr`�szCalendar.itermonthdays3ccs<t|�||��D]&\}\}}}||||j|dfVqdS)z�
        Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.
        Can be used for dates outside of datetime.date range.
        rKN)rhr`r)rrQr
r5rarbrcrrr�itermonthdays4�szCalendar.itermonthdays4cs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix (list of lists) representing a month's calendar.
        Each row represents a week; week entries are datetime.date values.
        csg|]}�||d��qS�rKrr3�Zdatesrrr6�sz/Calendar.monthdatescalendar.<locals>.<listcomp>rrK)�listrdrH�len�rrQr
rrmr�monthdatescalendar�szCalendar.monthdatescalendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; week entries are
        (day number, weekday number) tuples. Day numbers outside this month
        are zero.
        csg|]}�||d��qSrlrr3��daysrrr6�sz/Calendar.monthdays2calendar.<locals>.<listcomp>rrK)rnrirHrorprrrr�monthdays2calendar�szCalendar.monthdays2calendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; days outside this month are zero.
        csg|]}�||d��qSrlrr3rrrrr6�sz.Calendar.monthdayscalendar.<locals>.<listcomp>rrK)rnrgrHrorprrrr�monthdayscalendar�szCalendar.monthdayscalendar�cs>��fdd�tttd�D����fdd�tdt����D�S)a'
        Return the data for the specified year ready for formatting. The return
        value is a list of month rows. Each month row contains up to width months.
        Each month contains between 4 and 6 weeks and each week contains 1-7
        days. Days are datetime.date objects.
        csg|]}���|��qSr)rqr3�rrQrrr6s�z.Calendar.yeardatescalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3��months�widthrrr6	sr�rH�Januaryro�rrQrzr�ryrrzrQr�yeardatescalendar�s�zCalendar.yeardatescalendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are
        (day number, weekday number) tuples. Day numbers outside this month are
        zero.
        csg|]}���|��qSr)rtr3rwrrr6s�z.Calendar.yeardays2calendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6srr{r}rr~r�yeardays2calendars�zCalendar.yeardays2calendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are day numbers.
        Day numbers outside this month are zero.
        csg|]}���|��qSr)rur3rwrrr6s�z-Calendar.yeardayscalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6"srr{r}rr~r�yeardayscalendars�zCalendar.yeardayscalendarN)r)rv)rv)rv)r$r%r&�__doc__r r^r�propertyrr_rdrgrir`rkrqrtrurr�r�rrrrr�s"

	



c@sjeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Z	ddd�Z
ddd�Zd dd�Zd!dd�Z
dS)"rzr
    Subclass of Calendar that outputs a calendar as a simple plain text
    similar to the UNIX program cal.
    cCst|�||�dd�dS)z3
        Print a single week (no newline).
        r8�rjN)�print�
formatweek�r�theweekrzrrr�prweek+szTextCalendar.prweekcCs |dkrd}nd|}|�|�S)z*
        Returns a formatted day.
        rr8z%2i��center)rrRr	rz�srrr�	formatday1szTextCalendar.formatdaycsd���fdd�|D��S)zA
        Returns a single week in a string (no newline).
        � c3s |]\}}��||��VqdSr�r��r4rcZwd�rrzrr�	<genexpr>?sz*TextCalendar.formatweek.<locals>.<genexpr>��joinr�rr�rr�;szTextCalendar.formatweekcCs(|dkrt}nt}||d|��|�S)z4
        Returns a formatted week day name.
        �	N)rrr�)rrRrz�namesrrr�
formatweekdayAszTextCalendar.formatweekdaycsd���fdd����D��S)z-
        Return a header for a week.
        r�c3s|]}��|��VqdSr�r�r3r�rrr�Osz0TextCalendar.formatweekheader.<locals>.<genexpr>�r�r_r�rr�r�formatweekheaderKszTextCalendar.formatweekheaderTcCs"t|}|rd||f}|�|�S)z0
        Return a formatted month name.
        �%s %r)rr��r�theyear�themonthrz�withyearr�rrr�formatmonthnameQszTextCalendar.formatmonthnamercCst|�||||�dd�dS)z+
        Print a month's calendar.
        r8r�N)r��formatmonth)rr�r��w�lrrrrZszTextCalendar.prmonthcCs�td|�}td|�}|�||d|dd�}|��}|d|7}||�|���7}|d|7}|�||�D]$}||�||���7}|d|7}ql|S)z@
        Return a month's calendar string (multi-line).
        r)r(rK�
)�maxr��rstripr�rtr�)rr�r�r�r�r��weekrrrr�`s

zTextCalendar.formatmonthr)r(�rvc	s�td|�}td|�}td|�}|ddd�g}|j}|t����|||d����|d|���|��t���|��D�]"\}}	t||dt	||ddd��}
|d|����fdd�|
D�}|t
|�|����|d|��fdd�|
D�}|t
|�|����|d|�td	d�|	D��}
t|
�D]f}g}|	D]6}|t|�k�rj|�d
�n|���|||���qL|t
|�|����|d|��q@q�d
�
|�S)zC
        Returns a year's calendar as a multi-line string.
        r)r(rKr�rFc3s|]}���|�d�VqdS)FN)r��r4�k)�colwidthrr�rrr��s�z*TextCalendar.formatyear.<locals>.<genexpr>c3s|]
}�VqdSrrr�)�headerrrr��scss|]}t|�VqdSr)ro)r4�calrrrr��sr8)r��append�reprr�r�r�rhr�rH�min�formatstringror�r�)rr�r�r��crb�v�ar5�rowryr�ZheadersZheight�jZweeksr�r)r�r�rr�r�
formatyearps<


&
$�zTextCalendar.formatyearcCst|�|||||�dd�dS)zPrint a year's calendar.r8r�N)r�r�)rr�r�r�r�rbrrr�pryear�szTextCalendar.pryearN)T)rr)rr)r)r(r�rv)rrr�rv)r$r%r&r�r�r�r�r�r�r�rr�r�r�rrrrr%s


	


%c@s�eZdZdZdddddddgZeZd	Zd
Zd
ZdZ	dZ
dd
�Zdd�Zdd�Z
dd�Zd dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$rz4
    This calendar returns complete HTML pages.
    ZmonZtueZwedZthuZfriZsatZsunZnodayr
rQcCs(|dkrd|jSd|j||fSdS)z/
        Return a day as a table cell.
        rz<td class="%s">&nbsp;</td>z<td class="%s">%d</td>N)�cssclass_noday�
cssclasses)rrRr	rrrr��s
zHTMLCalendar.formatdaycs d��fdd�|D��}d|S)z8
        Return a complete week as a table row.
        r8c3s|]\}}��||�VqdSrr�r�r!rrr��sz*HTMLCalendar.formatweek.<locals>.<genexpr>�<tr>%s</tr>r�)rr�r�rr!rr��szHTMLCalendar.formatweekcCsd|j|t|fS)z:
        Return a weekday name as a table header.
        �<th class="%s">%s</th>)�cssclasses_weekday_headr)rrRrrrr��s�zHTMLCalendar.formatweekdaycs$d��fdd����D��}d|S)z<
        Return a header for a week as a table row.
        r8c3s|]}��|�VqdSrr�r3r!rrr��sz0HTMLCalendar.formatweekheader.<locals>.<genexpr>r�r�)rr�rr!rr��szHTMLCalendar.formatweekheaderTcCs0|rdt||f}ndt|}d|j|fS)z5
        Return a month name as a table row.
        �%s %sz%sz+<tr><th colspan="7" class="%s">%s</th></tr>)r�cssclass_month_head�rr�r�r�r�rrrr��s�zHTMLCalendar.formatmonthnamecCs�g}|j}|d|j�|d�||j|||d��|d�||���|d�|�||�D]}||�|��|d�q\|d�|d�d�|�S)z6
        Return a formatted month as a table.
        �=<table border="0" cellpadding="0" cellspacing="0" class="%s">r��r��</table>r8)r��cssclass_monthr�r�rtr�r�)rr�r�r�r�r�r�rrrr��s �
zHTMLCalendar.formatmonthrvcCs�g}|j}t|d�}|d|j�|d�|d||j|f�tttd|�D]V}t|t||d��}|d�|D](}|d�||j||d	d
��|d�qr|d�qN|d
�d�|�S)z?
        Return a formatted year as a table of tables.
        r(r�r�z,<tr><th colspan="%d" class="%s">%s</th></tr>r7rFz<tr>z<td>Fr�z</td>z</tr>r�r8)	r�r��
cssclass_year�cssclass_year_headrHr|r�r�r�)rr�rzr�r�r5ryrbrrrr��s,
��

zHTMLCalendar.formatyear�calendar.cssNcCs�|dkrt��}g}|j}|d|�|d�|d�|d�|d|�|dk	r^|d|�|d|�|d	�|d
�||�||��|d�|d�d
�|��|d�S)zB
        Return a formatted year as a complete HTML page.
        Nz$<?xml version="1.0" encoding="%s"?>
zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
z<html>
z<head>
zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />
z4<link rel="stylesheet" type="text/css" href="%s" />
z<title>Calendar for %d</title>
z</head>
z<body>
z</body>
z</html>
r8�xmlcharrefreplace)�sys�getdefaultencodingr�r�r��encode)rr�rz�css�encodingr�r�rrr�formatyearpage
s$zHTMLCalendar.formatyearpage)T)T)rv)rvr�N)r$r%r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�s 



c@s$eZdZdd�Zdd�Zdd�ZdS)�different_localecCs
||_dSr��locale)rr�rrrr #szdifferent_locale.__init__cCs"t�tj�|_t�tj|j�dSr)�_localeZ	getlocale�LC_TIME�	oldlocale�	setlocaler�r!rrr�	__enter__&szdifferent_locale.__enter__cGst�tj|j�dSr)r�r�r�r�)r�argsrrr�__exit__*szdifferent_locale.__exit__N)r$r%r&r r�r�rrrrr�"sr�c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
r�
    This class can be passed a locale name in the constructor and will return
    month and weekday names in the specified locale. If this locale includes
    an encoding all strings containing month and weekday names will be returned
    as unicode.
    rNcCs&t�||�|dkrt��}||_dSr)rr r��getdefaultlocaler��rrr�rrrr 6szLocaleTextCalendar.__init__c
CsNt|j��:|dkrt}nt}||}|d|��|�W5QR�SQRXdS)Nr�)r�r�rrr�)rrRrzr��namerrrr�<sz LocaleTextCalendar.formatweekdayTc
CsDt|j��0t|}|r$d||f}|�|�W5QR�SQRXdS)Nr�)r�r�rr�r�rrrr�Es
z"LocaleTextCalendar.formatmonthname)rN)T�r$r%r&r�r r�r�rrrrr.s
	c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
rr�rNcCs&t�||�|dkrt��}||_dSr)rr r�r�r�r�rrrr TszLocaleHTMLCalendar.__init__c
Cs<t|j��(t|}d|j||fW5QR�SQRXdS)Nr�)r�r�rr�)rrRr�rrrr�Zsz LocaleHTMLCalendar.formatweekdayTc
CsBt|j��.t|}|r$d||f}d|W5QR�SQRXdS)Nr�z.<tr><th colspan="7" class="month">%s</th></tr>)r�r�rr�rrrr�_s
z"LocaleHTMLCalendar.formatmonthname)rN)Tr�rrrrrMs
cCs(t|krtksnt|��|t_dSr)�MONDAY�SUNDAYrr�rr[rrrrls�r�cCstt|||��dS)z1Prints multi-column formatting for year calendarsN)r�r��Zcolsr��spacingrrrr=�sr=cs |d9}|��fdd�|D��S)zEReturns a string formatted from n strings, centered within n columns.r�c3s|]}|���VqdSrr�)r4r��r�rrr��szformatstring.<locals>.<genexpr>r�r�rr�rr��sr�i�cCs^|dd�\}}}}}}t�||d���t|d}|d|}|d|}	|	d|}
|
S)zBUnrelated but handy function to calculate Unix timestamp from GMT.Nr�r(��<)r0r1�	toordinal�
_EPOCH_ORD)�tuplerQr
rRZhourZminute�secondrsZhoursZminutesZsecondsrrrr�scCs�ddl}|��}|�d�}|�d�}|jddtddd�|jd	d
tddd�|jd
dtddd�|jddtddd�|jddddd�|jddddd�|jddddd�|jd d!d"d#d$d%�|jd&d'td(d)�|jd*d'td+d)�|�|dd��}|j�r|j�s|�d,�t	�
d�|j|jf}|jd-k�r�|j�rDt|d.�}nt
�}|j}|dk�rbt	��}t||jd/�}	t	jjj}
|jdk�r�|
|jtj��jf|	��n6|jdk�r�|
|j|jf|	��n|�d0�t	�
d�n�|j�r�t|d.�}nt�}t|j|jd1�}	|jdk�r$|j|	d2<|j|	d3<|jdk�rH|j tj��jf|	�}n2|jdk�rf|j |jf|	�}n|j!|j|jf|	�}t	jj}
|j�r�|�"|j�}t	jjj}
|
|�dS)4Nrztext only argumentszhtml only argumentsz-wz--widthr)z width of date column (default 2))�type�default�helpz-lz--linesr(z)number of lines for each week (default 1)z-sz	--spacingr�z"spacing between months (default 6)z-mz--monthsrvzmonths per row (default 3)z-cz--cssr�zCSS to use for page)r�r�z-Lz--localez.locale to be used from month and weekday namesz-ez
--encodingzencoding to use for outputz-tz--type�text)r��htmlzoutput type (text or html))r��choicesr�rQ�?zyear number (1-9999))�nargsr�r�r
zmonth number (1-12, text only)z/if --locale is specified --encoding is requiredr�r�)r�r�zincorrect number of arguments)r�r�r�rb)#�argparse�ArgumentParserZadd_argument_group�add_argument�int�
parse_argsr�r��errorr��exitr�rrr��dictr��stdout�buffer�writerQr�r0r1Ztodayr
rrrz�linesr�ryr�r�r�)r�r��parserZ	textgroupZ	htmlgroupZoptionsr�r�r�Zoptdictr��resultrrr�main�s�

����������







r�__main__)Ir�r�r0r�r��	itertoolsr�__all__�
ValueErrorr�rrr|rTrSr-rJrrrrrHr�ZTUESDAYZ	WEDNESDAYZTHURSDAYZFRIDAYZSATURDAYr�rrr	r
rXrYrZ�objectrrrr�rrr�r^rrrurr�r�r�r�rrr�r
r�rr�rZ	_colwidthZ_spacingr=r�ZEPOCHr1r�r�rrr$�argvrrrr�<module>s��
u	
h
sre_constants.cpython-38.pyc000064400000014331151450073350012066 0ustar00U

e5d��@sDdZdZddlmZmZGdd�de�ZGdd�de�Zeed�Zd	d
�Z	e	d�Z
e
dd
�=e	d�Ze	d�Ze
eeeiZe
eeeiZe
eeeiZeeeeiZeeee iZ!ee"ee#iZ$e%e%e&e&e'e'e(e(e)e*e+e,e-e-e.e.iZ/e%e0e&e1e'e2e(e3e)e4e+e5e-e6e.e7iZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCdZDeEdk�r@dd�ZFeGdd���ZHeH�Id�eH�Ide�eFeHe
d �eFeHed!�eFeHed!�eH�Id"e9�eH�Id#e:�eH�Id$e;�eH�Id%e<�eH�Id&e=�eH�Id'e>�eH�Id(e?�eH�Id)e@�eH�Id*eA�eH�Id+eB�eH�Id,eC�eH�Id-eD�W5QRXeJd.�d
S)/zInternal support module for srei��3�)�	MAXREPEAT�	MAXGROUPScs&eZdZdZdZd�fdd�	Z�ZS)�erroraiException raised for invalid regular expressions.

    Attributes:

        msg: The unformatted error message
        pattern: The regular expression pattern
        pos: The index in the pattern where compilation failed (may be None)
        lineno: The line corresponding to pos (may be None)
        colno: The column corresponding to pos (may be None)
    �reNcs�||_||_||_|dk	r�|dk	r�d||f}t|t�r>d}nd}|�|d|�d|_||�|d|�|_||kr�d||j|jf}nd|_|_t	��
|�dS)Nz%s at position %d�
�
r�z%s (line %d, column %d))�msg�pattern�pos�
isinstance�str�count�lineno�rfind�colno�super�__init__)�selfr	r
r�newline��	__class__��%/usr/lib64/python3.8/sre_constants.pyr%s
zerror.__init__)NN)�__name__�
__module__�__qualname__�__doc__r�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�_NamedIntConstantcstt|��||�}||_|S�N)rr�__new__�name)�cls�valuer"rrrrr!9sz_NamedIntConstant.__new__cCs|jSr �r")rrrr�__repr__>sz_NamedIntConstant.__repr__)rrrr!r&rrrrrr8srrcCs8|����}dd�t|�D�}t��dd�|D��|S)NcSsg|]\}}t||��qSr)r)�.0�ir"rrr�
<listcomp>Esz_makecodes.<locals>.<listcomp>cSsi|]}|j|�qSrr%)r'�itemrrr�
<dictcomp>Fsz_makecodes.<locals>.<dictcomp>)�strip�split�	enumerate�globals�update)�names�itemsrrr�
_makecodesCsr3az
    FAILURE SUCCESS

    ANY ANY_ALL
    ASSERT ASSERT_NOT
    AT
    BRANCH
    CALL
    CATEGORY
    CHARSET BIGCHARSET
    GROUPREF GROUPREF_EXISTS
    IN
    INFO
    JUMP
    LITERAL
    MARK
    MAX_UNTIL
    MIN_UNTIL
    NOT_LITERAL
    NEGATE
    RANGE
    REPEAT
    REPEAT_ONE
    SUBPATTERN
    MIN_REPEAT_ONE

    GROUPREF_IGNORE
    IN_IGNORE
    LITERAL_IGNORE
    NOT_LITERAL_IGNORE

    GROUPREF_LOC_IGNORE
    IN_LOC_IGNORE
    LITERAL_LOC_IGNORE
    NOT_LITERAL_LOC_IGNORE

    GROUPREF_UNI_IGNORE
    IN_UNI_IGNORE
    LITERAL_UNI_IGNORE
    NOT_LITERAL_UNI_IGNORE
    RANGE_UNI_IGNORE

    MIN_REPEAT MAX_REPEAT
���Nz�
    AT_BEGINNING AT_BEGINNING_LINE AT_BEGINNING_STRING
    AT_BOUNDARY AT_NON_BOUNDARY
    AT_END AT_END_LINE AT_END_STRING

    AT_LOC_BOUNDARY AT_LOC_NON_BOUNDARY

    AT_UNI_BOUNDARY AT_UNI_NON_BOUNDARY
a�
    CATEGORY_DIGIT CATEGORY_NOT_DIGIT
    CATEGORY_SPACE CATEGORY_NOT_SPACE
    CATEGORY_WORD CATEGORY_NOT_WORD
    CATEGORY_LINEBREAK CATEGORY_NOT_LINEBREAK

    CATEGORY_LOC_WORD CATEGORY_LOC_NOT_WORD

    CATEGORY_UNI_DIGIT CATEGORY_UNI_NOT_DIGIT
    CATEGORY_UNI_SPACE CATEGORY_UNI_NOT_SPACE
    CATEGORY_UNI_WORD CATEGORY_UNI_NOT_WORD
    CATEGORY_UNI_LINEBREAK CATEGORY_UNI_NOT_LINEBREAK
r����� �@���__main__cCs*t|�}|D]}|�d|||f�qdS)Nz#define %s_%s %d
)�sorted�write)�f�d�prefixr2r*rrr�dump�srCzsre_constants.h�wao/*
 * Secret Labs' Regular Expression Engine
 *
 * regular expression matching engine
 *
 * NOTE: This file is generated by sre_constants.py.  If you need
 * to change anything in here, edit sre_constants.py and run it.
 *
 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
 *
 * See the _sre.c file for information on usage and redistribution.
 */

z#define SRE_MAGIC %d
ZSRE_OPZSREz#define SRE_FLAG_TEMPLATE %d
z#define SRE_FLAG_IGNORECASE %d
z#define SRE_FLAG_LOCALE %d
z#define SRE_FLAG_MULTILINE %d
z#define SRE_FLAG_DOTALL %d
z#define SRE_FLAG_UNICODE %d
z#define SRE_FLAG_VERBOSE %d
z#define SRE_FLAG_DEBUG %d
z#define SRE_FLAG_ASCII %d
z#define SRE_INFO_PREFIX %d
z#define SRE_INFO_LITERAL %d
z#define SRE_INFO_CHARSET %d
Zdone)Kr�MAGIC�_srerr�	Exceptionr�intrr3�OPCODES�ATCODES�CHCODES�LITERAL�LITERAL_IGNORE�NOT_LITERAL�NOT_LITERAL_IGNORE�	OP_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�OP_LOCALE_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�OP_UNICODE_IGNORE�AT_BEGINNINGZAT_BEGINNING_LINE�AT_ENDZAT_END_LINE�AT_MULTILINEZAT_BOUNDARYZAT_LOC_BOUNDARYZAT_NON_BOUNDARYZAT_LOC_NON_BOUNDARY�	AT_LOCALEZAT_UNI_BOUNDARYZAT_UNI_NON_BOUNDARY�
AT_UNICODEZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_LOC_WORDZCATEGORY_NOT_WORDZCATEGORY_LOC_NOT_WORDZCATEGORY_LINEBREAKZCATEGORY_NOT_LINEBREAK�	CH_LOCALEZCATEGORY_UNI_DIGITZCATEGORY_UNI_NOT_DIGITZCATEGORY_UNI_SPACEZCATEGORY_UNI_NOT_SPACEZCATEGORY_UNI_WORDZCATEGORY_UNI_NOT_WORDZCATEGORY_UNI_LINEBREAKZCATEGORY_UNI_NOT_LINEBREAK�
CH_UNICODE�SRE_FLAG_TEMPLATE�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALL�SRE_FLAG_UNICODE�SRE_FLAG_VERBOSE�SRE_FLAG_DEBUG�SRE_FLAG_ASCII�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSETrrC�openr@r?�printrrrr�<module>s�!	
,
��������

getpass.cpython-38.pyc000064400000010124151450073350010643 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddlZdddgZGdd�de�Zddd	�Z	dd
d�Z
ddd
�Zddd�Zdd�Z
zddlZejejfWnBeefk
r�zddlZWnek
r�eZYnXe
ZYnXe	ZdS)a�Utilities to get a password and/or the current user name.

getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.

GetPassWarning - This UserWarning is issued when getpass() cannot prevent
                 echoing of the password contents while reading.

On Windows, the msvcrt module will be used.

�N�getpass�getuser�GetPassWarningc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/getpass.pyrs�
Password: c
Cs�d}t�����}zJt�dtjtjB�}t�|d�}|�|�t�	|�}|�|�|sX|}Wnpt
k
r�}zR|��ztj
��}Wn&ttfk
r�d}t||�}YnXtj
}|s�tj}W5d}~XYnX|dk	�r�z�t�|�}|dd�}	|	dtjM<tj}
ttd��r|
tjO}
z t�||
|	�t|||d�}W5t�||
|�|��XWn@tjk
�r�|dk	�rz�||k	�r�|��t||�}YnX|�d�|W5QR�SQRXdS)aPrompt for a password, with echo turned off.

    Args:
      prompt: Written on stream to ask for the input.  Default: 'Password: '
      stream: A writable file object to display the prompt.  Defaults to
              the tty.  If no tty is available defaults to sys.stderr.
    Returns:
      The seKr3t input.
    Raises:
      EOFError: If our input tty or stdin was closed.
      GetPassWarning: When we were unable to turn echo off on the input.

    Always restores terminal settings before returning.
    Nz/dev/ttyzw+��TCSASOFT)�input�
)�
contextlib�	ExitStack�os�open�O_RDWR�O_NOCTTY�io�FileIO�
enter_context�
TextIOWrapper�OSError�close�sys�stdin�fileno�AttributeError�
ValueError�fallback_getpass�stderr�termios�	tcgetattrZECHOZ	TCSAFLUSH�hasattrr�	tcsetattr�flush�
_raw_input�error�write)�prompt�streamZpasswd�stack�fdZttyr
�e�old�newZtcsetattr_flagsrrr	�unix_getpasssR








r1cCs�tjtjk	rt||�S|D]}t�|�qd}t��}|dkst|dkrHqt|dkrTt�|dkrj|dd�}q.||}q.t�d�t�d�|S)z9Prompt for password with echo off, using Windows getch().��
r��N���)rr�	__stdin__r �msvcrtZputwchZgetwch�KeyboardInterrupt)r*r+�cZpwrrr	�win_getpassas 



r;cCs0tjdtdd�|stj}td|d�t||�S)Nz%Can not control echo on the terminal.�)�
stacklevelz&Warning: Password input may be echoed.)�file)�warnings�warnrrr!�printr')r*r+rrr	r xs�r r2cCs�|s
tj}|stj}t|�}|rpz|�|�Wn8tk
rf|�|jd�}|�|j�}|�|�YnX|�	�|�
�}|s�t�|ddkr�|dd�}|S)N�replacer6r)rr!r�strr)�UnicodeEncodeError�encode�encoding�decoder&�readline�EOFError)r*r+r
�linerrr	r'�s&r'cCs<dD]}tj�|�}|r|Sqddl}|�t���dS)z�Get the username from the environment or password database.

    First try various environment variables, then the password
    database.  This works on Windows as long as USERNAME is set.

    )ZLOGNAMEZUSERZLNAMEZUSERNAMErN)r�environ�get�pwd�getpwuid�getuid)�name�userrMrrr	r�s
)r
N)r
N)r
N)r2NN)�__doc__rrrrr?�__all__�UserWarningrr1r;r r'rr"r#r%�ImportErrorrr8rrrrr	�<module>s,

D

	


imp.cpython-38.opt-1.pyc000064400000023123151450073350010724 0ustar00U

e5d()�@s�dZddlmZmZmZmZmZmZmZm	Z	m
Z
zddlmZWnek
rXdZYnXddl
mZmZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejd	ed
d�dZdZd
Z d
Z!dZ"dZ#dZ$dZ%dZ&dZ'dd�Z(dd�Z)dd�Z*d8dd�Z+dd�Z,dd�Z-Gd d!�d!�Z.Gd"d#�d#�Z/Gd$d%�d%e/ej0�Z1d9d&d'�Z2Gd(d)�d)e/e�Z3d:d*d+�Z4d,d-�Z5d.d/�Z6d;d0d1�Z7d2d3�Z8d4d5�Z9e�r�d<d6d7�Z:ndZ:dS)=z�This module provides the components needed to build your own __import__
function.  Undocumented functions are obsolete.

In most cases it is preferred you consider using the importlib module's
functionality over this module.

�)	�	lock_held�acquire_lock�release_lock�get_frozen_object�is_frozen_package�init_frozen�
is_builtin�	is_frozen�_fix_co_filename)�create_dynamicN)�_ERR_MSG�_exec�_load�_builtin_from_name)�SourcelessFileLoader)�	machinery)�utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses�)�
stacklevel��������	cCs
t�|�S)z_**DEPRECATED**

    Create a new module.

    The module is not entered into sys.modules.

    )�types�
ModuleType��name�r!�/usr/lib64/python3.8/imp.py�
new_module0sr#cCstjS)z@**DEPRECATED**

    Return the magic number for .pyc files.
    )r�MAGIC_NUMBERr!r!r!r"�	get_magic;sr%cCstjjS)z$Return the magic tag for .pyc files.)�sys�implementation�	cache_tagr!r!r!r"�get_tagCsr)c
Cs6t���$t�d�t�||�W5QR�SQRXdS)a�**DEPRECATED**

    Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    If debug_override is not None, then it must be a boolean and is used in
    place of sys.flags.optimize.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    �ignoreN)�warnings�catch_warnings�simplefilterr�cache_from_source)�path�debug_overrider!r!r"r.Hs

r.cCs
t�|�S)a~**DEPRECATED**

    Given the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    )r�source_from_cache�r/r!r!r"r1[sr1cCs<dd�tjD�}dd�tjD�}dd�tjD�}|||S)�**DEPRECATED**cSsg|]}|dtf�qS��rb)�C_EXTENSION��.0�sr!r!r"�
<listcomp>ksz get_suffixes.<locals>.<listcomp>cSsg|]}|dtf�qS)�r)�	PY_SOURCEr7r!r!r"r:lscSsg|]}|dtf�qSr4)�PY_COMPILEDr7r!r!r"r:ms)r�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXES)�
extensions�source�bytecoder!r!r"�get_suffixesisrDc@s eZdZdZdd�Zdd�ZdS)�NullImporterz-**DEPRECATED**

    Null import object.

    cCs2|dkrtddd��ntj�|�r.td|d��dS)N�zempty pathnamer2zexisting directory)�ImportError�osr/�isdir)�selfr/r!r!r"�__init__zszNullImporter.__init__cCsdS)zAlways returns None.Nr!)rJ�fullnamer!r!r"�find_module�szNullImporter.find_moduleN)�__name__�
__module__�__qualname__�__doc__rKrMr!r!r!r"rErsrEcs.eZdZdZd�fdd�	Z�fdd�Z�ZS)�_HackedGetDatazMCompatibility support for 'file' arguments of various load_*()
    functions.Ncst��||�||_dS)N)�superrK�file)rJrLr/rT��	__class__r!r"rK�sz_HackedGetData.__init__c
s||jrl||jkrl|jjs0|j}d|jkr0|��|jjrJt|jd�|_}|�|��W5QR�SQRXnt��|�SdS)z;Gross hack to contort loader to deal w/ load_*()'s bad API.�br5N)	rTr/�closed�mode�close�open�readrS�get_data)rJr/rTrUr!r"r]�s
z_HackedGetData.get_data)N)rNrOrPrQrKr]�
__classcell__r!r!rUr"rR�srRc@seZdZdZdS)�_LoadSourceCompatibilityz5Compatibility support for implementing load_source().N�rNrOrPrQr!r!r!r"r_�sr_cCs\t|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t�||�|_	|j	|j
_|S)N��loader)r_r�spec_from_file_locationr&�modulesr
rr�SourceFileLoader�
__loader__�__spec__rb�r �pathnamerTrb�spec�moduler!r!r"�load_source�s

rlc@seZdZdZdS)�_LoadCompiledCompatibilityz7Compatibility support for implementing load_compiled().Nr`r!r!r!r"rm�srmcCsZt|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t||�|_|j|j	_
|S)r3ra)rmrrcr&rdr
rrrfrgrbrhr!r!r"�
load_compiled�s

rncCs�tj�|�rftjdd�tjdd�}|D]*}tj�|d|�}tj�|�r,|}qfq,td�	|���t
j||gd�}|tj
kr�t|tj
|�St|�SdS)r3NrKz{!r} is not a package)�submodule_search_locations)rHr/rIrr?r@�join�exists�
ValueError�formatrrcr&rdr
r)r r/rA�	extensionZ	init_pathrjr!r!r"�load_package�s ��
ruc	
Cs$|\}}}|r0|�d�r d|kr0td�|���n�|dkrX|tthkrXd�|�}t|��n�|tkrlt|||�S|tkr�t|||�S|tkr�tdk	r�|dkr�t	|d��}t|||�W5QR�SQRXnt|||�SnN|t
kr�t||�S|tk�r�t
|�S|tk�rt|�Sd�||�}t||d��dS)	z�**DEPRECATED**

    Load a module, given information returned by find_module().

    The module name must include the full package name, if any.

    )r;�U�+zinvalid file open mode {!r}Nz.file object required for import (type code {})r5z*Don't know how to import {} (type code {})r)�
startswithrrrsr<r=rlrnr6�load_dynamicr[�
PKG_DIRECTORYru�	C_BUILTIN�init_builtin�	PY_FROZENrrG)	r rT�filenameZdetails�suffixrY�type_�msgZopened_filer!r!r"�load_module�s.


 


r�c	Cs�t|t�std�t|����n$t|td�tf�sBtd�t|����|dkr�t|�rbddddtffSt	|�rzddddt
ffStj}|D]�}t
j�||�}dtjdfD]>}d|}t
j�||�}t
j�|�r�d|ddtffSq�t�D]2\}}}||}	t
j�||	�}t
j�|�r��q q�q��q:q�tt�|�|d��d}
d	|k�rnt|d
��}t�|j�d}
W5QRXt|||
d�}|||||ffS)a,**DEPRECATED**

    Search for a module.

    If path is omitted or None, search for a built-in, frozen or special
    module and continue search in sys.path. The module name cannot
    contain '.'; to search for a submodule of a package, pass the
    submodule name and the package's __path__.

    z'name' must be a str, not {}Nz%'path' must be None or a list, not {}rFz.pyrrKrrWr5)�encoding)�
isinstance�str�	TypeErrorrs�type�list�RuntimeErrorrr{r	r}r&r/rHrprr@�isfilerzrDrGrr[�tokenize�detect_encoding�readline)r r/�entryZpackage_directoryrZpackage_file_nameZ	file_pathrYr��	file_namer�rTr!r!r"rM�sB
�
rMcCs
t�|�S)zw**DEPRECATED**

    Reload the module and return it.

    The module must have been successfully imported before.

    )�	importlib�reload)rkr!r!r"r�2sr�cCs&z
t|�WStk
r YdSXdS)zl**DEPRECATED**

    Load and return a built-in module by name, or None is such module doesn't
    exist
    N)rrGrr!r!r"r|=s
r|cCs0ddl}|j�||�}|jj|||d�}t|�S)z:**DEPRECATED**

        Load an extension module.
        rN)r rb�origin)�importlib.machineryr�ExtensionFileLoader�
ModuleSpecr)r r/rTr�rbrjr!r!r"ryJs�ry)N)N)N)N)N);rQ�_imprrrrrrrr	r
rrGZimportlib._bootstraprr
rrZimportlib._bootstrap_externalrr�rrrHr&r�rr+�warn�DeprecationWarningZSEARCH_ERRORr<r=r6ZPY_RESOURCErzr{r}ZPY_CODERESOURCEZIMP_HOOKr#r%r)r.r1rDrErRrer_rlrmrnrur�rMr�r|ryr!r!r!r"�<module>sb,
�
	

#
4cgitb.cpython-38.opt-2.pyc000064400000020551151450073350011232 0ustar00U

e5d@/�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	dd�Z
gZdd�Zdd�Z
dd	�Zd
d�Zdd
�Zddd�Zddd�ZGdd�d�Ze�jZddd�ZdS)�NcCsdS)Na'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>�rrr�/usr/lib64/python3.8/cgitb.py�reset#srcCs|rd|dSdSdS)Nz<small>z</small>�r��textrrr�small.srcCs|rd|dSdSdS)Nz<strong>z	</strong>rrrrrr�strong4sr	cCs|rd|dSdSdS)Nz<font color="#909090">z</font>rrrrrr�grey:sr
cCs�||krd||fS||jkr,d|j|fSd|jkr~|jd}t|�ti�krf||kr~d||fSnt||�r~dt||�fSdtfS)N�local�global�__builtins__�builtin)�	f_globals�type�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinsrrr�lookup@s



rcCs�gdddtf\}}}}}t�|�D]�\}}	}
}}|tjkr>q�|tjkr�|	tjkr�|dkr�|tk	r�t||	t�}|�||	||f�q�t	|	||�\}
}|�|	|
|f�n"|	dkr�||d7}|}nd\}}|	}q"|S)Nr�.)Nr)
r�tokenize�generate_tokens�NEWLINE�NAME�keyword�kwlistr�appendr)�readerrr�varsZ	lasttoken�parent�prefix�valueZttype�token�start�end�line�whererrr�scanvarsPs"
r+�c"s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	j
�dtt	j
�
t|���dd|d|�d	}d
td�d}g}	t�||�}
|
D�]F\}�}}
}}�r�tj����d
�t	j
�
��f}nd�}t�|�\}}}}d}|
dk�r8dtt	j
�
|
��}|
dk�r8|tj||||dd�d�7}i�|gf��fdd�	}t|||�}dd||fg}|dk	�r
||}|D]�}tddtt|��t|��d}|�k�r�d|t	j
�|�f}|�d|�n&d|t	j
�|�f}|�dt|��|d7}�q�ig}}|D]�\}}} ||k�r0�qd||<| tk	�r�|d k�r^d!|t|�}n*|d"k�rrt|�}n|t|�d#�d$�}|�d%|t	j
�| �f�n|�|d&��q|�dttd'�|����|	�d(d)�|��q�d*tt	j
�
t|���t	j
�
t|��fg}!t|�D]B}|dd�d+k�r4�qt	j
�t ||��} |!�d,||| f��q|d�|	�d�|!�d-t	j
�
d�t!�"|||���S).N�Python r�: z<body bgcolor="#f0f0f8">z<big><big>%s</big></big>z#ffffffz#6622aaz<br>z�
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://%s">%s</a>�?r�in �<module>cSsdtj�|�S�N�=)�pydoc�html�repr�r%rrr�<lambda>��zhtml.<locals>.<lambda>�Zformatvaluec
s8d�|d<zt��|d�W�S|dd7<XdS�N�r��	linecache�getline��lnum��fileZ	highlightrrr!�szhtml.<locals>.readerz+<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>z<big>&nbsp;</big>z&nbsp;r,z<tt>=&gt;%s%s</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;%s%s</tt>z<tr><td>%s</td></tr>r<)rrz<em>%s</em> rr���z%s&nbsp;= %sz <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>�
z	<p>%s: %s�_z
<br>%s%s&nbsp;=
%sz�


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
)#�
isinstancer�__name__�sys�version�split�
executable�time�ctimer4r5Zheadingr	�escape�strr�inspect�getinnerframes�os�path�abspath�getargvalues�formatargvaluesr+�lenZ	preformatr r
rr6�join�dirr�	traceback�format_exception)"�einfo�context�etype�evalue�etb�pyver�date�head�indent�frames�recordsrrA�func�lines�index�link�args�varargs�varkwr�callr!r"�rows�ir)�num�done�dumprr*r%�	exceptionrrBrr5es�

�
��

��
$






��	��r5c 	s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	|�||fd}g}t
�||�}	|	D�]�\}
�}}}
}�r�tj
���p�d�t
�|
�\}}}}d}|dkr�d|}|d	kr�|t
j||||d
d�d�7}i�|gf��fd
d�	}t||
|�}d�|fg}|dk	�rP||}|
D](}d|}|�||���|d7}�q&ig}}|D]�\}}}||k�rv�q^d||<|tk	�r�|dk�r�d|}n|dk�r�||�d�d}|�d|tj�|�f�n|�|d��q^|�d�|��|�dd�|��qndt	|�t	|�fg}t|�D],}tj�t||��}|�dd||f��q*|d�|�d�|�dd�t�|||��S)Nr-rr.z	%s
%s
%s
z�
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r/rr0r1cSsdtj�|�Sr2)r4rr6r7rrrr8�r9ztext.<locals>.<lambda>r:c
s8d�|d<zt��|d�W�S|dd7<XdSr;r=r@rBrrr!�sztext.<locals>.readerz %s %sz%5d r<rzglobal rrrDz%s = %sz
 undefinedrEz
%s
z%s: %sz

%s%s = %sz    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rGrrHrIrJrKrLrMrNrPrQrRrSrTrUrVrWr+r �rstriprr4rr6rYrZrr[r\) r]r^r_r`rarbrcrdrfrgrrArhrirjrlrmrnrror!r"rprqr)rrrsrtrr*r%rurrBrr�sb

�






�rc@s(eZdZddd�Zdd�Zdd	d
�ZdS)
�Hookr<Nr,r5cCs(||_||_||_|ptj|_||_dS�N)�display�logdirr^rI�stdoutrC�format)�selfryrzr^rCr|rrr�__init__s
z
Hook.__init__cCs|�|||f�dSrx)�handle)r}r_r`rarrr�__call__
sz
Hook.__call__c
	Csz|p
t��}|jdkr$|j�t��|jdkr2tp4t}d}z|||j�}Wn d�	t
j|��}d}YnX|jr�|r�t
j�|�}|j�d|d�q�|j�|d�n|j�d�|jdk	�rZd	d
g|jdk}tj||jd�\}}z.t�|d��}|�|�W5QRXd
|}	Wnd|}	YnX|jdk�rJ|j�d|	�n|j�|	d�z|j��WnYnXdS)Nr5FrTz<pre>z</pre>
rEz*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrZ�wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)rI�exc_infor|rC�writerr5rr^rYr[r\ryr4rOrz�tempfileZmkstemprS�fdopen�flush)
r}�infoZ	formatterZplain�docr��fdrTrC�msgrrrrs@

zHook.handle)r<Nr,Nr5)N)rH�
__module__�__qualname__r~r�rrrrrrws
�
rwr<cCst||||d�t_dS)N�ryrzr^r|)rwrI�
excepthookr�rrr�enable:s�r�)r,)r,)r<Nr,r5)rQrr>rSr4rIr�rMrr[rrrr	r
rr+r5rrwrZhandlerr�rrrr�<module>s*

[
B7_dummy_thread.cpython-38.pyc000064400000013627151450073350012031 0ustar00U

e5d��@s�dZddddddddgZd	ZeZifd
d�Zdd�Zdd�Zd
d�Zddd�Z	dd�Z
Gdd�de�ZGdd�de�Z
dadadd�ZdS)a/Drop-in replacement for the thread module.

Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.

Suggested usage is::

    try:
        import _thread
    except ImportError:
        import _dummy_thread as _thread

�error�start_new_thread�exit�	get_ident�
allocate_lock�interrupt_main�LockType�RLocklcCs�t|�tt��krtd��t|�tt��kr4td��daz|||�Wn.tk
rZYnddl}|��YnXdatr�dat	�dS)a�Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    z2nd arg must be a tuplez3rd arg must be a dictF�NT)
�type�tuple�	TypeError�dict�_main�
SystemExit�	traceback�	print_exc�
_interrupt�KeyboardInterrupt)Zfunction�args�kwargsr�r�%/usr/lib64/python3.8/_dummy_thread.pyrs 
cCst�dS)z'Dummy implementation of _thread.exit().N)rrrrrr=scCsdS)z�Dummy implementation of _thread.get_ident().

    Since this module should only be used when _threadmodule is not
    available, it is safe to assume that the current process is the
    only thread.  Thus a constant can be safely returned.
    �rrrrrrAscCst�S)z0Dummy implementation of _thread.allocate_lock().�rrrrrrJsNcCs|dk	rtd��dS)z-Dummy implementation of _thread.stack_size().Nz'setting thread stack size not supportedr	)r)�sizerrr�
stack_sizeNsrcCst�S)z0Dummy implementation of _thread._set_sentinel().rrrrr�
_set_sentinelTsrc@sFeZdZdZdd�Zddd�ZeZdd	�Zd
d�Zdd
�Z	dd�Z
dS)ra�Class implementing dummy implementation of _thread.LockType.

    Compatibility is maintained by maintaining self.locked_status
    which is a boolean that stores the state of the lock.  Pickling of
    the lock, though, should not be done since if the _thread module is
    then used with an unpickled ``lock()`` from here problems could
    occur from this class not having atomic methods.

    cCs
d|_dS)NF��
locked_status��selfrrr�__init__cszLockType.__init__N���cCsH|dks|rd|_dS|js&d|_dS|dkr@ddl}|�|�dSdS)a�Dummy implementation of acquire().

        For blocking calls, self.locked_status is automatically set to
        True and returned appropriately based on value of
        ``waitflag``.  If it is non-blocking, then the value is
        actually checked and not set if it is already acquired.  This
        is all done so that threading.Condition's assert statements
        aren't triggered and throw a little fit.

        NTr	F)r�time�sleep)r �waitflag�timeoutr#rrr�acquirefs
zLockType.acquirecCs|��dS�N)�release)r �typ�val�tbrrr�__exit__�szLockType.__exit__cCs|js
t�d|_dS)zRelease the dummy lock.FT)rrrrrrr)�szLockType.releasecCs|jSr(rrrrr�locked�szLockType.lockedcCs*d|jrdnd|jj|jjtt|��fS)Nz<%s %s.%s object at %s>r.Zunlocked)r�	__class__�
__module__�__qualname__�hex�idrrrr�__repr__�s
�zLockType.__repr__)Nr")�__name__r0r1�__doc__r!r'�	__enter__r-r)r.r4rrrrrXs

	cs:eZdZdZ�fdd�Zd
�fdd�	Z�fdd	�Z�ZS)raDummy implementation of threading._RLock.

    Re-entrant lock can be aquired multiple times and needs to be released
    just as many times. This dummy implemention does not check wheter the
    current thread actually owns the lock, but does accounting on the call
    counts.
    cst���d|_dS)Nr	)�superr!�_levelsr�r/rrr!�s
zRLock.__init__Nr"cs$t��||�}|r |jd7_|S)zEAquire the lock, can be called multiple times in succession.
        r)r8r'r9)r r%r&r.r:rrr'�sz
RLock.acquirecs4|jdkrt�|jdkr"t���|jd8_dS)zERelease needs to be called once for every call to acquire().
        r	rN)r9rr8r)rr:rrr)�s



z
RLock.release)Nr")r5r0r1r6r!r'r)�
__classcell__rrr:rr�sFTcCstr
t�ndadS)z^Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting.TN)rrrrrrrr�s)N)r6�__all__�TIMEOUT_MAX�RuntimeErrorrrrrrrr�objectrrrrrrrrr�<module>s$
� 	
@sndhdr.cpython-38.opt-2.pyc000064400000013124151450073350011422 0ustar00U

e5d��@s.ddgZddlmZedd�Zdej_dej_dej_d	ej_d
ej	_dd�Z
dd�ZgZd
d�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zed)k�r*e�d*S)+�what�whathdr�)�
namedtuple�
SndHeadersz.filetype framerate nchannels nframes sampwidthz�The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.zYThe sampling_rate will be either the actual
value or 0 if unknown or difficult to decode.z^The number of channels or 0 if it cannot be
determined or if the value is difficult to decode.z?The value for frames will be either the number
of frames or -1.zAEither the sample size in bits or
'A' for A-LAW or 'U' for u-LAW.cCst|�}|S)N)r)�filename�res�r�/usr/lib64/python3.8/sndhdr.pyr4sc
Cs^t|d��J}|�d�}tD]*}|||�}|rt|�W5QR�SqW5QR�dSQRXdS)N�rbi)�open�read�testsr)r�f�hZtfrrrr	r:s

c	Cs�ddl}|�d�sdS|dd�dkr,d}n|dd�dkrBd}ndS|�d�z|�|d	�}Wnt|jfk
r|YdSX||��|��|��d|�	�fS)
Nr�FORM��sAIFC�aifcsAIFFZaiff�r)
r�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrrZfmt�arrr	�	test_aifcKs"


�rc
Cs�|�d�rt}n|dd�dkr&t}ndSd}||dd��}||dd��}||dd��}||dd��}||dd	��}d
}	|d
kr�d}
n$|dkr�d}
n|d
kr�d}
d}	nd}
|	|}|r�||}nd}|||||
fS)Ns.snd�)sds.sdns.Zaurr�����U���?���)r�get_long_be�get_long_le)
rr�func�filetypeZhdr_size�	data_size�encoding�rate�	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	�test_au`s2

r1cCsT|dd�dks |dd�dkr$dSt|dd��}|rBd	|}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"VrZhcomr#r(r)r))rrZdivisorr/rrr	�	test_hcom�s 
r8cCst|�d�sdSt|dd��}d}d|kr6dkrfnn,||dkrfd||d}|rftd	|�}d
|dddfS)
NsCreative Voice Filer!�ri�r#�rg��.AZvocr(r)r�get_short_le�int)rrZsbseekr/Zratecoderrr	�test_voc�s
$r=c	Cs�ddl}|�d�r2|dd�dks2|dd�dkr6dS|�d�z|�|d�}Wnt|jfk
rlYdSXd	|��|��|��d|�	�fS)
NrsRIFFrrsWAVEr sfmt rZwav)
�waverrrrrrrrr)rrr>�wrrr	�test_wav�s*

�r@cCs"|�d�r|dd�dkrdSdS)Nrrrs8SVX)Z8svxrr#rr)r)rrrrr	�	test_8svx�srAcCs<|�d�r8t|dd��}t|dd��}d|d|dfSdS)NsSOUNDrrr!r9Zsndtr#)rr*r;)rrZnsamplesr/rrr	�	test_sndt�s
rBcCsD|�d�r@t|dd��}d|kr.dkr@nnd|ddd	fSdS)
Nsr%ri�i�aZsndrr#r(r)rr;)rrr/rrr	�	test_sndr�s
rCcCs,|dd>|dd>B|dd>B|dBS)Nrr"r#r r%rr&r��brrr	r)�sr)cCs,|dd>|dd>B|dd>B|dBS)Nr&r"r%r r#rrrrDrrr	r*�sr*cCs|dd>|dBS)Nrrr#rrDrrr	�get_short_be�srFcCs|dd>|dBS)Nr#rrrrDrrr	r;�sr;cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr#z-rr%�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rH�	recursiverrr	�test�srPc	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rH�os�path�isdir�print�glob�join�escaperJ�stdout�flushr�OSError)�listrOZtoplevelrHrUrrY�namesrrr	rJ�s"

rJ�__main__N)�__all__�collectionsrrr,�__doc__Z	framerater0ZnframesZ	sampwidthrrr
r�appendr1r8r=r@rArBrCr)r*rFr;rPrJ�__name__rrrr	�<module>!sH�









mailbox.cpython-38.opt-1.pyc000064400000165432151450073350011604 0ustar00U

e5dE3�@sRdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZzddl
Z
Wnek
r�dZ
YnXddddddd	d
ddd
ddddddgZej�d�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	ejj�ZGd d
�d
e�ZGd!d"�d"e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�Z Gd&d�de�Z!Gd'd(�d(�Z"Gd)d*�d*e"�Z#d=d,d-�Z$d.d/�Z%d0d1�Z&d2d3�Z'd4d5�Z(d6d7�Z)Gd8d�de*�Z+Gd9d�de+�Z,Gd:d�de+�Z-Gd;d�de+�Z.Gd<d�de+�Z/dS)>zDRead/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.�N�Mailbox�Maildir�mbox�MH�Babyl�MMDF�Message�MaildirMessage�mboxMessage�	MHMessage�BabylMessage�MMDFMessage�Error�NoSuchMailboxError�
NotEmptyError�ExternalClashError�FormatError�asciic@seZdZdZdCdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dDdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdEd0d1�Zd2d3�ZdFd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@Z"dGdAdB�Z#dS)Hrz*A group of messages in a particular place.NTcCs tj�tj�|��|_||_dS)zInitialize a Mailbox instance.N)�os�path�abspath�
expanduser�_path�_factory��selfr�factory�create�r�/usr/lib64/python3.8/mailbox.py�__init__$szMailbox.__init__cCstd��dS)�$Add message and return assigned key.�&Method must be implemented by subclassN��NotImplementedError�r�messagerrr�add)szMailbox.addcCstd��dS)�=Remove the keyed message; raise KeyError if it doesn't exist.r"Nr#�r�keyrrr�remove-szMailbox.removecCs|�|�dS�N)r+r)rrr�__delitem__1szMailbox.__delitem__cCs(z|�|�Wntk
r"YnXdS�z'If the keyed message exists, remove it.N)r+�KeyErrorr)rrr�discard4szMailbox.discardcCstd��dS)�>Replace the keyed message; raise KeyError if it doesn't exist.r"Nr#�rr*r&rrr�__setitem__;szMailbox.__setitem__cCs*z|�|�WStk
r$|YSXdS)z9Return the keyed message, or default if it doesn't exist.N)�__getitem__r/)rr*�defaultrrr�get?szMailbox.getc
CsB|js|�|�St�|�|���}|�|�W5QR�SQRXdS)z=Return the keyed message; raise KeyError if it doesn't exist.N)r�get_message�
contextlib�closing�get_file)rr*�filerrrr4Fs
zMailbox.__getitem__cCstd��dS)�4Return a Message representation or raise a KeyError.r"Nr#r)rrrr7NszMailbox.get_messagecCst�|�|����S)z�Return a string representation or raise a KeyError.

        Uses email.message.Message to create a 7bit clean string
        representation of the message.��email�message_from_bytes�	get_bytesZ	as_stringr)rrr�
get_stringRszMailbox.get_stringcCstd��dS)z8Return a byte string representation or raise a KeyError.r"Nr#r)rrrr@YszMailbox.get_bytescCstd��dS)�6Return a file-like representation or raise a KeyError.r"Nr#r)rrrr:]szMailbox.get_filecCstd��dS)�Return an iterator over keys.r"Nr#�rrrr�iterkeysaszMailbox.iterkeyscCst|���S)zReturn a list of keys.)�listrErDrrr�keyseszMailbox.keysc	cs>|��D]0}z||}Wntk
r0YqYnX|VqdS)z%Return an iterator over all messages.N�rEr/�rr*�valuerrr�
itervaluesis
zMailbox.itervaluescCs|��Sr,)rKrDrrr�__iter__rszMailbox.__iter__cCst|���S)z,Return a list of messages. Memory intensive.)rFrKrDrrr�valuesuszMailbox.valuesc	csB|��D]4}z||}Wntk
r0YqYnX||fVqdS)z.Return an iterator over (key, message) tuples.NrHrIrrr�	iteritemsys
zMailbox.iteritemscCst|���S)z9Return a list of (key, message) tuples. Memory intensive.)rFrNrDrrr�items�sz
Mailbox.itemscCstd��dS)�9Return True if the keyed message exists, False otherwise.r"Nr#r)rrr�__contains__�szMailbox.__contains__cCstd��dS)�*Return a count of messages in the mailbox.r"Nr#rDrrr�__len__�szMailbox.__len__cCs|��D]}|�|�qdS)zDelete all messages.N)rGr0r)rrr�clear�sz
Mailbox.clearcCs4z||}Wntk
r$|YSX|�|�|S)z3Delete the keyed message and return it, or default.)r/r0)rr*r5�resultrrr�pop�s

zMailbox.popcCs*|��D]}||�|�fStd��dS)z6Delete an arbitrary (key, message) pair and return it.zNo messages in mailboxN)rErVr/r)rrr�popitem�szMailbox.popitemc	Cstt|d�r|��}nt|d�r(|��}n|}d}|D].\}}z|||<Wq4tk
r`d}Yq4Xq4|rptd��dS)z4Change the messages that correspond to certain keys.rNrOFTzNo message with key(s)N)�hasattrrNrOr/)r�arg�sourceZbad_keyr*r&rrr�update�s



zMailbox.updatecCstd��dS)�&Write any pending changes to the disk.r"Nr#rDrrr�flush�sz
Mailbox.flushcCstd��dS)�Lock the mailbox.r"Nr#rDrrr�lock�szMailbox.lockcCstd��dS)�#Unlock the mailbox if it is locked.r"Nr#rDrrr�unlock�szMailbox.unlockcCstd��dS)�Flush and close the mailbox.r"Nr#rDrrr�close�sz
Mailbox.closecCs.z|�d�WStk
r(td��YnXdS)Nrz?String input must be ASCII-only; use bytes or a Message instead)�encode�UnicodeError�
ValueErrorr%rrr�_string_to_bytes�szMailbox._string_to_bytesFc	Cs�t|tjj�rvt��}tj�||d�}|�|�|�	d�|�
�}|�dt�}|�
|�|jrr|�t�sr|�
t��n�t|tttjf��rt|tj�r�t�dtd�|��}t|t�r�|�|�}|r�|�dd�}|�dt�}|�
|�|j�r�|�t��s�|�
t�n�t|d��r�t|d��r2t�d	td�|j}d
}|��}|�d��r\|d
d�d}n|�d
��rx|d
d�d}|�s��q�|�r�|�d��r�d|dd
�}|�dt�}|�
|�|}�q6|j�r�|�r�|�t��s�|�
t�ntdt|���d
S)z%Dump message contents to target file.r�
�8Use of StringIO input is deprecated, use BytesIO instead�s
From s
>From �read�buffer�DUse of text mode files is deprecated, use a binary mode file insteadN�
����
����From s>From ��Invalid message type: %s)�
isinstancer>r&r�io�BytesIO�	generator�BytesGenerator�flatten�seekrk�replace�linesep�write�_append_newline�endswith�str�bytes�StringIO�warnings�warn�DeprecationWarning�getvaluergrXrl�readline�
startswith�	TypeError�type)	rr&�targetZmangle_from_rl�gen�dataZlastline�linerrr�
_dump_message�s`


�


�
zMailbox._dump_message)NT)N)N)N)F)$�__name__�
__module__�__qualname__�__doc__r r'r+r-r0r3r6r4r7rAr@r:rErGrKrLrMrNrOrQrSrTrVrWr[r]r_rarcrgrr�rrrrr!sB

		
	
c@s�eZdZdZdZd6dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7rzA qmail-style Maildir mailbox.�:NTcCs�t�||||�tj�|jd�tj�|jd�tj�|jd�d�|_tj�|j�s�|r�t�|jd�|j�	�D]}t�|d�qln
t
|j��i|_ddd�|_d|_
d|_d	S)
zInitialize a Maildir instance.�tmp�new�cur)r�r�r��r)r�r�g�������?N)rr rr�joinr�_paths�exists�mkdirrMr�_toc�_toc_mtimes�
_last_read�_skewfactor)r�dirnamerrrrrrr 
s�
zMaildir.__init__c
Cs~|��}z|�||�Wn*tk
rB|��t�|j��YnXt|�t|t	�r||�
�}|j|��}||jkr�d}nd}d}tj
�|j��|j�d}tj
�|j|||�}t|t	�r�t�|jtj
�|j�|��f�zLzt�|j|�Wn(ttfk
�rt�|j|�YnXt�|j�WnNtk
�rx}z.t�|j�|jtjk�rftd|��n�W5d}~XYnX|S)r!�r�rz$Name clash with existing message: %sN)�_create_tmpr��
BaseExceptionrcrr+�name�_sync_closerur	�
get_subdir�colon�get_infor�basename�splitr�r�utime�getatime�get_date�link�AttributeError�PermissionError�rename�OSError�errnoZEEXISTr)rr&Ztmp_file�subdir�suffix�uniq�dest�errrr'!sF


��zMaildir.addcCs t�tj�|j|�|���dS�r(N)rr+rr�r�_lookupr)rrrr+KszMaildir.removec	Cs,z|�|�Wnttfk
r&YnXdSr.)r+r/�FileNotFoundErrorr)rrrr0OszMaildir.discardcCs�|�|�}|�|�}|�|�}t|t�r.|}n|}tj�|�}|j|kr`|j|�|j�d}nd}|�	|�tj�
|j|�}	tj�
|j|||�}
t|t�r�t�|	tj�
|	�|��f�t�|	|
�dS)r1rqr�N)r�r'rur	rrr�r�r�r0r�rr�r�r�r�)rr*r&Zold_subpathZtemp_keyZtemp_subpathZdominant_subpathr�r�Ztmp_path�new_pathrrrr3Ws$






�zMaildir.__setitem__c	Cs�|�|�}ttj�|j|�d�� }|jr4|�|�}nt|�}W5QRXtj�|�\}}|�	|�|j
|kr�|�|�|j
�d�|�tj�
tj�|j|���|S)r<�rbrq)r��openrrr�rrr	r��
set_subdirr��set_info�set_date�getmtime)rr*Zsubpath�f�msgr�r�rrrr7rs


zMaildir.get_messagec
CsDttj�|j|�|��d��}|���td�W5QR�SQRXdS)�2Return a bytes representation or raise a KeyError.r�rhN)	r�rrr�rr�rkr|r}�rr*r�rrrr@�szMaildir.get_bytescCs$ttj�|j|�|��d�}t|�S)rBr�)r�rrr�rr��
_ProxyFiler�rrrr:�szMaildir.get_filec	csF|��|jD]2}z|�|�Wntk
r8YqYnX|VqdS�rCN)�_refreshr�r�r/r)rrrrE�s

zMaildir.iterkeyscCs|��||jkS�rP)r�r�r)rrrrQ�szMaildir.__contains__cCs|��t|j�S�rR)r��lenr�rDrrrrS�szMaildir.__len__cCsdS)�"Write any pending changes to disk.NrrDrrrr]�sz
Maildir.flushcCsdS)r^NrrDrrrr_�szMaildir.lockcCsdS)r`NrrDrrrra�szMaildir.unlockcCsdS�rbNrrDrrrrc�sz
Maildir.closecCs\g}t�|j�D]F}t|�dkr|ddkrtj�tj�|j|��r|�|dd��q|S)�Return a list of folder names.�r�.N)r�listdirrr�r�isdirr��append�rrU�entryrrr�list_folders�s�zMaildir.list_folderscCs ttj�|jd|�|jdd�S)z/Return a Maildir instance for the named folder.r�F�rr)rrrr�rr�r�folderrrr�
get_folder�s�zMaildir.get_foldercCs\tj�|jd|�}t||jd�}tj�|d�}tj�|�sXt�t�|tj	tj
Bd��|S)z>Create a folder and return a Maildir instance representing it.r��rZ
maildirfolder�)rrr�rrrr�rcr��O_CREAT�O_WRONLY)rr�rrUZmaildirfolder_pathrrr�
add_folder�s�zMaildir.add_foldercCstj�|jd|�}t�tj�|d��t�tj�|d��D](}t|�dksX|ddkr<td|��q<t�|�D]B}|dkrp|dkrp|dkrptj�tj�||��rptd||f��qptj|d	d
�D]F\}}}|D]}t�	tj�||��q�|D]}t�
tj�||��q�q�t�
|�dS)�-Delete the named folder, which must be empty.r�r�r�r�rzFolder contains message(s): %sr�z%Folder contains subdirectory '%s': %sF)�topdownN)rrr�rr�r�rr��walkr+�rmdir)rr�rr��root�dirs�filesrrr�
remove_folder�s&���zMaildir.remove_foldercCsXt��}t�tj�|jd��D]4}tj�|jd|�}|tj�|�dkrt�|�qdS)zDelete old files in "tmp".r�i@�N)�timerr�rr�rr�r+)r�nowr�rrrr�clean�s
z
Maildir.cleanr�cCs�t��}t��}d|kr$|�dd�}d|kr8|�dd�}dt|�t|dd�t��tj|f}tj	�
|jd|�}zt�|�WnFt
k
r�tjd7_zt|�WYStk
r�YnXYnXtd	|��d
S)z=Create a file in the tmp subdirectory and open and return it.�/z\057r�z\072z%s.M%sP%sQ%s.%sr�g��.Ar�z&Name clash prevented file creation: %sN)r��socket�gethostnamer|�intr�getpidr�_countrr�r�statr��_create_carefully�FileExistsErrorr)rr�Zhostnamer�rrrrr��s,��zMaildir._create_tmpcCs�t��|jd|jkr^d}|jD]2}tj�|j|�}||j|krJd}||j|<q"|s^dSi|_|jD]^}|j|}t�	|�D]D}tj�
||�}tj�|�r�q�|�|j
�d}tj�
||�|j|<q�qjt��|_dS)z!Update table of contents mapping.�FTNr)r�r�r�r�rrr�r�r�r�r�r�r�r�)rZrefreshr��mtimerr��pr�rrrr��s&


zMaildir._refreshcCs�z.tj�tj�|j|j|��r,|j|WSWntk
rBYnX|��z|j|WStk
rztd|�d�YnXdS)z=Use TOC to return subpath for given key, or raise a KeyError.�No message with key: %sN)rrr�r�rr�r/r�r)rrrr�#szMaildir._lookupcCsXt|d�s|��|_z|t|j�WStk
r:YdStk
rPYqYqXqdS)z0Return the next message in a one-time iteration.�
_onetime_keysN)rXrEr��next�
StopIterationr/rDrrrr�1s

zMaildir.next)NT)r�r�r�r�r�r r'r+r0r3r7r@r:rErQrSr]r_rarcr�r�r�r�r�r�r�r�r�r�rrrrrs6
*
	
$c@s�eZdZdZd$dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd%d d!�Zd"d#�ZdS)&�_singlefileMailboxzA single-file mailbox.NTc
Cs�t�||||�zt|jd�}Wnntk
r�}zP|jtjkr\|rPt|jd�}q~t|j��n"|jtjtj	fkr|t|jd�}n�W5d}~XYnX||_
d|_d|_d|_
d|_d|_d|_dS)z!Initialize a single-file mailbox.�rb+zwb+r�NrF)rr r�rr�r��ENOENTr�EACCES�EROFS�_filer��	_next_key�_pending�
_pending_sync�_locked�_file_length)rrrrr�r�rrrr As$z_singlefileMailbox.__init__cCs8|��|�|�|j|j<|jd7_d|_|jdS)r!r�T)r��_append_messager�rrr%rrrr'Xs
z_singlefileMailbox.addcCs|�|�|j|=d|_dS)r(TN)r�r�rr)rrrr+bs
z_singlefileMailbox.removecCs$|�|�|�|�|j|<d|_dS)r1TN)r�r	r�rr2rrrr3hs
z_singlefileMailbox.__setitem__ccs|��|j��EdHdSr�)r�r�rGrDrrrrEnsz_singlefileMailbox.iterkeyscCs|��||jkSr�)r�r�r)rrrrQssz_singlefileMailbox.__contains__cCs|��t|j�Sr�)r�r�r�rDrrrrSxsz_singlefileMailbox.__len__cCs|jst|j�d|_dS)r^TN)r�
_lock_filerrDrrrr_}s
z_singlefileMailbox.lockcCs|jrt|j�d|_dS�r`FN)r�_unlock_filerrDrrrra�s
z_singlefileMailbox.unlockc
Cs�|js |jrt|j�d|_dS|j�dd�|j��}||jkrTtd|j|f��t|j	�}z�i}|�
|�t|j�
��D]x}|j|\}}|j�|�|�|�|��}|j�td||j����}|s�q�|�|�q�||��f||<|�|�q||��|_Wn"|��t�|j��YnXt|�|j��t�|j	�j}	t�|j|	�zt�|j|j	�Wn2tk
�r�t�|j	�t�|j|j	�YnXt|j	d�|_||_d|_d|_|j�r�t|jdd�dS)	r�FNrr�z4Size of mailbox file changed (expected %i, found %i)�r�)�dotlock) rr�_sync_flushrr{�tellrr�_create_temporaryr�_pre_mailbox_hook�sortedr�rG�_pre_message_hookrk�minr~�_post_message_hookrcrr+r�r�r��st_mode�chmodr�r�r�rr
)
rZcur_lenZnew_fileZnew_tocr*�start�stopZ	new_startrl�moderrrr]�s`
	

�



�
z_singlefileMailbox.flushcCsdS)�,Called before writing the mailbox to file f.Nr�rr�rrrr�sz$_singlefileMailbox._pre_mailbox_hookcCsdS)�-Called before writing each message to file f.Nrrrrrr�sz$_singlefileMailbox._pre_message_hookcCsdS��,Called after writing each message to file f.Nrrrrrr�sz%_singlefileMailbox._post_message_hookcCs4z|��W5z|jr|��W5|j��XXdSr�)rrcrrar]rDrrrrc�sz_singlefileMailbox.closecCsN|jdkr|��|dk	rJz|j|WStk
rHtd|�d�YnXdS)z'Return (start, stop) or raise KeyError.Nr�)r��
_generate_tocr/r)rrrr��s
z_singlefileMailbox._lookupcCs�|j�dd�|j��}t|j�dkr8|js8|�|j�z&|�|j�|�|�}|�	|j�Wn"t
k
r�|j�|��YnX|j��|j��|_
|S)z;Append message to mailbox and return (start, stop) offsets.rr�)rr{rr�r�rrr�_install_messagerr��truncater]r)rr&ZbeforeZoffsetsrrrr	�s


z"_singlefileMailbox._append_message)NT)N)r�r�r�r�r r'r+r3rErQrSr_rar]rrrrcr�r	rrrrr�>s"

@

r�c@sBeZdZdZdZdd�Zddd�Zddd	�Zdd
d�Zdd
�Z	dS)�	_mboxMMDFzAn mbox or MMDF mailbox.TcCsp|�|�\}}|j�|�|j���td�}|j�||j���}|�|�td��}|�	|dd��
d��|S)r<�rhrsNr)r�rr{r�r|r}rkr�_message_factory�set_from�decode)rr*rr�	from_line�stringr�rrrr7sz_mboxMMDF.get_messageFcCst�|�||��j|d�S)�3Return a string representation or raise a KeyError.)�unixfromr=)rr*�from_rrrrAs

��z_mboxMMDF.get_stringcCsJ|�|�\}}|j�|�|s(|j��|j�||j���}|�td�S)r+rh)r�rr{r�rkrr|r})rr*r-rrr*rrrr@s
z_mboxMMDF.get_bytescCs<|�|�\}}|j�|�|s(|j��t|j|j��|�S)rB)r�rr{r��_PartialFiler)rr*r-rrrrrr:s

z_mboxMMDF.get_filecCsd}t|t�r|�|�}t|t�rf|�d�rf|�d�}|dkr\|d|�}||dd�}q�|}d}nJt|t�r�|���d�}d|}n(t|t	j
j�r�|��}|dk	r�|�d�}|dkr�dt
�t
�����}|j��}|j�|t�|�||j|j�|j��}||fS)	z1Format a message and blindly write to self._file.Nrrrhrqr�r%rsFrom MAILER-DAEMON )rur�rgr�r��find�_mboxMMDFMessage�get_fromrdr>r&r�get_unixfromr��asctime�gmtimerrr~r}r��
_mangle_from_)rr&r)�newlineZauthorrrrrrr"&s0







z_mboxMMDF._install_messageN)F)F)F)
r�r�r�r�r5r7rAr@r:r"rrrrr$s


	
r$c@s2eZdZdZdZdZd
dd�Zdd�Zdd	�ZdS)rzA classic mbox mailbox.TNcCst|_t�||||�dS)zInitialize an mbox mailbox.N)r
r&r$r rrrrr Lsz
mbox.__init__cCs|�t�dSr�r~r}rrrrrQszmbox._post_message_hookcCs�gg}}d}|j�d�|j��}|j��}|�d�rzt|�t|�krj|r`|�|tt��n
|�|�|�|�d}q|s�|r�|�|tt��q�|�|�q�q|tkr�d}qd}qtt	t
||���|_t|j�|_|j��|_
dS)�0Generate key-to-(start, stop) table of contents.FrrrTN)rr{rr�r�r�r�r}�dict�	enumerate�zipr�rr)r�starts�stopsZlast_was_empty�line_posr�rrrr!Us.






zmbox._generate_toc)NT)	r�r�r�r�r5rr rr!rrrrrCs
c@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
rzAn MMDF mailbox.NTcCst|_t�||||�dS)zInitialize an MMDF mailbox.N)r
r&r$r rrrrr zsz
MMDF.__init__cCs|�dt�dS)r�Nr7rrrrrszMMDF._pre_message_hookcCs|�tdt�dS)r r?Nr7rrrrr�szMMDF._post_message_hookcCs�gg}}|j�d�d}|}|j��}|j��}|�dt�r�|�|�|}|j��}|j��}|dtkr�|�|tt��q�qJ|sJ|�|�q�qJq|sq�qtt	t
||���|_t|j�|_|j�dd�|j��|_
dS)r8rr?r�N)rr{r�rr�r}r�r�r9r:r;r�rr)rr<r=�next_posr>r�rrrr!�s.






zMMDF._generate_toc)NT)r�r�r�r�r rrr!rrrrrws

c@s�eZdZdZd0dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdS)1rzAn MH mailbox.NTcCstt�||||�tj�|j�sj|r`t�|jd�t�t�tj�	|jd�tj
tjBtjBd��n
t
|j��d|_dS)zInitialize an MH instance.r��
.mh_sequencesi�FN)rr rrr�rr�rcr�r�r��O_EXCLr�rrrrrrr �s�
zMH.__init__cCs�|��}t|�dkrd}nt|�d}tj�|jt|��}t|�}d}z�|j
rVt|�zfz|�
||�Wn:tk
r�|j
r�t|�t	|�d}t�|��YnXt|t�r�|�||�W5|j
r�t|�XW5|s�t	|�X|S)r!rr�FT)rGr��maxrrr�rr�r�r�rr
rr�r�r+rur�_dump_sequences)rr&rGZnew_keyr�r��closedrrrr'�s6


zMH.addc
Csxtj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnX|�
�t�|�dS)r(r�r�N)rrr�rr�r�r�r�rr/rcr+)rr*rr�r�rrrr+�sz	MH.removec
Cs�tj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnXzd|jrrt|�z@t�t�|tjtjB��|�||�t|t�r�|�||�W5|jr�t
|�XW5t
|�XdS)r1r�r�N)rrr�rr�r�r�r�rr/r�rr
rrcr��O_TRUNCr�rurrD)rr*r&rr�r�rrrr3�s$
zMH.__setitem__c
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�2|jr�t|�zt
|�}W5|jr�t|�XW5QRX|����D]\}}||kr�|�|�q�|S)r<r�r�r�N)rr�rrr�rr�r�r�rr/r
rr�
get_sequencesrO�add_sequence)rr*r�r�r�r��key_listrrrr7�s&zMH.get_messagec
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�F|jr�t|�z |�
��td�W�W5QR�S|jr�t|�XW5QRXdS)r�r�r�r�Nrh)rr�rrr�rr�r�r�rr/r
rrkr|r}�rr*r�r�rrrr@s zMH.get_bytesc
Csfzttj�|jt|��d�}Wn>tk
r\}z |jtjkrJt	d|��n�W5d}~XYnXt
|�S)rBr�r�N)r�rrr�rr�r�r�rr/r�rJrrrr:)szMH.get_filecCsttdd�t�|j�D���S)rCcss|]}|��rt|�VqdSr,)�isdigitr�)�.0r�rrr�	<genexpr>6s�zMH.iterkeys.<locals>.<genexpr>)�iterrrr�rrDrrrrE4szMH.iterkeyscCstj�tj�|jt|���Sr�)rrr�r�rr�r)rrrrQ9szMH.__contains__cCstt|����Sr�)r�rFrErDrrrrS=sz
MH.__len__cCs2|js.ttj�|jd�d�|_t|j�d|_dS)r^rAr�TN)rr�rrr�rrr
rDrrrr_As
zMH.lockcCs(|jr$t|j�t|j�|`d|_dSr)rrrr�rDrrrraHs


z	MH.unlockcCsdS)r\NrrDrrrr]PszMH.flushcCs|jr|��dSr�)rrarDrrrrcTszMH.closecCs<g}t�|j�D]&}tj�tj�|j|��r|�|�q|S)r�)rr�rrr�r�r�r�rrrr�Ys
zMH.list_folderscCsttj�|j|�|jdd�S)z+Return an MH instance for the named folder.Fr��rrrr�rrr�rrrr�as�z
MH.get_foldercCsttj�|j|�|jd�S)z:Create a folder and return an MH instance representing it.r�rOr�rrrr�fs�z
MH.add_foldercCs`tj�|j|�}t�|�}|dgkr:t�tj�|d��n|gkrDntd|j��t�|�dS)r�rAzFolder not empty: %sN)rrr�rr�r+rr�)rr�r�entriesrrrr�ks

zMH.remove_folderc

si}ttj�|jd�ddd���}t|����|D]�}z�|�d�\}}t�}|��D]H}|��rn|�	t
|��qRdd�|�d�D�\}}	|�t||	d	��qR�fd
d�t
|�D�||<t||�dkr�||=Wq0tk
r�td
|����Yq0Xq0W5QRX|S)z=Return a name-to-key-list dictionary to define each sequence.rA�r�ASCII��encodingr�css|]}t|�VqdSr,)r�)rL�xrrrrM�sz#MH.get_sequences.<locals>.<genexpr>�-r�csg|]}|�kr|�qSrr)rLr*�Zall_keysrr�
<listcomp>�s�z$MH.get_sequences.<locals>.<listcomp>rz"Invalid sequence specification: %s)r�rrr�r�setrGr�rKr'r�r[�rangerr�rfr�rstrip)
rZresultsr�r�r��contentsrG�specrrrrWrrGws(
�zMH.get_sequencescCsttj�|jd�ddd�}z�t�t�|jtjtj	B��|�
�D]�\}}t|�dkrVq@|�|d�d}d}t
t|��D]R}|d	|kr�|s�d
}|�d�n*|r�d}|�d||f�n|�d
|�|}qx|r�|�t|�d�q@|�d�q@W5t|�XdS)z:Set sequences using the given name-to-key-list dictionary.rAzr+rRrSrr�NFr�TrVz%s %sz %s�
)r�rrr�rr�rcr�r�rFrOr�r~rrYr�)r�	sequencesr�r�rG�prevZ
completingr*rrr�
set_sequences�s.zMH.set_sequencesc	
Cs>|��}d}g}|��D]�}|d|kr�|�||df�z4t�tj�|jt|��tj�|jt|d���WnHt	t
fk
r�t�tj�|jt|��tj�|jt|d���YnXt�tj�|jt|���|d7}q|d|_
t|�dkr�dS|��D]0\}}|D]"\}}||k�r
|||�|�<�q
q�|�|�dS)z?Re-name messages to eliminate numbering gaps. Invalidates keys.rr�N)rGrEr�rr�rr�rr�r�r�r��unlinkrr�rO�indexra)	rr_r`Zchangesr*r�rI�oldr�rrr�pack�s0��



zMH.packcCst|��}|��}|��D]0\}}||kr4|�|�q||kr||�|�=q|D]}||krN|g||<qN|�|�dS)z;Inspect a new MHMessage and update sequences appropriately.N)rGrOr�rcra)rr&r*Zpending_sequencesZ
all_sequencesr�rI�sequencerrrrD�szMH._dump_sequences)NT)r�r�r�r�r r'r+r3r7r@r:rErQrSr_rar]rcr�r�r�r�rGrarerDrrrrr�s.
"c@s�eZdZdZedddddddh�Zd%dd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd	S)&rzAn Rmail-style Babyl mailbox.�unseen�deletedZfiled�answered�	forwardedZedited�resentNTcCst�||||�i|_dS)zInitialize a Babyl mailbox.N)r�r �_labelsrrrrr �szBabyl.__init__cCs(t�||�}t|t�r$|��|j|<|S)r!)r�r'rur�
get_labelsrl)rr&r*rrrr'�s
z	Babyl.addcCs"t�||�||jkr|j|=dSr�)r�r+rlr)rrrr+�s
zBabyl.removecCs*t�|||�t|t�r&|��|j|<dS)r1N)r�r3rurrmrlr2rrrr3�s
zBabyl.__setitem__c
Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,t��}|j��}|tks�|s|q�|�|�td��qd||j�	�}|j�
|�}|�td�}t|��|�}	|	�
|���||jkr�|	�|j|�|	S)r<�*** EOOH ***rh)r�rr{r�rvrwr}r~r|rrkrr��set_visiblerl�
set_labels)
rr*rr�original_headersr�Zvisible_headers�nZbodyr�rrrr7�s*



zBabyl.get_messagec	Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,|j��}|tksv|s\qvq\|�	�}||j�
�}|j�|�}|�td�}||S)r+rnrh)r�rr{r�rvrwr}r~r|r�rrk)	rr*rrrqr�Zheadersrrr�rrrr@s 


zBabyl.get_bytescCst�|�|��dt��S)rBrh)rvrwr@r|r}r)rrrr:%szBabyl.get_filecCs<|��t�}|j��D]}|�|�q|�|j�t|�S)z4Return a list of user-defined labels in the mailbox.)r�rYrlrMr[�difference_update�_special_labelsrF)r�labelsZ
label_listrrrrm)szBabyl.get_labelscCs:gg}}|j�d�d}g}|}|j��}|j��}|dtkr�t|�t|�krd|�|tt��|�|�dd�|j��dd��d�D�}|�|�q|dks�|dtkr�t|�t|�kr�|�|tt��q|s|�|tt��q�qtt	t
||���|_tt	|��|_t|j�|_
|j�dd	�|j��|_dS)
r8rscSsg|]}|��r|���qSr)�strip�rL�labelrrrrX@s�z'Babyl._generate_toc.<locals>.<listcomp>r�N�,�r�)rr{r�rr}r�r�r�r9r:r;r�rlrr)rr<r=r@Zlabel_listsr>r�rurrrr!2s4



�zBabyl._generate_toccCsVdt}|dt7}|��}dd�|D�}|dd�|�t7}|d7}|�|�dS)	rsBABYL OPTIONS:s
Version: 5css|]}|��VqdSr,)rdrwrrrrMUsz*Babyl._pre_mailbox_hook.<locals>.<genexpr>sLabels:ryrzN)r}rmr�r~)rr�ZbabylrurrrrPszBabyl._pre_mailbox_hookcCs|�dt�dS)r�Nr7rrrrrZszBabyl._pre_message_hookcCs|�td�dS)r rzNr7rrrrr^szBabyl._post_message_hookcCsx|j��}t|t�r�g}g}|��D]$}||jkr>|�|�q$|�|�q$|j�d�|D]}|j�d|���qZ|j�d�|D]}|j�d|��d�q�|j�t	�n|j�dt	�t|t
jj��rt
��}t
j�|dd�}|�|�|�d�|��}|j�|�d	t	��|d	k�s,|s��q,q�|j�d
t	�t|t��r�t
��}	t
j�|	dd�}
|
�|���|	��}|j�|�d	t	��|d	k�s�|�sn�q�qnn>|�d�|��}|j�|�d	t	��|d	k�s�|�s��q�q�|�d�}|�s��qf|j�|�d	t	���q�nTt|ttt
jf��rt|t
j��rJt�dtd
�|��}t|t��r`|�|�}|�d�d}|ddk�r�|j�|d|��d	t	��|j�d
t	�|j�|d|��d	t	��|j�||d��d	t	��n(|j�d
t	t	�|j�|�d	t	���nXt |d��rVt |d��r:t�dtd
�|j!}|��}
d}|��}|�"d��rl|dd�d	}n|�"d��r�|dd�d	}|j�|�d	t	��|d	k�s�|�sF|�r�d}|j�d
t	�|�|
�n�qڐqF|��}|�s�qf|�"d��r
|dd�t	}n:|�"d��r(|dd�t	}n|�"d	��rD|dd�t	}|j�|��q�nt#dt$|���|j��}||fS)z0Write message contents and return (start, stop).�1s, s,,� rys1,,Frrhrnr
rirjs

r�rqNr�rlrmTrnrorprt)%rrrurrmrtr�r~rdr}r>r&rrvrwrxryrzr{r�r|�get_visiblerkr�r�r�r�r�r�r�rgr/rXrlr�r�r�)rr&rZspecial_labelsrurxZorig_bufferZorig_generatorr�Z
vis_bufferZ
vis_generatorrlZ
body_startZoriginal_posZ
first_passrrrrr"bs�







�
�
zBabyl._install_message)NT)r�r�r�r��	frozensetrtr r'r+r3r7r@r:rmr!rrrr"rrrrr�s&
�
	
c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz0Message with mailbox-format-specific properties.NcCs�t|tjj�r4|�t�|��t|t�r�|�|�n�t|t�rP|�t�	|��n~t|t
�rl|�t�|��nbt|tj
�r�|�t�|��nDt|d�r�|�t�|��n(|dkr�tjj�|�ntdt|���dS)zInitialize a Message instance.rkNrt)rur>r&r�_become_message�copyZdeepcopy�_explain_tor�r?r�Zmessage_from_stringrv�
TextIOWrapperZmessage_from_filerXZmessage_from_binary_filer r�r�r%rrrr �s



zMessage.__init__cCs4t|dg�}|jD]}||kr|j||j|<qdS)z0Assume the non-format-specific state of message.�_type_specific_attributesN)�getattr�__dict__)rr&Z
type_specificr�rrrr��s
zMessage._become_messagecCst|t�rdStd��dS)z:Copy format-specific state to message insofar as possible.Nz Cannot convert to specified type)rurr�r%rrrr��s
zMessage._explain_to)N)r�r�r�r�r r�r�rrrrr�s
c@s|eZdZdZdddgZddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)r	z)Message with Maildir-specific properties.�_subdir�_info�_dateNcCs&d|_d|_t��|_t�||�dS)z%Initialize a MaildirMessage instance.r�r�N)r�r�r�r�rr r%rrrr �s
zMaildirMessage.__init__cCs|jS)zReturn 'new' or 'cur'.)r�rDrrrr��szMaildirMessage.get_subdircCs(|dks|dkr||_ntd|��dS)zSet subdir to 'new' or 'cur'.r�r�z!subdir must be 'new' or 'cur': %sN)r�rf)rr�rrrr�szMaildirMessage.set_subdircCs"|j�d�r|jdd�SdSdS)�*Return as a string the flags that are set.�2,r�Nr�)r�r�rDrrr�	get_flags
szMaildirMessage.get_flagscCsdd�t|��|_dS)�)Set the given flags and unset all others.r�r�N)r�rr�)r�flagsrrr�	set_flagsszMaildirMessage.set_flagscCs$|�d�t|���t|�B��dS�z.Set the given flag(s) without changing others.r�N�r�r�rYr��r�flagrrr�add_flagszMaildirMessage.add_flagcCs,|��r(|�d�t|���t|���dS)�7Unset the given string flag(s) without changing others.r�N)r�r�r�rYr�rrr�remove_flagszMaildirMessage.remove_flagcCs|jS)z<Return delivery date of message, in seconds since the epoch.)r�rDrrrr�szMaildirMessage.get_datecCs6zt|�|_Wn"tk
r0td|�d�YnXdS)z9Set delivery date of message, in seconds since the epoch.zcan't convert to float: %sN)�floatr�rfr�)r�daterrrr�"szMaildirMessage.set_datecCs|jS)z%Get the message's "info" as a string.)r�rDrrrr�)szMaildirMessage.get_infocCs&t|t�r||_ntdt|���dS)z Set the message's "info" string.zinfo must be a string: %sN)rur�r�r�r�)r�inforrrr�-s
zMaildirMessage.set_infocCs�t|t�r8|�|���|�|���|�|����nht|t�r�t	|���}d|kr`|�
d�|��dkrv|�
d�d|kr�|�
d�d|kr�|�
d�d|kr�|�
d�|�d	t�
|����n�t|t��rt	|���}d|kr�|�d
�d|k�r|�d�d|k�r�|�d�n�t|t��r�t	|���}d|k�rD|�d
�d|k�rX|�d
�d|k�rl|�d�d|k�r�|�d�nt|t��r�ntdt|���dS)z;Copy Maildir-specific state to message insofar as possible.�S�Rr��O�T�D�F�A�
MAILER-DAEMONrg�replied�flaggedrhri�Prj�$Cannot convert to specified type: %sN)rur	r�r�r�r�r�r�r0rYr�r'r�r4rrHr�	add_labelrr�r�)rr&r�rrrr�4sP

















�zMaildirMessage._explain_to)N)r�r�r�r�r�r r�r�r�r�r�r�r�r�r�r�r�rrrrr	�s

c@sZeZdZdZdgZddd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)r0z/Message with mbox- or MMDF-specific properties.�_fromNcCsV|�dd�t|tjj�rF|��}|dk	rF|�d�rF|�|dd��t�||�dS)z'Initialize an mboxMMDFMessage instance.r�TNzFrom rs)r'rur>r&rr2r�r )rr&r,rrrr esz_mboxMMDFMessage.__init__cCs|jS)z Return contents of "From " line.)r�rDrrrr1nsz_mboxMMDFMessage.get_fromcCs4|dk	r*|dkrt��}|dt�|�7}||_dS)z>Set "From " line, formatting and appending time_ if specified.NT� )r�r4r3r�)rr-Ztime_rrrr'rs
z_mboxMMDFMessage.set_fromcCs|�dd�|�dd�S)r��Statusr��X-Status)r6rDrrrr�zsz_mboxMMDFMessage.get_flagscCs�t|�}d\}}dD]}||kr||7}|�|�qdD]}||kr8||7}|�|�q8|d�t|��7}z|�d|�Wn tk
r�|�d|�YnXz|�d|�Wn tk
r�|�d|�YnXdS)r�)r�r�)r�r�)r�r�r�r�r�r�N)rYr+r�r�replace_headerr/Z
add_header)rr�Zstatus_flagsZ
xstatus_flagsr�rrrr�~s&z_mboxMMDFMessage.set_flagscCs$|�d�t|���t|�B��dSr�r�r�rrrr��sz_mboxMMDFMessage.add_flagcCs4d|ksd|kr0|�d�t|���t|���dS)r�r�r�r�Nr�r�rrrr��sz_mboxMMDFMessage.remove_flagc	Cs�t|t�r�t|���}d|kr(|�d�d|kr:|�d�d|krL|�d�d|kr^|�d�d|krp|�d�|d	=|d
=d�|����dd
��}z|�	t
�t�
|d���Wnttfk
r�YnX�n
t|t�r�|�|���|�|���n�t|t��rZt|���}d|k�r$|�d�d|k�r8|�d�d|k�rL|�d�|d	=|d
=n�t|t��r�t|���}d|k�r�|�d�d|k�r�|�d�d|k�r�|�d�|d	=|d
=nt|t��r�ntdt|���d
S)zACopy mbox- or MMDF-specific state to message insofar as possible.r�r�r�r�r�r�r�r�Zstatuszx-statusr����Nz%a %b %d %H:%M:%S %Yrgr�r�rhrir�)rur	rYr�r�r�r�r1r�r��calendarZtimegmr��strptimerf�
OverflowErrorr0r�r'rrHrr�rr�r�)rr&r�Z
maybe_daterrrr��sb





�













�z_mboxMMDFMessage._explain_to)N)N)
r�r�r�r�r�r r1r'r�r�r�r�r�rrrrr0`s
	
r0c@seZdZdZdS)r
z&Message with mbox-specific properties.N�r�r�r�r�rrrrr
�sc@sHeZdZdZdgZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz$Message with MH-specific properties.�
_sequencesNcCsg|_t�||�dS)z!Initialize an MHMessage instance.N)r�rr r%rrrr �szMHMessage.__init__cCs|jdd�S)z4Return a list of sequences that include the message.N)r�rDrrrrG�szMHMessage.get_sequencescCst|�|_dS)z3Set the list of sequences that include the message.N)rFr�)rr_rrrra�szMHMessage.set_sequencescCs6t|t�r"||jkr2|j�|�ntdt|���dS)z8Add sequence to list of sequences including the message.zsequence type must be str: %sN)rur�r�r�r�r��rrfrrrrH�s

zMHMessage.add_sequencecCs*z|j�|�Wntk
r$YnXdS)zARemove sequence from the list of sequences including the message.N)r�r+rfr�rrr�remove_sequence�szMHMessage.remove_sequencecCsFt|t�rdt|���}d|kr*|�d�n|�d�|�d�d|krP|�d�d|krb|�d�n�t|t�r�t|���}d|kr�|�d�n
|�d	�d|kr�|�d�d|kr�|�d
�n�t|t�r�|��D]}|�|�q�n`t|t	��r$t|���}d|k�r|�
d�d|k�rB|�
d�nt|t��r2ntdt
|���d
S)z6Copy MH-specific state to message insofar as possible.rgr�r�r�r�r�r��ROr�r�rir�N)rur	rYrGr�r�r0rrHrr�rr�r�)rr&r_rfrrrr��sB










�zMHMessage._explain_to)N)r�r�r�r�r�r rGrarHr�r�rrrrr�s
c@sbeZdZdZddgZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz'Message with Babyl-specific properties.rl�_visibleNcCsg|_t�|_t�||�dS)z#Initialize a BabylMessage instance.N)rlrr�r r%rrrr "szBabylMessage.__init__cCs|jdd�S)z'Return a list of labels on the message.N)rlrDrrrrm(szBabylMessage.get_labelscCst|�|_dS)z&Set the list of labels on the message.N)rFrl)rrurrrrp,szBabylMessage.set_labelscCs6t|t�r"||jkr2|j�|�ntdt|���dS)z+Add label to list of labels on the message.zlabel must be a string: %sN)rur�rlr�r�r��rrxrrrr�0s

zBabylMessage.add_labelcCs*z|j�|�Wntk
r$YnXdS)z4Remove label from the list of labels on the message.N)rlr+rfr�rrr�remove_label8szBabylMessage.remove_labelcCs
t|j�S)z3Return a Message representation of visible headers.�rr�rDrrrr~?szBabylMessage.get_visiblecCst|�|_dS)z2Set the Message representation of visible headers.Nr�)rZvisiblerrrroCszBabylMessage.set_visiblecCsb|j��D](}||kr*|j�|||�q
|j|=q
dD]$}||kr8||jkr8|||j|<q8dS)z9Update and/or sensibly generate a set of visible headers.)ZDateZFromzReply-ToZToZCCZSubjectN)r�rGr�)r�headerrrr�update_visibleGs
zBabylMessage.update_visiblecCsrt|t�r~t|���}d|kr*|�d�n|�d�|�d�d|ksNd|krX|�d�d|krj|�d�d	|kr||�d
�n�t|t�r�t|���}d|kr�|�d�n
|�d�d	|kr�|�d
�d|kr�|�d�n�t|t��rt|���}d|k�r|�d�d|k�rn|�d�nTt|t	��rP|�
|���|��D]}|�|��q<nt|t
��r^ntdt|���dS)z9Copy Babyl-specific state to message insofar as possible.rgr�r�rjrkr�rir�rhr�r�r�r�r�r�r�N)rur	rYrmr�r�r0rrHrror~r�rr�r�)rr&rurxrrrr�RsH










�zBabylMessage._explain_to)N)r�r�r�r�r�r rmrpr�r�r~ror�r�rrrrrs
c@seZdZdZdS)r
z&Message with MMDF-specific properties.Nr�rrrrr
|sc@s�eZdZdZd&dd�Zd'dd�Zd(dd�Zd)d	d
�Zd*dd�Zd
d�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zed$d%��ZdS),r�zA read-only wrapper of a file.NcCs$||_|dkr|��|_n||_dS)zInitialize a _ProxyFile.N)rr�_pos)rr��posrrrr �sz_ProxyFile.__init__cCs|�||jj�S�zRead bytes.)�_readrrk�r�sizerrrrk�sz_ProxyFile.readcCs|�||jj�Sr�)r�r�read1r�rrrr��sz_ProxyFile.read1cCs|�||jj�S)zRead a line.)r�rr�r�rrrr��sz_ProxyFile.readlinecCs<g}|D].}|�|�|dk	r|t|�8}|dkrq8q|S)zRead multiple lines.Nr)r�r�)r�sizehintrUr�rrr�	readlines�s
z_ProxyFile.readlinesccs|��}|sdS|VqdS)zIterate over lines.N)r�)rr�rrrrL�sz_ProxyFile.__iter__cCs|jS)zReturn the position.)r�rDrrrr�sz_ProxyFile.tellrcCs4|dkr|j�|j�|j�||�|j��|_dS)zChange position.r�N�rr{r�r�r�offset�whencerrrr{�sz_ProxyFile.seekcCs0t|d�r,zt|jd�r"|j��W5|`XdS)zClose the file.rrcN)rXrrcrDrrrrc�s

z_ProxyFile.closecCs2|dkrd}|j�|j�||�}|j��|_|S)z"Read size bytes using read_method.Nrqr�)rr��read_methodrUrrrr��sz_ProxyFile._readcCs|S)z$Context management protocol support.rrDrrr�	__enter__�sz_ProxyFile.__enter__cGs|��dSr,)rc)r�excrrr�__exit__�sz_ProxyFile.__exit__cCs
|j��Sr,)r�readablerDrrrr��sz_ProxyFile.readablecCs
|j��Sr,)r�writablerDrrrr��sz_ProxyFile.writablecCs
|j��Sr,)r�seekablerDrrrr��sz_ProxyFile.seekablecCs
|j��Sr,)rr]rDrrrr]�sz_ProxyFile.flushcCs&t|d�sdSt|jd�sdS|jjS)NrTrEF)rXrrErDrrrrE�s

z_ProxyFile.closed)N)N)N)N)N)r)r�r�r�r�r rkr�r�r�rLrr{rcr�r�r�r�r�r�r]�propertyrErrrrr��s&





		r�c@s<eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�ZdS)r.z&A read-only wrapper of part of a file.NcCst�|||�||_||_dS)zInitialize a _PartialFile.N)r�r �_start�_stop)rr�rrrrrr �sz_PartialFile.__init__cCst�|�|jS)z*Return the position with respect to start.)r�rr�rDrrrr�sz_PartialFile.tellrcCs<|dkr|j|_d}n|dkr*|j|_d}t�|||�dS)z8Change position, possibly with respect to start or stop.rr�r�N)r�r�r�r�r{r�rrrr{�sz_PartialFile.seekcCsB|j|j}|dkrdS|dks0|dks0||kr4|}t�|||�S)z;Read size bytes using read_method, honoring start and stop.rr%N)r�r�r�r�)rr�r�Z	remainingrrrr��sz_PartialFile._readcCst|d�r|`dS)Nr)rXrrDrrrrcs
z_PartialFile.close)NN)r)	r�r�r�r�r rr{r�rcrrrrr.�s


	r.Tc
Cs�d}�zbtrpzt�|tjtjB�WnJtk
rn}z,|jtjtjtjfkr\t	d|j
��n�W5d}~XYnX|�rfzt|j
d�}|��WnBtk
r�}z$|jtjtjfkr�WY�WdS�W5d}~XYnXz`zt
�|j
|j
d�d}Wn2ttfk
�r$t
�|j
|j
d�d}YnXt
�|j
�Wn0tk
�rdt
�|j
�t	d|j
��YnXWn8t�r�t�|tj�|�r�t
�|j
d��YnXdS)z(Lock file f using lockf and dot locking.Fzlockf: lock unavailable: %sN�.lockTzdot lock unavailable: %s)�fcntl�lockfZLOCK_EXZLOCK_NBr�r�ZEAGAINrrrr�rrcrr�r�r�r�rbr�r+�LOCK_UN)r�rZdotlock_doner�Zpre_lockrrrr

sL�
�r
cCs8trt�|tj�tj�|jd�r4t�|jd�dS)z*Unlock file f using lockf and dot locking.r�N)r�r�r�rrr�r�r+�r�rrrr4src	Cs<t�|tjtjBtjBd�}zt|d�W�St�|�XdS)zCCreate a file if it doesn't exist and open for reading and writing.r�r�N)rr�r�rB�O_RDWRrc)r�fdrrrr�;sr�cCs$td|tt���t��t��f�S)zBCreate a temp file based on path and open for reading and writing.z%s.%s.%s.%s)r�r�r�r�r�rr�)rrrrrCs�rcCs$|��ttd�r t�|���dS)z0Ensure changes to file f are physically on disk.�fsyncN)r]rXrr��filenor�rrrrIs
rcCst|�|��dS)z:Close file f, ensuring all changes are physically on disk.N)rrcr�rrrr�Osr�c@seZdZdZdS)rz"Raised for module-specific errors.Nr�rrrrrUsc@seZdZdZdS)rz:The specified mailbox does not exist and won't be created.Nr�rrrrrXsc@seZdZdZdS)rz>The specified mailbox is not empty and deletion was requested.Nr�rrrrr[sc@seZdZdZdS)rz)Another process caused an action to fail.Nr�rrrrr^sc@seZdZdZdS)rz)A file appears to have an invalid format.Nr�rrrrras)T)0r�rr�r�r�r�r�r�r>Z
email.messageZemail.generatorrvr8r��ImportError�__all__r}rdrrr�r$rrrrr&rr	r0r
rrr
r�r.r
rr�rrr��	Exceptionrrrrrrrrr�<module>s�
�h8DB4-3z%mqH_c'
*asynchat.cpython-38.opt-2.pyc000064400000012546151450073350011761 0ustar00U

e5d@,�@s@ddlZddlmZGdd�dej�ZGdd�d�Zdd�ZdS)	�N)�dequec@s�eZdZdZdZdZdZd'dd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS)(�
async_chatirzlatin-1NcCs(d|_g|_t�|_tj�|||�dS�N�)�ac_in_buffer�incomingr�
producer_fifo�asyncore�
dispatcher�__init__)�selfZsock�map�r� /usr/lib64/python3.8/asynchat.pyrCszasync_chat.__init__cCstd��dS�Nzmust be implemented in subclass��NotImplementedError�r�datarrr�collect_incoming_dataQsz async_chat.collect_incoming_datacCs|j�|�dS�N)r�appendrrrr�_collect_incoming_dataTsz!async_chat._collect_incoming_datacCsd�|j�}|jdd�=|Sr)�joinr)r�drrr�	_get_dataWszasync_chat._get_datacCstd��dSrr�rrrr�found_terminator\szasync_chat.found_terminatorcCsBt|t�r|jrt||j�}nt|t�r8|dkr8td��||_dS)Nrz-the number of received bytes must be positive)�
isinstance�str�use_encoding�bytes�encoding�int�
ValueError�
terminator)rZtermrrr�set_terminator_s
zasync_chat.set_terminatorcCs|jSr)r%rrrr�get_terminatorjszasync_chat.get_terminatorc
Cs�z|�|j�}WnDtk
r&YdStk
rT}z|��WY�dSd}~XYnXt|t�rr|jrrtt|j	�}|j
||_
|j
�r�t|j
�}|��}|s�|�
|j
�d|_
q~t|t��r|}||kr�|�
|j
�d|_
|j||_n2|�
|j
d|��|j
|d�|_
d|_|��q~t|�}|j
�|�}|dk�rv|dk�rX|�
|j
d|��|j
||d�|_
|��q~t|j
|�}|�r�||k�r�|�
|j
d|��|j
|d�|_
�q�q~|�
|j
�d|_
q~dS)Nrr���)Zrecv�ac_in_buffer_size�BlockingIOError�OSError�handle_errorrrr r!r"r�lenr'rr#r%r�find�find_prefix_at_end)rrZwhyZlbr%�nZterminator_len�indexrrr�handle_readrsR

	



zasync_chat.handle_readcCs|��dSr)�
initiate_sendrrrr�handle_write�szasync_chat.handle_writecCs|��dSr)�closerrrr�handle_close�szasync_chat.handle_closecCsxt|tttf�stdt|���|j}t|�|kr`tdt|�|�D]}|j	�
||||��q@n|j	�
|�|��dS)Nz#data argument must be byte-ish (%r)r)rr!�	bytearray�
memoryview�	TypeError�type�ac_out_buffer_sizer-�rangerrr3)rrZsabs�irrr�push�s�zasync_chat.pushcCs|j�|�|��dSr)rrr3)rZproducerrrr�push_with_producer�szasync_chat.push_with_producercCsdS�N�rrrrr�readable�szasync_chat.readablecCs|jp|jSr)r�	connectedrrrr�writable�szasync_chat.writablecCs|j�d�dSr)rrrrrr�close_when_done�szasync_chat.close_when_donecCs|j�r|j�r|jd}|s:|jd=|dkr:|��dS|j}z|d|�}Wn:tk
r�|��}|rz|j�|�n|jd=YqYnXt|t�r�|j	r�t
||j�}z|�|�}Wnt
k
r�|��YdSX|�r|t|�ks�|t|�k�r
||d�|jd<n|jd=dSdS)Nr)rrCr6r;r9�more�
appendleftrrr r!r"�sendr+r,r-)r�firstZobsrZnum_sentrrrr3�s8

zasync_chat.initiate_sendcCs d|_|jdd�=|j��dSr)rrr�clearrrrr�discard_buffersszasync_chat.discard_buffers)NN)�__name__�
__module__�__qualname__r)r;r r"rrrrrr&r'r2r4r6r>r?rBrDrEr3rKrrrrr4s*
H(rc@seZdZddd�Zdd�ZdS)�simple_producer�cCs||_||_dSr)r�buffer_size)rrrQrrrrszsimple_producer.__init__cCsJt|j�|jkr6|jd|j�}|j|jd�|_|S|j}d|_|SdSr)r-rrQ)r�resultrrrrFszsimple_producer.moreN)rP)rLrMrNrrFrrrrrOs
rOcCs0t|�d}|r,|�|d|��s,|d8}q|Sr@)r-�endswith)ZhaystackZneedle�lrrrr//s
r/)r	�collectionsrr
rrOr/rrrr�<module>0s
\ cgitb.cpython-38.opt-1.pyc000064400000023650151450073350011234 0ustar00U

e5d@/�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dd�ZgZdd�Z
dd�Zd	d
�Zdd�Zd
d�Zddd�Zddd�ZGdd�d�Ze�jZddd�ZdS)a�More comprehensive traceback formatting for Python scripts.

To enable this module, do:

    import cgitb; cgitb.enable()

at the top of your script.  The optional arguments to enable() are:

    display     - if true, tracebacks are displayed in the web browser
    logdir      - if set, tracebacks are written to files in this directory
    context     - number of lines of source code to show for each stack frame
    format      - 'text' or 'html' controls the output format

By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)

Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler().  The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.

�NcCsdS)zAReturn a string that resets the CGI and browser to a known state.a'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>�rrr�/usr/lib64/python3.8/cgitb.py�reset#srcCs|rd|dSdSdS)Nz<small>z</small>�r��textrrr�small.srcCs|rd|dSdSdS)Nz<strong>z	</strong>rrrrrr�strong4sr	cCs|rd|dSdSdS)Nz<font color="#909090">z</font>rrrrrr�grey:sr
cCs�||krd||fS||jkr,d|j|fSd|jkr~|jd}t|�ti�krf||kr~d||fSnt||�r~dt||�fSdtfS)z9Find the value for a given name in the given environment.�local�global�__builtins__�builtinN)�	f_globals�type�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinsrrr�lookup@s



rcCs�gdddtf\}}}}}t�|�D]�\}}	}
}}|tjkr>q�|tjkr�|	tjkr�|dkr�|tk	r�t||	t�}|�||	||f�q�t	|	||�\}
}|�|	|
|f�n"|	dkr�||d7}|}nd\}}|	}q"|S)zEScan one logical line of Python and look up values of variables used.Nr�.)Nr)
r�tokenize�generate_tokens�NEWLINE�NAME�keyword�kwlistr�appendr)�readerrr�varsZ	lasttoken�parent�prefix�valueZttype�token�start�end�line�whererrr�scanvarsPs"
r+�c"s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	j
�dtt	j
�
t|���dd|d|�d	}d
td�d}g}	t�||�}
|
D�]F\}�}}
}}�r�tj����d
�t	j
�
��f}nd�}t�|�\}}}}d}|
dk�r8dtt	j
�
|
��}|
dk�r8|tj||||dd�d�7}i�|gf��fdd�	}t|||�}dd||fg}|dk	�r
||}|D]�}tddtt|��t|��d}|�k�r�d|t	j
�|�f}|�d|�n&d|t	j
�|�f}|�dt|��|d 7}�q�ig}}|D]�\}}} ||k�r0�qd ||<| tk	�r�|d!k�r^d"|t|�}n*|d#k�rrt|�}n|t|�d$�d%�}|�d&|t	j
�| �f�n|�|d'��q|�dttd(�|����|	�d)d*�|��q�d+tt	j
�
t|���t	j
�
t|��fg}!t|�D]B}|dd �d,k�r4�qt	j
�t ||��} |!�d-||| f��q|d�|	�d�|!�d.t	j
�
d�t!�"|||���S)/z9Return a nice HTML document describing a given traceback.�Python r�: z<body bgcolor="#f0f0f8">z<big><big>%s</big></big>z#ffffffz#6622aaz<br>z�
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://%s">%s</a>�?r�in �<module>cSsdtj�|�S�N�=)�pydoc�html�repr�r%rrr�<lambda>��zhtml.<locals>.<lambda>�Zformatvaluec
s8d�|d<zt��|d�W�S|dd7<XdS�N�r��	linecache�getline��lnum��fileZ	highlightrrr!�szhtml.<locals>.readerz+<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>z<big>&nbsp;</big>Nz&nbsp;r,z<tt>=&gt;%s%s</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;%s%s</tt>z<tr><td>%s</td></tr>r<)rrz<em>%s</em> rr���z%s&nbsp;= %sz <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>�
z	<p>%s: %s�_z
<br>%s%s&nbsp;=
%sz�


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
)#�
isinstancer�__name__�sys�version�split�
executable�time�ctimer4r5Zheadingr	�escape�strr�inspect�getinnerframes�os�path�abspath�getargvalues�formatargvaluesr+�lenZ	preformatr r
rr6�join�dirr�	traceback�format_exception)"�einfo�context�etype�evalue�etb�pyver�date�head�indent�frames�recordsrrA�func�lines�index�link�args�varargs�varkwr�callr!r"�rows�ir)�num�done�dumprr*r%�	exceptionrrBrr5es�

�
��

��
$






��	��r5c 	s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	|�||fd}g}t
�||�}	|	D�]�\}
�}}}
}�r�tj
���p�d�t
�|
�\}}}}d}|dkr�d|}|d	kr�|t
j||||d
d�d�7}i�|gf��fd
d�	}t||
|�}d�|fg}|dk	�rP||}|
D](}d|}|�||���|d7}�q&ig}}|D]�\}}}||k�rv�q^d||<|tk	�r�|dk�r�d|}n|dk�r�||�d�d}|�d|tj�|�f�n|�|d��q^|�d�|��|�dd�|��qndt	|�t	|�fg}t|�D],}tj�t||��}|�dd||f��q*|d�|�d�|�dd�t�|||��S) z:Return a plain text document describing a given traceback.r-rr.z	%s
%s
%s
z�
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r/rr0r1cSsdtj�|�Sr2)r4rr6r7rrrr8�r9ztext.<locals>.<lambda>r:c
s8d�|d<zt��|d�W�S|dd7<XdSr;r=r@rBrrr!�sztext.<locals>.readerz %s %sNz%5d r<rzglobal rrrDz%s = %sz
 undefinedrEz
%s
z%s: %sz

%s%s = %sz    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rGrrHrIrJrKrLrMrNrPrQrRrSrTrUrVrWr+r �rstriprr4rr6rYrZrr[r\) r]r^r_r`rarbrcrdrfrgrrArhrirjrlrmrnrror!r"rprqr)rrrsrtrr*r%rurrBrr�sb

�






�rc@s,eZdZdZddd�Zdd	�Zd
d
d�ZdS)�Hookz?A hook to replace sys.excepthook that shows tracebacks in HTML.r<Nr,r5cCs(||_||_||_|ptj|_||_dS�N)�display�logdirr^rI�stdoutrC�format)�selfryrzr^rCr|rrr�__init__s
z
Hook.__init__cCs|�|||f�dSrx)�handle)r}r_r`rarrr�__call__
sz
Hook.__call__c
	Csz|p
t��}|jdkr$|j�t��|jdkr2tp4t}d}z|||j�}Wn d�	t
j|��}d}YnX|jr�|r�t
j�|�}|j�d|d�q�|j�|d�n|j�d�|jdk	�rZd	d
g|jdk}tj||jd�\}}z.t�|d��}|�|�W5QRXd
|}	Wnd|}	YnX|jdk�rJ|j�d|	�n|j�|	d�z|j��WnYnXdS)Nr5FrTz<pre>z</pre>
rEz*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrZ�wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)rI�exc_infor|rC�writerr5rr^rYr[r\ryr4rOrz�tempfileZmkstemprS�fdopen�flush)
r}�infoZ	formatterZplain�docr��fdrTrC�msgrrrrs@

zHook.handle)r<Nr,Nr5)N)rH�
__module__�__qualname__�__doc__r~r�rrrrrrws�
rwr<cCst||||d�t_dS)aInstall an exception handler that formats tracebacks as HTML.

    The optional argument 'display' can be set to 0 to suppress sending the
    traceback to the browser, and 'logdir' can be set to a directory to cause
    tracebacks to be written to files there.�ryrzr^r|N)rwrI�
excepthookr�rrr�enable:s�r�)r,)r,)r<Nr,r5)r�rQrr>rSr4rIr�rMrr[rrrr	r
rr+r5rrwrZhandlerr�rrrr�<module>s,

[
B7secrets.cpython-38.opt-1.pyc000064400000004220151450073350011604 0ustar00U

e5d��@s�dZddddddddgZd	d
lZd	d
lZd	d
lZd	dlmZd	dlmZe�Z	e	j
Ze	jZd
d�Z
dZddd�Zddd�Zddd�Zd
S)z�Generate cryptographically strong pseudo-random numbers suitable for
managing secrets such as account authentication, tokens, and similar.

See PEP 506 for more information.
https://www.python.org/dev/peps/pep-0506/

�choice�	randbelow�randbits�SystemRandom�token_bytes�	token_hex�
token_urlsafe�compare_digest�N)r)rcCs|dkrtd��t�|�S)z(Return a random int in the range [0, n).r	zUpper bound must be positive.)�
ValueError�_sysrandZ
_randbelow)Zexclusive_upper_bound�r�/usr/lib64/python3.8/secrets.pyrs� cCs|dkrt}t�|�S)z�Return a random byte string containing *nbytes* bytes.

    If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_bytes(16)  #doctest:+SKIP
    b'\xebr\x17D*t\xae\xd4\xe3S\xb6\xe2\xebP1\x8b'

    N)�DEFAULT_ENTROPY�os�urandom��nbytesrrr
r#s
cCst�t|���d�S)a"Return a random text string, in hexadecimal.

    The string has *nbytes* random bytes, each byte converted to two
    hex digits.  If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_hex(16)  #doctest:+SKIP
    'f9bf78b9a18ce6d46a0cd2b0b86df9da'

    �ascii)�binasciiZhexlifyr�decoderrrr
r1scCst|�}t�|��d��d�S)z�Return a random URL-safe text string, in Base64 encoding.

    The string has *nbytes* random bytes.  If *nbytes* is ``None``
    or not supplied, a reasonable default is used.

    >>> token_urlsafe(16)  #doctest:+SKIP
    'Drmhze6EPcv0fN_81Bj-nA'

    �=r)r�base64Zurlsafe_b64encode�rstripr)r�tokrrr
r>s
)N)N)N)�__doc__�__all__rrrZhmacrZrandomrrZgetrandbitsrrrrrrrrrrr
�<module>s&�


tracemalloc.cpython-38.pyc000064400000041725151450073350011476 0ustar00U

e5d�B�@sddlmZmZddlmZddlZddlZddlZddl	Z	ddl
Tddl
mZmZdd�Z
Gdd	�d	�ZGd
d�d�Zdd
�ZeGdd�d��ZeGdd�de��Zdd�ZGdd�d�ZGdd�de�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGd d!�d!�Zd"d#�ZdS)$�)�Sequence�Iterable)�total_orderingN)�*)�_get_object_traceback�_get_tracescCs�dD]|}t|�dkr@|dkr@|r0d||fSd||fSt|�dksT|dkrx|rhd||fSd	||fS|d
}qdS)N)�BZKiBZMiBZGiB�TiB�drz%+.1f %sz%.1f %si(r	z%+.0f %sz%.0f %si)�abs)�sizeZsignZunit�r
�#/usr/lib64/python3.8/tracemalloc.py�_format_size
src@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�	StatisticzS
    Statistic difference on memory allocations between two Snapshot instance.
    ��	tracebackr�countcCs||_||_||_dS�Nr)�selfrrrr
r
r�__init__%szStatistic.__init__cCst|j|j|jf�Sr)�hashrrr�rr
r
r�__hash__*szStatistic.__hash__cCs$|j|jko"|j|jko"|j|jkSrr�r�otherr
r
r�__eq__-s

�
�zStatistic.__eq__cCsBd|jt|jd�|jf}|jr>|j|j}|dt|d�7}|S)Nz%s: size=%s, count=%iF�, average=%s)rrrr�r�textZaverager
r
r�__str__2s
��zStatistic.__str__cCsd|j|j|jfS)Nz)<Statistic traceback=%r size=%i count=%i>rrr
r
r�__repr__<s�zStatistic.__repr__cCs|j|j|jfSr)rrrrr
r
r�	_sort_key@szStatistic._sort_keyN��__name__�
__module__�__qualname__�__doc__�	__slots__rrrr r!r"r
r
r
rrs
rc@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
StatisticDiffzd
    Statistic difference on memory allocations between an old and a new
    Snapshot instance.
    �rr�	size_diffr�
count_diffcCs"||_||_||_||_||_dSrr*)rrrr+rr,r
r
rrKs
zStatisticDiff.__init__cCst|j|j|j|j|jf�Sr)rrrr+rr,rr
r
rrRs�zStatisticDiff.__hash__cCs<|j|jko:|j|jko:|j|jko:|j|jko:|j|jkSrr*rr
r
rrVs
�
�
�
�zStatisticDiff.__eq__cCsPd|jt|jd�t|jd�|j|jf}|jrL|j|j}|dt|d�7}|S)Nz %s: size=%s (%s), count=%i (%+i)FTr)rrrr+rr,rr
r
rr ]s

��zStatisticDiff.__str__cCsd|j|j|j|j|jfS)Nz9<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>r*rr
r
rr!is��zStatisticDiff.__repr__cCs t|j�|jt|j�|j|jfSr)rr+rr,rrrr
r
rr"ns
�zStatisticDiff._sort_keyNr#r
r
r
rr)Dsr)cCs�g}|��D]d\}}|�|d�}|dk	rNt||j|j|j|j|j|j�}nt||j|j|j|j�}|�|�q|��D]*\}}t|d|jd|j�}|�|�qz|S�Nr)�items�popr)rr�append)�	old_group�	new_group�
statisticsr�statZpreviousr
r
r�_compare_grouped_statsts*

��r5c@s\eZdZdZdZdd�Zedd��Zedd��Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Framez
    Frame of a traceback.
    ��_framecCs
||_dSrr7�r�framer
r
rr�szFrame.__init__cCs
|jdSr-r7rr
r
r�filename�szFrame.filenamecCs
|jdS�N�r7rr
r
r�lineno�szFrame.linenocCs|j|jkSrr7rr
r
rr�szFrame.__eq__cCs|j|jkSrr7rr
r
r�__lt__�szFrame.__lt__cCs
t|j�Sr)rr8rr
r
rr�szFrame.__hash__cCsd|j|jfS)Nz%s:%s�r;r>rr
r
rr �sz
Frame.__str__cCsd|j|jfS)Nz<Frame filename=%r lineno=%r>r@rr
r
rr!�szFrame.__repr__N)r$r%r&r'r(r�propertyr;r>rr?rr r!r
r
r
rr6�s

r6c@sfeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�	Tracebackz`
    Sequence of Frame instances sorted from the oldest frame
    to the most recent frame.
    ��_framescCst�|�tt|��|_dSr)rr�tuple�reversedrD)r�framesr
r
rr�s
zTraceback.__init__cCs
t|j�Sr)�lenrDrr
r
r�__len__�szTraceback.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r6��.0�tracer
r
r�	<genexpr>�sz(Traceback.__getitem__.<locals>.<genexpr>)�
isinstance�slicerErDr6�r�indexr
r
r�__getitem__�s
zTraceback.__getitem__cCs|j|jkSr)r8rDr9r
r
r�__contains__�szTraceback.__contains__cCs
t|j�Sr)rrDrr
r
rr�szTraceback.__hash__cCs|j|jkSrrCrr
r
rr�szTraceback.__eq__cCs|j|jkSrrCrr
r
rr?�szTraceback.__lt__cCst|d�Sr-)�strrr
r
rr �szTraceback.__str__cCsdt|�fS)Nz<Traceback %r>)rErr
r
rr!�szTraceback.__repr__NFcCs�g}|dk	r2|dkr$||d�}q6|d|�}n|}|rBt|�}|D]@}|�d|j|jf�t�|j|j���}|rF|�d|�qF|S)Nrz  File "%s", line %sz    %s)rFr0r;r>�	linecache�getline�strip)r�limitZmost_recent_first�linesZframe_slicer:�liner
r
r�format�s 
�zTraceback.format)NF)r$r%r&r'r(rrIrRrSrrr?r r!r[r
r
r
rrB�srBcCs t|�}|dk	rt|�SdSdS)z�
    Get the traceback where the Python object *obj* was allocated.
    Return a Traceback instance.

    Return None if the tracemalloc module is not tracing memory allocations or
    did not trace the allocation of the object.
    N)rrB)�objrGr
r
r�get_object_traceback�sr]c@s`eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Tracez"
    Trace of a memory block.
    ��_tracecCs
||_dSrr_�rrLr
r
rrszTrace.__init__cCs
|jdSr-r_rr
r
r�domainszTrace.domaincCs
|jdSr<r_rr
r
rr	sz
Trace.sizecCst|jd�S)N�)rBr`rr
r
rr
szTrace.tracebackcCs|j|jkSrr_rr
r
rrszTrace.__eq__cCs
t|j�Sr)rr`rr
r
rrszTrace.__hash__cCsd|jt|jd�fS)Nz%s: %sF)rrrrr
r
rr sz
Trace.__str__cCsd|jt|jd�|jfS)Nz'<Trace domain=%s size=%s, traceback=%r>F)rbrrrrr
r
rr!s�zTrace.__repr__N)r$r%r&r'r(rrArbrrrrr r!r
r
r
rr^�s


r^c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_TracescCst�|�||_dSr)rr�_traces)r�tracesr
r
rr s
z_Traces.__init__cCs
t|j�Sr)rHrerr
r
rrI%sz_Traces.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r^rJr
r
rrM*sz&_Traces.__getitem__.<locals>.<genexpr>)rNrOrErer^rPr
r
rrR(s
z_Traces.__getitem__cCs|j|jkSr)r`rerar
r
rrS.sz_Traces.__contains__cCs|j|jkSr)rerr
r
rr1sz_Traces.__eq__cCsdt|�S)Nz<Traces len=%s>)rHrr
r
rr!4sz_Traces.__repr__N)	r$r%r&rrIrRrSrr!r
r
r
rrdsrdcCs&tj�|�}|�d�r"|dd�}|S)Nz.pyc���)�os�path�normcase�endswith)r;r
r
r�_normalize_filename8s
rlc@seZdZdd�Zdd�ZdS)�
BaseFiltercCs
||_dSr)�	inclusive)rrnr
r
rr@szBaseFilter.__init__cCst�dSr)�NotImplementedErrorrar
r
r�_matchCszBaseFilter._matchN)r$r%r&rrpr
r
r
rrm?srmcsJeZdZd�fdd�	Zedd��Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�FilterNFcs2t��|�||_t|�|_||_||_||_dSr)�superrrnrl�_filename_patternr>�
all_framesrb)rrn�filename_patternr>rtrb��	__class__r
rrHs
zFilter.__init__cCs|jSr)rsrr
r
rruQszFilter.filename_patterncCs6t|�}t�||j�sdS|jdkr(dS||jkSdS)NFT)rl�fnmatchrsr>�rr;r>r
r
r�_match_frame_implUs
zFilter._match_frame_implcCs|�||�|jASr)rzrnryr
r
r�_match_frame^szFilter._match_framecsH�jr,t�fdd�|D��r"�jS�jSn|d\}}��||�SdS)Nc3s|]\}}��||�VqdSr)rz)rKr;r>rr
rrMcs�z*Filter._match_traceback.<locals>.<genexpr>r)rt�anyrnr{)rrr;r>r
rr�_match_tracebackas�
zFilter._match_tracebackcCsD|\}}}|�|�}|jdk	r@|jr2|o0||jkS|p>||jkS|Sr)r}rbrn)rrLrbrr�resr
r
rrpls


z
Filter._match)NFN)r$r%r&rrArurzr{r}rp�
__classcell__r
r
rvrrqGs�	
	rqcs0eZdZ�fdd�Zedd��Zdd�Z�ZS)�DomainFiltercst��|�||_dSr)rrr�_domain)rrnrbrvr
rrxszDomainFilter.__init__cCs|jSr)r�rr
r
rrb|szDomainFilter.domaincCs|\}}}||jk|jASr)rbrn)rrLrbrrr
r
rrp�s
zDomainFilter._match)r$r%r&rrArbrprr
r
rvrr�ws
r�c@sXeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�ZdS)�SnapshotzB
    Snapshot of traces of memory blocks allocated by Python.
    cCst|�|_||_dSr)rdrf�traceback_limit)rrfr�r
r
rr�s
zSnapshot.__init__c	Cs*t|d��}t�||tj�W5QRXdS)z1
        Write the snapshot into a file.
        �wbN)�open�pickle�dumpZHIGHEST_PROTOCOL)rr;�fpr
r
rr��sz
Snapshot.dumpc
Cs,t|d��}t�|�W5QR�SQRXdS)z.
        Load a snapshot from a file.
        �rbN)r�r��load)r;r�r
r
rr��sz
Snapshot.loadcs@|rt�fdd�|D��sdS|r<t�fdd�|D��r<dSdS)Nc3s|]}|���VqdSr�rp�rK�trace_filter�rLr
rrM�s�z)Snapshot._filter_trace.<locals>.<genexpr>Fc3s|]}|���VqdSrr�r�r�r
rrM�s�T)r|)r�include_filters�exclude_filtersrLr
r�r�
_filter_trace�s��zSnapshot._filter_tracecs�t|t�stdt|�j��|rjg�g�|D] }|jrB��|�q,��|�q,���fdd��jjD�}n�jj�	�}t
|�j�S)z�
        Create a new Snapshot instance with a filtered traces sequence, filters
        is a list of Filter or DomainFilter instances.  If filters is an empty
        list, return a new Snapshot instance with a copy of the traces.
        z)filters must be a list of filters, not %scsg|]}����|�r|�qSr
)r�rJ�r�r�rr
r�
<listcomp>�s��z*Snapshot.filter_traces.<locals>.<listcomp>)rNr�	TypeError�typer$rnr0rfre�copyr�r�)r�filtersr�Z
new_tracesr
r�r�
filter_traces�s
�zSnapshot.filter_tracesc

Cs�|dkrtd|f��|r.|dkr.td|��i}i}|�s|jjD]�}|\}}}z||}	WnZtk
r�|dkr||}
n(|dkr�|dd�}
n|dddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_WqDtk
�rt|	|d�||	<YqDXqDn�|jjD]�}|\}}}|D]�}z||}	WnFtk
�r~|dk�r\|f}
n|ddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_Wn&tk
�r�t|	|d�||	<YnX�q(�q|S)	N)rr;r>zunknown key_type: %r)r>r;z/cumulative mode cannot by used with key type %rrr>r=r)�
ValueErrorrfre�KeyErrorrBrrr)
r�key_type�
cumulativeZstatsZ
tracebacksrLrbrZtrace_tracebackrrGr4r:r
r
r�	_group_by�sZ�


zSnapshot._group_byFcCs,|�||�}t|���}|jdtjd�|S)zd
        Group statistics by key_type. Return a sorted list of Statistic
        instances.
        T��reverse�key)r��list�values�sortrr")rr�r�Zgroupedr3r
r
rr3�szSnapshot.statisticscCs6|�||�}|�||�}t||�}|jdtjd�|S)z�
        Compute the differences with an old snapshot old_snapshot. Get
        statistics as a sorted list of StatisticDiff instances, grouped by
        group_by.
        Tr�)r�r5r�r)r")rZold_snapshotr�r�r2r1r3r
r
r�
compare_tos

zSnapshot.compare_toN)F)F)
r$r%r&r'rr��staticmethodr�r�r�r�r3r�r
r
r
rr��s
3

r�cCs$t�std��t�}t�}t||�S)zI
    Take a snapshot of traces of memory blocks allocated by Python.
    zLthe tracemalloc module must be tracing memory allocations to take a snapshot)�
is_tracing�RuntimeErrorrZget_traceback_limitr�)rfr�r
r
r�
take_snapshot
s
r�)Zcollections.abcrr�	functoolsrrxrUZos.pathrhr�Z_tracemallocrrrrr)r5r6rBr]r^rdrlrmrqr�r�r�r
r
r
r�<module>s2&0"?%0	copyreg.cpython-38.opt-2.pyc000064400000006633151450073350011617 0ustar00U

e5d��@s�dddddgZiZddd�Zdd�ZzeWnek
r@YnXdd	�Zeeee�d
d�ZdZd
d�Z	dd�Z
dd�Zdd�ZiZ
iZiZdd�Zdd�Zdd�ZdS)�pickle�constructor�
add_extension�remove_extension�clear_extension_cacheNcCs,t|�std��|t|<|dk	r(t|�dS)Nz$reduction functions must be callable)�callable�	TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�/usr/lib64/python3.8/copyreg.pyrs
cCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rscCst|j|jffS�N)�complex�real�imag)�crrr
�pickle_complex"srcCs<|tkrt�|�}n$|�||�}|jtjkr8|�||�|Sr)r�__new__�__init__)�cls�base�state�objrrr
�_reconstructor)sricCs�|j}|jD]}t|d�r|jt@sq.qt}|tkr<d}n"||krVtd|j�d���||�}|||f}z
|j}Wn\t	k
r�t
|dd�r�td|j�d|���d�z
|j}Wnt	k
r�d}YnXYnX|�}|r�t||fSt|fSdS)N�	__flags__zcannot pickle z object�	__slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )
�	__class__�__mro__�hasattrr�	_HEAPTYPErr�__name__�__getstate__�AttributeError�getattr�__dict__r)�self�protorrr�args�getstate�dictrrr
�
_reduce_ex6s4


�

r,cGs|j|f|��Sr�r)rr)rrr
�
__newobj__Zsr.cCs|j|f|�|�Srr-)rr)�kwargsrrr
�
__newobj_ex__]sr0cCs�|j�d�}|dk	r|Sg}t|d�s(n�|jD]�}d|jkr.|jd}t|t�rV|f}|D]^}|dkrjqZqZ|�d�r�|�d�s�|j�	d�}|r�|�
d||f�q�|�
|�qZ|�
|�qZq.z
||_WnYnX|S)N�
__slotnames__r)r&�__weakref__�__�_z_%s%s)r&�getr r�
isinstance�str�
startswith�endswithr"�lstrip�appendr1)r�namesr�slots�name�strippedrrr
�
_slotnamescs2





r@cCs�t|�}d|krdks&ntd��||f}t�|�|krNt�|�|krNdS|tkrjtd|t|f��|tkr�td|t|f��|t|<|t|<dS)N�i���zcode out of rangez)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr5�_inverted_registry��moduler>�code�keyrrr
r�s$�
�
�cCsR||f}t�|�|ks$t�|�|kr4td||f��t|=t|=|tkrNt|=dS)Nz%key %s is not registered with code %s)rDr5rErC�_extension_cacherFrrr
r�s��cCst��dSr)rJ�clearrrrr
r�s)N)�__all__rrrr�	NameErrorrrr!r,r.r0r@rDrErJrrrrrrr
�<module>s2�

	$<pyclbr.cpython-38.opt-1.pyc000064400000024325151450073350011437 0ustar00U

e5d�;�@s�dZddlZddlZddlZddlZddlmZmZm	Z	ddddgZ
iZGdd	�d	�ZGd
d�de�Z
Gdd�de�Zdd
�Zddd�Zddd�Zddd�Zd dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�dS)!aParse a Python module and describe its classes and functions.

Parse enough of a Python file to recognize imports and class and
function definitions, and to find out the superclasses of a class.

The interface consists of a single function:
    readmodule_ex(module, path=None)
where module is the name of a Python module, and path is an optional
list of directories where the module is to be searched.  If present,
path is prepended to the system search path sys.path.  The return value
is a dictionary.  The keys of the dictionary are the names of the
classes and functions defined in the module (including classes that are
defined via the from XXX import YYY construct).  The values are
instances of classes Class and Function.  One special key/value pair is
present for packages: the key '__path__' has a list as its value which
contains the package search path.

Classes and Functions have a common superclass: _Object.  Every instance
has the following attributes:
    module  -- name of the module;
    name    -- name of the object;
    file    -- file in which the object is defined;
    lineno  -- line in the file where the object's definition starts;
    parent  -- parent of this object, if any;
    children -- nested objects contained in this object.
The 'children' attribute is a dictionary mapping names to objects.

Instances of Function describe functions with the attributes from _Object.

Instances of Class describe classes with the attributes from _Object,
plus the following:
    super   -- list of super classes (Class instances if possible);
    methods -- mapping of method names to beginning line numbers.
If the name of a super class is not recognized, the corresponding
entry in the list of super classes is not a class instance but a
string giving the name of the super class.  Since import statements
are recognized and imported modules are scanned as well, this
shouldn't happen often.
�N)�NAME�DEDENT�OP�
readmodule�
readmodule_ex�Class�Functionc@s eZdZdZdd�Zdd�ZdS)�_Objectz+Information about Python class or function.cCs(||_||_||_||_||_i|_dS�N)�module�name�file�lineno�parent�children��selfrrr
rr�r�/usr/lib64/python3.8/pyclbr.py�__init__6sz_Object.__init__cCs||j|<dSr
)r)rr�objrrr�	_addchild>sz_Object._addchildN)�__name__�
__module__�__qualname__�__doc__rrrrrrr	4sr	c@seZdZdZddd�ZdS)rz7Information about a Python function, including methods.NcCst�||||||�dSr
)r	rrrrrrDszFunction.__init__)N)rrrrrrrrrrBscs*eZdZdZd�fdd�	Zdd�Z�ZS)rz!Information about a Python class.Ncs0t�||||||�|dkr gn||_i|_dSr
)r	r�super�methods)rrrrr
rr��	__class__rrrJszClass.__init__cCs||j|<dSr
)r)rrrrrr�
_addmethodOszClass._addmethod)N)rrrrrr �
__classcell__rrrrrHscCs:t|j||j||�}|�||�t|t�r6|�||�|S)z*Return a Function after nesting within ob.)rrr
r�
isinstancerr )�ob�	func_namerZnewfuncrrr�_nest_functionSs

r%cCs&t|j|||j||�}|�||�|S)z'Return a Class after nesting within ob.)rrr
r)r#�
class_namerrZnewclassrrr�_nest_class[sr'cCs6i}t||pg���D]\}}t|t�r|||<q|S)z�Return Class objects for the top-level classes in module.

    This is the original interface, before Functions were added.
    )�_readmodule�itemsr"r)r�path�res�key�valuerrrras


cCst||p
g�S)z�Return a dictionary with all functions and classes in module.

    Search for module in PATH + sys.path.
    If possible, include imported superclasses.
    Do this by reading source, without importing (and executing) it.
    )r()rr*rrrrmsc	Cs�|dk	rd||f}n|}|tkr*t|Si}|tjkrL|dkrL|t|<|S|�d�}|dkr�|d|�}||dd�}t|||�}|dk	r�d||f}d|kr�td�|���t||d|�Sd}	|dk	r�|}
n
|tj}
tj	�
||
�}|dk�rtd|��|d	��|t|<|jdk	�r$|j|d<z|j
�|�}Wnttfk
�rR|YSX|dk�rb|S|j
�|�}
t|||
|||�S)
a.Do the hard work for readmodule[_ex].

    If inpackage is given, it must be the dotted name of the package in
    which we are searching for a submodule, and then PATH must be the
    package search path; otherwise, we are searching for a top-level
    module, and path is combined with sys.path.
    Nz%s.%s�.r��__path__zNo package named {}zno module named )r)�_modules�sys�builtin_module_names�rfindr(�ImportError�formatr*�	importlib�util�_find_spec_from_path�ModuleNotFoundError�submodule_search_locations�loader�
get_source�AttributeError�get_filename�_create_tree)rr*�	inpackage�
fullmodule�tree�i�packageZ	submoduler�fZsearch_path�spec�source�fnamerrrr(vsJ	





r(c!
CsHt�|�}g}t�|j�}�z|D�]�\}	}
}}}
|	tkr`|\}}|r^|dd|kr^|d=qBq"|
dkr�|\}}|r�|dd|kr�|d=qpt|�dd�\}	}}|	tkr�q"d}|r�|dd}t|||�}nt	||||�}|||<|�
||f�q"|
dk�r�|\}}|�r(|dd|k�r(|d=�qt|�dd�\}	}}|	tk�rJq"t|�dd�\}	}
}d}|
dk�r�g}d}g}t|�dd�\}	}
}|
d	k�r|dk�rd
�|�}||k�r�||}nL|�d�}t
|�dk�r|d}|d}|tk�rt|}||k�r||}|�
|�g}|
dk�r0|d7}nZ|
d
k�rR|d8}|dk�r��q�n8|
dk�rh|dk�rhn"|	ttfk�rz|dk�rz|�
|
��qz|}|�r�|dd}t||||�}nt|||||�}|||<|�
||f�q"|
dk�rh|ddk�rht|�}|D]d\}}zL|dk�r t||�n2zt|||�Wn tk
�rPt|g�YnXWnYnX�qq"|
dkr"|ddkr"t|�\}}
|r"|
dk�r�q"t|�}zt|||�}WnYq"YnX|D]X\}} ||k�r�|||| �p�|<n0|dk�r�|D] }|ddk�r�||||<�q��q�q"Wntk
�r:YnX|��|S)a�Return the tree for a particular module.

    fullmodule (full module name), inpackage+module, becomes o.module.
    path is passed to recursive calls of _readmodule.
    fname becomes o.file.
    source is tokenized.  Imports cause recursive calls to _readmodule.
    tree is {} or {'__path__': <submodule search locations>}.
    inpackage, None or string, is passed to recursive calls of _readmodule.

    The effect of recursive calls is mutation of global _modules.
    ���r/�defr�N�class�()�)�,�r.���rOrP�import�from�*�_)�io�StringIO�tokenize�generate_tokens�readliner�nextrr%r�append�join�split�lenr1rr'r�_getnamelistr(r5�_getname�
StopIteration�close)!rBr*rIrHrCrArF�stack�g�	tokentype�token�startZ_end�_linerZ
thisindentr$Zcur_funcZcur_objr&Zinherit�names�levelr�n�c�m�dZ	cur_class�modules�modZ_mod2Zn2rrrr@�s�
















��



r@cCslg}t|�\}}|sqh|dkr,t|�\}}nd}|�||f�|dkr\d|kr\t|�d}q>|dkrqhq|S)z�Return list of (dotted-name, as-name or None) tuples for token source g.

    An as-name is the name that follows 'as' in an as clause.
    �asNrP�
r/)rbr]r\)rfrkrrhZname2rrrraEsracCs�g}t|�dd�\}}|tkr0|dkr0d|fS|�|�t|�dd�\}}|dkrXq�t|�dd�\}}|tkrvq�|�|�q:d�|�|fS)zBReturn (dotted-name or None, next-token) tuple for token source g.r�rUNr.)r\rr]r^)rf�partsrgrhrrrrb[s
rbc
CsXddl}ztjd}Wnt}YnX|j�|�rj|j�|�g}|j�|�}|���	d�rn|dd�}ng}t
||�}dd�}t|��|dd	�}d
}|�rT|�
�}t|t�r�q�t|d�s�d|_t|t�r�t|j��|dd	�}|D]}	|j||	_q�|�|�t|t��r,td�d
|j|j|j|j��q�t|t�r�td�d
|j|j|j��q�dS)z?Print module output (default this file) for quick visual check.rNr/z.py���cSst|dd�S)Nrr)�getattr)�arrr�<lambda>|�z_main.<locals>.<lambda>T)r,�reverseru�indentz{}class {} {} {}� z{}def {} {})�osr2�argv�__file__r*�exists�dirname�basename�lower�endswithr�sorted�values�popr"�list�hasattrr}r	r�extendr�printr6rrrr)
rrrr*rCZ
lineno_keyZobjsZindent_levelrZnew_objsr#rrr�_mainmsL





�
�
r��__main__)N)N)N)N)rrWr2�importlib.utilr7rYrhrrr�__all__r1r	rrr%r'rrr(r@rarbr�rrrrr�<module>s,(


	
@&imghdr.cpython-38.opt-1.pyc000064400000010030151450073350011402 0ustar00U

e5d��@s2dZddlmZdgZd%dd�ZgZdd�Ze�e�dd	�Ze�e�d
d�Z	e�e	�dd
�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�d d!�Zd"d#�Zed$k�r.e�dS)&z<Recognize image file formats based on their first few bytes.�)�PathLike�whatNcCs�d}zp|dkrNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�tD]}|||�}|rR|W�SqRW5|r�|��XdS)N�rb� )	�close�
isinstance�strr�open�read�tell�seek�tests)�file�h�f�locationZtf�res�r�/usr/lib64/python3.8/imghdr.pyrs 




cCs|dd�dkrdSdS)z JPEG data in JFIF or Exif format��
)sJFIFsExifZjpegNr�rrrrr�	test_jpeg%srcCs|�d�rdSdS)Ns�PNG

Zpng��
startswithrrrr�test_png,s
rcCs|dd�dkrdSdS)zGIF ('87 and '89 variants)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2srcCs|dd�dkrdSdS)z-TIFF (can be in Motorola or Intel byte order)N�)sMMsIIZtiffrrrrr�	test_tiff9srcCs|�d�rdSdS)zSGI image librarys�ZrgbNrrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPBM (portable bitmap)�r�P�s14r� 	

ZpbmN��len�ordrrrr�test_pbmGs�
�
�r'cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPGM (portable graymap)r rr!r"s25rr#ZpgmNr$rrrr�test_pgmOs�
�
�r(cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPPM (portable pixmap)r rr!r"s36rr#ZppmNr$rrrr�test_ppmWs�
�
�r)cCs|�d�rdSdS)zSun raster filesY�j�ZrastNrrrrr�	test_rast_s
r*cCs|�d�rdSdS)zX bitmap (X10 or X11)s#define ZxbmNrrrrr�test_xbmfs
r+cCs|�d�rdSdS)NsBMZbmprrrrr�test_bmpms
r,cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpssr/cCs|�d�rdSdS)Nsv/1Zexrrrrrr�test_exrys
r0cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr"z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r2�	recursiverrr�test�sr:c	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r2�os�path�isdir�print�glob�join�escaper4�stdout�flushr�OSError)�listr9Ztoplevelr2r?�filenamerC�namesrrrr4�s"

r4�__main__)N)�__doc__r?r�__all__rr
r�appendrrrrr'r(r)r*r+r,r/r0r:r4�__name__rrrr�<module>sD














sunau.cpython-38.opt-2.pyc000064400000030314151450073350011273 0ustar00U

e5d�G�@s�ddlmZddlZedd�ZdZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZeeeee	egZGdd�de�Zdd�Zdd�ZGdd�d�ZGdd�d�Zd!dd�Zd"dd �ZdS)#�)�
namedtupleN�
_sunau_paramsz7nchannels sampwidth framerate nframes comptype compnameidns.������������l��c@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/sunau.pyr�srcCs8d}td�D]&}|�d�}|s"t�|dt|�}q|S)Nrrr�)�range�read�EOFError�ord)�file�x�iZbyterrr�	_read_u32�s
rcCsFg}td�D]&}t|d�\}}|�dt|��|}q|�t|��dS)Nrrr)r�divmod�insert�int�write�bytes)rr�datar�d�mrrr�
_write_u32�sr'c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�Au_readcCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)N�r�rbTF��type�builtins�open�_opened�initfp��self�fr-rrr�__init__�szAu_read.__init__cCs|jr|��dS�N��_file�close�r2rrr�__del__�szAu_read.__del__cCs|Sr5rr9rrr�	__enter__�szAu_read.__enter__cGs|��dSr5�r8�r2�argsrrr�__exit__�szAu_read.__exit__c	Cs�||_d|_tt|��}|tkr(td��tt|��|_|jdkrHtd��|jdkrZtd��t|�|_|jtkrzt|j�|_tt|��|_	|j	t
kr�td��|j	ttfkr�d|_
d	|_nj|j	tkr�d	|_|_
nR|j	tkr�d|_|_
n:|j	tkr�d
|_|_
n"|j	tk�rd|_|_
ntd��tt|��|_tt|��|_|j�sLtd
��|j|j|_|jdk�r�|�|jd�|_|j�d�\|_}}nd|_z|��|_Wn ttfk
�r�d|_YnXdS)Nrzbad magic numberrzheader size too small�dzheader size ridiculously largezencoding not (yet) supportedrrrrzunknown encodingzbad # of channels��)r7�	_soundposr!r�AUDIO_FILE_MAGICrZ	_hdr_size�
_data_size�AUDIO_UNKNOWN_SIZE�	_encoding�_simple_encodings�AUDIO_FILE_ENCODING_MULAW_8�AUDIO_FILE_ENCODING_ALAW_8�
_sampwidth�
_framesize�AUDIO_FILE_ENCODING_LINEAR_8�AUDIO_FILE_ENCODING_LINEAR_16�AUDIO_FILE_ENCODING_LINEAR_24�AUDIO_FILE_ENCODING_LINEAR_32�
_framerate�
_nchannelsr�_info�	partition�tell�	_data_pos�AttributeError�OSError)r2r�magic�_rrrr0�sV




�


zAu_read.initfpcCs|jSr5)r7r9rrr�getfp�sz
Au_read.getfpcCs|jSr5)rRr9rrr�getnchannels�szAu_read.getnchannelscCs|jSr5)rKr9rrr�getsampwidth�szAu_read.getsampwidthcCs|jSr5)rQr9rrr�getframerate�szAu_read.getframeratecCs(|jtkrtS|jtkr$|j|jSdS�Nr)rErFrGrHrLr9rrr�
getnframes�s


zAu_read.getnframescCs$|jtkrdS|jtkrdSdSdS)N�ULAW�ALAW�NONE�rGrIrJr9rrr�getcomptype�s


zAu_read.getcomptypecCs$|jtkrdS|jtkrdSdSdS)N�CCITT G.711 u-law�CCITT G.711 A-law�not compressedrdr9rrr�getcompname�s


zAu_read.getcompnamecCs*t|��|��|��|��|��|���Sr5�rr\r]r^r`rerir9rrr�	getparamss�zAu_read.getparamscCsdSr5rr9rrr�
getmarkersszAu_read.getmarkerscCstd��dS)Nzno marks)r)r2�idrrr�getmarkszAu_read.getmarkcCsp|jtkrl|tkr|j��}n|j�||j�}|jt|�|j7_|jtkrhddl	}|�
||j�}|SdSr_)rGrHrFr7rrLrC�lenrI�audioopZulaw2linrK)r2�nframesr$rprrr�
readframess

zAu_read.readframescCs*|jdkrtd��|j�|j�d|_dS)N�cannot seekr)rVrXr7�seekrCr9rrr�rewinds
zAu_read.rewindcCs|jSr5)rCr9rrrrU!szAu_read.tellcCsP|dks||��krtd��|jdkr.td��|j�|j||j�||_dS)Nrzposition not in rangers)r`rrVrXr7rtrLrC)r2�posrrr�setpos$s
zAu_read.setposcCs"|j}|rd|_|jr|��dSr5)r7r/r8�r2rrrrr8,s
z
Au_read.closeN)rrrr4r:r;r?r0r[r\r]r^r`rerirkrlrnrrrurUrwr8rrrrr(�s(	.
r(c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3S)4�Au_writecCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)Nr)r�wbTFr+r1rrrr45szAu_write.__init__cCs|jr|��d|_dSr5r6r9rrrr:>szAu_write.__del__cCs|Sr5rr9rrrr;CszAu_write.__enter__cGs|��dSr5r<r=rrrr?FszAu_write.__exit__cCsF||_d|_d|_d|_d|_t|_d|_d|_d|_	d|_
d|_dS)NrrBra)r7rQrRrKrLrF�_nframes�_nframeswritten�_datawritten�_datalengthrS�	_comptyperxrrrr0IszAu_write.initfpcCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to write)rrrz"only 1, 2, or 4 channels supported)r|rrR)r2�	nchannelsrrr�setnchannelsVs
zAu_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rRrr9rrrr\]szAu_write.getnchannelscCs(|jrtd��|dkrtd��||_dS)Nr�)rrrrzbad sample width)r|rrK)r2�	sampwidthrrr�setsampwidthbs
zAu_write.setsampwidthcCs|jstd��|jS)N�sample width not specified)rQrrKr9rrrr]iszAu_write.getsampwidthcCs|jrtd��||_dS)Nr�)r|rrQ)r2�	frameraterrr�setframeratenszAu_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rQrr9rrrr^sszAu_write.getframeratecCs(|jrtd��|dkrtd��||_dS)Nr�rz# of frames cannot be negative)r|rr{)r2rqrrr�
setnframesxs
zAu_write.setnframescCs|jSr5�r|r9rrrr`szAu_write.getnframescCs|dkr||_ntd��dS)N)rcrazunknown compression type)rr)r2r,�namerrr�setcomptype�szAu_write.setcomptypecCs|jSr5�rr9rrrre�szAu_write.getcomptypecCs$|jdkrdS|jdkrdSdSdS)Nrarfrbrgrhr�r9rrrri�s


zAu_write.getcompnamecCsH|\}}}}}}|�|�|�|�|�|�|�|�|�||�dSr5)r�r�r�r�r�)r2Zparamsr�r�r�rqZcomptypeZcompnamerrr�	setparams�s



zAu_write.setparamscCs*t|��|��|��|��|��|���Sr5rjr9rrrrk�s�zAu_write.getparamscCs|jSr5r�r9rrrrU�sz
Au_write.tellcCs~t|ttf�st|��d�}|��|jdkrDddl}|�||j	�}t
|�|j}|j�
|�|j||_|jt
|�|_dS)N�Brar)�
isinstancer#�	bytearray�
memoryview�cast�_ensure_header_writtenrrpZlin2ulawrKrorLr7r"r|r})r2r$rprqrrr�writeframesraw�s
zAu_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSr5)r�r|r{r~r}�_patchheader)r2r$rrr�writeframes�s


�zAu_write.writeframescCs^|jrZz6|��|j|jks(|j|jkr0|��|j�	�W5|j}d|_|jrX|��XdSr5)
r7r/r8r�r|r{r~r}r��flushrxrrrr8�s
�zAu_write.closecCs<|js8|jstd��|js"td��|js0td��|��dS)Nz# of channels not specifiedr�zframe rate not specified)r|rRrrKrQ�
_write_headerr9rrrr��szAu_write._ensure_header_writtenc	Cs�|jdkrl|jdkr t}d|_q�|jdkr6t}d|_q�|jdkrLt}d|_q�|jdkrbt}d|_q�td��n|jdkr�t}d|_ntd��|j|j	|_t
|jt�dt
|j�}|d	d
@}t
|j|�|jtkr�t}n|j|j}z|j��|_Wn ttfk
�rd|_YnXt
|j|�||_t
|j|�t
|j|j�t
|j|j	�|j�|j�|j�d|t
|j�d�dS)
Nrcrrrrzinternal errorrar
r
i����rAr)rrKrMrLrNrOrPrrIrRr'r7rDrorSr{rFrU�_form_length_posrWrXr~rQr")r2�encoding�header_sizeZlengthrrrr��sJ







zAu_write._write_headercCsH|jdkrtd��|j�|j�t|j|j�|j|_|j�dd�dS)Nrsrr)r�rXr7rtr'r}r~r9rrrr��s
zAu_write._patchheaderN)rrrr4r:r;r?r0r�r\r�r]r�r^r�r`r�rerir�rkrUr�r�r8r�r�r�rrrrry3s2	

*rycCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder*)�rr*)�wrzz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�r(ryr�r3r�rrrr.s
r.cCstjdtdd�t||d�S)NzDsunau.openfp is deprecated since Python 3.7. Use sunau.open instead.r)�
stacklevel)r�)�warnings�warn�DeprecationWarningr.r�rrr�openfps
�r�)N)N)�collectionsrr�rrDrIrMrNrOrPZAUDIO_FILE_ENCODING_FLOATZAUDIO_FILE_ENCODING_DOUBLEZAUDIO_FILE_ENCODING_ADPCM_G721ZAUDIO_FILE_ENCODING_ADPCM_G722Z AUDIO_FILE_ENCODING_ADPCM_G723_3Z AUDIO_FILE_ENCODING_ADPCM_G723_5rJrFrH�	Exceptionrrr'r(ryr.r�rrrr�<module>jsD��	Q

platform.cpython-38.opt-2.pyc000064400000040104151450073350011762 0ustar00U

e5d��@shdZdZddlZddlZddlZddlZddddddddd	d	d
�
Ze�d�Zdd
�Z	e�dej
�Zdvdd�Zdwdd�Z
e�d�Zdxdd�Zdddddddd d!d"d#d$�Zdd%d&d'd(d)d*�Zd+d,�Zd-d.�Zdyd/d0�Zd1d2�Zdzd4d5�Zd6d7�Zd{d8d9�Zd:d;�Zd<d=�Zd|d>d?�Zd@dA�Zd}dBdC�Zd~dDdE�ZdFdGdHd�Zej ddfdIdJ�Z!e�"dKdL�Z#da$dMdN�Z%dOdP�Z&dQdR�Z'dSdT�Z(dUdV�Z)dWdX�Z*dYdZ�Z+e�d[ej
�Z,e�d\ej
�Z-e�d]�Z.e�d^�Z/iZ0dd_d`�Z1dadb�Z2dcdd�Z3dedf�Z4dgdh�Z5didj�Z6dkdl�Z7dmdn�Z8iZ9d�dodp�Z:e;dqk�rddrej<k�p4dsej<kZ=dtej<k�oJduej<kZ>e?e:e>e=��e�@d�dS)�a
    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee or royalty is hereby granted,
    provided that the above copyright notice appear in all copies and that
    both that copyright notice and this permission notice appear in
    supporting documentation or portions thereof, including modifications,
    that you make.

    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !

z1.0.8�N�
���(�2��)
ZdevZalpha�aZbeta�b�cZRCZrc�pl�pz([0-9]+|[._+-])c	Csbg}t�|�D]N}|dkrzt|d�}d}Wn tk
rLt�|d�}YnX|�||f�q|S)Nz._+-r�dr)�
_component_re�split�int�
ValueError�_ver_stages�get�extend)�version�result�v�t�r� /usr/lib64/python3.8/platform.py�_comparable_version�s
rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)��@c
Cs�|dkrZz0t�d�}|jdd�}t|�dkr6t|�WSWntttfk
rRYnXtj	}t
}ttjd�rvtj�
|�}t|d���`}|�|�}d}	|	t|�k�r�d|ks�d	|kr�t�||	�}
nd}
|
r�|
��t|�k�r|�|�}|�r|t|	t|�d
�d�|}d}	q�|
�s�q�dd�|
��D�\}}
}}}}|�rF|�sFd
}n�|
�rx|dk�r`d}|}n||�||�k�r�|}n\|�r�|dk�r�d
}|�r�|�r�||�||�k�r�|}|�r�|t|�d�|k�r�||}|
��}	q�W5QRX||fS)N�CS_GNU_LIBC_VERSION�)�maxsplit��realpath�rbrslibcsGLIBCi�cSs"g|]}|dk	r|�d�n|�qS)N�latin1)�decode)�.0�srrr�
<listcomp>�s�zlibc_ver.<locals>.<listcomp>Zlibc�glibc)�os�confstrr�len�tuple�AttributeErrorr�OSError�sys�
executabler�hasattr�pathr"�open�read�_libc_search�search�end�max�groups)r1�librZ	chunksize�ver�parts�V�fZbinary�pos�m�chunkZlibcinitr)ZglibcversionZsoZthreadsZ	soversionrrr�libc_ver�s^


�

rCcCs`|�d�}|r|�|�zttttt|���}Wntk
rH|}YnXd�|dd��}|S)N�.�)r�append�list�map�strrr�join)r�build�lZstringsrrr�
_norm_version�s


rMz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc	Cs�tj|kr|||fSddl}dD]R}z|j||jddd�}Wn0t|jfk
rl}zWY�q W5d}~XYq Xq~q |||fS|��}t�	|�}|dk	r�|�
�\}}}|ddkr�|dd�}|ddkr�|dd�}t|�}|||fS)Nr)r<zcommand /c verz
cmd /c verT)�stderr�text�shell���rD)r0�platform�
subprocess�check_output�DEVNULLr/�CalledProcessError�strip�_ver_output�matchr:rM)	�system�releaserZsupported_platformsrW�cmd�infoZwhyrArrr�_syscmd_vers0

�


rbZ2000ZXPZ
2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10))�r)rfr�rfr!)rfN��r�rir�rir!�rirE�riN)rr)rNZ
2008ServerZ2008ServerR2Z
2012ServerZ2012ServerR2Zpost2012ServerR2)rgrhrjrkrlrmcCs
t�dkS)N)ZIoTUAPZ
NanoServerZWindowsCoreHeadlessZ	IoTEdgeOS)�
win32_editionrrrr�win32_is_iotOsroc
Cs�z.zddl}Wntk
r*ddl}YnXWntk
rBYnTXz<d}|�|j|�� }|�|d�dW5QR�WSQRXWntk
r�YnXdS)Nr�,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ	EditionId)�winreg�ImportError�_winreg�	OpenKeyEx�HKEY_LOCAL_MACHINE�QueryValueExr/)rq�cvkey�keyrrrrnRs(rnc	Cs�zddlm}Wn tk
r0||||fYSX|�}z ttt�d�d��\}}}Wn,tk
r�|jpx|dd�\}}}YnXd�	|||�}t
�||f�p�t
�|df�p�|}|dd�||fk�rzd�	|j�}Wn8t
k
�r|dd�d	k�rd
|dd�}YnXt|dd�dk�rJt�||f��pHt�|df��pH|}z0zddl}	Wntk
�rvddl}	YnXWntk
�r�YnLXz2d}
|	�|	j|
��}|	�|d
�d}W5QRXWntk
�r�YnX||||fS)Nr)�getwindowsversionr!rDrEz{0}.{1}.{2}zSP{}�
z
Service Pack ZSPZproduct_typerpZCurrentType)r0ryrrrHrrbrrZplatform_version�format�_WIN32_CLIENT_RELEASESrZservice_pack_majorr.�getattr�_WIN32_SERVER_RELEASESrqrsrtrurvr/)r_r�csd�ptyperyZwinver�major�minorrKrqrwrxrrr�	win32_verdsR ����r�c	Cs�d}tj�|�sdSzddl}Wntk
r6YdSXt|d��}|�|�}W5QRX|d}d}t��j}|dkrzd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr#ZProductVersion�rrr)ZppczPower MacintoshZPowerPC)	r*r3�exists�plistlibrrr4�load�uname�machine)�fnr�r?rr_�versioninfor�rrr�_mac_ver_xml�s
r�r�cCst�}|dk	r|S|||fS�N)r�)r_r�r�rarrr�mac_ver�sr�cCsHddlm}z|�|�}|dkr&|WS|WStk
rB|YSXdS)Nr)�System)�	java.langr�ZgetPropertyr.)�name�defaultr��valuerrr�
_java_getprop�s
r�cCs�zddl}Wn tk
r,||||fYSXtd|�}td|�}|\}}}td|�}td|�}td|�}|||f}|\}}	}
td|
�}
td|�}td	|	�}	||	|
f}||||fS)
Nrzjava.vendorzjava.versionzjava.vm.namezjava.vm.vendorzjava.vm.versionzjava.os.archzjava.os.namezjava.os.version)r�rrr�)r_�vendor�vminfo�osinfo�javaZvm_nameZ
vm_releaseZ	vm_vendor�os_name�
os_version�os_archrrr�java_ver�s"












r�cCs�|dkr�|dkr|||fS|�d�}|rlzt|d�}Wntk
rLYn X|d}t|�|d<d�|�}|dkrzd}q�d}n,|dkr�d	}|r�|d
}q�d}n|dkr�d
}|||fS)NZSunOS�5rDrrE�6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rOrP�Windows)rrrrIrJ)r^r_rrLr�rrr�system_alias�s.	



r�cGs�d�dd�tt|�D��}|�dd�}|�dd�}|�dd�}|�dd�}|�d	d�}|�d
d�}|�dd�}|�dd�}|�d
d�}|�dd�}||kr�q�|}q�|ddkr�|dd�}q�|S)N�-css|]}|��VqdSr�)r[)r&�xrrr�	<genexpr>(sz_platform.<locals>.<genexpr>� �_�/�\�:�;�"�(�)�unknownrz--rU)rJ�filterr,�replace)�argsrVZcleanedrrr�	_platform"s"r�cCsNzddl}Wntk
r$|YSXz
|��WStk
rH|YSXdS�Nr)�socketrrZgethostnamer/)r�r�rrr�_nodeBs

r�cCsBtj�|�}tj�|�r>tj�tj�tj�|�t�|���}q|Sr�)r*r3�abspath�islink�normpathrJ�dirname�readlink)�filepathrrr�_follow_symlinksQs�r�c	Cs\tjdkr|Sddl}z|jd|f|jdd�}Wnt|jfk
rN|YSX|��pZ|S)N�rQrOrPrr�T)rRrS)r0rVrWrXrYr/rZr[)Zoptionr�rW�outputrrr�
_syscmd_uname\s

�

r�c	Csztjdkr|Sddl}t|�}ttjdd�}z|jdd|g|j|d�}Wnt	|j
fk
rf|YSX|sp|S|�d�S)	Nr�r�C)�LC_ALL�filez-b)rR�envzlatin-1)r0rVrWr��dictr*�environrXrYr/rZr%)�targetr�rWr�r�rrr�_syscmd_filems	
�

r�)r�	WindowsPE)rr�)r�MSDOScCs|s&ddl}|�d�}t|d�d}|r6t|d�}nd}|sx|tjkrxtjtkrpttj\}}|rh|}|rp|}||fSd|kr�d|kr�||fSd|kr�d	}nd
|kr�d}nd|kr�d
}d|kr�d}n8d|kr�d|kr�d}q�d}nd|kr�d}nd|kr�d}n||fS)Nr�P��bitrr1z
shared objectz32-bit�32bitZN32Zn32bitz64-bitr�ZELFZPEr�r�ZCOFFzMS-DOSr�)�structZcalcsizerIr�r0r1rV�_default_architecture)r1�bits�linkager��sizeZfileoutr	rLrrr�architecture�sH
�
r��uname_resultz-system node release version machine processorcCs�d}tdk	rtSd}zt��\}}}}}Wntk
rBd}YnX|sbttd|||||f���s�|r~tj}d}d}t�}d}d}|dkr�t	�\}}}}	|r�|r�d}|s�dtj
kr�tj
�dd�}ntj
�dd�}|s�tj
�d|�}|�r:t|�\}}}|dk�rd	}n4|d
k�r:|d	k�r:d	}d|dd�k�r6d
}nd}|dk�rd|�s^|dk�rZd}nd}d	}n8|dd�dk�r�t
�\}}
}}d}d�|�}|�s�|
}|dk�r|�r�|dk�r�|}d}zddl}
Wntk
�r�Yn&X|
�dd�\}}|dk�rd}nd}|�stdd�}|dk�r$d}|dk�r2d}|dk�r@d}|dk�rNd}|dk�r\d}|dk�rjd}|d
k�r�|d	k�r�d	}d
}t||||||�atS)NrrrrOZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr�Z	Microsoftz6.0rErcr�r�Z16bit�r��Javaz, ZOpenVMS�0zSYI$_CPU�ZAlphaZVAXz-pr�)�_uname_cacher*r�r.rGr�r0rVr�r�r�rrbr�rJ�vms_librrZgetsyir�r�)Zno_os_uname�	processorr^�noder_rr�Zuse_syscmd_verrr�r�r�r�r�ZcsidZ
cpu_numberrrrr��s�
















�r�cCst�jSr�)r�r^rrrrr^usr^cCst�jSr�)r�r�rrrrr�~sr�cCst�jSr�)r�r_rrrrr_�sr_cCst�jSr�)r�rrrrrr�srcCst�jSr�)r�r�rrrrr��sr�cCst�jSr�)r�r�rrrrr��s
r�zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCs|dkrtj}t�|d�}|dk	r&|Sd|kr�d}|�d�rHt�|�}n
t�|�}|dkrjtdt	|���|�
�\}}}d}d}n�tj�d�r�d}t�|�}|dkr�tdt	|���|�
�\}}}}	}
|dkr�d}tj}n�d|k�r"d}t
�|�}|dk�rtdt	|���|�
�\}}}}	d}n\t�|�}|dk�rFtd	t	|���|�
�\}}}}	}d
}|dk�rld}n|	�r~|d|	}ttd��r�tj\}
}}n"ttd
��r�tj\}
}}nd}d}|�d�}
t|
�dk�r�|
�d�d�|
�}|||||||f}|t|<|S)NZ
IronPythonz*failed to parse IronPython sys.version: %srr�ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr��_git�
_mercurialrDr!r�)r0r�_sys_version_cacher�
startswith�_ironpython_sys_version_parserr]� _ironpython26_sys_version_parserr�reprr:rV�_sys_version_parser�_pypy_sys_version_parserr2r�r�rr,rFrJ)�sys_versionrr�r]rZalt_versionZcompilerZbuildnoZ	builddateZ	buildtimer��branchZrevisionrLrrr�_sys_version�s�

��
��


�

���



r�cCs
t�dSr��r�rrrr�python_implementation5sr�cCs
t�dS)Nrr�rrrr�python_versionBsr�cCstt�d�d��S)NrrD)r-r�rrrrr�python_version_tupleLs	r�cCs
t�dS)Nr!r�rrrr�
python_branchWsr�cCs
t�dS)NrEr�rrrr�python_revisionesr�cCst�dd�S)Nr�rir�rrrr�python_buildrsr�cCs
t�dS)Nrir�rrrr�python_compilerzsr�cCsbt�||fd�}|dk	r|St�\}}}}}}||kr:d}|rPt|||�\}}}|dkrnt�d}	|	rnd}|	}|dkr�t|�\}
}}}
|r�t||�}nt||||�}n�|dkr�ttj	�\}}t||||d||�}n~|dk�r t
�\}}}\}}}|s�|�s
t|||�}nt|||d	|||�}n2|�r2t||�}n ttj	�\}}t||||||�}|t||f<|S)
NrZDarwinrZmacOSr�)ZLinux�withr�Zon)�_platform_cacherr�r�r�r�r�rCr0r1r�r�)�aliased�terserr^r�r_rr�r�Z
macos_releaseZrelZversrr�rVZlibcnameZlibcversion�rrr�r�r�r�r�r�rrrrV�sX

�

��rV�__main__r�z--terseZ
nonaliasedz--nonaliased)Nrrr)r)rrrrN)rrrr)rr�r)rrr�r�)r)r)r)N)rr)AZ
__copyright__�__version__�collectionsr*�rer0r�compilerr�ASCIIr6rCrMr\rbr|r~rornr�r�r�r�r�r�r�r�r�r�r�r�r1r��
namedtupler�r�r�r^r�r_rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rV�__name__�argvr�r��print�exitrrrr�<module>\s�
�
�
G


�
1��

3

#4 


$�P�	
			����
h




L
ftplib.cpython-38.pyc000064400000066551151450073350010474 0ustar00U

e5d9��@sVdZddlZddlZddlmZdddddd	gZd
ZdZdZGd
d�de�Z	Gdd�de	�Z
Gdd�de	�ZGdd�de	�ZGdd�de	�Z
e	eefZdZdZGdd�d�ZzddlZWnek
r�dZYn0XejZGdd�de�Ze�d�e	eeejfZdadd�Zdadd�Zdd�Zdd�Z d d!�Z!d)d$d%�Z"d&d'�Z#e$d(k�rRe#�dS)*aSAn FTP client class and some helper functions.

Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds

Example:

>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, access restrictions apply.'
>>> ftp.retrlines('LIST') # list directory contents
total 9
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
-rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
'226 Transfer complete.'
>>> ftp.quit()
'221 Goodbye.'
>>>

A nice test that reveals some of the network dialogue would be:
python ftplib.py -d localhost -l -p -l
�N)�_GLOBAL_DEFAULT_TIMEOUT�FTP�error_reply�
error_temp�
error_perm�error_proto�
all_errors��� c@seZdZdS)�ErrorN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/ftplib.pyr9src@seZdZdS)rNr
rrrrr:sc@seZdZdS)rNr
rrrrr;sc@seZdZdS)rNr
rrrrr<sc@seZdZdS)rNr
rrrrr=s�
s
c@s�eZdZdZdZdZeZeZ	dZ
dZdZdZ
dZdZddddedfdd	�Zd
d�Zdd
�Zd\dd�Zdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d]d3d4�Z'd^d5d6�Z(d_d7d8�Z)d`d:d;�Z*dad<d=�Z+dbd>d?�Z,dcd@dA�Z-dBdC�Z.dDdE�Z/dFdG�Z0dgfdHdI�Z1dJdK�Z2dLdM�Z3dNdO�Z4dPdQ�Z5dRdS�Z6dTdU�Z7dVdW�Z8dXdY�Z9dZd[�Z:dS)drayAn FTP client class.

    To create a connection, call the class using these arguments:
            host, user, passwd, acct, timeout

    The first four arguments are all strings, and have default value ''.
    timeout must be numeric and defaults to None if not passed,
    meaning that no timeout will be set on any ftp socket(s)
    If a timeout is passed, then this is now the default timeout for all ftp
    socket operations for this instance.

    Then use self.connect() with optional host and port argument.

    To download a file, use ftp.retrlines('RETR ' + filename),
    or ftp.retrbinary() with slightly different arguments.
    To upload a file, use ftp.storlines() or ftp.storbinary(),
    which have an open file as argument (see their definitions
    below for details).
    The download/upload functions first issue appropriate TYPE
    and PORT or PASV commands.
    r�Nr	zlatin-1FcCs0||_||_|r,|�|�|r,|�|||�dS�N)�source_address�timeout�connect�login)�self�host�user�passwd�acctrrrrr�__init__rs
zFTP.__init__cCs|Srr�rrrr�	__enter__{sz
FTP.__enter__c	GsN|jdk	rJz*z|��Wnttfk
r0YnXW5|jdk	rH|��XdSr)�sock�close�quit�OSError�EOFError)r�argsrrr�__exit__s


zFTP.__exit__����cCs�|dkr||_|dkr||_|dkr*||_|dk	r8||_t�d||j|j�tj|j|jf|j|jd�|_|jj	|_
|jjd|jd�|_
|��|_|jS)	awConnect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
        rrr)Nzftplib.connect�r�r��encoding)r�portrr�sys�audit�socket�create_connectionr"�family�af�makefiler-�file�getresp�welcome)rrr.rrrrrr�s �

zFTP.connectcCs|jrtd|�|j��|jS)z`Get the welcome message from the server.
        (this is read and squirreled away by connect())z	*welcome*)�	debugging�print�sanitizer8r rrr�
getwelcome�szFTP.getwelcomecCs
||_dS)z�Set the debugging level.
        The required argument level means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)r9)r�levelrrr�set_debuglevel�szFTP.set_debuglevelcCs
||_dS)z�Use passive or active mode for data transfers.
        With a false argument, use the normal PORT mode,
        With a true argument, use the PASV command.N)�
passiveserver)r�valrrr�set_pasv�szFTP.set_pasvcCsJ|dd�dkrBt|�d��}|dd�d|d||d�}t|�S)N�>�PASS �pass r�*)�len�rstrip�repr)r�s�irrrr;�s$zFTP.sanitizecCs`d|ksd|krtd��t�d||�|t}|jdkrHtd|�|��|j�|�	|j
��dS)N�
�
z4an illegal newline character should not be containedzftplib.sendcmdr	z*put*)�
ValueErrorr/r0�CRLFr9r:r;r"�sendall�encoder-�r�linerrr�putline�s
zFTP.putlinecCs$|jrtd|�|��|�|�dS)Nz*cmd*)r9r:r;rSrQrrr�putcmd�sz
FTP.putcmdcCs�|j�|jd�}t|�|jkr.td|j��|jdkrHtd|�|��|sPt�|dd�t	krn|dd�}n|dd�t	kr�|dd�}|S)Nr	�got more than %d bytesz*get*������)
r6�readline�maxlinerFrr9r:r;r&rNrQrrr�getline�s
zFTP.getlinecCs`|��}|dd�dkr\|dd�}|��}|d|}|dd�|kr$|dd�dkr$q\q$|S)N���-rL)rZ)rrR�codeZnextlinerrr�getmultiline�s�zFTP.getmultilinecCsp|��}|jrtd|�|��|dd�|_|dd�}|dkrD|S|dkrTt|��|dkrdt|��t|��dS)Nz*resp*r[r	>�1�3�2�4�5)r_r9r:r;Zlastresprrr)r�resp�crrrr7�szFTP.getrespcCs$|��}|dd�dkr t|��|S)z%Expect a response beginning with '2'.Nr	rb)r7r�rrerrr�voidresp�szFTP.voidrespcCsTdt}|jdkr"td|�|��|j�|t�|��}|dd�dkrPt|��|S)z�Abort a file transfer.  Uses out-of-band data.
        This does not follow the procedure from the RFC to send Telnet
        IP and Synch; that doesn't seem to work with the servers I've
        tried.  Instead, just send the ABOR command as OOB data.�ABORr	z*put urgent*Nr[��225�426�226)	�B_CRLFr9r:r;r"rO�MSG_OOBr_r�rrRrerrr�aborts
z	FTP.abortcCs|�|�|��S)z'Send a command and return the response.)rTr7�r�cmdrrr�sendcmds
zFTP.sendcmdcCs|�|�|��S)z8Send a command and expect a response beginning with '2'.)rTrhrrrrr�voidcmds
zFTP.voidcmdcCsB|�d�}t|d�t|d�g}||}dd�|�}|�|�S)zUSend a PORT command with the current host and the given
        port number.
        �.�zPORT �,)�splitrH�joinru)rrr.ZhbytesZpbytes�bytesrsrrr�sendports

zFTP.sendportcCsbd}|jtjkrd}|jtjkr$d}|dkr4td��dt|�|t|�dg}dd�|�}|�|�S)zESend an EPRT command with the current host and the given port number.rr	�zunsupported address familyrzEPRT �|)r4r1�AF_INETZAF_INET6rrHrzru)rrr.r4Zfieldsrsrrr�sendeprt&szFTP.sendeprtcCsltjd|jdd�}|��d}|j��d}|jtjkrF|�||�}n|�||�}|jt	k	rh|�
|j�|S)z3Create a new socket and send a PORT command for it.)rrr	)r3Zbacklogr)r1Z
create_serverr4Zgetsocknamer"rr|r�rr�
settimeout)rr"r.rrerrr�makeport3s
zFTP.makeportcCs\|jtjkr:t|�d��\}}|jr*|}qT|j��d}nt|�d�|j���\}}||fS)z<Internal: Does the PASV or EPSV handshake -> (address, port)�PASVrZEPSV)	r4r1r�parse227rt�trust_server_pasv_ipv4_addressr"Zgetpeername�parse229)rZuntrusted_hostr.rrrr�makepasv@szFTP.makepasvc
	Cs6d}|jr�|��\}}tj||f|j|jd�}zL|dk	rF|�d|�|�|�}|ddkrd|��}|ddkrxt|��Wn|�	��YnXn�|�
��r}|dk	r�|�d|�|�|�}|ddkr�|��}|ddkr�t|��|��\}}	|jtk	�r
|�
|j�W5QRX|dd�dk�r.t|�}||fS)	a�Initiate a transfer over the data connection.

        If the transfer is active, send a port command and the
        transfer command, and accept the connection.  If the server is
        passive, send a pasv command, connect to it, and start the
        transfer command.  Either way, return the socket for the
        connection and the expected size of the transfer.  The
        expected size may be None if it could not be determined.

        Optional `rest' argument can be a string that is sent as the
        argument to a REST command.  This is essentially a server
        marker used to tell the server to skip over any data up to the
        given marker.
        Nr*zREST %srrbr`r[�150)r?r�r1r2rrrtr7rr#r�Zacceptrr��parse150)
rrs�rest�sizerr.�connrer"Zsockaddrrrr�ntransfercmdLs>�



zFTP.ntransfercmdcCs|�||�dS)z0Like ntransfercmd() but returns only the socket.r)r�)rrsr�rrr�transfercmd�szFTP.transfercmdcCs�|sd}|sd}|sd}|dkr0|dkr0|d}|�d|�}|ddkrX|�d|�}|ddkrr|�d	|�}|dd
kr�t|��|S)zLogin, default anonymous.Z	anonymousr>rr]z
anonymous@zUSER rrarC�ACCT rb�rtr)rrrrrerrrr�s z	FTP.loginrc	Cs^|�d�|�||��:}|�|�}|s(q2||�qtdk	rLt|t�rL|��W5QRX|��S)a�Retrieve data in binary mode.  A new port is created for you.

        Args:
          cmd: A RETR command.
          callback: A single parameter callable to be called on each
                    block of data read.
          blocksize: The maximum number of bytes to read from the
                     socket at one time.  [default: 8192]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        �TYPE IN)rur�Zrecv�
_SSLSocket�
isinstance�unwraprh)rrs�callback�	blocksizer�r��datarrr�
retrbinary�s


zFTP.retrbinaryc
Cs�|dkrt}|�d�}|�|���}|jd|jd���}|�|jd�}t|�|jkr`td|j��|j	dkrxt
dt|��|s~q�|d	d�tkr�|dd	�}n|d
d�dkr�|dd
�}||�q4t
dk	r�t|t
�r�|��W5QRXW5QRX|��S)ahRetrieve data in line mode.  A new port is created for you.

        Args:
          cmd: A RETR, LIST, or NLST command.
          callback: An optional single parameter callable that is called
                    for each line with the trailing CRLF stripped.
                    [default: print_line()]

        Returns:
          The response code.
        N�TYPE Ar+r,r	rUr}z*retr*rVrWrL)�
print_linertr�r5r-rXrYrFrr9r:rHrNr�r�r�rh)rrsr�rer��fprRrrr�	retrlines�s,
�

z
FTP.retrlinesc	Csl|�d�|�||��H}|�|�}|s(q@|�|�|r||�qtdk	rZt|t�rZ|��W5QRX|��S)a9Store a file in binary mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a read(num_bytes) method.
          blocksize: The maximum data size to read from fp and send over
                     the connection at once.  [default: 8192]
          callback: An optional single parameter callable that is called on
                    each block of data after it is sent.  [default: None]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        r�N)rur��readrOr�r�r�rh)rrsr�r�r�r�r��bufrrr�
storbinary�s



zFTP.storbinaryc	Cs�|�d�|�|���}|�|jd�}t|�|jkrBtd|j��|sHq�|dd�tkrx|dtkrp|dd�}|t}|�|�|r||�qtdk	r�t	|t�r�|�
�W5QRX|��S)ahStore a file in line mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a readline() method.
          callback: An optional single parameter callable that is called on
                    each line after it is sent.  [default: None]

        Returns:
          The response code.
        r�r	rUrVNrW)rur�rXrYrFrrnrOr�r�r�rh)rrsr�r�r�r�rrr�	storlines�s"


z
FTP.storlinescCsd|}|�|�S)zSend new account name.r��ru)rZpasswordrsrrrrszFTP.acctcGs0d}|D]}|d|}qg}|�||j�|S)zBReturn a list of files in a given directory (default the current).ZNLST� )r��append)rr'rs�arg�filesrrr�nlstszFTP.nlstcGshd}d}|dd�r>t|d�td�kr>|dd�|d}}|D]}|rB|d|}qB|�||�dS)aList a directory in long form.
        By default list current directory to stdout.
        Optional last argument is callback function; all
        non-empty arguments before it are concatenated to the
        LIST command.  (This *should* only be used for a pathname.)ZLISTNrWrr�)�typer�)rr'rs�funcr�rrr�dir(s zFTP.dirc
cs�|r|�dd�|�d�|r*d|}nd}g}|�||j�|D]\}|�t��d�\}}}i}	|dd��d�D] }
|
�d�\}}}||	|��<qt||	fVqDdS)	a<List a directory in a standardized format by using MLSD
        command (RFC-3659). If path is omitted the current directory
        is assumed. "facts" is a list of strings representing the type
        of information desired (e.g. ["type", "size", "perm"]).

        Return a generator object yielding a tuple of two elements
        for every file found in path.
        First element is the file name, the second one is a dictionary
        including a variable number of "facts" depending on the server
        and whether "facts" argument has been provided.
        z
OPTS MLST �;zMLSD %sZMLSDr�NrW�=)	rtrzr�r�rGrN�	partitionry�lower)
r�pathZfactsrs�linesrRZfacts_found�_�name�entryZfact�key�valuerrr�mlsd7s
zFTP.mlsdcCs0|�d|�}|ddkr"t|��|�d|�S)zRename a file.zRNFR rrazRNTO )rtrru)rZfromnameZtonamererrr�renameSsz
FTP.renamecCs.|�d|�}|dd�dkr"|St|��dS)zDelete a file.zDELE Nr[>�250�200r�)r�filenamererrr�deleteZsz
FTP.deletec
Csp|dkrRz|�d�WStk
rN}z|jddd�dkr>�W5d}~XYq^Xn|dkr^d}d	|}|�|�S)
zChange to a directory.z..ZCDUPrNr[�500rrvzCWD )rurr')r�dirname�msgrsrrr�cwdbszFTP.cwdcCs:|�d|�}|dd�dkr6|dd���}t|�SdS)zRetrieve the size of a file.zSIZE Nr[Z213)rt�strip�int)rr�rerIrrrr�oszFTP.sizecCs$|�d|�}|�d�sdSt|�S)z+Make a directory, return its full pathname.zMKD �257r�ru�
startswith�parse257)rr�rerrr�mkdws
zFTP.mkdcCs|�d|�S)zRemove a directory.zRMD r�)rr�rrr�rmd�szFTP.rmdcCs |�d�}|�d�sdSt|�S)z!Return current working directory.ZPWDr�rr�rgrrr�pwd�s

zFTP.pwdcCs|�d�}|��|S)zQuit, and close the connection.ZQUIT)rur#rgrrrr$�s
zFTP.quitcCsDz |j}d|_|dk	r|��W5|j}d|_|dk	r>|��XdS)z8Close the connection without assuming anything about it.N)r"r#r6)rr"r6rrrr#�sz	FTP.close)rrr)N)N)N)rrr)rN)N)rNN)N);rrr�__doc__r9r�FTP_PORTr.�MAXLINErYr"r6r8r?r-r�rrr!r(rr<r>�debugrAr;rSrTrZr_r7rhrqrtrur|r�r�r�r�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r$r#rrrrrJsp�
	






7



#

	
		c	@sneZdZdZejZdddddddedf	dd�Zddd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ddd�Zdd�ZdS)�FTP_TLSa�A FTP subclass which adds TLS support to FTP as described
        in RFC-4217.

        Connect as usual to port 21 implicitly securing the FTP control
        connection before authenticating.

        Securing the data connection requires user to explicitly ask
        for it by calling prot_p() method.

        Usage example:
        >>> from ftplib import FTP_TLS
        >>> ftps = FTP_TLS('ftp.python.org')
        >>> ftps.login()  # login anonymously previously securing control channel
        '230 Guest login ok, access restrictions apply.'
        >>> ftps.prot_p()  # switch to secure data connection
        '200 Protection level set to P'
        >>> ftps.retrlines('LIST')  # list directory content securely
        total 9
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
        d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
        drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
        drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
        drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
        -rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
        '226 Transfer complete.'
        >>> ftps.quit()
        '221 Goodbye.'
        >>>
        rNc
	Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}
|
�dtd�||_||_|dkr|tj|j||d�}||_	d|_
t�|||||||	�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr})�certfile�keyfileF)
rM�warnings�warn�DeprecationWarningr�r��sslZ_create_stdlib_context�ssl_version�context�_prot_prr)rrrrrr�r�r�rrr�rrrr�s(��zFTP_TLS.__init__TcCs*|rt|jtj�s|��t�||||�Sr)r�r"r��	SSLSocket�authrr)rrrrZsecurerrrr�sz
FTP_TLS.logincCsft|jtj�rtd��|jtjkr.|�d�}n
|�d�}|jj	|j|j
d�|_|jjd|jd�|_
|S)z2Set up secure control connection by using TLS/SSL.zAlready using TLSzAUTH TLSzAUTH SSL�Zserver_hostnamer+)�moder-)r�r"r�r�rMr�ZPROTOCOL_TLSrur��wrap_socketrr5r-r6rgrrrr��s

�zFTP_TLS.authcCs0t|jtj�std��|�d�}|j��|_|S)z/Switch back to a clear-text control connection.z
not using TLSZCCC)r�r"r�r�rMrur�rgrrr�ccc�s

zFTP_TLS.ccccCs|�d�|�d�}d|_|S)zSet up secure data connection.zPBSZ 0zPROT PT�rur�rgrrr�prot_p�s

zFTP_TLS.prot_pcCs|�d�}d|_|S)z"Set up clear text data connection.zPROT CFr�rgrrr�prot_cs
zFTP_TLS.prot_ccCs2t�|||�\}}|jr*|jj||jd�}||fS)Nr�)rr�r�r�r�r)rrsr�r�r�rrrr�s�zFTP_TLS.ntransfercmdcCs8dt}|j�|�|��}|dd�dkr4t|��|S)Nrir[rj)rnr"rOr_rrprrrrqsz
FTP_TLS.abort)rrrT)N)rrrr�r�ZPROTOCOL_TLS_CLIENTr�rrrr�r�r�r�r�rqrrrrr��s 
�



r�cCs\|dd�dkrt|��tdkr<ddl}|�d|j|jB�at�|�}|sNdSt|�d��S)z�Parse the '150' response for a RETR request.
    Returns the expected transfer size or None; size is not guaranteed to
    be present in the 150 message.
    Nr[r�rz150 .* \((\d+) bytes\)r	)	r�_150_re�re�compile�
IGNORECASE�ASCII�matchr��group)rer��mrrrr�)s
�
r�cCs�|dd�dkrt|��tdkr6ddl}|�d|j�at�|�}|sLt|��|��}d�|dd��}t	|d�d>t	|d	�}||fS)
z�Parse the '227' response for a PASV request.
    Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z227rz#(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)rvr\�rB)
r�_227_rer�r�r��searchr�groupsrzr�)rer�r�Znumbersrr.rrrr�=s
r�cCs�|dd�dkrt|��|�d�}|dkr2t|��|�d|d�}|dkrRt|��||d||dkrrt|��||d|��||d�}t|�dkr�t|��|d}t|d�}||fS)	z�Parse the '229' response for an EPSV request.
    Raises error_proto if it does not contain '(|||port|)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z229�(r�)r	rB)r�findrryrFr�)reZpeer�left�right�partsrr.rrrr�Qs 
r�cCs�|dd�dkrt|��|dd�dkr,dSd}d}t|�}||kr�||}|d}|dkrz||ks�||dkrrq�|d}||}q<|S)	z�Parse the '257' response for a MKD or PWD request.
    This is a response to a MKD or PWD request: a directory name.
    Returns the directoryname in the 257 reply.Nr[r�rBz "rr	�")rrF)rer�rJ�nrfrrrr�gs 
r�cCst|�dS)z+Default retrlines callback to print a line.N)r:)rRrrrr�~sr�r�Ic	Cs�|s|}d|}|�|�|�|�t|�d��\}}|�||�|�d|�}|dd�dkrdt�|�d|�}|dd�dkr�t�|��|��dS)z+Copy file from one FTP-instance to another.zTYPE r�zSTOR Nr[>�125r��RETR )rur�rtr|rrh)	�sourceZ
sourcename�targetZ
targetnamer�Z
sourcehostZ
sourceportZtreplyZsreplyrrr�ftpcp�s

r�cCs�ttj�dkr"ttj�t�d�ddl}d}d}tjddkrR|d}tjd=q2tjddd�dkr�tjddd�}tjd=tjd}t|�}|�	|�d}}}z|�|�}Wn(t
k
r�|dk	r�tj�d�Yn:Xz|�
|�\}}}Wn"tk
�rtj�d	�YnX|�|||�tjdd�D]�}	|	dd�d
k�r`|�|	dd��nt|	dd�dk�r�d}
|	dd��r�|
d|	dd�}
|�|
�}n0|	d
k�r�|�|j�n|�d|	tjjd��q6|��dS)z�Test program.
    Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...

    -d dir
    -l list
    -p password
    r}rNr	z-dz-rrz5Could not open account file -- using anonymous login.z$No account -- using anonymous login.z-lZCWDr�z-pr�i)rFr/�argvr:�testr��exit�netrcrr>r%�stderr�writeZauthenticators�KeyErrorrr�rtrAr?r��stdoutr$)r�r9ZrcfilerZftpZuseridrrZnetrcobjr6rsrerrrr��sV	




�


�r��__main__)rr�)%r�r/r1r�__all__ror�r��	Exceptionrrrrrr%r&rrNrnrr��ImportErrorr�r�r�r�ZSSLErrorr�r�r�r�r�r�r�r�r�rrrrr�<module>sR&
�
Z
|

9
_bootlocale.cpython-38.opt-2.pyc000064400000001742151450073350012425 0ustar00U

e5d	�@svddlZddlZej�d�r(d
dd�ZnJz
ejWn4ek
rfeed�rXddd�Zn
ddd�ZYnXd
d	d�ZdS)�N�winTcCstjjrdSt��dS)N�UTF-8�)�sys�flags�	utf8_mode�_localeZ_getdefaultlocale��do_setlocale�r�#/usr/lib64/python3.8/_bootlocale.py�getpreferredencodingsr
ZgetandroidapilevelcCsdS)Nrrr	rrrr
scCstjjrdSddl}|�|�S)Nrr)rrr�localer
)r
rrrrr
scCs.tjjrdSt�tj�}|s*tjdkr*d}|S)Nr�darwin)rrrr�nl_langinfo�CODESET�platform)r
�resultrrrr
!s)T)T)T)T)rrr�
startswithr
r�AttributeError�hasattrrrrr�<module>s

sre_compile.cpython-38.opt-2.pyc000064400000034250151450073350012444 0ustar00U

e5dGh�@sddlZddlZddlTeehZeeehZ	e
ehZe
ehZeeehBZdZdd�eD�Zejfdd�Zdd	�Zd
d�Zd+dd
�ZejdZde>dZdZeefdd�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd �Z&d!d"�Z'd#d$�Z(d%d&�Z)d'd(�Z*d,d)d*�Z+dS)-�N)�*))�ii1)�si)�i�)iEi�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)iai�)i�i�cs.i|]&}|D]��t�fdd�|D���qqS)c3s|]}�|kr|VqdS�N�)�.0�j��ir�#/usr/lib64/python3.8/sre_compile.py�	<genexpr>>sz<dictcomp>.<genexpr>)�tuple)r�trr
r�
<dictcomp>>s
�rcCs ||@r||M}||B|@Srr)�flags�	add_flags�	del_flags�
TYPE_FLAGSrrr�_combine_flagsAs
rcCs�|j}t}t}t}t}t}d}	d}
d}|t@r\|t@s\|t@rPt	j
}	t	j}
t}nt	j
}	t	j}
|D�]|\}}
||k�rr|t@s�||�||
�n�|t@r�|t|�||
�n�|	|
�s�||�||
�n�|
|
�}|s�|t|�||�n�||k�r|t|�||�nh|t�||�}|d�|tk�r2|t�|f||D]}|t�||��q@|t�||�|||<q`|tk�rt|
|	|
|�\}}|t@�r�|t@�r�|t�n(|�s�|t�n|�s�|t�n|t�||�}|d�t|||�||�|||<q`|tk�r*|t@�r |t�n|t�q`||k�r6|t@�rLt d|f��t!|
d��r�|t"k�rn|t#�n|t$�||�}|d�||
d�||
d�t%||
d|�|t&�||�|||<nl|t'�||�}|d�||
d�||
d�t%||
d|�||�|||<|t"k�r,|t(�n|t)�q`|t*k�r�|
\}}}}|�rj|t+�||dd�t%||t,|||��|�r�|t+�||ddd�q`||k�r�||�q`||k�rD||�||�}|d�|
ddk�r�|d�n*|
d�-�\}}||k�rt d��||�t%||
d|�|t&�||�|||<q`|t.k�r�||�||�}|d�t%||
|�|t&�||�|||<q`|t/k�r�||�|t0@�r�t1�2|
|
�}
|t@�r�t3�2|
|
�}
n|t@�r�t4�2|
|
�}
||
�q`|t5k�r�||�g}|j}|
dD]N}
||�}|d�t%||
|�|t6�|||��|d�||�|||<�q|t�|D]}||�|||<�qlq`|t7k�r�||�|t@�r�t8|
}
n|t@�r�t9|
}
||
�q`|t:k�r |t@�s�||�n,|t@�r�|t;�n|�s
|t<�n|t=�||
d�q`|t>k�r�||�||
dd�||�}|d�t%||
d|�|
d�r�|t6�||�}|d�||�|d||<t%||
d|�||�|||<n||�|d||<q`t d|f��q`dS)Nrz*internal: unsupported template operator %r��z(look-behind requires fixed-width patternz%internal: unsupported operand type %r)?�append�len�_LITERAL_CODES�_REPEATING_CODES�_SUCCESS_CODES�
_ASSERT_CODES�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_UNICODE�_sre�unicode_iscased�unicode_tolower�_ignorecase_fixes�
ascii_iscased�
ascii_tolower�OP_LOCALE_IGNORE�	OP_IGNORE�OP_UNICODE_IGNORE�
IN_UNI_IGNORE�NOT_LITERAL�NEGATE�LITERAL�FAILURE�IN�_optimize_charset�
IN_LOC_IGNORE�	IN_IGNORE�_compile_charset�ANY�SRE_FLAG_DOTALL�ANY_ALL�SRE_FLAG_TEMPLATE�error�_simple�
MAX_REPEAT�
REPEAT_ONE�MIN_REPEAT_ONE�_compile�SUCCESS�REPEAT�	MAX_UNTIL�	MIN_UNTIL�
SUBPATTERN�MARKr�getwidth�CALL�AT�SRE_FLAG_MULTILINE�AT_MULTILINE�get�	AT_LOCALE�
AT_UNICODE�BRANCH�JUMP�CATEGORY�	CH_LOCALE�
CH_UNICODE�GROUPREF�GROUPREF_LOC_IGNORE�GROUPREF_IGNORE�GROUPREF_UNI_IGNORE�GROUPREF_EXISTS)�code�patternr�emit�_len�
LITERAL_CODES�REPEATING_CODES�
SUCCESS_CODES�ASSERT_CODES�iscased�tolower�fixes�op�av�lo�skip�k�charset�hascased�grouprr�p�hi�tail�
tailappend�skipyes�skipnorrrr=GsV
















































r=cCs�|j}|D]�\}}||�|tkr$q
|tkr6||�q
|tksF|tkr`||d�||d�q
|tkrt|�|�q
|tkr�|�|�q
|tkr�|t	@r�|t
|�q�|t@r�|t|�q�||�q
t
d|f��q
|t�dS)Nrrz%internal: unsupported set operator %r)rr,r-�RANGE�RANGE_UNI_IGNORE�CHARSET�extend�
BIGCHARSETrNrrOr rPr8r.)rfrrVrXrarbrrrr3�s,

r3c	Cs�g}g}td�}d}|D�]�\}}	�z,|tkr�|rv||	�}
d||
<|rd|
|krd||
D]}d||<qV|s~||	�r~d}nd||	<n�|tk�r&t|	d|	dd�}|�r|r�t||�D]*}
d||
<|
|kr�||
D]}d||<q�q�nt||�D]}
d||
<q�|�s$tt||��}n|D]}
d||
<�qn(|tk�r@|�||	f�n|�||	f�WnZtk
�r�t	|�dk�r�|dd7}Yq"|�r�d}|tk�r�t
}|�||	f�YnXqq"qg}d}|�d|�}|dk�rԐq(t	|�dk�r�d}�q(|�d|�}|dk�r|�|t	|�f��q(|�||f��q�|dk	�r�|D]>\}}||dk�r\|�t|f�n|�t||dff��q6||7}|�s�t	|�t	|�k�r�||fS||fSt	|�dk�r�t|�}|�t
|f�||7}||fSt|�}i}td�}d}t�}tdd	d�D]V}
||
|
d�}||k�r4||||
d<n$|||
d<||<|d7}||7}�qt|�}|gt|�|dd�<|�t|f�||7}||fS)
N�FrTr�i�ri)�	bytearrayr-ro�range�map�anyr,r�
IndexErrorrrp�find�
_mk_bitmaprq�bytes�_bytes_to_codesrs)rfr^�fixupr`�outrk�charmaprgrarbrcre�rr�runs�qri�data�comps�mapping�block�chunkrrrr0s�









r0�rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|�t�ddd�����fdd�tt��d��D�S)N���cs"g|]}��|�|�d��qS)rr)rr��	_CODEBITS�_int�srr�
<listcomp>�s�z_mk_bitmap.<locals>.<listcomp>r)�	translate�_BITS_TRANSrwr)�bitsr�r�rr�rr|�s�r|cCst|��d�}|��S)N�I)�
memoryview�cast�tolist)�b�arrrr~�sr~cCsDt|�dkrdS|d\}}|tkr<|ddko:t|d�S|tkS)NrFrr�)rrBr9�_UNIT_CODES)rirarbrrrr9�sr9cCsndgt|�}tdt|��D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)Nrr)rrw)�prefix�tabler�idxrrr�_generate_overlap_table�s	r�cCs$|t@sdS|t@rtjStjSdSr)rr r!r"r%)rrrr�_get_iscased�s
r�cCs�g}|j}d}t|�}|jD]�\}}|tkrF|r<||�r<q�||�q|tkr�|\}}	}
}t||	|
�}|t@rz|t@rzq�t||�\}
}}|dkr�|dk	r�t	|�}n|dk	r�t	|�|}|�
|
�|s�q�qq�q||dfS||dfS)NTF)rr�r�r-rBrrr�_get_literal_prefixrrr)rWrr��prefixappend�prefix_skipr^rarbrhrrri�flags1�prefix1�prefix_skip1�got_allrrrr��s4



r�cCsd|js
dS|jd\}}|tk	r"qP|\}}}}t|||�}|t@r|t@rdSqt|�}|tkrz|rp||�rpdS||fgS|tkr�g}|j}	|dD]B}
|
s�dS|
d\}}|tkr�|r�||�s�|	||f�q�dSq�|S|t	k�r`|}|�r\|D]f\}}|tk�r||��rZdSq�|t
kr�|ddk�r4dStt|t
|d|dd���r�dSq�|SdS)Nrri��)r�rBrrrr�r-rLrr/roryrxrw)rWrrarbrhrrr^rf�
charsetappendrirrr�_get_charset_prefix�sN



 r�c
Csr|��\}}|tkrt}|dkr8|�tdd||g�dSg}d}g}|t@rT|t@srt||�\}}}|srt||�}|j}	|	t�t	|�}
|	d�d}|r�t
}|dkr�|r�|tB}n|r�|tB}|	|�|tkr�|	|�n|	t�|dt�}|	t
|t��|�r@|	t	|��|dk�rt	|�}|	|�|�|�|�t|��n|�r^t|�\}}t|||�t	|�|
||
<dS)Nr�)rD�MAXCODErr�INFOrrr�r�rr�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSET�minr�r0r3)
rVrWrrcrjr�r�rfr�rXrd�maskrgrrr�
_compile_infosR




r�cCst|ttf�Sr)�
isinstance�strr})�objrrr�isstringSsr�cCs8|jj|B}g}t|||�t||j|�|�t�|Sr)�staterr�r=r�rr>)rirrVrrr�_codeVs
r�cCsdd�dd�|D��S)N�[%s]�, css$|]}dtjdd|fVqdS)z%#0*xrN)r!�CODESIZE�r�xrrrr
fsz_hex_code.<locals>.<genexpr>)�join�rVrrr�	_hex_codeesr�csNddl�t��d�ttt��d���������fdd���dt���dS)Nrrc	s�dd�����fdd�
}��fdd�}�d7��}||k�r�|��|}|d7}t|}|tttttttfkrx||�q2|tt	t
ttt
ttfkr��|}|d7}||d|t|�f�q2|tkr�|}|d7}tt|�}|||dd��q2|tk�r*�|}|d7}tt|�}|||d	d��q2|ttttfk�rr�|}|||||d��|d||�||7}q2|ttfk�r��||d
�\}}	|d
7}||d||	t|�t|	�f�q2|tk�r�||t�||dt���|dt7}q2|tk�r��|}|d7}t d
�!�fdd��||dt"j#�D���}
||||
�|dt"j#7}�d7�t$|�D].}|t�||dt���|dt7}�qd�d8�q2|t%t&t't(t)fk�rΈ|}|d7}|||�q2|t*k�r��|}|||||d�|d7}q2|t+k�r|�|}|||||d�|�rr�|d||�||7}|��|}|�rf|d|||d�n|t��q |d7}q2|t,t-t.fk�r�||d�\}}}
|
t/k�r�d}
|||||
||d��|d||�||7}q2|t0k�r�||d
�\}}||||||d�|d
7}q2|t1t2fk�rp�||d
�\}}||||||d��|d
||�||7}q2|t3k�r��||d�\}}}}
|
t/k�r�d}
|||t4|�||
||d�|d�|t5@�r^�|d|d�\}}|d|�|d����|�}|ddd�!dd�|D��dd�!t6t|����|7�|d���|���|7�|t7@�r��d7�|d���||��d8�||7}q2t8|��q2�d8�dS)N)�tocsX|dk	r"��|�|d|ff7}td����kr6dndfd�dd�t|�dS)Nz(to %d)z%*d%s �:�.z  r��end)�add�print)r��args)�labels�level�offset_width�startrr�print_ps

�z!dis.<locals>.dis_.<locals>.print_cs"td�d�d�t|�dS)N� rr�)r�)r�)r�r�rr�print_2xsz"dis.<locals>.dis_.<locals>.print_2rz
%#02x (%r)��	rz%#02x %#02x (%r-%r)rt�c3s|]}|�tj�j�VqdSr)�to_bytesr!r��	byteorderr�)�sysrrr
�s�z$dis.<locals>.dis_.<locals>.<genexpr>�branch�	MAXREPEATr��z
  prefix_skipz  prefixr�r�css|]}d|VqdS)z%#02xNrr�rrrr
�sz(%r)�z	  overlap�in)9�OPCODESr>r.r4r6r@rAr,r-r+�LITERAL_IGNORE�NOT_LITERAL_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�chrrFr��ATCODESrN�CHCODESr/r2r*r1rorprqr�r�rs�listr�r!r�rwrCrQrSrTrRrMrLr?r;r<r�rU�ASSERT�
ASSERT_NOTr��binr�rxr��
ValueError)r�r�r�r�rra�argrdrcrjr�r	r��maxr�
prefix_lenr�r��rV�dis_r�r�r�r�)r�rr�os�

�
�

 

�


�












�


zdis.<locals>.dis_)r��setrr�r�rr�r�dishsr�c	Cs�t|�r|}t�||�}nd}t||�}|t@r>t�t|�|jj}dg|jj	}|�
�D]\}}|||<q\t�|||jj
B||jj	d|t|��S)Nr)r��	sre_parse�parser��SRE_FLAG_DEBUGr�r�r��	groupdict�groups�itemsr!�compilerr)rirrWrV�
groupindex�
indexgrouprerrrrr��s(



�r�)NNN)r),r!r��
sre_constantsr-r+rr?�
MIN_REPEATr:rr>r.rr�r�rr4r/r��
_equivalencesr$rrr=r3r0r�r�r�r��intr|r~r9r�r�r�r�r�r�r�r�r�r�rrrr�<module>
sF
$��
3

	,;decimal.cpython-38.opt-2.pyc000064400000000551151450073350011536 0ustar00U

e5d@�@svz0ddlTddlmZddlmZddlmZWn@ek
rpddlTddlmZddlmZddlmZYnXdS)�)�*)�__doc__)�__version__)�__libmpdec_version__N)Z_decimalrrr�ImportErrorZ
_pydecimal�rr�/usr/lib64/python3.8/decimal.py�<module>sopcode.cpython-38.opt-2.pyc000064400000012242151450073350011411 0ustar00U

e5d��
@s�dddddddddd	d
ddg
Zzd
dlmZe�d�Wnek
rLYnXdZgZgZgZgZ	gZ
gZgZgZ
iZdd�ed�D�Zdd�Zdd�Zdd�Zdd�Zedd�edd�ed d!�ed"d#�ed$d%�ed&d'�ed(d)�ed*d+�ed,d-�ed.d/�ed0d1�ed2d3�ed4d5�ed6d7�ed8d9�ed:d;�ed<d=�ed>d?�ed@dA�edBdC�edDdE�edFdG�edHdI�edJdK�edLdM�edNdO�edPdQ�edRdS�edTdU�edVdW�edXdY�edZd[�ed\d]�ed^d_�ed`da�edbdc�eddde�edfdg�edhdi�edjdk�edldm�edndo�edpdq�edrds�edtdu�edvdw�edxdy�edzd{�ed|d}�ed~d�ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��d�Zed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�dÃed�dŃed�dǃed�dɃed�d˃e
�dˡed�d̓e
�d͡ed�dσe
�dϡed�dуed�dӃed�dՃed�d׃ed�dكe�d١ed�dۃe�dۡed�d݃e�dݡed�d߃e�dߡed�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�e�d�edd�d�Zed�d�ed�d�ed�d�ed�d��ed�d��ed�d��ed�d��ed�d��ed��d�e�d�d�e�d�d�e�d�d�e�d�d�e�d	�d
�[[[[�dS(�cmp_op�hasconst�hasname�hasjrel�hasjabs�haslocal�
hascompare�hasfree�opname�opmap�
HAVE_ARGUMENT�EXTENDED_ARG�hasnargs�)�stack_effectr)�<z<=z==z!=�>z>=�inznot in�iszis notzexception matchZBADcCsg|]}d|f�qS)z<%r>�)�.0�oprr�/usr/lib64/python3.8/opcode.py�
<listcomp>%sr�cCs|t|<|t|<dS�N)r	r
��namerrrr�def_op'srcCst||�t�|�dSr)rr�appendrrrr�name_op+s
rcCst||�t�|�dSr)rrrrrrr�jrel_op/s
r cCst||�t�|�dSr)rrrrrrr�jabs_op3s
r!ZPOP_TOP�ZROT_TWO�Z	ROT_THREE�ZDUP_TOP�ZDUP_TOP_TWO�ZROT_FOUR�ZNOP�	ZUNARY_POSITIVE�
ZUNARY_NEGATIVE�Z	UNARY_NOT�ZUNARY_INVERT�ZBINARY_MATRIX_MULTIPLY�ZINPLACE_MATRIX_MULTIPLY�ZBINARY_POWER�ZBINARY_MULTIPLY�Z
BINARY_MODULO�Z
BINARY_ADD�ZBINARY_SUBTRACT�Z
BINARY_SUBSCR�ZBINARY_FLOOR_DIVIDE�ZBINARY_TRUE_DIVIDE�ZINPLACE_FLOOR_DIVIDE�ZINPLACE_TRUE_DIVIDE�Z	GET_AITER�2Z	GET_ANEXT�3ZBEFORE_ASYNC_WITH�4Z
BEGIN_FINALLY�5Z
END_ASYNC_FOR�6ZINPLACE_ADD�7ZINPLACE_SUBTRACT�8ZINPLACE_MULTIPLY�9ZINPLACE_MODULO�;ZSTORE_SUBSCR�<Z
DELETE_SUBSCR�=Z
BINARY_LSHIFT�>Z
BINARY_RSHIFT�?Z
BINARY_AND�@Z
BINARY_XOR�AZ	BINARY_OR�BZ
INPLACE_POWER�CZGET_ITER�DZGET_YIELD_FROM_ITER�EZ
PRINT_EXPR�FZLOAD_BUILD_CLASS�GZ
YIELD_FROM�HZ
GET_AWAITABLE�IZINPLACE_LSHIFT�KZINPLACE_RSHIFT�LZINPLACE_AND�MZINPLACE_XOR�NZ
INPLACE_OR�OZWITH_CLEANUP_START�QZWITH_CLEANUP_FINISH�RZRETURN_VALUE�SZIMPORT_STAR�TZSETUP_ANNOTATIONS�UZYIELD_VALUE�VZ	POP_BLOCK�WZEND_FINALLY�XZ
POP_EXCEPT�Y�ZZ
STORE_NAMEZDELETE_NAME�[ZUNPACK_SEQUENCE�\ZFOR_ITER�]Z	UNPACK_EX�^Z
STORE_ATTR�_ZDELETE_ATTR�`ZSTORE_GLOBAL�aZ
DELETE_GLOBAL�bZ
LOAD_CONST�dZ	LOAD_NAME�eZBUILD_TUPLE�fZ
BUILD_LIST�gZ	BUILD_SET�hZ	BUILD_MAP�iZ	LOAD_ATTR�jZ
COMPARE_OP�kZIMPORT_NAME�lZIMPORT_FROM�mZJUMP_FORWARD�nZJUMP_IF_FALSE_OR_POP�oZJUMP_IF_TRUE_OR_POP�pZ
JUMP_ABSOLUTE�qZPOP_JUMP_IF_FALSE�rZPOP_JUMP_IF_TRUE�sZLOAD_GLOBAL�tZ
SETUP_FINALLY�zZ	LOAD_FAST�|Z
STORE_FAST�}ZDELETE_FAST�~Z
RAISE_VARARGS�Z
CALL_FUNCTION�Z
MAKE_FUNCTION�ZBUILD_SLICE�ZLOAD_CLOSURE�Z
LOAD_DEREF�ZSTORE_DEREF�ZDELETE_DEREF�ZCALL_FUNCTION_KW�ZCALL_FUNCTION_EX�Z
SETUP_WITH�ZLIST_APPEND�ZSET_ADD�ZMAP_ADD�ZLOAD_CLASSDEREF��ZBUILD_LIST_UNPACK�ZBUILD_MAP_UNPACK�ZBUILD_MAP_UNPACK_WITH_CALL�ZBUILD_TUPLE_UNPACK�ZBUILD_SET_UNPACK�ZSETUP_ASYNC_WITH�ZFORMAT_VALUE�ZBUILD_CONST_KEY_MAP�ZBUILD_STRING�ZBUILD_TUPLE_UNPACK_WITH_CALL�ZLOAD_METHOD�ZCALL_METHOD�ZCALL_FINALLY�ZPOP_FINALLY�N)�__all__Z_opcoderr�ImportErrorrrrrrrrrr
r
�ranger	rrr r!rrrrrr�<module>sD
�



























































































































symbol.cpython-38.opt-2.pyc000064400000004432151450073350011447 0ustar00U

��.e=�@s�dZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJdKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[iZ\e]e^��_��D]$\Z`Zaebea�ebd\�k�r�e`e\ea<�q�[`[ad]S)^�iiiiiiiii	i
iii
iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[�N)cZsingle_inputZ
file_inputZ
eval_inputZ	decoratorZ
decoratorsZ	decoratedZ
async_funcdefZfuncdefZ
parametersZ
typedargslistZtfpdefZvarargslistZvfpdefZstmtZsimple_stmtZ
small_stmtZ	expr_stmtZ	annassignZtestlist_star_exprZ	augassignZdel_stmtZ	pass_stmtZ	flow_stmtZ
break_stmtZ
continue_stmtZreturn_stmtZ
yield_stmtZ
raise_stmtZimport_stmtZimport_nameZimport_fromZimport_as_nameZdotted_as_nameZimport_as_namesZdotted_as_namesZdotted_nameZglobal_stmtZ
nonlocal_stmtZassert_stmtZ
compound_stmtZ
async_stmtZif_stmtZ
while_stmtZfor_stmtZtry_stmtZ	with_stmtZ	with_itemZ
except_clauseZsuiteZnamedexpr_testZtestZtest_nocondZlambdefZlambdef_nocondZor_testZand_testZnot_testZ
comparisonZcomp_opZ	star_expr�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactorZpowerZ	atom_exprZatomZ
testlist_compZtrailerZ
subscriptlistZ	subscriptZsliceopZexprlistZtestlistZdictorsetmakerZclassdefZarglistZargumentZ	comp_iterZ
sync_comp_forZcomp_forZcomp_ifZ
encoding_declZ
yield_exprZ	yield_argZfunc_body_suiteZfunc_type_inputZ	func_typeZtypelistZsym_name�list�globals�items�_nameZ_value�type�r	r	�/usr/lib64/python3.8/symbol.py�<module>s�ast.cpython-38.opt-2.pyc000064400000024137151450073350010735 0ustar00U

e5d"K�@s�ddlTd<ddd�dd�Zd	d
�Zd=dd
�Zdd�Zdd�Zd>dd�Zdd�Zdd�Zd?dd�Z	dd�Z
dd�Zdd�d d!�Zd"d#�Z
Gd$d%�d%e�ZGd&d'�d'e�Zd(d)�Zd*d+�Zeee�e_eee�e_Gd,d-�d-e�Zd.d/�ZGd0d1�d1eed2�ZGd3d4�d4eed2�ZGd5d6�d6eed2�ZGd7d8�d8eed2�ZGd9d:�d:eed2�Zeee e!fee"fee#feed�e$feed;�fiZ%ee$fiZ&e$d8ed�d8ed1e d1e!d1e"d4e#d6ed;�d:iZ'dS)@�)�*�	<unknown>�execFN)�
type_comments�feature_versioncCsFt}|r|tO}t|t�r(|\}}|}n|dkr4d}t|||||d�S)N���)�_feature_version)Z
PyCF_ONLY_ASTZPyCF_TYPE_COMMENTS�
isinstance�tuple�compile)�source�filename�moderr�flags�major�minor�r�/usr/lib64/python3.8/ast.py�parses

�rcs`t|t�rt|dd�}t|t�r&|j}dd���fdd���fdd������fd	d
���|�S)N�eval)rcSstd|����dS)Nzmalformed node or string: )�
ValueError��noderrr�_raise_malformed_node>sz+literal_eval.<locals>._raise_malformed_nodecs,t|t�rt|j�tttfkr&�|�|jS�N)r	�Constant�type�value�int�float�complexr)rrr�_convert_num@sz"literal_eval.<locals>._convert_numcsDt|t�r<t|jttf�r<�|j�}t|jt�r6|
S|S�|�Sr)r	ZUnaryOp�opZUAddZUSub�operand)rr#)r!rr�_convert_signed_numDs
z)literal_eval.<locals>._convert_signed_numcst|t�r|jSt|t�r*tt�|j��St|t�rDtt�|j��St|t	�r^t
t�|j��St|t�r�t|j
�t|j�kr��|�ttt�|j
�t�|j���St|t��rt|jttf��r�|j�}�|j�}t|ttf��rt|t��rt|jt��r||S||S�|�Sr)r	rrZTupler
�mapZeltsZList�list�Set�setZDict�len�keys�values�dict�zipZBinOpr"ZAddZSub�left�rightrrr )rr.r/��_convertr!r$rrrr1Ls,





�

zliteral_eval.<locals>._convert)r	�strrZ
Expression�body)Znode_or_stringrr0r�literal_eval3s

r4Tcs2���fdd��t|t�s*td|jj���|�S)Nc	st|t�r�g}�}|jD]V}zt||�}Wntk
rBd}YqX|r`|�d|�|�f�q|��|��q�r�|jr�|jD]:}z |�d|�t||��f�Wq�tk
r�Yq�Xq�d|jjd�	|�fSt|t
�r�dd�	�fdd�|D��St|�S)NTz%s=%sz%s(%s)z, z[%s]c3s|]}�|�VqdSrr)�.0�x)�_formatrr�	<genexpr>�sz(dump.<locals>._format.<locals>.<genexpr>)r	�AST�_fields�getattr�AttributeError�append�_attributes�	__class__�__name__�joinr&�repr)r�args�keywords�fieldr�a�r7�annotate_fields�include_attributesrrr7ps*




 
zdump.<locals>._formatzexpected AST, got %r)r	r9�	TypeErrorr?r@)rrHrIrrGr�dumpfs

rKcCsVdD]L}||jkr||jkrt||d�}|dk	sDt||�r|�d�rt|||�q|S)N)�lineno�
col_offset�
end_lineno�end_col_offsetZend_)r>r;�hasattr�
startswith�setattr)�new_nodeZold_node�attrrrrr�
copy_location�s��rUcs �fdd���|dddd�|S)Ncs�d|jkr"t|d�s||_n|j}d|jkrDt|d�s>||_n|j}d|jkrft|d�s`||_n|j}d|jkr�t|d�s�||_n|j}t|�D]}�|||||�q�dS)NrLrNrMrO)r>rPrLrNrMrO�iter_child_nodes)rrLrMrNrO�child��_fixrrrY�s$







z#fix_missing_locations.<locals>._fix�rrrrrXr�fix_missing_locations�sr[rZcCsVt|�D]H}d|jkr(t|dd�||_d|jkrt|dd�}dk	r|||_q|S)NrLrrN)�walkr>r;rLrN)r�nrWrNrrr�increment_lineno�s
��r^c	cs:|jD].}z|t||�fVWqtk
r2YqXqdSr)r:r;r<)rrErrr�iter_fields�s

r_ccsLt|�D]>\}}t|t�r"|Vqt|t�r|D]}t|t�r0|Vq0qdSr)r_r	r9r&)r�namerE�itemrrrrV�s


rVcCs�t|ttttf�s"td|jj��|jr8t|jdt	�s<dS|jdj
}t|t�rZ|j}n"t|t
�rxt|j
t�rx|j
}ndS|r�ddl}|�|�}|S)Nz%r can't have docstringsr)r	ZAsyncFunctionDefZFunctionDefZClassDefZModulerJr?r@r3ZExprr�Str�srr2�inspectZcleandoc)rZclean�textrdrrr�
get_docstring�s	

rfcCs�d}g}d}|t|�krx||}||7}|d7}|dkr`|t|�kr`||dkr`|d7}|d7}|dkr|�|�d}q|r�|�|�|S)Nr�rZ�
�
z
)r)r=)r�idx�linesZ	next_line�crrr�_splitlines_no_ffs  

rmcCs,d}|D]}|dkr||7}q|d7}q|S)Nrgz	� r)r�resultrlrrr�_pad_whitespaces

rp)�paddedcCs�z$|jd}|jd}|j}|j}Wntk
r:YdSXt|�}||krd||��||���S|r�t||��d|����}nd}|||��|d���}	||��d|���}
||d|�}|�	d|	�|�
|
�d�|�S)NrZrgr)rLrNrMrOr<rm�encode�decoderp�insertr=rA)rrrqrLrNrMrOrkZpadding�firstZlastrrr�get_source_segment*s&	



rvccs<ddlm}||g�}|r8|��}|�t|��|VqdS)Nr)�deque)�collectionsrw�popleft�extendrV)rrwZtodorrrr\Ms
r\c@s$eZdZdd�Zdd�Zdd�ZdS)�NodeVisitorcCs"d|jj}t|||j�}||�S)N�visit_)r?r@r;�
generic_visit)�selfr�method�visitorrrr�visitoszNodeVisitor.visitcCsTt|�D]F\}}t|t�r:|D]}t|t�r|�|�qqt|t�r|�|�qdSr)r_r	r&r9r�)r~rrErrarrrr}us


zNodeVisitor.generic_visitc	Cs�|j}t�t|��}|dkr@t��D]\}}t||�r$|}q@q$|dk	r�d|}zt||�}Wntk
rrYn&Xddl}|�	|�d�t
d�||�S|�|�S)Nr|rz" is deprecated; add visit_Constant�)r�_const_node_type_names�getr�itemsr	r;r<�warnings�warn�PendingDeprecationWarningr})	r~rrZ	type_name�clsr`rr�r�rrr�visit_Constants(
�zNodeVisitor.visit_ConstantN)r@�
__module__�__qualname__r�r}r�rrrrr{[s
r{c@seZdZdd�ZdS)�NodeTransformercCs�t|�D]�\}}t|t�rvg}|D]D}t|t�r\|�|�}|dkrFq"nt|t�s\|�|�q"|�|�q"||dd�<qt|t�r|�|�}|dkr�t||�qt|||�q|Sr)	r_r	r&r9r�rzr=�delattrrR)r~rrE�	old_valueZ
new_valuesrrSrrrr}�s&






zNodeTransformer.generic_visitN)r@r�r�r}rrrrr��s$r�cCs|jSr�r)r~rrr�_getter�sr�cCs
||_dSrr�)r~rrrr�_setter�sr�c@seZdZdd�ZdS)�_ABCcCsft|t�sdS|tkrZz
|j}Wntk
r6YdSXt|t|�oXt|t�|d��St�||�S)NFr)	r	r�_const_typesrr<�_const_types_notr�r�__instancecheck__)r��instrrrrr��s

�z_ABC.__instancecheck__N)r@r�r�r�rrrrr��sr�cOsf|D]<}||jkrq|j�|�}|t|�krt|j�d|����q|tkrTt||�Stj|f|�|�S)Nz" got multiple values for argument )r:�indexr)rJr@r�r�__new__)r�rC�kwargs�key�posrrr�_new�s

r�c@seZdZdZeZdS)�Num)r]N�r@r�r�r:r�r�rrrrr��sr�)�	metaclassc@seZdZdZeZdS)rb�rcNr�rrrrrb�srbc@seZdZdZeZdS)�Bytesr�Nr�rrrrr�sr�c@seZdZeZdS)�NameConstantN)r@r�r�r�r�rrrrr�sr�c@seZdZdZdd�ZdS)�EllipsisrcOs(|tkrtd|�|�Stj|f|�|�S)N.).)r�rr�)r�rCr�rrrr�szEllipsis.__new__N)r@r�r�r:r�rrrrr�sr�.)rr)TF)rZ)T)(�_astrr4rKrUr[r^r_rVrfrmrprvr\�objectr{r�r�r��propertyrr]rcrr�r�r�rbr�r�r�rrr r2�bytes�boolr�r�r�rrrr�<module>sx�3
'#

#:>	
���pdb.cpython-38.pyc000064400000134174151450073350007756 0ustar00U

e5d��"@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZGdd�de�Zddddd	d
ddd
g	Zdd�Zdd�Zdd�ZGdd�de�ZdZGdd�dejej�Zedk	�rnd
ddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7g"ZeD]"Zeeed8e�j��d97Z�q:eej j7Z[[dJd:d�Z!dKd;d�Z"d<d	�Z#d=d
�Z$dd>�d?d�Z%dLd@d�Z&dAd�Z'dBZ(dCdD�Z)dEd
�Z*dFZ+dGdH�Z,e-dIk�r�ddl.Z.e.�,�dS)Ma�	
The Python Debugger Pdb
=======================

To use the debugger in its simplest form:

        >>> import pdb
        >>> pdb.run('<a statement>')

The debugger's prompt is '(Pdb) '.  This will stop in the first
function call in <a statement>.

Alternatively, if a statement terminated with an unhandled exception,
you can use pdb's post-mortem facility to inspect the contents of the
traceback:

        >>> <a statement>
        <exception traceback>
        >>> import pdb
        >>> pdb.pm()

The commands recognized by the debugger are listed in the next
section.  Most can be abbreviated as indicated; e.g., h(elp) means
that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
nor as 'H' or 'Help' or 'HELP').  Optional arguments are enclosed in
square brackets.  Alternatives in the command syntax are separated
by a vertical bar (|).

A blank line repeats the previous command literally, except for
'list', where it lists the next 11 lines.

Commands that the debugger doesn't recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ('!').  This is a powerful way to inspect the program being
debugged; it is even possible to change variables or call functions.
When an exception occurs in such a statement, the exception name is
printed but the debugger's state is not changed.

The debugger supports aliases, which can save typing.  And aliases can
have parameters (see the alias help entry) which allows one a certain
level of adaptability to the context under examination.

Multiple commands may be entered on a single line, separated by the
pair ';;'.  No intelligence is applied to separating the commands; the
input is split at the first ';;', even if it is in the middle of a
quoted string.

If a file ".pdbrc" exists in your home directory or in the current
directory, it is read in and executed as if it had been typed at the
debugger prompt.  This is particularly useful for aliases.  If both
files exist, the one in the home directory is read first and aliases
defined there can be overridden by the local file.  This behavior can be
disabled by passing the "readrc=False" argument to the Pdb constructor.

Aside from aliases, the debugger is not directly programmable; but it
is implemented as a class from which you can derive your own debugger
class, which you can make as fancy as you like.


Debugger commands
=================

�Nc@seZdZdZdS)�RestartzBCauses a debugger to be restarted for the debugged python program.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pdb.pyrWsr�run�pm�Pdb�runeval�runctx�runcall�	set_trace�post_mortem�helpc
Cs�t�dt�|��}zt�|�}Wntk
r8YdSX|�@t|dd�D],\}}|�|�rL|||fW5QR�SqLW5QRXdS)Nzdef\s+%s\s*[(]�)�start)�re�compile�escape�tokenize�open�OSError�	enumerate�match)�funcname�filenameZcre�fp�lineno�linerrr�
find_function^s
&r!cCsXt�|�\}}t�|�r,|j|jkr,|dfSt�|�r>|dfSt�||d��|dfS)Nr)�inspectZ
findsourceZisframe�	f_globals�f_localsZismoduleZgetblock)�obj�linesrrrr�getsourcelinesks
r'cCs8tt�|��}|��|D]\}}||kr|SqdS�Nr)�list�disZfindlinestarts�reverse)�codeZlastiZ
linestarts�irrrr�lasti2linenots
r.c@seZdZdZdd�ZdS)�_rstrz#String that doesn't quote its repr.cCs|S�Nr��selfrrr�__repr__sz_rstr.__repr__N)rrrrr3rrrrr/}sr/z
-> c@seZdZdZd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZeZd�d8d9�Zd:d;�ZeZ eZ!eZ"d<d=�Z#eZ$d>d?�Z%d@dA�Z&dBdC�Z'eZ(dDdE�Z)eZ*dFdG�Z+eZ,dHdI�Z-eZ.dJdK�Z/e/Z0eZ1eZ2dLdM�Z3e3Z4e3Z5dNdO�Z6dPdQ�Z7e7Z8dRdS�Z9e9Z:dTdU�Z;e;Z<dVdW�Z=e=Z>dXdY�Z?e?Z@dZd[�ZAeAZBd\d]�ZCeCZDd^d_�ZEeEZFZGd`da�ZHeHZIdbdc�ZJeZKddde�ZLeLZMeLZNdfdg�ZOdhdi�ZPePZQdjdk�ZReRZSdldm�ZTd�dndo�ZUdpdq�ZVdrds�ZWeZXeZYeZZdtdu�Z[e[Z\dvdw�Z]e]Z^dxdy�Z_eZ`d�d{d|�Zad}d~�ZbeZcdd��ZdeZed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d�d�d�d�d�gZld�d��Zmenfd�d��Zod�d��ZpepZqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��ZvdS)�rN�tabFTc		Cs>tjj||d�tj�||||�t�d�|r6d|_d|_i|_	i|_
d|_d|_i|_
zddl}|�d�Wntk
r�YnXd|_||_g|_|�rz,ttj�d���}|j�|�W5QRXWntk
r�YnXz$td	��}|j�|�W5QRXWntk
�rYnXi|_i|_i|_d|_d|_dS)
N)�skipzpdb.Pdbrz(Pdb) �Fz 	
`@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)�bdb�Bdb�__init__�cmd�Cmd�sys�auditZuse_rawinput�prompt�aliases�
displaying�
mainpyfile�_wait_for_mainpyfile�	tb_lineno�readlineZset_completer_delims�ImportError�allow_kbdint�nosigint�rcLinesr�os�path�
expanduser�extendr�commands�commands_doprompt�commands_silent�commands_defining�
commands_bnum)	r2�completekey�stdin�stdoutr5rGZreadrcrDZrcFilerrrr9�sF

zPdb.__init__cCs*|jr
t�|�d�|��|�|�dS)Nz-
Program interrupted. (Use 'cont' to resume).)rF�KeyboardInterrupt�message�set_stepr)r2Zsignum�framerrr�sigint_handler�s

zPdb.sigint_handlercCstj�|�|��dSr0)r7r8�reset�forgetr1rrrrZ�sz	Pdb.resetcCs&d|_g|_d|_d|_|j��dSr()r�stack�curindex�curframerC�clearr1rrrr[�s
z
Pdb.forgetcCsh|��|�||�\|_|_|rDt|jj|j�}||j|j<|j	}q|j|jd|_
|j
j|_|�
�Sr()r[Z	get_stackr\r]r.�tb_frame�f_code�tb_lastirC�tb_nextr^r$�curframe_locals�execRcLines)r2�f�tbrrrr�setup�s
z	Pdb.setupcCsd|js
dS|j}|��g|_|r`|����}|r|ddkr|�|�r|jt|�7_dSqdS)Nr�#T)rHr+�pop�strip�onecmd�reversed)r2rHr rrrre�s
zPdb.execRcLinescCs.|jr
dS|�|�r*|�d�|�|d�dS)znThis method is called when there is the remote possibility
        that we ever need to stop in this function.Nz--Call--)rBZ	stop_hererV�interaction)r2rXZ
argument_listrrr�	user_call�s


z
Pdb.user_callcCsH|jr.|j|�|jj�ks$|jdkr(dSd|_|�|�rD|�|d�dS)z;This function is called when we stop or break at this line.rNF)rBrA�canonicra�co_filename�f_lineno�bp_commandsrn)r2rXrrr�	user_line�s�
z
Pdb.user_linecCs�t|dd�r�|j|jkr�|j}d|_|j}|�|d�|j|D]}|�|�q@||_|j|sr|�|j|j	�|j
|r�|��|��dSdS)z�Call every command that was set for the current active breakpoint
        (if there is one).

        Returns True if the normal interaction function must be called,
        False otherwise.�	currentbpFrNr)
�getattrrurM�lastcmdrhrlrO�print_stack_entryr\r]rN�_cmdloopr[)r2rXruZlastcmd_backr rrrrss"
�

zPdb.bp_commandscCs.|jr
dS||jd<|�d�|�|d�dS)z7This function is called when a return trap is set here.N�
__return__z
--Return--)rBr$rVrn)r2rXZreturn_valuerrr�user_return s


zPdb.user_returncCsh|jr
dS|\}}}||f|jd<|s2|tkr2dnd}|�d|t�||�d��f�|�||�dS)zoThis function is called if an exception occurs,
        but only if we are to stop at or just below this level.NZ
__exception__z	Internal r6z%s%s���)rBr$�
StopIterationrV�	traceback�format_exception_onlyrkrn)r2rX�exc_info�exc_type�	exc_value�
exc_traceback�prefixrrr�user_exception(s
���zPdb.user_exceptioncCsBzd|_|��d|_Wq>Wqtk
r:|�d�YqXqdS)NTFz--KeyboardInterrupt--)rF�cmdlooprUrVr1rrrry<szPdb._cmdloopcCs^|j�|j�}|rZ|��D]>\}}|�|�}||k	r||kr|||<|�d|||f�qdS)Nzdisplay %s: %r  [old: %r])r@�getr^�items�_getval_exceptrV)r2r@�exprZoldvalueZnewvaluerrr�preloopIs
�zPdb.preloopcCsttjr6zt�tjtj�Wntk
r.YnXdt_|�||�rN|��dS|�|j|j	�|�
�|��dSr0)r�_previous_sigint_handler�signal�SIGINT�
ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVszPdb.interactioncCs|dk	r|�t|��dS)z{Custom displayhook for the exec in default(), which prevents
        assignment of the _ variable in the builtins.
        N)rV�repr)r2r%rrr�displayhookhszPdb.displayhookc	Cs�|dd�dkr|dd�}|j}|jj}zdt|ddd�}tj}tj}tj}z(|jt_|jt_|jt_t|||�W5|t_|t_|t_XWn4t�	�dd�}|�
tj|�d�
��YnXdS)Nr�!�
z<stdin>Zsingle�r|)rdr^r#rr<rTrSr��execr��errorr~rrk)	r2r �locals�globalsr,Zsave_stdoutZ
save_stdinZsave_displayhookr�rrr�defaultps(zPdb.defaultcCs�|��s|S|��}|d|jkr�|j|d}d}|dd�D] }|�dt|�|�}|d7}q@|�dd�|dd���}|��}q|ddkr�|�d�}|dkr�||d	d���}|j�	|�|d|��
�}|S)
z*Handle alias expansion and ';;' separator.rrN�%z%*� �aliasz;;r�)rk�splitr?�replace�str�join�find�lstrip�cmdqueue�append�rstrip)r2r �argsZiiZtmpArgZmarker�nextrrr�precmd�s(�


z
Pdb.precmdcCs"|jstj�||�S|�|�SdS)z�Interpret the argument as though it had been typed in response
        to the prompt.

        Checks whether this line is typed at the normal prompt or in
        a breakpoint command list definition.
        N)rPr:r;rl�handle_command_def)r2r rrrrl�sz
Pdb.onecmdcCs�|�|�\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf|�|d|�n
|�|�zt|d|�}Wntk
r�|j}YnX|j	|j
kr�d|j|j<g|_dSdS)	z8Handles one command line during command list definition.NZsilentT�endrr��do_F)Z	parselinerOrQr�rMr�rv�AttributeErrorr�r�commands_resumingrN)r2r r:�argZcmdlist�funcrrrr��s,
zPdb.handle_command_defcCst||jd�dS)N��file��printrT�r2�msgrrrrV�szPdb.messagecCstd||jd�dS)Nz***r�r�r�rrrr��sz	Pdb.errorcCs�|���d�rgSz|�||||�}Wntk
r>g}YnXt�t�|�d�}|D]H}tj�|�rx|�	|d�qXtj�
|�rX|���d�rX|�	|d�qX|S)N)�:�,�*�/)�.pyz.pywr�)rk�endswith�_complete_expression�	Exception�globrrIrJ�isdirr��isfile�lower)r2�textr �begidx�endidxZret�globs�fnrrr�_complete_location�s
zPdb._complete_locationcs�fdd�ttjj�D�S)Ncs.g|]&\}}|dk	rt|����rt|��qSr0)r��
startswith)�.0r-�bp�r�rr�
<listcomp>�s�z*Pdb._complete_bpnumber.<locals>.<listcomp>)rr7�
Breakpoint�
bpbynumber�r2r�r r�r�rr�r�_complete_bpnumber�szPdb._complete_bpnumberc	s�|js
gS|jj|j�}d�kr���d��z,|�d}�dd�D]}t||�}qDWnttfk
rrgYSXd��dd��d���fdd�t|�D�S�fdd�|�	�D�SdS)N�.rrr|cs"g|]}|��d�r�|�qS)r|�r��r��n)�dottedr�rrr�sz,Pdb._complete_expression.<locals>.<listcomp>csg|]}|���r|�qSrr�r�r�rrr�s
)
r^r#rdr�rv�KeyErrorr�r��dir�keys)r2r�r r�r��nsr%�partr)r�r�r�rr��s

zPdb._complete_expressioncCs,|sttjj�d}n&zt|�}Wn|�d�YdSX||_||jkrj|j||j||j	|f}nd}g|j|<d|j|<d|j	|<|j
}d|_
d|_zzz|��Wnht
k
�r|r�|d|j|<|d|j|<|d|j	|<n|j|=|j|=|j	|=|�d	�YnXW5d|_||_
XdS)
a4commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)

        Specify a list of commands for breakpoint number bpnumber.
        The commands themselves are entered on the following lines.
        Type a line containing just 'end' to terminate the commands.
        The commands are executed when the breakpoint is hit.

        To remove all commands from a breakpoint, type commands and
        follow it immediately with end; that is, give no commands.

        With no bpnumber argument, commands refers to the last
        breakpoint set.

        You can use breakpoint commands to start your program up
        again.  Simply use the continue command, or step, or any other
        command that resumes execution.

        Specifying any command resuming execution (currently continue,
        step, next, return, jump, quit and their abbreviations)
        terminates the command list (as if that command was
        immediately followed by end).  This is because any time you
        resume execution (even with a simple next or step), you may
        encounter another breakpoint -- which could have its own
        command list, leading to ambiguities about which list to
        execute.

        If you use the 'silent' command in the command list, the usual
        message about stopping at a breakpoint is not printed.  This
        may be desirable for breakpoints that are to print a specific
        message and then continue.  If none of the other commands
        print anything, you will see no sign that the breakpoint was
        reached.
        rz.Usage: commands [bnum]
        ...
        endNTFz(com) rr�z1command definition aborted, old commands restored)�lenr7r�r��intr�rQrMrNrOr>rPr�rU)r2r�ZbnumZold_command_defsZprompt_backrrr�do_commands	sB%

�


zPdb.do_commandsrc
CsB|s8|jr4|�d�tjjD]}|r|�|���qdSd}d}d}|�d�}|dkrz||dd���}|d|���}|�	d�}d}	|dk�r|d|���}|�
|�}
|
s�|�d|�dS|
}||dd���}zt|�}Wn&t
k
�r|�d|�YdSXn�zt|�}Wn�t
k
�r�zt||jj|j�}Wn|}YnXz.t|d	��rj|j}|j}|j}	|j}|j}WnD|�|�\}
}}|
�s�|�d
|�YYdS|
}	t|�}YnXYnX|�s�|��}|�||�}|�r>|�|||||	�}|�r|�|�n*|�||�d}|�d|j|j|jf�dS)
a�b(reak) [ ([filename:]lineno | function) [, condition] ]
        Without argument, list all breaks.

        With a line number argument, set a break at this line in the
        current file.  With a function name, set a break at the first
        executable line of that function.  If a second argument is
        present, it is a string specifying an expression which must
        evaluate to true before the breakpoint is honored.

        The line number may be prefixed with a filename and a colon,
        to specify a breakpoint in another file (probably one that
        hasn't been loaded yet).  The file is searched for on
        sys.path; the .py suffix may be omitted.
        z!Num Type         Disp Enb   WhereNr�rrr�z%r not found from sys.pathzBad lineno: %s�__func__zJThe specified object %r is not a function or was not found along sys.path.r|zBreakpoint %d at %s:%d) �breaksrVr7r�r�Zbpformatr�r�r��rfind�lookupmoduler�r�r��evalr^r#rd�hasattrr��__code__�co_name�co_firstlinenorq�lineinfo�defaultFile�	checklineZ	set_break�
get_breaks�numberr�r )r2r�Z	temporaryr�rr�condZcommaZcolonrrfr�r,�okZlnr �errrrr�do_breakXs�





�

��zPdb.do_breakcCs"|jjj}|dkr|jr|j}|S)zProduce a reasonable default.z<string>)r^rarqrA)r2rrrrr��s
zPdb.defaultFilecCs|�|d�dS)z�tbreak [ ([filename:]lineno | function) [, condition] ]
        Same arguments as break, but sets a temporary breakpoint: it
        is automatically deleted when first hit.
        rN)r��r2r�rrr�	do_tbreak�sz
Pdb.do_tbreakc
Cs�d}|�d�}t|�dkr(|d��}nt|�dkrB|d��}n|S|dkrR|S|�d�}|ddkr~|d=t|�dkr~|S|��}t|�dkr�|d}n|�|d�}|r�|}|d}t||�}	|	p�|S)	N)NNN�'rr�r6r�r2)r�r�rkr�r�r!)
r2Z
identifierZfailedZidstring�id�partsZfname�itemrfZanswerrrrr��s.



zPdb.lineinfocCs�t|d�r|jjnd}t�|||�}|s6|�d�dS|��}|rn|ddksn|dd�dksn|dd�dkr||�d	�dS|S)
z�Check whether specified line seems to be executable.

        Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
        line or EOF). Warning: testing is not comprehensive.
        r^NzEnd of filerrir�z"""z'''zBlank or comment)r�r^r#�	linecache�getlinerVrkr�)r2rrr�r rrrr��s
��
z
Pdb.checklinecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)z�enable bpnumber [bpnumber ...]
        Enables the breakpoints given as a space separated list of
        breakpoint numbers.
        Nz
Enabled %s)r��get_bpbynumberr�r��enablerV�r2r�r�r-r�r�rrr�	do_enablesz
Pdb.do_enablecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)aNdisable bpnumber [bpnumber ...]
        Disables the breakpoints given as a space separated list of
        breakpoint numbers.  Disabling a breakpoint means it cannot
        cause the program to stop execution, but unlike clearing a
        breakpoint, it remains in the list of breakpoints and can be
        (re-)enabled.
        NzDisabled %s)r�r�r�r��disablerVr�rrr�
do_disableszPdb.do_disablec
Cs�|�dd�}z|d}Wntk
r0d}YnXz|�|d���}WnHtk
rf|�d�YnXtk
r�}z|�|�W5d}~XYn.X||_|s�|�d|j�n|�d|j�dS)a#condition bpnumber [condition]
        Set a new condition for the breakpoint, an expression which
        must evaluate to true before the breakpoint is honored.  If
        condition is absent, any existing condition is removed; i.e.,
        the breakpoint is made unconditional.
        r�rNr�Breakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.)	r��
IndexErrorr�rkr�r�r�rVr�)r2r�r�r�r�r�rrr�do_condition%s
zPdb.do_conditionc
Cs�|��}zt|d���}Wnd}YnXz|�|d���}WnHtk
rb|�d�Ynvtk
r�}z|�|�W5d}~XYnLX||_|dkr�|dkr�d|}nd}|�d||j	f�n|�d|j	�dS)	a�ignore bpnumber [count]
        Set the ignore count for the given breakpoint number.  If
        count is omitted, the ignore count is set to 0.  A breakpoint
        becomes active when the ignore count is zero.  When non-zero,
        the count is decremented each time the breakpoint is reached
        and the breakpoint is not disabled and any associated
        condition evaluates to true.
        rrr�Nz%d crossingsz
1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.)
r�r�rkr�rr�r��ignorerVr�)r2r�r��countr�r�Zcountstrrrr�	do_ignore@s,	

��z
Pdb.do_ignorec
Cs�|stztd�}Wntk
r(d}YnX|����}|dkrpdd�tjjD�}|��|D]}|�d|�q\dSd|k�r|�	d�}|d|�}||d	d�}zt
|�}Wntk
r�d
|}YnX|�||�}|�
||�}|r�|�|�n|D]}|�d|�q�dS|��}	|	D]\}z|�|�}Wn.tk
�r^}z|�|�W5d}~XYnX|�|�|�d|��qdS)a=cl(ear) filename:lineno
cl(ear) [bpnumber [bpnumber...]]
        With a space separated list of breakpoint numbers, clear
        those breakpoints.  Without argument, clear all breaks (but
        first ask confirmation).  With a filename:lineno argument,
        clear all breaks at that line in that file.
        zClear all breaks? Zno)�yZyescSsg|]}|r|�qSrr)r�r�rrrr�qsz Pdb.do_clear.<locals>.<listcomp>z
Deleted %sNr�rzInvalid line number (%s))�input�EOFErrorrkr�r7r�r�Zclear_all_breaksrVr�r�r�r�Zclear_breakr�r�r�Zclear_bpbynumber)
r2r�ZreplyZbplistr�r-rrr�Z
numberlistrrr�do_clearcsF



zPdb.do_clearcCs|��dS)z�w(here)
        Print a stack trace, with the most recent frame at the bottom.
        An arrow indicates the "current frame", which determines the
        context of most commands.  'bt' is an alias for this command.
        N)�print_stack_tracer�rrr�do_where�szPdb.do_wherecCs^d|krt|j�ks nt�||_|j|jd|_|jj|_|�|j|j�d|_dSr()	r�r\�AssertionErrorr]r^r$rdrxr)r2r�rrr�
_select_frame�s 
zPdb._select_framecCsz|jdkr|�d�dSzt|p"d�}Wn$tk
rL|�d|�YdSX|dkr\d}ntd|j|�}|�|�dS)z�u(p) [count]
        Move the current frame count (default one) levels up in the
        stack trace (to an older frame).
        rzOldest frameNr�Invalid frame count (%s))r]r�r�r��maxr�r2r�rZnewframerrr�do_up�s

z	Pdb.do_upcCs�|jdt|j�kr"|�d�dSzt|p,d�}Wn$tk
rV|�d|�YdSX|dkrpt|j�d}ntt|j�d|j|�}|�|�dS)z�d(own) [count]
        Move the current frame count (default one) levels down in the
        stack trace (to a newer frame).
        rzNewest frameNr
r)r]r�r\r�r�r��minrrrrr�do_down�s
zPdb.do_downcCsh|rRzt|�}Wn$tk
r4|�d|�YdSX||jjkrV|�d�dSnd}|�|j|�dS)aNunt(il) [lineno]
        Without argument, continue execution until the line with a
        number greater than the current one is reached.  With a line
        number, continue execution until a line with a number greater
        or equal to that is reached.  In both cases, also stop when
        the current frame returns.
        �Error in argument: %rNz7"until" line number is smaller than current line numberr)r�r�r�r^rrZ	set_until)r2r�rrrr�do_until�s
zPdb.do_untilcCs|��dS)z�s(tep)
        Execute the current line, stop at the first possible occasion
        (either in a function that is called or in the current
        function).
        r)rWr�rrr�do_step�szPdb.do_stepcCs|�|j�dS)zxn(ext)
        Continue execution until the next line in the current function
        is reached or it returns.
        r)Zset_nextr^r�rrr�do_next�szPdb.do_nextcCs<|r4ddl}tjdd�}|�|�t_|tjdd�<t�dS)arun [args...]
        Restart the debugged python program. If a string is supplied
        it is split with "shlex", and the result is used as the new
        sys.argv.  History, breakpoints, actions and debugger options
        are preserved.  "restart" is an alias for "run".
        rNr)�shlexr<�argvr�r)r2r�rZargv0rrr�do_run�sz
Pdb.do_runcCs|�|j�dS)zPr(eturn)
        Continue execution until the current function returns.
        r)Z
set_returnr^r�rrr�	do_returnsz
Pdb.do_returncCs>|js2zt�tj|j�t_Wntk
r0YnX|��dS)z]c(ont(inue))
        Continue execution, only stop when a breakpoint is encountered.
        r)rGr�r�rYrr�r�Zset_continuer�rrr�do_continues�zPdb.do_continuec
Cs�|jdt|j�kr"|�d�dSzt|�}Wntk
rL|�d�YnnXz:||j_|j|jd|f|j|j<|�|j|j�Wn0tk
r�}z|�d|�W5d}~XYnXdS)a�j(ump) lineno
        Set the next line that will be executed.  Only available in
        the bottom-most frame.  This lets you jump back and execute
        code again, or jump forward to skip code that you don't want
        to run.

        It should be noted that not all jumps are allowed -- for
        instance it is not possible to jump into the middle of a
        for loop or out of a finally clause.
        rz)You can only jump within the bottom frameNz)The 'jump' command requires a line numberrzJump failed: %s)	r]r�r\r�r�r�r^rrrx)r2r��errr�do_jump&s
zPdb.do_jumpcCs�t�d�|jj}|j}t|j|j|j�}d|j	�
�|_	|�d�zt�|j
|||f�Wn<tk
r�t��dd�}|�tj|�d�
��YnX|�d�t�|j�|j|_dS)z�debug code
        Enter a recursive debugger that steps through the code
        argument (which is an arbitrary expression or statement to be
        executed in the current environment).
        Nz(%s) zENTERING RECURSIVE DEBUGGERr�r|zLEAVING RECURSIVE DEBUGGER)r<�settracer^r#rdrrRrSrTr>rkrV�call_tracingr	r�r�r�r~rZtrace_dispatchrw)r2r�r�r��pr�rrr�do_debugCs


zPdb.do_debugcCsd|_|��dS)z[q(uit)
exit
        Quit from the debugger. The program being executed is aborted.
        Tr)�_user_requested_quit�set_quitr�rrr�do_quitZszPdb.do_quitcCs|�d�d|_|��dS)z=EOF
        Handles the receipt of EOF as a command.
        r6Tr)rVr"r#r�rrr�do_EOFes
z
Pdb.do_EOFcCs�|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t	|�D]>}|j
|}||krx|�d|||f�qJ|�d|f�qJdS)zHa(rgs)
        Print the argument list of the current function.
        rz%s = %rz%s = *** undefined ***N)r^rard�co_argcount�co_kwonlyargcount�co_flagsr"Z
CO_VARARGSZCO_VARKEYWORDS�range�co_varnamesrV)r2r��co�dictr�r-�namerrr�do_argsns
zPdb.do_argscCs.d|jkr |�t|jd��n
|�d�dS)zQretval
        Print the return value for the last return of a function.
        rzzNot yet returned!N)rdrVr�r�r�rrr�	do_retvals
z
Pdb.do_retvalcCsPzt||jj|j�WSt��dd�}|�tj|�d�	���YnXdS)Nr�r|)
r�r^r#rdr<r�r�r~rrk)r2r�r�rrr�_getval�szPdb._getvalcCsrz2|dkrt||jj|j�WSt||j|j�WSWn:t��dd�}tj|�d�	�}t
d|�YSXdS)Nr�r|z** raised %s **)r�r^r#rdr$r<r�r~rrkr/)r2r�rXr�r�rrrr��szPdb._getval_exceptcCs*z|�t|�|���WnYnXdS)z@p expression
        Print the value of the expression.
        N)rVr�r0r�rrr�do_p�szPdb.do_pcCs,z|�t�|�|���WnYnXdS)zHpp expression
        Pretty-print the value of the expression.
        N)rV�pprintZpformatr0r�rrr�do_pp�sz	Pdb.do_ppcCsfd|_d}|r�|dkr�z^d|krX|�d�\}}t|���}t|���}||krr||}nt|���}td|d�}Wq�tk
r�|�d|�YdSXn0|jdks�|dkr�td|jj	d�}n
|jd}|dkr�|d}|jj
j}|�|�}zZt
�||jj�}|�||d|�|||j�t|t|��|_t|�|k�rH|�d	�Wntk
�r`YnXdS)
a�l(ist) [first [,last] | .]

        List source code for the current file.  Without arguments,
        list 11 lines around the current line or continue the previous
        listing.  With . as argument, list 11 lines around the current
        line.  With one argument, list 11 lines starting at that line.
        With two arguments, list the given range; if the second
        argument is less than the first, it is a count.

        The current line in the current frame is indicated by "->".
        If an exception is being debugged, the line where the
        exception was originally raised or propagated is indicated by
        ">>", if it differs from the current line.
        r)Nr�r�r�r�
z[EOF])rwr�r�rkrr�r�rr^rrrarq�get_file_breaksr��getlinesr#�_print_linesrr�rVrU)r2r�Zlast�firstr�	breaklistr&rrr�do_list�s@




�zPdb.do_listc
Csp|jjj}|�|�}zt|j�\}}Wn2tk
rX}z|�|�WY�dSd}~XYnX|�||||j�dS)z\longlist | ll
        List the whole source code for the current function or frame.
        N)r^rarqr6r'rr�r8)r2r�rr:r&rr�rrr�do_longlist�s


zPdb.do_longlistc
Csvz|�|�}WnYdSXzt|�\}}Wn6ttfk
rd}z|�|�WY�dSd}~XYnX|�||�dS)z^source expression
        Try to get source code for the given object and display it.
        N)r0r'r�	TypeErrorr�r8)r2r�r%r&rr�rrr�	do_source�s
z
Pdb.do_sourcerc
Cs�|r|j}|j�|d�}nd}}t||�D]|\}}t|��d�}	t|	�dkrV|	d7}	||krh|	d7}	n|	d7}	||kr�|	d7}	n||kr�|	d7}	|�|	d|���q,d	S)
zPrint a range of lines.r|r��r��Bz->z>>�	N)	rrrCr�rr��rjustr�rVr�)
r2r&rr�rXZcurrent_linenoZ
exc_linenorr �srrrr8s 

zPdb._print_linescCs�z|�|�}WnYdSXd}z|jj}Wntk
rBYnX|r\|�d|j�dSz
|j}Wntk
rzYnX|r�|�d|j�dS|jtkr�|�d|j|j	f�dS|�t|��dS)z;whatis arg
        Print the type of the argument.
        Nz	Method %szFunction %szClass %s.%s)
r0r�r�r�rVr��	__class__�typerr)r2r��valuer,rrr�	do_whatiss.

z
Pdb.do_whatiscCsl|s8|�d�|j�|ji���D]}|�d|�q"n0|�|�}||j�|ji�|<|�d||f�dS)z�display [expression]

        Display the value of the expression if it changed, each time execution
        stops in the current frame.

        Without expression, list all display expressions for the current frame.
        zCurrently displaying:z%s: %rzdisplay %s: %rN)rVr@r�r^r�r��
setdefault)r2r�r��valrrr�
do_display<s

zPdb.do_displaycCsT|r@z|j�|ji�|=WqPtk
r<|�d|�YqPXn|j�|jd�dS)z�undisplay [expression]

        Do not display the expression any more in the current frame.

        Without expression, clear all display expressions for the current frame.
        znot displaying %sN)r@r�r^r�r�rjr�rrr�do_undisplayOszPdb.do_undisplaycs�fdd�|j�|ji�D�S)Ncsg|]}|���r|�qSrr�)r�rr�rrr�_s
�z*Pdb.complete_undisplay.<locals>.<listcomp>)r@r�r^r�rr�r�complete_undisplay^szPdb.complete_undisplaycCs |jj|j�}tjd|d�dS)z�interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
        z
*interactive*)ZlocalN)r^r#rdr,�interact)r2r�r�rrr�do_interactbszPdb.do_interactcCs�|��}t|�dkrHt|j���}|D]}|�d||j|f�q&dS|d|jkr�t|�dkr�|�d|d|j|df�nd�|dd��|j|d<dS)acalias [name [command [parameter parameter ...] ]]
        Create an alias called 'name' that executes 'command'.  The
        command must *not* be enclosed in quotes.  Replaceable
        parameters can be indicated by %1, %2, and so on, while %* is
        replaced by all the parameters.  If no command is given, the
        current alias for name is shown. If no name is given, all
        aliases are listed.

        Aliases may be nested and can contain anything that can be
        legally typed at the pdb prompt.  Note!  You *can* override
        internal pdb commands with aliases!  Those internal commands
        are then hidden until the alias is removed.  Aliasing is
        recursively applied to the first word of the command line; all
        other words in the line are left alone.

        As an example, here are two useful aliases (especially when
        placed in the .pdbrc file):

        # Print instance variables (usage "pi classInst")
        alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
        # Print instance variables in self
        alias ps pi self
        rz%s = %sNrr�)r�r��sortedr?r�rVr�)r2r�r�r�r�rrr�do_aliasks"zPdb.do_aliascCs6|��}t|�dkrdS|d|jkr2|j|d=dS)z9unalias name
        Delete the specified alias.
        rN)r�r�r?)r2r�r�rrr�
do_unalias�s
zPdb.do_unaliascs�fdd�|jD�S)Ncsg|]}|���r|�qSrr�)r��ar�rrr��s
z(Pdb.complete_unalias.<locals>.<listcomp>)r?r�rr�r�complete_unalias�szPdb.complete_unaliasrrrrr$rcCs4z|jD]}|�|�qWntk
r.YnXdSr0)r\rxrU)r2�frame_linenorrrr	�s

zPdb.print_stack_tracecCs6|\}}||jkrd}nd}|�||�||��dS)Nz> z  )r^rVZformat_stack_entry)r2rTZ
prompt_prefixrXrr�rrrrx�s

�zPdb.print_stack_entrycCs�|stj�||�Sz@zt|d|�}|�WWStk
rNt|d|�}YnXWn"tk
rt|�d|�Yn0Xtjjdkr�|�d|�dS|�	|j
���dS)z�h(elp)
        Without argument, print the list of available commands.
        With a command name as argument, print help about that command.
        "help pdb" shows the full pdb documentation.
        "help exec" gives help on the ! command.
        Zhelp_r�zNo help for %rr�zJNo help for %r; please do not run Python with -OO if you need command helpN)r:r;�do_helprvr�r�r<�flags�optimizerVrr�)r2r�ZtopicZcommandrrrrU�s 
�zPdb.do_helpcCs|�|jjpd���dS)a�(!) statement
        Execute the (one-line) statement in the context of the current
        stack frame.  The exclamation point can be omitted unless the
        first word of the statement resembles a debugger command.  To
        assign to a global variable you must always prefix the command
        with a 'global' command, e.g.:
        (Pdb) global list_options; list_options = ['-l']
        (Pdb)
        r6N)rV�	help_execrrkr1rrrrX�s
z
Pdb.help_execcCs
t�dSr0)rr1rrr�help_pdb�szPdb.help_pdbcCs�tj�|�rtj�|�r|Stj�tjd|�}tj�|�rP|�|�|jkrP|Stj�|�\}}|dkrp|d}tj�|�r�|StjD]>}tj�	|�r�t�
|�}q�tj�||�}tj�|�r�|Sq�dS)z�Helper function for break/clear parsing -- may be overridden.

        lookupmodule() translates (possibly incomplete) file or module name
        into an absolute file name.
        rr6r�N)rIrJ�isabs�existsr�r<rprA�splitext�islink�readlink)r2rrf�rootZext�dirname�fullnamerrrr��s"

zPdb.lookupmodulec	Csrd|_d|_ddl}|�|�\}}}|�|j�|_ddl}|j�	�|j�
d|j|j|j|t
d��|�|�dS)NTFr�__main__)r�__file__�__package__�
__loader__�__spec__�__builtins__)rBr"�runpyZ_get_module_detailsrprqrArb�__dict__r_�update�parent�loaderrgr	)r2Zmodule_namerhZmod_nameZmod_specr,rbrrr�
_runmodule�s 
�zPdb._runmodulec	Cstddl}|j��|j�d|td��d|_|�|�|_d|_t	�
|��}d|��|jf}W5QRX|�|�dS)Nrrb)rrcrgTFzexec(compile(%r, %r, 'exec')))
rbrir_rjrgrBrprAr"�io�	open_code�readr	)r2rrbr�	statementrrr�
_runscript
s
�
�zPdb._runscript)r4NNNFT)r)N)rN)wrrrr�r9rYrZr[rhrerortrsr{r�ryr�rnr�r�r�rlr�rVr�r�r�r�r�Zcomplete_commandsr�r�Zdo_bZcomplete_breakZ
complete_br�Zcomplete_tbreakr�r�r�Zcomplete_enabler�Zcomplete_disablerZcomplete_conditionrZcomplete_ignorerZdo_clZcomplete_clearZcomplete_clr
Zdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ
do_restartrZdo_rrZdo_cZdo_contrZdo_jr!Zcomplete_debugr$Zdo_qZdo_exitr%r.Zdo_ar/Zdo_rvr0r�r1r3Zcomplete_printZ
complete_pZcomplete_ppr;Zdo_lr<Zdo_llr>Zcomplete_sourcer8rGZcomplete_whatisrJZcomplete_displayrKrLrNrPrQrSr�r	�line_prefixrxrUZdo_hrXrYr�rmrrrrrrr�s��
/	


M
]!!.	
		1
!	#	��whereZdownZup�breakZtbreakr_r�r�rZ	conditionrM�stepr�ZuntilZjump�returnZretval�continuer)Zlonglistr�r ZppZwhatis�sourceZdisplayZ	undisplayrMr�Zunalias�debug�quitr�z

cCst��|||�dSr0)rr	�rqr�r�rrrr	<scCst��|||�Sr0)rr)Z
expressionr�r�rrrr?scCst|||�dSr0)r	r|rrrr
BscOst�j||�Sr0)rr)r��kwdsrrrrFs)�headercCs,t�}|dk	r|�|�|�t��j�dSr0)rrVrr<�	_getframe�f_back)r~�pdbrrrrIs
cCsB|dkrt��d}|dkr$td��t�}|��|�d|�dS)Nr�zAA valid traceback must be passed if no exception is being handled)r<r�r�rrZrn)�tr rrrrQscCsttj�dSr0)rr<�last_tracebackrrrrr
_szimport x; x.main()cCstt�dSr0)r	�TESTCMDrrrr�testgsr�cCsddl}|�t�dSr()�pydocZpagerr)r�rrrrksausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...

Debug the Python program given by pyfile. Alternatively,
an executable module or package to debug can be specified using
the -m switch.

Initial commands are read from .pdbrc files in your home directory
and in the current directory, if they exist.  Commands supplied with
-c are executed after commands from .pdbrc files.

To let the script run until an exception occurs, use "-c continue".
To let the script run up to a given line X in the debugged file, use
"-c 'until X'".c

Csddl}|�tjdd�dddg�\}}|s>tt�t�d�g}d}|D]B\}}|dkrltt�t��qJ|d	kr�|�|�qJ|d
krJd}qJ|d}|s�tj�	|�s�td|d
�t�d�|tjdd�<|s�tj�
|�}tj�|�tjd<t�}|j
�|�z6|�r|�|�n
|�|�|j�r*W�qtd�Wq�tk
�rrtd|d�tdd�tjdd���Yq�tk
�r�tddd�tt��d�Yq�tk
�r�t��t�d�Yq�t��td�td�t��d}	|�d|	�td|d�Yq�Xq�dS)Nrrzmhc:rzcommand=r�F)z-hz--help)z-cz	--command)z-mTzError:zdoes not existz*The program finished and will be restartedZ
Restartingzwith arguments:rAr�z/The program exited via sys.exit(). Exit status:)r�z2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)�getoptr<rr��_usage�exitr�rIrJr[�realpathr`rrHrLrmrrr"rr��
SystemExitr��SyntaxErrorr~�	print_excrn)
r�Zoptsr�rMZ
run_as_module�optZoptargrAr�r�rrr�main~sd 



 �r�rb)NN)NN)N)/rrIrnrr<r:r7r*r,r�r2r�r"rr~r�r�r�__all__r!r'r.r�r/rsr8r;rZ_help_orderZ_commandrvrkrXr	rr
rrrr
r�r�rr�r�rr�rrrr�<module>s�C�
		*
� 


D
sre_compile.cpython-38.opt-1.pyc000064400000035106151450073350012444 0ustar00U

e5dGh�@sdZddlZddlZddlTeehZeee	hZ
eehZ
eehZeeehBZdZdd�eD�Zejfdd�Zd	d
�Zdd�Zd,d
d�ZejdZde>dZdZeefdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&d d!�Z'd"d#�Z(d$d%�Z)d&d'�Z*d(d)�Z+d-d*d+�Z,dS).zInternal support module for sre�N)�*))�ii1)�si)�i�)iEi�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)iai�)i�i�cs.i|]&}|D]��t�fdd�|D���qqS)c3s|]}�|kr|VqdS�N�)�.0�j��ir�#/usr/lib64/python3.8/sre_compile.py�	<genexpr>>sz<dictcomp>.<genexpr>)�tuple)r�trr
r�
<dictcomp>>s
�rcCs ||@r||M}||B|@Srr)�flags�	add_flags�	del_flags�
TYPE_FLAGSrrr�_combine_flagsAs
rcCs�|j}t}t}t}t}t}d}	d}
d}|t@r\|t@s\|t@rPt	j
}	t	j}
t}nt	j
}	t	j}
|D�]|\}}
||k�rr|t@s�||�||
�n�|t@r�|t|�||
�n�|	|
�s�||�||
�n�|
|
�}|s�|t|�||�n�||k�r|t|�||�nh|t�||�}|d�|tk�r2|t�|f||D]}|t�||��q@|t�||�|||<q`|tk�rt|
|	|
|�\}}|t@�r�|t@�r�|t�n(|�s�|t�n|�s�|t�n|t�||�}|d�t|||�||�|||<q`|tk�r*|t@�r |t�n|t�q`||k�r6|t@�rLt d|f��t!|
d��r�|t"k�rn|t#�n|t$�||�}|d�||
d�||
d�t%||
d|�|t&�||�|||<nl|t'�||�}|d�||
d�||
d�t%||
d|�||�|||<|t"k�r,|t(�n|t)�q`|t*k�r�|
\}}}}|�rj|t+�||dd�t%||t,|||��|�r�|t+�||ddd�q`||k�r�||�q`||k�rD||�||�}|d�|
ddk�r�|d�n*|
d�-�\}}||k�rt d��||�t%||
d|�|t&�||�|||<q`|t.k�r�||�||�}|d�t%||
|�|t&�||�|||<q`|t/k�r�||�|t0@�r�t1�2|
|
�}
|t@�r�t3�2|
|
�}
n|t@�r�t4�2|
|
�}
||
�q`|t5k�r�||�g}|j}|
dD]N}
||�}|d�t%||
|�|t6�|||��|d�||�|||<�q|t�|D]}||�|||<�qlq`|t7k�r�||�|t@�r�t8|
}
n|t@�r�t9|
}
||
�q`|t:k�r |t@�s�||�n,|t@�r�|t;�n|�s
|t<�n|t=�||
d�q`|t>k�r�||�||
dd�||�}|d�t%||
d|�|
d�r�|t6�||�}|d�||�|d||<t%||
d|�||�|||<n||�|d||<q`t d|f��q`dS)Nrz*internal: unsupported template operator %r��z(look-behind requires fixed-width patternz%internal: unsupported operand type %r)?�append�len�_LITERAL_CODES�_REPEATING_CODES�_SUCCESS_CODES�
_ASSERT_CODES�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_UNICODE�_sre�unicode_iscased�unicode_tolower�_ignorecase_fixes�
ascii_iscased�
ascii_tolower�OP_LOCALE_IGNORE�	OP_IGNORE�OP_UNICODE_IGNORE�
IN_UNI_IGNORE�NOT_LITERAL�NEGATE�LITERAL�FAILURE�IN�_optimize_charset�
IN_LOC_IGNORE�	IN_IGNORE�_compile_charset�ANY�SRE_FLAG_DOTALL�ANY_ALL�SRE_FLAG_TEMPLATE�error�_simple�
MAX_REPEAT�
REPEAT_ONE�MIN_REPEAT_ONE�_compile�SUCCESS�REPEAT�	MAX_UNTIL�	MIN_UNTIL�
SUBPATTERN�MARKr�getwidth�CALL�AT�SRE_FLAG_MULTILINE�AT_MULTILINE�get�	AT_LOCALE�
AT_UNICODE�BRANCH�JUMP�CATEGORY�	CH_LOCALE�
CH_UNICODE�GROUPREF�GROUPREF_LOC_IGNORE�GROUPREF_IGNORE�GROUPREF_UNI_IGNORE�GROUPREF_EXISTS)�code�patternr�emit�_len�
LITERAL_CODES�REPEATING_CODES�
SUCCESS_CODES�ASSERT_CODES�iscased�tolower�fixes�op�av�lo�skip�k�charset�hascased�grouprr�p�hi�tail�
tailappend�skipyes�skipnorrrr=GsV
















































r=cCs�|j}|D]�\}}||�|tkr$q
|tkr6||�q
|tksF|tkr`||d�||d�q
|tkrt|�|�q
|tkr�|�|�q
|tkr�|t	@r�|t
|�q�|t@r�|t|�q�||�q
t
d|f��q
|t�dS)Nrrz%internal: unsupported set operator %r)rr,r-�RANGE�RANGE_UNI_IGNORE�CHARSET�extend�
BIGCHARSETrNrrOr rPr8r.)rfrrVrXrarbrrrr3�s,

r3c	Cs�g}g}td�}d}|D�]�\}}	�z,|tkr�|rv||	�}
d||
<|rd|
|krd||
D]}d||<qV|s~||	�r~d}nd||	<n�|tk�r&t|	d|	dd�}|�r|r�t||�D]*}
d||
<|
|kr�||
D]}d||<q�q�nt||�D]}
d||
<q�|�s$tt||��}n|D]}
d||
<�qn(|tk�r@|�||	f�n|�||	f�WnZtk
�r�t	|�dk�r�|dd7}Yq"|�r�d}|tk�r�t
}|�||	f�YnXqq"qg}d}|�d|�}|dk�rԐq(t	|�dk�r�d}�q(|�d|�}|dk�r|�|t	|�f��q(|�||f��q�|dk	�r�|D]>\}}||dk�r\|�t|f�n|�t||dff��q6||7}|�s�t	|�t	|�k�r�||fS||fSt	|�dk�r�t|�}|�t
|f�||7}||fSt|�}i}td�}d}t�}tdd	d�D]V}
||
|
d�}||k�r4||||
d<n$|||
d<||<|d7}||7}�qt|�}|gt|�|dd�<|�t|f�||7}||fS)
N�FrTr�i�ri)�	bytearrayr-ro�range�map�anyr,r�
IndexErrorrrp�find�
_mk_bitmaprq�bytes�_bytes_to_codesrs)rfr^�fixupr`�outrk�charmaprgrarbrcre�rr�runs�qri�data�comps�mapping�block�chunkrrrr0s�









r0�rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|�t�ddd�����fdd�tt��d��D�S)N���cs"g|]}��|�|�d��qS)rr)rr��	_CODEBITS�_int�srr�
<listcomp>�s�z_mk_bitmap.<locals>.<listcomp>r)�	translate�_BITS_TRANSrwr)�bitsr�r�rr�rr|�s�r|cCst|��d�}|��S)N�I)�
memoryview�cast�tolist)�b�arrrr~�sr~cCsDt|�dkrdS|d\}}|tkr<|ddko:t|d�S|tkS)NrFrr�)rrBr9�_UNIT_CODES)rirarbrrrr9�sr9cCsndgt|�}tdt|��D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)aj
    Generate an overlap table for the following prefix.
    An overlap table is a table of the same size as the prefix which
    informs about the potential self-overlap for each index in the prefix:
    - if overlap[i] == 0, prefix[i:] can't overlap prefix[0:...]
    - if overlap[i] == k with 0 < k <= i, prefix[i-k+1:i+1] overlaps with
      prefix[0:k]
    rr)rrw)�prefix�tabler�idxrrr�_generate_overlap_table�s	r�cCs$|t@sdS|t@rtjStjSdSr)rr r!r"r%)rrrr�_get_iscased�s
r�cCs�g}|j}d}t|�}|jD]�\}}|tkrF|r<||�r<q�||�q|tkr�|\}}	}
}t||	|
�}|t@rz|t@rzq�t||�\}
}}|dkr�|dk	r�t	|�}n|dk	r�t	|�|}|�
|
�|s�q�qq�q||dfS||dfS)NTF)rr�r�r-rBrrr�_get_literal_prefixrrr)rWrr��prefixappend�prefix_skipr^rarbrhrrri�flags1�prefix1�prefix_skip1�got_allrrrr��s4



r�cCsd|js
dS|jd\}}|tk	r"qP|\}}}}t|||�}|t@r|t@rdSqt|�}|tkrz|rp||�rpdS||fgS|tkr�g}|j}	|dD]B}
|
s�dS|
d\}}|tkr�|r�||�s�|	||f�q�dSq�|S|t	k�r`|}|�r\|D]f\}}|tk�r||��rZdSq�|t
kr�|ddk�r4dStt|t
|d|dd���r�dSq�|SdS)Nrri��)r�rBrrrr�r-rLrr/roryrxrw)rWrrarbrhrrr^rf�
charsetappendrirrr�_get_charset_prefix�sN



 r�c
Csr|��\}}|tkrt}|dkr8|�tdd||g�dSg}d}g}|t@rT|t@srt||�\}}}|srt||�}|j}	|	t�t	|�}
|	d�d}|r�t
}|dkr�|r�|tB}n|r�|tB}|	|�|tkr�|	|�n|	t�|dt�}|	t
|t��|�r@|	t	|��|dk�rt	|�}|	|�|�|�|�t|��n|�r^t|�\}}t|||�t	|�|
||
<dS)Nr�)rD�MAXCODErr�INFOrrr�r�rr�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSET�minr�r0r3)
rVrWrrcrjr�r�rfr�rXrd�maskrgrrr�
_compile_infosR




r�cCst|ttf�Sr)�
isinstance�strr})�objrrr�isstringSsr�cCs8|jj|B}g}t|||�t||j|�|�t�|Sr)�staterr�r=r�rr>)rirrVrrr�_codeVs
r�cCsdd�dd�|D��S)N�[%s]�, css$|]}dtjdd|fVqdS)z%#0*xrN)r!�CODESIZE�r�xrrrr
fsz_hex_code.<locals>.<genexpr>)�join�rVrrr�	_hex_codeesr�csNddl�t��d�ttt��d���������fdd���dt���dS)Nrrc	s�dd�����fdd�
}��fdd�}�d7��}||k�r�|��|}|d7}t|}|tttttttfkrx||�q2|tt	t
ttt
ttfkr��|}|d7}||d|t|�f�q2|tkr�|}|d7}tt|�}|||dd��q2|tk�r*�|}|d7}tt|�}|||d	d��q2|ttttfk�rr�|}|||||d��|d||�||7}q2|ttfk�r��||d
�\}}	|d
7}||d||	t|�t|	�f�q2|tk�r�||t�||dt���|dt7}q2|tk�r��|}|d7}t d
�!�fdd��||dt"j#�D���}
||||
�|dt"j#7}�d7�t$|�D].}|t�||dt���|dt7}�qd�d8�q2|t%t&t't(t)fk�rΈ|}|d7}|||�q2|t*k�r��|}|||||d�|d7}q2|t+k�r|�|}|||||d�|�rr�|d||�||7}|��|}|�rf|d|||d�n|t��q |d7}q2|t,t-t.fk�r�||d�\}}}
|
t/k�r�d}
|||||
||d��|d||�||7}q2|t0k�r�||d
�\}}||||||d�|d
7}q2|t1t2fk�rp�||d
�\}}||||||d��|d
||�||7}q2|t3k�r��||d�\}}}}
|
t/k�r�d}
|||t4|�||
||d�|d�|t5@�r^�|d|d�\}}|d|�|d����|�}|ddd�!dd�|D��dd�!t6t|����|7�|d���|���|7�|t7@�r��d7�|d���||��d8�||7}q2t8|��q2�d8�dS)N)�tocsX|dk	r"��|�|d|ff7}td����kr6dndfd�dd�t|�dS)Nz(to %d)z%*d%s �:�.z  r��end)�add�print)r��args)�labels�level�offset_width�startrr�print_ps

�z!dis.<locals>.dis_.<locals>.print_cs"td�d�d�t|�dS)N� rr�)r�)r�)r�r�rr�print_2xsz"dis.<locals>.dis_.<locals>.print_2rz
%#02x (%r)��	rz%#02x %#02x (%r-%r)rt�c3s|]}|�tj�j�VqdSr)�to_bytesr!r��	byteorderr�)�sysrrr
�s�z$dis.<locals>.dis_.<locals>.<genexpr>�branch�	MAXREPEATr��z
  prefix_skipz  prefixr�r�css|]}d|VqdS)z%#02xNrr�rrrr
�sz(%r)�z	  overlap�in)9�OPCODESr>r.r4r6r@rAr,r-r+�LITERAL_IGNORE�NOT_LITERAL_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�chrrFr��ATCODESrN�CHCODESr/r2r*r1rorprqr�r�rs�listr�r!r�rwrCrQrSrTrRrMrLr?r;r<r�rU�ASSERT�
ASSERT_NOTr��binr�rxr��
ValueError)r�r�r�r�rra�argrdrcrjr�r	r��maxr�
prefix_lenr�r��rV�dis_r�r�r�r�)r�rr�os�

�
�

 

�


�












�


zdis.<locals>.dis_)r��setrr�r�rr�r�dishsr�c	Cs�t|�r|}t�||�}nd}t||�}|t@r>t�t|�|jj}dg|jj	}|�
�D]\}}|||<q\t�|||jj
B||jj	d|t|��S)Nr)r��	sre_parse�parser��SRE_FLAG_DEBUGr�r�r��	groupdict�groups�itemsr!�compilerr)rirrWrV�
groupindex�
indexgrouprerrrrr��s(



�r�)NNN)r)-�__doc__r!r��
sre_constantsr-r+rr?�
MIN_REPEATr:rr>r.rr�r�rr4r/r��
_equivalencesr$rrr=r3r0r�r�r�r��intr|r~r9r�r�r�r�r�r�r�r�r�r�rrrr�<module>sH
$��
3

	,;queue.cpython-38.pyc000064400000024604151450073350010331 0ustar00U

e5d\,�@sdZddlZddlmZddlmZmZddlmZzddl	m
Z
Wnek
r\dZ
YnXddd	d
ddgZzdd
l	m
Z
Wn$ek
r�Gdd�de�Z
YnXGdd�de�ZGdd	�d	�ZGdd
�d
e�ZGdd�de�ZGdd�d�Ze
dkr�eZ
dS)z'A multi-producer, multi-consumer queue.�N)�deque)�heappush�heappop)�	monotonic)�SimpleQueue�Empty�Full�Queue�
PriorityQueue�	LifoQueuer)rc@seZdZdZdS)rz4Exception raised by Queue.get(block=0)/get_nowait().N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/queue.pyrsc@seZdZdZdS)rz4Exception raised by Queue.put(block=0)/put_nowait().Nrrrrrrsc@s�eZdZdZd!dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	d"dd�Z
d#dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �ZdS)$r	zjCreate a queue object with a given maximum size.

    If maxsize is <= 0, the queue size is infinite.
    rcCsN||_|�|�t��|_t�|j�|_t�|j�|_t�|j�|_d|_	dS�Nr)
�maxsize�_init�	threadingZLock�mutexZ	Condition�	not_empty�not_full�all_tasks_done�unfinished_tasks��selfrrrr�__init__!s

zQueue.__init__c	CsH|j�8|jd}|dkr4|dkr*td��|j��||_W5QRXdS)a.Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.
        �rz!task_done() called too many timesN)rr�
ValueErrorZ
notify_all)rZ
unfinishedrrr�	task_done8s

zQueue.task_donec	Cs(|j�|jr|j��qW5QRXdS)a�Blocks until all items in the Queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer thread calls task_done()
        to indicate the item was retrieved and all work on it is complete.

        When the count of unfinished tasks drops to zero, join() unblocks.
        N)rr�wait�rrrr�joinNs	z
Queue.joinc
Cs&|j�|��W5QR�SQRXdS)�9Return the approximate size of the queue (not reliable!).N�r�_qsizer#rrr�qsize[szQueue.qsizec
Cs(|j�|��W5QR�SQRXdS)a�Return True if the queue is empty, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() == 0
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can grow before the result of empty() or
        qsize() can be used.

        To create code that needs to wait for all queued tasks to be
        completed, the preferred technique is to use the join() method.
        Nr&r#rrr�empty`szQueue.emptyc
Cs<|j�,d|jko |��knW5QR�SQRXdS)aOReturn True if the queue is full, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() >= n
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can shrink before the result of full() or
        qsize() can be used.
        rN)rrr'r#rrr�fullnsz
Queue.fullTNc	Cs�|j��|jdkr�|s*|��|jkr�t�nr|dkrN|��|jkr�|j��q2nN|dkr`td��n<t�|}|��|jkr�|t�}|dkr�t�|j�|�qj|�|�|jd7_|j	�
�W5QRXdS)aPut an item into the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until a free slot is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Full exception if no free slot was available within that time.
        Otherwise ('block' is false), put an item on the queue if a free slot
        is immediately available, else raise the Full exception ('timeout'
        is ignored in that case).
        rN�''timeout' must be a non-negative number�r)rrr'rr"r �time�_putrr�notify)r�item�block�timeout�endtime�	remainingrrr�putys&




z	Queue.putc
Cs�|j��|s|��s�t�nf|dkr8|��s�|j��q"nH|dkrJtd��n6t�|}|��s�|t�}|dkrrt�|j�|�qT|��}|j��|W5QR�SQRXdS)�Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        Nrr+r,)	rr'rr"r r-�_getrr/)rr1r2r3r4r0rrr�get�s$



z	Queue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.
        F�r1�r5�rr0rrr�
put_nowait�szQueue.put_nowaitcCs|jdd�S�z�Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        Fr9�r8r#rrr�
get_nowait�szQueue.get_nowaitcCst�|_dS�N)r�queuerrrrr�szQueue._initcCs
t|j�Sr@��lenrAr#rrrr'�szQueue._qsizecCs|j�|�dSr@�rA�appendr;rrrr.�sz
Queue._putcCs
|j��Sr@)rA�popleftr#rrrr7�sz
Queue._get)r)TN)TN)r
rrrrr!r$r(r)r*r5r8r<r?rr'r.r7rrrrr	s


 

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r
z�Variant of Queue that retrieves open entries in priority order (lowest first).

    Entries are typically tuples of the form:  (priority number, data).
    cCs
g|_dSr@�rArrrrr�szPriorityQueue._initcCs
t|j�Sr@rBr#rrrr'�szPriorityQueue._qsizecCst|j|�dSr@)rrAr;rrrr.�szPriorityQueue._putcCs
t|j�Sr@)rrAr#rrrr7�szPriorityQueue._getN�r
rrrrr'r.r7rrrrr
�s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBVariant of Queue that retrieves most recently added entries first.cCs
g|_dSr@rGrrrrr�szLifoQueue._initcCs
t|j�Sr@rBr#rrrr'�szLifoQueue._qsizecCs|j�|�dSr@rDr;rrrr.�szLifoQueue._putcCs
|j��Sr@)rA�popr#rrrr7�szLifoQueue._getNrHrrrrr�s
c@sLeZdZdZdd�Zddd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�_PySimpleQueuezYSimple, unbounded FIFO queue.

    This pure Python implementation is not reentrant.
    cCst�|_t�d�|_dSr)r�_queuerZ	Semaphore�_countr#rrrr	sz_PySimpleQueue.__init__TNcCs|j�|�|j��dS)z�Put the item on the queue.

        The optional 'block' and 'timeout' arguments are ignored, as this method
        never blocks.  They are provided for compatibility with the Queue class.
        N)rKrErL�release)rr0r1r2rrrr5
sz_PySimpleQueue.putcCs4|dk	r|dkrtd��|j�||�s*t�|j��S)r6Nrr+)r rL�acquirerrKrF)rr1r2rrrr8s
z_PySimpleQueue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        This is exactly equivalent to `put(item)` and is only provided
        for compatibility with the Queue class.
        Fr9r:r;rrrr<'sz_PySimpleQueue.put_nowaitcCs|jdd�Sr=r>r#rrrr?/sz_PySimpleQueue.get_nowaitcCst|j�dkS)zCReturn True if the queue is empty, False otherwise (not reliable!).r�rCrKr#rrrr)7sz_PySimpleQueue.emptycCs
t|j�S)r%rOr#rrrr(;sz_PySimpleQueue.qsize)TN)TN)r
rrrrr5r8r<r?r)r(rrrrrJ�s	
	
rJ)rr�collectionsr�heapqrrr-rrKr�ImportError�__all__r�	Exceptionrr	r
rrJrrrr�<module>s*
BA_strptime.cpython-38.pyc000064400000037256151450073350011222 0ustar00U

e5d�b�@s�dZddlZddlZddlZddlmZddlmZddlmZ	ddl
mZm
ZmZddlmZgZdd	�ZGd
d�de�ZGdd
�d
e�Ze�Ze�adZiadd�Zdd�Zddd�Z ddd�Z!ddd�Z"dS)a�Strptime-related classes and functions.

CLASSES:
    LocaleTime -- Discovers and stores locale-specific time information
    TimeRE -- Creates regexes for pattern matching a string of text containing
                time information

FUNCTIONS:
    _getlang -- Figure out what language is being used for the locale
    strptime -- Calculates the time struct represented by the passed-in string

�N)�compile)�
IGNORECASE)�escape)�date�	timedelta�timezone)�
allocate_lockcCst�tj�S�N)�localeZ	getlocale�LC_TIME�rr�!/usr/lib64/python3.8/_strptime.py�_getlangsrc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
LocaleTimeakStores and handles locale-specific information related to time.

    ATTRIBUTES:
        f_weekday -- full weekday names (7-item list)
        a_weekday -- abbreviated weekday names (7-item list)
        f_month -- full month names (13-item list; dummy value in [0], which
                    is added by code)
        a_month -- abbreviated month names (13-item list, dummy value in
                    [0], which is added by code)
        am_pm -- AM/PM representation (2-item list)
        LC_date_time -- format string for date/time representation (string)
        LC_date -- format string for date representation (string)
        LC_time -- format string for time representation (string)
        timezone -- daylight- and non-daylight-savings timezone representation
                    (2-item list of sets)
        lang -- Language used by instance (2-item tuple)
    cCsht�|_|��|��|��|��|��t�|jkrDtd��tj	|j	ks\tj
|j
krdtd��dS)a�Set all attributes.

        Order of methods called matters for dependency reasons.

        The locale language is set at the offset and then checked again before
        exiting.  This is to make sure that the attributes were not set with a
        mix of information from more than one locale.  This would most likely
        happen when using threads where one thread calls a locale-dependent
        function while another thread changes the locale while the function in
        the other thread is still running.  Proper coding would call for
        locks to prevent changing the locale while locale-dependent code is
        running.  The check here is done in case someone does not think about
        doing this.

        Only other possible issue is if someone changed the timezone and did
        not call tz.tzset .  That is an issue for the programmer, though,
        since changing the timezone is worthless without that call.

        z$locale changed during initializationz&timezone changed during initializationN)r�lang�_LocaleTime__calc_weekday�_LocaleTime__calc_month�_LocaleTime__calc_am_pm�_LocaleTime__calc_timezone�_LocaleTime__calc_date_time�
ValueError�time�tzname�daylight)�selfrrr
�__init__1szLocaleTime.__init__cCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)�calendarZday_abbr�lower��.0�irrr
�
<listcomp>Ssz-LocaleTime.__calc_weekday.<locals>.<listcomp>�cSsg|]}tj|���qSr)rZday_namerrrrr
r!Ts)�range�	a_weekday�	f_weekday)rr$r%rrr
Z__calc_weekdayPszLocaleTime.__calc_weekdaycCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)rZ
month_abbrrrrrr
r!Zsz+LocaleTime.__calc_month.<locals>.<listcomp>�
cSsg|]}tj|���qSr)rZ
month_namerrrrr
r![s)r#�a_month�f_month)rr'r(rrr
Z__calc_monthXszLocaleTime.__calc_monthcCsJg}dD]6}t�ddd|ddddd	f	�}|�t�d
|����q||_dS)N)�������,�7��Lr�%p)r�struct_time�append�strftimer�am_pm)rr6�hour�
time_tuplerrr
Z__calc_am_pm_s
zLocaleTime.__calc_am_pmc
CsJt�d�}dddg}t�d|���|d<t�d|���|d<t�d|���|d<d|jdd	f|jd
df|jddf|jd
d
f|jddfdddddddddddg}|�	dd�|j
D��dD]d\}}||}|D]\}}|r�|�||�}q�t�d�}dt�||�k�rd}	nd }	|�d!|	�||<q�|d|_|d|_
|d|_dS)"N)	r+r,r-r*r.r/r0r1r�%cr�%xr)�%Xr0)�%z%%z%Ar,z%Bz%az%br2)Z1999z%Y)Z99z%y)Z22z%H)Z44z%M)Z55z%S)Z76z%j)Z17z%d)Z03�%m)�3r=)�2z%w)Z10z%IcSsg|]}|D]}|df�qqS)z%Zr)r�	tz_values�tzrrr
r!�s�z/LocaleTime.__calc_date_time.<locals>.<listcomp>))rr9)r)r:)r0r;)	r+r)r,r)r)r)�r,rZ00z%Wz%UZ11)rr3r5rr%r(r$r'r6�extendr�replace�LC_date_time�LC_date�LC_time)
rr8Z	date_timeZreplacement_pairs�offset�	directiveZcurrent_format�old�newZU_Wrrr
Z__calc_date_timeksH

�


zLocaleTime.__calc_date_timecCszzt��Wntk
r YnXtj|_tj|_tdd|jd��h�}|jrft|jd��h�}nt�}||f|_dS)N�utc�gmtrr))r�tzset�AttributeErrorrr�	frozensetrr)rZ	no_savingZ
has_savingrrr
Z__calc_timezone�szLocaleTime.__calc_timezoneN)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrr
rs-rcs:eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Z�ZS)�TimeREz4Handle conversion from format directives to regexes.Ncs|r||_nt�|_t�}|�ddddddddd	d
ddd
ddd|�|jjd�|�|jjd�|�|jjdd�d�|�|jjdd�d�|�|jj	d�|�dd�|jj
D�d�dd��|�d|�d��
dd��|�d|�|jj��|�d |�|jj��|�d!|�|jj��dS)"z^Create keys/values.

        Order of execution is important for dependency reasons.

        z)(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])z(?P<f>[0-9]{1,6})z(?P<H>2[0-3]|[0-1]\d|\d)z(?P<I>1[0-2]|0[1-9]|[1-9])z(?P<G>\d\d\d\d)zG(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])z(?P<m>1[0-2]|0[1-9]|[1-9])z(?P<M>[0-5]\d|\d)z(?P<S>6[0-1]|[0-5]\d|\d)z(?P<U>5[0-3]|[0-4]\d|\d)z(?P<w>[0-6])z(?P<u>[1-7])z(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)z(?P<y>\d\d)z(?P<Y>\d\d\d\d)z2(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)�A�ar)N�B�b�pcss|]}|D]
}|Vq
qdSr	r)rZtz_namesrArrr
�	<genexpr>�s�z"TimeRE.__init__.<locals>.<genexpr>�Zr<)�d�f�H�I�G�j�m�M�S�U�w�u�V�y�Y�zrVrWrXrYrZr\r<�Wrf�c�x�X)�locale_timer�superr�_TimeRE__seqToREr%r$r(r'r6r�__setitem__�__getitem__rD�patternrErFrG)rrq�base��	__class__rr
r�sF��zTimeRE.__init__cCsPt|tdd�}|D]}|dkrq(qdSd�dd�|D��}d||f}d|S)	aeConvert a list to a regex string for matching a directive.

        Want possible matching values to be from longest to shortest.  This
        prevents the possibility of a match occurring for a value that also
        a substring of a larger value that should have matched (e.g., 'abc'
        matching when 'abcdef' should have been the match).

        T)�key�reverse��|css|]}t|�VqdSr	)�	re_escape)rZstuffrrr
r[�sz#TimeRE.__seqToRE.<locals>.<genexpr>z	(?P<%s>%sz%s))�sorted�len�join)rZ
to_convertrI�valueZregexrrr
Z	__seqToRE�s	zTimeRE.__seqToREcCs�d}td�}|�d|�}td�}|�d|�}d|krv|�d�d}d||d	|d�|||f}||dd	�}q,d
||fS)z�Return regex pattern for the format string.

        Need to make sure that any characters that might be interpreted as
        regex syntax are escaped.

        r|z([\\.^$*+?\(\){}\[\]|])z\\\1z\s+z\\s+r<r)z%s%s%sNz%s%s)�
re_compile�sub�index)r�formatZprocessed_formatZregex_charsZwhitespace_replacementZdirective_indexrrr
rv�s
�zTimeRE.patterncCst|�|�t�S)z2Return a compiled re object for the format string.)r�rvr)rr�rrr
rszTimeRE.compile)N)	rQrRrSrTrrsrvr�
__classcell__rrrxr
rU�s
.rU�cCslt|dd���}|s,|dd}|dd}d|d}|dkrLd||S|d|d}d||SdS)z�Calculate the Julian day based on the year, week of the year, and day of
    the week, with week_start_day representing whether the week of the year
    assumes the week starts on Sunday or Monday (6 or 0).r)r"rN)�
datetime_date�weekday)�year�week_of_yearZday_of_week�week_starts_MonZ
first_weekdayZ
week_0_lengthZdays_to_weekrrr
�_calc_julian_from_U_or_Wsr�cCsdt|dd���d}|d||}|dkr\|t|dd���7}|d8}|t|dd���8}||fS)z�Calculate the Julian day based on the ISO 8601 year, week, and weekday.
    ISO weeks start on Mondays, with week 01 being the week containing 4 Jan.
    ISO week days range from 1 (Monday) to 7 (Sunday).
    r)�r,r")r�Z
isoweekday�	toordinal)�iso_year�iso_weekZiso_weekdayZ
correctionZordinalrrr
�_calc_julian_from_V%sr��%a %b %d %H:%M:%S %Yc,Cs.t||g�D]*\}}t|t�sd}t|�|t|����qt��tj}t	�|j
kshtj|jkshtj
|j
kr|t�at��tj}tt�tkr�t��t�|�}|�s&zt�|�}Wnntk
r�}z.|jd}|dkr�d}~td||f�d�W5d}~XYn$tk
�rtd|�d�YnX|t|<W5QRX|�|�}	|	�sPtd||f��t|�|	��k�rztd	||	��d���d}
}d
}}
d}}}}d}d}d}d}}d}d}}|	��}|��D�]d}|dk�rt|d�}|d
k�r�|d7}n|d7}�q�|dk�r t|d�}�q�|dk�r:t|d�}
�q�|dk�rTt|d�}�q�|dk�rv|j�|d� ��}�q�|dk�r�|j!�|d� ��}�q�|dk�r�t|d�}
�q�|dk�r�t|d�}�q�|dk�r<t|d�}|�dd�� �}|d|j"dfk�r|dk�r8d}n"||j"d
k�r.|dk�r.|d7}�q�|dk�rVt|d�}�q�|dk�rpt|d�}�q�|dk�r�|d}|ddt|�7}t|�}�q�|d k�r�|j#�|d � ��}�q�|d!k�r�|j$�|d!� ��}�q�|d"k�rt|d"�}|dk�rd}n|d
8}�q�|d#k�r:t|d#�}|d
8}�q�|d$k�rTt|d$�}�q�|d%k�r�t||�}|d&k�rzd}nd}�q�|d'k�r�t|d'�}�q�|d(k�r�|d(}|d)k�r�d}n�|d*d+k�r.|dd*�|d,d�}t|�d-k�r.|d-d+k�rd.|d(��}t|��|dd-�|dd�}t|d
d*��}t|d*d-��} t|d-d/��p`d�}!|d0d0| d0|!}|d1d�}"ddt|"�}#t|"|#�}|�%d2��r.|}|}np|d)k�r�|d)� �}$t|j&�D]N\}%}&|$|&k�r�tjdtjd
k�r tj
�r |$d3k�r �q�n
|%}�qʐqސq�|dk�rv|
dk	�rv|dk�sZ|dk�rbtd4��|dk	�r�td5��n0|dk�r�|dk	�r�|dk�r�td6��ntd7��d8}'|dk�r�|d9k�r�|
d:k�r�d;}d<}'n|dk�r�d}|dk�r�|dk	�r�|dk	�r |dk�rd<nd8}(t'||||(�}n(|
dk	�rH|dk	�rHt(|
||d
�\}}|dk	�r�|dk�r�|d
8}t)�*|��rtd=nd>})||)7}|dk�r�t+|||
��,�t+|d
d
��,�d
}n0t+�-|d
t+|d
d
��,��}*|*j.}|*j/}|*j0}
|dk�r�t+|||
��1�}|�d)�}+|'�rd}|||
|||||||+|f||fS)?z�Return a 2-tuple consisting of a time struct and an int containing
    the number of microseconds based on the input string and the
    format string.z*strptime() argument {} must be str, not {}r�\r<z&'%s' is a bad directive in format '%s'Nzstray %% in format '%s'z%time data %r does not match format %rzunconverted data remains: %sr)���rj�Di�ilrkrarcrXrYr]r_r`rZr|�rdrer^�0rBrVrWrgrhrb)rfrmrfrirlr\r,�:r�r�zInconsistent use of : in r"�<��-)rLrMzzISO year directive '%G' must be used with the ISO week directive '%V' and a weekday directive ('%A', '%a', '%w', or '%u').z`Day of the year directive '%j' is not compatible with ISO year directive '%G'. Use '%Y' instead.zzISO week directive '%V' must be used with the ISO year directive '%G' and a weekday directive ('%A', '%a', '%w', or '%u').zdISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G' instead.Fr0�ipTinim)2�	enumerate�
isinstance�str�	TypeErrorr��type�_cache_lock�
_TimeRE_cacherqrrrrrrU�_regex_cache�clearr��_CACHE_MAX_SIZE�getr�KeyError�argsr�
IndexError�match�end�	groupdict�keys�intr(r�rr'r6r%r$�
startswithrr�r�rZisleapr�r�Zfromordinalr��month�dayr�),�data_stringr�r��arg�msgrqZformat_regex�errZ
bad_directive�foundr�r�r�r�r7Zminute�second�fractionrA�gmtoff�gmtoff_fractionr�r�Zweek_of_year_startr�ZjulianZ
found_dictZ	group_keyZampm�srlZhoursZminutes�secondsZgmtoff_remainderZgmtoff_remainder_paddingZ
found_zoner�r@Z
leap_year_fixr�ZydayZdatetime_resultrrrr
�	_strptime5s�

�
�

��
��




























��





�
����

��r�cCs"t||�d}t�|dtj��S)zIReturn a time struct based on the input string and the
    format string.rN)r�rr3�_STRUCT_TM_ITEMS)r�r��ttrrr
�_strptime_time/sr�cCspt||�\}}}|dd�\}}|dd�|f}|dk	rht||d�}	|rVt|	|�}
nt|	�}
||
f7}||�S)zPReturn a class cls instance based on the input string and the
    format string.���NrB)r�Zmicroseconds)r��datetime_timedelta�datetime_timezone)�clsr�r�r�r�r�rr�r�ZtzdeltarArrr
�_strptime_datetime5s
r�)r�)r�)r�)#rTrr
r�rerr�rrr~Zdatetimerr�rr�rr��_threadrZ_thread_allocate_lock�__all__r�objectr�dictrUr�r�r�r�r�r�r�r�r�rrrr
�<module>s.
_
{
locale.cpython-38.opt-2.pyc000064400000072574151450073350011415 0ustar00U

e5do1�M@s*ddlZddlZddlZddlZddlZddlmZddlZddddddd	d
ddd
ddddddddddddgZ	dd�Z
dd�ZzddlTWnLe
k
r�dZd Zd!ZdZd"Zd#Zd$Zd%ZeZd&d	�Z�d�d'd�ZYnXde�kr�eZd
e�kr�e
ZeZiZe�e�d(d	��Zd)d*�Z �d�d,d-�Z!d.d/�Z"e�#d0�Z$�d�d1d2�Z%�d�d3d�Z&�d�d4d�Z'�d�d6d�Z(d7d�Zd8d9�Z)e*fd:d
�Z+d;d�Z,d<d=�Z-eZ.d>d?�Z/d@dA�Z0dBd�Z1dCdD�Z2dEdF�Z3�d�dHd�Z4efdId�Z5�d�dJd�ZefdKd�Z6ej7�8dL��r�d�dMd�Z9nRze:Wn<e;k
�rLe<edN��r<�d�dOd�Z9n�d�dPd�Z9YnX�d�dQd�Z9dRdRdSdTdTdUdVdWdXdYdSdZd[d\dSdSdSd]d^d_d`d\dadZdbdcd[dddedfdgdTdhdidUdjdkdldmdndodWdXdYdp�,Z=e>e=�?��D]"\Z@ZAe@�Bdqdr�Z@e=�Ce@eA��q�dsdsdsdtdudvdwdwdxdydzdzd{d|d}d~d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d~d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dRd�dRdRd{d�dRdRd�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d{d�d{dRd{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d̐d�d�d�d�d�d�d�d�d�d�d�d�d�d	�d	�d
�dd��d�d
�d
�d
�d
�d
�d�d
�d�d�d�d�d�d�d�d�dd�d�d�d��d�d�d�dd͐d�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d��d�d�d �d �d �d!�d"�d#�d$�d%�d&�d&�d'�d(�d&�d&�d%�d%d{d�d{d�d{d�d)�d*�d)�d)�d+�d+�d+�d�d�d,�d-�d-�d-�d.�d.�d-�d-�d-�d-�d-�d/�d/�d/�d0�d/�d1�d2�d3�d3�d4�d5�d5�d6�d6�d6�d7�d6�d6�d8�d8�d9�d:�d;�d;�d<�d<�d=�d>�d?�d@�dA�dB�dC�dD�dD�dE�dE�dD�dB�dB�dF�dF�dG�dH�dI�dI�dJ�dK�dL�dM�dN�dN�dO�dP�dQ�dQ�dR�dR�dS�dT�dU�dU�dV�dV�dW�dW�dX�dYd�d��dZ�d[�d\�d]�d^�d_dǐd`d�dǐda�da�db�dc�db�db�db�db�dd�dd�de�de�dc�dc�da�df�df�dg�dh�di�di�dj�dk�dk�dl�dm�dn�do�dp�dq�dp�dr�dr�ds�ds�ds�dt�dudRdR�dv�dv�dw�dt�du�dt�dx�dy�dz�dz�dz�d{�d{�d|�dz�d}�d~�d~�d�d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��dddddÐdÐdĐdĐdŐdƐdǐdȐdȐdɐdɐdʐdːd�d��d͐d�d��dϐdϐdАdѐd�d�d��dҐdҐdӐ�LZD�dԐdՐd֐dאdؐdِdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�de�df�dg�dh�di�dj�dk�dl�dm�dl�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���ZE�d��d��ZFzeWne;k
�
r�YnXe	�G�d��eH�d�k�r&eI�d��eI�eF�eI�eI�d��eI�e-�dS(��N)�str�	getlocale�getdefaultlocale�getpreferredencoding�Error�	setlocale�resetlocale�
localeconv�strcoll�strxfrmr�atof�atoi�format�
format_string�currency�	normalize�LC_CTYPE�
LC_COLLATE�LC_TIME�LC_MONETARY�
LC_NUMERIC�LC_ALL�CHAR_MAXcCs||k||kS�N�)�a�brr�/usr/lib64/python3.8/locale.py�_strcoll!srcCs|Srr)�srrr�_strxfrm'sr )�*�������cCs,dgddddgddddddddddddd�S)Nr"��.)�grouping�currency_symbol�n_sign_posn�
p_cs_precedes�
n_cs_precedes�mon_grouping�n_sep_by_space�
decimal_point�
negative_sign�
positive_sign�p_sep_by_space�int_curr_symbol�p_sign_posn�
thousands_sep�mon_thousands_sep�frac_digits�mon_decimal_point�int_frac_digitsrrrrrr	?s&�cCs|dkrtd��dS)N)Nr)�Cz*_locale emulation only supports "C" localer=)r)�category�valuerrrrWscCst�}tr|�t�|Sr)�_localeconv�_override_localeconv�update)�drrrr	ls
ccsJd}|D]<}|tkrdS|dkr:|dkr2td��|Vq2|V|}qdS)Nrzinvalid grouping)r�
ValueError)r+Z
last_interval�intervalrrr�_grouping_intervalszsrFFc
Cs�t�}||rdpd}||r dp"d}|s2|dfS|ddkr\|��}|t|�d�}|}nd}d}g}t|�D]B}	|r�|dd	kr�|}d}q�|�||	d��|d|	�}qp|r�|�|�|��||�|�|t|�t|�d
fS)Nr9r8r0r+r���� r)�
0123456789r')r	�rstrip�lenrF�append�reverse�join)
r�monetary�convr8r+�strippedZright_spacesZleft_spaces�groupsrErrr�_group�s2
�rScCsdd}|r&||dkr&|d7}|d8}qt|�d}|rT||dkrT|d8}|d8}q2|||d�S)NrrHr')rK)rZamountZlposZrposrrr�_strip_padding�s

rTzG%(?:\((?P<key>.*?)\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]c	Gs�|r||f|}n||}|ddkr~d}|�d�}|rRt|d|d�\|d<}t�|r^dp`d}|�|�}|r�t||�}n2|ddkr�d}|r�t||d�\}}|r�t||�}|S)	NrGZeEfFgGrr*�rOr;r2Zdiu)�splitrSr	rNrT)	�percentr?r+rO�
additionalZ	formattedZseps�partsr2rrr�_format�s*
�

rZc
	Cs
tt�|��}t�d|�}t|tj�rjg}|D]8}|��ddkrN|�d�q.|�t	|��|||��q.n�t|t
�sz|f}g}d}|D]r}|��ddkr�|�d�q�|�d��d�}	|�t	|��||||f||d|d|	����|d|	7}q�t
|�}||S)Nz%srG�%rZ	modifiersr!r')�list�_percent_re�finditer�sub�
isinstance�_collections_abc�Mapping�grouprLrZ�tuple�count)
�f�valr+rOZpercentsZnew_fZnew_valZperc�iZ	starcountrrrr�s4
��cGs^ddl}|jdtdd�t�|�}|r:t|���t|�krJtdt|���t	||||f|��S)Nrz`This method will be removed in a future version of Python. Use 'locale.format_string()' instead.r()�
stacklevelzHformat() must be given exactly one %%char format specifier, %s not valid)
�warnings�warn�DeprecationWarningr]�matchrKrcrD�reprrZ)rWr?r+rOrXrjrmrrrr�s�
�TcCsft�}||rdpd}|dkr&td��td|t|�|dd�}d|d	}|r�||rXd
pZd}||dkrld
pnd}||dkr�dp�d}	|r�||	r�dp�d|}n||	r�dp�d|}||dkr�dp�d}
||dkr�dp�d}|
dkr�d|d}n`|
dk�r||}nL|
dk�r||}n8|
dk�r2|�d|�}n |
dk�rJ|�d	|�}n||}|�dd��d	d�S)Nr<r:r"z9Currency formatting is not possible using the 'C' locale.z%%.%ifTrU�<�>r6r,rr/r.r1r5rHr)r-r7r3r4�(�)r'r(r$r&)r	rDrZ�abs�replace)rgZsymbolr+Z
internationalrPZdigitsrZsmbZprecedesZ	separatedZsign_posZsignrrrrs6





cCs
td|�S)Nz%.12g)rZ)rgrrrr0scCs:t�}|d}|r|�|d�}|d}|r6|�|d�}|S)Nr8r)r2r*)r	rt)�stringrP�tsZddrrr�
delocalize4srwcCs|t|��Sr)rw)ru�funcrrrrDscCstt|��Sr)�intrw)rurrrr
HscCsBttd�tddd�}t|dt|��td�}t|dt|��dS)Nr)z%di�[r'�isg��Q�	@)rrr�printr
rr)�s1rrr�_testLs

r}cCs�d|kr|d|�d��}n|}t�|�}tjj�|��|�}|}|��}|tkr\t|}n(|�dd�}|�dd�}|tkr�t|}|d|S)Nr*�_r)�-)�index�	encodings�normalize_encoding�aliases�get�lower�locale_encoding_aliasrt)�code�encoding�langname�
norm_encodingrrr�_replace_encoding^s 
�
r�cCsR|dkrFd|kr|dS|�d�\}}}|dkr4|S|dkrFt|d�S|d|S)N�euror*z.ISO8859-15)�
ISO8859-15�UTF-8�	ISO8859-1r��@)�	partitionr�)r��modifierr~r�rrr�_append_modifierus
r�c	Cs�|��}d|kr|�dd�}d|kr6|�dd�\}}nd}d|krZ|�d�dd�\}}n|}d}|}|r�|�dd�}|�dd�}|d|7}|}|r�|d|7}t�|d�}|dk	r�|S|�rt�|d�}|dk	�rd|kr�t||�S|�dd�d��|k�r|S|�r�|}|�r"|d|7}t�|d�}|dk	�rnd|k�rLt||�S|�dd�\}}t||�d|S|�r�t�|d�}|dk	�r�d|k�r�t||�}t||�S|�dd�\}}|��|k�r�t||�d|S|S)	N�:r*r�r'r)r(rr~)r�rtrV�locale_aliasr�r�r�)	�
localenamer�r�r�r�Zlang_encr�Zlookup_nameZdefmodrrrr�s`








cCs~t|�}d|kr8|�dd�\}}|dkr8d|kr8|dfSd|krVt|�d�dd��S|dkrbdS|d	krnd
Std|��dS)Nr�r'r�r*�iso-8859-15r(r=)NNr��Nr�zunknown locale: %s)rrVrdrD)r�r�r�rrr�_parse_localename�sr�c	Cs\z4|\}}|dkrd}|dkr$|WS|d|WSWn"ttfk
rVtd�d�YnXdS)Nr=r*zXLocale must be None, a string, or an iterable of two strings -- language code, encoding.)�	TypeErrorrD)ZlocaletupleZlanguager�rrr�_build_localename�s�r��rrZLANG�LANGUAGEc	Cs�zddl}|��\}}Wnttfk
r0Yn8Xtjdkr`|r`|dd�dkr`t�t|d��}||fSddl	}|j
j}|D],}||d�}|r||dkr�|�d�d}q�q|d}t|�S)NrZwin32r(Z0xr�r�r=)
�_localeZ_getdefaultlocale�ImportError�AttributeError�sys�platform�windows_localer�ry�os�environrVr�)Zenvvarsr�r�r�r��lookupZvariabler�rrrr
s$
cCs(t|�}|tkr d|kr td��t|�S)N�;z category LC_ALL is not supported)�
_setlocalerr�r�)r>r�rrrr?s
cCs$|rt|t�stt|��}t||�Sr)r`�_builtin_strrr�r�)r>ZlocalerrrrQscCst|tt���dSr)r�r�r)r>rrrrbs�wincCstjjrdSddl}|�d�S)Nr�rF)r��flags�	utf8_mode�_bootlocaler)�do_setlocaler�rrrrnsZgetandroidapilevelcCsdSr�r)r�rrrr|scCs&tjjrdSt�d}|dkr"d}|S)Nr�r'�ascii)r�r�r�r)r��resrrrr�s
cCs`tjjrdSddl}|rDtt�}zttd�Wntk
rBYnX|�d�}|r\tt|�|S)Nr�rr)F)r�r�r�r�rrrr)r�r�Zoldloc�resultrrrr�s

r=r�ZJIS7ZeucJPzKOI8-CZCP1251ZCP1255ZCP1256z	ISO8859-2z	ISO8859-5r�z
ISO8859-10z
ISO8859-11z
ISO8859-13z
ISO8859-14z
ISO8859-16z	ISO8859-3z	ISO8859-4z	ISO8859-6z	ISO8859-7z	ISO8859-8z	ISO8859-9ZSJISZTACTISZeucKRr�zKOI8-RzKOI8-TzKOI8-UZRK1048),�437�c�enZjisZjis7ZajecZkoi8cZmicrosoftcp1251Zmicrosoftcp1255Zmicrosoftcp1256Z88591Z88592Z88595Z885915r��latin_1�	iso8859_1�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�
iso2022_jp�	shift_jis�tactis�euc_jp�euc_kr�utf_8�koi8_rZkoi8_tZkoi8_u�kz1048�cp1251�cp1255�cp1256r~r)zaz_AZ.KOI8-Czaa_DJ.ISO8859-1zaa_ER.UTF-8zaa_ET.UTF-8zaf_ZA.ISO8859-1zagr_PE.UTF-8zak_GH.UTF-8zam_ET.UTF-8zen_US.ISO8859-1zan_ES.ISO8859-15zanp_IN.UTF-8zar_AA.ISO8859-6zar_AE.ISO8859-6zar_BH.ISO8859-6zar_DZ.ISO8859-6zar_EG.ISO8859-6zar_IN.UTF-8zar_IQ.ISO8859-6zar_JO.ISO8859-6zar_KW.ISO8859-6zar_LB.ISO8859-6zar_LY.ISO8859-6zar_MA.ISO8859-6zar_OM.ISO8859-6zar_QA.ISO8859-6zar_SA.ISO8859-6zar_SD.ISO8859-6zar_SS.UTF-8zar_SY.ISO8859-6zar_TN.ISO8859-6zar_YE.ISO8859-6zas_IN.UTF-8zast_ES.ISO8859-15zayc_PE.UTF-8zaz_AZ.ISO8859-9Ezaz_IR.UTF-8zbe_BY.CP1251zbe_BY.UTF-8@latinzbg_BG.UTF-8zbem_ZM.UTF-8zber_DZ.UTF-8zber_MA.UTF-8zbg_BG.CP1251zbhb_IN.UTF-8zbho_IN.UTF-8zbho_NP.UTF-8zbi_VU.UTF-8zbn_BD.UTF-8zbn_IN.UTF-8zbo_CN.UTF-8zbo_IN.UTF-8znb_NO.ISO8859-1zbr_FR.ISO8859-1zbrx_IN.UTF-8zbs_BA.ISO8859-2zbyn_ER.UTF-8zfr_CA.ISO8859-1zen_US.UTF-8zca_ES.ISO8859-1zca_AD.ISO8859-1zca_ES.UTF-8@valenciazca_FR.ISO8859-1zca_IT.ISO8859-1zce_RU.UTF-8zzh_CN.eucCNzzh_TW.eucTWzchr_US.UTF-8zckb_IQ.UTF-8zcmn_TW.UTF-8zcrh_UA.UTF-8zhr_HR.ISO8859-2zcs_CZ.ISO8859-2zcsb_PL.UTF-8zcv_RU.UTF-8zcy_GB.ISO8859-1zda_DK.ISO8859-1zde_DE.ISO8859-1zde_AT.ISO8859-1zde_BE.ISO8859-1zde_CH.ISO8859-1zde_IT.ISO8859-1zde_LI.UTF-8zde_LU.ISO8859-1zdoi_IN.UTF-8znl_NL.ISO8859-1znl_BE.ISO8859-1zdv_MV.UTF-8zdz_BT.UTF-8zee_EE.ISO8859-4zet_EE.ISO8859-1zel_GR.ISO8859-7zel_CY.ISO8859-7zel_GR.ISO8859-15zen_AG.UTF-8zen_AU.ISO8859-1zen_BE.ISO8859-1zen_BW.ISO8859-1zen_CA.ISO8859-1zen_DK.ISO8859-1zen_DL.UTF-8zen_GB.ISO8859-1zen_HK.ISO8859-1zen_IE.ISO8859-1zen_IL.UTF-8zen_IN.ISO8859-1zen_NG.UTF-8zen_NZ.ISO8859-1zen_PH.ISO8859-1zen_SC.UTF-8zen_SG.ISO8859-1zen_US.ISO8859-15zen_ZA.ISO8859-1zen_ZM.UTF-8zen_ZW.ISO8859-1zen_ZS.UTF-8zen_EN.ISO8859-1zeo_XX.ISO8859-3zeo.UTF-8zeo_EO.ISO8859-3zeo_US.UTF-8zes_ES.ISO8859-1zes_AR.ISO8859-1zes_BO.ISO8859-1zes_CL.ISO8859-1zes_CO.ISO8859-1zes_CR.ISO8859-1zes_CU.UTF-8zes_DO.ISO8859-1zes_EC.ISO8859-1zes_GT.ISO8859-1zes_HN.ISO8859-1zes_MX.ISO8859-1zes_NI.ISO8859-1zes_PA.ISO8859-1zes_PE.ISO8859-1zes_PR.ISO8859-1zes_PY.ISO8859-1zes_SV.ISO8859-1zes_US.ISO8859-1zes_UY.ISO8859-1zes_VE.ISO8859-1zet_EE.ISO8859-15zeu_ES.ISO8859-1zeu_FR.ISO8859-1zfa_IR.UTF-8zfa_IR.ISIRI-3342zff_SN.UTF-8zfi_FI.ISO8859-15zfil_PH.UTF-8zfi_FI.ISO8859-1zfo_FO.ISO8859-1zfr_FR.ISO8859-1zfr_BE.ISO8859-1zfr_CH.ISO8859-1zfr_LU.ISO8859-1zfur_IT.UTF-8zfy_DE.UTF-8zfy_NL.UTF-8zga_IE.ISO8859-1zgl_ES.ISO8859-1zgd_GB.ISO8859-1zgez_ER.UTF-8zgez_ET.UTF-8zgu_IN.UTF-8zgv_GB.ISO8859-1zha_NG.UTF-8zhak_TW.UTF-8zhe_IL.ISO8859-8zhi_IN.ISCII-DEVzhif_FJ.UTF-8zhne_IN.UTF-8zhsb_DE.ISO8859-2zht_HT.UTF-8zhu_HU.ISO8859-2zhy_AM.UTF-8zhy_AM.ARMSCII_8zia.UTF-8zia_FR.UTF-8zis_IS.ISO8859-1zid_ID.ISO8859-1zig_NG.UTF-8zik_CA.UTF-8zit_IT.ISO8859-1zit_CH.ISO8859-1ziu_CA.NUNACOM-8ziw_IL.UTF-8zja_JP.eucJPz
ja_JP.SJISzka_GE.GEORGIAN-ACADEMYzka_GE.GEORGIAN-PSzkab_DZ.UTF-8z
kk_KZ.ptcp154zkl_GL.ISO8859-1zkm_KH.UTF-8zkn_IN.UTF-8zko_KR.eucKRzkok_IN.UTF-8zks_IN.UTF-8zks_IN.UTF-8@devanagarizku_TR.ISO8859-9zkw_GB.ISO8859-1zky_KG.UTF-8zlb_LU.UTF-8zlg_UG.ISO8859-10zli_BE.UTF-8zli_NL.UTF-8zlij_IT.UTF-8zlt_LT.ISO8859-13zln_CD.UTF-8zlo_LA.MULELAO-1zlo_LA.IBM-CP1133zlv_LV.ISO8859-13zlzh_TW.UTF-8zmag_IN.UTF-8zmai_IN.UTF-8zmai_NP.UTF-8zmfe_MU.UTF-8zmg_MG.ISO8859-15zmhr_RU.UTF-8zmi_NZ.ISO8859-1zmiq_NI.UTF-8zmjw_IN.UTF-8zmk_MK.ISO8859-5zml_IN.UTF-8zmn_MN.UTF-8zmni_IN.UTF-8zmr_IN.UTF-8zms_MY.ISO8859-1zmt_MT.ISO8859-3zmy_MM.UTF-8znan_TW.UTF-8znds_DE.UTF-8znds_NL.UTF-8zne_NP.UTF-8znhn_MX.UTF-8zniu_NU.UTF-8zniu_NZ.UTF-8znl_AW.UTF-8znn_NO.ISO8859-1zno_NO.ISO8859-1zny_NO.ISO8859-1znr_ZA.ISO8859-1znso_ZA.ISO8859-15zoc_FR.ISO8859-1zom_ET.UTF-8zom_KE.ISO8859-1zor_IN.UTF-8zos_RU.UTF-8zpa_IN.UTF-8zpa_PK.UTF-8zpap_AN.UTF-8zpap_AW.UTF-8zpap_CW.UTF-8zpd_US.ISO8859-1zpd_DE.ISO8859-1zph_PH.ISO8859-1zpl_PL.ISO8859-2zpt_PT.ISO8859-1zpt_BR.ISO8859-1zpp_AN.ISO8859-1zps_AF.UTF-8zquz_PE.UTF-8zraj_IN.UTF-8zro_RO.ISO8859-2zru_RU.UTF-8zru_UA.KOI8-Uzru_RU.KOI8-Rzrw_RW.ISO8859-1zsa_IN.UTF-8zsat_IN.UTF-8zsc_IT.UTF-8zsd_IN.UTF-8zsd_IN.UTF-8@devanagarizsd_PK.UTF-8zse_NO.UTF-8zsr_RS.UTF-8@latinzsgs_LT.UTF-8zsr_CS.ISO8859-2zsh_HR.ISO8859-2zshn_MM.UTF-8zshs_CA.UTF-8zsi_LK.UTF-8zsid_ET.UTF-8zsk_SK.ISO8859-2zsl_SI.ISO8859-2zsl_CS.ISO8859-2zsm_WS.UTF-8zso_DJ.ISO8859-1zso_ET.UTF-8zso_KE.ISO8859-1zso_SO.ISO8859-1zsr_CS.ISO8859-5zsq_AL.ISO8859-2zsq_MK.UTF-8zsr_RS.UTF-8zsr_CS.UTF-8@latinzsr_CS.UTF-8zsr_ME.UTF-8zsr_CS.CP1251zss_ZA.ISO8859-1zst_ZA.ISO8859-1zsv_SE.ISO8859-1zsv_FI.ISO8859-1zsw_KE.UTF-8zsw_TZ.UTF-8zszl_PL.UTF-8z
ta_IN.TSCII-0zta_LK.UTF-8ztcy_IN.UTF-8zte_IN.UTF-8ztg_TJ.KOI8-Czth_TH.ISO8859-11zth_TH.TIS620zthe_NP.UTF-8zti_ER.UTF-8zti_ET.UTF-8ztig_ER.UTF-8ztk_TM.UTF-8ztl_PH.ISO8859-1ztn_ZA.ISO8859-15zto_TO.UTF-8ztpi_PG.UTF-8ztr_TR.ISO8859-9ztr_CY.ISO8859-9zts_ZA.ISO8859-1ztt_RU.TATAR-CYRztt_RU.UTF-8@iqtelifzug_CN.UTF-8zuk_UA.KOI8-Uz	en_US.utfzunm_US.UTF-8zur_PK.CP1256zur_IN.UTF-8zuz_UZ.UTF-8zve_ZA.UTF-8z
vi_VN.TCVNzvi_VN.VISCIIzwa_BE.ISO8859-1zwae_CH.UTF-8zwal_ET.UTF-8zwo_SN.UTF-8zxh_ZA.ISO8859-1zyi_US.CP1255zyo_NG.UTF-8zyue_HK.UTF-8zyuw_PG.UTF-8zzh_CN.gb2312z
zh_TW.big5zzh_HK.big5hkscszzh_SG.GB2312z	zh_SG.GBKzzu_ZA.ISO8859-1(LZa3Za3_azz
a3_az.koicZaa_djZaa_erZaa_etZafZaf_zaZagr_peZak_ghZamZam_etZamericanZan_esZanp_inZarZar_aaZar_aeZar_bhZar_dzZar_egZar_inZar_iqZar_joZar_kwZar_lbZar_lyZar_maZar_omZar_qaZar_saZar_sdZar_ssZar_syZar_tnZar_ye�arabic�asZas_inZast_esZayc_peZazZaz_azzaz_az.iso88599eZaz_irZbezbe@latinz
be_bg.utf8Zbe_byzbe_by@latinZbem_zmZber_dzZber_maZbgZbg_bgzbhb_in.utf8Zbho_inZbho_npZbi_vuZbn_bdZbn_inZbo_cnZbo_inZbokmalubokmål�brZbr_frZbrx_inZbsZbs_baZ	bulgarianZbyn_err�zc-frenchzc.asciizc.enz
c.iso88591zc.utf8Zc_czc_c.cZcaZca_adZca_eszca_es@valenciaZca_frZca_itZcatalanZce_ruZcextendz	chinese-sz	chinese-tZchr_usZckb_iqZcmn_twZcrh_uaZcroatianZcsZcs_csZcs_czZcsb_plZcv_ruZcyZcy_gbZczZcz_czZczechZdaZda_dkZdanishZdanskZdeZde_atZde_beZde_chZde_deZde_itz
de_li.utf8Zde_luZdeutschZdoi_inZdutchzdutch.iso88591Zdv_mvZdz_btZeeZee_eeZeestiZelZel_cyZel_grz
el_gr@euror�Zen_agZen_auZen_beZen_bwZen_caZen_dkz
en_dl.utf8Zen_gbZen_hkZen_ieZen_ilZen_inZen_ngZen_nzZen_phz
en_sc.utf8Zen_sgZen_ukZen_uszen_us@euro@euroZen_zaZen_zmZen_zwz
en_zw.utf8Zeng_gbZenglishzenglish.iso88591Z
english_ukzenglish_united-stateszenglish_united-states.437Z
english_usZeozeo.utf8Zeo_eoz
eo_us.utf8Zeo_xxZesZes_arZes_boZes_clZes_coZes_crZes_cuZes_doZes_ecZes_esZes_gtZes_hnZes_mxZes_niZes_paZes_peZes_prZes_pyZes_svZes_usZes_uyZes_veZestonianZetZet_eeZeuZeu_esZeu_frZfaZfa_irzfa_ir.isiri3342Zff_snZfiZfi_fiZfil_phZfinnishZfoZfo_fo�frZfr_beZfr_caZfr_chZfr_frZfr_luu	françaisZfre_frZfrenchzfrench.iso88591Z
french_franceZfur_itZfy_deZfy_nlZgaZga_ieZgalegoZgalicianZgdZgd_gbZger_deZgermanzgerman.iso88591Zgerman_germanyZgez_erZgez_etZglZgl_es�greekZgu_inZgvZgv_gbZha_ngZhak_twZheZhe_il�hebrew�hiZhi_inzhi_in.isciidevZhif_fjZhneZhne_inZhrZhr_hrZhrvatskiZhsb_deZht_htZhuZhu_huZ	hungarianZhy_amzhy_am.armscii8ZiaZia_frZ	icelandic�idZid_idZig_ngZik_ca�inZin_idrzZis_isz
iso-8859-1r�z	iso8859-1z
iso8859-15�
iso_8859_1�iso_8859_15�itZit_chZit_itZitalianZiuZiu_caziu_ca.nunacom8ZiwZiw_ilz
iw_il.utf8ZjaZja_jpz	ja_jp.euczja_jp.mscodez	ja_jp.pckZjapanZjapanesezjapanese-euczjapanese.eucZjp_jpZkaZka_gezka_ge.georgianacademyzka_ge.georgianpszka_ge.georgianrsZkab_dzZkk_kzZklZkl_glZkm_khZknZkn_inZkoZko_krz	ko_kr.eucZkok_in�koreanz
korean.eucZksZks_inzks_in@devanagari.utf8Zku_tr�kwZkw_gbZkyZky_kgZlb_luZlg_ugZli_beZli_nlZlij_itZ
lithuanianZln_cd�loZlo_lazlo_la.cp1133zlo_la.ibmcp1133zlo_la.mulelao1�ltZlt_ltZlvZlv_lvZlzh_twZmag_inZmaiZmai_inZmai_npZmfe_muZmg_mgZmhr_ru�miZmi_nzZmiq_niZmjw_inZmkZmk_mkZmlZml_inZmn_mnZmni_inZmrZmr_inZmsZms_myZmtZmt_mtZmy_mmZnan_twZnbZnb_noZnds_deZnds_nlZne_npZnhn_mxZniu_nuZniu_nz�nlZnl_awZnl_beZnl_nlZnnZnn_noZnoz
no@nynorskZno_nozno_no.iso88591@bokmalzno_no.iso88591@nynorskZ	norwegianZnrZnr_zaZnsoZnso_zaZnyZny_noZnynorskZocZoc_frZom_etZom_ke�orZor_inZos_ruZpaZpa_inZpa_pkZpap_anZpap_awZpap_cwZpdZpd_deZpd_usZphZph_phZplZpl_plZpolishZ
portugueseZportuguese_brazil�posixz
posix-utf2ZppZpp_anZps_afZptZpt_brZpt_ptZquz_peZraj_inZroZro_roZromanianZruZru_ruZru_uaZrumanianZrussianZrwZrw_rwZsa_inZsat_inZsc_itZsdZsd_inzsd_in@devanagari.utf8Zsd_pkZse_noZ
serbocroatianZsgs_ltZshzsh_ba.iso88592@bosniaZsh_hrzsh_hr.iso88592Zsh_spZsh_yuZshn_mmZshs_caZsiZsi_lkZsid_etZsinhalaZskZsk_skZslZsl_csZsl_siZslovakZsloveneZ	slovenianZsm_wsZso_djZso_etZso_keZso_soZspZsp_yuZspanishZ
spanish_spainZsqZsq_alZsq_mk�srzsr@cyrilliczsr@latnZsr_cszsr_cs.iso88592@latnz
sr_cs@latnZsr_meZsr_rsz
sr_rs@latnZsr_spZsr_yuzsr_yu.cp1251@cyrilliczsr_yu.iso88592zsr_yu.iso88595zsr_yu.iso88595@cyrilliczsr_yu.microsoftcp1251@cyrillicz
sr_yu.utf8zsr_yu.utf8@cyrilliczsr_yu@cyrillicZssZss_za�stZst_zaZsvZsv_fiZsv_seZsw_keZsw_tzZswedishZszl_plZtaZta_inzta_in.tsciizta_in.tscii0Zta_lkztcy_in.utf8ZteZte_inZtgZtg_tjZthZth_thzth_th.tactiszth_th.tis620�thaiZthe_npZti_erZti_etZtig_erZtk_tmZtlZtl_phZtnZtn_zaZto_toZtpi_pgZtrZtr_cyZtr_trrvZts_zaZttZtt_ruztt_ru.tatarcyrz
tt_ru@iqtelifZturkishZug_cnZukZuk_uaZunivZ	universalzuniversal.utf8@ucs4Zunm_usZurZur_inZur_pkZuzZuz_uzzuz_uz@cyrillicZveZve_zaZviZvi_vnz
vi_vn.tcvnzvi_vn.tcvn5712zvi_vn.visciizvi_vn.viscii111ZwaZwa_beZwae_chZwal_etZwo_snZxhZxh_zaZyiZyi_usZyo_ngZyue_hkZyuw_pgZzhZzh_cnz
zh_cn.big5z	zh_cn.eucZzh_hkzzh_hk.big5hkZzh_sgz	zh_sg.gbkZzh_twz	zh_tw.euczzh_tw.euctwZzuZzu_zaZaf_ZAZsq_ALZgsw_FRZam_ETZar_SAZar_IQZar_EGZar_LYZar_DZZar_MAZar_TNZar_OMZar_YEZar_SYZar_JOZar_LBZar_KWZar_AEZar_BHZar_QAZhy_AMZas_INZaz_AZZba_RUZeu_ESZbe_BYZbn_INZbs_BAZbr_FRZbg_BGZca_ESZzh_CHSZzh_TWZzh_CNZzh_HKZzh_SGZzh_MOZzh_CHTZco_FRZhr_HRZhr_BAZcs_CZZda_DKZgbz_AFZdiv_MVZnl_NLZnl_BEZen_USZen_GBZen_AUZen_CAZen_NZZen_IEZen_ZAZen_JAZen_CBZen_BZZen_TTZen_ZWZen_PHZen_INZen_MYZet_EEZfo_FOZfil_PHZfi_FIZfr_FRZfr_BEZfr_CAZfr_CHZfr_LUZfr_MCZfy_NLZgl_ESZka_GEZde_DEZde_CHZde_ATZde_LUZde_LIZel_GRZkl_GLZgu_INZha_NGZhe_ILZhi_INZhu_HUZis_ISZid_IDZiu_CAZga_IEZit_ITZit_CHZja_JPZkn_INZkk_KZZkh_KHZqut_GTZrw_RWZkok_INZko_KRZky_KGZlo_LAZlv_LVZlt_LTZdsb_DEZlb_LUZmk_MKZms_MYZms_BNZml_INZmt_MTZmi_NZZarn_CLZmr_INZmoh_CAZmn_MNZmn_CNZne_NPZnb_NOZnn_NOZoc_FRZor_INZps_AFZfa_IRZpl_PLZpt_BRZpt_PTZpa_INZquz_BOZquz_ECZquz_PEZro_ROZrm_CHZru_RUZsmn_FIZsmj_NOZsmj_SEZse_NOZse_SEZse_FIZsms_FIZsma_NOZsma_SEZsa_INZsr_SPZsr_BAZsi_LKZns_ZAZtn_ZAZsk_SKZsl_SIZes_ESZes_MXZes_GTZes_CRZes_PAZes_DOZes_VEZes_COZes_PEZes_ARZes_ECZes_CLZes_URZes_PYZes_BOZes_SVZes_HNZes_NIZes_PRZes_USZsw_KEZsv_SEZsv_FIZsyr_SYZtg_TJZtmz_DZZta_INZtt_RUZte_INZth_THZbo_BTZbo_CNZtr_TRZtk_TMZug_CNZuk_UAZwen_DEZur_PKZur_INZuz_UZZvi_VNZcy_GBZwo_SNZxh_ZAZsah_RUZii_CNZyo_NGZzu_ZA)�i6ii�i^iiiiiiii i$i(i,i0i4i8i<i@i+iMi,i,imi-i#iEi ii~iir&iiiiii|i�iiiii�ieiii	i	i	i	i	i	i	i	 i	$i	(i	,i	0i	4i	@i	Di	Hi%i8idiiiiiiiibiVi7iiiiiiioiGihi
i9iii!i]i]i<iiiiKi?iSi�i�iWii@iTi&i'i.ini/i>i>iLi:i�iziNi|iPiPiaiii�iHici)iiiiFikikikiiii;$i;i;i;i;i;i; i;i;iOiiiii[ili2ii$i
i
i
i
i
i
i
i
 i
$i
(i
,i
0i
4i
8i
<i
@i
Di
Hi
Li
Pi
TiAiiiZi(i_iIiDiJiiQiQiiBi�i"i.i i iCiCi*iRi�i4i�ixiji5cCs�i}|fdd�}|�|d=td�td�t�\}}td|p@d�td|pNd�t�td	�td�|��D]@\}}t|d
�t|�\}}td|p�d�td|p�d�t�qpt�td
�td�t�|��D]B\}}t|d
�t|�\}}td|p�d�td|�pd�t�q�zttd�Wn$td�td�td�YnhXt�td�td�|��D]F\}}t|d
�t|�\}}td|�p�d�td|�p�d�t��qldS)NcSs0t���D] \}}|dd�dkr
|||<q
dS)Nr$ZLC_)�globals�items)�
categories�k�vrrr�_init_categories�sz'_print_locale.<locals>._init_categoriesrz4Locale defaults as determined by getdefaultlocale():zH------------------------------------------------------------------------z
Language: z(undefined)z
Encoding: zLocale settings on startup:z...z
   Language: z
   Encoding: z,Locale settings after calling resetlocale():r)zNOTE:z9setlocale(LC_ALL, "") does not support the default localez&given in the OS environment variables.z4Locale settings after calling setlocale(LC_ALL, ""):)r{rr�rrrr)r�r�Zlang�enc�namer>rrr�
_print_locale�sV



r��LC_MESSAGES�__main__zLocale aliasing:zNumber formatting:)N)F)FF)FF)FF)TFF)r�)N)T)T)T)T)Jr�r�Zencodings.aliases�rera�builtinsrr��	functools�__all__rr r�r�rrrrr�rrrrDrr	rr�rr
r@rA�wrapsrFrSrT�compiler]rZrrrrw�floatrr
r}r�r�r�rr�r�rrrr��
startswithr�CODESET�	NameError�hasattrr��sortedr�r�r�rt�
setdefaultr�r�r�rL�__name__r{rrrr�<module>
sr�	




%-S"5
$�6}�����
a��V:

site.cpython-38.pyc000064400000041121151450073350010142 0ustar00U

&�.eNU�@s&dZddlZddlZddlZddlZddlZejejgada	da
dadd�Zdd�Z
dd�Zd	d
�Zdd�Zd2d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd3dd�Zd4dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z d-d.�Z!ej"j#�s
e!�d/d0�Z$e%d1k�r"e$�dS)5a�Append module search paths for third-party packages to sys.path.

****************************************************************
* This module is automatically imported during initialization. *
****************************************************************

This will append site-specific paths to the module search path.  On
Unix (including Mac OSX), it starts with sys.prefix and
sys.exec_prefix (if different) and appends
lib/python<version>/site-packages.
On other platforms (such as Windows), it tries each of the
prefixes directly, as well as with lib/site-packages appended.  The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.

If a file named "pyvenv.cfg" exists one directory above sys.executable,
sys.prefix and sys.exec_prefix are set to that directory and
it is also checked for site-packages (sys.base_prefix and
sys.base_exec_prefix will always be the "real" prefixes of the Python
installation). If "pyvenv.cfg" (a bootstrap configuration file) contains
the key "include-system-site-packages" set to anything other than "false"
(case-insensitive), the system-level prefixes will still also be
searched for site-packages; otherwise they won't.

All of the resulting site-specific directories, if they exist, are
appended to sys.path, and also inspected for path configuration
files.

A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
to be added to sys.path.  Non-existing directories (or
non-directories) are never added to sys.path; no directory is added to
sys.path more than once.  Blank lines and lines beginning with
'#' are skipped. Lines starting with 'import' are executed.

For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python2.5/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth.  Assume foo.pth contains the
following:

  # foo package configuration
  foo
  bar
  bletch

and bar.pth contains:

  # bar package configuration
  bar

Then the following directories are added to sys.path, in this order:

  /usr/local/lib/python2.5/site-packages/bar
  /usr/local/lib/python2.5/site-packages/foo

Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
omitted because it is not mentioned in either path configuration file.

The readline module is also automatically configured to enable
completion for systems that support it.  This can be overridden in
sitecustomize, usercustomize or PYTHONSTARTUP.  Starting Python in
isolated mode (-I) disables automatic readline configuration.

After these operations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
site-specific customizations.  If this import fails with an
ImportError exception, it is silently ignored.
�NcGsBtjj|�}ztj�|�}Wntk
r0YnX|tj�|�fS�N)�os�path�join�abspath�OSError�normcase)�paths�dir�r�/usr/lib64/python3.8/site.py�makepath[sr
cCs�ttj���D]~}tt|dd�dd�dkr,qztj�|j�|_Wnt	t
tfk
rZYnXztj�|j�|_Wqt	t
tfk
r�YqXqdS)zESet all module __file__ and __cached__ attributes to an absolute path�
__loader__N�
__module__)�_frozen_importlib�_frozen_importlib_external)
�set�sys�modules�values�getattrrrr�__file__�AttributeErrorr�	TypeError�
__cached__)�mrrr�	abs_pathsds�rcCsPg}t�}tjD],}t|�\}}||kr|�|�|�|�q|tjdd�<|S)zK Remove duplicate entries from sys.path along with making them
    absoluteN)rrrr
�append�add)�L�known_pathsr
�dircaserrr�removeduppathsts

r"c	CsVt�}tjD]D}z&tj�|�r4t|�\}}|�|�Wqtk
rNYqYqXq|S)zEReturn a set containing all existing file system items from sys.path.)rrrr�existsr
rr)�d�item�_�itemcaserrr�_init_pathinfo�s
r(cCsr|dkrt�}d}nd}tj�||�}zt�t�|��}Wntk
rPYdSX|��t|�D]�\}}|�	d�rvqbzZ|�	d�r�t
|�Wqb|��}t||�\}}	|	|kr�tj�
|�r�tj�|�|�|	�Wqbtk
�rVtd�|d|�tjd�d	dl}
|
jt���D](}|��D]}td
|tjd��q�qtdtjd�Y�qZYqbXqbW5QRX|�rnd}|S)z�Process a .pth file within the site-packages directory:
       For each line in the file, either combine it with sitedir to a path
       and add that to known_paths, or execute it if it starts with 'import '.
    NTF�#)zimport zimport	z"Error processing line {:d} of {}:
�)�filerz  z
Remainder of file ignored)r(rrr�io�
TextIOWrapper�	open_coder�	enumerate�
startswith�exec�rstripr
r#rrr�	Exception�print�format�stderr�	traceback�format_exception�exc_info�
splitlines)�sitedir�namer �reset�fullname�f�n�liner
r!r7�recordrrr�
addpackage�sF

�rCcCs�|dkrt�}d}nd}t|�\}}||krBtj�|�|�|�zt�|�}Wntk
rfYdSXdd�|D�}t	|�D]}t
|||�q~|r�d}|S)zTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'NTFcSsg|]}|�d�r|�qS)z.pth)�endswith)�.0r<rrr�
<listcomp>�s
zaddsitedir.<locals>.<listcomp>)r(r
rrrrr�listdirr�sortedrC)r;r r=�sitedircase�namesr<rrr�
addsitedir�s$
rKcCs`tjjrdSttd�r4ttd�r4t��t��kr4dSttd�r\ttd�r\t��t��kr\dSdS)a,Check if user site directory is safe for inclusion

    The function tests for the command line flag (including environment var),
    process uid/gid equal to effective uid/gid.

    None: Disabled for security reasons
    False: Disabled by user (command line option)
    True: Safe and enabled
    F�getuid�geteuidN�getgid�getegidT)	r�flags�no_user_site�hasattrrrMrLrOrNrrrr�check_enableusersite�s
rScCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)rr�
expanduserr)�argsrrr�joinuser�sz_getuserbase.<locals>.joinuser�nt�APPDATA�~�Python�darwin�Libraryz%d.%d�z.local)r�environ�getr<r�platform�
_framework�version_info)�env_baserW�baserrr�_getuserbase�s


�rfcCsdtj}tjdkr,|�d|d�|d�d�StjdkrFtjrF|�d�S|�d|d�d	|d�d
�S)NrXz\Pythonrr*z\site-packagesr\z/lib/python/site-packagesz/lib/python�.z/site-packages)rrcrr<rarb)�userbase�versionrrr�	_get_path
s

rjcCstdkrt�atS)z�Returns the `user base` directory path.

    The `user base` directory can be used to store data. If the global
    variable ``USER_BASE`` is not initialized yet, this function will also set
    it.
    N)�	USER_BASErfrrrr�getuserbasesrlcCst�}tdkrt|�atS)z�Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    N)rl�	USER_SITErj)rhrrr�getusersitepackages#srncCs$t�}tr tj�|�r t||�|S)z�Add a per user site-package to sys.path

    Each user has its own python directory with site-packages in the
    home directory.
    )rn�ENABLE_USER_SITErr�isdirrK)r �	user_siterrr�addusersitepackages1s
rrcCs�g}t�}|dkrt}|D]�}|r||kr,q|�|�tjdkr�|�tj�|ddtj	dd�d��|�tj�|ddtj
dd	�d��q|�|�|�tj�|dd��|�tj�|dd��q|S)
aReturns a list containing all global site-packages directories.

    For each directory present in ``prefixes`` (or the global ``PREFIXES``),
    this function will find its `site-packages` subdirectory depending on the
    system environment, and will return a list of full paths.
    N�/�lib64�python�z
site-packages�libzpython%d.%dr^)r�PREFIXESrr�seprrrrrirc)�prefixes�sitepackages�seen�prefixrrr�getsitepackages?s*

��
r~cCsBtrdtjkrt�dd�t|�D]}tj�|�r"t||�q"|S)z�Add site-packages to sys.path

    '/usr/local' is included in PREFIXES if RPM build is not detected
    to make packages installed into this location visible.

    �RPM_BUILD_ROOTrz
/usr/local)	rorr_rx�insertr~rrprK)r rzr;rrr�addsitepackages^sr�cCs4tjdkrd}nd}t�d|�t_t�d|�t_dS)z�Define new builtins 'quit' and 'exit'.

    These are objects which make the interpreter exit when called.
    The repr of each object contains a hint at how it works.

    �\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)�quit�exitN)rry�
_sitebuiltins�Quitter�builtinsr�r�)�eofrrr�setquitms

r�cCs�t�dtj�t_tjdd�dkr2t�dd�t_nt�dd�t_gg}}ttd�r�tj	�
tj�}|�d	d
g�|�tj	�
|tj�|tjg�t�dd||�t_dS)
z)Set 'copyright' and 'credits' in builtins�	copyrightN��java�creditsz?Jython is maintained by the Jython developers (www.jython.org).z�    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.rzLICENSE.txt�LICENSE�licensez'See https://www.python.org/psf/license/)r��_Printerrr�r�rar�rRrr�dirnamer�extendr�pardir�curdirr�)�files�dirs�hererrr�setcopyright}s$�

�r�cCst��t_dSr)r��_Helperr��helprrrr�	sethelper�sr�cCsdd�}|t_dS)ajEnable default readline configuration on interactive prompts, by
    registering a sys.__interactivehook__.

    If the readline module can be imported, the hook will set the Tab key
    as completion key and register ~/.python_history as history file.
    This can be overridden in the sitecustomize or usercustomize module,
    or in a PYTHONSTARTUP file.
    cs�ddl}zddl�ddl}Wntk
r2YdSXt�dd�}|dk	r\d|kr\��d�n
��d�z���Wntk
r�YnX���dkr�t	j
�t	j
�d�d��z��
��Wntk
r�YnX��fd	d
�}|�|�dS)Nr�__doc__��libeditzbind ^I rl_completez
tab: completerZz.python_historycs(z����Wntk
r"YnXdSr)�write_history_filerr��history�readlinerr�
write_history�szCenablerlcompleter.<locals>.register_readline.<locals>.write_history)�atexitr��rlcompleter�ImportErrorr�parse_and_bind�read_init_filer�get_current_history_lengthrrrrU�read_history_file�register)r�r��readline_docr�rr�r�register_readline�s0
�z,enablerlcompleter.<locals>.register_readlineN)r�__interactivehook__)r�rrr�enablerlcompleter�s	0r�c	CsHtj}tjdkr*d|kr*tjd}t_ntj}tj�tj�|��\}}tj�	|�}dt_
d}dd�tj�||�tj�||�fD�}|�rD|d}d}	t|dd	��\}
|
D]P}d
|kr�|�
d
�\}}}
|����}|
��}
|dkr�|
��}	q�|dkr�|
t_
q�W5QRX|t_t_t|tjg�|	dk�r8t�dtj�ntjgad
a|S)Nr\�__PYVENV_LAUNCHER__z
pyvenv.cfgcSsg|]}tj�|�r|�qSr)rr�isfile)rE�conffilerrrrF�s�zvenv.<locals>.<listcomp>r�truezutf-8)�encoding�=zinclude-system-site-packages�homeF)rr_rra�_base_executable�
executabler�splitrr��_homer�open�	partition�strip�lowerr}�exec_prefixr�rxr�ro)r �envr��exe_dirr&�site_prefix�
conf_basename�candidate_confs�virtual_conf�system_siter?rA�key�valuerrr�venv�sB��

r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom site specific code, if available.rN�
sitecustomizez@Error in sitecustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrP�verbose�
excepthookr9r6�write�	__class__�__name__)r��exc�errrrr�execsitecustomizes

��r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom user specific code, if available.rN�
usercustomizez@Error in usercustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrPr�r�r9r6r�r�r�)r�r�r�rrr�execusercustomizes

��r�cCs~tjdd�}t�}|tjkr$t�t|�}tdkr:t�at|�}t|�}t	�t
�t�tjj
sjt�t�trzt�dS)z�Add standard site-specific directories to the module search path.

    This function is called automatically when this module is imported,
    unless the python interpreter was started with the -S flag.
    N)rrr"rr�rorSrrr�r�r�r�rP�isolatedr�r�r�)�	orig_pathr rrr�main/s"
r�cCs\d}tjdd�}|s�t�}t�}td�tjD]}td|f�q0td�td|tj�|�rbdndf�td	|tj�|�r�dndf�td
t�t�	d�g}d|kr�|�
t�d
|kr�|�
t�|�r(ttj
�|��tr�t�	d�n6tdk�rt�	d�n tdk�rt�	d�n
t�	d�n0ddl}t|�|tjdtj
f��t�	d�dS)Na�    %s [--user-base] [--user-site]

    Without arguments print some useful information
    With arguments print the value of USER_BASE and/or USER_SITE separated
    by '%s'.

    Exit codes with --user-base or --user-site:
      0 - user site directory is enabled
      1 - user site directory is disabled by user
      2 - uses site directory is disabled by super user
          or for security reasons
     >2 - unknown error
    r*zsys.path = [z    %r,�]zUSER_BASE: %r (%s)r#z
doesn't existzUSER_SITE: %r (%s)zENABLE_USER_SITE: %rrz--user-basez--user-siteFr^rv�
)r�argvrlrnr4rrrpror�rrkrm�pathsepr�textwrap�dedent)r�rV�	user_baserqr
�bufferr�rrr�_scriptQsD
��




r��__main__)N)N)N)&r�rrr�r�r,r}r�rxrormrkr
rr"r(rCrKrSrfrjrlrnrrr~r�r�r�r�r�r�r�r�r�rP�no_siter�r�rrrr�<module>sHG	
*
 


;4
3
pkgutil.cpython-38.pyc000064400000037722151450073350010671 0ustar00U

e5d�S�@sxdZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z	ddlZddlm
Z
ddlZdddd	d
ddd
ddddgZedd�Zde_dd�Zdd�Zd+dd
�Zd,dd�Zed-dd��Zd.dd�Ze�ejje�dd�ZGd d
�d
�ZGd!d�d�Zz.ddlZdd"lmZd/d#d$�Ze�ee�Wne k
�r@YnXd%d�Z!d0d&d�Z"d'd�Z#d(d	�Z$d)d�Z%d*d�Z&dS)1zUtilities to support packages.�)�
namedtuple)�singledispatchN)�
ModuleType�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsRz
|j}Wn:tk
rD|�|�}|dkr2YdStj�||�YSX||�SdS)z'Return the finder-specific module spec.N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�/usr/lib64/python3.8/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr�magicrrrr(s

�c	#s�ifdd��t||�D]�}|V|jrzt|j�WnNtk
rZ|dk	rV||j�Yqtk
r�|dk	r|||j�n�YqXttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqdS)a�Yields ModuleInfo for all modules recursively
    on path, or, if path is None, all accessible modules.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.

    Note that this function must import all *packages* (NOT all
    modules!) on the given path, in order to access the __path__
    attribute to find submodules.

    'onerror' is a function which gets called with one argument (the
    name of the package which was being imported) if any exception
    occurs while trying to import a package.  If no onerror function is
    supplied, ImportErrors are caught and ignored, while all other
    exceptions are propagated, terminating the search.

    Examples:

    # list all modules python can access
    walk_packages()

    # list all submodules of ctypes
    walk_packages(ctypes.__path__, ctypes.__name__+'.')
    cSs||krdSd||<dS)NTr)�p�mrrr�seenRszwalk_packages.<locals>.seenN�__path__csg|]}�|�s|�qSrr)�.0r&�r(rr�
<listcomp>isz!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�inforr+rr	5s ccsr|dkrt�}nt|t�r$td��n
tt|�}i}|D]6}t||�D]&\}}||krDd||<t|||�VqDq6dS)aYields ModuleInfo for all submodules on path,
    or, if path is None, all top-level modules on sys.path.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.
    Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r5r6Z	importers�yielded�irr.rrrr
ns



cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr6rrrr>�s
r>c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dS�Nr�__init__Fr-Tr9�	r5�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rBr6r?rH�	filenames�fn�modnamer5r.�dircontents�subnamerrr�_iter_file_finder_modules�s<



rSc	Cs.t���t�dt�t�d�aW5QRXdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerUrrrr�_import_imp�s
r[c@s.eZdZdZd
dd�Zddd�Zddd	�ZdS)
raPEP 302 Finder that wraps Python's "classic" import algorithm

    ImpImporter(dirname) produces a PEP 302 finder that searches that
    directory.  ImpImporter(None) produces a PEP 302 finder that searches
    the current sys.path, plus any modules that are frozen or built-in.

    Note that ImpImporter does not currently support being used by placement
    on sys.meta_path.
    NcCst�dt�t�||_dS�Nz5This emulation is deprecated, use 'importlib' instead)rV�warnrYr[r5)�selfr5rrrrD�s
�zImpImporter.__init__cCs�|�d�d}||kr$|jdkr$dS|jdkr4d}ntj�|j�g}zt�||�\}}}Wntk
rpYdSXt||||�S)Nr-���)�splitr5rF�realpathrUrr0r
)r^�fullnamer5rR�file�filename�etcrrrr�s
zImpImporter.find_moduler%c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dSrCrE)r^r6r?rHrNrOrPr5r.rQrRrrrr
�s<



zImpImporter.iter_modules)N)N)r%)�__name__�
__module__�__qualname__�__doc__rDrr
rrrrr�s


c@sneZdZdZdZZdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zddd�Zddd�Z
dd�Zddd�ZdS)r
zBPEP 302 Loader that wraps Python's "classic" import algorithm
    NcCs.t�dt�t�||_||_||_||_dSr\)rVr]rYr[rcrdrbre)r^rbrcrdrerrrrDs�zImpLoader.__init__cCs:|��zt�||j|j|j�}W5|jr4|j��X|S)N)�_reopenrc�closerU�load_modulerdre)r^rb�modrrrrlszImpLoader.load_modulec
Cs*t|d��}|��W5QR�SQRXdS)N�rb)�openr )r^�pathnamercrrrr%szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfkrPt|jd�|_dS)N��rrn)	rc�closedrerU�	PY_SOURCErord�PY_COMPILED�C_EXTENSION)r^�mod_typerrrrj)s

zImpLoader._reopencCs0|dkr|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)rbr0�r^rbrrr�	_fix_name1s
�zImpLoader._fix_namecCs|�|�}|jdtjkS�Nrq)ryrerU�
PKG_DIRECTORYrxrrr�
is_package9s
zImpLoader.is_packagecCs�|�|�}|jdkr�|jd}|tjkrD|�|�}t||jd�|_nJ|tjkrv|�	�zt|j
�|_W5|j
��Xn|tj
kr�|����|_|jS)Nrq�exec)ry�codererUrt�
get_source�compilerdrurjrcrkrr{�
_get_delegate�get_code)r^rbrw�sourcerrrr�=s






zImpLoader.get_codec	Cs�|�|�}|jdkr�|jd}|tjkrP|��z|j��|_W5|j��Xnd|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_W5QRXn|tjkr�|����|_|jS)Nrqr_rr)ryr�rerUrtrjrcrkr rurFr5�existsrdror{r�r)r^rbrw�frrrrNs





zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrD)rrdrr)r^r�specrrrr�`s

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfkrD|j	SdSrz)
ryrerUr{r��get_filenamertrurvrd)r^rbrwrrrr�es


zImpLoader.get_filename)N)N)N)rfrgrhrir~r�rDrlrrjryr|r�rr�r�rrrrr
s	

)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}|D]�}|�|�s>q.||d��t	j
�}t|�dkr�|d�d�r�|d|kr�d||d<||ddfVt|�dkr�q.|�|d�}|dkr�q.|r.d|kr.||kr.d||<||dfVq.dS)	Nrrqr9z__init__.pyTrDr-F)�sorted�	zipimport�_zip_directory_cache�archiver6�lenrH�
startswithr`rF�seprL)	rBr6Zdirlist�_prefixZplenr?rHrOrPrrr�iter_zipimport_modulesss*
r�cCsxt�|�}ztj|}WnZtk
rrtjD]:}z ||�}tj�||�WqnWq.tk
rfYq.Xq.d}YnX|S)z�Retrieve a finder for the given path item

    The returned finder is cached in sys.path_importer_cache
    if it was newly created by a path hook.

    The cache (or part of it) can be cleared manually if a
    rescan of sys.path_hooks is necessary.
    N)rF�fsdecoder3�path_importer_cache�KeyError�
path_hooks�
setdefaultr0)Z	path_itemrB�	path_hookrrrr�s	



ccs�|�d�rd�|�}t|��d|krV|�d�d}t�|�}t|dd�}|dkrhdSntjEdHtj	}|D]}t
|�VqldS)a�Yield finders for the given module name

    If fullname contains a '.', the finders will be for the package
    containing fullname, otherwise they will be all registered top level
    finders (i.e. those on both sys.meta_path and sys.path_hooks).

    If the named module is in a package, that package is imported as a side
    effect of invoking this function.

    If no module name is specified, all top level finders are produced.
    r-�'Relative module name {!r} not supportedrr)N)r��formatr0�
rpartitionrrZr2r3�	meta_pathr5r)rb�msgZpkg_nameZpkgr5�itemrrrr�s


cCsn|tjkr tj|}|dkr dSt|t�rb|}t|dd�}|dk	rF|St|dd�dkrZdS|j}n|}t|�S)z�Get a "loader" object for module_or_name

    Returns None if the module cannot be found or imported.
    If the named module is not already imported, its containing package
    (if any) is imported, in order to establish the package __path__.
    N�
__loader__�__spec__)r3r4r:rr2rfr)Zmodule_or_name�modulerrbrrrr�s


cCs�|�d�rd�|�}t|��ztj�|�}WnFttttfk
rr}z d}t|�|t	|�|��|�W5d}~XYnX|dk	r�|j
SdS)z�Find a "loader" object for fullname

    This is a backwards compatibility wrapper around
    importlib.util.find_spec that converts most failures to ImportError
    and only returns the loader rather than the full spec
    r-r�z,Error while finding loader for {!r} ({}: {})N)r�r�r0rrrr�	TypeErrorr<�typer)rbr�r�Zexrrrr�s

*cCs�t|t�s|S|d}|dd�}|�d�\}}}|rfztj|j}Wqlttfk
rb|YSXntj}|D�]&}t|t	�s�qpt
|�}|dk	r�g}	t|d�r�|�|�}
|
dk	r�|
j
p�g}	nt|d�r�|�|�\}}	|	D]}||kr�|�|�q�tj�||�}tj�|�rpzt|�}
Wn8tk
�rP}ztj�d||f�W5d}~XYqpX|
�<|
D]0}|�d�}|�r\|�d��r��q\|�|��q\W5QRXqp|S)	a�Extend a package's path.

    Intended use is to place the following code in a package's __init__.py:

        from pkgutil import extend_path
        __path__ = extend_path(__path__, __name__)

    This will add to the package's __path__ all subdirectories of
    directories on sys.path named after the package.  This is useful
    if one wants to distribute different parts of a single logical
    package as multiple directories.

    It also looks for *.pkg files beginning where * matches the name
    argument.  This feature is similar to *.pth files (see site.py),
    except that it doesn't special-case lines starting with 'import'.
    A *.pkg file is trusted at face value: apart from checking for
    duplicates, all entries found in a *.pkg file are added to the
    path, regardless of whether they are exist the filesystem.  (This
    is a feature.)

    If the input path is not a list (as is the case for frozen
    packages) it is returned unchanged.  The input path is not
    modified; an extended copy is returned.  Items are only appended
    to the copy at the end.

    It is assumed that sys.path is a sequence.  Items of sys.path that
    are not (unicode or 8-bit) strings referring to existing
    directories are ignored.  Unicode items of sys.path that cause
    errors when used as filenames may cause this function to raise an
    exception (in line with os.path.isdir() behavior).
    z.pkgNr-rrzCan't open %s: %s
�
�#)r:�listr�r3r4r)r�rr5r;rrAr�submodule_search_locationsr�appendrFrM�isfilerorJ�stderr�write�rstripr�)r5rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsr�ZportionZpkgfiler�r��linerrrr�sR!





�
cCs�tj�|�}|dkrdS|j}|dks0t|d�s4dStj�|�pJtj�	|�}|dks^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)afGet a resource from a package.

    This is a wrapper round the PEP 302 loader get_data API. The package
    argument should be the name of a package, in standard module format
    (foo.bar). The resource argument should be in the form of a relative
    filename, using '/' as the path separator. The parent directory name '..'
    is not allowed, and nor is a rooted name (starting with a '/').

    The function returns a binary string, which is the contents of the
    specified resource.

    For packages located in the filesystem, which have already been imported,
    this is the rough equivalent of

        d = os.path.dirname(sys.modules[package].__file__)
        data = open(os.path.join(d, resource), 'rb').read()

    If the package cannot be located or loaded, or it uses a PEP 302 loader
    which does not support get_data(), then None is returned.
    Nr�__file__�/r)rrrrrAr3r4�get�
_bootstrap�_loadr`�insertrFr5�dirnamer�rMr)�package�resourcer�rrm�partsZ
resource_namerrrrVs
�
)Nr%N)Nr%)r%)r%)r%)r%)'ri�collectionsr�	functoolsrZ
simplegenericr�importlib.util�importlib.machineryrFZos.pathr3�typesrrV�__all__rrrr	r
r>rS�register�	machinery�
FileFinderr[rr
r�r�r�r0rrrrrrrrrr�<module>sh�

9

(�Jc

^re.cpython-38.pyc000064400000034130151450073350007606 0ustar00U

e5d�=�@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddddddddddddddddddgZd ZGd!d"�d"ej	�Z
e��e
j
�ejZd@d#d�ZdAd$d�ZdBd%d�ZdCd&d�ZdDd'd�ZdEd(d�ZdFd)d	�ZdGd*d
�ZdHd+d�Zd,d�ZdId-d
�Zd.d/�d0D�Zd1d�Zee�d2d��Zee�d2d��d2��ZiZd3Z d4d5�Z!e�"e �d6d7��Z#d8d9�Z$d:d;�Z%ddl&Z&d<d=�Z'e&�(ee'e!�Gd>d?�d?�Z)dS)Ja�Support for regular expressions (RE).

This module provides regular expression matching operations similar to
those found in Perl.  It supports both 8-bit and Unicode strings; both
the pattern and the strings being processed can contain null bytes and
characters outside the US ASCII range.

Regular expressions can contain both special and ordinary characters.
Most ordinary characters, like "A", "a", or "0", are the simplest
regular expressions; they simply match themselves.  You can
concatenate ordinary characters, so last matches the string 'last'.

The special characters are:
    "."      Matches any character except a newline.
    "^"      Matches the start of the string.
    "$"      Matches the end of the string or just before the newline at
             the end of the string.
    "*"      Matches 0 or more (greedy) repetitions of the preceding RE.
             Greedy means that it will match as many repetitions as possible.
    "+"      Matches 1 or more (greedy) repetitions of the preceding RE.
    "?"      Matches 0 or 1 (greedy) of the preceding RE.
    *?,+?,?? Non-greedy versions of the previous three special characters.
    {m,n}    Matches from m to n repetitions of the preceding RE.
    {m,n}?   Non-greedy version of the above.
    "\\"     Either escapes special characters or signals a special sequence.
    []       Indicates a set of characters.
             A "^" as the first character indicates a complementing set.
    "|"      A|B, creates an RE that will match either A or B.
    (...)    Matches the RE inside the parentheses.
             The contents can be retrieved or matched later in the string.
    (?aiLmsux) The letters set the corresponding flags defined below.
    (?:...)  Non-grouping version of regular parentheses.
    (?P<name>...) The substring matched by the group is accessible by name.
    (?P=name)     Matches the text matched earlier by the group named name.
    (?#...)  A comment; ignored.
    (?=...)  Matches if ... matches next, but doesn't consume the string.
    (?!...)  Matches if ... doesn't match next.
    (?<=...) Matches if preceded by ... (must be fixed length).
    (?<!...) Matches if not preceded by ... (must be fixed length).
    (?(id/name)yes|no) Matches yes pattern if the group with id/name matched,
                       the (optional) no pattern otherwise.

The special sequences consist of "\\" and a character from the list
below.  If the ordinary character is not on the list, then the
resulting RE will match the second character.
    \number  Matches the contents of the group of the same number.
    \A       Matches only at the start of the string.
    \Z       Matches only at the end of the string.
    \b       Matches the empty string, but only at the start or end of a word.
    \B       Matches the empty string, but not at the start or end of a word.
    \d       Matches any decimal digit; equivalent to the set [0-9] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode digits.
    \D       Matches any non-digit character; equivalent to [^\d].
    \s       Matches any whitespace character; equivalent to [ \t\n\r\f\v] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode whitespace characters.
    \S       Matches any non-whitespace character; equivalent to [^\s].
    \w       Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]
             in bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the
             range of Unicode alphanumeric characters (letters plus digits
             plus underscore).
             With LOCALE, it will match the set [0-9_] plus characters defined
             as letters for the current locale.
    \W       Matches the complement of \w.
    \\       Matches a literal backslash.

This module exports the following functions:
    match     Match a regular expression pattern to the beginning of a string.
    fullmatch Match a regular expression pattern to all of a string.
    search    Search a string for the presence of a pattern.
    sub       Substitute occurrences of a pattern found in a string.
    subn      Same as sub, but also return the number of substitutions made.
    split     Split a string by the occurrences of a pattern.
    findall   Find all occurrences of a pattern in a string.
    finditer  Return an iterator yielding a Match object for each match.
    compile   Compile a pattern into a Pattern object.
    purge     Clear the regular expression cache.
    escape    Backslash all non-alphanumerics in a string.

Each function other than purge and escape can take an optional 'flags' argument
consisting of one or more of the following module constants, joined by "|".
A, L, and U are mutually exclusive.
    A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
                   match the corresponding ASCII character categories
                   (rather than the whole Unicode categories, which is the
                   default).
                   For bytes patterns, this flag is the only available
                   behaviour and needn't be specified.
    I  IGNORECASE  Perform case-insensitive matching.
    L  LOCALE      Make \w, \W, \b, \B, dependent on the current locale.
    M  MULTILINE   "^" matches the beginning of lines (after a newline)
                   as well as the string.
                   "$" matches the end of lines (before a newline) as well
                   as the end of the string.
    S  DOTALL      "." matches any character at all, including the newline.
    X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.
    U  UNICODE     For compatibility only. Ignored for string patterns (it
                   is the default), and forbidden for bytes patterns.

This module also defines an exception 'error'.

�N�match�	fullmatch�search�sub�subn�split�findall�finditer�compile�purge�template�escape�error�Pattern�Match�A�I�L�M�S�X�U�ASCII�
IGNORECASE�LOCALE�	MULTILINE�DOTALL�VERBOSE�UNICODEz2.2.1c@speZdZejZZejZZ	ej
ZZej
ZZejZZejZZejZZejZZejZdd�Zej Z dS)�	RegexFlagcCs�|jdk	rd|j��S|j}g}|dk}|r2|}|jD],}||j@r8||jM}|�d|j���q8|rx|�t|��d�|�}|r�t|�dkr�d|�d�}n
d|��}|S)Nzre.r�|�z~(�)�~)�_name_�_value_�	__class__�append�hex�join�len)�self�value�members�negative�m�res�r1�/usr/lib64/python3.8/re.py�__repr__�s&




zRegexFlag.__repr__N)!�__name__�
__module__�__qualname__�sre_compile�SRE_FLAG_ASCIIrr�SRE_FLAG_IGNORECASErr�SRE_FLAG_LOCALErr�SRE_FLAG_UNICODErr�SRE_FLAG_MULTILINErr�SRE_FLAG_DOTALLrr�SRE_FLAG_VERBOSErr�SRE_FLAG_TEMPLATE�TEMPLATE�T�SRE_FLAG_DEBUG�DEBUGr3�object�__str__r1r1r1r2r�s







rcCst||��|�S)zqTry to apply the pattern at the start of the string, returning
    a Match object, or None if no match was found.)�_compiler��pattern�string�flagsr1r1r2r�scCst||��|�S)zkTry to apply the pattern to all of the string, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|�S)ztScan through string looking for a match to the pattern, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|||�S)aZReturn the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in string by the
    replacement repl.  repl can be either a string or a callable;
    if a string, backslash escapes in it are processed.  If it is
    a callable, it's passed the Match object and must return
    a replacement string to be used.)rFr�rH�replrI�countrJr1r1r2r�scCst||��|||�S)a�Return a 2-tuple containing (new_string, number).
    new_string is the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in the source
    string by the replacement repl.  number is the number of
    substitutions that were made. repl can be either a string or a
    callable; if a string, backslash escapes in it are processed.
    If it is a callable, it's passed the Match object and must
    return a replacement string to be used.)rFrrKr1r1r2r�s	cCst||��||�S)a�Split the source string by the occurrences of the pattern,
    returning a list containing the resulting substrings.  If
    capturing parentheses are used in pattern, then the text of all
    groups in the pattern are also returned as part of the resulting
    list.  If maxsplit is nonzero, at most maxsplit splits occur,
    and the remainder of the string is returned as the final element
    of the list.)rFr)rHrI�maxsplitrJr1r1r2r�scCst||��|�S)aReturn a list of all non-overlapping matches in the string.

    If one or more capturing groups are present in the pattern, return
    a list of groups; this will be a list of tuples if the pattern
    has more than one group.

    Empty matches are included in the result.)rFrrGr1r1r2r�scCst||��|�S)z�Return an iterator over all non-overlapping matches in the
    string.  For each match, the iterator returns a Match object.

    Empty matches are included in the result.)rFr	rGr1r1r2r	�scCs
t||�S)zACompile a regular expression pattern, returning a Pattern object.)rF�rHrJr1r1r2r
�scCst��t��dS)z#Clear the regular expression cachesN)�_cache�clear�
_compile_repl�cache_clearr1r1r1r2r�scCst||tB�S)z6Compile a template pattern, returning a Pattern object)rFrArOr1r1r2rscCsi|]}|dt|��qS)�\)�chr)�.0�ir1r1r2�
<dictcomp>srXs()[]{}?*+-|^$\.&~# 	

cCs2t|t�r|�t�St|d�}|�t��d�SdS)z0
    Escape special characters in a string.
    �latin1N)�
isinstance�str�	translate�_special_chars_map�encode)rHr1r1r2r
s


�ic
Cs�t|t�r|j}ztt|�||fWStk
r8YnXt|t�rT|rPtd��|St�	|�sft
d��t�||�}|t@s�t
t�tkr�ztttt��=Wntttfk
r�YnX|tt|�||f<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled pattern)rZrr,rP�type�KeyErrorr�
ValueErrorr7�isstring�	TypeErrorr
rCr*�	_MAXCACHE�next�iter�
StopIteration�RuntimeError)rHrJ�pr1r1r2rF!s.

�
rFcCst�||�S�N)�	sre_parse�parse_template)rLrHr1r1r2rR;srRcCst�||�}t�||�Srk)rlrm�expand_template)rHrrr1r1r2�_expand@srocCs>t||�}|ds.t|d�dkr.|ddS|fdd�}|S)Nrr!cSst�||�Srk)rlrn)rrr1r1r2�filterKsz_subx.<locals>.filter)rRr*)rHrrpr1r1r2�_subxEs

rqcCst|j|jffSrk)rFrHrJ)rjr1r1r2�_pickleSsrrc@seZdZddd�Zdd�ZdS)�Scannerrc
Cs�ddlm}m}t|t�r |j}||_g}t��}||_	|D]H\}}|�
�}	|�t�|||	ddt�
||�ffg��|�|	|d�q<t�||d|ffg�}t�|�|_dS)Nr)�BRANCH�
SUBPATTERN���)�
sre_constantsrtrurZrr,�lexiconrl�StaterJ�	opengroupr'�
SubPattern�parse�
closegroupr7r
�scanner)
r+rxrJrtrurj�s�phrase�action�gidr1r1r2�__init__\s

�zScanner.__init__c	Cs�g}|j}|j�|�j}d}|�}|s(q�|��}||kr:q�|j|jdd}t|�rj||_|||���}|dk	rz||�|}q|||d�fS)Nrr!)r'r~r�endrx�	lastindex�callable�group)	r+rI�resultr'rrWr/�jr�r1r1r2�scanms$zScanner.scanN)r)r4r5r6r�r�r1r1r1r2rs[s
rs)r)r)r)rr)rr)rr)r)r)r)r)*�__doc__�enumr7rl�	functools�_locale�ImportError�__all__�__version__�IntFlagr�globals�update�__members__rrrrrrrrr	r
rrr]r
r`rrrPrerF�	lru_cacherRrorq�copyregrr�picklersr1r1r1r2�<module>s�k
�#



	







	

codecs.cpython-38.pyc000064400000102246151450073350010444 0ustar00U

e5d;��,@s�dZddlZddlZzddlTWn.ek
rNZzede��W5dZ[XYnXddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g,Zd1Zd2Z	Z
d3ZZd4Z
d5Zejd6kr�e
ZZe
ZneZZeZe
ZeZe
ZeZGd7d�de�ZGd8d�d�ZGd9d�de�ZGd:d;�d;e�ZGd<d�de�ZGd=d>�d>e�ZGd?d�de�ZGd@d�de�Z GdAd�d�Z!GdBd�d�Z"d\dFd�Z#d]dGd�Z$dHd�Z%dId �Z&dJd!�Z'dKd"�Z(dLd#�Z)dMd$�Z*d^dNd'�Z+d_dOd(�Z,dPdQ�Z-dRdS�Z.z4e/dD�Z0e/dT�Z1e/dU�Z2e/dV�Z3e/dW�Z4e/dX�Z5Wn.e6k
�r`dZ0dZ1dZ2dZ3dZ4dZ5YnXdZ7e7�rtddl8Z8e9dYk�r�e$ej:dZd[�e_:e$ej;d[dZ�e_;dS)`z� codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N)�*z%Failed to load the builtin codecs: %s�register�lookup�open�EncodedFile�BOM�BOM_BE�BOM_LE�BOM32_BE�BOM32_LE�BOM64_BE�BOM64_LE�BOM_UTF8�	BOM_UTF16�BOM_UTF16_LE�BOM_UTF16_BE�	BOM_UTF32�BOM_UTF32_LE�BOM_UTF32_BE�	CodecInfo�Codec�IncrementalEncoder�IncrementalDecoder�StreamReader�StreamWriter�StreamReaderWriter�
StreamRecoder�
getencoder�
getdecoder�getincrementalencoder�getincrementaldecoder�	getreader�	getwriter�encode�decode�
iterencode�
iterdecode�
strict_errors�
ignore_errors�replace_errors�xmlcharrefreplace_errors�backslashreplace_errors�namereplace_errors�register_error�lookup_errorss��s��s��s���littlec@s,eZdZdZdZd	dd�dd�Zdd�ZdS)
rz0Codec details when looking up the codec registryTN)�_is_text_encodingc
CsPt�|||||f�}	||	_||	_||	_||	_||	_||	_||	_|dk	rL||	_	|	S�N)
�tuple�__new__�namer#r$�incrementalencoder�incrementaldecoder�streamwriter�streamreaderr0)
�clsr#r$r8r7r5r6r4r0�self�r;�/usr/lib64/python3.8/codecs.pyr3^szCodecInfo.__new__cCsd|jj|jj|jt|�fS)Nz%<%s.%s object for encoding %s at %#x>)�	__class__�
__module__�__qualname__r4�id�r:r;r;r<�__repr__ms��zCodecInfo.__repr__)NNNNN)�__name__r>r?�__doc__r0r3rBr;r;r;r<rSs��c@s$eZdZdZddd�Zd	dd�ZdS)
ra9 Defines the interface for stateless encoders/decoders.

        The .encode()/.decode() methods may use different error
        handling schemes by providing the errors argument. These
        string values are predefined:

         'strict' - raise a ValueError error (or a subclass)
         'ignore' - ignore the character and continue with the next
         'replace' - replace with a suitable replacement character;
                    Python will use the official U+FFFD REPLACEMENT
                    CHARACTER for the builtin Unicode codecs on
                    decoding and '?' on encoding.
         'surrogateescape' - replace with private code points U+DCnn.
         'xmlcharrefreplace' - Replace with the appropriate XML
                               character reference (only for encoding).
         'backslashreplace'  - Replace with backslashed escape sequences.
         'namereplace'       - Replace with \N{...} escape sequences
                               (only for encoding).

        The set of allowed values can be extended via register_error.

    �strictcCst�dS)a# Encodes the object input and returns a tuple (output
            object, length consumed).

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamWriter for codecs which have to keep state in order to
            make encoding efficient.

            The encoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        N��NotImplementedError�r:�input�errorsr;r;r<r#�szCodec.encodecCst�dS)a� Decodes the object input and returns a tuple (output
            object, length consumed).

            input must be an object which provides the bf_getreadbuf
            buffer slot. Python strings, buffer objects and memory
            mapped files are examples of objects providing this slot.

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamReader for codecs which have to keep state in order to
            make decoding efficient.

            The decoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        NrFrHr;r;r<r$�szCodec.decodeN)rE)rE)rCr>r?rDr#r$r;r;r;r<rrs
c@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalEncoder encodes an input in multiple steps. The input can
    be passed piece by piece to the encode() method. The IncrementalEncoder
    remembers the state of the encoding process between calls to encode().
    rEcCs||_d|_dS)z�
        Creates an IncrementalEncoder instance.

        The IncrementalEncoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        �N)rJ�buffer�r:rJr;r;r<�__init__�szIncrementalEncoder.__init__FcCst�dS)zA
        Encodes input and returns the resulting object.
        NrF�r:rI�finalr;r;r<r#�szIncrementalEncoder.encodecCsdS)z:
        Resets the encoder to the initial state.
        Nr;rAr;r;r<�reset�szIncrementalEncoder.resetcCsdS)z:
        Return the current state of the encoder.
        rr;rAr;r;r<�getstate�szIncrementalEncoder.getstatecCsdS)zl
        Set the current state of the encoder. state must have been
        returned by getstate().
        Nr;�r:�stater;r;r<�setstate�szIncrementalEncoder.setstateN)rE)F)	rCr>r?rDrNr#rQrRrUr;r;r;r<r�s

c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalEncoderz�
    This subclass of IncrementalEncoder can be used as the baseclass for an
    incremental encoder if the encoder must keep some of the output in a
    buffer between calls to encode().
    rEcCst�||�d|_dS�NrK)rrNrLrMr;r;r<rN�sz#BufferedIncrementalEncoder.__init__cCst�dSr1rF�r:rIrJrPr;r;r<�_buffer_encode�sz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrYrJ�r:rIrP�data�result�consumedr;r;r<r#�s
z!BufferedIncrementalEncoder.encodecCst�|�d|_dSrW)rrQrLrAr;r;r<rQ�s
z BufferedIncrementalEncoder.resetcCs
|jpdS�Nr�rLrAr;r;r<rR�sz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrWr_rSr;r;r<rU�sz#BufferedIncrementalEncoder.setstateN)rE)F)
rCr>r?rDrNrYr#rQrRrUr;r;r;r<rV�s

rVc@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalDecoder decodes an input in multiple steps. The input can
    be passed piece by piece to the decode() method. The IncrementalDecoder
    remembers the state of the decoding process between calls to decode().
    rEcCs
||_dS)z�
        Create an IncrementalDecoder instance.

        The IncrementalDecoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        N)rJrMr;r;r<rNszIncrementalDecoder.__init__FcCst�dS)z@
        Decode input and returns the resulting object.
        NrFrOr;r;r<r$szIncrementalDecoder.decodecCsdS)z9
        Reset the decoder to the initial state.
        Nr;rAr;r;r<rQszIncrementalDecoder.resetcCsdS)a	
        Return the current state of the decoder.

        This must be a (buffered_input, additional_state_info) tuple.
        buffered_input must be a bytes object containing bytes that
        were passed to decode() that have not yet been converted.
        additional_state_info must be a non-negative integer
        representing the state of the decoder WITHOUT yet having
        processed the contents of buffered_input.  In the initial state
        and after reset(), getstate() must return (b"", 0).
        )�rr;rAr;r;r<rRszIncrementalDecoder.getstatecCsdS)z�
        Set the current state of the decoder.

        state must have been returned by getstate().  The effect of
        setstate((b"", 0)) must be equivalent to reset().
        Nr;rSr;r;r<rU'szIncrementalDecoder.setstateN)rE)F)	rCr>r?rDrNr$rQrRrUr;r;r;r<r�s


c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalDecoderz�
    This subclass of IncrementalDecoder can be used as the baseclass for an
    incremental decoder if the decoder must be able to handle incomplete
    byte sequences.
    rEcCst�||�d|_dS�Nr`)rrNrLrMr;r;r<rN5sz#BufferedIncrementalDecoder.__init__cCst�dSr1rFrXr;r;r<�_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrcrJrZr;r;r<r$?s
z!BufferedIncrementalDecoder.decodecCst�|�d|_dSrb)rrQrLrAr;r;r<rQGs
z BufferedIncrementalDecoder.resetcCs
|jdfSr^r_rAr;r;r<rRKsz#BufferedIncrementalDecoder.getstatecCs|d|_dSr^r_rSr;r;r<rUOsz#BufferedIncrementalDecoder.setstateN)rE)F)
rCr>r?rDrNrcr$rQrRrUr;r;r;r<ra/s

rac@sTeZdZddd�Zdd�Zdd�Zdd	�Zddd�Zefd
d�Z	dd�Z
dd�ZdS)rrEcCs||_||_dS)aw Creates a StreamWriter instance.

            stream must be a file-like object open for writing.

            The StreamWriter may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'xmlcharrefreplace' - Replace with the appropriate XML
                                   character reference.
             'backslashreplace'  - Replace with backslashed escape
                                   sequences.
             'namereplace'       - Replace with \N{...} escape sequences.

            The set of allowed parameter values can be extended via
            register_error.
        N)�streamrJ�r:rdrJr;r;r<rN\szStreamWriter.__init__cCs"|�||j�\}}|j�|�dS)z> Writes the object's contents encoded to self.stream.
        N)r#rJrd�write)r:�objectr[r]r;r;r<rfuszStreamWriter.writecCs|�d�|��dS)z[ Writes the concatenated list of strings to the stream
            using .write().
        rKN)rf�join�r:�listr;r;r<�
writelines|szStreamWriter.writelinescCsdS)a5 Flushes and resets the codec buffers used for keeping state.

            Calling this method should ensure that the data on the
            output is put into a clean state, that allows appending
            of new fresh data without having to rescan the whole
            stream to recover state.

        Nr;rAr;r;r<rQ�s
zStreamWriter.resetrcCs*|j�||�|dkr&|dkr&|��dSr^�rd�seekrQ�r:�offset�whencer;r;r<rm�szStreamWriter.seekcCs||j|�S�z? Inherit all other methods from the underlying stream.
        �rd�r:r4�getattrr;r;r<�__getattr__�szStreamWriter.__getattr__cCs|Sr1r;rAr;r;r<�	__enter__�szStreamWriter.__enter__cCs|j��dSr1�rd�close�r:�type�value�tbr;r;r<�__exit__�szStreamWriter.__exit__N)rE)r)rCr>r?rNrfrkrQrmrtrurvr}r;r;r;r<rZs

�
c@s�eZdZeZddd�Zd dd�Zd!dd	�Zd"dd
�Zd#dd�Z	dd�Z
d$dd�Zdd�Zdd�Z
efdd�Zdd�Zdd�Zd
S)%rrEcCs.||_||_d|_|��|_|j|_d|_dS)a� Creates a StreamReader instance.

            stream must be a file-like object open for reading.

            The StreamReader may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'backslashreplace' - Replace with backslashed escape sequences;

            The set of allowed parameter values can be extended via
            register_error.
        r`N)rdrJ�
bytebuffer�charbuffertype�_empty_charbuffer�
charbuffer�
linebufferrer;r;r<rN�s
zStreamReader.__init__cCst�dSr1rFrHr;r;r<r$�szStreamReader.decode���Fc
CsN|jr|j�|j�|_d|_|dkr(|}|dkrBt|j�|krB�q|dkrV|j��}n|j�|�}|j|}|st�qz|�||j	�\}}Wn`t
k
r�}zB|r�|�|d|j�|j	�\}}|jdd�}	t|	�dkrڂn�W5d}~XYnX||d�|_|j|7_|s(�qq(|dk�r,|j}
|j|_n|jd|�}
|j|d�|_|
S)a� Decodes data from the stream self.stream and returns the
            resulting object.

            chars indicates the number of decoded code points or bytes to
            return. read() will never return more data than requested,
            but it might return less, if there is not enough available.

            size indicates the approximate maximum number of decoded
            bytes or code points to read for decoding. The decoder
            can modify this setting as appropriate. The default value
            -1 indicates to read and decode as much as possible.  size
            is intended to prevent having to decode huge files in one
            step.

            If firstline is true, and a UnicodeDecodeError happens
            after the first line terminator in the input only the first line
            will be returned, the rest of the input will be kept until the
            next call to read().

            The method should use a greedy read strategy, meaning that
            it should read as much data as is allowed within the
            definition of the encoding and the given size, e.g.  if
            optional encoding endings or state markers are available
            on the stream, these should be read too.
        NrT��keepends�)
r�r�rhr��lenrd�readr~r$rJ�UnicodeDecodeError�start�
splitlines)r:�size�chars�	firstline�newdatar[�newchars�decodedbytes�exc�linesr\r;r;r<r��sD
�

zStreamReader.readNTc	Cs�|jrP|jd}|jd=t|j�dkr8|jd|_d|_|sL|jdd�d}|S|pVd}|j}|j|dd�}|r�t|t�r�|�d	�s�t|t	�r�|�d
�r�||jddd�7}||7}|jdd�}|�r�t|�dk�r8|d}|d=t|�dk�r|d|j7<||_d|_n|d|j|_|�s�|jdd�d}�q�|d}|djdd�d}||k�r�|j�
|dd��|j|_|�r�|}n|}�q�|�r�|dk	�r�|�r�|�s�|jdd�d}�q�|d
kr^|d9}q^|S)z� Read one line from the input stream and return the
            decoded data.

            size, if given, is passed as size argument to the
            read() method.

        rr�NFr��HT)r��
�
)r�r�r�i@�)r�r�r�r�r�r��
isinstance�str�endswith�bytesrh)	r:r�r��line�readsizer[r��line0withend�line0withoutendr;r;r<�readlinesd
��
�
zStreamReader.readlinecCs|��}|�|�S)aS Read all lines available on the input stream
            and return them as a list.

            Line breaks are implemented using the codec's decoder
            method and are included in the list entries.

            sizehint, if given, is ignored since there is no efficient
            way to finding the true end-of-line.

        )r�r�)r:�sizehintr�r[r;r;r<�	readlines^szStreamReader.readlinescCsd|_|j|_d|_dS)z� Resets the codec buffers used for keeping state.

            Note that no stream repositioning should take place.
            This method is primarily intended to be able to recover
            from decoding errors.

        r`N)r~r�r�r�rAr;r;r<rQms	zStreamReader.resetrcCs|j�||�|��dS)zp Set the input stream's current position.

            Resets the codec buffers used for keeping state.
        Nrlrnr;r;r<rmzszStreamReader.seekcCs|��}|r|St�dS)�4 Return the next decoded line from the input stream.N)r��
StopIteration)r:r�r;r;r<�__next__�szStreamReader.__next__cCs|Sr1r;rAr;r;r<�__iter__�szStreamReader.__iter__cCs||j|�Srqrrrsr;r;r<ru�szStreamReader.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReader.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReader.__exit__)rE)rE)r�r�F)NT)NT)r)rCr>r?r�rrNr$r�r�r�rQrmr�r�rtrurvr}r;r;r;r<r�s


P
K

�
c@s�eZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d%dd�Zefdd�Zdd�Zdd �Zd	S)&ra StreamReaderWriter instances allow wrapping streams which
        work in both read and write modes.

        The design is such that one can use the factory functions
        returned by the codec.lookup() function to construct the
        instance.

    �unknownrEcCs(||_|||�|_|||�|_||_dS)aR Creates a StreamReaderWriter instance.

            stream must be a Stream-like object.

            Reader, Writer must be factory functions or classes
            providing the StreamReader, StreamWriter interface resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rd�reader�writerrJ)r:rd�Reader�WriterrJr;r;r<rN�s
zStreamReaderWriter.__init__r�cCs|j�|�Sr1)r�r��r:r�r;r;r<r��szStreamReaderWriter.readNcCs|j�|�Sr1)r�r�r�r;r;r<r��szStreamReaderWriter.readlinecCs|j�|�Sr1)r�r�)r:r�r;r;r<r��szStreamReaderWriter.readlinescCs
t|j�S�r�)�nextr�rAr;r;r<r��szStreamReaderWriter.__next__cCs|Sr1r;rAr;r;r<r��szStreamReaderWriter.__iter__cCs|j�|�Sr1)r�rf)r:r[r;r;r<rf�szStreamReaderWriter.writecCs|j�|�Sr1)r�rkrir;r;r<rk�szStreamReaderWriter.writelinescCs|j��|j��dSr1�r�rQr�rAr;r;r<rQ�s
zStreamReaderWriter.resetrcCs6|j�||�|j��|dkr2|dkr2|j��dSr^)rdrmr�rQr�rnr;r;r<rm�s
zStreamReaderWriter.seekcCs||j|�Srqrrrsr;r;r<ru�szStreamReaderWriter.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReaderWriter.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReaderWriter.__exit__)rE)r�)N)N)r)rCr>r?rD�encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s 	




�
	c@s�eZdZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd%dd�Zefdd�Zdd�Zdd �Zd	S)&raB StreamRecoder instances translate data from one encoding to another.

        They use the complete set of APIs returned by the
        codecs.lookup() function to implement their task.

        Data written to the StreamRecoder is first decoded into an
        intermediate format (depending on the "decode" codec) and then
        written to the underlying stream using an instance of the provided
        Writer class.

        In the other direction, data is read from the underlying stream using
        a Reader instance and then encoded and returned to the caller.

    r�rEcCs4||_||_||_|||�|_|||�|_||_dS)a� Creates a StreamRecoder instance which implements a two-way
            conversion: encode and decode work on the frontend (the
            data visible to .read() and .write()) while Reader and Writer
            work on the backend (the data in stream).

            You can use these objects to do transparent
            transcodings from e.g. latin-1 to utf-8 and back.

            stream must be a file-like object.

            encode and decode must adhere to the Codec interface; Reader and
            Writer must be factory functions or classes providing the
            StreamReader and StreamWriter interfaces resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rdr#r$r�r�rJ)r:rdr#r$r�r�rJr;r;r<rNszStreamRecoder.__init__r�cCs"|j�|�}|�||j�\}}|Sr1)r�r�r#rJ�r:r�r[�bytesencodedr;r;r<r�#szStreamRecoder.readNcCs6|dkr|j��}n|j�|�}|�||j�\}}|Sr1)r�r�r#rJr�r;r;r<r�)s
zStreamRecoder.readlinecCs(|j��}|�||j�\}}|jdd�S)NTr�)r�r�r#rJr�)r:r�r[r�r;r;r<r�2s
zStreamRecoder.readlinescCs t|j�}|�||j�\}}|Sr�)r�r�r#rJ)r:r[r�r;r;r<r�8s
zStreamRecoder.__next__cCs|Sr1r;rAr;r;r<r�?szStreamRecoder.__iter__cCs|�||j�\}}|j�|�Sr1)r$rJr�rf)r:r[�bytesdecodedr;r;r<rfBszStreamRecoder.writecCs(d�|�}|�||j�\}}|j�|�Srb)rhr$rJr�rf)r:rjr[r�r;r;r<rkGs
zStreamRecoder.writelinescCs|j��|j��dSr1r�rAr;r;r<rQMs
zStreamRecoder.resetrcCs |j�||�|j�||�dSr1)r�rmr�rnr;r;r<rmRszStreamRecoder.seekcCs||j|�Srqrrrsr;r;r<ruXszStreamRecoder.__getattr__cCs|Sr1r;rAr;r;r<rv_szStreamRecoder.__enter__cCs|j��dSr1rwryr;r;r<r}bszStreamRecoder.__exit__)rE)r�)N)N)r)rCr>r?rD�
data_encoding�
file_encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s$�


	

�
�rrEr�cCst|dk	rd|kr|d}t�|||�}|dkr2|Sz&t|�}t||j|j|�}||_|WS|���YnXdS)aq Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually be
        Unicode as well.

        Underlying encoded files are always opened in binary mode.
        The default file mode is 'r', meaning to open the file in read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to -1 which means that the default buffer size will
        be used.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    N�b)�builtinsrrrr8r7r�rx)�filename�moder�rJ�	buffering�file�info�srwr;r;r<rgs�cCsF|dkr|}t|�}t|�}t||j|j|j|j|�}||_||_|S)a� Return a wrapped version of file which provides transparent
        encoding translation.

        Data written to the wrapped file is decoded according
        to the given data_encoding and then encoded to the underlying
        file using file_encoding. The intermediate data type
        will usually be Unicode but depends on the specified codecs.

        Bytes read from the file are decoded using file_encoding and then
        passed back to the caller encoded using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    N)rrr#r$r8r7r�r�)r�r�r�rJ�	data_info�	file_info�srr;r;r<r�s�cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr#�r�r;r;r<r�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr$r�r;r;r<r�scCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalEncoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental encoder.

    N)rr5�LookupError)r��encoderr;r;r<r�s	
cCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalDecoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental decoder.

    N)rr6r�)r��decoderr;r;r<r �s	
cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr8r�r;r;r<r!�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr7r�r;r;r<r"�scksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Encoding iterator.

    Encodes the input strings from the iterator using an IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
    rKTN)rr#)�iteratorr�rJ�kwargsr�rI�outputr;r;r<r%s	
cksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Decoding iterator.

    Decodes the input strings from the iterator using an IncrementalDecoder.

    errors and kwargs are passed through to the IncrementalDecoder
    constructor.
    r`TN)r r$)r�r�rJr�r�rIr�r;r;r<r&s	
cCsdd�|D�S)z� make_identity_dict(rng) -> dict

        Return a dictionary where elements of the rng sequence are
        mapped to themselves.

    cSsi|]
}||�qSr;r;)�.0�ir;r;r<�
<dictcomp>/sz&make_identity_dict.<locals>.<dictcomp>r;)�rngr;r;r<�make_identity_dict'sr�cCs4i}|��D]"\}}||kr&|||<qd||<q|S)a� Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \u001a.

    N)�items)�decoding_map�m�k�vr;r;r<�make_encoding_map1s


r��ignore�replace�xmlcharrefreplace�backslashreplace�namereplace�__main__zlatin-1zutf-8)r�NrEr�)NrE)rE)rE)<rDr��sys�_codecs�ImportErrorZwhy�SystemError�__all__rr	rrrrr�	byteorderrrrrr
r
rr2rrrgrrVrrarrrrrrrrrr r!r"r%r&r�r�r.r'r(r)r*r+r,r��_falseZ	encodingsrC�stdout�stdinr;r;r;r<�<module>s�	�
B("1+IzWt
0
&








hashlib.cpython-38.opt-1.pyc000064400000012457151450073350011561 0ustar00U

&�.e� �	@svdZdZee�Zee�ZedZddddddd	d
hZzddlmZ	Wne
k
r`d
d�Z	YnXe	�stiZdd�Zdd�Z
e	�s�ddd�Zddd�Zz ddlZeZe
Ze�ej�ZWn$e
k
r�e	�r΂eZeZYnXddlmZzddlmZWne
k
�rYnXeD]DZzee�e�e<Wn*ek
�rTddlZe�de�YnX�q[[[[[
e���sp[[	dS)a3hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
                                given hash function; initializing the hash
                                using the given binary data.

Named constructor functions are also available, these are faster
than using new(name):

md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(data): Update the hash object with the bytes in data. Repeated calls
                 are equivalent to a single call with the concatenation of all
                 the arguments.
 - digest():     Return the digest of the bytes passed to the update() method
                 so far as a bytes object.
 - hexdigest():  Like digest() except the digest is returned as a string
                 of double length, containing only hexadecimal digits.
 - copy():       Return a copy (clone) of the hash object. This can be used to
                 efficiently compute the digests of datas that share a common
                 initial substring.

For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update(b"Nobody inspects")
    >>> m.update(b" the spammish repetition")
    >>> m.digest()
    b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:

    >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

)�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512�	shake_128�	shake_256)�new�algorithms_guaranteed�algorithms_available�pbkdf2_hmacr	r
rrr
rrr�)�
get_fips_modecCsdS)Nr�rrr�/usr/lib64/python3.8/hashlib.py�_hashlib_get_fips_modeQsrc	Cs�t}|�|�}|dk	r|S�zB|dkrDddl}|j|d<|d<�n|dkrhddl}|j|d<|d<n�|dkr�ddl}|j|d	<|d
<|j|d<|d<n�|d
kr�ddl	}|j
|d<|d<|j|d<|d<n�|dkr�ddl}|j
|d<|j|d<nb|dk�r6ddl}|j|d<|j|d<|j|d<|j|d<n&|dk�r\ddl}|j|d<|j|d<Wntk
�rtYnX|�|�}|dk	�r�|Std|��dS)N>r�SHA1rrr>�MD5rrr>r�SHA224r�SHA256rrrr>r�SHA512�SHA384rrrrr>rrrr>rr	rr
r	r
rr>r
rr
rzunsupported hash type )�__builtin_constructor_cache�get�_sha1r�_md5r�_sha256rr�_sha512rr�_blake2rr�_sha3r	r
rrr
r�ImportError�
ValueError)	�name�cache�constructorr r!r"r#r$r%rrr�__get_builtin_constructorWsN









r+c	Cs^t�s|tkrt|�Sz"ttd|�}t��s4|�|WSttfk
rXt|�YSXdS)NZopenssl_)r�__block_openssl_constructorr+�getattr�_hashlibr�AttributeErrorr')r(�frrr�__get_openssl_constructor�sr1�cKst|�|f|�S)z�new(name, data=b'', **kwargs) - Return a new hashing object using the
        named algorithm; optionally initialized with data (which must be
        a bytes-like object).
        )r+�r(�data�kwargsrrr�__py_new�sr6cKsft��s |tkr t|�|f|�Sztj||f|�WStk
r`t��rL�t|�|f|�YSXdS)z�new(name, data=b'') - Return a new hashing object using the named algorithm;
    optionally initialized with data (which must be a bytes-like object).
    N)r.rr,r+rr'r3rrr�
__hash_new�sr7N)r)�scryptzcode for hash %s was not found.)r2)r2)�__doc__Z__always_supported�setrr�__all__r,r.rrr&rr+r1r6r7rZ
__get_hash�unionZopenssl_md_meth_namesrr8Z__func_name�globalsr'ZloggingZ	exceptionrrrr�<module>sh5�,

�

difflib.cpython-38.opt-2.pyc000064400000060533151450073350011545 0ustar00U

e5dZH�@s4dddddddddd	d
dgZdd
lmZddlmZedd�Zdd�ZGdd�d�Z	d7dd�Z
dd�ZGdd�d�Zddl
Z
e
�d�jfdd�Zd8dd�Zdd�Zd9d"d�Zd#d$�Zd:d%d�Zd&d'�Zd;d*d	�Zdefd+d�Zddefd,d-�Zd.Zd/Zd0Zd1ZGd2d
�d
e�Z[
d3d�Z d4d5�Z!e"d6k�r0e!�dS)<�get_close_matches�ndiff�restore�SequenceMatcher�Differ�IS_CHARACTER_JUNK�IS_LINE_JUNK�context_diff�unified_diff�
diff_bytes�HtmlDiff�Match�)�nlargest)�
namedtupleza b sizecCs|rd||SdS)Ng@��?�)�matches�lengthrr�/usr/lib64/python3.8/difflib.py�_calculate_ratio&src@speZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�ZdS)rN�TcCs(||_d|_|_||_|�||�dS�N)�isjunk�a�b�autojunk�set_seqs)�selfrrrrrrr�__init__�s;zSequenceMatcher.__init__cCs|�|�|�|�dSr)�set_seq1�set_seq2)rrrrrrr�s	
zSequenceMatcher.set_seqscCs$||jkrdS||_d|_|_dSr)r�matching_blocks�opcodes)rrrrrr�s
zSequenceMatcher.set_seq1cCs2||jkrdS||_d|_|_d|_|��dSr)rr!r"�
fullbcount�_SequenceMatcher__chain_b)rrrrrr �s
zSequenceMatcher.set_seq2cCs�|j}i|_}t|�D]\}}|�|g�}|�|�qt�|_}|j}|r~|��D]}||�rV|�	|�qV|D]
}||=qrt�|_
}t|�}	|jr�|	dkr�|	dd}
|�
�D]\}}t|�|
kr�|�	|�q�|D]
}||=q�dS)N���d�)r�b2j�	enumerate�
setdefault�append�set�bjunkr�keys�addZbpopular�lenr�items)rrr(�i�elt�indicesZjunkrZpopular�nZntestZidxsrrrZ	__chain_b)s,
zSequenceMatcher.__chain_bcCs4|j|j|j|jjf\}}}}||d}	}
}i}g}
t||�D]�}|j}i}|�|||
�D]\}||krlq^||krxq�||dd�d}||<||kr^||d||d|}	}
}q^|}q@|	|k�r |
|k�r |||
d��s ||	d||
dk�r |	d|
d|d}	}
}q�|	||k�rt|
||k�rt|||
|��st||	|||
|k�rt|d7}�q |	|k�r�|
|k�r�|||
d��r�||	d||
dk�r�|	d|
d|d}	}
}�qt|	||k�r(|
||k�r(|||
|��r(||	|||
|k�r(|d}�q�t|	|
|�S�Nr
r')rrr(r-�__contains__�range�getr)r�alo�ahi�blo�bhirrr(ZisbjunkZbestiZbestjZbestsizeZj2lenZnothingr2Zj2lengetZnewj2len�j�krrr�find_longest_matchPsR8"����	�� ��z"SequenceMatcher.find_longest_matchcCs||jdk	r|jSt|j�t|j�}}d|d|fg}g}|r�|��\}}}}|�||||�\}	}
}}|r8|�|�||	kr�||
kr�|�||	||
f�|	||kr8|
||kr8|�|	|||
||f�q8|��d}
}}g}|D]V\}}}|
||k�r|||k�r||7}q�|�r,|�|
||f�|||}
}}q�|�rT|�|
||f�|�||df�tt	t
j|��|_|jS�Nr
)r!r0rr�popr@r+�sort�list�mapr�_make)r�la�lbZqueuer!r:r;r<r=r2r>r?�x�i1�j1Zk1Znon_adjacent�i2�j2Zk2rrr�get_matching_blocks�s8


z#SequenceMatcher.get_matching_blockscCs�|jdk	r|jSd}}g|_}|��D]�\}}}d}||krN||krNd}n||kr\d}n||krhd}|r�|�|||||f�||||}}|r*|�d||||f�q*|S)Nr
r�replace�delete�insert�equal)r"rNr+)rr2r>Zanswer�ai�bj�size�tagrrr�get_opcodess$

zSequenceMatcher.get_opcodes�c
csn|��}|sdg}|dddkrZ|d\}}}}}|t|||�|t|||�|f|d<|dddkr�|d\}}}}}||t|||�|t|||�f|d<||}g}	|D]�\}}}}}|dk�r(|||k�r(|	�||t|||�|t|||�f�|	Vg}	t|||�t|||�}}|	�|||||f�q�|	�rjt|	�dk�rd|	dddk�sj|	VdS)N)rRr
r'r
r'r
rR���r')rW�max�minr+r0)
rr5ZcodesrVrJrLrKrMZnn�grouprrr�get_grouped_opcodes<s(&&(&z#SequenceMatcher.get_grouped_opcodescCs0tdd�|��D��}t|t|j�t|j��S)Ncss|]}|dVqdS)rYNr)�.0Ztriplerrr�	<genexpr>�sz(SequenceMatcher.ratio.<locals>.<genexpr>)�sumrNrr0rr)rrrrr�rationszSequenceMatcher.ratiocCs�|jdkr4i|_}|jD]}|�|d�d||<q|j}i}|jd}}|jD]>}||�rf||}n|�|d�}|d||<|dkrP|d}qPt|t|j�t|j��Sr6)r#rr9r7rrr0)rr#r3ZavailZavailhasrZnumbrrr�quick_ratio�s






zSequenceMatcher.quick_ratiocCs*t|j�t|j�}}tt||�||�Sr)r0rrrr[)rrGrHrrr�real_quick_ratio�sz SequenceMatcher.real_quick_ratio)NrrT)rX)�__name__�
__module__�__qualname__rrrr r$r@rNrWr]rarbrcrrrrr+sl
@,'nG7
2rX�333333�?cCs�|dkstd|f��d|kr*dks:ntd|f��g}t�}|�|�|D]D}|�|�|��|krR|��|krR|��|krR|�|��|f�qRt||�}dd�|D�S)Nr
zn must be > 0: %rgrz cutoff must be in [0.0, 1.0]: %rcSsg|]\}}|�qSrr)r^ZscorerIrrr�
<listcomp>�sz%get_close_matches.<locals>.<listcomp>)	�
ValueErrorrr rrcrbrar+�	_nlargest)ZwordZ
possibilitiesr5�cutoff�result�srIrrrr�s"


�
�
cCsd�dd�t||�D��S)Nrcss*|]"\}}|dkr|��r|n|VqdS)� N)�isspace)r^�cZtag_crrrr_�s�z$_keep_original_ws.<locals>.<genexpr>)�join�zip)rmZtag_srrr�_keep_original_ws�s
�rsc@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)rNcCs||_||_dSr��linejunk�charjunk)rrurvrrrrHszDiffer.__init__c
	cs�t|j||�}|��D]�\}}}}}|dkrB|�||||||�}	n\|dkr\|�d|||�}	nB|dkrv|�d|||�}	n(|dkr�|�d|||�}	ntd|f��|	EdHqdS)	NrOrP�-rQ�+rRrn�unknown tag %r)rrurW�_fancy_replace�_dumpri)
rrr�cruncherrVr:r;r<r=�grrr�compare_szDiffer.compareccs&t||�D]}d|||fVq
dS)Nz%s %s)r8)rrVrI�lo�hir2rrrr{�szDiffer._dumpc
csn||||kr2|�d|||�}|�d|||�}n |�d|||�}|�d|||�}||fD]}	|	EdHqZdS)Nrxrw)r{)
rrr:r;rr<r=�first�secondr}rrr�_plain_replace�szDiffer._plain_replaceccs:d\}}t|j�}	d\}
}t||�D]�}||}
|	�|
�t||�D]j}||}||
krl|
dkrD||}
}qD|	�|�|	��|krD|	��|krD|	��|krD|	��||}}}qDq$||kr�|
dkr�|�||||||�EdHdS|
|d}}}nd}
|�	||||||�EdH||||}}|
dk�r
d}}|	�
||�|	��D]�\}}}}}||||}}|dk�r�|d|7}|d|7}nb|dk�r�|d|7}nJ|d	k�r�|d
|7}n2|dk�r�|d|7}|d|7}ntd
|f���qH|�
||||�EdHn
d|V|�	||d|||d|�EdHdS)N)g�G�z��?g�?)NNrrrO�^rPrwrQrxrRrnry�  r')rrvr8r rrcrbrar��
_fancy_helperrrWri�_qformat)rrr:r;rr<r=Z
best_ratiorkr|ZeqiZeqjr>rTr2rSZbest_iZbest_jZaeltZbelt�atags�btagsrVZai1Zai2Zbj1Zbj2rGrHrrrrz�s\




�
�





zDiffer._fancy_replaceccsbg}||kr<||kr*|�||||||�}qT|�d|||�}n||krT|�d|||�}|EdHdS)Nrwrx)rzr{)rrr:r;rr<r=r}rrrr��szDiffer._fancy_helperccsXt||���}t||���}d|V|r8d|�d�Vd|V|rTd|�d�VdS)N�- z? �
�+ )rs�rstrip)rZalineZbliner�r�rrrr�s

zDiffer._qformat)NN)
rdrerfrr~r{r�rzr�r�rrrrr�s^
)^Nz
\s*(?:#\s*)?$cCs||�dk	Srr)�lineZpatrrrr3s� 	cCs||kSrr)ZchZwsrrrrCscCs:|d}||}|dkr"d�|�S|s.|d8}d�||�S�Nr'z{}z{},{}��format��start�stopZ	beginningrrrr�_format_range_unifiedZs
r�rr�ccsPt|||||||�d}td||��|�D�]}	|s|d}|rFd�|�nd}
|rXd�|�nd}d�||
|�Vd�|||�V|	d|	d}}
t|d	|
d
�}t|d|
d�}d
�|||�V|	D]�\}}}}}|dkr�|||�D]}d|Vq�q�|dk�r"|||�D]}d|V�q|dkr�|||�D]}d|V�q6q�q*dS)NFT�	{}r�
--- {}{}{}z
+++ {}{}{}r
rYr'�rX�z@@ -{} +{} @@{}rRrn>rPrOrw>rOrQrx)�_check_typesrr]r�r�)rr�fromfile�tofile�fromfiledate�
tofiledater5�lineterm�startedr\�fromdate�todater��last�file1_range�file2_rangerVrJrLrKrMr�rrrr	es0)
cCsB|d}||}|s|d8}|dkr.d�|�Sd�|||d�Sr�r�r�rrr�_format_range_context�s
r�ccs�t|||||||�tddddd�}d}	td||��|�D�]R}
|	s�d}	|rVd�|�nd	}|rhd�|�nd	}d
�|||�Vd�|||�V|
d|
d
}
}d|Vt|
d|d�}d�||�Vtdd�|
D���r|
D]8\}}}}}|dkr�|||�D]}|||V�qq�t|
d|d�}d�||�Vtdd�|
D��r:|
D]<\}}}}}|dk�rP|||�D]}|||V�qt�qPq:dS)Nr�r�z! r�)rQrPrOrRFTr�rz
*** {}{}{}r�r
rYz***************r'r�z
*** {} ****{}css |]\}}}}}|dkVqdS)>rPrONr�r^rV�_rrrr_�szcontext_diff.<locals>.<genexpr>rQrXr�z
--- {} ----{}css |]\}}}}}|dkVqdS)>rOrQNrr�rrrr_srP)r��dictrr]r�r��any)rrr�r�r�r�r5r��prefixr�r\r�r�r�r�r�rVrJrLr�r�r�rKrMrrrr�s4,

cGs�|r0t|dt�s0tdt|d�j|df��|r`t|dt�s`tdt|d�j|df��|D]}t|t�sdtd|f��qddS)Nr
z)lines to compare must be str, not %s (%r)z"all arguments must be str, not: %r)�
isinstance�str�	TypeError�typerd)rr�args�argrrrr�s��
r���
c		cs~dd�}	tt|	|��}tt|	|��}|	|�}|	|�}|	|�}|	|�}|	|�}|||||||||�}
|
D]}|�dd�VqfdS)Nc
SsRz|�dd�WStk
rL}z dt|�j|f}t|�|�W5d}~XYnXdS)N�ascii�surrogateescapez(all arguments must be bytes, not %s (%r))�decode�AttributeErrorr�rdr�)rm�err�msgrrrr�"s�zdiff_bytes.<locals>.decoder�r�)rDrE�encode)Zdfuncrrr�r�r�r�r5r�r��linesr�rrrr
scCst||��||�Sr)rr~)rrrurvrrrr5s#c#s�ddl}|�d��t||||��ddgf�fdd�	���fdd���fdd�}|�}|dkrj|EdH�n|d	7}d}ddg|}	}
d
}|d
kr�zt|�\}}
}Wntk
r�YdSX|	|}||
|f|
|<|	d	7}	q�|	|kr�dV|}n|	}d}	|�r"|	|}|	d	7}	|
|V|d	8}q�|d	}z@|�rht|�\}}
}|�rP|d	}n|d	8}||
|fV�q,Wqvtk
�r�YdSXqvdS)Nr
z
(\++|\-+|\^+)cs�||d7<|dkr2|||�d�dd�fS|dkr�|�d�|�d�}}g}|fdd�}��||�t|�D]<\}\}	}
|d|	�d|||	|
�d||
d�}qt|dd�}n*|�d�dd�}|s�d	}d||d}|||fS)
Nr'r
r��?cSs&|�|�d�d|��g�|�d�S)Nr'r
)r+r\�span)Zmatch_object�sub_inforrr�record_sub_info�sz3_mdiff.<locals>._make_line.<locals>.record_sub_info��rn)rB�sub�reversed)r�Z
format_key�sideZ	num_lines�textZmarkersr�r��keyZbegin�end)�	change_rerr�
_make_line�s 2z_mdiff.<locals>._make_linec3sng}d\}}t|�dkr*|�t�d��qd�dd�|D��}|�d�rP|}�n�|�d�r|�|dd	��|dd
�dfVq�n�|�d�r�|d
8}�|d
d	�ddfVq�nl|�d�rֈ|d
d	�d}}|d
d	}}�n>|�d��r�|dd	��|dd
�dfVq�n|�d��r0�|dd	��|dd
�dfVqn�|�d
��r\|d
8}�|d
d	�ddfVqn�|�d��r�|d
7}d�|dd
�dfVqn�|�d��r�d�|dd
�}}|d
d	}}n^|�d��r�|d
7}d�|dd
�dfVqn2|�d��r�|dd�dd	��|dd
�dfVq|d	k�r0|d
7}dV�q|d	k�rL|d
8}dV�q0|�d��r\dS||dfVqdS)N)r
r
r��XrcSsg|]}|d�qS)r
r�r^r�rrrrh�sz2_mdiff.<locals>._line_iterator.<locals>.<listcomp>z-?+?r�r
r'Tz--++rw)z--?+z--+r�z-+?z-?+z+--rx)r�z+-rnF)N�rr�T)r�NT)r0r+�nextrq�
startswith)r�Znum_blanks_pendingZnum_blanks_to_yieldrm�	from_line�to_line)r��diff_lines_iteratorrr�_line_iterator�sd



$



z_mdiff.<locals>._line_iteratorc3s���}gg}}t|�dks(t|�dkr�zt|�\}}}Wntk
rPYdSX|dk	rh|�||f�|dk	r|�||f�q|�d�\}}|�d�\}}|||p�|fVqdSrA)r0r��
StopIterationr+rB)Z
line_iterator�	fromlines�tolinesr�r��
found_diffZfromDiffZto_diff)r�rr�_line_pair_iterators

z#_mdiff.<locals>._line_pair_iteratorr'F)NNN)�re�compilerr�r�)r�r��contextrurvr�r�Zline_pair_iteratorZlines_to_write�indexZcontextLinesr�r�r�r2r)r�r�r�r�r�_mdiffZsR"
8X!



r�an
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>aH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}aZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>a�
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>c@s�eZdZeZeZeZeZdZdddefdd�Z	dd	d
�dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zddd�ZdS)rr
�NcCs||_||_||_||_dSr)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r�tabsizeZ
wrapcolumnrurvrrrr�szHtmlDiff.__init__rF�zutf-8)�charsetcCs:|jt|j|j|j||||||d�|d��|d��|�S)N)r��numlines)ZstylesZlegend�tabler��xmlcharrefreplace)�_file_templater��_styles�_legend�
make_tabler�r�)rr�r��fromdesc�todescr�r�r�rrr�	make_file�s����zHtmlDiff.make_filecs8�fdd���fdd�|D�}�fdd�|D�}||fS)Ncs6|�dd�}|��j�}|�dd�}|�dd��d�S)Nrnr��	r�)rO�
expandtabsr�r�)r�)rrr�expand_tabs�sz2HtmlDiff._tab_newline_replace.<locals>.expand_tabscsg|]}�|��qSrrr��r�rrrh�sz1HtmlDiff._tab_newline_replace.<locals>.<listcomp>csg|]}�|��qSrrr�r�rrrh�sr)rr�r�r)r�rr�_tab_newline_replace�s
	zHtmlDiff._tab_newline_replacecCs|s|�||f�dSt|�}|j}||ksB||�d�d|krT|�||f�dSd}d}d}||kr�||kr�||dkr�|d7}||}|d7}q`||dkr�|d7}d}q`|d7}|d7}q`|d|�}	||d�}
|r�|	d}	d||
}
|�||	f�|�|d|
�dS)Nr�rXr
rr'r��>)r+r0r��count�_split_line)rZ	data_listZline_numr�rUrZr2r5ZmarkZline1Zline2rrrr��s8


zHtmlDiff._split_lineccs�|D]�\}}}|dkr$|||fVq||\}}\}}gg}	}
|�|	||�|�|
||�|	sd|
r|	rt|	�d�}nd}|
r�|
�d�}nd}|||fVq\qdS)Nr
)rrn)r�rB)r�diffs�fromdata�todata�flagZfromlineZfromtextZtolineZtotext�fromlist�tolistrrr�
_line_wrapper0s 
zHtmlDiff._line_wrapperc	Cs�ggg}}}|D]r\}}}z4|�|jd|f|���|�|jd|f|���Wn(tk
rz|�d�|�d�YnX|�|�q|||fSr6)r+�_format_liner�)rr�r�r��flaglistr�r�r�rrr�_collect_linesLs
zHtmlDiff._collect_linescCsrzd|}d|j||f}Wntk
r6d}YnX|�dd��dd��dd	�}|�d
d���}d|||fS)
Nz%dz
 id="%s%s"r�&z&amp;r�z&gt;�<z&lt;rn�&nbsp;z<<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>)�_prefixr�rOr�)rr�r�Zlinenumr��idrrrr�as
�zHtmlDiff._format_linecCs0dtj}dtj}tjd7_||g|_dS)Nzfrom%d_zto%d_r')r�_default_prefixr)rZ
fromprefix�toprefixrrr�_make_prefixxs

zHtmlDiff._make_prefixcCs�|jd}dgt|�}dgt|�}d\}	}
d}t|�D]V\}}
|
r�|
s�d}
|}td||g�}d||	f||<|	d7}	d||	f||<q:d}
q:|s�dg}dg}dg}d}|r�d	g}|}n
d
g}}|ds�d||d<d|||<|||||fS)
Nr'r)r
Fr
Tz id="difflib_chg_%s_%d"z"<a href="#difflib_chg_%s_%d">n</a>Fz2<td></td><td>&nbsp;No Differences Found&nbsp;</td>z(<td></td><td>&nbsp;Empty File&nbsp;</td>z!<a href="#difflib_chg_%s_0">f</a>z#<a href="#difflib_chg_%s_top">t</a>)rr0r)rZ)rr�r�rr�r�r�next_id�	next_hrefZnum_chgZ	in_changer�r2r�rrr�_convert_flags�s>
�
zHtmlDiff._convert_flagsc
CsR|��|�||�\}}|r"|}nd}t||||j|jd�}|jrL|�|�}|�|�\}	}
}|�|	|
|||�\}	}
}}}
g}d}t	t
|��D]P}||dkr�|dkr�|�d�q�|�||
||||	||||
|f�q�|s�|�rddd|dd|f}nd}|jt
d�|�||jd	d
�}|�dd��d
d��dd��dd��dd�S)NrtzV            <tr><td class="diff_next"%s>%s</td>%s<td class="diff_next">%s</td>%s</tr>
r
z)        </tbody>        
        <tbody>
z <thead><tr>%s%s%s%s</tr></thead>z!<th class="diff_next"><br /></th>z+<th colspan="2" class="diff_header">%s</th>rr')Z	data_rows�
header_rowr�z+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r�z</span>r�r)r	r�r�r�r�r�r�rrr8r0r+�_table_templater�rqrrO)rr�r�r�r�r�r�Z
context_linesr�r�r�rrr
rmZfmtr2r
r�rrrr��sl�
��

������zHtmlDiff.make_table)rrFr�)rrFr�)rdrerfr�r�rr�rrrr�r�r�r�rr�r	rr�rrrrr�s0�
��7/�ccsnzddd�t|�}Wn"tk
r8td|�d�YnXd|f}|D]"}|dd�|krF|dd�VqFdS)Nr�r�)r'r�z)unknown delta choice (must be 1 or 2): %rr�r�)�int�KeyErrorri)ZdeltaZwhichrV�prefixesr�rrrrs��cCsddl}ddl}|�|�SrA)�doctest�difflibZtestmod)rrrrr�_test!sr�__main__)rXrg)r�)rrrrrXr�)rrrrrXr�)r�r�r�r�rXr�)#�__all__�heapqrrj�collectionsrZ_namedtuplerrrrrsrr�r��matchrrr�r	r�rr�r
rr�r�r�rr��objectrrrrdrrrr�<module>s��


1	I
�
I�
L�
%�
	
a 
filecmp.cpython-38.pyc000064400000020355151450073350010623 0ustar00U

e5df&�@s�dZddlZddlZddlmZdddddgZiZd	Zd
ddd
ddddgZdd�Z	d"dd�Z
dd�Zdd�ZGdd�d�Z
d#dd�Zee
fdd�Zdd�Zdd �Zed!kr�e�dS)$z�Utilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=True) -> int
    cmpfiles(a, b, common) -> ([], [], [])
    clear_cache()

�N)�filterfalse�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCst��dS)zClear the filecmp cache.N)�_cache�clear�rr�/usr/lib64/python3.8/filecmp.pyrsTcCs�tt�|��}tt�|��}|dtjks8|dtjkr<dS|rL||krLdS|d|dkr`dSt�||||f�}|dkr�t||�}tt�dkr�t�|t||||f<|S)a�Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to True.

    Return value:

    True if the files are the same, False otherwise.

    This function uses a cache for past comparisons and the results,
    with cache entries invalidated if their stat information
    changes.  The cache may be cleared by calling clear_cache().

    rFT�N�d)	�_sig�os�stat�S_IFREGr	�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomerrrrs
cCst�|j�|j|jfS�N)r�S_IFMT�st_mode�st_size�st_mtime)�strrrrDs
�rc
Cs�t}t|d��n}t|d��X}|�|�}|�|�}||krPW5QR�W5QR�dS|sW5QR�W5QR�dSqW5QRXW5QRXdS)N�rbFT)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2rrrrIs

rc@s�eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
ee	eeeeeeeeeeed�Zdd�ZdS)raMA class that manages the comparison of 2 directories.

    dircmp(a, b, ignore=None, hide=None)
      A and B are directories.
      IGNORE is a list of names to ignore,
        defaults to DEFAULT_IGNORES.
      HIDE is a list of names to hide,
        defaults to [os.curdir, os.pardir].

    High level usage:
      x = dircmp(dir1, dir2)
      x.report() -> prints a report on the differences between dir1 and dir2
       or
      x.report_partial_closure() -> prints report on differences between dir1
            and dir2, and reports on common immediate subdirectories.
      x.report_full_closure() -> like report_partial_closure,
            but fully recursive.

    Attributes:
     left_list, right_list: The files in dir1 and dir2,
        filtered by hide and ignore.
     common: a list of names in both dir1 and dir2.
     left_only, right_only: names only in dir1, dir2.
     common_dirs: subdirectories in both dir1 and dir2.
     common_files: files in both dir1 and dir2.
     common_funny: names in both dir1 and dir2 where the type differs between
        dir1 and dir2, or the name is not stat-able.
     same_files: list of identical files.
     diff_files: list of filenames which differ.
     funny_files: list of files which could not be compared.
     subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.
     NcCsD||_||_|dkr$tjtjg|_n||_|dkr:t|_n||_dSr)�left�rightr�curdir�pardir�hider�ignore)�self�a�br-r,rrr�__init__xszdircmp.__init__cCsPtt�|j�|j|j�|_tt�|j�|j|j�|_|j�	�|j�	�dSr)
�_filterr�listdirr(r,r-�	left_listr)�
right_list�sort�r.rrr�phase0�s
�
�
z
dircmp.phase0cCs�ttttjj|j�|j��}ttttjj|j�|j��}tt|j	t
|j|���|_tt|j	t
|j|���|_tt|j	t
|j|���|_dSr)�dict�zip�mapr�path�normcaser4r5�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r.r/r0rrr�phase1�s
z
dircmp.phase1c
Cs4g|_g|_g|_|jD�]}tj�|j|�}tj�|j|�}d}zt�	|�}Wn&t
k
rv}zd}W5d}~XYnXzt�	|�}Wn&t
k
r�}zd}W5d}~XYnX|�r"t	�|j�}t	�|j�}	||	kr�|j�
|�n>t	�|�r�|j�
|�n&t	�|��r|j�
|�n|j�
|�q|j�
|�qdS)Nr
r)�common_dirs�common_files�common_funnyrBrr<�joinr(r)r�OSErrorrr�append�S_ISDIR�S_ISREG)
r.�xZa_pathZb_path�okZa_statZwhyZb_statZa_typeZb_typerrr�phase2�s4
z
dircmp.phase2cCs&t|j|j|j�}|\|_|_|_dSr)rr(r)rG�
same_files�
diff_files�funny_files)r.Zxxrrr�phase3�sz
dircmp.phase3cCsNi|_|jD]<}tj�|j|�}tj�|j|�}t|||j|j	�|j|<qdSr)
�subdirsrFrr<rIr(r)rr-r,)r.rNZa_xZb_xrrr�phase4�s

z
dircmp.phase4cCs$|��|j��D]}|��qdSr)rVrU�values�phase4_closure�r.ZsdrrrrX�szdircmp.phase4_closurecCs�td|j|j�|jr2|j��td|jd|j�|jrT|j��td|jd|j�|jrp|j��td|j�|jr�|j��td|j�|jr�|j��td|j�|j	r�|j	��td|j	�|j
r�|j
��td|j
�dS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr(r)rCr6rDrQrRrSrFrHr7rrr�report�s,






z
dircmp.reportcCs*|��|j��D]}t�|��qdSr)r\rUrWr[rYrrr�report_partial_closure�szdircmp.report_partial_closurecCs*|��|j��D]}t�|��qdSr)r\rUrWr[�report_full_closurerYrrrr^�szdircmp.report_full_closure)rUrQrRrSrFrGrHrBrCrDr4r5cCs*||jkrt|��|j||�t||�Sr)�	methodmap�AttributeError�getattr)r.�attrrrr�__getattr__�s
zdircmp.__getattr__)NN)�__name__�
__module__�__qualname__�__doc__r1r8rErPrTrVrXr\r]r^r9r_rcrrrrrVs2!
#
�cCsJgggf}|D]6}tj�||�}tj�||�}|t|||��|�q|S)a]Compare common files in two directories.

    a, b -- directory names
    common -- list of file names found in both directories
    shallow -- if true, do comparison based solely on stat() information

    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.

    )rr<rI�_cmprK)r/r0rBr�resrNZaxZbxrrrr�s
cCs0z|||||��WStk
r*YdSXdS)N�)rJ)r/r0Zsh�absrrrrrhsrhcCstt|j|��Sr)r>rrA)Zflist�skiprrrr2sr2cCsrddl}ddl}|�|jdd�d�\}}t|�dkrB|�dd��t|d|d�}d|krf|��n|��dS)Nrr
�rrjzneed exactly two args)z-r�)�sys�getopt�argvrZGetoptErrorrr^r\)rorpZoptions�argsZddrrr�demo$s
rs�__main__)T)T)rgrr�	itertoolsr�__all__r	r"rrrrrrrrkrhr2rsrdrrrr�<module>s6�
'
%
	pdb.cpython-38.opt-1.pyc000064400000134105151450073350010707 0ustar00U

e5d��"@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZGdd�de�Zddddd	d
ddd
g	Zdd�Zdd�Zdd�ZGdd�de�ZdZGdd�dejej�Zedk	�rnd
ddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7g"ZeD]"Zeeed8e�j��d97Z�q:eej j7Z[[dJd:d�Z!dKd;d�Z"d<d	�Z#d=d
�Z$dd>�d?d�Z%dLd@d�Z&dAd�Z'dBZ(dCdD�Z)dEd
�Z*dFZ+dGdH�Z,e-dIk�r�ddl.Z.e.�,�dS)Ma�	
The Python Debugger Pdb
=======================

To use the debugger in its simplest form:

        >>> import pdb
        >>> pdb.run('<a statement>')

The debugger's prompt is '(Pdb) '.  This will stop in the first
function call in <a statement>.

Alternatively, if a statement terminated with an unhandled exception,
you can use pdb's post-mortem facility to inspect the contents of the
traceback:

        >>> <a statement>
        <exception traceback>
        >>> import pdb
        >>> pdb.pm()

The commands recognized by the debugger are listed in the next
section.  Most can be abbreviated as indicated; e.g., h(elp) means
that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
nor as 'H' or 'Help' or 'HELP').  Optional arguments are enclosed in
square brackets.  Alternatives in the command syntax are separated
by a vertical bar (|).

A blank line repeats the previous command literally, except for
'list', where it lists the next 11 lines.

Commands that the debugger doesn't recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ('!').  This is a powerful way to inspect the program being
debugged; it is even possible to change variables or call functions.
When an exception occurs in such a statement, the exception name is
printed but the debugger's state is not changed.

The debugger supports aliases, which can save typing.  And aliases can
have parameters (see the alias help entry) which allows one a certain
level of adaptability to the context under examination.

Multiple commands may be entered on a single line, separated by the
pair ';;'.  No intelligence is applied to separating the commands; the
input is split at the first ';;', even if it is in the middle of a
quoted string.

If a file ".pdbrc" exists in your home directory or in the current
directory, it is read in and executed as if it had been typed at the
debugger prompt.  This is particularly useful for aliases.  If both
files exist, the one in the home directory is read first and aliases
defined there can be overridden by the local file.  This behavior can be
disabled by passing the "readrc=False" argument to the Pdb constructor.

Aside from aliases, the debugger is not directly programmable; but it
is implemented as a class from which you can derive your own debugger
class, which you can make as fancy as you like.


Debugger commands
=================

�Nc@seZdZdZdS)�RestartzBCauses a debugger to be restarted for the debugged python program.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pdb.pyrWsr�run�pm�Pdb�runeval�runctx�runcall�	set_trace�post_mortem�helpc
Cs�t�dt�|��}zt�|�}Wntk
r8YdSX|�@t|dd�D],\}}|�|�rL|||fW5QR�SqLW5QRXdS)Nzdef\s+%s\s*[(]�)�start)�re�compile�escape�tokenize�open�OSError�	enumerate�match)�funcname�filenameZcre�fp�lineno�linerrr�
find_function^s
&r!cCsXt�|�\}}t�|�r,|j|jkr,|dfSt�|�r>|dfSt�||d��|dfS)Nr)�inspectZ
findsourceZisframe�	f_globals�f_localsZismoduleZgetblock)�obj�linesrrrr�getsourcelinesks
r'cCs8tt�|��}|��|D]\}}||kr|SqdS�Nr)�list�disZfindlinestarts�reverse)�codeZlastiZ
linestarts�irrrr�lasti2linenots
r.c@seZdZdZdd�ZdS)�_rstrz#String that doesn't quote its repr.cCs|S�Nr��selfrrr�__repr__sz_rstr.__repr__N)rrrrr3rrrrr/}sr/z
-> c@seZdZdZd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZeZd�d8d9�Zd:d;�ZeZ eZ!eZ"d<d=�Z#eZ$d>d?�Z%d@dA�Z&dBdC�Z'eZ(dDdE�Z)eZ*dFdG�Z+eZ,dHdI�Z-eZ.dJdK�Z/e/Z0eZ1eZ2dLdM�Z3e3Z4e3Z5dNdO�Z6dPdQ�Z7e7Z8dRdS�Z9e9Z:dTdU�Z;e;Z<dVdW�Z=e=Z>dXdY�Z?e?Z@dZd[�ZAeAZBd\d]�ZCeCZDd^d_�ZEeEZFZGd`da�ZHeHZIdbdc�ZJeZKddde�ZLeLZMeLZNdfdg�ZOdhdi�ZPePZQdjdk�ZReRZSdldm�ZTd�dndo�ZUdpdq�ZVdrds�ZWeZXeZYeZZdtdu�Z[e[Z\dvdw�Z]e]Z^dxdy�Z_eZ`d�d{d|�Zad}d~�ZbeZcdd��ZdeZed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d�d�d�d�d�gZld�d��Zmenfd�d��Zod�d��ZpepZqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��ZvdS)�rN�tabFTc		Cs>tjj||d�tj�||||�t�d�|r6d|_d|_i|_	i|_
d|_d|_i|_
zddl}|�d�Wntk
r�YnXd|_||_g|_|�rz,ttj�d���}|j�|�W5QRXWntk
r�YnXz$td	��}|j�|�W5QRXWntk
�rYnXi|_i|_i|_d|_d|_dS)
N)�skipzpdb.Pdbrz(Pdb) �Fz 	
`@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)�bdb�Bdb�__init__�cmd�Cmd�sys�auditZuse_rawinput�prompt�aliases�
displaying�
mainpyfile�_wait_for_mainpyfile�	tb_lineno�readlineZset_completer_delims�ImportError�allow_kbdint�nosigint�rcLinesr�os�path�
expanduser�extendr�commands�commands_doprompt�commands_silent�commands_defining�
commands_bnum)	r2�completekey�stdin�stdoutr5rGZreadrcrDZrcFilerrrr9�sF

zPdb.__init__cCs*|jr
t�|�d�|��|�|�dS)Nz-
Program interrupted. (Use 'cont' to resume).)rF�KeyboardInterrupt�message�set_stepr)r2Zsignum�framerrr�sigint_handler�s

zPdb.sigint_handlercCstj�|�|��dSr0)r7r8�reset�forgetr1rrrrZ�sz	Pdb.resetcCs&d|_g|_d|_d|_|j��dSr()r�stack�curindex�curframerC�clearr1rrrr[�s
z
Pdb.forgetcCsh|��|�||�\|_|_|rDt|jj|j�}||j|j<|j	}q|j|jd|_
|j
j|_|�
�Sr()r[Z	get_stackr\r]r.�tb_frame�f_code�tb_lastirC�tb_nextr^r$�curframe_locals�execRcLines)r2�f�tbrrrr�setup�s
z	Pdb.setupcCsd|js
dS|j}|��g|_|r`|����}|r|ddkr|�|�r|jt|�7_dSqdS)Nr�#T)rHr+�pop�strip�onecmd�reversed)r2rHr rrrre�s
zPdb.execRcLinescCs.|jr
dS|�|�r*|�d�|�|d�dS)znThis method is called when there is the remote possibility
        that we ever need to stop in this function.Nz--Call--)rBZ	stop_hererV�interaction)r2rXZ
argument_listrrr�	user_call�s


z
Pdb.user_callcCsH|jr.|j|�|jj�ks$|jdkr(dSd|_|�|�rD|�|d�dS)z;This function is called when we stop or break at this line.rNF)rBrA�canonicra�co_filename�f_lineno�bp_commandsrn)r2rXrrr�	user_line�s�
z
Pdb.user_linecCs�t|dd�r�|j|jkr�|j}d|_|j}|�|d�|j|D]}|�|�q@||_|j|sr|�|j|j	�|j
|r�|��|��dSdS)z�Call every command that was set for the current active breakpoint
        (if there is one).

        Returns True if the normal interaction function must be called,
        False otherwise.�	currentbpFrNr)
�getattrrurM�lastcmdrhrlrO�print_stack_entryr\r]rN�_cmdloopr[)r2rXruZlastcmd_backr rrrrss"
�

zPdb.bp_commandscCs.|jr
dS||jd<|�d�|�|d�dS)z7This function is called when a return trap is set here.N�
__return__z
--Return--)rBr$rVrn)r2rXZreturn_valuerrr�user_return s


zPdb.user_returncCsh|jr
dS|\}}}||f|jd<|s2|tkr2dnd}|�d|t�||�d��f�|�||�dS)zoThis function is called if an exception occurs,
        but only if we are to stop at or just below this level.NZ
__exception__z	Internal r6z%s%s���)rBr$�
StopIterationrV�	traceback�format_exception_onlyrkrn)r2rX�exc_info�exc_type�	exc_value�
exc_traceback�prefixrrr�user_exception(s
���zPdb.user_exceptioncCsBzd|_|��d|_Wq>Wqtk
r:|�d�YqXqdS)NTFz--KeyboardInterrupt--)rF�cmdlooprUrVr1rrrry<szPdb._cmdloopcCs^|j�|j�}|rZ|��D]>\}}|�|�}||k	r||kr|||<|�d|||f�qdS)Nzdisplay %s: %r  [old: %r])r@�getr^�items�_getval_exceptrV)r2r@�exprZoldvalueZnewvaluerrr�preloopIs
�zPdb.preloopcCsttjr6zt�tjtj�Wntk
r.YnXdt_|�||�rN|��dS|�|j|j	�|�
�|��dSr0)r�_previous_sigint_handler�signal�SIGINT�
ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVszPdb.interactioncCs|dk	r|�t|��dS)z{Custom displayhook for the exec in default(), which prevents
        assignment of the _ variable in the builtins.
        N)rV�repr)r2r%rrr�displayhookhszPdb.displayhookc	Cs�|dd�dkr|dd�}|j}|jj}zdt|ddd�}tj}tj}tj}z(|jt_|jt_|jt_t|||�W5|t_|t_|t_XWn4t�	�dd�}|�
tj|�d�
��YnXdS)Nr�!�
z<stdin>Zsingle�r|)rdr^r#rr<rTrSr��execr��errorr~rrk)	r2r �locals�globalsr,Zsave_stdoutZ
save_stdinZsave_displayhookr�rrr�defaultps(zPdb.defaultcCs�|��s|S|��}|d|jkr�|j|d}d}|dd�D] }|�dt|�|�}|d7}q@|�dd�|dd���}|��}q|ddkr�|�d�}|dkr�||d	d���}|j�	|�|d|��
�}|S)
z*Handle alias expansion and ';;' separator.rrN�%z%*� �aliasz;;r�)rk�splitr?�replace�str�join�find�lstrip�cmdqueue�append�rstrip)r2r �argsZiiZtmpArgZmarker�nextrrr�precmd�s(�


z
Pdb.precmdcCs"|jstj�||�S|�|�SdS)z�Interpret the argument as though it had been typed in response
        to the prompt.

        Checks whether this line is typed at the normal prompt or in
        a breakpoint command list definition.
        N)rPr:r;rl�handle_command_def)r2r rrrrl�sz
Pdb.onecmdcCs�|�|�\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf|�|d|�n
|�|�zt|d|�}Wntk
r�|j}YnX|j	|j
kr�d|j|j<g|_dSdS)	z8Handles one command line during command list definition.NZsilentT�endrr��do_F)Z	parselinerOrQr�rMr�rv�AttributeErrorr�r�commands_resumingrN)r2r r:�argZcmdlist�funcrrrr��s,
zPdb.handle_command_defcCst||jd�dS)N��file��printrT�r2�msgrrrrV�szPdb.messagecCstd||jd�dS)Nz***r�r�r�rrrr��sz	Pdb.errorcCs�|���d�rgSz|�||||�}Wntk
r>g}YnXt�t�|�d�}|D]H}tj�|�rx|�	|d�qXtj�
|�rX|���d�rX|�	|d�qX|S)N)�:�,�*�/)�.pyz.pywr�)rk�endswith�_complete_expression�	Exception�globrrIrJ�isdirr��isfile�lower)r2�textr �begidx�endidxZret�globs�fnrrr�_complete_location�s
zPdb._complete_locationcs�fdd�ttjj�D�S)Ncs.g|]&\}}|dk	rt|����rt|��qSr0)r��
startswith)�.0r-�bp�r�rr�
<listcomp>�s�z*Pdb._complete_bpnumber.<locals>.<listcomp>)rr7�
Breakpoint�
bpbynumber�r2r�r r�r�rr�r�_complete_bpnumber�szPdb._complete_bpnumberc	s�|js
gS|jj|j�}d�kr���d��z,|�d}�dd�D]}t||�}qDWnttfk
rrgYSXd��dd��d���fdd�t|�D�S�fdd�|�	�D�SdS)N�.rrr|cs"g|]}|��d�r�|�qS)r|�r��r��n)�dottedr�rrr�sz,Pdb._complete_expression.<locals>.<listcomp>csg|]}|���r|�qSrr�r�r�rrr�s
)
r^r#rdr�rv�KeyErrorr�r��dir�keys)r2r�r r�r��nsr%�partr)r�r�r�rr��s

zPdb._complete_expressioncCs,|sttjj�d}n&zt|�}Wn|�d�YdSX||_||jkrj|j||j||j	|f}nd}g|j|<d|j|<d|j	|<|j
}d|_
d|_zzz|��Wnht
k
�r|r�|d|j|<|d|j|<|d|j	|<n|j|=|j|=|j	|=|�d	�YnXW5d|_||_
XdS)
a4commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)

        Specify a list of commands for breakpoint number bpnumber.
        The commands themselves are entered on the following lines.
        Type a line containing just 'end' to terminate the commands.
        The commands are executed when the breakpoint is hit.

        To remove all commands from a breakpoint, type commands and
        follow it immediately with end; that is, give no commands.

        With no bpnumber argument, commands refers to the last
        breakpoint set.

        You can use breakpoint commands to start your program up
        again.  Simply use the continue command, or step, or any other
        command that resumes execution.

        Specifying any command resuming execution (currently continue,
        step, next, return, jump, quit and their abbreviations)
        terminates the command list (as if that command was
        immediately followed by end).  This is because any time you
        resume execution (even with a simple next or step), you may
        encounter another breakpoint -- which could have its own
        command list, leading to ambiguities about which list to
        execute.

        If you use the 'silent' command in the command list, the usual
        message about stopping at a breakpoint is not printed.  This
        may be desirable for breakpoints that are to print a specific
        message and then continue.  If none of the other commands
        print anything, you will see no sign that the breakpoint was
        reached.
        rz.Usage: commands [bnum]
        ...
        endNTFz(com) rr�z1command definition aborted, old commands restored)�lenr7r�r��intr�rQrMrNrOr>rPr�rU)r2r�ZbnumZold_command_defsZprompt_backrrr�do_commands	sB%

�


zPdb.do_commandsrc
CsB|s8|jr4|�d�tjjD]}|r|�|���qdSd}d}d}|�d�}|dkrz||dd���}|d|���}|�	d�}d}	|dk�r|d|���}|�
|�}
|
s�|�d|�dS|
}||dd���}zt|�}Wn&t
k
�r|�d|�YdSXn�zt|�}Wn�t
k
�r�zt||jj|j�}Wn|}YnXz.t|d	��rj|j}|j}|j}	|j}|j}WnD|�|�\}
}}|
�s�|�d
|�YYdS|
}	t|�}YnXYnX|�s�|��}|�||�}|�r>|�|||||	�}|�r|�|�n*|�||�d}|�d|j|j|jf�dS)
a�b(reak) [ ([filename:]lineno | function) [, condition] ]
        Without argument, list all breaks.

        With a line number argument, set a break at this line in the
        current file.  With a function name, set a break at the first
        executable line of that function.  If a second argument is
        present, it is a string specifying an expression which must
        evaluate to true before the breakpoint is honored.

        The line number may be prefixed with a filename and a colon,
        to specify a breakpoint in another file (probably one that
        hasn't been loaded yet).  The file is searched for on
        sys.path; the .py suffix may be omitted.
        z!Num Type         Disp Enb   WhereNr�rrr�z%r not found from sys.pathzBad lineno: %s�__func__zJThe specified object %r is not a function or was not found along sys.path.r|zBreakpoint %d at %s:%d) �breaksrVr7r�r�Zbpformatr�r�r��rfind�lookupmoduler�r�r��evalr^r#rd�hasattrr��__code__�co_name�co_firstlinenorq�lineinfo�defaultFile�	checklineZ	set_break�
get_breaks�numberr�r )r2r�Z	temporaryr�rr�condZcommaZcolonrrfr�r,�okZlnr �errrrr�do_breakXs�





�

��zPdb.do_breakcCs"|jjj}|dkr|jr|j}|S)zProduce a reasonable default.z<string>)r^rarqrA)r2rrrrr��s
zPdb.defaultFilecCs|�|d�dS)z�tbreak [ ([filename:]lineno | function) [, condition] ]
        Same arguments as break, but sets a temporary breakpoint: it
        is automatically deleted when first hit.
        rN)r��r2r�rrr�	do_tbreak�sz
Pdb.do_tbreakc
Cs�d}|�d�}t|�dkr(|d��}nt|�dkrB|d��}n|S|dkrR|S|�d�}|ddkr~|d=t|�dkr~|S|��}t|�dkr�|d}n|�|d�}|r�|}|d}t||�}	|	p�|S)	N)NNN�'rr�r6r�r2)r�r�rkr�r�r!)
r2Z
identifierZfailedZidstring�id�partsZfname�itemrfZanswerrrrr��s.



zPdb.lineinfocCs�t|d�r|jjnd}t�|||�}|s6|�d�dS|��}|rn|ddksn|dd�dksn|dd�dkr||�d	�dS|S)
z�Check whether specified line seems to be executable.

        Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
        line or EOF). Warning: testing is not comprehensive.
        r^NzEnd of filerrir�z"""z'''zBlank or comment)r�r^r#�	linecache�getlinerVrkr�)r2rrr�r rrrr��s
��
z
Pdb.checklinecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)z�enable bpnumber [bpnumber ...]
        Enables the breakpoints given as a space separated list of
        breakpoint numbers.
        Nz
Enabled %s)r��get_bpbynumberr�r��enablerV�r2r�r�r-r�r�rrr�	do_enablesz
Pdb.do_enablecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)aNdisable bpnumber [bpnumber ...]
        Disables the breakpoints given as a space separated list of
        breakpoint numbers.  Disabling a breakpoint means it cannot
        cause the program to stop execution, but unlike clearing a
        breakpoint, it remains in the list of breakpoints and can be
        (re-)enabled.
        NzDisabled %s)r�r�r�r��disablerVr�rrr�
do_disableszPdb.do_disablec
Cs�|�dd�}z|d}Wntk
r0d}YnXz|�|d���}WnHtk
rf|�d�YnXtk
r�}z|�|�W5d}~XYn.X||_|s�|�d|j�n|�d|j�dS)a#condition bpnumber [condition]
        Set a new condition for the breakpoint, an expression which
        must evaluate to true before the breakpoint is honored.  If
        condition is absent, any existing condition is removed; i.e.,
        the breakpoint is made unconditional.
        r�rNr�Breakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.)	r��
IndexErrorr�rkr�r�r�rVr�)r2r�r�r�r�r�rrr�do_condition%s
zPdb.do_conditionc
Cs�|��}zt|d���}Wnd}YnXz|�|d���}WnHtk
rb|�d�Ynvtk
r�}z|�|�W5d}~XYnLX||_|dkr�|dkr�d|}nd}|�d||j	f�n|�d|j	�dS)	a�ignore bpnumber [count]
        Set the ignore count for the given breakpoint number.  If
        count is omitted, the ignore count is set to 0.  A breakpoint
        becomes active when the ignore count is zero.  When non-zero,
        the count is decremented each time the breakpoint is reached
        and the breakpoint is not disabled and any associated
        condition evaluates to true.
        rrr�Nz%d crossingsz
1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.)
r�r�rkr�rr�r��ignorerVr�)r2r�r��countr�r�Zcountstrrrr�	do_ignore@s,	

��z
Pdb.do_ignorec
Cs�|stztd�}Wntk
r(d}YnX|����}|dkrpdd�tjjD�}|��|D]}|�d|�q\dSd|k�r|�	d�}|d|�}||d	d�}zt
|�}Wntk
r�d
|}YnX|�||�}|�
||�}|r�|�|�n|D]}|�d|�q�dS|��}	|	D]\}z|�|�}Wn.tk
�r^}z|�|�W5d}~XYnX|�|�|�d|��qdS)a=cl(ear) filename:lineno
cl(ear) [bpnumber [bpnumber...]]
        With a space separated list of breakpoint numbers, clear
        those breakpoints.  Without argument, clear all breaks (but
        first ask confirmation).  With a filename:lineno argument,
        clear all breaks at that line in that file.
        zClear all breaks? Zno)�yZyescSsg|]}|r|�qSrr)r�r�rrrr�qsz Pdb.do_clear.<locals>.<listcomp>z
Deleted %sNr�rzInvalid line number (%s))�input�EOFErrorrkr�r7r�r�Zclear_all_breaksrVr�r�r�r�Zclear_breakr�r�r�Zclear_bpbynumber)
r2r�ZreplyZbplistr�r-rrr�Z
numberlistrrr�do_clearcsF



zPdb.do_clearcCs|��dS)z�w(here)
        Print a stack trace, with the most recent frame at the bottom.
        An arrow indicates the "current frame", which determines the
        context of most commands.  'bt' is an alias for this command.
        N)�print_stack_tracer�rrr�do_where�szPdb.do_wherecCs>||_|j|jd|_|jj|_|�|j|j�d|_dSr()r]r\r^r$rdrxr)r2r�rrr�
_select_frame�s

zPdb._select_framecCsz|jdkr|�d�dSzt|p"d�}Wn$tk
rL|�d|�YdSX|dkr\d}ntd|j|�}|�|�dS)z�u(p) [count]
        Move the current frame count (default one) levels up in the
        stack trace (to an older frame).
        rzOldest frameNr�Invalid frame count (%s))r]r�r�r��maxr�r2r�rZnewframerrr�do_up�s

z	Pdb.do_upcCs�|jdt|j�kr"|�d�dSzt|p,d�}Wn$tk
rV|�d|�YdSX|dkrpt|j�d}ntt|j�d|j|�}|�|�dS)z�d(own) [count]
        Move the current frame count (default one) levels down in the
        stack trace (to a newer frame).
        rzNewest frameNrr)r]r�r\r�r�r��minrrrrr�do_down�s
zPdb.do_downcCsh|rRzt|�}Wn$tk
r4|�d|�YdSX||jjkrV|�d�dSnd}|�|j|�dS)aNunt(il) [lineno]
        Without argument, continue execution until the line with a
        number greater than the current one is reached.  With a line
        number, continue execution until a line with a number greater
        or equal to that is reached.  In both cases, also stop when
        the current frame returns.
        �Error in argument: %rNz7"until" line number is smaller than current line numberr)r�r�r�r^rrZ	set_until)r2r�rrrr�do_until�s
zPdb.do_untilcCs|��dS)z�s(tep)
        Execute the current line, stop at the first possible occasion
        (either in a function that is called or in the current
        function).
        r)rWr�rrr�do_step�szPdb.do_stepcCs|�|j�dS)zxn(ext)
        Continue execution until the next line in the current function
        is reached or it returns.
        r)Zset_nextr^r�rrr�do_next�szPdb.do_nextcCs<|r4ddl}tjdd�}|�|�t_|tjdd�<t�dS)arun [args...]
        Restart the debugged python program. If a string is supplied
        it is split with "shlex", and the result is used as the new
        sys.argv.  History, breakpoints, actions and debugger options
        are preserved.  "restart" is an alias for "run".
        rNr)�shlexr<�argvr�r)r2r�rZargv0rrr�do_run�sz
Pdb.do_runcCs|�|j�dS)zPr(eturn)
        Continue execution until the current function returns.
        r)Z
set_returnr^r�rrr�	do_returnsz
Pdb.do_returncCs>|js2zt�tj|j�t_Wntk
r0YnX|��dS)z]c(ont(inue))
        Continue execution, only stop when a breakpoint is encountered.
        r)rGr�r�rYrr�r�Zset_continuer�rrr�do_continues�zPdb.do_continuec
Cs�|jdt|j�kr"|�d�dSzt|�}Wntk
rL|�d�YnnXz:||j_|j|jd|f|j|j<|�|j|j�Wn0tk
r�}z|�d|�W5d}~XYnXdS)a�j(ump) lineno
        Set the next line that will be executed.  Only available in
        the bottom-most frame.  This lets you jump back and execute
        code again, or jump forward to skip code that you don't want
        to run.

        It should be noted that not all jumps are allowed -- for
        instance it is not possible to jump into the middle of a
        for loop or out of a finally clause.
        rz)You can only jump within the bottom frameNz)The 'jump' command requires a line numberrzJump failed: %s)	r]r�r\r�r�r�r^rrrx)r2r��errr�do_jump&s
zPdb.do_jumpcCs�t�d�|jj}|j}t|j|j|j�}d|j	�
�|_	|�d�zt�|j
|||f�Wn<tk
r�t��dd�}|�tj|�d�
��YnX|�d�t�|j�|j|_dS)z�debug code
        Enter a recursive debugger that steps through the code
        argument (which is an arbitrary expression or statement to be
        executed in the current environment).
        Nz(%s) zENTERING RECURSIVE DEBUGGERr�r|zLEAVING RECURSIVE DEBUGGER)r<�settracer^r#rdrrRrSrTr>rkrV�call_tracingr	r�r�r�r~rZtrace_dispatchrw)r2r�r�r��pr�rrr�do_debugCs


zPdb.do_debugcCsd|_|��dS)z[q(uit)
exit
        Quit from the debugger. The program being executed is aborted.
        Tr)�_user_requested_quit�set_quitr�rrr�do_quitZszPdb.do_quitcCs|�d�d|_|��dS)z=EOF
        Handles the receipt of EOF as a command.
        r6Tr)rVr!r"r�rrr�do_EOFes
z
Pdb.do_EOFcCs�|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t	|�D]>}|j
|}||krx|�d|||f�qJ|�d|f�qJdS)zHa(rgs)
        Print the argument list of the current function.
        rz%s = %rz%s = *** undefined ***N)r^rard�co_argcount�co_kwonlyargcount�co_flagsr"Z
CO_VARARGSZCO_VARKEYWORDS�range�co_varnamesrV)r2r��co�dictr�r-�namerrr�do_argsns
zPdb.do_argscCs.d|jkr |�t|jd��n
|�d�dS)zQretval
        Print the return value for the last return of a function.
        rzzNot yet returned!N)rdrVr�r�r�rrr�	do_retvals
z
Pdb.do_retvalcCsPzt||jj|j�WSt��dd�}|�tj|�d�	���YnXdS)Nr�r|)
r�r^r#rdr<r�r�r~rrk)r2r�r�rrr�_getval�szPdb._getvalcCsrz2|dkrt||jj|j�WSt||j|j�WSWn:t��dd�}tj|�d�	�}t
d|�YSXdS)Nr�r|z** raised %s **)r�r^r#rdr$r<r�r~rrkr/)r2r�rXr�r�rrrr��szPdb._getval_exceptcCs*z|�t|�|���WnYnXdS)z@p expression
        Print the value of the expression.
        N)rVr�r/r�rrr�do_p�szPdb.do_pcCs,z|�t�|�|���WnYnXdS)zHpp expression
        Pretty-print the value of the expression.
        N)rV�pprintZpformatr/r�rrr�do_pp�sz	Pdb.do_ppcCsfd|_d}|r�|dkr�z^d|krX|�d�\}}t|���}t|���}||krr||}nt|���}td|d�}Wq�tk
r�|�d|�YdSXn0|jdks�|dkr�td|jj	d�}n
|jd}|dkr�|d}|jj
j}|�|�}zZt
�||jj�}|�||d|�|||j�t|t|��|_t|�|k�rH|�d	�Wntk
�r`YnXdS)
a�l(ist) [first [,last] | .]

        List source code for the current file.  Without arguments,
        list 11 lines around the current line or continue the previous
        listing.  With . as argument, list 11 lines around the current
        line.  With one argument, list 11 lines starting at that line.
        With two arguments, list the given range; if the second
        argument is less than the first, it is a count.

        The current line in the current frame is indicated by "->".
        If an exception is being debugged, the line where the
        exception was originally raised or propagated is indicated by
        ">>", if it differs from the current line.
        r)Nr�r�r�r�
z[EOF])rwr�r�rkr
r�r�rr^rrrarq�get_file_breaksr��getlinesr#�_print_linesrr�rVrU)r2r�Zlast�firstr�	breaklistr&rrr�do_list�s@




�zPdb.do_listc
Csp|jjj}|�|�}zt|j�\}}Wn2tk
rX}z|�|�WY�dSd}~XYnX|�||||j�dS)z\longlist | ll
        List the whole source code for the current function or frame.
        N)r^rarqr5r'rr�r7)r2r�rr9r&rr�rrr�do_longlist�s


zPdb.do_longlistc
Csvz|�|�}WnYdSXzt|�\}}Wn6ttfk
rd}z|�|�WY�dSd}~XYnX|�||�dS)z^source expression
        Try to get source code for the given object and display it.
        N)r/r'r�	TypeErrorr�r7)r2r�r%r&rr�rrr�	do_source�s
z
Pdb.do_sourcerc
Cs�|r|j}|j�|d�}nd}}t||�D]|\}}t|��d�}	t|	�dkrV|	d7}	||krh|	d7}	n|	d7}	||kr�|	d7}	n||kr�|	d7}	|�|	d|���q,d	S)
zPrint a range of lines.r|r��r��Bz->z>>�	N)	rrrCr�rr��rjustr�rVr�)
r2r&rr�rXZcurrent_linenoZ
exc_linenorr �srrrr7s 

zPdb._print_linescCs�z|�|�}WnYdSXd}z|jj}Wntk
rBYnX|r\|�d|j�dSz
|j}Wntk
rzYnX|r�|�d|j�dS|jtkr�|�d|j|j	f�dS|�t|��dS)z;whatis arg
        Print the type of the argument.
        Nz	Method %szFunction %szClass %s.%s)
r/r�r�r�rVr��	__class__�typerr)r2r��valuer,rrr�	do_whatiss.

z
Pdb.do_whatiscCsl|s8|�d�|j�|ji���D]}|�d|�q"n0|�|�}||j�|ji�|<|�d||f�dS)z�display [expression]

        Display the value of the expression if it changed, each time execution
        stops in the current frame.

        Without expression, list all display expressions for the current frame.
        zCurrently displaying:z%s: %rzdisplay %s: %rN)rVr@r�r^r�r��
setdefault)r2r�r��valrrr�
do_display<s

zPdb.do_displaycCsT|r@z|j�|ji�|=WqPtk
r<|�d|�YqPXn|j�|jd�dS)z�undisplay [expression]

        Do not display the expression any more in the current frame.

        Without expression, clear all display expressions for the current frame.
        znot displaying %sN)r@r�r^r�r�rjr�rrr�do_undisplayOszPdb.do_undisplaycs�fdd�|j�|ji�D�S)Ncsg|]}|���r|�qSrr�)r�rr�rrr�_s
�z*Pdb.complete_undisplay.<locals>.<listcomp>)r@r�r^r�rr�r�complete_undisplay^szPdb.complete_undisplaycCs |jj|j�}tjd|d�dS)z�interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
        z
*interactive*)ZlocalN)r^r#rdr,�interact)r2r�r�rrr�do_interactbszPdb.do_interactcCs�|��}t|�dkrHt|j���}|D]}|�d||j|f�q&dS|d|jkr�t|�dkr�|�d|d|j|df�nd�|dd��|j|d<dS)acalias [name [command [parameter parameter ...] ]]
        Create an alias called 'name' that executes 'command'.  The
        command must *not* be enclosed in quotes.  Replaceable
        parameters can be indicated by %1, %2, and so on, while %* is
        replaced by all the parameters.  If no command is given, the
        current alias for name is shown. If no name is given, all
        aliases are listed.

        Aliases may be nested and can contain anything that can be
        legally typed at the pdb prompt.  Note!  You *can* override
        internal pdb commands with aliases!  Those internal commands
        are then hidden until the alias is removed.  Aliasing is
        recursively applied to the first word of the command line; all
        other words in the line are left alone.

        As an example, here are two useful aliases (especially when
        placed in the .pdbrc file):

        # Print instance variables (usage "pi classInst")
        alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
        # Print instance variables in self
        alias ps pi self
        rz%s = %sNrr�)r�r��sortedr?r�rVr�)r2r�r�r�r�rrr�do_aliasks"zPdb.do_aliascCs6|��}t|�dkrdS|d|jkr2|j|d=dS)z9unalias name
        Delete the specified alias.
        rN)r�r�r?)r2r�r�rrr�
do_unalias�s
zPdb.do_unaliascs�fdd�|jD�S)Ncsg|]}|���r|�qSrr�)r��ar�rrr��s
z(Pdb.complete_unalias.<locals>.<listcomp>)r?r�rr�r�complete_unalias�szPdb.complete_unaliasrrrrr#rcCs4z|jD]}|�|�qWntk
r.YnXdSr0)r\rxrU)r2�frame_linenorrrr	�s

zPdb.print_stack_tracecCs6|\}}||jkrd}nd}|�||�||��dS)Nz> z  )r^rVZformat_stack_entry)r2rSZ
prompt_prefixrXrr�rrrrx�s

�zPdb.print_stack_entrycCs�|stj�||�Sz@zt|d|�}|�WWStk
rNt|d|�}YnXWn"tk
rt|�d|�Yn0Xtjjdkr�|�d|�dS|�	|j
���dS)z�h(elp)
        Without argument, print the list of available commands.
        With a command name as argument, print help about that command.
        "help pdb" shows the full pdb documentation.
        "help exec" gives help on the ! command.
        Zhelp_r�zNo help for %rr�zJNo help for %r; please do not run Python with -OO if you need command helpN)r:r;�do_helprvr�r�r<�flags�optimizerVrr�)r2r�ZtopicZcommandrrrrT�s 
�zPdb.do_helpcCs|�|jjpd���dS)a�(!) statement
        Execute the (one-line) statement in the context of the current
        stack frame.  The exclamation point can be omitted unless the
        first word of the statement resembles a debugger command.  To
        assign to a global variable you must always prefix the command
        with a 'global' command, e.g.:
        (Pdb) global list_options; list_options = ['-l']
        (Pdb)
        r6N)rV�	help_execrrkr1rrrrW�s
z
Pdb.help_execcCs
t�dSr0)rr1rrr�help_pdb�szPdb.help_pdbcCs�tj�|�rtj�|�r|Stj�tjd|�}tj�|�rP|�|�|jkrP|Stj�|�\}}|dkrp|d}tj�|�r�|StjD]>}tj�	|�r�t�
|�}q�tj�||�}tj�|�r�|Sq�dS)z�Helper function for break/clear parsing -- may be overridden.

        lookupmodule() translates (possibly incomplete) file or module name
        into an absolute file name.
        rr6r�N)rIrJ�isabs�existsr�r<rprA�splitext�islink�readlink)r2rrf�rootZext�dirname�fullnamerrrr��s"

zPdb.lookupmodulec	Csrd|_d|_ddl}|�|�\}}}|�|j�|_ddl}|j�	�|j�
d|j|j|j|t
d��|�|�dS)NTFr�__main__)r�__file__�__package__�
__loader__�__spec__�__builtins__)rBr!�runpyZ_get_module_detailsrprqrAra�__dict__r_�update�parent�loaderrfr	)r2Zmodule_namergZmod_nameZmod_specr,rarrr�
_runmodule�s 
�zPdb._runmodulec	Cstddl}|j��|j�d|td��d|_|�|�|_d|_t	�
|��}d|��|jf}W5QRX|�|�dS)Nrra)rrbrfTFzexec(compile(%r, %r, 'exec')))
rarhr_rirfrBrprAr!�io�	open_code�readr	)r2rrar�	statementrrr�
_runscript
s
�
�zPdb._runscript)r4NNNFT)r)N)rN)wrrrr�r9rYrZr[rhrerortrsr{r�ryr�rnr�r�r�rlr�rVr�r�r�r�r�Zcomplete_commandsr�r�Zdo_bZcomplete_breakZ
complete_br�Zcomplete_tbreakr�r�r�Zcomplete_enabler�Zcomplete_disablerZcomplete_conditionrZcomplete_ignorerZdo_clZcomplete_clearZcomplete_clr
Zdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ
do_restartrZdo_rrZdo_cZdo_contrZdo_jr Zcomplete_debugr#Zdo_qZdo_exitr$r-Zdo_ar.Zdo_rvr/r�r0r2Zcomplete_printZ
complete_pZcomplete_ppr:Zdo_lr;Zdo_llr=Zcomplete_sourcer7rFZcomplete_whatisrIZcomplete_displayrJrKrMrOrPrRr�r	�line_prefixrxrTZdo_hrWrXr�rlrqrrrrr�s��
/	


M
]!!.	
		1
!	#	��whereZdownZup�breakZtbreakr_r�r�rZ	conditionrM�stepr�ZuntilZjump�returnZretval�continuer)Zlonglistr�rZppZwhatis�sourceZdisplayZ	undisplayrLr�Zunalias�debug�quitr�z

cCst��|||�dSr0)rr	�rpr�r�rrrr	<scCst��|||�Sr0)rr)Z
expressionr�r�rrrr?scCst|||�dSr0)r	r{rrrr
BscOst�j||�Sr0)rr)r��kwdsrrrrFs)�headercCs,t�}|dk	r|�|�|�t��j�dSr0)rrVrr<�	_getframe�f_back)r}�pdbrrrrIs
cCsB|dkrt��d}|dkr$td��t�}|��|�d|�dS)Nr�zAA valid traceback must be passed if no exception is being handled)r<r�r�rrZrn)�trrrrrQscCsttj�dSr0)rr<�last_tracebackrrrrr
_szimport x; x.main()cCstt�dSr0)r	�TESTCMDrrrr�testgsr�cCsddl}|�t�dSr()�pydocZpagerr)r�rrrrksausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...

Debug the Python program given by pyfile. Alternatively,
an executable module or package to debug can be specified using
the -m switch.

Initial commands are read from .pdbrc files in your home directory
and in the current directory, if they exist.  Commands supplied with
-c are executed after commands from .pdbrc files.

To let the script run until an exception occurs, use "-c continue".
To let the script run up to a given line X in the debugged file, use
"-c 'until X'".c

Csddl}|�tjdd�dddg�\}}|s>tt�t�d�g}d}|D]B\}}|dkrltt�t��qJ|d	kr�|�|�qJ|d
krJd}qJ|d}|s�tj�	|�s�td|d
�t�d�|tjdd�<|s�tj�
|�}tj�|�tjd<t�}|j
�|�z6|�r|�|�n
|�|�|j�r*W�qtd�Wq�tk
�rrtd|d�tdd�tjdd���Yq�tk
�r�tddd�tt��d�Yq�tk
�r�t��t�d�Yq�t��td�td�t��d}	|�d|	�td|d�Yq�Xq�dS)Nrrzmhc:rzcommand=r�F)z-hz--help)z-cz	--command)z-mTzError:zdoes not existz*The program finished and will be restartedZ
Restartingzwith arguments:r@r�z/The program exited via sys.exit(). Exit status:)r�z2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)�getoptr<rr��_usage�exitr�rIrJrZ�realpathr_rrHrLrlrqr!rr��
SystemExitr��SyntaxErrorr~�	print_excrn)
r�Zoptsr�rMZ
run_as_module�optZoptargrAr�r�rrr�main~sd 



 �r�ra)NN)NN)N)/rrIrmrr<r:r7r*r,r�r1r�r"rr~r�r�r�__all__r!r'r.r�r/rrr8r;rZ_help_orderZ_commandrvrkrWr	rr
rrrr
r�r�rr�r�rr�rrrr�<module>s�C�
		*
� 


D
zipfile.cpython-38.pyc000064400000162224151450073350010650 0ustar00U

e5d�V�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZzddlZejZWnek
r�dZejZYnXzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXddddddd	d
ddd
ddg
ZGdd�de�ZGdd�de�ZeZZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(e�)e'�Z*dZ+dZ,dZ-dZ.d Z/d!Z0d"Z1d#Z2dZ3d$Z4d%Z5d&Z6e�)e5�Z7dZ8dZ9dZ:dZ;d Z<d!Z=d"Z>d#Z?dZ@d$ZAd'ZBd(ZCdZDd)ZEdZFd*ZGd+ZHd,ZId-ZJd.ZKd/ZLe�)eK�ZMdZNdZOdZPdZQd ZRd!ZSd"ZTd#ZUdZVd$ZWd'ZXd(ZYd0ZZd1Z[e�)eZ�Z\d2Z]d3Z^e�)e]�Z_dZ`dZadZbdZcd Zdd!Zed"Zfd#ZgdZhd$Zid4Zje�kd5�Zld6d7�Zmd8d9�Znd:d
�Zod;d<�Zpd=d>�ZqGd?d�der�Zsdatd@dA�ZudBdC�ZvGdDdE�dE�ZwGdFdG�dG�ZxdHdIdJdJdJdJdKdLdMdNdKdOdPdQdRdSdTdU�ZydVdW�ZzdtdXdY�Z{dZd[�Z|Gd\d]�d]�Z}Gd^d_�d_�Z~Gd`da�daej�Z�Gdbdc�dcej�Z�Gddd�d�Z�Gded
�d
e��Z�dfdg�Z�dhdi�Z�e�j�Z�djdk�Z�Gdldm�dme��Z�Gdndo�doe��Z�Gdpd�d�Z�dudqdr�Z�e�dsk�r
e��dS)vzP
Read and write ZIP files.

XXX references to utf-8 need further investigation.
�N�
BadZipFile�
BadZipfile�error�
ZIP_STORED�ZIP_DEFLATED�	ZIP_BZIP2�ZIP_LZMA�
is_zipfile�ZipInfo�ZipFile�	PyZipFile�LargeZipFile�Pathc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/zipfile.pyr+sc@seZdZdZdS)r
zu
    Raised when writing a zipfile, the zipfile requires ZIP64 extensions
    and those extensions are disabled.
    N)rrr�__doc__rrrrr
/si���������-�.�?s<4s4H2LHsPK��������	z<4s4B4HL2L5H2LsPK�
��
����z<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK�<HHc
Cs�tj}d}g}d}}|dt|�krz||||d��\}}|d|}	||krt||krl|�|||��|	}d}|	}q|s�|Sd�|�S)NFrr T�)�_EXTRA_FIELD_STRUCT�unpack�len�append�join)
�extraZxidsr/Zmodified�buffer�start�iZxidZxlen�jrrr�_strip_extra�s r8cCs,zt|�rWdSWntk
r&YnXdS)NTF)�_EndRecData�OSError��fprrr�_check_zipfile�s
r=c	CsVd}z8t|d�rt|d�}nt|d��}t|�}W5QRXWntk
rPYnX|S)z�Quickly see if a file is a ZIP file by checking the magic number.

    The filename argument may be a file or file-like object too.
    F�readr;�rb)�hasattrr=�openr:)�filename�resultr<rrrr	�s
c
Csz|�|td�Wntk
r,|YSX|�t�}t|�tkrH|St�t|�\}}}}|tkrh|S|dksx|dkr�t	d��|�|tt
d�|�t
�}t|�t
kr�|St�t|�\
}}}	}
}}}
}}}|tkr�|S||t
<||t<||t<|
|t<||t<||t<||t<|S)zM
    Read the ZIP64 end-of-archive records and use that to update endrec
    rrrz3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr:r>r0�structr/�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL�	_ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZread_versionZdisk_numZdisk_dirZdircountZ	dircount2ZdirsizeZ	diroffsetrrr�
_EndRecData64�s@



�rXc	Csh|�dd�|��}z|�td�Wntk
r<YdSX|��}t|�tkr�|dd�tkr�|dd�dkr�t�t	|�}t
|�}|�d�|�|t�t|t|�St
|dtd�}|�|d�|��}|�t�}|dk�rd|||t�}t|�tk�rdSt
t�t	|��}|t}||t|t|�}|�|�|�||�t|||||�SdS)	z�Return data from the "End of Central Directory" record, or None.

    The data is a list of the nine items in the ZIP "End of central dir"
    record followed by a tenth item, the file seek offset of this record.rrNr ���sr-i)rD�tell�sizeEndCentDirr:r>r0�stringEndArchiverFr/�structEndArchive�listr1rX�max�rfind�_ECD_COMMENT_SIZE)	rSZfilesizerVrUZmaxCommentStartr5ZrecDataZcommentSize�commentrrrr9sD��



�r9c@s\eZdZdZdZddd�Zdd�Zdd
d�Zdd
�Zdd�Z	e
ddd�dd��Zdd�Zd	S)r
z>Class with attributes describing each file in the ZIP archive.)�
orig_filenamerB�	date_time�
compress_type�_compresslevelrbr3�
create_systemrW�extract_version�reserved�	flag_bits�volume�
internal_attr�
external_attr�
header_offset�CRC�
compress_size�	file_size�	_raw_time�NoName��rrrrrcCs�||_|�td��}|dkr(|d|�}tjdkrJtj|krJ|�tjd�}||_||_|ddkrjtd��t	|_
d|_d|_d|_
tjdkr�d|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nr�/ruz+ZIP does not support timestamps before 1980r-Zwin32r)rc�find�chr�os�sep�replacerBrd�
ValueErrorrrerfrbr3�sys�platformrg�DEFAULT_VERSIONrWrhrirjrkrlrm)�selfrBrdZ	null_byterrr�__init__Xs0
zZipInfo.__init__cCs�d|jj|jfg}|jtkr8|�dt�|j|j��|jd?}|jd@}|rd|�dt	�
|��|rv|�d|�|��}|r�|jr�|�d|j�|r�|j
r�|jtks�|j|j
kr�|�d|j
�|�d	�d
�|�S)Nz<%s filename=%r� compress_type=%sr)rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r�>�)�	__class__rrBrerr1�compressor_names�getrm�stat�filemode�is_dirrqrpr2)r�rC�hi�lo�isdirrrr�__repr__�s0
��



�
�
zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}|jd
@rfd}}}n|j}|j}|j}|j}d}	|dkr�|tkp�|tk}|r�d}
|t�|
dt�	|
�d	||�}|tks�|tkr�|s�t
d
��d}d}t}	|jt
k�rtt|	�}	n|jtk�rtt|	�}	t|	|j�|_t|	|j�|_|��\}}t�tt|j|j||j|||||t|�t|��
}
|
||S)z-Return the per-file header as a bytes object.rrur$rr!rrr&r rNz<HHQQz'Filesize would require ZIP64 extensions���)rdrjrorprqr3�ZIP64_LIMITrF�pack�calcsizer
�
ZIP64_VERSIONrerr_�
BZIP2_VERSIONr�LZMA_VERSIONrhrW�_encodeFilenameFlags�structFileHeader�stringFileHeaderrir0)r��zip64�dt�dosdate�dostimerorprqr3�min_version�fmtrBrj�headerrrr�
FileHeader�s^$$
�
�zZipInfo.FileHeadercCsDz|j�d�|jfWStk
r>|j�d�|jdBfYSXdS)N�ascii�utf-8�)rB�encoderj�UnicodeEncodeError�r�rrrr��szZipInfo._encodeFilenameFlagscCs�|j}tj}t|�dk�r�|d|dd��\}}|dt|�krPtd||f��|dk�rp|dkrv|d|dd��}nV|dkr�|d	|dd
��}n:|dkr�|d|dd
��}n|dkr�d}ntd||f��d}|jdk�rt|�|kr�td��|||_|d7}|jdk�r6t|�|k�r$td��|||_|d7}|jdk�rpt|�|k�rXtd��|j}|||_|d7}||dd�}qdS)Nr r,z"Corrupt extra field %04x (size=%d)r�z<QQQ�r)z<QQrrz<Qrrr)l����r�z/Corrupt zip64 extra field. File size not found.r�z3Corrupt zip64 extra field. Compress size not found.z3Corrupt zip64 extra field. Header offset not found.)r3rFr/r0rrqrprn)r�r3r/�tpZlnZcounts�idx�oldrrr�_decodeExtra�sP
�
�
�
zZipInfo._decodeExtraT��strict_timestampsc	Cst|tj�rt�|�}t�|�}t�|j�}t�|j	�}|dd�}|sZ|ddkrZd}n|sn|ddkrnd}|dkrz|}tj
�tj
�|�d�}|dtj
tjfkr�|dd�}q�|r�|d	7}|||�}|jd
@d>|_|r�d|_|jdO_n|j|_|S)a_Construct an appropriate ZipInfo for a file on the filesystem.

        filename should be the path to a file or directory on the filesystem.

        arcname is the name which it will have within the archive (by default,
        this will be the same as filename, but without a drive letter and with
        leading path separators removed).
        rr"rurt�;)r�r���;r�Nrrvrr))�
isinstancery�PathLike�fspathr��S_ISDIR�st_mode�time�	localtime�st_mtime�path�normpath�
splitdriverz�altseprmrq�st_size)	�clsrB�arcnamer��str��mtimerd�zinforrr�	from_file�s0



zZipInfo.from_filecCs|jddkS)z2Return True if this archive member is a directory.���rv�rBr�rrrr�%szZipInfo.is_dir)rsrt)N)N)
rrrr�	__slots__r�r�r�r�r��classmethodr�r�rrrrr
>s
+
.2%cCs0td�D]"}|d@r"|d?dA}q|dL}q|S)Nrrl q[)�range)�crcr7rrr�_gen_crc/s

r�csld�d�d�tdkr&ttttd���at��fdd������fdd��|D]}�|�qL��fd	d
�}|S)NixV4i�gE#i�xV4�cs|d?�||Ad@AS)z(Compute the CRC32 primitive on one byte.r�r)Zchr�)�crctablerr�crc32Isz_ZipDecrypter.<locals>.crc32cs<�|�����d@d@��ddd@���d?���dS)Nr�r�i�rr�r)�c)r��key0�key1�key2rr�update_keysMs
z"_ZipDecrypter.<locals>.update_keyscsNt�}|j}|D]4}�dB}|||dAd?d@N}�|�||�qt|�S)zDecrypt a bytes object.rrrr�)�	bytearrayr1�bytes)rVrCr1r��k)r�r�rr�	decrypterWs
z _ZipDecrypter.<locals>.decrypter)�	_crctabler^�mapr�r�)�pwd�pr�r)r�r�r�r�r�r�r�
_ZipDecrypter?s
r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LZMACompressorcCs
d|_dS�N)�_compr�rrrr�gszLZMACompressor.__init__cCsFt�dtji�}tjtjt�tj|�gd�|_t�dddt	|��|S)N�id��filtersz<BBHr$r )
�lzmaZ_encode_filter_properties�FILTER_LZMA1r��
FORMAT_RAW�_decode_filter_propertiesr�rFr�r0)r�Zpropsrrr�_initjs
�
zLZMACompressor._initcCs*|jdkr|��|j�|�S|j�|�Sr�)r�r��compress)r�rVrrrr�qs
zLZMACompressor.compresscCs&|jdkr|��|j��S|j��Sr�)r�r��flushr�rrrr�vs
zLZMACompressor.flushN)rrrr�r�r�r�rrrrr�esr�c@seZdZdd�Zdd�ZdS)�LZMADecompressorcCsd|_d|_d|_dS)Nr-F)�_decomp�_unconsumed�eofr�rrrr�~szLZMADecompressor.__init__c	Cs�|jdkr�|j|7_t|j�dkr*dSt�d|jdd��\}t|j�d|krXdStjtjt�tj	|jdd|��gd�|_|jd|d�}|`|j�
|�}|jj|_|S)Nr r-z<Hrr�)r�r�r0rFr/r�r�r�r�r��
decompressr�)r�rVZpsizerCrrrr��s"
��

zLZMADecompressor.decompressN)rrrr�r�rrrrr�|sr�ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ	deflate64Zbzip2r�ZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr+��a�bcCsX|tkr
nJ|tkr tsTtd��n4|tkr6tsTtd��n|tkrLtsTtd��ntd��dS)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rr�zlib�RuntimeErrorr�bz2rr��NotImplementedError)�compressionrrr�_check_compression�s$���r�cCsj|tkr2|dk	r t�|tjd�St�tjtjd�S|tkrT|dk	rLt�|�St��S|tkrbt	�SdSdS)N��)
rr�ZcompressobjZDEFLATEDZZ_DEFAULT_COMPRESSIONrr�Z
BZ2Compressorrr�)re�
compresslevelrrr�_get_compressor�s
r�cCsvt|�|tkrdS|tkr&t�d�S|tkr6t��S|tkrDt	�St
�|�}|rdtd||f��ntd|f��dS)Nr�zcompression type %d (%s)zcompression type %d)
r�rrr�Z
decompressobjrr�ZBZ2Decompressorrr�r�r�r�)reZdescrrrr�_get_decompressor�s

r�c@s0eZdZdd�Zddd�Zd
dd�Zd	d
�ZdS)�_SharedFilecCs2||_||_||_||_||_|j|_|j|_dSr�)�_file�_pos�_close�_lock�_writing�seekablerZ)r��file�pos�close�lockZwritingrrrr��sz_SharedFile.__init__rc
CsN|j�>|��rtd��|j�||�|j��|_|jW5QR�SQRXdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrZr)r�rT�whencerrrrD�sz_SharedFile.seekr�c
CsX|j�H|��rtd��|j�|j�|j�|�}|j��|_|W5QR�SQRXdS)N�yCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrr>rZ�r��nrVrrrr>�sz_SharedFile.readcCs$|jdk	r |j}d|_|�|�dSr�)rr)r��fileobjrrrr	s
z_SharedFile.closeN)r)r�)rrrr�rDr>r	rrrrr�s	


rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	_TellablecCs||_d|_dS�Nr)r<rT�r�r<rrrr�sz_Tellable.__init__cCs|j�|�}|j|7_|Sr�)r<�writerT)r�rVrrrrrsz_Tellable.writecCs|jSr�)rTr�rrrrZsz_Tellable.tellcCs|j��dSr�)r<r�r�rrrr�sz_Tellable.flushcCs|j��dSr�)r<r	r�rrrr	sz_Tellable.closeN)rrrr�rrZr�r	rrrrrs
rcs�eZdZdZdZdZdZd(dd�Zd	d
�Zdd�Z	d)dd�Z
d*dd�Zdd�Zd+dd�Z
dd�Zdd�Zdd�Zdd�Z�fdd �Zd!d"�Zd,d$d%�Zd&d'�Z�ZS)-�
ZipExtFilezZFile-like object for reading an archive member.
       Is returned by ZipFile.open().
    i@iiNFcCs(||_||_||_|j|_|j|_|j|_t	|j�|_
d|_d|_d|_
d|_||_|j|_t|d�rz|j|_td�|_nd|_d|_z4|��r�|��|_|j|_|j|_|j|_d|_Wntk
r�YnXd|_|�r$|j d@r�|j!d?d@}n|jd?d@}|�"�}||k�r$t#d	|j$��dS)
NFr-rroTrr�r�zBad password for file %r)%�_fileobj�_pwd�_close_fileobjre�_compress_typerp�_compress_leftrq�_leftr��
_decompressor�_eof�_readbuffer�_offset�newlines�moderB�namer@ro�
_expected_crcr��_running_crc�	_seekablerrZ�_orig_compress_start�_orig_compress_size�_orig_file_size�_orig_start_crc�AttributeError�
_decrypterrjrr�_init_decrypterr�rc)r�rr �zipinfor�Z
close_fileobjZ
check_byte�hrrrr�)sF




zZipExtFile.__init__cCs4t|j�|_|j�d�}|jd8_|�|�dS)Nrr&)r�rr*rr>r)r�r�rrrr+\szZipExtFile._init_decryptercCsvd|jj|jjfg}|jsX|�d|j|jf�|jtkrb|�dt	�
|j|j��n
|�d�|�d�d�|�S)N�<%s.%sz name=%r mode=%rr��	 [closed]r�r�)r�rr�closedr1r!r rrr�r�r2�r�rCrrrr�gs�
��

zZipExtFile.__repr__r�cCsL|dkr>|j�d|j�d}|dkr>|j|j|�}||_|Stj�||�S)zrRead and return a line from the stream.

        If limit is specified, at most limit bytes will be read.
        r�
r)rrwr�io�BufferedIOBase�readline)r��limitr6�linerrrr5uszZipExtFile.readlinercCsr|t|j�|jkr\|�|�}t|�|jkrJ||j|jd�|_d|_n|jt|�8_|j|j|jd�S)z6Returns buffered bytes without advancing the position.Nri)r0rrr>)r�r�chunkrrr�peek�s
zZipExtFile.peekcCsdS�NTrr�rrr�readable�szZipExtFile.readablecCs|dks|dkrH|j|jd�}d|_d|_|jsD||�|j�7}q,|S||j}|t|j�krz|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dkr�|js�|�|�}|t|�kr�||_||_||d|�7}q�||7}|t|�8}q�|S)z�Read and return up to n bytes.
        If the argument is omitted, None, or negative, data is read and returned until EOF is reached.
        Nrr-�rrr�_read1�MAX_Nr0)r�r�buf�endrVrrrr>�s4

zZipExtFile.readcCs@|jdkrdSt||j�|_|jr<|j|jkr<td|j��dS)NzBad CRC-32 for file %r)r"r�r#rrr!)r��newdatarrr�_update_crc�s

zZipExtFile._update_crccCs|dks|dkrR|j|jd�}d|_d|_|jsN|�|j�}|r,||7}qNq,|S||j}|t|j�kr�|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dk�r|j�s|�|�}|t|�kr�||_||_||d|�7}�q|r�||7}�qq�|S)z7Read up to n bytes with at most one read() system call.Nrr-r<)r�rr?rVr@rrr�read1�s>


zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|�krR||�|t|��7}n
|�|�}|jtkrj|jdk|_nx|jtkr�t	||j
�}|j�||�}|jjp�|jdko�|jj|_|jr�||j�
�7}n |j�|�}|jjp�|jdk|_|d|j�}|jt|�8_|jdk�rd|_|�|�|S)Nrr-T)rrrrZunconsumed_tailr0�_read2rrr_�
MIN_READ_SIZEr�r�r�rrBr
rrrr=�s4




�
zZipExtFile._read1cCsd|jdkrdSt||j�}t||j�}|j�|�}|jt|�8_|sLt�|jdk	r`|�|�}|S)Nrr-)	rr_rE�minrr>r0�EOFErrorr*r
rrrrD	s


zZipExtFile._read2cs&z|jr|j��W5t���XdSr�)�superr	rrr��r�rrr	szZipExtFile.closecCs|jSr�)r$r�rrrr szZipExtFile.seekablercCs>|jst�d��|��}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd��||jkrd|j}|dkrpd}||}||j}|dkr�|t|j�kr�||_d}nf|dk�r
|j	�
|j�|j|_
|j|_|j|_d|_d|_t|j�|_d|_|}|jdk	�r
|��|dk�r6t|j|�}|�|�||8}�q
|��S)N�!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r-F)r$r3�UnsupportedOperationrZr'r|rr0rrrDr%r(r#r&rrr�rrrr*r+rF�
MAX_SEEK_READr>)r�rTrZcurr_posZnew_posZread_offsetZbuff_offsetZread_lenrrrrD#sH






zZipExtFile.seekcCs0|jst�d��|j|jt|j�|j}|S)NrJ)r$r3rKr'rr0rr)r�ZfileposrrrrZSs
zZipExtFile.tell)NF)r�)r)r�)r)rrrrr>rErLr�r+r�r5r9r;r>rBrCr=rDr	rrDrZ�
__classcell__rrrIrrs*�
3



!
%$
0rcs@eZdZdd�Zedd��Zdd�Zdd�Z�fd	d
�Z�Z	S)�
_ZipWriteFilecCs8||_||_||_t|j|j�|_d|_d|_d|_	dSr)
�_zinfo�_zip64�_zipfiler�rerf�_compressor�
_file_size�_compress_size�_crc)r��zfr�r�rrrr�[s�z_ZipWriteFile.__init__cCs|jjSr�)rQr<r�rrrresz_ZipWriteFile._fileobjcCsdSr:rr�rrr�writableisz_ZipWriteFile.writablecCsf|jrtd��t|�}|j|7_t||j�|_|jrV|j�|�}|jt|�7_|j	�
|�|S)NzI/O operation on closed file.)r0r|r0rSr�rUrRr�rTrr)r�rV�nbytesrrrrlsz_ZipWriteFile.writec	sb|jr
dS�zFt���|jrR|j��}|jt|�7_|j	�
|�|j|j_n
|j
|j_|j|j_|j
|j_|jjd@r�|jr�dnd}|j	�
t�|t|jj|jj|jj��|j	��|j_nn|js�|j
tkr�td��|jtkr�td��|j	��|j_|j	�|jj�|j	�
|j�|j��|j	�|jj�|jj�|j�|j|jj|jj <W5d|j_XdS)NFrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limit)!r0rQrrHr	rRr�rTr0rrrOrprSrUrorqrjrPrFr��
_DD_SIGNATURErZ�	start_dirr�r�rDrnr��filelistr1�
NameToInforB)r�r?r�rIrrr	xsF




�
�
�z_ZipWriteFile.close)
rrrr��propertyrrWrr	rMrrrIrrNZs

rNc@s$eZdZdZdZdZdeddfdd�dd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
d=dd�Zdd�Zdd�Zdd�Zedd��Zejdd��Zd>dd �Zd?d!d"�d#d$�Zd@d%d&�ZdAd'd(�ZdBd)d*�Zed+d,��Zd-d.�Zd/d0�ZdCd1d2�ZdDd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#dS)Erai Class with methods to open, read, write, close, list zip files.

    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True,
                compresslevel=None)

    file: Either the path to the file, or a file-like object.
          If it is a path, the file will be opened and closed by ZipFile.
    mode: The mode can be either read 'r', write 'w', exclusive create 'x',
          or append 'a'.
    compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib),
                 ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma).
    allowZip64: if True ZipFile will create files with ZIP64 extensions when
                needed, otherwise it will raise an exception when this would
                be necessary.
    compresslevel: None (default for the given compression type) or an integer
                   specifying the level to pass to the compressor.
                   When using ZIP_STORED or ZIP_LZMA this keyword has no effect.
                   When using ZIP_DEFLATED integers 0 through 9 are accepted.
                   When using ZIP_BZIP2 integers 1 through 9 are accepted.

    N�rTr�c
	CsP|dkrtd��t|�||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_t
|tj�rpt�|�}t
|t�r�d|_||_ddd	d
dddd
�}||}zt�||�|_Wq�tk
r�||kr�||}Yq��Yq�Xq�q�nd|_||_t|dd�|_d|_t��|_d|_d|_�z|dk�r4|��n�|dk�r�d|_z|j� �|_!Wn2t"tfk
�r�t#|j�|_d|_!d|_Yn6Xz|j�$|j!�Wn t"tfk
�r�d|_YnXnf|dk�rz|��|j�$|j!�Wn6t%k
�r|j�$dd�d|_|j� �|_!YnXntd��Wn$|j}	d|_|�&|	��YnXdS)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
        or append 'a'.)r^�w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNr-r?�w+b�x+b�r+b�wbZxb)r^r_r`rardrbrcrr!Tr^)r_r`rarz"Mode must be 'r', 'w', 'x', or 'a')'r|r��_allowZip64�
_didModify�debugr\r[r�r�r r��_comment�_strict_timestampsr�ryr�r��str�_filePassedrBr3rAr<r:�getattr�_fileRefCnt�	threading�RLockrr$r�_RealGetContentsrZrZr)rrDr�_fpclose)
r�rr r��
allowZip64r�r�ZmodeDictr�r<rrrr��s�

�





zZipFile.__init__cCs|Sr�rr�rrr�	__enter__szZipFile.__enter__cCs|��dSr��r	)r��type�value�	tracebackrrr�__exit__szZipFile.__exit__cCs�d|jj|jjfg}|jdk	rd|jr8|�d|j�n|jdk	rR|�d|j�|�d|j�n
|�d�|�d�d�|�S)Nr.z file=%rz filename=%rz mode=%rr/r�r�)	r�rrr<rlr1rBr r2r1rrrr�"s�



zZipFile.__repr__cCs�|j}zt|�}Wntk
r.td��YnX|s<td��|jdkrNt|�|t}|t}|t|_	|t
||}|ttkr�|t
t8}|jdkr�||}td|||�|||_|�|jd�|�|�}t�|�}d}||k�r�|�t�}	t|	�tk�r
td��t�t|	�}	|	ttk�r,td��|jdk�r@t|	�|�|	t�}
|	d}|d	@�rl|
�d
�}
n
|
�d�}
t|
�}|�|	t�|_|�|	t �|_!|	t"|_#|	dd�\|_$|_%|_&|_'|_(|_)}
}|_*|_+|_,|j&t-k�r�t.d
|j&d��|	dd�\|_/|_0|_1|
|_2|d?d|d?d@|d@|
d?|
d?d@|
d@df|_3|�4�|j#||_#|j5�6|�||j7|j8<|t|	t|	t|	t }|jdkr�td|�q�dS)z/Read in the table of contents for the ZIP file.zFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!r�r��cp437rzzip file version %.1fr%r(r+r$rur�r&r�totalN)9r<r9r:rrh�printrQrR�_ECD_COMMENTri�
_ECD_LOCATIONrLrKrIrErZrDr>r3�BytesIO�sizeCentralDirr0rFr/�structCentralDir�
_CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder
�_CD_EXTRA_FIELD_LENGTHr3�_CD_COMMENT_LENGTHrb�_CD_LOCAL_HEADER_OFFSETrnrWrgrhrirjrerorprq�MAX_EXTRACT_VERSIONr�rkrlrmrrrdr�r[r1r\rB)r�r<rUZsize_cdZ	offset_cd�concatZinferredrVr{�centdirrB�flagsr`�t�drrrrq0s�











��

���
zZipFile._RealGetContentscCsdd�|jD�S)z+Return a list of file names in the archive.cSsg|]
}|j�qSrr�)�.0rVrrr�
<listcomp>�sz$ZipFile.namelist.<locals>.<listcomp>�r[r�rrr�namelist~szZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the
        archive.r�r�rrr�infolist�szZipFile.infolistcCsLtdd|d�|jD]0}d|jdd�}td|j||jf|d�qdS)z+Print a table of contents for the zip file.z%-46s %19s %12s)z	File NamezModified    ZSize�rz%d-%02d-%02d %02d:%02d:%02dNr"z
%-46s %s %12d)r|r[rdrBrq)r�rr��daterrr�printdir�s�
�zZipFile.printdirc
Cs^d}|jD]N}z*|�|jd��}|�|�r,q W5QRXWq
tk
rV|jYSXq
dS)z%Read all the files and check the CRC.ir^N)r[rArBr>r)r�Z
chunk_sizer��frrr�testzip�s

zZipFile.testzipcCs$|j�|�}|dkr td|��|S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)r\r��KeyError)r�r!�inforrr�getinfo�s�zZipFile.getinfocCs6|r t|t�s tdt|�j��|r,||_nd|_dS)z)Set default password for encrypted files.�pwd: expected bytes, got %sN)r�r��	TypeErrorrvrr�)r�r�rrr�setpassword�s
zZipFile.setpasswordcCs|jS)z.The comment text associated with the ZIP file.)rir�rrrrb�szZipFile.commentcCs^t|t�stdt|�j��t|�tkrNddl}|jdtdd�|dt�}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr��
stacklevelT)r�r�r�rvrr0�ZIP_MAX_COMMENT�warnings�warnrirg)r�rbr�rrrrb�s
��c
Cs.|�|d|��}|��W5QR�SQRXdS)zReturn file bytes for name.r^N�rAr>)r�r!r�r<rrrr>�szZipFile.readF��force_zip64cs|dkrtd��|r0t|t�s0tdt|�j��|rD|dkrDtd���jsRtd��t|t�rb|}n,|dkr�t|�}�j|_	�j
|_n
��|�}|dkr��j
||d�S�jr�td���jd	7_t�j|j�j�j�fd
d��}�z|�t�}t|�tk�rtd��t�t|�}|ttk�r&td
��|�|t�}|t�rL|�|t�|jd@�r`t d��|jd@�rtt d��|t!d@�r�|�"d�}	n
|�"d�}	|	|j#k�r�td|j#|f��|jd	@}
|
�r�|�s҈j$}|�s�t%d|��nd}t&||||d�WS|�'��YnXdS)auReturn file-like object for 'name'.

        name is a string for the file name within the ZIP file, or a ZipInfo
        object.

        mode should be 'r' to read a file already in the ZIP file, or 'w' to
        write to a file newly added to the archive.

        pwd is the password to decrypt files (only used for reading).

        When writing, if the file size is not known in advance but may exceed
        2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
        files.  If the size is known in advance, it is best to pass a ZipInfo
        instance for name, with zinfo.file_size set.
        >r_r^zopen() requires mode "r" or "w"r�r_z'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedr�rrcs�jSr�)rrr�rr�<lambda>�r-zZipFile.open.<locals>.<lambda>zTruncated file headerz Bad magic number for file header� z$compressed patched data (flag bit 5)�@zstrong encryption (flag bit 6)r�r�rzz/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionNT)(r|r�r�r�rvrr<r
r�rer�rfr��_open_to_writerrnrrnrrrr>�sizeFileHeaderr0rrFr/r��
_FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHrjr��_FH_GENERAL_PURPOSE_FLAG_BITSr�rcr�r�rr	)r�r!r r�r�r�Zzef_fileZfheader�fnameZ	fname_strZis_encryptedrr�rrA�s~�




�


��
�zZipFile.opencCs�|r|jstd��|jr td��t|d�s0d|_d|_d|_d|_|jt	krZ|jdO_|j
sn|jdO_|jszd|_|jo�|p�|jdtk}|j
r�|j
�|j�|j
��|_|�|�d	|_|j
�|�|��d	|_t|||�S)
NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rqrrr��g�������?T)rfr|rr@rqrprorjrerr$rmr�r<rDrZrZrn�_writecheckrgrr�rN)r�r�r�r�rrrr�(s8
�

�
zZipFile._open_to_writecCs*|dkrt��}n
t�|�}|�|||�S)a#Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a ZipInfo object. You can
           specify a different directory using `path'.
        N)ry�getcwdr��_extract_member)r��memberr�r�rrr�extractSs

zZipFile.extractcCsH|dkr|��}|dkr"t��}n
t�|�}|D]}|�|||�q0dS)z�Extract all members from the archive to the current working
           directory. `path' specifies a different directory to extract to.
           `members' is optional and must be a subset of the list returned
           by namelist().
        N)r�ryr�r�r�)r�r��membersr�r,rrr�
extractall`s

zZipFile.extractallcCs^|j}|s(d}t�|dt|��}||_|�|�}dd�|�|�D�}|�dd�|D��}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*�_css|]}|�d�VqdS)�.N)�rstrip�r�r`rrr�	<genexpr>{sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdSr�rr�rrrr�}s)�!_windows_illegal_name_trans_tablerk�	maketransr0�	translate�splitr2)r�r��pathsep�tableZillegalrrr�_sanitize_windows_nameqs
zZipFile._sanitize_windows_namec
sLt|t�s|�|�}|j�dtjj�}tjjrB|�tjjtjj�}tj�	|�d}dtjj
tjjf�tjj��fdd�|�
tjj�D��}tjjdkr�|�|tjj�}tj�||�}tj�|�}tj�|�}|r�tj�|�s�t�|�|���rtj�|��st�|�|S|j||d��(}t|d��}t�||�W5QRXW5QRX|S)	zbExtract the ZipInfo object 'member' to a physical
           file on the path targetpath.
        rvrr�c3s|]}|�kr|VqdSr�rr��Zinvalid_path_partsrrr��s�z*ZipFile._extract_member.<locals>.<genexpr>�\)r�re)r�r
r�rBr{ryr�rzr�r��curdir�pardirr2r�r�r��dirname�exists�makedirsr�r��mkdirrA�shutil�copyfileobj)r�r�Z
targetpathr�r�Z	upperdirs�source�targetrr�rr��s2

&


� zZipFile._extract_membercCs�|j|jkr(ddl}|jd|jdd�|jdkr:td��|jsHtd��t|j�|j	s�d}t
|j�tkrpd	}n|j
tkr�d
}n|jtkr�d}|r�t|d��dS)
z6Check for errors before writing a file to the archive.rNzDuplicate name: %rrr��r_r`raz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed�Files countZFilesizezZipfile size� would require ZIP64 extensions)rBr\r�r�r r|r<r�rerfr0r[�ZIP_FILECOUNT_LIMITrqr�rnr
)r�r�r��requires_zip64rrrr��s,
�


�zZipFile._writecheckc
CsP|jstd��|jrtd��tj|||jd�}|��rDd|_d|_n0|dk	rT||_	n|j
|_	|dk	rl||_n|j|_|���r|j
��|jr�|j�|j�|j��|_|j	tkr�|jdO_|�|�d|_|j�|�||j|j<|j�|�d��|j��|_W5QRXn<t|d	��,}|�|d
��}t�||d�W5QRXW5QRXdS)zLPut the bytes from filename into the archive under the name
        arcname.�7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsr�rNrTFr?r_i ) r<r|rr
r�rjr�rprorer�rfr�rr$rDrZrZrnrrjr�rgr[r1r\rBrr�rAr�r�)r�rBr�rer�r��src�destrrrr�sF���


z
ZipFile.writec
Cs�t|t�r|�d�}t|t�sxt|t�t���dd�d�}|j|_|j|_	|j
ddkrpd|_|jdO_q|d	|_n|}|js�t
d
��|jr�t
d��|dk	r�||_|dk	r�||_	t|�|_|j�*|j|dd
��}|�|�W5QRXW5QRXdS)aWrite a file into the archive.  The contents is 'data', which
        may be either a 'str' or a 'bytes' instance; if it is a 'str',
        it is encoded as UTF-8 first.
        'zinfo_or_arcname' is either a ZipInfo instance or
        the name of the file in the archive.r�Nr")rBrdr�rvi�Ar)r�r�z?Can't write to ZIP archive while an open writing handle exists.r_)r )r�rkr�r
r�r�r�rer�rfrBrmr<r|rr0rqrrAr)r�Zzinfo_or_arcnamerVrer�r�r�rrr�writestr�s:


���
zZipFile.writestrcCs|��dS)z2Call the "close()" method in case the user forgot.Nrur�rrr�__del__szZipFile.__del__c	Cs||jdkrdS|jrtd��zB|jdkr\|jr\|j�"|jrJ|j�|j	�|�
�W5QRXW5|j}d|_|�|�XdS)zOClose the file, and for mode 'w', 'x' and 'a' write the ending
        records.NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r�)r<rr|rrr rgrr$rDrZ�_write_end_recordrrrrr	s
z
ZipFile.closecCs�|jD�]D}|j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}g}|jtksr|jtkr�|�|j�|�|j�d
}d
}n|j}|j}|jtkr�|�|j�d
}n|j}|j}	d}
|�rt|	d�}	t	j
dd
t|�ddt|�f|��|	}	t}
|j
tk�r$tt|
�}
n|j
tk�r:tt|
�}
t|
|j�}t|
|j�}zZ|��\}
}t	�
tt||j||j||j
|||j||t|
�t|	�t|j�d|j|j|�}Wnltk
�rttt||j||j|j |j
|||j||t|j!�t|	�t|j�d|j|j|ft"j#d��YnX|j$�%|�|j$�%|
�|j$�%|	�|j$�%|j�q|j$�&�}t|j�}||j'}|j'}d}|t(k�r�d}n|tk�r�d}n|tk�r�d}|�r$|j)�s�t*|d��t	�
t+t,ddddd||||�}|j$�%|�t	�
t-t.d|d�}|j$�%|�t/|d�}t/|d
�}t/|d
�}t	�
t0t1dd||||t|j2��	}|j$�%|�|j$�%|j2�|j3dk�rt|j$�4�|j$�5�dS)Nrrur$rr!rrr&r r�)rr,�Qrr�r�zCentral directory offsetzCentral directory sizer��,rrra)6r[rdrqr�rpr1rnr3r8rFr�r0r�rerr_r�rr�rhrWr�r�r�rgrirorbrlrm�DeprecationWarningr|rjrBr}�stderrr<rrZrZr�rfr
rJrKrGrHrFr]r\rir �truncater�)r�r�r�r�r�r3rqrprnZ
extra_datar�rhrWrBrjr�Zpos2ZcentDirCountZcentDirSizeZ
centDirOffsetr�Zzip64endrecZzip64locrecrUrrrr�5s$$
�


���
���





���


�
zZipFile._write_end_recordcCs4|jdkst�|jd8_|js0|js0|��dS)Nrr)rn�AssertionErrorrlr	rrrrrr�szZipFile._fpclose)N)N)r^N)F)NN)NNN)NNN)NN)$rrrrr<r�rr�rtryr�rqr�r�r�r�r�r�r]rb�setterr>rAr�r�r�r�r�r�r�rr�r�r	r�rrrrrrr�sT��ZN
	
		


b
+


*�
2�
)hc@s4eZdZdZdeddfdd�Zd
d	d
�Zdd�ZdS)rzDClass to create ZIP archives with Python library files and packages.r^Tr�cCstj|||||d�||_dS)N)r r�rs)rr��	_optimize)r�rr r�rs�optimizerrrr��s�zPyZipFile.__init__r�NcCs�t�|�}|rD||�sD|jr@tj�|�r,dnd}td||f�dStj�|�\}}tj�|��rhtj�|d�}tj�|��r�|r�d||f}n|}|jr�td|d|�|�	|d	d
�|�\}}	|jr�td|	�|�
||	�tt�|��}
|
�
d�|
D]�}tj�||�}tj�|�\}
}tj�|��rRtj�tj�|d���r�|j|||d�q�|d
kr�|�r~||��s~|jr�td|�q�|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�q�n�|j�r�td|�tt�|��D]�}tj�||�}tj�|�\}
}|d
k�r�|�r,||��s,|j�r�td|��q�|�	|d	d
�|�\}}	|j�rVtd|	�|�
||	��q�nP|d
d�d
k�r�td��|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�dS)a�Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
        the modules into the archive.  If pathname is a plain
        directory, listdir *.py and enter all modules.  Else, pathname
        must be a Python *.py file and the module will be put into the
        archive.  Added modules are always module.pyc.
        This method will compile the module.py into module.pyc if
        necessary.
        If filterfunc(pathname) is given, it is called with every argument.
        When it is False, the file or directory is skipped.
        r�rz%s %r skipped by filterfuncNz__init__.py�%s/%szAdding package in�asr���ZAdding)�
filterfunc�.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)ryr�rhr�r�r|r�r2�isfile�
_get_codenamer�sorted�listdir�remove�splitext�writepyr�)r��pathname�basenamer�Zlabel�dirr!Zinitnamer�r�ZdirlistrBr��rootZextrrrr��s�


��


�
�
zPyZipFile.writepyc
sd�fdd�	}|d}|d}tjj|dd�}tjj|dd�}tjj|d	d�}�jdk�r\tj�|�r�t�|�jt�|�jkr�|}	}
n�tj�|�r�t�|�jt�|�jkr�|}
|}	n�tj�|�r�t�|�jt�|�jkr�|}
|}	nvtj�|��rt�|�jt�|�jk�r|}
|}	nD||��rRt	j
jd
k�r4|}
nt	j
jdk�rH|}
n|}
|}	n|}
}	n��jd
k�rr|}
|}	n<|}	�jdk�r�|}
n&�jd	k�r�|}
nd��j�}t
|��tj�|
��r�t�|
�jt�|�jk�s�||�jd��s�|}
}	tj�|	�d}|�rd
||f}|
|fS)aReturn (filename, archivename) for the path.

        Given a module name path, return the correct file path and
        archive name, compiling if necessary.  For example, given
        /python/lib/string, return (/python/lib/string.pyc, string).
        r�c
sfddl}�jrtd|�z|j|d|d�Wn4|jk
r`}zt|j�WY�dSd}~XYnXdS)NrZ	CompilingT)�doraiser�F)�
py_compilerhr|�compile�PyCompileError�msg)rr�r��errr�rr�_compiles

z)PyZipFile._get_codename.<locals>._compiler�z.pycr�)�optimizationrrrz"invalid value for 'optimize': {!r})r�r�)r�)�	importlib�util�cache_from_sourcer�ryr�r�r�r�r}r�r��formatr|r�)
r�r�r�r�Zfile_pyZfile_pycZpycache_opt0Zpycache_opt1Zpycache_opt2r�r�r�Zarchivenamerr�rr��sj�
���

�zPyZipFile._get_codename)r�N)rrrrrr�r�r�rrrrr�s�

RcCst�t|�dd�S)a2
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    rN)�	itertools�islice�	_ancestry)r�rrr�_parentsRsrccs4|�tj�}|r0|tjkr0|Vt�|�\}}qdS)aR
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []
    N)r��	posixpathrzr�)r��tailrrrresrcCst�t|�j|�S)zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )r�filterfalse�set�__contains__)ZminuendZ
subtrahendrrr�_differencesr
csHeZdZdZedd��Z�fdd�Zdd�Zdd	�Ze	d
d��Z
�ZS)�CompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    cCs.tj�tt|��}dd�|D�}tt||��S)Ncss|]}|tjVqdSr�)rrz)r�r�rrrr��sz-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterabler�r�_deduper
)�names�parentsZas_dirsrrr�
_implied_dirs�szCompleteDirs._implied_dirscs tt|���}|t|�|��Sr�)rHrr�r^r)r�rrIrrr��szCompleteDirs.namelistcCst|���Sr�)rr�r�rrr�	_name_set�szCompleteDirs._name_setcCs,|��}|d}||ko||k}|r(|S|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        rv)r)r�r!rr�Z	dir_matchrrr�resolve_dir�szCompleteDirs.resolve_dircCsNt|t�r|St|t�s ||�Sd|jkr.t}|�|�}t|��t|��|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        r^)r�rrr �__new__�vars�update)r�r��resrrr�make�s



zCompleteDirs.make)rrrr�staticmethodrr�rrr�rrMrrrIrr�s

rcs,eZdZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)�
contextlib�suppressr)Z_FastLookup__namesrHrr�r�rIrrr��szFastLookup.namelistc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)rrr)Z_FastLookup__lookuprHrrr�rIrrr�szFastLookup._name_set)rrrrr�rrMrrrIrr�src@s�eZdZdZdZd#dd�Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZed d!��Zd"S)$ru�
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('abcde.zip', 'a.txt')
    >>> b
    Path('abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> str(c)
    'abcde.zip/b/c.txt'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})r�cCst�|�|_||_dSr�)rrr��at)r�r�rrrrr�	sz
Path.__init__cCst�|jj|j�Sr�)�	functools�partialr�rArr�rrrrA	sz	Path.opencCst�|j�d��S�Nrv)rr�rr�r�rrrr!	sz	Path.namec
Os6|���$}tj|f|�|���W5QR�SQRXdSr�)rAr3�
TextIOWrapperr>)r��args�kwargs�strmrrr�	read_text	s
zPath.read_textc
Cs(|���}|��W5QR�SQRXdSr�r�)r�r$rrr�
read_bytes	s
zPath.read_bytescCst�|j�d��|j�d�kSr )rr�rr�)r�r�rrr�	_is_child"	szPath._is_childcCst|j|�Sr�)rr�)r�rrrr�_next%	sz
Path._nextcCs|jp|j�d�Sr )r�endswithr�rrrr�(	szPath.is_dircCs
|��Sr�)r�r�rrr�is_file+	szPath.is_filecCs|j|j��kSr�)rr�rr�rrrr�.	szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)r�r|r�r(r�r��filterr')r�Zsubsrrr�iterdir1	szPath.iterdircCst�|jj|j�Sr�)rr2r�rBrr�rrr�__str__7	szPath.__str__cCs|jj|d�S)Nr�)�_Path__reprrr�rrrr�:	sz
Path.__repr__cCs t�|j|�}|�|j�|��Sr�)rr2rr(r�r)r��add�nextrrr�joinpath=	sz
Path.joinpathcCs(t�|j�d��}|r|d7}|�|�Sr )rr�rr�r()r�Z	parent_atrrr�parentC	szPath.parentN)r�)rrrrr.r�r]rAr!r%r&r'r(r�r*r�r,r-r�r1�__truediv__r2rrrrr�s*@


c
	s�ddl}d}|j|d�}|jdd�}|jdddd	d
�|jddd
ddd�|jdddddd�|jddddd
�|�|�}|jdk	r�|j}t|d��}|��}W5QRX|r�td�	|��td�n�|j
dk	r�|j
}t|d��}|��W5QRXn�|jdk	�r,|j\}}t|d��}|�
|�W5QRXn�|jdk	�r�|j�d�}	|j}
�fdd��t|	d��\}|
D]P}tj�|�}|�s�tj�tj�|��}|dtjtjfk�r�d}�|||��qfW5QRXdS) Nrz3A simple command-line interface for zipfile module.)�descriptionT)Zrequiredz-lz--list�	<zipfile>zShow listing of a zipfile)�metavar�helpz-ez	--extractr)r5z<output_dir>zExtract zipfile into target dir)�nargsr6r7z-cz--create�+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validr^z.The following enclosed file is corrupted: {!r}zDone testingcsptj�|�r|�||t�nPtj�|�rl|r8|�||�tt�|��D]$}�|tj�||�tj�||��qFdSr�)	ryr�r�rrr�r�r�r2)rVr��zippathZnm��addToZiprrr<s	s�zmain.<locals>.addToZipr_r�)�argparse�ArgumentParserZadd_mutually_exclusive_group�add_argument�
parse_argsZtestrr�r|rr^r�r�r�Zcreate�popryr�r�r�r�r�)
r"r=r4�parser�groupr�rVZbadfiler�Zzip_name�filesr�r:rr;r�mainK	s\
�
�
�
�




rE�__main__)N)N)�rZbinasciir�importlib.utilr�r3rryrr�r�rFr}ror�rr�r��ImportErrorr�r��__all__�	Exceptionrr
rrr�r�r�rrrrrr�r�r�r�r]r\r�r[rLrMrNrOrPrQrRrar}r~r�r�r�r�Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ
_CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr�r�r�Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr�r�r�r�r�Z_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMr�Z_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZEr�r�rGrHrErJrKrIZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRrYZStructr.r8r=r	rXr9�objectr
r�r�r�r�r�r�r�r�r�rrr4rrNrrrr�dict�fromkeysrr
rrrrErrrrr�<module>sl


�






+=q&�
&AN/2
=
genericpath.cpython-38.opt-1.pyc000064400000007643151450073350012441 0ustar00U

e5do�@s�dZddlZddlZddddddd	d
ddd
gZdd�Zdd
�Zdd	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd
�Zdd�Z
dd�Zdd�Zdd�ZdS)z�
Path operations common to more than one OS
Do not use directly.  The OS specific modules import the appropriate
functions from this module themselves.
�N�commonprefix�exists�getatime�getctime�getmtime�getsize�isdir�isfile�samefile�sameopenfile�samestatc	Cs.zt�|�Wnttfk
r(YdSXdS)zDTest whether a path exists.  Returns False for broken symbolic linksFT)�os�stat�OSError�
ValueError)�path�r�#/usr/lib64/python3.8/genericpath.pyrs
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z%Test whether a path is a regular fileF)r
rrr�S_ISREG�st_mode)r�strrrr	s
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z<Return true if the pathname refers to an existing directory.F)r
rrr�S_ISDIRr)�srrrrr's
cCst�|�jS)z1Return the size of a file, reported by os.stat().)r
r�st_size��filenamerrrr0scCst�|�jS)zCReturn the last modification time of a file, reported by os.stat().)r
r�st_mtimerrrrr5scCst�|�jS)z=Return the last access time of a file, reported by os.stat().)r
r�st_atimerrrrr:scCst�|�jS)zAReturn the metadata change time of a file, reported by os.stat().)r
r�st_ctimerrrrr?scCsl|sdSt|dttf�s*tttj|��}t|�}t|�}t|�D]$\}}|||krB|d|�SqB|S)zGGiven a list of pathnames, returns the longest common leading component�rN)	�
isinstance�list�tuple�mapr
�fspath�min�max�	enumerate)�m�s1�s2�i�crrrrEscCs|j|jko|j|jkS)z5Test whether two stat buffers reference the same file)�st_ino�st_dev)r)r*rrrrWs
�cCst�|�}t�|�}t||�S)z�Test whether two pathnames reference the same actual file or directory

    This is determined by the device number and i-node number and
    raises an exception if an os.stat() call on either pathname fails.
    )r
rr)�f1�f2r)r*rrrr
^s

cCst�|�}t�|�}t||�S)z:Test whether two open file objects reference the same file)r
�fstatr)�fp1�fp2r)r*rrrrks

cCs�|�|�}|r"|�|�}t||�}|�|�}||krz|d}||krz|||d�|krp|d|�||d�fS|d7}q<||dd�fS)z�Split the extension from a pathname.

    Extension is everything from the last dot to the end, ignoring
    leading dots.  Returns "(root, ext)"; ext may be empty.�Nr)�rfindr&)�p�sep�altsep�extsep�sepIndex�altsepIndex�dotIndex�
filenameIndexrrr�	_splitextys




r>cGs`d}}|D]<}t|t�r d}qt|t�r0d}qt|�d|jj���d�q|r\|r\td�d�dS)NFTz;() argument must be str, bytes, or os.PathLike object, not z.Can't mix strings and bytes in path components)r �str�bytes�	TypeError�	__class__�__name__)�funcname�args�hasstr�hasbytesrrrr�_check_arg_types�s

�rH)�__doc__r
r�__all__rr	rrrrrrrr
rr>rHrrrr�<module>s.
�	
pipes.cpython-38.opt-2.pyc000064400000011502151450073350011256 0ustar00U

e5d�"�@slddlZddlZddlZddlmZdgZdZdZdZdZ	dZ
d	Zeeee	e
egZGd
d�d�Z
dd�ZdS)
�N)�quote�TemplateZffz-fzf-�--z.-z-.c@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)rcCsd|_|��dS)Nr)�	debugging�reset��self�r	�/usr/lib64/python3.8/pipes.py�__init__UszTemplate.__init__cCsd|jfS)Nz<Template instance, steps=%r>��stepsrr	r	r
�__repr__ZszTemplate.__repr__cCs
g|_dS�Nrrr	r	r
r^szTemplate.resetcCs"t�}|jdd�|_|j|_|Sr)rr
r)r�tr	r	r
�clonebszTemplate.clonecCs
||_dSr)r)r�flagr	r	r
�debugjszTemplate.debugcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|dd	kr~t�d
|�s~td��|dd	kr�t�d|�s�td
��|j�	||f�dS)N�z%Template.append: cmd must be a stringzTemplate.append: bad kind %rz-Template.append: SOURCE can only be prepended����z'Template.append: already ends with SINKr�f�\$IN\bz#Template.append: missing $IN in cmd�\$OUT\bz$Template.append: missing $OUT in cmd)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append�r�cmd�kindr	r	r
r"nszTemplate.appendcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|ddkr~t�d	|�s~td
��|ddkr�t�d|�s�td��|j�	d||f�dS)
Nrz&Template.prepend: cmd must be a stringzTemplate.prepend: bad kind %rz+Template.prepend: SINK can only be appendedrrz,Template.prepend: already begins with SOURCErrz$Template.prepend: missing $IN in cmdrz%Template.prepend: missing $OUT in cmd)
rrrrrr
rr r!�insertr#r	r	r
�prepend~szTemplate.prependcCs6|dkr|�|�S|dkr$|�|�Std|f��dS)N�r�wz,Template.open: rw must be 'r' or 'w', not %r)�open_r�open_wr)r�fileZrwr	r	r
�open�s

�z
Template.opencCsB|jst|d�S|jddtkr*td��|�|d�}t�|d�S)Nr(rrz)Template.open_r: pipeline ends width SINKr)r
r-rr�makepipeline�os�popen�rr,r$r	r	r
r*�s
zTemplate.open_rcCsB|jst|d�S|jddtkr*td��|�d|�}t�|d�S)Nr)rrz,Template.open_w: pipeline begins with SOURCEr)r
r-rrr.r/r0r1r	r	r
r+�s
zTemplate.open_wcCst�|�||��Sr)r/�systemr.)r�infile�outfiler	r	r
�copy�sz
Template.copycCs(t||j|�}|jr$t|�d|}|S)Nzset -x; )r.r
r�print)rr3r4r$r	r	r
r.�s
zTemplate.makepipelineN)�__name__�
__module__�__qualname__rrrrrr"r'r-r*r+r5r.r	r	r	r
rRs

cCs�g}|D]\}}|�d||dg�q|s:|�ddddg�|ddd�\}}|ddkrr|sr|�dddddg�||dd<|ddd�\}}|ddkr�|s�|�ddddg�||dd<g}tdt|��D]v}||dd	}||d	}	|ddk�s|	ddkr�t��\}
}t�|
�|�|�|||dd<||d<q�|D]�}|\}
}}}|ddk�r�d
t|�d|}|ddk�r�dt|
�d|}|dd
k�r�|
�r�|dt|
�}|dd
k�r�|�r�|dt|�}||d<�qN|dd}|dd�D]T}|dd�\}}|ddk�rTd|k�rFd|d}|d|}n|d|}�q|�r�d}|D]}|dt|�}�qrdt|d�d}|d|d|}|S)Nr�catrrr�rr�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15)	r"r&�range�len�tempfileZmkstempr/�closer)r3r
r4�listr$r%Zgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr,Ztrapcmdr	r	r
r.�s`


r.)r r/rBZshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr.r	r	r	r
�<module><s �cpoplib.cpython-38.pyc000064400000032225151450073350010470 0ustar00U

e5d�:�@sldZddlZddlZddlZddlZzddlZdZWnek
rLdZYnXddgZGdd�de	�Z
dZd	Zd
Z
dZe
eZdZGd
d�d�Zer�Gdd�de�Ze�d�edk�rhddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]BZ e�!e �\Z"Z#Z$ede �e#D]Z%ede%��q@ed��qe�&�dS)z@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/poplib.pyrs�ni��
�
ic@seZdZdZdZeejfdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd=d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Ze�d0�Z d1d2�Z!d3d4�Z"d>d5d6�Z#d7d8�Z$d9d:�Z%d?d;d<�Z&dS)@raPThis class supports both the minimal and optional command sets.
    Arguments can be strings or integers (where appropriate)
    (e.g.: retr(1) and retr('1') both work equally well.

    Minimal Command Set:
            USER name               user(name)
            PASS string             pass_(string)
            STAT                    stat()
            LIST [msg]              list(msg = None)
            RETR msg                retr(msg)
            DELE msg                dele(msg)
            NOOP                    noop()
            RSET                    rset()
            QUIT                    quit()

    Optional Commands (some servers support these):
            RPOP name               rpop(name)
            APOP name digest        apop(name, digest)
            TOP msg n               top(msg, n)
            UIDL [msg]              uidl(msg = None)
            CAPA                    capa()
            STLS                    stls()
            UTF8                    utf8()

    Raises one exception: 'error_proto'.

    Instantiate with:
            POP3(hostname, port=110)

    NB:     the POP protocol locks the mailbox from user
            authorization until QUIT, so be sure to get in, suck
            the messages, and quit, each time you access the
            mailbox.

            POP is a line-based protocol, which means large mail
            messages consume lots of python cycles reading them
            line-by-line.

            If it's available on your mail server, use IMAP4
            instead, it doesn't suffer from the two problems
            above.
    zUTF-8cCsP||_||_d|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCst�|j|jf|�S�N)�socketZcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlineps
z
POP3._putlinecCs.|jrtdt|��t||j�}|�|�dS)Nz*cmd*)rrr �bytes�encodingr$r"rrr�_putcmdxszPOP3._putcmdcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sHtd��t|�}|dd�tkrp|dd�|fS|dd�t	kr�|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrrr r!�CR)rr#�octetsrrr�_getline�s
z
POP3._getlinecCs:|��\}}|jdkr$tdt|��|�d�s6t|��|S)Nrz*resp*�+)r/rrr �
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsl|��}g}d}|��\}}|dkrb|�d�rB|d}|dd�}||}|�|�|��\}}q|||fS)Nr�.s..r)rr/r1�append)rr2�listr.r#r3rrr�_getlongresp�s

zPOP3._getlongrespcCs|�|�|��Sr)r'rr"rrr�	_shortcmd�s
zPOP3._shortcmdcCs|�|�|��Sr)r'r7r"rrr�_longcmd�s
z
POP3._longcmdcCs|jSr)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|�d|�S)zVSend user name, return response

        (should indicate password required).
        zUSER %s�r8�r�userrrrr@�sz	POP3.usercCs|�d|�S)z�Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        zPASS %sr>)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jr&tdt|��t|d�}t|d�}||fS)z]Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        ZSTATz*stat*r�)r8�splitrrr �int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dk	r|�d|�S|�d�S)aRequest listing, return result.

        Result without a message number argument is in form
        ['response', ['mesg_num octets', ...], octets].

        Result when a message number argument is given is a
        single response: the "scan listing" for that message.
        NzLIST %sZLIST�r8r9�r�whichrrrr6�s	z	POP3.listcCs|�d|�S)zoRetrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        zRETR %s�r9rGrrr�retr�sz	POP3.retrcCs|�d|�S)zFDelete message number 'which'.

        Result is 'response'.
        zDELE %sr>rGrrr�dele�sz	POP3.delecCs
|�d�S)zXDoes nothing.

        One supposes the response indicates the server is alive.
        ZNOOPr>r:rrr�noopsz	POP3.noopcCs
|�d�S)z(Unmark all messages marked for deletion.ZRSETr>r:rrr�rsetsz	POP3.rsetcCs|�d�}|��|S)zDSignoff: commit changes on server, unlock mailbox, close connection.ZQUIT)r8�close)rr2rrr�quits
z	POP3.quitcCs�z |j	}d|_	|dk	r|��W5|j}d|_|dk	r�zVz|�tj�Wn@tk
r�}z"|jtjkrxt|dd�dkrx�W5d}~XYnXW5|��XXdS)z8Close the connection without assuming anything about it.NZwinerrorri&')
rrNZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattrr)rr�excrrrrrNs �z
POP3.closecCs|�d|�S)zNot sure what this does.zRPOP %sr>r?rrr�rpop5sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|s&td��ddl}|�d�|}|�|��	�}|�
d||f�S)aAuthorisation

        - only possible if server has supplied a timestamp in initial greeting.

        Args:
                user     - mailbox user;
                password - mailbox password.

        NB: mailbox is locked by server from here to 'quit()'
        z!-ERR APOP not supported by serverrNrz
APOP %s %s)r%r&�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr8)rr@ZpasswordZsecret�mrWZdigestrrr�apop<sz	POP3.apopcCs|�d||f�S)z�Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        z	TOP %s %srI)rrHZhowmuchrrr�topQszPOP3.topcCs |dk	r|�d|�S|�d�S)z�Return message digest (unique id) list.

        If 'which', result contains unique id for that message
        in the form 'response mesgnum uid', otherwise result is
        the list ['response', ['mesgnum uid', ...], octets]
        NzUIDL %sZUIDLrFrGrrr�uidlZsz	POP3.uidlcCs
|�d�S)zITry to enter UTF-8 mode (see RFC 6856). Returns server response.
        ZUTF8r>r:rrr�utf8fsz	POP3.utf8c	
Cspdd�}i}z4|�d�}|d}|D]}||�\}}|||<q$Wn*tk
rj}ztd��W5d}~XYnX|S)aReturn server capabilities (RFC 2449) as a dictionary
        >>> c=poplib.POP3('localhost')
        >>> c.capa()
        {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
         'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
         'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
         'UIDL': [], 'RESP-CODES': []}
        >>>

        Really, according to RFC 2449, the cyrus folks should avoid
        having the implementation split into multiple arguments...
        cSs"|�d���}|d|dd�fS)N�asciirr)�decoderC)r#Zlstrrr�	_parsecapyszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by serverN)r9r)	rr`�capsr2ZrawcapsZcaplineZcapnmZcapargsZ_errrrr�capals

z	POP3.capacCsxtstd��|jrtd��|��}d|kr2td��|dkrBt��}|�d�}|j|j|j	d�|_|j�
d�|_d|_|S)	z{Start a TLS session on the active connection as specified in RFC 2595.

                context - a ssl.SSLContext
        z-ERR TLS support missing�$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by serverN�Zserver_hostnamerT)�HAVE_SSLrrrb�ssl�_create_stdlib_contextr8�wrap_socketrr
rr)r�contextrar2rrr�stls�s 
�z	POP3.stls)N)N)N)'rrr�__doc__r&�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr$r'r/rr7r8r9r;r=r@rArEr6rJrKrLrMrOrNrT�re�compilerUrZr[r\r]rbrjrrrrr3sB+�





	
c@s8eZdZdZeddejdfdd�Zdd�Zd	dd�Z	dS)
�POP3_SSLaPOP3 client class over SSL connection

        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
                                   context=None)

               hostname - the hostname of the pop3 over ssl server
               port - port number
               keyfile - PEM formatted file that contains your private key
               certfile - PEM formatted certificate chain file
               context - a ssl.SSLContext

        See the methods of the parent class POP3 for more documentation.
        NcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrB)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrrrqrfrgrirr)rr
rrrrqrrirtrrrr�s$��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrd)rrrirhr
)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��dS)z�The method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            rcN)r)rrrrqrirrrrj�sz
POP3_SSL.stls)NNN)
rrrrk�
POP3_SSL_PORTrrmrrrjrrrrrp�s�
rp�__main__rrB�zMessage %d:z   z-----------------------)'rkrQrnrrrfre�ImportError�__all__�	Exceptionrrlrwr-ZLFr!r+rrpr5r�argv�arr;r@rAr6rEZnumMsgsZ	totalSize�range�irJ�header�msgr.r#rOrrrr�<module>sL
n0

getopt.cpython-38.pyc000064400000014201151450073350010477 0ustar00U

e5dA�@s�dZddddgZddlZzddlmZWnek
rDdd	�ZYnXGd
d�de�ZeZgfdd�Z	gfdd�Z
d
d�Zdd�Zdd�Z
dd�Zedkr�ddlZee	ejdd�dddg��dS)a�Parser for command line options.

This module helps scripts to parse the command line arguments in
sys.argv.  It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--').  Long options similar to those supported by GNU software
may be used as well via an optional third argument.  This module
provides two functions and an exception:

getopt() -- Parse command line options
gnu_getopt() -- Like getopt(), but allow option and non-option arguments
to be intermixed.
GetoptError -- exception (class) raised with 'opt' attribute, which is the
option involved with the exception.
�GetoptError�error�getopt�
gnu_getopt�N)�gettextcCs|S�N�)�srr�/usr/lib64/python3.8/getopt.py�_)�rc@s&eZdZdZdZddd�Zdd�ZdS)r�cCs||_||_t�|||�dSr)�msg�opt�	Exception�__init__)�selfrrrrr
r.szGetoptError.__init__cCs|jSr)r)rrrr
�__str__3szGetoptError.__str__N)r
)�__name__�
__module__�__qualname__rrrrrrrr
r+s
cCs�g}t|�td�kr|g}nt|�}|r�|d�d�r�|ddkr�|ddkr\|dd�}q�|d�d�r�t||ddd�||dd��\}}q$t||ddd�||dd��\}}q$||fS)a@getopt(args, options[, long_options]) -> opts, args

    Parses command line options and parameter list.  args is the
    argument list to be parsed, without the leading reference to the
    running program.  Typically, this means "sys.argv[1:]".  shortopts
    is the string of option letters that the script wants to
    recognize, with options that require an argument followed by a
    colon (i.e., the same format that Unix getopt() uses).  If
    specified, longopts is a list of strings with the names of the
    long options which should be supported.  The leading '--'
    characters should not be included in the option name.  Options
    which require an argument should be followed by an equal sign
    ('=').

    The return value consists of two elements: the first is a list of
    (option, value) pairs; the second is the list of program arguments
    left after the option list was stripped (this is a trailing slice
    of the first argument).  Each option-and-value pair returned has
    the option as its first element, prefixed with a hyphen (e.g.,
    '-x'), and the option argument as its second element, or an empty
    string if the option has no argument.  The options occur in the
    list in the same order in which they were found, thus allowing
    multiple occurrences.  Long and short options may be mixed.

    r
r�-�--�N�)�type�list�
startswith�do_longs�	do_shorts)�args�	shortopts�longopts�optsrrr
r8s((cCs6g}g}t|t�r|g}nt|�}|�d�r>|dd�}d}ntj�d�rPd}nd}|�r.|ddkrz||dd�7}�q.|ddd	�dkr�t||dd	d�||dd��\}}qT|ddd�d
kr�|dd
kr�t||ddd�||dd��\}}qT|�r||7}�q.qT|�	|d�|dd�}qT||fS)agetopt(args, options[, long_options]) -> opts, args

    This function works like getopt(), except that GNU style scanning
    mode is used by default. This means that option and non-option
    arguments may be intermixed. The getopt() function stops
    processing options as soon as a non-option argument is
    encountered.

    If the first character of the option string is `+', or if the
    environment variable POSIXLY_CORRECT is set, then option
    processing stops as soon as a non-option argument is encountered.

    �+rNTZPOSIXLY_CORRECTFrrrr)
�
isinstance�strrr�os�environ�getrr�append)r r!r"r#Z	prog_argsZall_options_firstrrr
rcs2

( (cCs�z|�d�}Wntk
r&d}Yn X|d|�||dd�}}t||�\}}|r�|dkr�|svttd�||��|d|dd�}}n|dk	r�ttd�||��|�d||p�df�||fS)N�=rzoption --%s requires argumentrz%option --%s must not have an argumentrr
)�index�
ValueError�
long_has_argsrrr*)r#rr"r �i�optarg�has_argrrr
r�s
rcs��fdd�|D�}|s(ttd������|kr8d�fS�d|krLd�fSt|�dkrjttd�����t|�dkszt�|d	}|�d�}|r�|dd
�}||fS)Ncsg|]}|���r|�qSr)r)�.0�o�rrr
�
<listcomp>�s
z!long_has_args.<locals>.<listcomp>zoption --%s not recognizedFr+Trzoption --%s not a unique prefixr���)rr�len�AssertionError�endswith)rr"Z
possibilitiesZunique_matchr1rr4r
r.�s
r.cCs�|dkr�|d|dd�}}t||�rh|dkr\|sFttd�||��|d|dd�}}|d}}nd}|�d||f�q||fS)Nr
rrzoption -%s requires argumentr)�
short_has_argrrr*)r#Z	optstringr!r rr0rrr
r�s
�rcCsXtt|��D]4}|||kr(dkrnq|�d|d�Sqttd�||��dS)N�:rzoption -%s not recognized)�ranger7rrr)rr!r/rrr
r:�sr:�__main__rza:bzalpha=Zbeta)�__doc__�__all__r'rr�ImportErrorrrrrrrr.rr:r�sys�print�argvrrrr
�<module>s"!+2uu.cpython-38.pyc000064400000007314151450073350007635 0ustar00U

��.em�@sjdZddlZddlZddlZdddgZGdd�de�Zddd�d	d�Zdd
d�Zdd�Z	e
d
krfe	�dS)z�Implementation of the UUencode and UUdecode functions.

encode(in_file, out_file [,name, mode], *, backtick=False)
decode(in_file [, out_file, mode, quiet])
�N�Error�encode�decodec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/uu.pyr&sF��backtickc	Csjg}�zH|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfzt�	|�j
}Wntk
rdYnXt|d�}|�
|�|dkr�tjj}nt|t�r�t|d�}|�
|�|dkr�d}|dkr�d}|�dd�}|�dd	�}|�d
|d@|f�d��|�d
�}t|�dk�r0|�tj||d��|�d
�}�q|�rB|�d�n
|�d�W5|D]}|���qTXdS)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
s`
end
s 
end
)�close�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu)�in_file�out_file�name�moder�opened_files�f�datarrr	r)sF








c

Cspg}|dkrtjj}nt|t�r4t|d�}|�|��z|��}|sLt	d��|�
d�sXq8|�dd�}t|�dkr8|ddkr8zt
|d	d
�Wq�Wq8tk
r�Yq8Xq8|dk�r:|d�d��d
�}tj�|�r�t	d|����|�
tj��s*dtj��|k�s*tj�r:|�
tj��s*dtj��|k�r:t	d|�d���|dk�rRt
|d	d
�}|dk�rftjj}n0t|t��r�t|d�}t�||�|}|�|�|��}	|	�rD|	�d�dk�rDzt�|	�}
Wnjtj	k
�r,}zH|	ddd@ddd}t�|	d|��}
|�stj�d|�W5d}~XYnX|�|
�|��}	�q�|	�sRt	d��W5|D]}|���qZXdS)zDecode uuencoded filerr
z'No valid begin line found in input filesbegin� ��r��Ns 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrrr r�readliner�
startswith�splitr%�int�
ValueError�rstriprrr�exists�sep�altsepr!�chmod�stripr&Za2b_uu�stderrr#)
r'r(r*�quietr+r,ZhdrZ	hdrfields�fp�sr-�v�nbytesrrr	rcsr





��
��




"
cCs4ddl}|jdd�}|jddddd	d
d�|jdd
ddd	d
d�|��\}}t|�dkrl|�d�t�d�tjj	}tj
j	}t|�dkr�|d}t|�dkr�|d}|jr�|jr�t
|t�r�t|d�}nttjdd�t�d�t||�nD|j�r&t
|t��rt|d�}nttjdd�t�d�t||�dS)zuuencode/uudecode main programrNz'usage: %prog [-d] [-t] [input [output]])Zusagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r/zincorrect number of argumentsr1rz: cannot do -t to stdoutr
z: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr%�errorr�exitrrr!rrMrrr�print�argvr)rN�parserZoptions�args�input�outputrrr	�test�s6




rX�__main__)NN)NNF)�__doc__r&rr�__all__�	ExceptionrrrrXrrrrr	�<module>s
:
J&pickletools.cpython-38.opt-1.pyc000064400000201414151450073350012470 0ustar00U

e5d.m�L@s�
dZddlZddlZddlZddlZddlZdddgZejZdZdZ	dZ
d	Zd
ZGdd�de
�Zdd
lmZdd�Zeddedd�Zdd�Zeddedd�Zdd�Zeddedd�Zdd�Zed ded!d�Zd"d#�Zed$d%ed&d�Z�d�d(d)�Zed*eed+d�Zd,d-�Zed.eed/d�Zd0d1�Z ed2ee d3d�Z!d4d5�Z"ed6e	e"d7d�Z#d8d9�Z$ed:e
e$d;d�Z%d<d=�Z&ed>e	e&d?d�Z'd@dA�Z(edBee(dCd�Z)dDdE�Z*edFee*dGd�Z+dHdI�Z,edJee,dKd�Z-dLdM�Z.edNee.dOd�Z/dPdQ�Z0edRe	e0dSd�Z1dTdU�Z2edVee2dWd�Z3dXdY�Z4edZee4d[d�Z5d\d]�Z6d^d_�Z7ed`ee6dad�Z8edbee7dcd�Z9ddde�Z:edfee:dgd�Z;dhdi�Z<edjd%e<dkd�Z=ddllm>Z>dmdn�Z?edoe	e?dpd�Z@dqdr�ZAedse
eAdtd�ZBGdudv�dve
�ZCeCdweDdxdy�ZEZFeCdzeDeGfd{dy�ZHeCd|eGd}dy�ZIeCd~eJddy�ZKeCd�eLeMfd�dy�ZNZOeCd�eLd�dy�ZPeCd�eQd�dy�ZReCd�eMd�dy�ZSeCd�eTd�d�dy�ZUeCd�eVd�dy�ZWeCd�eXd�dy�ZYeCd�eZd�dy�Z[eCd�e\d�dy�Z]eCd�e\d�dy�Z^eCd�e
d�dy�Z_eCd�e
d�dy�Z`eCd�eCd�dy�ZaeCd�eCd�dy�ZbGd�d��d�e
�ZcecZdedd�d�e8geHgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�e9geEgdd�d��edd�d�e@geEgdd�d��edd�d�eBgeEgdd�d��edd�d�egeNgdd�d��edd�d�e%geNgdd�d��edd�d�e#geNgdd�d��edd�d�e)gePgd�d�d��edd�d�e'gePgd�d�d��edd�d�e+gePgdd�d��edd�d�e-geRgd�d�d��edd�d�dge_gd�d�d��edd�d�de_ge_gd�d�d��edd�d�dgeUgdd�d��edd�d�dgeIgdd�d��edd�d�dgeIgdd�d��edd�d�e/geSgdd�d��edd�d�e1geSgdd�d��edd�d�e3geSgdd�d��edd�d�e5geSgdd�d��edd�d�e;geKgdd�d��edd�d�e=geKgdd�d��edd�d�dgeYgdd�d��edd�d�deYe`geYgdd�d��edd�d�deYeaebgeYgdd�d��edd�d�deaebgeYgdd�d��edd�d�dgeWgdd�d��edd�d�deaebgeWgdd�d��edd�d�de`geWgd�dd��ed�d�dde`e`geWgd�dd��ed�d�dde`e`e`geWgd�dd��ed�d�ddge[gd�d	d��ed�d
�ddeaebge[gd�dd��ed�d
�dde[e`e`ge[gd�dd��ed�d�dde[eaebge[gd�dd��ed�d�ddge]gd�dd��ed�d�dde]eaebge]gd�dd��ed�d�ddeaebge^gd�dd��ed�d�dde`ggd�dd��ed�d�d de`ge`e`gd�d!d��ed�d"�d#dgeagd�d$d��ed�d%�d&deaebggd�d'd��ed�d(�d)e8ge`gd�d*d��ed�d+�d,ege`gd�d-d��ed�d.�d/ege`gd�d0d��ed�d1�d2e8ggd�d3d��ed�d4�d5eggd�d6d��ed�d7�d8eggd�d9d��ed�d:�d;de`ge`gd�d<d��ed�d=�d>ege`gd�d?d��ed�d@�dAege`gd�dBd��ed�dC�dDege`gd�dEd��ed�dF�dGe!ge`gd�dHd��ed�dI�dJdeSeSge`gd�dKd��ed�dL�dMde`e`ge`gd�dNd��ed�dO�dPde`e`ge`gd�dQd��ed�dR�dSe!eaebge`gd�dTd��ed�dU�dVdeae`ebge`gd�dWd��ed�dX�dYde`e`ge`gd�dZd��ed�d[�d\de`e`e`ge`gd�d]d��ed�d^�d_eggd�d`d��ed�da�dbde`ggd�dcd��ed�dd�deeggd�dfd��ed�dg�dhege`gd�did��ed�dj�dkde`ge`gd�dld��gDZe[diZfiZgehee�D]n\ZiZjejjkefk�rBel�dmejjkefejjkeif��ejjmegk�rjel�dnejjmegejjmeif��eiefejjk<eiegejjm<�q[f[g[i[jiZneeD]Zjejenejjm<�q�[j�d��dp�dq�Zoeo�[o�d��dr�ds�Zp�dtd�Zq�dud�Zr�d��dvd�ZsG�dw�dx��dx�Zt�dyZu�dzZveuev�d{�Zw�d|�d}�Zxey�d~k�
r�ddlzZzezj{�d�d��Z|e|j}�d�ez�~�d���d��d��d��e|j}�d��d�ejez�~�d���d��d��e|j}�d��d��d��d��d��e|j}�d��d�deD�d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��e|���Z�e�j��
rPex�n�e�j��
r^�d�ndZ�e�j��
ste|���n�e�e�j��dk�
r�ese�j�de�j�de�j�e��nVe�j��
r�indZ�e�j�D]>Z�e�j�j�e�jk�d��Z�e�j���e��d��ese�e�j�e�e�j�e���
q�dS(�ar"Executable documentation" for the pickle module.

Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here.  Some functions meant for external use:

genops(pickle)
   Generate all the opcodes in a pickle, as (opcode, arg, position) triples.

dis(pickle, out=None, memo=None, indentlevel=4)
   Print a symbolic disassembly of a pickle.
�N�dis�genops�optimize���������������c@seZdZdZdd�ZdS)�ArgumentDescriptor��name�n�reader�doccCs||_||_||_||_dS�Nr)�selfrr
rr�r�#/usr/lib64/python3.8/pickletools.py�__init__�szArgumentDescriptor.__init__N��__name__�
__module__�__qualname__�	__slots__rrrrrr
�sr
)�unpackcCs"|�d�}|r|dStd��dS)zG
    >>> import io
    >>> read_uint1(io.BytesIO(b'\xff'))
    255
    �rz'not enough data in stream to read uint1N)�read�
ValueError��f�datarrr�
read_uint1�s
r!�uint1rzOne-byte unsigned integer.rcCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint2(io.BytesIO(b'\xff\x00'))
    255
    >>> read_uint2(io.BytesIO(b'\xff\xff'))
    65535
    �z<Hrz'not enough data in stream to read uint2N�r�len�_unpackrrrrr�
read_uint2�s	
r'�uint2r#z)Two-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_int4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_int4(io.BytesIO(b'\x00\x00\x00\x80')) == -(2**31)
    True
    �z<irz&not enough data in stream to read int4Nr$rrrr�	read_int4�s	
r*�int4r)z8Four-byte signed integer, little-endian, 2's complement.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_uint4(io.BytesIO(b'\x00\x00\x00\x80')) == 2**31
    True
    r)z<Irz'not enough data in stream to read uint4Nr$rrrr�
read_uint4s	
r,�uint4z*Four-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00'))
    255
    >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1
    True
    �z<Qrz'not enough data in stream to read uint8Nr$rrrr�
read_uint8&s	
r/�uint8r.z+Eight-byte unsigned integer, little-endian.TcCs�|��}|�d�std��|dd�}|rtdD]8}|�|�r.|�|�sVtd||f��|dd�}qtq.td|��|r�t�|�d	�d
�}|S)au
    >>> import io
    >>> read_stringnl(io.BytesIO(b"'abcd'\nefg\n"))
    'abcd'

    >>> read_stringnl(io.BytesIO(b"\n"))
    Traceback (most recent call last):
    ...
    ValueError: no string quotes around b''

    >>> read_stringnl(io.BytesIO(b"\n"), stripquotes=False)
    ''

    >>> read_stringnl(io.BytesIO(b"''\n"))
    ''

    >>> read_stringnl(io.BytesIO(b'"abcd"'))
    Traceback (most recent call last):
    ...
    ValueError: no newline found when trying to read stringnl

    Embedded escapes are undone in the result.
    >>> read_stringnl(io.BytesIO(br"'a\n\\b\x00c\td'" + b"\n'e'"))
    'a\n\\b\x00c\td'
    �
z-no newline found when trying to read stringnlNr)�"�'z,strinq quote %r not found at both ends of %rrzno string quotes around %rr�ascii)�readline�endswithr�
startswith�codecs�
escape_decode�decode)rr:�stripquotesr �qrrr�
read_stringnl;s"


�r=�stringnlz�A newline-terminated string.

                   This is a repr-style string, with embedded escapes, and
                   bracketing quotes.
                   cCst|dd�S)NF)r;)r=�rrrr�read_stringnl_noescapetsr@�stringnl_noescapeaA newline-terminated string.

                        This is a str-style string, without embedded escapes,
                        or bracketing quotes.  It should consist solely of
                        printable ASCII characters.
                        cCsdt|�t|�fS)zp
    >>> import io
    >>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
    'Queue Empty'
    z%s %s)r@r?rrr�read_stringnl_noescape_pair�srB�stringnl_noescape_paira�A pair of newline-terminated strings.

                             These are str-style strings, without embedded
                             escapes, or bracketing quotes.  They should
                             consist solely of printable ASCII characters.
                             The pair is returned as a single string, with
                             a single blank separating the two strings.
                             cCs@t|�}|�|�}t|�|kr(|�d�Std|t|�f��dS)z�
    >>> import io
    >>> read_string1(io.BytesIO(b"\x00"))
    ''
    >>> read_string1(io.BytesIO(b"\x03abcdef"))
    'abc'
    �latin-1z2expected %d bytes in a string1, but only %d remainN)r!rr%r:r�rr
r rrr�read_string1�s	


�rF�string1z�A counted string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes in the string, and the second argument is that many
              bytes.
              cCsTt|�}|dkrtd|��|�|�}t|�|kr<|�d�Std|t|�f��dS)aP
    >>> import io
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    ''
    >>> read_string4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    'abc'
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a string4, but only 6 remain
    rzstring4 byte count < 0: %drDz2expected %d bytes in a string4, but only %d remainN)r*rrr%r:rErrr�read_string4�s



�rH�string4z�A counted string.

              The first argument is a 4-byte little-endian signed int giving
              the number of bytes in the string, and the second argument is
              that many bytes.
              cCs:t|�}|�|�}t|�|kr"|Std|t|�f��dS)z�
    >>> import io
    >>> read_bytes1(io.BytesIO(b"\x00"))
    b''
    >>> read_bytes1(io.BytesIO(b"\x03abcdef"))
    b'abc'
    z1expected %d bytes in a bytes1, but only %d remainN)r!rr%rrErrr�read_bytes1�s	

�rJ�bytes1z�A counted bytes string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)aN
    >>> import io
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    b'abc'
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a bytes4, but only 6 remain
    z#bytes4 byte count > sys.maxsize: %dz1expected %d bytes in a bytes4, but only %d remainN)r,�sys�maxsizerrr%rErrr�read_bytes4�s



�rN�bytes4z�A counted bytes string.

              The first argument is a 4-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    b'abc'
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytes8, but only 6 remain
    z#bytes8 byte count > sys.maxsize: %dz1expected %d bytes in a bytes8, but only %d remainN)r/rLrMrrr%rErrr�read_bytes8s


�rP�bytes8z�A counted bytes string.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsTt|�}|tjkrtd|��|�|�}t|�|kr<t|�Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytearray8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    bytearray(b'')
    >>> read_bytearray8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    bytearray(b'abc')
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytearray8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytearray8, but only 6 remain
    z'bytearray8 byte count > sys.maxsize: %dz5expected %d bytes in a bytearray8, but only %d remainN)r/rLrMrrr%�	bytearrayrErrr�read_bytearray89s


�rS�
bytearray8z�A counted bytearray.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs0|��}|�d�std��|dd�}t|d�S)zm
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
    r1z4no newline found when trying to read unicodestringnlNrzraw-unicode-escape)r5r6r�strrrrr�read_unicodestringnl[s

rV�unicodestringnlz�A newline-terminated Unicode string.

                      This is raw-unicode-escape encoded, so consists of
                      printable ASCII characters, and may contain embedded
                      escape sequences.
                      cCsBt|�}|�|�}t|�|kr*t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)])  # little-endian 1-byte length
    >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring1, but only 6 remain
    �utf-8�
surrogatepassz9expected %d bytes in a unicodestring1, but only %d remainN)r!rr%rUrrErrr�read_unicodestring1us

�rZ�unicodestring1aAA counted Unicode string.

                    The first argument is a 1-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc), 0, 0, 0])  # little-endian 4-byte length
    >>> t = read_unicodestring4(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring4(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring4, but only 6 remain
    z+unicodestring4 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring4, but only %d remainN)r,rLrMrrr%rUrErrr�read_unicodestring4�s


�r\�unicodestring4aAA counted Unicode string.

                    The first argument is a 4-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)]) + b'\0' * 7  # little-endian 8-byte length
    >>> t = read_unicodestring8(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring8(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring8, but only 6 remain
    z+unicodestring8 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring8, but only %d remainN)r/rLrMrrr%rUrErrr�read_unicodestring8�s


�r^�unicodestring8aBA counted Unicode string.

                    The first argument is an 8-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCs.t|ddd�}|dkrdS|dkr&dSt|�S)z�
    >>> import io
    >>> read_decimalnl_short(io.BytesIO(b"1234\n56"))
    1234

    >>> read_decimalnl_short(io.BytesIO(b"1234L\n56"))
    Traceback (most recent call last):
    ...
    ValueError: invalid literal for int() with base 10: b'1234L'
    F�r:r;s00s01T�r=�int�r�srrr�read_decimalnl_short�srecCs2t|ddd�}|dd�dkr*|dd�}t|�S)z�
    >>> import io

    >>> read_decimalnl_long(io.BytesIO(b"1234L\n56"))
    1234

    >>> read_decimalnl_long(io.BytesIO(b"123456789012345678901234L\n6"))
    123456789012345678901234
    Fr`rN�Lrarcrrr�read_decimalnl_longsrg�decimalnl_shorta�A newline-terminated decimal integer literal.

                          This never has a trailing 'L', and the integer fit
                          in a short Python int on the box where the pickle
                          was written -- but there's no guarantee it will fit
                          in a short Python int on the box where the pickle
                          is read.
                          �decimalnl_longz�A newline-terminated decimal integer literal.

                         This has a trailing 'L', and can represent integers
                         of any size.
                         cCst|ddd�}t|�S)zO
    >>> import io
    >>> read_floatnl(io.BytesIO(b"-1.25\n6"))
    -1.25
    Fr`)r=�floatrcrrr�read_floatnl-srk�floatnla�A newline-terminated decimal floating literal.

              In general this requires 17 significant digits for roundtrip
              identity, and pickling then unpickling infinities, NaNs, and
              minus zero doesn't work across boxes, or on some boxes even
              on itself (e.g., Windows can't read the strings it produces
              for infinities or NaNs).
              cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io, struct
    >>> raw = struct.pack(">d", -1.25)
    >>> raw
    b'\xbf\xf4\x00\x00\x00\x00\x00\x00'
    >>> read_float8(io.BytesIO(raw + b"\n"))
    -1.25
    r.z>drz(not enough data in stream to read float8Nr$rrrr�read_float8Cs

rm�float8aAn 8-byte binary representation of a float, big-endian.

             The format is unique to Python, and shared with the struct
             module (format string '>d') "in theory" (the struct and pickle
             implementations don't share the code -- they should).  It's
             strongly related to the IEEE-754 double format, and, in normal
             cases, is in fact identical to the big-endian 754 double format.
             On other boxes the dynamic range is limited to that of a 754
             double, and "add a half and chop" rounding is used to reduce
             the precision to 53 bits.  However, even on a 754 box,
             infinities, NaNs, and minus zero may not be handled correctly
             (may not survive roundtrip pickling intact).
             )�decode_longcCs.t|�}|�|�}t|�|kr&td��t|�S)a+
    >>> import io
    >>> read_long1(io.BytesIO(b"\x00"))
    0
    >>> read_long1(io.BytesIO(b"\x02\xff\x00"))
    255
    >>> read_long1(io.BytesIO(b"\x02\xff\x7f"))
    32767
    >>> read_long1(io.BytesIO(b"\x02\x00\xff"))
    -256
    >>> read_long1(io.BytesIO(b"\x02\x00\x80"))
    -32768
    z'not enough data in stream to read long1)r!rr%rrorErrr�
read_long1is

rp�long1aA binary long, little-endian, using 1-byte size.

    This first reads one byte as an unsigned size, then reads that
    many bytes and interprets them as a little-endian 2's-complement long.
    If the size is 0, that's taken as a shortcut for the long 0L.
    cCsBt|�}|dkrtd|��|�|�}t|�|kr:td��t|�S)ag
    >>> import io
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
    255
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
    32767
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
    -256
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
    -32768
    >>> read_long1(io.BytesIO(b"\x00\x00\x00\x00"))
    0
    rzlong4 byte count < 0: %dz'not enough data in stream to read long4)r*rrr%rorErrr�
read_long4�s
rr�long4a�A binary representation of a long, little-endian.

    This first reads four bytes as a signed size (but requires the
    size to be >= 0), then reads that many bytes and interprets them
    as a little-endian 2's-complement long.  If the size is 0, that's taken
    as a shortcut for the int 0, although LONG1 should really be used
    then instead (and in any case where # of bytes < 256).
    c@s eZdZdZdd�Zdd�ZdS)�StackObject�r�obtypercCs*||_t|t�r|D]}q||_||_dSr)r�
isinstance�tuplervr)rrrvrZ	containedrrrr�s
zStackObject.__init__cCs|jSr�r)rrrr�__repr__�szStackObject.__repr__N)rrrrrrzrrrrrt�s
rtrbzA Python integer object.ruZint_or_boolz#A Python integer or boolean object.�boolzA Python boolean object.rjzA Python float object.Zbytes_or_strz*A Python bytes or (Unicode) string object.�byteszA Python bytes object.rRzA Python bytearray object.rUz!A Python (Unicode) string object.�NonezThe Python None object.rxzA Python tuple object.�listzA Python list object.�dictzA Python dict object.�setzA Python set object.�	frozensetzA Python frozenset object.�bufferzA Python buffer-like object.�anyzAny kind of object whatsoever.Zmarkaz'The mark' is a unique object.

Opcodes that operate on a variable number of objects
generally don't embed the count of objects in the opcode,
or pull it off the stack.  Instead the MARK opcode is used
to push a special marker object on the stack, and then
some other opcodes grab all the objects from the top of
the stack down to (but not including) the topmost marker
object.
�
stackslicea�An object representing a contiguous slice of the stack.

This is used in conjunction with markobject, to represent all
of the stack following the topmost markobject.  For example,
the POP_MARK opcode changes the stack from

    [..., markobject, stackslice]
to
    [...]

No matter how many object are on the stack after the topmost
markobject, POP_MARK gets rid of all of them (including the
topmost markobject too).
c@seZdZdZdd�ZdS)�
OpcodeInfo�r�code�arg�stack_before�stack_after�protorc	CsB||_||_||_|D]}q||_|D]}q&||_||_||_dSrr�)	rrr�r�r�r�r�r�xrrrrdszOpcodeInfo.__init__Nrrrrrr�Esr�ZINT�Ia�Push an integer or bool.

      The argument is a newline-terminated decimal literal string.

      The intent may have been that this always fit in a short Python int,
      but INT can be generated in pickles written on a 64-bit box that
      require a Python long on a 32-bit box.  The difference between this
      and LONG then is that INT skips a trailing 'L', and produces a short
      int whenever possible.

      Another difference is due to that, when bool was introduced as a
      distinct type in 2.3, builtin names True and False were also added to
      2.2.2, mapping to ints 1 and 0.  For compatibility in both directions,
      True gets pickled as INT + "I01\n", and False as INT + "I00\n".
      Leading zeroes are never produced for a genuine integer.  The 2.3
      (and later) unpicklers special-case these and return bool instead;
      earlier unpicklers ignore the leading "0" and return the int.
      r�ZBININT�Ja1Push a four-byte signed integer.

      This handles the full range of Python (short) integers on a 32-bit
      box, directly as binary bytes (1 for the opcode and 4 for the integer).
      If the integer is non-negative and fits in 1 or 2 bytes, pickling via
      BININT1 or BININT2 saves space.
      ZBININT1�Kz�Push a one-byte unsigned integer.

      This is a space optimization for pickling very small non-negative ints,
      in range(256).
      ZBININT2�Mz�Push a two-byte unsigned integer.

      This is a space optimization for pickling small positive ints, in
      range(256, 2**16).  Integers in range(256) can also be pickled via
      BININT2, but BININT1 instead saves a byte.
      ZLONG�La�Push a long integer.

      The same as INT, except that the literal ends with 'L', and always
      unpickles to a Python long.  There doesn't seem a real purpose to the
      trailing 'L'.

      Note that LONG takes time quadratic in the number of digits when
      unpickling (this is simply due to the nature of decimal->binary
      conversion).  Proto 2 added linear-time (in C; still quadratic-time
      in Python) LONG1 and LONG4 opcodes.
      ZLONG1�Šz|Long integer using one-byte length.

      A more efficient encoding of a Python long; the long1 encoding
      says it all.ZLONG4�‹z~Long integer using found-byte length.

      A more efficient encoding of a Python long; the long4 encoding
      says it all.�STRING�Sa�Push a Python string object.

      The argument is a repr-style string, with bracketing quote characters,
      and perhaps embedded escapes.  The argument extends until the next
      newline character.  These are usually decoded into a str instance
      using the encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      Z	BINSTRING�Ta�Push a Python string object.

      There are two arguments: the first is a 4-byte little-endian
      signed int giving the number of bytes in the string, and the
      second is that many bytes, which are taken literally as the string
      content.  These are usually decoded into a str instance using the
      encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      ZSHORT_BINSTRING�Ua�Push a Python string object.

      There are two arguments: the first is a 1-byte unsigned int giving
      the number of bytes in the string, and the second is that many
      bytes, which are taken literally as the string content.  These are
      usually decoded into a str instance using the encoding given to
      the Unpickler constructor. or the default, 'ASCII'.  If the
      encoding given was 'bytes' however, they will be decoded as bytes
      object instead.
      ZBINBYTES�B�z�Push a Python bytes object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes, and the second is that many bytes, which are
      taken literally as the bytes content.
      ZSHORT_BINBYTES�Cz�Push a Python bytes object.

      There are two arguments:  the first is a 1-byte unsigned int giving
      the number of bytes, and the second is that many bytes, which are taken
      literally as the string content.
      Z	BINBYTES8�Žz�Push a Python bytes object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the string, and the second is that many bytes,
      which are taken literally as the string content.
      Z
BYTEARRAY8�–�z�Push a Python bytearray object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the bytearray, and the second is that many bytes,
      which are taken literally as the bytearray content.
      ZNEXT_BUFFER�—z"Push an out-of-band buffer object.ZREADONLY_BUFFER�˜z,Make an out-of-band buffer object read-only.ZNONE�NzPush None on the stack.ZNEWTRUE�ˆzPush True onto the stack.ZNEWFALSE�‰zPush False onto the stack.�UNICODE�Vz�Push a Python Unicode string object.

      The argument is a raw-unicode-escape encoding of a Unicode string,
      and so may contain embedded escape sequences.  The argument extends
      until the next newline character.
      ZSHORT_BINUNICODE�ŒaPush a Python Unicode string object.

      There are two arguments:  the first is a 1-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      Z
BINUNICODE�XaPush a Python Unicode string object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZBINUNICODE8�aPush a Python Unicode string object.

      There are two arguments:  the first is an 8-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZFLOAT�Fa�Newline-terminated decimal float literal.

      The argument is repr(a_float), and in general requires 17 significant
      digits for roundtrip conversion to be an identity (this is so for
      IEEE-754 double precision values, which is what Python float maps to
      on most boxes).

      In general, FLOAT cannot be used to transport infinities, NaNs, or
      minus zero across boxes (or even on a single box, if the platform C
      library can't read the strings it produces for such things -- Windows
      is like that), but may do less damage than BINFLOAT on boxes with
      greater precision or dynamic range than IEEE-754 double.
      ZBINFLOAT�Ga�Float stored in binary form, with 8 bytes of data.

      This generally requires less than half the space of FLOAT encoding.
      In general, BINFLOAT cannot be used to transport infinities, NaNs, or
      minus zero, raises an exception if the exponent exceeds the range of
      an IEEE-754 double, and retains no more than 53 bits of precision (if
      there are more than that, "add a half and chop" rounding is used to
      cut it back to 53 significant bits).
      Z
EMPTY_LIST�]zPush an empty list.ZAPPEND�az�Append an object to a list.

      Stack before:  ... pylist anyobject
      Stack after:   ... pylist+[anyobject]

      although pylist is really extended in-place.
      ZAPPENDS�ez�Extend a list by a slice of stack objects.

      Stack before:  ... pylist markobject stackslice
      Stack after:   ... pylist+stackslice

      although pylist is really extended in-place.
      ZLIST�lasBuild a list out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python list, which single list object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... [1, 2, 3, 'abc']
      ZEMPTY_TUPLE�)zPush an empty tuple.ZTUPLE�tavBuild a tuple out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python tuple, which single tuple object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... (1, 2, 3, 'abc')
      ZTUPLE1�…z�Build a one-tuple out of the topmost item on the stack.

      This code pops one value off the stack and pushes a tuple of
      length 1 whose one item is that value back onto it.  In other
      words:

          stack[-1] = tuple(stack[-1:])
      ZTUPLE2�†aBuild a two-tuple out of the top two items on the stack.

      This code pops two values off the stack and pushes a tuple of
      length 2 whose items are those values back onto it.  In other
      words:

          stack[-2:] = [tuple(stack[-2:])]
      ZTUPLE3�‡aBuild a three-tuple out of the top three items on the stack.

      This code pops three values off the stack and pushes a tuple of
      length 3 whose items are those values back onto it.  In other
      words:

          stack[-3:] = [tuple(stack[-3:])]
      Z
EMPTY_DICT�}zPush an empty dict.ZDICT�da�Build a dict out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python dict, which single dict object replaces all of the
      stack from the topmost markobject onward.  The stack slice alternates
      key, value, key, value, ....  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... {1: 2, 3: 'abc'}
      ZSETITEMrdz�Add a key+value pair to an existing dict.

      Stack before:  ... pydict key value
      Stack after:   ... pydict

      where pydict has been modified via pydict[key] = value.
      ZSETITEMS�ua\Add an arbitrary number of key+value pairs to an existing dict.

      The slice of the stack following the topmost markobject is taken as
      an alternating sequence of keys and values, added to the dict
      immediately under the topmost markobject.  Everything at and after the
      topmost markobject is popped, leaving the mutated dict at the top
      of the stack.

      Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
      Stack after:   ... pydict

      where pydict has been modified via pydict[key_i] = value_i for i in
      1, 2, ..., n, and in that order.
      Z	EMPTY_SET�zPush an empty set.ZADDITEMS�a$Add an arbitrary number of items to an existing set.

      The slice of the stack following the topmost markobject is taken as
      a sequence of items, added to the set immediately under the topmost
      markobject.  Everything at and after the topmost markobject is popped,
      leaving the mutated set at the top of the stack.

      Stack before:  ... pyset markobject item_1 ... item_n
      Stack after:   ... pyset

      where pyset has been modified via pyset.add(item_i) = item_i for i in
      1, 2, ..., n, and in that order.
      Z	FROZENSET�‘azBuild a frozenset out of the topmost slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python frozenset, which single frozenset object replaces all
      of the stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3
      Stack after:  ... frozenset({1, 2, 3})
      �POP�0z<Discard the top stack item, shrinking the stack by one item.ZDUP�2z=Push the top stack item onto the stack again, duplicating it.�MARK�(z�Push markobject onto the stack.

      markobject is a unique object, used by other opcodes to identify a
      region of the stack containing a variable number of objects for them
      to work on.  See markobject.doc for more detail.
      ZPOP_MARK�1aPop all the stack objects at and above the topmost markobject.

      When an opcode using a variable number of stack objects is done,
      POP_MARK is used to remove those objects, and to remove the markobject
      that delimited their starting position on the stack.
      �GET�gz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the newline-terminated
      decimal string following.  BINGET and LONG_BINGET are space-optimized
      versions.
      �BINGET�hz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 1-byte unsigned
      integer following.
      �LONG_BINGET�jz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 4-byte unsigned
      little-endian integer following.
      �PUT�pz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the newline-
      terminated decimal string following.  BINPUT and LONG_BINPUT are
      space-optimized versions.
      �BINPUTr<z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 1-byte
      unsigned integer following.
      �LONG_BINPUT�rz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 4-byte
      unsigned little-endian integer following.
      �MEMOIZE�”z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write is the number of
      elements currently present in the memo.
      ZEXT1�‚a�Extension code.

      This code and the similar EXT2 and EXT4 allow using a registry
      of popular objects that are pickled by name, typically classes.
      It is envisioned that through a global negotiation and
      registration process, third parties can set up a mapping between
      ints and object names.

      In order to guarantee pickle interchangeability, the extension
      code registry ought to be global, although a range of codes may
      be reserved for private use.

      EXT1 has a 1-byte integer argument.  This is used to index into the
      extension registry, and the object at that index is pushed on the stack.
      ZEXT2�ƒzNExtension code.

      See EXT1.  EXT2 has a two-byte integer argument.
      ZEXT4�„zOExtension code.

      See EXT1.  EXT4 has a four-byte integer argument.
      ZGLOBAL�ca�Push a global object (module.attr) on the stack.

      Two newline-terminated strings follow the GLOBAL opcode.  The first is
      taken as a module name, and the second as a class name.  The class
      object module.class is pushed on the stack.  More accurately, the
      object returned by self.find_class(module, class) is pushed on the
      stack, so unpickling subclasses can override this form of lookup.
      ZSTACK_GLOBAL�“z7Push a global object (module.attr) on the stack.
      ZREDUCE�RaLPush an object built from a callable and an argument tuple.

      The opcode is named to remind of the __reduce__() method.

      Stack before: ... callable pytuple
      Stack after:  ... callable(*pytuple)

      The callable and the argument tuple are the first two items returned
      by a __reduce__ method.  Applying the callable to the argtuple is
      supposed to reproduce the original object, or at least get it started.
      If the __reduce__ method returns a 3-tuple, the last component is an
      argument to be passed to the object's __setstate__, and then the REDUCE
      opcode is followed by code to create setstate's argument, and then a
      BUILD opcode to apply  __setstate__ to that argument.

      If not isinstance(callable, type), REDUCE complains unless the
      callable has been registered with the copyreg module's
      safe_constructors dict, or the callable has a magic
      '__safe_for_unpickling__' attribute with a true value.  I'm not sure
      why it does this, but I've sure seen this complaint often enough when
      I didn't want to <wink>.
      ZBUILD�ba�Finish building an object, via __setstate__ or dict update.

      Stack before: ... anyobject argument
      Stack after:  ... anyobject

      where anyobject may have been mutated, as follows:

      If the object has a __setstate__ method,

          anyobject.__setstate__(argument)

      is called.

      Else the argument must be a dict, the object must have a __dict__, and
      the object is updated via

          anyobject.__dict__.update(argument)
      ZINST�iaqBuild a class instance.

      This is the protocol 0 version of protocol 1's OBJ opcode.
      INST is followed by two newline-terminated strings, giving a
      module and class name, just as for the GLOBAL opcode (and see
      GLOBAL for more details about that).  self.find_class(module, name)
      is used to get a class object.

      In addition, all the objects on the stack following the topmost
      markobject are gathered into a tuple and popped (along with the
      topmost markobject), just as for the TUPLE opcode.

      Now it gets complicated.  If all of these are true:

        + The argtuple is empty (markobject was at the top of the stack
          at the start).

        + The class object does not have a __getinitargs__ attribute.

      then we want to create an old-style class instance without invoking
      its __init__() method (pickle has waffled on this over the years; not
      calling __init__() is current wisdom).  In this case, an instance of
      an old-style dummy class is created, and then we try to rebind its
      __class__ attribute to the desired class object.  If this succeeds,
      the new instance object is pushed on the stack, and we're done.

      Else (the argtuple is not empty, it's not an old-style class object,
      or the class object does have a __getinitargs__ attribute), the code
      first insists that the class object have a __safe_for_unpickling__
      attribute.  Unlike as for the __safe_for_unpickling__ check in REDUCE,
      it doesn't matter whether this attribute has a true or false value, it
      only matters whether it exists (XXX this is a bug).  If
      __safe_for_unpickling__ doesn't exist, UnpicklingError is raised.

      Else (the class object does have a __safe_for_unpickling__ attr),
      the class object obtained from INST's arguments is applied to the
      argtuple obtained from the stack, and the resulting instance object
      is pushed on the stack.

      NOTE:  checks for __safe_for_unpickling__ went away in Python 2.3.
      NOTE:  the distinction between old-style and new-style classes does
             not make sense in Python 3.
      ZOBJ�oa�Build a class instance.

      This is the protocol 1 version of protocol 0's INST opcode, and is
      very much like it.  The major difference is that the class object
      is taken off the stack, allowing it to be retrieved from the memo
      repeatedly if several instances of the same class are created.  This
      can be much more efficient (in both time and space) than repeatedly
      embedding the module and class names in INST opcodes.

      Unlike INST, OBJ takes no arguments from the opcode stream.  Instead
      the class object is taken off the stack, immediately above the
      topmost markobject:

      Stack before: ... markobject classobject stackslice
      Stack after:  ... new_instance_object

      As for INST, the remainder of the stack above the markobject is
      gathered into an argument tuple, and then the logic seems identical,
      except that no __safe_for_unpickling__ check is done (XXX this is
      a bug).  See INST for the gory details.

      NOTE:  In Python 2.3, INST and OBJ are identical except for how they
      get the class object.  That was always the intent; the implementations
      had diverged for accidental reasons.
      ZNEWOBJ�aLBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple (the tuple being the stack
      top).  Call these cls and args.  They are popped off the stack,
      and the value returned by cls.__new__(cls, *args) is pushed back
      onto the stack.
      Z	NEWOBJ_EX�’auBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple and by a keyword argument dict
      (the dict being the stack top).  Call these cls and args.  They are
      popped off the stack, and the value returned by
      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
      �PROTO�€z�Protocol version indicator.

      For protocol 2 and above, a pickle must start with this opcode.
      The argument is the protocol version, an int in range(2, 256).
      ZSTOP�.z�Stop the unpickling machine.

      Every pickle ends with this opcode.  The object at the top of the stack
      is popped, and that's the result of unpickling.  The stack should be
      empty then.
      �FRAME�•z�Indicate the beginning of a new frame.

      The unpickler may use this opcode to safely prefetch data from its
      underlying stream.
      ZPERSID�PaPush an object identified by a persistent ID.

      The pickle module doesn't define what a persistent ID means.  PERSID's
      argument is a newline-terminated str-style (no embedded escapes, no
      bracketing quote characters) string, which *is* "the persistent ID".
      The unpickler passes this string to self.persistent_load().  Whatever
      object that returns is pushed on the stack.  There is no implementation
      of persistent_load() in Python's unpickler:  it must be supplied by an
      unpickler subclass.
      Z	BINPERSID�QaXPush an object identified by a persistent ID.

      Like PERSID, except the persistent ID is popped off the stack (instead
      of being a string embedded in the opcode bytestream).  The persistent
      ID is passed to self.persistent_load(), and whatever object that
      returns is pushed on the stack.  See PERSID for more detail.
      z%repeated name %r at indices %d and %dz%repeated code %r at indices %d and %dFcCst��}tjD]�}t�d|�s0|rtd|�qtt|�}t|t	�rPt
|�dkrf|rtd||f�q|�d�}||kr�|r�td||f�||}|j|kr�t
d|||jf��||=qt
d||f��q|�rd	g}|��D]\}}|�d
|j|f�q�t
d�|���dS)Nz[A-Z][A-Z0-9_]+$z0skipping %r: it doesn't look like an opcode namerz5skipping %r: value %r doesn't look like a pickle coderDz+checking name %r w/ code %r for consistencyzBfor pickle code %r, pickle.py uses name %r but we're using name %rzPpickle.py appears to have a pickle opcode with name %r and code %r, but we don'tz=we appear to have pickle opcodes that pickle.py doesn't have:z    name %r with code %r�
)�code2op�copy�pickle�__all__�re�match�print�getattrrwr|r%r:rr�items�append�join)�verboser�rZ
picklecoder��msgr�rrr�assure_pickle_consistency�sJ

�
�
���r�ccs�t|t�rt�|�}t|d�r&|j}ndd�}|�}|�d�}t�|�	d��}|dkr�|dkrht
d��nt
d|dkrxd	n||f��|jdkr�d}n|j�|�}|r�||||�fVn|||fV|d
kr.q�q.dS)N�tellcSsdSrrrrrr�<lambda>��z_genops.<locals>.<lambda>rrDr�z#pickle exhausted before seeing STOPz!at position %s, opcode %r unknownz	<unknown>�.)
rw�bytes_types�io�BytesIO�hasattrr�rr��getr:rr�r)r �
yield_end_posZgetpos�posr��opcoder�rrr�_genops�s.




�
r�cCst|�S)axGenerate all the opcodes in a pickle.

    'pickle' is a file-like object, or string, containing the pickle.

    Each opcode in the pickle is generated, from the current pickle position,
    stopping after a STOP opcode is delivered.  A triple is generated for
    each opcode:

        opcode, arg, pos

    opcode is an OpcodeInfo record, describing the current opcode.

    If the opcode has an argument embedded in the pickle, arg is its decoded
    value, as a Python object.  If the opcode doesn't have an argument, arg
    is None.

    If the pickle has a tell() method, pos was the value of pickle.tell()
    before reading the current opcode.  If the pickle is a bytes object,
    it's wrapped in a BytesIO object, and the latter's tell() result is
    used.  Else (the pickle doesn't have a tell(), and it's not obvious how
    to query its current position) pos is None.
    )r�)r�rrrr�scCsd}d}t�}i}g}d}d}t|dd�D]�\}}	}
}d|jkrZ|�|	�|�||	f�q*|jdkr�t|�}|�|�|�||f�q*d|jkr�q*d|jkr�|j|kr�|j}d	||	<|�||	f�q*|jd
k�r|	|kr�|	}|
dkr�||
|�}n|�|
|f�q*|�|
|f�q*~t��}
|
�	|�t
�|
|�}|dk�rF|j�
�d}|D]�\}}	d}||k�r�|	|k�rr�qN|�|�}|||	<|d
7}n6||k�r�|�||	�}n|||	�}t|�|jjk}|jj|d�|�r�|j�|�n
|�	|��qN|j��|
��S)z7Optimize a pickle string by removing unused PUT opcodesr�r�rr�T)r�r�r�Nr�r)Fr)Zforce)r�r�r�addr�r%r�r�r��writer�Z_PicklerZframerZ
start_framing�putr�Z_FRAME_SIZE_TARGETZcommit_frameZ
file_writeZend_framing�getvalue)r�r�r�ZoldidsZnewids�opcodesr�Zprotoheaderr�r�r�Zend_pos�idx�outZpickler�opZ	framelessr rrrr	sl















c	Csg}|dkri}d}g}d|}d}	|}
t|�D�]�\}}}
|
dk	rVtd|
d|d�dt|j�dd�|t|�|jf}t||j�}|j}|j	}t|�}d}t
|ks�|jdk�r@|�r@|dt
k�r@|�r8|��}|dkr�d	}nd
|}|dt
k	�r|��q�|��z|�t
�}Wnt
k
�r4d}YnXnd}	}|jd
k�r�|jdk�rjt|�}d|}n|}||k�r�d|}	n,|�s�d}	n |dt
k�r�d}	n|d||<n*|jdk�r�||k�r�||g}nd|}	|dk	�s�|�r,|ddt|j�7}|dk	�r|dt|�7}|�r,|d|7}|�rv|d|
t|�7}t|�}
|
dk�r\|}
|d|j�dd�d7}t||d�|	�r�t
|	��t|�|k�r�t
d|t|�f��|�r�||d�=t
|k�r�|�|
�|�|�q0td||d�|�rt
d|��dS)aKProduce a symbolic disassembly of a pickle.

    'pickle' is a file-like object, or string, containing a (at least one)
    pickle.  The pickle is disassembled from the current position, through
    the first STOP opcode encountered.

    Optional arg 'out' is a file-like object to which the disassembly is
    printed.  It defaults to sys.stdout.

    Optional arg 'memo' is a Python dict, used as the pickle's memo.  It
    may be mutated by dis(), if the pickle contains PUT or BINPUT opcodes.
    Passing the same memo object to another dis() call then allows disassembly
    to proceed across multiple pickles that were all created by the same
    pickler with the same memo.  Ordinarily you don't need to worry about this.

    Optional arg 'indentlevel' is the number of blanks by which to indent
    a new MARK level.  It defaults to 4.

    Optional arg 'annotate' if nonzero instructs dis() to add short
    description of the opcode on each line of disassembled output.
    The value given to 'annotate' must be an integer and is used as a
    hint for the column where annotation should start.  The default
    value is 0, meaning no annotations.

    In addition to printing the disassembly, some sanity checks are made:

    + All embedded opcode arguments "make sense".

    + Explicit and implicit pop operations have enough items on the stack.

    + When an opcode implicitly refers to a markobject, a markobject is
      actually on the stack.

    + A memo entry isn't referenced before it's defined.

    + The markobject isn't stored in the memo.

    + A memo entry isn't redefined.
    Nr� z%5d:)�end�filez	%-4s %s%srr�z(MARK at unknown opcode offset)z(MARK at %d)rzno MARK exists on stack)r�r�r�r�r�z(as %d)zmemo key %r already definedz'stack is empty -- can't store into memoz"can't store markobject in the memo)r�r�r�z&memo key %r has never been stored into�
�2r�)rz3tries to pop %d items from stack with only %d itemsz highest protocol among opcodes =zstack not empty after STOP: %r)rr��reprr�r%r�maxr�r�r��
markobject�pop�indexrr�splitr��extend)r�r�memo�indentlevel�annotate�stackZmaxprotoZ	markstackZindentchunkZerrormsgZannocolr�r�r��lineZbeforeZafterZnumtopopZmarkmsgZmarkposZmemo_idxrrrr[	s�-
��
�







�

c@seZdZdd�ZdS)�_ExamplecCs
||_dSr)�value)rrrrrr�	sz_Example.__init__N)rrrrrrrrr�	sra�
>>> import pickle
>>> x = [1, 2, (3, 4), {b'abc': "def"}]
>>> pkl0 = pickle.dumps(x, 0)
>>> dis(pkl0)
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: I    INT        1
    8: a    APPEND
    9: I    INT        2
   12: a    APPEND
   13: (    MARK
   14: I        INT        3
   17: I        INT        4
   20: t        TUPLE      (MARK at 13)
   21: p    PUT        1
   24: a    APPEND
   25: (    MARK
   26: d        DICT       (MARK at 25)
   27: p    PUT        2
   30: c    GLOBAL     '_codecs encode'
   46: p    PUT        3
   49: (    MARK
   50: V        UNICODE    'abc'
   55: p        PUT        4
   58: V        UNICODE    'latin1'
   66: p        PUT        5
   69: t        TUPLE      (MARK at 49)
   70: p    PUT        6
   73: R    REDUCE
   74: p    PUT        7
   77: V    UNICODE    'def'
   82: p    PUT        8
   85: s    SETITEM
   86: a    APPEND
   87: .    STOP
highest protocol among opcodes = 0

Try again with a "binary" pickle.

>>> pkl1 = pickle.dumps(x, 1)
>>> dis(pkl1)
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: K        BININT1    1
    6: K        BININT1    2
    8: (        MARK
    9: K            BININT1    3
   11: K            BININT1    4
   13: t            TUPLE      (MARK at 8)
   14: q        BINPUT     1
   16: }        EMPTY_DICT
   17: q        BINPUT     2
   19: c        GLOBAL     '_codecs encode'
   35: q        BINPUT     3
   37: (        MARK
   38: X            BINUNICODE 'abc'
   46: q            BINPUT     4
   48: X            BINUNICODE 'latin1'
   59: q            BINPUT     5
   61: t            TUPLE      (MARK at 37)
   62: q        BINPUT     6
   64: R        REDUCE
   65: q        BINPUT     7
   67: X        BINUNICODE 'def'
   75: q        BINPUT     8
   77: s        SETITEM
   78: e        APPENDS    (MARK at 3)
   79: .    STOP
highest protocol among opcodes = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
>>> dis(pickle.dumps(pickletools.dis, 0))
    0: c    GLOBAL     'pickletools dis'
   17: p    PUT        0
   20: .    STOP
highest protocol among opcodes = 0

>>> from pickletools import _Example
>>> x = [_Example(42)] * 2
>>> dis(pickle.dumps(x, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: c    GLOBAL     'copy_reg _reconstructor'
   30: p    PUT        1
   33: (    MARK
   34: c        GLOBAL     'pickletools _Example'
   56: p        PUT        2
   59: c        GLOBAL     '__builtin__ object'
   79: p        PUT        3
   82: N        NONE
   83: t        TUPLE      (MARK at 33)
   84: p    PUT        4
   87: R    REDUCE
   88: p    PUT        5
   91: (    MARK
   92: d        DICT       (MARK at 91)
   93: p    PUT        6
   96: V    UNICODE    'value'
  103: p    PUT        7
  106: I    INT        42
  110: s    SETITEM
  111: b    BUILD
  112: a    APPEND
  113: g    GET        5
  116: a    APPEND
  117: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(x, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: c        GLOBAL     'copy_reg _reconstructor'
   29: q        BINPUT     1
   31: (        MARK
   32: c            GLOBAL     'pickletools _Example'
   54: q            BINPUT     2
   56: c            GLOBAL     '__builtin__ object'
   76: q            BINPUT     3
   78: N            NONE
   79: t            TUPLE      (MARK at 31)
   80: q        BINPUT     4
   82: R        REDUCE
   83: q        BINPUT     5
   85: }        EMPTY_DICT
   86: q        BINPUT     6
   88: X        BINUNICODE 'value'
   98: q        BINPUT     7
  100: K        BININT1    42
  102: s        SETITEM
  103: b        BUILD
  104: h        BINGET     5
  106: e        APPENDS    (MARK at 3)
  107: .    STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-object test.

>>> L = []
>>> T = L,
>>> L.append(T)
>>> L[0] is T
True
>>> T[0] is L
True
>>> L[0][0] is L
True
>>> T[0][0] is T
True
>>> dis(pickle.dumps(L, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: (    MARK
    6: g        GET        0
    9: t        TUPLE      (MARK at 5)
   10: p    PUT        1
   13: a    APPEND
   14: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(L, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: h        BINGET     0
    6: t        TUPLE      (MARK at 3)
    7: q    BINPUT     1
    9: a    APPEND
   10: .    STOP
highest protocol among opcodes = 1

Note that, in the protocol 0 pickle of the recursive tuple, the disassembler
has to emulate the stack in order to realize that the POP opcode at 16 gets
rid of the MARK at 0.

>>> dis(pickle.dumps(T, 0))
    0: (    MARK
    1: (        MARK
    2: l            LIST       (MARK at 1)
    3: p        PUT        0
    6: (        MARK
    7: g            GET        0
   10: t            TUPLE      (MARK at 6)
   11: p        PUT        1
   14: a        APPEND
   15: 0        POP
   16: 0        POP        (MARK at 0)
   17: g    GET        1
   20: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(T, 1))
    0: (    MARK
    1: ]        EMPTY_LIST
    2: q        BINPUT     0
    4: (        MARK
    5: h            BINGET     0
    7: t            TUPLE      (MARK at 4)
    8: q        BINPUT     1
   10: a        APPEND
   11: 1        POP_MARK   (MARK at 0)
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 1

Try protocol 2.

>>> dis(pickle.dumps(L, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: .    STOP
highest protocol among opcodes = 2

>>> dis(pickle.dumps(T, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: 0    POP
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 2

Try protocol 3 with annotations:

>>> dis(pickle.dumps(T, 3), annotate=1)
    0: \x80 PROTO      3 Protocol version indicator.
    2: ]    EMPTY_LIST   Push an empty list.
    3: q    BINPUT     0 Store the stack top into the memo.  The stack is not popped.
    5: h    BINGET     0 Read an object from the memo and push it on the stack.
    7: \x85 TUPLE1       Build a one-tuple out of the topmost item on the stack.
    8: q    BINPUT     1 Store the stack top into the memo.  The stack is not popped.
   10: a    APPEND       Append an object to a list.
   11: 0    POP          Discard the top stack item, shrinking the stack by one item.
   12: h    BINGET     1 Read an object from the memo and push it on the stack.
   14: .    STOP         Stop the unpickling machine.
highest protocol among opcodes = 2

a=
>>> import pickle
>>> import io
>>> f = io.BytesIO()
>>> p = pickle.Pickler(f, 2)
>>> x = [1, 2, 3]
>>> p.dump(x)
>>> p.dump(x)
>>> f.seek(0)
0
>>> memo = {}
>>> dis(f, memo=memo)
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: K        BININT1    1
    8: K        BININT1    2
   10: K        BININT1    3
   12: e        APPENDS    (MARK at 5)
   13: .    STOP
highest protocol among opcodes = 2
>>> dis(f, memo=memo)
   14: \x80 PROTO      2
   16: h    BINGET     0
   18: .    STOP
highest protocol among opcodes = 2
)Zdisassembler_testZdisassembler_memo_testcCsddl}|��S)Nr)�doctestZtestmod)rrrr�_testsr�__main__z$disassemble one or more pickle files)Zdescription�pickle_file�br�*zthe pickle file)�type�nargs�helpz-oz--output�wz+the file where the output should be written)�defaultrrz-mz--memo�
store_truez#preserve memo between disassemblies)�actionrz-lz
--indentlevelz8the number of blanks by which to indent a new MARK levelz-az
--annotatez2annotate each line with a short opcode descriptionz-pz
--preamblez==> {name} <==zMif more than one pickle file is specified, print this before each disassembly)rrz-tz--testzrun self-test suitez-vz)run verbosely; only affects self-test run�ryr�)TT)F)F)NNr)r)��__doc__r8r�r�r�rLr�r�Z
UP_TO_NEWLINEZTAKEN_FROM_ARGUMENT1ZTAKEN_FROM_ARGUMENT4ZTAKEN_FROM_ARGUMENT4UZTAKEN_FROM_ARGUMENT8U�objectr
Zstructrr&r!r"r'r(r*r+r,r-r/r0r=r>r@rArBrCrFrGrHrIrJrKrNrOrPrQrSrTrVrWrZr[r\r]r^r_rergrhrirkrlrmrnrorprqrrrsrtrbZpyintZpylongr{Zpyinteger_or_boolZpyboolrjZpyfloatr|rUZpybytes_or_strZpystringZpybytesrRZpybytearrayZ	pyunicoderZpynonerxZpytupler~ZpylistrZpydictr�ZpysetZpyfrozensetZpybufferZ	anyobjectr	r�r�r�r�Zname2iZcode2i�	enumerater�r�rrr�r�r�r�rrrrZ	_dis_testZ
_memo_testZ__test__rr�argparse�ArgumentParser�parser�add_argumentZFileType�stdout�
parse_args�argsZtestrrZ
print_helpr%�outputrrrZpreamble�formatr�rrrr�<module>s`
$�����/�
�	�������
��
�
�
�
�	�
����
����
�������������;����
���
����
�
����
���
�
�
�
����������������������
��
���
�����������2� ������������������
& 

C��
�
�������
�
tarfile.cpython-38.pyc000064400000211663151450073350010636 0ustar00U

&�.e��@sdZdZdZdZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXeefZzeef7ZWnek
r�YnXddd	d
ddd
ddddddddgZdZdZdZdZedZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2dZ3d-Z4d.Z5e5Z6e$e%e&e'e*e+e,e(e)e-e.e/fZ7e$e%e,e/fZ8e-e.e/fZ9d/Z:d0d1d2d3hZ;e<e<e<e=e=e=d4�Z>ej?d5k�r�d6Z@ne�A�Z@d7d8�ZBd9d:�ZCd;d<�ZDd=e6fd>d?�ZEd@dA�ZFdedfdBdC�ZGdDdE�ZHGdFd
�d
eI�ZJGdGd�deJ�ZKGdHd�deJ�ZLGdId�deJ�ZMGdJd
�d
eJ�ZNGdKd�deJ�ZOGdLdM�dMeO�ZPGdNdO�dOeO�ZQGdPdQ�dQeO�ZRGdRdS�dSeO�ZSGdTdU�dUeO�ZTGdVdW�dW�ZUGdXdY�dY�ZVGdZd[�d[eW�ZXGd\d]�d]eW�ZYGd^d_�d_e	jZ�Z[Gd`da�daeJ�Z\Gdbdc�dce\�Z]Gddde�dee\�Z^Gdfdg�dge\�Z_Gdhdi�die\�Z`Gdjdk�dke\�Zad{dldm�Zbdndo�Zcdpdq�Zddrds�Zeecedeedt�ZfeW�ZgGdud�deW�ZhGdvd�deW�Zidwd	�ZjeijZdxdy�Zkeldzk�r
ek�dS)|z,Read from and write to tar format archives.
z0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.�)�openN�TarFile�TarInfo�
is_tarfile�TarError�	ReadError�CompressionError�StreamError�ExtractError�HeaderError�ENCODING�USTAR_FORMAT�
GNU_FORMAT�
PAX_FORMAT�DEFAULT_FORMATrTz/etc/python/tarfile.cfg�i�sustar  sustar00�d��0�1�2�3�4�5�6�7�L�K�S�x�g�X��)�path�linkpath�size�mtime�uid�gid�uname�gnamer%r&r+r,)Zatime�ctimer(r)r*r'�nt�utf-8cCs8|dkrtd��|�||�}|d|�|t|�tS)z8Convert a string to a null-terminated bytes object.
    Nzmetadata cannot contain None)�
ValueError�encode�len�NUL)�s�length�encoding�errors�r8�/usr/lib64/python3.8/tarfile.py�stn�sr:cCs*|�d�}|dkr|d|�}|�||�S)z8Convert a null-terminated bytes object to a string.
    r���N)�find�decode)r4r6r7�pr8r8r9�nts�s
r?cCs�|ddkrbd}tt|�d�D]}|dK}|||d7}q |ddkr�dt|�d|}n@z"t|dd�}t|��p|d	d�}Wntk
r�td
��YnX|S)z/Convert a number field to a python number.
    r)��r#�rA��ascii�strict�0�invalid header)�ranger2r?�int�stripr0�InvalidHeaderError)r4�n�ir8r8r9�nti�srNrBcCs�t|�}d|kr$d|dkrDnntd|d|fd�t}n�|tkr�d|d|krrd|dkr�nnV|dkr�tdg�}ntdg�}d||}t|d�D]}|�d|d@�|dL}q�ntd	��|S)
z/Convert a python number to a number field.
    rrBr#z%0*orDrCr@rAzoverflow in number field)rI�bytesr3r�	bytearrayrH�insertr0)rL�digits�formatr4rMr8r8r9�itn�s 2
rTcCs0dtt�d|��}dtt�d|��}||fS)a�Calculate the checksum for a member's header by summing up all
       characters except for the chksum field which is treated as if
       it was filled with spaces. According to the GNU tar sources,
       some tars (Sun and NeXT) calculate chksum with signed char,
       which will be different if there are chars in the buffer with
       the high bit set. So we calculate two checksums, unsigned and
       signed.
    rCZ
148B8x356BZ
148b8x356b)�sum�structZunpack_from)�bufZunsigned_chksumZ
signed_chksumr8r8r9�calc_chksums�s	rXc	Cs�|pd}|dkrdS|dkr.t�|||�dSt||�\}}t|�D],}|�|�}t|�|krf|d��|�|�qD|dkr�|�|�}t|�|kr�|d��|�|�dS)zjCopy length bytes from fileobj src to fileobj dst.
       If length is None, copy the entire content.
    i@rN�unexpected end of data)�shutil�copyfileobj�divmodrH�readr2�write)	�srcZdstr5�	exception�bufsize�blocks�	remainder�brWr8r8r9r[�s$


r[cCs8ttjdd�}|dk	r(|�|d��|�}t|dd�dS)Nr6�backslashreplace� )�end)�getattr�sys�stdoutr1r=�print)r4r6r8r8r9�_safe_printsrlc@seZdZdZdS)rzBase exception.N��__name__�
__module__�__qualname__�__doc__r8r8r8r9rsc@seZdZdZdS)r
z%General exception for extract errors.Nrmr8r8r8r9r
sc@seZdZdZdS)rz&Exception for unreadable tar archives.Nrmr8r8r8r9rsc@seZdZdZdS)rz.Exception for unavailable compression methods.Nrmr8r8r8r9rsc@seZdZdZdS)r	z=Exception for unsupported operations on stream-like TarFiles.Nrmr8r8r8r9r	!sc@seZdZdZdS)rz!Base exception for header errors.Nrmr8r8r8r9r$sc@seZdZdZdS)�EmptyHeaderErrorzException for empty headers.Nrmr8r8r8r9rr'srrc@seZdZdZdS)�TruncatedHeaderErrorz Exception for truncated headers.Nrmr8r8r8r9rs*srsc@seZdZdZdS)�EOFHeaderErrorz"Exception for end of file headers.Nrmr8r8r8r9rt-srtc@seZdZdZdS)rKzException for invalid headers.Nrmr8r8r8r9rK0srKc@seZdZdZdS)�SubsequentHeaderErrorz3Exception for missing and invalid extended headers.Nrmr8r8r8r9ru3sruc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
_LowLevelFilez�Low-level file object. Supports reading and writing.
       It is used instead of a regular file object for streaming
       access.
    cCsFtjtjtjBtjBd�|}ttd�r2|tjO}t�||d�|_dS)N��r�w�O_BINARYi�)	�os�O_RDONLY�O_WRONLY�O_CREAT�O_TRUNC�hasattrrzr�fd)�self�name�moder8r8r9�__init__@s��

z_LowLevelFile.__init__cCst�|j�dS�N)r{�closer��r�r8r8r9r�Isz_LowLevelFile.closecCst�|j|�Sr�)r{r]r��r�r'r8r8r9r]Lsz_LowLevelFile.readcCst�|j|�dSr�)r{r^r��r�r4r8r8r9r^Osz_LowLevelFile.writeN)rnrorprqr�r�r]r^r8r8r8r9rv:s
	rvc@sreZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS)�_Streama�Class that serves as an adapter between TarFile and
       a stream-like object.  The stream-like object only
       needs to have a read() or write() method and is accessed
       blockwise.  Use of gzip or bzip2 compression is possible.
       A stream-like object could be for example: sys.stdin,
       sys.stdout, a socket, a tape device etc.

       _Stream is intended to be used only internally.
    c	Cs�d|_|dkrt||�}d|_|dkr6t|�}|��}|p<d|_||_||_||_||_d|_	d|_
d|_�zL|dkr�zddl}Wnt
k
r�td	��YnX||_|�d�|_|d
kr�|��|j|_n|��n�|dk�r:zddl}Wnt
k
�r
td��YnX|d
k�r.d|_|��|_t|_n
|��|_n||d
k�r�zddl}Wnt
k
�rntd��YnX|d
k�r�d|_|��|_|j|_n
|��|_n|dk�r�td|��Wn&|j�s�|j��d|_�YnXdS)z$Construct a _Stream object.
        TNF�*��r�gzzzlib module is not availablerx�bz2�bz2 module is not available�xz�lzma module is not available�tar�unknown compression type %r) �_extfileobjrv�_StreamProxy�getcomptyper�r��comptype�fileobjrarW�pos�closed�zlib�ImportErrorr�crc32�crc�
_init_read_gz�errorr`�_init_write_gzr��dbufZBZ2Decompressor�cmp�OSErrorZ
BZ2Compressor�lzmaZLZMADecompressor�	LZMAErrorZLZMACompressorr�)	r�r�r�r�r�rar�r�r�r8r8r9r�]sl












z_Stream.__init__cCst|d�r|js|��dS)Nr�)r�r�r�r�r8r8r9�__del__�sz_Stream.__del__cCs�|j�d|jj|jj|jjd�|_t�dtt	�	���}|�
d|d�|j�d�rf|jdd�|_t
j�|j�|_|�
|j�d	d
�t�dS)z6Initialize for writing with gzip compression.
        �	r�<Ls�s��.gzN���z
iso-8859-1�replace)r�ZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�rV�packrI�time�_Stream__writer��endswithr{r%�basenamer1r3)r�Z	timestampr8r8r9r��s�z_Stream._init_write_gzcCsR|jdkr|j�||j�|_|jt|�7_|jdkrD|j�|�}|�|�dS)z&Write string s to the stream.
        r�r�N)	r�r�r�r�r�r2r��compressr�r�r8r8r9r^�s

z
_Stream.writecCsN|j|7_t|j�|jkrJ|j�|jd|j��|j|jd�|_qdS)z]Write string s to the stream if a whole new block
           is ready to be written.
        N)rWr2rar�r^r�r8r8r9Z__write�sz_Stream.__writecCs�|jr
dSd|_z�|jdkr:|jdkr:|j|j��7_|jdkr�|jr�|j�	|j�d|_|jdkr�|j�	t
�d|j��|j�	t
�d|j
d@��W5|js�|j��XdS)	z[Close the _Stream object. No operation should be
           done on it afterwards.
        NTryr�r�r�r�l��)r�r�r�r�r�r�rWr��flushr^rVr�r�r�r�r8r8r9r��s
z
_Stream.closecCs�|j�|jj�|_d|_|�d�dkr0td��|�d�dkrFtd��t|�d��}|�d�|d	@r�t|�d��d
t|�d��}|�	|�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�d
S)z:Initialize for reading a gzip compressed fileobj.
        r�r$s��not a gzip filer#�zunsupported compression method��rCrB�N)r�Z
decompressobjr�r�r��
_Stream__readrr�ordr]r3)r��flagZxlenr4r8r8r9r��s*
 


z_Stream._init_read_gzcCs|jS)z3Return the stream's file pointer position.
        )r�r�r8r8r9�tell�sz_Stream.tellrcCsX||jdkrJt||j|j�\}}t|�D]}|�|j�q,|�|�ntd��|jS)zXSet the stream's file pointer to pos. Negative seeking
           is forbidden.
        rz seeking backwards is not allowed)r�r\rarHr]r	)r�r�rbrcrMr8r8r9�seeksz_Stream.seekcCs,|dk	st�|�|�}|jt|�7_|S)z5Return the next size number of bytes from the stream.N)�AssertionError�_readr�r2)r�r'rWr8r8r9r]s
z_Stream.readcCs�|jdkr|�|�St|j�}|jg}||kr�|jrB|j}d|_n|j�|j�}|sVq�z|j�	|�}Wn|j
k
r�td��YnX|�|�|t|�7}q&d�
|�}||d�|_|d|�S)z+Return size bytes from the stream.
        r�r�zinvalid compressed dataN)r�r�r2r�rWr�r]rar��
decompressr`r�append�join�r�r'�c�trWr8r8r9r�s(




z
_Stream._readcCsjt|j�}|jg}||krF|j�|j�}|s.qF|�|�|t|�7}qd�|�}||d�|_|d|�S)zsReturn size bytes from stream. If internal buffer is empty,
           read another block from the stream.
        r�N)r2rWr�r]rar�r�r�r8r8r9Z__read3s


z_Stream.__readN)r)rnrorprqr�r�r�r^r�r�r�r�r�r]r�r�r8r8r8r9r�Rs
F
	

r�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zsSmall proxy class that enables transparent compression
       detection for the Stream interface (mode 'r|*').
    cCs||_|j�t�|_dSr�)r�r]�	BLOCKSIZErW)r�r�r8r8r9r�Isz_StreamProxy.__init__cCs|jj|_|jSr�)r�r]rWr�r8r8r9r]Ms
z_StreamProxy.readcCsP|j�d�rdS|jdd�dkr8|jdd�dkr8d	S|j�d
�rHdSdSdS)
Ns�r�r�sBZhr��
s1AY&SYr�)s]�s�7zXZr�r�)rW�
startswithr�r8r8r9r�Qs$z_StreamProxy.getcomptypecCs|j��dSr�)r�r�r�r8r8r9r�[sz_StreamProxy.closeN)rnrorprqr�r]r�r�r8r8r8r9r�Ds

r�c@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
jfdd�Zddd�Z
dd�Zdd�ZdS)�_FileInFilezA thin wrapper around an existing file object that
       provides a part of its data as an individual file
       object.
    NcCs�||_||_||_d|_t|dd�|_d|_|dkr>d|fg}d|_g|_d}|j}|D]L\}}||kr||j�	d||df�|j�	d||||f�||7}||}qX||jkr�|j�	d||jdf�dS)Nrr�FT)
r��offsetr'�positionrhr�r��	map_index�mapr�)r�r�r�r'Z	blockinfoZlastposZrealposr8r8r9r�hs(


z_FileInFile.__init__cCsdSr�r8r�r8r8r9r��sz_FileInFile.flushcCsdS�NTr8r�r8r8r9�readable�sz_FileInFile.readablecCsdS)NFr8r�r8r8r9�writable�sz_FileInFile.writablecCs
|j��Sr�)r��seekabler�r8r8r9r��sz_FileInFile.seekablecCs|jS)z*Return the current file position.
        )r�r�r8r8r9r��sz_FileInFile.tellcCs�|tjkr tt|d�|j�|_nj|tjkr\|dkrFt|j|d�|_q�t|j||j�|_n.|tjkr�tt|j||j�d�|_ntd��|jS)z(Seek to a position in the file.
        rzInvalid argument)	�io�SEEK_SET�min�maxr'r��SEEK_CUR�SEEK_ENDr0)r�r��whencer8r8r9r��s


z_FileInFile.seekc	Cs
|dkr|j|j}nt||j|j�}d}|dk�r|j|j\}}}}||jkr`|krhq�nq�q6|jd7_|jt|j�kr6d|_q6t|||j�}|r�|j�||j|�|j�|�}t|�|kr�t	d��||7}n|t
|7}||8}|j|7_q,|S)z!Read data from the file.
        Nr�rr#rY)r'r�r�r�r�r2r�r�r]rr3)	r�r'rW�data�start�stopr�r5rdr8r8r9r]�s,

z_FileInFile.readcCs&|�t|��}||dt|��<t|�Sr�)r]r2)r�rdrWr8r8r9�readinto�sz_FileInFile.readintocCs
d|_dSr�)r�r�r8r8r9r��sz_FileInFile.close)N)N)rnrorprqr�r�r�r�r�r�r�r�r�r]r�r�r8r8r8r9r�bs

r�cseZdZ�fdd�Z�ZS)�ExFileObjectcs&t|j|j|j|j�}t��|�dSr�)r�r��offset_datar'�sparse�superr�)r��tarfile�tarinfor���	__class__r8r9r��s

�zExFileObject.__init__�rnrorpr��
__classcell__r8r8r�r9r��sr�c@seZdZdS)�FilterErrorN)rnrorpr8r8r8r9r��sr�cseZdZ�fdd�Z�ZS)�AbsolutePathErrorcs ||_t��d|j�d��dS)Nzmember z has an absolute path�r�r�r�r��r�r�r�r8r9r��szAbsolutePathError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�OutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would be extracted to �, � which is outside the destination�r��_pathr�r�r��r�r�r%r�r8r9r��s
�z OutsideDestinationError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�SpecialFileErrorcs||_t��|j�d��dS)Nz is a special filer�r�r�r8r9r��szSpecialFileError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�AbsoluteLinkErrorcs||_t��|j�d��dS)Nz! is a symlink to an absolute pathr�r�r�r8r9r��szAbsoluteLinkError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�LinkOutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would link to r�r�r�r�r�r8r9r��s
�z$LinkOutsideDestinationError.__init__r�r8r8r�r9r��sr�cCs�i}|j}tj�|�}|�dtjf�r@|j�dtj�}|d<tj�|�rTt|��tj�tj�	||��}tj�
||g�|kr�t||��|j}|dk	r�|d@}|r�|�
�s�|��r�|d@s�|dM}|dO}n|��s�|��r�d}nt|��||jkr�||d<|�r�|jdk	�rd|d<|jdk	�r*d|d	<|jdk	�r>d|d
<|jdk	�rRd|d<|���sf|���r�tj�|j��r~t|��|���r�tj�	|tj�|�|j�}ntj�	||j�}tj�|�}tj�
||g�|k�r�t||��|S)N�/r�i��@i�����r�r)r*r+r,)r�r{r%�realpathr��sep�lstrip�isabsr�r��
commonpathr�r��isreg�islnk�isdir�issymr�r)r*r+r,�linknamer��dirnamer�)�member�	dest_pathZfor_data�	new_attrsr�Ztarget_pathr�r8r8r9�_get_filtered_attrs�s^




��
r	cCs|Sr�r8)rrr8r8r9�fully_trusted_filter6sr
cCs(t||d�}|r$|jf|ddi��S|S)NF�deep�r	r��rrrr8r8r9�
tar_filter9srcCs(t||d�}|r$|jf|ddi��S|S)NTrFrr
r8r8r9�data_filter?sr)Z
fully_trustedr�r�c@s�eZdZdZedddddddd	d
ddd
ddddddddd�Zdidd�Zedd��Zej	dd��Zedd��Z
e
j	dd��Z
dd�Zeeeeeeeed ed!�
d"d#�Z
d$d%�Zeed&fd'd(�Zd)d*�Zd+d,�Zd-d.�Zed/d0��Zd1d2�Zed3d4��Zed5d6��Zed7d8��Zed9d:��Zed;d<��Zed=d>��Zd?d@�ZdAdB�Z dCdD�Z!dEdF�Z"dGdH�Z#dIdJ�Z$dKdL�Z%dMdN�Z&dOdP�Z'dQdR�Z(dSdT�Z)dUdV�Z*dWdX�Z+dYdZ�Z,d[d\�Z-d]d^�Z.d_d`�Z/dadb�Z0dcdd�Z1dedf�Z2dgdh�Z3dS)jraInformational class which holds the details about an
       archive member given by a tar header block.
       TarInfo objects are returned by TarFile.getmember(),
       TarFile.getmembers() and TarFile.gettarinfo() and are
       usually created internally.
    zName of the archive member.zPermission bits.z6User ID of the user who originally stored this member.z7Group ID of the user who originally stored this member.zSize in bytes.zTime of last modification.zHeader checksum.z�File type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.zcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.z
User name.zGroup name.zDevice major number.zDevice minor number.zThe tar header starts here.zThe file's data starts here.zMA dictionary containing key-value pairs of an associated pax extended header.zSparse member information.N)r�r�r)r*r'r(�chksum�typerr+r,�devmajor�devminorr�r��pax_headersr�r��_sparse_structs�_link_targetr�cCsj||_d|_d|_d|_d|_d|_d|_t|_d|_	d|_
d|_d|_d|_
d|_d|_d|_i|_dS)zXConstruct a TarInfo object. name is the optional name
           of the member.
        i�rr�N)r�r�r)r*r'r(r�REGTYPErrr+r,rrr�r�r�r�r�r�r8r8r9r�us"zTarInfo.__init__cCs|jS)z(In pax headers, "name" is called "path".�r�r�r8r8r9r%�szTarInfo.pathcCs
||_dSr�rrr8r8r9r%�scCs|jS)z0In pax headers, "linkname" is called "linkpath".�rr�r8r8r9r&�szTarInfo.linkpathcCs
||_dSr�r)r�rr8r8r9r&�scCsd|jj|jt|�fS)Nz<%s %r at %#x>)r�rnr��idr�r8r8r9�__repr__�szTarInfo.__repr__T)
r�r(r�rr)r*r+r,r�_KEEPc
Cs�|	rt�|�}n
t�|�}||
k	r(||_||
k	r6||_||
k	rD||_||
k	rR||_||
k	r`||_||
k	rn||_||
k	r|||_||
k	r�||_	|S)zGReturn a deep copy of self with the given attributes replaced.
        )
�copyZdeepcopyr�r(r�rr)r*r+r,)r�r�r(r�rr)r*r+r,rr�resultr8r8r9r��s(
zTarInfo.replacecCs�|jdkrd}n
|jd@}|j||j|j|j|j|j|j|j|j	|j
|j|jd�
}|dt
kr||d�d�s||dd7<|S)z9Return the TarInfo's attributes as a dictionary.
        N�)
r�r�r)r*r'r(rrrr+r,rrrr�r�)r�r�r)r*r'r(rrrr+r,rr�DIRTYPEr�)r�r��infor8r8r9�get_info�s(

�zTarInfo.get_info�surrogateescapecCsz|��}|��D]\}}|dkrtd|��q|tkrD|�|||�S|tkrZ|�|||�S|tkrn|�||�Std��dS)z<Return a tar header as a string of 512 byte blocks.
        Nz%s may not be Nonezinvalid format)	r#�itemsr0r
�create_ustar_headerr�create_gnu_headerr�create_pax_header)r�rSr6r7r"r��valuer8r8r9�tobuf�sz
TarInfo.tobufcCsnt|d<t|d�||��tkr(td��t|d�||��tkr^|�|d||�\|d<|d<|�|t||�S)z3Return the object as a ustar header block.
        �magicrzlinkname is too longr��prefix)	�POSIX_MAGICr2r1�LENGTH_LINKr0�LENGTH_NAME�_posix_split_name�_create_headerr
)r�r"r6r7r8r8r9r&�szTarInfo.create_ustar_headercCs�t|d<d}t|d�||��tkr<||�|dt||�7}t|d�||��tkrl||�|dt||�7}||�|t	||�S)z:Return the object as a GNU header block sequence.
        r+r�rr�)
�	GNU_MAGICr2r1r.�_create_gnu_long_header�GNUTYPE_LONGLINKr/�GNUTYPE_LONGNAMEr1r)r�r"r6r7rWr8r8r9r'�szTarInfo.create_gnu_headerc
	Cs*t|d<|j��}ddtfddtfddfD]j\}}}||kr>q*z||�dd	�Wn$tk
rv||||<Yq*YnXt||�|kr*||||<q*d
D]`\}}||kr�d||<q�||}d|kr�d|d
kr�nn
t|t	�r�t
|�||<d||<q�|�r|�|t|�}	nd}	|	|�
|tdd�S)z�Return the object as a ustar header block. If it cannot be
           represented this way, prepend a pax extended header sequence
           with supplement information.
        r+r�r%rr&)r+r+� )r,r,r6rDrE))r)rB)r*rB)r'�)r(r7rrBr#r�r�)r-rrr/r.r1�UnicodeEncodeErrorr2�
isinstance�float�str�_create_pax_generic_header�XHDTYPEr1r
)
r�r"r6rr�Zhnamer5rR�valrWr8r8r9r(s8
�
*
zTarInfo.create_pax_headercCs|�|td�S)zAReturn the object as a pax global header block sequence.
        r/)r<�XGLTYPE)�clsrr8r8r9�create_pax_global_header7sz TarInfo.create_pax_global_headercCs~|�d�}tdt|��D]T}d�|d|��}d�||d��}t|�||��tkrt|�||��tkrqvqtd��||fS)zUSplit a name longer than 100 chars into a prefix
           and a name part.
        r�r#Nzname is too long)�splitrHr2r�r1�
LENGTH_PREFIXr/r0)r�r�r6r7Z
componentsrMr,r8r8r9r0=s
�zTarInfo._posix_split_namecCs�|�d�ttfk}|r@t|�dd�d|�}t|�dd�d|�}ntdd||�}tdd||�}|�dt�}|dkrxtd��t|�d	d�d
||�t|�dd�d@d|�t|�d
d�d|�t|�dd�d|�t|�dd�d|�t|�dd�d|�d|t|�dd�d
||�|�dt�t|�dd�d||�t|�dd�d||�t|�dd�d|�t|�dd�d|�t|�dd�d||�g}t�	dt
d�|��}	t|	t
d��d}
|	dd�t
d|
d�|	dd�}	|	S) z�Return a header block. info is a dictionary with file
           information, format must be one of the *_FORMAT constants.
        rrrrBrr�NzTarInfo.type must not be Noner�rr�r r)r*r'r7r(s        rr+r+r6r,r,rz%dsr�i����z%06orDi����)�get�CHRTYPE�BLKTYPErTr:rr0r-rVr�r�r�rXrO)r"rSr6r7Zhas_device_fieldsrrZfiletype�partsrWrr8r8r9r1Ms:
�&zTarInfo._create_headercCs.tt|�t�\}}|dkr*|t|t7}|S)zdReturn the string payload filled with zero bytes
           up to the next 512 byte border.
        r)r\r2r�r3)Zpayloadrbrcr8r8r9�_create_payloadwszTarInfo._create_payloadcCsR|�||�t}i}d|d<||d<t|�|d<t|d<|�|t||�|�|�S)zTReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence
           for name.
        z
././@LongLinkr�rr'r+)r1r3r2r2r1r
rH)r@r�rr6r7r"r8r8r9r3�s�zTarInfo._create_gnu_long_headerc	Cs2d}|��D]8\}}z|�dd�Wqtk
rBd}YqFYqXqd}|rV|d7}|��D]�\}}|�d�}|r�|�|d�}n
|�d�}t|�t|�d}d	}	}
|tt|
��}	|	|
kr�q�|	}
q�|tt|
�d
�d|d|d
7}q^i}d|d<||d<t|�|d<t|d<|�|td
d�|�	|�S)z�Return a POSIX.1-2008 extended or global header sequence
           that contains a list of keyword, value pairs. The values
           must be strings.
        Fr/rETr�s21 hdrcharset=BINARY
r$r�rrD� �=�
z././@PaxHeaderr�rr'r+r�)
r%r1r8r2r;rOr-r1r
rH)r@rrr6Zbinary�keywordr)Zrecords�lrLr>r"r8r8r9r<�s<

(�z"TarInfo._create_pax_generic_headerc	Csvt|�dkrtd��t|�tkr(td��|�t�tkr>td��t|dd��}|t|�krbt	d��|�}t
|dd�||�|_t|dd	��|_t|d	d
��|_
t|d
d��|_t|dd��|_t|dd��|_||_|dd
�|_t
|d
d�||�|_t
|dd�||�|_t
|dd�||�|_t|dd��|_t|dd��|_t
|dd�||�}|jtk�r�|j�d��r�t|_|jtk�r8d}g}td�D]l}	z0t|||d��}
t||d|d��}Wntk
�r�Y�qYnX|�|
|f�|d7}�q�t|d�}t|dd��}
|||
f|_ |�!��rP|j�"d�|_|�rr|jt#k�rr|d|j|_|S)zAConstruct a TarInfo object from a 512 byte bytes object.
        rzempty headerztruncated headerzend of file header��zbad checksumr�l�t�|��ii	i)iIiQiYi�r�i�r�r7�i�i�i�)$r2rrr�rs�countr3rtrNrXrKr?r�r�r)r*r'r(rrrr+r,rr�AREGTYPEr�r!�GNUTYPE_SPARSErHr0r��boolrr�rstrip�	GNU_TYPES)r@rWr6r7r�objr,r��structsrMr��numbytes�
isextended�origsizer8r8r9�frombuf�sZ
zTarInfo.frombufcCs8|j�t�}|�||j|j�}|j��t|_|�|�S)zOReturn the next TarInfo object from TarFile object
           tarfile.
        )	r�r]r�rar6r7r�r��_proc_member)r@r�rWr\r8r8r9�fromtarfileszTarInfo.fromtarfilecCsT|jttfkr|�|�S|jtkr,|�|�S|jtttfkrF|�	|�S|�
|�SdS)zYChoose the right processing method depending on
           the type and call it.
        N)rr5r4�
_proc_gnulongrX�_proc_sparser=r?�SOLARIS_XHDTYPE�	_proc_pax�
_proc_builtin)r�r�r8r8r9rbs



zTarInfo._proc_membercCsR|j��|_|j}|��s$|jtkr4||�|j�7}||_|�	|j
|j|j�|S)zfProcess a builtin type or an unknown type which
           will be treated as a regular file.
        )
r�r�r�rr�SUPPORTED_TYPES�_blockr'r��_apply_pax_inforr6r7)r�r�r�r8r8r9rh&szTarInfo._proc_builtincCs�|j�|�|j��}z|�|�}Wntk
r>td��YnX|j|_|jt	krft
||j|j�|_
n|jtkr�t
||j|j�|_|S)zSProcess the blocks that hold a GNU longname
           or longlink member.
        � missing or bad subsequent header)r�r]rjr'rcrrur�rr5r?r6r7r�r4r)r�r�rW�nextr8r8r9rd7s

zTarInfo._proc_gnulongc
	Cs�|j\}}}|`|r�|j�t�}d}td�D]n}z0t|||d��}t||d|d��}	Wntk
rzYq�YnX|r�|	r�|�||	f�|d7}q,t|d�}q||_	|j�
�|_|j|�|j
�|_||_
|S)z8Process a GNU sparse header plus extra headers.
        r�r7rUi�)rr�r]r�rHrNr0r�rYr�r�r�rjr'r�)
r�r�r]r_r`rWr�rMr�r^r8r8r9reMs(
zTarInfo._proc_sparsecCs.|j�|�|j��}|jtkr&|j}n
|j��}t�	d|�}|dk	rX|�
d��d�|d<|�d�}|dkrr|j
}nd}t�d�}d}|�||�}|s��q6|��\}	}
t|	�}	|	dkr�td	��||�d
�d|�d�|	d�}|�|
dd|j�}
|
tk�r|�|||j
|j�}n|�|dd|j�}|||
<||	7}q�z|�|�}Wntk
�rbtd��YnXd|k�r||�||�nHd
|k�r�|�|||�n.|�d�dk�r�|�d�dk�r�|�|||�|jttfk�r*|� ||j
|j�|j!|_!d|k�r*|j"}
|�#��s|jt$k�r$|
|�|j�7}
|
|_!|S)zVProcess an extended or global header as described in
           POSIX.1-2008.
        s\d+ hdrcharset=([^\n]+)\nNr#r/�
hdrcharsetZBINARYs(\d+) ([^=]+)=rrGr$rl�GNU.sparse.map�GNU.sparse.sizezGNU.sparse.major�1zGNU.sparse.minorrFr')%r�r]rjr'rr?rr�re�search�groupr=rDr6�compile�match�groupsrIrKrgr��_decode_pax_fieldr7�PAX_NAME_FIELDSrcrru�_proc_gnusparse_01�_proc_gnusparse_00�_proc_gnusparse_10r=rfrkr�r�rri)r�r�rWrrwror6Zregexr�r5rLr)rmr�r8r8r9rgish



$	
�
�
�


 
zTarInfo._proc_paxcCshg}t�d|�D]}|�t|�d���qg}t�d|�D]}|�t|�d���q:tt||��|_dS)z?Process a GNU tar extended sparse header, version 0.0.
        s\d+ GNU.sparse.offset=(\d+)\nr#s\d+ GNU.sparse.numbytes=(\d+)\nN)rs�finditerr�rIru�list�zipr�)r�rmrrWZoffsetsrwr^r8r8r9r|�szTarInfo._proc_gnusparse_00cCs@dd�|d�d�D�}tt|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 0.1.
        cSsg|]}t|��qSr8)rI)�.0�xr8r8r9�
<listcomp>�sz.TarInfo._proc_gnusparse_01.<locals>.<listcomp>rp�,Nr$r#)rBrr�r�)r�rmrr�r8r8r9r{�szTarInfo._proc_gnusparse_01cCs�d}g}|j�t�}|�dd�\}}t|�}t|�|dkrtd|krT||j�t�7}|�dd�\}}|�t|��q,|j��|_t	t
|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 1.0.
        NrKr#r$)r�r]r�rBrIr2r�r�r�rr�r�)r�rmrr�Zfieldsr�rWZnumberr8r8r9r}�szTarInfo._proc_gnusparse_10c	Cs�|��D]�\}}|dkr&t|d|�q|dkr@t|dt|��q|dkrZt|dt|��q|tkr|tkr�zt||�}Wntk
r�d}YnX|dkr�|�d�}t|||�q|��|_dS)	zoReplace fields with supplemental information from a previous
           pax extended or global header.
        zGNU.sparse.namer%rqr'zGNU.sparse.realsizerr�N)	r%�setattrrI�
PAX_FIELDS�PAX_NUMBER_FIELDSr0rZrr)r�rr6r7rLr)r8r8r9rk�s"

zTarInfo._apply_pax_infocCs4z|�|d�WStk
r.|�||�YSXdS)z1Decode a single field from a pax record.
        rEN)r=�UnicodeDecodeError)r�r)r6Zfallback_encodingZfallback_errorsr8r8r9ry	szTarInfo._decode_pax_fieldcCs"t|t�\}}|r|d7}|tS)z_Round up a byte count by BLOCKSIZE and return it,
           e.g. _block(834) => 1024.
        r#)r\r�)r�rVrbrcr8r8r9rjszTarInfo._blockcCs
|jtkS�z4Return True if the Tarinfo object is a regular file.)r�
REGULAR_TYPESr�r8r8r9rsz
TarInfo.isregcCs|��Sr�)rr�r8r8r9�isfileszTarInfo.isfilecCs
|jtkS)z!Return True if it is a directory.)rr!r�r8r8r9r"sz
TarInfo.isdircCs
|jtkS)z%Return True if it is a symbolic link.)r�SYMTYPEr�r8r8r9r&sz
TarInfo.issymcCs
|jtkS)z!Return True if it is a hard link.)r�LNKTYPEr�r8r8r9r*sz
TarInfo.islnkcCs
|jtkS)z(Return True if it is a character device.)rrEr�r8r8r9�ischr.sz
TarInfo.ischrcCs
|jtkS)z$Return True if it is a block device.)rrFr�r8r8r9�isblk2sz
TarInfo.isblkcCs
|jtkS)zReturn True if it is a FIFO.)r�FIFOTYPEr�r8r8r9�isfifo6szTarInfo.isfifocCs
|jdk	Sr�)r�r�r8r8r9�issparse:szTarInfo.issparsecCs|jtttfkS)zCReturn True if it is one of character device, block device or FIFO.)rrErFr�r�r8r8r9�isdev=sz
TarInfo.isdev)r�)4rnrorprq�dict�	__slots__r��propertyr%�setterr&rrr�r#rrr*r&r'r(�classmethodrAr0�staticmethodr1rHr3r<rarcrbrhrdrergr|r{r}rkryrjrr�rrrr�r�r�r�r�r8r8r8r9rRs��




�
1

)
	

2
>

h	c
@s�eZdZdZdZdZdZdZeZ	e
ZdZe
ZeZdZdfdd	�Zedddefd
d��Zedgdd
��Zedhdd��Zedidd��Zedjdd��Zddddd�Zdd�Zdd�Zdd�Zd d!�Zdkd"d#�Zdldd%�d&d'�Z dmdd(�d)d*�Z!dnd+d,�Z"d-d.�Z#doddd0�d1d2�Z$dpddd0�d4d5�Z%d6d7�Z&d8d9�Z'd:d;�Z(d<d=�Z)d>d?�Z*dqd@dA�Z+dBdC�Z,dDdE�Z-dFdG�Z.dHdI�Z/dJdK�Z0dLdM�Z1dNdO�Z2dPdQ�Z3dRdS�Z4dTdU�Z5drdVdW�Z6dXdY�Z7dsdZd[�Z8d\d]�Z9d^d_�Z:d`da�Z;dbdc�Z<ddde�Z=dS)trz=The TarFile Class provides an interface to tar archives.
    rFr#Nrxr$c
Cs�ddddd�}||krtd��||_|||_|sh|jdkrTtj�|�sTd|_d|_t||j�}d	|_n@|d
kr�t|d�r�t	|j
ttf�r�|j
}t|d�r�|j|_d
|_|r�tj�
|�nd
|_
||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	�r||_|	|_|
d
k	�r0|jtk�r0|
|_ni|_|d
k	�rF||_|d
k	�rV||_|
|_d	|_g|_d	|_|j��|_i|_z�|jdk�r�d
|_ |�!�|_ |jdk�r2|j�"|j�z|j�#|�}|j�$|�WnXt%k
�r�|j�"|j�Y�q2Yn0t&k
�r,}zt't|���W5d
}~XYnX�q�|jdk�r|d
|_|j�r||j�(|j�)��}|j�*|�|jt+|�7_Wn&|j�s�|j�,�d
|_�YnXd
S)a�Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        �rbzr+b�wbZxb�rx�aryr��!mode must be 'r', 'a', 'w' or 'x'r�ryFNr�r�Trx�r�ryr�)-r0r��_moder{r%�exists�	bltn_openr�r�r9r�r;rO�abspathr�rSr��dereference�ignore_zerosr6r7rr�debug�
errorlevel�copybufsizer��members�_loadedr�r��inodes�firstmemberrmr�rcr�rtrrrArr^r2r�)r�r�r�r�rSr�r�r�r6r7rr�r�r�Zmodes�erWr8r8r9r�^s�
�





"
zTarFile.__init__c

s�|s|std��|dkr��fdd�}t�j|d�D]j}t��j|�}|dk	rV|��}	z||d|f|�WSttfk
r�|dk	r�|�|	�Yq2Yq2Xq2td���nd	|k�r|�d	d
�\}
}|
p�d}
|p�d}|�jkr�t��j|�}ntd|��|||
|f|�Sd
|k�r�|�d
d
�\}
}|
�p.d}
|�p8d}|
dk�rLtd��t	||
|||�}z�||
|f|�}Wn|�
��YnXd|_|S|dk�r��j|||f|�Std��dS)a�Open a tar archive for reading, writing or appending. Return
           an appropriate TarFile class.

           mode:
           'r' or 'r:*' open for reading with transparent compression
           'r:'         open for reading exclusively uncompressed
           'r:gz'       open for reading with gzip compression
           'r:bz2'      open for reading with bzip2 compression
           'r:xz'       open for reading with lzma compression
           'a' or 'a:'  open for appending, creating the file if necessary
           'w' or 'w:'  open for writing without compression
           'w:gz'       open for writing with gzip compression
           'w:bz2'      open for writing with bzip2 compression
           'w:xz'       open for writing with lzma compression

           'x' or 'x:'  create a tarfile exclusively without compression, raise
                        an exception if the file is already created
           'x:gz'       create a gzip compressed tarfile, raise an exception
                        if the file is already created
           'x:bz2'      create a bzip2 compressed tarfile, raise an exception
                        if the file is already created
           'x:xz'       create an lzma compressed tarfile, raise an exception
                        if the file is already created

           'r|*'        open a stream of tar blocks with transparent compression
           'r|'         open an uncompressed stream of tar blocks for reading
           'r|gz'       open a gzip compressed stream of tar blocks
           'r|bz2'      open a bzip2 compressed stream of tar blocks
           'r|xz'       open an lzma compressed stream of tar blocks
           'w|'         open an uncompressed stream for writing
           'w|gz'       open a gzip compressed stream for writing
           'w|bz2'      open a bzip2 compressed stream for writing
           'w|xz'       open an lzma compressed stream for writing
        znothing to open)rx�r:*cs�j|dkS)N�taropen)�	OPEN_METH)r��r@r8r9�not_compressed�sz$TarFile.open.<locals>.not_compressed)�keyNrxz%file could not be opened successfully�:r#r�r��|rwzmode must be 'r' or 'w'Fr�zundiscernible mode)
r0�sortedr�rhr�rrr�rBr�r�r�r�)
r@r�r�r�ra�kwargsr�r��funcZ	saved_pos�filemode�streamr�r8r�r9r�sP%







zTarFile.opencKs |dkrtd��||||f|�S)zCOpen uncompressed tar archive name for reading or writing.
        r�r�)r0)r@r�r�r�r�r8r8r9r�(szTarFile.taropenr�cKs�|dkrtd��zddlm}Wntk
r<td��YnXz|||d||�}Wn.tk
r�|dk	r||dkr|td	���YnXz|j|||f|�}WnBtk
r�|��|dkr�td	���Yn|���YnXd
|_	|S)zkOpen gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        �rxryr��mode must be 'r', 'w' or 'x'r)�GzipFilezgzip module is not availablerdNrxr�F)
r0Zgzipr�r�rr�rr�r�r�)r@r�r�r��
compresslevelr�r�r�r8r8r9�gzopen0s0zTarFile.gzopenc	Ks�|dkrtd��zddlm}Wntk
r<td��YnX||pF|||d�}z|j|||f|�}WnFttfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zlOpen bzip2 compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�BZ2Filer�)r�rxznot a bzip2 fileF)r0r�r�r�rr�r��EOFErrorr�rr�)r@r�r�r�r�r�r�r�r8r8r9�bz2openQs&zTarFile.bz2openc		Ks�|dkrtd��zddlm}m}Wntk
r@td��YnX||pJ|||d�}z|j|||f|�}WnF|tfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zkOpen lzma compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�LZMAFiler�r�)�presetrxznot an lzma fileF)r0r�r�r�r�rr�r�r�rr�)	r@r�r�r�r�r�r�r�r�r8r8r9�xzopenms&zTarFile.xzopenr�r�r�r�)r�r�r�r�cCs�|jr
dSd|_z`|jdkrn|j�ttd�|jtd7_t	|jt
�\}}|dkrn|j�tt
|�W5|js�|j��XdS)zlClose the TarFile. In write-mode, two finishing zero blocks are
           appended to the archive.
        NTr�r$r)r�r�r�r�r�r^r3r�r�r\�
RECORDSIZE)r�rbrcr8r8r9r��s
z
TarFile.closecCs"|�|�}|dkrtd|��|S)aReturn a TarInfo object for member `name'. If `name' can not be
           found in the archive, KeyError is raised. If a member occurs more
           than once in the archive, its last occurrence is assumed to be the
           most up-to-date version.
        Nzfilename %r not found)�
_getmember�KeyError)r�r�r�r8r8r9�	getmember�s
zTarFile.getmembercCs|��|js|��|jS)z�Return the members of the archive as a list of TarInfo objects. The
           list has the same order as the members in the archive.
        )�_checkr��_loadr�r�r8r8r9�
getmembers�szTarFile.getmemberscCsdd�|��D�S)z�Return the members of the archive as a list of their names. It has
           the same order as the list returned by getmembers().
        cSsg|]
}|j�qSr8r)r�r�r8r8r9r��sz$TarFile.getnames.<locals>.<listcomp>)r�r�r8r8r9�getnames�szTarFile.getnamescCs^|�d�|dk	r|j}|dkr$|}tj�|�\}}|�tjd�}|�d�}|��}||_	|dkr�|j
stt�|�}q�t�|�}nt�
|���}d}|j}t�|�r�|j|jf}	|j
s�|jdkr�|	|jkr�||j|	kr�t}
|j|	}nt}
|	dr�||j|	<nht�|��rt}
nVt�|��r"t}
nDt�|��r>t}
t�|�}n(t�|��rPt}
nt� |��rbt!}
ndS||_||_"|j#|_$|j%|_&|
tk�r�|j'|_(nd|_(|j)|_*|
|_+||_,t-�r�zt-�.|j$�d|_/Wnt0k
�r�YnXt1�rzt1�2|j&�d|_3Wnt0k
�rYnX|
tt!fk�rZt4td��rZt4td��rZt�5|j6�|_7t�8|j6�|_9|S)	a�Create a TarInfo object from the result of os.stat or equivalent
           on an existing file. The file is either named by `name', or
           specified as a file object `fileobj' with a file descriptor. If
           given, `arcname' specifies an alternative name for the file in the
           archive, otherwise, the name is taken from the 'name' attribute of
           'fileobj', or the 'name' argument. The name should be a text
           string.
        �awxNr�r�r#r�major�minor):r�r�r{r%�
splitdriver�r�r�r�r�r��lstat�stat�fstat�fileno�st_mode�S_ISREG�st_ino�st_dev�st_nlinkr�r�r�S_ISDIRr!�S_ISFIFOr��S_ISLNKr��readlink�S_ISCHRrE�S_ISBLKrFr��st_uidr)�st_gidr*�st_sizer'�st_mtimer(rr�pwd�getpwuidr+r��grpZgetgrgidr,r�r��st_rdevrr�r)r�r��arcnamer�Zdrvr�ZstatresrZstmd�inoderr8r8r9�
gettarinfo�s�	


��

zTarFile.gettarinfoT)r�cCs*|��|dkr|}|D�]
}|r�|jdkr6td�ntt�|j��td|jpT|j|jp^|jf�|�	�sv|�
�r�tdd|j|jf�ntd|j
�|jdkr�td�ntdt�|j�dd	��t|j|��r�d
nd�|�r|���rtd|j�|���rtd
|j�t�qdS)aPrint a table of contents to sys.stdout. If `verbose' is False, only
           the names of the members are printed. If it is True, an `ls -l'-like
           output is produced. `members' is optional and must be a subset of the
           list returned by getmembers().
        Nz
??????????z%s/%sz%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02dr�r�r�z-> zlink to )r�r�rlr�r�r+r)r,r*r�r�rrr'r(r��	localtimer�rrrrrk)r��verboser�r�r8r8r9r's8



��

�

zTarFile.list��filterc	Cs6|�d�|dkr|}|jdk	rFtj�|�|jkrF|�dd|�dS|�d|�|�||�}|dkrz|�dd|�dS|dk	r�||�}|dkr�|�dd|�dS|��r�t|d��}|�	||�W5QRXn`|�
��r(|�	|�|�r2tt�|��D]*}|j
tj�||�tj�||�||d	�q�n
|�	|�dS)
a!Add the file `name' to the archive. `name' may be any type of file
           (directory, fifo, symbolic link, etc.). If given, `arcname'
           specifies an alternative name for the file in the archive.
           Directories are added recursively by default. This can be avoided by
           setting `recursive' to False. `filter' is a function
           that expects a TarInfo object argument and returns the changed
           TarInfo object, if it returns None the TarInfo object will be
           excluded from the archive.
        r�Nr$ztarfile: Skipped %rr#ztarfile: Unsupported type %r�tarfile: Excluded %rr�r�)r�r�r{r%r��_dbgr�rr��addfilerr��listdir�addr�)r�r�r��	recursiver�r��fr8r8r9r�Ms8



�
zTarFile.addcCs�|�d�t�|�}|�|j|j|j�}|j�|�|jt	|�7_|j
}|dk	r�t||j|j|d�t
|jt�\}}|dkr�|j�tt|�|d7}|j|t7_|j�|�dS)aAdd the TarInfo object `tarinfo' to the archive. If `fileobj' is
           given, it should be a binary file, and tarinfo.size bytes are read
           from it and added to the archive. You can create TarInfo objects
           directly, or by using gettarinfo().
        r�N)rarr#)r�rr*rSr6r7r�r^r�r2r�r[r'r\r�r3r�r�)r�r�r�rWrarbrcr8r8r9r��s

zTarFile.addfilec	CsB|dkr�|j}|dkr�tj�d�}|dkr�ztt�}Wntk
rJYnBXddl}|jddd�}|�|�	|�W5QRX|jdddd�}|r�zt
|}Wn&tk
r�td|�d	��d�YnX||_|St
r�t�d
t�tStSt|t�r�td��|St|��r
|Sz
t
|WStk
�r<td|�d	��d�YnXdS)NZ PYTHON_TARFILE_EXTRACTION_FILTERr)�#)Z
interpolationZcomment_prefixesr�r�)Zfallbackzfilter z
 not foundaThe default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.zrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.)�extraction_filterr{�environrDr��_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�_NAMED_FILTERSr�r0�_RH_SAFER_DEFAULT�warnings�warn�RuntimeWarningrr
r9r;�	TypeError�callable)r�r�r��filer�Zconfr8r8r9�_get_filter_function�sZ���	
�

zTarFile._get_filter_function�.)�
numeric_ownerr�cCs�g}|�|�}|dkr|}|D]F}|�|||�}|dkr:q|��rL|�|�|j|||��|d�q|jdd�dd�|D]n}tj�||j	�}	z,|j
||	|d�|�||	�|�||	�Wq|t
k
r�}
z|�|
�W5d}
~
XYq|Xq|dS)a�Extract all members from the archive to the current working
           directory and set owner, modification time and permissions on
           directories afterwards. `path' specifies a different directory
           to extract to. `members' is optional and must be a subset of the
           list returned by getmembers(). If `numeric_owner` is True, only
           the numbers for user/group names are used and not the names.

           The `filter` function will be called on each member just
           before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N��	set_attrsrcSs|jSr�r)r�r8r8r9�<lambda>�r�z$TarFile.extractall.<locals>.<lambda>T)r��reverse)r)r�_get_extract_tarinforr��_extract_one�sortr{r%r�r��chown�utime�chmodr
�_handle_nonfatal_error)r�r%r�rr�Zdirectories�filter_functionrr��dirpathr�r8r8r9�
extractall�s,

�zTarFile.extractallr�cCs4|�|�}|�|||�}|dk	r0|�||||�dS)a�Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a TarInfo object. You can
           specify a different directory using `path'. File attributes (owner,
           mtime, mode) are set unless `set_attrs' is False. If `numeric_owner`
           is True, only the numbers for user/group names are used and not
           the names.

           The `filter` function will be called before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N)rrr
)r�rr%r	rr�rr�r8r8r9�extract�s
zTarFile.extractc
Cs�t|t�r|�|�}n|}|}z|||�}WnZttfk
r\}z|�|�W5d}~XYn,tk
r�}z|�|�W5d}~XYnX|dkr�|�dd|j	�dS|�
�r�t�|�}tj
�||j�|_|S)z@Get filtered TarInfo (or None) from member, which might be a strNr$r�)r9r;r�r�r��_handle_fatal_errorr
rr�r�rrr{r%r�rr)r�rrr%r�Z
unfilteredr�r8r8r9r	s"

zTarFile._get_extract_tarinfoc
Cs�|�d�z"|j|tj�||j�||d�WnVtk
rX}z|�|�W5d}~XYn,tk
r�}z|�	|�W5d}~XYnXdS)z%Extract from filtered tarinfo to diskrxrN)
r��_extract_memberr{r%r�r�r�rr
r)r�r�r%r	rr�r8r8r9r
%	s
�
zTarFile._extract_onecCs"|jdkr�n|�dd|�dS)z=Handle non-fatal error (ExtractError) according to errorlevelr#�tarfile: %sN)r�r��r�r�r8r8r9r2	s
zTarFile._handle_nonfatal_errorcCsn|jdkr�n\t|t�rP|jdkr6|�dd|j�qj|�dd|j|jf�n|�ddt|�j|f�dS)z1Handle "fatal" error according to self.errorlevelrNr#rztarfile: %s %rztarfile: %s %s)r�r9r��filenamer��strerrorrrnrr8r8r9r9	s


zTarFile._handle_fatal_errorcCs�|�d�t|t�r |�|�}n|}|��s6|jtkrB|�||�S|��sR|�	�rzt|j
t�rhtd��q~|�
|�|��SndSdS)z�Extract a member from the archive as a file object. `member' may be
           a filename or a TarInfo object. If `member' is a regular file or a
           link, an io.BufferedReader object is returned. Otherwise, None is
           returned.
        rxz'cannot extract (sym)link as file objectN)r�r9r;r�rrri�
fileobjectrrr�r�r	�extractfile�_find_link_target)r�rr�r8r8r9rE	s


zTarFile.extractfilecCsT|�d�}|�dtj�}tj�|�}|r>tj�|�s>t�|�|��sN|�	�rh|�
dd|j|jf�n|�
d|j�|�
�r�|�||�n�|��r�|�||�nx|��r�|�||�nb|��s�|��r�|�||�nD|��s�|�	�r�|�||�n&|jtk�r|�||�n|�||�|�rP|�|||�|�	��sP|�||�|�||�dS)z\Extract the TarInfo object tarinfo to a physical
           file called targetpath.
        r�r#z%s -> %sN)rZr�r{r�r%rr��makedirsrrr�r�rr�makefiler�makedirr��makefifor�r��makedev�makelinkrri�makeunknownrrr)r�r��
targetpathr	rZ	upperdirsr8r8r9rd	s4


zTarFile._extract_membercCs@z&|jdkrt�|�nt�|d�Wntk
r:YnXdS)z,Make a directory called targetpath.
        Ni�)r�r{�mkdir�FileExistsError�r�r�r'r8r8r9r"�	s
zTarFile.makedirc	Cs�|j}|�|j�|j}t|d��b}|jdk	rn|jD]"\}}|�|�t|||t|�q4|�|j�|�	�nt|||jt|�W5QRXdS)z'Make a file called targetpath.
        r�N)
r�r�r�r�r�r�r[rr'�truncate)r�r�r'�sourcera�targetr�r'r8r8r9r!�	s


zTarFile.makefilecCs"|�||�|�dd|j�dS)zYMake a file from a TarInfo object with an unknown type
           at targetpath.
        r#z9tarfile: Unknown file type %r, extracted as regular file.N)r!r�rr*r8r8r9r&�	s�zTarFile.makeunknowncCs"ttd�rt�|�ntd��dS)z'Make a fifo called targetpath.
        �mkfifozfifo not supported by systemN)r�r{r.r
r*r8r8r9r#�	s
zTarFile.makefifocCsjttd�rttd�std��|j}|dkr.d}|��rB|tjO}n
|tjO}t�||t�	|j
|j��dS)z<Make a character or block device called targetpath.
        �mknodr$z'special devices not supported by systemNr�)r�r{r
r�r�r��S_IFBLK�S_IFCHRr/r$rr)r�r�r'r�r8r8r9r$�	s
�zTarFile.makedevcCs�zb|��r0tj�|�r t�|�t�|j|�n0tj�|j�rNt�	|j|�n|�
|�|�|�WnHtk
r�z|�
|�|�|�Wnt
k
r�td��YnXYnXdS)z�Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
        z%unable to resolve link inside archiveN)rr{r%�lexists�unlink�symlinkrr�r�linkrr�symlink_exceptionr�r
r*r8r8r9r%�	s"
��zTarFile.makelinkcCs�ttd�r�t��dkr�|j}|j}|s�ztrB|jrBt�|j�d}Wntk
rXYnXzt	rv|j
rvt	�|j
�d}Wntk
r�YnX|dkr�d}|dkr�d}z4|��r�ttd�r�t�
|||�nt�|||�Wntk
r�td��YnXdS)z�Set owner of targetpath according to tarinfo. If numeric_owner
           is True, use .gid/.uid instead of .gname/.uname. If numeric_owner
           is False, fall back to .gid/.uid when the search based on name
           fails.
        �geteuidrr$Nr;�lchownzcould not change owner)r�r{r7r*r)r�r,Zgetgrnamr�r�r+�getpwnamrr8rr�r
)r�r�r'r�g�ur8r8r9r�	s0

z
TarFile.chowncCsB|jdkrdSzt�||j�Wntk
r<td��YnXdS)zASet file permissions of targetpath according to tarinfo.
        Nzcould not change mode)r�r{rr�r
r*r8r8r9r
s
z
TarFile.chmodcCsV|j}|dkrdSttd�s dSzt�|||f�Wntk
rPtd��YnXdS)zBSet modification time of targetpath according to tarinfo.
        Nrz"could not change modification time)r(r�r{rr�r
)r�r�r'r(r8r8r9r
s
z
TarFile.utimec
Cs�|�d�|jdk	r$|j}d|_|S|j|j��krZ|j�|jd�|j�d�sZtd��d}z|j�	|�}W�q�t
k
r�}z6|jr�|�dd|j|f�|jt
7_WY�q^W5d}~XY�q�tk
�r6}zR|j�r|�dd|j|f�|jt
7_WY� q^n|jdk�r&tt|���W5d}~XYn�tk
�r^|jdk�rZtd��Ynjtk
�r�}z|jdk�r�tt|���W5d}~XYn0tk
�r�}ztt|���W5d}~XYnX�q�q^|dk	�r�|j�|�nd	|_|S)
z�Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        ZraNr#rYr$z0x%X: %srz
empty fileT)r�r�r�r�r�r�r]rr�rcrtr�r�r�rKr;rrrsrur�r�r�)r��mr�r�r8r8r9rm'
sJ



zTarFile.nextc	Cs�|��}d}|dk	rHz|�|�}Wntk
r:d}YnX|d|�}|rXtj�|�}t|�D]D}|rz|j|jkr`d}q`|r�tj�|j�}n|j}||kr`|Sq`|r�t|��dS)z}Find an archive member by name from bottom to top.
           If tarinfo is given, it is used as the starting point.
        FNT)	r��indexr0r{r%�normpath�reversedr�r�)	r�r�r��	normalizer�Zskippingr=r�member_namer8r8r9r�]
s,

zTarFile._getmembercCs|��}|dkrqqd|_dS)zWRead through the entire archive file and look for readable
           members.
        NT)rmr�r�r8r8r9r��
sz
TarFile._loadcCs:|jrtd|jj��|dk	r6|j|kr6td|j��dS)znCheck if TarFile is still open, and if the operation's mode
           corresponds to TarFile's mode.
        z%s is closedNzbad operation for mode %r)r�r�r�rnr�)r�r�r8r8r9r��
szTarFile._checkcCs`|��r.d�tdtj�|j�|jf��}d}n
|j}|}|j||dd�}|dkr\t	d|��|S)zZFind the target member of a symlink or hardlink member in the
           archive.
        r�NT)r�r@zlinkname %r not found)
rr�r�r{r%rr�rr�r�)r�r�r�limitrr8r8r9r�
s zTarFile._find_link_targetccs�|jr|jEdHdSd}|jdk	r:|��}|d7}|V|t|j�krT|j|}n"|jsr|��}|svd|_dSndS|d7}|Vq:dS)z$Provide an iterator object.
        Nrr#T)r�r�r�rmr2)r�r=r�r8r8r9�__iter__�
s$
zTarFile.__iter__cCs||jkrt|tjd�dS)z.Write debugging output to sys.stderr.
        �rN)r�rkri�stderr)r��level�msgr8r8r9r��
s
zTarFile._dbgcCs|��|Sr�)r�r�r8r8r9�	__enter__�
szTarFile.__enter__cCs,|dkr|��n|js"|j��d|_dSr�)r�r�r�r�)r�rr)�	tracebackr8r8r9�__exit__�
s


zTarFile.__exit__)
NrxNNNNNNr$NNNN)rxN)rxNr�)rxNr�)rxNN)NNN)T)NT)N)rN)r�T)TF)NF)N)>rnrorprqr�r�r�r�rrSrr6r7rr�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�rr�r�rrrrr
rrrrr"r!r&r#r$r%rrrrmr�r�r�rrCr�rHrJr8r8r8r9rBs��
oZ �


c&3
5�-�
�
1!
6
(

	cCs2zt|�}|��WdStk
r,YdSXdS)zfReturn True if name points to a tar archive that we
       are able to handle, else return False.
    TFN)rr�r)r�r�r8r8r9r�
sc	Csddl}d}|j|d�}|jdddddd	�|jd
dtdd
�|jdd�}|jddddd�|jdddddd�|jdddddd�|jdd dd!d�|��}|jr�|jdkr�|�d"d#�|j	dk	�r4|j	}t
|��rt|d$�� }|��t
|��tjd%�W5QRX|j�r0t
d&�|��n|�d"d'�|���n�|jdk	�r�|j}t
|��rxt�|d(��}|j|jd)�W5QRXn|�d"d'�|���nv|jdk	�rbt|j�d"k�r�|jd}tj}n,t|j�d*k�r�|j\}}n|�d"|���t
|��rNt�|d(��}|j||jd+�W5QRX|j�r`|d,k�r8d-�|�}	nd.�||�}	t
|	�n|�d"d'�|��n�|jdk	�r|j�d�}
tj�|
�\}}d/d/d0d0d1d1d1d1d2�}
||
k�r�d3|
|nd4}|j}t�|
|��}|D]}|�|��q�W5QRX|j�rt
d5�|
��dS)6Nrz3A simple command-line interface for tarfile module.)�descriptionz-vz	--verbose�
store_trueFzVerbose output)�action�default�helpz--filterz<filtername>zFilter for extraction)�metavar�choicesrOT)Zrequiredz-lz--list�	<tarfile>zShow listing of a tarfile)rPrOz-ez	--extract�+)rRz<output_dir>zExtract tarfile into target dir)�nargsrPrOz-cz--create)z<name>z<file>zCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr#z&--filter is only valid for extraction
rxrDz{!r} is a tar archive.z{!r} is not a tar archive.
r�)r�r$)r%r�rz{!r} file is extracted.z+{!r} file is extracted into {!r} directory.r�r�r�)r�z.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:ryz{!r} file created.)�argparse�ArgumentParser�add_argumentr�Zadd_mutually_exclusive_group�
parse_argsr�r�exitZtestrrr�rkrirEr�rSrrr2r{�curdirZformat_helprZcreate�popr%�splitextr�)rUrK�parserru�argsr_r�ZtfrZrGZtar_name�_ZextZcompressionsZtar_modeZ	tar_files�	file_namer8r8r9�main�
s���
�
�
�
�




�
�
ra�__main__)T)mrq�version�
__author__�__credits__�builtinsrr�rir{r�rZr�r�rVrrsr�r�r�r��AttributeError�NotImplementedErrorr6r��	NameError�__all__r�r�r3r�r�r2r-r/r.rCrrWr�r�rErFr!r�ZCONTTYPEr5r4rXr=r?rfr
rrrrir�r[r�rzr:rIr�r�r�getfilesystemencodingr:r?rNrTrXr[rl�	Exceptionrr
rrr	rrrrsrtrKrurvr��objectr�r��BufferedReaderr�r�r�r�r�r�r�r	r
rrr�rrrrrarnr8r8r8r9�<module>s<


�����
sh

?�u)_
runpy.cpython-38.opt-2.pyc000064400000014731151450073350011322 0ustar00U

e5d/�@sddlZddlZddlZddlZddlZddlZddlmZm	Z	ddgZ
Gdd�de�ZGdd�de�Z
dd	d
�Zd dd�Zefd
d�ZGdd�de�Zd!dd�Zd"dd�Zefdd�Zdd�Zd#dd�Zedk�r
eej�dk�r�edejd�nejd=eejd�dS)$�N)�	read_code�get_importer�
run_module�run_pathc@s$eZdZdd�Zdd�Zdd�ZdS)�_TempModulecCs||_t�|�|_g|_dS�N)�mod_name�types�
ModuleType�module�
_saved_module��selfr�r�/usr/lib64/python3.8/runpy.py�__init__sz_TempModule.__init__cCsB|j}z|j�tj|�Wntk
r0YnX|jtj|<|Sr)rr�append�sys�modules�KeyErrorrr
rrr�	__enter__ sz_TempModule.__enter__cGs.|jr|jdtj|j<n
tj|j=g|_dS�Nr)rrrr�r�argsrrr�__exit__)s
z_TempModule.__exit__N��__name__�
__module__�__qualname__rrrrrrrrs	rc@s$eZdZdd�Zdd�Zdd�ZdS)�_ModifiedArgv0cCs||_t�|_|_dSr)�value�object�_saved_value�	_sentinel)rr rrrr1sz_ModifiedArgv0.__init__cCs0|j|jk	rtd��tjd|_|jtjd<dS)NzAlready preserving saved valuer)r"r#�RuntimeErrorr�argvr )rrrrr5sz_ModifiedArgv0.__enter__cGs|j|_|jtjd<dSr)r#r r"rr%rrrrr;sz_ModifiedArgv0.__exit__Nrrrrrr0src
	Csn|dk	r|�|�|dkr(d}|}d}	n |j}|j}|j}	|dkrH|j}|j|||	d|||d�t||�|S)N)r�__file__�
__cached__�__doc__�
__loader__�__package__�__spec__)�update�loader�origin�cached�parent�exec)
�codeZrun_globals�init_globalsr�mod_spec�pkg_name�script_namer-�fnamer/rrr�	_run_code@s*
�
r8c	
Cs^|dkr|n|j}t|��6}t|��"|jj}t|||||||�W5QRXW5QRX|��Sr)r.rrr�__dict__r8�copy)	r2r3rr4r5r6r7�temp_module�mod_globalsrrr�_run_module_codeZs�r=c
Cs2|�d�r|d��|�d�\}}}|r�zt|�WnHtk
rz}z*|jdksh|j|krj|�|jd�sj�W5d}~XYnXtj�|�}|dk	r�t|d�s�ddl	m
}dj||d�}|t|��zt
j�|�}WnJttttfk
�r}	z"d}||�|t|	�j|	��|	�W5d}	~	XYnX|dk�r2|d	|��|jdk	�r�|d
k�sT|�d��r\|d��z|d}
t|
|�WS|k
�r�}z"|tjk�r��|d
||f��W5d}~XYnX|j}|dk�r�|d|��z|�|�}Wn2tk
�r}z|t|��|�W5d}~XYnX|dk�r(|d|��|||fS)N�.z#Relative module names not supported�__path__r)�warnz�{mod_name!r} found in sys.modules after import of package {pkg_name!r}, but prior to execution of {mod_name!r}; this may result in unpredictable behaviour)rr5z:Error while finding module specification for {!r} ({}: {})zNo module named %s�__main__z	.__main__z%Cannot use package as __main__ modulez3%s; %r is a package and cannot be directly executedz0%r is a namespace package and cannot be executedzNo code object available for %s)�
startswith�
rpartition�
__import__�ImportError�namerr�get�hasattr�warningsr@�format�RuntimeWarning�	importlib�util�	find_spec�AttributeError�	TypeError�
ValueError�typer�submodule_search_locations�endswith�_get_module_detailsr-�get_code)
r�errorr5�_�eZexistingr@�msg�specZexZ
pkg_main_namer-r2rrrrUhsd
��,
�
� 
rUc@seZdZdS)�_ErrorN)rrrrrrrr\�sr\Tc
Cs�z0|s|dkr t|t�\}}}ntt�\}}}Wn:tk
rj}zdtj|f}t�|�W5d}~XYnXtjdj}|r�|jtj	d<t
||dd|�S)NrAz%s: %sr)rUr\�_get_main_module_detailsr�
executable�exitrr9r.r%r8)rZ
alter_argvr4r2�excrZZmain_globalsrrr�_run_module_as_main�s�raFcCs@t|�\}}}|dkr|}|r,t||||�St|i|||�SdSr)rUr=r8)rr3�run_nameZ	alter_sysr4r2rrrr�sc
Cs�d}tj|}tj|=z\zt|�WW�NStk
rn}z*|t|�kr\|d|tjdf�|��W5d}~XYnXW5|tj|<XdS)NrAzcan't find %r module in %rr)rrrUrE�str�path)rWZ	main_nameZ
saved_mainr`rrrr]�s
��r]c	Csftj�t�|��}t�|��}t|�}W5QRX|dkr^t�|��}t|��|d�}W5QRX||fS)Nr1)	�osrd�abspath�fsdecode�io�	open_coder�compile�read)rbr7Zdecoded_path�fr2rrr�_get_code_from_file�srmcCs$|dkrd}|�d�d}t|�}d}t|�jdkrFt|�jdkrFd}t|td��sX|rxt||�\}}t|||||d�Stj	�
d|�znt
�\}}	}t|��P}
t|��<|
jj}t|||||	|���W5QR�W5QR�W�SQRXW5QRXW5ztj	�|�Wntk
�rYnXXdS)	Nz
<run_path>r>rFZimpZNullImporterT)r5r6)rCrrRrr�
isinstancermr=rrd�insert�removerQr]rrrr9r8r:)Z	path_namer3rbr5ZimporterZis_NullImporterr2r7rr4r;r<rrrr�s<
�
��8rA�z!No module specified for execution)�file)NNNNN)NNNNN)T)NNF)NN)r�importlib.machineryrL�importlib.utilrhr	reZpkgutilrr�__all__r!rrr8r=rErU�	Exceptionr\rarr]rmrr�lenr%�print�stderrrrrr�<module>
sL��
�
:
�

1
pathlib.cpython-38.opt-2.pyc000064400000105313151450073350011565 0ustar00U

e5d���@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe� �dd	�d
kr�ddlm!Z!q�dZdZ!ndZd
dddddgZ"ee
eefZ#dZ$dd�Z%dd�Z&Gdd�de'�Z(Gdd�de(�Z)Gdd�de(�Z*e)�Z+e*�Z,Gdd�d�Z-Gd d!�d!e-�Z.e.�Z/d"d#�Z0e1ed$��r�e�2�e0�Z0Gd%d&�d&�Z3Gd'd(�d(�Z4Gd)d*�d*e3�Z5Gd+d,�d,e3�Z6Gd-d.�d.e3�Z7Gd/d0�d0e	�Z8Gd1d
�d
e'�Z9ej:�;e9�Gd2d�de9�Z<Gd3d�de9�Z=Gd4d�de9�Z>Gd5d�de>e<�Z?Gd6d�de>e=�Z@dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF�ELOOP)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt�)�r)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPath)��{i�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r!�/usr/lib64/python3.8/pathlib.py�
_ignore_error.s�r#cCsd|kpd|kpd|kS)N�*�?�[r!)�patr!r!r"�_is_wildcard_pattern3sr(c@s$eZdZdd�Zdd�Zdd�ZdS)�_FlavourcCs|jj|_dS�N)�sep�join��selfr!r!r"�__init__=sz_Flavour.__init__cCsg}|j}|j}d}}t|�}|D]�}|s.q$|r>|�||�}|�|�\}}}	||	kr�t|	�|��D] }
|
rd|
dkrd|�t�|
��qdn|	r�|	dkr�|�t�|	��|s�|r$|s�|D]0}|s�q�|r�|�||�}|�|�d}|r�q�q�q�q$|s�|�r|�||�|�	�|||fS)N��.r)
r+�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r.�partsZparsedr+r2�drv�root�it�partZrel�xr!r!r"�parse_parts@s@
z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS�N�)�casefold)r.r<r=r;Zdrv2Zroot2Zparts2r!r!r"�join_parsed_partsfsz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__r/rArEr!r!r!r"r)9s&r)c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zdd�Zd&dd�Ze
fdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)'�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr!��.0�ir!r!r"�	<setcomp>�sz_WindowsFlavour.<setcomp>rC�
cCsh|]}d|�qS)zLPT%dr!rLr!r!r"rO�scCs\|dd�}|dd�}||krP||krP|�|�\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d�}|dkr�|�||d�}||dkr�|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r6||jk�r6|dd�}	|dd�}|}||k�rN|}
|�|�}||	|
|fS)NrrCrr0�����:)�_split_extended_path�find�len�
drive_letters�lstrip)r.r?r+�first�second�prefixZthird�indexZindex2r<r=r!r!r"r5�s6"

z_WindowsFlavour.splitrootcCs|��Sr*��lower�r.�sr!r!r"rD�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr!r])rM�pr!r!r"�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r!�r.r;r!r!r"�casefold_parts�sz_WindowsFlavour.casefold_partscCst�t�|�tj�jSr*)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch�r.�patternr!r!r"�compile_pattern�sz_WindowsFlavour.compile_patternFcCs�t|�}|st��Sd}tdk	r�|r2|�t|��Sg}z|�t|��}WnBtk
r�|}tj�|�\}}|�|�||kr�|YSYq6Xtjj	|ft
|���Sq6dSr*)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr6r7r,r3)r.rs�strictr`Z
previous_sZ
tail_parts�tailr!r!r"�resolve�s$
z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr0�zUNC\rQrJ)�
startswith)r.r`Z
ext_prefixr[r!r!r"rT�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dSrB)rTr_r!r!r"rq�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rRr1)rx�	partition�upper�reserved_namesrcr!r!r"�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|��dd��d�}d|t|�d��fSdt|���d��SdS)NrrCrSrKz
file:///%s/%szutf-8zfile:)�driverV�as_posixrX�urlquote_from_bytes�encode)r.rsr}�restr!r!r"�make_uri�s�z_WindowsFlavour.make_uricCs�dtjkrtjd}nJdtjkrXztjd}Wntk
rFd}YnX|tjd}ntd��|r�tjd|kr�|�|f�\}}}|dtjdkr�td|��||d<|s�|r�|||�|d	d��}n
|�|�}|S)
NZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr0zCan't determine home directoryZUSERNAMErR�%Can't determine home directory for %rrC)ro�environ�KeyError�RuntimeErrorrAr,)r.�username�userhomer<r=r;r!r!r"�
gethomedirs*


�
z_WindowsFlavour.gethomedirN)F)rFrGrHr+r2�has_drv�ntpath�pathmodro�name�is_supported�setrWZext_namespace_prefix�ranger{r5rDrdrmrvrTrqr|r�r�r!r!r!r"rIxs.

���'

rIc@sleZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
dd�Zdd
d�Zdd�Zdd�Zdd�ZdS)�
_PosixFlavourrKr0FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr0)rXrV)r.r?r+Z
stripped_partr!r!r"r5%s
z_PosixFlavour.splitrootcCs|Sr*r!r_r!r!r"rD4sz_PosixFlavour.casefoldcCs|Sr*r!rcr!r!r"rd7sz_PosixFlavour.casefold_partscCst�t�|��jSr*)rerfrgrhrjrkr!r!r"rm:sz_PosixFlavour.compile_patterncsJ|j�|j�i������fdd��|��r0dnt��}�|t|��pH�S)Ncs�|���rd}|���D]�}|r|dkr*q|dkrD|���\}}}q|���rX||}n|�|}|�kr��|}|dk	r~qtd|��z��|�}Wn6tk
r�}z|jtkr��r��|}W5d}~XYqXd�|<�||�}|�|<q|S)Nr0r1�..zSymlink loop from %r)	rxr6�
rpartition�endswithr��readlink�OSErrorrr)rsr�r��_�newpath�target�e��_resolveZaccessor�seenr+rtr!r"r�As4




z'_PosixFlavour.resolve.<locals>._resolver0)r+�	_accessor�is_absoluterorprn)r.rsrt�baser!r�r"rv=s)z_PosixFlavour.resolvecCsdS�NFr!rcr!r!r"r|msz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesr)r.rsZbpathr!r!r"r�psz_PosixFlavour.make_uricCs||s@ztjdWStk
r<ddl}|�t���jYSXn8ddl}z|�|�jWStk
rvtd|��YnXdS)N�HOMErr�)	ror�r��pwd�getpwuid�getuid�pw_dir�getpwnamr�)r.r�r�r!r!r"r�vs�z_PosixFlavour.gethomedirN)F)rFrGrHr+r2r��	posixpathr�ror�r�r5rDrdrmrvr|r�r�r!r!r!r"r�s

0r�c@seZdZdS)�	_AccessorN)rFrGrHr!r!r!r"r��sr�c@s�eZdZejZejZejZejZejZej	Z	e
ed�r>ejZndd�ZejZej
Z
e
ed�rdejZnedd��ZejZejZejZer�er�ejZq�dd�Zned	d��ZejZd
d�ZdS)
�_NormalAccessor�lchmodcCstd��dS)Nz%lchmod() not available on this system��NotImplementedError)r.Zpathobj�moder!r!r"r��sz_NormalAccessor.lchmod�linkcCstd��dS)Nz&os.link() not available on this systemr��r.r�r!r!r"�link_to�sz_NormalAccessor.link_tocCstd��dS)Nz&symlink() not available on this systemr���a�b�target_is_directoryr!r!r"�symlink�sz_NormalAccessor.symlinkcCst�||�Sr*)ror�r�r!r!r"r��scCs
t�|�Sr*)ror��r.rsr!r!r"r��sz_NormalAccessor.readlinkN)rFrGrHro�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlinkr�r��staticmethod�rmdir�renamer4r�supports_symlinksr��utimer�r!r!r!r"r��s4




r�cCsR|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}||||�S)NrrC�**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr(�_WildcardSelector�_PreciseSelector)�
pattern_parts�flavourr'�child_parts�clsr!r!r"�_make_selector�s
r��	lru_cachec@seZdZdd�Zdd�ZdS)�	_SelectorcCs0||_|rt||�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r.r�r�r!r!r"r/�sz_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�Sr*)�type�is_dir�existsr�r��iter�_select_from)r.�parent_pathZpath_clsr�r�r�r!r!r"�select_from�sz_Selector.select_fromN)rFrGrHr/r�r!r!r!r"r��s	r�c@seZdZdd�ZdS)r�ccs
|VdSr*r!)r.r�r�r�r�r!r!r"r��sz!_TerminatingSelector._select_fromN)rFrGrHr�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�|||�dSr*)r�r�r/)r.r�r�r�r!r!r"r/sz_PreciseSelector.__init__ccs\z@|�|j�}|jr|n||�r>|j�||||�D]
}|Vq2Wntk
rVYdSXdSr*)�_make_child_relpathr�r�r�r��PermissionError)r.r�r�r�r�rsrar!r!r"r�sz_PreciseSelector._select_fromN�rFrGrHr/r�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs|�|�|_t�|||�dSr*)rm�matchr�r/�r.r'r�r�r!r!r"r/sz_WildcardSelector.__init__ccs�z�||��}t|�}W5QRX|D]�}|jrrz|��s:Wq"Wn4tk
rp}zt|�sX�WY�q"W5d}~XYnX|j}	|�|	�r"|�|	�}
|j�	|
|||�D]
}|Vq�q"Wnt
k
r�YdSXdSr*)�listr�r�r�r#r�r�r�r�r�r�)r.r�r�r�r��
scandir_it�entries�entryr�r�rsrar!r!r"r�s&


z_WildcardSelector._select_fromNr�r!r!r!r"r�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�|||�dSr*)r�r/r�r!r!r"r//sz#_RecursiveWildcardSelector.__init__ccs�|Vz�||��}t|�}W5QRX|D]t}d}z|��}Wn,tk
rh}zt|�sX�W5d}~XYnX|r(|��s(|�|j�}	|�|	||�D]
}
|
Vq�q(Wntk
r�YdSXdSr�)	r�r�r�r#�
is_symlinkr�r��_iterate_directoriesr�)r.r�r�r�r�r�r�Zentry_is_dirr�rsrar!r!r"r�2s"
z/_RecursiveWildcardSelector._iterate_directoriesc	cs~zbt�}zL|jj}|�|||�D]0}|||||�D]}||kr2|V|�|�q2q W5|��XWntk
rxYdSXdSr*)r��clearr�r�r��addr�)	r.r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrar!r!r"r�Esz'_RecursiveWildcardSelector._select_fromN)rFrGrHr/r�r�r!r!r!r"r�-sr�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_PathParents)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dSr*)r�r�r�r�r�r�r!r!r"r/^s
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdSrB)r�r�rVr�r-r!r!r"�__len__esz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)NrrC)rV�
IndexErrorr��_from_parsed_partsr�r�r�)r.�idxr!r!r"�__getitem__ks
�z_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rFr-r!r!r"�__repr__qsz_PathParents.__repr__N)rFrGrH�	__slots__r/r�r�r�r!r!r!r"r�Ys
r�c@s�eZdZdZdd�Zdd�Zedd��ZedUd	d
��ZedVdd��Z	ed
d��Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zeed-�d.d/�Zeed0�d1d/�Zed2d3��Zed4d5��Zed6d7��Z ed8d9��Z!ed:d;��Z"d<d=�Z#d>d?�Z$d@dA�Z%edBdC��Z&dDdE�Z'dFdG�Z(dHdI�Z)edJdK��Z*edLdM��Z+dNdO�Z,dPdQ�Z-dRdS�Z.dTS)Wr)r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)Nr)rror�rr�_from_parts)r��argsr!r!r"�__new__�szPurePath.__new__cCs|jt|j�fSr*)�	__class__�tupler�r-r!r!r"�
__reduce__�szPurePath.__reduce__cCsdg}|D]N}t|t�r"||j7}qt�|�}t|t�rF|�t|��qtdt|���q|j	�
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�ro�fspathrnr7�	TypeErrorr��_flavourrA)r�r�r;r�r!r!r"�_parse_args�s


��zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|Sr*)�objectr�rr�r�r��_init)r�r��initr.r<r=r;r!r!r"r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|Sr*)rr�r�r�r�r)r�r<r=r;rr.r!r!r"r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdSrB)rr,)r�r<r=r;r!r!r"�_format_parsed_parts�szPurePath._format_parsed_partscCsdSr*r!r-r!r!r"r�szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�Sr*)rrrEr�r�r�r�)r.r�r<r=r;r!r!r"�_make_child�s�
zPurePath._make_childcCsBz|jWStk
r<|�|j|j|j�p.d|_|jYSXdS)Nr1)r��AttributeErrorr	r�r�r�r-r!r!r"�__str__�s��zPurePath.__str__cCst|�Sr*)rnr-r!r!r"�
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)NrK)rrnr4r+�r.�fr!r!r"r~�szPurePath.as_posixcCs
t�|�Sr*)ro�fsencoder-r!r!r"�	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rFr~r-r!r!r"r��szPurePath.__repr__cCs|��std��|j�|�S)Nz.relative path can't be expressed as a file URI)r�r�rr�r-r!r!r"�as_uri�szPurePath.as_uricCs8z|jWStk
r2|j�|j�|_|jYSXdSr*)r�rrrdr�r-r!r!r"�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkSr*)rr�NotImplementedrr�r.�otherr!r!r"�__eq__�s
zPurePath.__eq__cCs8z|jWStk
r2tt|j��|_|jYSXdSr*)r�r�hashr�rr-r!r!r"�__hash__�s
zPurePath.__hash__cCs&t|t�r|j|jk	rtS|j|jkSr*�rrrrrrr!r!r"�__lt__szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__le__	szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__gt__szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__ge__szPurePath.__ge__r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.cCs|j|j}|Sr*)r�r�)r.�anchorr!r!r"r szPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)NrCrr0rR)r�rVr�r�rcr!r!r"r�$sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)Nr1rrCr0�r��rfindrV�r.r�rNr!r!r"�suffix,s

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)Nr1cSsg|]}d|�qS)r1r!)rMr$r!r!r"rbEsz%PurePath.suffixes.<locals>.<listcomp>rC)r�r�rXr6�r.r�r!r!r"�suffixes:s


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)Nr1rrCr!r#r!r!r"�stemGs

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjfksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)N�%r has an empty namerRrCzInvalid name %r)r�r�rrAr+r2rVr�r�r�r�)r.r�r<r=r;r!r!r"�	with_nameQs��
��zPurePath.with_namecCs�|j}|j|ks |jr.|j|kr.td|f��|r<|�d�rD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|�|j	|j
|jdd�|g�S)NzInvalid suffix %rr1r(rR)rr+r2r�rxr�r$rVr�r�r�r�)r.r$rr�Z
old_suffixr!r!r"�with_suffix\s
�zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|�|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|s�|r�n||d|
��||	�kr�|�|||�}t	d�
t|�t|����|�d|
dkr�|nd||
d��S)Nzneed at least one argumentrCrz{!r} does not start with {!r}r0)
rr�r�r�rrVrrdr	r�r�rnr�)
r.rr;r<r=Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�n�cfZ	formattedr!r!r"�relative_toqs.	*�
�zPurePath.relative_tocCs4z|jWStk
r.t|j�|_|jYSXdSr*)r�rr�r�r-r!r!r"r;�s
zPurePath.partscGs
|�|�Sr*)r
)r.r�r!r!r"�joinpath�szPurePath.joinpathcCs,z|�|f�WStk
r&tYSXdSr*)r
rr�r.�keyr!r!r"�__truediv__�szPurePath.__truediv__cCs2z|�|g|j�WStk
r,tYSXdSr*)r�r�rrr/r!r!r"�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)NrCrR)r�r�r�rVr�)r.r<r=r;r!r!r"�parent�szPurePath.parentcCst|�Sr*)r�r-r!r!r"�parents�szPurePath.parentscCs|js
dS|jjpt|j�Sr�)r�rr��boolr�r-r!r!r"r��szPurePath.is_absolutecCs|j�|j�Sr*)rr|r�r-r!r!r"r|�szPurePath.is_reservedc	Cs�|jj}||�}|j�|f�\}}}|s0td��|rF|||j�krFdS|r\|||j�kr\dS|j}|sj|r�t|�t|�kr~dS|dd�}nt|�t|�kr�dStt	|�t	|��D]\}}t
�||�s�dSq�dS)Nz
empty patternFrCT)rrDrAr�r�r�rrV�zipr3rgZfnmatchcase)	r.Zpath_patternr,r<r=Z	pat_partsr;r?r'r!r!r"r��s(zPurePath.matchN)T)T)/rFrGrHr�r�r�classmethodrr�r�r	rr
rr
r~rr�r�propertyrrrrrrrrr}r=r r�r$r&r'r)r*r-r;r.r1r2r3r4r�r|r�r!r!r!r"rust	

	


��





	 

	
c@seZdZeZdZdS)rr!N)rFrGrH�_posix_flavourrr�r!r!r!r"r�sc@seZdZeZdZdS)rr!N)rFrGrH�_windows_flavourrr�r!r!r!r"r�sc@s�eZdZdZdd�Zdcdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dddd�Z
dedd�Zedd��Z
edd��Zdd�Zdd�Zdd�Zdd �Zd!d"�Zdfd$d%�Zd&d'�Zd(d)�Zd*d+�Zdgd.d/�Zd0d1�Zdhd2d3�Zd4d5�Zdid6d7�Zdjd9d:�Zdkd;d<�Zd=d>�Zd?d@�Z dldAdB�Z!dCdD�Z"dEdF�Z#dGdH�Z$dIdJ�Z%dmdKdL�Z&dMdN�Z'dOdP�Z(dQdR�Z)dSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/d_d`�Z0dadb�Z1dS)nr)r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF�rz$cannot instantiate %r on your system)rror�rrr�rr�r�rFr)r�r��kwargsr.r!r!r"r�s�zPath.__new__NcCs"d|_|dk	r|j|_nt|_dSr�)r;r��_normal_accessor)r.�templater!r!r"rs
z
Path._initcCs|j|g}|�|j|j|�Sr*)r�r�r�r�)r.r?r;r!r!r"r�#szPath._make_child_relpathcCs|jr|��|Sr*)r;�
_raise_closedr-r!r!r"�	__enter__)szPath.__enter__cCs
d|_dS)NT)r;)r.�t�v�tbr!r!r"�__exit__.sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�r-r!r!r"r@1szPath._raise_closed�cCs|j�|||�Sr*)r�r�)r.r��flagsr�r!r!r"�_opener4szPath._opener�cCs|jr|��|j�|||�Sr*)r;r@r�r�)r.rGr�r!r!r"�	_raw_open8szPath._raw_opencCs|t���Sr*)rorp�r�r!r!r"�cwdCszPath.cwdcCs||�j�d��Sr*)rr�rKr!r!r"�homeJsz	Path.homecCsB|��}z|��}Wntk
r2t�|�}YnXtj�||�Sr*)r�rrors�samestat)r.Z
other_path�stZother_str!r!r"�samefileQsz
Path.samefileccsH|jr|��|j�|�D](}|dkr(q|�|�V|jr|��qdS)N>r1r�)r;r@r�r�r�r%r!r!r"�iterdir\szPath.iterdirccs`|std�|���|j�|f�\}}}|s.|r6td��tt|�|j�}|�|�D]
}|VqPdS)NzUnacceptable pattern: {!r}�%Non-relative patterns are unsupported)r�r�rrAr�r�r�r��r.rlr<r=r�Zselectorrar!r!r"�globjsz	Path.globccsR|j�|f�\}}}|s|r$td��tdt|�|j�}|�|�D]
}|VqBdS)NrR)r�)rrAr�r�r�r�rSr!r!r"�rglobwsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)NFr<�r?)r;r@r�r�rorpr�r)r.�objr!r!r"�absolute�sz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)N)rtFr<rV)r;r@rrvr�rnrXr��normpathr�r)r.rtr`ZnormedrWr!r!r"rv�szPath.resolvecCs|j�|�Sr*)r�r�r-r!r!r"r��sz	Path.statcCsddl}|�|��j�jS�Nr)r�r�r��st_uidZpw_name)r.r�r!r!r"�owner�sz
Path.ownercCsddl}|�|��j�jSrZ)�grpZgetgrgidr��st_gidZgr_name)r.r]r!r!r"�group�sz
Path.group�rrRc	Cs(|jr|��tj|||||||jd�S)N)Zopener)r;r@�ior�rH)r.r��	buffering�encoding�errors�newliner!r!r"r��s
�z	Path.openc
Cs,|jdd��}|��W5QR�SQRXdS)N�rb�r��r��readrr!r!r"�
read_bytes�szPath.read_bytesc
Cs0|jd||d��}|��W5QR�SQRXdS)Nr`�r�rcrdrh)r.rcrdrr!r!r"�	read_text�szPath.read_textc
Cs6t|�}|jdd��}|�|�W5QR�SQRXdS)N�wbrg)�
memoryviewr��write)r.�dataZviewrr!r!r"�write_bytes�szPath.write_bytesc
CsLt|t�std|jj��|jd||d��}|�|�W5QR�SQRXdS)Nzdata must be str, not %s�wrk)rrnrr�rFr�ro)r.rprcrdrr!r!r"�
write_text�s
�zPath.write_textTcCsr|jr|��|r>z|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dSr*)r;r@r�r�r�ro�O_CREAT�O_WRONLY�O_EXCLrJ�close)r.r��exist_okrG�fdr!r!r"�touch�s
z
Path.touchcCs�|jr|��z|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)NT)r4rxF)r;r@r�r�rrr3r�r�)r.r�r4rxr!r!r"r�sz
Path.mkdircCs |jr|��|j�||�dSr*)r;r@r�r��r.r�r!r!r"r�sz
Path.chmodcCs |jr|��|j�||�dSr*)r;r@r�r�r{r!r!r"r�szPath.lchmodcCs>|jr|��z|j�|�Wntk
r8|s4�YnXdSr*)r;r@r�r�rr)r.Z
missing_okr!r!r"r�%szPath.unlinkcCs|jr|��|j�|�dSr*)r;r@r�r�r-r!r!r"r�2sz
Path.rmdircCs|jr|��|j�|�Sr*)r;r@r�r�r-r!r!r"r�:sz
Path.lstatcCs&|jr|��|j�||�|�|�Sr*)r;r@r�r�r�r�r!r!r"r�Cs
zPath.renamecCs&|jr|��|j�||�|�|�Sr*)r;r@r�r4r�r�r!r!r"r4Rs
zPath.replacecCs"|jr|��|j�|||�dSr*)r;r@r�r�)r.r�r�r!r!r"�
symlink_toaszPath.symlink_tocCs |jr|��|j�||�dSr*)r;r@r�r�r�r!r!r"r�js
zPath.link_toc
CsXz|��WnFtk
r>}zt|�s(�WY�dSd}~XYntk
rRYdSXdS�NFT)r�r�r#r��r.r�r!r!r"r�zszPath.existsc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)r	r��st_moder�r#r�r~r!r!r"r��szPath.is_dirc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�is_file�szPath.is_filecCsv|��r|��sdSt|j�}z|��j}Wntk
rBYdSX|��j}||krZdS|��j}|��j}||kSr})r�r�rr3r��st_devr��st_ino)r.r3Z
parent_devZdevZinoZ
parent_inor!r!r"�is_mount�s



z
Path.is_mountc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)r
r�rr�r#r�r~r!r!r"r��szPath.is_symlinkc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)r
r�rr�r#r�r~r!r!r"�is_block_device�szPath.is_block_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�is_char_device�szPath.is_char_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�is_fifo�szPath.is_fifoc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)NrrC�~)r�r�r�rr�r�)r.Zhomedirr!r!r"�
expandusers��zPath.expanduser)N)rF)rI)F)r`rRNNN)NN)NN)rFT)rIFF)F)F)2rFrGrHr�r�rr�rArEr@rHrJr7rLrMrPrQrTrUrXrvr�r\r_r�rjrlrqrsrzr�r�r�r�r�r�r�r4r|r�r�r�r�r�r�r�r�r�r�r�r!r!r!r"rsh	�







�

	



	

	
	c@seZdZdZdS)rr!N)rFrGrHr�r!r!r!r"rsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rr!cCstd��dS)Nz*Path.owner() is unsupported on this systemr�r-r!r!r"r\(szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this systemr�r-r!r!r"r_+szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this systemr�r-r!r!r"r�.szWindowsPath.is_mountN)rFrGrHr�r\r_r�r!r!r!r"r!s)Arg�	functoolsrar�ror�rer8�_collections_abcrrrrrrr�operatorrr�r	r
rrr
rrZurllib.parserrr�r�rZgetwindowsversionr�__all__rr r#r(rr)rIr�r:r9r�r�r>r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrr!r!r!r"�<module>s|$
�
?&i8
,t

difflib.cpython-38.opt-1.pyc000064400000164012151450073350011541 0ustar00U

e5dZH�@s8dZddddddddd	d
ddgZd
dlmZd
dlmZedd�Zdd�Z	Gdd�d�Z
d8dd�Zdd�ZGdd�d�Z
d
dlZe�d�jfdd�Zd9dd�Zdd �Zd:d#d	�Zd$d%�Zd;d&d�Zd'd(�Zd<d+d
�Zdefd,d�Zddefd-d.�Zd/Zd0Zd1Zd2ZGd3d�de�Z [d4d�Z!d5d6�Z"e#d7k�r4e"�dS)=ae
Module difflib -- helpers for computing deltas between objects.

Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
    Use SequenceMatcher to return list of the best "good enough" matches.

Function context_diff(a, b):
    For two lists of strings, return a delta in context diff format.

Function ndiff(a, b):
    Return a delta: the difference between `a` and `b` (lists of strings).

Function restore(delta, which):
    Return one of the two sequences that generated an ndiff delta.

Function unified_diff(a, b):
    For two lists of strings, return a delta in unified diff format.

Class SequenceMatcher:
    A flexible class for comparing pairs of sequences of any type.

Class Differ:
    For producing human-readable deltas from sequences of lines of text.

Class HtmlDiff:
    For producing HTML side by side comparison with change highlights.
�get_close_matches�ndiff�restore�SequenceMatcher�Differ�IS_CHARACTER_JUNK�IS_LINE_JUNK�context_diff�unified_diff�
diff_bytes�HtmlDiff�Match�)�nlargest)�
namedtupleza b sizecCs|rd||SdS)Ng@��?�)�matches�lengthrr�/usr/lib64/python3.8/difflib.py�_calculate_ratio&src@steZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS) ra�
    SequenceMatcher is a flexible class for comparing pairs of sequences of
    any type, so long as the sequence elements are hashable.  The basic
    algorithm predates, and is a little fancier than, an algorithm
    published in the late 1980's by Ratcliff and Obershelp under the
    hyperbolic name "gestalt pattern matching".  The basic idea is to find
    the longest contiguous matching subsequence that contains no "junk"
    elements (R-O doesn't address junk).  The same idea is then applied
    recursively to the pieces of the sequences to the left and to the right
    of the matching subsequence.  This does not yield minimal edit
    sequences, but does tend to yield matches that "look right" to people.

    SequenceMatcher tries to compute a "human-friendly diff" between two
    sequences.  Unlike e.g. UNIX(tm) diff, the fundamental notion is the
    longest *contiguous* & junk-free matching subsequence.  That's what
    catches peoples' eyes.  The Windows(tm) windiff has another interesting
    notion, pairing up elements that appear uniquely in each sequence.
    That, and the method here, appear to yield more intuitive difference
    reports than does diff.  This method appears to be the least vulnerable
    to synching up on blocks of "junk lines", though (like blank lines in
    ordinary text files, or maybe "<P>" lines in HTML files).  That may be
    because this is the only method of the 3 that has a *concept* of
    "junk" <wink>.

    Example, comparing two strings, and considering blanks to be "junk":

    >>> s = SequenceMatcher(lambda x: x == " ",
    ...                     "private Thread currentThread;",
    ...                     "private volatile Thread currentThread;")
    >>>

    .ratio() returns a float in [0, 1], measuring the "similarity" of the
    sequences.  As a rule of thumb, a .ratio() value over 0.6 means the
    sequences are close matches:

    >>> print(round(s.ratio(), 3))
    0.866
    >>>

    If you're only interested in where the sequences match,
    .get_matching_blocks() is handy:

    >>> for block in s.get_matching_blocks():
    ...     print("a[%d] and b[%d] match for %d elements" % block)
    a[0] and b[0] match for 8 elements
    a[8] and b[17] match for 21 elements
    a[29] and b[38] match for 0 elements

    Note that the last tuple returned by .get_matching_blocks() is always a
    dummy, (len(a), len(b), 0), and this is the only case in which the last
    tuple element (number of elements matched) is 0.

    If you want to know how to change the first sequence into the second,
    use .get_opcodes():

    >>> for opcode in s.get_opcodes():
    ...     print("%6s a[%d:%d] b[%d:%d]" % opcode)
     equal a[0:8] b[0:8]
    insert a[8:8] b[8:17]
     equal a[8:29] b[17:38]

    See the Differ class for a fancy human-friendly file differencer, which
    uses SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    See also function get_close_matches() in this module, which shows how
    simple code building on SequenceMatcher can be used to do useful work.

    Timing:  Basic R-O is cubic time worst case and quadratic time expected
    case.  SequenceMatcher is quadratic time for the worst case and has
    expected-case behavior dependent in a complicated way on how many
    elements the sequences have in common; best case time is linear.

    Methods:

    __init__(isjunk=None, a='', b='')
        Construct a SequenceMatcher.

    set_seqs(a, b)
        Set the two sequences to be compared.

    set_seq1(a)
        Set the first sequence to be compared.

    set_seq2(b)
        Set the second sequence to be compared.

    find_longest_match(alo, ahi, blo, bhi)
        Find longest matching block in a[alo:ahi] and b[blo:bhi].

    get_matching_blocks()
        Return list of triples describing matching subsequences.

    get_opcodes()
        Return list of 5-tuples describing how to turn a into b.

    ratio()
        Return a measure of the sequences' similarity (float in [0,1]).

    quick_ratio()
        Return an upper bound on .ratio() relatively quickly.

    real_quick_ratio()
        Return an upper bound on ratio() very quickly.
    N�TcCs(||_d|_|_||_|�||�dS)a!Construct a SequenceMatcher.

        Optional arg isjunk is None (the default), or a one-argument
        function that takes a sequence element and returns true iff the
        element is junk.  None is equivalent to passing "lambda x: 0", i.e.
        no elements are considered to be junk.  For example, pass
            lambda x: x in " \t"
        if you're comparing lines as sequences of characters, and don't
        want to synch up on blanks or hard tabs.

        Optional arg a is the first of two sequences to be compared.  By
        default, an empty string.  The elements of a must be hashable.  See
        also .set_seqs() and .set_seq1().

        Optional arg b is the second of two sequences to be compared.  By
        default, an empty string.  The elements of b must be hashable. See
        also .set_seqs() and .set_seq2().

        Optional arg autojunk should be set to False to disable the
        "automatic junk heuristic" that treats popular elements as junk
        (see module documentation for more information).
        N)�isjunk�a�b�autojunk�set_seqs)�selfrrrrrrr�__init__�s;zSequenceMatcher.__init__cCs|�|�|�|�dS)z�Set the two sequences to be compared.

        >>> s = SequenceMatcher()
        >>> s.set_seqs("abcd", "bcde")
        >>> s.ratio()
        0.75
        N)�set_seq1�set_seq2)rrrrrrr�s	
zSequenceMatcher.set_seqscCs$||jkrdS||_d|_|_dS)aMSet the first sequence to be compared.

        The second sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq1("bcde")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq2().
        N)r�matching_blocks�opcodes)rrrrrr�s
zSequenceMatcher.set_seq1cCs2||jkrdS||_d|_|_d|_|��dS)aMSet the second sequence to be compared.

        The first sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq2("abcd")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq1().
        N)rr r!�
fullbcount�_SequenceMatcher__chain_b)rrrrrr�s
zSequenceMatcher.set_seq2cCs�|j}i|_}t|�D]\}}|�|g�}|�|�qt�|_}|j}|r~|��D]}||�rV|�	|�qV|D]
}||=qrt�|_
}t|�}	|jr�|	dkr�|	dd}
|�
�D]\}}t|�|
kr�|�	|�q�|D]
}||=q�dS)N���d�)r�b2j�	enumerate�
setdefault�append�set�bjunkr�keys�addZbpopular�lenr�items)rrr'�i�elt�indicesZjunkrZpopular�nZntestZidxsrrrZ	__chain_b)s,
zSequenceMatcher.__chain_bcCs4|j|j|j|jjf\}}}}||d}	}
}i}g}
t||�D]�}|j}i}|�|||
�D]\}||krlq^||krxq�||dd�d}||<||kr^||d||d|}	}
}q^|}q@|	|k�r |
|k�r |||
d��s ||	d||
dk�r |	d|
d|d}	}
}q�|	||k�rt|
||k�rt|||
|��st||	|||
|k�rt|d7}�q |	|k�r�|
|k�r�|||
d��r�||	d||
dk�r�|	d|
d|d}	}
}�qt|	||k�r(|
||k�r(|||
|��r(||	|||
|k�r(|d}�q�t|	|
|�S)a�Find longest matching block in a[alo:ahi] and b[blo:bhi].

        If isjunk is not defined:

        Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
            alo <= i <= i+k <= ahi
            blo <= j <= j+k <= bhi
        and for all (i',j',k') meeting those conditions,
            k >= k'
            i <= i'
            and if i == i', j <= j'

        In other words, of all maximal matching blocks, return one that
        starts earliest in a, and of all those maximal matching blocks that
        start earliest in a, return the one that starts earliest in b.

        >>> s = SequenceMatcher(None, " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=0, b=4, size=5)

        If isjunk is defined, first the longest matching block is
        determined as above, but with the additional restriction that no
        junk element appears in the block.  Then that block is extended as
        far as possible by matching (only) junk elements on both sides.  So
        the resulting block never matches on junk except as identical junk
        happens to be adjacent to an "interesting" match.

        Here's the same example as before, but considering blanks to be
        junk.  That prevents " abcd" from matching the " abcd" at the tail
        end of the second sequence directly.  Instead only the "abcd" can
        match, and matches the leftmost "abcd" in the second sequence:

        >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=1, b=0, size=4)

        If no blocks match, return (alo, blo, 0).

        >>> s = SequenceMatcher(None, "ab", "c")
        >>> s.find_longest_match(0, 2, 0, 1)
        Match(a=0, b=0, size=0)
        r
r&)rrr'r,�__contains__�range�getr)r�alo�ahi�blo�bhirrr'ZisbjunkZbestiZbestjZbestsizeZj2lenZnothingr1Zj2lengetZnewj2len�j�krrr�find_longest_matchPsR8"����	�� ��z"SequenceMatcher.find_longest_matchcCs||jdk	r|jSt|j�t|j�}}d|d|fg}g}|r�|��\}}}}|�||||�\}	}
}}|r8|�|�||	kr�||
kr�|�||	||
f�|	||kr8|
||kr8|�|	|||
||f�q8|��d}
}}g}|D]V\}}}|
||k�r|||k�r||7}q�|�r,|�|
||f�|||}
}}q�|�rT|�|
||f�|�||df�tt	t
j|��|_|jS)aReturn list of triples describing matching subsequences.

        Each triple is of the form (i, j, n), and means that
        a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in
        i and in j.  New in Python 2.5, it's also guaranteed that if
        (i, j, n) and (i', j', n') are adjacent triples in the list, and
        the second is not the last triple in the list, then i+n != i' or
        j+n != j'.  IOW, adjacent triples never describe adjacent equal
        blocks.

        The last triple is a dummy, (len(a), len(b), 0), and is the only
        triple with n==0.

        >>> s = SequenceMatcher(None, "abxcd", "abcd")
        >>> list(s.get_matching_blocks())
        [Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
        Nr
)r r/rr�popr>r*�sort�list�mapr�_make)r�la�lbZqueuer r8r9r:r;r1r<r=�x�i1�j1Zk1Znon_adjacent�i2�j2Zk2rrr�get_matching_blocks�s8


z#SequenceMatcher.get_matching_blockscCs�|jdk	r|jSd}}g|_}|��D]�\}}}d}||krN||krNd}n||kr\d}n||krhd}|r�|�|||||f�||||}}|r*|�d||||f�q*|S)a[Return list of 5-tuples describing how to turn a into b.

        Each tuple is of the form (tag, i1, i2, j1, j2).  The first tuple
        has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
        tuple preceding it, and likewise for j1 == the previous j2.

        The tags are strings, with these meanings:

        'replace':  a[i1:i2] should be replaced by b[j1:j2]
        'delete':   a[i1:i2] should be deleted.
                    Note that j1==j2 in this case.
        'insert':   b[j1:j2] should be inserted at a[i1:i1].
                    Note that i1==i2 in this case.
        'equal':    a[i1:i2] == b[j1:j2]

        >>> a = "qabxcd"
        >>> b = "abycdf"
        >>> s = SequenceMatcher(None, a, b)
        >>> for tag, i1, i2, j1, j2 in s.get_opcodes():
        ...    print(("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
        ...           (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2])))
         delete a[0:1] (q) b[0:0] ()
          equal a[1:3] (ab) b[0:2] (ab)
        replace a[3:4] (x) b[2:3] (y)
          equal a[4:6] (cd) b[3:5] (cd)
         insert a[6:6] () b[5:6] (f)
        Nr
r�replace�delete�insert�equal)r!rKr*)rr1r<Zanswer�ai�bj�size�tagrrr�get_opcodess$

zSequenceMatcher.get_opcodes�c
csn|��}|sdg}|dddkrZ|d\}}}}}|t|||�|t|||�|f|d<|dddkr�|d\}}}}}||t|||�|t|||�f|d<||}g}	|D]�\}}}}}|dk�r(|||k�r(|	�||t|||�|t|||�f�|	Vg}	t|||�t|||�}}|	�|||||f�q�|	�rjt|	�dk�rd|	dddk�sj|	VdS)a� Isolate change clusters by eliminating ranges with no changes.

        Return a generator of groups with up to n lines of context.
        Each group is in the same format as returned by get_opcodes().

        >>> from pprint import pprint
        >>> a = list(map(str, range(1,40)))
        >>> b = a[:]
        >>> b[8:8] = ['i']     # Make an insertion
        >>> b[20] += 'x'       # Make a replacement
        >>> b[23:28] = []      # Make a deletion
        >>> b[30] += 'y'       # Make another replacement
        >>> pprint(list(SequenceMatcher(None,a,b).get_grouped_opcodes()))
        [[('equal', 5, 8, 5, 8), ('insert', 8, 8, 8, 9), ('equal', 8, 11, 9, 12)],
         [('equal', 16, 19, 17, 20),
          ('replace', 19, 20, 20, 21),
          ('equal', 20, 22, 21, 23),
          ('delete', 22, 27, 23, 23),
          ('equal', 27, 30, 23, 26)],
         [('equal', 31, 34, 27, 30),
          ('replace', 34, 35, 30, 31),
          ('equal', 35, 38, 31, 34)]]
        )rOr
r&r
r&r
rO���r&N)rT�max�minr*r/)
rr4ZcodesrSrGrIrHrJZnn�grouprrr�get_grouped_opcodes<s(&&(&z#SequenceMatcher.get_grouped_opcodescCs0tdd�|��D��}t|t|j�t|j��S)a�Return a measure of the sequences' similarity (float in [0,1]).

        Where T is the total number of elements in both sequences, and
        M is the number of matches, this is 2.0*M / T.
        Note that this is 1 if the sequences are identical, and 0 if
        they have nothing in common.

        .ratio() is expensive to compute if you haven't already computed
        .get_matching_blocks() or .get_opcodes(), in which case you may
        want to try .quick_ratio() or .real_quick_ratio() first to get an
        upper bound.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.quick_ratio()
        0.75
        >>> s.real_quick_ratio()
        1.0
        css|]}|dVqdS)rVNr)�.0Ztriplerrr�	<genexpr>�sz(SequenceMatcher.ratio.<locals>.<genexpr>)�sumrKrr/rr)rrrrr�rationszSequenceMatcher.ratiocCs�|jdkr4i|_}|jD]}|�|d�d||<q|j}i}|jd}}|jD]>}||�rf||}n|�|d�}|d||<|dkrP|d}qPt|t|j�t|j��S)z�Return an upper bound on ratio() relatively quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute.
        Nr
r&)r"rr7r5rrr/)rr"r2ZavailZavailhasrZnumbrrr�quick_ratio�s






zSequenceMatcher.quick_ratiocCs*t|j�t|j�}}tt||�||�S)z�Return an upper bound on ratio() very quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute than either .ratio() or .quick_ratio().
        )r/rrrrX)rrDrErrr�real_quick_ratio�sz SequenceMatcher.real_quick_ratio)NrrT)rU)�__name__�
__module__�__qualname__�__doc__rrrrr#r>rKrTrZr^r_r`rrrrr+sj
@,'nG7
2rU�333333�?cCs�|dkstd|f��d|kr*dks:ntd|f��g}t�}|�|�|D]D}|�|�|��|krR|��|krR|��|krR|�|��|f�qRt||�}dd�|D�S)a�Use SequenceMatcher to return list of the best "good enough" matches.

    word is a sequence for which close matches are desired (typically a
    string).

    possibilities is a list of sequences against which to match word
    (typically a list of strings).

    Optional arg n (default 3) is the maximum number of close matches to
    return.  n must be > 0.

    Optional arg cutoff (default 0.6) is a float in [0, 1].  Possibilities
    that don't score at least that similar to word are ignored.

    The best (no more than n) matches among the possibilities are returned
    in a list, sorted by similarity score, most similar first.

    >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
    ['apple', 'ape']
    >>> import keyword as _keyword
    >>> get_close_matches("wheel", _keyword.kwlist)
    ['while']
    >>> get_close_matches("Apple", _keyword.kwlist)
    []
    >>> get_close_matches("accept", _keyword.kwlist)
    ['except']
    r
zn must be > 0: %rgrz cutoff must be in [0.0, 1.0]: %rcSsg|]\}}|�qSrr)r[ZscorerFrrr�
<listcomp>�sz%get_close_matches.<locals>.<listcomp>)	�
ValueErrorrrrr`r_r^r*�	_nlargest)ZwordZ
possibilitiesr4�cutoff�result�srFrrrr�s"


�
�
cCsd�dd�t||�D��S)zAReplace whitespace with the original whitespace characters in `s`rcss*|]"\}}|dkr|��r|n|VqdS)� N)�isspace)r[�cZtag_crrrr\�s�z$_keep_original_ws.<locals>.<genexpr>)�join�zip)rkZtag_srrr�_keep_original_ws�s
�rqc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra�

    Differ is a class for comparing sequences of lines of text, and
    producing human-readable differences or deltas.  Differ uses
    SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    Each line of a Differ delta begins with a two-letter code:

        '- '    line unique to sequence 1
        '+ '    line unique to sequence 2
        '  '    line common to both sequences
        '? '    line not present in either input sequence

    Lines beginning with '? ' attempt to guide the eye to intraline
    differences, and were not present in either input sequence.  These lines
    can be confusing if the sequences contain tab characters.

    Note that Differ makes no claim to produce a *minimal* diff.  To the
    contrary, minimal diffs are often counter-intuitive, because they synch
    up anywhere possible, sometimes accidental matches 100 pages apart.
    Restricting synch points to contiguous matches preserves some notion of
    locality, at the occasional cost of producing a longer diff.

    Example: Comparing two texts.

    First we set up the texts, sequences of individual single-line strings
    ending with newlines (such sequences can also be obtained from the
    `readlines()` method of file-like objects):

    >>> text1 = '''  1. Beautiful is better than ugly.
    ...   2. Explicit is better than implicit.
    ...   3. Simple is better than complex.
    ...   4. Complex is better than complicated.
    ... '''.splitlines(keepends=True)
    >>> len(text1)
    4
    >>> text1[0][-1]
    '\n'
    >>> text2 = '''  1. Beautiful is better than ugly.
    ...   3.   Simple is better than complex.
    ...   4. Complicated is better than complex.
    ...   5. Flat is better than nested.
    ... '''.splitlines(keepends=True)

    Next we instantiate a Differ object:

    >>> d = Differ()

    Note that when instantiating a Differ object we may pass functions to
    filter out line and character 'junk'.  See Differ.__init__ for details.

    Finally, we compare the two:

    >>> result = list(d.compare(text1, text2))

    'result' is a list of strings, so let's pretty-print it:

    >>> from pprint import pprint as _pprint
    >>> _pprint(result)
    ['    1. Beautiful is better than ugly.\n',
     '-   2. Explicit is better than implicit.\n',
     '-   3. Simple is better than complex.\n',
     '+   3.   Simple is better than complex.\n',
     '?     ++\n',
     '-   4. Complex is better than complicated.\n',
     '?            ^                     ---- ^\n',
     '+   4. Complicated is better than complex.\n',
     '?           ++++ ^                      ^\n',
     '+   5. Flat is better than nested.\n']

    As a single multi-line string it looks like this:

    >>> print(''.join(result), end="")
        1. Beautiful is better than ugly.
    -   2. Explicit is better than implicit.
    -   3. Simple is better than complex.
    +   3.   Simple is better than complex.
    ?     ++
    -   4. Complex is better than complicated.
    ?            ^                     ---- ^
    +   4. Complicated is better than complex.
    ?           ++++ ^                      ^
    +   5. Flat is better than nested.

    Methods:

    __init__(linejunk=None, charjunk=None)
        Construct a text differencer, with optional filters.

    compare(a, b)
        Compare two sequences of lines; generate the resulting delta.
    NcCs||_||_dS)a�
        Construct a text differencer, with optional filters.

        The two optional keyword parameters are for filter functions:

        - `linejunk`: A function that should accept a single string argument,
          and return true iff the string is junk. The module-level function
          `IS_LINE_JUNK` may be used to filter out lines without visible
          characters, except for at most one splat ('#').  It is recommended
          to leave linejunk None; the underlying SequenceMatcher class has
          an adaptive notion of "noise" lines that's better than any static
          definition the author has ever been able to craft.

        - `charjunk`: A function that should accept a string of length 1. The
          module-level function `IS_CHARACTER_JUNK` may be used to filter out
          whitespace characters (a blank or tab; **note**: bad idea to include
          newline in this!).  Use of IS_CHARACTER_JUNK is recommended.
        N��linejunk�charjunk)rrsrtrrrrHszDiffer.__init__c
	cs�t|j||�}|��D]�\}}}}}|dkrB|�||||||�}	n\|dkr\|�d|||�}	nB|dkrv|�d|||�}	n(|dkr�|�d|||�}	ntd|f��|	Ed	Hqd	S)
a�
        Compare two sequences of lines; generate the resulting delta.

        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.

        Example:

        >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(True),
        ...                                'ore\ntree\nemu\n'.splitlines(True))),
        ...       end="")
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu
        rLrM�-rN�+rOrl�unknown tag %rN)rrsrT�_fancy_replace�_dumprg)
rrr�cruncherrSr8r9r:r;�grrr�compare_szDiffer.compareccs&t||�D]}d|||fVq
dS)z4Generate comparison results for a same-tagged range.z%s %sN)r6)rrSrF�lo�hir1rrrry�szDiffer._dumpc
csn||||kr2|�d|||�}|�d|||�}n |�d|||�}|�d|||�}||fD]}	|	EdHqZdS)Nrvru)ry)
rrr8r9rr:r;�first�secondr{rrr�_plain_replace�szDiffer._plain_replaceccs:d\}}t|j�}	d\}
}t||�D]�}||}
|	�|
�t||�D]j}||}||
krl|
dkrD||}
}qD|	�|�|	��|krD|	��|krD|	��|krD|	��||}}}qDq$||kr�|
dkr�|�||||||�EdHdS|
|d}}}nd}
|�	||||||�EdH||||}}|
dk�r
d}}|	�
||�|	��D]�\}}}}}||||}}|dk�r�|d|7}|d|7}nb|dk�r�|d	|7}nJ|d
k�r�|d|7}n2|dk�r�|d
|7}|d
|7}ntd|f���qH|�
||||�EdHn
d|V|�	||d|||d|�EdHdS)aL
        When replacing one block of lines with another, search the blocks
        for *similar* lines; the best-matching pair (if any) is used as a
        synch point, and intraline difference marking is done on the
        similar pair. Lots of work, but often worth it.

        Example:

        >>> d = Differ()
        >>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,
        ...                            ['abcdefGhijkl\n'], 0, 1)
        >>> print(''.join(results), end="")
        - abcDefghiJkl
        ?    ^  ^  ^
        + abcdefGhijkl
        ?    ^  ^  ^
        )g�G�z��?g�?)NNNrrrL�^rMrurNrvrOrlrw�  r&)rrtr6rrr`r_r^r��
_fancy_helperrrTrg�_qformat)rrr8r9rr:r;Z
best_ratiorirzZeqiZeqjr<rQr1rPZbest_iZbest_jZaeltZbelt�atags�btagsrSZai1Zai2Zbj1Zbj2rDrErrrrx�s\




�
�





zDiffer._fancy_replaceccsbg}||kr<||kr*|�||||||�}qT|�d|||�}n||krT|�d|||�}|EdHdS)Nrurv)rxry)rrr8r9rr:r;r{rrrr��szDiffer._fancy_helperccsXt||���}t||���}d|V|r8d|�d�Vd|V|rTd|�d�VdS)a�
        Format "?" output and deal with tabs.

        Example:

        >>> d = Differ()
        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print(repr(line))
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'
        �- z? �
�+ N)rq�rstrip)rZalineZbliner�r�rrrr�s

zDiffer._qformat)NN)rarbrcrdrr|ryr�rxr�r�rrrrr�s]
)^Nz
\s*(?:#\s*)?$cCs||�dk	S)z�
    Return True for ignorable line: iff `line` is blank or contains a single '#'.

    Examples:

    >>> IS_LINE_JUNK('\n')
    True
    >>> IS_LINE_JUNK('  #   \n')
    True
    >>> IS_LINE_JUNK('hello\n')
    False
    Nr)�lineZpatrrrr3s� 	cCs||kS)z�
    Return True for ignorable character: iff `ch` is a space or tab.

    Examples:

    >>> IS_CHARACTER_JUNK(' ')
    True
    >>> IS_CHARACTER_JUNK('\t')
    True
    >>> IS_CHARACTER_JUNK('\n')
    False
    >>> IS_CHARACTER_JUNK('x')
    False
    r)ZchZwsrrrrCscCs:|d}||}|dkr"d�|�S|s.|d8}d�||�S�z Convert range to the "ed" formatr&z{}z{},{}��format��start�stopZ	beginningrrrr�_format_range_unifiedZs
r�rr�ccsPt|||||||�d}td||��|�D�]}	|s|d}|rFd�|�nd}
|rXd�|�nd}d�||
|�Vd�|||�V|	d|	d	}}
t|d
|
d�}t|d|
d
�}d�|||�V|	D]�\}}}}}|dkr�|||�D]}d|Vq�q�|dk�r"|||�D]}d|V�q|dkr�|||�D]}d|V�q6q�q*dS)a�
    Compare two sequences of lines; generate the delta as a unified diff.

    Unified diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with ---, +++, or @@) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The unidiff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for
    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.

    Example:

    >>> for line in unified_diff('one two three four'.split(),
    ...             'zero one tree four'.split(), 'Original', 'Current',
    ...             '2005-01-26 23:30:50', '2010-04-02 10:20:52',
    ...             lineterm=''):
    ...     print(line)                 # doctest: +NORMALIZE_WHITESPACE
    --- Original        2005-01-26 23:30:50
    +++ Current         2010-04-02 10:20:52
    @@ -1,4 +1,4 @@
    +zero
     one
    -two
    -three
    +tree
     four
    FNT�	{}r�
--- {}{}{}z
+++ {}{}{}r
rVr&�rU�z@@ -{} +{} @@{}rOrl>rMrLru>rLrNrv)�_check_typesrrZr�r�)rr�fromfile�tofile�fromfiledate�
tofiledater4�lineterm�startedrY�fromdate�todater�last�file1_range�file2_rangerSrGrIrHrJr�rrrr	es0)
cCsB|d}||}|s|d8}|dkr.d�|�Sd�|||d�Sr�r�r�rrr�_format_range_context�s
r�ccs�t|||||||�tddddd�}d}	td||��|�D�]R}
|	s�d}	|rVd	�|�nd
}|rhd	�|�nd
}d�|||�Vd�|||�V|
d
|
d}
}d|Vt|
d|d�}d�||�Vtdd�|
D���r|
D]8\}}}}}|dkr�|||�D]}|||V�qq�t|
d|d�}d�||�Vtdd�|
D��r:|
D]<\}}}}}|dk�rP|||�D]}|||V�qt�qPq:dS)ah
    Compare two sequences of lines; generate the delta as a context diff.

    Context diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with *** or ---) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The context diff format normally has a header for filenames and
    modification times.  Any or all of these may be specified using
    strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.
    If not specified, the strings default to blanks.

    Example:

    >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True),
    ...       'zero\none\ntree\nfour\n'.splitlines(True), 'Original', 'Current')),
    ...       end="")
    *** Original
    --- Current
    ***************
    *** 1,4 ****
      one
    ! two
    ! three
      four
    --- 1,4 ----
    + zero
      one
    ! tree
      four
    r�r�z! r�)rNrMrLrOFNTr�rz
*** {}{}{}r�r
rVz***************r&r�z
*** {} ****{}css |]\}}}}}|dkVqdS)>rMrLNr�r[rS�_rrrr\�szcontext_diff.<locals>.<genexpr>rNrUr�z
--- {} ----{}css |]\}}}}}|dkVqdS)>rLrNNrr�rrrr\srM)r��dictrrZr�r��any)rrr�r�r�r�r4r��prefixr�rYr�r�rr�r�rSrGrIr�r�r�rHrJrrrr�s4,

cGs�|r0t|dt�s0tdt|d�j|df��|r`t|dt�s`tdt|d�j|df��|D]}t|t�sdtd|f��qddS)Nr
z)lines to compare must be str, not %s (%r)z"all arguments must be str, not: %r)�
isinstance�str�	TypeError�typera)rr�args�argrrrr�s��
r���
c		cs~dd�}	tt|	|��}tt|	|��}|	|�}|	|�}|	|�}|	|�}|	|�}|||||||||�}
|
D]}|�dd�VqfdS)a�
    Compare `a` and `b`, two sequences of lines represented as bytes rather
    than str. This is a wrapper for `dfunc`, which is typically either
    unified_diff() or context_diff(). Inputs are losslessly converted to
    strings so that `dfunc` only has to worry about strings, and encoded
    back to bytes on return. This is necessary to compare files with
    unknown or inconsistent encoding. All other inputs (except `n`) must be
    bytes rather than str.
    c
SsRz|�dd�WStk
rL}z dt|�j|f}t|�|�W5d}~XYnXdS)N�ascii�surrogateescapez(all arguments must be bytes, not %s (%r))�decode�AttributeErrorr�rar�)rk�err�msgrrrr�"s�zdiff_bytes.<locals>.decoder�r�N)rArB�encode)Zdfuncrrr�r�r�r�r4r�r��linesr�rrrr
scCst||��||�S)aJ
    Compare `a` and `b` (lists of strings); return a `Differ`-style delta.

    Optional keyword parameters `linejunk` and `charjunk` are for filter
    functions, or can be None:

    - linejunk: A function that should accept a single string argument and
      return true iff the string is junk.  The default is None, and is
      recommended; the underlying SequenceMatcher class has an adaptive
      notion of "noise" lines.

    - charjunk: A function that accepts a character (string of length
      1), and returns true iff the character is junk. The default is
      the module-level function IS_CHARACTER_JUNK, which filters out
      whitespace characters (a blank or tab; note: it's a bad idea to
      include newline in this!).

    Tools/scripts/ndiff.py is a command-line front-end to this function.

    Example:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> print(''.join(diff), end="")
    - one
    ?  ^
    + ore
    ?  ^
    - two
    - three
    ?  -
    + tree
    + emu
    )rr|)rrrsrtrrrr5s#c#s�ddl}|�d��t||||��ddgf�fdd�	���fdd���fdd	�}|�}|dkrj|EdH�n|d
7}d}ddg|}	}
d}|dkr�zt|�\}}
}Wntk
r�YdSX|	|}||
|f|
|<|	d
7}	q�|	|kr�dV|}n|	}d}	|�r"|	|}|	d
7}	|
|V|d
8}q�|d
}z@|�rht|�\}}
}|�rP|d
}n|d
8}||
|fV�q,Wqvtk
�r�YdSXqvdS)
a�Returns generator yielding marked up from/to side by side differences.

    Arguments:
    fromlines -- list of text lines to compared to tolines
    tolines -- list of text lines to be compared to fromlines
    context -- number of context lines to display on each side of difference,
               if None, all from/to text lines will be generated.
    linejunk -- passed on to ndiff (see ndiff documentation)
    charjunk -- passed on to ndiff (see ndiff documentation)

    This function returns an iterator which returns a tuple:
    (from line tuple, to line tuple, boolean flag)

    from/to line tuple -- (line num, line text)
        line num -- integer or None (to indicate a context separation)
        line text -- original line text with following markers inserted:
            '\0+' -- marks start of added text
            '\0-' -- marks start of deleted text
            '\0^' -- marks start of changed text
            '\1' -- marks end of added/deleted/changed text

    boolean flag -- None indicates context separation, True indicates
        either "from" or "to" line contains a change, otherwise False.

    This function/iterator was originally developed to generate side by side
    file difference for making HTML pages (see HtmlDiff class for example
    usage).

    Note, this function utilizes the ndiff function to generate the side by
    side difference markup.  Optional ndiff arguments may be passed to this
    function and they in turn will be passed to ndiff.
    r
Nz
(\++|\-+|\^+)cs�||d7<|dkr2|||�d�dd�fS|dkr�|�d�|�d�}}g}|fdd�}��||�t|�D]<\}\}	}
|d|	�d|||	|
�d	||
d�}qt|dd�}n*|�d�dd�}|s�d
}d||d	}|||fS)aReturns line of text with user's change markup and line formatting.

        lines -- list of lines from the ndiff generator to produce a line of
                 text from.  When producing the line of text to return, the
                 lines used are removed from this list.
        format_key -- '+' return first line in list with "add" markup around
                          the entire line.
                      '-' return first line in list with "delete" markup around
                          the entire line.
                      '?' return first line in list with add/delete/change
                          intraline markup (indices obtained from second line)
                      None return first line in list with no markup
        side -- indice into the num_lines list (0=from,1=to)
        num_lines -- from/to current line number.  This is NOT intended to be a
                     passed parameter.  It is present as a keyword argument to
                     maintain memory of the current line numbers between calls
                     of this function.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r&Nr
r��?cSs&|�|�d�d|��g�|�d�S)Nr&r
)r*rY�span)Zmatch_object�sub_inforrr�record_sub_info�sz3_mdiff.<locals>._make_line.<locals>.record_sub_info��rl)r?�sub�reversed)r�Z
format_key�sideZ	num_lines�textZmarkersr�r��keyZbegin�end)�	change_rerr�
_make_line�s 2z_mdiff.<locals>._make_linec3sng}d\}}t|�dkr*|�t�d��qd�dd�|D��}|�d�rP|}�n�|�d�r|�|dd	��|dd
�dfVq�n�|�d�r�|d
8}�|d
d	�ddfVq�nl|�d�rֈ|d
d	�d}}|d
d	}}�n>|�d��r�|dd	��|dd
�dfVq�n|�d��r0�|dd	��|dd
�dfVqn�|�d
��r\|d
8}�|d
d	�ddfVqn�|�d��r�|d
7}d�|dd
�dfVqn�|�d��r�d�|dd
�}}|d
d	}}n^|�d��r�|d
7}d�|dd
�dfVqn2|�d��r�|dd�dd	��|dd
�dfVq|d	k�r0|d
7}dV�q|d	k�rL|d
8}dV�q0|�d��r\dS||dfVqdS)a�Yields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from a
        differencing iterator, processes them and yields them.  When it can
        it yields both a "from" and a "to" line, otherwise it will yield one
        or the other.  In addition to yielding the lines of from/to text, a
        boolean flag is yielded to indicate if the text line(s) have
        differences in them.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        )r
r
r��XrcSsg|]}|d�qS)r
r�r[r�rrrrf�sz2_mdiff.<locals>._line_iterator.<locals>.<listcomp>z-?+?r�r
r&Tz--++ruN)z--?+z--+r�z-+?z-?+z+--rv)r�z+-rlF)N�rr�T)r�NT)r/r*�nextro�
startswith)r�Znum_blanks_pendingZnum_blanks_to_yieldrk�	from_line�to_line)r��diff_lines_iteratorrr�_line_iterator�sd



$



z_mdiff.<locals>._line_iteratorc3s���}gg}}t|�dks(t|�dkr�zt|�\}}}Wntk
rPYdSX|dk	rh|�||f�|dk	r|�||f�q|�d�\}}|�d�\}}|||p�|fVqdS)atYields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from the line
        iterator.  Its difference from that iterator is that this function
        always yields a pair of from/to text lines (with the change
        indication).  If necessary it will collect single from/to lines
        until it has a matching pair from/to pair to yield.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r
N)r/r��
StopIterationr*r?)Z
line_iterator�	fromlines�tolinesr�r��
found_diffZfromDiffZto_diff)r�rr�_line_pair_iterators

z#_mdiff.<locals>._line_pair_iteratorr&F)NNN)�re�compilerr�r�)r�r��contextrsrtr�r�Zline_pair_iteratorZlines_to_write�indexZcontextLinesr�r�r�r1r)r�r�r�r�r�_mdiffZsR"
8X!



r�an
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>aH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}aZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>a�
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>c@s�eZdZdZeZeZeZeZdZddde	fdd�Z
dd
d�dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zddd�ZdS) ra{For producing HTML side by side comparison with change highlights.

    This class can be used to create an HTML table (or a complete HTML file
    containing the table) showing a side by side, line by line comparison
    of text with inter-line and intra-line change highlights.  The table can
    be generated in either full or contextual difference mode.

    The following methods are provided for HTML generation:

    make_table -- generates HTML for a single side by side table
    make_file -- generates complete HTML file with a single side by side table

    See tools/scripts/diff.py for an example usage of this class.
    r
�NcCs||_||_||_||_dS)a�HtmlDiff instance initializer

        Arguments:
        tabsize -- tab stop spacing, defaults to 8.
        wrapcolumn -- column number where lines are broken and wrapped,
            defaults to None where lines are not wrapped.
        linejunk,charjunk -- keyword arguments passed into ndiff() (used by
            HtmlDiff() to generate the side by side HTML differences).  See
            ndiff() documentation for argument default values and descriptions.
        N)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r�tabsizeZ
wrapcolumnrsrtrrrr�szHtmlDiff.__init__rF�zutf-8)�charsetcCs:|jt|j|j|j||||||d�|d��|d��|�S)aReturns HTML file of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        charset -- charset of the HTML document
        )r��numlines)ZstylesZlegend�tabler��xmlcharrefreplace)�_file_templater��_styles�_legend�
make_tabler�r�)rr�r��fromdesc�todescr�r�r�rrr�	make_file�s����zHtmlDiff.make_filecs8�fdd���fdd�|D�}�fdd�|D�}||fS)aReturns from/to line lists with tabs expanded and newlines removed.

        Instead of tab characters being replaced by the number of spaces
        needed to fill in to the next tab stop, this function will fill
        the space with tab characters.  This is done so that the difference
        algorithms can identify changes in a file when tabs are replaced by
        spaces and vice versa.  At the end of the HTML generation, the tab
        characters will be replaced with a nonbreakable space.
        cs6|�dd�}|��j�}|�dd�}|�dd��d�S)Nrlr��	r�)rL�
expandtabsr�r�)r�)rrr�expand_tabs�sz2HtmlDiff._tab_newline_replace.<locals>.expand_tabscsg|]}�|��qSrrr��r�rrrf�sz1HtmlDiff._tab_newline_replace.<locals>.<listcomp>csg|]}�|��qSrrr�r�rrrf�sr)rr�r�r)r�rr�_tab_newline_replace�s
	zHtmlDiff._tab_newline_replacecCs|s|�||f�dSt|�}|j}||ksB||�d�d|krT|�||f�dSd}d}d}||kr�||kr�||dkr�|d7}||}|d7}q`||dkr�|d7}d}q`|d7}|d7}q`|d|�}	||d�}
|r�|	d}	d||
}
|�||	f�|�|d|
�dS)	a�Builds list of text lines by splitting text lines at wrap point

        This function will determine if the input text line needs to be
        wrapped (split) into separate lines.  If so, the first wrap point
        will be determined and the first line appended to the output
        text line list.  This function is used recursively to handle
        the second part of the split line to further split it.
        Nr�rUr
rr&r��>)r*r/r��count�_split_line)rZ	data_listZline_numr�rRrWr1r4ZmarkZline1Zline2rrrr��s8


zHtmlDiff._split_lineccs�|D]�\}}}|dkr$|||fVq||\}}\}}gg}	}
|�|	||�|�|
||�|	sd|
r|	rt|	�d�}nd}|
r�|
�d�}nd}|||fVq\qdS)z5Returns iterator that splits (wraps) mdiff text linesNr
)rrl)r�r?)r�diffs�fromdata�todata�flagZfromlineZfromtextZtolineZtotext�fromlist�tolistrrr�
_line_wrapper0s 
zHtmlDiff._line_wrapperc	Cs�ggg}}}|D]r\}}}z4|�|jd|f|���|�|jd|f|���Wn(tk
rz|�d�|�d�YnX|�|�q|||fS)z�Collects mdiff output into separate lists

        Before storing the mdiff from/to data into a list, it is converted
        into a single line of text with HTML markup.
        r
r&N)r*�_format_liner�)rr�r�r��flaglistr�r�r�rrr�_collect_linesLs
zHtmlDiff._collect_linescCsrzd|}d|j||f}Wntk
r6d}YnX|�dd��dd��dd	�}|�d
d���}d|||fS)
aReturns HTML markup of "from" / "to" text lines

        side -- 0 or 1 indicating "from" or "to" text
        flag -- indicates if difference on line
        linenum -- line number (used for line number column)
        text -- line text to be marked up
        z%dz
 id="%s%s"r�&z&amp;r�z&gt;�<z&lt;rl�&nbsp;z<<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>)�_prefixr�rLr�)rr�r�Zlinenumr��idrrrr�as
�zHtmlDiff._format_linecCs0dtj}dtj}tjd7_||g|_dS)zCreate unique anchor prefixeszfrom%d_zto%d_r&N)r�_default_prefixr)rZ
fromprefix�toprefixrrr�_make_prefixxs

zHtmlDiff._make_prefixcCs�|jd}dgt|�}dgt|�}d\}	}
d}t|�D]V\}}
|
r�|
s�d}
|}td||g�}d||	f||<|	d7}	d||	f||<q:d}
q:|s�dg}dg}dg}d}|r�d	g}|}n
d
g}}|ds�d||d<d|||<|||||fS)
zMakes list of "next" linksr&r)r
Fr
Tz id="difflib_chg_%s_%d"z"<a href="#difflib_chg_%s_%d">n</a>Fz2<td></td><td>&nbsp;No Differences Found&nbsp;</td>z(<td></td><td>&nbsp;Empty File&nbsp;</td>z!<a href="#difflib_chg_%s_0">f</a>z#<a href="#difflib_chg_%s_top">t</a>)rr/r(rW)rr�r�r�r�r�r�next_id�	next_hrefZnum_chgZ	in_changer�r1r�rrr�_convert_flags�s>
�
zHtmlDiff._convert_flagsc
CsR|��|�||�\}}|r"|}nd}t||||j|jd�}|jrL|�|�}|�|�\}	}
}|�|	|
|||�\}	}
}}}
g}d}t	t
|��D]P}||dkr�|dkr�|�d�q�|�||
||||	||||
|f�q�|s�|�rddd|dd|f}nd	}|jt
d	�|�||jd
d�}|�dd
��dd��dd��dd��dd�S)a�Returns HTML table of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        NrrzV            <tr><td class="diff_next"%s>%s</td>%s<td class="diff_next">%s</td>%s</tr>
r
z)        </tbody>        
        <tbody>
z <thead><tr>%s%s%s%s</tr></thead>z!<th class="diff_next"><br /></th>z+<th colspan="2" class="diff_header">%s</th>rr&)Z	data_rows�
header_rowr�z+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r�z</span>r�r)rr�r�r�r�r�r�r�r
r6r/r*�_table_templater�rorrL)rr�r�r�r�r�r�Z
context_linesr�r�r�r�r	rrkZfmtr1rr�rrrr��sl�
��

������zHtmlDiff.make_table)rrFr�)rrFr�)rarbrcrdr�r�rr�rrrr�r�r�r�r�r�rr
r�rrrrr�s2�
��7/�ccsnzddd�t|�}Wn"tk
r8td|�d�YnXd|f}|D]"}|dd�|krF|dd�VqFdS)a0
    Generate one of the two sequences that generated a delta.

    Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract
    lines originating from file 1 or 2 (parameter `which`), stripping off line
    prefixes.

    Examples:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> diff = list(diff)
    >>> print(''.join(restore(diff, 1)), end="")
    one
    two
    three
    >>> print(''.join(restore(diff, 2)), end="")
    ore
    tree
    emu
    r�r�)r&r�z)unknown delta choice (must be 1 or 2): %rNr�r�)�int�KeyErrorrg)ZdeltaZwhichrS�prefixesr�rrrrs��cCsddl}ddl}|�|�S)Nr
)�doctest�difflibZtestmod)rrrrr�_test!sr�__main__)rUre)r�)rrrrrUr�)rrrrrUr�)r�r�r�r�rUr�)$rd�__all__�heapqrrh�collectionsrZ_namedtuplerrrrrqrr�r��matchrrr�r	r�rr�r
rr�r�r�rr��objectrrrrarrrr�<module>s��


1	I
�
I�
L�
%�
	
a 
_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-38.pyc000064400000070505151450073350016667 0ustar00U

��.e]���@s`dddddddddddd	d
dddd
ddddddddddddddddddddddd	dd dd!d"d#d$d%dddd&d'dd(d)d*d&d+dd!dd,d-dddddddd.d&d&d&d&dd&dd&d&d&d&d&dddddddddd&dd&d&d&d&d&d&d&d&dd&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&dd&dd&dd&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&ddd&d&dd&dddd&d&d&ddd&d&dddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&dd&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&d&d&d&d&ddd&d&d&dd&d&ddd&d&d&d&d&d&d&dddddd&dd&d&dddddd&ddd&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&ddd&d&d&ddd&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&dd
d/ddd0d1d0d0d2d3d4dd5d6d7ddd8dd	d9dd:d;dd<d=dd>ddd?d@dAdBddd+ddCdDddEdd	dddd&dFdGdHdIdddJddKdLd&dMddddNdOdddddddddPdQdRdddSd&d&dddddTddddUdVdddWddXd&dYdZdd[d6d\d]dd^d&d&ddd_d`dadbdcd9dddded?dfd&dddgdhdidhdgdidgdgdhdhdgd]dgdgdgdgdhd&djdkdld&dmdnddod:d&dddddpddqdrdd&ddddsd&dtdud&d&d&d&dddd&d&ddvdwdudxdydydudz���Zd{S)|�d�z"cpython-38-x86_64-linux-gnu"ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPython�z/usr/binz/usr/lib64/python3.8z-L. -lpython3.8dzOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa{-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Ogz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--with-pydebug' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8dz=/builddir/build/BUILD/Python-3.8.17/build/debug/coverage.infoz;/builddir/build/BUILD/Python-3.8.17/build/debug/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz .cpython-38d-x86_64-linux-gnu.soi�ZyeszI/usr/include /usr/include /usr/include/python3.8d /usr/include/python3.8dz/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8d.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8d.soz3.8dz
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz1/usr/lib64/python3.8/config-3.8d-x86_64-linux-gnuzlibpython3.8d.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa1-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgozno-frameworkz./python -Ez	python3.8a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internala�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidz?LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debugz	@SGI_ABI@z/bin/shz.so���zcpython-38d-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczHLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz3.8z#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz//builddir/build/BUILD/Python-3.8.17/build/debugz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�?/usr/lib64/python3.8/_sysconfigdata_d_linux_x86_64-linux-gnu.py�<module>sb2+-��������timeit.cpython-38.opt-1.pyc000064400000027003151450073350011433 0ustar00U

e5d�4�@s�dZddlZddlZddlZddlZddddgZdZdZd	Zej	Z
eZd
Z
dd�ZGd
d�d�Zdde
edfdd�Zdde
eedfdd�Zddd�dd�Zedkr�e�e��dS)a9Tool for measuring execution time of small code snippets.

This module avoids a number of common traps for measuring execution
times.  See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.

Library usage: see the Timer class.

Command line usage:
    python timeit.py [-n N] [-r N] [-s S] [-p] [-h] [--] [statement]

Options:
  -n/--number N: how many times to execute 'statement' (default: see below)
  -r/--repeat N: how many times to repeat the timer (default 5)
  -s/--setup S: statement to be executed once initially (default 'pass').
                Execution time of this setup statement is NOT timed.
  -p/--process: use time.process_time() (default is time.perf_counter())
  -v/--verbose: print raw timing results; repeat for more digits precision
  -u/--unit: set the output time unit (nsec, usec, msec, or sec)
  -h/--help: print this usage message and exit
  --: separate options from statement, use when statement starts with -
  statement: statement to be timed (default 'pass')

A multi-line statement may be given by specifying each line as a
separate argument; indented lines are possible by enclosing an
argument in quotes and using leading spaces.  Multiple -s options are
treated similarly.

If -n is not given, a suitable number of loops is calculated by trying
increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the
total time is at least 0.2 seconds.

Note: there is a certain baseline overhead associated with executing a
pass statement.  It differs between versions.  The code here doesn't try
to hide it, but you should be aware of it.  The baseline overhead can be
measured by invoking the program without arguments.

Classes:

    Timer

Functions:

    timeit(string, string) -> float
    repeat(string, string) -> list
    default_timer() -> float

�N�Timer�timeit�repeat�
default_timerz<timeit-src>i@B�z�
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
cCs|�ddd|�S)z*Helper to reindent a multi-line statement.�
� )�replace)�src�indent�r�/usr/lib64/python3.8/timeit.py�reindentOsrc@sPeZdZdZddedfdd�Zddd�Zefdd	�Ze	efd
d�Z
ddd
�ZdS)ra�Class for timing execution speed of small code snippets.

    The constructor takes a statement to be timed, an additional
    statement used for setup, and a timer function.  Both statements
    default to 'pass'; the timer function is platform-dependent (see
    module doc string).  If 'globals' is specified, the code will be
    executed within that namespace (as opposed to inside timeit's
    namespace).

    To measure the execution time of the first statement, use the
    timeit() method.  The repeat() method is a convenience to call
    timeit() multiple times and return a list of results.

    The statements may contain newlines, as long as they don't contain
    multi-line string literals.
    �passNcCs�||_i}|dkrt�n|}d}t|t�rJt|td�|d}t|d�}n*t|�rl||d<|d7}d}d}ntd	��t|t�r�t||td�t|d
�}n&t|�r�||d<|d7}d
}ntd��t	j
|||d�}	|	|_t|	td�}
t|
||�|d|_
dS)z#Constructor.  See class doc string.N��execr��_setupz, _setup=_setupz_setup()z&setup is neither a string nor callable�Z_stmtz
, _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)�stmt�setup�init�inner)�timer�_globals�
isinstance�str�compile�dummy_src_namer�callable�
ValueError�template�formatr
rr)�selfrrr�globalsZlocal_nsZ	global_nsrZ
stmtprefixr
�coderrr
�__init__es6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|j�d�tf|jt<|j|d�dS)a�Helper to print a traceback from the timed code.

        Typical use:

            t = Timer(...)       # outside the try/except
            try:
                t.timeit(...)    # or t.repeat(...)
            except:
                t.print_exc()

        The advantage over the standard traceback is that source lines
        in the compiled template will be displayed.

        The optional file argument directs where the traceback is
        sent; it defaults to sys.stderr.
        rNr��file)�	linecache�	tracebackr
�len�splitr�cache�	print_exc)r#r(r)r*rrr
r.�s

�
zTimer.print_exccCsBt�d|�}t��}t��z|�||j�}W5|r<t��X|S)a�Time 'number' executions of the main statement.

        To be precise, this executes the setup statement once, and
        then returns the time it takes to execute the main statement
        a number of times, as a float measured in seconds.  The
        argument is the number of times through the loop, defaulting
        to one million.  The main statement, the setup statement and
        the timer function to be used are passed to the constructor.
        N)�	itertoolsr�gcZ	isenabledZdisableZenablerr)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs*g}t|�D]}|�|�}|�|�q|S)a�Call timeit() a few times.

        This is a convenience function that calls the timeit()
        repeatedly, returning a list of results.  The first argument
        specifies how many times to call timeit(), defaulting to 5;
        the second argument specifies the timer argument, defaulting
        to one million.

        Note: it's tempting to calculate mean and standard deviation
        from the result vector and report these.  However, this is not
        very useful.  In a typical case, the lowest value gives a
        lower bound for how fast your machine can run the given code
        snippet; higher values in the result vector are typically not
        caused by variability in Python's speed, but by other
        processes interfering with your timing accuracy.  So the min()
        of the result is probably the only number you should be
        interested in.  After that, you should look at the entire
        vector and apply common sense rather than statistics.
        )�ranger�append)r#rr1�r�i�trrr
r�s

zTimer.repeatcCsPd}dD]8}||}|�|�}|r,|||�|dkr||fSq|d9}qdS)a�Return the number of loops and time taken so that total time >= 0.2.

        Calls the timeit method with increasing numbers from the sequence
        1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2
        second.  Returns (number, time_taken).

        If *callback* is given and is not None, it will be called after
        each trial with two arguments: ``callback(number, time_taken)``.
        �)r8�rg�������?�
N)r)r#�callbackr6�jr1�
time_takenrrr
�	autorange�s


zTimer.autorange)N)N)�__name__�
__module__�__qualname__�__doc__rr&r.�default_numberr�default_repeatrr>rrrr
rSs�
#
rcCst||||��|�S)zCConvenience function to create Timer object and call timeit method.)rr)rrrr1r$rrr
r�scCst||||��||�S)zCConvenience function to create Timer object and call repeat method.)rr)rrrrr1r$rrr
r�s)�_wrap_timerc
s|dkrtjdd�}ddl}z(|�|dddddd	d
ddd
g	�\}}Wn:|jk
r�}zt|�td�WY�dSd}~XYnXt}d�|�p�d}d�g}t}d}	d�ddddd��d�|D]�\}
}|
dkr�t|��|
dkr�|�	|�|
dk�r|�k�r|�ntdtj
d�dS|
dk�r6t|�}|dk�r6d}|
dk�rFtj}|
dk�rf|	�r^�d7�|	d7}	|
d kr�tt
d!d"�dSq�d�|��p�d}ddl}tj�d|j�|dk	�r�||�}t|||�}
�dk�rd}|	�r�fd#d$�}z|
�|�\�}Wn|
��YdSX|	�rt�z|
�|��}Wn|
��YdSX���fd%d&�}|	�rztd'd(�t||���t��fd)d*�|D�}t|�}td+��dk�r�d,nd-|||�f�t|�}t|�}||d.k�rddl}|�d/||�||�ftd-d�dS)0a�Main program, used when run as a script.

    The optional 'args' argument specifies the command line to be parsed,
    defaulting to sys.argv[1:].

    The return value is an exit code to be passed to sys.exit(); it
    may be None to indicate success.

    When an exception happens during timing, a traceback is printed to
    stderr and the return value is 1.  Exceptions at other times
    (including the template compilation) are not caught.

    '_wrap_timer' is an internal interface used for unit testing.  If it
    is not None, it must be a callable that accepts a timer function
    and returns another timer function (used for unit testing).
    Nr8rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�timeZclockZprocess�verbosezunit=�helpz#use -h/--help for command line helpr9rrg��&�.>g���ư>g����MbP?g�?)ZnsecZusecZmsecZsec�)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.r')z-rz--repeat)z-pz	--process)z-vz	--verbose)z-hz--helpr)�endcs.d}|dk}t|j||rdnd|�d��dS)Nz%{num} loop{s} -> {secs:.{prec}g} secsr8�sr)ZnumrKZsecsZprec)�printr")r1r=�msgZplural)�	precisionrr
r;?s�zmain.<locals>.callbackcs`�}|dk	r�|}n8dd����D�}|jdd�|D]\}}||kr8qNq8d�|||fS)NcSsg|]\}}||f�qSrr)�.0�unit�scalerrr
�
<listcomp>Ysz-main.<locals>.format_time.<locals>.<listcomp>T)�reversez%.*g %s)�items�sort)�dtrPrQZscales)rN�	time_unit�unitsrr
�format_timeSs
zmain.<locals>.format_timez
raw times: %sz, csg|]}|��qSrr)rOrV)r1rr
rRdszmain.<locals>.<listcomp>z"%d loop%s, best of %d: %s per looprKrrztThe test results are likely unreliable. The worst time (%s) was more than four times slower than the best time (%s).)�sys�argv�getopt�errorrLr�joinrD�intr4�stderrrF�process_timerB�os�path�insert�curdirrr>r.r�map�min�max�warnings�
warn_explicit�UserWarning)�argsrEr\Zopts�errrrrrrG�o�arbr7r;�_Zraw_timingsrYZtimingsZbestZworstrir)r1rNrWrXr
�main�s���


�





����rq�__main__)N)rBr0rZrFr/�__all__rrCrD�perf_counterrr$rr!rrrrrqr?�exitrrrr
�<module>s61
�
�
ssl.cpython-38.pyc000064400000127066151450073350010014 0ustar00U

e5dH��
@s�dZddlZddlZddlmZddlmZmZ	m
ZddlZddlm
Z
mZmZddlmZmZmZddlmZmZmZmZmZmZmZddlmZmZdd	lmZmZm Z m!Z!zdd
lm"Z"Wne#k
r�YnXddlm$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddlm.Z.m/Z/e	j0d
e1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e	j0de1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e2j3Z4e2_4dd�e2j5�6�D�Z7e8e2dd�Z9Gdd�de	�Z:Gd d!�d!e	�Z;Gd"d#�d#e	�Z<Gd$d%�d%e	�Z=ej>d&k�r"dd'lm?Z?m@Z@dd(lAmAZAmBZBmCZCmDZDdd)lAmEZEmFZFddlAZGddlHZHddlIZIddlJZJeKZLd*gZMeNed+�ZOe.ZPeZQd,d-�ZRd.d/�ZSd0d1�ZTd2d3�ZUed4d5�ZVd6d7�ZWGd8d9�d9ed9d:��ZXGd;d<�d<eXe�ZYGd=d>�d>e�ZZeYj[fdddd?�d@dA�Z\e3fe]dBeYj[ddddddC�dDdE�Z^e\Z_e^Z`GdFdG�dG�ZadHdI�ZbGdJdK�dKeA�ZceceZ_deaeZ_edddBe]e3ddLdLdf	dMdN�ZfdOdP�ZgdQZhdRZidSdT�ZjdUdV�Zke3dfdWdX�ZldYdZ�ZmdS)[a�
This module provides some more Pythonic support for SSL.

Object types:

  SSLSocket -- subtype of socket.socket which does SSL over the socket

Exceptions:

  SSLError -- exception raised for I/O errors

Functions:

  cert_time_to_seconds -- convert time string used for certificate
                          notBefore and notAfter functions to integer
                          seconds past the Epoch (the time values
                          returned from time.time())

  fetch_server_certificate (HOST, PORT) -- fetch the certificate provided
                          by the server running on HOST at port PORT.  No
                          validation of the certificate is performed.

Integer constants:

SSL_ERROR_ZERO_RETURN
SSL_ERROR_WANT_READ
SSL_ERROR_WANT_WRITE
SSL_ERROR_WANT_X509_LOOKUP
SSL_ERROR_SYSCALL
SSL_ERROR_SSL
SSL_ERROR_WANT_CONNECT

SSL_ERROR_EOF
SSL_ERROR_INVALID_ERROR_CODE

The following group define certificate requirements that one side is
allowing/requiring from the other side:

CERT_NONE - no certificates from the other side are required (or will
            be looked at if provided)
CERT_OPTIONAL - certificates are not required, but if provided will be
                validated, and if validation fails, the connection will
                also fail
CERT_REQUIRED - certificates are required, and will be validated, and
                if validation fails, the connection will also fail

The following constants identify various SSL protocol variants:

PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLS
PROTOCOL_TLS_CLIENT
PROTOCOL_TLS_SERVER
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2

The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6

ALERT_DESCRIPTION_CLOSE_NOTIFY
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
ALERT_DESCRIPTION_BAD_RECORD_MAC
ALERT_DESCRIPTION_RECORD_OVERFLOW
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_BAD_CERTIFICATE
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
ALERT_DESCRIPTION_CERTIFICATE_REVOKED
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
ALERT_DESCRIPTION_ILLEGAL_PARAMETER
ALERT_DESCRIPTION_UNKNOWN_CA
ALERT_DESCRIPTION_ACCESS_DENIED
ALERT_DESCRIPTION_DECODE_ERROR
ALERT_DESCRIPTION_DECRYPT_ERROR
ALERT_DESCRIPTION_PROTOCOL_VERSION
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
ALERT_DESCRIPTION_INTERNAL_ERROR
ALERT_DESCRIPTION_USER_CANCELLED
ALERT_DESCRIPTION_NO_RENEGOTIATION
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
ALERT_DESCRIPTION_UNRECOGNIZED_NAME
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
�N)�
namedtuple)�Enum�IntEnum�IntFlag)�OPENSSL_VERSION_NUMBER�OPENSSL_VERSION_INFO�OPENSSL_VERSION)�_SSLContext�	MemoryBIO�
SSLSession)�SSLError�SSLZeroReturnError�SSLWantReadError�SSLWantWriteError�SSLSyscallError�SSLEOFError�SSLCertVerificationError)�txt2obj�nid2obj)�RAND_status�RAND_add�
RAND_bytes�RAND_pseudo_bytes)�RAND_egd)
�HAS_SNI�HAS_ECDH�HAS_NPN�HAS_ALPN�	HAS_SSLv2�	HAS_SSLv3�	HAS_TLSv1�HAS_TLSv1_1�HAS_TLSv1_2�HAS_TLSv1_3)�_DEFAULT_CIPHERS�_OPENSSL_API_VERSION�
_SSLMethodcCs|�d�o|dkS)NZ	PROTOCOL_�PROTOCOL_SSLv23��
startswith��name�r,�/usr/lib64/python3.8/ssl.py�<lambda>|�r.)�source�OptionscCs
|�d�S)NZOP_r(r*r,r,r-r.�r/ZAlertDescriptioncCs
|�d�S)NZALERT_DESCRIPTION_r(r*r,r,r-r.�r/ZSSLErrorNumbercCs
|�d�S)NZ
SSL_ERROR_r(r*r,r,r-r.�r/�VerifyFlagscCs
|�d�S)NZVERIFY_r(r*r,r,r-r.�r/�
VerifyModecCs
|�d�S)NZCERT_r(r*r,r,r-r.�r/cCsi|]\}}||�qSr,r,)�.0r+�valuer,r,r-�
<dictcomp>�sr6ZPROTOCOL_SSLv2c@s6eZdZejZejZejZ	ej
ZejZ
ejZejZdS)�
TLSVersionN)�__name__�
__module__�__qualname__�_sslZPROTO_MINIMUM_SUPPORTEDZMINIMUM_SUPPORTEDZPROTO_SSLv3�SSLv3ZPROTO_TLSv1ZTLSv1Z
PROTO_TLSv1_1ZTLSv1_1Z
PROTO_TLSv1_2ZTLSv1_2Z
PROTO_TLSv1_3ZTLSv1_3ZPROTO_MAXIMUM_SUPPORTEDZMAXIMUM_SUPPORTEDr,r,r,r-r7�sr7c@s(eZdZdZdZdZdZdZdZdZ	dS)	�_TLSContentTypez@Content types (record layer)

    See RFC 8446, section B.1
    ������N)
r8r9r:�__doc__�CHANGE_CIPHER_SPEC�ALERTZ	HANDSHAKEZAPPLICATION_DATA�HEADERZINNER_CONTENT_TYPEr,r,r,r-r=�sr=c@s�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$S)%�
_TLSAlertTypezQAlert types for TLSContentType.ALERT messages

    See RFC 8466, section B.2
    r�
r>r?r@��(�)�*�+�,�-�.�/�0�1�2�3�<�F�G�P�V�Z�d�m�n�o�p�q�r�s�t�xN)&r8r9r:rDZCLOSE_NOTIFYZUNEXPECTED_MESSAGEZBAD_RECORD_MACZDECRYPTION_FAILEDZRECORD_OVERFLOWZDECOMPRESSION_FAILUREZHANDSHAKE_FAILUREZNO_CERTIFICATEZBAD_CERTIFICATEZUNSUPPORTED_CERTIFICATEZCERTIFICATE_REVOKEDZCERTIFICATE_EXPIREDZCERTIFICATE_UNKNOWNZILLEGAL_PARAMETERZ
UNKNOWN_CAZ
ACCESS_DENIEDZDECODE_ERRORZ
DECRYPT_ERRORZEXPORT_RESTRICTIONZPROTOCOL_VERSIONZINSUFFICIENT_SECURITYZINTERNAL_ERRORZINAPPROPRIATE_FALLBACKZ
USER_CANCELEDZNO_RENEGOTIATIONZMISSING_EXTENSIONZUNSUPPORTED_EXTENSIONZCERTIFICATE_UNOBTAINABLEZUNRECOGNIZED_NAMEZBAD_CERTIFICATE_STATUS_RESPONSEZBAD_CERTIFICATE_HASH_VALUEZUNKNOWN_PSK_IDENTITYZCERTIFICATE_REQUIREDZNO_APPLICATION_PROTOCOLr,r,r,r-rH�sFrHc@sheZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdS)�_TLSMessageTypezFMessage types (handshake protocol)

    See RFC 8446, section B.3
    r����������
���r>r?r@rA��C�rCN)r8r9r:rDZ
HELLO_REQUESTZCLIENT_HELLOZSERVER_HELLOZHELLO_VERIFY_REQUESTZNEWSESSION_TICKETZEND_OF_EARLY_DATAZHELLO_RETRY_REQUESTZENCRYPTED_EXTENSIONSZCERTIFICATEZSERVER_KEY_EXCHANGEZCERTIFICATE_REQUESTZSERVER_DONEZCERTIFICATE_VERIFYZCLIENT_KEY_EXCHANGEZFINISHEDZCERTIFICATE_URLZCERTIFICATE_STATUSZSUPPLEMENTAL_DATAZ
KEY_UPDATEZ
NEXT_PROTOZMESSAGE_HASHrEr,r,r,r-rg�s.rg�win32)�enum_certificates�	enum_crls)�socket�AF_INET�SOCK_STREAM�create_connection)�
SOL_SOCKET�SO_TYPE�
tls-unique�HOSTFLAG_NEVER_CHECK_SUBJECTcCs�|sdS|�d�}|s&|��|��kS|dkr<td�|���|�d�\}}}d|krbtd�|���|sttd�|���|dkr�td�|���|�d�\}}}|r�|s�dS|��|��kS)	a�Matching according to RFC 6125, section 6.4.3

    - Hostnames are compared lower case.
    - For IDNA, both dn and hostname must be encoded as IDN A-label (ACE).
    - Partial wildcards like 'www*.example.org', multiple wildcards, sole
      wildcard or wildcards in labels other then the left-most label are not
      supported and a CertificateError is raised.
    - A wildcard must match at least one character.
    F�*rhz1too many wildcards in certificate DNS name: {!r}.�.z9wildcard can only be present in the leftmost label: {!r}.z>sole wildcard without additional labels are not support: {!r}.z<partial wildcards in leftmost label are not supported: {!r}.)�count�lower�CertificateError�format�	partition)Zdn�hostnameZ	wildcardsZdn_leftmost�sepZdn_remainderZhostname_leftmostZhostname_remainderr,r,r-�_dnsname_matchs@

�������r�cCs�zt�|�}Wntk
r"Yn"Xt�|�|kr6|Std�|���zt�tj|�WStk
rvtd�|���Yntk
r�YnXtd�|���dS)z�Try to convert an IP address to packed binary form

    Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6
    support.
    z'{!r} is not a quad-dotted IPv4 address.z+{!r} is neither an IPv4 nor an IP6 address.z{!r} is not an IPv4 address.N)	�_socketZ	inet_aton�OSErrorZ	inet_ntoa�
ValueErrorr�Z	inet_ptonZAF_INET6�AttributeError)Zipname�addrr,r,r-�_inet_patonDs$��
r�cCst|���}||kS)z�Exact matching of IP addresses.

    RFC 6125 explicitly doesn't define an algorithm for this
    (section 1.7.2 - "Out of Scope").
    )r��rstrip)Zcert_ipaddress�host_ipZipr,r,r-�_ipaddress_matchgsr�cCsJ|std��zt|�}Wntk
r0d}YnXg}|�dd�}|D]^\}}|dkrz|dkrnt||�rndS|�|�qF|dkrF|dk	r�t||�r�dS|�|�qF|s�|�dd�D]6}|D],\}}|dkr�t||�r�dS|�|�q�q�t|�d	k�rtd
|d�t	t
|��f��n,t|�d	k�r>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.

    The function matches IP addresses rather than dNSNames if hostname is a
    valid ipaddress string. IPv4 addresses are supported on all platforms.
    IPv6 addresses are supported on platforms with IPv6 support (AF_INET6
    and inet_pton).

    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_REQUIREDNZsubjectAltNamer,ZDNSz
IP AddressZsubjectZ
commonNamerhz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)r�r��getr��appendr��lenr��join�map�repr)�certr�r�ZdnsnamesZsan�keyr5�subr,r,r-�match_hostnamessB


�
�r��DefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcCsdt��}tj�|d|d�}tj�|d|d�}ttj�|�rF|ndtj�|�rX|ndf|��S)z/Return paths to default cafile and capath.
    rrhrirjN)	r;�get_default_verify_paths�os�environr�r��path�isfile�isdir)�parts�cafile�capathr,r,r-r��s��r�csDeZdZdZdZ�fdd�Ze�fdd��Ze�fdd��Z�Z	S)	�_ASN1Objectz#ASN.1 object identifier lookup
    r,cst�j|ft|dd���S)NFr*��super�__new__�_txt2obj)�cls�oid��	__class__r,r-r��sz_ASN1Object.__new__cst�j|ft|���S)z3Create _ASN1Object from OpenSSL numeric ID
        )r�r��_nid2obj)r�Znidr�r,r-�fromnid�sz_ASN1Object.fromnidcst�j|ft|dd���S)z=Create _ASN1Object from short name, long name or OID
        Tr*r�)r�r+r�r,r-�fromname�sz_ASN1Object.fromname)
r8r9r:rD�	__slots__r��classmethodr�r��
__classcell__r,r,r�r-r��sr�znid shortname longname oidc@seZdZdZdZdZdS)�PurposezDSSLContext purpose flags with X509v3 Extended Key Usage objects
    z1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)r8r9r:rD�SERVER_AUTHZCLIENT_AUTHr,r,r,r-r��sr�cs�eZdZdZdZdZdZefdd�Zdd�Z	d2d
d�Z
d3dd
�Zdd�Zdd�Z
dd�Zdd�Zejfdd�Zeed�r�e�fdd��Zej�fdd��Ze�fdd��Zej�fdd��Ze�fdd ��Zej�fd!d ��Zeed"��red#d$��Zejd%d$��Zned&d$��Ze�fd'd(��Zej�fd)d(��Ze�fd*d+��Ze�fd,d-��Zej�fd.d-��Ze�fd/d0��Zej�fd1d0��Z�Z S)4�
SSLContextz|An SSLContext holds various SSL-related configuration options and
    data, such as certificates and possibly a private key.)ZCAZROOTNcOst�||�}|S�N)r	r�)r��protocol�args�kwargs�selfr,r,r-r��szSSLContext.__new__cCs4|dkrdSt|t�r&|�d��d�S|�d�SdS)NZidna�ascii)�
isinstance�str�encode�decode)r�r�r,r,r-�_encode_hostname�s

zSSLContext._encode_hostnameFTc	Cs|jj|||||||d�S)N)�sock�server_side�do_handshake_on_connect�suppress_ragged_eofs�server_hostname�context�session)�sslsocket_class�_create)r�r�r�r�r�r�r�r,r,r-�wrap_socket�s�zSSLContext.wrap_socketcCs|jj||||�|�||d�S)N)r�r�r�r�)�sslobject_classr�r�)r��incoming�outgoingr�r�r�r,r,r-�wrap_bio�s�zSSLContext.wrap_biocCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�r�z(NPN protocols must be 1 to 255 in length)�	bytearray�bytesr�rr��extendZ_set_npn_protocols)r�Z
npn_protocols�protosr��br,r,r-�set_npn_protocolss
zSSLContext.set_npn_protocolscs8�dkrd�_n$t��s td����fdd�}|�_dS)Nznot a callable objectcs��|�}�|||�Sr�)r�)�sslobjZ
servernameZsslctx�r��server_name_callbackr,r-�shim_cbs
z3SSLContext.set_servername_callback.<locals>.shim_cb)Zsni_callback�callable�	TypeError)r�r�r�r,r�r-�set_servername_callbacksz"SSLContext.set_servername_callbackcCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�rr�z)ALPN protocols must be 1 to 255 in length)r�r�r�rr�r�Z_set_alpn_protocols)r�Zalpn_protocolsr�r�r�r,r,r-�set_alpn_protocols s
zSSLContext.set_alpn_protocolscCsvt�}z<t|�D].\}}}|dkr|dks4|j|kr|�|�qWntk
r`t�d�YnX|rr|j|d�|S)NZx509_asnTz-unable to enumerate Windows certificate store)�cadata)r�ryr�r��PermissionError�warnings�warn�load_verify_locations)r��	storename�purposeZcertsr��encodingZtrustr,r,r-�_load_windows_store_certs+sz$SSLContext._load_windows_store_certscCs@t|t�st|��tjdkr4|jD]}|�||�q"|��dS)Nrx)r�r�r��sys�platform�_windows_cert_storesr�Zset_default_verify_paths)r�r�r�r,r,r-�load_default_certs9s


zSSLContext.load_default_certs�minimum_versioncstt�j�Sr�)r7r�r��r�r�r,r-r�BszSSLContext.minimum_versioncs4|tjkr|jtjM_ttt�j�||�dSr�)	r7r<�optionsr1ZOP_NO_SSLv3r�r�r��__set__�r�r5r�r,r-r�Fs
cstt�j�Sr�)r7r��maximum_versionr�r�r,r-r�LszSSLContext.maximum_versioncsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Pscstt�j�Sr�)r1r�r�r�r�r,r-r�TszSSLContext.optionscsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Xsr�cCs|jtj@}|tjkSr��Z_host_flagsr;r�)r�Zncsr,r,r-�hostname_checks_common_name]sz&SSLContext.hostname_checks_common_namecCs,|r|jtjM_n|jtjO_dSr�r�r�r,r,r-r�bscCsdS)NTr,r�r,r,r-r�iscst�j}|dk	r|jSdSdS)a9TLS message callback

        The message callback provides a debugging hook to analyze TLS
        connections. The callback is called for any TLS protocol message
        (header, handshake, alert, and more), but not for application data.
        Due to technical  limitations, the callback can't be used to filter
        traffic or to abort a connection. Any exception raised in the
        callback is delayed until the handshake, read, or write operation
        has been performed.

        def msg_cb(conn, direction, version, content_type, msg_type, data):
            pass

        conn
            :class:`SSLSocket` or :class:`SSLObject` instance
        direction
            ``read`` or ``write``
        version
            :class:`TLSVersion` enum member or int for unknown version. For a
            frame header, it's the header version.
        content_type
            :class:`_TLSContentType` enum member or int for unsupported
            content type.
        msg_type
            Either a :class:`_TLSContentType` enum number for a header
            message, a :class:`_TLSAlertType` enum member for an alert
            message, a :class:`_TLSMessageType` enum member for other
            messages, or int for unsupported message types.
        data
            Raw, decrypted message content as bytes
        N)r��
_msg_callback�
user_function)r��innerr�r,r-r�ms!zSSLContext._msg_callbackcsb�dkr ttt�j�|d�dSt�d�s8t��d����fdd�}�|_ttt�j�||�dS)N�__call__z is not callable.cs�zt|�}Wntk
r YnXzt|�}Wntk
rBYnX|tjkrTt}n|tjkrdt}nt}z||�}Wntk
r�YnX�||||||�Sr�)r7r�r=rGrFrHrg)Zconn�	direction�versionZcontent_typeZmsg_type�dataZmsg_enum��callbackr,r-r��s,

�z'SSLContext._msg_callback.<locals>.inner)r�r�r�r��hasattrr�r�)r�rr�r�rr-r��s
cstt�j�Sr�)r&r�r�r�r�r,r-r��szSSLContext.protocolcstt�j�Sr�)r2r��verify_flagsr�r�r,r-r�szSSLContext.verify_flagscsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�scs0t�j}z
t|�WStk
r*|YSXdSr�)r��verify_moder3r�r�r�r,r-r�s

zSSLContext.verify_modecsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�s)FTTNN)FNN)!r8r9r:rDr�r�r��PROTOCOL_TLSr�r�r�r�r�r�r�r�r�r�r�rr	�propertyr��setterr�r�r;r�r�r�rrr�r,r,r�r-r��sn�
�





&%r�)r�r�r�cCs�t|t�st|��tt�}|tjkr0t|_d|_	|s<|s<|rL|�
|||�n|jtkr`|�|�t
|d�r�tj�d�}|r�tjjs�||_|S)z�Create a SSLContext object with default settings.

    NOTE: The protocol and settings may change anytime without prior
          deprecation. The values represent a fair balance between maximum
          compatibility and security.
    T�keylog_filename�
SSLKEYLOGFILE)r�r�r�r�rr�r��
CERT_REQUIREDr�check_hostnamer��	CERT_NONEr�rr�r�r�r��flags�ignore_environmentr)r�r�r�r�r��
keylogfiler,r,r-�create_default_context�s




rF)�	cert_reqsrr��certfile�keyfiler�r�r�cCs�t|t�st|��t|�}	|s$d|	_|dk	r2||	_|r<d|	_|rL|sLtd��|sT|r`|	�||�|sl|sl|r||	�|||�n|	jt	kr�|	�
|�t|	d�r�tj
�d�}
|
r�tjjs�|
|	_|	S)a/Create a SSLContext object for Python stdlib modules

    All Python stdlib modules shall use this function to create SSLContext
    objects in order to keep common settings in one place. The configuration
    is less restrict than create_default_context()'s to increase backward
    compatibility.
    FNT�certfile must be specifiedrr	)r�r�r�r�rrr��load_cert_chainr�rr�rr�r�r�r�r
rr)r�rrr�rrr�r�r�r�rr,r,r-�_create_unverified_context�s,



rc@s�eZdZdZdd�Zed2dd��Zedd	��Zej	d
d	��Zedd��Z
e
j	d
d��Z
edd��Zedd��Zedd��Z
d3dd�Zdd�Zd4dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd5d,d-�Zd.d/�Zd0d1�ZdS)6�	SSLObjectaThis class implements an interface on top of a low-level SSL object as
    implemented by OpenSSL. This object captures the state of an SSL connection
    but does not provide any network IO itself. IO needs to be performed
    through separate "BIO" objects which are OpenSSL's IO abstraction layer.

    This class does not have a public constructor. Instances are returned by
    ``SSLContext.wrap_bio``. This class is typically used by framework authors
    that want to implement asynchronous IO for SSL through memory buffers.

    When compared to ``SSLSocket``, this object lacks the following features:

     * Any form of network IO, including methods such as ``recv`` and ``send``.
     * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery.
    cOst|jj�d���dS)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().�r�r�r8�r�r�r�r,r,r-�__init__;s�zSSLObject.__init__FNc	Cs*|�|�}|j||||||d�}||_|S)N)r�r��ownerr�)r�Z	_wrap_bio�_sslobj)	r�r�r�r�r�r�r�r�r�r,r,r-r�As
�zSSLObject._createcCs|jjS)z(The SSLContext that is currently in use.�rr�r�r,r,r-r�MszSSLObject.contextcCs||j_dSr�r�r�Zctxr,r,r-r�RscCs|jjS)z!The SSLSession for client socket.�rr�r�r,r,r-r�VszSSLObject.sessioncCs||j_dSr�r�r�r�r,r,r-r�[scCs|jjS)z.Was the client session reused during handshake�r�session_reusedr�r,r,r-r"_szSSLObject.session_reusedcCs|jjS)z%Whether this is a server-side socket.)rr�r�r,r,r-r�dszSSLObject.server_sidecCs|jjS)z^The currently set server hostname (for SNI), or ``None`` if no
        server hostname is set.)rr�r�r,r,r-r�iszSSLObject.server_hostname�cCs(|dk	r|j�||�}n|j�|�}|S)z�Read up to 'len' bytes from the SSL object and return them.

        If 'buffer' is provided, read into this buffer and return the number of
        bytes read.
        N)r�read)r�r��buffer�vr,r,r-r$oszSSLObject.readcCs|j�|�S)z�Write 'data' to the SSL object and return the number of bytes
        written.

        The 'data' argument must support the buffer interface.
        )r�write�r�r�r,r,r-r'{szSSLObject.writecCs|j�|�S)z�Returns a formatted version of the data in the certificate provided
        by the other end of the SSL channel.

        Return None if no certificate was provided, {} if a certificate was
        provided, but not validated.
        )r�getpeercert�r�Zbinary_formr,r,r-r)�szSSLObject.getpeercertcCstjr|j��SdS)z�Return the currently selected NPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if NPN is not supported by one
        of the peers.N)r;rr�selected_npn_protocolr�r,r,r-r+�szSSLObject.selected_npn_protocolcCstjr|j��SdS)z�Return the currently selected ALPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if ALPN is not supported by one
        of the peers.N)r;rr�selected_alpn_protocolr�r,r,r-r,�sz SSLObject.selected_alpn_protocolcCs
|j��S)z_Return the currently selected cipher as a 3-tuple ``(name,
        ssl_version, secret_bits)``.)r�cipherr�r,r,r-r-�szSSLObject.ciphercCs
|j��S)z�Return a list of ciphers shared by the client during the handshake or
        None if this is not a valid server connection.
        )r�shared_ciphersr�r,r,r-r.�szSSLObject.shared_cipherscCs
|j��S)z�Return the current compression algorithm in use, or ``None`` if
        compression was not negotiated or not supported by one of the peers.)r�compressionr�r,r,r-r/�szSSLObject.compressioncCs
|j��S)z8Return the number of bytes that can be read immediately.)r�pendingr�r,r,r-r0�szSSLObject.pendingcCs|j��dS)zStart the SSL/TLS handshake.N)r�do_handshaker�r,r,r-r1�szSSLObject.do_handshakecCs
|j��S)z!Start the SSL shutdown handshake.)r�shutdownr�r,r,r-�unwrap�szSSLObject.unwrapr�cCs|j�|�S)z�Get channel binding data for current connection.  Raise ValueError
        if the requested `cb_type` is not supported.  Return bytes of the data
        or None if the data is not available (e.g. before the handshake).)r�get_channel_binding�r�Zcb_typer,r,r-r4�szSSLObject.get_channel_bindingcCs
|j��S)zZReturn a string identifying the protocol version used by the
        current SSL channel. �rr�r�r,r,r-r��szSSLObject.versioncCs
|j��Sr�)r�verify_client_post_handshaker�r,r,r-r7�sz&SSLObject.verify_client_post_handshake)FNNN)r#N)F)r�)r8r9r:rDrr�r�rr�rr�r"r�r�r$r'r)r+r,r-r.r/r0r1r3r4r�r7r,r,r,r-r,sH�








	
rcCstt|j�j|_|S)z*Copy docstring from SSLObject to SSLSocket)�getattrrr8rD)�funcr,r,r-�_sslcopydoc�sr:cseZdZdZdd�ZedX�fdd�	�Zeed	d
���Z	e	j
dd
��Z	eedd
���Zej
dd
��Zeedd���Zdd�Z
dYdd�Zdd�ZdZdd�Zdd�Zed[dd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd\�fd)d*�	Zd]�fd+d,�	Zd-d.�Zd^�fd/d0�	Zd_�fd1d2�	Zd`�fd3d4�	Zda�fd5d6�	Zdb�fd7d8�	Zdc�fd9d:�	Z d;d<�Z!d=d>�Z"ed?d@��Z#�fdAdB�Z$edCdD��Z%edEdF��Z&�fdGdH�Z'edddIdJ��Z(�fdKdL�Z)dMdN�Z*dOdP�Z+�fdQdR�Z,ededTdU��Z-edVdW��Z.�Z/S)f�	SSLSocketz�This class implements a subtype of socket.socket that wraps
    the underlying OS socket in an SSL context when necessary, and
    provides read and write methods over that channel. cOst|jj�d���dS)NzX does not have a public constructor. Instances are returned by SSLContext.wrap_socket().rrr,r,r-r�s�zSSLSocket.__init__FTNc

s�|�tt�tkrtd��|r8|r(td��|dk	r8td��|jrJ|sJtd��t|j|j	|j
|��d�}|j|f|�}	t
t|	�jf|�|	�|���|��||	_||	_d|	_d|	_||	_|�|�|	_||	_||	_z|	��Wn6tk
�r}
z|
jtjkr��d}W5d}
~
XYnXd}||	_ |�r�zH|	jj!|	||	j|	|	jd�|	_|�rj|	��}|d	k�rbtd
��|	�"�Wn$ttfk
�r�|	�#��YnX|	S)Nz!only stream sockets are supportedz4server_hostname can only be specified in client modez,session can only be specified in client modez'check_hostname requires server_hostname)�family�type�proto�filenoFT�rr��zHdo_handshake_on_connect should not be specified for non-blocking sockets)$Z
getsockoptrr�r}�NotImplementedErrorr�r�dictr<r=r>r?r�r�r;r�
settimeout�
gettimeout�detach�_context�_sessionZ_closedrr�r�r�r�r��getpeernamer��errnoZENOTCONN�
_connected�_wrap_socketr1�close)
r�r�r�r�r�r�r�r�r�r��eZ	connected�timeoutr�r,r-r��sj
��
zSSLSocket._createcCs|jSr�)rGr�r,r,r-r�szSSLSocket.contextcCs||_||j_dSr�)rGrr�rr,r,r-r�scCs|jdk	r|jjSdSr�rr�r,r,r-r� s
zSSLSocket.sessioncCs||_|jdk	r||j_dSr�)rHrr�r r,r,r-r�&s
cCs|jdk	r|jjSdSr�r!r�r,r,r-r",s
zSSLSocket.session_reusedcCstd|jj��dS)NzCan't dup() %s instances)rBr�r8r�r,r,r-�dup2s�z
SSLSocket.dupcCsdSr�r,)r��msgr,r,r-�_checkClosed6szSSLSocket._checkClosedcCs|js|��dSr�)rKrIr�r,r,r-�_check_connected:szSSLSocket._check_connectedr#c
Cs�|��|jdkrtd��z*|dk	r4|j�||�WS|j�|�WSWnVtk
r�}z8|jdtkr�|jr�|dk	r|WY�dSWY�dSn�W5d}~XYnXdS)zORead up to LEN bytes and return them.
        Return zero-length string on EOF.Nz'Read on closed or unwrapped SSL socket.rr/)rRrr�r$rr�Z
SSL_ERROR_EOFr�)r�r�r%�xr,r,r-r$Bs

zSSLSocket.readcCs&|��|jdkrtd��|j�|�S)zhWrite DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted.Nz(Write on closed or unwrapped SSL socket.)rRrr�r'r(r,r,r-r'Ws
zSSLSocket.writecCs|��|��|j�|�Sr�)rRrSrr)r*r,r,r-r)`szSSLSocket.getpeercertcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr+r�r,r,r-r+fszSSLSocket.selected_npn_protocolcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr,r�r,r,r-r,nsz SSLSocket.selected_alpn_protocolcCs$|��|jdkrdS|j��SdSr�)rRrr-r�r,r,r-r-vs
zSSLSocket.ciphercCs$|��|jdkrdS|j��SdSr�)rRrr.r�r,r,r-r.~s
zSSLSocket.shared_cipherscCs$|��|jdkrdS|j��SdSr�)rRrr/r�r,r,r-r/�s
zSSLSocket.compressionrcsF|��|jdk	r4|dkr(td|j��|j�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to send() on %s)rRrr�r�r'r��send)r�r�r
r�r,r-rU�s
��zSSLSocket.sendcsL|��|jdk	r"td|j��n&|dkr8t��||�St��|||�SdS)Nz%sendto not allowed on instances of %s)rRrr�r�r��sendto)r�r�Z
flags_or_addrr�r�r,r-rV�s
�zSSLSocket.sendtocOstd|j��dS)Nz&sendmsg not allowed on instances of %s�rBr�rr,r,r-�sendmsg�s�zSSLSocket.sendmsgc
s�|��|jdk	r�|dkr(td|j��d}t|��H}|�d��2}t|�}||krn|�||d��}||7}qJW5QRXW5QRXnt��	||�SdS)Nrz6non-zero flags not allowed in calls to sendall() on %s�B)
rRrr�r��
memoryview�castr�rUr��sendall)r�r�r
r�ZviewZ	byte_viewZamountr&r�r,r-r\�s
�� zSSLSocket.sendallcs,|jdk	r|�|||�St��|||�SdS)z�Send a file, possibly by using os.sendfile() if this is a
        clear-text socket.  Return the total number of bytes sent.
        N)rZ_sendfile_use_sendr��sendfile)r��file�offsetr�r�r,r-r]�s
zSSLSocket.sendfilecsD|��|jdk	r2|dkr(td|j��|�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to recv() on %s)rRrr�r�r$r��recv�r�Zbuflenr
r�r,r-r`�s
��
zSSLSocket.recvcsj|��|r|dkrt|�}n|dkr*d}|jdk	rV|dkrJtd|j��|�||�St��|||�SdS)Nr#rz8non-zero flags not allowed in calls to recv_into() on %s)rRr�rr�r�r$r��	recv_into�r�r%�nbytesr
r�r,r-rb�s

��zSSLSocket.recv_intocs4|��|jdk	r"td|j��nt��||�SdS)Nz'recvfrom not allowed on instances of %s)rRrr�r�r��recvfromrar�r,r-re�s
�zSSLSocket.recvfromcs6|��|jdk	r"td|j��nt��|||�SdS)Nz,recvfrom_into not allowed on instances of %s)rRrr�r�r��
recvfrom_intorcr�r,r-rf�s
�zSSLSocket.recvfrom_intocOstd|j��dS)Nz&recvmsg not allowed on instances of %srWrr,r,r-�recvmsg�s�zSSLSocket.recvmsgcOstd|j��dS)Nz+recvmsg_into not allowed on instances of %srWrr,r,r-�recvmsg_into�s�zSSLSocket.recvmsg_intocCs$|��|jdk	r|j��SdSdS)Nr)rRrr0r�r,r,r-r0�s

zSSLSocket.pendingcs|��d|_t��|�dSr�)rRrr�r2)r�Zhowr�r,r-r2�szSSLSocket.shutdowncCs.|jr|j��}d|_|Stdt|���dS�NzNo SSL wrapper around )rr2r�r�)r��sr,r,r-r3s

zSSLSocket.unwrapcCs$|jr|j��Stdt|���dSri)rr7r�r�r�r,r,r-r7s
z&SSLSocket.verify_client_post_handshakecsd|_t���dSr�)rr��_real_closer�r�r,r-rkszSSLSocket._real_closec	CsF|��|��}z$|dkr(|r(|�d�|j��W5|�|�XdS)NrA)rSrErDrr1)r��blockrOr,r,r-r1s
zSSLSocket.do_handshakec	s�|jrtd��|js|jdk	r&td��|jj|d|j||jd�|_z@|rVt��	|�}nd}t��
|�|s~d|_|jr~|��|WSt
tfk
r�d|_�YnXdS)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!Fr@T)r�r�rKrr�rLr�rHr��
connect_ex�connectr�r1r�)r�r�rmZrcr�r,r-�
_real_connect!s0�zSSLSocket._real_connectcCs|�|d�dS)�QConnects to remote ADDR, and then wraps the connection in
        an SSL channel.FN�ro�r�r�r,r,r-rn;szSSLSocket.connectcCs|�|d�S)rpTrqrrr,r,r-rm@szSSLSocket.connect_excs.t���\}}|jj||j|jdd�}||fS)z�Accepts a new connection from a remote client, and returns
        a tuple containing that new connection wrapped with a server-side
        SSL channel, and the address of the remote client.T)r�r�r�)r��acceptr�r�r�r�)r�Znewsockr�r�r,r-rsEs�zSSLSocket.acceptr�cCs4|jdk	r|j�|�S|tkr,td�|���dSdS)Nz({0} channel binding type not implemented)rr4�CHANNEL_BINDING_TYPESr�r�r5r,r,r-r4Qs
�zSSLSocket.get_channel_bindingcCs|jdk	r|j��SdSdSr�r6r�r,r,r-r�\s

zSSLSocket.version)FTTNNN)N)r#N)F)r)N)r)rN)r#r)Nr)r#r)Nr)F)r�)0r8r9r:rDrr�r�rr:r�rr�r"rPrRrSr$r'r)r+r,r-r.r/rUrVrXr\r]r`rbrerfrgrhr0r2r3r7rkr1rornrmrsr4r�r�r,r,r�r-r;�s��>



	











r;Tc
Csl|r|std��|r |s td��t|�}
||
_|r<|
�|�|rL|
�||�|	rZ|
�|	�|
j||||d�S)Nz5certfile must be specified for server-side operationsr)r�r�r�r�)r�r�rr�rZset_ciphersr�)r�rrr�r�ssl_version�ca_certsr�r�Zciphersr�r,r,r-r�is$

�r�cCs�ddlm}ddlm}d}d}z|�|dd����d}Wn$tk
rbtd	||f��Yn0X||dd�|�}||d|f|d
d��SdS)a�Return the time in seconds since the Epoch, given the timestring
    representing the "notBefore" or "notAfter" date from a certificate
    in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).

    "notBefore" or "notAfter" dates must use UTC (RFC 5280).

    Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    UTC should be specified as GMT (see ASN1_TIME_print())
    r)�strptime)�timegm)ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecz %d %H:%M:%S %Y GMTNrjrhz*time data %r does not match format "%%b%s"rirm)�timerwZcalendarrx�index�titler�)Z	cert_timerwrxZmonthsZtime_formatZmonth_numberZttr,r,r-�cert_time_to_seconds�s
�r|z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----csRtt�|�dd��tg}|�fdd�tdt��d�D�7}|�td�d�|�S)z[Takes a certificate in binary DER format and returns the
    PEM version of it as a string.�ASCII�strictcsg|]}�||d��qS)�@r,)r4�i��fr,r-�
<listcomp>�sz(DER_cert_to_PEM_cert.<locals>.<listcomp>rr�
)	r��base64Zstandard_b64encode�
PEM_HEADER�ranger�r��
PEM_FOOTERr�)Zder_cert_bytesZssr,r�r-�DER_cert_to_PEM_cert�s
"r�cCs\|�t�stdt��|���t�s0tdt��|��tt�tt��}t�|�	dd��S)zhTakes a certificate in ASCII PEM format and returns the
    DER-encoded version of it as a byte sequencez(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %sr}r~)
r)r�r��strip�endswithr�r�r�Zdecodebytesr�)Zpem_cert_string�dr,r,r-�PEM_cert_to_DER_cert�s
��r�c

Csd|\}}|dk	rt}nt}t|||d�}t|��&}|�|��}|�d�}	W5QRXW5QRXt|	�S)z�Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If 'ca_certs' is specified, validate the server cert against it.
    If 'ssl_version' is specified, use it in the connection attempt.N)rr�T)r
r�_create_stdlib_contextr~r�r)r�)
r�rurvZhostZportrr�r�ZsslsockZdercertr,r,r-�get_server_certificate�s�
r�cCst�|d�S)Nz	<unknown>)�_PROTOCOL_NAMESr�)Z
protocol_coder,r,r-�get_protocol_name�sr�)nrDr�r��collectionsr�enumrZ_EnumrZ_IntEnumrZ_IntFlagr;rrrr	r
rrr
rrrrrrr�rr�rrrrr�ImportErrorrrrrrrr r!r"r#r$r%�	_convert_r8r&rr'�__members__�itemsr�r8Z_SSLv2_IF_EXISTSr7r=rHrgr�ryrzr{r|r}r~rr�r�r�rJr�r�Zsocket_errorrtrZHAS_NEVER_CHECK_COMMON_NAMEZ_RESTRICTED_SERVER_CIPHERSr�r�r�r�r�r�r�r�r�r�r�rrrZ_create_default_https_contextr�rr:r;r�r�r�r|r�r�r�r�r�r�r,r,r,r-�<module>s�Y$0������
)
1#9�z�#�/�


zipimport.cpython-38.opt-2.pyc000064400000032527151450073350012205 0ustar00U

e5d-x�@sNddlZddlmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddgZejZej
dd�ZGdd�de�ZiZee	�ZdZdZd	ZGd
d�d�Zedddfed
ddfddfZdd�Zdd�Zdd�Zdd�ZdZdadd�Zdd�Z dd�Z!d d!�Z"ee"j#�Z$d"d#�Z%d$d%�Z&d&d'�Z'd(d)�Z(d*d+�Z)d,d-�Z*Gd.d/�d/�Z+dS)0�N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter�c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�!/usr/lib64/python3.8/zipimport.pyr!s�sPKi��c@sheZdZdd�Zddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rc	Cs$t|t�sddl}|�|�}|s,td|d��tr<|�tt�}g}zt�	|�}WnHt
tfk
r�t�|�\}}||kr�td|d��|}|�
|�Yq@X|jd@dkr�td|d��q�q@zt|}Wn$tk
r�t|�}|t|<YnX||_||_tj|ddd��|_|j�r |jt7_dS)Nrzarchive path is empty��pathznot a Zip filei�i����)�
isinstance�str�os�fsdecoder�alt_path_sep�replace�path_sep�_bootstrap_external�
_path_stat�OSError�
ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive�
_path_join�prefix)�selfrrr$�st�dirname�basename�filesr
r
r�__init__?s:

zzipimporter.__init__NcCsNt||�}|dk	r|gfSt||�}t||�rFd|j�t�|��gfSdgfS�N)�_get_module_info�_get_module_path�_is_dirr"r)r%�fullnamer�mi�modpathr
r
r�find_loaderms



zzipimporter.find_loadercCs|�||�dS)Nr)r2)r%r/rr
r
r�find_module�s	zzipimporter.find_modulecCst||�\}}}|Sr+��_get_module_code�r%r/�code�	ispackager1r
r
r�get_code�szzipimporter.get_codecCsvtr|�tt�}|}|�|jt�r:|t|jt�d�}z|j|}Wn tk
rhtdd|��YnXt	|j|�S)Nr�)
rrr�
startswithr"�lenr!rr�	_get_data)r%�pathname�key�	toc_entryr
r
r�get_data�szzipimporter.get_datacCst||�\}}}|Sr+r4r6r
r
r�get_filename�szzipimporter.get_filenamecCs�t||�}|dkr$td|��|d��t||�}|r@t�|d�}n
|�d�}z|j|}Wntk
rnYdSXt|j|��	�S)N�can't find module ��name�__init__.py�.py)
r,rr-rr#r!rr=r"�decode)r%r/r0r�fullpathr@r
r
r�
get_source�s


zzipimporter.get_sourcecCs(t||�}|dkr$td|��|d��|S)NrCrD)r,r)r%r/r0r
r
r�
is_package�s
zzipimporter.is_packagecCs�t||�\}}}tj�|�}|dks.t|t�s@t|�}|tj|<||_zT|rlt||�}t�	|j
|�}|g|_t|d�s|t
|_
t�|j||�t||j�Wntj|=�YnXztj|}Wn$tk
r�td|�d���YnXt�d||�|S)N�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r5�sys�modules�getr�_module_type�
__loader__r-rr#r"�__path__�hasattrrL�_fix_up_module�__dict__�execr�ImportError�
_bootstrap�_verbose_message)r%r/r7r8r1�modrrIr
r
r�load_module�s0


zzipimporter.load_modulecCsXz|�|�sWdSWntk
r*YdSXtjsNddlm}|�t�dt_t||�S)Nr)�ResourceReaderT)rKr�_ZipImportResourceReader�_registered�
importlib.abcr\�register)r%r/r\r
r
r�get_resource_readers


zzipimporter.get_resource_readercCsd|j�t�|j�d�S)Nz<zipimporter object "z">)r"rr$)r%r
r
r�__repr__"szzipimporter.__repr__)N)N)rrr	r*r2r3r9rArBrJrKr[rarbr
r
r
rr-s.
 


&z__init__.pycTrFF)z.pycTF)rGFFcCs|j|�d�dS)N�.�)r$�
rpartition)r%r/r
r
rr-4sr-cCs|t}||jkSr+)rr!)r%r�dirpathr
r
rr.8sr.cCs8t||�}tD]$\}}}||}||jkr|SqdSr+)r-�_zip_searchorderr!)r%r/r�suffix�
isbytecoder8rIr
r
rr,As


r,c	Cs�zt�|�}Wn&tk
r4td|��|d��YnX|���z$|�td�|��}|�t�}Wn&tk
r�td|��|d��YnXt|�tkr�td|��|d��|dd�t	k�r�z|�dd�|��}Wn&tk
r�td|��|d��YnXt
|ttd�}z|�|�|��}Wn(tk
�rJtd|��|d��YnX|�t	�}|dk�rrtd|��|d��|||t�}t|�tk�r�td|��|d��|t|�|}t
|d	d
��}t
|d
d��}	||k�r�td|��|d��||	k�r
td
|��|d��||8}||	}
|
dk�r6td|��|d��i}d}z|�|�Wn(tk
�rttd|��|d��YnX|�d�}t|�dk�r�td��|dd�dk�r��q�t|�dk�r�td��t|dd��}
t|dd	��}t|d	d��}t|dd
��}t
|d
d��}t
|dd��}t
|dd��}t|dd��}t|dd��}t|dd��}t
|dd��}|||}||	k�r�td|��|d��||
7}z|�|�}Wn(tk
�r�td|��|d��YnXt|�|k�r�td|��|d��z2t|�||��||k�r*td|��|d��Wn(tk
�rTtd|��|d��YnX|
d@�rj|��}n6z|�d�}Wn&tk
�r�|�d��t�}YnX|�dt�}t�||�}||||||||f}|||<|d 7}�qvW5QRXt�d!||�|S)"Nzcan't open Zip file: r
rd�can't read Zip file: �rznot a Zip file: zcorrupt Zip file: ���zbad central directory size: zbad central directory offset: z&bad central directory size or offset: �.�EOF read where not expectedsPK��
����� �"�*zbad local header offset: i�ascii�latin1�/rz!zipimport: found {} names in {!r})�_io�	open_coderr�seek�END_CENTRAL_DIR_SIZE�tell�readr<�STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr�EOFErrorrrH�UnicodeDecodeError�	translate�cp437_tablerrrr#rXrY)r"�fp�header_position�buffer�	file_size�max_comment_start�data�pos�header_size�
header_offset�
arc_offsetr)�count�flags�compress�time�date�crc�	data_size�	name_size�
extra_size�comment_size�file_offsetrEr�tr
r
rr `s�
���

�


�
�






r u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsltrt�d�td��daz<zddlm}Wn&tk
rRt�d�td��YnXW5daXt�d�|S)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTFr��
decompresszzipimport: zlib available)�_importing_zlibrXrYr�zlibr��	Exceptionr�r
r
r�_get_decompress_func�s


r�c	Cs�|\}}}}}}}}	|dkr$td��t�|���}
z|
�|�Wn&tk
rftd|��|d��YnX|
�d�}t|�dkr�td��|dd�dkr�td	|��|d��t|d
d��}t|dd��}
d||
}||7}z|
�|�Wn(tk
�rtd|��|d��YnX|
�|�}t|�|k�r4td��W5QRX|dk�rL|Sz
t	�}Wnt
k
�rttd
��YnX||d�S)Nrznegative data sizerjr
rvrprksPKzbad local file header: �ruzzipimport: can't read datar�i�)rr}r~rrr�r<r�rr�r�)r"r@�datapathr�r�r�r�r�r�r�r�r�r�r�r��raw_datar�r
r
rr=s>



r=cCst||�dkS)Nr)�abs)�t1�t2r
r
r�	_eq_mtimeAsr�cCs<||d�}zt�|||�}Wntk
r2YdSX|d@dk}|r�|d@dk}tjdkr�|shtjdkr�t||�}	|	dk	r�t�tj|	�}
zt�||
||�Wntk
r�YdSXnTt	||�\}}|�r
t
t|dd��|�r�t|dd	��|k�r
t�
d
|���dSt�|d	d��}
t|
t��s8td|�d���|
S)
N)rErrrrd�never�alwaysrqrlrmzbytecode is stale for zcompiled module z is not a code object)r�
_classify_pycrW�_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer�rrXrY�marshal�loadsr�
_code_type�	TypeError)r%r>rIr/r��exc_detailsr��
hash_based�check_source�source_bytesr��source_mtime�source_sizer7r
r
r�_unmarshal_codeKsX�
��
��
���r�cCs|�dd�}|�dd�}|S)Ns
�
�
)r)�sourcer
r
r�_normalize_line_endings~sr�cCst|�}t||ddd�S)NrVT)�dont_inherit)r��compile)r>r�r
r
r�_compile_source�sr�cCsDt�|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	�S)
N�	i������?rdr)r��mktime)�dr�r
r
r�_parse_dostime�s



�r�c
Cs`z>|dd�}|j|}|d}|d}|d}t||�|fWStttfk
rZYdSXdS)Nrr���)rr)r!r�r�
IndexErrorr�)r%rr@r�r��uncompressed_sizer
r
rr��s
r�cCsB|dd�}z|j|}Wntk
r0YdSXt|j|�SdS)Nr)r!rr=r")r%rr@r
r
rr��sr�c	Cs�t||�}tD]�\}}}||}tjd|jt|dd�z|j|}Wntk
rXYqX|d}t|j|�}	|r�t	|||||	�}
n
t
||	�}
|
dkr�q|d}|
||fSqtd|��|d��dS)Nz
trying {}{}{}rd)�	verbosityrrCrD)r-rgrXrYr"rr!rr=r�r�r)r%r/rrhrir8rIr@r1r�r7r
r
rr5�s$

r5c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
r]FcCs||_||_dSr+)rr/)r%rr/r
r
rr*�sz!_ZipImportResourceReader.__init__cCs\|j�dd�}|�d|��}ddlm}z||j�|��WStk
rVt|��YnXdS)Nrcr|r)�BytesIO)r/r�ior�rrAr�FileNotFoundError)r%�resource�fullname_as_pathrr�r
r
r�
open_resource�sz&_ZipImportResourceReader.open_resourcecCst�dSr+)r�)r%r�r
r
r�
resource_path�sz&_ZipImportResourceReader.resource_pathcCsH|j�dd�}|�d|��}z|j�|�Wntk
rBYdSXdS)Nrcr|FT)r/rrrAr)r%rEr�rr
r
r�is_resource�sz$_ZipImportResourceReader.is_resourcec		cs�ddlm}||j�|j��}|�|jj�}|j}t�}|jj	D]f}z||��|�}Wnt
k
rnYq@YnX|jj}t|�dkr�|jVq@||kr@|�
|�|Vq@dS)Nr)�Path)�pathlibr�rrBr/�relative_tor"�parent�setr!rrEr<�add)	r%r��
fullname_path�
relative_path�package_path�subdirs_seen�filename�relative�parent_namer
r
r�contents�s 


z!_ZipImportResourceReader.contentsN)	rrr	r^r*r�r�r�r�r
r
r
rr]�s	r]),�_frozen_importlib_externalrrr�_frozen_importlibrXr�r}r�rMr��__all__r�path_separatorsrrWrr�typerPr�r�r�rrgr-r.r,r r�r�r�r=r�r��__code__r�r�r�r�r�r�r5r]r
r
r
r�<module>sV�		~�.
.

pydoc.cpython-38.opt-1.pyc000064400000242752151450073350011270 0ustar00U

��.e̠�@s�dZdgZdZdZdZddlZddlZddlZddl	Zddl
ZddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd	lmZd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$e�%dej&�Z'dd�Z(dd�Z)dd�Z*dd �Z+dxd!d"�Z,d#d$�Z-d%d&�Z.d'd(�Z/d)d*�Z0ifd+d,�Z1Gd-d.�d.e2�Z3d/d0�Z4difd1d2�Z5Gd3d4�d4�Z6Gd5d6�d6e�Z7Gd7d8�d8e6�Z8Gd9d:�d:e�Z9Gd;d<�d<e6�Z:Gd=d>�d>e:�Z;d?d@�a<dAdB�Z=dCdD�Z>dEdF�Z?dGdH�Z@dIdJ�ZAdKdL�ZBdMdN�ZCdOdP�ZDdydQdR�ZEe:�ZFe;�ZGe8�ZHdzdSdT�ZId{dVdW�ZJd|dXdY�ZKd}dZd[�ZLd~d]d^�ZMGd_d`�d`�ZNeN�ZOGdadb�db�ZPdcdd�ZQdedf�ZRddhdi�ZSd�djdkdl�dmdn�ZTdodp�ZUdqdr�ZVdsdt�ZWdudv�ZXeYdwk�r�eX�dS)�aGenerate Python documentation in HTML or text for interactive use.

At the Python interactive prompt, calling help(thing) on a Python object
documents the object, and calling help() starts up an interactive
help session.

Or, at the shell command line outside of Python:

Run "pydoc <name>" to show documentation on something.  <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package.  If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.

Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.

Run "pydoc -n <hostname>" to start an HTTP server with the given
hostname (default: localhost) on the local machine.

Run "pydoc -p <port>" to start an HTTP server on the given port on the
local machine.  Port number 0 can be used to get an arbitrary unused port.

Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
open a Web browser to interactively browse documentation.  Combine with
the -n and -p options to control the hostname and port used.

Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".

Module docs for core modules are assumed to be in

    https://docs.python.org/X.Y/library/

This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
�helpzKa-Ping Yee <ping@lfw.org>z26 February 2001z�Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
�N)�deque)�Repr)�format_exception_onlycCs\g}g}tjD]H}tj�|pd�}tj�|�}||krtj�|�r|�|�|�|�q|S)zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir�r�/usr/lib64/python3.8/pydoc.py�pathdirsPs

rcCs.t�|�pt�|�}|r*t�dd|���p,dS)z-Get the doc string or comments for an object.z^ *
�)�inspect�getdocZgetcomments�re�sub�rstrip)�object�resultrrrr\srcCsf|���d�}t|�dkr&|ddfSt|�dkrX|d��sX|dd�|dd��fSdd�|�fS)z>Split a doc string into a synopsis line (if any) and the rest.�
�rr�N)�strip�split�lenr�join)�doc�linesrrr�splitdocasr$cCs"|j}|j|kr|jd|}|S)z@Get a class name and qualify it with a module name if necessary.r)�__name__�
__module__)r�modname�namerrr�	classnamejs
r)cCs>t�|�p:t�|�p:t�|�p:t�|�p:t�|�p:t�|�S)z>Check if an object is of a type that probably means it's data.)r�ismodule�isclass�	isroutineZisframeZistracebackZiscode�rrrr�isdataqs����r.cGs.|r*|d�|�|d��}|dd�}q|S)z/Do a series of global replacements on a string.rrrN)r!r)�textZpairsrrr�replacewsr0cCsXt|�|krTtd|dd�}td|d|�}|d|�d|t|�|d�S|S)zCOmit part of a string if needed to make it fit in a maximum length.r�rN�...)r �max)r/�maxlenZpreZpostrrr�cram~s
$r5z at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)z>Remove the hexadecimal id from a Python object representation.z\1)�_re_stripidr�r/rrr�stripid�sr8cCs<t�|�rdSt�|�r8t|dd�}t�|�p4|dkSdS)zo
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    T�__self__NF)r�ismethod�	isbuiltin�getattrr*)�fn�selfrrr�_is_bound_method�s

r?cCs^i}t�|tj�D]\}}d||<q|jD]}|�t|��q*|��D]}t||�||<qF|S�Nr)r�
getmembersr,�	__bases__�update�
allmethods�keysr<)�cl�methods�key�value�baserrrrD�s

rDcCs8g}g}|D]"}||�r$|�|�q|�|�q||fS)z�Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    �r
)�s�	predicateZyesZno�xrrr�_split_list�srOcCs\|dkrdS|�d�r$|�d�r$dS|�d�r<t|d�r<dS|dk	rL||kS|�d�SdS)	z3Decide whether to show documentation on a variable.>�	__slots__�__date__�__path__�__qualname__�__builtins__�__credits__�__doc__�
__author__�__version__�__file__r%�
__cached__r&�
__loader__�__spec__�__package__r�__r�_�_fieldsTN)�
startswith�endswith�hasattr)r(�all�objrrr�visiblename�srfcCsXg}t�|�D]D\}}}}t�|�r@d}t|t�r@|jdkr@d}|�||||f�q|S)zCWrap inspect.classify_class_attrs, with fixup for data descriptors.�data descriptorN�readonly property)r�classify_class_attrs�isdatadescriptor�
isinstance�property�fsetr
)r�resultsr(�kind�clsrIrrrri�s
rics\t|dg��z�fdd�t��D��Wntk
r>i�YnX�fdd�}|j|d�dS)zGSort the attrs list in-place by _fields and then alphabetically by namer`csi|]\}}||t���qSr)r )�.0�ir()�fieldsrr�
<dictcomp>�sz#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)�get)�attr)�field_orderrr�<lambda>��z!sort_attributes.<locals>.<lambda>�rHN)r<�	enumerate�	TypeError�sort)�attrsrZkeyfuncr)rxrsr�sort_attributes�s
r�cCs:tj�|�r6dD]$}tj�tj�|d|��rdSqdS)z3Guess whether a path refers to a package directory.)z.pyz.pyc�__init__TF)r	rr�isfiler!)r�extrrr�	ispackage�s
r�cCs�|��}|dd�dks |��s0|��}|sq0q|��}|dd�dkrT|dd�}|dd�dkr�|dd�}|dd�dkr�|dd�}|��s�|��}|s�q�q�|�d�d	��}nd}|S)
Nr�#�zr"""r1�"""����\r)�readlinerr)�file�linerrrr�source_synopsis�s&r�c
	Cs t�|�j}|�|d�\}}|dks.||k�r|�ttjj��rJtjj	}n |�ttjj
��rftjj}nd}|dkr�zt�
|�}Wntk
r�YdSX|�t|�}W5QRXn^|d|�}tjjd||d�}ztj�|�}	WnYdSXtjd=|	j�r|	j��dnd}||f||<|S)z.Get the one-line summary out of a module file.)NNNZ__temp__��loaderr)r	�stat�st_mtimervrb�tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr�modulesrV�
splitlines)
�filename�cache�mtimeZ
lastupdaterZ
loader_clsr�r��spec�modulerrr�synopsis�s6



�r�c@s eZdZdZdd�Zdd�ZdS)�ErrorDuringImportzEErrors that occurred while trying to import something to document it.cCs||_|\|_|_|_dS�N)r��excrI�tb)r>r��exc_inforrrr�#szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r%r�rI)r>r�rrr�__str__'szErrorDuringImport.__str__N)r%r&rSrVr�r�rrrrr�!sr�c		Cs�tjj}t|d��}||�t|��k}W5QRXtj�|�}tj�	|�\}}|r`tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����YnXdS)z<Import a Python source file or compiled file given its path.�rbr�N)r�r��MAGIC_NUMBERr��readr r	r�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r�magicr�Zis_bytecoder�r(r�r�r�rrr�
importfile+sr�c	s z^|rT�tjkrT�tjkrT�fdd�tjD�}�g|D]}tj|||<tj|=q8t��}Wnzt��\}}}}	�tjkr�ttj�j|	��n>|tkr�t|j|	��n(t	|t
�r�|j�kr�YdSt�t����YnX��d�dd�D].}
zt
||
�}Wq�tk
�rYdSXq�|S)a�Import a module; handle errors; return None if the module isn't found.

    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning.  If the optional 'forceload' argument
    is 1, we reload the module from disk (unless it's a dynamic extension).csg|]}|��d�r|�qS)r)ra)rq�m�rrr�
<listcomp>Qszsafeimport.<locals>.<listcomp>Nrr)rr��builtin_module_names�
__import__r�r�rY�SyntaxErrorr��
issubclass�ImportErrorr(rr<�AttributeError)r�	forceloadr�ZsubsrHr�r�rIr��info�partrr�r�
safeimport=s.


r�c@sfeZdZej�ddejdd��Zddd�Z	d
dd�Z
e
ZZZ
ZZZe�d	�fd
d�ZdS)�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrcGs�||f|}zFt�|�r$|j|�WSt�|�r:|j|�WSt�|�rP|j|�WSWntk
rfYnXt�|�r||j	|�S|j
|�S)z%Generate documentation for an object.)rr*�	docmoduler+�docclassr,�
docroutiner�rj�docdata�docother)r>rr(�argsrrr�documentss




zDoc.documentcGs*d|odt|�t|�jf}t|��dS)z+Raise an exception for unimplemented types.z.don't know how to document object%s of type %s� N)�repr�typer%r})r>rr(r��messagerrr�fail�s
�zDoc.failZstdlibcCs�zt�|�}Wntk
r&d}YnXtj�d|j�}tj�|�}t	|t
t��r�|jdksz|�|�r�|�tj�
|d��s�|jdkr�|�d�r�d|�d�|j��f}q�tj�
||j��d	�}nd
}|S)z*Return the location of module docs or None�
(built-in)r�)
�errno�
exceptionsZgcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z%s/%s�/�.htmlN)r�
getabsfiler}r	�environrvr�rrrkr�r%rar!r�lower)r>rZbasedirr��doclocrrr�	getdocloc�s(
����
z
Doc.getdocloc)N)N)r%r&rSr	r�rvr�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfigZget_pathr�rrrrr�ms��

r�c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZeZ	dd
�Z
eZdS)�HTMLReprzBClass for safely making an HTML representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r>rrrr��s
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)r0�r>r/rrr�escape�szHTMLRepr.escapecCst�||�Sr�)rr��r>rrrrr��sz
HTMLRepr.reprcCsZtt|�d�r@dd�t|�j���}t||�r@t||�||�S|�ttt	|��|j
��S�Nr%�repr_r_)rcr�r!r%rr<r�r5r8r�r��r>rN�levelZ
methodnamerrr�repr1�s

zHTMLRepr.repr1cCs^t||j�}t|�}d|krJdt|dd�krJd|d|�|�|dSt�dd|�|��S)Nr��\\r�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r5r�r�r0r�rr�r>rNr�ZtestZtestreprrrr�repr_string�s�zHTMLRepr.repr_stringcCs@z|�ttt|��|j��WS|�d|jj�YSXdS�Nz
<%s instance>)r�r5r8r�r��	__class__r%�r>rNr�rrr�
repr_instance�szHTMLRepr.repr_instanceN)r%r&rSrVr�r�r�r�r��repr_strrZrepr_unicoderrrrr��sr�c@seZdZdZe�ZejZejZdd�Zd1dd�Z	d2d
d�Z
dd
�Zdd�Zd3dd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd �Zd4d!d"�Zd5d#d$�Zddiifd%d&�Zd'd(�Zddiiidfd)d*�Zd6d+d,�ZeZd7d-d.�Zd8d/d0�ZdS)9�HTMLDocz'Formatter class for HTML documentation.cCsd||fS)�Format an HTML page.z�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>r)r>�title�contentsrrr�page�s�zHTMLDoc.pagercCsd|||||pdfS)zFormat a page heading.a'
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    �&nbsp;r)r>r�fgcol�bgcolZextrasrrr�heading�s�zHTMLDoc.heading�Nrc	
Cs^|dkrdd|d}d|||f}	|r@|	d||||f}	n|	d|||f}	|	d|S)	z Format a section with a heading.Nz<tt>rz</tt>z�<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r>rr	r
r�widthZpreludeZ
marginaliaZgaprrrr�section�s�
��zHTMLDoc.sectioncGsd|}|j|f|��S)z$Format a section with a big heading.z<big><strong>%s</strong></big>)r)r>rr�rrr�
bigsectionszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)z!Format literal preformatted text.�

z
 
r�rr�<br>
)r��
expandtabsr0r�rrr�	preformat
s�zHTMLDoc.preformatr�cCs�d}t|�|d|}t|�D]X}|dd|}t|||||�D]$}|t|�krJ||||�d}qJ|d}q d|S)z0Format a list of items into a multi-column list.rrz<td width="%d%%" valign=top>r�rz</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r �range)r>�list�formatZcolsr�rows�colrrrrr�multicolumns
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rr�rrr�greyrzzHTMLDoc.greycGs*|D] }||krd|||fSq|S)z:Make a link for an identifier, given name-to-URL mappings.�<a href="%s">%s</a>r)r>r(Zdicts�dictrrr�namelinkszHTMLDoc.namelinkcCsN|jtj�|j�}}t||�rDt||�|krDd|j|t||�fSt||�S)zMake a link for a class.z<a href="%s.html#%s">%s</a>)r%rr�rvr&rcr<r))r>rr'r(r�rrr�	classlink%s�zHTMLDoc.classlinkcCsd|j|jfS)zMake a link for a module.�<a href="%s.html">%s</a>)r%r�rrr�
modulelink-szHTMLDoc.modulelinkcCsR|\}}}}|r|�|�S|r,d||f}nd|}|rBd|}n|}d||fS)z;Make a link for a module or package to display in an index.z
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)r)r)r>Z
modpkginfor(rr��shadowed�urlr/rrr�
modpkglink1s

zHTMLDoc.modpkglinkcCsd||fS)zMake a link to source file.z<a href="file:%s">%s</a>r)r>r"rrrr�filelink@szHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}|�||�}	|	s0�qh|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n�|r�dt|�}|�d|||�f�n�|�r"|||d�d	k�r|�d
|�	||��n|�d|�n@|||d�d	k�rP|�|�	||||��n|�|�	||��|}q|�|||d���d
�
|�S)z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;rz'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r�(zself.zself.<strong>%s</strong>Nr)r�r�compile�search�spanr
�groupsr0�intrr!)r>r/r��funcs�classesrGrn�here�pattern�match�start�endrdZschemeZrfcZpepZselfdotr(r"rrr�markupDs:

zHTMLDoc.markupc
Cs�d}|D]�}t|�td�kr�|\}}|d}||�||�}|r�||fkr�g}|D]}	|�|�|	|��qR|dd�|�d}|d}qt|�tg�kr|d|�|||�}qd	|S)
zAProduce HTML for a class tree as given by inspect.getclasstree().rrz"<dt><font face="helvetica, arial">r&�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r�rr
r!�
formattree)
r>�treer'�parentr�entry�c�bases�parentsrJrrrr6os&
�
zHTMLDoc.formattreec#
s�|j}z
|j}Wntk
r(d}YnX|�d�}g}tt|�d�D],}|�dd�|d|d��||f�qHd�||dd��}	d|	}
z&t�	|�}t
j�|�}��
||�}
Wntk
r�d}
YnXg}t|d��r6t|j�}|dd	�d
k�r"|dd�dk�r"|d	d���}|�d��|��t|d
��rX|���t|j���|�rp|
dd�|�}
��|�}|dk	�r�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|tj�D]Z\}}|dk	�s�t�|��p�||k�r�t|||��r�|�||f�d|||<||<�q�|D]�\}}|jD]n}|j|j}}tj �!|�}||k�r@|�r@t||��r@t"||�|k�r@||k�r@|d|||<||<�q@�q2gi}}t�|tj#�D]p\}}|dk	�s�t�$|��s�t�|�|k�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q�g}t�|t&�D]&\}}t|||��rN|�||f��qN��'t(|��j)||�}|�o�d|}|d|}t|d��rg}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n.|�r<��.|�fdd��}!|��0d dd|!�}|�r�d!d"�|D�}"��1t�2|"d�|�g}!|D]"\}}|!���3|||||���qj|��0d#dd$d%�|!��}|�r�g}!|D]"\}}|!���3|||||���q�|��0d&dd'd%�|!��}|�r:g}!|D]\}}|!���3||���q|��0d(dd)d*�|!��}t|d+��rn��'t|j4��j)�}!|��0d,dd|!�}t|d-��r���'t|j5��j)�}!|��0d.dd|!�}|S)/z/Produce HTML documentation for a module object.Nrrz5<a href="%s.html"><font color="#ffffff">%s</font></a>r��)<big><big><strong>%s</strong></big></big>r�rX��$Revision: �$z
version %srQz (%s)r4z-<br><a href="%(docloc)s">Module Reference</a>r�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
rRrzPackage Contentsz#aa55cccs��|d�Sr@)r ��tr�rrry�rzz#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|�qSrr�rqrHrIrrrr��sz%HTMLDoc.docmodule.<locals>.<listcomp>ZClasses�#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55rrWZAuthorrUZCredits)6r%�__all__r�rrr r
r!rr��urllib�parseZquoter$r}rc�strrXrr�rQr��localsrrAr*r+�	getmodulerfrBr&rr�rvr<r,r;�
isfunctionr.r3rr�pkgutil�iter_modulesrRr~rr#rr6�getclasstreer�rWrU)#r>rr(�mod�ignoredrd�partsZlinksrrZ
linkedname�headrr"r$r��versionr�rr�r-ZcdictrHrIrJr'r�r,Zfdict�datar"�modpkgs�importer�ispkgr�	classlistrr�rr��s*


��


$


�

�

 

���
��������zHTMLDoc.docmodulec	s��j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkr�����d�|D]}�d��|�j	��qd�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]n\}}}}d|d|�|<}zt�|�}Wntk
�r4YnXz|�|<Wq�t
k
�rXYq�Xq�|�rj|�rr|���n|dd�t|�fdd��\}}�tjk	�r��tjk�r�|}�q\n"��k�r�d}nd����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|}�q\d#�|	�}	||k�r�d$||f}nd%|||f}|�r�g}|D]}|���|�j	���q�|d&d'�|�}d#}zt���}Wntt
fk
�rd(}YnX|�r8t|�}|�r8|d)k�r8|��|�d*}t��}|�rT||�pPd#}��|�j����}|�otd+|}��|d,d-|	d.|�S)/z.Produce HTML documentation for a class object.cs eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dSru�Zneedoner�rrrr�sz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)Nz<hr>
rr[r���pushrr�maybe	sz.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r%r&rSr�r^rr\rr�HorizontalRulesr`rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|r�����|�|D]d\}}}}zt�|�}Wn&tk
rf���||���YnX���||��������d�q&|S)Nr�rOr^r<�	Exceptionr�r���msgrrM�okr(ro�homeclsrI�r-r,�hr�mdictrQrr]r>rr�spills"�
zHTMLDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr��rOr^r�rd�rirQr]r>rr�spilldescriptors+sz*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|r�����|�|D]�\}}}}��t�|�|��}t|�sXt�|�rft|dd�}	nd}	|	dkr��d|�n0��t|��j	����}	d|	}	�d||	f��d�q&|S)NrVz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rOr^r�r<�callablerrjr3rr)
rerrMrfr(rorgrIrJr"rhrr�	spilldata4s(�
z#HTMLDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS�)re�rf�rqr(rorprIr-rrr�Is
�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rcs|d�kS�NrrrC��	thisclassrrrybrzz"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scSs|ddkS�Nr�methodrrCrrrryrrzzClass methods %scSs|ddkS�Nrzclass methodrrCrrrrytrzzStatic methods %scSs|ddkS�Nrz
static methodrrCrrrryvrzzReadonly properties %scSs|ddkS�NrrhrrCrrrryxrzzData descriptors %scSs|ddkS�NrrgrrCrrrryzrzzData and other attributes %scSs|ddkS�NrrVrrCrrrry|rzrz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)r4N�()rz<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r1)r%rBr
rr�getmror r^rr&rir<rcr}�popleftrO�builtinsrr�r!�	signature�
ValueErrorrJr�rr3rr)r>rr(rQr,r-rR�realnamer;rr`�mrorJrkrnrprrHrorgrI�anchor�	inherited�tagrr<�declr��argspecr"r)	r-r,rirjrQrr]r>rwrr��s�
�
	
�

�

�
�
�
�
�
�

��
zHTMLDoc.docclasscCs|�d|�|��S�z)Format an argument default value as text.�=)rr�r�rrr�formatvalue�szHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jpdd|}	d}
d}t|�r�|jj}|rZ||k	r�d|�||�}
n0|jdk	rzd|�|jj|�}
nd|�||�}
t�|�s�t�|�r�d}
nd}
||kr�d	|	|f}nD|r�t�||g�|kr�d
|jd||f}d}n|}d|	||f}d}t�	|��rlzt�
|�}Wnttfk
�r>d}YnX|�rlt
|�}|d
k�rld|}|dd�}|�svd}|
||�|�|
�o�|�d|
�}|�r�d|S|�t|�|j|||�}|�o�d|}d||fSdS)z;Produce HTML documentation for a function or method object.rrtr� from N� method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %s�<lambda>z$<strong>%s</strong> <em>lambda</em> r��(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r%r?r9r�rr�iscoroutinefunction�isasyncgenfunction�getattr_staticr,r�r�r}rJr�rr3rr)r>rr(rQr,r-rGrFr�r��note�skipdocs�imclass�asyncqualifierrZreallinkr�r�r�r"rrrr��s|
�
���

��zHTMLDoc.docroutinecCsNg}|j}|r|d|�|�t|�|j�}|r<|d|�|d�d�|�S)z1Produce html documentation for a data descriptor.z!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
rar)r
r3rrr!�r>rr(rQrFrnr]r"rrrr��szHTMLDoc.docdatacGs|rd|pd}||�|�S)z-Produce HTML documentation for a data object.z<strong>%s</strong> = r�r�)r>rr(rQrRZlhsrrrr��szHTMLDoc.docothercCs�g}|dkri}t�|g�D]<\}}}tdd�|D��r:q|�|d|||kf�d||<q|��|�||j�}|�|dd|�S)z2Generate an HTML index for a directory of modules.Ncss*|]"}dt|�kodknVqdS)i�i��N)�ord�rqZchrrr�	<genexpr>�sz HTMLDoc.index.<locals>.<genexpr>rrrArF)rNrO�anyr
r~rr#r)r>rr!rWrXr(rYrrrr�index�s
z
HTMLDoc.index)r)rrNr)r�)N)NN)NNN)NN)N)r%r&rSrVr��_repr_instancer�r�rrrrrrrrrr r#r$r3r6r�r�r�r�r�r�r�r�rrrrr�sH

�

+

y&�
A

rc@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�TextReprzAClass for safely making a text representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dSr�r�r�rrrr�
s
zTextRepr.__init__cCsTtt|�d�r@dd�t|�j���}t||�r@t||�||�Sttt|��|j	�Sr�)
rcr�r!r%rr<r5r8r�r�r�rrrr�s

zTextRepr.repr1cCsHt||j�}t|�}d|krDdt|dd�krDd|d||dS|S)Nr�r�rr�r)r5r�r�r0r�rrrr�s
zTextRepr.repr_stringcCs4zttt|��|j�WSd|jjYSXdSr�)r5r8r�r�r�r%rrrrr%szTextRepr.repr_instanceN)	r%r&rSrVr�r�r�rrrrrrr�s	r�c@s~eZdZdZe�ZejZdd�Zddd�Zdd�Z	ddd�Z
dd
d�Zddd�Zdd�Z
ddd�Zddd�ZeZddd�Zd	S) �TextDocz'Formatter class for text documentation.cCsd�dd�|D��S)z(Format a string in bold by overstriking.rcss|]}|d|VqdS)�Nrr�rrrr�5szTextDoc.bold.<locals>.<genexpr>)r!r�rrr�bold3szTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r4|d��|d<d�|�S)z6Indent text by prepending a given prefix to each line.rcsg|]}�|�qSrr�rqr���prefixrrr�:sz"TextDoc.indent.<locals>.<listcomp>rr�)rrr!)r>r/r�r#rr�r�indent7szTextDoc.indentcCs$|�|���}|�|�d|dS)z&Format a section with a given heading.rr)r�rr�)r>rrZclean_contentsrrrr>szTextDoc.sectionNrc
	s�d}|D]�}t|�td�krr|\}}||t|��}|rh||fkrh�fdd�|D�}	|dd�|	�}|d}qt|�tg�kr||�|�||d�}q|S)	zBRender in text a class tree as returned by inspect.getclasstree().rrc3s|]}t|��VqdSr��r))rqr:�r'rrr�Msz%TextDoc.formattree.<locals>.<genexpr>r�r4rr�)r�r)r!r6)
r>r7r'r8r�rr9r:r;r<rr�rr6Es"
�zTextDoc.formattreec	Cs$|j}tt|��\}}|�d||o(d|�}t|dd�}|�|�}|dk	r`||�d|d�}|rt||�d|�}g}	t�|tj�D]<\}
}|dk	s�t�	|�p�||kr�t
|
||�r�|	�|
|f�q�g}t�|tj�D]F\}
}|dk	�st�
|��st�	|�|kr�t
|
||�r�|�|
|f�q�g}
t�|t�D]&\}
}t
|
||��r.|
�|
|f��q.g}t�}t|d��r�t�|j�D]6\}}}|�|�|�r�|�|d	�n
|�|��qx|��||�d
d�|��}g}t�|tj�D]0\}
}|j�|d��r�|
|k�r�|�|
��q�|�r6|��||�d
d�|��}|	�r�dd�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���qd||�dd�|��}|�r�g}|D]\}
}|�|�||
|���q�||�dd�|��}|
�r&g}|
D]"\}
}|�|j||
|dd���q�||�dd�|��}t|d��r�t|j�}|dd�dk�rp|dd�dk�rp|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d ��r�||�d!t|j"��}zt�#|�}Wnt$k
�rd"}YnX||�d#|�}|S)$z5Produce text documentation for a given module object.�NAME� - rGNzMODULE REFERENCEa.

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
ZDESCRIPTIONrR�
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|�qSrrrErrrr��sz%TextDoc.docmodule.<locals>.<listcomp>r�CLASSES�	FUNCTIONS�F)r4ZDATArXr>r?r�r@ZVERSIONrQZDATErWZAUTHORrUZCREDITSr�ZFILE)%r%r$rrr<r�rrAr+rLrfr
r,r;r.�setrcrNrOrR�addr~r!r*rar6rPr�r�rJrXrrQrWrUr�r})r>rr(rQZsynop�descrrdr�r-rHrIr,rVrWZ
modpkgs_namesrXr'rYZ
submodulesrZrrUr�rrrr�Us�
	�
��
��
�
$
zTextDoc.docmodulec	sL�j}|p|}�j}�jfdd�}||kr:d��|�}n��|�d|}|rlt||�}	|dd�|	�}g}
|
j�zt���}Wnt	t
fk
r�d}YnX|r�t|�}|r�|dkrʈ||d	�t��}
|
r�|
d	�t
t����}t|�d
k�r*�d�|D]}�d||���q
�d
�tdd�t���D�tjd�}t|�}d}|�r��d�|d|�D]}�d|��qn||k�r��dt||�d��d
�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r|�r*|���n|dd
�t|�fd d!��\}}�tjk	�rn�tjk�rn|}�qn ��k�r~d"}nd#t��j�}t|��|d$||d%d!��}|d&||d'd!��}|d(||d)d!��}|d*||d+d!��}|d,||d-d!��}|d.||d/d!��}|}�qd	�|
�}
|
�s0|d	S|d	��|
��d0�d	S)1z4Produce text documentation for a given class object.cSs
t||�Sr�r�)r:r�rrr�makename�sz"TextDoc.docclass.<locals>.makename�class z	 = class r�r4Nr�rrzMethod resolution order:r�rcss.|]&}|j�d�s|jdkrt|j�VqdS)r_r�N)r%rar&rJ)rqrprrrr��s
�z#TextDoc.docclass.<locals>.<genexpr>r{r�zBuilt-in subclasses:z    ... and z other subclassescs eZdZdd�Z�fdd�ZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrur[r�rrrr��sz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)NzF----------------------------------------------------------------------rr[r�r\rrr^�sz.TextDoc.docclass.<locals>.HorizontalRule.maybeNr_rr\rrr`�sr`c
s�t||�\}}|r~����|�|D]V\}}}}zt�|�}Wn&tk
rf���||���Yq&X���||����q&|Sr�rbrd�rirQrr]r>rrrk�s�zTextDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr�rlrdrmrrrnsz*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|r�����|�|D]v\}}}}t|�sDt�|�rNt|�}nd}zt�|�}	Wntk
r~|j|}	YnX��j	|	|�d|d�d�q&|S)Nr�)r4r"r)
rOr^rorrjrr<r��__dict__r�)
rerrMrfr(rorgrIr"rer�rrrps 
�z#TextDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qSrqrrrsr-rrr�+s
�z$TextDoc.docclass.<locals>.<listcomp>rcs|d�kSrurrCrvrrry4rzz"TextDoc.docclass.<locals>.<lambda>rxryzMethods %s:
cSs|ddkSrzrrCrrrryCrzzClass methods %s:
cSs|ddkSr|rrCrrrryErzzStatic methods %s:
cSs|ddkSr}rrCrrrryGrzzReadonly properties %s:
cSs|ddkSr~rrCrrrryIrzzData descriptors %s:
cSs|ddkSrrrCrrrryKrzzData and other attributes %s:
cSs|ddkSr�rrCrrrryMrzz |  )r%rBr&r��mapr!r
rr�r�r}rJrrr�r �sortedr��__subclasses__r�rir�rOr�rr)r�r�r)r>rr(rQrRr�r;r�rr<rr�r�r"r�rJZ
subclassesZno_of_subclassesZMAX_SUBCLASSES_TO_DISPLAYZsubclassnamer`rkrnrprr�r�r)rirQrr]r>rwrr��s�

�

��	
�

�

�
�
�
�
�
�
zTextDoc.docclasscCsd|�|�Sr�r�r�rrrr�WszTextDoc.formatvaluec	Cs�|j}|p|}d}d}t|�rn|jj}|rB||k	rndt||�}n,|jdk	r`dt|jj|�}ndt||�}t�|�s�t�|�r�d}	nd}	||kr�|�|�}
n,|r�t�	||g�|kr�d}|�|�d	|}
d}t�
|��r<zt�|�}Wntt
fk
�rd}YnX|�r<t|�}|d
k�r<|�|�d}
|dd�}|�sFd
}|	|
||}
|�rd|
dSt|��ppd}|
d|�o�|�|���dSdS)z;Produce text documentation for a function or method object.rrr�Nr�r�r�r� = r�z lambda r�r�r)r%r?r9r�r)rr�r�r�r�r,r�r�r}rJrr�r)r>rr(rQrFr�r�r�r�r�rr�r�r�r"rrrr�[sV
�
�

zTextDoc.docroutinecCsTg}|j}|r$||�|��|d�t|�p.d}|rJ||�|��|d�d�|�S)z1Produce text documentation for a data descriptor.rr)r
r�rr�r!r�rrrr��szTextDoc.docdatac
Cs�|�|�}|rF|r|dpd|}|t|�}	|	dkrF|d|	�d}|rX|�|�dpZd|}|dk	r~|d|�t|��7}|S)z-Produce text documentation for a data object.r�rrNr2r)r�r r�r�rJ)
r>rr(rQr8r4r"r�r�Zchoprrrr��s
zTextDoc.docother)r�)Nr)NN)NN)NNN)NNN)NNNNN)r%r&rSrVr�r�r�r�r�rr6r�r�r�r�r�r�r�rrrrr�+s


e

7
r�c@seZdZdZdd�ZdS)�
_PlainTextDocz2Subclass of TextDoc which overrides string stylingcCs|Sr�rr�rrrr��sz_PlainTextDoc.boldN)r%r&rSrVr�rrrrr��sr�cCst�at|�dS)zCThe first time this is called, determine what kind of pager to use.N)�getpager�pagerr7rrrr��sr�c	s@ttjd�stSttjd�s tStj��r4tj��s8tStj�d�pNtj�d���r�tj	dkrj�fdd�Stj�d�dkr��fd	d�S�fd
d�Stj�d�dkr�tStj	dkr�dd�Sttd�r�t�
d
�dkr�dd�Sddl}|��\}}t�
|�z8ttd��r$t�
d|�dk�r$dd�W�StW�SW5t�|�XdS)z2Decide what method to use for paging through text.�isattyZMANPAGERZPAGER�win32cstt|���Sr���
tempfilepager�plainr7�Z	use_pagerrrry�rzzgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscstt|���Sr�)�	pipepagerr�r7r�rrry�rzcs
t|��Sr��r�r7r�rrry�rzcSstt|�d�S)Nzmore <r�r7rrrry�rz�systemz(less) 2>/dev/nullrcSs
t|d�S)NZlessr�r7rrrry�rzNz	more "%s"cSs
t|d�S)NZmorer�r7rrrry�rz)rcr�stdin�
plainpager�stdoutr�r	r�rv�platformr��tempfileZmkstemp�close�unlink�ttypager)r��fdr�rr�rr��s6


 r�cCst�dd|�S)z%Remove boldface formatting from text.z.r)rrr7rrrr��sr�c	Cs�ddl}|j|d|jd�}zDtj|jdd��*}z|�|�Wntk
rPYnXW5QRXWntk
rrYnXz|�	�Wq�Wqttk
r�YqtXqtdS)z3Page through text by feeding it to another program.rNT)�shellr��backslashreplace)�errors)
�
subprocess�Popen�PIPE�io�
TextIOWrapperr��write�KeyboardInterruptr��wait)r/�cmdr��proc�piperrrr��sr�c
Cs~ddl}|���d}tj�|d�}t|ddtjdkr<t�d�ndd��}|�	|�W5QRXt�
|d|d	�W5QRXdS)
z<Page through text by invoking a program on a temporary file.rNz	pydoc.out�wr�r�)r��encodingz "r%)r�ZTemporaryDirectoryr	rr!r�rr��device_encodingr�r�)r/r�r�Ztempdirr�r�rrrr��s
��r�cCs$ttjdd�pd}|�|d��|�S)Nr��utf-8r�)r<rr��encode�decode)r/r�rrr�_escape_stdoutsr�c
Cs�tt|���d�}z2ddl}tj��}|�|�}|�|�dd�}Wn(t	t
tjfk
rld}dd�}YnX�z0zttj�dd��}Wntk
r�d}YnX|dkr�d	}|d}}tj�d�|d|��d�||d��r�tj�d
�tj��|�}	|	dk�rtj�d��q�n,|	d
k�rJtj�d||d�|d}q�|	dk�rn|||}|dk�rnd}tj�dd�||||��d�||}q�W5|�r�|�
||j|�XdS)z%Page through text on a text terminal.rrNcSstj�d�Sr@)rr�r�rrrrryrzzttypager.<locals>.<lambda>cSstj��dd�dd�S)Nr�r)rr�r�rrrrryrzZLINESr�z
-- more --)�q�Qz
          
)�
r)�b�B�)r�r�r�ttyrr��filenoZ	tcgetattrZ	setcbreakr�r�r��UnsupportedOperationZ	tcsetattrZ	TCSAFLUSHr+r	r�rvr�r�r�r!�flush)
r/r#r�r��oldZgetchar�hr�Zincr:rrrr�	sL








&r�cCstj�tt|���dS)z>Simply print unformatted text.  This is the ultimate fallback.N)rr�r�r�r�r7rrrr�5sr�cCs�t�|�r>|jtjkr d|jSt|d�r4d|jSd|jSt�|�rRd|jSt�|�rtd|jj	|jj|jfSt�
|�r�d|jj	|jj|jfSt�|�r�d|jSt�|�r�d	|jSt�
|�r�d
|jSt|�jS)z/Produce a short description of the given thing.zbuilt-in module rRzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr�z	function zmethod )rr*r%rr�rcr;Zisgetsetdescriptor�__objclass__r&Zismemberdescriptorr+rMr:r�)�thingrrr�describe9s6







�
�





r�c	Cs�dd�|�d�D�}d\}}|t|�kr\td�|d|d��|�}|r\||d}}qq\q|rf|}nt}||d�D],}zt||�}Wqvtk
r�YdSXqv|S)z@Locate an object by name or dotted path, importing as necessary.cSsg|]}|r|�qSrr)rqr�rrrr�Vszlocate.<locals>.<listcomp>rruNr)rr r�r!r�r<r�)rr�rSr��nZ
nextmodulerr�rrr�locateTs r�cCsVt|t�r0t||�}|dkr(td|��||fSt|dd�}|t|t�rL|ndfSdS)zDGiven an object or a path to an object, get the object and its name.Nz~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.r%)rkrJr�r�r<)r�r�rr(rrr�resolvems

�r�� Python Library Documentation: %scCs�|dkrt}t||�\}}t|�}t�|�}|rTd|krT|d|d|�d��7}n|rn||k	rn|d|j7}t�|�s�t�|�s�t�	|�s�t�
|�s�t|�}|d7}||d|�||�S)zBRender text documentation, given an object or a path to an object.Nrz in z in module z objectr)
r/r�r�rrL�rfindr%r*r+r,rjr�r�)r�rr�Zrendererrr(r�r�rrr�
render_doc{s&

���rc
Csfz2|dkrtt|||��n|�t|||t��Wn.ttfk
r`}zt|�W5d}~XYnXdS)zCDisplay text documentation, given an object or a path to an object.N)r�rr��	plaintextr�r��print)r�rr��outputrIrrrr"�sr"c
Cs�z`t||�\}}t�t|�t�||��}t|dddd��}|�|�W5QRXtd|d�Wn.tt	fk
r�}zt|�W5d}~XYnXdS)z<Write HTML documentation to a file in the current directory.r�r�r�)r�ZwroteN)
r��htmlrr�r�r�r�rr�r�)r�r�rr(rr�rIrrr�writedoc�srrcCs2|dkri}t�|g|�D]\}}}t|�qdS)zAWrite out HTML documentation for all modules in a directory tree.N)rN�
walk_packagesr)r�pkgpathZdonerXr'rYrrr�	writedocs�s

r
cJ@s"eZdZddddddddddd	d
ddd
ddddddddddddddddddddd�#Zd d!�d"D�Zd�e�d'd(d)d*d+d,d-�Zd.d/d0d1d2d3d4d5d6d7d8d9d9d:d:d;�Ze��D]:\ZZ	e	D],Z
e�e
e�Zeekr�ed<eZeee
<q�q�d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdLdMdNdOdPdQddRdSdSdTdUdVdWdXdYdZd[d\d]d^d_d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{ddd|d}d~dd��IZd�d�d��Z
ed�d���Zed�d���Zd�d��Ze�Zefd�d��Zd�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d�d��Zd�d��Zd�d�d��Z d�S)��Helperr�BOOLEAN�with)�assertr)�asyncr)�awaitr)�break�	while for)�classzCLASSES SPECIALMETHODS)�continuer)Zfunctionr)�del�BASICMETHODS�if)�elser�try)�forzbreak continue while�import)�globalznonlocal NAMESPACES)r�
TRUTHVALUE)r�MODULES)�in�SEQUENCEMETHODS�
COMPARISON)�lambdar�)�nonlocalzglobal NAMESPACES)�passr)�raise�
EXCEPTIONS)�returnr�)rr&)�whilezbreak continue if TRUTHVALUE)r
z CONTEXTMANAGERS EXCEPTIONS yield)�yieldr)#�False�None�True�and�asrrrrrr�defr�elifr�except�finallyr�fromrrrr�isr"r#�not�orr$r%r'rr(r
r)cCsg|]}dD]}||�qqS)��'r%r)rq�pr�rrrr��szHelper.<listcomp>)r��fr��ur8�'''r%r�)�+rt�*�**r�z//�%�<<�>>r��|�^�~r�r��<=�>=�==�!=�<>)r�r�rFrGrHrIrJ)rtrE)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rArBr�rCrDrE)�j�J)�STRINGS�	OPERATORSr!�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classrM�PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)r@r?�,rr2�:�@r�r_r^�`r&r5�[�]r�)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES)zstring-methodszSTRINGS FORMATTING)Z
formatstringsrN)r]z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES)ZnumberszINTEGER FLOAT COMPLEX TYPES)Zintegersz	int range)Zfloatingz
float math)Z	imaginaryz
complex cmath)Ztypesseqz$STRINGMETHODS FORMATTING range LISTS�DICTIONARIES)Ztypesfunctionsz	def TYPES)Ztypesmethodszclass def CLASSES TYPES)zbltin-code-objectszcompile FUNCTIONS TYPES)zbltin-type-objectsztypes TYPES�TYPES)zbltin-null-objectr)zbltin-ellipsis-object�SLICINGS)Zspecialattrsr)r\z!class SPECIALMETHODS PRIVATENAMES)Ztypesmodulesr)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES�EXPRESSIONS)Zobjectsr_)ZspecialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES)Z
customizationzhash repr str SPECIALMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS)zcallable-typeszCALLS SPECIALMETHODS)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS)rbzMAPPINGS SPECIALMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS)Z	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS)Znamingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES)zdynamic-featuresr�
NAMESPACES)r�ztry except finally raise)Zconversionsr)Zidentifierszkeywords SPECIALIDENTIFIERS)z
id-classesr)zatom-identifiersr)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�	SEQUENCES)Z	exprlistszTUPLES LITERALS)ztypesseq-mutable�LISTLITERALS)ZlistszLISTS LITERALS)Ztypesmapping�DICTIONARYLITERALS)rzDICTIONARIES LITERALS)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS)Z
subscriptionsr )Zslicingsr )Zcallsra)Zpowerra)Zunaryra)Zbinaryra)Zshiftingra)Zbitwisera)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEr)Z
assignmentrP)Z	augassign�
NUMBERMETHODSrr')Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersr
)Ir_rMZ
STRINGMETHODSZ
FORMATTING�UNICODEZNUMBERSZINTEGERZFLOATrRrdZMAPPINGSr�ZMETHODSZCODEOBJECTSZTYPEOBJECTSZFRAMEOBJECTSZ
TRACEBACKSZNONErTZSPECIALATTRIBUTESr�rZPACKAGESrarNZ
PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSr ZMAPPINGMETHODSrgZ	EXECUTIONrcZDYNAMICFEATURESZSCOPINGZFRAMESr&ZCONVERSIONSZIDENTIFIERSZSPECIALIDENTIFIERSrUZLITERALSZTUPLESZ
TUPLELITERALSZLISTSrer^rfZ
ATTRIBUTESZ
SUBSCRIPTSr`ZCALLSrSrOZBINARYZSHIFTINGrQr!rZ	ASSERTIONZ
ASSIGNMENTrPZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGrZ	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dSr�)�_input�_output)r>�inputrrrrr�^szHelper.__init__cCs|jp
tjSr�)rjrr�r�rrrrlbszHelper.inputcCs|jp
tjSr�)rkrr�r�rrrrfsz
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)Nrr1�?rz<%s.%s instance>)r�stackr�r&rSr�rrr�__repr__js�zHelper.__repr__cCs6||jk	r|�|�n|��|��|j�d�dS)Na
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
)�_GoInteractiver�intro�interactrr��r>Zrequestrrr�__call__rs

zHelper.__call__c	Cs�|j�d�z|�d�}|s Wq�Wnttfk
r>Yq�YnX|��}t|�dkr�|d|dkrpdkr�nn |d|dd�kr�|dd�}|��dkr�q�|d	kr�|��q|�	|�qdS)
Nrzhelp> rrr�r7r)r��quitr)
rr��getliner��EOFErrorrr r�rqrrsrrrrrs"

,�
zHelper.interactcCs8|jtjkrt|�S|j�|�|j��|j��SdS)z.Read one line, using input() when appropriate.N)rlrr�rr�r�r�)r>�promptrrrrv�s

zHelper.getlinecCs<t|�td�k�r|��}|dkr,|��n�|dkr>|��n�|dkrP|��n�|dkrb|��n�|dd�dkr�|�|��d�n�||jkr�|�|�nj|d	kr�t	t
|�d
�nR||jkr�|�|�n<||j
kr�|�|�n&|r�t	|d
|jd�nt	td
|jd�n$t|t��r|�nt	|d
|jd�|j�d�dS)
Nr�keywords�symbols�topicsr��zmodules r)r,r*r+zHelp on %s:)rr)r�r�listkeywords�listsymbols�
listtopics�listmodulesrrz�
showsymbolr"�evalry�	showtopicr{rkrJrkrrr�rsrrrr�s6






zHelper.helpcCs$|j�d�dtjdd���dS)Na�
Welcome to Python {0}'s help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/{0}/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
z%d.%dr)rr�rrr�r�rrrrq�s
�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D]v}t|�D]\}|||}|t|�kr<|j�||�||dkr<|j�dd|dt||��q<|j�d�q0dS)Nrr�r)rr�r rrr�)	r>�items�columnsr
Zcolwr�rowrrrrrrr�s&zHelper.listcCs |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rr�rryrEr�rrrr}�szHelper.listkeywordscCs |j�d�|�|j���dS)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rr�rrzrEr�rrrr~�szHelper.listsymbolscCs |j�d�|�|j���dS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rr�rr{rEr�rrrr�szHelper.listtopicscCs0zddl}Wn"tk
r.|j�d�YdSX|j�||j�|��}|sb|j�dt|��dSt|�td�kr~|�	||�S|\}}z|jj|}Wn*t
k
r�|j�dt|��YdSX|��d}|r�|p�dd|}|�r$ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nr�t
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrr��Related help topics: r4�Hz
%s
)�pydoc_data.topicsr�rr�r{rvryr�r�r��KeyErrorr�textwrapr!rZwrapr�)r>�topic�
more_xrefs�
pydoc_data�target�label�xrefsr"r�r/Zwrapped_textrrrr��s4zHelper.showtopiccCs�zddl}Wntk
r"YdSX|j�||j�|��}|sFtd��t|t�r\|�||�S|\}}|jj|}|r�|pzdd|}||fS)a*Return unbuffered tuple of (topic, xrefs).

        If an error occurs here, the exception is caught and displayed by
        the url handler.

        This function duplicates the showtopic method but returns its
        result directly so it can be formatted for display in an html page.
        rN)r�rzcould not find topicrr�)	r�r�r{rvryr�rkrJ�	_gettopic)r>r�r�r�r�r�r�r"rrrr�s	
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)rz�	partitionr�)r>�symbolr�r�r_r�rrrr�!s
zHelper.showsymbolcsv|r |j�d�|��t|�nR|j�d�i}|fdd���fdd�}t�j�|d�|�|���|j�d�dS)	Nzy
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

zI
Please wait a moment while I gather a list of all available modules...

cSs>|r$|dd�dkr$|dd�d}|�d�dkr:d||<dS)N����	.__init__r�rrr)�find)rr'r�r�rrr�callback4sz$Helper.listmodules.<locals>.callbackcs�d|d�dSr�rr��r�rr�onerror9sz#Helper.listmodules.<locals>.onerror�r�z�
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
)rr�r�apropos�
ModuleScanner�runrrE)r>rHr�r�rr�rr�&s
�
zHelper.listmodules)r8r<r%r�)NN)r�r�)r)r)r)!r%r&rSryZ_strprefixesZ_symbols_inverserzr�r�Zsymbols_r�rvr{r�rlrlrrorrprtrrrvrrqrr}r~rr�r�r�r�rrrrr�sB�'���W



	


 
rc@seZdZdZddd�ZdS)r�z7An interruptible scanner that searches module synopses.Nc	Cs
|r|��}d|_i}tjD]p}|dkrd||<|dkrF|d|d�qt|�jpRd}|�d�d}|d|}|���|�dkr|d||�qtj	|d�D�]\\}	}}
|jr��q�|dkr�|d|d�q�zt�
|	|�}Wntk
r�Yq�YnX|j}t
|d	��rnz|�|�}
Wn(tk
�r:|�r2||�Yq�YnXtt�|
���pNd}t
|d
��rh|�|�}nd}n`ztj�|�}Wn(tk
�r�|�r�||�Yq�YnX|j�r�|j��dnd}t|dd�}|d|}|���|�dkr�||||�q�|�r|�dS)NF�__main__rrrrr�r��
get_source�get_filenamerY)r�rurr�r�rVrr�rNr�	_get_specr�r�rcr�rcr�r��StringIOr�r�r�r�r�r�r<)r>r�rHZ	completerr��seenr'r(r�rXrYr�r��sourcerr�rrrr�Gs`



zModuleScanner.run)NNN)r%r&rSrVr�rrrrr�Dsr�c	CsDdd�}dd�}t���"t�d�t�j|||d�W5QRXdS)zAPrint all the one-line module summaries that contain a substring.cSs6|dd�dkr |dd�d}t||o.d|�dS�Nr�r�r�z- )r�rr'r�rrrr��szapropos.<locals>.callbackcSsdSr�rr�rrrr��szapropos.<locals>.onerror�ignorer�N)�warnings�catch_warnings�filterwarningsr�r�)rHr�r�rrrr��s


r�cs�ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	s�|j
s�t�d	�q~|S)
aAStart an HTTP server thread on a specific port.

    Start an HTML/text server thread, so HTML or text documents can be
    browsed dynamically and interactively with a Web browser.  Example use:

        >>> import time
        >>> import pydoc

        Define a URL handler.  To determine what the client is asking
        for, check the URL and content_type.

        Then get or generate some text or HTML code and return it.

        >>> def my_url_handler(url, content_type):
        ...     text = 'the URL sent was: (%s, %s)' % (url, content_type)
        ...     return text

        Start server thread on port 0.
        If you use port 0, the server will pick a random port number.
        You can then use serverthread.port to get the port number.

        >>> port = 0
        >>> serverthread = pydoc._start_server(my_url_handler, port)

        Check that the server is really started.  If it is, open browser
        and get first page.  Use serverthread.url as the starting page.

        >>> if serverthread.serving:
        ...    import webbrowser

        The next two lines are commented out so a browser doesn't open if
        doctest is run on this module.

        #...    webbrowser.open(serverthread.url)
        #True

        Let the server do its thing. We just need to monitor its status.
        Use time.sleep so the loop doesn't hog the CPU.

        >>> starttime = time.monotonic()
        >>> timeout = 1                    #seconds

        This is a short timeout for testing purposes.

        >>> while serverthread.serving:
        ...     time.sleep(.01)
        ...     if serverthread.serving and time.monotonic() - starttime > timeout:
        ...          serverthread.stop()
        ...          break

        Print any errors that may have occurred.

        >>> print(serverthread.error)
        None
   rNc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsX|j�d�rd}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)	z�Process a request from an HTML browser.

            The URL received is in self.path.
            Get an HTML page from self.urlhandler and send it.
            z.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8r�N)	rrbZ
send_responseZsend_headerZend_headersZwfiler��
urlhandlerr�)r>�content_typerrr�do_GET�s

��z(_start_server.<locals>.DocHandler.do_GETcWsdSr�r)r>r�rrr�log_message�sz-_start_server.<locals>.DocHandler.log_messageN)r%r&rSr�r�rrrr�
DocHandler�sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�hostZaddressr�rJr��handlerru)r>r��portr�rrrr��s
z)_start_server.<locals>.DocServer.__init__cs>|js2��|j��gggd�\}}}|r|��q|��dSr@)ru�selectZsocketr�Zhandle_requestZserver_close)r>ZrdZwrZex�r�rr�serve_until_quit�s

z1_start_server.<locals>.DocServer.serve_until_quitcSs |j�|�|jr|�|�dSr�)rJ�server_activater�r�rrrr��sz0_start_server.<locals>.DocServer.server_activateN)r%r&rSr�r�r�rr�rr�	DocServer�sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�r+r��Threadr��serving�error)r>r�r�r�)�	threadingrrr��s
z,_start_server.<locals>.ServerThread.__init__c
sxzJ�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�Wn(tk
rr}z
||_W5d}~XYnXdS)zStart the server.N)�server�
HTTPServerrJr�r�ZMessageZMessageClass�staticmethodr�r�r��ready�	docserverr�rcr�)r>Zdocsvr�e)r�r��email�httprrr�	s

z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r�r�Zserver_portr�r")r>r�rrrr�	sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)z&Stop the server and this thread nicelyTNF)r�rur!r�r"r�rrr�stop	s
z(_start_server.<locals>.ServerThread.stopN)r%r&rSr�r�r�r�r)r�r�r�r�r�rr�ServerThread�s
r�g{�G�z�?)
Zhttp.serverZ
email.messager�r�r�ZBaseHTTPRequestHandlerr�r�r1r�r��time�sleep)r��hostnamer�r��threadr)r�r�r�r�r�r�r�
_start_server�s8'r�r�c
s(G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�r�|dd�}|dk�rtj�tj�t��}tj�||�}t|��}d�|�	��W5QR�SQRXn|dk�r||�St
d||f��dS)aThe pydoc url handler for use with the pydoc server.

    If the content_type is 'text/css', the _pydoc.css style
    sheet is read and returned if it exits.

    If the content_type is 'text/html', then the result of
    get_html_page(url) is returned.
    cseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccsd}d|}d||��|fS)rzpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">a<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>r)r>rr�css_pathZcss_link��html_navbarrrr2	s���z#_url_handler.<locals>._HTMLDoc.pageN)r%r&rSrrr�rr�_HTMLDoc0	sr�cs>��dt��t��dt��f�}d|��tjdd��fS)Nz%s [%s, %s]raZ
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            T)Zterse)r�r�Zpython_versionZpython_buildZpython_compiler)rU�rrrr�B	s
��z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��qT|�d�dd
�|�fS)zModule Index page.cSsd||fS�Nrr�r(rrr�	bltinlink`	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>rArBcSsg|]}|dkr|�qS)r�r)rqr(rrrr�f	s�z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in ModulesrFz|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</font>zIndex of Modulesr)	rrr�rrrr
r�r!)r�r�namesrr�rr�rr�
html_index]	s*��
�z _url_handler.<locals>.html_indexc		s�g��fdd�}t���*t�d�dd�}t�j|||d�W5QRXdd�}g}��d	d
d�}�D]\}}|�||�|�qf|��d|d
d
d�|��}d|fS)zSearch results page.cs:|dd�dkr |dd�d}��||o0d|f�dSr�rKr��Z
search_resultrrr�{	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSsdSr�rr�rrrr��	sz2_url_handler.<locals>.html_search.<locals>.onerrorr�cSsd||fSr�rr�rrrr��	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>rArBzkey = %srF�<br>zSearch Results)	r�r�r�r�r�rr
rr!)	rHr�r�r�rnrr(r�rr�r�r�html_searchv	s,

��z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)zIndex of topic texts available.cSsd||fS�Nz<a href="topic?key=%s">%s</a>rr�rrrr��	sz4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>rArBZTopicsrF)rr�rr{rErr)r�rr�rr�rr�html_topics�	s��z!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)zIndex of keywords.r�rArBcSsd||fSr�rr�rrrr��	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsrF)rr�rryrErr)rr�r�rr�rr�
html_keywords�	s��z#_url_handler.<locals>.html_keywordscs�t��}t||�}|�|�\}}||jkr0d}nd}��d|dd�}d��|�}��|dd|�}|r�t|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
zTopic or keyword help page.ZKEYWORDZTOPICr=rArBz
<pre>%s</pre>rFcSsd||fSr�rr�rrrr��	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkr�z%s %sr)
r�r�rr�ryrr3rr�rrrr!)r�ZbufZhtmlhelprr�rrr�r�rr�html_topicpage�	s2

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dkr$|dkr$td��t|�}��||�}||fS)Nr)r�r+zcould not find object)r�r�r�r�)r"rer�contentr�rr�html_getobj�	sz!_url_handler.<locals>.html_getobjcsP��ddd�}d��fdd�tt|�|�D��}|��|dd|�}d||fS)	Nz,<big><big><strong>Error</strong></big></big>rArBr�c3s|]}��|�VqdSr�)r�r�r�rrr��	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rr!rr�r)r"r�rrr�rr�
html_error�	s���z _url_handler.<locals>.html_errorc
sr|}|�d�r|dd�}�z|dkr2��\}}n�|dkrF��\}}n�|dkrZ��\}}n�d|k�r$|�d�\}}}|dkr��|�\}}n�|d	kr�z�|�\}}Wn tk
r��|�\}}YnXn\|d
k�r|dkr��\}}n4z�|�\}}Wn"tk
�r�|�\}}YnXntd��n�|�\}}Wn2tk
�rd}z�||�\}}W5d}~XYnX��||�S)zGenerate an HTML page for url.r�N���)rr�r{ryr�z
search?keyz	topic?keyzget?keyz
bad pydoc url)rbr�r�rcr)r"Zcomplete_urlrr��opr_r�)rr�r�r�r�r�r�r�rr�
get_html_page�	s>



 z#_url_handler.<locals>.get_html_pager�rNr�rr�z"unknown content type %r for url %s)rrar	r�dirname�realpathrYr!r��	readlinesr})r"r�r�r�Z	path_herer��fpr)	rr�r�r�r�r�r�r�r�r�_url_handler'	s*	
(


"
r�T�	localhost)�open_browserr�c	Cs�ddl}tt||�}|jr(t|j�dS|jr�d}|rB|�|j�z~zZtd|j�t|�|jr�t	d�}|�
�}|dkr|q�qZ|dkr�|�|j�qZt|�qZWnttfk
r�t�YnXW5|jr�|��td�XdS)	z�Start the enhanced pydoc Web server and open a Web browser.

    Use port '0' to start the server on an arbitrary port.
    Set open_browser to False to suppress opening a browser.
    rNz"Server commands: [b]rowser, [q]uitzServer stoppedzServer ready atzserver> r�r�)
�
webbrowserr�r�r�rr�r�r"r�rlr�r�rw)r�r�r�r�ZserverthreadZserver_help_msgr�rrr�browse
s2
r�cCst|t�o|�tj�dkSru)rkrJr�r	�sep)rNrrr�ispath9
sr�cCsvd|kstj|kst��|kr"dStj�t�}tj�|�}|��}||krbtj�||�sb|�|�|�	dt���|S)z�Ensures current directory is on returned path, and argv0 directory is not

    Exception: argv0 dir is left alone if it's also pydoc's directory.

    Returns a new path entry list, or None if no adjustment is needed.
    rNr)
r	�curdir�getcwdrr�rY�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path<
s

r�cCs,ttjtjd�}|dk	r(|tjdd�<dS)z�Ensures current directory is on sys.path, and __main__ directory is not.

    Exception: __main__ dir is left alone if it's also pydoc's directory.
    rN)r�rr�argv)r�rrr�_adjust_cli_sys_pathX
sr�cCs�ddl}Gdd�dt�}t��zv|�tjdd�d�\}}d}d}d}d}d}|D]\\}	}
|	d	krld
}d
}|	dkr�t|
�WdS|	dkr�d
}|
}|	d
kr�d
}|	dkrTd
}|
}qT|r�t|||d�WdS|s�|�|D]�}t|��rtj	�
|��std|��q�z`t|��r&tj	�|��r&t
|�}|�rXt|��rNtj	�|��rNt|�nt|�n
t�|�Wq�tk
�r�}zt|�W5d}~XYq�Xq�WnN|j|fk
�r�tj	�tj	�tjd��d}
tdj|
tjd��YnXdS)z@Command-line interface (looks at sys.argv to decide what to do).rNc@seZdZdS)zcli.<locals>.BadUsageN)r%r&rSrrrr�BadUsagee
sr�rzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exista�pydoc - the Python documentation tool

{cmd} <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '{sep}', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

{cmd} -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

{cmd} -n <hostname>
    Start an HTTP server with the given hostname (default: localhost).

{cmd} -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

{cmd} -b
    Start an HTTP server on an arbitrary unused port and open a Web browser
    to interactively browse documentation.  This option can be used in
    combination with -n and/or -p.

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
)r�r�)�getoptrcr�rr�r�r�r�r	r�existsrr�r�rr
rrr�r�r�r�rr�)rr�Zoptsr�ZwritingZstart_serverr�r�r��opt�val�argrIr�rrr�clib
sd

 �rr�)NN)r)r)rrN)rrN)r)rN)r�)r)ZrVrGrWrQrUr�Zimportlib._bootstrapr�Zimportlib._bootstrap_external�importlib.machinery�importlib.utilrr�r	rNr�rrr�r�r�Zurllib.parserHr��collectionsr�reprlibr�	tracebackrrrr$r)r.r0r5r'�
IGNORECASEr6r8r?rDrOrfrir�r�r�r�rcr�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r/rrr�rr"rr
rrr�r�r�r�r�r�r�r�rr%rrrr�<module>s�&
	


'
0:*> ",

�
�


=
n%
U
__phello__.foo.cpython-38.opt-2.pyc000064400000000201151450073350012771 0ustar00U

e5d@�@sdS)N�rrr�&/usr/lib64/python3.8/__phello__.foo.py�<module>�symbol.cpython-38.opt-1.pyc000064400000004546151450073350011454 0ustar00U

��.e=�@s�dZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJdKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[d\Z\iZ]e^e_��`��D]$\ZaZbeceb�ecd]�k�r�eae]eb<�q�[a[bd^S)_z;Non-terminal symbols of Python grammar (from "graminit.h").�iiiiiiiii	i
iii
iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[�N)d�__doc__Zsingle_inputZ
file_inputZ
eval_inputZ	decoratorZ
decoratorsZ	decoratedZ
async_funcdefZfuncdefZ
parametersZ
typedargslistZtfpdefZvarargslistZvfpdefZstmtZsimple_stmtZ
small_stmtZ	expr_stmtZ	annassignZtestlist_star_exprZ	augassignZdel_stmtZ	pass_stmtZ	flow_stmtZ
break_stmtZ
continue_stmtZreturn_stmtZ
yield_stmtZ
raise_stmtZimport_stmtZimport_nameZimport_fromZimport_as_nameZdotted_as_nameZimport_as_namesZdotted_as_namesZdotted_nameZglobal_stmtZ
nonlocal_stmtZassert_stmtZ
compound_stmtZ
async_stmtZif_stmtZ
while_stmtZfor_stmtZtry_stmtZ	with_stmtZ	with_itemZ
except_clauseZsuiteZnamedexpr_testZtestZtest_nocondZlambdefZlambdef_nocondZor_testZand_testZnot_testZ
comparisonZcomp_opZ	star_expr�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactorZpowerZ	atom_exprZatomZ
testlist_compZtrailerZ
subscriptlistZ	subscriptZsliceopZexprlistZtestlistZdictorsetmakerZclassdefZarglistZargumentZ	comp_iterZ
sync_comp_forZcomp_forZcomp_ifZ
encoding_declZ
yield_exprZ	yield_argZfunc_body_suiteZfunc_type_inputZ	func_typeZtypelistZsym_name�list�globals�items�_nameZ_value�type�r
r
�/usr/lib64/python3.8/symbol.py�<module>s�binhex.cpython-38.opt-1.pyc000064400000027550151450073350011424 0ustar00U

e5d�6�@s�dZddlZddlZddlZddlZdddgZGdd�de�ZdZdZ	dZ
d	Zd
ZGdd�d�Z
d
d�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZdS)z�Macintosh binhex compression/decompression.

easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
�N�binhex�hexbin�Errorc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/binhex.pyrs�i��@��c@seZdZdd�ZdS)�FInfocCsd|_d|_d|_dS)Nz????r)�Type�Creator�Flags��selfrrr	�__init__0szFInfo.__init__N)rrrrrrrr	r
/sr
c	Cstt�}t�|d��2}|�d�}d|kr,d|_|�dd�|��}W5QRXtj�	|�\}}|�
ddd�}|||dfS)	N�rbirZTEXT��:�-r
)r
�io�open�readr�seek�tell�os�path�split�replace)�name�finfo�fp�dataZdsize�dir�filerrr	�getfileinfo5s
r'c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�openrsrccGsdS�Nr�r�argsrrr	rCszopenrsrc.__init__cGsdS�N�rr*rrr	rFsz
openrsrc.readcGsdSr)rr*rrr	�writeIszopenrsrc.writecCsdSr)rrrrr	�closeLszopenrsrc.closeN)rrrrrr.r/rrrr	r(Bsr(c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Hqxcoderenginez(Write data to the coder in 3-byte chunkscCs ||_d|_d|_td|_dS)Nr-r
)�ofpr$�hqxdata�LINELEN�linelen�rr1rrr	rRsz_Hqxcoderengine.__init__cCsh|j||_t|j�}|dd}|jd|�}|j|d�|_|sHdS|jt�|�|_|�d�dS)N�r)r$�lenr2�binascii�b2a_hqx�_flush)rr$ZdatalenZtodorrr	r.Xs
z_Hqxcoderengine.writecCsrd}|t|j�|jkrH||j}|j�|j||�d�t|_|}q|j|d�|_|rn|j�|jd�dS)Nr�
s:
)r7r2r4r1r.r3)rZforce�firstZlastrrr	r:cs
z_Hqxcoderengine._flushcCs6|jr|jt�|j�|_|�d�|j��|`dS)Nr
)r$r2r8r9r:r1r/rrrr	r/ns


z_Hqxcoderengine.closeN)rrr�__doc__rr.r:r/rrrr	r0Os
r0c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Rlecoderenginez4Write data to the RLE-coder in suitably large chunkscCs||_d|_dSr,)r1r$r5rrr	rxsz_Rlecoderengine.__init__cCs@|j||_t|j�tkrdSt�|j�}|j�|�d|_dSr,)r$r7�REASONABLY_LARGEr8�rlecode_hqxr1r.)rr$�rledatarrr	r.|sz_Rlecoderengine.writecCs0|jrt�|j�}|j�|�|j��|`dSr))r$r8r@r1r.r/)rrArrr	r/�s

z_Rlecoderengine.closeN)rrrr=rr.r/rrrr	r>usr>c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BinHexc
Cs�|\}}}}d}t|t�r.|}t�|d�}d}zR|�d�t|�}	t|	�|_d|_|dkr`t	�}||_
||_|�||�t
|_Wn|r�|���YnXdS)NF�wbTs0(This file must be converted with BinHex 4.0)

:r)�
isinstance�strrrr.r0r>r1�crcr
�dlen�rlen�
_writeinfo�_DID_HEADER�stater/)
rZname_finfo_dlen_rlenr1r!r"rGrHZclose_on_errorZofnameZhqxerrrr	r�s*



zBinHex.__init__cCs�t|�}|dkrtd��t|g�|�d�d}|j|j}}t|t�rR|�d�}t|t�rf|�d�}||}t�	d|j
�}t�	d|j|j�}	||||	}
|�
|
�|��dS)N�?zFilename too longzlatin-1��>hz>ii)r7r�bytes�encoderrrDrE�struct�packrrGrH�_write�	_writecrc)rr!r"�nl�d�tpZcrZd2Zd3Zd4�inforrr	rI�s




zBinHex._writeinfocCs t�||j�|_|j�|�dSr))r8�crc_hqxrFr1r.�rr$rrr	rS�sz
BinHex._writecCs4|jdkrd}nd}|j�t�||j��d|_dS)NrrNz>H)rFr1r.rQrR)rZfmtrrr	rT�s

zBinHex._writecrccCs0|jtkrtd��|jt|�|_|�|�dS)NzWriting data at the wrong time)rKrJrrGr7rSrZrrr	r.�s
zBinHex.writecCs,|jdkrtd|jf��|��t|_dS)NrzIncorrect data size, diff=%r)rGrrHrT�	_DID_DATArKrrrr	�
close_data�s
zBinHex.close_datacCsB|jtkr|��|jtkr$td��|jt|�|_|�|�dS)Nz'Writing resource data at the wrong time)rKr[r\rrHr7rSrZrrr	�
write_rsrc�s

zBinHex.write_rsrccCsx|jdkrdSzJ|jtkr"|��|jtkr4td��|jdkrNtd|jf��|��W5d|_|j}|`|��XdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rKr1r/r[r\rrHrTr5rrr	r/�s



zBinHex.closeN)rrrrrIrSrTr.r\r]r/rrrr	rB�s
rBc	Cs�t|�}t||�}t�|d��*}|�d�}|s0q<|�|�q |��W5QRXt|d�}|�d�}|shqt|�|�qX|�	�|�	�dS)zEbinhex(infilename, outfilename): create binhex-encoded copy of a filer��N)
r'rBrrrr.r\r(r]r/)�inp�outr"r1�ifprVrrr	r�s



c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Hqxdecoderenginez*Read data via the decoder in 4-byte chunkscCs||_d|_dS)Nr)ra�eof�rrarrr	rsz_Hqxdecoderengine.__init__cCs�d}|}|dkr�|jr|S|ddd}|j�|�}zt�|�\}|_Wq�Wntjk
rdYnX|j�d�}|s~td��||}q6||}|t|�}|s|jstd��q|S)z&Read at least wtd bytes (or until EOF)r-rrr6�r
zPremature EOF on binhex file)rcrarr8Za2b_hqxZ
Incompleterr7)rZtotalwtdZdecdata�wtdr$Z
decdatacur�newdatarrr	rs*


z_Hqxdecoderengine.readcCs|j��dSr)�rar/rrrr	r/%sz_Hqxdecoderengine.closeN)rrrr=rrr/rrrr	rb�s rbc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_RledecoderenginezRead data via the RLE-codercCs||_d|_d|_d|_dS)Nr-r)ra�
pre_buffer�post_bufferrcrdrrr	r+sz_Rledecoderengine.__init__cCsD|t|j�kr"|�|t|j��|jd|�}|j|d�|_|Sr))r7rk�_fill)rrf�rvrrr	r1s
z_Rledecoderengine.readcCs�|j|j�|d�|_|jjr>|jt�|j�|_d|_dSt|j�}|jdd�tdtkrl|d}nX|jdd�tkr�|d}n<|jdd�tdkr�|d}n|jdd�tkr�n|d	}|jt�|jd|��|_|j|d�|_dS)
Nrer-���rMr6���r���r
)	rjrarrcrkr8Z
rledecode_hqxr7�RUNCHAR)rrfZmarkrrr	rl8s*
�



�z_Rledecoderengine._fillcCs|j��dSr)rhrrrr	r/[sz_Rledecoderengine.closeN)rrrr=rrrlr/rrrr	ri(s
#ric@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HexBincCsft|t�rt�|d�}|�d�}|s,td��|dkr6q|dkrqBqt|�}t|�|_d|_	|�
�dS)Nrr
zNo binhex data foundr;�:r)rDrErrrrrbrirarF�_readheader)rraZchZhqxifprrr	r_s


zHexBin.__init__cCs |j�|�}t�||j�|_|Sr))rarr8rYrF)rr7r$rrr	�_readuszHexBin._readcCsNt�d|j�d��dd@}|jd@|_||jkrDtd|j|f��d|_dS)NrNrri��zCRC error, computed %x, read %x)rQ�unpackrarrFr)rZfilecrcrrr	�	_checkcrczs
�zHexBin._checkcrccCs�|�d�}|�t|��}|�d�}|��|dd�}|dd�}t�d|dd��d}t�d|dd	��d|_t�d|d	d��d|_||_t�|_||j_	||j_
||j_t|_
dS)
Nr
���	rN�rz>l�)ru�ordrwrQrvrGrH�FNamer
rrrrJrK)rr7Zfname�rest�typeZcreator�flagsrrr	rt�s

zHexBin._readheadercGsj|jtkrtd��|r,|d}t||j�}n|j}d}t|�|krZ||�|t|��}q6|j||_|S)NzRead data at wrong timerr-)rKrJr�minrGr7ru)r�nrmrrr	r�s
zHexBin.readcCs6|jtkrtd��|jr$|�|j�}|��t|_dS)Nzclose_data at wrong time)rKrJrrGrurwr[�rZdummyrrr	r\�s
zHexBin.close_datacGsZ|jtkr|��|jtkr$td��|r>|d}t||j�}n|j}|j||_|�|�S)Nz Read resource data at wrong timer)rKrJr\r[rr�rHru)rr�rrr	�	read_rsrc�s

zHexBin.read_rsrccCsD|jdkrdSz|jr"|�|j�}|��W5d|_|j��XdSr))rKrar/rHr�rwr�rrr	r/�s
zHexBin.closeN)rrrrrurwrtrr\r�r/rrrr	rr^s

rrc	Cs�t|�}|j}|s|j}t�|d��"}|�d�}|s6qB|�|�q&W5QRX|��|�d�}|r�t	|d�}|�|�|�d�}|s�q�|�|�qv|�
�|�
�dS)z6hexbin(infilename, outfilename) - Decode binhexed filerCr^N)rrr
r~rrrr.r\r�r(r/)r_r`rar"r1rVrrr	r�s(




)r=rrrQr8�__all__�	ExceptionrrJr[r?r3rqr
r'r(r0r>rBrrbrirrrrrrr	�<module>s,


&^*6hcolorsys.cpython-38.pyc000064400000006252151450073350011061 0ustar00U

e5d��@s\dZddddddgZdZdZd	Zd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
dd�ZdS)aJConversion functions between RGB and other color systems.

This modules provides two functions for each color system ABC:

  rgb_to_abc(r, g, b) --> a, b, c
  abc_to_rgb(a, b, c) --> r, g, b

All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly larger range).
Inputs outside the valid range may cause exceptions or invalid outputs.

Supported color systems:
RGB: Red, Green, Blue components
YIQ: Luminance, Chrominance (used by composite video signals)
HLS: Hue, Luminance, Saturation
HSV: Hue, Saturation, Value
�
rgb_to_yiq�
yiq_to_rgb�
rgb_to_hls�
hls_to_rgb�
rgb_to_hsv�
hsv_to_rgbgUUUUUU�?gUUUUUU�?gUUUUUU�?cCsRd|d|d|}d||d||}d||d||}|||fS)Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g=
ףp=�?�)�r�g�b�y�i�qrr� /usr/lib64/python3.8/colorsys.pyr(scCs�|d|d|}|d|d|}|d|d|}|dkrHd}|dkrTd}|dkr`d}|dkrld}|dkrxd}|dkr�d}|||fS)	Ng2r��L�?g����,��?g:�����?g�nєW�?g6�޷���?gJ"�X�?���?r)rrr
rr	r
rrrr.s cCs�t|||�}t|||�}||d}||kr6d|dfS|dkrP||||}n||d||}||||}||||}||||}	||kr�|	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)N�@r��?�@�@r��max�min)rr	r
�maxc�minc�l�s�rc�gc�bc�hrrrrKs$

cCsn|dkr|||fS|dkr(|d|}n||||}d||}t|||t�t|||�t|||t�fS)Nrrrr)�_v�	ONE_THIRD)rrr�m2�m1rrrrbs
cCsT|d}|tkr$||||dS|dkr0|S|tkrP|||t|dS|S)Nrrr)�	ONE_SIXTH�	TWO_THIRD)r#r"Zhuerrrr lsr cCs�t|||�}t|||�}|}||kr.dd|fS|||}||||}||||}||||}	||kr||	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)Nrrrrrr)rr	r
rr�vrrrrrrrrr|s 

cCs�|dkr|||fSt|d�}|d|}|d|}|d||}|d|d|}|d}|dkrt|||fS|dkr�|||fS|dkr�|||fS|dkr�|||fS|d	kr�|||fS|d
kr�|||fSdS)Nrrr�������)�int)rrr&r�f�pr
�trrrr�s(





N)�__doc__�__all__r!r$r%rrrrr rrrrrr�<module>s�	
configparser.cpython-38.opt-1.pyc000064400000131230151450073350012620 0ustar00U

e5df��@s�dZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddddd	d
ddd
ddddddddddddgZ
eZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d	�d	e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�ZGd&d
�d
e�ZGd'd�de�Ze�ZGd(d�d�Z Gd)d�de �Z!Gd*d�de �Z"Gd+d�de �Z#Gd,d�de�Z$Gd-d�de$�Z%Gd.d�de%�Z&Gd/d�de�Z'Gd0d�de�Z(dS)1a�Configuration file parser.

A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
                    configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
             delimiters=('=', ':'), comment_prefixes=('#', ';'),
             inline_comment_prefixes=None, strict=True,
             empty_lines_in_values=True, default_section='DEFAULT',
             interpolation=<unset>, converters=<unset>):
        Create the parser. When `defaults' is given, it is initialized into the
        dictionary or intrinsic defaults. The keys must be strings, the values
        must be appropriate for %()s string interpolation.

        When `dict_type' is given, it will be used to create the dictionary
        objects for the list of sections, for the options within a section, and
        for the default values.

        When `delimiters' is given, it will be used as the set of substrings
        that divide keys from values.

        When `comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in empty lines. Comments can be
        indented.

        When `inline_comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in non-empty lines.

        When `strict` is True, the parser won't allow for any section or option
        duplicates while reading from a single source (file, string or
        dictionary). Default is True.

        When `empty_lines_in_values' is False (default: True), each empty line
        marks the end of an option. Otherwise, internal empty lines of
        a multiline option are kept as part of the value.

        When `allow_no_value' is True (default: False), options without
        values are accepted; the value presented for these is None.

        When `default_section' is given, the name of the special section is
        named accordingly. By default it is called ``"DEFAULT"`` but this can
        be customized to point to any other valid section name. Its current
        value can be retrieved using the ``parser_instance.default_section``
        attribute and may be modified at runtime.

        When `interpolation` is given, it should be an Interpolation subclass
        instance. It will be used as the handler for option value
        pre-processing when using getters. RawConfigParser objects don't do
        any sort of interpolation, whereas ConfigParser uses an instance of
        BasicInterpolation. The library also provides a ``zc.buildbot``
        inspired ExtendedInterpolation implementation.

        When `converters` is given, it should be a dictionary where each key
        represents the name of a type converter and each value is a callable
        implementing the conversion from string to the desired datatype. Every
        converter gets its corresponding get*() method on the parser object and
        section proxies.

    sections()
        Return all the configuration section names, sans DEFAULT.

    has_section(section)
        Return whether the given section exists.

    has_option(section, option)
        Return whether the given option exists in the given section.

    options(section)
        Return list of configuration options for the named section.

    read(filenames, encoding=None)
        Read and parse the iterable of named configuration files, given by
        name.  A single filename is also allowed.  Non-existing files
        are ignored.  Return list of successfully read files.

    read_file(f, filename=None)
        Read and parse one configuration file, given as a file object.
        The filename defaults to f.name; it is only used in error
        messages (if f has no `name' attribute, the string `<???>' is used).

    read_string(string)
        Read configuration from a given string.

    read_dict(dictionary)
        Read configuration from a dictionary. Keys are section names,
        values are dictionaries with keys and values that should be present
        in the section. If the used dictionary type preserves order, sections
        and their keys will be added in order. Values are automatically
        converted to strings.

    get(section, option, raw=False, vars=None, fallback=_UNSET)
        Return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults. If `option' is a key in
        `vars', the value from `vars' is used.

    getint(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to an integer.

    getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a float.

    getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a boolean (currently case
        insensitively defined as 0, false, no, off for False, and 1, true,
        yes, on for True).  Returns False or True.

    items(section=_UNSET, raw=False, vars=None)
        If section is given, return a list of tuples with (name, value) for
        each option in the section. Otherwise, return a list of tuples with
        (section_name, section_proxy) for each section, including DEFAULTSECT.

    remove_section(section)
        Remove the given file section and all its options.

    remove_option(section, option)
        Remove the given option from the given section.

    set(section, option, value)
        Set the given option.

    write(fp, space_around_delimiters=True)
        Write the configuration state in .ini format. If
        `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
�)�MutableMapping)�ChainMapN�NoSectionError�DuplicateOptionError�DuplicateSectionError�
NoOptionError�InterpolationError�InterpolationDepthError�InterpolationMissingOptionError�InterpolationSyntaxError�ParsingError�MissingSectionHeaderError�ConfigParser�SafeConfigParser�RawConfigParser�
Interpolation�BasicInterpolation�ExtendedInterpolation�LegacyInterpolation�SectionProxy�ConverterMapping�DEFAULTSECT�MAX_INTERPOLATION_DEPTHZDEFAULT�
c@s&eZdZdZddd�Zdd�ZeZdS)	�Errorz'Base class for ConfigParser exceptions.�cCs||_t�||�dS�N)�message�	Exception�__init__)�self�msg�r"�$/usr/lib64/python3.8/configparser.pyr�szError.__init__cCs|jSr)r�r r"r"r#�__repr__�szError.__repr__N)r)�__name__�
__module__�__qualname__�__doc__rr%�__str__r"r"r"r#r�s
rc@seZdZdZdd�ZdS)rz2Raised when no section matches a requested option.cCs$t�|d|f�||_|f|_dS)NzNo section: %r)rr�section�args�r r+r"r"r#r�szNoSectionError.__init__N�r&r'r(r)rr"r"r"r#r�sc@seZdZdZddd�ZdS)raRaised when a section is repeated in an input source.

    Possible repetitions that raise this exception are: multiple creation
    using the API or in strict parsers when a section is found more than once
    in a single input file, string or dictionary.
    NcCs�t|�dg}|dk	rRdt|�g}|dk	r8|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
|||f|_dS)N� already exists�While reading from � [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr+�source�linenor,)r r+r8r9r!rr"r"r#r�s

zDuplicateSectionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZddd�ZdS)rz�Raised by strict parsers when an option is repeated in an input source.

    Current implementation raises this exception only when an option is found
    more than once in a single file, string or dictionary.
    NcCs�t|�dt|�dg}|dk	rZdt|�g}|dk	r@|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
||_||||f|_dS)	Nz in section r/r0r1z	: option rzOption r)
r2r3r4r5r6rrr7r+�optionr8r9r,)r r+r:r8r9r!rr"r"r#r�s"�

zDuplicateOptionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz!A requested option was not found.cCs.t�|d||f�||_||_||f|_dS)NzNo option %r in section: %r�rrr:r+r,)r r:r+r"r"r#r�s�zNoOptionError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz0Base class for interpolation-related exceptions.cCs(t�||�||_||_|||f|_dSrr;)r r:r+r!r"r"r#rszInterpolationError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)r
zAA string substitution required a setting which was not available.cCs8d�||||�}t�||||�||_||||f|_dS)Nz�Bad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})r4rr�	referencer,)r r:r+�rawvalr<r!r"r"r#rs�z(InterpolationMissingOptionError.__init__Nr.r"r"r"r#r
sc@seZdZdZdS)rz�Raised when the source text contains invalid syntax.

    Current implementation raises this exception when the source text into
    which substitutions are made does not conform to the required syntax.
    N)r&r'r(r)r"r"r"r#rsc@seZdZdZdd�ZdS)r	z0Raised when substitutions are nested too deeply.cCs0d�||t|�}t�||||�|||f|_dS)Nz�Recursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})r4rrrr,)r r:r+r=r!r"r"r#rs�z InterpolationDepthError.__init__Nr.r"r"r"r#r	sc@s<eZdZdZd
dd�Zedd��Zejdd��Zdd	�ZdS)rz>Raised when a configuration file does not follow legal syntax.NcCsT|r|rtd��n|s$|s$td��n|r,|}t�|d|�||_g|_|f|_dS)Nz:Cannot specify both `filename' and `source'. Use `source'.z%Required argument `source' not given.z"Source contains parsing errors: %r)�
ValueErrorrrr8�errorsr,)r r8�filenamer"r"r#r,s

zParsingError.__init__cCstjdtdd�|jS)zDeprecated, use `source'.�SThe 'filename' attribute will be removed in future versions.  Use 'source' instead.���
stacklevel��warnings�warn�DeprecationWarningr8r$r"r"r#r@;s�zParsingError.filenamecCstjdtdd�||_dS)zDeprecated, user `source'.rArBrCNrE�r �valuer"r"r#r@Es�cCs*|j�||f�|jd||f7_dS)Nz
	[line %2d]: %s)r?r3r)r r9�liner"r"r#r3OszParsingError.append)NN)	r&r'r(r)r�propertyr@�setterr3r"r"r"r#r)s

	
	c@seZdZdZdd�ZdS)r
z@Raised when a key-value pair is found before any section header.cCs8t�|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr8r9rKr,)r r@r9rKr"r"r#rWs��z"MissingSectionHeaderError.__init__Nr.r"r"r"r#r
Tsc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBDummy interpolation that passes the value through with no changes.cCs|Srr")r �parserr+r:rJ�defaultsr"r"r#�
before_getkszInterpolation.before_getcCs|Srr"�r rNr+r:rJr"r"r#�
before_setnszInterpolation.before_setcCs|Srr"rQr"r"r#�before_readqszInterpolation.before_readcCs|Srr"rQr"r"r#�before_writetszInterpolation.before_writeN)r&r'r(r)rPrRrSrTr"r"r"r#rhs
c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
ra!Interpolation as implemented in the classic ConfigParser.

    The option values can contain format strings which refer to other values in
    the same section, or values in the special default section.

    For example:

        something: %(dir)s/whatever

    would resolve the "%(dir)s" to the value of dir.  All reference
    expansions are done late, on demand. If a user needs to use a bare % in
    a configuration file, she can escape it by writing %%. Other % usage
    is considered a user error and raises `InterpolationSyntaxError'.z
%\(([^)]+)\)sc	Cs$g}|�||||||d�d�|�S�N�r��_interpolate_somer7�r rNr+r:rJrO�Lr"r"r#rP�szBasicInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz%%r�%�1invalid interpolation syntax in %r at position %d��replace�_KEYCRE�subr>�find�r rNr+r:rJZ	tmp_valuer"r"r#rR�s�zBasicInterpolation.before_setc
Csj|j||d|d�}|tkr&t|||��|�rf|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rR|j�|�}|dkr�t||d|��|�|�	d��}||�
�d�}z||}
Wn&tk
�rt||||�d�YnXd|
k�rF|�
||||
|||d�n
|�|
�q&t||d	|f��q&dS)
NT��raw�fallbackr[rrVrB�(�'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr	rar3r_�matchr�optionxform�group�end�KeyErrorr
rX)r rNr:�accum�restr+�map�depthr=�p�c�m�var�vr"r"r#rX�s`



���
���z$BasicInterpolation._interpolate_someN�
r&r'r(r)�re�compiler_rPrRrXr"r"r"r#rxs

c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
rzyAdvanced variant of interpolation, supports the syntax used by
    `zc.buildout'. Enables interpolation between sections.z
\$\{([^}]+)\}c	Cs$g}|�||||||d�d�|�SrUrWrYr"r"r#rP�sz ExtendedInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz$$r�$r\r]rbr"r"r#rR�s�z ExtendedInterpolation.before_setcCs�|j||d|d�}|tkr&t|||��|�r�|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�r�|j�|�}|dkr�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn2t
ttfk
�r�t|||d	�|��d�YnXd|k�r�|�|||||
t|j|
dd
��|d�n
|�|�q&t||d|f��q&dS)
NTrcrzrrVrB�{rg�:)rdzMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rhrr	rar3r_rirrk�splitrl�lenrjrmrrr
r7rX�dict�items)r rNr:rnror+rprqr=rrrsrt�pathZsect�optrvr"r"r#rX�sx



�
���
���z'ExtendedInterpolation._interpolate_someNrwr"r"r"r#r�s

c@s6eZdZdZe�d�Zdd�Zdd�Ze	dd��Z
d	S)
rz{Deprecated interpolation used in old versions of ConfigParser.
    Use BasicInterpolation or ExtendedInterpolation instead.z%\(([^)]*)\)s|.c

Cs�|}t}|r�|d8}|r�d|kr�tj|j|d�}|j�||�}z||}Wq�tk
r�}	zt||||	jd�d�W5d}	~	XYq�Xqq�q|r�d|kr�t	|||��|S)NrVz%()rNr)
r�	functools�partial�_interpolation_replacer_r`rmr
r,r	)
r rNr+r:rJ�varsr=rqr^�er"r"r#rPs0���zLegacyInterpolation.before_getcCs|Srr"rQr"r"r#rR$szLegacyInterpolation.before_setcCs,|�d�}|dkr|��Sd|�|�SdS)NrVz%%(%s)s)rkrj)rirN�sr"r"r#r�'s
z*LegacyInterpolation._interpolation_replaceN)r&r'r(r)rxryr_rPrR�staticmethodr�r"r"r"r#r
s
c
s6eZdZdZdZdZdZe�Ze	�
ee	j�Ze	�
ej
dd�e	j�Ze	�
ej
dd�e	j�Ze	�
d�Zddddd	d	d	d	d
�Zded	fdd
dddeeed�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdddd�Zdedd�Zdfd d!�Zdgd#d$�Zdhd%d&�Zd	ded'�d(d)�Z d*d+�Z!d	ded'�d,d-�Z"d	ded'�d.d/�Z#d	ded'�d0d1�Z$d	ded'�d2d3�Z%ed	df�fd4d5�	Z&d6d7�Z'd8d9�Z(d:d;�Z)did<d=�Z*djd>d?�Z+d@dA�Z,dBdC�Z-dDdE�Z.dFdG�Z/dHdI�Z0dJdK�Z1dLdM�Z2dNdO�Z3dPdQ�Z4dRdS�Z5dTdU�Z6dVdW�Z7dXdY�Z8dZd[�Z9d\d]�Z:d^d^d^d_�d`da�Z;e<dbdc��Z=�Z>S)krz,ConfigParser that does not do interpolation.z�
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        z=|:�Zdelimz\STF)�1Zyes�trueZon�0ZnoZfalseZoffN��=r|)�#�;)�
delimiters�comment_prefixes�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
convertersc
Cs<||_|��|_|��|_t|�|_|��|_t||	�|j|	<t|�|_|dkrd|rZ|j	n|j
|_nNd�dd�|D��}|r�t
�|jj|d�t
j�|_nt
�|jj|d�t
j�|_t|p�d�|_t|p�d�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdk�rt�|_|tk	�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rx�escape)�.0�dr"r"r#�	<genexpr>jsz+RawConfigParser.__init__.<locals>.<genexpr>r�r")�_dict�	_sections�	_defaultsr�_converters�_proxiesr�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer7rxry�_OPT_NV_TMPLr4�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update�_read_defaults)
r rOZ	dict_typeZallow_no_valuer�r�r�r�r�r�r�r�r�r"r"r#rYs@




��

zRawConfigParser.__init__cCs|jSr)r�r$r"r"r#rO�szRawConfigParser.defaultscCst|j���S)z3Return a list of section names, excluding [DEFAULT])�listr��keysr$r"r"r#�sections�szRawConfigParser.sectionscCsJ||jkrtd|��||jkr(t|��|��|j|<t||�|j|<dS)z�Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists. Raise ValueError if name is DEFAULT.
        zInvalid section name: %rN)r�r>r�rr�rr�r-r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jkS)z~Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        )r�r-r"r"r#�has_section�szRawConfigParser.has_sectioncCsJz|j|��}Wntk
r0t|�d�YnX|�|j�t|���S)z9Return a list of option names for the given section name.N)r��copyrmrr�r�r�r�)r r+Zoptsr"r"r#�options�szRawConfigParser.optionsc
Cs�t|tttjf�r|g}g}|D]f}z(t||d��}|�||�W5QRXWntk
rdYq YnXt|tj�r|t�|�}|�	|�q |S)a�Read and parse a filename or an iterable of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify an iterable of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the iterable will be read.  A single
        filename may also be given.

        Return list of successfully read files.
        )�encoding)
�
isinstance�str�bytes�os�PathLike�open�_read�OSError�fspathr3)r �	filenamesr�Zread_okr@�fpr"r"r#�read�s

zRawConfigParser.readcCs<|dkr,z
|j}Wntk
r*d}YnX|�||�dS)aPLike read() but the argument must be a file-like object.

        The `f' argument must be iterable, returning one line at a time.
        Optional second argument is the `source' specifying the name of the
        file being read. If not given, it is taken from f.name. If `f' has no
        `name' attribute, `<???>' is used.
        Nz<???>)�name�AttributeErrorr�)r �fr8r"r"r#�	read_file�s

zRawConfigParser.read_file�<string>cCst�|�}|�||�dS)z'Read configuration from a given string.N)�io�StringIOr�)r �stringr8Zsfiler"r"r#�read_string�s
zRawConfigParser.read_string�<dict>c
Cs�t�}|��D]�\}}t|�}z|�|�Wn(ttfk
rT|jrP||krP�YnX|�|�|��D]`\}}|�t|��}|dk	r�t|�}|jr�||f|kr�t	|||��|�||f�|�|||�qhqdS)aRead configuration from a dictionary.

        Keys are section names, values are dictionaries with keys and values
        that should be present in the section. If the used dictionary type
        preserves order, sections and their keys will be added in order.

        All types held in the dictionary are converted to strings during
        reading, including section names, option names and keys.

        Optional second argument is the `source' specifying the name of the
        dictionary being read.
        N)
�setr�r�r�rr>r��addrjr)r Z
dictionaryr8�elements_addedr+r��keyrJr"r"r#�	read_dict�s"

zRawConfigParser.read_dictcCs"tjdtdd�|j||d�dS)z"Deprecated, use read_file instead.zRThis method will be removed in future versions.  Use 'parser.read_file()' instead.rBrC)r8N)rFrGrHr�)r r�r@r"r"r#�readfp�s�zRawConfigParser.readfp�rdr�recCs�z|�||�}Wn(tk
r8|tkr,�n|YSYnX|�|�}z||}Wn0tk
r�|tkrtt||��n|YSYnX|s�|dkr�|S|j�|||||�SdS)a]Get an option value for a given section.

        If `vars' is provided, it must be a dictionary. The option is looked up
        in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
        If the key is not found and `fallback' is provided, it is used as
        a fallback value. `None' can be provided as a `fallback' value.

        If interpolation is enabled and the optional argument `raw' is False,
        all interpolations are expanded in the return values.

        Arguments `raw', `vars', and `fallback' are keyword only.

        The section DEFAULT is special.
        N)�
_unify_valuesrr�rjrmrr�rP)r r+r:rdr�rer�rJr"r"r#rh�s$
�zRawConfigParser.getcKs||j||f|��Sr)rh)r r+�convr:�kwargsr"r"r#�_get"szRawConfigParser._getc	KsJz|j|||f||d�|��WSttfk
rD|tkr<�|YSXdS)N)rdr�)r�rrr�)r r+r:r�rdr�rer�r"r"r#�	_get_conv%s�zRawConfigParser._get_convcKs|j||tf|||d�|��S�Nr�)r��int�r r+r:rdr�rer�r"r"r#�getint0s
��zRawConfigParser.getintcKs|j||tf|||d�|��Sr�)r��floatr�r"r"r#�getfloat5s
��zRawConfigParser.getfloatcKs |j|||jf|||d�|��Sr�)r��_convert_to_booleanr�r"r"r#�
getboolean:s��zRawConfigParser.getbooleancs��tkrt���S�j���z���j��Wn&tk
rV��jkrRt	���YnXt
����}|r�|��D]\}}|���|�<qp���fdd��|r��fdd���fdd�|D�S)a�Return a list of (name, value) tuples for each option in a section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        cs�j���|�|��Sr)r�rP�r:)r�r+r r"r#�<lambda>Ws
�z'RawConfigParser.items.<locals>.<lambda>cs�|Srr"r�)r�r"r#r�Z�csg|]}|�|�f�qSr"r")r�r:)�value_getterr"r#�
<listcomp>[sz)RawConfigParser.items.<locals>.<listcomp>)
r��superr�r�r�r�r�rmr�rr�r�rj)r r+rdr�Z	orig_keysr�rJ��	__class__)r�r+r r�r#r�?s 


zRawConfigParser.itemscCs.|��D]}||}||=||fSt�dS)z�Remove a section from the parser and return it as
        a (section_name, section_proxy) tuple. If no section is present, raise
        KeyError.

        The section DEFAULT is never returned because it cannot be removed.
        N)r�rm�r r�rJr"r"r#�popitem]s
zRawConfigParser.popitemcCs|��Sr)�lower)r Z	optionstrr"r"r#rjjszRawConfigParser.optionxformcCsV|r||jkr"|�|�}||jkS||jkr0dS|�|�}||j|kpP||jkSdS)z�Check for the existence of a given option in a given section.
        If the specified `section' is None or an empty string, DEFAULT is
        assumed. If the specified `section' does not exist, returns False.FN)r�rjr�r�)r r+r:r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsl|r|j�||||�}|r$||jkr,|j}n.z|j|}Wntk
rXt|�d�YnX|||�|�<dS)zSet an option.N)r�rRr�r�r�rmrrj)r r+r:rJ�sectdictr"r"r#r�{s�zRawConfigParser.setcCsh|rd�|jd�}n
|jd}|jr>|�||j|j��|�|jD]}|�|||j|��|�qDdS)z�Write an .ini-format representation of the configuration state.

        If `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
        z {} rN)r4r�r��_write_sectionr�r�r�)r r�Zspace_around_delimitersr�r+r"r"r#�write�s

�
�zRawConfigParser.writecCsx|�d�|��|D]T\}}|j�||||�}|dk	s<|jsR|t|��dd�}nd}|�d�||��q|�d�dS)z-Write a single section to the specified `fp'.z[{}]
N�
z
	rz{}{}
)r�r4r�rTr�r�r^)r r�Zsection_nameZ
section_itemsZ	delimiterr�rJr"r"r#r��s�zRawConfigParser._write_sectioncCsd|r||jkr|j}n.z|j|}Wntk
rBt|�d�YnX|�|�}||k}|r`||=|S)zRemove an option.N)r�r�r�rmrrj)r r+r:r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jk}|r|j|=|j|=|S)zRemove a file section.)r�r�)r r+r�r"r"r#�remove_section�s

zRawConfigParser.remove_sectioncCs&||jkr|�|�st|��|j|Sr)r�r�rmr��r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsX||kr|||krdS||jkr.|j��n||jkrF|j|��|�||i�dSr)r�r��clearr�r�r�r"r"r#�__setitem__�s

zRawConfigParser.__setitem__cCs2||jkrtd��|�|�s$t|��|�|�dS)Nz"Cannot remove the default section.)r�r>r�rmr�r�r"r"r#�__delitem__�s


zRawConfigParser.__delitem__cCs||jkp|�|�Sr)r�r�r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrV)r~r�r$r"r"r#�__len__�szRawConfigParser.__len__cCst�|jf|j���Sr)�	itertools�chainr�r�r�r$r"r"r#�__iter__�szRawConfigParser.__iter__cCs t�}d}d}d}d}d}d}	t|dd�D�]�\}}
tj}dd�|jD�}|tjkr�|r�i}
|��D]T\}}|
�||d�}|dkr�qd||
|<|dks�|dkrd|
|d��rdt||�}qd|
}qJ|j	D]}|
�
��|�r�d}q�q�|tjkr�d}|
d|��
�}|�sN|j�rF|dk�rL|dk	�rL|�rL||dk	�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|dk	�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d	�}||jk�r�|j�r�||k�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|dk�rTt|||
��q*|j�|�}|�r�|�d
dd�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|k�r�t"||||��|�||f�|dk	�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)
aParse a sectioned configuration file.

        Each section in a configuration file contains a header, indicated by
        a name in square brackets (`[]'), plus key/value options, indicated by
        `name' and `value' delimited with a specific substring (`=' or `:' by
        default).

        Values can span multiple lines, as long as they are indented deeper
        than the first line of the value. Depending on the parser's mode, blank
        lines may be treated as parts of multiline values or ignored.

        Configuration files may include comments, prefixed by specific
        characters (`#' and `;' by default). Comments may appear on their own
        in an otherwise empty line or may be entered in lines holding values or
        section names.
        NrrV)�startcSsi|]
}|d�qS)���r")r�rrr"r"r#�
<dictcomp>�sz)RawConfigParser._read.<locals>.<dictcomp>rr�headerr:�virJ)$r��	enumerate�sys�maxsizer�r�ra�isspace�minr��strip�
startswithr�r3�NONSPACECRE�searchr�SECTCRErirkr�r�rr�r�r�r�rr�r
r��
_handle_errorrj�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer9Zindent_levelr�rKZ
comment_startZinline_prefixesZ
next_prefixes�prefix�indexrJZfirst_nonspaceZcur_indent_levelZmor	Zoptvalr"r"r#r��s� 


��
��
�




��

zRawConfigParser._readcCsr|j|jf}t�|f|j���}|D]H\}}|��D]6\}}t|t�rTd�|��	�}|j
�||||�||<q4q$dS)Nr�)r�r�rrr�r�r�r�r7rr�rS)r rOZall_sectionsr+r�r��valr"r"r#r[s�
�z&RawConfigParser._join_multiline_valuescCs&|��D]\}}||j|�|�<qdS)zTRead the defaults passed in the initializer.
        Note: values can be non-string.N)r�r�rj)r rOr�rJr"r"r#r�gszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr3r2)r �excrr9rKr"r"r#rmszRawConfigParser._handle_errorcCs�i}z|j|}Wn(tk
r:||jkr6t|�d�YnXi}|rt|��D]&\}}|dk	rdt|�}|||�|�<qLt|||j�S)z�Create a sequence of lookups with 'vars' taking priority over
        the 'section' which takes priority over the DEFAULTSECT.

        N)	r�rmr�rr�r�rj�	_ChainMapr�)r r+r�ZsectiondictZvardictr�rJr"r"r#r�ss
zRawConfigParser._unify_valuescCs(|��|jkrtd|��|j|��S)zJReturn a boolean value translating from other types if necessary.
        zNot a boolean: %s)r��BOOLEAN_STATESr>rIr"r"r#r��sz#RawConfigParser._convert_to_booleanr)r+r:rJcCsDt|t�std��t|t�s$td��|jr.|r@t|t�s@td��dS)a�Raises a TypeError for non-string values.

        The only legal non-string value if we allow valueless
        options is None, so we need to check if the value is a
        string if:
        - we do not allow valueless options, or
        - we allow valueless options but the value is not None

        For compatibility reasons this method is not used in classic set()
        for RawConfigParsers. It is invoked in every case for mapping protocol
        access and in ConfigParser.set().
        zsection names must be stringszoption keys must be stringszoption values must be stringsN)r�r��	TypeErrorr��r r+r:rJr"r"r#�_validate_value_types�s



z%RawConfigParser._validate_value_typescCs|jSr)r�r$r"r"r#r��szRawConfigParser.converters)N)N)r�)r�)N)N)T)?r&r'r(r)Z
_SECT_TMPLr�r�rr�rxryr�rr4r�r�rr�
_default_dictrr�rrOr�r�r�r�r�r�r�r�r�rhr�r�r�r�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrr�rr�rr�r�r rLr��
__classcell__r"r"r�r#r0s�

���(	




	%����




zcs<eZdZdZe�Zd	�fdd�	Z�fdd�Zdd�Z�Z	S)
rz(ConfigParser implementing interpolation.Ncs"|j||d�t��|||�dS)zmSet an option.  Extends RawConfigParser.set by validating type and
        interpolation syntax on the value.�r:rJN)r r�r�rr�r"r#r��szConfigParser.setcs|j|d�t��|�dS)z�Create a new section in the configuration.  Extends
        RawConfigParser.add_section by validating if the section name is
        a string.)r+N)r r�r�r-r�r"r#r��szConfigParser.add_sectioncCs0z"|j}t�|_|�|j|i�W5||_XdS)z�Reads the defaults passed in the initializer, implicitly converting
        values to strings like the rest of the API.

        Does not perform interpolation for backwards compatibility.
        N)r�rr�r�)r rOZhold_interpolationr"r"r#r��s
zConfigParser._read_defaults)N)
r&r'r(r)rr�r�r�r�r"r"r"r�r#r�s
cs eZdZdZ�fdd�Z�ZS)rz8ConfigParser alias for backwards compatibility purposes.cs"t�j||�tjdtdd�dS)Nz�The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.rBrC)r�rrFrGrH)r r,r�r�r"r#r�s�zSafeConfigParser.__init__)r&r'r(r)rr"r"r"r�r#r�sc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Zddddd�dd�ZdS)rz+A proxy for a single section from a parser.cCsF||_||_|jD].}d|}tj|jt||�d�}t|||�qdS)z@Creates a view on a section of the specified `name` in `parser`.rh��_implN)�_parser�_namer�r�r�rh�getattr�setattr)r rNr�r�r��getterr"r"r#r�s
zSectionProxy.__init__cCsd�|j�S)Nz
<Section: {}>)r4r'r$r"r"r#r%�szSectionProxy.__repr__cCs(|j�|j|�st|��|j�|j|�Sr)r&r�r'rmrhr�r"r"r#r��szSectionProxy.__getitem__cCs"|jj||d�|j�|j||�S)Nr#)r&r r�r'r�r"r"r#r��szSectionProxy.__setitem__cCs,|j�|j|�r |j�|j|�s(t|��dSr)r&r�r'r�rmr�r"r"r#r��s�zSectionProxy.__delitem__cCs|j�|j|�Sr)r&r�r'r�r"r"r#r�szSectionProxy.__contains__cCst|���Sr)r~�_optionsr$r"r"r#r�szSectionProxy.__len__cCs|����Sr)r+rr$r"r"r#r�szSectionProxy.__iter__cCs*|j|jjkr|j�|j�S|j��SdSr)r'r&r�r�rOr$r"r"r#r+�szSectionProxy._optionscCs|jSr)r&r$r"r"r#rNszSectionProxy.parsercCs|jSr)r'r$r"r"r#r�szSectionProxy.nameNF)rdr�r%cKs(|s|jj}||j|f|||d�|��S)z�Get an option value.

        Unless `fallback` is provided, `None` will be returned if the option
        is not found.

        r�)r&rhr')r r:rerdr�r%r�r"r"r#rhs
��zSectionProxy.get)N)r&r'r(r)rr%r�r�r�rrrr+rLrNr�rhr"r"r"r#r�s"	

�c@sJeZdZdZe�d�Zdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)ra/Enables reuse of get*() methods between the parser and section proxies.

    If a parser class implements a getter directly, the value for the given
    key will be ``None``. The presence of the converter name here enables
    section proxies to find and use the implementation on the parser class.
    z^get(?P<name>.+)$cCsR||_i|_t|j�D]6}|j�|�}|rtt|j|��s<qd|j|�d�<qdS)Nr�)r&�_data�dir�	GETTERCREri�callabler(rk)r rNr*rtr"r"r#r%szConverterMapping.__init__cCs
|j|Sr)r,r�r"r"r#r�.szConverterMapping.__getitem__c	Cs�zd|}Wn(tk
r4td�|t|����YnX|dkrFtd��||j|<tj|jj|d�}||_	t
|j||�|j��D] }tj|j|d�}t
|||�q�dS)NrhzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a name)r�r$)
rr>r4�typer,r�r�r&r�Z	converterr)�valuesrh)r r�rJ�k�func�proxyr*r"r"r#r�1s �
zConverterMapping.__setitem__c	Cs~zd|p
d}Wntk
r,t|��YnX|j|=t�|jf|j���D],}zt||�WqLtk
rvYqLYqLXqLdS)Nrh)	rrmr,rrr&r1�delattrr�)r r�r2�instr"r"r#r�AszConverterMapping.__delitem__cCs
t|j�Sr)�iterr,r$r"r"r#rOszConverterMapping.__iter__cCs
t|j�Sr)r~r,r$r"r"r#rRszConverterMapping.__len__N)
r&r'r(r)rxryr.rr�r�r�rrr"r"r"r#rs
	))r)Zcollections.abcr�collectionsrrr�r�rr�rxrrF�__all__rr!rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>st
�	
	

+HJ&| 
Fargparse.cpython-38.opt-2.pyc000064400000147231151450073350011753 0ustar00U

e5dw�@s,dZddddddddd	d
ddd
ddddgZddlZddlZddlZddlZ	ddl
m
ZmZdZ
dZdZdZdZdZdZGdd�de�Zdd�ZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d�de�ZGd$d	�d	e�Zd%d&�ZGd'd�de�ZGd(d�de�ZGd)d�de�Z Gd*d+�d+e �Z!Gd,d-�d-e �Z"Gd.d/�d/e"�Z#Gd0d1�d1e"�Z$Gd2d3�d3e �Z%Gd4d5�d5e �Z&Gd6d7�d7e �Z'Gd8d9�d9e �Z(Gd:d;�d;e �Z)Gd<d=�d=e �Z*Gd>d?�d?e%�Z+Gd@d�de�Z,GdAd
�d
e�Z-GdBdC�dCe�Z.GdDdE�dEe.�Z/GdFdG�dGe/�Z0GdHd�dee.�Z1dS)Iz1.1�ArgumentParser�
ArgumentError�ArgumentTypeError�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...Z_unrecognized_argsc@s$eZdZdd�Zdd�Zdd�ZdS)�_AttributeHoldercCs�t|�j}g}i}|��D]}|�t|��q|��D],\}}|��rZ|�d||f�q6|||<q6|rz|�dt|��d|d�|�fS)N�%s=%rz**%s�%s(%s)�, )�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�selfZ	type_name�arg_stringsZ	star_args�arg�name�value�r*� /usr/lib64/python3.8/argparse.py�__repr__ts

z_AttributeHolder.__repr__cCst|j���S�N)�sorted�__dict__�items�r%r*r*r+r"�sz_AttributeHolder._get_kwargscCsgSr-r*r1r*r*r+r�sz_AttributeHolder._get_argsN)r�
__module__�__qualname__r,r"rr*r*r*r+rks	rcCs6|dkrgSt|�tkr$|dd�Sddl}|�|�S)Nr)r�list�copy)r0r5r*r*r+�_copy_items�sr6c@s�eZdZd:dd�Zdd�Zdd	�ZGd
d�de�Zdd
�Zdd�Z	dd�Z
dd�Zd;dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)<r��NcCs�|dkrt��j}|d8}||_||_t|t|d|d��|_||_d|_	d|_
d|_|�|d�|_
|j
|_t�dtj�|_t�d�|_dS)Nr7�rz\s+z\n\n\n+)�_shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r%�progZindent_incrementZmax_help_position�widthr*r*r+�__init__�s 
�zHelpFormatter.__init__cCs"|j|j7_|jd7_dS�N��rCr>rDr1r*r*r+�_indent�szHelpFormatter._indentcCs"|j|j8_|jd8_dSrQrSr1r*r*r+�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dSr-)�	formatter�parent�headingr0)r%rVrWrXr*r*r+rP�szHelpFormatter._Section.__init__cCs�|jdk	r|j��|jj}|dd�|jD��}|jdk	rD|j��|sLdS|jtk	rz|jdk	rz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr*r*)�.0�func�argsr*r*r+�
<listcomp>�sz6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s:
�
)	rWrVrT�_join_partsr0rUrXrrC)r%r$Z	item_helpZcurrent_indentrXr*r*r+�format_help�s



z"HelpFormatter._Section.format_help)N)rr2r3rPr`r*r*r*r+rF�s
rFcCs|jj�||f�dSr-)rHr0r )r%rZr[r*r*r+�	_add_item�szHelpFormatter._add_itemcCs0|��|�||j|�}|�|jg�||_dSr-)rTrFrHrar`)r%rXZsectionr*r*r+�
start_section�szHelpFormatter.start_sectioncCs|jj|_|��dSr-)rHrWrUr1r*r*r+�end_section�s
zHelpFormatter.end_sectioncCs$|tk	r |dk	r |�|j|g�dSr-)rra�_format_text)r%�textr*r*r+�add_text�szHelpFormatter.add_textcCs&|tk	r"||||f}|�|j|�dSr-)rra�
_format_usage)r%�usage�actions�groups�prefixr[r*r*r+�	add_usage�szHelpFormatter.add_usagecCsv|jtk	rr|j}||�g}|�|�D]}|�||��q$tdd�|D��}||j}t|j|�|_|�|j	|g�dS)NcSsg|]}t|��qSr*��len�rY�sr*r*r+r\
sz.HelpFormatter.add_argument.<locals>.<listcomp>)
�helpr�_format_action_invocation�_iter_indented_subactionsr r@rCrEra�_format_action)r%�actionZget_invocationZinvocations�	subactionZinvocation_lengthZ
action_lengthr*r*r+�add_arguments


�zHelpFormatter.add_argumentcCs|D]}|�|�qdSr-)rw)r%rirur*r*r+�
add_argumentsszHelpFormatter.add_argumentscCs.|j��}|r*|j�d|�}|�d�d}|S)N�

r^)rGr`rM�sub�strip)r%rqr*r*r+r`s

zHelpFormatter.format_helpcCsd�dd�|D��S)Nr]cSsg|]}|r|tk	r|�qSr*)r)rY�partr*r*r+r\!s�z-HelpFormatter._join_parts.<locals>.<listcomp>)r$)r%Zpart_stringsr*r*r+r_ s
�zHelpFormatter._join_partscs|dkrtd�}|dk	r,|t|jd�}�n�|dkrL|sLdt|jd�}�n�|dk�rdt|jd�}g}g}|D] }|jr�|�|�qr|�|�qr|j}	|	|||�}
d�dd�||
fD��}|j|j�t	|�t	|��k�rd}|	||�}|	||�}
t
�||�}t
�||
�}d�fdd	�	}t	|�t	|�d
�k�r�dt	|�t	|�d}|�r|||g|||�}|�|||��n |�r�||g|||�}n|g}nZdt	|�}||}|||�}t	|�dk�r�g}|�|||��|�|||��|g|}d�|�}d
||fS)Nzusage: �rNz%(prog)s� cSsg|]}|r|�qSr*r*ror*r*r+r\Asz/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|dk	rt|�d}nt|�d}|D]Z}|dt|��krn|rn|�|d�|��g}t|�d}|�|�|t|�d7}q.|r�|�|d�|��|dk	r�|dt|�d�|d<|S)NrRr~r)rnr r$)�parts�indentrk�lines�lineZline_lenr|��
text_widthr*r+�	get_linesUs"
z.HelpFormatter._format_usage.<locals>.get_linesg�?rRr^z%s%s

)N)
�_�dictr=�option_stringsr �_format_actions_usager$rBrCrnrI�findall�extend)r%rhrirjrkrN�	optionals�positionalsru�formatZaction_usageZpart_regexpZ	opt_usageZ	pos_usageZ	opt_partsZ	pos_partsr�r�r�rr*r�r+rg%sX
�




zHelpFormatter._format_usagec	Cs�t�}i}|D�]}z|�|jd�}Wntk
r@YqYqX|t|j�}|||�|jkr|jD]}|�|�qh|js�||kr�||d7<nd||<||kr�||d7<nd||<nF||kr�||d7<nd||<||k�r||d7<nd||<t|d|�D]}	d	||	<�qqg}
t|�D�]"\}	}|j	t
k�r�|
�d�|�|	�d	k�rr|�
|	�n"|�|	d�d	k�rX|�
|	d�n�|j�s�|�|�}|�||�}||k�r�|ddk�r�|d
dk�r�|dd
�}|
�|�nf|jd}
|jdk�rd|
}n"|�|�}|�||�}d|
|f}|j�sN||k�rNd
|}|
�|��q6t|dd�D]}	||	g|
|	|	�<�qhd�dd�|
D��}d}d}t�d|d|�}t�d|d|�}t�d||fd|�}t�dd|�}|��}|S)Nrz [�[�]z (�(�)rR�|����%s�%s %s�[%s]T)�reverser~cSsg|]}|dk	r|�qSr-r*)rY�itemr*r*r+r\�sz7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1� (%s)z%s *%sr]z\(([^|]*)\))�set�index�_group_actions�
ValueErrorrn�add�required�range�	enumeraterqrr �get�popr��#_get_default_metavar_for_positional�_format_args�nargs�!_get_default_metavar_for_optionalr.r$rIrzr{)r%rirj�
group_actionsZinserts�group�start�endru�ir�defaultr|�
option_string�args_stringre�open�closer*r*r+r��sz










z#HelpFormatter._format_actions_usagecCsFd|kr|t|jd�}t|j|jd�}d|j}|�|||�dS)Nz%(prog)r}�r~ry)r�r=r@rBrC�
_fill_text)r%rer�r�r*r*r+rd�s

zHelpFormatter._format_textc
Cs:t|jd|j�}t|j|d�}||jd}|�|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|jr�|�	|�}	|�
|	|�}
|�d|d|
df�|
dd�D]}|�d|d|f�q�n|�d��s|�d�|�
|�D]}|�|�|���q|�|�S)	Nr7r�r]z%*s%s
z	%*s%-*s  rrRr^)r?rErAr@rBrCrrrqrn�_expand_help�_split_linesr �endswithrsrtr_)
r%ruZ
help_positionZ
help_widthZaction_widthZ
action_header�tupZindent_firstrZ	help_textZ
help_linesr�rvr*r*r+rt�s8
�



zHelpFormatter._format_actioncCs�|js&|�|�}|�||�d�\}|Sg}|jdkrB|�|j�n4|�|�}|�||�}|jD]}|�d||f�q^d�|�SdS)NrRrr�r)	r�r��_metavar_formatterr�r�r�r�r r$)r%rur��metavarrr�r�r*r*r+rr"s



z'HelpFormatter._format_action_invocationcsP|jdk	r|j�n.|jdk	r<dd�|jD�}dd�|��n|��fdd�}|S)NcSsg|]}t|��qSr*��str)rYZchoicer*r*r+r\>sz4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdSr-)�
isinstance�tuple)Z
tuple_size��resultr*r+r�Cs
z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr$)r%ru�default_metavarZchoice_strsr�r*r�r+r�:s

z HelpFormatter._metavar_formattercCs�|�||�}|jdkr$d|d�}n�|jtkr<d|d�}n�|jtkrTd|d�}n�|jtkrld|d�}n�|jtkr|d}nt|jtkr�d|d�}n\|jtkr�d	}nLzd
d�t|j�D�}Wnt	k
r�t
d�d�YnXd
�|�||j�}|S)Nr�rRr�z
[%s [%s ...]]r7z%s [%s ...]rz%s ...r]cSsg|]}d�qS)r�r*)rYr�r*r*r+r\\sz.HelpFormatter._format_args.<locals>.<listcomp>zinvalid nargs valuer~)r�r�r
rrrrrr��	TypeErrorr�r$)r%rur�Zget_metavarr�Zformatsr*r*r+r�Js*






zHelpFormatter._format_argscCs�tt|�|jd�}t|�D]}||tkr||=qt|�D] }t||d�r:||j||<q:|�d�dk	r�d�dd�|dD��}||d<|�	|�|S)Nr}rr�rcSsg|]}t|��qSr*r�)rY�cr*r*r+r\ksz.HelpFormatter._expand_help.<locals>.<listcomp>)
r��varsr=r4r�hasattrrr�r$�_get_help_string)r%ruZparamsr(Zchoices_strr*r*r+r�bszHelpFormatter._expand_helpccs@z
|j}Wntk
rYnX|��|�EdH|��dSr-)�_get_subactions�AttributeErrorrTrU)r%ruZget_subactionsr*r*r+rsos
z'HelpFormatter._iter_indented_subactionscCs&|j�d|���}ddl}|�||�S)Nr~r)rLrzr{�textwrapZwrap)r%rerOr�r*r*r+r�yszHelpFormatter._split_linescCs,|j�d|���}ddl}|j||||d�S)Nr~r)Zinitial_indentZsubsequent_indent)rLrzr{r�Zfill)r%rerOr�r�r*r*r+r��s�zHelpFormatter._fill_textcCs|jSr-)rq�r%rur*r*r+r��szHelpFormatter._get_help_stringcCs
|j��Sr-)�dest�upperr�r*r*r+r��sz/HelpFormatter._get_default_metavar_for_optionalcCs|jSr-)r�r�r*r*r+r��sz1HelpFormatter._get_default_metavar_for_positional)r7r8N)N)rr2r3rPrTrU�objectrFrarbrcrfrlrwrxr`r_rgr�rdrtrrr�r�r�rsr�r�r�r�r�r*r*r*r+r�s<	�

`g/

c@seZdZdd�ZdS)rcs d��fdd�|jdd�D��S)Nr]c3s|]}�|VqdSr-r*)rYr��r�r*r+�	<genexpr>�sz9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r$�
splitlines)r%rerOr�r*r�r+r��sz&RawDescriptionHelpFormatter._fill_textN)rr2r3r�r*r*r*r+r�sc@seZdZdd�ZdS)rcCs|��Sr-)r�)r%rerOr*r*r+r��sz!RawTextHelpFormatter._split_linesN)rr2r3r�r*r*r*r+r�sc@seZdZdd�ZdS)rcCs>|j}d|jkr:|jtk	r:ttg}|js2|j|kr:|d7}|S)Nz
%(default)z (default: %(default)s))rqr�rr
rr�r�)r%rurqZdefaulting_nargsr*r*r+r��s

z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr2r3r�r*r*r*r+r�sc@seZdZdd�Zdd�ZdS)r	cCs|jjSr-�rrr�r*r*r+r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjSr-r�r�r*r*r+r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr2r3r�r�r*r*r*r+r	�scCsN|dkrdS|jrd�|j�S|jdtfkr2|jS|jdtfkrF|jSdSdS)N�/)r�r$r�rr�)�argumentr*r*r+�_get_action_name�sr�c@seZdZdd�Zdd�ZdS)rcCst|�|_||_dSr-)r��
argument_name�message)r%r�r�r*r*r+rP�s
zArgumentError.__init__cCs(|jdkrd}nd}|t|j|jd�S)Nz%(message)sz'argument %(argument_name)s: %(message)s)r�r�)r�r�r�)r%r�r*r*r+�__str__�s
�zArgumentError.__str__N)rr2r3rPr�r*r*r*r+r�sc@seZdZdS)rN)rr2r3r*r*r*r+r�sc@s(eZdZd	dd�Zdd�Zd
dd�ZdS)rNFcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr-�
r�r�r��constr�rr�r�rqr��r%r�r�r�r�r�rr�r�rqr�r*r*r+rP)szAction.__init__c	s(ddddddddd	g	}�fd
d�|D�S)Nr�r�r�r�r�rr�rqr�csg|]}|t�|�f�qSr*��getattr�rYr(r1r*r+r\Ksz&Action._get_kwargs.<locals>.<listcomp>r*�r%�namesr*r1r+r"?s�zAction._get_kwargscCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr��r%�parser�	namespace�valuesr�r*r*r+�__call__MszAction.__call__)NNNNNFNN)N)rr2r3rPr"r�r*r*r*r+r�s6�
cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr�)r�r
�superr�rPr���	__class__r*r+rPSs 
�z_StoreAction.__init__cCst||j|�dSr-)�setattrr�r�r*r*r+r�psz_StoreAction.__call__)NNNNNFNN)N�rr2r3rPr��
__classcell__r*r*r�r+r�Qs�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreConstActionNFc	s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�rq)r�r�rP�r%r�r�r�r�r�rqr�r�r*r+rPvs
�z_StoreConstAction.__init__cCst||j|j�dSr-)r�r�r�r�r*r*r+r��sz_StoreConstAction.__call__)NFNN)Nr�r*r*r�r+r�ts�r�cseZdZd�fdd�	Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT�r�r�r�r�r�rq)r�r�rP�r%r�r�r�r�rqr�r*r+rP�s
�z_StoreTrueAction.__init__)FFN�rr2r3rPr�r*r*r�r+r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NFr�)r�r�rPr�r�r*r+rP�s
�z_StoreFalseAction.__init__)TFNr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�
_AppendActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriater�r�)r�r
r�r�rPr�r�r*r+rP�s 
�z_AppendAction.__init__cCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r6r r��r%r�r�r�r�r0r*r*r+r��s
z_AppendAction.__call__)NNNNNFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_AppendConstActionNFc
s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�rqr�)r�r�rPr�r�r*r+rP�s
�z_AppendConstAction.__init__cCs4t||jd�}t|�}|�|j�t||j|�dSr-)r�r�r6r r�r�r�r*r*r+r��sz_AppendConstAction.__call__)NFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�rq)r�r�rPr�r�r*r+rP�s
�z_CountAction.__init__cCs0t||jd�}|dkrd}t||j|d�dS�NrrR)r�r�r�)r%r�r�r�r��countr*r*r+r��sz_CountAction.__call__)NFN)Nr�r*r*r�r+r��s
�r�cs.eZdZeedf�fdd�	Zddd�Z�ZS)�_HelpActionNcstt|�j|||d|d�dS�Nr)r�r�r�r�rq)r�r�rP)r%r�r�r�rqr�r*r+rPs
�z_HelpAction.__init__cCs|��|��dSr-)�
print_help�exitr�r*r*r+r�sz_HelpAction.__call__)N�rr2r3rrPr�r�r*r*r�r+r�s
�r�cs0eZdZdeedf�fdd�	Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dSr�)r�rrP�version)r%r�rr�r�rqr�r*r+rPs
�z_VersionAction.__init__cCsD|j}|dkr|j}|��}|�|�|�|��tj�|��dSr-)r�_get_formatterrf�_print_messager`�_sys�stdoutr)r%r�r�r�r�rrVr*r*r+r�(s
z_VersionAction.__call__)Nrr*r*r�r+rs�rcsPeZdZGdd�de�Zedddf�fdd�	Zdd�Zd	d
�Zd
dd�Z	�Z
S)�_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|dd�|�7}ttj|�}|jg|||d�dS)Nr�r)r�r�rqr�)r$r�r	�_ChoicesPseudoActionrP)r%r(�aliasesrqr�r�Zsupr�r*r+rP6s
�z/_SubParsersAction._ChoicesPseudoAction.__init__r�r*r*r�r+r
4sr
FNc	s<||_||_i|_g|_tt|�j||t|j|||d�dS)N)r�r�r�r�r�rqr�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr�r	rPr)r%r�rN�parser_classr�r�rqr�r�r*r+rP>s	
�z_SubParsersAction.__init__cKs�|�d�dkr d|j|f|d<|�dd�}d|krX|�d�}|�|||�}|j�|�|jf|�}||j|<|D]}||j|<qr|S)NrNr�rr*rq)r�rr�r
rr r
r)r%r(�kwargsrrqZ
choice_actionr��aliasr*r*r+�
add_parserUs

z_SubParsersAction.add_parsercCs|jSr-)rr1r*r*r+r�lsz!_SubParsersAction._get_subactionscCs�|d}|dd�}|jtk	r,t||j|�z|j|}Wn<tk
rv|d�|j�d�}td�|}t||��YnX|�|d�\}	}t	|	��
�D]\}
}t||
|�q�|r�t	|��tg�t
|t��|�dS)NrrRr)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr�r�KeyErrorr$r�r�parse_known_argsr�r0�
setdefault�_UNRECOGNIZED_ARGS_ATTRr�r�)r%r�r�r�r�rr&r[�msgZsubnamespace�keyr)r*r*r+r�os$

�	z_SubParsersAction.__call__)N)rr2r3rr
rrPrr�r�r�r*r*r�r+r	2s�r	c@seZdZddd�ZdS)�
_ExtendActionNcCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r6r�r�r�r*r*r+r��s
z_ExtendAction.__call__)N)rr2r3r�r*r*r*r+r�src@s&eZdZd
dd�Zdd�Zdd	�ZdS)r�rr�NcCs||_||_||_||_dSr-)�_mode�_bufsize�	_encoding�_errors)r%�mode�bufsize�encoding�errorsr*r*r+rP�szFileType.__init__c
Cs�|dkr>d|jkrtjSd|jkr(tjStd�|j}t|��zt||j|j|j|j	�WSt
k
r�}z"||d�}td�}t||��W5d}~XYnXdS)N�-r�wzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)rr�stdinrr�r�r�rrr �OSErrorr)r%�stringr�er[r�r*r*r+r��s

�
zFileType.__call__cCsT|j|jf}d|jfd|jfg}d�dd�|D�dd�|D��}dt|�j|fS)Nr#r$rcSsg|]}|dkrt|��qS)r�)r!)rYr'r*r*r+r\�sz%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|dk	rd||f�qS)Nrr*)rY�kwr'r*r*r+r\�s�r)rrrr r$rr)r%r[rZargs_strr*r*r+r,�s�zFileType.__repr__)rr�NN)rr2r3rPr�r,r*r*r*r+r�s
c@s$eZdZdd�Zdd�Zdd�ZdS)r
cKs|D]}t||||�qdSr-)r�)r%rr(r*r*r+rP�szNamespace.__init__cCst|t�stSt|�t|�kSr-)r�r
�NotImplementedr�)r%�otherr*r*r+�__eq__�s
zNamespace.__eq__cCs
||jkSr-)r/)r%rr*r*r+�__contains__�szNamespace.__contains__N)rr2r3rPr0r1r*r*r*r+r
�scs�eZdZ�fdd�Zdd�Zd&dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|���||_||_||_||_i|_|�ddt	�|�ddt	�|�ddt
�|�ddt�|�ddt�|�ddt
�|�ddt�|�ddt�|�dd	t�|�dd
t�|�ddt�|�ddt�|��g|_i|_g|_g|_i|_t�d
�|_g|_dS)NruZstoreZstore_const�
store_trueZstore_falser Zappend_constr�rqr�parsersr�z^-\d+$|^-\d*\.\d+$)r�r2rP�description�argument_default�prefix_chars�conflict_handler�_registries�registerr�r�r�r�r�r�r�r�rr	r�_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrIrJ�_negative_number_matcher�_has_negative_number_optionals)r%r5r7r6r8r�r*r+rP�s4z_ActionsContainer.__init__cCs|j�|i�}|||<dSr-)r9r)r%�
registry_namer)r��registryr*r*r+r:sz_ActionsContainer.registerNcCs|j|�||�Sr-)r9r�)r%rCr)r�r*r*r+�
_registry_get sz_ActionsContainer._registry_getcKs2|j�|�|jD]}|j|kr||j|_qdSr-)r@�updater<r�r�)r%rrur*r*r+�set_defaults&s

z_ActionsContainer.set_defaultscCs8|jD]"}|j|kr|jdk	r|jSq|j�|d�Sr-)r<r�r�r@r�)r%r�rur*r*r+�get_default/s
z_ActionsContainer.get_defaultcOsD|j}|r&t|�dkrH|dd|krH|r:d|kr:td��|j||�}n|j||�}d|kr�|d}||jkr~|j||d<n|jdk	r�|j|d<|�|�}t|�s�td|f��|f|�}|�	d|j
|j
�}t|�s�td|f��|tkr�td	|f��t|d
��r:z|�
��|d�Wntk
�r8td��YnX|�|�S)NrRrr�z+dest supplied twice for positional argumentr�zunknown action "%s"r�%r is not callablez<%r is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargs)r7rnr��_get_positional_kwargs�_get_optional_kwargsr@r6�_pop_action_class�callablerErrr�rr�r��_add_action)r%r[r�charsr�Zaction_classru�	type_funcr*r*r+rw9s:	 




�z_ActionsContainer.add_argumentcOs t|f|�|�}|j�|�|Sr-)�_ArgumentGroupr>r )r%r[rr�r*r*r+�add_argument_grouplsz$_ActionsContainer.add_argument_groupcKst|f|�}|j�|�|Sr-)�_MutuallyExclusiveGroupr?r )r%rr�r*r*r+�add_mutually_exclusive_groupqsz._ActionsContainer.add_mutually_exclusive_groupcCs`|�|�|j�|�||_|jD]}||j|<q"|jD]"}|j�|�r8|js8|j�d�q8|S)NT)	�_check_conflictr<r �	containerr�r=rA�matchrB)r%rur�r*r*r+rNvs


z_ActionsContainer._add_actioncCs|j�|�dSr-)r<�remover�r*r*r+�_remove_action�sz _ActionsContainer._remove_actioncCs�i}|jD].}|j|kr.td�}t||j��|||j<q
i}|jD]D}|j|krn|j|j|j|jd�||j<|jD]}||j||<qtqD|jD]&}|j	|j
d�}|jD]}|||<q�q�|jD]}|�||��
|�q�dS)Nz.cannot merge actions - two groups are named %r)�titler5r8)r�)r>rZr�r�rRr5r8r�r?rTr�r<r�rN)r%rVZtitle_group_mapr�rZ	group_mapru�mutex_groupr*r*r+�_add_container_actions�s0



�

�

z(_ActionsContainer._add_container_actionscKs^d|krtd�}t|��|�d�ttfkr2d|d<|�d�tkrPd|krPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r�r�)r�r�r�r
rr�)r%r�rrr*r*r+rJ�sz(_ActionsContainer._get_positional_kwargsc	Os�g}g}|D]n}|d|jkr>||jd�}td�}t||��|�|�|d|jkrt|�dkr|d|jkr|�|�q|�dd�}|dkr�|r�|d}n|d}|�|j�}|s�td�}t||��|�dd�}t|||d	�S)
Nr)�optionr7zNinvalid option string %(option)r: must start with a character %(prefix_chars)rrRr�z%dest= is required for options like %rr%r�r])	r7r�r�r rnr��lstrip�replacer�)	r%r[rr�Zlong_option_stringsr�rr�Zdest_option_stringr*r*r+rK�s2�

z&_ActionsContainer._get_optional_kwargscCs|�d|�}|�d||�S)Nru)r�rE)r%rr�rur*r*r+rL�sz#_ActionsContainer._pop_action_classcCsFd|j}zt||�WStk
r@td�}t||j��YnXdS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r8r�r�r�r�)r%Zhandler_func_namerr*r*r+r;�s
z_ActionsContainer._get_handlercCsLg}|jD]&}||jkr
|j|}|�||f�q
|rH|��}|||�dSr-)r�r=r r;)r%ruZconfl_optionalsr�Zconfl_optionalr8r*r*r+rU�s


z!_ActionsContainer._check_conflictcCs6tddt|��}d�dd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %srcSsg|]\}}|�qSr*r*)rYr�rur*r*r+r\	s�z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rrnr$r)r%ru�conflicting_actionsr�Zconflict_stringr*r*r+�_handle_conflict_errors�
�z(_ActionsContainer._handle_conflict_errorcCs>|D]4\}}|j�|�|j�|d�|js|j�|�qdSr-)r�rXr=r�rVrY)r%rurar�r*r*r+�_handle_conflict_resolves
z*_ActionsContainer._handle_conflict_resolve)N)N)rr2r3rPr:rErGrHrwrRrTrNrYr\rJrKrLr;rUrbrcr�r*r*r�r+r2�s$5
	
3($
		r2cs6eZdZd�fdd�	Z�fdd�Z�fdd�Z�ZS)	rQNcs�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)Nr8r7r6r5)rr8r7r6r�rQrPrZr�r9r<r=r@rBr?)r%rVrZr5rrFZ
super_initr�r*r+rPs�z_ArgumentGroup.__init__cs tt|��|�}|j�|�|Sr-)r�rQrNr�r r�r�r*r+rN5sz_ArgumentGroup._add_actioncs tt|��|�|j�|�dSr-)r�rQrYr�rXr�r�r*r+rY:sz_ArgumentGroup._remove_action)NN�rr2r3rPrNrYr�r*r*r�r+rQsrQcs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	rSFcs tt|��|�||_||_dSr-)r�rSrPr��
_container)r%rVr�r�r*r+rPAsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|j�|�}|j�|�|S)Nz-mutually exclusive arguments must be optional)r�r�r�rerNr�r )r%rurr*r*r+rNFsz#_MutuallyExclusiveGroup._add_actioncCs|j�|�|j�|�dSr-)rerYr�rXr�r*r*r+rYNsz&_MutuallyExclusiveGroup._remove_action)Frdr*r*r�r+rS?srScs&eZdZddddgeddddddf�fdd�	Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	d@dd�Z
dAdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdBd%d&�ZdCd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdDd5d6�ZdEd7d8�ZdFd9d:�ZdGd<d=�Zd>d?�Z �Z!S)HrNr%r(Tc
	s"tt|�j}
|
|||	|
d�|dkr6tj�tjd�}||_||_	||_
||_||_||_
||_|j}|td��|_|td��|_d|_dd�}|�dd|�d|kr�dn|d}|j
r�|j|d	|d
ddttd�d
�|D]<}|�|�z
|j}Wntk
�rYq�X|j�|�q�dS)N)r5r7r6r8rzpositional argumentszoptional argumentscSs|Sr-r*)r+r*r*r+�identity�sz)ArgumentParser.__init__.<locals>.identityrr%�hr7rqzshow this help message and exit)rur�rq)r�rrP�_os�path�basenamer�argvrNrh�epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrevrRr��_positionals�
_optionals�_subparsersr:rwrr\r@r�rF)r%rNrhr5rl�parentsrmr7rnr6r8rorpZ	superinitZ	add_grouprfZdefault_prefixrW�defaultsr�r*r+rPfsJ�
�

zArgumentParser.__init__cs"ddddddg}�fdd�|D�S)	NrNrhr5rmr8rocsg|]}|t�|�f�qSr*r�r�r1r*r+r\�sz.ArgumentParser._get_kwargs.<locals>.<listcomp>r*r�r*r1r+r"�s�zArgumentParser._get_kwargsc	Ks�|jdk	r|�td��|�dt|��d|ks8d|krht|�dd��}t|�dd��}|�||�|_n|j|_|�d�dkr�|�	�}|�
�}|j}|�|j
||d�|����|d<|�|d�}|fd	gi|��}|j�|�|S)
Nz(cannot have multiple subparser argumentsrrZr5ZsubcommandsrNr]r4r�)rsr(r�rrr�rRrqr�r�_get_positional_actionsr?rlrhr`r{rLrN)	r%rrZr5rVr�rjZ
parsers_classrur*r*r+�add_subparsers�s$
zArgumentParser.add_subparserscCs$|jr|j�|�n|j�|�|Sr-)r�rrrNrqr�r*r*r+rN�szArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr*�r��rYrur*r*r+r\�s�z8ArgumentParser._get_optional_actions.<locals>.<listcomp>�r<r1r*r*r+�_get_optional_actions�s�z$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr*rxryr*r*r+r\�s�z:ArgumentParser._get_positional_actions.<locals>.<listcomp>rzr1r*r*r+rv�s�z&ArgumentParser._get_positional_actionscCs4|�||�\}}|r0td�}|�|d�|��|S�Nzunrecognized arguments: %sr~)rr�r(r$�r%r[r�rkrr*r*r+�
parse_args�s
zArgumentParser.parse_argscCs|dkrtjdd�}nt|�}|dkr.t�}|jD]4}|jtk	r4t||j�s4|jtk	r4t	||j|j�q4|j
D] }t||�spt	|||j
|�qpz>|�||�\}}t|t�r�|�
t|t��t|t�||fWStk
�rt��d}|�t|��YnXdSrQ)rrkr4r
r<r�rr�r�r�r@�_parse_known_argsrr�r��delattrr�exc_infor(r�)r%r[r�rur��errr*r*r+r�s,







zArgumentParser.parse_known_argscs�	jdk	r�	����i��	jD]R}|j}t|j�D]<\}}��|g�}|�|d|��|�||dd��q2qi�g}t��}	t|	�D]^\}}
|
dkr�|�d�|	D]}
|�d�q�q��	�	|
�}|dkr�d}n|�|<d}|�|�q�d�
|��t��t��d�����	fdd�	������	�fd	d
�}
�	�������	�fdd�}g�d
�
��r`t
��}nd}�
|k�r�t�
fdd��D��}�
|k�r�|�
�}|�
k�r�|�
�qdn|�
�
�k�r҈�
|�}��|�|�
|
�
��
�qd|�
�}���|d��g}�	jD]|}|�k�r|j�r(|�t|��nT|jdk	�rt|jt��rt�|j��r|jt�|j�k�rt�|j�	�||j���q|�r��	�td�d�
|���	jD]X}|j�r�|jD]}|�k�r��q��q�dd�|jD�}td�}�	�|d�
|���q���fS)NrR�--r%�A�Or]cs|��|���||�}||jk	rb��|���|g�D]*}|�kr6td�}t|�}t|||��q6|tk	rx|��||�dS)Nznot allowed with argument %s)r��_get_valuesr�r�r�r�rr)ruZargument_stringsr�Zargument_valuesZconflict_actionrZaction_name)�action_conflictsr��seen_actions�seen_non_default_actionsr%r*r+�take_action@s


z5ArgumentParser._parse_known_args.<locals>.take_actioncs~�|}|\}}}�j}g}|dkr:���|�|dS|dk	�r||d�}�j}|dkr�|d|kr�|�|g|f�|d}	|	|d}|dd�p�d}
�j}||kr�||}|
}ntd�}t|||��nB|dkr�|d}
|g}|�|||f��q\ntd�}t|||��q|d}�|d�}|||�}||}
�||
�}|�|||f��q\q|D]\}}}�|||��q`|
S)NrRr�rzignored explicit argument %r)�_match_argumentr r7r=r�r)�start_index�option_tuplerur��explicit_argZmatch_argumentZ
action_tuples�	arg_countrO�charZnew_explicit_argZ
optionals_mapr�stopr[r�Zselected_patterns)r&�arg_strings_pattern�extras�option_string_indicesr%r�r*r+�consume_optionalUsL



z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsn�j}�|d�}|�|�}t�|�D]*\}}�|||�}||7}�||�q&�t|�d��dd�<|Sr-)�_match_arguments_partial�ziprn)r�Z
match_partialZselected_patternZ
arg_countsrur�r[)r&r�r�r%r�r*r+�consume_positionals�s
z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrr�csg|]}|�kr|�qSr*r*)rYr�)r�r*r+r\�s�z4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %srcSsg|]}|jtk	rt|��qSr*)rqrr�ryr*r*r+r\�s
�z#one of the arguments %s is requiredr~)N)rn�_read_args_from_filesr?r�r�rr��iterr �_parse_optionalr$r�rvr@r?r<r�r�r�r�r�r�r�r�r��
_get_valuer(r�)r%r&r�r[r�r�Zmutex_actionZ	conflictsZarg_string_pattern_partsZarg_strings_iter�
arg_stringr��patternr�r�Zmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ
stop_indexZrequired_actionsrur�r�rr*)r�r&r�r�r�r�r�r�r�r%r�r�r+rs�





J

�






�
���
�



�z ArgumentParser._parse_known_argsc
Cs�g}|D]�}|r|d|jkr*|�|�qzdt|dd���J}g}|����D]}|�|�D]}|�|�q\qN|�|�}|�|�W5QRXWqtk
r�t	�
�d}|�t|��YqXq|Sr�)
rnr r��readr��convert_arg_line_to_argsr�r�r*rr�r(r�)r%r&Znew_arg_stringsr�Z	args_file�arg_liner'r�r*r*r+r�s 
z$ArgumentParser._read_args_from_filescCs|gSr-r*)r%r�r*r*r+r�!sz'ArgumentParser.convert_arg_line_to_argscCsz|�|�}t�||�}|dkrldtd�ttd�ttd�i}|�|j�}|dkrbtdd|j�|j}t	||��t
|�d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrR)�_get_nargs_patternrIrWr�r
rr�r�rrrnr�)r%rur��
nargs_patternrWZnargs_errorsrr*r*r+r�$s(
���
zArgumentParser._match_argumentcsrg}tt|�dd�D]X}|d|�}d��fdd�|D��}t�||�}|dk	r|�dd�|��D��qnq|S)Nrr�r]csg|]}��|��qSr*)r�ryr1r*r+r\@s�z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|]}t|��qSr*rm)rYr+r*r*r+r\Ds)r�rnr$rIrWr�rj)r%rir�r�r�Z
actions_slicer�rWr*r1r+r�:s�z'ArgumentParser._match_arguments_partialc
Cs|sdS|d|jkrdS||jkr8|j|}||dfSt|�dkrHdSd|kr~|�dd�\}}||jkr~|j|}|||fS|�|�}t|�dkr�d�dd�|D��}||d�}td�}|�||�nt|�dkr�|\}	|	S|j�	|�r�|j
s�dSd	|k�rdSd|dfS)
NrrR�=rcSsg|]\}}}|�qSr*r*)rYrur�r�r*r*r+r\is�z2ArgumentParser._parse_optional.<locals>.<listcomp>)r^Zmatchesz4ambiguous option: %(option)s could match %(matches)sr~)r7r=rn�split�_get_option_tuplesr$r�r(rArWrB)
r%r�rur�r�Z
option_tuplesZoptionsr[rr�r*r*r+r�Js>







�

zArgumentParser._parse_optionalc
Cs0g}|j}|d|kr�|d|kr�|jr~d|krB|�dd�\}}n|}d}|jD],}|�|�rP|j|}|||f}|�|�qPn�|d|k�r|d|k�r|}d}|dd�}|dd�}	|jD]T}||kr�|j|}|||	f}|�|�q�|�|�r�|j|}|||f}|�|�q�n|�td�|�|S)NrrRr�r7zunexpected option string: %s)r7rpr�r=�
startswithr r(r�)
r%r�r�rOZ
option_prefixr�rur�Zshort_option_prefixZshort_explicit_argr*r*r+r��s:









z!ArgumentParser._get_option_tuplescCs�|j}|dkrd}nf|tkr"d}nX|tkr0d}nJ|tkr>d}n<|tkrLd}n.|tkrZd}n |tkrhd}ndd	�d
|�}|jr�|�	d	d�}|�	dd�}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�r]r%)
r�r
rrrrrr$r�r`)r%rur�r�r*r*r+r��s(z!ArgumentParser._get_nargs_patterncCs4|�||�\}}|r0td�}|�|d�|��|Sr|)�parse_known_intermixed_argsr�r(r$r}r*r*r+�parse_intermixed_args�s
z$ArgumentParser.parse_intermixed_argsc	s�|���dd��D�}|r,td|dj���fdd�|jD�rHtd���zN|j}z�|jdkrp|��dd�|_�D] }|j|_t	|_|j|_t	|_qt|�
||�\}}�D]J}t||j�r�t
||j�gkr�ddlm}|d	|j|f�t||j�q�W5�D]}|j|_|j|_q�X|��}zJ|D]}|j|_d
|_�q$|jD]}	|	j|	_d
|	_�q@|�
||�\}}
W5|D]}|j|_�qn|jD]}	|	j|	_�q�XW5||_X||
fS)NcSsg|]}|jttfkr|�qSr*)r�rrryr*r*r+r\�s�z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>z3parse_intermixed_args: positional arg with nargs=%srcs&g|]}|jD]}|�kr|j�qqSr*)r�r�)rYr�ru�r�r*r+r\�s
�z;parse_intermixed_args: positional in mutuallyExclusiveGroup�)�warnzDo not expect %s in %sF)rvr�r�r?rhZ
save_nargsZsave_defaultr��format_usagerrr�r�r��warningsr�r�r{Z
save_requiredr�)r%r[r��aZ
save_usageruZremaining_argsr�r�r�r�r*r�r+r��s`
�
��


�
z*ArgumentParser.parse_known_intermixed_argscs��jttfkr2z|�d�Wntk
r0YnX|sz�jtkrz�jrN�j}n�j}t	|t
�rv���|�}���|��n|s��jt
kr��js��jdk	r��j}n|}���|�n�t|�dkr�jdtfkr�|\}���|�}���|�n��jtk�r��fdd�|D�}np�jtk�r@��fdd�|D�}���|d�n>�jtk�rRt}n,��fdd�|D�}|D]}���|��qj|S)Nr�rRcsg|]}���|��qSr*�r��rY�v�rur%r*r+r\Z	sz.ArgumentParser._get_values.<locals>.<listcomp>csg|]}���|��qSr*r�r�r�r*r+r\^	srcsg|]}���|��qSr*r�r�r�r*r+r\g	s)r�rrrXr�r
r�r�r�r�r�r��_check_valuerrnr)r%rur&r)r�r�r*r�r+r�6	sD
�
zArgumentParser._get_valuesc	Cs�|�d|j|j�}t|�s0td�}t|||��z||�}Wn�tk
r~t|jdt|j��}tt	�
�d�}t||��YnLttfk
r�t|jdt|j��}||d�}td�}t|||��YnX|S)NrrIrrR)rr)z!invalid %(type)s value: %(value)r)
rErrMr�rrr�r!r�rr�r�r�)r%rur�rPrr�r(r[r*r*r+r�n	s 
zArgumentParser._get_valuecCsF|jdk	rB||jkrB|d�tt|j��d�}td�}t|||��dS)Nr)r)r�z3invalid choice: %(value)r (choose from %(choices)s))r�r$�mapr!r�r)r%rur)r[rr*r*r+r��	s�zArgumentParser._check_valuecCs$|��}|�|j|j|j�|��Sr-)rrlrhr<r?r`)r%rVr*r*r+r��	s
�zArgumentParser.format_usagecCst|��}|�|j|j|j�|�|j�|jD]0}|�|j	�|�|j�|�
|j�|��q.|�|j
�|��Sr-)rrlrhr<r?rfr5r>rbrZrxr�rcrlr`)r%rVZaction_groupr*r*r+r`�	s�

zArgumentParser.format_helpcCs|j|jd�S)Nr})rmrNr1r*r*r+r�	szArgumentParser._get_formattercCs"|dkrtj}|�|��|�dSr-)rrrr��r%�filer*r*r+�print_usage�	szArgumentParser.print_usagecCs"|dkrtj}|�|��|�dSr-)rrrr`r�r*r*r+r�	szArgumentParser.print_helpcCs |r|dkrtj}|�|�dSr-)r�stderr�write)r%r�r�r*r*r+r�	szArgumentParser._print_messagercCs |r|�|tj�t�|�dSr-)rrr�r)r%Zstatusr�r*r*r+r�	szArgumentParser.exitcCs0|�tj�|j|d�}|�dtd�|�dS)N)rNr�r7z%(prog)s: error: %(message)s
)r�rr�rNrr�)r%r�r[r*r*r+r(�	s	zArgumentParser.error)NN)NN)NN)NN)N)N)N)rN)"rr2r3rrPr"rwrNr{rvr~rrr�r�r�r�r�r�r�r�r�r�r�r�r�r`rr�rrrr(r�r*r*r�r+rSsT�@

#w:-1

M8


	
)2�__version__�__all__�osrh�rerIZshutilr:�sysrrr�rrr
rrrrrr�rr6rrrrr	r��	Exceptionrrrr�r�r�r�r�r�r�r�rr	rrr
r2rQrSrr*r*r*r+�<module>As~�z
	[#&]7:"uu.cpython-38.opt-1.pyc000064400000007314151450073350010574 0ustar00U

��.em�@sjdZddlZddlZddlZdddgZGdd�de�Zddd�d	d�Zdd
d�Zdd�Z	e
d
krfe	�dS)z�Implementation of the UUencode and UUdecode functions.

encode(in_file, out_file [,name, mode], *, backtick=False)
decode(in_file [, out_file, mode, quiet])
�N�Error�encode�decodec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/uu.pyr&sF��backtickc	Csjg}�zH|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfzt�	|�j
}Wntk
rdYnXt|d�}|�
|�|dkr�tjj}nt|t�r�t|d�}|�
|�|dkr�d}|dkr�d}|�dd�}|�dd	�}|�d
|d@|f�d��|�d
�}t|�dk�r0|�tj||d��|�d
�}�q|�rB|�d�n
|�d�W5|D]}|���qTXdS)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
s`
end
s 
end
)�close�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu)�in_file�out_file�name�moder�opened_files�f�datarrr	r)sF








c

Cspg}|dkrtjj}nt|t�r4t|d�}|�|��z|��}|sLt	d��|�
d�sXq8|�dd�}t|�dkr8|ddkr8zt
|d	d
�Wq�Wq8tk
r�Yq8Xq8|dk�r:|d�d��d
�}tj�|�r�t	d|����|�
tj��s*dtj��|k�s*tj�r:|�
tj��s*dtj��|k�r:t	d|�d���|dk�rRt
|d	d
�}|dk�rftjj}n0t|t��r�t|d�}t�||�|}|�|�|��}	|	�rD|	�d�dk�rDzt�|	�}
Wnjtj	k
�r,}zH|	ddd@ddd}t�|	d|��}
|�stj�d|�W5d}~XYnX|�|
�|��}	�q�|	�sRt	d��W5|D]}|���qZXdS)zDecode uuencoded filerr
z'No valid begin line found in input filesbegin� ��r��Ns 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrrr r�readliner�
startswith�splitr%�int�
ValueError�rstriprrr�exists�sep�altsepr!�chmod�stripr&Za2b_uu�stderrr#)
r'r(r*�quietr+r,ZhdrZ	hdrfields�fp�sr-�v�nbytesrrr	rcsr





��
��




"
cCs4ddl}|jdd�}|jddddd	d
d�|jdd
ddd	d
d�|��\}}t|�dkrl|�d�t�d�tjj	}tj
j	}t|�dkr�|d}t|�dkr�|d}|jr�|jr�t
|t�r�t|d�}nttjdd�t�d�t||�nD|j�r&t
|t��rt|d�}nttjdd�t�d�t||�dS)zuuencode/uudecode main programrNz'usage: %prog [-d] [-t] [input [output]])Zusagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r/zincorrect number of argumentsr1rz: cannot do -t to stdoutr
z: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr%�errorr�exitrrr!rrMrrr�print�argvr)rN�parserZoptions�args�input�outputrrr	�test�s6




rX�__main__)NN)NNF)�__doc__r&rr�__all__�	ExceptionrrrrXrrrrr	�<module>s
:
J&formatter.cpython-38.opt-2.pyc000064400000035403151450073350012147 0ustar00U

e5d';�@s�ddlZddlZejdedd�dZGdd�d�ZGdd�d�ZGd	d
�d
�ZGdd�de�ZGd
d�de�Z	ddd�Z
edkr�e
�dS)�Nz"the formatter module is deprecated�)�
stacklevelc@s�eZdZd'dd�Zdd�Zdd�Zdd	�Zd(d
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd)d#d$�Zd*d%d&�ZdS)+�
NullFormatterNcCs|dkrt�}||_dS�N)�
NullWriter�writer��selfr�r
�!/usr/lib64/python3.8/formatter.py�__init__)szNullFormatter.__init__cCsdSrr
�r	�	blankliner
r
r�
end_paragraph-�zNullFormatter.end_paragraphcCsdSrr
�r	r
r
r�add_line_break.rzNullFormatter.add_line_breakcOsdSrr
�r	�args�kwr
r
r�add_hor_rule/rzNullFormatter.add_hor_rulecCsdSrr
�r	�format�counterrr
r
r�add_label_data0rzNullFormatter.add_label_datacCsdSrr
�r	�datar
r
r�add_flowing_data1rzNullFormatter.add_flowing_datacCsdSrr
rr
r
r�add_literal_data2rzNullFormatter.add_literal_datacCsdSrr
rr
r
r�flush_softspace3rzNullFormatter.flush_softspacecCsdSrr
�r	�alignr
r
r�push_alignment4rzNullFormatter.push_alignmentcCsdSrr
rr
r
r�
pop_alignment5rzNullFormatter.pop_alignmentcCsdSrr
)r	�xr
r
r�	push_font6rzNullFormatter.push_fontcCsdSrr
rr
r
r�pop_font7rzNullFormatter.pop_fontcCsdSrr
)r	�marginr
r
r�push_margin8rzNullFormatter.push_margincCsdSrr
rr
r
r�
pop_margin9rzNullFormatter.pop_margincCsdSrr
�r	�spacingr
r
r�set_spacing:rzNullFormatter.set_spacingcGsdSrr
�r	�stylesr
r
r�
push_style;rzNullFormatter.push_style�cCsdSrr
�r	�nr
r
r�	pop_style<rzNullFormatter.pop_stylecCsdSrr
�r	�flagr
r
r�assert_line_data=rzNullFormatter.assert_line_data)N)N)r0)r0)�__name__�
__module__�__qualname__rrrrrrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rrs$


rc@s�eZdZdd�Zdd�Zdd�Zdd�Zd-d
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd.d)d*�Zd/d+d,�Zd	S)0�AbstractFormattercCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_	d|_
d|_d|_dS�Nr0r)
rr!�align_stack�
font_stack�margin_stackr+�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_labelrr
r
rrNszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS�Nrr0)	rDr�send_line_breakrErC�send_paragraphr@rBrAr
r
r
rr]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dSrF)rDrBrrGrErCr@rArr
r
rrhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dSr;)	rDrrG�
send_hor_ruler@rErBrArCrr
r
rros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dSr;)
rErDrrGrBrH�
isinstance�str�send_label_data�format_counterr@rArCrr
r
rrvs

z AbstractFormatter.add_label_datacCstd}|D]f}|dkr"|d|}q|dkrD|dkrn||�||�}q|dkrf|dkrn||�||�}q||}q|S)N��1z%dZaArZiI)�
format_letter�format_roman)r	rr�label�cr
r
rrM�s
z AbstractFormatter.format_countercCs<d}|dkr8t|dd�\}}tt|�|�}||}q|S)NrNrr0�)�divmod�chr�ord)r	�caserrRr$�sr
r
rrP�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}|d	kr�t|d
�\}}|dkrV||||d|}nT|d
krt|||||}n6|dkr�||}|d}nd}||||}||}|d}q|dkr�|��S|S)N�ir$rS�m�v�l�d)rNrr�
�	r0��rN�I)rU�upper)	r	rXrZonesZfivesrR�indexr$rYr
r
rrQ�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr0���� r)�isspace�join�splitr@rArCrDrBrEr�send_flowing_data)r	rZprespaceZ	postspacer
r
rr�s*

�z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)Nrgrf�
r)	rArrkrDr@rBrCrE�send_literal_datarr
r
rr�s�z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS�Nrr0rg)rArDrBrCrEr@rrkrr
r
rr�s�z!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dSr)r!r�
new_alignmentr<�appendr r
r
rr"�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS�Nrf)r<r!rror r
r
rr#�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr0rgrf)
rArDrBr@rrkr=�AS_ISrp�new_font)
r	�font�sizerZ�bZttZcsizeZci�cbZcttr
r
rr%�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dSrq)r=rrs�r	rtr
r
rr&�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSr
r
��.0r[r
r
r�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rf)r>rpr�
new_margin�len)r	r'�fstackr
r
rr(s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrfcSsg|]}|r|�qSr
r
ryr
r
rr{
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r>rr|r})r	r~r'r
r
rr)
s
zAbstractFormatter.pop_margincCs||_|j�|�dSr)r+r�new_spacingr*r
r
rr,szAbstractFormatter.set_spacingcGsV|jr*d|_|_|_d|_|j�d�|D]}|j�|�q.|j�t	|j��dSrn)
rArDrBr@rrkr?rp�
new_styles�tuple)r	r.Zstyler
r
rr/szAbstractFormatter.push_styler0cCs$|j|d�=|j�t|j��dSr)r?rr�r�r1r
r
rr3!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS�Nr)r@rDrBrCrEr4r
r
rr6%sz"AbstractFormatter.assert_line_data)N)r0)r0)r7r8r9rrrrrrMrPrQrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rr:@s*
	
	
	
r:c@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rcCsdSrr
rr
r
rr2rzNullWriter.__init__cCsdSrr
rr
r
r�flush3rzNullWriter.flushcCsdSrr
r r
r
rro4rzNullWriter.new_alignmentcCsdSrr
rxr
r
rrs5rzNullWriter.new_fontcCsdSrr
�r	r'�levelr
r
rr|6rzNullWriter.new_margincCsdSrr
r*r
r
rr7rzNullWriter.new_spacingcCsdSrr
r-r
r
rr�8rzNullWriter.new_stylescCsdSrr
r
r
r
rrH9rzNullWriter.send_paragraphcCsdSrr
rr
r
rrG:rzNullWriter.send_line_breakcOsdSrr
rr
r
rrI;rzNullWriter.send_hor_rulecCsdSrr
rr
r
rrL<rzNullWriter.send_label_datacCsdSrr
rr
r
rrk=rzNullWriter.send_flowing_datacCsdSrr
rr
r
rrm>rzNullWriter.send_literal_dataN)r7r8r9rr�rorsr|rr�rHrGrIrLrkrmr
r
r
rr*src@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�AbstractWritercCstd|f�dS)Nznew_alignment(%r)��printr r
r
rroIszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r)r�rxr
r
rrsLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d)r�r�r
r
rr|OszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r)r�r*r
r
rrRszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r)r�r-r
r
rr�UszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r)r�r
r
r
rrHXszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break()r�rr
r
rrG[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule()r�rr
r
rrI^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r)r�rr
r
rrLaszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r)r�rr
r
rrkdsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r)r�rr
r
rrmgsz AbstractWriter.send_literal_dataN)r7r8r9rorsr|rr�rHrGrIrLrkrmr
r
r
rr�Asr�c@sFeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)�
DumbWriterN�HcCs(|ptj|_||_t�|�|��dSr)�sys�stdout�file�maxcolrr�reset)r	r�r�r
r
rrts
zDumbWriter.__init__cCsd|_d|_dSr�)�col�atbreakrr
r
rr�zszDumbWriter.resetcCs |j�d|�d|_d|_dS�Nrlr�r��writer�r�r
r
r
rrH~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dSr�r�rr
r
rrG�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nrl�-r)r�r�r�r�r�rr
r
rrI�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nrlrr0)r�r��rfindr��
expandtabsr}r�)r	rrZr
r
rrm�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}|��D]N}|rl|t|�|kr\|d�d}n|d�|d}||�|t|�}d}q6||_|d��|_dS)Nrrlrgr0rf)r�rhr�r�r�r�rjr})r	rr�r�r�r�Zwordr
r
rrk�s$zDumbWriter.send_flowing_data)Nr�)
r7r8r9rr�rHrGrIrmrkr
r
r
rr�ks	

r�cCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z,|D]"}|dkrb|�d�qJ|�|�qJW5|tjk	r�|��X|�d�dS)Nr0rlr)	r�r:�openr��argv�stdin�closerr)r��w�f�fp�liner
r
r�test�s


r��__main__)N)r��warnings�warn�DeprecationWarningrrrr:rr�r�r�r7r
r
r
r�<module>s�"k*C
gettext.cpython-38.pyc000064400000042735151450073350010676 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddddgZej�ejdd�Z	e�
dejejB�Z
dd�Zdd�ZdZd d!�eed"�D�Zd#d$d%d&�ZdGd(d)�Zd*d+�Zd,d-�Zd.d/�ZGd0d�d�ZGd1d�de�ZdHd3d�ZiZd4gZdddd2efd5d�Zdedfd6d�Ziaiad7a dId8d	�Z!dJd9d
�Z"dKd:d�Z#d;d�Z$d<d�Z%d=d
�Z&d>d�Z'd?d�Z(d@d�Z)dAd�Z*dBd�Z+dCd�Z,dDd�Z-dEd�Z.dFd�Z/eZ0dS)La�Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.

I18N refers to the operation by which a program is made aware of multiple
languages.  L10N refers to the adaptation of your program, once
internationalized, to the local language and cultural habits.

�N�NullTranslations�GNUTranslations�Catalog�find�translation�install�
textdomain�bindtextdomain�bind_textdomain_codeset�dgettext�	dngettext�gettext�lgettext�	ldgettext�
ldngettext�	lngettext�ngettext�pgettext�	dpgettext�	npgettext�
dnpgettextZshare�localea�
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccsPt�t|�D]8}|j}|dkr q|�|�}|dkr>td|��|VqdVdS)NZWHITESPACESZINVALIDz invalid token in plural form: %s�)�re�finditer�_token_pattern�	lastgroup�group�
ValueError)�pluralZmoZkind�value�r!�/usr/lib64/python3.8/gettext.py�	_tokenizeWs
r#cCs|rtd|�Std�SdS)Nz#unexpected token in plural form: %szunexpected end of plural form)r)r r!r!r"�_errorbsr$))�||)�&&)z==z!=)�<�>z<=z>=)�+�-)�*�/�%cCs i|]\}}|D]
}||�qqSr!r!)�.0�iZops�opr!r!r"�
<dictcomp>ps
r1��or�andz//)r%r&r,���cCs�d}t|�}|dkr&|d7}t|�}q|dkrXt|�\}}d||f}|dkr�td��nP|dkrnd	||f}n:zt|d
�}Wntk
r�t|�d�YnXd||f}t|�}d}|tk�rt|}||krҐq|d
kr�|d
kr�d|}t�||�}t||d�\}	}d|||	f}|}q�||k�r4dk�r@nnd|}|dk�r�|dk�r�t|d�\}
}|dk�rtt|��t|�\}}d|
||f}|dk�r�d|}||fS)Nr�!znot �(z%s(%s)�)z%unbalanced parenthesis in plural form�nz%s%s�
z%s%d�d)��z(%s)r2z%s %s %sr=�?r�:z%s if %s else %s)�next�_parser�intr$�_binary_ops�	_c2py_ops�get)�tokensZpriority�result�nexttok�subr �jr/r0�rightZif_trueZif_falser!r!r"rAssP




rAcCsZzt|�}Wn(tk
r4td|jjf�d�YnXddl}|�d|jjftd�|S)Nz'Plural value must be an integer, got %srr=)�round�	TypeError�	__class__�__name__�warnings�warn�DeprecationWarning)r9r/rPr!r!r"�_as_int�s ����rScCs�t|�dkrtd��z|tt|��\}}|r2t|��d}|D]6}|dkr`|d7}|dkrptd��q:|dkr:|d8}q:d	ti}td
||�|dWStk
r�td��YnXdS)
z�Gets a C expression as used in PO files for plural forms and returns a
    Python function that implements an equivalent expression.
    i�z"plural form expression is too longrr7r2�z%plural form expression is too complexr8rSz�if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            �funcN)�lenrrAr#r$rS�exec�RecursionError)rrGrHZdepth�c�nsr!r!r"�c2py�s.

��
r[c
Cs4t�|�}d}d}d}d}|�d�}|dkrN||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|}	g}
t|d�D]P}||@s�|	}||@r�||7}||@�r
||7}||@�r||7}|
�|�q�|
��|
S)	Nr2�r=r�@r�.�_)rZ	normalizer�range�append�reverse)
ZlocZCOMPONENT_CODESETZCOMPONENT_TERRITORYZCOMPONENT_MODIFIER�mask�posZmodifier�codesetZ	territoryZlanguageZretr/�valr!r!r"�_expand_lang�sJ









rgc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zddd�ZdS) rNcCs.i|_d|_d|_d|_|dk	r*|�|�dS�N)�_info�_charset�_output_charset�	_fallbackrA��self�fpr!r!r"�__init__�szNullTranslations.__init__cCsdSrhr!rmr!r!r"rAszNullTranslations._parsecCs|jr|j�|�n||_dSrh)rl�add_fallback)rn�fallbackr!r!r"rq
szNullTranslations.add_fallbackcCs|jr|j�|�S|Srh)rlr
)rn�messager!r!r"r
szNullTranslations.gettextc
Csrddl}|�dtd�|jrR|���(|�ddt�|j�|�W5QR�SQRX|jrd|�|j�S|�t	�
��S)Nr�/lgettext() is deprecated, use gettext() insteadr\�ignore�.*\blgettext\b.*)rPrQrRrl�catch_warnings�filterwarningsrrk�encoder�getpreferredencoding)rnrsrPr!r!r"rs�
�zNullTranslations.lgettextcCs*|jr|j�|||�S|dkr"|S|SdS�Nr2)rlr)rn�msgid1�msgid2r9r!r!r"r"s
zNullTranslations.ngettextc
Cs�ddl}|�dtd�|jrV|���,|�ddt�|j�|||�W5QR�SQRX|dkrd|}n|}|jrz|�|j�S|�t	�
��S)Nr�1lngettext() is deprecated, use ngettext() insteadr\ru�.*\blngettext\b.*r2)rPrQrRrlrwrxrrkryrrz�rnr|r}r9rP�tmsgr!r!r"r*s"�
�"zNullTranslations.lngettextcCs|jr|j�||�S|Srh)rlr)rn�contextrsr!r!r"r;szNullTranslations.pgettextcCs,|jr|j�||||�S|dkr$|S|SdSr{)rlr)rnr�r|r}r9r!r!r"r@s
zNullTranslations.npgettextcCs|jSrh)ri�rnr!r!r"�infoHszNullTranslations.infocCs|jSrh)rjr�r!r!r"�charsetKszNullTranslations.charsetcCsddl}|�dtd�|jS)Nrzoutput_charset() is deprecatedr\�rPrQrRrk)rnrPr!r!r"�output_charsetNs�zNullTranslations.output_charsetcCs ddl}|�dtd�||_dS)Nrz"set_output_charset() is deprecatedr\r�)rnr�rPr!r!r"�set_output_charsetTs�z#NullTranslations.set_output_charsetcCsRddl}|j|jd<|dk	rNddddddh}|t|�@D]}t||�|j|<q8dS)	Nrr_r
rrrrr)�builtinsr
�__dict__�set�getattr)rn�namesr�Zallowed�namer!r!r"rZs�zNullTranslations.install)N)N)rO�
__module__�__qualname__rprArqr
rrrrrr�r�r�r�rr!r!r!r"r�s

c@s\eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)rl�*l�$<z%s%s)rr2cCs|d?|d@fS)z/Returns a tuple of major version, minor version�i��r!)rn�versionr!r!r"�
_get_versionspszGNUTranslations._get_versionsc"Cs�ddlm}t|dd�}i|_}dd�|_|��}t|�}|d|dd	��d}||jkr||d
|d	d��\}}	}
}d}n6||jkr�|d
|d	d��\}}	}
}d}nt	dd|��|�
|�\}
}|
|jkr�t	ddt|
�|��t
d|	�D�]}||||
|
d��\}}||}|||||d��\}}||}||k�r`||k�r`|||�}|||�}nt	dd|��|dk�rld}|�d�D]�}|����}|�s��q�|�d��r�|�d��r��q�d}}d|k�r|�dd�\}}|����}|��}||j|<|}n|�r|j|d|7<|dk�r8|�d�d|_n0|dk�r�|�d�}|d�d�d}t|�|_�q�|j�pvd}d|k�r�|�d�\}} |�d�}t||�}t|�D]\}}!t|!|�|||f<�q�nt||�|t||�<|
d7}
|d7}q�dS)z8Override this method to support alternative .mo formats.r)�unpackr�rcSst|dk�Sr{)rB)r9r!r!r"�<lambda>}�z(GNUTranslations._parse.<locals>.<lambda>z<INr=z<4IrTz<IIz>4Iz>IIzBad magic numberzBad version number �zFile is corrupt�
z	#-#-#-#-#r?r2�
zcontent-typezcharset=zplural-forms�;zplural=�ascii�)Zstructr�r��_catalogr�readrV�LE_MAGIC�BE_MAGIC�OSErrorr��VERSIONS�strr`�split�decode�strip�
startswith�endswith�lowerrirjr[�	enumerate)"rnror��filenameZcatalogZbufZbuflen�magicr�ZmsgcountZ	masteridxZtransidxZiiZ
major_versionZ
minor_versionr/ZmlenZmoffZmendZtlenZtoffZtend�msgr�ZlastkZb_item�item�k�vrr�r|r}�xr!r!r"rAtsv














zGNUTranslations._parsecCshddl}|�dtd�t�}|j�||�}||krH|jrD|j�|�S|}|jrZ|�	|j�S|�	t
���S)Nrrtr\)rPrQrR�objectr�rErlrrkryrrz)rnrsrP�missingr�r!r!r"r�s�zGNUTranslations.lgettextcCs�ddl}|�dtd�z|j||�|�f}Wn@tk
rn|jrX|j�|||�YS|dkrf|}n|}YnX|jr�|�	|j�S|�	t
���S)Nrr~r\r2)rPrQrRr�r�KeyErrorrlrrkryrrzr�r!r!r"r�s �
zGNUTranslations.lngettextcCs6t�}|j�||�}||kr2|jr.|j�|�S|S|Srh)r�r�rErlr
)rnrsr�r�r!r!r"r
�szGNUTranslations.gettextcCs^z|j||�|�f}Wn@tk
rX|jrB|j�|||�YS|dkrP|}n|}YnX|Sr{)r�rr�rlr)rnr|r}r9r�r!r!r"r�s
zGNUTranslations.ngettextcCsF|j||f}t�}|j�||�}||krB|jr>|j�||�S|S|Srh)�CONTEXTr�r�rErlr)rnr�rs�ctxt_msg_idr�r�r!r!r"rszGNUTranslations.pgettextc	Csn|j||f}z|j||�|�f}WnBtk
rh|jrR|j�||||�YS|dkr`|}n|}YnX|Sr{)r�r�rr�rlr)rnr�r|r}r9r�r�r!r!r"rs
zGNUTranslations.npgettextN)rOr�r�r�r�r�r�r�rArrr
rrrr!r!r!r"rdsY	
FcCs�|dkrt}|dkrRg}dD]"}tj�|�}|r|�d�}q@qd|krR|�d�g}|D]$}t|�D]}||krf|�|�qfqZ|r�g}	nd}	|D]J}|dkr�q�tj�||dd|�}
tj�	|
�r�|r�|	�|
�q�|
Sq�|	S)N)ZLANGUAGE�LC_ALL�LC_MESSAGESZLANGr?�Cr�z%s.mo)
�_default_localedir�os�environrEr�rarg�path�join�exists)�domain�	localedir�	languages�allZenvarrfZnelangsZlangZnelangrG�mofiler!r!r"rs8


Zunspecifiedc
Cs|dkrt}t|||dd�}|sB|r*t�Sddlm}t|d|��d}|D]�}	|tj�|	�f}
t	�
|
�}|dkr�t|	d��}t	�|
||��}W5QRXddl
}
|
�
|�}|tk	r�ddl}|�dtd�|r�|���|�d	d
t�|�|�W5QRX|dk�r|}qJ|�|�qJ|S)NT)r�r)�ENOENTz$No translation file found for domain�rbzparameter codeset is deprecatedr\ruz.*\bset_output_charset\b.*)rrr�errnor��FileNotFoundErrorr�r��abspath�
_translationsrE�open�
setdefault�copy�_unspecifiedrPrQrRrwrxr�rq)r�r�r�Zclass_rrreZmofilesr�rGr��key�tror�rPr!r!r"rCsH�

�
�
cCst||d|d�}|�|�dS)NT)rrre)rr)r�r�rer�r�r!r!r"rnsZmessagescCs|dk	r|atSrh)�_current_domain)r�r!r!r"r|scCs|dk	r|t|<t�|t�Srh)�_localedirsrEr�)r�r�r!r!r"r	�scCs0ddl}|�dtd�|dk	r&|t|<t�|�S)Nrz'bind_textdomain_codeset() is deprecatedr\)rPrQrR�_localecodesetsrE)r�rerPr!r!r"r
�s�cCs:zt|t�|d��}Wntk
r.|YSX|�|�Srh)rr�rEr�r
)r�rsr�r!r!r"r�s

c
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn&t	k
r�|�
|pzt���YSX|���&|�ddt�|�
|�W5QR�SQRXdS)Nrz1ldgettext() is deprecated, use dgettext() insteadr\ru�.*\bparameter codeset\b.*�rerv)rPrQrRr�rErwrxrr�r�ryrrzr)r�rsrPrer�r!r!r"r�s&�

�$
�cCsRzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�|||�Sr{)rr�rEr�r)r�r|r}r9r�r!r!r"r�sc
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn8t	k
r�|dkrz|}n|}|�
|p�t���YSX|���*|�ddt�|�
|||�W5QR�SQRXdS)	Nrz3ldngettext() is deprecated, use dngettext() insteadr\rur�r�r2r)rPrQrRr�rErwrxrr�r�ryrrzr)r�r|r}r9rPrer�r�r!r!r"r�s,�

�$
�cCs<zt|t�|d��}Wntk
r.|YSX|�||�Srh)rr�rEr�r)r�r�rsr�r!r!r"r�s

cCsTzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�||||�Sr{)rr�rEr�r)r�r�r|r}r9r�r!r!r"r�scCs
tt|�Srh)rr�)rsr!r!r"r
�sc
CsNddl}|�dtd�|���&|�ddt�tt|�W5QR�SQRXdS)Nrrtr\ruz.*\bldgettext\b.*)rPrQrRrwrxrr�)rsrPr!r!r"r�s�
�cCstt|||�Srh)rr�)r|r}r9r!r!r"r�sc
CsRddl}|�dtd�|���*|�ddt�tt|||�W5QR�SQRXdS)Nrr~r\ruz.*\bldngettext\b.*)rPrQrRrwrxrr�)r|r}r9rPr!r!r"r�s�
�cCstt||�Srh)rr�)r�rsr!r!r"r�scCstt||||�Srh)rr�)r�r|r}r9r!r!r"r�s)r5)NNF)N)N)N)1�__doc__rr�r�sys�__all__r�r��base_prefixr��compile�VERBOSE�DOTALLrr#r$rCr�rDrArSr[rgrrrr�r�rrr�r�r�rr	r
rrrrrrr
rrrrrrr!r!r!r"�<module>s�0�
�

1$*f7
&�
+




	
selectors.cpython-38.opt-2.pyc000064400000031146151450073350012147 0ustar00U

e5d�H�@s�ddlmZmZddlmZddlmZddlZddlZddl	Z	dZ
dZdd�Zed	d
ddd
g�Z
de
_e	jdkr�de
j_de
j_de
j_de
j_Gdd�de�ZGdd�ded�ZGdd�de�ZGdd�de�ZGdd�de�Zeed�r�Gd d!�d!e�Zeed"��rGd#d$�d$e�Zeed%��r6Gd&d'�d'e�Zeed(��rRGd)d*�d*e�Zd*e�k�rdeZn:d$e�k�rveZn(d'e�k�r�eZnd!e�k�r�eZneZdS)+�)�ABCMeta�abstractmethod)�
namedtuple)�MappingN��c
Csft|t�r|}n<zt|���}Wn*tttfk
rJtd�|��d�YnX|dkrbtd�|���|S)NzInvalid file object: {!r}rzInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError�	TypeError�
ValueError�format)�fileobj�fd�r�!/usr/lib64/python3.8/selectors.py�_fileobj_to_fds
��r�SelectorKeyrr�events�dataz�SelectorKey(fileobj, fd, events, data)

    Object used to associate a file object to its backing
    file descriptor, selected event mask, and attached data.
)��zFile object registered.zUnderlying file descriptor.z3Events that must be waited for on this file object.zzOptional opaque data associated to this file object.
    For example, this could be used to store a per-client session ID.c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_SelectorMappingcCs
||_dS�N)�	_selector)�selfZselectorrrr�__init__?sz_SelectorMapping.__init__cCst|jj�Sr)�lenr�
_fd_to_key�rrrr�__len__Bsz_SelectorMapping.__len__cCsDz|j�|�}|jj|WStk
r>td�|��d�YnXdS�N�{!r} is not registered)r�_fileobj_lookupr�KeyErrorr)rrrrrr�__getitem__Es
z_SelectorMapping.__getitem__cCst|jj�Sr)�iterrrr rrr�__iter__Lsz_SelectorMapping.__iter__N)�__name__�
__module__�__qualname__rr!r&r(rrrrr<src@sjeZdZeddd��Zedd��Zddd�Zeddd	��Zd
d�Zdd
�Z	edd��Z
dd�Zdd�ZdS)�BaseSelectorNcCst�dSr��NotImplementedError�rrrrrrr�register_szBaseSelector.registercCst�dSrr-)rrrrr�
unregistervszBaseSelector.unregistercCs|�|�|�|||�Sr)r1r0r/rrr�modify�s
zBaseSelector.modifycCst�dSrr-)r�timeoutrrr�select�szBaseSelector.selectcCsdSrrr rrr�close�szBaseSelector.closecCsL|��}|dkrtd��z
||WStk
rFtd�|��d�YnXdS)NzSelector is closedr#)�get_map�RuntimeErrorr%r)rr�mappingrrr�get_key�s
zBaseSelector.get_keycCst�dSrr-r rrrr6�szBaseSelector.get_mapcCs|Srrr rrr�	__enter__�szBaseSelector.__enter__cGs|��dSr)r5)r�argsrrr�__exit__�szBaseSelector.__exit__)N)N)N)
r)r*r+rr0r1r2r4r5r9r6r:r<rrrrr,Ps


r,)�	metaclassc@sPeZdZdd�Zdd�Zddd�Zdd	�Zdd
d�Zdd
�Zdd�Z	dd�Z
dS)�_BaseSelectorImplcCsi|_t|�|_dSr)rr�_mapr rrrr�sz_BaseSelectorImpl.__init__cCsNz
t|�WStk
rH|j��D]}|j|kr$|jYSq$�YnXdSr)rr
r�valuesrr�rr�keyrrrr$�s	

z!_BaseSelectorImpl._fileobj_lookupNcCsb|r|ttB@r td�|���t||�|�||�}|j|jkrRtd�||j���||j|j<|S)NzInvalid events: {!r}z"{!r} (FD {}) is already registered)	�
EVENT_READ�EVENT_WRITEr
rrr$rrr%�rrrrrBrrrr0�s�z_BaseSelectorImpl.registercCs@z|j�|�|��}Wn$tk
r:td�|��d�YnX|Sr")r�popr$r%rrArrrr1�s
z_BaseSelectorImpl.unregistercCs�z|j|�|�}Wn$tk
r8td�|��d�YnX||jkr^|�|�|�|||�}n"||jkr�|j|d�}||j|j	<|S)Nr#)r)
rr$r%rrr1r0r�_replacerrErrrr2�s


z_BaseSelectorImpl.modifycCs|j��d|_dSr)r�clearr?r rrrr5s
z_BaseSelectorImpl.closecCs|jSr)r?r rrrr6sz_BaseSelectorImpl.get_mapcCs(z|j|WStk
r"YdSXdSr)rr%)rrrrr�_key_from_fds	z_BaseSelectorImpl._key_from_fd)N)N)r)r*r+rr$r0r1r2r5r6rIrrrrr>�s


r>cs\eZdZ�fdd�Zd
�fdd�	Z�fdd�ZejdkrDdd	d
�Zne	j	Zddd�Z	�Z
S)�SelectSelectorcst���t�|_t�|_dSr)�superr�set�_readers�_writersr ��	__class__rrr%s
zSelectSelector.__init__Ncs@t��|||�}|t@r&|j�|j�|t@r<|j�|j�|Sr)rKr0rCrM�addrrDrNrErOrrr0*szSelectSelector.registercs,t��|�}|j�|j�|j�|j�|Sr)rKr1rM�discardrrNrArOrrr12szSelectSelector.unregisterZwin32cCs$t�||||�\}}}|||gfSr)r4)r�r�w�_r3�xrrr�_select9szSelectSelector._selectc	Cs�|dkrdnt|d�}g}z|�|j|jg|�\}}}Wntk
rP|YSXt|�}t|�}||BD]J}d}||kr�|tO}||kr�|tO}|�|�}|rj|�	|||j
@f�qj|S�Nr)�maxrWrMrN�InterruptedErrorrLrCrDrI�appendr)	rr3�readyrSrTrUrrrBrrrr4?s$

zSelectSelector.select)N)N)N)r)r*r+rr0r1�sys�platformrWr4�
__classcell__rrrOrrJ"s
rJcsZeZdZdZdZdZ�fdd�Zd�fdd�	Z�fdd�Zd
�fdd	�	Z	dd
d�Z
�ZS)�_PollLikeSelectorNcst���|��|_dSr)rKr�
_selector_clsrr rOrrr[s
z_PollLikeSelector.__init__cslt��|||�}d}|t@r&||jO}|t@r8||jO}z|j�|j|�Wnt��|��YnX|SrX)	rKr0rC�_EVENT_READrD�_EVENT_WRITErrr1)rrrrrBZ
poller_eventsrOrrr0_s

z_PollLikeSelector.registercs8t��|�}z|j�|j�Wntk
r2YnX|Sr)rKr1rr�OSErrorrArOrrr1msz_PollLikeSelector.unregistercs�z|j|�|�}Wn$tk
r8t|�d��d�YnXd}||jkr�d}|t@r^||jO}|t@rp||jO}z|j�	|j
|�Wnt��|��YnXd}||j
kr�d}|r�|j||d�}||j|j
<|S)Nz is not registeredFrT)rr)rr$r%rrCrbrDrcrr2rrKr1rrG)rrrrrBZchangedZselector_eventsrOrrr2ws.



z_PollLikeSelector.modifycCs�|dkrd}n|dkrd}nt�|d�}g}z|j�|�}Wntk
rV|YSX|D]V\}}d}||j@r||tO}||j@r�|tO}|�	|�}|r\|�
|||j@f�q\|S)Nr�@�@)�math�ceilr�pollrZrbrDrcrCrIr[r)rr3r\�
fd_event_listr�eventrrBrrrr4�s(

z_PollLikeSelector.select)N)N)N)r)r*r+rarbrcrr0r1r2r4r_rrrOrr`Us
r`rhc@seZdZejZejZejZ	dS)�PollSelectorN)
r)r*r+r4rhra�POLLINrb�POLLOUTrcrrrrrk�srk�epollcs@eZdZejZejZejZ	dd�Z
ddd�Z�fdd�Z�ZS)	�
EpollSelectorcCs
|j��Sr�rr
r rrrr
�szEpollSelector.filenoNc	Cs�|dkrd}n |dkrd}nt�|d�d}tt|j�d�}g}z|j�||�}Wntk
rl|YSX|D]V\}}d}|tj	@r�|t
O}|tj@r�|tO}|�
|�}|rr|�|||j@f�qr|S)N���rreg����MbP?r)rfrgrYrrrrhrZr4�EPOLLINrD�EPOLLOUTrCrIr[r)	rr3�max_evr\rirrjrrBrrrr4�s*

zEpollSelector.selectcs|j��t���dSr�rr5rKr rOrrr5�s
zEpollSelector.close)N)
r)r*r+r4rnrarrrbrsrcr
r5r_rrrOrro�s
 ro�devpollcs6eZdZejZejZejZ	dd�Z
�fdd�Z�ZS)�DevpollSelectorcCs
|j��Srrpr rrrr
�szDevpollSelector.filenocs|j��t���dSrrur rOrrr5�s
zDevpollSelector.close)
r)r*r+r4rvrarlrbrmrcr
r5r_rrrOrrw�s
rw�kqueuecsTeZdZ�fdd�Zdd�Zd�fdd�	Z�fdd	�Zdd
d�Z�fdd
�Z�Z	S)�KqueueSelectorcst���t��|_dSr)rKrr4rxrr rOrrr�s
zKqueueSelector.__init__cCs
|j��Srrpr rrrr
szKqueueSelector.filenoNcs�t��|||�}z`|t@r@t�|jtjtj�}|j�	|gdd�|t
@rnt�|jtjtj�}|j�	|gdd�Wnt��|��YnX|SrX)
rKr0rCr4�keventr�KQ_FILTER_READZ	KQ_EV_ADDr�controlrD�KQ_FILTER_WRITEr1)rrrrrB�kevrOrrr0s ��zKqueueSelector.registercs�t��|�}|jt@rVt�|jtjtj�}z|j	�
|gdd�Wntk
rTYnX|jt@r�t�|jtj
tj�}z|j	�
|gdd�Wntk
r�YnX|SrX)rKr1rrCr4rzrr{ZKQ_EV_DELETErr|rdrDr})rrrBr~rOrrr1s$
�
�zKqueueSelector.unregisterc
Cs�|dkrdnt|d�}t|j�}g}z|j�d||�}Wntk
rP|YSX|D]Z}|j}|j}d}|tj	kr||t
O}|tjkr�|tO}|�
|�}	|	rV|�|	||	j@f�qV|SrX)rYrrrr|rZZident�filterr4r{rCr}rDrIr[r)
rr3rtr\Zkev_listr~r�flagrrBrrrr4)s&




zKqueueSelector.selectcs|j��t���dSrrur rOrrr5?s
zKqueueSelector.close)N)N)
r)r*r+rr
r0r1r4r5r_rrrOrry�s
ry) �abcrr�collectionsrZcollections.abcrrfr4r]rCrDrr�__doc__�version_inforrrrrr,r>rJr`�hasattrrkrorwry�globalsZDefaultSelectorrrrr�<module>sJ
~T3Z
.M_osx_support.cpython-38.opt-1.pyc000064400000026513151450073350012711 0ustar00U

e5dU�@s�dZddlZddlZddlZddddgZdZdZd	Zd-d
d�Zd.d
d�Z	dd�Z
dadd�Zda
dd�Zdd�Zdd�Zdadd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d�Zd*d�Zd+d�Zd,d�ZdS)/zShared OS X support functions.�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|�tj�}tj�|�\}}tjdkrH|dkrH|d}tj�|�s�|D]&}tj�	||�}tj�|�rX|SqXdS|SdS)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�$/usr/lib64/python3.8/_osx_support.py�_find_executables

rFc
Cs�ddl}zddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��P}|rfd||jf}nd||jf}t�	|�s�|�
��d���ndW5QR�SQRXdS)z0Output from successful command execution or NonerNz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr�fp�cmdrrr�_read_output7s��
r+cCst|�ptd|f�pdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find %s�)rr+)Ztoolnamerrr�_find_build_toolMs
��r-cCsxtdkrtdaztd�}Wntk
r,YnHXzt�d|���}W5|��X|dk	rtd�|�d��	d�dd��atS)z*Return the OS X system version as a stringNr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�close�re�searchr&r�groupr)r�mrrr�_get_system_versionVs
�
r8cCsLtdkrHt�}|rHztdd�|�d�D��aWntk
rFdaYnXtS)z}
    Return the macOS system version as a tuple

    The return value is safe to use to compare
    two version numbers.
    Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>�sz,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rDcCs"t|�D]}|�t�r||=qdS)z-Remove original unmodified values for testingN)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rJcCs8|�|d�}||kr,t||kr,||t|<|||<dS)z@Save modified and original unmodified value of configuration varr,N)�getrG)rH�cvZnewvalueZoldvaluerrr�_save_modified_value�srMcCs�tdk	rtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d	�r(|dd
�aq(tdkr�datS)z= Returns the root of the default SDK for this system, or '/' Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrFr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rUcCst�}|rt|dk�SdS)z=Returns True if universal builds are supported on this system��
�F)rD�boolrCrrr�_supports_universal_builds�srZcCst�}|r|dkSdS)z9Returns True if arm64 builds are supported on this system)�rF)rDrCrrr�_supports_arm64_builds�sr\cCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�tD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
z7Find appropriate C compiler for extension module buildsr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerFr+�replace�SystemError�_COMPILER_CONFIG_VARSrMr)rHrRZoldcc�datarLZcv_splitrrr�_find_appropriate_compiler�s,

��recCsVtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�q|S)z5Remove all universal build arguments from config vars�
-arch\s+\w+\sr_)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r4�sub�ASCIIrM)rHrLrgrrr�_remove_universal_flagssrkcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�tD]8}||krF|tjkrF||}t�dd	|�}t|||�qF|S)
z-Remove any unsupported archs from config varsr	z-arch\s+ppcrNzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullr]r^z-arch\s+ppc\w*\sr_)	rr
r4r5r%rarhrirM)rHZstatusrLrgrrr�_remove_unsupported_archss
��	rlcCsddtjkr`tjd}tD]F}||krd||kr||}t�dd|�}|d|}t|||�q|S)z2Allow override of all archs with ARCHFLAGS env var�	ARCHFLAGS�-archrfr_)rr
rhr4rirM)rHZarchrLrgrrr�_override_all_archs:s

rocCsx|�dd�}t�d|�}|dk	rt|�d�}tj�|�sttD]8}||kr:|tjkr:||}t�	dd|�}t
|||�q:|S)z+Remove references to any SDKs not availablerr,z-isysroot\s*(\S+)Nr/z-isysroot\s*\S+(?:\s|$)r_)rKr4r5r6rr�existsrhr
rirM)rH�cflagsr7ZsdkrLrgrrr�_check_for_unavailable_sdkKs
rrc
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�z|�d�}|||d�=WqHtk
r|Yq�YqHXqHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjkr�|s�|tjd��}|�r@d
d�t|�D�}|�s
�q@|d}||d
k�r0|||d�=q�|||d�=q�d}|}dd�t|�D�}|�sv|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qz|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)ae
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    FTrncss|]}|�d�r|VqdS)�	-isysrootN�rF)r=�argrrrr?ys
z!compiler_fixup.<locals>.<genexpr>rmr0r/�arm64cSsg|]\}}|�d�r|�qS�rsrt�r=r>�xrrr�
<listcomp>�s
z"compiler_fixup.<locals>.<listcomp>rrsNcSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
cSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rErZ�anyrr
�indexrBr\�reversed�range�lenr�	enumerater�isdirZ	distutilsr{�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr}�idx�indicesZsysrootZargvarr{rrrrfsZ	


�
cCs"t�st|�t|�t|�|S)a�Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    )rZrkrorr�rHrrrr�s
cCst|�t|�t|�|S)z�Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler).
    )rerlror�rrrr�s	cCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�rFd|��k�rFd
}t�d|�}tt	t
|���}t|�dkr�|d}nj|dkr�d}n\|dkr�d
}nN|dk�rd}n>|dk�rd}n.|dk�r&d}n|dk�r6d}ntd|f��n<|dk�rbtj
dk�r�d}n |dk�r�tj
dk�r~d }nd!}|||fS)"z Filter values for get_platform()ZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?sz#get_platform_osx.<locals>.<genexpr>r.rr0)rWrrVrnZfatz
-arch\s+(\S+)r/)rv�x86_64Z
universal2)�i386�ppc)r�r�Zintel)r�r�r�Zfat3)�ppc64r�Zfat64)r�r�r�r�Z	universalz%Don't know machine value for archs=%rr�lr�)ZPowerPCZPower_Macintoshr�r�)rKr8rGrArrBr(r4�findall�sorted�setr�r�maxsize)rHZosname�release�machineZmacverZ
macreleaserqZarchsrrrr�sX



�$




�

)N)F)�__doc__rr4r�__all__rhrcrGrr+r-r1r8r@rDrJrMrOrUrZr\rerkrlrorrrrrrrrrr�<module>sB�


	

>(Q)posixpath.cpython-38.opt-1.pyc000064400000024276151450073350012170 0ustar00U

e5d=�&@s^dZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Z
d0d1�Zd2d
�Zd3d�Zd4d�Zd5d�Zd6d�Zejje_d7d
�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zd=d�Zdadad>d�Zd?d�Zd@d �Z dAd,�Z!dBdC�Z"e
j#dDkZ$dGdEd.�Z%dFd/�Z&dS)Ha�Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
�.�..�/�:z
/bin:/usr/binNz	/dev/null�)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes��path�r2�!/usr/lib64/python3.8/posixpath.py�_get_sep)s
r4cCs
t�|�S)z6Normalize case of pathname.  Has no effect under Posix��os�fspath)�sr2r2r3r4scCst�|�}t|�}|�|�S)zTest whether a path is absolute)r6r7r4�
startswith)r8r#r2r2r3r<s
c
Gs�t�|�}t|�}|}z^|s,|dd�|ttj|�D]8}|�|�rL|}q8|rZ|�|�rd||7}q8|||7}q8Wn.tttfk
r�t	j
d|f|���YnX|S)z�Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr	)r6r7r4�mapr9�endswith�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr#r1�br2r2r3r	Gs 


cCs`t�|�}t|�}|�|�d}|d|�||d�}}|rX||t|�krX|�|�}||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N�r6r7r4�rfind�len�rstrip)rBr#�i�head�tailr2r2r3rds

cCs6t�|�}t|t�rd}d}nd}d}t�||d|�S)Nr-�.rr)r6r7r.r/r?�	_splitext)rBr#r'r2r2r3rus

cCst�|�}|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr5)rBr2r2r3r
�s
cCs,t�|�}t|�}|�|�d}||d�S)z)Returns the final component of a pathnamerDN)r6r7r4rF)rBr#rIr2r2r3r
�s
cCsNt�|�}t|�}|�|�d}|d|�}|rJ||t|�krJ|�|�}|S)z-Returns the directory component of a pathnamerDNrE)rBr#rIrJr2r2r3r�s

c
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)z&Test whether a path is a symbolic linkF)r6�lstat�OSError�
ValueErrorr=�stat�S_ISLNK�st_mode)r1�str2r2r3r�s
c	Cs.zt�|�Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r6rNrOrPr0r2r2r3r�s
c	Cs�zt�|�}Wnttfk
r(YdSXt�|j�r:dSt|t�rPt	|d�}n
t	|d�}t
|�}zt�|�}Wnttfk
r�YdSX|j}|j}||kr�dS|j}|j}||kr�dSdS)z$Test whether a path is a mount pointF�..rT)
r6rNrOrPrQrRrSr.r/r	r)�st_dev�st_ino)r1�s1�parent�s2�dev1�dev2�ino1�ino2r2r2r3r�s.

c	Cs<t�|�}t|t�rd}nd}|�|�s,|St|�}|�|d�}|dkrPt|�}|dkr�dtjkr�ddl	}z|�
t���j}Wq�t
k
r�|YSXn
tjd}nVddl	}|d|�}t|t�r�t|d�}z|�|�}Wnt
k
r�|YSX|j}t|t��rt�|�}d}nd	}|�|�}|||d��p:|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.�~�~rDr�HOMEN�ASCIIr-r)r6r7r.r/r9r4�findrG�environ�pwd�getpwuid�getuid�pw_dir�KeyError�str�getpwnam�fsencoderH)	r1�tilder#rIre�userhome�name�pwent�rootr2r2r3r�sB








cCsZt�|�}t|t�rVd|kr |Sts:ddl}|�d|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|�d	|j�a
t
j}d
}d}tj}d}|||�}|s��qV|�d�\}}|�
d�}	|	�|�r�|	�|�r�|	dd
�}	z.|dk�rt�tjt�|	��}
n||	}
Wntk
�r&|}Yq�X||d�}|d|�|
}t|�}||7}q�|S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.�$rNs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}rD���)r6r7r.r/�	_varprogb�re�compilerb�search�getattr�_varprogrd�span�groupr9r;rl�fsdecoderirG)r1r{r}�start�endrdrI�m�jro�valuerKr2r2r3rsN






c	Cs�t�|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|�|�}|rp|�|d	�rp|�|d
�spd	}|�|�}g}|D]J}|||fkr�q�||ks�|s�|r�|r�|d|kr�|�|�q�|r�|��q�|}|�|�}|r�|||}|p�|S)z0Normalize path, eliminating double slashes, etc.r-�rLrUr�rr��ry)	r6r7r.r/r9r�append�popr	)	r1r#�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr2r2r3rNsJ


��
�
�

cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)zReturn an absolute path.)	r6r7rr.r/�getcwdb�getcwdr	r)r1�cwdr2r2r3rts



cCs*t�|�}t|dd�|i�\}}t|�S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r6r7�
_joinrealpathr)�filenamer1�okr2r2r3r)�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}|�r|�|�\}}}|r<||kr`q<||kr�|r�t|�\}}||kr�t|||�}q<|}q<t||�}t|�s�|}q<||kr�||}|dk	r�q<t||�dfSd||<t|t�	|�|�\}}	|	�st||�dfS|||<q<|d	fS)
Nr-rLrUrrrrDFT)
r.r/r�	partitionrr	rr�r6�readlink)
r1�rest�seenr#r!r"ro�_�newpathr�r2r2r3r��sH


r��darwinc	Cs�|std��t�|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
t�|�}zrd	d
�t|��|�D�}dd
�t|��|�D�}tt||g��}|gt|�|||d�}|s�|WSt	|�WSt
ttt
fk
r�t�d||��YnXdS)
z#Return a relative version of a pathzno path specifiedrLr-rUrrrNcSsg|]}|r|�qSr2r2��.0�xr2r2r3�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr2r2r�r2r2r3r��sr+)rPr6r7r.r/rrrGrr	r<r=r>�DeprecationWarningr?r@)	r1r�r!r#r"�
start_list�	path_listrI�rel_listr2r2r3r+�s0



c		s2|std��tttj|��}t|dt�r4d�d�nd�d�zƇfdd�|D�}zt�fd	d
�|D��\}Wntk
r�td�d�YnX�fd
d�|D�}t|�}t	|�}|}t
|�D]$\}}|||kr�|d|�}q�q�|r�n
�dd�}|��|�WStt
fk
�r,tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr-rLrrcsg|]}|����qSr2)r)r�r1�r#r2r3r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdS)NrDr2)r�rBr�r2r3�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr2r2)r��c�r!r2r3r�sz)commonpath.<locals>.<listcomp>.<listcomp>r2)r�r8r�r2r3r�sr,)r,)rP�tupler:r6r7r.r/�set�min�max�	enumerater	r<r=r?r@)	�paths�split_pathsrrXrZ�commonrIr��prefixr2)r!r#r3r,�s6)N)'�__doc__r!r"r'r#r$r%r&r(r6�sysrQr?�__all__r4rrr	rrrMr
r
rrrrrrrzrrrr)r��platformr*r+r,r2r2r2r3�<module>s��
	
	

*25&	3

)ftplib.cpython-38.opt-1.pyc000064400000066551151450073350011433 0ustar00U

e5d9��@sVdZddlZddlZddlmZdddddd	gZd
ZdZdZGd
d�de�Z	Gdd�de	�Z
Gdd�de	�ZGdd�de	�ZGdd�de	�Z
e	eefZdZdZGdd�d�ZzddlZWnek
r�dZYn0XejZGdd�de�Ze�d�e	eeejfZdadd�Zdadd�Zdd�Zdd�Z d d!�Z!d)d$d%�Z"d&d'�Z#e$d(k�rRe#�dS)*aSAn FTP client class and some helper functions.

Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds

Example:

>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, access restrictions apply.'
>>> ftp.retrlines('LIST') # list directory contents
total 9
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
-rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
'226 Transfer complete.'
>>> ftp.quit()
'221 Goodbye.'
>>>

A nice test that reveals some of the network dialogue would be:
python ftplib.py -d localhost -l -p -l
�N)�_GLOBAL_DEFAULT_TIMEOUT�FTP�error_reply�
error_temp�
error_perm�error_proto�
all_errors��� c@seZdZdS)�ErrorN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/ftplib.pyr9src@seZdZdS)rNr
rrrrr:sc@seZdZdS)rNr
rrrrr;sc@seZdZdS)rNr
rrrrr<sc@seZdZdS)rNr
rrrrr=s�
s
c@s�eZdZdZdZdZeZeZ	dZ
dZdZdZ
dZdZddddedfdd	�Zd
d�Zdd
�Zd\dd�Zdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d]d3d4�Z'd^d5d6�Z(d_d7d8�Z)d`d:d;�Z*dad<d=�Z+dbd>d?�Z,dcd@dA�Z-dBdC�Z.dDdE�Z/dFdG�Z0dgfdHdI�Z1dJdK�Z2dLdM�Z3dNdO�Z4dPdQ�Z5dRdS�Z6dTdU�Z7dVdW�Z8dXdY�Z9dZd[�Z:dS)drayAn FTP client class.

    To create a connection, call the class using these arguments:
            host, user, passwd, acct, timeout

    The first four arguments are all strings, and have default value ''.
    timeout must be numeric and defaults to None if not passed,
    meaning that no timeout will be set on any ftp socket(s)
    If a timeout is passed, then this is now the default timeout for all ftp
    socket operations for this instance.

    Then use self.connect() with optional host and port argument.

    To download a file, use ftp.retrlines('RETR ' + filename),
    or ftp.retrbinary() with slightly different arguments.
    To upload a file, use ftp.storlines() or ftp.storbinary(),
    which have an open file as argument (see their definitions
    below for details).
    The download/upload functions first issue appropriate TYPE
    and PORT or PASV commands.
    r�Nr	zlatin-1FcCs0||_||_|r,|�|�|r,|�|||�dS�N)�source_address�timeout�connect�login)�self�host�user�passwd�acctrrrrr�__init__rs
zFTP.__init__cCs|Srr�rrrr�	__enter__{sz
FTP.__enter__c	GsN|jdk	rJz*z|��Wnttfk
r0YnXW5|jdk	rH|��XdSr)�sock�close�quit�OSError�EOFError)r�argsrrr�__exit__s


zFTP.__exit__����cCs�|dkr||_|dkr||_|dkr*||_|dk	r8||_t�d||j|j�tj|j|jf|j|jd�|_|jj	|_
|jjd|jd�|_
|��|_|jS)	awConnect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
        rrr)Nzftplib.connect�r�r��encoding)r�portrr�sys�audit�socket�create_connectionr"�family�af�makefiler-�file�getresp�welcome)rrr.rrrrrr�s �

zFTP.connectcCs|jrtd|�|j��|jS)z`Get the welcome message from the server.
        (this is read and squirreled away by connect())z	*welcome*)�	debugging�print�sanitizer8r rrr�
getwelcome�szFTP.getwelcomecCs
||_dS)z�Set the debugging level.
        The required argument level means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)r9)r�levelrrr�set_debuglevel�szFTP.set_debuglevelcCs
||_dS)z�Use passive or active mode for data transfers.
        With a false argument, use the normal PORT mode,
        With a true argument, use the PASV command.N)�
passiveserver)r�valrrr�set_pasv�szFTP.set_pasvcCsJ|dd�dkrBt|�d��}|dd�d|d||d�}t|�S)N�>�PASS �pass r�*)�len�rstrip�repr)r�s�irrrr;�s$zFTP.sanitizecCs`d|ksd|krtd��t�d||�|t}|jdkrHtd|�|��|j�|�	|j
��dS)N�
�
z4an illegal newline character should not be containedzftplib.sendcmdr	z*put*)�
ValueErrorr/r0�CRLFr9r:r;r"�sendall�encoder-�r�linerrr�putline�s
zFTP.putlinecCs$|jrtd|�|��|�|�dS)Nz*cmd*)r9r:r;rSrQrrr�putcmd�sz
FTP.putcmdcCs�|j�|jd�}t|�|jkr.td|j��|jdkrHtd|�|��|sPt�|dd�t	krn|dd�}n|dd�t	kr�|dd�}|S)Nr	�got more than %d bytesz*get*������)
r6�readline�maxlinerFrr9r:r;r&rNrQrrr�getline�s
zFTP.getlinecCs`|��}|dd�dkr\|dd�}|��}|d|}|dd�|kr$|dd�dkr$q\q$|S)N���-rL)rZ)rrR�codeZnextlinerrr�getmultiline�s�zFTP.getmultilinecCsp|��}|jrtd|�|��|dd�|_|dd�}|dkrD|S|dkrTt|��|dkrdt|��t|��dS)Nz*resp*r[r	>�1�3�2�4�5)r_r9r:r;Zlastresprrr)r�resp�crrrr7�szFTP.getrespcCs$|��}|dd�dkr t|��|S)z%Expect a response beginning with '2'.Nr	rb)r7r�rrerrr�voidresp�szFTP.voidrespcCsTdt}|jdkr"td|�|��|j�|t�|��}|dd�dkrPt|��|S)z�Abort a file transfer.  Uses out-of-band data.
        This does not follow the procedure from the RFC to send Telnet
        IP and Synch; that doesn't seem to work with the servers I've
        tried.  Instead, just send the ABOR command as OOB data.�ABORr	z*put urgent*Nr[��225�426�226)	�B_CRLFr9r:r;r"rO�MSG_OOBr_r�rrRrerrr�aborts
z	FTP.abortcCs|�|�|��S)z'Send a command and return the response.)rTr7�r�cmdrrr�sendcmds
zFTP.sendcmdcCs|�|�|��S)z8Send a command and expect a response beginning with '2'.)rTrhrrrrr�voidcmds
zFTP.voidcmdcCsB|�d�}t|d�t|d�g}||}dd�|�}|�|�S)zUSend a PORT command with the current host and the given
        port number.
        �.�zPORT �,)�splitrH�joinru)rrr.ZhbytesZpbytes�bytesrsrrr�sendports

zFTP.sendportcCsbd}|jtjkrd}|jtjkr$d}|dkr4td��dt|�|t|�dg}dd�|�}|�|�S)zESend an EPRT command with the current host and the given port number.rr	�zunsupported address familyrzEPRT �|)r4r1�AF_INETZAF_INET6rrHrzru)rrr.r4Zfieldsrsrrr�sendeprt&szFTP.sendeprtcCsltjd|jdd�}|��d}|j��d}|jtjkrF|�||�}n|�||�}|jt	k	rh|�
|j�|S)z3Create a new socket and send a PORT command for it.)rrr	)r3Zbacklogr)r1Z
create_serverr4Zgetsocknamer"rr|r�rr�
settimeout)rr"r.rrerrr�makeport3s
zFTP.makeportcCs\|jtjkr:t|�d��\}}|jr*|}qT|j��d}nt|�d�|j���\}}||fS)z<Internal: Does the PASV or EPSV handshake -> (address, port)�PASVrZEPSV)	r4r1r�parse227rt�trust_server_pasv_ipv4_addressr"Zgetpeername�parse229)rZuntrusted_hostr.rrrr�makepasv@szFTP.makepasvc
	Cs6d}|jr�|��\}}tj||f|j|jd�}zL|dk	rF|�d|�|�|�}|ddkrd|��}|ddkrxt|��Wn|�	��YnXn�|�
��r}|dk	r�|�d|�|�|�}|ddkr�|��}|ddkr�t|��|��\}}	|jtk	�r
|�
|j�W5QRX|dd�dk�r.t|�}||fS)	a�Initiate a transfer over the data connection.

        If the transfer is active, send a port command and the
        transfer command, and accept the connection.  If the server is
        passive, send a pasv command, connect to it, and start the
        transfer command.  Either way, return the socket for the
        connection and the expected size of the transfer.  The
        expected size may be None if it could not be determined.

        Optional `rest' argument can be a string that is sent as the
        argument to a REST command.  This is essentially a server
        marker used to tell the server to skip over any data up to the
        given marker.
        Nr*zREST %srrbr`r[�150)r?r�r1r2rrrtr7rr#r�Zacceptrr��parse150)
rrs�rest�sizerr.�connrer"Zsockaddrrrr�ntransfercmdLs>�



zFTP.ntransfercmdcCs|�||�dS)z0Like ntransfercmd() but returns only the socket.r)r�)rrsr�rrr�transfercmd�szFTP.transfercmdcCs�|sd}|sd}|sd}|dkr0|dkr0|d}|�d|�}|ddkrX|�d|�}|ddkrr|�d	|�}|dd
kr�t|��|S)zLogin, default anonymous.Z	anonymousr>rr]z
anonymous@zUSER rrarC�ACCT rb�rtr)rrrrrerrrr�s z	FTP.loginrc	Cs^|�d�|�||��:}|�|�}|s(q2||�qtdk	rLt|t�rL|��W5QRX|��S)a�Retrieve data in binary mode.  A new port is created for you.

        Args:
          cmd: A RETR command.
          callback: A single parameter callable to be called on each
                    block of data read.
          blocksize: The maximum number of bytes to read from the
                     socket at one time.  [default: 8192]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        �TYPE IN)rur�Zrecv�
_SSLSocket�
isinstance�unwraprh)rrs�callback�	blocksizer�r��datarrr�
retrbinary�s


zFTP.retrbinaryc
Cs�|dkrt}|�d�}|�|���}|jd|jd���}|�|jd�}t|�|jkr`td|j��|j	dkrxt
dt|��|s~q�|d	d�tkr�|dd	�}n|d
d�dkr�|dd
�}||�q4t
dk	r�t|t
�r�|��W5QRXW5QRX|��S)ahRetrieve data in line mode.  A new port is created for you.

        Args:
          cmd: A RETR, LIST, or NLST command.
          callback: An optional single parameter callable that is called
                    for each line with the trailing CRLF stripped.
                    [default: print_line()]

        Returns:
          The response code.
        N�TYPE Ar+r,r	rUr}z*retr*rVrWrL)�
print_linertr�r5r-rXrYrFrr9r:rHrNr�r�r�rh)rrsr�rer��fprRrrr�	retrlines�s,
�

z
FTP.retrlinesc	Csl|�d�|�||��H}|�|�}|s(q@|�|�|r||�qtdk	rZt|t�rZ|��W5QRX|��S)a9Store a file in binary mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a read(num_bytes) method.
          blocksize: The maximum data size to read from fp and send over
                     the connection at once.  [default: 8192]
          callback: An optional single parameter callable that is called on
                    each block of data after it is sent.  [default: None]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        r�N)rur��readrOr�r�r�rh)rrsr�r�r�r�r��bufrrr�
storbinary�s



zFTP.storbinaryc	Cs�|�d�|�|���}|�|jd�}t|�|jkrBtd|j��|sHq�|dd�tkrx|dtkrp|dd�}|t}|�|�|r||�qtdk	r�t	|t�r�|�
�W5QRX|��S)ahStore a file in line mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a readline() method.
          callback: An optional single parameter callable that is called on
                    each line after it is sent.  [default: None]

        Returns:
          The response code.
        r�r	rUrVNrW)rur�rXrYrFrrnrOr�r�r�rh)rrsr�r�r�r�rrr�	storlines�s"


z
FTP.storlinescCsd|}|�|�S)zSend new account name.r��ru)rZpasswordrsrrrrszFTP.acctcGs0d}|D]}|d|}qg}|�||j�|S)zBReturn a list of files in a given directory (default the current).ZNLST� )r��append)rr'rs�arg�filesrrr�nlstszFTP.nlstcGshd}d}|dd�r>t|d�td�kr>|dd�|d}}|D]}|rB|d|}qB|�||�dS)aList a directory in long form.
        By default list current directory to stdout.
        Optional last argument is callback function; all
        non-empty arguments before it are concatenated to the
        LIST command.  (This *should* only be used for a pathname.)ZLISTNrWrr�)�typer�)rr'rs�funcr�rrr�dir(s zFTP.dirc
cs�|r|�dd�|�d�|r*d|}nd}g}|�||j�|D]\}|�t��d�\}}}i}	|dd��d�D] }
|
�d�\}}}||	|��<qt||	fVqDdS)	a<List a directory in a standardized format by using MLSD
        command (RFC-3659). If path is omitted the current directory
        is assumed. "facts" is a list of strings representing the type
        of information desired (e.g. ["type", "size", "perm"]).

        Return a generator object yielding a tuple of two elements
        for every file found in path.
        First element is the file name, the second one is a dictionary
        including a variable number of "facts" depending on the server
        and whether "facts" argument has been provided.
        z
OPTS MLST �;zMLSD %sZMLSDr�NrW�=)	rtrzr�r�rGrN�	partitionry�lower)
r�pathZfactsrs�linesrRZfacts_found�_�name�entryZfact�key�valuerrr�mlsd7s
zFTP.mlsdcCs0|�d|�}|ddkr"t|��|�d|�S)zRename a file.zRNFR rrazRNTO )rtrru)rZfromnameZtonamererrr�renameSsz
FTP.renamecCs.|�d|�}|dd�dkr"|St|��dS)zDelete a file.zDELE Nr[>�250�200r�)r�filenamererrr�deleteZsz
FTP.deletec
Csp|dkrRz|�d�WStk
rN}z|jddd�dkr>�W5d}~XYq^Xn|dkr^d}d	|}|�|�S)
zChange to a directory.z..ZCDUPrNr[�500rrvzCWD )rurr')r�dirname�msgrsrrr�cwdbszFTP.cwdcCs:|�d|�}|dd�dkr6|dd���}t|�SdS)zRetrieve the size of a file.zSIZE Nr[Z213)rt�strip�int)rr�rerIrrrr�oszFTP.sizecCs$|�d|�}|�d�sdSt|�S)z+Make a directory, return its full pathname.zMKD �257r�ru�
startswith�parse257)rr�rerrr�mkdws
zFTP.mkdcCs|�d|�S)zRemove a directory.zRMD r�)rr�rrr�rmd�szFTP.rmdcCs |�d�}|�d�sdSt|�S)z!Return current working directory.ZPWDr�rr�rgrrr�pwd�s

zFTP.pwdcCs|�d�}|��|S)zQuit, and close the connection.ZQUIT)rur#rgrrrr$�s
zFTP.quitcCsDz |j}d|_|dk	r|��W5|j}d|_|dk	r>|��XdS)z8Close the connection without assuming anything about it.N)r"r#r6)rr"r6rrrr#�sz	FTP.close)rrr)N)N)N)rrr)rN)N)rNN)N);rrr�__doc__r9r�FTP_PORTr.�MAXLINErYr"r6r8r?r-r�rrr!r(rr<r>�debugrAr;rSrTrZr_r7rhrqrtrur|r�r�r�r�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r$r#rrrrrJsp�
	






7



#

	
		c	@sneZdZdZejZdddddddedf	dd�Zddd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ddd�Zdd�ZdS)�FTP_TLSa�A FTP subclass which adds TLS support to FTP as described
        in RFC-4217.

        Connect as usual to port 21 implicitly securing the FTP control
        connection before authenticating.

        Securing the data connection requires user to explicitly ask
        for it by calling prot_p() method.

        Usage example:
        >>> from ftplib import FTP_TLS
        >>> ftps = FTP_TLS('ftp.python.org')
        >>> ftps.login()  # login anonymously previously securing control channel
        '230 Guest login ok, access restrictions apply.'
        >>> ftps.prot_p()  # switch to secure data connection
        '200 Protection level set to P'
        >>> ftps.retrlines('LIST')  # list directory content securely
        total 9
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
        d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
        drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
        drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
        drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
        -rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
        '226 Transfer complete.'
        >>> ftps.quit()
        '221 Goodbye.'
        >>>
        rNc
	Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}
|
�dtd�||_||_|dkr|tj|j||d�}||_	d|_
t�|||||||	�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr})�certfile�keyfileF)
rM�warnings�warn�DeprecationWarningr�r��sslZ_create_stdlib_context�ssl_version�context�_prot_prr)rrrrrr�r�r�rrr�rrrr�s(��zFTP_TLS.__init__TcCs*|rt|jtj�s|��t�||||�Sr)r�r"r��	SSLSocket�authrr)rrrrZsecurerrrr�sz
FTP_TLS.logincCsft|jtj�rtd��|jtjkr.|�d�}n
|�d�}|jj	|j|j
d�|_|jjd|jd�|_
|S)z2Set up secure control connection by using TLS/SSL.zAlready using TLSzAUTH TLSzAUTH SSL�Zserver_hostnamer+)�moder-)r�r"r�r�rMr�ZPROTOCOL_TLSrur��wrap_socketrr5r-r6rgrrrr��s

�zFTP_TLS.authcCs0t|jtj�std��|�d�}|j��|_|S)z/Switch back to a clear-text control connection.z
not using TLSZCCC)r�r"r�r�rMrur�rgrrr�ccc�s

zFTP_TLS.ccccCs|�d�|�d�}d|_|S)zSet up secure data connection.zPBSZ 0zPROT PT�rur�rgrrr�prot_p�s

zFTP_TLS.prot_pcCs|�d�}d|_|S)z"Set up clear text data connection.zPROT CFr�rgrrr�prot_cs
zFTP_TLS.prot_ccCs2t�|||�\}}|jr*|jj||jd�}||fS)Nr�)rr�r�r�r�r)rrsr�r�r�rrrr�s�zFTP_TLS.ntransfercmdcCs8dt}|j�|�|��}|dd�dkr4t|��|S)Nrir[rj)rnr"rOr_rrprrrrqsz
FTP_TLS.abort)rrrT)N)rrrr�r�ZPROTOCOL_TLS_CLIENTr�rrrr�r�r�r�r�rqrrrrr��s 
�



r�cCs\|dd�dkrt|��tdkr<ddl}|�d|j|jB�at�|�}|sNdSt|�d��S)z�Parse the '150' response for a RETR request.
    Returns the expected transfer size or None; size is not guaranteed to
    be present in the 150 message.
    Nr[r�rz150 .* \((\d+) bytes\)r	)	r�_150_re�re�compile�
IGNORECASE�ASCII�matchr��group)rer��mrrrr�)s
�
r�cCs�|dd�dkrt|��tdkr6ddl}|�d|j�at�|�}|sLt|��|��}d�|dd��}t	|d�d>t	|d	�}||fS)
z�Parse the '227' response for a PASV request.
    Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z227rz#(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)rvr\�rB)
r�_227_rer�r�r��searchr�groupsrzr�)rer�r�Znumbersrr.rrrr�=s
r�cCs�|dd�dkrt|��|�d�}|dkr2t|��|�d|d�}|dkrRt|��||d||dkrrt|��||d|��||d�}t|�dkr�t|��|d}t|d�}||fS)	z�Parse the '229' response for an EPSV request.
    Raises error_proto if it does not contain '(|||port|)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z229�(r�)r	rB)r�findrryrFr�)reZpeer�left�right�partsrr.rrrr�Qs 
r�cCs�|dd�dkrt|��|dd�dkr,dSd}d}t|�}||kr�||}|d}|dkrz||ks�||dkrrq�|d}||}q<|S)	z�Parse the '257' response for a MKD or PWD request.
    This is a response to a MKD or PWD request: a directory name.
    Returns the directoryname in the 257 reply.Nr[r�rBz "rr	�")rrF)rer�rJ�nrfrrrr�gs 
r�cCst|�dS)z+Default retrlines callback to print a line.N)r:)rRrrrr�~sr�r�Ic	Cs�|s|}d|}|�|�|�|�t|�d��\}}|�||�|�d|�}|dd�dkrdt�|�d|�}|dd�dkr�t�|��|��dS)z+Copy file from one FTP-instance to another.zTYPE r�zSTOR Nr[>�125r��RETR )rur�rtr|rrh)	�sourceZ
sourcename�targetZ
targetnamer�Z
sourcehostZ
sourceportZtreplyZsreplyrrr�ftpcp�s

r�cCs�ttj�dkr"ttj�t�d�ddl}d}d}tjddkrR|d}tjd=q2tjddd�dkr�tjddd�}tjd=tjd}t|�}|�	|�d}}}z|�|�}Wn(t
k
r�|dk	r�tj�d�Yn:Xz|�
|�\}}}Wn"tk
�rtj�d	�YnX|�|||�tjdd�D]�}	|	dd�d
k�r`|�|	dd��nt|	dd�dk�r�d}
|	dd��r�|
d|	dd�}
|�|
�}n0|	d
k�r�|�|j�n|�d|	tjjd��q6|��dS)z�Test program.
    Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...

    -d dir
    -l list
    -p password
    r}rNr	z-dz-rrz5Could not open account file -- using anonymous login.z$No account -- using anonymous login.z-lZCWDr�z-pr�i)rFr/�argvr:�testr��exit�netrcrr>r%�stderr�writeZauthenticators�KeyErrorrr�rtrAr?r��stdoutr$)r�r9ZrcfilerZftpZuseridrrZnetrcobjr6rsrerrrr��sV	




�


�r��__main__)rr�)%r�r/r1r�__all__ror�r��	Exceptionrrrrrr%r&rrNrnrr��ImportErrorr�r�r�r�ZSSLErrorr�r�r�r�r�r�r�r�r�rrrrr�<module>sR&
�
Z
|

9
tokenize.cpython-38.opt-2.pyc000064400000032052151450073350011771 0ustar00U

e5d�d�@sDdZdZddlmZddlmZmZddlZddl	m
Z
ddlZddl
Z
ddlZddlTddlmZe
�d	e
j�Ze
�d
e
j�ZddlZejddd
ddgZ[Gdd�de�dd��Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZdZ dZ!dZ"eee e!e"�Z#d Z$ed!d"�ee$�Z%d#e$Z&ee%e&�Z'ed$e'd%�Z(ee(e'e#�Z)d&d'�Z*d(d)�Z+ee*��Z,d*Z-d+Z.d,Z/d-Z0ee,d.e,d/�Z1ee,d0e,d1�Z2ee3e
j4e5ed2d3���Z6ed4e6�Z7ee)e7e2e�Z8ee8Z9ee,d5ed6d�e,d7ed8d��Z:ed9ee1�Z;eee;e)e7e:e�Z<iZ=e*�D]6Z>e-e=e>d6<e.e=e>d8<e/e=e>d.<e0e=e>d/<�q(e?�Z@e?�ZAe*�D]JZBeBd8eBd6fD]ZCe@�DeC��q�eBd/eBd.fD]ZCeA�DeC��q��qrd:ZEGd;d<�d<eF�ZGGd=d>�d>eF�ZHGd?d@�d@�ZIdAd�ZJdBdC�ZKdDd
�ZLdEdF�ZdGd�ZMdHdI�ZNdJd�ZOdKdL�ZPeQdMk�r@eP�dS)NzKa-Ping Yee <ping@lfw.org>zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foord�)�open)�lookup�BOM_UTF8N)�
TextIOWrapper)�*)�EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)�tokenize�generate_tokens�detect_encoding�
untokenize�	TokenInfoc@s eZdZdd�Zedd��ZdS)rcCs$d|jt|jf}d|j|d�S)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))�type)r
�tok_name�_replace)�self�annotated_type�r� /usr/lib64/python3.8/tokenize.py�__repr__.s
�zTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdS�N)r
�OP�stringr�rrrr�
exact_type3s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr-sztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group:�r$cGst|�dS)Nr�r$r"rrr�any;r%r'cGst|�dS)N�?r&r"rrr�maybe<r%r)z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]cCs^ddddddg}dh}|D]>}t�|�D].}tjdd	�|D��D]}|�d�|��q@q(q|S)
N�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>^sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr,rrr�_all_string_prefixesSsr=cCst�|tj�Sr)�re�compile�UNICODE)�exprrrr�_compilebsrBz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)�reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"z
\\\r?\n|\Z�c@seZdZdS)�
TokenErrorN�rrrrrrrrG�srGc@seZdZdS)�StopTokenizingNrHrrrrrI�srIc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__init__�szUntokenizer.__init__cCs�|\}}||jks&||jkr>||jkr>td�|||j|j���||j}|rb|j�d|�d|_||j}|r�|j�d|�dS)Nz+start ({},{}) precedes previous end ({},{})�\
r� )rMrN�
ValueError�formatrL�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

zUntokenizer.add_whitespacecCs6t|�}g}d}|D�]}t|�dkr8|�||��q*|\}}}}	}
|tkrV||_q|tkrd�q*|tkrz|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fkr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fkr|j
d7_
d|_qd�|j�S)NF�T���rKrr0)�iter�len�compat�ENCODINGrO�	ENDMARKER�INDENTrU�DEDENT�poprMrN�NEWLINE�NLrLr[r!)r�iterable�it�indents�	startliner<�tok_type�tokenrV�end�line�indentrrrr�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfk}d}t�|g|�D]�}|dd�\}}	|tkrR|	|_q.|tt	fkrf|	d7}	|t
kr�|rzd|	}	d}nd}|tkr�|�|	�q.n>|tkr�|�
�q.n*|ttfkr�d}n|r�|r�||d�d}||	�q.dS)NrFr\rRTr])rLrUrfrgr5�chainrarO�NAME�NUMBER�STRINGrcrdre)
rrmrhrj�toks_appendrk�
prevstring�tok�toknum�tokvalrrrr`�s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJ�s
%rJcCs*t�}|�|�}|jdk	r&|�|j�}|Sr)rJrrO�encode)rh�ut�outrrrrs


cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDdS|S)	N��_�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r�)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_names�r�cs�z�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|�t�rpd�|dd�}d	}|s||gfS||�}|r�||gfSt�|�s�||gfS|�}|s�||gfS||�}|r�|||gfS|||gfS)
NFr�cs$z��WStk
rYdSXdS�Nr%)�
StopIterationr��readlinerr�read_or_stop?sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn4tk
rBd}�dk	r6d�|��}t|��YnXt�|�}|sVdSt|�d��}zt|�}Wn:t	k
r��dkr�d|}nd��|�}t|��YnX�r�|dkr؈dkr�d}n
d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrT�SyntaxError�	cookie_re�matchr�r$r�LookupError)ro�line_string�msgr�rO�codec)�	bom_found�filenamerr�find_cookieEs8

�
z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rO�defaultr�r��first�secondr)r�r�r�rr
's8
&




cCsXt|d�}z2t|j�\}}|�d�t||dd�}d|_|WS|���YnXdS)N�rbrT)�line_bufferingr+)�
_builtin_openr
r��seekr�mode�close)r��bufferrO�lines�textrrrr�s

rcCs6t|�\}}t�d�}t�|t|d�|�}t|j|�Sr�)r
r5�repeatrqr^�	_tokenize�__next__)r�rO�consumed�empty�rl_genrrrr�s
ccsld}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|ddd�Vd}
d}z|}
|�}Wntk
rvd}YnX|dk	r�|�|�}|d	7}dt|�}}
|�rp|s�td
|��|�|�}|�r|�d�}}tt||d|�|||f||�Vd\}}d}nf|�rZ|dd�dk�rZ|d
d�dk�rZtt	||||t|�f|�Vd}d}qPn||}||}qP�n�|dk�r|�s|�s��q�d}||
k�r�||dk�r�|d	7}n8||dk�r�|t
d	t
}n||dk�r�d}n�q�|d	7}�q�||
k�r�q�||dk�r�||dk�r^||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqP||	dk�r�|	�|�tt|d|�|df||f|�V||	dk�r.||	k�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�n|�s*td|df��d}||
krPtt��||�}|�r�|�d	�\}}||f||f|}}}||k�r��q.|||�||}}||k�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dk�r|dk�r�tt
||||�Vntt||||�V�q�|dk�r2tt||||�V�q�|tk�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}qP�q�|tk�s�|dd�tk�s�|dd�tk�rF|ddk�r2||f}tt�|��pt�|d	��pt�|d��}||d�d	}}|}qPntt||||�Vnf|���rdtt||||�VnH|dk�rtd	}n8|dk�r�|d	7}n|d k�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q.qP|
�r |
ddk�r ttd|d	t|
�f|d	t|
�d	fd�V|	d	d�D] }ttd|df|dfd�V�q,ttd|df|dfd�VdS)!Nr�
0123456789)r0rr�r�)rrr0r%rKzEOF in multi-line string���rQ���z\
rR�	�z#
�#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...r\r��
�\z([{z)]})rrar�r�r_rGr�rnrt�
ERRORTOKEN�tabsize�rstrip�COMMENTrgrUrc�IndentationErrorrdrB�PseudoToken�spanrsrf�
triple_quoted�endpats�
single_quoted�get�isidentifierrrrrb)r�rO�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerj�	last_linero�pos�max�strstart�endprog�endmatchrn�column�
comment_token�pseudomatchrV�spos�eposrm�initialrprrrr��s<




�*

�


�
�
"

� 

���





����






�.r�cCs
t|d�Sr)r�r�rrrr	dsc

s$ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}z�|jr�|j}t|d��}tt|j��}W5QRXnd}t	t
jjd�}|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�W�n8tk
�r6}
z0|
jddd�\}}||
jd|||f�W5d}
~
XYn�tk
�r|}
z(|
jd\}}||
jd|||f�W5d}
~
XYn�tk
�r�}
z||
|�W5d}
~
XYnxtk
�r�}
z||
�W5d}
~
XYnNtk
�r�td�Yn2tk
�r}
z�d|
��W5d}
~
XYnXdS)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorpszmain.<locals>.perrorcsR|r"|f||f}�d|�n"|r8�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srK)r��exit)r�r��location�args�r�rr�errortszmain.<locals>.errorzpython -m tokenize)�progr�r(zfilename.pyz'the file to tokenize; defaults to stdin)�dest�nargs�metavar�helpz-ez--exact�exact�
store_truez(display token names using the exact type)r��actionr�r�z<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrKr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrVrn�printrrr�r�rGr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r-rLrm�
token_type�token_range�errror�rr�r�mainlsT���&&r��__main__)R�
__author__�__credits__�builtinsrr��codecsrr�collections�ior�	itertoolsr5r>r�rmrr?�ASCIIr�r��__all__�
namedtuplerr$r'r)�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr=rB�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r<r,r8r�r�rGrIrJrr�r
rr�r	r�rrrrr�<module>s�
�
��

�
���

_]8=
os.cpython-38.pyc000064400000075247151450073350007637 0ustar00U

e5dS��@s�dZddlZddlZddlZddlmZejZdddddd	d
ddd
dddddddddgZ	dd�Z
dd�Zdekr�dZdZ
ddlTzddlmZe	�d�Wnek
r�YnXddlZzdd lmZWnek
r�YnXddlZe	�ee��[n�d!ek�r�d!Zd"Z
ddlTzddlmZe	�d�Wnek
�rBYnXddlZddlZe	�ee��[zdd lmZWnek
�r�YnXned#��eejd$<dd%lmZmZmZmZmZmZm Z m!Z![e
d&��r�e"�Z#d'd(�Z$e%�Z&e$d)d*�e$d+d,�e$d-d.�e$d/d0�e$d1d2�e$d3d4�e$d5d6�e$d7d8�e$d9d:�e$d;d<�e$d=d>�e$d?d@�e$dAdB�e$dCdD�e$dCdE�e$dFd2�e&Z'e%�Z&e$d)d*�e&Z(e%�Z&e$dGdH�e$dId,�e$dJd.�e$dKdL�e$dKdM�e$dNdO�e&�)e�e$dPdQ�e$dRd2�e$dSd2�e$dTdU�e
dV��r2e
dW��r2e$dXdV�e&Z*e%�Z&e$d)d*�e$d-d.�e$d/d0�e$dYdZ�e$d[d,�e
d\��r�e$d]d.�e$d3d4�e$d^d2�e$d_d0�e$d/d0�e$dFd2�e$d`d0�e&Z+[&[[#[$dZ,daZ-dbZ.d�dedf�Z/dgdh�Z0didj�Z1e	�dfdhdjg�d�dldm�Z2e	�dm�e3ehe'k�rTe4ehe*k�rTd�ddddo�dpdq�Z5drds�Z6e	�dq�dtdu�Z7dvdw�Z8dxdy�Z9dzd{�Z:d|d}�Z;d~d�Z<e	�dudwdyd{d}dg�d�d�d��Z=d�d�d�Z>dd�lm?Z?Gd�d��d�e?�Z@zeAZBWneCk
�r�d�d��ZBYnXd�e	k�re	�d��zeDZEWneCk
�r,d�d��ZEYnXd�e	k�rBe	�d��d�d��ZFeF�ZG[Fd�d�d��ZHed!kZIe	�d��eI�r�d�d��ZJe@eGjKeJeLeJeLeBeE�ZM[Jd�d�d��ZNe	�d��d�d��ZOeO�\ZPZQ[Oe
d���r0e
d���s0e
d���r0dZRdaZSZTe	�d�d�d�g�d�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYe	�d�d�d�d�g�e
d���rXd�d��ZZd�d��Z[e	�d�d�g�e
d���r�d�d��Z\d�d��Z]e	�d�d�g�d�d�d�Z^Gd�d��d��Z_d�d�Z`d�d��Zae
d���s�eaZbd�eb_cGd�d��d�ejd�Zeed!k�r�Gd�d��d��Zfd�d��ZgdS)�aNOS routines for NT or Posix depending on what system we're on.

This exports:
  - all functions from posix or nt, e.g. unlink, stat, etc.
  - os.path is either posixpath or ntpath
  - os.name is either 'posix' or 'nt'
  - os.curdir is a string representing the current directory (always '.')
  - os.pardir is a string representing the parent directory (always '..')
  - os.sep is the (or a most common) pathname separator ('/' or '\\')
  - os.extsep is the extension separator (always '.')
  - os.altsep is the alternate pathname separator (None or '/')
  - os.pathsep is the component separator used in $PATH etc
  - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
  - os.defpath is the default search path for executables
  - os.devnull is the file path of the null device ('/dev/null', etc.)

Programs that import and use 'os' stand a better chance of being
portable between different platforms.  Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
�N)�_check_methods�altsep�curdir�pardir�sep�pathsep�linesep�defpath�name�path�devnull�SEEK_SET�SEEK_CUR�SEEK_END�fsencode�fsdecode�
get_exec_path�fdopen�popen�extsepcCs
|t�kS�N)�globals)r
�r�/usr/lib64/python3.8/os.py�_exists'srcCs8zt|j�WStk
r2dd�t|�D�YSXdS)NcSsg|]}|ddkr|�qS)r�_r)�.0�nrrr�
<listcomp>.sz%_get_exports_list.<locals>.<listcomp>)�list�__all__�AttributeError�dir)�modulerrr�_get_exports_list*sr$�posix�
)�*)�_exitr()�_have_functions�ntz
zno os specific module foundzos.path)rrrrr	rrrr)cCs"|tkr|tkrt�t|�dSr)�_globalsr)�_set�add)�str�fnrrr�_addfsr0ZHAVE_FACCESSAT�accessZ
HAVE_FCHMODAT�chmodZ
HAVE_FCHOWNAT�chownZHAVE_FSTATAT�statZHAVE_FUTIMESAT�utimeZHAVE_LINKAT�linkZHAVE_MKDIRAT�mkdirZ
HAVE_MKFIFOAT�mkfifoZHAVE_MKNODAT�mknodZHAVE_OPENAT�openZHAVE_READLINKAT�readlinkZ
HAVE_RENAMEAT�renameZHAVE_SYMLINKAT�symlinkZ
HAVE_UNLINKAT�unlink�rmdirZHAVE_UTIMENSATZHAVE_FCHDIR�chdirZHAVE_FCHMODZHAVE_FCHOWNZHAVE_FDOPENDIR�listdir�scandirZHAVE_FEXECVE�execveZHAVE_FTRUNCATE�truncateZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FPATHCONF�pathconf�statvfs�fstatvfsZ
HAVE_FSTATVFSZ
HAVE_LCHFLAGSZchflagsZHAVE_LCHMOD�lchownZHAVE_LCHOWNZHAVE_LUTIMESZ
HAVE_LSTATZ
MS_WINDOWS���FcCs�t�|�\}}|s t�|�\}}|r||r|t�|�s|zt||d�Wntk
rVYnXt}t|t�rpttd�}||kr|dSzt||�Wn$t	k
r�|r�t�
|�s��YnXdS)a�makedirs(name [, mode=0o777][, exist_ok=False])

    Super-mkdir; create a leaf directory and all intermediate ones.  Works like
    mkdir, except that any intermediate path segment (not just the rightmost)
    will be created if it does not exist. If the target directory already
    exists, raise an OSError if exist_ok is False. Otherwise no exception is
    raised.  This is recursive.

    )�exist_ok�ASCIIN)r�split�exists�makedirs�FileExistsErrorr�
isinstance�bytesr7�OSError�isdir)r
�moderL�head�tail�cdirrrrrP�s$


rPcCsjt|�t�|�\}}|s(t�|�\}}|rf|rfzt|�Wntk
rTYqfYnXt�|�\}}q(dS)a�removedirs(name)

    Super-rmdir; remove a leaf directory and all empty intermediate
    ones.  Works like rmdir except that, if the leaf directory is
    successfully removed, directories corresponding to rightmost path
    segments will be pruned away until either the whole path is
    consumed or an error occurs.  Errors during this latter phase are
    ignored -- they generally mean that a directory was not empty.

    N)r?rrNrT)r
rWrXrrr�
removedirs�s
rZcCsnt�|�\}}|r(|r(t�|�s(t|�t||�t�|�\}}|rj|rjzt|�Wntk
rhYnXdS)a<renames(old, new)

    Super-rename; create directories as necessary and delete any left
    empty.  Works like rename, except creation of any intermediate
    directories needed to make the new pathname good is attempted
    first.  After the rename, directories corresponding to rightmost
    path segments of the old name will be pruned until either the
    whole path is consumed or a nonempty directory is found.

    Note: this function can fail with the new directory structure made
    if you lack permissions needed to unlink the leaf directory or
    file.

    N)rrNrOrPr<rZrT)�old�newrWrXrrr�renames�s
r]Tccst|�}g}g}g}zt|�}Wn8tk
rX}z|dk	rB||�WY�dSd}~XYnX|��z.zt|�}	Wntk
r�YW�qpYnXWnBtk
r�}z$|dk	r�||�WY�W5QR�dSd}~XYnXz|	��}
Wntk
�r�d}
YnX|
�r|�|	j�n|�|	j�|sb|
rb|�r0d}n.z|	��}Wntk
�rVd}YnX|}|rb|�|	j	�qbW5QRX|�r�|||fVt	j
t	j}
}|D]4}|||�}|�s�|
|��s�t||||�EdH�q�n,|D]}t||||�EdH�q�|||fVdS)aDirectory tree generator.

    For each directory in the directory tree rooted at top (including top
    itself, but excluding '.' and '..'), yields a 3-tuple

        dirpath, dirnames, filenames

    dirpath is a string, the path to the directory.  dirnames is a list of
    the names of the subdirectories in dirpath (excluding '.' and '..').
    filenames is a list of the names of the non-directory files in dirpath.
    Note that the names in the lists are just names, with no path components.
    To get a full path (which begins with top) to a file or directory in
    dirpath, do os.path.join(dirpath, name).

    If optional arg 'topdown' is true or not specified, the triple for a
    directory is generated before the triples for any of its subdirectories
    (directories are generated top down).  If topdown is false, the triple
    for a directory is generated after the triples for all of its
    subdirectories (directories are generated bottom up).

    When topdown is true, the caller can modify the dirnames list in-place
    (e.g., via del or slice assignment), and walk will only recurse into the
    subdirectories whose names remain in dirnames; this can be used to prune the
    search, or to impose a specific order of visiting.  Modifying dirnames when
    topdown is false has no effect on the behavior of os.walk(), since the
    directories in dirnames have already been generated by the time dirnames
    itself is generated. No matter the value of topdown, the list of
    subdirectories is retrieved before the tuples for the directory and its
    subdirectories are generated.

    By default errors from the os.scandir() call are ignored.  If
    optional arg 'onerror' is specified, it should be a function; it
    will be called with one argument, an OSError instance.  It can
    report the error to continue with the walk, or raise the exception
    to abort the walk.  Note that the filename is available as the
    filename attribute of the exception object.

    By default, os.walk does not follow symbolic links to subdirectories on
    systems that support them.  In order to get this functionality, set the
    optional argument 'followlinks' to true.

    Caution:  if you pass a relative pathname for top, don't change the
    current working directory between resumptions of walk.  walk never
    changes the current directory, and assumes that the client doesn't
    either.

    Example:

    import os
    from os.path import join, getsize
    for root, dirs, files in os.walk('python/Lib/email'):
        print(root, "consumes", end="")
        print(sum(getsize(join(root, name)) for name in files), end="")
        print("bytes in", len(files), "non-directory files")
        if 'CVS' in dirs:
            dirs.remove('CVS')  # don't visit CVS directories

    NFT)
�fspathrBrT�next�
StopIteration�is_dir�appendr
�
is_symlinkr�islink�join�walk)�top�topdown�onerror�followlinks�dirs�nondirs�	walk_dirs�
scandir_it�error�entryra�	walk_intorcrdre�dirname�new_pathrrrrfs^;"


rf�.��follow_symlinks�dir_fdccs�t|t�rt|d�st|�}|s.t|d|d�}t|t|d�}zB|s^t�	|j
�r|t�|t|��r|t
||t|t�|||�EdHW5t|�XdS)aDirectory tree generator.

        This behaves exactly like walk(), except that it yields a 4-tuple

            dirpath, dirnames, filenames, dirfd

        `dirpath`, `dirnames` and `filenames` are identical to walk() output,
        and `dirfd` is a file descriptor referring to the directory `dirpath`.

        The advantage of fwalk() over walk() is that it's safe against symlink
        races (when follow_symlinks is False).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and top should be relative; top will then be relative to that directory.
          (dir_fd is always supported for fwalk.)

        Caution:
        Since fwalk() yields file descriptors, those are only valid until the
        next iteration step, so you should dup() them if you want to keep them
        for a longer period.

        Example:

        import os
        for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):
            print(root, "consumes", end="")
            print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files),
                  end="")
            print("bytes in", len(files), "non-directory files")
            if 'CVS' in dirs:
                dirs.remove('CVS')  # don't visit CVS directories
        �	__index__Fru�rwN)rR�int�hasattrr^r4r:�O_RDONLY�close�st�S_ISDIR�st_moder�samestat�_fwalkrS)rgrhrirvrw�orig_st�topfdrrr�fwalk�s!��r�ccs�t|�}g}g}|s|rdng}	|D]�}
|
j}|r:t|�}z4|
��rb|�|�|	dk	rl|	�|
�n
|�|�Wq$tk
r�z|
��r�|�|�Wntk
r�YnXYq$Xq$|r�||||fV|	dkr�|nt||	�D]�}zN|�s|r�t||dd�}n"|	dk	�st	�|\}}
|
jdd�}t
|t|d�}
Wn>tk
�rj}z|dk	�rR||�WY�q�W5d}~XYnXz@|�s�t
�|t|
���r�t
�||�}t|
|||||�EdHW5t|
�Xq�|�s�||||fVdS)NF)rwrv)rvry)rBr
rrarbrTrc�zipr4�AssertionErrorr:r|r}rr�rer�)r��toppath�isbytesrhrirvrnrkrl�entriesrpr
r��dirfd�err�dirpathrrrr��s\

�r�cGst||�dS)zpexecl(file, *args)

    Execute the executable file with argument list args, replacing the
    current process. N)�execv��file�argsrrr�execlsr�cGs |d}t||dd�|�dS)z�execle(file, *args, env)

    Execute the executable file with argument list args and
    environment env, replacing the current process. ���N)rC�r�r��envrrr�execlesr�cGst||�dS)z�execlp(file, *args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process. N)�execvpr�rrr�execlp"sr�cGs |d}t||dd�|�dS)z�execlpe(file, *args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the current
    process. r�N)�execvper�rrr�execlpe)sr�cCst||�dS)z�execvp(file, args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process.
    args may be a list or tuple of strings. N��_execvper�rrrr�2sr�cCst|||�dS)z�execvpe(file, args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the
    current process.
    args may be a list or tuple of strings. Nr�r�rrrr�:sr�cCs�|dk	rt}||f}nt}|f}t}t�|�r@||f|��dSd}t|�}tdkrft|�}tt|�}|D]~}t�	||�}z||f|��Wqjt
tfk
r�}	z|	}
W5d}	~	XYqjtk
r�}	z|	}
|dkr�|	}W5d}	~	XYqjXqj|dk	r�|�|
�dS)Nr*)
rCr��environrrrrr
r�mapre�FileNotFoundError�NotADirectoryErrorrT)r�r�r��	exec_func�argrest�	saved_exc�	path_listr"�fullname�e�last_excrrrr�Es6


r�c
Cs�ddl}|dkrt}|����|�dt�z|�d�}Wntk
rPd}YnXtr�z|d}Wnttfk
rzYnX|dk	r�t	d��|}|dk	r�t
|t�r�t|�}W5QRX|dkr�t
}|�t�S)z�Returns the sequence of directories that will be searched for the
    named executable (similar to a shell) when launching a process.

    *env* must be an environment variable dict or None.  If *env* is None,
    os.environ will be used.
    rN�ignore�PATHsPATHz*env cannot contain 'PATH' and b'PATH' keys)�warningsr��catch_warnings�simplefilter�BytesWarning�get�	TypeError�supports_bytes_environ�KeyError�
ValueErrorrRrSrr	rNr)r�r�r��
path_listbrrrres0


�)�MutableMappingc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_EnvironcCs.||_||_||_||_||_||_||_dSr)�	encodekey�	decodekey�encodevalue�decodevalue�putenv�unsetenv�_data)�self�datar�r�r�r�r�r�rrr�__init__�sz_Environ.__init__cCs>z|j|�|�}Wntk
r2t|�d�YnX|�|�Sr)r�r�r�r��r��key�valuerrr�__getitem__�s
z_Environ.__getitem__cCs.|�|�}|�|�}|�||�||j|<dSr)r�r�r�r�r�rrr�__setitem__�s

z_Environ.__setitem__cCsD|�|�}|�|�z|j|=Wntk
r>t|�d�YnXdSr)r�r�r�r�)r�r��
encodedkeyrrr�__delitem__�s

z_Environ.__delitem__ccs$t|j�}|D]}|�|�VqdSr)rr�r�)r��keysr�rrr�__iter__�s
z_Environ.__iter__cCs
t|j�Sr)�lenr��r�rrr�__len__�sz_Environ.__len__cs$d�d��fdd��j��D���S)Nzenviron({{{}}})z, c3s*|]"\}}d���|���|��VqdS)z
{!r}: {!r}N)�formatr�r�)rr�r�r�rr�	<genexpr>�s�z$_Environ.__repr__.<locals>.<genexpr>)r�rer��itemsr�rr�r�__repr__�s

��z_Environ.__repr__cCst|�Sr)�dictr�rrr�copy�sz
_Environ.copycCs||kr|||<||Srrr�rrr�
setdefault�sz_Environ.setdefaultN)�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�rrrrr��s		r�cCsdSrr)r�r�rrr�<lambda>��r�r�cCs
t|d�S)N�)�_putenv�r�rrrr��r�r�cs�tdkrHdd�}|�t}�fdd�}i}t��D]\}}||||�<q0n(t����fdd���fdd	�}�}t}t|||�|tt�S)
Nr*cSs t|t�stdt|�j��|S)N�str expected, not %s)rRr.r��typer��r�rrr�	check_str�s
z!_createenviron.<locals>.check_strcs�|���Sr)�upperr�)�encoderrr��sz!_createenviron.<locals>.encodekeycs(t|t�stdt|�j��|��d�S)Nr��surrogateescape)rRr.r�r�r�r�r���encodingrrr��s
z_createenviron.<locals>.encodecs|��d�S)Nr�)�decoder�r�rrr��sz_createenviron.<locals>.decode)	r
r.r�r��sys�getfilesystemencodingr�r��	_unsetenv)r�r�r�r�r�r�r)r�r�r�_createenviron�s*�r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
    The optional second argument can specify an alternate default.
    key, default and the result are str.)r�r��r��defaultrrr�getenv�sr�)r�r�cCs t|t�stdt|�j��|S)Nzbytes expected, not %s)rRrSr�r�r�r�rrr�_check_bytess
r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
        The optional second argument can specify an alternate default.
        key, default and the result are bytes.)�environbr�r�rrr�getenvbsr�)r�r�cs4t���t�����fdd�}��fdd�}||fS)Ncs&t|�}t|t�r|����S|SdS)aEncode filename (an os.PathLike, bytes, or str) to the filesystem
        encoding with 'surrogateescape' error handler, return bytes unchanged.
        On Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRr.r���filename�r��errorsrrr s
z_fscodec.<locals>.fsencodecs&t|�}t|t�r|����S|SdS)aDecode filename (an os.PathLike, bytes, or str) from the filesystem
        encoding with 'surrogateescape' error handler, return str unchanged. On
        Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRrSr�r�r�rrr,s
z_fscodec.<locals>.fsdecode)r�r��getfilesystemencodeerrors)rrrr�r�_fscodecs
r��fork�spawnvr��P_WAIT�P_NOWAIT�	P_NOWAITOcCs�t|ttf�std��|r"|ds*td��t�}|spz$|dkrJ|||�n||||�Wq�td�Yq�XnR|tkr||St|d�\}}t	|�r�q|q|t
|�r�t|�St|�r�t
|�Std��q|dS)Nzargv must be a tuple or a listrz"argv first element cannot be empty�z"Not stopped, signaled or exited???)rR�tuplerr�r�r�r(r��waitpid�
WIFSTOPPED�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUSrT)rVr�r�r��func�pid�wpid�stsrrr�	_spawnvefIs,
rcCst|||dt�S)aspawnv(mode, file, args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr��rVr�r�rrrr�hscCst||||t�S)a:spawnve(mode, file, args, env) -> integer

Execute file with arguments from args in a subprocess with the
specified environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rrC�rVr�r�r�rrr�spawnveqsr	cCst|||dt�S)a8spawnvp(mode, file, args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr�rrrr�spawnvp}sr
cCst||||t�S)a\spawnvpe(mode, file, args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rr�rrrr�spawnvpe�srcGst|||�S)aspawnl(mode, file, *args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r�rrrr�spawnl�srcGs|d}t|||dd�|�S)a:spawnle(mode, file, *args, env) -> integer

Execute file with arguments from args in a subprocess with the
supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)r	rrrr�spawnle�sr
cGst|||�S)aWspawnlp(mode, file, *args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r
rrrr�spawnlp�srcGs|d}t|||dd�|�S)a]spawnlpe(mode, file, *args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)rrrrr�spawnlpe�sr�rr�cCs�t|t�stdt|���|dkr.td|��|dks>|dkrFtd��ddl}ddl}|dkr�|j|d|j|d�}t	|�
|j�|�S|j|d|j|d	�}t	|�
|j�|�SdS)
Nz&invalid cmd type (%s, expected string))r�wzinvalid mode %rrz+popen() does not support unbuffered streamsrT)�shell�stdout�bufsize)r�stdinr)
rRr.r�r�r��
subprocess�io�Popen�PIPE�_wrap_close�
TextIOWrapperrr)�cmdrV�	bufferingrr�procrrrr�s(
��c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCs||_||_dSr)�_stream�_proc)r��streamrrrrr��sz_wrap_close.__init__cCs8|j��|j��}|dkr dStdkr,|S|d>SdS)Nrr*�)rr}r �waitr
)r��
returncoderrrr}�s

z_wrap_close.closecCs|Srrr�rrr�	__enter__�sz_wrap_close.__enter__cGs|��dSr�r}�r�r�rrr�__exit__�sz_wrap_close.__exit__cCst|j|�Sr)�getattrr)r�r
rrr�__getattr__�sz_wrap_close.__getattr__cCs
t|j�Sr)�iterrr�rrrr��sz_wrap_close.__iter__N)	r�r�r�r�r}r%r(r*r�rrrrr�s	rcOs4t|t�stdt|���ddl}|j|f|�|�S)Nz&invalid fd type (%s, expected integer)r)rRrzr�r�rr:)�fdr��kwargsrrrrr�s
cCs�t|ttf�r|St|�}z|�|�}Wn0tk
rXt|d�rF�ntd|j��YnXt|ttf�rl|Std�	|jt|�j���dS)aaReturn the path representation of a path-like object.

    If str or bytes is passed in, it is returned unchanged. Otherwise the
    os.PathLike interface is used to get the path representation. If the
    path representation is not str or bytes, TypeError is raised. If the
    provided path is not str, bytes, or os.PathLike, TypeError is raised.
    �
__fspath__z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {}N)
rRr.rSr�r.r!r{r�r�r�)r�	path_type�	path_reprrrr�_fspaths"
��r1r^c@s*eZdZdZejdd��Zedd��ZdS)�PathLikezCAbstract base class for implementing the file system path protocol.cCst�dS)z9Return the file system path representation of the object.N)�NotImplementedErrorr�rrrr.,szPathLike.__fspath__cCs|tkrt|d�StS)Nr.)r2r�NotImplemented)�cls�subclassrrr�__subclasshook__1s
zPathLike.__subclasshook__N)	r�r�r��__doc__�abc�abstractmethodr.�classmethodr7rrrrr2(s

r2c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_AddedDllDirectorycCs||_||_||_dSr)r�_cookie�_remove_dll_directory)r�r�cookieZremove_dll_directoryrrrr�:sz_AddedDllDirectory.__init__cCs|�|j�d|_dSr)r>r=rr�rrrr}>sz_AddedDllDirectory.closecCs|Srrr�rrrr%Asz_AddedDllDirectory.__enter__cGs|��dSrr&r'rrrr(Csz_AddedDllDirectory.__exit__cCs|jrd�|j�SdS)Nz<AddedDllDirectory({!r})>z<AddedDllDirectory()>)rr�r�rrrr�Esz_AddedDllDirectory.__repr__N)r�r�r�r�r}r%r(r�rrrrr<9s
r<cCs ddl}|�|�}t|||j�S)aOAdd a path to the DLL search path.

        This search path is used when resolving dependencies for imported
        extension modules (the module itself is resolved through sys.path),
        and also by ctypes.

        Remove the directory by calling close() on the returned object or
        using it in a with statement.
        rN)r*Z_add_dll_directoryr<r>)rr*r?rrr�add_dll_directoryJs

�r@)rKF)TNF)rtTN)N)N)N)N)rr�)hr8r9r�r4r~�_collections_abcr�builtin_module_namesZ_namesr rr$r
rr%r(rb�ImportError�	posixpathrr)�extendr*Zntpath�modulesZos.pathrrrrr	rrrrr+r0�setr,�supports_dir_fd�supports_effective_idsr-�supports_fd�supports_follow_symlinksr
rrrPrZr]rfr:rBr�r�r�r�r�r�r�r�r�rr�r�r�r��	NameErrorr�r�r�r�r�r�r�r�rSr�r�r�rrr�r�r�rr�r	r
rrr
rrrrrr1r^r��ABCr2r<r@rrrr�<module>s��

(











































 

08
		
 
-7





�


	

	


	

selectors.cpython-38.opt-1.pyc000064400000041051151450073350012142 0ustar00U

e5d�H�@s�dZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
dZdZdd	�Z
ed
ddd
dg�Zde_e
jdkr�dej_dej_dej_dej_Gdd�de�ZGdd�ded�ZGdd�de�ZGdd�de�ZGdd�de�Zee	d ��rGd!d"�d"e�Zee	d#��r Gd$d%�d%e�Zee	d&��r<Gd'd(�d(e�Zee	d)��rXGd*d+�d+e�Zd+e�k�rjeZn:d%e�k�r|eZn(d(e�k�r�eZnd"e�k�r�eZneZdS),z|Selectors module.

This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
�)�ABCMeta�abstractmethod)�
namedtuple)�MappingN��c
Csft|t�r|}n<zt|���}Wn*tttfk
rJtd�|��d�YnX|dkrbtd�|���|S)z�Return a file descriptor from a file object.

    Parameters:
    fileobj -- file object or file descriptor

    Returns:
    corresponding file descriptor

    Raises:
    ValueError if the object is invalid
    zInvalid file object: {!r}NrzInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError�	TypeError�
ValueError�format)�fileobj�fd�r�!/usr/lib64/python3.8/selectors.py�_fileobj_to_fds
��r�SelectorKeyrr�events�dataz�SelectorKey(fileobj, fd, events, data)

    Object used to associate a file object to its backing
    file descriptor, selected event mask, and attached data.
)��zFile object registered.zUnderlying file descriptor.z3Events that must be waited for on this file object.zzOptional opaque data associated to this file object.
    For example, this could be used to store a per-client session ID.c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_SelectorMappingz)Mapping of file objects to selector keys.cCs
||_dS�N)�	_selector)�selfZselectorrrr�__init__?sz_SelectorMapping.__init__cCst|jj�Sr)�lenr�
_fd_to_key�rrrr�__len__Bsz_SelectorMapping.__len__cCsDz|j�|�}|jj|WStk
r>td�|��d�YnXdS�N�{!r} is not registered)r�_fileobj_lookupr�KeyErrorr)rrrrrr�__getitem__Es
z_SelectorMapping.__getitem__cCst|jj�Sr)�iterrrr rrr�__iter__Lsz_SelectorMapping.__iter__N)�__name__�
__module__�__qualname__�__doc__rr!r&r(rrrrr<s
rc@sneZdZdZeddd��Zedd��Zddd�Zedd	d
��Zdd�Z	d
d�Z
edd��Zdd�Zdd�Z
dS)�BaseSelectora-Selector abstract base class.

    A selector supports registering file objects to be monitored for specific
    I/O events.

    A file object is a file descriptor or any object with a `fileno()` method.
    An arbitrary object can be attached to the file object, which can be used
    for example to store context information, a callback, etc.

    A selector can use various implementations (select(), poll(), epoll()...)
    depending on the platform. The default `Selector` class uses the most
    efficient implementation on the current platform.
    NcCst�dS)a3Register a file object.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        ValueError if events is invalid
        KeyError if fileobj is already registered
        OSError if fileobj is closed or otherwise is unacceptable to
                the underlying system call (if a system call is made)

        Note:
        OSError may or may not be raised
        N��NotImplementedError�rrrrrrr�register_szBaseSelector.registercCst�dS)ajUnregister a file object.

        Parameters:
        fileobj -- file object or file descriptor

        Returns:
        SelectorKey instance

        Raises:
        KeyError if fileobj is not registered

        Note:
        If fileobj is registered but has since been closed this does
        *not* raise OSError (even if the wrapped syscall does)
        Nr.)rrrrr�
unregistervszBaseSelector.unregistercCs|�|�|�|||�S)ayChange a registered file object monitored events or attached data.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        Anything that unregister() or register() raises
        )r2r1r0rrr�modify�s
zBaseSelector.modifycCst�dS)aqPerform the actual selection, until some monitored file objects are
        ready or a timeout expires.

        Parameters:
        timeout -- if timeout > 0, this specifies the maximum wait time, in
                   seconds
                   if timeout <= 0, the select() call won't block, and will
                   report the currently ready file objects
                   if timeout is None, select() will block until a monitored
                   file object becomes ready

        Returns:
        list of (key, events) for ready file objects
        `events` is a bitwise mask of EVENT_READ|EVENT_WRITE
        Nr.)r�timeoutrrr�select�szBaseSelector.selectcCsdS)zmClose the selector.

        This must be called to make sure that any underlying resource is freed.
        Nrr rrr�close�szBaseSelector.closecCsL|��}|dkrtd��z
||WStk
rFtd�|��d�YnXdS)zzReturn the key associated to a registered file object.

        Returns:
        SelectorKey for this file object
        NzSelector is closedr#)�get_map�RuntimeErrorr%r)rr�mappingrrr�get_key�s
zBaseSelector.get_keycCst�dS)z2Return a mapping of file objects to selector keys.Nr.r rrrr7�szBaseSelector.get_mapcCs|Srrr rrr�	__enter__�szBaseSelector.__enter__cGs|��dSr)r6)r�argsrrr�__exit__�szBaseSelector.__exit__)N)N)N)r)r*r+r,rr1r2r3r5r6r:r7r;r=rrrrr-Ps


r-)�	metaclassc@sTeZdZdZdd�Zdd�Zddd�Zd	d
�Zddd�Zd
d�Z	dd�Z
dd�ZdS)�_BaseSelectorImplzBase selector implementation.cCsi|_t|�|_dSr)rr�_mapr rrrr�sz_BaseSelectorImpl.__init__cCsNz
t|�WStk
rH|j��D]}|j|kr$|jYSq$�YnXdS)alReturn a file descriptor from a file object.

        This wraps _fileobj_to_fd() to do an exhaustive search in case
        the object is invalid but we still have it in our map.  This
        is used by unregister() so we can unregister an object that
        was previously registered even if it is closed.  It is also
        used by _SelectorMapping.
        N)rr
r�valuesrr�rr�keyrrrr$�s	

z!_BaseSelectorImpl._fileobj_lookupNcCsb|r|ttB@r td�|���t||�|�||�}|j|jkrRtd�||j���||j|j<|S)NzInvalid events: {!r}z"{!r} (FD {}) is already registered)	�
EVENT_READ�EVENT_WRITEr
rrr$rrr%�rrrrrCrrrr1�s�z_BaseSelectorImpl.registercCs@z|j�|�|��}Wn$tk
r:td�|��d�YnX|Sr")r�popr$r%rrBrrrr2�s
z_BaseSelectorImpl.unregistercCs�z|j|�|�}Wn$tk
r8td�|��d�YnX||jkr^|�|�|�|||�}n"||jkr�|j|d�}||j|j	<|S)Nr#)r)
rr$r%rrr2r1r�_replacerrFrrrr3�s


z_BaseSelectorImpl.modifycCs|j��d|_dSr)r�clearr@r rrrr6s
z_BaseSelectorImpl.closecCs|jSr)r@r rrrr7sz_BaseSelectorImpl.get_mapcCs(z|j|WStk
r"YdSXdS)z�Return the key associated to a given file descriptor.

        Parameters:
        fd -- file descriptor

        Returns:
        corresponding key, or None if not found
        N)rr%)rrrrr�_key_from_fds	z_BaseSelectorImpl._key_from_fd)N)N)r)r*r+r,rr$r1r2r3r6r7rJrrrrr?�s


r?cs`eZdZdZ�fdd�Zd�fdd�	Z�fdd�Zejd	krHdd
d�Z	ne
j
Z	ddd
�Z
�ZS)�SelectSelectorzSelect-based selector.cst���t�|_t�|_dSr)�superr�set�_readers�_writersr ��	__class__rrr%s
zSelectSelector.__init__Ncs@t��|||�}|t@r&|j�|j�|t@r<|j�|j�|Sr)rLr1rDrN�addrrErOrFrPrrr1*szSelectSelector.registercs,t��|�}|j�|j�|j�|j�|Sr)rLr2rN�discardrrOrBrPrrr22szSelectSelector.unregisterZwin32cCs$t�||||�\}}}|||gfSr)r5)r�r�w�_r4�xrrr�_select9szSelectSelector._selectc	Cs�|dkrdnt|d�}g}z|�|j|jg|�\}}}Wntk
rP|YSXt|�}t|�}||BD]J}d}||kr�|tO}||kr�|tO}|�|�}|rj|�	|||j
@f�qj|S�Nr)�maxrXrNrO�InterruptedErrorrMrDrErJ�appendr)	rr4�readyrTrUrVrrrCrrrr5?s$

zSelectSelector.select)N)N)N)r)r*r+r,rr1r2�sys�platformrXr5�
__classcell__rrrPrrK"s
rKcs^eZdZdZdZdZdZ�fdd�Zd
�fdd�	Z�fdd�Z	d�fd	d
�	Z
ddd�Z�ZS)�_PollLikeSelectorz<Base class shared between poll, epoll and devpoll selectors.Ncst���|��|_dSr)rLr�
_selector_clsrr rPrrr[s
z_PollLikeSelector.__init__cslt��|||�}d}|t@r&||jO}|t@r8||jO}z|j�|j|�Wnt��|��YnX|SrY)	rLr1rD�_EVENT_READrE�_EVENT_WRITErrr2)rrrrrCZ
poller_eventsrPrrr1_s

z_PollLikeSelector.registercs8t��|�}z|j�|j�Wntk
r2YnX|Sr)rLr2rr�OSErrorrBrPrrr2msz_PollLikeSelector.unregistercs�z|j|�|�}Wn$tk
r8t|�d��d�YnXd}||jkr�d}|t@r^||jO}|t@rp||jO}z|j�	|j
|�Wnt��|��YnXd}||j
kr�d}|r�|j||d�}||j|j
<|S)Nz is not registeredFrT)rr)rr$r%rrDrcrErdrr3rrLr2rrH)rrrrrCZchangedZselector_eventsrPrrr3ws.



z_PollLikeSelector.modifycCs�|dkrd}n|dkrd}nt�|d�}g}z|j�|�}Wntk
rV|YSX|D]V\}}d}||j@r||tO}||j@r�|tO}|�	|�}|r\|�
|||j@f�q\|S)Nr�@�@)�math�ceilr�pollr[rcrErdrDrJr\r)rr4r]�
fd_event_listr�eventrrCrrrr5�s(

z_PollLikeSelector.select)N)N)N)
r)r*r+r,rbrcrdrr1r2r3r5r`rrrPrraUs
raric@s"eZdZdZejZejZej	Z
dS)�PollSelectorzPoll-based selector.N)r)r*r+r,r5rirb�POLLINrc�POLLOUTrdrrrrrl�srl�epollcsDeZdZdZejZejZej	Z
dd�Zd	dd�Z�fdd�Z�Z
S)
�
EpollSelectorzEpoll-based selector.cCs
|j��Sr�rr
r rrrr
�szEpollSelector.filenoNc	Cs�|dkrd}n |dkrd}nt�|d�d}tt|j�d�}g}z|j�||�}Wntk
rl|YSX|D]V\}}d}|tj	@r�|t
O}|tj@r�|tO}|�
|�}|rr|�|||j@f�qr|S)N���rrfg����MbP?r)rgrhrZrrrrir[r5�EPOLLINrE�EPOLLOUTrDrJr\r)	rr4�max_evr]rjrrkrrCrrrr5�s*

zEpollSelector.selectcs|j��t���dSr�rr6rLr rPrrr6�s
zEpollSelector.close)N)r)r*r+r,r5rorbrsrcrtrdr
r6r`rrrPrrp�s
 rp�devpollcs:eZdZdZejZejZej	Z
dd�Z�fdd�Z�Z
S)�DevpollSelectorzSolaris /dev/poll selector.cCs
|j��Srrqr rrrr
�szDevpollSelector.filenocs|j��t���dSrrvr rPrrr6�s
zDevpollSelector.close)r)r*r+r,r5rwrbrmrcrnrdr
r6r`rrrPrrx�srx�kqueuecsXeZdZdZ�fdd�Zdd�Zd�fdd�	Z�fd	d
�Zddd�Z�fd
d�Z	�Z
S)�KqueueSelectorzKqueue-based selector.cst���t��|_dSr)rLrr5ryrr rPrrr�s
zKqueueSelector.__init__cCs
|j��Srrqr rrrr
szKqueueSelector.filenoNcs�t��|||�}z`|t@r@t�|jtjtj�}|j�	|gdd�|t
@rnt�|jtjtj�}|j�	|gdd�Wnt��|��YnX|SrY)
rLr1rDr5�keventr�KQ_FILTER_READZ	KQ_EV_ADDr�controlrE�KQ_FILTER_WRITEr2)rrrrrC�kevrPrrr1s ��zKqueueSelector.registercs�t��|�}|jt@rVt�|jtjtj�}z|j	�
|gdd�Wntk
rTYnX|jt@r�t�|jtj
tj�}z|j	�
|gdd�Wntk
r�YnX|SrY)rLr2rrDr5r{rr|ZKQ_EV_DELETErr}rerEr~)rrrCrrPrrr2s$
�
�zKqueueSelector.unregisterc
Cs�|dkrdnt|d�}t|j�}g}z|j�d||�}Wntk
rP|YSX|D]Z}|j}|j}d}|tj	kr||t
O}|tjkr�|tO}|�
|�}	|	rV|�|	||	j@f�qV|SrY)rZrrrr}r[Zident�filterr5r|rDr~rErJr\r)
rr4rur]Zkev_listrr�flagrrCrrrr5)s&




zKqueueSelector.selectcs|j��t���dSrrvr rPrrr6?s
zKqueueSelector.close)N)N)r)r*r+r,rr
r1r2r5r6r`rrrPrrz�s
rz) r,�abcrr�collectionsrZcollections.abcrrgr5r^rDrErr�version_inforrrrrr-r?rKra�hasattrrlrprxrz�globalsZDefaultSelectorrrrr�<module>sL
~T3Z.Mcopy.cpython-38.opt-2.pyc000064400000011103151450073350011105 0ustar00U

e5d�!�@sPddlZddlZddlmZGdd�de�ZeZzddlmZWne	k
rXdZYnXdddgZ
dd�ZiZZ
d	d
�Zed�eeeeeeeeeeeeejee�ee�ejejfD]Z ee
e <q�e!edd�Z e dk	r�ee
e <e"je
e"<e#je
e#<e$je
e$<e%je
e%<edk	�reje
e<[
[ dgfdd�Z&iZ'Z
d
d�Z(e(e
ed�<e(e
ee�<e(e
ee�<e(e
e<e(e
e<e(e
e<e(e
e<e(e
e<e(e
e<e(e
ej)<e(e
e<e(e
ej<e(e
ej<e(e
ej<e(e
e<e&fdd�Z*e*e
e"<e&fdd�Z+e+e
e<e&fdd�Z,e,e
e#<edk	�re,e
e<dd�Z-e-e
ej.<[
dd�Z/ddde&fdd�Z0[[[dS)�N)�dispatch_tablec@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/copy.pyr7sr)�PyStringMap�copy�deepcopycCs�t|�}t�|�}|r||�St|t�r0t|�St|dd�}|dk	rL||�St�|�}|dk	rh||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t|t	�r�|St
|df|��S)N�__copy__�
__reduce_ex__��
__reduce__z%un(shallow)copyable object of type %s)�type�_copy_dispatch�get�
issubclass�_copy_immutable�getattrrr�
isinstance�str�_reconstruct)�x�cls�copier�reductor�rvrrrr
Bs,





cCs|S�Nr)rrrrrksr�CodeTypec	Cs |dkri}t|�}|�||�}||k	r,|St|�}t�|�}|dk	rR|||�}n�t|t�rht||�}n�t|dd�}|dk	r�||�}nzt�|�}|r�||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t	|t
�r�|}nt||f|��}||k	�r|||<t||�|S)N�__deepcopy__r
rrz"un(deep)copyable object of type %s)
�idrr�_deepcopy_dispatchr�_deepcopy_atomicrrrrrr�_keep_alive)	r�memoZ_nil�d�yrrrrrrrr�sD





�


cCs|Srr�rr%rrrr#�sr#cCs2g}||t|�<|j}|D]}||||��q|Sr)r!�append)rr%rr'r)�arrr�_deepcopy_list�sr+csh��fdd�|D�}z�t|�WStk
r6YnXt||�D]\}}||k	rBt|�}qdqB|}|S)Ncsg|]}�|���qSrr)�.0r*�rr%rr�
<listcomp>�sz#_deepcopy_tuple.<locals>.<listcomp>)r!�KeyError�zip�tuple)rr%rr'�k�jrr-r�_deepcopy_tuple�sr4cCs:i}||t|�<|��D]\}}|||�||||�<q|Sr)r!�items)rr%rr'�key�valuerrr�_deepcopy_dict�s
r8cCst|�|jt|j|��Sr)r�__func__r�__self__r(rrr�_deepcopy_method�sr;cCs>z|t|��|�Wn"tk
r8|g|t|�<YnXdSr)r!r)r/r(rrrr$�s
r$csb�dk	}|r$|r$��fdd�|D�}||�}	|r<|	�t|�<|dk	r�|rR�|��}t|	d�rh|	�|�n^t|t�r�t|�dkr�|\}}
nd}
|dk	r�|	j�|�|
dk	r�|
��D]\}}t	|	||�q�|dk	�r|r�|D]}
�|
��}
|	�
|
�q�n|D]}
|	�
|
�q�|dk	�r^|�rF|D]&\}}�|��}�|��}||	|<�qn|D]\}}||	|<�qJ|	S)Nc3s|]}�|��VqdSrr)r,�argr-rr�	<genexpr>sz_reconstruct.<locals>.<genexpr>�__setstate__�)r!�hasattrr>rr1�len�__dict__�updater5�setattrr))rr%�func�args�stateZlistiterZdictiterrZdeepr'Z	slotstater6r7�itemrr-rrsF







r)1�types�weakref�copyregr�	Exceptionr�errorZorg.python.corer	�ImportError�__all__r
rr&rr�int�float�bool�complexrr1�bytes�	frozenset�range�slice�property�BuiltinFunctionType�Ellipsis�NotImplemented�FunctionType�ref�tr�list�dict�set�	bytearrayrr"r#rr+r4r8r;�
MethodTyper$rrrrr�<module>3s�

'�






4





�
-_bootlocale.cpython-38.pyc000064400000002335151450073350011464 0ustar00U

e5d	�@szdZddlZddlZej�d�r,ddd�ZnJz
ejWn4ek
rjeed�r\ddd�Zn
d
d	d�ZYnXdd
d�ZdS)z�A minimal subset of the locale module used at interpreter startup
(imported by the _io module), in order to reduce startup time.

Don't import directly from third-party code; use the `locale` module instead!
�N�winTcCstjjrdSt��dS)N�UTF-8�)�sys�flags�	utf8_mode�_localeZ_getdefaultlocale��do_setlocale�r�#/usr/lib64/python3.8/_bootlocale.py�getpreferredencodingsr
ZgetandroidapilevelcCsdS)Nrrr	rrrr
scCstjjrdSddl}|�|�S)Nrr)rrr�localer
)r
rrrrr
scCs6|rt�tjjrdSt�tj�}|s2tjdkr2d}|S)Nr�darwin)�AssertionErrorrrrr�nl_langinfo�CODESET�platform)r
�resultrrrr
!s)T)T)T)T)	�__doc__rrr�
startswithr
r�AttributeError�hasattrrrrr�<module>s

ast.cpython-38.opt-1.pyc000064400000040532151450073350010731 0ustar00U

e5d"K�@s�dZddlTd=ddd�dd	�Zd
d�Zd>d
d�Zdd�Zdd�Zd?dd�Zdd�Zdd�Z	d@dd�Z
dd�Zdd�Zdd �d!d"�Z
d#d$�ZGd%d&�d&e�ZGd'd(�d(e�Zd)d*�Zd+d,�Zeee�e_eee�e_Gd-d.�d.e�Zd/d0�ZGd1d2�d2eed3�ZGd4d5�d5eed3�ZGd6d7�d7eed3�ZGd8d9�d9eed3�ZGd:d;�d;eed3�Zee e!e"fee#fee$feed�e%feed<�fiZ&ee%fiZ'e%d9ed�d9e d2e!d2e"d2e#d5e$d7ed<�d;iZ(dS)AaH
    ast
    ~~~

    The `ast` module helps Python applications to process trees of the Python
    abstract syntax grammar.  The abstract syntax itself might change with
    each Python release; this module helps to find out programmatically what
    the current grammar looks like and allows modifications of it.

    An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as
    a flag to the `compile()` builtin function or by using the `parse()`
    function from this module.  The result will be a tree of objects whose
    classes all inherit from `ast.AST`.

    A modified abstract syntax tree can be compiled into a Python code object
    using the built-in `compile()` function.

    Additionally various helper functions are provided that make working with
    the trees simpler.  The main intention of the helper functions and this
    module in general is to provide an easy to use interface for libraries
    that work tightly with the python syntax (template engines for example).


    :copyright: Copyright 2008 by Armin Ronacher.
    :license: Python License.
�)�*�	<unknown>�execFN)�
type_comments�feature_versioncCsFt}|r|tO}t|t�r(|\}}|}n|dkr4d}t|||||d�S)z�
    Parse the source into an AST node.
    Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
    Pass type_comments=True to get back type comments where the syntax allows.
    N���)�_feature_version)Z
PyCF_ONLY_ASTZPyCF_TYPE_COMMENTS�
isinstance�tuple�compile)�source�filename�moderr�flags�major�minor�r�/usr/lib64/python3.8/ast.py�parses

�rcs`t|t�rt|dd�}t|t�r&|j}dd���fdd���fdd������fd	d
���|�S)a
    Safely evaluate an expression node or a string containing a Python
    expression.  The string or node provided may only consist of the following
    Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
    sets, booleans, and None.
    �eval)rcSstd|����dS)Nzmalformed node or string: )�
ValueError��noderrr�_raise_malformed_node>sz+literal_eval.<locals>._raise_malformed_nodecs,t|t�rt|j�tttfkr&�|�|jS�N)r	�Constant�type�value�int�float�complexr)rrr�_convert_num@sz"literal_eval.<locals>._convert_numcsDt|t�r<t|jttf�r<�|j�}t|jt�r6|
S|S�|�Sr)r	ZUnaryOp�opZUAddZUSub�operand)rr#)r!rr�_convert_signed_numDs
z)literal_eval.<locals>._convert_signed_numcst|t�r|jSt|t�r*tt�|j��St|t�rDtt�|j��St|t	�r^t
t�|j��St|t�r�t|j
�t|j�kr��|�ttt�|j
�t�|j���St|t��rt|jttf��r�|j�}�|j�}t|ttf��rt|t��rt|jt��r||S||S�|�Sr)r	rrZTupler
�mapZeltsZList�list�Set�setZDict�len�keys�values�dict�zipZBinOpr"ZAddZSub�left�rightrrr )rr.r/��_convertr!r$rrrr1Ls,





�

zliteral_eval.<locals>._convert)r	�strrZ
Expression�body)Znode_or_stringrr0r�literal_eval3s

r4Tcs2���fdd��t|t�s*td|jj���|�S)a�
    Return a formatted dump of the tree in node.  This is mainly useful for
    debugging purposes.  If annotate_fields is true (by default),
    the returned string will show the names and the values for fields.
    If annotate_fields is false, the result string will be more compact by
    omitting unambiguous field names.  Attributes such as line
    numbers and column offsets are not dumped by default.  If this is wanted,
    include_attributes can be set to true.
    c	st|t�r�g}�}|jD]V}zt||�}Wntk
rBd}YqX|r`|�d|�|�f�q|��|��q�r�|jr�|jD]:}z |�d|�t||��f�Wq�tk
r�Yq�Xq�d|jjd�	|�fSt|t
�r�dd�	�fdd�|D��St|�S)NTz%s=%sz%s(%s)z, z[%s]c3s|]}�|�VqdSrr)�.0�x)�_formatrr�	<genexpr>�sz(dump.<locals>._format.<locals>.<genexpr>)r	�AST�_fields�getattr�AttributeError�append�_attributes�	__class__�__name__�joinr&�repr)r�args�keywords�fieldr�a�r7�annotate_fields�include_attributesrrr7ps*




 
zdump.<locals>._formatzexpected AST, got %r)r	r9�	TypeErrorr?r@)rrHrIrrGr�dumpfs

rKcCsVdD]L}||jkr||jkrt||d�}|dk	sDt||�r|�d�rt|||�q|S)z�
    Copy source location (`lineno`, `col_offset`, `end_lineno`, and `end_col_offset`
    attributes) from *old_node* to *new_node* if possible, and return *new_node*.
    )�lineno�
col_offset�
end_lineno�end_col_offsetNZend_)r>r;�hasattr�
startswith�setattr)�new_nodeZold_node�attrrrrr�
copy_location�s��rUcs �fdd���|dddd�|S)a{
    When you compile a node tree with compile(), the compiler expects lineno and
    col_offset attributes for every node that supports them.  This is rather
    tedious to fill in for generated nodes, so this helper adds these attributes
    recursively where not already set, by setting them to the values of the
    parent node.  It works recursively starting at *node*.
    cs�d|jkr"t|d�s||_n|j}d|jkrDt|d�s>||_n|j}d|jkrft|d�s`||_n|j}d|jkr�t|d�s�||_n|j}t|�D]}�|||||�q�dS)NrLrNrMrO)r>rPrLrNrMrO�iter_child_nodes)rrLrMrNrO�child��_fixrrrY�s$







z#fix_missing_locations.<locals>._fix�rrrrrXr�fix_missing_locations�sr[rZcCsVt|�D]H}d|jkr(t|dd�||_d|jkrt|dd�}dk	r|||_q|S)z�
    Increment the line number and end line number of each node in the tree
    starting at *node* by *n*. This is useful to "move code" to a different
    location in a file.
    rLrrNN)�walkr>r;rLrN)r�nrWrNrrr�increment_lineno�s
��r^c	cs:|jD].}z|t||�fVWqtk
r2YqXqdS)zs
    Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
    that is present on *node*.
    N)r:r;r<)rrErrr�iter_fields�s

r_ccsLt|�D]>\}}t|t�r"|Vqt|t�r|D]}t|t�r0|Vq0qdS)z�
    Yield all direct child nodes of *node*, that is, all fields that are nodes
    and all items of fields that are lists of nodes.
    N)r_r	r9r&)r�namerE�itemrrrrV�s


rVcCs�t|ttttf�s"td|jj��|jr8t|jdt	�s<dS|jdj
}t|t�rZ|j}n"t|t
�rxt|j
t�rx|j
}ndS|r�ddl}|�|�}|S)aC
    Return the docstring for the given node or None if no docstring can
    be found.  If the node provided does not have docstrings a TypeError
    will be raised.

    If *clean* is `True`, all tabs are expanded to spaces and any whitespace
    that can be uniformly removed from the second line onwards is removed.
    z%r can't have docstringsrN)r	ZAsyncFunctionDefZFunctionDefZClassDefZModulerJr?r@r3ZExprr�Str�srr2�inspectZcleandoc)rZclean�textrdrrr�
get_docstring�s	

rfcCs�d}g}d}|t|�krx||}||7}|d7}|dkr`|t|�kr`||dkr`|d7}|d7}|dkr|�|�d}q|r�|�|�|S)z}Split a string into lines ignoring form feed and other chars.

    This mimics how the Python parser splits source code.
    r�rZ�
�
z
)r)r=)r�idx�linesZ	next_line�crrr�_splitlines_no_ffs  

rmcCs,d}|D]}|dkr||7}q|d7}q|S)z6Replace all chars except '\f\t' in a line with spaces.rgz	� r)r�resultrlrrr�_pad_whitespaces

rp)�paddedcCs�z$|jd}|jd}|j}|j}Wntk
r:YdSXt|�}||krd||��||���S|r�t||��d|����}nd}|||��|d���}	||��d|���}
||d|�}|�	d|	�|�
|
�d�|�S)aBGet source code segment of the *source* that generated *node*.

    If some location information (`lineno`, `end_lineno`, `col_offset`,
    or `end_col_offset`) is missing, return None.

    If *padded* is `True`, the first line of a multi-line statement will
    be padded with spaces to match its original position.
    rZNrgr)rLrNrMrOr<rm�encode�decoderp�insertr=rA)rrrqrLrNrMrOrkZpadding�firstZlastrrr�get_source_segment*s&	



rvccs<ddlm}||g�}|r8|��}|�t|��|VqdS)z�
    Recursively yield all descendant nodes in the tree starting at *node*
    (including *node* itself), in no specified order.  This is useful if you
    only want to modify nodes in place and don't care about the context.
    r)�dequeN)�collectionsrw�popleft�extendrV)rrwZtodorrrr\Ms
r\c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�NodeVisitora<
    A node visitor base class that walks the abstract syntax tree and calls a
    visitor function for every node found.  This function may return a value
    which is forwarded by the `visit` method.

    This class is meant to be subclassed, with the subclass adding visitor
    methods.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `visit` method.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.

    Don't use the `NodeVisitor` if you want to apply changes to nodes during
    traversing.  For this a special visitor exists (`NodeTransformer`) that
    allows modifications.
    cCs"d|jj}t|||j�}||�S)z
Visit a node.�visit_)r?r@r;�
generic_visit)�selfr�method�visitorrrr�visitoszNodeVisitor.visitcCsTt|�D]F\}}t|t�r:|D]}t|t�r|�|�qqt|t�r|�|�qdS)z9Called if no explicit visitor function exists for a node.N)r_r	r&r9r�)r~rrErrarrrr}us


zNodeVisitor.generic_visitc	Cs�|j}t�t|��}|dkr@t��D]\}}t||�r$|}q@q$|dk	r�d|}zt||�}Wntk
rrYn&Xddl}|�	|�d�t
d�||�S|�|�S)Nr|rz" is deprecated; add visit_Constant�)r�_const_node_type_names�getr�itemsr	r;r<�warnings�warn�PendingDeprecationWarningr})	r~rrZ	type_name�clsr`rr�r�rrr�visit_Constants(
�zNodeVisitor.visit_ConstantN)r@�
__module__�__qualname__�__doc__r�r}r�rrrrr{[s
r{c@seZdZdZdd�ZdS)�NodeTransformeraG
    A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
    allows modification of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor methods to replace or remove the old node.  If the return value of
    the visitor method is ``None``, the node will be removed from its location,
    otherwise it is replaced with the return value.  The return value may be the
    original node in which case no replacement takes place.

    Here is an example transformer that rewrites all occurrences of name lookups
    (``foo``) to ``data['foo']``::

       class RewriteName(NodeTransformer):

           def visit_Name(self, node):
               return Subscript(
                   value=Name(id='data', ctx=Load()),
                   slice=Index(value=Str(s=node.id)),
                   ctx=node.ctx
               )

    Keep in mind that if the node you're operating on has child nodes you must
    either transform the child nodes yourself or call the :meth:`generic_visit`
    method for the node first.

    For nodes that were part of a collection of statements (that applies to all
    statement nodes), the visitor may also return a list of nodes rather than
    just a single node.

    Usually you use the transformer like this::

       node = YourTransformer().visit(node)
    cCs�t|�D]�\}}t|t�rvg}|D]D}t|t�r\|�|�}|dkrFq"nt|t�s\|�|�q"|�|�q"||dd�<qt|t�r|�|�}|dkr�t||�qt|||�q|Sr)	r_r	r&r9r�rzr=�delattrrR)r~rrE�	old_valueZ
new_valuesrrSrrrr}�s&






zNodeTransformer.generic_visitN)r@r�r�r�r}rrrrr��s#r�cCs|jSr�r)r~rrr�_getter�sr�cCs
||_dSrr�)r~rrrr�_setter�sr�c@seZdZdd�ZdS)�_ABCcCsft|t�sdS|tkrZz
|j}Wntk
r6YdSXt|t|�oXt|t�|d��St�||�S)NFr)	r	r�_const_typesrr<�_const_types_notr�r�__instancecheck__)r��instrrrrr��s

�z_ABC.__instancecheck__N)r@r�r�r�rrrrr��sr�cOsf|D]<}||jkrq|j�|�}|t|�krt|j�d|����q|tkrTt||�Stj|f|�|�S)Nz" got multiple values for argument )r:�indexr)rJr@r�r�__new__)r�rC�kwargs�key�posrrr�_new�s

r�c@seZdZdZeZdS)�Num)r]N�r@r�r�r:r�r�rrrrr��sr�)�	metaclassc@seZdZdZeZdS)rb�rcNr�rrrrrb�srbc@seZdZdZeZdS)�Bytesr�Nr�rrrrr�sr�c@seZdZeZdS)�NameConstantN)r@r�r�r�r�rrrrr�sr�c@seZdZdZdd�ZdS)�EllipsisrcOs(|tkrtd|�|�Stj|f|�|�S)N.).)r�rr�)r�rCr�rrrr�szEllipsis.__new__N)r@r�r�r:r�rrrrr�sr�.)rr)TF)rZ)T))r��_astrr4rKrUr[r^r_rVrfrmrprvr\�objectr{r�r�r��propertyrr]rcrr�r�r�rbr�r�r�rrr r2�bytes�boolr�r�r�rrrr�<module>sz�3
'#

#:>	
���functools.cpython-38.opt-2.pyc000064400000051402151450073350012155 0ustar00U

e5d��
@s�dddddddddd	d
ddg
Zd
dlmZd
dlmZd
dlmZd
dlmZdZ	dZ
e	e
fdd�Ze	e
fdd�Ze
fdd�Ze
fdd�Ze
fdd�Ze
fdd�Ze
fdd�Ze
fd d!�Ze
fd"d#�Ze
fd$d%�Ze
fd&d'�Ze
fd(d)�Ze
fd*d+�Ze
fd,d-�Zd.efd/efd0efgd0efd1efd.efgd1efd0efd/efgd/efd.efd1efgd2�Zd3d�Zd4d�Zzd
d5lmZWnek
�r�YnXe�Z e fd6d�Z!zd
d7lm!Z!Wnek
�r�YnXGd8d�d�Z"zd
d9lm"Z"Wnek
�r�YnXGd:d	�d	e�Z#d;d<�Z$ed=d>d?d@dAg�Z%GdBdC�dCe&�Z'e�fe(e)he*e+e,fdDdE�Z-dXdHd�Z.dIdJ�Z/zd
dKlm/Z/Wnek
�r�YnXdLdM�Z0dYdOdP�Z1dQdR�Z2dSdT�Z3dUd
�Z4GdVd�d�Z5e�Z6GdWd�d�Z7dNS)Z�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�singledispatchmethod�cached_property�)�get_cache_token)�
namedtuple)�recursive_repr)�RLock)�
__module__�__name__�__qualname__�__doc__�__annotations__)�__dict__c	Csf|D]4}zt||�}Wntk
r*YqXt|||�q|D]}t||��t||i��q>||_|S�N)�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r%�!/usr/lib64/python3.8/functools.pyr"scCstt|||d�S)N�r r!r")r	rr'r%r%r&r@s�cCs$|�|�}||kr|S|o"||kSr��__lt__��self�other�NotImplemented�	op_resultr%r%r&�_gt_from_ltXs
r/cCs|�|�}|p||kSrr(r*r%r%r&�_le_from_lt_s
r0cCs|�|�}||kr|S|Srr(r*r%r%r&�_ge_from_ltds
r1cCs$|�|�}||kr|S|p"||kSr��__le__r*r%r%r&�_ge_from_leks
r4cCs"|�|�}||kr|S|o ||kSrr2r*r%r%r&�_lt_from_lers
r5cCs|�|�}||kr|S|Srr2r*r%r%r&�_gt_from_leys
r6cCs$|�|�}||kr|S|o"||kSr��__gt__r*r%r%r&�_lt_from_gt�s
r9cCs|�|�}|p||kSrr7r*r%r%r&�_ge_from_gt�s
r:cCs|�|�}||kr|S|Srr7r*r%r%r&�_le_from_gt�s
r;cCs$|�|�}||kr|S|p"||kSr��__ge__r*r%r%r&�_le_from_ge�s
r>cCs"|�|�}||kr|S|o ||kSrr<r*r%r%r&�_gt_from_ge�s
r?cCs|�|�}||kr|S|Srr<r*r%r%r&�_lt_from_ge�s
r@r8r3r=r))r)r3r8r=csV�fdd�tD�}|std��t|�}t|D]"\}}||kr.||_t�||�q.�S)Ncs(h|] }t�|d�tt|d�k	r|�qSr)r�object)�.0�op��clsr%r&�	<setcomp>�sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)rE�roots�root�opname�opfuncr%rDr&r�scsG�fdd�dt�}|S)NcsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dSr�rN)r+rNr%r%r&�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS�NrrO�r+r,��mycmpr%r&r)�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkSrQrOrRrSr%r&r8�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkSrQrOrRrSr%r&�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkSrQrOrRrSr%r&r3�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkSrQrOrRrSr%r&r=�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rPr)r8rUr3r=�__hash__r%rSr%r&�K�srX)rA)rTrXr%rSr&r�s)rcCsZt|�}|tkr>zt|�}WqBtk
r:td�d�YqBXn|}|D]}|||�}qF|S)Nz0reduce() of empty sequence with no initial value)�iter�_initial_missing�next�
StopIteration�	TypeError)ZfunctionZsequence�initial�itr$Zelementr%r%r&r�s)rcsFeZdZdZ�fdd�Zdd�Ze�dd��Zdd	�Zd
d�Z	�Z
S)r	)�func�args�keywordsr�__weakref__csZt|�std��t|d�r4|j|}|j|�}|j}tt|��|�}||_||_||_|S)Nz#the first argument must be callabler`)	�callabler]�hasattrrarbr`�superr	�__new__)rEr`rarbr+��	__class__r%r&rgs


zpartial.__new__cOs|j|�}|j|j|�|�Sr�rbr`ra)r+rarbr%r%r&�__call__%s
zpartial.__call__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdSr)�repr)rB�xr%r%r&�	<genexpr>-sz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr%�rB�k�vr%r%r&rn.s�	functoolsz
functools.�(�, �))
�typerrlr`�extendrarb�itemsr�join)r+�qualnamerar%r%r&�__repr__)s
zpartial.__repr__cCs*t|�|jf|j|j|jpd|jp$dffSr)rwr`rarbr�r+r%r%r&�
__reduce__3s�zpartial.__reduce__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dk	r`t|t�rr|dk	rzt|t�sztd��t|�}|dkr�i}nt|�tk	r�t|�}|dkr�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstance�tupler]�lenrd�dictrwrr`rarb)r+�stater`ra�kwds�	namespacer%r%r&�__setstate__7s4
����zpartial.__setstate__)rrrrVrgrkrr|r~r��
__classcell__r%r%rhr&r	s
	)r	c@s@eZdZdd�Zde_dd�Zdd�Zd
d	d
�Zedd��Z	dS)r
cOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��t|�}t|�s�t|d	�s�td
�	|���t
|t�r�|j|_|j
||_
|j|�|_n||_||_
||_dS)N�z8descriptor '__init__' of partialmethod needs an argumentr`rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz8type 'partialmethod' takes at least one argument, got %d��__get__z${!r} is not callable or a descriptor)r�r]�pop�warnings�warn�DeprecationWarningr�rdre�formatr�r
r`rarb)rarbr+r`r�r%r%r&rP]s6

�
��
zpartialmethod.__init__z#($self, func, /, *args, **keywords)cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nrucss|]\}}d�||�VqdS)z{}={!r}N)r�rpr%r%r&rn�s�z)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�modulerEr`rarb)rz�maprlrarbryr�rirrr`)r+rarb�
format_stringr%r%r&r|�s
�
�zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs �j|�}�j|f�j|�|�Srrj)�cls_or_selfrarbr}r%r&�_method�s
z3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r+r�r%r}r&�_make_unbound_method�sz"partialmethod._make_unbound_methodNcCs�t|jdd�}d}|dk	rd|||�}||jk	rdt|f|j�|j�}z|j|_Wntk
rbYnX|dkr||���||�}|S)Nr�)	rr`r	rarb�__self__rr�r�)r+rNrE�get�result�new_funcr%r%r&r��s

zpartialmethod.__get__cCst|jdd�S�Nr�F�rr`r}r%r%r&r��sz"partialmethod.__isabstractmethod__)N)
rrrrP�__text_signature__r|r�r��propertyr�r%r%r%r&r
Us"
cCst|t�r|j}q|Sr)r�r	r`�r`r%r%r&�_unwrap_partial�s
r��	CacheInfo�hits�misses�maxsize�currsizec@s$eZdZdZefdd�Zdd�ZdS)�
_HashedSeq�	hashvaluecCs||dd�<||�|_dSr�r�)r+�tup�hashr%r%r&rP�sz_HashedSeq.__init__cCs|jSrr�r}r%r%r&rW�sz_HashedSeq.__hash__N)rrrrVr�rPrWr%r%r%r&r��sr�c
s�|}|r&||7}|��D]}	||	7}q|rh||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|kr�|dSt|�S)Nc3s|]}�|�VqdSrr%�rBrr�rwr%r&rn�sz_make_key.<locals>.<genexpr>c3s|]}�|�VqdSrr%r�r�r%r&rn�sr�r)ry�valuesr�)
rar��typed�kwd_mark�	fasttypesr�rwr��key�itemr%r�r&�	_make_key�s
 r��Fcsnt�t�r�dkr\d�nDt��rLt�t�rL�d}�t|��t�}t||�S�dk	r\td����fdd�}|S)Nrr�z=Expected first argument to be an integer, a callable, or Nonecst|��t�}t||�Sr)�_lru_cache_wrapper�
_CacheInfor)�
user_functionr�r�r�r%r&�decorating_function
sz&lru_cache.<locals>.decorating_function)r��intrd�boolr�r�rr])r�r�r�rr�r%r�r&r�s


�cs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dkr����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rr�r��rFcs�d7��||�}|S�Nr�r%)rar�r�)r�r�r%r&r$s
z#_lru_cache_wrapper.<locals>.wrappercsH�||��}�|��}|�k	r*�d7�|S�d7��||�}|�|<|Sr�r%)rar�r�r�)�cache�	cache_getr��make_keyr��sentinelr�r�r%r&r-s

c
s>�
||��}�	�z�|�}|dk	r~|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|W5QR�S�d7�W5QRX�||�}�	��|�kr�n��r��
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�W5QRX|Sr�r%)rar�r��linkZ	link_prevZ	link_nextZ_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTr�r��	cache_len�fullr��lockr�r�r�rKr�r�r%r&r<sB

c
s,���������W5QR�SQRXdSrr%r%)r�r�r�r�r�r�r%r&�
cache_infousz&_lru_cache_wrapper.<locals>.cache_infoc	s<��.�����ddg�dd�<d��d�W5QRXdS)NrF)�clearr%)r�r�r�r�r�rKr%r&�cache_clearzs
z'_lru_cache_wrapper.<locals>.cache_clear)rAr�r��__len__rr�r�)r�r�r�r�rr�r�r%)r�r�r�r�r�r�r�r�r�r�r�r�r�r�rKr�r�r�r&r�s**9	r�)r�cCs�g}dd�|D�}|s|S|D]2}|d}|D]}||dd�kr.d}qq.qRq|dkrbtd��|�|�|D]}|d|krp|d=qpqdS)NcSsg|]}|r|�qSr%r%�rB�sr%r%r&�
<listcomp>�sz_c3_merge.<locals>.<listcomp>rr�zInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr%r%r&�	_c3_merge�s"
r�Nc
stt|j��D]$\}�t�d�rt|j�|}q8qd}�rDt��ng�t|jd|��}g}t|j|d��}�D]0�t|��rtt�fdd�|jD��st|���qt|D]���	��q��fdd�|D�}�fdd�|D�}�fdd�|D�}	t
|gg|||	|g|g|g�S)	N�__abstractmethods__rc3s|]}t|��VqdSr)�
issubclass)rB�b)�baser%r&rn�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS���abcs��_c3_mro�rBr�r�r%r&r��sz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qSr�r�r�r�r%r&r��scsg|]}t|�d��qSr�r�r�r�r%r&r��s)�	enumerate�reversed�	__bases__rer��listr��anyr��remover�)
rEr��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr%)r�r�r&r��sD
��������r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}�D]�}g}|��D]0}|�krht�|�rh|��fdd�|jD��qh|s�|�|�qX|jtd	d
�|D] }|D]}||kr�|�|�q�q�qXt�|d�S)Ncs|�kot|d�ot�|�S)N�__mro__)rer�)�typ)�basesrEr%r&�
is_related�s�z _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr%r%�rB�n)r�r%r&r��sz _compose_mro.<locals>.<listcomp>cs&�D]}||kr||jkrdSqdS)NTF)r�)r�r,)�typesr%r&�is_strict_base�sz$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr%r%r�)r�r%r&r��scsg|]}|�kr|�qSr%r%r�)�type_setr%r&r��sT)r��reverser�)�setr��__subclasses__r�r��sortr�r�)rEr��mror��found�sub�subclsr%)r�rEr�r�r�r�r&�_compose_mro�s*

rcCstt||���}d}|D]R}|dk	r\||krX||jkrX||jkrXt||�sXtd�||���qj||kr|}q|�|�S)NzAmbiguous dispatch: {} or {})r�keysr�r�r�r�r�)rE�registryr�match�tr%r%r&�
_find_impls"
���r
cs�ddl}ddl}i�|���d����fdd��d
����fdd�	���fdd�}t|dd	��|�t<�|_�|_|���|_�j	|_
t||�|S)Nrcs|�dk	r"t�}�|kr"���|�z�|}WnHtk
rvz�|}Wntk
rht|��}YnX|�|<YnX|Sr)rr��KeyErrorr
)rE�
current_token�impl)�cache_token�dispatch_cacherr%r&�dispatch.sz singledispatch.<locals>.dispatchcs�|dkr�t�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�t�t�s�td|�d	��d
���|��<�dkr�t	�d�r�t
�����|S)Ncs
��|�Srr%)�f)rE�registerr%r&�<lambda>N�z2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)�get_type_hintszInvalid annotation for z. z is not a class.r�)r�rwrr]�typingrr[rYryrerr�)rEr`�annr�argname)rrrrrDr&rEs(

�
�z singledispatch.<locals>.registercs&|st��d����|dj�||�S)Nz( requires at least 1 positional argumentr)r]ri)ra�kw)r�funcnamer%r&rfszsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrrArr�MappingProxyTyperr��_clear_cacher)r`r�rrr%)rrrrrrr&rs!
c@s4eZdZdd�Zd
dd�Zddd�Zedd	��ZdS)rcCs4t|�s t|d�s t|�d���t|�|_||_dS)Nr�z  is not callable or a descriptor)rdrer]r�
dispatcherr`�r+r`r%r%r&rPs
zsingledispatchmethod.__init__NcCs|jj||d�S)Nr�)rr)r+rE�methodr%r%r&r�szsingledispatchmethod.registercs0���fdd�}�j|_�j|_t|�j�|S)Ncs$�j�|dj�}|����||�SrQ)rrrir�)ra�kwargsr!�rErNr+r%r&r��sz-singledispatchmethod.__get__.<locals>._method)r�rrr`)r+rNrEr�r%r#r&r��s
zsingledispatchmethod.__get__cCst|jdd�Sr�r�r}r%r%r&r��sz)singledispatchmethod.__isabstractmethod__)N)N)rrrrPrr�r�r�r%r%r%r&rxs



c@s&eZdZdd�Zdd�Zddd�ZdS)	r
cCs ||_d|_|j|_t�|_dSr)r`�attrnamerrr�r r%r%r&rP�szcached_property.__init__cCs8|jdkr||_n"||jkr4td|j�d|�d���dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r$r])r+�owner�namer%r%r&�__set_name__�s

�zcached_property.__set_name__Nc	Cs�|dkr|S|jdkrtd��z
|j}Wn8tk
r`dt|�j�d|j�d�}t|�d�YnX|�|jt�}|tkr�|j�n|�|jt�}|tkr�|�	|�}z|||j<Wn8tk
r�dt|�j�d|j�d�}t|�d�YnXW5QRX|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z
 property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching )
r$r]rrrwrr��
_NOT_FOUNDr�r`)r+�instancer%r��msg�valr%r%r&r��s2
�
�
�zcached_property.__get__)N)rrrrPr'r�r%r%r%r&r
�s	)r�F)N)8�__all__�abcr�collectionsr�reprlibr�_threadrrrrrr-r/r0r1r4r5r6r9r:r;r>r?r@rGrr�
_functools�ImportErrorrArZrr	r
r�r�r�r�r��strr�rwr�r�rr�r�r�rr
rrr(r
r%r%r%r&�<module>s��
�
�
�����AX	�

,t
-)\(gzip.cpython-38.opt-1.pyc000064400000043412151450073350011113 0ustar00U

e5d�S�@sdZddlZddlZddlZddlZddlZddlZddlZddlZdddddgZ	d\Z
ZZZ
Zd	\ZZd
ZdZdZd
edddfdd�Zdd�ZGdd�d�ZGdd�de�ZGdd�dej�ZGdd�dej�Zefdd�dd�Zdd�Zdd�Ze dk�re�dS)z�Functions that read and write gzipped files.

The user of the file doesn't have to worry about the compression,
but random access is not allowed.�N�BadGzipFile�GzipFile�open�compress�
decompress)�����)rrr��	�rbcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|tttjf�r|t|||�}n,t|d	�s�t|d
�r�td|||�}nt	d��d|kr�t
�||||�S|SdS)aOpen a gzip-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str or bytes object), or
    an existing file object to read from or write to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
    binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
    "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the GzipFile constructor:
    GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
    and newline arguments must not be provided.

    For text mode, a GzipFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error handling
    behavior, and line ending(s).

    �t�bzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newlineZgz_modeZbinary_file�r%�/usr/lib64/python3.8/gzip.pyrs$cCs|�t�d|��dS)Nz<L)r�structZpack)�output�valuer%r%r&�write32uEsr*c@s<eZdZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
S)�_PaddedFilez�Minimal read-only file object that prepends a string to the contents
    of an actual file. Shouldn't be used outside of gzip.py, as it lacks
    essential functionality.�cCs ||_t|�|_||_d|_dS�Nr)�_buffer�len�_length�file�_read)�self�f�prependr%r%r&�__init__Os
z_PaddedFile.__init__cCs~|jdkr|j�|�S|j||jkrJ|j}|j|7_|j||j�S|j}d|_|j|d�|j�||j|�SdS�N)r2r1rr0r.)r3�sizerr%r%r&rUs
�z_PaddedFile.readcCs>|jdkr||_n|jt|�8_dSt|j�|_d|_dSr-)r2r.r/r0)r3r5r%r%r&r5bs
z_PaddedFile.prependcCsd|_d|_|j�|�Sr7)r2r.r1�seek)r3Zoffr%r%r&r9ksz_PaddedFile.seekcCsdS�NTr%�r3r%r%r&�seekablepsz_PaddedFile.seekableN)r,)r,)	�__name__�
__module__�__qualname__�__doc__r6rr5r9r<r%r%r%r&r+Js

	r+c@seZdZdZdS)rz6Exception raised in some cases for invalid gzip files.N)r=r>r?r@r%r%r%r&rtsc@s�eZdZdZdZddeddfdd�Zedd��Zedd��Z	d	d
�Z
dd�Zd
d�Zdd�Z
d,dd�Zd-dd�Zdd�Zedd��Zdd�Zejfdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zejfd(d)�Zd.d*d+�ZdS)/ra
The GzipFile class simulates most of the methods of a file object with
    the exception of the truncate() method.

    This class only supports opening files in binary mode. If you need to open a
    compressed file in text mode, use the gzip.open() function.

    NcCs4|r"d|ksd|kr"td�|���|r6d|kr6|d7}|dkrTt�||pJd�}|_|dkr|t|dd�}t|ttf�s�d}n
t	�
|�}|dkr�t|d	d�}|�d
�r�t|_
t|�}t�|�|_||_nN|�d��rt|_
|�|�t�|tjtjtjd�|_||_ntd�|���||_|j
tk�r0|�|�dS)
aGConstructor for the GzipFile class.

        At least one of fileobj and filename must be given a
        non-trivial value.

        The new class instance is based on fileobj, which can be a regular
        file, an io.BytesIO object, or any other object which simulates a file.
        It defaults to None, in which case filename is opened to provide
        a file object.

        When fileobj is not None, the filename argument is only used to be
        included in the gzip file header, which may include the original
        filename of the uncompressed file.  It defaults to the filename of
        fileobj, if discernible; otherwise, it defaults to the empty string,
        and in this case the original filename is not included in the header.

        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
        'xb' depending on whether the file will be read or written.  The default
        is the mode of fileobj if discernible; otherwise, the default is 'rb'.
        A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
        'wb', 'a' and 'ab', and 'x' and 'xb'.

        The compresslevel argument is an integer from 0 to 9 controlling the
        level of compression; 1 is fastest and produces the least compression,
        and 9 is slowest and produces the most compression. 0 is no compression
        at all. The default is 9.

        The mtime argument is an optional numeric timestamp to be written
        to the last modification time field in the stream when compressing.
        If omitted or None, the current time is used.

        r�UzInvalid mode: {!r}rNr�namerr �r)�w�a�xr)r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr �_GzipReaderr�BufferedReaderr.rB�WRITE�_init_write�zlibZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�_write_mtime�fileobj�_write_gzip_header)r3rr r!rU�mtime�rawr%r%r&r6�s@#


�zGzipFile.__init__cCsBddl}|�dtd�|jtkr<|jdd�dkr<|jdS|jS)Nrzuse the name attributer����.gz)�warnings�warn�DeprecationWarningr rPrB)r3r[r%r%r&r�s

zGzipFile.filenamecCs
|jjjS)z0Last modification time read from stream, or None)r.rX�_last_mtimer;r%r%r&rW�szGzipFile.mtimecCs.t|j�}d|dd�dtt|��dS)Nz<gzip r���� �>)�reprrU�hex�id)r3�sr%r%r&�__repr__�s
zGzipFile.__repr__cCs.||_t�d�|_d|_g|_d|_d|_dS�Nr,r)rBrR�crc32�crcr8Zwritebuf�bufsize�offset)r3rr%r%r&rQ�szGzipFile._init_writecCs|j�d�|j�d�z<tj�|j�}t|t�s<|�d�}|�	d�rR|dd�}Wnt
k
rld}YnXd}|rzt}|j�t|��d��|j
}|dkr�t��}t|jt|��|tkr�d}n|tkr�d	}nd
}|j�|�|j�d�|�r|j�|d
�dS)N���zlatin-1s.gzrYr,r�����)rUrr�path�basenamerBrr�encode�endswith�UnicodeEncodeError�FNAME�chrrT�timer*�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r3r!Zfname�flagsrWZxflr%r%r&rV�s6



zGzipFile._write_gzip_headercCs�|��|jtkr&ddl}t|jd��|jdkr8td��t|t	�rLt
|�}nt|�}|j}|dkr�|j�
|j�|��|j|7_t�||j�|_|j|7_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)�_check_not_closedr rP�errno�OSError�EBADFrUrrrr/�
memoryview�nbytesrrr8rRrhrirk)r3�datarZlengthr%r%r&rs 



zGzipFile.writer_cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$read() on write-only GzipFile object)r~r rMrr�r�r.r�r3r8rr%r%r&rs

z
GzipFile.readcCs@|��|jtkr&ddl}t|jd��|dkr4tj}|j�	|�S)zdImplements BufferedIOBase.read1()

        Reads up to a buffer's worth of data if size is negative.rNz%read1() on write-only GzipFile object)
r~r rMrr�r�r�DEFAULT_BUFFER_SIZEr.�read1r�r%r%r&r�&s
zGzipFile.read1cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$peek() on write-only GzipFile object)r~r rMrr�r�r.�peek)r3�nrr%r%r&r�3s

z
GzipFile.peekcCs
|jdkSr7�rUr;r%r%r&�closed:szGzipFile.closedcCs�|j}|dkrdSd|_zP|jtkrR|�|j���t||j	�t||j
d@�n|jtkrf|j��W5|j}|r�d|_|��XdS)N���)
rUrI�closer rPrr�flushr*rir8rMr.)r3rUrIr%r%r&r�>s

zGzipFile.closecCs4|��|jtkr0|j�|j�|��|j��dSr7)r~r rPrUrrr�)r3Z	zlib_moder%r%r&r�Qs
zGzipFile.flushcCs
|j��S)z�Invoke the underlying file object's fileno() method.

        This will raise AttributeError if the underlying file object
        doesn't support fileno().
        )rU�filenor;r%r%r&r�XszGzipFile.filenocCs"|jtkrtd��|j�d�dS)z[Return the uncompressed stream file position indicator to the
        beginning of the filezCan't rewind in write moderN)r rMr�r.r9r;r%r%r&�rewind`s
zGzipFile.rewindcCs
|jtkSr7)r rMr;r%r%r&�readablegszGzipFile.readablecCs
|jtkSr7)r rPr;r%r%r&�writablejszGzipFile.writablecCsdSr:r%r;r%r%r&r<mszGzipFile.seekablecCs�|jtkr�|tjkr2|tjkr*|j|}ntd��||jkrDtd��||j}d}t|d�D]}|�	|�q^|�	d|d�n |jt
kr�|��|j�
||�S|jS)NzSeek from end not supportedzNegative seek in write modes�rp)r rPr�SEEK_SET�SEEK_CURrkrr��rangerrMr~r.r9)r3rk�whence�count�chunk�ir%r%r&r9ps 





z
GzipFile.seekcCs|��|j�|�Sr7)r~r.�readline)r3r8r%r%r&r��szGzipFile.readline)r_)r_)r_)r=r>r?r@rIr{r6�propertyrrWrfrQrVrrr�r�r�r�rRZZ_SYNC_FLUSHr�r�r�r�r�r<rr�r9r�r%r%r%r&rxs:
�
I

 



csZeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�fdd�Z
�ZS)rNcs,t�jt|�tjtjd�d|_d|_dS)N)ZwbitsT)�superr6r+rRZ
decompressobjrS�_new_memberr^)r3�fp��	__class__r%r&r6�s
�z_GzipReader.__init__cCst�d�|_d|_dSrg)rRrh�_crc�_stream_sizer;r%r%r&�
_init_read�sz_GzipReader._init_readcCsF|j�|�}t|�|krB|j�|t|��}|s8td��||7}q|S)z�Read exactly *n* bytes from `self._fp`

        This method is required because self._fp may be unbuffered,
        i.e. return short reads.
        �ACompressed file ended before the end-of-stream marker was reached)�_fprr/�EOFError)r3r�r�rr%r%r&�_read_exact�s
z_GzipReader._read_exactcCs�|j�d�}|dkrdS|dkr,td|��t�d|�d��\}}|_|dkrVtd��|t@r|t�d	|�d��\}|�|�|t@r�|j�d
�}|r�|dkr�q�q�|t	@r�|j�d
�}|r�|dkr�q�q�|t
@r�|�d�dS)
Nrr,FrlzNot a gzipped file (%r)z<BBIxxr
zUnknown compression methodz<HrrpT)r�rrr'�unpackr�r^�FEXTRArw�FCOMMENT�FHCRC)r3�magic�method�flagZ	extra_lenrer%r%r&�_read_gzip_header�s0�

z_GzipReader._read_gzip_headerr_cCs�|dkr|��S|sdS|jjr>|��d|_|jf|j�|_|jrf|��|��s`|j	|_
dSd|_|j�t
j�}|j�||�}|jjdkr�|j�|jj�n|jjdkr�|j�|jj�|dkr�q�|dkrtd��q|�|�|j	t|�7_	|S)Nrr,TFr�)�readallZ
_decompressor�eof�	_read_eofr�Z_decomp_factoryZ_decomp_argsr�r�Z_posZ_sizer�rrr�rZunconsumed_tailr5Zunused_datar��_add_read_datar/)r3r8�bufZ
uncompressr%r%r&r�s:�

z_GzipReader.readcCs$t�||j�|_|jt|�|_dSr7)rRrhr�r�r/)r3r�r%r%r&r��sz_GzipReader._add_read_datacCs�t�d|�d��\}}||jkr<tdt|�t|j�f��n||jd@krRtd��d}|dkrl|j�d�}qV|r||j�	|�dS)Nz<IIr
zCRC check failed %s != %sr�z!Incorrect length of data producedrpr)
r'r�r�r�rrcr�r�rr5)r3rhZisize�cr%r%r&r��s

�
z_GzipReader._read_eofcst���d|_dSr:)r��_rewindr�r;r�r%r&r�s
z_GzipReader._rewind)r_)r=r>r?r6r�r�r�rr�r�r��
__classcell__r%r%r�r&rN�s!
3rN)rWc	Cs6t��}t|d||d��}|�|�W5QRX|��S)z�Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
    �wb)rUr r!rW)r�BytesIOrr�getvalue)r�r!rWr�r4r%r%r&rsc
Cs0tt�|�d��}|��W5QR�SQRXdS)zYDecompress a gzip compressed string in one shot.
    Return the decompressed string.
    r�N)rrr�r)r�r4r%r%r&rsc	Cs�ddlm}|dd�}|��}|jdddd�|jd	dd
d�|jdddd
d�|jdddgdd�|��}t}|jr|t}n
|jr�t	}|j
D]�}|jr�|dkr�tddt
jjd�}t
jj}n>|dd�dkr�t
�d|���t|d�}t�|dd�d�}nB|dk�r"t
jj}tddt
jj|d�}nt�|d�}t|dd�}|�d�}|�sP�q^|�|��q<|t
jjk	�rt|��|t
jjk	r�|��q�dS)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)Zdescriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r1)�nargs�default�metavarrr)rr rUrYrZzfilename doesn't end in .gz: r�)rr rUr!r�)�argparser�Zadd_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFFZfastr|Zbestr{r�rr�sys�stdin�buffer�stdout�exitrrHrrr�)	r��parser�groupr�r!�argr4�gr�r%r%r&�main'sR�
�



�
r��__main__)!r@r'r�ryrrRrHrZ_compression�__all__ZFTEXTr�r�rwr�rMrPr|r�r{rr*r+r�rZ
BaseStreamrZDecompressReaderrNrrr�r=r%r%r%r&�<module>s: �
,*	0
contextvars.cpython-38.opt-1.pyc000064400000000365151450073350012522 0ustar00U

e5d��@s ddlmZmZmZmZdZdS)�)�Context�
ContextVar�Token�copy_contextN)Z_contextvarsrrrr�__all__�rr�#/usr/lib64/python3.8/contextvars.py�<module>smailcap.cpython-38.pyc000064400000016050151450073350010607 0ustar00U

e5dk#�@s�dZddlZddlZddlZddgZdd�Ze�d�jZGdd	�d	e	�Z
d
d�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zddgfdd�Zd#dd�Zgfdd�Zdd�Zdd�Zd d!�Zed"kr�e�dS)$z%Mailcap file handling.  See RFC 1524.�N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor)�r�)�entryrr�/usr/lib64/python3.8/mailcap.py�lineno_sort_key
sr	z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdZdS)�UnsafeMailcapInputz)Warning raised when refusing unsafe inputN)�__name__�
__module__�__qualname__�__doc__rrrrr
sr
c
Cs�i}d}t�D]~}zt|d�}Wntk
r8YqYnX|�t||�\}}W5QRX|��D]*\}}||krz|||<q`|||||<q`q|S)a�Return a dictionary containing the mailcap database.

    The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
    to a list of dictionaries corresponding to mailcap entries.  The list
    collects all the entries for that MIME type from all available mailcap
    files.  Each dictionary contains key-value pairs for that MIME type,
    where the viewing command is stored with the key "view".

    r�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs



cCsPdtjkr"tjd}|�tj�}n*dtjkr8tjd}nd}|ddddg}|S)z7Return a list of all mailcap files found on the system.ZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr3s


�rcCs t�dtd�t|d�\}}|S)z?Read a mailcap file and return a dictionary keyed by MIME type.z2readmailcapfile is deprecated, use getcaps instead�N)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfileEs�r%c	Cs�i}|��}|sq�|ddks|��dkr,q|}|dd�dkrb|��}|sPd}|dd�|}q0t|�\}}|r|sxq|dk	r�||d<|d	7}|�d
�}tt|��D]}||��||<q�d
�|���}||kr�||�|�q|g||<q||fS)a�Read a mailcap file and return a dictionary keyed by MIME type.

    Each MIME type is mapped to an entry consisting of a list of
    dictionaries; the list will contain more than one such dictionary
    if a given MIME type appears more than once in the mailcap file.
    Each dictionary contains key-value pairs for that MIME type, where
    the viewing command is stored with the key "view".
    r�#����Nz\
�
rr�/)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrMs4	
rc
Cs�g}dt|�}}||kr>t|||�\}}|�|�|d}qt|�dkrNdS|d|d|dd�}}}d|i}|D]V}|�d�}|dkr�|}d}	n$|d|���}||dd���}	||kr�qz|	||<qz||fS)	z�Parse one entry in a mailcap file and return a dictionary.

    The viewing command is stored as the value with the key "view",
    and the rest of the fields produce key-value pairs in the dict.
    rrr �NNN�view�=r')r/�
parsefieldr2�findr,)
r3r4�i�n�fieldrr8�restZfkeyZfvaluerrrr-vs*

 

r-cCsP|}||kr<||}|dkr q<q|dkr2|d}q|d}q|||���|fS)z/Separate one key-value pair in a mailcap entry.�;�\r r)r,)r3r<r=�start�crrrr:�s

r:r8z	/dev/nullc
Cs�t|�r"d|f}t�|t�dSt|||�}|D]`}d|krlt|d||�}|dkrXq2|rlt�|�dkrlq2t|||||�}	|	dk	r2|	|fSq2dS)aFind a match for a mailcap entry.

    Return a tuple containing the command line, and the mailcap entry
    used; (None, None) if no match is found.  This may invoke the
    'test' command of several matching entries before deciding which
    entry to use.

    zHRefusing to use mailcap with filename %r. Use a safe temporary filename.r7�testNr)�_find_unsafer!r"r
�lookup�substr�system)
r�MIMEtyper�filename�plist�msg�entries�erD�commandrrrr�s 	
cslg}||kr|||}|�d�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr*rz/*csg|]}�|kr|�qSrr)�.0rN�rrr�
<listcomp>�szlookup.<locals>.<listcomp>rQ)r�sortedr	)rrIrrMZ	MIMEtypesrrQrrF�s
rFcCsRd}dt|�}}||k�rN||}|d}|dkr^|dkrT|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�t|�r�d|f}t�|t�dS||}q|d	k�r@|}	||kr�||d
kr�|d}q�||	|�}
|d}t|
|�}t|��r6d||
f}t�|t�dS||}q|d|}q|S)Nr'rr�%rA�s�tz9Refusing to substitute MIME type %r into a shell command.�{�}z=Refusing to substitute parameter %r (%s) into a shell command)r/rEr!r"r
�	findparam)r>rIrJrK�resr<r=rCrLrB�nameZparamrrrrG�sH










rGcCsF|��d}t|�}|D](}|d|���|kr||d�SqdS)Nr9r')r1r/)r[rKr=�prrrrY�srYc	Cs�ddl}t�}|jdd�s(t|�dStdt|j�d�D]�}|j||d�}t|�dkrjtd�dS|d}|d}t||d|�\}}|s�tdt�q:td|�t	�
|�}|r:td|�q:dS)	Nrrr z"usage: mailcap [MIMEtype file] ...r8zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr.r/�printr�typerrH)	r]rr<�argsrI�filerOrN�stsrrrrDs&

rDcCs�td�t�D]}td|�qt�|s0t�}td�t�t|�}|D]H}t|�||}|D].}t|�}|D]}td|||�qrt�qbqJdS)NzMailcap files:�	zMailcap entries:z  %-15s)r`rrrS)r�fnZckeysrarMrN�keys�krrrr_s"
r_�__main__)N)rrr!�re�__all__r	�compile�searchrE�Warningr
rrr%rr-r:rrFrGrYrDr_rrrrr�<module>s*)

)hashlib.cpython-38.pyc000064400000012457151450073350010622 0ustar00U

&�.e� �	@svdZdZee�Zee�ZedZddddddd	d
hZzddlmZ	Wne
k
r`d
d�Z	YnXe	�stiZdd�Zdd�Z
e	�s�ddd�Zddd�Zz ddlZeZe
Ze�ej�ZWn$e
k
r�e	�r΂eZeZYnXddlmZzddlmZWne
k
�rYnXeD]DZzee�e�e<Wn*ek
�rTddlZe�de�YnX�q[[[[[
e���sp[[	dS)a3hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
                                given hash function; initializing the hash
                                using the given binary data.

Named constructor functions are also available, these are faster
than using new(name):

md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(data): Update the hash object with the bytes in data. Repeated calls
                 are equivalent to a single call with the concatenation of all
                 the arguments.
 - digest():     Return the digest of the bytes passed to the update() method
                 so far as a bytes object.
 - hexdigest():  Like digest() except the digest is returned as a string
                 of double length, containing only hexadecimal digits.
 - copy():       Return a copy (clone) of the hash object. This can be used to
                 efficiently compute the digests of datas that share a common
                 initial substring.

For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update(b"Nobody inspects")
    >>> m.update(b" the spammish repetition")
    >>> m.digest()
    b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:

    >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

)�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512�	shake_128�	shake_256)�new�algorithms_guaranteed�algorithms_available�pbkdf2_hmacr	r
rrr
rrr�)�
get_fips_modecCsdS)Nr�rrr�/usr/lib64/python3.8/hashlib.py�_hashlib_get_fips_modeQsrc	Cs�t}|�|�}|dk	r|S�zB|dkrDddl}|j|d<|d<�n|dkrhddl}|j|d<|d<n�|dkr�ddl}|j|d	<|d
<|j|d<|d<n�|d
kr�ddl	}|j
|d<|d<|j|d<|d<n�|dkr�ddl}|j
|d<|j|d<nb|dk�r6ddl}|j|d<|j|d<|j|d<|j|d<n&|dk�r\ddl}|j|d<|j|d<Wntk
�rtYnX|�|�}|dk	�r�|Std|��dS)N>r�SHA1rrr>�MD5rrr>r�SHA224r�SHA256rrrr>r�SHA512�SHA384rrrrr>rrrr>rr	rr
r	r
rr>r
rr
rzunsupported hash type )�__builtin_constructor_cache�get�_sha1r�_md5r�_sha256rr�_sha512rr�_blake2rr�_sha3r	r
rrr
r�ImportError�
ValueError)	�name�cache�constructorr r!r"r#r$r%rrr�__get_builtin_constructorWsN









r+c	Cs^t�s|tkrt|�Sz"ttd|�}t��s4|�|WSttfk
rXt|�YSXdS)NZopenssl_)r�__block_openssl_constructorr+�getattr�_hashlibr�AttributeErrorr')r(�frrr�__get_openssl_constructor�sr1�cKst|�|f|�S)z�new(name, data=b'', **kwargs) - Return a new hashing object using the
        named algorithm; optionally initialized with data (which must be
        a bytes-like object).
        )r+�r(�data�kwargsrrr�__py_new�sr6cKsft��s |tkr t|�|f|�Sztj||f|�WStk
r`t��rL�t|�|f|�YSXdS)z�new(name, data=b'') - Return a new hashing object using the named algorithm;
    optionally initialized with data (which must be a bytes-like object).
    N)r.rr,r+rr'r3rrr�
__hash_new�sr7N)r)�scryptzcode for hash %s was not found.)r2)r2)�__doc__Z__always_supported�setrr�__all__r,r.rrr&rr+r1r6r7rZ
__get_hash�unionZopenssl_md_meth_namesrr8Z__func_name�globalsr'ZloggingZ	exceptionrrrr�<module>sh5�,

�

dataclasses.cpython-38.pyc000064400000056147151450073350011503 0ustar00U

e5d5��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZdddddddd	d
ddd
gZ	Gdd�de
�ZGdd�d�Ze�Z
Gdd�d�Ze�Ze�i�ZGdd�d�Zed�Zed�Zed�ZdZdZdZe�d�ZGdd�de�ZGdd�ded�ZGd d�d�ZGd!d"�d"�Zeed#d#dd#dd$�d%d�Z d&d'�Z!d(d)�Z"dded*�d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(d7d8�Z)d9d:�Z*d;d<�Z+d=d>�Z,d?d@�Z-dAdB�Z.dCdD�Z/dEdF�Z0dGdH�Z1dIdJ�Z2dKdL�Z3dddde1de2de2e3e2e3e2e3e2e3dM�Z4dNdO�Z5ddd#d#d#dPdPdPdQ�dRd�Z6dSd�Z7dTdU�Z8dVd
�Z9e:dW�dXd	�Z;dYdZ�Z<e=d[�d\d
�Z>d]d^�Z?d_dd#d#d#dPdPdPd`�dad�Z@dbd�ZAdceA_BdS)e�N�	dataclass�field�Field�FrozenInstanceError�InitVar�MISSING�fields�asdict�astuple�make_dataclass�replace�is_dataclassc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�#/usr/lib64/python3.8/dataclasses.pyr�sc@seZdZdd�ZdS)�_HAS_DEFAULT_FACTORY_CLASScCsdS)Nz	<factory>r��selfrrr�__repr__�sz#_HAS_DEFAULT_FACTORY_CLASS.__repr__N)rrrrrrrrr�src@seZdZdS)�
_MISSING_TYPENrrrrrr�src@seZdZdd�Zdd�ZdS)�_FIELD_BASEcCs
||_dS�N��name�rrrrr�__init__�sz_FIELD_BASE.__init__cCs|jSrrrrrrr�sz_FIELD_BASE.__repr__N)rrrrrrrrrr�sr�_FIELD�_FIELD_CLASSVAR�_FIELD_INITVARZ__dataclass_fields__Z__dataclass_params__Z
__post_init__z^(?:\s*(\w+)\s*\.)?\s*(\w+)c@seZdZdd�ZdS)�_InitVarMetacCst|�Sr)r)rZparamsrrr�__getitem__�sz_InitVarMeta.__getitem__N)rrrr#rrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)r��typecCs
||_dSrr$)rr%rrrr�szInitVar.__init__cCs,t|jt�r|jj}n
t|j�}d|�d�S)Nzdataclasses.InitVar[�])�
isinstancer%r�repr)rZ	type_namerrrr�s

zInitVar.__repr__N�rrr�	__slots__rrrrrrr�s)�	metaclassc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r)
rr%�default�default_factoryr(�hash�init�compare�metadata�_field_typecCsRd|_d|_||_||_||_||_||_||_|dkr<tnt	�
|�|_d|_dSr)
rr%r,r-r/r(r.r0�_EMPTY_METADATA�types�MappingProxyTyper1r2)rr,r-r/r(r.r0r1rrrr�s��zField.__init__cCsVd|j�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d	|j�d
|j	�d�S)NzField(name=z,type=z	,default=z,default_factory=z,init=�,repr=z,hash=z	,compare=z
,metadata=z
,_field_type=�))
rr%r,r-r/r(r.r0r1r2rrrrrszField.__repr__cCs(tt|j�dd�}|r$||j||�dS)N�__set_name__)�getattrr%r,)r�ownerr�funcrrrr8szField.__set_name__N)rrrr*rrr8rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�_DataclassParams�r/r(�eq�order�unsafe_hash�frozencCs(||_||_||_||_||_||_dSrr=)rr/r(r>r?r@rArrrr*sz_DataclassParams.__init__c
Cs6d|j�d|j�d|j�d|j�d|j�d|j�d�
S)Nz_DataclassParams(init=r6z,eq=z,order=z
,unsafe_hash=z,frozen=r7r=rrrrr2sz_DataclassParams.__repr__Nr)rrrrr<!sr<T�r,r-r/r(r.r0r1cCs,|tk	r|tk	rtd��t|||||||�S)a�Return an object to identify dataclass fields.

    default is the default value of the field.  default_factory is a
    0-argument function called to initialize a field's value.  If init
    is True, the field will be a parameter to the class's __init__()
    function.  If repr is True, the field will be included in the
    object's repr().  If hash is True, the field will be included in
    the object's hash().  If compare is True, the field will be used
    in comparison functions.  metadata, if specified, must be a
    mapping which is stored but not otherwise examined by dataclass.

    It is an error to specify both default and default_factory.
    z/cannot specify both default and default_factory)r�
ValueErrorrrBrrrr@s
�cs(|sdSdd��fdd�|D���d�S)N�()�(�,csg|]}��d|j���qS)�.r��.0�f��obj_namerr�
<listcomp>_sz_tuple_str.<locals>.<listcomp>�,))�join)rLrrrKr�
_tuple_strVsrPcs"t��t�����fdd��}|S)Nc	sDt|�t��f}|�krdS��|�z�|�}W5��|�X|S)Nz...)�id�_thread�	get_ident�add�discard)r�key�result��repr_running�
user_functionrr�wrapperis
z _recursive_repr.<locals>.wrapper)�set�	functools�wraps)rZr[rrXr�_recursive_reprds
r_)�globals�locals�return_typec
Cs�|dkri}d|krt|d<d}|tk	r4||d<d}d�|�}d�dd�|D��}d	|�d
|�d|�d|��}d
�|���}d|�d|�d|��}i}	t|||	�|	df|�S)NZBUILTINS�Z_return_typez->_return_typerF�
css|]}d|��VqdS)z  Nr)rI�brrr�	<genexpr>�sz_create_fn.<locals>.<genexpr>z def rEr7z:
�, zdef __create_fn__(z):
z	
 return Z
__create_fn__)�builtinsrrO�keys�exec)
r�argsZbodyr`rarbZreturn_annotationZtxtZ
local_vars�nsrrr�
_create_fnws 
rmcCs0|rd|�d|�d|�d�S|�d|�d|��S)NzBUILTINS.object.__setattr__(rFr7rG�=r)rAr�value�	self_namerrr�
_field_assign�srqcCs�d|j��}|jtk	rV|jr@|j||<|�d|j�d|j��}q�|j||<|�d�}n8|jr�|jtkrn|j}q�|jtk	r�|j||<|j}ndS|jtkr�dSt||j||�S)NZ_dflt_z() if z is _HAS_DEFAULT_FACTORY else rD)rr-rr/r,r2r!rq)rJrAr`rpZdefault_namerorrr�_field_init�s"






rrcCsV|jtkr|jtkrd}n&|jtk	r2d|j��}n|jtk	r@d}|j�d|j�|��S)Nrcz=_dflt_z=_HAS_DEFAULT_FACTORYz:_type_)r,rr-r)rJr,rrr�_init_param�s

rscCs�d}|D]:}|jr|jtkr&|jtks,d}q|rtd|j�d���qdd�|D�}|�ttd��g}|D] }t||||�}	|	rj|�	|	�qj|r�d�
d	d
�|D��}
|�	|�dt�d|
�d
��|s�dg}td|gdd�|D�|||dd�S)NFTznon-default argument z follows default argumentcSsi|]}d|j��|j�qS)Z_type_)rr%rHrrr�
<dictcomp>�s
z_init_fn.<locals>.<dictcomp>)r�_HAS_DEFAULT_FACTORYrFcss|]}|jtkr|jVqdSr)r2r!rrHrrrrf	s
�z_init_fn.<locals>.<genexpr>rGrEr7�passrcSsg|]}|jrt|��qSr)r/rsrHrrrrMsz_init_fn.<locals>.<listcomp>)rar`rb)
r/r,rr-�	TypeErrorr�updaterurr�appendrO�_POST_INIT_NAMErm)rrA�
has_post_initrpr`Zseen_defaultrJraZ
body_lines�lineZ
params_strrrr�_init_fn�s:��r}cCs2tdddd�dd�|D��dg|d�}t|�S)	Nrrz(return self.__class__.__qualname__ + f"(rgcSs g|]}|j�d|j�d��qS)z={self.z!r}rrHrrrrMs�z_repr_fn.<locals>.<listcomp>z)"�r`)rmrOr_)rr`�fnrrr�_repr_fns
����r�cCsp|td�}|r,dd�dd�|D��d}nd}tdd	d
|�d�dd
f||d�tddd
|�d�ddf||d�fS)N)�clsrrErFcss|]}t|j�VqdSr)r(rrHrrrrf(sz'_frozen_get_del_attr.<locals>.<genexpr>rNrD�__setattr__)rrroz if type(self) is cls or name in �:z> raise FrozenInstanceError(f"cannot assign to field {name!r}")z)super(cls, self).__setattr__(name, value))rar`�__delattr__rz; raise FrozenInstanceError(f"cannot delete field {name!r}")z"super(cls, self).__delattr__(name))rrOrm)r�rr`raZ
fields_strrrr�_frozen_get_del_attr$s2�
��
���r�cCs$t|ddd|�|�|��dg|d�S)N)r�otherz%if other.__class__ is self.__class__:z return zreturn NotImplementedr~)rm)r�op�
self_tuple�other_tupler`rrr�_cmp_fn=s��r�cCs$td|�}tddd|�d�g|d�S)Nr�__hash__rzreturn hash(r7r~)rPrm)rr`r�rrr�_hash_fnKs
�r�cCs$||jkp"t|�|jko"|j|jkSr)�ClassVarr%Z
_GenericAliasZ
__origin__)�a_type�typingrrr�_is_classvarSs

�r�cCs||jkpt|�|jkSr)rr%)r��dataclassesrrr�_is_initvar[s
�r�c	Cs�t�|�}|r�d}|�d�}|s2tj�|j�j}n2tj�|j�}|rd|j�|�|krdtj�|j�j}|r�||�|�d��|�r�dSdS)N��TF)�_MODULE_IDENTIFIER_RE�match�group�sys�modules�getr�__dict__)	Z
annotationr�Za_moduler�Zis_type_predicater�rlZmodule_name�modulerrr�_is_typebs)

r�cCs8t||t�}t|t�r|}nt|tj�r,t}t|d�}||_||_t	|_
tj�
d�}|r�t||�s�t|jt�r�t|j|||jt�r�t|_
|j
t	kr�tjt}t||�s�t|jt�r�t|j|||jt�r�t|_
|j
ttfkr�|jtk	r�td|j�d���|j
t	k�r4t|jtttf��r4tdt|j��d|j�d���|S)N)r,r��field z cannot have a default factoryzmutable default z for field z$ is not allowed: use default_factory)r9rr'rr4�MemberDescriptorTyperrr%rr2r�r�r�r��strr�r�r rr�rr!r-rwr,�list�dictr\rC)r�Za_namer�r,rJr�r�rrr�
_get_field�sF



���



���
	 r�cCs||jkrdSt|||�dS)NTF)r��setattr)r�rrorrr�_set_new_attribute�s
r�cCsdSrr�r�rr`rrr�_hash_set_none�sr�cCsdd�|D�}t||�S)NcSs(g|] }|jdkr|jrn|jr|�qSr)r.r0rHrrrrMs

z_hash_add.<locals>.<listcomp>)r�)r�rr`�fldsrrr�	_hash_addsr�cCstd|j����dS)Nz-Cannot overwrite attribute __hash__ in class )rwrr�rrr�_hash_exceptionsr�))FFFF)FFFT)FFTF)FFTT)FTFF)FTFT)FTTF)FTTT)TFFF)TFFT)TFTF)TFTT)TTFF)TTFT)TTTF)TTTTcs�i}�jtjkr tj�jj}ni}t�tt||||||��d}	d}
�jddd�D]D}t|t	d�}|dk	rVd}
|�
�D]}
|
||
j<qzt|t�jrVd}	qV�j�
di�}�fdd�|��D�}|D]L}
|
||
j<tt�|
jd�t�r�|
jtk�rt�|
j�q�t�|
j|
j�qĈj��D].\}}t|t��r||k�rt|�d����q|
�rz|	�rf|�sftd	��|	�sz|�rztd
��t�t	|��j�
dt�}|tk�p�|dk�o�d�jk}|�r�|�s�td
��|�rt�t�}dd�|�
�D�}t�dt|||d|k�rdnd|��dd�|�
�D�}|�rHdd�|D�}t�dt||��|�r�dd�|D�}td|�}td|�}t�dtdd|||d��|�r�dd�|D�}td|�}td|�}dD]>\}}t�|t|||||d���r�td|�d�j�d����q�|�r8t�||�D].}t�|j|��rtd|j�d�j�����qtt |�t |�t |�|f}|�rh|�||��_!t�d��s��jt"t#�$����%dd ��_&�S)!NF���rT�__annotations__csg|]\}}t�||��qSr)r�)rIrr%�r�rrrM]s�z"_process_class.<locals>.<listcomp>z& is a field but has no type annotationz5cannot inherit non-frozen dataclass from a frozen onez5cannot inherit frozen dataclass from a non-frozen oner��__eq__z eq must be true if order is truecSsg|]}|jttfkr|�qSr)r2rr!rHrrrrM�s�rrZ__dataclass_self__cSsg|]}|jtkr|�qSr�r2rrHrrrrM�s
cSsg|]}|jr|�qSr)r(rHrrrrM�srcSsg|]}|jr|�qSr�r0rHrrrrM�sr�z==r~cSsg|]}|jr|�qSrr�rHrrrrM�s))�__lt__�<)�__le__z<=)�__gt__�>)�__ge__z>=zCannot overwrite attribute z
 in class z). Consider using functools.total_ordering�__doc__z -> Nonerc)'rr�r�r�r��_PARAMSr<�__mro__r9�_FIELDS�valuesrrAr��itemsr'rr,r�delattrrwrC�hasattrrzr�r}r�rPr�rr��_hash_action�boolr�r��inspectZ	signaturerr�)r�r/r(r>r?r@rArr`Zany_frozen_baseZhas_dataclass_basesreZbase_fieldsrJZcls_annotationsZ
cls_fieldsrroZ
class_hashZhas_explicit_hashr{r�Z
field_listr�r�r�rZhash_actionrr�r�_process_class's��
�

�
��

��


����r�Fr=cs*������fdd�}|dkr"|S||�S)a�Returns the same class as was passed in, with dunder methods
    added based on the fields defined in the class.

    Examines PEP 526 __annotations__ to determine fields.

    If init is true, an __init__() method is added to the class. If
    repr is true, a __repr__() method is added. If order is true, rich
    comparison dunder methods are added. If unsafe_hash is true, a
    __hash__() method function is added. If frozen is true, fields may
    not be assigned to after instance creation.
    cst|�������Sr)r�r��r>rAr/r?r(r@rr�wrap�szdataclass.<locals>.wrapNr)r�r/r(r>r?r@rAr�rr�rr�scCsBzt|t�}Wntk
r*td��YnXtdd�|��D��S)z�Return a tuple describing the fields of this dataclass.

    Accepts a dataclass or an instance of one. Tuple elements are of
    type Field.
    z0must be called with a dataclass type or instancecss|]}|jtkr|VqdSrr�rHrrrrf
s
zfields.<locals>.<genexpr>)r9r��AttributeErrorrw�tupler�)Zclass_or_instancerrrrr�s
cCstt|�t�S)z2Returns True if obj is an instance of a dataclass.)r�r%r�)�objrrr�_is_dataclass_instancesr�cCs t|t�r|nt|�}t|t�S)zEReturns True if obj is a dataclass or an instance of a
    dataclass.)r'r%r�r�)r�r�rrrr
s��dict_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new dictionary mapping
    field names to field values.

    Example usage:

      @dataclass
      class C:
          x: int
          y: int

      c = C(1, 2)
      assert asdict(c) == {'x': 1, 'y': 2}

    If given, 'dict_factory' will be used instead of built-in dict.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z0asdict() should be called on dataclass instances)r�rw�
_asdict_inner)r�r�rrrr	scs�t|�rDg}t|�D]&}tt||j���}|�|j|f�q�|�St|t�rrt|d�rrt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)N�_fieldscsg|]}t|���qSr�r��rI�vr�rrrMOsz!_asdict_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrfTsz _asdict_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr��rI�kr�r�rrrfVs��)r�rr�r9rryr'r�r�r%r�r�r��copy�deepcopy)r�r�rWrJrorr�rr�4s
�r���
tuple_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new tuple of field values.

    Example usage::

      @dataclass
      class C:
          x: int
          y: int

    c = C(1, 2)
    assert astuple(c) == (1, 2)

    If given, 'tuple_factory' will be used instead of built-in tuple.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z1astuple() should be called on dataclass instances)r�rw�_astuple_inner)r�r�rrrr
]scs�t|�r>g}t|�D] }tt||j���}|�|�q�|�St|t�rlt|d�rlt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)Nr�csg|]}t|���qSr�r�r�r�rrrM�sz"_astuple_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrf�sz!_astuple_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr�r�r�rrrf�s�)r�rr�r9rryr'r�r�r%r�r�r�r�r�)r�r�rWrJrorr�rr�us
�r�r)�bases�	namespacer/r(r>r?r@rAc	s�dkri�n����t�}
i}|D]�}t|t�r<|}
d}nDt|�dkrR|\}
}n.t|�dkrr|\}
}}|�|
<ntd|����t|
t�r�|
��s�td|
����t�|
�r�td|
����|
|
kr�td|
����|
�	|
�|||
<q$|�d	<t
�||i�fd
d��}t|||||||	d�S)
a�Return a new dynamically created dataclass.

    The dataclass name will be 'cls_name'.  'fields' is an iterable
    of either (name), (name, type) or (name, type, Field) objects. If type is
    omitted, use the string 'typing.Any'.  Field objects are created by
    the equivalent of calling 'field(name, type [, Field-info])'.

      C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))

    is equivalent to:

      @dataclass
      class C(Base):
          x: 'typing.Any'
          y: int
          z: int = field(init=False)

    For the bases and namespace parameters, see the builtin type() function.

    The parameters init, repr, eq, order, unsafe_hash, and frozen are passed to
    dataclass().
    Nz
typing.Anyr��zInvalid field: z'Field names must be valid identifiers: z"Field names must not be keywords: zField name duplicated: r�cs
|���Sr)rx)rl�r�rr�<lambda>��z make_dataclass.<locals>.<lambda>r=)
r�r\r'r��lenrw�isidentifier�keyword�	iskeywordrTr4�	new_classr)Zcls_namerr�r�r/r(r>r?r@rA�seenZanns�itemr�tp�specr�rr�rr�s:






�cOst|�dkr tdt|��d���|r,|\}n4d|krX|�d�}ddl}|jdtdd	�ntd
��t|�sptd��t|t��	�D]v}|j
tkr�q~|js�|j
|kr~td|j
�d
���q~|j
|kr~|j
tkr�|jtkr�td|j
�d���t||j
�||j
<q~|jf|�S)a,Return a new object replacing specified fields with new values.

    This is especially useful for frozen classes.  Example usage:

      @dataclass(frozen=True)
      class C:
          x: int
          y: int

      c = C(1, 2)
      c1 = replace(c, x=3)
      assert c1.x == 3 and c1.y == 2
      r�z*replace() takes 1 positional argument but z were givenr�rNz/Passing 'obj' as keyword argument is deprecatedr�)�
stacklevelz7replace() missing 1 required positional argument: 'obj'z1replace() should be called on dataclass instancesr�zC is declared with init=False, it cannot be specified with replace()zInitVar z! must be specified with replace())r�rw�pop�warnings�warn�DeprecationWarningr�r9r�r�r2r r/rrCr!r,r�	__class__)rkZchangesr�r�rJrrrr�s4
�


z(obj, /, **kwargs))N)C�rer�r�r4r�r�rhr]rR�__all__r�rrrurrr5r3rrr r!r�r�rz�compiler�r%r"rrr<rrPr_rmrqrrrsr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r
r�r	r�r�r
r�rr�__text_signature__rrrr�<module>s��

:��62;R�>
�)�B<tokenize.cpython-38.opt-1.pyc000064400000041336151450073350011775 0ustar00U

e5d�d�@sHdZdZdZddlmZddlmZmZddl	Z	ddl
mZddlZ
ddlZddlZddlTdd	lmZe�d
ej�Ze�dej�ZddlZejdd
dddgZ[Gdd�de	�dd��Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZ dZ!dZ"d Z#ee e!e"e#�Z$d!Z%ed"d#�ee%�Z&d$e%Z'ee&e'�Z(ed%e(d&�Z)ee)e(e$�Z*d'd(�Z+d)d*�Z,ee+��Z-d+Z.d,Z/d-Z0d.Z1ee-d/e-d0�Z2ee-d1e-d2�Z3ee4ej5e6ed3d4���Z7ed5e7�Z8ee*e8e3e�Z9ee9Z:ee-d6ed7d�e-d8ed9d��Z;ed:ee2�Z<eee<e*e8e;e�Z=iZ>e+�D]6Z?e.e>e?d7<e/e>e?d9<e0e>e?d/<e1e>e?d0<�q,e@�ZAe@�ZBe+�D]JZCeCd9eCd7fD]ZDeA�EeD��q�eCd0eCd/fD]ZDeB�EeD��q��qvd;ZFGd<d=�d=eG�ZHGd>d?�d?eG�ZIGd@dA�dA�ZJdBd�ZKdCdD�ZLdEd�ZMdFdG�ZdHd�ZNdIdJ�ZOdKd
�ZPdLdM�ZQeRdNk�rDeQ�dS)OaoTokenization help for Python programs.

tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens.  It decodes the bytes according to PEP-0263 for
determining source file encoding.

It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF).  It generates 5-tuples with these
members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators.  Additionally, all token lists start with an ENCODING token
which tells you which encoding was used to decode the bytes stream.
zKa-Ping Yee <ping@lfw.org>zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foord�)�open)�lookup�BOM_UTF8N)�
TextIOWrapper)�*)�EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)�tokenize�generate_tokens�detect_encoding�
untokenize�	TokenInfoc@s eZdZdd�Zedd��ZdS)rcCs$d|jt|jf}d|j|d�S)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))�type)r
�tok_name�_replace)�self�annotated_type�r� /usr/lib64/python3.8/tokenize.py�__repr__.s
�zTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdS�N)r
�OP�stringr�rrrr�
exact_type3s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr-sztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group:�r$cGst|�dS)Nr�r$r"rrr�any;r%r'cGst|�dS)N�?r&r"rrr�maybe<r%r)z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]cCs^ddddddg}dh}|D]>}t�|�D].}tjdd	�|D��D]}|�d�|��q@q(q|S)
N�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>^sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr,rrr�_all_string_prefixesSsr=cCst�|tj�Sr)�re�compile�UNICODE)�exprrrr�_compilebsrBz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)�reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"z
\\\r?\n|\Z�c@seZdZdS)�
TokenErrorN�rrrrrrrrG�srGc@seZdZdS)�StopTokenizingNrHrrrrrI�srIc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__init__�szUntokenizer.__init__cCs�|\}}||jks&||jkr>||jkr>td�|||j|j���||j}|rb|j�d|�d|_||j}|r�|j�d|�dS)Nz+start ({},{}) precedes previous end ({},{})�\
r� )rMrN�
ValueError�formatrL�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

zUntokenizer.add_whitespacecCs6t|�}g}d}|D�]}t|�dkr8|�||��q*|\}}}}	}
|tkrV||_q|tkrd�q*|tkrz|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fkr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fkr|j
d7_
d|_qd�|j�S)NF�T���rKrr0)�iter�len�compat�ENCODINGrO�	ENDMARKER�INDENTrU�DEDENT�poprMrN�NEWLINE�NLrLr[r!)r�iterable�it�indents�	startliner<�tok_type�tokenrV�end�line�indentrrrr�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfk}d}t�|g|�D]�}|dd�\}}	|tkrR|	|_q.|tt	fkrf|	d7}	|t
kr�|rzd|	}	d}nd}|tkr�|�|	�q.n>|tkr�|�
�q.n*|ttfkr�d}n|r�|r�||d�d}||	�q.dS)NrFr\rRTr])rLrUrfrgr5�chainrarO�NAME�NUMBER�STRINGrcrdre)
rrmrhrj�toks_appendrk�
prevstring�tok�toknum�tokvalrrrr`�s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJ�s
%rJcCs*t�}|�|�}|jdk	r&|�|j�}|S)aTransform tokens back into Python source code.
    It returns a bytes object, encoded using the ENCODING
    token, which is the first token sequence output by tokenize.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output bytes will tokenize back to the input
        t1 = [tok[:2] for tok in tokenize(f.readline)]
        newcode = untokenize(t1)
        readline = BytesIO(newcode).readline
        t2 = [tok[:2] for tok in tokenize(readline)]
        assert t1 == t2
    N)rJrrO�encode)rh�ut�outrrrrs


cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N��_�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r�)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_names�r�cs�z�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|�t�rpd�|d	d�}d
}|s||gfS||�}|r�||gfSt�|�s�||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.
    NFr�cs$z��WStk
rYdSXdS)Nr%)�
StopIterationr��readlinerr�read_or_stop?sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn4tk
rBd}�dk	r6d�|��}t|��YnXt�|�}|sVdSt|�d��}zt|�}Wn:t	k
r��dkr�d|}nd��|�}t|��YnX�r�|dkr؈dkr�d}n
d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrT�SyntaxError�	cookie_re�matchr�r$r�LookupError)ro�line_string�msgr�rO�codec)�	bom_found�filenamerr�find_cookieEs8

�
z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rO�defaultr�r��first�secondr)r�r�r�rr
's8
&




cCsXt|d�}z2t|j�\}}|�d�t||dd�}d|_|WS|���YnXdS)zXOpen a file in read only mode using the encoding detected by
    detect_encoding().
    �rbrT)�line_bufferingr+N)�
_builtin_openr
r��seekr�mode�close)r��bufferrO�lines�textrrrr�s

rcCs6t|�\}}t�d�}t�|t|d�|�}t|j|�S)a�
    The tokenize() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects.  Each call to the function
    should return one line of input as bytes.  Alternatively, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile, 'rb').__next__  # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found.  The line passed is the
    physical line.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    r%)r
r5�repeatrqr^�	_tokenize�__next__)r�rO�consumed�empty�rl_genrrrr�s
ccsld}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|ddd�Vd}
d}z|}
|�}Wntk
rvd}YnX|dk	r�|�|�}|d	7}dt|�}}
|�rp|s�td
|��|�|�}|�r|�d�}}tt||d|�|||f||�Vd\}}d}nf|�rZ|dd�dk�rZ|d
d�dk�rZtt	||||t|�f|�Vd}d}qPn||}||}qP�n�|dk�r|�s|�s��q�d}||
k�r�||dk�r�|d	7}n8||dk�r�|t
d	t
}n||dk�r�d}n�q�|d	7}�q�||
k�r�q�||dk�r�||dk�r^||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqP||	dk�r�|	�|�tt|d|�|df||f|�V||	dk�r.||	k�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�n|�s*td|df��d}||
krPtt��||�}|�r�|�d	�\}}||f||f|}}}||k�r��q.|||�||}}||k�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dk�r|dk�r�tt
||||�Vntt||||�V�q�|dk�r2tt||||�V�q�|tk�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}qP�q�|tk�s�|dd�tk�s�|dd�tk�rF|ddk�r2||f}tt�|��pt�|d	��pt�|d��}||d�d	}}|}qPntt||||�Vnf|���rdtt||||�VnH|dk�rtd	}n8|dk�r�|d	7}n|d k�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q.qP|
�r |
ddk�r ttd|d	t|
�f|d	t|
�d	fd�V|	d	d�D] }ttd|df|dfd�V�q,ttd|df|dfd�VdS)!Nr�
0123456789)r0rr�r�)rrr0r%rKzEOF in multi-line string���rQ���z\
rR�	�z#
�#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...r\r��
�\z([{z)]})rrar�r�r_rGr�rnrt�
ERRORTOKEN�tabsize�rstrip�COMMENTrgrUrc�IndentationErrorrdrB�PseudoToken�spanrsrf�
triple_quoted�endpats�
single_quoted�get�isidentifierrrrrb)r�rO�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerj�	last_linero�pos�max�strstart�endprog�endmatchrn�column�
comment_token�pseudomatchrV�spos�eposrm�initialrprrrr��s<




�*

�


�
�
"

� 

���





����






�.r�cCs
t|d�S)z�Tokenize a source reading Python code as unicode strings.

    This has the same API as tokenize(), except that it expects the *readline*
    callable to return str objects instead of bytes.
    N)r�r�rrrr	dsc

s$ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}z�|jr�|j}t|d��}tt|j��}W5QRXnd}t	t
jjd�}|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�W�n8tk
�r6}
z0|
jddd�\}}||
jd|||f�W5d}
~
XYn�tk
�r|}
z(|
jd\}}||
jd|||f�W5d}
~
XYn�tk
�r�}
z||
|�W5d}
~
XYnxtk
�r�}
z||
�W5d}
~
XYnNtk
�r�td�Yn2tk
�r}
z�d|
��W5d}
~
XYnXdS)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorpszmain.<locals>.perrorcsR|r"|f||f}�d|�n"|r8�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srK)r��exit)r�r��location�args�r�rr�errortszmain.<locals>.errorzpython -m tokenize)�progr�r(zfilename.pyz'the file to tokenize; defaults to stdin)�dest�nargs�metavar�helpz-ez--exact�exact�
store_truez(display token names using the exact type)r��actionr�r�z<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrKr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrVrn�printrrr�r�rGr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r-rLrm�
token_type�token_range�errror�rr�r�mainlsT���&&r��__main__)S�__doc__�
__author__�__credits__�builtinsrr��codecsrr�collections�ior�	itertoolsr5r>r�rmrr?�ASCIIr�r��__all__�
namedtuplerr$r'r)�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr=rB�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r<r,r8r�r�rGrIrJrr�r
rr�r	r�rrrrr�<module>s�
�
��

�
���

_]8=
rlcompleter.cpython-38.pyc000064400000013175151450073350011536 0ustar00U

e5d��@s�dZddlZddlZddlZdgZGdd�d�Zdd�ZzddlZWnek
r\dZ	Yn"Xe�
e�j�e�dd	��d
Z	dS)a1Word completion for GNU readline.

The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.

It's very cool to do "import sys" type "sys.", hit the completion key (twice),
and see the list of names defined by the sys module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")

Notes:

- Exceptions raised by the completer function are *ignored* (and generally cause
  the completion to fail).  This is a feature -- since readline sets the tty
  device in raw (or cbreak) mode, printing a traceback wouldn't work well
  without some complicated hoopla to save, reset and restore the tty state.

- The evaluation of the NAME.NAME... form may cause arbitrary application
  defined code to be executed if an object with a __getattr__ hook is found.
  Since it is the responsibility of the application (or the user) to enable this
  feature, I consider this an acceptable risk.  More complicated expressions
  (e.g. function calls or indexing operations) are *not* evaluated.

- When the original stdin is not a tty device, GNU readline is never
  used, and this module (and the readline module) are silently inactive.

�N�	Completerc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs6|rt|t�std��|dkr&d|_nd|_||_dS)a�Create a new completer for the command line.

        Completer([namespace]) -> completer instance.

        If unspecified, the default namespace where completions are performed
        is __main__ (technically, __main__.__dict__). Namespaces should be
        given as dictionaries.

        Completer instances should be used as the completion mechanism of
        readline via the set_completer() call:

        readline.set_completer(Completer(my_namespace).complete)
        znamespace must be a dictionaryN�r)�
isinstance�dict�	TypeError�use_main_ns�	namespace)�selfr�r
�#/usr/lib64/python3.8/rlcompleter.py�__init__'szCompleter.__init__cCs�|jrtj|_|��sB|dkr>tr8t�d�t��dSdSndS|dkrld|kr`|�	|�|_
n|�|�|_
z|j
|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        This is called successively with state == 0, 1, 2, ... until it
        returns None.  The completion should begin with 'text'.

        r�	�N�.)
r�__main__�__dict__r�strip�_readline_available�readlineZinsert_textZ	redisplay�attr_matches�matches�global_matches�
IndexError)r	�text�stater
r
r�completeBs$
zCompleter.completecCst|�r|d}|S)N�()�callable)r	�val�wordr
r
r�_callable_postfixaszCompleter._callable_postfixc	Cs�ddl}g}dh}t|�}|jD]J}|d|�|kr |�|�|dkrP|d}n|dkr`|d}|�|�q |jtjfD]J}|��D]<\}}|d|�|kr�||kr�|�|�|�|�	||��q�qx|S)z�Compute matches when text is a simple name.

        Return a list of all keywords, built-in functions and names currently
        defined in self.namespace that match.

        rN�__builtins__>�try�finally�:>�break�None�pass�continue�False�True�else� )
�keyword�len�kwlist�add�appendr�builtinsr�itemsr )	r	rr-r�seen�nrZnspacerr
r
rrfs$



zCompleter.global_matchesc	Cshddl}|�d|�}|sgS|�dd�\}}zt||j�}Wntk
rTgYSXtt|��}|�d�t	|d�r�|�
d�|�t|j
��g}t|�}	|dkr�d	}
n|d	kr�d
}
nd}
|D]t}|d|	�|kr�|
r�|d|	d�|
ks�d||f}zt||�}
Wntk
�rYnX|�|
|�}|�|�q�|�s\|
�sF�q\|
d	k�rVd
}
q�d}
q�|��|S)a�Compute matches when text contains a dot.

        Assuming the text is of the form NAME.NAME....[NAME], and is
        evaluable in self.namespace, it will be evaluated and its attributes
        (as revealed by dir()) are used as possible completions.  (For class
        instances, class members are also considered.)

        WARNING: this can still invoke arbitrary C code, if an object
        with a __getattr__ hook is evaluated.

        rNz(\w+(\.\w+)*)\.(\w*)r�r!�	__class__r�_�__z%s.%s)�re�match�group�evalr�	Exception�set�dir�discard�hasattrr0�update�get_class_membersr7r.�getattrr r1�sort)r	rr:�m�expr�attrZ
thisobjectZwordsrr5Znoprefixrr;rr
r
rr�sR



��
zCompleter.attr_matches)N)�__name__�
__module__�__qualname__rrr rrr
r
r
rr&s

cCs.t|�}t|d�r*|jD]}|t|�}q|S)N�	__bases__)r@rBrMrD)�klassZret�baser
r
rrD�s


rDFcCs
t�d�S)N)r�
set_completerr
r
r
r�<lambda>��rQT)
�__doc__�atexitr2r�__all__rrDr�ImportErrorrrPr�registerr
r
r
r�<module>s
ast.cpython-38.pyc000064400000040575151450073350010001 0ustar00U

e5d"K�@s�dZddlTd=ddd�dd	�Zd
d�Zd>d
d�Zdd�Zdd�Zd?dd�Zdd�Zdd�Z	d@dd�Z
dd�Zdd�Zdd �d!d"�Z
d#d$�ZGd%d&�d&e�ZGd'd(�d(e�Zd)d*�Zd+d,�Zeee�e_eee�e_Gd-d.�d.e�Zd/d0�ZGd1d2�d2eed3�ZGd4d5�d5eed3�ZGd6d7�d7eed3�ZGd8d9�d9eed3�ZGd:d;�d;eed3�Zee e!e"fee#fee$feed�e%feed<�fiZ&ee%fiZ'e%d9ed�d9e d2e!d2e"d2e#d5e$d7ed<�d;iZ(dS)AaH
    ast
    ~~~

    The `ast` module helps Python applications to process trees of the Python
    abstract syntax grammar.  The abstract syntax itself might change with
    each Python release; this module helps to find out programmatically what
    the current grammar looks like and allows modifications of it.

    An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as
    a flag to the `compile()` builtin function or by using the `parse()`
    function from this module.  The result will be a tree of objects whose
    classes all inherit from `ast.AST`.

    A modified abstract syntax tree can be compiled into a Python code object
    using the built-in `compile()` function.

    Additionally various helper functions are provided that make working with
    the trees simpler.  The main intention of the helper functions and this
    module in general is to provide an easy to use interface for libraries
    that work tightly with the python syntax (template engines for example).


    :copyright: Copyright 2008 by Armin Ronacher.
    :license: Python License.
�)�*�	<unknown>�execFN)�
type_comments�feature_versioncCsRt}|r|tO}t|t�r4|\}}|dks.t�|}n|dkr@d}t|||||d�S)z�
    Parse the source into an AST node.
    Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
    Pass type_comments=True to get back type comments where the syntax allows.
    �N���)�_feature_version)Z
PyCF_ONLY_ASTZPyCF_TYPE_COMMENTS�
isinstance�tuple�AssertionError�compile)�source�filename�moderr�flags�major�minor�r�/usr/lib64/python3.8/ast.py�parses

�rcs`t|t�rt|dd�}t|t�r&|j}dd���fdd���fdd������fd	d
���|�S)a
    Safely evaluate an expression node or a string containing a Python
    expression.  The string or node provided may only consist of the following
    Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
    sets, booleans, and None.
    �eval)rcSstd|����dS)Nzmalformed node or string: )�
ValueError��noderrr�_raise_malformed_node>sz+literal_eval.<locals>._raise_malformed_nodecs,t|t�rt|j�tttfkr&�|�|jS�N)r
�Constant�type�value�int�float�complexr)rrr�_convert_num@sz"literal_eval.<locals>._convert_numcsDt|t�r<t|jttf�r<�|j�}t|jt�r6|
S|S�|�Sr)r
ZUnaryOp�opZUAddZUSub�operand)rr%)r#rr�_convert_signed_numDs
z)literal_eval.<locals>._convert_signed_numcst|t�r|jSt|t�r*tt�|j��St|t�rDtt�|j��St|t	�r^t
t�|j��St|t�r�t|j
�t|j�kr��|�ttt�|j
�t�|j���St|t��rt|jttf��r�|j�}�|j�}t|ttf��rt|t��rt|jt��r||S||S�|�Sr)r
rrZTupler�mapZeltsZList�list�Set�setZDict�len�keys�values�dict�zipZBinOpr$ZAddZSub�left�rightr r!r")rr0r1��_convertr#r&rrrr3Ls,





�

zliteral_eval.<locals>._convert)r
�strrZ
Expression�body)Znode_or_stringrr2r�literal_eval3s

r6Tcs2���fdd��t|t�s*td|jj���|�S)a�
    Return a formatted dump of the tree in node.  This is mainly useful for
    debugging purposes.  If annotate_fields is true (by default),
    the returned string will show the names and the values for fields.
    If annotate_fields is false, the result string will be more compact by
    omitting unambiguous field names.  Attributes such as line
    numbers and column offsets are not dumped by default.  If this is wanted,
    include_attributes can be set to true.
    c	st|t�r�g}�}|jD]V}zt||�}Wntk
rBd}YqX|r`|�d|�|�f�q|��|��q�r�|jr�|jD]:}z |�d|�t||��f�Wq�tk
r�Yq�Xq�d|jjd�	|�fSt|t
�r�dd�	�fdd�|D��St|�S)NTz%s=%sz%s(%s)z, z[%s]c3s|]}�|�VqdSrr)�.0�x)�_formatrr�	<genexpr>�sz(dump.<locals>._format.<locals>.<genexpr>)r
�AST�_fields�getattr�AttributeError�append�_attributes�	__class__�__name__�joinr(�repr)r�args�keywords�fieldr�a�r9�annotate_fields�include_attributesrrr9ps*




 
zdump.<locals>._formatzexpected AST, got %r)r
r;�	TypeErrorrArB)rrJrKrrIr�dumpfs

rMcCsVdD]L}||jkr||jkrt||d�}|dk	sDt||�r|�d�rt|||�q|S)z�
    Copy source location (`lineno`, `col_offset`, `end_lineno`, and `end_col_offset`
    attributes) from *old_node* to *new_node* if possible, and return *new_node*.
    )�lineno�
col_offset�
end_lineno�end_col_offsetNZend_)r@r=�hasattr�
startswith�setattr)�new_nodeZold_node�attrrrrr�
copy_location�s��rWcs �fdd���|dddd�|S)a{
    When you compile a node tree with compile(), the compiler expects lineno and
    col_offset attributes for every node that supports them.  This is rather
    tedious to fill in for generated nodes, so this helper adds these attributes
    recursively where not already set, by setting them to the values of the
    parent node.  It works recursively starting at *node*.
    cs�d|jkr"t|d�s||_n|j}d|jkrDt|d�s>||_n|j}d|jkrft|d�s`||_n|j}d|jkr�t|d�s�||_n|j}t|�D]}�|||||�q�dS)NrNrPrOrQ)r@rRrNrPrOrQ�iter_child_nodes)rrNrOrPrQ�child��_fixrrr[�s$







z#fix_missing_locations.<locals>._fix�rrrrrZr�fix_missing_locations�sr]r\cCsVt|�D]H}d|jkr(t|dd�||_d|jkrt|dd�}dk	r|||_q|S)z�
    Increment the line number and end line number of each node in the tree
    starting at *node* by *n*. This is useful to "move code" to a different
    location in a file.
    rNrrPN)�walkr@r=rNrP)r�nrYrPrrr�increment_lineno�s
��r`c	cs:|jD].}z|t||�fVWqtk
r2YqXqdS)zs
    Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
    that is present on *node*.
    N)r<r=r>)rrGrrr�iter_fields�s

raccsLt|�D]>\}}t|t�r"|Vqt|t�r|D]}t|t�r0|Vq0qdS)z�
    Yield all direct child nodes of *node*, that is, all fields that are nodes
    and all items of fields that are lists of nodes.
    N)rar
r;r()r�namerG�itemrrrrX�s


rXcCs�t|ttttf�s"td|jj��|jr8t|jdt	�s<dS|jdj
}t|t�rZ|j}n"t|t
�rxt|j
t�rx|j
}ndS|r�ddl}|�|�}|S)aC
    Return the docstring for the given node or None if no docstring can
    be found.  If the node provided does not have docstrings a TypeError
    will be raised.

    If *clean* is `True`, all tabs are expanded to spaces and any whitespace
    that can be uniformly removed from the second line onwards is removed.
    z%r can't have docstringsrN)r
ZAsyncFunctionDefZFunctionDefZClassDefZModulerLrArBr5ZExprr�Str�srr4�inspectZcleandoc)rZclean�textrfrrr�
get_docstring�s	

rhcCs�d}g}d}|t|�krx||}||7}|d7}|dkr`|t|�kr`||dkr`|d7}|d7}|dkr|�|�d}q|r�|�|�|S)z}Split a string into lines ignoring form feed and other chars.

    This mimics how the Python parser splits source code.
    r�r\�
�
z
)r+r?)r�idx�linesZ	next_line�crrr�_splitlines_no_ffs  

rocCs,d}|D]}|dkr||7}q|d7}q|S)z6Replace all chars except '\f\t' in a line with spaces.riz	� r)r�resultrnrrr�_pad_whitespaces

rr)�paddedcCs�z$|jd}|jd}|j}|j}Wntk
r:YdSXt|�}||krd||��||���S|r�t||��d|����}nd}|||��|d���}	||��d|���}
||d|�}|�	d|	�|�
|
�d�|�S)aBGet source code segment of the *source* that generated *node*.

    If some location information (`lineno`, `end_lineno`, `col_offset`,
    or `end_col_offset`) is missing, return None.

    If *padded* is `True`, the first line of a multi-line statement will
    be padded with spaces to match its original position.
    r\Nrir)rNrPrOrQr>ro�encode�decoderr�insertr?rC)rrrsrNrPrOrQrmZpadding�firstZlastrrr�get_source_segment*s&	



rxccs<ddlm}||g�}|r8|��}|�t|��|VqdS)z�
    Recursively yield all descendant nodes in the tree starting at *node*
    (including *node* itself), in no specified order.  This is useful if you
    only want to modify nodes in place and don't care about the context.
    r)�dequeN)�collectionsry�popleft�extendrX)rryZtodorrrr^Ms
r^c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�NodeVisitora<
    A node visitor base class that walks the abstract syntax tree and calls a
    visitor function for every node found.  This function may return a value
    which is forwarded by the `visit` method.

    This class is meant to be subclassed, with the subclass adding visitor
    methods.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `visit` method.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.

    Don't use the `NodeVisitor` if you want to apply changes to nodes during
    traversing.  For this a special visitor exists (`NodeTransformer`) that
    allows modifications.
    cCs"d|jj}t|||j�}||�S)z
Visit a node.�visit_)rArBr=�
generic_visit)�selfr�method�visitorrrr�visitoszNodeVisitor.visitcCsTt|�D]F\}}t|t�r:|D]}t|t�r|�|�qqt|t�r|�|�qdS)z9Called if no explicit visitor function exists for a node.N)rar
r(r;r�)r�rrGrrcrrrrus


zNodeVisitor.generic_visitc	Cs�|j}t�t|��}|dkr@t��D]\}}t||�r$|}q@q$|dk	r�d|}zt||�}Wntk
rrYn&Xddl}|�	|�d�t
d�||�S|�|�S)Nr~rz" is deprecated; add visit_Constant�)r�_const_node_type_names�getr�itemsr
r=r>�warnings�warn�PendingDeprecationWarningr)	r�rrZ	type_name�clsrbr�r�r�rrr�visit_Constants(
�zNodeVisitor.visit_ConstantN)rB�
__module__�__qualname__�__doc__r�rr�rrrrr}[s
r}c@seZdZdZdd�ZdS)�NodeTransformeraG
    A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
    allows modification of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor methods to replace or remove the old node.  If the return value of
    the visitor method is ``None``, the node will be removed from its location,
    otherwise it is replaced with the return value.  The return value may be the
    original node in which case no replacement takes place.

    Here is an example transformer that rewrites all occurrences of name lookups
    (``foo``) to ``data['foo']``::

       class RewriteName(NodeTransformer):

           def visit_Name(self, node):
               return Subscript(
                   value=Name(id='data', ctx=Load()),
                   slice=Index(value=Str(s=node.id)),
                   ctx=node.ctx
               )

    Keep in mind that if the node you're operating on has child nodes you must
    either transform the child nodes yourself or call the :meth:`generic_visit`
    method for the node first.

    For nodes that were part of a collection of statements (that applies to all
    statement nodes), the visitor may also return a list of nodes rather than
    just a single node.

    Usually you use the transformer like this::

       node = YourTransformer().visit(node)
    cCs�t|�D]�\}}t|t�rvg}|D]D}t|t�r\|�|�}|dkrFq"nt|t�s\|�|�q"|�|�q"||dd�<qt|t�r|�|�}|dkr�t||�qt|||�q|Sr)	rar
r(r;r�r|r?�delattrrT)r�rrG�	old_valueZ
new_valuesrrUrrrr�s&






zNodeTransformer.generic_visitN)rBr�r�r�rrrrrr��s#r�cCs|jSr�r)r�rrr�_getter�sr�cCs
||_dSrr�)r�rrrr�_setter�sr�c@seZdZdd�ZdS)�_ABCcCsft|t�sdS|tkrZz
|j}Wntk
r6YdSXt|t|�oXt|t�|d��St�||�S)NFr)	r
r�_const_typesrr>�_const_types_notr�r�__instancecheck__)r��instrrrrr��s

�z_ABC.__instancecheck__N)rBr�r�r�rrrrr��sr�cOsf|D]<}||jkrq|j�|�}|t|�krt|j�d|����q|tkrTt||�Stj|f|�|�S)Nz" got multiple values for argument )r<�indexr+rLrBr�r�__new__)r�rE�kwargs�key�posrrr�_new�s

r�c@seZdZdZeZdS)�Num)r_N�rBr�r�r<r�r�rrrrr��sr�)�	metaclassc@seZdZdZeZdS)rd�reNr�rrrrrd�srdc@seZdZdZeZdS)�Bytesr�Nr�rrrrr�sr�c@seZdZeZdS)�NameConstantN)rBr�r�r�r�rrrrr�sr�c@seZdZdZdd�ZdS)�EllipsisrcOs(|tkrtd|�|�Stj|f|�|�S)N.).)r�rr�)r�rEr�rrrr�szEllipsis.__new__N)rBr�r�r<r�rrrrr�sr�.)rr)TF)r\)T))r��_astrr6rMrWr]r`rarXrhrorrrxr^�objectr}r�r�r��propertyrr_rerr�r�r�rdr�r�r�r r!r"r4�bytes�boolr�r�r�rrrr�<module>sz�3
'#

#:>	
���py_compile.cpython-38.pyc000064400000016332151450073350011344 0ustar00U

&�.e �@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddddgZ
Gdd�de�ZGdd�dej
�Zd	d
�Zdd
d�Zddd�Zedkr�e�e��dS)zqRoutine to "compile" a .py file to a .pyc file.

This module has intimate knowledge of the format of .pyc files.
�N�compile�main�PyCompileError�PycInvalidationModec@s"eZdZdZddd�Zdd�ZdS)	ra�Exception raised when an error occurs while attempting to
    compile the file.

    To raise this exception, use

        raise PyCompileError(exc_type,exc_value,file[,msg])

    where

        exc_type:   exception type to be used in error message
                    type name can be accesses as class variable
                    'exc_type_name'

        exc_value:  exception value to be used in error message
                    can be accesses as class variable 'exc_value'

        file:       name of file being compiled to be used in error message
                    can be accesses as class variable 'file'

        msg:        string message to be written as error message
                    If no value is given, a default exception message will be
                    given, consistent with 'standard' py_compile output.
                    message (or default) can be accesses as class variable
                    'msg'

    �cCst|j}|tkr2d�t�||��}|�dd|�}nd||f}t�||pJ||||�||_||_	||_
|pl||_dS)NrzFile "<string>"z	File "%s"z
Sorry: %s: %s)�__name__�SyntaxError�join�	traceback�format_exception_only�replace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�self�exc_typerrrr�tbtext�errmsg�r�"/usr/lib64/python3.8/py_compile.pyr.s�zPyCompileError.__init__cCs|jS)N)r)rrrr�__str__>szPyCompileError.__str__N)r)r�
__module__�__qualname__�__doc__rrrrrrrs
c@seZdZdZdZdZdS)r���N)rrr�	TIMESTAMP�CHECKED_HASH�UNCHECKED_HASHrrrrrBscCs(tj�d�rtj�d�stjStjSdS)N�SOURCE_DATE_EPOCH�RPM_BUILD_ROOT)�os�environ�getrr!r rrrr�_get_default_invalidation_modeHs

�r(F���c
Cs�|dkrt�}|dkrL|dkr@|dkr*|nd}tjj||d�}ntj�|�}tj�|�rld}t|�|���n*tj�	|�r�tj�
|�s�d}t|�|���tj�d|�}	|	�
|�}
z|	j|
|p�||d	�}Wndtk
�r*}zDt|j||p�|�}
|d
k�r|�r|
�ntj�|
jd�WY�dSd}~XYnXz tj�|�}|�rJt�|�Wntk
�rbYnX|tjk�r�|	�|�}tj�||d|d
�}n"tj�|
�}tj�|||tjk�}tj� |�}tj�!|||�|S)a�Byte-compile one Python source file to Python bytecode.

    :param file: The source file name.
    :param cfile: The target byte compiled file name.  When not given, this
        defaults to the PEP 3147/PEP 488 location.
    :param dfile: Purported file name, i.e. the file name that shows up in
        error messages.  Defaults to the source file name.
    :param doraise: Flag indicating whether or not an exception should be
        raised when a compile error is found.  If an exception occurs and this
        flag is set to False, a string indicating the nature of the exception
        will be printed, and the function will return to the caller. If an
        exception occurs and this flag is set to True, a PyCompileError
        exception will be raised.
    :param optimize: The optimization level for the compiler.  Valid values
        are -1, 0, 1 and 2.  A value of -1 means to use the optimization
        level of the current interpreter, as given by -O command line options.
    :param invalidation_mode:
    :param quiet: Return full output with False or 0, errors only with 1,
        and no output with 2.

    :return: Path to the resulting byte compiled file.

    Note that it isn't necessary to byte-compile Python modules for
    execution efficiency -- Python itself byte-compiles a module when
    it is loaded, and if it can, writes out the bytecode to the
    corresponding .pyc file.

    However, if a Python installation is shared between users, it is a
    good idea to byte-compile all modules upon installation, since
    other users may not be able to write in the source directories,
    and thus they won't be able to write the .pyc file, and then
    they would be byte-compiling every module each time it is loaded.
    This can slow down program start-up considerably.

    See compileall.py for a script/module that uses this module to
    byte-compile all installed files (or all files in selected
    directories).

    Do note that FileExistsError is raised if cfile ends up pointing at a
    non-regular file or symlink. Because the compilation uses a file renaming,
    the resulting file would be regular and thus not the same type of file as
    it was previously.
    Nrrr)�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)�	_optimizer�
�mtime�size)"r(�	importlib�util�cache_from_sourcer%�path�islink�FileExistsError�format�exists�isfile�	machinery�SourceFileLoader�get_data�source_to_coder
r�	__class__�sys�stderr�writer�dirname�makedirsrr �
path_stats�_bootstrap_external�_code_to_timestamp_pyc�source_hash�_code_to_hash_pycr!�
_calc_mode�
_write_atomic)r�cfile�dfile�doraise�optimize�invalidation_mode�quietr*r�loader�source_bytes�code�err�py_excr@�source_stats�bytecoderE�moderrrrPsd-�
�


��cCs|dkrtjdd�}d}|dgkr�tj��}|s4q�|�d�}zt|dd�Wq$tk
r�}zd}tj�d|j	�W5d}~XYq$t
k
r�}zd}tj�d|�W5d}~XYq$Xq$nV|D]P}zt|dd�Wq�tk
�r}zd}tj�d|j	�W5d}~XYq�Xq�|S)	a�Compile several source files.

    The files named in 'args' (or on the command line, if 'args' is
    not specified) are compiled and the resulting bytecode is cached
    in the normal manner.  This function does not search a directory
    structure to locate source files; it only compiles files named
    explicitly.  If '-' is the only parameter in args, the list of
    files is taken from standard input.

    Nrr�-r,T)rKz%s
)r=�argv�stdin�readline�rstriprrr>r?r�OSError)�args�rv�filename�errorrrrr�s.


"&&�__main__)NNFr)Nr)N)r�enumZimportlib._bootstrap_externalr/�importlib.machinery�importlib.utilr%Zos.pathr=r
�__all__r
r�Enumrr(rrr�exitrrrr�<module>s&0�
a
&formatter.cpython-38.pyc000064400000042213151450073350011204 0ustar00U

e5d';�@s�dZddlZddlZejdedd�dZGdd�d�ZGdd	�d	�ZGd
d�d�ZGdd
�d
e�Z	Gdd�de�Z
ddd�Zedkr�e�dS)aGeneric output formatting.

Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor any sort
of ``change back'' operation. Specific writer properties which may be
controlled via formatter objects are horizontal alignment, font, and left
margin indentations. A mechanism is provided which supports providing
arbitrary, non-exclusive style settings to a writer as well. Additional
interfaces facilitate formatting events which are not reversible, such as
paragraph separation.

Writer objects encapsulate device interfaces. Abstract devices, such as
file formats, are supported as well as physical devices. The provided
implementations all work with abstract devices. The interface makes
available mechanisms for setting the properties which formatter objects
manage and inserting data into the output.
�Nz"the formatter module is deprecated�)�
stacklevelc@s�eZdZdZd(dd�Zdd�Zdd�Zd	d
�Zd)dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd*d$d%�Zd+d&d'�ZdS),�
NullFormattera=A formatter which does nothing.

    If the writer parameter is omitted, a NullWriter instance is created.
    No methods of the writer are called by NullFormatter instances.

    Implementations should inherit from this class if implementing a writer
    interface but don't need to inherit any implementation.

    NcCs|dkrt�}||_dS�N)�
NullWriter�writer��selfr�r
�!/usr/lib64/python3.8/formatter.py�__init__)szNullFormatter.__init__cCsdSrr
�r	�	blankliner
r
r�
end_paragraph-�zNullFormatter.end_paragraphcCsdSrr
�r	r
r
r�add_line_break.rzNullFormatter.add_line_breakcOsdSrr
�r	�args�kwr
r
r�add_hor_rule/rzNullFormatter.add_hor_rulecCsdSrr
�r	�format�counterrr
r
r�add_label_data0rzNullFormatter.add_label_datacCsdSrr
�r	�datar
r
r�add_flowing_data1rzNullFormatter.add_flowing_datacCsdSrr
rr
r
r�add_literal_data2rzNullFormatter.add_literal_datacCsdSrr
rr
r
r�flush_softspace3rzNullFormatter.flush_softspacecCsdSrr
�r	�alignr
r
r�push_alignment4rzNullFormatter.push_alignmentcCsdSrr
rr
r
r�
pop_alignment5rzNullFormatter.pop_alignmentcCsdSrr
)r	�xr
r
r�	push_font6rzNullFormatter.push_fontcCsdSrr
rr
r
r�pop_font7rzNullFormatter.pop_fontcCsdSrr
)r	�marginr
r
r�push_margin8rzNullFormatter.push_margincCsdSrr
rr
r
r�
pop_margin9rzNullFormatter.pop_margincCsdSrr
�r	�spacingr
r
r�set_spacing:rzNullFormatter.set_spacingcGsdSrr
�r	�stylesr
r
r�
push_style;rzNullFormatter.push_style�cCsdSrr
�r	�nr
r
r�	pop_style<rzNullFormatter.pop_stylecCsdSrr
�r	�flagr
r
r�assert_line_data=rzNullFormatter.assert_line_data)N)N)r0)r0)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rrs&



rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd.dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd/d*d+�Zd0d,d-�Zd
S)1�AbstractFormatterz�The standard formatter.

    This implementation has demonstrated wide applicability to many writers,
    and may be used directly in most circumstances.  It has been used to
    implement a full-featured World Wide Web browser.

    cCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_	d|_
d|_d|_dS�Nr0r)
rr!�align_stack�
font_stack�margin_stackr+�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_labelrr
r
rrNszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS�Nrr0)	rEr�send_line_breakrFrD�send_paragraphrArCrBr
r
r
rr]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dSrG)rErCrrHrFrDrArBrr
r
rrhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dSr<)	rErrH�
send_hor_rulerArFrCrBrDrr
r
rros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dSr<)
rFrErrHrCrI�
isinstance�str�send_label_data�format_counterrArBrDrr
r
rrvs

z AbstractFormatter.add_label_datacCstd}|D]f}|dkr"|d|}q|dkrD|dkrn||�||�}q|dkrf|dkrn||�||�}q||}q|S)N��1z%dZaArZiI)�
format_letter�format_roman)r	rr�label�cr
r
rrN�s
z AbstractFormatter.format_countercCs<d}|dkr8t|dd�\}}tt|�|�}||}q|S)NrOrr0�)�divmod�chr�ord)r	�caserrSr$�sr
r
rrQ�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}|d	kr�t|d
�\}}|dkrV||||d|}nT|d
krt|||||}n6|dkr�||}|d}nd}||||}||}|d}q|dkr�|��S|S)N�ir$rT�m�v�l�d)rOrr�
�	r0��rO�I)rV�upper)	r	rYrZonesZfivesrS�indexr$rZr
r
rrR�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr0���� r)�isspace�join�splitrArBrDrErCrFr�send_flowing_data)r	rZprespaceZ	postspacer
r
rr�s*

�z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)Nrhrg�
r)	rBrrlrErArCrDrF�send_literal_datarr
r
rr�s�z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS�Nrr0rh)rBrErCrDrFrArrlrr
r
rr�s�z!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dSr)r!r�
new_alignmentr=�appendr r
r
rr"�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS�Nrg)r=r!rrpr r
r
rr#�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr0rhrg)
rBrErCrArrlr>�AS_ISrq�new_font)
r	�font�sizer[�bZttZcsizeZci�cbZcttr
r
rr%�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dSrr)r>rrt�r	rur
r
rr&�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSr
r
��.0r\r
r
r�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rg)r?rqr�
new_margin�len)r	r'�fstackr
r
rr(s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrgcSsg|]}|r|�qSr
r
rzr
r
rr|
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r?rr}r~)r	rr'r
r
rr)
s
zAbstractFormatter.pop_margincCs||_|j�|�dSr)r+r�new_spacingr*r
r
rr,szAbstractFormatter.set_spacingcGsV|jr*d|_|_|_d|_|j�d�|D]}|j�|�q.|j�t	|j��dSro)
rBrErCrArrlr@rq�
new_styles�tuple)r	r.Zstyler
r
rr/szAbstractFormatter.push_styler0cCs$|j|d�=|j�t|j��dSr)r@rr�r�r1r
r
rr3!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS�Nr)rArErCrDrFr4r
r
rr6%sz"AbstractFormatter.assert_line_data)N)r0)r0)r7r8r9r:rrrrrrNrQrRrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rr;@s,

	
	
	
r;c@sxeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)raMinimal writer interface to use in testing & inheritance.

    A writer which only provides the interface definition; no actions are
    taken on any methods.  This should be the base class for all writers
    which do not need to inherit any implementation methods.

    cCsdSrr
rr
r
rr2rzNullWriter.__init__cCsdSrr
rr
r
r�flush3rzNullWriter.flushcCsdSrr
r r
r
rrp4rzNullWriter.new_alignmentcCsdSrr
ryr
r
rrt5rzNullWriter.new_fontcCsdSrr
�r	r'�levelr
r
rr}6rzNullWriter.new_margincCsdSrr
r*r
r
rr�7rzNullWriter.new_spacingcCsdSrr
r-r
r
rr�8rzNullWriter.new_stylescCsdSrr
r
r
r
rrI9rzNullWriter.send_paragraphcCsdSrr
rr
r
rrH:rzNullWriter.send_line_breakcOsdSrr
rr
r
rrJ;rzNullWriter.send_hor_rulecCsdSrr
rr
r
rrM<rzNullWriter.send_label_datacCsdSrr
rr
r
rrl=rzNullWriter.send_flowing_datacCsdSrr
rr
r
rrn>rzNullWriter.send_literal_dataN)r7r8r9r:rr�rprtr}r�r�rIrHrJrMrlrnr
r
r
rr*src@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�AbstractWriterz�A writer which can be used in debugging formatters, but not much else.

    Each method simply announces itself by printing its name and
    arguments on standard output.

    cCstd|f�dS)Nznew_alignment(%r)��printr r
r
rrpIszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r)r�ryr
r
rrtLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d)r�r�r
r
rr}OszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r)r�r*r
r
rr�RszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r)r�r-r
r
rr�UszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r)r�r
r
r
rrIXszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break()r�rr
r
rrH[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule()r�rr
r
rrJ^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r)r�rr
r
rrMaszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r)r�rr
r
rrldsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r)r�rr
r
rrngsz AbstractWriter.send_literal_dataN)r7r8r9r:rprtr}r�r�rIrHrJrMrlrnr
r
r
rr�Asr�c@sJeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�
DumbWritera;Simple writer class which writes output on the file object passed in
    as the file parameter or, if file is omitted, on standard output.  The
    output is simply word-wrapped to the number of columns specified by
    the maxcol parameter.  This class is suitable for reflowing a sequence
    of paragraphs.

    N�HcCs(|ptj|_||_t�|�|��dSr)�sys�stdout�file�maxcolrr�reset)r	r�r�r
r
rrts
zDumbWriter.__init__cCsd|_d|_dSr�)�col�atbreakrr
r
rr�zszDumbWriter.resetcCs |j�d|�d|_d|_dS�Nrmr�r��writer�r�r
r
r
rrI~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dSr�r�rr
r
rrH�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nrm�-r)r�r�r�r�r�rr
r
rrJ�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nrmrr0)r�r��rfindr��
expandtabsr~r�)r	rr[r
r
rrn�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}|��D]N}|rl|t|�|kr\|d�d}n|d�|d}||�|t|�}d}q6||_|d��|_dS)Nrrmrhr0rg)r�rir�r�r�r�rkr~)r	rr�r�r�r�Zwordr
r
rrl�s$zDumbWriter.send_flowing_data)Nr�)r7r8r9r:rr�rIrHrJrnrlr
r
r
rr�ks

r�cCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z,|D]"}|dkrb|�d�qJ|�|�qJW5|tjk	r�|��X|�d�dS)Nr0rmr)	r�r;�openr��argv�stdin�closerr)r��w�f�fp�liner
r
r�test�s


r��__main__)N)
r:r��warnings�warn�DeprecationWarningrsrr;rr�r�r�r7r
r
r
r�<module>s�"k*C
inspect.cpython-38.opt-2.pyc000064400000153635151450073350011621 0ustar00U

e5d��@s�dZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlmZddlmZmZe�Zej��D]\ZZeede<q�dZdd�Zd	d
�Zdd�Z d
d�Z!dd�Z"e#ed��rdd�Z$ndd�Z$e#ed��r&dd�Z%ndd�Z%dd�Z&dd�Z'dd�Z(dd �Z)d!d"�Z*d#d$�Z+d%d&�Z,d'd(�Z-d)d*�Z.d+d,�Z/d-d.�Z0d/d0�Z1d1d2�Z2d3d4�Z3d5d6�Z4d�d7d8�Z5ed9d:�Z6d;d<�Z7d=d>�Z8dd?�d@dA�Z9dBdC�Z:dDdE�Z;dFdG�Z<dHdI�Z=dJdK�Z>dLdM�Z?dNdO�Z@dPdQ�ZAd�dRdS�ZBiZCiZDd�dTdU�ZEdVdW�ZFdXdY�ZGGdZd[�d[eH�ZIGd\d]�d]�ZJd^d_�ZKd`da�ZLdbdc�ZMddde�ZNd�dgdh�ZOedidj�ZPdkdl�ZQedmdn�ZRdodp�ZSedqdr�ZTdsdt�ZUedudv�ZVdwdx�ZWd�dydz�ZXd{d|�ZYdddd}iieZd~d�d�d�d�d�d�d�eXfd�d��Z[eZd�d�d�d�d�d�fd�d��Z\d�d��Z]d�d��Z^d�d��Z_ed�d��Z`d�d��Zaed�d��Zbd�d�d��Zcd�d��Zded�d�ebje�Zfd�d�d��Zgd�d�d��Zhd�d��Zid�d�d��Zjd�d�d��Zkel�Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zremfd�d��Zsd�Ztd�Zud�Zvd�Zwd�d��Zxd�d��Zyd�Zzd�Z{d�Z|d�Z}d�d��Z~d�d„Ze�e�j��Z�e�e�j��Z�e�e�j�d��Z�e�e�e�ej�fZ�d�dńZ�d�d�dDŽZ�d�dɄZ�d�d˄Z�d�d̈́Z�d�dτZ�d�dфZ�d�d�dԄZ�d�d�dքZ��dd�d؄Z�d�d�dٜd�dۄZ�Gd�d݄d݃Z�Gd�d߄d߃Z�Gd�d�d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�d�e�d�e�d�e�d�e�d�iZ�Gd�d�d�Z�Gd�d�d�Z�Gd�d�d�Z�d�d�d�d�Z�d�d�Z�e�d�k�r�e��dS()zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�N)�
attrgetter)�
namedtuple�OrderedDictZCO_icCst|tj�S�N)�
isinstance�types�
ModuleType��object�r�/usr/lib64/python3.8/inspect.py�ismodule?sr
cCs
t|t�Sr)r�typer	rrr�isclassHsrcCst|tj�Sr)rr�
MethodTyper	rrr�ismethodPsrcCs:t|�st|�st|�rdSt|�}t|d�o8t|d�S)NF�__get__�__set__�rr�
isfunctionr�hasattr�r
�tprrr�ismethoddescriptorZsrcCs8t|�st|�st|�rdSt|�}t|d�p6t|d�S)NFr�
__delete__rrrrr�isdatadescriptornsr�MemberDescriptorTypecCst|tj�Sr)rrrr	rrr�ismemberdescriptor~srcCsdS�NFrr	rrrr�s�GetSetDescriptorTypecCst|tj�Sr)rrrr	rrr�isgetsetdescriptor�sr cCsdSrrr	rrrr �scCst|tj�Sr)rr�FunctionTyper	rrrr�srcCs6t|�r|j}qt�|�}t|�s&dSt|jj|@�Sr)r�__func__�	functools�_unwrap_partialr�bool�__code__�co_flags)�f�flagrrr�_has_code_flag�s
r*cCs
t|t�Sr)r*ZCO_GENERATOR��objrrr�isgeneratorfunction�sr-cCs
t|t�Sr)r*ZCO_COROUTINEr+rrr�iscoroutinefunction�sr.cCs
t|t�Sr)r*ZCO_ASYNC_GENERATORr+rrr�isasyncgenfunction�sr/cCst|tj�Sr)rr�AsyncGeneratorTyper	rrr�
isasyncgen�sr1cCst|tj�Sr)rr�
GeneratorTyper	rrr�isgenerator�sr3cCst|tj�Sr)rr�
CoroutineTyper	rrr�iscoroutine�sr5cCs6t|tj�p4t|tj�r(t|jjt@�p4t|tj	j
�Sr)rrr4r2r%�gi_coder'ZCO_ITERABLE_COROUTINE�collections�abc�	Awaitabler	rrr�isawaitable�s��r:cCst|tj�Sr)rr�
TracebackTyper	rrr�istraceback�sr<cCst|tj�Sr)rr�	FrameTyper	rrr�isframe�sr>cCst|tj�Sr)rr�CodeTyper	rrr�iscodesr@cCst|tj�Sr)rr�BuiltinFunctionTyper	rrr�	isbuiltinsrBcCs t|�pt|�pt|�pt|�Sr)rBrrrr	rrr�	isroutine&s���rCcCs�t|t�sdS|jt@rdStt|�tj�s0dSt|d�r>dS|j�	�D]\}}t
|dd�rHdSqH|jD]6}t
|dd�D]$}t
||d�}t
|dd�rzdSqzqjdS)NFT�__abstractmethods__�__isabstractmethod__r)rr�	__flags__�TPFLAGS_IS_ABSTRACT�
issubclassr8�ABCMetar�__dict__�items�getattr�	__bases__)r
�name�value�baserrr�
isabstract-s"



rQc	Cst|�r|ft|�}nd}g}t�}t|�}z:|jD].}|j��D]\}}t|tj	�rD|�
|�qDq6Wntk
r|YnX|D]~}	zt||	�}
|	|kr�t�Wn:tk
r�|D]}|	|jkr�|j|	}
q�q�Yq�YnX|r�||
�r�|�
|	|
f�|�
|	�q�|jdd�d�|S)NrcSs|dS)Nrr)Zpairrrr�<lambda>n�zgetmembers.<locals>.<lambda>��key)r�getmro�set�dirrMrJrKrr�DynamicClassAttribute�append�AttributeErrorrL�add�sort)r
Z	predicate�mro�results�	processed�namesrP�k�vrUrOrrr�
getmembersEs:




rd�	Attributezname kind defining_class objectcCsTt|�}tt|��}tdd�|D��}|f|}||}t|�}|D].}|j��D]\}}t|tj�rR|�	|�qRqDg}	t
�}
|D�]�}d}d}
d}||
k�rzz|dkr�td��t||�}
Wn"tk
r�}zW5d}~XYn�Xt|
d|�}||k�rzd}d}|D] }t||d�}||
k�r|}�q|D]B}z|�
||�}Wntk
�rXY�q(YnX||
k�r(|}�q(|dk	�rz|}|D]0}||jk�r~|j|}||k�r�|}�q��q~|dk�r�q�|
dk	�r�|
n|}t|ttjf��r�d}|}nFt|ttjf��rd}|}n*t|t��rd}|}nt|��r,d	}nd
}|	�	t||||��|
�|�q�|	S)Ncss|]}|ttfkr|VqdSr)rr
)�.0�clsrrr�	<genexpr>�sz'classify_class_attrs.<locals>.<genexpr>rJz)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)rVr�tuplerXrJrKrrrYrZrW�	ExceptionrL�__getattr__r[�staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyperjrCrer\)rgr^ZmetamroZclass_basesZ	all_basesrarPrbrc�resultr`rNZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_objr,�kindrrr�classify_class_attrsss�












rwcCs|jSr)�__mro__)rgrrrrV�srV��stopcs|�dkrdd�}n�fdd�}|}t|�|i}t��}||�rx|j}t|�}||ks`t|�|krntd�|���|||<q6|S)NcSs
t|d�S�N�__wrapped__�r�r(rrr�_is_wrapper�szunwrap.<locals>._is_wrappercst|d�o�|�Sr{r}r~ryrrrsz!wrapper loop when unwrapping {!r})�id�sys�getrecursionlimitr|�len�
ValueError�format)�funcrzrr(ZmemoZrecursion_limitZid_funcrryr�unwrap�s

r�cCs|��}t|�t|���Sr)�
expandtabsr��lstrip)�lineZexplinerrr�
indentsizesr�cCsNtj�|j�}|dkrdS|j�d�dd�D]}t||�}q.t|�sJdS|S)N�.���)r��modules�get�
__module__�__qualname__�splitrLr)r�rgrNrrr�
_findclasssr�c	Cst|�rT|jD]@}|tk	rz
|j}Wntk
r<YqYnX|dk	r|SqdSt|�r�|jj}|j}t|�r�t	t	||d�d�|jkr�|}n|j
}�n$t|�r�|j}t|�}|dks�t	||�|k	r�dSn�t
|��r|j}|j}t|��r|jd||jk�r|}n|j
}n�t|t��rP|j}|j}t|�}|dk�sJt	||�|k	�r�dSnnt|��sdt|��r�|j}|j}t	||�|k	�r�dSt|��r�t	|dd�}t|t��r�||k�r�||SndS|jD]F}zt	||�j}Wntk
�r�Y�q�YnX|dk	�r�|S�q�dS)Nr"r��	__slots__)rrxr
�__doc__r[rr"�__name__�__self__rL�	__class__rr�rBr�rrj�fgetrrrir�dict)r,rP�docrN�selfrgr��slotsrrr�_finddoc sn



�


�



r�c	Cshz
|j}Wntk
r YdSX|dkrRzt|�}Wnttfk
rPYdSXt|t�s`dSt|�Sr)r�r[r��	TypeErrorr�str�cleandoc)r
r�rrr�getdoc^s

r�cCs�z|���d�}Wntk
r(YdSXtj}|dd�D]*}t|���}|r<t|�|}t||�}q<|r||d��|d<|tjkr�tdt|��D]}|||d�||<q�|r�|ds�|�	�q�|r�|ds�|�	d�q�d�
|�SdS)N�
�rr�)r�r��UnicodeErrorr��maxsizer�r��min�range�pop�join)r��linesZmarginr�Zcontent�indent�irrrr�qs(

r�cCs�t|�r(t|dd�r|jStd�|���t|�rht|d�rZtj�	|j
�}t|dd�rZ|jStd�|���t|�rv|j}t
|�r�|j}t|�r�|j}t|�r�|j}t|�r�|jStd�t|�j���dS)N�__file__z{!r} is a built-in moduler�z{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})r
rLr�r�r�rrr�r�r�r�rr"rr&r<�tb_framer>�f_coder@�co_filenamerr�)r
�modulerrr�getfile�s.
�r�cCsTtj�|�}dd�tj��D�}|��|D]"\}}|�|�r,|d|�Sq,dS)NcSsg|]}t|�|f�qSr)r�)rf�suffixrrr�
<listcomp>�s�z!getmodulename.<locals>.<listcomp>)�os�path�basename�	importlib�	machinery�all_suffixesr]�endswith)r�Zfname�suffixesZneglenr�rrr�
getmodulename�s�
r�cs�t|��tjjdd�}|tjjdd�7}t�fdd�|D��r`tj���dtjj	d�nt�fdd�tjj
D��r~dStj���r��Stt
|��dd�dk	r��S�tjkr��SdS)Nc3s|]}��|�VqdSr�r��rf�s��filenamerrrh�sz getsourcefile.<locals>.<genexpr>rc3s|]}��|�VqdSrr�r�r�rrrh�s�
__loader__)r�r�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr�r��splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrL�	getmodule�	linecache�cache)r
Zall_bytecode_suffixesrr�r�
getsourcefile�s"
��
r�cCs,|dkrt|�pt|�}tj�tj�|��Sr)r�r�r�r��normcase�abspath)r
�	_filenamerrr�
getabsfile�sr�c
Cs�t|�r|St|d�r$tj�|j�S|dk	rD|tkrDtj�t|�Szt||�}Wntk
rhYdSX|tkr�tj�t|�Stj�	��
�D]\\}}t|�r�t|d�r�|j}|t�|d�kr�q�|t|<t|�}|j
t|<ttj�|�<q�|tk�rtj�t|�Stjd}t|d��s"dSt||j
��rJt||j
�}||k�rJ|Stjd}t||j
��r|t||j
�}	|	|k�r||SdS)Nr�r��__main__r��builtins)r
rr�r�r�r��
modulesbyfiler�r��copyrKr��_filesbymodnamer�r�r��realpathrL)
r
r��file�modnamer�r(�mainZ
mainobjectZbuiltinZ
builtinobjectrrrr��sJ
�

�




r�cCs�t|�}|rt�|�n$t|�}|�d�r4|�d�s<td��t||�}|rZt�||j	�}n
t�|�}|sptd��t
|�r�|dfSt|��r |j}t
�d|d�}g}tt|��D]F}|�||�}|r�||ddkr�||fS|�|�d	�|f�q�|�r|��||dd	fStd
��t|��r0|j}t|��r@|j}t|��rP|j}t|��r`|j}t|��r�t|d��s~td��|jd	}	t
�d
�}|	dk�r�z||	}
Wnt k
�r�td��YnX|�|
��rؐq�|	d	}	�q�||	fStd��dS)N�<�>zsource code not availablezcould not get source coderz^(\s*)class\s*z\b�cr�zcould not find class definition�co_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code object)!r�r��
checkcacher��
startswithr��OSErrorr��getlinesrJr
rr��re�compiler�r��matchrZ�groupr]rr"rr&r<r�r>r�r@rr��
IndexError)r
r�r�r�rNZpatZ
candidatesr�r��lnumr�rrr�
findsourcesf










r�c	Cs.zt|�\}}Wnttfk
r*YdSXt|�r�d}|rT|ddd�dkrTd}|t|�krz||��dkrz|d}qT|t|�kr�||dd�dkr�g}|}|t|�kr�||dd�dkr�|�||���|d}q�d�|�S�n>|dk�r*t	||�}|d}|dk�r*||�
�dd�dk�r*t	||�|k�r*||���
�g}|dk�r�|d}||���
�}|dd�dk�r�t	||�|k�r�|g|dd�<|d}|dk�r��q�||���
�}�qt|�r�|d��dk�r�g|dd�<�q�|�r |d��dk�r g|dd�<�q�d�|�SdS)	Nr�z#!r�)��#r�r�r�)r�r�r�r
r��striprZr�r�r�r�)r
r�r��startZcomments�endr�Zcommentrrr�getcommentsRsL
  

$�
$
r�c@seZdZdS)�
EndOfBlockN�r�r�r�rrrrr�sr�c@seZdZdd�Zdd�ZdS)�BlockFindercCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrFr�)r��islambda�started�passline�indecorator�decoratorhasargs�last�	body_col0�r�rrr�__init__�szBlockFinder.__init__cCsr|jsB|jsB|dkrd|_n|dkr8|dkr2d|_d|_d|_�n,|dkrZ|jrVd|_�n|dkrv|jrtd|_d|_n�|tjkr�d|_|d|_|jr�t�|jr�|js�d|_n�|jr�n�|tj	kr�|j
dkr�|jr�|d	|_
|jd	|_d|_n�|tjk�r|jd	|_|jdk�rnt�nV|tj
k�rL|j
dk	�rn|d	|j
k�rn|d|_n"|jdk�rn|tj
tjfk�rnt�dS)
N�@T)�def�class�lambdar�(�)Frr�)r�r�r�r�r��tokenize�NEWLINEr�r��INDENTr�r��DEDENT�COMMENT�NL)r�r�tokenZsrowcolZerowcolr�rrr�
tokeneater�sL





zBlockFinder.tokeneaterN)r�r�r�r�rrrrrr��s
r�c	CsVt�}z(t�t|�j�}|D]}|j|�qWnttfk
rFYnX|d|j�Sr)	r�r�generate_tokens�iter�__next__rr��IndentationErrorr�)r�Zblockfinder�tokensZ_tokenrrr�getblock�srcCsbt|�}t|�\}}t|�r"|j}t|�s>t|�rF|jjdkrF|dfSt||d��|dfSdS)Nz<module>rr�)	r�r�r<r�r
r>r��co_namer�r
r�r�rrr�getsourcelines�s�
�rcCst|�\}}d�|�S)Nr�)rr�rrrr�	getsource�srcCsRg}|jtdd�d�|D]2}|�||jf�||kr|�t||||��q|S)Nr�r�rT)r]rrZrM�walktree)�classes�children�parentr_r�rrrr�srFcCs�i}g}|D]d}|jr^|jD]>}||kr0g||<|||krJ||�|�|r||krqpqq||kr|�|�q|D]}||krv|�|�qvt||d�Sr)rMrZr)r�uniquer�rootsr�rrrr�getclasstree�s"	
r�	Argumentszargs, varargs, varkwc	Cs�t|�std�|���|j}|j}|j}t|d|��}t||||��}d}||7}d}|jt@rx|j|}|d}d}|jt	@r�|j|}t
||||�S)Nz{!r} is not a code objectrr�)r@r�r��co_varnames�co_argcount�co_kwonlyargcount�listr'�
CO_VARARGS�CO_VARKEYWORDSr)	�cora�nargsZnkwargs�args�
kwonlyargs�step�varargs�varkwrrr�getargss"



r,�ArgSpeczargs varargs keywords defaultscCsDtjdtdd�t|�\}}}}}}}|s.|r6td��t||||�S)Nzhinspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()r���
stacklevelzgFunction has keyword-only parameters or annotations, use inspect.signature() API which can support them)�warnings�warn�DeprecationWarning�getfullargspecr�r-)r�r'r*r+�defaultsr(�kwonlydefaults�annrrr�
getargspec-s��r7�FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc
Cs|zt|ddtd�}Wn,tk
r@}ztd�|�W5d}~XYnXg}d}d}g}g}d}i}	d}i}
|j|jk	r||j|	d<|j��D]�}|j}|j	}
|t
kr�|�|
�|j|jk	r�||jf7}nv|t
kr�|�|
�|j|jk	r�||jf7}nJ|tkr�|
}n<|tk�r*|�|
�|j|jk	�r8|j|
|
<n|tk�r8|
}|j|jk	r�|j|	|
<q�|
�sZd}
|�sdd}t|||||||
|	�S)NF��follow_wrapper_chains�skip_bound_arg�sigclszunsupported callabler�return)�_signature_from_callable�	Signaturernr��return_annotation�empty�
parameters�valuesrvrN�_POSITIONAL_ONLYrZ�default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr8)r��sig�exr'r*r+Zposonlyargsr(r4�annotations�
kwdefaults�paramrvrNrrrr3Nsb�






�r3�ArgInfozargs varargs keywords localscCs t|j�\}}}t||||j�Sr)r,r�rP�f_locals)�framer'r*r+rrr�getargvalues�srScCsVt|dd�dkr t|��dd�St|t�rN|jd|fkr>|jS|jd|jSt|�S)Nr��typingztyping.r�r�r�)rL�repr�replacerrr�r�)rJZbase_modulerrr�formatannotation�s
rWcst|dd���fdd�}|S)Nr�cs
t|��Sr)rW)rJ�r�rr�_formatannotation�sz5formatannotationrelativeto.<locals>._formatannotation)rL)r
rYrrXr�formatannotationrelativeto�srZrcCsd|S�N�*r�rNrrrrR�rSrRcCsd|S�N�**rr]rrrrR�rScCsdt|�S�N�=�rU�rOrrrrR�rScCsd|S)Nz -> r)�textrrrrR�rSc
s<ddlm}
|
dtdd����fdd�}g}|rBt|�t|�}t|�D]:\}}||�}|rz||krz||
|||�}|�|�qJ|dk	r�|�|||���n|r�|�d�|r�|D]2}||�}|r�||kr�||
||�7}|�|�q�|dk	�r|�|	||���d	d
�|�d}d�k�r8||��d��7}|S)
Nr)r1zc`formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directlyr�r.cs(�|�}|�kr$|d��|�7}|S)Nz: r)�argrt�rMrW�	formatargrr�formatargandannotation�sz-formatargspec.<locals>.formatargandannotationr\r�, rr=)r0r1r2r��	enumeraterZr�)r'r*r+r4r(r5rMrg�
formatvarargs�formatvarkw�formatvalueZ
formatreturnsrWr1rh�specsZfirstdefaultr�re�specZ	kwonlyargrtrrfr�
formatargspec�s<�


rpcCsd|Sr[rr]rrrrRrScCsd|Sr^rr]rrrrRrScCsdt|�Sr`rbrcrrrrRrScCs�|||fdd�}g}	tt|��D]}
|	�|||
��q |rV|	�||�|||��|rt|	�||�|||��dd�|	�dS)NcSs||�|||�Srr)rN�localsrgrmrrr�convertsz formatargvalues.<locals>.convertrrir)r�r�rZr�)r'r*r+rqrgrkrlrmrrrnr�rrr�formatargvaluess�
rscs��fdd�|D�}t|�}|dkr,|d}n>|dkr@dj|�}n*dj|dd��}|dd�=d	�|�|}td
|||rzdnd|dkr�d
nd|f��dS)Ncsg|]}|�krt|��qSrrb)rfrN�rCrrr�sz&_missing_arguments.<locals>.<listcomp>r�rr�z	{} and {}z, {} and {}���riz*%s() missing %i required %s argument%s: %s�
positional�keyword-onlyr�r�)r�r�r�r�)�f_nameZargnames�posrCra�missingr��tailrrtr�_missing_argumentss 


��r|c
	s�t|�|}t�fdd�|D��}|r:|dk}	d|f}
n2|rTd}	d|t|�f}
nt|�dk}	tt|��}
d}|r�d}||dkr�d	nd||dkr�d	ndf}td
||
|	r�d	nd|||dkr�|s�dndf��dS)
Ncsg|]}|�kr|�qSrr)rfrertrrr�)sz_too_many.<locals>.<listcomp>r�zat least %dTz
from %d to %dr�z7 positional argument%s (and %d keyword-only argument%s)r�z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)r�r�r�)
rxr'Zkwonlyr*ZdefcountZgivenrCZatleastZkwonly_givenZpluralrKZ
kwonly_sig�msgrrtr�	_too_many's*���r~cOst|�}|\}}}}}}	}
|j}i}t|�rB|jdk	rB|jf|}t|�}
t|�}|r^t|�nd}t|
|�}t|�D]}|||||<qt|r�t||d��||<t||�}|r�i||<|�	�D]T\}}||kr�|s�t
d||f��||||<q�||k�rt
d||f��|||<q�|
|k�r<|�s<t||||||
|�|
|k�r�|d||�}|D]}||k�rZt||d|��qZt
|||d��D] \}}||k�r�||||<�q�d}|D]6}||k�r�|	�r�||	k�r�|	|||<n|d7}�q�|�rt||d|�|S)Nrz*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTr�F)r3r�rr�r�r�r�rmrWrKr�r~r|rj)r�rvZnamedror'r*r+r4r(r5r6rxZ	arg2valueZnum_posZnum_argsZnum_defaults�nr�Zpossible_kwargs�kwrOZreqrerz�kwargrrr�getcallargs<sh
�
�
�



r��ClosureVarsz"nonlocals globals builtins unboundc	Cs�t|�r|j}t|�s$td�|���|j}|jdkr:i}ndd�t|j|j�D�}|j	}|�
dtj�}t
|�rt|j}i}i}t�}|jD]d}|dkr�q�z||||<Wq�tk
r�z||||<Wntk
r�|�|�YnXYq�Xq�t||||�S)N�{!r} is not a Python functioncSsi|]\}}||j�qSr)�
cell_contents)rf�varZcellrrr�
<dictcomp>�s�z"getclosurevars.<locals>.<dictcomp>�__builtins__)�None�True�False)rr"rr�r�r&�__closure__�zip�co_freevars�__globals__r�r�rJr
rW�co_names�KeyErrorr\r�)	r��codeZ
nonlocal_varsZ	global_nsZ
builtin_nsZglobal_varsZbuiltin_varsZ
unbound_namesrNrrr�getclosurevarszs>	
�
�r��	Tracebackz+filename lineno function code_context indexr�cCs�t|�r|j}|j}n|j}t|�s2td�|���t|�p@t|�}|dkr�|d|d}zt	|�\}}Wnt
k
r�d}}Yq�Xtdt|t
|�|��}||||�}|d|}nd}}t|||jj||�S)Nz'{!r} is not a frame or traceback objectrr�r�)r<�	tb_linenor��f_linenor>r�r�r�r�r�r��maxr�r�r�r�r)rR�context�linenor�r�r�r��indexrrr�getframeinfo�s$r�cCs|jSr)r��rRrrr�	getlineno�sr��	FrameInfor�cCs2g}|r.|ft||�}|�t|��|j}q|Sr)r�rZr��f_back)rRr��	framelist�	frameinforrr�getouterframes�sr�cCs4g}|r0|jft||�}|�t|��|j}q|Sr)r�r�rZr��tb_next)�tbr�r�r�rrr�getinnerframes�sr�cCsttd�rt�d�SdS)N�	_getframer�)rr�r�rrrr�currentframe�sr�cCstt�d�|�S)Nr�)r�r�r��r�rrr�stack�sr�cCstt��d|�S)Nr�)r�r��exc_infor�rrr�trace�sr�cCstjd�|�S)Nrx)rrJr)�klassrrr�_static_getmrosr�cCs8i}zt�|d�}Wntk
r(YnXt�||t�S�NrJ)r
�__getattribute__r[r�r��	_sentinel)r,�attrZ
instance_dictrrr�_check_instancesr�c	CsHt|�D]:}tt|��tkrz|j|WStk
r@YqXqtSr)r��_shadowed_dictrr�rJr�)r�r��entryrrr�_check_class
sr�cCs(zt|�Wntk
r"YdSXdS�NFT)r�r�r+rrr�_is_types
r�c	Csntjd}t|�D]V}z|�|�d}Wntk
r<YqXt|�tjkr`|jdkr`|j|ks|Sqt	Sr�)
rrJr�rr�rrr�rir�)r��	dict_attrr�Z
class_dictrrrr�s
��
r�c	Cst}t|�s>t|�}t|�}|tks2t|�tjkrBt||�}n|}t||�}|tk	r�|tk	r�tt|�d�tk	r�tt|�d�tk	r�|S|tk	r�|S|tk	r�|S||kr�tt|��D]:}tt|��tkr�z|j	|WSt
k
r�Yq�Xq�|tk	r�|St|��dS)Nrr)r�r�rr�rrr�r�r�rJr�r[)r,r�rEZinstance_resultr�r�Zklass_resultr�rrr�getattr_static+s:�
�r��GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�
GEN_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS�Nr�)�
gi_runningr��gi_framer��f_lastir�r�)�	generatorrrr�getgeneratorstate`s	
r�cCs:t|�std�|���t|dd�}|dk	r2|jjSiSdS)Nz{!r} is not a Python generatorr�)r3r�r�rLr�rQ)r�rRrrr�getgeneratorlocalsrsr��CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStSr�)�
cr_runningr��cr_framer�r�r�r�)�	coroutinerrr�getcoroutinestate�s	
r�cCs"t|dd�}|dk	r|jSiSdS)Nr�)rLrQ)r�rRrrr�getcoroutinelocals�sr��
from_bytescCs8zt||�}Wntk
r$YdSXt|t�s4|SdSr)rLr[r�_NonUserDefinedCallables)rgZmethod_nameZmethrrr�"_signature_get_user_defined_method�s
r�c
Cs�|j}t|���}|jpd}|jp$i}|r2||}z|j||�}Wn6tk
rx}zd�|�}	t|	�|�W5d}~XYnXd}
|��D]�\}}z|j	|}
Wnt
k
r�YnjX|jtkr�|�
|�q�|jtkr�||kr�d}
|j|
d�||<n|�
|j�q�|jtk�r|j|
d�||<|
r�|jtk�rN||jtd�}|||<|�|�q�|jttfk�rj|�|�q�|jtkr�|�
|j�q�|j|��d�S)Nrz+partial object {!r} has incorrect argumentsFT)rE�rv�rB)rBrrKr'�keywords�bind_partialr�r�r��	argumentsr�rvrDr�rFrVrNrH�move_to_endrIrGrC)�wrapped_sig�partialZ
extra_argsZ
old_params�
new_paramsZpartial_argsZpartial_keywordsZbarLr}Ztransform_to_kwonly�
param_namerOZ	arg_valueZ	new_paramrrr�_signature_get_partial�sL







r�cCslt|j���}|r$|djttfkr,td��|dj}|ttfkrP|dd�}n|t	k	r`td��|j
|d�S)Nrzinvalid method signaturer�zinvalid argument typer�)rmrBrCrvrIrHr�rFrDrGrV)rK�paramsrvrrr�_signature_bound_methods
r�cCs&t|�p$t|�p$t|t�p$|ttfkSr)rBrrr�rr
r+rrr�_signature_is_builtin.s��
�r�cCs�t|�rt|�rdSt|dd�}t|dd�}t|dt�}t|dt�}t|dd�}t|tj�o�t|t�o�|dksxt|t�o�|dks�t|t	�o�t|t	�S)NFr�r&�__defaults__�__kwdefaults__�__annotations__)
�callablerrL�_voidrrr?r�rmr�)r,rNr�r4rNrMrrr�_signature_is_functionlike:s ����r�cCs<|�d�}|dkr|�d�}|�d�}|�d�}|d|�S)N�,r�r�:rar�)�find)roryZcposrrr�_signature_get_bound_paramSs




r�cCs |s|ddfSd}d}dd�|�d�D�}t|�j}t�|�}d}d}g}|j}	d}
tj}tj}t|�}
|D]�}
|
j	|
j
}}||kr�|dkr�|r�d}qld}|
d7}
ql|d	kr�d}|
d}ql||kr�|d
kr�|
}ql|r�d}||kr�|dks�|	d�|	|�|dkrl|	d
�qld�|�}|||fS)NcSsg|]}|�d��qS)�ascii)�encode)rf�lrrrr�}sz6_signature_strip_non_python_syntax.<locals>.<listcomp>r�Frr�Tr��/�$rri� r�)r�rrrrZr�OP�
ERRORTOKEN�nextr�stringr�)�	signature�self_parameter�last_positional_onlyr�r�Ztoken_streamZ
delayed_commaZskip_next_commardr\Zcurrent_parameterr�r��trr��clean_signaturerrr�"_signature_strip_non_python_syntaxjsP





r�Tc	s`ddl�|j�t|�\}}}d|d}z��|�}Wntk
rNd}YnXt|�j�sjtd�|���|j	d}	g��j
�t��d}i�t|dd�}
|
r�t
j�|
d�}|r�|j�t
j���	�fdd�����	fdd	��
G��
fd
d�d�j���f��������fdd
�	}t|	jj�}t|	jj�}
tj||
dd�}|dk	�rJ�j�n�j�ttt|���D](\}\}}|||�||k�r`�j��q`|	jj�r��j�||	jj���j�t|	jj |	jj!�D]\}}|||��q�|	jj"�r�j#�||	jj"��|dk	�rRt|dd�}|dk	}t$|�}|�r8|�s,|�r8��%d�n�dj&�jd�}|�d<|�|j
d�S)Nrzdef fooz: passz"{!r} builtin has invalid signaturer�cs|jdk	rtd��|jS)Nz'Annotations are not currently supported)rJr�re)�node)�astrr�
parse_name�s
z&_signature_fromstr.<locals>.parse_namecs|zt|��}Wn>tk
rLzt|��}Wntk
rFt��YnXYnXt|tttttt	d�f�rr��
|�St��dSr)�eval�	NameError�RuntimeErrorrr��int�float�bytesr%rZConstant)r�rO)r��module_dict�sys_module_dictrr�
wrap_value�s
z&_signature_fromstr.<locals>.wrap_valuecs(eZdZ��fdd�Z��fdd�ZdS)z,_signature_fromstr.<locals>.RewriteSymbolicscs\g}|}t|�j�r(|�|j�|j}qt|�j�s:t��|�|j�d�t	|��}�|�S)Nr�)
rrerZr�rO�Namer�r�r��reversed)r�r��arrO�r�rrr�visit_Attribute�sz<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributecst|j�j�st���|j�Sr)rZctxZLoadr�r�)r�r�rrr�
visit_Name�sz7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r�r�r�r	r
rrrr�RewriteSymbolics�srcs��|�}|�krdS|rp|tk	rpz���|�}��|�}Wntk
rR�}YnX|�kr`dS|�k	rl|n|}���|�|�d��dS�N�rErJ)�_emptyZvisitZliteral_evalr�rZ)Z	name_nodeZdefault_noderErN�o)�	Parameterrr�rA�invalidrvrBr�rr�p�s
z_signature_fromstr.<locals>.p)�	fillvaluer�r��r@)'r��_parameter_clsr��parse�SyntaxErrorrZModuler�r�ZbodyrAr
rLr�r�r�rJr�ZNodeTransformerrr'r4�	itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDrjr"Zvararg�VAR_POSITIONAL�KEYWORD_ONLYr�r(Zkw_defaultsr��VAR_KEYWORDr
r�rV)rgr,r�r;r�r�r�Zprogramr�r(Zmodule_namerr'r4rr�rNrEZ_selfZself_isboundZ
self_ismoduler)rrr�rArrvrrBr�rrr�_signature_fromstr�sn�










rcCsBt|�std�|���t|dd�}|s4td�|���t||||�S)Nz%{!r} is not a Python builtin function�__text_signature__z#no signature found for builtin {!r})r�r�r�rLr�r)rgr�r;r�rrr�_signature_from_builtin<s�r!c	CsHd}t|�s(t|�rd}ntd�|���t|dd�}|rFt||||�S|j}|j}|j}|j	}|j
}	|d|�}
|j}||||�}|j}
|j
}|j}|r�t|�}nd}g}||}|	}|
d|�D]<}|r�tnt}|
�|t�}|�||||d��|r�|d8}q�t|
|d��D]L\}}|�r&tnt}|
�|t�}|�||||||d��|�r|d8}�q|jt@�r�|||}|
�|t�}|�|||td��|D]B}t}|dk	�r�|�|t�}|
�|t�}|�|||t|d���q�|jt@�r2||}|jt@�r
|d7}||}|
�|t�}|�|||td��|||
�d	t�|d
�S)NFTr�r r)rJrvr�)rJrvrEr=�r@�__validate_parameters__)rr�r�r�rLrrr&r r�co_posonlyargcountr!r�r�r�r�rDrFr�rrZrjr'r#rGrHr$rI)rgr�r;Zis_duck_functionr�rZ	func_codeZ	pos_countZ	arg_namesZ
posonly_countrvZkeyword_only_countZkeyword_onlyrMr4rNZpos_default_countrBZnon_default_countZposonly_leftrNrvrJ�offsetrEr�rrr�_signature_from_functionLs�

�

�
�

�
�
�r&)r:r;c
Cs�t|�std�|���t|tj�rDt|j|||d�}|r@t|�S|S|rtt	|dd�d�}t|tj�rtt||||d�Sz
|j
}Wntk
r�Yn&X|dk	r�t|t�s�td�|���|Sz
|j
}Wntk
r�YnvXt|tj��rLt|j|||d�}t||d�}t|j���d}|jtjk�r(|St|j���}|f|}	|j|	d	�St|��s`t|��rnt|||d
�St|��r�t|||d
�St|tj��r�t|j|||d�}t||�Sd}t|t��r�t t|�d�}
|
dk	�r�t|
|||d�}nJt |d�}|dk	�rt||||d�}n$t |d
�}|dk	�r4t||||d�}|dk�r@|j!dd�D]>}
z
|
j"}Wntk
�rpYnX|�rLt#|||�S�qLt|j!k�r@|j$t%j$k�r�|j&t%j&k�r�|�'t%�St(d�|���nrt|t)��s@t t|�d�}
|
dk	�r@zt|
|||d�}Wn8t(k
�r>}zd�|�}t(|�|�W5d}~XYnX|dk	�r\|�rXt|�S|St|tj*��r|d�|�}t(|��t(d�|���dS)Nz{!r} is not a callable objectr9cSs
t|d�S)N�
__signature__r}r~rrrrR�rSz*_signature_from_callable.<locals>.<lambda>ryz1unexpected object {!r} in __signature__ attributerrr�)r;�__call__�__new__r�r�z(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature)+r�r�r�rrrr>r"r�r�r'r[r?�_partialmethodr#�
partialmethodr�r�rmrBrCrvrrrVrr�r&r�r!r�rr�rxr rr�r
r)�
from_callabler�r�rA)r,r:r;r<rKr+r�Zfirst_wrapped_paramZ
sig_paramsr�Zcall�newZinitrPZtext_sigrLr}rrrr>�s	��

��
�
�
��

�

�

�


�
�
�



r>c@seZdZdS)r�Nr�rrrrr�t	sr�c@seZdZdS)rNr�rrrrrx	src@s4eZdZdZdZdZdZdZdd�Ze	dd	��Z
d
S)�_ParameterKindrr�r���cCs|jSr)�_name_r�rrr�__str__�	sz_ParameterKind.__str__cCst|Sr)�_PARAM_NAME_MAPPINGr�rrr�description�	sz_ParameterKind.descriptionN)r�r�r�rrrrrr2rjr4rrrrr.|	sr.zpositional-onlyzpositional or keywordzvariadic positionalrwzvariadic keywordc@s�eZdZdZeZeZeZ	e
ZeZ
eZeed�dd�Zdd�Zdd�Zed	d
��Zedd��Zed
d��Zedd��Zeeeed�dd�Zdd�Zdd�Zdd�Zdd�ZdS)r)�_name�_kind�_default�_annotationr
cCszt|�|_Wn$tk
r2td|�d���YnX|tk	rd|jttfkrdd}|�|jj�}t|��||_||_	|tkr�td��t
|t�s�d�t|�j
�}t|��|ddkr�|dd���r�|jtkr�d	}|�|jj�}t|��t|_d
�|dd��}|���std�|���||_dS)Nzvalue z is not a valid Parameter.kindz({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {}rr�r�zLimplicit arguments must be passed as positional or keyword arguments, not {}z
implicit{}z"{!r} is not a valid parameter name)r.r6r�rrGrIr�r4r7r8rr�rr�r��isdigitrFrD�isidentifierr5)r�rNrvrErJr}rrrr��	s6

�
zParameter.__init__cCs t|�|j|jf|j|jd�fS)N�r7r8)rr5r6r7r8r�rrr�
__reduce__�	s
��zParameter.__reduce__cCs|d|_|d|_dS)Nr7r8r;�r��staterrr�__setstate__�	s
zParameter.__setstate__cCs|jSr)r5r�rrrrN�	szParameter.namecCs|jSr)r7r�rrrrE�	szParameter.defaultcCs|jSr)r8r�rrrrJ�	szParameter.annotationcCs|jSr)r6r�rrrrv�	szParameter.kind)rNrvrJrEcCsL|tkr|j}|tkr|j}|tkr*|j}|tkr8|j}t|�||||d�Sr)r�r5r6r8r7r)r�rNrvrJrErrrrV�	szParameter.replacecCs�|j}|j}|jtk	r(d�|t|j��}|jtk	rb|jtk	rPd�|t|j��}nd�|t|j��}|tkrtd|}n|t	kr�d|}|S)Nz{}: {}z{} = {}z{}={}r\r_)
rvr5r8rr�rWr7rUrGrI)r�rv�	formattedrrrr2
s
�


zParameter.__str__cCsd�|jj|�S)Nz	<{} "{}">�r�r�r�r�rrr�__repr__#
szParameter.__repr__cCst|j|j|j|jf�Sr)�hashrNrvrJrEr�rrr�__hash__&
szParameter.__hash__cCsJ||krdSt|t�stS|j|jkoH|j|jkoH|j|jkoH|j|jkS�NT)rr�NotImplementedr5r6r7r8�r��otherrrr�__eq__)
s

�
�
�zParameter.__eq__N)r�r�r�r�rDrrFrrGrrHrrIrrrAr�r<r?rjrNrErJrvr�rVr2rBrDrIrrrrr�	s4(



�rc@sdeZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)�BoundArguments)r��
_signature�__weakref__cCs||_||_dSr)r�rK)r�r�r�rrrr�G
szBoundArguments.__init__cCs|jSr)rKr�rrrr�K
szBoundArguments.signaturec	Cs~g}|jj��D]d\}}|jttfkr*qvz|j|}Wntk
rRYqvYqX|jtkrj|�	|�q|�
|�qt|�Sr)rKrBrKrvrIrHr�r�rG�extendrZrm)r�r'r�rOrerrrr'O
s
zBoundArguments.argsc	Cs�i}d}|jj��D]x\}}|sD|jttfkr4d}n||jkrDd}q|sJqz|j|}Wntk
rlYqX|jtkr�|�|�q|||<q|Sr�)	rKrBrKrvrIrHr�r��update)r��kwargsZkwargs_startedr�rOrerrrrOf
s&


zBoundArguments.kwargsc	Cs�|j}g}|jj��D]x\}}z|�|||f�Wqtk
r�|jtk	rV|j}n$|jt	krfd}n|jt
krvi}nYq|�||f�YqXqt|�|_dS)Nr)r�rKrBrKrZr�rErrvrGrIr)r�r�Z
new_argumentsrNrO�valrrr�apply_defaults�
s	


zBoundArguments.apply_defaultscCs2||krdSt|t�stS|j|jko0|j|jkSrE)rrJrFr�r�rGrrrrI�
s

�zBoundArguments.__eq__cCs|d|_|d|_dS)NrKr��rKr�r=rrrr?�
s
zBoundArguments.__setstate__cCs|j|jd�S)NrRrRr�rrr�__getstate__�
szBoundArguments.__getstate__cCs@g}|j��D]\}}|�d�||��qd�|jjd�|��S)Nz{}={!r}z	<{} ({})>ri)r�rKrZr�r�r�r�)r�r'rerOrrrrB�
szBoundArguments.__repr__N)r�r�r�r�r�rjr�r'rOrQrIr?rSrBrrrrrJ4
s


rJc@s�eZdZdZeZeZeZ	d+edd�dd�Z
edd��Zed	d
��Z
edd�dd
��Zedd��Zedd��Zeed�dd�Zdd�Zdd�Zdd�Zdd�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZdS),r?)�_return_annotation�_parametersNTr"cCs�|dkrt�}n�|r�t�}t}d}t|�D]�\}}|j}	|j}
|	|krdd}|�|j|	j�}t|��n|	|krtd}|	}|	ttfkr�|j	t
kr�|r�d}t|��nd}|
|kr�d�|
�}t|��|||
<q*ntdd�|D��}t�|�|_
||_dS)NFz7wrong parameter order: {} parameter before {} parameterz-non-default argument follows default argumentTzduplicate parameter name: {!r}css|]}|j|fVqdSrr]�rfrOrrrrhs�z%Signature.__init__.<locals>.<genexpr>)rrDrjrvrNr�r4r�rFrErr�MappingProxyTyperUrT)r�rBr@r#r�Ztop_kindZ
kind_defaults�idxrOrvrNr}rrrr��
sD��



�zSignature.__init__cCstjdtdd�t||�S)Nz_inspect.Signature.from_function() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r&�rgr�rrr�
from_functions
�zSignature.from_functioncCstjdtdd�t||�S)Nz^inspect.Signature.from_builtin() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r!rYrrr�from_builtins
�zSignature.from_builtin��follow_wrappedcCst|||d�S)N)r<r:)r>)rgr,r]rrrr,#s�zSignature.from_callablecCs|jSr)rUr�rrrrB)szSignature.parameterscCs|jSr�rTr�rrrr@-szSignature.return_annotation)rBr@cCs0|tkr|j��}|tkr |j}t|�||d�S)Nr)r�rBrCrTr)r�rBr@rrrrV1s
�zSignature.replacecCs8tdd�|j��D��}dd�|j��D�}|||jfS)Ncss|]}|jtkr|VqdSr)rvrHrVrrrrhAs
�z(Signature._hash_basis.<locals>.<genexpr>cSsi|]}|jtkr|j|�qSr)rvrHrNrVrrrr�Ds
�z)Signature._hash_basis.<locals>.<dictcomp>)rmrBrCr@)r�r��
kwo_paramsrrr�_hash_basis@szSignature._hash_basiscCs(|��\}}}t|���}t|||f�Sr)r`�	frozensetrCrC)r�r�r_r@rrrrDIszSignature.__hash__cCs*||krdSt|t�stS|��|��kSrE)rr?rFr`rGrrrrINs

zSignature.__eq__F�r�cCs�t�}t|j���}d}t|�}zt|�}Wn�tk
�rzt|�}	Wntk
rfYY�q�Yn�X|	jtkrzY�q�n�|	j|kr�|	jt	kr�d}
|
j
|	jd�}
t|
�d�|	f}Y�q�nP|	jtks�|	j
tk	r�|	f}Y�q�n.|r�|	f}Y�q�nd}
|
j
|	jd�}
t|
�d�Yq Xzt|�}	Wn tk
�r:td�d�Yq X|	jttfk�rVtd�d�|	jtk�r�|g}|�|�t|�||	j<�q�|	j|k�r�|	jt	k�r�tdj
|	jd��d�|||	j<q d}t�||�D]�}	|	jtk�r�|	}�q�|	jtk�r�q�|	j}
z|�|
�}WnFtk
�rN|�sJ|	jtk�rJ|	j
tk�rJtdj
|
d��d�Yn(X|	jt	k�rntdj
|	jd���|||
<�q�|�r�|dk	�r�|||j<ntdj
tt|��d���|�||�S)NrzA{arg!r} parameter is positional only, but was passed as a keyword)rez$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rrrBrCr��
StopIterationrvrGrNrDr�r�rIrErrHrMrmr�chainr�r��_bound_arguments_cls)r�r'rOr�r�rBZ
parameters_exZarg_valsZarg_valrOr}rCZkwargs_paramr�rrr�_bindUs�




���
�������

��zSignature._bindcOs|�||�Sr�rf�r�r'rOrrr�bind�szSignature.bindcOs|j||dd�S)NTrbrgrhrrrr��szSignature.bind_partialcCs t|�t|j���fd|jifS�NrT)rrmrUrCrTr�rrrr<�s�zSignature.__reduce__cCs|d|_dSrjr^r=rrrr?�szSignature.__setstate__cCsd�|jj|�S)Nz<{} {}>rAr�rrrrB�szSignature.__repr__c	Cs�g}d}d}|j��D]d}t|�}|j}|tkr6d}n|rH|�d�d}|tkrVd}n|tkrp|rp|�d�d}|�|�q|r�|�d�d�d�	|��}|j
tk	r�t|j
�}|d�|�7}|S)NFTr�r\z({})riz -> {})
rBrCr�rvrDrZrGrHr�r�r@rrW)	r�rtZrender_pos_only_separatorZrender_kw_only_separatorrOr@rvZrenderedZannorrrr2�s0




zSignature.__str__)N)r�r�r�r�rrrJrerrAr�rrrZr[r,rjrBr@r�rVr`rDrIrfrir�r<r?rBr2rrrrr?�
s:�7



	r?r\cCstj||d�S)Nr\)r?r,)r,r]rrrr�sr�c
Cs�ddl}ddl}|��}|jddd�|jddddd	�|��}|j}|�d
�\}}}z|�|�}}	WnNtk
r�}
z0d�	|t
|
�j|
�}t|t
jd�t
�d
�W5d}
~
XYnX|r�|�d�}|	}|D]}
t||
�}q�|	jt
jk�rtdt
jd�t
�d�|j�r�td�	|��td�	t|	���td�	|	j��||	k�rxtd�	t|	j���t|	d��r�td�	|	j��n6zt|�\}}Wntk
�r�YnXtd�	|��td�ntt|��dS)Nrr
zCThe object to be analysed. It supports the 'module:qualname' syntax)�helpz-dz	--details�
store_truez9Display info about the module rather than its source code)�actionrkr�zFailed to import {} ({}: {}))r�r�r�z#Can't get info for builtin modules.r�z
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r�)�argparser��ArgumentParser�add_argument�
parse_argsr
�	partition�
import_modulernr�rr��printr��stderr�exitr�rL�builtin_module_namesZdetailsr��
__cached__rUr�rrnr�r)ror��parserr'�targetZmod_nameZ	has_attrs�attrsr,r�rur}�parts�part�__r�rrr�_main$s`���



r�r�)N)N)N)F)N)r�)r�)r�)r�)r�)r)T)T)T)��
__author__r8�disZcollections.abcr7�enum�importlib.machineryr�rr�r�r�r�rrrr0r#r��operatorrrr�globalsZmod_dictZCOMPILER_FLAG_NAMESrKrbrcrGr
rrrrrrr rr*r-r.r/r1r3r5r:r<r>r@rBrCrQrdrerwrVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rnr�r�rrrrrrr,r-r7r8r3rPrSrWrZr�rprsr|r~r�r�r�r�r�r��_fieldsr�r�r�r�r�r�r
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr(Z_WrapperDescriptor�allZ_MethodWrapperr�rJZ_ClassMethodWrapperrAr�r�r�r�r�r�r�r�rr!r&r>r�r�IntEnumr.rrDrrFrrGrrHrrIr3rrJr?r�r�r�rrrr�<module>sx	




	
,
t$
>
	
.N->




�]


	�
;�
<
5

 



		0

�
LH

_�K�	k:
nturl2path.cpython-38.opt-1.pyc000064400000003322151450073350012241 0ustar00U

e5dG�@sdZdd�Zdd�ZdS)z�Convert a NT pathname to a file URL and vice versa.

This module only exists to provide OS-specific code
for urllib.requests, thus do not use directly.
cCs�ddl}ddl}|�dd�}d|kr\|dd�dkr@|dd�}|�d�}|j�d	�|��S|�d�}t|�dks�|dd
|jkr�d|}t	|��|dd
�
�}|d�d�}|d}|D]}|r�|d	|j�|�}q�|�d�r�|�d�r�|d	7}|S)
z{OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use.�N�:�|�z////��/�\���z	Bad URL: �)�string�urllib.parse�replace�split�parseZunquote�join�lenZ
ascii_letters�OSError�upper�endswith)Zurlr
�urllib�
components�comp�error�drive�path�r�"/usr/lib64/python3.8/nturl2path.py�url2pathnames(	

rcCs4ddl}|dd�dkrf|dd�}|dd���dkrJd|dd�}n|dd�d	krftd
|��d	|kr�|dd�dkr�d|}|�d�}|j�d�|��S|jd	dd
�}t|�dks�t|d�dkr�d
|}t|��|j�|d���}|d�d�}d|d	}|D] }|�r|d|j�|�}�q|S)z{OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use.rNrz\\?\zUNC\rr	rrz
Bad path: z\\r)�maxsplitz///)rrrr
rZquoterr)�prrrrrrrrr�pathname2url-s.
rN)�__doc__rrrrrr�<module>s%glob.cpython-38.pyc000064400000010371151450073350010124 0ustar00U

e5dA�@s�dZddlZddlZddlZddlZdddgZdd�dd�Zdd�d	d�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Ze�d�Ze�d�Zdd�Zdd�Zd d!�Zd"d�ZdS)#zFilename globbing utility.�N�glob�iglob�escapeF��	recursivecCstt||d��S)ayReturn a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    r)�listr)�pathnamer�r	�/usr/lib64/python3.8/glob.pyr
scCs:t�d||�t||d�}|r6t|�r6t|�}|r6t�|S)a�Return an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    z	glob.globF)�sys�audit�_iglob�_isrecursive�next�AssertionError)rr�it�sr	r	r
rsccstj�|�\}}t|�sN|r t�|r8tj�|�rJ|Vntj�|�rJ|VdS|s�|rrt|�rrt|||�EdHnt	|||�EdHdS||kr�t|�r�t
||d�}n|g}t|�r�|r�t|�r�t}q�t	}nt}|D]&}||||�D]}tj�||�Vq�q�dS)NT)
�os�path�split�	has_magicr�lexists�isdirr�_glob2�_glob1r
�_glob0�join)rr�dironly�dirname�basename�dirsZglob_in_dir�namer	r	r
r
)s2r
cCs0tt||��}t|�s$dd�|D�}t�||�S)Ncss|]}t|�s|VqdS�N)�	_ishidden)�.0�xr	r	r
�	<genexpr>Tsz_glob1.<locals>.<genexpr>)r�_iterdirr#�fnmatch�filter)r�patternr�namesr	r	r
rQsrcCs8|stj�|�r4|gSntj�tj�||��r4|gSgSr")rrrrr)rrrr	r	r
rWsrcCst||d�S�NF)r�rr*r	r	r
�glob0dsr.cCst||d�Sr,)rr-r	r	r
�glob1gsr/ccs.t|�st�|dd�Vt||�EdHdS)Nr)rr�	_rlistdir)rr*rr	r	r
rmsrc
cs�|s"t|t�rttjd�}ntj}zRt�|��>}|D]2}z|rF|��rN|jVWq4tk
rdYq4Xq4W5QRXWntk
r�YdSXdS)N�ASCII)�
isinstance�bytesr�curdir�scandir�is_dirr!�OSError)rrr�entryr	r	r
r'ts
r'ccs`tt||��}|D]H}t|�s|V|r6tj�||�n|}t||�D]}tj�||�VqDqdSr")rr'r#rrrr0)rrr+r%r�yr	r	r
r0�sr0z([*?[])s([*?[])cCs(t|t�rt�|�}n
t�|�}|dk	Sr")r2r3�magic_check_bytes�search�magic_check)r�matchr	r	r
r�s

rcCs|ddkS)Nr)�.�.r	)rr	r	r
r#�sr#cCst|t�r|dkS|dkSdS)Ns**z**)r2r3)r*r	r	r
r�s
rcCs<tj�|�\}}t|t�r(t�d|�}nt�d|�}||S)z#Escape all special characters.
    s[\1]z[\1])rr�
splitdriver2r3r:�subr<)rZdriver	r	r
r�s

)�__doc__r�rer(r�__all__rrr
rrr.r/rr'r0�compiler<r:rr#rrr	r	r	r
�<module>s*

(



code.cpython-38.opt-1.pyc000064400000023273151450073350011057 0ustar00U

e5d~)�@s�dZddlZddlZddlmZmZddddgZGdd�d�ZGd	d�de�Zdd
d�Z	e
dkr�ddlZe��Z
e
jdd
dd�e
��Zejs�ejjr�dZndZe	e�dS)z?Utilities needed to emulate Python's interactive interpreter.

�N)�CommandCompiler�compile_command�InteractiveInterpreter�InteractiveConsole�interactrc@sFeZdZdZddd�Zddd�Zd	d
�Zddd�Zd
d�Zdd�Z	dS)rz�Base class for InteractiveConsole.

    This class deals with parsing and interpreter state (the user's
    namespace); it doesn't deal with input buffering or prompting or
    input file naming (the filename is always passed in explicitly).

    NcCs$|dkrddd�}||_t�|_dS)aConstructor.

        The optional 'locals' argument specifies the dictionary in
        which code will be executed; it defaults to a newly created
        dictionary with key "__name__" set to "__console__" and key
        "__doc__" set to None.

        NZ__console__)�__name__�__doc__)�localsr�compile)�selfr	�r�/usr/lib64/python3.8/code.py�__init__s	
zInteractiveInterpreter.__init__�<input>�singlec
CsTz|�|||�}Wn&tttfk
r8|�|�YdSX|dkrFdS|�|�dS)a�Compile and run some source in the interpreter.

        Arguments are as for compile_command().

        One of several things can happen:

        1) The input is incorrect; compile_command() raised an
        exception (SyntaxError or OverflowError).  A syntax traceback
        will be printed by calling the showsyntaxerror() method.

        2) The input is incomplete, and more input is required;
        compile_command() returned None.  Nothing happens.

        3) The input is complete; compile_command() returned a code
        object.  The code is executed by calling self.runcode() (which
        also handles run-time exceptions, except for SystemExit).

        The return value is True in case 2, False in the other cases (unless
        an exception is raised).  The return value can be used to
        decide whether to use sys.ps1 or sys.ps2 to prompt the next
        line.

        FNT)r
�
OverflowError�SyntaxError�
ValueError�showsyntaxerror�runcode)r�source�filenameZsymbol�coderrr
�	runsource&s

z InteractiveInterpreter.runsourcecCs>zt||j�Wn(tk
r&�Yn|��YnXdS)a�Execute a code object.

        When an exception occurs, self.showtraceback() is called to
        display a traceback.  All exceptions are caught except
        SystemExit, which is reraised.

        A note about KeyboardInterrupt: this exception may occur
        elsewhere in this code, and may not always be caught.  The
        caller should be prepared to deal with it.

        N)�execr	�
SystemExit�
showtraceback)rrrrr
rMszInteractiveInterpreter.runcodecCs�t��\}}}|t_|t_|t_|rp|tkrpz|j\}\}}}}	Wntk
rVYnXt|||||	f�}|t_tjtj	kr�t
�||�}
|�d�
|
��nt�|||�dS)apDisplay the syntax error that just occurred.

        This doesn't display a stack trace because there isn't one.

        If a filename is given, it is stuffed in the exception instead
        of what was there before (because Python's parser always uses
        "<string>" when reading from a string).

        The output is written by self.write(), below.

        �N)�sys�exc_info�	last_type�
last_value�last_tracebackr�argsr�
excepthook�__excepthook__�	traceback�format_exception_only�write�join)rr�type�value�tb�msgZdummy_filename�lineno�offset�line�linesrrr
r`sz&InteractiveInterpreter.showsyntaxerrorcCs|t��\t_t_}}|t_zPt�|d|d|j�}tjtj	krT|�
d�|��nt�|d|d|�W5d}}XdS)z�Display the exception that just occurred.

        We remove the first stack item because it is our own code.

        The output is written by self.write(), below.

        Nr�r)rrr r!r"r&�format_exception�tb_nextr$r%r(r))rZlast_tbZeir1rrr
r�sz$InteractiveInterpreter.showtracebackcCstj�|�dS)z�Write a string.

        The base implementation writes to sys.stderr; a subclass may
        replace this with a different implementation.

        N)r�stderrr()r�datarrr
r(�szInteractiveInterpreter.write)N)rr)N)
r�
__module__�__qualname__rrrrrrr(rrrr
rs

'
#c@s>eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
d�ZdS)rz�Closely emulate the behavior of the interactive Python interpreter.

    This class builds on InteractiveInterpreter and adds prompting
    using the familiar sys.ps1 and sys.ps2, and input buffering.

    N�	<console>cCst�||�||_|��dS)z�Constructor.

        The optional locals argument will be passed to the
        InteractiveInterpreter base class.

        The optional filename argument should specify the (file)name
        of the input stream; it will show up in tracebacks.

        N)rrr�resetbuffer)rr	rrrr
r�s
zInteractiveConsole.__init__cCs
g|_dS)zReset the input buffer.N)�buffer)rrrr
r:�szInteractiveConsole.resetbuffercCsRz
tjWntk
r$dt_YnXz
tjWntk
rJdt_YnXd}|dkrx|�dtjtj||jjf�n|r�|�dt	|��d}zV|r�tj}ntj}z|�
|�}Wn&tk
r�|�d�YW�qYnX|�|�}Wq�t
k
�r|�d	�|��d}Yq�Xq�|dk�r6|�d
|jj�n|dk�rN|�d|�dS)a�Closely emulate the interactive Python console.

        The optional banner argument specifies the banner to print
        before the first interaction; by default it prints a banner
        similar to the one printed by the real Python interpreter,
        followed by the current class name in parentheses (so as not
        to confuse this with the real interpreter -- since it's so
        close!).

        The optional exitmsg argument specifies the exit message
        printed when exiting. Pass the empty string to suppress
        printing an exit message. If exitmsg is not given or None,
        a default message is printed.

        z>>> z... zFType "help", "copyright", "credits" or "license" for more information.NzPython %s on %s
%s
(%s)
z%s
r�
z
KeyboardInterrupt
znow exiting %s...
r)rZps1�AttributeErrorZps2r(�version�platform�	__class__r�str�	raw_input�EOFError�push�KeyboardInterruptr:)r�banner�exitmsgZcprt�more�promptr0rrr
r�sH


��



zInteractiveConsole.interactcCs6|j�|�d�|j�}|�||j�}|s2|��|S)aPush a line to the interpreter.

        The line should not have a trailing newline; it may have
        internal newlines.  The line is appended to a buffer and the
        interpreter's runsource() method is called with the
        concatenated contents of the buffer as source.  If this
        indicates that the command was executed or invalid, the buffer
        is reset; otherwise, the command is incomplete, and the buffer
        is left as it was after the line was appended.  The return
        value is 1 if more input is required, 0 if the line was dealt
        with in some way (this is the same as runsource()).

        r<)r;�appendr)rrr:)rr0rrHrrr
rD�szInteractiveConsole.pushrcCst|�S)aDWrite a prompt and read a line.

        The returned line does not include the trailing newline.
        When the user enters the EOF key sequence, EOFError is raised.

        The base implementation uses the built-in function
        input(); a subclass may replace this with a different
        implementation.

        )�input)rrIrrr
rBszInteractiveConsole.raw_input)Nr9)NN)r)	rr7r8rrr:rrDrBrrrr
r�s

6cCsJt|�}|dk	r||_n"zddl}Wntk
r8YnX|�||�dS)a&Closely emulate the interactive Python interpreter.

    This is a backwards compatible interface to the InteractiveConsole
    class.  When readfunc is not specified, it attempts to import the
    readline module to enable GNU readline if it is available.

    Arguments (all optional, all default to None):

    banner -- passed to InteractiveConsole.interact()
    readfunc -- if not None, replaces InteractiveConsole.raw_input()
    local -- passed to InteractiveInterpreter.__init__()
    exitmsg -- passed to InteractiveConsole.interact()

    Nr)rrB�readline�ImportErrorr)rFZreadfuncZlocalrGZconsolerLrrr
rs�__main__z-q�
store_truez*don't print version and copyright messages)�action�helpr)NNNN)rrr&Zcodeoprr�__all__rrrr�argparse�ArgumentParser�parser�add_argument�
parse_argsr#�q�flags�quietrFrrrr
�<module>s*�t
�colorsys.cpython-38.opt-2.pyc000064400000005114151450073350012015 0ustar00U

e5d��@sXddddddgZdZdZdZd	d�Zd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
dS)�
rgb_to_yiq�
yiq_to_rgb�
rgb_to_hls�
hls_to_rgb�
rgb_to_hsv�
hsv_to_rgbgUUUUUU�?gUUUUUU�?gUUUUUU�?cCsRd|d|d|}d||d||}d||d||}|||fS)Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g=
ףp=�?�)�r�g�b�y�i�qrr� /usr/lib64/python3.8/colorsys.pyr(scCs�|d|d|}|d|d|}|d|d|}|dkrHd}|dkrTd}|dkr`d}|dkrld}|dkrxd}|dkr�d}|||fS)	Ng2r��L�?g����,��?g:�����?g�nєW�?g6�޷���?gJ"�X�?���?r)rrr
rr	r
rrrr.s cCs�t|||�}t|||�}||d}||kr6d|dfS|dkrP||||}n||d||}||||}||||}||||}	||kr�|	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)N�@r��?�@�@r��max�min)rr	r
�maxc�minc�l�s�rc�gc�bc�hrrrrKs$

cCsn|dkr|||fS|dkr(|d|}n||||}d||}t|||t�t|||�t|||t�fS)Nrrrr)�_v�	ONE_THIRD)rrr�m2�m1rrrrbs
cCsT|d}|tkr$||||dS|dkr0|S|tkrP|||t|dS|S)Nrrr)�	ONE_SIXTH�	TWO_THIRD)r#r"Zhuerrrr lsr cCs�t|||�}t|||�}|}||kr.dd|fS|||}||||}||||}||||}	||kr||	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)Nrrrrrr)rr	r
rr�vrrrrrrrrr|s 

cCs�|dkr|||fSt|d�}|d|}|d|}|d||}|d|d|}|d}|dkrt|||fS|dkr�|||fS|dkr�|||fS|dkr�|||fS|d	kr�|||fS|d
kr�|||fSdS)Nrrr�������)�int)rrr&r�f�pr
�trrrr�s(





N)�__all__r!r$r%rrrrr rrrrrr�<module>s�	
getpass.cpython-38.opt-2.pyc000064400000005663151450073350011617 0ustar00U

e5dj�@s�ddlZddlZddlZddlZddlZdddgZGdd�de�Zddd�Zdd	d
�Z	ddd�Z
ddd�Zdd�Zzddl
Z
e
je
jfWnBeefk
r�zddlZWnek
r�e
ZYnXe	ZYnXeZdS)�N�getpass�getuser�GetPassWarningc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/getpass.pyrs�
Password: c
Cs�d}t�����}zJt�dtjtjB�}t�|d�}|�|�t�	|�}|�|�|sX|}Wnpt
k
r�}zR|��ztj
��}Wn&ttfk
r�d}t||�}YnXtj
}|s�tj}W5d}~XYnX|dk	�r�z�t�|�}|dd�}	|	dtjM<tj}
ttd��r|
tjO}
z t�||
|	�t|||d�}W5t�||
|�|��XWn@tjk
�r�|dk	�rz�||k	�r�|��t||�}YnX|�d�|W5QR�SQRXdS)Nz/dev/ttyzw+��TCSASOFT)�input�
)�
contextlib�	ExitStack�os�open�O_RDWR�O_NOCTTY�io�FileIO�
enter_context�
TextIOWrapper�OSError�close�sys�stdin�fileno�AttributeError�
ValueError�fallback_getpass�stderr�termios�	tcgetattrZECHOZ	TCSAFLUSH�hasattrr�	tcsetattr�flush�
_raw_input�error�write)�prompt�streamZpasswd�stack�fdZttyr
�e�old�newZtcsetattr_flagsrrr	�unix_getpasssR








r1cCs�tjtjk	rt||�S|D]}t�|�qd}t��}|dkst|dkrHqt|dkrTt�|dkrj|dd�}q.||}q.t�d�t�d�|S)N��
r�����)rr�	__stdin__r �msvcrtZputwchZgetwch�KeyboardInterrupt)r*r+�cZpwrrr	�win_getpassas 



r;cCs0tjdtdd�|stj}td|d�t||�S)Nz%Can not control echo on the terminal.�)�
stacklevelz&Warning: Password input may be echoed.)�file)�warnings�warnrrr!�printr')r*r+rrr	r xs�r r2cCs�|s
tj}|stj}t|�}|rpz|�|�Wn8tk
rf|�|jd�}|�|j�}|�|�YnX|�	�|�
�}|s�t�|ddkr�|dd�}|S)N�replacer6r)rr!r�strr)�UnicodeEncodeError�encode�encoding�decoder&�readline�EOFError)r*r+r
�linerrr	r'�s&r'cCs<dD]}tj�|�}|r|Sqddl}|�t���dS)N)ZLOGNAMEZUSERZLNAMEZUSERNAMEr)r�environ�get�pwd�getpwuid�getuid)�name�userrMrrr	r�s
)r
N)r
N)r
N)r2NN)rrrrr?�__all__�UserWarningrr1r;r r'rr"r#r%�ImportErrorrr8rrrrr	�<module>s*

D

	


turtle.cpython-38.pyc000064400000375750151450073350010537 0ustar00U

e5dd1�O@s6dZdZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZddd	d
ddd
ddg	Zddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.gZd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}gOZd~dgZeeeed�gZdd0d3d@dMdQdUd[d]dbdcdedfdqdvdydzgZd�d�d�d�ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d��Zd�d��Zd�d��Zzee�Wnek
�r
ed��YnXGd�d�de�Zd�d��Zd�d��Zd�Zd�d�d��Z Gd�d�dej!�Z"e e"ej#d��Gd�d��d�ej$�Z%ej#Z#Gd�d��d�e&�Z'Gd�d��d�e�Z(Gd�d��d�e�Z)Gd�d�de&�Z*Gd�d��d�e&�Z+Gd�d�de'�Z,Gd�d��d�e&�Z-Gd�d��d�e&�Z.Gd�d��d�e&�Z/Gd�d
�d
e.e-�Z0e0Z1d�d	�Z2Gd�d��d�e,�Z3Gd�d�de0�Z4e4Z5d�d�d~�Z6d�d��Z7ed�Z8ze8d�k�rre7e8�Wn@e9k
�r�ed�e8�Yn"ek
�r�ed�e8�YnXd�d��Z:d�dÄZ;d�dńZ<d�Z=d�dȄZ>e>ee3d�d�e<�e>ee4d�d�e;�e?Z@eAd�k�r2d�dτZBd�dфZCd�dӄZDeC�eD�eE�dS)�a�

Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it
the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
the direction it is facing, drawing a line as it moves. Give it the
command turtle.right(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.

----- turtle.py

This module is an extended reimplementation of turtle.py from the
Python standard distribution up to Python 2.5. (See: http://www.python.org)

It tries to keep the merits of turtle.py and to be (nearly) 100%
compatible with it. This means in the first place to enable the
learning programmer to use all the commands, classes and methods
interactively when using the module from within IDLE run with
the -n switch.

Roughly it has the following features added:

- Better animation of the turtle movements, especially of turning the
  turtle. So the turtles can more easily be used as a visual feedback
  instrument by the (beginning) programmer.

- Different turtle shapes, gif-images as turtle shapes, user defined
  and user controllable turtle shapes, among them compound
  (multicolored) shapes. Turtle shapes can be stretched and tilted, which
  makes turtles very versatile geometrical objects.

- Fine control over turtle movement and screen updates via delay(),
  and enhanced tracer() and speed() methods.

- Aliases for the most commonly used commands, like fd for forward etc.,
  following the early Logo traditions. This reduces the boring work of
  typing long sequences of commands, which often occur in a natural way
  when kids try to program fancy pictures on their first encounter with
  turtle graphics.

- Turtles now have an undo()-method with configurable undo-buffer.

- Some simple commands/methods for creating event driven programs
  (mouse-, key-, timer-events). Especially useful for programming games.

- A scrollable Canvas class. The default scrollable Canvas can be
  extended interactively as needed while playing around with the turtle(s).

- A TurtleScreen class with methods controlling background color or
  background image, window and canvas size and other properties of the
  TurtleScreen.

- There is a method, setworldcoordinates(), to install a user defined
  coordinate-system for the TurtleScreen.

- The implementation uses a 2-vector class named Vec2D, derived from tuple.
  This class is public, so it can be imported by the application programmer,
  which makes certain types of computations very natural and compact.

- Appearance of the TurtleScreen and the Turtles at startup/import can be
  configured by means of a turtle.cfg configuration file.
  The default configuration mimics the appearance of the old turtle module.

- If configured appropriately the module reads in docstrings from a docstring
  dictionary in some different language, supplied separately  and replaces
  the English ones by those read in. There is a utility function
  write_docstringdict() to write a dictionary with the original (English)
  docstrings to disc, so it can serve as a template for translations.

Behind the scenes there are some features included with possible
extensions in mind. These will be commented and documented elsewhere.

z-turtle 1.1b- - for Python 3.1   -  4. 5. 2009�N)�isfile�split�join)�deepcopy)�simpledialog�ScrolledCanvas�TurtleScreen�Screen�	RawTurtle�Turtle�RawPen�Pen�Shape�Vec2D�addshape�bgcolor�bgpic�bye�clearscreen�	colormode�delay�exitonclick�	getcanvas�	getshapes�listen�mainloop�mode�numinput�onkey�
onkeypress�onkeyrelease�
onscreenclick�ontimer�register_shape�resetscreen�
screensize�setup�setworldcoordinates�	textinput�title�tracer�turtles�update�
window_height�window_width�back�backward�
begin_fill�
begin_poly�bk�circle�clear�
clearstamp�clearstamps�clone�color�degrees�distance�dot�down�end_fill�end_poly�fd�	fillcolor�filling�forward�get_poly�getpen�	getscreen�
get_shapepoly�	getturtle�goto�heading�
hideturtle�home�ht�isdown�	isvisible�left�lt�onclick�ondrag�	onrelease�pd�pen�pencolor�pendown�pensize�penup�pos�position�pu�radians�right�reset�
resizemode�rt�seth�
setheading�setpos�setposition�settiltangle�
setundobuffer�setx�sety�shape�	shapesize�shapetransform�shearfactor�
showturtle�speed�st�stamp�tilt�	tiltangle�towards�
turtlesize�undo�undobufferentries�up�width�write�xcor�ycor�write_docstringdict�done�
Terminator��?g�?i�i,�standard��?�
i��classic�black�noresizeTZenglish�turtle�screenzPython Turtle GraphicsF)rz�height�	canvwidth�
canvheight�	leftright�	topbottomrrr�undobuffersizerkrWrAra�visible�language�
exampleturtle�
examplescreenr)�
using_IDLEc	Cs�t|d��}|��}W5QRXi}|D]�}|��}|r&|�d�rBq&z|�d�\}}Wn(tk
r|td||f�Yq&YnX|��}|��}|dkr�t|�}n4zd|kr�t|�}nt	|�}Wntk
r�YnX|||<q&|S)z/Convert content of config-file into dictionary.�r�#�=zBad line in config-file %s:
%s)�True�False�Nonez''z""�.)
�open�	readlines�strip�
startswithr�
ValueError�print�eval�float�int)�filename�fZcfglines�cfgdict�line�key�value�r��/usr/lib64/python3.8/turtle.py�config_dict�s0



r�cCs�d}i}i}t|�rt|�}d|kr0d|d}ztt�\}}t||�}Wntk
rbd}YnXt|�rtt|�}t�|�t�|�dS)a@Read config-files, change configuration-dict accordingly.

    If there is a turtle.cfg file in the current working directory,
    read it from there. If this contains an importconfig-value,
    say 'myway', construct filename turtle_mayway.cfg else use
    turtle.cfg and read it from the import-directory, where
    turtle.py is located.
    Update configuration dictionary first according to config-file,
    in the import directory, then according to config-file in the
    current working directory.
    If no config-file is found, the default configuration is used.
    z
turtle.cfgZimportconfigz
turtle_%s.cfg�N)rr�r�__file__r�	Exception�_CFGr,)r�Zdefault_cfgZcfgdict1Zcfgdict2�head�tailZ	cfg_file2r�r�r��
readconfig�s 


r�z"No configfile read, reason unknownc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)ra�A 2 dimensional vector class, used as a helper class
    for implementing turtle graphics.
    May be useful for turtle graphics programs also.
    Derived from tuple, so a vector is a tuple!

    Provides (for a, b vectors, k number):
       a+b vector addition
       a-b vector subtraction
       a*b inner product
       k*a and a*k multiplication with scalar
       |a| absolute value of a
       a.rotate(angle) rotation
    cCst�|||f�S�N)�tuple�__new__)�cls�x�yr�r�r�r��sz
Vec2D.__new__cCs"t|d|d|d|d�S�Nr��r��self�otherr�r�r��__add__�sz
Vec2D.__add__cCsDt|t�r*|d|d|d|dSt|d||d|�Sr�)�
isinstancerr�r�r�r��__mul__�s
 z
Vec2D.__mul__cCs2t|t�st|t�r.t|d||d|�StSr�)r�r�r�r�NotImplementedr�r�r�r��__rmul__szVec2D.__rmul__cCs"t|d|d|d|d�Sr�r�r�r�r�r��__sub__sz
Vec2D.__sub__cCst|d|d�Sr�r��r�r�r�r��__neg__sz
Vec2D.__neg__cCs|dd|dddS)Nr�r�r�r�r�r�r�r��__abs__
sz
Vec2D.__abs__cCsjt|d|d�}|tjd}t�|�t�|�}}t|d||d||d||d|�S)z.rotate self counterclockwise by angle
        r�r��f@)r�math�pi�cos�sin)r��angleZperp�c�sr�r�r��rotateszVec2D.rotatecCs|d|dfSr�r�r�r�r�r��__getnewargs__szVec2D.__getnewargs__cCsd|S)Nz(%.2f,%.2f)r�r�r�r�r��__repr__szVec2D.__repr__N)�__name__�
__module__�__qualname__�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s
cCsTt|j�}|��|D]}t||�q|j��D]\}}t|�tjkr0|||<q0dS)�#helper function for Scrolled CanvasN)	�list�	__bases__�reverse�__methodDict�__dict__�items�type�types�FunctionType)r��_dictZbaseListZ_superr�r�r�r�r�r�!s
r�cCsi}t||�|��S)r�)r��keys)r�r�r�r�r��	__methods+s
r�zTdef %(method)s(self, *args, **kw): return self.%(attribute)s.%(method)s(*args, **kw)r�cCs�i}t||�i}t|�}|��D]B}|dd�dksd|dd�dksd||ksd||krXq"||||<q"|��D]D\}}	||	d�}
t|t�r�t||d�}t||
�t|||
|�qndS)Nr��_���)�method�func)r�Z	attribute)	r�r�r�r�r��str�__stringBody�exec�setattr)Z	fromClassZtoClassZtoPartZexcludeZ_dict_1r�ZmfcZexr�r��dZ
execStringr�r�r��__forwardmethods5s
0

�
r�c@sdeZdZdZddd�Zddd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz�Modeled after the scrolled canvas class from Grayons's Tkinter book.

    Used as the default canvas, which pops up automatically when
    using turtle graphics functions or the Turtle class.
    ���^�Xc
Cs0tjj||||d�|��|_|||_|_|||_|_d|_	tj
||||j	tjdd�|_tj
||jjtjd�|_tj
||jjd�|_|jj|jj|jjd�|jdd	dd
�|jdd	dd
�|jjd	|d	ddd	d	dd�|jjd	|d	dd	d	d	dd�|jjd	|d	d	dd	d	dd�|��|j�d
|j�dS)N)rzr��whiter�)rzr��bgZreliefZborderwidth)�commandZorient)r�)ZxscrollcommandZyscrollcommandrr�)ZweightZminsize�news�ZpadxZin_Zpady�row�columnZrowspanZ
columnspanZstickyz<Configure>)�TK�Frame�__init__�winfo_toplevelZ_rootwindowrzr�r�r�r��CanvasZSUNKEN�_canvasZ	ScrollbarZxviewZ
HORIZONTAL�hscrollZyview�vscrollZ	configure�setZrowconfigureZcolumnconfigure�gridr`�bind�onResize)r��masterrzr�r�r�r�r�r�r�PsN

������zScrolledCanvas.__init__NcCs�|r
||_|r||_|r||_|jj||jd|jd|jd|jdfd�|j�d|j|jd|j�|j�d|j|jd|j�|�	�dS)z<Adjust canvas and scrollbars according to given canvas size.r�)r��scrollregionr��N)
r�r�r�r�config�xview_movetorz�yview_movetor��
adjustScrolls�r�r�r�r�r�r�r�r`is&����zScrolledCanvas.resetc
Cs�|j��}|j��}|j�d|j||j�|j�d|j||j�||jks`||jkr�|jjd|ddddddd�|j	jd|ddddddd�n|j�
�|j	�
�dS)zA Adjust scrollbars according to window- and canvas-size.
        r�r�rr�r�N)r�winfo_width�winfo_heightrr�rr�rrrZgrid_forget)r��cwidth�cheightr�r�r�r
{s&

��
zScrolledCanvas.adjustScrollscCs|��dS)zself-explanatoryN)r
)r��eventr�r�r�r�szScrolledCanvas.onResizecGs|jj|�S��@ 'forward' method, which canvas itself has inherited...
        )r�bbox�r��argsr�r�r�r�szScrolledCanvas.bboxcOs|jj||�Sr)r�cget�r�r�kwargsr�r�r�r�szScrolledCanvas.cgetcOs|jj||�dS�rN)rr
rr�r�r�r
�szScrolledCanvas.configcOs|jj||�dSr)rrrr�r�r�r�szScrolledCanvas.bindcOs|jj||�dSr)r�unbindrr�r�r�r�szScrolledCanvas.unbindcCs|j��dSr)r�focus_forcer�r�r�r�r�szScrolledCanvas.focus_force)r�r�r�r�)NNN)r�r�r�r�r�r`r
rrrr
rrrr�r�r�r�rJs�

rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�_Rootz'Root class for Screen based on Tkinter.cCstj�|�dSr�)r��Tkr�r�r�r�r�r��sz_Root.__init__cCs&t|||||�|_|jjddd�dS)Nr�Zboth)�expand�fill)rrZpack)r�rzr�rrr�r�r��setupcanvas�sz_Root.setupcanvascCs|jSr�)rr�r�r�r��
_getcanvas�sz_Root._getcanvascCs|�d||||f�dS)Nz%dx%d%+d%+d)Zgeometry)r�rzr��startx�startyr�r�r��set_geometry�sz_Root.set_geometrycCs|�d|�dS)NZWM_DELETE_WINDOW)Zwm_protocol)r��destroyr�r�r��	ondestroy�sz_Root.ondestroycCs|��Sr�)Zwinfo_screenwidthr�r�r�r��	win_width�sz_Root.win_widthcCs|��Sr�)Zwinfo_screenheightr�r�r�r��
win_height�sz_Root.win_heightN)r�r�r�r�r�r#r$r'r)r*r+r�r�r�r�r�src@s,eZdZdZdd�Zdd�Zdd�Zdd	�ZdGdd
�Zdd�Z	dHdd�Z
dd�Zdd�Zdd�Z
dd�ZdIdd�Zdd�ZdJdd �ZdKd!d"�ZdLd#d$�ZdMd%d&�Zd'd(�ZdNd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdOd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dPdEdF�Z$d
S)Q�TurtleScreenBasez�Provide the basic graphics functionality.
       Interface between Tkinter and turtle.py.

       To port turtle.py to some different graphics toolkit
       a corresponding TurtleScreenBase class has to be implemented.
    cCstjdd|jd�}|��|S)z$return a blank image object
        r�)rzr�r)r��
PhotoImage�cv�blank)r�Zimgr�r�r��_blankimage�szTurtleScreenBase._blankimagecCstj||jd�S)z`return an image object containing the
        imagedata from a gif-file named filename.
        )�filer)r�r-r.)r�r�r�r�r��_image�szTurtleScreenBase._imagecCs�||_t|t�r"|jj}|jj}nJt|j�d��}t|j�d��}|jj|d|d|d|dfd�||_||_d|_|_	dS)Nrzr�r��rr�)
r.r�rr�r�r�rr
�xscale�yscale)r�r.�w�hr�r�r�r��s

*zTurtleScreenBase.__init__cCs|jjdddd�S)z<Create an invisible polygon item on canvas self.cv)
        )rrrrrrr��r"�outline)r.Zcreate_polygonr�r�r�r��_createpoly�szTurtleScreenBase._createpolyNFc
Cs�g}|D]*\}}	|�||j�|�|	|j�q|jj|f|��|dk	r^|jj||d�|dk	rv|jj||d�|dk	r�|jj||d�|r�|j�|�dS)a`Configure polygonitem polyitem according to provided
        arguments:
        coordlist is sequence of coordinates
        fill is filling color
        outline is outline color
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        N�r")r9�rz��appendr4r5r.�coordsZ
itemconfigureZ	tag_raise)
r�Zpolyitem�	coordlistr"r9rz�top�clr�r�r�r�r��	_drawpoly�szTurtleScreenBase._drawpolyc	Cs|jjddddddtjd�S)z9Create an invisible line item on canvas self.cv)
        rr�r�)r"rzZcapstyle)r.Zcreate_liner�ZROUNDr�r�r�r��_createlines�zTurtleScreenBase._createlinec	Cs�|dk	rNg}|D]*\}}|�||j�|�||j�q|jj|f|��|dk	rf|jj||d�|dk	r~|jj||d�|r�|j�|�dS)aQConfigure lineitem according to provided arguments:
        coordlist is sequence of coordinates
        fill is drawing color
        width is width of drawn line.
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        Nr;r<r=)	r�Zlineitemr@r"rzrArBr�r�r�r�r��	_drawlines
zTurtleScreenBase._drawlinecCs|j�|�dS)z]Delete graphics item from canvas.
        If item is"all" delete all graphics items.
        N)r.�delete�r��itemr�r�r��_delete(szTurtleScreenBase._deletecCs|j��dS)z(Redraw graphics items on canvas
        N)r.r,r�r�r�r��_update.szTurtleScreenBase._updatecCs|j�|�dS)z-Delay subsequent canvas actions for delay ms.N)r.�after�r�rr�r�r��_delay3szTurtleScreenBase._delaycCs4z|j�|�}d}Wntjk
r.d}YnX|S)zCCheck if the string color is a legal Tkinter color string.
        TF)r.Z	winfo_rgbr�ZTclError)r�r9Zrgb�okr�r�r��_iscolorstring7s
zTurtleScreenBase._iscolorstringcCs0|dk	r |jj|d�|��n|j�d�SdS)zVSet canvas' backgroundcolor if color is not None,
        else return backgroundcolor.N)r�r�)r.r
rJr)r�r9r�r�r��_bgcolorAs
zTurtleScreenBase._bgcolorcCst|\}}||j}||j}dddd�}|jj|d||||||d�}	|j�|	�\}
}}}
|j��|	|dfS)z�Write txt at pos in canvas with specified font
        and color.
        Return text item and x-coord of right bottom corner
        of text's bounding box.�swr�Zse)rP�centerr_r�)�text�anchorr"�font)r4r5r.Zcreate_textrr,)r�r[�txt�alignrUrWr�r�rTrHZx0Zy0Zx1Zy1r�r�r��_writeJs

�
zTurtleScreenBase._writer�csD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)z�Bind fun to mouse-click event on turtle.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1
        N�<Button-%s>cs:�j�|j��j�j�|j��j}}�||�dSr��r.�canvasxr�r4�canvasyr�r5�rr�r���funr�r�r��eventfunes�z+TurtleScreenBase._onclick.<locals>.eventfun�r.Z
tag_unbindZtag_bind�r�rHr_�num�addr`r�r^r��_onclick\szTurtleScreenBase._onclickcsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)agBind fun to mouse-button-release event on turtle.
        fun must be a function with two arguments, the coordinates
        of the point on the canvas where mouse button is released.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        Nz<Button%s-ButtonRelease>cs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`ws�z-TurtleScreenBase._onrelease.<locals>.eventfunrarbr�r^r��
_onreleaseks	�zTurtleScreenBase._onreleasecsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)aqBind fun to mouse-move-event (with pressed mouse button) on turtle.
        fun must be a function with two arguments, the coordinates of the
        actual mouse position on the canvas.
        num, the number of the mouse-button defaults to 1

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.
        Nz<Button%s-Motion>csTz:�j�|j��j�j�|j��j}}�||�Wntk
rNYnXdSr�)r.r[r�r4r\r�r5r�r]r^r�r�r`�s�z*TurtleScreenBase._ondrag.<locals>.eventfunrarbr�r^r��_ondrag~s	zTurtleScreenBase._ondragcs@�dkr�j�d|�n"��fdd�}�j�d|||�dS)aGBind fun to mouse-click event on canvas.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        NrYcs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`�s�z1TurtleScreenBase._onscreenclick.<locals>.eventfun�r.rr)r�r_rcrdr`r�r^r��_onscreenclick�s	zTurtleScreenBase._onscreenclickcs>�dkr|j�d|d�n�fdd�}|j�d||�dS)z`Bind fun to key-release event of key.
        Canvas must have focus. See method listen
        Nz<KeyRelease-%s>cs
��dSr�r��r�r_r�r�r`�sz0TurtleScreenBase._onkeyrelease.<locals>.eventfunrh�r�r_r�r`r�rkr��
_onkeyrelease�szTurtleScreenBase._onkeyreleasecsn�dkr4|dkr |j�dd�qj|j�d|d�n6�fdd�}|dkrX|j�d|�n|j�d||�dS)z�If key is given, bind fun to key-press event of key.
        Otherwise bind fun to any key-press.
        Canvas must have focus. See method listen.
        Nz
<KeyPress>z
<KeyPress-%s>cs
��dSr�r�rjrkr�r�r`�sz.TurtleScreenBase._onkeypress.<locals>.eventfunrhrlr�rkr��_onkeypress�szTurtleScreenBase._onkeypresscCs|j��dS)z=Set focus on canvas (in order to collect key-events)
        N)r.rr�r�r�r��_listen�szTurtleScreenBase._listencCs(|dkr|j�|�n|j�||�dS)z?Install a timer, which calls fun after t milliseconds.
        rN)r.Z
after_idlerK�r�r_�tr�r�r��_ontimer�szTurtleScreenBase._ontimercCs|jjdd|d�S)z0Create and return image item on canvas.
        r��image)r.Zcreate_image)r�rtr�r�r��_createimage�szTurtleScreenBase._createimagecCs<|\}}|j�|||j||jf�|jj||d�dS)zZConfigure image item as to draw image object
        at position (x,y) on canvas)
        rsN)r.r?r4r5�
itemconfig)r�rHr[rtr�r�r�r�r��
_drawimage�s zTurtleScreenBase._drawimagecCs |jj||d�|j�|�dS)z�Configure image item as to draw image object
        at center of canvas. Set item to the first item
        in the displaylist, so it will be drawn below
        any other item .rsN)r.rvZ	tag_lower)r�rHrtr�r�r��	_setbgpic�szTurtleScreenBase._setbgpiccCs|j�|�S)zQReturn 'line' or 'polygon' or 'image' depending on
        type of item.
        )r.r�rGr�r�r��_type�szTurtleScreenBase._typecs.|j�|���fdd�tdt��d�D�}|S)a returns list of coordinate-pairs of points of item
        Example (for insiders):
        >>> from turtle import *
        >>> getscreen()._pointlist(getturtle().turtle._item)
        [(0.0, 9.9999999999999982), (0.0, -9.9999999999999982),
        (9.9999999999999982, 0.0)]
        >>> cs"g|]}�|�|df�qS)r�r���.0�i�rBr�r��
<listcomp>�sz/TurtleScreenBase._pointlist.<locals>.<listcomp>rr�)r.r?�range�len)r�rH�plr�r}r��
_pointlist�szTurtleScreenBase._pointlistcCs|jj||||fd�dS)Nr3)r.r
)r��srx1�sry1�srx2�sry2r�r�r��_setscrollregion�sz!TurtleScreenBase._setscrollregionc	Cs||j��}|D]h}t|j�|��}g}|rd|dd�\}}|�||�|�||�|dd�}q&|jj|f|��qdS)Nr�)r.Zfind_allr�r?r>)	r�ZxscalefactorZyscalefactorr�rHZcoordinatesZnewcoordlistr�r�r�r�r��_rescale�s
zTurtleScreenBase._rescalecCszt|jt�s|j|jfS||kr6|kr6dkrJnn|jj|jjfS|dk	rX||_|dk	rf||_|j�|||�dS)zaResize the canvas the turtles are drawing on. Does
        not alter the drawing window.
        N)r�r.rr�r�r`rr�r�r��_resizes"zTurtleScreenBase._resizecCs@|j��}|dkr|jd}|j��}|dkr8|jd}||fS)z; Return the width and height of the turtle window.
        r�rzr�)r.rr)r�rzr�r�r�r��_window_sizes



zTurtleScreenBase._window_sizecCs|jj��dS)a{Starts event loop - calling Tkinter's mainloop function.

        No argument.

        Must be last statement in a turtle graphics program.
        Must NOT be used if a script is run from within IDLE in -n mode
        (No subprocess) - for interactive use of turtle graphics.

        Example (for a TurtleScreen instance named screen):
        >>> screen.mainloop()

        N)r.Ztkrr�r�r�r�rs
zTurtleScreenBase.mainloopcCstj|||jd�S)a�Pop up a dialog window for input of a string.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what information to input.

        Return the string input
        If the dialog is canceled, return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.textinput("NIM", "Name of first player:")

        )�parent)rZ	askstringr.)r�r)�promptr�r�r�r(.s
zTurtleScreenBase.textinputcCstj||||||jd�S)a�Pop up a dialog window for input of a number.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what numerical information to input.
        default: default value
        minval: minimum value for input
        maxval: maximum value for input

        The number input must be in the range minval .. maxval if these are
        given. If not, a hint is issued and the dialog remains open for
        correction. Return the number input.
        If the dialog is canceled,  return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000)

        )ZinitialvalueZminvalueZmaxvaluer�)rZaskfloatr.)r�r)r��defaultZminvalZmaxvalr�r�r�r=s

�zTurtleScreenBase.numinput)NNNF)NNNF)N)r�N)r�N)r�N)r�N)N)NNN)NNN)%r�r�r�r�r0r2r�r:rCrDrErIrJrMrOrPrXrerfrgrirmrnrorrrurwrxryr�r�r�r�r�rr(rr�r�r�r�r,�sT
�
�


	





r,c@seZdZdZdS)r�z�Will be raised in TurtleScreen.update, if _RUNNING becomes False.

    This stops execution of a turtle graphics script.
    Main purpose: use in the Demo-Viewer turtle.Demo.py.
    N�r�r�r�r�r�r�r�r�r�Ysc@seZdZdZdS)�TurtleGraphicsErrorzSome TurtleGraphics Error
    Nr�r�r�r�r�r�bsr�c@s$eZdZdZddd�Zddd�ZdS)	rz�Data structure modeling shapes.

    attribute _type is one of "polygon", "image", "compound"
    attribute _data is - depending on _type a poygon-tuple,
    an image or a list constructed using the addcomponent method.
    NcCsz||_|dkr"t|t�rpt|�}nN|dkrVt|t�rp|���d�rpt|�rpt�	|�}n|dkrdg}nt
d|��||_dS)N�polygonrt�.gif�compoundzThere is no shape type %s)ryr�r�r�r��lower�endswithrrr2r��_data)r�Ztype_�datar�r�r�r�ns


zShape.__init__cCs:|jdkrtd|j��|dkr$|}|j�|||g�dS)a-Add component to a shape of type compound.

        Arguments: poly is a polygon, i. e. a tuple of number pairs.
        fill is the fillcolor of the component,
        outline is the outline color of the component.

        call (for a Shapeobject namend s):
        --   s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue")

        Example:
        >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
        >>> s = Shape("compound")
        >>> s.addcomponent(poly, "red", "blue")
        >>> # .. add more components and then use register_shape()
        r�z Cannot add component to %s ShapeN)ryr�r�r>)r��polyr"r9r�r�r��addcomponent~s
�zShape.addcomponent)N)N)r�r�r�r�r�r�r�r�r�r�rgs
c@sDeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�Tbufferz5Ring buffer used as undobuffer for RawTurtle objects.r�cCs$||_dgg||_d|_d|_dS)Nr�F)�bufsize�buffer�ptr�cumulate)r�r�r�r�r�r��szTbuffer.__init__NcCsD|dkr&t|j�D]}dg|j|<qn||_dgg||_d|_dS)Nr�)rr�r�r�)r�r�r|r�r�r�r`�sz
Tbuffer.resetcCsF|jdkrB|js0|jd|j|_||j|j<n|j|j�|�dSr�)r�r�r�r�r>rGr�r�r��push�s

zTbuffer.pushcCsJ|jdkrF|j|j}|dkr"dSdg|j|j<|jd|j|_|SdSr�)r�r�r�rGr�r�r��pop�s
zTbuffer.popcCs|j|j�dg�Sr�)r�r��countr�r�r�r��nr_of_items�szTbuffer.nr_of_itemscCst|j�dt|j�S)N� )r�r�r�r�r�r�r�r��szTbuffer.__repr__)r�)N)
r�r�r�r�r�r`r�r�r�r�r�r�r�r�r��s

	r�c@s"eZdZdZdZedededfdd�Zdd	�Zd=dd�Zd
d�Z	d>dd�Z
dd�Zdd�Zd?dd�Z
dd�Zdd�Zdd�Zd@dd�ZdAdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdBd.d/�Zd0d1�ZdCd2d3�ZdDd4d5�ZdEd7d8�ZdFd9d:�ZdGd;d<�ZeZ eZ!eZ"e
Z#eZ$d
S)Hrz�Provides screen oriented methods like setbg etc.

    Only relies upon the methods of TurtleScreenBase and NOT
    upon components of the underlying graphics toolkit -
    which is Tkinter in this case.
    Trrrc
Cs�t�||�tdd�tdd�tdd�tdd�tdd�tdd�td|���d	�|_d
di|_||_||_td|_	g|_
|��tj
d
kr�|��}|�ddddd�|�ddddd�dS)Nr�)����r�r�r�rr�))r�)����)r�r�)����)����	)����)����)r�r�)������)���r�)r�r�)r�r��rr�)�r�)�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�)��Q�#@���Q�@)�G�z. @��Q��@)r�r�)r�r�r�)���Q��r�)��Q���r�)�G�z. �r�)��Q�#�r�r�)r�r�)r�r�)r�r�)r�r�)g�g$�)r�r�)r�r�)r�r�)r�r�))r�r�)r�r�)r�r�)r�r�))r���G�z�)rg�����'@)r�r�)�rr)r�r�r�)r�r�rt)Zarrowr�r4ZsquareZtriangler�r/�nopicr�r�darwinZwmZ
attributesr�z-topmost�1�0)r,r�rr0�_shapes�_bgpics�_mode�_delayvaluer��
_colormode�_keysr5�sys�platformr�Zcall)r�r.rrrZ
rootwindowr�r�r�r��s&�


zTurtleScreen.__init__cCs�td|_td|_|�d�|�d�|_d|_d|_d|_g|_	|�
d�d	D]}|�d
|�qP|�d
�|j
d
d
�D]}|�d
|�|�d
|�qzd
t_d
S)aqDelete all drawings and all turtles from the TurtleScreen.

        No argument.

        Reset empty TurtleScreen to its initial state: white background,
        no backgroundimage, no eventbindings and tracing on.

        Example (for a TurtleScreen instance named screen):
        >>> screen.clear()

        Note: this method is not available as function.
        rr�allr�r�r�rr�)r�r��N)r�r�r�rIru�_bgpic�
_bgpicname�_tracing�_updatecounter�_turtlesrrRrr�rr�_pen)r��btnr�r�r�r�r5�s 




zTurtleScreen.clearNcCs||dkr|jS|��}|dkr*td|��||_|dkrp|�|jd|jd|jd|jd�d|_|_|��dS)ahSet turtle-mode ('standard', 'logo' or 'world') and perform reset.

        Optional argument:
        mode -- one of the strings 'standard', 'logo' or 'world'

        Mode 'standard' is compatible with turtle.py.
        Mode 'logo' is compatible with most Logo-Turtle-Graphics.
        Mode 'world' uses userdefined 'worldcoordinates'. *Attention*: in
        this mode angles appear distorted if x/y unit-ratio doesn't equal 1.
        If mode is not given, return the current mode.

             Mode      Initial turtle heading     positive angles
         ------------|-------------------------|-------------------
          'standard'    to the right (east)       counterclockwise
            'logo'        upward    (north)         clockwise

        Examples:
        >>> mode('logo')   # resets turtle heading to north
        >>> mode()
        'logo'
        N�r��logo�worldzNo turtle-graphics-mode %s)r�r�r�r�)	r�r�r�r�r�r�r4r5r`�r�rr�r�r�rs�zTurtleScreen.modecCs�|��dkr|�d�t||�}t||�}|��\}}|�|d|d�|j|j}	}
|j||_|j||_||j}||j}|j|}
|j|}|�|||
|�|�	|j|	|j|
�|�
�dS)asSet up a user defined coordinate-system.

        Arguments:
        llx -- a number, x-coordinate of lower left corner of canvas
        lly -- a number, y-coordinate of lower left corner of canvas
        urx -- a number, x-coordinate of upper right corner of canvas
        ury -- a number, y-coordinate of upper right corner of canvas

        Set up user coodinat-system and switch to mode 'world' if necessary.
        This performs a screen.reset. If mode 'world' is already active,
        all drawings are redrawn according to the new coordinates.

        But ATTENTION: in user-defined coordinatesystems angles may appear
        distorted. (see Screen.mode())

        Example (for a TurtleScreen instance named screen):
        >>> screen.setworldcoordinates(-10,-0.5,50,1.5)
        >>> for _ in range(36):
        ...     left(10)
        ...     forward(0.5)
        r��N)rr�r�r%r4r5r�r�r�r�r,)r�ZllxZllyZurxZuryZxspanZyspanZwxZwyZ	oldxscaleZ	oldyscaler�r�r�r�r�r�r�r'-s 



z TurtleScreen.setworldcoordinatescCsT|dkr2|���d�r(td|�|��}qFtd��nt|t�rFtd|�}||j|<dS)a�Adds a turtle shape to TurtleScreen's shapelist.

        Arguments:
        (1) name is the name of a gif-file and shape is None.
            Installs the corresponding image shape.
            !! Image-shapes DO NOT rotate when turning the turtle,
            !! so they do not display the heading of the turtle!
        (2) name is an arbitrary string and shape is a tuple
            of pairs of coordinates. Installs the corresponding
            polygon shape
        (3) name is an arbitrary string and shape is a
            (compound) Shape object. Installs the corresponding
            compound shape.
        To use a shape, you have to issue the command shape(shapename).

        call: register_shape("turtle.gif")
        --or: register_shape("tri", ((0,0), (10,10), (-10,10)))

        Example (for a TurtleScreen instance named screen):
        >>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3)))

        Nr�rtz;Bad arguments for register_shape.
Use  help(register_shape)r�)r�r�rr2r�r�r�r�)r��namerkr�r�r�r#Ts


zTurtleScreen.register_shapec	Cst|�dkr|d}t|t�rD|�|�s0|dkr4|Stdt|���z|\}}}Wn(ttfk
rztdt|���YnX|jdkr�dd�|||fD�\}}}d|kr�d	kr�nn.d|kr�d	kr�nnd|kr�d	ks�ntd
t|���d|||fS)aReturn color string corresponding to args.

        Argument may be a string or a tuple of three
        numbers corresponding to actual colormode,
        i.e. in the range 0<=n<=colormode.

        If the argument doesn't represent a color,
        an error is raised.
        r�rr�zbad color string: %s�bad color arguments: %sr�cSsg|]}td|��qS�g�o@��round�r{r�r�r�r�r~�sz*TurtleScreen._colorstr.<locals>.<listcomp>��bad color sequence: %s�
#%02x%02x%02x)r�r�r�rOr��	TypeErrorr�r�)r�r9r��g�br�r�r��	_colorstrws


FzTurtleScreen._colorstrcsx��d�s�St��dkr.�fdd�dD�}n4t��dkrV�fdd��dd�D�}ntd	���t�fd
d�|D��S)Nr�r�cs"g|]}t�||d�d��qS)r�r��r�rz��cstrr�r�r~�sz'TurtleScreen._color.<locals>.<listcomp>)r�r�r�r�csg|]}dt�|d��qS)r�r�)r{r7r�r�r�r~�sr�zbad colorstring: %sc3s|]}|�jdVqdS)r�N)r�)r{r�r�r�r��	<genexpr>�sz&TurtleScreen._color.<locals>.<genexpr>)r�r�r�r�)r�r�rBr�)r�r�r��_color�s
zTurtleScreen._colorcCs8|dkr|jS|dkr"t|�|_n|dkr4t|�|_dS)aqReturn the colormode or set it to 1.0 or 255.

        Optional argument:
        cmode -- one of the values 1.0 or 255

        r, g, b values of colortriples have to be in range 0..cmode.

        Example (for a TurtleScreen instance named screen):
        >>> screen.colormode()
        1.0
        >>> screen.colormode(255)
        >>> pencolor(240,160,80)
        Nr�r�)r�r�r�)r�Zcmoder�r�r�r�szTurtleScreen.colormodecCs$|jD]}|�|j�|��qdS)z�Reset all Turtles on the Screen to their initial state.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.reset()
        N)r��_setmoder�r`)r�r�r�r�r�r`�s
zTurtleScreen.resetcCs|jS)z�Return the list of turtles on the screen.

        Example (for a TurtleScreen instance named screen):
        >>> screen.turtles()
        [<turtle.Turtle object at 0x00E11FB0>]
        )r�r�r�r�r�r+�szTurtleScreen.turtlescGs4|r|�|�}nd}|�|�}|dk	r0|�|�}|S)a�Set or return backgroundcolor of the TurtleScreen.

        Arguments (if given): a color string or three numbers
        in the range 0..colormode or a 3-tuple of such numbers.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgcolor("orange")
        >>> screen.bgcolor()
        'orange'
        >>> screen.bgcolor(0.5,0,0.5)
        >>> screen.bgcolor()
        '#800080'
        N)r�rPr��r�rr9r�r�r�r�s

zTurtleScreen.bgcolorcCsB|dkr|jSt|�|_d|_|dk	r0t|�|_|jr>|��dS)aeTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a TurtleScreen instance named screen):
        >>> screen.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     fd(dist)
        ...     rt(90)
        ...     dist += 2
        Nr)r�r�r�r�r,)r��nrr�r�r�r*�s

zTurtleScreen.tracercCs|dkr|jSt|�|_dS)z� Return or set the drawing delay in milliseconds.

        Optional argument:
        delay -- positive integer

        Example (for a TurtleScreen instance named screen):
        >>> screen.delay(15)
        >>> screen.delay()
        15
        N)r�r�rLr�r�r�r�szTurtleScreen.delaycCs<tjsdt_t�|jdkr8|jd7_|j|j;_dS)zIncrement update counter.Trr�N)r�_RUNNINGr�r�r�r�r�r�r��
_incrementudc	s
zTurtleScreen._incrementudccCs<|j}d|_|��D]}|��|��q||_|��dS)z'Perform a TurtleScreen update.
        TN)r�r+�_update_data�_drawturtlerJ)r��tracingrqr�r�r�r,s
zTurtleScreen.updatecCs|��dS)z� Return the width of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        r�r�r�r�r�r�r.szTurtleScreen.window_widthcCs|��dS)z� Return the height of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        r�r�r�r�r�r�r-&szTurtleScreen.window_heightcCs|jS)z�Return the Canvas of this TurtleScreen.

        No argument.

        Example (for a Screen instance named screen):
        >>> cv = screen.getcanvas()
        >>> cv
        <turtle.ScrolledCanvas instance at 0x010742D8>
        )r.r�r�r�r�r/s
zTurtleScreen.getcanvascCst|j���S)z�Return a list of names of all currently available turtle shapes.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.getshapes()
        ['arrow', 'blank', 'circle', ... , 'turtle']
        )�sortedr�r�r�r�r�r�r;s	zTurtleScreen.getshapesr�cCs|�|||�dS)a�Bind fun to mouse-click event on canvas.

        Arguments:
        fun -- a function with two arguments, the coordinates of the
               clicked point on the canvas.
        btn -- the number of the mouse-button, defaults to 1

        Example (for a TurtleScreen instance named screen)

        >>> screen.onclick(goto)
        >>> # Subsequently clicking into the TurtleScreen will
        >>> # make the turtle move to the clicked point.
        >>> screen.onclick(None)
        N)ri�r�r_r�rdr�r�r�rRFszTurtleScreen.onclickcCsF|dkr ||jkr6|j�|�n||jkr6|j�|�|�||�dS)amBind fun to key-release event of key.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkey(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, consequently drawing a hexagon

        N)r��remover>rm�r�r_r�r�r�r�rWs

zTurtleScreen.onkeycCsN|dkr ||jkr>|j�|�n|dk	r>||jkr>|j�|�|�||�dS)aBind fun to key-press event of key if key is given,
        or to any key-press-event if no key is given.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen
        and a Turtle instance named turtle):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkeypress(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, or by keeping pressed the up-arrow key.
        consequently drawing a hexagon.
        N)r�r�r>rnr�r�r�r�rus
zTurtleScreen.onkeypresscCs|��dS)aSet focus on TurtleScreen (in order to collect key-events)

        No arguments.
        Dummy arguments are provided in order
        to be able to pass listen to the onclick method.

        Example (for a TurtleScreen instance named screen):
        >>> screen.listen()
        N)ro)r��xdummy�ydummyr�r�r�r�s
zTurtleScreen.listenrcCs|�||�dS)a�Install a timer, which calls fun after t milliseconds.

        Arguments:
        fun -- a function with no arguments.
        t -- a number >= 0

        Example (for a TurtleScreen instance named screen):

        >>> running = True
        >>> def f():
        ...     if running:
        ...             fd(50)
        ...             lt(60)
        ...             screen.ontimer(f, 250)
        ...
        >>> f()   # makes the turtle marching around
        >>> running = False
        N)rrrpr�r�r�r"�szTurtleScreen.ontimercCsF|dkr|jS||jkr(|�|�|j|<|�|j|j|�||_dS)aFSet background image or return name of current backgroundimage.

        Optional argument:
        picname -- a string, name of a gif-file or "nopic".

        If picname is a filename, set the corresponding image as background.
        If picname is "nopic", delete backgroundimage, if present.
        If picname is None, return the filename of the current backgroundimage.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgpic()
        'nopic'
        >>> screen.bgpic("landscape.gif")
        >>> screen.bgpic()
        'landscape.gif'
        N)r�r�r2rxr�)r�Zpicnamer�r�r�r�s
zTurtleScreen.bgpiccCs|�|||�S)a�Resize the canvas the turtles are drawing on.

        Optional arguments:
        canvwidth -- positive integer, new width of canvas in pixels
        canvheight --  positive integer, new height of canvas in pixels
        bg -- colorstring or color-tuple, new backgroundcolor
        If no arguments are given, return current (canvaswidth, canvasheight)

        Do not alter the drawing window. To observe hidden parts of
        the canvas use the scrollbars. (Can make visible those parts
        of a drawing, which were outside the canvas before!)

        Example (for a Turtle instance named turtle):
        >>> turtle.screensize(2000,1500)
        >>> # e.g. to search for an erroneously escaped turtle ;-)
        )r�rr�r�r�r%�szTurtleScreen.screensize)N)N)N)NN)N)r�N)N)NN)r)N)NNN)%r�r�r�r�r�r�r�r5rr'r#r�r�rr`r+rr*rr�r,r.r-rrrRrrrr"rr%r!r$rrr r�r�r�r�r�sH�
(
"'
#
	

			

 



c@sTeZdZdZedd�edd�edd�d�ZdZdZdZefdd	�Z	d
d�Z
dBd
d�Zdd�ZdCdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�ZdDd*d+�Zd,d-�Zd.d/�Zd0d1�ZdEd2d3�ZdFd4d5�Zd6d7�Zd8d9�Z dGd:d;�Z!dHd<d=�Z"dId>d?�Z#dJd@dA�Z$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,e Z-dS)K�
TNavigatorzRNavigation part of the RawTurtle.
    Implements methods for turtle movement.
    r��)r�r�r�r�rr�cCsB|j|_|j|_||_d|_|��d|_|�|�t�	|�dSr�)
�DEFAULT_ANGLEOFFSET�_angleOffset�DEFAULT_ANGLEORIENT�_angleOrientr��
undobufferr:r�r�r`r�r�r�r�r��s
zTNavigator.__init__cCstdd�|_tj|j|_dS)zXreset turtle to its initial values

        Will be overwritten by parent class
        r�N)r�	_positionr��START_ORIENTATIONr��_orientr�r�r�r�r`�szTNavigator.resetNcCsL|dkr|jS|dkrdS||_|dkr6d|_d|_n|jd|_d|_dS)z:Set turtle-mode to 'standard', 'world' or 'logo'.
        Nr�)r�r�rr��@r�)r�rr�_fullcircler�r�r�r�r�szTNavigator._setmodecCs0||_d||_|jdkr"d|_n
|d|_dS)z+Helper function for degrees() and radians()ihr�rrN)r�
_degreesPerAUr�r�r�Z
fullcircler�r�r��_setDegreesPerAUs


zTNavigator._setDegreesPerAU��v@cCs|�|�dS)a> Set angle measurement units to degrees.

        Optional argument:
        fullcircle -  a number

        Set angle measurement units, i. e. set number
        of 'degrees' for a full circle. Default value is
        360 degrees.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(90)
        >>> turtle.heading()
        90

        Change angle measurement unit to grad (also known as gon,
        grade, or gradian and equals 1/100-th of the right angle.)
        >>> turtle.degrees(400.0)
        >>> turtle.heading()
        100

        N)rr
r�r�r�r:szTNavigator.degreescCs|�dtj�dS)a Set the angle measurement units to radians.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        90
        >>> turtle.radians()
        >>> turtle.heading()
        1.5707963267948966
        r�N)rr�r�r�r�r�r�r^5szTNavigator.radianscCs|j|j|}|�|�dS)z)move turtle forward by specified distanceN)rr�_goto)r�r;Zender�r�r��_goCszTNavigator._gocCs||j9}|j�|�|_dS)z=Turn turtle counterclockwise by specified angle if angle > 0.N)r	rr��r�r�r�r�r��_rotateHs
zTNavigator._rotatecCs
||_dS)zmove turtle to position end.N�r)r��endr�r�r�r
MszTNavigator._gotocCs|�|�dS)aMove the turtle forward by the specified distance.

        Aliases: forward | fd

        Argument:
        distance -- a number (integer or float)

        Move the turtle forward by the specified distance, in the direction
        the turtle is headed.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.forward(25)
        >>> turtle.position()
        (25.00,0.00)
        >>> turtle.forward(-75)
        >>> turtle.position()
        (-50.00,0.00)
        N�r�r�r;r�r�r�rCQszTNavigator.forwardcCs|�|�dS)a�Move the turtle backward by distance.

        Aliases: back | backward | bk

        Argument:
        distance -- a number

        Move the turtle backward by distance, opposite to the direction the
        turtle is headed. Do not change the turtle's heading.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.backward(30)
        >>> turtle.position()
        (-30.00, 0.00)
        Nrrr�r�r�r/hszTNavigator.backcCs|�|�dS)a�Turn turtle right by angle units.

        Aliases: right | rt

        Argument:
        angle -- a number (integer or float)

        Turn turtle right by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.right(45)
        >>> turtle.heading()
        337.0
        N�rrr�r�r�r_|szTNavigator.rightcCs|�|�dS)a�Turn turtle left by angle units.

        Aliases: left | lt

        Argument:
        angle -- a number (integer or float)

        Turn turtle left by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.left(45)
        >>> turtle.heading()
        67.0
        Nrrr�r�r�rP�szTNavigator.leftcCs|jS)z�Return the turtle's current location (x,y), as a Vec2D-vector.

        Aliases: pos | position

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 240.00)
        rr�r�r�r�r[�szTNavigator.poscCs
|jdS)z� Return the turtle's x coordinate.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.xcor()
        50.0
        rrr�r�r�r�r|�szTNavigator.xcorcCs
|jdS)a	 Return the turtle's y coordinate
        ---
        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.ycor()
        86.6025403784
        r�rr�r�r�r�r}�szTNavigator.ycorcCs,|dkr|�t|��n|�t||��dS)atMove turtle to an absolute position.

        Aliases: setpos | setposition | goto:

        Arguments:
        x -- a number      or     a pair/vector of numbers
        y -- a number             None

        call: goto(x, y)         # two coordinates
        --or: goto((x, y))       # a pair (tuple) of coordinates
        --or: goto(vec)          # e.g. as returned by pos()

        Move turtle to an absolute position. If the pen is down,
        a line will be drawn. The turtle's orientation does not change.

        Example (for a Turtle instance named turtle):
        >>> tp = turtle.pos()
        >>> tp
        (0.00, 0.00)
        >>> turtle.setpos(60,30)
        >>> turtle.pos()
        (60.00,30.00)
        >>> turtle.setpos((20,80))
        >>> turtle.pos()
        (20.00,80.00)
        >>> turtle.setpos(tp)
        >>> turtle.pos()
        (0.00,0.00)
        N)r
r)r�r�r�r�r�r�rI�szTNavigator.gotocCs|�dd�|�d�dS)a$Move turtle to the origin - coordinates (0,0).

        No arguments.

        Move turtle to the origin - coordinates (0,0) and set its
        heading to its start-orientation (which depends on mode).

        Example (for a Turtle instance named turtle):
        >>> turtle.home()
        rN)rIrdr�r�r�r�rL�szTNavigator.homecCs|�t||jd��dS)a�Set the turtle's first coordinate to x

        Argument:
        x -- a number (integer or float)

        Set the turtle's first coordinate to x, leave second coordinate
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 240.00)
        >>> turtle.setx(10)
        >>> turtle.position()
        (10.00, 240.00)
        r�N�r
rr)r�r�r�r�r�riszTNavigator.setxcCs|�t|jd|��dS)a�Set the turtle's second coordinate to y

        Argument:
        y -- a number (integer or float)

        Set the turtle's first coordinate to x, second coordinate remains
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 40.00)
        >>> turtle.sety(-10)
        >>> turtle.position()
        (0.00, -10.00)
        rNr)r�r�r�r�r�rjszTNavigator.setycCsT|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}t||j�S)a�Return the distance from the turtle to (x,y) in turtle step units.

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 0.00)
        >>> turtle.distance(30,40)
        50.0
        >>> pen = Turtle()
        >>> pen.forward(77)
        >>> turtle.distance(pen)
        77.0
        N)rr�r�r�r�abs)r�r�r�r[r�r�r�r;%s




zTNavigator.distancecCs�|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}||j\}}tt�||�dtjd�d}||j	}|j
|j||jS)aCReturn the angle of the line from the turtle's position to (x, y).

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Return the angle, between the line from turtle-position to position
        specified by x, y and the turtle's start orientation. (Depends on
        modes - "standard" or "logo")

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (10.00, 10.00)
        >>> turtle.towards(0,0)
        225.0
        Nr�r�r)
rr�r�r�rr�r��atan2r�r	rrr)r�r�r�r[�resultr�r�r�ruEs




 
zTNavigator.towardscCsJ|j\}}tt�||�dtjd�d}||j}|j|j||jS)z� Return the turtle's current heading.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(67)
        >>> turtle.heading()
        67.0
        r�r�r)	rr�r�rr�r	rrr)r�r�r�rr�r�r�rJhs

 
zTNavigator.headingcCs>||��|j}|j}||d||d}|�|�dS)a�Set the orientation of the turtle to to_angle.

        Aliases:  setheading | seth

        Argument:
        to_angle -- a number (integer or float)

        Set the orientation of the turtle to to_angle.
        Here are some common directions in degrees:

         standard - mode:          logo-mode:
        -------------------|--------------------
           0 - east                0 - north
          90 - north              90 - east
         180 - west              180 - south
         270 - south             270 - west

        Example (for a Turtle instance named turtle):
        >>> turtle.setheading(90)
        >>> turtle.heading()
        90
        �@N)rJrrr)r�Zto_angler�Zfullr�r�r�rdwszTNavigator.setheadingcCsp|jr|j�dg�d|j_|��}|dkr2|j}|dkrjt|�|j}dttdt|�dd�|�}d||}d	|}d
|t�	|tj
d|j�}|dkr�|||}}}|��}	|�
�}
|dkr�|�dd�n
|�d�|�|�t|�D].}|�|�|�|�|�d�|�|��q|�|�|dk�rR|�|	|
�|�|�|j�rld
|j_dS)a� Draw a circle with given radius.

        Arguments:
        radius -- a number
        extent (optional) -- a number
        steps (optional) -- an integer

        Draw a circle with given radius. The center is radius units left
        of the turtle; extent - an angle - determines which part of the
        circle is drawn. If extent is not given, draw the entire circle.
        If extent is not a full circle, one endpoint of the arc is the
        current pen position. Draw the arc in counterclockwise direction
        if radius is positive, otherwise in clockwise direction. Finally
        the direction of the turtle is changed by the amount of extent.

        As the circle is approximated by an inscribed regular polygon,
        steps determines the number of steps to use. If not given,
        it will be calculated automatically. Maybe used to draw regular
        polygons.

        call: circle(radius)                  # full circle
        --or: circle(radius, extent)          # arc
        --or: circle(radius, extent, steps)
        --or: circle(radius, steps=6)         # 6-sided polygon

        Example (for a Turtle instance named turtle):
        >>> turtle.circle(50)
        >>> turtle.circle(120, 180)  # semicircle
        �seqTNr��g@g�M@r�r�rr�rF)rr�r�rprrr��minr�r�r�r	�_tracerrMrrr)r��radiusZextent�stepsrpZfracr6Zw2�lZtrZdlr|r�r�r�r4�s>""






zTNavigator.circlecCsdS�z/dummy method - to be overwritten by child classNr�)r�r�r�r�r�rp�szTNavigator.speedcCsdSr"r�)r��ar�r�r�r�r�szTNavigator._tracercCsdSr"r�)r�r�r�r�r�rM�szTNavigator._delay)N)r)N)N)N)NN)r)NN)N).r�r�r�r�rrZDEFAULT_MODEr�rr�r`r�rr:r^rrr
rCr/r_rPr[r|r}rIrLrirjr;rurJrdr4rprrMr@r3r0rbrQr\rerfrcr�r�r�r�r��sZ�

	


#
 
#
A


r�c@s�eZdZdZedfdd�Zededfdd�Zd.d
d�Zd/dd
�Zdd�Z	dd�Z
dd�Zd0dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd1d"d#�Zd2d%d&�Zd3d(d)�Zd*d+�Zd,d-�ZeZe	Ze	Ze
Ze
ZeZeZd	S)4�TPenzFDrawing part of the RawTurtle.
    Implements drawing properties.
    racCs||_d|_t�|�dSr�)�_resizemoderr$�_reset)r�rar�r�r�r��sz
TPen.__init__rWrAcCsFd|_d|_||_||_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr�Tr�)r�r�r�)r�r�r�r�)�_pensize�_shown�	_pencolor�
_fillcolor�_drawing�_speed�_stretchfactor�_shearfactor�_tilt�_shapetrafo�
_outlinewidth)r�rWrAr�r�r�r&�szTPen._resetNcCs.|dkr|jS|��}|dkr*|j|d�dS)azSet resizemode to one of the values: "auto", "user", "noresize".

        (Optional) Argument:
        rmode -- one of the strings "auto", "user", "noresize"

        Different resizemodes have the following effects:
          - "auto" adapts the appearance of the turtle
                   corresponding to the value of pensize.
          - "user" adapts the appearance of the turtle according to the
                   values of stretchfactor and outlinewidth (outline),
                   which are set by shapesize()
          - "noresize" no adaption of the turtle's appearance takes place.
        If no argument is given, return current resizemode.
        resizemode("user") is called by a call of shapesize with arguments.


        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("noresize")
        >>> turtle.resizemode()
        'noresize'
        N)�auto�userr��ra)r%r�rV)r�Zrmoder�r�r�ra�s
zTPen.resizemodecCs|dkr|jS|j|d�dS)a!Set or return the line thickness.

        Aliases:  pensize | width

        Argument:
        width -- positive number

        Set the line thickness to width or return it. If resizemode is set
        to "auto" and turtleshape is a polygon, that polygon is drawn with
        the same line thickness. If no argument is given, current pensize
        is returned.

        Example (for a Turtle instance named turtle):
        >>> turtle.pensize()
        1
        >>> turtle.pensize(10)   # from here on lines of width 10 are drawn
        N)rY)r'rV)r�rzr�r�r�rYszTPen.pensizecCs|js
dS|jdd�dS)z�Pull the pen up -- no drawing when moving.

        Aliases: penup | pu | up

        No argument

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        NF�rX�r+rVr�r�r�r�rZ0s
z
TPen.penupcCs|jr
dS|jdd�dS)z�Pull the pen down -- drawing when moving.

        Aliases: pendown | pd | down

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.pendown()
        NTr5r6r�r�r�r�rX>s
zTPen.pendowncCs|jS)aReturn True if pen is down, False if it's up.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        >>> turtle.isdown()
        False
        >>> turtle.pendown()
        >>> turtle.isdown()
        True
        )r+r�r�r�r�rNLs
zTPen.isdowncCsjdddddd�}|dkr|jS||kr0||}n*d|krDd	krVnntt|��}nd}|j|d
�dS)a� Return or set the turtle's speed.

        Optional argument:
        speed -- an integer in the range 0..10 or a speedstring (see below)

        Set the turtle's speed to an integer value in the range 0 .. 10.
        If no argument is given: return current speed.

        If input is a number greater than 10 or smaller than 0.5,
        speed is set to 0.
        Speedstrings  are mapped to speedvalues in the following way:
            'fastest' :  0
            'fast'    :  10
            'normal'  :  6
            'slow'    :  3
            'slowest' :  1
        speeds from 1 to 10 enforce increasingly faster animation of
        line drawing and turtle turning.

        Attention:
        speed = 0 : *no* animation takes place. forward/back makes turtle jump
        and likewise left/right make the turtle turn instantly.

        Example (for a Turtle instance named turtle):
        >>> turtle.speed(3)
        rr�r�r�r�)ZfastestZfast�normalZslowZslowestNr�g%@)rp)r,r�r�rV)r�rpZspeedsr�r�r�rp[s
z
TPen.speedcGs�|rht|�}|dkr"|d}}n"|dkr4|\}}n|dkrD|}}|�|�}|�|�}|j||d�n|�|j�|�|j�fSdS)a�Return or set the pencolor and fillcolor.

        Arguments:
        Several input formats are allowed.
        They use 0, 1, 2, or 3 arguments as follows:

        color()
            Return the current pencolor and the current fillcolor
            as a pair of color specification strings as are returned
            by pencolor and fillcolor.
        color(colorstring), color((r,g,b)), color(r,g,b)
            inputs as in pencolor, set both, fillcolor and pencolor,
            to the given value.
        color(colorstring1, colorstring2),
        color((r1,g1,b1), (r2,g2,b2))
            equivalent to pencolor(colorstring1) and fillcolor(colorstring2)
            and analogously, if the other input format is used.

        If turtleshape is a polygon, outline and interior of that polygon
        is drawn with the newly set colors.
        For more info see: pencolor, fillcolor

        Example (for a Turtle instance named turtle):
        >>> turtle.color('red', 'green')
        >>> turtle.color()
        ('red', 'green')
        >>> colormode(255)
        >>> color((40, 80, 120), (160, 200, 240))
        >>> color()
        ('#285078', '#a0c8f0')
        r�rr�r�)rWrAN)r�r�rVr�r)r*)r�rr!ZpcolorZfcolorr�r�r�r9�s 


z
TPen.colorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)aZ Return or set the pencolor.

        Arguments:
        Four input formats are allowed:
          - pencolor()
            Return the current pencolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - pencolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - pencolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - pencolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the outline of that polygon is drawn
        with the newly set pencolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.pencolor('brown')
        >>> tup = (0.2, 0.8, 0.55)
        >>> turtle.pencolor(tup)
        >>> turtle.pencolor()
        '#33cc8c'
        N)rW)r�r)rVr�r�r�r�r�rW�s

z
TPen.pencolorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)a] Return or set the fillcolor.

        Arguments:
        Four input formats are allowed:
          - fillcolor()
            Return the current fillcolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - fillcolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - fillcolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - fillcolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the interior of that polygon is drawn
        with the newly set fillcolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.fillcolor('violet')
        >>> col = turtle.pencolor()
        >>> turtle.fillcolor(col)
        >>> turtle.fillcolor(0, .5, 0)
        N)rA)r�r*rVr�r�r�r�r�rA�s

zTPen.fillcolorcCs|jdd�dS)z�Makes the turtle visible.

        Aliases: showturtle | st

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> turtle.showturtle()
        T��shownN�rVr�r�r�r�ro�szTPen.showturtlecCs|jdd�dS)aYMakes the turtle invisible.

        Aliases: hideturtle | ht

        No argument.

        It's a good idea to do this while you're in the
        middle of a complicated drawing, because hiding
        the turtle speeds up the drawing observably.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        Fr8Nr:r�r�r�r�rK	szTPen.hideturtlecCs|jS)z�Return True if the Turtle is shown, False if it's hidden.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> print turtle.isvisible():
        False
        )r(r�r�r�r�rO	s
zTPen.isvisiblecKs�|j|j|j|j|j|j|j|j|j|j	|j
d�}|s>|s>|St|t�rN|}ni}|�
|�i}|D]}||||<qd|jr�|j�d|f�d}d|kr�|j|dkr�d}d|kr�t|dt�r�|�|df�|d<|j|dkr�d}d|k�r|j|dk�rd}|�r|��d|k�r&|d|_d|k�r:|d|_d|k�rN|d|_d|k�r�t|dt��r||�|df�|d<|d|_d	|k�r�|d	|_d
|k�r�|d
|_d|k�r�|d}t|ttf��r�||f}||_d|k�r�|d|_d
|k�r|d
|_	d|k�r|d|_d|k�r.|d|_
d|k�sLd|k�sLd|k�r�|j\}	}
|j}t�|j
�t�|j
�}}
|	|
|
||
||	||
|
||f|_|��dS)aLReturn or set the pen's attributes.

        Arguments:
            pen -- a dictionary with some or all of the below listed keys.
            **pendict -- one or more keyword-arguments with the below
                         listed keys as keywords.

        Return or set the pen's attributes in a 'pen-dictionary'
        with the following key/value pairs:
           "shown"      :   True/False
           "pendown"    :   True/False
           "pencolor"   :   color-string or color-tuple
           "fillcolor"  :   color-string or color-tuple
           "pensize"    :   positive number
           "speed"      :   number in range 0..10
           "resizemode" :   "auto" or "user" or "noresize"
           "stretchfactor": (positive number, positive number)
           "shearfactor":   number
           "outline"    :   positive number
           "tilt"       :   number

        This dictionary can be used as argument for a subsequent
        pen()-call to restore the former pen-state. Moreover one
        or more of these attributes can be provided as keyword-arguments.
        This can be used to set several pen attributes in one statement.


        Examples (for a Turtle instance named turtle):
        >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10)
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'black',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> penstate=turtle.pen()
        >>> turtle.color("yellow","")
        >>> turtle.penup()
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'yellow', 'pendown': False, 'fillcolor': '',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> p.pen(penstate, fillcolor="green")
        >>> p.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'green',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        )r9rXrWrArYrpra�
stretchfactorrnr9rsrVFrXTrWrYrArprar;rnr9r9rsN)r(r+r)r*r'r,r%r-r.r1r/r��dictr,rr�r�r��_newLiner�r�r�r�r�r0rJ)r�rVZpendictZ_pd�pZ_p_bufr�ZnewLineZsfZscxZscyZshf�sa�car�r�r�rV!	s�/�

























�zTPen.penTcCsdSr"r��r�ZusePosr�r�r�r=�	sz
TPen._newLineFcCsdSr"r�)r�r�Zforcedr�r�r�rJ�	szTPen._updatecCsdSr"r�rr�r�r�r��	szTPen._colorcCsdSr"r�rr�r�r�r��	szTPen._colorstr)N)N)N)N)T)TF)r�r�r�r�r�r�r&rarYrZrXrNrpr9rWrArorKrOrVr=rJr�r�rzryr]rUr=rqrMr�r�r�r�r$�s:�



&.%$



r$c@s eZdZdZdd�Zdd�ZdS)�_TurtleImagez6Helper class: Datatype to store Turtle attributes
    cCs||_d|_|�|�dSr�)r�ry�	_setshape)r�r��
shapeIndexr�r�r�r��	sz_TurtleImage.__init__cs�|j�||_|jdkr*�j|jkr2nndS|jdkrP�j|jkrXnndS|jdkrp��|j�n |jdkr�|jD]}��|�q��j|j|_|jdkr����|_nF|jdkrԈ��jdj�|_n&|jdkr��fdd��j|jD�|_dS)Nr�rt)rtr�r�r/csg|]}����qSr��r:�r{rH�r�r�r�r~�	sz*_TurtleImage._setshape.<locals>.<listcomp>)	r�rDryr�rI�_itemr:rur�)r�rDrHr�rGr�rC�	s(""







�z_TurtleImage._setshapeN)r�r�r�r�r�rCr�r�r�r�rB�	srBc@s�eZdZdZgZdedededfdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dmdd�Zdd�Zdd�Zdd�Zdd�Zdnd d!�Zdod"d#�Zdpd$d%�Zd&d'�Zdqd(d)�Zd*d+�Zdrd,d-�Zd.d/�Zd0d1�Zdsd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z dtd=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dudFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dvdNdO�Z)dPdQ�Z*dwdTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0e0Z1dxd`da�Z2dydcdd�Z3dzdedf�Z4d{dgdh�Z5didj�Z6dkdl�Z7eZ8dS)|r
zvAnimation part of the RawTurtle.
    Puts RawTurtle upon a TurtleScreen and provides tools for
    its animation.
    Nrkr�r�cCs4t|t�r||_n|t|t�r:|tjkr2tj�|�||_nTt|ttf�r�tjD]}|j	|krN||_q�qNt|�|_tj�|j�nt
d|��|j}t�||�
��t�|�|j�|�|��|_t||�|_d|_d|_d|_|_||_d|_|��|_|jg|_|jg|_g|_||_t |�|_!|�"�dS)Nzbad canvas argument %sF)#r��_Screenr�rr
�screensr>rr�r.r�r�r�rr$r�rD�drawingLineItemrBr��_poly�
_creatingPoly�	_fillitem�	_fillpathr(�_hidden_from_screen�currentLineItemr�currentLiner��
stampItems�_undobuffersizer�rrJ)r�Zcanvasrkr�r�r�r�r�r�r��	s@











zRawTurtle.__init__cCs0t�|�t�|�|��|��|��dS)a�Delete the turtle's drawings and restore its default values.

        No argument.

        Delete the turtle's drawings from the screen, re-center the turtle
        and set variables to the default values.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00,-22.00)
        >>> turtle.heading()
        100.0
        >>> turtle.reset()
        >>> turtle.position()
        (0.00,0.00)
        >>> turtle.heading()
        0.0
        N)r�r`r$r&�_clearr�rJr�r�r�r�r`
s


zRawTurtle.resetcCs&|dks|dkrd|_n
t|�|_dS)a�Set or disable undobuffer.

        Argument:
        size -- an integer or None

        If size is an integer an empty undobuffer of given size is installed.
        Size gives the maximum number of turtle-actions that can be undone
        by the undo() function.
        If size is None, no undobuffer is present.

        Example (for a Turtle instance named turtle):
        >>> turtle.setundobuffer(42)
        Nr)rr�)r��sizer�r�r�rh
szRawTurtle.setundobuffercCs|jdkrdS|j��S)z�Return count of entries in the undobuffer.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> while undobufferentries():
        ...     undo()
        Nr)rr�r�r�r�r�rx,
s	
zRawTurtle.undobufferentriescCsld|_|_|jD]}|j�|�q|j��|_g|_|jrJ|j�	|j
�|jg|_|��|�|j
�dS)zDelete all of pen's drawingsN)rNrOr�r�rIrDrQrRr+r>rr7rhrTrGr�r�r�rU9
s

zRawTurtle._clearcCs|��|��dS)agDelete the turtle's drawings from the screen. Do not move turtle.

        No arguments.

        Delete the turtle's drawings from the screen. Do not move turtle.
        State and position of the turtle as well as drawings of other
        turtles are not affected.

        Examples (for a Turtle instance named turtle):
        >>> turtle.clear()
        N)rUrJr�r�r�r�r5G
szRawTurtle.clearcCsF|j��|jjdkrdSt|j�dkrB|j�|j|j|j|j�dSr�)	r�r�r�r�rRrErQr)r'r�r�r�r�r�V
s
�zRawTurtle._update_datacCsx|j}|jdkrdS|jdkrD|��|��|��|�|j�n0|��|jdkrt|��D]}|��q^|��dS)z&Perform a Turtle-data update.
        rNr�)	r�r�r�r�rJrMr�r�r+)r�r�rqr�r�r�rJ^
s



zRawTurtle._updatecCs|j�||�S)amTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a Turtle instance named turtle):
        >>> turtle.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     turtle.fd(dist)
        ...     turtle.rt(90)
        ...     dist += 2
        )r�r*)r��flagrr�r�r�rp
szRawTurtle._tracercCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorcCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorstrc	Cs�t|t�r|Sz|\}}}Wn(ttfk
rDtdt|���YnX|jjdkrldd�|||fD�\}}}d|kr�dkr�nn.d|kr�dkr�nnd|kr�dks�ntdt|���d|||fS)	z,Convert colortriples to hexstrings.
        r�r�cSsg|]}td|��qSr�r�r�r�r�r�r~�
sz!RawTurtle._cc.<locals>.<listcomp>rr�r�r�)r�r�r�r�r�r�r�)r�rr�r�r�r�r�r��_cc�
s
Fz
RawTurtle._cccs�|j�|�|j�|j}d|_d|_t|�}�|_||_�|_t�|jj�|_�j�|��j	|jjj
}|dkr����|j_nJ|dkr���
�j	dj�|j_n*|dkrʇfdd��j	|jjjD�|j_���|_|��|S)aCreate and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
        Nr�rtr/r�csg|]}����qSr�rErFrGr�r�r~�
sz#RawTurtle.clone.<locals>.<listcomp>)r�r=r+r�rrBrDr�r>r�ryr:rHrur�rDrQrJ)r�r��q�ttyper�rGr�r8�
s.
�

zRawTurtle.clonecCsB|dkr|jjS||j��kr*td|��|j�|�|��dS)a�Set turtle shape to shape with given name / return current shapename.

        Optional argument:
        name -- a string, which is a valid shapename

        Set turtle shape to shape with given name or, if name is not given,
        return name of current shape.
        Shape with name must exist in the TurtleScreen's shape dictionary.
        Initially there are the following polygon shapes:
        'arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'.
        To learn about how to deal with shapes see Screen-method register_shape.

        Example (for a Turtle instance named turtle):
        >>> turtle.shape()
        'arrow'
        >>> turtle.shape("turtle")
        >>> turtle.shape()
        'turtle'
        NzThere is no shape named %s)r�rDr�rr�rCrJ)r�r�r�r�r�rk�
szRawTurtle.shapecCs�||kr|krdkr8nn|j\}}|||jfS|dksH|dkrPtd��|dk	rt|dkrj||f}q�||f}n|dk	r�|jd|f}n|j}|dkr�|j}|jd||d�dS)aOSet/return turtle's stretchfactors/outline. Set resizemode to "user".

        Optional arguments:
           stretch_wid : positive number
           stretch_len : positive number
           outline  : positive number

        Return or set the pen's attributes x/y-stretchfactors and/or outline.
        Set resizemode to "user".
        If and only if resizemode is set to "user", the turtle will be displayed
        stretched according to its stretchfactors:
        stretch_wid is stretchfactor perpendicular to orientation
        stretch_len is stretchfactor in direction of turtles orientation.
        outline determines the width of the shapes's outline.

        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("user")
        >>> turtle.shapesize(5, 5, 12)
        >>> turtle.shapesize(outline=8)
        Nrz(stretch_wid/stretch_len must not be zeror3)rar;r9)r-r1r�rV)r�Zstretch_widZstretch_lenr9r;r�r�r�rl�
s$"


�zRawTurtle.shapesizecCs |dkr|jS|jd|d�dS)a�Set or return the current shearfactor.

        Optional argument: shear -- number, tangent of the shear angle

        Shear the turtleshape according to the given shearfactor shear,
        which is the tangent of the shear angle. DO NOT change the
        turtle's heading (direction of movement).
        If shear is not given: return the current shearfactor, i. e. the
        tangent of the shear angle, by which lines parallel to the
        heading of the turtle are sheared.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.shearfactor(0.5)
        >>> turtle.shearfactor()
        >>> 0.5
        Nr3)rarn)r.rV)r�Zshearr�r�r�rnszRawTurtle.shearfactorcCs<||j|j}|tjddtj}|jd|d�dS)aIRotate the turtleshape to point in the specified direction

        Argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).


        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.settiltangle(45)
        >>> stamp()
        >>> turtle.fd(50)
        >>> turtle.settiltangle(-45)
        >>> stamp()
        >>> turtle.fd(50)
        r�r�r3)rarsN)r	rr�r�rV�r�r�rsr�r�r�rgszRawTurtle.settiltanglecCs>|dkr0|jdtj|j}||j|jS|�|�dS)a�Set or return the current tilt-angle.

        Optional argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).
        If angle is not given: return the current tilt-angle, i. e. the angle
        between the orientation of the turtleshape and the heading of the
        turtle (its direction of movement).

        Deprecated since Python 3.1

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(45)
        >>> turtle.tiltangle()
        Nr�)r/r�r�rr	rrgr[r�r�r�rt4szRawTurtle.tiltanglecCs|�||���dS)a�Rotate the turtleshape by angle.

        Argument:
        angle - a number

        Rotate the turtleshape by angle from its current tilt-angle,
        but do NOT change the turtle's heading (direction of movement).

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        N)rgrtrr�r�r�rsNszRawTurtle.tiltcCs6||kr(|kr(|kr(dkr2nn|jS|j\}}}}|dk	rL|}|dk	rX|}|dk	rd|}|dk	rp|}||||dkr�td��||||f|_t�||�dtj}	t�|	�t�|	�}
}|||
||||
||
||||
|||f\}}
}}||f|_|
||_|	|_	|j
dd�dS)a�Set or return the current transformation matrix of the turtle shape.

        Optional arguments: t11, t12, t21, t22 -- numbers.

        If none of the matrix elements are given, return the transformation
        matrix.
        Otherwise set the given elements and transform the turtleshape
        according to the matrix consisting of first row t11, t12 and
        second row t21, 22.
        Modify stretchfactor, shearfactor and tiltangle according to the
        given matrix.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapesize(4,2)
        >>> turtle.shearfactor(-0.5)
        >>> turtle.shapetransform()
        (4.0, -1.0, -0.0, 2.0)
        Nrz0Bad shape transform matrix: must not be singularr�r3r4)r0r�r�rr�r�r�r-r.r/rV)r��t11�t12�t21�t22Zm11Zm12Zm21Zm22Zalfar?r@Za11Za12Za21Za22r�r�r�rmas0,�

zRawTurtle.shapetransformcs^|j�|j\��|j\��t���j�j�}dt|�|\�������fdd�|D�S)zlComputes transformed polygon shapes from a shape
        according to current position and heading.
        r�csFg|]>\}}��|�|�j��|�|�jf�qSr�)r4r5�r{r�r��Ze0Ze1Zp0Zp1r�r�r�r~�s�z(RawTurtle._polytrafo.<locals>.<listcomp>)r�rrrr5r4r)r�r��er�rar��
_polytrafo�s

�zRawTurtle._polytrafocCs2|jj|jj}|jdkr.|�|j|jdk�SdS)a@Return the current shape polygon as tuple of coordinate pairs.

        No argument.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapetransform(4, -1, 0, 2)
        >>> turtle.get_shapepoly()
        ((50, -20), (30, 20), (-50, 20), (-30, -20))

        r�r�N)r�r�r�rDry�
_getshapepolyr�)r�rkr�r�r�rG�s
zRawTurtle.get_shapepolyFcsx|jdks|r|j\����n>|jdkrNtd|jd�}|dd|f\����n|jdkr\|St����fdd�|D��S)	z`Calculate transformed shape polygon according to resizemode
        and shapetransform.
        r3r2r�g@rr�c3s2|]*\}}�|�|�|�|fVqdSr�r�r`�r\r]r^r_r�r�r��sz*RawTurtle._getshapepoly.<locals>.<genexpr>)r%r0�maxr'r�)r�r�r�r!r�rer�rd�s

zRawTurtle._getshapepolyc	Cs�|j}|j|jj}|j}|jj}|j�r*|jdk�r*|jdk�r*d|_	|j
}|dkr�|jdkrfd}n|jdkrx|j}n|j
}|�|�|��}|j|j}}|j|||||dd�nt|d	kr�|�||j|�nZ|d
k�r�t||�D]D\}	\}
}}|�|�|
d��}
|j|	|
|�|�|�|�|j
dd�q�nx|j	�r6dS|dk�rR|�|dd
d
�nJ|d	k�rv|�||j|jdj
�n&|d
k�r�|D]}	|�|	dd
d
��q�d|_	dS)zpManages the correct rendering of the turtle with respect to
        its shape, resizemode, stretch and tilt etc.rFr�r�r�r2T�r"r9rzrArtr�N�r�r�r�r�r/)r�r�r�rDryrHr(r�r�rPr�r%r'r1rcrdr*r)rCrwr�ziprX)r�r�rkrZZtitem�tshaper6�fc�ocrHr�r�r�r�r��sR 

�
�




�
zRawTurtle._drawturtlec	CsT|j}|j|jj}|j}|j}|dkr�|��}|jdkr@d}n|jdkrR|j}n|j	}|�
|�|��}|j|j
}}|j|||||dd�n�|dkr�|�d�}|�||j|�n�|d	k�r4g}|D]}	|��}
|�|
�q�t|�}t||�D]D\}
\}}}|�
|�|d��}|j|
||�|�|�|�|j	dd�q�|j�|�|j�d
|f�|S)a�Stamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
        r�r�r�r2Trgrtr�r�rr)r�r�r�rDryr�r:r%r'r1rcrdr*r)rCrurwrr>r�rirXrSrr�)r�r�rkrZrj�stitemr6rkrlZelementrHr�r�r�r�rr�sH

�

�zRawTurtle.stampcCs�||jkrDt|t�r,|D]}|j�|�qn|j�|�|j�|�d|f}|j}||jkr`dS|j�|�}|j�|�||j	kr�|j	d|j
|_	|j�|j	d|j
dg�dS)z9does the work for clearstamp() and clearstamps()
        rrNr�)rSr�r�r�rIr�rr��indexr�r��insert)r��stampidZsubitemrHZbufrnr�r�r��_clearstamps



zRawTurtle._clearstampcCs|�|�|��dS)aDDelete stamp with given stampid

        Argument:
        stampid - an integer, must be return value of previous stamp() call.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> astamp = turtle.stamp()
        >>> turtle.fd(50)
        >>> turtle.clearstamp(astamp)
        N)rqrJ)r�rpr�r�r�r6s
zRawTurtle.clearstampcCs^|dkr|jdd�}n&|dkr0|jd|�}n|j|d�}|D]}|�|�qB|��dS)a�Delete all or first/last n of turtle's stamps.

        Optional argument:
        n -- an integer

        If n is None, delete all of pen's stamps,
        else if n > 0 delete first n stamps
        else if n < 0 delete last n stamps.

        Example (for a Turtle instance named turtle):
        >>> for i in range(8):
        ...     turtle.stamp(); turtle.fd(30)
        ...
        >>> turtle.clearstamps(2)
        >>> turtle.clearstamps(-2)
        >>> turtle.clearstamps()
        Nr)rSrqrJ)r�r�ZtoDeleterHr�r�r�r7-szRawTurtle.clearstampsc
Cs�|j|j|jt|jt�f}|j}d|j|||j|j	dd�|�
|j�|jdd�ff}|jrh|j�
|�|j}|j�rZ|jdk�rZ||}|d|jd|d|jd}dt|ddd|j|j�}|d	|}	td|�D]R}
|
dkr�d
}nd}||	|
|_|j�r2|�|j||jf|j|j|�|��q�|j�rZ|j|jdd
|jd�|j�rn|j	�|�t|jt��r�|j�|�||_|j�r�|j�|�t|j	�dk�r�|��|��dS)z�Move the pen to the point end, thereby drawing a line
        if pen is down. All other methods for turtle movement depend
        on this one.
        �goNr�rr�r�r�皙�����?r�TF�r�r�r��r"rz�*)r+r)r'r�rOr�r�rrQrRr�r�rr�r,r�r4r5r�rrErKrJr>rMrLr�r=)r�r�go_modesr�Z
undo_entry�start�diff�diffsq�nhops�deltar�rAr�r�r�r
Isb
�

��$$�

�zRawTurtle._gotocs|\}}}}|\}}}}	|\}
}}�|j�t|j|�dkrDtd�|
|_||_|ddgkrbd}
n|}
�j|
||
|d���fdd�|jD�}|D]}��|�|j�	|�q�|}|j
�r��jdk�r�||}|d	�jd
|d�j
d
}dt|ddd|j
|j
�}|d
|}td|�D]P}|dk�r@d}nd}||||_|�rr��|j||jf|||�|���q,|�r��j|jdd|d�||_|j�r�t|j�d	k�r�|j��|jgk�r�d|_d|_|	�r|jgk�r�d|_td�n|jdk	�r|j��|��dS)z)Reverse a _goto. Used for undo()
        r�z$undogoto: HALLO-DA-STIMMT-WAS-NICHT!r�r�rucs&g|]}|�kr��|�dkr|�qS)r�)ryrz�r�r�r�r�r~�s�z'RawTurtle._undogoto.<locals>.<listcomp>r�rr�r�rsr�TFrtNzUnwahrscheinlich in _undogoto!)r�rrr�rQrRrEr�rIr�r,r�r4r5r�rrKrJrMr�rLr�rO)r��entry�old�newrwZcoodataZdrawingZpcZpsrBZcLIZcLr�ZusepcZtodeleter|rxryrzr{r|r�rAr�r}r��	_undogoto~sl
$$
�
�


zRawTurtle._undogotocCs�|jr|j�d||jf�||j9}|j�|�}|jj}|dkr�|jdkr�d|j}dtt	|�|�}d||}t
|�D]}|j�|�|_|��q|||_|��dS)z&Turns pen clockwise by angle.
        �rotr�rg@r�N)rr�r	rr�r�r�r,r�rrrJ)r�r�Z	neworientr�Zanglevelr r|r�r�r�r�r�s


zRawTurtle._rotateTcCsnt|j�dkrD|j�|j|j|j|j�|j��|_|j�	|j�n|jj|jdd�g|_|rj|j
g|_dS)z�Closes current line item and starts a new one.
           Remark: if current line became too long, animation
           performance (via _drawline) slowed down considerably.
        r�T)rAN)r�rRr�rErQr)r'rDr�r>rrAr�r�r�r=�s�zRawTurtle._newLinecCst|jt�S)aReturn fillstate (True if filling, False else).

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> if turtle.filling():
        ...     turtle.pensize(5)
        ... else:
        ...     turtle.pensize(3)
        )r�rOr�r�r�r�r�rB�szRawTurtle.fillingcCsX|��s"|j��|_|j�|j�|jg|_|��|j	rL|j	�
d|jf�|��dS)aCalled just before drawing a shape to be filled.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        �	beginfillN)rBr�r:rNr�r>rrOr=rr�rJr�r�r�r�r1�s
zRawTurtle.begin_fillcCs^|��rZt|j�dkrF|jj|j|j|jd�|jrF|j�d|jf�d|_|_|�	�dS)aFill the shape drawn after the call begin_fill().

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        r�r;�dofillN)
rBr�rOr�rCrNr*rr�rJr�r�r�r�r>
s�zRawTurtle.end_fillc	Gs8|sNt|ttf�r0|�|�}|jt|jd�}qr|j}|sr|jt|jd�}n$|dkrh|jt|jd�}|�|�}t|jd�r�|j�	|j
||�}|j�|�|j
r�|j
�d|f�n�|��}|j
r�|j
�dg�d|j
_z>|��dkr�|��|��|�|�|�|�|�d�W5|�|�X|j
�r4d	|j
_dS)
a�Draw a dot with diameter size, using color.

        Optional arguments:
        size -- an integer >= 1 (if given)
        color -- a colorstring or a numeric color tuple

        Draw a circular dot with diameter size, using color.
        If size is not given, the maximum of pensize+4 and 2*pensize is used.

        Example (for a Turtle instance named turtle):
        >>> turtle.dot()
        >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
        r�N�_dotr<rTr2rF)r�r�r�r�r'rfr)�hasattrr�r�rr�r>rr�rVr�rarMrXrYrWrC)r�rVr9rHrVr�r�r�r<
s:



z
RawTurtle.dotcCsB|j�|j||||j�\}}|j�|�|jr>|j�d|f�|S)z)Performs the writing for write()
        �wri)r�rXrr)r�r>rr�)r�rVrWrUrHrr�r�r�rXH
s�zRawTurtle._writerP��Arialr�r7cCs`|jr|j�dg�d|j_|�t|�|��|�}|rN|��\}}|�||�|jr\d|j_dS)a�Write text at the current turtle position.

        Arguments:
        arg -- info, which is to be written to the TurtleScreen
        move (optional) -- True/False
        align (optional) -- one of the strings "left", "center" or right"
        font (optional) -- a triple (fontname, fontsize, fonttype)

        Write text - the string representation of arg - at the current
        turtle position according to align ("left", "center" or right")
        and with the given font.
        If move is True, the pen is moved to the bottom-right corner
        of the text. By default, move is False.

        Example (for a Turtle instance named turtle):
        >>> turtle.write('Home = ', True, align="center")
        >>> turtle.write((0,0), True)
        rTFN)rr�r�rXr�r�r[re)r��argZmoverWrUrr�r�r�r�r�r{R
szRawTurtle.writecCs|jg|_d|_dS)aStart recording the vertices of a polygon.

        No argument.

        Start recording the vertices of a polygon. Current turtle position
        is first point of polygon.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_poly()
        TN)rrLrMr�r�r�r�r2o
s
zRawTurtle.begin_polycCs
d|_dS)a7Stop recording the vertices of a polygon.

        No argument.

        Stop recording the vertices of a polygon. Current turtle position is
        last point of polygon. This will be connected with the first point.

        Example (for a Turtle instance named turtle):
        >>> turtle.end_poly()
        FN)rMr�r�r�r�r?}
szRawTurtle.end_polycCs|jdk	rt|j�SdS)z�Return the lastly recorded polygon.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> p = turtle.get_poly()
        >>> turtle.register_shape("myFavouriteShape", p)
        N)rLr�r�r�r�r�rD�
s

zRawTurtle.get_polycCs|jS)a�Return the TurtleScreen object, the turtle is drawing  on.

        No argument.

        Return the TurtleScreen object, the turtle is drawing  on.
        So TurtleScreen-methods can be called for that object.

        Example (for a Turtle instance named turtle):
        >>> ts = turtle.getscreen()
        >>> ts
        <turtle.TurtleScreen object at 0x0106B770>
        >>> ts.bgcolor("pink")
        rGr�r�r�r�rF�
szRawTurtle.getscreencCs|S)aUReturn the Turtleobject itself.

        No argument.

        Only reasonable use: as a function to return the 'anonymous turtle':

        Example:
        >>> pet = getturtle()
        >>> pet.fd(50)
        >>> pet
        <turtle.Turtle object at 0x0187D810>
        >>> turtles()
        [<turtle.Turtle object at 0x0187D810>]
        r�r�r�r�r�rH�
szRawTurtle.getturtlecCs|j�|�S)zDSet delay value which determines speed of turtle animation.
        )r�rrLr�r�r�rM�
szRawTurtle._delayr�cCs"|j�|jj|||�|��dS)a�Bind fun to mouse-click event on this turtle on canvas.

        Arguments:
        fun --  a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).
        add --  True or False. If True, new binding will be added, otherwise
                it will replace a former binding.

        Example for the anonymous turtle, i. e. the procedural way:

        >>> def turn(x, y):
        ...     left(360)
        ...
        >>> onclick(turn)  # Now clicking into the turtle will turn it.
        >>> onclick(None)  # event-binding will be removed
        N)r�rer�rHrJr�r�r�r�rR�
szRawTurtle.onclickcCs"|j�|jj|||�|��dS)a�Bind fun to mouse-button-release event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).

        Example (for a MyTurtle instance named joe):
        >>> class MyTurtle(Turtle):
        ...     def glow(self,x,y):
        ...             self.fillcolor("red")
        ...     def unglow(self,x,y):
        ...             self.fillcolor("")
        ...
        >>> joe = MyTurtle()
        >>> joe.onclick(joe.glow)
        >>> joe.onrelease(joe.unglow)

        Clicking on joe turns fillcolor red, unclicking turns it to
        transparent.
        N)r�rfr�rHrJr�r�r�r�rT�
szRawTurtle.onreleasecCs|j�|jj|||�dS)a�Bind fun to mouse-move event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
               the coordinates of the clicked point on the canvas.
        btn -- number of the mouse-button defaults to 1 (left mouse button).

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.

        Example (for a Turtle instance named turtle):
        >>> turtle.ondrag(turtle.goto)

        Subsequently clicking and dragging a Turtle will move it
        across the screen thereby producing handdrawings (if pen is
        down).
        N)r�rgr�rHr�r�r�r�rS�
szRawTurtle.ondragcCs,|jdkrdS|dkr@|\}}|�|||j�|j��}n�|dkr\|d}|�|�n�|dkrp|�|�n�|dkr�|d}|j�|�|j�	|�n�|dkr�|d}|jj
|dd	d	d
�nh|dk�r|d}d|_|_||jk�r(|j�|�|j�	|�n$|dk�r(t
�||d�|j��dS)
z2Does the main part of the work for undo()
        Nr�rrrrr)r�r<r�rhr�r8r�rV)rrr	r�r6r�r�rIr�r�rCrNrOr$rV)r��actionr�r�ZdegPAUZdummyrmrHr�r�r��_undos<

�

zRawTurtle._undocCsl|jdkrdS|j��}|d}|dd�}|dkr\|rh|��}|�|d|dd��q4n|�||�dS)a�undo (repeatedly) the last turtle action.

        No argument.

        undo (repeatedly) the last turtle action.
        Number of available undo actions is determined by the size of
        the undobuffer.

        Example (for a Turtle instance named turtle):
        >>> for i in range(4):
        ...     turtle.fd(50); turtle.lt(80)
        ...
        >>> for i in range(8):
        ...     turtle.undo()
        ...
        Nrr�r)rr�r�)r�rHr�r�r�r�r�rw's

zRawTurtle.undo)NN)N)NNN)N)N)NNNN)F)N)T)N)FrPr�)N)r�N)r�N)r�N)9r�r�r�r�rJr�r�r`rhrxrUr5r�rJrr�r�rXr8rkrlrnrgrtrsrmrcrGrdr�rrrqr6r7r
r�rr=rBr1r>r<rXr{r2r?rDrFrHrErMrRrTrSr�rwrvr�r�r�r�r
�	sr�
(

(

(


(

(-
5A

0







 cCstjdkrt�t_tjS)z�Return the singleton screen object.
    If none exists at the moment, create a new one and return it,
    else return the existing one.N)r�_screenrIr�r�r�r�r	Js
c@sfeZdZdZdZedZdd�Zededededfd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rINr)cCs�tjdkr4t�t_|_|j�tj�|j�|j�tjdkr�td}td}td}td}td}td}|j�	||||�|j�
�t_t�|tj�|�
||||�dS)Nrzr�r�r�r�r�)rI�_rootrr)�_titler)�_destroyrr�r#r$rr�r&)r�rzr�r�r�r�r�r�r�r�r�Xs

z_Screen.__init__rzr�r�r�cCs�t|jd�sdS|j��}|j��}t|t�rNd|krBdkrNnn||}|dkrb||d}t|t�r�d|kr�dkr�nn||}|dkr�||d}|j�||||�|��dS)a Set the size and position of the main window.

        Arguments:
        width: as integer a size in pixels, as float a fraction of the screen.
          Default is 50% of screen.
        height: as integer the height in pixels, as float a fraction of the
          screen. Default is 75% of screen.
        startx: if positive, starting position in pixels from the left
          edge of the screen, if negative from the right edge
          Default, startx=None is to center window horizontally.
        starty: if positive, starting position in pixels from the top
          edge of the screen, if negative from the bottom edge
          Default, starty=None is to center window vertically.

        Examples (for a Screen instance named screen):
        >>> screen.setup (width=200, height=200, startx=0, starty=0)

        sets window to 200x200 pixels, in upper left of screen

        >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)

        sets window to 75% of screen by 50% of screen and centers
        r'Nrr�r�)r�r�r*r+r�r�r'r,)r�rzr�r%r&rQZshr�r�r�r&ns

""z
_Screen.setupcCs tjdk	rtj�|�|t_dS)aqSet title of turtle-window

        Argument:
        titlestring -- a string, to appear in the titlebar of the
                       turtle graphics window.

        This is a method of Screen-class. Not available for TurtleScreen-
        objects.

        Example (for a Screen instance named screen):
        >>> screen.title("Welcome to the turtle-zoo!")
        N)rIr�r)r�)r�Ztitlestringr�r�r�r)�s
z
_Screen.titlecCs:|j}|tjkr(dt_dt_dt_dt_dt_|��dS)NF)	r�rIrr�r�rrr�r()r��rootr�r�r�r��s
z_Screen._destroycCs|��dS)z~Shut the turtlegraphics window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bye()
        N)r�r�r�r�r�r�sz_Screen.byecsN�fdd�}��|�tdr"dSz
t�Wntk
rHtd�YnXdS)alGo into mainloop until the mouse is clicked.

        No arguments.

        Bind bye() method to mouseclick on TurtleScreen.
        If "using_IDLE" - value in configuration dictionary is False
        (default value), enter mainloop.
        If IDLE with -n switch (no subprocess) is used, this value should be
        set to True in turtle.cfg. In this case IDLE's mainloop
        is active also for the client script.

        This is a method of the Screen-class and not available for
        TurtleScreen instances.

        Example (for a Screen instance named screen):
        >>> screen.exitonclick()

        cs���dS)z&Screen.bye() with two dummy-parametersN)r)r�r�r�r�r��exitGracefully�sz+_Screen.exitonclick.<locals>.exitGracefullyr�Nr)rRr�r�AttributeError�exit)r�r�r�r�r�r�s

z_Screen.exitonclick)
r�r�r�r�rr�r�r�r&r)r�rrr�r�r�r�rIRs�
(
rIc@s4eZdZdZdZdZedededfdd�ZdS)rz�RawTurtle auto-creating (scrolled) canvas.

    When a Turtle object is created or a function derived from some
    Turtle method is called a TurtleScreen object is automatically created.
    Nrkr�r�cCs,tjdkrt�t_tj|tj|||d�dS)N)rkr�r�)rr�r	r
r�)r�rkr�r�r�r�r�r��s

�zTurtle.__init__)r�r�r�r�r�r�r�r�r�r�r�r�r�s��turtle_docstringdictc	Cs�i}tD]}d|}t|�j||<qtD]}d|}t|�j||<q(td|d���}tdd�|D��}|�d�|dd	�D](}|�d
t|��|�d||�q||d	}|�d
t|��|�d||�|�d
�|��W5QRXdS)a�Create and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitly, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
    z_Screen.zTurtle.z%s.pyr6css$|]}|�d�dtkr|VqdS)r�r�N)r�_alias_listr�r�r�r�r�s�z&write_docstringdict.<locals>.<genexpr>zdocsdict = {

Nr�z%s :
z        """%s
""",

z        """%s
"""

z}
)	�_tg_screen_functionsr�r��_tg_turtle_functionsr�r�r{�repr�close)r��docsdict�
methodnamer�r�r�r�r�r�r~�s$

c	Cs`dd|��i}t|�}|j}|D]8}z||t|�_Wq"tk
rXtd|�Yq"Xq"dS)z�Read in docstrings from lang-specific docstring dictionary.

    Transfer docstrings, translated to lang, from a dictionary-file
    to the methods of classes Screen and Turtle and - in revised form -
    to the corresponding functions.
    z!turtle_docstringdict_%(language)sr�zBad docstring-entry: %sN)r��
__import__r�r�r�r�r�)Zlang�modname�moduler�r�r�r�r��read_docstringssr�r�zCannot find docsdict forz;Unknown Error when trying to import %s-docstring-dictionaryc
Cs�d}}t�|j�\}}}|dd�}|dd�}|jp:g}dd�|D�}dgt|�t|�|}dd�t||�D�}	|dk	r�|	�d|�|�d|�|dk	r�|	�d|�|�d|�d	�|	�}d
|}d	�|�}d
|}||fS)a?Get strings describing the arguments for the given object

    Returns a pair of strings representing function parameter lists
    including parenthesis.  The first string is suitable for use in
    function definition and the second is suitable for use in function
    call.  The "self" parameter is not included.
    r�r�NcSsg|]}d|f�qS)z=%rr�)r{r�r�r�r�r~<sz"getmethparlist.<locals>.<listcomp>cSsg|]\}}||�qSr�r�)r{r�Zdfltr�r�r�r~>s�*z**z, z(%s))�inspectZgetargs�__code__�__defaults__r�rir>r)
ZobZdefTextZcallTextrZvarargsZvarkwZitems2ZrealArgs�defaultsZitems1r�r�r��getmethparlist,s&


r�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z<To reduce docstrings from RawTurtle class for functions
    rNr��%s.r�� \(.+ %s\):�:��rer��replace�compile�sub)�docstrr�Z
turtlename�	newdocstr�parexpr�r�r��_turtle_docreviseKsr�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z?To reduce docstrings from TurtleScreen class for functions
    rNr�r�r�r�r�r�)r�r�Z
screennamer�r�r�r�r��_screen_docreviseWsr�ardef {name}{paramslist}:
    if {obj} is None:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        {obj} = {init}
    try:
        return {obj}.{name}{argslist}
    except TK.TclError:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        raise
c
Csl|D]b}t||�}t|�\}}|dkr4td||�qtj|||||d�}	t|	t��||j�t�|_qdS)Nr�z>>>>>>)�obj�initr�Z
paramslistZargslist)�getattrr�r��__func_body�formatr��globalsr�)
Z	functionsr�r�r�Z	docreviser�r�Zpl1Zpl2Zdefstrr�r�r��_make_global_funcsws

�r�zTurtle._screenzScreen()zTurtle._penzTurtle()�__main__cCst�rt�nt�dSr�)rNr]rUr�r�r�r��	switchpen�sr�cCslt�td�t�td�t�td�td�D]Z}|dkrDt�td�D]}td�t	d�qL|dkrxt
d�t�t�td	�t�q2td
�t
d�td�t�td�td�td�td�td
�t�t
dd
�t
dd
�t
d�td�D]$}td�t	d�td�td�q�td�t�td�D]&}td�t	d�td�td��q:t�dS)zDemo of old turtle.py - moduleT�dr�r�r�r��ZZmaroonr	r�r�F�Z
startstartrx�redr�N)r`r*ryr0r=rzrr1rCrPr9r>r_r{)r|r�r�r�r��demo1�sX



r�cCsBtd�t�td�ttdd��tdd�d}td�td�D]}t�t	|d�qBt
d�t�rnt�q`t
�td�td	�d}td
�td�td�tdd
�D]p}|dkr�t�td	d|dd|�td�D]}t|�td�q�t�|d7}td�tt�dd�q�td�t�td�td�t�tdd�td�t�td�D](}t	dd�td�td�td��q`t�td�t�td�t�td�t�}|�d�t�}|�d�|�d�|�
�|�d�|�d�|��|�dd�|�d�|��|�d�|�dd�|�d�|�d�tt|��d}|�|�dk�r�|�d�|�d �|�|�|��|�d�|d!dk�r�|� �|� �t�|d7}�qZ|j
d"d#d$d%�|�d&�|�d�d'd(�}t!�"d�t��r|��|���q�|�d�|j
d)d*d+�|�#|d�d,S)-zDemo of some new features.r�r�rrr��r�zwait a moment...r�Zgreenr�r�r���x��Fr	r�Zyellowr��2r�r2i�(r�ZblueZoranger�g@g333333�?r�zCAUGHT! )r�r��boldr_)rUrWr�cSst�t�dSr�)rr)r�r�r�r�r��babaszdemo2.<locals>.babaz  Click me!)ZCourierr�r�)rUN)$rprqrYrdrur;rbrr�r4r{rxrwr`rQrrWr1rAr@r>r]rUr9rkrHrarrPryrIr=rr�time�sleeprR)rr�Zlaenger|Ztrir�r�r�r�r�r��demo2�s�


















r�)r�)r�)Fr�Z_verZtkinterr�r�r�r�r�r�Zos.pathrrr�copyrrZ_tg_classesr�r�Z
_tg_utilities�__all__r�r�r�r�r�r�r�rr�r�r�r�r�rr�r r�objectr,r�r�rr�rr�r$rBr
rr	rIrr
r~r�Z	_LANGUAGE�ImportErrorr�r�r�r�r�rrr�r�r�r�rr�r�r�r��<module>s�N��
�

����5
�
c	/&/O}
"
���
5c_compression.cpython-38.pyc000064400000010064151450073350011700 0ustar00U

e5d��@s:dZddlZejZGdd�dej�ZGdd�dej�ZdS)z7Internal classes used by the gzip, lzma and bz2 modules�Nc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
BaseStreamzMode-checking helper functions.cCs|jrtd��dS)NzI/O operation on closed file)�closed�
ValueError��self�r�$/usr/lib64/python3.8/_compression.py�_check_not_closedszBaseStream._check_not_closedcCs|��st�d��dS)NzFile not open for reading)�readable�io�UnsupportedOperationrrrr�_check_can_readszBaseStream._check_can_readcCs|��st�d��dS)NzFile not open for writing)�writablerrrrrr�_check_can_writeszBaseStream._check_can_writecCs(|��st�d��|��s$t�d��dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r
rr�seekablerrrr�_check_can_seeks
zBaseStream._check_can_seekN)�__name__�
__module__�__qualname__�__doc__r	r
rrrrrrr	s
rcsjeZdZdZdd�Zddd�Z�fdd�Zd	d
�Zdd�Zddd�Z	dd�Z
ejfdd�Z
dd�Z�ZS)�DecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIcCsdS)NTrrrrrr
$szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|j�|_||_dS)NFr���)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args�
_decompressor�_trailing_error)r�fpZdecomp_factoryZtrailing_errorZdecomp_argsrrr�__init__'szDecompressReader.__init__csd|_t���S�N)r�super�closer��	__class__rrr$;szDecompressReader.closecCs
|j��Sr")rrrrrrr?szDecompressReader.seekablec
CsPt|��:}|�d��$}|�t|��}||dt|��<W5QRXW5QRXt|�S)N�B)�
memoryview�cast�read�len)r�bZviewZ	byte_view�datarrr�readintoBs$zDecompressReader.readintorcCs�|dkr|��S|r|jrdSd}|jjr�|jjp<|j�t�}|sDq�|jf|j	�|_z|j�
||�}Wq�|jk
r�Yq�Yq�Xn4|jjr�|j�t�}|s�t
d��nd}|j�
||�}|r"q�q"|s�d|_|j|_dS|jt|�7_|S)Nr�zACompressed file ended before the end-of-stream marker was reachedT)�readallrr�eofZunused_datarr*�BUFFER_SIZErr�
decompressrZneeds_input�EOFErrorrrr+)r�sizer-Zrawblockrrrr*Hs@

��
zDecompressReader.readcCs,|j�d�d|_d|_|jf|j�|_dS)NrF)r�seekrrrrrrrrr�_rewindrszDecompressReader._rewindcCs�|tjkrnR|tjkr"|j|}n<|tjkrP|jdkrD|�tj�rDq6|j|}ntd�	|���||jkrr|�
�n
||j8}|dkr�|�ttj|��}|s�q�|t|�8}q||jS)NrzInvalid value for whence: {})
r�SEEK_SET�SEEK_CURr�SEEK_ENDrr*�DEFAULT_BUFFER_SIZEr�formatr7�minr+)r�offset�whencer-rrrr6xs&






zDecompressReader.seekcCs|jS)z!Return the current file position.)rrrrr�tell�szDecompressReader.tell)r)r)rrrrr
r!r$rr.r*r7rr8r6r@�
__classcell__rrr%rr!s

*r)rrr;r2�BufferedIOBaser�	RawIOBaserrrrr�<module>s_threading_local.cpython-38.pyc000064400000014460151450073350012462 0ustar00U

e5d4�@s^dZddlmZddlmZdgZGdd�d�Zedd��ZGd	d�d�Zdd
l	m
Z
mZdS)a(Thread-local objects.

(Note that this module provides a Python version of the threading.local
 class.  Depending on the version of Python you're using, there may be a
 faster one available.  You should always import the `local` class from
 `threading`.)

Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
a thread-local object and use its attributes:

  >>> mydata = local()
  >>> mydata.number = 42
  >>> mydata.number
  42

You can also access the local-object's dictionary:

  >>> mydata.__dict__
  {'number': 42}
  >>> mydata.__dict__.setdefault('widgets', [])
  []
  >>> mydata.widgets
  []

What's important about thread-local objects is that their data are
local to a thread. If we access the data in a different thread:

  >>> log = []
  >>> def f():
  ...     items = sorted(mydata.__dict__.items())
  ...     log.append(items)
  ...     mydata.number = 11
  ...     log.append(mydata.number)

  >>> import threading
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[], 11]

we get different data.  Furthermore, changes made in the other thread
don't affect data seen in this thread:

  >>> mydata.number
  42

Of course, values you get from a local object, including a __dict__
attribute, are for whatever thread was current at the time the
attribute was read.  For that reason, you generally don't want to save
these values across threads, as they apply only to the thread they
came from.

You can create custom local objects by subclassing the local class:

  >>> class MyLocal(local):
  ...     number = 2
  ...     def __init__(self, /, **kw):
  ...         self.__dict__.update(kw)
  ...     def squared(self):
  ...         return self.number ** 2

This can be useful to support default values, methods and
initialization.  Note that if you define an __init__ method, it will be
called each time the local object is used in a separate thread.  This
is necessary to initialize each thread's dictionary.

Now if we create a local object:

  >>> mydata = MyLocal(color='red')

Now we have a default number:

  >>> mydata.number
  2

an initial color:

  >>> mydata.color
  'red'
  >>> del mydata.color

And a method that operates on the data:

  >>> mydata.squared()
  4

As before, we can access the data in a separate thread:

  >>> log = []
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[('color', 'red')], 11]

without affecting this thread's data:

  >>> mydata.number
  2
  >>> mydata.color
  Traceback (most recent call last):
  ...
  AttributeError: 'MyLocal' object has no attribute 'color'

Note that subclasses can define slots, but they are not thread
local. They are shared across threads:

  >>> class MyLocal(local):
  ...     __slots__ = 'number'

  >>> mydata = MyLocal()
  >>> mydata.number = 42
  >>> mydata.color = 'red'

So, the separate thread:

  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()

affects what we see:

  >>> mydata.number
  11

>>> del mydata
�)�ref)�contextmanager�localc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�
_localimplz#A class managing thread-local dicts)�key�dicts�	localargs�	locallock�__weakref__cCsdtt|��|_i|_dS)Nz_threading_local._localimpl.)�str�idrr)�self�r�(/usr/lib64/python3.8/_threading_local.py�__init__�sz_localimpl.__init__cCst�}|jt|�dS)zPReturn the dict for the current thread. Raises KeyError if none
        defined.�)�current_threadrr)r
�threadrrr�get_dict�sz_localimpl.get_dictcshi}|j}t�}t|�}|f�fdd�	}|f�fdd�	}t||��t||���|j|<�|f|j|<|S)z8Create a new dict for the current thread, and return it.cs��}|dk	r|j|=dS�N)�__dict__)�_rr)�wrthreadrr�
local_deleted�sz-_localimpl.create_dict.<locals>.local_deletedcs��}|dk	r|j�|�}dSr)r�pop)r�idtr�dct)�wrlocalrr�thread_deleted�sz._localimpl.create_dict.<locals>.thread_deleted)rrrrrr)r
Z	localdictrrrrrr)rrr�create_dict�s


z_localimpl.create_dictN)�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrrr�s
rc	csvt�|d�}z|��}Wn2tk
rJ|��}|j\}}|j||�YnX|j�t�|d|�dVW5QRXdS)N�_local__implr)	�object�__getattribute__r�KeyErrorrrrr	�__setattr__)r
�implr�args�kwrrr�_patch�s
r-c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)r%rcOsX|s|r|jtjkrtd��t�|�}t�}||f|_t�|_t�|d|�|�	�|S)Nz*Initialization arguments are not supportedr%)
rr&�	TypeError�__new__rr�RLockr	r)r)�clsr+r,r
r*rrrr/�s

z
local.__new__c
Cs,t|��t�||�W5QR�SQRXdSr)r-r&r'�r
�namerrrr'�s
zlocal.__getattribute__c
CsF|dkrtd|jj��t|��t�|||�W5QR�SQRXdS�Nrz+%r object attribute '__dict__' is read-only)�AttributeError�	__class__r r-r&r))r
r3�valuerrrr)�s��
zlocal.__setattr__c
CsD|dkrtd|jj��t|��t�||�W5QR�SQRXdSr4)r5r6r r-r&�__delattr__r2rrrr8�s��
zlocal.__delattr__N)r r!r"r$r/r'r)r8rrrrr�s
)rr0N)r#�weakrefr�
contextlibr�__all__rr-rZ	threadingrr0rrrr�<module>s,

&hmac.cpython-38.opt-2.pyc000064400000011423151450073350011050 0ustar00U

&�.e��@s�ddlZddlmZzddlZWnek
r<dZdZYnXe	ej
�ZddlZddlZddl
Z
edd�ed�D��Zedd�ed�D��ZdZGdd�d�Zd	d
�ZGdd�de
j�Ze��r�eZddd�Zdd�ZdS)�N)�_compare_digestccs|]}|dAVqdS)�\N���.0�xrr�/usr/lib64/python3.8/hmac.py�	<genexpr>sr	�ccs|]}|dAVqdS)�6Nrrrrrr	sc@sNeZdZdZddd�Zedd��Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)�HMAC�@N�csVt��rtd��t|ttf�s0tdt|�j���s<td��t	��rL�|_
n,t�t�rhd�fdd�	|_
nd�fdd�	|_
|�
�|_|�
�|_
|j
j|_t|j
d�r�|j
j}|d	kr�t�d
||jftd�|j}nt�d|jtd�|j}||_t|�|k�r|�
|���}|�|d
�}|j�|�t��|j
�|�t��|dk	�rR|�|�dS)Nz9This class is not available in FIPS mode. Use hmac.new().�,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.�cst��|�S�N��_hashlib�new��d��	digestmodrr�<lambda>?rzHMAC.__init__.<locals>.<lambda>cs
��|�Sr�rrrrrrAr�
block_size�z:block_size of %d seems too small; using our default of %d.�z<No block_size attribute on given digest object; Assuming %d.�)r)r)�_hashlibopenssl�
get_fips_mode�
ValueError�
isinstance�bytes�	bytearray�	TypeError�type�__name__�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	_warnings�warn�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)�self�key�msgrr1rrr�__init__#sR
�



����
z
HMAC.__init__cCsd|jjS)Nzhmac-)r,�name)r:rrrr>asz	HMAC.namecCs t��rtd��|j�|�dS)Nz'hmac.HMAC is not available in FIPS mode)rr r!r,r6)r:r<rrrr6eszHMAC.updatecCs:|j�|j�}|j|_|j|_|j��|_|j��|_|Sr)�	__class__�__new__r)r-r,�copyr+)r:�otherrrrrAksz	HMAC.copycCs|j��}|�|j���|Sr)r+rAr6r,r4�r:�hrrr�_currentxs
z
HMAC._currentcCs|��}|��Sr)rEr4rCrrrr4�szHMAC.digestcCs|��}|��Sr)rE�	hexdigestrCrrrrF�szHMAC.hexdigest)Nr)r'�
__module__�__qualname__r1r=�propertyr>r6rArEr4rFrrrrrs
>

	
rcCsHt|t�r|��St|�r"|d�}t|tj�s6td��|j���dd�S)Nrz6Only OpenSSL hashlib hashes are accepted in FIPS mode.�_�-)	r"r*�lowerr(rZHASHr%r>�replacerrrr�_get_openssl_name�s
�rNc@seZdZddd�ZdS)�HMAC_opensslNcCsLt|ttf�s tdt|�j��t|�}tjj	|||d�}|rH|�
|�|S)Nrr)r"r#r$r%r&r'rN�_hmacopensslrr@r6)�clsr;r<rr>�resultrrrr@�s
zHMAC_openssl.__new__)NN)r'rGrHr@rrrrrO�srOrcCst|||�Sr)r)r;r<rrrrr�srcs�tdk	r(t�t�r(�tkr(t�||��St��r6�}n(t�t�rPd�fdd�	}nd	�fdd�	}|�}|�}t|dd�}t|�|kr�||���}|d|t|�}|�	|�
t��|�	|�
t��|�	|�|�	|���|��S)
Nrcst��|�Srrr�r4rrr�rzdigest.<locals>.<lambda>cs
��|�SrrrrSrrr�rrr
r)r)r)
�_hashopensslr"r*�_openssl_md_methsZhmac_digestr(�getattrr3r4r6r7r9r8)r;r<r4r)r,r+r1rrSrr4�s,	��

r4)Nr)�warningsr/�	_operatorrZcompare_digestrrT�ImportErrorrU�	frozensetZopenssl_md_meth_namesZhashlibrrPr#�ranger8r9r-rrNrOr rr4rrrr�<module>s(

u
__future__.cpython-38.opt-1.pyc000064400000010100151450073350012234 0ustar00U

e5d�
@s�dZddddddddd	d
g
ZdgeZdZd
ZdZdZdZdZdZ	dZ
dZdZGdd�d�Z
e
dde�Ze
dde�Ze
dde�Ze
dde�Ze
dde�Ze
d de�Ze
d de	�Ze
d!d"e
�Ze
d#d$e�Ze
d%d&e�Zd'S)(afRecord of phased-in incompatible language changes.

Each line is of the form:

    FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
                              CompilerFlag ")"

where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:

    (PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
     PY_MINOR_VERSION, # the 1; an int
     PY_MICRO_VERSION, # the 0; an int
     PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
     PY_RELEASE_SERIAL # the 3; an int
    )

OptionalRelease records the first release in which

    from __future__ import FeatureName

was accepted.

In the case of MandatoryReleases that have not yet occurred,
MandatoryRelease predicts the release in which the feature will become part
of the language.

Else MandatoryRelease records when the feature became part of the language;
in releases at or after that, modules no longer need

    from __future__ import FeatureName

to use the feature in question, but may continue to use such imports.

MandatoryRelease may also be None, meaning that a planned feature got
dropped.

Instances of class _Feature have two corresponding methods,
.getOptionalRelease() and .getMandatoryRelease().

CompilerFlag is the (bitfield) flag that should be passed in the fourth
argument to the builtin function compile() to enable the feature in
dynamically compiled code.  This flag is stored in the .compiler_flag
attribute on _Future instances.  These values must match the appropriate
#defines of CO_xxx flags in Include/compile.h.

No feature line is ever to be deleted from this file.
�
nested_scopes�
generators�division�absolute_import�with_statement�print_function�unicode_literals�barry_as_FLUFL�generator_stop�annotations�all_feature_names��iiiii i@i�ic@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_FeaturecCs||_||_||_dS)N)�optional�	mandatory�
compiler_flag)�selfZoptionalReleaseZmandatoryReleaser�r�"/usr/lib64/python3.8/__future__.py�__init__Ssz_Feature.__init__cCs|jS)z�Return first release in which this feature was recognized.

        This is a 5-tuple, of the same form as sys.version_info.
        )r�rrrr�getOptionalReleaseXsz_Feature.getOptionalReleasecCs|jS)z�Return release in which this feature will become mandatory.

        This is a 5-tuple, of the same form as sys.version_info, or, if
        the feature was dropped, is None.
        )rrrrr�getMandatoryRelease_sz_Feature.getMandatoryReleasecCsdt|j|j|jf�S)Nr)�reprrrrrrrr�__repr__gs�z_Feature.__repr__N)�__name__�
__module__�__qualname__rrrrrrrrrQsr)��r
�betar)rrr
�alphar
)rrr
r!r)r�r
�finalr
)rrr
r!r)r"r
r
r!r
)r�r
r!r)r�r
r!r
)rr%r
r!r)r"rr
r!r)�r
r
r!r
)r"r$r
r r)r"�r
r!r
)r"r'r
r r)r"�
r
r!r
N)�__doc__r�__all__Z	CO_NESTEDZCO_GENERATOR_ALLOWEDZCO_FUTURE_DIVISIONZCO_FUTURE_ABSOLUTE_IMPORTZCO_FUTURE_WITH_STATEMENTZCO_FUTURE_PRINT_FUNCTIONZCO_FUTURE_UNICODE_LITERALSZCO_FUTURE_BARRY_AS_BDFLZCO_FUTURE_GENERATOR_STOPZCO_FUTURE_ANNOTATIONSrrrrrrrrrr	r
rrrr�<module>s~2�
����������base64.cpython-38.opt-1.pyc000064400000041016151450073350011224 0ustar00U

e5d�O�@s�dZddlZddlZddlZddddddd	d
ddd
dddddddgZeefZdd�ZdCdd�Z	dDdd�Z
dd�Zdd�Ze�
dd�Ze�
dd�Zdd�Zdd�Zd Zdadad!d	�ZdEd"d
�Zd#d�ZdFd$d�Zdadad%Zd&ZdGd'd(�Zddddd)�d*d�Zddd+d,�d-d�Zd.Z da!da"da#dHd/d
�Z$d0d�Z%d1Z&e&d2d3Z'd4d�Z(d5d�Z)d6d7�Z*d8d�Z+d9d:�Z,d;d�Z-d<d=�Z.d>d?�Z/d@dA�Z0e1dBk�r�e/�dS)IzDBase16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings�N�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodecCs|t|t�r4z|�d�WStk
r2td��YnXt|t�rB|Szt|���WStk
rvtd|j	j
�d�YnXdS)N�asciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r)�
isinstance�strr�UnicodeEncodeError�
ValueError�bytes_types�
memoryview�tobytes�	TypeError�	__class__�__name__��s�r!�/usr/lib64/python3.8/base64.py�_bytes_from_decode_data"s

��r#cCs,tj|dd�}|dk	r(|�t�d|��S|S)a*Encode the bytes-like object s using Base64 and return a bytes object.

    Optional altchars should be a byte string of length 2 which specifies an
    alternative alphabet for the '+' and '/' characters.  This allows an
    application to e.g. generate url or filesystem safe Base64 strings.
    F)�newlineN�+/)�binascii�
b2a_base64�	translate�bytes�	maketrans)r �altchars�encodedr!r!r"r3sFcCsNt|�}|dk	r*t|�}|�t�|d��}|rDt�d|�sDt�d��t�|�S)anDecode the Base64 encoded bytes-like object or ASCII string s.

    Optional altchars must be a bytes-like object or ASCII string of length 2
    which specifies the alternative alphabet used instead of the '+' and '/'
    characters.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded.

    If validate is False (the default), characters that are neither in the
    normal base-64 alphabet nor the alternative alphabet are discarded prior
    to the padding check.  If validate is True, these non-alphabet characters
    in the input result in a binascii.Error.
    Nr%s[A-Za-z0-9+/]*={0,2}zNon-base64 digit found)	r#r(r)r*�re�	fullmatchr&�Error�
a2b_base64)r r+Zvalidater!r!r"rAs
cCst|�S)zrEncode bytes-like object s using the standard Base64 alphabet.

    The result is returned as a bytes object.
    )rrr!r!r"rZscCst|�S)aQDecode bytes encoded with the standard Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the standard alphabet
    are discarded prior to the padding check.
    )rrr!r!r"rasr%s-_cCst|��t�S)z�Encode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object to encode.  The result is returned as a
    bytes object.  The alphabet uses '-' instead of '+' and '_' instead of
    '/'.
    )rr(�_urlsafe_encode_translationrr!r!r"roscCst|�}|�t�}t|�S)a�Decode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the URL-safe base-64
    alphabet, and are not a plus '+' or slash '/', are discarded prior to the
    padding check.

    The alphabet uses '-' instead of '+' and '_' instead of '/'.
    )r#r(�_urlsafe_decode_translationrrr!r!r"rxs
s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567cs>tdkr,dd�tD���fdd��D�ad�t|t�sBt|���}t|�d}|rb|dd|}t�}tj	}t}t
dt|�d�D]V}||||d�d�}|||d	?||d
?d@||d?d@||d@7}q�|d
kr�d|dd�<nF|dk�rd|dd�<n.|dk�r d|dd�<n|dk�r6d|dd�<t|�S)zKEncode the bytes-like object s using Base32 and return a bytes object.
    NcSsg|]}t|f��qSr!�r)��.0�ir!r!r"�
<listcomp>�szb32encode.<locals>.<listcomp>csg|]}�D]}||�qqSr!r!�r5�a�b�Zb32tabr!r"r7�s��r�big��i��
�s======i�����s====����s===�����=���)�_b32tab2�_b32alphabetrrrr�len�	bytearray�int�
from_bytes�ranger))r �leftoverr,rOZb32tab2r6�cr!r;r"r�s<
��
�


c
	Csztdkrdd�tt�D�at|�}t|�dr8t�d��|dk	r^t|�}|�t�	dd|��}|rj|�
�}t|�}|�d�}|t|�}t�}t}t
d	t|�d�D]h}|||d�}d	}	z|D]}
|	d
>||
}	q�Wn tk
r�t�d�d�YnX||	�d
d�7}q�|d�s |d
k�r*t�d��|�rr|�rr|	d
|K}	|	�d
d�}dd
|d}|d|�|dd�<t|�S)aZDecode the Base32 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    RFC 3548 allows for optional mapping of the digit 0 (zero) to the
    letter O (oh), and for optional mapping of the digit 1 (one) to
    either the letter I (eye) or letter L (el).  The optional argument
    map01 when not None, specifies which letter the digit 1 should be
    mapped to (when map01 is not None, the digit 0 is always mapped to
    the letter O).  For security purposes the default is None, so that
    0 and 1 are not allowed in the input.

    The result is returned as a bytes object.  A binascii.Error is raised if
    the input is incorrectly padded or if there are non-alphabet
    characters present in the input.
    NcSsi|]\}}||�qSr!r!)r5�k�vr!r!r"�
<dictcomp>�szb32decode.<locals>.<dictcomp>�zIncorrect paddings01�OrHrr<zNon-base32 digit foundr>>rrBrErG��+���)�_b32rev�	enumeraterKr#rLr&r/r(r)r*�upper�rstriprMrP�KeyError�to_bytes)
r �casefoldZmap01�lZpadchars�decodedZb32revr6Zquanta�accrRZlastrQr!r!r"r	�s@


cCst�|���S)zKEncode the bytes-like object s using Base16 and return a bytes object.
    )r&Zhexlifyr]rr!r!r"r
�scCs4t|�}|r|��}t�d|�r*t�d��t�|�S)a�Decode the Base16 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded or if there are non-alphabet characters present
    in the input.
    s	[^0-9A-F]zNon-base16 digit found)r#r]r-�searchr&r/Z	unhexlify)r rar!r!r"r�s

s<~s~>c	s�t|t�st|���}t|�d}|r4|d|}t�dt|�d��|�}����fdd�|D�}|r�|s�|ddkr��dd	|d<|dd|�|d<d
�|�S)NrGr=z!%dIcsPg|]H}�r|sdn6�r$|dkr$dn&�|d�|dd�|d�qS)�zi    �yi�^	�Ui9r!)r5Zword��chars�chars2�foldnuls�
foldspacesr!r"r7!s�
�
�z_85encode.<locals>.<listcomp>rIrfrr<�)	rrrrrL�struct�StructZunpack�join)	r:rjrk�padrlrm�paddingZwords�chunksr!rir"�	_85encodes
�ru)rm�wrapcolrr�adobecs�tdkr*dd�tdd�D�add�tD�at|tt|d|��|rHt���r�t|rVdnd	�����fd
d�tdt����D�}|r�t|d�d�kr�|�d
�d�|��|r��t	7��S)a�Encode bytes-like object b using Ascii85 and return a bytes object.

    foldspaces is an optional flag that uses the special short sequence 'y'
    instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
    feature is not supported by the "standard" Adobe encoding.

    wrapcol controls whether the output should have newline (b'\n') characters
    added to it. If this is non-zero, each output line will be at most this
    many characters long.

    pad controls whether the input is padded to a multiple of 4 before
    encoding. Note that the btoa implementation always pads.

    adobe controls whether the encoded byte sequence is framed with <~ and ~>,
    which is used by the Adobe implementation.
    NcSsg|]}t|f��qSr!r3r4r!r!r"r7Dsza85encode.<locals>.<listcomp>�!�vcSsg|]}tD]}||�qqSr!)�	_a85charsr8r!r!r"r7EsTrCrBcsg|]}�||���qSr!r!r4��resultrvr!r"r7Ms�rrIrn�
)
�
_a85chars2rPrzru�	_A85START�maxrL�appendrq�_A85END)r:rmrvrrrwrtr!r{r"r/s$�

s 	

)rmrw�ignorecharsc	Cs�t|�}|rH|�t�s$td�t���|�t�r<|dd�}n|dd�}t�d�j	}g}|j
}g}|j
}|j}	|dD]�}
d|
kr�dkr�nnl||
�t|�d	kr�d
}|D]}
d||
d}q�z|||��Wn tj
k
r�td�d�YnX|	�qv|
d
k�r |�rtd��|d�qv|�rH|
dk�rH|�r>td��|d�qv|
|k�rVqvqvtd|
��qvd�|�}dt|�}
|
�r�|d|
�}|S)a�Decode the Ascii85 encoded bytes-like object or ASCII string b.

    foldspaces is a flag that specifies whether the 'y' short sequence should be
    accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
    not supported by the "standard" Adobe encoding.

    adobe controls whether the input sequence is in Adobe Ascii85 format (i.e.
    is framed with <~ and ~>).

    ignorechars should be a byte string containing characters to ignore from the
    input. This should only contain whitespace characters, and by default
    contains all whitespace characters in ASCII.

    The result is returned as a bytes object.
    z1Ascii85 encoded byte sequences must end with {!r}rC���N�!Isuuuurx�ur<rrhzAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %crnrG)r#�endswithr�r�format�
startswithrrorp�packr��clearrL�errorrq)r:rmrwr��packIrcZdecoded_appendZcurrZcurr_appendZ
curr_clear�xrdr|rsr!r!r"rXsZ
��





sU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs2tdkr$dd�tD�add�tD�at|tt|�S)z�Encode bytes-like object b in base85 format and return a bytes object.

    If pad is true, the input is padded with b'\0' so its length is a multiple of
    4 bytes before encoding.
    NcSsg|]}t|f��qSr!r3r4r!r!r"r7�szb85encode.<locals>.<listcomp>cSsg|]}tD]}||�qqSr!)�	_b85charsr8r!r!r"r7�s)�
_b85chars2�_b85alphabetr�ru)r:rrr!r!r"r�s	c
	CsJtdkr,dgdatt�D]\}}|t|<qt|�}t|�d}|d|}g}t�d�j}tdt|�d�D]�}|||d�}d}z|D]}|dt|}q�WnFt	k
r�t|�D]&\}}t|dkr�t
d||�d�q��YnXz|�||��Wqntjk
�r$t
d	|�d�YqnXqnd
�
|�}	|�rF|	d|�}	|	S)zqDecode the base85-encoded bytes-like object or ASCII string b

    The result is returned as a bytes object.
    N�r<�~r�rrhz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %drn)�_b85decr\r�r#rLrorpr�rPrrr�r�rq)
r:r6rRrs�outr��chunkrd�jr|r!r!r"r
�sH

����

�LrGrEcCsX|�t�}|sqTt|�tkr>|�tt|��}|s4q>||7}qt�|�}|�|�qdS)z1Encode a file; input and output are binary files.N)�read�
MAXBINSIZErLr&r'�write)�input�outputr �ns�liner!r!r"r�s


cCs(|��}|sq$t�|�}|�|�qdS)z1Decode a file; input and output are binary files.N)�readliner&r0r�)r�r�r�r r!r!r"r�s

c
Cs�zt|�}Wn8tk
rD}zd|jj}t|�|�W5d}~XYnX|jdkrjd|j|jjf}t|��|jdkr�d|j|jjf}t|��dS)Nz"expected bytes-like object, not %s)rRr:�Bz-expected single byte elements, not %r from %srBz(expected 1-D data, not %d-D data from %s)rrrrr��ndim)r �m�err�msgr!r!r"�_input_type_check�s
�
�r�cCsLt|�g}tdt|�t�D]$}|||t�}|�t�|��qd�|�S)zVEncode a bytestring into a bytes object containing multiple lines
    of base-64 data.rrn)r�rPrLr�r�r&r'rq)r �piecesr6r�r!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of encodebytes().rNzAencodestring() is a deprecated alias since 3.1, use encodebytes()rC)�warnings�warn�DeprecationWarningr�r r�r!r!r"�encodestrings�r�cCst|�t�|�S)z8Decode a bytestring of base-64 data into a bytes object.)r�r&r0rr!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of decodebytes().rNzHdecodestring() is a deprecated alias since Python 3.1, use decodebytes()rC)r�r�r�rr�r!r!r"�decodestring$s�r�c	
Csddl}ddl}z|�|jdd�d�\}}WnP|jk
r~}z0|j|_t|�td|jd�|�d�W5d}~XYnXt}|D]@\}}|dkr�t}|dkr�t	}|d	kr�t	}|d
kr�t
�dSq�|�r|ddk�rt|dd��}|||jj�W5QRXn||j
j|jj�dS)
zSmall main programrNrBZdeutz�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'rCz-ez-dz-uz-t�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)	r�r�Zopts�argsr��func�or9�fr!r!r"�main.s2�r�cCs<d}tt|��t|�}tt|��t|�}tt|��dS)NsAladdin:open sesame)r��reprrr)Zs0�s1�s2r!r!r"r�Hsr��__main__)N)NF)FN)F)FFF)F)2�__doc__r-ror&�__all__r)rMrr#rrrrr*r1r2rrrKrJr[rr	r
rrzr~rr�rurrr�r�r�r�rr
ZMAXLINESIZEr�rrr�rr�rr�r�r�rr!r!r!r"�<module>s��

	&
C

)H
-	
	


asyncore.cpython-38.opt-2.pyc000064400000034752151450073350011775 0ustar00U

e5d~N�@sdddlZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZee
ee
eeeh�ZzeWnek
r�iZYnXdd�ZGdd�de�ZeeefZdd�Zd	d
�Zdd�Z d
d�Z!d%dd�Z"d&dd�Z#e#Z$d'dd�Z%Gdd�d�Z&Gdd�de&�Z'dd�Z(d(dd�Z)ej*d k�r`Gd!d"�d"�Z+Gd#d$�d$e&�Z,dS))�N)
�EALREADY�EINPROGRESS�EWOULDBLOCK�
ECONNRESET�EINVAL�ENOTCONN�	ESHUTDOWN�EISCONN�EBADF�ECONNABORTED�EPIPE�EAGAIN�	errorcodec
CsHzt�|�WStttfk
rB|tkr6t|YSd|YSXdS)NzUnknown error %s)�os�strerror�
ValueError�
OverflowError�	NameErrorr)�err�r� /usr/lib64/python3.8/asyncore.py�	_strerrorDsrc@seZdZdS)�ExitNowN)�__name__�
__module__�__qualname__rrrrrLsrcCs:z|��Wn(tk
r"�Yn|��YnXdS�N)�handle_read_event�_reraised_exceptions�handle_error��objrrr�readQsr"cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_write_eventrrr rrr�writeYsr$cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_expt_eventrrr rrr�
_exceptionasr&c
Cs�zX|tj@r|��|tj@r&|��|tj@r8|��|tjtjBtj	B@rV|�
�Wnhtk
r�}z$|jdt
kr�|��n|�
�W5d}~XYn(tk
r��Yn|��YnXdS�Nr)�select�POLLINr�POLLOUTr#�POLLPRIr%ZPOLLHUPZPOLLERRZPOLLNVAL�handle_close�OSError�args�
_DISCONNECTEDrr)r!�flags�errr�	readwriteis"



r2�c	Cs<|dkrt}|�r8g}g}g}t|���D]L\}}|��}|��}|rP|�|�|rd|jsd|�|�|sl|r*|�|�q*g|kr�|kr�|kr�nnt�|�dSt	�	||||�\}}}|D] }|�
|�}|dkr�q�t|�q�|D]"}|�
|�}|dk�rq�t|�q�|D]&}|�
|�}|dk�r,�qt
|��qdSr)�
socket_map�list�items�readable�writable�append�	accepting�time�sleepr(�getr"r$r&)	�timeout�map�r�wr1�fdr!Zis_rZis_wrrr�poll}sD


"







rCcCs�|dkrt}|dk	r t|d�}t��}|r�t|���D]L\}}d}|��r\|tjtjBO}|�	�rt|j
st|tjO}|r8|�||�q8|�|�}|D]&\}}|�
|�}|dkr�q�t||�q�dS)Ni�r)r4�intr(rCr5r6r7r)r+r8r:r*�registerr=r2)r>r?ZpollsterrBr!r0r@rrr�poll2�s(


rF�>@FcCsb|dkrt}|r ttd�r t}nt}|dkr>|r^|||�q,n |r^|dkr^|||�|d}q>dS)NrCr�)r4�hasattrr(rFrC)r>Zuse_pollr?�countZpoll_funrrr�loop�s
rKc@s2eZdZdZdZdZdZdZdZe	dh�Z
dAdd�Zdd�ZdBdd	�Z
dCd
d�Zejejfdd
�ZdDdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdEd'd(�Zd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#d1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'd9d:�Z(d;d<�Z)d=d>�Z*d?d@�Z+dS)F�
dispatcherFN�warningc
Cs�|dkrt|_n||_d|_|r�|�d�|�||�d|_z|��|_Wq�tk
r�}z*|j	dt
tfkrvd|_n|�|��W5d}~XYq�Xnd|_
dS�NrTF)r4�_map�_fileno�setblocking�
set_socket�	connectedZgetpeername�addrr-r.rr�del_channel�socket)�self�sockr?rrrr�__init__�s 

zdispatcher.__init__cCs�|jjd|jjg}|jr.|jr.|�d�n|jr>|�d�|jdk	r�z|�d|j�Wn$tk
r�|�t|j��YnXdd�	|�t
|�fS)N�.Z	listeningrSz%s:%dz<%s at %#x>� )�	__class__rrr:rTr9rS�	TypeError�repr�join�id)rWZstatusrrr�__repr__�s

zdispatcher.__repr__cCs|dkr|j}|||j<dSr)rOrP)rWr?rrr�add_channel	szdispatcher.add_channelcCs,|j}|dkr|j}||kr"||=d|_dSr)rPrO)rWr?rBrrrrUszdispatcher.del_channelcCs.||f|_t�||�}|�d�|�|�dSr')Zfamily_and_typerVrQrR)rWZfamily�typerXrrr�
create_sockets

zdispatcher.create_socketcCs||_|��|_|�|�dSr)rV�filenorPrb�rWrXr?rrrrRs
zdispatcher.set_socketcCsDz*|j�tjtj|j�tjtj�dB�Wntk
r>YnXdS)NrH)rVZ
setsockopt�
SOL_SOCKETZSO_REUSEADDR�
getsockoptr-�rWrrr�set_reuse_addr#s
���zdispatcher.set_reuse_addrcCsdS�NTrrirrrr74szdispatcher.readablecCsdSrkrrirrrr87szdispatcher.writablecCs(d|_tjdkr|dkrd}|j�|�S)NT�nt�)r:r�namerV�listen)rWZnumrrrro>szdispatcher.listencCs||_|j�|�Sr)rTrV�bind)rWrTrrrrpDszdispatcher.bindcCspd|_d|_|j�|�}|tttfks8|tkrBtj	dkrB||_
dS|dtfkr^||_
|��nt
|t|��dS)NFTrlr)rS�
connectingrVZ
connect_exrrrrrrnrTr	�handle_connect_eventr-r)rWZaddressrrrr�connectHs��
zdispatcher.connectc
Csvz|j��\}}WnVtk
r(YdStk
rh}z$|jdtttfkrVWY�
dS�W5d}~XYn
X||fSdSr')rV�acceptr]r-r.rrr
)rWZconnrT�whyrrrrtVs
zdispatcher.acceptc
Cstz|j�|�}|WStk
rn}z>|jdtkr<WY�*dS|jdtkr\|��WY�
dS�W5d}~XYnXdSr')rV�sendr-r.rr/r,)rW�data�resultrurrrrvds

zdispatcher.sendc
Csrz(|j�|�}|s |��WdS|WSWnDtk
rl}z&|jdtkrZ|��WY�
dS�W5d}~XYnXdS)N�r)rV�recvr,r-r.r/)rWZbuffer_sizerwrurrrrzqs

zdispatcher.recvc
Csnd|_d|_d|_|��|jdk	rjz|j��Wn6tk
rh}z|jdtt	fkrX�W5d}~XYnXdS)NFr)
rSr:rqrUrV�closer-r.rr
)rWrurrrr{�s
zdispatcher.closecCstj�dt|��dS)Nzlog: %s
)�sys�stderrr$�str)rW�messagerrr�log�szdispatcher.log�infocCs||jkrtd||f�dS)Nz%s: %s)�ignore_log_types�print)rWrrcrrr�log_info�s
zdispatcher.log_infocCs:|jr|��n&|js.|jr$|��|��n|��dSr)r:�
handle_acceptrSrqrr�handle_readrirrrr�s

zdispatcher.handle_read_eventcCs@|j�tjtj�}|dkr(t|t|���|��d|_d|_dSrN)	rVrhrg�SO_ERRORr-r�handle_connectrSrq�rWrrrrrr�szdispatcher.handle_connect_eventcCs*|jr
dS|js|jr|��|��dSr)r:rSrqrr�handle_writerirrrr#�szdispatcher.handle_write_eventcCs0|j�tjtj�}|dkr$|��n|��dSr')rVrhrgr�r,�handle_exptr�rrrr%�s
zdispatcher.handle_expt_eventcCsXt�\}}}}zt|�}Wndt|�}YnX|�d||||fd�|��dS)Nz)<__repr__(self) failed for object at %0x>z:uncaptured python exception, closing channel %s (%s:%s %s)�error)�compact_tracebackr^r`r�r,)rWZnil�t�v�tbinfoZ	self_reprrrrr�s��	zdispatcher.handle_errorcCs|�dd�dS)Nz!unhandled incoming priority eventrM�r�rirrrr��szdispatcher.handle_exptcCs|�dd�dS)Nzunhandled read eventrMr�rirrrr��szdispatcher.handle_readcCs|�dd�dS)Nzunhandled write eventrMr�rirrrr��szdispatcher.handle_writecCs|�dd�dS)Nzunhandled connect eventrMr�rirrrr��szdispatcher.handle_connectcCs|��}|dk	r|j|�dSr)rt�handle_accepted)rWZpairrrrr��szdispatcher.handle_acceptcCs|��|�dd�dS)Nzunhandled accepted eventrM)r{r�)rWrXrTrrrr��szdispatcher.handle_acceptedcCs|�dd�|��dS)Nzunhandled close eventrM)r�r{rirrrr,�szdispatcher.handle_close)NN)N)N)N)r�),rrr�debugrSr:rq�closingrT�	frozensetr�rYrarbrUrVZAF_INETZSOCK_STREAMrdrRrjr7r8rorprsrtrvrzr{r�r�rrrr#r%rr�r�r�r�r�r�r,rrrrrL�sJ

 

	


rLc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�dispatcher_with_sendNcCst�|||�d|_dS)Nry)rLrY�
out_bufferrfrrrrY�szdispatcher_with_send.__init__cCs.d}t�||jdd��}|j|d�|_dS)Nri)rLrvr�)rWZnum_sentrrr�
initiate_sendsz"dispatcher_with_send.initiate_sendcCs|��dSr)r�rirrrr�sz!dispatcher_with_send.handle_writecCs|jpt|j�Sr)rS�lenr�rirrrr8szdispatcher_with_send.writablecCs0|jr|�dt|��|j||_|��dS)Nz
sending %s)r�r�r^r�r�)rWrwrrrrvszdispatcher_with_send.send)NN)rrrrYr�r�r8rvrrrrr��s

r�cCs�t��\}}}g}|std��|rL|�|jjj|jjjt|j	�f�|j
}q~|d\}}}d�dd�|D��}|||f|||fS)Nztraceback does not exist���r[cSsg|]}d|�qS)z
[%s|%s|%s]r)�.0�xrrr�
<listcomp>&sz%compact_traceback.<locals>.<listcomp>)r|�exc_info�AssertionErrorr9�tb_frame�f_code�co_filename�co_namer~�	tb_lineno�tb_nextr_)r�r��tbr��fileZfunction�liner�rrrr�s�r�cCs�|dkrt}t|���D]n}z|��Wqtk
r`}z|jdtkrJn|sP�W5d}~XYqtk
rt�Yq|s��YqXq|��dSr')	r4r5�valuesr{r-r.r
r�clear)r?Z
ignore_allr�rrr�	close_all)s 
r��posixc@sNeZdZdd�Zdd�Zdd�Zdd�Zdd
d�ZeZeZ	dd
�Z
dd�Zd	S)�file_wrappercCst�|�|_dSr)r�duprB�rWrBrrrrYNszfile_wrapper.__init__cCs*|jdkrtjd|t|d�|��dS)Nrzunclosed file %r)�source)rB�warnings�warn�ResourceWarningr{rirrr�__del__Qs

�zfile_wrapper.__del__cGstj|jf|��Sr)rr"rB�rWr.rrrrzWszfile_wrapper.recvcGstj|jf|��Sr)rr$rBr�rrrrvZszfile_wrapper.sendNcCs(|tjkr|tjkr|sdStd��dS)Nrz-Only asyncore specific behaviour implemented.)rVrgr��NotImplementedError)rW�levelZoptnameZbuflenrrrrh]s
��zfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t�|�dS)Nrr�)rBrr{r�rrrr{hs

zfile_wrapper.closecCs|jSr)rBrirrrreoszfile_wrapper.fileno)N)rrrrYr�rzrvrhr"r$r{rerrrrr�Is
r�c@seZdZddd�Zdd�ZdS)�file_dispatcherNcCsPt�|d|�d|_z|��}Wntk
r4YnX|�|�t�|d�dS)NTF)rLrYrSre�AttributeError�set_filer�set_blocking)rWrBr?rrrrYts
zfile_dispatcher.__init__cCs"t|�|_|j��|_|��dSr)r�rVrerPrbr�rrrr�s
zfile_dispatcher.set_file)N)rrrrYr�rrrrr�rs
r�)r3N)r3N)rGFNN)NF)-r(rVr|r;r�r�errnorrrrrrrr	r
rrr
rr�r/r4rr�	Exceptionr�KeyboardInterrupt�
SystemExitrr"r$r&r2rCrFZpoll3rKrLr�r�r�rnr�r�rrrr�<module>1sB<�


'

*
)zipfile.cpython-38.opt-1.pyc000064400000162157151450073350011614 0ustar00U

e5d�V�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZzddlZejZWnek
r�dZejZYnXzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXddddddd	d
ddd
ddg
ZGdd�de�ZGdd�de�ZeZZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(e�)e'�Z*dZ+dZ,dZ-dZ.d Z/d!Z0d"Z1d#Z2dZ3d$Z4d%Z5d&Z6e�)e5�Z7dZ8dZ9dZ:dZ;d Z<d!Z=d"Z>d#Z?dZ@d$ZAd'ZBd(ZCdZDd)ZEdZFd*ZGd+ZHd,ZId-ZJd.ZKd/ZLe�)eK�ZMdZNdZOdZPdZQd ZRd!ZSd"ZTd#ZUdZVd$ZWd'ZXd(ZYd0ZZd1Z[e�)eZ�Z\d2Z]d3Z^e�)e]�Z_dZ`dZadZbdZcd Zdd!Zed"Zfd#ZgdZhd$Zid4Zje�kd5�Zld6d7�Zmd8d9�Znd:d
�Zod;d<�Zpd=d>�ZqGd?d�der�Zsdatd@dA�ZudBdC�ZvGdDdE�dE�ZwGdFdG�dG�ZxdHdIdJdJdJdJdKdLdMdNdKdOdPdQdRdSdTdU�ZydVdW�ZzdtdXdY�Z{dZd[�Z|Gd\d]�d]�Z}Gd^d_�d_�Z~Gd`da�daej�Z�Gdbdc�dcej�Z�Gddd�d�Z�Gded
�d
e��Z�dfdg�Z�dhdi�Z�e�j�Z�djdk�Z�Gdldm�dme��Z�Gdndo�doe��Z�Gdpd�d�Z�dudqdr�Z�e�dsk�r
e��dS)vzP
Read and write ZIP files.

XXX references to utf-8 need further investigation.
�N�
BadZipFile�
BadZipfile�error�
ZIP_STORED�ZIP_DEFLATED�	ZIP_BZIP2�ZIP_LZMA�
is_zipfile�ZipInfo�ZipFile�	PyZipFile�LargeZipFile�Pathc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/zipfile.pyr+sc@seZdZdZdS)r
zu
    Raised when writing a zipfile, the zipfile requires ZIP64 extensions
    and those extensions are disabled.
    N)rrr�__doc__rrrrr
/si���������-�.�?s<4s4H2LHsPK��������	z<4s4B4HL2L5H2LsPK�
��
����z<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK�<HHc
Cs�tj}d}g}d}}|dt|�krz||||d��\}}|d|}	||krt||krl|�|||��|	}d}|	}q|s�|Sd�|�S)NFrr T�)�_EXTRA_FIELD_STRUCT�unpack�len�append�join)
�extraZxidsr/Zmodified�buffer�start�iZxidZxlen�jrrr�_strip_extra�s r8cCs,zt|�rWdSWntk
r&YnXdS)NTF)�_EndRecData�OSError��fprrr�_check_zipfile�s
r=c	CsVd}z8t|d�rt|d�}nt|d��}t|�}W5QRXWntk
rPYnX|S)z�Quickly see if a file is a ZIP file by checking the magic number.

    The filename argument may be a file or file-like object too.
    F�readr;�rb)�hasattrr=�openr:)�filename�resultr<rrrr	�s
c
Csz|�|td�Wntk
r,|YSX|�t�}t|�tkrH|St�t|�\}}}}|tkrh|S|dksx|dkr�t	d��|�|tt
d�|�t
�}t|�t
kr�|St�t|�\
}}}	}
}}}
}}}|tkr�|S||t
<||t<||t<|
|t<||t<||t<||t<|S)zM
    Read the ZIP64 end-of-archive records and use that to update endrec
    rrrz3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr:r>r0�structr/�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL�	_ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZread_versionZdisk_numZdisk_dirZdircountZ	dircount2ZdirsizeZ	diroffsetrrr�
_EndRecData64�s@



�rXc	Csh|�dd�|��}z|�td�Wntk
r<YdSX|��}t|�tkr�|dd�tkr�|dd�dkr�t�t	|�}t
|�}|�d�|�|t�t|t|�St
|dtd�}|�|d�|��}|�t�}|dk�rd|||t�}t|�tk�rdSt
t�t	|��}|t}||t|t|�}|�|�|�||�t|||||�SdS)	z�Return data from the "End of Central Directory" record, or None.

    The data is a list of the nine items in the ZIP "End of central dir"
    record followed by a tenth item, the file seek offset of this record.rrNr ���sr-i)rD�tell�sizeEndCentDirr:r>r0�stringEndArchiverFr/�structEndArchive�listr1rX�max�rfind�_ECD_COMMENT_SIZE)	rSZfilesizerVrUZmaxCommentStartr5ZrecDataZcommentSize�commentrrrr9sD��



�r9c@s\eZdZdZdZddd�Zdd�Zdd
d�Zdd
�Zdd�Z	e
ddd�dd��Zdd�Zd	S)r
z>Class with attributes describing each file in the ZIP archive.)�
orig_filenamerB�	date_time�
compress_type�_compresslevelrbr3�
create_systemrW�extract_version�reserved�	flag_bits�volume�
internal_attr�
external_attr�
header_offset�CRC�
compress_size�	file_size�	_raw_time�NoName��rrrrrcCs�||_|�td��}|dkr(|d|�}tjdkrJtj|krJ|�tjd�}||_||_|ddkrjtd��t	|_
d|_d|_d|_
tjdkr�d|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nr�/ruz+ZIP does not support timestamps before 1980r-Zwin32r)rc�find�chr�os�sep�replacerBrd�
ValueErrorrrerfrbr3�sys�platformrg�DEFAULT_VERSIONrWrhrirjrkrlrm)�selfrBrdZ	null_byterrr�__init__Xs0
zZipInfo.__init__cCs�d|jj|jfg}|jtkr8|�dt�|j|j��|jd?}|jd@}|rd|�dt	�
|��|rv|�d|�|��}|r�|jr�|�d|j�|r�|j
r�|jtks�|j|j
kr�|�d|j
�|�d	�d
�|�S)Nz<%s filename=%r� compress_type=%sr)rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r�>�)�	__class__rrBrerr1�compressor_names�getrm�stat�filemode�is_dirrqrpr2)r�rC�hi�lo�isdirrrr�__repr__�s0
��



�
�
zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}|jd
@rfd}}}n|j}|j}|j}|j}d}	|dkr�|tkp�|tk}|r�d}
|t�|
dt�	|
�d	||�}|tks�|tkr�|s�t
d
��d}d}t}	|jt
k�rtt|	�}	n|jtk�rtt|	�}	t|	|j�|_t|	|j�|_|��\}}t�tt|j|j||j|||||t|�t|��
}
|
||S)z-Return the per-file header as a bytes object.rrur$rr!rrr&r rNz<HHQQz'Filesize would require ZIP64 extensions���)rdrjrorprqr3�ZIP64_LIMITrF�pack�calcsizer
�
ZIP64_VERSIONrerr_�
BZIP2_VERSIONr�LZMA_VERSIONrhrW�_encodeFilenameFlags�structFileHeader�stringFileHeaderrir0)r��zip64�dt�dosdate�dostimerorprqr3�min_version�fmtrBrj�headerrrr�
FileHeader�s^$$
�
�zZipInfo.FileHeadercCsDz|j�d�|jfWStk
r>|j�d�|jdBfYSXdS)N�ascii�utf-8�)rB�encoderj�UnicodeEncodeError�r�rrrr��szZipInfo._encodeFilenameFlagscCs�|j}tj}t|�dk�r�|d|dd��\}}|dt|�krPtd||f��|dk�rp|dkrv|d|dd��}nV|dkr�|d	|dd
��}n:|dkr�|d|dd
��}n|dkr�d}ntd||f��d}|jdk�rt|�|kr�td��|||_|d7}|jdk�r6t|�|k�r$td��|||_|d7}|jdk�rpt|�|k�rXtd��|j}|||_|d7}||dd�}qdS)Nr r,z"Corrupt extra field %04x (size=%d)r�z<QQQ�r)z<QQrrz<Qrrr)l����r�z/Corrupt zip64 extra field. File size not found.r�z3Corrupt zip64 extra field. Compress size not found.z3Corrupt zip64 extra field. Header offset not found.)r3rFr/r0rrqrprn)r�r3r/�tpZlnZcounts�idx�oldrrr�_decodeExtra�sP
�
�
�
zZipInfo._decodeExtraT��strict_timestampsc	Cst|tj�rt�|�}t�|�}t�|j�}t�|j	�}|dd�}|sZ|ddkrZd}n|sn|ddkrnd}|dkrz|}tj
�tj
�|�d�}|dtj
tjfkr�|dd�}q�|r�|d	7}|||�}|jd
@d>|_|r�d|_|jdO_n|j|_|S)a_Construct an appropriate ZipInfo for a file on the filesystem.

        filename should be the path to a file or directory on the filesystem.

        arcname is the name which it will have within the archive (by default,
        this will be the same as filename, but without a drive letter and with
        leading path separators removed).
        rr"rurt�;)r�r���;r�Nrrvrr))�
isinstancery�PathLike�fspathr��S_ISDIR�st_mode�time�	localtime�st_mtime�path�normpath�
splitdriverz�altseprmrq�st_size)	�clsrB�arcnamer��str��mtimerd�zinforrr�	from_file�s0



zZipInfo.from_filecCs|jddkS)z2Return True if this archive member is a directory.���rv�rBr�rrrr�%szZipInfo.is_dir)rsrt)N)N)
rrrr�	__slots__r�r�r�r�r��classmethodr�r�rrrrr
>s
+
.2%cCs0td�D]"}|d@r"|d?dA}q|dL}q|S)Nrrl q[)�range)�crcr7rrr�_gen_crc/s

r�csld�d�d�tdkr&ttttd���at��fdd������fdd��|D]}�|�qL��fd	d
�}|S)NixV4i�gE#i�xV4�cs|d?�||Ad@AS)z(Compute the CRC32 primitive on one byte.r�r)Zchr�)�crctablerr�crc32Isz_ZipDecrypter.<locals>.crc32cs<�|�����d@d@��ddd@���d?���dS)Nr�r�i�rr�r)�c)r��key0�key1�key2rr�update_keysMs
z"_ZipDecrypter.<locals>.update_keyscsNt�}|j}|D]4}�dB}|||dAd?d@N}�|�||�qt|�S)zDecrypt a bytes object.rrrr�)�	bytearrayr1�bytes)rVrCr1r��k)r�r�rr�	decrypterWs
z _ZipDecrypter.<locals>.decrypter)�	_crctabler^�mapr�r�)�pwd�pr�r)r�r�r�r�r�r�r�
_ZipDecrypter?s
r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LZMACompressorcCs
d|_dS�N)�_compr�rrrr�gszLZMACompressor.__init__cCsFt�dtji�}tjtjt�tj|�gd�|_t�dddt	|��|S)N�id��filtersz<BBHr$r )
�lzmaZ_encode_filter_properties�FILTER_LZMA1r��
FORMAT_RAW�_decode_filter_propertiesr�rFr�r0)r�Zpropsrrr�_initjs
�
zLZMACompressor._initcCs*|jdkr|��|j�|�S|j�|�Sr�)r�r��compress)r�rVrrrr�qs
zLZMACompressor.compresscCs&|jdkr|��|j��S|j��Sr�)r�r��flushr�rrrr�vs
zLZMACompressor.flushN)rrrr�r�r�r�rrrrr�esr�c@seZdZdd�Zdd�ZdS)�LZMADecompressorcCsd|_d|_d|_dS)Nr-F)�_decomp�_unconsumed�eofr�rrrr�~szLZMADecompressor.__init__c	Cs�|jdkr�|j|7_t|j�dkr*dSt�d|jdd��\}t|j�d|krXdStjtjt�tj	|jdd|��gd�|_|jd|d�}|`|j�
|�}|jj|_|S)Nr r-z<Hrr�)r�r�r0rFr/r�r�r�r�r��
decompressr�)r�rVZpsizerCrrrr��s"
��

zLZMADecompressor.decompressN)rrrr�r�rrrrr�|sr�ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ	deflate64Zbzip2r�ZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr+��a�bcCsX|tkr
nJ|tkr tsTtd��n4|tkr6tsTtd��n|tkrLtsTtd��ntd��dS)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rr�zlib�RuntimeErrorr�bz2rr��NotImplementedError)�compressionrrr�_check_compression�s$���r�cCsj|tkr2|dk	r t�|tjd�St�tjtjd�S|tkrT|dk	rLt�|�St��S|tkrbt	�SdSdS)N��)
rr�ZcompressobjZDEFLATEDZZ_DEFAULT_COMPRESSIONrr�Z
BZ2Compressorrr�)re�
compresslevelrrr�_get_compressor�s
r�cCsvt|�|tkrdS|tkr&t�d�S|tkr6t��S|tkrDt	�St
�|�}|rdtd||f��ntd|f��dS)Nr�zcompression type %d (%s)zcompression type %d)
r�rrr�Z
decompressobjrr�ZBZ2Decompressorrr�r�r�r�)reZdescrrrr�_get_decompressor�s

r�c@s0eZdZdd�Zddd�Zd
dd�Zd	d
�ZdS)�_SharedFilecCs2||_||_||_||_||_|j|_|j|_dSr�)�_file�_pos�_close�_lock�_writing�seekablerZ)r��file�pos�close�lockZwritingrrrr��sz_SharedFile.__init__rc
CsN|j�>|��rtd��|j�||�|j��|_|jW5QR�SQRXdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrZr)r�rT�whencerrrrD�sz_SharedFile.seekr�c
CsX|j�H|��rtd��|j�|j�|j�|�}|j��|_|W5QR�SQRXdS)N�yCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrr>rZ�r��nrVrrrr>�sz_SharedFile.readcCs$|jdk	r |j}d|_|�|�dSr�)rr)r��fileobjrrrr	s
z_SharedFile.closeN)r)r�)rrrr�rDr>r	rrrrr�s	


rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	_TellablecCs||_d|_dS�Nr)r<rT�r�r<rrrr�sz_Tellable.__init__cCs|j�|�}|j|7_|Sr�)r<�writerT)r�rVrrrrrsz_Tellable.writecCs|jSr�)rTr�rrrrZsz_Tellable.tellcCs|j��dSr�)r<r�r�rrrr�sz_Tellable.flushcCs|j��dSr�)r<r	r�rrrr	sz_Tellable.closeN)rrrr�rrZr�r	rrrrrs
rcs�eZdZdZdZdZdZd(dd�Zd	d
�Zdd�Z	d)dd�Z
d*dd�Zdd�Zd+dd�Z
dd�Zdd�Zdd�Zdd�Z�fdd �Zd!d"�Zd,d$d%�Zd&d'�Z�ZS)-�
ZipExtFilezZFile-like object for reading an archive member.
       Is returned by ZipFile.open().
    i@iiNFcCs(||_||_||_|j|_|j|_|j|_t	|j�|_
d|_d|_d|_
d|_||_|j|_t|d�rz|j|_td�|_nd|_d|_z4|��r�|��|_|j|_|j|_|j|_d|_Wntk
r�YnXd|_|�r$|j d@r�|j!d?d@}n|jd?d@}|�"�}||k�r$t#d	|j$��dS)
NFr-rroTrr�r�zBad password for file %r)%�_fileobj�_pwd�_close_fileobjre�_compress_typerp�_compress_leftrq�_leftr��
_decompressor�_eof�_readbuffer�_offset�newlines�moderB�namer@ro�
_expected_crcr��_running_crc�	_seekablerrZ�_orig_compress_start�_orig_compress_size�_orig_file_size�_orig_start_crc�AttributeError�
_decrypterrjrr�_init_decrypterr�rc)r�rr �zipinfor�Z
close_fileobjZ
check_byte�hrrrr�)sF




zZipExtFile.__init__cCs4t|j�|_|j�d�}|jd8_|�|�dS)Nrr&)r�rr*rr>r)r�r�rrrr+\szZipExtFile._init_decryptercCsvd|jj|jjfg}|jsX|�d|j|jf�|jtkrb|�dt	�
|j|j��n
|�d�|�d�d�|�S)N�<%s.%sz name=%r mode=%rr��	 [closed]r�r�)r�rr�closedr1r!r rrr�r�r2�r�rCrrrr�gs�
��

zZipExtFile.__repr__r�cCsL|dkr>|j�d|j�d}|dkr>|j|j|�}||_|Stj�||�S)zrRead and return a line from the stream.

        If limit is specified, at most limit bytes will be read.
        r�
r)rrwr�io�BufferedIOBase�readline)r��limitr6�linerrrr5uszZipExtFile.readlinercCsr|t|j�|jkr\|�|�}t|�|jkrJ||j|jd�|_d|_n|jt|�8_|j|j|jd�S)z6Returns buffered bytes without advancing the position.Nri)r0rrr>)r�r�chunkrrr�peek�s
zZipExtFile.peekcCsdS�NTrr�rrr�readable�szZipExtFile.readablecCs|dks|dkrH|j|jd�}d|_d|_|jsD||�|j�7}q,|S||j}|t|j�krz|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dkr�|js�|�|�}|t|�kr�||_||_||d|�7}q�||7}|t|�8}q�|S)z�Read and return up to n bytes.
        If the argument is omitted, None, or negative, data is read and returned until EOF is reached.
        Nrr-�rrr�_read1�MAX_Nr0)r�r�buf�endrVrrrr>�s4

zZipExtFile.readcCs@|jdkrdSt||j�|_|jr<|j|jkr<td|j��dS)NzBad CRC-32 for file %r)r"r�r#rrr!)r��newdatarrr�_update_crc�s

zZipExtFile._update_crccCs|dks|dkrR|j|jd�}d|_d|_|jsN|�|j�}|r,||7}qNq,|S||j}|t|j�kr�|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dk�r|j�s|�|�}|t|�kr�||_||_||d|�7}�q|r�||7}�qq�|S)z7Read up to n bytes with at most one read() system call.Nrr-r<)r�rr?rVr@rrr�read1�s>


zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|�krR||�|t|��7}n
|�|�}|jtkrj|jdk|_nx|jtkr�t	||j
�}|j�||�}|jjp�|jdko�|jj|_|jr�||j�
�7}n |j�|�}|jjp�|jdk|_|d|j�}|jt|�8_|jdk�rd|_|�|�|S)Nrr-T)rrrrZunconsumed_tailr0�_read2rrr_�
MIN_READ_SIZEr�r�r�rrBr
rrrr=�s4




�
zZipExtFile._read1cCsd|jdkrdSt||j�}t||j�}|j�|�}|jt|�8_|sLt�|jdk	r`|�|�}|S)Nrr-)	rr_rE�minrr>r0�EOFErrorr*r
rrrrD	s


zZipExtFile._read2cs&z|jr|j��W5t���XdSr�)�superr	rrr��r�rrr	szZipExtFile.closecCs|jSr�)r$r�rrrr szZipExtFile.seekablercCs>|jst�d��|��}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd��||jkrd|j}|dkrpd}||}||j}|dkr�|t|j�kr�||_d}nf|dk�r
|j	�
|j�|j|_
|j|_|j|_d|_d|_t|j�|_d|_|}|jdk	�r
|��|dk�r6t|j|�}|�|�||8}�q
|��S)N�!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r-F)r$r3�UnsupportedOperationrZr'r|rr0rrrDr%r(r#r&rrr�rrrr*r+rF�
MAX_SEEK_READr>)r�rTrZcurr_posZnew_posZread_offsetZbuff_offsetZread_lenrrrrD#sH






zZipExtFile.seekcCs0|jst�d��|j|jt|j�|j}|S)NrJ)r$r3rKr'rr0rr)r�ZfileposrrrrZSs
zZipExtFile.tell)NF)r�)r)r�)r)rrrrr>rErLr�r+r�r5r9r;r>rBrCr=rDr	rrDrZ�
__classcell__rrrIrrs*�
3



!
%$
0rcs@eZdZdd�Zedd��Zdd�Zdd�Z�fd	d
�Z�Z	S)�
_ZipWriteFilecCs8||_||_||_t|j|j�|_d|_d|_d|_	dSr)
�_zinfo�_zip64�_zipfiler�rerf�_compressor�
_file_size�_compress_size�_crc)r��zfr�r�rrrr�[s�z_ZipWriteFile.__init__cCs|jjSr�)rQr<r�rrrresz_ZipWriteFile._fileobjcCsdSr:rr�rrr�writableisz_ZipWriteFile.writablecCsf|jrtd��t|�}|j|7_t||j�|_|jrV|j�|�}|jt|�7_|j	�
|�|S)NzI/O operation on closed file.)r0r|r0rSr�rUrRr�rTrr)r�rV�nbytesrrrrlsz_ZipWriteFile.writec	sb|jr
dS�zFt���|jrR|j��}|jt|�7_|j	�
|�|j|j_n
|j
|j_|j|j_|j
|j_|jjd@r�|jr�dnd}|j	�
t�|t|jj|jj|jj��|j	��|j_nn|js�|j
tkr�td��|jtkr�td��|j	��|j_|j	�|jj�|j	�
|j�|j��|j	�|jj�|jj�|j�|j|jj|jj <W5d|j_XdS)NFrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limit)!r0rQrrHr	rRr�rTr0rrrOrprSrUrorqrjrPrFr��
_DD_SIGNATURErZ�	start_dirr�r�rDrnr��filelistr1�
NameToInforB)r�r?r�rIrrr	xsF




�
�
�z_ZipWriteFile.close)
rrrr��propertyrrWrr	rMrrrIrrNZs

rNc@s$eZdZdZdZdZdeddfdd�dd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
d=dd�Zdd�Zdd�Zdd�Zedd��Zejdd��Zd>dd �Zd?d!d"�d#d$�Zd@d%d&�ZdAd'd(�ZdBd)d*�Zed+d,��Zd-d.�Zd/d0�ZdCd1d2�ZdDd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#dS)Erai Class with methods to open, read, write, close, list zip files.

    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True,
                compresslevel=None)

    file: Either the path to the file, or a file-like object.
          If it is a path, the file will be opened and closed by ZipFile.
    mode: The mode can be either read 'r', write 'w', exclusive create 'x',
          or append 'a'.
    compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib),
                 ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma).
    allowZip64: if True ZipFile will create files with ZIP64 extensions when
                needed, otherwise it will raise an exception when this would
                be necessary.
    compresslevel: None (default for the given compression type) or an integer
                   specifying the level to pass to the compressor.
                   When using ZIP_STORED or ZIP_LZMA this keyword has no effect.
                   When using ZIP_DEFLATED integers 0 through 9 are accepted.
                   When using ZIP_BZIP2 integers 1 through 9 are accepted.

    N�rTr�c
	CsP|dkrtd��t|�||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_t
|tj�rpt�|�}t
|t�r�d|_||_ddd	d
dddd
�}||}zt�||�|_Wq�tk
r�||kr�||}Yq��Yq�Xq�q�nd|_||_t|dd�|_d|_t��|_d|_d|_�z|dk�r4|��n�|dk�r�d|_z|j� �|_!Wn2t"tfk
�r�t#|j�|_d|_!d|_Yn6Xz|j�$|j!�Wn t"tfk
�r�d|_YnXnf|dk�rz|��|j�$|j!�Wn6t%k
�r|j�$dd�d|_|j� �|_!YnXntd��Wn$|j}	d|_|�&|	��YnXdS)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
        or append 'a'.)r^�w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNr-r?�w+b�x+b�r+b�wbZxb)r^r_r`rardrbrcrr!Tr^)r_r`rarz"Mode must be 'r', 'w', 'x', or 'a')'r|r��_allowZip64�
_didModify�debugr\r[r�r�r r��_comment�_strict_timestampsr�ryr�r��str�_filePassedrBr3rAr<r:�getattr�_fileRefCnt�	threading�RLockrr$r�_RealGetContentsrZrZr)rrDr�_fpclose)
r�rr r��
allowZip64r�r�ZmodeDictr�r<rrrr��s�

�





zZipFile.__init__cCs|Sr�rr�rrr�	__enter__szZipFile.__enter__cCs|��dSr��r	)r��type�value�	tracebackrrr�__exit__szZipFile.__exit__cCs�d|jj|jjfg}|jdk	rd|jr8|�d|j�n|jdk	rR|�d|j�|�d|j�n
|�d�|�d�d�|�S)Nr.z file=%rz filename=%rz mode=%rr/r�r�)	r�rrr<rlr1rBr r2r1rrrr�"s�



zZipFile.__repr__cCs�|j}zt|�}Wntk
r.td��YnX|s<td��|jdkrNt|�|t}|t}|t|_	|t
||}|ttkr�|t
t8}|jdkr�||}td|||�|||_|�|jd�|�|�}t�|�}d}||k�r�|�t�}	t|	�tk�r
td��t�t|	�}	|	ttk�r,td��|jdk�r@t|	�|�|	t�}
|	d}|d	@�rl|
�d
�}
n
|
�d�}
t|
�}|�|	t�|_|�|	t �|_!|	t"|_#|	dd�\|_$|_%|_&|_'|_(|_)}
}|_*|_+|_,|j&t-k�r�t.d
|j&d��|	dd�\|_/|_0|_1|
|_2|d?d|d?d@|d@|
d?|
d?d@|
d@df|_3|�4�|j#||_#|j5�6|�||j7|j8<|t|	t|	t|	t }|jdkr�td|�q�dS)z/Read in the table of contents for the ZIP file.zFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!r�r��cp437rzzip file version %.1fr%r(r+r$rur�r&r�totalN)9r<r9r:rrh�printrQrR�_ECD_COMMENTri�
_ECD_LOCATIONrLrKrIrErZrDr>r3�BytesIO�sizeCentralDirr0rFr/�structCentralDir�
_CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder
�_CD_EXTRA_FIELD_LENGTHr3�_CD_COMMENT_LENGTHrb�_CD_LOCAL_HEADER_OFFSETrnrWrgrhrirjrerorprq�MAX_EXTRACT_VERSIONr�rkrlrmrrrdr�r[r1r\rB)r�r<rUZsize_cdZ	offset_cd�concatZinferredrVr{�centdirrB�flagsr`�t�drrrrq0s�











��

���
zZipFile._RealGetContentscCsdd�|jD�S)z+Return a list of file names in the archive.cSsg|]
}|j�qSrr�)�.0rVrrr�
<listcomp>�sz$ZipFile.namelist.<locals>.<listcomp>�r[r�rrr�namelist~szZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the
        archive.r�r�rrr�infolist�szZipFile.infolistcCsLtdd|d�|jD]0}d|jdd�}td|j||jf|d�qdS)z+Print a table of contents for the zip file.z%-46s %19s %12s)z	File NamezModified    ZSize�rz%d-%02d-%02d %02d:%02d:%02dNr"z
%-46s %s %12d)r|r[rdrBrq)r�rr��daterrr�printdir�s�
�zZipFile.printdirc
Cs^d}|jD]N}z*|�|jd��}|�|�r,q W5QRXWq
tk
rV|jYSXq
dS)z%Read all the files and check the CRC.ir^N)r[rArBr>r)r�Z
chunk_sizer��frrr�testzip�s

zZipFile.testzipcCs$|j�|�}|dkr td|��|S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)r\r��KeyError)r�r!�inforrr�getinfo�s�zZipFile.getinfocCs6|r t|t�s tdt|�j��|r,||_nd|_dS)z)Set default password for encrypted files.�pwd: expected bytes, got %sN)r�r��	TypeErrorrvrr�)r�r�rrr�setpassword�s
zZipFile.setpasswordcCs|jS)z.The comment text associated with the ZIP file.)rir�rrrrb�szZipFile.commentcCs^t|t�stdt|�j��t|�tkrNddl}|jdtdd�|dt�}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr��
stacklevelT)r�r�r�rvrr0�ZIP_MAX_COMMENT�warnings�warnrirg)r�rbr�rrrrb�s
��c
Cs.|�|d|��}|��W5QR�SQRXdS)zReturn file bytes for name.r^N�rAr>)r�r!r�r<rrrr>�szZipFile.readF��force_zip64cs|dkrtd��|r0t|t�s0tdt|�j��|rD|dkrDtd���jsRtd��t|t�rb|}n,|dkr�t|�}�j|_	�j
|_n
��|�}|dkr��j
||d�S�jr�td���jd	7_t�j|j�j�j�fd
d��}�z|�t�}t|�tk�rtd��t�t|�}|ttk�r&td
��|�|t�}|t�rL|�|t�|jd@�r`t d��|jd@�rtt d��|t!d@�r�|�"d�}	n
|�"d�}	|	|j#k�r�td|j#|f��|jd	@}
|
�r�|�s҈j$}|�s�t%d|��nd}t&||||d�WS|�'��YnXdS)auReturn file-like object for 'name'.

        name is a string for the file name within the ZIP file, or a ZipInfo
        object.

        mode should be 'r' to read a file already in the ZIP file, or 'w' to
        write to a file newly added to the archive.

        pwd is the password to decrypt files (only used for reading).

        When writing, if the file size is not known in advance but may exceed
        2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
        files.  If the size is known in advance, it is best to pass a ZipInfo
        instance for name, with zinfo.file_size set.
        >r_r^zopen() requires mode "r" or "w"r�r_z'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedr�rrcs�jSr�)rrr�rr�<lambda>�r-zZipFile.open.<locals>.<lambda>zTruncated file headerz Bad magic number for file header� z$compressed patched data (flag bit 5)�@zstrong encryption (flag bit 6)r�r�rzz/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionNT)(r|r�r�r�rvrr<r
r�rer�rfr��_open_to_writerrnrrnrrrr>�sizeFileHeaderr0rrFr/r��
_FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHrjr��_FH_GENERAL_PURPOSE_FLAG_BITSr�rcr�r�rr	)r�r!r r�r�r�Zzef_fileZfheader�fnameZ	fname_strZis_encryptedrr�rrA�s~�




�


��
�zZipFile.opencCs�|r|jstd��|jr td��t|d�s0d|_d|_d|_d|_|jt	krZ|jdO_|j
sn|jdO_|jszd|_|jo�|p�|jdtk}|j
r�|j
�|j�|j
��|_|�|�d	|_|j
�|�|��d	|_t|||�S)
NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rqrrr��g�������?T)rfr|rr@rqrprorjrerr$rmr�r<rDrZrZrn�_writecheckrgrr�rN)r�r�r�r�rrrr�(s8
�

�
zZipFile._open_to_writecCs*|dkrt��}n
t�|�}|�|||�S)a#Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a ZipInfo object. You can
           specify a different directory using `path'.
        N)ry�getcwdr��_extract_member)r��memberr�r�rrr�extractSs

zZipFile.extractcCsH|dkr|��}|dkr"t��}n
t�|�}|D]}|�|||�q0dS)z�Extract all members from the archive to the current working
           directory. `path' specifies a different directory to extract to.
           `members' is optional and must be a subset of the list returned
           by namelist().
        N)r�ryr�r�r�)r�r��membersr�r,rrr�
extractall`s

zZipFile.extractallcCs^|j}|s(d}t�|dt|��}||_|�|�}dd�|�|�D�}|�dd�|D��}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*�_css|]}|�d�VqdS)�.N)�rstrip�r�r`rrr�	<genexpr>{sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdSr�rr�rrrr�}s)�!_windows_illegal_name_trans_tablerk�	maketransr0�	translate�splitr2)r�r��pathsep�tableZillegalrrr�_sanitize_windows_nameqs
zZipFile._sanitize_windows_namec
sLt|t�s|�|�}|j�dtjj�}tjjrB|�tjjtjj�}tj�	|�d}dtjj
tjjf�tjj��fdd�|�
tjj�D��}tjjdkr�|�|tjj�}tj�||�}tj�|�}tj�|�}|r�tj�|�s�t�|�|���rtj�|��st�|�|S|j||d��(}t|d��}t�||�W5QRXW5QRX|S)	zbExtract the ZipInfo object 'member' to a physical
           file on the path targetpath.
        rvrr�c3s|]}|�kr|VqdSr�rr��Zinvalid_path_partsrrr��s�z*ZipFile._extract_member.<locals>.<genexpr>�\)r�re)r�r
r�rBr{ryr�rzr�r��curdir�pardirr2r�r�r��dirname�exists�makedirsr�r��mkdirrA�shutil�copyfileobj)r�r�Z
targetpathr�r�Z	upperdirs�source�targetrr�rr��s2

&


� zZipFile._extract_membercCs�|j|jkr(ddl}|jd|jdd�|jdkr:td��|jsHtd��t|j�|j	s�d}t
|j�tkrpd	}n|j
tkr�d
}n|jtkr�d}|r�t|d��dS)
z6Check for errors before writing a file to the archive.rNzDuplicate name: %rrr��r_r`raz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed�Files countZFilesizezZipfile size� would require ZIP64 extensions)rBr\r�r�r r|r<r�rerfr0r[�ZIP_FILECOUNT_LIMITrqr�rnr
)r�r�r��requires_zip64rrrr��s,
�


�zZipFile._writecheckc
CsP|jstd��|jrtd��tj|||jd�}|��rDd|_d|_n0|dk	rT||_	n|j
|_	|dk	rl||_n|j|_|���r|j
��|jr�|j�|j�|j��|_|j	tkr�|jdO_|�|�d|_|j�|�||j|j<|j�|�d��|j��|_W5QRXn<t|d	��,}|�|d
��}t�||d�W5QRXW5QRXdS)zLPut the bytes from filename into the archive under the name
        arcname.�7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsr�rNrTFr?r_i ) r<r|rr
r�rjr�rprorer�rfr�rr$rDrZrZrnrrjr�rgr[r1r\rBrr�rAr�r�)r�rBr�rer�r��src�destrrrr�sF���


z
ZipFile.writec
Cs�t|t�r|�d�}t|t�sxt|t�t���dd�d�}|j|_|j|_	|j
ddkrpd|_|jdO_q|d	|_n|}|js�t
d
��|jr�t
d��|dk	r�||_|dk	r�||_	t|�|_|j�*|j|dd
��}|�|�W5QRXW5QRXdS)aWrite a file into the archive.  The contents is 'data', which
        may be either a 'str' or a 'bytes' instance; if it is a 'str',
        it is encoded as UTF-8 first.
        'zinfo_or_arcname' is either a ZipInfo instance or
        the name of the file in the archive.r�Nr")rBrdr�rvi�Ar)r�r�z?Can't write to ZIP archive while an open writing handle exists.r_)r )r�rkr�r
r�r�r�rer�rfrBrmr<r|rr0rqrrAr)r�Zzinfo_or_arcnamerVrer�r�r�rrr�writestr�s:


���
zZipFile.writestrcCs|��dS)z2Call the "close()" method in case the user forgot.Nrur�rrr�__del__szZipFile.__del__c	Cs||jdkrdS|jrtd��zB|jdkr\|jr\|j�"|jrJ|j�|j	�|�
�W5QRXW5|j}d|_|�|�XdS)zOClose the file, and for mode 'w', 'x' and 'a' write the ending
        records.NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r�)r<rr|rrr rgrr$rDrZ�_write_end_recordrrrrr	s
z
ZipFile.closecCs�|jD�]D}|j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}g}|jtksr|jtkr�|�|j�|�|j�d
}d
}n|j}|j}|jtkr�|�|j�d
}n|j}|j}	d}
|�rt|	d�}	t	j
dd
t|�ddt|�f|��|	}	t}
|j
tk�r$tt|
�}
n|j
tk�r:tt|
�}
t|
|j�}t|
|j�}zZ|��\}
}t	�
tt||j||j||j
|||j||t|
�t|	�t|j�d|j|j|�}Wnltk
�rttt||j||j|j |j
|||j||t|j!�t|	�t|j�d|j|j|ft"j#d��YnX|j$�%|�|j$�%|
�|j$�%|	�|j$�%|j�q|j$�&�}t|j�}||j'}|j'}d}|t(k�r�d}n|tk�r�d}n|tk�r�d}|�r$|j)�s�t*|d��t	�
t+t,ddddd||||�}|j$�%|�t	�
t-t.d|d�}|j$�%|�t/|d�}t/|d
�}t/|d
�}t	�
t0t1dd||||t|j2��	}|j$�%|�|j$�%|j2�|j3dk�rt|j$�4�|j$�5�dS)Nrrur$rr!rrr&r r�)rr,�Qrr�r�zCentral directory offsetzCentral directory sizer��,rrra)6r[rdrqr�rpr1rnr3r8rFr�r0r�rerr_r�rr�rhrWr�r�r�rgrirorbrlrm�DeprecationWarningr|rjrBr}�stderrr<rrZrZr�rfr
rJrKrGrHrFr]r\rir �truncater�)r�r�r�r�r�r3rqrprnZ
extra_datar�rhrWrBrjr�Zpos2ZcentDirCountZcentDirSizeZ
centDirOffsetr�Zzip64endrecZzip64locrecrUrrrr�5s$$
�


���
���





���


�
zZipFile._write_end_recordcCs&|jd8_|js"|js"|��dS)Nr)rnrlr	rrrrrr�szZipFile._fpclose)N)N)r^N)F)NN)NNN)NNN)NN)$rrrrr<r�rr�rtryr�rqr�r�r�r�r�r�r]rb�setterr>rAr�r�r�r�r�r�r�rr�r�r	r�rrrrrrr�sT��ZN
	
		


b
+


*�
2�
)hc@s4eZdZdZdeddfdd�Zd
d	d
�Zdd�ZdS)rzDClass to create ZIP archives with Python library files and packages.r^Tr�cCstj|||||d�||_dS)N)r r�rs)rr��	_optimize)r�rr r�rs�optimizerrrr��s�zPyZipFile.__init__r�NcCs�t�|�}|rD||�sD|jr@tj�|�r,dnd}td||f�dStj�|�\}}tj�|��rhtj�|d�}tj�|��r�|r�d||f}n|}|jr�td|d|�|�	|d	d
�|�\}}	|jr�td|	�|�
||	�tt�|��}
|
�
d�|
D]�}tj�||�}tj�|�\}
}tj�|��rRtj�tj�|d���r�|j|||d�q�|d
kr�|�r~||��s~|jr�td|�q�|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�q�n�|j�r�td|�tt�|��D]�}tj�||�}tj�|�\}
}|d
k�r�|�r,||��s,|j�r�td|��q�|�	|d	d
�|�\}}	|j�rVtd|	�|�
||	��q�nP|d
d�d
k�r�td��|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�dS)a�Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
        the modules into the archive.  If pathname is a plain
        directory, listdir *.py and enter all modules.  Else, pathname
        must be a Python *.py file and the module will be put into the
        archive.  Added modules are always module.pyc.
        This method will compile the module.py into module.pyc if
        necessary.
        If filterfunc(pathname) is given, it is called with every argument.
        When it is False, the file or directory is skipped.
        r�rz%s %r skipped by filterfuncNz__init__.py�%s/%szAdding package in�asr���ZAdding)�
filterfunc�.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)ryr�rhr�r�r|r�r2�isfile�
_get_codenamer�sorted�listdir�remove�splitext�writepyr�)r��pathname�basenamer�Zlabel�dirr!Zinitnamer�r�ZdirlistrBr��rootZextrrrr��s�


��


�
�
zPyZipFile.writepyc
sd�fdd�	}|d}|d}tjj|dd�}tjj|dd�}tjj|d	d�}�jdk�r\tj�|�r�t�|�jt�|�jkr�|}	}
n�tj�|�r�t�|�jt�|�jkr�|}
|}	n�tj�|�r�t�|�jt�|�jkr�|}
|}	nvtj�|��rt�|�jt�|�jk�r|}
|}	nD||��rRt	j
jd
k�r4|}
nt	j
jdk�rH|}
n|}
|}	n|}
}	n��jd
k�rr|}
|}	n<|}	�jdk�r�|}
n&�jd	k�r�|}
nd��j�}t
|��tj�|
��r�t�|
�jt�|�jk�s�||�jd��s�|}
}	tj�|	�d}|�rd
||f}|
|fS)aReturn (filename, archivename) for the path.

        Given a module name path, return the correct file path and
        archive name, compiling if necessary.  For example, given
        /python/lib/string, return (/python/lib/string.pyc, string).
        r�c
sfddl}�jrtd|�z|j|d|d�Wn4|jk
r`}zt|j�WY�dSd}~XYnXdS)NrZ	CompilingT)�doraiser�F)�
py_compilerhr|�compile�PyCompileError�msg)rr�r��errr�rr�_compiles

z)PyZipFile._get_codename.<locals>._compiler�z.pycr�)�optimizationrrrz"invalid value for 'optimize': {!r})r�r�)r�)�	importlib�util�cache_from_sourcer�ryr�r�r�r�r}r�r��formatr|r�)
r�r�r�r�Zfile_pyZfile_pycZpycache_opt0Zpycache_opt1Zpycache_opt2r�r�r�Zarchivenamerr�rr��sj�
���

�zPyZipFile._get_codename)r�N)rrrrrr�r�r�rrrrr�s�

RcCst�t|�dd�S)a2
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    rN)�	itertools�islice�	_ancestry)r�rrr�_parentsRsrccs4|�tj�}|r0|tjkr0|Vt�|�\}}qdS)aR
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []
    N)r��	posixpathrzr�)r��tailrrrresrcCst�t|�j|�S)zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )r�filterfalse�set�__contains__)ZminuendZ
subtrahendrrr�_differencesr	csHeZdZdZedd��Z�fdd�Zdd�Zdd	�Ze	d
d��Z
�ZS)�CompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    cCs.tj�tt|��}dd�|D�}tt||��S)Ncss|]}|tjVqdSr�)rrz)r�r�rrrr��sz-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterabler�r�_deduper	)�names�parentsZas_dirsrrr�
_implied_dirs�szCompleteDirs._implied_dirscs tt|���}|t|�|��Sr�)rHr
r�r^r)r�rrIrrr��szCompleteDirs.namelistcCst|���Sr�)rr�r�rrr�	_name_set�szCompleteDirs._name_setcCs,|��}|d}||ko||k}|r(|S|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        rv)r)r�r!rr�Z	dir_matchrrr�resolve_dir�szCompleteDirs.resolve_dircCsNt|t�r|St|t�s ||�Sd|jkr.t}|�|�}t|��t|��|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        r^)r�r
rr �__new__�vars�update)r�r��resrrr�make�s



zCompleteDirs.make)rrrr�staticmethodrr�rrr�rrMrrrIrr
�s

r
cs,eZdZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)�
contextlib�suppressr)Z_FastLookup__namesrHrr�r�rIrrr��szFastLookup.namelistc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)rrr)Z_FastLookup__lookuprHrrr�rIrrr�szFastLookup._name_set)rrrrr�rrMrrrIrr�src@s�eZdZdZdZd#dd�Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZed d!��Zd"S)$ru�
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('abcde.zip', 'a.txt')
    >>> b
    Path('abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> str(c)
    'abcde.zip/b/c.txt'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})r�cCst�|�|_||_dSr�)rrr��at)r�r�rrrrr�	sz
Path.__init__cCst�|jj|j�Sr�)�	functools�partialr�rArr�rrrrA	sz	Path.opencCst�|j�d��S�Nrv)rr�rr�r�rrrr!	sz	Path.namec
Os6|���$}tj|f|�|���W5QR�SQRXdSr�)rAr3�
TextIOWrapperr>)r��args�kwargs�strmrrr�	read_text	s
zPath.read_textc
Cs(|���}|��W5QR�SQRXdSr�r�)r�r#rrr�
read_bytes	s
zPath.read_bytescCst�|j�d��|j�d�kSr)rr�rr�)r�r�rrr�	_is_child"	szPath._is_childcCst|j|�Sr�)rr�)r�rrrr�_next%	sz
Path._nextcCs|jp|j�d�Sr)r�endswithr�rrrr�(	szPath.is_dircCs
|��Sr�)r�r�rrr�is_file+	szPath.is_filecCs|j|j��kSr�)rr�rr�rrrr�.	szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)r�r|r�r'r�r��filterr&)r�Zsubsrrr�iterdir1	szPath.iterdircCst�|jj|j�Sr�)rr2r�rBrr�rrr�__str__7	szPath.__str__cCs|jj|d�S)Nr�)�_Path__reprr�r�rrrr�:	sz
Path.__repr__cCs t�|j|�}|�|j�|��Sr�)rr2rr'r�r)r��add�nextrrr�joinpath=	sz
Path.joinpathcCs(t�|j�d��}|r|d7}|�|�Sr)rr�rr�r')r�Z	parent_atrrr�parentC	szPath.parentN)r�)rrrrr-r�r]rAr!r$r%r&r'r�r)r�r+r,r�r0�__truediv__r1rrrrr�s*@


c
	s�ddl}d}|j|d�}|jdd�}|jdddd	d
�|jddd
ddd�|jdddddd�|jddddd
�|�|�}|jdk	r�|j}t|d��}|��}W5QRX|r�td�	|��td�n�|j
dk	r�|j
}t|d��}|��W5QRXn�|jdk	�r,|j\}}t|d��}|�
|�W5QRXn�|jdk	�r�|j�d�}	|j}
�fdd��t|	d��\}|
D]P}tj�|�}|�s�tj�tj�|��}|dtjtjfk�r�d}�|||��qfW5QRXdS) Nrz3A simple command-line interface for zipfile module.)�descriptionT)Zrequiredz-lz--list�	<zipfile>zShow listing of a zipfile)�metavar�helpz-ez	--extractr)r4z<output_dir>zExtract zipfile into target dir)�nargsr5r6z-cz--create�+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validr^z.The following enclosed file is corrupted: {!r}zDone testingcsptj�|�r|�||t�nPtj�|�rl|r8|�||�tt�|��D]$}�|tj�||�tj�||��qFdSr�)	ryr�r�rrr�r�r�r2)rVr��zippathZnm��addToZiprrr;s	s�zmain.<locals>.addToZipr_r�)�argparse�ArgumentParserZadd_mutually_exclusive_group�add_argument�
parse_argsZtestrr�r|r�r^r�r�r�Zcreate�popryr�r�r�r�r�)
r!r<r3�parser�groupr�rVZbadfiler�Zzip_name�filesr�r9rr:r�mainK	s\
�
�
�
�




rD�__main__)N)N)�rZbinasciir�importlib.utilr�r3rryrr�r�rFr}ror�rr�r��ImportErrorr�r��__all__�	Exceptionrr
rrr�r�r�rrrrrr�r�r�r�r]r\r�r[rLrMrNrOrPrQrRrar}r~r�r�r�r�Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ
_CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr�r�r�Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr�r�r�r�r�Z_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMr�Z_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZEr�r�rGrHrErJrKrIZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRrYZStructr.r8r=r	rXr9�objectr
r�r�r�r�r�r�r�r�r�rrr4rrNrrrr�dict�fromkeysr
r	r
rrrDrrrrr�<module>sl


�






+=q&�
&AN/2
=
sre_compile.cpython-38.pyc000064400000035450151450073350011507 0ustar00U

e5dGh�@s$dZddlZddlZddlTejeks.td��eehZe	e
ehZe
ehZeehZeeehBZdZdd�eD�Zejfdd	�Zd
d�Zdd
�Zd-dd�ZejdZde>dZdZ ee!fdd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd �Z(d!d"�Z)d#d$�Z*d%d&�Z+d'd(�Z,d)d*�Z-d.d+d,�Z.dS)/zInternal support module for sre�N)�*zSRE module mismatch))�ii1)�si)�i�)iEi�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)iai�)i�i�cs.i|]&}|D]��t�fdd�|D���qqS)c3s|]}�|kr|VqdS�N�)�.0�j��ir�#/usr/lib64/python3.8/sre_compile.py�	<genexpr>>sz<dictcomp>.<genexpr>)�tuple)r�trr
r�
<dictcomp>>s
�rcCs ||@r||M}||B|@Srr)�flags�	add_flags�	del_flags�
TYPE_FLAGSrrr�_combine_flagsAs
rcCs�|j}t}t}t}t}t}d}	d}
d}|t@r\|t@s\|t@rPt	j
}	t	j}
t}nt	j
}	t	j}
|D�]|\}}
||k�rr|t@s�||�||
�n�|t@r�|t|�||
�n�|	|
�s�||�||
�n�|
|
�}|s�|t|�||�n�||k�r|t|�||�nh|t�||�}|d�|tk�r2|t�|f||D]}|t�||��q@|t�||�|||<q`|tk�rt|
|	|
|�\}}|t@�r�|t@�r�|t�n(|�s�|t�n|�s�|t�n|t�||�}|d�t|||�||�|||<q`|tk�r*|t@�r |t�n|t�q`||k�r6|t@�rLt d|f��t!|
d��r�|t"k�rn|t#�n|t$�||�}|d�||
d�||
d�t%||
d|�|t&�||�|||<nl|t'�||�}|d�||
d�||
d�t%||
d|�||�|||<|t"k�r,|t(�n|t)�q`|t*k�r�|
\}}}}|�rj|t+�||dd�t%||t,|||��|�r�|t+�||ddd�q`||k�r�||�q`||k�rD||�||�}|d�|
ddk�r�|d�n*|
d�-�\}}||k�rt d��||�t%||
d|�|t&�||�|||<q`|t.k�r�||�||�}|d�t%||
|�|t&�||�|||<q`|t/k�r�||�|t0@�r�t1�2|
|
�}
|t@�r�t3�2|
|
�}
n|t@�r�t4�2|
|
�}
||
�q`|t5k�r�||�g}|j}|
dD]N}
||�}|d�t%||
|�|t6�|||��|d�||�|||<�q|t�|D]}||�|||<�qlq`|t7k�r�||�|t@�r�t8|
}
n|t@�r�t9|
}
||
�q`|t:k�r |t@�s�||�n,|t@�r�|t;�n|�s
|t<�n|t=�||
d�q`|t>k�r�||�||
dd�||�}|d�t%||
d|�|
d�r�|t6�||�}|d�||�|d||<t%||
d|�||�|||<n||�|d||<q`t d|f��q`dS)Nrz*internal: unsupported template operator %r��z(look-behind requires fixed-width patternz%internal: unsupported operand type %r)?�append�len�_LITERAL_CODES�_REPEATING_CODES�_SUCCESS_CODES�
_ASSERT_CODES�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_UNICODE�_sre�unicode_iscased�unicode_tolower�_ignorecase_fixes�
ascii_iscased�
ascii_tolower�OP_LOCALE_IGNORE�	OP_IGNORE�OP_UNICODE_IGNORE�
IN_UNI_IGNORE�NOT_LITERAL�NEGATE�LITERAL�FAILURE�IN�_optimize_charset�
IN_LOC_IGNORE�	IN_IGNORE�_compile_charset�ANY�SRE_FLAG_DOTALL�ANY_ALL�SRE_FLAG_TEMPLATE�error�_simple�
MAX_REPEAT�
REPEAT_ONE�MIN_REPEAT_ONE�_compile�SUCCESS�REPEAT�	MAX_UNTIL�	MIN_UNTIL�
SUBPATTERN�MARKr�getwidth�CALL�AT�SRE_FLAG_MULTILINE�AT_MULTILINE�get�	AT_LOCALE�
AT_UNICODE�BRANCH�JUMP�CATEGORY�	CH_LOCALE�
CH_UNICODE�GROUPREF�GROUPREF_LOC_IGNORE�GROUPREF_IGNORE�GROUPREF_UNI_IGNORE�GROUPREF_EXISTS)�code�patternr�emit�_len�
LITERAL_CODES�REPEATING_CODES�
SUCCESS_CODES�ASSERT_CODES�iscased�tolower�fixes�op�av�lo�skip�k�charset�hascased�grouprr�p�hi�tail�
tailappend�skipyes�skipnorrrr=GsV
















































r=cCs�|j}|D]�\}}||�|tkr$q
|tkr6||�q
|tksF|tkr`||d�||d�q
|tkrt|�|�q
|tkr�|�|�q
|tkr�|t	@r�|t
|�q�|t@r�|t|�q�||�q
t
d|f��q
|t�dS)Nrrz%internal: unsupported set operator %r)rr,r-�RANGE�RANGE_UNI_IGNORE�CHARSET�extend�
BIGCHARSETrNrrOr rPr8r.)rfrrVrXrarbrrrr3�s,

r3c	Cs�g}g}td�}d}|D�]�\}}	�z,|tkr�|rv||	�}
d||
<|rd|
|krd||
D]}d||<qV|s~||	�r~d}nd||	<n�|tk�r&t|	d|	dd�}|�r|r�t||�D]*}
d||
<|
|kr�||
D]}d||<q�q�nt||�D]}
d||
<q�|�s$tt||��}n|D]}
d||
<�qn(|tk�r@|�||	f�n|�||	f�WnZtk
�r�t	|�dk�r�|dd7}Yq"|�r�d}|tk�r�t
}|�||	f�YnXqq"qg}d}|�d|�}|dk�rԐq(t	|�dk�r�d}�q(|�d|�}|dk�r|�|t	|�f��q(|�||f��q�|dk	�r�|D]>\}}||dk�r\|�t|f�n|�t||dff��q6||7}|�s�t	|�t	|�k�r�||fS||fSt	|�dk�r�t|�}|�t
|f�||7}||fSt|�}i}td�}d}t�}tdd	d�D]V}
||
|
d�}||k�r4||||
d<n$|||
d<||<|d7}||7}�qt|�}|gt|�|dd�<|�t|f�||7}||fS)
N�FrTr�i�ri)�	bytearrayr-ro�range�map�anyr,r�
IndexErrorrrp�find�
_mk_bitmaprq�bytes�_bytes_to_codesrs)rfr^�fixupr`�outrk�charmaprgrarbrcre�rr�runs�qri�data�comps�mapping�block�chunkrrrr0s�









r0�rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|�t�ddd�����fdd�tt��d��D�S)N���cs"g|]}��|�|�d��qS)rr)rr��	_CODEBITS�_int�srr�
<listcomp>�s�z_mk_bitmap.<locals>.<listcomp>r)�	translate�_BITS_TRANSrwr)�bitsr�r�rr�rr|�s�r|cCs@t|��d�}|jtjkst�t|�|jt|�ks8t�|��S)N�I)�
memoryview�cast�itemsizer!�CODESIZE�AssertionErrorr�tolist)�b�arrrr~�sr~cCsDt|�dkrdS|d\}}|tkr<|ddko:t|d�S|tkS)NrFrr�)rrBr9�_UNIT_CODES)rirarbrrrr9�sr9cCsndgt|�}tdt|��D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)aj
    Generate an overlap table for the following prefix.
    An overlap table is a table of the same size as the prefix which
    informs about the potential self-overlap for each index in the prefix:
    - if overlap[i] == 0, prefix[i:] can't overlap prefix[0:...]
    - if overlap[i] == k with 0 < k <= i, prefix[i-k+1:i+1] overlaps with
      prefix[0:k]
    rr)rrw)�prefix�tabler�idxrrr�_generate_overlap_table�s	r�cCs$|t@sdS|t@rtjStjSdSr)rr r!r"r%)rrrr�_get_iscased�s
r�cCs�g}|j}d}t|�}|jD]�\}}|tkrF|r<||�r<q�||�q|tkr�|\}}	}
}t||	|
�}|t@rz|t@rzq�t||�\}
}}|dkr�|dk	r�t	|�}n|dk	r�t	|�|}|�
|
�|s�q�qq�q||dfS||dfS)NTF)rr�r�r-rBrrr�_get_literal_prefixrrr)rWrr��prefixappend�prefix_skipr^rarbrhrrri�flags1�prefix1�prefix_skip1�got_allrrrr��s4



r�cCsd|js
dS|jd\}}|tk	r"qP|\}}}}t|||�}|t@r|t@rdSqt|�}|tkrz|rp||�rpdS||fgS|tkr�g}|j}	|dD]B}
|
s�dS|
d\}}|tkr�|r�||�s�|	||f�q�dSq�|S|t	k�r`|}|�r\|D]f\}}|tk�r||��rZdSq�|t
kr�|ddk�r4dStt|t
|d|dd���r�dSq�|SdS)Nrri��)r�rBrrrr�r-rLrr/roryrxrw)rWrrarbrhrrr^rf�
charsetappendrirrr�_get_charset_prefix�sN



 r�c
Cs||��\}}|tkrt}|dkr8|�tdd||g�dSg}d}g}|t@rT|t@srt||�\}}}|srt||�}|j}	|	t�t	|�}
|	d�d}|r�t
}|dkr�|r�|tB}n|r�|tB}|	|�|tkr�|	|�n|	t�|dt�}|	t
|t��|�r@|	t	|��|dk�rt	|�}|	|�|�|�|�t|��n(|�rht|�\}}|�r\t�t|||�t	|�|
||
<dS)Nr�)rD�MAXCODErr�INFOrrr�r�rr�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSET�minr�r0r�r3)
rVrWrrcrjr�r�rfr�rXrd�maskrgrrr�
_compile_infosT





r�cCst|ttf�Sr)�
isinstance�strr})�objrrr�isstringSsr�cCs8|jj|B}g}t|||�t||j|�|�t�|Sr)�staterr�r=r�rr>)rirrVrrr�_codeVs
r�cCsdd�dd�|D��S)N�[%s]�, css$|]}dtjdd|fVqdS)z%#0*xrN)r!r��r�xrrrr
fsz_hex_code.<locals>.<genexpr>)�join�rVrrr�	_hex_codeesr�csNddl�t��d�ttt��d���������fdd���dt���dS)Nrrc	s�dd�����fdd�
}��fdd�}�d7��}||k�r�|��|}|d7}t|}|tttttttfkrx||�q2|tt	t
ttt
ttfkr��|}|d7}||d|t|�f�q2|tk�r�|}|d7}tt|�}|dd�d	ks�t�|||dd��q2|tk�rV�|}|d7}tt|�}|dd
�dk�sBt�|||d
d��q2|ttttfk�r��|}|||||d��|d||�||7}q2|ttfk�r�||d�\}}	|d7}||d
||	t|�t|	�f�q2|tk�r||t�||dt���|dt7}q2|t k�rʈ|}|d7}t!d�"�fdd��||dt#j$�D���}
||||
�|dt#j$7}�d7�t%|�D].}|t�||dt���|dt7}�q��d8�q2|t&t't(t)t*fk�r��|}|d7}|||�q2|t+k�r(�|}|||||d�|d7}q2|t,k�r��|}|||||d�|�r��|d||�||7}|��|}|�r�|d|||d�n|t��qL|d7}q2|t-t.t/fk�r�||d�\}}}
|
t0k�r�d}
|||||
||d��|d||�||7}q2|t1k�rJ�||d�\}}||||||d�|d7}q2|t2t3fk�r��||d�\}}||||||d��|d||�||7}q2|t4k�rĈ||d�\}}}}
|
t0k�r�d}
|||t5|�||
||d�|d�|t6@�r��|d|d�\}}|d|�|d����|�}|ddd�"dd�|D��dd�"t7t|����|7�|d���|���|7�|t8@�r��d7�|d���||��d8�||7}q2t9|��q2�d8�dS)N)�tocsX|dk	r"��|�|d|ff7}td����kr6dndfd�dd�t|�dS)Nz(to %d)z%*d%s �:�.z  r��end)�add�print)r��args)�labels�level�offset_width�startrr�print_ps

�z!dis.<locals>.dis_.<locals>.print_cs"td�d�d�t|�dS)N� rr�)r�)r�)r�r�rr�print_2xsz"dis.<locals>.dis_.<locals>.print_2rz
%#02x (%r)�ZAT_�	Z	CATEGORY_rz%#02x %#02x (%r-%r)rt�c3s|]}|�tj�j�VqdSr)�to_bytesr!r��	byteorderr�)�sysrrr
�s�z$dis.<locals>.dis_.<locals>.<genexpr>�branch�	MAXREPEATr��z
  prefix_skipz  prefixr�r�css|]}d|VqdS)z%#02xNrr�rrrr
�sz(%r)�z	  overlap�in):�OPCODESr>r.r4r6r@rAr,r-r+�LITERAL_IGNORE�NOT_LITERAL_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�chrrFr��ATCODESr�rN�CHCODESr/r2r*r1rorprqr�r�rs�listr�r!r�rwrCrQrSrTrRrMrLr?r;r<r�rU�ASSERT�
ASSERT_NOTr��binr�rxr��
ValueError)r�r�r�r�rra�argrdrcrjr�r	r��maxr�
prefix_lenr�r��rV�dis_r�r�r�r�)r�rr�os�

�
�


 

�


�












�


zdis.<locals>.dis_)r��setrr�r�rr�r�dishsr�c	Cs�t|�r|}t�||�}nd}t||�}|t@r>t�t|�|jj}dg|jj	}|�
�D]\}}|||<q\t�|||jj
B||jj	d|t|��S)Nr)r��	sre_parse�parser��SRE_FLAG_DEBUGr�r�r��	groupdict�groups�itemsr!�compilerr)rirrWrV�
groupindex�
indexgrouprerrrrr��s(



�r�)NNN)r)/�__doc__r!r��
sre_constants�MAGICr�r-r+rr?�
MIN_REPEATr:rr>r.rr�r�rr4r/r��
_equivalencesr$rrr=r3r0r�r�r�r��intr|r~r9r�r�r�r�r�r�r�r�r�r�rrrr�<module>sJ
$��
3

	,;pickle.cpython-38.opt-1.pyc000064400000133311151450073350011407 0ustar00U

e5d��	@shdZddlmZddlmZddlmZmZmZddlm	Z	ddl
mZddlZddlm
Z
dd	lmZmZddlZddlZddlZddlZd
ddd
dddddg	ZzddlmZe�d�dZWnek
r�dZYnXeefZdZddddddddgZdZ d Z!Gd!d
�d
e"�Z#Gd"d�de#�Z$Gd#d�de#�Z%Gd$d%�d%e"�Z&zdd&l'm(Z(Wnek
�rldZ(YnXd'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^d]Z_eOeYeZe[gZ`d^Zad_Zbd`ZcdaZddbZedcZfddZgdeZhdfZidgZjdhZkdiZldjZmdkZndlZoe�pdmdn�eq�D��Gdodp�dp�ZrGdqdr�dr�Zsdsdt�Ztdudv�Zudwdx�Zvdydz�ZwGd{d|�d|�ZxGd}d~�d~�Zyd�ddd�d�d��Zzd�ddd�d�d��Z{dd�d�dd��d�d��Z|dd�d�dd��d�d��Z}z0dd�lm#Z#m$Z$m%Z%m~Z~mZm�Z�m�Z�m�Z�m�Z�Wn4ek
�r�exeyZ~Zeze{e|e}f\Z�Z�Z�Z�YnXd�d��Z�e�d�k�rdddl�Z�e�j�d�d��Z�e�j�d�e���d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e����Z�e�j��r*e��n:e�j��s<e����n(ddl�Z�e�j�D]Z�e�e��Z�e���e���qJdS)�a�Create portable serialized representations of Python objects.

See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

�)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loads)�PickleBufferrTFz4.0z1.0z1.1z1.2z1.3z2.0z3.0z5.0��c@seZdZdZdS)rz6A common base class for the other pickling exceptions.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pickle.pyrIsc@seZdZdZdS)r
z]This exception is raised when an unpicklable object is passed to the
    dump() method.

    Nrrrrrr
Msc@seZdZdZdS)raThis exception is raised when there is a problem unpickling an object,
    such as a security violation.

    Note that other exceptions may also be raised during unpickling, including
    (but not necessarily limited to) AttributeError, EOFError, ImportError,
    and IndexError.

    NrrrrrrTsc@seZdZdd�ZdS)�_StopcCs
||_dS�N)�value��selfr!rrr�__init__bsz_Stop.__init__N)rrrr$rrrrrasr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
�������������������������B�C��������������������������cCsg|]}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srnc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dSr )�
file_write�
current_frame)r#rprrrr$�sz_Framer.__init__cCst��|_dSr )�io�BytesIOrq�r#rrr�
start_framing�sz_Framer.start_framingcCs*|jr&|j��dkr&|jdd�d|_dS)NrT��force)rq�tell�commit_framertrrr�end_framing�sz_Framer.end_framingFcCsf|jrb|j}|��|jks|rb|��}|j}t|�|jkrP|ttdt|���||�t	�
�|_dS)N�<Q)rqrx�_FRAME_SIZE_TARGET�	getbufferrp�len�_FRAME_SIZE_MIN�FRAMEr
rrrs)r#rw�f�data�writerrrry�sz_Framer.commit_framecCs |jr|j�|�S|�|�SdSr )rqr�rp�r#r�rrrr��sz
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NTrv)rprqry)r#�headerZpayloadr�rrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrrr|r$rurzryr�r�rrrrro�s
roc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	_UnframerNcCs||_||_d|_dSr )�	file_read�
file_readlinerq)r#r�r�Z	file_tellrrrr$	sz_Unframer.__init__cCs�|jrb|j�|�}|dkrJt|�dkrJd|_t|�}|�|�|dd�<|S|t|�kr^td��|St|�}|�|�|dd�<|SdS�Nr�$pickle exhausted before end of frame)rq�readintor~r�r)r#�buf�nrrrr�s�z_Unframer.readintocCsT|jrF|j�|�}|s.|dkr.d|_|�|�St|�|krBtd��|S|�|�SdSr�)rq�readr�r~r�r#r�r�rrrr�s
�z_Unframer.readcCsF|jr:|j��}|s"d|_|��S|ddkr6td��|S|��SdS)N����
r�)rq�readliner�rr�rrrr�,s
�z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rqr�rrrrsr��r#Z
frame_sizerrr�
load_frame9s
�z_Unframer.load_frame)N)rrrr$r�r�r�r�rrrrr�s



r�c	Csj|�d�D]V}|dkr&td�||���z|}t||�}Wq
tk
r^td�||��d�Yq
Xq
||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributeBs"���
r�c	Cs�t|dd�}|dk	r|Stj����D]X\}}|dks&|dks&|dkrHq&z t||�d|krf|WSWq&tk
r|Yq&Xq&dS)z$Find the module an object belong to.rN�__main__Z__mp_main__r)r��sys�modules�copy�itemsr�r�)r�r��module_name�modulerrr�whichmoduleOs ��r�cCsh|dkrdS|��d?d}|j|ddd�}|dkrd|dkrd|dd	krd|d
d@dkrd|dd�}|S)
a�Encode a long to a two's complement little-endian binary string.
    Note that 0 is a special case, returning an empty string, to save a
    byte in the LONG1 pickling context.

    >>> encode_long(0)
    b''
    >>> encode_long(255)
    b'\xff\x00'
    >>> encode_long(32767)
    b'\xff\x7f'
    >>> encode_long(-256)
    b'\x00\xff'
    >>> encode_long(-32768)
    b'\x00\x80'
    >>> encode_long(-128)
    b'\x80'
    >>> encode_long(127)
    b'\x7f'
    >>>
    rr����littleT��	byteorderZsignedr������N)�
bit_length�to_bytes)rm�nbytes�resultrrr�encode_longbsr�cCstj|ddd�S)a\Decode a long from a two's complement little-endian binary string.

    >>> decode_long(b'')
    0
    >>> decode_long(b"\xff\x00")
    255
    >>> decode_long(b"\xff\x7f")
    32767
    >>> decode_long(b"\x00\xff")
    -256
    >>> decode_long(b"\x00\x80")
    -32768
    >>> decode_long(b"\x80")
    -128
    >>> decode_long(b"\x7f")
    127
    r�Tr�)�int�
from_bytes)r�rrr�decode_long�sr�c@s�eZdZd;ddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd<dd�Z	dd�Z
dd�Zd=dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<er�d$d%�Zee
e<d&d'�Zee
e<d(d)�Zee
e <d*d+�Z!e!e
e"<d,Z#d-d.�Z$d/d0�Z%e%e
e&<e'dk	�r@e%e
e'<d1d2�Z(d3d4�Z)e)e
e*<d5d6�Z+e+e
e,<d>d7d8�Z-d9d:�Z.e-e
e/<e.e
e<dS)?�_PicklerNT��fix_imports�buffer_callbackcCs�|dkrt}|dkrt}n"d|kr.tks<ntdt��|dk	rT|dkrTtd��||_z|j|_Wntk
r�td��YnXt|j�|_	|j	j|_|j	j
|_i|_t
|�|_|dk|_d|_|o�|dk|_dS)	a!This takes a binary file for writing a pickle data stream.

        The optional *protocol* argument tells the pickler to use the
        given protocol; supported protocols are 0, 1, 2, 3, 4 and 5.
        The default protocol is 4. It was introduced in Python 3.4, and
        is incompatible with previous versions.

        Specifying a negative protocol version selects the highest
        protocol version supported.  The higher the protocol used, the
        more recent the version of Python needed to read the pickle
        produced.

        The *file* argument must have a write() method that accepts a
        single bytes argument. It can thus be a file object opened for
        binary writing, an io.BytesIO instance, or any other custom
        object that meets this interface.

        If *fix_imports* is True and *protocol* is less than 3, pickle
        will try to map the new Python 3 names to the old module names
        used in Python 2, so that the pickle data stream is readable
        with Python 2.

        If *buffer_callback* is None (the default), buffer views are
        serialized into *file* as part of the pickle stream.

        If *buffer_callback* is not None, then it can be called any number
        of times with a buffer view.  If the callback returns a false value
        (such as None), the given buffer is out-of-band; otherwise the
        buffer is serialized in-band, i.e. inside the pickle stream.

        It is an error if *buffer_callback* is not None and *protocol*
        is None or smaller than 5.
        Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributer�r�)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueError�_buffer_callbackr��_file_writer��	TypeErrorro�framerr��_write_large_bytes�memor��proto�bin�fastr�)r#�file�protocolr�r�rrrr$�s*#



z_Pickler.__init__cCs|j��dS)aClears the pickler's "memo".

        The memo is the data structure that remembers which objects the
        pickler has already seen, so that shared or recursive objects
        are pickled by reference and not by value.  This method is
        useful when re-using picklers.
        N)r��clearrtrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|�ttd|j��|jdkrP|j�	�|�
|�|�t�|j��dS)z7Write a pickled representation of obj to the open file.r�z2Pickler.__init__() was not called by %s.__init__()��<BrN)
�hasattrr
�	__class__rr�r��PROTOr
r�ru�save�STOPrz�r#r�rrrr�s
�




z
_Pickler.dumpcCs:|jr
dSt|j�}|�|�|��||f|jt|�<dS)zStore an object in the memo.N)r�r~r�r��put�id)r#r��idxrrr�memoize�s

z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|��d�dSdS)Nr�r��<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)r#r�rrrr�s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|��d�dS)Nr�r�r�r�r�)r��BINGETr
�LONG_BINGET�GETr�r��r#�irrr�gets
z_Pickler.getc
Cs�|j��|�|�}|dk	r.|r.|�|�dS|j�t|��}|dk	r^|�|�|d��dSt}t	|dd�}|dk	r~||�}|tk�r@t
|�}|j�|�}|dk	r�|||�dSt	|dt��|�}|dk	r�||�}njt
|t
�r�|�|�dSt	|dd�}|dk	�r||j�}n0t	|dd�}|dk	�r.|�}ntd|j|f��t|t��r\|�||�dSt|t��sttd|��t|�}	d|	k�r�d	k�s�ntd
|��|j|d|i�dS)NrZreducer_overrider�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z2Tuple returned by %s must have two to six elementsr�)r�ry�
persistent_id�	save_persr�r�r�r��NotImplementedr��type�dispatchr�
issubclass�save_globalr�r
r�
isinstance�str�tupler~�save_reduce)
r#r��save_persistent_id�pidrm�rv�reduce�tr��lrrrr�sZ









��z
_Pickler.savecCsdSr rr�rrrr�]sz_Pickler.persistent_idcCsb|jr |j|dd�|�t�n>z |�tt|��d�d�Wntk
r\td��YnXdS)NF)r�r�r��2persistent IDs in protocol 0 must be ASCII strings)	r�r�r��	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
�r#r�rrrr�as �z_Pickler.save_persc
Cs>t|t�std��t|�s"td��|j}|j}	t|dd�}
|jdkr�|
dkr�|\}}}t|d�sntd�	|
���|dk	r�||j
k	r�td	�	|
���|jd
kr�||�||�||�|	t�n,t|j
|f|�|�}||�|d�|	t�n�|jdk�r^|
dk�r^|d
}t|d��std��|dk	�r8||j
k	�r8td��|dd�}||�||�|	t�n||�||�|	t�|dk	�r�t|�|jk�r�|	t|�|jt|�d
��n
|�|�|dk	�r�|�|�|dk	�r�|�|�|dk	�r:|dk�r
||�|	t�n0||�||�||�|	t�|	t�|	t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r��
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classrr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�r�r�r�r�r�r��	NEWOBJ_EXrr�REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD�TUPLE2)
r#�func�args�stateZ	listitemsZ	dictitemsZstate_setterr�r�r�Z	func_name�cls�kwargsrrrr�msz


��


��

"







z_Pickler.save_reducecCs|�t�dSr )r��NONEr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|�|rtnt�n|�|r*tnt�dS)Nr�)r�r��NEWTRUE�NEWFALSE�TRUE�FALSEr�rrr�	save_bool�s
z_Pickler.save_boolcCs.|jr~|dkrN|dkr.|�ttd|��dS|dkrN|�ttd|��dSd|krbdkr~nn|�ttd|��dS|jd	kr�t|�}t|�}|d
kr�|�t	td|�|�n|�t
td|�|�dSd|kr�dk�rnn|�tt|��
d�d�n|�tt|��
d�d
�dS)Nrr�r���<Hi�i����<ir�r�r�r�sL
)r�r��BININT1r
�BININT2�BININTr�r�r~�LONG1�LONG4�INTr�r��LONG�r#r�Zencodedr�rrr�	save_long�s*
z_Pickler.save_longcCs<|jr|�ttd|��n|�tt|��d�d�dS)N�>dr�r�)r�r��BINFLOATr
�FLOATr�r�r�rrr�
save_floatsz_Pickler.save_floatcCs�|jdkr@|s |jtd|d�n|jtjt|d�df|d�dSt|�}|dkrj|�tt	d|�|�nf|dkr�|jdkr�|�
tt	d	|�|�n<||jj
kr�|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nr�r�r��latin1r�r����rr{r�)r�r��bytes�codecsr�r�r~r��SHORT_BINBYTESr
r��	BINBYTES8r�r|�BINBYTESr��r#r�r�rrr�
save_bytess"
�z_Pickler.save_bytescCs�|jdkr:|s |jtd|d�n|jtt|�f|d�dSt|�}||jjkrf|�tt	d|�|�n|�
tt	d|�|�dS)Nrrr*r{)r�r��	bytearrayr-r~r�r|r��
BYTEARRAY8r
r�r2rrr�save_bytearray)s
z_Pickler.save_bytearrayc	Cs�|jdkrtd��|���t}|js*td��d}|jdk	rFt|�|��}|rp|jr`|�|���q�|�	|���n|�
t�|jr�|�
t�W5QRXdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT)
r�r
�raw�
contiguousr��bool�readonlyr3�tobytesr6r��NEXT_BUFFER�READONLY_BUFFER)r#r��mZin_bandrrr�save_picklebuffer8s



z_Pickler.save_picklebuffercCs|jr�|�dd�}t|�}|dkrF|jdkrF|�ttd|�|�nf|dkrp|jdkrp|�ttd|�|�n<||j	j
kr�|�ttd|�|�n|�ttd|�|�nT|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)N�utf-8�
surrogatepassr�rr�r,r{r��\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001a�raw-unicode-escaper�)r�r�r~r�r��SHORT_BINUNICODEr
r��BINUNICODE8r�r|�
BINUNICODE�replace�UNICODEr�r$rrr�save_strRs&�z_Pickler.save_strcCs:|s(|jr|�t�n|�tt�dSt|�}|j}|j}|dkr�|jdkr�|D]}||�qRt	|�|kr�|�
|t	|�d�}|�t||�n|�t|�|�
|�dS|j}|t�|D]}||�q�t	|�|k�r$|�
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|�
|�dS)Nr�r�rr�)r�r��EMPTY_TUPLE�MARK�TUPLEr~r�r�r�r�r�r	�_tuplesize2coder��POP_MARK)r#r�r�r�r�Zelementr�r�rrr�
save_tupleis:


z_Pickler.save_tuplecCs8|jr|�t�n|�tt�|�|�|�|�dSr )r�r��
EMPTY_LISTrO�LISTr�r
r�rrr�	save_list�s

z_Pickler.save_listi�cCs�|j}|j}|js0|D]}||�|t�qdSt|�}tt||j��}t|�}|dkr||t	�|D]}||�qd|t
�n|r�||d�|t�||jkr8dSq8dS�Nr�r)r�r�r��APPEND�iter�listr�
_BATCHSIZEr~rO�APPENDS)r#r�r�r�rm�it�tmpr�rrrr
�s(



z_Pickler._batch_appendscCs<|jr|�t�n|�tt�|�|�|�|���dSr )r�r��
EMPTY_DICTrO�DICTr�rr�r�rrr�	save_dict�s

z_Pickler.save_dictc	Cs�|j}|j}|js<|D] \}}||�||�|t�qdSt|�}tt||j��}t|�}|dkr�|t	�|D]\}}||�||�qp|t
�n(|r�|d\}}||�||�|t�||jkrDdSqDdSrW)r�r�r��SETITEMrYrZrr[r~rO�SETITEMS)	r#r�r�r��k�vr]r^r�rrrr�s0



z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|�|�t|�}tt	||j
��}t|�}|dkr�|t�|D]}||�qv|t
�||j
krJdSqJdS�Nrr*r)r�r�r�r��setrZ�	EMPTY_SETr�rYrr[r~rO�ADDITEMS)r#r�r�r�r]Zbatchr��itemrrr�save_set�s"



z_Pickler.save_setcCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|D]}||�q<t|�|jkr||t	|�
|jt|�d��dS|t�|�|�dSrf)
r�r�r�r��	frozensetrZrOr�r�rRr��	FROZENSETr�)r#r�r�r�rjrrr�save_frozensets

 z_Pickler.save_frozensetc

CsX|j}|j}|dkr t|dd�}|dkr.|j}t||�}z(t|dd�tj|}t||�\}}Wn.t	t
tfk
r�td|||f�d�YnX||k	r�td|||f��|j
dk�rt�||f�}	|	�r|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|�d�d}
||k�r6|
}|j
d
k�r`|�|�|�|�|t�n�||k	�r||�t||
f�n�|j
dk�r�|tt|d�dt|d�d�n�|j�r�tj}tj}||f|k�r�|||f\}}n||k�r�||}z(|tt|d�dt|d�d�Wn,tk
�rHtd|||j
f�d�YnX|�|�dS)Nrr��levelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�r�rrrr�rr�r@r�r�z?can't pickle global identifier '%s.%s' using pickle protocol %i) r�r�r�rr��
__import__r�r�r��ImportError�KeyErrorr�r
r�rr��EXT1r
�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr-r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGr�r�)
r#r�r�r�r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr�s�

�����





��
��

���z_Pickler.save_globalcCs`|td�kr|jtd|d�S|tt�kr:|jttf|d�S|td�krV|jtd|d�S|�|�S)Nr r*.).)r�r�r�r�r�rrr�	save_typeasz_Pickler.save_type)N)T)NNNNN)N)0rrrr$r�rr�r�r�r�r�r�r�r�rr�rr9r%r�r)�floatr3r-r6r4�_HAVE_PICKLE_BUFFERr?rrMr�rSr�rVrZr[r
ra�dictr%rrkrgrnrlr�r|rrrrrr��sj�9
	
F�
u1		

B	r�c@s�eZdZddddd�dd�Zdd	�Zd
d�Zdd
�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd �Zeeed<d!d"�Zeeed<d#d$�Zeeed<d%d&�Zeeed<d'd(�Z e ee!d<d)d*�Z"e"ee#d<d+d,�Z$e$ee%d<d-d.�Z&e&ee'd<d/d0�Z(d1d2�Z)e)ee*d<d3d4�Z+e+ee,d<d5d6�Z-e-ee.d<d7d8�Z/e/ee0d<d9d:�Z1e1ee2d<d;d<�Z3e3ee4d<d=d>�Z5e5ee6d<d?d@�Z7e7ee8d<dAdB�Z9e9ee:d<dCdD�Z;e;ee<d<dEdF�Z=e=ee>d<dGdH�Z?e?ee@d<dIdJ�ZAeAeeBd<dKdL�ZCeCeeDd<dMdN�ZEeEeeFd<dOdP�ZGeGeeHd<dQdR�ZIeIeeJd<dSdT�ZKeKeeLd<dUdV�ZMeMeeNd<dWdX�ZOeOeePd<dYdZ�ZQeQeeRd<d[d\�ZSeSeeTd<d]d^�ZUeUeeVd<d_d`�ZWeWeeXd<dadb�ZYdcdd�ZZeZee[d<dedf�Z\e\ee]d<dgdh�Z^e^ee_d<didj�Z`e`eead<dkdl�Zbebeecd<dmdn�Zdedeeed<dodp�Zfefeegd<dqdr�Zheheeid<dsdt�Zjejeekd<dudv�Zldwdx�Zmdydz�Zneneeod<d{d|�Zpepeeqd<d}d~�Zrereesd<dd��Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<dS)��
_UnpicklerT�ASCII�strictN�r��encoding�errors�bufferscCsH|dk	rt|�nd|_|j|_|j|_i|_||_||_d|_	||_
dS)a�This takes a binary file for reading a pickle data stream.

        The protocol version of the pickle is detected automatically, so
        no proto argument is needed.

        The argument *file* must have two methods, a read() method that
        takes an integer argument, and a readline() method that requires
        no arguments.  Both methods should return bytes.  Thus *file*
        can be a binary file object opened for reading, an io.BytesIO
        object, or any other custom object that meets this interface.

        The file-like object must have two methods, a read() method
        that takes an integer argument, and a readline() method that
        requires no arguments.  Both methods should return bytes.
        Thus file-like object can be a binary file object opened for
        reading, a BytesIO object, or any other custom object that
        meets this interface.

        If *buffers* is not None, it should be an iterable of buffer-enabled
        objects that is consumed each time the pickle stream references
        an out-of-band buffer view.  Such buffers have been given in order
        to the *buffer_callback* of a Pickler object.

        If *buffers* is None (the default), then the buffers are taken
        from the pickle stream, assuming they are serialized there.
        It is an error for *buffers* to be None if the pickle stream
        was produced with a non-None *buffer_callback*.

        Other optional arguments are *fix_imports*, *encoding* and
        *errors*, which are used to control compatibility support for
        pickle stream generated by Python 2.  If *fix_imports* is True,
        pickle will try to map the old Python 2 names to the new names
        used in Python 3.  The *encoding* and *errors* tell pickle how
        to decode 8-bit string instances pickled by Python 2; these
        default to 'ASCII' and 'strict', respectively. *encoding* can be
        'bytes' to read theses 8-bit string instances as bytes objects.
        Nr)rY�_buffersr��_file_readliner��
_file_readr�r�r�r�r�)r#r�r�r�r�r�rrrr$rs'z_Unpickler.__init__c
Cs�t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	|jj
|_
g|_g|_|jj
|_
d|_|j}|j}z&|d�}|s�t�||d|�qtWn,tk
r�}z|jWY�Sd}~XYnXdS)z�Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        r�z4Unpickler.__init__() was not called by %s.__init__()rr�N)r�rr�rr�r�r��	_unframerr�r�r��	metastack�stack�appendr�r��EOFErrorrr!)r#r�r��keyZstopinstrrrr�s*
�



z_Unpickler.loadcCs |j}|j��|_|jj|_|Sr )r�r��popr��r#r�rrr�pop_mark�s
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)rrrrr�persistent_load�sz_Unpickler.persistent_loadcCs:|�d�d}d|kr"tks0ntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)r#r�rrr�
load_proto�sz_Unpickler.load_protorcCs8td|�d��\}|tjkr(td|��|j�|�dS)Nr{�zframe size > sys.maxsize: %d)rr�r�r	r�r�r�r�rrrr��s
z_Unpickler.load_framecCsLz|��dd��d�}Wntk
r6td��YnX|�|�|��dS)Nr�r�r�)r��decode�UnicodeDecodeErrorrr�r�rrrr�load_persid�s�
z_Unpickler.load_persidcCs|j��}|�|�|��dSr )r�r�r�r�rrrr�load_binpersid�s
z_Unpickler.load_binpersidcCs|�d�dSr �r�rtrrr�	load_none�sz_Unpickler.load_nonecCs|�d�dS)NFr�rtrrr�
load_false�sz_Unpickler.load_falsecCs|�d�dS)NTr�rtrrr�	load_true�sz_Unpickler.load_truecCsL|��}|tdd�krd}n |tdd�kr4d}n
t|d�}|�|�dS)Nr�FTr)r�rrr�r�)r#r��valrrr�load_int�s
z_Unpickler.load_intcCs|�td|�d��d�dS)Nrrr�r�rr�rtrrr�load_binint�sz_Unpickler.load_binintcCs|�|�d�d�dSrW)r�r�rtrrr�load_binint1sz_Unpickler.load_binint1cCs|�td|�d��d�dS)Nrr�rr�rtrrr�load_binint2sz_Unpickler.load_binint2cCs@|��dd�}|r,|ddkr,|dd�}|�t|d��dS)Nr��Lr)r�r�r�)r#r�rrr�	load_longsz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dSrW)r�r�r�r�rrr�
load_long1s
z_Unpickler.load_long1cCs>td|�d��\}|dkr"td��|�|�}|�t|��dS)Nrrrz#LONG pickle has negative byte count)rr�rr�r�r�rrr�
load_long4s

z_Unpickler.load_long4cCs|�t|��dd���dS�Nr�)r�r}r�rtrrr�
load_float!sz_Unpickler.load_floatcCs|�td|�d��d�dS)Nr&r�rr�rtrrr�
load_binfloat%sz_Unpickler.load_binfloatcCs"|jdkr|S|�|j|j�SdS)Nr-)r�r�r�r"rrr�_decode_string)s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�r~rr�r�r.�
escape_decoder�rrr�load_string2s
(z_Unpickler.load_stringcCs@td|�d��\}|dkr"td��|�|�}|�|�|��dS)Nrrrz(BINSTRING pickle has negative byte count)rr�rr�r��r#r~r�rrr�load_binstring<s

z_Unpickler.load_binstringcCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr�rz2BINBYTES exceeds system's maximum size of %d bytes�rr�r	rr��r#r~rrr�
load_binbytesEs�z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�rG)r�r�r�rtrrr�load_unicodeMsz_Unpickler.load_unicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr�rz4BINUNICODE exceeds system's maximum size of %d bytesr@rA�rr�r	rr�r�r�rrr�load_binunicodeQs�z_Unpickler.load_binunicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr{r�z5BINUNICODE8 exceeds system's maximum size of %d bytesr@rAr�r�rrr�load_binunicode8Ys�z_Unpickler.load_binunicode8cCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr{r�z3BINBYTES8 exceeds system's maximum size of %d bytesr�r�rrr�load_binbytes8as�z_Unpickler.load_binbytes8cCsFtd|�d��\}|tkr&tdt��t|�}|�|�|�|�dS)Nr{r�z4BYTEARRAY8 exceeds system's maximum size of %d bytes)rr�r	rr4r�r�)r#r~�brrr�load_bytearray8is�
z_Unpickler.load_bytearray8cCsL|jdkrtd��zt|j�}Wntk
r<td��YnX|�|�dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)r�r�next�
StopIterationr�)r#r�rrr�load_next_bufferss
z_Unpickler.load_next_bufferc	Cs6|jd}t|��}|js(|��|jd<W5QRXdSr�)r��
memoryviewr:�
toreadonly)r#r�r>rrr�load_readonly_buffer~s

z_Unpickler.load_readonly_buffercCs,|�d�d}|�|�}|�|�|��dSrW)r�r�r�r�rrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dSrW)r�r�r�rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rr@rA)r�r�r�r�rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|��}|�t|��dSr )r�r�r�r�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|�d�dS)Nrr�rtrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dSr��r�rtrrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�rtrrr�load_tuple2�sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�r�rtrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|�g�dSr r�rtrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|�i�dSr r�rtrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|�t��dSr )r�rgrtrrr�load_empty_set�sz_Unpickler.load_empty_setcCs|��}|�t|��dSr )r�r�rlr�rrr�load_frozenset�sz_Unpickler.load_frozensetcCs|��}|�|�dSr )r�r�r�rrr�	load_list�sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|�|d�qS)r�r)rlr��r�rr�
<dictcomp>�s�z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r��ranger~r�)r#�drr�r�	load_dict�s

�z_Unpickler.load_dictc
Cs�|st|t�rt|d�rjz||�}Wqttk
rf}z$td|jt|�ft��d��W5d}~XYqtXn
|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_inforr�)r#�klassrr!�errrrr�_instantiate�s��
�
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r��
find_classr�r��r#r�r�r�rrr�	load_inst�sz_Unpickler.load_instcCs"|��}|�d�}|�||�dS�Nr)r�r�r�)r#rrrrr�load_obj�s
z_Unpickler.load_objcCs2|j��}|j��}|j|f|��}|�|�dSr �r�r�rr�)r#rrr�rrr�load_newobj�s

z_Unpickler.load_newobjcCs>|j��}|j��}|j��}|j|f|�|�}|�|�dSr r�)r#rrrr�rrr�load_newobj_ex�s



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�r@)r�r�r�r�r�rrr�load_global�sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tk	s,t|�tk	r4td��|�|�||��dS)NzSTACK_GLOBAL requires str)r�r�r�r�rr�r�)r#r�r�rrr�load_stack_global�s


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dSrW)r��
get_extension�r#r{rrr�	load_ext1sz_Unpickler.load_ext1cCs td|�d��\}|�|�dS)Nrr��rr�r�r�rrr�	load_ext2	sz_Unpickler.load_ext2cCs td|�d��\}|�|�dS)Nrrr�r�rrr�	load_ext4sz_Unpickler.load_ext4cCspg}t�||�}||k	r&|�|�dSt�|�}|sP|dkrDtd��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r�rrr�r�)r#r{Znilr�r�rrrr�s


z_Unpickler.get_extensioncCs�t�d||�|jdkrT|jrT||ftjkr@tj||f\}}n|tjkrTtj|}t|dd�|jdkr~ttj	||�dSt
tj	||�SdS)Nzpickle.find_classr�rror)r��auditr�r�rzZNAME_MAPPINGZIMPORT_MAPPINGrqr�r�r�)r#r�r�rrrr�#s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dSr��r�r�)r#r�rrrrr�load_reduce1sz_Unpickler.load_reducecCs|jr|jd=n|��dSr�)r�r�rtrrr�load_pop8s
z_Unpickler.load_popcCs|��dSr )r�rtrrr�
load_pop_mark?sz_Unpickler.load_pop_markcCs|�|jd�dSr�)r�r�rtrrr�load_dupCsz_Unpickler.load_dupcCs(t|��dd��}|�|j|�dSr�)r�r�r�r�r�rrr�load_getGsz_Unpickler.load_getcCs"|�d�d}|�|j|�dSrW)r�r�r�r�rrr�load_bingetLsz_Unpickler.load_bingetcCs&td|�d��\}|�|j|�dS)Nr�r)rr�r�r�r�rrr�load_long_bingetQsz_Unpickler.load_long_bingetcCs8t|��dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�r�r�r�rrr�load_putVsz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�r�r�r�rrr�load_binput]sz_Unpickler.load_binputcCs6td|�d��\}|tkr"td��|jd|j|<dS)Nr�rznegative LONG_BINPUT argumentr�)rr�r	r�r�r�r�rrr�load_long_binputdsz_Unpickler.load_long_binputcCs|j}|jd|t|�<dSr�)r�r�r~)r#r�rrr�load_memoizeksz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dSr�)r�r�r�)r#r�r!rZrrr�load_appendpsz_Unpickler.load_appendcCsZ|��}|jd}z
|j}Wntk
r0YnX||�dS|j}|D]}||�qHdSr�)r�r��extendr�r�)r#r�Zlist_objr�r�rjrrr�load_appendsws

z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dSr�r�)r#r�r!r�rrrr�load_setitem�s
z_Unpickler.load_setitemcCs@|��}|jd}tdt|�d�D]}||d|||<q"dS)Nr�rr�r�)r�r�r�r~)r#r�rr�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsD|��}|jd}t|t�r(|�|�n|j}|D]}||�q2dSr�)r�r�r�rg�update�add)r#r�Zset_objr�rjrrr�
load_additems�s

z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}|�	�D]*\}}	t
|�tkr�|	|||�<qp|	||<qp|r�|�	�D]\}}	t|||	�q�dS)Nr��__setstate__r�)
r�r�r�r�r�r~�__dict__r��internr�r�r��setattr)
r#r�r�inst�setstateZ	slotstateZ	inst_dictr�rdrerrr�
load_build�s(
z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dSr )r�r�r�rtrrr�	load_mark�sz_Unpickler.load_markcCs|j��}t|��dSr )r�r�rr"rrr�	load_stop�s
z_Unpickler.load_stop)�rrrr$rr�r�r�r�r�r�r�r�r�r�r�r�rr�rr�rr�r"r�rr�rr�rr�r#r�r r�r!r�r(r�r'r�r��STRINGr��	BINSTRINGr�r1r�rLr�rJr�rIr�r0r�r5r�r<r�r=r��SHORT_BINSTRINGr�r/r�rHr�rPr�rNr��TUPLE1r�r
r��TUPLE3r�rTr�r_r�rhr�rmr�rUr�r`r�r��INSTr��OBJr�rr�rr�ryr�rxr�rtr�rur�rvr�r�r�rr�r	r�rRr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rXr�r\r�rbr�rcr�rirrrrOrr�rrrrr�ps*�0				r�r�cCst||||d��|�dS�Nr�)r�r)r�r�r�r�r�rrr�_dump�s
��rcCs*t��}t||||d��|�|��}|Sr)rrrsr�r�getvalue)r�r�r�r�r��resrrr�_dumps�s��rr�r�r�cCst|||||d���S)N�r�r�r�r�)r�r)r�r�r�r�r�rrr�_load�s�rcCs2t|t�rtd��t�|�}t|||||d���S)Nz%Can't load pickle from unicode stringr)r�r�r�rrrsr�r)�sr�r�r�r�r�rrr�_loads�s

�r)	rr
rrrrrrrcCsddl}|��Sr�)�doctestZtestmod)rrrr�_test�srr�z$display contents of the pickle files)Zdescription�pickle_file�br�*zthe pickle file)r��nargs�helpz-tz--test�
store_truezrun self-test suite)�actionrz-vz)run verbosely; only affects self-test run)N)N)�r�typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrjrrr.rz�__all__�_picklerr�r~rrr-r4Zbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer%rOr�r	rRr
r(r"rrr#rrr�r�rrrrrLrJrXrryr`r_r\r�r�rr�rUrTrr�r�r�rbrPrNrcr'rrr�rrtrurvr	r
r
rrr r!rQr1r/rHrIr0rhrirmrrxr�r�r5r<r=r��dirror�r�r�r�r�r�r�rrrrrrrrrrrr�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsrZtestrZ
print_helpZpprintr�r�rrrr�<module>sh�

�

?;
^]��	0

����

bisect.cpython-38.opt-2.pyc000064400000002024151450073350011406 0ustar00U

e5d��@sVddd�Zddd�Zd
dd�Zddd	�Zzdd
lTWnek
rHYnXeZeZdS)�NcCst||||�}|�||�dS�N)�bisect_right�insert��a�x�lo�hi�r
�/usr/lib64/python3.8/bisect.py�insort_rights	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krF|}q |d}q |S�Nrzlo must be non-negative����
ValueError�len�rrrr	Zmidr
r
rrs
rcCst||||�}|�||�dSr)�bisect_leftrrr
r
r�insort_left$s	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krJ|d}q |}q |Sr
rrr
r
rr1s
r)�*)rN)rN)rN)rN)rrrrZ_bisect�ImportErrorZbisectZinsortr
r
r
r�<module>s



tabnanny.cpython-38.opt-1.pyc000064400000015570151450073350011760 0ustar00U

e5d�,�@s�dZdZddlZddlZddlZeed�s2ed��dddgZdada	d	d
�Z
dd�ZGd
d�de�Z
dd�ZGdd�d�Zdd�Zdd�Zedkr�e�dS)a�The Tab Nanny despises ambiguous indentation.  She knows no mercy.

tabnanny -- Detection of ambiguous indentation

For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.

Warning: The API provided by this module is likely to change in future
releases; such changes may not be backward compatible.
�6�N�NLz4tokenize.NL doesn't exist -- tokenize module too old�check�NannyNag�process_tokenscGs6d}|D]}tj�|t|��d}qtj�d�dS)N�� �
)�sys�stderr�write�str)�args�sep�arg�r� /usr/lib64/python3.8/tabnanny.py�errprint"s
rc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnX|D](\}}|dkrvtda|dkr^tdaq^|s�tdtjdd�dS|D]}t|�q�dS)Nr�Zqvz-qz-vzUsage:z[-v] file_or_directory ...)�getoptr
�argv�errorr�
filename_only�verboser)rZoptsr�msg�o�arrrr�main)s 
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzk
    Raised by process_tokens() if detecting an ambiguous indent.
    Captured and handled in check().
    cCs||||_|_|_dS�N)�linenor�line)�selfrrr rrr�__init__BszNannyNag.__init__cCs|jSr)r�r!rrr�
get_linenoDszNannyNag.get_linenocCs|jSr)rr#rrr�get_msgFszNannyNag.get_msgcCs|jSr)r r#rrr�get_lineHszNannyNag.get_lineN)�__name__�
__module__�__qualname__�__doc__r"r$r%r&rrrrr=s
c	
CsHtj�|�r�tj�|�s�tr*td|f�t�|�}|D]J}tj�||�}tj�|�rbtj�|�rztj�|dd��dkr8t	|�q8dSzt
�|�}Wn8tk
r�}zt
d||f�WY�dSd}~XYnXtdkr�td|��z>ztt
�|j��W�n"t
jk
�r@}z t
d||f�WY�
W���dSd}~XYn�tk
�r|}zt
d	||f�WY�W��dSd}~XYn�tk
�r }z�|��}|��}t�r�td
||f�td|f�t|���n6d|k�r�d
|d
}t�r�t|�nt||t|��WY�W�dSd}~XYnXW5|��Xt�rDtd|f�dS)a~check(file_or_dir)

    If file_or_dir is a directory and not a symbolic link, then recursively
    descend the directory tree named by file_or_dir, checking all .py files
    along the way. If file_or_dir is an ordinary Python source file, it is
    checked for whitespace related problems. The diagnostic messages are
    written to standard output using the print statement.
    z%r: listing directory���Nz.pyz%r: I/O Error: %srzchecking %r ...z%r: Token Error: %sz%r: Indentation Error: %sz)%r: *** Line %d: trouble in tab city! ***zoffending line: %rr�"z%r: Clean bill of health.)�os�path�isdir�islinkr�print�listdir�join�normcaser�tokenize�open�OSErrorr�closer�generate_tokens�readline�
TokenError�IndentationErrorrr$r&r%r�repr)	�file�names�name�fullname�frZnag�badliner rrrrKsX


��


 
c@sLeZdZd\ZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
Whitespacez 	c	Cs�||_tjtj}}g}d}}}|jD]v}||krH|d}|d}q*||kr�|d}|d}|t|�kr�|dg|t|�d}||d||<d}q*q�q*||_||_t|�|f|_t|�dk|_	dS)Nrr)
�rawrD�S�T�len�n�nt�tuple�norm�	is_simple)	r!ZwsrFrG�count�brIrJZchrrrr"�s(

zWhitespace.__init__cCs|j\}}tt|�d|�S�Nr)rL�maxrH)r!rN�trailingrrr�longest_run_of_spaces�s
z Whitespace.longest_run_of_spacescCsH|j\}}d}t|t|��D]}|||||}q||||jS)Nr)rL�rangerHrJ)r!�tabsizerNrRZil�irrr�indent_level�s

zWhitespace.indent_levelcCs|j|jkSr)rL)r!�otherrrr�equal�szWhitespace.equalcCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrP�rQrSrTrW�append�r!rXrIr�tsrrr�not_equal_witness�s���zWhitespace.not_equal_witnesscCsp|j|jkrdS|jr(|jr(|j|jkSt|��|���d}td|d�D]}|�|�|�|�krLdSqLdS)NFr�T)rIrMrJrQrSrTrW)r!rXrIr]rrr�less�s��zWhitespace.lesscCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrPrZr\rrr�not_less_witnesss���zWhitespace.not_less_witnessN)r'r(r)rFrGr"rSrWrYr^r`rarrrrrD�srDcCs8dd�|D�}d}t|�dkr&|d}|dd�|�S)Ncss|]}t|d�VqdS)rN)r
)�.0�tuprrr�	<genexpr>sz#format_witnesses.<locals>.<genexpr>zat tab sizer�srz, )rHr3)�wZfirsts�prefixrrr�format_witnessess
rhcCstj}tj}tj}tjtjf}td�g}d}|D]�\}}}	}
}||krLd}q0||kr�d}t|�}|d�|�s�|d�|�}
dt	|
�}t
|	d||��|�|�q0||kr�d}|d=q0|r0||kr0d}t|�}|d�|�s0|d�
|�}
dt	|
�}t
|	d||��q0dS)Nrrr���zindent not greater e.g. zindent not equal e.g. )r5�INDENT�DEDENT�NEWLINE�COMMENTrrDr`rarhrr[rYr^)�tokensrjrkrlZJUNK�indentsZcheck_equal�type�token�start�endr ZthisguyZwitnessrrrrrs6

�__main__)r*�__version__r-r
r5�hasattr�
ValueError�__all__rrrr�	ExceptionrrrDrhrr'rrrr�<module>s&

=7getopt.cpython-38.opt-1.pyc000064400000014137151450073350011446 0ustar00U

e5dA�@s�dZddddgZddlZzddlmZWnek
rDdd	�ZYnXGd
d�de�ZeZgfdd�Z	gfdd�Z
d
d�Zdd�Zdd�Z
dd�Zedkr�ddlZee	ejdd�dddg��dS)a�Parser for command line options.

This module helps scripts to parse the command line arguments in
sys.argv.  It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--').  Long options similar to those supported by GNU software
may be used as well via an optional third argument.  This module
provides two functions and an exception:

getopt() -- Parse command line options
gnu_getopt() -- Like getopt(), but allow option and non-option arguments
to be intermixed.
GetoptError -- exception (class) raised with 'opt' attribute, which is the
option involved with the exception.
�GetoptError�error�getopt�
gnu_getopt�N)�gettextcCs|S�N�)�srr�/usr/lib64/python3.8/getopt.py�_)�rc@s&eZdZdZdZddd�Zdd�ZdS)r�cCs||_||_t�|||�dSr)�msg�opt�	Exception�__init__)�selfrrrrr
r.szGetoptError.__init__cCs|jSr)r)rrrr
�__str__3szGetoptError.__str__N)r
)�__name__�
__module__�__qualname__rrrrrrrr
r+s
cCs�g}t|�td�kr|g}nt|�}|r�|d�d�r�|ddkr�|ddkr\|dd�}q�|d�d�r�t||ddd�||dd��\}}q$t||ddd�||dd��\}}q$||fS)a@getopt(args, options[, long_options]) -> opts, args

    Parses command line options and parameter list.  args is the
    argument list to be parsed, without the leading reference to the
    running program.  Typically, this means "sys.argv[1:]".  shortopts
    is the string of option letters that the script wants to
    recognize, with options that require an argument followed by a
    colon (i.e., the same format that Unix getopt() uses).  If
    specified, longopts is a list of strings with the names of the
    long options which should be supported.  The leading '--'
    characters should not be included in the option name.  Options
    which require an argument should be followed by an equal sign
    ('=').

    The return value consists of two elements: the first is a list of
    (option, value) pairs; the second is the list of program arguments
    left after the option list was stripped (this is a trailing slice
    of the first argument).  Each option-and-value pair returned has
    the option as its first element, prefixed with a hyphen (e.g.,
    '-x'), and the option argument as its second element, or an empty
    string if the option has no argument.  The options occur in the
    list in the same order in which they were found, thus allowing
    multiple occurrences.  Long and short options may be mixed.

    r
r�-�--�N�)�type�list�
startswith�do_longs�	do_shorts)�args�	shortopts�longopts�optsrrr
r8s((cCs6g}g}t|t�r|g}nt|�}|�d�r>|dd�}d}ntj�d�rPd}nd}|�r.|ddkrz||dd�7}�q.|ddd	�dkr�t||dd	d�||dd��\}}qT|ddd�d
kr�|dd
kr�t||ddd�||dd��\}}qT|�r||7}�q.qT|�	|d�|dd�}qT||fS)agetopt(args, options[, long_options]) -> opts, args

    This function works like getopt(), except that GNU style scanning
    mode is used by default. This means that option and non-option
    arguments may be intermixed. The getopt() function stops
    processing options as soon as a non-option argument is
    encountered.

    If the first character of the option string is `+', or if the
    environment variable POSIXLY_CORRECT is set, then option
    processing stops as soon as a non-option argument is encountered.

    �+rNTZPOSIXLY_CORRECTFrrrr)
�
isinstance�strrr�os�environ�getrr�append)r r!r"r#Z	prog_argsZall_options_firstrrr
rcs2

( (cCs�z|�d�}Wntk
r&d}Yn X|d|�||dd�}}t||�\}}|r�|dkr�|svttd�||��|d|dd�}}n|dk	r�ttd�||��|�d||p�df�||fS)N�=rzoption --%s requires argumentrz%option --%s must not have an argumentrr
)�index�
ValueError�
long_has_argsrrr*)r#rr"r �i�optarg�has_argrrr
r�s
rcs��fdd�|D�}|s(ttd������|kr8d�fS�d|krLd�fSt|�dkrjttd�����|d	}|�d�}|r�|dd
�}||fS)Ncsg|]}|���r|�qSr)r)�.0�o�rrr
�
<listcomp>�s
z!long_has_args.<locals>.<listcomp>zoption --%s not recognizedFr+Trzoption --%s not a unique prefixr���)rr�len�endswith)rr"Z
possibilitiesZunique_matchr1rr4r
r.�s
r.cCs�|dkr�|d|dd�}}t||�rh|dkr\|sFttd�||��|d|dd�}}|d}}nd}|�d||f�q||fS)Nr
rrzoption -%s requires argumentr)�
short_has_argrrr*)r#Z	optstringr!r rr0rrr
r�s
�rcCsXtt|��D]4}|||kr(dkrnq|�d|d�Sqttd�||��dS)N�:rzoption -%s not recognized)�ranger7rrr)rr!r/rrr
r9�sr9�__main__rza:bzalpha=Zbeta)�__doc__�__all__r'rr�ImportErrorrrrrrrr.rr9r�sys�print�argvrrrr
�<module>s"!+2functools.cpython-38.opt-1.pyc000064400000066377151450073350012175 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZddlmZddlmZddlmZddlm	Z	dZ
dZe
efdd�Ze
efdd�Z
efdd�Zefdd�Zefdd�Zefdd�Zefdd �Zefd!d"�Zefd#d$�Zefd%d&�Zefd'd(�Zefd)d*�Zefd+d,�Zefd-d.�Zd/efd0efd1efgd1efd2efd/efgd2efd1efd0efgd0efd/efd2efgd3�Zd4d�Zd5d�Zzdd6lmZWnek
�r�YnXe �Z!e!fd7d�Z"zdd8lm"Z"Wnek
�r�YnXGd9d	�d	�Z#zdd:lm#Z#Wnek
�rYnXGd;d
�d
e �Z$d<d=�Z%ed>d?d@dAdBg�Z&GdCdD�dDe'�Z(e �fe)e*he+e,e-fdEdF�Z.dYdId�Z/dJdK�Z0zddLlm0Z0Wnek
�r�YnXdMdN�Z1dZdPdQ�Z2dRdS�Z3dTdU�Z4dVd�Z5GdWd�d�Z6e �Z7GdXd
�d
�Z8dOS)[zEfunctools.py - Tools for working with functions and callable objects
�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�singledispatchmethod�cached_property�)�get_cache_token)�
namedtuple)�recursive_repr)�RLock)�
__module__�__name__�__qualname__�__doc__�__annotations__)�__dict__c	Csf|D]4}zt||�}Wntk
r*YqXt|||�q|D]}t||��t||i��q>||_|S)aUpdate a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    )�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r$�!/usr/lib64/python3.8/functools.pyr"scCstt|||d�S)a�Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    �rr r!)r	rr&r$r$r%r@s�cCs$|�|�}||kr|S|o"||kS)zIReturn a > b.  Computed by @total_ordering from (not a < b) and (a != b).��__lt__��self�other�NotImplemented�	op_resultr$r$r%�_gt_from_ltXs
r.cCs|�|�}|p||kS)zEReturn a <= b.  Computed by @total_ordering from (a < b) or (a == b).r'r)r$r$r%�_le_from_lt_s
r/cCs|�|�}||kr|S|S)z=Return a >= b.  Computed by @total_ordering from (not a < b).r'r)r$r$r%�_ge_from_ltds
r0cCs$|�|�}||kr|S|p"||kS)zJReturn a >= b.  Computed by @total_ordering from (not a <= b) or (a == b).��__le__r)r$r$r%�_ge_from_leks
r3cCs"|�|�}||kr|S|o ||kS)zFReturn a < b.  Computed by @total_ordering from (a <= b) and (a != b).r1r)r$r$r%�_lt_from_lers
r4cCs|�|�}||kr|S|S)z=Return a > b.  Computed by @total_ordering from (not a <= b).r1r)r$r$r%�_gt_from_leys
r5cCs$|�|�}||kr|S|o"||kS)zIReturn a < b.  Computed by @total_ordering from (not a > b) and (a != b).��__gt__r)r$r$r%�_lt_from_gt�s
r8cCs|�|�}|p||kS)zEReturn a >= b.  Computed by @total_ordering from (a > b) or (a == b).r6r)r$r$r%�_ge_from_gt�s
r9cCs|�|�}||kr|S|S)z=Return a <= b.  Computed by @total_ordering from (not a > b).r6r)r$r$r%�_le_from_gt�s
r:cCs$|�|�}||kr|S|p"||kS)zJReturn a <= b.  Computed by @total_ordering from (not a >= b) or (a == b).��__ge__r)r$r$r%�_le_from_ge�s
r=cCs"|�|�}||kr|S|o ||kS)zFReturn a > b.  Computed by @total_ordering from (a >= b) and (a != b).r;r)r$r$r%�_gt_from_ge�s
r>cCs|�|�}||kr|S|S)z=Return a < b.  Computed by @total_ordering from (not a >= b).r;r)r$r$r%�_lt_from_ge�s
r?r7r2r<r()r(r2r7r<csV�fdd�tD�}|std��t|�}t|D]"\}}||kr.||_t�||�q.�S)z6Class decorator that fills in missing ordering methodscs(h|] }t�|d�tt|d�k	r|�qS�N)r�object)�.0�op��clsr$r%�	<setcomp>�sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)rE�roots�root�opname�opfuncr$rDr%r�scsG�fdd�dt�}|S)z,Convert a cmp= function into a key= functioncsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dSr@�rN)r*rNr$r$r%�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS�NrrO�r*r+��mycmpr$r%r(�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkSrQrOrRrSr$r%r7�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkSrQrOrRrSr$r%�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkSrQrOrRrSr$r%r2�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkSrQrOrRrSr$r%r<�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rPr(r7rUr2r<�__hash__r$rSr$r%�K�srX)rA)rTrXr$rSr%r�s)rcCsZt|�}|tkr>zt|�}WqBtk
r:td�d�YqBXn|}|D]}|||�}qF|S)a�
    reduce(function, sequence[, initial]) -> value

    Apply a function of two arguments cumulatively to the items of a sequence,
    from left to right, so as to reduce the sequence to a single value.
    For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    of the sequence in the calculation, and serves as a default when the
    sequence is empty.
    z0reduce() of empty sequence with no initial valueN)�iter�_initial_missing�next�
StopIteration�	TypeError)ZfunctionZsequence�initial�itr#Zelementr$r$r%r�s)rcsJeZdZdZdZ�fdd�Zdd�Ze�dd��Zd	d
�Z	dd�Z
�ZS)
r	zSNew function with partial application of the given arguments
    and keywords.
    )�func�args�keywordsr�__weakref__csZt|�std��t|d�r4|j|}|j|�}|j}tt|��|�}||_||_||_|S)Nz#the first argument must be callabler`)	�callabler]�hasattrrarbr`�superr	�__new__)rEr`rarbr*��	__class__r$r%rgs


zpartial.__new__cOs|j|�}|j|j|�|�Sr@�rbr`ra)r*rarbr$r$r%�__call__%s
zpartial.__call__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdSr@)�repr)rB�xr$r$r%�	<genexpr>-sz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr$�rB�k�vr$r$r%rn.s�	functoolsz
functools.�(�, �))
�typerrlr`�extendrarb�itemsr�join)r*�qualnamerar$r$r%�__repr__)s
zpartial.__repr__cCs*t|�|jf|j|j|jpd|jp$dffSr@)rwr`rarbr�r*r$r$r%�
__reduce__3s�zpartial.__reduce__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dk	r`t|t�rr|dk	rzt|t�sztd��t|�}|dkr�i}nt|�tk	r�t|�}|dkr�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstance�tupler]�lenrd�dictrwrr`rarb)r*�stater`ra�kwds�	namespacer$r$r%�__setstate__7s4
����zpartial.__setstate__)rrrrrVrgrkrr|r~r��
__classcell__r$r$rhr%r	s
	)r	c@sDeZdZdZdd�Zde_dd�Zdd�Zdd
d�Ze	dd
��Z
d	S)r
z�Method descriptor with partial application of the given arguments
    and keywords.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��t|�}t|�s�t|d	�s�td
�	|���t
|t�r�|j|_|j
||_
|j|�|_n||_||_
||_dS)N�z8descriptor '__init__' of partialmethod needs an argumentr`rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz8type 'partialmethod' takes at least one argument, got %d��__get__z${!r} is not callable or a descriptor)r�r]�pop�warnings�warn�DeprecationWarningr�rdre�formatr�r
r`rarb)rarbr*r`r�r$r$r%rP]s6

�
��
zpartialmethod.__init__z#($self, func, /, *args, **keywords)cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nrucss|]\}}d�||�VqdS)z{}={!r}N)r�rpr$r$r%rn�s�z)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�modulerEr`rarb)rz�maprlrarbryr�rirrr`)r*rarb�
format_stringr$r$r%r|�s
�
�zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs �j|�}�j|f�j|�|�Sr@rj)�cls_or_selfrarbr}r$r%�_method�s
z3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r*r�r$r}r%�_make_unbound_method�sz"partialmethod._make_unbound_methodNcCs�t|jdd�}d}|dk	rd|||�}||jk	rdt|f|j�|j�}z|j|_Wntk
rbYnX|dkr||���||�}|S)Nr�)	rr`r	rarb�__self__rr�r�)r*rNrE�get�result�new_funcr$r$r%r��s

zpartialmethod.__get__cCst|jdd�S�Nr�F�rr`r}r$r$r%r��sz"partialmethod.__isabstractmethod__)N)rrrrrP�__text_signature__r|r�r��propertyr�r$r$r$r%r
Us"
cCst|t�r|j}q|Sr@)r�r	r`�r`r$r$r%�_unwrap_partial�s
r��	CacheInfo�hits�misses�maxsize�currsizec@s(eZdZdZdZefdd�Zdd�ZdS)�
_HashedSeqz� This class guarantees that hash() will be called no more than once
        per element.  This is important because the lru_cache() will hash
        the key multiple times on a cache miss.

    �	hashvaluecCs||dd�<||�|_dSr@�r�)r*�tup�hashr$r$r%rP�sz_HashedSeq.__init__cCs|jSr@r�r}r$r$r%rW�sz_HashedSeq.__hash__N)rrrrrVr�rPrWr$r$r$r%r��sr�c
s�|}|r&||7}|��D]}	||	7}q|rh||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|kr�|dSt|�S)a�Make a cache key from optionally typed positional and keyword arguments

    The key is constructed in a way that is flat as possible rather than
    as a nested structure that would take more memory.

    If there is only a single argument and its data type is known to cache
    its hash value, then that argument is returned without a wrapper.  This
    saves space and improves lookup speed.

    c3s|]}�|�VqdSr@r$�rBrr�rwr$r%rn�sz_make_key.<locals>.<genexpr>c3s|]}�|�VqdSr@r$r�r�r$r%rn�sr�r)ry�valuesr�)
rar��typed�kwd_mark�	fasttypesr�rwr��key�itemr$r�r%�	_make_key�s
 r��Fcsnt�t�r�dkr\d�nDt��rLt�t�rL�d}�t|��t�}t||�S�dk	r\td����fdd�}|S)a�Least-recently-used cache decorator.

    If *maxsize* is set to None, the LRU features are disabled and the cache
    can grow without bound.

    If *typed* is True, arguments of different types will be cached separately.
    For example, f(3.0) and f(3) will be treated as distinct calls with
    distinct results.

    Arguments to the cached function must be hashable.

    View the cache statistics named tuple (hits, misses, maxsize, currsize)
    with f.cache_info().  Clear the cache and statistics with f.cache_clear().
    Access the underlying function with f.__wrapped__.

    See:  http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

    rr�Nz=Expected first argument to be an integer, a callable, or Nonecst|��t�}t||�Sr@)�_lru_cache_wrapper�
_CacheInfor)�
user_functionr�r�r�r$r%�decorating_function
sz&lru_cache.<locals>.decorating_function)r��intrd�boolr�r�rr])r�r�r�rr�r$r�r%r�s


�cs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dkr����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rr�r��rFcs�d7��||�}|S�Nr�r$)rar�r�)r�r�r$r%r$s
z#_lru_cache_wrapper.<locals>.wrappercsH�||��}�|��}|�k	r*�d7�|S�d7��||�}|�|<|Sr�r$)rar�r�r�)�cache�	cache_getr��make_keyr��sentinelr�r�r$r%r-s

c
s>�
||��}�	�z�|�}|dk	r~|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|W5QR�S�d7�W5QRX�||�}�	��|�kr�n��r��
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�W5QRX|Sr�r$)rar�r��linkZ	link_prevZ	link_nextZ_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTr�r��	cache_len�fullr��lockr�r�r�rKr�r�r$r%r<sB

c
s,���������W5QR�SQRXdS)zReport cache statisticsNr$r$)r�r�r�r�r�r�r$r%�
cache_infousz&_lru_cache_wrapper.<locals>.cache_infoc	s<��.�����ddg�dd�<d��d�W5QRXdS)z$Clear the cache and cache statisticsNrF)�clearr$)r�r�r�r�r�rKr$r%�cache_clearzs
z'_lru_cache_wrapper.<locals>.cache_clear)rAr�r��__len__rr�r�)r�r�r�r�rr�r�r$)r�r�r�r�r�r�r�r�r�r�r�r�r�r�rKr�r�r�r%r�s**9	r�)r�cCs�g}dd�|D�}|s|S|D]2}|d}|D]}||dd�kr.d}qq.qRq|dkrbtd��|�|�|D]}|d|krp|d=qpqdS)z�Merges MROs in *sequences* to a single MRO using the C3 algorithm.

    Adapted from http://www.python.org/download/releases/2.3/mro/.

    cSsg|]}|r|�qSr$r$�rB�sr$r$r%�
<listcomp>�sz_c3_merge.<locals>.<listcomp>rr�NzInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr$r$r%�	_c3_merge�s"
r�Nc
stt|j��D]$\}�t�d�rt|j�|}q8qd}�rDt��ng�t|jd|��}g}t|j|d��}�D]0�t|��rtt�fdd�|jD��st|���qt|D]���	��q��fdd�|D�}�fdd�|D�}�fd	d�|D�}	t
|gg|||	|g|g|g�S)
a�Computes the method resolution order using extended C3 linearization.

    If no *abcs* are given, the algorithm works exactly like the built-in C3
    linearization used for method resolution.

    If given, *abcs* is a list of abstract base classes that should be inserted
    into the resulting MRO. Unrelated ABCs are ignored and don't end up in the
    result. The algorithm inserts ABCs where their functionality is introduced,
    i.e. issubclass(cls, abc) returns True for the class itself but returns
    False for all its direct base classes. Implicit ABCs for a given class
    (either registered or inferred from the presence of a special method like
    __len__) are inserted directly after the last ABC explicitly listed in the
    MRO of said class. If two implicit ABCs end up next to each other in the
    resulting MRO, their ordering depends on the order of types in *abcs*.

    �__abstractmethods__rNc3s|]}t|��VqdSr@)�
issubclass)rB�b)�baser$r%rn�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS���abcs��_c3_mro�rBr�r�r$r%r��sz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qSr�r�r�r�r$r%r��scsg|]}t|�d��qSr�r�r�r�r$r%r��s)�	enumerate�reversed�	__bases__rer��listr��anyr��remover�)
rEr��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr$)r�r�r%r��sD
��������r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}�D]�}g}|��D]0}|�krht�|�rh|��fdd�|jD��qh|s�|�|�qX|jtd	d
�|D] }|D]}||kr�|�|�q�q�qXt�|d�S)z�Calculates the method resolution order for a given class *cls*.

    Includes relevant abstract base classes (with their respective bases) from
    the *types* iterable. Uses a modified C3 linearization algorithm.

    cs|�kot|d�ot�|�S)N�__mro__)rer�)�typ)�basesrEr$r%�
is_related�s�z _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr$r$�rB�n)r�r$r%r��sz _compose_mro.<locals>.<listcomp>cs&�D]}||kr||jkrdSqdS)NTF)r�)r�r+)�typesr$r%�is_strict_base�sz$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr$r$r�)r�r$r%r��scsg|]}|�kr|�qSr$r$r�)�type_setr$r%r��sT)r��reverser�)�setr��__subclasses__r�r��sortr�r�)rEr��mror��found�sub�subclsr$)r�rEr�r�r�r�r%�_compose_mro�s*

rcCstt||���}d}|D]R}|dk	r\||krX||jkrX||jkrXt||�sXtd�||���qj||kr|}q|�|�S)a^Returns the best matching implementation from *registry* for type *cls*.

    Where there is no registered implementation for a specific type, its method
    resolution order is used to find a more generic implementation.

    Note: if *registry* does not contain an implementation for the base
    *object* type, this function may return None.

    NzAmbiguous dispatch: {} or {})r�keysr�r�r�r�r�)rE�registryr�match�tr$r$r%�
_find_impls"
���r
cs�ddl}ddl}i�|���d����fdd��d����fdd�	���fdd�}t|d	d
��|�t<�|_�|_|���|_�j	|_
t||�|S)akSingle-dispatch generic function decorator.

    Transforms a function into a generic function, which can have different
    behaviours depending upon the type of its first argument. The decorated
    function acts as the default implementation, and additional
    implementations can be registered using the register() attribute of the
    generic function.
    rNcs|�dk	r"t�}�|kr"���|�z�|}WnHtk
rvz�|}Wntk
rht|��}YnX|�|<YnX|S)z�generic_func.dispatch(cls) -> <function implementation>

        Runs the dispatch algorithm to return the best available implementation
        for the given *cls* registered on *generic_func*.

        N)rr��KeyErrorr
)rE�
current_token�impl)�cache_token�dispatch_cacherr$r%�dispatch.sz singledispatch.<locals>.dispatchcs�|dkr�t�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�t�t�s�td	|�d
��d���|��<�dkr�t	�d�r�t
�����|S)
z�generic_func.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_func*.

        Ncs
��|�Sr@r$)�f)rE�registerr$r%�<lambda>N�z2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)�get_type_hintszInvalid annotation for z. z is not a class.r�)r�rwrr]�typingrr[rYryrerr�)rEr`�annr�argname)rrrrrDr%rEs(

�
�z singledispatch.<locals>.registercs&|st��d����|dj�||�S)Nz( requires at least 1 positional argumentr)r]ri)ra�kw)r�funcnamer$r%rfszsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrrArr�MappingProxyTyperr��_clear_cacher)r`r�rrr$)rrrrrrr%rs!
c@s8eZdZdZdd�Zddd�Zddd�Zed	d
��ZdS)
rz�Single-dispatch generic method descriptor.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cCs4t|�s t|d�s t|�d���t|�|_||_dS)Nr�z  is not callable or a descriptor)rdrer]r�
dispatcherr`�r*r`r$r$r%rPs
zsingledispatchmethod.__init__NcCs|jj||d�S)z�generic_method.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_method*.
        r�)rr)r*rE�methodr$r$r%r�szsingledispatchmethod.registercs0���fdd�}�j|_�j|_t|�j�|S)Ncs$�j�|dj�}|����||�SrQ)rrrir�)ra�kwargsr!�rErNr*r$r%r��sz-singledispatchmethod.__get__.<locals>._method)r�rrr`)r*rNrEr�r$r#r%r��s
zsingledispatchmethod.__get__cCst|jdd�Sr�r�r}r$r$r%r��sz)singledispatchmethod.__isabstractmethod__)N)N)	rrrrrPrr�r�r�r$r$r$r%rxs


c@s&eZdZdd�Zdd�Zddd�ZdS)	r
cCs ||_d|_|j|_t�|_dSr@)r`�attrnamerrr�r r$r$r%rP�szcached_property.__init__cCs8|jdkr||_n"||jkr4td|j�d|�d���dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r$r])r*�owner�namer$r$r%�__set_name__�s

�zcached_property.__set_name__Nc	Cs�|dkr|S|jdkrtd��z
|j}Wn8tk
r`dt|�j�d|j�d�}t|�d�YnX|�|jt�}|tkr�|j�n|�|jt�}|tkr�|�	|�}z|||j<Wn8tk
r�dt|�j�d|j�d�}t|�d�YnXW5QRX|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z
 property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching )
r$r]rrrwrr��
_NOT_FOUNDr�r`)r*�instancer%r��msg�valr$r$r%r��s2
�
�
�zcached_property.__get__)N)rrrrPr'r�r$r$r$r%r
�s	)r�F)N)9r�__all__�abcr�collectionsr�reprlibr�_threadrrrrrr,r.r/r0r3r4r5r8r9r:r=r>r?rGrr�
_functools�ImportErrorrArZrr	r
r�r�r�r�r��strr�rwr�r�rr�r�r�rr
rrr(r
r$r$r$r%�<module>s��
�
�
�����AX	�

,t
-)\(_py_abc.cpython-38.opt-1.pyc000064400000011032151450073350011527 0ustar00U

e5d-�@s(ddlmZdd�ZGdd�de�ZdS)�)�WeakSetcCstjS)z�Returns the current ABC cache token.

    The token is an opaque object (supporting equality testing) identifying the
    current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.
    )�ABCMeta�_abc_invalidation_counter�rr�/usr/lib64/python3.8/_py_abc.py�get_cache_tokensrcsVeZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)rahMetaclass for defining Abstract Base Classes (ABCs).

    Use this metaclass to create an ABC.  An ABC can be subclassed
    directly, and then acts as a mix-in class.  You can also register
    unrelated concrete classes (even built-in classes) and unrelated
    ABCs as 'virtual subclasses' -- these and their descendants will
    be considered subclasses of the registering ABC by the built-in
    issubclass() function, but the registering ABC won't show up in
    their MRO (Method Resolution Order) nor will method
    implementations defined by the registering ABC be callable (not
    even via super()).
    rc	s�t�j||||f|�}dd�|��D�}|D]:}t|dt��D]&}t||d�}t|dd�r>|�|�q>q,t|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)�__isabstractmethod__F)�getattr)�.0�name�valuerrr�	<setcomp>&s�z"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__rF)�super�__new__�itemsr	�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacherr�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�clsZ	abstracts�baser��	__class__rrr#s�
zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|j�|�tjd7_|S)zsRegister a virtual subclass of an ABC.

        Returns the subclass, to allow usage as a class decorator.
        zCan only register classesz'Refusing to create an inheritance cycle�)	�
isinstance�type�	TypeError�
issubclass�RuntimeErrorrrrr)r�subclassrrr�register6s


zABCMeta.registerNcCs|td|j�d|j��|d�tdt���|d�|jD]@}|�d�r6t||�}t|t�r`t	|�}t|�d|��|d�q6dS)z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: Z_abc_z: N)
�print�
__module__�__qualname__r�__dict__�
startswithr	r"rr)rr*rrrrr�_dump_registryHs



zABCMeta._dump_registrycCs|j��dS)z.Clear the registry (for debugging or testing).N)r�clear�rrrr�_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j��|j��dS)z,Clear the caches (for debugging or testing).N)rr1rr2rrr�_abc_caches_clearWs
zABCMeta._abc_caches_clearcsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS��|�St�fdd�||fD��S)z'Override for isinstance(instance, cls).TFc3s|]}��|�VqdS)N)�__subclasscheck__)r
�cr2rr�	<genexpr>jsz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r rr#rrrrr5�any)r�instancer'Zsubtyperr2r�__instancecheck__\s
��
zABCMeta.__instancecheck__cCst|t�std��||jkr dS|jtjkr>t�|_tj|_n||jkrLdS|�	|�}|t
k	r�|rp|j�|�n|j�|�|S|t|dd�kr�|j�|�dS|j
D] }t||�r�|j�|�dSq�|��D] }t||�r�|j�|�dSq�|j�|�dS)z'Override for issubclass(subclass, cls).z"issubclass() arg 1 must be a classTF�__mro__r)r"r#r$rrrrrr�__subclasshook__�NotImplementedrr	rr%�__subclasses__)rr'�okZrclsZsclsrrrr5ls8







zABCMeta.__subclasscheck__)N)
�__name__r,r-�__doc__rrr(r0r3r4r:r5�
__classcell__rrrrrs
rN)Z_weakrefsetrrr#rrrrr�<module>s
hmac.cpython-38.opt-1.pyc000064400000016352151450073350011055 0ustar00U

&�.e��@s�dZddlZddlmZzddlZWnek
r@dZdZ	YnXe
ej�Z	ddlZddlZ
ddlZedd�ed�D��Zedd�ed�D��ZdZGdd	�d	�Zd
d�ZGdd
�d
ej�Ze
��r�eZddd�Zdd�ZdS)zqHMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
�N)�_compare_digestccs|]}|dAVqdS)�\N���.0�xrr�/usr/lib64/python3.8/hmac.py�	<genexpr>sr	�ccs|]}|dAVqdS)�6Nrrrrrr	sc@sReZdZdZdZddd�Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�HMACz~RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    �@N�csVt��rtd��t|ttf�s0tdt|�j���s<td��t	��rL�|_
n,t�t�rhd�fdd�	|_
nd�fdd�	|_
|�
�|_|�
�|_
|j
j|_t|j
d�r�|j
j}|d	kr�t�d
||jftd�|j}nt�d|jtd�|j}||_t|�|k�r|�
|���}|�|d
�}|j�|�t��|j
�|�t��|dk	�rR|�|�dS)a?Create a new HMAC object.

        key: bytes or buffer, key for the keyed hash object.
        msg: bytes or buffer, Initial input for the hash or None.
        digestmod: A hash name suitable for hashlib.new(). *OR*
                   A hashlib constructor returning a new hash object. *OR*
                   A module supporting PEP 247.

                   Required as of 3.8, despite its position after the optional
                   msg argument.  Passing it as a keyword argument is
                   recommended, though not required for legacy API reasons.
        z9This class is not available in FIPS mode. Use hmac.new().�,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.�cst��|�S�N��_hashlib�new��d��	digestmodrr�<lambda>?rzHMAC.__init__.<locals>.<lambda>cs
��|�Sr�rrrrrrAr�
block_size�z:block_size of %d seems too small; using our default of %d.�z<No block_size attribute on given digest object; Assuming %d.�N)r)r)�_hashlibopenssl�
get_fips_mode�
ValueError�
isinstance�bytes�	bytearray�	TypeError�type�__name__�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	_warnings�warn�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)�self�key�msgrr1rrr�__init__#sR
�



����
z
HMAC.__init__cCsd|jjS)Nzhmac-)r,�name)r:rrrr>asz	HMAC.namecCs t��rtd��|j�|�dS)z,Feed data from msg into this hashing object.z'hmac.HMAC is not available in FIPS modeN)rr r!r,r6)r:r<rrrr6eszHMAC.updatecCs:|j�|j�}|j|_|j|_|j��|_|j��|_|S)zyReturn a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        )�	__class__�__new__r)r-r,�copyr+)r:�otherrrrrAksz	HMAC.copycCs|j��}|�|j���|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )r+rAr6r,r4�r:�hrrr�_currentxs
z
HMAC._currentcCs|��}|��S)z�Return the hash value of this hashing object.

        This returns the hmac value as bytes.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        )rEr4rCrrrr4�szHMAC.digestcCs|��}|��S)zKLike digest(), but returns a string of hexadecimal digits instead.
        )rE�	hexdigestrCrrrrF�szHMAC.hexdigest)Nr)
r'�
__module__�__qualname__�__doc__r1r=�propertyr>r6rArEr4rFrrrrrs
>

	
rcCsHt|t�r|��St|�r"|d�}t|tj�s6td��|j���dd�S)Nrz6Only OpenSSL hashlib hashes are accepted in FIPS mode.�_�-)	r"r*�lowerr(rZHASHr%r>�replacerrrr�_get_openssl_name�s
�rOc@seZdZddd�ZdS)�HMAC_opensslNcCsLt|ttf�s tdt|�j��t|�}tjj	|||d�}|rH|�
|�|S)Nrr)r"r#r$r%r&r'rO�_hmacopensslrr@r6)�clsr;r<rr>�resultrrrr@�s
zHMAC_openssl.__new__)NN)r'rGrHr@rrrrrP�srPrcCst|||�S)a�Create a new hashing object and return it.

    key: bytes or buffer, The starting key for the hash.
    msg: bytes or buffer, Initial input for the hash, or None.
    digestmod: A hash name suitable for hashlib.new(). *OR*
               A hashlib constructor returning a new hash object. *OR*
               A module supporting PEP 247.

               Required as of 3.8, despite its position after the optional
               msg argument.  Passing it as a keyword argument is
               recommended, though not required for legacy API reasons.

    You can now feed arbitrary bytes into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    or hexdigest() methods.
    )r)r;r<rrrrr�srcs�tdk	r(t�t�r(�tkr(t�||��St��r6�}n(t�t�rPd	�fdd�	}nd
�fdd�	}|�}|�}t|dd�}t|�|kr�||���}|d|t|�}|�	|�
t��|�	|�
t��|�	|�|�	|���|��S)aJFast inline implementation of HMAC.

    key: bytes or buffer, The key for the keyed hash object.
    msg: bytes or buffer, Input message.
    digest: A hash name suitable for hashlib.new() for best performance. *OR*
            A hashlib constructor returning a new hash object. *OR*
            A module supporting PEP 247.
    Nrcst��|�Srrr�r4rrr�rzdigest.<locals>.<lambda>cs
��|�SrrrrTrrr�rrr
r)r)r)
�_hashopensslr"r*�_openssl_md_methsZhmac_digestr(�getattrr3r4r6r7r9r8)r;r<r4r)r,r+r1rrTrr4�s,	��

r4)Nr)rI�warningsr/�	_operatorrZcompare_digestrrU�ImportErrorrV�	frozensetZopenssl_md_meth_namesZhashlibrrQr#�ranger8r9r-rrOrPr rr4rrrr�<module>s*

u
csv.cpython-38.pyc000064400000027210151450073350007774 0ustar00U

e5d?�@s@dZddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZdddd	d
ddd
dddddddddddddgZGdd�d�ZGdd
�d
e�Zed
e�Gdd�de�Zede�Gdd�de�Zed e�Gd!d�d�ZGd"d�d�ZzeWnek
�r,eZYnXGd#d�d�ZdS)$z+
csv.py - read/write/investigate CSV files
�N)�Error�__version__�writer�reader�register_dialect�unregister_dialect�get_dialect�
list_dialects�field_size_limit�
QUOTE_MINIMAL�	QUOTE_ALL�QUOTE_NONNUMERIC�
QUOTE_NONE�__doc__)�Dialect)�StringIOrrr
rrrr�excel�	excel_tabr
rrrrr	�Snifferrr�
DictReader�
DictWriter�unix_dialectc@sDeZdZdZdZdZdZdZdZdZ	dZ
dZdZdd�Z
dd�ZdS)	rz�Describe a CSV dialect.

    This must be subclassed (see csv.excel).  Valid attributes are:
    delimiter, quotechar, escapechar, doublequote, skipinitialspace,
    lineterminator, quoting.

    �FNcCs|jtkrd|_|��dS)NT)�	__class__r�_valid�	_validate��self�r�/usr/lib64/python3.8/csv.py�__init__*s
zDialect.__init__c
Cs@zt|�Wn.tk
r:}ztt|���W5d}~XYnXdS�N)�_Dialect�	TypeErrorr�str)r�errrr/szDialect._validate)�__name__�
__module__�__qualname__r�_namer�	delimiter�	quotecharZ
escapechar�doublequote�skipinitialspace�lineterminator�quotingr rrrrrrsc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz;Describe the usual properties of Excel-generated CSV files.�,�"TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrr6sc@seZdZdZdZdS)rzEDescribe the usual properties of Excel-generated TAB-delimited files.�	N)r&r'r(rr*rrrrr@sz	excel-tabc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz:Describe the usual properties of Unix-generated CSV files.r0r1TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrrEsZunixc@s@eZdZddd�Zdd�Zedd��Zejd	d��Zd
d�ZdS)
rNrcOs6||_||_||_t||f|�|�|_||_d|_dS�Nr)�_fieldnames�restkey�restvalr�dialect�line_num)r�f�
fieldnamesr7r8r9�args�kwdsrrrr QszDictReader.__init__cCs|Sr!rrrrr�__iter__ZszDictReader.__iter__cCs@|jdkr0zt|j�|_Wntk
r.YnX|jj|_|jSr!)r6�nextr�
StopIterationr:rrrrr<]s

zDictReader.fieldnamescCs
||_dSr!)r6)r�valuerrrr<gscCs�|jdkr|jt|j�}|jj|_|gkr8t|j�}q$tt|j|��}t|j�}t|�}||krv||d�||j<n&||kr�|j|d�D]}|j||<q�|Sr5)	r:r<r@r�dict�zip�lenr7r8)r�row�dZlfZlr�keyrrr�__next__ks



zDictReader.__next__)NNNr)	r&r'r(r r?�propertyr<�setterrIrrrrrPs�
	
	
c@s6eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rr�raisercOsB||_||_|��dkr$td|��||_t||f|�|�|_dS)N)rL�ignorez-extrasaction (%s) must be 'raise' or 'ignore')r<r8�lower�
ValueError�extrasactionr)rr;r<r8rPr9r=r>rrrr �s�zDictWriter.__init__cCstt|j|j��}|�|�Sr!)rCrDr<�writerow)r�headerrrr�writeheader�szDictWriter.writeheadercsN�jdkr8����j}|r8tdd�dd�|D������fdd��jD�S)NrLz(dict contains fields not in fieldnames: z, cSsg|]}t|��qSr)�repr)�.0�xrrr�
<listcomp>�sz,DictWriter._dict_to_list.<locals>.<listcomp>c3s|]}��|�j�VqdSr!)�getr8)rUrH��rowdictrrr�	<genexpr>�sz+DictWriter._dict_to_list.<locals>.<genexpr>)rP�keysr<rO�join)rrZZwrong_fieldsrrYr�
_dict_to_list�s
�zDictWriter._dict_to_listcCs|j�|�|��Sr!)rrQr^)rrZrrrrQ�szDictWriter.writerowcCs|j�t|j|��Sr!)r�	writerows�mapr^)rZrowdictsrrrr_�szDictWriter.writerowsN)rrLr)r&r'r(r rSr^rQr_rrrrr�s�

c@s:eZdZdZdd�Zd
dd�Zdd�Zd	d
�Zdd�ZdS)rze
    "Sniffs" the format of a CSV file (i.e. delimiter, quotechar)
    Returns a Dialect object.
    cCsdddddg|_dS)Nr0r3�;� �:)�	preferredrrrrr �szSniffer.__init__NcCsd|�||�\}}}}|s(|�||�\}}|s4td��Gdd�dt�}||_||_|pVd|_||_|S)zI
        Returns a dialect (or None) corresponding to the sample
        zCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff.<locals>.dialectZsniffedr2N)r&r'r(r)r.rr/rrrrr9�sr9r1)�_guess_quote_and_delimiter�_guess_delimiterrrr,r*r+r-)r�sample�
delimitersr+r,r*r-r9rrr�sniff�s
�
�
z
Sniffer.sniffc	Cs�g}dD]*}t�|tjtjB�}|�|�}|rq4q|s<dSi}i}d}|j}	|D]�}
|	dd}|
|}|r�|�|d�d||<z|	dd}|
|}Wntk
r�YqRYnX|r�|dks�||kr�|�|d�d||<z|	dd}Wntk
�rYqRYnX|
|rR|d7}qRt||jd	�}
|�rXt||jd	�}|||k}|d
k�r`d}nd}d}t�dt�	|�|
d
�tj�}|�
|��r�d}nd}|
|||fS)a�
        Looks for text enclosed between two identical quotes
        (the probable quotechar) which are preceded and followed
        by the same character (the probable delimiter).
        For example:
                         ,'some text',
        The quote with the most wins, same with the delimiter.
        If there is no quotechar the delimiter can't be determined
        this way.
        )zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n))rFNrr�quote��delimNZspace�rHr4rz]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rlrjTF)�re�compile�DOTALL�	MULTILINE�findall�
groupindexrX�KeyError�max�escape�search)r�datarhZmatchesZrestrZregexpZquotes�delimsZspacesrs�m�nrHr+rlr-Z	dq_regexpr,rrrre�s`




��z"Sniffer._guess_quote_and_delimitercCsttd|�d���}dd�td�D�}tdt|��}d}i}i}i}d|}	}
|	t|�k�rR|d7}||	|
�D]@}|D]6}|�|i�}
|�|�}|
�|d�d|
|<|
||<qxqp|��D]�}t||�	��}t|�dkr�|dddkr�q�t|�dk�rLt
|d	d
�d�||<|�||�||d||dtdd
�|D��f||<q�|d||<q�|�	�}t
t||t|���}d}d}t|�dk�r�||k�r�|D]T\}}|ddk�r�|ddk�r�|d||k�r�|dk�s�||k�r�|||<�q�|d8}�q�t|�dk�rDt|���d}|d�|�|d�d|�k}||fS|
}	|
|7}
qN|�s\dSt|�dk�r�|jD]@}||��k�rp|d�|�|d�d|�k}||fS�qpdd�|�	�D�}|��|dd}|d�|�|d�d|�k}||fS)a�
        The delimiter /should/ occur the same number of times on
        each row. However, due to malformed data, it may not. We don't want
        an all or nothing approach, so we allow for small variations in this
        number.
          1) build a table of the frequency of each character on every line.
          2) build a table of frequencies of this frequency (meta-frequency?),
             e.g.  'x occurred 5 times in 10 rows, 6 times in 1000 rows,
             7 times in 2 rows'
          3) use the mode of the meta-frequency to determine the /expected/
             frequency for that character
          4) find out how often the character actually meets that goal
          5) the character that best meets its goal is the delimiter
        For performance reasons, the data is evaluated in chunks, so it can
        try and evaluate the smallest portion of the data possible, evaluating
        additional chunks as necessary.
        Nr4cSsg|]}t|��qSr)�chr)rU�crrrrW-sz,Sniffer._guess_delimiter.<locals>.<listcomp>��
rrkcSs|dS)Nrkr)rVrrr�<lambda>G�z*Sniffer._guess_delimiter.<locals>.<lambda>rmcss|]}|dVqdS)rkNr)rU�itemrrrr[Lsz+Sniffer._guess_delimiter.<locals>.<genexpr>g�?g�������?g{�G�z�?z%c )rrcSsg|]\}}||f�qSrr)rU�k�vrrrrWvs���)�list�filter�split�range�minrErX�countr\�itemsru�remove�sum�floatrd�sort)rrxrh�asciiZchunkLengthZ	iterationZ
charFrequencyZmodesry�start�end�line�charZ
metaFrequencyZfreqr�ZmodeListZtotalZconsistencyZ	thresholdr�r�rlr-rGrrrrfs�

����

��zSniffer._guess_delimiterc
Cs�tt|�|�|��}t|�}t|�}i}t|�D]}d||<q0d}|D]�}|dkrVq�|d7}t|�|krlqFt|���D]x}	tt	t
fD]4}
z|
||	�Wq�Wq�ttfk
r�Yq�Xq�t||	�}
|
||	krx||	dkr�|
||	<qx||	=qxqFd}|�
�D]~\}	}t|�td�k�r@t||	�|k�r6|d7}n|d8}n<z|||	�Wn"ttfk
�rr|d7}Yn
X|d8}�q|dkS)Nr�rk)rrrir@rEr�r�r\�intr��complexrO�
OverflowErrorr��typer#)
rrgZrdrrR�columnsZcolumnTypes�i�checkedrF�colZthisTypeZ	hasHeaderZcolTyperrr�
has_headersJ






zSniffer.has_header)N)	r&r'r(rr rirerfr�rrrrr�s
Lg)rrnZ_csvrrrrrrrr	r
rrr
rrr"�ior�__all__rrrrrr��	NameErrorr�rrrrr�<module>sJ@�


2
zipfile.cpython-38.opt-2.pyc000064400000141176151450073350011613 0ustar00U

e5d�V�@s
ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZzddlZejZWnek
r�dZejZYnXzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXdddddddd	d
ddd
dg
ZGdd�de�ZGdd
�d
e�ZeZZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'e
�(e&�Z)dZ*dZ+dZ,dZ-dZ.d Z/d!Z0d"Z1dZ2d#Z3d$Z4d%Z5e
�(e4�Z6dZ7dZ8dZ9dZ:dZ;d Z<d!Z=d"Z>dZ?d#Z@d&ZAd'ZBdZCd(ZDdZEd)ZFd*ZGd+ZHd,ZId-ZJd.ZKe
�(eJ�ZLdZMdZNdZOdZPdZQd ZRd!ZSd"ZTdZUd#ZVd&ZWd'ZXd/ZYd0ZZe
�(eY�Z[d1Z\d2Z]e
�(e\�Z^dZ_dZ`dZadZbdZcd Zdd!Zed"ZfdZgd#Zhd3Zie
�jd4�Zkd5d6�Zld7d8�Zmd9d	�Znd:d;�Zod<d=�ZpGd>d
�d
eq�Zrdasd?d@�ZtdAdB�ZuGdCdD�dD�ZvGdEdF�dF�ZwdGdHdIdIdIdIdJdKdLdMdJdNdOdPdQdRdSdT�ZxdUdV�ZydsdWdX�ZzdYdZ�Z{Gd[d\�d\�Z|Gd]d^�d^�Z}Gd_d`�d`ej~�ZGdadb�dbej~�Z�Gdcd�d�Z�Gddd�de��Z�dedf�Z�dgdh�Z�e�j�Z�didj�Z�Gdkdl�dle��Z�Gdmdn�dne��Z�Gdod�d�Z�dtdpdq�Z�e�drk�re��dS)u�N�
BadZipFile�
BadZipfile�error�
ZIP_STORED�ZIP_DEFLATED�	ZIP_BZIP2�ZIP_LZMA�
is_zipfile�ZipInfo�ZipFile�	PyZipFile�LargeZipFile�Pathc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/zipfile.pyr+sc@seZdZdS)r
Nrrrrrr
/si���������-�.�?s<4s4H2LHsPK��������	z<4s4B4HL2L5H2LsPK�
��
����z<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK�<HHc
Cs�tj}d}g}d}}|dt|�krz||||d��\}}|d|}	||krt||krl|�|||��|	}d}|	}q|s�|Sd�|�S)NFrr T�)�_EXTRA_FIELD_STRUCT�unpack�len�append�join)
�extraZxidsr/Zmodified�buffer�start�iZxidZxlen�jrrr�_strip_extra�s r8cCs,zt|�rWdSWntk
r&YnXdS)NTF)�_EndRecData�OSError��fprrr�_check_zipfile�s
r=c	CsVd}z8t|d�rt|d�}nt|d��}t|�}W5QRXWntk
rPYnX|S)NF�readr;�rb)�hasattrr=�openr:)�filename�resultr<rrrr	�s
c
Csz|�|td�Wntk
r,|YSX|�t�}t|�tkrH|St�t|�\}}}}|tkrh|S|dksx|dkr�t	d��|�|tt
d�|�t
�}t|�t
kr�|St�t|�\
}}}	}
}}}
}}}|tkr�|S||t
<||t<||t<|
|t<||t<||t<||t<|S)Nrrrz3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr:r>r0�structr/�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL�	_ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZread_versionZdisk_numZdisk_dirZdircountZ	dircount2ZdirsizeZ	diroffsetrrr�
_EndRecData64�s@



�rXc	Csh|�dd�|��}z|�td�Wntk
r<YdSX|��}t|�tkr�|dd�tkr�|dd�dkr�t�t	|�}t
|�}|�d�|�|t�t|t|�St
|dtd�}|�|d�|��}|�t�}|dk�rd|||t�}t|�tk�rdSt
t�t	|��}|t}||t|t|�}|�|�|�||�t|||||�SdS)Nrrr ���sr-i)rD�tell�sizeEndCentDirr:r>r0�stringEndArchiverFr/�structEndArchive�listr1rX�max�rfind�_ECD_COMMENT_SIZE)	rSZfilesizerVrUZmaxCommentStartr5ZrecDataZcommentSize�commentrrrr9sD��



�r9c@sXeZdZdZddd�Zdd�Zdd	d
�Zdd�Zd
d�Ze	ddd�dd��Z
dd�ZdS)r
)�
orig_filenamerB�	date_time�
compress_type�_compresslevelrbr3�
create_systemrW�extract_version�reserved�	flag_bits�volume�
internal_attr�
external_attr�
header_offset�CRC�
compress_size�	file_size�	_raw_time�NoName��rrrrrcCs�||_|�td��}|dkr(|d|�}tjdkrJtj|krJ|�tjd�}||_||_|ddkrjtd��t	|_
d|_d|_d|_
tjdkr�d|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nr�/ruz+ZIP does not support timestamps before 1980r-Zwin32r)rc�find�chr�os�sep�replacerBrd�
ValueErrorrrerfrbr3�sys�platformrg�DEFAULT_VERSIONrWrhrirjrkrlrm)�selfrBrdZ	null_byterrr�__init__Xs0
zZipInfo.__init__cCs�d|jj|jfg}|jtkr8|�dt�|j|j��|jd?}|jd@}|rd|�dt	�
|��|rv|�d|�|��}|r�|jr�|�d|j�|r�|j
r�|jtks�|j|j
kr�|�d|j
�|�d	�d
�|�S)Nz<%s filename=%r� compress_type=%sr)rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r�>�)�	__class__rrBrerr1�compressor_names�getrm�stat�filemode�is_dirrqrpr2)r�rC�hi�lo�isdirrrr�__repr__�s0
��



�
�
zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}|jd
@rfd}}}n|j}|j}|j}|j}d}	|dkr�|tkp�|tk}|r�d}
|t�|
dt�	|
�d	||�}|tks�|tkr�|s�t
d��d
}d
}t}	|jt
k�rtt|	�}	n|jtk�rtt|	�}	t|	|j�|_t|	|j�|_|��\}}t�tt|j|j||j|||||t|�t|��
}
|
||S)Nrrur$rr!rrr&r rz<HHQQz'Filesize would require ZIP64 extensions���)rdrjrorprqr3�ZIP64_LIMITrF�pack�calcsizer
�
ZIP64_VERSIONrerr_�
BZIP2_VERSIONr�LZMA_VERSIONrhrW�_encodeFilenameFlags�structFileHeader�stringFileHeaderrir0)r��zip64�dt�dosdate�dostimerorprqr3�min_version�fmtrBrj�headerrrr�
FileHeader�s^$$
�
�zZipInfo.FileHeadercCsDz|j�d�|jfWStk
r>|j�d�|jdBfYSXdS)N�ascii�utf-8�)rB�encoderj�UnicodeEncodeError�r�rrrr��szZipInfo._encodeFilenameFlagscCs�|j}tj}t|�dk�r�|d|dd��\}}|dt|�krPtd||f��|dk�rp|dkrv|d|dd��}nV|dkr�|d	|dd
��}n:|dkr�|d|dd
��}n|dkr�d}ntd||f��d}|jdk�rt|�|kr�td��|||_|d7}|jdk�r6t|�|k�r$td��|||_|d7}|jdk�rpt|�|k�rXtd��|j}|||_|d7}||dd�}qdS)Nr r,z"Corrupt extra field %04x (size=%d)r�z<QQQ�r)z<QQrrz<Qrrr)l����r�z/Corrupt zip64 extra field. File size not found.r�z3Corrupt zip64 extra field. Compress size not found.z3Corrupt zip64 extra field. Header offset not found.)r3rFr/r0rrqrprn)r�r3r/�tpZlnZcounts�idx�oldrrr�_decodeExtra�sP
�
�
�
zZipInfo._decodeExtraT��strict_timestampsc	Cst|tj�rt�|�}t�|�}t�|j�}t�|j	�}|dd�}|sZ|ddkrZd}n|sn|ddkrnd}|dkrz|}tj
�tj
�|�d�}|dtj
tjfkr�|dd�}q�|r�|d7}|||�}|jd	@d
>|_|r�d|_|jd
O_n|j|_|S)Nrr"rurt�;)r�r���;r�rrvrr))�
isinstancery�PathLike�fspathr��S_ISDIR�st_mode�time�	localtime�st_mtime�path�normpath�
splitdriverz�altseprmrq�st_size)	�clsrB�arcnamer��str��mtimerd�zinforrr�	from_file�s0



zZipInfo.from_filecCs|jddkS)N���rv�rBr�rrrr�%szZipInfo.is_dir)rsrt)N)N)rrr�	__slots__r�r�r�r�r��classmethodr�r�rrrrr
>s
+
.2%cCs0td�D]"}|d@r"|d?dA}q|dL}q|S)Nrrl q[)�range)�crcr7rrr�_gen_crc/s

r�csld�d�d�tdkr&ttttd���at��fdd������fdd��|D]}�|�qL��fd	d
�}|S)NixV4i�gE#i�xV4�cs|d?�||Ad@AS)Nr�r)Zchr�)�crctablerr�crc32Isz_ZipDecrypter.<locals>.crc32cs<�|�����d@d@��ddd@���d?���dS)Nr�r�i�rr�r)�c)r��key0�key1�key2rr�update_keysMs
z"_ZipDecrypter.<locals>.update_keyscsNt�}|j}|D]4}�dB}|||dAd?d@N}�|�||�qt|�S)Nrrrr�)�	bytearrayr1�bytes)rVrCr1r��k)r�r�rr�	decrypterWs
z _ZipDecrypter.<locals>.decrypter)�	_crctabler^�mapr�r�)�pwd�pr�r)r�r�r�r�r�r�r�
_ZipDecrypter?s
r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LZMACompressorcCs
d|_dS�N)�_compr�rrrr�gszLZMACompressor.__init__cCsFt�dtji�}tjtjt�tj|�gd�|_t�dddt	|��|S)N�id��filtersz<BBHr$r )
�lzmaZ_encode_filter_properties�FILTER_LZMA1r��
FORMAT_RAW�_decode_filter_propertiesr�rFr�r0)r�Zpropsrrr�_initjs
�
zLZMACompressor._initcCs*|jdkr|��|j�|�S|j�|�Sr�)r�r��compress)r�rVrrrr�qs
zLZMACompressor.compresscCs&|jdkr|��|j��S|j��Sr�)r�r��flushr�rrrr�vs
zLZMACompressor.flushN)rrrr�r�r�r�rrrrr�esr�c@seZdZdd�Zdd�ZdS)�LZMADecompressorcCsd|_d|_d|_dS)Nr-F)�_decomp�_unconsumed�eofr�rrrr�~szLZMADecompressor.__init__c	Cs�|jdkr�|j|7_t|j�dkr*dSt�d|jdd��\}t|j�d|krXdStjtjt�tj	|jdd|��gd�|_|jd|d�}|`|j�
|�}|jj|_|S)Nr r-z<Hrr�)r�r�r0rFr/r�r�r�r�r��
decompressr�)r�rVZpsizerCrrrr��s"
��

zLZMADecompressor.decompressN)rrrr�r�rrrrr�|sr�ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ	deflate64Zbzip2r�ZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr+��a�bcCsX|tkr
nJ|tkr tsTtd��n4|tkr6tsTtd��n|tkrLtsTtd��ntd��dS)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rr�zlib�RuntimeErrorr�bz2rr��NotImplementedError)�compressionrrr�_check_compression�s$���r�cCsj|tkr2|dk	r t�|tjd�St�tjtjd�S|tkrT|dk	rLt�|�St��S|tkrbt	�SdSdS)N��)
rr�ZcompressobjZDEFLATEDZZ_DEFAULT_COMPRESSIONrr�Z
BZ2Compressorrr�)re�
compresslevelrrr�_get_compressor�s
r�cCsvt|�|tkrdS|tkr&t�d�S|tkr6t��S|tkrDt	�St
�|�}|rdtd||f��ntd|f��dS)Nr�zcompression type %d (%s)zcompression type %d)
r�rrr�Z
decompressobjrr�ZBZ2Decompressorrr�r�r�r�)reZdescrrrr�_get_decompressor�s

r�c@s0eZdZdd�Zddd�Zd
dd�Zd	d
�ZdS)�_SharedFilecCs2||_||_||_||_||_|j|_|j|_dSr�)�_file�_pos�_close�_lock�_writing�seekablerZ)r��file�pos�close�lockZwritingrrrr��sz_SharedFile.__init__rc
CsN|j�>|��rtd��|j�||�|j��|_|jW5QR�SQRXdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrZr)r�rT�whencerrrrD�sz_SharedFile.seekr�c
CsX|j�H|��rtd��|j�|j�|j�|�}|j��|_|W5QR�SQRXdS)N�yCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrr>rZ�r��nrVrrrr>�sz_SharedFile.readcCs$|jdk	r |j}d|_|�|�dSr�)rr)r��fileobjrrrr	s
z_SharedFile.closeN)r)r�)rrrr�rDr>r	rrrrr�s	


rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	_TellablecCs||_d|_dS�Nr)r<rT�r�r<rrrr�sz_Tellable.__init__cCs|j�|�}|j|7_|Sr�)r<�writerT)r�rVrrrrrsz_Tellable.writecCs|jSr�)rTr�rrrrZsz_Tellable.tellcCs|j��dSr�)r<r�r�rrrr�sz_Tellable.flushcCs|j��dSr�)r<r	r�rrrr	sz_Tellable.closeN)rrrr�rrZr�r	rrrrrs
rcs�eZdZdZdZdZd'dd�Zdd	�Zd
d�Zd(d
d�Z	d)dd�Z
dd�Zd*dd�Zdd�Z
dd�Zdd�Zdd�Z�fdd�Zd d!�Zd+d#d$�Zd%d&�Z�ZS),�
ZipExtFilei@iiNFcCs(||_||_||_|j|_|j|_|j|_t	|j�|_
d|_d|_d|_
d|_||_|j|_t|d�rz|j|_td�|_nd|_d|_z4|��r�|��|_|j|_|j|_|j|_d|_Wntk
r�YnXd|_|�r$|j d@r�|j!d?d@}n|jd?d@}|�"�}||k�r$t#d	|j$��dS)
NFr-rroTrr�r�zBad password for file %r)%�_fileobj�_pwd�_close_fileobjre�_compress_typerp�_compress_leftrq�_leftr��
_decompressor�_eof�_readbuffer�_offset�newlines�moderB�namer@ro�
_expected_crcr��_running_crc�	_seekablerrZ�_orig_compress_start�_orig_compress_size�_orig_file_size�_orig_start_crc�AttributeError�
_decrypterrjrr�_init_decrypterr�rc)r�rr �zipinfor�Z
close_fileobjZ
check_byte�hrrrr�)sF




zZipExtFile.__init__cCs4t|j�|_|j�d�}|jd8_|�|�dS)Nrr&)r�rr*rr>r)r�r�rrrr+\szZipExtFile._init_decryptercCsvd|jj|jjfg}|jsX|�d|j|jf�|jtkrb|�dt	�
|j|j��n
|�d�|�d�d�|�S)N�<%s.%sz name=%r mode=%rr��	 [closed]r�r�)r�rr�closedr1r!r rrr�r�r2�r�rCrrrr�gs�
��

zZipExtFile.__repr__r�cCsL|dkr>|j�d|j�d}|dkr>|j|j|�}||_|Stj�||�S)Nr�
r)rrwr�io�BufferedIOBase�readline)r��limitr6�linerrrr5uszZipExtFile.readlinercCsr|t|j�|jkr\|�|�}t|�|jkrJ||j|jd�|_d|_n|jt|�8_|j|j|jd�S)Nri)r0rrr>)r�r�chunkrrr�peek�s
zZipExtFile.peekcCsdS�NTrr�rrr�readable�szZipExtFile.readablecCs|dks|dkrH|j|jd�}d|_d|_|jsD||�|j�7}q,|S||j}|t|j�krz|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dkr�|js�|�|�}|t|�kr�||_||_||d|�7}q�||7}|t|�8}q�|S�Nrr-�rrr�_read1�MAX_Nr0)r�r�buf�endrVrrrr>�s4

zZipExtFile.readcCs@|jdkrdSt||j�|_|jr<|j|jkr<td|j��dS)NzBad CRC-32 for file %r)r"r�r#rrr!)r��newdatarrr�_update_crc�s

zZipExtFile._update_crccCs|dks|dkrR|j|jd�}d|_d|_|jsN|�|j�}|r,||7}qNq,|S||j}|t|j�kr�|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dk�r|j�s|�|�}|t|�kr�||_||_||d|�7}�q|r�||7}�qq�|Sr<r=)r�rr@rVrArrr�read1�s>


zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|�krR||�|t|��7}n
|�|�}|jtkrj|jdk|_nx|jtkr�t	||j
�}|j�||�}|jjp�|jdko�|jj|_|jr�||j�
�7}n |j�|�}|jjp�|jdk|_|d|j�}|jt|�8_|jdk�rd|_|�|�|S)Nrr-T)rrrrZunconsumed_tailr0�_read2rrr_�
MIN_READ_SIZEr�r�r�rrCr
rrrr>�s4




�
zZipExtFile._read1cCsd|jdkrdSt||j�}t||j�}|j�|�}|jt|�8_|sLt�|jdk	r`|�|�}|Sr<)	rr_rF�minrr>r0�EOFErrorr*r
rrrrE	s


zZipExtFile._read2cs&z|jr|j��W5t���XdSr�)�superr	rrr��r�rrr	szZipExtFile.closecCs|jSr�)r$r�rrrr szZipExtFile.seekablercCs>|jst�d��|��}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd��||jkrd|j}|dkrpd}||}||j}|dkr�|t|j�kr�||_d}nf|dk�r
|j	�
|j�|j|_
|j|_|j|_d|_d|_t|j�|_d|_|}|jdk	�r
|��|dk�r6t|j|�}|�|�||8}�q
|��S)N�!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r-F)r$r3�UnsupportedOperationrZr'r|rr0rrrDr%r(r#r&rrr�rrrr*r+rG�
MAX_SEEK_READr>)r�rTrZcurr_posZnew_posZread_offsetZbuff_offsetZread_lenrrrrD#sH






zZipExtFile.seekcCs0|jst�d��|j|jt|j�|j}|S)NrK)r$r3rLr'rr0rr)r�ZfileposrrrrZSs
zZipExtFile.tell)NF)r�)r)r�)r)rrrr?rFrMr�r+r�r5r9r;r>rCrDr>rEr	rrDrZ�
__classcell__rrrJrrs(�
3



!
%$
0rcs@eZdZdd�Zedd��Zdd�Zdd�Z�fd	d
�Z�Z	S)�
_ZipWriteFilecCs8||_||_||_t|j|j�|_d|_d|_d|_	dSr)
�_zinfo�_zip64�_zipfiler�rerf�_compressor�
_file_size�_compress_size�_crc)r��zfr�r�rrrr�[s�z_ZipWriteFile.__init__cCs|jjSr�)rRr<r�rrrresz_ZipWriteFile._fileobjcCsdSr:rr�rrr�writableisz_ZipWriteFile.writablecCsf|jrtd��t|�}|j|7_t||j�|_|jrV|j�|�}|jt|�7_|j	�
|�|S)NzI/O operation on closed file.)r0r|r0rTr�rVrSr�rUrr)r�rV�nbytesrrrrlsz_ZipWriteFile.writec	sb|jr
dS�zFt���|jrR|j��}|jt|�7_|j	�
|�|j|j_n
|j
|j_|j|j_|j
|j_|jjd@r�|jr�dnd}|j	�
t�|t|jj|jj|jj��|j	��|j_nn|js�|j
tkr�td��|jtkr�td��|j	��|j_|j	�|jj�|j	�
|j�|j��|j	�|jj�|jj�|j�|j|jj|jj <W5d|j_XdS)NFrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limit)!r0rRrrIr	rSr�rUr0rrrPrprTrVrorqrjrQrFr��
_DD_SIGNATURErZ�	start_dirr�r�rDrnr��filelistr1�
NameToInforB)r�r@r�rJrrr	xsF




�
�
�z_ZipWriteFile.close)
rrrr��propertyrrXrr	rNrrrJrrOZs

rOc@s eZdZdZdZdeddfdd�dd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zd<dd�Z
dd�Zdd�Zdd�Zedd��Zejdd��Zd=dd�Zd>d d!�d"d#�Zd?d$d%�Zd@d&d'�ZdAd(d)�Zed*d+��Zd,d-�Zd.d/�ZdBd0d1�ZdCd2d3�Zd4d5�Zd6d7�Z d8d9�Z!d:d;�Z"dS)DrN�rTr�c
	CsP|dkrtd��t|�||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_t
|tj�rpt�|�}t
|t�r�d|_||_dddd	dd
dd�}||}zt�||�|_Wq�tk
r�||kr�||}Yq��Yq�Xq�q�nd
|_||_t|dd�|_d
|_t��|_d|_d|_�z|dk�r4|��n�|dk�r�d|_z|j� �|_!Wn2t"tfk
�r�t#|j�|_d|_!d|_Yn6Xz|j�$|j!�Wn t"tfk
�r�d|_YnXnf|dk�rz|��|j�$|j!�Wn6t%k
�r|j�$dd�d|_|j� �|_!YnXntd��Wn$|j}	d|_|�&|	��YnXdS)N)r_�w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'Frr-r?�w+b�x+b�r+b�wbZxb)r_r`rarbrercrdrr!Tr_)r`rarbrz"Mode must be 'r', 'w', 'x', or 'a')'r|r��_allowZip64�
_didModify�debugr]r\r�r�r r��_comment�_strict_timestampsr�ryr�r��str�_filePassedrBr3rAr<r:�getattr�_fileRefCnt�	threading�RLockrr$r�_RealGetContentsrZr[r)rrDr�_fpclose)
r�rr r��
allowZip64r�r�ZmodeDictr�r<rrrr��s�

�





zZipFile.__init__cCs|Sr�rr�rrr�	__enter__szZipFile.__enter__cCs|��dSr��r	)r��type�value�	tracebackrrr�__exit__szZipFile.__exit__cCs�d|jj|jjfg}|jdk	rd|jr8|�d|j�n|jdk	rR|�d|j�|�d|j�n
|�d�|�d�d�|�S)Nr.z file=%rz filename=%rz mode=%rr/r�r�)	r�rrr<rmr1rBr r2r1rrrr�"s�



zZipFile.__repr__cCs�|j}zt|�}Wntk
r.td��YnX|s<td��|jdkrNt|�|t}|t}|t|_	|t
||}|ttkr�|t
t8}|jdkr�||}td|||�|||_|�|jd�|�|�}t�|�}d}||k�r�|�t�}	t|	�tk�r
td��t�t|	�}	|	ttk�r,td��|jdk�r@t|	�|�|	t�}
|	d}|d	@�rl|
�d
�}
n
|
�d�}
t|
�}|�|	t�|_|�|	t �|_!|	t"|_#|	dd�\|_$|_%|_&|_'|_(|_)}
}|_*|_+|_,|j&t-k�r�t.d
|j&d��|	dd�\|_/|_0|_1|
|_2|d?d|d?d@|d@|
d?|
d?d@|
d@df|_3|�4�|j#||_#|j5�6|�||j7|j8<|t|	t|	t|	t }|jdkr�td|�q�dS)NzFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!r�r��cp437rzzip file version %.1fr%r(r+r$rur�r&r�total)9r<r9r:rri�printrQrR�_ECD_COMMENTrj�
_ECD_LOCATIONrLrKrIrEr[rDr>r3�BytesIO�sizeCentralDirr0rFr/�structCentralDir�
_CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder
�_CD_EXTRA_FIELD_LENGTHr3�_CD_COMMENT_LENGTHrb�_CD_LOCAL_HEADER_OFFSETrnrWrgrhrirjrerorprq�MAX_EXTRACT_VERSIONr�rkrlrmrrrdr�r\r1r]rB)r�r<rUZsize_cdZ	offset_cd�concatZinferredrVr|�centdirrB�flagsra�t�drrrrr0s�











��

���
zZipFile._RealGetContentscCsdd�|jD�S)NcSsg|]
}|j�qSrr�)�.0rVrrr�
<listcomp>�sz$ZipFile.namelist.<locals>.<listcomp>�r\r�rrr�namelist~szZipFile.namelistcCs|jSr�r�r�rrr�infolist�szZipFile.infolistcCsLtdd|d�|jD]0}d|jdd�}td|j||jf|d�qdS)Nz%-46s %19s %12s)z	File NamezModified    ZSize�rz%d-%02d-%02d %02d:%02d:%02dr"z
%-46s %s %12d)r}r\rdrBrq)r�rr��daterrr�printdir�s�
�zZipFile.printdirc
Cs^d}|jD]N}z*|�|jd��}|�|�r,q W5QRXWq
tk
rV|jYSXq
dS)Nir_)r\rArBr>r)r�Z
chunk_sizer��frrr�testzip�s

zZipFile.testzipcCs$|j�|�}|dkr td|��|S)Nz(There is no item named %r in the archive)r]r��KeyError)r�r!�inforrr�getinfo�s�zZipFile.getinfocCs6|r t|t�s tdt|�j��|r,||_nd|_dS)N�pwd: expected bytes, got %s)r�r��	TypeErrorrwrr�)r�r�rrr�setpassword�s
zZipFile.setpasswordcCs|jSr�)rjr�rrrrb�szZipFile.commentcCs^t|t�stdt|�j��t|�tkrNddl}|jdtdd�|dt�}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr��
stacklevelT)r�r�r�rwrr0�ZIP_MAX_COMMENT�warnings�warnrjrh)r�rbr�rrrrb�s
��c
Cs.|�|d|��}|��W5QR�SQRXdS�Nr_�rAr>)r�r!r�r<rrrr>�szZipFile.readF��force_zip64cs|dkrtd��|r0t|t�s0tdt|�j��|rD|dkrDtd���jsRtd��t|t�rb|}n,|dkr�t|�}�j|_	�j
|_n
��|�}|dkr��j
||d�S�jr�td���jd	7_t�j|j�j�j�fd
d��}�z|�t�}t|�tk�rtd��t�t|�}|ttk�r&td
��|�|t�}|t�rL|�|t�|jd@�r`t d��|jd@�rtt d��|t!d@�r�|�"d�}	n
|�"d�}	|	|j#k�r�td|j#|f��|jd	@}
|
�r�|�s҈j$}|�s�t%d|��nd}t&||||d�WS|�'��YnXdS)N>r`r_zopen() requires mode "r" or "w"r�r`z'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedr�rrcs�jSr�)rrr�rr�<lambda>�r-zZipFile.open.<locals>.<lambda>zTruncated file headerz Bad magic number for file header� z$compressed patched data (flag bit 5)�@zstrong encryption (flag bit 6)r�r�r{z/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionT)(r|r�r�r�rwrr<r
r�rer�rfr��_open_to_writerrorrnrsrr>�sizeFileHeaderr0rrFr/r��
_FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHrjr��_FH_GENERAL_PURPOSE_FLAG_BITSr�rcr�r�rr	)r�r!r r�r�r�Zzef_fileZfheader�fnameZ	fname_strZis_encryptedrr�rrA�s~�




�


��
�zZipFile.opencCs�|r|jstd��|jr td��t|d�s0d|_d|_d|_d|_|jt	krZ|jdO_|j
sn|jdO_|jszd|_|jo�|p�|jdtk}|j
r�|j
�|j�|j
��|_|�|�d	|_|j
�|�|��d	|_t|||�S)
NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rqrrr��g�������?T)rgr|rr@rqrprorjrerr$rmr�r<rDr[rZrn�_writecheckrhrr�rO)r�r�r�r�rrrr�(s8
�

�
zZipFile._open_to_writecCs*|dkrt��}n
t�|�}|�|||�Sr�)ry�getcwdr��_extract_member)r��memberr�r�rrr�extractSs

zZipFile.extractcCsH|dkr|��}|dkr"t��}n
t�|�}|D]}|�|||�q0dSr�)r�ryr�r�r�)r�r��membersr�r,rrr�
extractall`s

zZipFile.extractallcCs^|j}|s(d}t�|dt|��}||_|�|�}dd�|�|�D�}|�dd�|D��}|S)Nz:<>|"?*�_css|]}|�d�VqdS)�.N)�rstrip�r�rarrr�	<genexpr>{sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdSr�rr�rrrr�}s)�!_windows_illegal_name_trans_tablerl�	maketransr0�	translate�splitr2)r�r��pathsep�tableZillegalrrr�_sanitize_windows_nameqs
zZipFile._sanitize_windows_namec
sLt|t�s|�|�}|j�dtjj�}tjjrB|�tjjtjj�}tj�	|�d}dtjj
tjjf�tjj��fdd�|�
tjj�D��}tjjdkr�|�|tjj�}tj�||�}tj�|�}tj�|�}|r�tj�|�s�t�|�|���rtj�|��st�|�|S|j||d��(}t|d��}t�||�W5QRXW5QRX|S)	Nrvrr�c3s|]}|�kr|VqdSr�rr��Zinvalid_path_partsrrr��s�z*ZipFile._extract_member.<locals>.<genexpr>�\)r�rf)r�r
r�rBr{ryr�rzr�r��curdir�pardirr2r�r�r��dirname�exists�makedirsr�r��mkdirrA�shutil�copyfileobj)r�r�Z
targetpathr�r�Z	upperdirs�source�targetrr�rr��s2

&


� zZipFile._extract_membercCs�|j|jkr(ddl}|jd|jdd�|jdkr:td��|jsHtd��t|j�|j	s�d}t
|j�tkrpd}n|j
tkr�d	}n|jtkr�d
}|r�t|d��dS)NrzDuplicate name: %rrr��r`rarbz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed�Files countZFilesizezZipfile size� would require ZIP64 extensions)rBr]r�r�r r|r<r�rergr0r\�ZIP_FILECOUNT_LIMITrqr�rnr
)r�r�r��requires_zip64rrrr��s,
�


�zZipFile._writecheckc
CsP|jstd��|jrtd��tj|||jd�}|��rDd|_d|_n0|dk	rT||_	n|j
|_	|dk	rl||_n|j|_|���r|j
��|jr�|j�|j�|j��|_|j	tkr�|jdO_|�|�d|_|j�|�||j|j<|j�|�d��|j��|_W5QRXn<t|d��,}|�|d	��}t�||d
�W5QRXW5QRXdS)N�7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsr�rrTFr?r`i ) r<r|rr
r�rkr�rprorer�rfr�rr$rDr[rZrnrrjr�rhr\r1r]rBrr�rAr�r�)r�rBr�rer�r��src�destrrrr�sF���


z
ZipFile.writec
Cs�t|t�r|�d�}t|t�sxt|t�t���dd�d�}|j|_|j|_	|j
ddkrpd|_|jdO_q|d|_n|}|js�t
d	��|jr�t
d
��|dk	r�||_|dk	r�||_	t|�|_|j�*|j|dd��}|�|�W5QRXW5QRXdS)
Nr�r")rBrdr�rvi�Ar)r�r�z?Can't write to ZIP archive while an open writing handle exists.r`)r )r�rlr�r
r�r�r�rer�rfrBrmr<r|rr0rqrrAr)r�Zzinfo_or_arcnamerVrer�r�r�rrr�writestr�s:


���
zZipFile.writestrcCs|��dSr�rvr�rrr�__del__szZipFile.__del__c	Cs||jdkrdS|jrtd��zB|jdkr\|jr\|j�"|jrJ|j�|j	�|�
�W5QRXW5|j}d|_|�|�XdS)NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r�)r<rr|rsr rhrr$rDr[�_write_end_recordrrrrr	s
z
ZipFile.closecCs�|jD�]D}|j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}g}|jtksr|jtkr�|�|j�|�|j�d
}d
}n|j}|j}|jtkr�|�|j�d
}n|j}|j}	d}
|�rt|	d�}	t	j
dd
t|�ddt|�f|��|	}	t}
|j
tk�r$tt|
�}
n|j
tk�r:tt|
�}
t|
|j�}t|
|j�}zZ|��\}
}t	�
tt||j||j||j
|||j||t|
�t|	�t|j�d|j|j|�}Wnltk
�rttt||j||j|j |j
|||j||t|j!�t|	�t|j�d|j|j|ft"j#d��YnX|j$�%|�|j$�%|
�|j$�%|	�|j$�%|j�q|j$�&�}t|j�}||j'}|j'}d}|t(k�r�d}n|tk�r�d}n|tk�r�d}|�r$|j)�s�t*|d��t	�
t+t,ddddd||||�}|j$�%|�t	�
t-t.d|d�}|j$�%|�t/|d�}t/|d
�}t/|d
�}t	�
t0t1dd||||t|j2��	}|j$�%|�|j$�%|j2�|j3dk�rt|j$�4�|j$�5�dS)Nrrur$rr!rrr&r r�)rr,�Qrr�r�zCentral directory offsetzCentral directory sizer��,rrrb)6r\rdrqr�rpr1rnr3r8rFr�r0r�rerr_r�rr�rhrWr�r�r�rgrirorbrlrm�DeprecationWarningr}rjrBr}�stderrr<rrZr[r�rgr
rJrKrGrHrGr]r\rjr �truncater�)r�r�r�r�r�r3rqrprnZ
extra_datar�rhrWrBrjr�Zpos2ZcentDirCountZcentDirSizeZ
centDirOffsetr�Zzip64endrecZzip64locrecrUrrrr�5s$$
�


���
���





���


�
zZipFile._write_end_recordcCs&|jd8_|js"|js"|��dS�Nr)rormr	rrrrrs�szZipFile._fpclose)N)N)r_N)F)NN)NNN)NNN)NN)#rrrr<r�rr�rurzr�rrr�r�r�r�r�r�r^rb�setterr>rAr�r�r�r�r�r�r�rr�r�r	r�rsrrrrr�sR��ZN
	
		


b
+


*�
2�
)hc@s0eZdZdeddfdd�Zddd	�Zd
d�ZdS)
rr_Tr�cCstj|||||d�||_dS)N)r r�rt)rr��	_optimize)r�rr r�rt�optimizerrrr��s�zPyZipFile.__init__r�NcCs�t�|�}|rD||�sD|jr@tj�|�r,dnd}td||f�dStj�|�\}}tj�|��rhtj�|d�}tj�|��r�|r�d||f}n|}|jr�td|d|�|�	|dd	�|�\}}	|jr�td
|	�|�
||	�tt�|��}
|
�
d�|
D]�}tj�||�}tj�|�\}
}tj�|��rRtj�tj�|d���r�|j|||d�q�|dkr�|�r~||��s~|jr�td
|�q�|�	|dd	�|�\}}	|j�r�td
|	�|�
||	�q�n�|j�r�td|�tt�|��D]�}tj�||�}tj�|�\}
}|dk�r�|�r,||��s,|j�r�td
|��q�|�	|dd	�|�\}}	|j�rVtd
|	�|�
||	��q�nP|d	d�dk�r�td��|�	|dd	�|�\}}	|j�r�td|	�|�
||	�dS)Nr�rz%s %r skipped by filterfuncz__init__.py�%s/%szAdding package in�asr���ZAdding)�
filterfunc�.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)ryr�rir�r�r}r�r2�isfile�
_get_codenamer�sorted�listdir�remove�splitext�writepyr�)r��pathname�basenamer�Zlabel�dirr!Zinitnamer�r�ZdirlistrBr��rootZextrrrr��s�


��


�
�
zPyZipFile.writepyc
sd�fdd�	}|d}|d}tjj|dd�}tjj|dd�}tjj|d	d�}�jdk�r\tj�|�r�t�|�jt�|�jkr�|}	}
n�tj�|�r�t�|�jt�|�jkr�|}
|}	n�tj�|�r�t�|�jt�|�jkr�|}
|}	nvtj�|��rt�|�jt�|�jk�r|}
|}	nD||��rRt	j
jd
k�r4|}
nt	j
jdk�rH|}
n|}
|}	n|}
}	n��jd
k�rr|}
|}	n<|}	�jdk�r�|}
n&�jd	k�r�|}
nd��j�}t
|��tj�|
��r�t�|
�jt�|�jk�s�||�jd��s�|}
}	tj�|	�d}|�rd
||f}|
|fS)Nr�c
sfddl}�jrtd|�z|j|d|d�Wn4|jk
r`}zt|j�WY�dSd}~XYnXdS)NrZ	CompilingT)�doraiser�F)�
py_compilerir}�compile�PyCompileError�msg)rr�r��errr�rr�_compiles

z)PyZipFile._get_codename.<locals>._compiler�z.pycr�)�optimizationrrrz"invalid value for 'optimize': {!r})r�r�)r�)�	importlib�util�cache_from_sourcer�ryr�r�r�r�r}r�r��formatr|r�)
r�r�r�r�Zfile_pyZfile_pycZpycache_opt0Zpycache_opt1Zpycache_opt2r�r�r�Zarchivenamerr�rr��sj�
���

�zPyZipFile._get_codename)r�N)rrrrr�r�r�rrrrr�s�

RcCst�t|�dd�Sr�)�	itertools�islice�	_ancestry)r�rrr�_parentsRsrccs4|�tj�}|r0|tjkr0|Vt�|�\}}qdSr�)r��	posixpathrzr�)r��tailrrrresrcCst�t|�j|�Sr�)r�filterfalse�set�__contains__)ZminuendZ
subtrahendrrr�_differencesrcsDeZdZedd��Z�fdd�Zdd�Zdd�Zed	d
��Z	�Z
S)�CompleteDirscCs.tj�tt|��}dd�|D�}tt||��S)Ncss|]}|tjVqdSr�)rrz)r�r�rrrr��sz-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterabler�r�_deduper)�names�parentsZas_dirsrrr�
_implied_dirs�szCompleteDirs._implied_dirscs tt|���}|t|�|��Sr�)rIr
r�r^r)r�rrJrrr��szCompleteDirs.namelistcCst|���Sr�)r
r�r�rrr�	_name_set�szCompleteDirs._name_setcCs,|��}|d}||ko||k}|r(|S|S�Nrv)r)r�r!rr�Z	dir_matchrrr�resolve_dir�szCompleteDirs.resolve_dircCsNt|t�r|St|t�s ||�Sd|jkr.t}|�|�}t|��t|��|Sr�)r�r
rr �__new__�vars�update)r�r��resrrr�make�s



zCompleteDirs.make)rrr�staticmethodrr�rrr�rrNrrrJrr
�s

r
cs(eZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)�
contextlib�suppressr)Z_FastLookup__namesrIrr�r�rJrrr��szFastLookup.namelistc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)rrr)Z_FastLookup__lookuprIrrr�rJrrr�szFastLookup._name_set)rrrr�rrNrrrJrr�src@s�eZdZdZd"dd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZeZedd ��Zd!S)#rz>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})r�cCst�|�|_||_dSr�)rrr��at)r�r�r rrrr�	sz
Path.__init__cCst�|jj|j�Sr�)�	functools�partialr�rAr r�rrrrA	sz	Path.opencCst�|j�d��Sr)rr�r r�r�rrrr!	sz	Path.namec
Os6|���$}tj|f|�|���W5QR�SQRXdSr�)rAr3�
TextIOWrapperr>)r��args�kwargs�strmrrr�	read_text	s
zPath.read_textc
Cs(|���}|��W5QR�SQRXdSr�r�)r�r&rrr�
read_bytes	s
zPath.read_bytescCst�|j�d��|j�d�kSr)rr�r r�)r�r�rrr�	_is_child"	szPath._is_childcCst|j|�Sr�)rr�)r�r rrr�_next%	sz
Path._nextcCs|jp|j�d�Sr)r �endswithr�rrrr�(	szPath.is_dircCs
|��Sr�)r�r�rrr�is_file+	szPath.is_filecCs|j|j��kSr�)r r�rr�rrrr�.	szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)r�r|r�r*r�r��filterr))r�Zsubsrrr�iterdir1	szPath.iterdircCst�|jj|j�Sr�)rr2r�rBr r�rrr�__str__7	szPath.__str__cCs|jj|d�S)Nr�)�_Path__reprrr�rrrr�:	sz
Path.__repr__cCs t�|j|�}|�|j�|��Sr�)rr2r r*r�r)r��add�nextrrr�joinpath=	sz
Path.joinpathcCs(t�|j�d��}|r|d7}|�|�Sr)rr�r r�r*)r�Z	parent_atrrr�parentC	szPath.parentN)r�)rrrr0r�r^rAr!r'r(r)r*r�r,r�r.r/r�r3�__truediv__r4rrrrr�s(A


c
	s�ddl}d}|j|d�}|jdd�}|jdddd	d
�|jddd
ddd�|jdddddd�|jddddd
�|�|�}|jdk	r�|j}t|d��}|��}W5QRX|r�td�	|��td�n�|j
dk	r�|j
}t|d��}|��W5QRXn�|jdk	�r,|j\}}t|d��}|�
|�W5QRXn�|jdk	�r�|j�d�}	|j}
�fdd��t|	d��\}|
D]P}tj�|�}|�s�tj�tj�|��}|dtjtjfk�r�d}�|||��qfW5QRXdS) Nrz3A simple command-line interface for zipfile module.)�descriptionT)Zrequiredz-lz--list�	<zipfile>zShow listing of a zipfile)�metavar�helpz-ez	--extractr)r7z<output_dir>zExtract zipfile into target dir)�nargsr8r9z-cz--create�+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validr_z.The following enclosed file is corrupted: {!r}zDone testingcsptj�|�r|�||t�nPtj�|�rl|r8|�||�tt�|��D]$}�|tj�||�tj�||��qFdSr�)	ryr�r�rrr�r�r�r2)rWr��zippathZnm��addToZiprrr>s	s�zmain.<locals>.addToZipr`r�)�argparse�ArgumentParserZadd_mutually_exclusive_group�add_argument�
parse_argsZtestrr�r}rr^r�r�r�Zcreate�popryr�r�r�r�r�)
r$r?r6�parser�groupr�rWZbadfiler�Zzip_name�filesr�r<rr=r�mainK	s\
�
�
�
�




rG�__main__)N)N)�Zbinasciir!�importlib.utilr�r3rryrr�r�rFr}rpr�rr�r��ImportErrorr�r��__all__�	Exceptionrr
rrr�r�r�rrrrrr�r�r�r�r]r\r�r[rLrMrNrOrPrQrRrar~rr�r�r�r�Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ
_CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr�r�r�Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr�r�r�r�r�Z_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMr�Z_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZEr�r�rGrHrErJrKrIZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRrZZStructr.r8r=r	rXr9�objectr
r�r�r�r�r�r�r�r�r�rrr4rrOrrrr�dict�fromkeysrrr
rrrGrrrrr�<module>sj


�






+=q&�
&AN/2
=
socketserver.cpython-38.pyc000064400000061423151450073350011724 0ustar00U

e5d�j�	@sdZdZddlZddlZddlZddlZddlZddlmZddl	m
Z	dddd	d
ddd
dg	Zeed�rxe�
dddg�eed�r�e�
ddddg�eed�r�ejZnejZGdd�d�ZGdd�de�ZGdd�de�Zeed�r�Gdd�d�ZGdd�de�ZGdd �d �ZGd!d�d�Zeed��rNGd"d�dee�ZGd#d�dee�ZGd$d	�d	ee�ZGd%d
�d
ee�Zeed��r�Gd&d�de�ZGd'd�de�ZGd(d�dee�ZGd)d�dee�Z Gd*d�d�Z!Gd+d�de!�Z"Gd,d-�d-e�Z#Gd.d
�d
e!�Z$dS)/aqGeneric socket server classes.

This module tries to capture the various aspects of defining a server:

For socket-based servers:

- address family:
        - AF_INET{,6}: IP (Internet Protocol) sockets (default)
        - AF_UNIX: Unix domain sockets
        - others, e.g. AF_DECNET are conceivable (see <socket.h>
- socket type:
        - SOCK_STREAM (reliable stream, e.g. TCP)
        - SOCK_DGRAM (datagrams, e.g. UDP)

For request-based servers (including socket-based):

- client address verification before further looking at the request
        (This is actually a hook for any processing that needs to look
         at the request before anything else, e.g. logging)
- how to handle multiple requests:
        - synchronous (one request is handled at a time)
        - forking (each request is handled by a new process)
        - threading (each request is handled by a new thread)

The classes in this module favor the server type that is simplest to
write: a synchronous TCP/IP server.  This is bad class design, but
saves some typing.  (There's also the issue that a deep class hierarchy
slows down method lookups.)

There are five classes in an inheritance diagram, four of which represent
synchronous servers of four types:

        +------------+
        | BaseServer |
        +------------+
              |
              v
        +-----------+        +------------------+
        | TCPServer |------->| UnixStreamServer |
        +-----------+        +------------------+
              |
              v
        +-----------+        +--------------------+
        | UDPServer |------->| UnixDatagramServer |
        +-----------+        +--------------------+

Note that UnixDatagramServer derives from UDPServer, not from
UnixStreamServer -- the only difference between an IP and a Unix
stream server is the address family, which is simply repeated in both
unix server classes.

Forking and threading versions of each type of server can be created
using the ForkingMixIn and ThreadingMixIn mix-in classes.  For
instance, a threading UDP server class is created as follows:

        class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass

The Mix-in class must come first, since it overrides a method defined
in UDPServer! Setting the various member variables also changes
the behavior of the underlying server mechanism.

To implement a service, you must derive a class from
BaseRequestHandler and redefine its handle() method.  You can then run
various versions of the service by combining one of the server classes
with your request handler class.

The request handler class must be different for datagram or stream
services.  This can be hidden by using the request handler
subclasses StreamRequestHandler or DatagramRequestHandler.

Of course, you still have to use your head!

For instance, it makes no sense to use a forking server if the service
contains state in memory that can be modified by requests (since the
modifications in the child process would never reach the initial state
kept in the parent process and passed to each child).  In this case,
you can use a threading server, but you will probably have to use
locks to avoid two requests that come in nearly simultaneous to apply
conflicting changes to the server state.

On the other hand, if you are building e.g. an HTTP server, where all
data is stored externally (e.g. in the file system), a synchronous
class will essentially render the service "deaf" while one request is
being handled -- which may be for a very long time if a client is slow
to read all the data it has requested.  Here a threading or forking
server is appropriate.

In some cases, it may be appropriate to process part of a request
synchronously, but to finish processing in a forked child depending on
the request data.  This can be implemented by using a synchronous
server and doing an explicit fork in the request handler class
handle() method.

Another approach to handling multiple simultaneous requests in an
environment that supports neither threads nor fork (or where these are
too expensive or inappropriate for the service) is to maintain an
explicit table of partially finished requests and to use a selector to
decide which request to work on next (or whether to handle a new
incoming request).  This is particularly important for stream services
where each client can potentially be connected for a long time (if
threads or subprocesses cannot be used).

Future work:
- Standard classes for Sun RPC (which uses either UDP or TCP)
- Standard mix-in classes to implement various authentication
  and encryption schemes

XXX Open problems:
- What to do with out-of-band data?

BaseServer:
- split generic "request" functionality out into BaseServer class.
  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>

  example: read entries from a SQL database (requires overriding
  get_request() to return a table entry from the database).
  entry is processed by a RequestHandlerClass.

z0.4�N)�BufferedIOBase)�	monotonic�
BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�PollSelectorc@s�eZdZdZdZdd�Zdd�Zd&dd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra�Base class for server classes.

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you do not use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - server_close()
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - service_actions()
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - allow_reuse_address

    Instance variables:

    - RequestHandlerClass
    - socket

    NcCs ||_||_t��|_d|_dS)�/Constructor.  May be extended, do not override.FN)�server_address�RequestHandlerClass�	threadingZEvent�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrr�r�$/usr/lib64/python3.8/socketserver.py�__init__�s
zBaseServer.__init__cCsdS�zSCalled by constructor to activate the server.

        May be overridden.

        Nr�rrrr�server_activate�szBaseServer.server_activate��?c	Cst|j��zRt��B}|�|tj�|jsP|�|�}|jr:qP|rF|�	�|�
�q"W5QRXW5d|_|j��XdS)z�Handle one request at a time until shutdown.

        Polls for shutdown every poll_interval seconds. Ignores
        self.timeout. If you need to do periodic tasks, do them in
        another thread.
        FN)r�clearr�set�_ServerSelector�register�	selectors�
EVENT_READ�select�_handle_request_noblock�service_actions)rZ
poll_interval�selector�readyrrr�
serve_forever�s

zBaseServer.serve_forevercCsd|_|j��dS)z�Stops the serve_forever loop.

        Blocks until the loop has finished. This must be called while
        serve_forever() is running in another thread, or it will
        deadlock.
        TN)rr�waitr"rrr�shutdown�szBaseServer.shutdowncCsdS)z�Called by the serve_forever() loop.

        May be overridden by a subclass / Mixin to implement any code that
        needs to be run during the loop.
        Nrr"rrrr-�szBaseServer.service_actionsc
Cs�|j��}|dkr|j}n|jdk	r0t||j�}|dk	rBt�|}t��f}|�|tj�|�	|�}|rz|�
�W5QR�S|dk	rX|t�}|dkrX|��W5QR�SqXW5QRXdS)zOHandle one request, possibly blocking.

        Respects self.timeout.
        Nr)�socketZ
gettimeout�timeout�min�timer'r(r)r*r+r,�handle_timeout)rr4Zdeadliner.r/rrr�handle_requests 




zBaseServer.handle_requestcCs�z|��\}}Wntk
r&YdSX|�||�r�z|�||�Wq�tk
rn|�||�|�|�Yq�|�|��Yq�Xn
|�|�dS)z�Handle one request, without blocking.

        I assume that selector.select() has returned that the socket is
        readable before this function was called, so there should be no risk of
        blocking in get_request().
        N)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r�request�client_addressrrrr,/s

z"BaseServer._handle_request_noblockcCsdS)zcCalled if no new request arrives within self.timeout.

        Overridden by ForkingMixIn.
        Nrr"rrrr7FszBaseServer.handle_timeoutcCsdS)znVerify the request.  May be overridden.

        Return True if we should proceed with this request.

        Trr@rrrr;MszBaseServer.verify_requestcCs|�||�|�|�dS)zVCall finish_request.

        Overridden by ForkingMixIn and ThreadingMixIn.

        N)�finish_requestr?r@rrrr<UszBaseServer.process_requestcCsdS�zDCalled to clean-up the server.

        May be overridden.

        Nrr"rrr�server_close^szBaseServer.server_closecCs|�|||�dS)z8Finish one request by instantiating RequestHandlerClass.N)rr@rrrrCfszBaseServer.finish_requestcCs|�|�dS�z3Called to shutdown and close an individual request.N��
close_request�rrArrrr?jszBaseServer.shutdown_requestcCsdS�z)Called to clean up an individual request.NrrIrrrrHnszBaseServer.close_requestcCs@tdtjd�td|tjd�ddl}|��tdtjd�dS)ztHandle an error gracefully.  May be overridden.

        The default is to print a traceback and continue.

        z(----------------------------------------)�filez4Exception happened during processing of request fromrN)�print�sys�stderr�	traceback�	print_exc)rrArBrOrrrr>rs�zBaseServer.handle_errorcCs|S�Nrr"rrr�	__enter__szBaseServer.__enter__cGs|��dSrQ)rE)r�argsrrr�__exit__�szBaseServer.__exit__)r$)�__name__�
__module__�__qualname__�__doc__r4r r#r0r2r-r8r,r7r;r<rErCr?rHr>rRrTrrrrr�s&+

	
c@sfeZdZdZejZejZdZ	dZ
ddd�Zdd�Zd	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�ZdS)ra3Base class for various socket-based server classes.

    Defaults to synchronous IP stream (i.e., TCP).

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass, bind_and_activate=True)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you don't use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - request_queue_size (only for stream sockets)
    - allow_reuse_address

    Instance variables:

    - server_address
    - RequestHandlerClass
    - socket

    �FTcCsTt�|||�t�|j|j�|_|rPz|��|��Wn|���YnXdS)rN)rr r3�address_family�socket_type�server_bindr#rE)rrrZbind_and_activaterrrr �s�zTCPServer.__init__cCs8|jr|j�tjtjd�|j�|j�|j��|_dS)zOCalled by constructor to bind the socket.

        May be overridden.

        �N)�allow_reuse_addressr3�
setsockoptZ
SOL_SOCKETZSO_REUSEADDRZbindrZgetsocknamer"rrrr\�szTCPServer.server_bindcCs|j�|j�dSr!)r3Zlisten�request_queue_sizer"rrrr#�szTCPServer.server_activatecCs|j��dSrD)r3�closer"rrrrE�szTCPServer.server_closecCs
|j��S)zMReturn socket file number.

        Interface required by selector.

        )r3�filenor"rrrrb�szTCPServer.filenocCs
|j��S)zYGet the request and client address from the socket.

        May be overridden.

        )r3Zacceptr"rrrr9�szTCPServer.get_requestcCs4z|�tj�Wntk
r$YnX|�|�dSrF)r2r3ZSHUT_WRr:rHrIrrrr?�s
zTCPServer.shutdown_requestcCs|��dSrJ)rarIrrrrH�szTCPServer.close_requestN)T)rUrVrWrXr3ZAF_INETrZZSOCK_STREAMr[r`r^r r\r#rErbr9r?rHrrrrr�s-


c@s>eZdZdZdZejZdZdd�Z	dd�Z
dd	�Zd
d�ZdS)
rzUDP server class.Fi cCs |j�|j�\}}||jf|fSrQ)r3Zrecvfrom�max_packet_size)r�dataZclient_addrrrrr9szUDPServer.get_requestcCsdSrQrr"rrrr#szUDPServer.server_activatecCs|�|�dSrQrGrIrrrr?szUDPServer.shutdown_requestcCsdSrQrrIrrrrHszUDPServer.close_requestN)
rUrVrWrXr^r3Z
SOCK_DGRAMr[rcr9r#r?rHrrrrrscsVeZdZdZdZdZdZdZdd�dd	�Zd
d�Z	dd
�Z
dd�Z�fdd�Z�Z
S)rz5Mix-in class to handle each request in a new process.i,N�(TF��blockingc	Cs�|jdkrdSt|j�|jkrvz t�dd�\}}|j�|�Wqtk
r\|j��Yqtk
rrYqvYqXq|j�	�D]f}z.|r�dntj
}t�||�\}}|j�|�Wq�tk
r�|j�|�Yq�tk
r�Yq�Xq�dS)z7Internal routine to wait for children that have exited.N���r)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr%r:�copy�WNOHANG)rrg�pid�_�flagsrrr�collect_children(s&
zForkingMixIn.collect_childrencCs|��dS)zvWait for zombies after self.timeout seconds of inactivity.

            May be extended, do not override.
            N�rur"rrrr7KszForkingMixIn.handle_timeoutcCs|��dS)z�Collect the zombie child processes regularly in the ForkingMixIn.

            service_actions is called in the BaseServer's serve_forever loop.
            Nrvr"rrrr-RszForkingMixIn.service_actionscCs�t��}|r8|jdkrt�|_|j�|�|�|�dSd}z:z|�||�d}Wn t	k
rr|�
||�YnXW5z|�|�W5t�|�XXdS)z-Fork a new subprocess to process the request.Nr]r)rlr
rir&�addrH�_exitr?rCr=r>)rrArBrrZstatusrrrr<Ys 

zForkingMixIn.process_requestcst���|j|jd�dS)Nrf)�superrEru�block_on_closer"��	__class__rrrErs
zForkingMixIn.server_close)rUrVrWrXr4rirkrzrur7r-r<rE�
__classcell__rrr{rrs#cs8eZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�ZS)
�_Threadsz2
    Joinable list of all non-daemon threads.
    cs"|��|jrdSt��|�dSrQ)�reap�daemonry�append�r�threadr{rrr�{sz_Threads.appendcCsg|dd�|dd�<}|SrQr)r�resultrrr�pop_all�sz_Threads.pop_allcCs|��D]}|��qdSrQ)r��joinr�rrrr��sz
_Threads.joincCsdd�|D�|dd�<dS)Ncss|]}|��r|VqdSrQ)Zis_alive)�.0r�rrr�	<genexpr>�sz _Threads.reap.<locals>.<genexpr>rr"rrrr�sz
_Threads.reap)	rUrVrWrXr�r�r�rr}rrr{rr~ws
r~c@s eZdZdZdd�Zdd�ZdS)�
_NoThreadsz)
    Degenerate version of _Threads.
    cCsdSrQrr�rrrr��sz_NoThreads.appendcCsdSrQrr"rrrr��sz_NoThreads.joinN)rUrVrWrXr�r�rrrrr��sr�cs>eZdZdZdZdZe�Zdd�Zdd�Z	�fdd	�Z
�ZS)
rz4Mix-in class to handle each request in a new thread.FTc	CsHz6z|�||�Wn tk
r2|�||�YnXW5|�|�XdS)zgSame as in BaseServer but as a thread.

        In addition, exception handling is done here.

        N)r?rCr=r>r@rrr�process_request_thread�s
z%ThreadingMixIn.process_request_threadcCsL|jrt|��dt��tj|j||fd�}|j|_|j	�
|�|��dS)z*Start a new thread to process the request.�_threads)�targetrSN)rz�vars�
setdefaultr~rZThreadr��daemon_threadsr�r�r��start)rrArB�trrrr<�s�zThreadingMixIn.process_requestcst���|j��dSrQ)ryrEr�r�r"r{rrrE�s
zThreadingMixIn.server_close)rUrVrWrXr�rzr�r�r�r<rEr}rrr{rr�s

c@seZdZdS)rN�rUrVrWrrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZejZdS)rN�rUrVrWr3rrZrrrrr�sc@seZdZejZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r	a�Base class for request handler classes.

    This class is instantiated for each request to be handled.  The
    constructor sets the instance variables request, client_address
    and server, and then calls the handle() method.  To implement a
    specific service, all you need to do is to derive a class which
    defines a handle() method.

    The handle() method can find the request as self.request, the
    client address as self.client_address, and the server (in case it
    needs access to per-server information) as self.server.  Since a
    separate instance is created for each request, the handle() method
    can define other arbitrary instance variables.

    cCs6||_||_||_|��z|��W5|��XdSrQ)rArB�server�setup�finish�handle)rrArBr�rrrr �szBaseRequestHandler.__init__cCsdSrQrr"rrrr��szBaseRequestHandler.setupcCsdSrQrr"rrrr��szBaseRequestHandler.handlecCsdSrQrr"rrrr��szBaseRequestHandler.finishN)rUrVrWrXr r�r�r�rrrrr	�s

c@s0eZdZdZdZdZdZdZdd�Zdd	�Z	dS)
r
z4Define self.rfile and self.wfile for stream sockets.rhrNFcCsz|j|_|jdk	r |j�|j�|jr:|j�tjtjd�|j�	d|j
�|_|jdkrdt
|j�|_n|j�	d|j�|_dS)NT�rbr�wb)rAZ
connectionr4Z
settimeout�disable_nagle_algorithmr_r3ZIPPROTO_TCPZTCP_NODELAYZmakefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler"rrrr�s

�
zStreamRequestHandler.setupcCsF|jjs.z|j��Wntjk
r,YnX|j��|j��dSrQ)r��closed�flushr3�errorrar�r"rrrr�#s
zStreamRequestHandler.finish)
rUrVrWrXr�r�r4r�r�r�rrrrr
s	
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�z�Simple writable BufferedIOBase implementation for a socket

    Does not hold data in a buffer, avoiding any need to call flush().cCs
||_dSrQ)�_sock)rZsockrrrr 3sz_SocketWriter.__init__cCsdS)NTrr"rrr�writable6sz_SocketWriter.writablec
Cs2|j�|�t|��}|jW5QR�SQRXdSrQ)r�Zsendall�
memoryview�nbytes)r�bZviewrrr�write9s
z_SocketWriter.writecCs
|j��SrQ)r�rbr"rrrrb>sz_SocketWriter.filenoN)rUrVrWrXr r�r�rbrrrrr�.s
r�c@s eZdZdZdd�Zdd�ZdS)rz6Define self.rfile and self.wfile for datagram sockets.cCs2ddlm}|j\|_|_||j�|_|�|_dS)Nr)�BytesIO)�ior�rAZpacketr3r�r�)rr�rrrr�EszDatagramRequestHandler.setupcCs|j�|j��|j�dSrQ)r3Zsendtor��getvaluerBr"rrrr�KszDatagramRequestHandler.finishN)rUrVrWrXr�r�rrrrrAs)%rX�__version__r3r)rlrMrr�rr6r�__all__�hasattr�extendrr'ZSelectSelectorrrrr�listr~r�rrrrrrrrrr	r
r�rrrrr�<module>sbz�

�
n~
X(.-statistics.cpython-38.opt-2.pyc000064400000042242151450073350012335 0ustar00U

e5d
��@sjdddddddddd	d
ddd
dddgZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZddlm
Z
mZmZmZmZmZmZmZddlmZddlmZGdd�de�Zdcdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!ddd*d+�Z"d,d�Z#d-d�Z$d.d�Z%d/d�Z&d0d�Z'd1d	�Z(d2d�Z)ded4d�Z*d5d
�Z+d6d�Z,d7d8d9�d:d�Z-dfd;d<�Z.dgd=d�Z/dhd>d
�Z0did?d�Z1djd@d�Z2dAdB�Z3GdCd�d�Z4zddDl5m3Z3Wne6k
�r�YnXe7dEk�rfddFlm8Z8ddGlm9Z9m:Z:m;Z;m<Z<ddHlm=Z=ddl>Z>e4dIdJ�Z?e4dKdL�Z@dMZAe?�BeA�ZCe@�BeA�ZDe9e:fD]<ZEeFdNeEj7�dO��eFeEe?e@��eFe4�GeHeEeCeD����qNdPZIe9e:e;e<fD]@ZEeFdNeEj7�dQ��eFeEe?eI��eFe4�GeHeEeCe=eI�����q�dRZIe9e:e;fD]@ZEeFdSeEj7�dT��eFeEeIe?��eFe4�GeHeEe=eI�eC����q�dUdV�ZJe4dWdX�ZKe4dYdZ�ZLd[ZMdMZAe4�Gd\d]�eK�BeA�D��ZNeJeKeMeN�e4�Gd^d]�eK�BeA�D��ZNeJeKeMeN�e4�Gd_d]�eK�BeA�D��ZNeJeKeMeN�e4�Gd`d]�eK�BeA�D��ZNeJeKeMeN�e4�Gdad]�eOeK�BeA�eL�BeA��D��ZNeJeKeLeN�e4�Gdbd]�eOeK�BeA�eL�BeA��D��ZNeJeKeLeN�eFe>�P��dS)k�
NormalDist�StatisticsError�fmean�geometric_mean�
harmonic_mean�mean�median�median_grouped�median_high�
median_low�mode�	multimode�pstdev�	pvariance�	quantiles�stdev�variance�N��Fraction)�Decimal)�groupby)�bisect_left�bisect_right)�hypot�sqrt�fabs�exp�erf�tau�log�fsum)�
itemgetter)�Counterc@seZdZdS)rN)�__name__�
__module__�__qualname__�r&r&�"/usr/lib64/python3.8/statistics.pyruscCs�d}t|�\}}||i}|j}ttt|��}t|t�D]@\}}	t||�}tt|	�D]"\}}|d7}||d�|||<qRq6d|kr�|d}
ntdd�t|�	��D��}
||
|fS)Nr�css|]\}}t||�VqdS�Nr)�.0�d�nr&r&r'�	<genexpr>�sz_sum.<locals>.<genexpr>)
�_exact_ratio�get�_coerce�int�typer�map�sum�sorted�items)�data�start�countr,r+ZpartialsZpartials_get�T�typ�values�totalr&r&r'�_sum{s$
r>cCs.z
|��WStk
r(t�|�YSXdSr))Z	is_finite�AttributeError�mathZisfinite)�xr&r&r'�	_isfinite�s
rBcCs�||kr|S|tks|tkr |S|tkr,|St||�r:|St||�rH|St|t�rV|St|t�rd|St|t�r|t|t�r||St|t�r�t|t�r�|Sd}t||j|jf��dS)Nz"don't know how to coerce %s and %s)r1�bool�
issubclassr�float�	TypeErrorr#)r:�S�msgr&r&r'r0�s(



r0cCs�zrt|�tkst|�tkr$|��WSz|j|jfWWStk
rnz|��WYWStk
rhYnXYnXWn ttfk
r�|dfYSXd}t	|�
t|�j���dS)Nz0can't convert type '{}' to numerator/denominator)r2rEr�as_integer_ratio�	numerator�denominatorr?�
OverflowError�
ValueErrorrF�formatr#)rArHr&r&r'r.�s
r.cCspt|�|kr|St|t�r(|jdkr(t}z
||�WStk
rjt|t�rd||j�||j�YS�YnXdS)Nr()r2rDr1rKrErFrrJ)�valuer:r&r&r'�_convert�s

rPcCs.t||�}|t|�kr&|||kr&|St�dSr))r�lenrM)�arA�ir&r&r'�
_find_lteq
s
rTcCs>t|||d�}|t|�dkr6||d|kr6|dSt�dS)N)�lor()rrQrM)rR�lrArSr&r&r'�
_find_rteqs rW�negative valueccs$|D]}|dkrt|��|VqdS)Nr)r)r<�errmsgrAr&r&r'�	_fail_negsrZcCsHt|�|krt|�}t|�}|dkr,td��t|�\}}}t|||�S)Nr(z%mean requires at least one data point)�iter�listrQrr>rP)r7r,r:r=r9r&r&r'r'scstzt|��Wn0tk
r<d��fdd�}t||��}Yn
Xt|�}z
|�WStk
rntd�d�YnXdS)Nrc3s t|dd�D]\�}|VqdS)Nr()r8)�	enumerate)�iterablerA�r,r&r'r9Oszfmean.<locals>.countz&fmean requires at least one data point)rQrFr �ZeroDivisionErrorr)r7r9r=r&r_r'rAs	
cCs8ztttt|���WStk
r2td�d�YnXdS)NzHgeometric mean requires a non-empty dataset  containing positive numbers)rrr3rrMr)r7r&r&r'r\s�cCs�t|�|krt|�}d}t|�}|dkr2td��n<|dkrn|d}t|tjtf�rf|dkrbt|��|Std��z"t	dd�t
||�D��\}}}Wntk
r�YdSXt|||�S)Nz.harmonic mean does not support negative valuesr(z.harmonic_mean requires at least one data pointrzunsupported typecss|]}d|VqdS)r(Nr&�r*rAr&r&r'r-�sz harmonic_mean.<locals>.<genexpr>)
r[r\rQr�
isinstance�numbersZRealrrFr>rZr`rP)r7rYr,rAr:r=r9r&r&r'ros$
"cCs\t|�}t|�}|dkr td��|ddkr8||dS|d}||d||dSdS�Nr�no median for empty data�r(�r5rQr)r7r,rSr&r&r'r�s
cCsLt|�}t|�}|dkr td��|ddkr8||dS||ddSdSrdrg�r7r,r&r&r'r
�scCs,t|�}t|�}|dkr td��||dS)Nrrerfrgrhr&r&r'r	�s
r(c
Cs�t|�}t|�}|dkr"td��n|dkr2|dS||d}||fD]}t|ttf�rFtd|��qFz||d}Wn(tk
r�t|�t|�d}YnXt||�}t	|||�}|}||d}	|||d||	S)Nrrer(rfzexpected number but got %r)
r5rQrrb�str�bytesrFrErTrW)
r7Zintervalr,rA�obj�L�l1�l2Zcf�fr&r&r'r�s&

cCsHt|�}t|��d�}z|ddWStk
rBtd�d�YnXdS)Nr(rzno mode for empty data)r[r"�most_common�
IndexErrorr)r7Zpairsr&r&r'rscCs@tt|����}tt|td�d�dgf�\}}tttd�|��S)Nr()�keyr)r"r[rp�nextrr!r\r3)r7ZcountsZmaxcountZ
mode_itemsr&r&r'r5s
��	exclusive)r,�methodc
CsL|dkrtd��t|�}t|�}|dkr0td��|dkr�|d}g}td|�D]N}|||}||||}||||||d||}	|�|	�qN|S|dk�r:|d}g}td|�D]r}|||}|dkr�dn||dkr�|dn|}||||}||d||||||}	|�|	�q�|Std|����dS)Nr(zn must be at least 1rfz"must have at least two data pointsZ	inclusiveruzUnknown method: )rr5rQ�range�appendrM)
r7r,rvZld�m�resultrS�jZdeltaZinterpolatedr&r&r'rls4$
$$cs��dk	r,t�fdd�|D��\}}}||fSt|��t�fdd�|D��\}}}t�fdd�|D��\}}}||dt|�8}||fS)Nc3s|]}|�dVqdS�rfNr&ra��cr&r'r-�sz_ss.<locals>.<genexpr>c3s|]}|�dVqdSr|r&rar}r&r'r-�sc3s|]}|�VqdSr)r&rar}r&r'r-�srf)r>rrQ)r7r~r:r=r9�UZtotal2Zcount2r&r}r'�_ss�sr�cCsLt|�|krt|�}t|�}|dkr,td��t||�\}}t||d|�S)Nrfz*variance requires at least two data pointsr(�r[r\rQrr�rP)r7�xbarr,r:�ssr&r&r'r�s&cCsHt|�|krt|�}t|�}|dkr,td��t||�\}}t|||�S)Nr(z*pvariance requires at least one data pointr�)r7�mur,r:r�r&r&r'r�s#cCs8t||�}z
|��WStk
r2t�|�YSXdSr))rrr?r@)r7r��varr&r&r'rs
	

cCs8t||�}z
|��WStk
r2t�|�YSXdSr))rrr?r@)r7r�r�r&r&r'r
&s
	

cCs|d}t|�dkr�d||}d|d|d|d|d|d	|d
|d|}d|d
|d|d|d|d|d|d}||}|||S|dkr�|nd|}tt|��}|dk�r^|d}d|d|d|d|d|d|d|d}d|d |d!|d"|d#|d$|d%|d}n�|d}d&|d'|d(|d)|d*|d+|d,|d-}d.|d/|d0|d1|d2|d3|d4|d}||}|dk�r�|}|||S)5N��?g333333�?g��Q��?g^�}o)��@g�E.k�R�@g ��Ul�@g*u��>l�@g�N����@g�"]Ξ@gnC���`@gu��@giK��~j�@gv��|E�@g��d�|1�@gfR��r��@g��u.2�@g���~y�@g�n8(E@��?�g@g�������?g鬷�ZaI?gg�El�D�?g7\�����?g�uS�S�?g�=�.
@gj%b�@g���Hw�@gjR�e�?g�9dh?
>g('߿��A?g��~z �?g@�3��?gɅ3��?g3fR�x�?gI�F��l@g����t��>g*�Y��n�>gESB\T?g�N;A+�?g�UR1��?gE�F���?gP�n��@g&�>���@g����i�<g�@�F�>g�tcI,\�>g�ŝ���I?g*F2�v�?g�C4�?g��O�1�?)rrr)�pr��sigma�q�rZnumZdenrAr&r&r'�_normal_dist_inv_cdf9sd���������������������������
��������������������������	��������������������������
r�c@s�eZdZddd�Zd7dd�Zedd	��Zd
d�dd
�Zdd�Zdd�Z	dd�Z
d8dd�Zdd�Ze
dd��Ze
dd��Ze
dd��Ze
dd ��Ze
d!d"��Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�ZeZd/d0�ZeZd1d2�Zd3d4�Zd5d6�Zd
S)9rz(Arithmetic mean of a normal distributionz+Standard deviation of a normal distribution)�_mu�_sigmar�r�cCs(|dkrtd��t|�|_t|�|_dS)Nr�zsigma must be non-negative)rrEr�r�)�selfr�r�r&r&r'�__init__�s
zNormalDist.__init__cCs.t|ttf�st|�}t|�}||t||��Sr))rbr\�tuplerr)�clsr7r�r&r&r'�from_samples�szNormalDist.from_samplesN)�seedcsB|dkrtjn
t�|�j�|j|j�����fdd�t|�D�S)Ncsg|]}�����qSr&r&�r*rS��gaussr�r�r&r'�
<listcomp>�sz&NormalDist.samples.<locals>.<listcomp>)�randomr�ZRandomr�r�rw)r�r,r�r&r�r'�samples�szNormalDist.samplescCs<|jd}|std��t||jdd|�tt|�S)N�@z$pdf() not defined when sigma is zerog�)r�rrr�rr)r�rArr&r&r'�pdf�s
zNormalDist.pdfcCs2|jstd��ddt||j|jtd��S)Nz$cdf() not defined when sigma is zeror�r�r�)r�rrr�r)r�rAr&r&r'�cdf�szNormalDist.cdfcCs:|dks|dkrtd��|jdkr*td��t||j|j�S)Nr�r�z$p must be in the range 0.0 < p < 1.0z-cdf() not defined when sigma at or below zero)rr�r�r�)r�r�r&r&r'�inv_cdf�s


zNormalDist.inv_cdfrtcs��fdd�td��D�S)Ncsg|]}��|���qSr&)r�r��r,r�r&r'r��sz(NormalDist.quantiles.<locals>.<listcomp>r()rw)r�r,r&r�r'r�s	zNormalDist.quantilescCst|t�std��||}}|j|jf|j|jfkr>||}}|j|j}}|rT|s\td��||}t|j|j�}|s�dt|d|jt	d��S|j||j|}|j|jt	|d|t
||��}	||	|}
||	|}dt|�|
�|�|
��t|�|�|�|��S)Nz$Expected another NormalDist instancez(overlap() not defined when sigma is zeror�r�)rbrrFr�r�rrrrrrr�)r��other�X�YZX_varZY_varZdvZdmrR�b�x1�x2r&r&r'�overlap�s"


(zNormalDist.overlapcCs|jSr)�r��r�r&r&r'r�szNormalDist.meancCs|jSr)r�r�r&r&r'r�szNormalDist.mediancCs|jSr)r�r�r&r&r'r�szNormalDist.modecCs|jSr)�r�r�r&r&r'r�szNormalDist.stdevcCs
|jdS)Nr�r�r�r&r&r'rszNormalDist.variancecCs8t|t�r&t|j|jt|j|j��St|j||j�Sr)�rbrr�rr��r�r�r&r&r'�__add__	s

zNormalDist.__add__cCs8t|t�r&t|j|jt|j|j��St|j||j�Sr)r�r�r&r&r'�__sub__s

zNormalDist.__sub__cCst|j||jt|��Sr)�rr�r�rr�r&r&r'�__mul__%szNormalDist.__mul__cCst|j||jt|��Sr)r�r�r&r&r'�__truediv__-szNormalDist.__truediv__cCst|j|j�Sr)�rr�r��r�r&r&r'�__pos__5szNormalDist.__pos__cCst|j|j�Sr)r�r�r&r&r'�__neg__9szNormalDist.__neg__cCs
||Sr)r&r�r&r&r'�__rsub__?szNormalDist.__rsub__cCs&t|t�stS|j|jko$|j|jkSr))rbr�NotImplementedr�r�r�r&r&r'�__eq__Es
zNormalDist.__eq__cCst|j|jf�Sr))�hashr�r�r�r&r&r'�__hash__KszNormalDist.__hash__cCs t|�j�d|j�d|j�d�S)Nz(mu=z, sigma=�))r2r#r�r�r�r&r&r'�__repr__OszNormalDist.__repr__)r�r�)rt)r#r$r%�	__slots__r��classmethodr�r�r�r�r�rr��propertyrrrrrr�r�r�r�r�r��__radd__r��__rmul__r�r�r�r&r&r&r'r�sD�


"




)r��__main__)�isclose)�add�sub�mul�truediv)�repeat�
�����i��z
Test z with another NormalDist:�z with a constant:�z
Test constant with �:cCsdSr)r&)�G1�G2r&r&r'�assert_closesr�i�����I��/g`@@cCsg|]}|t�qSr&��srar&r&r'r��sr�cCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]\}}||�qSr&r&�r*rA�yr&r&r'r��scCsg|]\}}||�qSr&r&r�r&r&r'r��s)r)rX)r()N)N)N)N)N)Q�__all__r@rcr�Z	fractionsrZdecimalr�	itertoolsrZbisectrrrrrrrrrr �operatorr!�collectionsr"rMrr>rBr0r.rPrTrWrZrrrrrr
r	rrrrr�rrrr
r�rZ_statistics�ImportErrorr#r�r�r�r�r�r�ZdoctestZg1Zg2r,r�r�r��func�printr�r3Zconstr�r�r�r�rG�zipZtestmodr&r&r&r'�<module>Ts��(
: 

/
779

/
,

JQ






�
�
ntpath.cpython-38.pyc000064400000034503151450073350010502 0ustar00U

e5dVl�&@s(dZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g&Z
d1d2�Zd3d�Zd4d�Zd5d
�Zd6d�Zd7d�Zd8d�Zejje_d9d�Zd:d�Zd;d�Zd<d�Zzdd=lmZWnek
�r(d	ZYnXd>d�Zd?d�Zd@d�ZdAd �Z dBdC�Z!zddDlm"Z"Wnek
�r|e!Z#Yn
XdEd!�Z#zddFlm$Z$m%Z&Wnek
�r�e#Z'YnXdGdH�Z(dIdJ�Z)dKd*�Z'e*e
dL��o�e
�+�dMdNkZ,dRdOd,�Z-dPd0�Z.zddQlm/Z0Wnek
�r"YnXd	S)Sz�Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
�.�..�\�;�/z.;C:\binZnul�N)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat�
commonpathcCst|t�rdSdSdS)N�\/�\/)�
isinstance�bytes��path�r4�/usr/lib64/python3.8/ntpath.py�
_get_bothseps"s
r6cCs8t�|�}t|t�r$|�dd���S|�dd���SdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.�/�\rrN)�os�fspathr0r1�replace�lower��sr4r4r5r,s

cCsjt�|�}t|t�r,|�dd��d�rBdSn|�dd��d�rBdSt|�d}t|�d	koh|d	t|�kS)
zTest whether a path is absoluter7r8�\\?\Trr�\\?\�r)	r9r:r0r1r;�
startswithr�lenr6r=r4r4r5r	=s

c

GsTt�|�}t|t�r"d}d}d}nd}d}d}z�|sD|dd�|t|�\}}ttj|�D]~}t|�\}}	|	r�|	d|kr�|s�|s�|}|	}q\n*|r�||kr�|��|��kr�|}|	}q\|}|r�|d|kr�||}||	}q\|�r|d|k�r|�r|dd�|k�r|||WS||WSttt	fk
�rNt
jd	|f|���YnXdS)
Nr8r.�:rr/�:r���r
)r9r:r0r1r�mapr<�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)
r3�pathsr!�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr4r4r5r
MsL


��
cCst�|�}t|�dk�rt|t�r0d}d}d}nd}d}d}|�||�}|dd�|dkr�|dd	�|kr�|�|d�}|d
kr�|dd�|fS|�||d�}||dkr�|dd�|fS|d
kr�t|�}|d|�||d�fS|dd�|k�r|dd�|dd�fS|dd�|fS)
a�Split a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    �r8r7rDrrrEr�rFNrA)r9r:rCr0r1r;�find)rPr!r$rOZnormp�indexZindex2r4r4r5r|s.

$cCsxt�|�}t|�}t|�\}}t|�}|rD||d|krD|d8}q&|d|�||d�}}|�|�pj|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.rAN)r9r:r6rrC�rstrip)rPrN�d�i�head�tailr4r4r5r�s

cCs8t�|�}t|t�r$t�|ddd�St�|ddd�SdS)Nr8r7�.rrr)r9r:r0r1rK�	_splitext�rPr4r4r5r
�s

cCst|�dS)z)Returns the final component of a pathnamerA�rr\r4r4r5r�scCst|�dS)z-Returns the directory component of a pathnamerr]r\r4r4r5r�sc
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)r9�lstat�OSError�
ValueErrorrI�stat�S_ISLNK�st_mode�r3�str4r4r5r�s
c	Cs.zt�|�}Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r9r^r_r`rdr4r4r5r�s
)�_getvolumepathnamecCstt�|�}t|�}t|�}t|�\}}|rD|d|krD|pB||kS||krPdStrl|�|�t|��|�kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r9r:r6rrrfrU)r3rN�root�restr4r4r5rs
cCs�t�|�}t|t�rd}nd}|�|�s,|Sdt|�}}||kr\||t|�kr\|d7}q:dtjkrrtjd}nFdtjkr�|Sztjd}Wntk
r�d}YnXt	|tjd�}t|t�r�t�
|�}|dkr�t	t|�|d|��}|||d�S)	zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.�~�~rAZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�N)r9r:r0r1rBrCr6�environ�KeyErrorr
�fsencoder)r3�tilderW�n�userhome�driver4r4r5r!s.








cCs2t�|�}t|t�rhd|kr(d|kr(|Sddl}t|j|jdd�}d}d}d}d	}d}ttd
d�}nFd|kr|d|kr||Sddl}|j|jd}d
}d}d}d}d}tj}|dd�}	d}
t	|�}|
|k�r.||
|
d�}||k�rX||
dd�}t	|�}z&|�
|�}
|	||d|
d�7}	Wn*tk
�rR|	||7}	|d}
YnX�n�||k�rJ||
d|
d�|k�r�|	|7}	|
d7}
n�||
dd�}t	|�}z|�
|�}
Wn*tk
�r�|	||7}	|d}
YnhX|d|
�}
z.|dk�rt�tjt�
|
��}n||
}Wn"tk
�r<||
|}YnX|	|7}	�n�||k�r||
d|
d�|k�r�|	|7}	|
d7}
�q$||
d|
d�|k�r^||
dd�}t	|�}z|�
|�}
Wn.tk
�r�|	|||7}	|d}
YnlX|d|
�}
z.|dk�r"t�tjt�
|
��}n||
}Wn&tk
�rR|||
|}YnX|	|7}	n�|dd�}
|
d7}
||
|
d�}|�r�||k�r�|
|7}
|
d7}
||
|
d�}�q�z.|dk�r�t�tjt�
|
��}n||
}Wntk
�r||
}YnX|	|7}	|�r$|
d8}
n|	|7}	|
d7}
q�|	S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rNz_-�ascii�'�{�}�environb�$�%�'�{�}rArQ)r9r:r0r1�stringZ
ascii_lettersZdigits�getattrrlrCrTr`rn�fsdecoderm)r3rZvarcharsZquoteZpercentZbraceZrbraceZdollarrl�resrTZpathlen�c�var�valuer4r4r5rQs�













c	CsPt�|�}t|t�r*d}d}d}d}d}nd}d}d}d	}d
}|�|�rL|S|�||�}t|�\}}|�|�r�||7}|�|�}|�|�}d}|t	|�k�r,||r�|||kr�||=q�|||k�r"|dkr�||d|kr�||d|d�=|d8}n&|dk�r|�
|��r||=n|d7}q�|d7}q�|�sB|�sB|�|�||�|�S)
z0Normalize path, eliminating double slashes, etc.r8r7rZ�..)s\\.\r?rrrr)z\\.\r@rrA)
r9r:r0r1rBr;r�lstriprrC�endswith�appendr
)	r3r!r$rr Zspecial_prefixes�prefix�compsrWr4r4r5r�sF









cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)z�Return the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    )	r9r:r	r0r1�getcwdb�getcwdr
r)r3�cwdr4r4r5�_abspath_fallback�s



r�)�_getfullpathnamec	Cs4ztt|��WSttfk
r.t|�YSXdS)z&Return the absolute version of a path.N)rr�r_r`r�r2r4r4r5rs)�_getfinalpathname�readlinkc
Cs�d}t�}t|�|kr�|�t|��z:|}t|�}t|�s\t|�sJ|}Wq�ttt|�|��}Wq
t	k
r�}z|j
|kr�WY�q��W5d}~XYq
tk
r�Yq�Yq
Xq
|S)N)rArQrR��� �2�C�Wi&i(i))�setr�add�_nt_readlinkr	rrr
rr_�winerrorr`)r3�allowed_winerror�seenZold_path�exr4r4r5�_readlink_deeps&
r�cCs�d}d}|r�zt|�}|r$t||�n|WStk
r�}z�|j|krF�z0t|�}||krt|rft||�n|WWY�TSWntk
r�YnXt|�\}}|r�|s�||WY�S|r�t||�n|}W5d}~XYqXq|S)N)rArQrRr�r�r�r�r�r��{i�i�rk)r�r
r_r�r�r)r3r�rYr��new_path�namer4r4r5�_getfinalpathname_nonstrictCs(
 &r�c	
Cs^t|�}t|t�rBd}d}d}t��}t|�tt�t��krjdSn(d}d}d}t��}t|�tt�krjdS|�	|�}|s�t
|�s�t||�}zt|�}d	}Wn0t
k
r�}z|j}t|�}W5d}~XYnX|�sZ|�	|��rZ|�	|�r�||t|�d�}n|t|�d�}zt|�|k�r"|}Wn4t
k
�rX}z|j|k�rH|}W5d}~XYnX|S)
Nr?s\\?\UNC\s\\s\\.\NULr@z\\?\UNC\z\\z\\.\NULr)rr0r1r9r�rrnr&r�rBr	r
r�r_r�r�rC)	r3r�Z
unc_prefixZnew_unc_prefixr�Z
had_prefixZinitial_winerrorr�Zspathr4r4r5r'qsD



�getwindowsversionrRrQcCsft�|�}t|t�r"d}d}d}nd}d}d}|dkr:|}|sFtd��t�|�}z�tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td	|	|f��d
d�|�	|�D�}dd�|
�	|�D�}d
}
t
||�D]$\}}t|�t|�kr�q�|
d7}
q�|gt|�|
||
d�}|�s(|WSt|�WSt
ttttfk
�r`t�d||��YnXdS)z#Return a relative version of a pathr8rZr�rrrNzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr4r4��.0�xr4r4r5�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr4r4r�r4r4r5r��srrAr))r9r:r0r1r`rrrrr�ziprCr
rHrIrJ�DeprecationWarningrKrL)r3�startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrWZe1Ze2�rel_listr4r4r5r)�sJ


�

c	s�|std��tttj|��}t|dt�r8d�d�d�nd�d�d��z@��fd	d
�|D�}�fdd
�|D�}zt�fdd
�|D��\}Wntk
r�td�d�YnXttdd
�|D���dkr�td��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}t|�D]*\}	}
|
||	k�r*|d|	�}�qf�q*|dt|��}|�rt|�n|}|��|�WSttfk
�r�tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr8r7rZrrrcs g|]}t|��������qSr4)rr;r<)r�rP)r$r!r4r5r��szcommonpath.<locals>.<listcomp>csg|]\}}|����qSr4r]�r�rVrP�r!r4r5r��sc3s"|]\}}|dd��kVqdS)NrAr4r�r�r4r5�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr4r�r4r4r5r��srAzPaths don't have the same drivecsg|]}|r|�kr|�qSr4r4�r�r��rr4r5r��scsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr4r4r�r�r4r5r�sz)commonpath.<locals>.<listcomp>.<listcomp>r4)r�r>r�r4r5r�sr-)r-)r`�tuplerGr9r:r0r1r�rCrr;r�min�max�	enumerater
rHrIrKrL)rMZdrivesplits�split_pathsr	rrr3�common�s1�s2rWr�r�r4)r$rr!r5r-�sF

)�_isdir)N)1�__doc__rr r%r!r"r$r#r&r9�sysrarK�__all__r6rr	r
rrr
r[rrrr�ntrf�ImportErrorrrrrr�r�rr�r�r�r'r�r��hasattrr�r(r)r-r�rr4r4r4r5�<module>s�	�
/8

0q2

*.2�
84decimal.cpython-38.opt-1.pyc000064400000000551151450073350011535 0ustar00U

e5d@�@svz0ddlTddlmZddlmZddlmZWn@ek
rpddlTddlmZddlmZddlmZYnXdS)�)�*)�__doc__)�__version__)�__libmpdec_version__N)Z_decimalrrr�ImportErrorZ
_pydecimal�rr�/usr/lib64/python3.8/decimal.py�<module>sabc.cpython-38.opt-2.pyc000064400000006216151450073350010671 0ustar00U

e5d��@s�dd�ZGdd�de�ZGdd�de�ZGdd�de�Zz,dd	lmZm	Z	m
Z
mZmZm
Z
mZmZWn*ek
r�dd
lmZmZde_YnXGdd
�d
e�ZGdd�ded�ZdS)cCs
d|_|S�NT)�__isabstractmethod__)�funcobj�r�/usr/lib64/python3.8/abc.py�abstractmethodsrcs eZdZdZ�fdd�Z�ZS)�abstractclassmethodTcsd|_t��|�dSr�r�super�__init__��self�callable��	__class__rrr
$szabstractclassmethod.__init__��__name__�
__module__�__qualname__rr
�
__classcell__rrrrrsrcs eZdZdZ�fdd�Z�ZS)�abstractstaticmethodTcsd|_t��|�dSrrrrrrr
1szabstractstaticmethod.__init__rrrrrr)src@seZdZdZdS)�abstractpropertyTN)rrrrrrrrr6sr�)�get_cache_token�	_abc_init�
_abc_register�_abc_instancecheck�_abc_subclasscheck�	_get_dump�_reset_registry�
_reset_caches)�ABCMetar�abccsNeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�Z
S)r cs"t�j||||f|�}t|�|S�N)r	�__new__r)�mcls�name�bases�	namespace�kwargs�clsrrrr#TszABCMeta.__new__cCs
t||�Sr")r�r)�subclassrrr�registerYszABCMeta.registercCs
t||�Sr")r)r)�instancerrr�__instancecheck__`szABCMeta.__instancecheck__cCs
t||�Sr")rr*rrr�__subclasscheck__dszABCMeta.__subclasscheck__NcCs�td|j�d|j��|d�tdt���|d�t|�\}}}}td|��|d�td|��|d�td|��|d�td|��|d�dS)	NzClass: �.)�filezInv. counter: z_abc_registry: z_abc_cache: z_abc_negative_cache: z_abc_negative_cache_version: )�printrrrr)r)r1�
_abc_registry�
_abc_cache�_abc_negative_cache�_abc_negative_cache_versionrrr�_dump_registryhs�
�zABCMeta._dump_registrycCst|�dSr")r�r)rrr�_abc_registry_cleartszABCMeta._abc_registry_clearcCst|�dSr")rr8rrr�_abc_caches_clearxszABCMeta._abc_caches_clear)N)rrrr#r,r.r/r7r9r:rrrrrr Gs

r c@seZdZdZdS)�ABCrN)rrr�	__slots__rrrrr;}sr;)�	metaclassN)r�classmethodr�staticmethodr�propertyr�_abcrrrrrrrr�ImportErrorZ_py_abcr r�typer;rrrr�<module>s

	,6_sitebuiltins.cpython-38.pyc000064400000006633151450073350012064 0ustar00U

e5d+�@s@dZddlZGdd�de�ZGdd�de�ZGdd�de�ZdS)	z=
The objects used by the site module to add custom builtins.
�Nc@s&eZdZdd�Zdd�Zddd�ZdS)	�QuittercCs||_||_dS�N��name�eof)�selfrr�r�%/usr/lib64/python3.8/_sitebuiltins.py�__init__szQuitter.__init__cCsd|j|jfS)NzUse %s() or %s to exitr�rrrr	�__repr__szQuitter.__repr__NcCs(ztj��WnYnXt|��dSr)�sys�stdin�close�
SystemExit)r�coderrr	�__call__s
zQuitter.__call__)N)�__name__�
__module__�__qualname__r
rrrrrr	r
src@s6eZdZdZdZd
dd�Zdd�Zdd	�Zd
d�ZdS)�_Printerzninteractive prompt objects for printing the license text, a list of
    contributors and the copyright notice.�rcs4ddl�||_||_d|_��fdd�|D�|_dS)Nrcs$g|]}�D]}�j�||��qqSr)�path�join)�.0�dir�filename��files�osrr	�
<listcomp>(s�z%_Printer.__init__.<locals>.<listcomp>)r�_Printer__name�_Printer__data�_Printer__lines�_Printer__filenames)rr�datar�dirsrrr	r
#s�z_Printer.__init__c
Cs~|jr
dSd}|jD]B}z(t|d��}|��}W5QRXWqXWqtk
rTYqXq|sb|j}|�d�|_t|j�|_dS)N�r�
)	r#r$�open�read�OSErrorr"�split�len�_Printer__linecnt)rr%r�fprrr	�__setup,s

z_Printer.__setupcCs8|��t|j�|jkr$d�|j�Sd|jfdSdS)Nr(z!Type %s() to see the full %s text�)�_Printer__setupr-r#�MAXLINESrr!rrrr	r<sz_Printer.__repr__cCs�|��d}d}z(t|||j�D]}t|j|�q"Wntk
rPYq�YqX||j7}d}|dkr~t|�}|dkr`d}q`|dkrq�qdS)Nz0Hit Return for more, or q (and Return) to quit: r)��qr5)r2�ranger3�printr#�
IndexError�input)r�prompt�lineno�i�keyrrr	rCs 

z_Printer.__call__N)rr)	rrr�__doc__r3r
r2rrrrrr	rs
	rc@s eZdZdZdd�Zdd�ZdS)�_Helpera3Define the builtin 'help'.

    This is a wrapper around pydoc.help that provides a helpful message
    when 'help' is typed at the Python interactive prompt.

    Calling help() at the Python prompt starts an interactive help session.
    Calling help(thing) prints help for the python object 'thing'.
    cCsdS)NzHType help() for interactive help, or help(object) for help about object.rrrrr	rbsz_Helper.__repr__cOsddl}|j||�S)Nr)�pydoc�help)r�args�kwdsr@rrr	resz_Helper.__call__N)rrrr>rrrrrr	r?Xs	r?)r>r
�objectrrr?rrrr	�<module>s
;lzma.cpython-38.opt-1.pyc000064400000027364151450073350011115 0ustar00U

e5d�2�$@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g$Zd%d&lZd%d&lZd%d&lZd%d'lTd%d(lmZmZd%d&lZd%Z	d)Z
d*ZGd+d�dej�Z
d2d&d-d&d&d&d&d&d.�d/d!�Zed-d&d&fd0d"�Zed&d&fd1d#�Zd&S)3aSInterface to the liblzma compression library.

This module provides a class for reading and writing compressed files,
classes for incremental (de)compression, and convenience functions for
one-shot (de)compression.

These classes and functions support both the XZ and legacy LZMA
container formats, as well as raw compressed data streams.
Z
CHECK_NONEZCHECK_CRC32ZCHECK_CRC64ZCHECK_SHA256ZCHECK_ID_MAXZ
CHECK_UNKNOWNZFILTER_LZMA1ZFILTER_LZMA2ZFILTER_DELTAZ
FILTER_X86ZFILTER_IA64Z
FILTER_ARMZFILTER_ARMTHUMBZFILTER_POWERPCZFILTER_SPARC�FORMAT_AUTO�	FORMAT_XZZFORMAT_ALONEZ
FORMAT_RAWZMF_HC3ZMF_HC4ZMF_BT2ZMF_BT3ZMF_BT4Z	MODE_FASTZMODE_NORMALZPRESET_DEFAULTZPRESET_EXTREME�LZMACompressor�LZMADecompressor�LZMAFile�	LZMAError�open�compress�
decompressZis_check_supported�N)�*)�_encode_filter_properties�_decode_filter_properties��c@s�eZdZdZd"ddddd�dd�Zdd	�Zed
d��Zdd
�Zdd�Z	dd�Z
dd�Zd#dd�Zd$dd�Z
d%dd�Zd&dd�Zdd�Zejfdd�Zd d!�ZdS)'ra@A file object providing transparent LZMA (de)compression.

    An LZMAFile can act as a wrapper for an existing file object, or
    refer directly to a named file on disk.

    Note that LZMAFile provides a *binary* file interface - data read
    is returned as bytes, and data to be written must be given as bytes.
    N�r�����format�check�preset�filtersc	Cs&d|_d|_t|_|dkrL|dkr*td��|dk	r:td��|dkrFt}t}n@|dkr~|dkr`t}t}t	||||d�|_
d	|_ntd
�|���t
|tttjf�r�d|kr�|d7}t�||�|_d|_||_n*t|d
�s�t|d�r�||_||_ntd��|jtk�r"tj|jtt||d�}t�|�|_dS)a�Open an LZMA-compressed file in binary mode.

        filename can be either an actual file name (given as a str,
        bytes, or PathLike object), in which case the named file is
        opened, or it can be an existing file object to read from or
        write to.

        mode can be "r" for reading (default), "w" for (over)writing,
        "x" for creating exclusively, or "a" for appending. These can
        equivalently be given as "rb", "wb", "xb" and "ab" respectively.

        format specifies the container format to use for the file.
        If mode is "r", this defaults to FORMAT_AUTO. Otherwise, the
        default is FORMAT_XZ.

        check specifies the integrity check to use. This argument can
        only be used when opening a file for writing. For FORMAT_XZ,
        the default is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not
        support integrity checks - for these formats, check must be
        omitted, or be CHECK_NONE.

        When opening a file for reading, the *preset* argument is not
        meaningful, and should be omitted. The *filters* argument should
        also be omitted, except when format is FORMAT_RAW (in which case
        it is required).

        When opening a file for writing, the settings used by the
        compressor can be specified either as a preset compression
        level (with the *preset* argument), or in detail as a custom
        filter chain (with the *filters* argument). For FORMAT_XZ and
        FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
        level. For FORMAT_RAW, the caller must always specify a filter
        chain; the raw compressor does not support preset compression
        levels.

        preset (if provided) should be an integer in the range 0-9,
        optionally OR-ed with the constant PRESET_EXTREME.

        filters (if provided) should be a sequence of dicts. Each dict
        should have an entry for "id" indicating ID of the filter, plus
        additional entries for options to the filter.
        NF)r�rbrzACannot specify an integrity check when opening a file for readingzICannot specify a preset compression level when opening a file for reading)�w�wb�aZab�xZxbrr
zInvalid mode: {!r}�bT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorrr)�_fp�_closefp�_MODE_CLOSED�_mode�
ValueErrorr�
_MODE_READr�_MODE_WRITEr�_compressor�_posr�
isinstance�str�bytes�os�PathLike�builtinsr�hasattr�	TypeError�_compressionZDecompressReaderrr�io�BufferedReader�_buffer)	�self�filename�moderrrrZ	mode_code�raw�r8�/usr/lib64/python3.8/lzma.py�__init__1sL,�
�zLZMAFile.__init__cCs�|jtkrdSzB|jtkr,|j��d|_n"|jtkrN|j�|j	�
��d|_	W5z|jrd|j��W5d|_d|_t|_XXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)r"r!rr �closer$r3r%rr&�flush�r4r8r8r9r;�s




zLZMAFile.closecCs
|jtkS)zTrue if this file is closed.)r"r!r=r8r8r9�closed�szLZMAFile.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor=r8r8r9r@�szLZMAFile.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler=r8r8r9rB�szLZMAFile.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)r?r"r$r=r8r8r9rA�szLZMAFile.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)r?r"r%r=r8r8r9�writable�szLZMAFile.writablecCs|��|j�|�S)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        )�_check_can_readr3�peek�r4�sizer8r8r9rE�sz
LZMAFile.peekcCs|��|j�|�S)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b"" if the file is already at EOF.
        )rDr3rrFr8r8r9r�sz
LZMAFile.readcCs"|��|dkrtj}|j�|�S)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b"" if the file is at EOF.
        r
)rDr1�DEFAULT_BUFFER_SIZEr3�read1rFr8r8r9rI�szLZMAFile.read1cCs|��|j�|�S)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        )rDr3�readlinerFr8r8r9rJ�szLZMAFile.readlinecCs:|��|j�|�}|j�|�|jt|�7_t|�S)z�Write a bytes object to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        )Z_check_can_writer&rrrr'�len)r4�dataZ
compressedr8r8r9r�s
zLZMAFile.writecCs|��|j�||�S)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Possible values for whence are:

            0: start of stream (default): offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        )Z_check_can_seekr3�seek)r4�offset�whencer8r8r9rM�sz
LZMAFile.seekcCs"|��|jtkr|j��S|jS)z!Return the current file position.)r?r"r$r3�tellr'r=r8r8r9rP�s

z
LZMAFile.tell)Nr)r)r)r)r)�__name__�
__module__�__qualname__�__doc__r:r;�propertyr>r@rBrArCrErrIrJrr1�SEEK_SETrMrPr8r8r8r9r&s*	�U


	



rr)rrrr�encoding�errors�newlinecCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}	t||	||||d	�}
d|kr�t�|
|||�S|
SdS)
a�Open an LZMA-compressed file in binary or text mode.

    filename can be either an actual file name (given as a str, bytes,
    or PathLike object), in which case the named file is opened, or it
    can be an existing file object to read from or write to.

    The mode argument can be "r", "rb" (default), "w", "wb", "x", "xb",
    "a", or "ab" for binary mode, or "rt", "wt", "xt", or "at" for text
    mode.

    The format, check, preset and filters arguments specify the
    compression settings, as for LZMACompressor, LZMADecompressor and
    LZMAFile.

    For binary mode, this function is equivalent to the LZMAFile
    constructor: LZMAFile(filename, mode, ...). In this case, the
    encoding, errors and newline arguments must not be provided.

    For text mode, an LZMAFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�r)r#�replacerr1�
TextIOWrapper)r5r6rrrrrWrXrYZlz_modeZbinary_filer8r8r9rs"
�cCs t||||�}|�|�|��S)z�Compress a block of data.

    Refer to LZMACompressor's docstring for a description of the
    optional arguments *format*, *check*, *preset* and *filters*.

    For incremental compression, use an LZMACompressor instead.
    )rrr<)rLrrrr�compr8r8r9r6scCspg}t|||�}z|�|�}Wn tk
r>|r8Yqfn�YnX|�|�|jsXtd��|j}|sqfqd�|�S)z�Decompress a block of data.

    Refer to LZMADecompressor's docstring for a description of the
    optional arguments *format*, *check* and *filters*.

    For incremental decompression, use an LZMADecompressor instead.
    zACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rLrZmemlimitrZresultsZdecomp�resr8r8r9r	Bs
)r)rT�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>sv�
b�/telnetlib.cpython-38.pyc000064400000043477151450073350011200 0ustar00U

e5d�Z�@sJdZddlZddlZddlZddlmZdgZdZdZ	e
dg�Ze
dg�Ze
dg�Z
e
d	g�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Z e
dg�Z!e
dg�Z"e
dg�Z#e
dg�Z$e
dg�Z%e
dg�Z&e
d g�Z'e
d!g�Z(e
d"g�Z)e
d#g�Z*e
d$g�Z+e
d%g�Z,e
d&g�Z-e
d'g�Z.e
d(g�Z/e
d)g�Z0e
d*g�Z1e
d+g�Z2e
dg�Z3e
d,g�Z4e
d-g�Z5e
d.g�Z6e
d/g�Z7e
d0g�Z8e
d1g�Z9e
d2g�Z:e
d3g�Z;e
d4g�Z<e
d5g�Z=e
d6g�Z>e
d7g�Z?e
d8g�Z@e
d9g�ZAe
d:g�ZBe
d;g�ZCe
d<g�ZDe
d=g�ZEe
d>g�ZFe
d?g�ZGe
d@g�ZHe
dAg�ZIe
dBg�ZJe
dCg�ZKe
dDg�ZLe
dEg�ZMe
dFg�ZNe
dGg�ZOe
dHg�ZPe
dg�ZQe
dg�ZReSedI��rejTZUnejVZUGdJd�d�ZWdKdL�ZXeYdMk�rFeX�dS)NaQTELNET client class.

Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds

Example:

>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79)   # connect to finger port
>>> tn.write(b'guido\r\n')
>>> print(tn.read_all())
Login       Name               TTY         Idle    When    Where
guido    Guido van Rossum      pts/2        <Dec  2 11:10> snag.cnri.reston..

>>>

Note that read_all() won't read until eof -- it just reads some data
-- but it guarantees to read at least one byte unless EOF is hit.

It is possible to pass a Telnet object to a selector in order to wait until
more data is available.  Note that in this case, read_eager() may return b''
even if there was data on the socket, because the protocol negotiation may have
eaten the data.  This is why EOFError is needed in some cases to distinguish
between "no data" and "connection closed" (since the socket also appears ready
for reading when it is closed).

To do:
- option negotiation
- timeout should be intrinsic to the connection object instead of an
  option on one of the read calls only

�N)�	monotonic�Telnet�������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1����PollSelectorc@seZdZdZddejfdd�Zdejfdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zd<dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd=d6d7�Zd8d9�Z d:d;�Z!dS)>ra�Telnet interface class.

    An instance of this class represents a connection to a telnet
    server.  The instance is initially not connected; the open()
    method must be used to establish a connection.  Alternatively, the
    host name and optional port number can be passed to the
    constructor, too.

    Don't try to reopen an already connected instance.

    This class has many read_*() methods.  Note that some of them
    raise EOFError when the end of the connection is read, because
    they can return an empty string for other reasons.  See the
    individual doc strings.

    read_until(expected, [timeout])
        Read until the expected string has been seen, or a timeout is
        hit (default is no timeout); may block.

    read_all()
        Read all data until EOF; may block.

    read_some()
        Read at least one byte or EOF; may block.

    read_very_eager()
        Read all data available already queued or on the socket,
        without blocking.

    read_eager()
        Read either data already queued or some data available on the
        socket, without blocking.

    read_lazy()
        Read all data in the raw queue (processing it first), without
        doing any socket I/O.

    read_very_lazy()
        Reads all data in the cooked queue, without doing any socket
        I/O.

    read_sb_data()
        Reads available data between SB ... SE sequence. Don't block.

    set_option_negotiation_callback(callback)
        Each time a telnet option is read on the input flow, this callback
        (if set) is called with the following parameters :
        callback(telnet socket, command, option)
            option will be chr(0) when there is no option.
        No other action is done afterwards by telnetlib.

    NrcCsht|_||_||_||_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
|dk	rd|�|||�dS)z�Constructor.

        When called without arguments, create an unconnected instance.
        With a hostname argument, it connects the instance; port number
        and timeout are optional.
        N�r)�
DEBUGLEVEL�
debuglevel�host�port�timeout�sock�rawq�irawq�cookedq�eof�iacseq�sb�sbdataq�option_callback�open��selfrLrMrN�r[�!/usr/lib64/python3.8/telnetlib.py�__init__�szTelnet.__init__cCsFd|_|st}||_||_||_t�d|||�t�||f|�|_	dS)z�Connect to a host.

        The optional second argument is the port number, which
        defaults to the standard telnet port (23).

        Don't try to reopen an already connected instance.
        rztelnetlib.Telnet.openN)
rS�TELNET_PORTrLrMrN�sys�audit�socketZcreate_connectionrOrYr[r[r\rX�szTelnet.opencCs|��dS)z#Destructor -- close the connection.N��close�rZr[r[r\�__del__�szTelnet.__del__cGs@|jdkr<td|j|jfdd�|r4t||�nt|�dS)z�Print a debug message, when the debug level is > 0.

        If extra arguments are present, they are substituted in the
        message using the standard string formatting operator.

        rzTelnet(%s,%s):� )�endN)rK�printrLrM)rZ�msg�argsr[r[r\ri�s

z
Telnet.msgcCs
||_dS)zhSet the debug level.

        The higher it is, the more debug output you get (on sys.stdout).

        N)rK)rZrKr[r[r\�set_debuglevel�szTelnet.set_debuglevelcCs.|j}d|_d|_d|_d|_|r*|��dS)zClose the connection.NTrIr)rOrSrTrUrc)rZrOr[r[r\rcszTelnet.closecCs|jS)z)Return the socket object used internally.)rOrdr[r[r\�
get_socketszTelnet.get_socketcCs
|j��S)z9Return the fileno() of the socket object used internally.)rO�filenordr[r[r\rmsz
Telnet.filenocCsBt|kr|�ttt�}t�d||�|�d|�|j�|�dS)z�Write a string to the socket, doubling any IAC characters.

        Can block if the connection is blocked.  May raise
        OSError if the connection is closed.

        ztelnetlib.Telnet.writezsend %rN)�IAC�replacer_r`rirO�sendall)rZ�bufferr[r[r\�writes
zTelnet.writec
Cs*t|�}|��|j�|�}|dkrN||}|jd|�}|j|d�|_|S|dk	r`t�|}t���}|�|tj�|j	�s|�
|�r�tdt|j�|�}|��|��|j�||�}|dkr�||}|jd|�}|j|d�|_|W5QR�S|dk	rv|t�}|dkrv�qqvW5QRX|�
�S)aRead until a given string is encountered or until timeout.

        When no match is found, return whatever is available instead,
        possibly the empty string.  Raise EOFError if the connection
        is closed and no cooked data is available.

        rN)�len�process_rawqrR�find�_time�_TelnetSelector�register�	selectors�
EVENT_READrS�select�max�	fill_rawq�read_very_lazy)rZ�matchrN�n�i�buf�deadline�selectorr[r[r\�
read_until&s8


zTelnet.read_untilcCs0|��|js |��|��q|j}d|_|S)z7Read all data until EOF; block until connection closed.rI)rtrSr}rR�rZr�r[r[r\�read_allKs
zTelnet.read_allcCs6|��|js&|js&|��|��q|j}d|_|S)z�Read at least one byte of cooked data unless EOF is hit.

        Return b'' if EOF is hit.  Block if no data is immediately
        available.

        rI)rtrRrSr}r�r[r[r\�	read_someUs
zTelnet.read_somecCs0|��|js(|��r(|��|��q|��S)aRead everything that's possible without blocking in I/O (eager).

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrS�
sock_availr}r~rdr[r[r\�read_very_eagerds

zTelnet.read_very_eagercCs6|��|js.|js.|��r.|��|��q|��S)z�Read readily available data.

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrRrSr�r}r~rdr[r[r\�
read_eagerrs

zTelnet.read_eagercCs|��|��S)aProcess and return data that's already in the queues (lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block
        unless in the midst of an IAC sequence.

        )rtr~rdr[r[r\�	read_lazy�szTelnet.read_lazycCs(|j}d|_|s$|jr$|js$td��|S)z�Return any data available in the cooked queue (very lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block.

        rIztelnet connection closed)rRrSrP�EOFErrorr�r[r[r\r~�s
zTelnet.read_very_lazycCs|j}d|_|S)aReturn any data available in the SB ... SE queue.

        Return b'' if no SB ... SE available. Should only be called
        after seeing a SB or SE command. When a new SB command is
        found, old unread SB data will be discarded. Don't block.

        rI)rVr�r[r[r\�read_sb_data�szTelnet.read_sb_datacCs
||_dS)zIProvide a callback function called after each receipt of a telnet option.N)rW)rZ�callbackr[r[r\�set_option_negotiation_callback�sz&Telnet.set_option_negotiation_callbackcCsRddg}�z|j�r|��}|jsf|tkr,q|dkr6q|tkrV||j|||j<qn|j|7_qt|j�dk�r$|ttt	t
fkr�|j|7_qd|_|tkr�||j|||j<nh|tkr�d|_d|_n&|t
kr�d|_|j|d|_d|d<|j�r|�|j|t�n|�dt|��qt|j�dkr|jdd�}d|_|}|ttfk�r�|�d|tk�rnd�ppd	t|��|j�r�|�|j||�n|j�tt
|�q|t	t
fkr|�d|t	k�r�d
�p�dt|��|j�r�|�|j||�q|j�tt|�qWn"tk
�r,d|_d|_YnX|j|d|_|j|d|_dS)
z�Transfer from raw queue to cooked queue.

        Set self.eof when connection is closed.  Don't block unless in
        the midst of an IAC sequence.

        rI�rrzIAC %d not recognizedrz	IAC %s %d�DO�DONT�WILL�WONTN)rP�rawq_getcharrT�theNULLrnrUrsr�r�r�r��SBrV�SErWrO�NOOPTri�ordrpr�rR)rZr��c�cmd�optr[r[r\rt�sp��zTelnet.process_rawqcCsZ|js|��|jrt�|j|j|jd�}|jd|_|jt|j�krVd|_d|_|S)z�Get next char from raw queue.

        Block if no data is immediately available.  Raise EOFError
        when connection is closed.

        rrIr)rPr}rSr�rQrs)rZr�r[r[r\r��szTelnet.rawq_getcharcCsL|jt|j�krd|_d|_|j�d�}|�d|�||_|j||_dS)z�Fill raw queue from exactly one recv() system call.

        Block if no data is immediately available.  Set self.eof when
        connection is closed.

        rIr�2zrecv %rN)rQrsrPrOZrecvrirSr�r[r[r\r}szTelnet.fill_rawqc
Cs:t��*}|�|tj�t|�d��W5QR�SQRXdS)z-Test whether data is available on the socket.rN)rwrxryrz�boolr{)rZr�r[r[r\r�szTelnet.sock_availc
Cs�tjdkr|��dSt���}|�|tj�|�tjtj�|��D]�\}}|j	|kr�z|�
�}Wn*tk
r�td�YW5QR�dSX|r�tj
�|�d��tj
��qD|j	tjkrDtj���d�}|s�W5QR�dS|�|�qDq<W5QRXdS)z9Interaction function, emulates a very dumb telnet client.Zwin32N�(*** Connection closed by remote host ***�ascii)r_�platform�mt_interactrwrxryrz�stdinr{Zfileobjr�r�rh�stdoutrr�decode�flush�readline�encode)rZr��keyZevents�text�liner[r[r\�interacts*

zTelnet.interactcCs<ddl}|�|jd�tj��}|s&q8|�|�d��qdS)z$Multithreaded version of interact().rNr[r�)�_thread�start_new_thread�listenerr_r�r�rrr�)rZr�r�r[r[r\r�3s
zTelnet.mt_interactcCsTz|��}Wntk
r*td�YdSX|rDtj�|�d��qtj��qdS)z>Helper for mt_interact() -- this executes in the other thread.r�Nr�)r�r�rhr_r�rrr�r�)rZ�datar[r[r\r�=szTelnet.listenerc
CsTd}|dd�}tt|��}|D]0}t||d�s |s>ddl}|�||�||<q |dk	rdt�|}t���}|�|tj	�|j
�s&|��|D]X}||�|j
�}|r�|��}	|j
d|	�}
|j
|	d�|_
|||
fW5QR�Sq�|dk	�r|�|�}|t�}|�s|dkrz�q&nqz|��qzW5QRX|��}
|
�sJ|j
�rJt�dd|
fS)a�Read until one from a list of a regular expressions matches.

        The first argument is a list of regular expressions, either
        compiled (re.Pattern instances) or uncompiled (strings).
        The optional second argument is a timeout, in seconds; default
        is no timeout.

        Return a tuple of three items: the index in the list of the
        first regular expression that matches; the re.Match object
        returned; and the text read up till and including the match.

        If EOF is read and no text was read, raise EOFError.
        Otherwise, when nothing matches, return (-1, None, text) where
        text is the text received so far (may be the empty string if a
        timeout happened).

        If a regular expression ends with a greedy match (e.g. '.*')
        or if more than one expression can match the same input, the
        results are undeterministic, and may depend on the I/O timing.

        N�searchr���)�rangers�hasattr�re�compilervrwrxryrzrSrtr�rRrgr{r}r~r�)rZ�listrNr��indicesr�r�r��m�er�Zreadyr[r[r\�expectJsB



z
Telnet.expectcCs|S�Nr[rdr[r[r\�	__enter__�szTelnet.__enter__cCs|��dSr�rb)rZ�type�value�	tracebackr[r[r\�__exit__�szTelnet.__exit__)N)N)"�__name__�
__module__�__qualname__�__doc__raZ_GLOBAL_DEFAULT_TIMEOUTr]rXrerirkrcrlrmrrr�r�r�r�r�r�r~r�r�rtr�r}r�r�r�r�r�r�r�r[r[r[r\r�s>5�


%

H

8c	Cs�d}tjdd�r2tjddkr2|d}tjd=qd}tjdd�rNtjd}d}tjdd�r�tjd}zt|�}Wn tk
r�t�|d�}YnXt��(}|�|�|j||dd	�|�	�W5QRXdS)
z�Test program for telnetlib.

    Usage: python telnetlib.py [-d] ... [host [port]]

    Default host is localhost; default port is 23.

    rrNz-dZ	localhostrZtcpg�?)rN)
r_�argv�int�
ValueErrorraZ
getservbynamerrkrXr�)rKrLrMZportstrZtnr[r[r\�test�s$



r��__main__)Zr�r_rary�timerrv�__all__rJr^�bytesrnr�r�r�r�r�r�ZNOPZDMZBRKZIPZAOZAYTZECZELZGAr�ZBINARYZECHOZRCPZSGAZNAMSZSTATUSZTMZRCTEZNAOLZNAOPZNAOCRDZNAOHTSZNAOHTDZNAOFFDZNAOVTSZNAOVTDZNAOLFDZXASCIIZLOGOUTZBMZDETZSUPDUPZSUPDUPOUTPUTZSNDLOCZTTYPEZEORZTUIDZOUTMRKZTTYLOCZVT3270REGIMEZX3PADZNAWSZTSPEEDZLFLOWZLINEMODEZXDISPLOCZOLD_ENVIRONZAUTHENTICATIONZENCRYPTZNEW_ENVIRONZTN3270EZXAUTH�CHARSETZRSPZCOM_PORT_OPTIONZSUPPRESS_LOCAL_ECHOZTLSZKERMITZSEND_URLZ	FORWARD_XZPRAGMA_LOGONZ
SSPI_LOGONZPRAGMA_HEARTBEATZEXOPLr�r�rHrwZSelectSelectorrr�r�r[r[r[r\�<module>s�#








































































operator.cpython-38.opt-1.pyc000064400000032575151450073350012005 0ustar00U

e5d�)�6@s(dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g6Zd7d8lmZd9d&�Zd:d#�Zd;d	�Zd<d+�Zd=d�Z	d>d
�Z
d?d-�Zd@d5�ZdAd�Z
dBd�ZdCd�ZdDd�ZdEd�ZdFd
�ZdGd�ZdHd�ZeZdId%�ZdJd)�ZdKd*�ZdLd'�ZdMd,�ZdNd.�ZdOd/�ZdPd0�ZdQd1�ZdRd3�ZdSd4�ZdTd6�Z dUd�Z!dVd�Z"dWd�Z#dXd�Z$dYd�Z%dZd�Z&d[d2�Z'dqd\d$�Z(Gd]d�d�Z)Gd^d �d �Z*Gd_d(�d(�Z+d`d�Z,dad�Z-dbd�Z.dcd�Z/ddd�Z0ded�Z1dfd�Z2dgd�Z3dhd�Z4did�Z5djd�Z6dkd�Z7dld!�Z8dmd"�Z9zd7dnl:TWne;k
�rbYnXd7dol:mZeZ<eZ=eZ>eZ?e	Z@e
ZAeZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTe ZUe!ZVe"ZWe$ZXe%ZYe'ZZe,Z[e-Z\e.Z]e/Z^e0Z_e1Z`e2Zae3Zbe4Zce5Zde6Zee7Zfe8Zge9ZhdpS)ras
Operator Interface

This module exports a set of functions corresponding to the intrinsic
operators of Python.  For example, operator.add(x, y) is equivalent
to the expression x+y.  The function names are those used for special
methods; variants without leading and trailing '__' are also provided
for convenience.

This is the pure Python implementation of the module.
�abs�add�and_�
attrgetter�concat�contains�countOf�delitem�eq�floordiv�ge�getitem�gt�iadd�iand�iconcat�	ifloordiv�ilshift�imatmul�imod�imul�index�indexOf�inv�invert�ior�ipow�irshift�is_�is_not�isub�
itemgetter�itruediv�ixor�le�length_hint�lshift�lt�matmul�methodcaller�mod�mul�ne�neg�not_�or_�pos�pow�rshift�setitem�sub�truediv�truth�xor�)rcCs||kS)zSame as a < b.���a�br8r8� /usr/lib64/python3.8/operator.pyr&scCs||kS)zSame as a <= b.r8r9r8r8r<r#scCs||kS)zSame as a == b.r8r9r8r8r<r	#scCs||kS)zSame as a != b.r8r9r8r8r<r+'scCs||kS)zSame as a >= b.r8r9r8r8r<r+scCs||kS)zSame as a > b.r8r9r8r8r<r
/scCs|S)zSame as not a.r8�r:r8r8r<r-5scCs|rdSdS)z*Return True if a is true, False otherwise.TFr8r=r8r8r<r59scCs||kS)zSame as a is b.r8r9r8r8r<r=scCs||k	S)zSame as a is not b.r8r9r8r8r<rAscCst|�S)zSame as abs(a).)�_absr=r8r8r<rGscCs||S)zSame as a + b.r8r9r8r8r<rKscCs||@S)zSame as a & b.r8r9r8r8r<rOscCs||S)zSame as a // b.r8r9r8r8r<r
SscCs|��S)zSame as a.__index__().)�	__index__r=r8r8r<rWscCs|S)zSame as ~a.r8r=r8r8r<r[scCs||>S)zSame as a << b.r8r9r8r8r<r%`scCs||S)zSame as a % b.r8r9r8r8r<r)dscCs||S)zSame as a * b.r8r9r8r8r<r*hscCs||S)zSame as a @ b.r8r9r8r8r<r'lscCs|S)zSame as -a.r8r=r8r8r<r,pscCs||BS)zSame as a | b.r8r9r8r8r<r.tscCs|
S)zSame as +a.r8r=r8r8r<r/xscCs||S)zSame as a ** b.r8r9r8r8r<r0|scCs||?S)zSame as a >> b.r8r9r8r8r<r1�scCs||S)zSame as a - b.r8r9r8r8r<r3�scCs||S)zSame as a / b.r8r9r8r8r<r4�scCs||AS)zSame as a ^ b.r8r9r8r8r<r6�scCs(t|d�s dt|�j}t|��||S)z%Same as a + b, for a and b sequences.�__getitem__�!'%s' object can't be concatenated��hasattr�type�__name__�	TypeError�r:r;�msgr8r8r<r�s
cCs||kS)z(Same as b in a (note reversed operands).r8r9r8r8r<r�scCs"d}|D]}||kr|d7}q|S)z)Return the number of times b occurs in a.r7�r8)r:r;�count�ir8r8r<r�s

cCs
||=dS)zSame as del a[b].Nr8r9r8r8r<r�scCs||S)z
Same as a[b].r8r9r8r8r<r�scCs.t|�D]\}}||kr|Sqtd��dS)z!Return the first index of b in a.z$sequence.index(x): x not in sequenceN)�	enumerate�
ValueError)r:r;rK�jr8r8r<r�s
cCs|||<dS)zSame as a[b] = c.Nr8)r:r;�cr8r8r<r2�scCs�t|t�s dt|�j}t|��z
t|�WStk
r>YnXzt|�j}Wntk
rf|YSXz||�}Wntk
r�|YSX|tkr�|St|t�s�dt|�j}t|��|dkr�d}t	|��|S)a2
    Return an estimate of the number of items in obj.
    This is useful for presizing containers when building from an iterable.

    If the object supports len(), the result will be exact. Otherwise, it may
    over- or under-estimate by an arbitrary amount. The result will be an
    integer >= 0.
    z/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr7z$__length_hint__() should return >= 0)
�
isinstance�intrDrErF�len�__length_hint__�AttributeError�NotImplementedrM)�obj�defaultrHZhint�valr8r8r<r$�s8	
�



�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)raV
    Return a callable object that fetches the given attribute(s) from its operand.
    After f = attrgetter('name'), the call f(r) returns r.name.
    After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
    After h = attrgetter('name.first', 'name.last'), the call h(r) returns
    (r.name.first, r.name.last).
    )�_attrs�_callcsn|s<t|t�std��|f|_|�d���fdd�}||_n.|f||_ttt|j����fdd�}||_dS)Nzattribute name must be a string�.cs�D]}t||�}q|S�N)�getattr)rV�name)�namesr8r<�func�sz!attrgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}|��VqdSr\r8)�.0�getter�rVr8r<�	<genexpr>�sz4attrgetter.__init__.<locals>.func.<locals>.<genexpr>��tuplerc)�gettersrcr<r`�s)	rP�strrFrY�splitrZrf�mapr)�self�attr�attrsr`r8)rgr_r<�__init__�s

zattrgetter.__init__cCs
|�|�Sr\�rZ�rkrVr8r8r<�__call__�szattrgetter.__call__cCs$d|jj|jjd�tt|j��fS�N�	%s.%s(%s)�, )�	__class__�
__module__�__qualname__�joinrj�reprrY�rkr8r8r<�__repr__s�zattrgetter.__repr__cCs|j|jfSr\)rurYrzr8r8r<�
__reduce__szattrgetter.__reduce__N�	rErvrw�__doc__�	__slots__rnrqr{r|r8r8r8r<r�sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r z�
    Return a callable object that fetches the given item(s) from its operand.
    After f = itemgetter(2), the call f(r) returns r[2].
    After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
    ��_itemsrZcsF�s �f|_�fdd�}||_n"�f�|_��fdd�}||_dS)Ncs|�Sr\r8rc)�itemr8r<r`sz!itemgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}�|VqdSr\r8)rarKrcr8r<rdsz4itemgetter.__init__.<locals>.func.<locals>.<genexpr>rerc)�itemsrcr<r`sr�)rkr�r�r`r8)r�r�r<rnszitemgetter.__init__cCs
|�|�Sr\rorpr8r8r<rqszitemgetter.__call__cCs$d|jj|jjd�tt|j��fSrr)rurvrErxrjryr�rzr8r8r<r{ s�zitemgetter.__repr__cCs|j|jfSr\)rur�rzr8r8r<r|%szitemgetter.__reduce__Nr}r8r8r8r<r 	sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r(z�
    Return a callable object that calls the given method on its operand.
    After f = methodcaller('name'), the call f(r) returns r.name().
    After g = methodcaller('name', 'date', foo=1), the call g(r) returns
    r.name('date', foo=1).
    )�_name�_args�_kwargscOs*||_t|jt�std��||_||_dS)Nzmethod name must be a string)r�rPrhrFr�r�)rkr^�args�kwargsr8r8r<rn1s
zmethodcaller.__init__cCst||j�|j|j�Sr\)r]r�r�r�rpr8r8r<rq8szmethodcaller.__call__cCsTt|j�g}|�tt|j��|�dd�|j��D��d|jj|jj	d�
|�fS)Ncss|]\}}d||fVqdS)z%s=%rNr8)ra�k�vr8r8r<rd>sz(methodcaller.__repr__.<locals>.<genexpr>rsrt)ryr��extendrjr�r�r�rurvrErx)rkr�r8r8r<r{;s�zmethodcaller.__repr__cCsD|js|j|jf|jfSddlm}||j|jf|j�|jfSdS)Nr7)�partial)r�rur�r��	functoolsr�)rkr�r8r8r<r|Cszmethodcaller.__reduce__Nr}r8r8r8r<r((scCs||7}|S)zSame as a += b.r8r9r8r8r<rMscCs||M}|S)zSame as a &= b.r8r9r8r8r<rRscCs,t|d�s dt|�j}t|��||7}|S)z&Same as a += b, for a and b sequences.r@rArBrGr8r8r<rWs

cCs||}|S)zSame as a //= b.r8r9r8r8r<r_scCs||K}|S)zSame as a <<= b.r8r9r8r8r<rdscCs||;}|S)zSame as a %= b.r8r9r8r8r<riscCs||9}|S)zSame as a *= b.r8r9r8r8r<rnscCs||}|S)zSame as a @= b.r8r9r8r8r<rsscCs||O}|S)zSame as a |= b.r8r9r8r8r<rxscCs||C}|S)zSame as a **= b.r8r9r8r8r<r}scCs||L}|S)zSame as a >>= b.r8r9r8r8r<r�scCs||8}|S)zSame as a -= b.r8r9r8r8r<r�scCs||}|S)zSame as a /= b.r8r9r8r8r<r!�scCs||N}|S)zSame as a ^= b.r8r9r8r8r<r"�s)�*)r~N)r7)ir~�__all__�builtinsrr>r&r#r	r+rr
r-r5rrrrr
rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrrrr2r$rr r(rrrrrrrrrrrrr!r"�	_operator�ImportError�__lt__�__le__�__eq__�__ne__�__ge__�__gt__�__not__�__abs__�__add__�__and__�__floordiv__r?�__inv__�
__invert__�
__lshift__�__mod__�__mul__�
__matmul__�__neg__�__or__�__pos__�__pow__�
__rshift__�__sub__�__truediv__�__xor__�
__concat__�__contains__�__delitem__r@�__setitem__�__iadd__�__iand__�__iconcat__�
__ifloordiv__�__ilshift__�__imod__�__imul__�__imatmul__�__ior__�__ipow__�__irshift__�__isub__�__itruediv__�__ixor__r8r8r8r<�<module>s4�	
)'%_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.pyc000064400000070732151450073350016525 0ustar00U

��.en���@s`dddddddddddddd	dd
ddd
dddddddddddddddddddddddddd d!d"d#dddd$d%dd&d'd(d$d)dddd*d+dddddddd,d$d$d$d$dd$dd$d$d$d$d$dddddddddd$dd$d$d$d$d$d$d$d$dd$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$dd$dd$dd$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$ddd$d$dd$dddd$d$d$ddd$d$dddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$dd$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$d$d$d$d$ddd$d$d$dd$d$ddd$d$d$d$d$d$d$dddddd$dd$d$dddddd$ddd$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$ddd$d$d$ddd$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd-ddd.d/d.d.d0d1d2dd3d4d5dd	d6ddd7dd8d9dd:d;dd<ddd=d>d?d@ddd)ddAdBddCdddd
dd$dDdEdFdGdddHddIdJd$dKddddLdMdddddddddNdOdPdddQd$d$dRdd
ddSddddTdUdddVddWd$dXdYddZd4d[d\dd]dd$ddd^d_d`dadbd7ddcddd=ded$dddfdgdhdgdfdhdfdfdgdgdfd\dfdfdfdfdgd$didjdkd$dldmddnd8d$dddddoddpdqdd$ddddrd$d6dsd$d$d$d$dddd$d$ddtdudsdvdwdwdsdx���ZdyS)z��ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPythonz/usr/binz/usr/lib64/python3.8z-L. -lpython3.8zOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8zA/builddir/build/BUILD/Python-3.8.17/build/optimized/coverage.infoz?/builddir/build/BUILD/Python-3.8.17/build/optimized/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz.cpython-38-x86_64-linux-gnu.soi�ZyeszG/usr/include /usr/include /usr/include/python3.8 /usr/include/python3.8z/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8.soz3.8z
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz0/usr/lib64/python3.8/config-3.8-x86_64-linux-gnuzlibpython3.8.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa:-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgoz
libpython3.sozno-frameworkz./python -Ez	python3.8a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa.-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internala-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidzCLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimizedz	@SGI_ABI@z/bin/shz.so���zcpython-38-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczLLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz3/builddir/build/BUILD/Python-3.8.17/build/optimizedz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�>/usr/lib64/python3.8/_sysconfigdata__linux_x86_64-linux-gnu.py�<module>sb2,/��������ssl.cpython-38.opt-1.pyc000064400000127066151450073350010753 0ustar00U

e5dH��
@s�dZddlZddlZddlmZddlmZmZ	m
ZddlZddlm
Z
mZmZddlmZmZmZddlmZmZmZmZmZmZmZddlmZmZdd	lmZmZm Z m!Z!zdd
lm"Z"Wne#k
r�YnXddlm$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddlm.Z.m/Z/e	j0d
e1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e	j0de1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e2j3Z4e2_4dd�e2j5�6�D�Z7e8e2dd�Z9Gdd�de	�Z:Gd d!�d!e	�Z;Gd"d#�d#e	�Z<Gd$d%�d%e	�Z=ej>d&k�r"dd'lm?Z?m@Z@dd(lAmAZAmBZBmCZCmDZDdd)lAmEZEmFZFddlAZGddlHZHddlIZIddlJZJeKZLd*gZMeNed+�ZOe.ZPeZQd,d-�ZRd.d/�ZSd0d1�ZTd2d3�ZUed4d5�ZVd6d7�ZWGd8d9�d9ed9d:��ZXGd;d<�d<eXe�ZYGd=d>�d>e�ZZeYj[fdddd?�d@dA�Z\e3fe]dBeYj[ddddddC�dDdE�Z^e\Z_e^Z`GdFdG�dG�ZadHdI�ZbGdJdK�dKeA�ZceceZ_deaeZ_edddBe]e3ddLdLdf	dMdN�ZfdOdP�ZgdQZhdRZidSdT�ZjdUdV�Zke3dfdWdX�ZldYdZ�ZmdS)[a�
This module provides some more Pythonic support for SSL.

Object types:

  SSLSocket -- subtype of socket.socket which does SSL over the socket

Exceptions:

  SSLError -- exception raised for I/O errors

Functions:

  cert_time_to_seconds -- convert time string used for certificate
                          notBefore and notAfter functions to integer
                          seconds past the Epoch (the time values
                          returned from time.time())

  fetch_server_certificate (HOST, PORT) -- fetch the certificate provided
                          by the server running on HOST at port PORT.  No
                          validation of the certificate is performed.

Integer constants:

SSL_ERROR_ZERO_RETURN
SSL_ERROR_WANT_READ
SSL_ERROR_WANT_WRITE
SSL_ERROR_WANT_X509_LOOKUP
SSL_ERROR_SYSCALL
SSL_ERROR_SSL
SSL_ERROR_WANT_CONNECT

SSL_ERROR_EOF
SSL_ERROR_INVALID_ERROR_CODE

The following group define certificate requirements that one side is
allowing/requiring from the other side:

CERT_NONE - no certificates from the other side are required (or will
            be looked at if provided)
CERT_OPTIONAL - certificates are not required, but if provided will be
                validated, and if validation fails, the connection will
                also fail
CERT_REQUIRED - certificates are required, and will be validated, and
                if validation fails, the connection will also fail

The following constants identify various SSL protocol variants:

PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLS
PROTOCOL_TLS_CLIENT
PROTOCOL_TLS_SERVER
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2

The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6

ALERT_DESCRIPTION_CLOSE_NOTIFY
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
ALERT_DESCRIPTION_BAD_RECORD_MAC
ALERT_DESCRIPTION_RECORD_OVERFLOW
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_BAD_CERTIFICATE
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
ALERT_DESCRIPTION_CERTIFICATE_REVOKED
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
ALERT_DESCRIPTION_ILLEGAL_PARAMETER
ALERT_DESCRIPTION_UNKNOWN_CA
ALERT_DESCRIPTION_ACCESS_DENIED
ALERT_DESCRIPTION_DECODE_ERROR
ALERT_DESCRIPTION_DECRYPT_ERROR
ALERT_DESCRIPTION_PROTOCOL_VERSION
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
ALERT_DESCRIPTION_INTERNAL_ERROR
ALERT_DESCRIPTION_USER_CANCELLED
ALERT_DESCRIPTION_NO_RENEGOTIATION
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
ALERT_DESCRIPTION_UNRECOGNIZED_NAME
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
�N)�
namedtuple)�Enum�IntEnum�IntFlag)�OPENSSL_VERSION_NUMBER�OPENSSL_VERSION_INFO�OPENSSL_VERSION)�_SSLContext�	MemoryBIO�
SSLSession)�SSLError�SSLZeroReturnError�SSLWantReadError�SSLWantWriteError�SSLSyscallError�SSLEOFError�SSLCertVerificationError)�txt2obj�nid2obj)�RAND_status�RAND_add�
RAND_bytes�RAND_pseudo_bytes)�RAND_egd)
�HAS_SNI�HAS_ECDH�HAS_NPN�HAS_ALPN�	HAS_SSLv2�	HAS_SSLv3�	HAS_TLSv1�HAS_TLSv1_1�HAS_TLSv1_2�HAS_TLSv1_3)�_DEFAULT_CIPHERS�_OPENSSL_API_VERSION�
_SSLMethodcCs|�d�o|dkS)NZ	PROTOCOL_�PROTOCOL_SSLv23��
startswith��name�r,�/usr/lib64/python3.8/ssl.py�<lambda>|�r.)�source�OptionscCs
|�d�S)NZOP_r(r*r,r,r-r.�r/ZAlertDescriptioncCs
|�d�S)NZALERT_DESCRIPTION_r(r*r,r,r-r.�r/ZSSLErrorNumbercCs
|�d�S)NZ
SSL_ERROR_r(r*r,r,r-r.�r/�VerifyFlagscCs
|�d�S)NZVERIFY_r(r*r,r,r-r.�r/�
VerifyModecCs
|�d�S)NZCERT_r(r*r,r,r-r.�r/cCsi|]\}}||�qSr,r,)�.0r+�valuer,r,r-�
<dictcomp>�sr6ZPROTOCOL_SSLv2c@s6eZdZejZejZejZ	ej
ZejZ
ejZejZdS)�
TLSVersionN)�__name__�
__module__�__qualname__�_sslZPROTO_MINIMUM_SUPPORTEDZMINIMUM_SUPPORTEDZPROTO_SSLv3�SSLv3ZPROTO_TLSv1ZTLSv1Z
PROTO_TLSv1_1ZTLSv1_1Z
PROTO_TLSv1_2ZTLSv1_2Z
PROTO_TLSv1_3ZTLSv1_3ZPROTO_MAXIMUM_SUPPORTEDZMAXIMUM_SUPPORTEDr,r,r,r-r7�sr7c@s(eZdZdZdZdZdZdZdZdZ	dS)	�_TLSContentTypez@Content types (record layer)

    See RFC 8446, section B.1
    ������N)
r8r9r:�__doc__�CHANGE_CIPHER_SPEC�ALERTZ	HANDSHAKEZAPPLICATION_DATA�HEADERZINNER_CONTENT_TYPEr,r,r,r-r=�sr=c@s�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$S)%�
_TLSAlertTypezQAlert types for TLSContentType.ALERT messages

    See RFC 8466, section B.2
    r�
r>r?r@��(�)�*�+�,�-�.�/�0�1�2�3�<�F�G�P�V�Z�d�m�n�o�p�q�r�s�t�xN)&r8r9r:rDZCLOSE_NOTIFYZUNEXPECTED_MESSAGEZBAD_RECORD_MACZDECRYPTION_FAILEDZRECORD_OVERFLOWZDECOMPRESSION_FAILUREZHANDSHAKE_FAILUREZNO_CERTIFICATEZBAD_CERTIFICATEZUNSUPPORTED_CERTIFICATEZCERTIFICATE_REVOKEDZCERTIFICATE_EXPIREDZCERTIFICATE_UNKNOWNZILLEGAL_PARAMETERZ
UNKNOWN_CAZ
ACCESS_DENIEDZDECODE_ERRORZ
DECRYPT_ERRORZEXPORT_RESTRICTIONZPROTOCOL_VERSIONZINSUFFICIENT_SECURITYZINTERNAL_ERRORZINAPPROPRIATE_FALLBACKZ
USER_CANCELEDZNO_RENEGOTIATIONZMISSING_EXTENSIONZUNSUPPORTED_EXTENSIONZCERTIFICATE_UNOBTAINABLEZUNRECOGNIZED_NAMEZBAD_CERTIFICATE_STATUS_RESPONSEZBAD_CERTIFICATE_HASH_VALUEZUNKNOWN_PSK_IDENTITYZCERTIFICATE_REQUIREDZNO_APPLICATION_PROTOCOLr,r,r,r-rH�sFrHc@sheZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdS)�_TLSMessageTypezFMessage types (handshake protocol)

    See RFC 8446, section B.3
    r����������
���r>r?r@rA��C�rCN)r8r9r:rDZ
HELLO_REQUESTZCLIENT_HELLOZSERVER_HELLOZHELLO_VERIFY_REQUESTZNEWSESSION_TICKETZEND_OF_EARLY_DATAZHELLO_RETRY_REQUESTZENCRYPTED_EXTENSIONSZCERTIFICATEZSERVER_KEY_EXCHANGEZCERTIFICATE_REQUESTZSERVER_DONEZCERTIFICATE_VERIFYZCLIENT_KEY_EXCHANGEZFINISHEDZCERTIFICATE_URLZCERTIFICATE_STATUSZSUPPLEMENTAL_DATAZ
KEY_UPDATEZ
NEXT_PROTOZMESSAGE_HASHrEr,r,r,r-rg�s.rg�win32)�enum_certificates�	enum_crls)�socket�AF_INET�SOCK_STREAM�create_connection)�
SOL_SOCKET�SO_TYPE�
tls-unique�HOSTFLAG_NEVER_CHECK_SUBJECTcCs�|sdS|�d�}|s&|��|��kS|dkr<td�|���|�d�\}}}d|krbtd�|���|sttd�|���|dkr�td�|���|�d�\}}}|r�|s�dS|��|��kS)	a�Matching according to RFC 6125, section 6.4.3

    - Hostnames are compared lower case.
    - For IDNA, both dn and hostname must be encoded as IDN A-label (ACE).
    - Partial wildcards like 'www*.example.org', multiple wildcards, sole
      wildcard or wildcards in labels other then the left-most label are not
      supported and a CertificateError is raised.
    - A wildcard must match at least one character.
    F�*rhz1too many wildcards in certificate DNS name: {!r}.�.z9wildcard can only be present in the leftmost label: {!r}.z>sole wildcard without additional labels are not support: {!r}.z<partial wildcards in leftmost label are not supported: {!r}.)�count�lower�CertificateError�format�	partition)Zdn�hostnameZ	wildcardsZdn_leftmost�sepZdn_remainderZhostname_leftmostZhostname_remainderr,r,r-�_dnsname_matchs@

�������r�cCs�zt�|�}Wntk
r"Yn"Xt�|�|kr6|Std�|���zt�tj|�WStk
rvtd�|���Yntk
r�YnXtd�|���dS)z�Try to convert an IP address to packed binary form

    Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6
    support.
    z'{!r} is not a quad-dotted IPv4 address.z+{!r} is neither an IPv4 nor an IP6 address.z{!r} is not an IPv4 address.N)	�_socketZ	inet_aton�OSErrorZ	inet_ntoa�
ValueErrorr�Z	inet_ptonZAF_INET6�AttributeError)Zipname�addrr,r,r-�_inet_patonDs$��
r�cCst|���}||kS)z�Exact matching of IP addresses.

    RFC 6125 explicitly doesn't define an algorithm for this
    (section 1.7.2 - "Out of Scope").
    )r��rstrip)Zcert_ipaddress�host_ipZipr,r,r-�_ipaddress_matchgsr�cCsJ|std��zt|�}Wntk
r0d}YnXg}|�dd�}|D]^\}}|dkrz|dkrnt||�rndS|�|�qF|dkrF|dk	r�t||�r�dS|�|�qF|s�|�dd�D]6}|D],\}}|dkr�t||�r�dS|�|�q�q�t|�d	k�rtd
|d�t	t
|��f��n,t|�d	k�r>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.

    The function matches IP addresses rather than dNSNames if hostname is a
    valid ipaddress string. IPv4 addresses are supported on all platforms.
    IPv6 addresses are supported on platforms with IPv6 support (AF_INET6
    and inet_pton).

    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_REQUIREDNZsubjectAltNamer,ZDNSz
IP AddressZsubjectZ
commonNamerhz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)r�r��getr��appendr��lenr��join�map�repr)�certr�r�ZdnsnamesZsan�keyr5�subr,r,r-�match_hostnamessB


�
�r��DefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcCsdt��}tj�|d|d�}tj�|d|d�}ttj�|�rF|ndtj�|�rX|ndf|��S)z/Return paths to default cafile and capath.
    rrhrirjN)	r;�get_default_verify_paths�os�environr�r��path�isfile�isdir)�parts�cafile�capathr,r,r-r��s��r�csDeZdZdZdZ�fdd�Ze�fdd��Ze�fdd��Z�Z	S)	�_ASN1Objectz#ASN.1 object identifier lookup
    r,cst�j|ft|dd���S)NFr*��super�__new__�_txt2obj)�cls�oid��	__class__r,r-r��sz_ASN1Object.__new__cst�j|ft|���S)z3Create _ASN1Object from OpenSSL numeric ID
        )r�r��_nid2obj)r�Znidr�r,r-�fromnid�sz_ASN1Object.fromnidcst�j|ft|dd���S)z=Create _ASN1Object from short name, long name or OID
        Tr*r�)r�r+r�r,r-�fromname�sz_ASN1Object.fromname)
r8r9r:rD�	__slots__r��classmethodr�r��
__classcell__r,r,r�r-r��sr�znid shortname longname oidc@seZdZdZdZdZdS)�PurposezDSSLContext purpose flags with X509v3 Extended Key Usage objects
    z1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)r8r9r:rD�SERVER_AUTHZCLIENT_AUTHr,r,r,r-r��sr�cs�eZdZdZdZdZdZefdd�Zdd�Z	d2d
d�Z
d3dd
�Zdd�Zdd�Z
dd�Zdd�Zejfdd�Zeed�r�e�fdd��Zej�fdd��Ze�fdd��Zej�fdd��Ze�fdd ��Zej�fd!d ��Zeed"��red#d$��Zejd%d$��Zned&d$��Ze�fd'd(��Zej�fd)d(��Ze�fd*d+��Ze�fd,d-��Zej�fd.d-��Ze�fd/d0��Zej�fd1d0��Z�Z S)4�
SSLContextz|An SSLContext holds various SSL-related configuration options and
    data, such as certificates and possibly a private key.)ZCAZROOTNcOst�||�}|S�N)r	r�)r��protocol�args�kwargs�selfr,r,r-r��szSSLContext.__new__cCs4|dkrdSt|t�r&|�d��d�S|�d�SdS)NZidna�ascii)�
isinstance�str�encode�decode)r�r�r,r,r-�_encode_hostname�s

zSSLContext._encode_hostnameFTc	Cs|jj|||||||d�S)N)�sock�server_side�do_handshake_on_connect�suppress_ragged_eofs�server_hostname�context�session)�sslsocket_class�_create)r�r�r�r�r�r�r�r,r,r-�wrap_socket�s�zSSLContext.wrap_socketcCs|jj||||�|�||d�S)N)r�r�r�r�)�sslobject_classr�r�)r��incoming�outgoingr�r�r�r,r,r-�wrap_bio�s�zSSLContext.wrap_biocCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�r�z(NPN protocols must be 1 to 255 in length)�	bytearray�bytesr�rr��extendZ_set_npn_protocols)r�Z
npn_protocols�protosr��br,r,r-�set_npn_protocolss
zSSLContext.set_npn_protocolscs8�dkrd�_n$t��s td����fdd�}|�_dS)Nznot a callable objectcs��|�}�|||�Sr�)r�)�sslobjZ
servernameZsslctx�r��server_name_callbackr,r-�shim_cbs
z3SSLContext.set_servername_callback.<locals>.shim_cb)Zsni_callback�callable�	TypeError)r�r�r�r,r�r-�set_servername_callbacksz"SSLContext.set_servername_callbackcCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�rr�z)ALPN protocols must be 1 to 255 in length)r�r�r�rr�r�Z_set_alpn_protocols)r�Zalpn_protocolsr�r�r�r,r,r-�set_alpn_protocols s
zSSLContext.set_alpn_protocolscCsvt�}z<t|�D].\}}}|dkr|dks4|j|kr|�|�qWntk
r`t�d�YnX|rr|j|d�|S)NZx509_asnTz-unable to enumerate Windows certificate store)�cadata)r�ryr�r��PermissionError�warnings�warn�load_verify_locations)r��	storename�purposeZcertsr��encodingZtrustr,r,r-�_load_windows_store_certs+sz$SSLContext._load_windows_store_certscCs@t|t�st|��tjdkr4|jD]}|�||�q"|��dS)Nrx)r�r�r��sys�platform�_windows_cert_storesr�Zset_default_verify_paths)r�r�r�r,r,r-�load_default_certs9s


zSSLContext.load_default_certs�minimum_versioncstt�j�Sr�)r7r�r��r�r�r,r-r�BszSSLContext.minimum_versioncs4|tjkr|jtjM_ttt�j�||�dSr�)	r7r<�optionsr1ZOP_NO_SSLv3r�r�r��__set__�r�r5r�r,r-r�Fs
cstt�j�Sr�)r7r��maximum_versionr�r�r,r-r�LszSSLContext.maximum_versioncsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Pscstt�j�Sr�)r1r�r�r�r�r,r-r�TszSSLContext.optionscsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Xsr�cCs|jtj@}|tjkSr��Z_host_flagsr;r�)r�Zncsr,r,r-�hostname_checks_common_name]sz&SSLContext.hostname_checks_common_namecCs,|r|jtjM_n|jtjO_dSr�r�r�r,r,r-r�bscCsdS)NTr,r�r,r,r-r�iscst�j}|dk	r|jSdSdS)a9TLS message callback

        The message callback provides a debugging hook to analyze TLS
        connections. The callback is called for any TLS protocol message
        (header, handshake, alert, and more), but not for application data.
        Due to technical  limitations, the callback can't be used to filter
        traffic or to abort a connection. Any exception raised in the
        callback is delayed until the handshake, read, or write operation
        has been performed.

        def msg_cb(conn, direction, version, content_type, msg_type, data):
            pass

        conn
            :class:`SSLSocket` or :class:`SSLObject` instance
        direction
            ``read`` or ``write``
        version
            :class:`TLSVersion` enum member or int for unknown version. For a
            frame header, it's the header version.
        content_type
            :class:`_TLSContentType` enum member or int for unsupported
            content type.
        msg_type
            Either a :class:`_TLSContentType` enum number for a header
            message, a :class:`_TLSAlertType` enum member for an alert
            message, a :class:`_TLSMessageType` enum member for other
            messages, or int for unsupported message types.
        data
            Raw, decrypted message content as bytes
        N)r��
_msg_callback�
user_function)r��innerr�r,r-r�ms!zSSLContext._msg_callbackcsb�dkr ttt�j�|d�dSt�d�s8t��d����fdd�}�|_ttt�j�||�dS)N�__call__z is not callable.cs�zt|�}Wntk
r YnXzt|�}Wntk
rBYnX|tjkrTt}n|tjkrdt}nt}z||�}Wntk
r�YnX�||||||�Sr�)r7r�r=rGrFrHrg)Zconn�	direction�versionZcontent_typeZmsg_type�dataZmsg_enum��callbackr,r-r��s,

�z'SSLContext._msg_callback.<locals>.inner)r�r�r�r��hasattrr�r�)r�rr�r�rr-r��s
cstt�j�Sr�)r&r�r�r�r�r,r-r��szSSLContext.protocolcstt�j�Sr�)r2r��verify_flagsr�r�r,r-r�szSSLContext.verify_flagscsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�scs0t�j}z
t|�WStk
r*|YSXdSr�)r��verify_moder3r�r�r�r,r-r�s

zSSLContext.verify_modecsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�s)FTTNN)FNN)!r8r9r:rDr�r�r��PROTOCOL_TLSr�r�r�r�r�r�r�r�r�r�r�rr	�propertyr��setterr�r�r;r�r�r�rrr�r,r,r�r-r��sn�
�





&%r�)r�r�r�cCs�t|t�st|��tt�}|tjkr0t|_d|_	|s<|s<|rL|�
|||�n|jtkr`|�|�t
|d�r�tj�d�}|r�tjjs�||_|S)z�Create a SSLContext object with default settings.

    NOTE: The protocol and settings may change anytime without prior
          deprecation. The values represent a fair balance between maximum
          compatibility and security.
    T�keylog_filename�
SSLKEYLOGFILE)r�r�r�r�rr�r��
CERT_REQUIREDr�check_hostnamer��	CERT_NONEr�rr�r�r�r��flags�ignore_environmentr)r�r�r�r�r��
keylogfiler,r,r-�create_default_context�s




rF)�	cert_reqsrr��certfile�keyfiler�r�r�cCs�t|t�st|��t|�}	|s$d|	_|dk	r2||	_|r<d|	_|rL|sLtd��|sT|r`|	�||�|sl|sl|r||	�|||�n|	jt	kr�|	�
|�t|	d�r�tj
�d�}
|
r�tjjs�|
|	_|	S)a/Create a SSLContext object for Python stdlib modules

    All Python stdlib modules shall use this function to create SSLContext
    objects in order to keep common settings in one place. The configuration
    is less restrict than create_default_context()'s to increase backward
    compatibility.
    FNT�certfile must be specifiedrr	)r�r�r�r�rrr��load_cert_chainr�rr�rr�r�r�r�r
rr)r�rrr�rrr�r�r�r�rr,r,r-�_create_unverified_context�s,



rc@s�eZdZdZdd�Zed2dd��Zedd	��Zej	d
d	��Zedd��Z
e
j	d
d��Z
edd��Zedd��Zedd��Z
d3dd�Zdd�Zd4dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd5d,d-�Zd.d/�Zd0d1�ZdS)6�	SSLObjectaThis class implements an interface on top of a low-level SSL object as
    implemented by OpenSSL. This object captures the state of an SSL connection
    but does not provide any network IO itself. IO needs to be performed
    through separate "BIO" objects which are OpenSSL's IO abstraction layer.

    This class does not have a public constructor. Instances are returned by
    ``SSLContext.wrap_bio``. This class is typically used by framework authors
    that want to implement asynchronous IO for SSL through memory buffers.

    When compared to ``SSLSocket``, this object lacks the following features:

     * Any form of network IO, including methods such as ``recv`` and ``send``.
     * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery.
    cOst|jj�d���dS)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().�r�r�r8�r�r�r�r,r,r-�__init__;s�zSSLObject.__init__FNc	Cs*|�|�}|j||||||d�}||_|S)N)r�r��ownerr�)r�Z	_wrap_bio�_sslobj)	r�r�r�r�r�r�r�r�r�r,r,r-r�As
�zSSLObject._createcCs|jjS)z(The SSLContext that is currently in use.�rr�r�r,r,r-r�MszSSLObject.contextcCs||j_dSr�r�r�Zctxr,r,r-r�RscCs|jjS)z!The SSLSession for client socket.�rr�r�r,r,r-r�VszSSLObject.sessioncCs||j_dSr�r�r�r�r,r,r-r�[scCs|jjS)z.Was the client session reused during handshake�r�session_reusedr�r,r,r-r"_szSSLObject.session_reusedcCs|jjS)z%Whether this is a server-side socket.)rr�r�r,r,r-r�dszSSLObject.server_sidecCs|jjS)z^The currently set server hostname (for SNI), or ``None`` if no
        server hostname is set.)rr�r�r,r,r-r�iszSSLObject.server_hostname�cCs(|dk	r|j�||�}n|j�|�}|S)z�Read up to 'len' bytes from the SSL object and return them.

        If 'buffer' is provided, read into this buffer and return the number of
        bytes read.
        N)r�read)r�r��buffer�vr,r,r-r$oszSSLObject.readcCs|j�|�S)z�Write 'data' to the SSL object and return the number of bytes
        written.

        The 'data' argument must support the buffer interface.
        )r�write�r�r�r,r,r-r'{szSSLObject.writecCs|j�|�S)z�Returns a formatted version of the data in the certificate provided
        by the other end of the SSL channel.

        Return None if no certificate was provided, {} if a certificate was
        provided, but not validated.
        )r�getpeercert�r�Zbinary_formr,r,r-r)�szSSLObject.getpeercertcCstjr|j��SdS)z�Return the currently selected NPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if NPN is not supported by one
        of the peers.N)r;rr�selected_npn_protocolr�r,r,r-r+�szSSLObject.selected_npn_protocolcCstjr|j��SdS)z�Return the currently selected ALPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if ALPN is not supported by one
        of the peers.N)r;rr�selected_alpn_protocolr�r,r,r-r,�sz SSLObject.selected_alpn_protocolcCs
|j��S)z_Return the currently selected cipher as a 3-tuple ``(name,
        ssl_version, secret_bits)``.)r�cipherr�r,r,r-r-�szSSLObject.ciphercCs
|j��S)z�Return a list of ciphers shared by the client during the handshake or
        None if this is not a valid server connection.
        )r�shared_ciphersr�r,r,r-r.�szSSLObject.shared_cipherscCs
|j��S)z�Return the current compression algorithm in use, or ``None`` if
        compression was not negotiated or not supported by one of the peers.)r�compressionr�r,r,r-r/�szSSLObject.compressioncCs
|j��S)z8Return the number of bytes that can be read immediately.)r�pendingr�r,r,r-r0�szSSLObject.pendingcCs|j��dS)zStart the SSL/TLS handshake.N)r�do_handshaker�r,r,r-r1�szSSLObject.do_handshakecCs
|j��S)z!Start the SSL shutdown handshake.)r�shutdownr�r,r,r-�unwrap�szSSLObject.unwrapr�cCs|j�|�S)z�Get channel binding data for current connection.  Raise ValueError
        if the requested `cb_type` is not supported.  Return bytes of the data
        or None if the data is not available (e.g. before the handshake).)r�get_channel_binding�r�Zcb_typer,r,r-r4�szSSLObject.get_channel_bindingcCs
|j��S)zZReturn a string identifying the protocol version used by the
        current SSL channel. �rr�r�r,r,r-r��szSSLObject.versioncCs
|j��Sr�)r�verify_client_post_handshaker�r,r,r-r7�sz&SSLObject.verify_client_post_handshake)FNNN)r#N)F)r�)r8r9r:rDrr�r�rr�rr�r"r�r�r$r'r)r+r,r-r.r/r0r1r3r4r�r7r,r,r,r-r,sH�








	
rcCstt|j�j|_|S)z*Copy docstring from SSLObject to SSLSocket)�getattrrr8rD)�funcr,r,r-�_sslcopydoc�sr:cseZdZdZdd�ZedX�fdd�	�Zeed	d
���Z	e	j
dd
��Z	eedd
���Zej
dd
��Zeedd���Zdd�Z
dYdd�Zdd�ZdZdd�Zdd�Zed[dd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd\�fd)d*�	Zd]�fd+d,�	Zd-d.�Zd^�fd/d0�	Zd_�fd1d2�	Zd`�fd3d4�	Zda�fd5d6�	Zdb�fd7d8�	Zdc�fd9d:�	Z d;d<�Z!d=d>�Z"ed?d@��Z#�fdAdB�Z$edCdD��Z%edEdF��Z&�fdGdH�Z'edddIdJ��Z(�fdKdL�Z)dMdN�Z*dOdP�Z+�fdQdR�Z,ededTdU��Z-edVdW��Z.�Z/S)f�	SSLSocketz�This class implements a subtype of socket.socket that wraps
    the underlying OS socket in an SSL context when necessary, and
    provides read and write methods over that channel. cOst|jj�d���dS)NzX does not have a public constructor. Instances are returned by SSLContext.wrap_socket().rrr,r,r-r�s�zSSLSocket.__init__FTNc

s�|�tt�tkrtd��|r8|r(td��|dk	r8td��|jrJ|sJtd��t|j|j	|j
|��d�}|j|f|�}	t
t|	�jf|�|	�|���|��||	_||	_d|	_d|	_||	_|�|�|	_||	_||	_z|	��Wn6tk
�r}
z|
jtjkr��d}W5d}
~
XYnXd}||	_ |�r�zH|	jj!|	||	j|	|	jd�|	_|�rj|	��}|d	k�rbtd
��|	�"�Wn$ttfk
�r�|	�#��YnX|	S)Nz!only stream sockets are supportedz4server_hostname can only be specified in client modez,session can only be specified in client modez'check_hostname requires server_hostname)�family�type�proto�filenoFT�rr��zHdo_handshake_on_connect should not be specified for non-blocking sockets)$Z
getsockoptrr�r}�NotImplementedErrorr�r�dictr<r=r>r?r�r�r;r�
settimeout�
gettimeout�detach�_context�_sessionZ_closedrr�r�r�r�r��getpeernamer��errnoZENOTCONN�
_connected�_wrap_socketr1�close)
r�r�r�r�r�r�r�r�r�r��eZ	connected�timeoutr�r,r-r��sj
��
zSSLSocket._createcCs|jSr�)rGr�r,r,r-r�szSSLSocket.contextcCs||_||j_dSr�)rGrr�rr,r,r-r�scCs|jdk	r|jjSdSr�rr�r,r,r-r� s
zSSLSocket.sessioncCs||_|jdk	r||j_dSr�)rHrr�r r,r,r-r�&s
cCs|jdk	r|jjSdSr�r!r�r,r,r-r",s
zSSLSocket.session_reusedcCstd|jj��dS)NzCan't dup() %s instances)rBr�r8r�r,r,r-�dup2s�z
SSLSocket.dupcCsdSr�r,)r��msgr,r,r-�_checkClosed6szSSLSocket._checkClosedcCs|js|��dSr�)rKrIr�r,r,r-�_check_connected:szSSLSocket._check_connectedr#c
Cs�|��|jdkrtd��z*|dk	r4|j�||�WS|j�|�WSWnVtk
r�}z8|jdtkr�|jr�|dk	r|WY�dSWY�dSn�W5d}~XYnXdS)zORead up to LEN bytes and return them.
        Return zero-length string on EOF.Nz'Read on closed or unwrapped SSL socket.rr/)rRrr�r$rr�Z
SSL_ERROR_EOFr�)r�r�r%�xr,r,r-r$Bs

zSSLSocket.readcCs&|��|jdkrtd��|j�|�S)zhWrite DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted.Nz(Write on closed or unwrapped SSL socket.)rRrr�r'r(r,r,r-r'Ws
zSSLSocket.writecCs|��|��|j�|�Sr�)rRrSrr)r*r,r,r-r)`szSSLSocket.getpeercertcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr+r�r,r,r-r+fszSSLSocket.selected_npn_protocolcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr,r�r,r,r-r,nsz SSLSocket.selected_alpn_protocolcCs$|��|jdkrdS|j��SdSr�)rRrr-r�r,r,r-r-vs
zSSLSocket.ciphercCs$|��|jdkrdS|j��SdSr�)rRrr.r�r,r,r-r.~s
zSSLSocket.shared_cipherscCs$|��|jdkrdS|j��SdSr�)rRrr/r�r,r,r-r/�s
zSSLSocket.compressionrcsF|��|jdk	r4|dkr(td|j��|j�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to send() on %s)rRrr�r�r'r��send)r�r�r
r�r,r-rU�s
��zSSLSocket.sendcsL|��|jdk	r"td|j��n&|dkr8t��||�St��|||�SdS)Nz%sendto not allowed on instances of %s)rRrr�r�r��sendto)r�r�Z
flags_or_addrr�r�r,r-rV�s
�zSSLSocket.sendtocOstd|j��dS)Nz&sendmsg not allowed on instances of %s�rBr�rr,r,r-�sendmsg�s�zSSLSocket.sendmsgc
s�|��|jdk	r�|dkr(td|j��d}t|��H}|�d��2}t|�}||krn|�||d��}||7}qJW5QRXW5QRXnt��	||�SdS)Nrz6non-zero flags not allowed in calls to sendall() on %s�B)
rRrr�r��
memoryview�castr�rUr��sendall)r�r�r
r�ZviewZ	byte_viewZamountr&r�r,r-r\�s
�� zSSLSocket.sendallcs,|jdk	r|�|||�St��|||�SdS)z�Send a file, possibly by using os.sendfile() if this is a
        clear-text socket.  Return the total number of bytes sent.
        N)rZ_sendfile_use_sendr��sendfile)r��file�offsetr�r�r,r-r]�s
zSSLSocket.sendfilecsD|��|jdk	r2|dkr(td|j��|�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to recv() on %s)rRrr�r�r$r��recv�r�Zbuflenr
r�r,r-r`�s
��
zSSLSocket.recvcsj|��|r|dkrt|�}n|dkr*d}|jdk	rV|dkrJtd|j��|�||�St��|||�SdS)Nr#rz8non-zero flags not allowed in calls to recv_into() on %s)rRr�rr�r�r$r��	recv_into�r�r%�nbytesr
r�r,r-rb�s

��zSSLSocket.recv_intocs4|��|jdk	r"td|j��nt��||�SdS)Nz'recvfrom not allowed on instances of %s)rRrr�r�r��recvfromrar�r,r-re�s
�zSSLSocket.recvfromcs6|��|jdk	r"td|j��nt��|||�SdS)Nz,recvfrom_into not allowed on instances of %s)rRrr�r�r��
recvfrom_intorcr�r,r-rf�s
�zSSLSocket.recvfrom_intocOstd|j��dS)Nz&recvmsg not allowed on instances of %srWrr,r,r-�recvmsg�s�zSSLSocket.recvmsgcOstd|j��dS)Nz+recvmsg_into not allowed on instances of %srWrr,r,r-�recvmsg_into�s�zSSLSocket.recvmsg_intocCs$|��|jdk	r|j��SdSdS)Nr)rRrr0r�r,r,r-r0�s

zSSLSocket.pendingcs|��d|_t��|�dSr�)rRrr�r2)r�Zhowr�r,r-r2�szSSLSocket.shutdowncCs.|jr|j��}d|_|Stdt|���dS�NzNo SSL wrapper around )rr2r�r�)r��sr,r,r-r3s

zSSLSocket.unwrapcCs$|jr|j��Stdt|���dSri)rr7r�r�r�r,r,r-r7s
z&SSLSocket.verify_client_post_handshakecsd|_t���dSr�)rr��_real_closer�r�r,r-rkszSSLSocket._real_closec	CsF|��|��}z$|dkr(|r(|�d�|j��W5|�|�XdS)NrA)rSrErDrr1)r��blockrOr,r,r-r1s
zSSLSocket.do_handshakec	s�|jrtd��|js|jdk	r&td��|jj|d|j||jd�|_z@|rVt��	|�}nd}t��
|�|s~d|_|jr~|��|WSt
tfk
r�d|_�YnXdS)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!Fr@T)r�r�rKrr�rLr�rHr��
connect_ex�connectr�r1r�)r�r�rmZrcr�r,r-�
_real_connect!s0�zSSLSocket._real_connectcCs|�|d�dS)�QConnects to remote ADDR, and then wraps the connection in
        an SSL channel.FN�ro�r�r�r,r,r-rn;szSSLSocket.connectcCs|�|d�S)rpTrqrrr,r,r-rm@szSSLSocket.connect_excs.t���\}}|jj||j|jdd�}||fS)z�Accepts a new connection from a remote client, and returns
        a tuple containing that new connection wrapped with a server-side
        SSL channel, and the address of the remote client.T)r�r�r�)r��acceptr�r�r�r�)r�Znewsockr�r�r,r-rsEs�zSSLSocket.acceptr�cCs4|jdk	r|j�|�S|tkr,td�|���dSdS)Nz({0} channel binding type not implemented)rr4�CHANNEL_BINDING_TYPESr�r�r5r,r,r-r4Qs
�zSSLSocket.get_channel_bindingcCs|jdk	r|j��SdSdSr�r6r�r,r,r-r�\s

zSSLSocket.version)FTTNNN)N)r#N)F)r)N)r)rN)r#r)Nr)r#r)Nr)F)r�)0r8r9r:rDrr�r�rr:r�rr�r"rPrRrSr$r'r)r+r,r-r.r/rUrVrXr\r]r`rbrerfrgrhr0r2r3r7rkr1rornrmrsr4r�r�r,r,r�r-r;�s��>



	











r;Tc
Csl|r|std��|r |s td��t|�}
||
_|r<|
�|�|rL|
�||�|	rZ|
�|	�|
j||||d�S)Nz5certfile must be specified for server-side operationsr)r�r�r�r�)r�r�rr�rZset_ciphersr�)r�rrr�r�ssl_version�ca_certsr�r�Zciphersr�r,r,r-r�is$

�r�cCs�ddlm}ddlm}d}d}z|�|dd����d}Wn$tk
rbtd	||f��Yn0X||dd�|�}||d|f|d
d��SdS)a�Return the time in seconds since the Epoch, given the timestring
    representing the "notBefore" or "notAfter" date from a certificate
    in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).

    "notBefore" or "notAfter" dates must use UTC (RFC 5280).

    Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    UTC should be specified as GMT (see ASN1_TIME_print())
    r)�strptime)�timegm)ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecz %d %H:%M:%S %Y GMTNrjrhz*time data %r does not match format "%%b%s"rirm)�timerwZcalendarrx�index�titler�)Z	cert_timerwrxZmonthsZtime_formatZmonth_numberZttr,r,r-�cert_time_to_seconds�s
�r|z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----csRtt�|�dd��tg}|�fdd�tdt��d�D�7}|�td�d�|�S)z[Takes a certificate in binary DER format and returns the
    PEM version of it as a string.�ASCII�strictcsg|]}�||d��qS)�@r,)r4�i��fr,r-�
<listcomp>�sz(DER_cert_to_PEM_cert.<locals>.<listcomp>rr�
)	r��base64Zstandard_b64encode�
PEM_HEADER�ranger�r��
PEM_FOOTERr�)Zder_cert_bytesZssr,r�r-�DER_cert_to_PEM_cert�s
"r�cCs\|�t�stdt��|���t�s0tdt��|��tt�tt��}t�|�	dd��S)zhTakes a certificate in ASCII PEM format and returns the
    DER-encoded version of it as a byte sequencez(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %sr}r~)
r)r�r��strip�endswithr�r�r�Zdecodebytesr�)Zpem_cert_string�dr,r,r-�PEM_cert_to_DER_cert�s
��r�c

Csd|\}}|dk	rt}nt}t|||d�}t|��&}|�|��}|�d�}	W5QRXW5QRXt|	�S)z�Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If 'ca_certs' is specified, validate the server cert against it.
    If 'ssl_version' is specified, use it in the connection attempt.N)rr�T)r
r�_create_stdlib_contextr~r�r)r�)
r�rurvZhostZportrr�r�ZsslsockZdercertr,r,r-�get_server_certificate�s�
r�cCst�|d�S)Nz	<unknown>)�_PROTOCOL_NAMESr�)Z
protocol_coder,r,r-�get_protocol_name�sr�)nrDr�r��collectionsr�enumrZ_EnumrZ_IntEnumrZ_IntFlagr;rrrr	r
rrr
rrrrrrr�rr�rrrrr�ImportErrorrrrrrrr r!r"r#r$r%�	_convert_r8r&rr'�__members__�itemsr�r8Z_SSLv2_IF_EXISTSr7r=rHrgr�ryrzr{r|r}r~rr�r�r�rJr�r�Zsocket_errorrtrZHAS_NEVER_CHECK_COMMON_NAMEZ_RESTRICTED_SERVER_CIPHERSr�r�r�r�r�r�r�r�r�r�r�rrrZ_create_default_https_contextr�rr:r;r�r�r�r|r�r�r�r�r�r�r,r,r,r-�<module>s�Y$0������
)
1#9�z�#�/�


xdrlib.cpython-38.opt-1.pyc000064400000020037151450073350011424 0ustar00U

e5d�@sxdZddlZddlmZddlmZddddgZGd	d�de�ZGd
d�de�Z	dd�Z
Gd
d�d�ZGdd�d�ZdS)zRImplements (a subset of) Sun XDR -- eXternal Data Representation.

See: RFC 1014

�N)�BytesIO��wraps�Error�Packer�Unpacker�ConversionErrorc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rz�Exception class for this module. Use:

    except xdrlib.Error as var:
        # var has the Error instance for the exception

    Public ivars:
        msg -- contains the message

    cCs
||_dS�N)�msg)�selfr
�r�/usr/lib64/python3.8/xdrlib.py�__init__szError.__init__cCs
t|j�Sr	)�reprr
�rrrr
�__repr__szError.__repr__cCs
t|j�Sr	)�strr
rrrr
�__str__sz
Error.__str__N)�__name__�
__module__�__qualname__�__doc__rrrrrrr
rs	c@seZdZdS)rN)rrrrrrr
r scst���fdd��}|S)z5 Wrap any raised struct.errors in a ConversionError. c
sFz�||�WStjk
r@}zt|jd�d�W5d}~XYnXdS�Nr)�struct�errorr�args)r�value�e��functionrr
�result&sz&raise_conversion_error.<locals>.resultr)rr rrr
�raise_conversion_error#sr!c@s�eZdZdZdd�Zdd�Zdd�ZeZedd	��Z	ed
d��Z
e
Zdd
�Zdd�Z
e
Zedd��Zedd��Zdd�ZeZdd�ZeZeZdd�Zdd�Zdd�ZdS)rz0Pack various data representations into a buffer.cCs|��dSr	��resetrrrr
r2szPacker.__init__cCst�|_dSr	)r�_Packer__bufrrrr
r#5szPacker.resetcCs
|j��Sr	)r$�getvaluerrrr
�
get_buffer8szPacker.get_buffercCs|j�t�d|��dS)N�>L�r$�writerZpack�r�xrrr
�	pack_uint=szPacker.pack_uintcCs|j�t�d|��dS)N�>lr(r*rrr
�pack_intAszPacker.pack_intcCs"|r|j�d�n|j�d�dS)Nss)r$r)r*rrr
�	pack_boolGszPacker.pack_boolc
Cs�z|�|d?d@�Wn8ttjfk
rN}zt|jd�d�W5d}~XYnXz|�|d@�Wn8ttjfk
r�}zt|jd�d�W5d}~XYnXdS)N� l��r)r,�	TypeErrorrrrr)rr+rrrr
�pack_uhyperKs"zPacker.pack_uhypercCs|j�t�d|��dS)N�>fr(r*rrr
�
pack_floatWszPacker.pack_floatcCs|j�t�d|��dS)N�>dr(r*rrr
�pack_double[szPacker.pack_doublecCsP|dkrtd��|d|�}|ddd}||t|�d}|j�|�dS)Nr� fstring size must be nonnegative���)�
ValueError�lenr$r))r�n�s�datarrr
�pack_fstring_szPacker.pack_fstringcCs"t|�}|�|�|�||�dSr	)r<r,r@)rr>r=rrr
�pack_stringis
zPacker.pack_stringcCs*|D]}|�d�||�q|�d�dS)N�r)r,)r�list�	pack_item�itemrrr
�	pack_listqs

zPacker.pack_listcCs*t|�|krtd��|D]}||�qdS)Nzwrong array size)r<r;)rr=rCrDrErrr
�pack_farraywszPacker.pack_farraycCs$t|�}|�|�|�|||�dSr	)r<r,rG)rrCrDr=rrr
�
pack_array}s
zPacker.pack_arrayN)rrrrrr#r&Zget_bufr!r,r.Z	pack_enumr/r2Z
pack_hyperr4r6r@Zpack_fopaquerAZpack_opaqueZ
pack_bytesrFrGrHrrrr
r/s2




c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZeZdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZeZdd�ZeZeZd d!�Zd"d#�Zd$d%�Zd&S)'rz;Unpacks various data representations from the given buffer.cCs|�|�dSr	r"�rr?rrr
r�szUnpacker.__init__cCs||_d|_dSr)�_Unpacker__buf�_Unpacker__posrIrrr
r#�szUnpacker.resetcCs|jSr	�rKrrrr
�get_position�szUnpacker.get_positioncCs
||_dSr	rL)rZpositionrrr
�set_position�szUnpacker.set_positioncCs|jSr	)rJrrrr
r&�szUnpacker.get_buffercCs|jt|j�krtd��dS)Nzunextracted data remains)rKr<rJrrrrr
�done�sz
Unpacker.donecCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r'r�rKrJr<�EOFErrorrZunpack�r�i�jr?rrr
�unpack_uint�szUnpacker.unpack_uintcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r-rrPrRrrr
�
unpack_int�szUnpacker.unpack_intcCst|���Sr	)�boolrVrrrr
�unpack_bool�szUnpacker.unpack_boolcCs |��}|��}t|�d>|BS)Nr0)rU�int)r�hi�lorrr
�
unpack_uhyper�szUnpacker.unpack_uhypercCs|��}|dkr|d}|S)Nll)r\r*rrr
�unpack_hyper�szUnpacker.unpack_hypercCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r3rrPrRrrr
�unpack_float�szUnpacker.unpack_floatcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)N�r5rrPrRrrr
�
unpack_double�szUnpacker.unpack_doublecCsT|dkrtd��|j}||ddd}|t|j�kr<t�||_|j|||�S)Nrr7r8r9)r;rKr<rJrQ)rr=rSrTrrr
�unpack_fstring�szUnpacker.unpack_fstringcCs|��}|�|�Sr	)rUra)rr=rrr
�
unpack_string�szUnpacker.unpack_stringcCsBg}|��}|dkrq>|dkr,td|f��|�}|�|�q|S)NrrBz0 or 1 expected, got %r)rUr�append)r�unpack_itemrCr+rErrr
�unpack_list�szUnpacker.unpack_listcCs"g}t|�D]}|�|��q|Sr	)�rangerc)rr=rdrCrSrrr
�
unpack_farray�szUnpacker.unpack_farraycCs|��}|�||�Sr	)rUrg)rrdr=rrr
�unpack_array�szUnpacker.unpack_arrayN)rrrrrr#rMrNr&rOrUrVZunpack_enumrXr\r]r^r`raZunpack_fopaquerbZ
unpack_opaqueZunpack_bytesrergrhrrrr
r�s.
)
rr�ior�	functoolsr�__all__�	Exceptionrrr!rrrrrr
�<module>sUmodulefinder.cpython-38.opt-1.pyc000064400000037267151450073350012632 0ustar00U

e5dn_�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ejdZejdZ
ejdZejdZeefZejZdZdZdZd	Zd
ZdZdZiZd
d�ZiZdd�Zddd�ZGdd�d�ZGdd�d�Zdd�Z e!dk�rz
e �Z"Wne#k
�re$d�YnXdS)z3Find modules used by a script, using introspection.�N�
LOAD_CONST�IMPORT_NAME�
STORE_NAME�STORE_GLOBAL������cCst�|g��|�dS�N)�packagePathMap�
setdefault�append)Zpackagename�path�r�$/usr/lib64/python3.8/modulefinder.py�AddPackagePath(srcCs|t|<dSr)�replacePackageMap)Zoldname�newnamerrr�ReplacePackage3srcCstjj��tjj�||�}|dkr8tdj|d�|d��|jtjjkrVddddt	ffS|jtjj
krtddddtffS|j}|j�
|�r�dtj�|�ddtffSt|jtjj�r�t}n<t|jtjj�r�t}n&t|jtjj�r�t}nddddtffSt�|�}tj�|�d}|||d|ffS)zDAn importlib reimplementation of imp.find_module (for our purposes).NzNo module named {name!r})�name�����rb)�	importlib�	machinery�
PathFinder�invalidate_caches�	find_spec�ImportError�format�loader�BuiltinImporter�
_C_BUILTIN�FrozenImporter�
_PY_FROZEN�origin�
is_package�osr�dirname�_PKG_DIRECTORY�
isinstance�SourceFileLoader�
_PY_SOURCE�ExtensionFileLoader�_C_EXTENSION�SourcelessFileLoader�_PY_COMPILED�
_SEARCH_ERROR�io�	open_code�splitext)rr�specZ	file_pathZkind�file�suffixrrr�_find_module7s*
r:c@seZdZddd�Zdd�ZdS)�ModuleNcCs(||_||_||_d|_i|_i|_dSr)�__name__�__file__�__path__�__code__�globalnames�starimports)�selfrr8rrrr�__init__fszModule.__init__cCsLd|jf}|jdk	r&|d|jf}|jdk	r@|d|jf}|d}|S)Nz	Module(%rz, %r�))r<r=r>)rB�srrr�__repr__ss

zModule.__repr__)NN)r<�
__module__�__qualname__rCrFrrrrr;ds

r;c@s�eZdZd6dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zd7dd�Z	d8dd�Z
dd�Zdd�Zd9dd�Z
dd�Zdd�Zdd�Zd d!�Zd:d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd;d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)<�ModuleFinderNrcCsZ|dkrtj}||_i|_i|_||_d|_|dk	r8|ng|_|dk	rJ|ng|_g|_dS)Nr)	�sysr�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rBrrMrOrPrrrrC~szModuleFinder.__init__cGsV||jkrRt|j�D]}tddd�qt|dd�|D]}tt|�dd�q6t�dS)N�   � ��end)rM�rangerN�print�repr)rB�level�str�args�i�argrrr�msg�s
zModuleFinder.msgcGs,|d}||jkr(|jd|_|j|�dS�Nrr�rMrNr^�rBr[rYrrr�msgin�s
zModuleFinder.msgincGs,|d}||jkr(|jd|_|j|�dSr_r`rarrr�msgout�s
zModuleFinder.msgoutc	CsB|�dd|�t�|�� }ddtf}|�d|||�W5QRXdS)Nr�
run_scriptrr�__main__)r^r4r5r.�load_module)rB�pathname�fp�stuffrrrrd�s
zModuleFinder.run_scriptc	CsTtj�|�\}}tj�|�\}}t�|�� }|dtf}|�||||�W5QRXdS)Nr)r)r�splitr6r4r5r.rf)rBrg�dirrZextrhrirrr�	load_file�s

zModuleFinder.load_filerc	Cs\|�dd||||�|j||d�}|�||�\}}|�||�}|sF|S|jrX|�||�dS)Nr�import_hook�rY)r^�determine_parent�find_head_package�	load_tailr>�ensure_fromlist)	rBr�caller�fromlistrY�parent�q�tail�mrrrrm�szModuleFinder.import_hookcCs&|�dd||�|r|dkr,|�dd�dS|j}|dkr�|jrH|d8}|dkrl|j|}|�dd|�|S|�d�|kr�td��d�|�d�d|��}|j|}|�dd|�|S|jr�|j|}|�dd|�|Sd|k�r|�	d�}|d|�}|j|}|�dd|�|S|�dd�dS)	N�rorzdetermine_parent -> Nonerzdetermine_parent ->�.zrelative importpath too deep)
rbrcr<r>rK�countr �joinrj�rfind)rBrsrYZpnamerur\rrrro�s<





zModuleFinder.determine_parentcCs�|�dd||�d|kr@|�d�}|d|�}||dd�}n|}d}|r\d|j|f}n|}|�|||�}|r�|�dd||f�||fS|r�|}d}|�|||�}|r�|�dd||f�||fS|�dd|�td	|��dS)
Nryrprzrr�%s.%szfind_head_package ->�"raise ImportError: No module named�No module named )rb�findr<�
import_modulercr )rBrurr\�headrwZqnamervrrrrp�s.
zModuleFinder.find_head_packagecCs�|�dd||�|}|r�|�d�}|dkr2t|�}|d|�||dd�}}d|j|f}|�|||�}|s|�dd|�td|��q|�dd	|�|S)
Nryrqrzrrr~rr�zload_tail ->)rbr��lenr<r�rcr )rBrvrwrxr\r�Zmnamerrrrq�s
zModuleFinder.load_tailcCs�|�dd|||�|D]d}|dkrD|sz|�|�}|rz|�||d�qt||�sd|j|f}|�|||�}|std|��qdS)Nryrr�*rr~r�)r^�find_all_submodulesrr�hasattrr<r�r )rBrxrt�	recursive�sub�all�subnameZsubmodrrrrrs

zModuleFinder.ensure_fromlistc
	Cs�|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}|jD]�}zt�|�}Wn&tk
r�|�	dd|�YqTYnX|D]R}d}|D]0}t
|�}	||	d�|kr�|d|	�}q�q�|r�|dkr�|||<q�qT|��S)Nrzcan't list directoryrC)r>rr�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr)�listdir�OSErrorr^r��keys)
rBrxrK�suffixesrk�namesr�modZsuff�nrrrr�s.

z ModuleFinder.find_all_submodulescCs
|�dd|||�z|j|}Wntk
r4YnX|�dd|�|S||jkrb|�dd�dS|r�|jdkr�|�dd�dSz|�||o�|j|�\}}}Wn$tk
r�|�ddd�YdSXz|�	||||�}W5|r�|��X|r�t
|||�|�dd|�|S)Nrr�zimport_module ->zimport_module -> None)rbrK�KeyErrorrcrLr>�find_moduler �closerf�setattr)rBZpartname�fqnamerurxrhrgrirrrr�.s:
�
zModuleFinder.import_modulec
Cs(|\}}}|�dd||od|�|tkrF|�||�}|�dd|�|S|tkr`t|��|d�}	n||tkr�z|��}
tj	�
|
|i�Wn:tk
r�}z|�ddt|�|��W5d}~XYnXt
�t|
�dd��}	nd}	|�|�}||_|	�r|j�r|�|	�}	|	|_|�|	|�|�dd|�|S)Nrrfrhzload_module ->�execzraise ImportError: �)rbr+�load_packagercr.�compile�readr2r�_bootstrap_external�
_classify_pycr rZ�marshal�loads�
memoryview�
add_moduler=rP�replace_paths_in_coder?�	scan_code)rBr�rhrg�	file_infor9�mode�typerx�co�data�excrrrrfNs4


zModuleFinder.load_modulecCs<||jkri|j|<|r*d|j||j<nd|j|d<dS)Nr�-)rLr<)rBrrsrrr�_add_badmoduleks


zModuleFinder._add_badmodulecCsB||jkr|�||�dSz|j|||d�Wn~tk
rn}z"|�ddt|��|�||�W5d}~XYn�tk
r�}z"|�ddt|��|�||�W5d}~XYn�X|�r>|D]�}|d|}||jkr�|�||�q�z|j|||g|d�Wq�tk
�r:}z"|�ddt|��|�||�W5d}~XYq�Xq�dS)NrnrzImportError:zSyntaxError:rz)rLr�rmr r^rZ�SyntaxError)rBrrsrtrYr^r��fullnamerrr�_safe_import_hookss,

zModuleFinder._safe_import_hookccs�|j}|j}|j}dd�t�|�D�}t|�D]�\}\}}|tkrTd||ffVq.|tkr.|dkr.||dd||ddkr�tkr.nq.|||dd}	|||dd}
|	dkr�d|
||ffVq.d|	|
||ffVq.q.dS)	NcSs"g|]\}}}|tkr||f�qSr)�EXTENDED_ARG)�.0�_�opr]rrr�
<listcomp>�s�z-ModuleFinder.scan_opcodes.<locals>.<listcomp>�storerrr�absolute_import�relative_import)	�co_code�co_names�	co_consts�disZ_unpack_opargs�	enumerate�	STORE_OPSrr)rBr��coder��constsZopargsr\r�ZopargrYrtrrr�scan_opcodes�s(��
zModuleFinder.scan_opcodescCs�|j}|j}||�D�]F\}}|dkr8|\}d|j|<q|dk�r|\}}d}	|dk	rpd|krbd}	dd�|D�}|j|||dd�|	�r\d}
|jr�|j�|jd	|�}
|
dkr�|j�|�}
|
dk	r�|j�|
j�|j	�|
j	�|
j
dkr�d|j	|<n
d|j	|<q|d
k�rT|\}}}|�r0|j||||d�n"|j||d�}|j|jd|dd�qt|��q|j
D]"}
t|
t|���rd|�|
|��qddS)Nr�rr�rr�cSsg|]}|dkr|�qS)r�r)r��frrrr��sz*ModuleFinder.scan_code.<locals>.<listcomp>rnrzr�)r�r�r@r�r>rK�getr<�updaterAr?ro�RuntimeErrorr�r,r�r�)rBr�rxr��scannerZwhatr[rrtZ	have_starZmmrYru�crrrr��sH





zModuleFinder.scan_codecCs�|�dd||�t�|�}|r"|}|�|�}||_|g|_|jt�|g�|_|�d|j�\}}}z&|�	||||�|�
dd|�|W�S|r�|��XdS)Nrr�rCzload_package ->)rbrr�r�r=r>r
r�r�rfrc)rBr�rgrrxrhZbufrirrrr��s

zModuleFinder.load_packagecCs*||jkr|j|St|�|j|<}|Sr)rKr;)rBr�rxrrrr��s

zModuleFinder.add_modulecCsn|dk	r|jd|}n|}||jkr<|�dd|�t|��|dkrd|tjkr^ddddtffS|j}t||�S)Nrzrzfind_module -> Excludedr)	r<rOrcr rJ�builtin_module_namesr$rr:)rBrrrur�rrrr��s

zModuleFinder.find_modulecCst�tdd�tdd�t|j���}|D]B}|j|}|jrRtddd�ntddd�td||jpnd	�q0|��\}}|r�t�td
�|D]*}t|j|���}td|dd
�|��q�|�rt�tddd�td�|D]*}t|j|���}td|dd
�|��q�dS)z�Print a report to stdout, listing the found modules with their
        paths, as well as modules that are missing, or seem to be missing.
        z
  %-25s %s)�NameZFile)�----r��PrSrTrxz%-25srzMissing modules:�?z
imported fromz, z7Submodules that appear to be missing, but could also bez#global names in the parent package:N)	rW�sortedrKr�r>r=�any_missing_mayberLr|)rBr��keyrx�missing�mayberZmodsrrr�reports0
zModuleFinder.reportcCs|��\}}||S)z�Return a list of modules that appear to be missing. Use
        any_missing_maybe() if you want to know which modules are
        certain to be missing, and which *may* be missing.
        )r�)rBr�r�rrr�any_missing"szModuleFinder.any_missingcCs�g}g}|jD]�}||jkrq|�d�}|dkr<|�|�q||dd�}|d|�}|j�|�}|dk	r�||j|kr�|�|�q�||jkr�q�|jr�|�|�q�|�|�q|�|�q|��|��||fS)a�Return two lists, one with modules that are certainly missing
        and one with modules that *may* be missing. The latter names could
        either be submodules *or* just global names in the package.

        The reason it can't always be determined is that it's impossible to
        tell which names are imported when "from module import *" is done
        with an extension module, short of actually importing it.
        rzrrN)	rLrOr}rrKr�r@rA�sort)rBr�r�rr\r�ZpkgnameZpkgrrrr�*s0	




zModuleFinder.any_missing_maybecCs�tj�|j�}}|jD]*\}}|�|�r||t|�d�}qDq|jr�||jkr�||krr|�	dd||f�n|�	dd|f�|j�
|�t|j�}t
t|��D](}t||t|��r�|�||�||<q�|jt|�|d�S)Nrzco_filename %r changed to %rz co_filename %r remains unchanged)r��co_filename)r)r�normpathr�rP�
startswithr�rMrQrcr�listr�rVr,r�r��replace�tuple)rBr�Znew_filenameZoriginal_filenamer��rr�r\rrrr�Xs&
��
z"ModuleFinder.replace_paths_in_code)NrNN)NNr)r)r)r)N)r<rGrHrCr^rbrcrdrlrmrorprqrrr�r�rfr�r�r�r�r�r�r�r�r�r�r�rrrrrI|s2
	

#
 
1
".rIc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnXd}d}g}g}|D]Z\}}	|dkr�|d}|dkr�d}|dkr�||	�tj�}|dkr�d}|dkrn|�|	�qn|s�d	}
n|d}
tj	dd�}tj	�
|
�|d<||}|dk�r.td
�|D]}tdt|���qt|||�}
|dd�D]`}|dk�r\d}�qF|�r�|dd�d
k�r�|
�
|dd�ddg�n
|
�
|�n
|
�|��qF|
�|
�|
��|
S)Nrrzdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:rR���z.*r�)�getoptrJ�argv�errorrWrjr)�pathseprrr*rXrIrmrlrdr�)r�Zoptsr[r^rMZdomodsZaddpathZexclude�o�aZscriptr�item�mfr]rrr�testpsX


r�rez
[interrupted])N)%�__doc__r�Zimportlib._bootstrap_externalr�importlib.machineryr�r)r4rJ�types�warningsZopmaprrrrr�r�r3r.r2r0r+r$r&r
rrrr:r;rIr�r<r��KeyboardInterruptrWrrrr�<module>sL




-w;

mailcap.cpython-38.opt-2.pyc000064400000013007151450073350011546 0ustar00U

e5dk#�@s�ddlZddlZddlZddgZdd�Ze�d�jZGdd�de�Z	d	d�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zddgfdd�Zd"dd�Zgfdd�Zdd�Zdd�Zdd �Zed!kr�e�dS)#�N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor)�r�)�entryrr�/usr/lib64/python3.8/mailcap.py�lineno_sort_key
sr	z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdS)�UnsafeMailcapInputN)�__name__�
__module__�__qualname__rrrrr
sr
c
Cs�i}d}t�D]~}zt|d�}Wntk
r8YqYnX|�t||�\}}W5QRX|��D]*\}}||krz|||<q`|||||<q`q|S)Nr�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs



cCsPdtjkr"tjd}|�tj�}n*dtjkr8tjd}nd}|ddddg}|S)NZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr3s


�rcCs t�dtd�t|d�\}}|S)Nz2readmailcapfile is deprecated, use getcaps instead�)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfileEs�r$c	Cs�i}|��}|sq�|ddks|��dkr,q|}|dd�dkrb|��}|sPd}|dd�|}q0t|�\}}|r|sxq|dk	r�||d<|d7}|�d	�}tt|��D]}||��||<q�d	�|���}||kr�||�|�q|g||<q||fS)
Nr�#����z\
�
rr�/)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrMs4	
rc
Cs�g}dt|�}}||kr>t|||�\}}|�|�|d}qt|�dkrNdS|d|d|dd�}}}d|i}|D]V}|�d�}|dkr�|}d}	n$|d|���}||dd���}	||kr�qz|	||<qz||fS)Nrrr�NN�view�=r&)r.�
parsefieldr1�findr+)
r2r3�i�n�fieldrr7�restZfkeyZfvaluerrrr,vs*

 

r,cCsP|}||kr<||}|dkr q<q|dkr2|d}q|d}q|||���|fS)N�;�\rr)r+)r2r;r<�start�crrrr9�s

r9r7z	/dev/nullc
Cs�t|�r"d|f}t�|t�dSt|||�}|D]`}d|krlt|d||�}|dkrXq2|rlt�|�dkrlq2t|||||�}	|	dk	r2|	|fSq2dS)NzHRefusing to use mailcap with filename %r. Use a safe temporary filename.r6�testr)�_find_unsafer r!r
�lookup�substr�system)
r�MIMEtyper�filename�plist�msg�entries�erC�commandrrrr�s 	
cslg}||kr|||}|�d�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr)rz/*csg|]}�|kr|�qSrr)�.0rM�rrr�
<listcomp>�szlookup.<locals>.<listcomp>rP)r�sortedr	)rrHrrLZ	MIMEtypesrrPrrE�s
rEcCsRd}dt|�}}||k�rN||}|d}|dkr^|dkrT|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�t|�r�d|f}t�|t�dS||}q|d	k�r@|}	||kr�||d
kr�|d}q�||	|�}
|d}t|
|�}t|��r6d||
f}t�|t�dS||}q|d|}q|S)Nr&rr�%r@�s�tz9Refusing to substitute MIME type %r into a shell command.�{�}z=Refusing to substitute parameter %r (%s) into a shell command)r.rDr r!r
�	findparam)r=rHrIrJ�resr;r<rBrKrA�nameZparamrrrrF�sH










rFcCsF|��d}t|�}|D](}|d|���|kr||d�SqdS)Nr8r&)r0r.)rZrJr<�prrrrX�srXc	Cs�ddl}t�}|jdd�s(t|�dStdt|j�d�D]�}|j||d�}t|�dkrjtd�dS|d}|d}t||d|�\}}|s�tdt�q:td|�t	�
|�}|r:td|�q:dS)	Nrrrz"usage: mailcap [MIMEtype file] ...r7zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr-r.�printr�typerrG)	r\rr;�argsrH�filerNrM�stsrrrrCs&

rCcCs�td�t�D]}td|�qt�|s0t�}td�t�t|�}|D]H}t|�||}|D].}t|�}|D]}td|||�qrt�qbqJdS)NzMailcap files:�	zMailcap entries:z  %-15s)r_rrrR)r�fnZckeysr`rLrM�keys�krrrr^s"
r^�__main__)N)rr �re�__all__r	�compile�searchrD�Warningr
rrr$rr,r9rrErFrXrCr^rrrrr�<module>s()

)symbol.cpython-38.pyc000064400000004546151450073350010515 0ustar00U

��.e=�@s�dZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJdKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[d\Z\iZ]e^e_��`��D]$\ZaZbeceb�ecd]�k�r�eae]eb<�q�[a[bd^S)_z;Non-terminal symbols of Python grammar (from "graminit.h").�iiiiiiiii	i
iii
iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[�N)d�__doc__Zsingle_inputZ
file_inputZ
eval_inputZ	decoratorZ
decoratorsZ	decoratedZ
async_funcdefZfuncdefZ
parametersZ
typedargslistZtfpdefZvarargslistZvfpdefZstmtZsimple_stmtZ
small_stmtZ	expr_stmtZ	annassignZtestlist_star_exprZ	augassignZdel_stmtZ	pass_stmtZ	flow_stmtZ
break_stmtZ
continue_stmtZreturn_stmtZ
yield_stmtZ
raise_stmtZimport_stmtZimport_nameZimport_fromZimport_as_nameZdotted_as_nameZimport_as_namesZdotted_as_namesZdotted_nameZglobal_stmtZ
nonlocal_stmtZassert_stmtZ
compound_stmtZ
async_stmtZif_stmtZ
while_stmtZfor_stmtZtry_stmtZ	with_stmtZ	with_itemZ
except_clauseZsuiteZnamedexpr_testZtestZtest_nocondZlambdefZlambdef_nocondZor_testZand_testZnot_testZ
comparisonZcomp_opZ	star_expr�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactorZpowerZ	atom_exprZatomZ
testlist_compZtrailerZ
subscriptlistZ	subscriptZsliceopZexprlistZtestlistZdictorsetmakerZclassdefZarglistZargumentZ	comp_iterZ
sync_comp_forZcomp_forZcomp_ifZ
encoding_declZ
yield_exprZ	yield_argZfunc_body_suiteZfunc_type_inputZ	func_typeZtypelistZsym_name�list�globals�items�_nameZ_value�type�r
r
�/usr/lib64/python3.8/symbol.py�<module>s�timeit.cpython-38.opt-2.pyc000064400000013445151450073350011441 0ustar00U

e5d�4�@s�ddlZddlZddlZddlZddddgZdZdZdZejZ	e
Zd	Zd
d�Z
Gdd�d�Zd
d
e	edfdd�Zd
d
e	eedfdd�Zddd�dd�Zedkr�e�e��dS)�N�Timer�timeit�repeat�
default_timerz<timeit-src>i@B�z�
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
cCs|�ddd|�S)N�
� )�replace)�src�indent�r�/usr/lib64/python3.8/timeit.py�reindentOsrc@sLeZdZddedfdd�Zd
dd�Zefdd�Zeefd	d
�Z	ddd�Z
dS)r�passNcCs�||_i}|dkrt�n|}d}t|t�rJt|td�|d}t|d�}n*t|�rl||d<|d7}d}d}ntd��t|t�r�t||td�t|d	�}n&t|�r�||d
<|d7}d}ntd
��t	j
|||d�}	|	|_t|	td�}
t|
||�|d|_
dS)N��execr��_setupz, _setup=_setupz_setup()z&setup is neither a string nor callable�Z_stmtz
, _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)�stmt�setup�init�inner)�timer�_globals�
isinstance�str�compile�dummy_src_namer�callable�
ValueError�template�formatr
rr)�selfrrr�globalsZlocal_nsZ	global_nsrZ
stmtprefixr
�coderrr
�__init__es6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|j�d�tf|jt<|j|d�dS)Nrr��file)�	linecache�	tracebackr
�len�splitr�cache�	print_exc)r#r(r)r*rrr
r.�s

�
zTimer.print_exccCsBt�d|�}t��}t��z|�||j�}W5|r<t��X|S�N)�	itertoolsr�gcZ	isenabledZdisableZenablerr)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs*g}t|�D]}|�|�}|�|�q|Sr/)�ranger�append)r#rr2�r�i�trrr
r�s

zTimer.repeatcCsPd}dD]8}||}|�|�}|r,|||�|dkr||fSq|d9}qdS)N�)r9�rg�������?�
)r)r#�callbackr7�jr2�
time_takenrrr
�	autorange�s


zTimer.autorange)N)N)�__name__�
__module__�__qualname__rr&r.�default_numberr�default_repeatrr?rrrr
rSs�
#
rcCst||||��|�Sr/)rr)rrrr2r$rrr
r�scCst||||��||�Sr/)rr)rrrrr2r$rrr
r�s)�_wrap_timerc
s|dkrtjdd�}ddl}z(|�|ddddddd	d
ddg	�\}}Wn:|jk
r�}zt|�td
�WY�dSd}~XYnXt}d�|�p�d}d�g}t}d}	d�ddddd��d�|D]�\}
}|
dkr�t|��|
dkr�|�	|�|
dk�r|�k�r|�ntdtj
d�dS|
dk�r6t|�}|dk�r6d}|
dk�rFtj}|
dk�rf|	�r^�d7�|	d7}	|
dkr�tt
d d!�dSq�d�|��p�d}ddl}tj�d|j�|dk	�r�||�}t|||�}
�dk�rd}|	�r�fd"d#�}z|
�|�\�}Wn|
��YdSX|	�rt�z|
�|��}Wn|
��YdSX���fd$d%�}|	�rztd&d'�t||���t��fd(d)�|D�}t|�}td*��dk�r�d+nd,|||�f�t|�}t|�}||d-k�rddl}|�d.||�||�ftd,d�dS)/Nr9rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�timeZclockZprocess�verbosezunit=�helpz#use -h/--help for command line helpr:rrg��&�.>g���ư>g����MbP?g�?)ZnsecZusecZmsecZsec�)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.r')z-rz--repeat)z-pz	--process)z-vz	--verbose)z-hz--helpr)�endcs.d}|dk}t|j||rdnd|�d��dS)Nz%{num} loop{s} -> {secs:.{prec}g} secsr9�sr)ZnumrKZsecsZprec)�printr")r2r>�msgZplural)�	precisionrr
r<?s�zmain.<locals>.callbackcs`�}|dk	r�|}n8dd����D�}|jdd�|D]\}}||kr8qNq8d�|||fS)NcSsg|]\}}||f�qSrr)�.0�unit�scalerrr
�
<listcomp>Ysz-main.<locals>.format_time.<locals>.<listcomp>T)�reversez%.*g %s)�items�sort)�dtrPrQZscales)rN�	time_unit�unitsrr
�format_timeSs
zmain.<locals>.format_timez
raw times: %sz, csg|]}|��qSrr)rOrV)r2rr
rRdszmain.<locals>.<listcomp>z"%d loop%s, best of %d: %s per looprKrrztThe test results are likely unreliable. The worst time (%s) was more than four times slower than the best time (%s).)�sys�argv�getopt�errorrLr�joinrD�intr5�stderrrF�process_time�__doc__�os�path�insert�curdirrr?r.r�map�min�max�warnings�
warn_explicit�UserWarning)�argsrEr\Zopts�errrrrrrG�o�arcr8r<�_Zraw_timingsrYZtimingsZbestZworstrjr)r2rNrWrXr
�main�s���


�





����rr�__main__)N)r1rZrFr0�__all__rrCrD�perf_counterrr$rr!rrrrrrr@�exitrrrr
�<module>4s4
�
�
doctest.cpython-38.opt-2.pyc000064400000116753151450073350011621 0ustar00U

e5d_��!@spdZddddddddd	d
ddd
ddddddddddddddddddd d!g!Zd"d#lZd"d#lZd"d#lZd"d#lZd"d#lZd"d#lZd"d#lZd"d#l	Z	d"d#l
Z
d"d#lZd"d$lm
Z
d"d%lmZed&d'�ZiZd(d�Zed�Zed�Zed�Zed�Zed�Zed�ZeeBeBeBeBeBZed	�Zed
�Zed�Zed�Zed�ZeeBeBeBeBZd)Z d*Z!d+d,�Z"drd.d/�Z#d0d1�Z$d2d3�Z%dsd5d6�Z&d7d8�Z'Gd9d:�d:e
�Z(d;d<�Z)d=d>�Z*d?d@�Z+GdAdB�dBej,�Z-dCdD�Z.GdEd�d�Z/GdFd�d�Z0GdGd�d�Z1GdHd�d�Z2GdId�d�Z3GdJd�d�Z4GdKd�de5�Z6GdLd�de5�Z7GdMd�de3�Z8d#a9dtdPd�Z:dNd#d#d#d#dNd"d#dOe1�d#fdQd�Z;dudSd�Z<d"a=dTd�Z>GdUdV�dVej?�Z@GdWdX�dXe@�ZAGdYdZ�dZejB�ZCdvd[d�ZDGd\d]�d]e@�ZEdNd#d#e1�d#fd^d_�ZFd`d�ZGdad�ZHdbd�ZIdwdcd �ZJdxddde�ZKdydfd!�ZLGdgdh�dh�ZMeMdidjdkdldmdn�ZNdodp�ZOePdqk�rle	�QeO��d#S)zzreStructuredText en�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS�	FAIL_FAST�Example�DocTest�
DocTestParser�
DocTestFinder�
DocTestRunner�
OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples�
testsource�	debug_src�debug�N)�StringIO)�
namedtuple�TestResultszfailed attemptedcCst�|dtt�>�S)N�)�OPTIONFLAGS_BY_NAME�
setdefault�len��name�r,�/usr/lib64/python3.8/doctest.pyr�sz<BLANKLINE>z...cCs8d}tjD](}|�|d�}|tt|�kr
||jO}q
|S)Nr")�
__future__Zall_feature_names�get�getattrZ
compiler_flag)�globs�flagsZfnameZfeaturer,r,r-�_extract_future_flags�s
r3�cCsVt�|�r|St|t�r,t|t�t�dg�S|dkrJtjt�	|�j
dStd��dS)N�*�__name__z"Expected a module, string, or None)�inspect�ismodule�
isinstance�str�
__import__�globals�locals�sys�modules�	_getframe�	f_globals�	TypeError)�moduleZdepthr,r,r-�_normalize_module�s


rDcCsdD]}|�|d�}q|S)N)z
�
�
)�replace)�data�newliner,r,r-�_newline_convert�srJc
Cs�|rVt|d�}t||�}t|dd�dk	rVt|jd�rV|j�|�}|�|�}t|�|fSt||d��}|�	�|fW5QR�SQRXdS)N��
__loader__�get_data)�encoding)
rD�_module_relative_pathr0�hasattrrLrM�decoderJ�open�read)�filename�package�module_relativerNZ
file_contents�fr,r,r-�_load_testfile�s


rX�cCst�d|d|�S)Nz
(?m)^(?!$)� )�re�sub)�s�indentr,r,r-�_indent�sr_cCs*t�}|\}}}tj||||d�|��S)N)�file)r#�	traceback�print_exception�getvalue)�exc_infoZexcout�exc_typeZexc_valZexc_tbr,r,r-�_exception_traceback�s
rfc@seZdZdd�Zddd�ZdS)�	_SpoofOutcCs$t�|�}|r |�d�s |d7}|S�NrF)r#rc�endswith)�self�resultr,r,r-rcs
z_SpoofOut.getvalueNcCs|�|�t�|�dS�N)�seekr#�truncate)rj�sizer,r,r-rn	s
z_SpoofOut.truncate)N)r6�
__module__�__qualname__rcrnr,r,r,r-rg�s	rgcCs�t|kr||kS|�t�}dt|�}}|d}|rR|�|�rNt|�}|d=ndS|d}|r�|�|�r||t|�8}|d=ndS||kr�dS|D],}|�|||�}|dkr�dS|t|�7}q�dS)Nr"F���T)�ELLIPSIS_MARKER�splitr)�
startswithri�find)�want�gotZws�startpos�endpos�wr,r,r-�_ellipsis_matchs0


r|cCs|��}|rd|SdSdS)Nz# �#)�rstrip)�liner,r,r-�
_comment_line?sr�cCshdt|�}}|�d�}|dkr$|}|�dd|�}|dkr>|}|�dd|�}|dkr\|d}|||�S)Nr"rF�:�.r&)r)rv�rfind)�msg�start�end�ir,r,r-�_strip_exception_detailsGs
r�c@s.eZdZdd�Zd
dd�Zdd�Zdd	�ZdS)�_OutputRedirectingPdbcCs(||_d|_tjj||dd�d|_dS)NFT)�stdout�nosigintr&)�_OutputRedirectingPdb__out�$_OutputRedirectingPdb__debugger_used�pdb�Pdb�__init__Zuse_rawinput)rj�outr,r,r-r�gsz_OutputRedirectingPdb.__init__NcCs*d|_|dkrt��j}tj�||�dS)NT)r�r>r@�f_backr�r��	set_trace)rj�framer,r,r-r�os
z_OutputRedirectingPdb.set_tracecCs|jrtj�|�dSrl)r�r�r��set_continue�rjr,r,r-r�usz"_OutputRedirectingPdb.set_continuecGs2tj}|jt_ztjj|f|��W�S|t_XdSrl)r>r�r�r�r��trace_dispatch)rj�args�save_stdoutr,r,r-r�{s
z$_OutputRedirectingPdb.trace_dispatch)N)r6rprqr�r�r�r�r,r,r,r-r�as
r�cCs�t�|�std|��|�d�r(td��tjj|�d��}t	|d�rXtj�|j
�d}n�|jdkr�tt
j�dkr�t
jddkr�tj�t
jd�d}q�tj}nFt	|d�r�|jD]&}tj�||�}tj�|�r�|Sq�td	|j��tj�||�S)
NzExpected a module: %r�/z1Module-relative files may not have absolute paths�__file__r"�__main__��__path__zBCan't resolve paths relative to the module %r (it has no __file__))r7r8rBru�
ValueError�os�path�joinrtrPr�r6r)r>�argv�curdirr��exists)rCZ	test_pathZbasedirZ	directory�fullpathr,r,r-rO�s(






�rOc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rNr"cCsv|�d�s|d7}|r(|�d�s(|d7}|dk	rB|�d�sB|d7}||_||_||_||_|dkrfi}||_||_dSrh)ri�sourcerw�linenor^�options�exc_msg)rjr�rwr�r�r^r�r,r,r-r��s
zExample.__init__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)�type�NotImplementedr�rwr�r^r�r��rj�otherr,r,r-�__eq__�s
�
�
�
�
�zExample.__eq__cCst|j|j|j|j|jf�Srl)�hashr�rwr�r^r�r�r,r,r-�__hash__�s�zExample.__hash__)Nr"r"N)r6rprqr�r�r�r,r,r,r-r�s
#�
c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)rcCs,||_||_|��|_||_||_||_dSrl)�examples�	docstring�copyr1r+rTr�)rjr�r1r+rTr�r�r,r,r-r�s
zDocTest.__init__cCsRt|j�dkrd}n"t|j�dkr(d}ndt|j�}d|jj|j|j|j|fS)Nr"zno examplesr&z	1 examplez%d examplesz<%s %s from %s:%s (%s)>)r)r��	__class__r6r+rTr�)rjr�r,r,r-�__repr__s��zDocTest.__repr__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)r�r�r�r�r1r+rTr�r�r,r,r-r�)s
�
�
�
�
�zDocTest.__eq__cCst|j|j|j|jf�Srl)r�r�r+rTr�r�r,r,r-r�4szDocTest.__hash__cCs:t|t�stS|j|j|jt|�f|j|j|jt|�fkSrl)r9rr�r+rTr��idr�r,r,r-�__lt__8s

�zDocTest.__lt__N)r6rprqr�r�r�r�r�r,r,r,r-r�s
c@s�eZdZe�dejejB�Ze�dejejBejB�Z	e�d�j
Zddd�Zdd�Z
dd	d
�Zdd�Ze�d
ej�Zdd�Ze�dej�Zdd�Zdd�Zdd�ZdS)ra�
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a�
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$�<string>c
s|��}|�|���dkr8d��fdd�|�d�D��}g}d\}}|j�|�D]�}|�|||����||�d||���7}|�	|||�\}}}	}
|�
|�s�|�t||	|
|�t|�
d��|d��||�d|��|���7}|��}qP|�||d��|S)Nr"rFcsg|]}|�d��qSrlr,��.0�l�Z
min_indentr,r-�
<listcomp>sz'DocTestParser.parse.<locals>.<listcomp>�r"r"r^)r�r^r�)�
expandtabs�_min_indentr�rt�_EXAMPLE_RE�finditer�appendr��count�_parse_example�_IS_BLANK_OR_COMMENTrr)�groupr�)rj�stringr+�outputZcharnor��mr�r�rwr�r,r�r-�parsess*
�

�
zDocTestParser.parsecCst|�||�|||||�Srl)r�get_examples)rjr�r1r+rTr�r,r,r-�get_doctest�s	�zDocTestParser.get_doctestcCsdd�|�||�D�S)NcSsg|]}t|t�r|�qSr,)r9r)r��xr,r,r-r��s
�z.DocTestParser.get_examples.<locals>.<listcomp>)r�)rjr�r+r,r,r-r��szDocTestParser.get_examplesc
s
t|�d���|�d��d�}|�|�||�|�|dd�d�d||�d��fdd�|D��}|�d	�}|�d�}t|�dkr�t�d
|d�r�|d=|�|d�||t|��d��fdd�|D��}|j�|�}|r�|�d
�}nd}|�	|||�}	||	||fS)Nr^r�rFr&rZr�csg|]}|�dd��qS)rYNr,)r�Zsl�r^r,r-r��sz0DocTestParser._parse_example.<locals>.<listcomp>rwz *$rrcsg|]}|�d��qSrlr,)r�Zwlr�r,r-r��sr�)
r)r�rt�_check_prompt_blank�
_check_prefixr�r[�match�
_EXCEPTION_RE�
_find_options)
rjr�r+r��source_linesr�rw�
want_linesr�r�r,r�r-r��s& 


�zDocTestParser._parse_examplez#\s*doctest:\s*([^\n\'"]*)$c	Cs�i}|j�|�D]v}|�d��dd���}|D]V}|ddksN|dd�tkrdtd|d||f��t|dd�}|ddk||<q.q|r�|�|�r�td|||f��|S)	Nr&�,rZr"z+-z7line %r of the doctest for %s has an invalid option: %r�+zSline %r of the doctest for %s has an option directive on a line with no example: %r)�_OPTION_DIRECTIVE_REr�r�rGrtr'r�r�)	rjr�r+r�r�r�Zoption_strings�option�flagr,r,r-r��s"���zDocTestParser._find_optionsz
^([ ]*)(?=\S)cCs2dd�|j�|�D�}t|�dkr*t|�SdSdS)NcSsg|]}t|��qSr,)r))r�r^r,r,r-r�
sz-DocTestParser._min_indent.<locals>.<listcomp>r")�
_INDENT_RE�findallr)�min)rjr]�indentsr,r,r-r�szDocTestParser._min_indentc	Cs^t|�D]P\}}t|�|dkr||ddkrtd||d||||d�|f��qdS)NrYrKrZz8line %r of the docstring for %s lacks blank after %s: %rr&)�	enumerater)r�)rj�linesr^r+r�r�rr,r,r-r�s ��z!DocTestParser._check_prompt_blankcCs>t|�D]0\}}|r|�|�std||d||f��qdS)NzGline %r of the docstring for %s has inconsistent leading whitespace: %rr&)r�rur�)rjr��prefixr+r�r�rr,r,r-r�s
�zDocTestParser._check_prefixN)r�)r�)r6rprqr[�compile�	MULTILINE�VERBOSEr��DOTALLr�r�r�r�r�r�r�r�r�r�r�r�r�r,r,r,r-rCs&	
��
'
3�c@sJeZdZde�ddfdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)rFTcCs||_||_||_||_dSrl)�_parser�_verbose�_recurse�_exclude_empty)rj�verbose�parser�recurse�
exclude_emptyr,r,r-r�7szDocTestFinder.__init__Nc		CsN|dkr.t|dd�}|dkr.tdt|�f��|dkr<d}n|dkrNt�|�}zt�|�}Wntk
rtd}YndX|s�t�|�}|d|dd�dks�d}|dkr�d}n*|dk	r�t�	||j
�}n
t�	|�}|s�d}|dkr�|dkr�i}n
|j
��}n|��}|dk	�r|�|�d|k�r(d|d<g}|�
||||||i�|��|S)Nr6zJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rFr"���z<]>r�)r0r�r�r7�	getmoduleZ
getsourcefilerBZgetfile�	linecache�getlines�__dict__r��update�_find�sort)	rj�objr+rCr1�
extraglobsr`r��testsr,r,r-rvMsL$�






zDocTestFinder.findcCs�|dkrdSt�|�dk	r(|t�|�kSt�|�r>|j|jkSt�|�r|t|d�r\|jj}nt|d�rn|j}ndS|j	|kSt�
|�r�|j	|jkSt|d�r�|j	|jkSt|t�r�dSt
d��dS)NT�__objclass__rpz"object must be a class or function)r7r��
isfunctionr��__globals__ZismethoddescriptorrPr�rpr6�isclassr9�propertyr�)rjrC�objectZobj_modr,r,r-�_from_module�s(








zDocTestFinder._from_modulec
Cs|jrtd|�t|�|kr"dSd|t|�<|�|||||�}|dk	rR|�|�t�|�r�|jr�|j�	�D]P\}	}
d||	f}	t�
t�|
��s�t�|
�rl|�
||
�rl|�||
|	||||�qlt�|��rn|j�rnt|di��	�D]�\}	}
t|	t��stdt|	�f��t�
|
��sJt�|
��sJt�|
��sJt|
t��sJtdt|
�f��d||	f}	|�||
|	||||�q�t�|��r|j�r|j�	�D]�\}	}
t|
t��r�t||	�}
t|
t��r�t||	�j}
t�
|
��s�t�|
��s�t|
t��r�|�
||
��r�d||	f}	|�||
|	||||��q�dS)NzFinding tests in %sr&z%s.%s�__test__z5DocTestFinder.find: __test__ keys must be strings: %rz`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rz%s.__test__.%s)r��printr��	_get_testr�r7r8r�r��itemsZ	isroutineZunwrapr�rr�r0r9r:r�r��staticmethod�classmethod�__func__r�)rjr�r�r+rCr�r1�seen�testZvalname�valr,r,r-r��sn
�
�������
�
��zDocTestFinder._findc		Cs�t|t�r|}nJz,|jdkr"d}n|j}t|t�s:t|�}Wnttfk
rXd}YnX|�||�}|jrt|stdS|dkr�d}n.t|dd�p�|j}|dd�dkr�|dd�}|j	�
|||||�S)Nr�r�����.pycrr)r9r:�__doc__rB�AttributeError�_find_linenor�r0r6r�r�)	rjr�r+rCr1r�r�r�rTr,r,r-rs,




�zDocTestFinder._get_testcCsd}t�|�rd}t�|�rb|dkr(dSt�dt|dd��}t|�D]\}}|�|�rF|}qbqFt�|�rr|j	}t�
|�r�|j}t�|�r�|j
}t�|�r�|j}t�|�r�t|dd�d}|dk	�r
|dkr�|dSt�d�}t|t|��D]}|�||�r�|Sq�dS)Nr"z^\s*class\s*%s\br6�-�co_firstlinenor&z(^|.*:)\s*\w*("|\'))r7r8r�r[r�r0r�r�Zismethodrr��__code__Zistraceback�tb_frameZisframe�f_codeZiscode�ranger))rjr�r�r�Zpatr�rr,r,r-r4s>


�








zDocTestFinder._find_lineno)NNNN)
r6rprqrr�rvrr�rrr,r,r,r-r.s	�

f?&c@s�eZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Ze�
d�Zddd�Zd dd�Zd!dd�Zdd�ZdS)"rzF**********************************************************************Nr"cCsN|pt�|_|dkrdtjk}||_||_||_d|_d|_i|_	t
�|_dS)N�-vr")r�_checkerr>r�r��optionflags�original_optionflags�tries�failures�_name2ftrg�_fakeout)rj�checkerr�rr,r,r-r��s
zDocTestRunner.__init__cCsH|jrD|jr.|dt|j�dt|j��n|dt|j�d�dS)NzTrying:
zExpecting:
zExpecting nothing
)r�rwr_r�)rjr�r
�exampler,r,r-�report_start�s���zDocTestRunner.report_startcCs|jr|d�dS)Nzok
)r��rjr�r
r rxr,r,r-�report_success�szDocTestRunner.report_successcCs&||�||�|j�|||j��dSrl)�_failure_headerr�output_differencerr"r,r,r-�report_failure�s�zDocTestRunner.report_failurecCs$||�||�dtt|���dS)NzException raised:
)r$r_rf�rjr�r
r rdr,r,r-�report_unexpected_exception�s
�
�z)DocTestRunner.report_unexpected_exceptioncCs�|jg}|jrR|jdk	r4|jdk	r4|j|jd}nd}|�d|j||jf�n|�d|jd|jf�|�d�|j}|�t|��d�|�S)Nr&�?zFile "%s", line %s, in %szLine %s, in %szFailed example:rF)�DIVIDERrTr�r�r+r�r_r�)rjr
r r�r�r�r,r,r-r$�s�
zDocTestRunner._failure_headerc	Cs�d}}|j}td�\}}}	|jj}
t|j�D�]6\}}|jt@oH|dk}
||_|jr�|j��D],\}}|r||j|O_q`|j|M_q`|jt	@r�q.|d7}|
s�|�
|||�d|j|f}z,tt
|j|d|d�|j�|j��d}Wn4tk
�r�Ynt��}|j��YnX|j��}|j�d�|}|dk�r`|
|j||j��r�|}n|tj|dd��d}|
�s�|t|�7}|jdk�r�|	}nB|
|j||j��r�|}n*|jt@�r�|
t|j�t|�|j��r�|}||k�r�|
�sR|�||||�nT||k�r(|
�s|� ||||�|d7}n*||	k�rR|
�sH|�!||||�|d7}n|r.|jt"@r.�qhq.||_|�#|||�t$||�S)Nr"rKr&z<doctest %s[%d]>Zsingler4rr)%rrr�check_outputr�r�rr�rrr!r+�execr�r�r1�debuggerr��KeyboardInterruptr>rdrrcrnrwra�format_exception_onlyrfr�rr�r#r&r(r�_DocTestRunner__record_outcomer%)rjr
�compileflagsr�rrr�SUCCESS�FAILUREZBOOMZcheck�
examplenumr �quietZ
optionflagrrTZ	exceptionrxZoutcomer�r,r,r-Z__run�s�
�
��



�




�
zDocTestRunner.__runcCsL|j�|jd�\}}||||f|j|j<|j|7_|j|7_dS)Nr�)rr/r+rr)rjr
rW�t�f2�t2r,r,r-Z__record_outcome|szDocTestRunner.__record_outcomez.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$cCsV|j�|�}|rF|�d�|jjkrF|jjt|�d��}|jjdd�S|�	||�SdS)Nr+r4T��keepends)
�%_DocTestRunner__LINECACHE_FILENAME_REr�r�r
r+r��intr��
splitlines�save_linecache_getlines)rjrT�module_globalsr�r r,r,r-Z__patched_linecache_getlines�s
z*DocTestRunner.__patched_linecache_getlinesTc		s||_|dkrt|j�}tj�|dkrV�j��dks@���dkrH�j}n��fdd�}|jt_t�	�}t
j}t��|_
|j
��|j
jt
_tj|_|jt_tj}tjt_z|�|||�W�S�t_|t
_t�|�|jt_|t_|�r�|j��ddl}d|_XdS)N�utf-8cs t|��d���}��|�dS)N�backslashreplace)r:�encode�write)r]�rNr�r,r-r��szDocTestRunner.run.<locals>.outr")r
r3r1r>r�rN�lowerrCr�gettracer�r�r�r-�resetr�r�r>�*_DocTestRunner__patched_linecache_getlines�displayhook�__displayhook__�settrace�clear�builtins�_�_DocTestRunner__run)	rjr
r1r��clear_globsZ
save_traceZsave_set_traceZsave_displayhookrMr,rDr-�run�s<





zDocTestRunner.runc
Cs�|dkr|j}g}g}g}d}}|j��D]V}|\}\}	}
||
7}||	7}|
dkr`|�|�q,|	dkrx|�||
f�q,|�|�q,|r�|r�tt|�d�|��|D]}td|�q�|r�tt|�d�|��|D]\}}td||f�q�|�r:t|j�tt|�d�|��|D] \}\}	}
td|	|
|f��q|�rft|dt|j�d	�t||d
|d�|�rztd|d
�n|�r�td�t||�S)Nr"zitems had no tests:z   zitems passed all tests:z %3d tests in %szitems had failures:z %3d of %3d in %sztests inzitems.z
passed andzfailed.z***Test Failed***z	failures.zTest passed.)	r�rrr�rr)r�r*r%)
rjr�ZnotestsZpassedZfailedZtotaltZtotalfr�r+rWr6�thingr�r,r,r-�	summarize�sP
zDocTestRunner.summarizecCsR|j}|j��D]<\}\}}||kr@||\}}||}||}||f||<qdSrl)rr)rjr��dr+rWr6r7r8r,r,r-�mergeszDocTestRunner.merge)NNr")N)NNT)N)r6rprqr*r�r!r#r&r(r$rOr0r[r�r;rHrQrSrUr,r,r,r-rhs:
$
}



I
9c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCst|�dd�d�S)N�ASCIIrA)r:rB)rjr]r,r,r-�_toAscii(szOutputChecker._toAsciicCs�|�|�}|�|�}||kr dS|t@sH||fdkr8dS||fdkrHdS|t@s�t�dt�t�d|�}t�dd|�}||kr�dS|t@r�d�|�	��}d�|�	��}||kr�dS|t
@r�t||�r�dSdS)	NT)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r�z(?m)^[^\S\n]+$rZF)rWrrr[r\�escape�BLANKLINE_MARKERrr�rtrr|�rjrwrxrr,r,r-r+.s4

�
zOutputChecker.check_outputcCs<|ttBtB@sdS|t@r dS|�d�dko:|�d�dkS)NFTrFr4)r	r
rr�rZr,r,r-�_do_a_fancy_diffms��zOutputChecker._do_a_fancy_diffc
Cs(|j}|t@st�dt|�}|�|||�r�|jdd�}|jdd�}|t@rptj	||dd�}t
|�dd�}d}nZ|t@r�tj||dd�}t
|�dd�}d}n,|t
@r�tjtjd�}	t
|	�||��}d	}nd
|td�|��S|r�|r�dt|�t|�fS|�rd
t|�S|�r dt|�SdSdS)Nz(?m)^[ ]*(?=
)Tr9r4)�nz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualzDifferences (%s):
r�zExpected:
%sGot:
%szExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rwrr[r\rYr[r=r	�difflibZunified_diff�listr
Zcontext_diffrZDifferZIS_CHARACTER_JUNKZcomparer_r�)
rjr rxrrwr�Z	got_linesZdiffZkindZenginer,r,r-r%�s4zOutputChecker.output_differenceN)r6rprqrWr+r[r%r,r,r,r-r s?c@seZdZdd�Zdd�ZdS)rcCs||_||_||_dSrl)r
r rx)rjr
r rxr,r,r-r��szDocTestFailure.__init__cCs
t|j�Srl�r:r
r�r,r,r-�__str__�szDocTestFailure.__str__N�r6rprqr�r`r,r,r,r-r�sc@seZdZdd�Zdd�ZdS)rcCs||_||_||_dSrl)r
r rd)rjr
r rdr,r,r-r��szUnexpectedException.__init__cCs
t|j�Srlr_r�r,r,r-r`�szUnexpectedException.__str__Nrar,r,r,r-r�sc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rNTcCs$t�||||d�}|r |j��|S)NF)rrQr1rL)rjr
r1r�rP�rr,r,r-rQ3s
zDebugRunner.runcCst|||��dSrl)rr'r,r,r-r(9sz'DebugRunner.report_unexpected_exceptioncCst|||��dSrl)rr"r,r,r-r&<szDebugRunner.report_failure)NNT)r6rprqrQr(r&r,r,r,r-r�s[
TFc	Cs�|dkrtj�d�}t�|�s,td|f��|dkr:|j}t|d�}	|rVt||d�}
nt	||d�}
|	j
||||d�D]}|
�|�qt|r�|
��t
dkr�|
a
n
t
�|
�t|
j|
j�S)Nr�ztestmod: module required; %r)r��r�r�r1r�)r>r?r/r7r8rBr6rrrrvrQrS�masterrUr%rr)r�r+r1r��reportrr��raise_on_errorr��finder�runnerr
r,r,r-rHs$E


cCs�|r|std��t||||pd�\}}|dkr:tj�|�}|dkrHi}n|��}|dk	rb|�|�d|krrd|d<|	r�t||d�}
nt||d�}
|
�	||||d�}|
�
|�|r�|
��tdkr�|
an
t�
|
�t|
j|
j�S)N�8Package may only be specified for module-relative paths.r@r6r�rcr")r�rXr�r��basenamer�r�rrr�rQrSrerUr%rr)rTrVr+rUr1r�rfrr�rgr�rN�textrir
r,r,r-r�s2R�


�NoNamec	Cs@t|dd�}t||d�}|j|||d�D]}|j||d�q(dS)NF)r�r�rc)r1)r1)rrrvrQ)	rWr1r�r+r1rrhrir
r,r,r-r+scCs"|t@|krtd|��t}|a|S)NzOnly reporting flags allowed)r
r��_unittest_reportflags)r2�oldr,r,r-rHs

c@sleZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
jZdd�ZdS)�DocTestCaser"NcCs.tj�|�||_||_||_||_||_dSrl)�unittest�TestCaser��_dt_optionflags�_dt_checker�_dt_test�	_dt_setUp�_dt_tearDown)rjr
r�setUp�tearDownrr,r,r-r�nszDocTestCase.__init__cCs|j}|jdk	r|�|�dSrl)rurv�rjr
r,r,r-rxxs
zDocTestCase.setUpcCs(|j}|jdk	r|�|�|j��dSrl)rurwr1rLrzr,r,r-ry~s

zDocTestCase.tearDowncCs~|j}tj}t�}|j}|t@s(|tO}t||jdd�}z d|_	|j
||jdd�\}}W5|t_X|rz|�|�
|�����dS)NF�rrr�zF----------------------------------------------------------------------)r�rP)rur>r�r#rsr
rnrrtr*rQrCZfailureException�format_failurerc)rjr
ro�newrrirrr,r,r-�runTest�s(��zDocTestCase.runTestcCsP|j}|jdkrd}n
d|j}d�|j�d�dd��}d|j|j|||fS)Nzunknown line numberz%sr�rrz:Failed doctest test for %s
  File "%s", line %s, in %s

%s)rur�r�r+rtrT)rj�errr
r�Zlnamer,r,r-r|�s

�zDocTestCase.format_failurecCs6|��t|j|jdd�}|j|jdd�|��dS)NFr{)rP)rxrrsrtrQrury)rjrir,r,r-r!�sB�zDocTestCase.debugcCs|jjSrl�rur+r�r,r,r-r��szDocTestCase.idcCsPt|�t|�k	rtS|j|jkoN|j|jkoN|j|jkoN|j|jkoN|j|jkSrl)r�r�rursrvrwrtr�r,r,r-r��s
�
�
�
�zDocTestCase.__eq__cCst|j|j|j|jf�Srl)r�rsrvrwrtr�r,r,r-r��s�zDocTestCase.__hash__cCs,|jj�d�}d|dd�|dd��fS)Nr�z%s (%s)rr)rur+rtr�)rjr+r,r,r-r�	szDocTestCase.__repr__cCsd|jjS)Nz	Doctest: r�r�r,r,r-�shortDescription		szDocTestCase.shortDescription)r"NNN)r6rprqr�rxryr~r|r!r�r�r�r�rr`r�r,r,r,r-rpls�

H
rpc@s0eZdZdd�Zdd�Zdd�Zdd�ZeZd	S)
�SkipDocTestCasecCs||_t�|d�dSrl)rCrpr�)rjrCr,r,r-r�
	szSkipDocTestCase.__init__cCs|�d�dS)Nz-DocTestSuite will not work with -O2 and above)ZskipTestr�r,r,r-rx	szSkipDocTestCase.setUpcCsdSrlr,r�r,r,r-�	test_skip	szSkipDocTestCase.test_skipcCsd|jjS)NzSkipping tests from %s)rCr6r�r,r,r-r�	sz SkipDocTestCase.shortDescriptionN)r6rprqr�rxr�r�r`r,r,r,r-r�	s
r�c@seZdZdd�ZdS)�
_DocTestSuitecCsdSrlr,)rj�indexr,r,r-�_removeTestAtIndex	sz _DocTestSuite._removeTestAtIndexN)r6rprqr�r,r,r,r-r�	sr�c	Ks�|dkrt�}t|�}|j|||d�}|sNtjjdkrNt�}|�t|��|S|�	�t�}|D]T}t
|j�dkrtq`|js�|j
}|dd�dkr�|dd�}||_|�t|f|��q`|S)Nrdr4r"rr
rr)rrDrvr>r2�optimizer��addTestr�r�r)r�rTr�rp)	rCr1r�Ztest_finderr�r��suiter
rTr,r,r-r#	s(%c@s$eZdZdd�Zdd�Zdd�ZdS)�DocFileCasecCsd�|jj�d��S)NrNr�)r�rur+rtr�r,r,r-r�e	szDocFileCase.idcCs|jjSrl)rurTr�r,r,r-r�h	szDocFileCase.__repr__cCsd|jj|jj|fS)Nz2Failed doctest test for %s
  File "%s", line 0

%s)rur+rT)rjrr,r,r-r|k	s�zDocFileCase.format_failureN)r6rprqr�r�r|r,r,r,r-r�c	sr�c
Ksv|dkri}n|��}|r&|s&td��t||||p4d�\}}d|krL||d<tj�|�}|�||||d�}	t|	f|�S)Nrjr@r�r")r�r�rXr�r�rkr�r�)
r�rVrUr1r�rNr��docr+r
r,r,r-�DocFileTestp	s�r�cOsDt�}|�dd�r$t|�d��|d<|D]}|�t|f|��q(|S)NrVTrU)r�r/rDr�r�)�paths�kwr�r�r,r,r-r�	s8cCs�g}t��|�D]x}t|t�rh|�|jdd��|j}|r�|�d�|dd�|�d�dd�D�7}q|dd�|�d�dd�D�7}q|r�|ddkr�|��q�|r�|ddkr�|�d�q�d�	|�dS)	Nrrz# Expected:cSsg|]}d|�qS)z## r,r�r,r,r-r�
sz(script_from_examples.<locals>.<listcomp>rFcSsg|]}t|��qSr,)r�r�r,r,r-r�
s�r}r")
rr�r9rr�r�rwrt�popr�)r]r�Zpiecerwr,r,r-r�	s :

"�

csJt|�}t��|�}�fdd�|D�}|s4t�d��|d}t|j�}|S)Ncsg|]}|j�kr|�qSr,r*)r�r6r*r,r-r�.
s
ztestsource.<locals>.<listcomp>znot found in testsr")rDrrvr�rr�)rCr+r�r
�testsrcr,r*r-r%
s

cCst|�}t|||�dSrl)r�debug_script)�src�pmr1r�r,r,r-r 5
scCs�ddl}|r|��}ni}|rvzt|||�Wq�tt��d�|jdd�}|��|�dt��d�Yq�Xn|jdd��	d|||�dS)Nr"r&T)r�r4zexec(%r))
r�r�r,rr>rdr�rGZinteractionrQ)r�r�r1r��pr,r,r-r�:
s
r�cCs$t|�}t||�}t|||j�dSrl)rDrr�r�)rCr+r�r�r,r,r-r!N
s
c@s$eZdZdd�Zdd�Zdd�ZdS)�
_TestClasscCs
||_dSrl�r)rjrr,r,r-r�j
sz_TestClass.__init__cCs|jd|_|S)Nr4r�r�r,r,r-�squaret
sz_TestClass.squarecCs|jSrlr�r�r,r,r-r/~
sz_TestClass.getN)r6rprqr�r�r/r,r,r,r-r�\
s

r�z�
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      a�
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    z�
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            z�
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            a�
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r�r�zbool-int equivalencezblank linesZellipsiszwhitespace normalizationcCs"ddl}|jdd�}|jdddddd	�|jd
ddt��gd
d�|jddddd�|jdddd�|��}|j}|j}d}|jD]}|t|O}q�|j	r�|t
O}|D]v}|�d�r�tj
�|�\}}tj
�d|�t|dd��}	tj
d=t|	||d�\}
}nt|d||d�\}
}|
r�dSq�dS)Nr"zdoctest runner)Zdescriptionrz	--verbose�
store_trueFz'print very verbose output for all tests)�action�default�helpz-oz--optionr�zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r��choicesr�r�z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r�r�r`r�z file containing the tests to run)�nargsr�z.py���rc)rVr�rr&)�argparse�ArgumentParser�add_argumentr'�keys�
parse_argsr`r�r�Z	fail_fastrrir�r�rtr>�insertr;rr)r�r�r�Z	testfilesr�r�r�rT�dirnamer�rrNr,r,r-�_test�
sL�
�
��

�
r�r�)r4)rY)	NNNNTr"NFF)FrmNr")NNNN)FN)FN)F)RZ
__docformat__�__all__r.r]r7r�r�r�r[r>rarq�ior#�collectionsr$r%r'rrrrrrrrr	r
rrrr
rYrsr3rDrJrXr_rfrgr|r�r�r�r�rOrrrrrr�	Exceptionrrrrerrrrnrrrrpr�Z	TestSuiter�rr�r�rrrr r�r!r�rr�r6�exitr,r,r,r-�<module>0sD�-
���������

1%.DKl<;n�
h�
{�
$!
@
�
IR


,	�3-
chunk.cpython-38.opt-2.pyc000064400000005211151450073350011246 0ustar00U

e5d;�@sGdd�d�ZdS)c@sZeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Zdd�Z	ddd�Z
dd�ZdS)�ChunkTFc	Cs�ddl}d|_||_|rd}nd}||_|�d�|_t|j�dkrFt�z |�|d|�d��d|_	Wn|j
k
r�td�YnX|r�|j	d|_	d|_z|j��|_
Wnttfk
r�d|_YnXd|_dS)	N�F�>�<��L�T)�struct�closed�align�file�read�	chunkname�len�EOFErrorZunpack_from�	chunksize�error�	size_read�tell�offset�AttributeError�OSError�seekable)�selfrr
Z	bigendianZ
inclheaderrZstrflag�r�/usr/lib64/python3.8/chunk.py�__init__4s, zChunk.__init__cCs|jS�N)r
�rrrr�getnameNsz
Chunk.getnamecCs|jSr)rrrrr�getsizeRsz
Chunk.getsizecCs |jsz|��W5d|_XdS)NT)r	�skiprrrr�closeVszChunk.closecCs|jrtd��dS)N�I/O operation on closed fileF)r	�
ValueErrorrrrr�isatty]szChunk.isattyrcCsv|jrtd��|jstd��|dkr0||j}n|dkrB||j}|dksT||jkrXt�|j�|j	|d�||_dS)Nr"zcannot seek��r)
r	r#rrrr�RuntimeErrorr�seekr)r�pos�whencerrrr(bs
z
Chunk.seekcCs|jrtd��|jS)Nr")r	r#rrrrrrusz
Chunk.tell���cCs�|jrtd��|j|jkrdS|dkr2|j|j}||j|jkrN|j|j}|j�|�}|jt|�|_|j|jkr�|jr�|jd@r�|j�d�}|jt|�|_|S)Nr"�rr%)r	r#rrrrrr
)r�size�data�dummyrrrrzs$��z
Chunk.readcCs�|jrtd��|jrnzD|j|j}|jr:|jd@r:|d}|j�|d�|j||_WdStk
rlYnX|j|jkr�t	d|j|j�}|�
|�}|snt�qndS)Nr"r%i )r	r#rrrr
rr(r�minrr)r�nr/rrrr �s"
z
Chunk.skipN)TTF)r)r+)�__name__�
__module__�__qualname__rrrr!r$r(rrr rrrrr3s


rN)rrrrr�<module>3r,tracemalloc.cpython-38.opt-1.pyc000064400000041725151450073350012435 0ustar00U

e5d�B�@sddlmZmZddlmZddlZddlZddlZddl	Z	ddl
Tddl
mZmZdd�Z
Gdd	�d	�ZGd
d�d�Zdd
�ZeGdd�d��ZeGdd�de��Zdd�ZGdd�d�ZGdd�de�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGd d!�d!�Zd"d#�ZdS)$�)�Sequence�Iterable)�total_orderingN)�*)�_get_object_traceback�_get_tracescCs�dD]|}t|�dkr@|dkr@|r0d||fSd||fSt|�dksT|dkrx|rhd||fSd	||fS|d
}qdS)N)�BZKiBZMiBZGiB�TiB�drz%+.1f %sz%.1f %si(r	z%+.0f %sz%.0f %si)�abs)�sizeZsignZunit�r
�#/usr/lib64/python3.8/tracemalloc.py�_format_size
src@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�	StatisticzS
    Statistic difference on memory allocations between two Snapshot instance.
    ��	tracebackr�countcCs||_||_||_dS�Nr)�selfrrrr
r
r�__init__%szStatistic.__init__cCst|j|j|jf�Sr)�hashrrr�rr
r
r�__hash__*szStatistic.__hash__cCs$|j|jko"|j|jko"|j|jkSrr�r�otherr
r
r�__eq__-s

�
�zStatistic.__eq__cCsBd|jt|jd�|jf}|jr>|j|j}|dt|d�7}|S)Nz%s: size=%s, count=%iF�, average=%s)rrrr�r�textZaverager
r
r�__str__2s
��zStatistic.__str__cCsd|j|j|jfS)Nz)<Statistic traceback=%r size=%i count=%i>rrr
r
r�__repr__<s�zStatistic.__repr__cCs|j|j|jfSr)rrrrr
r
r�	_sort_key@szStatistic._sort_keyN��__name__�
__module__�__qualname__�__doc__�	__slots__rrrr r!r"r
r
r
rrs
rc@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
StatisticDiffzd
    Statistic difference on memory allocations between an old and a new
    Snapshot instance.
    �rr�	size_diffr�
count_diffcCs"||_||_||_||_||_dSrr*)rrrr+rr,r
r
rrKs
zStatisticDiff.__init__cCst|j|j|j|j|jf�Sr)rrrr+rr,rr
r
rrRs�zStatisticDiff.__hash__cCs<|j|jko:|j|jko:|j|jko:|j|jko:|j|jkSrr*rr
r
rrVs
�
�
�
�zStatisticDiff.__eq__cCsPd|jt|jd�t|jd�|j|jf}|jrL|j|j}|dt|d�7}|S)Nz %s: size=%s (%s), count=%i (%+i)FTr)rrrr+rr,rr
r
rr ]s

��zStatisticDiff.__str__cCsd|j|j|j|j|jfS)Nz9<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>r*rr
r
rr!is��zStatisticDiff.__repr__cCs t|j�|jt|j�|j|jfSr)rr+rr,rrrr
r
rr"ns
�zStatisticDiff._sort_keyNr#r
r
r
rr)Dsr)cCs�g}|��D]d\}}|�|d�}|dk	rNt||j|j|j|j|j|j�}nt||j|j|j|j�}|�|�q|��D]*\}}t|d|jd|j�}|�|�qz|S�Nr)�items�popr)rr�append)�	old_group�	new_group�
statisticsr�statZpreviousr
r
r�_compare_grouped_statsts*

��r5c@s\eZdZdZdZdd�Zedd��Zedd��Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Framez
    Frame of a traceback.
    ��_framecCs
||_dSrr7�r�framer
r
rr�szFrame.__init__cCs
|jdSr-r7rr
r
r�filename�szFrame.filenamecCs
|jdS�N�r7rr
r
r�lineno�szFrame.linenocCs|j|jkSrr7rr
r
rr�szFrame.__eq__cCs|j|jkSrr7rr
r
r�__lt__�szFrame.__lt__cCs
t|j�Sr)rr8rr
r
rr�szFrame.__hash__cCsd|j|jfS)Nz%s:%s�r;r>rr
r
rr �sz
Frame.__str__cCsd|j|jfS)Nz<Frame filename=%r lineno=%r>r@rr
r
rr!�szFrame.__repr__N)r$r%r&r'r(r�propertyr;r>rr?rr r!r
r
r
rr6�s

r6c@sfeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�	Tracebackz`
    Sequence of Frame instances sorted from the oldest frame
    to the most recent frame.
    ��_framescCst�|�tt|��|_dSr)rr�tuple�reversedrD)r�framesr
r
rr�s
zTraceback.__init__cCs
t|j�Sr)�lenrDrr
r
r�__len__�szTraceback.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r6��.0�tracer
r
r�	<genexpr>�sz(Traceback.__getitem__.<locals>.<genexpr>)�
isinstance�slicerErDr6�r�indexr
r
r�__getitem__�s
zTraceback.__getitem__cCs|j|jkSr)r8rDr9r
r
r�__contains__�szTraceback.__contains__cCs
t|j�Sr)rrDrr
r
rr�szTraceback.__hash__cCs|j|jkSrrCrr
r
rr�szTraceback.__eq__cCs|j|jkSrrCrr
r
rr?�szTraceback.__lt__cCst|d�Sr-)�strrr
r
rr �szTraceback.__str__cCsdt|�fS)Nz<Traceback %r>)rErr
r
rr!�szTraceback.__repr__NFcCs�g}|dk	r2|dkr$||d�}q6|d|�}n|}|rBt|�}|D]@}|�d|j|jf�t�|j|j���}|rF|�d|�qF|S)Nrz  File "%s", line %sz    %s)rFr0r;r>�	linecache�getline�strip)r�limitZmost_recent_first�linesZframe_slicer:�liner
r
r�format�s 
�zTraceback.format)NF)r$r%r&r'r(rrIrRrSrrr?r r!r[r
r
r
rrB�srBcCs t|�}|dk	rt|�SdSdS)z�
    Get the traceback where the Python object *obj* was allocated.
    Return a Traceback instance.

    Return None if the tracemalloc module is not tracing memory allocations or
    did not trace the allocation of the object.
    N)rrB)�objrGr
r
r�get_object_traceback�sr]c@s`eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Tracez"
    Trace of a memory block.
    ��_tracecCs
||_dSrr_�rrLr
r
rrszTrace.__init__cCs
|jdSr-r_rr
r
r�domainszTrace.domaincCs
|jdSr<r_rr
r
rr	sz
Trace.sizecCst|jd�S)N�)rBr`rr
r
rr
szTrace.tracebackcCs|j|jkSrr_rr
r
rrszTrace.__eq__cCs
t|j�Sr)rr`rr
r
rrszTrace.__hash__cCsd|jt|jd�fS)Nz%s: %sF)rrrrr
r
rr sz
Trace.__str__cCsd|jt|jd�|jfS)Nz'<Trace domain=%s size=%s, traceback=%r>F)rbrrrrr
r
rr!s�zTrace.__repr__N)r$r%r&r'r(rrArbrrrrr r!r
r
r
rr^�s


r^c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_TracescCst�|�||_dSr)rr�_traces)r�tracesr
r
rr s
z_Traces.__init__cCs
t|j�Sr)rHrerr
r
rrI%sz_Traces.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r^rJr
r
rrM*sz&_Traces.__getitem__.<locals>.<genexpr>)rNrOrErer^rPr
r
rrR(s
z_Traces.__getitem__cCs|j|jkSr)r`rerar
r
rrS.sz_Traces.__contains__cCs|j|jkSr)rerr
r
rr1sz_Traces.__eq__cCsdt|�S)Nz<Traces len=%s>)rHrr
r
rr!4sz_Traces.__repr__N)	r$r%r&rrIrRrSrr!r
r
r
rrdsrdcCs&tj�|�}|�d�r"|dd�}|S)Nz.pyc���)�os�path�normcase�endswith)r;r
r
r�_normalize_filename8s
rlc@seZdZdd�Zdd�ZdS)�
BaseFiltercCs
||_dSr)�	inclusive)rrnr
r
rr@szBaseFilter.__init__cCst�dSr)�NotImplementedErrorrar
r
r�_matchCszBaseFilter._matchN)r$r%r&rrpr
r
r
rrm?srmcsJeZdZd�fdd�	Zedd��Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�FilterNFcs2t��|�||_t|�|_||_||_||_dSr)�superrrnrl�_filename_patternr>�
all_framesrb)rrn�filename_patternr>rtrb��	__class__r
rrHs
zFilter.__init__cCs|jSr)rsrr
r
rruQszFilter.filename_patterncCs6t|�}t�||j�sdS|jdkr(dS||jkSdS)NFT)rl�fnmatchrsr>�rr;r>r
r
r�_match_frame_implUs
zFilter._match_frame_implcCs|�||�|jASr)rzrnryr
r
r�_match_frame^szFilter._match_framecsH�jr,t�fdd�|D��r"�jS�jSn|d\}}��||�SdS)Nc3s|]\}}��||�VqdSr)rz)rKr;r>rr
rrMcs�z*Filter._match_traceback.<locals>.<genexpr>r)rt�anyrnr{)rrr;r>r
rr�_match_tracebackas�
zFilter._match_tracebackcCsD|\}}}|�|�}|jdk	r@|jr2|o0||jkS|p>||jkS|Sr)r}rbrn)rrLrbrr�resr
r
rrpls


z
Filter._match)NFN)r$r%r&rrArurzr{r}rp�
__classcell__r
r
rvrrqGs�	
	rqcs0eZdZ�fdd�Zedd��Zdd�Z�ZS)�DomainFiltercst��|�||_dSr)rrr�_domain)rrnrbrvr
rrxszDomainFilter.__init__cCs|jSr)r�rr
r
rrb|szDomainFilter.domaincCs|\}}}||jk|jASr)rbrn)rrLrbrrr
r
rrp�s
zDomainFilter._match)r$r%r&rrArbrprr
r
rvrr�ws
r�c@sXeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�ZdS)�SnapshotzB
    Snapshot of traces of memory blocks allocated by Python.
    cCst|�|_||_dSr)rdrf�traceback_limit)rrfr�r
r
rr�s
zSnapshot.__init__c	Cs*t|d��}t�||tj�W5QRXdS)z1
        Write the snapshot into a file.
        �wbN)�open�pickle�dumpZHIGHEST_PROTOCOL)rr;�fpr
r
rr��sz
Snapshot.dumpc
Cs,t|d��}t�|�W5QR�SQRXdS)z.
        Load a snapshot from a file.
        �rbN)r�r��load)r;r�r
r
rr��sz
Snapshot.loadcs@|rt�fdd�|D��sdS|r<t�fdd�|D��r<dSdS)Nc3s|]}|���VqdSr�rp�rK�trace_filter�rLr
rrM�s�z)Snapshot._filter_trace.<locals>.<genexpr>Fc3s|]}|���VqdSrr�r�r�r
rrM�s�T)r|)r�include_filters�exclude_filtersrLr
r�r�
_filter_trace�s��zSnapshot._filter_tracecs�t|t�stdt|�j��|rjg�g�|D] }|jrB��|�q,��|�q,���fdd��jjD�}n�jj�	�}t
|�j�S)z�
        Create a new Snapshot instance with a filtered traces sequence, filters
        is a list of Filter or DomainFilter instances.  If filters is an empty
        list, return a new Snapshot instance with a copy of the traces.
        z)filters must be a list of filters, not %scsg|]}����|�r|�qSr
)r�rJ�r�r�rr
r�
<listcomp>�s��z*Snapshot.filter_traces.<locals>.<listcomp>)rNr�	TypeError�typer$rnr0rfre�copyr�r�)r�filtersr�Z
new_tracesr
r�r�
filter_traces�s
�zSnapshot.filter_tracesc

Cs�|dkrtd|f��|r.|dkr.td|��i}i}|�s|jjD]�}|\}}}z||}	WnZtk
r�|dkr||}
n(|dkr�|dd�}
n|dddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_WqDtk
�rt|	|d�||	<YqDXqDn�|jjD]�}|\}}}|D]�}z||}	WnFtk
�r~|dk�r\|f}
n|ddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_Wn&tk
�r�t|	|d�||	<YnX�q(�q|S)	N)rr;r>zunknown key_type: %r)r>r;z/cumulative mode cannot by used with key type %rrr>r=r)�
ValueErrorrfre�KeyErrorrBrrr)
r�key_type�
cumulativeZstatsZ
tracebacksrLrbrZtrace_tracebackrrGr4r:r
r
r�	_group_by�sZ�


zSnapshot._group_byFcCs,|�||�}t|���}|jdtjd�|S)zd
        Group statistics by key_type. Return a sorted list of Statistic
        instances.
        T��reverse�key)r��list�values�sortrr")rr�r�Zgroupedr3r
r
rr3�szSnapshot.statisticscCs6|�||�}|�||�}t||�}|jdtjd�|S)z�
        Compute the differences with an old snapshot old_snapshot. Get
        statistics as a sorted list of StatisticDiff instances, grouped by
        group_by.
        Tr�)r�r5r�r)r")rZold_snapshotr�r�r2r1r3r
r
r�
compare_tos

zSnapshot.compare_toN)F)F)
r$r%r&r'rr��staticmethodr�r�r�r�r3r�r
r
r
rr��s
3

r�cCs$t�std��t�}t�}t||�S)zI
    Take a snapshot of traces of memory blocks allocated by Python.
    zLthe tracemalloc module must be tracing memory allocations to take a snapshot)�
is_tracing�RuntimeErrorrZget_traceback_limitr�)rfr�r
r
r�
take_snapshot
s
r�)Zcollections.abcrr�	functoolsrrxrUZos.pathrhr�Z_tracemallocrrrrr)r5r6rBr]r^rdrlrmrqr�r�r�r
r
r
r�<module>s2&0"?%0	base64.cpython-38.opt-2.pyc000064400000026076151450073350011236 0ustar00U

e5d�O�@s�ddlZddlZddlZdddddddd	d
ddd
ddddddgZeefZdd�ZdBdd�ZdCdd�Z	dd�Z
dd�Ze�dd�Z
e�dd�Zdd�Zdd�ZdZdadad d�ZdDd!d	�Zd"d
�ZdEd#d�Zdadad$Zd%ZdFd&d'�Zddddd(�d)d�Zddd*d+�d,d�Zd-Zda da!da"dGd.d�Z#d/d
�Z$d0Z%e%d1d2Z&d3d�Z'd4d�Z(d5d6�Z)d7d�Z*d8d9�Z+d:d�Z,d;d<�Z-d=d>�Z.d?d@�Z/e0dAk�r�e.�dS)H�N�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodecCs|t|t�r4z|�d�WStk
r2td��YnXt|t�rB|Szt|���WStk
rvtd|j	j
�d�YnXdS)N�asciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r)�
isinstance�strr�UnicodeEncodeError�
ValueError�bytes_types�
memoryview�tobytes�	TypeError�	__class__�__name__��s�r!�/usr/lib64/python3.8/base64.py�_bytes_from_decode_data"s

��r#cCs,tj|dd�}|dk	r(|�t�d|��S|S)NF)�newline�+/)�binascii�
b2a_base64�	translate�bytes�	maketrans)r �altchars�encodedr!r!r"r3sFcCsNt|�}|dk	r*t|�}|�t�|d��}|rDt�d|�sDt�d��t�|�S)Nr%s[A-Za-z0-9+/]*={0,2}zNon-base64 digit found)	r#r(r)r*�re�	fullmatchr&�Error�
a2b_base64)r r+Zvalidater!r!r"rAs
cCst|�S�N)rrr!r!r"rZscCst|�Sr1)rrr!r!r"rasr%s-_cCst|��t�Sr1)rr(�_urlsafe_encode_translationrr!r!r"roscCst|�}|�t�}t|�Sr1)r#r(�_urlsafe_decode_translationrrr!r!r"rxs
s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567cs>tdkr,dd�tD���fdd��D�ad�t|t�sBt|���}t|�d}|rb|dd|}t�}tj	}t}t
dt|�d�D]V}||||d�d�}|||d?||d	?d
@||d?d
@||d
@7}q�|dkr�d
|dd�<nF|dk�rd|dd�<n.|dk�r d|dd�<n|dk�r6d|dd�<t|�S)NcSsg|]}t|f��qSr!�r)��.0�ir!r!r"�
<listcomp>�szb32encode.<locals>.<listcomp>csg|]}�D]}||�qqSr!r!�r6�a�b�Zb32tabr!r"r8�s��r�big��i��
�s======i�����s====����s===�����=���)�_b32tab2�_b32alphabetrrrr�len�	bytearray�int�
from_bytes�ranger))r �leftoverr,rPZb32tab2r7�cr!r<r"r�s<
��
�


c
	Csztdkrdd�tt�D�at|�}t|�dr8t�d��|dk	r^t|�}|�t�	dd|��}|rj|�
�}t|�}|�d�}|t|�}t�}t}t
dt|�d�D]h}|||d�}d}	z|D]}
|	d	>||
}	q�Wn tk
r�t�d
�d�YnX||	�d	d�7}q�|d�s |dk�r*t�d��|�rr|�rr|	d	|K}	|	�d	d�}d
d	|d}|d|�|dd�<t|�S)NcSsi|]\}}||�qSr!r!)r6�k�vr!r!r"�
<dictcomp>�szb32decode.<locals>.<dictcomp>�zIncorrect paddings01�OrIrr=zNon-base32 digit foundr?>rrCrFrH��+���)�_b32rev�	enumeraterLr#rMr&r/r(r)r*�upper�rstriprNrQ�KeyError�to_bytes)
r �casefoldZmap01�lZpadchars�decodedZb32revr7Zquanta�accrSZlastrRr!r!r"r	�s@


cCst�|���Sr1)r&Zhexlifyr^rr!r!r"r
�scCs4t|�}|r|��}t�d|�r*t�d��t�|�S)Ns	[^0-9A-F]zNon-base16 digit found)r#r^r-�searchr&r/Z	unhexlify)r rbr!r!r"r�s

s<~s~>c	s�t|t�st|���}t|�d}|r4|d|}t�dt|�d��|�}����fdd�|D�}|r�|s�|ddkr��dd	|d<|dd|�|d<d
�|�S)NrHr>z!%dIcsPg|]H}�r|sdn6�r$|dkr$dn&�|d�|dd�|d�qS)�zi    �yi�^	�Ui9r!)r6Zword��chars�chars2�foldnuls�
foldspacesr!r"r8!s�
�
�z_85encode.<locals>.<listcomp>rJrgrr=�)	rrrrrM�struct�StructZunpack�join)	r;rkrl�padrmrn�paddingZwords�chunksr!rjr"�	_85encodes
�rv)rn�wrapcolrs�adobecs�tdkr*dd�tdd�D�add�tD�at|tt|d|��|rHt���r�t|rVdnd�����fd	d�td
t����D�}|r�t|d�d�kr�|�d�d
�|��|r��t	7��S)NcSsg|]}t|f��qSr!r4r5r!r!r"r8Dsza85encode.<locals>.<listcomp>�!�vcSsg|]}tD]}||�qqSr!)�	_a85charsr9r!r!r"r8EsTrDrCcsg|]}�||���qSr!r!r5��resultrwr!r"r8Ms�rrJro�
)
�
_a85chars2rQr{rv�	_A85START�maxrM�appendrr�_A85END)r;rnrwrsrxrur!r|r"r/s$�

s 	

)rnrx�ignorecharsc	Cs�t|�}|rH|�t�s$td�t���|�t�r<|dd�}n|dd�}t�d�j	}g}|j
}g}|j
}|j}	|dD]�}
d|
kr�dkr�nnl||
�t|�dkr�d	}|D]}
d
||
d}q�z|||��Wn tj
k
r�td�d�YnX|	�qv|
dk�r |�rtd
��|d�qv|�rH|
dk�rH|�r>td��|d�qv|
|k�rVqvqvtd|
��qvd�|�}dt|�}
|
�r�|d|
�}|S)Nz1Ascii85 encoded byte sequences must end with {!r}rD����!Isuuuury�ur=rrizAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %crorH)r#�endswithr�r�format�
startswithr�rprq�packr��clearrM�errorrr)r;rnrxr��packIrdZdecoded_appendZcurrZcurr_appendZ
curr_clear�xrer}rtr!r!r"rXsZ
��





sU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs2tdkr$dd�tD�add�tD�at|tt|�S)NcSsg|]}t|f��qSr!r4r5r!r!r"r8�szb85encode.<locals>.<listcomp>cSsg|]}tD]}||�qqSr!)�	_b85charsr9r!r!r"r8�s)�
_b85chars2�_b85alphabetr�rv)r;rsr!r!r"r�s	c
	CsJtdkr,dgdatt�D]\}}|t|<qt|�}t|�d}|d|}g}t�d�j}tdt|�d�D]�}|||d�}d}z|D]}|dt|}q�WnFt	k
r�t|�D]&\}}t|dkr�t
d||�d�q��YnXz|�||��Wqntjk
�r$t
d|�d�YqnXqnd	�
|�}	|�rF|	d|�}	|	S)
N�r=�~r�rriz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %dro)�_b85decr]r�r#rMrprqr�rQrrr�r�rr)
r;r7rSrt�outr��chunkre�jr}r!r!r"r
�sH

����

�LrHrFcCsX|�t�}|sqTt|�tkr>|�tt|��}|s4q>||7}qt�|�}|�|�qdSr1)�read�
MAXBINSIZErMr&r'�write)�input�outputr �ns�liner!r!r"r�s


cCs(|��}|sq$t�|�}|�|�qdSr1)�readliner&r0r�)r�r�r�r r!r!r"r�s

c
Cs�zt|�}Wn8tk
rD}zd|jj}t|�|�W5d}~XYnX|jdkrjd|j|jjf}t|��|jdkr�d|j|jjf}t|��dS)Nz"expected bytes-like object, not %s)rSr;�Bz-expected single byte elements, not %r from %srCz(expected 1-D data, not %d-D data from %s)rrrrr��ndim)r �m�err�msgr!r!r"�_input_type_check�s
�
�r�cCsLt|�g}tdt|�t�D]$}|||t�}|�t�|��qd�|�S)Nrro)r�rQrMr�r�r&r'rr)r �piecesr7r�r!r!r"rscCsddl}|�dtd�t|�S)NrzAencodestring() is a deprecated alias since 3.1, use encodebytes()rD)�warnings�warn�DeprecationWarningr�r r�r!r!r"�encodestrings�r�cCst|�t�|�Sr1)r�r&r0rr!r!r"rscCsddl}|�dtd�t|�S)NrzHdecodestring() is a deprecated alias since Python 3.1, use decodebytes()rD)r�r�r�rr�r!r!r"�decodestring$s�r�c	
Csddl}ddl}z|�|jdd�d�\}}WnP|jk
r~}z0|j|_t|�td|jd�|�d�W5d}~XYnXt}|D]@\}}|dkr�t}|dkr�t	}|dkr�t	}|d	kr�t
�dSq�|�r|dd
k�rt|dd��}|||jj�W5QRXn||j
j|jj�dS)NrrCZdeutz�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'rDz-ez-dz-uz-t�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)	r�r�Zopts�argsr��func�or:�fr!r!r"�main.s2�r�cCs<d}tt|��t|�}tt|��t|�}tt|��dS)NsAladdin:open sesame)r��reprrr)Zs0�s1�s2r!r!r"r�Hsr��__main__)N)NF)FN)F)FFF)F)1r-rpr&�__all__r)rNrr#rrrrr*r2r3rrrLrKr\rr	r
rr{rr�r�rvrrr�r�r�r�rr
ZMAXLINESIZEr�rrr�rr�rr�r�r�rr!r!r!r"�<module>	s��

	&
C

)H
-	
	


_collections_abc.cpython-38.pyc000064400000070107151450073350012466 0ustar00U

e5d�e�@stdZddlmZmZddlZdddddd	d
ddd
dddddddddddddddgZdZeed��Z	eee
���Zeei����Z
eei����Zeei����Zeeg��Zeeeg���Zeeed���Zeeedd >���Zeee���Zeed!��Zeed"��Zeee���Zei���Zei���Zei���Z eej!�Z"ed#d$���Z#d%d&�Z$e$�Z$ee$�Z%e$�&�[$d'd(�Z'e'�Z'ee'�Z(['d)d*�Z)Gd+d	�d	ed,�Z*Gd-d�ded,�Z+Gd.d�de+�Z,e,�-e%�Gd/d�ded,�Z.Gd0d�de.�Z/Gd1d�de/�Z0e0�-e(�Gd2d
�d
ed,�Z1Gd3d�de1�Z2e2�-e	�e2�-e�e2�-e
�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�Gd4d
�d
e1�Z3Gd5d�de2�Z4e4�-e#�Gd6d�ded,�Z5Gd7d�ded,�Z6Gd8d�de5e1e6�Z7Gd9d�ded,�Z8Gd:d�de7�Z9e9�-e:�Gd;d�de9�Z;e;�-e�Gd<d�de7�Z<e<�-e"�Gd=d�de5�Z=Gd>d�de=e9�Z>e>�-e�Gd?d�de=e9�Z?e?�-e �Gd@d�de=e7�Z@e@�-e�GdAd�de<�ZAeA�-eB�GdBd�de3e7�ZCeC�-eD�eC�-eE�eC�-e�eC�-eF�GdCd�deC�ZGeG�-eH�eG�-e
�GdDd�deC�ZIeI�-eJ�eI�-e
�dS)EzjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
�)�ABCMeta�abstractmethodN�	Awaitable�	Coroutine�
AsyncIterable�
AsyncIterator�AsyncGenerator�Hashable�Iterable�Iterator�	Generator�
Reversible�Sized�	Container�Callable�
Collection�Set�
MutableSet�Mapping�MutableMapping�MappingView�KeysView�	ItemsView�
ValuesView�Sequence�MutableSequence�
ByteStringzcollections.abc��i���ccsdVS�Nr r r r �(/usr/lib64/python3.8/_collections_abc.py�<lambda>8rr#c�sdSr!r r r r r"�_coro:rr$cCs
dVdSr!r r r r r"�_ag@rr%cGsN|j}|D]>}|D],}||jkr|j|dkr:tSq
qtSq
dS)NT)�__mro__�__dict__�NotImplemented)�C�methods�mro�method�Br r r"�_check_methodsHs

r.c@s(eZdZdZedd��Zedd��ZdS)r	r cCsdS�Nrr ��selfr r r"�__hash__XszHashable.__hash__cCs|tkrt|d�StS)Nr2)r	r.r(��clsr)r r r"�__subclasshook__\s
zHashable.__subclasshook__N)�__name__�
__module__�__qualname__�	__slots__rr2�classmethodr5r r r r"r	Ts

)�	metaclassc@s(eZdZdZedd��Zedd��ZdS)rr ccs
dVdSr!r r0r r r"�	__await__gszAwaitable.__await__cCs|tkrt|d�StS)Nr<)rr.r(r3r r r"r5ks
zAwaitable.__subclasshook__N)r6r7r8r9rr<r:r5r r r r"rcs

c@s>eZdZdZedd��Zeddd��Zdd�Zed	d
��Z	dS)rr cCst�dS)zcSend a value into the coroutine.
        Return next yielded value or raise StopIteration.
        N��
StopIteration�r1�valuer r r"�sendvszCoroutine.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        N��with_traceback�r1�typ�val�tbr r r"�throw}s
zCoroutine.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)�.Raise GeneratorExit inside coroutine.
        zcoroutine ignored GeneratorExitN�rH�
GeneratorExitr>�RuntimeErrorr0r r r"�close�s
zCoroutine.closecCs|tkrt|dddd�StS)Nr<rArHrM)rr.r(r3r r r"r5�szCoroutine.__subclasshook__)NN)
r6r7r8r9rrArHrMr:r5r r r r"rrs

c@s(eZdZdZedd��Zedd��ZdS)rr cCst�Sr!)rr0r r r"�	__aiter__�szAsyncIterable.__aiter__cCs|tkrt|d�StS)NrN)rr.r(r3r r r"r5�s
zAsyncIterable.__subclasshook__N)r6r7r8r9rrNr:r5r r r r"r�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr c�st�dS)z@Return the next item or raise StopAsyncIteration when exhausted.N��StopAsyncIterationr0r r r"�	__anext__�szAsyncIterator.__anext__cCs|Sr!r r0r r r"rN�szAsyncIterator.__aiter__cCs|tkrt|dd�StS)NrQrN)rr.r(r3r r r"r5�szAsyncIterator.__subclasshook__N)	r6r7r8r9rrQrNr:r5r r r r"r�s
c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr c�s|�d�IdHS)zpReturn the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        N)�asendr0r r r"rQ�szAsyncGenerator.__anext__c�st�dS)zuSend a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrOr?r r r"rR�szAsyncGenerator.asendNc�s4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zyRaise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrBrDr r r"�athrow�s
zAsyncGenerator.athrowc	�s:z|�t�IdHWnttfk
r,Yn
Xtd��dS)rINz,asynchronous generator ignored GeneratorExit)rSrKrPrLr0r r r"�aclose�s
zAsyncGenerator.aclosecCs|tkrt|ddddd�StS)NrNrQrRrSrT)rr.r(r3r r r"r5�s�zAsyncGenerator.__subclasshook__)NN)r6r7r8r9rQrrRrSrTr:r5r r r r"r�s

c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__iter__�szIterable.__iter__cCs|tkrt|d�StS)NrU)r
r.r(r3r r r"r5�s
zIterable.__subclasshook__N)r6r7r8r9rrUr:r5r r r r"r
�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr cCst�dS)zKReturn the next item from the iterator. When exhausted, raise StopIterationNr=r0r r r"�__next__szIterator.__next__cCs|Sr!r r0r r r"rUszIterator.__iter__cCs|tkrt|dd�StS)NrUrV)rr.r(r3r r r"r5szIterator.__subclasshook__N)	r6r7r8r9rrVrUr:r5r r r r"rs
c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__reversed__)szReversible.__reversed__cCs|tkrt|dd�StS)NrWrU)r
r.r(r3r r r"r5.szReversible.__subclasshook__N)r6r7r8r9rrWr:r5r r r r"r
%s

c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr cCs
|�d�S)z^Return the next item from the generator.
        When exhausted, raise StopIteration.
        N)rAr0r r r"rV9szGenerator.__next__cCst�dS)zcSend a value into the generator.
        Return next yielded value or raise StopIteration.
        Nr=r?r r r"rA?szGenerator.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the generator.
        Return next yielded value or raise StopIteration.
        NrBrDr r r"rHFs
zGenerator.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)z.Raise GeneratorExit inside generator.
        zgenerator ignored GeneratorExitNrJr0r r r"rMSs
zGenerator.closecCs|tkrt|ddddd�StS)NrUrVrArHrM)rr.r(r3r r r"r5]s�zGenerator.__subclasshook__)NN)r6r7r8r9rVrrArHrMr:r5r r r r"r5s

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdSr/r r0r r r"�__len__ksz
Sized.__len__cCs|tkrt|d�StS)NrX)rr.r(r3r r r"r5os
zSized.__subclasshook__N)r6r7r8r9rrXr:r5r r r r"rgs

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdS�NFr )r1�xr r r"�__contains__zszContainer.__contains__cCs|tkrt|d�StS)Nr[)rr.r(r3r r r"r5~s
zContainer.__subclasshook__N)r6r7r8r9rr[r:r5r r r r"rvs

c@seZdZdZedd��ZdS)rr cCs|tkrt|ddd�StS)NrXrUr[)rr.r(r3r r r"r5�szCollection.__subclasshook__N)r6r7r8r9r:r5r r r r"r�sc@s(eZdZdZedd��Zedd��ZdS)rr cOsdSrYr )r1�args�kwdsr r r"�__call__�szCallable.__call__cCs|tkrt|d�StS)Nr^)rr.r(r3r r r"r5�s
zCallable.__subclasshook__N)r6r7r8r9rr^r:r5r r r r"r�s

c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
d��Zdd�ZeZ
dd�Zdd�ZeZdd�Zdd�Zdd�ZeZdd�ZdS)raZA set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__ and __len__.

    To override the comparisons (presumably for speed, as the
    semantics are fixed), redefine __le__ and __ge__,
    then the other operations will automatically follow suit.
    r cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dS�NFT��
isinstancerr(�len�r1�other�elemr r r"�__le__�s
z
Set.__le__cCs(t|t�stSt|�t|�ko&|�|�Sr!�rarr(rbrf�r1rdr r r"�__lt__�s
z
Set.__lt__cCs(t|t�stSt|�t|�ko&|�|�Sr!)rarr(rb�__ge__rhr r r"�__gt__�s
z
Set.__gt__cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dSr_r`rcr r r"rj�s
z
Set.__ge__cCs(t|t�stSt|�t|�ko&|�|�Sr!rgrhr r r"�__eq__�s
z
Set.__eq__cCs||�S)z�Construct an instance of the class from any iterable input.

        Must override this method if the class constructor signature
        does not accept an iterable for an input.
        r )r4�itr r r"�_from_iterable�szSet._from_iterablecs&t|t�stS���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ��.0r@r0r r"�	<genexpr>�szSet.__and__.<locals>.<genexpr>�rar
r(rnrhr r0r"�__and__�s
zSet.__and__cCs|D]}||krdSqdS)z1Return True if two sets have a null intersection.FTr )r1rdr@r r r"�
isdisjoint�szSet.isdisjointcCs*t|t�stSdd�||fD�}|�|�S)Ncss|]}|D]
}|Vq
qdSr!r )rp�s�er r r"rq�szSet.__or__.<locals>.<genexpr>rr)r1rd�chainr r r"�__or__�s
z
Set.__or__cs:t�t�s"t�t�stS|����|��fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ro�rdr r"rq�s�zSet.__sub__.<locals>.<genexpr>�rarr
r(rnrhr ryr"�__sub__�s



zSet.__sub__cs:t|t�s"t|t�stS��|�}���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ror0r r"rq�s�zSet.__rsub__.<locals>.<genexpr>rzrhr r0r"�__rsub__�s



zSet.__rsub__cCs2t|t�s"t|t�stS|�|�}||||BSr!rzrhr r r"�__xor__s



zSet.__xor__cCs�tj}d|d}t|�}d|d}||M}|D],}t|�}|||d>AdAdN}||M}q2|dd}||M}||kr�||d8}|d	kr�d
}|S)a+Compute the hash value of a set.

        Note that we don't define __hash__: not all sets are hashable.
        But if you define a hashable set type, its __hash__ should
        call this function.

        This must be compatible __eq__.

        All sets ought to compare equal if they contain the same
        elements, regardless of how they are implemented, and
        regardless of the order of the elements; so there's not much
        freedom for __eq__ or __hash__.  We match the algorithm used
        by the built-in frozenset type.
        �riM��r�i�M[l�4~2i�
i��6���i��8#)�sys�maxsizerb�hash)r1�MAX�MASK�n�hrZ�hxr r r"�_hash	s 
z	Set._hashN)r6r7r8�__doc__r9rfrirkrjrlr:rnrs�__rand__rtrx�__ror__r{r|r}�__rxor__r�r r r r"r�s&



c@sdeZdZdZdZedd��Zedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)ra�A mutable set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__, __len__,
    add(), and discard().

    To override the comparisons (presumably for speed, as the
    semantics are fixed), all you have to do is redefine __le__ and
    then the other operations will automatically follow suit.
    r cCst�dS)zAdd an element.N��NotImplementedErrorr?r r r"�add:szMutableSet.addcCst�dS)z8Remove an element.  Do not raise an exception if absent.Nr�r?r r r"�discard?szMutableSet.discardcCs||krt|��|�|�dS)z5Remove an element. If not a member, raise a KeyError.N)�KeyErrorr�r?r r r"�removeDszMutableSet.removecCs>t|�}zt|�}Wntk
r.td�YnX|�|�|S)z2Return the popped value.  Raise KeyError if empty.N)�iter�nextr>r�r��r1rmr@r r r"�popJs
zMutableSet.popcCs(z|��qWntk
r"YnXdS)z6This is slow (creates N new iterators!) but effective.N)r�r�r0r r r"�clearTszMutableSet.clearcCs|D]}|�|�q|Sr!)r�r�r r r"�__ior__\szMutableSet.__ior__cCs||D]}|�|�q|Sr!)r�r�r r r"�__iand__aszMutableSet.__iand__cCsR||kr|��n<t|t�s&|�|�}|D]"}||krB|�|�q*|�|�q*|Sr!)r�rarrnr�r�r�r r r"�__ixor__fs


zMutableSet.__ixor__cCs*||kr|��n|D]}|�|�q|Sr!)r�r�r�r r r"�__isub__ss

zMutableSet.__isub__N)r6r7r8r�r9rr�r�r�r�r�r�r�r�r�r r r r"r,s



c@sReZdZdZedd��Zddd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdS)rr cCst�dSr!�r��r1�keyr r r"�__getitem__�szMapping.__getitem__NcCs(z
||WStk
r"|YSXdS)z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.Nr��r1r��defaultr r r"�get�s
zMapping.getcCs,z||Wntk
r"YdSXdSdSr_r�r�r r r"r[�s
zMapping.__contains__cCst|�S)z:D.keys() -> a set-like object providing a view on D's keys)rr0r r r"�keys�szMapping.keyscCst|�S)z<D.items() -> a set-like object providing a view on D's items)rr0r r r"�items�sz
Mapping.itemscCst|�S)z6D.values() -> an object providing a view on D's values)rr0r r r"�values�szMapping.valuescCs&t|t�stSt|���t|���kSr!)rarr(�dictr�rhr r r"rl�s
zMapping.__eq__)N)
r6r7r8r9rr�r�r[r�r�r�rlrWr r r r"r�s


c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��_mappingcCs
||_dSr!r�)r1�mappingr r r"�__init__�szMappingView.__init__cCs
t|j�Sr!)rbr�r0r r r"rX�szMappingView.__len__cCs
d�|�S)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr0r r r"�__repr__�szMappingView.__repr__N)r6r7r8r9r�rXr�r r r r"r�sc@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!��set�r1rmr r r"rn�szKeysView._from_iterablecCs
||jkSr!r�r�r r r"r[�szKeysView.__contains__ccs|jEdHdSr!r�r0r r r"rU�szKeysView.__iter__N�r6r7r8r9r:rnr[rUr r r r"r�s

c@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!r�r�r r r"rn�szItemsView._from_iterablecCsB|\}}z|j|}Wntk
r,YdSX||kp<||kSdSrY)r�r�)r1�itemr�r@�vr r r"r[�szItemsView.__contains__ccs |jD]}||j|fVqdSr!r�r�r r r"rU�s
zItemsView.__iter__Nr�r r r r"r�s

	c@s eZdZdZdd�Zdd�ZdS)rr cCs0|jD]$}|j|}||ks$||krdSqdS�NTFr�)r1r@r�r�r r r"r[�s


zValuesView.__contains__ccs|jD]}|j|VqdSr!r�r�r r r"rU�s
zValuesView.__iter__N)r6r7r8r9r[rUr r r r"r�sc@s^eZdZdZedd��Zedd��Ze�Zefdd�Z	dd	�Z
d
d�Zddd
�Zddd�Z
dS)rr cCst�dSr!r��r1r�r@r r r"�__setitem__szMutableMapping.__setitem__cCst�dSr!r�r�r r r"�__delitem__szMutableMapping.__delitem__cCs@z||}Wn$tk
r0||jkr(�|YSX||=|SdS)z�D.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.
        N)r��_MutableMapping__marker)r1r�r�r@r r r"r�s

zMutableMapping.popcCsBztt|��}Wntk
r*td�YnX||}||=||fS)z�D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        N)r�r�r>r�r�r r r"�popitem$szMutableMapping.popitemcCs(z|��qWntk
r"YnXdS)z,D.clear() -> None.  Remove all items from D.N)r�r�r0r r r"r�0szMutableMapping.clearcKs|t|t�r"|D]}||||<qn<t|d�rH|��D]}||||<q4n|D]\}}|||<qL|��D]\}}|||<qfdS)aK D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
            In either case, this is followed by: for k, v in F.items(): D[k] = v
        r�N)rar�hasattrr�r�)r1rdr]r�r@r r r"�update8s


zMutableMapping.updateNcCs,z
||WStk
r&|||<YnX|S)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in Dr�r�r r r"�
setdefaultJs

zMutableMapping.setdefault)r )N)r6r7r8r9rr�r��objectr�r�r�r�r�r�r r r r"r�s


c@sJeZdZdZdZedd��Zdd�Zdd�Zd	d
�Z	dd
d�Z
dd�ZdS)rz�All the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    r cCst�dSr!��
IndexError�r1�indexr r r"r�bszSequence.__getitem__ccs<d}z||}|V|d7}qWntk
r6YdSXdS)Nrrr�)r1�ir�r r r"rUfszSequence.__iter__cCs$|D]}||ks||krdSqdSr�r )r1r@r�r r r"r[pszSequence.__contains__ccs$ttt|���D]}||VqdSr!)�reversed�rangerb)r1r�r r r"rWvszSequence.__reversed__rNcCs�|dk	r"|dkr"tt|�|d�}|dk	r>|dkr>|t|�7}|}|dksR||kr�z"||}||ksl||krr|WSWntk
r�Yq�YnX|d7}qBt�dS)z�S.index(value, [start, [stop]]) -> integer -- return first index of value.
           Raises ValueError if the value is not present.

           Supporting start and stop arguments is optional, but
           recommended.
        Nrr)�maxrbr��
ValueError)r1r@�start�stopr�r�r r r"r�zs


zSequence.indexcst�fdd�|D��S)zBS.count(value) -> integer -- return number of occurrences of valuec3s"|]}|�ks|�krdVqdS)rNr )rpr��r@r r"rq�sz!Sequence.count.<locals>.<genexpr>)�sumr?r r�r"�count�szSequence.count)rN)r6r7r8r�r9rr�rUr[rWr�r�r r r r"rXs


c@seZdZdZdZdS)rzMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    r N)r6r7r8r�r9r r r r"r�sc@sneZdZdZedd��Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�ZdS)rr cCst�dSr!r��r1r�r@r r r"r��szMutableSequence.__setitem__cCst�dSr!r�r�r r r"r��szMutableSequence.__delitem__cCst�dS)z3S.insert(index, value) -- insert value before indexNr�r�r r r"�insert�szMutableSequence.insertcCs|�t|�|�dS)z:S.append(value) -- append value to the end of the sequenceN)r�rbr?r r r"�append�szMutableSequence.appendcCs(z|��qWntk
r"YnXdS)z,S.clear() -> None -- remove all items from SN)r�r�r0r r r"r��szMutableSequence.clearcCsHt|�}t|d�D].}|||d||||<|||d<qdS)z!S.reverse() -- reverse *IN PLACE*r~rN)rbr�)r1r�r�r r r"�reverse�szMutableSequence.reversecCs(||krt|�}|D]}|�|�qdS)zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)�listr�)r1r�r�r r r"�extend�szMutableSequence.extendr�cCs||}||=|S)z�S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r )r1r�r�r r r"r��szMutableSequence.popcCs||�|�=dS)zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r�r?r r r"r��szMutableSequence.removecCs|�|�|Sr!)r�)r1r�r r r"�__iadd__�s
zMutableSequence.__iadd__N)r�)r6r7r8r9rr�r�r�r�r�r�r�r�r�r�r r r r"r�s	



)Kr��abcrrr��__all__r6�typer��bytes_iterator�	bytearray�bytearray_iteratorr��dict_keyiteratorr��dict_valueiteratorr��dict_itemiterator�
list_iteratorr��list_reverseiteratorr��range_iterator�longrange_iteratorr��set_iterator�str_iterator�tuple_iterator�zip�zip_iterator�	dict_keys�dict_values�
dict_itemsr'�mappingproxy�	generatorr$�	coroutinerMr%�async_generatorr.r	rr�registerrrrr
rr
rrrrrr�	frozensetrrrrrrrr�r�tuple�str�
memoryviewr�bytesrr�r r r r"�<module>s��	
)
0













/



O
2



S
=



	

C
__phello__.foo.cpython-38.opt-1.pyc000064400000000201151450073350012770 0ustar00U

e5d@�@sdS)N�rrr�&/usr/lib64/python3.8/__phello__.foo.py�<module>�antigravity.cpython-38.opt-2.pyc000064400000001217151450073350012501 0ustar00U

e5d��@s&ddlZddlZe�d�dd�ZdS)�Nzhttps://xkcd.com/353/cCs\t�|���}dd�|dd�|dd�fD�\}}td||dd�||dd�f�dS)NcSsg|]}dt�d|��qS)z%fz0.)�float�fromhex)�.0�x�r�#/usr/lib64/python3.8/antigravity.py�
<listcomp>szgeohash.<locals>.<listcomp>�� z	%d%s %d%s�)�hashlibZmd5Z	hexdigest�print)ZlatitudeZ	longitudeZdatedow�h�p�qrrr�geohashs&r)Z
webbrowserr�openrrrrr�<module>s
pickle.cpython-38.opt-2.pyc000064400000117731151450073350011420 0ustar00U

e5d��	@sdddlmZddlmZddlmZmZmZddlmZddl	m
Z
ddlZddlmZddl
mZmZddlZddlZddlZddlZd	d
ddd
ddddg	ZzddlmZe�d�dZWnek
r�dZYnXeefZdZddddddddgZdZdZ Gd d	�d	e!�Z"Gd!d
�d
e"�Z#Gd"d�de"�Z$Gd#d$�d$e!�Z%zdd%l&m'Z'Wnek
�rhdZ'YnXd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^eNeXeYeZgZ_d]Z`d^Zad_Zbd`ZcdaZddbZedcZfddZgdeZhdfZidgZjdhZkdiZldjZmdkZne�odldm�ep�D��Gdndo�do�ZqGdpdq�dq�Zrdrds�Zsdtdu�Ztdvdw�Zudxdy�ZvGdzd{�d{�ZwGd|d}�d}�Zxd�ddd~�dd��Zyd�ddd~�d�d��Zzdd�d�dd��d�d��Z{dd�d�dd��d�d��Z|z0dd�lm"Z"m#Z#m$Z$m}Z}m~Z~mZm�Z�m�Z�m�Z�Wn4ek
�r�ewexZ}Z~eyeze{e|f\ZZ�Z�Z�YnXd�d��Z�e�d�k�r`ddl�Z�e�j�d�d��Z�e�j�d�e���d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e����Z�e�j��r&e��n:e�j��s8e����n(ddl�Z�e�j�D]Z�e�e��Z�e���e���qFdS)��)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loads)�PickleBufferrTFz4.0z1.0z1.1z1.2z1.3z2.0z3.0z5.0��c@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/pickle.pyrIsc@seZdZdS)r
Nrrrrrr
Msc@seZdZdS)rNrrrrrrTs	c@seZdZdd�ZdS)�_StopcCs
||_dS�N)�value��selfr rrr�__init__bsz_Stop.__init__N)rrrr#rrrrrasr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
�������������������������B�C��������������������������cCsg|]}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srmc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dSr)�
file_write�
current_frame)r"rorrrr#�sz_Framer.__init__cCst��|_dSr)�io�BytesIOrp�r"rrr�
start_framing�sz_Framer.start_framingcCs*|jr&|j��dkr&|jdd�d|_dS)NrT��force)rp�tell�commit_framersrrr�end_framing�sz_Framer.end_framingFcCsf|jrb|j}|��|jks|rb|��}|j}t|�|jkrP|ttdt|���||�t	�
�|_dS)N�<Q)rprw�_FRAME_SIZE_TARGET�	getbufferro�len�_FRAME_SIZE_MIN�FRAMEr
rqrr)r"rv�f�data�writerrrrx�sz_Framer.commit_framecCs |jr|j�|�S|�|�SdSr)rpr�ro�r"r�rrrr��sz
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NTru)rorprx)r"�headerZpayloadr�rrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrr~r{r#rtryrxr�r�rrrrrn�s
rnc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	_UnframerNcCs||_||_d|_dSr)�	file_read�
file_readlinerp)r"r�r�Z	file_tellrrrr#	sz_Unframer.__init__cCs�|jrb|j�|�}|dkrJt|�dkrJd|_t|�}|�|�|dd�<|S|t|�kr^td��|St|�}|�|�|dd�<|SdS�Nr�$pickle exhausted before end of frame)rp�readintor}r�r)r"�buf�nrrrr�s�z_Unframer.readintocCsT|jrF|j�|�}|s.|dkr.d|_|�|�St|�|krBtd��|S|�|�SdSr�)rp�readr�r}r�r"r�r�rrrr�s
�z_Unframer.readcCsF|jr:|j��}|s"d|_|��S|ddkr6td��|S|��SdS)N����
r�)rp�readliner�rr�rrrr�,s
�z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rpr�rrqrrr��r"Z
frame_sizerrr�
load_frame9s
�z_Unframer.load_frame)N)rrrr#r�r�r�r�rrrrr�s



r�c	Csj|�d�D]V}|dkr&td�||���z|}t||�}Wq
tk
r^td�||��d�Yq
Xq
||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributeBs"���
r�c	Cs�t|dd�}|dk	r|Stj����D]X\}}|dks&|dks&|dkrHq&z t||�d|krf|WSWq&tk
r|Yq&Xq&dS)Nr�__main__Z__mp_main__r)r��sys�modules�copy�itemsr�r�)r�r��module_name�modulerrr�whichmoduleOs ��r�cCsh|dkrdS|��d?d}|j|ddd�}|dkrd|dkrd|dd	krd|d
d@dkrd|dd�}|S)Nrr����littleT��	byteorderZsignedr������)�
bit_length�to_bytes)rl�nbytes�resultrrr�encode_longbsr�cCstj|ddd�S)Nr�Tr�)�int�
from_bytes)r�rrr�decode_long�sr�c@s�eZdZd;ddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd<dd�Z	dd�Z
dd�Zd=dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<er�d$d%�Zee
e<d&d'�Zee
e<d(d)�Zee
e <d*d+�Z!e!e
e"<d,Z#d-d.�Z$d/d0�Z%e%e
e&<e'dk	�r@e%e
e'<d1d2�Z(d3d4�Z)e)e
e*<d5d6�Z+e+e
e,<d>d7d8�Z-d9d:�Z.e-e
e/<e.e
e<dS)?�_PicklerNT��fix_imports�buffer_callbackcCs�|dkrt}|dkrt}n"d|kr.tks<ntdt��|dk	rT|dkrTtd��||_z|j|_Wntk
r�td��YnXt|j�|_	|j	j|_|j	j
|_i|_t
|�|_|dk|_d|_|o�|dk|_dS)Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributer�r�)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueError�_buffer_callbackr��_file_writer��	TypeErrorrn�framerr��_write_large_bytes�memor��proto�bin�fastr�)r"�file�protocolr�r�rrrr#�s*#



z_Pickler.__init__cCs|j��dSr)r��clearrsrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|�ttd|j��|jdkrP|j�	�|�
|�|�t�|j��dS)Nr�z2Pickler.__init__() was not called by %s.__init__()��<Br)
�hasattrr
�	__class__rr�r��PROTOr
r�rt�save�STOPry�r"r�rrrr�s
�




z
_Pickler.dumpcCs:|jr
dSt|j�}|�|�|��||f|jt|�<dSr)r�r}r�r��put�id)r"r��idxrrr�memoize�s

z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|��d�dSdS)Nr�r��<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)r"r�rrrr�s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|��d�dS)Nr�r�r�r�r�)r��BINGETr
�LONG_BINGET�GETr�r��r"�irrr�gets
z_Pickler.getc
Cs�|j��|�|�}|dk	r.|r.|�|�dS|j�t|��}|dk	r^|�|�|d��dSt}t	|dd�}|dk	r~||�}|tk�r@t
|�}|j�|�}|dk	r�|||�dSt	|dt��|�}|dk	r�||�}njt
|t
�r�|�|�dSt	|dd�}|dk	�r||j�}n0t	|dd�}|dk	�r.|�}ntd|j|f��t|t��r\|�||�dSt|t��sttd|��t|�}	d|	k�r�d	k�s�ntd
|��|j|d|i�dS)NrZreducer_overrider�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z2Tuple returned by %s must have two to six elementsr�)r�rx�
persistent_id�	save_persr�r�r�r��NotImplementedr��type�dispatchr�
issubclass�save_globalr�r
r�
isinstance�str�tupler}�save_reduce)
r"r��save_persistent_id�pidrl�rv�reduce�tr��lrrrr�sZ









��z
_Pickler.savecCsdSrrr�rrrr�]sz_Pickler.persistent_idcCsb|jr |j|dd�|�t�n>z |�tt|��d�d�Wntk
r\td��YnXdS)NF)r�r�r��2persistent IDs in protocol 0 must be ASCII strings)	r�r�r��	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
�r"r�rrrr�as �z_Pickler.save_persc
Cs>t|t�std��t|�s"td��|j}|j}	t|dd�}
|jdkr�|
dkr�|\}}}t|d�sntd�	|
���|dk	r�||j
k	r�td	�	|
���|jd
kr�||�||�||�|	t�n,t|j
|f|�|�}||�|d�|	t�n�|jdk�r^|
dk�r^|d
}t|d��std��|dk	�r8||j
k	�r8td��|dd�}||�||�|	t�n||�||�|	t�|dk	�r�t|�|jk�r�|	t|�|jt|�d
��n
|�|�|dk	�r�|�|�|dk	�r�|�|�|dk	�r:|dk�r
||�|	t�n0||�||�||�|	t�|	t�|	t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r��
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classrr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�r�r�r�r�r�r��	NEWOBJ_EXrr�REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD�TUPLE2)
r"�func�args�stateZ	listitemsZ	dictitemsZstate_setterr�r�r�Z	func_name�cls�kwargsrrrr�msz


��


��

"







z_Pickler.save_reducecCs|�t�dSr)r��NONEr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|�|rtnt�n|�|r*tnt�dS)Nr�)r�r��NEWTRUE�NEWFALSE�TRUE�FALSEr�rrr�	save_bool�s
z_Pickler.save_boolcCs.|jr~|dkrN|dkr.|�ttd|��dS|dkrN|�ttd|��dSd|krbdkr~nn|�ttd|��dS|jd	kr�t|�}t|�}|d
kr�|�t	td|�|�n|�t
td|�|�dSd|kr�dk�rnn|�tt|��
d�d�n|�tt|��
d�d
�dS)Nrr�r���<Hi�i����<ir�r�r�r�sL
)r�r��BININT1r
�BININT2�BININTr�r�r}�LONG1�LONG4�INTr�r��LONG�r"r�Zencodedr�rrr�	save_long�s*
z_Pickler.save_longcCs<|jr|�ttd|��n|�tt|��d�d�dS)N�>dr�r�)r�r��BINFLOATr
�FLOATr�r�r�rrr�
save_floatsz_Pickler.save_floatcCs�|jdkr@|s |jtd|d�n|jtjt|d�df|d�dSt|�}|dkrj|�tt	d|�|�nf|dkr�|jdkr�|�
tt	d	|�|�n<||jj
kr�|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nr�r�r��latin1r�r����rrzr�)r�r��bytes�codecsr�r�r}r��SHORT_BINBYTESr
r��	BINBYTES8r�r{�BINBYTESr��r"r�r�rrr�
save_bytess"
�z_Pickler.save_bytescCs�|jdkr:|s |jtd|d�n|jtt|�f|d�dSt|�}||jjkrf|�tt	d|�|�n|�
tt	d|�|�dS)Nrrr)rz)r�r��	bytearrayr,r}r�r{r��
BYTEARRAY8r
r�r1rrr�save_bytearray)s
z_Pickler.save_bytearrayc	Cs�|jdkrtd��|���t}|js*td��d}|jdk	rFt|�|��}|rp|jr`|�|���q�|�	|���n|�
t�|jr�|�
t�W5QRXdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT)
r�r
�raw�
contiguousr��bool�readonlyr2�tobytesr5r��NEXT_BUFFER�READONLY_BUFFER)r"r��mZin_bandrrr�save_picklebuffer8s



z_Pickler.save_picklebuffercCs|jr�|�dd�}t|�}|dkrF|jdkrF|�ttd|�|�nf|dkrp|jdkrp|�ttd|�|�n<||j	j
kr�|�ttd|�|�n|�ttd|�|�nT|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)N�utf-8�
surrogatepassr�rr�r+rzr��\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001a�raw-unicode-escaper�)r�r�r}r�r��SHORT_BINUNICODEr
r��BINUNICODE8r�r{�
BINUNICODE�replace�UNICODEr�r#rrr�save_strRs&�z_Pickler.save_strcCs:|s(|jr|�t�n|�tt�dSt|�}|j}|j}|dkr�|jdkr�|D]}||�qRt	|�|kr�|�
|t	|�d�}|�t||�n|�t|�|�
|�dS|j}|t�|D]}||�q�t	|�|k�r$|�
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|�
|�dS)Nr�r�rr�)r�r��EMPTY_TUPLE�MARK�TUPLEr}r�r�r�r�r�r�_tuplesize2coder��POP_MARK)r"r�r�r�r�Zelementr�r�rrr�
save_tupleis:


z_Pickler.save_tuplecCs8|jr|�t�n|�tt�|�|�|�|�dSr)r�r��
EMPTY_LISTrN�LISTr�r	r�rrr�	save_list�s

z_Pickler.save_listi�cCs�|j}|j}|js0|D]}||�|t�qdSt|�}tt||j��}t|�}|dkr||t	�|D]}||�qd|t
�n|r�||d�|t�||jkr8dSq8dS�Nr�r)r�r�r��APPEND�iter�listr�
_BATCHSIZEr}rN�APPENDS)r"r�r�r�rl�it�tmpr�rrrr	�s(



z_Pickler._batch_appendscCs<|jr|�t�n|�tt�|�|�|�|���dSr)r�r��
EMPTY_DICTrN�DICTr�r
r�r�rrr�	save_dict�s

z_Pickler.save_dictc	Cs�|j}|j}|js<|D] \}}||�||�|t�qdSt|�}tt||j��}t|�}|dkr�|t	�|D]\}}||�||�qp|t
�n(|r�|d\}}||�||�|t�||jkrDdSqDdSrV)r�r�r��SETITEMrXrYrrZr}rN�SETITEMS)	r"r�r�r��k�vr\r]r�rrrr
�s0



z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|�|�t|�}tt	||j
��}t|�}|dkr�|t�|D]}||�qv|t
�||j
krJdSqJdS�Nrr)r)r�r�r�r��setrY�	EMPTY_SETr�rXrrZr}rN�ADDITEMS)r"r�r�r�r\Zbatchr��itemrrr�save_set�s"



z_Pickler.save_setcCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|D]}||�q<t|�|jkr||t	|�
|jt|�d��dS|t�|�|�dSre)
r�r�r�r��	frozensetrYrNr�r�rQr��	FROZENSETr�)r"r�r�r�rirrr�save_frozensets

 z_Pickler.save_frozensetc

CsX|j}|j}|dkr t|dd�}|dkr.|j}t||�}z(t|dd�tj|}t||�\}}Wn.t	t
tfk
r�td|||f�d�YnX||k	r�td|||f��|j
dk�rt�||f�}	|	�r|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|�d�d}
||k�r6|
}|j
d
k�r`|�|�|�|�|t�n�||k	�r||�t||
f�n�|j
dk�r�|tt|d�dt|d�d�n�|j�r�tj}tj}||f|k�r�|||f\}}n||k�r�||}z(|tt|d�dt|d�d�Wn,tk
�rHtd|||j
f�d�YnX|�|�dS)Nrr��levelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�r�rrrr�rr�r?r�r�z?can't pickle global identifier '%s.%s' using pickle protocol %i) r�r�r�rr��
__import__r�r�r��ImportError�KeyErrorr�r
r�rr��EXT1r
�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr,r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGr�r�)
r"r�r�r�r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr�s�

�����





��
��

���z_Pickler.save_globalcCs`|td�kr|jtd|d�S|tt�kr:|jttf|d�S|td�krV|jtd|d�S|�|�S)Nrr).).)r�r�r�r�r�rrr�	save_typeasz_Pickler.save_type)N)T)NNNNN)N)0rrrr#r�rr�r�r�r�r�r�r�r�rr�rr8r$r�r(�floatr2r,r5r3�_HAVE_PICKLE_BUFFERr>rrLr�rRr�rUrYrZr	r`�dictr$r
rjrfrmrkr�r{rrrrrr��sj�9
	
F�
u1		

B	r�c@s�eZdZddddd�dd�Zdd	�Zd
d�Zdd
�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd �Zeeed<d!d"�Zeeed<d#d$�Zeeed<d%d&�Zeeed<d'd(�Z e ee!d<d)d*�Z"e"ee#d<d+d,�Z$e$ee%d<d-d.�Z&e&ee'd<d/d0�Z(d1d2�Z)e)ee*d<d3d4�Z+e+ee,d<d5d6�Z-e-ee.d<d7d8�Z/e/ee0d<d9d:�Z1e1ee2d<d;d<�Z3e3ee4d<d=d>�Z5e5ee6d<d?d@�Z7e7ee8d<dAdB�Z9e9ee:d<dCdD�Z;e;ee<d<dEdF�Z=e=ee>d<dGdH�Z?e?ee@d<dIdJ�ZAeAeeBd<dKdL�ZCeCeeDd<dMdN�ZEeEeeFd<dOdP�ZGeGeeHd<dQdR�ZIeIeeJd<dSdT�ZKeKeeLd<dUdV�ZMeMeeNd<dWdX�ZOeOeePd<dYdZ�ZQeQeeRd<d[d\�ZSeSeeTd<d]d^�ZUeUeeVd<d_d`�ZWeWeeXd<dadb�ZYdcdd�ZZeZee[d<dedf�Z\e\ee]d<dgdh�Z^e^ee_d<didj�Z`e`eead<dkdl�Zbebeecd<dmdn�Zdedeeed<dodp�Zfefeegd<dqdr�Zheheeid<dsdt�Zjejeekd<dudv�Zldwdx�Zmdydz�Zneneeod<d{d|�Zpepeeqd<d}d~�Zrereesd<dd��Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<dS)��
_UnpicklerT�ASCII�strictN�r��encoding�errors�bufferscCsH|dk	rt|�nd|_|j|_|j|_i|_||_||_d|_	||_
dS�Nr)rX�_buffersr��_file_readliner��
_file_readr�r�r�r�r�)r"r�r�r�r�r�rrrr#rs'z_Unpickler.__init__c
Cs�t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	|jj
|_
g|_g|_|jj
|_
d|_|j}|j}z&|d�}|s�t�||d|�qtWn,tk
r�}z|jWY�Sd}~XYnXdS)Nr�z4Unpickler.__init__() was not called by %s.__init__()rr�)r�rr�rr�r�r��	_unframerr�r�r��	metastack�stack�appendr�r��EOFErrorrr )r"r�r��keyZstopinstrrrr�s*
�



z_Unpickler.loadcCs |j}|j��|_|jj|_|Sr)r�r��popr��r"r�rrr�pop_mark�s
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)rr�rrr�persistent_load�sz_Unpickler.persistent_loadcCs:|�d�d}d|kr"tks0ntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)r"r�rrr�
load_proto�sz_Unpickler.load_protorcCs8td|�d��\}|tjkr(td|��|j�|�dS)Nrz�zframe size > sys.maxsize: %d)rr�r�r	r�r�r�r�rrrr��s
z_Unpickler.load_framecCsLz|��dd��d�}Wntk
r6td��YnX|�|�|��dS)Nr�r�r�)r��decode�UnicodeDecodeErrorrr�r�r�rrr�load_persid�s�
z_Unpickler.load_persidcCs|j��}|�|�|��dSr)r�r�r�r�r�rrr�load_binpersid�s
z_Unpickler.load_binpersidcCs|�d�dSr�r�rsrrr�	load_none�sz_Unpickler.load_nonecCs|�d�dS)NFr�rsrrr�
load_false�sz_Unpickler.load_falsecCs|�d�dS)NTr�rsrrr�	load_true�sz_Unpickler.load_truecCsL|��}|tdd�krd}n |tdd�kr4d}n
t|d�}|�|�dS)Nr�FTr)r�rrr�r�)r"r��valrrr�load_int�s
z_Unpickler.load_intcCs|�td|�d��d�dS)Nrrr�r�rr�rsrrr�load_binint�sz_Unpickler.load_binintcCs|�|�d�d�dSrV)r�r�rsrrr�load_binint1sz_Unpickler.load_binint1cCs|�td|�d��d�dS)Nrr�rr�rsrrr�load_binint2sz_Unpickler.load_binint2cCs@|��dd�}|r,|ddkr,|dd�}|�t|d��dS)Nr��Lr)r�r�r�)r"r�rrr�	load_longsz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dSrV)r�r�r�r�rrr�
load_long1s
z_Unpickler.load_long1cCs>td|�d��\}|dkr"td��|�|�}|�t|��dS)Nrrrz#LONG pickle has negative byte count)rr�rr�r�r�rrr�
load_long4s

z_Unpickler.load_long4cCs|�t|��dd���dS�Nr�)r�r|r�rsrrr�
load_float!sz_Unpickler.load_floatcCs|�td|�d��d�dS)Nr%r�rr�rsrrr�
load_binfloat%sz_Unpickler.load_binfloatcCs"|jdkr|S|�|j|j�SdS)Nr,)r�r�r�r!rrr�_decode_string)s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�r}rr�r�r-�
escape_decoder�rrr�load_string2s
(z_Unpickler.load_stringcCs@td|�d��\}|dkr"td��|�|�}|�|�|��dS)Nrrrz(BINSTRING pickle has negative byte count)rr�rr�r��r"r}r�rrr�load_binstring<s

z_Unpickler.load_binstringcCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr�rz2BINBYTES exceeds system's maximum size of %d bytes�rr�r	rr��r"r}rrr�
load_binbytesEs�z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�rF)r�r�r�rsrrr�load_unicodeMsz_Unpickler.load_unicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr�rz4BINUNICODE exceeds system's maximum size of %d bytesr?r@�rr�r	rr�r�r�rrr�load_binunicodeQs�z_Unpickler.load_binunicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nrzr�z5BINUNICODE8 exceeds system's maximum size of %d bytesr?r@r�r�rrr�load_binunicode8Ys�z_Unpickler.load_binunicode8cCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nrzr�z3BINBYTES8 exceeds system's maximum size of %d bytesr�r�rrr�load_binbytes8as�z_Unpickler.load_binbytes8cCsFtd|�d��\}|tkr&tdt��t|�}|�|�|�|�dS)Nrzr�z4BYTEARRAY8 exceeds system's maximum size of %d bytes)rr�r	rr3r�r�)r"r}�brrr�load_bytearray8is�
z_Unpickler.load_bytearray8cCsL|jdkrtd��zt|j�}Wntk
r<td��YnX|�|�dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)r�r�next�
StopIterationr�)r"r�rrr�load_next_bufferss
z_Unpickler.load_next_bufferc	Cs6|jd}t|��}|js(|��|jd<W5QRXdSr�)r��
memoryviewr9�
toreadonly)r"r�r=rrr�load_readonly_buffer~s

z_Unpickler.load_readonly_buffercCs,|�d�d}|�|�}|�|�|��dSrV)r�r�r�r�rrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dSrV)r�r�r�rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rr?r@)r�r�r�r�rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|��}|�t|��dSr)r�r�r�r�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|�d�dS)Nrr�rsrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dSr��r�rsrrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�rsrrr�load_tuple2�sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�r�rsrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|�g�dSrr�rsrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|�i�dSrr�rsrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|�t��dSr)r�rfrsrrr�load_empty_set�sz_Unpickler.load_empty_setcCs|��}|�t|��dSr)r�r�rkr�rrr�load_frozenset�sz_Unpickler.load_frozensetcCs|��}|�|�dSr)r�r�r�rrr�	load_list�sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|�|d�qS)r�r)rkr��r�rr�
<dictcomp>�s�z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r��ranger}r�)r"�drr�r�	load_dict�s

�z_Unpickler.load_dictc
Cs�|st|t�rt|d�rjz||�}Wqttk
rf}z$td|jt|�ft��d��W5d}~XYqtXn
|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_inforr�)r"�klassrr �errrrr�_instantiate�s��
�
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r��
find_classr�r��r"r�r�r�rrr�	load_inst�sz_Unpickler.load_instcCs"|��}|�d�}|�||�dSr�)r�r�r�)r"rrrrr�load_obj�s
z_Unpickler.load_objcCs2|j��}|j��}|j|f|��}|�|�dSr�r�r�rr�)r"rrr�rrr�load_newobj�s

z_Unpickler.load_newobjcCs>|j��}|j��}|j��}|j|f|�|�}|�|�dSrr�)r"rrrr�rrr�load_newobj_ex�s



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�r?)r�r�r�r�r�rrr�load_global�sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tk	s,t|�tk	r4td��|�|�||��dS)NzSTACK_GLOBAL requires str)r�r�r�r�rr�r�)r"r�r�rrr�load_stack_global�s


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dSrV)r��
get_extension�r"rzrrr�	load_ext1sz_Unpickler.load_ext1cCs td|�d��\}|�|�dS)Nrr��rr�r�r�rrr�	load_ext2	sz_Unpickler.load_ext2cCs td|�d��\}|�|�dS)Nrrr�r�rrr�	load_ext4sz_Unpickler.load_ext4cCspg}t�||�}||k	r&|�|�dSt�|�}|sP|dkrDtd��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r�rrr�r�)r"rzZnilr�r�rrrr�s


z_Unpickler.get_extensioncCs�t�d||�|jdkrT|jrT||ftjkr@tj||f\}}n|tjkrTtj|}t|dd�|jdkr~ttj	||�dSt
tj	||�SdS)Nzpickle.find_classr�rrnr)r��auditr�r�ryZNAME_MAPPINGZIMPORT_MAPPINGrpr�r�r�)r"r�r�rrrr�#s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dSr��r�r�)r"r�rr
rrr�load_reduce1sz_Unpickler.load_reducecCs|jr|jd=n|��dSr�)r�r�rsrrr�load_pop8s
z_Unpickler.load_popcCs|��dSr)r�rsrrr�
load_pop_mark?sz_Unpickler.load_pop_markcCs|�|jd�dSr�)r�r�rsrrr�load_dupCsz_Unpickler.load_dupcCs(t|��dd��}|�|j|�dSr�)r�r�r�r�r�rrr�load_getGsz_Unpickler.load_getcCs"|�d�d}|�|j|�dSrV)r�r�r�r�rrr�load_bingetLsz_Unpickler.load_bingetcCs&td|�d��\}|�|j|�dS)Nr�r)rr�r�r�r�rrr�load_long_bingetQsz_Unpickler.load_long_bingetcCs8t|��dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�r�r�r�rrr�load_putVsz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�r�r�r�rrr�load_binput]sz_Unpickler.load_binputcCs6td|�d��\}|tkr"td��|jd|j|<dS)Nr�rznegative LONG_BINPUT argumentr�)rr�r	r�r�r�r�rrr�load_long_binputdsz_Unpickler.load_long_binputcCs|j}|jd|t|�<dSr�)r�r�r})r"r�rrr�load_memoizeksz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dSr�)r�r�r�)r"r�r rYrrr�load_appendpsz_Unpickler.load_appendcCsZ|��}|jd}z
|j}Wntk
r0YnX||�dS|j}|D]}||�qHdSr�)r�r��extendr�r�)r"r�Zlist_objr�r�rirrr�load_appendsws

z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dSr�r�)r"r�r r�r~rrr�load_setitem�s
z_Unpickler.load_setitemcCs@|��}|jd}tdt|�d�D]}||d|||<q"dS)Nr�rr�r�)r�r�r�r})r"r�r~r�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsD|��}|jd}t|t�r(|�|�n|j}|D]}||�q2dSr�)r�r�r�rf�update�add)r"r�Zset_objr�rirrr�
load_additems�s

z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}|�	�D]*\}}	t
|�tkr�|	|||�<qp|	||<qp|r�|�	�D]\}}	t|||	�q�dS)Nr��__setstate__r�)
r�r�r�r�r�r}�__dict__r��internr�r�r��setattr)
r"r�r�inst�setstateZ	slotstateZ	inst_dictr�rcrdrrr�
load_build�s(
z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dSr)r�r�r�rsrrr�	load_mark�sz_Unpickler.load_markcCs|j��}t|��dSr)r�r�rr!rrr�	load_stop�s
z_Unpickler.load_stop)�rrrr#rr�r�r�r�r�r�rr�r�r�r�r�rr�rr�rr�r!r�rr�rr�rr�r"r�rr�r r�r'r�r&r�r��STRINGr��	BINSTRINGr�r0r�rKr�rIr�rHr�r/r�r4r�r;r�r<r��SHORT_BINSTRINGr�r.r�rGr�rOr�rMr��TUPLE1r�rr��TUPLE3r�rSr�r^r�rgr�rlr�rTr�r_r�r��INSTr��OBJr�rr�rr�rxr�rwr�rsr�rtr�rur�r�r�rr�rr�rQr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rWr�r[r�rar�rbr�rhrrrrNrr�rrrrrps*�0				rr�cCst||||d��|�dS�Nr�)r�r)r�r�r�r�r�rrr�_dump�s
��rcCs*t��}t||||d��|�|��}|Sr
)rqrrr�r�getvalue)r�r�r�r�r��resrrr�_dumps�s��rr�r�r�cCst|||||d���S)N�r�r�r�r�)rr)r�r�r�r�r�rrr�_load�s�rcCs2t|t�rtd��t�|�}t|||||d���S)Nz%Can't load pickle from unicode stringr)r�r�r�rqrrrr)�sr�r�r�r�r�rrr�_loads�s

�r)	rr
rrrrrrrcCsddl}|��Sr�)�doctestZtestmod)rrrr�_test�srr�z$display contents of the pickle files)Zdescription�pickle_file�br�*zthe pickle file)r��nargs�helpz-tz--test�
store_truezrun self-test suite)�actionrz-vz)run verbosely; only affects self-test run)N)N)��typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrirqr-ry�__all__�_picklerr�r}rqr,r3Zbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer$rNr�rrQrr'r!rrr"rrr�r�rrrrrKrIrWrrxr_r^r[r�r�r
r�rTrSrr�r�r�rarOrMrbr&rrr�rrsrtrurrr	rrrr rPr0r.rGrHr/rgrhrlrrwr�rr4r;r<r��dirrnr�r�r�r�r�r�rrrrrrrrrrrrr�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsrZtestrZ
print_helpZpprintr�r�rrrr�<module>sf�

�

?;
^]��	0

����

__phello__.foo.cpython-38.pyc000064400000000201151450073350012031 0ustar00U

e5d@�@sdS)N�rrr�&/usr/lib64/python3.8/__phello__.foo.py�<module>�poplib.cpython-38.opt-2.pyc000064400000020522151450073350011425 0ustar00U

e5d�:�@shddlZddlZddlZddlZzddlZdZWnek
rHdZYnXddgZGdd�de�Z	dZ
dZd	Zd
Z
ee
ZdZGdd�d�Zer�Gd
d�de�Ze�d�edk�rdddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]BZe� e�\Z!Z"Z#ede�e"D]Z$ede$��q<ed��qe�%�dS)�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/poplib.pyrs�ni��
�
ic@seZdZdZeejfdd�Zdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd<dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Ze�d/�Zd0d1�Z d2d3�Z!d=d4d5�Z"d6d7�Z#d8d9�Z$d>d:d;�Z%dS)?rzUTF-8cCsP||_||_d|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCst�|j|jf|�S�N)�socketZcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlineps
z
POP3._putlinecCs.|jrtdt|��t||j�}|�|�dS)Nz*cmd*)rrr �bytes�encodingr$r"rrr�_putcmdxszPOP3._putcmdcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sHtd��t|�}|dd�tkrp|dd�|fS|dd�t	kr�|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrrr r!�CR)rr#�octetsrrr�_getline�s
z
POP3._getlinecCs:|��\}}|jdkr$tdt|��|�d�s6t|��|S)Nrz*resp*�+)r/rrr �
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsl|��}g}d}|��\}}|dkrb|�d�rB|d}|dd�}||}|�|�|��\}}q|||fS)Nr�.s..r)rr/r1�append)rr2�listr.r#r3rrr�_getlongresp�s

zPOP3._getlongrespcCs|�|�|��Sr)r'rr"rrr�	_shortcmd�s
zPOP3._shortcmdcCs|�|�|��Sr)r'r7r"rrr�_longcmd�s
z
POP3._longcmdcCs|jSr)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|�d|�S)NzUSER %s�r8�r�userrrrr@�sz	POP3.usercCs|�d|�S)NzPASS %sr>)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jr&tdt|��t|d�}t|d�}||fS)NZSTATz*stat*r�)r8�splitrrr �int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dk	r|�d|�S|�d�S)NzLIST %sZLIST�r8r9�r�whichrrrr6�s	z	POP3.listcCs|�d|�S)NzRETR %s�r9rGrrr�retr�sz	POP3.retrcCs|�d|�S)NzDELE %sr>rGrrr�dele�sz	POP3.delecCs
|�d�S)NZNOOPr>r:rrr�noopsz	POP3.noopcCs
|�d�S)NZRSETr>r:rrr�rsetsz	POP3.rsetcCs|�d�}|��|S)NZQUIT)r8�close)rr2rrr�quits
z	POP3.quitcCs�z |j	}d|_	|dk	r|��W5|j}d|_|dk	r�zVz|�tj�Wn@tk
r�}z"|jtjkrxt|dd�dkrx�W5d}~XYnXW5|��XXdS)NZwinerrorri&')
rrNZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattrr)rr�excrrrrrNs �z
POP3.closecCs|�d|�S)NzRPOP %sr>r?rrr�rpop5sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|s&td��ddl}|�d�|}|�|��	�}|�
d||f�S)Nz!-ERR APOP not supported by serverrrz
APOP %s %s)r%r&�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr8)rr@ZpasswordZsecret�mrWZdigestrrr�apop<sz	POP3.apopcCs|�d||f�S)Nz	TOP %s %srI)rrHZhowmuchrrr�topQszPOP3.topcCs |dk	r|�d|�S|�d�S)NzUIDL %sZUIDLrFrGrrr�uidlZsz	POP3.uidlcCs
|�d�S)NZUTF8r>r:rrr�utf8fsz	POP3.utf8c	
Cspdd�}i}z4|�d�}|d}|D]}||�\}}|||<q$Wn*tk
rj}ztd��W5d}~XYnX|S)NcSs"|�d���}|d|dd�fS)N�asciirr)�decoderC)r#Zlstrrr�	_parsecapyszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by server)r9r)	rr`�capsr2ZrawcapsZcaplineZcapnmZcapargsZ_errrrr�capals

z	POP3.capacCsxtstd��|jrtd��|��}d|kr2td��|dkrBt��}|�d�}|j|j|j	d�|_|j�
d�|_d|_|S)Nz-ERR TLS support missing�$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by server�Zserver_hostnamerT)�HAVE_SSLrrrb�ssl�_create_stdlib_contextr8�wrap_socketrr
rr)r�contextrar2rrr�stls�s 
�z	POP3.stls)N)N)N)&rrrr&�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr$r'r/rr7r8r9r;r=r@rArEr6rJrKrLrMrOrNrT�re�compilerUrZr[r\r]rbrjrrrrr3s@-�





	
c@s4eZdZeddejdfdd�Zdd�Zddd�ZdS)	�POP3_SSLNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrB)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrqrprfrgrirr)rr
rrqrprrirsrrrr�s$��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrd)rrrirhr
)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��dS)Nrc)r)rrqrprirrrrj�sz
POP3_SSL.stls)NNN)	rrr�
POP3_SSL_PORTrrlrrrjrrrrro�s�
ro�__main__rrB�zMessage %d:z   z-----------------------)&rQrmrrrfre�ImportError�__all__�	Exceptionrrkrvr-ZLFr!r+rror5r�argv�arr;r@rAr6rEZnumMsgsZ	totalSize�range�irJ�header�msgr.r#rOrrrr�<module>sJ
n0

_collections_abc.cpython-38.opt-1.pyc000064400000070107151450073350013425 0ustar00U

e5d�e�@stdZddlmZmZddlZdddddd	d
ddd
dddddddddddddddgZdZeed��Z	eee
���Zeei����Z
eei����Zeei����Zeeg��Zeeeg���Zeeed���Zeeedd >���Zeee���Zeed!��Zeed"��Zeee���Zei���Zei���Zei���Z eej!�Z"ed#d$���Z#d%d&�Z$e$�Z$ee$�Z%e$�&�[$d'd(�Z'e'�Z'ee'�Z(['d)d*�Z)Gd+d	�d	ed,�Z*Gd-d�ded,�Z+Gd.d�de+�Z,e,�-e%�Gd/d�ded,�Z.Gd0d�de.�Z/Gd1d�de/�Z0e0�-e(�Gd2d
�d
ed,�Z1Gd3d�de1�Z2e2�-e	�e2�-e�e2�-e
�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�Gd4d
�d
e1�Z3Gd5d�de2�Z4e4�-e#�Gd6d�ded,�Z5Gd7d�ded,�Z6Gd8d�de5e1e6�Z7Gd9d�ded,�Z8Gd:d�de7�Z9e9�-e:�Gd;d�de9�Z;e;�-e�Gd<d�de7�Z<e<�-e"�Gd=d�de5�Z=Gd>d�de=e9�Z>e>�-e�Gd?d�de=e9�Z?e?�-e �Gd@d�de=e7�Z@e@�-e�GdAd�de<�ZAeA�-eB�GdBd�de3e7�ZCeC�-eD�eC�-eE�eC�-e�eC�-eF�GdCd�deC�ZGeG�-eH�eG�-e
�GdDd�deC�ZIeI�-eJ�eI�-e
�dS)EzjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
�)�ABCMeta�abstractmethodN�	Awaitable�	Coroutine�
AsyncIterable�
AsyncIterator�AsyncGenerator�Hashable�Iterable�Iterator�	Generator�
Reversible�Sized�	Container�Callable�
Collection�Set�
MutableSet�Mapping�MutableMapping�MappingView�KeysView�	ItemsView�
ValuesView�Sequence�MutableSequence�
ByteStringzcollections.abc��i���ccsdVS�Nr r r r �(/usr/lib64/python3.8/_collections_abc.py�<lambda>8rr#c�sdSr!r r r r r"�_coro:rr$cCs
dVdSr!r r r r r"�_ag@rr%cGsN|j}|D]>}|D],}||jkr|j|dkr:tSq
qtSq
dS)NT)�__mro__�__dict__�NotImplemented)�C�methods�mro�method�Br r r"�_check_methodsHs

r.c@s(eZdZdZedd��Zedd��ZdS)r	r cCsdS�Nrr ��selfr r r"�__hash__XszHashable.__hash__cCs|tkrt|d�StS)Nr2)r	r.r(��clsr)r r r"�__subclasshook__\s
zHashable.__subclasshook__N)�__name__�
__module__�__qualname__�	__slots__rr2�classmethodr5r r r r"r	Ts

)�	metaclassc@s(eZdZdZedd��Zedd��ZdS)rr ccs
dVdSr!r r0r r r"�	__await__gszAwaitable.__await__cCs|tkrt|d�StS)Nr<)rr.r(r3r r r"r5ks
zAwaitable.__subclasshook__N)r6r7r8r9rr<r:r5r r r r"rcs

c@s>eZdZdZedd��Zeddd��Zdd�Zed	d
��Z	dS)rr cCst�dS)zcSend a value into the coroutine.
        Return next yielded value or raise StopIteration.
        N��
StopIteration�r1�valuer r r"�sendvszCoroutine.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        N��with_traceback�r1�typ�val�tbr r r"�throw}s
zCoroutine.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)�.Raise GeneratorExit inside coroutine.
        zcoroutine ignored GeneratorExitN�rH�
GeneratorExitr>�RuntimeErrorr0r r r"�close�s
zCoroutine.closecCs|tkrt|dddd�StS)Nr<rArHrM)rr.r(r3r r r"r5�szCoroutine.__subclasshook__)NN)
r6r7r8r9rrArHrMr:r5r r r r"rrs

c@s(eZdZdZedd��Zedd��ZdS)rr cCst�Sr!)rr0r r r"�	__aiter__�szAsyncIterable.__aiter__cCs|tkrt|d�StS)NrN)rr.r(r3r r r"r5�s
zAsyncIterable.__subclasshook__N)r6r7r8r9rrNr:r5r r r r"r�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr c�st�dS)z@Return the next item or raise StopAsyncIteration when exhausted.N��StopAsyncIterationr0r r r"�	__anext__�szAsyncIterator.__anext__cCs|Sr!r r0r r r"rN�szAsyncIterator.__aiter__cCs|tkrt|dd�StS)NrQrN)rr.r(r3r r r"r5�szAsyncIterator.__subclasshook__N)	r6r7r8r9rrQrNr:r5r r r r"r�s
c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr c�s|�d�IdHS)zpReturn the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        N)�asendr0r r r"rQ�szAsyncGenerator.__anext__c�st�dS)zuSend a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrOr?r r r"rR�szAsyncGenerator.asendNc�s4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zyRaise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrBrDr r r"�athrow�s
zAsyncGenerator.athrowc	�s:z|�t�IdHWnttfk
r,Yn
Xtd��dS)rINz,asynchronous generator ignored GeneratorExit)rSrKrPrLr0r r r"�aclose�s
zAsyncGenerator.aclosecCs|tkrt|ddddd�StS)NrNrQrRrSrT)rr.r(r3r r r"r5�s�zAsyncGenerator.__subclasshook__)NN)r6r7r8r9rQrrRrSrTr:r5r r r r"r�s

c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__iter__�szIterable.__iter__cCs|tkrt|d�StS)NrU)r
r.r(r3r r r"r5�s
zIterable.__subclasshook__N)r6r7r8r9rrUr:r5r r r r"r
�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr cCst�dS)zKReturn the next item from the iterator. When exhausted, raise StopIterationNr=r0r r r"�__next__szIterator.__next__cCs|Sr!r r0r r r"rUszIterator.__iter__cCs|tkrt|dd�StS)NrUrV)rr.r(r3r r r"r5szIterator.__subclasshook__N)	r6r7r8r9rrVrUr:r5r r r r"rs
c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__reversed__)szReversible.__reversed__cCs|tkrt|dd�StS)NrWrU)r
r.r(r3r r r"r5.szReversible.__subclasshook__N)r6r7r8r9rrWr:r5r r r r"r
%s

c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr cCs
|�d�S)z^Return the next item from the generator.
        When exhausted, raise StopIteration.
        N)rAr0r r r"rV9szGenerator.__next__cCst�dS)zcSend a value into the generator.
        Return next yielded value or raise StopIteration.
        Nr=r?r r r"rA?szGenerator.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the generator.
        Return next yielded value or raise StopIteration.
        NrBrDr r r"rHFs
zGenerator.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)z.Raise GeneratorExit inside generator.
        zgenerator ignored GeneratorExitNrJr0r r r"rMSs
zGenerator.closecCs|tkrt|ddddd�StS)NrUrVrArHrM)rr.r(r3r r r"r5]s�zGenerator.__subclasshook__)NN)r6r7r8r9rVrrArHrMr:r5r r r r"r5s

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdSr/r r0r r r"�__len__ksz
Sized.__len__cCs|tkrt|d�StS)NrX)rr.r(r3r r r"r5os
zSized.__subclasshook__N)r6r7r8r9rrXr:r5r r r r"rgs

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdS�NFr )r1�xr r r"�__contains__zszContainer.__contains__cCs|tkrt|d�StS)Nr[)rr.r(r3r r r"r5~s
zContainer.__subclasshook__N)r6r7r8r9rr[r:r5r r r r"rvs

c@seZdZdZedd��ZdS)rr cCs|tkrt|ddd�StS)NrXrUr[)rr.r(r3r r r"r5�szCollection.__subclasshook__N)r6r7r8r9r:r5r r r r"r�sc@s(eZdZdZedd��Zedd��ZdS)rr cOsdSrYr )r1�args�kwdsr r r"�__call__�szCallable.__call__cCs|tkrt|d�StS)Nr^)rr.r(r3r r r"r5�s
zCallable.__subclasshook__N)r6r7r8r9rr^r:r5r r r r"r�s

c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
d��Zdd�ZeZ
dd�Zdd�ZeZdd�Zdd�Zdd�ZeZdd�ZdS)raZA set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__ and __len__.

    To override the comparisons (presumably for speed, as the
    semantics are fixed), redefine __le__ and __ge__,
    then the other operations will automatically follow suit.
    r cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dS�NFT��
isinstancerr(�len�r1�other�elemr r r"�__le__�s
z
Set.__le__cCs(t|t�stSt|�t|�ko&|�|�Sr!�rarr(rbrf�r1rdr r r"�__lt__�s
z
Set.__lt__cCs(t|t�stSt|�t|�ko&|�|�Sr!)rarr(rb�__ge__rhr r r"�__gt__�s
z
Set.__gt__cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dSr_r`rcr r r"rj�s
z
Set.__ge__cCs(t|t�stSt|�t|�ko&|�|�Sr!rgrhr r r"�__eq__�s
z
Set.__eq__cCs||�S)z�Construct an instance of the class from any iterable input.

        Must override this method if the class constructor signature
        does not accept an iterable for an input.
        r )r4�itr r r"�_from_iterable�szSet._from_iterablecs&t|t�stS���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ��.0r@r0r r"�	<genexpr>�szSet.__and__.<locals>.<genexpr>�rar
r(rnrhr r0r"�__and__�s
zSet.__and__cCs|D]}||krdSqdS)z1Return True if two sets have a null intersection.FTr )r1rdr@r r r"�
isdisjoint�szSet.isdisjointcCs*t|t�stSdd�||fD�}|�|�S)Ncss|]}|D]
}|Vq
qdSr!r )rp�s�er r r"rq�szSet.__or__.<locals>.<genexpr>rr)r1rd�chainr r r"�__or__�s
z
Set.__or__cs:t�t�s"t�t�stS|����|��fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ro�rdr r"rq�s�zSet.__sub__.<locals>.<genexpr>�rarr
r(rnrhr ryr"�__sub__�s



zSet.__sub__cs:t|t�s"t|t�stS��|�}���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ror0r r"rq�s�zSet.__rsub__.<locals>.<genexpr>rzrhr r0r"�__rsub__�s



zSet.__rsub__cCs2t|t�s"t|t�stS|�|�}||||BSr!rzrhr r r"�__xor__s



zSet.__xor__cCs�tj}d|d}t|�}d|d}||M}|D],}t|�}|||d>AdAdN}||M}q2|dd}||M}||kr�||d8}|d	kr�d
}|S)a+Compute the hash value of a set.

        Note that we don't define __hash__: not all sets are hashable.
        But if you define a hashable set type, its __hash__ should
        call this function.

        This must be compatible __eq__.

        All sets ought to compare equal if they contain the same
        elements, regardless of how they are implemented, and
        regardless of the order of the elements; so there's not much
        freedom for __eq__ or __hash__.  We match the algorithm used
        by the built-in frozenset type.
        �riM��r�i�M[l�4~2i�
i��6���i��8#)�sys�maxsizerb�hash)r1�MAX�MASK�n�hrZ�hxr r r"�_hash	s 
z	Set._hashN)r6r7r8�__doc__r9rfrirkrjrlr:rnrs�__rand__rtrx�__ror__r{r|r}�__rxor__r�r r r r"r�s&



c@sdeZdZdZdZedd��Zedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)ra�A mutable set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__, __len__,
    add(), and discard().

    To override the comparisons (presumably for speed, as the
    semantics are fixed), all you have to do is redefine __le__ and
    then the other operations will automatically follow suit.
    r cCst�dS)zAdd an element.N��NotImplementedErrorr?r r r"�add:szMutableSet.addcCst�dS)z8Remove an element.  Do not raise an exception if absent.Nr�r?r r r"�discard?szMutableSet.discardcCs||krt|��|�|�dS)z5Remove an element. If not a member, raise a KeyError.N)�KeyErrorr�r?r r r"�removeDszMutableSet.removecCs>t|�}zt|�}Wntk
r.td�YnX|�|�|S)z2Return the popped value.  Raise KeyError if empty.N)�iter�nextr>r�r��r1rmr@r r r"�popJs
zMutableSet.popcCs(z|��qWntk
r"YnXdS)z6This is slow (creates N new iterators!) but effective.N)r�r�r0r r r"�clearTszMutableSet.clearcCs|D]}|�|�q|Sr!)r�r�r r r"�__ior__\szMutableSet.__ior__cCs||D]}|�|�q|Sr!)r�r�r r r"�__iand__aszMutableSet.__iand__cCsR||kr|��n<t|t�s&|�|�}|D]"}||krB|�|�q*|�|�q*|Sr!)r�rarrnr�r�r�r r r"�__ixor__fs


zMutableSet.__ixor__cCs*||kr|��n|D]}|�|�q|Sr!)r�r�r�r r r"�__isub__ss

zMutableSet.__isub__N)r6r7r8r�r9rr�r�r�r�r�r�r�r�r�r r r r"r,s



c@sReZdZdZedd��Zddd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdS)rr cCst�dSr!�r��r1�keyr r r"�__getitem__�szMapping.__getitem__NcCs(z
||WStk
r"|YSXdS)z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.Nr��r1r��defaultr r r"�get�s
zMapping.getcCs,z||Wntk
r"YdSXdSdSr_r�r�r r r"r[�s
zMapping.__contains__cCst|�S)z:D.keys() -> a set-like object providing a view on D's keys)rr0r r r"�keys�szMapping.keyscCst|�S)z<D.items() -> a set-like object providing a view on D's items)rr0r r r"�items�sz
Mapping.itemscCst|�S)z6D.values() -> an object providing a view on D's values)rr0r r r"�values�szMapping.valuescCs&t|t�stSt|���t|���kSr!)rarr(�dictr�rhr r r"rl�s
zMapping.__eq__)N)
r6r7r8r9rr�r�r[r�r�r�rlrWr r r r"r�s


c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��_mappingcCs
||_dSr!r�)r1�mappingr r r"�__init__�szMappingView.__init__cCs
t|j�Sr!)rbr�r0r r r"rX�szMappingView.__len__cCs
d�|�S)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr0r r r"�__repr__�szMappingView.__repr__N)r6r7r8r9r�rXr�r r r r"r�sc@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!��set�r1rmr r r"rn�szKeysView._from_iterablecCs
||jkSr!r�r�r r r"r[�szKeysView.__contains__ccs|jEdHdSr!r�r0r r r"rU�szKeysView.__iter__N�r6r7r8r9r:rnr[rUr r r r"r�s

c@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!r�r�r r r"rn�szItemsView._from_iterablecCsB|\}}z|j|}Wntk
r,YdSX||kp<||kSdSrY)r�r�)r1�itemr�r@�vr r r"r[�szItemsView.__contains__ccs |jD]}||j|fVqdSr!r�r�r r r"rU�s
zItemsView.__iter__Nr�r r r r"r�s

	c@s eZdZdZdd�Zdd�ZdS)rr cCs0|jD]$}|j|}||ks$||krdSqdS�NTFr�)r1r@r�r�r r r"r[�s


zValuesView.__contains__ccs|jD]}|j|VqdSr!r�r�r r r"rU�s
zValuesView.__iter__N)r6r7r8r9r[rUr r r r"r�sc@s^eZdZdZedd��Zedd��Ze�Zefdd�Z	dd	�Z
d
d�Zddd
�Zddd�Z
dS)rr cCst�dSr!r��r1r�r@r r r"�__setitem__szMutableMapping.__setitem__cCst�dSr!r�r�r r r"�__delitem__szMutableMapping.__delitem__cCs@z||}Wn$tk
r0||jkr(�|YSX||=|SdS)z�D.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.
        N)r��_MutableMapping__marker)r1r�r�r@r r r"r�s

zMutableMapping.popcCsBztt|��}Wntk
r*td�YnX||}||=||fS)z�D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        N)r�r�r>r�r�r r r"�popitem$szMutableMapping.popitemcCs(z|��qWntk
r"YnXdS)z,D.clear() -> None.  Remove all items from D.N)r�r�r0r r r"r�0szMutableMapping.clearcKs|t|t�r"|D]}||||<qn<t|d�rH|��D]}||||<q4n|D]\}}|||<qL|��D]\}}|||<qfdS)aK D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
            In either case, this is followed by: for k, v in F.items(): D[k] = v
        r�N)rar�hasattrr�r�)r1rdr]r�r@r r r"�update8s


zMutableMapping.updateNcCs,z
||WStk
r&|||<YnX|S)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in Dr�r�r r r"�
setdefaultJs

zMutableMapping.setdefault)r )N)r6r7r8r9rr�r��objectr�r�r�r�r�r�r r r r"r�s


c@sJeZdZdZdZedd��Zdd�Zdd�Zd	d
�Z	dd
d�Z
dd�ZdS)rz�All the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    r cCst�dSr!��
IndexError�r1�indexr r r"r�bszSequence.__getitem__ccs<d}z||}|V|d7}qWntk
r6YdSXdS)Nrrr�)r1�ir�r r r"rUfszSequence.__iter__cCs$|D]}||ks||krdSqdSr�r )r1r@r�r r r"r[pszSequence.__contains__ccs$ttt|���D]}||VqdSr!)�reversed�rangerb)r1r�r r r"rWvszSequence.__reversed__rNcCs�|dk	r"|dkr"tt|�|d�}|dk	r>|dkr>|t|�7}|}|dksR||kr�z"||}||ksl||krr|WSWntk
r�Yq�YnX|d7}qBt�dS)z�S.index(value, [start, [stop]]) -> integer -- return first index of value.
           Raises ValueError if the value is not present.

           Supporting start and stop arguments is optional, but
           recommended.
        Nrr)�maxrbr��
ValueError)r1r@�start�stopr�r�r r r"r�zs


zSequence.indexcst�fdd�|D��S)zBS.count(value) -> integer -- return number of occurrences of valuec3s"|]}|�ks|�krdVqdS)rNr )rpr��r@r r"rq�sz!Sequence.count.<locals>.<genexpr>)�sumr?r r�r"�count�szSequence.count)rN)r6r7r8r�r9rr�rUr[rWr�r�r r r r"rXs


c@seZdZdZdZdS)rzMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    r N)r6r7r8r�r9r r r r"r�sc@sneZdZdZedd��Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�ZdS)rr cCst�dSr!r��r1r�r@r r r"r��szMutableSequence.__setitem__cCst�dSr!r�r�r r r"r��szMutableSequence.__delitem__cCst�dS)z3S.insert(index, value) -- insert value before indexNr�r�r r r"�insert�szMutableSequence.insertcCs|�t|�|�dS)z:S.append(value) -- append value to the end of the sequenceN)r�rbr?r r r"�append�szMutableSequence.appendcCs(z|��qWntk
r"YnXdS)z,S.clear() -> None -- remove all items from SN)r�r�r0r r r"r��szMutableSequence.clearcCsHt|�}t|d�D].}|||d||||<|||d<qdS)z!S.reverse() -- reverse *IN PLACE*r~rN)rbr�)r1r�r�r r r"�reverse�szMutableSequence.reversecCs(||krt|�}|D]}|�|�qdS)zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)�listr�)r1r�r�r r r"�extend�szMutableSequence.extendr�cCs||}||=|S)z�S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r )r1r�r�r r r"r��szMutableSequence.popcCs||�|�=dS)zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r�r?r r r"r��szMutableSequence.removecCs|�|�|Sr!)r�)r1r�r r r"�__iadd__�s
zMutableSequence.__iadd__N)r�)r6r7r8r9rr�r�r�r�r�r�r�r�r�r�r r r r"r�s	



)Kr��abcrrr��__all__r6�typer��bytes_iterator�	bytearray�bytearray_iteratorr��dict_keyiteratorr��dict_valueiteratorr��dict_itemiterator�
list_iteratorr��list_reverseiteratorr��range_iterator�longrange_iteratorr��set_iterator�str_iterator�tuple_iterator�zip�zip_iterator�	dict_keys�dict_values�
dict_itemsr'�mappingproxy�	generatorr$�	coroutinerMr%�async_generatorr.r	rr�registerrrrr
rr
rrrrrr�	frozensetrrrrrrrr�r�tuple�str�
memoryviewr�bytesrr�r r r r"�<module>s��	
)
0













/



O
2



S
=



	

C
locale.cpython-38.pyc000064400000103603151450073350010441 0ustar00U

e5do1�M@s0dZddlZddlZddlZddlZddlZddlmZddl	Z	dddddd	d
ddd
dddddddddddddgZ
dd�Zdd�Zzddl
TWnLek
r�d Zd!Zd"ZdZd#Zd$Zd%Zd&ZeZd'd
�Z�d�d(d�ZYnXde�kr�eZde�kr�eZeZiZe	� e�d)d
��Zd*d+�Z!�d�d-d.�Z"d/d0�Z#e�$d1�Z%�d�d2d3�Z&�d�d4d�Z'�d�d5d�Z(�d�d7d�Z)d8d
�Zd9d:�Z*e+fd;d�Z,d<d�Z-d=d>�Z.eZ/d?d@�Z0dAdB�Z1dCd�Z2dDdE�Z3dFdG�Z4�d�dId�Z5efdJd�Z6�d�dKd�ZefdLd	�Z7ej8�9dM��r�d�dNd�Z:nRze;Wn<e<k
�rPe=edO��r@�d�dPd�Z:n�d�dQd�Z:YnX�d�dRd�Z:dSdSdTdUdUdVdWdXdYdZdTd[d\d]dTdTdTd^d_d`dad]dbd[dcddd\dedfdgdhdUdidjdVdkdldmdndodpdXdYdZdq�,Z>e?e>�@��D]"\ZAZBeA�Cdrds�ZAe>�DeAeB��q�dtdtdtdudvdwdxdxdydzd{d{d|d}d~ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dSd�dSdSd|d�dSdSd�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d|d�d|dSd|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��dd͐d�d�d�d�d�d�d�d�d�d�d�d�d	�d
�d
�d�dd��d
�d�d�d�d�d�d
�d�d�d�d�d�d�d�d�d�dd�d�d�d��d�d�d�ddΐd�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d��d�d �d!�d!�d!�d"�d#�d$�d%�d&�d'�d'�d(�d)�d'�d'�d&�d&d|d�d|d�d|d�d*�d+�d*�d*�d,�d,�d,�d�d�d-�d.�d.�d.�d/�d/�d.�d.�d.�d.�d.�d0�d0�d0�d1�d0�d2�d3�d4�d4�d5�d6�d6�d7�d7�d7�d8�d7�d7�d9�d9�d:�d;�d<�d<�d=�d=�d>�d?�d@�dA�dB�dC�dD�dE�dE�dF�dF�dE�dC�dC�dG�dG�dH�dI�dJ�dJ�dK�dL�dM�dN�dO�dO�dP�dQ�dR�dR�dS�dS�dT�dU�dV�dV�dW�dW�dX�dX�dY�dZd�d��d[�d\�d]�d^�d_�d`dȐdad�dȐdb�db�dc�dd�dc�dc�dc�dc�de�de�df�df�dd�dd�db�dg�dg�dh�di�dj�dj�dk�dl�dl�dm�dn�do�dp�dq�dr�dq�ds�ds�dt�dt�dt�du�dvdSdS�dw�dw�dx�du�dv�du�dy�dz�d{�d{�d{�d|�d|�d}�d{�d~�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��dddÐdÐdÐdÐdĐdĐdŐdŐdƐdǐdȐdɐdɐdʐdʐdːd̐d�d��dΐd�d��dАdАdѐdҐd�d�d��dӐdӐdԐ�LZE�dՐd֐dאdؐdِdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�df�dg�dh�di�dj�dk�dl�dm�dn�dm�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���ZF�d��d��ZGzeWne<k
�
r�YnXe
�H�d��eI�d�k�r,eJ�d��eJ�eG�eJ�eJ�d��eJ�e.�dS(�a�Locale support module.

The module provides low-level access to the C lib's locale APIs and adds high
level number formatting APIs as well as a locale aliasing engine to complement
these.

The aliasing engine includes support for many commonly used locale names and
maps them to values suitable for passing to the C lib's setlocale() function. It
also includes default encodings for all supported locale names.

�N)�str�	getlocale�getdefaultlocale�getpreferredencoding�Error�	setlocale�resetlocale�
localeconv�strcoll�strxfrmr�atof�atoi�format�
format_string�currency�	normalize�LC_CTYPE�
LC_COLLATE�LC_TIME�LC_MONETARY�
LC_NUMERIC�LC_ALL�CHAR_MAXcCs||k||kS)zZ strcoll(string,string) -> int.
        Compares two strings according to the locale.
    �)�a�brr�/usr/lib64/python3.8/locale.py�_strcoll!srcCs|S)z\ strxfrm(string) -> string.
        Returns a string that behaves for cmp locale-aware.
    r)�srrr�_strxfrm'sr)�*�������cCs,dgddddgddddddddddddd�S)zd localeconv() -> dict.
            Returns numeric and monetary locale-specific parameters.
        r!��.)�grouping�currency_symbol�n_sign_posn�
p_cs_precedes�
n_cs_precedes�mon_grouping�n_sep_by_space�
decimal_point�
negative_sign�
positive_sign�p_sep_by_space�int_curr_symbol�p_sign_posn�
thousands_sep�mon_thousands_sep�frac_digits�mon_decimal_point�int_frac_digitsrrrrrr	?s&�cCs|dkrtd��dS)zd setlocale(integer,string=None) -> string.
            Activates/queries locale processing.
        )Nr(�Cz*_locale emulation only supports "C" localer<)r)�category�valuerrrrWscCst�}tr|�t�|S)N)�_localeconv�_override_localeconv�update)�drrrr	ls
ccsJd}|D]<}|tkrdS|dkr:|dkr2td��|Vq2|V|}qdS)Nrzinvalid grouping)r�
ValueError)r*Z
last_interval�intervalrrr�_grouping_intervalszsrEFc
Cs�t�}||rdpd}||r dp"d}|s2|dfS|ddkr\|��}|t|�d�}|}nd}d}g}t|�D]B}	|r�|dd	kr�|}d}q�|�||	d��|d|	�}qp|r�|�|�|��||�|�|t|�t|�d
fS)Nr8r7r/r*r���� r(�
0123456789r&)r	�rstrip�lenrE�append�reverse�join)
r�monetary�convr7r*�strippedZright_spacesZleft_spaces�groupsrDrrr�_group�s2
�rRcCsdd}|r&||dkr&|d7}|d8}qt|�d}|rT||dkrT|d8}|d8}q2|||d�S)NrrGr&)rJ)rZamountZlposZrposrrr�_strip_padding�s

rSzG%(?:\((?P<key>.*?)\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]c	Gs�|r||f|}n||}|ddkr~d}|�d�}|rRt|d|d�\|d<}t�|r^dp`d}|�|�}|r�t||�}n2|ddkr�d}|r�t||d�\}}|r�t||�}|S)	NrFZeEfFgGrr)�rNr:r1Zdiu)�splitrRr	rMrS)	�percentr>r*rN�
additionalZ	formattedZseps�partsr1rrr�_format�s*
�

rYc
	Cs
tt�|��}t�d|�}t|tj�rjg}|D]8}|��ddkrN|�d�q.|�t	|��|||��q.n�t|t
�sz|f}g}d}|D]r}|��ddkr�|�d�q�|�d��d�}	|�t	|��||||f||d|d|	����|d|	7}q�t
|�}||S)aFormats a string in the same way that the % formatting would use,
    but takes the current locale into account.

    Grouping is applied if the third parameter is true.
    Conversion uses monetary thousands separator and grouping strings if
    forth parameter monetary is true.z%srF�%rZ	modifiersr r&)�list�_percent_re�finditer�sub�
isinstance�_collections_abc�Mapping�grouprKrY�tuple�count)
�f�valr*rNZpercentsZnew_fZnew_valZperc�iZ	starcountrrrr�s4
��cGs^ddl}|jdtdd�t�|�}|r:t|���t|�krJtdt|���t	||||f|��S)z&Deprecated, use format_string instead.rNz`This method will be removed in a future version of Python. Use 'locale.format_string()' instead.r')�
stacklevelzHformat() must be given exactly one %%char format specifier, %s not valid)
�warnings�warn�DeprecationWarningr\�matchrJrbrC�reprrY)rVr>r*rNrWrirlrrrr�s�
�TcCsft�}||rdpd}|dkr&td��td|t|�|dd�}d|d	}|r�||rXd
pZd}||dkrld
pnd}||dkr�dp�d}	|r�||	r�dp�d|}n||	r�dp�d|}||dkr�dp�d}
||dkr�dp�d}|
dkr�d|d}n`|
dk�r||}nL|
dk�r||}n8|
dk�r2|�d|�}n |
dk�rJ|�d	|�}n||}|�dd��d	d�S)zIFormats val according to the currency settings
    in the current locale.r;r9r!z9Currency formatting is not possible using the 'C' locale.z%%.%ifTrT�<�>r5r+rr.r-r0r4rGr(r,r6r2r3�(�)r&r'r#r%)r	rCrY�abs�replace)rfZsymbolr*Z
internationalrOZdigitsrZsmbZprecedesZ	separatedZsign_posZsignrrrrs6





cCs
td|�S)z8Convert float to string, taking the locale into account.z%.12g)rY)rfrrrr0scCs:t�}|d}|r|�|d�}|d}|r6|�|d�}|S)zHParses a string as a normalized number according to the locale settings.r7r(r1r))r	rs)�stringrO�tsZddrrr�
delocalize4srvcCs|t|��S)z<Parses a string as a float according to the locale settings.)rv)rt�funcrrrrDscCstt|��S)zAConverts a string to an integer according to the locale settings.)�intrv)rtrrrr
HscCsBttd�tddd�}t|dt|��td�}t|dt|��dS)Nr(z%di�[r&�isg��Q�	@)rrr�printr
rr)�s1rrr�_testLs

r|cCs�d|kr|d|�d��}n|}t�|�}tjj�|��|�}|}|��}|tkr\t|}n(|�dd�}|�dd�}|tkr�t|}|d|S)Nr)�_r(�-)�index�	encodings�normalize_encoding�aliases�get�lower�locale_encoding_aliasrs)�code�encoding�langname�
norm_encodingrrr�_replace_encoding^s 
�
r�cCsR|dkrFd|kr|dS|�d�\}}}|dkr4|S|dkrFt|d�S|d|S)N�euror)z.ISO8859-15)�
ISO8859-15�UTF-8�	ISO8859-1r��@)�	partitionr�)r��modifierr}r�rrr�_append_modifierus
r�c	Cs�|��}d|kr|�dd�}d|kr6|�dd�\}}nd}d|krZ|�d�dd�\}}n|}d}|}|r�|�dd�}|�d	d�}|d|7}|}|r�|d|7}t�|d�}|dk	r�|S|�rt�|d�}|dk	�rd|kr�t||�S|�dd�d��|k�r|S|�r�|}|�r"|d|7}t�|d�}|dk	�rnd|k�rLt||�S|�dd�\}}t||�d|S|�r�t�|d�}|dk	�r�d|k�r�t||�}t||�S|�dd�\}}|��|k�r�t||�d|S|S)
a� Returns a normalized locale code for the given locale
        name.

        The returned locale code is formatted for use with
        setlocale().

        If normalization fails, the original name is returned
        unchanged.

        If the given encoding is not known, the function defaults to
        the default encoding for the locale code just like setlocale()
        does.

    �:r)r�r&r(Nr'r~r})r�rsrU�locale_aliasr�r�r�)	�
localenamer�r�r�r�Zlang_encr�Zlookup_nameZdefmodrrrr�s`








cCs~t|�}d|kr8|�dd�\}}|dkr8d|kr8|dfSd|krVt|�d�dd��S|dkrbd	S|d
krndStd|��dS)
a� Parses the locale code for localename and returns the
        result as tuple (language code, encoding).

        The localename is normalized and passed through the locale
        alias engine. A ValueError is raised in case the locale name
        cannot be parsed.

        The language code corresponds to RFC 1766.  code and encoding
        can be None in case the values cannot be determined or are
        unknown to this implementation.

    r�r&r�r)�iso-8859-15Nr'r<)NNr��Nr�zunknown locale: %s)rrUrcrC)r�r�r�rrr�_parse_localename�sr�c	Cs\z4|\}}|dkrd}|dkr$|WS|d|WSWn"ttfk
rVtd�d�YnXdS)z� Builds a locale code from the given tuple (language code,
        encoding).

        No aliasing or normalizing takes place.

    Nr<r)zXLocale must be None, a string, or an iterable of two strings -- language code, encoding.)�	TypeErrorrC)ZlocaletupleZlanguager�rrr�_build_localename�s�r��rrZLANG�LANGUAGEc	Cs�zddl}|��\}}Wnttfk
r0Yn8Xtjdkr`|r`|dd�dkr`t�t|d��}||fSddl	}|j
j}|D],}||d�}|r||dkr�|�d�d}q�q|d}t|�S)	a� Tries to determine the default locale settings and returns
        them as tuple (language code, encoding).

        According to POSIX, a program which has not called
        setlocale(LC_ALL, "") runs using the portable 'C' locale.
        Calling setlocale(LC_ALL, "") lets it use the default locale as
        defined by the LANG variable. Since we don't want to interfere
        with the current locale setting we thus emulate the behavior
        in the way described above.

        To maintain compatibility with other platforms, not only the
        LANG variable is tested, but a list of variables given as
        envvars parameter. The first found to be defined will be
        used. envvars defaults to the search path used in GNU gettext;
        it must always contain the variable name 'LANG'.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    rNZwin32r'Z0xr�r�r<)
�_localeZ_getdefaultlocale�ImportError�AttributeError�sys�platform�windows_localer�rx�os�environrUr�)Zenvvarsr�r�r�r��lookupZvariabler�rrrr
s$
cCs(t|�}|tkr d|kr td��t|�S)ap Returns the current setting for the given locale category as
        tuple (language code, encoding).

        category may be one of the LC_* value except LC_ALL. It
        defaults to LC_CTYPE.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    �;z category LC_ALL is not supported)�
_setlocalerr�r�)r=r�rrrr?s
cCs$|rt|t�stt|��}t||�S)a^ Set the locale for the given category.  The locale can be
        a string, an iterable of two strings (language code and encoding),
        or None.

        Iterables are converted to strings using the locale aliasing
        engine.  Locale strings are passed directly to the C lib.

        category may be given as one of the LC_* values.

    )r_�_builtin_strrr�r�)r=ZlocalerrrrQscCst|tt���dS)z� Sets the locale for category to the default setting.

        The default setting is determined by calling
        getdefaultlocale(). category defaults to LC_ALL.

    N)r�r�r)r=rrrrbs�wincCstjjrdSddl}|�d�S)z1Return the charset that the user is likely using.r�rNF)r��flags�	utf8_mode�_bootlocaler)�do_setlocaler�rrrrnsZgetandroidapilevelcCsdSr�r)r�rrrr|scCs&tjjrdSt�d}|dkr"d}|S)zfReturn the charset that the user is likely using,
                by looking at environment variables.r�r&N�ascii)r�r�r�r)r��resrrrr�s
cCs`tjjrdSddl}|rDtt�}zttd�Wntk
rBYnX|�d�}|r\tt|�|S)zdReturn the charset that the user is likely using,
            according to the system configuration.r�rNr(F)r�r�r�r�rrrr)r�r�Zoldloc�resultrrrr�s

r<r�ZJIS7ZeucJPzKOI8-CZCP1251ZCP1255ZCP1256z	ISO8859-2z	ISO8859-5r�z
ISO8859-10z
ISO8859-11z
ISO8859-13z
ISO8859-14z
ISO8859-16z	ISO8859-3z	ISO8859-4z	ISO8859-6z	ISO8859-7z	ISO8859-8z	ISO8859-9ZSJISZTACTISZeucKRr�zKOI8-RzKOI8-TzKOI8-UZRK1048),�437�c�enZjisZjis7ZajecZkoi8cZmicrosoftcp1251Zmicrosoftcp1255Zmicrosoftcp1256Z88591Z88592Z88595Z885915r��latin_1�	iso8859_1�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�
iso2022_jp�	shift_jis�tactis�euc_jp�euc_kr�utf_8�koi8_rZkoi8_tZkoi8_u�kz1048�cp1251�cp1255�cp1256r}r(zaz_AZ.KOI8-Czaa_DJ.ISO8859-1zaa_ER.UTF-8zaa_ET.UTF-8zaf_ZA.ISO8859-1zagr_PE.UTF-8zak_GH.UTF-8zam_ET.UTF-8zen_US.ISO8859-1zan_ES.ISO8859-15zanp_IN.UTF-8zar_AA.ISO8859-6zar_AE.ISO8859-6zar_BH.ISO8859-6zar_DZ.ISO8859-6zar_EG.ISO8859-6zar_IN.UTF-8zar_IQ.ISO8859-6zar_JO.ISO8859-6zar_KW.ISO8859-6zar_LB.ISO8859-6zar_LY.ISO8859-6zar_MA.ISO8859-6zar_OM.ISO8859-6zar_QA.ISO8859-6zar_SA.ISO8859-6zar_SD.ISO8859-6zar_SS.UTF-8zar_SY.ISO8859-6zar_TN.ISO8859-6zar_YE.ISO8859-6zas_IN.UTF-8zast_ES.ISO8859-15zayc_PE.UTF-8zaz_AZ.ISO8859-9Ezaz_IR.UTF-8zbe_BY.CP1251zbe_BY.UTF-8@latinzbg_BG.UTF-8zbem_ZM.UTF-8zber_DZ.UTF-8zber_MA.UTF-8zbg_BG.CP1251zbhb_IN.UTF-8zbho_IN.UTF-8zbho_NP.UTF-8zbi_VU.UTF-8zbn_BD.UTF-8zbn_IN.UTF-8zbo_CN.UTF-8zbo_IN.UTF-8znb_NO.ISO8859-1zbr_FR.ISO8859-1zbrx_IN.UTF-8zbs_BA.ISO8859-2zbyn_ER.UTF-8zfr_CA.ISO8859-1zen_US.UTF-8zca_ES.ISO8859-1zca_AD.ISO8859-1zca_ES.UTF-8@valenciazca_FR.ISO8859-1zca_IT.ISO8859-1zce_RU.UTF-8zzh_CN.eucCNzzh_TW.eucTWzchr_US.UTF-8zckb_IQ.UTF-8zcmn_TW.UTF-8zcrh_UA.UTF-8zhr_HR.ISO8859-2zcs_CZ.ISO8859-2zcsb_PL.UTF-8zcv_RU.UTF-8zcy_GB.ISO8859-1zda_DK.ISO8859-1zde_DE.ISO8859-1zde_AT.ISO8859-1zde_BE.ISO8859-1zde_CH.ISO8859-1zde_IT.ISO8859-1zde_LI.UTF-8zde_LU.ISO8859-1zdoi_IN.UTF-8znl_NL.ISO8859-1znl_BE.ISO8859-1zdv_MV.UTF-8zdz_BT.UTF-8zee_EE.ISO8859-4zet_EE.ISO8859-1zel_GR.ISO8859-7zel_CY.ISO8859-7zel_GR.ISO8859-15zen_AG.UTF-8zen_AU.ISO8859-1zen_BE.ISO8859-1zen_BW.ISO8859-1zen_CA.ISO8859-1zen_DK.ISO8859-1zen_DL.UTF-8zen_GB.ISO8859-1zen_HK.ISO8859-1zen_IE.ISO8859-1zen_IL.UTF-8zen_IN.ISO8859-1zen_NG.UTF-8zen_NZ.ISO8859-1zen_PH.ISO8859-1zen_SC.UTF-8zen_SG.ISO8859-1zen_US.ISO8859-15zen_ZA.ISO8859-1zen_ZM.UTF-8zen_ZW.ISO8859-1zen_ZS.UTF-8zen_EN.ISO8859-1zeo_XX.ISO8859-3zeo.UTF-8zeo_EO.ISO8859-3zeo_US.UTF-8zes_ES.ISO8859-1zes_AR.ISO8859-1zes_BO.ISO8859-1zes_CL.ISO8859-1zes_CO.ISO8859-1zes_CR.ISO8859-1zes_CU.UTF-8zes_DO.ISO8859-1zes_EC.ISO8859-1zes_GT.ISO8859-1zes_HN.ISO8859-1zes_MX.ISO8859-1zes_NI.ISO8859-1zes_PA.ISO8859-1zes_PE.ISO8859-1zes_PR.ISO8859-1zes_PY.ISO8859-1zes_SV.ISO8859-1zes_US.ISO8859-1zes_UY.ISO8859-1zes_VE.ISO8859-1zet_EE.ISO8859-15zeu_ES.ISO8859-1zeu_FR.ISO8859-1zfa_IR.UTF-8zfa_IR.ISIRI-3342zff_SN.UTF-8zfi_FI.ISO8859-15zfil_PH.UTF-8zfi_FI.ISO8859-1zfo_FO.ISO8859-1zfr_FR.ISO8859-1zfr_BE.ISO8859-1zfr_CH.ISO8859-1zfr_LU.ISO8859-1zfur_IT.UTF-8zfy_DE.UTF-8zfy_NL.UTF-8zga_IE.ISO8859-1zgl_ES.ISO8859-1zgd_GB.ISO8859-1zgez_ER.UTF-8zgez_ET.UTF-8zgu_IN.UTF-8zgv_GB.ISO8859-1zha_NG.UTF-8zhak_TW.UTF-8zhe_IL.ISO8859-8zhi_IN.ISCII-DEVzhif_FJ.UTF-8zhne_IN.UTF-8zhsb_DE.ISO8859-2zht_HT.UTF-8zhu_HU.ISO8859-2zhy_AM.UTF-8zhy_AM.ARMSCII_8zia.UTF-8zia_FR.UTF-8zis_IS.ISO8859-1zid_ID.ISO8859-1zig_NG.UTF-8zik_CA.UTF-8zit_IT.ISO8859-1zit_CH.ISO8859-1ziu_CA.NUNACOM-8ziw_IL.UTF-8zja_JP.eucJPz
ja_JP.SJISzka_GE.GEORGIAN-ACADEMYzka_GE.GEORGIAN-PSzkab_DZ.UTF-8z
kk_KZ.ptcp154zkl_GL.ISO8859-1zkm_KH.UTF-8zkn_IN.UTF-8zko_KR.eucKRzkok_IN.UTF-8zks_IN.UTF-8zks_IN.UTF-8@devanagarizku_TR.ISO8859-9zkw_GB.ISO8859-1zky_KG.UTF-8zlb_LU.UTF-8zlg_UG.ISO8859-10zli_BE.UTF-8zli_NL.UTF-8zlij_IT.UTF-8zlt_LT.ISO8859-13zln_CD.UTF-8zlo_LA.MULELAO-1zlo_LA.IBM-CP1133zlv_LV.ISO8859-13zlzh_TW.UTF-8zmag_IN.UTF-8zmai_IN.UTF-8zmai_NP.UTF-8zmfe_MU.UTF-8zmg_MG.ISO8859-15zmhr_RU.UTF-8zmi_NZ.ISO8859-1zmiq_NI.UTF-8zmjw_IN.UTF-8zmk_MK.ISO8859-5zml_IN.UTF-8zmn_MN.UTF-8zmni_IN.UTF-8zmr_IN.UTF-8zms_MY.ISO8859-1zmt_MT.ISO8859-3zmy_MM.UTF-8znan_TW.UTF-8znds_DE.UTF-8znds_NL.UTF-8zne_NP.UTF-8znhn_MX.UTF-8zniu_NU.UTF-8zniu_NZ.UTF-8znl_AW.UTF-8znn_NO.ISO8859-1zno_NO.ISO8859-1zny_NO.ISO8859-1znr_ZA.ISO8859-1znso_ZA.ISO8859-15zoc_FR.ISO8859-1zom_ET.UTF-8zom_KE.ISO8859-1zor_IN.UTF-8zos_RU.UTF-8zpa_IN.UTF-8zpa_PK.UTF-8zpap_AN.UTF-8zpap_AW.UTF-8zpap_CW.UTF-8zpd_US.ISO8859-1zpd_DE.ISO8859-1zph_PH.ISO8859-1zpl_PL.ISO8859-2zpt_PT.ISO8859-1zpt_BR.ISO8859-1zpp_AN.ISO8859-1zps_AF.UTF-8zquz_PE.UTF-8zraj_IN.UTF-8zro_RO.ISO8859-2zru_RU.UTF-8zru_UA.KOI8-Uzru_RU.KOI8-Rzrw_RW.ISO8859-1zsa_IN.UTF-8zsat_IN.UTF-8zsc_IT.UTF-8zsd_IN.UTF-8zsd_IN.UTF-8@devanagarizsd_PK.UTF-8zse_NO.UTF-8zsr_RS.UTF-8@latinzsgs_LT.UTF-8zsr_CS.ISO8859-2zsh_HR.ISO8859-2zshn_MM.UTF-8zshs_CA.UTF-8zsi_LK.UTF-8zsid_ET.UTF-8zsk_SK.ISO8859-2zsl_SI.ISO8859-2zsl_CS.ISO8859-2zsm_WS.UTF-8zso_DJ.ISO8859-1zso_ET.UTF-8zso_KE.ISO8859-1zso_SO.ISO8859-1zsr_CS.ISO8859-5zsq_AL.ISO8859-2zsq_MK.UTF-8zsr_RS.UTF-8zsr_CS.UTF-8@latinzsr_CS.UTF-8zsr_ME.UTF-8zsr_CS.CP1251zss_ZA.ISO8859-1zst_ZA.ISO8859-1zsv_SE.ISO8859-1zsv_FI.ISO8859-1zsw_KE.UTF-8zsw_TZ.UTF-8zszl_PL.UTF-8z
ta_IN.TSCII-0zta_LK.UTF-8ztcy_IN.UTF-8zte_IN.UTF-8ztg_TJ.KOI8-Czth_TH.ISO8859-11zth_TH.TIS620zthe_NP.UTF-8zti_ER.UTF-8zti_ET.UTF-8ztig_ER.UTF-8ztk_TM.UTF-8ztl_PH.ISO8859-1ztn_ZA.ISO8859-15zto_TO.UTF-8ztpi_PG.UTF-8ztr_TR.ISO8859-9ztr_CY.ISO8859-9zts_ZA.ISO8859-1ztt_RU.TATAR-CYRztt_RU.UTF-8@iqtelifzug_CN.UTF-8zuk_UA.KOI8-Uz	en_US.utfzunm_US.UTF-8zur_PK.CP1256zur_IN.UTF-8zuz_UZ.UTF-8zve_ZA.UTF-8z
vi_VN.TCVNzvi_VN.VISCIIzwa_BE.ISO8859-1zwae_CH.UTF-8zwal_ET.UTF-8zwo_SN.UTF-8zxh_ZA.ISO8859-1zyi_US.CP1255zyo_NG.UTF-8zyue_HK.UTF-8zyuw_PG.UTF-8zzh_CN.gb2312z
zh_TW.big5zzh_HK.big5hkscszzh_SG.GB2312z	zh_SG.GBKzzu_ZA.ISO8859-1(LZa3Za3_azz
a3_az.koicZaa_djZaa_erZaa_etZafZaf_zaZagr_peZak_ghZamZam_etZamericanZan_esZanp_inZarZar_aaZar_aeZar_bhZar_dzZar_egZar_inZar_iqZar_joZar_kwZar_lbZar_lyZar_maZar_omZar_qaZar_saZar_sdZar_ssZar_syZar_tnZar_ye�arabic�asZas_inZast_esZayc_peZazZaz_azzaz_az.iso88599eZaz_irZbezbe@latinz
be_bg.utf8Zbe_byzbe_by@latinZbem_zmZber_dzZber_maZbgZbg_bgzbhb_in.utf8Zbho_inZbho_npZbi_vuZbn_bdZbn_inZbo_cnZbo_inZbokmalubokmål�brZbr_frZbrx_inZbsZbs_baZ	bulgarianZbyn_err�zc-frenchzc.asciizc.enz
c.iso88591zc.utf8Zc_czc_c.cZcaZca_adZca_eszca_es@valenciaZca_frZca_itZcatalanZce_ruZcextendz	chinese-sz	chinese-tZchr_usZckb_iqZcmn_twZcrh_uaZcroatianZcsZcs_csZcs_czZcsb_plZcv_ruZcyZcy_gbZczZcz_czZczechZdaZda_dkZdanishZdanskZdeZde_atZde_beZde_chZde_deZde_itz
de_li.utf8Zde_luZdeutschZdoi_inZdutchzdutch.iso88591Zdv_mvZdz_btZeeZee_eeZeestiZelZel_cyZel_grz
el_gr@euror�Zen_agZen_auZen_beZen_bwZen_caZen_dkz
en_dl.utf8Zen_gbZen_hkZen_ieZen_ilZen_inZen_ngZen_nzZen_phz
en_sc.utf8Zen_sgZen_ukZen_uszen_us@euro@euroZen_zaZen_zmZen_zwz
en_zw.utf8Zeng_gbZenglishzenglish.iso88591Z
english_ukzenglish_united-stateszenglish_united-states.437Z
english_usZeozeo.utf8Zeo_eoz
eo_us.utf8Zeo_xxZesZes_arZes_boZes_clZes_coZes_crZes_cuZes_doZes_ecZes_esZes_gtZes_hnZes_mxZes_niZes_paZes_peZes_prZes_pyZes_svZes_usZes_uyZes_veZestonianZetZet_eeZeuZeu_esZeu_frZfaZfa_irzfa_ir.isiri3342Zff_snZfiZfi_fiZfil_phZfinnishZfoZfo_fo�frZfr_beZfr_caZfr_chZfr_frZfr_luu	françaisZfre_frZfrenchzfrench.iso88591Z
french_franceZfur_itZfy_deZfy_nlZgaZga_ieZgalegoZgalicianZgdZgd_gbZger_deZgermanzgerman.iso88591Zgerman_germanyZgez_erZgez_etZglZgl_es�greekZgu_inZgvZgv_gbZha_ngZhak_twZheZhe_il�hebrew�hiZhi_inzhi_in.isciidevZhif_fjZhneZhne_inZhrZhr_hrZhrvatskiZhsb_deZht_htZhuZhu_huZ	hungarianZhy_amzhy_am.armscii8ZiaZia_frZ	icelandic�idZid_idZig_ngZik_ca�inZin_idryZis_isz
iso-8859-1r�z	iso8859-1z
iso8859-15�
iso_8859_1�iso_8859_15�itZit_chZit_itZitalianZiuZiu_caziu_ca.nunacom8ZiwZiw_ilz
iw_il.utf8ZjaZja_jpz	ja_jp.euczja_jp.mscodez	ja_jp.pckZjapanZjapanesezjapanese-euczjapanese.eucZjp_jpZkaZka_gezka_ge.georgianacademyzka_ge.georgianpszka_ge.georgianrsZkab_dzZkk_kzZklZkl_glZkm_khZknZkn_inZkoZko_krz	ko_kr.eucZkok_in�koreanz
korean.eucZksZks_inzks_in@devanagari.utf8Zku_tr�kwZkw_gbZkyZky_kgZlb_luZlg_ugZli_beZli_nlZlij_itZ
lithuanianZln_cd�loZlo_lazlo_la.cp1133zlo_la.ibmcp1133zlo_la.mulelao1�ltZlt_ltZlvZlv_lvZlzh_twZmag_inZmaiZmai_inZmai_npZmfe_muZmg_mgZmhr_ru�miZmi_nzZmiq_niZmjw_inZmkZmk_mkZmlZml_inZmn_mnZmni_inZmrZmr_inZmsZms_myZmtZmt_mtZmy_mmZnan_twZnbZnb_noZnds_deZnds_nlZne_npZnhn_mxZniu_nuZniu_nz�nlZnl_awZnl_beZnl_nlZnnZnn_noZnoz
no@nynorskZno_nozno_no.iso88591@bokmalzno_no.iso88591@nynorskZ	norwegianZnrZnr_zaZnsoZnso_zaZnyZny_noZnynorskZocZoc_frZom_etZom_ke�orZor_inZos_ruZpaZpa_inZpa_pkZpap_anZpap_awZpap_cwZpdZpd_deZpd_usZphZph_phZplZpl_plZpolishZ
portugueseZportuguese_brazil�posixz
posix-utf2ZppZpp_anZps_afZptZpt_brZpt_ptZquz_peZraj_inZroZro_roZromanianZruZru_ruZru_uaZrumanianZrussianZrwZrw_rwZsa_inZsat_inZsc_itZsdZsd_inzsd_in@devanagari.utf8Zsd_pkZse_noZ
serbocroatianZsgs_ltZshzsh_ba.iso88592@bosniaZsh_hrzsh_hr.iso88592Zsh_spZsh_yuZshn_mmZshs_caZsiZsi_lkZsid_etZsinhalaZskZsk_skZslZsl_csZsl_siZslovakZsloveneZ	slovenianZsm_wsZso_djZso_etZso_keZso_soZspZsp_yuZspanishZ
spanish_spainZsqZsq_alZsq_mk�srzsr@cyrilliczsr@latnZsr_cszsr_cs.iso88592@latnz
sr_cs@latnZsr_meZsr_rsz
sr_rs@latnZsr_spZsr_yuzsr_yu.cp1251@cyrilliczsr_yu.iso88592zsr_yu.iso88595zsr_yu.iso88595@cyrilliczsr_yu.microsoftcp1251@cyrillicz
sr_yu.utf8zsr_yu.utf8@cyrilliczsr_yu@cyrillicZssZss_za�stZst_zaZsvZsv_fiZsv_seZsw_keZsw_tzZswedishZszl_plZtaZta_inzta_in.tsciizta_in.tscii0Zta_lkztcy_in.utf8ZteZte_inZtgZtg_tjZthZth_thzth_th.tactiszth_th.tis620�thaiZthe_npZti_erZti_etZtig_erZtk_tmZtlZtl_phZtnZtn_zaZto_toZtpi_pgZtrZtr_cyZtr_trruZts_zaZttZtt_ruztt_ru.tatarcyrz
tt_ru@iqtelifZturkishZug_cnZukZuk_uaZunivZ	universalzuniversal.utf8@ucs4Zunm_usZurZur_inZur_pkZuzZuz_uzzuz_uz@cyrillicZveZve_zaZviZvi_vnz
vi_vn.tcvnzvi_vn.tcvn5712zvi_vn.visciizvi_vn.viscii111ZwaZwa_beZwae_chZwal_etZwo_snZxhZxh_zaZyiZyi_usZyo_ngZyue_hkZyuw_pgZzhZzh_cnz
zh_cn.big5z	zh_cn.eucZzh_hkzzh_hk.big5hkZzh_sgz	zh_sg.gbkZzh_twz	zh_tw.euczzh_tw.euctwZzuZzu_zaZaf_ZAZsq_ALZgsw_FRZam_ETZar_SAZar_IQZar_EGZar_LYZar_DZZar_MAZar_TNZar_OMZar_YEZar_SYZar_JOZar_LBZar_KWZar_AEZar_BHZar_QAZhy_AMZas_INZaz_AZZba_RUZeu_ESZbe_BYZbn_INZbs_BAZbr_FRZbg_BGZca_ESZzh_CHSZzh_TWZzh_CNZzh_HKZzh_SGZzh_MOZzh_CHTZco_FRZhr_HRZhr_BAZcs_CZZda_DKZgbz_AFZdiv_MVZnl_NLZnl_BEZen_USZen_GBZen_AUZen_CAZen_NZZen_IEZen_ZAZen_JAZen_CBZen_BZZen_TTZen_ZWZen_PHZen_INZen_MYZet_EEZfo_FOZfil_PHZfi_FIZfr_FRZfr_BEZfr_CAZfr_CHZfr_LUZfr_MCZfy_NLZgl_ESZka_GEZde_DEZde_CHZde_ATZde_LUZde_LIZel_GRZkl_GLZgu_INZha_NGZhe_ILZhi_INZhu_HUZis_ISZid_IDZiu_CAZga_IEZit_ITZit_CHZja_JPZkn_INZkk_KZZkh_KHZqut_GTZrw_RWZkok_INZko_KRZky_KGZlo_LAZlv_LVZlt_LTZdsb_DEZlb_LUZmk_MKZms_MYZms_BNZml_INZmt_MTZmi_NZZarn_CLZmr_INZmoh_CAZmn_MNZmn_CNZne_NPZnb_NOZnn_NOZoc_FRZor_INZps_AFZfa_IRZpl_PLZpt_BRZpt_PTZpa_INZquz_BOZquz_ECZquz_PEZro_ROZrm_CHZru_RUZsmn_FIZsmj_NOZsmj_SEZse_NOZse_SEZse_FIZsms_FIZsma_NOZsma_SEZsa_INZsr_SPZsr_BAZsi_LKZns_ZAZtn_ZAZsk_SKZsl_SIZes_ESZes_MXZes_GTZes_CRZes_PAZes_DOZes_VEZes_COZes_PEZes_ARZes_ECZes_CLZes_URZes_PYZes_BOZes_SVZes_HNZes_NIZes_PRZes_USZsw_KEZsv_SEZsv_FIZsyr_SYZtg_TJZtmz_DZZta_INZtt_RUZte_INZth_THZbo_BTZbo_CNZtr_TRZtk_TMZug_CNZuk_UAZwen_DEZur_PKZur_INZuz_UZZvi_VNZcy_GBZwo_SNZxh_ZAZsah_RUZii_CNZyo_NGZzu_ZA)�i6ii�i^iiiiiiii i$i(i,i0i4i8i<i@i+iMi,i,imi-i#iEi ii~iir%iiiiii|i�iiiii�ieiii	i	i	i	i	i	i	i	 i	$i	(i	,i	0i	4i	@i	Di	Hi%i8idiiiiiiiibiVi7iiiiiiioiGihi
i9iii!i]i]i<iiiiKi?iSi�i�iWii@iTi&i'i.ini/i>i>iLi:i�iziNi|iPiPiaiii�iHici)iiiiFikikikiiii;$i;i;i;i;i;i; i;i;iOiiiii[ili2ii$i
i
i
i
i
i
i
i
 i
$i
(i
,i
0i
4i
8i
<i
@i
Di
Hi
Li
Pi
TiAiiiZi(i_iIiDiJiiQiQiiBi�i"i.i i iCiCi*iRi�i4i�ixiji5cCs�i}|fdd�}|�|d=td�td�t�\}}td|p@d�td|pNd�t�td	�td�|��D]@\}}t|d
�t|�\}}td|p�d�td|p�d�t�qpt�td
�td�t�|��D]B\}}t|d
�t|�\}}td|p�d�td|�pd�t�q�zttd�Wn$td�td�td�YnhXt�td�td�|��D]F\}}t|d
�t|�\}}td|�p�d�td|�p�d�t��qldS)z Test function.
    cSs0t���D] \}}|dd�dkr
|||<q
dS)Nr#ZLC_)�globals�items)�
categories�k�vrrr�_init_categories�sz'_print_locale.<locals>._init_categoriesrz4Locale defaults as determined by getdefaultlocale():zH------------------------------------------------------------------------z
Language: z(undefined)z
Encoding: zLocale settings on startup:z...z
   Language: z
   Encoding: z,Locale settings after calling resetlocale():r(zNOTE:z9setlocale(LC_ALL, "") does not support the default localez&given in the OS environment variables.z4Locale settings after calling setlocale(LC_ALL, ""):N)rzrr�rrrr)r�r�Zlang�enc�namer=rrr�
_print_locale�sV



r��LC_MESSAGES�__main__zLocale aliasing:zNumber formatting:)N)F)FF)FF)FF)TFF)r�)N)T)T)T)T)K�__doc__r�r�Zencodings.aliases�rer`�builtinsrr��	functools�__all__rrr�r�rrrrr�rrrrCrr	rr�rr
r?r@�wrapsrErRrS�compiler\rYrrrrv�floatrr
r|r�r�r�rr�r�rrrr��
startswithr�CODESET�	NameError�hasattrr��sortedr�r�r�rs�
setdefaultr�r�r�rK�__name__rzrrrr�<module>st�	




%-S"5
$�6}�����
a��V:

uu.cpython-38.opt-2.pyc000064400000006730151450073350010576 0ustar00U

��.em�@sfddlZddlZddlZdddgZGdd�de�Zd
dd�dd�Zdd	d�Zd
d�Ze	dkrbe�dS)�N�Error�encode�decodec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/uu.pyr&sF��backtickc	Csjg}�zH|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfzt�	|�j
}Wntk
rdYnXt|d�}|�
|�|dkr�tjj}nt|t�r�t|d�}|�
|�|dkr�d}|dkr�d}|�dd�}|�dd�}|�d	|d
@|f�d��|�d�}t|�d
k�r0|�tj||d��|�d�}�q|�rB|�d�n
|�d�W5|D]}|���qTXdS)N�-�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
s`
end
s 
end
)�close�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu)�in_file�out_file�name�moder�opened_files�f�datarrr	r)sF








c

Cspg}|dkrtjj}nt|t�r4t|d�}|�|��z|��}|sLt	d��|�
d�sXq8|�dd�}t|�dkr8|ddkr8zt
|d	d
�Wq�Wq8tk
r�Yq8Xq8|dk�r:|d�d��d�}tj�|�r�t	d
|����|�
tj��s*dtj��|k�s*tj�r:|�
tj��s*dtj��|k�r:t	d|�d���|dk�rRt
|d	d
�}|dk�rftjj}n0t|t��r�t|d�}t�||�|}|�|�|��}	|	�rD|	�d�dk�rDzt�|	�}
Wnjtj	k
�r,}zH|	ddd@ddd}t�|	d|��}
|�stj�d|�W5d}~XYnX|�|
�|��}	�q�|	�sRt	d��W5|D]}|���qZXdS)Nrr
z'No valid begin line found in input filesbegin� ��r��s 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrrr r�readliner�
startswith�splitr%�int�
ValueError�rstriprrr�exists�sep�altsepr!�chmod�stripr&Za2b_uu�stderrr#)
r'r(r*�quietr+r,ZhdrZ	hdrfields�fp�sr-�v�nbytesrrr	rcsr





��
��




"
cCs4ddl}|jdd�}|jdddddd	d
�|jddd
ddd	d
�|��\}}t|�dkrl|�d�t�d�tjj	}tj
j	}t|�dkr�|d}t|�dkr�|d}|jr�|jr�t
|t�r�t|d�}nttjdd�t�d�t||�nD|j�r&t
|t��rt|d�}nttjdd�t�d�t||�dS)Nrz'usage: %prog [-d] [-t] [input [output]])Zusagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r/zincorrect number of argumentsr1rz: cannot do -t to stdoutr
z: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr%�errorr�exitrrr!rrMrrr�print�argvr)rN�parserZoptions�args�input�outputrrr	�test�s6




rX�__main__)NN)NNF)
r&rr�__all__�	ExceptionrrrrXrrrrr	�<module> s
:
J&struct.cpython-38.opt-2.pyc000064400000000514151450073350011463 0ustar00U

e5d�@s8ddddddddgZdd	lTdd
lmZddlmZdS)
ZcalcsizeZpackZ	pack_intoZunpackZunpack_fromZiter_unpackZStruct�error�)�*)�_clearcache)�__doc__N)�__all__Z_structrr�rr�/usr/lib64/python3.8/struct.py�<module>s�cProfile.cpython-38.pyc000064400000012577151450073350010756 0ustar00U

e5db�@s�dZdddgZddlZddlZddlZddd�Zddd�Zejje_ejje_Gd	d�dej�Z	d
d�Z
dd
�Zedkr~e�dS)zUPython interface for the 'lsprof' profiler.
   Compatible with the 'profile' module.
�run�runctx�Profile�N���cCst�t��|||�S�N)�
_pyprofile�_Utilsrr)�	statement�filename�sort�r� /usr/lib64/python3.8/cProfile.pyrscCst�t��|||||�Sr)rrrr)r	�globals�localsr
rrrr
rs�c@s`eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
de
_dd�Zdd�Z
dS)ra`Profile(timer=None, timeunit=None, subcalls=True, builtins=True)

    Builds a profiler object using the specified timer function.
    The default timer is a fast built-in one based on real time.
    For custom timer functions returning integers, timeunit can
    be a float specifying a scale (i.e. how long each integer unit
    is, in seconds).
    rcCs$ddl}|�|����|���dS�Nr)�pstats�StatsZ
strip_dirsZ
sort_stats�print_stats)�selfrrrrr
r)szProfile.print_statsc	Cs8ddl}t|d��}|��|�|j|�W5QRXdS)Nr�wb)�marshal�open�create_stats�dump�stats)r�filer�frrr
�
dump_stats-szProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rrrr
r3szProfile.create_statsc
Cs,|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i}	|	|t|j�<|||||	f|j|<q|D]�}|j	rlt|j�}|j	D]�}
z|t|
j�}	Wnt
k
r�Yq�YnX|
j}||
j}|
j}|
j}||	k�r|	|}||d7}||d7}||d7}||d7}||||f|	|<q�qldS)Nr���)Zgetstatsr�label�codeZ	callcountZreccallcountZ
inlinetimeZ	totaltime�idZcalls�KeyError)r�entriesZcallersdicts�entry�funcZncZccZttZctZcallersZsubentry�prevrrr
r7s>






zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr,�dictrrr
r]szProfile.runcCs(|��zt|||�W5|��X|Sr)�enabler�exec)rr.rrrrr
rbs

zProfile.runctxcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��z|||�W�S|��XdS)	Nr"z:descriptor 'runcall' of 'Profile' object needs an argumentr*rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr!)�len�	TypeError�pop�warnings�warn�DeprecationWarningr0r)�args�kwrr*r6rrr
�runcallks&

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs|��|Sr)r0r rrr
�	__enter__�szProfile.__enter__cGs|��dSr)r)r�exc_inforrr
�__exit__�szProfile.__exit__N)r)�__name__�
__module__�__qualname__�__doc__rrrrrrr;�__text_signature__r<r>rrrr
rs
&	cCs(t|t�rdd|fS|j|j|jfSdS)N�~r)�
isinstance�str�co_filename�co_firstlineno�co_name)r%rrr
r$�s

r$c
Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddt|j	j
�d�|jdddddd�|jdd�s�|��|�
d�|��\}}||jdd�<|jdk	r�|j�|j�|_t|�dk�r�|j�rd}	|j|dd�}
nR|d}|j�d|j�|��t�|��}t|��|d�}	W5QRX|dddd�}
zt|	|
d|j|j�Wn6tk
�r�}
zd|_|�
|
j�W5d}
~
XYnXn|��|S)Nr)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr)rMrNrO�choicesz-m�module�
store_truezProfile a library module)rM�actionrNrOr!r"z(run_module(modname, run_name='__main__'))�
run_module�modnamer1r,)�__file__r?�__package__�
__cached__) �os�sys�runpyrZoptparserJZallow_interspersed_argsZ
add_option�sortedrZsort_arg_dict_default�argvZprint_usage�exit�
parse_argsrL�path�abspathr3rQrT�insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)rYrZr[rrJrK�parserZoptionsr9r%ZglobsZprogname�fp�excrrr
�main�sd

�

�
�

�� rnr,)Nr)Nr)
rB�__all__Z_lsprofrdZprofilerrrZProfilerrr$rnr?rrrr
�<module>s




o;uuid.cpython-38.pyc000064400000056243151450073350010157 0ustar00U

&�.e3w�@s dZddlZddlZddlmZdZejdkr8dZZn ddlZe�	�Z
e
dkZe
dkZd	d
ddg\ZZZ
ZeZeZGd
d�de�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zdaa da!zddl"Z"Wne#k
�rdZ"YnXd%d&�Z$d'd(�Z%d)d*�Z&d+d,�Z'e�rFeegZ(nJejd-k�r^eeegZ(n2ejd.k�rteegZ(ne�r�egZ(neeeeegZ(ej)d/k�r�e%ge(Z*nej)d0k�r�e&ge(Z*ne(Z*da+dd1�d2d3�Z,da-d@d4d5�Z.d6d7�Z/d8d9�Z0d:d;�Z1ed<�Z2ed=�Z3ed>�Z4ed?�Z5dS)AaQUUID objects (universally unique identifiers) according to RFC 4122.

This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call uuid1() or uuid4().
Note that uuid1() may compromise privacy since it creates a UUID containing
the computer's network address.  uuid4() creates a random UUID.

Typical usage:

    >>> import uuid

    # make a UUID based on the host ID and current time
    >>> uuid.uuid1()    # doctest: +SKIP
    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')

    # make a UUID using an MD5 hash of a namespace UUID and a name
    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

    # make a random UUID
    >>> uuid.uuid4()    # doctest: +SKIP
    UUID('16fd2706-8baf-433b-82eb-8c7fada847da')

    # make a UUID using a SHA-1 hash of a namespace UUID and a name
    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')

    # make a UUID from a string of hex digits (braces and hyphens ignored)
    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')

    # convert a UUID to a string of hex digits in standard form
    >>> str(x)
    '00010203-0405-0607-0809-0a0b0c0d0e0f'

    # get the raw 16 bytes of the UUID
    >>> x.bytes
    b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

    # make a UUID from a 16-byte string
    >>> uuid.UUID(bytes=x.bytes)
    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
�N)�EnumzKa-Ping Yee <ping@zesty.ca>)�win32�darwinFZAIXZLinuxzreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definitionc@seZdZdZdZdZdS)�SafeUUIDr���N)�__name__�
__module__�__qualname__ZsafeZunsafe�unknown�rr�/usr/lib64/python3.8/uuid.pyrHsrc@s:eZdZdZdZd=ejd�dd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zed)d*��Zed+d,��Zed-d.��Zed/d0��Zed1d2��Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#dS)>�UUIDa�	Instances of the UUID class represent UUIDs as specified in RFC 4122.
    UUID objects are immutable, hashable, and usable as dictionary keys.
    Converting a UUID to a string with str() yields something in the form
    '12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts
    five possible forms: a similar string of hexadecimal digits, or a tuple
    of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
    48-bit values respectively) as an argument named 'fields', or a string
    of 16 bytes (with all the integer fields in big-endian order) as an
    argument named 'bytes', or a string of 16 bytes (with the first three
    fields in little-endian order) as an argument named 'bytes_le', or a
    single 128-bit integer as an argument named 'int'.

    UUIDs have these read-only attributes:

        bytes       the UUID as a 16-byte string (containing the six
                    integer fields in big-endian byte order)

        bytes_le    the UUID as a 16-byte string (with time_low, time_mid,
                    and time_hi_version in little-endian byte order)

        fields      a tuple of the six integer fields of the UUID,
                    which are also available as six individual attributes
                    and two derived attributes:

            time_low                the first 32 bits of the UUID
            time_mid                the next 16 bits of the UUID
            time_hi_version         the next 16 bits of the UUID
            clock_seq_hi_variant    the next 8 bits of the UUID
            clock_seq_low           the next 8 bits of the UUID
            node                    the last 48 bits of the UUID

            time                    the 60-bit timestamp
            clock_seq               the 14-bit sequence number

        hex         the UUID as a 32-character hexadecimal string

        int         the UUID as a 128-bit integer

        urn         the UUID as a URN as specified in RFC 4122

        variant     the UUID variant (one of the constants RESERVED_NCS,
                    RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)

        version     the UUID version number (1 through 5, meaningful only
                    when the variant is RFC_4122)

        is_safe     An enum indicating whether the UUID has been generated in
                    a way that is safe for multiprocessing applications, via
                    uuid_generate_time_safe(3).
    )�int�is_safe�__weakref__N)rcCs�|||||g�d�dkr td��|dk	rl|�dd��dd�}|�d��dd�}t|�d	krbtd
��t|d�}|dk	r�t|�dkr�td��|d
dd�|dd
d�|ddd�|dd�}|dk	r�t|�dkr�td��t|t�s�t	t
|���tj|dd�}|dk	�r*t|�dk�rtd��|\}}	}
}}}
d|k�rFdk�sPntd��d|	k�rhdk�srntd��d|
k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|
k�r�d k�s�ntd!��|d>|B}|d">|	d#>B|
d$>B|d%>B|
B}|dk	�rZd|k�rPd&d'>k�sZntd(��|dk	�r�d&|k�r|dk�s�ntd)��|d*M}|d+O}|d,M}||d->O}t�
|d.|�t�
|d/|�dS)0aLCreate a UUID from either a string of 32 hexadecimal digits,
        a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
        in little-endian order as the 'bytes_le' argument, a tuple of six
        integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
        8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
        the 'fields' argument, or a single 128-bit integer as the 'int'
        argument.  When a string of hex digits is given, curly braces,
        hyphens, and a URN prefix are all optional.  For example, these
        expressions all yield the same UUID:

        UUID('{12345678-1234-5678-1234-567812345678}')
        UUID('12345678123456781234567812345678')
        UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
        UUID(bytes='\x12\x34\x56\x78'*4)
        UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' +
                      '\x12\x34\x56\x78\x12\x34\x56\x78')
        UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
        UUID(int=0x12345678123456781234567812345678)

        Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must
        be given.  The 'version' argument is optional; if given, the resulting
        UUID will have its variant and version set according to RFC 4122,
        overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'.

        is_safe is an enum exposed as an attribute on the instance.  It
        indicates whether the UUID has been generated in a way that is safe
        for multiprocessing applications, via uuid_generate_time_safe(3).
        N�zGone of the hex, bytes, bytes_le, fields, or int arguments must be givenzurn:�zuuid:z{}�-� z$badly formed hexadecimal UUID string�z bytes_le is not a 16-char string�r���zbytes is not a 16-char string�big)�	byteorder�zfields is not a 6-tuplerlz*field 1 out of range (need a 32-bit value)iz*field 2 out of range (need a 16-bit value)z*field 3 out of range (need a 16-bit value)�z*field 4 out of range (need an 8-bit value)z*field 5 out of range (need an 8-bit value)�z*field 6 out of range (need a 48-bit value)�`�P�@�0��z*int is out of range (need a 128-bit value)zillegal version numberl�����l�����Lrr)�count�	TypeError�replace�strip�len�
ValueError�int_�
isinstance�bytes_�AssertionError�repr�
from_bytes�object�__setattr__)�self�hex�bytes�bytes_le�fieldsr�versionr�time_low�time_mid�time_hi_version�clock_seq_hi_variant�
clock_seq_low�node�	clock_seqrrr�__init__�sz 
�
�
����

z
UUID.__init__cCs&d|ji}|jtjkr"|jj|d<|S�Nrr)rrrr
�value)r5�drrr�__getstate__�s
zUUID.__getstate__cCs:t�|d|d�t�|dd|kr.t|d�ntj�dSrC)r3r4rr
)r5�staterrr�__setstate__�s��zUUID.__setstate__cCst|t�r|j|jkStS�N�r.r
r�NotImplemented�r5�otherrrr�__eq__�s
zUUID.__eq__cCst|t�r|j|jkStSrIrJrLrrr�__lt__�s
zUUID.__lt__cCst|t�r|j|jkStSrIrJrLrrr�__gt__�s
zUUID.__gt__cCst|t�r|j|jkStSrIrJrLrrr�__le__�s
zUUID.__le__cCst|t�r|j|jkStSrIrJrLrrr�__ge__s
zUUID.__ge__cCs
t|j�SrI)�hashr�r5rrr�__hash__sz
UUID.__hash__cCs|jSrI�rrTrrr�__int__szUUID.__int__cCsd|jjt|�fS)Nz%s(%r))�	__class__r�strrTrrr�__repr__sz
UUID.__repr__cCstd��dS)NzUUID objects are immutable)r()r5�namerDrrrr4szUUID.__setattr__cCsDd|j}d|dd�|dd�|dd�|dd�|dd�fS)N�%032xz%s-%s-%s-%s-%sr�r�rV)r5r6rrr�__str__s





�zUUID.__str__cCs|j�dd�S)Nrr)r�to_bytesrTrrrr7sz
UUID.bytescCs<|j}|ddd�|ddd�|ddd�|dd�S)Nrrrrr�r7)r5r7rrrr8s(
�z
UUID.bytes_lecCs|j|j|j|j|j|jfSrI)r;r<r=r>r?r@rTrrrr9 s
�zUUID.fieldscCs
|jd?S)NrrVrTrrrr;%sz
UUID.time_lowcCs|jd?d@S)Nr �rVrTrrrr<)sz
UUID.time_midcCs|jd?d@S)Nr!rbrVrTrrrr=-szUUID.time_hi_versioncCs|jd?d@S)N�8�rVrTrrrr>1szUUID.clock_seq_hi_variantcCs|jd?d@S)Nr"rdrVrTrrrr?5szUUID.clock_seq_lowcCs|jd@d>|jd>B|jBS)N�r"r)r=r<r;rTrrr�time9s
��z	UUID.timecCs|jd@d>|jBS)N�?r)r>r?rTrrrrA>s�zUUID.clock_seqcCs
|jd@S)Nl���rVrTrrrr@Csz	UUID.nodecCs
d|jS)Nr\rVrTrrrr6GszUUID.hexcCsdt|�S)Nz	urn:uuid:)rYrTrrr�urnKszUUID.urncCs2|jd@stS|jd@stS|jd@s*tStSdS)Nr%ll)r�RESERVED_NCS�RFC_4122�RESERVED_MICROSOFT�RESERVED_FUTURErTrrr�variantOs


zUUID.variantcCs |jtkrt|jd?d@�SdS)Nr&�)rmrjrrTrrrr:Zs
zUUID.version)NNNNNN)$rrr	�__doc__�	__slots__rr
rBrFrHrNrOrPrQrRrUrWrZr4r_�propertyr7r8r9r;r<r=r>r?rfrAr@r6rhrmr:rrrrr
Nsd3��V














r
c	Gs�ddl}ddl}ddl}|�|�}|dkrP|j�d�}|j||d�}|dkrPdSt|j�}d|d<|j|f||j	|j
|d�}|S)Nr)z/sbinz	/usr/sbin)�path�C�LC_ALL)�stdout�stderr�env)�os�shutil�
subprocessZwhich�pathsep�join�dict�environ�Popen�PIPEZDEVNULL)	�command�argsrxryrz�
executablerrrw�procrrr�_popen`s

�r�cCs
|d@S)Nlr��macrrr�
_is_universal�sr�cCs�d}z�t|f|����}|s"WdS|��|jD]�}|������}tt|��D]x}|||krNzN|||�}	t|	�dd�d�}
t	|
�r�|
WW5QR�WS|p�|
}WqNt
tfk
r�YqNXqNq.W5QRXWntk
r�YnX|p�dS)N�:�r)
r��splitru�lower�rstrip�ranger+rr)r�r,�
IndexError�OSError)r�r�Zhw_identifiersZ	get_index�first_local_macr��line�words�i�wordr�rrr�	_find_mac�s*
r�cCs4d}dD]&}td||dd��}|r*|SdSdS)z5Get the hardware address on Unix by running ifconfig.)shwaddrsethersaddress:slladdr)rz-az-avZifconfigcSs|dS�Nr#r�r�rrr�<lambda>�r�z#_ifconfig_getnode.<locals>.<lambda>N�r�)�keywordsr�r�rrr�_ifconfig_getnode�sr�cCs tdddgdd��}|r|SdS)z/Get the hardware address on Unix by running ip.Zip�links
link/ethercSs|dSr�rr�rrrr��r�z_ip_getnode.<locals>.<lambda>Nr�r�rrr�_ip_getnode�sr�cCs�ddl}ddl}z|�|���}Wntk
r8YdSXtdd|�|�gdd��}|r\|Stdd|�|�gdd��}|r~|Stdd|�d|�gd	d��}|r�|SdS)
z0Get the hardware address on Unix by running arp.rNZarpz-ancSsdS)Nrrr�rrrr��r�z_arp_getnode.<locals>.<lambda>cSs|dSr�rr�rrrr��r�z(%s)cSs|dS)N�rr�rrrr��r�)rx�socketZ
gethostbynameZgethostnamer�r��fsencode)rxr�Zip_addrr�rrr�_arp_getnode�s"�r�cCstdddgdd��S)z4Get the hardware address on Unix by running lanscan.Zlanscanz-aislan0cSsdS)Nrrr�rrrr��r�z"_lanscan_getnode.<locals>.<lambda>r�rrrr�_lanscan_getnode�sr�cCs&d}�z�tdd�}|sWdS|��|j������}z|�d�}Wn"tk
rdYW5QR�WdSX|jD]�}zl|����}||}t|�dkr�|�d�dkr�t	|�
dd�d	�}t|�r�|WW5QR�WS|p�|}Wqlttfk
r�YqlXqlW5QRXWnt
k
�rYnX|�p$dS)
z4Get the hardware address on Unix by running netstat.NZnetstatz-iasAddress�r�rr�r)r�ru�readliner�r��indexr,r+r'rr)r�r�r�)r�r�r�r�r�r�r�rrr�_netstat_getnode�s2

r�cCs<ddl}ddl}ddl}d}dddg}z:ddl}|�d�}|jj�|d�|�d|j	�
d��WnYnX|D]�}z$|j|j�
|d�d	g|jd
d�}Wntk
r�YqrYnX|�r|jD]d}	|	�d�d
����}
|�d|
�r�t|
�dd�d�}t|��r|W5QR�S|�p"|}q�W5QRXqr|�p:dS)z<Get the hardware address on Windows by running ipconfig.exe.rNrzc:\windows\system32zc:\winnt\system32i,�mbcsZipconfigz/allZoem)ru�encoding�:rz((?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]rr)rx�rerz�ctypes�create_string_buffer�windllZkernel32ZGetSystemDirectoryA�insertrD�decoderrrr|r�r�rur�r*r��	fullmatchrr)r�)rxr�rzr��dirsr��buffer�dirr�r�rDr�rrr�_ipconfig_getnode�s6

�



r�c	Cs6ddl}ddl}d}|��}|j|_|��|_}|��|�|�dkrLdS|�	�t
|j�D]�}|��|j
|_t|j|�|_|�|�dkr�q^|��|j|_t|j|�|_d�d�|_|��|_}|�|�dkr�q^|�	�|jdd�}t|�dk�rq^t�|d�}t|��r |S|�p(|}q^|�p4dS)ztGet the hardware address on Windows using NetBIOS calls.
    See http://support.microsoft.com/kb/118623 for details.rN�*rrr)�	win32wnet�netbiosZNCBZNCBENUMZCommandZ	LANA_ENUMZBufferZ_packZNetbiosZ_unpackr�ZlengthZResetZNCBRESET�ordZlanaZLana_numZNCBASTAT�ljustZCallnameZADAPTER_STATUSZadapter_addressr+rr2r�)	r�r�r�ZncbZadaptersr�Zstatusr7r�rrr�_netbios_getnodes>
r�c
s�tdk	rdSdatjdkr8tt��j�d�d�dkr8ntdk	rPtj	a
tjadSz�ddl�ddl
�dg}tj�d�s~|�d	�|D]�}z���j�|��}Wntk
r�Yq�YnXt|d
�r�|j���fdd�a
d
a�qq�t|d�r�|j�d�_��fdd�a
�qq�z�jj}Wnd}YnXt|dt|dd��aWn>tk
�r~}zddl}|�d|��t�W5d}~XYnXdS)zG
    Try to load platform-specific functions for generating uuids.
    NFr�.r�	Zuuid�win�c�uuid_generate_time_safecs ��d�}�|�}t|j�|fS�Nr�r�r7�raw)�_buffer�res)�_uuid_generate_time_safer�rr�_generate_time_safehs
r�T�uuid_generate_timecs ��d�}�|�t|j�dfSr�r�)r�)�_uuid_generate_timer�rrr�ss
ZUuidCreateSequentialZ
UuidCreatez/Could not find fallback ctypes uuid functions: )�_has_uuid_generate_time_safe�sys�platformrrx�uname�releaser��_uuidZgenerate_time_safer�Zhas_uuid_generate_time_safer�Zctypes.util�
startswith�appendZCDLL�utilZfind_library�	Exception�hasattrr�r�Zrestyper�Zrpcrt4�getattr�_UuidCreate�warnings�warn�
ImportWarning)Z	_libnamesZlibname�lib�excr�r)r�r�r�r�_load_system_functions:sT&






��r�cCst�t�\}}t|d�jS)zPGet the hardware address on Unix using the _uuid extension module
    or ctypes.ra)r�r�r
r@)�	uuid_time�_rrr�
_unix_getnode�s
r�cCs:ddl}t�|�d�}t|�dkr6tt|j�d�jSdS)z1Get the hardware address on Windows using ctypes.rNrra)r�r�r�r�r
r/r�r@)r�r�rrr�_windll_getnode�s

r�cCsddl}|�d�dBS)zGet a random node ID.rNr"l)�random�getrandbits)r�rrr�_random_getnode�sr�rr�posix�nt)�getterscCsvtdk	rtSttgD]H}z
|�aWnYqYnXtdk	rdtkrRdkrnqtSqdsrtd�t���dS)a3Get the hardware address as a 48-bit positive integer.

    The first time this runs, it may launch a separate program, which could
    be quite slow.  If all attempts to obtain the hardware address fail, we
    choose a random 48-bit number with its eighth bit set to 1 as recommended
    in RFC 4122.
    NrrFz,_random_getnode() returned invalid value: {})�_node�_GETTERSr�r0�format)r��getterrrr�getnode�s	

 
r�cCst�tdk	rd||kr"dkrdnn>t�\}}zt|�}Wntk
rVtj}YnXt||d�Sddl}|��}|dd}tdk	r�|tkr�td}|a|dkr�ddl	}|�
d�}|d@}	|d	?d
@}
|d?d@}|d
@}|d?d@}
|dkr�t�}t|	|
||
||fdd�S)aGenerate a UUID from a host ID, sequence number, and the current time.
    If 'node' is not given, getnode() is used to obtain the hardware
    address.  If 'clock_seq' is given, it is used as the sequence number;
    otherwise a random 14-bit sequence number is chosen.N)r7rr�dl@'Hw�
r#�l��rrbr"rerdrrg)r9r:)r�r�rr,r
r
rf�time_ns�_last_timestampr�r�r�)r@rAr�Zsafely_generatedrrfZnanosecondsZ	timestampr�r;r<r=r?r>rrr�uuid1�s> 

��r�cCs<ddlm}||jt|d�dd���}t|dd�dd	�S)
zAGenerate a UUID from the MD5 hash of a namespace UUID and a name.r)�md5�utf-8F)ZusedforsecurityNrr�r7r:)�hashlibr�r7�digestr
)�	namespacer[r�r�rrr�uuid3s�
r�cCstt�d�dd�S)zGenerate a random UUID.rrr�)r
rx�urandomrrrr�uuid4sr�cCs8ddlm}||jt|d����}t|dd�dd�S)zCGenerate a UUID from the SHA-1 hash of a namespace UUID and a name.r)�sha1r�Nrrr�)r�r�r7r�r
)r�r[r�rSrrr�uuid5sr�z$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8)NN)6rorxr��enumr�
__author__r�Z_AIXZ_LINUX�systemZ_platform_systemrirjrkrlrr-r7r/rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r��ImportErrorr�r�r�r�Z_OS_GETTERSr[r�r�r�r�r�r�r�r�Z
NAMESPACE_DNSZ
NAMESPACE_URLZ
NAMESPACE_OIDZNAMESPACE_X500rrrr�<module>s�.

�"
$
T

�
'	site.cpython-38.opt-2.pyc000064400000026047151450073350011114 0ustar00U

&�.eNU�@s"ddlZddlZddlZddlZddlZejejgadada	da
dd�Zdd�Zdd�Z
dd	�Zd
d�Zd1dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd2dd�Zd3dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z ej!j"�se �d.d/�Z#e$d0k�re#�dS)4�NcGsBtjj|�}ztj�|�}Wntk
r0YnX|tj�|�fS�N)�os�path�join�abspath�OSError�normcase)�paths�dir�r�/usr/lib64/python3.8/site.py�makepath[sr
cCs�ttj���D]~}tt|dd�dd�dkr,qztj�|j�|_Wnt	t
tfk
rZYnXztj�|j�|_Wqt	t
tfk
r�YqXqdS)N�
__loader__�
__module__)�_frozen_importlib�_frozen_importlib_external)
�set�sys�modules�values�getattrrrr�__file__�AttributeErrorr�	TypeError�
__cached__)�mrrr�	abs_pathsds�rcCsPg}t�}tjD],}t|�\}}||kr|�|�|�|�q|tjdd�<|Sr)rrrr
�append�add)�L�known_pathsr
�dircaserrr�removeduppathsts

r"c	CsVt�}tjD]D}z&tj�|�r4t|�\}}|�|�Wqtk
rNYqYqXq|Sr)rrrr�existsr
rr)�d�item�_�itemcaserrr�_init_pathinfo�s
r(cCsr|dkrt�}d}nd}tj�||�}zt�t�|��}Wntk
rPYdSX|��t|�D]�\}}|�	d�rvqbzZ|�	d�r�t
|�Wqb|��}t||�\}}	|	|kr�tj�
|�r�tj�|�|�|	�Wqbtk
�rVtd�|d|�tjd�ddl}
|
jt���D](}|��D]}td	|tjd��q�qtd
tjd�Y�qZYqbXqbW5QRX|�rnd}|S)NTF�#)zimport zimport	z"Error processing line {:d} of {}:
�)�filerz  z
Remainder of file ignored)r(rrr�io�
TextIOWrapper�	open_coder�	enumerate�
startswith�exec�rstripr
r#rrr�	Exception�print�format�stderr�	traceback�format_exception�exc_info�
splitlines)�sitedir�namer �reset�fullname�f�n�liner
r!r7�recordrrr�
addpackage�sF

�rCcCs�|dkrt�}d}nd}t|�\}}||krBtj�|�|�|�zt�|�}Wntk
rfYdSXdd�|D�}t	|�D]}t
|||�q~|r�d}|S)NTFcSsg|]}|�d�r|�qS)z.pth)�endswith)�.0r<rrr�
<listcomp>�s
zaddsitedir.<locals>.<listcomp>)r(r
rrrrr�listdirr�sortedrC)r;r r=�sitedircase�namesr<rrr�
addsitedir�s$
rKcCs`tjjrdSttd�r4ttd�r4t��t��kr4dSttd�r\ttd�r\t��t��kr\dSdS)NF�getuid�geteuid�getgid�getegidT)	r�flags�no_user_site�hasattrrrMrLrOrNrrrr�check_enableusersite�s
rScCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)rr�
expanduserr)�argsrrr�joinuser�sz_getuserbase.<locals>.joinuser�nt�APPDATA�~�Python�darwin�Libraryz%d.%d�z.local)r�environ�getr<r�platform�
_framework�version_info)�env_baserW�baserrr�_getuserbase�s


�rfcCsdtj}tjdkr,|�d|d�|d�d�StjdkrFtjrF|�d�S|�d|d�d	|d�d
�S)NrXz\Pythonrr*z\site-packagesr\z/lib/python/site-packagesz/lib/python�.z/site-packages)rrcrr<rarb)�userbase�versionrrr�	_get_path
s

rjcCstdkrt�atSr)�	USER_BASErfrrrr�getuserbasesrlcCst�}tdkrt|�atSr)rl�	USER_SITErj)rhrrr�getusersitepackages#srncCs$t�}tr tj�|�r t||�|Sr)rn�ENABLE_USER_SITErr�isdirrK)r �	user_siterrr�addusersitepackages1s
rrcCs�g}t�}|dkrt}|D]�}|r||kr,q|�|�tjdkr�|�tj�|ddtj	dd�d��|�tj�|ddtj
dd�d��q|�|�|�tj�|dd��|�tj�|dd��q|S)	N�/�lib64�python�z
site-packages�libzpython%d.%dr^)r�PREFIXESrr�seprrrrrirc)�prefixes�sitepackages�seen�prefixrrr�getsitepackages?s*

��
r~cCsBtrdtjkrt�dd�t|�D]}tj�|�r"t||�q"|S)N�RPM_BUILD_ROOTrz
/usr/local)	rorr_rx�insertr~rrprK)r rzr;rrr�addsitepackages^sr�cCs4tjdkrd}nd}t�d|�t_t�d|�t_dS)N�\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)�quit�exit)rry�
_sitebuiltins�Quitter�builtinsr�r�)�eofrrr�setquitms

r�cCs�t�dtj�t_tjdd�dkr2t�dd�t_nt�dd�t_gg}}ttd�r�tj	�
tj�}|�dd	g�|�tj	�
|tj�|tjg�t�d
d||�t_dS)N�	copyright��java�creditsz?Jython is maintained by the Jython developers (www.jython.org).z�    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.rzLICENSE.txt�LICENSE�licensez'See https://www.python.org/psf/license/)r��_Printerrr�r�rar�rRrr�dirnamer�extendr�pardir�curdirr�)�files�dirs�hererrr�setcopyright}s$�

�r�cCst��t_dSr)r��_Helperr��helprrrr�	sethelper�sr�cCsdd�}|t_dS)Ncs�ddl}zddl�ddl}Wntk
r2YdSXt�dd�}|dk	r\d|kr\��d�n
��d�z���Wntk
r�YnX���dkr�t	j
�t	j
�d�d��z��
��Wntk
r�YnX��fd	d
�}|�|�dS)Nr�__doc__��libeditzbind ^I rl_completez
tab: completerZz.python_historycs(z����Wntk
r"YnXdSr)�write_history_filerr��history�readlinerr�
write_history�szCenablerlcompleter.<locals>.register_readline.<locals>.write_history)�atexitr��rlcompleter�ImportErrorr�parse_and_bind�read_init_filer�get_current_history_lengthrrrrU�read_history_file�register)r�r��readline_docr�rr�r�register_readline�s0
�z,enablerlcompleter.<locals>.register_readline)r�__interactivehook__)r�rrr�enablerlcompleter�s	0r�c	CsHtj}tjdkr*d|kr*tjd}t_ntj}tj�tj�|��\}}tj�	|�}dt_
d}dd�tj�||�tj�||�fD�}|�rD|d}d}	t|dd	��\}
|
D]P}d
|kr�|�
d
�\}}}
|����}|
��}
|dkr�|
��}	q�|dkr�|
t_
q�W5QRX|t_t_t|tjg�|	dk�r8t�dtj�ntjgad
a|S)Nr\�__PYVENV_LAUNCHER__z
pyvenv.cfgcSsg|]}tj�|�r|�qSr)rr�isfile)rE�conffilerrrrF�s�zvenv.<locals>.<listcomp>r�truezutf-8)�encoding�=zinclude-system-site-packages�homeF)rr_rra�_base_executable�
executabler�splitrr��_homer�open�	partition�strip�lowerr}�exec_prefixr�rxr�ro)r �envr��exe_dirr&�site_prefix�
conf_basename�candidate_confs�virtual_conf�system_siter?rA�key�valuerrr�venv�sB��

r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)Nr�
sitecustomizez@Error in sitecustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrP�verbose�
excepthookr9r6�write�	__class__�__name__)r��exc�errrrr�execsitecustomizes

��r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)Nr�
usercustomizez@Error in usercustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrPr�r�r9r6r�r�r�)r�r�r�rrr�execusercustomizes

��r�cCs~tjdd�}t�}|tjkr$t�t|�}tdkr:t�at|�}t|�}t	�t
�t�tjj
sjt�t�trzt�dSr)rrr"rr�rorSrrr�r�r�r�rP�isolatedr�r�r�)�	orig_pathr rrr�main/s"
r�cCs\d}tjdd�}|s�t�}t�}td�tjD]}td|f�q0td�td|tj�|�rbdndf�td	|tj�|�r�dndf�td
t�t�	d�g}d|kr�|�
t�d
|kr�|�
t�|�r(ttj
�|��tr�t�	d�n6tdk�rt�	d�n tdk�rt�	d�n
t�	d�n0ddl}t|�|tjdtj
f��t�	d�dS)Na�    %s [--user-base] [--user-site]

    Without arguments print some useful information
    With arguments print the value of USER_BASE and/or USER_SITE separated
    by '%s'.

    Exit codes with --user-base or --user-site:
      0 - user site directory is enabled
      1 - user site directory is disabled by user
      2 - uses site directory is disabled by super user
          or for security reasons
     >2 - unknown error
    r*zsys.path = [z    %r,�]zUSER_BASE: %r (%s)r#z
doesn't existzUSER_SITE: %r (%s)zENABLE_USER_SITE: %rrz--user-basez--user-siteFr^rv�
)r�argvrlrnr4rrrpror�rrkrm�pathsepr�textwrap�dedent)r�rV�	user_baserqr
�bufferr�rrr�_scriptQsD
��




r��__main__)N)N)N)%rrr�r�r,r}r�rxrormrkr
rr"r(rCrKrSrfrjrlrnrrr~r�r�r�r�r�r�r�r�r�rP�no_siter�r�rrrr�<module>HsF	
*
 


;4
3
socketserver.cpython-38.opt-1.pyc000064400000061423151450073350012663 0ustar00U

e5d�j�	@sdZdZddlZddlZddlZddlZddlZddlmZddl	m
Z	dddd	d
ddd
dg	Zeed�rxe�
dddg�eed�r�e�
ddddg�eed�r�ejZnejZGdd�d�ZGdd�de�ZGdd�de�Zeed�r�Gdd�d�ZGdd�de�ZGdd �d �ZGd!d�d�Zeed��rNGd"d�dee�ZGd#d�dee�ZGd$d	�d	ee�ZGd%d
�d
ee�Zeed��r�Gd&d�de�ZGd'd�de�ZGd(d�dee�ZGd)d�dee�Z Gd*d�d�Z!Gd+d�de!�Z"Gd,d-�d-e�Z#Gd.d
�d
e!�Z$dS)/aqGeneric socket server classes.

This module tries to capture the various aspects of defining a server:

For socket-based servers:

- address family:
        - AF_INET{,6}: IP (Internet Protocol) sockets (default)
        - AF_UNIX: Unix domain sockets
        - others, e.g. AF_DECNET are conceivable (see <socket.h>
- socket type:
        - SOCK_STREAM (reliable stream, e.g. TCP)
        - SOCK_DGRAM (datagrams, e.g. UDP)

For request-based servers (including socket-based):

- client address verification before further looking at the request
        (This is actually a hook for any processing that needs to look
         at the request before anything else, e.g. logging)
- how to handle multiple requests:
        - synchronous (one request is handled at a time)
        - forking (each request is handled by a new process)
        - threading (each request is handled by a new thread)

The classes in this module favor the server type that is simplest to
write: a synchronous TCP/IP server.  This is bad class design, but
saves some typing.  (There's also the issue that a deep class hierarchy
slows down method lookups.)

There are five classes in an inheritance diagram, four of which represent
synchronous servers of four types:

        +------------+
        | BaseServer |
        +------------+
              |
              v
        +-----------+        +------------------+
        | TCPServer |------->| UnixStreamServer |
        +-----------+        +------------------+
              |
              v
        +-----------+        +--------------------+
        | UDPServer |------->| UnixDatagramServer |
        +-----------+        +--------------------+

Note that UnixDatagramServer derives from UDPServer, not from
UnixStreamServer -- the only difference between an IP and a Unix
stream server is the address family, which is simply repeated in both
unix server classes.

Forking and threading versions of each type of server can be created
using the ForkingMixIn and ThreadingMixIn mix-in classes.  For
instance, a threading UDP server class is created as follows:

        class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass

The Mix-in class must come first, since it overrides a method defined
in UDPServer! Setting the various member variables also changes
the behavior of the underlying server mechanism.

To implement a service, you must derive a class from
BaseRequestHandler and redefine its handle() method.  You can then run
various versions of the service by combining one of the server classes
with your request handler class.

The request handler class must be different for datagram or stream
services.  This can be hidden by using the request handler
subclasses StreamRequestHandler or DatagramRequestHandler.

Of course, you still have to use your head!

For instance, it makes no sense to use a forking server if the service
contains state in memory that can be modified by requests (since the
modifications in the child process would never reach the initial state
kept in the parent process and passed to each child).  In this case,
you can use a threading server, but you will probably have to use
locks to avoid two requests that come in nearly simultaneous to apply
conflicting changes to the server state.

On the other hand, if you are building e.g. an HTTP server, where all
data is stored externally (e.g. in the file system), a synchronous
class will essentially render the service "deaf" while one request is
being handled -- which may be for a very long time if a client is slow
to read all the data it has requested.  Here a threading or forking
server is appropriate.

In some cases, it may be appropriate to process part of a request
synchronously, but to finish processing in a forked child depending on
the request data.  This can be implemented by using a synchronous
server and doing an explicit fork in the request handler class
handle() method.

Another approach to handling multiple simultaneous requests in an
environment that supports neither threads nor fork (or where these are
too expensive or inappropriate for the service) is to maintain an
explicit table of partially finished requests and to use a selector to
decide which request to work on next (or whether to handle a new
incoming request).  This is particularly important for stream services
where each client can potentially be connected for a long time (if
threads or subprocesses cannot be used).

Future work:
- Standard classes for Sun RPC (which uses either UDP or TCP)
- Standard mix-in classes to implement various authentication
  and encryption schemes

XXX Open problems:
- What to do with out-of-band data?

BaseServer:
- split generic "request" functionality out into BaseServer class.
  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>

  example: read entries from a SQL database (requires overriding
  get_request() to return a table entry from the database).
  entry is processed by a RequestHandlerClass.

z0.4�N)�BufferedIOBase)�	monotonic�
BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�PollSelectorc@s�eZdZdZdZdd�Zdd�Zd&dd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra�Base class for server classes.

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you do not use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - server_close()
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - service_actions()
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - allow_reuse_address

    Instance variables:

    - RequestHandlerClass
    - socket

    NcCs ||_||_t��|_d|_dS)�/Constructor.  May be extended, do not override.FN)�server_address�RequestHandlerClass�	threadingZEvent�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrr�r�$/usr/lib64/python3.8/socketserver.py�__init__�s
zBaseServer.__init__cCsdS�zSCalled by constructor to activate the server.

        May be overridden.

        Nr�rrrr�server_activate�szBaseServer.server_activate��?c	Cst|j��zRt��B}|�|tj�|jsP|�|�}|jr:qP|rF|�	�|�
�q"W5QRXW5d|_|j��XdS)z�Handle one request at a time until shutdown.

        Polls for shutdown every poll_interval seconds. Ignores
        self.timeout. If you need to do periodic tasks, do them in
        another thread.
        FN)r�clearr�set�_ServerSelector�register�	selectors�
EVENT_READ�select�_handle_request_noblock�service_actions)rZ
poll_interval�selector�readyrrr�
serve_forever�s

zBaseServer.serve_forevercCsd|_|j��dS)z�Stops the serve_forever loop.

        Blocks until the loop has finished. This must be called while
        serve_forever() is running in another thread, or it will
        deadlock.
        TN)rr�waitr"rrr�shutdown�szBaseServer.shutdowncCsdS)z�Called by the serve_forever() loop.

        May be overridden by a subclass / Mixin to implement any code that
        needs to be run during the loop.
        Nrr"rrrr-�szBaseServer.service_actionsc
Cs�|j��}|dkr|j}n|jdk	r0t||j�}|dk	rBt�|}t��f}|�|tj�|�	|�}|rz|�
�W5QR�S|dk	rX|t�}|dkrX|��W5QR�SqXW5QRXdS)zOHandle one request, possibly blocking.

        Respects self.timeout.
        Nr)�socketZ
gettimeout�timeout�min�timer'r(r)r*r+r,�handle_timeout)rr4Zdeadliner.r/rrr�handle_requests 




zBaseServer.handle_requestcCs�z|��\}}Wntk
r&YdSX|�||�r�z|�||�Wq�tk
rn|�||�|�|�Yq�|�|��Yq�Xn
|�|�dS)z�Handle one request, without blocking.

        I assume that selector.select() has returned that the socket is
        readable before this function was called, so there should be no risk of
        blocking in get_request().
        N)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r�request�client_addressrrrr,/s

z"BaseServer._handle_request_noblockcCsdS)zcCalled if no new request arrives within self.timeout.

        Overridden by ForkingMixIn.
        Nrr"rrrr7FszBaseServer.handle_timeoutcCsdS)znVerify the request.  May be overridden.

        Return True if we should proceed with this request.

        Trr@rrrr;MszBaseServer.verify_requestcCs|�||�|�|�dS)zVCall finish_request.

        Overridden by ForkingMixIn and ThreadingMixIn.

        N)�finish_requestr?r@rrrr<UszBaseServer.process_requestcCsdS�zDCalled to clean-up the server.

        May be overridden.

        Nrr"rrr�server_close^szBaseServer.server_closecCs|�|||�dS)z8Finish one request by instantiating RequestHandlerClass.N)rr@rrrrCfszBaseServer.finish_requestcCs|�|�dS�z3Called to shutdown and close an individual request.N��
close_request�rrArrrr?jszBaseServer.shutdown_requestcCsdS�z)Called to clean up an individual request.NrrIrrrrHnszBaseServer.close_requestcCs@tdtjd�td|tjd�ddl}|��tdtjd�dS)ztHandle an error gracefully.  May be overridden.

        The default is to print a traceback and continue.

        z(----------------------------------------)�filez4Exception happened during processing of request fromrN)�print�sys�stderr�	traceback�	print_exc)rrArBrOrrrr>rs�zBaseServer.handle_errorcCs|S�Nrr"rrr�	__enter__szBaseServer.__enter__cGs|��dSrQ)rE)r�argsrrr�__exit__�szBaseServer.__exit__)r$)�__name__�
__module__�__qualname__�__doc__r4r r#r0r2r-r8r,r7r;r<rErCr?rHr>rRrTrrrrr�s&+

	
c@sfeZdZdZejZejZdZ	dZ
ddd�Zdd�Zd	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�ZdS)ra3Base class for various socket-based server classes.

    Defaults to synchronous IP stream (i.e., TCP).

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass, bind_and_activate=True)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you don't use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - request_queue_size (only for stream sockets)
    - allow_reuse_address

    Instance variables:

    - server_address
    - RequestHandlerClass
    - socket

    �FTcCsTt�|||�t�|j|j�|_|rPz|��|��Wn|���YnXdS)rN)rr r3�address_family�socket_type�server_bindr#rE)rrrZbind_and_activaterrrr �s�zTCPServer.__init__cCs8|jr|j�tjtjd�|j�|j�|j��|_dS)zOCalled by constructor to bind the socket.

        May be overridden.

        �N)�allow_reuse_addressr3�
setsockoptZ
SOL_SOCKETZSO_REUSEADDRZbindrZgetsocknamer"rrrr\�szTCPServer.server_bindcCs|j�|j�dSr!)r3Zlisten�request_queue_sizer"rrrr#�szTCPServer.server_activatecCs|j��dSrD)r3�closer"rrrrE�szTCPServer.server_closecCs
|j��S)zMReturn socket file number.

        Interface required by selector.

        )r3�filenor"rrrrb�szTCPServer.filenocCs
|j��S)zYGet the request and client address from the socket.

        May be overridden.

        )r3Zacceptr"rrrr9�szTCPServer.get_requestcCs4z|�tj�Wntk
r$YnX|�|�dSrF)r2r3ZSHUT_WRr:rHrIrrrr?�s
zTCPServer.shutdown_requestcCs|��dSrJ)rarIrrrrH�szTCPServer.close_requestN)T)rUrVrWrXr3ZAF_INETrZZSOCK_STREAMr[r`r^r r\r#rErbr9r?rHrrrrr�s-


c@s>eZdZdZdZejZdZdd�Z	dd�Z
dd	�Zd
d�ZdS)
rzUDP server class.Fi cCs |j�|j�\}}||jf|fSrQ)r3Zrecvfrom�max_packet_size)r�dataZclient_addrrrrr9szUDPServer.get_requestcCsdSrQrr"rrrr#szUDPServer.server_activatecCs|�|�dSrQrGrIrrrr?szUDPServer.shutdown_requestcCsdSrQrrIrrrrHszUDPServer.close_requestN)
rUrVrWrXr^r3Z
SOCK_DGRAMr[rcr9r#r?rHrrrrrscsVeZdZdZdZdZdZdZdd�dd	�Zd
d�Z	dd
�Z
dd�Z�fdd�Z�Z
S)rz5Mix-in class to handle each request in a new process.i,N�(TF��blockingc	Cs�|jdkrdSt|j�|jkrvz t�dd�\}}|j�|�Wqtk
r\|j��Yqtk
rrYqvYqXq|j�	�D]f}z.|r�dntj
}t�||�\}}|j�|�Wq�tk
r�|j�|�Yq�tk
r�Yq�Xq�dS)z7Internal routine to wait for children that have exited.N���r)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr%r:�copy�WNOHANG)rrg�pid�_�flagsrrr�collect_children(s&
zForkingMixIn.collect_childrencCs|��dS)zvWait for zombies after self.timeout seconds of inactivity.

            May be extended, do not override.
            N�rur"rrrr7KszForkingMixIn.handle_timeoutcCs|��dS)z�Collect the zombie child processes regularly in the ForkingMixIn.

            service_actions is called in the BaseServer's serve_forever loop.
            Nrvr"rrrr-RszForkingMixIn.service_actionscCs�t��}|r8|jdkrt�|_|j�|�|�|�dSd}z:z|�||�d}Wn t	k
rr|�
||�YnXW5z|�|�W5t�|�XXdS)z-Fork a new subprocess to process the request.Nr]r)rlr
rir&�addrH�_exitr?rCr=r>)rrArBrrZstatusrrrr<Ys 

zForkingMixIn.process_requestcst���|j|jd�dS)Nrf)�superrEru�block_on_closer"��	__class__rrrErs
zForkingMixIn.server_close)rUrVrWrXr4rirkrzrur7r-r<rE�
__classcell__rrr{rrs#cs8eZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�ZS)
�_Threadsz2
    Joinable list of all non-daemon threads.
    cs"|��|jrdSt��|�dSrQ)�reap�daemonry�append�r�threadr{rrr�{sz_Threads.appendcCsg|dd�|dd�<}|SrQr)r�resultrrr�pop_all�sz_Threads.pop_allcCs|��D]}|��qdSrQ)r��joinr�rrrr��sz
_Threads.joincCsdd�|D�|dd�<dS)Ncss|]}|��r|VqdSrQ)Zis_alive)�.0r�rrr�	<genexpr>�sz _Threads.reap.<locals>.<genexpr>rr"rrrr�sz
_Threads.reap)	rUrVrWrXr�r�r�rr}rrr{rr~ws
r~c@s eZdZdZdd�Zdd�ZdS)�
_NoThreadsz)
    Degenerate version of _Threads.
    cCsdSrQrr�rrrr��sz_NoThreads.appendcCsdSrQrr"rrrr��sz_NoThreads.joinN)rUrVrWrXr�r�rrrrr��sr�cs>eZdZdZdZdZe�Zdd�Zdd�Z	�fdd	�Z
�ZS)
rz4Mix-in class to handle each request in a new thread.FTc	CsHz6z|�||�Wn tk
r2|�||�YnXW5|�|�XdS)zgSame as in BaseServer but as a thread.

        In addition, exception handling is done here.

        N)r?rCr=r>r@rrr�process_request_thread�s
z%ThreadingMixIn.process_request_threadcCsL|jrt|��dt��tj|j||fd�}|j|_|j	�
|�|��dS)z*Start a new thread to process the request.�_threads)�targetrSN)rz�vars�
setdefaultr~rZThreadr��daemon_threadsr�r�r��start)rrArB�trrrr<�s�zThreadingMixIn.process_requestcst���|j��dSrQ)ryrEr�r�r"r{rrrE�s
zThreadingMixIn.server_close)rUrVrWrXr�rzr�r�r�r<rEr}rrr{rr�s

c@seZdZdS)rN�rUrVrWrrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZejZdS)rN�rUrVrWr3rrZrrrrr�sc@seZdZejZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r	a�Base class for request handler classes.

    This class is instantiated for each request to be handled.  The
    constructor sets the instance variables request, client_address
    and server, and then calls the handle() method.  To implement a
    specific service, all you need to do is to derive a class which
    defines a handle() method.

    The handle() method can find the request as self.request, the
    client address as self.client_address, and the server (in case it
    needs access to per-server information) as self.server.  Since a
    separate instance is created for each request, the handle() method
    can define other arbitrary instance variables.

    cCs6||_||_||_|��z|��W5|��XdSrQ)rArB�server�setup�finish�handle)rrArBr�rrrr �szBaseRequestHandler.__init__cCsdSrQrr"rrrr��szBaseRequestHandler.setupcCsdSrQrr"rrrr��szBaseRequestHandler.handlecCsdSrQrr"rrrr��szBaseRequestHandler.finishN)rUrVrWrXr r�r�r�rrrrr	�s

c@s0eZdZdZdZdZdZdZdd�Zdd	�Z	dS)
r
z4Define self.rfile and self.wfile for stream sockets.rhrNFcCsz|j|_|jdk	r |j�|j�|jr:|j�tjtjd�|j�	d|j
�|_|jdkrdt
|j�|_n|j�	d|j�|_dS)NT�rbr�wb)rAZ
connectionr4Z
settimeout�disable_nagle_algorithmr_r3ZIPPROTO_TCPZTCP_NODELAYZmakefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler"rrrr�s

�
zStreamRequestHandler.setupcCsF|jjs.z|j��Wntjk
r,YnX|j��|j��dSrQ)r��closed�flushr3�errorrar�r"rrrr�#s
zStreamRequestHandler.finish)
rUrVrWrXr�r�r4r�r�r�rrrrr
s	
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�z�Simple writable BufferedIOBase implementation for a socket

    Does not hold data in a buffer, avoiding any need to call flush().cCs
||_dSrQ)�_sock)rZsockrrrr 3sz_SocketWriter.__init__cCsdS)NTrr"rrr�writable6sz_SocketWriter.writablec
Cs2|j�|�t|��}|jW5QR�SQRXdSrQ)r�Zsendall�
memoryview�nbytes)r�bZviewrrr�write9s
z_SocketWriter.writecCs
|j��SrQ)r�rbr"rrrrb>sz_SocketWriter.filenoN)rUrVrWrXr r�r�rbrrrrr�.s
r�c@s eZdZdZdd�Zdd�ZdS)rz6Define self.rfile and self.wfile for datagram sockets.cCs2ddlm}|j\|_|_||j�|_|�|_dS)Nr)�BytesIO)�ior�rAZpacketr3r�r�)rr�rrrr�EszDatagramRequestHandler.setupcCs|j�|j��|j�dSrQ)r3Zsendtor��getvaluerBr"rrrr�KszDatagramRequestHandler.finishN)rUrVrWrXr�r�rrrrrAs)%rX�__version__r3r)rlrMrr�rr6r�__all__�hasattr�extendrr'ZSelectSelectorrrrr�listr~r�rrrrrrrrrr	r
r�rrrrr�<module>sbz�

�
n~
X(.-contextlib.cpython-38.opt-1.pyc000064400000047322151450073350012321 0ustar00U

e5d�a�@sjdZddlZddlZddlZddlmZddlmZddlm	Z	dddd	d
ddd
ddddgZ
Gdd
�d
ej�ZGdd�dej�Z
Gdd
�d
e�ZGdd�d�ZGdd�deee�ZGdd�dee
�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d$�d$�ZGd%d�dee�ZGd&d�dee
�ZGd'd	�d	e�ZdS)(z4Utilities for with-statement contexts.  See PEP 343.�N)�deque��wraps��
MethodType�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppressc@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz,An abstract base class for context managers.cCs|S�z0Return `self` upon entering the runtime context.���selfrr�"/usr/lib64/python3.8/contextlib.py�	__enter__sz AbstractContextManager.__enter__cCsdS�z9Raise any exception triggered within the runtime context.Nr�r�exc_type�	exc_value�	tracebackrrr�__exit__szAbstractContextManager.__exit__cCs|tkrt�|dd�StS)Nrr)r�_collections_abc�_check_methods�NotImplemented��cls�Crrr�__subclasshook__sz'AbstractContextManager.__subclasshook__N)
�__name__�
__module__�__qualname__�__doc__r�abc�abstractmethodr�classmethodr%rrrrrs
c@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz9An abstract base class for asynchronous context managers.c�s|Srrrrrr�
__aenter__'sz&AbstractAsyncContextManager.__aenter__c�sdSrrrrrr�	__aexit__+sz%AbstractAsyncContextManager.__aexit__cCs|tkrt�|dd�StS)Nr-r.)rrr r!r"rrrr%0s
�z,AbstractAsyncContextManager.__subclasshook__N)
r&r'r(r)r-r*r+r.r,r%rrrrr#s
c@s eZdZdZdd�Zdd�ZdS)rzJA base class or mixin that enables context managers to work as decorators.cCs|S)a6Return a recreated instance of self.

        Allows an otherwise one-shot context manager like
        _GeneratorContextManager to support use as
        a decorator via implicit recreation.

        This is a private interface just for _GeneratorContextManager.
        See issue #11647 for details.
        rrrrr�_recreate_cm;s
zContextDecorator._recreate_cmcst����fdd��}|S)Nc
s*�����||�W5QR�SQRXdS�N)r/��args�kwds��funcrrr�innerHs
z(ContextDecorator.__call__.<locals>.innerr)rr5r6rr4r�__call__GszContextDecorator.__call__N)r&r'r(r)r/r7rrrrr8sc@seZdZdZdd�ZdS)�_GeneratorContextManagerBasezBShared functionality for @contextmanager and @asynccontextmanager.cCsJ|||�|_||||_|_|_t|dd�}|dkr@t|�j}||_dS)Nr))�genr5r2r3�getattr�typer))rr5r2r3�docrrr�__init__Rs
z%_GeneratorContextManagerBase.__init__N)r&r'r(r)r=rrrrr8Osr8c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_GeneratorContextManagerz%Helper for @contextmanager decorator.cCs|�|j|j|j�Sr0)�	__class__r5r2r3rrrrr/fsz%_GeneratorContextManager._recreate_cmcCs<|`|`|`zt|j�WStk
r6td�d�YnXdS�Nzgenerator didn't yield)r2r3r5�nextr9�
StopIteration�RuntimeErrorrrrrrls
z"_GeneratorContextManager.__enter__c
Cs|dkr8zt|j�Wntk
r,YdSXtd��n�|dkrF|�}z|j�|||�Wn�tk
r�}z||k	WY�Sd}~XYnttk
r�}z4||kr�WY�&dS|tkr�|j|kr�WY�
dS�W5d}~XYn$t��d|kr�YdS�YnXtd��dS)NF�generator didn't stop�z#generator didn't stop after throw())rAr9rBrC�throw�	__cause__�sys�exc_info)rr;�valuer�excrrrrus.


z!_GeneratorContextManager.__exit__N)r&r'r(r)r/rrrrrrr>as	r>c@s eZdZdZdd�Zdd�ZdS)�_AsyncGeneratorContextManagerz Helper for @asynccontextmanager.c�s6z|j��IdHWStk
r0td�d�YnXdSr@)r9�	__anext__�StopAsyncIterationrCrrrrr-�sz(_AsyncGeneratorContextManager.__aenter__c
�s&|dkr>z|j��IdHWntk
r2YdSXtd��n�|dkrL|�}z"|j�|||�IdHtd��Wn�tk
r�}z||k	WY�Sd}~XYn�tk
r�}z:||kr�WY�,dSt|ttf�r�|j|kr�WY�
dS�W5d}~XYn0tk
�r }z||k	�r�W5d}~XYnXdS)NrDz$generator didn't stop after athrow()F)	r9rMrNrC�athrow�
isinstancerBrG�
BaseException)r�typrJrrKrrrr.�s.




z'_AsyncGeneratorContextManager.__aexit__N)r&r'r(r)r-r.rrrrrL�srLcst���fdd��}|S)a�@contextmanager decorator.

    Typical usage:

        @contextmanager
        def some_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        with some_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)r>r1�r5rr�helper�szcontextmanager.<locals>.helperr�r5rTrrSrr�scst���fdd��}|S)a�@asynccontextmanager decorator.

    Typical usage:

        @asynccontextmanager
        async def some_async_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        async with some_async_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)rLr1rSrrrTsz#asynccontextmanager.<locals>.helperrrUrrSrr�sc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r	a2Context to automatically close something at the end of a block.

    Code like this:

        with closing(<module>.open(<arguments>)) as f:
            <block>

    is equivalent to this:

        f = <module>.open(<arguments>)
        try:
            <block>
        finally:
            f.close()

    cCs
||_dSr0��thing)rrWrrrr=&szclosing.__init__cCs|jSr0rVrrrrr(szclosing.__enter__cGs|j��dSr0)rW�close)rrIrrrr*szclosing.__exit__N�r&r'r(r)r=rrrrrrr	sc@s(eZdZdZdd�Zdd�Zdd�ZdS)�_RedirectStreamNcCs||_g|_dSr0)�_new_target�_old_targets)r�
new_targetrrrr=2sz_RedirectStream.__init__cCs*|j�tt|j��tt|j|j�|jSr0)r\�appendr:rH�_stream�setattrr[rrrrr7sz_RedirectStream.__enter__cCstt|j|j���dSr0)r`rHr_r\�pop�r�exctype�excinst�exctbrrrr<sz_RedirectStream.__exit__)r&r'r(r_r=rrrrrrrZ.srZc@seZdZdZdZdS)raAContext manager for temporarily redirecting stdout to another file.

        # How to send help() to stderr
        with redirect_stdout(sys.stderr):
            help(dir)

        # How to write help() to a file
        with open('help.txt', 'w') as f:
            with redirect_stdout(f):
                help(pow)
    �stdoutN�r&r'r(r)r_rrrrr@sc@seZdZdZdZdS)rzCContext manager for temporarily redirecting stderr to another file.�stderrNrgrrrrrPsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra?Context manager to suppress specified exceptions

    After the exception is suppressed, execution proceeds with the next
    statement following the with statement.

         with suppress(FileNotFoundError):
             os.remove(somefile)
         # Execution still resumes here if the file was already removed
    cGs
||_dSr0)�_exceptions)r�
exceptionsrrrr=aszsuppress.__init__cCsdSr0rrrrrrdszsuppress.__enter__cCs|dk	ot||j�Sr0)�
issubclassrirbrrrrgs
zsuppress.__exit__NrYrrrrrVs
c@sheZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zde_dd�Z
ddd�ZdS)�_BaseExitStackz.A base class for ExitStack and AsyncExitStack.cCs
t||�Sr0r��cm�cm_exitrrr�_create_exit_wrapperwsz#_BaseExitStack._create_exit_wrappercs���fdd�}|S)Ncs����dSr0r�rrK�tb�r2�callbackr3rr�
_exit_wrapper}sz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapperr�rtr2r3rurrsr�_create_cb_wrapper{sz!_BaseExitStack._create_cb_wrappercCst�|_dSr0)r�_exit_callbacksrrrrr=�sz_BaseExitStack.__init__cCst|��}|j|_t�|_|S)z@Preserve the context stack by transferring it to a new instance.)r;rxr)r�	new_stackrrr�pop_all�s
z_BaseExitStack.pop_allcCsBt|�}z
|j}Wntk
r0|�|�YnX|�||�|S)aRegisters a callback with the standard __exit__ method signature.

        Can suppress exceptions the same way __exit__ method can.
        Also accepts any object with an __exit__ method (registering a call
        to the method instead of the object itself).
        )r;r�AttributeError�_push_exit_callback�
_push_cm_exit�r�exit�_cb_type�exit_methodrrr�push�s	
z_BaseExitStack.pushcCs(t|�}|j}|�|�}|�||�|S)z�Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        )r;rrr}�rrn�_cm_type�_exit�resultrrr�
enter_context�s

z_BaseExitStack.enter_contextcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|�|S)
z\Registers an arbitrary callback and arguments.

        Cannot suppress exceptions.
        �zBdescriptor 'callback' of '_BaseExitStack' object needs an argumentrtrN�4Passing 'callback' as keyword argument is deprecated��
stacklevelz8callback expected at least 1 positional argument, got %drE)	�len�	TypeErrorra�warnings�warn�DeprecationWarningrw�__wrapped__r|�r2r3rrtr�rurrrrt�s&

�
�
z_BaseExitStack.callback�#($self, callback, /, *args, **kwds)cCs|�||�}|�|d�dS)z;Helper to correctly register callbacks to __exit__ methods.TN)rpr|�rrnrorurrrr}�sz_BaseExitStack._push_cm_exitTcCs|j�||f�dSr0)rxr^)rrt�is_syncrrrr|�sz"_BaseExitStack._push_exit_callbackN)T)r&r'r(r)�staticmethodrprwr=rzr�r�rt�__text_signature__r}r|rrrrrlts

rlc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�Context manager for dynamic management of a stack of exit callbacks.

    For example:
        with ExitStack() as stack:
            files = [stack.enter_context(open(fname)) for fname in filenames]
            # All opened files will automatically be closed at the end of
            # the with statement, even if attempts to open files later
            # in the list raise an exception.
    cCs|Sr0rrrrrr�szExitStack.__enter__c
s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z||�rVd}d}d}Wq,t��}||d|d�d}|}Yq,Xq,|r�z|dj}	|d�Wn tk
r�|	|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0��__context__��new_exc�old_exc�exc_context��	frame_excrr�_fix_exception_context�sz2ExitStack.__exit__.<locals>._fix_exception_contextFT�NNN�rHrIrxrar�rQ)
r�exc_details�received_excr��suppressed_exc�
pending_raiser��cb�new_exc_details�	fixed_ctxrr�rr�s2

zExitStack.__exit__cCs|�ddd�dS�z%Immediately unwind the context stack.N)rrrrrrXszExitStack.closeN)r&r'r(r)rrrXrrrrr�s
1c@sfeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	de	_
d
d�Zdd�Zdd�Z
dd�ZdS)r
a�Async context manager for dynamic management of a stack of exit
    callbacks.

    For example:
        async with AsyncExitStack() as stack:
            connections = [await stack.enter_async_context(get_connection())
                for i in range(5)]
            # All opened connections will automatically be released at the
            # end of the async with statement, even if attempts to open a
            # connection later in the list raise an exception.
    cCs
t||�Sr0rrmrrr�_create_async_exit_wrapper&sz)AsyncExitStack._create_async_exit_wrappercs���fdd�}|S)Nc�s����IdHdSr0rrqrsrrru,sz>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperrrvrrsr�_create_async_cb_wrapper*sz'AsyncExitStack._create_async_cb_wrapperc�s.t|�}|j}|�|�IdH}|�||�|S)z�Enters the supplied async context manager.

        If successful, also pushes its __aexit__ method as a callback and
        returns the result of the __aenter__ method.
        N)r;r.r-�_push_async_cm_exitr�rrr�enter_async_context0s
z"AsyncExitStack.enter_async_contextcCsDt|�}z
|j}Wn tk
r2|�|d�YnX|�||�|S)a#Registers a coroutine function with the standard __aexit__ method
        signature.

        Can suppress exceptions the same way __aexit__ method can.
        Also accepts any object with an __aexit__ method (registering a call
        to the method instead of the object itself).
        F)r;r.r{r|r�r~rrr�push_async_exit<s
zAsyncExitStack.push_async_exitcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|d
�|S)zfRegisters an arbitrary coroutine function and arguments.

        Cannot suppress exceptions.
        r�zMdescriptor 'push_async_callback' of 'AsyncExitStack' object needs an argumentrtrNr�r�zCpush_async_callback expected at least 1 positional argument, got %drEF)	r�r�rar�r�r�r�r�r|r�rrr�push_async_callbackNs&

�
�z"AsyncExitStack.push_async_callbackr�c�s|�ddd�IdHdSr�)r.rrrr�aclosekszAsyncExitStack.aclosecCs|�||�}|�|d�dS)zLHelper to correctly register coroutine function to __aexit__
        method.FN)r�r|r�rrrr�osz"AsyncExitStack._push_async_cm_exitc�s|Sr0rrrrrr-uszAsyncExitStack.__aenter__c�s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z0|rP||�}n||�IdH}|rnd}d}d}Wq,t��}	||	d|d�d}|	}Yq,Xq,|r�z|dj}
|d�Wn tk
r�|
|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0r�r�r�rrr�~sz8AsyncExitStack.__aexit__.<locals>._fix_exception_contextFTr�r�)rr�r�r�r�r�r�r��cb_suppressr�r�rr�rr.xs8


zAsyncExitStack.__aexit__N)r&r'r(r)r�r�r�r�r�r�r�r�r�r-r.rrrrr
s

c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
r
aOContext manager that does no additional processing.

    Used as a stand-in for a normal context manager, when a particular
    block of code is only sometimes used with a normal context manager:

    cm = optional_cm if condition else nullcontext()
    with cm:
        # Perform operation, using optional_cm if condition is True
    NcCs
||_dSr0��enter_result)rr�rrrr=�sznullcontext.__init__cCs|jSr0r�rrrrr�sznullcontext.__enter__cGsdSr0r)r�excinforrrr�sznullcontext.__exit__)NrYrrrrr
�s

)r)r*rHr�collectionsr�	functoolsr�typesr�__all__�ABCrr�objectrr8r>rLrrr	rZrrrrlrr
r
rrrr�<module>sN��D�.!!`Eturtle.cpython-38.opt-2.pyc000064400000205521151450073350011463 0ustar00U

e5dd1�O@s2dZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlm
Z
ddlmZdddd	d
ddd
dg	Zdddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-gZd.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|gOZd}d~gZeeeedgZdd/d2d?dLdPdTdZd\dadbdddedpdudxdygZd�d�d�d�ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d��Zd�d��Zd�d��Zzee�Wnek
�red��YnXGd�d�de�Zd�d��Zd�d��Zd�Zd�d�d��ZGd�d�dej �Z!ee!ej"d��Gd�d��d�ej#�Z$ej"Z"Gd�d��d�e%�Z&Gd�d�de�Z'Gd�d��d�e�Z(Gd�d
�d
e%�Z)Gd�d��d�e%�Z*Gd�d�de&�Z+Gd�d��d�e%�Z,Gd�d��d�e%�Z-Gd�d��d�e%�Z.Gd�d	�d	e-e,�Z/e/Z0d�d�Z1Gd�d��d�e+�Z2Gd�d
�d
e/�Z3e3Z4d�d�d}�Z5d�d��Z6ed�Z7ze7d�k�rne6e7�Wn@e8k
�r�ed�e7�Yn"ek
�r�ed�e7�YnXd�d��Z9d�d„Z:d�dĄZ;d�Z<d�dDŽZ=e=ee2d�d�e;�e=ee3d�d�e:�e>Z?e@d�k�r.d�d΄ZAd�dЄZBd�d҄ZCeB�eC�eD�dS)�z-turtle 1.1b- - for Python 3.1   -  4. 5. 2009�N)�isfile�split�join)�deepcopy)�simpledialog�ScrolledCanvas�TurtleScreen�Screen�	RawTurtle�Turtle�RawPen�Pen�Shape�Vec2D�addshape�bgcolor�bgpic�bye�clearscreen�	colormode�delay�exitonclick�	getcanvas�	getshapes�listen�mainloop�mode�numinput�onkey�
onkeypress�onkeyrelease�
onscreenclick�ontimer�register_shape�resetscreen�
screensize�setup�setworldcoordinates�	textinput�title�tracer�turtles�update�
window_height�window_width�back�backward�
begin_fill�
begin_poly�bk�circle�clear�
clearstamp�clearstamps�clone�color�degrees�distance�dot�down�end_fill�end_poly�fd�	fillcolor�filling�forward�get_poly�getpen�	getscreen�
get_shapepoly�	getturtle�goto�heading�
hideturtle�home�ht�isdown�	isvisible�left�lt�onclick�ondrag�	onrelease�pd�pen�pencolor�pendown�pensize�penup�pos�position�pu�radians�right�reset�
resizemode�rt�seth�
setheading�setpos�setposition�settiltangle�
setundobuffer�setx�sety�shape�	shapesize�shapetransform�shearfactor�
showturtle�speed�st�stamp�tilt�	tiltangle�towards�
turtlesize�undo�undobufferentries�up�width�write�xcor�ycor�write_docstringdict�done�
Terminator��?g�?i�i,�standard��?�
i��classic�black�noresizeTZenglish�turtle�screenzPython Turtle GraphicsF)rz�height�	canvwidth�
canvheight�	leftright�	topbottomrrr�undobuffersizerkrWrAra�visible�language�
exampleturtle�
examplescreenr)�
using_IDLEc	Cs�t|d��}|��}W5QRXi}|D]�}|��}|r&|�d�rBq&z|�d�\}}Wn(tk
r|td||f�Yq&YnX|��}|��}|dkr�t|�}n4zd|kr�t|�}nt	|�}Wntk
r�YnX|||<q&|S)N�r�#�=zBad line in config-file %s:
%s)�True�False�Nonez''z""�.)
�open�	readlines�strip�
startswithr�
ValueError�print�eval�float�int)�filename�fZcfglines�cfgdict�line�key�value�r��/usr/lib64/python3.8/turtle.py�config_dict�s0



r�cCs�d}i}i}t|�rt|�}d|kr0d|d}ztt�\}}t||�}Wntk
rbd}YnXt|�rtt|�}t�|�t�|�dS)Nz
turtle.cfgZimportconfigz
turtle_%s.cfg�)rr�r�__file__r�	Exception�_CFGr,)r�Zdefault_cfgZcfgdict1Zcfgdict2�head�tailZ	cfg_file2r�r�r��
readconfig�s 


r�z"No configfile read, reason unknownc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)rcCst�|||f�S�N)�tuple�__new__)�cls�x�yr�r�r�r��sz
Vec2D.__new__cCs"t|d|d|d|d�S�Nr��r��self�otherr�r�r��__add__�sz
Vec2D.__add__cCsDt|t�r*|d|d|d|dSt|d||d|�Sr�)�
isinstancerr�r�r�r��__mul__�s
 z
Vec2D.__mul__cCs2t|t�st|t�r.t|d||d|�StSr�)r�r�r�r�NotImplementedr�r�r�r��__rmul__szVec2D.__rmul__cCs"t|d|d|d|d�Sr�r�r�r�r�r��__sub__sz
Vec2D.__sub__cCst|d|d�Sr�r��r�r�r�r��__neg__sz
Vec2D.__neg__cCs|dd|dddS)Nr�r�r�r�r�r�r�r��__abs__
sz
Vec2D.__abs__cCsjt|d|d�}|tjd}t�|�t�|�}}t|d||d||d||d|�S)Nr�r��f@)r�math�pi�cos�sin)r��angleZperp�c�sr�r�r��rotateszVec2D.rotatecCs|d|dfSr�r�r�r�r�r��__getnewargs__szVec2D.__getnewargs__cCsd|S)Nz(%.2f,%.2f)r�r�r�r�r��__repr__szVec2D.__repr__N)
�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�scCsTt|j�}|��|D]}t||�q|j��D]\}}t|�tjkr0|||<q0dSr�)	�list�	__bases__�reverse�__methodDict�__dict__�items�type�types�FunctionType)r��_dictZbaseListZ_superr�r�r�r�r�r�!s
r�cCsi}t||�|��Sr�)r��keys)r�r�r�r�r��	__methods+s
r�zTdef %(method)s(self, *args, **kw): return self.%(attribute)s.%(method)s(*args, **kw)r�cCs�i}t||�i}t|�}|��D]B}|dd�dksd|dd�dksd||ksd||krXq"||||<q"|��D]D\}}	||	d�}
t|t�r�t||d�}t||
�t|||
|�qndS)Nr��_���)�method�func)r�Z	attribute)	r�r�r�r�r��str�__stringBody�exec�setattr)Z	fromClassZtoClassZtoPartZexcludeZ_dict_1r�ZmfcZexr�r��dZ
execStringr�r�r��__forwardmethods5s
0

�
r�c@s`eZdZddd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�ZdS)r���^�Xc
Cs0tjj||||d�|��|_|||_|_|||_|_d|_	tj
||||j	tjdd�|_tj
||jjtjd�|_tj
||jjd�|_|jj|jj|jjd�|jdd	dd
�|jdd	dd
�|jjd	|d	ddd	d	dd�|jjd	|d	dd	d	d	dd�|jjd	|d	d	dd	d	dd�|��|j�d
|j�dS)N)rzr��whiter�)rzr��bgZreliefZborderwidth)�commandZorient)r�)ZxscrollcommandZyscrollcommandrr�)ZweightZminsize�news�ZpadxZin_Zpady�row�columnZrowspanZ
columnspanZstickyz<Configure>)�TK�Frame�__init__�winfo_toplevelZ_rootwindowrzr�r�r�r��CanvasZSUNKEN�_canvasZ	ScrollbarZxviewZ
HORIZONTAL�hscrollZyview�vscrollZ	configure�setZrowconfigureZcolumnconfigure�gridr`�bind�onResize)r��masterrzr�r�r�r�r�r�r�PsN

������zScrolledCanvas.__init__NcCs�|r
||_|r||_|r||_|jj||jd|jd|jd|jdfd�|j�d|j|jd|j�|j�d|j|jd|j�|�	�dS)Nr�)r��scrollregionr��)
r�r�r�r��config�xview_movetorz�yview_movetor��
adjustScrolls�r�r�r�r�r�r�r�r`is&����zScrolledCanvas.resetc
Cs�|j��}|j��}|j�d|j||j�|j�d|j||j�||jks`||jkr�|jjd|ddddddd�|j	jd|ddddddd�n|j�
�|j	�
�dS)Nr�r�rr�r�)r��winfo_width�winfo_heightr	r�r
r�r�rrZgrid_forget)r��cwidth�cheightr�r�r�r{s&

��
zScrolledCanvas.adjustScrollscCs|��dSr�)r)r��eventr�r�r�r�szScrolledCanvas.onResizecGs|jj|�Sr�)r��bbox�r��argsr�r�r�r�szScrolledCanvas.bboxcOs|jj||�Sr�)r��cget�r�r�kwargsr�r�r�r�szScrolledCanvas.cgetcOs|jj||�dSr�)r�rrr�r�r�r�szScrolledCanvas.configcOs|jj||�dSr�)r�rrr�r�r�r�szScrolledCanvas.bindcOs|jj||�dSr�)r��unbindrr�r�r�r�szScrolledCanvas.unbindcCs|j��dSr�)r��focus_forcer�r�r�r�r�szScrolledCanvas.focus_force)r�r�r�r�)NNN)
r�r�r�r�r`rrrrrrrrr�r�r�r�rJs�

r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�_RootcCstj�|�dSr�)r��Tkr�r�r�r�r�r��sz_Root.__init__cCs&t|||||�|_|jjddd�dS)Nr�Zboth)�expand�fill)rr�Zpack)r�rzr�rrr�r�r��setupcanvas�sz_Root.setupcanvascCs|jSr�)r�r�r�r�r��
_getcanvas�sz_Root._getcanvascCs|�d||||f�dS)Nz%dx%d%+d%+d)Zgeometry)r�rzr��startx�startyr�r�r��set_geometry�sz_Root.set_geometrycCs|�d|�dS)NZWM_DELETE_WINDOW)Zwm_protocol)r��destroyr�r�r��	ondestroy�sz_Root.ondestroycCs|��Sr�)Zwinfo_screenwidthr�r�r�r��	win_width�sz_Root.win_widthcCs|��Sr�)Zwinfo_screenheightr�r�r�r��
win_height�sz_Root.win_heightN)
r�r�r�r�rrr"r$r%r&r�r�r�r�r�src@s(eZdZdd�Zdd�Zdd�Zdd�ZdFdd�Zd
d�ZdGdd�Z	dd�Z
dd�Zdd�Zdd�Z
dHdd�Zdd�ZdIdd�ZdJd d!�ZdKd"d#�ZdLd$d%�Zd&d'�ZdMd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�ZdNd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dOdDdE�Z#d	S)P�TurtleScreenBasecCstjdd|jd�}|��|S)Nr�)rzr�r)r��
PhotoImage�cv�blank)r�Zimgr�r�r��_blankimage�szTurtleScreenBase._blankimagecCstj||jd�S)N)�filer)r�r(r))r�r�r�r�r��_image�szTurtleScreenBase._imagecCs�||_t|t�r"|jj}|jj}nJt|j�d��}t|j�d��}|jj|d|d|d|dfd�||_||_d|_|_	dS)Nrzr�r��rr�)
r)r�rr�r�r�rr�xscale�yscale)r�r)�w�hr�r�r�r��s

*zTurtleScreenBase.__init__cCs|jjdddd�S)N)rrrrrrr��r�outline)r)Zcreate_polygonr�r�r�r��_createpoly�szTurtleScreenBase._createpolyNFc
Cs�g}|D]*\}}	|�||j�|�|	|j�q|jj|f|��|dk	r^|jj||d�|dk	rv|jj||d�|dk	r�|jj||d�|r�|j�|�dS)N�r)r4�rz��appendr/r0r)�coordsZ
itemconfigureZ	tag_raise)
r�Zpolyitem�	coordlistrr4rz�top�clr�r�r�r�r��	_drawpoly�szTurtleScreenBase._drawpolyc	Cs|jjddddddtjd�S)Nrr�r�)rrzZcapstyle)r)Zcreate_liner�ZROUNDr�r�r�r��_createlines�zTurtleScreenBase._createlinec	Cs�|dk	rNg}|D]*\}}|�||j�|�||j�q|jj|f|��|dk	rf|jj||d�|dk	r~|jj||d�|r�|j�|�dS)Nr6r7r8)	r�Zlineitemr;rrzr<r=r�r�r�r�r��	_drawlines
zTurtleScreenBase._drawlinecCs|j�|�dSr�)r)�delete�r��itemr�r�r��_delete(szTurtleScreenBase._deletecCs|j��dSr�)r)r,r�r�r�r��_update.szTurtleScreenBase._updatecCs|j�|�dSr�)r)�after�r�rr�r�r��_delay3szTurtleScreenBase._delaycCs4z|j�|�}d}Wntjk
r.d}YnX|S)NTF)r)Z	winfo_rgbr�ZTclError)r�r9Zrgb�okr�r�r��_iscolorstring7s
zTurtleScreenBase._iscolorstringcCs0|dk	r |jj|d�|��n|j�d�SdS)N)r�r�)r)rrEr)r�r9r�r�r��_bgcolorAs
zTurtleScreenBase._bgcolorcCst|\}}||j}||j}dddd�}|jj|d||||||d�}	|j�|	�\}
}}}
|j��|	|dfS)N�swr�Zse)rP�centerr_r�)�text�anchorr�font)r/r0r)Zcreate_textrr,)r�r[�txt�alignrPrWr�r�rOrCZx0Zy0Zx1Zy1r�r�r��_writeJs

�
zTurtleScreenBase._writer�csD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)N�<Button-%s>cs:�j�|j��j�j�|j��j}}�||�dSr��r)�canvasxr�r/�canvasyr�r0�rr�r���funr�r�r��eventfunes�z+TurtleScreenBase._onclick.<locals>.eventfun�r)Z
tag_unbindZtag_bind�r�rCrZ�num�addr[r�rYr��_onclick\szTurtleScreenBase._onclickcsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)Nz<Button%s-ButtonRelease>cs:�j�|j��j�j�|j��j}}�||�dSr�rUrXrYr�r�r[ws�z-TurtleScreenBase._onrelease.<locals>.eventfunr\r]r�rYr��
_onreleaseks	�zTurtleScreenBase._onreleasecsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)Nz<Button%s-Motion>csTz:�j�|j��j�j�|j��j}}�||�Wntk
rNYnXdSr�)r)rVr�r/rWr�r0r�rXrYr�r�r[�s�z*TurtleScreenBase._ondrag.<locals>.eventfunr\r]r�rYr��_ondrag~s	zTurtleScreenBase._ondragcs@�dkr�j�d|�n"��fdd�}�j�d|||�dS)NrTcs:�j�|j��j�j�|j��j}}�||�dSr�rUrXrYr�r�r[�s�z1TurtleScreenBase._onscreenclick.<locals>.eventfun�r)rr)r�rZr^r_r[r�rYr��_onscreenclick�s	zTurtleScreenBase._onscreenclickcs>�dkr|j�d|d�n�fdd�}|j�d||�dS)Nz<KeyRelease-%s>cs
��dSr�r��r�rZr�r�r[�sz0TurtleScreenBase._onkeyrelease.<locals>.eventfunrc�r�rZr�r[r�rfr��
_onkeyrelease�szTurtleScreenBase._onkeyreleasecsn�dkr4|dkr |j�dd�qj|j�d|d�n6�fdd�}|dkrX|j�d|�n|j�d||�dS)Nz
<KeyPress>z
<KeyPress-%s>cs
��dSr�r�rerfr�r�r[�sz.TurtleScreenBase._onkeypress.<locals>.eventfunrcrgr�rfr��_onkeypress�szTurtleScreenBase._onkeypresscCs|j��dSr�)r)rr�r�r�r��_listen�szTurtleScreenBase._listencCs(|dkr|j�|�n|j�||�dS�Nr)r)Z
after_idlerF�r�rZ�tr�r�r��_ontimer�szTurtleScreenBase._ontimercCs|jjdd|d�S)Nr��image)r)Zcreate_image)r�rpr�r�r��_createimage�szTurtleScreenBase._createimagecCs<|\}}|j�|||j||jf�|jj||d�dS�Nro)r)r:r/r0�
itemconfig)r�rCr[rpr�r�r�r�r��
_drawimage�s zTurtleScreenBase._drawimagecCs |jj||d�|j�|�dSrr)r)rsZ	tag_lower)r�rCrpr�r�r��	_setbgpic�szTurtleScreenBase._setbgpiccCs|j�|�Sr�)r)r�rBr�r�r��_type�szTurtleScreenBase._typecs.|j�|���fdd�tdt��d�D�}|S)Ncs"g|]}�|�|df�qS)r�r���.0�i�r=r�r��
<listcomp>�sz/TurtleScreenBase._pointlist.<locals>.<listcomp>rr�)r)r:�range�len)r�rC�plr�rzr��
_pointlist�szTurtleScreenBase._pointlistcCs|jj||||fd�dS)Nr.)r)r)r��srx1�sry1�srx2�sry2r�r�r��_setscrollregion�sz!TurtleScreenBase._setscrollregionc	Cs||j��}|D]h}t|j�|��}g}|rd|dd�\}}|�||�|�||�|dd�}q&|jj|f|��qdS�Nr�)r)Zfind_allr�r:r9)	r�ZxscalefactorZyscalefactorr�rCZcoordinatesZnewcoordlistr�r�r�r�r��_rescale�s
zTurtleScreenBase._rescalecCszt|jt�s|j|jfS||kr6|kr6dkrJnn|jj|jjfS|dk	rX||_|dk	rf||_|j�|||�dSr�)r�r)rr�r�r`rr�r�r��_resizes"zTurtleScreenBase._resizecCs@|j��}|dkr|jd}|j��}|dkr8|jd}||fS)Nr�rzr�)r)r
r)r�rzr�r�r�r��_window_sizes



zTurtleScreenBase._window_sizecCs|jj��dSr�)r)Ztkrr�r�r�r�rs
zTurtleScreenBase.mainloopcCstj|||jd�S)N)�parent)rZ	askstringr))r�r)�promptr�r�r�r(.s
zTurtleScreenBase.textinputcCstj||||||jd�S)N)ZinitialvalueZminvalueZmaxvaluer�)rZaskfloatr))r�r)r��defaultZminvalZmaxvalr�r�r�r=s

�zTurtleScreenBase.numinput)NNNF)NNNF)N)r�N)r�N)r�N)r�N)N)NNN)NNN)$r�r�r�r+r-r�r5r>r?r@rDrErHrJrKrSr`rarbrdrhrirjrnrqrtrurvrr�r�r�r�rr(rr�r�r�r�r'�sR
�
�


	





r'c@seZdZdS)r�N�r�r�r�r�r�r�r�r�Ysc@seZdZdS)�TurtleGraphicsErrorNr�r�r�r�r�r�bsr�c@s eZdZddd�Zddd�ZdS)rNcCsz||_|dkr"t|t�rpt|�}nN|dkrVt|t�rp|���d�rpt|�rpt�	|�}n|dkrdg}nt
d|��||_dS)N�polygonrp�.gif�compoundzThere is no shape type %s)rvr�r�r�r��lower�endswithrrr-r��_data)r�Ztype_�datar�r�r�r�ns


zShape.__init__cCs:|jdkrtd|j��|dkr$|}|j�|||g�dS)Nr�z Cannot add component to %s Shape)rvr�r�r9)r��polyrr4r�r�r��addcomponent~s
�zShape.addcomponent)N)N)r�r�r�r�r�r�r�r�r�rgs
c@s@eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)�Tbufferr�cCs$||_dgg||_d|_d|_dS)Nr�F)�bufsize�buffer�ptr�cumulate)r�r�r�r�r�r��szTbuffer.__init__NcCsD|dkr&t|j�D]}dg|j|<qn||_dgg||_d|_dS)Nr�)r|r�r�r�)r�r�ryr�r�r�r`�sz
Tbuffer.resetcCsF|jdkrB|js0|jd|j|_||j|j<n|j|j�|�dSr�)r�r�r�r�r9rBr�r�r��push�s

zTbuffer.pushcCsJ|jdkrF|j|j}|dkr"dSdg|j|j<|jd|j|_|SdSr�)r�r�r�rBr�r�r��pop�s
zTbuffer.popcCs|j|j�dg�Sr�)r�r��countr�r�r�r��nr_of_items�szTbuffer.nr_of_itemscCst|j�dt|j�S)N� )r�r�r�r�r�r�r�r��szTbuffer.__repr__)r�)N)	r�r�r�r�r`r�r�r�r�r�r�r�r�r��s

	r�c@seZdZdZedededfdd�Zdd�Zd<d
d�Zdd
�Zd=dd�Z	dd�Z
dd�Zd>dd�Zdd�Z
dd�Zdd�Zd?dd�Zd@dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdAd-d.�Zd/d0�ZdBd1d2�ZdCd3d4�ZdDd6d7�ZdEd8d9�ZdFd:d;�ZeZe
Z eZ!e	Z"eZ#d	S)GrTrrrc
Cs�t�||�tdd�tdd�tdd�tdd�tdd�tdd�td|���d	�|_d
di|_||_||_td|_	g|_
|��tj
d
kr�|��}|�ddddd�|�ddddd�dS)Nr�)����r�r�r�rr�))r�)����)r�r�)����)����	)����)����)r�r�)������)���r�)r�r�)r�r��rr�)�r�)�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�)��Q�#@���Q�@)�G�z. @��Q��@)r�r�)r�r�r�)���Q��r�)��Q���r�)�G�z. �r�)��Q�#�r�r�)r�r�)r�r�)r�r�)r�r�)g�g$�)r�r�)r�r�)r�r�)r�r�))r�r�)r�r�)r�r�)r�r�))r���G�z�)rg�����'@)r�r�)�rr)r�r�r�)r�r�rp)Zarrowr�r4ZsquareZtriangler�r*�nopicr�r�darwinZwmZ
attributesr�z-topmost�1�0)r'r�rr+�_shapes�_bgpics�_mode�_delayvaluer��
_colormode�_keysr5�sys�platformr�Zcall)r�r)rrrZ
rootwindowr�r�r�r��s&�


zTurtleScreen.__init__cCs�td|_td|_|�d�|�d�|_d|_d|_d|_g|_	|�
d�d	D]}|�d|�qP|�d�|j
dd�D]}|�d|�|�d|�qzdt_dS)
Nrr�allr�r�r�rr�)r�r��)r�r�r�rDrq�_bgpic�
_bgpicname�_tracing�_updatecounter�_turtlesrrRrr�rr�_pen)r��btnr�r�r�r�r5�s 




zTurtleScreen.clearNcCs||dkr|jS|��}|dkr*td|��||_|dkrp|�|jd|jd|jd|jd�d|_|_|��dS)N�r��logo�worldzNo turtle-graphics-mode %s)r�r�r�r�)	r�r�r�r�r�r�r/r0r`�r�rr�r�r�rs�zTurtleScreen.modecCs�|��dkr|�d�t||�}t||�}|��\}}|�|d|d�|j|j}	}
|j||_|j||_||j}||j}|j|}
|j|}|�|||
|�|�	|j|	|j|
�|�
�dS)Nr��)rr�r�r%r/r0r�r�r�r�r,)r�ZllxZllyZurxZuryZxspanZyspanZwxZwyZ	oldxscaleZ	oldyscaler�r�r�r�r�r�r�r'-s 



z TurtleScreen.setworldcoordinatescCsT|dkr2|���d�r(td|�|��}qFtd��nt|t�rFtd|�}||j|<dS)Nr�rpz;Bad arguments for register_shape.
Use  help(register_shape)r�)r�r�rr-r�r�r�r�)r��namerkr�r�r�r#Ts


zTurtleScreen.register_shapec	Cst|�dkr|d}t|t�rD|�|�s0|dkr4|Stdt|���z|\}}}Wn(ttfk
rztdt|���YnX|jdkr�dd�|||fD�\}}}d|kr�d	kr�nn.d|kr�d	kr�nnd|kr�d	ks�ntd
t|���d|||fS)Nr�rr�zbad color string: %s�bad color arguments: %sr�cSsg|]}td|��qS�g�o@��round�rxr�r�r�r�r{�sz*TurtleScreen._colorstr.<locals>.<listcomp>��bad color sequence: %s�
#%02x%02x%02x)r}r�r�rJr��	TypeErrorr�r�)r�r9r��g�br�r�r��	_colorstrws


FzTurtleScreen._colorstrcsx��d�s�St��dkr.�fdd�dD�}n4t��dkrV�fdd��dd�D�}ntd	���t�fd
d�|D��S)Nr�r�cs"g|]}t�||d�d��qS)r�r��r�rw��cstrr�r�r{�sz'TurtleScreen._color.<locals>.<listcomp>)r�r�r�r�csg|]}dt�|d��qS)r�r�)rxr2r�r�r�r{�sr�zbad colorstring: %sc3s|]}|�jdVqdS)r�N)r�)rxr�r�r�r��	<genexpr>�sz&TurtleScreen._color.<locals>.<genexpr>)r�r}r�r�)r�r�r=r�)r�r�r��_color�s
zTurtleScreen._colorcCs8|dkr|jS|dkr"t|�|_n|dkr4t|�|_dS)Nr�r�)r�r�r�)r�Zcmoder�r�r�r�szTurtleScreen.colormodecCs$|jD]}|�|j�|��qdSr�)r��_setmoder�r`)r�r�r�r�r�r`�s
zTurtleScreen.resetcCs|jSr�)r�r�r�r�r�r+�szTurtleScreen.turtlescGs4|r|�|�}nd}|�|�}|dk	r0|�|�}|Sr�)r�rKr��r�rr9r�r�r�r�s

zTurtleScreen.bgcolorcCsB|dkr|jSt|�|_d|_|dk	r0t|�|_|jr>|��dSrk)r�r�r�r�r,)r��nrr�r�r�r*�s

zTurtleScreen.tracercCs|dkr|jSt|�|_dSr�)r�r�rGr�r�r�r�szTurtleScreen.delaycCs<tjsdt_t�|jdkr8|jd7_|j|j;_dS)NTrr�)r�_RUNNINGr�r�r�r�r�r�r��
_incrementudc	s
zTurtleScreen._incrementudccCs<|j}d|_|��D]}|��|��q||_|��dS�NT)r�r+�_update_data�_drawturtlerE)r��tracingrmr�r�r�r,s
zTurtleScreen.updatecCs|��dSrk�r�r�r�r�r�r.szTurtleScreen.window_widthcCs|��dS�Nr�r�r�r�r�r�r-&szTurtleScreen.window_heightcCs|jSr�)r)r�r�r�r�r/s
zTurtleScreen.getcanvascCst|j���Sr�)�sortedr�r�r�r�r�r�r;s	zTurtleScreen.getshapesr�cCs|�|||�dSr�)rd�r�rZr�r_r�r�r�rRFszTurtleScreen.onclickcCsF|dkr ||jkr6|j�|�n||jkr6|j�|�|�||�dSr�)r��remover9rh�r�rZr�r�r�r�rWs

zTurtleScreen.onkeycCsN|dkr ||jkr>|j�|�n|dk	r>||jkr>|j�|�|�||�dSr�)r�r�r9rir�r�r�r�rus
zTurtleScreen.onkeypresscCs|��dSr�)rj)r��xdummy�ydummyr�r�r�r�s
zTurtleScreen.listenrcCs|�||�dSr�)rnrlr�r�r�r"�szTurtleScreen.ontimercCsF|dkr|jS||jkr(|�|�|j|<|�|j|j|�||_dSr�)r�r�r-rur�)r�Zpicnamer�r�r�r�s
zTurtleScreen.bgpiccCs|�|||�Sr�)r�rr�r�r�r%�szTurtleScreen.screensize)N)N)N)NN)N)r�N)N)NN)r)N)NNN)$r�r�r�r�r�r�r5rr'r#r�r�rr`r+rr*rr�r,r.r-rrrRrrrr"rr%r!r$rrr r�r�r�r�r�sF�
(
"'
#
	

			

 



c@sPeZdZedd�edd�edd�d�ZdZdZdZefdd�Zd	d
�Z	dAdd
�Z
dd�ZdBdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdCd)d*�Zd+d,�Zd-d.�Zd/d0�ZdDd1d2�ZdEd3d4�Zd5d6�Zd7d8�ZdFd9d:�Z dGd;d<�Z!dHd=d>�Z"dId?d@�Z#eZ$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,dS)J�
TNavigatorr��)r�r�r�r�rr�cCsB|j|_|j|_||_d|_|��d|_|�|�t�	|�dSr�)
�DEFAULT_ANGLEOFFSET�_angleOffset�DEFAULT_ANGLEORIENT�_angleOrientr��
undobufferr:r�r�r`r�r�r�r�r��s
zTNavigator.__init__cCstdd�|_tj|j|_dS)Nr�)r�	_positionr��START_ORIENTATIONr��_orientr�r�r�r�r`�szTNavigator.resetNcCsL|dkr|jS|dkrdS||_|dkr6d|_d|_n|jd|_d|_dS)Nr�)r�r�rr��@r�)r�rr�_fullcircler�r�r�r�r�szTNavigator._setmodecCs0||_d||_|jdkr"d|_n
|d|_dS)Nihr�rr)r�
_degreesPerAUr�r�r�Z
fullcircler�r�r��_setDegreesPerAUs


zTNavigator._setDegreesPerAU��v@cCs|�|�dSr�)rr
r�r�r�r:szTNavigator.degreescCs|�dtj�dSr�)rr�r�r�r�r�r�r^5szTNavigator.radianscCs|j|j|}|�|�dSr�)rr�_goto)r�r;Zender�r�r��_goCszTNavigator._gocCs||j9}|j�|�|_dSr�)r	rr��r�r�r�r�r��_rotateHs
zTNavigator._rotatecCs
||_dSr��r)r��endr�r�r�r
MszTNavigator._gotocCs|�|�dSr��r�r�r;r�r�r�rCQszTNavigator.forwardcCs|�|�dSr�rrr�r�r�r/hszTNavigator.backcCs|�|�dSr��rrr�r�r�r_|szTNavigator.rightcCs|�|�dSr�rrr�r�r�rP�szTNavigator.leftcCs|jSr�rr�r�r�r�r[�szTNavigator.poscCs
|jdSrkrr�r�r�r�r|�szTNavigator.xcorcCs
|jdSr�rr�r�r�r�r}�szTNavigator.ycorcCs,|dkr|�t|��n|�t||��dSr�)r
r)r�r�r�r�r�r�rI�szTNavigator.gotocCs|�dd�|�d�dSrk)rIrdr�r�r�r�rL�szTNavigator.homecCs|�t||jd��dSr��r
rr)r�r�r�r�r�riszTNavigator.setxcCs|�t|jd|��dSrkr)r�r�r�r�r�rjszTNavigator.setycCsT|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}t||j�Sr�)rr�r�r�r�abs)r�r�r�r[r�r�r�r;%s




zTNavigator.distancecCs�|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}||j\}}tt�||�dtjd�d}||j	}|j
|j||jS�Nr�r�r)
rr�r�r�rr�r��atan2r�r	rrr)r�r�r�r[�resultr�r�r�ruEs




 
zTNavigator.towardscCsJ|j\}}tt�||�dtjd�d}||j}|j|j||jSr)	rr�r�rr�r	rrr)r�r�r�rr�r�r�rJhs

 
zTNavigator.headingcCs>||��|j}|j}||d||d}|�|�dS)N�@)rJrrr)r�Zto_angler�Zfullr�r�r�rdwszTNavigator.setheadingcCsp|jr|j�dg�d|j_|��}|dkr2|j}|dkrjt|�|j}dttdt|�dd�|�}d||}d|}d	|t�	|tj
d
|j�}|dkr�|||}}}|��}	|�
�}
|dkr�|�dd�n
|�d�|�|�t|�D].}|�|�|�|�|�d�|�|��q|�|�|dk�rR|�|	|
�|�|�|j�rld|j_dS)
N�seqTr��g@g�M@r�r�rr�rF)rr�r�rprrr��minr�r�r�r	�_tracerrHrr|r)r��radiusZextent�stepsrpZfracr1Zw2�lZtrZdlryr�r�r�r4�s>""






zTNavigator.circlecCsdSr�r�)r�r�r�r�r�rp�szTNavigator.speedcCsdSr�r�)r��ar�r�r�r�r�szTNavigator._tracercCsdSr�r�)r�r�r�r�r�rH�szTNavigator._delay)N)r)N)N)N)NN)r)NN)N)-r�r�r�rrZDEFAULT_MODEr�rr�r`r�rr:r^rrr
rCr/r_rPr[r|r}rIrLrirjr;rurJrdr4rprrHr@r3r0rbrQr\rerfrcr�r�r�r�r��sX�

	


#
 
#
A


r�c@s�eZdZedfdd�Zededfdd�Zd-d	d
�Zd.dd�Zd
d�Zdd�Z	dd�Z
d/dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd0d!d"�Zd1d$d%�Zd2d'd(�Zd)d*�Zd+d,�ZeZeZeZe	Ze	ZeZeZdS)3�TPenracCs||_d|_t�|�dSr�)�_resizemoderr$�_reset)r�rar�r�r�r��sz
TPen.__init__rWrAcCsFd|_d|_||_||_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr�Tr�)r�r�r�)r�r�r�r�)�_pensize�_shown�	_pencolor�
_fillcolor�_drawing�_speed�_stretchfactor�_shearfactor�_tilt�_shapetrafo�
_outlinewidth)r�rWrAr�r�r�r&�szTPen._resetNcCs.|dkr|jS|��}|dkr*|j|d�dS)N)�auto�userr��ra)r%r�rV)r�Zrmoder�r�r�ra�s
zTPen.resizemodecCs|dkr|jS|j|d�dS)N)rY)r'rV)r�rzr�r�r�rYszTPen.pensizecCs|js
dS|jdd�dS)NF�rX�r+rVr�r�r�r�rZ0s
z
TPen.penupcCs|jr
dS|jdd�dS)NTr5r6r�r�r�r�rX>s
zTPen.pendowncCs|jSr�)r+r�r�r�r�rNLs
zTPen.isdowncCsjdddddd�}|dkr|jS||kr0||}n*d|krDdkrVnntt|��}nd}|j|d	�dS)
Nrr�r�r�r�)ZfastestZfast�normalZslowZslowestr�g%@)rp)r,r�r�rV)r�rpZspeedsr�r�r�rp[s
z
TPen.speedcGs�|rht|�}|dkr"|d}}n"|dkr4|\}}n|dkrD|}}|�|�}|�|�}|j||d�n|�|j�|�|j�fSdS)Nr�rr�r�)rWrA)r}r�rVr�r)r*)r�rr"ZpcolorZfcolorr�r�r�r9�s 


z
TPen.colorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)N)rW)r�r)rVr�r�r�r�r�rW�s

z
TPen.pencolorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)N)rA)r�r*rVr�r�r�r�r�rA�s

zTPen.fillcolorcCs|jdd�dS)NT��shown�rVr�r�r�r�ro�szTPen.showturtlecCs|jdd�dS)NFr8r:r�r�r�r�rK	szTPen.hideturtlecCs|jSr�)r(r�r�r�r�rO	s
zTPen.isvisiblecKs�|j|j|j|j|j|j|j|j|j|j	|j
d�}|s>|s>|St|t�rN|}ni}|�
|�i}|D]}||||<qd|jr�|j�d|f�d}d|kr�|j|dkr�d}d|kr�t|dt�r�|�|df�|d<|j|dkr�d}d|k�r|j|dk�rd}|�r|��d|k�r&|d|_d|k�r:|d|_d|k�rN|d|_d|k�r�t|dt��r||�|df�|d<|d|_d	|k�r�|d	|_d
|k�r�|d
|_d|k�r�|d}t|ttf��r�||f}||_d|k�r�|d|_d
|k�r|d
|_	d|k�r|d|_d|k�r.|d|_
d|k�sLd|k�sLd|k�r�|j\}	}
|j}t�|j
�t�|j
�}}
|	|
|
||
||	||
|
||f|_|��dS)N)r9rXrWrArYrpra�
stretchfactorrnr4rsrVFrXTrWrYrArprar;rnr4r9rs)r(r+r)r*r'r,r%r-r.r1r/r��dictr,rr�r�r��_newLiner�r�r�r�r�r0rE)r�rVZpendictZ_pd�pZ_p_bufr�ZnewLineZsfZscxZscyZshf�sa�car�r�r�rV!	s�/�

























�zTPen.penTcCsdSr�r��r�ZusePosr�r�r�r=�	sz
TPen._newLineFcCsdSr�r�)r�r�Zforcedr�r�r�rE�	szTPen._updatecCsdSr�r�rr�r�r�r��	szTPen._colorcCsdSr�r�rr�r�r�r��	szTPen._colorstr)N)N)N)N)T)TF)r�r�r�r�r�r&rarYrZrXrNrpr9rWrArorKrOrVr=rEr�r�rzryr]rUr=rqrMr�r�r�r�r$�s8�



&.%$



r$c@seZdZdd�Zdd�ZdS)�_TurtleImagecCs||_d|_|�|�dSr�)r�rv�	_setshape)r�r��
shapeIndexr�r�r�r��	sz_TurtleImage.__init__cs�|j�||_|jdkr*�j|jkr2nndS|jdkrP�j|jkrXnndS|jdkrp��|j�n |jdkr�|jD]}��|�q��j|j|_|jdkr����|_nF|jdkrԈ��jdj�|_n&|jdkr��fdd��j|jD�|_dS)Nr�rp)rpr�r�r*csg|]}����qSr��r5�rxrC�r�r�r�r{�	sz*_TurtleImage._setshape.<locals>.<listcomp>)	r�rDrvr�rD�_itemr5rqr�)r�rDrCr�rGr�rC�	s(""







�z_TurtleImage._setshapeN)r�r�r�r�rCr�r�r�r�rB�	srBc@s�eZdZgZdedededfdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdldd�Z
dd�Zdd�Zdd�Zdd�Zdmdd �Zdnd!d"�Zdod#d$�Zd%d&�Zdpd'd(�Zd)d*�Zdqd+d,�Zd-d.�Zd/d0�Zdrd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zdsd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dtdEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dudMdN�Z(dOdP�Z)dvdSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/e/Z0dwd_d`�Z1dxdbdc�Z2dyddde�Z3dzdfdg�Z4dhdi�Z5djdk�Z6eZ7dS){r
Nrkr�r�cCs4t|t�r||_n|t|t�r:|tjkr2tj�|�||_nTt|ttf�r�tjD]}|j	|krN||_q�qNt|�|_tj�|j�nt
d|��|j}t�||�
��t�|�|j�|�|��|_t||�|_d|_d|_d|_|_||_d|_|��|_|jg|_|jg|_g|_||_t |�|_!|�"�dS)Nzbad canvas argument %sF)#r��_Screenr�rr
�screensr9rr�r)r�r�r�rr$r�r?�drawingLineItemrBr��_poly�
_creatingPoly�	_fillitem�	_fillpathr(�_hidden_from_screen�currentLineItemr�currentLiner��
stampItems�_undobuffersizer�rrE)r�Zcanvasrkr�r�r�r�r�r�r��	s@











zRawTurtle.__init__cCs0t�|�t�|�|��|��|��dSr�)r�r`r$r&�_clearr�rEr�r�r�r�r`
s


zRawTurtle.resetcCs&|dks|dkrd|_n
t|�|_dSrk)rr�)r��sizer�r�r�rh
szRawTurtle.setundobuffercCs|jdkrdS|j��Srk)rr�r�r�r�r�rx,
s	
zRawTurtle.undobufferentriescCsld|_|_|jD]}|j�|�q|j��|_g|_|jrJ|j�	|j
�|jg|_|��|�|j
�dSr�)rNrOr�r�rDr?rQrRr+r9rr7rhrTrBr�r�r�rU9
s

zRawTurtle._clearcCs|��|��dSr�)rUrEr�r�r�r�r5G
szRawTurtle.clearcCsF|j��|jjdkrdSt|j�dkrB|j�|j|j|j|j�dSr�)	r�r�r�r}rRr@rQr)r'r�r�r�r�r�V
s
�zRawTurtle._update_datacCsx|j}|jdkrdS|jdkrD|��|��|��|�|j�n0|��|jdkrt|��D]}|��q^|��dSr�)	r�r�r�r�rErHr�r�r+)r�r�rmr�r�r�rE^
s



zRawTurtle._updatecCs|j�||�Sr�)r�r*)r��flagrr�r�r�rp
szRawTurtle._tracercCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorcCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorstrc	Cs�t|t�r|Sz|\}}}Wn(ttfk
rDtdt|���YnX|jjdkrldd�|||fD�\}}}d|kr�dkr�nn.d|kr�dkr�nnd|kr�dks�ntdt|���d|||fS)	Nr�r�cSsg|]}td|��qSr�r�r�r�r�r�r{�
sz!RawTurtle._cc.<locals>.<listcomp>rr�r�r�)r�r�r�r�r�r�r�)r�rr�r�r�r�r�r��_cc�
s
Fz
RawTurtle._cccs�|j�|�|j�|j}d|_d|_t|�}�|_||_�|_t�|jj�|_�j�|��j	|jjj
}|dkr����|j_nJ|dkr���
�j	dj�|j_n*|dkrʇfdd��j	|jjjD�|j_���|_|��|S)Nr�rpr*r�csg|]}����qSr�rErFrGr�r�r{�
sz#RawTurtle.clone.<locals>.<listcomp>)r�r=r+r�rrBrDr�r9r�rvr5rHrqr�r?rQrE)r�r��q�ttyper�rGr�r8�
s.
�

zRawTurtle.clonecCsB|dkr|jjS||j��kr*td|��|j�|�|��dS)NzThere is no shape named %s)r�rDr�rr�rCrE)r�r�r�r�r�rk�
szRawTurtle.shapecCs�||kr|krdkr8nn|j\}}|||jfS|dksH|dkrPtd��|dk	rt|dkrj||f}q�||f}n|dk	r�|jd|f}n|j}|dkr�|j}|jd||d�dS)Nrz(stretch_wid/stretch_len must not be zeror3)rar;r4)r-r1r�rV)r�Zstretch_widZstretch_lenr4r;r�r�r�rl�
s$"


�zRawTurtle.shapesizecCs |dkr|jS|jd|d�dS)Nr3)rarn)r.rV)r�Zshearr�r�r�rnszRawTurtle.shearfactorcCs<||j|j}|tjddtj}|jd|d�dS)Nr�r�r3)rars)r	rr�r�rV�r�r�rsr�r�r�rgszRawTurtle.settiltanglecCs>|dkr0|jdtj|j}||j|jS|�|�dS)Nr�)r/r�r�rr	rrgr[r�r�r�rt4szRawTurtle.tiltanglecCs|�||���dSr�)rgrtrr�r�r�rsNszRawTurtle.tiltcCs6||kr(|kr(|kr(dkr2nn|jS|j\}}}}|dk	rL|}|dk	rX|}|dk	rd|}|dk	rp|}||||dkr�td��||||f|_t�||�dtj}	t�|	�t�|	�}
}|||
||||
||
||||
|||f\}}
}}||f|_|
||_|	|_	|j
dd�dS)Nrz0Bad shape transform matrix: must not be singularr�r3r4)r0r�r�rr�r�r�r-r.r/rV)r��t11�t12�t21�t22Zm11Zm12Zm21Zm22Zalfar?r@Za11Za12Za21Za22r�r�r�rmas0,�

zRawTurtle.shapetransformcs^|j�|j\��|j\��t���j�j�}dt|�|\�������fdd�|D�S)Nr�csFg|]>\}}��|�|�j��|�|�jf�qSr�)r/r0�rxr�r��Ze0Ze1Zp0Zp1r�r�r�r{�s�z(RawTurtle._polytrafo.<locals>.<listcomp>)r�rrrr0r/r)r�r��er�rar��
_polytrafo�s

�zRawTurtle._polytrafocCs2|jj|jj}|jdkr.|�|j|jdk�SdS)Nr�r�)r�r�r�rDrv�
_getshapepolyr�)r�rkr�r�r�rG�s
zRawTurtle.get_shapepolyFcsx|jdks|r|j\����n>|jdkrNtd|jd�}|dd|f\����n|jdkr\|St����fdd�|D��S)	Nr3r2r�g@rr�c3s2|]*\}}�|�|�|�|fVqdSr�r�r`�r\r]r^r_r�r�r��sz*RawTurtle._getshapepoly.<locals>.<genexpr>)r%r0�maxr'r�)r�r�r�r"r�rer�rd�s

zRawTurtle._getshapepolyc	Cs�|j}|j|jj}|j}|jj}|j�r*|jdk�r*|jdk�r*d|_	|j
}|dkr�|jdkrfd}n|jdkrx|j}n|j
}|�|�|��}|j|j}}|j|||||dd�nt|d	kr�|�||j|�nZ|d
k�r�t||�D]D\}	\}
}}|�|�|
d��}
|j|	|
|�|�|�|�|j
dd�q�nx|j	�r6dS|dk�rR|�|ddd�nJ|d	k�rv|�||j|jd
j
�n&|d
k�r�|D]}	|�|	ddd��q�d|_	dS)NrFr�r�r�r2T�rr4rzr<rpr��r�r�r�r�r*)r�r�r�rDrvrHr(r�r�rPr�r%r'r1rcrdr*r)r>rtr�ziprX)r�r�rkrZZtitem�tshaper1�fc�ocrCr�r�r�r�r��sR 

�
�




�
zRawTurtle._drawturtlec	CsT|j}|j|jj}|j}|j}|dkr�|��}|jdkr@d}n|jdkrR|j}n|j	}|�
|�|��}|j|j
}}|j|||||dd�n�|dkr�|�d�}|�||j|�n�|d	k�r4g}|D]}	|��}
|�|
�q�t|�}t||�D]D\}
\}}}|�
|�|d��}|j|
||�|�|�|�|j	dd�q�|j�|�|j�d
|f�|S)Nr�r�r�r2Trgrpr�r�rr)r�r�r�rDrvr�r5r%r'r1rcrdr*r)r>rqrtrr9r�rirXrSrr�)r�r�rkrZrj�stitemr1rkrlZelementrCr�r�r�r�rr�sH

�

�zRawTurtle.stampcCs�||jkrDt|t�r,|D]}|j�|�qn|j�|�|j�|�d|f}|j}||jkr`dS|j�|�}|j�|�||j	kr�|j	d|j
|_	|j�|j	d|j
dg�dS)Nrrr�)rSr�r�r�rDr�rr��indexr�r��insert)r��stampidZsubitemrCZbufrnr�r�r��_clearstamps



zRawTurtle._clearstampcCs|�|�|��dSr�)rqrE)r�rpr�r�r�r6s
zRawTurtle.clearstampcCs^|dkr|jdd�}n&|dkr0|jd|�}n|j|d�}|D]}|�|�qB|��dSrk)rSrqrE)r�r�ZtoDeleterCr�r�r�r7-szRawTurtle.clearstampsc
Cs�|j|j|jt|jt�f}|j}d|j|||j|j	dd�|�
|j�|jdd�ff}|jrh|j�
|�|j}|j�rZ|jdk�rZ||}|d|jd|d|jd}dt|ddd|j|j�}|d|}	td|�D]R}
|
dkr�d	}nd
}||	|
|_|j�r2|�|j||jf|j|j|�|��q�|j�rZ|j|jdd|jd
�|j�rn|j	�|�t|jt��r�|j�|�||_|j�r�|j�|�t|j	�dk�r�|��|��dS)N�gor�rr�r�r�皙�����?r�TF�r�r�r��rrz�*)r+r)r'r�rOr�r�rrQrRrr�rr�r,r�r/r0r�r|r@rKrEr9rMrLr}r=)r�r�go_modesr�Z
undo_entry�start�diff�diffsq�nhops�deltar�r<r�r�r�r
Isb
�

��$$�

�zRawTurtle._gotocs|\}}}}|\}}}}	|\}
}}�|j�t|j|�dkrDtd�|
|_||_|ddgkrbd}
n|}
�j|
||
|d���fdd�|jD�}|D]}��|�|j�	|�q�|}|j
�r��jdk�r�||}|d	�jd
|d�j
d
}dt|ddd|j
|j
�}|d
|}td|�D]P}|dk�r@d}nd}||||_|�rr��|j||jf|||�|���q,|�r��j|jdd|d�||_|j�r�t|j�d	k�r�|j��|jgk�r�d|_d|_|	�r|jgk�r�d|_td�n|jdk	�r|j��|��dS)Nr�z$undogoto: HALLO-DA-STIMMT-WAS-NICHT!r�r�rucs&g|]}|�kr��|�dkr|�qS)r�)rvrw�r�r�r�r�r{�s�z'RawTurtle._undogoto.<locals>.<listcomp>r�rr�r�rsr�TFrtzUnwahrscheinlich in _undogoto!)r�rrr�rQrRr@r�rDr�r,r�r/r0r�r|rKrErMr}rLr�rO)r��entry�old�newrwZcoodataZdrawingZpcZpsrBZcLIZcLr~ZusepcZtodeleteryrxryrzr{r|r�r<r�r}r��	_undogoto~sl
$$
�
�


zRawTurtle._undogotocCs�|jr|j�d||jf�||j9}|j�|�}|jj}|dkr�|jdkr�d|j}dtt	|�|�}d||}t
|�D]}|j�|�|_|��q|||_|��dS)N�rotr�rg@r�)rr�r	rr�r�r�r,r�rr|rE)r�r�Z	neworientr�Zanglevelr!r|r�r�r�r�r�s


zRawTurtle._rotateTcCsnt|j�dkrD|j�|j|j|j|j�|j��|_|j�	|j�n|jj|jdd�g|_|rj|j
g|_dS)Nr�T)r<)r}rRr�r@rQr)r'r?r�r9rrAr�r�r�r=�s�zRawTurtle._newLinecCst|jt�Sr�)r�rOr�r�r�r�r�rB�szRawTurtle.fillingcCsX|��s"|j��|_|j�|j�|jg|_|��|j	rL|j	�
d|jf�|��dS)N�	beginfill)rBr�r5rNr�r9rrOr=rr�rEr�r�r�r�r1�s
zRawTurtle.begin_fillcCs^|��rZt|j�dkrF|jj|j|j|jd�|jrF|j�d|jf�d|_|_|�	�dS)Nr�r6�dofill)
rBr}rOr�r>rNr*rr�rEr�r�r�r�r>
s�zRawTurtle.end_fillc	Gs8|sNt|ttf�r0|�|�}|jt|jd�}qr|j}|sr|jt|jd�}n$|dkrh|jt|jd�}|�|�}t|jd�r�|j�	|j
||�}|j�|�|j
r�|j
�d|f�n�|��}|j
r�|j
�dg�d|j
_z>|��dkr�|��|��|�|�|�|�|�d�W5|�|�X|j
�r4d|j
_dS)	Nr��_dotr<rTr2rF)r�r�r�r�r'rfr)�hasattrr�r�rr�r9rr�rVr�rarMrXrYrWrC)r�rVr9rCrVr�r�r�r<
s:



z
RawTurtle.dotcCsB|j�|j||||j�\}}|j�|�|jr>|j�d|f�|S)N�wri)r�rSrr)r�r9rr�)r�rQrRrPrCrr�r�r�rSH
s�zRawTurtle._writerP��Arialr�r7cCs`|jr|j�dg�d|j_|�t|�|��|�}|rN|��\}}|�||�|jr\d|j_dS)NrTF)rr�r�rSr�r�r[re)r��argZmoverRrPrr�r�r�r�r�r{R
szRawTurtle.writecCs|jg|_d|_dSr�)rrLrMr�r�r�r�r2o
s
zRawTurtle.begin_polycCs
d|_dS�NF)rMr�r�r�r�r?}
szRawTurtle.end_polycCs|jdk	rt|j�SdSr�)rLr�r�r�r�r�rD�
s

zRawTurtle.get_polycCs|jSr�rGr�r�r�r�rF�
szRawTurtle.getscreencCs|Sr�r�r�r�r�r�rH�
szRawTurtle.getturtlecCs|j�|�Sr�)r�rrGr�r�r�rH�
szRawTurtle._delayr�cCs"|j�|jj|||�|��dSr�)r�r`r�rHrEr�r�r�r�rR�
szRawTurtle.onclickcCs"|j�|jj|||�|��dSr�)r�rar�rHrEr�r�r�r�rT�
szRawTurtle.onreleasecCs|j�|jj|||�dSr�)r�rbr�rHr�r�r�r�rS�
szRawTurtle.ondragcCs,|jdkrdS|dkr@|\}}|�|||j�|j��}n�|dkr\|d}|�|�n�|dkrp|�|�n�|dkr�|d}|j�|�|j�	|�n�|dkr�|d}|jj
|dddd	�nh|d
k�r|d}d|_|_||jk�r(|j�|�|j�	|�n$|dk�r(t
�||d�|j��dS)Nr�rrrrr)r�r<r�rhr�r3r�rV)rrr	r�r6r�r�rDr�r�r>rNrOr$rV)r��actionr�r�ZdegPAUZdummyrmrCr�r�r��_undos<

�

zRawTurtle._undocCsl|jdkrdS|j��}|d}|dd�}|dkr\|rh|��}|�|d|dd��q4n|�||�dS)Nrr�r)rr�r�)r�rCr�r�r�r�r�rw's

zRawTurtle.undo)NN)N)NNN)N)N)NNNN)F)N)T)N)FrPr�)N)r�N)r�N)r�N)8r�r�r�rJr�r�r`rhrxrUr5r�rErr�r�rXr8rkrlrnrgrtrsrmrcrGrdr�rrrqr6r7r
r�rr=rBr1r>r<rSr{r2r?rDrFrHrErHrRrTrSr�rwrvr�r�r�r�r
�	sp�
(

(

(


(

(-
5A

0







 cCstjdkrt�t_tjSr�)r�_screenrIr�r�r�r�r	Js
c@sfeZdZdZdZedZdd�Zededededfd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rINr)cCs�tjdkr4t�t_|_|j�tj�|j�|j�tjdkr�td}td}td}td}td}td}|j�	||||�|j�
�t_t�|tj�|�
||||�dS)Nrzr�r�r�r�r�)rI�_rootrr)�_titler$�_destroyr�r�rrrr�r&)r�rzr�r�r�r�r�r�r�r�r�Xs

z_Screen.__init__rzr�r�r�cCs�t|jd�sdS|j��}|j��}t|t�rNd|krBdkrNnn||}|dkrb||d}t|t�r�d|kr�dkr�nn||}|dkr�||d}|j�||||�|��dS)Nr"rr�r�)r�r�r%r&r�r�r"r,)r�rzr�r r!rLZshr�r�r�r&ns

""z
_Screen.setupcCs tjdk	rtj�|�|t_dSr�)rIr�r)r�)r�Ztitlestringr�r�r�r)�s
z
_Screen.titlecCs:|j}|tjkr(dt_dt_dt_dt_dt_|��dSr�)	r�rIrr�r�r�rr�r#)r��rootr�r�r�r��s
z_Screen._destroycCs|��dSr�)r�r�r�r�r�r�sz_Screen.byecsN�fdd�}��|�tdr"dSz
t�Wntk
rHtd�YnXdS)Ncs���dSr�)r)r�r�r�r�r��exitGracefully�sz+_Screen.exitonclick.<locals>.exitGracefullyr�r)rRr�r�AttributeError�exit)r�r�r�r�r�r�s

z_Screen.exitonclick)
r�r�r�r�r�r�r�r�r&r)r�rrr�r�r�r�rIRs�
(
rIc@s0eZdZdZdZedededfdd�ZdS)rNrkr�r�cCs,tjdkrt�t_tj|tj|||d�dS)N)rkr�r�)rr�r	r
r�)r�rkr�r�r�r�r�r��s

�zTurtle.__init__)r�r�r�r�r�r�r�r�r�r�r�r�s��turtle_docstringdictc	Cs�i}tD]}d|}t|�j||<qtD]}d|}t|�j||<q(td|d���}tdd�|D��}|�d�|dd�D](}|�d	t|��|�d
||�q||d}|�d	t|��|�d||�|�d�|��W5QRXdS)
Nz_Screen.zTurtle.z%s.pyr1css$|]}|�d�dtkr|VqdS)r�r�N)r�_alias_listr�r�r�r�r�s�z&write_docstringdict.<locals>.<genexpr>zdocsdict = {

r�z%s :
z        """%s
""",

z        """%s
"""

z}
)	�_tg_screen_functionsr��__doc__�_tg_turtle_functionsr�r�r{�repr�close)r��docsdict�
methodnamer�r�r�r�r�r�r~�s$

c	Cs`dd|��i}t|�}|j}|D]8}z||t|�_Wq"tk
rXtd|�Yq"Xq"dS)Nz!turtle_docstringdict_%(language)sr�zBad docstring-entry: %s)r��
__import__r�r�r�r�r�)Zlang�modname�moduler�r�r�r�r��read_docstringssr�r�zCannot find docsdict forz;Unknown Error when trying to import %s-docstring-dictionaryc
Cs�d}}t�|j�\}}}|dd�}|dd�}|jp:g}dd�|D�}dgt|�t|�|}dd�t||�D�}	|dk	r�|	�d|�|�d|�|dk	r�|	�d|�|�d|�d�|	�}d	|}d�|�}d	|}||fS)
Nr�r�cSsg|]}d|f�qS)z=%rr�)rxr�r�r�r�r{<sz"getmethparlist.<locals>.<listcomp>cSsg|]\}}||�qSr�r�)rxr�Zdfltr�r�r�r{>s�*z**z, z(%s))�inspectZgetargs�__code__�__defaults__r}rir9r)
ZobZdefTextZcallTextrZvarargsZvarkwZitems2ZrealArgs�defaultsZitems1r�r�r��getmethparlist,s&


r�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)Nrr��%s.r�� \(.+ %s\):�:��rer��replace�compile�sub)�docstrr�Z
turtlename�	newdocstr�parexpr�r�r��_turtle_docreviseKsr�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)Nrr�r�r�r�r�r�)r�r�Z
screennamer�r�r�r�r��_screen_docreviseWsr�ardef {name}{paramslist}:
    if {obj} is None:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        {obj} = {init}
    try:
        return {obj}.{name}{argslist}
    except TK.TclError:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        raise
c
Csl|D]b}t||�}t|�\}}|dkr4td||�qtj|||||d�}	t|	t��||j�t�|_qdS)Nr�z>>>>>>)�obj�initr�Z
paramslistZargslist)�getattrr�r��__func_body�formatr��globalsr�)
Z	functionsr�r�r�Z	docreviser�r�Zpl1Zpl2Zdefstrr�r�r��_make_global_funcsws

�r�zTurtle._screenzScreen()zTurtle._penzTurtle()�__main__cCst�rt�nt�dSr�)rNr]rUr�r�r�r��	switchpen�sr�cCslt�td�t�td�t�td�td�D]Z}|dkrDt�td�D]}td�t	d�qL|dkrxt
d�t�t�td	�t�q2td
�t
d�td�t�td�td�td�td�td
�t�t
dd
�t
dd
�t
d�td�D]$}td�t	d�td�td�q�td�t�td�D]&}td�t	d�td�td��q:t�dS)NT�dr�r�r�r��ZZmaroonrr�r�F�Z
startstartrx�redr�)r`r*ryr0r=rzr|r1rCrPr9r>r_r{)ryr�r�r�r��demo1�sX



r�cCsBtd�t�td�ttdd��tdd�d}td�td�D]}t�t	|d�qBt
d�t�rnt�q`t
�td�td	�d}td
�td�td�tdd
�D]p}|dkr�t�td	d|dd|�td�D]}t|�td�q�t�|d7}td�tt�dd�q�td�t�td�td�t�tdd�td�t�td�D](}t	dd�td�td�td��q`t�td�t�td�t�td�t�}|�d�t�}|�d�|�d�|�
�|�d�|�d�|��|�dd�|�d�|��|�d�|�dd�|�d�|�d�tt|��d}|�|�dk�r�|�d�|�d �|�|�|��|�d�|d!dk�r�|� �|� �t�|d7}�qZ|j
d"d#d$d%�|�d&�|�d�d'd(�}t!�"d�t��r|��|���q�|�d�|j
d)d*d+�|�#|d�dS),Nr�r�rrr��r�zwait a moment...r�Zgreenr�r�r���x��Frr�Zyellowr��2r�r2i�(r�ZblueZoranger�g@g333333�?r�zCAUGHT! )r�r��boldr_)rPrRr�cSst�t�dSr�)rr)r�r�r�r�r��babaszdemo2.<locals>.babaz  Click me!)ZCourierr�r�)rP)$rprqrYrdrur;rbr|r�r4r{rxrwr`rQrrWr1rAr@r>r]rUr9rkrHrarrPryrIr=rr�time�sleeprR)r r�ZlaengeryZtrir�r�r�r�r�r��demo2�s�


















r�)r�)r�)EZ_verZtkinterr�r�r�r�r�r�Zos.pathrrr�copyrrZ_tg_classesr�r�Z
_tg_utilities�__all__r�r�r�r�r�r�r�rr�r�r�r�r�rr�rr�objectr'r�r�rr�rr�r$rBr
rr	rIrr
r~r�Z	_LANGUAGE�ImportErrorr�r�r�r�r�rrr�r�r�r�rr�r�r�r��<module>gs���
�

����5
�
c	/&/O}
"
���
5cpkgutil.cpython-38.opt-1.pyc000064400000037722151450073350011630 0ustar00U

e5d�S�@sxdZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z	ddlZddlm
Z
ddlZdddd	d
ddd
ddddgZedd�Zde_dd�Zdd�Zd+dd
�Zd,dd�Zed-dd��Zd.dd�Ze�ejje�dd�ZGd d
�d
�ZGd!d�d�Zz.ddlZdd"lmZd/d#d$�Ze�ee�Wne k
�r@YnXd%d�Z!d0d&d�Z"d'd�Z#d(d	�Z$d)d�Z%d*d�Z&dS)1zUtilities to support packages.�)�
namedtuple)�singledispatchN)�
ModuleType�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsRz
|j}Wn:tk
rD|�|�}|dkr2YdStj�||�YSX||�SdS)z'Return the finder-specific module spec.N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�/usr/lib64/python3.8/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr�magicrrrr(s

�c	#s�ifdd��t||�D]�}|V|jrzt|j�WnNtk
rZ|dk	rV||j�Yqtk
r�|dk	r|||j�n�YqXttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqdS)a�Yields ModuleInfo for all modules recursively
    on path, or, if path is None, all accessible modules.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.

    Note that this function must import all *packages* (NOT all
    modules!) on the given path, in order to access the __path__
    attribute to find submodules.

    'onerror' is a function which gets called with one argument (the
    name of the package which was being imported) if any exception
    occurs while trying to import a package.  If no onerror function is
    supplied, ImportErrors are caught and ignored, while all other
    exceptions are propagated, terminating the search.

    Examples:

    # list all modules python can access
    walk_packages()

    # list all submodules of ctypes
    walk_packages(ctypes.__path__, ctypes.__name__+'.')
    cSs||krdSd||<dS)NTr)�p�mrrr�seenRszwalk_packages.<locals>.seenN�__path__csg|]}�|�s|�qSrr)�.0r&�r(rr�
<listcomp>isz!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�inforr+rr	5s ccsr|dkrt�}nt|t�r$td��n
tt|�}i}|D]6}t||�D]&\}}||krDd||<t|||�VqDq6dS)aYields ModuleInfo for all submodules on path,
    or, if path is None, all top-level modules on sys.path.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.
    Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r5r6Z	importers�yielded�irr.rrrr
ns



cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr6rrrr>�s
r>c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dS�Nr�__init__Fr-Tr9�	r5�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rBr6r?rH�	filenames�fn�modnamer5r.�dircontents�subnamerrr�_iter_file_finder_modules�s<



rSc	Cs.t���t�dt�t�d�aW5QRXdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerUrrrr�_import_imp�s
r[c@s.eZdZdZd
dd�Zddd�Zddd	�ZdS)
raPEP 302 Finder that wraps Python's "classic" import algorithm

    ImpImporter(dirname) produces a PEP 302 finder that searches that
    directory.  ImpImporter(None) produces a PEP 302 finder that searches
    the current sys.path, plus any modules that are frozen or built-in.

    Note that ImpImporter does not currently support being used by placement
    on sys.meta_path.
    NcCst�dt�t�||_dS�Nz5This emulation is deprecated, use 'importlib' instead)rV�warnrYr[r5)�selfr5rrrrD�s
�zImpImporter.__init__cCs�|�d�d}||kr$|jdkr$dS|jdkr4d}ntj�|j�g}zt�||�\}}}Wntk
rpYdSXt||||�S)Nr-���)�splitr5rF�realpathrUrr0r
)r^�fullnamer5rR�file�filename�etcrrrr�s
zImpImporter.find_moduler%c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dSrCrE)r^r6r?rHrNrOrPr5r.rQrRrrrr
�s<



zImpImporter.iter_modules)N)N)r%)�__name__�
__module__�__qualname__�__doc__rDrr
rrrrr�s


c@sneZdZdZdZZdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zddd�Zddd�Z
dd�Zddd�ZdS)r
zBPEP 302 Loader that wraps Python's "classic" import algorithm
    NcCs.t�dt�t�||_||_||_||_dSr\)rVr]rYr[rcrdrbre)r^rbrcrdrerrrrDs�zImpLoader.__init__cCs:|��zt�||j|j|j�}W5|jr4|j��X|S)N)�_reopenrc�closerU�load_modulerdre)r^rb�modrrrrlszImpLoader.load_modulec
Cs*t|d��}|��W5QR�SQRXdS)N�rb)�openr )r^�pathnamercrrrr%szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfkrPt|jd�|_dS)N��rrn)	rc�closedrerU�	PY_SOURCErord�PY_COMPILED�C_EXTENSION)r^�mod_typerrrrj)s

zImpLoader._reopencCs0|dkr|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)rbr0�r^rbrrr�	_fix_name1s
�zImpLoader._fix_namecCs|�|�}|jdtjkS�Nrq)ryrerU�
PKG_DIRECTORYrxrrr�
is_package9s
zImpLoader.is_packagecCs�|�|�}|jdkr�|jd}|tjkrD|�|�}t||jd�|_nJ|tjkrv|�	�zt|j
�|_W5|j
��Xn|tj
kr�|����|_|jS)Nrq�exec)ry�codererUrt�
get_source�compilerdrurjrcrkrr{�
_get_delegate�get_code)r^rbrw�sourcerrrr�=s






zImpLoader.get_codec	Cs�|�|�}|jdkr�|jd}|tjkrP|��z|j��|_W5|j��Xnd|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_W5QRXn|tjkr�|����|_|jS)Nrqr_rr)ryr�rerUrtrjrcrkr rurFr5�existsrdror{r�r)r^rbrw�frrrrNs





zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrD)rrdrr)r^r�specrrrr�`s

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfkrD|j	SdSrz)
ryrerUr{r��get_filenamertrurvrd)r^rbrwrrrr�es


zImpLoader.get_filename)N)N)N)rfrgrhrir~r�rDrlrrjryr|r�rr�r�rrrrr
s	

)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}|D]�}|�|�s>q.||d��t	j
�}t|�dkr�|d�d�r�|d|kr�d||d<||ddfVt|�dkr�q.|�|d�}|dkr�q.|r.d|kr.||kr.d||<||dfVq.dS)	Nrrqr9z__init__.pyTrDr-F)�sorted�	zipimport�_zip_directory_cache�archiver6�lenrH�
startswithr`rF�seprL)	rBr6Zdirlist�_prefixZplenr?rHrOrPrrr�iter_zipimport_modulesss*
r�cCsxt�|�}ztj|}WnZtk
rrtjD]:}z ||�}tj�||�WqnWq.tk
rfYq.Xq.d}YnX|S)z�Retrieve a finder for the given path item

    The returned finder is cached in sys.path_importer_cache
    if it was newly created by a path hook.

    The cache (or part of it) can be cleared manually if a
    rescan of sys.path_hooks is necessary.
    N)rF�fsdecoder3�path_importer_cache�KeyError�
path_hooks�
setdefaultr0)Z	path_itemrB�	path_hookrrrr�s	



ccs�|�d�rd�|�}t|��d|krV|�d�d}t�|�}t|dd�}|dkrhdSntjEdHtj	}|D]}t
|�VqldS)a�Yield finders for the given module name

    If fullname contains a '.', the finders will be for the package
    containing fullname, otherwise they will be all registered top level
    finders (i.e. those on both sys.meta_path and sys.path_hooks).

    If the named module is in a package, that package is imported as a side
    effect of invoking this function.

    If no module name is specified, all top level finders are produced.
    r-�'Relative module name {!r} not supportedrr)N)r��formatr0�
rpartitionrrZr2r3�	meta_pathr5r)rb�msgZpkg_nameZpkgr5�itemrrrr�s


cCsn|tjkr tj|}|dkr dSt|t�rb|}t|dd�}|dk	rF|St|dd�dkrZdS|j}n|}t|�S)z�Get a "loader" object for module_or_name

    Returns None if the module cannot be found or imported.
    If the named module is not already imported, its containing package
    (if any) is imported, in order to establish the package __path__.
    N�
__loader__�__spec__)r3r4r:rr2rfr)Zmodule_or_name�modulerrbrrrr�s


cCs�|�d�rd�|�}t|��ztj�|�}WnFttttfk
rr}z d}t|�|t	|�|��|�W5d}~XYnX|dk	r�|j
SdS)z�Find a "loader" object for fullname

    This is a backwards compatibility wrapper around
    importlib.util.find_spec that converts most failures to ImportError
    and only returns the loader rather than the full spec
    r-r�z,Error while finding loader for {!r} ({}: {})N)r�r�r0rrrr�	TypeErrorr<�typer)rbr�r�Zexrrrr�s

*cCs�t|t�s|S|d}|dd�}|�d�\}}}|rfztj|j}Wqlttfk
rb|YSXntj}|D�]&}t|t	�s�qpt
|�}|dk	r�g}	t|d�r�|�|�}
|
dk	r�|
j
p�g}	nt|d�r�|�|�\}}	|	D]}||kr�|�|�q�tj�||�}tj�|�rpzt|�}
Wn8tk
�rP}ztj�d||f�W5d}~XYqpX|
�<|
D]0}|�d�}|�r\|�d��r��q\|�|��q\W5QRXqp|S)	a�Extend a package's path.

    Intended use is to place the following code in a package's __init__.py:

        from pkgutil import extend_path
        __path__ = extend_path(__path__, __name__)

    This will add to the package's __path__ all subdirectories of
    directories on sys.path named after the package.  This is useful
    if one wants to distribute different parts of a single logical
    package as multiple directories.

    It also looks for *.pkg files beginning where * matches the name
    argument.  This feature is similar to *.pth files (see site.py),
    except that it doesn't special-case lines starting with 'import'.
    A *.pkg file is trusted at face value: apart from checking for
    duplicates, all entries found in a *.pkg file are added to the
    path, regardless of whether they are exist the filesystem.  (This
    is a feature.)

    If the input path is not a list (as is the case for frozen
    packages) it is returned unchanged.  The input path is not
    modified; an extended copy is returned.  Items are only appended
    to the copy at the end.

    It is assumed that sys.path is a sequence.  Items of sys.path that
    are not (unicode or 8-bit) strings referring to existing
    directories are ignored.  Unicode items of sys.path that cause
    errors when used as filenames may cause this function to raise an
    exception (in line with os.path.isdir() behavior).
    z.pkgNr-rrzCan't open %s: %s
�
�#)r:�listr�r3r4r)r�rr5r;rrAr�submodule_search_locationsr�appendrFrM�isfilerorJ�stderr�write�rstripr�)r5rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsr�ZportionZpkgfiler�r��linerrrr�sR!





�
cCs�tj�|�}|dkrdS|j}|dks0t|d�s4dStj�|�pJtj�	|�}|dks^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)afGet a resource from a package.

    This is a wrapper round the PEP 302 loader get_data API. The package
    argument should be the name of a package, in standard module format
    (foo.bar). The resource argument should be in the form of a relative
    filename, using '/' as the path separator. The parent directory name '..'
    is not allowed, and nor is a rooted name (starting with a '/').

    The function returns a binary string, which is the contents of the
    specified resource.

    For packages located in the filesystem, which have already been imported,
    this is the rough equivalent of

        d = os.path.dirname(sys.modules[package].__file__)
        data = open(os.path.join(d, resource), 'rb').read()

    If the package cannot be located or loaded, or it uses a PEP 302 loader
    which does not support get_data(), then None is returned.
    Nr�__file__�/r)rrrrrAr3r4�get�
_bootstrap�_loadr`�insertrFr5�dirnamer�rMr)�package�resourcer�rrm�partsZ
resource_namerrrrVs
�
)Nr%N)Nr%)r%)r%)r%)r%)'ri�collectionsr�	functoolsrZ
simplegenericr�importlib.util�importlib.machineryrFZos.pathr3�typesrrV�__all__rrrr	r
r>rS�register�	machinery�
FileFinderr[rr
r�r�r�r0rrrrrrrrrr�<module>sh�

9

(�Jc

^bz2.cpython-38.opt-2.pyc000064400000014365151450073350010645 0ustar00U

e5d1�@s�ddddddgZdZddlmZdd	lZdd	lZdd	lZdd	lZdd
l	m
Z
ddlmZm
Z
dZdZd
Ze�ZGdd�dej�Zddd�Zddd�Zdd�Zd	S)�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>�)rN)�RLock)rr��c@s�eZdZdedfdd�Zdd�Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zd(dd�Zd)dd�Z
d*dd�Zdd�Zd+dd�Zd,dd�Zdd �Zd!d"�Zejfd#d$�Zd%d&�Zd'S)-r�r�	cCsTt�|_d|_d|_t|_|tk	r2tjdt	dd�d|krFdksPnt
d��|dkrbd	}t}nb|d
kr~d}t}t
|�|_nF|dkr�d
}t}t
|�|_n*|dkr�d}t}t
|�|_nt
d|f��t|tttjf�r�t||�|_d|_||_n.t|d��st|d��r||_||_ntd��|jtk�rJtj|jttd�}t�|�|_nd|_dS)NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.�)�
stacklevelr	rz%compresslevel must be between 1 and 9)�r�rbr)�w�wbr)�x�xbr)�a�abr�Invalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r�_lock�_fp�_closefp�_MODE_CLOSED�_mode�	_sentinel�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr�_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeError�_compressionZDecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode�	buffering�
compresslevelZ	mode_code�raw�r;�/usr/lib64/python3.8/bz2.py�__init__)sT��zBZ2File.__init__cCs�|j��|jtkr W5QR�dSz<|jtkr8|j��n"|jtkrZ|j�	|j
���d|_
W5z|jrp|j��W5d|_d|_t|_d|_XXW5QRXdS)NF)rrrrrr3�closer$r%rr&�flush�r5r;r;r<r>ps 



z
BZ2File.closecCs
|jtkS�N)rrr@r;r;r<�closed�szBZ2File.closedcCs|��|j��SrA)�_check_not_closedr�filenor@r;r;r<rD�szBZ2File.filenocCs|��o|j��SrA)�readabler3�seekabler@r;r;r<rF�szBZ2File.seekablecCs|��|jtkSrA)rCrr$r@r;r;r<rE�szBZ2File.readablecCs|��|jtkSrA)rCrr%r@r;r;r<�writable�szBZ2File.writablerc
Cs2|j�"|��|j�|�W5QR�SQRXdSrA)r�_check_can_readr3�peek)r5�nr;r;r<rI�szBZ2File.peek���c
Cs2|j�"|��|j�|�W5QR�SQRXdSrA)rrHr3r�r5�sizer;r;r<r�szBZ2File.readc
Cs@|j�0|��|dkrtj}|j�|�W5QR�SQRXdS)Nr)rrHr1�DEFAULT_BUFFER_SIZEr3�read1rLr;r;r<rO�s
z
BZ2File.read1c
Cs2|j�"|��|j�|�W5QR�SQRXdSrA)rrHr3�readinto)r5�br;r;r<rP�szBZ2File.readintoc
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS�N�	__index__zInteger argument expected)	r'�intr-r.rSrrHr3�readlinerLr;r;r<rU�s

zBZ2File.readlinec
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdSrR)	r'rTr-r.rSrrHr3�	readlinesrLr;r;r<rV�s

zBZ2File.readlinesc
CsX|j�H|��|j�|�}|j�|�|jt|�7_t|�W5QR�SQRXdSrA)rZ_check_can_writer&rrrr4�len)r5�dataZ
compressedr;r;r<r�sz
BZ2File.writec
Cs,|j�tj�||�W5QR�SQRXdSrA)rr/�
BaseStream�
writelines)r5�seqr;r;r<rZ�szBZ2File.writelinesc
Cs4|j�$|��|j�||�W5QR�SQRXdSrA)rZ_check_can_seekr3�seek)r5�offset�whencer;r;r<r\szBZ2File.seekc
CsL|j�<|��|jtkr0|j��W5QR�S|jW5QR�SQRXdSrA)rrCrr$r3�tellr4r@r;r;r<r_s

zBZ2File.tellN)r)rK)rK)rK)rK)�__name__�
__module__�__qualname__rr=r>�propertyrBrDrFrErGrIrrOrPrUrVrrZr1�SEEK_SETr\r_r;r;r;r<rs$G





	

rrcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|||d�}d|kr�t�||||�S|SdS)	N�trQrz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r9)r#�replacerr1�
TextIOWrapper)r6r7r9�encoding�errors�newlineZbz_modeZbinary_filer;r;r<r!scCst|�}|�|�|��SrA)rrr?)rXr9�compr;r;r<rJscCshg}|r^t�}z|�|�}Wn tk
r<|r6Yq^n�YnX|�|�|jsVtd��|j}qd�|�S)NzACompressed data ended before the end-of-stream marker was reached�)rrr0�append�eofr#Zunused_data�join)rXZresultsZdecomp�resr;r;r<rUs
)rrNNN)r)�__all__�
__author__�builtinsrr,r1r*r r/Z	threadingrZ_bz2rrrr$r%�objectrrYrrrr;r;r;r<�<module>s4��
)
this.cpython-38.opt-1.pyc000064400000002357151450073350011114 0ustar00U

e5d��@s\dZiZdD]2Zed�D]$Zeedde�eeee�<qqed�dd�eD���dS)aXGur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!)�A�a��
�cCsg|]}t�||��qS�)�d�get)�.0�crr�/usr/lib64/python3.8/this.py�
<listcomp>srN)�srr
�range�i�chr�print�joinrrrr�<module>s
$smtplib.cpython-38.pyc000064400000105531151450073350010656 0ustar00U

e5dɯ�
@srdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZdddddd	d
ddd
dddg
ZdZdZdZdZdZdZe�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z Gdd
�d
e�Z!Gdd�de�Z"Gd d�de�Z#Gd!d
�d
e�Z$d"d�Z%d#d$�Z&d%d�Z'd&d'�Z(d(d)�Z)zddl*Z*Wne+k
�r�d*Z,YnXd+Z,Gd,d�d�Z-e,�r�Gd-d.�d.e-�Z.e�/d.�d/Z0Gd0d1�d1e-�Z1e2d2k�rnd3d4�Z3e3d5�Z4e3d6��5d7�Z6e7d8�d9Z8ej9�:�Z;e;�s*�q6e8e;Z8�qe7d:e<e8��e-d;�Z=e=�>d<�e=�?e4e6e8�e=�@�dS)=aSMTP/ESMTP client class.

This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).

Notes:

Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RCPT
and MAIL commands!

Example:

  >>> import smtplib
  >>> s=smtplib.SMTP("localhost")
  >>> print(s.help())
  This is Sendmail version 8.8.4
  Topics:
      HELO    EHLO    MAIL    RCPT    DATA
      RSET    NOOP    QUIT    HELP    VRFY
      EXPN    VERB    ETRN    DSN
  For more info use "HELP <topic>".
  To report bugs in the implementation send email to
      sendmail-bugs@sendmail.org.
  For local information send email to Postmaster at your site.
  End of HELP info
  >>> s.putcmd("vrfy","someone@here")
  >>> s.getreply()
  (250, "Somebody OverHere <somebody@here.my.org>")
  >>> s.quit()
�N)�body_encode�
SMTPException�SMTPNotSupportedError�SMTPServerDisconnected�SMTPResponseException�SMTPSenderRefused�SMTPRecipientsRefused�
SMTPDataError�SMTPConnectError�
SMTPHeloError�SMTPAuthenticationError�	quoteaddr�	quotedata�SMTP�i��
s
i �z	auth=(.*)c@seZdZdZdS)rz4Base class for all exceptions raised by this module.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/smtplib.pyrHsc@seZdZdZdS)rz�The command or option is not supported by the SMTP server.

    This exception is raised when an attempt is made to run a command or a
    command with an option which is not supported by the server.
    NrrrrrrKsc@seZdZdZdS)rz�Not connected to any SMTP server.

    This exception is raised when the server unexpectedly disconnects,
    or when an attempt is made to use the SMTP instance before
    connecting it to a server.
    NrrrrrrRsc@seZdZdZdd�ZdS)ra2Base class for all exceptions that include an SMTP error code.

    These exceptions are generated in some instances when the SMTP
    server returns an error code.  The error code is stored in the
    `smtp_code' attribute of the error, and the `smtp_error' attribute
    is set to the error message.
    cCs||_||_||f|_dS�N)�	smtp_code�
smtp_error�args)�self�code�msgrrr�__init__cszSMTPResponseException.__init__N�rrrrr!rrrrrZsc@seZdZdZdd�ZdS)rz�Sender address refused.

    In addition to the attributes set by on all SMTPResponseException
    exceptions, this sets `sender' to the string that the SMTP refused.
    cCs"||_||_||_|||f|_dSr)rr�senderr)rrr r#rrrr!oszSMTPSenderRefused.__init__Nr"rrrrrhsc@seZdZdZdd�ZdS)rz�All recipient addresses refused.

    The errors for each recipient are accessible through the attribute
    'recipients', which is a dictionary of exactly the same sort as
    SMTP.sendmail() returns.
    cCs||_|f|_dSr)�
recipientsr)rr$rrrr!}szSMTPRecipientsRefused.__init__Nr"rrrrrusc@seZdZdZdS)r	z'The SMTP server didn't accept the data.Nrrrrrr	�sc@seZdZdZdS)r
z&Error during connection establishment.Nrrrrrr
�sc@seZdZdZdS)rz"The server refused our HELO reply.Nrrrrrr�sc@seZdZdZdS)rzvAuthentication error.

    Most probably the server didn't accept the username/password
    combination provided.
    Nrrrrrr�scCs>tj�|�\}}||fdkr6|���d�r.|Sd|Sd|S)z�Quote a subset of the email addresses defined by RFC 821.

    Should be able to handle anything email.utils.parseaddr can handle.
    ��r&�<z<%s>)�email�utils�	parseaddr�strip�
startswith�Z
addrstringZdisplayname�addrrrrr
�scCs$tj�|�\}}||fdkr |S|S)Nr%)r(r)r*r-rrr�
_addr_only�sr/c	Cst�ddt�dt|��S)z�Quote data for email.

    Double leading '.', and change Unix newline '\n', or Mac '\r' into
    Internet CRLF end-of-line.
    z(?m)^\.z..�(?:\r\n|\n|\r(?!\n))��re�sub�CRLF��datarrrr�s�cCst�dd|�S)Ns(?m)^\.s..)r2r3)Zbindatarrr�_quote_periods�sr7cCst�dt|�S)Nr0r1r5rrr�	_fix_eols�sr8FTc@szeZdZdZdZdZdZdZdZdZ	dZ
eZddde
jdfdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�ZdNdd�Zdd�ZdOdd�Zdd�ZdPdd�ZdQdd�ZdRdd �Zd!d"�ZdSd#d$�Zd%d&�Zd'd(�Zd)d*�Z dTd,d-�Z!dUd.d/�Z"d0d1�Z#d2d3�Z$e$Z%d4d5�Z&d6d7�Z'd8d9�d:d;�Z(dVd<d=�Z)dWd>d?�Z*dXd@dA�Z+d8d9�dBdC�Z,dYdDdE�Z-dZdFdG�Z.d[dHdI�Z/dJdK�Z0dLdM�Z1dS)\ra�This class manages a connection to an SMTP or ESMTP server.
    SMTP Objects:
        SMTP objects have the following attributes:
            helo_resp
                This is the message given by the server in response to the
                most recent HELO command.

            ehlo_resp
                This is the message given by the server in response to the
                most recent EHLO command. This is usually multiline.

            does_esmtp
                This is a True value _after you do an EHLO command_, if the
                server supports ESMTP.

            esmtp_features
                This is a dictionary, which, if the server supports ESMTP,
                will _after you do an EHLO command_, contain the names of the
                SMTP service extensions this server supports, and their
                parameters (if any).

                Note, all extension names are mapped to lower case in the
                dictionary.

        See each method's docstrings for details.  In general, there is a
        method of the same name to perform each SMTP command.  There is also a
        method called 'sendmail' that will do an entire mail transaction.
        rN�ehlor&c
Cs�||_||_i|_d|_||_d|_|rR|�||�\}}|dkrR|��t||��|dk	rb||_	nPt
��}d|krz||_	n8d}	zt
�t
�
��}	Wnt
jk
r�YnXd|	|_	dS)aInitialize a new instance.

        If specified, `host` is the name of the remote host to which to
        connect.  If specified, `port` specifies the port to which to connect.
        By default, smtplib.SMTP_PORT is used.  If a host is specified the
        connect method is called, and if it returns anything other than a
        success code an SMTPConnectError is raised.  If specified,
        `local_hostname` is used as the FQDN of the local host in the HELO/EHLO
        command.  Otherwise, the local hostname is found using
        socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host,
        port) for the socket to bind to as its source address before
        connecting. If the host is '' and port is 0, the OS default behavior
        will be used.

        �asciir��N�.z	127.0.0.1z[%s])�_host�timeout�esmtp_features�command_encoding�source_address�_auth_challenge_count�connect�closer
�local_hostname�socketZgetfqdnZ
gethostbynameZgethostnameZgaierror)
r�host�portrEr>rArr Zfqdnr.rrrr!�s,
z
SMTP.__init__cCs|Srr�rrrr�	__enter__szSMTP.__enter__cGsNz>z$|�d�\}}|dkr$t||��Wntk
r:YnXW5|��XdS)NZQUIT��)rD�docmdrr)rrr�messagerrr�__exit__s
z
SMTP.__exit__cCs
||_dS)z�Set the debug output level.

        A non-false value results in debug messages for connection and for all
        messages sent to and received from the server.

        N)�
debuglevel)rrOrrr�set_debuglevel"szSMTP.set_debuglevelcGs@|jdkr,ttj����f|�dtji�nt|dtji�dS)N��file)rO�print�datetimeZnow�time�sys�stderr�rrrrr�_print_debug+s
"zSMTP._print_debugcCs2|jdkr|�d||f|j�t�||f||j�S)Nrzconnect: to)rOrYrArF�create_connection)rrGrHr>rrr�_get_socket1s

�zSMTP._get_socket�	localhostcCs�|r
||_|s||�d�|�d�kr||�d�}|dkr||d|�||dd�}}zt|�}Wntk
rztd��YnX|s�|j}t�d|||�|�	|||j
�|_d|_|�
�\}}|jdkr�|�dt|��||fS)apConnect to a host on a given port.

        If the hostname ends with a colon (`:') followed by a number, and
        there is no port specified, that suffix will be stripped off and the
        number interpreted as the port number to use.

        Note: This method is automatically invoked by __init__, if a host is
        specified during instantiation.

        �:rNrQznonnumeric portzsmtplib.connect�connect:)rA�find�rfind�int�
ValueError�OSError�default_portrV�auditr[r>�sockrR�getreplyrOrY�repr)rrGrHrA�irr rrrrC9s&

zSMTP.connectcCs�|jdkr|�dt|��|jr|t|t�r6|�|j�}t�	d||�z|j�
|�Wq�tk
rx|��t
d��Yq�Xnt
d��dS)zSend `s' to the server.rzsend:zsmtplib.send�Server not connectedzplease run connect() firstN)rOrYrhrf�
isinstance�str�encoder@rVreZsendallrcrDr)r�srrr�sendZs

z	SMTP.sendcCsd|dkr|}n|�d|��}d|ks,d|krN|�dd��dd�}td|����|�|�t���dS)	zSend a command to the server.r&� �
�
z\nz\rz=command and arguments contain prohibited newline characters: N)�replacerbror4)r�cmdrrnrrr�putcmdms�zSMTP.putcmdc
CsPg}|jdkr|j�d�|_z|j�td�}Wn:tk
rj}z|��tdt|���W5d}~XYnX|s�|��td��|j	dkr�|�
dt|��t|�tkr�|��t
dd	��|�|d
d��d��|dd�}zt|�}Wn tk
�rd
}Y�q YnX|dd
�dkr�q qd�|�}|j	dk�rH|�
d||f�||fS)a�Get a reply from the server.

        Returns a tuple consisting of:

          - server response code (e.g. '250', or such, if all goes well)
            Note: returns -1 if it can't read response code.

          - server response string corresponding to response code (multiline
            responses are converted to a single, multiline string).

        Raises SMTPServerDisconnected if end-of-file is reached.
        N�rbrQz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:i�zLine too long.�s 	
�����-�
zreply: retcode (%s); Msg: %a)rRrfZmakefile�readline�_MAXLINErcrDrrlrOrYrh�lenr�appendr+rarb�join)r�resp�line�erZerrcode�errmsgrrrrgzs>

�


z
SMTP.getreplycCs|�||�|��S)z-Send a command, and return its response code.�rurg)rrtrrrrrL�sz
SMTP.docmdcCs,|�d|p|j�|��\}}||_||fS)zwSMTP 'helo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        �helo)rurErg�	helo_resp)r�namerr rrrr��sz	SMTP.heloc
CsHi|_|�|j|p|j�|��\}}|dkrJt|�dkrJ|��td��||_|dkr`||fSd|_	t
|jt�s�tt
|j���|j�d��d�}|d=|D]�}t�|�}|r�|j�dd	�d
|�d�d|jd<q�t�d|�}|r�|�d���}|j|�d�d
���}	|dk�r4|j�|d	�d
|	|j|<q�|	|j|<q�||fS)zx SMTP 'ehlo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        ryrrj�rQzlatin-1rr�authr&rpz((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?�featureN)r?ru�ehlo_msgrErgr~rDr�	ehlo_resp�
does_esmtprk�bytes�AssertionErrorrh�decode�split�
OLDSTYLE_AUTH�match�get�groupsr2�group�lower�string�endr+)
rr�rr r��eachZ
auth_match�mr�Zparamsrrrr9�sD
��

��z	SMTP.ehlocCs|��|jkS)z7Does the server support a given SMTP service extension?)r�r?)r�optrrr�has_extn�sz
SMTP.has_extncCs|�d|�|��dS)z;SMTP 'help' command.
        Returns help text from server.�helprQr�rXrrrr��sz	SMTP.helpcCsd|_|�d�S)z&SMTP 'rset' command -- resets session.r:�rset)r@rLrIrrrr��sz	SMTP.rsetcCs&z|��Wntk
r YnXdS)aInternal 'rset' command which ignores any SMTPServerDisconnected error.

        Used internally in the library, since the server disconnected error
        should appear to the application when the *next* command is issued, if
        we are doing an internal "safety" reset.
        N)r�rrIrrr�_rset�sz
SMTP._rsetcCs
|�d�S)z-SMTP 'noop' command -- doesn't do anything :>�noop)rLrIrrrr�	sz	SMTP.nooprcCshd}|rH|jrHtdd�|D��r:|�d�r2d|_ntd��dd�|�}|�dd	t|�|f�|��S)
a8SMTP 'mail' command -- begins mail xfer session.

        This method may raise the following exceptions:

         SMTPNotSupportedError  The options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.
        r&css|]}|��dkVqdS)�smtputf8N)r�)�.0�xrrr�	<genexpr>szSMTP.mail.<locals>.<genexpr>r�zutf-8z SMTPUTF8 not supported by serverrp�mailz	FROM:%s%s)	r��anyr�r@rr�rur
rg)rr#�options�
optionlistrrrr�
s	

�z	SMTP.mailcCs<d}|r|jrdd�|�}|�ddt|�|f�|��S)z;SMTP 'rcpt' command -- indicates 1 recipient for this mail.r&rp�rcptzTO:%s%s)r�r�rur
rg)rZrecipr�r�rrrr�"s

z	SMTP.rcptcCs�|�d�|��\}}|jdkr0|�d||f�|dkrDt||��n|t|t�r\t|��d�}t	|�}|dd�t
kr||t
}|dt
}|�|�|��\}}|jdkr�|�d||f�||fSdS)	a�SMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.  If msg
        is a string, lone '\r' and '\n' characters are converted to
        '\r\n' characters.  If msg is bytes, it is transmitted as is.
        r6rzdata:ibr:���N�.)rurgrOrYr	rkrlr8rmr7�bCRLFro)rr r�repl�qrrrr6*s"





z	SMTP.datacCs|�dt|��|��S)z5SMTP 'verify' command -- checks for address validity.�vrfy�rur/rg�rZaddressrrr�verifyGszSMTP.verifycCs|�dt|��|��S)z.SMTP 'expn' command -- expands a mailing list.�expnr�r�rrrr�Nsz	SMTP.expncCsb|jdkr^|jdkr^d|��dkr0dks^n|��\}}d|krRdks^nt||��dS)abCall self.ehlo() and/or self.helo() if needed.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        N��ri+)r�r�r9r�r)rrr�rrr�ehlo_or_helo_if_neededUs
zSMTP.ehlo_or_helo_if_neededT��initial_response_okc	Cs�|��}|r|�nd}|dk	rPt|�d�dd�}|�d|d|�\}}d|_n|�d|�\}}d|_|d	kr�|jd7_t�|�}t||��d�dd�}|�|�\}}|jtkrftd
t	||f���qf|dkr�||fSt
||��dS)a�Authentication command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - the valid values are those listed in the 'auth'
        element of 'esmtp_features'.

        'authobject' must be a callable object taking a single argument:

                data = authobject(challenge)

        It will be called to process the server's challenge response; the
        challenge argument it is passed will be a bytes.  It should return
        an ASCII string that will be base64 encoded and sent to the server.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.
        Nr:r&)ZeolZAUTHrprQriNz4Server AUTH mechanism infinite loop. Last response: ���i�)�upper�
encode_base64rmrLrB�base64Zdecodebytes�
_MAXCHALLENGErrhr)	rZ	mechanismZ
authobjectr�Zinitial_responseZresponserr��	challengerrrr�fs2
�

��z	SMTP.authcCs0|dkrdS|jdt�|j�d�|d���S)zh Authobject to use with CRAM-MD5 authentication. Requires self.user
        and self.password to be set.Nrpr:Zmd5)�user�hmacZHMAC�passwordrmZ	hexdigest�rr�rrr�
auth_cram_md5�s
�zSMTP.auth_cram_md5cCsd|j|jfS)ze Authobject to use with PLAIN authentication. Requires self.user and
        self.password to be set.z%s%s)r�r�r�rrr�
auth_plain�szSMTP.auth_plaincCs"|dks|jdkr|jS|jSdS)ze Authobject to use with LOGIN authentication. Requires self.user and
        self.password to be set.N�)rBr�r�r�rrr�
auth_login�szSMTP.auth_logincs�|��|�d�std��|jd���dddg}�fdd�|D�}|sPtd��|||_|_|D]t}d	|���	d
d�}z4|j
|t||�|d�\}}	|d
kr�||	fWSWqbtk
r�}
z|
}W5d}
~
XYqbXqb|�dS)awLog in on an SMTP server that requires authentication.

        The arguments are:
            - user:         The user name to authenticate with.
            - password:     The password for the authentication.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method will return normally if the authentication was successful.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
         SMTPAuthenticationError  The server didn't accept the username/
                                  password combination.
         SMTPNotSupportedError    The AUTH command is not supported by the
                                  server.
         SMTPException            No suitable authentication method was
                                  found.
        r�z,SMTP AUTH extension not supported by server.zCRAM-MD5ZPLAINZLOGINcsg|]}|�kr|�qSrr)r�r��Zadvertised_authlistrr�
<listcomp>�s�zSMTP.login.<locals>.<listcomp>z(No suitable authentication method found.Zauth_�-�_r�r�N)
r�r�rr?r�rr�r�r�rsr��getattrr)rr�r�r�Zpreferred_authsZauthlistZ
authmethodZmethod_namerr�r�Zlast_exceptionrr�r�login�s0
�
�
z
SMTP.logincCs�|��|�d�std��|�d�\}}|dkr�ts<td��|dk	rT|dk	rTtd��|dk	rl|dk	rltd��|dk	s||dk	r�d	dl}|�d
t	d�|dkr�t
j||d�}|j|j
|jd
�|_
d|_d|_d|_i|_d	|_n
t||��||fS)a�Puts the connection to the SMTP server into TLS mode.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        If the server supports TLS, this will encrypt the rest of the SMTP
        session. If you provide the keyfile and certfile parameters,
        the identity of the SMTP server and client can be checked. This,
        however, depends on whether the socket module really checks the
        certificates.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        �starttlsz+STARTTLS extension not supported by server.ZSTARTTLSr;z&No SSL support included in this PythonN�4context and keyfile arguments are mutually exclusive�5context and certfile arguments are mutually exclusiver�Akeyfile and certfile are deprecated, use a custom context insteadr���certfile�keyfile�Zserver_hostname)r�r�rrL�	_have_ssl�RuntimeErrorrb�warnings�warn�DeprecationWarning�ssl�_create_stdlib_context�wrap_socketrfr=rRr�r�r?r�r)rr�r��contextr�Zreplyr�rrrr��sB
����
z
SMTP.starttlscCs^|��g}t|t�r$t|��d�}|jrZ|�d�rF|�dt|��|D]}|�|�qJ|�	||�\}}	|dkr�|dkr�|�
�n|��t||	|��i}
t|t�r�|g}|D]H}|�
||�\}}	|dkr�|dkr�||	f|
|<|dkr�|�
�t|
��q�t|
�t|�k�r|��t|
��|�|�\}}	|dk�rZ|dk�rH|�
�n|��t||	��|
S)a|This command performs an entire mail transaction.

        The arguments are:
            - from_addr    : The address sending this mail.
            - to_addrs     : A list of addresses to send this mail to.  A bare
                             string will be treated as a list with 1 address.
            - msg          : The message to send.
            - mail_options : List of ESMTP options (such as 8bitmime) for the
                             mail command.
            - rcpt_options : List of ESMTP options (such as DSN commands) for
                             all the rcpt commands.

        msg may be a string containing characters in the ASCII range, or a byte
        string.  A string is encoded to bytes using the ascii codec, and lone
        \r and \n characters are converted to \r\n characters.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.  If the server does ESMTP, message size
        and each of the specified options will be passed to it.  If EHLO
        fails, HELO will be tried and ESMTP options suppressed.

        This method will return normally if the mail is accepted for at least
        one recipient.  It returns a dictionary, with one entry for each
        recipient that was refused.  Each entry contains a tuple of the SMTP
        error code and the accompanying error message sent by the server.

        This method may raise the following exceptions:

         SMTPHeloError          The server didn't reply properly to
                                the helo greeting.
         SMTPRecipientsRefused  The server rejected ALL recipients
                                (no mail was sent).
         SMTPSenderRefused      The server didn't accept the from_addr.
         SMTPDataError          The server replied with an unexpected
                                error code (other than a refusal of
                                a recipient).
         SMTPNotSupportedError  The mail_options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.

        Note: the connection will be open even after an exception is raised.

        Example:

         >>> import smtplib
         >>> s=smtplib.SMTP("localhost")
         >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
         >>> msg = '''\
         ... From: Me@my.org
         ... Subject: testin'...
         ...
         ... This is a test '''
         >>> s.sendmail("me@my.org",tolist,msg)
         { "three@three.org" : ( 550 ,"User unknown" ) }
         >>> s.quit()

        In the above example, the message was accepted for delivery to three
        of the four addresses, and one was rejected, with the error code
        550.  If all addresses are accepted, then the method will return an
        empty dictionary.

        r:�sizezsize=%dr�i��)r�rkrlr8rmr�r�rr~r�rDr�rr�rr6r	)r�	from_addr�to_addrsr �mail_options�rcpt_optionsZ
esmtp_optsZoptionrr�Zsenderrsr�rrr�sendmail&sF@








z
SMTP.sendmailc	Cs�|��|�d�}|dkr d}nt|�dkr2d}ntd��|dkr||d|krZ||dn
||d}tj�|g�d	d}|dkr�d
d�||d||d
||dfD�}dd�tj�|�D�}t�|�}	|	d
=|	d=d}
zd�|f|���	d�Wn.t
k
�r(|�d��s td��d}
YnXt
���R}|
�r^tjj||jjdd�d�}|d�}ntj�|�}|j|	dd�|��}
W5QRX|�|||
||�S)a~Converts message to a bytestring and passes it to sendmail.

        The arguments are as for sendmail, except that msg is an
        email.message.Message object.  If from_addr is None or to_addrs is
        None, these arguments are taken from the headers of the Message as
        described in RFC 2822 (a ValueError is raised if there is more than
        one set of 'Resent-' headers).  Regardless of the values of from_addr and
        to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
        resent) of the Message object won't be transmitted.  The Message
        object is then serialized using email.generator.BytesGenerator and
        sendmail is called to transmit the message.  If the sender or any of
        the recipient addresses contain non-ASCII and the server advertises the
        SMTPUTF8 capability, the policy is cloned with utf8 set to True for the
        serialization, and SMTPUTF8 and BODY=8BITMIME are asserted on the send.
        If the server does not support SMTPUTF8, an SMTPNotSupported error is
        raised.  Otherwise the generator is called without modifying the
        policy.

        zResent-DateNr&rQzResent-z0message has more than one 'Resent-' header blockZSender�FromrcSsg|]}|dk	r|�qSrr)r��frrrr��s�z%SMTP.send_message.<locals>.<listcomp>�ToZBccZCccSsg|]}|d�qS)rQr)r��arrrr��sz
Resent-BccFr:r�z�One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)�utf8)�policy�SMTPUTF8�
BODY=8BITMIMEr)�linesep)r�r�)r�Zget_allr~rbr(r)Zgetaddresses�copyr�rm�UnicodeEncodeErrorr�r�io�BytesIO�	generatorZBytesGeneratorr�ZcloneZflatten�getvaluer�)rr r�r�r�r�ZresentZ
header_prefixZaddr_fieldsZmsg_copyZ
internationalZbytesmsg�gZflatmsgrrr�send_message�sX

�
�

�
�

�
�zSMTP.send_messagecCs<z|j}d|_|r|��W5|j}d|_|r6|��XdS)z(Close the connection to the SMTP server.N)rfrDrR)rrfrRrrrrD�sz
SMTP.closecCs.|�d�}d|_|_i|_d|_|��|S)zTerminate the SMTP session.�quitNF)rLr�r�r?r�rD)r�resrrrr��s
z	SMTP.quit)r\rN)r&)r&)r&)r&)r&)r)r)N)N)N)NNN)rr)NNrr)2rrrrrOrfrRr�r�r�r��	SMTP_PORTrdrF�_GLOBAL_DEFAULT_TIMEOUTr!rJrNrPrYr[rCrorurgrLr�r9r�r�r�r�r�r�r�r6r�r�r�r�r�r�r�r�r�r�r�r�rDr�rrrrr�sh�
0
	
!

1



3


0
	

B
8�
h�
M
c@s8eZdZdZeZdddddejddfdd�Zdd�Z	dS)	�SMTP_SSLa� This is a subclass derived from SMTP that connects over an SSL
        encrypted socket (to use this class you need a socket module that was
        compiled with SSL support). If host is not specified, '' (the local
        host) is used. If port is omitted, the standard SMTP-over-SSL port
        (465) is used.  local_hostname and source_address have the same meaning
        as they do in the SMTP class.  keyfile and certfile are also optional -
        they can contain a PEM formatted private key and certificate chain file
        for the SSL connection. context also optional, can contain a
        SSLContext, and is an alternative to keyfile and certfile; If it is
        specified both keyfile and certfile must be None.

        r&rNc	
Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}	|	�dtd�||_||_|dkrxtj||d�}||_t	�
||||||�dS)Nr�r�rr�r�r�)rbr�r�r�r�r�r�r�r�rr!)
rrGrHrEr�r�r>rAr�r�rrrr!s(���zSMTP_SSL.__init__cCsD|jdkr|�d||f�t�||f||j�}|jj||jd�}|S)Nrr^r�)rOrYrFrZrAr�r�r=)rrGrHr>Z
new_socketrrrr[s
��zSMTP_SSL._get_socket)
rrrr�
SMTP_SSL_PORTrdrFr�r!r[rrrrr��s
�
r�i�c@s0eZdZdZdZdeddfdd�Zdd	d
�ZdS)�LMTPa�LMTP - Local Mail Transfer Protocol

    The LMTP protocol, which is very similar to ESMTP, is heavily based
    on the standard SMTP client. It's common to use Unix sockets for
    LMTP, so our connect() method must support that as well as a regular
    host:port server.  local_hostname and source_address have the same
    meaning as they do in the SMTP class.  To specify a Unix socket,
    you must use an absolute path as the host, starting with a '/'.

    Authentication is supported, using the regular SMTP mechanism. When
    using a Unix socket, LMTP generally don't support or require any
    authentication, but your mileage might vary.Zlhlor&NcCstj|||||d�dS)zInitialize a new instance.)rErAN)rr!)rrGrHrErArrrr!;s�z
LMTP.__init__r\rcCs�|ddkrtj||||d�Sz(t�tjtj�|_d|_|j�|�WnBtk
r�|jdkrl|�	d|�|jr||j�
�d|_�YnX|��\}}|jdkr�|�	d|�||fS)z=Connect to the LMTP daemon, on either a Unix or a TCP socket.r�/)rANz
connect fail:r^)rrCrFZAF_UNIXZSOCK_STREAMrfrRrcrOrYrDrg)rrGrHrArr rrrrCAs"


zLMTP.connect)r\rN)rrrrr��	LMTP_PORTr!rCrrrrr�+s
�
r��__main__cCs(tj�|d�tj��tj����S)Nz: )rV�stdout�write�flush�stdinr|r+)�promptrrrr[s
rr�r��,zEnter message, end with ^D:r&zMessage length is %dr\rQ)ArrFr�r2Zemail.utilsr(Z
email.messageZemail.generatorr�r�r�rTrVZemail.base64mimerr��__all__r�r�r4r�r}r��compile�Ir�rcrrrrrrr	r
rrr
r/rr7r8r��ImportErrorr�rr�rrr�rrZfromaddrr�ZtoaddrsrSr rr|r�r~ZserverrPr�r�rrrr�<module>s�)�


	
:0
/


imaplib.cpython-38.pyc000064400000120600151450073350010613 0ustar00U

e5df��*@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZmZm
Z
ddlmZzddlZdZWnek
r�dZYnXdd	d
ddd
gZdZdZdZdZdZdZdddddddddddddddddddddddddddddddddddddddddd�)Ze�d�Ze�d�Ze�d�Ze�dej�Z e�d�Z!e�d�Z"e�d�Z#e�d ej�Z$dZ%d Z&Gd!d�d�Z'e�r�Gd"d#�d#e'�Z(e�)d#�Gd$d	�d	e'�Z*Gd%d&�d&�Z+d'�,d(�Z-d)d*�e.e-d+d��D�Z/d,d
�Z0d-d�Z1d.d�Z2d/d
�Z3e4d0k�r�ddl5Z5ddl6Z6ze5�5ej7d+d�d1�\Z8Z9Wn.e5j:k
�rpZ;zd2\Z8Z9W5dZ;[;XYnXdZ<e8D]8\Z=Z;e=d3k�r�e>e;�Zne=d4k�rze;Z<e9�sze<fZ9�qze9�s�d5Z9e9dZ?e6�@�ZAe6�6d6eAe?�p�d7f�ZBd8eAd9d:�ZCd;eAeBffd<d=d>d?d@ddeCffdAdBdCdDdEdFdGdHdIfZDdJdKdLdMd?dddeCffdHdNfZEdOdP�ZF�ze<�rbe*e<�ZGne'e?�ZGeGjHdQk�r�eDd+d�ZDeG�IdReGjJ�eG�IdSeGjKf�eDD]\ZLZ9eFeLe9��q�eFdTdU�D]<ZMe�NdVeM�ZOeO�r�eO�Pd+�ZQneM�,�dWZQeFdXeQf��q�eED]T\ZLZ9eFeLe9�ZReLe9fdLk�r.�q
eRdW�,�ZSeS�sD�q
eFdYdZd[eSdWd\f��q
eTd]�Wn.eTd^�e�s�eTd_ej7d��YnXdS)`z�IMAP4 client.

Based on RFC 2060.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
z2.58�N)�datetime�timezone�	timedelta)�DEFAULT_BUFFER_SIZETF�IMAP4�IMAP4_stream�Internaldate2tuple�Int2AP�
ParseFlags�Time2Internaldate�
�i�)Z	IMAP4REV1ri@B)�AUTH�SELECTED)�NONAUTH)rrr�LOGOUT)r)r))�APPEND�AUTHENTICATE�
CAPABILITY�CHECK�CLOSE�COPY�CREATE�DELETE�	DELETEACL�ENABLE�EXAMINE�EXPUNGE�FETCH�GETACL�
GETANNOTATION�GETQUOTA�GETQUOTAROOT�MYRIGHTS�LIST�LOGINr�LSUBZMOVE�	NAMESPACE�NOOP�PARTIAL�	PROXYAUTH�RENAME�SEARCH�SELECT�SETACL�
SETANNOTATION�SETQUOTA�SORT�STARTTLS�STATUS�STORE�	SUBSCRIBE�THREAD�UID�UNSUBSCRIBEs\+( (?P<data>.*))?s.*FLAGS \((?P<flags>[^\)]*)\)s�.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])"s.*{(?P<size>\d+)}$s
\r\n|\r|\ns%\[(?P<type>[A-Z-]+)( (?P<data>.*))?\]s$\* (?P<type>[A-Z-]+)( (?P<data>.*))?s3\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?c@s�eZdZdZGdd�de�ZGdd�de�ZGdd�de�Zdefd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdefdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dEdF�Z'dGdH�Z(d�dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-d�dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5d�dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9dodp�Z:d�drds�Z;dtdu�Z<dvdw�Z=dxdy�Z>dzd{�Z?d|d}�Z@d~d�ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d�d��ZPd�d��ZQd�d��ZRd�d��ZSdqS)�ra�IMAP4 client class.

    Instantiate with: IMAP4([host[, port]])

            host - host's name (default: localhost);
            port - port number (default: standard IMAP4 port).

    All IMAP4rev1 commands are supported by methods of the same
    name (in lower-case).

    All arguments to commands are converted to strings, except for
    AUTHENTICATE, and the last argument to APPEND which is passed as
    an IMAP4 literal.  If necessary (the string contains any
    non-printing characters or white-space and isn't enclosed with
    either parentheses or double quotes) each string is quoted.
    However, the 'password' argument to the LOGIN command is always
    quoted.  If you want to avoid having an argument string quoted
    (eg: the 'flags' argument to STORE) then enclose the string in
    parentheses (eg: "(\Deleted)").

    Each command returns a tuple: (type, [data, ...]) where 'type'
    is usually 'OK' or 'NO', and 'data' is either the text from the
    tagged response, or untagged results from command. Each 'data'
    is either a string, or a tuple. If a tuple, then the first part
    is the header of the response, and the second part contains
    the data (ie: 'literal' value).

    Errors raise the exception class <instance>.error("<reason>").
    IMAP4 server errors raise <instance>.abort("<reason>"),
    which is a sub-class of 'error'. Mailbox status changes
    from READ-WRITE to READ-ONLY raise the exception class
    <instance>.readonly("<reason>"), which is a sub-class of 'abort'.

    "error" exceptions imply a program error.
    "abort" exceptions imply the connection should be reset, and
            the command re-tried.
    "readonly" exceptions imply the command should be re-tried.

    Note: to use this module, you must read the RFCs pertaining to the
    IMAP4 protocol, as the semantics of the arguments to each IMAP4
    command are left to the invoker, not to mention the results. Also,
    most IMAP servers implement a sub-set of the commands available here.
    c@seZdZdS)zIMAP4.errorN��__name__�
__module__�__qualname__�r=r=�/usr/lib64/python3.8/imaplib.py�error�sr?c@seZdZdS)zIMAP4.abortNr9r=r=r=r>�abort�sr@c@seZdZdS)zIMAP4.readonlyNr9r=r=r=r>�readonly�srA�cCs�t|_d|_d|_i|_i|_d|_d|_d|_d|_	|�
�|�||�z|��Wn8t
k
r�z|��Wntk
r�YnX�YnXdS)NrrBFr)�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�is_readonly�tagnum�_tls_established�_mode_ascii�open�_connect�	Exception�shutdown�OSError��self�host�portr=r=r>�__init__�s&zIMAP4.__init__cCs0d|_d|_t�ttj�|_t�ttj�|_dS)NF�ascii)	�utf8_enabled�	_encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rTr=r=r>rM�szIMAP4._mode_asciicCs(d|_d|_t�t�|_t�t�|_dS)NT�utf-8)rYrZr[r\r]r_r`rarbr=r=r>�
_mode_utf8�szIMAP4._mode_utf8cCs�tt�dd��|_t�d|jdtj�|_d|_d|_	i|_
|jdkrf|�dt
�|�d	|j�|��|_d
|jkr�d|_nd|jkr�d
|_n|�|j��|��|jdkr�|�d|jf�tD]}||jkr�q�||_dS|�d��dS)Nii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)�
r�zimaplib version %sznew IMAP4 connection, tag=%sZPREAUTHr�OKr�zCAPABILITIES: %rzserver not IMAP4 compliant)r	�randomZrandint�tagprer[r\r^�tagre�_cmd_log_len�_cmd_log_idx�_cmd_logrD�_mesg�__version__�
_get_responseZwelcomerHrEr?�_get_capabilities�capabilities�AllowedVersions�PROTOCOL_VERSION)rT�versionr=r=r>rO�s:���





zIMAP4._connectcCs&|tkrt||���Std|��dS)NzUnknown IMAP4 command: '%s')�Commands�getattr�lower�AttributeError)rT�attrr=r=r>�__getattr__	szIMAP4.__getattr__cCs|S�Nr=rbr=r=r>�	__enter__szIMAP4.__enter__cGs4|jdkrdSz|��Wntk
r.YnXdS)Nr)rE�logoutrR)rT�argsr=r=r>�__exit__s
zIMAP4.__exit__cCs4|js
dn|j}t�d||j|j�t�||jf�S)Nzimaplib.open)rU�sys�auditrV�socketZcreate_connection)rTrUr=r=r>�_create_socketszIMAP4._create_socketcCs(||_||_|��|_|j�d�|_dS)z�Setup connection to remote server on "host:port"
            (default: localhost:standard IMAP4 port).
        This connection will be used by the routines:
            read, readline, send, shutdown.
        �rbN)rUrVr��sock�makefile�filerSr=r=r>rN's
z
IMAP4.opencCs|j�|�S�zRead 'size' bytes from remote.)r��read�rT�sizer=r=r>r�3sz
IMAP4.readcCs.|j�td�}t|�tkr*|�dt��|S)�Read line from remote.rfzgot more than %d bytes)r��readline�_MAXLINE�lenr?�rT�liner=r=r>r�8szIMAP4.readlinecCst�d||�|j�|�dS)�Send data to remote.zimaplib.sendN)r�r�r�Zsendall�rT�datar=r=r>�send@sz
IMAP4.sendc
Cst|j��zXz|j�tj�Wn@tk
r^}z"|jtjkrNt	|dd�dkrN�W5d}~XYnXW5|j��XdS)� Close I/O established in "open".Zwinerrorri&'N)
r��closer�rQr�Z	SHUT_RDWRrR�errnoZENOTCONNrx)rT�excr=r=r>rQFs
�zIMAP4.shutdowncCs|jS)zfReturn socket instance used to connect to IMAP4 server.

        socket = <instance>.socket()
        )r�rbr=r=r>r�VszIMAP4.socketcCsBd}|�ddg|�\}}|dr(||fS|��\}}|�|||�S)aReturn most recent 'RECENT' responses if any exist,
        else prompt server for an update using the 'NOOP' command.

        (typ, [data]) = <instance>.recent()

        'data' is None if no new messages,
        else list of RECENT responses, most recent last.
        ZRECENTrgN���)�_untagged_response�noop�rT�name�typ�datr=r=r>�recentbs	zIMAP4.recentcCs|�|dg|���S)z�Return data for response 'code' if received, or None.

        Old value for response 'code' is cleared.

        (code, [data]) = <instance>.response(code)
        N)r��upper)rT�coder=r=r>�responsesszIMAP4.responsecCsxd}|sd}|r.|d|dfdkr2d|}nd}|r@t|�}nd}t�t|�}|jrbd|d	}||_|�||||�S)
z�Append message to named mailbox.

        (typ, [data]) = <instance>.append(mailbox, flags, date_time, message)

                All args except `message' can be None.
        r�INBOXrr���(�)�(%s)NsUTF8 (�))r�MapCRLF�sub�CRLFrYrF�_simple_command)rT�mailbox�flags�	date_time�messager�rFr=r=r>�append�s

zIMAP4.appendcCsP|��}t|�j|_|�d|�\}}|dkrB|�|d�dd���d|_||fS)asAuthenticate command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - it must appear in <instance>.capabilities in the
        form AUTH=<mechanism>.

        'authobject' must be a callable object:

                data = authobject(response)

        It will be called to process server continuation responses; the
        response argument it is passed will be a bytes.  It should return bytes
        data that will be base64 encoded and sent to the server.  It should
        return None if the client abort response '*' should be sent instead.
        rrgr�rc�replacer)r��_Authenticator�processrFr�r?�decoderE)rTZ	mechanismZ
authobject�mechr�r�r=r=r>�authenticate�szIMAP4.authenticatecCs d}|�|�\}}|�|||�S)zT(typ, [data]) = <instance>.capability()
        Fetch capabilities list from server.r�r�r�r�r=r=r>�
capability�szIMAP4.capabilitycCs
|�d�S)zRCheckpoint mailbox on server.

        (typ, [data]) = <instance>.check()
        r�r�rbr=r=r>�check�szIMAP4.checkcCs$z|�d�\}}W5d|_X||fS)z�Close currently selected mailbox.

        Deleted messages are removed from writable mailbox.
        This is the recommended command before 'LOGOUT'.

        (typ, [data]) = <instance>.close()
        rr)rEr��rTr�r�r=r=r>r��szIMAP4.closecCs|�d||�S)z�Copy 'message_set' messages onto end of 'new_mailbox'.

        (typ, [data]) = <instance>.copy(message_set, new_mailbox)
        rr�)rT�message_setZnew_mailboxr=r=r>�copy�sz
IMAP4.copycCs|�d|�S)zPCreate new mailbox.

        (typ, [data]) = <instance>.create(mailbox)
        rr��rTr�r=r=r>�create�szIMAP4.createcCs|�d|�S)zPDelete old mailbox.

        (typ, [data]) = <instance>.delete(mailbox)
        rr�r�r=r=r>�delete�szIMAP4.deletecCs|�d||�S)z�Delete the ACLs (remove any rights) set for who on mailbox.

        (typ, [data]) = <instance>.deleteacl(mailbox, who)
        rr�)rTr��whor=r=r>�	deleteacl�szIMAP4.deleteaclcCsHd|jkrt�d��|�d|�\}}|dkr@d|��kr@|��||fS)zkSend an RFC5161 enable string to the server.

        (typ, [data]) = <intance>.enable(capability)
        rzServer does not support ENABLErgzUTF8=ACCEPT)rsrr?r�r�rd)rTr�r�r�r=r=r>�enable�s

zIMAP4.enablecCs d}|�|�\}}|�|||�S)z�Permanently remove deleted items from selected mailbox.

        Generates 'EXPUNGE' response for each deleted message.

        (typ, [data]) = <instance>.expunge()

        'data' is list of 'EXPUNGE'd message numbers in order received.
        rr�r�r=r=r>�expunges	z
IMAP4.expungecCs$d}|�|||�\}}|�|||�S)a#Fetch (parts of) messages.

        (typ, [data, ...]) = <instance>.fetch(message_set, message_parts)

        'message_parts' should be a string of selected parts
        enclosed in parentheses, eg: "(UID BODY[TEXT])".

        'data' are tuples of message part envelope and data.
        rr�)rTr�Z
message_partsr�r�r�r=r=r>�fetchs
zIMAP4.fetchcCs|�d|�\}}|�||d�S)zXGet the ACLs for a mailbox.

        (typ, [data]) = <instance>.getacl(mailbox)
        rZACLr��rTr�r�r�r=r=r>�getaclszIMAP4.getaclcCs"|�d|||�\}}|�||d�S)za(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs.r �
ANNOTATIONr�)rTr��entryZ	attributer�r�r=r=r>�
getannotation(szIMAP4.getannotationcCs|�d|�\}}|�||d�S)z�Get the quota root's resource usage and limits.

        Part of the IMAP4 QUOTA extension defined in rfc2087.

        (typ, [data]) = <instance>.getquota(root)
        r!�QUOTAr�)rT�rootr�r�r=r=r>�getquota0szIMAP4.getquotacCs@|�d|�\}}|�||d�\}}|�||d�\}}|||gfS)z�Get the list of quota roots for the named mailbox.

        (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
        r"r�Z	QUOTAROOTr�)rTr�r�r�ZquotaZ	quotarootr=r=r>�getquotaroot;szIMAP4.getquotaroot�""�*cCs$d}|�|||�\}}|�|||�S)z�List mailbox names in directory matching pattern.

        (typ, [data]) = <instance>.list(directory='""', pattern='*')

        'data' is list of LIST responses.
        r$r��rTZ	directory�patternr�r�r�r=r=r>�listFsz
IMAP4.listcCs<|�d||�|��\}}|dkr.|�|d��d|_||fS)z�Identify client using plaintext password.

        (typ, [data]) = <instance>.login(user, password)

        NB: 'password' will be quoted.
        r%rgr�r)r��_quoter?rE)rT�user�passwordr�r�r=r=r>�loginRs
zIMAP4.logincCs|||_|_|�d|j�S)zr Force use of CRAM-MD5 authentication.

        (typ, [data]) = <instance>.login_cram_md5(user, password)
        zCRAM-MD5)r�r�r��_CRAM_MD5_AUTH)rTr�r�r=r=r>�login_cram_md5`szIMAP4.login_cram_md5cCsBddl}t|jt�r |j�d�n|j}|jd|�||d���S)z1 Authobject to use with CRAM-MD5 authentication. rNrc� Zmd5)�hmac�
isinstancer��str�encoder�ZHMACZ	hexdigest)rTZ	challenger��pwdr=r=r>r�is
�zIMAP4._CRAM_MD5_AUTHcCs$d|_|�d�\}}|��||fS)z|Shutdown connection to server.

        (typ, [data]) = <instance>.logout()

        Returns server 'BYE' response.
        r)rEr�rQr�r=r=r>rqszIMAP4.logoutcCs$d}|�|||�\}}|�|||�S)z�List 'subscribed' mailbox names in directory matching pattern.

        (typ, [data, ...]) = <instance>.lsub(directory='""', pattern='*')

        'data' are tuples of message part envelope and data.
        r&r�r�r=r=r>�lsub~sz
IMAP4.lsubcCs|�d|�\}}|�||d�S)z�Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).

        (typ, [data]) = <instance>.myrights(mailbox)
        r#r�r�r=r=r>�myrights�szIMAP4.myrightscCs d}|�|�\}}|�|||�S)zb Returns IMAP namespaces ala rfc2342

        (typ, [data, ...]) = <instance>.namespace()
        r'r�r�r=r=r>�	namespace�szIMAP4.namespacecCs |jdkr|�|j�|�d�S)zFSend NOOP command.

        (typ, [data]) = <instance>.noop()
        rhr()rD�_dump_urrHr�rbr=r=r>r��s
z
IMAP4.noopcCs(d}|�|||||�\}}|�||d�S)z�Fetch truncated part of a message.

        (typ, [data, ...]) = <instance>.partial(message_num, message_part, start, length)

        'data' is tuple of message part envelope and data.
        r)rr�)rTZmessage_numZmessage_part�startZlengthr�r�r�r=r=r>�partial�sz
IMAP4.partialcCsd}|�d|�S)z�Assume authentication as "user".

        Allows an authorised administrator to proxy into any user's
        mailbox.

        (typ, [data]) = <instance>.proxyauth(user)
        r*r�)rTr�r�r=r=r>�	proxyauth�s	zIMAP4.proxyauthcCs|�d||�S)zkRename old mailbox name to new.

        (typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
        r+r�)rTZ
oldmailboxZ
newmailboxr=r=r>�rename�szIMAP4.renamecGsTd}|r2|jrt�d��|j|d|f|��\}}n|j|f|��\}}|�|||�S)z�Search mailbox for matching messages.

        (typ, [data]) = <instance>.search(charset, criterion, ...)

        'data' is space separated list of matching message numbers.
        If UTF8 is enabled, charset MUST be None.
        r,z'Non-None charset not valid in UTF8 mode�CHARSET)rYrr?r�r�)rT�charsetZcriteriar�r�r�r=r=r>�search�s
zIMAP4.searchr�FcCs�i|_||_|rd}nd}|�||�\}}|dkr@d|_||fSd|_d|jkrx|sx|jdkrj|�|j�|�d|��||j�d	d
g�fS)atSelect a mailbox.

        Flush all untagged responses.

        (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)

        'data' is count of messages in mailbox ('EXISTS' response).

        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via <instance>.response('FLAGS') etc.
        rr-rgrr�	READ-ONLYrfz%s is not writable�EXISTSN)rHrJr�rErDr�rA�get)rTr�rAr�r�r�r=r=r>�select�s"
�
zIMAP4.selectcCs|�d|||�S)zZSet a mailbox acl.

        (typ, [data]) = <instance>.setacl(mailbox, who, what)
        r.r�)rTr�r�Zwhatr=r=r>�setacl�szIMAP4.setaclcGs |jd|��\}}|�||d�S)z_(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs.r/r�)r/r�)rTr�r�r�r=r=r>�
setannotationszIMAP4.setannotationcCs |�d||�\}}|�||d�S)ziSet the quota root's resource limits.

        (typ, [data]) = <instance>.setquota(root, limits)
        r0r�r�)rTr�Zlimitsr�r�r=r=r>�setquota	szIMAP4.setquotacGsFd}|d|dfdkr d|}|j|||f|��\}}|�|||�S)z�IMAP4rev1 extension SORT command.

        (typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
        r1rr�r�r�r�)rTZ
sort_criteriar��search_criteriar�r�r�r=r=r>�sorts
z
IMAP4.sortNcCs�d}ts|�d��|jr"|�d��||jkr6|�d��|dkrFt��}|�|�\}}|dkr�|j|j	|j
d�|_	|j	�d�|_d|_|�
�n
|�d	��|�|||�S)
Nr2zSSL support missingzTLS session already establishedzTLS not supported by serverrg�Zserver_hostnamer�TzCouldn't establish TLS session)�HAVE_SSLr?rLr@rs�ssl�_create_stdlib_contextr��wrap_socketr�rUr�r�rrr�)rT�ssl_contextr�r�r�r=r=r>�starttls s&



�

zIMAP4.starttlscCs$d}|�|||�\}}|�|||�S)zpRequest named status conditions for mailbox.

        (typ, [data]) = <instance>.status(mailbox, names)
        r3r�)rTr��namesr�r�r�r=r=r>�status7szIMAP4.statuscCs>|d|dfdkrd|}|�d|||�\}}|�||d�S)z�Alters flag dispositions for messages in mailbox.

        (typ, [data]) = <instance>.store(message_set, command, flags)
        rr�r�r�r4rr�)rTr��commandr�r�r�r=r=r>�storeCszIMAP4.storecCs|�d|�S)zYSubscribe to new mailbox.

        (typ, [data]) = <instance>.subscribe(mailbox)
        r5r�r�r=r=r>�	subscribeNszIMAP4.subscribecGs*d}|j|||f|��\}}|�|||�S)z�IMAPrev1 extension THREAD command.

        (type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
        r6r�)rTZthreading_algorithmr�r�r�r�r�r=r=r>�threadVszIMAP4.threadc	Gs�|��}|tkr|�d|��|jt|krL|�d||jd�t|�f��d}|j||f|��\}}|dkrt|}nd}|�|||�S)z�Execute "command arg ..." with messages identified by UID,
                rather than message number.

        (typ, [data]) = <instance>.uid(command, arg1, arg2, ...)

        Returns response appropriate to 'command'.
        zUnknown IMAP4 UID command: %s�9command %s illegal in state %s, only allowed in states %s�, r7)r,r1r6r)r�rwr?rE�joinr�r�)rTrr�r�r�r�r=r=r>�uid`s��z	IMAP4.uidcCs|�d|�S)z_Unsubscribe from old mailbox.

        (typ, [data]) = <instance>.unsubscribe(mailbox)
        r8r�r�r=r=r>�unsubscribeyszIMAP4.unsubscribecGs,|��}|tkr|jft|<|j|f|��S)aAllow simple extension commands
                notified by server in CAPABILITY response.

        Assumes command is legal in current state.

        (typ, [data]) = <instance>.xatom(name, arg, ...)

        Returns response appropriate to extension command `name'.
        )r�rwrEr��rTr�r�r=r=r>�xatom�s
zIMAP4.xatomc	Csb|dkrd}|j}|jdkr<|�d|t|�|d��|f�||krT||�|�n
|g||<dS)N��z#untagged_responses[%s] %s += ["%r"]rB)rHrDror�r�r�)rTr�r�Zurr=r=r>�_append_untagged�s
�zIMAP4._append_untaggedcCs,|j�d�}|r(|�|d�|jd���dS)N�BYEr�r�)rHr�r@r�rZ)rT�byer=r=r>�
_check_bye�szIMAP4._check_byec

Gs2|jt|kr4d|_|�d||jd�t|�f��dD]}||jkr8|j|=q8d|jkrj|jsj|�d��|��}t	||j
�}|d|}|D]0}|dkr�q�t|t�r�t	||j
�}|d|}q�|j}|dk	�r
d|_t
|�t
|j�kr�|}nd}|t	dt|�|j
�}|jdk�r&|�d	|�n|�d	|�z|�|t�Wn2tk
�rx}	z|�d
|	��W5d}	~	XYnX|dk�r�|S|���r�|j|�r�|S�q�|�r�||j�}|jdk�r�|�dt|��z|�|�|�t�Wn2tk
�r}	z|�d
|	��W5d}	~	XYnX|�s��q.�q�|S)Nrr�rg�NO�BADr�z#mailbox status changed to READ-ONLY� z {%s}�z> %rzsocket error: %szwrite literal size %s)rErwrFr?rrHrJrA�_new_tag�bytesrZr�r��type�_commandr�rDro�_logr�r�rRr@rqrGrI)
rTr�r�r��tagr��argrFZ	literator�valr=r=r>r�sl��


�


 



 zIMAP4._commandc
Cs�|dk}|s|��z|j||d�\}}Wnj|jk
r`}z|�d||f��W5d}~XYn6|jk
r�}z|�d||f��W5d}~XYnX|s�|��|dkr�|�d|||f��||fS)Nr)�
expect_byezcommand: %s => %srz%s command error: %s %s)r�_get_tagged_responser@r?)rTr�rrr�r�rr=r=r>�_command_complete�s"$zIMAP4._command_completecCsJ|��\}}|dgkr |�d��t|d|j�}|��}t|���|_dS)Nz"no CAPABILITY response from serverr�)r�r?r�rZr��tuple�splitrsr�r=r=r>rr
s

zIMAP4._get_capabilitiescCs�|��}|�|j|�rr|j�d�}||jkr:|�d|��|j�d�}t||j�}|j�d�}||gf|j|<�nd}|�t	|�s�|�|j
|�r�|j�d�}|jdkr�|�t|�r�|j�d�|_dS|�d|��|j�d�}t||j�}|j�d�}|dk�rd}|�r|d|}|�|j
|��rvt|j�d	��}|jd
k�rP|�d|�|�|�}|�|||f�|��}�q|�||�|dk�r�|�t|��r�|j�d�}t||j�}|�||j�d��|jd
k�r�|dk�r�|�d||f�|S)Nrzunexpected tagged response: %rrr�Zdata2zunexpected response: %rr
rr�rzread literal size %srrf)rrrz%s response: %r)�	_get_line�_matchrk�mo�grouprGr@r�rZ�Untagged_responsera�ContinuationrIr_�intrDror�r�
Response_code)rT�resprr�r�Zdat2r�r�r=r=r>rqsP



zIMAP4._get_responsec
Cs�|j|}|dk	r|j|=|S|rDd}|j�|d�}|dk	rD||fS|��z|��Wq|jk
r�}z|jdkr~|���W5d}~XYqXqdS)Nrrf)rGrH�poprrqr@rD�	print_log)rTrr �resultr�rrr=r=r>r!cs 

zIMAP4._get_tagged_responsecCsf|��}|s|�d��|�d�s.|�d|��|dd�}|jdkrT|�d|�n|�d|�|S)Nzsocket error: EOFrz#socket error: unterminated line: %r���rz< %r)r�r@�endswithrDrorr�r=r=r>r%�s


zIMAP4._get_linecCsD|�|�|_|jdk	r:|jdkr:|�d|j|j��f�|jdk	S)Nrz	matched %r => %r)�matchr'rDror��groups)rTZcre�sr=r=r>r&�szIMAP4._matchcCs2|jtt|j�|j�}|jd|_d|j|<|S)Nrf)rjrr�rKrZrG)rTrr=r=r>r�s
zIMAP4._new_tagcCs$|�dd�}|�dd�}d|dS)N�\z\\�"z\")r�)rTrr=r=r>r��szIMAP4._quotecGs|�||j|f|���Sr})r"rrr=r=r>r��szIMAP4._simple_commandcCsT|dkr||fS||jkr$|dgfS|j�|�}|jdkrL|�d||f�||fS)Nrrzuntagged_responses[%s] => %s)rHr.rDro)rTr�r�r�r�r=r=r>r��s


zIMAP4._untagged_responsecCsN|dkrt��}t�dt�|��}tj�d||dd|f�tj��dS)Nz%M:%Sz
  %s.%02d %s
�d)�time�strftime�	localtimer��stderr�write�flush)rTr5ZsecsZtmr=r=r>ro�s
zIMAP4._mesgcCs>|��}|sdSd}tdd�|�}|�d||�|�f�dS)Nz
		cSs*d|d|ddr"d�|d�p$dfS)Nz%s: "%s"rrfz" "rB)r)�xr=r=r>�<lambda>�r
z IMAP4._dump_ur.<locals>.<lambda>zuntagged responses dump:%s%s)�items�mapror)rT�dict�l�tr=r=r>r��szIMAP4._dump_urcCs8|t��f|j|j<|jd7_|j|jkr4d|_dS)Nrfr)r9rnrmrlr�r=r=r>r�sz
IMAP4._logcCsl|�dt|j��|j|j}}|rhz|j|j|�WnYnX|d7}||jkr^d}|d8}q"dS)Nzlast %d IMAP4 interactions:rfr)ror�rnrmrl)rT�i�nr=r=r>r/�s
zIMAP4.print_log)r�r�)r�r�)r�F)N)F)N)Tr:r;r<�__doc__rPr?r@rA�
IMAP4_PORTrWrMrdrOr|r~r�r�rNr�r�r�rQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	r
rrrrr"rrrqr!r%r&rr�r�r�ror�rr/r=r=r=r>r�s�,*
		
	



 	

M	P
!
c@s:eZdZdZdedddfdd�Zdd�Zdefdd	�ZdS)
�	IMAP4_SSLa3IMAP4 client class over SSL connection

        Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile[, ssl_context]]]]])

                host - host's name (default: localhost);
                port - port number (default: standard IMAP4 SSL port);
                keyfile - PEM formatted file that contains your private key (default: None);
                certfile - PEM formatted certificate chain file (default: None);
                ssl_context - a SSLContext object that contains your certificate chain
                              and private key (default: None)
                Note: if ssl_context is provided, then parameters keyfile or
                certfile should not be set otherwise ValueError is raised.

        for more documentation see the docstring of the parent class IMAP4.
        rBNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
|||�dS)Nz8ssl_context and keyfile arguments are mutually exclusivez9ssl_context and certfile arguments are mutually exclusiverzEkeyfile and certfile are deprecated, use a custom ssl_context instead�)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrMrLr�r�r�rrW)rTrUrVrMrLr�rOr=r=r>rW�s$��zIMAP4_SSL.__init__cCst�|�}|jj||jd�S)Nr�)rr�r�r�rU)rTr�r=r=r>r�s
�zIMAP4_SSL._create_socketcCst�|||�dS)z�Setup connection to remote server on "host:port".
                (default: localhost:standard IMAP4 SSL port).
            This connection will be used by the routines:
                read, readline, send, shutdown.
            N)rrNrSr=r=r>rNszIMAP4_SSL.open)r:r;r<rH�IMAP4_SSL_PORTrWr�rNr=r=r=r>rJ�s�
rJc@sBeZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)rz�IMAP4 client class over a stream

    Instantiate with: IMAP4_stream(command)

            "command" - a string that can be passed to subprocess.Popen()

    for more documentation see the docstring of the parent class IMAP4.
    cCs||_t�|�dSr})rrrW)rTrr=r=r>rW/szIMAP4_stream.__init__NcCsNd|_d|_d|_d|_tj|jttjtjddd�|_	|j	j
|_|j	j|_
dS)z�Setup a stream connection.
        This connection will be used by the routines:
            read, readline, send, shutdown.
        NT)�bufsize�stdin�stdout�shellZ	close_fds)rUrVr�r��
subprocess�Popenrr�PIPEr�rT�	writefilerU�readfilerSr=r=r>rN4s�
zIMAP4_stream.opencCs|j�|�Sr�)r[r�r�r=r=r>r�DszIMAP4_stream.readcCs
|j��S)r�)r[r�rbr=r=r>r�IszIMAP4_stream.readlinecCs|j�|�|j��dS)r�N)rZr=r>r�r=r=r>r�NszIMAP4_stream.sendcCs"|j��|j��|j��dS)r�N)r[r�rZr��waitrbr=r=r>rQTs

zIMAP4_stream.shutdown)NN)
r:r;r<rHrWrNr�r�r�rQr=r=r=r>r#s

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zcPrivate class to provide en/decoding
            for base64-based authentication conversation.
    cCs
||_dSr})r�)rTZmechinstr=r=r>rWbsz_Authenticator.__init__cCs&|�|�|��}|dkrdS|�|�S)N�*)r�r�r�)rTr�Zretr=r=r>r�esz_Authenticator.processcCsnd}t|t�r|�d�}|rjt|�dkrB|dd�}|dd�}n|}d}t�|�}|r||dd�}q|S)Nr
rc�0r�)r�r�r�r��binasciiZ
b2a_base64)rT�inpZouprE�er=r=r>r�ks	


z_Authenticator.encodecCs|sdSt�|�S)Nr
)r_Z
a2b_base64)rTr`r=r=r>r��sz_Authenticator.decodeN)r:r;r<rHrWr�r�r�r=r=r=r>r�\s
r�z0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decr�cCsi|]\}}|��|d�qS)rf)r�)�.0rGr5r=r=r>�
<dictcomp>�srcrfc	Cs�t�|�}|sdSt|�d�}|�d�}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}t|�d	��}	t|�d
��}
|	d|
d}|dkr�|}||||||d
d
d
f	}t�|�|}
t�|
�S)z�Parse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time tuple or None if the string has wrong format.
    N�mon�zonen�day�year�hour�min�sec�zoneh�zonem�<�-r�)	�InternalDater3�Mon2numr(r+�calendarZtimegmr9r;)r-r'rdrerfrgrhrirjrkrlZzoneZtt�utcr=r=r>r�s$

cCs@d}d}tt|��}|r<t|d�\}}|||d�|}q|S)z-Convert integer to A-P string representation.r
sABCDEFGHIJKLMNOP�rf)r+�abs�divmod)ZnumrZAP�modr=r=r>r	�scCs$t�|�}|sdSt|�d����S)z-Convert IMAP4 flags response to python tuple.r=r�)�Flagsr3r#r(r$)r-r'r=r=r>r
�s
cCst|ttf�r"t�|tj���}n�t|t�r�z
|j	}WnZt
k
r�tjr�|d}|dkrpt�
t�|��d}tjtjf|}ntj}YnXt|d�}t|dd�dt|�i�}nLt|t�r�|jdkr�td��|}n*t|t�r�|d|dfd	kr�|Std
��d�t|j�}|�|�S)a�Convert date_time to IMAP4 INTERNALDATE representation.

    Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'.  The
    date_time argument can be a number (int or float) representing
    seconds since epoch (as returned by time.time()), a 9-tuple
    representing local time, an instance of time.struct_time (as
    returned by time.localtime()), an aware datetime instance or a
    double-quoted string.  In the last case, it is assumed to already
    be in the correct format.
    �r�)ZsecondsN��tzinfozdate_time must be awarer)r7r7zdate_time not of a known typez"%d-{}-%Y %H:%M:%S %z")r�r+�floatrZ
fromtimestamprrrZ
astimezoner#�	tm_gmtoffrzr9�daylightr;�mktime�altzonerrzrNr��format�MonthsZmonthr:)r�ZdtZgmtoffZdstZdeltaZfmtr=r=r>r�s2�





�__main__zd:s:)r=r=z-dz-s)rBzIMAP password for %s on %s: Z	localhostzJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s�
)r�Zlfr�)r�)�
/tmp/xxx 1)r�)r�z/tmp/yyy)r��
/tmp/yyz 2r�r�)r�)z/tmpzyy*)r�r�)r�)NZSUBJECTZtest)r�)�1z(FLAGS INTERNALDATE RFC822))r)r��FLAGSz
(\Deleted))r�r=)r�r=)r�r=)r�r=)r�r=)r�)ZUIDVALIDITY)r	)r,ZALL)r�)r�)rr=cCsLt�d||f�tt|�|�\}}t�d|||f�|dkrH|d�|S)Nz%s %sz%s => %s %srr)�Mrorx)�cmdr�r�r�r=r=r>�run'sr�rzPROTOCOL_VERSION = %szCAPABILITIES = %rr�)z/tmp/zyy%z.*"([^"]+)"$r�r�r	rz%sz:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)z
All tests OK.z
Tests failed.z8
If you would like to see debugging output,
try: %s -d5
)UrHrpr_r�rir[r�rWr�r9rqrrr�iorr�r��ImportError�__all__r�rCrIrRrtr�rwr\r*rwror^r_r�r,r)rar]r`rrJr�rr�r$r��	enumeraterprr	r
rr:ZgetoptZgetpass�argvZoptlistr�r?rZstream_command�optr+rUZgetuserZUSERZPASSWDZ	test_mesgZ	test_seq1Z	test_seq2r�r�rErorursr�Zmlr3r'r(�pathr�r	�printr=r=r=r>�<module>sZH
�	�/



	

�l4
9,
#
)





��


�
�keyword.cpython-38.opt-1.pyc000064400000001750151450073350011625 0ustar00U

e5d��#@sddZddgZddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g#Zee�jZd&S)'a�Keywords (from "Grammar/Grammar")

This file is automatically generated; please don't muck it up!

To update the symbols in this file, 'cd' to the top directory of
the python source tree and run:

    python3 -m Parser.pgen.keywordgen Grammar/Grammar                                       Grammar/Tokens                                       Lib/keyword.py

Alternatively, you can run 'make regen-keyword'.
�	iskeyword�kwlist�False�None�True�and�as�assert�async�await�break�class�continue�def�del�elif�else�except�finally�for�from�global�if�import�in�is�lambda�nonlocal�not�or�pass�raise�return�try�while�with�yieldN)�__doc__�__all__r�	frozenset�__contains__r�r*r*�/usr/lib64/python3.8/keyword.py�<module>sL�&token.cpython-38.pyc000064400000004667151450073350010334 0ustar00U

e5d@	�0@s�dZddddgZdZdZdZdZd	Zd
ZdZdZ	d
Z
dZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d,Z)d-Z*d.Z+d/Z,d0Z-d1Z.d2Z/d3Z0d4Z1d5Z2d6Z3d7Z4d8Z5d9Z6d:Z7d;Z8d<Z9d=Z:d>Z;d?Z<d@Z=dAZ>dBZ?dCZ@dDZAdEZBdFdG�eC��D�D�ZEe�FeE�G��eee*ee+e	e
ee%e0e(ee&eee'e5ee6ee1e2e)e
e7eee#e.eeeee e$e/e3e4eee"e-eee,ee!dH�/ZHdId�ZIdJd�ZJdKd�ZKdLS)MzToken constants.�tok_name�
ISTERMINAL�
ISNONTERMINAL�ISEOF����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�cCs*i|]"\}}t|t�r|�d�s||�qS)�_)�
isinstance�int�
startswith)�.0�name�value�rM�/usr/lib64/python3.8/token.py�
<dictcomp>Js


�rO)/z!=�%z%=�&z&=�(�)�*z**z**=z*=�+z+=�,�-z-=z->�.z...�/z//z//=z/=�:z:=�;�<z<<z<<=z<=�=z==�>z>=z>>z>>=�@z@=�[�]�^z^=�{�|z|=�}�~cCs|tkS�N��	NT_OFFSET��xrMrMrNr�scCs|tkSrgrhrjrMrMrNr�scCs|tkSrg)�	ENDMARKERrjrMrMrNr�sN)L�__doc__�__all__rl�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENT�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�RARROW�ELLIPSIS�
COLONEQUAL�OP�AWAIT�ASYNC�TYPE_IGNORE�TYPE_COMMENT�
ERRORTOKEN�COMMENT�NL�ENCODING�N_TOKENSri�globals�itemsr�extend�values�EXACT_TOKEN_TYPESrrrrMrMrMrN�<module>s���2copyreg.cpython-38.pyc000064400000010340151450073350010645 0ustar00U

e5d��@s�dZdddddgZiZddd�Zdd�ZzeWnek
rDYnXd	d
�Zeeee�dd�Zd
Z	dd�Z
dd�Zdd�Zdd�Z
iZiZiZdd�Zdd�Zdd�ZdS)z�Helper to provide extensibility for pickle.

This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
�pickle�constructor�
add_extension�remove_extension�clear_extension_cacheNcCs,t|�std��|t|<|dk	r(t|�dS)Nz$reduction functions must be callable)�callable�	TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�/usr/lib64/python3.8/copyreg.pyrs
cCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rscCst|j|jffS�N)�complex�real�imag)�crrr
�pickle_complex"srcCs<|tkrt�|�}n$|�||�}|jtjkr8|�||�|Sr)r�__new__�__init__)�cls�base�state�objrrr
�_reconstructor)sricCs�|dkst�|j}|jD]}t|d�r|jt@sq:qt}|tkrHd}n"||krbtd|j�d���||�}|||f}z
|j	}Wn\t
k
r�t|dd�r�td|j�d|���d�z
|j}Wnt
k
r�d}YnXYnX|�}|r�t
||fSt
|fSdS)N��	__flags__zcannot pickle z object�	__slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )�AssertionError�	__class__�__mro__�hasattrr�	_HEAPTYPErr�__name__�__getstate__�AttributeError�getattr�__dict__r)�self�protorrr�args�getstate�dictrrr
�
_reduce_ex6s6


�

r.cGs|j|f|��Sr�r)rr+rrr
�
__newobj__Zsr0cCs|j|f|�|�S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with
    keyword-only arguments to be pickled correctly.
    r/)rr+�kwargsrrr
�
__newobj_ex__]sr2cCs�|j�d�}|dk	r|Sg}t|d�s(n�|jD]�}d|jkr.|jd}t|t�rV|f}|D]^}|dkrjqZqZ|�d�r�|�d�s�|j�	d�}|r�|�
d||f�q�|�
|�qZ|�
|�qZq.z
||_WnYnX|S)a�Return a list of slot names for a given class.

    This needs to find slots defined by the class and its bases, so we
    can't simply return the __slots__ attribute.  We must walk down
    the Method Resolution Order and concatenate the __slots__ of each
    class found there.  (This assumes classes don't modify their
    __slots__ attribute to misrepresent their slots after the class is
    defined.)
    �
__slotnames__Nr)r(�__weakref__�__�_z_%s%s)r(�getr"r!�
isinstance�str�
startswith�endswithr$�lstrip�appendr3)r�namesr�slots�name�strippedrrr
�
_slotnamescs2





rBcCs�t|�}d|krdks&ntd��||f}t�|�|krNt�|�|krNdS|tkrjtd|t|f��|tkr�td|t|f��|t|<|t|<dS)zRegister an extension code.�i���zcode out of rangeNz)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr7�_inverted_registry��moduler@�code�keyrrr
r�s$�
�
�cCsR||f}t�|�|ks$t�|�|kr4td||f��t|=t|=|tkrNt|=dS)z0Unregister an extension code.  For testing only.z%key %s is not registered with code %sN)rFr7rGrE�_extension_cacherHrrr
r�s��cCst��dSr)rL�clearrrrr
r�s)N)�__doc__�__all__rrrr�	NameErrorrrr#r.r0r2rBrFrGrLrrrrrrr
�<module>s4�

	$<threading.cpython-38.pyc000064400000116052151450073350011151 0ustar00U

e5d���@s2dZddlZddlZddlZddlmZddl	m
Z
ddlmZ
mZzddlmZWn ek
rtddlmZYnXddd	d
ddd
ddddddddddddddddgZejZejZejZejZzejZdZe�d�Wnek
r�d ZYnXej Z!z
ej"Z#Wnek
�rdZ#YnXej$Z$[da%da&d!d�Z'd"d�Z(eZ)d#d�Z"Gd$d%�d%�Z*e*Z+Gd&d	�d	�Z,Gd'd�d�Z-Gd(d�de-�Z.Gd)d�d�Z/Gd*d�d�Z0Gd+d�de1�Z2e�j3Z4e4�dLd-d.�Z5e�a6iZ7iZ8e
�Z9e�a:e;�a<Gd/d�d�Z=zdd0lm>a?m@ZAWnHek
�rVdd1lBmCZDdd2lmEZEeEdd3�Z@d4d�ZAd5d�a?YnXd6d7�ZFGd8d�de=�ZGGd9d:�d:e=�ZHGd;d<�d<e=�ZId=d
�ZJeJZKd>d�ZLeLZMd?d@�ZNdAd�ZOddBlmPZPeH�aQdCdD�ZRdEd�ZSzddFlmTZUWn"ek
�rddGlVmUZUYnXdHdI�ZWeXedJ��r.ejYeWdK�dS)Mz;Thread module emulating a subset of Java's threading model.�N)�	monotonic)�WeakSet)�islice�count)�deque�	get_ident�active_count�	Condition�current_thread�	enumerate�main_thread�TIMEOUT_MAX�Event�Lock�RLock�	Semaphore�BoundedSemaphore�Thread�Barrier�BrokenBarrierError�Timer�ThreadError�
setprofile�settrace�local�
stack_size�
excepthook�ExceptHookArgsT�
get_native_idFcCs|adS)z�Set a profile function for all threads started from the threading module.

    The func will be passed to sys.setprofile() for each thread, before its
    run() method is called.

    N)�
_profile_hook��func�r"�!/usr/lib64/python3.8/threading.pyr9scCs|adS)z�Set a trace function for all threads started from the threading module.

    The func will be passed to sys.settrace() for each thread, before its run()
    method is called.

    N)�_trace_hookr r"r"r#rCscOstdkrt||�St||�S)a2Factory function that returns a new reentrant lock.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it again
    without blocking; the thread must release it once for each time it has
    acquired it.

    N)�_CRLock�_PyRLock)�args�kwargsr"r"r#rQs	
c@sVeZdZdZdd�Zdd�Zddd	�ZeZd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�_RLocka,This class implements reentrant lock objects.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it
    again without blocking; the thread must release it once for each time it
    has acquired it.

    cCst�|_d|_d|_dS�Nr)�_allocate_lock�_block�_owner�_count��selfr"r"r#�__init__hsz_RLock.__init__c	Cs^|j}zt|j}Wntk
r(YnXd|j��r:dnd|jj|jj||j	t
t|��fS)Nz)<%s %s.%s object owner=%r count=%d at %s>�lockedZunlocked)r-�_active�name�KeyErrorr,r2�	__class__�
__module__�__qualname__r.�hex�id)r0�ownerr"r"r#�__repr__ms
�z_RLock.__repr__T���cCsDt�}|j|kr"|jd7_dS|j�||�}|r@||_d|_|S)aAcquire a lock, blocking or non-blocking.

        When invoked without arguments: if this thread already owns the lock,
        increment the recursion level by one, and return immediately. Otherwise,
        if another thread owns the lock, block until the lock is unlocked. Once
        the lock is unlocked (not owned by any thread), then grab ownership, set
        the recursion level to one, and return. If more than one thread is
        blocked waiting until the lock is unlocked, only one at a time will be
        able to grab ownership of the lock. There is no return value in this
        case.

        When invoked with the blocking argument set to true, do the same thing
        as when called without arguments, and return true.

        When invoked with the blocking argument set to false, do not block. If a
        call without an argument would block, return false immediately;
        otherwise, do the same thing as when called without arguments, and
        return true.

        When invoked with the floating-point timeout argument set to a positive
        value, block for at most the number of seconds specified by timeout
        and as long as the lock cannot be acquired.  Return true if the lock has
        been acquired, false if the timeout has elapsed.

        �)rr-r.r,�acquire)r0�blocking�timeout�me�rcr"r"r#r?|s
z_RLock.acquirecCs<|jt�krtd��|jd|_}|s8d|_|j��dS)amRelease a lock, decrementing the recursion level.

        If after the decrement it is zero, reset the lock to unlocked (not owned
        by any thread), and if any other threads are blocked waiting for the
        lock to become unlocked, allow exactly one of them to proceed. If after
        the decrement the recursion level is still nonzero, the lock remains
        locked and owned by the calling thread.

        Only call this method when the calling thread owns the lock. A
        RuntimeError is raised if this method is called when the lock is
        unlocked.

        There is no return value.

        �cannot release un-acquired lockr>N)r-r�RuntimeErrorr.r,�release)r0rr"r"r#rF�sz_RLock.releasecCs|��dS�N�rF�r0�t�v�tbr"r"r#�__exit__�sz_RLock.__exit__cCs|j��|\|_|_dSrG)r,r?r.r-)r0�stater"r"r#�_acquire_restore�s
z_RLock._acquire_restorecCs<|jdkrtd��|j}d|_|j}d|_|j��||fS)NrrD)r.rEr-r,rF)r0rr;r"r"r#�
_release_save�s

z_RLock._release_savecCs|jt�kSrG)r-rr/r"r"r#�	_is_owned�sz_RLock._is_ownedN)Tr=)
�__name__r7r8�__doc__r1r<r?�	__enter__rFrMrOrPrQr"r"r"r#r)^s	
$
r)c@steZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zddd�Zddd�Z
dd�ZeZdS)r	ajClass that implements a condition variable.

    A condition variable allows one or more threads to wait until they are
    notified by another thread.

    If the lock argument is given and not None, it must be a Lock or RLock
    object, and it is used as the underlying lock. Otherwise, a new RLock object
    is created and used as the underlying lock.

    NcCs�|dkrt�}||_|j|_|j|_z|j|_Wntk
rDYnXz|j|_Wntk
rfYnXz|j|_Wntk
r�YnXt�|_	dSrG)
r�_lockr?rFrP�AttributeErrorrOrQ�_deque�_waiters�r0�lockr"r"r#r1�s$zCondition.__init__cCs
|j��SrG)rUrTr/r"r"r#rT�szCondition.__enter__cGs|jj|�SrG)rUrM)r0r'r"r"r#rM�szCondition.__exit__cCsd|jt|j�fS)Nz<Condition(%s, %d)>)rU�lenrXr/r"r"r#r<�szCondition.__repr__cCs|j��dSrG)rUrFr/r"r"r#rP�szCondition._release_savecCs|j��dSrG)rUr?)r0�xr"r"r#rOszCondition._acquire_restorecCs"|j�d�r|j��dSdSdS)NrFT)rUr?rFr/r"r"r#rQs
zCondition._is_ownedcCs�|��std��t�}|��|j�|�|��}d}z>|dkrN|��d}n |dkrd|�d|�}n
|�d�}|W�S|�|�|s�z|j�|�Wnt	k
r�YnXXdS)akWait until notified or until a timeout occurs.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks until it is
        awakened by a notify() or notify_all() call for the same condition
        variable in another thread, or until the optional timeout occurs. Once
        awakened or timed out, it re-acquires the lock and returns.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        When the underlying lock is an RLock, it is not released using its
        release() method, since this may not actually unlock the lock when it
        was acquired multiple times recursively. Instead, an internal interface
        of the RLock class is used, which really unlocks it even when it has
        been recursively acquired several times. Another internal interface is
        then used to restore the recursion level when the lock is reacquired.

        zcannot wait on un-acquired lockFNTr)
rQrEr+r?rX�appendrPrO�remove�
ValueError)r0rA�waiterZsaved_stateZgotitr"r"r#�waits*

zCondition.waitcCsXd}|}|�}|sT|dk	rB|dkr.t�|}n|t�}|dkrBqT|�|�|�}q|S)z�Wait until a condition evaluates to True.

        predicate should be a callable which result will be interpreted as a
        boolean value.  A timeout may be provided giving the maximum time to
        wait.

        Nr)�_timera)r0Z	predicaterA�endtimeZwaittime�resultr"r"r#�wait_for>s

zCondition.wait_forr>c	Csf|��std��|j}tt||��}|s,dS|D]0}|��z|�|�Wq0tk
r^Yq0Xq0dS)aKWake up one or more threads waiting on this condition, if any.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method wakes up at most n of the threads waiting for the condition
        variable; it is a no-op if no threads are waiting.

        z!cannot notify on un-acquired lockN)rQrErXrW�_islicerFr^r_)r0�nZall_waitersZwaiters_to_notifyr`r"r"r#�notifyUs
zCondition.notifycCs|�t|j��dS)z�Wake up all threads waiting on this condition.

        If the calling thread has not acquired the lock when this method
        is called, a RuntimeError is raised.

        N)rhr[rXr/r"r"r#�
notify_alllszCondition.notify_all)N)N)N)r>)rRr7r8rSr1rTrMr<rPrOrQrarerhriZ	notifyAllr"r"r"r#r	�s
	
0

	c@s8eZdZdZd
dd�Zddd�ZeZd	d
�Zdd�ZdS)raGThis class implements semaphore objects.

    Semaphores manage a counter representing the number of release() calls minus
    the number of acquire() calls, plus an initial value. The acquire() method
    blocks if necessary until it can return without making the counter
    negative. If not given, value defaults to 1.

    r>cCs&|dkrtd��tt��|_||_dS)Nrz$semaphore initial value must be >= 0)r_r	r�_cond�_value�r0�valuer"r"r#r1�szSemaphore.__init__TNc	Cs�|s|dk	rtd��d}d}|j�f|jdkrr|s4q�|dk	rd|dkrPt�|}n|t�}|dkrdq�|j�|�q$|jd8_d}W5QRX|S)a�Acquire a semaphore, decrementing the internal counter by one.

        When invoked without arguments: if the internal counter is larger than
        zero on entry, decrement it by one and return immediately. If it is zero
        on entry, block, waiting until some other thread has called release() to
        make it larger than zero. This is done with proper interlocking so that
        if multiple acquire() calls are blocked, release() will wake exactly one
        of them up. The implementation may pick one at random, so the order in
        which blocked threads are awakened should not be relied on. There is no
        return value in this case.

        When invoked with blocking set to true, do the same thing as when called
        without arguments, and return true.

        When invoked with blocking set to false, do not block. If a call without
        an argument would block, return false immediately; otherwise, do the
        same thing as when called without arguments, and return true.

        When invoked with a timeout other than None, it will block for at
        most timeout seconds.  If acquire does not complete successfully in
        that interval, return false.  Return true otherwise.

        Nz.can't specify timeout for non-blocking acquireFrr>T)r_rjrkrbra)r0r@rArCrcr"r"r#r?�s$

zSemaphore.acquirec	Cs.|j�|jd7_|j��W5QRXdS)z�Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        r>N)rjrkrhr/r"r"r#rF�szSemaphore.releasecCs|��dSrGrHrIr"r"r#rM�szSemaphore.__exit__)r>)TN)	rRr7r8rSr1r?rTrFrMr"r"r"r#rxs

-c@s"eZdZdZddd�Zdd�ZdS)	ra�Implements a bounded semaphore.

    A bounded semaphore checks to make sure its current value doesn't exceed its
    initial value. If it does, ValueError is raised. In most situations
    semaphores are used to guard resources with limited capacity.

    If the semaphore is released too many times it's a sign of a bug. If not
    given, value defaults to 1.

    Like regular semaphores, bounded semaphores manage a counter representing
    the number of release() calls minus the number of acquire() calls, plus an
    initial value. The acquire() method blocks if necessary until it can return
    without making the counter negative. If not given, value defaults to 1.

    r>cCst�||�||_dSrG)rr1�_initial_valuerlr"r"r#r1�szBoundedSemaphore.__init__c	CsB|j�2|j|jkrtd��|jd7_|j��W5QRXdS)a6Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.

        z!Semaphore released too many timesr>N)rjrkrnr_rhr/r"r"r#rF�s

zBoundedSemaphore.releaseN)r>)rRr7r8rSr1rFr"r"r"r#r�s
c@sFeZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
d�Z	dd
d�Z
dS)rz�Class implementing event objects.

    Events manage a flag that can be set to true with the set() method and reset
    to false with the clear() method. The wait() method blocks until the flag is
    true.  The flag is initially false.

    cCstt��|_d|_dS)NF)r	rrj�_flagr/r"r"r#r1�szEvent.__init__cCs|j�t��dSrG)rjr1rr/r"r"r#�_reset_internal_locks�szEvent._reset_internal_lockscCs|jS)z5Return true if and only if the internal flag is true.)ror/r"r"r#�is_setszEvent.is_setc	Cs&|j�d|_|j��W5QRXdS)z�Set the internal flag to true.

        All threads waiting for it to become true are awakened. Threads
        that call wait() once the flag is true will not block at all.

        TN)rjrorir/r"r"r#�setsz	Event.setc	Cs|j�d|_W5QRXdS)z�Reset the internal flag to false.

        Subsequently, threads calling wait() will block until set() is called to
        set the internal flag to true again.

        FN)rjror/r"r"r#�clearszEvent.clearNc
Cs8|j�(|j}|s|j�|�}|W5QR�SQRXdS)aHBlock until the internal flag is true.

        If the internal flag is true on entry, return immediately. Otherwise,
        block until another thread calls set() to set the flag to true, or until
        the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        This method returns the internal flag on exit, so it will always return
        True except if a timeout is given and the operation times out.

        N)rjrora)r0rAZsignaledr"r"r#ras
z
Event.wait)N)rRr7r8rSr1rprqZisSetrrrsrar"r"r"r#r�s

c@s�eZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Ze
dd��ZdS)rz�Implements a Barrier.

    Useful for synchronizing a fixed number of threads at known synchronization
    points.  Threads block on 'wait()' and are simultaneously awoken once they
    have all made that call.

    NcCs.tt��|_||_||_||_d|_d|_dS)aWCreate a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.

        rN)r	rrj�_action�_timeout�_parties�_stater.)r0�parties�actionrAr"r"r#r1Fs	zBarrier.__init__c
Cs�|dkr|j}|j�r|��|j}|jd7_z6|d|jkrL|��n
|�|�|W�W5QR�S|jd8_|��XW5QRXdS)aNWait for the barrier.

        When the specified number of threads have started waiting, they are all
        simultaneously awoken. If an 'action' was provided for the barrier, one
        of the threads will have executed that callback prior to returning.
        Returns an individual index number from 0 to 'parties-1'.

        Nr>)rurj�_enterr.�_exitrv�_release�_wait)r0rA�indexr"r"r#raVs	

zBarrier.waitcCs6|jdkr|j��q|jdkr$t�|jdks2t�dS)N�r=r>r)rwrjrar�AssertionErrorr/r"r"r#rzts


zBarrier._entercCs>z"|jr|��d|_|j��Wn|���YnXdS)Nr>)rtrwrjri�_breakr/r"r"r#r|szBarrier._releasecsB�j��fdd�|�s"���t��jdkr0t��jdks>t�dS)Ncs
�jdkSr*�rwr"r/r"r#�<lambda>��zBarrier._wait.<locals>.<lambda>rr>)rjrer�rrwr��r0rAr"r/r#r}�s
z
Barrier._waitcCs(|jdkr$|jdkr$d|_|j��dS)Nrr)r.rwrjrir/r"r"r#r{�s

z
Barrier._exitc	CsT|j�D|jdkr6|jdkr$d|_q<|jdkr<d|_nd|_|j��W5QRXdS)z�Reset the barrier to the initial state.

        Any threads currently waiting will get the BrokenBarrier exception
        raised.

        rr=���N)rjr.rwrir/r"r"r#�reset�s


z
Barrier.resetc	Cs|j�|��W5QRXdS)z�Place the barrier into a 'broken' state.

        Useful in case of error.  Any currently waiting threads and threads
        attempting to 'wait()' will have BrokenBarrierError raised.

        N)rjr�r/r"r"r#�abort�sz
Barrier.abortcCsd|_|j��dS)Nr�)rwrjrir/r"r"r#r��szBarrier._breakcCs|jS)z:Return the number of threads required to trip the barrier.)rvr/r"r"r#rx�szBarrier.partiescCs|jdkr|jSdS)z>Return the number of threads currently waiting at the barrier.r)rwr.r/r"r"r#�	n_waiting�s
zBarrier.n_waitingcCs
|jdkS)z0Return True if the barrier is in a broken state.r�r�r/r"r"r#�broken�szBarrier.broken)NN)N)rRr7r8rSr1rarzr|r}r{r�r�r��propertyrxr�r�r"r"r"r#r=s 




c@seZdZdS)rN)rRr7r8r"r"r"r#r�s�	Thread-%dcCs
|t�SrG)�_counter)�templater"r"r#�_newname�sr�c@seZdZdZdZd:dd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zer\dd�Z
dd�Zdd�Zdd�Zdd�Zd;dd�Zd<d"d#�Zed$d%��Zejd&d%��Zed'd(��Zer�ed)d*��Zd+d,�Zd-d.�Zed/d0��Zejd1d0��Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)=raA class that represents a thread of control.

    This class can be safely subclassed in a limited fashion. There are two ways
    to specify the activity: by passing a callable object to the constructor, or
    by overriding the run() method in a subclass.

    FNr"��daemoncCs�|dkstd��|dkri}||_t|p,t��|_||_||_|dk	rN||_n
t�j	|_d|_
trhd|_d|_
t�|_d|_d|_tj|_t�|_t�|�dS)aKThis constructor should always be called with keyword arguments. Arguments are:

        *group* should be None; reserved for future extension when a ThreadGroup
        class is implemented.

        *target* is the callable object to be invoked by the run()
        method. Defaults to None, meaning nothing is called.

        *name* is the thread name. By default, a unique name is constructed of
        the form "Thread-N" where N is a small decimal number.

        *args* is the argument tuple for the target invocation. Defaults to ().

        *kwargs* is a dictionary of keyword arguments for the target
        invocation. Defaults to {}.

        If a subclass overrides the constructor, it must make sure to invoke
        the base class constructor (Thread.__init__()) before doing anything
        else to the thread.

        Nz#group argument must be None for nowFT)r��_target�strr��_name�_args�_kwargs�	_daemonicr
r��_ident�_HAVE_THREAD_NATIVE_ID�
_native_id�_tstate_lockr�_started�_is_stopped�_initialized�_sys�stderr�_stderr�_make_invoke_excepthook�_invoke_excepthook�	_dangling�add)r0�group�targetr4r'r(r�r"r"r#r1�s(
zThread.__init__cCs(|j��|r|��nd|_d|_dS�NT)r�rp�_set_tstate_lockr�r�)r0�is_aliver"r"r#rp(s


zThread._reset_internal_lockscCsl|jstd��d}|j��r d}|��|jr2d}|jr@|d7}|jdk	rX|d|j7}d|jj	|j
|fS)Nz Thread.__init__() was not called�initialZstartedZstoppedz daemonz %sz<%s(%s, %s)>)r�r�r�rqr�r�r�r�r6rRr�)r0Zstatusr"r"r#r<4s

zThread.__repr__cCs�|jstd��|j��r td��t�|t|<W5QRXzt|jd�Wn,tk
rtt�t|=W5QRX�YnX|j�	�dS)a-Start the thread's activity.

        It must be called at most once per thread object. It arranges for the
        object's run() method to be invoked in a separate thread of control.

        This method will raise a RuntimeError if called more than once on the
        same thread object.

        zthread.__init__() not calledz threads can only be started oncer"N)
r�rEr�rq�_active_limbo_lock�_limbo�_start_new_thread�
_bootstrap�	Exceptionrar/r"r"r#�startBs

zThread.startcCs.z|jr|j|j|j�W5|`|`|`XdS)aXMethod representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        N)r�r�r�r/r"r"r#�run[s	z
Thread.runcCs4z|��Wn"|jr(tdkr(YdS�YnXdSrG)�_bootstrap_innerr�r�r/r"r"r#r�ls
zThread._bootstrapcCst�|_dSrG)rr�r/r"r"r#�
_set_ident�szThread._set_identcCst�|_dSrG)rr�r/r"r"r#�_set_native_id�szThread._set_native_idc	Cs8t�|_|j��|js4t�t�|j�W5QRXdS)z�
        Set a lock object which will be released by the interpreter when
        the underlying thread state (see pystate.h) gets deleted.
        N)�
_set_sentinelr�r?r��_shutdown_locks_lock�_shutdown_locksr�r/r"r"r#r��s

zThread._set_tstate_lockcCs�z�|��|��tr|��|j��t�|t|j	<t
|=W5QRXtrVt�
t�trdt�t�z|��Wn|�|�YnXW5t� ztt�=WnYnXW5QRXXdSrG)r�r3rr�r�r�r�r�rrr�r�r$r�rrrr�r�r/r"r"r#r��s,



zThread._bootstrap_innerc	CsJ|j}|dk	r|��rt�d|_d|_|jsFt�t�|�W5QRXdSr�)r�r2r�r�r�r�r��discardrYr"r"r#�_stop�szThread._stopc	Cst�tt�=W5QRXdS)zARemove current thread from the dict of currently running threads.N)r�r3rr/r"r"r#�_delete�szThread._deletecCsZ|jstd��|j��s td��|t�kr2td��|dkrD|��n|jt|d�d�dS)aWait until the thread terminates.

        This blocks the calling thread until the thread whose join() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As join() always returns None, you must call
        is_alive() after join() to decide whether a timeout happened -- if the
        thread is still alive, the join() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be join()ed many times.

        join() raises a RuntimeError if an attempt is made to join the current
        thread as that would cause a deadlock. It is also an error to join() a
        thread before it has been started and attempts to do so raises the same
        exception.

        �Thread.__init__() not calledz'cannot join thread before it is startedzcannot join current threadNr)rA)r�rEr�rqr
�_wait_for_tstate_lock�maxr�r"r"r#�join�s


zThread.joinTr=cCs:|j}|dkr|js6t�n|�||�r6|��|��dSrG)r�r�r�r?rFr�)r0�blockrArZr"r"r#r��szThread._wait_for_tstate_lockcCs|jstd��|jS)z�A string used for identification purposes only.

        It has no semantics. Multiple threads may be given the same name. The
        initial name is set by the constructor.

        r�)r�r�r�r/r"r"r#r4szThread.namecCs|jstd��t|�|_dS)Nr�)r�r�r�r��r0r4r"r"r#r4scCs|jstd��|jS)a4Thread identifier of this thread or None if it has not been started.

        This is a nonzero integer. See the get_ident() function. Thread
        identifiers may be recycled when a thread exits and another thread is
        created. The identifier is available even after the thread has exited.

        r�)r�r�r�r/r"r"r#�idents	zThread.identcCs|jstd��|jS)z�Native integral thread ID of this thread, or None if it has not been started.

            This is a non-negative integer. See the get_native_id() function.
            This represents the Thread ID as reported by the kernel.

            r�)r�r�r�r/r"r"r#�	native_id$szThread.native_idcCs4|jstd��|js|j��s"dS|�d�|jS)z�Return whether the thread is alive.

        This method returns True just before the run() method starts until just
        after the run() method terminates. The module function enumerate()
        returns a list of all alive threads.

        r�F)r�r�r�r�rqr�r/r"r"r#r�/s

zThread.is_alivecCs ddl}|jdtdd�|��S)zhReturn whether the thread is alive.

        This method is deprecated, use is_alive() instead.
        rNz/isAlive() is deprecated, use is_alive() instead�)�
stacklevel)�warnings�warn�DeprecationWarningr�)r0r�r"r"r#�isAlive=s�zThread.isAlivecCs|jstd��|jS)a�A boolean value indicating whether this thread is a daemon thread.

        This must be set before start() is called, otherwise RuntimeError is
        raised. Its initial value is inherited from the creating thread; the
        main thread is not a daemon thread and therefore all threads created in
        the main thread default to daemon = False.

        The entire Python program exits when only daemon threads are left.

        r�)r�r�r�r/r"r"r#r�Gsz
Thread.daemoncCs*|jstd��|j��r td��||_dS)Nr�z)cannot set daemon status of active thread)r�rEr�rqr��r0Zdaemonicr"r"r#r�Vs

cCs|jSrGr�r/r"r"r#�isDaemon^szThread.isDaemoncCs
||_dSrGr�r�r"r"r#�	setDaemonaszThread.setDaemoncCs|jSrG�r4r/r"r"r#�getNamedszThread.getNamecCs
||_dSrGr�r�r"r"r#�setNamegszThread.setName)NNNr"N)N)Tr=) rRr7r8rSr�r1rpr<r�r�r�r�r�r�r�r�r�r�r�r�r�r4�setterr�r�r�r�r�r�r�r�r�r"r"r"r#r�sR��/	
&









)�_excepthook�_ExceptHookArgs)�print_exception)�
namedtuplez'exc_type exc_value exc_traceback threadcCst|�SrG)r�)r'r"r"r#rwscCs�|jtkrdStdk	r(tjdk	r(tj}n$|jdk	rH|jj}|dkrLdSndS|jdk	r`|jj}nt�}td|�d�|dd�t	|j|j
|j|d�|��dS)z9
        Handle uncaught Thread.run() exception.
        NzException in thread �:T��file�flush)r�)
�exc_type�
SystemExitr�r��threadr�r4r�print�_print_exception�	exc_value�
exc_tracebackr�)r'r�r4r"r"r#rzs(



��csPt�tj��dkrtd���dkr*td��tj�t�t������fdd�}|S)Nzthreading.excepthook is Nonezsys.excepthook is Nonec
s�z�z,t}|dkr�}t��|f��}||�Wn�tk
r�}zbd|_~�dk	rb�jdk	rb�j}n|j}�d|dd��dk	r��jdk	r��j}n�}|���W5d}~XYnXW5d}XdS)NTz"Exception in threading.excepthook:r�)rrr��__suppress_context__r�r�)r�r'�hook�excr�Zsys_excepthook�Zlocal_printZ	local_sysZold_excepthookZold_sys_excepthookZsys_exc_infor"r#�invoke_excepthook�s*� z2_make_invoke_excepthook.<locals>.invoke_excepthook)rr�rE�exc_infor�)r�r"r�r#r��s r�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz�Call a function after a specified number of seconds:

            t = Timer(30.0, f, args=None, kwargs=None)
            t.start()
            t.cancel()     # stop the timer's action if it's still waiting

    NcCsFt�|�||_||_|dk	r"|ng|_|dk	r4|ni|_t�|_dSrG)rr1�interval�functionr'r(r�finished)r0r�r�r'r(r"r"r#r1�s
zTimer.__init__cCs|j��dS)z)Stop the timer if it hasn't finished yet.N)r�rrr/r"r"r#�cancel�szTimer.cancelcCs6|j�|j�|j��s(|j|j|j�|j��dSrG)r�rar�rqr�r'r(rrr/r"r"r#r��s
z	Timer.run)NN)rRr7r8rSr1r�r�r"r"r"r#r�s
c@seZdZdd�ZdS)�_MainThreadc	CsTtj|ddd�|��|j��|��tr6|��t�|t	|j
<W5QRXdS)NZ
MainThreadF�r4r�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1�s
z_MainThread.__init__N)rRr7r8r1r"r"r"r#r��sr�c@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)�_DummyThreadc	CsPtj|td�dd�|j��|��tr2|��t�|t	|j
<W5QRXdS)NzDummy-%dTr�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1s
z_DummyThread.__init__cCsdSrGr"r/r"r"r#r�
sz_DummyThread._stopcCs|js|j��st�dSr�)r�r�rqr�r/r"r"r#r�sz_DummyThread.is_aliveNcCsdstd��dS)NFzcannot join a dummy thread)r�r�r"r"r#r�sz_DummyThread.join)N)rRr7r8r1r�r�r�r"r"r"r#r�s
r�cCs,ztt�WStk
r&t�YSXdS)z�Return the current Thread object, corresponding to the caller's thread of control.

    If the caller's thread of control was not created through the threading
    module, a dummy thread object with limited functionality is returned.

    N)r3rr5r�r"r"r"r#r
sc
Cs,t�tt�tt�W5QR�SQRXdS)z�Return the number of Thread objects currently alive.

    The returned count is equal to the length of the list returned by
    enumerate().

    N)r�r[r3r�r"r"r"r#r(scCstt���tt���SrG)�listr3�valuesr�r"r"r"r#�
_enumerate4sr�c
Cs4t�&tt���tt���W5QR�SQRXdS)z�Return a list of all Thread objects currently alive.

    The list includes daemonic threads, dummy thread objects created by
    current_thread(), and the main thread. It excludes terminated threads and
    threads that have not yet been started.

    N)r�r�r3r�r�r"r"r"r#r8s)rc	Cs~tjr
dStj}|dk	st�|��s(t�|��t��t�tt	�}t	�
�W5QRX|s^qz|D]}|��|��qbq8dS)zS
    Wait until the Python thread state of all non-daemon threads get deleted.
    N)�_main_threadr�r�r�r2rFr�r�r�r�rsr?)ZtlockZlocksrZr"r"r#�	_shutdownKs	r�cCstS)z�Return the main thread object.

    In normal conditions, the main thread is the thread from which the
    Python interpreter was started.
    )r�r"r"r"r#rss)�_local)rc	Cs�t�ai}ztt�}Wntk
r2t�}YnX|at�at�a	t��tt
��}|�t�|D]>}||kr�|�
d�t�}||_|||<qb|�
d�|��qbt��t��t�|�tt�dks�t�W5QRXdS)zL
    Cleanup threading module state that should not exist after a fork.
    TFr>N)r+r�r3rr5r�r�r�rrr�r��updater�rpr�r�r�rsr[r�)Z
new_activeZcurrentZthreadsr�r�r"r"r#�_after_fork�s0






r��register_at_fork)Zafter_in_child)r�)ZrS�os�_os�sysr��_thread�timerrbZ_weakrefsetr�	itertoolsrrfrr.�_collectionsrrW�ImportError�collections�__all__�start_new_threadr��
allocate_lockr+r�rrr�r]rV�errorrrr%r
rr$rrrr)r&r	rrrrrEr�__next__r�r�r�r3r�r�r�rrr�rr�rr�r�	tracebackr�r�r�r�rr�r�r
Z
currentThreadrZactiveCountr�rrr�r�rr�rZ_threading_localr��hasattrr�r"r"r"r#�<module>s��




q'P&O
�5
(5bz2.cpython-38.pyc000064400000026267151450073350007711 0ustar00U

e5d1�@s�dZddddddgZdZdd	lmZdd
lZdd
lZdd
lZdd
l	Z	ddl
mZddlm
Z
mZdZd
ZdZe�ZGdd�de	j�Zddd�Zddd�Zdd�Zd
S)z�Interface to the libbzip2 compression library.

This module provides a file interface, classes for incremental
(de)compression, and functions for one-shot (de)compression.
�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>�)rN)�RLock)rr��c@s�eZdZdZdedfdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zd)dd�Z
d*dd�Zd+dd�Zdd�Zd,dd�Zd-dd�Zd d!�Zd"d#�Zejfd$d%�Zd&d'�Zd(S).ra@A file object providing transparent bzip2 (de)compression.

    A BZ2File can act as a wrapper for an existing file object, or refer
    directly to a named file on disk.

    Note that BZ2File provides a *binary* file interface - data read is
    returned as bytes, and data to be written should be given as bytes.
    �r�	cCsTt�|_d|_d|_t|_|tk	r2tjdt	dd�d|krFdksPnt
d��|d	krbd
}t}nb|dkr~d}t}t
|�|_nF|d
kr�d}t}t
|�|_n*|dkr�d}t}t
|�|_nt
d|f��t|tttjf�r�t||�|_d|_||_n.t|d��st|d��r||_||_ntd��|jtk�rJtj|jttd�}t�|�|_nd|_dS)aOOpen a bzip2-compressed file.

        If filename is a str, bytes, or PathLike object, it gives the
        name of the file to be opened. Otherwise, it should be a file
        object, which will be used to read or write the compressed data.

        mode can be 'r' for reading (default), 'w' for (over)writing,
        'x' for creating exclusively, or 'a' for appending. These can
        equivalently be given as 'rb', 'wb', 'xb', and 'ab'.

        buffering is ignored since Python 3.0. Its use is deprecated.

        If mode is 'w', 'x' or 'a', compresslevel can be a number between 1
        and 9 specifying the level of compression: 1 produces the least
        compression, and 9 (default) produces the most compression.

        If mode is 'r', the input file may be the concatenation of
        multiple compressed streams.
        NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.�)�
stacklevelr	rz%compresslevel must be between 1 and 9)�r�rbr)�w�wbr)�x�xbr)�a�abr�Invalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r�_lock�_fp�_closefp�_MODE_CLOSED�_mode�	_sentinel�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr�_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeError�_compressionZDecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode�	buffering�
compresslevelZ	mode_code�raw�r;�/usr/lib64/python3.8/bz2.py�__init__)sT��zBZ2File.__init__cCs�|j��|jtkr W5QR�dSz<|jtkr8|j��n"|jtkrZ|j�	|j
���d|_
W5z|jrp|j��W5d|_d|_t|_d|_XXW5QRXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)rrrrrr3�closer$r%rr&�flush�r5r;r;r<r>ps 



z
BZ2File.closecCs
|jtkS)zTrue if this file is closed.)rrr@r;r;r<�closed�szBZ2File.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor@r;r;r<rC�szBZ2File.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler@r;r;r<rE�szBZ2File.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)rBrr$r@r;r;r<rD�szBZ2File.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)rBrr%r@r;r;r<�writable�szBZ2File.writablerc
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        N)r�_check_can_readr3�peek)r5�nr;r;r<rH�szBZ2File.peek���c
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b'' if the file is already at EOF.
        N)rrGr3r�r5�sizer;r;r<r�szBZ2File.readc
Cs@|j�0|��|dkrtj}|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b'' if the file is at EOF.
        rN)rrGr1�DEFAULT_BUFFER_SIZEr3�read1rKr;r;r<rN�s
z
BZ2File.read1c
Cs2|j�"|��|j�|�W5QR�SQRXdS)zRRead bytes into b.

        Returns the number of bytes read (0 for EOF).
        N)rrGr3�readinto)r5�br;r;r<rO�szBZ2File.readintoc
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        �	__index__�Integer argument expectedN)	r'�intr-r.rQrrGr3�readlinerKr;r;r<rT�s

zBZ2File.readlinec
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)z�Read a list of lines of uncompressed bytes from the file.

        size can be specified to control the number of lines read: no
        further lines will be read once the total size of the lines read
        so far equals or exceeds size.
        rQrRN)	r'rSr-r.rQrrGr3�	readlinesrKr;r;r<rU�s

zBZ2File.readlinesc
CsX|j�H|��|j�|�}|j�|�|jt|�7_t|�W5QR�SQRXdS)z�Write a byte string to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        N)rZ_check_can_writer&rrrr4�len)r5�dataZ
compressedr;r;r<r�sz
BZ2File.writec
Cs,|j�tj�||�W5QR�SQRXdS)z�Write a sequence of byte strings to the file.

        Returns the number of uncompressed bytes written.
        seq can be any iterable yielding byte strings.

        Line separators are not added between the written byte strings.
        N)rr/�
BaseStream�
writelines)r5�seqr;r;r<rY�szBZ2File.writelinesc
Cs4|j�$|��|j�||�W5QR�SQRXdS)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Values for whence are:

            0: start of stream (default); offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        N)rZ_check_can_seekr3�seek)r5�offset�whencer;r;r<r[szBZ2File.seekc
CsL|j�<|��|jtkr0|j��W5QR�S|jW5QR�SQRXdS)z!Return the current file position.N)rrBrr$r3�tellr4r@r;r;r<r^s

zBZ2File.tellN)r)rJ)rJ)rJ)rJ)�__name__�
__module__�__qualname__�__doc__rr=r>�propertyrArCrErDrFrHrrNrOrTrUrrYr1�SEEK_SETr[r^r;r;r;r<rs&	G





	

rrcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|||d	�}d|kr�t�||||�S|SdS)
aOpen a bzip2-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str, bytes, or
    PathLike object), or an existing file object to read from or write
    to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or
    "ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode.
    The default mode is "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the BZ2File
    constructor: BZ2File(filename, mode, compresslevel). In this case,
    the encoding, errors and newline arguments must not be provided.

    For text mode, a BZ2File object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trPrNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r9)r#�replacerr1�
TextIOWrapper)r6r7r9�encoding�errors�newlineZbz_modeZbinary_filer;r;r<r!scCst|�}|�|�|��S)z�Compress a block of data.

    compresslevel, if given, must be a number between 1 and 9.

    For incremental compression, use a BZ2Compressor object instead.
    )rrr?)rWr9�compr;r;r<rJscCshg}|r^t�}z|�|�}Wn tk
r<|r6Yq^n�YnX|�|�|jsVtd��|j}qd�|�S)zjDecompress a block of data.

    For incremental decompression, use a BZ2Decompressor object instead.
    zACompressed data ended before the end-of-stream marker was reached�)rrr0�append�eofr#Zunused_data�join)rWZresultsZdecomp�resr;r;r<rUs
)rrNNN)r)rb�__all__�
__author__�builtinsrr,r1r*r r/Z	threadingrZ_bz2rrrr$r%�objectrrXrrrr;r;r;r<�<module>s6��
)
dataclasses.cpython-38.opt-2.pyc000064400000047367151450073350012447 0ustar00U

e5d5��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZdddddddd	d
ddd
gZ	Gdd�de
�ZGdd�d�Ze�Z
Gdd�d�Ze�Ze�i�ZGdd�d�Zed�Zed�Zed�ZdZdZdZe�d�ZGdd�de�ZGdd�ded�ZGd d�d�ZGd!d"�d"�Zeed#d#dd#dd$�d%d�Z d&d'�Z!d(d)�Z"dded*�d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(d7d8�Z)d9d:�Z*d;d<�Z+d=d>�Z,d?d@�Z-dAdB�Z.dCdD�Z/dEdF�Z0dGdH�Z1dIdJ�Z2dKdL�Z3dddde1de2de2e3e2e3e2e3e2e3dM�Z4dNdO�Z5ddd#d#d#dPdPdPdQ�dRd�Z6dSd�Z7dTdU�Z8dVd
�Z9e:dW�dXd	�Z;dYdZ�Z<e=d[�d\d
�Z>d]d^�Z?d_dd#d#d#dPdPdPd`�dad�Z@dbd�ZAdceA_BdS)e�N�	dataclass�field�Field�FrozenInstanceError�InitVar�MISSING�fields�asdict�astuple�make_dataclass�replace�is_dataclassc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�#/usr/lib64/python3.8/dataclasses.pyr�sc@seZdZdd�ZdS)�_HAS_DEFAULT_FACTORY_CLASScCsdS)Nz	<factory>r��selfrrr�__repr__�sz#_HAS_DEFAULT_FACTORY_CLASS.__repr__N)rrrrrrrrr�src@seZdZdS)�
_MISSING_TYPENrrrrrr�src@seZdZdd�Zdd�ZdS)�_FIELD_BASEcCs
||_dS�N��name�rrrrr�__init__�sz_FIELD_BASE.__init__cCs|jSrrrrrrr�sz_FIELD_BASE.__repr__N)rrrrrrrrrr�sr�_FIELD�_FIELD_CLASSVAR�_FIELD_INITVARZ__dataclass_fields__Z__dataclass_params__Z
__post_init__z^(?:\s*(\w+)\s*\.)?\s*(\w+)c@seZdZdd�ZdS)�_InitVarMetacCst|�Sr)r)rZparamsrrr�__getitem__�sz_InitVarMeta.__getitem__N)rrrr#rrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)r��typecCs
||_dSrr$)rr%rrrr�szInitVar.__init__cCs,t|jt�r|jj}n
t|j�}d|�d�S)Nzdataclasses.InitVar[�])�
isinstancer%r�repr)rZ	type_namerrrr�s

zInitVar.__repr__N�rrr�	__slots__rrrrrrr�s)�	metaclassc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r)
rr%�default�default_factoryr(�hash�init�compare�metadata�_field_typecCsRd|_d|_||_||_||_||_||_||_|dkr<tnt	�
|�|_d|_dSr)
rr%r,r-r/r(r.r0�_EMPTY_METADATA�types�MappingProxyTyper1r2)rr,r-r/r(r.r0r1rrrr�s��zField.__init__cCsVd|j�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d	|j�d
|j	�d�S)NzField(name=z,type=z	,default=z,default_factory=z,init=�,repr=z,hash=z	,compare=z
,metadata=z
,_field_type=�))
rr%r,r-r/r(r.r0r1r2rrrrrszField.__repr__cCs(tt|j�dd�}|r$||j||�dS)N�__set_name__)�getattrr%r,)r�ownerr�funcrrrr8szField.__set_name__N)rrrr*rrr8rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�_DataclassParams�r/r(�eq�order�unsafe_hash�frozencCs(||_||_||_||_||_||_dSrr=)rr/r(r>r?r@rArrrr*sz_DataclassParams.__init__c
Cs6d|j�d|j�d|j�d|j�d|j�d|j�d�
S)Nz_DataclassParams(init=r6z,eq=z,order=z
,unsafe_hash=z,frozen=r7r=rrrrr2sz_DataclassParams.__repr__Nr)rrrrr<!sr<T�r,r-r/r(r.r0r1cCs,|tk	r|tk	rtd��t|||||||�S)Nz/cannot specify both default and default_factory)r�
ValueErrorrrBrrrr@s
�cs(|sdSdd��fdd�|D���d�S)N�()�(�,csg|]}��d|j���qS)�.r��.0�f��obj_namerr�
<listcomp>_sz_tuple_str.<locals>.<listcomp>�,))�join)rLrrrKr�
_tuple_strVsrPcs"t��t�����fdd��}|S)Nc	sDt|�t��f}|�krdS��|�z�|�}W5��|�X|S)Nz...)�id�_thread�	get_ident�add�discard)r�key�result��repr_running�
user_functionrr�wrapperis
z _recursive_repr.<locals>.wrapper)�set�	functools�wraps)rZr[rrXr�_recursive_reprds
r_)�globals�locals�return_typec
Cs�|dkri}d|krt|d<d}|tk	r4||d<d}d�|�}d�dd�|D��}d	|�d
|�d|�d|��}d
�|���}d|�d|�d|��}i}	t|||	�|	df|�S)NZBUILTINS�Z_return_typez->_return_typerF�
css|]}d|��VqdS)z  Nr)rI�brrr�	<genexpr>�sz_create_fn.<locals>.<genexpr>z def rEr7z:
�, zdef __create_fn__(z):
z	
 return Z
__create_fn__)�builtinsrrO�keys�exec)
r�argsZbodyr`rarbZreturn_annotationZtxtZ
local_vars�nsrrr�
_create_fnws 
rmcCs0|rd|�d|�d|�d�S|�d|�d|��S)NzBUILTINS.object.__setattr__(rFr7rG�=r)rAr�value�	self_namerrr�
_field_assign�srqcCs�d|j��}|jtk	rV|jr@|j||<|�d|j�d|j��}q�|j||<|�d�}n8|jr�|jtkrn|j}q�|jtk	r�|j||<|j}ndS|jtkr�dSt||j||�S)NZ_dflt_z() if z is _HAS_DEFAULT_FACTORY else rD)rr-rr/r,r2r!rq)rJrAr`rpZdefault_namerorrr�_field_init�s"






rrcCsV|jtkr|jtkrd}n&|jtk	r2d|j��}n|jtk	r@d}|j�d|j�|��S)Nrcz=_dflt_z=_HAS_DEFAULT_FACTORYz:_type_)r,rr-r)rJr,rrr�_init_param�s

rscCs�d}|D]:}|jr|jtkr&|jtks,d}q|rtd|j�d���qdd�|D�}|�ttd��g}|D] }t||||�}	|	rj|�	|	�qj|r�d�
d	d
�|D��}
|�	|�dt�d|
�d
��|s�dg}td|gdd�|D�|||dd�S)NFTznon-default argument z follows default argumentcSsi|]}d|j��|j�qS)Z_type_)rr%rHrrr�
<dictcomp>�s
z_init_fn.<locals>.<dictcomp>)r�_HAS_DEFAULT_FACTORYrFcss|]}|jtkr|jVqdSr)r2r!rrHrrrrf	s
�z_init_fn.<locals>.<genexpr>rGrEr7�passrcSsg|]}|jrt|��qSr)r/rsrHrrrrMsz_init_fn.<locals>.<listcomp>)rar`rb)
r/r,rr-�	TypeErrorr�updaterurr�appendrO�_POST_INIT_NAMErm)rrA�
has_post_initrpr`Zseen_defaultrJraZ
body_lines�lineZ
params_strrrr�_init_fn�s:��r}cCs2tdddd�dd�|D��dg|d�}t|�S)	Nrrz(return self.__class__.__qualname__ + f"(rgcSs g|]}|j�d|j�d��qS)z={self.z!r}rrHrrrrMs�z_repr_fn.<locals>.<listcomp>z)"�r`)rmrOr_)rr`�fnrrr�_repr_fns
����r�cCsp|td�}|r,dd�dd�|D��d}nd}tdd	d
|�d�dd
f||d�tddd
|�d�ddf||d�fS)N)�clsrrErFcss|]}t|j�VqdSr)r(rrHrrrrf(sz'_frozen_get_del_attr.<locals>.<genexpr>rNrD�__setattr__)rrroz if type(self) is cls or name in �:z> raise FrozenInstanceError(f"cannot assign to field {name!r}")z)super(cls, self).__setattr__(name, value))rar`�__delattr__rz; raise FrozenInstanceError(f"cannot delete field {name!r}")z"super(cls, self).__delattr__(name))rrOrm)r�rr`raZ
fields_strrrr�_frozen_get_del_attr$s2�
��
���r�cCs$t|ddd|�|�|��dg|d�S)N)r�otherz%if other.__class__ is self.__class__:z return zreturn NotImplementedr~)rm)r�op�
self_tuple�other_tupler`rrr�_cmp_fn=s��r�cCs$td|�}tddd|�d�g|d�S)Nr�__hash__rzreturn hash(r7r~)rPrm)rr`r�rrr�_hash_fnKs
�r�cCs$||jkp"t|�|jko"|j|jkSr)�ClassVarr%Z
_GenericAliasZ
__origin__)�a_type�typingrrr�_is_classvarSs

�r�cCs||jkpt|�|jkSr)rr%)r��dataclassesrrr�_is_initvar[s
�r�c	Cs�t�|�}|r�d}|�d�}|s2tj�|j�j}n2tj�|j�}|rd|j�|�|krdtj�|j�j}|r�||�|�d��|�r�dSdS)N��TF)�_MODULE_IDENTIFIER_RE�match�group�sys�modules�getr�__dict__)	Z
annotationr�Za_moduler�Zis_type_predicater�rlZmodule_name�modulerrr�_is_typebs)

r�cCs8t||t�}t|t�r|}nt|tj�r,t}t|d�}||_||_t	|_
tj�
d�}|r�t||�s�t|jt�r�t|j|||jt�r�t|_
|j
t	kr�tjt}t||�s�t|jt�r�t|j|||jt�r�t|_
|j
ttfkr�|jtk	r�td|j�d���|j
t	k�r4t|jtttf��r4tdt|j��d|j�d���|S)N)r,r��field z cannot have a default factoryzmutable default z for field z$ is not allowed: use default_factory)r9rr'rr4�MemberDescriptorTyperrr%rr2r�r�r�r��strr�r�r rr�rr!r-rwr,�list�dictr\rC)r�Za_namer�r,rJr�r�rrr�
_get_field�sF



���



���
	 r�cCs||jkrdSt|||�dS)NTF)r��setattr)r�rrorrr�_set_new_attribute�s
r�cCsdSrr�r�rr`rrr�_hash_set_none�sr�cCsdd�|D�}t||�S)NcSs(g|] }|jdkr|jrn|jr|�qSr)r.r0rHrrrrMs

z_hash_add.<locals>.<listcomp>)r�)r�rr`�fldsrrr�	_hash_addsr�cCstd|j����dS)Nz-Cannot overwrite attribute __hash__ in class )rwrr�rrr�_hash_exceptionsr�))FFFF)FFFT)FFTF)FFTT)FTFF)FTFT)FTTF)FTTT)TFFF)TFFT)TFTF)TFTT)TTFF)TTFT)TTTF)TTTTcs�i}�jtjkr tj�jj}ni}t�tt||||||��d}	d}
�jddd�D]D}t|t	d�}|dk	rVd}
|�
�D]}
|
||
j<qzt|t�jrVd}	qV�j�
di�}�fdd�|��D�}|D]L}
|
||
j<tt�|
jd�t�r�|
jtk�rt�|
j�q�t�|
j|
j�qĈj��D].\}}t|t��r||k�rt|�d����q|
�rz|	�rf|�sftd	��|	�sz|�rztd
��t�t	|��j�
dt�}|tk�p�|dk�o�d�jk}|�r�|�s�td
��|�rt�t�}dd�|�
�D�}t�dt|||d|k�rdnd|��dd�|�
�D�}|�rHdd�|D�}t�dt||��|�r�dd�|D�}td|�}td|�}t�dtdd|||d��|�r�dd�|D�}td|�}td|�}dD]>\}}t�|t|||||d���r�td|�d�j�d����q�|�r8t�||�D].}t�|j|��rtd|j�d�j�����qtt |�t |�t |�|f}|�rh|�||��_!t�d��s��jt"t#�$����%dd ��_&�S)!NF���rT�__annotations__csg|]\}}t�||��qSr)r�)rIrr%�r�rrrM]s�z"_process_class.<locals>.<listcomp>z& is a field but has no type annotationz5cannot inherit non-frozen dataclass from a frozen onez5cannot inherit frozen dataclass from a non-frozen oner��__eq__z eq must be true if order is truecSsg|]}|jttfkr|�qSr)r2rr!rHrrrrM�s�rrZ__dataclass_self__cSsg|]}|jtkr|�qSr�r2rrHrrrrM�s
cSsg|]}|jr|�qSr)r(rHrrrrM�srcSsg|]}|jr|�qSr�r0rHrrrrM�sr�z==r~cSsg|]}|jr|�qSrr�rHrrrrM�s))�__lt__�<)�__le__z<=)�__gt__�>)�__ge__z>=zCannot overwrite attribute z
 in class z). Consider using functools.total_ordering�__doc__z -> Nonerc)'rr�r�r�r��_PARAMSr<�__mro__r9�_FIELDS�valuesrrAr��itemsr'rr,r�delattrrwrC�hasattrrzr�r}r�rPr�rr��_hash_action�boolr�r��inspectZ	signaturerr�)r�r/r(r>r?r@rArr`Zany_frozen_baseZhas_dataclass_basesreZbase_fieldsrJZcls_annotationsZ
cls_fieldsrroZ
class_hashZhas_explicit_hashr{r�Z
field_listr�r�r�rZhash_actionrr�r�_process_class's��
�

�
��

��


����r�Fr=cs*������fdd�}|dkr"|S||�S)Ncst|�������Sr)r�r��r>rAr/r?r(r@rr�wrap�szdataclass.<locals>.wrapr)r�r/r(r>r?r@rAr�rr�rr�scCsBzt|t�}Wntk
r*td��YnXtdd�|��D��S)Nz0must be called with a dataclass type or instancecss|]}|jtkr|VqdSrr�rHrrrrf
s
zfields.<locals>.<genexpr>)r9r��AttributeErrorrw�tupler�)Zclass_or_instancerrrrr�s
cCstt|�t�Sr)r�r%r�)�objrrr�_is_dataclass_instancesr�cCs t|t�r|nt|�}t|t�Sr)r'r%r�r�)r�r�rrrr
s��dict_factorycCst|�std��t||�S)Nz0asdict() should be called on dataclass instances)r�rw�
_asdict_inner)r�r�rrrr	scs�t|�rDg}t|�D]&}tt||j���}|�|j|f�q�|�St|t�rrt|d�rrt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)N�_fieldscsg|]}t|���qSr�r��rI�vr�rrrMOsz!_asdict_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrfTsz _asdict_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr��rI�kr�r�rrrfVs��)r�rr�r9rryr'r�r�r%r�r�r��copy�deepcopy)r�r�rWrJrorr�rr�4s
�r���
tuple_factorycCst|�std��t||�S)Nz1astuple() should be called on dataclass instances)r�rw�_astuple_inner)r�r�rrrr
]scs�t|�r>g}t|�D] }tt||j���}|�|�q�|�St|t�rlt|d�rlt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)Nr�csg|]}t|���qSr�r�r�r�rrrM�sz"_astuple_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrf�sz!_astuple_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr�r�r�rrrf�s�)r�rr�r9rryr'r�r�r%r�r�r�r�r�)r�r�rWrJrorr�rr�us
�r�r)�bases�	namespacer/r(r>r?r@rAc	s�dkri�n����t�}
i}|D]�}t|t�r<|}
d}nDt|�dkrR|\}
}n.t|�dkrr|\}
}}|�|
<ntd|����t|
t�r�|
��s�td|
����t�|
�r�td|
����|
|
kr�td|
����|
�	|
�|||
<q$|�d<t
�||i�fd	d
��}t|||||||	d�S)Nz
typing.Anyr��zInvalid field: z'Field names must be valid identifiers: z"Field names must not be keywords: zField name duplicated: r�cs
|���Sr)rx)rl�r�rr�<lambda>��z make_dataclass.<locals>.<lambda>r=)
r�r\r'r��lenrw�isidentifier�keyword�	iskeywordrTr4�	new_classr)Zcls_namerr�r�r/r(r>r?r@rA�seenZanns�itemr�tp�specr�rr�rr�s:






�cOst|�dkr tdt|��d���|r,|\}n4d|krX|�d�}ddl}|jdtdd�ntd	��t|�sptd
��t|t��	�D]v}|j
tkr�q~|js�|j
|kr~td|j
�d���q~|j
|kr~|j
tkr�|jtkr�td
|j
�d���t||j
�||j
<q~|jf|�S)Nr�z*replace() takes 1 positional argument but z were givenr�rz/Passing 'obj' as keyword argument is deprecatedr�)�
stacklevelz7replace() missing 1 required positional argument: 'obj'z1replace() should be called on dataclass instancesr�zC is declared with init=False, it cannot be specified with replace()zInitVar z! must be specified with replace())r�rw�pop�warnings�warn�DeprecationWarningr�r9r�r�r2r r/rrCr!r,r�	__class__)rkZchangesr�r�rJrrrr�s4
�


z(obj, /, **kwargs))N)C�rer�r�r4r�r�rhr]rR�__all__r�rrrurrr5r3rrr r!r�r�rz�compiler�r%r"rrr<rrPr_rmrqrrrsr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r
r�r	r�r�r
r�rr�__text_signature__rrrr�<module>s��

:��62;R�>
�)�B<tempfile.cpython-38.opt-2.pyc000064400000040751151450073350011753 0ustar00U

e5d�k�
@s�dddddddddd	d
ddg
Zd
dlZd
dlZd
dlZd
dlZd
dl	Z
d
dlZd
dl
mZd
dlZd
dlZd
dlZejZejejBejBZeed�r�eejOZeZeed�r�eejOZeed�r�ejZndZdZ e�Z!dd�Z"dd�Z#dd�Z$Gdd�d�Z%dd�Z&dd�Z'da(d d!�Z)d"d#�Z*d$d�Z+d%d�Z,da-d&d
�Z.d'd�Z/d<d)d�Z0d=d*d�Z1d+e dfd,d�Z2Gd-d.�d.�Z3Gd/d0�d0�Z4d>dd4�d5d�Z5ej6d6k�s�ej7d7k�r�e5Z8need8�a9d?dd4�d9d�Z8Gd:d�d�Z:Gd;d�de;�Z<dS)@�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�N)�Random�
O_NOFOLLOW�O_BINARYi'ZtmpcCs.zt�|�Wntk
r$YdSXdSdS)NFT)�_os�lstat�OSError)�fn�r� /usr/lib64/python3.8/tempfile.py�_existsKs
rcGs\d}|D]B}|dkrqt|t�r6|tkr0td��t}q|tkrFtd��t}q|dkrXtS|S)Nz1Can't mix bytes and non-bytes in path components.)�
isinstance�bytes�str�	TypeError)�argsZreturn_type�argrrr�_infer_return_typeTs
rcCsdt|||�}|dkr|�}|dkr:|tkr0t}n
t�t�}|dkrX|tkrRt�}nt�}||||fS�N)rr�templater�fsencoderr
)�prefix�suffix�dir�output_typerrr�_sanitize_paramsis
r'c@s,eZdZdZedd��Zdd�Zdd�ZdS)	�_RandomNameSequenceZ%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t��}|t|dd�kr&t�|_||_|jS)N�_rng_pid)r�getpid�getattr�_RandomZ_rngr))�selfZcur_pidrrr�rng�s
z_RandomNameSequence.rngcCs|Sr r�r-rrr�__iter__�sz_RandomNameSequence.__iter__cs0|j�|jj���fdd�td�D�}d�|�S)Ncsg|]}����qSrr)�.0Zdummy��cZchooserr�
<listcomp>�sz0_RandomNameSequence.__next__.<locals>.<listcomp>��)�
charactersr.Zchoice�range�join)r-Zlettersrr2r�__next__�sz_RandomNameSequence.__next__N)�__name__�
__module__�__qualname__r7�propertyr.r0r:rrrrr({s

r(c	Cs�g}dD]}t�|�}|r|�|�qtjdkrX|�tj�d�tj�d�ddddg�n|�d	d
dg�z|�t���Wn$t	t
fk
r�|�tj�YnX|S)N)ZTMPDIRZTEMPZTMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmpz/tmpz/var/tmpz/usr/tmp)r�getenv�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlistZenvname�dirnamerrr�_candidate_tempdir_list�s&


�rLcCsFt�}t�}|D�]}|tjkr,tj�|�}td�D�]�}t|�}tj�||�}zft�	|t
d�}z<z*t
j	|ddd��}|�d�W5QRXW5t�|�XW5t�|�X|WStk
r�Yq4tk
�rtjdk�rtj�|��rt�|tj��rYq4YqYq4tk
�r,YqYq4Xq4qttjd|��dS)	N�d��wbF)�closefdsblatr?z)No usable temporary directory found in %s)r(rLrrIrD�abspathr8�nextr9�open�_bin_openflags�unlink�close�_io�write�FileExistsError�PermissionErrorrB�isdir�access�W_OKr�FileNotFoundError�_errnoZENOENT)ZnamerrJr%�seqrB�filename�fd�fprrr�_get_default_tempdir�s@	

�
��rdcCs2tdkr.t��ztdkr t�aW5t��XtSr )�_name_sequence�
_once_lock�acquire�releaser(rrrr�_get_candidate_names�s

ric
	Cs�t�}|tkrttj|�}tt�D]�}t|�}tj�	||||�}t
�d|�zt�||d�}	WnVt
k
rzYq"Yn@tk
r�tjdkr�tj�|�r�t�|tj�r�Yq"n�YnX|	tj�|�fSt
tjd��dS)Nztempfile.mkstemprNr?z#No usable temporary file name found)rir�maprr"r8rrRrDr9�_sys�auditrSrYrZrBr[r\r]rQr_�EEXIST)
r%ZpreZsuf�flagsr&�namesr`rB�filerbrrr�_mkstemp_inner�s*��rqcCstSr )r!rrrrr	
scCst�t��Sr )rr"r	rrrrrscCs2tdkr.t��ztdkr t�aW5t��XtSr )r
rfrgrhrdrrrrrs

cCst�t��Sr )rr"rrrrrr
#sFcCs2t|||�\}}}}|rt}nt}t|||||�Sr )r'�_text_openflagsrTrq)r$r#r%�textr&rnrrrr's
c	Cs�t|||�\}}}}t�}|tkr.ttj|�}tt�D]�}t|�}tj	�
||||�}t�d|�zt�
|d�WnVtk
r�Yq6Yn@tk
r�tjdkr�tj	�|�r�t�|tj�r�Yq6n�YnX|Sttjd��dS)Nztempfile.mkdtemp�r?z(No usable temporary directory name found)r'rirrjrr"r8rrRrDr9rkrl�mkdirrYrZrBr[r\r]r_rm)r$r#r%r&ror`rBrprrrrNs,
��r6cCs`|dkrt�}t�}tt�D]2}t|�}tj�||||�}t|�s|Sqt	t
jd��dS)Nz"No usable temporary filename found)rrir8rrRrrDr9rrYr_rm)r$r#r%ror`rBrprrrrvs
�c@sHeZdZdZdZddd�Zejdkr<ejfdd�Z	d	d
�Z
ndd�Z	dS)
�_TemporaryFileCloserNFTcCs||_||_||_dSr )rprB�delete�r-rprBrwrrr�__init__�sz_TemporaryFileCloser.__init__r?cCs<|js8|jdk	r8d|_z|j��W5|jr6||j�XdS�NT)�close_calledrprwrBrV)r-rUrrrrV�sz_TemporaryFileCloser.closecCs|��dSr )rVr/rrr�__del__�sz_TemporaryFileCloser.__del__cCs|jsd|_|j��dSrz)r{rprVr/rrrrV�s)T)r;r<r=rpr{ryrrBrUrVr|rrrrrv�s



rvc@s>eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�_TemporaryFileWrapperTcCs$||_||_||_t|||�|_dSr )rprBrwrv�_closerrxrrrry�sz_TemporaryFileWrapper.__init__cs^|jd}t||�}t|d�rD|�t����fdd��}|j|_|}t|t�sZt|||�|S)Nrp�__call__cs
�||�Sr r)r�kwargs��funcrr�func_wrapper�sz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	�__dict__r+�hasattr�
_functools�wrapsr~r�int�setattr)r-rBrp�ar�rr�r�__getattr__�s



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr )rp�	__enter__r/rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr )rp�__exit__rV)r-�exc�value�tb�resultrrrr��sz_TemporaryFileWrapper.__exit__cCs|j��dSr )r~rVr/rrrrV�sz_TemporaryFileWrapper.closeccs|jD]
}|VqdSr )rp)r-�linerrrr0�s
z_TemporaryFileWrapper.__iter__N)T)	r;r<r=ryr�r�r�rVr0rrrrr}�s
r}�w+b���T��errorscCs�t|||�\}}}}	t}
tjdkr0|r0|
tjO}
t||||
|	�\}}z$tj||||||d�}
t|
||�WSt	k
r�t�
|�t�|��YnXdS)Nr?��	buffering�newline�encodingr�)r'rTrrBZO_TEMPORARYrqrWrSr}�
BaseExceptionrUrV)�moder�r�r�r$r#r%rwr�r&rnrbrBrprrrrs 

�

�posix�cygwin�	O_TMPFILEc
Cs�t|||�\}}}}t}	tr�z$|	tjBtj@}
t�||
d�}Wn*tk
rXdaYnFtk
rjYn4Xzt	j||||||d�WSt�
|��YnXt||||	|�\}}z"t�|�t	j||||||d�WSt�
|��YnXdS)NrNFr�)
r'rT�_O_TMPFILE_WORKSrr��O_CREATrS�IsADirectoryErrorrrWrVrqrU)
r�r�r�r�r$r#r%r�r&rnZflags2rbrBrrrr2s<
�


�
c@s�eZdZdZd9dd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
edd��Zedd��Z
edd��Zdd�Zdd�Zdd �Zed!d"��Zed#d$��Zed%d&��Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zed/d0��Zd1d2�Zd:d3d4�Zd5d6�Zd7d8�ZdS);rFrr�r�Nr�c	
	CsTd|krt��|_ntjt��||	|d�|_||_d|_||||||||	d�|_dS)N�b)r�r�r�F)r�r�r$r#r�r�r%r�)rW�BytesIO�_file�
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r-�max_sizer�r�r�r�r$r#r%r�rrrryus"
��zSpooledTemporaryFile.__init__cCs,|jr
dS|j}|r(|��|kr(|��dSr )r�r��tell�rollover)r-rpr�rrr�_check�s
zSpooledTemporaryFile._checkcCsr|jr
dS|j}tf|j�}|_|`|��}t|d�rN|j�|���	��n|�|�	��|�
|d�d|_dS)N�bufferrT)r�r�rr�r�r�r�rX�detach�getvalue�seek)r-rpZnewfile�posrrrr��s
zSpooledTemporaryFile.rollovercCs|jjrtd��|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr/rrrr��szSpooledTemporaryFile.__enter__cCs|j��dSr �r�rV�r-r�r�r�rrrr��szSpooledTemporaryFile.__exit__cCs
|j��Sr )r�r0r/rrrr0�szSpooledTemporaryFile.__iter__cCs|j��dSr r�r/rrrrV�szSpooledTemporaryFile.closecCs|jjSr )r�r�r/rrrr��szSpooledTemporaryFile.closedcCs|jjSr )r�r�r/rrrr��szSpooledTemporaryFile.encodingcCs|jjSr )r�r�r/rrrr��szSpooledTemporaryFile.errorscCs|��|j��Sr )r�r��filenor/rrrr��szSpooledTemporaryFile.filenocCs|j��dSr )r��flushr/rrrr��szSpooledTemporaryFile.flushcCs
|j��Sr )r��isattyr/rrrr��szSpooledTemporaryFile.isattycCs.z
|jjWStk
r(|jdYSXdS)Nr�)r�r�rHr�r/rrrr��s
zSpooledTemporaryFile.modecCs&z
|jjWStk
r YdSXdSr )r�rBrHr/rrrrB�s
zSpooledTemporaryFile.namecCs|jjSr )r��newlinesr/rrrr��szSpooledTemporaryFile.newlinescGs|jj|�Sr )r��read�r-rrrrr��szSpooledTemporaryFile.readcGs|jj|�Sr )r��readliner�rrrr��szSpooledTemporaryFile.readlinecGs|jj|�Sr )r��	readlinesr�rrrr��szSpooledTemporaryFile.readlinescGs|jj|�Sr )r�r�r�rrrr��szSpooledTemporaryFile.seekcCs|jjSr )r��	softspacer/rrrr��szSpooledTemporaryFile.softspacecCs
|j��Sr )r�r�r/rrrr��szSpooledTemporaryFile.tellcCs6|dkr|j��n||jkr&|��|j�|�dSr )r��truncater�r�)r-�sizerrrr��s

zSpooledTemporaryFile.truncatecCs|j}|�|�}|�|�|Sr )r�rXr�)r-�srp�rvrrrrX�s

zSpooledTemporaryFile.writecCs|j}|�|�}|�|�|Sr )r��
writelinesr�)r-�iterablerpr�rrrr��s

zSpooledTemporaryFile.writelines)rr�r�NNNNN)N)r;r<r=r�ryr�r�r�r�r0rVr>r�r�r�r�r�r�r�rBr�r�r�r�r�r�r�r�rXr�rrrrrnsR��







c@sNeZdZddd�Zedd��Zedd��Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rNcCs0t|||�|_tj||j|jd�|�d�|_dS)NzImplicitly cleaning up {!r})�warn_message)rrB�_weakrefZfinalize�_cleanup�format�
_finalizer)r-r$r#r%rrrrys�zTemporaryDirectory.__init__cs ��fdd�}tj�|d�dS)Nc	s�t|dt�r�dd�}zV|�kr0|tj�|��||�zt�|�Wn"ttfk
rh��|�YnXWq�tk
r�Yq�Xnt|dt�r�n�dS)NrcSs6zt�|d�Wntk
r$YnXt�|d�dS)Nrrt)rZchflagsrH�chmod)rDrrr�
resetpermss
z?TemporaryDirectory._rmtree.<locals>.onerror.<locals>.resetperms)	�
issubclassrZrrDrKrUr��_rmtreer^)r�rD�exc_infor���clsrBrr�onerrorsz+TemporaryDirectory._rmtree.<locals>.onerror)r�)�_shutilZrmtree)r�rBr�rr�rr�szTemporaryDirectory._rmtreecCs|�|�t�|t�dSr )r��	_warnings�warn�ResourceWarning)r�rBr�rrrr�/s
zTemporaryDirectory._cleanupcCsd�|jj|j�S)Nz	<{} {!r}>)r��	__class__r;rBr/rrr�__repr__4szTemporaryDirectory.__repr__cCs|jSr )rBr/rrrr�7szTemporaryDirectory.__enter__cCs|��dSr )�cleanupr�rrrr�:szTemporaryDirectory.__exit__cCs|j��r|�|j�dSr )r�r�r�rBr/rrrr�=s
zTemporaryDirectory.cleanup)NNN)r;r<r=ry�classmethodr�r�r�r�r�r�rrrrr�s


)NNNF)NNN)r�r�NNNNNT)r�r�NNNNN)=�__all__�	functoolsr��warningsr��iorW�osrZshutilr��errnor_Zrandomrr,�sysrk�weakrefr��_thread�
allocate_lockZ_allocate_lock�O_RDWRr��O_EXCLrrr�rrTrrr!rfrrr'r(rLrdrerirqr	rr
rr
rrrrvr}rrB�platformrr�r�objectrrrrr�<module>s��





	-
'
( +?��'
��<_sitebuiltins.cpython-38.opt-2.pyc000064400000005617151450073350013025 0ustar00U

e5d+�@s<ddlZGdd�de�ZGdd�de�ZGdd�de�ZdS)�Nc@s&eZdZdd�Zdd�Zddd�ZdS)	�QuittercCs||_||_dS�N��name�eof)�selfrr�r�%/usr/lib64/python3.8/_sitebuiltins.py�__init__szQuitter.__init__cCsd|j|jfS)NzUse %s() or %s to exitr�rrrr	�__repr__szQuitter.__repr__NcCs(ztj��WnYnXt|��dSr)�sys�stdin�close�
SystemExit)r�coderrr	�__call__s
zQuitter.__call__)N)�__name__�
__module__�__qualname__r
rrrrrr	r
src@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
�_Printer�rcs4ddl�||_||_d|_��fdd�|D�|_dS)Nrcs$g|]}�D]}�j�||��qqSr)�path�join)�.0�dir�filename��files�osrr	�
<listcomp>(s�z%_Printer.__init__.<locals>.<listcomp>)r�_Printer__name�_Printer__data�_Printer__lines�_Printer__filenames)rr�datar�dirsrrr	r
#s�z_Printer.__init__c
Cs~|jr
dSd}|jD]B}z(t|d��}|��}W5QRXWqXWqtk
rTYqXq|sb|j}|�d�|_t|j�|_dS)N�r�
)	r#r$�open�read�OSErrorr"�split�len�_Printer__linecnt)rr%r�fprrr	�__setup,s

z_Printer.__setupcCs8|��t|j�|jkr$d�|j�Sd|jfdSdS)Nr(z!Type %s() to see the full %s text�)�_Printer__setupr-r#�MAXLINESrr!rrrr	r<sz_Printer.__repr__cCs�|��d}d}z(t|||j�D]}t|j|�q"Wntk
rPYq�YqX||j7}d}|dkr~t|�}|dkr`d}q`|dkrq�qdS)Nz0Hit Return for more, or q (and Return) to quit: r)��qr5)r2�ranger3�printr#�
IndexError�input)r�prompt�lineno�i�keyrrr	rCs 

z_Printer.__call__N)rr)rrrr3r
r2rrrrrr	rs

	rc@seZdZdd�Zdd�ZdS)�_HelpercCsdS)NzHType help() for interactive help, or help(object) for help about object.rrrrr	rbsz_Helper.__repr__cOsddl}|j||�S)Nr)�pydoc�help)r�args�kwdsr?rrr	resz_Helper.__call__N)rrrrrrrrr	r>Xs
r>)r
�objectrrr>rrrr	�<module>s;types.cpython-38.pyc000064400000021733151450073350010351 0ustar00U

e5d�%�@s�dZddlZdd�Zee�Zedd��Zeej�Zeej�Z	eej
�Zdd�Zee��Z
d	d
�Zee��Zdd�Ze�Zee�Ze��d
d�Ze�Zee�ZGdd�d�Zee�j�Zee�Zegj�Zeej�Zee�j�Z ee!j"�Z#ee$jd�Z%ee�Z&ze'�Wn:e'k
�rBe�(�dZ)ee)�Z*ee)j+�Z,dZ)[)YnXeej�Z-eej.�Z/[[[[[[d$dd�Z0dd�Z1d%dd�Z2dd�Z3Gdd�d�Z4Gdd�d�Z5d d!�Z6d"d#�e7�D�Z8dS)&zO
Define names for built-in types that aren't directly accessible as a builtin.
�NcCsdS�N�rrr�/usr/lib64/python3.8/types.py�_f�rcCsdSrrrrrr�<lambda>
rrcsd��fdd�}|jdS)N�csdSrrr��arr�fsz_cell_factory.<locals>.fr)�__closure__)rrr	r�
_cell_factorysr
ccs
dVdS)Nrrrrrr�_gsrc�sdSrrrrrr�_crrcCs
dVdSrrrrrr�_ag"src@seZdZdd�ZdS)�_CcCsdSrr��selfrrr�_m(rz_C._mN)�__name__�
__module__�__qualname__rrrrrr'sr�fromkeys�rcCsJt|�}t|||�\}}}|dk	r*||�||k	r:||d<||||f|�S)zBCreate a class object dynamically using the appropriate metaclass.N�__orig_bases__)�
resolve_bases�
prepare_class)�name�bases�kwds�	exec_body�resolved_bases�meta�nsrrr�	new_classEsr$cCs�t|�}d}d}t|�D]j\}}t|t�r,qt|d�s8q|�|�}d}t|t�sZtd��q||||||d�<|t|�d7}q|s�|St|�S)z8Resolve MRO entries dynamically as specified by PEP 560.Fr�__mro_entries__Tz#__mro_entries__ must return a tupler)	�list�	enumerate�
isinstance�type�hasattrr%�tuple�	TypeError�len)r�	new_bases�updated�shift�i�base�new_baserrrrOs"




rcCs~|dkri}nt|�}d|kr*|�d�}n|r<t|d�}nt}t|t�rTt||�}t|d�rp|j||f|�}ni}|||fS)azCall the __prepare__ method of the appropriate metaclass.

    Returns (metaclass, namespace, kwds) as a 3-tuple

    *metaclass* is the appropriate metaclass
    *namespace* is the prepared class namespace
    *kwds* is an updated copy of the passed in kwds argument with any
    'metaclass' entry removed. If no kwds argument is passed in, this will
    be an empty dict.
    N�	metaclassr�__prepare__)�dict�popr)r(�_calculate_metar*r5)rrrr"r#rrrrds


rcCs>|}|D]0}t|�}t||�r qt||�r0|}qtd��q|S)z%Calculate the most derived metaclass.zxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r)�
issubclassr,)r"r�winnerr2�	base_metarrrr8�s


r8c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�DynamicClassAttributeaRoute attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    This allows one to have properties active on an instance, and have virtual
    attributes on the class with the same name (see Enum for an example).

    NcCs>||_||_||_|p|j|_|dk|_tt|dd��|_dS)N�__isabstractmethod__F)�fget�fset�fdel�__doc__�
overwrite_doc�bool�getattrr=)rr>r?r@�docrrr�__init__�s
zDynamicClassAttribute.__init__cCs6|dkr|jr|St��n|jdkr,td��|�|�S)Nzunreadable attribute)r=�AttributeErrorr>)r�instance�
ownerclassrrr�__get__�s
zDynamicClassAttribute.__get__cCs"|jdkrtd��|�||�dS)Nzcan't set attribute)r?rG)rrH�valuerrr�__set__�s
zDynamicClassAttribute.__set__cCs |jdkrtd��|�|�dS)Nzcan't delete attribute)r@rG)rrHrrr�
__delete__�s
z DynamicClassAttribute.__delete__cCs8|jr|jnd}t|�||j|j|p(|j�}|j|_|Sr)rBrAr)r?r@)rr>�fdoc�resultrrr�getter�szDynamicClassAttribute.gettercCs$t|�|j||j|j�}|j|_|Sr)r)r>r@rArB)rr?rOrrr�setter�szDynamicClassAttribute.settercCs$t|�|j|j||j�}|j|_|Sr)r)r>r?rArB)rr@rOrrr�deleter�szDynamicClassAttribute.deleter)NNNN)N)rrrrArFrJrLrMrPrQrRrrrrr<�s


	r<c@s�eZdZdd�Zdd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
edd��ZeZe	Z
e
ZeZdd�Zdd�ZeZdS)�_GeneratorWrappercCs2||_|jtk|_t|dd�|_t|dd�|_dS)Nrr)�_GeneratorWrapper__wrapped�	__class__�
GeneratorType�_GeneratorWrapper__isgenrDrr)r�genrrrrF�sz_GeneratorWrapper.__init__cCs|j�|�Sr)rT�send)r�valrrrrY�sz_GeneratorWrapper.sendcGs|jj|f|��Sr)rT�throw)r�tp�restrrrr[�sz_GeneratorWrapper.throwcCs
|j��Sr)rT�closerrrrr^�sz_GeneratorWrapper.closecCs|jjSr)rT�gi_coderrrrr_�sz_GeneratorWrapper.gi_codecCs|jjSr)rT�gi_framerrrrr`�sz_GeneratorWrapper.gi_framecCs|jjSr)rT�
gi_runningrrrrra�sz_GeneratorWrapper.gi_runningcCs|jjSr)rT�gi_yieldfromrrrrrb�sz_GeneratorWrapper.gi_yieldfromcCs
t|j�Sr)�nextrTrrrr�__next__�sz_GeneratorWrapper.__next__cCs|jr|jS|Sr)rWrTrrrr�__iter__�sz_GeneratorWrapper.__iter__N)rrrrFrYr[r^�propertyr_r`rarb�cr_code�cr_frame�
cr_running�cr_awaitrdre�	__await__rrrrrS�s&



rScs�t��std���jtkrft�dd�jtkrf�jj}|d@r@�S|d@rf�j}|j|jdBd��_�Sddl	}ddl
�|�����fd	d
��}|S)z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callable�__code__Ni�� �)�co_flagsrcsR�||�}|jtks*|jtkr.|jjd@r.|St|�j�rNt|�j�sNt|�S|S)Nrn)	rU�
CoroutineTyperVr_ror(�	Generator�	CoroutinerS)�args�kwargs�coro��_collections_abc�funcrr�wrappeds

�
�
�zcoroutine.<locals>.wrapped)�callabler,rU�FunctionTyperD�CodeTyperlro�replace�	functoolsrw�wraps)rxro�cor~ryrrvr�	coroutine�s"
�r�cCs g|]}|dd�dkr|�qS)Nr�_r)�.0�nrrr�
<listcomp>(sr�)rNN)rN)9rA�sysrr)r{�
LambdaTyperlr|�__dict__�MappingProxyType�implementation�SimpleNamespacer
�CellTyperrVrrpr^r�AsyncGeneratorTyperr�
MethodTyper-�BuiltinFunctionType�append�BuiltinMethodType�objectrF�WrapperDescriptorType�__str__�MethodWrapperType�str�join�MethodDescriptorTyper6�ClassMethodDescriptorType�
ModuleTyper,�exc_info�tb�
TracebackType�tb_frame�	FrameType�GetSetDescriptorType�__globals__�MemberDescriptorTyper$rrr8r<rSr��globals�__all__rrrr�<module>s\













 :%4_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.opt-2.pyc000064400000070732151450073350017465 0ustar00U

��.en���@s`dddddddddddddd	dd
ddd
dddddddddddddddddddddddddd d!d"d#dddd$d%dd&d'd(d$d)dddd*d+dddddddd,d$d$d$d$dd$dd$d$d$d$d$dddddddddd$dd$d$d$d$d$d$d$d$dd$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$dd$dd$dd$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$ddd$d$dd$dddd$d$d$ddd$d$dddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$dd$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$d$d$d$d$ddd$d$d$dd$d$ddd$d$d$d$d$d$d$dddddd$dd$d$dddddd$ddd$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$ddd$d$d$ddd$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd-ddd.d/d.d.d0d1d2dd3d4d5dd	d6ddd7dd8d9dd:d;dd<ddd=d>d?d@ddd)ddAdBddCdddd
dd$dDdEdFdGdddHddIdJd$dKddddLdMdddddddddNdOdPdddQd$d$dRdd
ddSddddTdUdddVddWd$dXdYddZd4d[d\dd]dd$ddd^d_d`dadbd7ddcddd=ded$dddfdgdhdgdfdhdfdfdgdgdfd\dfdfdfdfdgd$didjdkd$dldmddnd8d$dddddoddpdqdd$ddddrd$d6dsd$d$d$d$dddd$d$ddtdudsdvdwdwdsdx���ZdyS)z��ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPythonz/usr/binz/usr/lib64/python3.8z-L. -lpython3.8zOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8zA/builddir/build/BUILD/Python-3.8.17/build/optimized/coverage.infoz?/builddir/build/BUILD/Python-3.8.17/build/optimized/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz.cpython-38-x86_64-linux-gnu.soi�ZyeszG/usr/include /usr/include /usr/include/python3.8 /usr/include/python3.8z/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8.soz3.8z
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz0/usr/lib64/python3.8/config-3.8-x86_64-linux-gnuzlibpython3.8.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa:-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgoz
libpython3.sozno-frameworkz./python -Ez	python3.8a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa.-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internala-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidzCLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimizedz	@SGI_ABI@z/bin/shz.so���zcpython-38-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczLLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz3/builddir/build/BUILD/Python-3.8.17/build/optimizedz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�>/usr/lib64/python3.8/_sysconfigdata__linux_x86_64-linux-gnu.py�<module>sb2,/��������getpass.cpython-38.opt-1.pyc000064400000010124151450073350011602 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddlZdddgZGdd�de�Zddd	�Z	dd
d�Z
ddd
�Zddd�Zdd�Z
zddlZejejfWnBeefk
r�zddlZWnek
r�eZYnXe
ZYnXe	ZdS)a�Utilities to get a password and/or the current user name.

getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.

GetPassWarning - This UserWarning is issued when getpass() cannot prevent
                 echoing of the password contents while reading.

On Windows, the msvcrt module will be used.

�N�getpass�getuser�GetPassWarningc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/getpass.pyrs�
Password: c
Cs�d}t�����}zJt�dtjtjB�}t�|d�}|�|�t�	|�}|�|�|sX|}Wnpt
k
r�}zR|��ztj
��}Wn&ttfk
r�d}t||�}YnXtj
}|s�tj}W5d}~XYnX|dk	�r�z�t�|�}|dd�}	|	dtjM<tj}
ttd��r|
tjO}
z t�||
|	�t|||d�}W5t�||
|�|��XWn@tjk
�r�|dk	�rz�||k	�r�|��t||�}YnX|�d�|W5QR�SQRXdS)aPrompt for a password, with echo turned off.

    Args:
      prompt: Written on stream to ask for the input.  Default: 'Password: '
      stream: A writable file object to display the prompt.  Defaults to
              the tty.  If no tty is available defaults to sys.stderr.
    Returns:
      The seKr3t input.
    Raises:
      EOFError: If our input tty or stdin was closed.
      GetPassWarning: When we were unable to turn echo off on the input.

    Always restores terminal settings before returning.
    Nz/dev/ttyzw+��TCSASOFT)�input�
)�
contextlib�	ExitStack�os�open�O_RDWR�O_NOCTTY�io�FileIO�
enter_context�
TextIOWrapper�OSError�close�sys�stdin�fileno�AttributeError�
ValueError�fallback_getpass�stderr�termios�	tcgetattrZECHOZ	TCSAFLUSH�hasattrr�	tcsetattr�flush�
_raw_input�error�write)�prompt�streamZpasswd�stack�fdZttyr
�e�old�newZtcsetattr_flagsrrr	�unix_getpasssR








r1cCs�tjtjk	rt||�S|D]}t�|�qd}t��}|dkst|dkrHqt|dkrTt�|dkrj|dd�}q.||}q.t�d�t�d�|S)z9Prompt for password with echo off, using Windows getch().��
r��N���)rr�	__stdin__r �msvcrtZputwchZgetwch�KeyboardInterrupt)r*r+�cZpwrrr	�win_getpassas 



r;cCs0tjdtdd�|stj}td|d�t||�S)Nz%Can not control echo on the terminal.�)�
stacklevelz&Warning: Password input may be echoed.)�file)�warnings�warnrrr!�printr')r*r+rrr	r xs�r r2cCs�|s
tj}|stj}t|�}|rpz|�|�Wn8tk
rf|�|jd�}|�|j�}|�|�YnX|�	�|�
�}|s�t�|ddkr�|dd�}|S)N�replacer6r)rr!r�strr)�UnicodeEncodeError�encode�encoding�decoder&�readline�EOFError)r*r+r
�linerrr	r'�s&r'cCs<dD]}tj�|�}|r|Sqddl}|�t���dS)z�Get the username from the environment or password database.

    First try various environment variables, then the password
    database.  This works on Windows as long as USERNAME is set.

    )ZLOGNAMEZUSERZLNAMEZUSERNAMErN)r�environ�get�pwd�getpwuid�getuid)�name�userrMrrr	r�s
)r
N)r
N)r
N)r2NN)�__doc__rrrrr?�__all__�UserWarningrr1r;r r'rr"r#r%�ImportErrorrr8rrrrr	�<module>s,

D

	


genericpath.cpython-38.pyc000064400000007643151450073350011502 0ustar00U

e5do�@s�dZddlZddlZddddddd	d
ddd
gZdd�Zdd
�Zdd	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd
�Zdd�Z
dd�Zdd�Zdd�ZdS)z�
Path operations common to more than one OS
Do not use directly.  The OS specific modules import the appropriate
functions from this module themselves.
�N�commonprefix�exists�getatime�getctime�getmtime�getsize�isdir�isfile�samefile�sameopenfile�samestatc	Cs.zt�|�Wnttfk
r(YdSXdS)zDTest whether a path exists.  Returns False for broken symbolic linksFT)�os�stat�OSError�
ValueError)�path�r�#/usr/lib64/python3.8/genericpath.pyrs
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z%Test whether a path is a regular fileF)r
rrr�S_ISREG�st_mode)r�strrrr	s
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z<Return true if the pathname refers to an existing directory.F)r
rrr�S_ISDIRr)�srrrrr's
cCst�|�jS)z1Return the size of a file, reported by os.stat().)r
r�st_size��filenamerrrr0scCst�|�jS)zCReturn the last modification time of a file, reported by os.stat().)r
r�st_mtimerrrrr5scCst�|�jS)z=Return the last access time of a file, reported by os.stat().)r
r�st_atimerrrrr:scCst�|�jS)zAReturn the metadata change time of a file, reported by os.stat().)r
r�st_ctimerrrrr?scCsl|sdSt|dttf�s*tttj|��}t|�}t|�}t|�D]$\}}|||krB|d|�SqB|S)zGGiven a list of pathnames, returns the longest common leading component�rN)	�
isinstance�list�tuple�mapr
�fspath�min�max�	enumerate)�m�s1�s2�i�crrrrEscCs|j|jko|j|jkS)z5Test whether two stat buffers reference the same file)�st_ino�st_dev)r)r*rrrrWs
�cCst�|�}t�|�}t||�S)z�Test whether two pathnames reference the same actual file or directory

    This is determined by the device number and i-node number and
    raises an exception if an os.stat() call on either pathname fails.
    )r
rr)�f1�f2r)r*rrrr
^s

cCst�|�}t�|�}t||�S)z:Test whether two open file objects reference the same file)r
�fstatr)�fp1�fp2r)r*rrrrks

cCs�|�|�}|r"|�|�}t||�}|�|�}||krz|d}||krz|||d�|krp|d|�||d�fS|d7}q<||dd�fS)z�Split the extension from a pathname.

    Extension is everything from the last dot to the end, ignoring
    leading dots.  Returns "(root, ext)"; ext may be empty.�Nr)�rfindr&)�p�sep�altsep�extsep�sepIndex�altsepIndex�dotIndex�
filenameIndexrrr�	_splitextys




r>cGs`d}}|D]<}t|t�r d}qt|t�r0d}qt|�d|jj���d�q|r\|r\td�d�dS)NFTz;() argument must be str, bytes, or os.PathLike object, not z.Can't mix strings and bytes in path components)r �str�bytes�	TypeError�	__class__�__name__)�funcname�args�hasstr�hasbytesrrrr�_check_arg_types�s

�rH)�__doc__r
r�__all__rr	rrrrrrrr
rr>rHrrrr�<module>s.
�	
warnings.cpython-38.opt-2.pyc000064400000025247151450073350012001 0ustar00U

e5d�L�@s�ddlZdddddddd	gZd;d
d�Zd<dd�Zdd
�Zdd�ZeZdd�ZeZdd�Z	de
dddfdd�Ze
ddfdd�Zdd�Z
dd�ZGdd�de�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd=d*d�Zd>d+d�ZGd,d-�d-e�ZGd.d	�d	e�Zd/d0�Zz0dd1lmZmZm Z mZmZm!Z!eZ"e Z#d2Z$Wn2e%k
�rjgZd3Z"iZ#d)a&d4d5�Z!dZ$YnXeej'�e$�s�e(ed6��s�ed3e)d7d)d8�ed9e)d)d:�ed9e*d)d:�ed9e+d)d:�ed9e,d)d:�[$dS)?�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS�N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r� /usr/lib64/python3.8/warnings.pyr
scCst||||d|�}t|�Sr
)r�_formatwarnmsg_impl)r
rrrrrrrrrscCsP|j}|dkr tj}|dkr dSt|�}z|�|�Wntk
rJYnXdSr
)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdkrpzddl}|�|j|j�}Wqvtk
rld}d}YqvXn|j}|r�|�	�}|d|7}|j
dk	�r�zddl}Wntk
r�d}d}Yn4X|��}z|�
|j
�}Wntk
r�d}YnX|dk	�r�|d7}|D]t}|d|j|jf7}z$|dk	�rB|�|j|j�}nd}Wntk
�rbd}YnX|�r|�	�}|d	|7}�qn|�s�||�d
�7}|S)N�:z: �
rz  %s
Tz-Object allocated at (most recent call last):
z  File "%s", lineno %s
z    %s
z<: Enable tracemalloc to get the object allocation traceback
)r�__name__rrr
r�	linecache�getline�	Exception�strip�source�tracemalloc�
is_tracing�get_object_traceback)	rr�sr rr%�tracing�tb�framerrrr#sT"




�

rcCsdzt}Wntk
rYn<X|tk	rXt|�s6td��||j|j|j|j|j	|j
�dSt|�dS)Nz:warnings.showwarning() must be set to a function or method)r�	NameError�_showwarning_orig�callable�	TypeErrorr
rrrrrr)r�swrrr�_showwarnmsg`s�r1cCsHzt}Wntk
rYn$X|tk	r@||j|j|j|j|j�St|�Sr
)	rr,�_formatwarning_origr
rrrrr)r�fwrrrrus
�r�FcCsT|s|rddl}|r$|�||j�}nd}|r8|�|�}nd}t||||||d�dS)Nr��append)�re�compile�I�_add_filter)�actionr
r�modulerr6r7rrrr�scCst|d|d||d�dS)Nr5)r:)r;rrr6rrrr�scGsR|s6zt�|�Wntk
r&YnXt�d|�n|tkrHt�|�t�dS)Nr)�filters�remove�
ValueError�insertr6�_filters_mutated)r6�itemrrrr:�s
r:cCsgtdd�<t�dSr
)r=rArrrrr�sc@seZdZdS)�_OptionErrorN)r�
__module__�__qualname__rrrrrC�srCcCsN|D]D}zt|�Wqtk
rF}ztd|tjd�W5d}~XYqXqdS)NzInvalid -W option ignored:)r)�
_setoptionrC�printrr)�args�argrrrr�_processoptions�s
rJc	Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t	�Wq�t	t
fk
r�td	|f�d�Yq�Xnd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr4cSsg|]}|���qSr)r#)�.0r(rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrCr6�
_getaction�_getcategoryr7�escape�intr?�
OverflowErrorr)rI�partsr;r
rr<rr7rrrrF�s2
�
rFcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)N�default�all�always)rVrX�ignorer<�once�errorzinvalid action: %r)�
startswithrC)r;�arrrrP�s

rPcCs�|stSd|krddl}|}nJ|�d�\}}}zt|dd|g�}Wn$tk
rftd|f�d�YnXzt||�}Wn$tk
r�td|f�d�YnXt|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	�Warning�builtins�
rpartition�
__import__�ImportErrorrC�getattr�AttributeError�
issubclass)r�m�klassr<�_�catrrrrQ�s"
rQcCs|jj}d|kod|kS)N�	importlib�
_bootstrap)�f_code�co_filename)r+rrrr�_is_internal_framesrocCs"|j}|dk	rt|�r|j}q|Sr
)�f_backro)r+rrr�_next_external_framesrq�c	Cst|t�r|j}|dkrt}t|t�r0t|t�sDtd�t|�j���zV|dks\t	t
�d��rht
�|�}n0t
�d�}t|d�D]}t
|�}|dkr~t�q~Wn"tk
r�t
j}d}d}YnX|j}|jj}|j}d|kr�|d}	nd}	|�di�}
t|||||	|
||�dS)Nz/category must be a Warning subclass, not '{:s}'rrrrz<string>Z__warningregistry__)�
isinstancer_�	__class__�UserWarning�typerfr/�formatrror�	_getframe�rangerqr?�__dict__�	f_globalsrmrn�f_lineno�
setdefaultr)r
r�
stacklevelr$r+�x�globalsrrr<�registryrrrrs>
�



�cCs�t|�}|dkr8|pd}|dd���dkr8|dd�}|dkrDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSt	D]V}
|
\}}}
}}|dks�|�
|�r�t||
�r�|dks�|�
|�r�|dks�||kr��qq�t}|dk�rdSddl
}|�||�|dk�r2|�|dk�rfd	||	<||f}t�|��r\dSd	t|<nf|d
k�rrnZ|dk�r�d	||	<||df}|�|��r�dSd	||<n$|dk�r�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrrYr[rZrrrXr<rVz1Unrecognized action (%r) in warnings.filters:
 %s)rS�lower�get�_filters_version�clearrsr_�strrtr=�matchrf�
defaultactionr �getlines�onceregistry�RuntimeErrorrr1)r
rrrr<r��module_globalsr$r�keyrBr;rrj�modZlnr ZoncekeyZaltkeyrrrrGs|


�����









��c@s"eZdZdZddd�Zdd�ZdS)r)r
rrrrrr$NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr
)	r
rrrrrr$r�_category_name)�selfr
rrrrrr$rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r
r�rrr)r�rrr�__str__�s��zWarningMessage.__str__)NNN)rrDrE�_WARNING_DETAILSr�r�rrrrr�s�
rc@s4eZdZddd�dd�Zdd�Zdd	�Zd
d�ZdS)r	FN)�recordr<cCs(||_|dkrtjdn||_d|_dS)N�warningsF)�_recordr�modules�_module�_entered)r�r�r<rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdk	r4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r6r�rr�rvr�join)r�rH�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�r=�_filtersrAr�_showwarningrr�r6r-)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�r=rAr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)rrDrEr�r�r�r�rrrrr	�s	cszd�j�d�g}�jdk	rVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s4t�j�D]$\}}}��||�}||||fVq
dSr
)�reversed�	cr_originr!)rr�funcnamer��coror rr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r4r�)rr~r$)rEr�r �	tracebackr6�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)r=�_defaultaction�
_onceregistryrrrATrVcCstd7adS)Nrr)r�rrrrrAsrAZgettotalrefcount�__main__)rr<r6rY)rr6)NN)N)NrrN)NNNN)-r�__all__rrrrr-r1r2rr_rrr:rr"rCrJrFrPrQrorqrr�objectrr	r��	_warningsr=r�r�rAr�r�Z_warnings_defaultsrcr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>sz�

;
�
#
	
)�
GC 

�smtpd.cpython-38.opt-2.pyc000064400000056445151450073350011304 0ustar00U

e5d���@sZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
dddddgZejdZd	ZGd
d�d�Ze�adZd
ZdZd$dd�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�Zdd�Z e!dk�rVe �Z"e"j#Z#de#k�rle#�$d�Z%e&e#de%�e'�e(�dg�Z)e#e%dd�Z#nddl*Z)e+e)e#�Z,e,e"j-e"j.fe"j/e"j0fe"j1e"j2d�Z3e"j4�r2zddl5Z5Wn.e6k
�r�e7dej8d �e�9d�YnXe5�:d!�d"Z;ze�4e;�Wn.e<k
�r0e7d#ej8d �e�9d�YnXze�=�Wne>k
�rTYnXdS)%�N)�warn)�
get_addr_spec�get_angle_addr�SMTPChannel�
SMTPServer�DebuggingServer�	PureProxy�MailmanProxyzPython SMTP proxy version 0.3c@seZdZdd�Zdd�ZdS)�DevnullcCsdS�N���self�msgrr�/usr/lib64/python3.8/smtpd.py�writef�z
Devnull.writecCsdSrr�rrrr�flushgrz
Devnull.flushN)�__name__�
__module__�__qualname__rrrrrrr
esr
�
z, i�cCs4ttt�tjd�|r&t|tjd�t�|�dS)N��file)�print�__doc__�globals�sys�stderr�exit)�coderrrr�usagepsr#c@s�eZdZdZdZdZe�efdd��Ze	dd��Z
edd	d	fd
d�Zdd
�Z
dd�Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd ��Zejd!d ��Ze	d"d#��Zejd$d#��Ze	d%d&��Zejd'd&��Ze	d(d)��Zejd*d)��Ze	d+d,��Zejd-d,��Ze	d.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dS)Srr�icCs|Srr)�xrrr�<lambda>|rzSMTPChannel.<lambda>cCs0zt|j���WStk
r*|jYSXdSr)�max�command_size_limits�values�
ValueError�command_size_limitrrrr�max_command_size_limit~sz"SMTPChannel.max_command_size_limitNFc	
Cs&tjj|||d�||_||_||_||_||_||_|rF|rFt	d��|rdd|_
d|_d|_t
|_nd|_
d|_td�|_d	|_|��d|_d
|_|j��t��|_z|��|_WnBtk
r�}z$|��|jdtjkr�WY�dSd}~XYnXtdt |j�t!d
�|�"d|jt#f�dS)N��map�Fdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer�
�.r�
�.�
FrzPeer:rz	220 %s %s)$�asynchat�
async_chat�__init__�smtp_server�conn�addr�data_size_limit�enable_SMTPUTF8�_decode_datar*�_emptystring�_linesep�_dotsep�NEWLINE�_newline�ord�_set_rset_state�
seen_greeting�
extended_smtpr(�clear�socketZgetfqdn�fqdnZgetpeername�peer�OSError�close�args�errnoZENOTCONNr�repr�DEBUGSTREAM�push�__version__)	rZserverr9r:r;r.r<�decode_data�errrrrr7�s@


zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|�d�dS)NFrr2)�COMMAND�
smtp_state�mailfrom�rcpttos�require_SMTPUTF8�	num_bytes�set_terminatorrrrr�_set_post_data_state�sz SMTPChannel._set_post_data_statecCs|��d|_g|_dS�Nr)r\�
received_data�received_linesrrrrrD�szSMTPChannel._set_rset_statecCstdtd�|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' instead��r�DeprecationWarningr8rrrr�__server�s
�zSMTPChannel.__servercCstdtd�||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr`ra�r�valuerrrrc�s
�cCstdtd�|jS)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr`�rrbr_rrrr�__line�s
�zSMTPChannel.__linecCstdtd�||_dS)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr`rfrdrrrrg�s
�cCstdtd�|jS)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr`�rrbrVrrrr�__state�s
�zSMTPChannel.__statecCstdtd�||_dS)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr`rhrdrrrri�s
�cCstdtd�|jS)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr`�rrbrErrrr�
__greeting�s
�zSMTPChannel.__greetingcCstdtd�||_dS)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr`rjrdrrrrk�s
�cCstdtd�|jS)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr`�rrbrWrrrr�
__mailfrom�s
�zSMTPChannel.__mailfromcCstdtd�||_dS)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr`rlrdrrrrm�s
�cCstdtd�|jS)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr`�rrbrXrrrr�	__rcpttos�s
�zSMTPChannel.__rcpttoscCstdtd�||_dS)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr`rnrdrrrro�s
�cCstdtd�|jS)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr`�rrbr^rrrr�__data�s
�zSMTPChannel.__datacCstdtd�||_dS)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr`rprdrrrrqs
�cCstdtd�|jS)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr`�rrbrIrrrr�__fqdn
s
�zSMTPChannel.__fqdncCstdtd�||_dS)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr`rrrdrrrrss
�cCstdtd�|jS)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr`�rrbrJrrrr�__peers
�zSMTPChannel.__peercCstdtd�||_dS)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr`rtrdrrrrus
�cCstdtd�|jS)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr`�rrbr9rrrr�__conn s
�zSMTPChannel.__conncCstdtd�||_dS)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr`rvrdrrrrw%s
�cCstdtd�|jS)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr`�rrbr:rrrr�__addr+s
�zSMTPChannel.__addrcCstdtd�||_dS)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr`rxrdrrrry0s
�cCs&tj�|t|d|jrdnd��dS)Nr0�utf-8�ascii)r5r6rQ�bytesrYr
rrrrQ7s
�zSMTPChannel.pushcCs|d}|j|jkr|j}n|j|jkr*|j}|r<|j|kr<dS|rR|jt|�7_|jrl|j�	t
|d��n|j�	|�dS)Nrz)rVrUr,�DATAr;rZ�lenr=r_�append�str)r�data�limitrrr�collect_incoming_data<sz!SMTPChannel.collect_incoming_datac
Cs|j�|j�}tdt|�td�g|_|j|jk�r|jd}|_|sT|�	d�dS|j
sdt|d�}|�d�}|dkr�|�
�}d}n$|d|��
�}||dd���}|jr�|j|n|j}||kr�|�	d�dSt|d	|d�}|s�|�	d
|�dS||�dS|j|jk�r(|�	d�d|_dS|j�rR|j|jk�rR|�	d�d|_dSg}|�|j�D]:}	|	�r�|	d|jk�r�|�|	dd��n
|�|	��qb|j�|�|_|j|j|j|jf}
i}|j
�s�|j|jd
�}|j j!|
|�}|�"�|�s|�	d�n
|�	|�dS)NzData:rrz500 Error: bad syntaxrz� r$z500 Error: line too longZsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data)�mail_options�rcpt_options�250 OK)#r>�joinr_rrOrPrVrUrZrQr=r��find�upper�striprFr(r+�getattrr}r;�splitr?r@rrBr^rJrWrXr�r�r8�process_messager\)
r�lineZsz�i�command�argZmax_sz�methodr��textrM�kwargsZstatusrrr�found_terminatorLsl


��


�zSMTPChannel.found_terminatorcCsH|s|�d�dS|jr&|�d�dS|��||_|�d|j�dS)Nz501 Syntax: HELO hostname�503 Duplicate HELO/EHLOz250 %s)rQrErDrI�rr�rrr�	smtp_HELO�s

zSMTPChannel.smtp_HELOcCs�|s|�d�dS|jr&|�d�dS|��||_d|_|�d|j�|jrr|�d|j�|jdd7<|js�|�d�|jr�|�d	�|jdd
7<|�d�dS)Nz501 Syntax: EHLO hostnamer�Tz250-%sz250-SIZE %s�MAIL�z250-8BITMIMEz250-SMTPUTF8�
z250 HELP)	rQrErDrFrIr;r(r=r<r�rrr�	smtp_EHLO�s&



zSMTPChannel.smtp_EHLOcCs|r|�d�n
|�d�dS)Nz501 Syntax: NOOPr��rQr�rrr�	smtp_NOOP�szSMTPChannel.smtp_NOOPcCs|�d�|��dS)Nz221 Bye)rQZclose_when_doner�rrr�	smtp_QUIT�s
zSMTPChannel.smtp_QUITcCs0t|�}|d|���|kr,||d���SdSr])r~r�r�)r�keywordr�Zkeylenrrr�_strip_command_keyword�sz"SMTPChannel._strip_command_keywordcCsF|sdS|���d�r$t|�\}}nt|�\}}|s<||fS|j|fS)N)rr�<)�lstrip�
startswithrrZ	addr_spec)rr��address�restrrr�_getaddr�szSMTPChannel._getaddrcCsHi}|D]:}|�d�\}}}|��r,|r2|s2dS|r:|nd||<q|S)N�=T)�	partition�isalnum)r�params�resultZparam�eqrerrr�
_getparams�szSMTPChannel._getparamscCs|r�d}|��}|dkr$|�d�q�|dkr8|�d�q�|dkr^d}|jrR||7}|�|�q�|dkr�d	}|jrx||7}|�|�q�|d
kr�|�d�q�|dkr�|�d
�q�|dkr�|�d�q�|dkr�|�d�q�|dkr�|�d�q�|�d�n
|�d�dS)N� [SP <mail-parameters>]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamer�z 250 Syntax: MAIL FROM: <address>ZRCPTz250 Syntax: RCPT TO: <address>r}z250 Syntax: DATAZRSETz250 Syntax: RSETZNOOPz250 Syntax: NOOPZQUITz250 Syntax: QUITZVRFYz250 Syntax: VRFY <address>zD501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFYzD250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY)r�rQrF)rr�ZextendedZlc_argrrrr�	smtp_HELP�s:zSMTPChannel.smtp_HELPcCs@|r2|�|�\}}|r"|�d�q<|�d|�n
|�d�dS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY <address>)r�rQ)rr�r�r�rrr�	smtp_VRFY�szSMTPChannel.smtp_VRFYcCs�|js|�d�dStd|td�d}|jr4|d7}|dkrJ|�|�dS|�d|�}|�|�\}}|sv|�|�dS|js�|r�|�|�dS|jr�|�d�dS|���	�|_
|�|j
�}|dkr�|�|�dS|js�|�
dd	�}|d
kr�|�d�dS|j�r8|�
dd
�}|dk�r d|_n|d
k	�r8|�d�dS|�
dd�}|�r�|���sb|�|�dS|j�r�t|�|jk�r�|�d�dSt|���dk�r�|�d�dS||_td|jtd�|�d�dS)N�503 Error: send HELO firstz	===> MAILrz 501 Syntax: MAIL FROM: <address>r�zFROM:z503 Error: nested MAIL commandZBODY�7BIT)r�Z8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMEZSMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsZSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r�)rErQrrPrFr�r�rWr�r�r�r�r=�popr<rY�isdigitr;�intr~�keys)rr��	syntaxerrr�r�Zbody�smtputf8�sizerrr�	smtp_MAILsh














zSMTPChannel.smtp_MAILcCs|js|�d�dStd|td�|js6|�d�dSd}|jrH|d7}|dkr^|�|�dS|�d|�}|�|�\}}|s�|�|�dS|js�|r�|�|�dS|���	�|_
|�|j
�}|dkr�|�|�dSt|�
��dkr�|�d	�dS|j�|�td
|jtd�|�d�dS)Nr�z	===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO: <address>r�zTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r�)rErQrrPrWrFr�r�r�r�r�r�r~r�rXr)rr�r�r�r�rrr�	smtp_RCPT7s@







zSMTPChannel.smtp_RCPTcCs(|r|�d�dS|��|�d�dS)Nz501 Syntax: RSETr�)rQrDr�rrr�	smtp_RSETZs

zSMTPChannel.smtp_RSETcCsZ|js|�d�dS|js(|�d�dS|r:|�d�dS|j|_|�d�|�d�dS)Nr�z503 Error: need RCPT commandz501 Syntax: DATAs
.
z#354 End data with <CR><LF>.<CR><LF>)rErQrXr}rVr[r�rrr�	smtp_DATAas



zSMTPChannel.smtp_DATAcCs|�d�dS)Nz502 EXPN not implementedr�r�rrr�	smtp_EXPNpszSMTPChannel.smtp_EXPN),rrrrUr}r+�collections�defaultdictr(�propertyr,�DATA_SIZE_DEFAULTr7r\rDZ_SMTPChannel__server�setterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrws�
�
'	





















>#6#c@s2eZdZeZedddfdd�Zdd�Zdd�ZdS)	rNFcCs�||_||_||_||_||_|r.|r.td��tjj||d�zNt	j
|dt	ji�}|�|dd|dd�|�
�|�|�|�d�Wn|���Yn(Xtd|jjt�t���||ftd�dS)	Nr/r-�typerr$�z0%s started at %s
	Local addr: %s
	Remote addr:%sr)Z
_localaddr�_remoteaddrr;r<r=r*�asyncore�
dispatcherr7rHZgetaddrinfoZSOCK_STREAMZ
create_socketZset_reuse_addrZbindZlistenrLr�	__class__r�time�ctimerP)rZ	localaddrZ
remoteaddrr;r.r<rSZgai_resultsrrrr7xs6�
��zSMTPServer.__init__c	Cs6tdt|�td�|�||||j|j|j|j�}dS)NzIncoming connection from %sr)rrOrP�
channel_classr;�_mapr<r=)rr9r:Zchannelrrr�handle_accepted�s�zSMTPServer.handle_acceptedcKst�dSr)�NotImplementedError�rrJrWrXr�r�rrrr��szSMTPServer.process_message)	rrrrr�r�r7r�r�rrrrrts�
c@seZdZdd�Zdd�ZdS)rcCsld}|��}|D]V}|rL|sLd|d}t|t�s@t|�d��}t|�d}t|t�s^t|�}t|�qdS)Nr$zX-Peer: rrz)�
splitlines�
isinstancer�rO�encoder)rrJr�Z	inheaders�linesr�Z
peerheaderrrr�_print_message_content�s

z&DebuggingServer._print_message_contentcKsXtd�|r@|�d�r&td|d�|�d�r@td|d�|�||�td�dS)Nz%---------- MESSAGE FOLLOWS ----------r�zmail options: %sr�zrcpt options: %s
z%------------ END MESSAGE ------------)r�getr�r�rrrr��s

zDebuggingServer.process_messageN)rrrr�r�rrrrr�scs,eZdZ�fdd�Zdd�Zdd�Z�ZS)rcs.d|kr|drtd��tt|�j||�dS)Nr<z$PureProxy does not support SMTPUTF8.�r*�superrr7�rrMr��r�rrr7�szPureProxy.__init__c	Csf|�d�}d}|D]}|sq(|d7}q|�|d|d�t�|�}|�|||�}td|td�dS)Nrrr$z
X-Peer: %szwe got some refusals:r)r��insertrAr��_deliverrrP)	rrJrWrXr�r�r�r��refusedrrrr��s


zPureProxy.process_messagec
Cs�ddl}i}zB|��}|�|jd|jd�z|�|||�}W5|��XWn�|jk
r�}ztdtd�|j	}W5d}~XYnft
|jfk
r�}zBtd|jtd�t
|dd�}t
|dd	�}	|D]}
||	f||
<q�W5d}~XYnX|S)
Nrr$zgot SMTPRecipientsRefusedrZgotZ	smtp_code���Z
smtp_error�ignore)�smtplibZSMTPZconnectr��quitZsendmailZSMTPRecipientsRefusedrrPZ
recipientsrKZ
SMTPExceptionr�r�)rrWrXr�r�r��s�eZerrcode�errmsg�rrrrr��s$ zPureProxy._deliver)rrrr7r�r��
__classcell__rrr�rr�scs$eZdZ�fdd�Zdd�Z�ZS)r	cs.d|kr|drtd��tt|�j||�dS)Nr<z'MailmanProxy does not support SMTPUTF8.r�r�r�rrr7
szMailmanProxy.__init__cCs*ddlm}ddlm}ddlm}ddlm}g}	|D]t}
|
���d�d}|�d�}t|�dkrfq8|d}
t|�dkr�|d	}nd
}|�	|
�r8|dkr�q8|	�
|
|
|f�q8|	D]\}
}
}|�|
�q�tdd
�
|�td�|r�|�|||�}td|td�i}||�}|�|�}|�d��s&||d<|�d��sDt�t���|d<|	D]�\}
}
}td|
td�|�|
�}|�s�|j|
dd�}|||
<|d
k�r�|j|d	d�n�|dk�r�|j|d	d�nh|dk�r�|j|d	d�nN|dk�r�|j|d	d�n4|dk�rH|dk�rd|d <nd!|d <|j|d	d��qHdS)"Nr)�StringIO)�Utils)�Message)�MailList�@�-r`r$r)r�admin�owner�requestr��leavezforwarding recips:r�rzwe got refusals:�fromZFrom�dateZDatezsending message to)�lock)�tolistr�)Ztoadminr�)Ztoownerr�)Z	torequest)r�r�r�Z	subscribeZSubjectZunsubscribe)�ior�ZMailmanr�r�r��lowerr�r~Zlist_existsr�removerr�rPr�r�r�r�ZEnqueue)rrJrWrXr�r�r�r�r�Z	listnamesZrcptZlocal�partsZlistnamer�r�Zmlistsr�rZmlistrrrr�sb










zMailmanProxy.process_message)rrrr7r�r�rrr�rr	sc@seZdZdZdZdZdZdS)�OptionsTrNF)rrr�setuid�	classname�
size_limitr<rrrrr�_sr�c
Cspz.t�tjdd�dddddddd	g�\}}Wn.tjk
r\}ztd|�W5d}~XYnXt�}|D]�\}}|d
kr�td�qh|dkr�tt�t�d�qh|d
kr�d|_	qh|dkr�||_
qh|dkr�tjaqh|dkr�d|_
qh|dkrhzt|�}||_Wqhtd|tjd�t�d�YqhXqht|�dk�r<d}d}nPt|�dk�rX|d}d}n4t|�dk�rx|d}|d}ntddt�|��|�d�}	|	dk�r�tdd|�|d|	�|_zt||	dd��|_Wn$tk
�r�tdd|�YnX|�d�}	|	dk�rtdd|�|d|	�|_zt||	dd��|_Wn$tk
�rjtdd|�YnX|S) Nr$z	nVhc:s:duzclass=Znosetuid�version�helpzsize=�debugr�)z-hz--helpr)z-Vz	--version)z-nz
--nosetuidF)z-cz--class)z-dz--debug)z-uz
--smtputf8T)z-sz--sizezInvalid size: rzlocalhost:8025zlocalhost:25r`�zInvalid arguments: %s�:zBad local spec: %szBad local port: %szBad remote spec: %szBad remote port: %s)�getoptr�argv�errorr#r�rrRr!r�r�r rPr<r�r�r~�
COMMASPACEr�r��	localhost�	localportr*�
remotehost�
remoteport)
ZoptsrMr��options�optr�Zint_sizeZ	localspecZ
remotespecr�rrr�	parseargsfsv��






r�__main__r1r$)r<z7Cannot import module "pwd"; try running with -n option.r�nobodyr`z3Cannot setuid "nobody"; try running with -n option.)r)?r�osrNrr�rHr�r5r��warningsrZemail._header_value_parserrr�__all__rZprogramrRr
rPrArr�r#r6rr�rrrr	r�rrrr��rfindZlastdot�
__import__r�locals�modrr�Zclass_rr	r
rr�r<�proxyr��pwd�ImportErrorrr r!�getpwnamr�PermissionErrorZloop�KeyboardInterruptrrrr�<module>Ps��

M-SB




�linecache.cpython-38.opt-2.pyc000064400000005314151450073350012055 0ustar00U

e5d��@sjddlZddlZddlZddlZdddgZddd�Ziadd�Zddd�Zdd	d�Z	dd
d�Z
dd
�ZdS)�N�getline�
clearcache�
checkcachecCs:t||�}d|kr"t|�kr2nn||dSdSdS)N��)�getlines�len)�filename�lineno�module_globals�lines�r
�!/usr/lib64/python3.8/linecache.pyrs
cCsiadS)N)�cacher
r
r
rrscCsX|tkr(t|}t|�dkr(t|dSzt||�WStk
rRt�gYSXdS)Nr�)rr�updatecache�MemoryErrorr)r	r�entryr
r
rr%src	Cs�|dkrtt���}n|tkr&|g}ndS|D]�}t|}t|�dkrHq.|\}}}}|dkr^q.zt�|�}Wn$tk
r�t�|d�Yq.YnX||jks�||j	kr.t�|d�q.dS)Nr)
�listr�keysr�os�stat�OSError�pop�st_size�st_mtime)r	�	filenamesr�size�mtimer�fullnamerr
r
rr5s&
c
Cs�|tkr$tt|�dkr$t�|d�|r<|�d�r@|�d�r@gS|}zt�|�}W�ntk
�rn|}t||�r�zt|d�}Wnt	tfk
r�YnDX|dkr�gYSt|�ddd�|�
�D�|ft|<t|dYStj�|�r�gYSt
jD]d}ztj�||�}Wnttfk
�r0Yq�YnXzt�|�}W�qjWq�tk
�r^Yq�Xq�gYSYnXz"t�|��}|��}W5QRXWntk
�r�gYSX|�r�|d�d	��s�|dd	7<|j|j}	}
|	|
||ft|<|S)
Nr�<�>rcSsg|]}|d�qS)�
r
)�.0�liner
r
r�
<listcomp>qszupdatecache.<locals>.<listcomp>r���r")rrr�
startswith�endswithrrr�	lazycache�ImportError�
splitlines�path�isabs�sys�join�	TypeError�AttributeError�tokenize�open�	readlinesrr)r	rrr�basename�data�dirname�fprrrr
r
rrRs\
�



rcCs�|tkr tt|�dkrdSdS|r8|�d�r<|�d�r<dS|r�d|kr�|�d�}|d}t|dd�}|r�|r�t�||�}|ft|<dSdS)	NrTFr r!�
__loader__�__name__�
get_source)rrr'r(�get�getattr�	functools�partial)r	r�name�loaderr;�	get_linesr
r
rr)�s


r))N)N)N)N)r>r.rr2�__all__rrrrrrr)r
r
r
r�<module>s




Atyping.cpython-38.pyc000064400000171726151450073350010527 0ustar00U

e5db
�G@s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddlm
Z
mZmZddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKgGZd�dMdN�ZdOdP�ZdQdR�ZdSdT�ZdUdV�ZdWdX�ZgZdYdZ�Zd[d\�ZGd]d^�d^�ZGd_d`�d`�ZGdadb�dbeedLdc�Zedddde�ZedGdfde�Zeddgde�Zeddhde�Z eddide�Z!eddjde�Z"eddkde�Z#Gdld	�d	edLdc�Z$Gdmd�deedLdc�Z%d7dd5d9d:d4d6dddn�	Z&dodp�Z'Gdqdr�dredLdc�Z(Gdsdt�dte(dLdc�Z)Gdud
�d
�Z*Gdvdw�dw�Z+Gdxdy�dy�Z,dzd{d|d}d~gZ-dd�d�d�d�d�d�d�d�d�g
Z.e-e.d�gZ/d�d��Z0d�d��Z1d�d��Z2d�d��Z3dd#ddd%dd!dd'd*g
d�d�gd��Z4Gd�d��d�e�Z5Gd�d
�d
e*e5d��Z6d�dI�Z7d�d?�Z8d�d��Z9ej:ej;ej<ej=e
eefZ>d�d�dC�Z?d�dB�Z@d�dA�ZAd�dE�ZBd�dF�ZCd�d��ZDd�dH�ZEd�d@�ZFe%d��ZGe%d��ZHe%d��ZIe%d�dLd��ZJe%d�dLd��ZKe%d�dLd��ZLe%d�dLd��ZMe%d�dLeNd��ZOe%d>ePeQ�ZRd�d�d��ZSeSejjTd��ZTeSejjUeJ�ZUeSejjVeJeMeKf�ZVeSejjWeJ�ZWeSejjXeJ�ZXeSejjYeJ�ZYeSejjZeJ�ZZeSejj[eJ�Z[eSejj\d��Z\eSejj]eJ�Z]eSejj^eJ�Z^e)ejj_d�dLd��Z_d�e__eSejj`eJ�ZaeSejjbeG�ZbeSejjceHeLf�ZceSejjdeHeIf�ZdeSejjeeJ�ZeeSejjfeG�ZfeSejjgd��Zge)ehd�d�dLd��Zid�ei_eSejeGd�d��ZkeSejleG�ZmeSeneGd�d��Z`eSeoeJd�d��ZpeSejjqeJ�ZqeSejjreH�ZreSejjseHeLf�ZseSejjteL�ZteSejueJ�ZveSejweJ�ZxeSeyeHeIfd�d��ZzeSej{eHeIf�Z|eSej}eHeIf�Z}eSej~eG�Z~eSejeHeIf�ZeSejj�eJeMeKf�Z�eSejj�eJeMf�Z�eSeNeOd�d��Z�d�e�_e7Gd�d0�d0e6��Z�e7Gd�d.�d.e6��Z�e7Gd�d-�d-e6��Z�e7Gd�d,�d,e6��Z�e7Gd�d/�d/e6��Z�e7Gd�d+�d+e6eJ��Z�e7Gd�d1�d1e6eJ��Z�d�dÄZ�d�Z�d�Z�Gd�dDŽd�eN�Z�Gd�d;�d;e�d��Z�d�dʄZ�d�dLd˜d�d̈́Z�d�dτZ�Gd�dфd�eN�Z�Gd�d<�d<eye�d��Z�d�dD�Z�eQZ�d�Z�Gd�dՄd�e*eR�Z�Gd�dׄd�e�eP�Z�Gd�dلd�e�eQ�Z�Gd�dۄdۃZ�e�d�e�_�e�ej�e�j�<eSe
j�eR�Z�eSe
j�eR�Z�Gd�dބdރZ	e�d�e	_�e	ej�e	j�<dS)�a=
The typing module: Support for gradual typing as defined by PEP 484.

At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its instances (special forms): Any, NoReturn, ClassVar, Union, Optional
* Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar
* The core of internal generics API: _GenericAlias and _VariadicGenericAlias, the latter is
  currently only used by Tuple and Callable. All subscripted types like X[int], Union[int, str],
  etc., are instances of either of these classes.
* The public counterpart of the generics API consists of two classes: Generic and Protocol.
* Public helper functions: get_type_hints, overload, cast, no_type_check,
  no_type_check_decorator.
* Generic aliases for collections.abc ABCs and few additional protocols.
* Special types: NewType, NamedTuple, TypedDict.
* Wrapper submodules for re and io related types.
�)�abstractmethod�ABCMetaN)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�Any�Callable�ClassVar�Final�
ForwardRef�Generic�Literal�Optional�Protocol�Tuple�Type�TypeVar�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�AnyStr�cast�final�get_args�
get_origin�get_type_hints�NewType�
no_type_check�no_type_check_decorator�NoReturn�overload�runtime_checkable�Text�
TYPE_CHECKINGTcCs�ttf}|r|ttf}|dkr(td�St|t�r:t|�St|t�r\|j	|kr\t
|�d���t|t�rr|tt
fks~|ttfkr�t
d|�d���t|tttf�r�|St|�s�t
|�d|d�d���|S)a�Check that the argument is a type, and return it (internal helper).

    As a special case, accept None and return type(None) instead. Also wrap strings
    into ForwardRef instances. Consider several corner cases, for example plain
    special forms like Union are not valid, while Union[int, str] is OK, etc.
    The msg argument is a human-readable error message, e.g::

        "Union[arg, ...]: arg should be a type."

    We append the repr() of the actual value (truncated to 100 chars).
    Nz is not valid as type argumentzPlain z Got z.100�.)rrr	r
�type�
isinstance�strr�
_GenericAlias�
__origin__�	TypeError�_SpecialFormrrIr�callable)�arg�msg�is_argumentZinvalid_generic_forms�rZ�/usr/lib64/python3.8/typing.py�_type_checkxs(

�
�r\cCsRt|t�r,|jdkr|jS|j�d|j��S|dkr8dSt|tj�rJ|jSt|�S)a;Return the repr() of an object, special-casing types (internal helper).

    If obj is a type, we return a shorter version than the default
    type.__repr__, based on the module and qualified name, which is
    typically enough to uniquely identify a type.  For everything
    else, we fall back on repr(obj).
    �builtinsrN.z...)rPrO�
__module__�__qualname__�types�FunctionType�__name__�repr)�objrZrZr[�
_type_repr�s

recs\g�|D]J}t|t�r(|�kr(��|�t|t�r|js���fdd�|jD��qt��S)z�Collect all type variable contained in types in order of
    first appearance (lexicographic order). For example::

        _collect_type_vars((T, List[S, T])) == (T, S)
    csg|]}|�kr|�qSrZrZ��.0�t��tvarsrZr[�
<listcomp>�sz&_collect_type_vars.<locals>.<listcomp>)rPr�appendrR�_special�extend�__parameters__�tuple)r`rhrZrir[�_collect_type_vars�s
rqcCs�t|t�s|St|j�}t|j�D]J\}}t|t�r\t|�D]\}}||kr<||||<q<q"t|||�||<q"|jtkr�tt	|�S|�
t	|��S)zjSubstitute type variables 'tvars' with substitutions 'subs'.
    These two must have the same length.
    )rPrR�list�__args__�	enumerater�_subs_tvarsrSrrp�	copy_with)�tprjZsubsZnew_args�arW�iZtvarrZrZr[ru�s



ruc	Cs^|jst|�d���t|�}t|j�}||krZtd||kr>dnd�d|�d|�d|����dS)	z�Check correct count for parameters of a generic cls (internal helper).
    This gives a nice error message in case of count mismatch.
    z is not a generic classzToo ZmanyZfewz parameters for z	; actual z, expected N)rorT�len)�cls�
parametersZalenZelenrZrZr[�_check_generic�s
r}cCs�g}|D]f}t|t�r.|jtkr.|�|j�qt|t�rdt|�dkrd|dtkrd|�|dd��q|�|�qt	|�}t|�t|�kr�g}|D] }||kr�|�|�|�
|�q�|}|r�t|��t|�S)zyAn internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
    r�N)rPrRrSrrnrsrprzrl�set�remove�AssertionError)r|�params�pZ
all_paramsZ
new_paramsrhrZrZr[�_remove_dups_flatten�s""
r�cs4t�����t��j�t�����fdd��}|S)zInternal wrapper caching __getitem__ of generic types with a fallback to
    original function for non-hashable arguments.
    cs,z�||�WStk
r YnX�||�S�N�rT��args�kwds��cached�funcrZr[�inner�s
z_tp_cache.<locals>.inner)�	functools�	lru_cache�	_cleanupsrl�cache_clear�wraps)r�r�rZr�r[�	_tp_cache�s
r�csbt|t�r|����St|t�r^t��fdd�|jD��}||jkrH|S|�|�}|j|_|S|S)z�Evaluate all forward references in the given type t.
    For use of globalns and localns see the docstring for get_type_hints().
    c3s|]}t|���VqdSr�)�
_eval_type�rgrx��globalns�localnsrZr[�	<genexpr>sz_eval_type.<locals>.<genexpr>)rPr�	_evaluaterRrprsrvrm)rhr�r�Zev_args�resrZr�r[r�	s



r�c@seZdZdZdZdd�ZdS)�_FinalzMixin to prohibit subclassing)�__weakref__cOsd|krtd��dS)N�_rootz&Cannot subclass special typing classesr���selfr�r�rZrZr[�__init_subclass__sz_Final.__init_subclass__N)rbr^r_�__doc__�	__slots__r�rZrZrZr[r�sr�c@s eZdZdZdd�Zdd�ZdS)�
_Immutablez3Mixin to indicate that object should not be copied.cCs|Sr�rZ�r�rZrZr[�__copy__%sz_Immutable.__copy__cCs|Sr�rZ)r�ZmemorZrZr[�__deepcopy__(sz_Immutable.__deepcopy__N)rbr^r_r�r�r�rZrZrZr[r�"sr�cspeZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
edd��Z�ZS)rUzhInternal indicator of special typing constructs.
    See _doc instance attribute for specific docs.
    ��_nameZ_doccsBt|�dkr6t|dt�r6t|dt�r6td|����t��|�S)z�Constructor.

        This only exists to give a better error message in case
        someone tries to subclass a special typing object (not a good idea).
        �rr~zCannot subclass )rzrPrQrprT�super�__new__)r{r�r���	__class__rZr[r�3s��z_SpecialForm.__new__cCs||_||_dSr�r�)r��name�docrZrZr[�__init__@sz_SpecialForm.__init__cCst|t�stS|j|jkSr�)rPrU�NotImplementedr��r��otherrZrZr[�__eq__Ds
z_SpecialForm.__eq__cCst|jf�Sr�)�hashr�r�rZrZr[�__hash__Isz_SpecialForm.__hash__cCs
d|jS)N�typing.�r�r�rZrZr[�__repr__Lsz_SpecialForm.__repr__cCs|jSr�r�r�rZrZr[�
__reduce__Osz_SpecialForm.__reduce__cOstd|����dS)NzCannot instantiate r�r�rZrZr[�__call__Rsz_SpecialForm.__call__cCst|�d���dS)Nz! cannot be used with isinstance()r��r�rdrZrZr[�__instancecheck__Usz_SpecialForm.__instancecheck__cCst|�d���dS)Nz! cannot be used with issubclass()r��r�r{rZrZr[�__subclasscheck__Xsz_SpecialForm.__subclasscheck__cs�|jdkr(t||j�d��}t||f�S|jdkr�|dkrBtd��t|t�sR|f}d�t�fdd�|D��}t|�}t|�d	kr�|d
St||�S|jdkr�t|d�}t|t	d�fS|jd
kr�t||�St|�d���dS)N)r	r
z accepts only single type.rrZz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3s|]}t|��VqdSr��r\�rgr��rXrZr[r�fsz+_SpecialForm.__getitem__.<locals>.<genexpr>r~rrz#Optional[t] requires a single type.r
z is not subscriptable)
r�r\rRrTrPrpr�rzrrO)r�r|�itemrWrZr�r[�__getitem__[s(







z_SpecialForm.__getitem__)rbr^r_r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rZrZr�r[rU,s
rU)r�a`Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    )r�aSpecial type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    a3Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    a'Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    zEOptional type.

    Optional[X] is equivalent to Union[X, None].
    a�Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

   Literal[...] cannot be subclassed. At runtime, an arbitrary value
   is allowed as type argument to Literal[...], but type checkers may
   impose restrictions.
    c@s>eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rz-Internal wrapper to hold a forward reference.)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__TcCsnt|t�std|����zt|dd�}Wn"tk
rJtd|����YnX||_||_d|_d|_||_	dS)Nz*Forward reference must be a string -- got z<string>�evalz/Forward reference must be an expression -- got F)
rPrQrT�compile�SyntaxErrorr�r�r�r�r�)r�rWrY�coderZrZr[r��s
zForwardRef.__init__cCsj|jr||k	rd|dkr(|dkr(i}}n|dkr6|}n|dkrB|}tt|j||�d|jd�|_d|_|jS)Nz*Forward references must evaluate to types.�rYT)r�r\r�r�r�r�)r�r�r�rZrZr[r��s
�zForwardRef._evaluatecCs>t|t�stS|jr2|jr2|j|jko0|j|jkS|j|jkSr�)rPrr�r�r�r�r�rZrZr[r�s

�zForwardRef.__eq__cCs
t|j�Sr�)r�r�r�rZrZr[r�szForwardRef.__hash__cCsd|j�d�S)NzForwardRef(�))r�r�rZrZr[r�szForwardRef.__repr__N)T)
rbr^r_r�r�r�r�r�r�r�rZrZrZr[r�s

c@s6eZdZdZdZdddd�dd�Zdd	�Zd
d�ZdS)ra�Type variable.

    Usage::

      T = TypeVar('T')  # Can be anything
      A = TypeVar('A', str, bytes)  # Must be str or bytes

    Type variables exist primarily for the benefit of static type
    checkers.  They serve as the parameters for generic types as well
    as for generic function definitions.  See class Generic for more
    information on generic types.  Generic functions work as follows:

      def repeat(x: T, n: int) -> List[T]:
          '''Return a list containing n references to x.'''
          return [x]*n

      def longest(x: A, y: A) -> A:
          '''Return the longest of two strings.'''
          return x if len(x) >= len(y) else y

    The latter example's signature is essentially the overloading
    of (str, str) -> str and (bytes, bytes) -> bytes.  Also note
    that if the arguments are instances of some subclass of str,
    the return type is still plain str.

    At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.

    Type variables defined with covariant=True or contravariant=True
    can be used to declare covariant or contravariant generic types.
    See PEP 484 for more details. By default generic types are invariant
    in all type variables.

    Type variables can be introspected. e.g.:

      T.__name__ == 'T'
      T.__constraints__ == ()
      T.__covariant__ == False
      T.__contravariant__ = False
      A.__constraints__ == (str, bytes)

    Note that only type variables defined in global scope can be pickled.
    )rb�	__bound__�__constraints__�
__covariant__�__contravariant__NF)�bound�	covariant�
contravariantc	s�||_|r|rtd��t|�|_t|�|_|r>|dk	r>td��|rVt|�dkrVtd��d�t�fdd�|D��|_|r�t	|d�|_
nd|_
zt�d�j
�d	d
�}Wnttfk
r�d}YnX|dkr�||_dS)Nz"Bivariant types are not supported.z-Constraints cannot be combined with bound=...r~z"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|��VqdSr�r�rfr�rZr[r�Vsz#TypeVar.__init__.<locals>.<genexpr>zBound must be a type.rb�__main__�typing)rb�
ValueError�boolr�r�rTrzrpr�r\r��sys�	_getframe�	f_globals�get�AttributeErrorr^)r�r�r�r�r�ZconstraintsZdef_modrZr�r[r�Js(


zTypeVar.__init__cCs&|jrd}n|jrd}nd}||jS)N�+�-�~)r�r�rb)r��prefixrZrZr[r�bszTypeVar.__repr__cCs|jSr�)rbr�rZrZr[r�kszTypeVar.__reduce__)rbr^r_r�r�r�r�r�rZrZrZr[rs+�	)	rrrp�dictr�	frozenset�deque�defaultdictrOr;cCs|�d�o|�d�S)N�__)�
startswith�endswith)�attrrZrZr[�
_is_dunder�sr�cs�eZdZdZdddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Zdd�Z�ZS) rRa�The central part of internal API.

    This represents a generic version of type 'origin' with type arguments 'params'.
    There are two kind of these aliases: user defined and special. The special ones
    are wrappers around builtin collections and ABCs in collections.abc. These must
    have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
    this is used by e.g. typing.List and typing.Dict.
    TFN)�inst�specialr�cCsz||_||_|r*|dkr*|j}t�||�}||_t|t�s@|f}||_tdd�|D��|_	t
|�|_d|_|sv|j
|_
dS)Ncss*|]"}|tkrdn|tkrdn|VqdS).rZN)�_TypingEllipsis�_TypingEmptyr�rZrZr[r��s�z)_GenericAlias.__init__.<locals>.<genexpr>)�_instrmrb�_normalize_aliasr�r�rPrprSrsrqror�r^)r��originr�r�r�r�Z	orig_namerZrZr[r��s 
�

z_GenericAlias.__init__cs^|jttfkrtd|����t|t�s,|f}d�t�fdd�|D��}t||�t||j|�S)Nz%Cannot subscript already-subscripted �*Parameters to generic types must be types.c3s|]}t|��VqdSr�r�r�r�rZr[r��sz,_GenericAlias.__getitem__.<locals>.<genexpr>)	rSrrrTrPrpr}ruro�r�r�rZr�r[r��s

z_GenericAlias.__getitem__cCst|j||j|jd�S)N)r�r�)rRrSr�r�r�rZrZr[rv�sz_GenericAlias.copy_withcCs�|jdks&t|j�dkrx|jdtkrx|jr8d|j}n
t|j�}|jshdd�dd�|jD���d	�}nd
}|�|��S|jr�dSdd�d
d�|jdd�D���dt|jd��d	�S)Nr�rr��[�, cSsg|]}t|��qSrZ�rer�rZrZr[rk�sz*_GenericAlias.__repr__.<locals>.<listcomp>�]�ztyping.Callableztyping.Callable[[cSsg|]}t|��qSrZr�r�rZrZr[rk�s���z], )r�rzrs�EllipsisrerSrm�join)r�r�r�rZrZr[r��s
��
 z_GenericAlias.__repr__cCsRt|t�stS|j|jkrdS|jtkrF|jtkrFt|j�t|j�kS|j|jkS)NF)rPrRr�rSrr�rsr�rZrZr[r��s
z_GenericAlias.__eq__cCs,|jtkrttt|j�f�St|j|jf�Sr�)rSrr�r�rsr�rZrZr[r��s
z_GenericAlias.__hash__cOsT|js$td|j�d|j���d���|j||�}z
||_Wntk
rNYnX|S)N�Type z cannot be instantiated; use z
() instead)r�rTr��lowerrS�__orig_class__r�)r�r��kwargs�resultrZrZr[r��s
z_GenericAlias.__call__cCs�|jrZg}|j|kr |�|j�|�|�}tdd�||dd�D��sR|�t�t|�S|jtkr�t|krpdS|�|�}||dd�D]}t|t	�r�||k	r�dSq�|jfS)Ncss"|]}t|t�pt|t�VqdSr�)rPrR�
issubclassr�rg�brZrZr[r��s�z0_GenericAlias.__mro_entries__.<locals>.<genexpr>r~rZ)
r�rSrl�index�anyrrprrPrR)r��basesr�ryrrZrZr[�__mro_entries__�s$

�


z_GenericAlias.__mro_entries__cCs*d|jkrt|�st|j|�St|��dS)NrS)�__dict__r��getattrrSr�)r�r�rZrZr[�__getattr__�sz_GenericAlias.__getattr__cs2t|�s|dkr t��||�nt|j||�dS)N)r�r�rm)r�r��__setattr__�setattrrS)r�r��valr�rZr[r�sz_GenericAlias.__setattr__cCs|�t|��Sr�)r�rOr�rZrZr[r�sz_GenericAlias.__instancecheck__cCs<|jr0t|t�st||j�S|jr0t|j|j�Std��dS)NzBSubscripted generics cannot be used with class and instance checks)rmrPrRrrSrTr�rZrZr[r�s
z_GenericAlias.__subclasscheck__cCs�|jr|jS|jr t�|j}n|j}|tkrht|j�dkrJ|jdtksht|jdd��|jdf}n*t	|j�}t|�dkr�t
|dt	�s�|\}tj||ffS)Nr�rr�r~)
rmr��globalsrSrrzrsr�rrrprP�operator�getitem)r�r�r�rZrZr[r�s��
z_GenericAlias.__reduce__)rbr^r_r�r�r�r�rvr�r�r�r�rrrr�r�r�r�rZrZr�r[rR�s
		rRcs,eZdZdZdd�Ze�fdd��Z�ZS)�_VariadicGenericAliasz�Same as _GenericAlias above but for variadic aliases. Currently,
    this is used only by special internal aliases: Tuple and Callable.
    cCs�|jdks|js|�|�St|t�r0t|�dkr8td��|\}}|tkrRt|f}n$t|t�sjtd|����t|�|f}|�|�S)Nrr�z6Callable must be used as Callable[[arg, ...], result].z1Callable[args, result]: args must be a list. Got )	r�rm�__getitem_inner__rPrprzrTr�rr)r�r�r�rrZrZr[r�"s


z!_VariadicGenericAlias.__getitem__cs
|jtkr�|jr�|dkr$|�tf�St|t�s4|f}t|�dkrl|ddkrld�t|d��}|�|tf�Sd�t�fdd	�|D��}|�|�S|jt	j
jkr�|jr�|\}}d
�t|��}|tkr�|�t|f�Sd�t�fdd	�|D��}||f}|�|�St
��|�S)
NrZr�r~.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|��VqdSr�r�r�r�rZr[r�>sz:_VariadicGenericAlias.__getitem_inner__.<locals>.<genexpr>z.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|��VqdSr�r�)rgrWr�rZr[r�Gs)rSrprmrvr�rPrzr\r��collections�abcrr�r�r�)r�r�r�r�rr�r�r[r2s.




z'_VariadicGenericAlias.__getitem_inner__)rbr^r_r�r�r�rr�rZrZr�r[rsrcs@eZdZdZdZdZ�fdd�Zedd��Z�fdd	�Z	�Z
S)
raCAbstract base class for generic types.

    A generic type is typically declared by inheriting from
    this class parameterized with one or more type variables.
    For example, a generic mapping type might be defined as::

      class Mapping(Generic[KT, VT]):
          def __getitem__(self, key: KT) -> VT:
              ...
          # Etc.

    This class can then be used as follows::

      def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
          try:
              return mapping[key]
          except KeyError:
              return default
    rZFcs^|ttfkrtd|j�d���t�jtjkrF|jtjk	rFt��|�}nt�j|f|�|�}|S)Nrz< cannot be instantiated; it can be used only as a base class)rrrTrbr�r��objectr�)r{r�r�rdr�rZr[r�dszGeneric.__new__cs�t|t�s|f}|s.|tk	r.td|j�d���d�t�fdd�|D��}|ttfkr�tdd�|D��sxtd|j�d���t	t
|��t	|�kr�td|j�d	���n
t||�t||�S)
NzParameter list to z[...] cannot be emptyr�c3s|]}t|��VqdSr�r�r�r�rZr[r�vsz,Generic.__class_getitem__.<locals>.<genexpr>css|]}t|t�VqdSr�)rPrr�rZrZr[r�yszParameters to z [...] must all be type variablesz[...] must all be unique)
rPrprrTr_rr�allrbrzrr}rR)r{r�rZr�r[�__class_getitem__ns&
���
zGeneric.__class_getitem__c
s
t�j||�g}d|jkr(t|jk}nt|jko:|jdk}|rHtd��d|jkr�t|j�}d}|jD].}t	|t
�rf|jtkrf|dk	r�td��|j}qf|dk	r�t
|�}t
|��|�ks�d��fdd�|D��}d�dd�|D��}	td	|�d
|	�d���|}t|�|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.r�c3s|]}|�krt|�VqdSr��rQrf�ZgvarsetrZr[r��sz,Generic.__init_subclass__.<locals>.<genexpr>css|]}t|�VqdSr�r)rg�grZrZr[r��szSome type variables (z) are not listed in Generic[r�)r�r�r
rr�	__bases__rbrTrqrPrRrSrorrrp)
r{r�rrj�errorZgvars�baseZtvarsetZs_varsZs_argsr�rr[r��s8




��zGeneric.__init_subclass__)rbr^r_r�r��_is_protocolr�r�rr�r�rZrZr�r[rMs

c@seZdZdZdS)r�z�Internal placeholder for () or []. Used by TupleMeta and CallableMeta
    to allow empty list/tuple in specific places, without allowing them
    to sneak in where prohibited.
    N�rbr^r_r�rZrZrZr[r��sr�c@seZdZdZdS)r�z(Internal placeholder for ... (ellipsis).Nr%rZrZrZr[r��sr�rorrr$�_is_runtime_protocol�__abstractmethods__�__annotations__r
r�r�r^r�r��__subclasshook__r��_MutableMapping__markercCsrt�}|jdd�D]X}|jdkr$qt|di�}t|j���t|���D] }|�d�sJ|tkrJ|�	|�qJq|S)z�Collect protocol members from a protocol class objects.

    This includes names actually defined in the class dictionary, as well
    as names that appear in annotations. Special names (above) are skipped.
    Nr�)rrr(Z_abc_)
r�__mro__rbrrrr
�keysr��EXCLUDED_ATTRIBUTES�add)r{�attrsr#�annotationsr�rZrZr[�_get_protocol_attrs�s
r1cst�fdd�t��D��S)Nc3s|]}tt�|d��VqdSr�)rVr�rgr��r{rZr[r��sz,_is_callable_members_only.<locals>.<genexpr>)rr1r3rZr3r[�_is_callable_members_only�sr4cOst|�jrtd��dS)Nz Protocols cannot be instantiated)rOr$rT)r�r�rrZrZr[�_no_init�s
r5c	Cs6zt�d�jddkWSttfk
r0YdSXdS)z�Allow instnance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    r�rb)rr�TN)r�r�r�r�r�rZrZrZr[�_allow_reckless_class_cheks�sr6�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibcseZdZ�fdd�Z�ZS)�
_ProtocolMetacsVt�dd�rt��r$t�j��r$dS�jrJt��fdd�t��D��rJdSt����S)Nr$FTc3s8|]0}t�|�o.tt�|d��p.t�|�dk	VqdSr�)�hasattrrVrr2�r{�instancerZr[r��s�
z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)	rr4rr�r$rr1r�r�r<r�r<r[r��s�
��z_ProtocolMeta.__instancecheck__)rbr^r_r�r�rZrZr�r[r:�sr:cs,eZdZdZdZdZdZ�fdd�Z�ZS)raZBase class for protocol classes.

    Protocol classes are defined as::

        class Proto(Protocol):
            def meth(self) -> int:
                ...

    Such classes are primarily used with static type checkers that recognize
    structural subtyping (static duck-typing), for example::

        class C:
            def meth(self) -> int:
                return 0

        def func(x: Proto) -> int:
            return x.meth()

        func(C())  # Passes static type check

    See PEP 544 for details. Protocol classes decorated with
    @typing.runtime_checkable act as simple-minded runtime protocols that check
    only the presence of given attributes, ignoring their type signatures.
    Protocol classes can be generic, they are defined as::

        class GenProto(Protocol[T]):
            def meth(self) -> T:
                ...
    rZTFcs�t�j||��j�dd�s2tdd��jD���_�fdd�}d�jkrN|�_�jsXdS�jD]F}|tt	fks^|j
tkr�|jt|j
ks^t
|t	�r�|js^td|��q^t�_dS)	Nr$Fcss|]}|tkVqdSr�)rrrZrZr[r�)sz-Protocol.__init_subclass__.<locals>.<genexpr>cs��j�dd�stSt�dd�s0t�r(tStd��t��sJt�rBtStd��t|t�s\td��t	��D]v}|j
D]b}||jkr�|j|dkr�tSqdt|di�}t|tjj
�rn||krnt|t�rn|jrnqdqntSqddS)	Nr$Fr&zLInstance and class checks can only be used with @runtime_checkable protocolsz<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr(T)r
r�r�rr6rTr4rPrOr1r+rrrrrr$)r�r�r#r0r3rZr[�_proto_hook,s:


���
z/Protocol.__init_subclass__.<locals>._proto_hookr)z7Protocols can only inherit from other protocols, got %r)r�r�r
r�r
r!r$r)rrr^�_PROTO_WHITELISTrbrrTr5r�)r{r�rr>r#r�r3r[r�$s,&

�����zProtocol.__init_subclass__)	rbr^r_r�r�r$r&r�r�rZrZr�r[rs
)�	metaclasscCs&t|t�r|jstd|��d|_|S)a9Mark a protocol class as a runtime protocol.

    Such protocol can be used with isinstance() and issubclass().
    Raise TypeError if applied to a non-protocol class.
    This allows a simple-minded structural check very similar to
    one trick ponies in collections.abc such as Iterable.
    For example::

        @runtime_checkable
        class Closable(Protocol):
            def close(self): ...

        assert isinstance(open('/some/file'), Closable)

    Warning: this will check only the presence of the required methods,
    not their type signatures!
    zB@runtime_checkable can be only applied to protocol classes, got %rT)rrr$rTr&r3rZrZr[rKds�cCs|S)z�Cast a value to a type.

    This returns the value unchanged.  To the type checker this
    signals that the return value has the designated type, but at
    runtime we intentionally don't check anything (we want this
    to be as fast as possible).
    rZ)�typrrZrZr[rA}sc
Cs�z
|j}Wntk
r"iYSX|j}|j}|d|�}|jpDd}|j}|rXt|�ni}|t|�}t||d�|�D]\}}	||ks�t	�|	||<qz|S)z:Internal helper to extract the default arguments, by name.NrZ)
�__code__r��co_argcount�co_varnames�__defaults__�__kwdefaults__r�rz�zipr�)
r�r�Z	pos_countZ	arg_names�defaultsZ
kwdefaultsr�Z
pos_offsetr��valuerZrZr[�
_get_defaults�s



rJcCs�t|dd�riSt|t�r�i}t|j�D]z}|dkrDtj|jj}n|}|j�	di�}|�
�D]B\}}|dkrvtd�}t|t�r�t|dd�}t
|||�}|||<q^q(|S|dkr�t|tj�r�|j}n"|}	t|	d�r�|	j}	q�t|	di�}|dkr�|}n|dk�r|}t|dd�}|dk�r6t|t��r(iStd�|���t|�}
t|�}|�
�D]d\}}|dk�rhtd�}t|t��r|t|�}t
|||�}||
k�r�|
|dk�r�t|}|||<�qN|S)	a�Return type hints for an object.

    This is often the same as obj.__annotations__, but it handles
    forward references encoded as string literals, and if necessary
    adds Optional[t] if a default value equal to None is set.

    The argument may be a module, class, method, or function. The annotations
    are returned as a dictionary. For classes, annotations include also
    inherited members.

    TypeError is raised if the argument is not of a type that can contain
    annotations, and an empty dictionary is returned if no annotations are
    present.

    BEWARE -- the behavior of globalns and localns is counterintuitive
    (unless you are familiar with how eval() and exec() work).  The
    search order is locals first, then globals.

    - If no dict arguments are passed, an attempt is made to use the
      globals from obj (or the respective module's globals for classes),
      and these are also used as the locals.  If the object does not appear
      to have globals, an empty dictionary is used.

    - If one dict argument is passed, it is used for both globals and
      locals.

    - If two dict arguments are passed, they specify globals and
      locals, respectively.
    �__no_type_check__Nr(Fr��__wrapped__�__globals__z1{!r} is not a module, class, method, or function.)rrPrO�reversedr+r��modulesr^r
r��itemsrQrr�r`�
ModuleTyper;rL�_allowed_typesrT�formatrJr�r)rdr�r�Zhintsr#Zbase_globals�annr�rIZnsobjrHrZrZr[rE�s^




�
cCs t|t�r|jS|tkrtSdS)a�Get the unsubscripted version of a type.

    This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar.
    Return None for unsupported types. Examples::

        get_origin(Literal[42]) is Literal
        get_origin(int) is None
        get_origin(ClassVar[int]) is ClassVar
        get_origin(Generic) is Generic
        get_origin(Generic[T]) is Generic
        get_origin(Union[T, int]) is Union
        get_origin(List[Tuple[T, T]][int]) == list
    N)rPrRrSr)rwrZrZr[rD�s

cCsRt|t�rN|jsN|j}t|�tjjkrJ|dtk	rJt	|dd��|df}|SdS)a�Get type arguments with all substitutions performed.

    For unions, basic simplifications used by Union constructor are performed.
    Examples::
        get_args(Dict[str, int]) == (str, int)
        get_args(int) == ()
        get_args(Union[int, Union[T, int], str][int]) == (int, str)
        get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
        get_args(Callable[[], T][int]) == ([], int)
    rNr�rZ)
rPrRrmrsrDrrrr�rr)rwr�rZrZr[rCscCs�t|t�rt|j��}|j��D]"\}}||j|fkr|�|�q|��D](}t|tj	�r`d|_
t|t�rJt|�qJz
d|_
Wntk
r�YnX|S)aIDecorator to indicate that annotations are not type hints.

    The argument must be a class or function; if it is a class, it
    applies recursively to all methods and classes defined in that class
    (but not to methods defined in its superclasses or subclasses).

    This mutates the function(s) or class(es) in place.
    T)
rPrOr
�copyrPr!�pop�valuesr`rarKrGrT)rWZ	arg_attrsr�rrdrZrZr[rGs	




cst����fdd��}|S)z�Decorator to give another decorator the @no_type_check effect.

    This wraps the decorator with something that wraps the decorated
    function in @no_type_check.
    cs�||�}t|�}|Sr�)rG)r�r�r���	decoratorrZr[�wrapped_decorator@s
z2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)rYrZrZrXr[rH9scOstd��dS)z*Helper for @overload to raise when called.z�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.N)�NotImplementedErrorr�rZrZr[�_overload_dummyIs�r\cCstS)a
Decorator for overloaded functions/methods.

    In a stub file, place two or more stub definitions for the same
    function in a row, each decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...

    In a non-stub file (i.e. a regular .py file), do the same but
    follow it with an implementation.  The implementation should *not*
    be decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...
      def utf8(value):
          # implementation goes here
    )r\)r�rZrZr[rJRscCs|S)aVA decorator to indicate final methods and final classes.

    Use this decorator to indicate to type checkers that the decorated
    method cannot be overridden, and decorated class cannot be subclassed.
    For example:

      class Base:
          @final
          def done(self) -> None:
              ...
      class Sub(Base):
          def done(self) -> None:  # Error reported by type checker
                ...

      @final
      class Leaf:
          ...
      class Other(Leaf):  # Error reported by type checker
          ...

    There is no runtime checking of these properties.
    rZ)�frZrZr[rBos�T�KT�VT�T_co)r��V_co�VT_co�T_contra)r��CT_co)r�r�cCst||d|d�S)NT)r�r�)rR)r�r�r�rZrZr[�_alias�srfrZ)r�a�Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    F)r�r�a@Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    )r�a�A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c@s&eZdZdZdZeed�dd��ZdS)r2z(An ABC with one abstract method __int__.rZ��returncCsdSr�rZr�rZrZr[�__int__�szSupportsInt.__int__N)rbr^r_r�r�r�intrirZrZrZr[r2�sc@s&eZdZdZdZeed�dd��ZdS)r0z*An ABC with one abstract method __float__.rZrgcCsdSr�rZr�rZrZr[�	__float__szSupportsFloat.__float__N)rbr^r_r�r�r�floatrkrZrZrZr[r0�sc@s&eZdZdZdZeed�dd��ZdS)r/z,An ABC with one abstract method __complex__.rZrgcCsdSr�rZr�rZrZr[�__complex__
szSupportsComplex.__complex__N)rbr^r_r�r�r�complexrmrZrZrZr[r/sc@s&eZdZdZdZeed�dd��ZdS)r.z*An ABC with one abstract method __bytes__.rZrgcCsdSr�rZr�rZrZr[�	__bytes__szSupportsBytes.__bytes__N)rbr^r_r�r�r�bytesrorZrZrZr[r.sc@s&eZdZdZdZeed�dd��ZdS)r1z*An ABC with one abstract method __index__.rZrgcCsdSr�rZr�rZrZr[�	__index__szSupportsIndex.__index__N)rbr^r_r�r�rrjrqrZrZrZr[r1sc@s&eZdZdZdZeed�dd��ZdS)r-zMAn ABC with one abstract method __abs__ that is covariant in its return type.rZrgcCsdSr�rZr�rZrZr[�__abs__(szSupportsAbs.__abs__N)rbr^r_r�r�rrarrrZrZrZr[r-#sc@s*eZdZdZdZedeed�dd��ZdS)	r3zOAn ABC with one abstract method __round__ that is covariant in its return type.rZr)�ndigitsrhcCsdSr�rZ)r�rsrZrZr[�	__round__2szSupportsRound.__round__N)r)	rbr^r_r�r�rrjrartrZrZrZr[r3-sc	std��fdd�|D�}t�|dd�|D��}t|�|_|_zt�d�j�dd�|_	Wnt
tfk
rnYnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecsg|]\}}|t|��f�qSrZr��rg�nrhr�rZr[rk9sz!_make_nmtuple.<locals>.<listcomp>cSsg|]\}}|�qSrZrZrurZrZr[rk:sr�rbr�)r�
namedtupler�r(�_field_typesr�r�r�r�r^r�r�)r�r`�nm_tplrZr�r[�
_make_nmtuple7srz)r�r�r��__getnewargs__�_fields�_field_defaultsrx�_make�_replace�_asdictZ_source)r^rbr(cseZdZ�fdd�Z�ZS)�NamedTupleMetacs�|�dd�rt��||||�S|�di�}t||���}g}i}|D]H}||krl||}	|�|	�|	||<qD|rDtdj|d�|�	��d���qDt
|�|j_t|�|j_
||_|D]<}
|
tkr�td|
��q�|
tkr�|
|jkr�t||
||
�q�|S)Nr�Fr(zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}r�)�
field_nameZ
default_namesz&Cannot overwrite NamedTuple attribute )r�r�r�rzrPrlrTrSrr,r�r(rprEr}�_prohibitedr�rmr|r)r{�typenamer�nsr`ryrHZ
defaults_dictr�Z
default_value�keyr�rZr[r�Os2

�
zNamedTupleMeta.__new__)rbr^r_r�r�rZrZr�r[r�Msr�c@s"eZdZdZdZdd�Zde_dS)r=a�Typed version of namedtuple.

    Usage in Python versions >= 3.6::

        class Employee(NamedTuple):
            name: str
            id: int

    This is equivalent to::

        Employee = collections.namedtuple('Employee', ['name', 'id'])

    The resulting class has an extra __annotations__ attribute, giving a
    dict that maps field names to types.  (The field names are also in
    the _fields attribute, which is part of the namedtuple API.)
    Alternative equivalent keyword syntax is also accepted::

        Employee = NamedTuple('Employee', name=str, id=int)

    In Python versions <= 3.5 use::

        Employee = NamedTuple('Employee', [('name', str), ('id', int)])
    TcOs�|std��|^}}|r"|^}}n4d|krN|�d�}ddl}|jdtdd�ntd��|r�z
|\}Wq�tk
r�tdt|�d�d	��d�Yq�Xn<d
|kr�t|�dkr�|�d
�}ddl}|jdtdd�nd}|dkr�|��}n|r�td
��t||�S)Nz*NamedTuple.__new__(): not enough argumentsr�rz4Passing 'typename' as keyword argument is deprecatedr�)�
stacklevelzGNamedTuple.__new__() missing 1 required positional argument: 'typename'z@NamedTuple.__new__() takes from 2 to 3 positional arguments but z were given�fieldsr~z2Passing 'fields' as keyword argument is deprecatedzIEither list of fields or keywords can be provided to NamedTuple, not both)	rTrV�warnings�warn�DeprecationWarningr�rzrPrz)r�rr{r�r�r�rZrZr[r��sB

�
�

�
zNamedTuple.__new__z*($cls, typename, fields=None, /, **kwargs)N)rbr^r_r�r�r��__text_signature__rZrZrZr[r=ls#cOs
t||�Sr�)r�)r{r�rrZrZr[�	_dict_new�sr�)�totalc	Ksj|dkr|}n|rtd��t|�|d�}zt�d�j�dd�|d<Wnttfk
r\YnXt|d|�S)Nz@TypedDict takes either a dict or keyword arguments, but not both)r(�	__total__r~rbr�r^rZ)	rTr�r�r�r�r�r�r��_TypedDictMeta)r{r�r�r�rr�rZrZr[�_typeddict_new�sr�cCstd��dS)Nz4TypedDict does not support instance and class checksr�)r{r�rZrZr[�_check_fails�sr�cs&eZdZd�fdd�	ZeZZ�ZS)r�Tcs�|dkrtnt|d<tt|��||tf|�}|�di�}d��fdd�|��D�}|D]}|�|j	�di��qV||_
t|d�s�||_|S)agCreate new typed dict class object.

        This method is called directly when TypedDict is subclassed,
        or via _typeddict_new when TypedDict is instantiated. This way
        TypedDict supports all three syntax forms described in its docstring.
        Subclasses and instances of TypedDict return actual dictionaries
        via _dict_new.
        r>r�r(z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecsi|]\}}|t|���qSrZr�)rgrvrwr�rZr[�
<dictcomp>�sz*_TypedDictMeta.__new__.<locals>.<dictcomp>r�)
r�r�r�r�r�r�r�rP�updater
r(r;r�)r{r�rr�r�Ztp_dictZannsr#r�r�r[r��s	
z_TypedDictMeta.__new__)T)rbr^r_r�r�r�r�r�rZrZr�r[r��sr�c@seZdZdZdS)r>a�A simple typed namespace. At runtime it is equivalent to a plain dict.

    TypedDict creates a dictionary type that expects all of its
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime but is only enforced by type checkers.
    Usage::

        class Point2D(TypedDict):
            x: int
            y: int
            label: str

        a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check

        assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')

    The type info can be accessed via Point2D.__annotations__. TypedDict
    supports two additional equivalent forms::

        Point2D = TypedDict('Point2D', x=int, y=int, label=str)
        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality.
    Usage::

        class point2D(TypedDict, total=False):
            x: int
            y: int

    This means that a point2D TypedDict can have any of the keys omitted.A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.

    The class syntax is only supported in Python 3.6+, while two other
    syntax forms work for Python 2.7 and 3.2+
    Nr%rZrZrZr[r>�scCsdd�}||_||_|S)a%NewType creates simple unique types with almost zero
    runtime overhead. NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy function that simply returns its argument. Usage::

        UserId = NewType('UserId', int)

        def name_by_id(user_id: UserId) -> str:
            ...

        UserId('user')          # Fails type check

        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK

        num = UserId(5) + 1     # type: int
    cSs|Sr�rZ)�xrZrZr[�new_typeszNewType.<locals>.new_type)rbZ
__supertype__)r�rwr�rZrZr[rFsc@s�eZdZdZdZeeed�dd���Zeeed�dd���Z	edd�d	d
��Z
eeed�dd���Zee
d�d
d��Zedd�dd��Zeed�dd��Zed7e
ed�dd��Zeed�dd��Zed8e
ed�dd��Zed9e
eed�dd��Zed:e
e
e
d �d!d"��Zeed�d#d$��Zee
d�d%d&��Zed;e
e
d'�d(d)��Zeed�d*d+��Zeee
d,�d-d.��Zeeedd/�d0d1��Zed2d�d3d4��Zedd�d5d6��ZdS)<�IOa�Generic base class for TextIO and BinaryIO.

    This is an abstract, generic version of the return of open().

    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    rZrgcCsdSr�rZr�rZrZr[�mode=szIO.modecCsdSr�rZr�rZrZr[r�BszIO.nameNcCsdSr�rZr�rZrZr[�closeGszIO.closecCsdSr�rZr�rZrZr[�closedKsz	IO.closedcCsdSr�rZr�rZrZr[�filenoPsz	IO.filenocCsdSr�rZr�rZrZr[�flushTszIO.flushcCsdSr�rZr�rZrZr[�isattyXsz	IO.isattyr�)rvrhcCsdSr�rZ)r�rvrZrZr[�read\szIO.readcCsdSr�rZr�rZrZr[�readable`szIO.readable)�limitrhcCsdSr�rZ)r�r�rZrZr[�readlinedszIO.readline)�hintrhcCsdSr�rZ)r�r�rZrZr[�	readlineshszIO.readlinesr)�offset�whencerhcCsdSr�rZ)r�r�r�rZrZr[�seeklszIO.seekcCsdSr�rZr�rZrZr[�seekablepszIO.seekablecCsdSr�rZr�rZrZr[�telltszIO.tell)�sizerhcCsdSr�rZ)r�r�rZrZr[�truncatexszIO.truncatecCsdSr�rZr�rZrZr[�writable|szIO.writable��srhcCsdSr�rZ�r�r�rZrZr[�write�szIO.write)�linesrhcCsdSr�rZ)r�r�rZrZr[�
writelines�sz
IO.writelinesz
IO[AnyStr]cCsdSr�rZr�rZrZr[�	__enter__�szIO.__enter__cCsdSr�rZ)r�rOrI�	tracebackrZrZr[�__exit__�szIO.__exit__)r�)r�)r�)r)N) rbr^r_r�r��propertyrrQr�r�r�r�r�rjr�r�r�r@r�r�r�r9r�r�r�r�r�r�r�r�r�r�rZrZrZr[r�.sZr�c@sBeZdZdZdZeeeefe	d�dd��Z
edd�dd��Zd	S)
�BinaryIOz5Typed version of the return of open() in binary mode.rZr�cCsdSr�rZr�rZrZr[r��szBinaryIO.writergcCsdSr�rZr�rZrZr[r��szBinaryIO.__enter__N)rbr^r_r�r�rrrp�	bytearrayrjr�r�rZrZrZr[r��sr�c@s�eZdZdZdZeeed�dd���Zeee	d�dd���Z
eeee	d�dd	���Zeee
d�d
d���Zeeed�dd
���Zedd�dd��ZdS)�TextIOz3Typed version of the return of open() in text mode.rZrgcCsdSr�rZr�rZrZr[�buffer�sz
TextIO.buffercCsdSr�rZr�rZrZr[�encoding�szTextIO.encodingcCsdSr�rZr�rZrZr[�errors�sz
TextIO.errorscCsdSr�rZr�rZrZr[�line_buffering�szTextIO.line_bufferingcCsdSr�rZr�rZrZr[�newlines�szTextIO.newlinescCsdSr�rZr�rZrZr[r��szTextIO.__enter__N)rbr^r_r�r�r�rr�r�rQr�rr�r�r�rr�r�rZrZrZr[r��s&r�c@s&eZdZdZdddgZeZeZeZdS)�ioz)Wrapper namespace for IO generic classes.r�r�r�N)rbr^r_r��__all__r�r�r�rZrZrZr[r��s

r�z.ioc@s eZdZdZddgZeZeZdS)�rez&Wrapper namespace for re type aliases.�Pattern�MatchN)rbr^r_r�r�r�r�rZrZrZr[r��sr�z.re)T)NN)T)N)�r�rrrrZcollections.abcr9r�rr�Z	stdlib_rer�r`rrrr�r\rerqrur}r�r�r�r�r�r�rUrrIr	r
rrr
rrr�r�rRrrr�r�Z_TYPING_INTERNALSZ_SPECIAL_NAMESr-r1r4r5r6r?r:rrKrArJra�BuiltinFunctionType�
MethodTyperQrRrErDrCrGrHr\rJrBr^r_r`rarbrcrdrOrerprQr@rfrr%r(r'r&rrr,r#rr)rr;rr!rrr"r rrprrrr9r�r6rr�r<rrrr$r7rr8r+r�r7r�r8r:r5r4r?r*rr2r0r/r.r1r-r3rzr�rmr�r=r�r�r�r�r>rFrLrMr�r�r�r�rbrOr�r�rZrZrZr[�<module>s(�X
!
	
I��
�����2a�
/[����	b�
V	
�
�	�							@+c#	

pstats.cpython-38.pyc000064400000053064151450073350010525 0ustar00U

e5d�j�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddgZ
Gdd�dee�ZGdd�d�Z
Gd	d
�d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedk�r�ddlZzddlZWnek
r�YnXGdd�dej�Zeej�dk�rejdZndZzPee�Zejdd�D]Z e�!e ��q0e"dej#d�e�$�e"d ej#d�Wne%k
�r~YnXdS)!z3Class for printing reports on profiled python code.�N)�Enum)�
cmp_to_key�Stats�SortKeyc@s8eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
d�ZdS)
r)�calls�ncalls)�
cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimecGs@|d}t�||�}||_|dd�D]}||j|<q&||_|S�Nr�)�str�__new__�_value_�_value2member_map_Z_all_values)�cls�values�value�objZother_value�r�/usr/lib64/python3.8/pstats.pyr-szSortKey.__new__N)
�__name__�
__module__�__qualname__ZCALLSZ
CUMULATIVEZFILENAMEZLINE�NAMEZNFLZPCALLSZSTDNAMEZTIMErrrrrr"sc@s�eZdZdZdd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dddddddddddddd�
Z
dd�Zdd�Zdd�Z
d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd7d1d2�Zd3d4�Zd5d6�ZdS)8ra�This class is used for creating reports from data generated by the
    Profile class.  It is a "friend" of that class, and imports data either
    by direct access to members of Profile class, or by reading in a dictionary
    that was emitted (via marshal) from the Profile class.

    The big change from the previous Profiler (in terms of raw functionality)
    is that an "add()" method has been provided to combine Stats from
    several distinct profile runs.  Both the constructor and the add()
    method now take arbitrarily many file names as arguments.

    All the print methods now take an argument that indicates how many lines
    to print.  If the arg is a floating point number between 0 and 1.0, then
    it is taken as a decimal percentage of the available lines to be printed
    (e.g., .1 means print 10% of all available lines).  If it is an integer,
    it is taken to mean the number of lines of data that you wish to have
    printed.

    The sort_stats() method now processes some additional options (i.e., in
    addition to the old -1, 0, 1, or 2 that are respectively interpreted as
    'stdname', 'calls', 'time', and 'cumulative').  It takes either an
    arbitrary number of quoted strings or SortKey enum to select the sort
    order.

    For example sort_stats('time', 'name') or sort_stats(SortKey.TIME,
    SortKey.NAME) sorts on the major key of 'internal function time', and on
    the minor key of 'the name of the function'.  Look at the two tables in
    sort_stats() and get_sort_arg_defs(self) for more examples.

    All methods return self, so you can string together commands like:
        Stats('foo', 'goo').strip_dirs().sort_stats('calls').                            print_stats(5).print_callers(5)
    N)�streamcGsF|ptj|_t|�sd}n|d}|dd�}|�|�|j|�dSr)�sys�stdoutr#�len�init�add)�selfr#�args�argrrr�__init__Ys
zStats.__init__cCs�d|_g|_d|_d|_d|_d|_d|_t�|_i|_	i|_
|�|�z|��Wn8t
k
r�td|jrx|jdnd|jd��YnXdS)NrzInvalid timing data %s������file)�all_callees�files�fcn_list�total_tt�total_calls�
prim_calls�max_name_len�set�	top_level�stats�
sort_arg_dict�
load_stats�get_top_level_stats�	Exception�printr#)r)r+rrrr'cs(
��z
Stats.initc	Cs�|dkri|_dSt|t�rxt|d��}t�|�|_W5QRXz"t�|�}t�	|j
�d|}WnYnX|g|_n t|d�r�|�
�|j|_i|_|js�td|j|f��dS)N�rbz    �create_statsz.Cannot create or construct a %r object from %r)r:�
isinstancer�open�marshal�load�os�statr�ctime�st_mtimer2�hasattrrA�	TypeError�	__class__)r)r+�fZ
file_statsrrrr<vs*



�zStats.load_statscCs�|j��D]p\}\}}}}}|j|7_|j|7_|j|7_d|krZ|j�|�tt|��|j	kr
tt|��|_	q
dS)N)ZjprofilerZprofiler)
r:�itemsr5r6r4r9r(r&�func_std_stringr7)r)�func�cc�nc�tt�ct�callersrrrr=�szStats.get_top_level_statscGs�|s|St|�D]�}t|�t|�kr,t|�}|j|j7_|j|j7_|j|j7_|j|j7_|jD]}|j�|�qr|j	|j	kr�|j	|_	d|_
|j��D]<\}}||jkr�|j|}nddddif}t
||�|j|<q�q|S�Nr)�reversed�typerr2r5r6r4r9r(r7r3r:rN�add_func_stats)r)�arg_list�itemrPrGZ
old_func_statrrrr(�s(

z	Stats.addc	Cs(t|d��}t�|j|�W5QRXdS)z:Write the profile data to a file we know how to load back.�wbN)rCrD�dumpr:)r)r
rMrrr�
dump_stats�szStats.dump_stats)))rr-z
call count)))�r-zcumulative time))��rz	file name))��rzline number))��rz
function name))rdr`rbzname/file/line)))rr-zprimitive call count)))�rz
standard name)))�r-z
internal time)
rrr	rr
rrr
rrrrrcCst|jsni|_}i}|j��D]>\}}|}|r|s4q||krFd||<q|||<|dd�}q*q|D]
}||=qb|jS)z)Expand all abbreviations that are unique.rNr-)r;�sort_arg_dict_defaultrN)r)�dictZbad_list�word�tupZfragmentrrr�get_sort_arg_defs�s 
zStats.get_sort_arg_defscGs\|sd|_|St|�dkrBt|dt�rBddddd�|dg}n:t|�dkr||dd�D] }t|�t|d�krZtd	��qZ|��}d
}d|_d}|D]B}t|t�r�|j	}|||d}|j|||d7_d}q�g}|j
��D]4\}\}	}
}}}
|�|	|
||f|t
|�|f�q�|jtt|�j�d
�g|_}|D]}|�|d��qB|S)Nrrrrrr)r-rrrgrgzCan't have mixed argument typerr.z, )�keyr-)r3r&rB�intrXrKrl�	sort_typerrr:rN�appendrO�sortr�	TupleComp�compare)r)Zfieldr+Z
sort_arg_defsZ
sort_tupleZ	connectorrjZ
stats_listrPrQrRrSrTrUr3�tuplerrr�
sort_stats�sF��


�
zStats.sort_statscCs|jr|j��|S�N)r3�reverse�r)rrr�
reverse_orders
zStats.reverse_ordercCs�|j}i|_}d}|��D]�\}\}}}}}	t|�}
tt|
��|krRtt|
��}i}|	��D]\}}
|
|t|�<q^|
|kr�t||
|||||f�||
<q|||||f||
<q|j}t�|_}|D]}|�t|��q�||_	d|_
d|_|SrV)r:rN�func_strip_pathr&rOrYr9r8r(r7r3r1)r)ZoldstatsZnewstatsr7rPrQrRrSrTrUZnewfuncZ
newcallers�func2�callerZold_topZnew_toprrr�
strip_dirss0
�
zStats.strip_dirsc
Cst|jr
dSi|_}|j��D]P\}\}}}}}||kr@i||<|��D]$\}}	||kr`i||<|	|||<qHqdSrv)r1r:rN)
r)r1rPrQrRrSrTrUr{r|rrr�calc_callees#s
zStats.calc_calleescCs|}t|t�rpzt�|�}Wn*tjk
rF|d|7}||fYSXg}|D]}|�t|��rP|�|�qPnzt|�}t|t	�r�d|kr�dkr�nnt
||d�}|d|�}n2t|t
�r�d|kr�|kr�nn|}|d|�}t|�t|�k�r|dt|�t|�|f7}||fS)Nz#   <Invalid regular expression %r>
gg�?g�?rz6   List reduced from %r to %r due to restriction <%r>
)rBr�re�compile�error�searchrOrpr&�floatrn)r)Zsel�list�msgZnew_listZrexrP�countrrr�eval_print_amount6s2
""�zStats.eval_print_amountcCs�|j}|jr*|jdd�}d|jd}nt|j���}d}|D]}|�|||�\}}q@t|�}|sld|fSt||j	d�|t|j�kr�d}|D] }tt
|��|kr�tt
|��}q�|d|fS)Nz   Ordered by: �
z!   Random listing order was used
rr/rg)r7r3ror�r:�keysr�r&r?r#rO)r)Zsel_list�widthZ	stat_listr�Z	selectionr�rPrrr�get_print_listPs$zStats.get_print_listcGs�|jD]}t||jd�q|jr,t|jd�d}|jD]}t|t|�|jd�q6t||jdd|jd�|j|jkr�td|jd|jd�td|j|jd�t|jd�|�|�\}}|r�|�	�|D]}|�
|�q�t|jd�t|jd�|S)Nr/�        zfunction calls� ��endr0z(%d primitive calls)zin %.3f seconds)r2r?r#r9�func_get_function_namer5r6r4r��print_title�
print_line)r)�amountr
�indentrPr�r�rrr�print_statshs(

zStats.print_statscGsz|�|�\}}|rv|��|�|d�|D]2}||jkrN|�|||j|�q*|�||i�q*t|jd�t|jd�|S)Nz	called...r/)r�r~�print_call_headingr1�print_call_liner?r#)r)r�r�r�rPrrr�
print_calleess
zStats.print_calleesc
Gsh|�|�\}}|rd|�|d�|D](}|j|\}}}}}	|�|||	d�q"t|jd�t|jd�|S)Nzwas called by...z<-r/)r�r�r:r�r?r#)
r)r�r�r�rPrQrRrSrTrUrrr�
print_callers�szStats.print_callersc
Csvtd�|�||jd�d}|j��D]0\}}}}}|r&tt|����}	t|	t�}qXq&|rrtd|d|jd�dS)Nz	Function r/Fr�z    ncalls  tottime  cumtime)	r?�ljustr#r:r�next�iterrBrt)
r)�	name_sizeZcolumn_titleZ	subheaderrQrRrSrTrUrrrrr��s
zStats.print_call_heading�->cCstt|��|�|d|jd�|s2t|jd�dSt|���}d}|D]�}t|�}||}	t|	t�r�|	\}
}}}
|
|kr�d|
|f}n
d|
f}d|�dd	t	|��t
|�t
|
�|f}|d
}n$d||	t
|j|d�f}|d}t||||jd�d}qFdS)
Nr�r�r/r.z%d/%dz%dz%s %s %s  %srfrgrz	%s(%r) %sr_)r?rOr�r#�sortedr�rBrt�rjustr&�f8r:)r)r��sourceZ	call_dictZarrowZclistr�rPr
rrRrQrSrTZsubstatsZ
left_widthrrrr��s0

�
zStats.print_call_linecCs"tdd|jd�td|jd�dS)Nz-   ncalls  tottime  percall  cumtime  percallr�r�zfilename:lineno(function)r/�r?r#rxrrrr��szStats.print_titlecCs�|j|\}}}}}t|�}||kr4|dt|�}t|�d�d|jd�tt|�d|jd�|dkrxtdd|jd�ntt||�d|jd�tt|�d|jd�|dkr�tdd|jd�ntt||�d|jd�tt|�|jd�dS)N�/�	r�r�rr�r/)r:rr?r�r#r�rO)r)rPrQrRrSrTrU�crrrr��szStats.print_line)r�)rr r!�__doc__r,r'r<r=r(r^rhrlruryr}r~r�r�r�r�r�r�r�r�r�rrrrr7sF!

�'
c@s eZdZdZdd�Zdd�ZdS)rra�This class provides a generic function for comparing any two tuples.
    Each instance records a list of tuple-indices (from most significant
    to least significant), and sort direction (ascending or decending) for
    each tuple-index.  The compare functions can then be used as the function
    argument to the system sort() function when a list of tuples need to be
    sorted in the instances order.cCs
||_dSrv��comp_select_list)r)r�rrrr,�szTupleComp.__init__cCsF|jD]:\}}||}||}||kr0|S||kr|SqdSrVr�)r)�left�right�index�	direction�l�rrrrrs�s

zTupleComp.compareN)rr r!r�r,rsrrrrrr�srrcCs|\}}}tj�|�||fSrv)rF�path�basename)�	func_namer
rr
rrrrz�s
rzcCs|dS)Nrgr)rPrrrr��sr�cCsN|dd�dkrB|d}|�d�r<|�d�r<d|dd�S|Snd|SdS)	Nrg)�~r�<�>z{%s}rr-z	%s:%d(%s))�
startswith�endswith)r�r
rrrrO�srOcCs@|\}}}}}|\}}}	}
}||||||	||
t||�fS)z3Add together all the stats for two profile entries.)�add_callers)�targetr�rQrRrSrTrUZt_ccZt_ncZt_ttZt_ctZ	t_callersrrrrYs
�rYcCs�i}|��D]\}}|||<q|��D]V\}}||krtt|t�rbtdd�t|||�D��||<q||||7<q&|||<q&|S)z*Combine two caller lists in a single list.css|]\}}||VqdSrvr)�.0�i�jrrr�	<genexpr>szadd_callers.<locals>.<genexpr>)rNrBrt�zip)r�r�Znew_callersrPr|rrrr�s

"
r�cCsd}|��D]}||7}q|S)z@Sum the caller statistics to get total number of calls received.r)r)rUrRrrrr�count_callss
r�cCsd|S)Nz%8.3fr)�xrrrr�(sr��__main__c@s�eZdZd6dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7�ProfileBrowserNcCs6tj�|�d|_d|_tj|_|dk	r2|�|�dS)N�% )	�cmd�Cmdr,�promptr:r$r%r#�do_read)r)�profilerrrr,7szProfileBrowser.__init__c	Cs�|��}g}|D]�}z|�t|��WqWntk
r>YnXz<t|�}|dksZ|dkrltd|jd�Wq|�|�WqWntk
r�YnX|�|�q|jr�t|j|�|�ntd|jd�dS)Nrrz#Fraction argument must be in [0, 1]r/�No statistics object is loaded.)	�splitrprn�
ValueErrorr�r?r#r:�getattr)r)�fnrr*Z	processedZtermZfracrrr�generic?s,
zProfileBrowser.genericcCsXtd|jd�td|jd�td|jd�td|jd�td|jd�td|jd�dS)NzArguments may be:r/z0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz-  what fraction of selected entries to print.z8* A regular expression; only entries with function namesz  that match it are printed.r�rxrrr�generic_helpWszProfileBrowser.generic_helpc
Csd|jrRz|j�|�Wq`tk
rN}ztd||f|jd�W5d}~XYq`Xntd|jd�dS)Nz$Failed to load statistics for %s: %sr/r�r)r:r(�OSErrorr?r#)r)r�errr�do_add_s*zProfileBrowser.do_addcCstd|jd�dS)Nz>Add profile info from given file to current statistics object.r/r�rxrrr�help_addhszProfileBrowser.help_addcCs|�d|�S)Nr��r��r)rrrr�
do_calleeskszProfileBrowser.do_calleescCstd|jd�|��dS)Nz6Print callees statistics from the current stat object.r/�r?r#r�rxrrr�help_calleesmszProfileBrowser.help_calleescCs|�d|�S)Nr�r�r�rrr�
do_callersqszProfileBrowser.do_callerscCstd|jd�|��dS)Nz6Print callers statistics from the current stat object.r/r�rxrrr�help_callerssszProfileBrowser.help_callerscCstd|jd�dS)Nr.r/rr�r�rrr�do_EOFwszProfileBrowser.do_EOFcCstd|jd�dS�NzLeave the profile browser.r/r�rxrrr�help_EOFzszProfileBrowser.help_EOFcCsdS)Nrrr�rrr�do_quit}szProfileBrowser.do_quitcCstd|jd�dSr�r�rxrrr�	help_quitszProfileBrowser.help_quitc
Cs�|r�zt|�|_Wnztk
rN}zt|jd|jd�WY�dSd}~XYn@tk
r�}z"t|jjd||jd�WY�dSd}~XYnX|d|_	n6t
|j	�dkr�|j	dd�}|�|�ntd|jd�dS)	Nrr/�:r�rg���z1No statistics object is current -- cannot reload.r)rr:r�r?r*r#r>rLrr�r&r�)r)r�errrrrr��szProfileBrowser.do_readcCs td|jd�td|jd�dS)Nz+Read in profile data from a specified file.r/z*Without argument, reload the current file.r�rxrrr�	help_read�szProfileBrowser.help_readcCs$|jr|j��ntd|jd�dS)Nr�r/r)r:ryr?r#r�rrr�
do_reverse�szProfileBrowser.do_reversecCstd|jd�dS)Nz/Reverse the sort order of the profiling report.r/r�rxrrr�help_reverse�szProfileBrowser.help_reversecs�|jstd|jd�dS|j���|rRt�fdd�|��D��rR|jj|���n<td|jd�tj�	�D]"\}}td||df|jd�qjdS)	Nr�r/c3s|]}|�kVqdSrvr)r�r��Zabbrevsrrr��sz)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %srr)
r:r?r#rl�allr�rurrhrN)r)rrmrrr�r�do_sort�s
zProfileBrowser.do_sortcCs td|jd�td|jd�dS)Nz.Sort profile data according to specified keys.r/z3(Typing `sort' without arguments lists valid keys.)r�rxrrr�	help_sort�szProfileBrowser.help_sortcs�fdd�tjD�S)Ncsg|]}|���r|�qSr)r�)r��a��textrr�
<listcomp>�s
z0ProfileBrowser.complete_sort.<locals>.<listcomp>)rrh)r)r�r*rr�r�
complete_sort�szProfileBrowser.complete_sortcCs|�d|�S)Nr�r�r�rrr�do_stats�szProfileBrowser.do_statscCstd|jd�|��dS)Nz.Print statistics from the current stat object.r/r�rxrrr�
help_stats�szProfileBrowser.help_statscCs$|jr|j��ntd|jd�dS)Nr�r/)r:r}r?r#r�rrr�do_strip�szProfileBrowser.do_stripcCstd|jd�dS)Nz<Strip leading path information from filenames in the report.r/r�rxrrr�
help_strip�szProfileBrowser.help_stripcCstd|jd�dS)NzShow help for a given command.r/r�rxrrr�	help_help�szProfileBrowser.help_helpcCs|r|SdSrvr)r)�stoprrrr�postcmd�szProfileBrowser.postcmd)N)rr r!r,r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�6s4
	r�rrgz*Welcome to the profile statistics browser.r/zGoodbye.)&r�r$rFrrDr�enumr�	functoolsr�__all__rrrrrrzr�rOrYr�r�r�rr��readline�ImportErrorr�r�r&�argvZinitprofileZbrowserr�r�r?r#Zcmdloop�KeyboardInterruptrrrr�<module>sR 
traceback.cpython-38.opt-2.pyc000064400000025435151450073350012067 0ustar00U

e5d;\�@s6ddlZddlZddlZddlZdddddddd	d
ddd
dddddddgZd2dd�Zdd�Zd3dd�Zd4dd�Zd5dd�Z	dZ
dZd6dd�Zd7dd�Z
d d�Zd!d"�Zd#d$�Zd8d%d	�Zd9d&d
�Zd:d'd�Zd;d(d
�Zd<d)d�Zd=d*d�Zd+d�ZGd,d�d�Zd-d�Zd.d�Zd/ZGd0d�de�ZGd1d�d�ZdS)>�N�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbcCs4|dkrtj}t�|���D]}t||dd�qdS)N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�item�r �!/usr/lib64/python3.8/traceback.py�
print_listsr"cCst�|���S�N)rrr)rr r r!rscCstt||d�|d�dS�N��limit)r)r"r)�tbr&rr r r!r-scCst||d���S�Nr%)rr�r'r&r r r!r7scCstjt|�|d�Sr()r�extractrr)r r r!r;s
zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

TcCsB|dkrtj}tt|�|||d�j|d�D]}t||dd�q*dS)Nr%��chainrr)rrr�typerr)�etype�valuer'r&rr,�liner r r!rWs��
cCs ttt|�|||d�j|d��S)Nr%r+)�listrr-r)r.r/r'r&r,r r r!rls��cCstt||d����Sr#)r1rr)r.r/r r r!r|scCs.t|�}|dks|sd|}nd||f}|S)Nz%s
z%s: %s
)�	_some_str)r.r/�valuestrr0r r r!�_format_final_exc_line�s

r4cCs*z
t|�WSdt|�jYSXdS)Nz<unprintable %s object>)�strr-�__name__)r/r r r!r2�s
r2cCstt��|||d��dS)N�r&rr,)rr�exc_infor7r r r!r	�scCsd�tt��||d���S)Nr�r&r,)�joinrrr8r9r r r!r
�scCs.ttd�std��ttjtjtj|||�dS)N�	last_typezno last exception)�hasattrr�
ValueErrorrr;�
last_value�last_tracebackr7r r r!r�s
�cCs*|dkrt��j}tt||d�|d�dSr$)r�	_getframe�f_backr"r)�fr&rr r r!r
�s
cCs"|dkrt��j}tt||d��Sr()rr@rArr)rBr&r r r!r�s
cCs0|dkrt��j}tjt|�|d�}|��|Sr()rr@rArr*r�reverse)rBr&�stackr r r!r�s
	
cCs8|dk	r4z|j��Wntk
r*YnX|j}qdSr#)�tb_frame�clear�RuntimeError�tb_next�r'r r r!r�sc@sVeZdZdZdddd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	e
dd��ZdS)r)�filename�lineno�name�_line�localsTN)�lookup_linerNr0cCsB||_||_||_||_|r"|j|r8dd�|��D�nd|_dS)NcSsi|]\}}|t|��qSr )�repr)�.0�k�vr r r!�
<dictcomp>sz)FrameSummary.__init__.<locals>.<dictcomp>)rJrKrLrMr0�itemsrN)�selfrJrKrLrOrNr0r r r!�__init__�szFrameSummary.__init__cCs`t|t�r:|j|jko8|j|jko8|j|jko8|j|jkSt|t�r\|j|j|j|jf|kStSr#)	�
isinstancerrJrKrLrN�tupler0�NotImplemented�rV�otherr r r!�__eq__s

�
�
�
zFrameSummary.__eq__cCs|j|j|j|jf|Sr#)rJrKrLr0)rV�posr r r!�__getitem__szFrameSummary.__getitem__cCst|j|j|j|jg�Sr#)�iterrJrKrLr0�rVr r r!�__iter__szFrameSummary.__iter__cCsdj|j|j|jd�S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)rJrKrL)rrJrKrLrar r r!�__repr__s
�zFrameSummary.__repr__cCsdS)N�r rar r r!�__len__szFrameSummary.__len__cCs&|jdkr t�|j|j���|_|jSr#)rM�	linecache�getlinerJrK�striprar r r!r0s
zFrameSummary.line)r6�
__module__�__qualname__�	__slots__rWr]r_rbrcre�propertyr0r r r r!r�s�
ccs4|dkrt��jj}|dk	r0||jfV|j}qdSr#)rr@rA�f_lineno)rBr r r!r$s
ccs"|dk	r|j|jfV|j}qdSr#)rE�	tb_linenorHrIr r r!r1s�c@s6eZdZedddd�dd��Zedd��Zd	d
�ZdS)rNTF�r&�lookup_lines�capture_localsc

Cs�|dkr(ttdd�}|dk	r(|dkr(d}|dk	rV|dkrFt�||�}ntj||d�}|�}t�}|D]Z\}}|j}	|	j}
|	j	}|�
|
�t�|
|j
�|r�|j}nd}|�t|
||d|d��qf|D]}
t�|
�q�|r�|D]
}|jq�|S)N�tracebacklimitr)�maxlenF)rOrN)�getattrr�	itertools�islice�collections�deque�set�f_code�co_filename�co_name�addrf�	lazycache�	f_globals�f_locals�appendr�
checkcacher0)
�klass�	frame_genr&rqrr�result�fnamesrBrK�corJrLr�r r r!r*As@
�
zStackSummary.extractc	CsLt�}|D]<}t|t�r$|�|�q
|\}}}}|�t||||d��q
|S)N)r0)rrXrr�)r��a_listr��framerJrKrLr0r r r!rqs

zStackSummary.from_listc
Csng}d}d}d}d}|D�]}|dksT||jksT|dksT||jksT|dksT||jkr�|tkr�|t8}|�d|�d|dkr|dnd�d��|j}|j}|j}d}|d7}|tkr�qg}|�d�|j|j|j��|jr�|�d	�|j����|j�r t	|j�
��D]\}}	|�d
j||	d���q|�d�|��q|tk�rj|t8}|�d|�d|dk�r^dnd�d��|S)Nrz  [Previous line repeated z
 more time��srz]
z  File "{}", line {}, in {}
�    {}
z    {name} = {value}
)rLr/)rJrKrL�_RECURSIVE_CUTOFFr�rr0rhrN�sortedrUr:)
rVr��	last_file�	last_line�	last_name�countr��rowrLr/r r r!r�sZ
������
�zStackSummary.format)r6rirj�classmethodr*rrr r r r!r>s�/
c@sZeZdZddddd�dd�Zedd��Zd	d
�Zdd�Zd
d�Zdd�Z	dd�dd�Z
dS)rNTF�r&rqrr�_seenc	CsJ|dkrt�}|�t|��|r\|jdk	r\t|j�|kr\tt|j�|j|jj|d||d�}nd}|r�|jdk	r�t|j�|kr�tt|j�|j|jj|d||d�}	nd}	||_|	|_|r�|jnd|_t	j
t|�|||d�|_||_
t|�|_|�r8t|t��r8|j|_|j}
|
dk	�rt|
�nd|_|j|_|j|_|j|_|�rF|��dS)NFr�rp)rzr~�id�	__cause__rr-�
__traceback__�__context__�__suppress_context__rr*rrD�exc_typer2�_str�
issubclass�SyntaxErrorrJrKr5�text�offset�msg�_load_lines)rVr��	exc_value�
exc_tracebackr&rqrrr��cause�context�lnor r r!rW�sd��	��	��
zTracebackException.__init__cOs|t|�||jf|�|�Sr#)r-r�)�cls�exc�args�kwargsr r r!�from_exceptionsz!TracebackException.from_exceptioncCs6|jD]
}|jq|jr"|j��|jr2|j��dSr#)rDr0r�r�r�)rVr�r r r!r�s

zTracebackException._load_linescCs|j|jkSr#)�__dict__r[r r r!r]szTracebackException.__eq__cCs|jSr#)r�rar r r!�__str__szTracebackException.__str__ccs6|jdkrtd|j�VdS|jj}|jj}|dkr@|d|}t|jt�s^t||j�VdSd}|jdk	r�d�|j	pxd|j�Vn|j	dk	r�d�|j	�}|j
}|j}|dk	�rd�|���V|dk	�r|�
d�}tt|�|�d	}|d|���}d
d�|D�}d�d�|��V|j�p d
}d�|||�VdS)N)�__main__�builtins�.rz  File "{}", line {}
z<string>z ({})r��
r�css|]}|��r|pdVqdS)� N)�isspace)rQ�cr r r!�	<genexpr>Msz;TracebackException.format_exception_only.<locals>.<genexpr>z    {}^
z<no detail available>z	{}: {}{}
)r�r4r�rjrir�r�rKrrJr�r�rh�rstrip�min�len�lstripr:r�)rV�stype�smod�filename_suffix�badliner��
caretspacer�r r r!r"s<

�



z(TracebackException.format_exception_onlyr+ccs�|rT|jdk	r*|jj|d�EdHtVn*|jdk	rT|jsT|jj|d�EdHtV|jrpdV|j��EdH|��EdHdS)Nr+z#Traceback (most recent call last):
)r�r�_cause_messager�r��_context_messagerDr)rVr,r r r!rRs

�zTracebackException.format)r6rirjrWr�r�r�r]r�rrr r r r!r�s�:
	0)N)NN)N)N)NNT)NT)NNT)NT)NNT)NNN)NN)NN)rxrvrfr�__all__r"rrrrr�r�rrrr4r2r	r
rr
rrrrrrr�r1rrr r r r!�<module>s`�




��







A
z_osx_support.cpython-38.pyc000064400000026513151450073350011752 0ustar00U

e5dU�@s�dZddlZddlZddlZddddgZdZdZd	Zd-d
d�Zd.d
d�Z	dd�Z
dadd�Zda
dd�Zdd�Zdd�Zdadd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d�Zd*d�Zd+d�Zd,d�ZdS)/zShared OS X support functions.�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|�tj�}tj�|�\}}tjdkrH|dkrH|d}tj�|�s�|D]&}tj�	||�}tj�|�rX|SqXdS|SdS)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�$/usr/lib64/python3.8/_osx_support.py�_find_executables

rFc
Cs�ddl}zddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��P}|rfd||jf}nd||jf}t�	|�s�|�
��d���ndW5QR�SQRXdS)z0Output from successful command execution or NonerNz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr�fp�cmdrrr�_read_output7s��
r+cCst|�ptd|f�pdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find %s�)rr+)Ztoolnamerrr�_find_build_toolMs
��r-cCsxtdkrtdaztd�}Wntk
r,YnHXzt�d|���}W5|��X|dk	rtd�|�d��	d�dd��atS)z*Return the OS X system version as a stringNr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�close�re�searchr&r�groupr)r�mrrr�_get_system_versionVs
�
r8cCsLtdkrHt�}|rHztdd�|�d�D��aWntk
rFdaYnXtS)z}
    Return the macOS system version as a tuple

    The return value is safe to use to compare
    two version numbers.
    Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>�sz,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rDcCs"t|�D]}|�t�r||=qdS)z-Remove original unmodified values for testingN)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rJcCs8|�|d�}||kr,t||kr,||t|<|||<dS)z@Save modified and original unmodified value of configuration varr,N)�getrG)rH�cvZnewvalueZoldvaluerrr�_save_modified_value�srMcCs�tdk	rtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d	�r(|dd
�aq(tdkr�datS)z= Returns the root of the default SDK for this system, or '/' Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrFr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rUcCst�}|rt|dk�SdS)z=Returns True if universal builds are supported on this system��
�F)rD�boolrCrrr�_supports_universal_builds�srZcCst�}|r|dkSdS)z9Returns True if arm64 builds are supported on this system)�rF)rDrCrrr�_supports_arm64_builds�sr\cCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�tD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
z7Find appropriate C compiler for extension module buildsr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerFr+�replace�SystemError�_COMPILER_CONFIG_VARSrMr)rHrRZoldcc�datarLZcv_splitrrr�_find_appropriate_compiler�s,

��recCsVtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�q|S)z5Remove all universal build arguments from config vars�
-arch\s+\w+\sr_)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r4�sub�ASCIIrM)rHrLrgrrr�_remove_universal_flagssrkcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�tD]8}||krF|tjkrF||}t�dd	|�}t|||�qF|S)
z-Remove any unsupported archs from config varsr	z-arch\s+ppcrNzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullr]r^z-arch\s+ppc\w*\sr_)	rr
r4r5r%rarhrirM)rHZstatusrLrgrrr�_remove_unsupported_archss
��	rlcCsddtjkr`tjd}tD]F}||krd||kr||}t�dd|�}|d|}t|||�q|S)z2Allow override of all archs with ARCHFLAGS env var�	ARCHFLAGS�-archrfr_)rr
rhr4rirM)rHZarchrLrgrrr�_override_all_archs:s

rocCsx|�dd�}t�d|�}|dk	rt|�d�}tj�|�sttD]8}||kr:|tjkr:||}t�	dd|�}t
|||�q:|S)z+Remove references to any SDKs not availablerr,z-isysroot\s*(\S+)Nr/z-isysroot\s*\S+(?:\s|$)r_)rKr4r5r6rr�existsrhr
rirM)rH�cflagsr7ZsdkrLrgrrr�_check_for_unavailable_sdkKs
rrc
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�z|�d�}|||d�=WqHtk
r|Yq�YqHXqHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjkr�|s�|tjd��}|�r@d
d�t|�D�}|�s
�q@|d}||d
k�r0|||d�=q�|||d�=q�d}|}dd�t|�D�}|�sv|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qz|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)ae
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    FTrncss|]}|�d�r|VqdS)�	-isysrootN�rF)r=�argrrrr?ys
z!compiler_fixup.<locals>.<genexpr>rmr0r/�arm64cSsg|]\}}|�d�r|�qS�rsrt�r=r>�xrrr�
<listcomp>�s
z"compiler_fixup.<locals>.<listcomp>rrsNcSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
cSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rErZ�anyrr
�indexrBr\�reversed�range�lenr�	enumerater�isdirZ	distutilsr{�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr}�idx�indicesZsysrootZargvarr{rrrrfsZ	


�
cCs"t�st|�t|�t|�|S)a�Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    )rZrkrorr�rHrrrr�s
cCst|�t|�t|�|S)z�Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler).
    )rerlror�rrrr�s	cCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�rFd|��k�rFd
}t�d|�}tt	t
|���}t|�dkr�|d}nj|dkr�d}n\|dkr�d
}nN|dk�rd}n>|dk�rd}n.|dk�r&d}n|dk�r6d}ntd|f��n<|dk�rbtj
dk�r�d}n |dk�r�tj
dk�r~d }nd!}|||fS)"z Filter values for get_platform()ZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?sz#get_platform_osx.<locals>.<genexpr>r.rr0)rWrrVrnZfatz
-arch\s+(\S+)r/)rv�x86_64Z
universal2)�i386�ppc)r�r�Zintel)r�r�r�Zfat3)�ppc64r�Zfat64)r�r�r�r�Z	universalz%Don't know machine value for archs=%rr�lr�)ZPowerPCZPower_Macintoshr�r�)rKr8rGrArrBr(r4�findall�sorted�setr�r�maxsize)rHZosname�release�machineZmacverZ
macreleaserqZarchsrrrr�sX



�$




�

)N)F)�__doc__rr4r�__all__rhrcrGrr+r-r1r8r@rDrJrMrOrUrZr\rerkrlrorrrrrrrrrr�<module>sB�


	

>(Q)argparse.cpython-38.opt-1.pyc000064400000171262151450073350011753 0ustar00U

e5dw�@s0dZdZdddddddd	d
ddd
dddddgZddlZddlZddlZddl	Z
ddlmZm
Z
dZdZdZdZdZdZdZGdd�de�Zdd �ZGd!d�de�ZGd"d�de�ZGd#d	�d	e�ZGd$d�de�ZGd%d
�d
e�Zd&d'�ZGd(d�de�ZGd)d�de�Z Gd*d�de�Z!Gd+d,�d,e!�Z"Gd-d.�d.e!�Z#Gd/d0�d0e#�Z$Gd1d2�d2e#�Z%Gd3d4�d4e!�Z&Gd5d6�d6e!�Z'Gd7d8�d8e!�Z(Gd9d:�d:e!�Z)Gd;d<�d<e!�Z*Gd=d>�d>e!�Z+Gd?d@�d@e&�Z,GdAd�de�Z-GdBd�de�Z.GdCdD�dDe�Z/GdEdF�dFe/�Z0GdGdH�dHe0�Z1GdId�dee/�Z2dS)Ja�
Command-line parsing library

This module is an optparse-inspired command-line parsing library that:

    - handles both optional and positional arguments
    - produces highly informative usage messages
    - supports parsers that dispatch to sub-parsers

The following is a simple usage example that sums integers from the
command-line and writes the result to a file::

    parser = argparse.ArgumentParser(
        description='sum the integers at the command line')
    parser.add_argument(
        'integers', metavar='int', nargs='+', type=int,
        help='an integer to be summed')
    parser.add_argument(
        '--log', default=sys.stdout, type=argparse.FileType('w'),
        help='the file where the sum should be written')
    args = parser.parse_args()
    args.log.write('%s' % sum(args.integers))
    args.log.close()

The module contains the following public classes:

    - ArgumentParser -- The main entry point for command-line parsing. As the
        example above shows, the add_argument() method is used to populate
        the parser with actions for optional and positional arguments. Then
        the parse_args() method is invoked to convert the args at the
        command-line into an object with attributes.

    - ArgumentError -- The exception raised by ArgumentParser objects when
        there are errors with the parser's actions. Errors raised while
        parsing the command-line are caught by ArgumentParser and emitted
        as command-line messages.

    - FileType -- A factory for defining types of files to be created. As the
        example above shows, instances of FileType are typically passed as
        the type= argument of add_argument() calls.

    - Action -- The base class for parser actions. Typically actions are
        selected by passing strings like 'store_true' or 'append_const' to
        the action= argument of add_argument(). However, for greater
        customization of ArgumentParser actions, subclasses of Action may
        be defined and passed as the action= argument.

    - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
        ArgumentDefaultsHelpFormatter -- Formatter classes which
        may be passed as the formatter_class= argument to the
        ArgumentParser constructor. HelpFormatter is the default,
        RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
        not to change the formatting for help text, and
        ArgumentDefaultsHelpFormatter adds information about argument defaults
        to the help.

All other classes in this module are considered implementation details.
(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
considered public as object names -- the API of the formatter objects is
still considered an implementation detail.)
z1.1�ArgumentParser�
ArgumentError�ArgumentTypeError�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...Z_unrecognized_argsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_AttributeHolderaAbstract base class that provides __repr__.

    The __repr__ method returns a string in the format::
        ClassName(attr=name, attr=name, ...)
    The attributes are determined either by a class-level attribute,
    '_kwarg_names', or by inspecting the instance __dict__.
    cCs�t|�j}g}i}|��D]}|�t|��q|��D],\}}|��rZ|�d||f�q6|||<q6|rz|�dt|��d|d�|�fS)N�%s=%rz**%s�%s(%s)�, )�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�selfZ	type_name�arg_stringsZ	star_args�arg�name�value�r*� /usr/lib64/python3.8/argparse.py�__repr__ts

z_AttributeHolder.__repr__cCst|j���S�N)�sorted�__dict__�items�r%r*r*r+r"�sz_AttributeHolder._get_kwargscCsgSr-r*r1r*r*r+r�sz_AttributeHolder._get_argsN)r�
__module__�__qualname__�__doc__r,r"rr*r*r*r+rksrcCs6|dkrgSt|�tkr$|dd�Sddl}|�|�S)Nr)r�list�copy)r0r6r*r*r+�_copy_items�sr7c@s�eZdZdZd;dd�Zdd�Zd	d
�ZGdd�de�Zd
d�Z	dd�Z
dd�Zdd�Zd<dd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)=rz�Formatter for generating usage messages and argument help strings.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    ��NcCs�|dkrt��j}|d8}||_||_t|t|d|d��|_||_d|_	d|_
d|_|�|d�|_
|j
|_t�dtj�|_t�d�|_dS)Nr8�rz\s+z\n\n\n+)�_shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r%�progZindent_incrementZmax_help_position�widthr*r*r+�__init__�s 
�zHelpFormatter.__init__cCs"|j|j7_|jd7_dS�N��rDr?rEr1r*r*r+�_indent�szHelpFormatter._indentcCs"|j|j8_|jd8_dSrRrTr1r*r*r+�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dSr-)�	formatter�parent�headingr0)r%rWrXrYr*r*r+rQ�szHelpFormatter._Section.__init__cCs�|jdk	r|j��|jj}|dd�|jD��}|jdk	rD|j��|sLdS|jtk	rz|jdk	rz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr*r*)�.0�func�argsr*r*r+�
<listcomp>�sz6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s:
�
)	rXrWrU�_join_partsr0rVrYrrD)r%r$Z	item_helpZcurrent_indentrYr*r*r+�format_help�s



z"HelpFormatter._Section.format_help)N)rr2r3rQrar*r*r*r+rG�s
rGcCs|jj�||f�dSr-)rIr0r )r%r[r\r*r*r+�	_add_item�szHelpFormatter._add_itemcCs0|��|�||j|�}|�|jg�||_dSr-)rUrGrIrbra)r%rYZsectionr*r*r+�
start_section�szHelpFormatter.start_sectioncCs|jj|_|��dSr-)rIrXrVr1r*r*r+�end_section�s
zHelpFormatter.end_sectioncCs$|tk	r |dk	r |�|j|g�dSr-)rrb�_format_text)r%�textr*r*r+�add_text�szHelpFormatter.add_textcCs&|tk	r"||||f}|�|j|�dSr-)rrb�
_format_usage)r%�usage�actions�groups�prefixr\r*r*r+�	add_usage�szHelpFormatter.add_usagecCsv|jtk	rr|j}||�g}|�|�D]}|�||��q$tdd�|D��}||j}t|j|�|_|�|j	|g�dS)NcSsg|]}t|��qSr*��len�rZ�sr*r*r+r]
sz.HelpFormatter.add_argument.<locals>.<listcomp>)
�helpr�_format_action_invocation�_iter_indented_subactionsr rArDrFrb�_format_action)r%�actionZget_invocationZinvocations�	subactionZinvocation_lengthZ
action_lengthr*r*r+�add_arguments


�zHelpFormatter.add_argumentcCs|D]}|�|�qdSr-)rx)r%rjrvr*r*r+�
add_argumentsszHelpFormatter.add_argumentscCs.|j��}|r*|j�d|�}|�d�d}|S)N�

r_)rHrarN�sub�strip)r%rrr*r*r+ras

zHelpFormatter.format_helpcCsd�dd�|D��S)Nr^cSsg|]}|r|tk	r|�qSr*)r)rZ�partr*r*r+r]!s�z-HelpFormatter._join_parts.<locals>.<listcomp>)r$)r%Zpart_stringsr*r*r+r` s
�zHelpFormatter._join_partscs|dkrtd�}|dk	r,|t|jd�}�n�|dkrL|sLdt|jd�}�n�|dk�rdt|jd�}g}g}|D] }|jr�|�|�qr|�|�qr|j}	|	|||�}
d�dd�||
fD��}|j|j�t	|�t	|��k�rd}|	||�}|	||�}
t
�||�}t
�||
�}d�fdd	�	}t	|�t	|�d
�k�r�dt	|�t	|�d}|�r|||g|||�}|�|||��n |�r�||g|||�}n|g}nZdt	|�}||}|||�}t	|�dk�r�g}|�|||��|�|||��|g|}d�|�}d
||fS)Nzusage: �rOz%(prog)s� cSsg|]}|r|�qSr*r*rpr*r*r+r]Asz/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|dk	rt|�d}nt|�d}|D]Z}|dt|��krn|rn|�|d�|��g}t|�d}|�|�|t|�d7}q.|r�|�|d�|��|dk	r�|dt|�d�|d<|S)NrSrr)ror r$)�parts�indentrl�lines�lineZline_lenr}��
text_widthr*r+�	get_linesUs"
z.HelpFormatter._format_usage.<locals>.get_linesg�?rSr_z%s%s

)N)
�_�dictr>�option_stringsr �_format_actions_usager$rCrDrorJ�findall�extend)r%rirjrkrlrO�	optionals�positionalsrv�formatZaction_usageZpart_regexpZ	opt_usageZ	pos_usageZ	opt_partsZ	pos_partsr�r�r�r�r*r�r+rh%sX
�




zHelpFormatter._format_usagec	Cs�t�}i}|D�]}z|�|jd�}Wntk
r@YqYqX|t|j�}|||�|jkr|jD]}|�|�qh|js�||kr�||d7<nd||<||kr�||d7<nd||<nF||kr�||d7<nd||<||k�r||d7<nd||<t|d|�D]}	d	||	<�qqg}
t|�D�]"\}	}|j	t
k�r�|
�d�|�|	�d	k�rr|�
|	�n"|�|	d�d	k�rX|�
|	d�n�|j�s�|�|�}|�||�}||k�r�|ddk�r�|d
dk�r�|dd
�}|
�|�nf|jd}
|jdk�rd|
}n"|�|�}|�||�}d|
|f}|j�sN||k�rNd
|}|
�|��q6t|dd�D]}	||	g|
|	|	�<�qhd�dd�|
D��}d}d}t�d|d|�}t�d|d|�}t�d||fd|�}t�dd|�}|��}|S)Nrz [�[�]z (�(�)rS�|����%s�%s %s�[%s]T)�reversercSsg|]}|dk	r|�qSr-r*)rZ�itemr*r*r+r]�sz7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1� (%s)z%s *%sr^z\(([^|]*)\))�set�index�_group_actions�
ValueErrorro�add�required�range�	enumeraterrrr �get�popr��#_get_default_metavar_for_positional�_format_args�nargs�!_get_default_metavar_for_optionalr.r$rJr{r|)r%rjrk�
group_actionsZinserts�group�start�endrv�ir��defaultr}�
option_string�args_stringrf�open�closer*r*r+r��sz










z#HelpFormatter._format_actions_usagecCsFd|kr|t|jd�}t|j|jd�}d|j}|�|||�dS)Nz%(prog)r~�rrz)r�r>rArCrD�
_fill_text)r%rfr�r�r*r*r+re�s

zHelpFormatter._format_textc
Cs:t|jd|j�}t|j|d�}||jd}|�|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|jr�|�	|�}	|�
|	|�}
|�d|d|
df�|
dd�D]}|�d|d|f�q�n|�d��s|�d�|�
|�D]}|�|�|���q|�|�S)	Nr8r�r^z%*s%s
z	%*s%-*s  rrSr_)r@rFrBrArCrDrsrrro�_expand_help�_split_linesr �endswithrtrur`)
r%rvZ
help_positionZ
help_widthZaction_widthZ
action_header�tupZindent_firstr�Z	help_textZ
help_linesr�rwr*r*r+ru�s8
�



zHelpFormatter._format_actioncCs�|js&|�|�}|�||�d�\}|Sg}|jdkrB|�|j�n4|�|�}|�||�}|jD]}|�d||f�q^d�|�SdS)NrSrr�r)	r�r��_metavar_formatterr�r�r�r�r r$)r%rvr��metavarr�r�r�r*r*r+rs"s



z'HelpFormatter._format_action_invocationcsP|jdk	r|j�n.|jdk	r<dd�|jD�}dd�|��n|��fdd�}|S)NcSsg|]}t|��qSr*��str)rZZchoicer*r*r+r]>sz4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdSr-)�
isinstance�tuple)Z
tuple_size��resultr*r+r�Cs
z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr$)r%rv�default_metavarZchoice_strsr�r*r�r+r�:s

z HelpFormatter._metavar_formattercCs�|�||�}|jdkr$d|d�}n�|jtkr<d|d�}n�|jtkrTd|d�}n�|jtkrld|d�}n�|jtkr|d}nt|jtkr�d|d�}n\|jtkr�d	}nLzd
d�t|j�D�}Wnt	k
r�t
d�d�YnXd
�|�||j�}|S)Nr�rSr�z
[%s [%s ...]]r8z%s [%s ...]rz%s ...r^cSsg|]}d�qS)r�r*)rZr�r*r*r+r]\sz.HelpFormatter._format_args.<locals>.<listcomp>zinvalid nargs valuer)r�r�r
rrrrrr��	TypeErrorr�r$)r%rvr�Zget_metavarr�Zformatsr*r*r+r�Js*






zHelpFormatter._format_argscCs�tt|�|jd�}t|�D]}||tkr||=qt|�D] }t||d�r:||j||<q:|�d�dk	r�d�dd�|dD��}||d<|�	|�|S)Nr~rr�rcSsg|]}t|��qSr*r�)rZ�cr*r*r+r]ksz.HelpFormatter._expand_help.<locals>.<listcomp>)
r��varsr>r5r�hasattrrr�r$�_get_help_string)r%rvZparamsr(Zchoices_strr*r*r+r�bszHelpFormatter._expand_helpccs@z
|j}Wntk
rYnX|��|�EdH|��dSr-)�_get_subactions�AttributeErrorrUrV)r%rvZget_subactionsr*r*r+rtos
z'HelpFormatter._iter_indented_subactionscCs&|j�d|���}ddl}|�||�S)Nrr)rMr{r|�textwrapZwrap)r%rfrPr�r*r*r+r�yszHelpFormatter._split_linescCs,|j�d|���}ddl}|j||||d�S)Nrr)Zinitial_indentZsubsequent_indent)rMr{r|r�Zfill)r%rfrPr�r�r*r*r+r��s�zHelpFormatter._fill_textcCs|jSr-)rr�r%rvr*r*r+r��szHelpFormatter._get_help_stringcCs
|j��Sr-)�dest�upperr�r*r*r+r��sz/HelpFormatter._get_default_metavar_for_optionalcCs|jSr-)r�r�r*r*r+r��sz1HelpFormatter._get_default_metavar_for_positional)r8r9N)N) rr2r3r4rQrUrV�objectrGrbrcrdrgrmrxryrar`rhr�rerursr�r�r�rtr�r�r�r�r�r*r*r*r+r�s>�

`g/

c@seZdZdZdd�ZdS)rz�Help message formatter which retains any formatting in descriptions.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cs d��fdd�|jdd�D��S)Nr^c3s|]}�|VqdSr-r*)rZr��r�r*r+�	<genexpr>�sz9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r$�
splitlines)r%rfrPr�r*r�r+r��sz&RawDescriptionHelpFormatter._fill_textN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which retains formatting of all help text.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|��Sr-)r�)r%rfrPr*r*r+r��sz!RawTextHelpFormatter._split_linesN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which adds default values to argument help.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs>|j}d|jkr:|jtk	r:ttg}|js2|j|kr:|d7}|S)Nz
%(default)z (default: %(default)s))rrr�rr
rr�r�)r%rvrrZdefaulting_nargsr*r*r+r��s

z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr2r3r4r�r*r*r*r+r�sc@s eZdZdZdd�Zdd�ZdS)r	aHelp message formatter which uses the argument 'type' as the default
    metavar value (instead of the argument 'dest')

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|jjSr-�rrr�r*r*r+r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjSr-r�r�r*r*r+r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr2r3r4r�r�r*r*r*r+r	�scCsN|dkrdS|jrd�|j�S|jdtfkr2|jS|jdtfkrF|jSdSdS)N�/)r�r$r�rr�)�argumentr*r*r+�_get_action_name�sr�c@s eZdZdZdd�Zdd�ZdS)rz�An error from creating or using an argument (optional or positional).

    The string value of this exception is the message, augmented with
    information about the argument that caused it.
    cCst|�|_||_dSr-)r��
argument_name�message)r%r�r�r*r*r+rQ�s
zArgumentError.__init__cCs(|jdkrd}nd}|t|j|jd�S)Nz%(message)sz'argument %(argument_name)s: %(message)s)r�r�)r�r�r�)r%r�r*r*r+�__str__�s
�zArgumentError.__str__N)rr2r3r4rQr�r*r*r*r+r�sc@seZdZdZdS)rz@An error from trying to convert a command line string to a type.N)rr2r3r4r*r*r*r+r�sc@s,eZdZdZd
dd�Zdd�Zddd	�ZdS)ra\	Information about how to convert command line strings to Python objects.

    Action objects are used by an ArgumentParser to represent the information
    needed to parse a single argument from one or more strings from the
    command line. The keyword arguments to the Action constructor are also
    all attributes of Action instances.

    Keyword Arguments:

        - option_strings -- A list of command-line option strings which
            should be associated with this action.

        - dest -- The name of the attribute to hold the created object(s)

        - nargs -- The number of command-line arguments that should be
            consumed. By default, one argument will be consumed and a single
            value will be produced.  Other values include:
                - N (an integer) consumes N arguments (and produces a list)
                - '?' consumes zero or one arguments
                - '*' consumes zero or more arguments (and produces a list)
                - '+' consumes one or more arguments (and produces a list)
            Note that the difference between the default and nargs=1 is that
            with the default, a single value will be produced, while with
            nargs=1, a list containing a single value will be produced.

        - const -- The value to be produced if the option is specified and the
            option uses an action that takes no values.

        - default -- The value to be produced if the option is not specified.

        - type -- A callable that accepts a single string argument, and
            returns the converted value.  The standard Python types str, int,
            float, and complex are useful examples of such callables.  If None,
            str is used.

        - choices -- A container of values that should be allowed. If not None,
            after a command-line argument has been converted to the appropriate
            type, an exception will be raised if it is not a member of this
            collection.

        - required -- True if the action must always be specified at the
            command line. This is only meaningful for optional command-line
            arguments.

        - help -- The help string describing the argument.

        - metavar -- The name to be used for the option's argument with the
            help string. If None, the 'dest' value will be used as the name.
    NFcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr-�
r�r�r��constr�rr�r�rrr��r%r�r�r�r�r�rr�r�rrr�r*r*r+rQ)szAction.__init__c	s(ddddddddd	g	}�fd
d�|D�S)Nr�r�r�r�r�rr�rrr�csg|]}|t�|�f�qSr*��getattr�rZr(r1r*r+r]Ksz&Action._get_kwargs.<locals>.<listcomp>r*�r%�namesr*r1r+r"?s�zAction._get_kwargscCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr��r%�parser�	namespace�valuesr�r*r*r+�__call__MszAction.__call__)NNNNNFNN)N)rr2r3r4rQr"r�r*r*r*r+r�s5�
cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr�)r�r
�superr�rQr���	__class__r*r+rQSs 
�z_StoreAction.__init__cCst||j|�dSr-)�setattrr�r�r*r*r+r�psz_StoreAction.__call__)NNNNNFNN)N�rr2r3rQr��
__classcell__r*r*r�r+r�Qs�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreConstActionNFc	s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�r�rrr�r�r*r+rQvs
�z_StoreConstAction.__init__cCst||j|j�dSr-)r�r�r�r�r*r*r+r��sz_StoreConstAction.__call__)NFNN)Nr�r*r*r�r+r�ts�r�cseZdZd�fdd�	Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�rrr�r*r+rQ�s
�z_StoreTrueAction.__init__)FFN�rr2r3rQr�r*r*r�r+r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NFr�)r�r�rQr�r�r*r+rQ�s
�z_StoreFalseAction.__init__)TFNr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�
_AppendActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriater�r�)r�r
r�r�rQr�r�r*r+rQ�s 
�z_AppendAction.__init__cCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r r��r%r�r�r�r�r0r*r*r+r��s
z_AppendAction.__call__)NNNNNFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_AppendConstActionNFc
s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�rrr�)r�r�rQr�r�r*r+rQ�s
�z_AppendConstAction.__init__cCs4t||jd�}t|�}|�|j�t||j|�dSr-)r�r�r7r r�r�r�r*r*r+r��sz_AppendConstAction.__call__)NFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�rr)r�r�rQr�r�r*r+rQ�s
�z_CountAction.__init__cCs0t||jd�}|dkrd}t||j|d�dS�NrrS)r�r�r�)r%r�r�r�r��countr*r*r+r��sz_CountAction.__call__)NFN)Nr�r*r*r�r+r��s
�r�cs.eZdZeedf�fdd�	Zddd�Z�ZS)�_HelpActionNcstt|�j|||d|d�dS�Nr)r�r�r�r�rr)r�r�rQ)r%r�r�r�rrr�r*r+rQs
�z_HelpAction.__init__cCs|��|��dSr-)�
print_help�exitr�r*r*r+r�sz_HelpAction.__call__)N�rr2r3rrQr�r�r*r*r�r+r�s
�r�cs0eZdZdeedf�fdd�	Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dSr)r�rrQ�version)r%r�rr�r�rrr�r*r+rQs
�z_VersionAction.__init__cCsD|j}|dkr|j}|��}|�|�|�|��tj�|��dSr-)r�_get_formatterrg�_print_messagera�_sys�stdoutr)r%r�r�r�r�rrWr*r*r+r�(s
z_VersionAction.__call__)Nrr*r*r�r+rs�rcsPeZdZGdd�de�Zedddf�fdd�	Zdd�Zd	d
�Zd
dd�Z	�Z
S)�_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|dd�|�7}ttj|�}|jg|||d�dS)Nr�r)r�r�rrr�)r$r�r
�_ChoicesPseudoActionrQ)r%r(�aliasesrrr�r�Zsupr�r*r+rQ6s
�z/_SubParsersAction._ChoicesPseudoAction.__init__r�r*r*r�r+r4srFNc	s<||_||_i|_g|_tt|�j||t|j|||d�dS)N)r�r�r�r�r�rrr�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr�r
rQr)r%r�rO�parser_classr�r�rrr�r�r*r+rQ>s	
�z_SubParsersAction.__init__cKs�|�d�dkr d|j|f|d<|�dd�}d|krX|�d�}|�|||�}|j�|�|jf|�}||j|<|D]}||j|<qr|S)NrOr�rr*rr)r�r
r�rrr rr)r%r(�kwargsrrrZ
choice_actionr��aliasr*r*r+�
add_parserUs

z_SubParsersAction.add_parsercCs|jSr-)rr1r*r*r+r�lsz!_SubParsersAction._get_subactionscCs�|d}|dd�}|jtk	r,t||j|�z|j|}Wn<tk
rv|d�|j�d�}td�|}t||��YnX|�|d�\}	}t	|	��
�D]\}
}t||
|�q�|r�t	|��tg�t
|t��|�dS)NrrSr)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr�r�KeyErrorr$r�r�parse_known_argsr�r0�
setdefault�_UNRECOGNIZED_ARGS_ATTRr�r�)r%r�r�r�r�rr&r\�msgZsubnamespace�keyr)r*r*r+r�os$

�	z_SubParsersAction.__call__)N)rr2r3rrrrQrr�r�r�r*r*r�r+r
2s�r
c@seZdZddd�ZdS)�
_ExtendActionNcCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r�r�r�r*r*r+r��s
z_ExtendAction.__call__)N)rr2r3r�r*r*r*r+r�src@s*eZdZdZddd�Zdd�Zd	d
�ZdS)ra�Factory for creating file object types

    Instances of FileType are typically passed as type= arguments to the
    ArgumentParser add_argument() method.

    Keyword Arguments:
        - mode -- A string indicating how the file is to be opened. Accepts the
            same values as the builtin open() function.
        - bufsize -- The file's desired buffer size. Accepts the same values as
            the builtin open() function.
        - encoding -- The file's encoding. Accepts the same values as the
            builtin open() function.
        - errors -- A string indicating how encoding and decoding errors are to
            be handled. Accepts the same value as the builtin open() function.
    �rr�NcCs||_||_||_||_dSr-)�_mode�_bufsize�	_encoding�_errors)r%�mode�bufsize�encoding�errorsr*r*r+rQ�szFileType.__init__c
Cs�|dkr>d|jkrtjSd|jkr(tjStd�|j}t|��zt||j|j|j|j	�WSt
k
r�}z"||d�}td�}t||��W5d}~XYnXdS)N�-r�wzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)rr�stdinr	r�r�r�rr r!�OSErrorr)r%�stringr�er\r�r*r*r+r��s

�
zFileType.__call__cCsT|j|jf}d|jfd|jfg}d�dd�|D�dd�|D��}dt|�j|fS)Nr$r%rcSsg|]}|dkrt|��qS)r�)r!)rZr'r*r*r+r]�sz%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|dk	rd||f�qS)Nrr*)rZ�kwr'r*r*r+r]�s�r)rrr r!r$rr)r%r\rZargs_strr*r*r+r,�s�zFileType.__repr__)rr�NN)rr2r3r4rQr�r,r*r*r*r+r�s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r
z�Simple object for storing attributes.

    Implements equality by attribute names and values, and provides a simple
    string representation.
    cKs|D]}t||||�qdSr-)r�)r%rr(r*r*r+rQ�szNamespace.__init__cCst|t�stSt|�t|�kSr-)r�r
�NotImplementedr�)r%�otherr*r*r+�__eq__�s
zNamespace.__eq__cCs
||jkSr-)r/)r%rr*r*r+�__contains__�szNamespace.__contains__N)rr2r3r4rQr1r2r*r*r*r+r
�scs�eZdZ�fdd�Zdd�Zd&dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|���||_||_||_||_i|_|�ddt	�|�ddt	�|�ddt
�|�ddt�|�ddt�|�ddt
�|�ddt�|�ddt�|�dd	t�|�dd
t�|�ddt�|�ddt�|��g|_i|_g|_g|_i|_t�d
�|_g|_dS)NrvZstoreZstore_const�
store_trueZstore_falser Zappend_constr�rrr�parsersr�z^-\d+$|^-\d*\.\d+$)r�r3rQ�description�argument_default�prefix_chars�conflict_handler�_registries�registerr�r�r�r�r�r�r�r�rr
r�_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrJrK�_negative_number_matcher�_has_negative_number_optionals)r%r6r8r7r9r�r*r+rQ�s4z_ActionsContainer.__init__cCs|j�|i�}|||<dSr-)r:r)r%�
registry_namer)r��registryr*r*r+r;sz_ActionsContainer.registerNcCs|j|�||�Sr-)r:r�)r%rDr)r�r*r*r+�
_registry_get sz_ActionsContainer._registry_getcKs2|j�|�|jD]}|j|kr||j|_qdSr-)rA�updater=r�r�)r%rrvr*r*r+�set_defaults&s

z_ActionsContainer.set_defaultscCs8|jD]"}|j|kr|jdk	r|jSq|j�|d�Sr-)r=r�r�rAr�)r%r�rvr*r*r+�get_default/s
z_ActionsContainer.get_defaultcOsD|j}|r&t|�dkrH|dd|krH|r:d|kr:td��|j||�}n|j||�}d|kr�|d}||jkr~|j||d<n|jdk	r�|j|d<|�|�}t|�s�td|f��|f|�}|�	d|j
|j
�}t|�s�td	|f��|tkr�td
|f��t|d��r:z|�
��|d�Wntk
�r8td��YnX|�|�S)
z�
        add_argument(dest, ..., name=value, ...)
        add_argument(option_string, option_string, ..., name=value, ...)
        rSrr�z+dest supplied twice for positional argumentr�Nzunknown action "%s"r�%r is not callablez<%r is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargs)r8ror��_get_positional_kwargs�_get_optional_kwargsrAr7�_pop_action_class�callablerFrrr�rr�r��_add_action)r%r\r�charsr�Zaction_classrv�	type_funcr*r*r+rx9s:	 




�z_ActionsContainer.add_argumentcOs t|f|�|�}|j�|�|Sr-)�_ArgumentGroupr?r )r%r\rr�r*r*r+�add_argument_grouplsz$_ActionsContainer.add_argument_groupcKst|f|�}|j�|�|Sr-)�_MutuallyExclusiveGroupr@r )r%rr�r*r*r+�add_mutually_exclusive_groupqsz._ActionsContainer.add_mutually_exclusive_groupcCs`|�|�|j�|�||_|jD]}||j|<q"|jD]"}|j�|�r8|js8|j�d�q8|S)NT)	�_check_conflictr=r �	containerr�r>rB�matchrC)r%rvr�r*r*r+rOvs


z_ActionsContainer._add_actioncCs|j�|�dSr-)r=�remover�r*r*r+�_remove_action�sz _ActionsContainer._remove_actioncCs�i}|jD].}|j|kr.td�}t||j��|||j<q
i}|jD]D}|j|krn|j|j|j|jd�||j<|jD]}||j||<qtqD|jD]&}|j	|j
d�}|jD]}|||<q�q�|jD]}|�||��
|�q�dS)Nz.cannot merge actions - two groups are named %r)�titler6r9)r�)r?r[r�r�rSr6r9r�r@rUr�r=r�rO)r%rWZtitle_group_mapr�rZ	group_maprv�mutex_groupr*r*r+�_add_container_actions�s0



�

�

z(_ActionsContainer._add_container_actionscKs^d|krtd�}t|��|�d�ttfkr2d|d<|�d�tkrPd|krPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r�r�)r�r�r�r
rr�)r%r�rrr*r*r+rK�sz(_ActionsContainer._get_positional_kwargsc	Os�g}g}|D]n}|d|jkr>||jd�}td�}t||��|�|�|d|jkrt|�dkr|d|jkr|�|�q|�dd�}|dkr�|r�|d}n|d}|�|j�}|s�td�}t||��|�dd�}t|||d	�S)
Nr)�optionr8zNinvalid option string %(option)r: must start with a character %(prefix_chars)rrSr�z%dest= is required for options like %rr&r�r^)	r8r�r�r ror��lstrip�replacer�)	r%r\rr�Zlong_option_stringsr�rr�Zdest_option_stringr*r*r+rL�s2�

z&_ActionsContainer._get_optional_kwargscCs|�d|�}|�d||�S)Nrv)r�rF)r%rr�rvr*r*r+rM�sz#_ActionsContainer._pop_action_classcCsFd|j}zt||�WStk
r@td�}t||j��YnXdS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r9r�r�r�r�)r%Zhandler_func_namerr*r*r+r<�s
z_ActionsContainer._get_handlercCsLg}|jD]&}||jkr
|j|}|�||f�q
|rH|��}|||�dSr-)r�r>r r<)r%rvZconfl_optionalsr�Zconfl_optionalr9r*r*r+rV�s


z!_ActionsContainer._check_conflictcCs6tddt|��}d�dd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %srcSsg|]\}}|�qSr*r*)rZr�rvr*r*r+r]	s�z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rror$r)r%rv�conflicting_actionsr�Zconflict_stringr*r*r+�_handle_conflict_errors�
�z(_ActionsContainer._handle_conflict_errorcCs>|D]4\}}|j�|�|j�|d�|js|j�|�qdSr-)r�rYr>r�rWrZ)r%rvrbr�r*r*r+�_handle_conflict_resolves
z*_ActionsContainer._handle_conflict_resolve)N)N)rr2r3rQr;rFrHrIrxrSrUrOrZr]rKrLrMr<rVrcrdr�r*r*r�r+r3�s$5
	
3($
		r3cs6eZdZd�fdd�	Z�fdd�Z�fdd�Z�ZS)	rRNcs�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)Nr9r8r7r6)rr9r8r7r�rRrQr[r�r:r=r>rArCr@)r%rWr[r6rrGZ
super_initr�r*r+rQs�z_ArgumentGroup.__init__cs tt|��|�}|j�|�|Sr-)r�rRrOr�r r�r�r*r+rO5sz_ArgumentGroup._add_actioncs tt|��|�|j�|�dSr-)r�rRrZr�rYr�r�r*r+rZ:sz_ArgumentGroup._remove_action)NN�rr2r3rQrOrZr�r*r*r�r+rRsrRcs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	rTFcs tt|��|�||_||_dSr-)r�rTrQr��
_container)r%rWr�r�r*r+rQAsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|j�|�}|j�|�|S)Nz-mutually exclusive arguments must be optional)r�r�r�rfrOr�r )r%rvrr*r*r+rOFsz#_MutuallyExclusiveGroup._add_actioncCs|j�|�|j�|�dSr-)rfrZr�rYr�r*r*r+rZNsz&_MutuallyExclusiveGroup._remove_action)Frer*r*r�r+rT?srTcs*eZdZdZddddgeddddddf�fdd�	Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dAdd�ZdBdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdCd&d'�ZdDd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEd6d7�ZdFd8d9�ZdGd:d;�ZdHd=d>�Z d?d@�Z!�Z"S)Ira�Object for parsing command line strings into Python objects.

    Keyword Arguments:
        - prog -- The name of the program (default: sys.argv[0])
        - usage -- A usage message (default: auto-generated from arguments)
        - description -- A description of what the program does
        - epilog -- Text following the argument descriptions
        - parents -- Parsers whose arguments should be copied into this one
        - formatter_class -- HelpFormatter class for printing help messages
        - prefix_chars -- Characters that prefix optional arguments
        - fromfile_prefix_chars -- Characters that prefix files containing
            additional arguments
        - argument_default -- The default value for all arguments
        - conflict_handler -- String indicating how to handle conflicts
        - add_help -- Add a -h/-help option
        - allow_abbrev -- Allow long options to be abbreviated unambiguously
    Nr&r)Tc
	s"tt|�j}
|
|||	|
d�|dkr6tj�tjd�}||_||_	||_
||_||_||_
||_|j}|td��|_|td��|_d|_dd�}|�dd|�d|kr�dn|d}|j
r�|j|d	|d
ddttd�d
�|D]<}|�|�z
|j}Wntk
�rYq�X|j�|�q�dS)N)r6r8r7r9rzpositional argumentszoptional argumentscSs|Sr-r*)r,r*r*r+�identity�sz)ArgumentParser.__init__.<locals>.identityrr&�hr8rrzshow this help message and exit)rvr�rr)r�rrQ�_os�path�basenamer�argvrOri�epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrevrSr��_positionals�
_optionals�_subparsersr;rxrr]rAr�rG)r%rOrir6rm�parentsrnr8ror7r9rprqZ	superinitZ	add_grouprgZdefault_prefixrX�defaultsr�r*r+rQfsJ�
�

zArgumentParser.__init__cs"ddddddg}�fdd�|D�S)	NrOrir6rnr9rpcsg|]}|t�|�f�qSr*r�r�r1r*r+r]�sz.ArgumentParser._get_kwargs.<locals>.<listcomp>r*r�r*r1r+r"�s�zArgumentParser._get_kwargsc	Ks�|jdk	r|�td��|�dt|��d|ks8d|krht|�dd��}t|�dd��}|�||�|_n|j|_|�d�dkr�|�	�}|�
�}|j}|�|j
||d�|����|d<|�|d�}|fd	gi|��}|j�|�|S)
Nz(cannot have multiple subparser argumentsrr[r6ZsubcommandsrOr^r5r�)rtr)r�rrr�rSrrr�r�_get_positional_actionsr@rmrirar|rMrO)	r%rr[r6rWr�rkZ
parsers_classrvr*r*r+�add_subparsers�s$
zArgumentParser.add_subparserscCs$|jr|j�|�n|j�|�|Sr-)r�rsrOrrr�r*r*r+rO�szArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr*�r��rZrvr*r*r+r]�s�z8ArgumentParser._get_optional_actions.<locals>.<listcomp>�r=r1r*r*r+�_get_optional_actions�s�z$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr*ryrzr*r*r+r]�s�z:ArgumentParser._get_positional_actions.<locals>.<listcomp>r{r1r*r*r+rw�s�z&ArgumentParser._get_positional_actionscCs4|�||�\}}|r0td�}|�|d�|��|S�Nzunrecognized arguments: %sr)rr�r)r$�r%r\r�rlrr*r*r+�
parse_args�s
zArgumentParser.parse_argscCs|dkrtjdd�}nt|�}|dkr.t�}|jD]4}|jtk	r4t||j�s4|jtk	r4t	||j|j�q4|j
D] }t||�spt	|||j
|�qpz>|�||�\}}t|t�r�|�
t|t��t|t�||fWStk
�rt��d}|�t|��YnXdSrR)rrlr5r
r=r�rr�r�r�rA�_parse_known_argsrr�r��delattrr�exc_infor)r�)r%r\r�rvr��errr*r*r+r�s,







zArgumentParser.parse_known_argscs�	jdk	r�	����i��	jD]R}|j}t|j�D]<\}}��|g�}|�|d|��|�||dd��q2qi�g}t��}	t|	�D]^\}}
|
dkr�|�d�|	D]}
|�d�q�q��	�	|
�}|dkr�d}n|�|<d}|�|�q�d�
|��t��t��d�����	fdd�	������	�fd	d
�}
�	�������	�fdd�}g�d
�
��r`t
��}nd}�
|k�r�t�
fdd��D��}�
|k�r�|�
�}|�
k�r�|�
�qdn|�
�
�k�r҈�
|�}��|�|�
|
�
��
�qd|�
�}���|d��g}�	jD]|}|�k�r|j�r(|�t|��nT|jdk	�rt|jt��rt�|j��r|jt�|j�k�rt�|j�	�||j���q|�r��	�td�d�
|���	jD]X}|j�r�|jD]}|�k�r��q��q�dd�|jD�}td�}�	�|d�
|���q���fS)NrS�--r&�A�Or^cs|��|���||�}||jk	rb��|���|g�D]*}|�kr6td�}t|�}t|||��q6|tk	rx|��||�dS)Nznot allowed with argument %s)r��_get_valuesr�r�r�r�rr)rvZargument_stringsr�Zargument_valuesZconflict_actionrZaction_name)�action_conflictsr��seen_actions�seen_non_default_actionsr%r*r+�take_action@s


z5ArgumentParser._parse_known_args.<locals>.take_actioncs~�|}|\}}}�j}g}|dkr:���|�|dS|dk	�r||d�}�j}|dkr�|d|kr�|�|g|f�|d}	|	|d}|dd�p�d}
�j}||kr�||}|
}ntd�}t|||��nB|dkr�|d}
|g}|�|||f��q\ntd�}t|||��q|d}�|d�}|||�}||}
�||
�}|�|||f��q\q|D]\}}}�|||��q`|
S)NrSr�rzignored explicit argument %r)�_match_argumentr r8r>r�r)�start_index�option_tuplervr��explicit_argZmatch_argumentZ
action_tuples�	arg_countrP�charZnew_explicit_argZ
optionals_mapr�stopr\r�Zselected_patterns)r&�arg_strings_pattern�extras�option_string_indicesr%r�r*r+�consume_optionalUsL



z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsn�j}�|d�}|�|�}t�|�D]*\}}�|||�}||7}�||�q&�t|�d��dd�<|Sr-)�_match_arguments_partial�zipro)r�Z
match_partialZselected_patternZ
arg_countsrvr�r\)r&r�r�r%r�r*r+�consume_positionals�s
z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrr�csg|]}|�kr|�qSr*r*)rZr�)r�r*r+r]�s�z4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %srcSsg|]}|jtk	rt|��qSr*)rrrr�rzr*r*r+r]�s
�z#one of the arguments %s is requiredr)N)ro�_read_args_from_filesr@r�r�rr��iterr �_parse_optionalr$r�rwrAr@r=r�r�r�r�r�r�r�r�r��
_get_valuer)r�)r%r&r�r\r�r�Zmutex_actionZ	conflictsZarg_string_pattern_partsZarg_strings_iter�
arg_stringr��patternr�r�Zmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ
stop_indexZrequired_actionsrvr�r�rr*)r�r&r�r�r�r�r�r�r�r%r�r�r+r�s�





J

�






�
���
�



�z ArgumentParser._parse_known_argsc
Cs�g}|D]�}|r|d|jkr*|�|�qzdt|dd���J}g}|����D]}|�|�D]}|�|�q\qN|�|�}|�|�W5QRXWqtk
r�t	�
�d}|�t|��YqXq|Sr�)
ror r��readr��convert_arg_line_to_argsr�r�r+rr�r)r�)r%r&Znew_arg_stringsr�Z	args_file�arg_liner'r�r*r*r+r�s 
z$ArgumentParser._read_args_from_filescCs|gSr-r*)r%r�r*r*r+r�!sz'ArgumentParser.convert_arg_line_to_argscCsz|�|�}t�||�}|dkrldtd�ttd�ttd�i}|�|j�}|dkrbtdd|j�|j}t	||��t
|�d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrS)�_get_nargs_patternrJrXr�r
rr�r�rrror�)r%rvr��
nargs_patternrXZnargs_errorsrr*r*r+r�$s(
���
zArgumentParser._match_argumentcsrg}tt|�dd�D]X}|d|�}d��fdd�|D��}t�||�}|dk	r|�dd�|��D��qnq|S)Nrr�r^csg|]}��|��qSr*)r�rzr1r*r+r]@s�z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|]}t|��qSr*rn)rZr,r*r*r+r]Ds)r�ror$rJrXr�rk)r%rjr�r�r�Z
actions_slicer�rXr*r1r+r�:s�z'ArgumentParser._match_arguments_partialc
Cs|sdS|d|jkrdS||jkr8|j|}||dfSt|�dkrHdSd|kr~|�dd�\}}||jkr~|j|}|||fS|�|�}t|�dkr�d�dd�|D��}||d�}td�}|�||�nt|�dkr�|\}	|	S|j�	|�r�|j
s�dSd	|k�rdSd|dfS)
NrrS�=rcSsg|]\}}}|�qSr*r*)rZrvr�r�r*r*r+r]is�z2ArgumentParser._parse_optional.<locals>.<listcomp>)r_Zmatchesz4ambiguous option: %(option)s could match %(matches)sr)r8r>ro�split�_get_option_tuplesr$r�r)rBrXrC)
r%r�rvr�r�Z
option_tuplesZoptionsr\rr�r*r*r+r�Js>







�

zArgumentParser._parse_optionalc
Cs0g}|j}|d|kr�|d|kr�|jr~d|krB|�dd�\}}n|}d}|jD],}|�|�rP|j|}|||f}|�|�qPn�|d|k�r|d|k�r|}d}|dd�}|dd�}	|jD]T}||kr�|j|}|||	f}|�|�q�|�|�r�|j|}|||f}|�|�q�n|�td�|�|S)NrrSr�r8zunexpected option string: %s)r8rqr�r>�
startswithr r)r�)
r%r�r�rPZ
option_prefixr�rvr�Zshort_option_prefixZshort_explicit_argr*r*r+r��s:









z!ArgumentParser._get_option_tuplescCs�|j}|dkrd}nf|tkr"d}nX|tkr0d}nJ|tkr>d}n<|tkrLd}n.|tkrZd}n |tkrhd}ndd	�d
|�}|jr�|�	d	d�}|�	dd�}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�r^r&)
r�r
rrrrrr$r�ra)r%rvr�r�r*r*r+r��s(z!ArgumentParser._get_nargs_patterncCs4|�||�\}}|r0td�}|�|d�|��|Sr})�parse_known_intermixed_argsr�r)r$r~r*r*r+�parse_intermixed_args�s
z$ArgumentParser.parse_intermixed_argsc	s�|���dd��D�}|r,td|dj���fdd�|jD�rHtd���zN|j}z�|jdkrp|��dd�|_�D] }|j|_t	|_|j|_t	|_qt|�
||�\}}�D]J}t||j�r�t
||j�gkr�ddlm}|d	|j|f�t||j�q�W5�D]}|j|_|j|_q�X|��}zJ|D]}|j|_d
|_�q$|jD]}	|	j|	_d
|	_�q@|�
||�\}}
W5|D]}|j|_�qn|jD]}	|	j|	_�q�XW5||_X||
fS)NcSsg|]}|jttfkr|�qSr*)r�rrrzr*r*r+r]�s�z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>z3parse_intermixed_args: positional arg with nargs=%srcs&g|]}|jD]}|�kr|j�qqSr*)r�r�)rZr�rv�r�r*r+r]�s
�z;parse_intermixed_args: positional in mutuallyExclusiveGroup�)�warnzDo not expect %s in %sF)rwr�r�r@riZ
save_nargsZsave_defaultr��format_usagerrr�r�r��warningsr�r�r|Z
save_requiredr�)r%r\r��aZ
save_usagervZremaining_argsr�r�r�r�r*r�r+r��s`
�
��


�
z*ArgumentParser.parse_known_intermixed_argscs��jttfkr2z|�d�Wntk
r0YnX|sz�jtkrz�jrN�j}n�j}t	|t
�rv���|�}���|��n|s��jt
kr��js��jdk	r��j}n|}���|�n�t|�dkr�jdtfkr�|\}���|�}���|�n��jtk�r��fdd�|D�}np�jtk�r@��fdd�|D�}���|d�n>�jtk�rRt}n,��fdd�|D�}|D]}���|��qj|S)Nr�rScsg|]}���|��qSr*�r��rZ�v�rvr%r*r+r]Z	sz.ArgumentParser._get_values.<locals>.<listcomp>csg|]}���|��qSr*r�r�r�r*r+r]^	srcsg|]}���|��qSr*r�r�r�r*r+r]g	s)r�rrrYr�r
r�r�r�r�r�r��_check_valuerror)r%rvr&r)r�r�r*r�r+r�6	sD
�
zArgumentParser._get_valuesc	Cs�|�d|j|j�}t|�s0td�}t|||��z||�}Wn�tk
r~t|jdt|j��}tt	�
�d�}t||��YnLttfk
r�t|jdt|j��}||d�}td�}t|||��YnX|S)NrrJrrS)rr)z!invalid %(type)s value: %(value)r)
rFrrNr�rrr�r!r�rr�r�r�)r%rvr�rQrr�r(r\r*r*r+r�n	s 
zArgumentParser._get_valuecCsF|jdk	rB||jkrB|d�tt|j��d�}td�}t|||��dS)Nr)r)r�z3invalid choice: %(value)r (choose from %(choices)s))r�r$�mapr!r�r)r%rvr)r\rr*r*r+r��	s�zArgumentParser._check_valuecCs$|��}|�|j|j|j�|��Sr-)rrmrir=r@ra)r%rWr*r*r+r��	s
�zArgumentParser.format_usagecCst|��}|�|j|j|j�|�|j�|jD]0}|�|j	�|�|j�|�
|j�|��q.|�|j
�|��Sr-)rrmrir=r@rgr6r?rcr[ryr�rdrmra)r%rWZaction_groupr*r*r+ra�	s�

zArgumentParser.format_helpcCs|j|jd�S)Nr~)rnrOr1r*r*r+r�	szArgumentParser._get_formattercCs"|dkrtj}|�|��|�dSr-)rr	rr��r%�filer*r*r+�print_usage�	szArgumentParser.print_usagecCs"|dkrtj}|�|��|�dSr-)rr	rrar�r*r*r+r�	szArgumentParser.print_helpcCs |r|dkrtj}|�|�dSr-)r�stderr�write)r%r�r�r*r*r+r�	szArgumentParser._print_messagercCs |r|�|tj�t�|�dSr-)rrr�r)r%Zstatusr�r*r*r+r�	szArgumentParser.exitcCs0|�tj�|j|d�}|�dtd�|�dS)z�error(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        )rOr�r8z%(prog)s: error: %(message)s
N)r�rr�rOrr�)r%r�r\r*r*r+r)�	s	zArgumentParser.error)NN)NN)NN)NN)N)N)N)rN)#rr2r3r4rrQr"rxrOr|rwrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�rarr�rrrr)r�r*r*r�r+rSsV�@

#w:-1

M8


	
)3r4�__version__�__all__�osri�rerJZshutilr;�sysrrr�rrr
rrrrrr�rr7rrrrr	r��	Exceptionrrrr�r�r�r�r�r�r�r�rr
rrr
r3rRrTrr*r*r*r+�<module>s�=�z
	[#&]7:"wave.cpython-38.pyc000064400000043347151450073350010154 0ustar00U

e5d6G�@s�dZddlZdddddgZGdd�de�Zd	Zd
ZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZe
d
d�ZGdd�d�ZGdd�d�Zddd�Zddd�ZdS)a%
Stuff to parse WAVE files.

Usage.

Reading WAVE files:
      f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
      getnchannels()  -- returns number of audio channels (1 for
                         mono, 2 for stereo)
      getsampwidth()  -- returns sample width in bytes
      getframerate()  -- returns sampling frequency
      getnframes()    -- returns number of audio frames
      getcomptype()   -- returns compression type ('NONE' for linear samples)
      getcompname()   -- returns human-readable version of
                         compression type ('not compressed' linear samples)
      getparams()     -- returns a namedtuple consisting of all of the
                         above in the above order
      getmarkers()    -- returns None (for compatibility with the
                         aifc module)
      getmark(id)     -- raises an error since the mark does not
                         exist (for compatibility with the aifc module)
      readframes(n)   -- returns at most n frames of audio
      rewind()        -- rewind to the beginning of the audio stream
      setpos(pos)     -- seek to the specified position
      tell()          -- return the current position
      close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing WAVE files:
      f = wave.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
      setnchannels(n) -- set the number of channels
      setsampwidth(n) -- set the sample width
      setframerate(n) -- set the frame rate
      setnframes(n)   -- set the number of frames
      setcomptype(type, name)
                      -- set the compression type and the
                         human-readable compression type
      setparams(tuple)
                      -- set all parameters at once
      tell()          -- return current position in output file
      writeframesraw(data)
                      -- write audio frames without patching up the
                         file header
      writeframes(data)
                      -- write audio frames and patch up the file header
      close()         -- patch up the file header and close the
                         output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�N�open�openfp�Error�	Wave_read�
Wave_writec@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/wave.pyrNs�)N�b�hN�i)�Chunk)�
namedtuple�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,S)-raPVariables used in this class:

    These variables are available to the user though appropriate
    methods of this class:
    _file -- the open file with methods read(), close(), and seek()
              set through the __init__() method
    _nchannels -- the number of audio channels
              available through the getnchannels() method
    _nframes -- the number of audio frames
              available through the getnframes() method
    _sampwidth -- the number of bytes per audio sample
              available through the getsampwidth() method
    _framerate -- the sampling frequency
              available through the getframerate() method
    _comptype -- the AIFF-C compression type ('NONE' if AIFF)
              available through the getcomptype() method
    _compname -- the human-readable AIFF-C compression type
              available through the getcomptype() method
    _soundpos -- the position in the audio stream
              available through the tell() method, set through the
              setpos() method

    These variables are used internally only:
    _fmt_chunk_read -- 1 iff the FMT chunk has been read
    _data_seek_needed -- 1 iff positioned correctly in audio
              file for readframes()
    _data_chunk -- instantiation of a chunk class for the DATA chunk
    _framesize -- size of one frame in the file
    cCs�d|_d|_t|dd�|_|j��dkr0td��|j�d�dkrHtd��d|_d|_d|_	zt|jdd�}Wnt
k
r�Yq�YnX|��}|d	kr�|�|�d|_n2|d
kr�|js�td��||_|j|j
|_d|_	q�|��qT|jr�|js�td��dS)
Nr)Z	bigendian�RIFFz file does not start with RIFF id��WAVEznot a WAVE filer�fmt �datazdata chunk before fmt chunkz#fmt chunk and/or data chunk missing)�_convert�	_soundposr�_fileZgetnamer�readZ_fmt_chunk_read�_data_chunk�_data_seek_needed�EOFError�_read_fmt_chunkZ	chunksize�
_framesize�_nframes�skip)�self�file�chunkZ	chunknamer
r
r�initfp~s8


zWave_read.initfpcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�rb��_i_opened_the_file�
isinstance�str�builtinsrr&�close�r#�fr
r
r�__init__�s
zWave_read.__init__cCs|��dS�N�r-�r#r
r
r�__del__�szWave_read.__del__cCs|Sr1r
r3r
r
r�	__enter__�szWave_read.__enter__cGs|��dSr1r2�r#�argsr
r
r�__exit__�szWave_read.__exit__cCs|jSr1)rr3r
r
r�getfp�szWave_read.getfpcCsd|_d|_dS)Nrr)rrr3r
r
r�rewind�szWave_read.rewindcCs"d|_|j}|rd|_|��dSr1)rr)r-�r#r$r
r
rr-�s
zWave_read.closecCs|jSr1)rr3r
r
r�tell�szWave_read.tellcCs|jSr1)�
_nchannelsr3r
r
r�getnchannels�szWave_read.getnchannelscCs|jSr1)r!r3r
r
r�
getnframes�szWave_read.getnframescCs|jSr1)�
_sampwidthr3r
r
r�getsampwidth�szWave_read.getsampwidthcCs|jSr1)�
_framerater3r
r
r�getframerate�szWave_read.getframeratecCs|jSr1��	_comptyper3r
r
r�getcomptype�szWave_read.getcomptypecCs|jSr1��	_compnamer3r
r
r�getcompname�szWave_read.getcompnamecCs*t|��|��|��|��|��|���Sr1)rr>rArCr?rFrIr3r
r
r�	getparams�s�zWave_read.getparamscCsdSr1r
r3r
r
r�
getmarkers�szWave_read.getmarkerscCstd��dS�Nzno marks�r�r#�idr
r
r�getmark�szWave_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)r!rrr)r#�posr
r
r�setpos�szWave_read.setposcCs�|jr8|j�dd�|j|j}|r2|j�|d�d|_|dkrDdS|j�||j�}|jdkrxtjdkrxt	�
||j�}|jr�|r�|�|�}|jt|�|j
|j|_|S)Nr�r�big)rr�seekrr rr@�sys�	byteorder�audioop�byteswapr�lenr=)r#�nframesrQ�datar
r
r�
readframes�s

zWave_read.readframescCs�z$t�d|�d��\}|_|_}}Wntjk
r@td�YnX|tkr�zt�d|�d��d}Wntjk
r�td�YnX|dd|_|js�t	d��nt	d	|f��|js�t	d
��|j|j|_
d|_d|_dS)
Nz<HHLLH�z<H�r���bad sample widthzunknown format: %r�bad # of channels�NONEznot compressed)
�structZunpack_fromrr=rB�errorr�WAVE_FORMAT_PCMr@rr rErH)r#r%Z
wFormatTagZdwAvgBytesPerSecZwBlockAlign�	sampwidthr
r
rr�s$$
zWave_read._read_fmt_chunkN)rrr	�__doc__r&r0r4r5r8r9r:r-r<r>r?rArCrFrIrJrKrPrRr]rr
r
r
rr_s,
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:S);ra�Variables used in this class:

    These variables are user settable through appropriate methods
    of this class:
    _file -- the open file with methods write(), close(), tell(), seek()
              set through the __init__() method
    _comptype -- the AIFF-C compression type ('NONE' in AIFF)
              set through the setcomptype() or setparams() method
    _compname -- the human-readable AIFF-C compression type
              set through the setcomptype() or setparams() method
    _nchannels -- the number of audio channels
              set through the setnchannels() or setparams() method
    _sampwidth -- the number of bytes per audio sample
              set through the setsampwidth() or setparams() method
    _framerate -- the sampling frequency
              set through the setframerate() or setparams() method
    _nframes -- the number of audio frames written to the header
              set through the setnframes() or setparams() method

    These variables are used internally only:
    _datalength -- the size of the audio samples written to the header
    _nframeswritten -- the number of frames actually written
    _datawritten -- the size of the audio samples actually written
    cCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�wbr(r.r
r
rr0.s
zWave_write.__init__cCs@||_d|_d|_d|_d|_d|_d|_d|_d|_d|_	dS)NrF)
rrr=r@rBr!�_nframeswritten�_datawritten�_datalength�_headerwrittenr;r
r
rr&:szWave_write.initfpcCs|��dSr1r2r3r
r
rr4FszWave_write.__del__cCs|Sr1r
r3r
r
rr5IszWave_write.__enter__cGs|��dSr1r2r6r
r
rr8LszWave_write.__exit__cCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to writerrc)rlrr=)r#�	nchannelsr
r
r�setnchannelsRs
zWave_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)r=rr3r
r
rr>YszWave_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nrorrrb)rlrr@)r#rhr
r
r�setsampwidth^s
zWave_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)r@rr3r
r
rrAeszWave_write.getsampwidthcCs0|jrtd��|dkrtd��tt|��|_dS)Nrorzbad frame rate)rlr�int�roundrB)r#�	framerater
r
r�setframeratejs
zWave_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rBrr3r
r
rrCqszWave_write.getframeratecCs|jrtd��||_dS�Nro)rlrr!)r#r[r
r
r�
setnframesvszWave_write.setnframescCs|jSr1�rkr3r
r
rr?{szWave_write.getnframescCs.|jrtd��|dkrtd��||_||_dS)Nro)rdzunsupported compression type)rlrrErH)r#�comptype�compnamer
r
r�setcomptype~szWave_write.setcomptypecCs|jSr1rDr3r
r
rrF�szWave_write.getcomptypecCs|jSr1rGr3r
r
rrI�szWave_write.getcompnamecCsV|\}}}}}}|jrtd��|�|�|�|�|�|�|�|�|�||�dSrw)rlrrqrrrvrxr|)r#Zparamsrprhrur[rzr{r
r
r�	setparams�s



zWave_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)r=r@rBrrr!rErHr3r
r
rrJ�s�zWave_write.getparamscCstd��dS)Nzsetmark() not supportedrM)r#rOrQ�namer
r
r�setmark�szWave_write.setmarkcCstd��dSrLrMrNr
r
rrP�szWave_write.getmarkcCsdSr1r
r3r
r
rrK�szWave_write.getmarkerscCs|jSr1ryr3r
r
rr<�szWave_write.tellcCs�t|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|jdkrpt
jdkrpt�
||j�}|j�|�|jt|�7_|j||_dS)N�BrrT)r*�bytes�	bytearray�
memoryview�cast�_ensure_header_writtenrZr@r=rrVrWrXrYr�writerlrk)r#r\r[r
r
r�writeframesraw�s
zWave_write.writeframesrawcCs"|�|�|j|jkr|��dSr1)r�rmrl�_patchheader)r#r\r
r
r�writeframes�s
zWave_write.writeframescCsXz2|jr0|�d�|j|jkr&|��|j��W5d|_|j}|rRd|_|��XdS)Nr)rr)r-r�rmrlr��flushr;r
r
rr-�s
zWave_write.closecCs>|js:|jstd��|js"td��|js0td��|�|�dS)Nz# channels not specifiedzsample width not specifiedzsampling rate not specified)rnr=rr@rB�
_write_header)r#Zdatasizer
r
rr��sz!Wave_write._ensure_header_writtencCs�|jr
t�|j�d�|js.||j|j|_|j|j|j|_z|j��|_	Wnt
tfk
rpd|_	YnX|j�t�
dd|jdddt|j|j|j|j|j|j|j|jdd��|j	dk	r�|j��|_|j�t�
d	|j��d
|_dS)Nrz<L4s4sLHHLLHH4s�$rr�rar�<LT)rn�AssertionErrorrr�r!r=r@rmr<�_form_length_pos�AttributeError�OSErrorre�packrgrB�_data_length_pos)r#Z
initlengthr
r
rr��s4

�
zWave_write._write_headercCs�|js
t�|j|jkrdS|j��}|j�|jd�|j�t	�
dd|j��|j�|jd�|j�t	�
d|j��|j�|d�|j|_dS)Nrr�r�)rnr�rlrmrr<rUr�r�rer�r�)r#Zcurposr
r
rr��s

zWave_write._patchheaderN) rrr	rir0r&r4r5r8rqr>rrrArvrCrxr?r|rFrIr}rJrrPrKr<r�r�r-r�r�r�r
r
r
rrs:


cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder')�rr')�wrjz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�rrr�r/r�r
r
rr�s
cCstjdtdd�t||d�S)NzBwave.openfp is deprecated since Python 3.7. Use wave.open instead.r_)�
stacklevel)r�)�warnings�warn�DeprecationWarningrr�r
r
rrs
�)N)N)rir,�__all__�	ExceptionrrgZ_array_fmtsrXrerVr%r�collectionsrr�rrrrrr
r
r
r�<module>s(I�6d

heapq.cpython-38.pyc000064400000033370151450073350010303 0ustar00U

e5d]Y�@sZdZdZdddddddd	gZd
d�Zdd�Zdd�Zd
d	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zddd�d d�Zd)d!d�Zd*d"d�Zzd#d$lTWnek
r�YnXzd#d%lm	Z	Wnek
r�YnXzd#d&lm
Z
Wnek
�rYnXzd#d'lmZWnek
�r6YnXed(k�rVd#dlZee���dS)+a�Heap queue algorithm (a.k.a. priority queue).

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

Usage:

heap = []            # creates an empty heap
heappush(heap, item) # pushes a new item on the heap
item = heappop(heap) # pops the smallest item from the heap
item = heap[0]       # smallest item on the heap without popping it
heapify(x)           # transforms list into a heap, in-place, in linear time
item = heapreplace(heap, item) # pops and returns smallest item, and adds
                               # new item; the heap size is unchanged

Our API differs from textbook heap algorithms as follows:

- We use 0-based indexing.  This makes the relationship between the
  index for a node and the indexes for its children slightly less
  obvious, but is more suitable since Python uses 0-based indexing.

- Our heappop() method returns the smallest item, not the largest.

These two make it possible to view the heap as a regular Python list
without surprises: heap[0] is the smallest item, and heap.sort()
maintains the heap invariant!
uoHeap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
�heappush�heappop�heapify�heapreplace�merge�nlargest�	nsmallest�heappushpopcCs"|�|�t|dt|�d�dS)z4Push item onto heap, maintaining the heap invariant.��N)�append�	_siftdown�len��heap�item�r�/usr/lib64/python3.8/heapq.pyr�s
cCs.|��}|r*|d}||d<t|d�|S|S)zCPop the smallest item off the heap, maintaining the heap invariant.r	)�pop�_siftup�rZlastelt�
returnitemrrrr�s
cCs|d}||d<t|d�|S)a�Pop and return the current smallest value, and add the new item.

    This is more efficient than heappop() followed by heappush(), and can be
    more appropriate when using a fixed-size heap.  Note that the value
    returned may be larger than item!  That constrains reasonable uses of
    this routine unless written as part of a conditional replacement:

        if item > heap[0]:
            item = heapreplace(heap, item)
    r	�r�rrrrrrr�s
cCs0|r,|d|kr,|d|}|d<t|d�|S)z1Fast version of a heappush followed by a heappop.r	rrrrrr�s
cCs,t|�}tt|d��D]}t||�qdS)z8Transform list into a heap, in-place, in O(len(x)) time.�N)r
�reversed�ranger��x�n�irrrr�scCs.|��}|r*|d}||d<t|d�|S|S)zMaxheap version of a heappop.r	)r�_siftup_maxrrrr�_heappop_max�s
r!cCs|d}||d<t|d�|S)z4Maxheap version of a heappop followed by a heappush.r	)r rrrr�_heapreplace_max�s
r"cCs,t|�}tt|d��D]}t||�qdS)z;Transform list into a maxheap, in-place, in O(len(x)) time.rN)r
rrr rrrr�_heapify_max�sr#cCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)Nr
r�r�startpos�pos�newitem�	parentpos�parentrrrr�srcCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)Nrr
)r
r�rr&�endposr%r'�childpos�rightposrrrrsrcCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)zMaxheap variant of _siftdownr
Nrr$rrr�
_siftdown_maxsr.cCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)zMaxheap variant of _siftuprr
N)r
r.r*rrrr %sr NF��key�reversec	gsg}|j}|r t}t}t}d}nt}t}t}d}|dk�rttt	|��D]<\}	}
z|
j
}||�|	||g�WqHtk
r�YqHXqH||�t|�dkr�z2|d\}}	}}
|V|�|
d<|||
�q�Wq�tk
r�||�Yq�Xq�|�r|d\}}	}|V|j
EdHdSttt	|��D]J\}	}
z(|
j
}|�}|||�|	|||g�Wntk
�rjYnX�q$||�t|�dk�r�zF|d\}}	}}}
|V|�}||�|
d<||
d<|||
��q�Wntk
�r�||�YnX�qx|�r|d\}}	}}|V|j
EdHdS)akMerge multiple sorted inputs into a single sorted output.

    Similar to sorted(itertools.chain(*iterables)) but returns a generator,
    does not pull the data into memory all at once, and assumes that each of
    the input streams is already sorted (smallest to largest).

    >>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
    [0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]

    If *key* is not None, applies a key function to each element to determine
    its sort order.

    >>> list(merge(['dog', 'horse'], ['cat', 'fish', 'kangaroo'], key=len))
    ['dog', 'cat', 'fish', 'horse', 'kangaroo']

    ���r
Nr	r)rr#r!r"rrr�	enumerate�map�iter�__next__�
StopIterationr
�__self__)r0r1�	iterables�h�h_append�_heapify�_heappop�_heapreplace�	direction�order�it�next�value�s�	key_valuerrrr:sl


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYnX||krxt|�d�d|�S�dk�rt|�}dd�tt|�|�D�}|s�|St	|�|dd}|}t
}	|D].}
|
|kr�|	||
|f�|d\}}|d7}q�|��dd�|D�St|�}�fd	d�tt|�|�D�}|�s>|St	|�|dd}|}t
}	|D]>}
�|
�}||k�r^|	||||
f�|d\}}}
|d7}�q^|��d
d�|D�S)zbFind the n smallest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key)[:n]
    r
��defaultr0�r0NcSsg|]\}}||f�qSrr��.0r�elemrrr�
<listcomp>�sznsmallest.<locals>.<listcomp>r	cSsg|]\}}|�qSrr�rJrKr@rrrrL�scsg|]\}}�|�||f�qSrrrIrHrrrL�scSsg|]\}}}|�qSrr�rJ�kr@rKrrrrLs)r5�object�minr
�	TypeError�AttributeError�sorted�ziprr#r"�sort�r�iterabler0rA�sentinel�result�size�topr@r>rK�_orderrO�_elemrrHrr�sV


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYn X||krzt|�dd�d|�S�dk�rt|�}dd�ttd|d	�|�D�}|s�|St	|�|dd}|}t
}	|D].}
||
kr�|	||
|f�|d\}}|d8}q�|jdd
�dd�|D�St|�}�fdd�ttd|d	�|�D�}|�sR|St	|�|dd}|}t
}	|D]>}
�|
�}||k�rt|	||||
f�|d\}}}
|d8}�qt|jdd
�d
d�|D�S)zoFind the n largest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
    r
rFTr/NcSsg|]\}}||f�qSrrrIrrrrL"sznlargest.<locals>.<listcomp>r	r2)r1cSsg|]\}}|�qSrrrMrrrrL/scsg|]\}}�|�||f�qSrrrIrHrrrL3scSsg|]\}}}|�qSrrrNrrrrLAs)r5rP�maxr
rRrSrTrUrrrrVrWrrHrr	sV

"
r	)�*)r")r#)r!�__main__)N)N)�__doc__�	__about__�__all__rrrrrr!r"r#rrr.r rrr�_heapq�ImportError�__name__Zdoctest�printZtestmodrrrr�<module>sR ^
�

	5
<
;
mimetypes.cpython-38.opt-1.pyc000064400000037241151450073350012161 0ustar00U

e5d�T�
@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddg
Z	dddddddddg	Z
dadaGdd�d�Z
d&dd�Zd'dd�Zd(dd�Zd)dd	�Zd*dd
�Zd d�Zd!d"�Ze�d#d$�Zed%kr�e�dS)+a�Guess the MIME type of a file.

This module defines two useful functions:

guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.

guess_extension(type, strict=True) -- guess the extension for a given MIME type.

It also contains the following, for tuning the behavior:

Data:

knownfiles -- list of files to parse
inited -- flag set when init() has been called
suffix_map -- dictionary mapping suffixes to suffixes
encodings_map -- dictionary mapping suffixes to encodings
types_map -- dictionary mapping suffixes to types

Functions:

init([files]) -- parse a list of files, default knownfiles (on Windows, the
  default values are taken from the registry)
read_mime_types(file) -- parse one file, return a dictionary or None
�N�
knownfiles�inited�	MimeTypes�
guess_type�guess_all_extensions�guess_extension�add_type�init�read_mime_types�
suffix_map�
encodings_map�	types_map�common_typesz/etc/mime.typesz/etc/httpd/mime.typesz/etc/httpd/conf/mime.typesz/etc/apache/mime.typesz/etc/apache2/mime.typesz$/usr/local/etc/httpd/conf/mime.typesz"/usr/local/lib/netscape/mime.typesz/usr/local/etc/mime.typesFc@s`eZdZdZddd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	ddd�Z
ddd�ZdS)rz�MIME-types datastore.

    This datastore can handle information from mime.types-style files
    and supports basic determination of MIME type from a filename or
    URL, and can guess a reasonable extension given a MIME type.
    �TcCs�ts
t�t��|_t��|_iif|_iif|_t	�
�D]\}}|�||d�q:t�
�D]\}}|�||d�qZ|D]}|�
||�qvdS�NTF)rr	�_encodings_map_default�copyr�_suffix_map_defaultrr
�
types_map_inv�_types_map_default�itemsr�_common_types_default�read)�self�	filenames�strict�ext�type�namerr�!/usr/lib64/python3.8/mimetypes.py�__init__Bs



zMimeTypes.__init__cCs6||j||<|j|�|g�}||kr2|�|�dS)a�Add a mapping between a type and an extension.

        When the extension is already known, the new
        type will replace the old one. When the type
        is already known the extension will be added
        to the list of known extensions.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        N)r
r�
setdefault�append)rrrrZextsrrrrPszMimeTypes.add_typecCsrt�|�}tj�|�\}}|dkr�|�d�}|dkr8dS|�dd|�}|dkr\|d|�}n|d|�}d|ksxd|kr|d	}|dfSt�|�\}}||jkr�t�||j|�\}}q�||j	kr�|j	|}	t�|�\}}nd}	|j
d
}
||
kr�|
||	fS|��|
k�r|
|��|	fS|�r(d|	fS|j
d}
||
k�rH|
||	fS|��|
k�rf|
|��|	fSd|	fSdS)aUGuess the type of a file which is either a URL or a path-like object.

        Return value is a tuple (type, encoding) where type is None if
        the type can't be guessed (no or unknown suffix) or a string
        of the form type/subtype, usable for a MIME Content-type
        header; and encoding is None for no encoding or the name of
        the program used to encode (e.g. compress or gzip).  The
        mappings are table driven.  Encoding suffixes are case
        sensitive; type suffixes are first tried case sensitive, then
        case insensitive.

        The suffixes .tgz, .taz and .tz (case sensitive!) are all
        mapped to '.tar.gz'.  (This is table-driven too, using the
        dictionary suffix_map.)

        Optional `strict' argument when False adds a bunch of commonly found,
        but non-standard types.
        �data�,r)NN�;N�=�/�
text/plainTF)�os�fspath�urllib�parseZ
_splittype�find�	posixpath�splitextrrr
�lower)r�urlrZschemeZcommaZsemir�baser�encodingr
rrrrasB







zMimeTypes.guess_typecCsL|��}|jd�|g�}|sH|jd�|g�D]}||kr0|�|�q0|S)a�Guess the extensions for a file based on its MIME type.

        Return value is a list of strings giving the possible filename
        extensions, including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data stream,
        but would be mapped to the MIME type `type' by guess_type().

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        TF)r0r�getr")rrr�
extensionsrrrrr�szMimeTypes.guess_all_extensionscCs|�||�}|sdS|dS)aGuess the extension for a file based on its MIME type.

        Return value is a string giving a filename extension,
        including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data
        stream, but would be mapped to the MIME type `type' by
        guess_type().  If no extension can be guessed for `type', None
        is returned.

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        Nr)r)rrrr5rrrr�s
zMimeTypes.guess_extensionc	Cs(t|dd��}|�||�W5QRXdS)z�
        Read a single mime.types-format file, specified by pathname.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        �utf-8�r3N)�open�readfp)r�filenamer�fprrrr�szMimeTypes.readc	Cs�|��}|sq�|��}tt|��D]"}||ddkr"||d�=qFq"|sLq|d|dd�}}|D]}|�|d||�qfqdS)z�
        Read a single mime.types-format file.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        r�#N��.)�readline�split�range�lenr)	rr;r�lineZwords�ir�suffixesZsuffrrrr9�s	
zMimeTypes.readfpcCs�tsdSdd�}t�tjd���}||�D]�}zjt�||��T}|�d�sTW5QR�Wq(t�|d�\}}|tjkr|W5QR�Wq(|�|||�W5QRXWq(tk
r�Yq(Yq(Xq(W5QRXdS)z�
        Load the MIME types database from Windows registry.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        NcssJd}zt�||�}Wntk
r,YqFYnXd|kr<|V|d7}qdS)Nr�r=)�_winregZEnumKey�OSError)ZmimedbrDZctyperrr�
enum_types�s
z3MimeTypes.read_windows_registry.<locals>.enum_types�r>zContent Type)rG�OpenKeyZHKEY_CLASSES_ROOT�
startswithZQueryValueExZREG_SZrrH)rrrIZhkcrZ
subkeynameZsubkeyZmimetypeZdatatyperrr�read_windows_registry�s$

�
zMimeTypes.read_windows_registryN)rT)T)T)T)T)T)T)T)�__name__�
__module__�__qualname__�__doc__r rrrrrr9rMrrrrr:s


?



TcCstdkrt�t�||�S)a�Guess the type of a file based on its URL.

    Return value is a tuple (type, encoding) where type is None if the
    type can't be guessed (no or unknown suffix) or a string of the
    form type/subtype, usable for a MIME Content-type header; and
    encoding is None for no encoding or the name of the program used
    to encode (e.g. compress or gzip).  The mappings are table
    driven.  Encoding suffixes are case sensitive; type suffixes are
    first tried case sensitive, then case insensitive.

    The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped
    to ".tar.gz".  (This is table-driven too, using the dictionary
    suffix_map).

    Optional `strict' argument when false adds a bunch of commonly found, but
    non-standard types.
    N)�_dbr	r)r1rrrrrscCstdkrt�t�||�S)a�Guess the extensions for a file based on its MIME type.

    Return value is a list of strings giving the possible filename
    extensions, including the leading dot ('.').  The extension is not
    guaranteed to have been associated with any particular data
    stream, but would be mapped to the MIME type `type' by
    guess_type().  If no extension can be guessed for `type', None
    is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	r�rrrrrr's
cCstdkrt�t�||�S)a�Guess the extension for a file based on its MIME type.

    Return value is a string giving a filename extension, including the
    leading dot ('.').  The extension is not guaranteed to have been
    associated with any particular data stream, but would be mapped to the
    MIME type `type' by guess_type().  If no extension can be guessed for
    `type', None is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	rrSrrrr8scCstdkrt�t�|||�S)aiAdd a mapping between a type and an extension.

    When the extension is already known, the new
    type will replace the old one. When the type
    is already known the extension will be added
    to the list of known extensions.

    If strict is true, information will be added to
    list of standard types, else to the list of non-standard
    types.
    N)rRr	r)rrrrrrrHscCs�da|dkstdkrBt�}tr&|��|dkr4t}qFtt|�}nt}|D]}tj�	|�rJ|�
|�qJ|ja|ja|j
da
|j
da|adSr)rrRrrGrMr�listr)�path�isfilerrrr
r)�files�db�filerrrr	Ys"

c
Cs`zt|dd�}Wntk
r&YdSX|�*t�}|�|d�|jdW5QR�SQRXdS)Nr6r7T)r8rHrr9r
)rY�frXrrrr
usc�CsXddddddd�aadddd	d
�aadddd
ddddddddddddddddddddddddddddddddddd d!d!d"d"d#d$d$d%d&d'd(d)d*d+d,d-d-d.d.d.d/d0d1d2d3d4d4d4d4d5d6d6d7d7d8d8d8d9d:d;d<d=d>d>d>d?d@dAdAdBdCdDdEdFdGdHdIdJdKdLdMdMdMdMdNdOdPdPdQdQdQdQdQdQdRdSdTdUdVdVdWdXdYdZdZdZdZdZd[d[d\d]d^d_��aad`dadadbdcdcdcddde�aadS)fNz.svg.gzz.tar.gzz.tar.bz2z.tar.xz)z.svgzz.tgzz.tazz.tzz.tbz2z.txzZgzip�compressZbzip2Zxz)z.gzz.Zz.bz2z.xzzapplication/javascriptzapplication/jsonzapplication/manifest+jsonzapplication/mswordzapplication/octet-streamzapplication/odazapplication/pdfzapplication/pkcs7-mimezapplication/postscriptzapplication/vnd.apple.mpegurlzapplication/vnd.ms-excelzapplication/vnd.ms-powerpointzapplication/wasmzapplication/x-bcpiozapplication/x-cpiozapplication/x-cshzapplication/x-dvizapplication/x-gtarzapplication/x-hdfzapplication/x-hdf5zapplication/x-latexzapplication/x-mifzapplication/x-netcdfzapplication/x-pkcs12zapplication/x-pn-realaudiozapplication/x-python-codezapplication/x-shzapplication/x-sharzapplication/x-shockwave-flashzapplication/x-sv4cpiozapplication/x-sv4crczapplication/x-tarzapplication/x-tclzapplication/x-texzapplication/x-texinfozapplication/x-troffzapplication/x-troff-manzapplication/x-troff-mezapplication/x-troff-mszapplication/x-ustarzapplication/x-wais-sourcezapplication/xmlzapplication/zipzaudio/basicz
audio/mpegzaudio/x-aiffzaudio/x-pn-realaudiozaudio/x-wavz	image/bmpz	image/gifz	image/iefz
image/jpegz	image/pngz
image/svg+xmlz
image/tiffzimage/vnd.microsoft.iconzimage/x-cmu-rasterzimage/x-ms-bmpzimage/x-portable-anymapzimage/x-portable-bitmapzimage/x-portable-graymapzimage/x-portable-pixmapzimage/x-rgbzimage/x-xbitmapzimage/x-xpixmapzimage/x-xwindowdumpzmessage/rfc822ztext/cssztext/csvz	text/htmlr(z
text/richtextztext/tab-separated-valuesz
text/x-pythonz
text/x-setextztext/x-sgmlztext/x-vcardztext/xmlz	video/mp4z
video/mpegzvideo/quicktimez
video/webmzvideo/x-msvideozvideo/x-sgi-movie)�z.jsz.mjsz.jsonz.webmanifestz.docz.dotz.wizz.binz.az.dllz.exez.oz.objz.soz.odaz.pdfz.p7cz.psz.aiz.epsz.m3uz.m3u8z.xlsz.xlbz.pptz.potz.ppaz.ppsz.pwzz.wasmz.bcpioz.cpioz.cshz.dviz.gtarz.hdfz.h5z.latexz.mifz.cdfz.ncz.p12z.pfxz.ramz.pycz.pyoz.shz.sharz.swfz.sv4cpioz.sv4crcz.tarz.tclz.texz.texiz.texinfoz.roffz.tz.trz.manz.mez.msz.ustarz.srcz.xslz.rdfz.wsdlz.xpdlz.zipz.auz.sndz.mp3z.mp2z.aifz.aifcz.aiffz.raz.wav�.bmpz.gifz.ief�.jpgz.jpez.jpegz.pngz.svgz.tiffz.tifz.icoz.rasr\z.pnmz.pbmz.pgmz.ppmz.rgbz.xbmz.xpmz.xwdz.emlz.mhtz.mhtmlz.nwsz.cssz.csvz.htmlz.htmz.txtz.batz.cz.hz.kshz.plz.rtxz.tsvz.pyz.etxz.sgmz.sgmlz.vcfz.xmlz.mp4z.mpegz.m1vz.mpaz.mpez.mpgz.movz.qtz.webmz.aviz.moviezapplication/rtfz
audio/midiz	image/jpgz
image/pictztext/xul)z.rtfz.midiz.midr]z.pictz.pctz.picz.xul)rrrrr
rrrrrrr�_default_mime_types�s8�

�
��

�r^c
sddl}d�d�fdd�	}z&|�tjdd�ddd	d
g�\}}Wn.|jk
rn}z|d|�W5d}~XYnXd}d}|D]4\}}|dkr�|d�q||dkr�d}q||d
kr|d}q||D]Z}	|r�t|	|�}
|
s�td|	�nt|
�q�t|	|�\}
}|
�std|	�q�td|
d|�q�dS)Nra4Usage: mimetypes.py [options] type

Options:
    --help / -h       -- print this message and exit
    --lenient / -l    -- additionally search of some common, but non-standard
                         types.
    --extension / -e  -- guess extension instead of type

More than one type argument may be given.
rJcs"t��|rt|�t�|�dS)N)�print�sys�exit)�code�msg�ZUSAGErr�usageFsz_main.<locals>.usager=Zhle�helpZlenient�	extension)z-hz--help)z-lz	--lenient)z-ez--extensionz I don't know anything about typeztype:z	encoding:)rJ)�getoptr`�argv�errorrr_r)rhreZopts�argsrcrrg�opt�argZgtypeZguessr3rrdr�_main7s8�


rn�__main__)T)T)T)T)N)rQr)r`r.Zurllib.parser+�winregrG�ImportError�__all__rrrRrrrrrr	r
r^rnrNrrrr�<module>s`
��W




5._weakrefset.cpython-38.opt-1.pyc000064400000016662151450073350012450 0ustar00U

e5dg�@s2ddlmZdgZGdd�d�ZGdd�d�ZdS)���ref�WeakSetc@s$eZdZdd�Zdd�Zdd�ZdS)�_IterationGuardcCst|�|_dS�N)r�
weakcontainer)�selfr�r	�#/usr/lib64/python3.8/_weakrefset.py�__init__sz_IterationGuard.__init__cCs |��}|dk	r|j�|�|Sr)r�
_iterating�add)r�wr	r	r
�	__enter__sz_IterationGuard.__enter__cCs0|��}|dk	r,|j}|�|�|s,|��dSr)rr�remove�_commit_removals)r�e�t�br�sr	r	r
�__exit__s
z_IterationGuard.__exit__N)�__name__�
__module__�__qualname__rrrr	r	r	r
r
src@seZdZd@dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�ZeZd&d'�Zd(d)�Zd*d+�ZeZd,d-�Zd.d/�ZeZd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$e$Z%d<d=�Z&d>d?�Z'dS)ArNcCsBt�|_t|�fdd�}||_g|_t�|_|dk	r>|�|�dS)NcSs2|�}|dk	r.|jr"|j�|�n|j�|�dSr)r�_pending_removals�append�data�discard)�itemZselfrefrr	r	r
�_remove&s
z!WeakSet.__init__.<locals>._remove)�setrrrrr�update)rrrr	r	r
r$szWeakSet.__init__cCs$|j}|jj}|r ||���qdSr)rrr�pop)r�lrr	r	r
r4szWeakSet._commit_removalsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr)rr�rZitemrefrr	r	r
�__iter__:s


zWeakSet.__iter__cCst|j�t|j�Sr)�lenrr�rr	r	r
�__len__CszWeakSet.__len__cCs.zt|�}Wntk
r"YdSX||jkS)NF)r�	TypeErrorr)rrZwrr	r	r
�__contains__Fs
zWeakSet.__contains__cCs|jt|�ft|dd�fS)N�__dict__)�	__class__�list�getattrr'r	r	r
�
__reduce__Ms
�zWeakSet.__reduce__cCs&|jr|��|j�t||j��dSr)rrrr
rr�rrr	r	r
r
QszWeakSet.addcCs|jr|��|j��dSr)rrr�clearr'r	r	r
r1Vsz
WeakSet.clearcCs
|�|�Sr�r,r'r	r	r
�copy[szWeakSet.copycCsT|jr|��z|j��}Wntk
r:td�d�YnX|�}|dk	r|SqdS)Nzpop from empty WeakSet)rrrr"�KeyErrorr$r	r	r
r"^szWeakSet.popcCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
rjszWeakSet.removecCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
roszWeakSet.discardcCs&|jr|��|D]}|�|�qdSr)rrr
)r�otherZelementr	r	r
r!tszWeakSet.updatecCs|�|�|Sr)r!�rr5r	r	r
�__ior__zs
zWeakSet.__ior__cCs|��}|�|�|Sr)r3�difference_update�rr5Znewsetr	r	r
�
difference~s
zWeakSet.differencecCs|�|�dSr)�__isub__r6r	r	r
r8�szWeakSet.difference_updatecCs<|jr|��||kr"|j��n|j�dd�|D��|S)Ncss|]}t|�VqdSrr��.0rr	r	r
�	<genexpr>�sz#WeakSet.__isub__.<locals>.<genexpr>)rrrr1r8r6r	r	r
r;�szWeakSet.__isub__cs���fdd�|D��S)Nc3s|]}|�kr|VqdSrr	r<r'r	r
r>�sz'WeakSet.intersection.<locals>.<genexpr>r2r6r	r'r
�intersection�szWeakSet.intersectioncCs|�|�dSr)�__iand__r6r	r	r
�intersection_update�szWeakSet.intersection_updatecCs(|jr|��|j�dd�|D��|S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.__iand__.<locals>.<genexpr>)rrrrAr6r	r	r
r@�szWeakSet.__iand__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.issubset.<locals>.<genexpr>)r�issubsetr6r	r	r
rB�szWeakSet.issubsetcCs|jttt|��kSr�rr �maprr6r	r	r
�__lt__�szWeakSet.__lt__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz%WeakSet.issuperset.<locals>.<genexpr>)r�
issupersetr6r	r	r
rF�szWeakSet.issupersetcCs|jttt|��kSrrCr6r	r	r
�__gt__�szWeakSet.__gt__cCs$t||j�stS|jttt|��kSr)�
isinstancer,�NotImplementedrr rDrr6r	r	r
�__eq__�szWeakSet.__eq__cCs|��}|�|�|Sr)r3�symmetric_difference_updater9r	r	r
�symmetric_difference�s
zWeakSet.symmetric_differencecCs|�|�dSr)�__ixor__r6r	r	r
rK�sz#WeakSet.symmetric_difference_updatecs@�jr����|kr"�j��n�j��fdd�|D���S)Nc3s|]}t|�j�VqdSr)rrr<r'r	r
r>�sz#WeakSet.__ixor__.<locals>.<genexpr>)rrrr1rKr6r	r'r
rM�szWeakSet.__ixor__cCs|�dd�||fD��S)Ncss|]}|D]
}|Vq
qdSrr	)r=rrr	r	r
r>�sz WeakSet.union.<locals>.<genexpr>r2r6r	r	r
�union�sz
WeakSet.unioncCst|�|��dkS)Nr)r&r?r6r	r	r
�
isdisjoint�szWeakSet.isdisjointcCs
t|j�Sr)�reprrr'r	r	r
�__repr__�szWeakSet.__repr__)N)(rrrrrr%r(r*r/r
r1r3r"rrr!r7r:�__sub__r8r;r?�__and__rAr@rB�__le__rErF�__ge__rGrJrL�__xor__rKrMrN�__or__rOrQr	r	r	r
r#sJ
			N)�_weakrefr�__all__rrr	r	r	r
�<module>sstruct.cpython-38.opt-1.pyc000064400000000514151450073350011462 0ustar00U

e5d�@s8ddddddddgZdd	lTdd
lmZddlmZdS)
ZcalcsizeZpackZ	pack_intoZunpackZunpack_fromZiter_unpackZStruct�error�)�*)�_clearcache)�__doc__N)�__all__Z_structrr�rr�/usr/lib64/python3.8/struct.py�<module>s�pathlib.cpython-38.pyc000064400000126263151450073350010634 0ustar00U

e5d���@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe� �dd	�d
kr�ddlm!Z!q�dZdZ!ndZd
dddddgZ"ee
eefZ#dZ$dd�Z%dd�Z&Gdd�de'�Z(Gdd�de(�Z)Gdd�de(�Z*e)�Z+e*�Z,Gdd�d�Z-Gd d!�d!e-�Z.e.�Z/d"d#�Z0e1ed$��r�e�2�e0�Z0Gd%d&�d&�Z3Gd'd(�d(�Z4Gd)d*�d*e3�Z5Gd+d,�d,e3�Z6Gd-d.�d.e3�Z7Gd/d0�d0e	�Z8Gd1d
�d
e'�Z9ej:�;e9�Gd2d�de9�Z<Gd3d�de9�Z=Gd4d�de9�Z>Gd5d�de>e<�Z?Gd6d�de>e=�Z@dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF�ELOOP)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt�)�r)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPath)��{i�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r!�/usr/lib64/python3.8/pathlib.py�
_ignore_error.s�r#cCsd|kpd|kpd|kS)N�*�?�[r!)�patr!r!r"�_is_wildcard_pattern3sr(c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_FlavourzPA flavour implements a particular (platform-specific) set of path
    semantics.cCs|jj|_dS�N)�sep�join��selfr!r!r"�__init__=sz_Flavour.__init__cCsg}|j}|j}d}}t|�}|D]�}|s.q$|r>|�||�}|�|�\}}}	||	kr�t|	�|��D] }
|
rd|
dkrd|�t�|
��qdn|	r�|	dkr�|�t�|	��|s�|r$|s�|D]0}|s�q�|r�|�||�}|�|�d}|r�q�q�q�q$|s�|�r|�||�|�	�|||fS)N��.r)
r+�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r.�partsZparsedr+r2�drv�root�it�partZrel�xr!r!r"�parse_parts@s@
z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS)z�
        Join the two paths represented by the respective
        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
        �N)�casefold)r.r<r=r;Zdrv2Zroot2Zparts2r!r!r"�join_parsed_partsfsz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__�__doc__r/rArDr!r!r!r"r)9s&r)c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zdd�Zd&dd�Ze
fdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)'�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr!��.0�ir!r!r"�	<setcomp>�sz_WindowsFlavour.<setcomp>rB�
cCsh|]}d|�qS)zLPT%dr!rLr!r!r"rO�scCs\|dd�}|dd�}||krP||krP|�|�\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d�}|dkr�|�||d�}||dkr�|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r6||jk�r6|dd�}	|dd�}|}||k�rN|}
|�|�}||	|
|fS)NrrBrr0�����:)�_split_extended_path�find�len�
drive_letters�lstrip)r.r?r+�first�second�prefixZthird�indexZindex2r<r=r!r!r"r5�s6"

z_WindowsFlavour.splitrootcCs|��Sr*��lower�r.�sr!r!r"rC�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr!r])rM�pr!r!r"�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r!�r.r;r!r!r"�casefold_parts�sz_WindowsFlavour.casefold_partscCst�t�|�tj�jSr*)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch�r.�patternr!r!r"�compile_pattern�sz_WindowsFlavour.compile_patternFcCs�t|�}|st��Sd}tdk	r�|r2|�t|��Sg}z|�t|��}WnBtk
r�|}tj�|�\}}|�|�||kr�|YSYq6Xtjj	|ft
|���Sq6dSr*)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr6r7r,r3)r.rs�strictr`Z
previous_sZ
tail_parts�tailr!r!r"�resolve�s$
z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr0�zUNC\rQrJ)�
startswith)r.r`Z
ext_prefixr[r!r!r"rT�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dS�NrB)rTr_r!r!r"rq�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rRr1)rx�	partition�upper�reserved_namesrcr!r!r"�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|��dd��d�}d|t|�d��fSdt|���d��SdS)NrrBrSrKz
file:///%s/%szutf-8zfile:)�driverV�as_posixrX�urlquote_from_bytes�encode)r.rsr~�restr!r!r"�make_uri�s�z_WindowsFlavour.make_uricCs�dtjkrtjd}nJdtjkrXztjd}Wntk
rFd}YnX|tjd}ntd��|r�tjd|kr�|�|f�\}}}|dtjdkr�td|��||d<|s�|r�|||�|d	d��}n
|�|�}|S)
NZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr0zCan't determine home directoryZUSERNAMErR�%Can't determine home directory for %rrB)ro�environ�KeyError�RuntimeErrorrAr,)r.�username�userhomer<r=r;r!r!r"�
gethomedirs*


�
z_WindowsFlavour.gethomedirN)F)rErFrGr+r2�has_drv�ntpath�pathmodro�name�is_supported�setrWZext_namespace_prefix�ranger|r5rCrdrmrvrTrqr}r�r�r!r!r!r"rIxs.

���'

rIc@sleZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
dd�Zdd
d�Zdd�Zdd�Zdd�ZdS)�
_PosixFlavourrKr0FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr0)rXrV)r.r?r+Z
stripped_partr!r!r"r5%s
z_PosixFlavour.splitrootcCs|Sr*r!r_r!r!r"rC4sz_PosixFlavour.casefoldcCs|Sr*r!rcr!r!r"rd7sz_PosixFlavour.casefold_partscCst�t�|��jSr*)rerfrgrhrjrkr!r!r"rm:sz_PosixFlavour.compile_patterncsJ|j�|j�i������fdd��|��r0dnt��}�|t|��pH�S)Ncs�|���rd}|���D]�}|r|dkr*q|dkrD|���\}}}q|���rX||}n|�|}|�kr��|}|dk	r~qtd|��z��|�}Wn6tk
r�}z|jtkr��r��|}W5d}~XYqXd�|<�||�}|�|<q|S)Nr0r1�..zSymlink loop from %r)	rxr6�
rpartition�endswithr��readlink�OSErrorrr)rsr�r��_�newpath�target�e��_resolveZaccessor�seenr+rtr!r"r�As4




z'_PosixFlavour.resolve.<locals>._resolver0)r+�	_accessor�is_absoluterorprn)r.rsrt�baser!r�r"rv=s)z_PosixFlavour.resolvecCsdS�NFr!rcr!r!r"r}msz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesr�)r.rsZbpathr!r!r"r�psz_PosixFlavour.make_uricCs||s@ztjdWStk
r<ddl}|�t���jYSXn8ddl}z|�|�jWStk
rvtd|��YnXdS)N�HOMErr�)	ror�r��pwd�getpwuid�getuid�pw_dir�getpwnamr�)r.r�r�r!r!r"r�vs�z_PosixFlavour.gethomedirN)F)rErFrGr+r2r��	posixpathr�ror�r�r5rCrdrmrvr}r�r�r!r!r!r"r�s

0r�c@seZdZdZdS)�	_AccessorzjAn accessor implements a particular (system-specific or not) way of
    accessing paths on the filesystem.N)rErFrGrHr!r!r!r"r��sr�c@s�eZdZejZejZejZejZejZej	Z	e
ed�r>ejZndd�ZejZej
Z
e
ed�rdejZnedd��ZejZejZejZer�er�ejZq�dd�Zned	d��ZejZd
d�ZdS)
�_NormalAccessor�lchmodcCstd��dS)Nz%lchmod() not available on this system��NotImplementedError)r.Zpathobj�moder!r!r"r��sz_NormalAccessor.lchmod�linkcCstd��dS)Nz&os.link() not available on this systemr��r.r�r!r!r"�link_to�sz_NormalAccessor.link_tocCstd��dS)Nz&symlink() not available on this systemr���a�b�target_is_directoryr!r!r"�symlink�sz_NormalAccessor.symlinkcCst�||�Sr*)ror�r�r!r!r"r��scCs
t�|�Sr*)ror��r.rsr!r!r"r��sz_NormalAccessor.readlinkN)rErFrGro�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlinkr�r��staticmethod�rmdir�renamer4r�supports_symlinksr��utimer�r!r!r!r"r��s4




r�cCsR|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}||||�S)NrrB�**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr(�_WildcardSelector�_PreciseSelector)�
pattern_parts�flavourr'�child_parts�clsr!r!r"�_make_selector�s
r��	lru_cachec@s eZdZdZdd�Zdd�ZdS)�	_SelectorzYA selector matches a specific glob pattern part against the children
    of a given path.cCs0||_|rt||�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r.r�r�r!r!r"r/�sz_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�S)zuIterate over all child paths of `parent_path` matched by this
        selector.  This can contain parent_path itself.)�type�is_dir�existsr�r��iter�_select_from)r.�parent_pathZpath_clsr�r�r�r!r!r"�select_from�sz_Selector.select_fromN)rErFrGrHr/r�r!r!r!r"r��s	r�c@seZdZdd�ZdS)r�ccs
|VdSr*r!)r.r�r�r�r�r!r!r"r��sz!_TerminatingSelector._select_fromN)rErFrGr�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�|||�dSr*)r�r�r/)r.r�r�r�r!r!r"r/sz_PreciseSelector.__init__ccs\z@|�|j�}|jr|n||�r>|j�||||�D]
}|Vq2Wntk
rVYdSXdSr*)�_make_child_relpathr�r�r�r��PermissionError)r.r�r�r�r�rsrar!r!r"r�sz_PreciseSelector._select_fromN�rErFrGr/r�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs|�|�|_t�|||�dSr*)rm�matchr�r/�r.r'r�r�r!r!r"r/sz_WildcardSelector.__init__ccs�z�||��}t|�}W5QRX|D]�}|jrrz|��s:Wq"Wn4tk
rp}zt|�sX�WY�q"W5d}~XYnX|j}	|�|	�r"|�|	�}
|j�	|
|||�D]
}|Vq�q"Wnt
k
r�YdSXdSr*)�listr�r�r�r#r�r�r�r�r�r�)r.r�r�r�r��
scandir_it�entries�entryr�r�rsrar!r!r"r�s&


z_WildcardSelector._select_fromNr�r!r!r!r"r�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�|||�dSr*)r�r/r�r!r!r"r//sz#_RecursiveWildcardSelector.__init__ccs�|Vz�||��}t|�}W5QRX|D]t}d}z|��}Wn,tk
rh}zt|�sX�W5d}~XYnX|r(|��s(|�|j�}	|�|	||�D]
}
|
Vq�q(Wntk
r�YdSXdSr�)	r�r�r�r#�
is_symlinkr�r��_iterate_directoriesr�)r.r�r�r�r�r�r�Zentry_is_dirr�rsrar!r!r"r�2s"
z/_RecursiveWildcardSelector._iterate_directoriesc	cs~zbt�}zL|jj}|�|||�D]0}|||||�D]}||kr2|V|�|�q2q W5|��XWntk
rxYdSXdSr*)r��clearr�r�r��addr�)	r.r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrar!r!r"r�Esz'_RecursiveWildcardSelector._select_fromN)rErFrGr/r�r�r!r!r!r"r�-sr�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�_PathParentszvThis object provides sequence-like access to the logical ancestors
    of a path.  Don't try to construct it yourself.)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dSr*)r�r�r�r�r�r�r!r!r"r/^s
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdSry)r�r�rVr�r-r!r!r"�__len__esz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)NrrB)rV�
IndexErrorr��_from_parsed_partsr�r�r�)r.�idxr!r!r"�__getitem__ks
�z_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rEr-r!r!r"�__repr__qsz_PathParents.__repr__N)	rErFrGrH�	__slots__r/r�r�r�r!r!r!r"r�Ysr�c@s�eZdZdZdZdd�Zdd�Zedd��ZedVd
d��Z	edWdd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zeed.�d/d0�Zeed1�d2d0�Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#d=d>�Z$d?d@�Z%dAdB�Z&edCdD��Z'dEdF�Z(dGdH�Z)dIdJ�Z*edKdL��Z+edMdN��Z,dOdP�Z-dQdR�Z.dSdT�Z/dUS)Xra|Base class for manipulating paths without I/O.

    PurePath represents a filesystem path and offers operations which
    don't imply any actual filesystem I/O.  Depending on your system,
    instantiating a PurePath will return either a PurePosixPath or a
    PureWindowsPath object.  You can also instantiate either of these classes
    directly, regardless of your system.
    )r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)z�Construct a PurePath from one or several strings and or existing
        PurePath objects.  The strings and path objects are combined so as
        to yield a canonicalized path, which is incorporated into the
        new PurePath object.
        r)rror�rr�_from_parts)r��argsr!r!r"�__new__�szPurePath.__new__cCs|jt|j�fSr*)�	__class__�tupler�r-r!r!r"�
__reduce__�szPurePath.__reduce__cCsdg}|D]N}t|t�r"||j7}qt�|�}t|t�rF|�t|��qtdt|���q|j	�
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�ro�fspathrnr7�	TypeErrorr��_flavourrA)r�r�r;r�r!r!r"�_parse_args�s


��zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|Sr*)�objectr�rr�r�r��_init)r�r��initr.r<r=r;r!r!r"r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|Sr*)rr�r�r�r�r)r�r<r=r;r	r.r!r!r"r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdSry)rr,)r�r<r=r;r!r!r"�_format_parsed_parts�szPurePath._format_parsed_partscCsdSr*r!r-r!r!r"r�szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�Sr*)rrrDr�r�r�r�)r.r�r<r=r;r!r!r"�_make_child�s�
zPurePath._make_childcCsBz|jWStk
r<|�|j|j|j�p.d|_|jYSXdS)z[Return the string representation of the path, suitable for
        passing to system calls.r1N)r��AttributeErrorr
r�r�r�r-r!r!r"�__str__�s��zPurePath.__str__cCst|�Sr*)rnr-r!r!r"�
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)zNReturn the string representation of the path with forward (/)
        slashes.rK)rrnr4r+�r.�fr!r!r"r�szPurePath.as_posixcCs
t�|�S)zaReturn the bytes representation of the path.  This is only
        recommended to use under Unix.)ro�fsencoder-r!r!r"�	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rErr-r!r!r"r��szPurePath.__repr__cCs|��std��|j�|�S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)r�r�rr�r-r!r!r"�as_uri�szPurePath.as_uricCs8z|jWStk
r2|j�|j�|_|jYSXdSr*)r�rrrdr�r-r!r!r"�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkSr*)rr�NotImplementedrr�r.�otherr!r!r"�__eq__�s
zPurePath.__eq__cCs8z|jWStk
r2tt|j��|_|jYSXdSr*)r�r�hashrrr-r!r!r"�__hash__�s
zPurePath.__hash__cCs&t|t�r|j|jk	rtS|j|jkSr*�rrrrrrr!r!r"�__lt__szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__le__	szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__gt__szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__ge__szPurePath.__ge__r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.cCs|j|j}|S)z/The concatenation of the drive and root, or ''.)r�r�)r.�anchorr!r!r"r!szPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)z!The final path component, if any.rBrr0rR)r�rVr�r�rcr!r!r"r�$sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)z{
        The final component's last suffix, if any.

        This includes the leading period. For example: '.txt'
        r1rrBNr0�r��rfindrV�r.r�rNr!r!r"�suffix,s

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)z�
        A list of the final component's suffixes, if any.

        These include the leading periods. For example: ['.tar', '.gz']
        r1cSsg|]}d|�qS)r1r!)rMr%r!r!r"rbEsz%PurePath.suffixes.<locals>.<listcomp>rBN)r�r�rXr6�r.r�r!r!r"�suffixes:s


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)z0The final path component, minus its last suffix.r1rrBNr"r$r!r!r"�stemGs

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjfksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)z-Return a new path with the file name changed.�%r has an empty namerRrBzInvalid name %rN)r�r�rrAr+r2rVr�r�r�r�)r.r�r<r=r;r!r!r"�	with_nameQs��
��zPurePath.with_namecCs�|j}|j|ks |jr.|j|kr.td|f��|r<|�d�rD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|�|j	|j
|jdd�|g�S)z�Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        zInvalid suffix %rr1r)NrR)rr+r2r�rxr�r%rVr�r�r�r�)r.r%rr�Z
old_suffixr!r!r"�with_suffix\s
�zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|�|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|s�|r�n||d|
��||	�kr�|�|||�}t	d�
t|�t|����|�d|
dkr�|nd||
d��S)z�Return the relative path to another path identified by the passed
        arguments.  If the operation is not possible (because this is not
        a subpath of the other path), raise ValueError.
        zneed at least one argumentrBNrz{!r} does not start with {!r}r0)
rr�r�r�rrVrrdr
r�r�rnr�)
r.rr;r<r=Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�n�cfZ	formattedr!r!r"�relative_toqs.	*�
�zPurePath.relative_tocCs4z|jWStk
r.t|j�|_|jYSXdS)zZAn object providing sequence-like access to the
        components in the filesystem path.N)r�rrr�r-r!r!r"r;�s
zPurePath.partscGs
|�|�S)z�Combine this path with one or several arguments, and return a
        new path representing either a subpath (if all arguments are relative
        paths) or a totally different path (if one of the arguments is
        anchored).
        )r)r.r�r!r!r"�joinpath�szPurePath.joinpathcCs,z|�|f�WStk
r&tYSXdSr*)rrr�r.�keyr!r!r"�__truediv__�szPurePath.__truediv__cCs2z|�|g|j�WStk
r,tYSXdSr*)r�r�rrr0r!r!r"�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)zThe logical parent of the path.rBNrR)r�r�r�rVr�)r.r<r=r;r!r!r"�parent�szPurePath.parentcCst|�S)z*A sequence of this path's logical parents.)r�r-r!r!r"�parents�szPurePath.parentscCs|js
dS|jjpt|j�S)zSTrue if the path is absolute (has both a root and, if applicable,
        a drive).F)r�rr��boolr�r-r!r!r"r��szPurePath.is_absolutecCs|j�|j�S)zaReturn True if the path contains one of the special names reserved
        by the system, if any.)rr}r�r-r!r!r"r}�szPurePath.is_reservedc	Cs�|jj}||�}|j�|f�\}}}|s0td��|rF|||j�krFdS|r\|||j�kr\dS|j}|sj|r�t|�t|�kr~dS|dd�}nt|�t|�kr�dStt	|�t	|��D]\}}t
�||�s�dSq�dS)zE
        Return True if this path matches the given pattern.
        z
empty patternFrBNT)rrCrAr�r�r�rrV�zipr3rgZfnmatchcase)	r.Zpath_patternr-r<r=Z	pat_partsr;r?r'r!r!r"r��s(zPurePath.matchN)T)T)0rErFrGrHr�r�r�classmethodrr�r�r
rrr
rrrr�r�propertyrrrrrrrrr~r=r!r�r%r'r(r*r+r.r;r/r2r3r4r5r�r}r�r!r!r!r"rusv

	


��





	 

	
c@seZdZdZeZdZdS)rz�PurePath subclass for non-Windows systems.

    On a POSIX system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_posix_flavourrr�r!r!r!r"r�sc@seZdZdZeZdZdS)rz�PurePath subclass for Windows systems.

    On a Windows system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_windows_flavourrr�r!r!r!r"r�sc@s�eZdZdZdZdd�Zdddd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dedd�Zdfdd�Ze
dd��Ze
dd��Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zdgd%d&�Zd'd(�Zd)d*�Zd+d,�Zdhd/d0�Zd1d2�Zdid3d4�Zd5d6�Zdjd7d8�Zdkd:d;�Zdld<d=�Zd>d?�Z d@dA�Z!dmdBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dndLdM�Z'dNdO�Z(dPdQ�Z)dRdS�Z*dTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0d`da�Z1dbdc�Z2dS)ora�PurePath subclass that can make system calls.

    Path represents a filesystem path but unlike PurePath, also offers
    methods to do system calls on path objects. Depending on your system,
    instantiating a Path will return either a PosixPath or a WindowsPath
    object. You can also instantiate a PosixPath or WindowsPath directly,
    but cannot instantiate a WindowsPath on a POSIX system or vice versa.
    )r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF�r	z$cannot instantiate %r on your system)rror�rrr�rr�r�rEr)r�r��kwargsr.r!r!r"r�s�zPath.__new__NcCs"d|_|dk	r|j|_nt|_dSr�)r<r��_normal_accessor)r.�templater!r!r"rs
z
Path._initcCs|j|g}|�|j|j|�Sr*)r�r�r�r�)r.r?r;r!r!r"r�#szPath._make_child_relpathcCs|jr|��|Sr*)r<�
_raise_closedr-r!r!r"�	__enter__)szPath.__enter__cCs
d|_dS)NT)r<)r.�t�v�tbr!r!r"�__exit__.sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�r-r!r!r"rA1szPath._raise_closed�cCs|j�|||�Sr*)r�r�)r.r��flagsr�r!r!r"�_opener4szPath._opener�cCs|jr|��|j�|||�S)zm
        Open the file pointed by this path and return a file descriptor,
        as os.open() does.
        )r<rAr�r�)r.rHr�r!r!r"�	_raw_open8szPath._raw_opencCs|t���S)zjReturn a new path pointing to the current working directory
        (as returned by os.getcwd()).
        )rorp�r�r!r!r"�cwdCszPath.cwdcCs||�j�d��S)zrReturn a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        N)rr�rLr!r!r"�homeJsz	Path.homecCsB|��}z|��}Wntk
r2t�|�}YnXtj�||�S)zoReturn whether other_path is the same or not as this file
        (as returned by os.path.samefile()).
        )r�rrors�samestat)r.Z
other_path�stZother_str!r!r"�samefileQsz
Path.samefileccsH|jr|��|j�|�D](}|dkr(q|�|�V|jr|��qdS)zyIterate over the files in this directory.  Does not yield any
        result for the special paths '.' and '..'.
        >r1r�N)r<rAr�r�r�r&r!r!r"�iterdir\szPath.iterdirccs`|std�|���|j�|f�\}}}|s.|r6td��tt|�|j�}|�|�D]
}|VqPdS)z�Iterate over this subtree and yield all existing files (of any
        kind, including directories) matching the given relative pattern.
        zUnacceptable pattern: {!r}�%Non-relative patterns are unsupportedN)r�r�rrAr�r�rr��r.rlr<r=r�Zselectorrar!r!r"�globjsz	Path.globccsR|j�|f�\}}}|s|r$td��tdt|�|j�}|�|�D]
}|VqBdS)z�Recursively yield all existing files (of any kind, including
        directories) matching the given relative pattern, anywhere in
        this subtree.
        rS)r�N)rrAr�r�rr�rTr!r!r"�rglobwsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)aReturn an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
        Fr=�r@)r<rAr�r�rorpr�r)r.�objr!r!r"�absolute�sz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)z�
        Make the path absolute, resolving all symlinks on the way and also
        normalizing it (for example turning slashes into backslashes under
        Windows).
        )rtNFr=rW)r<rArrvr�rnrYr��normpathr�r)r.rtr`ZnormedrXr!r!r"rv�szPath.resolvecCs|j�|�S)zh
        Return the result of the stat() system call on this path, like
        os.stat() does.
        )r�r�r-r!r!r"r��sz	Path.statcCsddl}|�|��j�jS)z:
        Return the login name of the file owner.
        rN)r�r�r��st_uidZpw_name)r.r�r!r!r"�owner�sz
Path.ownercCsddl}|�|��j�jS)z8
        Return the group name of the file gid.
        rN)�grpZgetgrgidr��st_gidZgr_name)r.r]r!r!r"�group�sz
Path.group�rrRc	Cs(|jr|��tj|||||||jd�S)z|
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        )Zopener)r<rA�ior�rI)r.r��	buffering�encoding�errors�newliner!r!r"r��s
�z	Path.openc
Cs,|jdd��}|��W5QR�SQRXdS)zK
        Open the file in bytes mode, read it, and close the file.
        �rb�r�N�r��readrr!r!r"�
read_bytes�szPath.read_bytesc
Cs0|jd||d��}|��W5QR�SQRXdS)zJ
        Open the file in text mode, read it, and close the file.
        r`�r�rcrdNrh)r.rcrdrr!r!r"�	read_text�szPath.read_textc
Cs6t|�}|jdd��}|�|�W5QR�SQRXdS)zO
        Open the file in bytes mode, write to it, and close the file.
        �wbrgN)�
memoryviewr��write)r.�dataZviewrr!r!r"�write_bytes�szPath.write_bytesc
CsLt|t�std|jj��|jd||d��}|�|�W5QR�SQRXdS)zN
        Open the file in text mode, write to it, and close the file.
        zdata must be str, not %s�wrkN)rrnrr�rEr�ro)r.rprcrdrr!r!r"�
write_text�s
�zPath.write_textTcCsr|jr|��|r>z|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dS)zS
        Create this file with the given access mode, if it doesn't exist.
        N)r<rAr�r�r�ro�O_CREAT�O_WRONLY�O_EXCLrK�close)r.r��exist_okrH�fdr!r!r"�touch�s
z
Path.touchcCs�|jr|��z|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)z<
        Create a new directory at this given path.
        T)r5rxFN)r<rAr�r�rrr4r�r�)r.r�r5rxr!r!r"r�sz
Path.mkdircCs |jr|��|j�||�dS)zF
        Change the permissions of the path, like os.chmod().
        N)r<rAr�r��r.r�r!r!r"r�sz
Path.chmodcCs |jr|��|j�||�dS)z�
        Like chmod(), except if the path points to a symlink, the symlink's
        permissions are changed, rather than its target's.
        N)r<rAr�r�r{r!r!r"r�szPath.lchmodcCs>|jr|��z|j�|�Wntk
r8|s4�YnXdS)zd
        Remove this file or link.
        If the path is a directory, use rmdir() instead.
        N)r<rAr�r�rr)r.Z
missing_okr!r!r"r�%szPath.unlinkcCs|jr|��|j�|�dS)zF
        Remove this directory.  The directory must be empty.
        N)r<rAr�r�r-r!r!r"r�2sz
Path.rmdircCs|jr|��|j�|�S)z�
        Like stat(), except if the path points to a symlink, the symlink's
        status information is returned, rather than its target's.
        )r<rAr�r�r-r!r!r"r�:sz
Path.lstatcCs&|jr|��|j�||�|�|�S)a2
        Rename this path to the target path.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r�r�r�r!r!r"r�Cs
zPath.renamecCs&|jr|��|j�||�|�|�S)aS
        Rename this path to the target path, overwriting if that path exists.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r4r�r�r!r!r"r4Rs
zPath.replacecCs"|jr|��|j�|||�dS)z�
        Make this path a symlink pointing to the target path.
        Note the order of arguments (link, target) is the reverse of os.symlink.
        N)r<rAr�r�)r.r�r�r!r!r"�
symlink_toaszPath.symlink_tocCs |jr|��|j�||�dS)aQ
        Make the target path a hard link pointing to this path.

        Note this function does not make this path a hard link to *target*,
        despite the implication of the function and argument names. The order
        of arguments (target, link) is the reverse of Path.symlink_to, but
        matches that of os.link.

        N)r<rAr�r�r�r!r!r"r�js
zPath.link_toc
CsXz|��WnFtk
r>}zt|�s(�WY�dSd}~XYntk
rRYdSXdS)z+
        Whether this path exists.
        FNT)r�r�r#r��r.r�r!r!r"r�zszPath.existsc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z3
        Whether this path is a directory.
        FN)r	r��st_moder�r#r�r}r!r!r"r��szPath.is_dirc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)zq
        Whether this path is a regular file (also True for symlinks pointing
        to regular files).
        FN)rr�r~r�r#r�r}r!r!r"�is_file�szPath.is_filecCsv|��r|��sdSt|j�}z|��j}Wntk
rBYdSX|��j}||krZdS|��j}|��j}||kS)z;
        Check if this path is a POSIX mount point
        FT)r�r�rr4r��st_devr��st_ino)r.r4Z
parent_devZdevZinoZ
parent_inor!r!r"�is_mount�s



z
Path.is_mountc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z7
        Whether this path is a symbolic link.
        FN)r
r�r~r�r#r�r}r!r!r"r��szPath.is_symlinkc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z6
        Whether this path is a block device.
        FN)r
r�r~r�r#r�r}r!r!r"�is_block_device�szPath.is_block_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z:
        Whether this path is a character device.
        FN)rr�r~r�r#r�r}r!r!r"�is_char_device�szPath.is_char_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z.
        Whether this path is a FIFO.
        FN)rr�r~r�r#r�r}r!r!r"�is_fifo�szPath.is_fifoc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z0
        Whether this path is a socket.
        FN)rr�r~r�r#r�r}r!r!r"�	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)zl Return a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        rNrB�~)r�r�r�rr�r�)r.Zhomedirr!r!r"�
expandusers��zPath.expanduser)N)rG)rJ)F)r`rRNNN)NN)NN)rGT)rJFF)F)F)3rErFrGrHr�r�rr�rBrFrArIrKr8rMrNrQrRrUrVrYrvr�r\r_r�rjrlrqrsrzr�r�r�r�r�r�r�r4r|r�r�r�rr�r�r�r�r�r�r�r!r!r!r"rsj�







�

	



	

	
	c@seZdZdZdZdS)rzsPath subclass for non-Windows systems.

    On a POSIX system, instantiating a Path should return this object.
    r!N)rErFrGrHr�r!r!r!r"rsc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rzqPath subclass for Windows systems.

    On a Windows system, instantiating a Path should return this object.
    r!cCstd��dS)Nz*Path.owner() is unsupported on this systemr�r-r!r!r"r\(szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this systemr�r-r!r!r"r_+szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this systemr�r-r!r!r"r�.szWindowsPath.is_mountN)rErFrGrHr�r\r_r�r!r!r!r"r!s
)Arg�	functoolsrar�ror�rer8�_collections_abcrrrrrrr�operatorrr�r	r
rrr
rrZurllib.parserr�r�r�rZgetwindowsversionr�__all__rr r#r(rr)rIr�r;r:r�r�r?r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrr!r!r!r"�<module>s|$
�
?&i8
,t

_markupbase.cpython-38.pyc000064400000017160151450073350011475 0ustar00U

e5d9�@sVdZddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd	�d	�Z	dS)
z�Shared support for scanning document type declarations in HTML and XHTML.

This module is used as a foundation for the html.parser module.  It has no
documented public API and should not be used directly.

�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZ	d
d�Z
d#dd�Zd$dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)%�
ParserBaseziParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs|jtkrtd��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�#/usr/lib64/python3.8/_markupbase.py�__init__s
�zParserBase.__init__cCstd��dS)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error s�zParserBase.errorcCsd|_d|_dS)N�r��lineno�offsetrrrr�reset$szParserBase.resetcCs|j|jfS)z&Return current line number and offset.rrrrr�getpos(szParserBase.getposcCsb||kr|S|j}|�d||�}|rN|j||_|�d||�}||d|_n|j|||_|S)N�
r
)�rawdata�countr�rindexr)r�i�jrZnlines�posrrr�	updatepos0szParserBase.updatepos�c
Cs�|j}|d}|||�dks&td��|||d�dkrB|dS|||d�dkrZdSt|�}|||d�dkr�|�|�S||d	kr�|�|�S|�||�\}}|d
kr�|S|dkr�d|_||k�r�||}|dk�r||d|�}|dk�r|�|�n
|�|�|dS|d
k�r<t	||�}|�s2dS|�
�}n�|dk�rX|�||�\}	}nt||jk�rn|d}n^|d	k�r�|dk�r�|�|d|�}n$|dk�r�|�d|�n
|�d�n|�d||�|d
kr�|Sq�dS)N��<!z$unexpected call to parse_declarationr
�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�linktype�attlist�element�linkz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)
r�AssertionError�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subsetr)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration@s\














�zParserBase.parse_declarationr
cCs�|j}|||d�dks"td��|�|d|�\}}|dkrB|S|dkr\t�||d�}n4|dkrvt�||d�}n|�d||d|��|s�dS|r�|�d�}|�||d|��|�	d�S)	N�z<![z)unexpected call to parse_marked_section()r>�rcdata�temp�ignore�cdata�include>�endif�else�ifz+unknown status keyword %r in marked sectionr )
rr&r*�_markedsectionclose�search�_msmarkedsectioncloser�startr,r.)rr�reportrZsectNamer�matchrrrr)�s 
zParserBase.parse_marked_sectioncCsj|j}|||d�dkr$|�d�t�||d�}|s<dS|r`|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()r r)rr�
_commentcloser@rBZhandle_commentr.)rrrCrrDrrrrr(�s

zParserBase.parse_commentc
Cs*|j}t|�}|}||k�r&||}|dk�r0|||d�}|dkrJdS|dkrp|�||d�|�d|�|d|kr�dS|d|kr�dS|||d�dkr�|j|d	d
�}|d	kr|Sq|�|d|�\}}|dkr�dS|dk�r|�||d�|�d|�t|d
|�}	|	||�}|d	k�r$|Sq|dk�r�|d|k�rLdS|�|d|�\}}|d	k�rn|S||dk�r$|d}q|dk�r�|d}||k�r�||���r�|d}�q�||k�r�||dk�r�|S|�||�|�d�ndSq|���r
|d}q|�||�|�d|�qdS)N�<rr rr
z*unexpected char in internal subset (in %r)rErFr)rC>r$r#�notation�entityz)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr'rrr(r*�getattr�isspace)
rr�declstartposrr0rr1�sr4Zmethrrrr/�sp


�








z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�krB|�d|�dSdS)Nr rr
)r*r�find)rrrPr4rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkr2dS|dkrB|dS|�||�\}}|dkr^|S|||d�}|dkrzdS|dkr�d||d�kr�|�d|�d}ndS|||d���r�|d}q�||d�s�dSn|�||�\}}|||d�}|�sdS|dk�rDt||�}|�r&|��}ndS|||d�}|�sDdS|d	k�r�||d�d	k�rddS|�|d|�\}}|dk�r�|S|||d�}|�s�dS|dkrB|dSqBdS)
Nr
rr rr�(�)�'"�#)rr*rRrOr-r.)rrrPrr4rr1r3rrr�_parse_doctype_attlistsX





z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}|||d�}|s:dS|dkrJ|dS|dkrnt||�}|sddS|��}q"|�||�\}}|dkr"|Sq"dS)Nrr
r rrV)r*rr-r.)rrrPr4rrr1r3rrr�_parse_doctype_notation=s"

z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkrR|d}|||d�}|s:dS|��rP|d}q"qVq"n|}|�||�\}}|dkrr|S|j||d�}|s�dS|dkr�t||�}|r�|��}q�dSqr|dkr�|dS|�||�\}}|dkrr|SqrdS)Nr
rKr rrVr)rrOr*r-r.)rrrPrrr1r4r3rrr�_parse_doctype_entityTs4


z ParserBase._parse_doctype_entitycCs�|j}t|�}||krdSt||�}|r\|��}|��}|t|�|krLdS|��|��fS|�||�|�d|||d��dS)N)Nr zexpected name token at %r�)	rr'�_declname_match�group�strip�lowerr.rr)rrrPrr0r3rQr4rrrr*xs
�zParserBase._scan_namecCsdS)Nr)rr2rrrr,�szParserBase.unknown_declN)r
)r
)�__name__�
__module__�__qualname__�__doc__r	rrrrr+r5r)r(r/rSrXrYrZr*r,rrrrrs"
R

C9$r)
rc�re�compilerDr\r-rGr?rArrrrr�<module>s


pyclbr.cpython-38.pyc000064400000024325151450073350010500 0ustar00U

e5d�;�@s�dZddlZddlZddlZddlZddlmZmZm	Z	ddddgZ
iZGdd	�d	�ZGd
d�de�Z
Gdd�de�Zdd
�Zddd�Zddd�Zddd�Zd dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�dS)!aParse a Python module and describe its classes and functions.

Parse enough of a Python file to recognize imports and class and
function definitions, and to find out the superclasses of a class.

The interface consists of a single function:
    readmodule_ex(module, path=None)
where module is the name of a Python module, and path is an optional
list of directories where the module is to be searched.  If present,
path is prepended to the system search path sys.path.  The return value
is a dictionary.  The keys of the dictionary are the names of the
classes and functions defined in the module (including classes that are
defined via the from XXX import YYY construct).  The values are
instances of classes Class and Function.  One special key/value pair is
present for packages: the key '__path__' has a list as its value which
contains the package search path.

Classes and Functions have a common superclass: _Object.  Every instance
has the following attributes:
    module  -- name of the module;
    name    -- name of the object;
    file    -- file in which the object is defined;
    lineno  -- line in the file where the object's definition starts;
    parent  -- parent of this object, if any;
    children -- nested objects contained in this object.
The 'children' attribute is a dictionary mapping names to objects.

Instances of Function describe functions with the attributes from _Object.

Instances of Class describe classes with the attributes from _Object,
plus the following:
    super   -- list of super classes (Class instances if possible);
    methods -- mapping of method names to beginning line numbers.
If the name of a super class is not recognized, the corresponding
entry in the list of super classes is not a class instance but a
string giving the name of the super class.  Since import statements
are recognized and imported modules are scanned as well, this
shouldn't happen often.
�N)�NAME�DEDENT�OP�
readmodule�
readmodule_ex�Class�Functionc@s eZdZdZdd�Zdd�ZdS)�_Objectz+Information about Python class or function.cCs(||_||_||_||_||_i|_dS�N)�module�name�file�lineno�parent�children��selfrrr
rr�r�/usr/lib64/python3.8/pyclbr.py�__init__6sz_Object.__init__cCs||j|<dSr
)r)rr�objrrr�	_addchild>sz_Object._addchildN)�__name__�
__module__�__qualname__�__doc__rrrrrrr	4sr	c@seZdZdZddd�ZdS)rz7Information about a Python function, including methods.NcCst�||||||�dSr
)r	rrrrrrDszFunction.__init__)N)rrrrrrrrrrBscs*eZdZdZd�fdd�	Zdd�Z�ZS)rz!Information about a Python class.Ncs0t�||||||�|dkr gn||_i|_dSr
)r	r�super�methods)rrrrr
rr��	__class__rrrJszClass.__init__cCs||j|<dSr
)r)rrrrrr�
_addmethodOszClass._addmethod)N)rrrrrr �
__classcell__rrrrrHscCs:t|j||j||�}|�||�t|t�r6|�||�|S)z*Return a Function after nesting within ob.)rrr
r�
isinstancerr )�ob�	func_namerZnewfuncrrr�_nest_functionSs

r%cCs&t|j|||j||�}|�||�|S)z'Return a Class after nesting within ob.)rrr
r)r#�
class_namerrZnewclassrrr�_nest_class[sr'cCs6i}t||pg���D]\}}t|t�r|||<q|S)z�Return Class objects for the top-level classes in module.

    This is the original interface, before Functions were added.
    )�_readmodule�itemsr"r)r�path�res�key�valuerrrras


cCst||p
g�S)z�Return a dictionary with all functions and classes in module.

    Search for module in PATH + sys.path.
    If possible, include imported superclasses.
    Do this by reading source, without importing (and executing) it.
    )r()rr*rrrrmsc	Cs�|dk	rd||f}n|}|tkr*t|Si}|tjkrL|dkrL|t|<|S|�d�}|dkr�|d|�}||dd�}t|||�}|dk	r�d||f}d|kr�td�|���t||d|�Sd}	|dk	r�|}
n
|tj}
tj	�
||
�}|dk�rtd|��|d	��|t|<|jdk	�r$|j|d<z|j
�|�}Wnttfk
�rR|YSX|dk�rb|S|j
�|�}
t|||
|||�S)
a.Do the hard work for readmodule[_ex].

    If inpackage is given, it must be the dotted name of the package in
    which we are searching for a submodule, and then PATH must be the
    package search path; otherwise, we are searching for a top-level
    module, and path is combined with sys.path.
    Nz%s.%s�.r��__path__zNo package named {}zno module named )r)�_modules�sys�builtin_module_names�rfindr(�ImportError�formatr*�	importlib�util�_find_spec_from_path�ModuleNotFoundError�submodule_search_locations�loader�
get_source�AttributeError�get_filename�_create_tree)rr*�	inpackage�
fullmodule�tree�i�packageZ	submoduler�fZsearch_path�spec�source�fnamerrrr(vsJ	





r(c!
CsHt�|�}g}t�|j�}�z|D�]�\}	}
}}}
|	tkr`|\}}|r^|dd|kr^|d=qBq"|
dkr�|\}}|r�|dd|kr�|d=qpt|�dd�\}	}}|	tkr�q"d}|r�|dd}t|||�}nt	||||�}|||<|�
||f�q"|
dk�r�|\}}|�r(|dd|k�r(|d=�qt|�dd�\}	}}|	tk�rJq"t|�dd�\}	}
}d}|
dk�r�g}d}g}t|�dd�\}	}
}|
d	k�r|dk�rd
�|�}||k�r�||}nL|�d�}t
|�dk�r|d}|d}|tk�rt|}||k�r||}|�
|�g}|
dk�r0|d7}nZ|
d
k�rR|d8}|dk�r��q�n8|
dk�rh|dk�rhn"|	ttfk�rz|dk�rz|�
|
��qz|}|�r�|dd}t||||�}nt|||||�}|||<|�
||f�q"|
dk�rh|ddk�rht|�}|D]d\}}zL|dk�r t||�n2zt|||�Wn tk
�rPt|g�YnXWnYnX�qq"|
dkr"|ddkr"t|�\}}
|r"|
dk�r�q"t|�}zt|||�}WnYq"YnX|D]X\}} ||k�r�|||| �p�|<n0|dk�r�|D] }|ddk�r�||||<�q��q�q"Wntk
�r:YnX|��|S)a�Return the tree for a particular module.

    fullmodule (full module name), inpackage+module, becomes o.module.
    path is passed to recursive calls of _readmodule.
    fname becomes o.file.
    source is tokenized.  Imports cause recursive calls to _readmodule.
    tree is {} or {'__path__': <submodule search locations>}.
    inpackage, None or string, is passed to recursive calls of _readmodule.

    The effect of recursive calls is mutation of global _modules.
    ���r/�defr�N�class�()�)�,�r.���rOrP�import�from�*�_)�io�StringIO�tokenize�generate_tokens�readliner�nextrr%r�append�join�split�lenr1rr'r�_getnamelistr(r5�_getname�
StopIteration�close)!rBr*rIrHrCrArF�stack�g�	tokentype�token�startZ_end�_linerZ
thisindentr$Zcur_funcZcur_objr&Zinherit�names�levelr�n�c�m�dZ	cur_class�modules�modZ_mod2Zn2rrrr@�s�
















��



r@cCslg}t|�\}}|sqh|dkr,t|�\}}nd}|�||f�|dkr\d|kr\t|�d}q>|dkrqhq|S)z�Return list of (dotted-name, as-name or None) tuples for token source g.

    An as-name is the name that follows 'as' in an as clause.
    �asNrP�
r/)rbr]r\)rfrkrrhZname2rrrraEsracCs�g}t|�dd�\}}|tkr0|dkr0d|fS|�|�t|�dd�\}}|dkrXq�t|�dd�\}}|tkrvq�|�|�q:d�|�|fS)zBReturn (dotted-name or None, next-token) tuple for token source g.r�rUNr.)r\rr]r^)rf�partsrgrhrrrrb[s
rbc
CsXddl}ztjd}Wnt}YnX|j�|�rj|j�|�g}|j�|�}|���	d�rn|dd�}ng}t
||�}dd�}t|��|dd	�}d
}|�rT|�
�}t|t�r�q�t|d�s�d|_t|t�r�t|j��|dd	�}|D]}	|j||	_q�|�|�t|t��r,td�d
|j|j|j|j��q�t|t�r�td�d
|j|j|j��q�dS)z?Print module output (default this file) for quick visual check.rNr/z.py���cSst|dd�S)Nrr)�getattr)�arrr�<lambda>|�z_main.<locals>.<lambda>T)r,�reverseru�indentz{}class {} {} {}� z{}def {} {})�osr2�argv�__file__r*�exists�dirname�basename�lower�endswithr�sorted�values�popr"�list�hasattrr}r	r�extendr�printr6rrrr)
rrrr*rCZ
lineno_keyZobjsZindent_levelrZnew_objsr#rrr�_mainmsL





�
�
r��__main__)N)N)N)N)rrWr2�importlib.utilr7rYrhrrr�__all__r1r	rrr%r'rrr(r@rarbr�rrrrr�<module>s,(


	
@&textwrap.cpython-38.opt-2.pyc000064400000014136151450073350012022 0ustar00U

e5d�K�@s�ddlZddddddgZdZGd	d�d�Zddd�Zddd�Zd
d�Ze�dej�Z	e�dej�Z
dd�Zddd�Ze
dkr�eed��dS)�N�TextWrapper�wrap�fill�dedent�indent�shortenz	

 c
@s�eZdZiZed�ZeD]Zeeee�<qdZdZ	de
�e�Zdedd�Z
e
�dee	ee
d	�e
j�Z[[	[
e
�d
e�Z[e
�d�Zd%ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)&r� z[\w!"\'&.,?]z[^\d\W]z[%s]z[^�Na�
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        ))Zwp�ltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\Z�F�TF�z [...])�	max_lines�placeholderc
CsL||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS�N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizerr)
�selfrrrrrrrrrrrr�r� /usr/lib64/python3.8/textwrap.py�__init__sszTextWrapper.__init__cCs(|jr|�|j�}|jr$|�|j�}|Sr)r�
expandtabsrr�	translate�unicode_whitespace_trans�r�textrrr�_munge_whitespace�s
zTextWrapper._munge_whitespacecCs6|jdkr|j�|�}n|j�|�}dd�|D�}|S)NTcSsg|]}|r|�qSrr)�.0�crrr�
<listcomp>�sz&TextWrapper._split.<locals>.<listcomp>)r�
wordsep_re�split�wordsep_simple_re�rr#�chunksrrr�_split�s

zTextWrapper._splitcCs\d}|jj}|t|�dkrX||ddkrN|||�rNd||d<|d7}q|d7}qdS)Nrr	rz  �)�sentence_end_re�search�len)rr,�iZ	patsearchrrr�_fix_sentence_endings�s	
z!TextWrapper._fix_sentence_endingscCs^|dkrd}n||}|jrH|�|dd|��|d|d�|d<n|sZ|�|���dS)Nr	���)r�append�pop)rZreversed_chunks�cur_line�cur_lenrZ
space_leftrrr�_handle_long_word�s
zTextWrapper._handle_long_wordc	Cs�g}|jdkrtd|j��|jdk	rb|jdkr8|j}n|j}t|�t|j���|jkrbtd��|��|�r�g}d}|r�|j}n|j}|jt|�}|j	r�|d�
�dkr�|r�|d=|r�t|d�}|||kr�|�|���||7}q�q�q�|�r&t|d�|k�r&|�
||||�ttt|��}|j	�r\|�r\|d�
�dk�r\|t|d�8}|d=|rj|jdk�s�t|�d|jk�s�|�r�|j	�r�t|�dk�r�|d�
��s�||k�r�|�|d�|��qj|�r0|d�
��r|t|j�|k�r|�|j�|�|d�|���q�|t|d�8}|d=�q�|�rn|d��}t|�t|j�|jk�rn||j|d<�q�|�||j����q�qj|S)Nrzinvalid width %r (must be > 0)r	z#placeholder too large for max widthr4r)r�
ValueErrorrrrr1r�lstrip�reverser�stripr5r6r9�sum�map�join�rstrip)	rr,�linesrr7r8r�lZ	prev_linerrr�_wrap_chunks�s�




 ���
�
���
�zTextWrapper._wrap_chunkscCs|�|�}|�|�Sr)r$r-r"rrr�
_split_chunksPs
zTextWrapper._split_chunkscCs$|�|�}|jr|�|�|�|�Sr)rErr3rDr+rrrrVs	

zTextWrapper.wrapcCsd�|�|��S)N�
)r@rr"rrrrdszTextWrapper.fill)
rrrTTFTTTr
)�__name__�
__module__�__qualname__r!�ordZuspace�_whitespace�xZ
word_punctZletter�re�escapeZ
whitespaceZnowhitespace�compile�VERBOSEr(r*r/rr$r-r3r9rDrErrrrrrrsT1���
��!grcKstfd|i|��}|�|�S�Nr)rr�r#r�kwargs�wrrrrps
cKstfd|i|��}|�|�SrQ)rrrRrrrr}s	cKs,tf|dd�|��}|�d�|������S)Nr	)rrr)rrr@r=r)rRrrrr�sz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCs�d}t�d|�}t�|�}|D]b}|dkr0|}q|�|�r<q|�|�rL|}qtt||��D]$\}\}}||krZ|d|�}qqZqdr�|r�|�d�D]}q�|r�t�d|d|�}|S)NrrrFz(?m)^)	�_whitespace_only_re�sub�_leading_whitespace_re�findall�
startswith�	enumerate�zipr)rM)r#Zmargin�indentsrr2rL�y�linerrrr�s(


cs,�dkrdd�����fdd�}d�|��S)NcSs|��Sr)r=�r^rrr�	predicate�szindent.<locals>.predicatec3s*��d�D]}�|�r�|n|Vq
dS)NT)�
splitlinesr_�r`�prefixr#rr�prefixed_lines�szindent.<locals>.prefixed_linesr)r@)r#rcr`rdrrbrr�s�__main__z Hello there.
  This is indented.)r)r)N)rM�__all__rKrrrrrO�	MULTILINErUrWrrrG�printrrrr�<module>sa

3
rlcompleter.cpython-38.opt-1.pyc000064400000013175151450073350012475 0ustar00U

e5d��@s�dZddlZddlZddlZdgZGdd�d�Zdd�ZzddlZWnek
r\dZ	Yn"Xe�
e�j�e�dd	��d
Z	dS)a1Word completion for GNU readline.

The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.

It's very cool to do "import sys" type "sys.", hit the completion key (twice),
and see the list of names defined by the sys module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")

Notes:

- Exceptions raised by the completer function are *ignored* (and generally cause
  the completion to fail).  This is a feature -- since readline sets the tty
  device in raw (or cbreak) mode, printing a traceback wouldn't work well
  without some complicated hoopla to save, reset and restore the tty state.

- The evaluation of the NAME.NAME... form may cause arbitrary application
  defined code to be executed if an object with a __getattr__ hook is found.
  Since it is the responsibility of the application (or the user) to enable this
  feature, I consider this an acceptable risk.  More complicated expressions
  (e.g. function calls or indexing operations) are *not* evaluated.

- When the original stdin is not a tty device, GNU readline is never
  used, and this module (and the readline module) are silently inactive.

�N�	Completerc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs6|rt|t�std��|dkr&d|_nd|_||_dS)a�Create a new completer for the command line.

        Completer([namespace]) -> completer instance.

        If unspecified, the default namespace where completions are performed
        is __main__ (technically, __main__.__dict__). Namespaces should be
        given as dictionaries.

        Completer instances should be used as the completion mechanism of
        readline via the set_completer() call:

        readline.set_completer(Completer(my_namespace).complete)
        znamespace must be a dictionaryN�r)�
isinstance�dict�	TypeError�use_main_ns�	namespace)�selfr�r
�#/usr/lib64/python3.8/rlcompleter.py�__init__'szCompleter.__init__cCs�|jrtj|_|��sB|dkr>tr8t�d�t��dSdSndS|dkrld|kr`|�	|�|_
n|�|�|_
z|j
|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        This is called successively with state == 0, 1, 2, ... until it
        returns None.  The completion should begin with 'text'.

        r�	�N�.)
r�__main__�__dict__r�strip�_readline_available�readlineZinsert_textZ	redisplay�attr_matches�matches�global_matches�
IndexError)r	�text�stater
r
r�completeBs$
zCompleter.completecCst|�r|d}|S)N�()�callable)r	�val�wordr
r
r�_callable_postfixaszCompleter._callable_postfixc	Cs�ddl}g}dh}t|�}|jD]J}|d|�|kr |�|�|dkrP|d}n|dkr`|d}|�|�q |jtjfD]J}|��D]<\}}|d|�|kr�||kr�|�|�|�|�	||��q�qx|S)z�Compute matches when text is a simple name.

        Return a list of all keywords, built-in functions and names currently
        defined in self.namespace that match.

        rN�__builtins__>�try�finally�:>�break�None�pass�continue�False�True�else� )
�keyword�len�kwlist�add�appendr�builtinsr�itemsr )	r	rr-r�seen�nrZnspacerr
r
rrfs$



zCompleter.global_matchesc	Cshddl}|�d|�}|sgS|�dd�\}}zt||j�}Wntk
rTgYSXtt|��}|�d�t	|d�r�|�
d�|�t|j
��g}t|�}	|dkr�d	}
n|d	kr�d
}
nd}
|D]t}|d|	�|kr�|
r�|d|	d�|
ks�d||f}zt||�}
Wntk
�rYnX|�|
|�}|�|�q�|�s\|
�sF�q\|
d	k�rVd
}
q�d}
q�|��|S)a�Compute matches when text contains a dot.

        Assuming the text is of the form NAME.NAME....[NAME], and is
        evaluable in self.namespace, it will be evaluated and its attributes
        (as revealed by dir()) are used as possible completions.  (For class
        instances, class members are also considered.)

        WARNING: this can still invoke arbitrary C code, if an object
        with a __getattr__ hook is evaluated.

        rNz(\w+(\.\w+)*)\.(\w*)r�r!�	__class__r�_�__z%s.%s)�re�match�group�evalr�	Exception�set�dir�discard�hasattrr0�update�get_class_membersr7r.�getattrr r1�sort)r	rr:�m�expr�attrZ
thisobjectZwordsrr5Znoprefixrr;rr
r
rr�sR



��
zCompleter.attr_matches)N)�__name__�
__module__�__qualname__rrr rrr
r
r
rr&s

cCs.t|�}t|d�r*|jD]}|t|�}q|S)N�	__bases__)r@rBrMrD)�klassZret�baser
r
rrD�s


rDFcCs
t�d�S)N)r�
set_completerr
r
r
r�<lambda>��rQT)
�__doc__�atexitr2r�__all__rrDr�ImportErrorrrPr�registerr
r
r
r�<module>s
shutil.cpython-38.pyc000064400000111044151450073350010510 0ustar00U

e5d1��@s�dZddlZddlZddlZddlZddlZddlZzddlZ[dZWne	k
r^dZYnXzddl
Z
[
dZWne	k
r�dZYnXzddlZ[dZ
Wne	k
r�dZ
YnXzddlmZWne	k
r�dZYnXzddlmZWne	k
�rdZYnXejdkZdZZejdk�r6ddlZne�rDddlZe�rNd	nd
Zeed��ohej�d�ae�oxeed
�ZdZdddddddddddddddddd d!d"d#d$d%d&d'gZGd(d�de�ZGd)d'�d'e�Z Gd*d�de�Z!Gd+d�de�Z"Gd,d-�d-e�Z#Gd.d/�d/e$�Z%Gd0d1�d1e$�Z&d2d3�Z'd4d5�Z(efd6d7�Z)d�d8d�Z*d9d:�Z+d;d<�Z,d=d>�Z-dd?�d@d�Z.dd?�dAd�Z/eedB��r�dd?�dCdD�Z0ndEdD�Z0dd?�dFd�Z1dd?�dGd�Z2dd?�dHd�Z3dId#�Z4d�dJdK�Z5dde3ddfdLd�Z6eej7dM��rdNdO�Z8dPdQ�Z9ndRdO�Z8dSdQ�Z9dTdU�Z:dVdW�Z;ej<ejej=ej>hej?k�ofej@ejAk�ofejejBkZCd�dXd�ZDeCeD_EdYdZ�ZFe3fd[d�ZGd\d]�ZHd^d_�ZId`da�ZJdbdc�ZKd�dedf�ZLd�dgdh�ZMdieLdjgdkfiZNe�r�eLdlgdmfeNdn<eMgdofeNdp<e�r
eLdqgdrfeNds<e
�r eLdtgdufeNdv<dwd�ZOd�dyd�ZPdzd�ZQd�d{d�ZRd|d�ZSd}d~�ZTd�dd �ZUd�d!�ZVd�d��ZWd�d��ZXdd��d�d��ZYd�geYgdkfd�geXgdofd��ZZe�r�d�d�geYgdmfeZdn<e�r�d�d�geYgdrfeZds<e
�r�d�d�geYgdufeZdv<d�d��Z[d�dd��d�d"�Z\eed���rLe�]d��e�^d�d��Z_d�e_j`_d�e_ja_d�e_jb_d�d��Zcn$e�rpe�]d��e�^d�d��Z_d�d��Zcd�d�d$�Zdd�d�d&�Zed�d��ZfejgejhBdfd�d%�ZidS)�z�Utility functions for copying and archiving files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

�NTF)�getpwnam)�getgrnam�nt�posixii�sendfileZlinux�
_fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)rN)�__name__�
__module__�__qualname__�r$r$�/usr/lib64/python3.8/shutil.pyrEsc@seZdZdZdS)r z5Raised when source and destination are the same file.N�r!r"r#�__doc__r$r$r$r%r Hsc@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is
    not supported on a special file (e.g. a named pipe)Nr&r$r$r$r%rKsc@seZdZdZdS)rz+Raised when a command could not be executedNr&r$r$r$r%rOsc@seZdZdZdS)�	ReadErrorz%Raised when an archive cannot be readNr&r$r$r$r%r(Rsr(c@seZdZdZdS)�
RegistryErrorzVRaised when a registry operation with the archiving
    and unpacking registries failsNr&r$r$r$r%r)Usr)c@seZdZdZdS)�_GiveupOnFastCopyzuRaised as a signal to fallback on using raw read()/write()
    file copy when fast-copy functions fail to do so.
    Nr&r$r$r$r%r*Ysr*c
Cs�z|��}|��}Wn*tk
r>}zt|��W5d}~XYnXzt�|||�WnTtk
r�}z6|j|_|j|_|j	t	j
t	jhkr�t|��n|d�W5d}~XYnXdS)zhCopy a regular file content or metadata by using high-performance
    fcopyfile(3) syscall (macOS).
    N)�fileno�	Exceptionr*rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr$r$r%�_fastcopy_fcopyfile^s
r:c
CsDz|��}|��}Wn*tk
r>}zt|��W5d}~XYnXztt�|�jd�}Wntk
rnd}YnXtj	dkr�t
|d�}d}zt�||||�}Wn�tk
�r&}zj|j|_
|j|_|jtjkr�dat|��|jtjkr�|d�|dk�rt�|dtj�dk�rt|��|�W5d}~XYq�X|dk�r6�q@||7}q�dS)z�Copy data from one regular mmap-like fd to another by using
    high-performance sendfile(2) syscall.
    This should work on Linux >= 2.6.33 only.
    Ni�ili@rF)r+r,r*�max�os�fstat�st_sizer-�sys�maxsize�minrr.r/r0r1ZENOTSOCK�_USE_CP_SENDFILEZENOSPC�lseek�SEEK_CUR)r4r5r7r8r9Z	blocksize�offsetZsentr$r$r%�_fastcopy_sendfilers8


 
rFc
Csn|j}|j}tt|���L}||�}|s*q`q||krV|d|��}|�|�W5QRXq||�qW5QRXdS)z�readinto()/memoryview() based variant of copyfileobj().
    *fsrc* must support readinto() method and both files must be
    open in binary mode.
    N)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr$r$r%�_copyfileobj_readinto�srNcCs0|st}|j}|j}||�}|s"q,||�qdS)z=copy data from file-like object fsrc to file-like object fdstN)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr$r$r%r�scCs�t|tj�rJttjd�rJztj�|��t�|��WStk
rHYdSXttjd�r~ztj�||�WStk
r|YdSXtj�	tj�
|��tj�	tj�
|��kS)N�samestatF�samefile)�
isinstancer<�DirEntry�hasattr�pathrQ�statr-rR�normcase�abspath��src�dstr$r$r%�	_samefile�s�r]cCst|tj�r|��St�|�S�N)rSr<rTrW��fnr$r$r%�_stat�sracCs t|tj�r|��Stj�|�Sr^)rSr<rT�
is_symlinkrV�islinkr_r$r$r%�_islink�srd��follow_symlinksc	Cs�t�d||�t||�r(td�||���d}t||g�D]j\}}zt|�}Wntk
r`Yq8Xt�	|j
�r�t|tj
�r�|jn|}td|��tr8|dkr8|j}q8|s�t|�r�t�t�|�|��n
t|d����}t|d���}t�r,z,t||tj�|WW5QR�W5QR�Stk
�r(YnXn�t�rtz(t||�|WW5QR�W5QR�Stk
�rpYnXn>t�r�|dk�r�t||t|t��|W5QR�W5QR�St ||�W5QRXW5QRX|S)z�Copy data from src to dst in the most efficient way possible.

    If follow_symlinks is not set and src is a symbolic link, a new
    symlink will be created instead of copying the file it points to.

    zshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wb)!r?�auditr]r �format�	enumeraterar-rW�S_ISFIFO�st_moderSr<rTrVr�_WINDOWSr>rd�symlink�readlink�open�_HAS_FCOPYFILEr:rZ_COPYFILE_DATAr*rBrFrNrArOr)	r[r\rf�	file_size�ir`�str4r5r$r$r%r	�sD

cCspt�d||�|sFt|�rFtj�|�rFttd�r@tjtj}}qRdSnt	tj
}}||�}||t�|j
��dS)z�Copy mode bits from src to dst.

    If follow_symlinks is not set, symlinks aren't followed if and only
    if both `src` and `dst` are symlinks.  If `lchmod` isn't available
    (e.g. Linux) this method does nothing.

    zshutil.copymode�lchmodN)r?rirdr<rVrcrU�lstatrvra�chmodrW�S_IMODErm)r[r\rfZ	stat_funcZ
chmod_funcrur$r$r%r
!s
�	listxattrcCs�ztj||d�}Wn@tk
rR}z"|jtjtjtjfkr<�WY�dSd}~XYnX|D]j}z&tj|||d�}tj||||d�WqXtk
r�}z |jtj	tjtjtjfkr��W5d}~XYqXXqXdS)z�Copy extended filesystem attributes from `src` to `dst`.

        Overwrite existing attributes.

        If `follow_symlinks` is false, symlinks won't be followed.

        reN)
r<rzr-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\rf�names�er.�valuer$r$r%�
_copyxattr7s	�r�cOsdSr^r$)�args�kwargsr$r$r%r�Osc	
s`t�d||�ddd�dd��|p6t|�o4tj�|�}|rJ�fdd�}n�fdd�}t|tj�rp|j|d	�}n|d
�||d	�}t�	|j
�}|d�||j|jf|d�t
|||d	�z|d�|||d	�Wntk
r�YnXt|d
��r\z|d�||j|d	�WnVtk
�rZ}z6dD]*}tt|��r|jtt|�k�r�qJ�q�W5d}~XYnXdS)a�Copy file metadata

    Copy the permission bits, last access time, last modification time, and
    flags from `src` to `dst`. On Linux, copystat() also copies the "extended
    attributes" where possible. The file contents, owner, and group are
    unaffected. `src` and `dst` are path-like objects or path names given as
    strings.

    If the optional flag `follow_symlinks` is not set, symlinks aren't
    followed if and only if both `src` and `dst` are symlinks.
    zshutil.copystatN)�nsrfcWsdSr^r$)r�rfr�r$r$r%�_nop`szcopystat.<locals>._nopcstt|��Sr^)�getattrr<�r.�r�r$r%�lookupgszcopystat.<locals>.lookupcstt|��}|tjkr|S�Sr^)r�r<�supports_follow_symlinks)r.r`r�r$r%r�ls
rerW�utimerx�st_flagsZchflags)Z
EOPNOTSUPPr3)r?rirdr<rVrcrSrTrWryrm�st_atime_ns�st_mtime_nsr��NotImplementedErrorrUr�r-r1r�)	r[r\rfZfollowr�ru�mode�whyr9r$r�r%rRs4�
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a3Copy data and mode bits ("cp src dst"). Return the file's destination.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".

    If source and destination are the same file, a SameFileError will be
    raised.

    re)r<rV�isdir�join�basenamer	r
�r[r\rfr$r$r%r�s
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a0Copy data and metadata. Return the file's destination.

    Metadata is copied with copystat(). Please see the copystat function
    for more information.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".
    re)r<rVr�r�r�r	rr�r$r$r%r
�s
cs�fdd�}|S)z�Function that can be used as copytree() ignore parameter.

    Patterns is a sequence of glob-style patterns
    that are used to exclude filescs(g}�D]}|�t�||��qt|�Sr^)�extend�fnmatch�filter�set)rVr}�
ignored_names�pattern��patternsr$r%�_ignore_patterns�sz)ignore_patterns.<locals>._ignore_patternsr$)r�r�r$r�r%r�scCs>|dk	r$|t�|�dd�|D��}nt�}tj||d�g}	|tkpJ|tk}
|D�]~}|j|krbqPtj�||j�}tj�||j�}
|
r�|n|}z�|�	�}|r�tjdkr�|j
dd�}|jt
jkr�d}|�r8t�
|�}|r�t�||
�t||
|d�nBtj�|��s|�rWqP|���r,t||
||||d�n
|||
�n*|���rXt||
||||d�n
|||
�WqPtk
�r�}z|	�|jd�W5d}~XYqPtk
�r�}z|	�||
t|�f�W5d}~XYqPXqPzt||�WnJtk
�r*}z*t|d	d�dk�r|	�||t|�f�W5d}~XYnX|	�r:t|	��|S)
NcSsg|]
}|j�qSr$r�)�.0�xr$r$r%�
<listcomp>�sz_copytree.<locals>.<listcomp>)�exist_okrFre)�
dirs_exist_okrZwinerror)r<�fspathr��makedirsr
rr.rVr�rbrW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrpror�exists�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinksr�r��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrbrw�linktor9r�r$r$r%�	_copytree�s`




�
� (&r�c	
CsDt�d||�t�|��}t|�}W5QRXt||||||||d�S)aeRecursively copy a directory tree and return the destination directory.

    dirs_exist_ok dictates whether to raise an exception in case dst or any
    missing parent directory already exists.

    If exception(s) occur, an Error is raised with a list of reasons.

    If the optional symlinks flag is true, symbolic links in the
    source tree result in symbolic links in the destination tree; if
    it is false, the contents of the files pointed to by symbolic
    links are copied. If the file pointed by the symlink doesn't
    exist, an exception will be added in the list of errors raised in
    an Error exception at the end of the copy process.

    You can set the optional ignore_dangling_symlinks flag to true if you
    want to silence this exception. Notice that this has no effect on
    platforms that don't support os.symlink.

    The optional ignore argument is a callable. If given, it
    is called with the `src` parameter, which is the directory
    being visited by copytree(), and `names` which is the list of
    `src` contents, as returned by os.listdir():

        callable(src, names) -> ignored_names

    Since copytree() is called recursively, the callable will be
    called once for each directory that is copied. It returns a
    list of names relative to the `src` directory that should
    not be copied.

    The optional copy_function argument is a callable that will be used
    to copy each file. It will be called with the source path and the
    destination path as arguments. By default, copy2() is used, but any
    function that supports the same signature (like copy()) can be used.

    zshutil.copytree)r�r[r\r�r�r�r�r�)r?rir<�scandir�listr�)	r[r\r�r�r�r�r�Zitrr�r$r$r%rs&
��st_file_attributescCsPz4|jdd�}t�|j�o2|jtj@o0|jtjkWStk
rJYdSXdS�NFre)rW�S_ISDIRrmr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrur$r$r%�
_rmtree_isdir6s
�r�cCsLz0t�|�}t�|j�p.|jtj@o.|jtjkWSt	k
rFYdSXdS)NF)
r<rwrW�S_ISLNKrmr�r�r�r�r-)rVrur$r$r%�_rmtree_islink?s

�r�cCs*z|jdd�WStk
r$YdSXdSr�)r�r-)r�r$r$r%r�HscCstj�|�Sr^)r<rVrc)rVr$r$r%r�Nsc	Cs&z"t�|��}t|�}W5QRXWn*tk
rL|tj|t���g}YnX|D]�}|j}t|�r�z|��rvtd��Wn,tk
r�|tjj	|t���YqRYnXt
||�qRzt�|�WqRtk
r�|tj|t���YqRXqRzt�|�Wn(tk
�r |tj|t���YnXdS)N�%Cannot call rmtree on a symbolic link)
r<r�r�r-r?�exc_inforVr�rbrc�_rmtree_unsafe�unlink�rmdir)rV�onerror�
scandir_itr�r��fullnamer$r$r%r�Rs0

r�c
Cs.z"t�|��}t|�}W5QRXWn@tk
rb}z"||_|tj|t���WY�dSd}~XYnX|D�]�}tj�||j	�}z|j
dd�}Wntk
r�d}YnNX|r�z|jdd�}	t�|	j
�}Wn*tk
r�|tj|t���YqhYnX|�r�ztj|j	tj|d�}
Wn(tk
�r:|tj|t���Yn�Xz�tj�|	t�|
���r�t|
||�ztj|j	|d�Wn(tk
�r�|tj|t���YnXn8ztd��Wn*tk
�r�|tjj|t���YnXW5t�|
�Xqhztj|j	|d�Wqhtk
�r&|tj|t���YqhXqhdS)NFre)�dir_fdr�)r<r�r�r-r/r?r�rVr�r.r�rWr�rmrwrq�O_RDONLY�closerQr=�_rmtree_safe_fdr�rcr�)�topfdrVr�r�r�r9r�r�r��orig_st�dirfdr$r$r%r�qsR


r�c	Cs�t�d|�|rdd�}n|dkr*dd�}t�r`t|t�rDt�|�}zt�|�}Wn(tk
rz|tj|t�	��YdSXzt�
|tj�}Wn(tk
r�|tj
|t�	��YdSXz�tj
�|t�|���rt|||�zt�|�Wn(tk
�r|tj|t�	��YnXn8ztd��Wn*tk
�rL|tj
j|t�	��YnXW5t�|�XnNzt|��rttd��Wn,tk
�r�|tj
j|t�	��YdSXt||�SdS)a�Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if onerror
    is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is platform and implementation dependent;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
    is false and onerror is None, an exception is raised.

    z
shutil.rmtreecWsdSr^r$�r�r$r$r%r��szrmtree.<locals>.onerrorNcWs�dSr^r$r�r$r$r%r��sr�)r?ri�_use_fd_functionsrS�bytesr<�fsdecoderwr,r�rqr�r�rVrQr=r�r�r-rcr�r�)rV�
ignore_errorsr�r��fdr$r$r%r�sJ



cCs&tjjtjjpd}tj�|�|��S)N�)r<rV�sep�altsepr��rstrip)rVr�r$r$r%�	_basename�sr�c	CsTt�d||�|}tj�|�rbt||�r8t�||�dStj�|t|��}tj�	|�rbt
d|��zt�||�Wn�tk
�rNtj�|�r�t�
|�}t�||�t�|�n�tj�|��r6t||�r�t
d||f��t|��st�|tj��st�|��rtjdk�rtd||f��t|||dd�t|�n|||�t�|�YnX|S)	a+Recursively move a file or directory to another location. This is
    similar to the Unix "mv" command. Return the file or directory's
    destination.

    If the destination is a directory or a symlink to a directory, the source
    is moved inside the directory. The destination path must not already
    exist.

    If the destination already exists but is not a directory, it may be
    overwritten depending on os.rename() semantics.

    If the destination is on our current filesystem, then rename() is used.
    Otherwise, src is copied to the destination and then removed. Symlinks are
    recreated under the new name if os.rename() fails because of cross
    filesystem renames.

    The optional `copy_function` argument is a callable that will be used
    to copy the source or it will be delegated to `copytree`.
    By default, copy2() is used, but any function that supports the same
    signature (like copy()) can be used.

    A lot more could be done here...  A look at a mv.c shows a lot of
    the issues this implementation glosses over.

    zshutil.moveNz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.�darwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)r�r�)r?rir<rVr�r]�renamer�r�r�rr-rcrpror��
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)r[r\r�Zreal_dstr�r$r$r%r�sL


�
�����

cCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�Sr^)r<rVrY�endswithr��
startswithrZr$r$r%r�/sr�cCs(t|�}tjtjg}t|d�o&|j|kS)Nr�)rarW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[ruZimmutable_statesr$r$r%r�8sr�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns a gid, given a group name.N�)r�KeyError�r.�resultr$r$r%�_get_gid=s
r�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns an uid, given a user name.Nr�)rr�r�r$r$r%�_get_uidIs
r��gzipcs |dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���d	dl}	|rfd
|nd}
|d|
}tj�|�}|r�tj�	|�s�|dk	r�|�
d|�|s�t�|�|dk	r�|�
d
�t���t
�������fdd�}
|�s|	�|d|�}z|j||
d�W5|��X|S)a�Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", or None.

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_name' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", or ".xz").

    Returns the output filename.
    Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|Sr^)�gidZgname�uid�uname)Ztarinfo�r��group�ownerr�r$r%�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorrj�tarfiler<rV�dirnamer��infor�r�r�rqr��add)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionr�Zcompress_extZarchive_name�archive_dirr��tarr$r�r%�
_make_tarballUs>�

	
r	c	Csnddl}|d}tj�|�}|rNtj�|�sN|dk	r@|�d|�|sNt�|�|dk	rd|�d||�|�sj|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dk	r�|�d|	�t�|�D]�\}
}}t
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dk	r�|�d|	�q�|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|dk	�r|�d|	��qq�W5QRX|S)	z�Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Returns the
    name of the output zip file.
    rN�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVr�r�r�r��ZipFileZZIP_DEFLATED�normpath�curdirrH�walk�sortedr��isfile)rrrrrrZzip_filenamerZzfrV�dirpathZdirnames�	filenamesr.r$r$r%�
_make_zipfile�sH
��

rr)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)z�Returns a list of supported formats for archiving and unarchiving.

    Each element of the returned sequence is a tuple (name, description)
    cSsg|]\}}||df�qS)r�r$)r�r.�registryr$r$r%r��sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr$r$r%r�s
�r�cCst|dkrg}t|�s td|��t|ttf�s6td��|D]&}t|ttf�rXt|�dkr:td��q:|||ft|<dS)auRegisters an archive format.

    name is the name of the format. function is the callable that will be
    used to create archives. If provided, extra_args is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_archive_formats() function.
    NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorrS�tupler��lenr)r.�function�
extra_args�descriptionZelementr$r$r%r�s	
cCs
t|=dSr^)rr�r$r$r%r�sc	
Cst�d||||�t��}	|dk	rP|dk	r6|�d|�tj�|�}|sPt�|�|dkr^tj}||d�}
zt	|}Wn"t
k
r�td|�d�YnX|d}|dD]\}
}||
|
<q�|dkr�||
d	<||
d
<z|||f|
�}W5|dk	�r|dk	�r|�d|	�t�|	�X|S)aCreate an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", or "xztar".  Or any other registered format.

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    zshutil.make_archiveNzchanging into '%s')rrzunknown archive format '%s'r�rr�r�zchanging back to '%s')r?rir<�getcwd�debugrVrY�chdirrrr�r�)rrjZroot_dirrrrr�r�rZsave_cwdr��format_info�func�arg�valr/r$r$r%r�s8




cCsdd�t��D�}|��|S)z�Returns a list of supported formats for unpacking.

    Each element of the returned sequence is a tuple
    (name, extensions, description)
    cSs"g|]\}}||d|df�qS)r�r$)r�r.r�r$r$r%r�3sz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSrrrr$r$r%r-s
�c	Csji}t��D]\}}|dD]}|||<qq|D]$}||kr0d}t||||f��q0t|�sftd��dS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)r,rr)rr)	�
extensionsr r!Zexisting_extensionsr.r��ext�	extension�msgr$r$r%�_check_unpack_options8s�
r1cCs,|dkrg}t|||�||||ft|<dS)aMRegisters an unpack format.

    `name` is the name of the format. `extensions` is a list of extensions
    corresponding to the format.

    `function` is the callable that will be
    used to unpack archives. The callable will receive archives to unpack.
    If it's unable to handle an archive, it needs to raise a ReadError
    exception.

    If provided, `extra_args` is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_unpack_formats() function.
    N)r1r,)r.r-r r!r"r$r$r%rJscCs
t|=dS)z*Removes the pack format from the registry.N)r,r�r$r$r%r`scCs&tj�|�}tj�|�s"t�|�dS)z1Ensure that the parent directory of `path` existsN)r<rVr�r�r�)rVr�r$r$r%�_ensure_directorydsr2c		Cs�ddl}|�|�std|��|�|�}z�|��D]�}|j}|�d�s2d|krPq2tj	j
|f|�d���}|snq2t|�|�
d�s2|�|j�}t|d�}z|�|�W5|��~Xq2W5|��XdS)z+Unpack zip `filename` to `extract_dir`
    rNz%s is not a zip file�/z..rh)rZ
is_zipfiler(r
r�Zinfolistr/r�r<rVr��splitr2r�rPrqrH)	r/�extract_dirrrr�r.�target�data�fr$r$r%�_unpack_zipfilejs*




r9r�cCs\ddl}z|�|�}Wn"|jk
r8td|��YnXz|j||d�W5|��XdS)zAUnpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
    rNz/%s is not a compressed or uncompressed tar filer�)r�rqZTarErrorr(r�Z
extractall)r/r5r�r�Ztarobjr$r$r%�_unpack_tarfile�s�
r:r�r
)rrz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D],\}}|dD]}|�|�r|SqqdS)Nr)r,rr�)r/r.r�r/r$r$r%�_find_unpack_format�s

r;cCs�t�d|||�|dkr t��}t�|�}t�|�}|dkrBi}nd|i}|dk	r�zt|}Wn$tk
r�td�|��d�YnX|d}|||ft	|d�|��nRt
|�}|dkr�td�|���t|d}t	t|d�}|�|�|||f|�dS)a]Unpack an archive.

    `filename` is the name of the archive.

    `extract_dir` is the name of the target directory, where the archive
    is unpacked. If not provided, the current working directory is used.

    `format` is the archive format: one of "zip", "tar", "gztar", "bztar",
    or "xztar".  Or any other registered format.  If not provided,
    unpack_archive will use the filename extension and see if an unpacker
    was registered for that extension.

    In case none is found, a ValueError is raised.

    If `filter` is given, it is passed to the underlying
    extraction function.
    zshutil.unpack_archiveNr�zUnknown unpack format '{0}'r#r�zUnknown archive format '{0}')
r?rir<r$r�r,r�r�rj�dictr;r(�update)r/r5rjr�Z
filter_kwargsr'r(r�r$r$r%r�s,


�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�S)z�Return disk usage statistics about the given path.

        Returned value is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )r<r>�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVru�free�total�usedr$r$r%r?�s

cCs"t�|�\}}||}t|||�S)z�Return disk usage statistics about the given path.

        Returned values is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )rZ
_getdiskusagerD)rVrFrErGr$r$r%r?�scCs�t�d|||�|dkr(|dkr(td��|}|}|dkr>d}n(t|t�rft|�}|dkrftd�|���|dkrtd}n(t|t�s�t	|�}|dkr�td�|���t
�|||�dS)z�Change owner user and group of the given path.

    user and group can be the uid/gid or the user/group names, and in that case,
    they are converted to their respective uid/gid.
    zshutil.chownNzuser and/or group must be set���zno such user: {!r}zno such group: {!r})r?rir�rSr�r��LookupErrorrj�intr�r<r)rV�userr�Z_userZ_groupr$r$r%rs$

��P�c
Cs�zttjd�}Wnttfk
r.d}YnXzttjd�}Wnttfk
r^d}YnX|dksp|dkr�zt�tj���}Wn$t	tt
fk
r�t�|�}YnX|dkr�|j}|dkr�|j
}t�||f�S)aGet the size of the terminal window.

    For each of the two dimensions, the environment variable, COLUMNS
    and LINES respectively, is checked. If the variable is defined and
    the value is a positive integer, it is used.

    When COLUMNS or LINES is not defined, which is the common case,
    the terminal connected to sys.__stdout__ is queried
    by invoking os.get_terminal_size.

    If the terminal size cannot be successfully queried, either because
    the system doesn't support querying, or because we are not
    connected to a terminal, the value given in fallback parameter
    is used. Fallback defaults to (80, 24) which is the default
    size used by many terminal emulators.

    The value returned is a named tuple of type os.terminal_size.
    ZCOLUMNSrZLINES)rJr<�environr�r�rr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)ZfallbackrSrT�sizer$r$r%r(s$

cCs&tj�|�o$t�||�o$tj�|�Sr^)r<rVr�r�r�)r`r�r$r$r%�
_access_checkYs�rVc
	s�tj���rt�|�r�SdSt�t�}|dkrttj�dd�}|dkrtzt�d�}Wnt	t
fk
rrtj}YnX|s|dS|r�t�|�}|�
t�tj��}nt�|�}|�
tj�}tjdk�rTtj}|r�t�|�}||kr�|�d|�t�d�p�t}dd�|�
tj�D�}|�r d	d�|D�}t�fd
d�|D���r@�g}n�fdd�|D�}n�g}t�}|D]X}	tj�|	�}
|
|k�rd|�|
�|D],}tj�|	|�}t||��r�|S�q��qddS)
a3Given 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.

    N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr$r$�r�r.r$r$r%r��szwhich.<locals>.<listcomp>cSsg|]}t�|��qSr$)r<�fsencoderYr$r$r%r��sc3s |]}����|���VqdSr^)�lowerr�rY��cmdr$r%�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSr$r$rYr\r$r%r��s)r<rVr�rVrSr�rO�get�confstrrQr��defpathrZr4�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
r]r�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r$r\r%r^sV







)r)F)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)rL)jr'r<r?rWr��collectionsr1�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrprr.rnrrrOrUr�r�rBrrre�__all__r-rr rrr(r,r)r*r:rFrNrr]rardr	r
r�rrr
rr�r�stat_resultr�r�r�r�rqr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�rr�r�r�r�r	rrrrrrrr1rrr2r9r:r,r;rr��
namedtuplerDrFrGrEr?rrrV�F_OK�X_OKrr$r$r$r%�<module>st






�
@

7B
�
A�
.	
	4�
�
�
>?	�
A
-
����

�
8�
"�
�
�
�2



 
1plistlib.cpython-38.opt-1.pyc000064400000064734151450073350011776 0ustar00U

e5d�}�
@s>dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZejdded�Ze��ej�ejdd��Zdd�Zdd�Zdd�Zdd�ZGdd�d�ZGdd
�d
�ZdZe� d�Z!dLd!d"�Z"d#d$�Z#e� d%ej$�Z%d&d'�Z&d(d)�Z'd*d+�Z(Gd,d-�d-�Z)Gd.d/�d/�Z*Gd0d1�d1e*�Z+d2d3�Z,Gd4d�de-�Z.d5d6d7d8d9�Z/e0�Z1Gd:d;�d;�Z2d<d=�Z3e4e5e6eje7fZ8Gd>d?�d?e0�Z9d@dA�Z:e;e<e,e)e+dB�e=e<e:e2e9dB�iZ>ddCe<dD�dEd	�Z?ddCe<dD�dFd�Z@e;dCdGdH�dId
�ZAe;dGdCdJ�dKd�ZBdS)Ma�plistlib.py -- a tool to generate and parse MacOSX .plist files.

The property list (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.

To write out a plist file, use the dump(value, file)
function. 'value' is the top level object, 'file' is
a (writable) file object.

To parse a plist from a file, use the load(file) function,
with a (readable) file object as the only argument. It
returns the top level object (again, usually a dictionary).

To work with plist data in bytes objects, you can use loads()
and dumps().

Values can be strings, integers, floats, booleans, tuples, lists,
dictionaries (but only with string keys), Data, bytes, bytearray, or
datetime.datetime objects.

Generate Plist example:

    pl = dict(
        aString = "Doodah",
        aList = ["A", "B", 12, 32.1, [1, 2, 3]],
        aFloat = 0.1,
        anInt = 728,
        aDict = dict(
            anotherString = "<hello & hi there!>",
            aUnicodeValue = "M\xe4ssig, Ma\xdf",
            aTrueValue = True,
            aFalseValue = False,
        ),
        someData = b"<binary gunk>",
        someMoreData = b"<lots of binary gunk>" * 10,
        aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
    )
    with open(fileName, 'wb') as fp:
        dump(pl, fp)

Parse Plist example:

    with open(fileName, 'rb') as fp:
        pl = load(fp)
    print(pl["aKey"])
�	readPlist�
writePlist�readPlistFromBytes�writePlistToBytes�Data�InvalidFileException�FMT_XML�
FMT_BINARY�load�dump�loads�dumps�UID�N)�BytesIO)�warn)�ParserCreate�PlistFormatzFMT_XML FMT_BINARY)�modulec	cs2t|t�r(t||��}|VW5QRXn|VdS�N)�
isinstance�str�open)�
pathOrFile�mode�fp�r� /usr/lib64/python3.8/plistlib.py�_maybe_openOs
rc
Cs<tdtd�t|d��}t|ddd�W5QR�SQRXdS)z�
    Read a .plist from a path or file. pathOrFile should either
    be a file name, or a readable binary file object.

    This function is deprecated, use load instead.
    z8The readPlist function is deprecated, use load() instead��rbNF��fmt�use_builtin_types)r�DeprecationWarningrr	)rrrrrrYs�c	Cs8tdtd�t|d��}t||tddd�W5QRXdS)z�
    Write 'value' to a .plist file. 'pathOrFile' may either be a
    file name or a (writable) file object.

    This function is deprecated, use dump instead.
    z9The writePlist function is deprecated, use dump() insteadr�wbTF�r!�	sort_keys�skipkeysN)rr#rr
r)�valuerrrrrrfs�cCstdtd�tt|�ddd�S)z}
    Read a plist data from a bytes object. Return the root object.

    This function is deprecated, use loads instead.
    zBThe readPlistFromBytes function is deprecated, use loads() insteadrNFr )rr#r	r��datarrrrss
�cCs,tdtd�t�}t||tddd�|��S)zp
    Return 'value' as a plist-formatted bytes object.

    This function is deprecated, use dumps instead.
    zAThe writePlistToBytes function is deprecated, use dumps() insteadrTFr%)rr#rr
r�getvalue)r(�frrrr~s�c@s>eZdZdZdd�Zedd��Zddd�Zd	d
�Zdd�Z	d
S)rz]
    Wrapper for binary data.

    This class is deprecated, use a bytes object instead.
    cCst|t�std��||_dS)Nzdata must be as bytes)r�bytes�	TypeErrorr*��selfr*rrr�__init__�s
z
Data.__init__cCs|t|��Sr)�_decode_base64)�clsr*rrr�
fromBase64�szData.fromBase64�LcCst|j|�Sr)�_encode_base64r*)r0�
maxlinelengthrrr�asBase64�sz
Data.asBase64cCs4t||j�r|j|jkSt|t�r,|j|kStSdSr)r�	__class__r*r-�NotImplemented�r0�otherrrr�__eq__�s


zData.__eq__cCsd|jjt|j�fS�Nz%s(%s)�r9�__name__�reprr*�r0rrr�__repr__�sz
Data.__repr__N)r5)
r@�
__module__�__qualname__�__doc__r1�classmethodr4r8r=rCrrrrr�s

c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r
cCs<t|t�std��|dkr"td��|dkr2td��||_dS)Nzdata must be an int�zUIDs cannot be >= 2**64r�UIDs must be positive)r�intr.�
ValueErrorr*r/rrrr1�s
zUID.__init__cCs|jSrr)rBrrr�	__index__�sz
UID.__index__cCsd|jjt|j�fSr>r?rBrrrrC�szUID.__repr__cCs|j|jffSr)r9r*rBrrr�
__reduce__�szUID.__reduce__cCst|t�stS|j|jkSr)rr
r:r*r;rrrr=�s
z
UID.__eq__cCs
t|j�Sr)�hashr*rBrrr�__hash__�szUID.__hash__N)	r@rDrEr1rLrCrMr=rOrrrrr
�s	s�<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
zv[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]r5cCsP|dd}g}tdt|�|�D]$}||||�}|�t�|��q d�|�S)N��r�)�range�len�append�binasciiZ
b2a_base64�join)�sr7Z
maxbinsize�pieces�i�chunkrrrr6�sr6cCs(t|t�rt�|�d��St�|�SdS)N�utf-8)rrrVZ
a2b_base64�encode)rXrrrr2�s
r2z{(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?ZcCsLd}t�|���}g}|D]&}||}|dkr2qB|�t|��qtj|�S)N�ZyearZmonthZdayZhourZminute�second)�_dateParser�match�	groupdictrUrJ�datetime)rX�orderZgdZlst�key�valrrr�_date_from_string�srgcCs d|j|j|j|j|j|jfS)Nz%04d-%02d-%02dT%02d:%02d:%02dZr^)�drrr�_date_to_strings�ricCsZt�|�}|dk	rtd��|�dd�}|�dd�}|�dd�}|�dd�}|�d	d
�}|S)Nz<strings can't contains control characters; use bytes insteadz
�
�
�&z&amp;�<z&lt;�>z&gt;)�_controlCharPat�searchrK�replace)�text�mrrr�_escapes
rtc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�_PlistParsercCs"g|_d|_d|_||_||_dSr)�stack�current_key�root�_use_builtin_types�
_dict_type�r0r"�	dict_typerrrr1s
z_PlistParser.__init__cCsBt�|_|j|j_|j|j_|j|j_|j|j_	|j�
|�|jSr)r�parser�handle_begin_elementZStartElementHandler�handle_end_elementZEndElementHandler�handle_dataZCharacterDataHandler�handle_entity_declZEntityDeclHandlerZ	ParseFilerx)r0Zfileobjrrr�parses



z_PlistParser.parsecCstd��dS)Nz8XML entity declarations are not supported in plist files)r)r0Zentity_nameZis_parameter_entityr(�baseZ	system_idZ	public_idZ
notation_namerrrr�$sz_PlistParser.handle_entity_declcCs*g|_t|d|d�}|dk	r&||�dS)NZbegin_)r*�getattr)r0�element�attrs�handlerrrrr~*sz!_PlistParser.handle_begin_elementcCs"t|d|d�}|dk	r|�dS)NZend_)r�)r0r�r�rrrr0sz_PlistParser.handle_end_elementcCs|j�|�dSr)r*rUr/rrrr�5sz_PlistParser.handle_datacCs�|jdk	rFt|jdti��s.td|jj��||jd|j<d|_nB|jsT||_n4t|jdtg��sxtd|jj��|jd�|�dS)N���zunexpected element at line %d)	rwrrv�typerKr}�CurrentLineNumberrxrU�r0r(rrr�
add_object8s
��z_PlistParser.add_objectcCsd�|j�}g|_|S)N�)rWr*r/rrr�get_dataHsz_PlistParser.get_datacCs"|��}|�|�|j�|�dSr)rzr�rvrU)r0r�rhrrr�
begin_dictOs
z_PlistParser.begin_dictcCs*|jrtd|j|jjf��|j��dS)Nz%missing value for key '%s' at line %d)rwrKr}r�rv�poprBrrr�end_dictTs
�z_PlistParser.end_dictcCs8|jst|jdti��s*td|jj��|��|_dS)Nr�zunexpected key at line %d)rwrrvr�rKr}r�r�rBrrr�end_keyZs
�z_PlistParser.end_keycCsg}|�|�|j�|�dSr)r�rvrU)r0r��arrr�begin_array`s
z_PlistParser.begin_arraycCs|j��dSr)rvr�rBrrr�	end_arrayesz_PlistParser.end_arraycCs|�d�dS)NT�r�rBrrr�end_truehsz_PlistParser.end_truecCs|�d�dS)NFr�rBrrr�	end_falseksz_PlistParser.end_falsecCs@|��}|�d�s|�d�r.|�t|d��n|�t|��dS)NZ0xZ0X�)r��
startswithr�rJ)r0�rawrrr�end_integernsz_PlistParser.end_integercCs|�t|����dSr)r��floatr�rBrrr�end_realusz_PlistParser.end_realcCs|�|���dSr)r�r�rBrrr�
end_stringxsz_PlistParser.end_stringcCs2|jr|�t|����n|�t�|����dSr)ryr�r2r�rr4rBrrr�end_data{sz_PlistParser.end_datacCs|�t|����dSr)r�rgr�rBrrr�end_date�sz_PlistParser.end_dateN)r@rDrEr1r�r�r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrus(	ruc@s8eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zd	S)�_DumbXMLWriterr�	cCs||_g|_||_||_dSr)�filerv�
_indent_level�indent)r0r��indent_levelr�rrrr1�sz_DumbXMLWriter.__init__cCs,|j�|�|�d|�|jd7_dS)Nz<%s>�)rvrU�writelnr��r0r�rrr�
begin_element�sz_DumbXMLWriter.begin_elementcCs |jd8_|�d|�dS)Nr�z</%s>)r�r�r�rrr�end_element�sz_DumbXMLWriter.end_elementNcCs8|dk	r&t|�}|�d|||f�n|�d|�dS)Nz<%s>%s</%s>z<%s/>)rtr�)r0r�r(rrr�simple_element�sz_DumbXMLWriter.simple_elementcCsH|r8t|t�r|�d�}|j�|j|j�|j�|�|j�d�dS)Nr\�
)rrr]r��writer�r�)r0�linerrrr��s

z_DumbXMLWriter.writeln)rr�)N)r@rDrEr1r�r�r�r�rrrrr��s


r�c@sFeZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dS)�_PlistWriterr�	r�TFcCs.|r|�t�t�||||�||_||_dSr)r��PLISTHEADERr�r1�
_sort_keys�	_skipkeys)r0r�r�r�ZwriteHeaderr&r'rrrr1�s

z_PlistWriter.__init__cCs"|�d�|�|�|�d�dS)Nz<plist version="1.0">z</plist>)r��write_valuer�rrrr��s

z_PlistWriter.writecCs4t|t�r|�d|��n|dkr0|�d��n|dkrD|�d�n�t|t�r�d|krbdkrxnn|�dd	|�nt|��n�t|t�r�|�d
t|��n�t|t�r�|�|�n|t|t	�r�|�
|�nft|ttf�r�|�
|�nLt|tj��r|�dt|��n,t|ttf��r |�|�ntdt|���dS)
N�stringT�trueFZfalsel����rHZintegerz%d�real�datezunsupported type: %s)rrr�rJ�
OverflowErrorr�rA�dict�
write_dictr�
write_datar-�	bytearray�write_bytesrcri�tuple�list�write_arrayr.r�r�rrrr��s.





z_PlistWriter.write_valuecCs|�|j�dSr)r�r*r/rrrr��sz_PlistWriter.write_datacCsz|�d�|jd8_tddt|j�dd�|j��}t||��d�D]}|rJ|�|�qJ|jd7_|�	d�dS)Nr*r�r�r5r�s        r�)
r�r��maxrTr�rqr6�splitr�r�)r0r*r7r�rrrr��s
�z_PlistWriter.write_bytescCs�|rt|�d�|jr"t|���}n|��}|D]8\}}t|t�sP|jrHq.td��|�d|�|�	|�q.|�
d�n
|�d�dS)Nr��keys must be stringsre)r�r��sorted�itemsrrr�r.r�r�r�)r0rhr�rer(rrrr��s

z_PlistWriter.write_dictcCs<|r.|�d�|D]}|�|�q|�d�n
|�d�dS)N�array)r�r�r�r�)r0r�r(rrrr�s
z_PlistWriter.write_arrayN)rr�r�TF)
r@rDrEr1r�r�r�r�r�r�rrrrr��s�

%
r�cCs�d}|D]}|�|�rdSqtjdftjdftjdffD]N\}}|�|�sNq:|D]4}||�d��|�}|dt|��|krRdSqRq:dS)N)s<?xmls<plistTr\z	utf-16-bez	utf-16-le�asciiF)r��codecs�BOM_UTF8�BOM_UTF16_BE�BOM_UTF16_LE�decoder]rT)�header�prefixesZpfxZbom�encoding�start�prefixrrr�_is_fmt_xmls
�
r�c@seZdZddd�ZdS)r�Invalid filecCst�||�dSr)rKr1)r0�messagerrrr12szInvalidFileException.__init__N)r�)r@rDrEr1rrrrr1s�B�H�L�Q)r�rrP�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�_BinaryPlistParsera
    Read or write a binary plist file, following the description of the binary
    format.  Raise InvalidFileException in case of error, otherwise return the
    root object.

    see also: http://opensource.apple.com/source/CF/CF-744.18/CFBinaryPList.c
    cCs||_||_dSr)ryrzr{rrrr1Asz_BinaryPlistParser.__init__cCs�z~||_|j�dtj�|j�d�}t|�dkr6t��t�d|�\}|_	}}}|j�|�|�
||�|_tg||_
|�|�WStttjttfk
r�t��YnXdS)Ni��� z>6xBBQQQ)�_fp�seek�os�SEEK_END�readrTr�struct�unpack�	_ref_size�
_read_ints�_object_offsets�
_undefined�_objects�_read_object�OSError�
IndexError�errorr�rK)r0r�trailer�offset_size�num_objects�
top_object�offset_table_offsetrrrr�Es*
��z_BinaryPlistParser.parsecCsL|dkrH|j�d�dd@}d|>}dt|}t�||j�|��dS|S)z$ return the size of the next object.�r�rrQrn)r�r��_BINARY_FORMATr�r�)r0�tokenLrsrXr,rrr�	_get_size^sz_BinaryPlistParser._get_sizecst|j��|���tkr2t�d|�t�����S�rFt���|krLt��t��fdd�td�|��D��SdS)Nrnc3s&|]}t��||��d�VqdS)�bigN)rJ�
from_bytes)�.0rZ�r*�sizerr�	<genexpr>os�z0_BinaryPlistParser._read_ints.<locals>.<genexpr>r)	r�r�r�r�r�rTrr�rS)r0�nr�rr�rr�hs�z_BinaryPlistParser._read_intscCs|�||j�Sr)r�r�)r0r�rrr�
_read_refsrsz_BinaryPlistParser._read_refscs�j|}|tk	r|S�j|}�j�|��j�d�d}|d@|d@}}|dkr^d}�n�|dkrnd}�n�|dkr~d	}�n�|dkr�d
}�n�|dkr�tj�j�d|>�d|d
kd�}�nT|dkr�t�	d�j�d��d}�n0|dk�rt�	d�j�d��d}�n
|dk�rDt�	d�j�d��d}t
�
ddd�t
j|d�}�n�|dk�r���|�}�j�|�}t
|�|k�rxt���j�st|�}�n�|dk�rΈ�|�}�j�|�}	t
|	�|k�r�t��|	�d�}�n@|dk�r��|�d}�j�|�}	t
|	�|k�rt��|	�d�}n�|dk�r:tt��j�d|�d��}n�|dk�r���|�}��|�}
g}|�j|<|��fdd �|
D��n�|d!k�r��|�}��|�}��|�}
���}|�j|<z.t||
�D]\}}
��|
�|��|�<�q�Wntk
�rt��YnXnt��|�j|<|S)"zx
        read the object by reference.

        May recursively read sub-objects (content of an array/dict/set)
        r�r��r�Nr�F�	TrRr�r�rQ�Zsigned�"z>frP�#z>d�3��)Zseconds�@�Pr��`r�utf-16be��c3s|]}��|�VqdSr)r�)r��xrBrrr��sz2_BinaryPlistParser._read_object.<locals>.<genexpr>��)r�r�r�r�r�r�rJr�r�r�rcZ	timedeltar�rTrryrr�r
r��extendrz�zipr�r.)r0�ref�result�offset�tokenZtokenHr�r,rXr*Zobj_refsZkey_refs�k�orrBrr�us�

�



�















z_BinaryPlistParser._read_objectN)
r@rDrErFr1r�r�r�r�r�rrrrr�9s

r�cCs,|dkrdS|dkrdS|dkr$dSdSdS)N�r��r�rPr�r)�countrrr�_count_to_size�src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistWritercCs||_||_||_dSr)r�r�r�)r0rr&r'rrrr1�sz_BinaryPlistWriter.__init__c
Cs�g|_i|_i|_|�|�t|j�}dg||_t|�|_t|j|_	|j
�d�|jD]}|�|�qZ|�
|�}|j
��}t|�}dt||}|j
�tj|f|j���d}|||j|||f}	|j
�tjd|	���dS)Nr�bplist00rn�	>5xBBBQQQ)r)�_objlist�	_objtable�_objidtable�_flattenrTr�rr�r��_ref_formatr�r��
_write_object�
_getrefnum�tellr��pack)
r0r(r��objr�r�r�Z
offset_formatZsort_versionr�rrrr��s2





�z_BinaryPlistWriter.writec	Csrt|t�r"t|�|f|jkrZdSn8t|t�rHt|j�|jf|jkrZdSnt|�|jkrZdSt|j	�}|j	�
|�t|t�r�||jt|�|f<n0t|t�r�||jt|j�|jf<n||jt|�<t|t��rHg}g}|��}|j
r�t|�}|D]:\}}t|t��s|j�r
q�td��|�
|�|�
|�q�t�||�D]}|�|��q4n&t|ttf��rn|D]}|�|��q\dS)Nr�)r�_scalarsr�r rr*�idr!rTrrUr�r�r�r�rr�r.�	itertools�chainr"r�r�)	r0r(Zrefnum�keys�valuesr�r�vrrrrr"sB





z_BinaryPlistWriter._flattencCsNt|t�r|jt|�|fSt|t�r<|jt|j�|jfS|jt|�SdSr)rr)r r�rr*r!r*r�rrrr%Ns


z_BinaryPlistWriter._getrefnumcCs�|dkr"|j�t�d||B��n�|dkrH|j�t�d|dBd|��nh|dkrn|j�t�d|dBd|��nB|d	kr�|j�t�d
|dBd|��n|j�t�d|dBd
|��dS)Nr�z>Brz>BBBr�rz>BBH�rz>BBL�z>BBQ�)r�r�r�r')r0rr�rrr�_write_sizeVsz_BinaryPlistWriter._write_sizecs���|�}�j���j|<|dkr2�j�d��nl|dkrJ�j�d��nT|dkrb�j�d��n<t|t��rl|dkr�z�j�t�dd|��Wn tj	k
r�t
|�d�YnXn�|d	krԈj�t�d
d|��n�|dkr�j�t�d
d|��nt|dk�r�j�t�dd|��nR|dk�r8�j�t�dd|��n0|dk�r`�j�d|jdddd��nt
|���n2t|t��r��j�t�dd|���nt|t
j
��r�|t
�
ddd���}�j�t�dd|���n�t|t��r��dt|j���j�|j��n�t|ttf��r0��dt|���j�|��nnt|t��r�z|�d�}��dt|��Wn4tk
�r�|�d �}��d!t|�d"�YnX�j�|��n�t|t��r^|jdk�r�td#��n�|jd	k�r�j�t�d
d$|��nt|jdk�r
�j�t�d
d%|��nP|jdk�r.�j�t�dd&|��n,|jdk�rR�j�t�dd'|��nt
|���n@t|ttf��r��fd(d)�|D�}t|�}��d*|��j�tjd+�j|f|���n�t|t��r�gg}}�j�r�t|� ��}	n|� �}	|	D]J\}
}t|
t��s�j!�r�q�t"d,��|�#��|
��|�#��|���q�t|�}��d-|��j�tjd+�j|f|����j�tjd+�j|f|���nt"|��dS).N�F�Tr�rz>Bqr2rz>BBr�rz>BHr0rz>BLr1lz>BQrH�r�rz>Bdrrr�rrr�rr
r	rrIr���csg|]}��|��qSr)r%)r�rrBrr�
<listcomp>�sz4_BinaryPlistWriter._write_object.<locals>.<listcomp>rrnr�r)$r%r�r&r�r�rrJr�r'r�r��to_bytesr�rcZ
total_secondsrr3rTr*r-r�rr]�UnicodeEncodeErrorr
rKr�r�r#r�r�r�r�r�r.rU)r0r(rr,�tZrefsrXZkeyRefsZvalRefsZ	rootItemsrr/rrBrr$fs�






$
"$z _BinaryPlistWriter._write_objectN)	r@rDrEr1r�r"r%r3r$rrrrr�s-0rcCs|dd�dkS)Nr�rr)r�rrr�_is_fmt_binary�sr>)�detectr}�writerT�r!r"r|cCsl|dkrJ|�d�}|�d�t��D]}|d|�r$|d}qVq$t��nt|d}|||d�}|�|�S)z�Read a .plist file. 'fp' should be a readable and binary file object.
    Return the unpacked root object (which usually is a dictionary).
    Nr�rr?r})r"r|)r�r��_FORMATSr.rr�)rr!r"r|r��info�P�prrrr	�s

cCst|�}t||||d�S)zqRead a .plist file from a bytes object.
    Return the unpacked root object (which usually is a dictionary).
    rA)rr	)r(r!r"r|rrrrr�s�Fr%cCs:|tkrtd|f��t|d|||d�}|�|�dS)zWWrite 'value' to a .plist file. 'fp' should be a writable,
    binary file object.
    zUnsupported format: %rr@)r&r'N)rBrKr�)r(rr!r&r'r@rrrr
s�r!r'r&cCs t�}t|||||d�|��S)z?Return a bytes object with the contents for a .plist file.
    rF)rr
r+)r(r!r'r&rrrrrs)r5)CrF�__all__rVr��
contextlibrc�enum�iorr+r��rer��warningsrZxml.parsers.expatr�Enumr@r�globals�update�__members__�contextmanagerrrrrrrr
r��compileror6r2�ASCIIr`rgrirtrur�r�r�rKrr��objectr�r�rrrJr�r-r)rr>rr�rrBr	rr
rrrrr�<module>s�0�

	


'"�
	
s&d!$
a	���	telnetlib.cpython-38.opt-2.pyc000064400000024761151450073350012133 0ustar00U

e5d�Z�@sFddlZddlZddlZddlmZdgZdZdZe	dg�Z
e	dg�Ze	dg�Ze	dg�Z
e	d	g�Ze	dg�Ze	d
g�Ze	dg�Ze	dg�Ze	d
g�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Z e	dg�Z!e	dg�Z"e	dg�Z#e	dg�Z$e	dg�Z%e	dg�Z&e	d g�Z'e	d!g�Z(e	d"g�Z)e	d#g�Z*e	d$g�Z+e	d%g�Z,e	d&g�Z-e	d'g�Z.e	d(g�Z/e	d)g�Z0e	d*g�Z1e	dg�Z2e	d+g�Z3e	d,g�Z4e	d-g�Z5e	d.g�Z6e	d/g�Z7e	d0g�Z8e	d1g�Z9e	d2g�Z:e	d3g�Z;e	d4g�Z<e	d5g�Z=e	d6g�Z>e	d7g�Z?e	d8g�Z@e	d9g�ZAe	d:g�ZBe	d;g�ZCe	d<g�ZDe	d=g�ZEe	d>g�ZFe	d?g�ZGe	d@g�ZHe	dAg�ZIe	dBg�ZJe	dCg�ZKe	dDg�ZLe	dEg�ZMe	dFg�ZNe	dGg�ZOe	dg�ZPe	dg�ZQeRedH��rejSZTnejUZTGdId�d�ZVdJdK�ZWeXdLk�rBeW�dS)M�N)�	monotonic�Telnet�������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1����PollSelectorc@seZdZddejfdd�Zdejfdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
d;dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd<d5d6�Zd7d8�Zd9d:�Z dS)=rNrcCsht|_||_||_||_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
|dk	rd|�|||�dS)N�r)�
DEBUGLEVEL�
debuglevel�host�port�timeout�sock�rawq�irawq�cookedq�eof�iacseq�sb�sbdataq�option_callback�open��selfrLrMrN�r[�!/usr/lib64/python3.8/telnetlib.py�__init__�szTelnet.__init__cCsFd|_|st}||_||_||_t�d|||�t�||f|�|_	dS)Nrztelnetlib.Telnet.open)
rS�TELNET_PORTrLrMrN�sys�audit�socketZcreate_connectionrOrYr[r[r\rX�szTelnet.opencCs|��dS�N��close�rZr[r[r\�__del__�szTelnet.__del__cGs@|jdkr<td|j|jfdd�|r4t||�nt|�dS)NrzTelnet(%s,%s):� )�end)rK�printrLrM)rZ�msg�argsr[r[r\rj�s

z
Telnet.msgcCs
||_dSrb)rK)rZrKr[r[r\�set_debuglevel�szTelnet.set_debuglevelcCs.|j}d|_d|_d|_d|_|r*|��dS)NTrIr)rOrSrTrUrd)rZrOr[r[r\rdszTelnet.closecCs|jSrb)rOrer[r[r\�
get_socketszTelnet.get_socketcCs
|j��Srb)rO�filenorer[r[r\rnsz
Telnet.filenocCsBt|kr|�ttt�}t�d||�|�d|�|j�|�dS)Nztelnetlib.Telnet.writezsend %r)�IAC�replacer_r`rjrO�sendall)rZ�bufferr[r[r\�writes
zTelnet.writec
Cs*t|�}|��|j�|�}|dkrN||}|jd|�}|j|d�|_|S|dk	r`t�|}t���}|�|tj�|j	�s|�
|�r�tdt|j�|�}|��|��|j�||�}|dkr�||}|jd|�}|j|d�|_|W5QR�S|dk	rv|t�}|dkrv�qqvW5QRX|�
�S�Nr)�len�process_rawqrR�find�_time�_TelnetSelector�register�	selectors�
EVENT_READrS�select�max�	fill_rawq�read_very_lazy)rZ�matchrN�n�i�buf�deadline�selectorr[r[r\�
read_until&s8


zTelnet.read_untilcCs0|��|js |��|��q|j}d|_|S�NrI)rvrSrrR�rZr�r[r[r\�read_allKs
zTelnet.read_allcCs6|��|js&|js&|��|��q|j}d|_|Sr�)rvrRrSrr�r[r[r\�	read_someUs
zTelnet.read_somecCs0|��|js(|��r(|��|��q|��Srb)rvrS�
sock_availrr�rer[r[r\�read_very_eagerds

zTelnet.read_very_eagercCs6|��|js.|js.|��r.|��|��q|��Srb)rvrRrSr�rr�rer[r[r\�
read_eagerrs

zTelnet.read_eagercCs|��|��Srb)rvr�rer[r[r\�	read_lazy�szTelnet.read_lazycCs(|j}d|_|s$|jr$|js$td��|S)NrIztelnet connection closed)rRrSrP�EOFErrorr�r[r[r\r��s
zTelnet.read_very_lazycCs|j}d|_|Sr�)rVr�r[r[r\�read_sb_data�szTelnet.read_sb_datacCs
||_dSrb)rW)rZ�callbackr[r[r\�set_option_negotiation_callback�sz&Telnet.set_option_negotiation_callbackcCsRddg}�z|j�r|��}|jsf|tkr,q|dkr6q|tkrV||j|||j<qn|j|7_qt|j�dk�r$|ttt	t
fkr�|j|7_qd|_|tkr�||j|||j<nh|tkr�d|_d|_n&|t
kr�d|_|j|d|_d|d<|j�r|�|j|t�n|�dt|��qt|j�dkr|jdd�}d|_|}|ttfk�r�|�d|tk�rnd�ppd	t|��|j�r�|�|j||�n|j�tt
|�q|t	t
fkr|�d|t	k�r�d
�p�dt|��|j�r�|�|j||�q|j�tt|�qWn"tk
�r,d|_d|_YnX|j|d|_|j|d|_dS)NrI�rrzIAC %d not recognizedrz	IAC %s %d�DO�DONT�WILL�WONT)rP�rawq_getcharrT�theNULLrorUrur�r�r�r��SBrV�SErWrO�NOOPTrj�ordrqr�rR)rZr��c�cmd�optr[r[r\rv�sp��zTelnet.process_rawqcCsZ|js|��|jrt�|j|j|jd�}|jd|_|jt|j�krVd|_d|_|S)NrrIr)rPrrSr�rQru)rZr�r[r[r\r��szTelnet.rawq_getcharcCsL|jt|j�krd|_d|_|j�d�}|�d|�||_|j||_dS)NrIr�2zrecv %r)rQrurPrOZrecvrjrSr�r[r[r\rszTelnet.fill_rawqc
Cs:t��*}|�|tj�t|�d��W5QR�SQRXdSrt)ryrzr{r|�boolr})rZr�r[r[r\r�szTelnet.sock_availc
Cs�tjdkr|��dSt���}|�|tj�|�tjtj�|��D]�\}}|j	|kr�z|�
�}Wn*tk
r�td�YW5QR�dSX|r�tj
�|�d��tj
��qD|j	tjkrDtj���d�}|s�W5QR�dS|�|�qDq<W5QRXdS)NZwin32�(*** Connection closed by remote host ***�ascii)r_�platform�mt_interactryrzr{r|�stdinr}Zfileobjr�r�ri�stdoutrs�decode�flush�readline�encode)rZr��keyZevents�text�liner[r[r\�interacts*

zTelnet.interactcCs<ddl}|�|jd�tj��}|s&q8|�|�d��qdS)Nrr[r�)�_thread�start_new_thread�listenerr_r�r�rsr�)rZr�r�r[r[r\r�3s
zTelnet.mt_interactcCsTz|��}Wntk
r*td�YdSX|rDtj�|�d��qtj��qdS)Nr�r�)r�r�rir_r�rsr�r�)rZ�datar[r[r\r�=szTelnet.listenerc
CsTd}|dd�}tt|��}|D]0}t||d�s |s>ddl}|�||�||<q |dk	rdt�|}t���}|�|tj	�|j
�s&|��|D]X}||�|j
�}|r�|��}	|j
d|	�}
|j
|	d�|_
|||
fW5QR�Sq�|dk	�r|�|�}|t�}|�s|dkrz�q&nqz|��qzW5QRX|��}
|
�sJ|j
�rJt�dd|
fS)N�searchr���)�rangeru�hasattr�re�compilerxryrzr{r|rSrvr�rRrhr}rr�r�)rZ�listrNr��indicesr�r�r��m�er�Zreadyr[r[r\�expectJsB



z
Telnet.expectcCs|Srbr[rer[r[r\�	__enter__�szTelnet.__enter__cCs|��dSrbrc)rZ�type�value�	tracebackr[r[r\�__exit__�szTelnet.__exit__)N)N)!�__name__�
__module__�__qualname__raZ_GLOBAL_DEFAULT_TIMEOUTr]rXrfrjrlrdrmrnrsr�r�r�r�r�r�r�r�r�rvr�rr�r�r�r�r�r�r�r[r[r[r\r�s<7�


%

H

8c	Cs�d}tjdd�r2tjddkr2|d}tjd=qd}tjdd�rNtjd}d}tjdd�r�tjd}zt|�}Wn tk
r�t�|d�}YnXt��(}|�|�|j||dd�|�	�W5QRXdS)	Nrrz-dZ	localhostrZtcpg�?)rN)
r_�argv�int�
ValueErrorraZ
getservbynamerrlrXr�)rKrLrMZportstrZtnr[r[r\�test�s$



r��__main__)Yr_rar{�timerrx�__all__rJr^�bytesror�r�r�r�r�r�ZNOPZDMZBRKZIPZAOZAYTZECZELZGAr�ZBINARYZECHOZRCPZSGAZNAMSZSTATUSZTMZRCTEZNAOLZNAOPZNAOCRDZNAOHTSZNAOHTDZNAOFFDZNAOVTSZNAOVTDZNAOLFDZXASCIIZLOGOUTZBMZDETZSUPDUPZSUPDUPOUTPUTZSNDLOCZTTYPEZEORZTUIDZOUTMRKZTTYLOCZVT3270REGIMEZX3PADZNAWSZTSPEEDZLFLOWZLINEMODEZXDISPLOCZOLD_ENVIRONZAUTHENTICATIONZENCRYPTZNEW_ENVIRONZTN3270EZXAUTH�CHARSETZRSPZCOM_PORT_OPTIONZSUPPRESS_LOCAL_ECHOZTLSZKERMITZSEND_URLZ	FORWARD_XZPRAGMA_LOGONZ
SSPI_LOGONZPRAGMA_HEARTBEATZEXOPLr�r�rHryZSelectSelectorrr�r�r[r[r[r\�<module>$s�








































































struct.cpython-38.pyc000064400000000514151450073350010523 0ustar00U

e5d�@s8ddddddddgZdd	lTdd
lmZddlmZdS)
ZcalcsizeZpackZ	pack_intoZunpackZunpack_fromZiter_unpackZStruct�error�)�*)�_clearcache)�__doc__N)�__all__Z_structrr�rr�/usr/lib64/python3.8/struct.py�<module>s�cProfile.cpython-38.opt-2.pyc000064400000011662151450073350011710 0ustar00U

e5db�@s~dddgZddlZddlZddlZddd�Zddd�Zejje_ejje_Gdd�dej�Z	d	d
�Z
dd�Zed
krze�dS)�run�runctx�Profile�N���cCst�t��|||�S�N)�
_pyprofile�_Utilsrr)�	statement�filename�sort�r� /usr/lib64/python3.8/cProfile.pyrscCst�t��|||||�Sr)rrrr)r	�globals�localsr
rrrr
rs�c@s\eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	de	_
dd�Zdd�ZdS)rrcCs$ddl}|�|����|���dS�Nr)�pstats�StatsZ
strip_dirsZ
sort_stats�print_stats)�selfrrrrr
r)szProfile.print_statsc	Cs8ddl}t|d��}|��|�|j|�W5QRXdS)Nr�wb)�marshal�open�create_stats�dump�stats)r�filer�frrr
�
dump_stats-szProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rrrr
r3szProfile.create_statsc
Cs,|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i}	|	|t|j�<|||||	f|j|<q|D]�}|j	rlt|j�}|j	D]�}
z|t|
j�}	Wnt
k
r�Yq�YnX|
j}||
j}|
j}|
j}||	k�r|	|}||d7}||d7}||d7}||d7}||||f|	|<q�qldS)Nr���)Zgetstatsr�label�codeZ	callcountZreccallcountZ
inlinetimeZ	totaltime�idZcalls�KeyError)r�entriesZcallersdicts�entry�funcZncZccZttZctZcallersZsubentry�prevrrr
r7s>






zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr,�dictrrr
r]szProfile.runcCs(|��zt|||�W5|��X|Sr)�enabler�exec)rr.rrrrr
rbs

zProfile.runctxcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��z|||�W�S|��XdS)	Nr"z:descriptor 'runcall' of 'Profile' object needs an argumentr*rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr!)�len�	TypeError�pop�warnings�warn�DeprecationWarningr0r)�args�kwrr*r6rrr
�runcallks&

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs|��|Sr)r0r rrr
�	__enter__�szProfile.__enter__cGs|��dSr)r)r�exc_inforrr
�__exit__�szProfile.__exit__N)r)
�__name__�
__module__�__qualname__rrrrrrr;�__text_signature__r<r>rrrr
rs
&	cCs(t|t�rdd|fS|j|j|jfSdS)N�~r)�
isinstance�str�co_filename�co_firstlineno�co_name)r%rrr
r$�s

r$c
Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddt|j	j
�d�|jdddddd�|jdd�s�|��|�
d�|��\}}||jdd�<|jdk	r�|j�|j�|_t|�dk�r�|j�rd}	|j|dd�}
nR|d}|j�d|j�|��t�|��}t|��|d�}	W5QRX|dddd�}
zt|	|
d|j|j�Wn6tk
�r�}
zd|_|�
|
j�W5d}
~
XYnXn|��|S)Nr)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr)rLrMrN�choicesz-m�module�
store_truezProfile a library module)rL�actionrMrNr!r"z(run_module(modname, run_name='__main__'))�
run_module�modnamer1r,)�__file__r?�__package__�
__cached__) �os�sys�runpyrZoptparserIZallow_interspersed_argsZ
add_option�sortedrZsort_arg_dict_default�argvZprint_usage�exit�
parse_argsrK�path�abspathr3rPrS�insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)rXrYrZrrIrJ�parserZoptionsr9r%ZglobsZprogname�fp�excrrr
�main�sd

�

�
�

�� rmr,)Nr)Nr)
�__all__Z_lsprofrcZprofilerrr�__doc__ZProfilerrr$rmr?rrrr
�<module>s




o;aifc.cpython-38.pyc000064400000061604151450073350010110 0ustar00U

e5d.��
@sBdZddlZddlZddlZdddgZGdd�de�ZdZdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zdd!lmZdd"lmZed#d$�Zd%ej_d&ej_d'ej_d(ej_d)ej_d*ej_Gd+d,�d,�Z Gd-d.�d.�Z!dAd/d�Z"dBd0d�Z#e$d1k�r>ddl%Z%e%j&d2d��sNe%j&�'d3�e%j&d2Z(e"e(d4���Z)e*d5e(�e*d6e)�+��e*d7e)�,��e*d8e)�-��e*d9e)�.��e*d:e)�/��e*d;e)�0��e%j&d<d��r4e%j&d<Z1e*d=e1�e"e1d>��6Z2e2�3e)�4��e)�5d?�Z6e6�s�q"e2�7e6��qW5QRXe*d@�W5QRXdS)CaJStuff to parse AIFF-C and AIFF files.

Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.

An AIFF-C file has the following structure.

  +-----------------+
  | FORM            |
  +-----------------+
  | <size>          |
  +----+------------+
  |    | AIFC       |
  |    +------------+
  |    | <chunks>   |
  |    |    .       |
  |    |    .       |
  |    |    .       |
  +----+------------+

An AIFF file has the string "AIFF" instead of "AIFC".

A chunk consists of an identifier (4 bytes) followed by a size (4 bytes,
big endian order), followed by the data.  The size field does not include
the size of the 8 byte header.

The following chunk types are recognized.

  FVER
      <version number of AIFF-C defining document> (AIFF-C only).
  MARK
      <# of markers> (2 bytes)
      list of markers:
          <marker ID> (2 bytes, must be > 0)
          <position> (4 bytes)
          <marker name> ("pstring")
  COMM
      <# of channels> (2 bytes)
      <# of sound frames> (4 bytes)
      <size of the samples> (2 bytes)
      <sampling frequency> (10 bytes, IEEE 80-bit extended
          floating point)
      in AIFF-C files only:
      <compression type> (4 bytes)
      <human-readable version of compression type> ("pstring")
  SSND
      <offset> (4 bytes, not used by this program)
      <blocksize> (4 bytes, not used by this program)
      <sound data>

A pstring consists of 1 byte length, a string of characters, and 0 or 1
byte pad to make the total length even.

Usage.

Reading AIFF files:
  f = aifc.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
In some types of audio files, if the setpos() method is not used,
the seek() method is not necessary.

This returns an instance of a class with the following public methods:
  getnchannels()  -- returns number of audio channels (1 for
             mono, 2 for stereo)
  getsampwidth()  -- returns sample width in bytes
  getframerate()  -- returns sampling frequency
  getnframes()    -- returns number of audio frames
  getcomptype()   -- returns compression type ('NONE' for AIFF files)
  getcompname()   -- returns human-readable version of
             compression type ('not compressed' for AIFF files)
  getparams() -- returns a namedtuple consisting of all of the
             above in the above order
  getmarkers()    -- get the list of marks in the audio file or None
             if there are no marks
  getmark(id) -- get mark with the specified id (raises an error
             if the mark does not exist)
  readframes(n)   -- returns at most n frames of audio
  rewind()    -- rewind to the beginning of the audio stream
  setpos(pos) -- seek to the specified position
  tell()      -- return the current position
  close()     -- close the instance (make it unusable)
The position returned by tell(), the position given to setpos() and
the position of marks are all compatible and have nothing to do with
the actual position in the file.
The close() method is called automatically when the class instance
is destroyed.

Writing AIFF files:
  f = aifc.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
  aiff()      -- create an AIFF file (AIFF-C default)
  aifc()      -- create an AIFF-C file
  setnchannels(n) -- set the number of channels
  setsampwidth(n) -- set the sample width
  setframerate(n) -- set the frame rate
  setnframes(n)   -- set the number of frames
  setcomptype(type, name)
          -- set the compression type and the
             human-readable compression type
  setparams(tuple)
          -- set all parameters at once
  setmark(id, pos, name)
          -- add specified mark to the list of marks
  tell()      -- return current position in output file (useful
             in combination with setmark())
  writeframesraw(data)
          -- write audio frames without pathing up the
             file header
  writeframes(data)
          -- write audio frames and patch up the file header
  close()     -- patch up the file header and close the
             output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
Marks can be added anytime.  If there are any marks, you must call
close() after all frames have been written.
The close() method is called automatically when the class instance
is destroyed.

When a file is opened with the extension '.aiff', an AIFF file is
written, otherwise an AIFF-C file is written.  This default can be
changed by calling aiff() or aifc() before the first writeframes or
writeframesraw.
�N�Error�open�openfpc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/aifc.pyr�sl@QEcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>l�r��structZunpack�read�error�EOFError��filerrr	�
_read_long�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Lrrrrrrr	�_read_ulong�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>h�rrrrrr	�_read_short�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Hrrrrrrr	�_read_ushort�srcCs@t|�d��}|dkrd}n
|�|�}|d@dkr<|�d�}|S)N�r�)�ordr)r�length�data�dummyrrr	�_read_string�s

r!g�����cCs�t|�}d}|dkr d}|d}t|�}t|�}||krN|krNdkrXnnd}n0|dkrft}n"|d}|d|td	|d
�}||S)Nrr�����g�i�?lg@�?)rr�	_HUGE_VAL�pow)�f�expon�sign�himant�lomantrrr	�_read_float�s"r-cCs|�t�d|��dS)Nr��writer
�pack�r(�xrrr	�_write_short�sr3cCs|�t�d|��dS)Nrr.r1rrr	�
_write_ushort�sr4cCs|�t�d|��dS)Nr
r.r1rrr	�_write_long�sr5cCs|�t�d|��dS)Nrr.r1rrr	�_write_ulong�sr6cCsRt|�dkrtd��|�t�dt|���|�|�t|�d@dkrN|�d�dS)N�z%string exceeds maximum pstring length�Brr�)�len�
ValueErrorr/r
r0)r(�srrr	�
_write_string�s
r=c	Cs�ddl}|dkrd}|d}nd}|dkr8d}d}d}n�|�|�\}}|dks^|dks^||krp|dB}d}d}nh|d}|dkr�|�||�}d}||B}|�|d�}|�|�}t|�}|�||d�}|�|�}t|�}t||�t||�t||�dS)	Nrr#r"i@rr$i�?� )�mathZfrexpZldexpZfloor�intr4r6)	r(r2r?r*r)r+r,ZfmantZfsmantrrr	�_write_float�s8




rA)�Chunk)�
namedtuple�_aifc_paramsz7nchannels sampwidth framerate nframes comptype compnamez3Number of audio channels (1 for mono, 2 for stereo)zSample width in byteszSampling frequencyzNumber of audio framesz(Compression type ("NONE" for AIFF files)zRA human-readable version of the compression type
('not compressed' for AIFF files)c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�ZdS)2�	Aifc_readNcCs8d|_d|_g|_d|_||_t|�}|��dkr:td��|�d�}|dkrTd|_	n|dkrdd|_	ntd��d|_
d|_d|_zt|j�}Wnt
k
r�Y�qYnX|��}|d	kr�|�|�d|_
nH|d
kr�||_|�d�}d|_n(|dkr�t|�|_n|d
k�r|�|�|��qx|j
�r,|j�s4td��dS)Nr�FORMz file does not start with FORM idr�AIFF�AIFCrznot an AIFF or AIFF-C file�COMM�SSND��FVER�MARKz$COMM chunk and/or SSND chunk missing)�_version�_convert�_markers�	_soundpos�_filerBZgetnamerr�_aifcZ_comm_chunk_read�_ssnd_chunk�_ssnd_seek_neededr�_read_comm_chunkr�	_readmark�skip)�selfr�chunkZformdataZ	chunknamer rrr	�initfp4sH





zAifc_read.initfpcCsLt|t�r>t�|d�}z|�|�WqH|���YqHXn
|�|�dS)N�rb)�
isinstance�str�builtinsrr[�close�rYr(Zfile_objectrrr	�__init__\s

zAifc_read.__init__cCs|S�Nr�rYrrr	�	__enter__hszAifc_read.__enter__cGs|��dSrc�r`�rY�argsrrr	�__exit__kszAifc_read.__exit__cCs|jSrc)rRrdrrr	�getfpqszAifc_read.getfpcCsd|_d|_dS)Nrr)rUrQrdrrr	�rewindtszAifc_read.rewindcCs |j}|dk	rd|_|��dSrc)rRr`�rYrrrr	r`xszAifc_read.closecCs|jSrc)rQrdrrr	�tell~szAifc_read.tellcCs|jSrc)�
_nchannelsrdrrr	�getnchannels�szAifc_read.getnchannelscCs|jSrc)�_nframesrdrrr	�
getnframes�szAifc_read.getnframescCs|jSrc)�
_sampwidthrdrrr	�getsampwidth�szAifc_read.getsampwidthcCs|jSrc)�
_frameraterdrrr	�getframerate�szAifc_read.getframeratecCs|jSrc��	_comptyperdrrr	�getcomptype�szAifc_read.getcomptypecCs|jSrc��	_compnamerdrrr	�getcompname�szAifc_read.getcompnamecCs*t|��|��|��|��|��|���Src)rDrorsrurqrxr{rdrrr	�	getparams�s�zAifc_read.getparamscCst|j�dkrdS|jS�Nr�r:rPrdrrr	�
getmarkers�szAifc_read.getmarkerscCs2|jD]}||dkr|Sqtd�|���dS�Nrzmarker {0!r} does not exist�rPr�format�rY�id�markerrrr	�getmark�s

zAifc_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)rprrQrU)rY�posrrr	�setpos�szAifc_read.setposcCs�|jrD|j�d�|j�d�}|j|j}|r>|j�|d�d|_|dkrPdS|j�||j�}|jrv|rv|�|�}|jt|�|j|j	|_|S)NrrKr)
rUrT�seekrrQ�
_framesizerOr:rnrr)rY�nframesr r�rrrr	�
readframes�s 

�
zAifc_read.readframescCsddl}|�|d�S�Nrr)�audioopZalaw2lin�rYrr�rrr	�	_alaw2lin�szAifc_read._alaw2lincCsddl}|�|d�Sr�)r�Zulaw2linr�rrr	�	_ulaw2lin�szAifc_read._ulaw2lincCs2ddl}t|d�sd|_|�|d|j�\}|_|S�Nr�_adpcmstater)r��hasattrr�Z	adpcm2linr�rrr	�
_adpcm2lin�s

zAifc_read._adpcm2lincCsVt|�|_t|�|_t|�dd|_tt|��|_|jdkrFtd��|jdkrXtd��|j|j|_	|j
�rFd}|jdkr�d}t�
d�d	|_|�d
�|_|r�t|j�d��}|d@dkr�|d}|j||_|j�dd�t|�|_|jdk�rR|jd
k�r
|j|_n4|jdk�r |j|_n|jdk�r6|j|_ntd��d|_nd|_d|_dS)N�rKr�bad sample width�bad # of channels�rzWarning: bad COMM chunk size�rr"�NONE�G722��ulaw�ULAW��alaw�ALAW�unsupported compression typer�not compressed)rrnrrprrr@r-rtrr�rSZ	chunksize�warnings�warnrrwrrr�r!rzr�rOr�r�)rYrZZkludgerrrr	rV�sD









zAifc_read._read_comm_chunkcCs�t|�}zDt|�D]6}t|�}t|�}t|�}|s6|r|j�|||f�qWnDtk
r�dt|j�t|j�dkrxdnd|f}t�	|�YnXdS)Nz;Warning: MARK chunk contains only %s marker%s instead of %sr�r<)
r�rangerr!rP�appendrr:r�r�)rYrZZnmarkers�ir�r��name�wrrr	rW�s��zAifc_read._readmark)rrrrRr[rbrerirjrkr`rmrorqrsrurxr{r|rr�r�r�r�r�r�rVrWrrrr	rEs2$(*rEc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dS)J�
Aifc_writeNcCs\t|t�rNt�|d�}z|�|�Wn|���YnX|�d�rXd|_n
|�|�dS)N�wbz.aiffr)r]r^r_rr[r`�endswithrSrarrr	rb/s

zAifc_write.__init__cCs^||_t|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_g|_
d|_d|_dS)Nr�r�rr)rR�
_AIFC_versionrNrwrzrOrnrrrtrp�_nframeswritten�_datawritten�_datalengthrP�_marklengthrSrlrrr	r[?szAifc_write.initfpcCs|��dSrcrfrdrrr	�__del__PszAifc_write.__del__cCs|Srcrrdrrr	reSszAifc_write.__enter__cGs|��dSrcrfrgrrr	riVszAifc_write.__exit__cCs|jrtd��d|_dS)N�0cannot change parameters after starting to writer�r�rrSrdrrr	�aiff\szAifc_write.aiffcCs|jrtd��d|_dS)Nr�rr�rdrrr	�aifcaszAifc_write.aifccCs(|jrtd��|dkrtd��||_dS)Nr�rr�)r�rrn)rY�	nchannelsrrr	�setnchannelsfs
zAifc_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rnrrdrrr	romszAifc_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nr�rrr�)r�rrr)rY�	sampwidthrrr	�setsampwidthrs
zAifc_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)rrrrdrrr	rsyszAifc_write.getsampwidthcCs(|jrtd��|dkrtd��||_dS)Nr�rzbad frame rate)r�rrt)rY�	frameraterrr	�setframerate~s
zAifc_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rtrrdrrr	ru�szAifc_write.getframeratecCs|jrtd��||_dS)Nr�)r�rrp)rYr�rrr	�
setnframes�szAifc_write.setnframescCs|jSrc�r�rdrrr	rq�szAifc_write.getnframescCs.|jrtd��|dkrtd��||_||_dS�Nr�)r�r�r�r�r�r�r�)r�rrwrz)rY�comptype�compnamerrr	�setcomptype�szAifc_write.setcomptypecCs|jSrcrvrdrrr	rx�szAifc_write.getcomptypecCs|jSrcryrdrrr	r{�szAifc_write.getcompnamecCsf|\}}}}}}|jrtd��|dkr.td��|�|�|�|�|�|�|�|�|�||�dSr�)r�rr�r�r�r�r�)rYZparamsr�r�r�r�r�r�rrr	�	setparams�s



zAifc_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)rnrrrtrrDrprwrzrdrrr	r|�s�zAifc_write.getparamscCs�|dkrtd��|dkr td��t|t�s2td��tt|j��D],}||j|dkr@|||f|j|<dSq@|j�|||f�dS)Nrzmarker ID must be > 0zmarker position must be >= 0zmarker name must be bytes)rr]�bytesr�r:rPr�)rYr�r�r�r�rrr	�setmark�s
zAifc_write.setmarkcCs2|jD]}||dkr|Sqtd�|���dSr�r�r�rrr	r��s

zAifc_write.getmarkcCst|j�dkrdS|jSr}r~rdrrr	r�szAifc_write.getmarkerscCs|jSrcr�rdrrr	rm�szAifc_write.tellcCszt|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|j
�|�|j||_|j
t|�|_
dS)Nr8)r]r��	bytearray�
memoryview�cast�_ensure_header_writtenr:rrrnrOrRr/r�r�)rYrr�rrr	�writeframesraw�s
zAifc_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSrc)r�r�rpr�r��_patchheader)rYrrrr	�writeframes�s


�zAifc_write.writeframescCs�|jdkrdSz^|�d�|jd@r<|j�d�|jd|_|��|j|jksb|j	|jksb|j
rj|��W5d|_|j}d|_|��XdS)Nrrr9)rRrOr`r�r�r/�
_writemarkersr�rpr�r�r�)rYr(rrr	r`�s$



��zAifc_write.closecCsddl}|�|d�Sr�)r�Zlin2alawr�rrr	�	_lin2alaw�szAifc_write._lin2alawcCsddl}|�|d�Sr�)r�Zlin2ulawr�rrr	�	_lin2ulawszAifc_write._lin2ulawcCs2ddl}t|d�sd|_|�|d|j�\}|_|Sr�)r�r�r�Z	lin2adpcmr�rrr	�
_lin2adpcms

zAifc_write._lin2adpcmcCsf|jsb|jdkr.|jsd|_|jdkr.td��|js<td��|jsJtd��|jsXtd��|�|�dS)N�r�r�r�r�r�rzRsample width must be 2 when compressing with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)z# channels not specifiedzsample width not specifiedzsampling rate not specified)r�rwrrrrnrt�
_write_header)rYZdatasizerrr	r�
s

z!Aifc_write._ensure_header_writtencCs>|jdkr|j|_n&|jdkr(|j|_n|jdkr:|j|_dS)Nr�r�r�)rwr�rOr�r�rdrrr	�_init_compressions




zAifc_write._init_compressionc	CsJ|jr|jdkr|��|j�d�|js<||j|j|_|j|j|j|_|jd@rf|jd|_|jr�|jdkr�|jd|_|jd@r�|jd|_n0|jdkr�|jdd|_|jd@r�|jd|_z|j�	�|_
Wnttfk
r�d|_
YnX|�
|j�}|j�rB|j�d	�|j�d
�t|jd�t|j|j�n|j�d�|j�d�t|j|�t|j|j�|j
dk	�r�|j�	�|_t|j|j�|jd
k�r�t|jd�nt|j|jd�t|j|j�|j�r�|j�|j�t|j|j�|j�d�|j
dk	�r|j�	�|_t|j|jd�t|jd�t|jd�dS)Nr�rFr)r�r�r�r�rr��rrHrLrGrIr�rKrJr)rSrwr�rRr/rprnrrr�rm�_form_length_pos�AttributeError�OSError�_write_form_lengthr6rNr3�_nframes_posrArtr=rz�_ssnd_length_pos)rYZ
initlength�
commlengthrrr	r�%s^




zAifc_write._write_headercCs\|jr*dt|j�}|d@r$|d}d}nd}d}t|jd||jd|d|�|S)	Nr�r�r�rrrK�)rSr:rzr6rRr�)rY�
datalengthr�Z
verslengthrrr	r�Xs"����zAifc_write._write_form_lengthcCs�|j��}|jd@r,|jd}|j�d�n|j}||jkrd|j|jkrd|jdkrd|j�|d�dS|j�|j	d�|�
|�}|j�|jd�t|j|j�|j�|j
d�t|j|d�|j�|d�|j|_||_dS)Nrr9rrK)rRrmr�r/r�rpr�r�r�r�r�r�r6r�)rYZcurposr�r rrr	r�es*




��
zAifc_write._patchheadercCs�t|j�dkrdS|j�d�d}|jD]:}|\}}}|t|�dd}t|�d@dkr(|d}q(t|j|�|d|_t|jt|j��|jD]2}|\}}}t|j|�t|j|�t|j|�q�dS)NrrMrr�rK)r:rPrRr/r6r�r3r=)rYrr�r�r�r�rrr	r�{s"





zAifc_write._writemarkers)(rrrrRrbr[r�rerir�r�r�ror�rsr�rur�rqr�rxr{r�r|r�r�rrmr�r�r`r�r�r�r�r�r�r�r�r�rrrr	r�sJ	

3
r�cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder\)�rr\)r�r�z$mode must be 'r', 'rb', 'w', or 'wb')r�r�rEr�r�r(r�rrr	r�s
cCstjdtdd�t||d�S)NzBaifc.openfp is deprecated since Python 3.7. Use aifc.open instead.r)�
stacklevel)r�)r�r��DeprecationWarningrr�rrr	r�s
��__main__rz/usr/demos/data/audio/bach.aiffr�ZReadingznchannels =znframes   =zsampwidth =zframerate =zcomptype  =zcompname  =rZWritingr�izDone.)N)N)8�__doc__r
r_r��__all__�	Exceptionrr�rrrrr!r&r-r3r4r5r6r=rArZrB�collectionsrCrDr�r�r�r�r�r�rEr�rrr�sys�argvr��fnr(�printrorqrsrurxr{Zgn�gr�r|r�rr�rrrr	�<module>s~	

!�







zipimport.cpython-38.pyc000064400000041575151450073350011250 0ustar00U

e5d-x�@sRdZddlZddlmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddgZej
Z
ejdd�ZGdd�de�ZiZee
�ZdZd	Zd
ZGdd�d�Ze
dd
d
fe
ddd
fddfZdd�Zdd�Zdd�Zdd�ZdZdadd�Z dd�Z!dd �Z"d!d"�Z#ee#j$�Z%d#d$�Z&d%d&�Z'd'd(�Z(d)d*�Z)d+d,�Z*d-d.�Z+Gd/d0�d0�Z,dS)1aPzipimport provides support for importing Python modules from Zip archives.

This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
  subclass of ImportError, so it can be caught as ImportError, too.
- _zip_directory_cache: a dict, mapping archive paths to zip directory
  info dicts, as used in zipimporter._files.

It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
�N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter�c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�!/usr/lib64/python3.8/zipimport.pyr!s�sPKi��c@sleZdZdZdd�Zddd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra�zipimporter(archivepath) -> zipimporter object

    Create a new zipimporter instance. 'archivepath' must be a path to
    a zipfile, or to a specific path inside a zipfile. For example, it can be
    '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
    valid directory inside the archive.

    'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
    archive.

    The 'archive' attribute of zipimporter objects contains the name of the
    zipfile targeted.
    c	Cs$t|t�sddl}|�|�}|s,td|d��tr<|�tt�}g}zt�	|�}WnHt
tfk
r�t�|�\}}||kr�td|d��|}|�
|�Yq@X|jd@dkr�td|d��q�q@zt|}Wn$tk
r�t|�}|t|<YnX||_||_tj|ddd��|_|j�r |jt7_dS)Nrzarchive path is empty��pathznot a Zip filei�i����)�
isinstance�str�os�fsdecoder�alt_path_sep�replace�path_sep�_bootstrap_external�
_path_stat�OSError�
ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive�
_path_join�prefix)�selfrrr$�st�dirname�basename�filesr
r
r�__init__?s:

zzipimporter.__init__NcCsNt||�}|dk	r|gfSt||�}t||�rFd|j�t�|��gfSdgfS)a�find_loader(fullname, path=None) -> self, str or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, a string containing the
        full path name if it's possibly a portion of a namespace package,
        or None otherwise. The optional 'path' argument is ignored -- it's
        there for compatibility with the importer protocol.
        N)�_get_module_info�_get_module_path�_is_dirr"r)r%�fullnamer�mi�modpathr
r
r�find_loaderms



zzipimporter.find_loadercCs|�||�dS)a�find_module(fullname, path=None) -> self or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, or None if it wasn't.
        The optional 'path' argument is ignored -- it's there for compatibility
        with the importer protocol.
        r)r1)r%r.rr
r
r�find_module�s	zzipimporter.find_modulecCst||�\}}}|S)z�get_code(fullname) -> code object.

        Return the code object for the specified module. Raise ZipImportError
        if the module couldn't be found.
        ��_get_module_code�r%r.�code�	ispackager0r
r
r�get_code�szzipimporter.get_codecCsvtr|�tt�}|}|�|jt�r:|t|jt�d�}z|j|}Wn tk
rhtdd|��YnXt	|j|�S)z�get_data(pathname) -> string with file data.

        Return the data associated with 'pathname'. Raise OSError if
        the file wasn't found.
        Nr�)
rrr�
startswithr"�lenr!rr�	_get_data)r%�pathname�key�	toc_entryr
r
r�get_data�szzipimporter.get_datacCst||�\}}}|S)zjget_filename(fullname) -> filename string.

        Return the filename for the specified module.
        r3r5r
r
r�get_filename�szzipimporter.get_filenamecCs�t||�}|dkr$td|��|d��t||�}|r@t�|d�}n
|�d�}z|j|}Wntk
rnYdSXt|j|��	�S)z�get_source(fullname) -> source string.

        Return the source code for the specified module. Raise ZipImportError
        if the module couldn't be found, return None if the archive does
        contain the module, but has no source for it.
        N�can't find module ��name�__init__.py�.py)
r+rr,rr#r!rr<r"�decode)r%r.r/r�fullpathr?r
r
r�
get_source�s


zzipimporter.get_sourcecCs(t||�}|dkr$td|��|d��|S)z�is_package(fullname) -> bool.

        Return True if the module specified by fullname is a package.
        Raise ZipImportError if the module couldn't be found.
        NrBrC)r+r)r%r.r/r
r
r�
is_package�s
zzipimporter.is_packagecCs�t||�\}}}tj�|�}|dks.t|t�s@t|�}|tj|<||_zT|rlt||�}t�	|j
|�}|g|_t|d�s|t
|_
t�|j||�t||j�Wntj|=�YnXztj|}Wn$tk
r�td|�d���YnXt�d||�|S)z�load_module(fullname) -> module.

        Load the module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the imported
        module, or raises ZipImportError if it wasn't found.
        N�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r4�sys�modules�getr�_module_type�
__loader__r,rr#r"�__path__�hasattrrK�_fix_up_module�__dict__�execr�ImportError�
_bootstrap�_verbose_message)r%r.r6r7r0�modrrHr
r
r�load_module�s0


zzipimporter.load_modulecCsXz|�|�sWdSWntk
r*YdSXtjsNddlm}|�t�dt_t||�S)z�Return the ResourceReader for a package in a zip file.

        If 'fullname' is a package within the zip file, return the
        'ResourceReader' object for the package.  Otherwise return None.
        Nr)�ResourceReaderT)rJr�_ZipImportResourceReader�_registered�
importlib.abcr[�register)r%r.r[r
r
r�get_resource_readers


zzipimporter.get_resource_readercCsd|j�t�|j�d�S)Nz<zipimporter object "z">)r"rr$)r%r
r
r�__repr__"szzipimporter.__repr__)N)N)rrr	�__doc__r*r1r2r8r@rArIrJrZr`rar
r
r
rr-s.
 


&z__init__.pycTrEF)z.pycTF)rFFFcCs|j|�d�dS)N�.�)r$�
rpartition)r%r.r
r
rr,4sr,cCs|t}||jkS�N)rr!)r%r�dirpathr
r
rr-8sr-cCs8t||�}tD]$\}}}||}||jkr|SqdSrf)r,�_zip_searchorderr!)r%r.r�suffix�
isbytecoder7rHr
r
rr+As


r+c	Cs�zt�|�}Wn&tk
r4td|��|d��YnX|���z$|�td�|��}|�t�}Wn&tk
r�td|��|d��YnXt|�tkr�td|��|d��|dd�t	k�r�z|�dd�|��}Wn&tk
r�td|��|d��YnXt
|ttd�}z|�|�|��}Wn(tk
�rJtd|��|d��YnX|�t	�}|dk�rrtd|��|d��|||t�}t|�tk�r�td|��|d��|t|�|}t
|d	d
��}t
|d
d��}	||k�r�td|��|d��||	k�r
td
|��|d��||8}||	}
|
dk�r6td|��|d��i}d}z|�|�Wn(tk
�rttd|��|d��YnX|�d�}t|�dk�r�td��|dd�dk�r��q�t|�dk�r�td��t|dd��}
t|dd	��}t|d	d��}t|dd
��}t
|d
d��}t
|dd��}t
|dd��}t|dd��}t|dd��}t|dd��}t
|dd��}|||}||	k�r�td|��|d��||
7}z|�|�}Wn(tk
�r�td|��|d��YnXt|�|k�r�td|��|d��z2t|�||��||k�r*td|��|d��Wn(tk
�rTtd|��|d��YnX|
d@�rj|��}n6z|�d�}Wn&tk
�r�|�d��t�}YnX|�dt�}t�||�}||||||||f}|||<|d 7}�qvW5QRXt�d!||�|S)"Nzcan't open Zip file: r
rd�can't read Zip file: �rznot a Zip file: zcorrupt Zip file: ���zbad central directory size: zbad central directory offset: z&bad central directory size or offset: �.�EOF read where not expectedsPK��
����� �"�*zbad local header offset: i�ascii�latin1�/rz!zipimport: found {} names in {!r})�_io�	open_coderr�seek�END_CENTRAL_DIR_SIZE�tell�readr;�STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr�EOFErrorrrG�UnicodeDecodeError�	translate�cp437_tablerrrr#rWrX)r"�fp�header_position�buffer�	file_size�max_comment_start�data�pos�header_size�
header_offset�
arc_offsetr)�count�flags�compress�time�date�crc�	data_size�	name_size�
extra_size�comment_size�file_offsetrDr�tr
r
rr `s�
���

�


�
�






r u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsltrt�d�td��daz<zddlm}Wn&tk
rRt�d�td��YnXW5daXt�d�|S)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTFr��
decompresszzipimport: zlib available)�_importing_zlibrWrXr�zlibr��	Exceptionr�r
r
r�_get_decompress_func�s


r�c	Cs�|\}}}}}}}}	|dkr$td��t�|���}
z|
�|�Wn&tk
rftd|��|d��YnX|
�d�}t|�dkr�td��|dd�dkr�td	|��|d��t|d
d��}t|dd��}
d||
}||7}z|
�|�Wn(tk
�rtd|��|d��YnX|
�|�}t|�|k�r4td��W5QRX|dk�rL|Sz
t	�}Wnt
k
�rttd
��YnX||d�S)Nrznegative data sizerkr
rwrqrlsPKzbad local file header: �rvzzipimport: can't read datar�i�)rr~rr�rr�r;r�rr�r�)r"r?�datapathr�r�r�r�r�r�r�r�r�r�r�r��raw_datar�r
r
rr<s>



r<cCst||�dkS)Nr)�abs)�t1�t2r
r
r�	_eq_mtimeAsr�cCs<||d�}zt�|||�}Wntk
r2YdSX|d@dk}|r�|d@dk}tjdkr�|shtjdkr�t||�}	|	dk	r�t�tj|	�}
zt�||
||�Wntk
r�YdSXnTt	||�\}}|�r
t
t|dd��|�r�t|dd	��|k�r
t�
d
|���dSt�|d	d��}
t|
t��s8td|�d���|
S)
N)rDrrrrd�never�alwaysrrrmrnzbytecode is stale for zcompiled module z is not a code object)r�
_classify_pycrV�_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer�rrWrX�marshal�loadsr�
_code_type�	TypeError)r%r=rHr.r��exc_detailsr��
hash_based�check_source�source_bytesr��source_mtime�source_sizer6r
r
r�_unmarshal_codeKsX�
��
��
���r�cCs|�dd�}|�dd�}|S)Ns
�
�
)r)�sourcer
r
r�_normalize_line_endings~sr�cCst|�}t||ddd�S)NrUT)�dont_inherit)r��compile)r=r�r
r
r�_compile_source�sr�cCsDt�|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	�S)
N�	i������?rdr)r��mktime)�dr�r
r
r�_parse_dostime�s



�r�c
CstzR|dd�dkst�|dd�}|j|}|d}|d}|d}t||�|fWStttfk
rnYdSXdS)Nr��c�or���)rr)�AssertionErrorr!r�r�
IndexErrorr�)r%rr?r�r��uncompressed_sizer
r
rr��s
r�cCsV|dd�dkst�|dd�}z|j|}Wntk
rDYdSXt|j|�SdS)Nrr�)r�r!rr<r")r%rr?r
r
rr��sr�c	Cs�t||�}tD]�\}}}||}tjd|jt|dd�z|j|}Wntk
rXYqX|d}t|j|�}	|r�t	|||||	�}
n
t
||	�}
|
dkr�q|d}|
||fSqtd|��|d��dS)Nz
trying {}{}{}rd)�	verbosityrrBrC)r,rhrWrXr"rr!rr<r�r�r)r%r.rrirjr7rHr?r0r�r6r
r
rr4�s$

r4c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r\z�Private class used to support ZipImport.get_resource_reader().

    This class is allowed to reference all the innards and private parts of
    the zipimporter.
    FcCs||_||_dSrf)rr.)r%rr.r
r
rr*�sz!_ZipImportResourceReader.__init__cCs\|j�dd�}|�d|��}ddlm}z||j�|��WStk
rVt|��YnXdS)Nrcr}r)�BytesIO)r.r�ior�rr@r�FileNotFoundError)r%�resource�fullname_as_pathrr�r
r
r�
open_resource�sz&_ZipImportResourceReader.open_resourcecCst�dSrf)r�)r%r�r
r
r�
resource_path�sz&_ZipImportResourceReader.resource_pathcCsH|j�dd�}|�d|��}z|j�|�Wntk
rBYdSXdS)Nrcr}FT)r.rrr@r)r%rDr�rr
r
r�is_resource�sz$_ZipImportResourceReader.is_resourcec		cs�ddlm}||j�|j��}|�|jj�}|jdks:t�|j	}t
�}|jjD]f}z||��|�}Wntk
r|YqNYnX|j	j}t
|�dkr�|jVqN||krN|�|�|VqNdS)Nr)�PathrE)�pathlibr�rrAr.�relative_tor"rDr��parent�setr!rr;�add)	r%r��
fullname_path�
relative_path�package_path�subdirs_seen�filename�relative�parent_namer
r
r�contents�s"


z!_ZipImportResourceReader.contentsN)
rrr	rbr]r*r�r�r�r�r
r
r
rr\�s	r\)-rb�_frozen_importlib_externalrrr�_frozen_importlibrWr�r~r�rLr��__all__r�path_separatorsrrVrr�typerOr�r�r�rrhr,r-r+r r�r�r�r<r�r��__code__r�r�r�r�r�r�r4r\r
r
r
r�<module>sX�		~�.
.

operator.cpython-38.pyc000064400000032575151450073350011046 0ustar00U

e5d�)�6@s(dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g6Zd7d8lmZd9d&�Zd:d#�Zd;d	�Zd<d+�Zd=d�Z	d>d
�Z
d?d-�Zd@d5�ZdAd�Z
dBd�ZdCd�ZdDd�ZdEd�ZdFd
�ZdGd�ZdHd�ZeZdId%�ZdJd)�ZdKd*�ZdLd'�ZdMd,�ZdNd.�ZdOd/�ZdPd0�ZdQd1�ZdRd3�ZdSd4�ZdTd6�Z dUd�Z!dVd�Z"dWd�Z#dXd�Z$dYd�Z%dZd�Z&d[d2�Z'dqd\d$�Z(Gd]d�d�Z)Gd^d �d �Z*Gd_d(�d(�Z+d`d�Z,dad�Z-dbd�Z.dcd�Z/ddd�Z0ded�Z1dfd�Z2dgd�Z3dhd�Z4did�Z5djd�Z6dkd�Z7dld!�Z8dmd"�Z9zd7dnl:TWne;k
�rbYnXd7dol:mZeZ<eZ=eZ>eZ?e	Z@e
ZAeZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTe ZUe!ZVe"ZWe$ZXe%ZYe'ZZe,Z[e-Z\e.Z]e/Z^e0Z_e1Z`e2Zae3Zbe4Zce5Zde6Zee7Zfe8Zge9ZhdpS)ras
Operator Interface

This module exports a set of functions corresponding to the intrinsic
operators of Python.  For example, operator.add(x, y) is equivalent
to the expression x+y.  The function names are those used for special
methods; variants without leading and trailing '__' are also provided
for convenience.

This is the pure Python implementation of the module.
�abs�add�and_�
attrgetter�concat�contains�countOf�delitem�eq�floordiv�ge�getitem�gt�iadd�iand�iconcat�	ifloordiv�ilshift�imatmul�imod�imul�index�indexOf�inv�invert�ior�ipow�irshift�is_�is_not�isub�
itemgetter�itruediv�ixor�le�length_hint�lshift�lt�matmul�methodcaller�mod�mul�ne�neg�not_�or_�pos�pow�rshift�setitem�sub�truediv�truth�xor�)rcCs||kS)zSame as a < b.���a�br8r8� /usr/lib64/python3.8/operator.pyr&scCs||kS)zSame as a <= b.r8r9r8r8r<r#scCs||kS)zSame as a == b.r8r9r8r8r<r	#scCs||kS)zSame as a != b.r8r9r8r8r<r+'scCs||kS)zSame as a >= b.r8r9r8r8r<r+scCs||kS)zSame as a > b.r8r9r8r8r<r
/scCs|S)zSame as not a.r8�r:r8r8r<r-5scCs|rdSdS)z*Return True if a is true, False otherwise.TFr8r=r8r8r<r59scCs||kS)zSame as a is b.r8r9r8r8r<r=scCs||k	S)zSame as a is not b.r8r9r8r8r<rAscCst|�S)zSame as abs(a).)�_absr=r8r8r<rGscCs||S)zSame as a + b.r8r9r8r8r<rKscCs||@S)zSame as a & b.r8r9r8r8r<rOscCs||S)zSame as a // b.r8r9r8r8r<r
SscCs|��S)zSame as a.__index__().)�	__index__r=r8r8r<rWscCs|S)zSame as ~a.r8r=r8r8r<r[scCs||>S)zSame as a << b.r8r9r8r8r<r%`scCs||S)zSame as a % b.r8r9r8r8r<r)dscCs||S)zSame as a * b.r8r9r8r8r<r*hscCs||S)zSame as a @ b.r8r9r8r8r<r'lscCs|S)zSame as -a.r8r=r8r8r<r,pscCs||BS)zSame as a | b.r8r9r8r8r<r.tscCs|
S)zSame as +a.r8r=r8r8r<r/xscCs||S)zSame as a ** b.r8r9r8r8r<r0|scCs||?S)zSame as a >> b.r8r9r8r8r<r1�scCs||S)zSame as a - b.r8r9r8r8r<r3�scCs||S)zSame as a / b.r8r9r8r8r<r4�scCs||AS)zSame as a ^ b.r8r9r8r8r<r6�scCs(t|d�s dt|�j}t|��||S)z%Same as a + b, for a and b sequences.�__getitem__�!'%s' object can't be concatenated��hasattr�type�__name__�	TypeError�r:r;�msgr8r8r<r�s
cCs||kS)z(Same as b in a (note reversed operands).r8r9r8r8r<r�scCs"d}|D]}||kr|d7}q|S)z)Return the number of times b occurs in a.r7�r8)r:r;�count�ir8r8r<r�s

cCs
||=dS)zSame as del a[b].Nr8r9r8r8r<r�scCs||S)z
Same as a[b].r8r9r8r8r<r�scCs.t|�D]\}}||kr|Sqtd��dS)z!Return the first index of b in a.z$sequence.index(x): x not in sequenceN)�	enumerate�
ValueError)r:r;rK�jr8r8r<r�s
cCs|||<dS)zSame as a[b] = c.Nr8)r:r;�cr8r8r<r2�scCs�t|t�s dt|�j}t|��z
t|�WStk
r>YnXzt|�j}Wntk
rf|YSXz||�}Wntk
r�|YSX|tkr�|St|t�s�dt|�j}t|��|dkr�d}t	|��|S)a2
    Return an estimate of the number of items in obj.
    This is useful for presizing containers when building from an iterable.

    If the object supports len(), the result will be exact. Otherwise, it may
    over- or under-estimate by an arbitrary amount. The result will be an
    integer >= 0.
    z/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr7z$__length_hint__() should return >= 0)
�
isinstance�intrDrErF�len�__length_hint__�AttributeError�NotImplementedrM)�obj�defaultrHZhint�valr8r8r<r$�s8	
�



�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)raV
    Return a callable object that fetches the given attribute(s) from its operand.
    After f = attrgetter('name'), the call f(r) returns r.name.
    After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
    After h = attrgetter('name.first', 'name.last'), the call h(r) returns
    (r.name.first, r.name.last).
    )�_attrs�_callcsn|s<t|t�std��|f|_|�d���fdd�}||_n.|f||_ttt|j����fdd�}||_dS)Nzattribute name must be a string�.cs�D]}t||�}q|S�N)�getattr)rV�name)�namesr8r<�func�sz!attrgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}|��VqdSr\r8)�.0�getter�rVr8r<�	<genexpr>�sz4attrgetter.__init__.<locals>.func.<locals>.<genexpr>��tuplerc)�gettersrcr<r`�s)	rP�strrFrY�splitrZrf�mapr)�self�attr�attrsr`r8)rgr_r<�__init__�s

zattrgetter.__init__cCs
|�|�Sr\�rZ�rkrVr8r8r<�__call__�szattrgetter.__call__cCs$d|jj|jjd�tt|j��fS�N�	%s.%s(%s)�, )�	__class__�
__module__�__qualname__�joinrj�reprrY�rkr8r8r<�__repr__s�zattrgetter.__repr__cCs|j|jfSr\)rurYrzr8r8r<�
__reduce__szattrgetter.__reduce__N�	rErvrw�__doc__�	__slots__rnrqr{r|r8r8r8r<r�sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r z�
    Return a callable object that fetches the given item(s) from its operand.
    After f = itemgetter(2), the call f(r) returns r[2].
    After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
    ��_itemsrZcsF�s �f|_�fdd�}||_n"�f�|_��fdd�}||_dS)Ncs|�Sr\r8rc)�itemr8r<r`sz!itemgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}�|VqdSr\r8)rarKrcr8r<rdsz4itemgetter.__init__.<locals>.func.<locals>.<genexpr>rerc)�itemsrcr<r`sr�)rkr�r�r`r8)r�r�r<rnszitemgetter.__init__cCs
|�|�Sr\rorpr8r8r<rqszitemgetter.__call__cCs$d|jj|jjd�tt|j��fSrr)rurvrErxrjryr�rzr8r8r<r{ s�zitemgetter.__repr__cCs|j|jfSr\)rur�rzr8r8r<r|%szitemgetter.__reduce__Nr}r8r8r8r<r 	sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r(z�
    Return a callable object that calls the given method on its operand.
    After f = methodcaller('name'), the call f(r) returns r.name().
    After g = methodcaller('name', 'date', foo=1), the call g(r) returns
    r.name('date', foo=1).
    )�_name�_args�_kwargscOs*||_t|jt�std��||_||_dS)Nzmethod name must be a string)r�rPrhrFr�r�)rkr^�args�kwargsr8r8r<rn1s
zmethodcaller.__init__cCst||j�|j|j�Sr\)r]r�r�r�rpr8r8r<rq8szmethodcaller.__call__cCsTt|j�g}|�tt|j��|�dd�|j��D��d|jj|jj	d�
|�fS)Ncss|]\}}d||fVqdS)z%s=%rNr8)ra�k�vr8r8r<rd>sz(methodcaller.__repr__.<locals>.<genexpr>rsrt)ryr��extendrjr�r�r�rurvrErx)rkr�r8r8r<r{;s�zmethodcaller.__repr__cCsD|js|j|jf|jfSddlm}||j|jf|j�|jfSdS)Nr7)�partial)r�rur�r��	functoolsr�)rkr�r8r8r<r|Cszmethodcaller.__reduce__Nr}r8r8r8r<r((scCs||7}|S)zSame as a += b.r8r9r8r8r<rMscCs||M}|S)zSame as a &= b.r8r9r8r8r<rRscCs,t|d�s dt|�j}t|��||7}|S)z&Same as a += b, for a and b sequences.r@rArBrGr8r8r<rWs

cCs||}|S)zSame as a //= b.r8r9r8r8r<r_scCs||K}|S)zSame as a <<= b.r8r9r8r8r<rdscCs||;}|S)zSame as a %= b.r8r9r8r8r<riscCs||9}|S)zSame as a *= b.r8r9r8r8r<rnscCs||}|S)zSame as a @= b.r8r9r8r8r<rsscCs||O}|S)zSame as a |= b.r8r9r8r8r<rxscCs||C}|S)zSame as a **= b.r8r9r8r8r<r}scCs||L}|S)zSame as a >>= b.r8r9r8r8r<r�scCs||8}|S)zSame as a -= b.r8r9r8r8r<r�scCs||}|S)zSame as a /= b.r8r9r8r8r<r!�scCs||N}|S)zSame as a ^= b.r8r9r8r8r<r"�s)�*)r~N)r7)ir~�__all__�builtinsrr>r&r#r	r+rr
r-r5rrrrr
rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrrrr2r$rr r(rrrrrrrrrrrrr!r"�	_operator�ImportError�__lt__�__le__�__eq__�__ne__�__ge__�__gt__�__not__�__abs__�__add__�__and__�__floordiv__r?�__inv__�
__invert__�
__lshift__�__mod__�__mul__�
__matmul__�__neg__�__or__�__pos__�__pow__�
__rshift__�__sub__�__truediv__�__xor__�
__concat__�__contains__�__delitem__r@�__setitem__�__iadd__�__iand__�__iconcat__�
__ifloordiv__�__ilshift__�__imod__�__imul__�__imatmul__�__ior__�__ipow__�__irshift__�__isub__�__itruediv__�__ixor__r8r8r8r<�<module>s4�	
)'%dis.cpython-38.opt-2.pyc000064400000027343151450073350010727 0ustar00U

e5dZP�@sddlZddlZddlZddlZddlTddlmZdddddd	d
ddd
dgeZ[ejejej	e
eefZ
edZdedfedfedffZedZdZdd�ZdUddd�dd�ZdVdd�dd�Zddddd d!d"d#d$d%d&�
Zd'd(�Zd)d*�Zd+d�Zd,d-�Zdd�d.d�Ze�d/d0�Z d1e j!_"d2e j_"d3e j#_"d4e j$_"d5e j%_"d6e j&_"d7e j'_"d8e j(_"d9Z)d:Z*Gd;d
�d
e �Z+dd<�d=d�Z,d>d?�Z-d@dA�Z.dWdBdC�Z/dXdd�dEd�Z0ddd�dFdG�Z1dYdddH�dIdJ�Z2dKdL�Z3e0Z4dMdN�Z5dOd
�Z6dPd	�Z7GdQd�d�Z8dRdS�Z9e:dTk�re9�dS)Z�N)�*)�__all__�	code_info�dis�disassemble�distb�disco�findlinestarts�
findlabels�	show_code�get_instructions�Instruction�Bytecode�FORMAT_VALUE)N��str�repr�ascii�
MAKE_FUNCTION)�defaultsZ
kwdefaultsZannotationsZclosurecCs6zt||d�}Wn tk
r0t||d�}YnX|S)N�eval�exec)�compile�SyntaxError)�source�name�c�r�/usr/lib64/python3.8/dis.py�_try_compiles
r��file�depthcCsh|dkrt|d�dSt|d�r&|j}t|d�r8|j}n4t|d�rJ|j}n"t|d�r\|j}nt|d�rl|j}t|d�r�t|j�	��}|D]p\}}t
|t�r�td||d�zt
|||d	�Wn0tk
r�}ztd
||d�W5d}~XYnXt|d�q�nht|d��rt|||d	�nLt
|ttf��r6t||d�n.t
|t��rRt|||d	�ntdt|�j��dS)
N�r!�__func__�__code__�gi_code�ag_code�cr_code�__dict__zDisassembly of %s:r zSorry:�co_code�(don't know how to disassemble %s objects)r�hasattrr$r%r&r'r(�sortedr)�items�
isinstance�
_have_code�printr�	TypeError�_disassemble_recursive�bytes�	bytearray�_disassemble_bytesr�_disassemble_str�type�__name__)�xr!r"r.rZx1�msgrrrr+s@	







 �r#cCsX|dkr@z
tj}Wntk
r0td�d�YnX|jr@|j}q2t|jj|j|d�dS)Nz no last traceback to disassembler#)	�sys�last_traceback�AttributeError�RuntimeError�tb_nextr�tb_frame�f_code�tb_lasti)�tbr!rrrrXs
Z	OPTIMIZEDZ	NEWLOCALSZVARARGSZVARKEYWORDSZNESTEDZ	GENERATORZNOFREEZ	COROUTINEZITERABLE_COROUTINEZASYNC_GENERATOR)
������ �@��icCs`g}td�D]:}d|>}||@r|�t�|t|���||N}|sqVq|�t|��d�|�S)NrJrE�, )�range�append�COMPILER_FLAG_NAMES�get�hex�join)�flags�names�i�flagrrr�pretty_flagsrsrYcCs�t|d�r|j}t|d�r"|j}n4t|d�r4|j}n"t|d�rF|j}nt|d�rV|j}t|t�rjt|d�}t|d�rx|St	dt
|�j��dS)	Nr$r%r&r'r(z
<disassembly>r*r+)r,r$r%r&r'r(r/rrr2r8r9�r:rrr�_get_code_object�s"







�r[cCstt|��S�N)�_format_code_infor[rZrrrr�scCs�g}|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�dt|j	��|j
r�|�d	�t|j
�D]}|�d
|�q�|jr�|�d�t|j�D]}|�d|�q�|j
�r|�d
�t|j
�D]}|�d|��q|j�rH|�d�t|j�D]}|�d|��q2|j�rz|�d�t|j�D]}|�d|��qdd�|�S)NzName:              %szFilename:          %szArgument count:    %szPositional-only arguments: %szKw-only arguments: %szNumber of locals:  %szStack size:        %szFlags:             %sz
Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:�
)rP�co_name�co_filename�co_argcount�co_posonlyargcount�co_kwonlyargcount�
co_nlocals�co_stacksizerY�co_flags�	co_consts�	enumerate�co_names�co_varnames�co_freevars�co_cellvarsrT)�co�linesZi_cZi_nrrrr]�s<




r]cCstt|�|d�dS�Nr#)r1r)rmr!rrrr�s�_InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetz!Human readable name for operationzNumeric code for operationz6Numeric argument to operation (if any), otherwise Nonez4Resolved arg value (if known), otherwise same as argz0Human readable description of operation argumentz1Start index of operation within bytecode sequencez4Line started by this opcode (if any), otherwise Nonez1True if other code jumps to here, otherwise False��c@seZdZddd�ZdS)r
�FrGcCs�g}|r:|jdk	r,d|}|�||j�n|�d|�|rJ|�d�n
|�d�|jrf|�d�n
|�d�|�t|j��|��|�|j�t��|j	dk	r�|�t|j	��t
��|jr�|�d|jd�d�|��
�S)	Nz%%%dd� z-->z   z>>z  �(�))�starts_linerP�is_jump_targetr�offset�rjust�opname�ljust�
_OPNAME_WIDTH�arg�_OPARG_WIDTH�argreprrT�rstrip)�self�lineno_widthZmark_as_current�offset_widthZfieldsZ
lineno_fmtrrr�_disassemble�s&



zInstruction._disassembleN)rsFrG)r9�
__module__�__qualname__r�rrrrr
�s)�
first_linecCsTt|�}|j|j}tt|��}|dk	r4||j}nd}t|j|j|j	|j
|||�S�Nr)r[rlrk�dictr	�co_firstlineno�_get_instructions_bytesr*rjrirg)r:r�rm�
cell_names�
linestarts�line_offsetrrrrs�cCs |}|dk	r||}|t|�fSr\�r)Zconst_indexZ
const_list�argvalrrr�_get_const_infosr�cCs*|}|dk	r||}|}nt|�}||fSr\r�)Z
name_indexZ	name_listr�r�rrr�_get_name_info'sr�c
#s�t|�}d}t|�D�]r\}	}
�|dk	rD|�|	d�}|dk	rD||7}|	|k}d}d}
�dk	�rl�}|
tkrzt�|�\}}
n�|
tkr�t�|�\}}
n�|
tkr�|	d�}dt|�}
n�|
t	kr�t�|�\}}
n�|
t
kr�t�}|}
n�|
tkr�t�|�\}}
nr|
t
k�rFt�d@\}}
|t�d@�f}|d�rl|
�r<|
d7}
|
d7}
n&|
tk�rld��fd	d
�tt�D��}
tt|
|
�||
|	||�VqdS)NrrFzto rsrGrErNzwith formatc3s"|]\}}�d|>@r|VqdS)rENr)�.0rW�s�r~rr�	<genexpr>gs�z*_get_instructions_bytes.<locals>.<genexpr>)r
�_unpack_opargsrRZhasconstr�Zhasnamer��hasjrelrZhaslocalZ
hascompareZcmp_opZhasfreer�FORMAT_VALUE_CONVERTERS�boolrrTrh�MAKE_FUNCTION_FLAGSr
r{)�code�varnamesrV�	constants�cellsr�r��labelsrwry�oprxr�r�rr�rr�7sV






�r����c
Cs<|j|j}tt|��}t|j||j|j|j|||d�dSro)	rlrkr�r	r6r*rjrirg)rm�lastir!r�r�rrrrms�cCspt||d�|dks|dkrl|dk	r,|d}|jD]8}t|d�r2t|d�td|f|d�t|||d�q2dS)Nr#rrEr*zDisassembly of %r:r )rrgr,r1r3)rmr!r"r:rrrr3ts


r3)r!r�c	Cs�|dk	}	|	r8t|���|}
|
dkr2tt|
��}q<d}nd}t|�d}|dkr^tt|��}
nd}
t|||||||d�D]J}|	o�|jdk	o�|jdk}|r�t|d�|j|k}t|�|||
�|d�qxdS)	Ni�rsrrFi'rG�r�r#)	�max�values�lenrr�rwryr1r�)r�r�r�rVr�r�r�r!r�Zshow_linenoZ	maxlinenor�Z	maxoffsetr�ZinstrZnew_source_lineZis_current_instrrrrr6s8�
��

�r6cKstt|d�f|�dS)Nz<dis>)r3r)r�kwargsrrrr7�sr7ccsdd}tdt|�d�D]J}||}|tkrN||d|B}|tkrH|d>nd}nd}|||fVqdS)NrrFrErH)rOr�Z
HAVE_ARGUMENTZEXTENDED_ARG)r�Zextended_argrWr�r~rrrr��sr�cCs\g}t|�D]J\}}}|dk	r|tkr4|d|}n|tkr|}nq||kr|�|�q|S)NrF)r�r�ZhasjabsrP)r�r�ryr�r~Zlabelrrrr
�sc	cs�|jddd�}|jddd�}t|j�}d}|j}d}t||�D]P\}}|rz||krd||fV|}||7}||krzdS|dkr�|d8}||7}qB||kr�||fVdS)NrrFrErLrM)�	co_lnotabr�r*r��zip)	r�Zbyte_incrementsZline_incrementsZbytecode_lenZ
lastlineno�linenoZaddrZ	byte_incrZ	line_incrrrrr	�s&


c@sHeZdZddd�dd�Zdd�Zdd�Zed	d
��Zdd�Zd
d�Z	dS)rN)r��current_offsetcCsdt|�|_}|dkr&|j|_d|_n||_||j|_|j|j|_tt	|��|_
||_||_dSr�)
r[�codeobjr�r��_line_offsetrlrk�_cell_namesr�r	�_linestarts�_original_objectr�)r�r:r�r�rmrrr�__init__�szBytecode.__init__c	Cs*|j}t|j|j|j|j|j|j|jd�S)Nr�)	r�r�r*rjrirgr�r�r�)r�rmrrr�__iter__�s�zBytecode.__iter__cCsd�|jj|j�S)Nz{}({!r}))�format�	__class__r9r��r�rrr�__repr__�s
�zBytecode.__repr__cCs |jr|j}q||jj|jd�S)N)r�)r@rArBrC)�clsrDrrr�from_traceback�szBytecode.from_tracebackcCs
t|j�Sr\)r]r�r�rrr�infosz
Bytecode.infocCsl|j}|jdk	r|j}nd}t���>}t|j|j|j|j|j	|j
|j||d�	|��W5QR�SQRXdS)Nr�)r�rVr�r�r�r�r!r�)
r�r��io�StringIOr6r*rjrirgr�r�r��getvalue)r�rmry�outputrrrr
s


�zBytecode.dis)
r9r�r�r�r�r��classmethodr�r�rrrrrr�s

c	Csfddl}|��}|jd|�d�ddd�|��}|j�}|��}W5QRXt||jjd�}t	|�dS)Nr�infile�rb�?�-)r8�nargs�defaultr)
�argparse�ArgumentParser�add_argumentZFileType�
parse_argsr��readrrr)r��parser�argsr�rr�rrr�_testsr��__main__)N)N)NNNNNr)r�)r�NNNNN);r<�types�collectionsr�ZopcoderZ_opcodes_all�
MethodType�FunctionType�CodeTyper��staticmethodr8r0Zopmaprrrrr�rr�rrrrQrYr[rr]r�
namedtuplerpr{�__doc__r~r�r�ryrwrxr}rr
rr�r�r�rr3r6r7rr�r
r	rr�r9rrrr�<module>s�
����
-�
 �4�
6��=
tty.cpython-38.opt-2.pyc000064400000001711151450073350010757 0ustar00U

e5do�@sHddlTddgZdZdZdZdZdZdZd	Ze	fd
d�Z
e	fdd�ZdS)
�)�*�setraw�	setcbreak������cCs�t|�}|tttBtBtBtB@|t<|tt@|t<|t	t
tB@|t	<|t	tB|t	<|t
ttBtBtB@|t
<d|tt<d|tt<t|||�dS�Nrr)�	tcgetattr�IFLAGZBRKINTZICRNLZINPCKZISTRIPZIXON�OFLAGZOPOST�CFLAGZCSIZEZPARENBZCS8�LFLAG�ECHO�ICANONZIEXTENZISIG�CC�VMIN�VTIME�	tcsetattr��fdZwhen�mode�r�/usr/lib64/python3.8/tty.pyrs"cCsFt|�}|tttB@|t<d|tt<d|tt<t|||�dSr)rrrrrrrrrrrrrs
N)Ztermios�__all__r
rrrZISPEEDZOSPEEDrZ	TCSAFLUSHrrrrrr�<module>sos.cpython-38.opt-1.pyc000064400000075207151450073350010572 0ustar00U

e5dS��@s�dZddlZddlZddlZddlmZejZdddddd	d
ddd
dddddddddgZ	dd�Z
dd�Zdekr�dZdZ
ddlTzddlmZe	�d�Wnek
r�YnXddlZzdd lmZWnek
r�YnXddlZe	�ee��[n�d!ek�r�d!Zd"Z
ddlTzddlmZe	�d�Wnek
�rBYnXddlZddlZe	�ee��[zdd lmZWnek
�r�YnXned#��eejd$<dd%lmZmZmZmZmZmZm Z m!Z![e
d&��r�e"�Z#d'd(�Z$e%�Z&e$d)d*�e$d+d,�e$d-d.�e$d/d0�e$d1d2�e$d3d4�e$d5d6�e$d7d8�e$d9d:�e$d;d<�e$d=d>�e$d?d@�e$dAdB�e$dCdD�e$dCdE�e$dFd2�e&Z'e%�Z&e$d)d*�e&Z(e%�Z&e$dGdH�e$dId,�e$dJd.�e$dKdL�e$dKdM�e$dNdO�e&�)e�e$dPdQ�e$dRd2�e$dSd2�e$dTdU�e
dV��r2e
dW��r2e$dXdV�e&Z*e%�Z&e$d)d*�e$d-d.�e$d/d0�e$dYdZ�e$d[d,�e
d\��r�e$d]d.�e$d3d4�e$d^d2�e$d_d0�e$d/d0�e$dFd2�e$d`d0�e&Z+[&[[#[$dZ,daZ-dbZ.d�dedf�Z/dgdh�Z0didj�Z1e	�dfdhdjg�d�dldm�Z2e	�dm�e3ehe'k�rTe4ehe*k�rTd�ddddo�dpdq�Z5drds�Z6e	�dq�dtdu�Z7dvdw�Z8dxdy�Z9dzd{�Z:d|d}�Z;d~d�Z<e	�dudwdyd{d}dg�d�d�d��Z=d�d�d�Z>dd�lm?Z?Gd�d��d�e?�Z@zeAZBWneCk
�r�d�d��ZBYnXd�e	k�re	�d��zeDZEWneCk
�r,d�d��ZEYnXd�e	k�rBe	�d��d�d��ZFeF�ZG[Fd�d�d��ZHed!kZIe	�d��eI�r�d�d��ZJe@eGjKeJeLeJeLeBeE�ZM[Jd�d�d��ZNe	�d��d�d��ZOeO�\ZPZQ[Oe
d���r0e
d���s0e
d���r0dZRdaZSZTe	�d�d�d�g�d�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYe	�d�d�d�d�g�e
d���rXd�d��ZZd�d��Z[e	�d�d�g�e
d���r�d�d��Z\d�d��Z]e	�d�d�g�d�d�d�Z^Gd�d��d��Z_d�d�Z`d�d��Zae
d���s�eaZbd�eb_cGd�d��d�ejd�Zeed!k�r�Gd�d��d��Zfd�d��ZgdS)�aNOS routines for NT or Posix depending on what system we're on.

This exports:
  - all functions from posix or nt, e.g. unlink, stat, etc.
  - os.path is either posixpath or ntpath
  - os.name is either 'posix' or 'nt'
  - os.curdir is a string representing the current directory (always '.')
  - os.pardir is a string representing the parent directory (always '..')
  - os.sep is the (or a most common) pathname separator ('/' or '\\')
  - os.extsep is the extension separator (always '.')
  - os.altsep is the alternate pathname separator (None or '/')
  - os.pathsep is the component separator used in $PATH etc
  - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
  - os.defpath is the default search path for executables
  - os.devnull is the file path of the null device ('/dev/null', etc.)

Programs that import and use 'os' stand a better chance of being
portable between different platforms.  Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
�N)�_check_methods�altsep�curdir�pardir�sep�pathsep�linesep�defpath�name�path�devnull�SEEK_SET�SEEK_CUR�SEEK_END�fsencode�fsdecode�
get_exec_path�fdopen�popen�extsepcCs
|t�kS�N)�globals)r
�r�/usr/lib64/python3.8/os.py�_exists'srcCs8zt|j�WStk
r2dd�t|�D�YSXdS)NcSsg|]}|ddkr|�qS)r�_r)�.0�nrrr�
<listcomp>.sz%_get_exports_list.<locals>.<listcomp>)�list�__all__�AttributeError�dir)�modulerrr�_get_exports_list*sr$�posix�
)�*)�_exitr()�_have_functions�ntz
zno os specific module foundzos.path)rrrrr	rrrr)cCs"|tkr|tkrt�t|�dSr)�_globalsr)�_set�add)�str�fnrrr�_addfsr0ZHAVE_FACCESSAT�accessZ
HAVE_FCHMODAT�chmodZ
HAVE_FCHOWNAT�chownZHAVE_FSTATAT�statZHAVE_FUTIMESAT�utimeZHAVE_LINKAT�linkZHAVE_MKDIRAT�mkdirZ
HAVE_MKFIFOAT�mkfifoZHAVE_MKNODAT�mknodZHAVE_OPENAT�openZHAVE_READLINKAT�readlinkZ
HAVE_RENAMEAT�renameZHAVE_SYMLINKAT�symlinkZ
HAVE_UNLINKAT�unlink�rmdirZHAVE_UTIMENSATZHAVE_FCHDIR�chdirZHAVE_FCHMODZHAVE_FCHOWNZHAVE_FDOPENDIR�listdir�scandirZHAVE_FEXECVE�execveZHAVE_FTRUNCATE�truncateZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FPATHCONF�pathconf�statvfs�fstatvfsZ
HAVE_FSTATVFSZ
HAVE_LCHFLAGSZchflagsZHAVE_LCHMOD�lchownZHAVE_LCHOWNZHAVE_LUTIMESZ
HAVE_LSTATZ
MS_WINDOWS���FcCs�t�|�\}}|s t�|�\}}|r||r|t�|�s|zt||d�Wntk
rVYnXt}t|t�rpttd�}||kr|dSzt||�Wn$t	k
r�|r�t�
|�s��YnXdS)a�makedirs(name [, mode=0o777][, exist_ok=False])

    Super-mkdir; create a leaf directory and all intermediate ones.  Works like
    mkdir, except that any intermediate path segment (not just the rightmost)
    will be created if it does not exist. If the target directory already
    exists, raise an OSError if exist_ok is False. Otherwise no exception is
    raised.  This is recursive.

    )�exist_ok�ASCIIN)r�split�exists�makedirs�FileExistsErrorr�
isinstance�bytesr7�OSError�isdir)r
�moderL�head�tail�cdirrrrrP�s$


rPcCsjt|�t�|�\}}|s(t�|�\}}|rf|rfzt|�Wntk
rTYqfYnXt�|�\}}q(dS)a�removedirs(name)

    Super-rmdir; remove a leaf directory and all empty intermediate
    ones.  Works like rmdir except that, if the leaf directory is
    successfully removed, directories corresponding to rightmost path
    segments will be pruned away until either the whole path is
    consumed or an error occurs.  Errors during this latter phase are
    ignored -- they generally mean that a directory was not empty.

    N)r?rrNrT)r
rWrXrrr�
removedirs�s
rZcCsnt�|�\}}|r(|r(t�|�s(t|�t||�t�|�\}}|rj|rjzt|�Wntk
rhYnXdS)a<renames(old, new)

    Super-rename; create directories as necessary and delete any left
    empty.  Works like rename, except creation of any intermediate
    directories needed to make the new pathname good is attempted
    first.  After the rename, directories corresponding to rightmost
    path segments of the old name will be pruned until either the
    whole path is consumed or a nonempty directory is found.

    Note: this function can fail with the new directory structure made
    if you lack permissions needed to unlink the leaf directory or
    file.

    N)rrNrOrPr<rZrT)�old�newrWrXrrr�renames�s
r]Tccst|�}g}g}g}zt|�}Wn8tk
rX}z|dk	rB||�WY�dSd}~XYnX|��z.zt|�}	Wntk
r�YW�qpYnXWnBtk
r�}z$|dk	r�||�WY�W5QR�dSd}~XYnXz|	��}
Wntk
�r�d}
YnX|
�r|�|	j�n|�|	j�|sb|
rb|�r0d}n.z|	��}Wntk
�rVd}YnX|}|rb|�|	j	�qbW5QRX|�r�|||fVt	j
t	j}
}|D]4}|||�}|�s�|
|��s�t||||�EdH�q�n,|D]}t||||�EdH�q�|||fVdS)aDirectory tree generator.

    For each directory in the directory tree rooted at top (including top
    itself, but excluding '.' and '..'), yields a 3-tuple

        dirpath, dirnames, filenames

    dirpath is a string, the path to the directory.  dirnames is a list of
    the names of the subdirectories in dirpath (excluding '.' and '..').
    filenames is a list of the names of the non-directory files in dirpath.
    Note that the names in the lists are just names, with no path components.
    To get a full path (which begins with top) to a file or directory in
    dirpath, do os.path.join(dirpath, name).

    If optional arg 'topdown' is true or not specified, the triple for a
    directory is generated before the triples for any of its subdirectories
    (directories are generated top down).  If topdown is false, the triple
    for a directory is generated after the triples for all of its
    subdirectories (directories are generated bottom up).

    When topdown is true, the caller can modify the dirnames list in-place
    (e.g., via del or slice assignment), and walk will only recurse into the
    subdirectories whose names remain in dirnames; this can be used to prune the
    search, or to impose a specific order of visiting.  Modifying dirnames when
    topdown is false has no effect on the behavior of os.walk(), since the
    directories in dirnames have already been generated by the time dirnames
    itself is generated. No matter the value of topdown, the list of
    subdirectories is retrieved before the tuples for the directory and its
    subdirectories are generated.

    By default errors from the os.scandir() call are ignored.  If
    optional arg 'onerror' is specified, it should be a function; it
    will be called with one argument, an OSError instance.  It can
    report the error to continue with the walk, or raise the exception
    to abort the walk.  Note that the filename is available as the
    filename attribute of the exception object.

    By default, os.walk does not follow symbolic links to subdirectories on
    systems that support them.  In order to get this functionality, set the
    optional argument 'followlinks' to true.

    Caution:  if you pass a relative pathname for top, don't change the
    current working directory between resumptions of walk.  walk never
    changes the current directory, and assumes that the client doesn't
    either.

    Example:

    import os
    from os.path import join, getsize
    for root, dirs, files in os.walk('python/Lib/email'):
        print(root, "consumes", end="")
        print(sum(getsize(join(root, name)) for name in files), end="")
        print("bytes in", len(files), "non-directory files")
        if 'CVS' in dirs:
            dirs.remove('CVS')  # don't visit CVS directories

    NFT)
�fspathrBrT�next�
StopIteration�is_dir�appendr
�
is_symlinkr�islink�join�walk)�top�topdown�onerror�followlinks�dirs�nondirs�	walk_dirs�
scandir_it�error�entryra�	walk_intorcrdre�dirname�new_pathrrrrfs^;"


rf�.��follow_symlinks�dir_fdccs�t|t�rt|d�st|�}|s.t|d|d�}t|t|d�}zB|s^t�	|j
�r|t�|t|��r|t
||t|t�|||�EdHW5t|�XdS)aDirectory tree generator.

        This behaves exactly like walk(), except that it yields a 4-tuple

            dirpath, dirnames, filenames, dirfd

        `dirpath`, `dirnames` and `filenames` are identical to walk() output,
        and `dirfd` is a file descriptor referring to the directory `dirpath`.

        The advantage of fwalk() over walk() is that it's safe against symlink
        races (when follow_symlinks is False).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and top should be relative; top will then be relative to that directory.
          (dir_fd is always supported for fwalk.)

        Caution:
        Since fwalk() yields file descriptors, those are only valid until the
        next iteration step, so you should dup() them if you want to keep them
        for a longer period.

        Example:

        import os
        for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):
            print(root, "consumes", end="")
            print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files),
                  end="")
            print("bytes in", len(files), "non-directory files")
            if 'CVS' in dirs:
                dirs.remove('CVS')  # don't visit CVS directories
        �	__index__Fru�rwN)rR�int�hasattrr^r4r:�O_RDONLY�close�st�S_ISDIR�st_moder�samestat�_fwalkrS)rgrhrirvrw�orig_st�topfdrrr�fwalk�s!��r�ccs�t|�}g}g}|s|rdng}	|D]�}
|
j}|r:t|�}z4|
��rb|�|�|	dk	rl|	�|
�n
|�|�Wq$tk
r�z|
��r�|�|�Wntk
r�YnXYq$Xq$|r�||||fV|	dkr�|nt||	�D]�}z@|�s|r�t||dd�}n|\}}
|
jdd�}t	|t
|d�}
Wn>tk
�r\}z|dk	�rD||�WY�q�W5d}~XYnXz@|�sxt�
|t|
���r�t�||�}t|
|||||�EdHW5t|
�Xq�|�s�||||fVdS)NF)rwrv)rvry)rBr
rrarbrTrc�zipr4r:r|r}rr�rer�)r��toppath�isbytesrhrirvrnrkrl�entriesrpr
r��dirfd�err�dirpathrrrr��sZ

�r�cGst||�dS)zpexecl(file, *args)

    Execute the executable file with argument list args, replacing the
    current process. N)�execv��file�argsrrr�execlsr�cGs |d}t||dd�|�dS)z�execle(file, *args, env)

    Execute the executable file with argument list args and
    environment env, replacing the current process. ���N)rC�r�r��envrrr�execlesr�cGst||�dS)z�execlp(file, *args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process. N)�execvpr�rrr�execlp"sr�cGs |d}t||dd�|�dS)z�execlpe(file, *args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the current
    process. r�N)�execvper�rrr�execlpe)sr�cCst||�dS)z�execvp(file, args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process.
    args may be a list or tuple of strings. N��_execvper�rrrr�2sr�cCst|||�dS)z�execvpe(file, args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the
    current process.
    args may be a list or tuple of strings. Nr�r�rrrr�:sr�cCs�|dk	rt}||f}nt}|f}t}t�|�r@||f|��dSd}t|�}tdkrft|�}tt|�}|D]~}t�	||�}z||f|��Wqjt
tfk
r�}	z|	}
W5d}	~	XYqjtk
r�}	z|	}
|dkr�|	}W5d}	~	XYqjXqj|dk	r�|�|
�dS)Nr*)
rCr��environrrrrr
r�mapre�FileNotFoundError�NotADirectoryErrorrT)r�r�r��	exec_func�argrest�	saved_exc�	path_listr"�fullname�e�last_excrrrr�Es6


r�c
Cs�ddl}|dkrt}|����|�dt�z|�d�}Wntk
rPd}YnXtr�z|d}Wnttfk
rzYnX|dk	r�t	d��|}|dk	r�t
|t�r�t|�}W5QRX|dkr�t
}|�t�S)z�Returns the sequence of directories that will be searched for the
    named executable (similar to a shell) when launching a process.

    *env* must be an environment variable dict or None.  If *env* is None,
    os.environ will be used.
    rN�ignore�PATHsPATHz*env cannot contain 'PATH' and b'PATH' keys)�warningsr��catch_warnings�simplefilter�BytesWarning�get�	TypeError�supports_bytes_environ�KeyError�
ValueErrorrRrSrr	rNr)r�r�r��
path_listbrrrres0


�)�MutableMappingc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_EnvironcCs.||_||_||_||_||_||_||_dSr)�	encodekey�	decodekey�encodevalue�decodevalue�putenv�unsetenv�_data)�self�datar�r�r�r�r�r�rrr�__init__�sz_Environ.__init__cCs>z|j|�|�}Wntk
r2t|�d�YnX|�|�Sr)r�r�r�r��r��key�valuerrr�__getitem__�s
z_Environ.__getitem__cCs.|�|�}|�|�}|�||�||j|<dSr)r�r�r�r�r�rrr�__setitem__�s

z_Environ.__setitem__cCsD|�|�}|�|�z|j|=Wntk
r>t|�d�YnXdSr)r�r�r�r�)r�r��
encodedkeyrrr�__delitem__�s

z_Environ.__delitem__ccs$t|j�}|D]}|�|�VqdSr)rr�r�)r��keysr�rrr�__iter__�s
z_Environ.__iter__cCs
t|j�Sr)�lenr��r�rrr�__len__�sz_Environ.__len__cs$d�d��fdd��j��D���S)Nzenviron({{{}}})z, c3s*|]"\}}d���|���|��VqdS)z
{!r}: {!r}N)�formatr�r�)rr�r�r�rr�	<genexpr>�s�z$_Environ.__repr__.<locals>.<genexpr>)r�rer��itemsr�rr�r�__repr__�s

��z_Environ.__repr__cCst|�Sr)�dictr�rrr�copy�sz
_Environ.copycCs||kr|||<||Srrr�rrr�
setdefault�sz_Environ.setdefaultN)�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�rrrrr��s		r�cCsdSrr)r�r�rrr�<lambda>��r�r�cCs
t|d�S)N�)�_putenv�r�rrrr��r�r�cs�tdkrHdd�}|�t}�fdd�}i}t��D]\}}||||�<q0n(t����fdd���fdd	�}�}t}t|||�|tt�S)
Nr*cSs t|t�stdt|�j��|S)N�str expected, not %s)rRr.r��typer��r�rrr�	check_str�s
z!_createenviron.<locals>.check_strcs�|���Sr)�upperr�)�encoderrr��sz!_createenviron.<locals>.encodekeycs(t|t�stdt|�j��|��d�S)Nr��surrogateescape)rRr.r�r�r�r�r���encodingrrr��s
z_createenviron.<locals>.encodecs|��d�S)Nr�)�decoder�r�rrr��sz_createenviron.<locals>.decode)	r
r.r�r��sys�getfilesystemencodingr�r��	_unsetenv)r�r�r�r�r�r�r)r�r�r�_createenviron�s*�r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
    The optional second argument can specify an alternate default.
    key, default and the result are str.)r�r��r��defaultrrr�getenv�sr�)r�r�cCs t|t�stdt|�j��|S)Nzbytes expected, not %s)rRrSr�r�r�r�rrr�_check_bytess
r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
        The optional second argument can specify an alternate default.
        key, default and the result are bytes.)�environbr�r�rrr�getenvbsr�)r�r�cs4t���t�����fdd�}��fdd�}||fS)Ncs&t|�}t|t�r|����S|SdS)aEncode filename (an os.PathLike, bytes, or str) to the filesystem
        encoding with 'surrogateescape' error handler, return bytes unchanged.
        On Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRr.r���filename�r��errorsrrr s
z_fscodec.<locals>.fsencodecs&t|�}t|t�r|����S|SdS)aDecode filename (an os.PathLike, bytes, or str) from the filesystem
        encoding with 'surrogateescape' error handler, return str unchanged. On
        Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRrSr�r�r�rrr,s
z_fscodec.<locals>.fsdecode)r�r��getfilesystemencodeerrors)rrrr�r�_fscodecs
r��fork�spawnvr��P_WAIT�P_NOWAIT�	P_NOWAITOcCs�t|ttf�std��|r"|ds*td��t�}|spz$|dkrJ|||�n||||�Wq�td�Yq�XnR|tkr||St|d�\}}t	|�r�q|q|t
|�r�t|�St|�r�t
|�Std��q|dS)Nzargv must be a tuple or a listrz"argv first element cannot be empty�z"Not stopped, signaled or exited???)rR�tuplerr�r�r�r(r��waitpid�
WIFSTOPPED�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUSrT)rVr�r�r��func�pid�wpid�stsrrr�	_spawnvefIs,
rcCst|||dt�S)aspawnv(mode, file, args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr��rVr�r�rrrr�hscCst||||t�S)a:spawnve(mode, file, args, env) -> integer

Execute file with arguments from args in a subprocess with the
specified environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rrC�rVr�r�r�rrr�spawnveqsrcCst|||dt�S)a8spawnvp(mode, file, args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr�rrrr�spawnvp}sr	cCst||||t�S)a\spawnvpe(mode, file, args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rr�rrrr�spawnvpe�sr
cGst|||�S)aspawnl(mode, file, *args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r�rrrr�spawnl�srcGs|d}t|||dd�|�S)a:spawnle(mode, file, *args, env) -> integer

Execute file with arguments from args in a subprocess with the
supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)rrrrr�spawnle�srcGst|||�S)aWspawnlp(mode, file, *args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r	rrrr�spawnlp�sr
cGs|d}t|||dd�|�S)a]spawnlpe(mode, file, *args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)r
rrrr�spawnlpe�sr�rr�cCs�t|t�stdt|���|dkr.td|��|dks>|dkrFtd��ddl}ddl}|dkr�|j|d|j|d�}t	|�
|j�|�S|j|d|j|d	�}t	|�
|j�|�SdS)
Nz&invalid cmd type (%s, expected string))r�wzinvalid mode %rrz+popen() does not support unbuffered streamsrT)�shell�stdout�bufsize)r�stdinr)
rRr.r�r�r��
subprocess�io�Popen�PIPE�_wrap_close�
TextIOWrapperrr)�cmdrV�	bufferingrr�procrrrr�s(
��c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCs||_||_dSr)�_stream�_proc)r��streamrrrrr��sz_wrap_close.__init__cCs8|j��|j��}|dkr dStdkr,|S|d>SdS)Nrr*�)rr}r�waitr
)r��
returncoderrrr}�s

z_wrap_close.closecCs|Srrr�rrr�	__enter__�sz_wrap_close.__enter__cGs|��dSr�r}�r�r�rrr�__exit__�sz_wrap_close.__exit__cCst|j|�Sr)�getattrr)r�r
rrr�__getattr__�sz_wrap_close.__getattr__cCs
t|j�Sr)�iterrr�rrrr��sz_wrap_close.__iter__N)	r�r�r�r�r}r$r'r)r�rrrrr�s	rcOs4t|t�stdt|���ddl}|j|f|�|�S)Nz&invalid fd type (%s, expected integer)r)rRrzr�r�rr:)�fdr��kwargsrrrrr�s
cCs�t|ttf�r|St|�}z|�|�}Wn0tk
rXt|d�rF�ntd|j��YnXt|ttf�rl|Std�	|jt|�j���dS)aaReturn the path representation of a path-like object.

    If str or bytes is passed in, it is returned unchanged. Otherwise the
    os.PathLike interface is used to get the path representation. If the
    path representation is not str or bytes, TypeError is raised. If the
    provided path is not str, bytes, or os.PathLike, TypeError is raised.
    �
__fspath__z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {}N)
rRr.rSr�r-r!r{r�r�r�)r�	path_type�	path_reprrrr�_fspaths"
��r0r^c@s*eZdZdZejdd��Zedd��ZdS)�PathLikezCAbstract base class for implementing the file system path protocol.cCst�dS)z9Return the file system path representation of the object.N)�NotImplementedErrorr�rrrr-,szPathLike.__fspath__cCs|tkrt|d�StS)Nr-)r1r�NotImplemented)�cls�subclassrrr�__subclasshook__1s
zPathLike.__subclasshook__N)	r�r�r��__doc__�abc�abstractmethodr-�classmethodr6rrrrr1(s

r1c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_AddedDllDirectorycCs||_||_||_dSr)r�_cookie�_remove_dll_directory)r�r�cookieZremove_dll_directoryrrrr�:sz_AddedDllDirectory.__init__cCs|�|j�d|_dSr)r=r<rr�rrrr}>sz_AddedDllDirectory.closecCs|Srrr�rrrr$Asz_AddedDllDirectory.__enter__cGs|��dSrr%r&rrrr'Csz_AddedDllDirectory.__exit__cCs|jrd�|j�SdS)Nz<AddedDllDirectory({!r})>z<AddedDllDirectory()>)rr�r�rrrr�Esz_AddedDllDirectory.__repr__N)r�r�r�r�r}r$r'r�rrrrr;9s
r;cCs ddl}|�|�}t|||j�S)aOAdd a path to the DLL search path.

        This search path is used when resolving dependencies for imported
        extension modules (the module itself is resolved through sys.path),
        and also by ctypes.

        Remove the directory by calling close() on the returned object or
        using it in a with statement.
        rN)r*Z_add_dll_directoryr;r=)rr*r>rrr�add_dll_directoryJs

�r?)rKF)TNF)rtTN)N)N)N)N)rr�)hr7r8r�r4r~�_collections_abcr�builtin_module_namesZ_namesr rr$r
rr%r(rb�ImportError�	posixpathrr)�extendr*Zntpath�modulesZos.pathrrrrr	rrrrr+r0�setr,�supports_dir_fd�supports_effective_idsr-�supports_fd�supports_follow_symlinksr
rrrPrZr]rfr:rBr�r�r�r�r�r�r�r�r�rr�r�r�r��	NameErrorr�r�r�r�r�r�r�r�rSr�r�r�rrr�r�r�rr�rr	r
rrr
rrrrr0r^r��ABCr1r;r?rrrr�<module>s��

(











































 

08
		
 
-7





�


	

	


	

getopt.cpython-38.opt-2.pyc000064400000007145151450073350011450 0ustar00U

e5dA�@s�ddddgZddlZzddlmZWnek
r@dd�ZYnXGd	d�de�ZeZgfd
d�Zgfdd�Z	dd
�Z
dd�Zdd�Zdd�Z
edkr�ddlZeeejdd�dddg��dS)�GetoptError�error�getopt�
gnu_getopt�N)�gettextcCs|S�N�)�srr�/usr/lib64/python3.8/getopt.py�_)�rc@s&eZdZdZdZddd�Zdd�ZdS)r�cCs||_||_t�|||�dSr)�msg�opt�	Exception�__init__)�selfrrrrr
r.szGetoptError.__init__cCs|jSr)r)rrrr
�__str__3szGetoptError.__str__N)r
)�__name__�
__module__�__qualname__rrrrrrrr
r+s
cCs�g}t|�td�kr|g}nt|�}|r�|d�d�r�|ddkr�|ddkr\|dd�}q�|d�d�r�t||ddd�||dd��\}}q$t||ddd�||dd��\}}q$||fS)Nr
r�-�--��)�type�list�
startswith�do_longs�	do_shorts)�args�	shortopts�longopts�optsrrr
r8s((cCs6g}g}t|t�r|g}nt|�}|�d�r>|dd�}d}ntj�d�rPd}nd}|�r.|ddkrz||dd�7}�q.|ddd�dkr�t||ddd�||dd��\}}qT|ddd�d	kr�|dd	kr�t||ddd�||dd��\}}qT|�r||7}�q.qT|�	|d�|dd�}qT||fS)
N�+rTZPOSIXLY_CORRECTFrrrr)
�
isinstance�strrr�os�environ�getrr�append)r r!r"r#Z	prog_argsZall_options_firstrrr
rcs2

( (cCs�z|�d�}Wntk
r&d}Yn X|d|�||dd�}}t||�\}}|r�|dkr�|svttd�||��|d|dd�}}n|dk	r�ttd�||��|�d||p�df�||fS)N�=rzoption --%s requires argumentrz%option --%s must not have an argumentrr
)�index�
ValueError�
long_has_argsrrr*)r#rr"r �i�optarg�has_argrrr
r�s
rcs��fdd�|D�}|s(ttd������|kr8d�fS�d|krLd�fSt|�dkrjttd�����|d	}|�d�}|r�|dd
�}||fS)Ncsg|]}|���r|�qSr)r)�.0�o�rrr
�
<listcomp>�s
z!long_has_args.<locals>.<listcomp>zoption --%s not recognizedFr+Trzoption --%s not a unique prefixr���)rr�len�endswith)rr"Z
possibilitiesZunique_matchr1rr4r
r.�s
r.cCs�|dkr�|d|dd�}}t||�rh|dkr\|sFttd�||��|d|dd�}}|d}}nd}|�d||f�q||fS)Nr
rrzoption -%s requires argumentr)�
short_has_argrrr*)r#Z	optstringr!r rr0rrr
r�s
�rcCsXtt|��D]4}|||kr(dkrnq|�d|d�Sqttd�||��dS)N�:rzoption -%s not recognized)�ranger7rrr)rr!r/rrr
r9�sr9�__main__rza:bzalpha=Zbeta)�__all__r'rr�ImportErrorrrrrrrr.rr9r�sys�print�argvrrrr
�<module>"s +2fractions.cpython-38.opt-1.pyc000064400000044465151450073350012143 0ustar00U

e5d	_�@s�dZddlmZddlZddlZddlZddlZddlZddgZdd�Z	dd�Z
ejjZ
ejjZe�d	ejejB�ZGd
d�dej�ZdS)z+Fraction, infinite-precision, real numbers.���DecimalN�Fraction�gcdcCsfddl}|�dtd�t|�tkr2t|�kr\nn&|p<|dkrPt�||�St�||�St||�S)z�Calculate the Greatest Common Divisor of a and b.

    Unless b==0, the result will have the same sign as b (so that when
    b is divided by it, the result comes out positive).
    rNz6fractions.gcd() is deprecated. Use math.gcd() instead.�)�warnings�warn�DeprecationWarning�type�int�mathr�_gcd)�a�br�r�!/usr/lib64/python3.8/fractions.pyrs� cCs|r|||}}q|S�Nr�rrrrrr
 sr
aC
    \A\s*                      # optional whitespace at the start, then
    (?P<sign>[-+]?)            # an optional sign, then
    (?=\d|\.\d)                # lookahead for digit or .digit
    (?P<num>\d*)               # numerator (possibly empty)
    (?:                        # followed by
       (?:/(?P<denom>\d+))?    # an optional denominator
    |                          # or
       (?:\.(?P<decimal>\d*))? # an optional fractional part
       (?:E(?P<exp>[-+]?\d+))? # and optional exponent
    )
    \s*\Z                      # and optional whitespace to finish
cs�eZdZdZdZdRdd��fdd�Zed	d
��Zedd��Zd
d�Z	dSdd�Z
edd��Zedd��Z
dd�Zdd�Zdd�Zdd�Zeeej�\ZZdd�Zeeej�\ZZd d!�Zeeej�\ZZd"d#�Zeeej�\Z Z!d$d%�Z"ee"ej#�\Z$Z%d&d'�Z&ee&e'�\Z(Z)d(d)�Z*ee*ej+�\Z,Z-d*d+�Z.d,d-�Z/d.d/�Z0d0d1�Z1d2d3�Z2d4d5�Z3d6d7�Z4d8d9�Z5dTd:d;�Z6d<d=�Z7d>d?�Z8d@dA�Z9dBdC�Z:dDdE�Z;dFdG�Z<dHdI�Z=dJdK�Z>dLdM�Z?dNdO�Z@dPdQ�ZA�ZBS)Ura]This class implements rational numbers.

    In the two-argument form of the constructor, Fraction(8, 6) will
    produce a rational number equivalent to 4/3. Both arguments must
    be Rational. The numerator defaults to 0 and the denominator
    defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.

    Fractions can also be constructed from:

      - numeric strings similar to those accepted by the
        float constructor (for example, '-2.3' or '1e10')

      - strings of the form '123/456'

      - float and Decimal instances

      - other Rational instances (including integers)

    ��
_numerator�_denominatorrNT��
_normalizecsRtt|��|�}|dk�rdt|�tkr6||_d|_|St|tj	�rV|j
|_|j|_|St|tt
f�rx|��\|_|_|St|t��rZt�|�}|dkr�td|��t|�d�p�d�}|�d�}|r�t|�}nvd}|�d�}|�rdt|�}||t|�}||9}|�d	�}	|	�rBt|	�}	|	d
k�r4|d|	9}n|d|	9}|�d�dk�rb|}ntd
��nft|�tk�r�t|�k�r�nnn@t|tj	��r�t|tj	��r�|j
|j|j
|j}}ntd��|d
k�r�td|��|�rBt|�tk�rt|�k�r(nnt�||�}
|d
k�r2|
}
n
t||�}
||
}||
}||_||_|S)a�Constructs a Rational.

        Takes a string like '3/2' or '1.5', another Rational instance, a
        numerator/denominator pair, or a float.

        Examples
        --------

        >>> Fraction(10, -8)
        Fraction(-5, 4)
        >>> Fraction(Fraction(1, 7), 5)
        Fraction(1, 35)
        >>> Fraction(Fraction(1, 7), Fraction(2, 3))
        Fraction(3, 14)
        >>> Fraction('314')
        Fraction(314, 1)
        >>> Fraction('-35/4')
        Fraction(-35, 4)
        >>> Fraction('3.1415') # conversion from numeric string
        Fraction(6283, 2000)
        >>> Fraction('-47e-2') # string may include a decimal exponent
        Fraction(-47, 100)
        >>> Fraction(1.47)  # direct construction from float (exact conversion)
        Fraction(6620291452234629, 4503599627370496)
        >>> Fraction(2.25)
        Fraction(9, 4)
        >>> Fraction(Decimal('1.47'))
        Fraction(147, 100)

        N�z Invalid literal for Fraction: %rZnum�0�denom�decimal�
�exprZsign�-z2argument should be a string or a Rational instancez+both arguments should be Rational instanceszFraction(%s, 0))�superr�__new__r
rrr�
isinstance�numbers�Rational�	numerator�denominator�floatr�as_integer_ratio�str�_RATIONAL_FORMAT�match�
ValueError�group�len�	TypeError�ZeroDivisionErrorrrr
)�clsr%r&r�self�mrrZscaler�g��	__class__rrr!Tsx

�





$
�

�
$

zFraction.__new__cCsDt|tj�r||�St|t�s8td|j|t|�jf��||���S)z�Converts a finite float to a rational number, exactly.

        Beware that Fraction.from_float(0.3) != Fraction(3, 10).

        z.%s.from_float() only takes floats, not %r (%s))r"r#�Integralr'r/�__name__r
r()r1�frrr�
from_float�s
�zFraction.from_floatcCsVddlm}t|tj�r&|t|��}n$t||�sJtd|j|t|�jf��||�	��S)zAConverts a finite Decimal instance to a rational number, exactly.rrz2%s.from_decimal() only takes Decimals, not %r (%s))
rrr"r#r7rr/r8r
r()r1Zdecrrrr�from_decimal�s
��zFraction.from_decimalcCs|j|jfS)z�Return the integer ratio as a tuple.

        Return a tuple of two integers, whose ratio is equal to the
        Fraction and with a positive denominator.
        r�r2rrrr(�szFraction.as_integer_ratio�@Bc
Cs�|dkrtd��|j|kr"t|�Sd\}}}}|j|j}}||}|||}	|	|krZq�||||||	f\}}}}||||}}q<|||}
t||
|||
|�}t||�}t||�t||�kr�|S|SdS)aWClosest Fraction to self with denominator at most max_denominator.

        >>> Fraction('3.141592653589793').limit_denominator(10)
        Fraction(22, 7)
        >>> Fraction('3.141592653589793').limit_denominator(100)
        Fraction(311, 99)
        >>> Fraction(4321, 8765).limit_denominator(10000)
        Fraction(4321, 8765)

        rz$max_denominator should be at least 1)rrrrN)r,rrr�abs)
r2Zmax_denominatorZp0Zq0Zp1Zq1�n�drZq2�kZbound1Zbound2rrr�limit_denominator�s$ 

zFraction.limit_denominatorcCs|jSr)r�rrrrr%szFraction.numeratorcCs|jSr)rrCrrrr&szFraction.denominatorcCsd|jj|j|jfS)z
repr(self)z
%s(%s, %s))r6r8rrr<rrr�__repr__"s�zFraction.__repr__cCs(|jdkrt|j�Sd|j|jfSdS)z	str(self)rz%s/%sN)rr)rr<rrr�__str__'s

zFraction.__str__csT��fdd�}d�jd|_�j|_��fdd�}d�jd|_�j|_||fS)a�Generates forward and reverse operators given a purely-rational
        operator and a function from the operator module.

        Use this like:
        __op__, __rop__ = _operator_fallbacks(just_rational_op, operator.op)

        In general, we want to implement the arithmetic operations so
        that mixed-mode operations either call an implementation whose
        author knew about the types of both arguments, or convert both
        to the nearest built in type and do the operation there. In
        Fraction, that means that we define __add__ and __radd__ as:

            def __add__(self, other):
                # Both types have numerators/denominator attributes,
                # so do the operation directly
                if isinstance(other, (int, Fraction)):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                # float and complex don't have those operations, but we
                # know about those types, so special case them.
                elif isinstance(other, float):
                    return float(self) + other
                elif isinstance(other, complex):
                    return complex(self) + other
                # Let the other type take over.
                return NotImplemented

            def __radd__(self, other):
                # radd handles more types than add because there's
                # nothing left to fall back to.
                if isinstance(other, numbers.Rational):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                elif isinstance(other, Real):
                    return float(other) + float(self)
                elif isinstance(other, Complex):
                    return complex(other) + complex(self)
                return NotImplemented


        There are 5 different cases for a mixed-type addition on
        Fraction. I'll refer to all of the above code that doesn't
        refer to Fraction, float, or complex as "boilerplate". 'r'
        will be an instance of Fraction, which is a subtype of
        Rational (r : Fraction <: Rational), and b : B <:
        Complex. The first three involve 'r + b':

            1. If B <: Fraction, int, float, or complex, we handle
               that specially, and all is well.
            2. If Fraction falls back to the boilerplate code, and it
               were to return a value from __add__, we'd miss the
               possibility that B defines a more intelligent __radd__,
               so the boilerplate should return NotImplemented from
               __add__. In particular, we don't handle Rational
               here, even though we could get an exact answer, in case
               the other type wants to do something special.
            3. If B <: Fraction, Python tries B.__radd__ before
               Fraction.__add__. This is ok, because it was
               implemented with knowledge of Fraction, so it can
               handle those instances before delegating to Real or
               Complex.

        The next two situations describe 'b + r'. We assume that b
        didn't know about Fraction in its implementation, and that it
        uses similar boilerplate code:

            4. If B <: Rational, then __radd_ converts both to the
               builtin rational type (hey look, that's us) and
               proceeds.
            5. Otherwise, __radd__ tries to find the nearest common
               base ABC, and fall back to its builtin type. Since this
               class doesn't subclass a concrete type, there's no
               implementation to fall back to, so we need to try as
               hard as possible to return an actual value, or the user
               will get a TypeError.

        csPt|ttf�r�||�St|t�r0�t|�|�St|t�rH�t|�|�StSdSr)r"rrr'�complex�NotImplementedr��fallback_operator�monomorphic_operatorrr�forward~s


z-Fraction._operator_fallbacks.<locals>.forward�__csZt|tj�r�||�St|tj�r4�t|�t|��St|tj�rR�t|�t|��StSdSr)r"r#r$ZRealr'�ComplexrFrG�rrrHrr�reverse�s
z-Fraction._operator_fallbacks.<locals>.reverseZ__r)r8�__doc__)rJrIrKrOrrHr�_operator_fallbacks.sP	
zFraction._operator_fallbackscCs,|j|j}}t|j||j|||�S)za + b�r&rr%�rr�da�dbrrr�_add�s�z
Fraction._addcCs,|j|j}}t|j||j|||�S)za - brRrSrrr�_sub�s�z
Fraction._subcCst|j|j|j|j�S)za * b�rr%r&rrrr�_mul�sz
Fraction._mulcCst|j|j|j|j�S)za / brXrrrr�_div�s
�z
Fraction._divcCs|j|j|j|jS)za // b�r%r&rrrr�	_floordiv�szFraction._floordivcCs:|j|j}}t|j|||j�\}}|t|||�fS)z(a // b, a % b))r&�divmodr%r)rrrTrUZdivZn_modrrr�_divmod�szFraction._divmodcCs,|j|j}}t|j||j|||�S)za % brRrSrrr�_mod�sz
Fraction._modcCs�t|tj�r�|jdkr�|j}|dkr>t|j||j|dd�S|jdkrft|j||j|dd�St|j||j|dd�Sq�t|�t|�Snt|�|SdS)z�a ** b

        If b is not an integer, the result will be a float or complex
        since roots are generally irrational. If b is an integer, the
        result will be rational.

        rrFrN)	r"r#r$r&r%rrrr')rrZpowerrrr�__pow__�s&

�

��zFraction.__pow__cCs\|jdkr|jdkr||jSt|tj�r<t|j|j�|S|jdkrP||jS|t|�S)za ** brr)	rrr"r#r$rr%r&r'rNrrr�__rpow__�s


zFraction.__rpow__cCst|j|jdd�S)z++a: Coerces a subclass instance to FractionFr�rrrrCrrr�__pos__�szFraction.__pos__cCst|j|jdd�S)z-aFrrbrCrrr�__neg__�szFraction.__neg__cCstt|j�|jdd�S)zabs(a)Fr)rr>rrrCrrr�__abs__�szFraction.__abs__cCs*|jdkr|j|jS|j|jSdS)ztrunc(a)rNrrCrrr�	__trunc__s
zFraction.__trunc__cCs|j|jS)z
math.floor(a)r[rCrrr�	__floor__
szFraction.__floor__cCs|j|jS)zmath.ceil(a)r[rCrrr�__ceil__szFraction.__ceil__cCs�|dkrZt|j|j�\}}|d|jkr,|S|d|jkrB|dS|ddkrR|S|dSdt|�}|dkr�tt||�|�Stt||�|�SdS)z?round(self, ndigits)

        Rounds half toward even.
        Nrrrr)r]r%r&r>r�round)r2ZndigitsZfloorZ	remainder�shiftrrr�	__round__szFraction.__round__cCsPt|jtdt�}|st}nt|j�|t}|dkr:|n|}|dkrLdS|S)z
hash(self)rr������)�powr�_PyHASH_MODULUS�_PyHASH_INFr>r)r2ZdinvZhash_�resultrrr�__hash__,szFraction.__hash__cCs�t|�tkr |j|ko|jdkSt|tj�rD|j|jkoB|j|jkSt|tj	�r`|j
dkr`|j}t|t�r�t
�|�s~t
�|�r�d|kS||�|�kSntSdS)za == brr�N)r
rrrr"r#r$r%r&rM�imag�realr'r�isnan�isinfr:rGrrrr�__eq__Bs
�
zFraction.__eq__cCsht|tj�r&||j|j|j|j�St|t�r`t�	|�sDt�
|�rN|d|�S|||�|��SntSdS)acHelper for comparison operators, for internal use only.

        Implement comparison between a Rational instance `self`, and
        either another Rational instance or a float `other`.  If
        `other` is not a Rational instance or a float, return
        NotImplemented. `op` should be one of the six standard
        comparison operators.

        rsN)
r"r#r$rr&rr%r'rrvrwr:rG)r2�other�oprrr�_richcmpWs
�

zFraction._richcmpcCs|�|tj�S)za < b)r{�operator�ltrrrr�__lt__mszFraction.__lt__cCs|�|tj�S)za > b)r{r|�gtrrrr�__gt__qszFraction.__gt__cCs|�|tj�S)za <= b)r{r|�lerrrr�__le__uszFraction.__le__cCs|�|tj�S)za >= b)r{r|�gerrrr�__ge__yszFraction.__ge__cCs
t|j�S)za != 0)�boolrrCrrr�__bool__}szFraction.__bool__cCs|jt|�ffSr)r6r)r<rrr�
__reduce__�szFraction.__reduce__cCs t|�tkr|S|�|j|j�Sr�r
rr6rrr<rrr�__copy__�szFraction.__copy__cCs t|�tkr|S|�|j|j�Srr�)r2Zmemorrr�__deepcopy__�szFraction.__deepcopy__)rN)r=)N)Cr8�
__module__�__qualname__rP�	__slots__r!�classmethodr:r;r(rB�propertyr%r&rDrErQrVr|�add�__add__�__radd__rW�sub�__sub__�__rsub__rY�mul�__mul__�__rmul__rZ�truediv�__truediv__�__rtruediv__r\�floordiv�__floordiv__�
__rfloordiv__r^r]�
__divmod__�__rdivmod__r_�mod�__mod__�__rmod__r`rarcrdrerfrgrhrkrrrxr{r~r�r�r�r�r�r�r��
__classcell__rrr5rr<sdm



7

k
)rPrrrr#r|�re�sys�__all__rr
�	hash_info�modulusro�infrp�compile�VERBOSE�
IGNORECASEr*r$rrrrr�<module>s
�bisect.cpython-38.opt-1.pyc000064400000004464151450073350011417 0ustar00U

e5d��@sZdZddd�Zd
dd�Zddd�Zdd	d
�ZzddlTWnek
rLYnXeZeZdS)zBisection algorithms.�NcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_right�insert��a�x�lo�hi�r	�/usr/lib64/python3.8/bisect.py�insort_rights	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krF|}q |d}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e <= x, and all e in
    a[i:] have e > x.  So if x already appears in the list, a.insert(x) will
    insert just after the rightmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    r�lo must be non-negativeN����
ValueError�len�rrrrZmidr	r	r
rs
rcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the left of the leftmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_leftrrr	r	r
�insort_left$s	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krJ|d}q |}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, a.insert(x) will
    insert just before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    rrNr
rrrr	r	r
r1s
r)�*)rN)rN)rN)rN)	�__doc__rrrrZ_bisect�ImportErrorZbisectZinsortr	r	r	r
�<module>s



asynchat.cpython-38.pyc000064400000015305151450073350011015 0ustar00U

e5d@,�@sDdZddlZddlmZGdd�dej�ZGdd�d�Zdd	�ZdS)
a�A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
�N)�dequec@s�eZdZdZdZdZdZdZd(dd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))�
async_chatz�This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator()irzlatin-1NcCs(d|_g|_t�|_tj�|||�dS�N�)�ac_in_buffer�incomingr�
producer_fifo�asyncore�
dispatcher�__init__)�selfZsock�map�r� /usr/lib64/python3.8/asynchat.pyrCszasync_chat.__init__cCstd��dS�Nzmust be implemented in subclass��NotImplementedError�r�datarrr�collect_incoming_dataQsz async_chat.collect_incoming_datacCs|j�|�dS�N)r�appendrrrr�_collect_incoming_dataTsz!async_chat._collect_incoming_datacCsd�|j�}|jdd�=|Sr)�joinr)r�drrr�	_get_dataWszasync_chat._get_datacCstd��dSrr�rrrr�found_terminator\szasync_chat.found_terminatorcCsBt|t�r|jrt||j�}nt|t�r8|dkr8td��||_dS)zdSet the input delimiter.

        Can be a fixed string of any length, an integer, or None.
        rz-the number of received bytes must be positiveN)�
isinstance�str�use_encoding�bytes�encoding�int�
ValueError�
terminator)rZtermrrr�set_terminator_s
zasync_chat.set_terminatorcCs|jSr)r%rrrr�get_terminatorjszasync_chat.get_terminatorc
Cs�z|�|j�}WnDtk
r&YdStk
rT}z|��WY�dSd}~XYnXt|t�rr|jrrtt|j	�}|j
||_
|j
�r�t|j
�}|��}|s�|�
|j
�d|_
q~t|t��r|}||kr�|�
|j
�d|_
|j||_n2|�
|j
d|��|j
|d�|_
d|_|��q~t|�}|j
�|�}|dk�rv|dk�rX|�
|j
d|��|j
||d�|_
|��q~t|j
|�}|�r�||k�r�|�
|j
d|��|j
|d�|_
�q�q~|�
|j
�d|_
q~dS)Nrr���)Zrecv�ac_in_buffer_size�BlockingIOError�OSError�handle_errorrrr r!r"r�lenr'rr#r%r�find�find_prefix_at_end)rrZwhyZlbr%�nZterminator_len�indexrrr�handle_readrsR

	



zasync_chat.handle_readcCs|��dSr)�
initiate_sendrrrr�handle_write�szasync_chat.handle_writecCs|��dSr)�closerrrr�handle_close�szasync_chat.handle_closecCsxt|tttf�stdt|���|j}t|�|kr`tdt|�|�D]}|j	�
||||��q@n|j	�
|�|��dS)Nz#data argument must be byte-ish (%r)r)rr!�	bytearray�
memoryview�	TypeError�type�ac_out_buffer_sizer-�rangerrr3)rrZsabs�irrr�push�s�zasync_chat.pushcCs|j�|�|��dSr)rrr3)rZproducerrrr�push_with_producer�szasync_chat.push_with_producercCsdS)z4predicate for inclusion in the readable for select()�rrrrr�readable�szasync_chat.readablecCs|jp|jS)z4predicate for inclusion in the writable for select())r�	connectedrrrr�writable�szasync_chat.writablecCs|j�d�dS)zAautomatically close this channel once the outgoing queue is emptyN)rrrrrr�close_when_done�szasync_chat.close_when_donecCs|j�r|j�r|jd}|s:|jd=|dkr:|��dS|j}z|d|�}Wn:tk
r�|��}|rz|j�|�n|jd=YqYnXt|t�r�|j	r�t
||j�}z|�|�}Wnt
k
r�|��YdSX|�r|t|�ks�|t|�k�r
||d�|jd<n|jd=dSdS)Nr)rrBr6r;r9�more�
appendleftrrr r!r"�sendr+r,r-)r�firstZobsrZnum_sentrrrr3�s8

zasync_chat.initiate_sendcCs d|_|jdd�=|j��dSr)rrr�clearrrrr�discard_buffersszasync_chat.discard_buffers)NN)�__name__�
__module__�__qualname__�__doc__r)r;r r"rrrrrr&r'r2r4r6r>r?rArCrDr3rJrrrrr4s,
H(rc@seZdZddd�Zdd�ZdS)�simple_producer�cCs||_||_dSr)r�buffer_size)rrrQrrrrszsimple_producer.__init__cCsJt|j�|jkr6|jd|j�}|j|jd�|_|S|j}d|_|SdSr)r-rrQ)r�resultrrrrEszsimple_producer.moreN)rP)rKrLrMrrErrrrrOs
rOcCs0t|�d}|r,|�|d|��s,|d8}q|S)Nr@)r-�endswith)ZhaystackZneedle�lrrrr//s
r/)rNr	�collectionsrr
rrOr/rrrr�<module>s\ aifc.cpython-38.opt-2.pyc000064400000047455151450073350011060 0ustar00U

e5d.��
@s>ddlZddlZddlZdddgZGdd�de�ZdZdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd lmZdd!lmZed"d#�Zd$ej_d%ej_d&ej_d'ej_d(ej_d)ej_Gd*d+�d+�Z Gd,d-�d-�Z!d@d.d�Z"dAd/d�Z#e$d0k�r:ddl%Z%e%j&d1d��sJe%j&�'d2�e%j&d1Z(e"e(d3���Z)e*d4e(�e*d5e)�+��e*d6e)�,��e*d7e)�-��e*d8e)�.��e*d9e)�/��e*d:e)�0��e%j&d;d��r0e%j&d;Z1e*d<e1�e"e1d=��6Z2e2�3e)�4��e)�5d>�Z6e6�s�qe2�7e6��q�W5QRXe*d?�W5QRXdS)B�N�Error�open�openfpc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/aifc.pyr�sl@QEcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>l�r��structZunpack�read�error�EOFError��filerrr	�
_read_long�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Lrrrrrrr	�_read_ulong�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>h�rrrrrr	�_read_short�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Hrrrrrrr	�_read_ushort�srcCs@t|�d��}|dkrd}n
|�|�}|d@dkr<|�d�}|S)N�r�)�ordr)r�length�data�dummyrrr	�_read_string�s

r!g�����cCs�t|�}d}|dkr d}|d}t|�}t|�}||krN|krNdkrXnnd}n0|dkrft}n"|d}|d|td	|d
�}||S)Nrr�����g�i�?lg@�?)rr�	_HUGE_VAL�pow)�f�expon�sign�himant�lomantrrr	�_read_float�s"r-cCs|�t�d|��dS)Nr��writer
�pack�r(�xrrr	�_write_short�sr3cCs|�t�d|��dS)Nrr.r1rrr	�
_write_ushort�sr4cCs|�t�d|��dS)Nr
r.r1rrr	�_write_long�sr5cCs|�t�d|��dS)Nrr.r1rrr	�_write_ulong�sr6cCsRt|�dkrtd��|�t�dt|���|�|�t|�d@dkrN|�d�dS)N�z%string exceeds maximum pstring length�Brr�)�len�
ValueErrorr/r
r0)r(�srrr	�
_write_string�s
r=c	Cs�ddl}|dkrd}|d}nd}|dkr8d}d}d}n�|�|�\}}|dks^|dks^||krp|dB}d}d}nh|d}|dkr�|�||�}d}||B}|�|d�}|�|�}t|�}|�||d�}|�|�}t|�}t||�t||�t||�dS)	Nrr#r"i@rr$i�?� )�mathZfrexpZldexpZfloor�intr4r6)	r(r2r?r*r)r+r,ZfmantZfsmantrrr	�_write_float�s8




rA)�Chunk)�
namedtuple�_aifc_paramsz7nchannels sampwidth framerate nframes comptype compnamez3Number of audio channels (1 for mono, 2 for stereo)zSample width in byteszSampling frequencyzNumber of audio framesz(Compression type ("NONE" for AIFF files)zRA human-readable version of the compression type
('not compressed' for AIFF files)c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�ZdS)2�	Aifc_readNcCs8d|_d|_g|_d|_||_t|�}|��dkr:td��|�d�}|dkrTd|_	n|dkrdd|_	ntd��d|_
d|_d|_zt|j�}Wnt
k
r�Y�qYnX|��}|d	kr�|�|�d|_
nH|d
kr�||_|�d�}d|_n(|dkr�t|�|_n|d
k�r|�|�|��qx|j
�r,|j�s4td��dS)Nr�FORMz file does not start with FORM idr�AIFF�AIFCrznot an AIFF or AIFF-C file�COMM�SSND��FVER�MARKz$COMM chunk and/or SSND chunk missing)�_version�_convert�_markers�	_soundpos�_filerBZgetnamerr�_aifcZ_comm_chunk_read�_ssnd_chunk�_ssnd_seek_neededr�_read_comm_chunkr�	_readmark�skip)�selfr�chunkZformdataZ	chunknamer rrr	�initfp4sH





zAifc_read.initfpcCsLt|t�r>t�|d�}z|�|�WqH|���YqHXn
|�|�dS)N�rb)�
isinstance�str�builtinsrr[�close�rYr(Zfile_objectrrr	�__init__\s

zAifc_read.__init__cCs|S�Nr�rYrrr	�	__enter__hszAifc_read.__enter__cGs|��dSrc�r`�rY�argsrrr	�__exit__kszAifc_read.__exit__cCs|jSrc)rRrdrrr	�getfpqszAifc_read.getfpcCsd|_d|_dS)Nrr)rUrQrdrrr	�rewindtszAifc_read.rewindcCs |j}|dk	rd|_|��dSrc)rRr`�rYrrrr	r`xszAifc_read.closecCs|jSrc)rQrdrrr	�tell~szAifc_read.tellcCs|jSrc)�
_nchannelsrdrrr	�getnchannels�szAifc_read.getnchannelscCs|jSrc)�_nframesrdrrr	�
getnframes�szAifc_read.getnframescCs|jSrc)�
_sampwidthrdrrr	�getsampwidth�szAifc_read.getsampwidthcCs|jSrc)�
_frameraterdrrr	�getframerate�szAifc_read.getframeratecCs|jSrc��	_comptyperdrrr	�getcomptype�szAifc_read.getcomptypecCs|jSrc��	_compnamerdrrr	�getcompname�szAifc_read.getcompnamecCs*t|��|��|��|��|��|���Src)rDrorsrurqrxr{rdrrr	�	getparams�s�zAifc_read.getparamscCst|j�dkrdS|jS�Nr�r:rPrdrrr	�
getmarkers�szAifc_read.getmarkerscCs2|jD]}||dkr|Sqtd�|���dS�Nrzmarker {0!r} does not exist�rPr�format�rY�id�markerrrr	�getmark�s

zAifc_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)rprrQrU)rY�posrrr	�setpos�szAifc_read.setposcCs�|jrD|j�d�|j�d�}|j|j}|r>|j�|d�d|_|dkrPdS|j�||j�}|jrv|rv|�|�}|jt|�|j|j	|_|S)NrrKr)
rUrT�seekrrQ�
_framesizerOr:rnrr)rY�nframesr r�rrrr	�
readframes�s 

�
zAifc_read.readframescCsddl}|�|d�S�Nrr)�audioopZalaw2lin�rYrr�rrr	�	_alaw2lin�szAifc_read._alaw2lincCsddl}|�|d�Sr�)r�Zulaw2linr�rrr	�	_ulaw2lin�szAifc_read._ulaw2lincCs2ddl}t|d�sd|_|�|d|j�\}|_|S�Nr�_adpcmstater)r��hasattrr�Z	adpcm2linr�rrr	�
_adpcm2lin�s

zAifc_read._adpcm2lincCsVt|�|_t|�|_t|�dd|_tt|��|_|jdkrFtd��|jdkrXtd��|j|j|_	|j
�rFd}|jdkr�d}t�
d�d	|_|�d
�|_|r�t|j�d��}|d@dkr�|d}|j||_|j�dd�t|�|_|jdk�rR|jd
k�r
|j|_n4|jdk�r |j|_n|jdk�r6|j|_ntd��d|_nd|_d|_dS)N�rKr�bad sample width�bad # of channels�rzWarning: bad COMM chunk size�rr"�NONE�G722��ulaw�ULAW��alaw�ALAW�unsupported compression typer�not compressed)rrnrrprrr@r-rtrr�rSZ	chunksize�warnings�warnrrwrrr�r!rzr�rOr�r�)rYrZZkludgerrrr	rV�sD









zAifc_read._read_comm_chunkcCs�t|�}zDt|�D]6}t|�}t|�}t|�}|s6|r|j�|||f�qWnDtk
r�dt|j�t|j�dkrxdnd|f}t�	|�YnXdS)Nz;Warning: MARK chunk contains only %s marker%s instead of %sr�r<)
r�rangerr!rP�appendrr:r�r�)rYrZZnmarkers�ir�r��name�wrrr	rW�s��zAifc_read._readmark)rrrrRr[rbrerirjrkr`rmrorqrsrurxr{r|rr�r�r�r�r�r�rVrWrrrr	rEs2$(*rEc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dS)J�
Aifc_writeNcCs\t|t�rNt�|d�}z|�|�Wn|���YnX|�d�rXd|_n
|�|�dS)N�wbz.aiffr)r]r^r_rr[r`�endswithrSrarrr	rb/s

zAifc_write.__init__cCs^||_t|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_g|_
d|_d|_dS)Nr�r�rr)rR�
_AIFC_versionrNrwrzrOrnrrrtrp�_nframeswritten�_datawritten�_datalengthrP�_marklengthrSrlrrr	r[?szAifc_write.initfpcCs|��dSrcrfrdrrr	�__del__PszAifc_write.__del__cCs|Srcrrdrrr	reSszAifc_write.__enter__cGs|��dSrcrfrgrrr	riVszAifc_write.__exit__cCs|jrtd��d|_dS)N�0cannot change parameters after starting to writer�r�rrSrdrrr	�aiff\szAifc_write.aiffcCs|jrtd��d|_dS)Nr�rr�rdrrr	�aifcaszAifc_write.aifccCs(|jrtd��|dkrtd��||_dS)Nr�rr�)r�rrn)rY�	nchannelsrrr	�setnchannelsfs
zAifc_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rnrrdrrr	romszAifc_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nr�rrr�)r�rrr)rY�	sampwidthrrr	�setsampwidthrs
zAifc_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)rrrrdrrr	rsyszAifc_write.getsampwidthcCs(|jrtd��|dkrtd��||_dS)Nr�rzbad frame rate)r�rrt)rY�	frameraterrr	�setframerate~s
zAifc_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rtrrdrrr	ru�szAifc_write.getframeratecCs|jrtd��||_dS)Nr�)r�rrp)rYr�rrr	�
setnframes�szAifc_write.setnframescCs|jSrc�r�rdrrr	rq�szAifc_write.getnframescCs.|jrtd��|dkrtd��||_||_dS�Nr�)r�r�r�r�r�r�r�)r�rrwrz)rY�comptype�compnamerrr	�setcomptype�szAifc_write.setcomptypecCs|jSrcrvrdrrr	rx�szAifc_write.getcomptypecCs|jSrcryrdrrr	r{�szAifc_write.getcompnamecCsf|\}}}}}}|jrtd��|dkr.td��|�|�|�|�|�|�|�|�|�||�dSr�)r�rr�r�r�r�r�)rYZparamsr�r�r�r�r�r�rrr	�	setparams�s



zAifc_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)rnrrrtrrDrprwrzrdrrr	r|�s�zAifc_write.getparamscCs�|dkrtd��|dkr td��t|t�s2td��tt|j��D],}||j|dkr@|||f|j|<dSq@|j�|||f�dS)Nrzmarker ID must be > 0zmarker position must be >= 0zmarker name must be bytes)rr]�bytesr�r:rPr�)rYr�r�r�r�rrr	�setmark�s
zAifc_write.setmarkcCs2|jD]}||dkr|Sqtd�|���dSr�r�r�rrr	r��s

zAifc_write.getmarkcCst|j�dkrdS|jSr}r~rdrrr	r�szAifc_write.getmarkerscCs|jSrcr�rdrrr	rm�szAifc_write.tellcCszt|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|j
�|�|j||_|j
t|�|_
dS)Nr8)r]r��	bytearray�
memoryview�cast�_ensure_header_writtenr:rrrnrOrRr/r�r�)rYrr�rrr	�writeframesraw�s
zAifc_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSrc)r�r�rpr�r��_patchheader)rYrrrr	�writeframes�s


�zAifc_write.writeframescCs�|jdkrdSz^|�d�|jd@r<|j�d�|jd|_|��|j|jksb|j	|jksb|j
rj|��W5d|_|j}d|_|��XdS)Nrrr9)rRrOr`r�r�r/�
_writemarkersr�rpr�r�r�)rYr(rrr	r`�s$



��zAifc_write.closecCsddl}|�|d�Sr�)r�Zlin2alawr�rrr	�	_lin2alaw�szAifc_write._lin2alawcCsddl}|�|d�Sr�)r�Zlin2ulawr�rrr	�	_lin2ulawszAifc_write._lin2ulawcCs2ddl}t|d�sd|_|�|d|j�\}|_|Sr�)r�r�r�Z	lin2adpcmr�rrr	�
_lin2adpcms

zAifc_write._lin2adpcmcCsf|jsb|jdkr.|jsd|_|jdkr.td��|js<td��|jsJtd��|jsXtd��|�|�dS)N�r�r�r�r�r�rzRsample width must be 2 when compressing with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)z# channels not specifiedzsample width not specifiedzsampling rate not specified)r�rwrrrrnrt�
_write_header)rYZdatasizerrr	r�
s

z!Aifc_write._ensure_header_writtencCs>|jdkr|j|_n&|jdkr(|j|_n|jdkr:|j|_dS)Nr�r�r�)rwr�rOr�r�rdrrr	�_init_compressions




zAifc_write._init_compressionc	CsJ|jr|jdkr|��|j�d�|js<||j|j|_|j|j|j|_|jd@rf|jd|_|jr�|jdkr�|jd|_|jd@r�|jd|_n0|jdkr�|jdd|_|jd@r�|jd|_z|j�	�|_
Wnttfk
r�d|_
YnX|�
|j�}|j�rB|j�d	�|j�d
�t|jd�t|j|j�n|j�d�|j�d�t|j|�t|j|j�|j
dk	�r�|j�	�|_t|j|j�|jd
k�r�t|jd�nt|j|jd�t|j|j�|j�r�|j�|j�t|j|j�|j�d�|j
dk	�r|j�	�|_t|j|jd�t|jd�t|jd�dS)Nr�rFr)r�r�r�r�rr��rrHrLrGrIr�rKrJr)rSrwr�rRr/rprnrrr�rm�_form_length_pos�AttributeError�OSError�_write_form_lengthr6rNr3�_nframes_posrArtr=rz�_ssnd_length_pos)rYZ
initlength�
commlengthrrr	r�%s^




zAifc_write._write_headercCs\|jr*dt|j�}|d@r$|d}d}nd}d}t|jd||jd|d|�|S)	Nr�r�r�rrrK�)rSr:rzr6rRr�)rY�
datalengthr�Z
verslengthrrr	r�Xs"����zAifc_write._write_form_lengthcCs�|j��}|jd@r,|jd}|j�d�n|j}||jkrd|j|jkrd|jdkrd|j�|d�dS|j�|j	d�|�
|�}|j�|jd�t|j|j�|j�|j
d�t|j|d�|j�|d�|j|_||_dS)Nrr9rrK)rRrmr�r/r�rpr�r�r�r�r�r�r6r�)rYZcurposr�r rrr	r�es*




��
zAifc_write._patchheadercCs�t|j�dkrdS|j�d�d}|jD]:}|\}}}|t|�dd}t|�d@dkr(|d}q(t|j|�|d|_t|jt|j��|jD]2}|\}}}t|j|�t|j|�t|j|�q�dS)NrrMrr�rK)r:rPrRr/r6r�r3r=)rYrr�r�r�r�rrr	r�{s"





zAifc_write._writemarkers)(rrrrRrbr[r�rerir�r�r�ror�rsr�rur�rqr�rxr{r�r|r�r�rrmr�r�r`r�r�r�r�r�r�r�r�r�rrrr	r�sJ	

3
r�cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder\)�rr\)r�r�z$mode must be 'r', 'rb', 'w', or 'wb')r�r�rEr�r�r(r�rrr	r�s
cCstjdtdd�t||d�S)NzBaifc.openfp is deprecated since Python 3.7. Use aifc.open instead.r)�
stacklevel)r�)r�r��DeprecationWarningrr�rrr	r�s
��__main__rz/usr/demos/data/audio/bach.aiffr�ZReadingznchannels =znframes   =zsampwidth =zframerate =zcomptype  =zcompname  =rZWritingr�izDone.)N)N)8r
r_r��__all__�	Exceptionrr�rrrrr!r&r-r3r4r5r6r=rArZrB�collectionsrCrDr��__doc__r�r�r�r�r�rEr�rrr�sys�argvr��fnr(�printrorqrsrurxr{Zgn�gr�r|r�rr�rrrr	�<module>�sz

!�







filecmp.cpython-38.opt-2.pyc000064400000013600151450073350011556 0ustar00U

e5df&�@s�ddlZddlZddlmZdddddgZiZdZd	d
ddd
dddgZdd�Zd!dd�Z	dd�Z
dd�ZGdd�d�Zd"dd�Z
ee	fdd�Zdd�Zdd�Zed kr�e�dS)#�N)�filterfalse�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCst��dS�N)�_cache�clear�rr�/usr/lib64/python3.8/filecmp.pyrsTcCs�tt�|��}tt�|��}|dtjks8|dtjkr<dS|rL||krLdS|d|dkr`dSt�||||f�}|dkr�t||�}tt�dkr�t�|t||||f<|S)NrFT��d)	�_sig�os�stat�S_IFREGr
�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomerrr
rs
cCst�|j�|j|jfSr	)r�S_IFMT�st_mode�st_size�st_mtime)�strrr
rDs
�rc
Cs�t}t|d��n}t|d��X}|�|�}|�|�}||krPW5QR�W5QR�dS|sW5QR�W5QR�dSqW5QRXW5QRXdS)N�rbFT)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2rrr
rIs

rc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Ze
eeeeeeeeeeeed�Zdd�ZdS)rNcCsD||_||_|dkr$tjtjg|_n||_|dkr:t|_n||_dSr	)�left�rightr�curdir�pardir�hider�ignore)�self�a�br-r,rrr
�__init__xszdircmp.__init__cCsPtt�|j�|j|j�|_tt�|j�|j|j�|_|j�	�|j�	�dSr	)
�_filterr�listdirr(r,r-�	left_listr)�
right_list�sort�r.rrr
�phase0�s
�
�
z
dircmp.phase0cCs�ttttjj|j�|j��}ttttjj|j�|j��}tt|j	t
|j|���|_tt|j	t
|j|���|_tt|j	t
|j|���|_dSr	)�dict�zip�mapr�path�normcaser4r5�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r.r/r0rrr
�phase1�s
z
dircmp.phase1c
Cs4g|_g|_g|_|jD�]}tj�|j|�}tj�|j|�}d}zt�	|�}Wn&t
k
rv}zd}W5d}~XYnXzt�	|�}Wn&t
k
r�}zd}W5d}~XYnX|�r"t	�|j�}t	�|j�}	||	kr�|j�
|�n>t	�|�r�|j�
|�n&t	�|��r|j�
|�n|j�
|�q|j�
|�qdS)Nrr)�common_dirs�common_files�common_funnyrBrr<�joinr(r)r�OSErrorrr�append�S_ISDIR�S_ISREG)
r.�xZa_pathZb_path�okZa_statZwhyZb_statZa_typeZb_typerrr
�phase2�s4
z
dircmp.phase2cCs&t|j|j|j�}|\|_|_|_dSr	)rr(r)rG�
same_files�
diff_files�funny_files)r.Zxxrrr
�phase3�sz
dircmp.phase3cCsNi|_|jD]<}tj�|j|�}tj�|j|�}t|||j|j	�|j|<qdSr	)
�subdirsrFrr<rIr(r)rr-r,)r.rNZa_xZb_xrrr
�phase4�s

z
dircmp.phase4cCs$|��|j��D]}|��qdSr	)rVrU�values�phase4_closure�r.Zsdrrr
rX�szdircmp.phase4_closurecCs�td|j|j�|jr2|j��td|jd|j�|jrT|j��td|jd|j�|jrp|j��td|j�|jr�|j��td|j�|jr�|j��td|j�|j	r�|j	��td|j	�|j
r�|j
��td|j
�dS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr(r)rCr6rDrQrRrSrFrHr7rrr
�report�s,






z
dircmp.reportcCs*|��|j��D]}t�|��qdSr	)r\rUrWr[rYrrr
�report_partial_closure�szdircmp.report_partial_closurecCs*|��|j��D]}t�|��qdSr	)r\rUrWr[�report_full_closurerYrrr
r^�szdircmp.report_full_closure)rUrQrRrSrFrGrHrBrCrDr4r5cCs*||jkrt|��|j||�t||�Sr	)�	methodmap�AttributeError�getattr)r.�attrrrr
�__getattr__�s
zdircmp.__getattr__)NN)�__name__�
__module__�__qualname__r1r8rErPrTrVrXr\r]r^r9r_rcrrrr
rVs0"
#
�cCsJgggf}|D]6}tj�||�}tj�||�}|t|||��|�q|Sr	)rr<rI�_cmprK)r/r0rBr�resrNZaxZbxrrr
r�s
cCs0z|||||��WStk
r*YdSXdS)N�)rJ)r/r0Zsh�absrrrr
rgsrgcCstt|j|��Sr	)r>rrA)Zflist�skiprrr
r2sr2cCsrddl}ddl}|�|jdd�d�\}}t|�dkrB|�dd��t|d|d�}d|krf|��n|��dS)Nrr�rrizneed exactly two args)z-r�)�sys�getopt�argvrZGetoptErrorrr^r\)rnroZoptions�argsZddrrr
�demo$s
rr�__main__)T)T)rr�	itertoolsr�__all__r
r"rrrrrrrrjrgr2rrrdrrrr
�<module>
s4�
'
%
	fnmatch.cpython-38.opt-1.pyc000064400000006435151450073350011566 0ustar00U

e5d��@sjdZddlZddlZddlZddlZddddgZdd�Zejdd	d
�dd��Zd
d�Z	dd�Z
dd�ZdS)a�Filename matching with shell patterns.

fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.

The functions operate by translating the pattern into a regular
expression.  They cache the compiled regular expressions for speed.

The function translate(PATTERN) returns a regular expression
corresponding to PATTERN.  (It does not compile it.)
�N�filter�fnmatch�fnmatchcase�	translatecCs"tj�|�}tj�|�}t||�S)a�Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).
    )�os�path�normcaser)�name�pat�r�/usr/lib64/python3.8/fnmatch.pyrs�T)�maxsize�typedcCs<t|t�r(t|d�}t|�}t|d�}nt|�}t�|�jS)Nz
ISO-8859-1)�
isinstance�bytes�strr�re�compile�match)r
Zpat_strZres_str�resrrr�_compile_pattern&s

rcCshg}tj�|�}t|�}tjtkr@|D]}||�r&|�|�q&n$|D]}|tj�|��rD|�|�qD|S)zJConstruct a list from those elements of the iterable NAMES that match PAT.)rrrr�	posixpath�append)�namesr
�resultrr	rrrr0s
cCst|�}||�dk	S)z�Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    N)r)r	r
rrrrr@sc	Cs�dt|�}}d}||k�r�||}|d}|dkr>|d}q|dkrP|d}q|dk�r�|}||krz||d	krz|d}||kr�||d
kr�|d}||kr�||d
kr�|d}q�||kr�|d}�q�|||�}d|kr�|�d
d�}n�g}||d	k�r|dn|d}|�d||�}|dk�r(�qN|�|||��|d}|d}�q|�|||��d�dd�|D��}t�dd|�}|d}|dd	k�r�d|dd�}n|ddk�r�d
|}d||f}q|t�|�}qd|S)zfTranslate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    r���*z.*�?�.�[�!�]z\[z--�\�\\��-�css"|]}|�dd��dd�VqdS)r$r%r'z\-N)�replace)�.0�srrr�	<genexpr>ts�ztranslate.<locals>.<genexpr>z([&~|])z\\\1�^N)r-r!z%s[%s]z	(?s:%s)\Z)�lenr)�findr�joinr�sub�escape)	r
�i�nr�c�jZstuffZchunks�krrrrJsV






�)�__doc__rrr�	functools�__all__r�	lru_cacherrrrrrrr�<module>s
	
heapq.cpython-38.opt-1.pyc000064400000033370151450073350011242 0ustar00U

e5d]Y�@sZdZdZdddddddd	gZd
d�Zdd�Zdd�Zd
d	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zddd�d d�Zd)d!d�Zd*d"d�Zzd#d$lTWnek
r�YnXzd#d%lm	Z	Wnek
r�YnXzd#d&lm
Z
Wnek
�rYnXzd#d'lmZWnek
�r6YnXed(k�rVd#dlZee���dS)+a�Heap queue algorithm (a.k.a. priority queue).

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

Usage:

heap = []            # creates an empty heap
heappush(heap, item) # pushes a new item on the heap
item = heappop(heap) # pops the smallest item from the heap
item = heap[0]       # smallest item on the heap without popping it
heapify(x)           # transforms list into a heap, in-place, in linear time
item = heapreplace(heap, item) # pops and returns smallest item, and adds
                               # new item; the heap size is unchanged

Our API differs from textbook heap algorithms as follows:

- We use 0-based indexing.  This makes the relationship between the
  index for a node and the indexes for its children slightly less
  obvious, but is more suitable since Python uses 0-based indexing.

- Our heappop() method returns the smallest item, not the largest.

These two make it possible to view the heap as a regular Python list
without surprises: heap[0] is the smallest item, and heap.sort()
maintains the heap invariant!
uoHeap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
�heappush�heappop�heapify�heapreplace�merge�nlargest�	nsmallest�heappushpopcCs"|�|�t|dt|�d�dS)z4Push item onto heap, maintaining the heap invariant.��N)�append�	_siftdown�len��heap�item�r�/usr/lib64/python3.8/heapq.pyr�s
cCs.|��}|r*|d}||d<t|d�|S|S)zCPop the smallest item off the heap, maintaining the heap invariant.r	)�pop�_siftup�rZlastelt�
returnitemrrrr�s
cCs|d}||d<t|d�|S)a�Pop and return the current smallest value, and add the new item.

    This is more efficient than heappop() followed by heappush(), and can be
    more appropriate when using a fixed-size heap.  Note that the value
    returned may be larger than item!  That constrains reasonable uses of
    this routine unless written as part of a conditional replacement:

        if item > heap[0]:
            item = heapreplace(heap, item)
    r	�r�rrrrrrr�s
cCs0|r,|d|kr,|d|}|d<t|d�|S)z1Fast version of a heappush followed by a heappop.r	rrrrrr�s
cCs,t|�}tt|d��D]}t||�qdS)z8Transform list into a heap, in-place, in O(len(x)) time.�N)r
�reversed�ranger��x�n�irrrr�scCs.|��}|r*|d}||d<t|d�|S|S)zMaxheap version of a heappop.r	)r�_siftup_maxrrrr�_heappop_max�s
r!cCs|d}||d<t|d�|S)z4Maxheap version of a heappop followed by a heappush.r	)r rrrr�_heapreplace_max�s
r"cCs,t|�}tt|d��D]}t||�qdS)z;Transform list into a maxheap, in-place, in O(len(x)) time.rN)r
rrr rrrr�_heapify_max�sr#cCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)Nr
r�r�startpos�pos�newitem�	parentpos�parentrrrr�srcCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)Nrr
)r
r�rr&�endposr%r'�childpos�rightposrrrrsrcCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)zMaxheap variant of _siftdownr
Nrr$rrr�
_siftdown_maxsr.cCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)zMaxheap variant of _siftuprr
N)r
r.r*rrrr %sr NF��key�reversec	gsg}|j}|r t}t}t}d}nt}t}t}d}|dk�rttt	|��D]<\}	}
z|
j
}||�|	||g�WqHtk
r�YqHXqH||�t|�dkr�z2|d\}}	}}
|V|�|
d<|||
�q�Wq�tk
r�||�Yq�Xq�|�r|d\}}	}|V|j
EdHdSttt	|��D]J\}	}
z(|
j
}|�}|||�|	|||g�Wntk
�rjYnX�q$||�t|�dk�r�zF|d\}}	}}}
|V|�}||�|
d<||
d<|||
��q�Wntk
�r�||�YnX�qx|�r|d\}}	}}|V|j
EdHdS)akMerge multiple sorted inputs into a single sorted output.

    Similar to sorted(itertools.chain(*iterables)) but returns a generator,
    does not pull the data into memory all at once, and assumes that each of
    the input streams is already sorted (smallest to largest).

    >>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
    [0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]

    If *key* is not None, applies a key function to each element to determine
    its sort order.

    >>> list(merge(['dog', 'horse'], ['cat', 'fish', 'kangaroo'], key=len))
    ['dog', 'cat', 'fish', 'horse', 'kangaroo']

    ���r
Nr	r)rr#r!r"rrr�	enumerate�map�iter�__next__�
StopIterationr
�__self__)r0r1�	iterables�h�h_append�_heapify�_heappop�_heapreplace�	direction�order�it�next�value�s�	key_valuerrrr:sl


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYnX||krxt|�d�d|�S�dk�rt|�}dd�tt|�|�D�}|s�|St	|�|dd}|}t
}	|D].}
|
|kr�|	||
|f�|d\}}|d7}q�|��dd�|D�St|�}�fd	d�tt|�|�D�}|�s>|St	|�|dd}|}t
}	|D]>}
�|
�}||k�r^|	||||
f�|d\}}}
|d7}�q^|��d
d�|D�S)zbFind the n smallest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key)[:n]
    r
��defaultr0�r0NcSsg|]\}}||f�qSrr��.0r�elemrrr�
<listcomp>�sznsmallest.<locals>.<listcomp>r	cSsg|]\}}|�qSrr�rJrKr@rrrrL�scsg|]\}}�|�||f�qSrrrIrHrrrL�scSsg|]\}}}|�qSrr�rJ�kr@rKrrrrLs)r5�object�minr
�	TypeError�AttributeError�sorted�ziprr#r"�sort�r�iterabler0rA�sentinel�result�size�topr@r>rK�_orderrO�_elemrrHrr�sV


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYn X||krzt|�dd�d|�S�dk�rt|�}dd�ttd|d	�|�D�}|s�|St	|�|dd}|}t
}	|D].}
||
kr�|	||
|f�|d\}}|d8}q�|jdd
�dd�|D�St|�}�fdd�ttd|d	�|�D�}|�sR|St	|�|dd}|}t
}	|D]>}
�|
�}||k�rt|	||||
f�|d\}}}
|d8}�qt|jdd
�d
d�|D�S)zoFind the n largest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
    r
rFTr/NcSsg|]\}}||f�qSrrrIrrrrL"sznlargest.<locals>.<listcomp>r	r2)r1cSsg|]\}}|�qSrrrMrrrrL/scsg|]\}}�|�||f�qSrrrIrHrrrL3scSsg|]\}}}|�qSrrrNrrrrLAs)r5rP�maxr
rRrSrTrUrrrrVrWrrHrr	sV

"
r	)�*)r")r#)r!�__main__)N)N)�__doc__�	__about__�__all__rrrrrr!r"r#rrr.r rrr�_heapq�ImportError�__name__Zdoctest�printZtestmodrrrr�<module>sR ^
�

	5
<
;
tokenize.cpython-38.pyc000064400000041412151450073350011031 0ustar00U

e5d�d�@sHdZdZdZddlmZddlmZmZddl	Z	ddl
mZddlZ
ddlZddlZddlTdd	lmZe�d
ej�Ze�dej�ZddlZejdd
dddgZ[Gdd�de	�dd��Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZ dZ!dZ"d Z#ee e!e"e#�Z$d!Z%ed"d#�ee%�Z&d$e%Z'ee&e'�Z(ed%e(d&�Z)ee)e(e$�Z*d'd(�Z+d)d*�Z,ee+��Z-d+Z.d,Z/d-Z0d.Z1ee-d/e-d0�Z2ee-d1e-d2�Z3ee4ej5e6ed3d4���Z7ed5e7�Z8ee*e8e3e�Z9ee9Z:ee-d6ed7d�e-d8ed9d��Z;ed:ee2�Z<eee<e*e8e;e�Z=iZ>e+�D]6Z?e.e>e?d7<e/e>e?d9<e0e>e?d/<e1e>e?d0<�q,e@�ZAe@�ZBe+�D]JZCeCd9eCd7fD]ZDeA�EeD��q�eCd0eCd/fD]ZDeB�EeD��q��qvd;ZFGd<d=�d=eG�ZHGd>d?�d?eG�ZIGd@dA�dA�ZJdBd�ZKdCdD�ZLdEd�ZMdFdG�ZdHd�ZNdIdJ�ZOdKd
�ZPdLdM�ZQeRdNk�rDeQ�dS)OaoTokenization help for Python programs.

tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens.  It decodes the bytes according to PEP-0263 for
determining source file encoding.

It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF).  It generates 5-tuples with these
members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators.  Additionally, all token lists start with an ENCODING token
which tells you which encoding was used to decode the bytes stream.
zKa-Ping Yee <ping@lfw.org>zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foord�)�open)�lookup�BOM_UTF8N)�
TextIOWrapper)�*)�EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)�tokenize�generate_tokens�detect_encoding�
untokenize�	TokenInfoc@s eZdZdd�Zedd��ZdS)rcCs$d|jt|jf}d|j|d�S)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))�type)r
�tok_name�_replace)�self�annotated_type�r� /usr/lib64/python3.8/tokenize.py�__repr__.s
�zTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdS�N)r
�OP�stringr�rrrr�
exact_type3s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr-sztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group:�r$cGst|�dS)Nr�r$r"rrr�any;r%r'cGst|�dS)N�?r&r"rrr�maybe<r%r)z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]cCs^ddddddg}dh}|D]>}t�|�D].}tjdd	�|D��D]}|�d�|��q@q(q|S)
N�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>^sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr,rrr�_all_string_prefixesSsr=cCst�|tj�Sr)�re�compile�UNICODE)�exprrrr�_compilebsrBz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)�reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"z
\\\r?\n|\Z�c@seZdZdS)�
TokenErrorN�rrrrrrrrG�srGc@seZdZdS)�StopTokenizingNrHrrrrrI�srIc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__init__�szUntokenizer.__init__cCs�|\}}||jks&||jkr>||jkr>td�|||j|j���||j}|rb|j�d|�d|_||j}|r�|j�d|�dS)Nz+start ({},{}) precedes previous end ({},{})�\
r� )rMrN�
ValueError�formatrL�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

zUntokenizer.add_whitespacecCs6t|�}g}d}|D�]}t|�dkr8|�||��q*|\}}}}	}
|tkrV||_q|tkrd�q*|tkrz|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fkr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fkr|j
d7_
d|_qd�|j�S)NF�T���rKrr0)�iter�len�compat�ENCODINGrO�	ENDMARKER�INDENTrU�DEDENT�poprMrN�NEWLINE�NLrLr[r!)r�iterable�it�indents�	startliner<�tok_type�tokenrV�end�line�indentrrrr�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfk}d}t�|g|�D]�}|dd�\}}	|tkrR|	|_q.|tt	fkrf|	d7}	|t
kr�|rzd|	}	d}nd}|tkr�|�|	�q.n>|tkr�|�
�q.n*|ttfkr�d}n|r�|r�||d�d}||	�q.dS)NrFr\rRTr])rLrUrfrgr5�chainrarO�NAME�NUMBER�STRINGrcrdre)
rrmrhrj�toks_appendrk�
prevstring�tok�toknum�tokvalrrrr`�s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJ�s
%rJcCs*t�}|�|�}|jdk	r&|�|j�}|S)aTransform tokens back into Python source code.
    It returns a bytes object, encoded using the ENCODING
    token, which is the first token sequence output by tokenize.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output bytes will tokenize back to the input
        t1 = [tok[:2] for tok in tokenize(f.readline)]
        newcode = untokenize(t1)
        readline = BytesIO(newcode).readline
        t2 = [tok[:2] for tok in tokenize(readline)]
        assert t1 == t2
    N)rJrrO�encode)rh�ut�outrrrrs


cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N��_�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r�)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_names�r�cs�z�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|�t�rpd�|d	d�}d
}|s||gfS||�}|r�||gfSt�|�s�||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.
    NFr�cs$z��WStk
rYdSXdS)Nr%)�
StopIterationr��readlinerr�read_or_stop?sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn4tk
rBd}�dk	r6d�|��}t|��YnXt�|�}|sVdSt|�d��}zt|�}Wn:t	k
r��dkr�d|}nd��|�}t|��YnX�r�|dkr؈dkr�d}n
d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrT�SyntaxError�	cookie_re�matchr�r$r�LookupError)ro�line_string�msgr�rO�codec)�	bom_found�filenamerr�find_cookieEs8

�
z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rO�defaultr�r��first�secondr)r�r�r�rr
's8
&




cCsXt|d�}z2t|j�\}}|�d�t||dd�}d|_|WS|���YnXdS)zXOpen a file in read only mode using the encoding detected by
    detect_encoding().
    �rbrT)�line_bufferingr+N)�
_builtin_openr
r��seekr�mode�close)r��bufferrO�lines�textrrrr�s

rcCs6t|�\}}t�d�}t�|t|d�|�}t|j|�S)a�
    The tokenize() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects.  Each call to the function
    should return one line of input as bytes.  Alternatively, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile, 'rb').__next__  # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found.  The line passed is the
    physical line.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    r%)r
r5�repeatrqr^�	_tokenize�__next__)r�rO�consumed�empty�rl_genrrrr�s
ccs|d}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|ddd�Vd}
d}z|}
|�}Wntk
rvd}YnX|dk	r�|�|�}|d	7}dt|�}}
|�rp|s�td
|��|�|�}|�r|�d�}}tt||d|�|||f||�Vd\}}d}nf|�rZ|dd�dk�rZ|d
d�dk�rZtt	||||t|�f|�Vd}d}qPn||}||}qP�n�|dk�r|�s|�s��q�d}||
k�r�||dk�r�|d	7}n8||dk�r�|t
d	t
}n||dk�r�d}n�q�|d	7}�q�||
k�r�q�||dk�r�||dk�r^||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqP||	dk�r�|	�|�tt|d|�|df||f|�V||	dk�r.||	k�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�n|�s*td|df��d}||
krPtt��||�}|�r�|�d	�\}}||f||f|}}}||k�r��q.|||�||}}||k�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dk�r|dk�r�tt
||||�Vntt||||�V�q�|dk�rB|�d��r,t�tt||||�V�q�|tk�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}qP�q�|tk�s�|dd�tk�s�|dd�tk�rV|ddk�rB||f}tt�|��p$t�|d	��p$t�|d��}||d�d	}}|}qPntt||||�Vnf|���rttt||||�VnH|dk�r�d	}n8|dk�r�|d	7}n|d k�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q.qP|
�r0|
ddk�r0ttd|d	t|
�f|d	t|
�d	fd�V|	d	d�D] }ttd|df|dfd�V�q<tt d|df|dfd�VdS)!Nr�
0123456789)r0rr�r�)rrr0r%rKzEOF in multi-line string���rQ���z\
rR�	�z#
�#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...�
r\r��\z([{z)]})!rrar�r�r_rGr�rnrt�
ERRORTOKEN�tabsize�rstrip�COMMENTrgrUrc�IndentationErrorrdrB�PseudoToken�spanrsrf�endswith�AssertionError�
triple_quoted�endpats�
single_quoted�get�isidentifierrrrrb)r�rO�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerj�	last_linero�pos�max�strstart�endprog�endmatchrn�column�
comment_token�pseudomatchrV�spos�eposrm�initialrprrrr��s>




�*

�


�
�
"

� 

���





����






�.r�cCs
t|d�S)z�Tokenize a source reading Python code as unicode strings.

    This has the same API as tokenize(), except that it expects the *readline*
    callable to return str objects instead of bytes.
    N)r�r�rrrr	dsc

s$ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}z�|jr�|j}t|d��}tt|j��}W5QRXnd}t	t
jjd�}|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�W�n8tk
�r6}
z0|
jddd�\}}||
jd|||f�W5d}
~
XYn�tk
�r|}
z(|
jd\}}||
jd|||f�W5d}
~
XYn�tk
�r�}
z||
|�W5d}
~
XYnxtk
�r�}
z||
�W5d}
~
XYnNtk
�r�td�Yn2tk
�r}
z�d|
��W5d}
~
XYnXdS)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorpszmain.<locals>.perrorcsR|r"|f||f}�d|�n"|r8�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srK)r��exit)r�r��location�args�r�rr�errortszmain.<locals>.errorzpython -m tokenize)�progr�r(zfilename.pyz'the file to tokenize; defaults to stdin)�dest�nargs�metavar�helpz-ez--exact�exact�
store_truez(display token names using the exact type)r��actionr�r�z<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrKr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrVrn�printrrr�r�rGr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r-rLrm�
token_type�token_range�errror�rr�r�mainlsT���&&r��__main__)S�__doc__�
__author__�__credits__�builtinsrr��codecsrr�collections�ior�	itertoolsr5r>r�rmrr?�ASCIIr�r��__all__�
namedtuplerr$r'r)�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr=rB�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r<r,r8r�r�rGrIrJrr�r
rr�r	r�rrrrr�<module>s�
�
��

�
���

_]8=
_weakrefset.cpython-38.pyc000064400000016662151450073350011511 0ustar00U

e5dg�@s2ddlmZdgZGdd�d�ZGdd�d�ZdS)���ref�WeakSetc@s$eZdZdd�Zdd�Zdd�ZdS)�_IterationGuardcCst|�|_dS�N)r�
weakcontainer)�selfr�r	�#/usr/lib64/python3.8/_weakrefset.py�__init__sz_IterationGuard.__init__cCs |��}|dk	r|j�|�|Sr)r�
_iterating�add)r�wr	r	r
�	__enter__sz_IterationGuard.__enter__cCs0|��}|dk	r,|j}|�|�|s,|��dSr)rr�remove�_commit_removals)r�e�t�br�sr	r	r
�__exit__s
z_IterationGuard.__exit__N)�__name__�
__module__�__qualname__rrrr	r	r	r
r
src@seZdZd@dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�ZeZd&d'�Zd(d)�Zd*d+�ZeZd,d-�Zd.d/�ZeZd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$e$Z%d<d=�Z&d>d?�Z'dS)ArNcCsBt�|_t|�fdd�}||_g|_t�|_|dk	r>|�|�dS)NcSs2|�}|dk	r.|jr"|j�|�n|j�|�dSr)r�_pending_removals�append�data�discard)�itemZselfrefrr	r	r
�_remove&s
z!WeakSet.__init__.<locals>._remove)�setrrrrr�update)rrrr	r	r
r$szWeakSet.__init__cCs$|j}|jj}|r ||���qdSr)rrr�pop)r�lrr	r	r
r4szWeakSet._commit_removalsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr)rr�rZitemrefrr	r	r
�__iter__:s


zWeakSet.__iter__cCst|j�t|j�Sr)�lenrr�rr	r	r
�__len__CszWeakSet.__len__cCs.zt|�}Wntk
r"YdSX||jkS)NF)r�	TypeErrorr)rrZwrr	r	r
�__contains__Fs
zWeakSet.__contains__cCs|jt|�ft|dd�fS)N�__dict__)�	__class__�list�getattrr'r	r	r
�
__reduce__Ms
�zWeakSet.__reduce__cCs&|jr|��|j�t||j��dSr)rrrr
rr�rrr	r	r
r
QszWeakSet.addcCs|jr|��|j��dSr)rrr�clearr'r	r	r
r1Vsz
WeakSet.clearcCs
|�|�Sr�r,r'r	r	r
�copy[szWeakSet.copycCsT|jr|��z|j��}Wntk
r:td�d�YnX|�}|dk	r|SqdS)Nzpop from empty WeakSet)rrrr"�KeyErrorr$r	r	r
r"^szWeakSet.popcCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
rjszWeakSet.removecCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
roszWeakSet.discardcCs&|jr|��|D]}|�|�qdSr)rrr
)r�otherZelementr	r	r
r!tszWeakSet.updatecCs|�|�|Sr)r!�rr5r	r	r
�__ior__zs
zWeakSet.__ior__cCs|��}|�|�|Sr)r3�difference_update�rr5Znewsetr	r	r
�
difference~s
zWeakSet.differencecCs|�|�dSr)�__isub__r6r	r	r
r8�szWeakSet.difference_updatecCs<|jr|��||kr"|j��n|j�dd�|D��|S)Ncss|]}t|�VqdSrr��.0rr	r	r
�	<genexpr>�sz#WeakSet.__isub__.<locals>.<genexpr>)rrrr1r8r6r	r	r
r;�szWeakSet.__isub__cs���fdd�|D��S)Nc3s|]}|�kr|VqdSrr	r<r'r	r
r>�sz'WeakSet.intersection.<locals>.<genexpr>r2r6r	r'r
�intersection�szWeakSet.intersectioncCs|�|�dSr)�__iand__r6r	r	r
�intersection_update�szWeakSet.intersection_updatecCs(|jr|��|j�dd�|D��|S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.__iand__.<locals>.<genexpr>)rrrrAr6r	r	r
r@�szWeakSet.__iand__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.issubset.<locals>.<genexpr>)r�issubsetr6r	r	r
rB�szWeakSet.issubsetcCs|jttt|��kSr�rr �maprr6r	r	r
�__lt__�szWeakSet.__lt__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz%WeakSet.issuperset.<locals>.<genexpr>)r�
issupersetr6r	r	r
rF�szWeakSet.issupersetcCs|jttt|��kSrrCr6r	r	r
�__gt__�szWeakSet.__gt__cCs$t||j�stS|jttt|��kSr)�
isinstancer,�NotImplementedrr rDrr6r	r	r
�__eq__�szWeakSet.__eq__cCs|��}|�|�|Sr)r3�symmetric_difference_updater9r	r	r
�symmetric_difference�s
zWeakSet.symmetric_differencecCs|�|�dSr)�__ixor__r6r	r	r
rK�sz#WeakSet.symmetric_difference_updatecs@�jr����|kr"�j��n�j��fdd�|D���S)Nc3s|]}t|�j�VqdSr)rrr<r'r	r
r>�sz#WeakSet.__ixor__.<locals>.<genexpr>)rrrr1rKr6r	r'r
rM�szWeakSet.__ixor__cCs|�dd�||fD��S)Ncss|]}|D]
}|Vq
qdSrr	)r=rrr	r	r
r>�sz WeakSet.union.<locals>.<genexpr>r2r6r	r	r
�union�sz
WeakSet.unioncCst|�|��dkS)Nr)r&r?r6r	r	r
�
isdisjoint�szWeakSet.isdisjointcCs
t|j�Sr)�reprrr'r	r	r
�__repr__�szWeakSet.__repr__)N)(rrrrrr%r(r*r/r
r1r3r"rrr!r7r:�__sub__r8r;r?�__and__rAr@rB�__le__rErF�__ge__rGrJrL�__xor__rKrMrN�__or__rOrQr	r	r	r
r#sJ
			N)�_weakrefr�__all__rrr	r	r	r
�<module>stimeit.cpython-38.pyc000064400000027003151450073350010474 0ustar00U

e5d�4�@s�dZddlZddlZddlZddlZddddgZdZdZd	Zej	Z
eZd
Z
dd�ZGd
d�d�Zdde
edfdd�Zdde
eedfdd�Zddd�dd�Zedkr�e�e��dS)a9Tool for measuring execution time of small code snippets.

This module avoids a number of common traps for measuring execution
times.  See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.

Library usage: see the Timer class.

Command line usage:
    python timeit.py [-n N] [-r N] [-s S] [-p] [-h] [--] [statement]

Options:
  -n/--number N: how many times to execute 'statement' (default: see below)
  -r/--repeat N: how many times to repeat the timer (default 5)
  -s/--setup S: statement to be executed once initially (default 'pass').
                Execution time of this setup statement is NOT timed.
  -p/--process: use time.process_time() (default is time.perf_counter())
  -v/--verbose: print raw timing results; repeat for more digits precision
  -u/--unit: set the output time unit (nsec, usec, msec, or sec)
  -h/--help: print this usage message and exit
  --: separate options from statement, use when statement starts with -
  statement: statement to be timed (default 'pass')

A multi-line statement may be given by specifying each line as a
separate argument; indented lines are possible by enclosing an
argument in quotes and using leading spaces.  Multiple -s options are
treated similarly.

If -n is not given, a suitable number of loops is calculated by trying
increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the
total time is at least 0.2 seconds.

Note: there is a certain baseline overhead associated with executing a
pass statement.  It differs between versions.  The code here doesn't try
to hide it, but you should be aware of it.  The baseline overhead can be
measured by invoking the program without arguments.

Classes:

    Timer

Functions:

    timeit(string, string) -> float
    repeat(string, string) -> list
    default_timer() -> float

�N�Timer�timeit�repeat�
default_timerz<timeit-src>i@B�z�
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
cCs|�ddd|�S)z*Helper to reindent a multi-line statement.�
� )�replace)�src�indent�r�/usr/lib64/python3.8/timeit.py�reindentOsrc@sPeZdZdZddedfdd�Zddd�Zefdd	�Ze	efd
d�Z
ddd
�ZdS)ra�Class for timing execution speed of small code snippets.

    The constructor takes a statement to be timed, an additional
    statement used for setup, and a timer function.  Both statements
    default to 'pass'; the timer function is platform-dependent (see
    module doc string).  If 'globals' is specified, the code will be
    executed within that namespace (as opposed to inside timeit's
    namespace).

    To measure the execution time of the first statement, use the
    timeit() method.  The repeat() method is a convenience to call
    timeit() multiple times and return a list of results.

    The statements may contain newlines, as long as they don't contain
    multi-line string literals.
    �passNcCs�||_i}|dkrt�n|}d}t|t�rJt|td�|d}t|d�}n*t|�rl||d<|d7}d}d}ntd	��t|t�r�t||td�t|d
�}n&t|�r�||d<|d7}d
}ntd��t	j
|||d�}	|	|_t|	td�}
t|
||�|d|_
dS)z#Constructor.  See class doc string.N��execr��_setupz, _setup=_setupz_setup()z&setup is neither a string nor callable�Z_stmtz
, _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)�stmt�setup�init�inner)�timer�_globals�
isinstance�str�compile�dummy_src_namer�callable�
ValueError�template�formatr
rr)�selfrrr�globalsZlocal_nsZ	global_nsrZ
stmtprefixr
�coderrr
�__init__es6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|j�d�tf|jt<|j|d�dS)a�Helper to print a traceback from the timed code.

        Typical use:

            t = Timer(...)       # outside the try/except
            try:
                t.timeit(...)    # or t.repeat(...)
            except:
                t.print_exc()

        The advantage over the standard traceback is that source lines
        in the compiled template will be displayed.

        The optional file argument directs where the traceback is
        sent; it defaults to sys.stderr.
        rNr��file)�	linecache�	tracebackr
�len�splitr�cache�	print_exc)r#r(r)r*rrr
r.�s

�
zTimer.print_exccCsBt�d|�}t��}t��z|�||j�}W5|r<t��X|S)a�Time 'number' executions of the main statement.

        To be precise, this executes the setup statement once, and
        then returns the time it takes to execute the main statement
        a number of times, as a float measured in seconds.  The
        argument is the number of times through the loop, defaulting
        to one million.  The main statement, the setup statement and
        the timer function to be used are passed to the constructor.
        N)�	itertoolsr�gcZ	isenabledZdisableZenablerr)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs*g}t|�D]}|�|�}|�|�q|S)a�Call timeit() a few times.

        This is a convenience function that calls the timeit()
        repeatedly, returning a list of results.  The first argument
        specifies how many times to call timeit(), defaulting to 5;
        the second argument specifies the timer argument, defaulting
        to one million.

        Note: it's tempting to calculate mean and standard deviation
        from the result vector and report these.  However, this is not
        very useful.  In a typical case, the lowest value gives a
        lower bound for how fast your machine can run the given code
        snippet; higher values in the result vector are typically not
        caused by variability in Python's speed, but by other
        processes interfering with your timing accuracy.  So the min()
        of the result is probably the only number you should be
        interested in.  After that, you should look at the entire
        vector and apply common sense rather than statistics.
        )�ranger�append)r#rr1�r�i�trrr
r�s

zTimer.repeatcCsPd}dD]8}||}|�|�}|r,|||�|dkr||fSq|d9}qdS)a�Return the number of loops and time taken so that total time >= 0.2.

        Calls the timeit method with increasing numbers from the sequence
        1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2
        second.  Returns (number, time_taken).

        If *callback* is given and is not None, it will be called after
        each trial with two arguments: ``callback(number, time_taken)``.
        �)r8�rg�������?�
N)r)r#�callbackr6�jr1�
time_takenrrr
�	autorange�s


zTimer.autorange)N)N)�__name__�
__module__�__qualname__�__doc__rr&r.�default_numberr�default_repeatrr>rrrr
rSs�
#
rcCst||||��|�S)zCConvenience function to create Timer object and call timeit method.)rr)rrrr1r$rrr
r�scCst||||��||�S)zCConvenience function to create Timer object and call repeat method.)rr)rrrrr1r$rrr
r�s)�_wrap_timerc
s|dkrtjdd�}ddl}z(|�|dddddd	d
ddd
g	�\}}Wn:|jk
r�}zt|�td�WY�dSd}~XYnXt}d�|�p�d}d�g}t}d}	d�ddddd��d�|D]�\}
}|
dkr�t|��|
dkr�|�	|�|
dk�r|�k�r|�ntdtj
d�dS|
dk�r6t|�}|dk�r6d}|
dk�rFtj}|
dk�rf|	�r^�d7�|	d7}	|
d kr�tt
d!d"�dSq�d�|��p�d}ddl}tj�d|j�|dk	�r�||�}t|||�}
�dk�rd}|	�r�fd#d$�}z|
�|�\�}Wn|
��YdSX|	�rt�z|
�|��}Wn|
��YdSX���fd%d&�}|	�rztd'd(�t||���t��fd)d*�|D�}t|�}td+��dk�r�d,nd-|||�f�t|�}t|�}||d.k�rddl}|�d/||�||�ftd-d�dS)0a�Main program, used when run as a script.

    The optional 'args' argument specifies the command line to be parsed,
    defaulting to sys.argv[1:].

    The return value is an exit code to be passed to sys.exit(); it
    may be None to indicate success.

    When an exception happens during timing, a traceback is printed to
    stderr and the return value is 1.  Exceptions at other times
    (including the template compilation) are not caught.

    '_wrap_timer' is an internal interface used for unit testing.  If it
    is not None, it must be a callable that accepts a timer function
    and returns another timer function (used for unit testing).
    Nr8rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�timeZclockZprocess�verbosezunit=�helpz#use -h/--help for command line helpr9rrg��&�.>g���ư>g����MbP?g�?)ZnsecZusecZmsecZsec�)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.r')z-rz--repeat)z-pz	--process)z-vz	--verbose)z-hz--helpr)�endcs.d}|dk}t|j||rdnd|�d��dS)Nz%{num} loop{s} -> {secs:.{prec}g} secsr8�sr)ZnumrKZsecsZprec)�printr")r1r=�msgZplural)�	precisionrr
r;?s�zmain.<locals>.callbackcs`�}|dk	r�|}n8dd����D�}|jdd�|D]\}}||kr8qNq8d�|||fS)NcSsg|]\}}||f�qSrr)�.0�unit�scalerrr
�
<listcomp>Ysz-main.<locals>.format_time.<locals>.<listcomp>T)�reversez%.*g %s)�items�sort)�dtrPrQZscales)rN�	time_unit�unitsrr
�format_timeSs
zmain.<locals>.format_timez
raw times: %sz, csg|]}|��qSrr)rOrV)r1rr
rRdszmain.<locals>.<listcomp>z"%d loop%s, best of %d: %s per looprKrrztThe test results are likely unreliable. The worst time (%s) was more than four times slower than the best time (%s).)�sys�argv�getopt�errorrLr�joinrD�intr4�stderrrF�process_timerB�os�path�insert�curdirrr>r.r�map�min�max�warnings�
warn_explicit�UserWarning)�argsrEr\Zopts�errrrrrrG�o�arbr7r;�_Zraw_timingsrYZtimingsZbestZworstrir)r1rNrWrXr
�main�s���


�





����rq�__main__)N)rBr0rZrFr/�__all__rrCrD�perf_counterrr$rr!rrrrrqr?�exitrrrr
�<module>s61
�
�
gzip.cpython-38.pyc000064400000043412151450073350010154 0ustar00U

e5d�S�@sdZddlZddlZddlZddlZddlZddlZddlZddlZdddddgZ	d\Z
ZZZ
Zd	\ZZd
ZdZdZd
edddfdd�Zdd�ZGdd�d�ZGdd�de�ZGdd�dej�ZGdd�dej�Zefdd�dd�Zdd�Zdd�Ze dk�re�dS)z�Functions that read and write gzipped files.

The user of the file doesn't have to worry about the compression,
but random access is not allowed.�N�BadGzipFile�GzipFile�open�compress�
decompress)�����)rrr��	�rbcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|tttjf�r|t|||�}n,t|d	�s�t|d
�r�td|||�}nt	d��d|kr�t
�||||�S|SdS)aOpen a gzip-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str or bytes object), or
    an existing file object to read from or write to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
    binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
    "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the GzipFile constructor:
    GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
    and newline arguments must not be provided.

    For text mode, a GzipFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error handling
    behavior, and line ending(s).

    �t�bzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newlineZgz_modeZbinary_file�r%�/usr/lib64/python3.8/gzip.pyrs$cCs|�t�d|��dS)Nz<L)r�structZpack)�output�valuer%r%r&�write32uEsr*c@s<eZdZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
S)�_PaddedFilez�Minimal read-only file object that prepends a string to the contents
    of an actual file. Shouldn't be used outside of gzip.py, as it lacks
    essential functionality.�cCs ||_t|�|_||_d|_dS�Nr)�_buffer�len�_length�file�_read)�self�f�prependr%r%r&�__init__Os
z_PaddedFile.__init__cCs~|jdkr|j�|�S|j||jkrJ|j}|j|7_|j||j�S|j}d|_|j|d�|j�||j|�SdS�N)r2r1rr0r.)r3�sizerr%r%r&rUs
�z_PaddedFile.readcCs>|jdkr||_n|jt|�8_dSt|j�|_d|_dSr-)r2r.r/r0)r3r5r%r%r&r5bs
z_PaddedFile.prependcCsd|_d|_|j�|�Sr7)r2r.r1�seek)r3Zoffr%r%r&r9ksz_PaddedFile.seekcCsdS�NTr%�r3r%r%r&�seekablepsz_PaddedFile.seekableN)r,)r,)	�__name__�
__module__�__qualname__�__doc__r6rr5r9r<r%r%r%r&r+Js

	r+c@seZdZdZdS)rz6Exception raised in some cases for invalid gzip files.N)r=r>r?r@r%r%r%r&rtsc@s�eZdZdZdZddeddfdd�Zedd��Zedd��Z	d	d
�Z
dd�Zd
d�Zdd�Z
d,dd�Zd-dd�Zdd�Zedd��Zdd�Zejfdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zejfd(d)�Zd.d*d+�ZdS)/ra
The GzipFile class simulates most of the methods of a file object with
    the exception of the truncate() method.

    This class only supports opening files in binary mode. If you need to open a
    compressed file in text mode, use the gzip.open() function.

    NcCs4|r"d|ksd|kr"td�|���|r6d|kr6|d7}|dkrTt�||pJd�}|_|dkr|t|dd�}t|ttf�s�d}n
t	�
|�}|dkr�t|d	d�}|�d
�r�t|_
t|�}t�|�|_||_nN|�d��rt|_
|�|�t�|tjtjtjd�|_||_ntd�|���||_|j
tk�r0|�|�dS)
aGConstructor for the GzipFile class.

        At least one of fileobj and filename must be given a
        non-trivial value.

        The new class instance is based on fileobj, which can be a regular
        file, an io.BytesIO object, or any other object which simulates a file.
        It defaults to None, in which case filename is opened to provide
        a file object.

        When fileobj is not None, the filename argument is only used to be
        included in the gzip file header, which may include the original
        filename of the uncompressed file.  It defaults to the filename of
        fileobj, if discernible; otherwise, it defaults to the empty string,
        and in this case the original filename is not included in the header.

        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
        'xb' depending on whether the file will be read or written.  The default
        is the mode of fileobj if discernible; otherwise, the default is 'rb'.
        A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
        'wb', 'a' and 'ab', and 'x' and 'xb'.

        The compresslevel argument is an integer from 0 to 9 controlling the
        level of compression; 1 is fastest and produces the least compression,
        and 9 is slowest and produces the most compression. 0 is no compression
        at all. The default is 9.

        The mtime argument is an optional numeric timestamp to be written
        to the last modification time field in the stream when compressing.
        If omitted or None, the current time is used.

        r�UzInvalid mode: {!r}rNr�namerr �r)�w�a�xr)r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr �_GzipReaderr�BufferedReaderr.rB�WRITE�_init_write�zlibZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�_write_mtime�fileobj�_write_gzip_header)r3rr r!rU�mtime�rawr%r%r&r6�s@#


�zGzipFile.__init__cCsBddl}|�dtd�|jtkr<|jdd�dkr<|jdS|jS)Nrzuse the name attributer����.gz)�warnings�warn�DeprecationWarningr rPrB)r3r[r%r%r&r�s

zGzipFile.filenamecCs
|jjjS)z0Last modification time read from stream, or None)r.rX�_last_mtimer;r%r%r&rW�szGzipFile.mtimecCs.t|j�}d|dd�dtt|��dS)Nz<gzip r���� �>)�reprrU�hex�id)r3�sr%r%r&�__repr__�s
zGzipFile.__repr__cCs.||_t�d�|_d|_g|_d|_d|_dS�Nr,r)rBrR�crc32�crcr8Zwritebuf�bufsize�offset)r3rr%r%r&rQ�szGzipFile._init_writecCs|j�d�|j�d�z<tj�|j�}t|t�s<|�d�}|�	d�rR|dd�}Wnt
k
rld}YnXd}|rzt}|j�t|��d��|j
}|dkr�t��}t|jt|��|tkr�d}n|tkr�d	}nd
}|j�|�|j�d�|�r|j�|d
�dS)N���zlatin-1s.gzrYr,r�����)rUrr�path�basenamerBrr�encode�endswith�UnicodeEncodeError�FNAME�chrrT�timer*�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r3r!Zfname�flagsrWZxflr%r%r&rV�s6



zGzipFile._write_gzip_headercCs�|��|jtkr&ddl}t|jd��|jdkr8td��t|t	�rLt
|�}nt|�}|j}|dkr�|j�
|j�|��|j|7_t�||j�|_|j|7_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)�_check_not_closedr rP�errno�OSError�EBADFrUrrrr/�
memoryview�nbytesrrr8rRrhrirk)r3�datarZlengthr%r%r&rs 



zGzipFile.writer_cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$read() on write-only GzipFile object)r~r rMrr�r�r.r�r3r8rr%r%r&rs

z
GzipFile.readcCs@|��|jtkr&ddl}t|jd��|dkr4tj}|j�	|�S)zdImplements BufferedIOBase.read1()

        Reads up to a buffer's worth of data if size is negative.rNz%read1() on write-only GzipFile object)
r~r rMrr�r�r�DEFAULT_BUFFER_SIZEr.�read1r�r%r%r&r�&s
zGzipFile.read1cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$peek() on write-only GzipFile object)r~r rMrr�r�r.�peek)r3�nrr%r%r&r�3s

z
GzipFile.peekcCs
|jdkSr7�rUr;r%r%r&�closed:szGzipFile.closedcCs�|j}|dkrdSd|_zP|jtkrR|�|j���t||j	�t||j
d@�n|jtkrf|j��W5|j}|r�d|_|��XdS)N���)
rUrI�closer rPrr�flushr*rir8rMr.)r3rUrIr%r%r&r�>s

zGzipFile.closecCs4|��|jtkr0|j�|j�|��|j��dSr7)r~r rPrUrrr�)r3Z	zlib_moder%r%r&r�Qs
zGzipFile.flushcCs
|j��S)z�Invoke the underlying file object's fileno() method.

        This will raise AttributeError if the underlying file object
        doesn't support fileno().
        )rU�filenor;r%r%r&r�XszGzipFile.filenocCs"|jtkrtd��|j�d�dS)z[Return the uncompressed stream file position indicator to the
        beginning of the filezCan't rewind in write moderN)r rMr�r.r9r;r%r%r&�rewind`s
zGzipFile.rewindcCs
|jtkSr7)r rMr;r%r%r&�readablegszGzipFile.readablecCs
|jtkSr7)r rPr;r%r%r&�writablejszGzipFile.writablecCsdSr:r%r;r%r%r&r<mszGzipFile.seekablecCs�|jtkr�|tjkr2|tjkr*|j|}ntd��||jkrDtd��||j}d}t|d�D]}|�	|�q^|�	d|d�n |jt
kr�|��|j�
||�S|jS)NzSeek from end not supportedzNegative seek in write modes�rp)r rPr�SEEK_SET�SEEK_CURrkrr��rangerrMr~r.r9)r3rk�whence�count�chunk�ir%r%r&r9ps 





z
GzipFile.seekcCs|��|j�|�Sr7)r~r.�readline)r3r8r%r%r&r��szGzipFile.readline)r_)r_)r_)r=r>r?r@rIr{r6�propertyrrWrfrQrVrrr�r�r�r�rRZZ_SYNC_FLUSHr�r�r�r�r�r<rr�r9r�r%r%r%r&rxs:
�
I

 



csZeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�fdd�Z
�ZS)rNcs,t�jt|�tjtjd�d|_d|_dS)N)ZwbitsT)�superr6r+rRZ
decompressobjrS�_new_memberr^)r3�fp��	__class__r%r&r6�s
�z_GzipReader.__init__cCst�d�|_d|_dSrg)rRrh�_crc�_stream_sizer;r%r%r&�
_init_read�sz_GzipReader._init_readcCsF|j�|�}t|�|krB|j�|t|��}|s8td��||7}q|S)z�Read exactly *n* bytes from `self._fp`

        This method is required because self._fp may be unbuffered,
        i.e. return short reads.
        �ACompressed file ended before the end-of-stream marker was reached)�_fprr/�EOFError)r3r�r�rr%r%r&�_read_exact�s
z_GzipReader._read_exactcCs�|j�d�}|dkrdS|dkr,td|��t�d|�d��\}}|_|dkrVtd��|t@r|t�d	|�d��\}|�|�|t@r�|j�d
�}|r�|dkr�q�q�|t	@r�|j�d
�}|r�|dkr�q�q�|t
@r�|�d�dS)
Nrr,FrlzNot a gzipped file (%r)z<BBIxxr
zUnknown compression methodz<HrrpT)r�rrr'�unpackr�r^�FEXTRArw�FCOMMENT�FHCRC)r3�magic�method�flagZ	extra_lenrer%r%r&�_read_gzip_header�s0�

z_GzipReader._read_gzip_headerr_cCs�|dkr|��S|sdS|jjr>|��d|_|jf|j�|_|jrf|��|��s`|j	|_
dSd|_|j�t
j�}|j�||�}|jjdkr�|j�|jj�n|jjdkr�|j�|jj�|dkr�q�|dkrtd��q|�|�|j	t|�7_	|S)Nrr,TFr�)�readallZ
_decompressor�eof�	_read_eofr�Z_decomp_factoryZ_decomp_argsr�r�Z_posZ_sizer�rrr�rZunconsumed_tailr5Zunused_datar��_add_read_datar/)r3r8�bufZ
uncompressr%r%r&r�s:�

z_GzipReader.readcCs$t�||j�|_|jt|�|_dSr7)rRrhr�r�r/)r3r�r%r%r&r��sz_GzipReader._add_read_datacCs�t�d|�d��\}}||jkr<tdt|�t|j�f��n||jd@krRtd��d}|dkrl|j�d�}qV|r||j�	|�dS)Nz<IIr
zCRC check failed %s != %sr�z!Incorrect length of data producedrpr)
r'r�r�r�rrcr�r�rr5)r3rhZisize�cr%r%r&r��s

�
z_GzipReader._read_eofcst���d|_dSr:)r��_rewindr�r;r�r%r&r�s
z_GzipReader._rewind)r_)r=r>r?r6r�r�r�rr�r�r��
__classcell__r%r%r�r&rN�s!
3rN)rWc	Cs6t��}t|d||d��}|�|�W5QRX|��S)z�Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
    �wb)rUr r!rW)r�BytesIOrr�getvalue)r�r!rWr�r4r%r%r&rsc
Cs0tt�|�d��}|��W5QR�SQRXdS)zYDecompress a gzip compressed string in one shot.
    Return the decompressed string.
    r�N)rrr�r)r�r4r%r%r&rsc	Cs�ddlm}|dd�}|��}|jdddd�|jd	dd
d�|jdddd
d�|jdddgdd�|��}t}|jr|t}n
|jr�t	}|j
D]�}|jr�|dkr�tddt
jjd�}t
jj}n>|dd�dkr�t
�d|���t|d�}t�|dd�d�}nB|dk�r"t
jj}tddt
jj|d�}nt�|d�}t|dd�}|�d�}|�sP�q^|�|��q<|t
jjk	�rt|��|t
jjk	r�|��q�dS)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)Zdescriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r1)�nargs�default�metavarrr)rr rUrYrZzfilename doesn't end in .gz: r�)rr rUr!r�)�argparser�Zadd_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFFZfastr|Zbestr{r�rr�sys�stdin�buffer�stdout�exitrrHrrr�)	r��parser�groupr�r!�argr4�gr�r%r%r&�main'sR�
�



�
r��__main__)!r@r'r�ryrrRrHrZ_compression�__all__ZFTEXTr�r�rwr�rMrPr|r�r{rr*r+r�rZ
BaseStreamrZDecompressReaderrNrrr�r=r%r%r%r&�<module>s: �
,*	0
pprint.cpython-38.opt-1.pyc000064400000037552151450073350011466 0ustar00U

e5d�S�
@sdZddlZddlZddlZddlZddlm	Z
dddddd	d
gZd%d
dd�dd�Zd&d
dd�dd�Z
d
d�dd
�Zdd�Zdd�Zdd�ZGdd�d�Zdd�ZGdd	�d	�Zdd�Zeeeeeeeeed�h�Zdd�Z d'd d!�Z!d"d#�Z"e#d$k�r�e!�dS)(a/Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

�N)�StringIO�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp��PFT��compact�
sort_dictscCs"t||||||d�}|�|�dS)zAPretty-print a Python object to a stream [default is sys.stdout].)�stream�indent�width�depthr
rN)rr)�objectrrrrr
rZprinter�r�/usr/lib64/python3.8/pprint.pyr/s�cCst|||||d��|�S)z<Format a Python object into a pretty-printed representation.)rrrr
r)rr)rrrrr
rrrrr7s��)rcOst|f|�d|i|��dS)zPretty-print a Python objectrN)r)rr�args�kwargsrrrr	=scCst|iddd�dS)z=Version of repr() which can handle recursive data structures.NrT��
_safe_repr�rrrrrAscCst|iddd�dS)z4Determine if saferepr(object) is readable by eval().NrTr
rrrrrrEscCst|iddd�dS)z8Determine if object requires a recursive representation.NrT�rrrrrrIsc@s&eZdZdZdgZdd�Zdd�ZdS)�	_safe_keyaUHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    �objcCs
||_dS�N)r)�selfrrrr�__init__Ysz_safe_key.__init__cCsXz|j|jkWStk
rRtt|j��t|j�ftt|j��t|j�fkYSXdSr)r�	TypeError�str�type�id)r�otherrrr�__lt__\s�z_safe_key.__lt__N)�__name__�
__module__�__qualname__�__doc__�	__slots__r r&rrrrrMs	rcCst|d�t|d�fS)z&Helper function for comparing 2-tuplesrr
)r)�trrr�_safe_tuplecsr-c@s�eZdZd;ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�ZiZ	dd�Z
e
e	ej<dd�Z
e
e	ejj<dd�Zee	ej<dd�Zee	ej<dd�Zee	ej<ee	ej<dd�Zee	ej<dd �Zee	ej<d!d"�Zee	ej<d#d$�Zee	ejj<d%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$e$e	ej%j<d/d0�Z&e&e	ej'j<d1d2�Z(e(e	ej)j<d3d4�Z*e*e	ej+j<d5d6�Z,e,e	ej-j<d7d8�Z.e.e	ej/j<d9d:�Z0e0e	ej1j<dS)<rr
rNFTrcCs�t|�}t|�}|dkr td��|dk	r8|dkr8td��|sDtd��||_||_||_|dk	rf||_ntj|_t|�|_	||_
dS)a�Handle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts)rrrrrr
rrrrr hs 
zPrettyPrinter.__init__cCs&|�||jddid�|j�d�dS)Nr�
)�_formatr3�write�rrrrrr�szPrettyPrinter.pprintcCs"t�}|�||ddid�|��S�Nr)�	_StringIOr:�getvalue)rrZsiorrrr�szPrettyPrinter.pformatcCs|�|idd�dS)Nrr��formatr<rrrr�szPrettyPrinter.isrecursivecCs |�|idd�\}}}|o|Sr=r@)rr�s�readable�	recursiverrrr�szPrettyPrinter.isreadablec	Cs�t|�}||kr.|�t|��d|_d|_dS|�|||�}|j||}	t|�|	kr�|j�	t
|�jd�}
|
dk	r�d||<|
|||||||d�||=dSt|t
�r�d||<|�||||||d�||=dS|�|�dS)NTFr
)r$r;�
_recursion�
_recursive�	_readable�_reprr2�len�	_dispatch�getr#�__repr__�
isinstance�dict�_pprint_dict)rrrr�	allowance�context�level�objid�rep�	max_width�prrrr:�s0
�zPrettyPrinter._formatc
Csz|j}|d�|jdkr*||jdd�t|�}|rn|jrNt|��td�}	n|��}	|�|	|||d||�|d�dS)N�{r
� ��key�})r;r1rIr8�sorted�itemsr-�_format_dict_items)
rrrrrPrQrRr;Zlengthr]rrrrO�s
�zPrettyPrinter._pprint_dictcCslt|�s|�t|��dS|j}|�|jd�|�t|���||t|j�d|d||�|�d�dS)N�(r
�))rIr;�repr�	__class__r'r:�listr])rrrrrPrQrR�clsrrr�_pprint_ordered_dict�s�z"PrettyPrinter._pprint_ordered_dictcCs0|�d�|�||||d||�|�d�dS)N�[r
�])r;�
_format_items�rrrrrPrQrRrrr�_pprint_list�s
�zPrettyPrinter._pprint_listcCsH|�d�t|�dkrdnd}|�||||t|�||�|�|�dS)Nr_r
z,)r`)r;rIrh)rrrrrPrQrR�endcharrrr�
_pprint_tuple�s
�zPrettyPrinter._pprint_tuplec	Cs�t|�s|�t|��dS|j}|tkr8|�d�d}n&|�|jd�d}|t|j�d7}t|td�}|�||||t|�||�|�|�dS)NrWr[�({�})r
rY)	rIr;rarb�setr'r\rrh)	rrrrrPrQrR�typrkrrr�_pprint_set�s 
�zPrettyPrinter._pprint_setcCs�|j}t|�s|t|��dSg}|�d�}	|dkrD|d7}|d7}|j|}
}t|	�D]�\}}
t|
�}|t|	�dkr�|
|8}
t|�|
kr�|�|�qZt�d|
�}|�	�|}d}t|�D]h\}}||}|t|�dkr�|t|	�dkr�||8}tt|��|k�r"|�r|�t|��|}q�|}q�|rZ|�t|��qZt|�dk�rV||�dS|dk�rh|d�t|�D],\}}|dk�r�|dd|�||��qp|dk�r�|d	�dS)
NTr
z\S*\s*�r_rr9rXr`)
r;rIra�
splitlinesr2�	enumerate�append�re�findall�pop)rrrrrPrQrRr;Zchunks�linesZ
max_width1rU�i�linerT�partsZ
max_width2�current�j�part�	candidaterrr�_pprint_strsT
 


zPrettyPrinter._pprint_strcCs�|j}t|�dkr"|t|��dS|dk}|rF|d7}|d7}|d�d}	t||j||�D]$}
||	�||
�|	s\dd|}	q\|r�|d�dS)N�r
r_rrr9rXr`)r;rIra�_wrap_bytes_reprr2)rrrrrPrQrRr;Zparens�delimrTrrr�
_pprint_bytes3s"zPrettyPrinter._pprint_bytesc	Cs>|j}|d�|�t|�||d|d||d�|d�dS)Nz
bytearray(�
r
r`)r;r��bytes)rrrrrPrQrRr;rrr�_pprint_bytearrayHs�zPrettyPrinter._pprint_bytearraycCs8|�d�|�|��||d|d||�|�d�dS)Nz
mappingproxy(�
r
r`)r;r:�copyrirrr�_pprint_mappingproxyQs
�z"PrettyPrinter._pprint_mappingproxyc	Cs�|j}||j7}dd|}t|�d}	t|�D]f\}
\}}|
|	k}
|�|||�}||�|d�|�|||t|�d|
r�|nd||�|
s0||�q0dS)N�,
rXr
z: r)r;r1rIrtrHr:)rr]rrrPrQrRr;�delimnlZ
last_indexrzrZ�ent�lastrTrrrr^Ys 

�z PrettyPrinter._format_dict_itemscCsL|j}||j7}|jdkr,||jdd�dd|}d}	|j|d}
}t|�}zt|�}
Wntk
rxYdSXd}|�sH|
}zt|�}
Wn(tk
r�d}||8}|
|8}
YnX|j�r|�|||�}t|�d}|
|kr�|}
|	r�|}	|
|k�r|
|8}
||	�d}	||�q~||	�|}	|�	||||�r<|nd||�q~dS)	Nr
rXr�rrFTr�, )
r;r1r2�iter�next�
StopIterationr7rHrIr:)rr]rrrPrQrRr;r�r�rrU�itZnext_entr�r�rT�wrrrrhjsR



�zPrettyPrinter._format_itemscCs4|�||��|j|�\}}}|s&d|_|r0d|_|S)NFT)rAr�r0rGrF)rrrQrRrarCrDrrrrH�s�
zPrettyPrinter._reprcCst|||||j�S)z�Format object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        )rr8)rrrQ�	maxlevelsrRrrrrA�szPrettyPrinter.formatc	Cs�t|�s|�t|��dS|�|j||�}|j}|t|j�d7}|�d|j|d|f�|�||||d||�|�d�dS)Nr
z	%s(%s,
%srXr`)rIr;rarH�default_factoryrbr'rO)	rrrrrPrQrRZrdfrdrrr�_pprint_default_dict�sz"PrettyPrinter._pprint_default_dictc	Cs�t|�s|�t|��dS|j}|�|jd�|jdkrN|�|jdd�|��}|�|||t|j�d|d||�|�d�dS)Nrmr
rXrrn)rIr;rarbr'r1�most_commonr^)	rrrrrPrQrRrdr]rrr�_pprint_counter�s
�zPrettyPrinter._pprint_counterc
	Cs�t|j�s|�t|��dS|j}|�|jd�|t|j�d7}t|j�D]d\}}	|t|j�dkr�|�|	|||d||�|�d�qN|�|	||d||�|�dd|�qNdS)Nr_r
r`r�rX)rI�mapsr;rarbr'rtr:)
rrrrrPrQrRrdrz�mrrr�_pprint_chain_map�s
zPrettyPrinter._pprint_chain_mapc	Cs�t|�s|�t|��dS|j}|�|jd�|t|j�d7}|�d�|jdkrz|�||||d||�|�d�n:|�|||d||�|�|j||�}|�dd||f�dS)Nr_r
rfrz])z],
%smaxlen=%s)rX)rIr;rarbr'�maxlenrhrH)	rrrrrPrQrRrdZrmlrrr�
_pprint_deque�s&

��zPrettyPrinter._pprint_dequec	Cs|�|j|||||d�dS�Nr
�r:�datarirrr�_pprint_user_dict�szPrettyPrinter._pprint_user_dictc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_list�szPrettyPrinter._pprint_user_listc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_string�sz!PrettyPrinter._pprint_user_string)r
rNN)2r'r(r)r rrrrr:rJrOrNrLre�_collections�OrderedDictrjrcrl�tuplerqro�	frozensetr�r"r�r�r��	bytearrayr��_types�MappingProxyTyper^rhrHrAr��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrrrrrgs^�+




1


)	cCs�t|�}|tkrt|�ddfSt|dd�}t|t��rD|tjk�rD|sJdSt|�}|rl||krldd||kfS||kr�t|�ddfSd||<d}d}	g}
|
j	}|d7}|r�t
|��td�}n|��}|D]b\}
}t
|
||||�\}}}t
|||||�\}}}|d||f�|�o|�o|}|�s$|r�d}	q�||=d	d
�|
�||	fSt|t��r\|tjk�stt|t��rn|tjk�rnt|t��r�|�s�dSd}n"t|�dk�r�d
}n|�s�dSd}t|�}|�r�||k�r�|dd||kfS||k�r�t|�ddfSd||<d}d}	g}
|
j	}|d7}|D]8}t
|||||�\}}}||�|�sFd}|�rd}	�q||=|d
�|
�||	fSt|�}||�o�|�d�dfS)NTFrL)z{}TFz{...}r
rYz%s: %sz{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)z...�<)r#�_builtin_scalarsra�getattr�
issubclassrNrLr$rErur\r]r-r�joinrcr�rI�
startswith)rrQr�rRrrp�rrSrCrDZ
componentsrur]�k�vZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurrA�oZoreprZ	oreadableZorecurrTrrrr�s�
��
rcCsdt|�jt|�fS)Nz<Recursion on %s with id=%s>)r#r'r$rrrrrE?s�rEcCs�ddl}|dkr,ddddgddd�fgd	}t�}|��}t|iddd
�|��}|�|�|��}td||�td||�dS)
Nr�string)r
r�r���)��i��Tz_safe_repr:zpformat:)�timer�perf_counterrr�print)rr�rV�t1�t2Zt3rrr�
_perfcheckDs
r�ccs�d}t|�dd}tdt|�d�D]T}|||d�}||}||krP||8}tt|��|krt|rnt|�V|}q$|}q$|r�t|�VdS)N�r�r)rI�rangera)rrrPr}r�rzrr�rrrr�Qs
r��__main__)Nr
rN)r
rN)N)$r*�collectionsr�rv�sysr4�typesr��iorr>�__all__rrr	rrrrr-rrr�r"r�r�r.�float�complexr6r#r�rEr�r�r'rrrr�<module>sJ
���F�


statistics.cpython-38.pyc000064400000101567151450073350011403 0ustar00U

e5d
��@s�dZddddddddd	d
ddd
ddddgZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZmZmZmZmZmZmZddlmZddlmZGdd�de�Zdedd�Zdd�Zd d!�Zd"d#�Zd$d%�Z d&d'�Z!d(d)�Z"dfd+d,�Z#d-d�Z$d.d�Z%d/d�Z&d0d�Z'd1d�Z(d2d
�Z)d3d	�Z*dgd5d�Z+d6d�Z,d7d�Z-d8d9d:�d;d�Z.dhd<d=�Z/did>d�Z0djd?d�Z1dkd@d�Z2dldAd
�Z3dBdC�Z4GdDd�d�Z5zddEl6m4Z4Wne7k
�r�YnXe8dFk�r�ddGlm9Z9ddHlm:Z:m;Z;m<Z<m=Z=ddIl	m>Z>ddl?Z?e5dJdK�Z@e5dLdM�ZAe@dNdNj$e@j$k�sLtB�e@dNdNj2e@j2k�sftB�dOZCe@�DeC�ZEeA�DeC�ZFe:e;fD]<ZGeHdPeGj8�dQ��eHeGe@eA��eHe5�IeJeGeEeF����q�dRZKe:e;e<e=fD]@ZGeHdPeGj8�dS��eHeGe@eK��eHe5�IeJeGeEe>eK�����q�dTZKe:e;e<fD]@ZGeHdUeGj8�dV��eHeGeKe@��eHe5�IeJeGe>eK�eE����q$dWdX�ZLe5dYdZ�ZMe5d[d\�ZNd]ZOdOZCe5�Id^d_�eM�DeC�D��ZPeLeMeOeP�e5�Id`d_�eM�DeC�D��ZPeLeMeOeP�e5�Idad_�eM�DeC�D��ZPeLeMeOeP�e5�Idbd_�eM�DeC�D��ZPeLeMeOeP�e5�Idcd_�eQeM�DeC�eN�DeC��D��ZPeLeMeNeP�e5�Iddd_�eQeM�DeC�eN�DeC��D��ZPeLeMeNeP�eHe?�R��dS)mam

Basic statistics module.

This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.

Calculating averages
--------------------

==================  ==================================================
Function            Description
==================  ==================================================
mean                Arithmetic mean (average) of data.
fmean               Fast, floating point arithmetic mean.
geometric_mean      Geometric mean of data.
harmonic_mean       Harmonic mean of data.
median              Median (middle value) of data.
median_low          Low median of data.
median_high         High median of data.
median_grouped      Median, or 50th percentile, of grouped data.
mode                Mode (most common value) of data.
multimode           List of modes (most common values of data).
quantiles           Divide data into intervals with equal probability.
==================  ==================================================

Calculate the arithmetic mean ("the average") of data:

>>> mean([-1.0, 2.5, 3.25, 5.75])
2.625


Calculate the standard median of discrete data:

>>> median([2, 3, 4, 5])
3.5


Calculate the median, or 50th percentile, of data grouped into class intervals
centred on the data values provided. E.g. if your data points are rounded to
the nearest whole number:

>>> median_grouped([2, 2, 3, 3, 3, 4])  #doctest: +ELLIPSIS
2.8333333333...

This should be interpreted in this way: you have two data points in the class
interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in
the class interval 3.5-4.5. The median of these data points is 2.8333...


Calculating variability or spread
---------------------------------

==================  =============================================
Function            Description
==================  =============================================
pvariance           Population variance of data.
variance            Sample variance of data.
pstdev              Population standard deviation of data.
stdev               Sample standard deviation of data.
==================  =============================================

Calculate the standard deviation of sample data:

>>> stdev([2.5, 3.25, 5.5, 11.25, 11.75])  #doctest: +ELLIPSIS
4.38961843444...

If you have previously calculated the mean, you can pass it as the optional
second argument to the four "spread" functions to avoid recalculating it:

>>> data = [1, 2, 2, 4, 4, 4, 5, 6]
>>> mu = mean(data)
>>> pvariance(data, mu)
2.5


Exceptions
----------

A single exception is defined: StatisticsError is a subclass of ValueError.

�
NormalDist�StatisticsError�fmean�geometric_mean�
harmonic_mean�mean�median�median_grouped�median_high�
median_low�mode�	multimode�pstdev�	pvariance�	quantiles�stdev�variance�N��Fraction)�Decimal)�groupby)�bisect_left�bisect_right)�hypot�sqrt�fabs�exp�erf�tau�log�fsum)�
itemgetter)�Counterc@seZdZdS)rN)�__name__�
__module__�__qualname__�r&r&�"/usr/lib64/python3.8/statistics.pyruscCs�d}t|�\}}||i}|j}ttt|��}t|t�D]@\}}	t||�}tt|	�D]"\}}|d7}||d�|||<qRq6d|kr�|d}
t|
�r�t�nt	dd�t
|���D��}
||
|fS)aC_sum(data [, start]) -> (type, sum, count)

    Return a high-precision sum of the given numeric data as a fraction,
    together with the type to be converted to and the count of items.

    If optional argument ``start`` is given, it is added to the total.
    If ``data`` is empty, ``start`` (defaulting to 0) is returned.


    Examples
    --------

    >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
    (<class 'float'>, Fraction(11, 1), 5)

    Some sources of round-off error will be avoided:

    # Built-in sum returns zero.
    >>> _sum([1e50, 1, -1e50] * 1000)
    (<class 'float'>, Fraction(1000, 1), 3000)

    Fractions and Decimals are also supported:

    >>> from fractions import Fraction as F
    >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
    (<class 'fractions.Fraction'>, Fraction(63, 20), 4)

    >>> from decimal import Decimal as D
    >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
    >>> _sum(data)
    (<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)

    Mixed types are currently treated as an error, except that int is
    allowed.
    r�Ncss|]\}}t||�VqdS�Nr)�.0�d�nr&r&r'�	<genexpr>�sz_sum.<locals>.<genexpr>)�_exact_ratio�get�_coerce�int�typer�map�	_isfinite�AssertionError�sum�sorted�items)�data�start�countr,r+ZpartialsZpartials_get�T�typ�values�totalr&r&r'�_sum{s$
r@cCs.z
|��WStk
r(t�|�YSXdSr))Z	is_finite�AttributeError�mathZisfinite)�xr&r&r'r4�s
r4cCs�|tk	std��||kr|S|tks,|tkr0|S|tkr<|St||�rJ|St||�rX|St|t�rf|St|t�rt|St|t�r�t|t�r�|St|t�r�t|t�r�|Sd}t||j|jf��dS)z�Coerce types T and S to a common type, or raise TypeError.

    Coercion rules are currently an implementation detail. See the CoerceTest
    test class in test_statistics for details.
    zinitial type T is boolz"don't know how to coerce %s and %sN)�boolr5r1�
issubclassr�float�	TypeErrorr#)r<�S�msgr&r&r'r0�s*



r0cCs�zrt|�tkst|�tkr$|��WSz|j|jfWWStk
rnz|��WYWStk
rhYnXYnXWn,ttfk
r�t	|�r�t
�|dfYSXd}t|�t|�j
���dS)z�Return Real number x to exact (numerator, denominator) pair.

    >>> _exact_ratio(0.25)
    (1, 4)

    x is expected to be an int, Fraction, Decimal or float.
    Nz0can't convert type '{}' to numerator/denominator)r2rFr�as_integer_ratio�	numerator�denominatorrA�
OverflowError�
ValueErrorr4r5rG�formatr#)rCrIr&r&r'r.�s
r.cCspt|�|kr|St|t�r(|jdkr(t}z
||�WStk
rjt|t�rd||j�||j�YS�YnXdS)z&Convert value to given numeric type T.r(N)r2rEr1rLrFrGrrK)�valuer<r&r&r'�_convert�s

rQcCs.t||�}|t|�kr&|||kr&|St�dS)z,Locate the leftmost value exactly equal to xN)r�lenrN)�arC�ir&r&r'�
_find_lteq
s
rUcCs>t|||d�}|t|�dkr6||d|kr6|dSt�dS)z-Locate the rightmost value exactly equal to x)�lor(N)rrRrN)rS�lrCrTr&r&r'�
_find_rteqs rX�negative valueccs$|D]}|dkrt|��|VqdS)z7Iterate over values, failing if any are less than zero.rN)r)r>�errmsgrCr&r&r'�	_fail_negsr[cCsTt|�|krt|�}t|�}|dkr,td��t|�\}}}||ksFt�t|||�S)a�Return the sample arithmetic mean of data.

    >>> mean([1, 2, 3, 4, 4])
    2.8

    >>> from fractions import Fraction as F
    >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
    Fraction(13, 21)

    >>> from decimal import Decimal as D
    >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
    Decimal('0.5625')

    If ``data`` is empty, StatisticsError will be raised.
    r(z%mean requires at least one data point)�iter�listrRrr@r5rQ)r9r,r<r?r;r&r&r'r'scstzt|��Wn0tk
r<d��fdd�}t||��}Yn
Xt|�}z
|�WStk
rntd�d�YnXdS)z�Convert data to floats and compute the arithmetic mean.

    This runs faster than the mean() function and it always returns a float.
    If the input dataset is empty, it raises a StatisticsError.

    >>> fmean([3.5, 4.0, 5.25])
    4.25
    rc3s t|dd�D]\�}|VqdS)Nr()r:)�	enumerate)�iterablerC�r,r&r'r;Oszfmean.<locals>.countz&fmean requires at least one data pointN)rRrGr �ZeroDivisionErrorr)r9r;r?r&r`r'rAs	
cCs8ztttt|���WStk
r2td�d�YnXdS)aYConvert data to floats and compute the geometric mean.

    Raises a StatisticsError if the input dataset is empty,
    if it contains a zero, or if it contains a negative value.

    No special efforts are made to achieve exact results.
    (However, this may change in the future.)

    >>> round(geometric_mean([54, 24, 36]), 9)
    36.0
    zHgeometric mean requires a non-empty dataset  containing positive numbersN)rrr3rrNr)r9r&r&r'r\s�cCs�t|�|krt|�}d}t|�}|dkr2td��n<|dkrn|d}t|tjtf�rf|dkrbt|��|Std��z"t	dd�t
||�D��\}}}Wntk
r�YdSX||ks�t�t
|||�S)aReturn the harmonic mean of data.

    The harmonic mean, sometimes called the subcontrary mean, is the
    reciprocal of the arithmetic mean of the reciprocals of the data,
    and is often appropriate when averaging quantities which are rates
    or ratios, for example speeds. Example:

    Suppose an investor purchases an equal value of shares in each of
    three companies, with P/E (price/earning) ratios of 2.5, 3 and 10.
    What is the average P/E ratio for the investor's portfolio?

    >>> harmonic_mean([2.5, 3, 10])  # For an equal investment portfolio.
    3.6

    Using the arithmetic mean would give an average of about 5.167, which
    is too high.

    If ``data`` is empty, or any element is less than zero,
    ``harmonic_mean`` will raise ``StatisticsError``.
    z.harmonic mean does not support negative valuesr(z.harmonic_mean requires at least one data pointrzunsupported typecss|]}d|VqdS)r(Nr&�r*rCr&r&r'r-�sz harmonic_mean.<locals>.<genexpr>)r\r]rRr�
isinstance�numbersZRealrrGr@r[rar5rQ)r9rZr,rCr<r?r;r&r&r'ros&
"cCs\t|�}t|�}|dkr td��|ddkr8||dS|d}||d||dSdS)aBReturn the median (middle value) of numeric data.

    When the number of data points is odd, return the middle data point.
    When the number of data points is even, the median is interpolated by
    taking the average of the two middle values:

    >>> median([1, 3, 5])
    3
    >>> median([1, 3, 5, 7])
    4.0

    r�no median for empty data�r(N�r7rRr)r9r,rTr&r&r'r�s
cCsLt|�}t|�}|dkr td��|ddkr8||dS||ddSdS)a	Return the low median of numeric data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the smaller of the two middle values is returned.

    >>> median_low([1, 3, 5])
    3
    >>> median_low([1, 3, 5, 7])
    3

    rrerfr(Nrg�r9r,r&r&r'r
�scCs,t|�}t|�}|dkr td��||dS)aReturn the high median of data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the larger of the two middle values is returned.

    >>> median_high([1, 3, 5])
    3
    >>> median_high([1, 3, 5, 7])
    5

    rrerfrgrhr&r&r'r	�s
r(c
Cs�t|�}t|�}|dkr"td��n|dkr2|dS||d}||fD]}t|ttf�rFtd|��qFz||d}Wn(tk
r�t|�t|�d}YnXt||�}t	|||�}|}||d}	|||d||	S)a�Return the 50th percentile (median) of grouped continuous data.

    >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
    3.7
    >>> median_grouped([52, 52, 53, 54])
    52.5

    This calculates the median as the 50th percentile, and should be
    used when your data is continuous and grouped. In the above example,
    the values 1, 2, 3, etc. actually represent the midpoint of classes
    0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
    class 3.5-4.5, and interpolation is used to estimate it.

    Optional argument ``interval`` represents the class interval, and
    defaults to 1. Changing the class interval naturally will change the
    interpolated 50th percentile value:

    >>> median_grouped([1, 3, 3, 5, 7], interval=1)
    3.25
    >>> median_grouped([1, 3, 3, 5, 7], interval=2)
    3.5

    This function does not check whether the data points are at least
    ``interval`` apart.
    rrer(rfzexpected number but got %r)
r7rRrrc�str�bytesrGrFrUrX)
r9Zintervalr,rC�obj�L�l1�l2Zcf�fr&r&r'r�s&

cCsHt|�}t|��d�}z|ddWStk
rBtd�d�YnXdS)axReturn the most common data point from discrete or nominal data.

    ``mode`` assumes discrete data, and returns a single value. This is the
    standard treatment of the mode as commonly taught in schools:

        >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
        3

    This also works with nominal (non-numeric) data:

        >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
        'red'

    If there are multiple modes with same frequency, return the first one
    encountered:

        >>> mode(['red', 'red', 'green', 'blue', 'blue'])
        'red'

    If *data* is empty, ``mode``, raises StatisticsError.

    r(rzno mode for empty dataN)r\r"�most_common�
IndexErrorr)r9Zpairsr&r&r'rscCs@tt|����}tt|td�d�dgf�\}}tttd�|��S)a.Return a list of the most frequently occurring values.

    Will return more than one result if there are multiple modes
    or an empty list if *data* is empty.

    >>> multimode('aabbbbbbbbcc')
    ['b']
    >>> multimode('aabbbbccddddeeffffgg')
    ['b', 'd', 'f']
    >>> multimode('')
    []
    r()�keyr)r"r\rp�nextrr!r]r3)r9ZcountsZmaxcountZ
mode_itemsr&r&r'r5s
��	exclusive)r,�methodc
CsL|dkrtd��t|�}t|�}|dkr0td��|dkr�|d}g}td|�D]N}|||}||||}||||||d||}	|�|	�qN|S|dk�r:|d}g}td|�D]r}|||}|dkr�dn||dkr�|dn|}||||}||d||||||}	|�|	�q�|Std|����dS)	a�Divide *data* into *n* continuous intervals with equal probability.

    Returns a list of (n - 1) cut points separating the intervals.

    Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
    Set *n* to 100 for percentiles which gives the 99 cuts points that
    separate *data* in to 100 equal sized groups.

    The *data* can be any iterable containing sample.
    The cut points are linearly interpolated between data points.

    If *method* is set to *inclusive*, *data* is treated as population
    data.  The minimum value is treated as the 0th percentile and the
    maximum value is treated as the 100th percentile.
    r(zn must be at least 1rfz"must have at least two data pointsZ	inclusiveruzUnknown method: N)rr7rR�range�appendrN)
r9r,rvZld�m�resultrT�jZdeltaZinterpolatedr&r&r'rls4$
$$cs��dk	r,t�fdd�|D��\}}}||fSt|��t�fdd�|D��\}}}t�fdd�|D��\}}}||kr|||ks�t�||dt|�8}|dkr�td|��||fS)	a;Return sum of square deviations of sequence data.

    If ``c`` is None, the mean is calculated in one pass, and the deviations
    from the mean are calculated in a second pass. Otherwise, deviations are
    calculated from ``c`` as given. Use the second case with care, as it can
    lead to garbage results.
    Nc3s|]}|�dVqdS�rfNr&rb��cr&r'r-�sz_ss.<locals>.<genexpr>c3s|]}|�dVqdSr|r&rbr}r&r'r-�sc3s|]}|�VqdSr)r&rbr}r&r'r-�srfrz%negative sum of square deviations: %f)r@rr5rR)r9r~r<r?r;�UZtotal2Zcount2r&r}r'�_ss�sr�cCsLt|�|krt|�}t|�}|dkr,td��t||�\}}t||d|�S)a�Return the sample variance of data.

    data should be an iterable of Real-valued numbers, with at least two
    values. The optional argument xbar, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function when your data is a sample from a population. To
    calculate the variance from the entire population, see ``pvariance``.

    Examples:

    >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
    >>> variance(data)
    1.3720238095238095

    If you have already calculated the mean of your data, you can pass it as
    the optional second argument ``xbar`` to avoid recalculating it:

    >>> m = mean(data)
    >>> variance(data, m)
    1.3720238095238095

    This function does not check that ``xbar`` is actually the mean of
    ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
    impossible results.

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('31.01875')

    >>> from fractions import Fraction as F
    >>> variance([F(1, 6), F(1, 2), F(5, 3)])
    Fraction(67, 108)

    rfz*variance requires at least two data pointsr(�r\r]rRrr�rQ)r9�xbarr,r<�ssr&r&r'r�s&cCsHt|�|krt|�}t|�}|dkr,td��t||�\}}t|||�S)a,Return the population variance of ``data``.

    data should be a sequence or iterable of Real-valued numbers, with at least one
    value. The optional argument mu, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function to calculate the variance from the entire population.
    To estimate the variance from a sample, the ``variance`` function is
    usually a better choice.

    Examples:

    >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
    >>> pvariance(data)
    1.25

    If you have already calculated the mean of the data, you can pass it as
    the optional second argument to avoid recalculating it:

    >>> mu = mean(data)
    >>> pvariance(data, mu)
    1.25

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('24.815')

    >>> from fractions import Fraction as F
    >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
    Fraction(13, 72)

    r(z*pvariance requires at least one data pointr�)r9�mur,r<r�r&r&r'r�s#cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the sample variance.

    See ``variance`` for arguments and other details.

    >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    1.0810874155219827

    N)rrrArB)r9r��varr&r&r'rs
	

cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the population variance.

    See ``pvariance`` for arguments and other details.

    >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    0.986893273527251

    N)rrrArB)r9r�r�r&r&r'r
&s
	

cCs|d}t|�dkr�d||}d|d|d|d|d|d	|d
|d|}d|d
|d|d|d|d|d|d}||}|||S|dkr�|nd|}tt|��}|dk�r^|d}d|d|d|d|d|d|d|d}d|d |d!|d"|d#|d$|d%|d}n�|d}d&|d'|d(|d)|d*|d+|d,|d-}d.|d/|d0|d1|d2|d3|d4|d}||}|dk�r�|}|||S)5N��?g333333�?g��Q��?g^�}o)��@g�E.k�R�@g ��Ul�@g*u��>l�@g�N����@g�"]Ξ@gnC���`@gu��@giK��~j�@gv��|E�@g��d�|1�@gfR��r��@g��u.2�@g���~y�@g�n8(E@��?�g@g�������?g鬷�ZaI?gg�El�D�?g7\�����?g�uS�S�?g�=�.
@gj%b�@g���Hw�@gjR�e�?g�9dh?
>g('߿��A?g��~z �?g@�3��?gɅ3��?g3fR�x�?gI�F��l@g����t��>g*�Y��n�>gESB\T?g�N;A+�?g�UR1��?gE�F���?gP�n��@g&�>���@g����i�<g�@�F�>g�tcI,\�>g�ŝ���I?g*F2�v�?g�C4�?g��O�1�?)rrr)�pr��sigma�q�rZnumZdenrCr&r&r'�_normal_dist_inv_cdf9sd���������������������������
��������������������������	��������������������������
r�c@s�eZdZdZddd�Zd8dd�Zed	d
��Zdd�d
d�Zdd�Z	dd�Z
dd�Zd9dd�Zdd�Z
edd��Zedd��Zedd��Zed d!��Zed"d#��Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZeZd0d1�ZeZd2d3�Zd4d5�Zd6d7�ZdS):rz(Normal distribution of a random variablez(Arithmetic mean of a normal distributionz+Standard deviation of a normal distribution)�_mu�_sigmar�r�cCs(|dkrtd��t|�|_t|�|_dS)zDNormalDist where mu is the mean and sigma is the standard deviation.r�zsigma must be non-negativeN)rrFr�r�)�selfr�r�r&r&r'�__init__�s
zNormalDist.__init__cCs.t|ttf�st|�}t|�}||t||��S)z5Make a normal distribution instance from sample data.)rcr]�tuplerr)�clsr9r�r&r&r'�from_samples�szNormalDist.from_samplesN)�seedcsB|dkrtjn
t�|�j�|j|j�����fdd�t|�D�S)z=Generate *n* samples for a given mean and standard deviation.Ncsg|]}�����qSr&r&�r*rT��gaussr�r�r&r'�
<listcomp>�sz&NormalDist.samples.<locals>.<listcomp>)�randomr�ZRandomr�r�rw)r�r,r�r&r�r'�samples�szNormalDist.samplescCs<|jd}|std��t||jdd|�tt|�S)z4Probability density function.  P(x <= X < x+dx) / dx�@z$pdf() not defined when sigma is zerog�)r�rrr�rr)r�rCrr&r&r'�pdf�s
zNormalDist.pdfcCs2|jstd��ddt||j|jtd��S)z,Cumulative distribution function.  P(X <= x)z$cdf() not defined when sigma is zeror�r�r�)r�rrr�r)r�rCr&r&r'�cdf�szNormalDist.cdfcCs:|dks|dkrtd��|jdkr*td��t||j|j�S)aSInverse cumulative distribution function.  x : P(X <= x) = p

        Finds the value of the random variable such that the probability of
        the variable being less than or equal to that value equals the given
        probability.

        This function is also called the percent point function or quantile
        function.
        r�r�z$p must be in the range 0.0 < p < 1.0z-cdf() not defined when sigma at or below zero)rr�r�r�)r�r�r&r&r'�inv_cdf�s


zNormalDist.inv_cdfrtcs��fdd�td��D�S)anDivide into *n* continuous intervals with equal probability.

        Returns a list of (n - 1) cut points separating the intervals.

        Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
        Set *n* to 100 for percentiles which gives the 99 cuts points that
        separate the normal distribution in to 100 equal sized groups.
        csg|]}��|���qSr&)r�r��r,r�r&r'r��sz(NormalDist.quantiles.<locals>.<listcomp>r()rw)r�r,r&r�r'r�s	zNormalDist.quantilescCst|t�std��||}}|j|jf|j|jfkr>||}}|j|j}}|rT|s\td��||}t|j|j�}|s�dt|d|jt	d��S|j||j|}|j|jt	|d|t
||��}	||	|}
||	|}dt|�|
�|�|
��t|�|�|�|��S)a�Compute the overlapping coefficient (OVL) between two normal distributions.

        Measures the agreement between two normal probability distributions.
        Returns a value between 0.0 and 1.0 giving the overlapping area in
        the two underlying probability density functions.

            >>> N1 = NormalDist(2.4, 1.6)
            >>> N2 = NormalDist(3.2, 2.0)
            >>> N1.overlap(N2)
            0.8035050657330205
        z$Expected another NormalDist instancez(overlap() not defined when sigma is zeror�r�)rcrrGr�r�rrrrrrr�)r��other�X�YZX_varZY_varZdvZdmrS�b�x1�x2r&r&r'�overlap�s"


(zNormalDist.overlapcCs|jS)z+Arithmetic mean of the normal distribution.�r��r�r&r&r'r�szNormalDist.meancCs|jS)z,Return the median of the normal distributionr�r�r&r&r'r�szNormalDist.mediancCs|jS)z�Return the mode of the normal distribution

        The mode is the value x where which the probability density
        function (pdf) takes its maximum value.
        r�r�r&r&r'r�szNormalDist.modecCs|jS)z.Standard deviation of the normal distribution.�r�r�r&r&r'r�szNormalDist.stdevcCs
|jdS)z!Square of the standard deviation.r�r�r�r&r&r'rszNormalDist.variancecCs8t|t�r&t|j|jt|j|j��St|j||j�S)ajAdd a constant or another NormalDist instance.

        If *other* is a constant, translate mu by the constant,
        leaving sigma unchanged.

        If *other* is a NormalDist, add both the means and the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        �rcrr�rr��r�r�r&r&r'�__add__	s

zNormalDist.__add__cCs8t|t�r&t|j|jt|j|j��St|j||j�S)asSubtract a constant or another NormalDist instance.

        If *other* is a constant, translate by the constant mu,
        leaving sigma unchanged.

        If *other* is a NormalDist, subtract the means and add the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        r�r�r&r&r'�__sub__s

zNormalDist.__sub__cCst|j||jt|��S)z�Multiply both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        �rr�r�rr�r&r&r'�__mul__%szNormalDist.__mul__cCst|j||jt|��S)z�Divide both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        r�r�r&r&r'�__truediv__-szNormalDist.__truediv__cCst|j|j�S)zReturn a copy of the instance.�rr�r��r�r&r&r'�__pos__5szNormalDist.__pos__cCst|j|j�S)z(Negates mu while keeping sigma the same.r�r�r&r&r'�__neg__9szNormalDist.__neg__cCs
||S)z<Subtract a NormalDist from a constant or another NormalDist.r&r�r&r&r'�__rsub__?szNormalDist.__rsub__cCs&t|t�stS|j|jko$|j|jkS)zFTwo NormalDist objects are equal if their mu and sigma are both equal.)rcr�NotImplementedr�r�r�r&r&r'�__eq__Es
zNormalDist.__eq__cCst|j|jf�S)zCNormalDist objects hash equal if their mu and sigma are both equal.)�hashr�r�r�r&r&r'�__hash__KszNormalDist.__hash__cCs t|�j�d|j�d|j�d�S)Nz(mu=z, sigma=�))r2r#r�r�r�r&r&r'�__repr__OszNormalDist.__repr__)r�r�)rt) r#r$r%�__doc__�	__slots__r��classmethodr�r�r�r�r�rr��propertyrrrrrr�r�r�r�r�r��__radd__r��__rmul__r�r�r�r&r&r&r'r�sF�


"




)r��__main__)�isclose)�add�sub�mul�truediv)�repeat�
������i��z
Test z with another NormalDist:�z with a constant:�z
Test constant with �:cCs@t|j|jdd�st||f��t|j|jdd�s<t||f��dS)Ng{�G�z�?)Zrel_tol)r�rr5r)�G1�G2r&r&r'�assert_closesr�i�����I��/g`@@cCsg|]}|t�qSr&��srbr&r&r'r��sr�cCsg|]}|t�qSr&r�rbr&r&r'r��scCsg|]}|t�qSr&r�rbr&r&r'r��scCsg|]}|t�qSr&r�rbr&r&r'r��scCsg|]\}}||�qSr&r&�r*rC�yr&r&r'r��scCsg|]\}}||�qSr&r&r�r&r&r'r��s)r)rY)r()N)N)N)N)N)Sr��__all__rBrdr�Z	fractionsrZdecimalr�	itertoolsrZbisectrrrrrrrrrr �operatorr!�collectionsr"rNrr@r4r0r.rQrUrXr[rrrrrr
r	rrrrr�rrrr
r�rZ_statistics�ImportErrorr#r�r�r�r�r�r�ZdoctestZg1Zg2r5r,r�r�r��func�printr�r3Zconstr�r�r�r�rH�zipZtestmodr&r&r&r'�<module>s�S�(
: 

/
779

/
,

JQ






�
�
linecache.cpython-38.pyc000064400000007435151450073350011123 0ustar00U

e5d��@sndZddlZddlZddlZddlZdddgZddd�Ziadd�Zddd	�Z	dd
d�Z
ddd�Zd
d�ZdS)z�Cache lines from Python source files.

This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
�N�getline�
clearcache�
checkcachecCs:t||�}d|kr"t|�kr2nn||dSdSdS)N��)�getlines�len)�filename�lineno�module_globals�lines�r
�!/usr/lib64/python3.8/linecache.pyrs
cCsiadS)zClear the cache entirely.N)�cacher
r
r
rrscCsX|tkr(t|}t|�dkr(t|dSzt||�WStk
rRt�gYSXdS)z�Get the lines for a Python source file from the cache.
    Update the cache if it doesn't contain an entry for this file already.r�N)rr�updatecache�MemoryErrorr)r	r�entryr
r
rr%src	Cs�|dkrtt���}n|tkr&|g}ndS|D]�}t|}t|�dkrHq.|\}}}}|dkr^q.zt�|�}Wn$tk
r�t�|d�Yq.YnX||jks�||j	kr.t�|d�q.dS)zUDiscard cache entries that are out of date.
    (This is not checked upon each call!)Nr)
�listr�keysr�os�stat�OSError�pop�st_size�st_mtime)r	�	filenamesr�size�mtimer�fullnamerr
r
rr5s&
c
Cs�|tkr$tt|�dkr$t�|d�|r<|�d�r@|�d�r@gS|}zt�|�}W�ntk
�rn|}t||�r�zt|d�}Wnt	tfk
r�YnDX|dkr�gYSt|�ddd�|�
�D�|ft|<t|dYStj�|�r�gYSt
jD]d}ztj�||�}Wnttfk
�r0Yq�YnXzt�|�}W�qjWq�tk
�r^Yq�Xq�gYSYnXz"t�|��}|��}W5QRXWntk
�r�gYSX|�r�|d	�d
��s�|d	d
7<|j|j}	}
|	|
||ft|<|S)z�Update a cache entry and return its list of lines.
    If something's wrong, print a message, discard the cache entry,
    and return an empty list.rN�<�>rcSsg|]}|d�qS)�
r
)�.0�liner
r
r�
<listcomp>qszupdatecache.<locals>.<listcomp>r���r")rrr�
startswith�endswithrrr�	lazycache�ImportError�
splitlines�path�isabs�sys�join�	TypeError�AttributeError�tokenize�open�	readlinesrr)r	rrr�basename�data�dirname�fprrrr
r
rrRs\
�



rcCs�|tkr tt|�dkrdSdS|r8|�d�r<|�d�r<dS|r�d|kr�|�d�}|d}t|dd	�}|r�|r�t�||�}|ft|<dSdS)
a�Seed the cache for filename with module_globals.

    The module loader will be asked for the source only when getlines is
    called, not immediately.

    If there is an entry in the cache already, it is not altered.

    :return: True if a lazy load is registered in the cache,
        otherwise False. To register such a load a module loader with a
        get_source method must be found, the filename must be a cachable
        filename, and the filename must not be already cached.
    rTFr r!�
__loader__�__name__�
get_sourceN)rrr'r(�get�getattr�	functools�partial)r	r�name�loaderr;�	get_linesr
r
rr)�s


r))N)N)N)N)
�__doc__r>r.rr2�__all__rrrrrrr)r
r
r
r�<module>s




Adatetime.cpython-38.opt-1.pyc000064400000155202151450073350011737 0ustar00U

e5d�X�
@sVdZddlZddlZddlZdd�ZdZdZdZ	dd	d
d	dd	dd	d	dd	dd	g
Z
dgZdZe
dd�D]Z
e�e�ee
7Zqd[[
dd
�Zdd�Zdd�Zdd�Zdd�Zed�Zed�Zed�Zdd�Zddddddd d!d"d#d$d%d&g
Zdd'd(d)d*d+d,d-gZd.d/�Zdid1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(GdMdN�dN�Z)e)dO�e)_*e)dPdQdRdRdSdT�e)_+e)ddU�e)_,GdVdW�dW�Z-e-Z.e-ddd�e-_*e-ddXd	�e-_+e)ddY�e-_,GdZd[�d[�Z/e/Z0Gd\d]�d]�ZeZ1eddd�e_*edQdRdRdS�e_+e)ddU�e_,Gd^d_�d_e-�Z2e2ddd�e2_*e2ddXd	dQdRdRdS�e2_+e)ddU�e2_,d`da�Z3Gdbdc�dce/�Z4e4�5e)d��e4_6e4�5e)dQdRdd��e4_*e4�5e)dQdRdd��e4_+e2dedde4j6df�Z7zddgl8TWne9k
�r�YnXX[[[
[[[[7[	[[[$[#[%[&[!["[['[.[[[[[[[3[[[[1[0[[[([[ [ddhl8mZdS)jz�Concrete date/time and related types.

See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
�NcCs||krdS||krdSdS)Nr�������x�yrr� /usr/lib64/python3.8/datetime.py�_cmpsr	ri'i۹7r���cCs$|ddko"|ddkp"|ddkS)zyear -> 1 if leap year, else 0.�r�d�r)�yearrrr�_is_leap%srcCs(|d}|d|d|d|dS)z2year -> number of days before January 1st of year.r�mr
rrr)rrrrr�_days_before_year)srcCs|dkrt|�rdSt|S)z9year, month -> number of days in that month in that year.��)r�_DAYS_IN_MONTH�r�monthrrr�_days_in_month.srcCst||dkot|�S)zCyear, month -> number of days in year preceding first day of month.r)�_DAYS_BEFORE_MONTHrrrrr�_days_before_month5srcCs t||�}t|�t||�|S)z>year, month, day -> ordinal, considering 01-Jan-0001 as day 1.)rrr�rr�day�dimrrr�_ymd2ord:s
��ri��e�c	Cs�|d8}t|t�\}}|dd}t|t�\}}t|t�\}}t|d�\}}||d|d|7}|dkst|dkr�|dddfS|dko�|d	kp�|dk}|d
d?}t||dko�|}||kr�|d8}|t||dko�|8}||8}|||dfS)
z@ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.rrrrr
�r
���2r!r)�divmod�_DI400Y�_DI100Y�_DI4Yrr)	�nZn400rZn100Zn4Zn1ZleapyearrZ	precedingrrr�_ord2ymdSs"r+ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecZMonZTueZWedZThuZFriZSatZSunc	Cs>t|||�dd}t||�|}t�|||||||||f	�S)N��)rr�_time�struct_time)	r�m�d�hh�mm�ssZdstflagZwdayZdnumrrr�_build_struct_time�sr5�autocCstdddddd�}|dkr&|r dnd	}n|d
kr6|d}z||}Wntk
r^td��YnX|�||||�SdS)
Nz{:02d}z
{:02d}:{:02d}z{:02d}:{:02d}:{:02d}z{:02d}:{:02d}:{:02d}.{:03d}z{:02d}:{:02d}:{:02d}.{:06d})�hours�minutes�seconds�milliseconds�microsecondsr6r;r9r:��zUnknown timespec value)�KeyError�
ValueError�format)r2r3r4�us�timespecZspecs�fmtrrr�_format_time�s�rCcCs�d}|dk	r�|jdkr"d}|}nd}t|tdd��\}}t|tdd��\}}|d|||f7}|sj|jr�|d	|j7}|jr�|d
|j7}|S)N�r�-�+r�r7�r8z%s%02d:%02dz:%02d�.%06d)�daysr&�	timedeltar;r9)�off�s�signr2r3r4rrr�_format_offset�s

rOcCs�d}d}d}g}|j}dt|�}}	||	k�r�||}
|d7}|
dk�r�||	k�r�||}
|d7}|
dkr�|dkr�dt|dd�}|�|��q�|
dk�r^|dk�rRd}t|d	��rR|��}|dk	�rRd
}|jdkr�|}d}t|tdd��\}
}t|tdd
��\}}|j}|j	}|�r,d||
|||f}n&|�rDd||
||f}nd||
|f}|�|�n^|
dk�r�|dk�r�d}t|d��r�|�
�}|dk	�r�|�dd�}|�|�n|d�||
�n|d�q$||
�q$d�|�}t
�||�S)Nrr�%�fz%06d�microsecond�zrD�	utcoffsetrFrErGrHz%c%02d%02d%02d.%06dz%c%02d%02d%02dz
%c%02d%02d�Z�tznamez%%)�append�len�getattr�hasattrrTrJr&rKr9r;rV�replace�joinr.�strftime)�objectr?�	timetupleZfreplaceZzreplaceZZreplaceZ	newformat�push�ir*Zch�offsetrN�h�restr0rM�urrr�_wrap_strftime�sl


�










rfcCsjt|dd��}|ddkr,td|d��t|dd��}|ddkrPtd��t|dd	��}|||gS)
Nrr
rEzInvalid date separator: %sr!r-zInvalid date separator��
)�intr>)Zdtstrrrrrrr�_parse_isoformat_datesrjcCs
t|�}ddddg}d}tdd�D]t}||dkr:td��t|||d��||<|d7}|||d�}|rv|dkrzq�|dkr�td|��|d7}q"||k�r||dkr�td	��nN|d7}||}|d
kr�td	��t||d��|d<|dk�r|dd9<|S)Nrr#rzIncomplete time componentr�:zInvalid time separator: %c�.zInvalid microsecond component)r#r,r<)rX�ranger>ri)�tstr�len_str�
time_comps�pos�compZ	next_charZ
len_remainderrrr�_parse_hh_mm_ss_ffs2



rsc
Cs�t|�}|dkrtd��|�d�dp2|�d�d}|dkrL|d|d�n|}t|�}d}|dkr�||d�}t|�dkr�td��t|�}td	d
�|D��r�tj}nD||ddkr�dnd}t|d|d|d|dd
�}	t||	�}|�|�|S)NrzIsoformat time too shortrErrFr)r!rg�zMalformed time zone stringcss|]}|dkVqdS)rNr)�.0rrrr�	<genexpr>Tsz(_parse_isoformat_time.<locals>.<genexpr>rr#�r7r8r9r;)	rXr>�findrs�all�timezone�utcrKrW)
rnroZtz_posZtimestrrpZtziZtzstrZtz_compsZtzsignZtdrrr�_parse_isoformat_time;s,�
r|cCs&|dk	r"t|t�s"tdt|���dS)Nz4tzinfo.tzname() must return None or string, not '%s')�
isinstance�str�	TypeError�type)�namerrr�
_check_tznameds�r�cCs^|dkrdSt|t�s*td|t|�f��td�|krHtd�ksZntd||f��dS)Nz3tzinfo.%s() must return None or timedelta, not '%s'rzN%s()=%s, must be strictly between -timedelta(hours=24) and timedelta(hours=24))r}rKrr�r>)r�rbrrr�_check_utc_offsetos

� �r�cCs�t|t�r|St|t�r td��z|��}Wntk
r@Yn"Xt|t�s^tdt|�j��|S|}z|��}Wntk
r�YnDXt|t�s�tdt|�j��ddl	}|j
dt|�jtdd�|Stdt|�j��dS)Nz$integer argument expected, got floatz$__index__ returned non-int (type %s)z"__int__ returned non-int (type %s)rz$an integer is required (got type %s)r)�
stacklevel)r}ri�floatr�	__index__�AttributeErrorr��__name__�__int__�warnings�warn�DeprecationWarning)�valueZorigr�rrr�_check_int_field{sB


�
����r�cCs�t|�}t|�}t|�}t|kr,tks@ntdttf|��d|krTdks`ntd|��t||�}d|kr~|ks�ntd||��|||fS)Nzyear must be in %d..%drr"zmonth must be in 1..12zday must be in 1..%d)r��MINYEAR�MAXYEARr>rrrrr�_check_date_fields�s

r�cCs�t|�}t|�}t|�}t|�}d|kr4dks@ntd|��d|krTdks`ntd|��d|krtdks�ntd|��d|kr�dks�ntd|��|d	kr�td
|��|||||fS)Nr�zhour must be in 0..23�;zminute must be in 0..59zsecond must be in 0..59�?Bz microsecond must be in 0..999999)rrzfold must be either 0 or 1)r�r>)�hour�minute�secondrR�foldrrr�_check_time_fields�s




r�cCs|dk	rt|t�std��dS)Nz4tzinfo argument must be None or of a tzinfo subclass)r}�tzinfor)�tzrrr�_check_tzinfo_arg�sr�cCs tdt|�jt|�jf��dS)Nzcan't compare '%s' to '%s')rr�r�rrrr�	_cmperror�s�r�cCsRt||�\}}|d9}|dkr&||kn||k}|sF||krN|ddkrN|d7}|S)z�divide a by b and round result to the nearest integer

    When the ratio is exactly half-way between two integers,
    the even integer is returned.
    rrr)r&)�a�b�q�rZgreater_than_halfrrr�_divide_and_round�sr�c@seZdZdZdZd?dd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
e	dd��Ze	dd��Zdd�Z
e
Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"d:d;�Z#d<d=�Z$d>S)@rKa�Represent the difference between two datetime objects.

    Supported operators:

    - add, subtract timedelta
    - unary plus, minus, abs
    - compare to timedelta
    - multiply, divide by int

    In addition, datetime supports subtraction of two datetime objects
    returning a timedelta, and addition or subtraction of a datetime
    and a timedelta giving a datetime.

    Representation: (days, seconds, microseconds).  Why?  Because I
    felt like it.
    )�_days�_seconds�
_microseconds�	_hashcodercCs�d}}	}
||d7}||d|d7}||d7}t|t�rtt�|�\}}t�|d�\}}
t|
�}	t|�}nd}|}t|t�r�t�|�\}}t|�}||7}n|}t|d�\}}||7}|	t|�7}	|d	}t|t��rt||�}t|d
�\}}t|d�\}}||7}|	|7}	n@t|�}t|d
�\}}t|d�\}}||7}|	|7}	t||�}t|d
�\}}
|	|7}	t|	d�\}}	||7}t|�dk�r�td|��t	�
|�}||_|	|_|
|_
d
|_|S)Nrr-�<�r<g�@g�Q���.A�@B�ɚ;z$timedelta # of days is too large: %dr)r}r��_math�modfrir&�round�abs�
OverflowErrorr^�__new__r�r�r�r�)�clsrJr9r;r:r8r7Zweeksr1rMr@ZdayfracZdaysecondsfracZdaysecondswholeZsecondsfracZusdouble�selfrrrr��sZ




ztimedelta.__new__cCspg}|jr|�d|j�|jr0|�d|j�|jrF|�d|j�|sT|�d�d|jj|jjd�|�fS)Nzdays=%dz
seconds=%dzmicroseconds=%d�0�	%s.%s(%s)�, )r�rWr�r��	__class__�
__module__�__qualname__r\)r��argsrrr�__repr__Ms
�ztimedelta.__repr__cCsdt|jd�\}}t|d�\}}d|||f}|jrLdd�}d||j�|}|jr`|d|j}|S)Nr�z%d:%02d:%02dcSs|t|�dkrdpdfS)NrrMrD)r�)r*rrr�plural`sz!timedelta.__str__.<locals>.pluralz
%d day%s, rI)r&r�r�r�)r�r3r4r2rMr�rrr�__str__[sztimedelta.__str__cCs|jd|jd|jdS)zTotal seconds in the duration.r�r�)rJr9r;�r�rrr�
total_secondsgs
��ztimedelta.total_secondscCs|jS�rJ�r�r�rrrrJmsztimedelta.dayscCs|jS�r9)r�r�rrrr9rsztimedelta.secondscCs|jS�r;)r�r�rrrr;wsztimedelta.microsecondscCs2t|t�r.t|j|j|j|j|j|j�StS�N�r}rKr�r�r��NotImplemented�r��otherrrr�__add__|s


�ztimedelta.__add__cCs2t|t�r.t|j|j|j|j|j|j�StSr�r�r�rrr�__sub__�s


�ztimedelta.__sub__cCst|t�r||StSr�)r}rKr�r�rrr�__rsub__�s

ztimedelta.__rsub__cCst|j|j|j�Sr�)rKr�r�r�r�rrr�__neg__�s�ztimedelta.__neg__cCs|Sr�rr�rrr�__pos__�sztimedelta.__pos__cCs|jdkr|S|SdS�Nrr�r�rrr�__abs__�s
ztimedelta.__abs__cCs`t|t�r(t|j||j||j|�St|t�r\|��}|��\}}tddt	|||��St
Sr�)r}rirKr�r�r�r��_to_microseconds�as_integer_ratior�r��r�r��usecr�r�rrr�__mul__�s

�
ztimedelta.__mul__cCs|jd|jd|jS)Nr�r��r�r�r�r�rrrr��s�ztimedelta._to_microsecondscCsNt|ttf�stS|��}t|t�r0||��St|t�rJtdd||�SdSr�)r}rirKr�r�)r�r�r�rrr�__floordiv__�s

ztimedelta.__floordiv__cCs~t|tttf�stS|��}t|t�r2||��St|t�rNtddt||��St|t�rz|��\}}tddt|||��SdSr�)r}rir�rKr�r�r�r�r�rrr�__truediv__�s


ztimedelta.__truediv__cCs*t|t�r&|��|��}tdd|�StSr�)r}rKr�r�)r�r�r�rrr�__mod__�s
ztimedelta.__mod__cCs4t|t�r0t|��|���\}}|tdd|�fStSr�)r}rKr&r�r�)r�r�r�r�rrr�
__divmod__�s
�ztimedelta.__divmod__cCs t|t�r|�|�dkStSdSr��r}rKr	r�r�rrr�__eq__�s
ztimedelta.__eq__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__le__�s
ztimedelta.__le__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__lt__�s
ztimedelta.__lt__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__ge__�s
ztimedelta.__ge__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__gt__�s
ztimedelta.__gt__cCst|��|���Sr�)r	�	_getstater�rrrr	�sztimedelta._cmpcCs|jdkrt|���|_|jS)Nr�r��hashr�r�rrr�__hash__�s
ztimedelta.__hash__cCs|jdkp|jdkp|jdkSr�r�r�rrr�__bool__s

��ztimedelta.__bool__cCs|j|j|jfSr�r�r�rrrr�
sztimedelta._getstatecCs|j|��fSr��r�r�r�rrr�
__reduce__
sztimedelta.__reduce__N)rrrrrrr)%r�r�r��__doc__�	__slots__r�r�r�r��propertyrJr9r;r��__radd__r�r�r�r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�rrrrrK�sR�
e


		
		rKi6e�r�r�r�r�)rJr7r8r9r;r�c@s@eZdZdZdZdDdd�Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�ZeZedd��Zedd��Zedd��Zd d!�Zd"d#�ZdEd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(dS)F�datea�Concrete date type.

    Constructors:

    __new__()
    fromtimestamp()
    today()
    fromordinal()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__
    __add__, __radd__, __sub__ (add/radd only with timedelta arg)

    Methods:

    timetuple()
    toordinal()
    weekday()
    isoweekday(), isocalendar(), isoformat()
    ctime()
    strftime()

    Properties (readonly):
    year, month, day
    )�_year�_month�_dayr�NcCs�|dkr�t|ttf�r�t|�dkr�dt|dd��krBdkr�nnTt|t�r|z|�d�}Wntk
rztd��YnXt�	|�}|�
|�d	|_|St|||�\}}}t�	|�}||_
||_||_d	|_|S)
zVConstructor.

        Arguments:

        year, month, day (required, base 1)
        Nr
rrr#r"�latin1znFailed to encode latin1 string when unpickling a date object. pickle.load(data, encoding='latin1') is assumed.r)r}�bytesr~rX�ord�encode�UnicodeEncodeErrorr>r^r��_date__setstater�r�r�r�r�)r�rrrr�rrrr�3s8�
���

�



zdate.__new__c	Cs(t�|�\	}}}}}}}}	}
||||�S)z;Construct a date from a POSIX timestamp (like time.time()).)r.�	localtime)r��trr0r1r2r3r4�weekday�jday�dstrrr�
fromtimestampUszdate.fromtimestampcCst��}|�|�S)z"Construct a date from time.time().�r.�timer��r�r�rrr�today[sz
date.todaycCst|�\}}}||||�S)z�Construct a date from a proleptic Gregorian ordinal.

        January 1 of year 1 is day 1.  Only the year, month and day are
        non-zero in the result.
        )r+)r�r*rr0r1rrr�fromordinalaszdate.fromordinalcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS)z5Construct a date from the output of date.isoformat().�#fromisoformat: argument must be str�Invalid isoformat string: N)r}r~rrj�	Exceptionr>)r��date_stringrrr�
fromisoformatks
zdate.fromisoformatc	Cs�t|krtks$ntd|����d|kr8dks�nd}|dkrrt|dd�d}|dksn|dkrrt|�rrd	}|r�td
|����d|kr�dks�ntd|�d
���|dd|d}t|�}||}|t|��S)z|Construct a date from the ISO year, week number and weekday.

        This is the inverse of the date.isocalendar() functionzYear is out of range: r�5Trr-r
r#FzInvalid week: rgzInvalid weekday: z (range is [1, 7]))r�r�r>rr�_isoweek1mondayr+)	r�r�weekrZout_of_rangeZ
first_weekdayZ
day_offsetZday_1Zord_dayrrr�fromisocalendarws$�zdate.fromisocalendarcCs d|jj|jj|j|j|jfS)a5Convert to formal string, for repr().

        >>> dt = datetime(2010, 1, 1)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0)'

        >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
        z%s.%s(%d, %d, %d))r�r�r�r�r�r�r�rrrr��s�z
date.__repr__cCs.|��dpd}dt|t|j|j|jfS)�Return ctime() style string.r-z%s %s %2d 00:00:00 %04d)�	toordinal�	_DAYNAMES�_MONTHNAMESr�r�r��r�r�rrr�ctime�s�z
date.ctimecCst|||���S)zFormat using strftime().)rfr_�r�rBrrrr]�sz
date.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�S�Nzmust be str, not %sr�r}r~rr�r�rXr]rrrr�
__format__�s


zdate.__format__cCsd|j|j|jfS)z�Return the date formatted according to ISO.

        This is 'YYYY-MM-DD'.

        References:
        - http://www.w3.org/TR/NOTE-datetime
        - http://www.cl.cam.ac.uk/~mgk25/iso-time.html
        z%04d-%02d-%02d)r�r�r�r�rrr�	isoformat�s	zdate.isoformatcCs|jS)z
year (1-9999))r�r�rrrr�sz	date.yearcCs|jS)zmonth (1-12))r�r�rrrr�sz
date.monthcCs|jS)z
day (1-31))r�r�rrrr�szdate.daycCst|j|j|jdddd�S)�9Return local time tuple compatible with time.localtime().rr)r5r�r�r�r�rrrr_�s�zdate.timetuplecCst|j|j|j�S)z�Return proleptic Gregorian ordinal for the year, month and day.

        January 1 of year 1 is day 1.  Only the year, month and day values
        contribute to the result.
        )rr�r�r�r�rrrr�szdate.toordinalcCs:|dkr|j}|dkr|j}|dkr*|j}t|�|||�S)z;Return a new date with new values for the specified fields.N)r�r�r�r�)r�rrrrrrr[�szdate.replacecCst|t�r|�|�dkStSr��r}r�r	r�r�rrrr��s
zdate.__eq__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__le__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__lt__cCst|t�r|�|�dkStSr�rr�rrrr�
s
zdate.__ge__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__gt__cCsB|j|j|j}}}|j|j|j}}}t|||f|||f�Sr�)r�r�r�r	)r�r�rr0r1Zy2Zm2Zd2rrrr	sz	date._cmpcCs|jdkrt|���|_|jS)�Hash.rr�r�rrrr�s
z
date.__hash__cCsJt|t�rF|��|j}d|kr,tkr>nnt|��|�Std��tS)zAdd a date to a timedelta.r�result out of range)	r}rKrrJ�_MAXORDINALr�rr�r�)r�r��orrrr�%s
zdate.__add__cCsDt|t�r|t|j�St|t�r@|��}|��}t||�StS)z.Subtract two dates, or a date and a timedelta.)r}rKrJr�rr�)r�r��days1�days2rrrr�0s

zdate.__sub__cCs|��ddS)z:Return day of the week, where Monday == 0 ... Sunday == 6.r,r-�rr�rrrr�:szdate.weekdaycCs|��dpdS)z:Return day of the week, where Monday == 1 ... Sunday == 7.r-rr�rrr�
isoweekday@szdate.isoweekdaycCs�|j}t|�}t|j|j|j�}t||d�\}}|dkr^|d8}t|�}t||d�\}}n$|dkr�|t|d�kr�|d7}d}||d|dfS)a�Return a 3-tuple containing ISO year, week number, and weekday.

        The first ISO week of the year is the (Mon-Sun) week
        containing the year's first Thursday; everything else derives
        from that.

        The first week is 1; Monday is 1 ... Sunday is 7.

        ISO calendar algorithm taken from
        http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
        (used with permission)
        r-rr�4)r�rrr�r�r&)r�r�week1mondayrr	rrrr�isocalendarEs
zdate.isocalendarcCs&t|jd�\}}t|||j|jg�fS�N�)r&r�r�r�r�)r��yhi�ylorrrr�cszdate._getstatecCs"|\}}|_|_|d||_dSr#)r�r�r�)r��stringr%r&rrr�
__setstategszdate.__setstatecCs|j|��fSr�r�r�rrrr�kszdate.__reduce__)NN)NNN))r�r�r�r�r�r��classmethodr�rrrr
r�rr]rrr�r�rrrr_rr[r�r�r�r�r�r	r�r�r�r�r�rr"r�r�r�rrrrr�sX
"


	

$



	
r�r"r�c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r�z}Abstract base class for time zone info classes.

    Subclasses must override the name(), utcoffset() and dst() methods.
    rcCstd��dS)z%datetime -> string name of time zone.z&tzinfo subclass must override tzname()N��NotImplementedError�r��dtrrrrV|sz
tzinfo.tznamecCstd��dS)zIdatetime -> timedelta, positive for east of UTC, negative for west of UTCz)tzinfo subclass must override utcoffset()Nr*r,rrrrT�sztzinfo.utcoffsetcCstd��dS)z�datetime -> DST offset as timedelta, positive for east of UTC.

        Return 0 if DST not in effect.  utcoffset() must include the DST
        offset.
        z#tzinfo subclass must override dst()Nr*r,rrrr��sz
tzinfo.dstcCs�t|t�std��|j|k	r$td��|��}|dkr<td��|��}|dkrTtd��||}|r�||7}|��}|dkr�td��||S)z*datetime in UTC -> datetime in local time.z&fromutc() requires a datetime argumentzdt.tzinfo is not selfNz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultz;fromutc(): dt.dst gave inconsistent results; cannot convert)r}�datetimerr�r>rTr�)r�r-ZdtoffZdtdst�deltarrr�fromutc�s"

ztzinfo.fromutccCsft|dd�}|r|�}nd}t|dd�}|r4|�}nt|dd�pBd}|dkrV|j|fS|j||fSdS)N�__getinitargs__r�__getstate__�__dict__)rYr�)r�Zgetinitargsr��getstate�staterrrr��s
ztzinfo.__reduce__N)
r�r�r�r�r�rVrTr�r0r�rrrrr�usr�c@s*eZdZdZdZdBdd�dd�Zedd	��Zed
d��Zedd
��Z	edd��Z
edd��Zedd��Zdd�Z
dd�Zdd�Zdd�Zdd�ZdCdd �Zd!d"�Zd#d$�Zd%d&�ZdDd(d)�ZeZed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEdd�d7d8�ZdFd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dS)Gr�a<Time with time zone.

    Constructors:

    __new__()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__

    Methods:

    strftime()
    isoformat()
    utcoffset()
    tzname()
    dst()

    Properties (readonly):
    hour, minute, second, microsecond, tzinfo, fold
    )�_hour�_minute�_second�_microsecond�_tzinfor��_foldrN�r�cCs�t|ttf�r�t|�dkr�t|dd��d@dkr�t|t�rhz|�d�}Wntk
rftd��YnXt�	|�}|�
||p~d�d	|_|St|||||�\}}}}}t
|�t�	|�}||_||_||_||_||_d	|_||_|S)
z�Constructor.

        Arguments:

        hour, minute (required)
        second, microsecond (default to zero)
        tzinfo (default to None)
        fold (keyword only, default to zero)
        r,rr�r$r�znFailed to encode latin1 string when unpickling a time object. pickle.load(data, encoding='latin1') is assumed.Nr)r}r�r~rXr�r�r�r>r^r��_time__setstater�r�r�r6r7r8r9r:r;)r�r�r�r�rRr�r�r�rrrr��s>
�
�

�
ztime.__new__cCs|jS�zhour (0-23)�r6r�rrrr��sz	time.hourcCs|jS�z
minute (0-59)�r7r�rrrr�sztime.minutecCs|jS�z
second (0-59)�r8r�rrrr�sztime.secondcCs|jS�zmicrosecond (0-999999)�r9r�rrrrRsztime.microsecondcCs|jS�ztimezone info object�r:r�rrrr�sztime.tzinfocCs|jSr��r;r�rrrr�sz	time.foldcCs$t|t�r|j|dd�dkStSdS)NT��allow_mixedr�r}r�r	r�r�rrrr�s
ztime.__eq__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�#s
ztime.__le__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�)s
ztime.__lt__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�/s
ztime.__ge__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�5s
ztime.__gt__Fc
Cs�|j}|j}d}}||kr"d}n|��}|��}||k}|rht|j|j|j|jf|j|j|j|jf�S|dksx|dkr�|r�dStd��|jd|j|tdd�}|jd|j|tdd�}	t||j|jf|	|j|jf�S)NTrz$cannot compare naive and aware timesr�rrH)	r:rTr	r6r7r8r9rrK)
r�r�rK�mytz�ottz�myoff�otoff�base_compareZmyhhmmZothhmmrrrr	;s2����z	time._cmpcCs�|jdkr�|jr|jdd�}n|}|��}|sBt|��d�|_nztt|j|j	d�|tdd��\}}|tdd�}d|kr�dkr�nntt
|||j|j��|_nt|||j|jf�|_|jS)	rrrr<�r7r8rrGrHr$)
r�r�r[rTr�r�r&rKr�r�r�r�rR)r�r��tzoffrcr0rrrr�Ws
�z
time.__hash__cCs|��}t|�S)z=Return formatted timezone offset (+xx:xx) or an empty string.)rTrO)r�rLrrr�_tzstrnsztime._tzstrcCs�|jdkrd|j|jf}n|jdkr2d|j}nd}d|jj|jj|j|j|f}|jdk	rx|dd�d|jd	}|jr�|dd�d
}|S)�%Convert to formal string, for repr().rz, %d, %dz, %drDz%s.%s(%d, %d%s)Nr�, tzinfo=%r�)�	, fold=1))	r9r8r�r�r�r6r7r:r;�r�rMrrrr�ss 

�
z
time.__repr__r6cCs0t|j|j|j|j|�}|��}|r,||7}|S)a�Return the time formatted according to ISO.

        The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
        part is omitted if self.microsecond == 0.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        )rCr6r7r8r9rT)r�rArMr�rrrr�s
�ztime.isoformatcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS)z0Construct a time from the output of isoformat().rrN)r}r~rr|rr>)r�Ztime_stringrrrr�s
ztime.fromisoformatc	Cs(ddd|j|j|jdddf	}t|||�S)z{Format using strftime().  The date part of the timestamp passed
        to underlying strftime should not be used.
        ilrrr)r6r7r8rf)r�rBr_rrrr]�s�z
time.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�Srrrrrrr�s


ztime.__format__cCs(|jdkrdS|j�d�}td|�|S)z^Return the timezone offset as timedelta, positive east of UTC
         (negative west of UTC).NrT�r:rTr��r�rbrrrrT�s


ztime.utcoffsetcCs&|jdkrdS|j�d�}t|�|S�aReturn the timezone name.

        Note that the name is 100% informational -- there's no requirement that
        it mean anything in particular. For example, "GMT", "UTC", "-500",
        "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
        N�r:rVr��r�r�rrrrV�s

ztime.tznamecCs(|jdkrdS|j�d�}td|�|S�aqReturn 0 if DST is not in effect, or the DST offset (as timedelta
        positive eastward) if DST is in effect.

        This is purely informational; the DST offset has already been added to
        the UTC offset returned by utcoffset() if applicable, so there's no
        need to consult dst() unless you're interested in displaying the DST
        info.
        Nr��r:r�r�r[rrrr��s
	

ztime.dstTcCsl|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}t|�||||||d�S)z;Return a new time with new values for the specified fields.NTr<)r�r�r�rRr�r;r�)r�r�r�r�rRr�r�rrrr[�sztime.replacer#cCspt|jd�\}}t|d�\}}|j}|jr:|dkr:|d7}t||j|j|||g�}|jdkrb|fS||jfSdS�Nr$r#�)r&r9r6r;r�r7r8r:)r��protocol�us2�us3�us1rc�	basestaterrrr��s�
ztime._getstatecCst|dk	rt|t�std��|\}|_|_}}}|dkrHd|_|d|_nd|_||_|d>|Bd>|B|_||_dS)N�bad tzinfo state argr=rrbrrg)	r}�
_tzinfo_classrr7r8r;r6r9r:)r�r'r�rcrfrdrerrrr(�sztime.__setstatecCs|j|�|�fSr�r��r�rcrrr�
__reduce_ex__sztime.__reduce_ex__cCs
|�d�S�Nr�rkr�rrrr�sztime.__reduce__)rrrrN)F)r6)NNNNT)r#)$r�r�r�r�r�r�r�r�r�r�rRr�r�r�r�r�r�r�r	r�rTr�rr�r)rr]rrTrVr�r[r�r>rkr�rrrrr��sT(








		
��


r�c@s�eZdZdZejejZdddd�dd�Zedd��Z	ed	d
��Z
edd��Zed
d��Zedd��Z
edd��Zedd��Zededd��Zedd��Zedfdd��Zedd��Zedgdd��Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zdhdd�d0d1�Zd2d3�Zdid4d5�Zd6d7�Zdjd:d;�Z d<d=�Z!d>d?�Z"ed@dA��Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dkdSdT�Z,dUdV�Z-e-Z.dWdX�Z/dYdZ�Z0dld\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4dS)mr.z�datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

    The year, month and day arguments are required. tzinfo may be None, or an
    instance of a tzinfo subclass. The remaining arguments may be ints.
    Nrr<c	Cst|ttf�r�t|�dkr�dt|dd��d@kr>dkr�nnVt|t�rxzt|d�}Wntk
rvtd��YnXt�|�}
|
�	||�d	|
_
|
St|||�\}}}t|||||	�\}}}}}	t
|�t�|�}
||
_||
_||
_||
_||
_||
_||
_||
_d	|
_
|	|
_|
S)
Nrhrrr#r=r"r�zrFailed to encode latin1 string when unpickling a datetime object. pickle.load(data, encoding='latin1') is assumed.r)r}r�r~rXr�r�r>r^r��_datetime__setstater�r�r�r�r�r�r�r6r7r8r9r:r;)r�rrrr�r�r�rRr�r�r�rrrr�sL��

�

�
zdatetime.__new__cCs|jSr?r@r�rrrr�Csz
datetime.hourcCs|jSrArBr�rrrr�Hszdatetime.minutecCs|jSrCrDr�rrrr�Mszdatetime.secondcCs|jSrErFr�rrrrRRszdatetime.microsecondcCs|jSrGrHr�rrrr�Wszdatetime.tzinfocCs|jSr�rIr�rrrr�\sz
datetime.foldc	Cspt�|�\}}t|d�}|dkr4|d7}|d8}n|dkrL|d8}|d7}|rVtjntj}||�\	}}}	}
}}}
}}t|d�}||||	|
||||�}|dk�rbd}||kr�tj�	d�r�|S|||�dd	�\}}}	}
}}||||	|
||||�}||t
d|�}|jdk�rl|||t
dd��dd	�\}}}	}
}}||||	|
||||�}||k�rld|_n
|�
|�}|S)
��Construct a datetime from a POSIX timestamp (like time.time()).

        A timezone info object may be passed in as well.
        r�r�rrr�Nr��winr,)r�r�r�r.�gmtimer��min�sys�platform�
startswithrKrJr;r0)r�r�r{r�Zfracr@Z	converterrr0r1r2r3r4r�r�r��result�max_fold_secondsZprobe1ZtransZprobe2rrr�_fromtimestamp`s4


 *

zdatetime._fromtimestampcCst|�|�||dk	|�S)roN)r�rx)r�r�r�rrrr��szdatetime.fromtimestampcCs|�|dd�S)z6Construct a naive UTC datetime from a POSIX timestamp.TN)rxr�rrr�utcfromtimestamp�szdatetime.utcfromtimestampcCst��}|�||�S)zBConstruct a datetime from time.time() and optional time zone info.r�)r�r�r�rrr�now�szdatetime.nowcCst��}|�|�S)z*Construct a UTC datetime from time.time().)r.r�ryr�rrr�utcnow�szdatetime.utcnowTcCs\t|t�std��t|t�s$td��|dkr2|j}||j|j|j|j|j	|j
|j||jd�	S)z8Construct a datetime from a given date and a given time.z%date argument must be a date instancez%time argument must be a time instanceTr<)
r}�_date_classr�_time_classr�rrrr�r�r�rRr�)r�r�r�r�rrr�combine�s

�zdatetime.combinecCs�t|t�std��|dd�}|dd�}zt|�}Wn"tk
rXtd|����YnX|r�zt|�}Wq�tk
r�td|����Yq�Xndddddg}|||�S)z=Construct a datetime from the output of datetime.isoformat().rrrh�Nr)r}r~rrjr>r|)r�rZdstrrnZdate_componentsZtime_componentsrrrr�s
zdatetime.fromisoformatcCsD|��}|dkrd}n|r d}nd}t|j|j|j|j|j|j|�S)rNrrr)r�r5rrrr�r�r�)r�r�rrrr_�s�zdatetime.timetuplec
s�tddd��d}|�tdd�}�fdd�}||�|}||}||�}||kr�|||f|j}||�|}||kr�|Sn||}||}||�}	|	|kr�|S||kr�|Sttf|j||�S)zReturn integer POSIX timestamp.�rr�rcs>t�|�dd�\}}}}}}t||||||��tdd�S)Nr,rr)r.r�r.rK)rerr0r1r2r3r4�Zepochrr�local�szdatetime._mktime.<locals>.local)r.rKr��maxrr)
r�rwr�r�r�Zu1�t1Zu2r��t2rr�r�_mktime�s(zdatetime._mktimecCs0|jdkr |��}||jdS|t��SdS)zReturn POSIX timestamp as floatNr�)r:r�rR�_EPOCHr�rYrrr�	timestamp�s
zdatetime.timestampcCsT|��}|r||8}|j|j|j}}}|j|j|j}}}t||||||d�S)z4Return UTC time tuple compatible with time.gmtime().r)rTrrrr�r�r�r5)r�rbrr0r1r2r3r4rrr�utctimetupleszdatetime.utctimetuplecCst|j|j|j�S)zReturn the date part.)r�r�r�r�r�rrrr�sz
datetime.datecCst|j|j|j|j|jd�S)z'Return the time part, with tzinfo None.r<)r�r�r�r�rRr�r�rrrr�sz
datetime.timecCs t|j|j|j|j|j|jd�S)z'Return the time part, with same tzinfo.r<)r�r�r�r�rRr:r�r�rrr�timetzs�zdatetime.timetzc	
Cs�|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}|dkrb|j}|dkrp|j}|	dkr~|j}	t	|�|||||||||	d�	S)z?Return a new datetime with new values for the specified fields.NTr<)
rrrr�r�r�rRr�r�r�)
r�rrrr�r�r�rRr�r�rrrr[s.�zdatetime.replacecCs\|jdkr|��}n|ttdd�}t�|�}t|dd��}|j}|j}t	t|d�|�S)Nrr�r,)
r�r�r�rKr.r�r.�	tm_gmtoff�tm_zonerz)r�ZtsZlocaltmr�ZgmtoffZzonerrr�_local_timezone4s


zdatetime._local_timezonecCs�|dkr|��}nt|t�s$td��|j}|dkrF|��}|�|�}n,|�|�}|dkrr|jdd���}|�|�}||kr~|S||j|d�}|�|�S)Nz)tz argument must be an instance of tzinfo�r�)r�r}r�rrTr[r0)r�r�rMZmyoffsetr{rrr�
astimezone@s 



zdatetime.astimezonecCs:|��dpd}dt|t|j|j|j|j|j|jfS)rr-z%s %s %2d %02d:%02d:%02d %04d)	rr
rr�r�r6r7r8r�rrrrr[s�zdatetime.ctime�Tr6cCsNd|j|j|j|ft|j|j|j|j|�}|��}t	|�}|rJ||7}|S)a�Return the time formatted according to ISO.

        The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.
        By default, the fractional part is omitted if self.microsecond == 0.

        If self.tzinfo is not None, the UTC offset is also attached, giving
        giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.

        Optional argument sep specifies the separator between date and
        time, default 'T'.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        z%04d-%02d-%02d%c)
r�r�r�rCr6r7r8r9rTrO)r��seprArMrLr�rrrres��zdatetime.isoformatcCs�|j|j|j|j|j|j|jg}|ddkr2|d=|ddkrD|d=d|jj|jj	d�
tt|��f}|j
dk	r�|dd�d|j
d}|jr�|dd�d}|S)	rUrrr�r�NrVrWrX)r�r�r�r6r7r8r9r�r�r�r\�mapr~r:r;)r��LrMrrrr��s&��
zdatetime.__repr__cCs|jdd�S)zConvert to string, for str().� )r�)rr�rrrr��szdatetime.__str__cCsddl}|�|||�S)zKstring, format -> new datetime parsed from a string (like time.strptime()).rN)�	_strptimeZ_strptime_datetime)r�rr?r�rrr�strptime�szdatetime.strptimecCs(|jdkrdS|j�|�}td|�|S)z\Return the timezone offset as timedelta positive east of UTC (negative west of
        UTC).NrTrZr[rrrrT�s


zdatetime.utcoffsetcCs&|jdkrdS|j�|�}t|�|Sr\r]r^rrrrV�s

zdatetime.tznamecCs(|jdkrdS|j�|�}td|�|Sr_r`r[rrrr��s
	

zdatetime.dstcCs2t|t�r|j|dd�dkSt|t�s*tSdSdS)NTrJrF)r}r.r	r�r�r�rrrr��s


zdatetime.__eq__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr��r}r.r	r�r�r�r�rrrr��s


zdatetime.__le__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__lt__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__ge__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__gt__Fc		Cs�|j}|j}d}}||kr"d}nT|��}|��}|rn||j|jd���krRdS||j|jd���krndS||k}|r�t|j|j|j|j|j	|j
|jf|j|j|j|j|j	|j
|jf�S|dks�|dkr�|r�dStd��||}|j
dkr�dS|r�dp�dS)NTr<rz(cannot compare naive and aware datetimesrrr)r:rTr[r�r	r�r�r�r6r7r8r9rrJ)	r�r�rKrMrNrOrPrQZdiffrrrr	�sF���
z
datetime._cmpc
Cs�t|t�stSt|��|j|j|j|jd�}||7}t|j	d�\}}t|d�\}}d|j
krhtkr�nn*t|��
t�|j
�t||||j|jd��Std��dS)zAdd a datetime and a timedelta.rwr�r�rr�rN)r}rKr�rr6r7r8r9r&r9rJrr�r~r�rr�r;r:r�)r�r�r/r�Zremr�r�rrrr�s&
���zdatetime.__add__c	Cs�t|t�s"t|t�r||StS|��}|��}|j|jd|jd}|j|jd|jd}t|||||j|j�}|j	|j	kr�|S|�
�}|�
�}||kr�|S|dks�|dkr�td��|||S)z6Subtract two datetimes, or a datetime and a timedelta.r�r�Nz(cannot mix naive and timezone-aware time)r}r.rKr�rr8r7r6r9r:rTr)	r�r�rrZsecs1Zsecs2�baserOrPrrrr�&s*



�zdatetime.__sub__cCs�|jdkr�|jr|jdd�}n|}|��}|dkrFt|��d�|_nDt|j|j|j	�}|j
d|jd|j}tt
|||j�|�|_|jS)Nrrr<r�r�)r�r�r[rTr�r�rrrrr�r�r�rKrR)r�r�rSrJr9rrrr�>s
zdatetime.__hash__r#c	Cs�t|jd�\}}t|jd�\}}t|d�\}}|j}|jrJ|dkrJ|d7}t||||j|j|j|j	|||g
�}|j
dkr~|fS||j
fSdSra)r&r�r9r�r;r�r�r6r7r8r:)	r�rcr%r&rdrerfr0rgrrrr�Os"�
zdatetime._getstatec	
Cs�|dk	rt|t�std��|\
}}}|_|_|_|_}}}|dkrTd|_|d|_nd|_||_|d||_	|d>|Bd>|B|_
||_dS)Nrhr=rrbrr$rg)r}rirr�r6r7r8r;r�r�r9r:)	r�r'r�r%r&r0rfrdrerrrr(^s"�zdatetime.__setstatecCs|j|�|�fSr�r�rjrrrrkmszdatetime.__reduce_ex__cCs
|�d�Srlrmr�rrrr�pszdatetime.__reduce__)NNrrrrN)N)N)T)NNNNNNNT)N)r�r6)F)r#)5r�r�r�r�r�r�r�r�r�r�r�r�rRr�r�r)rxr�ryrzr{r~rr_r�r�r�r�r[r�r�rrr�r�r�rTrVr�r�r�r�r�r�r	r�r�r�r�r�rnrkr�rrrrr.s���$






+	



#	��



	

%
r.cCs8d}t|dd�}|dd}||}||kr4|d7}|S)Nr#rr,r-)r)rZTHURSDAYZfirstdayZfirstweekdayr!rrrrysrc@s�eZdZdZe�Zefdd�Zeddd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zeddd�ZeZedd��ZdS)rz)�_offset�_namecCslt|t�std��||jkr,|s&|jSd}nt|t�s>td��|j|krV|jks`ntd��|�	||�S)Nzoffset must be a timedeltazname must be a stringzYoffset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).)
r}rKr�_Omittedr{r~�
_minoffset�
_maxoffsetr>�_create)r�rbr�rrrr��s


ztimezone.__new__NcCst�|�}||_||_|Sr�)r�r�r�r�)r�rbr�r�rrrr��s
ztimezone._createcCs|jdkr|jfS|j|jfS)zpickle supportN)r�r�r�rrrr1�s
ztimezone.__getinitargs__cCst|t�r|j|jkStSr�)r}rzr�r�r�rrrr��s
ztimezone.__eq__cCs
t|j�Sr�)r�r�r�rrrr��sztimezone.__hash__cCsL||jkrdS|jdkr0d|jj|jj|jfSd|jj|jj|j|jfS)aConvert to formal string, for repr().

        >>> tz = timezone.utc
        >>> repr(tz)
        'datetime.timezone.utc'
        >>> tz = timezone(timedelta(hours=-5), 'EST')
        >>> repr(tz)
        "datetime.timezone(datetime.timedelta(-1, 68400), 'EST')"
        zdatetime.timezone.utcNz	%s.%s(%r)z
%s.%s(%r, %r))r{r�r�r�r�r�r�rrrr��s


��ztimezone.__repr__cCs
|�d�Sr�)rVr�rrrr��sztimezone.__str__cCs$t|t�s|dkr|jStd��dS)Nz8utcoffset() argument must be a datetime instance or None)r}r.r�rr,rrrrT�sztimezone.utcoffsetcCs:t|t�s|dkr.|jdkr(|�|j�S|jStd��dS)Nz5tzname() argument must be a datetime instance or None)r}r.r��_name_from_offsetr�rr,rrrrV�s

ztimezone.tznamecCs"t|t�s|dkrdStd��dS)Nz2dst() argument must be a datetime instance or None)r}r.rr,rrrr��sztimezone.dstcCs2t|t�r&|j|k	rtd��||jStd��dS)Nzfromutc: dt.tzinfo is not selfz6fromutc() argument must be a datetime instance or None)r}r.r�r>r�rr,rrrr0�s



ztimezone.fromutcr$r)r7r;c
Cs�|sdS|td�kr d}|}nd}t|tdd��\}}t|tdd��\}}|j}|j}|r�d|�|d�d	|d�d	|d�d
|d��	S|r�d|�|d�d	|d�d	|d��Sd|�|d�d	|d��S)NZUTCrrErFrrGrHZ02drkrlZ06d)rKr&r9r;)r/rNr7rdr8r9r;rrrr��s( ztimezone._name_from_offset)N)r�r�r�r�r^r�r�r)r�r1r�r�r�r�rTrVr�r0rKr�r��staticmethodr�rrrrrz�s$	rzrRr�r�)�*)r�)r6):r�r�r.Zmathr�rsr	r�r�rrrZdbmrrWrrrrrr'r(r)r+rr
r5rCrOrfrjrsr|r�r�r�r�r�r�r�r�rKrrr�Z
resolutionr�r|r�rir}r.rrzr�r{r�Z	_datetime�ImportErrorrrrr�<module>s�

	?�
@') 
=

�[DXatG
dis.cpython-38.pyc000064400000036702151450073350007766 0ustar00U

e5dZP�@sdZddlZddlZddlZddlZddlTddlmZddddd	d
ddd
ddgeZ[ejej	ej
eee
fZedZdedfedfedffZedZdZdd�ZdVddd�dd�ZdWdd�dd�Zdddd d!d"d#d$d%d&d'�
Zd(d)�Zd*d+�Zd,d�Zd-d.�Zdd�d/d�Ze� d0d1�Z!d2e!j"_d3e!j_d4e!j#_d5e!j$_d6e!j%_d7e!j&_d8e!j'_d9e!j(_d:Z)d;Z*Gd<d�de!�Z+dd=�d>d
�Z,d?d@�Z-dAdB�Z.dXdCdD�Z/dYdd�dFd�Z0ddd�dGdH�Z1dZdddI�dJdK�Z2dLdM�Z3e0Z4dNdO�Z5dPd�Z6dQd
�Z7GdRd�d�Z8dSdT�Z9e:dUk�re9�dS)[z0Disassembler of Python byte code into mnemonics.�N)�*)�__all__�	code_info�dis�disassemble�distb�disco�findlinestarts�
findlabels�	show_code�get_instructions�Instruction�Bytecode�FORMAT_VALUE)N��str�repr�ascii�
MAKE_FUNCTION)�defaultsZ
kwdefaultsZannotationsZclosurecCs6zt||d�}Wn tk
r0t||d�}YnX|S)z�Attempts to compile the given source, first as an expression and
       then as a statement if the first approach fails.

       Utility function to accept strings in functions that otherwise
       expect code objects
    �eval�exec)�compile�SyntaxError)�source�name�c�r�/usr/lib64/python3.8/dis.py�_try_compiles
r��file�depthcCsh|dkrt|d�dSt|d�r&|j}t|d�r8|j}n4t|d�rJ|j}n"t|d�r\|j}nt|d�rl|j}t|d�r�t|j�	��}|D]p\}}t
|t�r�td	||d�zt
|||d
�Wn0tk
r�}ztd||d�W5d}~XYnXt|d�q�nht|d��rt|||d
�nLt
|ttf��r6t||d�n.t
|t��rRt|||d
�ntd
t|�j��dS)a0Disassemble classes, methods, functions, and other compiled objects.

    With no argument, disassemble the last traceback.

    Compiled objects currently include generator objects, async generator
    objects, and coroutine objects, all of which store their code object
    in a special attribute.
    N�r!�__func__�__code__�gi_code�ag_code�cr_code�__dict__zDisassembly of %s:r zSorry:�co_code�(don't know how to disassemble %s objects)r�hasattrr$r%r&r'r(�sortedr)�items�
isinstance�
_have_code�printr�	TypeError�_disassemble_recursive�bytes�	bytearray�_disassemble_bytesr�_disassemble_str�type�__name__)�xr!r"r.rZx1�msgrrrr+s@	







 �r#cCsX|dkr@z
tj}Wntk
r0td�d�YnX|jr@|j}q2t|jj|j|d�dS)z2Disassemble a traceback (default: last traceback).Nz no last traceback to disassembler#)	�sys�last_traceback�AttributeError�RuntimeError�tb_nextr�tb_frame�f_code�tb_lasti)�tbr!rrrrXs
Z	OPTIMIZEDZ	NEWLOCALSZVARARGSZVARKEYWORDSZNESTEDZ	GENERATORZNOFREEZ	COROUTINEZITERABLE_COROUTINEZASYNC_GENERATOR)
������ �@��icCs`g}td�D]:}d|>}||@r|�t�|t|���||N}|sqVq|�t|��d�|�S)z+Return pretty representation of code flags.rJrE�, )�range�append�COMPILER_FLAG_NAMES�get�hex�join)�flags�names�i�flagrrr�pretty_flagsrsrYcCs�t|d�r|j}t|d�r"|j}n4t|d�r4|j}n"t|d�rF|j}nt|d�rV|j}t|t�rjt|d�}t|d�rx|St	dt
|�j��d	S)
zDHelper to handle methods, compiled or raw code objects, and strings.r$r%r&r'r(z
<disassembly>r*r+N)r,r$r%r&r'r(r/rrr2r8r9�r:rrr�_get_code_object�s"







�r[cCstt|��S)z1Formatted details of methods, functions, or code.)�_format_code_infor[rZrrrr�scCs�g}|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�dt|j	��|j
r�|�d	�t|j
�D]}|�d
|�q�|jr�|�d�t|j�D]}|�d|�q�|j
�r|�d
�t|j
�D]}|�d|��q|j�rH|�d�t|j�D]}|�d|��q2|j�rz|�d�t|j�D]}|�d|��qdd�|�S)NzName:              %szFilename:          %szArgument count:    %szPositional-only arguments: %szKw-only arguments: %szNumber of locals:  %szStack size:        %szFlags:             %sz
Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:�
)rP�co_name�co_filename�co_argcount�co_posonlyargcount�co_kwonlyargcount�
co_nlocals�co_stacksizerY�co_flags�	co_consts�	enumerate�co_names�co_varnames�co_freevars�co_cellvarsrT)�co�linesZi_cZi_nrrrr\�s<




r\cCstt|�|d�dS)z}Print details of methods, functions, or code to *file*.

    If *file* is not provided, the output is printed on stdout.
    r#N)r1r)rlr!rrrr�s�_InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetz!Human readable name for operationzNumeric code for operationz6Numeric argument to operation (if any), otherwise Nonez4Resolved arg value (if known), otherwise same as argz0Human readable description of operation argumentz1Start index of operation within bytecode sequencez4Line started by this opcode (if any), otherwise Nonez1True if other code jumps to here, otherwise False��c@seZdZdZddd�ZdS)	r
aKDetails for a bytecode operation

       Defined fields:
         opname - human readable name for operation
         opcode - numeric code for operation
         arg - numeric argument to operation (if any), otherwise None
         argval - resolved arg value (if known), otherwise same as arg
         argrepr - human readable description of operation argument
         offset - start index of operation within bytecode sequence
         starts_line - line started by this opcode (if any), otherwise None
         is_jump_target - True if other code jumps to here, otherwise False
    �FrGcCs�g}|r:|jdk	r,d|}|�||j�n|�d|�|rJ|�d�n
|�d�|jrf|�d�n
|�d�|�t|j��|��|�|j�t��|j	dk	r�|�t|j	��t
��|jr�|�d|jd	�d�|��
�S)
a%Format instruction details for inclusion in disassembly output

        *lineno_width* sets the width of the line number field (0 omits it)
        *mark_as_current* inserts a '-->' marker arrow as part of the line
        *offset_width* sets the width of the instruction offset field
        Nz%%%dd� z-->z   z>>z  �(�))�starts_linerP�is_jump_targetr�offset�rjust�opname�ljust�
_OPNAME_WIDTH�arg�_OPARG_WIDTH�argreprrT�rstrip)�self�lineno_widthZmark_as_current�offset_widthZfieldsZ
lineno_fmtrrr�_disassemble�s&



zInstruction._disassembleN)rqFrG)r9�
__module__�__qualname__�__doc__r�rrrrr
�s
)�
first_linecCsTt|�}|j|j}tt|��}|dk	r4||j}nd}t|j|j|j	|j
|||�S)a�Iterator for the opcodes in methods, functions or code

    Generates a series of Instruction named tuples giving the details of
    each operations in the supplied code.

    If *first_line* is not None, it indicates the line number that should
    be reported for the first source line in the disassembled code.
    Otherwise, the source line information (if any) is taken directly from
    the disassembled code object.
    Nr)r[rkrj�dictr	�co_firstlineno�_get_instructions_bytesr*rirhrf)r:r�rl�
cell_names�
linestarts�line_offsetrrrrs�cCs |}|dk	r||}|t|�fS)z�Helper to get optional details about const references

       Returns the dereferenced constant and its repr if the constant
       list is defined.
       Otherwise returns the constant index and its repr().
    N�r)Zconst_indexZ
const_list�argvalrrr�_get_const_infosr�cCs*|}|dk	r||}|}nt|�}||fS)z�Helper to get optional details about named references

       Returns the dereferenced name as both value and repr if the name
       list is defined.
       Otherwise returns the name index and its repr().
    Nr�)Z
name_indexZ	name_listr�r~rrr�_get_name_info'sr�c
#s�t|�}d}t|�D�]r\}	}
�|dk	rD|�|	d�}|dk	rD||7}|	|k}d}d}
�dk	�rl�}|
tkrzt�|�\}}
n�|
tkr�t�|�\}}
n�|
tkr�|	d�}dt|�}
n�|
t	kr�t�|�\}}
n�|
t
kr�t�}|}
n�|
tkr�t�|�\}}
nr|
t
k�rFt�d@\}}
|t�d@�f}|d�rl|
�r<|
d7}
|
d	7}
n&|
tk�rld��fd
d�tt�D��}
tt|
|
�||
|	||�VqdS)a&Iterate over the instructions in a bytecode string.

    Generates a sequence of Instruction namedtuples giving the details of each
    opcode.  Additional information about the code's runtime environment
    (e.g. variable names, constants) can be specified using optional
    arguments.

    NrrFzto rqrGrErNzwith formatc3s"|]\}}�d|>@r|VqdS)rENr)�.0rW�s�r|rr�	<genexpr>gs�z*_get_instructions_bytes.<locals>.<genexpr>)r
�_unpack_opargsrRZhasconstr�Zhasnamer��hasjrelrZhaslocalZ
hascompareZcmp_opZhasfreer�FORMAT_VALUE_CONVERTERS�boolrrTrg�MAKE_FUNCTION_FLAGSr
ry)�code�varnamesrV�	constants�cellsr�r��labelsrurw�oprvr�r~rr�rr�7sV






�r����c
Cs<|j|j}tt|��}t|j||j|j|j|||d�dS)zDisassemble a code object.r#N)	rkrjr�r	r6r*rirhrf)rl�lastir!r�r�rrrrms�cCspt||d�|dks|dkrl|dk	r,|d}|jD]8}t|d�r2t|d�td|f|d�t|||d�q2dS)Nr#rrEr*zDisassembly of %r:r )rrfr,r1r3)rlr!r"r:rrrr3ts


r3)r!r�c	Cs�|dk	}	|	r8t|���|}
|
dkr2tt|
��}q<d}nd}t|�d}|dkr^tt|��}
nd}
t|||||||d�D]J}|	o�|jdk	o�|jdk}|r�t|d�|j|k}t|�|||
�|d�qxdS)	Ni�rqrrFi'rG�r�r#)	�max�values�lenrr�rurwr1r�)r�r�r�rVr�r�r�r!r�Zshow_linenoZ	maxlinenor�Z	maxoffsetr�ZinstrZnew_source_lineZis_current_instrrrrr6s8�
��

�r6cKstt|d�f|�dS)z<Compile the source string, then disassemble the code object.z<dis>N)r3r)r�kwargsrrrr7�sr7ccsdd}tdt|�d�D]J}||}|tkrN||d|B}|tkrH|d>nd}nd}|||fVqdS)NrrFrErH)rOr�Z
HAVE_ARGUMENTZEXTENDED_ARG)r�Zextended_argrWr�r|rrrr��sr�cCs\g}t|�D]J\}}}|dk	r|tkr4|d|}n|tkr|}nq||kr|�|�q|S)z`Detect all offsets in a byte code which are jump targets.

    Return the list of offsets.

    NrF)r�r�ZhasjabsrP)r�r�rwr�r|Zlabelrrrr
�sc	cs�|jddd�}|jddd�}t|j�}d}|j}d}t||�D]P\}}|rz||krd||fV|}||7}||krzdS|dkr�|d8}||7}qB||kr�||fVdS)z�Find the offsets in a byte code which are start of lines in the source.

    Generate pairs (offset, lineno) as described in Python/compile.c.

    rNrFrErLrM)�	co_lnotabr�r*r��zip)	r�Zbyte_incrementsZline_incrementsZbytecode_lenZ
lastlineno�linenoZaddrZ	byte_incrZ	line_incrrrrr	�s&


c@sLeZdZdZddd�dd�Zdd�Zdd	�Zed
d��Zdd
�Z	dd�Z
dS)raThe bytecode operations of a piece of code

    Instantiate this with a function, method, other compiled object, string of
    code, or a code object (as returned by compile()).

    Iterating over this yields the bytecode operations as Instruction instances.
    N)r��current_offsetcCsdt|�|_}|dkr&|j|_d|_n||_||j|_|j|j|_tt	|��|_
||_||_dS)Nr)
r[�codeobjr�r��_line_offsetrkrj�_cell_namesr�r	�_linestarts�_original_objectr�)r�r:r�r�rlrrr�__init__�szBytecode.__init__c	Cs*|j}t|j|j|j|j|j|j|jd�S)Nr�)	r�r�r*rirhrfr�r�r�)r�rlrrr�__iter__�s�zBytecode.__iter__cCsd�|jj|j�S)Nz{}({!r}))�format�	__class__r9r��r�rrr�__repr__�s
�zBytecode.__repr__cCs |jr|j}q||jj|jd�S)z/ Construct a Bytecode from the given traceback )r�)r@rArBrC)�clsrDrrr�from_traceback�szBytecode.from_tracebackcCs
t|j�S)z3Return formatted information about the code object.)r\r�r�rrr�infosz
Bytecode.infocCsl|j}|jdk	r|j}nd}t���>}t|j|j|j|j|j	|j
|j||d�	|��W5QR�SQRXdS)z3Return a formatted view of the bytecode operations.Nr�)r�rVr�r�r�r�r!r�)
r�r��io�StringIOr6r*rirhrfr�r�r��getvalue)r�rlrw�outputrrrr
s


�zBytecode.dis)r9r�r�r�r�r�r��classmethodr�r�rrrrrr�s

c	Csfddl}|��}|jd|�d�ddd�|��}|j�}|��}W5QRXt||jjd�}t	|�dS)	z*Simple test program to disassemble a file.rN�infile�rb�?�-)r8�nargs�defaultr)
�argparse�ArgumentParser�add_argumentZFileType�
parse_argsr��readrrr)r��parser�argsr�rr�rrr�_testsr��__main__)N)N)NNNNNr)r�)r�NNNNN);r�r<�types�collectionsr�ZopcoderZ_opcodes_all�
MethodType�FunctionType�CodeTyper��staticmethodr8r0Zopmaprrrrr�rr�rrrrQrYr[rr\r�
namedtuplernryr|r�r~rwrurvr{r}r
rr�r�r�rr3r6r7rr�r
r	rr�r9rrrr�<module>s�
����
-�
 �4�
6��=
token.cpython-38.opt-1.pyc000064400000004667151450073350011273 0ustar00U

e5d@	�0@s�dZddddgZdZdZdZdZd	Zd
ZdZdZ	d
Z
dZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d,Z)d-Z*d.Z+d/Z,d0Z-d1Z.d2Z/d3Z0d4Z1d5Z2d6Z3d7Z4d8Z5d9Z6d:Z7d;Z8d<Z9d=Z:d>Z;d?Z<d@Z=dAZ>dBZ?dCZ@dDZAdEZBdFdG�eC��D�D�ZEe�FeE�G��eee*ee+e	e
ee%e0e(ee&eee'e5ee6ee1e2e)e
e7eee#e.eeeee e$e/e3e4eee"e-eee,ee!dH�/ZHdId�ZIdJd�ZJdKd�ZKdLS)MzToken constants.�tok_name�
ISTERMINAL�
ISNONTERMINAL�ISEOF����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�cCs*i|]"\}}t|t�r|�d�s||�qS)�_)�
isinstance�int�
startswith)�.0�name�value�rM�/usr/lib64/python3.8/token.py�
<dictcomp>Js


�rO)/z!=�%z%=�&z&=�(�)�*z**z**=z*=�+z+=�,�-z-=z->�.z...�/z//z//=z/=�:z:=�;�<z<<z<<=z<=�=z==�>z>=z>>z>>=�@z@=�[�]�^z^=�{�|z|=�}�~cCs|tkS�N��	NT_OFFSET��xrMrMrNr�scCs|tkSrgrhrjrMrMrNr�scCs|tkSrg)�	ENDMARKERrjrMrMrNr�sN)L�__doc__�__all__rl�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENT�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�RARROW�ELLIPSIS�
COLONEQUAL�OP�AWAIT�ASYNC�TYPE_IGNORE�TYPE_COMMENT�
ERRORTOKEN�COMMENT�NL�ENCODING�N_TOKENSri�globals�itemsr�extend�values�EXACT_TOKEN_TYPESrrrrMrMrMrN�<module>s���2warnings.cpython-38.pyc000064400000032526151450073350011037 0ustar00U

e5d�L�@s�dZddlZddddddd	d
gZd<dd�Zd=dd�Zd
d�Zdd�ZeZdd�ZeZ	dd�Z
dedddfdd�Zeddfdd�Z
dd�Zdd	�ZGdd�de�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd>d+d�Zd?d,d�ZGd-d.�d.e�ZGd/d
�d
e�Zd0d1�Zz0dd2lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d3Z%Wn2e&k
�rngZd4Z#iZ$d*a'd5d6�Z"dZ%YnXeej(�e%�s�e)ed7��s�ed4e*d8d*d9�e
d:e*d*d;�e
d:e+d*d;�e
d:e,d*d;�e
d:e-d*d;�[%dS)@z&Python part of the warnings subsystem.�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS)�7Hook to write a warning to a file; replace if you like.N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r� /usr/lib64/python3.8/warnings.pyr
scCst||||d|�}t|�S)�.Function to format a warning the standard way.N)r�_formatwarnmsg_impl)r
rrrrrrrrrscCsP|j}|dkr tj}|dkr dSt|�}z|�|�Wntk
rJYnXdS�N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdkrpzddl}|�|j|j�}Wqvtk
rld}d}YqvXn|j}|r�|�	�}|d|7}|j
dk	�r�zddl}Wntk
r�d}d}Yn4X|��}z|�
|j
�}Wntk
r�d}YnX|dk	�r�|d7}|D]t}|d|j|jf7}z$|dk	�rB|�|j|j�}nd}Wntk
�rbd}YnX|�r|�	�}|d	|7}�qn|�s�||�d
�7}|S)N�:z: �
rz  %s
Tz-Object allocated at (most recent call last):
z  File "%s", lineno %s
z    %s
z<: Enable tracemalloc to get the object allocation traceback
)r�__name__rrr
r�	linecache�getline�	Exception�strip�source�tracemalloc�
is_tracing�get_object_traceback)	rr�sr"rr'�tracing�tb�framerrrr#sT"




�

rcCsdzt}Wntk
rYn<X|tk	rXt|�s6td��||j|j|j|j|j	|j
�dSt|�dS)r
z:warnings.showwarning() must be set to a function or methodN)r�	NameError�_showwarning_orig�callable�	TypeErrorr
rrrrrr)r�swrrr�_showwarnmsg`s�r3cCsHzt}Wntk
rYn$X|tk	r@||j|j|j|j|j�St|�S)r)	rr.�_formatwarning_origr
rrrrr)r�fwrrrrus
�r�FcCs�|dkstd|f��t|t�s(td��t|t�s:td��t|t�sLtd��t|t�s^td��t|t�rp|dksxtd��|s�|r�dd	l}|r�|�||j	�}nd	}|r�|�|�}nd	}t
||||||d
�d	S)a�Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    ��error�ignore�always�default�module�once�invalid action: %rzmessage must be a stringzcategory must be a classz#category must be a Warning subclasszmodule must be a stringr�lineno must be an int >= 0N��append)�AssertionError�
isinstance�str�type�
issubclass�Warning�int�re�compile�I�_add_filter)�actionr
rr<rrArIrrrr�s&
��cCsH|dkstd|f��t|t�r(|dks0td��t|d|d||d�dS)a�Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    r7r>rr?Nr@)rBrCrHrL)rMrrrArrrr�s

��cGsR|s6zt�|�Wntk
r&YnXt�d|�n|tkrHt�|�t�dS)Nr)�filters�remove�
ValueError�insertrA�_filters_mutated)rA�itemrrrrL�s
rLcCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)rNrRrrrrr�sc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r!�
__module__�__qualname__�__doc__rrrrrT�srTcCsN|D]D}zt|�Wqtk
rF}ztd|tjd�W5d}~XYqXqdS)NzInvalid -W option ignored:)r)�
_setoptionrT�printrr)�args�argrrrr�_processoptions�s
r\c	Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t	�Wq�t	t
fk
r�td	|f�d�Yq�Xnd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr6cSsg|]}|���qSr)r%)�.0r*rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrTrA�
_getaction�_getcategoryrI�escaperHrP�
OverflowErrorr)r[�partsrMr
rr<rrIrrrrX�s2
�
rXcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)Nr;�allr:)r;r:r9r<r=r8r>)�
startswithrT)rM�arrrrb�s

rbcCs�|stSd|krddl}|}nJ|�d�\}}}zt|dd|g�}Wn$tk
rftd|f�d�YnXzt||�}Wn$tk
r�td|f�d�YnXt|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	rG�builtins�
rpartition�
__import__�ImportErrorrT�getattr�AttributeErrorrF)r�m�klassr<�_�catrrrrc�s"
rccCs|jj}d|kod|kS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r-rrrr�_is_internal_framesrycCs"|j}|dk	rt|�r|j}q|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backry)r-rrr�_next_external_framesr{�c	Cst|t�r|j}|dkrt}t|t�r0t|t�sDtd�t|�j���zV|dks\t	t
�d��rht
�|�}n0t
�d�}t|d�D]}t
|�}|dkr~t�q~Wn"tk
r�t
j}d}d}YnX|j}|jj}|j}d|kr�|d}	nd}	|�di�}
t|||||	|
||�dS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'r|rr!z<string>Z__warningregistry__)rCrG�	__class__�UserWarningrErFr1�formatr!ryr�	_getframe�ranger{rP�__dict__�	f_globalsrwrx�f_lineno�
setdefaultr)r
r�
stacklevelr&r-�x�globalsrrr<�registryrrrrs>
�



�cCs�t|�}|dkr8|pd}|dd���dkr8|dd�}|dkrDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSt	D]V}
|
\}}}
}}|dks�|�
|�r�t||
�r�|dks�|�
|�r�|dks�||kr��qq�t}|dk�rdSddl
}|�||�|dk�r2|�|dk�rfd	||	<||f}t�|��r\dSd	t|<nf|d
k�rrnZ|dk�r�d	||	<||df}|�|��r�dSd	||<n$|dk�r�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrr9r8r=r|r:r<r;z1Unrecognized action (%r) in warnings.filters:
 %s)rH�lower�get�_filters_version�clearrCrGrDr}rN�matchrF�
defaultactionr"�getlines�onceregistry�RuntimeErrorrr3)r
rrrr<r��module_globalsr&r�keyrSrMrrt�modZlnr"ZoncekeyZaltkeyrrrrGs|


�����









��c@s"eZdZdZddd�Zdd�ZdS)r)r
rrrrrr&NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr)	r
rrrrrr&r!�_category_name)�selfr
rrrrrr&rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r
r�rrr)r�rrr�__str__�s��zWarningMessage.__str__)NNN)r!rUrV�_WARNING_DETAILSr�r�rrrrr�s�
rc@s8eZdZdZddd�dd�Zdd�Zd	d
�Zdd�ZdS)
r	a�A context manager that copies and restores the warnings filter upon
    exiting the context.

    The 'record' argument specifies whether warnings should be captured by a
    custom implementation of warnings.showwarning() and be appended to a list
    returned by the context manager. Otherwise None is returned by the context
    manager. The objects appended to the list are arguments whose attributes
    mirror the arguments to showwarning().

    The 'module' argument is to specify an alternative module to the module
    named 'warnings' and imported under that name. This argument is only useful
    when testing the warnings module itself.

    FN)�recordr<cCs(||_|dkrtjdn||_d|_dS)z�Specify whether to record warnings and if an alternative module
        should be used other than sys.modules['warnings'].

        For compatibility with Python 3.0, please consider all arguments to be
        keyword-only.

        N�warningsF)�_recordr�modules�_module�_entered)r�r�r<rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdk	r4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�rAr�rr�rEr!�join)r�rZ�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�rN�_filtersrRr�_showwarningrr�rAr/)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�rNrRr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)r!rUrVrWr�r�r�r�rrrrr	�s
	cszd�j�d�g}�jdk	rVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s4t�j�D]$\}}}��||�}||||fVq
dSr)�reversed�	cr_originr#)rr�funcnamer��coror"rr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r6r �)rr�r&)rVr�r"�	tracebackrA�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)rN�_defaultaction�
_onceregistryrrrRTr;cCstd7adS)Nr|)r�rrrrrRsrRZgettotalrefcount�__main__)rr<rAr9)rrA)NN)N)Nr|N)NNNN).rWr�__all__rrrrr/r3r4rrGrrrLrr$rTr\rXrbrcryr{rr�objectrr	r��	_warningsrNr�r�rRr�r�Z_warnings_defaultsrnr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>s|�

;
�
#
	
)�
GC 

�datetime.cpython-38.pyc000064400000157527151450073350011014 0ustar00U

e5d�X�
@s�dZddlZddlZddlZdd�ZdZdZdZ	dd	d
d	dd	dd	d	dd	dd	g
Z
dgZdZe
dd�D]Z
e�e�ee
7Zqd[[
dd
�Zdd�Zdd�Zdd�Zdd�Zed�Zed�Zed�Zedks�t�ededks�t�ededks�t�dd�Zdddd d!d"d#d$d%d&d'd(d)g
Zdd*d+d,d-d.d/d0gZd1d2�Zdld4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dNdO�Z)GdPdQ�dQ�Z*e*dR�e*_+e*dSdTdUdUdVdW�e*_,e*ddX�e*_-GdYdZ�dZ�Z.e.Z/e.ddd�e._+e.dd[d	�e._,e*dd\�e._-Gd]d^�d^�Z0e0Z1Gd_d`�d`�ZeZ2eddd�e_+edTdUdUdV�e_,e*ddX�e_-Gdadb�dbe.�Z3e3ddd�e3_+e3dd[d	dTdUdUdV�e3_,e*ddX�e3_-dcdd�Z4Gdedf�dfe0�Z5e5�6e*d��e5_7e5�6e*dTdUdg��e5_+e5�6e*dTdUdg��e5_,e3dhdde5j7di�Z8zddjl9TWne:k
�r.YnXX[[[
[[[[8[	[[[%[$[&['["[#[[([/[[[[[[[4[[[[2[1[[[)[[![ ddkl9mZdS)mz�Concrete date/time and related types.

See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
�NcCs||krdS||krdSdS)Nr�������x�yrr� /usr/lib64/python3.8/datetime.py�_cmpsr	ri'i۹7r���cCs$|ddko"|ddkp"|ddkS)zyear -> 1 if leap year, else 0.�r�d�r)�yearrrr�_is_leap%srcCs(|d}|d|d|d|dS)z2year -> number of days before January 1st of year.r�mr
rrr)rrrrr�_days_before_year)srcCs:d|krdksnt|��|dkr2t|�r2dSt|S)z9year, month -> number of days in that month in that year.r���)�AssertionErrorr�_DAYS_IN_MONTH�r�monthrrr�_days_in_month.srcCs6d|krdksntd��t||dko2t|�S)zCyear, month -> number of days in year preceding first day of month.rr�month must be in 1..12r)r�_DAYS_BEFORE_MONTHrrrrr�_days_before_month5srcCs`d|krdksntd��t||�}d|kr<|ksJntd|��t|�t||�|S)z>year, month, day -> ordinal, considering 01-Jan-0001 as day 1.rrr�day must be in 1..%d)rrrr�rr�day�dimrrr�_ymd2ord:s
"��r#i��e�i�r
�c	Cs8|d8}t|t�\}}|dd}t|t�\}}t|t�\}}t|d�\}}||d|d|7}|dkst|dkr�|dks�t�|dddfS|d	ko�|d
kp�|d	k}|t|�ks�t�|dd?}t||d
ko�|}||kr�|d8}|t||d
ko�|8}||8}d|k�r$t||�k�s*nt�|||dfS)z@ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.rrrrr
rrr
���2r%r)	�divmod�_DI400Y�_DI100Y�_DI4Yrrrrr)	�nZn400rZn100Zn4Zn1ZleapyearrZ	precedingrrr�_ord2ymdSs($r/ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecZMonZTueZWedZThuZFriZSatZSunc	Cs>t|||�dd}t||�|}t�|||||||||f	�S)N��)r#r�_time�struct_time)	r�m�d�hh�mm�ssZdstflagZwdayZdnumrrr�_build_struct_time�sr9�autocCstdddddd�}|dkr&|r dnd	}n|d
kr6|d}z||}Wntk
r^td��YnX|�||||�SdS)
Nz{:02d}z
{:02d}:{:02d}z{:02d}:{:02d}:{:02d}z{:02d}:{:02d}:{:02d}.{:03d}z{:02d}:{:02d}:{:02d}.{:06d})�hours�minutes�seconds�milliseconds�microsecondsr:r?r=r>��zUnknown timespec value)�KeyError�
ValueError�format)r6r7r8�us�timespecZspecs�fmtrrr�_format_time�s�rGcCs�d}|dk	r�|jdkr"d}|}nd}t|tdd��\}}t|tdd��\}}|d|||f7}|sj|jr�|d	|j7}|jr�|d
|j7}|S)N�r�-�+r�r;�r<z%s%02d:%02dz:%02d�.%06d)�daysr*�	timedeltar?r=)�off�s�signr6r7r8rrr�_format_offset�s

rScCs�d}d}d}g}|j}dt|�}}	||	k�r�||}
|d7}|
dk�r�||	k�r�||}
|d7}|
dkr�|dkr�dt|dd�}|�|��q�|
dk�rl|dk�rRd}t|d	��rR|��}|dk	�rRd
}|jdkr�|}d}t|tdd��\}
}t|tdd
��\}}|j}|j	}|�r,d||
|||f}n&|�rDd||
||f}nd||
|f}d|k�s`t
�|�|�n^|
dk�r�|dk�r�d}t|d��r�|��}|dk	�r�|�dd�}|�|�n|d�||
�n|d�q$||
�q$d�
|�}t�||�S)Nrr�%�fz%06d�microsecond�zrH�	utcoffsetrJrIrKrLz%c%02d%02d%02d.%06dz%c%02d%02d%02dz
%c%02d%02d�Z�tznamez%%)�append�len�getattr�hasattrrXrNr*rOr=r?rrZ�replace�joinr2�strftime)�objectrC�	timetupleZfreplaceZzreplaceZZreplaceZ	newformat�push�ir.Zch�offsetrR�h�restr4rQ�urrr�_wrap_strftime�sn


�










rjcCsjt|dd��}|ddkr,td|d��t|dd��}|ddkrPtd��t|dd	��}|||gS)
Nrr
rIzInvalid date separator: %sr%r1zInvalid date separator��
)�intrB)Zdtstrrrr!rrr�_parse_isoformat_datesrncCs
t|�}ddddg}d}tdd�D]t}||dkr:td��t|||d��||<|d7}|||d�}|rv|dkrzq�|dkr�td|��|d7}q"||k�r||dkr�td	��nN|d7}||}|d
kr�td	��t||d��|d<|dk�r|dd9<|S)Nrr'rzIncomplete time componentr�:zInvalid time separator: %c�.zInvalid microsecond component)r'r0r@)r\�rangerBrm)�tstr�len_str�
time_comps�pos�compZ	next_charZ
len_remainderrrr�_parse_hh_mm_ss_ffs2



rwc
Cs�t|�}|dkrtd��|�d�dp2|�d�d}|dkrL|d|d�n|}t|�}d}|dkr�||d�}t|�dkr�td��t|�}td	d
�|D��r�tj}nD||ddkr�dnd}t|d|d|d|dd
�}	t||	�}|�|�|S)NrzIsoformat time too shortrIrrJr)r%rk�zMalformed time zone stringcss|]}|dkVqdS)rNr)�.0rrrr�	<genexpr>Tsz(_parse_isoformat_time.<locals>.<genexpr>rr'�r;r<r=r?)	r\rB�findrw�all�timezone�utcrOr[)
rrrsZtz_posZtimestrrtZtziZtzstrZtz_compsZtzsignZtdrrr�_parse_isoformat_time;s,�
r�cCs&|dk	r"t|t�s"tdt|���dS)Nz4tzinfo.tzname() must return None or string, not '%s')�
isinstance�str�	TypeError�type)�namerrr�
_check_tznameds�r�cCsj|dkst�|dkrdSt|t�s6td|t|�f��td�|krTtd�ksfntd||f��dS)N)rX�dstz3tzinfo.%s() must return None or timedelta, not '%s'rzN%s()=%s, must be strictly between -timedelta(hours=24) and timedelta(hours=24))rr�rOr�r�rB)r�rfrrr�_check_utc_offsetos

� �r�cCs�t|t�r|St|t�r td��z|��}Wntk
r@Yn"Xt|t�s^tdt|�j��|S|}z|��}Wntk
r�YnDXt|t�s�tdt|�j��ddl	}|j
dt|�jtdd�|Stdt|�j��dS)Nz$integer argument expected, got floatz$__index__ returned non-int (type %s)z"__int__ returned non-int (type %s)rz$an integer is required (got type %s)r)�
stacklevel)r�rm�floatr��	__index__�AttributeErrorr��__name__�__int__�warnings�warn�DeprecationWarning)�valueZorigr�rrr�_check_int_field{sB


�
����r�cCs�t|�}t|�}t|�}t|kr,tks@ntdttf|��d|krTdks`ntd|��t||�}d|kr~|ks�ntd||��|||fS)Nzyear must be in %d..%drrrr)r��MINYEAR�MAXYEARrBrr rrr�_check_date_fields�s

r�cCs�t|�}t|�}t|�}t|�}d|kr4dks@ntd|��d|krTdks`ntd|��d|krtdks�ntd|��d|kr�dks�ntd|��|d	kr�td
|��|||||fS)Nr�zhour must be in 0..23�;zminute must be in 0..59zsecond must be in 0..59�?Bz microsecond must be in 0..999999)rrzfold must be either 0 or 1)r�rB)�hour�minute�secondrV�foldrrr�_check_time_fields�s




r�cCs|dk	rt|t�std��dS)Nz4tzinfo argument must be None or of a tzinfo subclass)r��tzinfor�)�tzrrr�_check_tzinfo_arg�sr�cCs tdt|�jt|�jf��dS)Nzcan't compare '%s' to '%s')r�r�r�rrrr�	_cmperror�s�r�cCsRt||�\}}|d9}|dkr&||kn||k}|sF||krN|ddkrN|d7}|S)z�divide a by b and round result to the nearest integer

    When the ratio is exactly half-way between two integers,
    the even integer is returned.
    rrr)r*)�a�b�q�rZgreater_than_halfrrr�_divide_and_round�sr�c@seZdZdZdZd?dd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
e	dd��Ze	dd��Zdd�Z
e
Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"d:d;�Z#d<d=�Z$d>S)@rOa�Represent the difference between two datetime objects.

    Supported operators:

    - add, subtract timedelta
    - unary plus, minus, abs
    - compare to timedelta
    - multiply, divide by int

    In addition, datetime supports subtraction of two datetime objects
    returning a timedelta, and addition or subtraction of a datetime
    and a timedelta giving a datetime.

    Representation: (days, seconds, microseconds).  Why?  Because I
    felt like it.
    )�_days�_seconds�
_microseconds�	_hashcodercCsVd}}	}
||d7}||d|d7}||d7}t|t�r�t�|�\}}t�|d�\}}
|
t|
�ksrt�t|
�}	|t|�ks�t�t|�}nd}|}t|t�s�t�t|�dks�t�t|t�s�t�t|	�d	ks�t�t|t��r(t�|�\}}|t|�k�st�t|�}||7}t|�d
k�s,t�n|}t|t��s<t�t|�d
k�sNt�t|t��s^t�t|d	�\}}||7}|	t|�7}	t|	t��s�t�t|	�dk�s�t�|d}t|�d
k�s�t�t|t��rt||�}t|d�\}}t|d	�\}}||7}|	|7}	n@t|�}t|d�\}}t|d	�\}}||7}|	|7}	t||�}t|	t��sRt�t|t��sbt�t|	�dk�stt�t|�dk�s�t�t|d�\}}
|	|7}	t|	d	�\}}	||7}t|t��s�t�t|	t��r�d|	k�r�d	k�s�nt�t|
t��rd|
k�rdk�snt�t|�dk�r0t	d|��t
�|�}||_|	|_
|
|_d|_|S)Nrr1�<�r@g�@gg�?�Qg@i����.Ag�@A�@Bi��g��GA�ɚ;z$timedelta # of days is too large: %dr)r�r��_math�modfrmr�absr*�round�
OverflowErrorrb�__new__r�r�r�r�)�clsrNr=r?r>r<r;Zweeksr5rQrDZdayfracZdaysecondsfracZdaysecondswholeZsecondsfracZusdouble�selfrrrr��s�


**
ztimedelta.__new__cCspg}|jr|�d|j�|jr0|�d|j�|jrF|�d|j�|sT|�d�d|jj|jjd�|�fS)Nzdays=%dz
seconds=%dzmicroseconds=%d�0�	%s.%s(%s)�, )r�r[r�r��	__class__�
__module__�__qualname__r`)r��argsrrr�__repr__Ms
�ztimedelta.__repr__cCsdt|jd�\}}t|d�\}}d|||f}|jrLdd�}d||j�|}|jr`|d|j}|S)Nr�z%d:%02d:%02dcSs|t|�dkrdpdfS)NrrQrH)r�)r.rrr�plural`sz!timedelta.__str__.<locals>.pluralz
%d day%s, rM)r*r�r�r�)r�r7r8r6rQr�rrr�__str__[sztimedelta.__str__cCs|jd|jd|jdS)zTotal seconds in the duration.r�r�)rNr=r?�r�rrr�
total_secondsgs
��ztimedelta.total_secondscCs|jS�rN�r�r�rrrrNmsztimedelta.dayscCs|jS�r=)r�r�rrrr=rsztimedelta.secondscCs|jS�r?)r�r�rrrr?wsztimedelta.microsecondscCs2t|t�r.t|j|j|j|j|j|j�StS�N�r�rOr�r�r��NotImplemented�r��otherrrr�__add__|s


�ztimedelta.__add__cCs2t|t�r.t|j|j|j|j|j|j�StSr�r�r�rrr�__sub__�s


�ztimedelta.__sub__cCst|t�r||StSr�)r�rOr�r�rrr�__rsub__�s

ztimedelta.__rsub__cCst|j|j|j�Sr�)rOr�r�r�r�rrr�__neg__�s�ztimedelta.__neg__cCs|Sr�rr�rrr�__pos__�sztimedelta.__pos__cCs|jdkr|S|SdS�Nrr�r�rrr�__abs__�s
ztimedelta.__abs__cCs`t|t�r(t|j||j||j|�St|t�r\|��}|��\}}tddt	|||��St
Sr�)r�rmrOr�r�r�r��_to_microseconds�as_integer_ratior�r��r�r��usecr�r�rrr�__mul__�s

�
ztimedelta.__mul__cCs|jd|jd|jS)Nr�r��r�r�r�r�rrrr��s�ztimedelta._to_microsecondscCsNt|ttf�stS|��}t|t�r0||��St|t�rJtdd||�SdSr�)r�rmrOr�r�)r�r�r�rrr�__floordiv__�s

ztimedelta.__floordiv__cCs~t|tttf�stS|��}t|t�r2||��St|t�rNtddt||��St|t�rz|��\}}tddt|||��SdSr�)r�rmr�rOr�r�r�r�r�rrr�__truediv__�s


ztimedelta.__truediv__cCs*t|t�r&|��|��}tdd|�StSr�)r�rOr�r�)r�r�r�rrr�__mod__�s
ztimedelta.__mod__cCs4t|t�r0t|��|���\}}|tdd|�fStSr�)r�rOr*r�r�)r�r�r�r�rrr�
__divmod__�s
�ztimedelta.__divmod__cCs t|t�r|�|�dkStSdSr��r�rOr	r�r�rrr�__eq__�s
ztimedelta.__eq__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__le__�s
ztimedelta.__le__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__lt__�s
ztimedelta.__lt__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__ge__�s
ztimedelta.__ge__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__gt__�s
ztimedelta.__gt__cCs t|t�st�t|��|���Sr�)r�rOrr	�	_getstater�rrrr	�sztimedelta._cmpcCs|jdkrt|���|_|jS)Nr�r��hashr�r�rrr�__hash__�s
ztimedelta.__hash__cCs|jdkp|jdkp|jdkSr�r�r�rrr�__bool__s

��ztimedelta.__bool__cCs|j|j|jfSr�r�r�rrrr�
sztimedelta._getstatecCs|j|��fSr��r�r�r�rrr�
__reduce__
sztimedelta.__reduce__N)rrrrrrr)%r�r�r��__doc__�	__slots__r�r�r�r��propertyrNr=r?r��__radd__r�r�r�r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�rrrrrO�sR�
e


		
		rOi6e�r�r�r�r�)rNr;r<r=r?r�c@s@eZdZdZdZdDdd�Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�ZeZedd��Zedd��Zedd��Zd d!�Zd"d#�ZdEd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(dS)F�datea�Concrete date type.

    Constructors:

    __new__()
    fromtimestamp()
    today()
    fromordinal()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__
    __add__, __radd__, __sub__ (add/radd only with timedelta arg)

    Methods:

    timetuple()
    toordinal()
    weekday()
    isoweekday(), isocalendar(), isoformat()
    ctime()
    strftime()

    Properties (readonly):
    year, month, day
    )�_year�_month�_dayr�NcCs�|dkr�t|ttf�r�t|�dkr�dt|dd��krBdkr�nnTt|t�r|z|�d�}Wntk
rztd��YnXt�	|�}|�
|�d	|_|St|||�\}}}t�	|�}||_
||_||_d	|_|S)
zVConstructor.

        Arguments:

        year, month, day (required, base 1)
        Nr
rrr'r�latin1znFailed to encode latin1 string when unpickling a date object. pickle.load(data, encoding='latin1') is assumed.r)r��bytesr�r\�ord�encode�UnicodeEncodeErrorrBrbr��_date__setstater�r�r�r�r�)r�rrr!r�rrrr�3s8�
���

�



zdate.__new__c	Cs(t�|�\	}}}}}}}}	}
||||�S)z;Construct a date from a POSIX timestamp (like time.time()).)r2�	localtime)r��trr4r5r6r7r8�weekday�jdayr�rrr�
fromtimestampUszdate.fromtimestampcCst��}|�|�S)z"Construct a date from time.time().�r2�timer�r�r�rrr�today[sz
date.todaycCst|�\}}}||||�S)z�Construct a date from a proleptic Gregorian ordinal.

        January 1 of year 1 is day 1.  Only the year, month and day are
        non-zero in the result.
        )r/)r�r.rr4r5rrr�fromordinalaszdate.fromordinalcCsXt|t�std��zt|�dks$t�|t|��WStk
rRtd|����YnXdS)z5Construct a date from the output of date.isoformat().�#fromisoformat: argument must be strrl�Invalid isoformat string: N)r�r�r�r\rrn�	ExceptionrB)r��date_stringrrr�
fromisoformatks
zdate.fromisoformatc	Cs�t|krtks$ntd|����d|kr8dks�nd}|dkrrt|dd�d}|dksn|dkrrt|�rrd	}|r�td
|����d|kr�dks�ntd|�d
���|dd|d}t|�}||}|t|��S)z|Construct a date from the ISO year, week number and weekday.

        This is the inverse of the date.isocalendar() functionzYear is out of range: r�5Trr1r
r'FzInvalid week: rkzInvalid weekday: z (range is [1, 7]))r�r�rBr#r�_isoweek1mondayr/)	r�r�weekr!Zout_of_rangeZ
first_weekdayZ
day_offsetZday_1Zord_dayrrr�fromisocalendarws$�zdate.fromisocalendarcCs d|jj|jj|j|j|jfS)a5Convert to formal string, for repr().

        >>> dt = datetime(2010, 1, 1)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0)'

        >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
        z%s.%s(%d, %d, %d))r�r�r�r�r�r�r�rrrr��s�z
date.__repr__cCs.|��dpd}dt|t|j|j|jfS)�Return ctime() style string.r1z%s %s %2d 00:00:00 %04d)�	toordinal�	_DAYNAMES�_MONTHNAMESr�r�r��r�r�rrr�ctime�s�z
date.ctimecCst|||���S)zFormat using strftime().)rjrc�r�rFrrrra�sz
date.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�S�Nzmust be str, not %sr�r�r�r�r�r�r\rarrrr�
__format__�s


zdate.__format__cCsd|j|j|jfS)z�Return the date formatted according to ISO.

        This is 'YYYY-MM-DD'.

        References:
        - http://www.w3.org/TR/NOTE-datetime
        - http://www.cl.cam.ac.uk/~mgk25/iso-time.html
        z%04d-%02d-%02d)r�r�r�r�rrr�	isoformat�s	zdate.isoformatcCs|jS)z
year (1-9999))r�r�rrrr�sz	date.yearcCs|jS)zmonth (1-12))r�r�rrrr�sz
date.monthcCs|jS)z
day (1-31))r�r�rrrr!�szdate.daycCst|j|j|jdddd�S)�9Return local time tuple compatible with time.localtime().rr)r9r�r�r�r�rrrrc�s�zdate.timetuplecCst|j|j|j�S)z�Return proleptic Gregorian ordinal for the year, month and day.

        January 1 of year 1 is day 1.  Only the year, month and day values
        contribute to the result.
        )r#r�r�r�r�rrrr�szdate.toordinalcCs:|dkr|j}|dkr|j}|dkr*|j}t|�|||�S)z;Return a new date with new values for the specified fields.N)r�r�r�r�)r�rrr!rrrr_�szdate.replacecCst|t�r|�|�dkStSr��r�r�r	r�r�rrrr��s
zdate.__eq__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__le__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__lt__cCst|t�r|�|�dkStSr�rr�rrrr�
s
zdate.__ge__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__gt__cCsPt|t�st�|j|j|j}}}|j|j|j}}}t|||f|||f�Sr�)r�r�rr�r�r�r	)r�r�rr4r5Zy2Zm2Zd2rrrr	sz	date._cmpcCs|jdkrt|���|_|jS)�Hash.rr�r�rrrr�s
z
date.__hash__cCsJt|t�rF|��|j}d|kr,tkr>nnt|��|�Std��tS)zAdd a date to a timedelta.r�result out of range)	r�rOrrN�_MAXORDINALr�rr�r�)r�r��orrrr�%s
zdate.__add__cCsDt|t�r|t|j�St|t�r@|��}|��}t||�StS)z.Subtract two dates, or a date and a timedelta.)r�rOrNr�rr�)r�r��days1�days2rrrr�0s

zdate.__sub__cCs|��ddS)z:Return day of the week, where Monday == 0 ... Sunday == 6.r0r1�rr�rrrr�:szdate.weekdaycCs|��dpdS)z:Return day of the week, where Monday == 1 ... Sunday == 7.r1r"r�rrr�
isoweekday@szdate.isoweekdaycCs�|j}t|�}t|j|j|j�}t||d�\}}|dkr^|d8}t|�}t||d�\}}n$|dkr�|t|d�kr�|d7}d}||d|dfS)a�Return a 3-tuple containing ISO year, week number, and weekday.

        The first ISO week of the year is the (Mon-Sun) week
        containing the year's first Thursday; everything else derives
        from that.

        The first week is 1; Monday is 1 ... Sunday is 7.

        ISO calendar algorithm taken from
        http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
        (used with permission)
        r1rr�4)r�rr#r�r�r*)r�r�week1mondayrr
r!rrr�isocalendarEs
zdate.isocalendarcCs&t|jd�\}}t|||j|jg�fS�N�)r*r�r�r�r�)r��yhi�ylorrrr�cszdate._getstatecCs"|\}}|_|_|d||_dSr')r�r�r�)r��stringr)r*rrr�
__setstategszdate.__setstatecCs|j|��fSr�r�r�rrrr�kszdate.__reduce__)NN)NNN))r�r�r�r�r�r��classmethodrrrr
rr�rrarrr�r�rrr!rcrr_r�r�r�r�r�r	r�r�r�r�r�r#r&r�r�r�rrrrr�sX
"


	

$



	
r�rr�c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r�z}Abstract base class for time zone info classes.

    Subclasses must override the name(), utcoffset() and dst() methods.
    rcCstd��dS)z%datetime -> string name of time zone.z&tzinfo subclass must override tzname()N��NotImplementedError�r��dtrrrrZ|sz
tzinfo.tznamecCstd��dS)zIdatetime -> timedelta, positive for east of UTC, negative for west of UTCz)tzinfo subclass must override utcoffset()Nr.r0rrrrX�sztzinfo.utcoffsetcCstd��dS)z�datetime -> DST offset as timedelta, positive for east of UTC.

        Return 0 if DST not in effect.  utcoffset() must include the DST
        offset.
        z#tzinfo subclass must override dst()Nr.r0rrrr��sz
tzinfo.dstcCs�t|t�std��|j|k	r$td��|��}|dkr<td��|��}|dkrTtd��||}|r�||7}|��}|dkr�td��||S)z*datetime in UTC -> datetime in local time.z&fromutc() requires a datetime argumentzdt.tzinfo is not selfNz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultz;fromutc(): dt.dst gave inconsistent results; cannot convert)r��datetimer�r�rBrXr�)r�r1ZdtoffZdtdst�deltarrr�fromutc�s"

ztzinfo.fromutccCsft|dd�}|r|�}nd}t|dd�}|r4|�}nt|dd�pBd}|dkrV|j|fS|j||fSdS)N�__getinitargs__r�__getstate__�__dict__)r]r�)r�Zgetinitargsr��getstate�staterrrr��s
ztzinfo.__reduce__N)
r�r�r�r�r�rZrXr�r4r�rrrrr�usr�c@s*eZdZdZdZdBdd�dd�Zedd	��Zed
d��Zedd
��Z	edd��Z
edd��Zedd��Zdd�Z
dd�Zdd�Zdd�Zdd�ZdCdd �Zd!d"�Zd#d$�Zd%d&�ZdDd(d)�ZeZed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEdd�d7d8�ZdFd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dS)Gra<Time with time zone.

    Constructors:

    __new__()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__

    Methods:

    strftime()
    isoformat()
    utcoffset()
    tzname()
    dst()

    Properties (readonly):
    hour, minute, second, microsecond, tzinfo, fold
    )�_hour�_minute�_second�_microsecond�_tzinfor��_foldrN�r�cCs�t|ttf�r�t|�dkr�t|dd��d@dkr�t|t�rhz|�d�}Wntk
rftd��YnXt�	|�}|�
||p~d�d	|_|St|||||�\}}}}}t
|�t�	|�}||_||_||_||_||_d	|_||_|S)
z�Constructor.

        Arguments:

        hour, minute (required)
        second, microsecond (default to zero)
        tzinfo (default to None)
        fold (keyword only, default to zero)
        r0rr�r(r�znFailed to encode latin1 string when unpickling a time object. pickle.load(data, encoding='latin1') is assumed.Nr)r�r�r�r\r�r�r�rBrbr��_time__setstater�r�r�r:r;r<r=r>r?)r�r�r�r�rVr�r�r�rrrr��s>
�
�

�
ztime.__new__cCs|jS�zhour (0-23)�r:r�rrrr��sz	time.hourcCs|jS�z
minute (0-59)�r;r�rrrr�sztime.minutecCs|jS�z
second (0-59)�r<r�rrrr�sztime.secondcCs|jS�zmicrosecond (0-999999)�r=r�rrrrVsztime.microsecondcCs|jS�ztimezone info object�r>r�rrrr�sztime.tzinfocCs|jSr��r?r�rrrr�sz	time.foldcCs$t|t�r|j|dd�dkStSdS)NT��allow_mixedr�r�rr	r�r�rrrr�s
ztime.__eq__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�#s
ztime.__le__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�)s
ztime.__lt__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�/s
ztime.__ge__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�5s
ztime.__gt__Fc
Cs�t|t�st�|j}|j}d}}||kr0d}n|��}|��}||k}|rvt|j|j|j|j	f|j|j|j|j	f�S|dks�|dkr�|r�dSt
d��|jd|j|tdd�}|jd|j|tdd�}	t||j|j	f|	|j|j	f�S)NTrz$cannot compare naive and aware timesr�rrL)r�rrr>rXr	r:r;r<r=r�rO)
r�r�rO�mytz�ottz�myoff�otoff�base_compareZmyhhmmZothhmmrrrr	;s4����z	time._cmpcCs�|jdkr�|jr|jdd�}n|}|��}|sBt|��d�|_n�tt|j|j	d�|tdd��\}}|tdd�r|t
d��|tdd�}d|kr�d	kr�nntt|||j|j
��|_nt|||j|j
f�|_|jS)
rrrr@�r;r<rrKrLzwhole minuter()r�r�r_rXr�r�r*rOr�r�rrr�rV)r�r��tzoffrgr4rrrr�Ws 
�z
time.__hash__cCs|��}t|�S)z=Return formatted timezone offset (+xx:xx) or an empty string.)rXrS)r�rPrrr�_tzstrnsztime._tzstrcCs�|jdkrd|j|jf}n|jdkr2d|j}nd}d|jj|jj|j|j|f}|jdk	r�|dd�dksrt�|dd�d	|jd}|j	r�|dd�dks�t�|dd�d
}|S)�%Convert to formal string, for repr().rz, %d, %dz, %drHz%s.%s(%d, %d%s)Nr�)�, tzinfo=%r�	, fold=1))
r=r<r�r�r�r:r;r>rr?�r�rQrrrr�ss$

�
z
time.__repr__r:cCs0t|j|j|j|j|�}|��}|r,||7}|S)a�Return the time formatted according to ISO.

        The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
        part is omitted if self.microsecond == 0.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        )rGr:r;r<r=rX)r�rErQr�rrrr�s
�ztime.isoformatcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS)z0Construct a time from the output of isoformat().rrN)r�r�r�r�rrB)r�Ztime_stringrrrr
�s
ztime.fromisoformatc	Cs(ddd|j|j|jdddf	}t|||�S)z{Format using strftime().  The date part of the timestamp passed
        to underlying strftime should not be used.
        ilrrr)r:r;r<rj)r�rFrcrrrra�s�z
time.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�Srrrrrrr�s


ztime.__format__cCs(|jdkrdS|j�d�}td|�|S)z^Return the timezone offset as timedelta, positive east of UTC
         (negative west of UTC).NrX�r>rXr��r�rfrrrrX�s


ztime.utcoffsetcCs&|jdkrdS|j�d�}t|�|S�aReturn the timezone name.

        Note that the name is 100% informational -- there's no requirement that
        it mean anything in particular. For example, "GMT", "UTC", "-500",
        "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
        N�r>rZr��r�r�rrrrZ�s

ztime.tznamecCs(|jdkrdS|j�d�}td|�|S�aqReturn 0 if DST is not in effect, or the DST offset (as timedelta
        positive eastward) if DST is in effect.

        This is purely informational; the DST offset has already been added to
        the UTC offset returned by utcoffset() if applicable, so there's no
        need to consult dst() unless you're interested in displaying the DST
        info.
        Nr��r>r�r�r_rrrr��s
	

ztime.dstTcCsl|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}t|�||||||d�S)z;Return a new time with new values for the specified fields.NTr@)r�r�r�rVr�r?r�)r�r�r�r�rVr�r�rrrr_�sztime.replacer'cCspt|jd�\}}t|d�\}}|j}|jr:|dkr:|d7}t||j|j|||g�}|jdkrb|fS||jfSdS�Nr(r'�)r*r=r:r?r�r;r<r>)r��protocol�us2�us3�us1rg�	basestaterrrr��s�
ztime._getstatecCst|dk	rt|t�std��|\}|_|_}}}|dkrHd|_|d|_nd|_||_|d>|Bd>|B|_||_dS)N�bad tzinfo state argrArrfrrk)	r��
_tzinfo_classr�r;r<r?r:r=r>)r�r+r�rgrjrhrirrrr,�sztime.__setstatecCs|j|�|�fSr�r��r�rgrrr�
__reduce_ex__sztime.__reduce_ex__cCs
|�d�S�Nr�ror�rrrr�sztime.__reduce__)rrrrN)F)r:)NNNNT)r')$r�r�r�r�r�r�r�r�r�r�rVr�r�r�r�r�r�r�r	r�rXr�rr�r-r
rarrXrZr�r_r�rBror�rrrrr�sT(








		
��


rc@s�eZdZdZejejZdddd�dd�Zedd��Z	ed	d
��Z
edd��Zed
d��Zedd��Z
edd��Zedd��Zededd��Zedd��Zedfdd��Zedd��Zedgdd��Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zdhdd�d0d1�Zd2d3�Zdid4d5�Zd6d7�Zdjd:d;�Z d<d=�Z!d>d?�Z"ed@dA��Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dkdSdT�Z,dUdV�Z-e-Z.dWdX�Z/dYdZ�Z0dld\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4dS)mr2z�datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

    The year, month and day arguments are required. tzinfo may be None, or an
    instance of a tzinfo subclass. The remaining arguments may be ints.
    Nrr@c	Cst|ttf�r�t|�dkr�dt|dd��d@kr>dkr�nnVt|t�rxzt|d�}Wntk
rvtd��YnXt�|�}
|
�	||�d	|
_
|
St|||�\}}}t|||||	�\}}}}}	t
|�t�|�}
||
_||
_||
_||
_||
_||
_||
_||
_d	|
_
|	|
_|
S)
Nrlrrr'rArr�zrFailed to encode latin1 string when unpickling a datetime object. pickle.load(data, encoding='latin1') is assumed.r)r�r�r�r\r�r�rBrbr��_datetime__setstater�r�r�r�r�r�r�r:r;r<r=r>r?)r�rrr!r�r�r�rVr�r�r�rrrr�sL��

�

�
zdatetime.__new__cCs|jSrCrDr�rrrr�Csz
datetime.hourcCs|jSrErFr�rrrr�Hszdatetime.minutecCs|jSrGrHr�rrrr�Mszdatetime.secondcCs|jSrIrJr�rrrrVRszdatetime.microsecondcCs|jSrKrLr�rrrr�Wszdatetime.tzinfocCs|jSr�rMr�rrrr�\sz
datetime.foldc	Cspt�|�\}}t|d�}|dkr4|d7}|d8}n|dkrL|d8}|d7}|rVtjntj}||�\	}}}	}
}}}
}}t|d�}||||	|
||||�}|dk�rbd}||kr�tj�	d�r�|S|||�dd	�\}}}	}
}}||||	|
||||�}||t
d|�}|jdk�rl|||t
dd��dd	�\}}}	}
}}||||	|
||||�}||k�rld|_n
|�
|�}|S)
��Construct a datetime from a POSIX timestamp (like time.time()).

        A timezone info object may be passed in as well.
        r�r�rrr�Nr��winr0)r�r�r�r2�gmtimer��min�sys�platform�
startswithrOrNr?r4)r�r�rr�ZfracrDZ	converterrr4r5r6r7r8r�r�r��result�max_fold_secondsZprobe1ZtransZprobe2rrr�_fromtimestamp`s4


 *

zdatetime._fromtimestampcCst|�|�||dk	|�S)rsN)r�r|)r�r�r�rrrr�szdatetime.fromtimestampcCs|�|dd�S)z6Construct a naive UTC datetime from a POSIX timestamp.TN)r|rrrr�utcfromtimestamp�szdatetime.utcfromtimestampcCst��}|�||�S)zBConstruct a datetime from time.time() and optional time zone info.r)r�r�r�rrr�now�szdatetime.nowcCst��}|�|�S)z*Construct a UTC datetime from time.time().)r2rr}rrrr�utcnow�szdatetime.utcnowTcCs\t|t�std��t|t�s$td��|dkr2|j}||j|j|j|j|j	|j
|j||jd�	S)z8Construct a datetime from a given date and a given time.z%date argument must be a date instancez%time argument must be a time instanceTr@)
r��_date_classr��_time_classr�rrr!r�r�r�rVr�)r�r�rr�rrr�combine�s

�zdatetime.combinecCs�t|t�std��|dd�}|dd�}zt|�}Wn"tk
rXtd|����YnX|r�zt|�}Wq�tk
r�td|����Yq�Xndddddg}|||�S)z=Construct a datetime from the output of datetime.isoformat().rrrl�Nr)r�r�r�rnrBr�)r�r	ZdstrrrZdate_componentsZtime_componentsrrrr
�s
zdatetime.fromisoformatcCsD|��}|dkrd}n|r d}nd}t|j|j|j|j|j|j|�S)rNrrr)r�r9rrr!r�r�r�)r�r�rrrrc�s�zdatetime.timetuplec
s�tddd��d}|�tdd�}�fdd�}||�|}||}||�}||kr�|||f|j}||�|}||kr�|Sn||}||ks�t�||}||�}	|	|kr�|S||kr�|Sttf|j||�S)zReturn integer POSIX timestamp.�rr�rcs>t�|�dd�\}}}}}}t||||||��tdd�S)Nr0rr)r2r�r2rO)rirr4r5r6r7r8�Zepochrr�local�szdatetime._mktime.<locals>.local)r2rOr�r�maxrv)
r�r{r�r�r�Zu1�t1Zu2r��t2rr�r�_mktime�s*zdatetime._mktimecCs0|jdkr |��}||jdS|t��SdS)zReturn POSIX timestamp as floatNr�)r>r�rV�_EPOCHr�r]rrr�	timestamp�s
zdatetime.timestampcCsT|��}|r||8}|j|j|j}}}|j|j|j}}}t||||||d�S)z4Return UTC time tuple compatible with time.gmtime().r)rXrrr!r�r�r�r9)r�rfrr4r5r6r7r8rrr�utctimetupleszdatetime.utctimetuplecCst|j|j|j�S)zReturn the date part.)r�r�r�r�r�rrrr�sz
datetime.datecCst|j|j|j|j|jd�S)z'Return the time part, with tzinfo None.r@)rr�r�r�rVr�r�rrrrsz
datetime.timecCs t|j|j|j|j|j|jd�S)z'Return the time part, with same tzinfo.r@)rr�r�r�rVr>r�r�rrr�timetzs�zdatetime.timetzc	
Cs�|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}|dkrb|j}|dkrp|j}|	dkr~|j}	t	|�|||||||||	d�	S)z?Return a new datetime with new values for the specified fields.NTr@)
rrr!r�r�r�rVr�r�r�)
r�rrr!r�r�r�rVr�r�rrrr_s.�zdatetime.replacecCs\|jdkr|��}n|ttdd�}t�|�}t|dd��}|j}|j}t	t|d�|�S)Nrr�r0)
r�r�r�rOr2r�r2�	tm_gmtoff�tm_zoner~)r�ZtsZlocaltmr�ZgmtoffZzonerrr�_local_timezone4s


zdatetime._local_timezonecCs�|dkr|��}nt|t�s$td��|j}|dkrF|��}|�|�}n,|�|�}|dkrr|jdd���}|�|�}||kr~|S||j|d�}|�|�S)Nz)tz argument must be an instance of tzinfo�r�)r�r�r�r�rXr_r4)r�r�rQZmyoffsetrrrr�
astimezone@s 



zdatetime.astimezonecCs:|��dpd}dt|t|j|j|j|j|j|jfS)rr1z%s %s %2d %02d:%02d:%02d %04d)	rrrr�r�r:r;r<r�rrrrr[s�zdatetime.ctime�Tr:cCsNd|j|j|j|ft|j|j|j|j|�}|��}t	|�}|rJ||7}|S)a�Return the time formatted according to ISO.

        The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.
        By default, the fractional part is omitted if self.microsecond == 0.

        If self.tzinfo is not None, the UTC offset is also attached, giving
        giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.

        Optional argument sep specifies the separator between date and
        time, default 'T'.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        z%04d-%02d-%02d%c)
r�r�r�rGr:r;r<r=rXrS)r��seprErQrPr�rrrres��zdatetime.isoformatcCs�|j|j|j|j|j|j|jg}|ddkr2|d=|ddkrD|d=d|jj|jj	d�
tt|��f}|j
dk	r�|dd�dks�t�|dd�d|j
d}|jr�|dd�dks�t�|dd�d}|S)	rYrrr�r�NrZr[r\)r�r�r�r:r;r<r=r�r�r�r`�mapr�r>rr?)r��LrQrrrr��s*��
zdatetime.__repr__cCs|jdd�S)zConvert to string, for str().� )r�)rr�rrrr��szdatetime.__str__cCsddl}|�|||�S)zKstring, format -> new datetime parsed from a string (like time.strptime()).rN)�	_strptimeZ_strptime_datetime)r�r	rCr�rrr�strptime�szdatetime.strptimecCs(|jdkrdS|j�|�}td|�|S)z\Return the timezone offset as timedelta positive east of UTC (negative west of
        UTC).NrXr^r_rrrrX�s


zdatetime.utcoffsetcCs&|jdkrdS|j�|�}t|�|Sr`rarbrrrrZ�s

zdatetime.tznamecCs(|jdkrdS|j�|�}td|�|Srcrdr_rrrr��s
	

zdatetime.dstcCs2t|t�r|j|dd�dkSt|t�s*tSdSdS)NTrNrF)r�r2r	r�r�r�rrrr��s


zdatetime.__eq__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr��r�r2r	r�r�r�r�rrrr��s


zdatetime.__le__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__lt__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__ge__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__gt__Fc		Cst|t�st�|j}|j}d}}||kr0d}nT|��}|��}|r|||j|jd���kr`dS||j|jd���kr|dS||k}|r�t|j|j	|j
|j|j|j
|jf|j|j	|j
|j|j|j
|jf�S|dks�|dkr�|r�dStd��||}|jdk�rdS|�rd�pdS)NTr@rz(cannot compare naive and aware datetimesrrr)r�r2rr>rXr_r�r	r�r�r�r:r;r<r=r�rN)	r�r�rOrQrRrSrTrUZdiffrrrr	�sH���z
datetime._cmpc
Cs�t|t�stSt|��|j|j|j|jd�}||7}t|j	d�\}}t|d�\}}d|j
krhtkr�nn*t|��
t�|j
�t||||j|jd��Std��dS)zAdd a datetime and a timedelta.r{r�r�rr�rN)r�rOr�rr:r;r<r=r*r=rNrr�r�r�rrr?r>r�)r�r�r3r�Zremr�r�rrrr�s&
���zdatetime.__add__c	Cs�t|t�s"t|t�r||StS|��}|��}|j|jd|jd}|j|jd|jd}t|||||j|j�}|j	|j	kr�|S|�
�}|�
�}||kr�|S|dks�|dkr�td��|||S)z6Subtract two datetimes, or a datetime and a timedelta.r�r�Nz(cannot mix naive and timezone-aware time)r�r2rOr�rr<r;r:r=r>rXr�)	r�r�r r!Zsecs1Zsecs2�baserSrTrrrr�&s*



�zdatetime.__sub__cCs�|jdkr�|jr|jdd�}n|}|��}|dkrFt|��d�|_nDt|j|j|j	�}|j
d|jd|j}tt
|||j�|�|_|jS)Nrrr@r�r�)r�r�r_rXr�r�r#rrr!r�r�r�rOrV)r�r�rWrNr=rrrr�>s
zdatetime.__hash__r'c	Cs�t|jd�\}}t|jd�\}}t|d�\}}|j}|jrJ|dkrJ|d7}t||||j|j|j|j	|||g
�}|j
dkr~|fS||j
fSdSre)r*r�r=r�r?r�r�r:r;r<r>)	r�rgr)r*rhrirjr4rkrrrr�Os"�
zdatetime._getstatec	
Cs�|dk	rt|t�std��|\
}}}|_|_|_|_}}}|dkrTd|_|d|_nd|_||_|d||_	|d>|Bd>|B|_
||_dS)NrlrArrfrr(rk)r�rmr�r�r:r;r<r?r�r�r=r>)	r�r+r�r)r*r4rjrhrirrrr,^s"�zdatetime.__setstatecCs|j|�|�fSr�r�rnrrrromszdatetime.__reduce_ex__cCs
|�d�Srprqr�rrrr�pszdatetime.__reduce__)NNrrrrN)N)N)T)NNNNNNNT)N)r�r:)F)r')5r�r�r�r�r�r�rr�r�r�r�r�rVr�r�r-r|rr}r~rr�r
rcr�r�r�r�r_r�r�rrr�r�r�rXrZr�r�r�r�r�r�r	r�r�r�r�r�rrror�rrrrr2s���$






+	



#	��



	

%
r2cCs8d}t|dd�}|dd}||}||kr4|d7}|S)Nr'rr0r1)r#)rZTHURSDAYZfirstdayZfirstweekdayr%rrrrysrc@s�eZdZdZe�Zefdd�Zeddd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zeddd�ZeZedd��ZdS)r~)�_offset�_namecCslt|t�std��||jkr,|s&|jSd}nt|t�s>td��|j|krV|jks`ntd��|�	||�S)Nzoffset must be a timedeltazname must be a stringzYoffset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).)
r�rOr��_Omittedrr��
_minoffset�
_maxoffsetrB�_create)r�rfr�rrrr��s


ztimezone.__new__NcCst�|�}||_||_|Sr�)r�r�r�r�)r�rfr�r�rrrr��s
ztimezone._createcCs|jdkr|jfS|j|jfS)zpickle supportN)r�r�r�rrrr5�s
ztimezone.__getinitargs__cCst|t�r|j|jkStSr�)r�r~r�r�r�rrrr��s
ztimezone.__eq__cCs
t|j�Sr�)r�r�r�rrrr��sztimezone.__hash__cCsL||jkrdS|jdkr0d|jj|jj|jfSd|jj|jj|j|jfS)aConvert to formal string, for repr().

        >>> tz = timezone.utc
        >>> repr(tz)
        'datetime.timezone.utc'
        >>> tz = timezone(timedelta(hours=-5), 'EST')
        >>> repr(tz)
        "datetime.timezone(datetime.timedelta(-1, 68400), 'EST')"
        zdatetime.timezone.utcNz	%s.%s(%r)z
%s.%s(%r, %r))rr�r�r�r�r�r�rrrr��s


��ztimezone.__repr__cCs
|�d�Sr�)rZr�rrrr��sztimezone.__str__cCs$t|t�s|dkr|jStd��dS)Nz8utcoffset() argument must be a datetime instance or None)r�r2r�r�r0rrrrX�sztimezone.utcoffsetcCs:t|t�s|dkr.|jdkr(|�|j�S|jStd��dS)Nz5tzname() argument must be a datetime instance or None)r�r2r��_name_from_offsetr�r�r0rrrrZ�s

ztimezone.tznamecCs"t|t�s|dkrdStd��dS)Nz2dst() argument must be a datetime instance or None)r�r2r�r0rrrr��sztimezone.dstcCs2t|t�r&|j|k	rtd��||jStd��dS)Nzfromutc: dt.tzinfo is not selfz6fromutc() argument must be a datetime instance or None)r�r2r�rBr�r�r0rrrr4�s



ztimezone.fromutcr(r)r;r?c
Cs�|sdS|td�kr d}|}nd}t|tdd��\}}t|tdd��\}}|j}|j}|r�d|�|d�d	|d�d	|d�d
|d��	S|r�d|�|d�d	|d�d	|d��Sd|�|d�d	|d��S)NZUTCrrIrJrrKrLZ02drorpZ06d)rOr*r=r?)r3rRr;rhr<r=r?rrrr��s( ztimezone._name_from_offset)N)r�r�r�r�rbr�r�r-r�r5r�r�r�r�rXrZr�r4rOr�r��staticmethodr�rrrrr~�s$	r~rVr�r�)�*)r�)r:);r�rr2Zmathr�rwr	r�r�rrrZdbmr"r[rrrrr#r+r,r-rr/rrr9rGrSrjrnrwr�r�r�r�r�r�r�r�r�rOrvr�Z
resolutionr�r�r�rmr�r2rr~r�rr�Z	_datetime�ImportErrorrrrr�<module>s�

	?�
@') 
=

�[DXatG
imp.cpython-38.opt-2.pyc000064400000016426151450073350010735 0ustar00U

e5d()�@s�ddlmZmZmZmZmZmZmZmZm	Z	zddlm
Z
Wnek
rTdZ
YnXddlm
Z
mZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejded	d
�dZdZd	ZdZ d
Z!dZ"dZ#dZ$dZ%dZ&dd�Z'dd�Z(dd�Z)d7dd�Z*dd�Z+dd�Z,Gdd �d �Z-Gd!d"�d"�Z.Gd#d$�d$e.ej/�Z0d8d%d&�Z1Gd'd(�d(e.e�Z2d9d)d*�Z3d+d,�Z4d-d.�Z5d:d/d0�Z6d1d2�Z7d3d4�Z8e
�r�d;d5d6�Z9ndZ9dS)<�)	�	lock_held�acquire_lock�release_lock�get_frozen_object�is_frozen_package�init_frozen�
is_builtin�	is_frozen�_fix_co_filename)�create_dynamicN)�_ERR_MSG�_exec�_load�_builtin_from_name)�SourcelessFileLoader)�	machinery)�utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses�)�
stacklevel��������	cCs
t�|�S�N)�types�
ModuleType��name�r"�/usr/lib64/python3.8/imp.py�
new_module0sr$cCstjSr)r�MAGIC_NUMBERr"r"r"r#�	get_magic;sr&cCstjjSr)�sys�implementation�	cache_tagr"r"r"r#�get_tagCsr*c
Cs6t���$t�d�t�||�W5QR�SQRXdS)N�ignore)�warnings�catch_warnings�simplefilterr�cache_from_source)�path�debug_overrider"r"r#r/Hs

r/cCs
t�|�Sr)r�source_from_cache�r0r"r"r#r2[sr2cCs<dd�tjD�}dd�tjD�}dd�tjD�}|||S)NcSsg|]}|dtf�qS��rb)�C_EXTENSION��.0�sr"r"r#�
<listcomp>ksz get_suffixes.<locals>.<listcomp>cSsg|]}|dtf�qS)�r)�	PY_SOURCEr7r"r"r#r:lscSsg|]}|dtf�qSr4)�PY_COMPILEDr7r"r"r#r:ms)r�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXES)�
extensions�source�bytecoder"r"r#�get_suffixesisrDc@seZdZdd�Zdd�ZdS)�NullImportercCs2|dkrtddd��ntj�|�r.td|d��dS)N�zempty pathnamer3zexisting directory)�ImportError�osr0�isdir)�selfr0r"r"r#�__init__zszNullImporter.__init__cCsdSrr")rJ�fullnamer"r"r#�find_module�szNullImporter.find_moduleN)�__name__�
__module__�__qualname__rKrMr"r"r"r#rErsrEcs*eZdZd�fdd�	Z�fdd�Z�ZS)�_HackedGetDataNcst��||�||_dSr)�superrK�file)rJrLr0rS��	__class__r"r#rK�sz_HackedGetData.__init__c
s||jrl||jkrl|jjs0|j}d|jkr0|��|jjrJt|jd�|_}|�|��W5QR�SQRXnt��|�SdS)N�br5)	rSr0�closed�mode�close�open�readrR�get_data)rJr0rSrTr"r#r\�s
z_HackedGetData.get_data)N)rNrOrPrKr\�
__classcell__r"r"rTr#rQ�srQc@seZdZdS)�_LoadSourceCompatibilityN�rNrOrPr"r"r"r#r^�sr^cCs\t|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t�||�|_	|j	|j
_|S�N)�loader)r^r�spec_from_file_locationr'�modulesr
rr�SourceFileLoader�
__loader__�__spec__ra�r!�pathnamerSra�spec�moduler"r"r#�load_source�s

rkc@seZdZdS)�_LoadCompiledCompatibilityNr_r"r"r"r#rl�srlcCsZt|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t||�|_|j|j	_
|Sr`)rlrrbr'rcr
rrrerfrargr"r"r#�
load_compiled�s

rmcCs�tj�|�rftjdd�tjdd�}|D]*}tj�|d|�}tj�|�r,|}qfq,td�	|���t
j||gd�}|tj
kr�t|tj
|�St|�SdS)NrKz{!r} is not a package)�submodule_search_locations)rHr0rIrr?r@�join�exists�
ValueError�formatrrbr'rcr
r)r!r0rA�	extensionZ	init_pathrir"r"r#�load_package�s ��
rtc	
Cs$|\}}}|r0|�d�r d|kr0td�|���n�|dkrX|tthkrXd�|�}t|��n�|tkrlt|||�S|tkr�t|||�S|tkr�tdk	r�|dkr�t	|d��}t|||�W5QR�SQRXnt|||�SnN|t
kr�t||�S|tk�r�t
|�S|tk�rt|�Sd�||�}t||d��dS)N)r;�U�+zinvalid file open mode {!r}z.file object required for import (type code {})r5z*Don't know how to import {} (type code {})r )�
startswithrqrrr<r=rkrmr6�load_dynamicrZ�
PKG_DIRECTORYrt�	C_BUILTIN�init_builtin�	PY_FROZENrrG)	r!rS�filenameZdetails�suffixrX�type_�msgZopened_filer"r"r#�load_module�s.


 


r�c	Cs�t|t�std�t|����n$t|td�tf�sBtd�t|����|dkr�t|�rbddddtffSt	|�rzddddt
ffStj}|D]�}t
j�||�}dtjdfD]>}d|}t
j�||�}t
j�|�r�d|ddtffSq�t�D]2\}}}||}	t
j�||	�}t
j�|�r��q q�q��q:q�tt�|�|d��d}
d|k�rnt|d	��}t�|j�d}
W5QRXt|||
d
�}|||||ffS)Nz'name' must be a str, not {}z%'path' must be None or a list, not {}rFz.pyrrKr rVr5)�encoding)�
isinstance�str�	TypeErrorrr�type�list�RuntimeErrorrrzr	r|r'r0rHrorr@�isfileryrDrGrrZ�tokenize�detect_encoding�readline)r!r0�entryZpackage_directoryr~Zpackage_file_nameZ	file_pathrXr�	file_namer�rSr"r"r#rM�sB
�
rMcCs
t�|�Sr)�	importlib�reload)rjr"r"r#r�2sr�cCs&z
t|�WStk
r YdSXdSr)rrGr r"r"r#r{=s
r{cCs0ddl}|j�||�}|jj|||d�}t|�S)Nr)r!ra�origin)�importlib.machineryr�ExtensionFileLoader�
ModuleSpecr)r!r0rSr�rarir"r"r#rxJs�rx)N)N)N)N)N):�_imprrrrrrrr	r
rrGZimportlib._bootstraprr
rrZimportlib._bootstrap_externalrr�rrrHr'r�rr,�warn�DeprecationWarningZSEARCH_ERRORr<r=r6ZPY_RESOURCEryrzr|ZPY_CODERESOURCEZIMP_HOOKr$r&r*r/r2rDrErQrdr^rkrlrmrtr�rMr�r{rxr"r"r"r#�<module>	s`,
�
	

#
4bisect.cpython-38.pyc000064400000004464151450073350010460 0ustar00U

e5d��@sZdZddd�Zd
dd�Zddd�Zdd	d
�ZzddlTWnek
rLYnXeZeZdS)zBisection algorithms.�NcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_right�insert��a�x�lo�hi�r	�/usr/lib64/python3.8/bisect.py�insort_rights	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krF|}q |d}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e <= x, and all e in
    a[i:] have e > x.  So if x already appears in the list, a.insert(x) will
    insert just after the rightmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    r�lo must be non-negativeN����
ValueError�len�rrrrZmidr	r	r
rs
rcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the left of the leftmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_leftrrr	r	r
�insort_left$s	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krJ|d}q |}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, a.insert(x) will
    insert just before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    rrNr
rrrr	r	r
r1s
r)�*)rN)rN)rN)rN)	�__doc__rrrrZ_bisect�ImportErrorZbisectZinsortr	r	r	r
�<module>s



sndhdr.cpython-38.pyc000064400000015517151450073350010472 0ustar00U

e5d��@s2dZddgZddlmZedd�Zdej_dej_d	ej_d
ej_dej	_dd�Z
d
d�ZgZdd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zed*k�r.e�d+S),a�Routines to help recognizing sound files.

Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.

The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- number of channels (0 if unknown or hard to decode)
- number of frames in the file (-1 if unknown or hard to decode)
- number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW

If the file doesn't have a recognizable type, it returns None.
If the file can't be opened, OSError is raised.

To compute the total time, divide the number of frames by the
sampling rate (a frame contains a sample for each channel).

Function what() calls whathdr().  (It used to also use some
heuristics for raw data, but this doesn't work very well.)

Finally, the function test() is a simple main program that calls
what() for all files mentioned on the argument list.  For directory
arguments it calls what() for all files in that directory.  Default
argument is "." (testing all files in the current directory).  The
option -r tells it to recurse down directories found inside
explicitly given directories.
�what�whathdr�)�
namedtuple�
SndHeadersz.filetype framerate nchannels nframes sampwidthz�The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.zYThe sampling_rate will be either the actual
value or 0 if unknown or difficult to decode.z^The number of channels or 0 if it cannot be
determined or if the value is difficult to decode.z?The value for frames will be either the number
of frames or -1.zAEither the sample size in bits or
'A' for A-LAW or 'U' for u-LAW.cCst|�}|S)zGuess the type of a sound file.)r)�filename�res�r�/usr/lib64/python3.8/sndhdr.pyr4sc
Cs^t|d��J}|�d�}tD]*}|||�}|rt|�W5QR�SqW5QR�dSQRXdS)zRecognize sound headers.�rbiN)�open�read�testsr)r�f�hZtfrrrr	r:s

c	Cs�ddl}|�d�sdS|dd�dkr,d}n|dd�dkrBd}ndS|�d�z|�|d	�}Wnt|jfk
r|YdSX||��|��|��d|�	�fS)
Nr�FORM��sAIFC�aifcsAIFFZaiff�r)
r�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrrZfmt�arrr	�	test_aifcKs"


�rc
Cs�|�d�rt}n|dd�dkr&t}ndSd}||dd��}||dd��}||dd��}||dd��}||dd	��}d
}	|d
kr�d}
n$|dkr�d}
n|d
kr�d}
d}	nd}
|	|}|r�||}nd}|||||
fS)Ns.snd�)sds.sdns.Zaurr�����U���?���)r�get_long_be�get_long_le)
rr�func�filetypeZhdr_size�	data_size�encoding�rate�	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	�test_au`s2

r1cCsT|dd�dks |dd�dkr$dSt|dd��}|rBd	|}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"VrZhcomr#r(r)r))rrZdivisorr/rrr	�	test_hcom�s 
r8cCst|�d�sdSt|dd��}d}d|kr6dkrfnn,||dkrfd||d}|rftd	|�}d
|dddfS)
NsCreative Voice Filer!�ri�r#�rg��.AZvocr(r)r�get_short_le�int)rrZsbseekr/Zratecoderrr	�test_voc�s
$r=c	Cs�ddl}|�d�r2|dd�dks2|dd�dkr6dS|�d�z|�|d�}Wnt|jfk
rlYdSXd	|��|��|��d|�	�fS)
NrsRIFFrrsWAVEr sfmt rZwav)
�waverrrrrrrrr)rrr>�wrrr	�test_wav�s*

�r@cCs"|�d�r|dd�dkrdSdS)Nrrrs8SVX)Z8svxrr#rr)r)rrrrr	�	test_8svx�srAcCs<|�d�r8t|dd��}t|dd��}d|d|dfSdS)NsSOUNDrrr!r9Zsndtr#)rr*r;)rrZnsamplesr/rrr	�	test_sndt�s
rBcCsD|�d�r@t|dd��}d|kr.dkr@nnd|ddd	fSdS)
Nsr%ri�i�aZsndrr#r(r)rr;)rrr/rrr	�	test_sndr�s
rCcCs,|dd>|dd>B|dd>B|dBS)Nrr"r#r r%rr&r��brrr	r)�sr)cCs,|dd>|dd>B|dd>B|dBS)Nr&r"r%r r#rrrrDrrr	r*�sr*cCs|dd>|dBS)Nrrr#rrDrrr	�get_short_be�srFcCs|dd>|dBS)Nr#rrrrDrrr	r;�sr;cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr#z-rr%�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rH�	recursiverrr	�test�srPc	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rH�os�path�isdir�print�glob�join�escaperJ�stdout�flushr�OSError)�listrOZtoplevelrHrUrrY�namesrrr	rJ�s"

rJ�__main__N)�__doc__�__all__�collectionsrrr,Z	framerater0ZnframesZ	sampwidthrrr
r�appendr1r8r=r@rArBrCr)r*rFr;rPrJ�__name__rrrr	�<module>sJ �









calendar.cpython-38.opt-2.pyc000064400000053712151450073350011720 0ustar00U

e5da�@s0ddlZddlZddlZddlmZddddddd	d
ddd
dddddddddddddgZeZGdd�de�Z	Gdd�de�Z
dZdZddd dd!dd!ddd!dd!dg
Z
Gd"d#�d#�ZGd$d%�d%�Zed&�Zed'�Zed(�Zed)�Zed*�\ZZZZZZZd+d�Zd,d�Zd-d	�Zd.d
�Zd/d0�Z d1d2�Z!d3d4�Z"Gd5d�de#�Z$Gd6d�de$�Z%Gd7d�de$�Z&Gd8d9�d9�Z'Gd:d�de%�Z(Gd;d�de&�Z)e%�Z*e*j+Z,d<d�Z-e*j.Z/e*j0Z0e*j1Z2e*j3Z4e*j5Z5e*j6Z7e*j8Z9e*j:Z;d=Z<d>Z=e<e=fd?d@�Z>e<e=fdAdB�Z?dCZ@e�Ae@dd��B�ZCdDd�ZDdEdF�ZEeFdGk�r,eEejG�dS)H�N)�repeat�IllegalMonthError�IllegalWeekdayError�setfirstweekday�firstweekday�isleap�leapdays�weekday�
monthrange�
monthcalendar�prmonth�month�prcal�calendar�timegm�
month_name�
month_abbr�day_name�day_abbr�Calendar�TextCalendar�HTMLCalendar�LocaleTextCalendar�LocaleHTMLCalendar�
weekheaderc@seZdZdd�Zdd�ZdS)rcCs
||_dS�N�r
)�selfr
�r� /usr/lib64/python3.8/calendar.py�__init__szIllegalMonthError.__init__cCs
d|jS)Nz!bad month number %r; must be 1-12r�rrrr�__str__szIllegalMonthError.__str__N��__name__�
__module__�__qualname__r r"rrrrrsc@seZdZdd�Zdd�ZdS)rcCs
||_dSr�r	)rr	rrrr  szIllegalWeekdayError.__init__cCs
d|jS)Nz7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)r'r!rrrr""szIllegalWeekdayError.__str__Nr#rrrrrs�����c@sFeZdZdd�ed�D�Ze�ddd��dd�Zd	d
�Zdd�Zd
S)�_localized_monthcCs g|]}t�d|dd�j�qS�i�r(��datetime�date�strftime��.0�irrr�
<listcomp>4sz_localized_month.<listcomp>�rcCsdS)N�r)�xrrr�<lambda>5�z_localized_month.<lambda>cCs
||_dSr��format�rr=rrrr 7sz_localized_month.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<�r4�fr!rrr6=sz0_localized_month.__getitem__.<locals>.<listcomp>)�_months�
isinstance�slicer=�rr5Zfuncsrr!r�__getitem__:s

z_localized_month.__getitem__cCsdS)N�
rr!rrr�__len__Asz_localized_month.__len__N)	r$r%r&�rangerA�insertr rErGrrrrr-2s
r-c@s6eZdZdd�ed�D�Zdd�Zdd�Zdd	�Zd
S)�_localized_daycCs g|]}t�dd|d�j�qSr.r/r3rrrr6Hsz_localized_day.<listcomp>�cCs
||_dSrr<r>rrrr Jsz_localized_day.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<r?r!rrr6Psz._localized_day.__getitem__.<locals>.<listcomp>)�_daysrBrCr=rDrr!rrEMs

z_localized_day.__getitem__cCsdS�NrKrr!rrrrGTsz_localized_day.__len__N)r$r%r&rHrLr rErGrrrrrJEsrJz%Az%az%Bz%brKcCs$|ddko"|ddkp"|ddkS)N�r�d�r)�yearrrrrdscCs@|d8}|d8}|d|d|d|d|d|dS)Nr(rNrOrPr)Zy1Zy2rrrriscCs8tj|krtjks&nd|d}t�|||���S)Ni�rP)r0ZMINYEARZMAXYEARr1r	)rQr
�dayrrrr	qscCsJd|krdksnt|��t||d�}t||tko>t|�}||fS�Nr(r7)rr	�mdays�Februaryr)rQr
�day1�ndaysrrrr
xs
cCst||tkot|�Sr)rTrUr�rQr
rrr�	_monthlen�srYcCs$|dkr|ddfS||dfSdSrSrrXrrr�
_prevmonth�srZcCs$|dkr|ddfS||dfSdS)Nr7r(rrXrrr�
_nextmonth�sr[c@s�eZdZd"dd�Zdd�Zdd�Zeee�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd#dd�Zd$dd�Zd%dd �Zd!S)&rrcCs
||_dSr�r�rrrrrr �szCalendar.__init__cCs
|jdSrM�Z
_firstweekdayr!rrr�getfirstweekday�szCalendar.getfirstweekdaycCs
||_dSrr^r]rrrr�szCalendar.setfirstweekdayccs&t|j|jd�D]}|dVqdSrM)rHr)rr5rrr�iterweekdays�szCalendar.iterweekdaysccs,|�||�D]\}}}t�|||�VqdSr)�itermonthdays3r0r1)rrQr
�y�m�drrr�itermonthdates�szCalendar.itermonthdatesccsft||�\}}||jd}td|�EdHtd|d�EdH|j||d}td|�EdHdS)NrKrr()r
rrrH)rrQr
rVrW�days_before�
days_afterrrr�
itermonthdays�szCalendar.itermonthdaysccs0t|�||�|j�D]\}}||dfVqdSrM)�	enumeraterhr)rrQr
r5rdrrr�itermonthdays2�szCalendar.itermonthdays2ccs�t||�\}}||jd}|j||d}t||�\}}t||�d}	t|	||	�D]}
|||
fVqXtd|d�D]}
|||
fVqxt||�\}}td|d�D]}
|||
fVq�dS)NrKr()r
rrZrYrHr[)rrQr
rVrWrfrgrbrc�endrdrrrra�szCalendar.itermonthdays3ccs<t|�||��D]&\}\}}}||||j|dfVqdSrM)rirar)rrQr
r5rbrcrdrrr�itermonthdays4�szCalendar.itermonthdays4cs.t|�||����fdd�tdt��d�D�S)Ncsg|]}�||d��qS�rKrr3�Zdatesrrr6�sz/Calendar.monthdatescalendar.<locals>.<listcomp>rrK)�listrerH�len�rrQr
rrnr�monthdatescalendar�szCalendar.monthdatescalendarcs.t|�||����fdd�tdt��d�D�S)Ncsg|]}�||d��qSrmrr3��daysrrr6�sz/Calendar.monthdays2calendar.<locals>.<listcomp>rrK)rorjrHrprqrrsr�monthdays2calendar�szCalendar.monthdays2calendarcs.t|�||����fdd�tdt��d�D�S)Ncsg|]}�||d��qSrmrr3rsrrr6�sz.Calendar.monthdayscalendar.<locals>.<listcomp>rrK)rorhrHrprqrrsr�monthdayscalendar�szCalendar.monthdayscalendar�cs>��fdd�tttd�D����fdd�tdt����D�S)Ncsg|]}���|��qSr)rrr3�rrQrrr6s�z.Calendar.yeardatescalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3��months�widthrrr6	sr�rH�Januaryrp�rrQr{r�rzrr{rQr�yeardatescalendar�s�zCalendar.yeardatescalendarcs>��fdd�tttd�D����fdd�tdt����D�S)Ncsg|]}���|��qSr)rur3rxrrr6s�z.Calendar.yeardays2calendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3ryrrr6srr|r~rrr�yeardays2calendars�zCalendar.yeardays2calendarcs>��fdd�tttd�D����fdd�tdt����D�S)Ncsg|]}���|��qSr)rvr3rxrrr6s�z-Calendar.yeardayscalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3ryrrr6"srr|r~rrr�yeardayscalendars�zCalendar.yeardayscalendarN)r)rw)rw)rw)r$r%r&r r_r�propertyrr`rerhrjrarlrrrurvr�r�r�rrrrr�s 

	



c@sfeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zddd
�Zddd�Z	ddd�Z
ddd�Zd dd�ZdS)!rcCst|�||�dd�dS�Nr8)rk)�print�
formatweek�r�theweekr{rrr�prweek+szTextCalendar.prweekcCs |dkrd}nd|}|�|�S)Nrr8z%2i��center)rrRr	r{�srrr�	formatday1szTextCalendar.formatdaycsd���fdd�|D��S)N� c3s |]\}}��||��VqdSr�r��r4rdZwd�rr{rr�	<genexpr>?sz*TextCalendar.formatweek.<locals>.<genexpr>��joinr�rr�rr�;szTextCalendar.formatweekcCs(|dkrt}nt}||d|��|�S�N�	)rrr�)rrRr{�namesrrr�
formatweekdayAszTextCalendar.formatweekdaycsd���fdd����D��S)Nr�c3s|]}��|��VqdSr�r�r3r�rrr�Osz0TextCalendar.formatweekheader.<locals>.<genexpr>�r�r`r�rr�r�formatweekheaderKszTextCalendar.formatweekheaderTcCs"t|}|rd||f}|�|�S�Nz%s %r)rr��r�theyear�themonthr{�withyearr�rrr�formatmonthnameQszTextCalendar.formatmonthnamercCst|�||||�dd�dSr�)r��formatmonth)rr�r��w�lrrrrZszTextCalendar.prmonthcCs�td|�}td|�}|�||d|dd�}|��}|d|7}||�|���7}|d|7}|�||�D]$}||�||���7}|d|7}ql|S)Nr)r(rK�
)�maxr��rstripr�rur�)rr�r�r�r�r��weekrrrr�`s

zTextCalendar.formatmonthr)r(�rwc	s�td|�}td|�}td|�}|ddd�g}|j}|t����|||d����|d|���|��t���|��D�]"\}}	t||dt	||ddd��}
|d|����fdd�|
D�}|t
|�|����|d|��fdd�|
D�}|t
|�|����|d|�td	d�|	D��}
t|
�D]f}g}|	D]6}|t|�k�rj|�d
�n|���|||���qL|t
|�|����|d|��q@q�d
�
|�S)Nr)r(rKr�rFc3s|]}���|�d�VqdS)FN)r��r4�k)�colwidthrr�rrr��s�z*TextCalendar.formatyear.<locals>.<genexpr>c3s|]
}�VqdSrrr�)�headerrrr��scss|]}t|�VqdSr)rp)r4�calrrrr��sr8)r��append�reprr�r�r�rir�rH�min�formatstringrpr�r�)rr�r�r��crc�v�ar5�rowrzr�ZheadersZheight�jZweeksr�r)r�r�rr�r�
formatyearps<


&
$�zTextCalendar.formatyearcCst|�|||||�dd�dSr�)r�r�)rr�r�r�r�rcrrr�pryear�szTextCalendar.pryearN)T)rr)rr)r)r(r�rw)rrr�rw)
r$r%r&r�r�r�r�r�r�rr�r�r�rrrrr%s


	


%c@s~eZdZdddddddgZeZdZd	Zd	Zd
Zd
Z	dd�Z
d
d�Zdd�Zdd�Z
ddd�Zd dd�Zd!dd�Zd"dd�ZdS)#rZmonZtueZwedZthuZfriZsatZsunZnodayr
rQcCs(|dkrd|jSd|j||fSdS)Nrz<td class="%s">&nbsp;</td>z<td class="%s">%d</td>)�cssclass_noday�
cssclasses)rrRr	rrrr��s
zHTMLCalendar.formatdaycs d��fdd�|D��}d|S)Nr8c3s|]\}}��||�VqdSrr�r�r!rrr��sz*HTMLCalendar.formatweek.<locals>.<genexpr>�<tr>%s</tr>r�)rr�r�rr!rr��szHTMLCalendar.formatweekcCsd|j|t|fS�Nz<th class="%s">%s</th>)�cssclasses_weekday_headr)rrRrrrr��s�zHTMLCalendar.formatweekdaycs$d��fdd����D��}d|S)Nr8c3s|]}��|�VqdSrr�r3r!rrr��sz0HTMLCalendar.formatweekheader.<locals>.<genexpr>r�r�)rr�rr!rr��szHTMLCalendar.formatweekheaderTcCs0|rdt||f}ndt|}d|j|fS)N�%s %sz%sz+<tr><th colspan="7" class="%s">%s</th></tr>)r�cssclass_month_head�rr�r�r�r�rrrr��s�zHTMLCalendar.formatmonthnamecCs�g}|j}|d|j�|d�||j|||d��|d�||���|d�|�||�D]}||�|��|d�q\|d�|d�d�|�S)N�=<table border="0" cellpadding="0" cellspacing="0" class="%s">r��r��</table>r8)r��cssclass_monthr�r�rur�r�)rr�r�r�r�r�r�rrrr��s �
zHTMLCalendar.formatmonthrwcCs�g}|j}t|d�}|d|j�|d�|d||j|f�tttd|�D]V}t|t||d��}|d�|D](}|d�||j||d	d
��|d�qr|d�qN|d
�d�|�S)Nr(r�r�z,<tr><th colspan="%d" class="%s">%s</th></tr>r7rFz<tr>z<td>Fr�z</td>z</tr>r�r8)	r�r��
cssclass_year�cssclass_year_headrHr}r�r�r�)rr�r{r�r�r5rzrcrrrr��s,
��

zHTMLCalendar.formatyear�calendar.cssNcCs�|dkrt��}g}|j}|d|�|d�|d�|d�|d|�|dk	r^|d|�|d|�|d�|d	�||�||��|d
�|d�d�|��|d
�S)Nz$<?xml version="1.0" encoding="%s"?>
zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
z<html>
z<head>
zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />
z4<link rel="stylesheet" type="text/css" href="%s" />
z<title>Calendar for %d</title>
z</head>
z<body>
z</body>
z</html>
r8�xmlcharrefreplace)�sys�getdefaultencodingr�r�r��encode)rr�r{�css�encodingr�r�rrr�formatyearpage
s$zHTMLCalendar.formatyearpage)T)T)rw)rwr�N)r$r%r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�s



c@s$eZdZdd�Zdd�Zdd�ZdS)�different_localecCs
||_dSr��locale)rr�rrrr #szdifferent_locale.__init__cCs"t�tj�|_t�tj|j�dSr)�_localeZ	getlocale�LC_TIME�	oldlocale�	setlocaler�r!rrr�	__enter__&szdifferent_locale.__enter__cGst�tj|j�dSr)r�r�r�r�)r�argsrrr�__exit__*szdifferent_locale.__exit__N)r$r%r&r r�r�rrrrr�"sr�c@s(eZdZd
dd�Zdd�Zddd	�ZdS)rrNcCs&t�||�|dkrt��}||_dSr)rr r��getdefaultlocaler��rrr�rrrr 6szLocaleTextCalendar.__init__c
CsNt|j��:|dkrt}nt}||}|d|��|�W5QR�SQRXdSr�)r�r�rrr�)rrRr{r��namerrrr�<sz LocaleTextCalendar.formatweekdayTc
CsDt|j��0t|}|r$d||f}|�|�W5QR�SQRXdSr�)r�r�rr�r�rrrr�Es
z"LocaleTextCalendar.formatmonthname)rN)T�r$r%r&r r�r�rrrrr.s
	c@s(eZdZd
dd�Zdd�Zddd	�ZdS)rrNcCs&t�||�|dkrt��}||_dSr)rr r�r�r�r�rrrr TszLocaleHTMLCalendar.__init__c
Cs<t|j��(t|}d|j||fW5QR�SQRXdSr�)r�r�rr�)rrRr�rrrr�Zsz LocaleHTMLCalendar.formatweekdayTc
CsBt|j��.t|}|r$d||f}d|W5QR�SQRXdS)Nr�z.<tr><th colspan="7" class="month">%s</th></tr>)r�r�rr�rrrr�_s
z"LocaleHTMLCalendar.formatmonthname)rN)Tr�rrrrrMs
cCs(t|krtksnt|��|t_dSr)�MONDAY�SUNDAYrr�rr\rrrrls�r�cCstt|||��dSr)r�r��Zcolsr��spacingrrrr=�sr=cs |d9}|��fdd�|D��S)Nr�c3s|]}|���VqdSrr�)r4r��r�rrr��szformatstring.<locals>.<genexpr>r�r�rr�rr��sr�i�cCs^|dd�\}}}}}}t�||d���t|d}|d|}|d|}	|	d|}
|
S)Nr�r(��<)r0r1�	toordinal�
_EPOCH_ORD)�tuplerQr
rRZhourZminute�secondrtZhoursZminutesZsecondsrrrr�scCs�ddl}|��}|�d�}|�d�}|jddtddd�|jd	d
tddd�|jd
dtddd�|jddtddd�|jddddd�|jddddd�|jddddd�|jd d!d"d#d$d%�|jd&d'td(d)�|jd*d'td+d)�|�|dd��}|j�r|j�s|�d,�t	�
d�|j|jf}|jd-k�r�|j�rDt|d.�}nt
�}|j}|dk�rbt	��}t||jd/�}	t	jjj}
|jdk�r�|
|jtj��jf|	��n6|jdk�r�|
|j|jf|	��n|�d0�t	�
d�n�|j�r�t|d.�}nt�}t|j|jd1�}	|jdk�r$|j|	d2<|j|	d3<|jdk�rH|j tj��jf|	�}n2|jdk�rf|j |jf|	�}n|j!|j|jf|	�}t	jj}
|j�r�|�"|j�}t	jjj}
|
|�dS)4Nrztext only argumentszhtml only argumentsz-wz--widthr)z width of date column (default 2))�type�default�helpz-lz--linesr(z)number of lines for each week (default 1)z-sz	--spacingr�z"spacing between months (default 6)z-mz--monthsrwzmonths per row (default 3)z-cz--cssr�zCSS to use for page)r�r�z-Lz--localez.locale to be used from month and weekday namesz-ez
--encodingzencoding to use for outputz-tz--type�text)r��htmlzoutput type (text or html))r��choicesr�rQ�?zyear number (1-9999))�nargsr�r�r
zmonth number (1-12, text only)z/if --locale is specified --encoding is requiredr�r�)r�r�zincorrect number of arguments)r�r�r�rc)#�argparse�ArgumentParserZadd_argument_group�add_argument�int�
parse_argsr�r��errorr��exitr�rrr��dictr��stdout�buffer�writerQr�r0r1Ztodayr
rrr{�linesr�rzr�r�r�)r�r��parserZ	textgroupZ	htmlgroupZoptionsr�r�r�Zoptdictr��resultrrr�main�s�

����������







r�__main__)Hr�r0r�r��	itertoolsr�__all__�
ValueErrorr�rrr}rUrTr-rJrrrrrHr�ZTUESDAYZ	WEDNESDAYZTHURSDAYZFRIDAYZSATURDAYr�rrr	r
rYrZr[�objectrrrr�rrr�r_rrrvrr�r�r�r�rrr�r
r�rr�rZ	_colwidthZ_spacingr=r�ZEPOCHr1r�r�rrr$�argvrrrr�<module>s��
u	
h
fileinput.cpython-38.pyc000064400000032077151450073350011207 0ustar00U

e5du9�@s�dZddlZddlZddddddd	d
ddd
dgZdad"ddd�dd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�Zdd�Z
Gdd�d�Zdd
�Zd#dd�Zdd �Zed!kr�e�dS)$a
Helper class to quickly write a loop over all standard input files.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty.  If a filename is '-' it
is also replaced by sys.stdin and the optional arguments mode and
openhook are ignored.  To specify an alternative list of filenames,
pass it as the argument to input().  A single file name is also allowed.

Functions filename(), lineno() return the filename and cumulative line
number of the line that has just been read; filelineno() returns its
line number in the current file; isfirstline() returns true iff the
line just read is the first line of its file; isstdin() returns true
iff the line was read from sys.stdin.  Function nextfile() closes the
current file so that the next iteration will read the first line from
the next file (if any); lines not read from the file will not count
towards the cumulative line count; the filename is not changed until
after the first line of the next file has been read.  Function close()
closes the sequence.

Before any lines have been read, filename() returns None and both line
numbers are zero; nextfile() has no effect.  After all lines have been
read, filename() and the line number functions return the values
pertaining to the last line read; nextfile() has no effect.

All files are opened in text mode by default, you can override this by
setting the mode parameter to input() or FileInput.__init__().
If an I/O error occurs during opening or reading a file, the OSError
exception is raised.

If sys.stdin is used more than once, the second and further use will
return no lines, except perhaps for interactive use, or if it has been
explicitly reset (e.g. using sys.stdin.seek(0)).

Empty files are opened and immediately closed; the only time their
presence in the list of filenames is noticeable at all is when the
last file opened is empty.

It is possible that the last line of a file doesn't end in a newline
character; otherwise lines are returned including the trailing
newline.

Class FileInput is the implementation; its methods filename(),
lineno(), fileline(), isfirstline(), isstdin(), nextfile() and close()
correspond to the functions in the module.  In addition it has a
readline() method which returns the next input line, and a
__getitem__() method which implements the sequence behavior.  The
sequence must be accessed in strictly sequential order; sequence
access and readline() cannot be mixed.

Optional in-place filtering: if the keyword argument inplace=1 is
passed to input() or to the FileInput constructor, the file is moved
to a backup file and standard output is directed to the input file.
This makes it possible to write a filter that rewrites its input file
in place.  If the keyword argument backup=".<some extension>" is also
given, it specifies the extension for the backup file, and the backup
file remains around; by default, the extension is ".bak" and it is
deleted when the output file is closed.  In-place filtering is
disabled when standard input is read.  XXX The current implementation
does not work for MS-DOS 8+3 filesystems.

XXX Possible additions:

- optional getopt argument processing
- isatty()
- read(), read(size), even readlines()

�N�input�close�nextfile�filename�lineno�
filelineno�fileno�isfirstline�isstdin�	FileInput�hook_compressed�hook_encodedF��r��mode�openhookcCs(trtjrtd��t|||||d�atS)aReturn an instance of the FileInput class, which can be iterated.

    The parameters are passed to the constructor of the FileInput class.
    The returned instance, in addition to being an iterator,
    keeps global state for the functions of this module,.
    zinput() already activer)�_state�_file�RuntimeErrorr)�files�inplace�backuprr�r�!/usr/lib64/python3.8/fileinput.pyrSs
cCst}da|r|��dS)zClose the sequence.N)rr)�staterrrr`scCststd��t��S)a�
    Close the current file so that the next iteration will read the first
    line from the next file (if any); lines not read from the file will
    not count towards the cumulative line count. The filename is not
    changed until after the first line of the next file has been read.
    Before the first line has been read, this function has no effect;
    it cannot be used to skip the first file. After the last line of the
    last file has been read, this function has no effect.
    �no active input())rrrrrrrrhs
cCststd��t��S)zr
    Return the name of the file currently being read.
    Before the first line has been read, returns None.
    r)rrrrrrrrvscCststd��t��S)z�
    Return the cumulative line number of the line that has just been read.
    Before the first line has been read, returns 0. After the last line
    of the last file has been read, returns the line number of that line.
    r)rrrrrrrrscCststd��t��S)z�
    Return the line number in the current file. Before the first line
    has been read, returns 0. After the last line of the last file has
    been read, returns the line number of that line within the file.
    r)rrrrrrrr�scCststd��t��S)zg
    Return the file number of the current file. When no file is currently
    opened, returns -1.
    r)rrrrrrrr�scCststd��t��S)ze
    Returns true the line just read is the first line of its file,
    otherwise returns false.
    r)rrr	rrrrr	�scCststd��t��S)z]
    Returns true if the last line was read from sys.stdin,
    otherwise returns false.
    r)rrr
rrrrr
�sc@s�eZdZdZd)ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)*ra;FileInput([files[, inplace[, backup]]], *, mode=None, openhook=None)

    Class FileInput is the implementation of the module; its methods
    filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),
    nextfile() and close() correspond to the functions of the same name
    in the module.
    In addition it has a readline() method which returns the next
    input line, and a __getitem__() method which implements the
    sequence behavior. The sequence must be accessed in strictly
    sequential order; random access and readline() cannot be mixed.
    NFrrrcCst|t�r|f}nBt|tj�r,t�|�f}n(|dkrBtjdd�}|sLd}nt|�}||_||_	||_
d|_d|_d|_
d|_d|_d|_d|_d|_|dkr�td��d|kr�ddl}|�dtd	�||_d|kr�|�d
d�nd|_|�r|r�td��t|��std
��||_dS)N�)�-rF)rZrU�U�rbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'rz'U' mode is deprecated�r�wz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)�
isinstance�str�os�PathLike�fspath�sys�argv�tuple�_files�_inplace�_backup�_savestdout�_output�	_filename�_startlineno�_filelinenor�_isstdin�_backupfilename�
ValueError�warnings�warn�DeprecationWarning�_mode�replace�_write_mode�callable�	_openhook)�selfrrrrrr6rrr�__init__�sH
�
zFileInput.__init__cCs|��dS�N�r�r>rrr�__del__�szFileInput.__del__cCsz|��W5d|_XdS)Nr)r+rrBrrrr�szFileInput.closecCs|Sr@rrBrrr�	__enter__�szFileInput.__enter__cCs|��dSr@rA)r>�type�value�	tracebackrrr�__exit__�szFileInput.__exit__cCs|Sr@rrBrrr�__iter__�szFileInput.__iter__cCs6|��}|r|jd7_|S|js(t�|��qdS�Nr)�	_readliner2r�
StopIterationr�r>�linerrr�__next__�szFileInput.__next__cCsXddl}|jdtdd�||��kr,td��z
|��WStk
rRtd��YnXdS)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r!)�
stacklevelzaccessing lines out of orderzend of input reached)r6r7r8rrrOrL�
IndexError)r>�ir6rrr�__getitem__s�
zFileInput.__getitem__cCs�|j}d|_|r|t_|j}d|_z|r0|�
�W5|j}d|_z|`Wntk
r\YnXz|rr|jsr|�
�W5|j}d|_|r�|js�zt	�
|�Wntk
r�YnXd|_XXdS)NF)r.r(�stdoutr/rrK�AttributeErrorr4r-r%�unlink�OSErrorr3r)r>Z
savestdout�output�fileZbackupfilenamerrrrs4

zFileInput.nextfilecCs6|��}|r|jd7_|S|js(|S|��qdSrJ)rKr2rrrMrrr�readline.szFileInput.readlinecCs�|jsd|jkrdSdS|jd|_|jdd�|_|��|_d|_d|_d|_d|_|jdkr�d|_d|jkr�t	t
jd	t
j�|_nt
j|_d
|_�nT|j�r�t
�|j�|jp�d|_zt
�|j�Wntk
r�YnXt
�|j|j�t|j|j�|_zt
�|j���j}Wn&tk
�r8t|j|j�|_YntXt
jt
jBt
jB}tt
d��rb|t
jO}t
�|j||�}t
�||j�|_zt
�|j|�Wntk
�r�YnXt
j |_!|jt
_ n,|j"�r�|�"|j|j�|_nt|j|j�|_|jj#|_$|�$�S)
N�b�rrrFrz<stdin>�bufferTz.bak�O_BINARY)%r+r9r0rr1r2rr3r4�getattrr(�stdinr,r%r'r-rVrW�rename�open�fstatr�st_moder;r/�O_CREAT�O_WRONLY�O_TRUNC�hasattrr^�fdopen�chmodrTr.r=rZrK)r>Zpermr�fdrrrrK9s\




�


zFileInput._readlinecCs|jSr@)r0rBrrrrrszFileInput.filenamecCs|j|jSr@)r1r2rBrrrruszFileInput.linenocCs|jSr@�r2rBrrrrxszFileInput.filelinenocCs4|jr,z|j��WStk
r(YdSXndSdS)N���)rrr5rBrrrr{s
zFileInput.filenocCs
|jdkSrJrlrBrrrr	�szFileInput.isfirstlinecCs|jSr@)r3rBrrrr
�szFileInput.isstdin)NFr)�__name__�
__module__�__qualname__�__doc__r?rCrrDrHrIrOrSrrZrKrrrrr	r
rrrrr�s*�)9	cCsVtj�|�d}|dkr,ddl}|�||�S|dkrHddl}|�||�St||�SdS)Nrz.gzrz.bz2)r%�path�splitext�gziprb�bz2ZBZ2File)rrZextrtrurrrr�scs��fdd�}|S)Ncst||��d�S)N��encoding�errors)rb)rrrvrrr�szhook_encoded.<locals>.openhookr)rwrxrrrvrr
�scCs�ddl}d}d}|�tjdd�d�\}}|D] \}}|dkrBd}|dkr.|}q.t|||d�D]b}|d	d�d
kr~|dd	�}|d	d�dkr�|dd	�}tdt�t�t�t�r�d
p�d|f�q^tdt�t�t�f�dS)NrFrzib:z-iTz-b)rrrm�
�
z%d: %s[%d]%s %s�*rz
%d: %s[%d])	�getoptr(r)r�printrrrr	)r|rrZopts�args�o�arNrrr�_test�s&�
r��__main__)NFr)N)rqr(r%�__all__rrrrrrrrr	r
rrr
r�rnrrrr�<module>s4J�
	

			^
functools.cpython-38.pyc000064400000066377151450073350011236 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZddlmZddlmZddlmZddlm	Z	dZ
dZe
efdd�Ze
efdd�Z
efdd�Zefdd�Zefdd�Zefdd�Zefdd �Zefd!d"�Zefd#d$�Zefd%d&�Zefd'd(�Zefd)d*�Zefd+d,�Zefd-d.�Zd/efd0efd1efgd1efd2efd/efgd2efd1efd0efgd0efd/efd2efgd3�Zd4d�Zd5d�Zzdd6lmZWnek
�r�YnXe �Z!e!fd7d�Z"zdd8lm"Z"Wnek
�r�YnXGd9d	�d	�Z#zdd:lm#Z#Wnek
�rYnXGd;d
�d
e �Z$d<d=�Z%ed>d?d@dAdBg�Z&GdCdD�dDe'�Z(e �fe)e*he+e,e-fdEdF�Z.dYdId�Z/dJdK�Z0zddLlm0Z0Wnek
�r�YnXdMdN�Z1dZdPdQ�Z2dRdS�Z3dTdU�Z4dVd�Z5GdWd�d�Z6e �Z7GdXd
�d
�Z8dOS)[zEfunctools.py - Tools for working with functions and callable objects
�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�singledispatchmethod�cached_property�)�get_cache_token)�
namedtuple)�recursive_repr)�RLock)�
__module__�__name__�__qualname__�__doc__�__annotations__)�__dict__c	Csf|D]4}zt||�}Wntk
r*YqXt|||�q|D]}t||��t||i��q>||_|S)aUpdate a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    )�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r$�!/usr/lib64/python3.8/functools.pyr"scCstt|||d�S)a�Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    �rr r!)r	rr&r$r$r%r@s�cCs$|�|�}||kr|S|o"||kS)zIReturn a > b.  Computed by @total_ordering from (not a < b) and (a != b).��__lt__��self�other�NotImplemented�	op_resultr$r$r%�_gt_from_ltXs
r.cCs|�|�}|p||kS)zEReturn a <= b.  Computed by @total_ordering from (a < b) or (a == b).r'r)r$r$r%�_le_from_lt_s
r/cCs|�|�}||kr|S|S)z=Return a >= b.  Computed by @total_ordering from (not a < b).r'r)r$r$r%�_ge_from_ltds
r0cCs$|�|�}||kr|S|p"||kS)zJReturn a >= b.  Computed by @total_ordering from (not a <= b) or (a == b).��__le__r)r$r$r%�_ge_from_leks
r3cCs"|�|�}||kr|S|o ||kS)zFReturn a < b.  Computed by @total_ordering from (a <= b) and (a != b).r1r)r$r$r%�_lt_from_lers
r4cCs|�|�}||kr|S|S)z=Return a > b.  Computed by @total_ordering from (not a <= b).r1r)r$r$r%�_gt_from_leys
r5cCs$|�|�}||kr|S|o"||kS)zIReturn a < b.  Computed by @total_ordering from (not a > b) and (a != b).��__gt__r)r$r$r%�_lt_from_gt�s
r8cCs|�|�}|p||kS)zEReturn a >= b.  Computed by @total_ordering from (a > b) or (a == b).r6r)r$r$r%�_ge_from_gt�s
r9cCs|�|�}||kr|S|S)z=Return a <= b.  Computed by @total_ordering from (not a > b).r6r)r$r$r%�_le_from_gt�s
r:cCs$|�|�}||kr|S|p"||kS)zJReturn a <= b.  Computed by @total_ordering from (not a >= b) or (a == b).��__ge__r)r$r$r%�_le_from_ge�s
r=cCs"|�|�}||kr|S|o ||kS)zFReturn a > b.  Computed by @total_ordering from (a >= b) and (a != b).r;r)r$r$r%�_gt_from_ge�s
r>cCs|�|�}||kr|S|S)z=Return a < b.  Computed by @total_ordering from (not a >= b).r;r)r$r$r%�_lt_from_ge�s
r?r7r2r<r()r(r2r7r<csV�fdd�tD�}|std��t|�}t|D]"\}}||kr.||_t�||�q.�S)z6Class decorator that fills in missing ordering methodscs(h|] }t�|d�tt|d�k	r|�qS�N)r�object)�.0�op��clsr$r%�	<setcomp>�sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)rE�roots�root�opname�opfuncr$rDr%r�scsG�fdd�dt�}|S)z,Convert a cmp= function into a key= functioncsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dSr@�rN)r*rNr$r$r%�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS�NrrO�r*r+��mycmpr$r%r(�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkSrQrOrRrSr$r%r7�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkSrQrOrRrSr$r%�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkSrQrOrRrSr$r%r2�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkSrQrOrRrSr$r%r<�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rPr(r7rUr2r<�__hash__r$rSr$r%�K�srX)rA)rTrXr$rSr%r�s)rcCsZt|�}|tkr>zt|�}WqBtk
r:td�d�YqBXn|}|D]}|||�}qF|S)a�
    reduce(function, sequence[, initial]) -> value

    Apply a function of two arguments cumulatively to the items of a sequence,
    from left to right, so as to reduce the sequence to a single value.
    For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    of the sequence in the calculation, and serves as a default when the
    sequence is empty.
    z0reduce() of empty sequence with no initial valueN)�iter�_initial_missing�next�
StopIteration�	TypeError)ZfunctionZsequence�initial�itr#Zelementr$r$r%r�s)rcsJeZdZdZdZ�fdd�Zdd�Ze�dd��Zd	d
�Z	dd�Z
�ZS)
r	zSNew function with partial application of the given arguments
    and keywords.
    )�func�args�keywordsr�__weakref__csZt|�std��t|d�r4|j|}|j|�}|j}tt|��|�}||_||_||_|S)Nz#the first argument must be callabler`)	�callabler]�hasattrrarbr`�superr	�__new__)rEr`rarbr*��	__class__r$r%rgs


zpartial.__new__cOs|j|�}|j|j|�|�Sr@�rbr`ra)r*rarbr$r$r%�__call__%s
zpartial.__call__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdSr@)�repr)rB�xr$r$r%�	<genexpr>-sz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr$�rB�k�vr$r$r%rn.s�	functoolsz
functools.�(�, �))
�typerrlr`�extendrarb�itemsr�join)r*�qualnamerar$r$r%�__repr__)s
zpartial.__repr__cCs*t|�|jf|j|j|jpd|jp$dffSr@)rwr`rarbr�r*r$r$r%�
__reduce__3s�zpartial.__reduce__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dk	r`t|t�rr|dk	rzt|t�sztd��t|�}|dkr�i}nt|�tk	r�t|�}|dkr�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstance�tupler]�lenrd�dictrwrr`rarb)r*�stater`ra�kwds�	namespacer$r$r%�__setstate__7s4
����zpartial.__setstate__)rrrrrVrgrkrr|r~r��
__classcell__r$r$rhr%r	s
	)r	c@sDeZdZdZdd�Zde_dd�Zdd�Zdd
d�Ze	dd
��Z
d	S)r
z�Method descriptor with partial application of the given arguments
    and keywords.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��t|�}t|�s�t|d	�s�td
�	|���t
|t�r�|j|_|j
||_
|j|�|_n||_||_
||_dS)N�z8descriptor '__init__' of partialmethod needs an argumentr`rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz8type 'partialmethod' takes at least one argument, got %d��__get__z${!r} is not callable or a descriptor)r�r]�pop�warnings�warn�DeprecationWarningr�rdre�formatr�r
r`rarb)rarbr*r`r�r$r$r%rP]s6

�
��
zpartialmethod.__init__z#($self, func, /, *args, **keywords)cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nrucss|]\}}d�||�VqdS)z{}={!r}N)r�rpr$r$r%rn�s�z)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�modulerEr`rarb)rz�maprlrarbryr�rirrr`)r*rarb�
format_stringr$r$r%r|�s
�
�zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs �j|�}�j|f�j|�|�Sr@rj)�cls_or_selfrarbr}r$r%�_method�s
z3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r*r�r$r}r%�_make_unbound_method�sz"partialmethod._make_unbound_methodNcCs�t|jdd�}d}|dk	rd|||�}||jk	rdt|f|j�|j�}z|j|_Wntk
rbYnX|dkr||���||�}|S)Nr�)	rr`r	rarb�__self__rr�r�)r*rNrE�get�result�new_funcr$r$r%r��s

zpartialmethod.__get__cCst|jdd�S�Nr�F�rr`r}r$r$r%r��sz"partialmethod.__isabstractmethod__)N)rrrrrP�__text_signature__r|r�r��propertyr�r$r$r$r%r
Us"
cCst|t�r|j}q|Sr@)r�r	r`�r`r$r$r%�_unwrap_partial�s
r��	CacheInfo�hits�misses�maxsize�currsizec@s(eZdZdZdZefdd�Zdd�ZdS)�
_HashedSeqz� This class guarantees that hash() will be called no more than once
        per element.  This is important because the lru_cache() will hash
        the key multiple times on a cache miss.

    �	hashvaluecCs||dd�<||�|_dSr@�r�)r*�tup�hashr$r$r%rP�sz_HashedSeq.__init__cCs|jSr@r�r}r$r$r%rW�sz_HashedSeq.__hash__N)rrrrrVr�rPrWr$r$r$r%r��sr�c
s�|}|r&||7}|��D]}	||	7}q|rh||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|kr�|dSt|�S)a�Make a cache key from optionally typed positional and keyword arguments

    The key is constructed in a way that is flat as possible rather than
    as a nested structure that would take more memory.

    If there is only a single argument and its data type is known to cache
    its hash value, then that argument is returned without a wrapper.  This
    saves space and improves lookup speed.

    c3s|]}�|�VqdSr@r$�rBrr�rwr$r%rn�sz_make_key.<locals>.<genexpr>c3s|]}�|�VqdSr@r$r�r�r$r%rn�sr�r)ry�valuesr�)
rar��typed�kwd_mark�	fasttypesr�rwr��key�itemr$r�r%�	_make_key�s
 r��Fcsnt�t�r�dkr\d�nDt��rLt�t�rL�d}�t|��t�}t||�S�dk	r\td����fdd�}|S)a�Least-recently-used cache decorator.

    If *maxsize* is set to None, the LRU features are disabled and the cache
    can grow without bound.

    If *typed* is True, arguments of different types will be cached separately.
    For example, f(3.0) and f(3) will be treated as distinct calls with
    distinct results.

    Arguments to the cached function must be hashable.

    View the cache statistics named tuple (hits, misses, maxsize, currsize)
    with f.cache_info().  Clear the cache and statistics with f.cache_clear().
    Access the underlying function with f.__wrapped__.

    See:  http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

    rr�Nz=Expected first argument to be an integer, a callable, or Nonecst|��t�}t||�Sr@)�_lru_cache_wrapper�
_CacheInfor)�
user_functionr�r�r�r$r%�decorating_function
sz&lru_cache.<locals>.decorating_function)r��intrd�boolr�r�rr])r�r�r�rr�r$r�r%r�s


�cs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dkr����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rr�r��rFcs�d7��||�}|S�Nr�r$)rar�r�)r�r�r$r%r$s
z#_lru_cache_wrapper.<locals>.wrappercsH�||��}�|��}|�k	r*�d7�|S�d7��||�}|�|<|Sr�r$)rar�r�r�)�cache�	cache_getr��make_keyr��sentinelr�r�r$r%r-s

c
s>�
||��}�	�z�|�}|dk	r~|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|W5QR�S�d7�W5QRX�||�}�	��|�kr�n��r��
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�W5QRX|Sr�r$)rar�r��linkZ	link_prevZ	link_nextZ_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTr�r��	cache_len�fullr��lockr�r�r�rKr�r�r$r%r<sB

c
s,���������W5QR�SQRXdS)zReport cache statisticsNr$r$)r�r�r�r�r�r�r$r%�
cache_infousz&_lru_cache_wrapper.<locals>.cache_infoc	s<��.�����ddg�dd�<d��d�W5QRXdS)z$Clear the cache and cache statisticsNrF)�clearr$)r�r�r�r�r�rKr$r%�cache_clearzs
z'_lru_cache_wrapper.<locals>.cache_clear)rAr�r��__len__rr�r�)r�r�r�r�rr�r�r$)r�r�r�r�r�r�r�r�r�r�r�r�r�r�rKr�r�r�r%r�s**9	r�)r�cCs�g}dd�|D�}|s|S|D]2}|d}|D]}||dd�kr.d}qq.qRq|dkrbtd��|�|�|D]}|d|krp|d=qpqdS)z�Merges MROs in *sequences* to a single MRO using the C3 algorithm.

    Adapted from http://www.python.org/download/releases/2.3/mro/.

    cSsg|]}|r|�qSr$r$�rB�sr$r$r%�
<listcomp>�sz_c3_merge.<locals>.<listcomp>rr�NzInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr$r$r%�	_c3_merge�s"
r�Nc
stt|j��D]$\}�t�d�rt|j�|}q8qd}�rDt��ng�t|jd|��}g}t|j|d��}�D]0�t|��rtt�fdd�|jD��st|���qt|D]���	��q��fdd�|D�}�fdd�|D�}�fd	d�|D�}	t
|gg|||	|g|g|g�S)
a�Computes the method resolution order using extended C3 linearization.

    If no *abcs* are given, the algorithm works exactly like the built-in C3
    linearization used for method resolution.

    If given, *abcs* is a list of abstract base classes that should be inserted
    into the resulting MRO. Unrelated ABCs are ignored and don't end up in the
    result. The algorithm inserts ABCs where their functionality is introduced,
    i.e. issubclass(cls, abc) returns True for the class itself but returns
    False for all its direct base classes. Implicit ABCs for a given class
    (either registered or inferred from the presence of a special method like
    __len__) are inserted directly after the last ABC explicitly listed in the
    MRO of said class. If two implicit ABCs end up next to each other in the
    resulting MRO, their ordering depends on the order of types in *abcs*.

    �__abstractmethods__rNc3s|]}t|��VqdSr@)�
issubclass)rB�b)�baser$r%rn�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS���abcs��_c3_mro�rBr�r�r$r%r��sz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qSr�r�r�r�r$r%r��scsg|]}t|�d��qSr�r�r�r�r$r%r��s)�	enumerate�reversed�	__bases__rer��listr��anyr��remover�)
rEr��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr$)r�r�r%r��sD
��������r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}�D]�}g}|��D]0}|�krht�|�rh|��fdd�|jD��qh|s�|�|�qX|jtd	d
�|D] }|D]}||kr�|�|�q�q�qXt�|d�S)z�Calculates the method resolution order for a given class *cls*.

    Includes relevant abstract base classes (with their respective bases) from
    the *types* iterable. Uses a modified C3 linearization algorithm.

    cs|�kot|d�ot�|�S)N�__mro__)rer�)�typ)�basesrEr$r%�
is_related�s�z _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr$r$�rB�n)r�r$r%r��sz _compose_mro.<locals>.<listcomp>cs&�D]}||kr||jkrdSqdS)NTF)r�)r�r+)�typesr$r%�is_strict_base�sz$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr$r$r�)r�r$r%r��scsg|]}|�kr|�qSr$r$r�)�type_setr$r%r��sT)r��reverser�)�setr��__subclasses__r�r��sortr�r�)rEr��mror��found�sub�subclsr$)r�rEr�r�r�r�r%�_compose_mro�s*

rcCstt||���}d}|D]R}|dk	r\||krX||jkrX||jkrXt||�sXtd�||���qj||kr|}q|�|�S)a^Returns the best matching implementation from *registry* for type *cls*.

    Where there is no registered implementation for a specific type, its method
    resolution order is used to find a more generic implementation.

    Note: if *registry* does not contain an implementation for the base
    *object* type, this function may return None.

    NzAmbiguous dispatch: {} or {})r�keysr�r�r�r�r�)rE�registryr�match�tr$r$r%�
_find_impls"
���r
cs�ddl}ddl}i�|���d����fdd��d����fdd�	���fdd�}t|d	d
��|�t<�|_�|_|���|_�j	|_
t||�|S)akSingle-dispatch generic function decorator.

    Transforms a function into a generic function, which can have different
    behaviours depending upon the type of its first argument. The decorated
    function acts as the default implementation, and additional
    implementations can be registered using the register() attribute of the
    generic function.
    rNcs|�dk	r"t�}�|kr"���|�z�|}WnHtk
rvz�|}Wntk
rht|��}YnX|�|<YnX|S)z�generic_func.dispatch(cls) -> <function implementation>

        Runs the dispatch algorithm to return the best available implementation
        for the given *cls* registered on *generic_func*.

        N)rr��KeyErrorr
)rE�
current_token�impl)�cache_token�dispatch_cacherr$r%�dispatch.sz singledispatch.<locals>.dispatchcs�|dkr�t�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�t�t�s�td	|�d
��d���|��<�dkr�t	�d�r�t
�����|S)
z�generic_func.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_func*.

        Ncs
��|�Sr@r$)�f)rE�registerr$r%�<lambda>N�z2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)�get_type_hintszInvalid annotation for z. z is not a class.r�)r�rwrr]�typingrr[rYryrerr�)rEr`�annr�argname)rrrrrDr%rEs(

�
�z singledispatch.<locals>.registercs&|st��d����|dj�||�S)Nz( requires at least 1 positional argumentr)r]ri)ra�kw)r�funcnamer$r%rfszsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrrArr�MappingProxyTyperr��_clear_cacher)r`r�rrr$)rrrrrrr%rs!
c@s8eZdZdZdd�Zddd�Zddd�Zed	d
��ZdS)
rz�Single-dispatch generic method descriptor.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cCs4t|�s t|d�s t|�d���t|�|_||_dS)Nr�z  is not callable or a descriptor)rdrer]r�
dispatcherr`�r*r`r$r$r%rPs
zsingledispatchmethod.__init__NcCs|jj||d�S)z�generic_method.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_method*.
        r�)rr)r*rE�methodr$r$r%r�szsingledispatchmethod.registercs0���fdd�}�j|_�j|_t|�j�|S)Ncs$�j�|dj�}|����||�SrQ)rrrir�)ra�kwargsr!�rErNr*r$r%r��sz-singledispatchmethod.__get__.<locals>._method)r�rrr`)r*rNrEr�r$r#r%r��s
zsingledispatchmethod.__get__cCst|jdd�Sr�r�r}r$r$r%r��sz)singledispatchmethod.__isabstractmethod__)N)N)	rrrrrPrr�r�r�r$r$r$r%rxs


c@s&eZdZdd�Zdd�Zddd�ZdS)	r
cCs ||_d|_|j|_t�|_dSr@)r`�attrnamerrr�r r$r$r%rP�szcached_property.__init__cCs8|jdkr||_n"||jkr4td|j�d|�d���dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r$r])r*�owner�namer$r$r%�__set_name__�s

�zcached_property.__set_name__Nc	Cs�|dkr|S|jdkrtd��z
|j}Wn8tk
r`dt|�j�d|j�d�}t|�d�YnX|�|jt�}|tkr�|j�n|�|jt�}|tkr�|�	|�}z|||j<Wn8tk
r�dt|�j�d|j�d�}t|�d�YnXW5QRX|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z
 property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching )
r$r]rrrwrr��
_NOT_FOUNDr�r`)r*�instancer%r��msg�valr$r$r%r��s2
�
�
�zcached_property.__get__)N)rrrrPr'r�r$r$r$r%r
�s	)r�F)N)9r�__all__�abcr�collectionsr�reprlibr�_threadrrrrrr,r.r/r0r3r4r5r8r9r:r=r>r?rGrr�
_functools�ImportErrorrArZrr	r
r�r�r�r�r��strr�rwr�r�rr�r�r�rr
rrr(r
r$r$r$r%�<module>s��
�
�
�����AX	�

,t
-)\(hmac.cpython-38.pyc000064400000016352151450073350010116 0ustar00U

&�.e��@s�dZddlZddlmZzddlZWnek
r@dZdZ	YnXe
ej�Z	ddlZddlZ
ddlZedd�ed�D��Zedd�ed�D��ZdZGdd	�d	�Zd
d�ZGdd
�d
ej�Ze
��r�eZddd�Zdd�ZdS)zqHMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
�N)�_compare_digestccs|]}|dAVqdS)�\N���.0�xrr�/usr/lib64/python3.8/hmac.py�	<genexpr>sr	�ccs|]}|dAVqdS)�6Nrrrrrr	sc@sReZdZdZdZddd�Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�HMACz~RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    �@N�csVt��rtd��t|ttf�s0tdt|�j���s<td��t	��rL�|_
n,t�t�rhd�fdd�	|_
nd�fdd�	|_
|�
�|_|�
�|_
|j
j|_t|j
d�r�|j
j}|d	kr�t�d
||jftd�|j}nt�d|jtd�|j}||_t|�|k�r|�
|���}|�|d
�}|j�|�t��|j
�|�t��|dk	�rR|�|�dS)a?Create a new HMAC object.

        key: bytes or buffer, key for the keyed hash object.
        msg: bytes or buffer, Initial input for the hash or None.
        digestmod: A hash name suitable for hashlib.new(). *OR*
                   A hashlib constructor returning a new hash object. *OR*
                   A module supporting PEP 247.

                   Required as of 3.8, despite its position after the optional
                   msg argument.  Passing it as a keyword argument is
                   recommended, though not required for legacy API reasons.
        z9This class is not available in FIPS mode. Use hmac.new().�,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.�cst��|�S�N��_hashlib�new��d��	digestmodrr�<lambda>?rzHMAC.__init__.<locals>.<lambda>cs
��|�Sr�rrrrrrAr�
block_size�z:block_size of %d seems too small; using our default of %d.�z<No block_size attribute on given digest object; Assuming %d.�N)r)r)�_hashlibopenssl�
get_fips_mode�
ValueError�
isinstance�bytes�	bytearray�	TypeError�type�__name__�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	_warnings�warn�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)�self�key�msgrr1rrr�__init__#sR
�



����
z
HMAC.__init__cCsd|jjS)Nzhmac-)r,�name)r:rrrr>asz	HMAC.namecCs t��rtd��|j�|�dS)z,Feed data from msg into this hashing object.z'hmac.HMAC is not available in FIPS modeN)rr r!r,r6)r:r<rrrr6eszHMAC.updatecCs:|j�|j�}|j|_|j|_|j��|_|j��|_|S)zyReturn a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        )�	__class__�__new__r)r-r,�copyr+)r:�otherrrrrAksz	HMAC.copycCs|j��}|�|j���|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )r+rAr6r,r4�r:�hrrr�_currentxs
z
HMAC._currentcCs|��}|��S)z�Return the hash value of this hashing object.

        This returns the hmac value as bytes.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        )rEr4rCrrrr4�szHMAC.digestcCs|��}|��S)zKLike digest(), but returns a string of hexadecimal digits instead.
        )rE�	hexdigestrCrrrrF�szHMAC.hexdigest)Nr)
r'�
__module__�__qualname__�__doc__r1r=�propertyr>r6rArEr4rFrrrrrs
>

	
rcCsHt|t�r|��St|�r"|d�}t|tj�s6td��|j���dd�S)Nrz6Only OpenSSL hashlib hashes are accepted in FIPS mode.�_�-)	r"r*�lowerr(rZHASHr%r>�replacerrrr�_get_openssl_name�s
�rOc@seZdZddd�ZdS)�HMAC_opensslNcCsLt|ttf�s tdt|�j��t|�}tjj	|||d�}|rH|�
|�|S)Nrr)r"r#r$r%r&r'rO�_hmacopensslrr@r6)�clsr;r<rr>�resultrrrr@�s
zHMAC_openssl.__new__)NN)r'rGrHr@rrrrrP�srPrcCst|||�S)a�Create a new hashing object and return it.

    key: bytes or buffer, The starting key for the hash.
    msg: bytes or buffer, Initial input for the hash, or None.
    digestmod: A hash name suitable for hashlib.new(). *OR*
               A hashlib constructor returning a new hash object. *OR*
               A module supporting PEP 247.

               Required as of 3.8, despite its position after the optional
               msg argument.  Passing it as a keyword argument is
               recommended, though not required for legacy API reasons.

    You can now feed arbitrary bytes into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    or hexdigest() methods.
    )r)r;r<rrrrr�srcs�tdk	r(t�t�r(�tkr(t�||��St��r6�}n(t�t�rPd	�fdd�	}nd
�fdd�	}|�}|�}t|dd�}t|�|kr�||���}|d|t|�}|�	|�
t��|�	|�
t��|�	|�|�	|���|��S)aJFast inline implementation of HMAC.

    key: bytes or buffer, The key for the keyed hash object.
    msg: bytes or buffer, Input message.
    digest: A hash name suitable for hashlib.new() for best performance. *OR*
            A hashlib constructor returning a new hash object. *OR*
            A module supporting PEP 247.
    Nrcst��|�Srrr�r4rrr�rzdigest.<locals>.<lambda>cs
��|�SrrrrTrrr�rrr
r)r)r)
�_hashopensslr"r*�_openssl_md_methsZhmac_digestr(�getattrr3r4r6r7r9r8)r;r<r4r)r,r+r1rrTrr4�s,	��

r4)Nr)rI�warningsr/�	_operatorrZcompare_digestrrU�ImportErrorrV�	frozensetZopenssl_md_meth_namesZhashlibrrQr#�ranger8r9r-rrOrPr rr4rrrr�<module>s*

u
xdrlib.cpython-38.pyc000064400000020037151450073350010465 0ustar00U

e5d�@sxdZddlZddlmZddlmZddddgZGd	d�de�ZGd
d�de�Z	dd�Z
Gd
d�d�ZGdd�d�ZdS)zRImplements (a subset of) Sun XDR -- eXternal Data Representation.

See: RFC 1014

�N)�BytesIO��wraps�Error�Packer�Unpacker�ConversionErrorc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rz�Exception class for this module. Use:

    except xdrlib.Error as var:
        # var has the Error instance for the exception

    Public ivars:
        msg -- contains the message

    cCs
||_dS�N)�msg)�selfr
�r�/usr/lib64/python3.8/xdrlib.py�__init__szError.__init__cCs
t|j�Sr	)�reprr
�rrrr
�__repr__szError.__repr__cCs
t|j�Sr	)�strr
rrrr
�__str__sz
Error.__str__N)�__name__�
__module__�__qualname__�__doc__rrrrrrr
rs	c@seZdZdS)rN)rrrrrrr
r scst���fdd��}|S)z5 Wrap any raised struct.errors in a ConversionError. c
sFz�||�WStjk
r@}zt|jd�d�W5d}~XYnXdS�Nr)�struct�errorr�args)r�value�e��functionrr
�result&sz&raise_conversion_error.<locals>.resultr)rr rrr
�raise_conversion_error#sr!c@s�eZdZdZdd�Zdd�Zdd�ZeZedd	��Z	ed
d��Z
e
Zdd
�Zdd�Z
e
Zedd��Zedd��Zdd�ZeZdd�ZeZeZdd�Zdd�Zdd�ZdS)rz0Pack various data representations into a buffer.cCs|��dSr	��resetrrrr
r2szPacker.__init__cCst�|_dSr	)r�_Packer__bufrrrr
r#5szPacker.resetcCs
|j��Sr	)r$�getvaluerrrr
�
get_buffer8szPacker.get_buffercCs|j�t�d|��dS)N�>L�r$�writerZpack�r�xrrr
�	pack_uint=szPacker.pack_uintcCs|j�t�d|��dS)N�>lr(r*rrr
�pack_intAszPacker.pack_intcCs"|r|j�d�n|j�d�dS)Nss)r$r)r*rrr
�	pack_boolGszPacker.pack_boolc
Cs�z|�|d?d@�Wn8ttjfk
rN}zt|jd�d�W5d}~XYnXz|�|d@�Wn8ttjfk
r�}zt|jd�d�W5d}~XYnXdS)N� l��r)r,�	TypeErrorrrrr)rr+rrrr
�pack_uhyperKs"zPacker.pack_uhypercCs|j�t�d|��dS)N�>fr(r*rrr
�
pack_floatWszPacker.pack_floatcCs|j�t�d|��dS)N�>dr(r*rrr
�pack_double[szPacker.pack_doublecCsP|dkrtd��|d|�}|ddd}||t|�d}|j�|�dS)Nr� fstring size must be nonnegative���)�
ValueError�lenr$r))r�n�s�datarrr
�pack_fstring_szPacker.pack_fstringcCs"t|�}|�|�|�||�dSr	)r<r,r@)rr>r=rrr
�pack_stringis
zPacker.pack_stringcCs*|D]}|�d�||�q|�d�dS)N�r)r,)r�list�	pack_item�itemrrr
�	pack_listqs

zPacker.pack_listcCs*t|�|krtd��|D]}||�qdS)Nzwrong array size)r<r;)rr=rCrDrErrr
�pack_farraywszPacker.pack_farraycCs$t|�}|�|�|�|||�dSr	)r<r,rG)rrCrDr=rrr
�
pack_array}s
zPacker.pack_arrayN)rrrrrr#r&Zget_bufr!r,r.Z	pack_enumr/r2Z
pack_hyperr4r6r@Zpack_fopaquerAZpack_opaqueZ
pack_bytesrFrGrHrrrr
r/s2




c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZeZdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZeZdd�ZeZeZd d!�Zd"d#�Zd$d%�Zd&S)'rz;Unpacks various data representations from the given buffer.cCs|�|�dSr	r"�rr?rrr
r�szUnpacker.__init__cCs||_d|_dSr)�_Unpacker__buf�_Unpacker__posrIrrr
r#�szUnpacker.resetcCs|jSr	�rKrrrr
�get_position�szUnpacker.get_positioncCs
||_dSr	rL)rZpositionrrr
�set_position�szUnpacker.set_positioncCs|jSr	)rJrrrr
r&�szUnpacker.get_buffercCs|jt|j�krtd��dS)Nzunextracted data remains)rKr<rJrrrrr
�done�sz
Unpacker.donecCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r'r�rKrJr<�EOFErrorrZunpack�r�i�jr?rrr
�unpack_uint�szUnpacker.unpack_uintcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r-rrPrRrrr
�
unpack_int�szUnpacker.unpack_intcCst|���Sr	)�boolrVrrrr
�unpack_bool�szUnpacker.unpack_boolcCs |��}|��}t|�d>|BS)Nr0)rU�int)r�hi�lorrr
�
unpack_uhyper�szUnpacker.unpack_uhypercCs|��}|dkr|d}|S)Nll)r\r*rrr
�unpack_hyper�szUnpacker.unpack_hypercCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r3rrPrRrrr
�unpack_float�szUnpacker.unpack_floatcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)N�r5rrPrRrrr
�
unpack_double�szUnpacker.unpack_doublecCsT|dkrtd��|j}||ddd}|t|j�kr<t�||_|j|||�S)Nrr7r8r9)r;rKr<rJrQ)rr=rSrTrrr
�unpack_fstring�szUnpacker.unpack_fstringcCs|��}|�|�Sr	)rUra)rr=rrr
�
unpack_string�szUnpacker.unpack_stringcCsBg}|��}|dkrq>|dkr,td|f��|�}|�|�q|S)NrrBz0 or 1 expected, got %r)rUr�append)r�unpack_itemrCr+rErrr
�unpack_list�szUnpacker.unpack_listcCs"g}t|�D]}|�|��q|Sr	)�rangerc)rr=rdrCrSrrr
�
unpack_farray�szUnpacker.unpack_farraycCs|��}|�||�Sr	)rUrg)rrdr=rrr
�unpack_array�szUnpacker.unpack_arrayN)rrrrrr#rMrNr&rOrUrVZunpack_enumrXr\r]r^r`raZunpack_fopaquerbZ
unpack_opaqueZunpack_bytesrergrhrrrr
r�s.
)
rr�ior�	functoolsr�__all__�	Exceptionrrr!rrrrrr
�<module>sUtarfile.cpython-38.opt-2.pyc000064400000155175151450073350011603 0ustar00U

&�.e��@s
dZdZdZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXeefZzeef7ZWnek
r�YnXdddd	d
ddd
dddddddgZdZdZdZdZedZdZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1dZ2d,Z3d-Z4e4Z5e#e$e%e&e)e*e+e'e(e,e-e.fZ6e#e$e+e.fZ7e,e-e.fZ8d.Z9d/d0d1d2hZ:e;e;e;e<e<e<d3�Z=ej>d4k�r�d5Z?ne�@�Z?d6d7�ZAd8d9�ZBd:d;�ZCd<e5fd=d>�ZDd?d@�ZEdedfdAdB�ZFdCdD�ZGGdEd	�d	eH�ZIGdFd
�d
eI�ZJGdGd
�d
eI�ZKGdHd�deI�ZLGdId�deI�ZMGdJd�deI�ZNGdKdL�dLeN�ZOGdMdN�dNeN�ZPGdOdP�dPeN�ZQGdQdR�dReN�ZRGdSdT�dTeN�ZSGdUdV�dV�ZTGdWdX�dX�ZUGdYdZ�dZeV�ZWGd[d\�d\eV�ZXGd]d^�d^ejY�ZZGd_d`�d`eI�Z[Gdadb�dbe[�Z\Gdcdd�dde[�Z]Gdedf�dfe[�Z^Gdgdh�dhe[�Z_Gdidj�dje[�Z`dzdkdl�Zadmdn�Zbdodp�Zcdqdr�Zdebecedds�ZeeV�ZfGdtd�deV�ZgGdud�deV�Zhdvd�ZiehjZdwdx�Zjekdyk�rej�dS){z0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.�)�openN�TarFile�TarInfo�
is_tarfile�TarError�	ReadError�CompressionError�StreamError�ExtractError�HeaderError�ENCODING�USTAR_FORMAT�
GNU_FORMAT�
PAX_FORMAT�DEFAULT_FORMATrTz/etc/python/tarfile.cfg�i�sustar  sustar00�d��0�1�2�3�4�5�6�7�L�K�S�x�g�X��)�path�linkpath�size�mtime�uid�gid�uname�gnamer%r&r+r,)Zatime�ctimer(r)r*r'�nt�utf-8cCs8|dkrtd��|�||�}|d|�|t|�tS)Nzmetadata cannot contain None)�
ValueError�encode�len�NUL)�s�length�encoding�errors�r8�/usr/lib64/python3.8/tarfile.py�stn�sr:cCs*|�d�}|dkr|d|�}|�||�S)Nr���)�find�decode)r4r6r7�pr8r8r9�nts�s
r?cCs�|ddkrbd}tt|�d�D]}|dK}|||d7}q |ddkr�dt|�d|}n@z"t|dd�}t|��p|d	d�}Wntk
r�td
��YnX|S)Nr)��r#�rA��ascii�strict�0�invalid header)�ranger2r?�int�stripr0�InvalidHeaderError)r4�n�ir8r8r9�nti�srNrBcCs�t|�}d|kr$d|dkrDnntd|d|fd�t}n�|tkr�d|d|krrd|dkr�nnV|dkr�tdg�}ntdg�}d||}t|d�D]}|�d|d@�|dL}q�ntd	��|S)
NrrBr#z%0*orDrCr@rAzoverflow in number field)rI�bytesr3r�	bytearrayrH�insertr0)rL�digits�formatr4rMr8r8r9�itn�s 2
rTcCs0dtt�d|��}dtt�d|��}||fS)NrCZ
148B8x356BZ
148b8x356b)�sum�structZunpack_from)�bufZunsigned_chksumZ
signed_chksumr8r8r9�calc_chksums�s	rXc	Cs�|pd}|dkrdS|dkr.t�|||�dSt||�\}}t|�D],}|�|�}t|�|krf|d��|�|�qD|dkr�|�|�}t|�|kr�|d��|�|�dS)Ni@r�unexpected end of data)�shutil�copyfileobj�divmodrH�readr2�write)	�srcZdstr5�	exception�bufsize�blocks�	remainder�brWr8r8r9r[�s$


r[cCs8ttjdd�}|dk	r(|�|d��|�}t|dd�dS)Nr6�backslashreplace� )�end)�getattr�sys�stdoutr1r=�print)r4r6r8r8r9�_safe_printsrlc@seZdZdS)rN��__name__�
__module__�__qualname__r8r8r8r9rsc@seZdZdS)r
Nrmr8r8r8r9r
sc@seZdZdS)rNrmr8r8r8r9rsc@seZdZdS)rNrmr8r8r8r9rsc@seZdZdS)r	Nrmr8r8r8r9r	!sc@seZdZdS)rNrmr8r8r8r9r$sc@seZdZdS)�EmptyHeaderErrorNrmr8r8r8r9rq'srqc@seZdZdS)�TruncatedHeaderErrorNrmr8r8r8r9rr*srrc@seZdZdS)�EOFHeaderErrorNrmr8r8r8r9rs-srsc@seZdZdS)rKNrmr8r8r8r9rK0srKc@seZdZdS)�SubsequentHeaderErrorNrmr8r8r8r9rt3srtc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
_LowLevelFilecCsFtjtjtjBtjBd�|}ttd�r2|tjO}t�||d�|_dS)N��r�w�O_BINARYi�)	�os�O_RDONLY�O_WRONLY�O_CREAT�O_TRUNC�hasattrryr�fd)�self�name�moder8r8r9�__init__@s��

z_LowLevelFile.__init__cCst�|j�dS�N)rz�closer��r�r8r8r9r�Isz_LowLevelFile.closecCst�|j|�Sr�)rzr]r��r�r'r8r8r9r]Lsz_LowLevelFile.readcCst�|j|�dSr�)rzr^r��r�r4r8r8r9r^Osz_LowLevelFile.writeN)rnrorpr�r�r]r^r8r8r8r9ru:s	ruc@sneZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�ZdS)�_Streamc	Cs�d|_|dkrt||�}d|_|dkr6t|�}|��}|p<d|_||_||_||_||_d|_	d|_
d|_�zL|dkr�zddl}Wnt
k
r�td��YnX||_|�d�|_|d	kr�|��|j|_n|��n�|d
k�r:zddl}Wnt
k
�r
td��YnX|d	k�r.d|_|��|_t|_n
|��|_n||dk�r�zddl}Wnt
k
�rntd
��YnX|d	k�r�d|_|��|_|j|_n
|��|_n|dk�r�td|��Wn&|j�s�|j��d|_�YnXdS)NTF�*��r�gzzzlib module is not availablerw�bz2�bz2 module is not available�xz�lzma module is not available�tar�unknown compression type %r) �_extfileobjru�_StreamProxy�getcomptyper�r��comptype�fileobjrarW�pos�closed�zlib�ImportErrorr�crc32�crc�
_init_read_gz�errorr`�_init_write_gzr��dbufZBZ2Decompressor�cmp�OSErrorZ
BZ2Compressor�lzmaZLZMADecompressor�	LZMAErrorZLZMACompressorr�)	r�r�r�r�r�rar�r�r�r8r8r9r�]sl












z_Stream.__init__cCst|d�r|js|��dS)Nr�)rr�r�r�r8r8r9�__del__�sz_Stream.__del__cCs�|j�d|jj|jj|jjd�|_t�dtt	�	���}|�
d|d�|j�d�rf|jdd�|_t
j�|j�|_|�
|j�dd	�t�dS)
N�	r�<Ls�s��.gz���z
iso-8859-1�replace)r�ZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�rV�packrI�time�_Stream__writer��endswithrzr%�basenamer1r3)r�Z	timestampr8r8r9r��s�z_Stream._init_write_gzcCsR|jdkr|j�||j�|_|jt|�7_|jdkrD|j�|�}|�|�dS)Nr�r�)	r�r�r�r�r�r2r��compressr�r�r8r8r9r^�s

z
_Stream.writecCsN|j|7_t|j�|jkrJ|j�|jd|j��|j|jd�|_qdSr�)rWr2rar�r^r�r8r8r9Z__write�sz_Stream.__writecCs�|jr
dSd|_z�|jdkr:|jdkr:|j|j��7_|jdkr�|jr�|j�	|j�d|_|jdkr�|j�	t
�d|j��|j�	t
�d|j
d@��W5|js�|j��XdS)NTrxr�r�r�r�l��)r�r�r�r�r�r�rWr��flushr^rVr�r�r�r�r8r8r9r��s
z
_Stream.closecCs�|j�|jj�|_d|_|�d�dkr0td��|�d�dkrFtd��t|�d��}|�d�|d	@r�t|�d��d
t|�d��}|�	|�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�dS)
Nr�r$s��not a gzip filer#�zunsupported compression method��rCrB�)r�Z
decompressobjr�r�r��
_Stream__readrr�ordr]r3)r��flagZxlenr4r8r8r9r��s*
 


z_Stream._init_read_gzcCs|jSr�)r�r�r8r8r9�tell�sz_Stream.tellrcCsX||jdkrJt||j|j�\}}t|�D]}|�|j�q,|�|�ntd��|jS)Nrz seeking backwards is not allowed)r�r\rarHr]r	)r�r�rbrcrMr8r8r9�seeksz_Stream.seekcCs |�|�}|jt|�7_|Sr�)�_readr�r2)r�r'rWr8r8r9r]s
z_Stream.readcCs�|jdkr|�|�St|j�}|jg}||kr�|jrB|j}d|_n|j�|j�}|sVq�z|j�	|�}Wn|j
k
r�td��YnX|�|�|t|�7}q&d�
|�}||d�|_|d|�S)Nr�r�zinvalid compressed data)r�r�r2r�rWr�r]rar��
decompressr`r�append�join�r�r'�c�trWr8r8r9r�s(




z
_Stream._readcCsjt|j�}|jg}||krF|j�|j�}|s.qF|�|�|t|�7}qd�|�}||d�|_|d|�S)Nr�)r2rWr�r]rar�r�r�r8r8r9Z__read3s


z_Stream.__readN)r)rnrorpr�r�r�r^r�r�r�r�r�r]r�r�r8r8r8r9r�RsF
	

r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCs||_|j�t�|_dSr�)r�r]�	BLOCKSIZErW)r�r�r8r8r9r�Isz_StreamProxy.__init__cCs|jj|_|jSr�)r�r]rWr�r8r8r9r]Ms
z_StreamProxy.readcCsP|j�d�rdS|jdd�dkr8|jdd�dkr8d	S|j�d
�rHdSdSdS)
Ns�r�r�sBZhr��
s1AY&SYr�)s]�s�7zXZr�r�)rW�
startswithr�r8r8r9r�Qs$z_StreamProxy.getcomptypecCs|j��dSr�)r�r�r�r8r8r9r�[sz_StreamProxy.closeN)rnrorpr�r]r�r�r8r8r8r9r�Ds
r�c@sfeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Ze	j
fdd�Zddd�Zdd�Z
dd�ZdS)�_FileInFileNcCs�||_||_||_d|_t|dd�|_d|_|dkr>d|fg}d|_g|_d}|j}|D]L\}}||kr||j�	d||df�|j�	d||||f�||7}||}qX||jkr�|j�	d||jdf�dS)Nrr�FT)
r��offsetr'�positionrhr�r��	map_index�mapr�)r�r�r�r'Z	blockinfoZlastposZrealposr8r8r9r�hs(


z_FileInFile.__init__cCsdSr�r8r�r8r8r9r��sz_FileInFile.flushcCsdS�NTr8r�r8r8r9�readable�sz_FileInFile.readablecCsdS)NFr8r�r8r8r9�writable�sz_FileInFile.writablecCs
|j��Sr�)r��seekabler�r8r8r9r��sz_FileInFile.seekablecCs|jSr�)r�r�r8r8r9r��sz_FileInFile.tellcCs�|tjkr tt|d�|j�|_nj|tjkr\|dkrFt|j|d�|_q�t|j||j�|_n.|tjkr�tt|j||j�d�|_ntd��|jS)NrzInvalid argument)	�io�SEEK_SET�min�maxr'r��SEEK_CUR�SEEK_ENDr0)r�r��whencer8r8r9r��s


z_FileInFile.seekc	Cs
|dkr|j|j}nt||j|j�}d}|dk�r|j|j\}}}}||jkr`|krhq�nq�q6|jd7_|jt|j�kr6d|_q6t|||j�}|r�|j�||j|�|j�|�}t|�|kr�t	d��||7}n|t
|7}||8}|j|7_q,|S)Nr�rr#rY)r'r�r�r�r�r2r�r�r]rr3)	r�r'rW�data�start�stopr�r5rdr8r8r9r]�s,

z_FileInFile.readcCs&|�t|��}||dt|��<t|�Sr�)r]r2)r�rdrWr8r8r9�readinto�sz_FileInFile.readintocCs
d|_dSr�)r�r�r8r8r9r��sz_FileInFile.close)N)N)rnrorpr�r�r�r�r�r�r�r�r�r]r�r�r8r8r8r9r�bs

r�cseZdZ�fdd�Z�ZS)�ExFileObjectcs&t|j|j|j|j�}t��|�dSr�)r�r��offset_datar'�sparse�superr�)r��tarfile�tarinfor���	__class__r8r9r��s

�zExFileObject.__init__�rnrorpr��
__classcell__r8r8r�r9r��sr�c@seZdZdS)�FilterErrorNrmr8r8r8r9r��sr�cseZdZ�fdd�Z�ZS)�AbsolutePathErrorcs ||_t��d|j�d��dS)Nzmember z has an absolute path�r�r�r�r��r�r�r�r8r9r��szAbsolutePathError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�OutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would be extracted to �, � which is outside the destination�r��_pathr�r�r��r�r�r%r�r8r9r��s
�z OutsideDestinationError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�SpecialFileErrorcs||_t��|j�d��dS)Nz is a special filer�r�r�r8r9r��szSpecialFileError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�AbsoluteLinkErrorcs||_t��|j�d��dS)Nz! is a symlink to an absolute pathr�r�r�r8r9r��szAbsoluteLinkError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�LinkOutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would link to r�r�r�r�r�r8r9r��s
�z$LinkOutsideDestinationError.__init__r�r8r8r�r9r��sr�cCs�i}|j}tj�|�}|�dtjf�r@|j�dtj�}|d<tj�|�rTt|��tj�tj�	||��}tj�
||g�|kr�t||��|j}|dk	r�|d@}|r�|�
�s�|��r�|d@s�|dM}|dO}n|��s�|��r�d}nt|��||jkr�||d<|�r�|jdk	�rd|d<|jdk	�r*d|d	<|jdk	�r>d|d
<|jdk	�rRd|d<|���sf|���r�tj�|j��r~t|��|���r�tj�	|tj�|�|j�}ntj�	||j�}tj�|�}tj�
||g�|k�r�t||��|S)N�/r�i��@i�����r�r)r*r+r,)r�rzr%�realpathr��sep�lstrip�isabsr�r��
commonpathr�r��isreg�islnk�isdir�issymr�r)r*r+r,�linknamer��dirnamer�)�member�	dest_pathZfor_data�	new_attrsr�Ztarget_pathr�r8r8r9�_get_filtered_attrs�s^




��
rcCs|Sr�r8)rrr8r8r9�fully_trusted_filter6srcCs(t||d�}|r$|jf|ddi��S|S)NF�deep�rr��rrrr8r8r9�
tar_filter9srcCs(t||d�}|r$|jf|ddi��S|S)NTr	Fr
rr8r8r9�data_filter?sr
)Z
fully_trustedr�r�c@s�eZdZeddddddddd	d
ddd
dddddddd�Zdhdd�Zedd��Zejdd��Zedd��Z	e	jdd��Z	dd�Z
eeeeeeeeded �
d!d"�Zd#d$�Z
eed%fd&d'�Zd(d)�Zd*d+�Zd,d-�Zed.d/��Zd0d1�Zed2d3��Zed4d5��Zed6d7��Zed8d9��Zed:d;��Zed<d=��Zd>d?�Zd@dA�ZdBdC�Z dDdE�Z!dFdG�Z"dHdI�Z#dJdK�Z$dLdM�Z%dNdO�Z&dPdQ�Z'dRdS�Z(dTdU�Z)dVdW�Z*dXdY�Z+dZd[�Z,d\d]�Z-d^d_�Z.d`da�Z/dbdc�Z0ddde�Z1dfdg�Z2dS)irzName of the archive member.zPermission bits.z6User ID of the user who originally stored this member.z7Group ID of the user who originally stored this member.zSize in bytes.zTime of last modification.zHeader checksum.z�File type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.zcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.z
User name.zGroup name.zDevice major number.zDevice minor number.zThe tar header starts here.zThe file's data starts here.zMA dictionary containing key-value pairs of an associated pax extended header.zSparse member information.N)r�r�r)r*r'r(�chksum�typerr+r,�devmajor�devminorr�r��pax_headersr�r��_sparse_structs�_link_targetr�cCsj||_d|_d|_d|_d|_d|_d|_t|_d|_	d|_
d|_d|_d|_
d|_d|_d|_i|_dS)Ni�rr�)r�r�r)r*r'r(r�REGTYPErrr+r,rrr�r�r�r�r�r�r8r8r9r�us"zTarInfo.__init__cCs|jSr��r�r�r8r8r9r%�szTarInfo.pathcCs
||_dSr�rrr8r8r9r%�scCs|jSr��rr�r8r8r9r&�szTarInfo.linkpathcCs
||_dSr�r)r�rr8r8r9r&�scCsd|jj|jt|�fS)Nz<%s %r at %#x>)r�rnr��idr�r8r8r9�__repr__�szTarInfo.__repr__T)
r�r(r�rr)r*r+r,r	�_KEEPc
Cs�|	rt�|�}n
t�|�}||
k	r(||_||
k	r6||_||
k	rD||_||
k	rR||_||
k	r`||_||
k	rn||_||
k	r|||_||
k	r�||_	|Sr�)
�copyZdeepcopyr�r(r�rr)r*r+r,)r�r�r(r�rr)r*r+r,r	r�resultr8r8r9r��s(
zTarInfo.replacecCs�|jdkrd}n
|jd@}|j||j|j|j|j|j|j|j|j	|j
|j|jd�
}|dt
kr||d�d�s||dd7<|S)N�)
r�r�r)r*r'r(rrrr+r,rrrr�r�)r�r�r)r*r'r(rrrr+r,rr�DIRTYPEr�)r�r��infor8r8r9�get_info�s(

�zTarInfo.get_info�surrogateescapecCsz|��}|��D]\}}|dkrtd|��q|tkrD|�|||�S|tkrZ|�|||�S|tkrn|�||�Std��dS)Nz%s may not be Nonezinvalid format)	r!�itemsr0r
�create_ustar_headerr�create_gnu_headerr�create_pax_header)r�rSr6r7r r��valuer8r8r9�tobuf�sz
TarInfo.tobufcCsnt|d<t|d�||��tkr(td��t|d�||��tkr^|�|d||�\|d<|d<|�|t||�S)N�magicrzlinkname is too longr��prefix)	�POSIX_MAGICr2r1�LENGTH_LINKr0�LENGTH_NAME�_posix_split_name�_create_headerr
)r�r r6r7r8r8r9r$�szTarInfo.create_ustar_headercCs�t|d<d}t|d�||��tkr<||�|dt||�7}t|d�||��tkrl||�|dt||�7}||�|t	||�S)Nr)r�rr�)
�	GNU_MAGICr2r1r,�_create_gnu_long_header�GNUTYPE_LONGLINKr-�GNUTYPE_LONGNAMEr/r)r�r r6r7rWr8r8r9r%�szTarInfo.create_gnu_headerc
	Cs*t|d<|j��}ddtfddtfddfD]j\}}}||kr>q*z||�dd	�Wn$tk
rv||||<Yq*YnXt||�|kr*||||<q*d
D]`\}}||kr�d||<q�||}d|kr�d|d
kr�nn
t|t	�r�t
|�||<d||<q�|�r|�|t|�}	nd}	|	|�
|tdd�S)Nr)r�r%rr&)r+r+� )r,r,r4rDrE))r)rB)r*rB)r'�)r(r5rrBr#r�r�)r+rrr-r,r1�UnicodeEncodeErrorr2�
isinstance�float�str�_create_pax_generic_header�XHDTYPEr/r
)
r�r r6rr�Zhnamer5rR�valrWr8r8r9r&s8
�
*
zTarInfo.create_pax_headercCs|�|td�S)Nr/)r:�XGLTYPE)�clsrr8r8r9�create_pax_global_header7sz TarInfo.create_pax_global_headercCs~|�d�}tdt|��D]T}d�|d|��}d�||d��}t|�||��tkrt|�||��tkrqvqtd��||fS)Nr�r#zname is too long)�splitrHr2r�r1�
LENGTH_PREFIXr-r0)r�r�r6r7Z
componentsrMr*r8r8r9r.=s
�zTarInfo._posix_split_namecCs�|�d�ttfk}|r@t|�dd�d|�}t|�dd�d|�}ntdd||�}tdd||�}|�dt�}|dkrxtd��t|�dd�d	||�t|�d
d�d@d|�t|�dd�d|�t|�d
d�d|�t|�dd�d|�t|�dd�d|�d|t|�dd�d	||�|�dt�t|�dd�d||�t|�dd�d||�t|�dd�d|�t|�dd�d|�t|�dd�d||�g}t�	dt
d�|��}	t|	t
d��d}
|	dd�t
d|
d�|	dd�}	|	S)NrrrrBrr�zTarInfo.type must not be Noner�rr�rr)r*r'r5r(s        rr)r+r4r,r*rz%dsr�i����z%06orDi����)�get�CHRTYPE�BLKTYPErTr:rr0r+rVr�r�r�rXrO)r rSr6r7Zhas_device_fieldsrrZfiletype�partsrWrr8r8r9r/Ms:
�&zTarInfo._create_headercCs.tt|�t�\}}|dkr*|t|t7}|S)Nr)r\r2r�r3)Zpayloadrbrcr8r8r9�_create_payloadwszTarInfo._create_payloadcCsR|�||�t}i}d|d<||d<t|�|d<t|d<|�|t||�|�|�S)Nz
././@LongLinkr�rr'r))r1r3r2r0r/r
rF)r>r�rr6r7r r8r8r9r1�s�zTarInfo._create_gnu_long_headerc	Cs2d}|��D]8\}}z|�dd�Wqtk
rBd}YqFYqXqd}|rV|d7}|��D]�\}}|�d�}|r�|�|d�}n
|�d�}t|�t|�d}d	}	}
|tt|
��}	|	|
kr�q�|	}
q�|tt|
�d
�d|d|d
7}q^i}d|d<||d<t|�|d<t|d<|�|td
d�|�	|�S)NFr/rETr�s21 hdrcharset=BINARY
r"r�rrD� �=�
z././@PaxHeaderr�rr'r)r�)
r#r1r6r2r9rOr+r/r
rF)r>rrr6Zbinary�keywordr'Zrecords�lrLr>r r8r8r9r:�s<

(�z"TarInfo._create_pax_generic_headerc	Csvt|�dkrtd��t|�tkr(td��|�t�tkr>td��t|dd��}|t|�krbt	d��|�}t
|dd�||�|_t|dd	��|_t|d	d
��|_
t|d
d��|_t|dd��|_t|dd��|_||_|dd
�|_t
|d
d�||�|_t
|dd�||�|_t
|dd�||�|_t|dd��|_t|dd��|_t
|dd�||�}|jtk�r�|j�d��r�t|_|jtk�r8d}g}td�D]l}	z0t|||d��}
t||d|d��}Wntk
�r�Y�qYnX|�|
|f�|d7}�q�t|d�}t|dd��}
|||
f|_ |�!��rP|j�"d�|_|�rr|jt#k�rr|d|j|_|S)Nrzempty headerztruncated headerzend of file header��zbad checksumr�l�t�|��ii	i)iIiQiYi�r�i�r�r5�i�i�i�)$r2rqr�rr�countr3rsrNrXrKr?r�r�r)r*r'r(rrrr+r,rr�AREGTYPEr�r�GNUTYPE_SPARSErHr0r��boolrr�rstrip�	GNU_TYPES)r>rWr6r7r�objr*r��structsrMr��numbytes�
isextended�origsizer8r8r9�frombuf�sZ
zTarInfo.frombufcCs8|j�t�}|�||j|j�}|j��t|_|�|�Sr�)	r�r]r�r_r6r7r�r��_proc_member)r>r�rWrZr8r8r9�fromtarfileszTarInfo.fromtarfilecCsT|jttfkr|�|�S|jtkr,|�|�S|jtttfkrF|�	|�S|�
|�SdSr�)rr3r2�
_proc_gnulongrV�_proc_sparser;r=�SOLARIS_XHDTYPE�	_proc_pax�
_proc_builtin)r�r�r8r8r9r`s



zTarInfo._proc_membercCsR|j��|_|j}|��s$|jtkr4||�|j�7}||_|�	|j
|j|j�|Sr�)
r�r�r�r�r�SUPPORTED_TYPES�_blockr'r��_apply_pax_inforr6r7)r�r�r�r8r8r9rf&szTarInfo._proc_builtincCs�|j�|�|j��}z|�|�}Wntk
r>td��YnX|j|_|jt	krft
||j|j�|_
n|jtkr�t
||j|j�|_|S)N� missing or bad subsequent header)r�r]rhr'rarrtr�rr3r?r6r7r�r2r)r�r�rW�nextr8r8r9rb7s

zTarInfo._proc_gnulongc
	Cs�|j\}}}|`|r�|j�t�}d}td�D]n}z0t|||d��}t||d|d��}	Wntk
rzYq�YnX|r�|	r�|�||	f�|d7}q,t|d�}q||_	|j�
�|_|j|�|j
�|_||_
|S)Nr�r5rSi�)rr�r]r�rHrNr0r�rWr�r�r�rhr'r�)
r�r�r[r]r^rWr�rMr�r\r8r8r9rcMs(
zTarInfo._proc_sparsecCs.|j�|�|j��}|jtkr&|j}n
|j��}t�	d|�}|dk	rX|�
d��d�|d<|�d�}|dkrr|j
}nd}t�d�}d}|�||�}|s��q6|��\}	}
t|	�}	|	dkr�td��||�d	�d|�d�|	d�}|�|
dd|j�}
|
tk�r|�|||j
|j�}n|�|dd|j�}|||
<||	7}q�z|�|�}Wntk
�rbtd
��YnXd|k�r||�||�nHd|k�r�|�|||�n.|�d
�dk�r�|�d�dk�r�|�|||�|jttfk�r*|� ||j
|j�|j!|_!d|k�r*|j"}
|�#��s|jt$k�r$|
|�|j�7}
|
|_!|S)Ns\d+ hdrcharset=([^\n]+)\nr#r/�
hdrcharsetZBINARYs(\d+) ([^=]+)=rrGr$rj�GNU.sparse.map�GNU.sparse.sizezGNU.sparse.major�1zGNU.sparse.minorrFr')%r�r]rhr'rr=rr�re�search�groupr=rBr6�compile�match�groupsrIrKrgr��_decode_pax_fieldr7�PAX_NAME_FIELDSrarrt�_proc_gnusparse_01�_proc_gnusparse_00�_proc_gnusparse_10r;rdrir�r�r�rg)r�r�rWrrurmr6Zregexr�r5rJr'rkr�r8r8r9reish



$	
�
�
�


 
zTarInfo._proc_paxcCshg}t�d|�D]}|�t|�d���qg}t�d|�D]}|�t|�d���q:tt||��|_dS)Ns\d+ GNU.sparse.offset=(\d+)\nr#s\d+ GNU.sparse.numbytes=(\d+)\n)rq�finditerr�rIrs�list�zipr�)r�rkrrWZoffsetsrur\r8r8r9rz�szTarInfo._proc_gnusparse_00cCs@dd�|d�d�D�}tt|ddd�|ddd���|_dS)NcSsg|]}t|��qSr8)rI)�.0�xr8r8r9�
<listcomp>�sz.TarInfo._proc_gnusparse_01.<locals>.<listcomp>rn�,r$r#)r@r}r~r�)r�rkrr�r8r8r9ry�szTarInfo._proc_gnusparse_01cCs�d}g}|j�t�}|�dd�\}}t|�}t|�|dkrtd|krT||j�t�7}|�dd�\}}|�t|��q,|j��|_t	t
|ddd�|ddd���|_dS)NrIr#r$)r�r]r�r@rIr2r�r�r�r}r~r�)r�rkrr�Zfieldsr�rWZnumberr8r8r9r{�szTarInfo._proc_gnusparse_10c	Cs�|��D]�\}}|dkr&t|d|�q|dkr@t|dt|��q|dkrZt|dt|��q|tkr|tkr�zt||�}Wntk
r�d}YnX|dkr�|�d�}t|||�q|��|_dS)NzGNU.sparse.namer%ror'zGNU.sparse.realsizerr�)	r#�setattrrI�
PAX_FIELDS�PAX_NUMBER_FIELDSr0rXrr)r�rr6r7rJr'r8r8r9ri�s"

zTarInfo._apply_pax_infocCs4z|�|d�WStk
r.|�||�YSXdS)NrE)r=�UnicodeDecodeError)r�r'r6Zfallback_encodingZfallback_errorsr8r8r9rw	szTarInfo._decode_pax_fieldcCs"t|t�\}}|r|d7}|tS)Nr#)r\r�)r�rTrbrcr8r8r9rhszTarInfo._blockcCs
|jtkSr�)r�
REGULAR_TYPESr�r8r8r9r�sz
TarInfo.isregcCs|��Sr�)r�r�r8r8r9�isfileszTarInfo.isfilecCs
|jtkSr�)rrr�r8r8r9r"sz
TarInfo.isdircCs
|jtkSr�)r�SYMTYPEr�r8r8r9r&sz
TarInfo.issymcCs
|jtkSr�)r�LNKTYPEr�r8r8r9r�*sz
TarInfo.islnkcCs
|jtkSr�)rrCr�r8r8r9�ischr.sz
TarInfo.ischrcCs
|jtkSr�)rrDr�r8r8r9�isblk2sz
TarInfo.isblkcCs
|jtkSr�)r�FIFOTYPEr�r8r8r9�isfifo6szTarInfo.isfifocCs
|jdk	Sr�)r�r�r8r8r9�issparse:szTarInfo.issparsecCs|jtttfkSr�)rrCrDr�r�r8r8r9�isdev=sz
TarInfo.isdev)r�)3rnrorp�dict�	__slots__r��propertyr%�setterr&rrr�r!rrr(r$r%r&�classmethodr?r.�staticmethodr/rFr1r:r_rar`rfrbrcrerzryr{rirwrhr�r�rrr�r�r�r�r�r�r8r8r8r9rRs��




�
1

)
	

2
>

h	c
@s�eZdZdZdZdZdZeZe	Z
dZeZ
eZdZdedd�Zedddefd	d
��Zedfdd��Zedgdd��Zedhdd��Zedidd��Zddddd�Zdd�Zdd�Zdd�Zdd �Zdjd!d"�Zdkdd$�d%d&�Zdldd'�d(d)�Z dmd*d+�Z!d,d-�Z"dnddd/�d0d1�Z#doddd/�d3d4�Z$d5d6�Z%d7d8�Z&d9d:�Z'd;d<�Z(d=d>�Z)dpd?d@�Z*dAdB�Z+dCdD�Z,dEdF�Z-dGdH�Z.dIdJ�Z/dKdL�Z0dMdN�Z1dOdP�Z2dQdR�Z3dSdT�Z4dqdUdV�Z5dWdX�Z6drdYdZ�Z7d[d\�Z8d]d^�Z9d_d`�Z:dadb�Z;dcdd�Z<dS)srrFr#Nrwr"c
Cs�ddddd�}||krtd��||_|||_|sh|jdkrTtj�|�sTd|_d|_t||j�}d	|_n@|dkr�t|d
�r�t	|j
ttf�r�|j
}t|d�r�|j|_d|_|r�tj�
|�nd|_
||_|dk	r�||_|dk	r�||_|dk	r�||_|dk	r�||_|dk	�r||_|	|_|
dk	�r0|jtk�r0|
|_ni|_|dk	�rF||_|dk	�rV||_|
|_d	|_g|_d	|_|j��|_i|_z�|jd
k�r�d|_ |�!�|_ |jdk�r2|j�"|j�z|j�#|�}|j�$|�WnXt%k
�r�|j�"|j�Y�q2Yn0t&k
�r,}zt't|���W5d}~XYnX�q�|jdk�r|d|_|j�r||j�(|j�)��}|j�*|�|jt+|�7_Wn&|j�s�|j�,�d|_�YnXdS)N�rbzr+b�wbZxb�rw�arxr��!mode must be 'r', 'a', 'w' or 'x'r�rxFr�r�Trw�r�rxr�)-r0r��_moderzr%�exists�	bltn_openr�rr7r�r9rO�abspathr�rSr��dereference�ignore_zerosr6r7rr�debug�
errorlevel�copybufsizer��members�_loadedr�r��inodes�firstmemberrkr�rar�rsrrr?rr^r2r�)r�r�r�r�rSr�r�r�r6r7rr�r�r�Zmodes�erWr8r8r9r�^s�
�





"
zTarFile.__init__c

s�|s|std��|dkr��fdd�}t�j|d�D]j}t��j|�}|dk	rV|��}	z||d|f|�WSttfk
r�|dk	r�|�|	�Yq2Yq2Xq2td���nd|k�r|�dd	�\}
}|
p�d}
|p�d
}|�jkr�t��j|�}ntd|��|||
|f|�Sd|k�r�|�dd	�\}
}|
�p.d}
|�p8d
}|
d
k�rLtd��t	||
|||�}z�||
|f|�}Wn|�
��YnXd|_|S|dk�r��j|||f|�Std��dS)Nznothing to open)rw�r:*cs�j|dkS)N�taropen)�	OPEN_METH)r��r>r8r9�not_compressed�sz$TarFile.open.<locals>.not_compressed)�keyrwz%file could not be opened successfully�:r#r�r��|rvzmode must be 'r' or 'w'Fr�zundiscernible mode)
r0�sortedr�rhr�rrr�r@r�r�r�r�)
r>r�r�r�ra�kwargsr�r��funcZ	saved_pos�filemode�streamr�r8r�r9r�sP%







zTarFile.opencKs |dkrtd��||||f|�S)Nr�r�)r0)r>r�r�r�r�r8r8r9r�(szTarFile.taropenr�cKs�|dkrtd��zddlm}Wntk
r<td��YnXz|||d||�}Wn.tk
r�|dk	r||dkr|td���YnXz|j|||f|�}WnBtk
r�|��|dkr�td���Yn|���YnXd	|_	|S)
N�rwrxr��mode must be 'r', 'w' or 'x'r)�GzipFilezgzip module is not availablerdrwr�F)
r0Zgzipr�r�rr�rr�r�r�)r>r�r�r��
compresslevelr�r�r�r8r8r9�gzopen0s0zTarFile.gzopenc	Ks�|dkrtd��zddlm}Wntk
r<td��YnX||pF|||d�}z|j|||f|�}WnFttfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
Nr�r�r)�BZ2Filer�)r�rwznot a bzip2 fileF)r0r�r�r�rr�r��EOFErrorr�rr�)r>r�r�r�r�r�r�r�r8r8r9�bz2openQs&zTarFile.bz2openc		Ks�|dkrtd��zddlm}m}Wntk
r@td��YnX||pJ|||d�}z|j|||f|�}WnF|tfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
Nr�r�r)�LZMAFiler�r�)�presetrwznot an lzma fileF)r0r�r�r�r�rr�r�r�rr�)	r>r�r�r�r�r�r�r�r�r8r8r9�xzopenms&zTarFile.xzopenr�r�r�r�)r�r�r�r�cCs�|jr
dSd|_z`|jdkrn|j�ttd�|jtd7_t	|jt
�\}}|dkrn|j�tt
|�W5|js�|j��XdS)NTr�r$r)r�r�r�r�r�r^r3r�r�r\�
RECORDSIZE)r�rbrcr8r8r9r��s
z
TarFile.closecCs"|�|�}|dkrtd|��|S)Nzfilename %r not found)�
_getmember�KeyError)r�r�r�r8r8r9�	getmember�s
zTarFile.getmembercCs|��|js|��|jSr�)�_checkr��_loadr�r�r8r8r9�
getmembers�szTarFile.getmemberscCsdd�|��D�S)NcSsg|]
}|j�qSr8r)rr�r8r8r9r��sz$TarFile.getnames.<locals>.<listcomp>)r�r�r8r8r9�getnames�szTarFile.getnamescCs^|�d�|dk	r|j}|dkr$|}tj�|�\}}|�tjd�}|�d�}|��}||_	|dkr�|j
stt�|�}q�t�|�}nt�
|���}d}|j}t�|�r�|j|jf}	|j
s�|jdkr�|	|jkr�||j|	kr�t}
|j|	}nt}
|	dr�||j|	<nht�|��rt}
nVt�|��r"t}
nDt�|��r>t}
t�|�}n(t�|��rPt}
nt� |��rbt!}
ndS||_||_"|j#|_$|j%|_&|
tk�r�|j'|_(nd|_(|j)|_*|
|_+||_,t-�r�zt-�.|j$�d|_/Wnt0k
�r�YnXt1�rzt1�2|j&�d|_3Wnt0k
�rYnX|
tt!fk�rZt4td��rZt4td��rZt�5|j6�|_7t�8|j6�|_9|S)N�awxr�r�r#r�major�minor):r�r�rzr%�
splitdriver�r�r�r�r�r��lstat�stat�fstat�fileno�st_mode�S_ISREG�st_ino�st_dev�st_nlinkr�r�r�S_ISDIRr�S_ISFIFOr��S_ISLNKr��readlink�S_ISCHRrC�S_ISBLKrDr��st_uidr)�st_gidr*�st_sizer'�st_mtimer(rr�pwd�getpwuidr+r��grpZgetgrgidr,rr��st_rdevrr�r)r�r��arcnamer�Zdrvr�ZstatresrZstmd�inoderr8r8r9�
gettarinfo�s�	


��

zTarFile.gettarinfoT)r�cCs*|��|dkr|}|D�]
}|r�|jdkr6td�ntt�|j��td|jpT|j|jp^|jf�|�	�sv|�
�r�tdd|j|jf�ntd|j
�|jdkr�td�ntdt�|j�dd��t|j|��r�d	nd
�|�r|���rtd|j�|���rtd|j�t�qdS)
Nz
??????????z%s/%sz%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02dr�r�r�z-> zlink to )r�r�rlr�r�r+r)r,r*r�r�rrr'r(r��	localtimer�rrrr�rk)r��verboser�r�r8r8r9r}'s8



��

�

zTarFile.list��filterc	Cs6|�d�|dkr|}|jdk	rFtj�|�|jkrF|�dd|�dS|�d|�|�||�}|dkrz|�dd|�dS|dk	r�||�}|dkr�|�dd|�dS|��r�t|d��}|�	||�W5QRXn`|�
��r(|�	|�|�r2tt�|��D]*}|j
tj�||�tj�||�||d�q�n
|�	|�dS)	Nr�r$ztarfile: Skipped %rr#ztarfile: Unsupported type %r�tarfile: Excluded %rr�r�)r�r�rzr%r��_dbgr�r�r��addfilerr��listdir�addr�)r�r�r��	recursiver�r��fr8r8r9r�Ms8



�
zTarFile.addcCs�|�d�t�|�}|�|j|j|j�}|j�|�|jt	|�7_|j
}|dk	r�t||j|j|d�t
|jt�\}}|dkr�|j�tt|�|d7}|j|t7_|j�|�dS)Nr�)rarr#)r�rr(rSr6r7r�r^r�r2r�r[r'r\r�r3r�r�)r�r�r�rWrarbrcr8r8r9r��s

zTarFile.addfilec	CsB|dkr�|j}|dkr�tj�d�}|dkr�ztt�}Wntk
rJYnBXddl}|jddd�}|�|�	|�W5QRX|jdddd�}|r�zt
|}Wn&tk
r�td|�d	��d�YnX||_|St
r�t�d
t�tStSt|t�r�td��|St|��r
|Sz
t
|WStk
�r<td|�d	��d�YnXdS)NZ PYTHON_TARFILE_EXTRACTION_FILTERr)�#)Z
interpolationZcomment_prefixesr�r�)Zfallbackzfilter z
 not foundaThe default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.zrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.)�extraction_filterrz�environrBr��_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�_NAMED_FILTERSr�r0�_RH_SAFER_DEFAULT�warnings�warn�RuntimeWarningrrr7r9�	TypeError�callable)r�r�r��filer�Zconfr8r8r9�_get_filter_function�sZ���	
�

zTarFile._get_filter_function�.)�
numeric_ownerr�cCs�g}|�|�}|dkr|}|D]F}|�|||�}|dkr:q|��rL|�|�|j|||��|d�q|jdd�dd�|D]n}tj�||j	�}	z,|j
||	|d�|�||	�|�||	�Wq|t
k
r�}
z|�|
�W5d}
~
XYq|Xq|dS)N��	set_attrsrcSs|jSr�r)r�r8r8r9�<lambda>�r�z$TarFile.extractall.<locals>.<lambda>T)r��reverse)r)r�_get_extract_tarinforr��_extract_one�sortrzr%r�r��chown�utime�chmodr
�_handle_nonfatal_error)r�r%r�rr�Zdirectories�filter_functionrr��dirpathr�r8r8r9�
extractall�s,

�zTarFile.extractallr�cCs4|�|�}|�|||�}|dk	r0|�||||�dSr�)rr	r
)r�rr%rrr�rr�r8r8r9�extract�s
zTarFile.extractc
Cs�t|t�r|�|�}n|}|}z|||�}WnZttfk
r\}z|�|�W5d}~XYn,tk
r�}z|�|�W5d}~XYnX|dkr�|�dd|j	�dS|�
�r�t�|�}tj
�||j�|_|S)Nr$r�)r7r9r�r�r��_handle_fatal_errorr
rr�r�r�rrzr%r�rr)r�rrr%r�Z
unfilteredr�r8r8r9r		s"

zTarFile._get_extract_tarinfoc
Cs�|�d�z"|j|tj�||j�||d�WnVtk
rX}z|�|�W5d}~XYn,tk
r�}z|�	|�W5d}~XYnXdS)Nrwr)
r��_extract_memberrzr%r�r�r�rr
r)r�r�r%rrr�r8r8r9r
%	s
�
zTarFile._extract_onecCs"|jdkr�n|�dd|�dS)Nr#�tarfile: %s)r�r��r�r�r8r8r9r2	s
zTarFile._handle_nonfatal_errorcCsn|jdkr�n\t|t�rP|jdkr6|�dd|j�qj|�dd|j|jf�n|�ddt|�j|f�dS)Nrr#rztarfile: %s %rztarfile: %s %s)r�r7r��filenamer��strerrorrrnrr8r8r9r9	s


zTarFile._handle_fatal_errorcCs�|�d�t|t�r |�|�}n|}|��s6|jtkrB|�||�S|��sR|�	�rzt|j
t�rhtd��q~|�
|�|��SndSdS)Nrwz'cannot extract (sym)link as file object)r�r7r9r�r�rrg�
fileobjectr�rr�r�r	�extractfile�_find_link_target)r�rr�r8r8r9rE	s


zTarFile.extractfilecCsT|�d�}|�dtj�}tj�|�}|r>tj�|�s>t�|�|��sN|�	�rh|�
dd|j|jf�n|�
d|j�|�
�r�|�||�n�|��r�|�||�nx|��r�|�||�nb|��s�|��r�|�||�nD|��s�|�	�r�|�||�n&|jtk�r|�||�n|�||�|�rP|�|||�|�	��sP|�||�|�||�dS)Nr�r#z%s -> %s)rXr�rzr�r%rr��makedirsr�rr�r�rr��makefiler�makedirr��makefifor�r��makedev�makelinkrrg�makeunknownrrr
)r�r��
targetpathrrZ	upperdirsr8r8r9rd	s4


zTarFile._extract_membercCs@z&|jdkrt�|�nt�|d�Wntk
r:YnXdS)Ni�)r�rz�mkdir�FileExistsError�r�r�r$r8r8r9r�	s
zTarFile.makedirc	Cs�|j}|�|j�|j}t|d��b}|jdk	rn|jD]"\}}|�|�t|||t|�q4|�|j�|�	�nt|||jt|�W5QRXdS)Nr�)
r�r�r�r�r�r�r[rr'�truncate)r�r�r$�sourcera�targetr�r'r8r8r9r�	s


zTarFile.makefilecCs"|�||�|�dd|j�dS)Nr#z9tarfile: Unknown file type %r, extracted as regular file.)rr�rr'r8r8r9r#�	s�zTarFile.makeunknowncCs"ttd�rt�|�ntd��dS)N�mkfifozfifo not supported by system)rrzr+r
r'r8r8r9r �	s
zTarFile.makefifocCsjttd�rttd�std��|j}|dkr.d}|��rB|tjO}n
|tjO}t�||t�	|j
|j��dS)N�mknodr!z'special devices not supported by systemr�)rrzr
r�r�r��S_IFBLK�S_IFCHRr,r!rr)r�r�r$r�r8r8r9r!�	s
�zTarFile.makedevcCs�zb|��r0tj�|�r t�|�t�|j|�n0tj�|j�rNt�	|j|�n|�
|�|�|�WnHtk
r�z|�
|�|�|�Wnt
k
r�td��YnXYnXdS)Nz%unable to resolve link inside archive)rrzr%�lexists�unlink�symlinkrr�r�linkrr�symlink_exceptionr�r
r'r8r8r9r"�	s"
��zTarFile.makelinkcCs�ttd�r�t��dkr�|j}|j}|s�ztrB|jrBt�|j�d}Wntk
rXYnXzt	rv|j
rvt	�|j
�d}Wntk
r�YnX|dkr�d}|dkr�d}z4|��r�ttd�r�t�
|||�nt�|||�Wntk
r�td��YnXdS)N�geteuidrr$r;�lchownzcould not change owner)rrzr4r*r)r�r,Zgetgrnamr�r�r+�getpwnamrr5rr�r
)r�r�r$r�g�ur8r8r9r�	s0

z
TarFile.chowncCsB|jdkrdSzt�||j�Wntk
r<td��YnXdS)Nzcould not change mode)r�rzrr�r
r'r8r8r9r
s
z
TarFile.chmodcCsV|j}|dkrdSttd�s dSzt�|||f�Wntk
rPtd��YnXdS)Nr
z"could not change modification time)r(rrzr
r�r
)r�r�r$r(r8r8r9r

s
z
TarFile.utimec
Cs�|�d�|jdk	r$|j}d|_|S|j|j��krZ|j�|jd�|j�d�sZtd��d}z|j�	|�}W�q�t
k
r�}z6|jr�|�dd|j|f�|jt
7_WY�q^W5d}~XY�q�tk
�r6}zR|j�r|�dd|j|f�|jt
7_WY� q^n|jdk�r&tt|���W5d}~XYn�tk
�r^|jdk�rZtd��Ynjtk
�r�}z|jdk�r�tt|���W5d}~XYn0tk
�r�}ztt|���W5d}~XYnX�q�q^|dk	�r�|j�|�nd|_|S)	NZrar#rYr$z0x%X: %srz
empty fileT)r�r�r�r�r�r�r]rr�rarsr�r�r�rKr9rqrrrtr�r�r�)r��mr�r�r8r8r9rk'
sJ



zTarFile.nextc	Cs�|��}d}|dk	rHz|�|�}Wntk
r:d}YnX|d|�}|rXtj�|�}t|�D]D}|rz|j|jkr`d}q`|r�tj�|j�}n|j}||kr`|Sq`|r�t|��dS)NFT)	r��indexr0rzr%�normpath�reversedr�r�)	r�r�r��	normalizer�Zskippingr:r�member_namer8r8r9r�]
s,

zTarFile._getmembercCs|��}|dkrqqd|_dSr�)rkr�r�r8r8r9r��
sz
TarFile._loadcCs:|jrtd|jj��|dk	r6|j|kr6td|j��dS)Nz%s is closedzbad operation for mode %r)r�r�r�rnr�)r�r�r8r8r9r��
szTarFile._checkcCs`|��r.d�tdtj�|j�|jf��}d}n
|j}|}|j||dd�}|dkr\t	d|��|S)Nr�T)r�r=zlinkname %r not found)
rr�r�rzr%rr�rr�r�)r�r�r�limitrr8r8r9r�
s zTarFile._find_link_targetccs�|jr|jEdHdSd}|jdk	r:|��}|d7}|V|t|j�krT|j|}n"|jsr|��}|svd|_dSndS|d7}|Vq:dS)Nrr#T)r�r�r�rkr2)r�r:r�r8r8r9�__iter__�
s$
zTarFile.__iter__cCs||jkrt|tjd�dS)N�r)r�rkri�stderr)r��level�msgr8r8r9r��
s
zTarFile._dbgcCs|��|Sr�)r�r�r8r8r9�	__enter__�
szTarFile.__enter__cCs,|dkr|��n|js"|j��d|_dSr�)r�r�r�r�)r�rr'�	tracebackr8r8r9�__exit__�
s


zTarFile.__exit__)
NrwNNNNNNr"NNNN)rwN)rwNr�)rwNr�)rwNN)NNN)T)NT)N)rN)r�T)TF)NF)N)=rnrorpr�r�r�r�rrSrr6r7rr�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r}r�r�rrrr	r
rrrrrrr#r r!r"rrr
rkr�r�r�rr@r�rErGr8r8r8r9rBs��
oZ �


c&3
5�-�
�
1!
6
(

	cCs2zt|�}|��WdStk
r,YdSXdS)NTF)rr�r)r�r�r8r8r9r�
sc	Csddl}d}|j|d�}|jdddddd	�|jd
dtdd
�|jdd�}|jddddd�|jdddddd�|jdddddd�|jdd dd!d�|��}|jr�|jdkr�|�d"d#�|j	dk	�r4|j	}t
|��rt|d$�� }|��t
|��tjd%�W5QRX|j�r0t
d&�|��n|�d"d'�|���n�|jdk	�r�|j}t
|��rxt�|d(��}|j|jd)�W5QRXn|�d"d'�|���nv|jdk	�rbt|j�d"k�r�|jd}tj}n,t|j�d*k�r�|j\}}n|�d"|���t
|��rNt�|d(��}|j||jd+�W5QRX|j�r`|d,k�r8d-�|�}	nd.�||�}	t
|	�n|�d"d'�|��n�|jdk	�r|j�d�}
tj�|
�\}}d/d/d0d0d1d1d1d1d2�}
||
k�r�d3|
|nd4}|j}t�|
|��}|D]}|�|��q�W5QRX|j�rt
d5�|
��dS)6Nrz3A simple command-line interface for tarfile module.)�descriptionz-vz	--verbose�
store_trueFzVerbose output)�action�default�helpz--filterz<filtername>zFilter for extraction)�metavar�choicesrLT)Zrequiredz-lz--list�	<tarfile>zShow listing of a tarfile)rMrLz-ez	--extract�+)rOz<output_dir>zExtract tarfile into target dir)�nargsrMrLz-cz--create)z<name>z<file>zCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr#z&--filter is only valid for extraction
rwrAz{!r} is a tar archive.z{!r} is not a tar archive.
r�)r�r$)r%r�rz{!r} file is extracted.z+{!r} file is extracted into {!r} directory.r�r�r�)r�z.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:rxz{!r} file created.)�argparse�ArgumentParser�add_argumentr�Zadd_mutually_exclusive_group�
parse_argsr�r�exitZtestrrr�rkrirBr�rSr}rr2rz�curdirZformat_helprZcreate�popr%�splitextr�)rRrH�parserrs�argsr_r�ZtfrWrDZtar_name�_ZextZcompressionsZtar_modeZ	tar_files�	file_namer8r8r9�main�
s���
�
�
�
�




�
�
r^�__main__)T)l�version�
__author__�__credits__�builtinsrr�rirzr�rZr�r�rVrrqr�r�r�r��AttributeError�NotImplementedErrorr3r��	NameError�__all__r�r�r3r�r�r0r+r-r,rArrUr�r�rCrDrr�ZCONTTYPEr3r2rVr;r=rdr
rrrrgr�rYr�rxr8rIr�r�r�getfilesystemencodingr:r?rNrTrXr[rl�	Exceptionrr
rrr	rrqrrrsrKrtrur��objectr�r��BufferedReaderr�r�r�r�r�r�r�rrrr
r�rrrrr^rnr8r8r8r9�<module> s:


�����
sh

?�u)_
cgi.cpython-38.opt-1.pyc000064400000063655151450073350010717 0ustar00U

&�.e���@sjdZdZddlmZmZmZddlmZddlZddl	Z	ddl
Zddlm
Z
ddlmZddlZddlZddlZdd	d
ddd
ddddddgZdadadd�Zdd�Zdd�Zdd�Zeadade	jdddfdd
�Zd1d!d�Zd"d#�Zd$d�Z Gd%d�d�Z!Gd&d	�d	�Z"e	jfd'd
�Z#d2d(d�Z$e	jfd)d�Z%d*d�Z&d+d�Z'd,d�Z(d-d�Z)d.d/�Z*e+d0k�rfe#�dS)3z�Support module for CGI (Common Gateway Interface) scripts.

This module defines a number of utilities for use by CGI scripts
written in Python.
z2.6�)�StringIO�BytesIO�
TextIOWrapper)�MappingN)�
FeedParser)�Message�MiniFieldStorage�FieldStorage�parse�parse_multipart�parse_header�test�print_exception�
print_environ�
print_form�print_directory�print_arguments�print_environ_usage�cGsFtr,ts,zttd�aWntk
r*YnXts6tantat|�dS)a�Write a log message, if there is a log file.

    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).

    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.

    If the global logfp is not None, it should be a file object to
    which log data is written.

    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).

    �aN)�logfile�logfp�open�OSError�nolog�log�dolog�Zallargs�r�/usr/lib64/python3.8/cgi.py�initlog8sr cGst�||d�dS)z=Write a log message to the log file.  See initlog() for docs.�
N)r�write)Zfmt�argsrrrr[srcGsdS)z9Dummy function, assigned to log when logging is disabled.Nrrrrrr_srcCsdatrt��datadS)zClose the log file.rN)rr�closer rrrrr�closelogcs
r%c
Cs^|dkrtj}t|d�r |j}nd}t|t�r4|j}d|krDd|d<|ddk�rt|d�\}}|dkrxt|||d	�S|d
kr�t	|d�}t
r�|t
kr�td��|�|��
|�}	nd
}	d|kr�|	r�|	d}	|	|d}	n*tjdd��r|	r�|	d}	|	tjd}	|	|d<n<d|k�r |d}	n(tjdd��r<tjd}	nd
}	|	|d<tjj|	||||d�S)a�Parse a query in the environment or from a file (default stdin)

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.
    N�encodingzlatin-1�REQUEST_METHOD�GET�POST�CONTENT_TYPEzmultipart/form-data)�	separator�!application/x-www-form-urlencoded�CONTENT_LENGTH�Maximum content length exceededr�QUERY_STRING�&�)r&r+)�sys�stdin�hasattrr&�
isinstancer�bufferrr�int�maxlen�
ValueError�read�decode�argv�urllibr
Zparse_qs)
�fp�environ�keep_blank_values�strict_parsingr+r&�ctype�pdictZclength�qsrrrr
vsL




��utf-8�replacer0csx|d�d�}d�|�}t�}|�|�z|d|d<Wntk
rLYnXt||||ddi|d���fd	d
��D�S)a�Parse multipart input.

    Arguments:
    fp   : input file
    pdict: dictionary containing other parameters of content-type header
    encoding, errors: request encoding and error handler, passed to
        FieldStorage

    Returns a dictionary just like parse_qs(): keys are the field names, each
    value is a list of values for that field. For non-file fields, the value
    is a list of strings.
    �boundary�asciiz multipart/form-data; boundary={}zCONTENT-LENGTHzContent-Lengthr'r))�headersr&�errorsr?r+csi|]}|��|��qSr)�getlist)�.0�k�Zfsrr�
<dictcomp>�sz#parse_multipart.<locals>.<dictcomp>)r;�formatrZset_type�KeyErrorr	)r>rCr&rJr+rGrBrIrrNrr�s


�ccs�|dd�dkr�|dd�}|�d�}|dkr`|�dd|�|�dd|�dr`|�d|d�}q&|dkrpt|�}|d|�}|��V||d�}qdS)Nr1�;r�"�\"�)�find�count�len�strip)�s�end�frrr�_parseparam�s
(
r]cCs�td|�}|��}i}|D]�}|�d�}|dkr|d|�����}||dd���}t|�dkr�|d|dkr�dkr�nn |dd�}|�d	d
��dd�}|||<q||fS)zfParse a Content-type like header.

    Return the main content-type and a dictionary of options.

    rR�=rNr1rU���rSz\\�\rT)r]�__next__rVrY�lowerrXrF)�line�parts�keyrC�p�i�name�valuerrrr�s
,
c@s@eZdZdZdZdZdZdZiZdZ	iZ
iZdd�Zdd�Z
dS)rz=Like FieldStorage, for use when no file uploads are possible.NcCs||_||_dS)z&Constructor from field name and value.N�rhri��selfrhrirrr�__init__	szMiniFieldStorage.__init__cCsd|j|jfS)z Return printable representation.zMiniFieldStorage(%r, %r)rj�rlrrr�__repr__szMiniFieldStorage.__repr__)�__name__�
__module__�__qualname__�__doc__�filename�list�type�file�type_options�disposition�disposition_optionsrIrmrorrrrr�sc@s�eZdZdZdddejdddddddfdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d:dd�Zd;dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdZd'd(�Zd)d*�Zd+Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z dS)<r	a�Store a sequence of fields, reading multipart/form-data.

    This class provides naming, typing, files stored on disk, and
    more.  At the top level, it is accessible like a dictionary, whose
    keys are the field names.  (Note: None can occur as a field name.)
    The items are either a Python list (if there's multiple values) or
    another FieldStorage or MiniFieldStorage object.  If it's a single
    object, it has the following attributes:

    name: the field name, if specified; otherwise None

    filename: the filename, if specified; otherwise None; this is the
        client side filename, *not* the file name on which it is
        stored (that's a temporary file you don't deal with)

    value: the value as a *string*; for file uploads, this
        transparently reads the file every time you request the value
        and returns *bytes*

    file: the file(-like) object from which you can read the data *as
        bytes* ; None if the data is stored a simple string

    type: the content-type, or None if not specified

    type_options: dictionary of options specified on the content-type
        line

    disposition: content-disposition, or None if not specified

    disposition_options: dictionary of corresponding options

    headers: a dictionary(-like) object (sometimes email.message.Message or a
        subclass thereof) containing *all* headers

    The class is subclassable, mostly for the purpose of overriding
    the make_file() method, which is called internally to come up with
    a file open for reading and writing.  This makes it possible to
    override the default choice of storing all files in a temporary
    directory and unlinking them as soon as they have been opened.

    N�rrErFcCsZd}||_||_|
|_||_d|kr0|d��}d|_|dksF|dkr�d|krX|d}
ntjdd�rrtjd}
nd}
|
�t	�
�d�}
t|
�}|dkr�d	d
i}|dkr�i}|dkr�d
|d	<d|kr�|d|d	<d|kr�|d|_d
|kr�|d
|d<nt|t
tf��std��||_|dk�r*tjj|_n<t|t��r@|j|_n&t|d��rXt|d��s`td��||_||_|	|_t|t��s�tdt|�j��||_d|_||_di}}d|jk�r�t|jd�\}}||_||_ d|_!d|k�r�|d|_!d|_"d|k�r
|d|_"|j"dk	|_#d	|jk�r6t|jd	�\}}n(|j�sH|dk�rTdi}}n
d
i}}||_||_$d|k�r�|d�|j|j�|_%nd|_%d}d|jk�r�zt&|jd�}Wnt'k
�r�YnXt(�r�|t(k�r�t'd��||_)|jdk�r|dk�r||_d|_*|_+d|_,|d
k�r,|�-�n*|dd�dk�rN|�.|||�n|�/�dS)a$Constructor.  Read multipart/* until last part.

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer
            (not used when the request method is GET)
            Can be :
            1. a TextIOWrapper object
            2. an object whose read() and readline() methods return bytes

        headers         : header dictionary-like object; default:
            taken from environ as per CGI spec

        outerboundary   : terminating multipart boundary
            (for internal use only)

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        limit : used internally to read parts of multipart/form-data forms,
            to exit from the reading loop when reached. It is the difference
            between the form content-length and the number of bytes already
            read

        encoding, errors : the encoding and error handler used to decode the
            binary stream to strings. Must be the same as the charset defined
            for the page sending the form (content-type : meta http-equiv or
            header)

        max_num_fields: int. If set, then __init__ throws a ValueError
            if there are more than n fields read by parse_qsl().

        r(r'NZHEADr/r1r�surrogateescapezcontent-typer,r)r*r-�content-lengthz?headers must be mapping or an instance of email.message.Messager:�readlinezfp must be file pointerz#outerboundary must be bytes, not %srzcontent-dispositionrhrtz
text/plainrGr{r_r.�
z
multipart/)0r@rA�max_num_fieldsr+�upper�
qs_on_postr2r<�encode�localeZgetpreferredencodingrr5rr�	TypeErrorrIr3r6r>rr4r&rJ�bytesrvrp�
outerboundary�
bytes_read�limitrryrzrhrt�_binary_filerx�
innerboundaryr7r9r8�lengthrurw�done�read_urlencoded�
read_multi�read_single)rlr>rIr�r?r@rAr�r&rJr�r+�methodrDZcdisprCrBZclenrrrrm?s�/
�


�






�

zFieldStorage.__init__cCs(z|j��Wntk
r"YnXdS�N)rwr$�AttributeErrorrnrrr�__del__�szFieldStorage.__del__cCs|Sr�rrnrrr�	__enter__�szFieldStorage.__enter__cGs|j��dSr�)rwr$)rlr#rrr�__exit__�szFieldStorage.__exit__cCsd|j|j|jfS)z"Return a printable representation.zFieldStorage(%r, %r, %r))rhrtrirnrrrro�s
�zFieldStorage.__repr__cCst|���Sr�)�iter�keysrnrrr�__iter__�szFieldStorage.__iter__cCsT|dkrt|��|jr:|j�d�|j��}|j�d�n|jdk	rL|j}nd}|S)Nrir)r�rw�seekr:rurkrrr�__getattr__�s

zFieldStorage.__getattr__cCs^|jdkrtd��g}|jD]}|j|kr|�|�q|sBt|��t|�dkrV|dS|SdS)zDictionary style indexing.N�
not indexabler1r)rur�rh�appendrQrX)rlre�found�itemrrr�__getitem__s


zFieldStorage.__getitem__cCs8||kr0||}t|t�r(dd�|D�S|jSn|SdS)z8Dictionary style get() method, including 'value' lookup.cSsg|]
}|j�qSr�ri�rL�xrrr�
<listcomp>sz)FieldStorage.getvalue.<locals>.<listcomp>N�r5ruri�rlre�defaultrirrr�getvalues
zFieldStorage.getvaluecCs4||kr,||}t|t�r$|djS|jSn|SdS)z! Return the first value received.rNr�r�rrr�getfirsts

zFieldStorage.getfirstcCs:||kr2||}t|t�r(dd�|D�S|jgSngSdS)z  Return list of received values.cSsg|]
}|j�qSrr�r�rrrr�.sz(FieldStorage.getlist.<locals>.<listcomp>Nr�)rlrerirrrrK)s

zFieldStorage.getlistcCs*|jdkrtd��ttdd�|jD���S)zDictionary style keys() method.Nr�css|]}|jVqdSr��rh�rLr�rrr�	<genexpr>8sz$FieldStorage.keys.<locals>.<genexpr>)rur��setrnrrrr�4s
zFieldStorage.keyscs*|jdkrtd��t�fdd�|jD��S)z%Dictionary style __contains__ method.Nr�c3s|]}|j�kVqdSr�r�r��rerrr�>sz,FieldStorage.__contains__.<locals>.<genexpr>)rur��any)rlrerr�r�__contains__:s
zFieldStorage.__contains__cCst|���S)z Dictionary style len(x) support.)rXr�rnrrr�__len__@szFieldStorage.__len__cCs|jdkrtd��t|j�S)NzCannot be converted to bool.)rur��boolrnrrr�__bool__Ds
zFieldStorage.__bool__c	Cs�|j�|j�}t|t�s0td|jt|�jf��|�|j	|j
�}|jrT|d|j7}tj
j||j|j|j	|j
|j|jd�}dd�|D�|_|��dS)z+Internal: read data in query string format.�%s should return bytes, got %sr0�r&rJr�r+cSsg|]\}}t||��qSr�r�rLrerirrrr�Vsz0FieldStorage.read_urlencoded.<locals>.<listcomp>N)r>r:r�r5r�r9rvrpr;r&rJr�r=r
�	parse_qslr@rAr�r+ru�
skip_lines)rlrD�queryrrrr�Is&
��zFieldStorage.read_urlencodedcCsL|j}t|�std|f��g|_|jrftjj|j|j|j	|j
|j|j|j
d�}|j�dd�|D��|jpp|j}|j��}t|t�s�td|jt|�jf��|jt|�7_|��d|jkr�|r�|j��}|jt|�7_q�|j}|dk	�r|t|j�8}t�}	d}
|j��}|
|7}
|���s�q0�q|
�s:�q@|jt|
�7_|	�|
�|j
|j��|	��}d	|k�rz|d	=|jdk�r�dn
|j|j}
||j||||||
|j
|j||j
�}|dk	�r�|d
8}|j�r�|t|j�8}|dk�r�td��|j|j7_|j�|�|j �s@|j|j!k�r4dk�rnn�q@�q|�"�dS)
z/Internal: read a part that is itself multipart.z&Invalid boundary in multipart form: %rr�css|]\}}t||�VqdSr�r�r�rrrr�fsz*FieldStorage.read_multi.<locals>.<genexpr>r��--Nr{r}r1rzMax number of fields exceeded)#r��valid_boundaryr9rur�r=r
r�r@rAr&rJr�r+�extend�FieldStorageClass�	__class__r>r~r5r�rvrpr�rXrYrZfeedr;r$r�r�r�r�r�)rlr?r@rAZibr��klassZ
first_liner��parserZhdr_text�datarIr��partrrrr�[s��

��





��

(zFieldStorage.read_multicCs4|jdkr|��|��n|��|j�d�dS)zInternal: read an atomic part.rN)r��read_binaryr��
read_linesrwr�rnrrrr��s


zFieldStorage.read_singlei cCs�|��|_|j}|dkr�|dkr�|j�t||j��}t|t�sVt	d|jt
|�jf��|jt
|�7_|std|_q�|j�|�|t
|�}qdS)zInternal: read binary data.rr�r_N)�	make_filerwr�r>r:�min�bufsizer5r�r9rvrpr�rXr�r")rlZtodor�rrrr��s

�zFieldStorage.read_binarycCs@|jrt�|_|_nt�|_|_|jr4|��n|��dS)z0Internal: read lines until EOF or outerboundary.N)r�rrw�_FieldStorage__filerr��read_lines_to_outerboundary�read_lines_to_eofrnrrrr��s
zFieldStorage.read_linescCsv|jdk	rF|j��t|�dkrF|��|_|j��}|j�|�d|_|jrZ|j�|�n|j�|�|j	|j
��dS)z line is always bytes, not stringNi�)r��tellrXr�rwr�r"r�r;r&rJ)rlrcr�rrrZ__write�s


zFieldStorage.__writecCs:|j�d�}|jt|�7_|s*d|_q6|�|�qdS)zInternal: read lines until EOF.�r_N)r>r~r�rXr��_FieldStorage__write)rlrcrrrr��szFieldStorage.read_lines_to_eofc	CsJd|j}|d}d}d}d}|jdk	rFd|jkr>|krFnn�qF|j�d�}|jt|�7_|t|�7}|s~d|_�qF|dkr�||}d}|�d�r�|r�|��}||kr��qF||kr�d	|_�qF|}|�	d
�r�d
}|dd�}d}nL|�	d��rd}|dd�}d}n*|�	d��r.d}|dd�}d
}nd}d
}|�
||�qdS)z�Internal: read lines until outerboundary.
        Data is read as bytes: boundaries and line ends must be converted
        to bytes for comparisons.
        r�r{TrNr�r_�
r1s
����
F)r�r�r>r~r�rXr��
startswith�rstrip�endswithr�)	rl�
next_boundary�
last_boundaryZdelim�last_line_lfendZ_readrc�strippedlineZodelimrrrr��sN
$
z(FieldStorage.read_lines_to_outerboundarycCs�|jr|jrdSd|j}|d}d}|j�d�}|jt|�7_|sPd|_q�|�d�r�|r�|��}||krpq�||kr�d|_q�|�d�}q&dS)z5Internal: skip lines until outer boundary if defined.Nr�Tr�r_r1r�)r�r�r>r~r�rXr�rY)rlr�r�r�rcr�rrrr�s$
zFieldStorage.skip_linescCs&|jrt�d�Stjd|jdd�SdS)a�Overridable: return a readable & writable file.

        The file will be used as follows:
        - data is written to it
        - seek(0)
        - data is read from it

        The file is opened in binary mode for files, in text mode
        for other fields

        This version opens a temporary file for reading and writing,
        and immediately deletes (unlinks) it.  The trick (on Unix!) is
        that the file can still be used, but it can't be opened by
        another process, and it will automatically be deleted when it
        is closed or when the current process terminates.

        If you want a more permanent file, you derive a class which
        overrides this method.  If you want a visible temporary file
        that is nevertheless automatically deleted when the script
        terminates, try defining a __del__ method in a derived class
        which unlinks the temporary files you have created.

        zwb+zw+r!)r&�newlineN)r��tempfileZ
TemporaryFiler&rnrrrr�(s
�zFieldStorage.make_file)N)N)!rprqrrrs�osr?rmr�r�r�ror�r�r�r�r�rKr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	sL)�
&


E	
2cCs�td�t�tjt_zNt�}t�t�t|�t|�t	�dd�}|fdd�}td�|�Wnt
�YnXtd�daz&t�}t�t�t|�t|�Wnt
�YnXd	S)
z�Robust test CGI script, usable as main program.

    Write minimal HTTP headers and dump all information provided to
    the script in HTML form.

    zContent-type: text/htmlcSstd�dS)Nz,testing print_exception() -- <I>italics?</I>)�execrrrrr\[sztest.<locals>.fcSs
|�dSr�r)r\rrr�g]sztest.<locals>.gz9<H3>What follows is a test, not an actual exception:</H3>z*<H1>Second try with a small maxlen...</H1>�2N)�printr2�stdout�stderrr	rrrrrrr8)r?�formr\r�rrrr
Js4
c	Csx|dkrt��\}}}ddl}t�td�|�||�|�||�}tdt�d�|dd���t�|d�f�~dS)Nrz+<H3>Traceback (most recent call last):</H3>z<PRE>%s<B>%s</B></PRE>rr_)	r2�exc_info�	tracebackr��	format_tb�format_exception_only�html�escape�join)rvri�tbr�r�rurrrrqs

��c	Cs\t|���}t�td�td�|D]"}tdt�|�dt�||��q&td�t�dS)z#Dump the shell environment as HTML.z<H3>Shell Environment:</H3>�<DL>�<DT>�<DD>�</DL>N)�sortedr�r�r�r�)r?r�rerrrrs cCs�t|���}t�td�|s&td�td�|D]Z}tdt�|�ddd�||}tdt�tt|���d	�td
t�t|���q2td�t�dS)
z$Dump the contents of a form as HTML.z<H3>Form Contents:</H3>z<P>No form fields.r�r��:� )r[z<i>z</i>r�r�N)r�r�r�r�r��reprrv)r�r�rerirrrr�sc
Csjt�td�zt��}Wn6tk
rP}ztdt�t|���W5d}~XYnXtt�|��t�dS)z#Dump the current directory as HTML.z#<H3>Current Working Directory:</H3>zOSError:N)r�r��getcwdrr�r��str)�pwd�msgrrrr�s&cCs(t�td�t�ttj�t�dS)Nz <H3>Command Line Arguments:</H3>)r�r2r<rrrrr�s

cCstd�dS)z9Dump a list of environment variables used by CGI as HTML.a�
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
N)r�rrrrr�scCs(ddl}t|t�rd}nd}|�||�S)Nrs^[ -~]{0,200}[!-~]$z^[ -~]{0,200}[!-~]$)�rer5r��match)rZr�Z_vb_patternrrrr��s

r��__main__)rErFr0)NNNN),rs�__version__�iorrrZcollections.abcrr2r�Zurllib.parser=Zemail.parserrZ
email.messagerr�r�r��__all__rrr rrr%rr8r?r
rr]rrr	r
rrrrrrr�rprrrr�<module>sh�#	�
F
:'
/
nntplib.cpython-38.opt-2.pyc000064400000051732151450073350011615 0ustar00U

e5d���@s�ddlZddlZddlZddlZddlZddlZzddlZWnek
rTdZYnXdZddl	m
ZddlmZdddd	d
ddd
gZ
dZGdd�de�ZGdd�de�ZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZdZdZdddddddddd d!d"hZd#d$d%d&d'd(d)gZd(d)d*�Zd+Ze�d,d-d.d/d0g�Ze�d1d2d3d4g�Zd5d
�Z
d6d7�Zdld8d9�Z dmd:d;�Z!dnd<d=�Z"e�r�d>d?�Z#Gd@dA�dA�Z$GdBd�de$�Z%e�r�GdCdD�dDe$�Z&e
�'dD�e(dEk�r�ddl)Z)e)j*dFdG�Z+e+j,dHdIdJdKdL�e+j,dMdNdOdPdL�e+j,dQdRdSe-dTeefdU�e+j,dVdWdXe-dYdU�e+j,dZd[d\dd]d^�e+�.�Z/e/j0Z0e/j�s�e0dSk�rxeZ0e%e/j1e0d_�Z2ne0dSk�r�eZ0e&e/j1e0d_�Z2e2�3�Z4d`e4k�r�e2�5�e2�6e/j6�\Z7Z8Z9Z:Z;e<dae;dbe8dce9dde:�dedf�Z=e>e-e:�e/j?dg�Z9e2�@e9e:�\Z7ZAeAD]Z\ZBZCe
eCd$��Ddhdg�dZEe
eCd#�ZFe-eCd)�ZGe<di�HeBe=eEdj�e=eFdk�eG���qe2�I�dS)o�NFT)�
decode_header)�_GLOBAL_DEFAULT_TIMEOUT�NNTP�	NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError�
NNTPDataErrorric@seZdZdd�ZdS)rcGs>tj|f|��z|d|_Wntk
r8d|_YnXdS)NrzNo response given)�	Exception�__init__�response�
IndexError)�self�args�r�/usr/lib64/python3.8/nntplib.pyrcs
zNNTPError.__init__N)�__name__�
__module__�__qualname__rrrrrrasc@seZdZdS)rN�rrrrrrrrjsc@seZdZdS)rNrrrrrrnsc@seZdZdS)rNrrrrrrrsc@seZdZdS)r	Nrrrrrr	vsc@seZdZdS)r
Nrrrrrr
zs�wi3Z100Z101�211�215Z220Z221Z222Z224Z225Z230Z231Z282�subject�from�datez
message-idZ
referencesz:bytesz:lines)�bytes�lines�
�	GroupInfo�group�last�first�flag�ArticleInfoZnumber�
message_idrcCsJg}t|�D]2\}}t|t�r4|�|�|p,d��q|�|�qd�|�S)N�ascii�)�_email_decode_header�
isinstancer�append�decode�join)Z
header_str�parts�v�encrrrr�s
cCs�g}|D]`}|ddkr:|dd��d�\}}}d|}n|�d�\}}}|��}t�||�}|�|�qt}t|�t|�kr�td��|dt|��|kr�td��|S)Nr�:�z$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)�	partition�lower�_OVERVIEW_FMT_ALTERNATIVES�getr+�_DEFAULT_OVERVIEW_FMT�lenr
)r�fmt�line�name�_�suffix�defaultsrrr�_parse_overview_fmt�s
r?cCs�tt�}g}|D]�}i}|�d�^}}t|�}t|�D]�\}	}
|	t|�krLq6||	}|�d�}|	|kr�|s�|d}
|
r�|
dt|
����|
kr�td��|
r�|
t|
�d�nd}
|
|||	<q6|�||f�q|S)N�	r1z: z?OVER/XOVER response doesn't include names of additional headers)	r8r7�split�int�	enumerate�
startswithr4r
r+)rr9Zdata_process_funcZ
n_defaultsZoverviewr:ZfieldsZarticle_number�tokens�i�tokenZ
field_nameZis_metadata�hrrr�_parse_overview�s&
rIcCs�|dkr |dd�}|dd�}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}|dkr�|d7}n|dkr�|d	7}t�||||||�S)
Ni�������������Fi��dil)rB�datetime)�date_str�time_strZhoursZminutesZseconds�yearZmonthZdayrrr�_parse_datetime�s
rTcCsPt|tj�sd}n
d�|�}|j}|r<|d}d�||�}nd�||�}||fS)NZ000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rOz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})r*rP�formatrS)ZdtZlegacyrR�yrQrrr�_unparse_datetime�s

rWcCs|dkrt��}|j||d�S)N)Zserver_hostname)�sslZ_create_stdlib_contextZwrap_socket)�sock�contextZhostnamerrr�_encrypt_onsr[c@seZdZdZdZdefdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZeZdd�Z
dd�Zdhdd�Zdd�Zdidd�Zdd�Zdjdd�Zdkdd �Zd!d"�Zd#d$�Zd%d&�Zdd'�d(d)�Zdd'�d*d+�Zdldd'�d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zdd'�d6d7�Zd8d9�Z d:d;�Z!dmd<d=�Z"d>d?�Z#d@dA�Z$dndBdC�Z%dodd'�dDdE�Z&dpdd'�dFdG�Z'dqdd'�dHdI�Z(dJdK�Z)dd'�dLdM�Z*dd'�dNdO�Z+dd'�dPdQ�Z,dd'�dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4drdbdc�Z5ddde�Z6e7�rdsdfdg�Z8dS)t�	_NNTPBasezutf-8�surrogateescapeNcCsj||_||_d|_|��|_d|_|��d|_|rZd|jkrZ|��|jsZd|_|��d|_	d|_
dS)NrF�READER)�host�file�	debugging�_getresp�welcome�_caps�getcapabilities�readermode_afterauth�_setreadermode�tls_on�
authenticated)rr`r_�
readermode�timeoutrrrr9s
	z_NNTPBase.__init__cCs|S�Nr�rrrr�	__enter__hsz_NNTPBase.__enter__c	sR�fdd�}|�rNz*z���Wnttfk
r8YnXW5|�rL���XdS)Ncs
t�d�S)Nr`)�hasattrrrmrr�<lambda>l�z$_NNTPBase.__exit__.<locals>.<lambda>)�_close�quit�OSError�EOFError)rrZis_connectedrrmr�__exit__ks
z_NNTPBase.__exit__cCs|jrtdt|j��|jS)Nz	*welcome*)ra�print�reprrcrmrrr�
getwelcomevsz_NNTPBase.getwelcomec	Cs�|jdkr�d|_d|_z|��\}}Wnttfk
rDi|_Yn<X||_d|krhttt|d��|_d|kr�d�	|d�|_|jS)Nr2ZVERSIONZIMPLEMENTATION� )
rd�nntp_versionZnntp_implementation�capabilitiesrr�max�maprBr-)r�resp�capsrrrres
z_NNTPBase.getcapabilitiescCs
||_dSrl)ra)r�levelrrr�set_debuglevel�sz_NNTPBase.set_debuglevelcCsHt�d||�|t}|jdkr.tdt|��|j�|�|j��dS)Nznntplib.putliner2z*put*)	�sys�audit�_CRLFrarwrxr`�write�flush�rr:rrr�_putline�s
z_NNTPBase._putlinecCs2|jrtdt|��|�|j|j�}|�|�dS)Nz*cmd*)rarwrx�encode�encoding�errorsr�r�rrr�_putcmd�sz_NNTPBase._putcmdTcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sDt�|r�|dd�t	krf|dd�}n|dd�t	kr�|dd�}|S)Nr2z
line too longz*get*rM���)
r`�readline�_MAXLINEr8r
rarwrxrur�)rZ
strip_crlfr:rrr�_getline�s
z_NNTPBase._getlinecCsl|��}|jrtdt|��|�|j|j�}|dd�}|dkrHt|��|dkrXt|��|dkrht	|��|S)Nz*resp*r2�4�5Z123)
r�rarwrxr,r�r�rrr	)rr�crrrrb�sz_NNTPBase._getrespcCs�d}z�t|ttf�r"t|d�}}|��}|dd�tkrBt|��g}|dk	r�dtdf}|�	d�}||krnq�|�
d�r�|dd�}|�|�qZn8d}|�	�}||kr�q�|�
d�r�|dd�}|�|�q�W5|r�|��X||fS)N�wb��.s.
Fs..r2)
�closer*�strr�openrb�	_LONGRESPrr�r�rDr�r+)rr`Z
openedFilerrZterminatorsr:�
terminatorrrr�_getlongresp�s4	



z_NNTPBase._getlongrespcCs|�|�|��Srl)r�rbr�rrr�	_shortcmd�s
z_NNTPBase._shortcmdcCs|�|�|�|�Srl�r�r�)rr:r`rrr�_longcmds
z_NNTPBase._longcmdcs.��|���|�\}}|�fdd�|D�fS)Ncsg|]}|��j�j��qSr)r,r�r���.0r:rmrr�
<listcomp>s�z,_NNTPBase._longcmdstring.<locals>.<listcomp>r�)rr:r`r�listrrmr�_longcmdstring	s

�z_NNTPBase._longcmdstringcCsdz|jWStk
rYnXz|�d�\}}Wn tk
rPtdd�}Yn
Xt|�}||_|S)NzLIST OVERVIEW.FMT)Z_cachedoverviewfmt�AttributeErrorr�rr7r?)rrrr9rrr�_getoverviewfmtsz_NNTPBase._getoverviewfmtcCsdd�|D�S)NcSsg|]}t|����qSr)r rAr�rrrr�&sz(_NNTPBase._grouplist.<locals>.<listcomp>r)rrrrr�
_grouplist$sz_NNTPBase._grouplistcCs8i}|�d�\}}|D]}|��^}}|||<q||fS)NZCAPABILITIES)r�rA)rr�rrr:r;rErrrr|(s
z_NNTPBase.capabilities)r`cCsbt|tjtjf�s$td�|jj���t||jdk�\}}d�||�}|�	||�\}}||�
|�fS)N�Athe date parameter must be a date or datetime object, not '{:40}'rJzNEWGROUPS {0} {1})r*rPr�	TypeErrorrU�	__class__rrWr{r�r�)rrr`rQrR�cmdrrrrr�	newgroups6s��z_NNTPBase.newgroupscCsRt|tjtjf�s$td�|jj���t||jdk�\}}d�|||�}|�	||�S)Nr�rJzNEWNEWS {0} {1} {2})
r*rPrr�rUr�rrWr{r�)rr!rr`rQrRr�rrr�newnewsFs��z_NNTPBase.newnewscCs4|dk	rd|}nd}|�||�\}}||�|�fS)NzLIST ACTIVE ZLIST)r�r�)r�
group_patternr`�commandrrrrrr�Vs

z_NNTPBase.listcCs�t�d�}|�d|�\}}|�d�s8|�d|�\}}i}|D]:}|�|���}|r@|�dd�\}	}
|sr|
S|
||	<q@|r�||fSdSdS)Nz^(?P<group>[^ 	]+)[ 	]+(.*)$zLIST NEWSGROUPS r�XGTITLE r2rJr()�re�compiler�rD�search�stripr!)rr�Z
return_all�line_patrr�groups�raw_line�matchr;Zdescrrr�_getdescriptionses


z_NNTPBase._getdescriptionscCs|�|d�S)NF�r�)rr!rrr�description|sz_NNTPBase.descriptioncCs|�|d�S)NTr�)rr�rrr�descriptions�sz_NNTPBase.descriptionscCs�|�d|�}|�d�s t|��|��}d}}}t|�}|dkr�|d}|dkr�|d}|dkr�|d}|dkr�|d��}|t|�t|�t|�|fS)NzGROUP rrr2rJr�rK)r�rDrrAr8r4rB)rr;r�words�countr#r"�nrrrr!�s

z_NNTPBase.groupcCs|�d|�S)NZHELP)r�)rr`rrr�help�sz_NNTPBase.helpcCs8|�d�st|��|��}t|d�}|d}|||fS)NZ22r2rJ)rDrrArB)rrr��art_numr&rrr�
_statparse�s
z_NNTPBase._statparsecCs|�|�}|�|�Srl)r�r�)rr:rrrr�_statcmd�s
z_NNTPBase._statcmdcCs"|r|�d�|��S|�d�SdS)NzSTAT {0}ZSTAT)r�rU)r�message_specrrr�stat�s	z_NNTPBase.statcCs
|�d�S)NZNEXT�r�rmrrr�next�sz_NNTPBase.nextcCs
|�d�S)NZLASTr�rmrrrr"�sz_NNTPBase.lastcCs0|�||�\}}|�|�\}}}|t|||�fSrl)r�r�r%)rr:r`rrr�r&rrr�_artcmd�sz_NNTPBase._artcmdcCs$|dk	rd�|�}nd}|�||�S)NzHEAD {0}ZHEAD�rUr��rr�r`r�rrr�head�sz_NNTPBase.headcCs$|dk	rd�|�}nd}|�||�S)NzBODY {0}ZBODYr�r�rrr�body�sz_NNTPBase.bodycCs$|dk	rd�|�}nd}|�||�S)NzARTICLE {0}ZARTICLEr�r�rrr�article�sz_NNTPBase.articlecCs
|�d�S)NZSLAVE)r�rmrrr�slavesz_NNTPBase.slavecsDt�d��|�d�||�|�\}}�fdd��|�fdd�|D�fS)Nz^([0-9]+) ?(.*)
?zXHDR {0} {1}cs��|�}|r|�dd�S|S)Nr2rJ)r�r!)r:�m)�patrr�
remove_numbers
z%_NNTPBase.xhdr.<locals>.remove_numbercsg|]}�|��qSrrr�)r�rrr�sz"_NNTPBase.xhdr.<locals>.<listcomp>)r�r�r�rU)rZhdrr�r`rrr)r�r�r�xhdrs	
z_NNTPBase.xhdrcCs.|�d�||�|�\}}|��}|t||�fS)Nz
XOVER {0}-{1})r�rUr�rI)r�start�endr`rrr9rrr�xovers
	�z_NNTPBase.xoverc	Csxd|jkrdnd}t|ttf�r>|\}}|d�||p6d�7}n|dk	rR|d|}|�||�\}}|��}|t||�fS)NZOVERZXOVERz {0}-{1}r(rz)rdr*�tupler�rUr�r�rI)	rr�r`r�r�r�rrr9rrr�over*sz_NNTPBase.overc	Csft�dtd�t�d�}|�d||�\}}g}|D](}|�|���}|r4|�|�	dd��q4||fS)NzFThe XGTITLE extension is not actively used, use descriptions() insteadrJz^([^ 	]+)[ 	]+(.*)$r�r2)
�warnings�warn�DeprecationWarningr�r�r�r�r�r+r!)	rr!r`r�rZ	raw_linesrr�r�rrr�xgtitleEs�
z_NNTPBase.xgtitlecCslt�dtd�|�d�|��}|�d�s0t|��z|��\}}Wntk
r^t|�d�Yn
X||fSdS)Nz(The XPATH extension is not actively usedrJz	XPATH {0}Z223)	r�r�r�r�rUrDrrA�
ValueError)r�idrZresp_num�pathrrr�xpathWs�
z_NNTPBase.xpathcCsb|�d�}|�d�st|��|��}t|�dkr8t|��|d}t|�dkrTt|��|t|d�fS)NZDATEZ111rJr2�)r�rDrrAr8r
rT)rr�elemrrrrrks

z_NNTPBase.datecCs�|�|�}|�d�st|��t|ttf�r2|��}|D]:}|�t�sR|�	d�t}|�d�rdd|}|j
�|�q6|j
�d�|j
��|�
�S)N�3rr�s.
)r�rDrr*r�	bytearray�
splitlines�endswithr��rstripr`r�r�rb)rr��frr:rrr�_post|s




z_NNTPBase._postcCs|�d|�S)NZPOST)r�)r�datarrr�post�sz_NNTPBase.postcCs|�d�|�|�S)Nz	IHAVE {0})r�rU)rr&r�rrr�ihave�sz_NNTPBase.ihavecCs|j��|`dSrl)r`r�rmrrrrr�s
z_NNTPBase._closecCsz|�d�}W5|��X|S)NZQUIT)rrr�)rrrrrrs�s
z_NNTPBase.quitcCs�|jrtd��|s|std��z<|rX|sXddl}|��}|�|j�}|rX|d}|d}Wntk
rnYnX|sxdS|�d|�}|�d�r�|s�t|��n |�d|�}|�d�s�t	|��d|_
|��|jr�d	|j
kr�|�
�d|_
|��dS)
NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrJzauthinfo user Z381zauthinfo pass Z281r^)rir��netrcZauthenticatorsr_rtr�rDrrrdrerfrg)r�user�password�usenetrcr�ZcredentialsZauthrrrr�login�s>�


z_NNTPBase.loginc
Cs`z|�d�|_WnJtk
r$Yn8tk
rZ}z|j�d�rHd|_n�W5d}~XYnXdS)Nzmode readerZ480T)r�rcrrr
rDrf)r�errrrg�sz_NNTPBase._setreadermodecCs||jrtd��|jrtd��|�d�}|�d�rp|j��t|j||j	�|_|j�
d�|_d|_d|_|��nt
d��dS)NzTLS is already enabled.z+TLS cannot be started after authentication.�STARTTLSZ382�rwbTzTLS failed to start.)rhr�rir�rDr`r�r[rYr_�makefilerdrer)rrZrrrr�starttls�s



z_NNTPBase.starttls)T)N)N)N)N)N)N)N)N)N)NNT)N)9rrrr�r�rrrnrvryrer��debugr�r�r�rbr�r�r�r�r�r�r|r�r�r�r�r�r�r!r�r�r�r�r�r"r�r�r�r�r�r�r�r�r�r�rr�r�r�rrrsr�rg�	_have_sslr�rrrrr\)sn
�
/		

.







		
)
r\c@s*eZdZeddddefdd�Zdd�ZdS)rNFc	Cs�||_||_t�d|||�t�||f|�|_d}z8|j�d�}t�	|||||�|sZ|rh|�
|||�Wn$|r~|��|j���YnXdS)N�nntplib.connectr�)r_�portr�r��socket�create_connectionrYr�r\rr�r�)	rr_r�r�r�rjr�rkr`rrrr�s$
�
z
NNTP.__init__cCs zt�|�W5|j��XdSrl�rYr�r\rrrmrrrrr$szNNTP._close)rrr�	NNTP_PORTrrrrrrrrr�s�
%c@s,eZdZedddddefdd�Zdd�ZdS)�NNTP_SSLNFc	
Cs�t�d|||�t�||f|�|_d}	zJt|j||�|_|j�d�}	tj||	|||d�|s`|rn|�	|||�Wn$|	r�|	�
�|j�
��YnXdS)Nr�r�)rjrk)r�r�r�r�rYr[r�r\rr�r�)
rr_r�r�r�Zssl_contextrjr�rkr`rrrr.s"
�
zNNTP_SSL.__init__cCs zt�|�W5|j��XdSrlr�rmrrrrrEszNNTP_SSL._close)rrr�
NNTP_SSL_PORTrrrrrrrrr�,s�
r��__main__zJ        nntplib built-in demo - display the latest articles in a newsgroup)r�z-gz--groupzgmane.comp.python.generalz3group to fetch messages from (default: %(default)s))�defaultr�z-sz--serverz
news.gmane.ioz+NNTP server hostname (default: %(default)s)z-pz--portr�z#NNTP port number (default: %s / %s))r�typer�z-nz
--nb-articles�
z2number of articles to fetch (default: %(default)s)z-Sz--ssl�
store_truezuse NNTP over SSL)�actionrr�)r_r�r�ZGroupZhaszarticles, range�tocCs$t|�|kr |d|d�d}|S)NrKz...)r8)�sZlimrrr�cutpsr	r2�<z{:7} {:20} {:42} ({})��*)N)N)F)Jr�r��collectionsrPr�r�rX�ImportErrorr�Zemail.headerrr)r�__all__r�rrrrrr	r
r�rr�r7r5r��
namedtupler r%r?rIrTrWr[r\rr�r+r�argparse�ArgumentParser�parser�add_argumentrB�
parse_argsrr�Zserverrrer�r�r!rr�r#r"r;rwr	r�Znb_articlesr�Z	overviewsZartnumr�rAZauthorrrrUrsrrrr�<module>Bs�
�
	���
��


Y.


�
�
���


�
platform.cpython-38.pyc000064400000057410151450073350011032 0ustar00U

e5d��@sldZdZdZddlZddlZddlZddlZddddddd	d	d
d
d�
Ze�d�Z	d
d�Z
e�dej�Zdwdd�Z
dxdd�Ze�d�Zdydd�Zddddddd d!d"d#d$d%�Zdd&d'd(d)d*d+�Zd,d-�Zd.d/�Zdzd0d1�Zd2d3�Zd{d5d6�Zd7d8�Zd|d9d:�Zd;d<�Zd=d>�Zd}d?d@�ZdAdB�Zd~dCdD�ZddEdF�ZdGdHdId�Z ej!ddfdJdK�Z"e�#dLdM�Z$da%dNdO�Z&dPdQ�Z'dRdS�Z(dTdU�Z)dVdW�Z*dXdY�Z+dZd[�Z,e�d\ej�Z-e�d]ej�Z.e�d^�Z/e�d_�Z0iZ1d�d`da�Z2dbdc�Z3ddde�Z4dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9iZ:d�dpdq�Z;e<drk�rhdsej=k�p8dtej=kZ>duej=k�oNdvej=kZ?e@e;e?e>��e�Ad�dS)�a8 This module tries to retrieve as much platform-identifying data as
    possible. It makes this information available via function APIs.

    If called from the command line, it prints the platform
    information concatenated as single string to stdout. The output
    format is useable as part of a filename.

a
    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee or royalty is hereby granted,
    provided that the above copyright notice appear in all copies and that
    both that copyright notice and this permission notice appear in
    supporting documentation or portions thereof, including modifications,
    that you make.

    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !

z1.0.8�N�
���(�2��)
ZdevZalpha�aZbeta�b�cZRCZrc�pl�pz([0-9]+|[._+-])c	Csbg}t�|�D]N}|dkrzt|d�}d}Wn tk
rLt�|d�}YnX|�||f�q|S)Nz._+-r�dr)�
_component_re�split�int�
ValueError�_ver_stages�get�extend)�version�result�v�t�r� /usr/lib64/python3.8/platform.py�_comparable_version�s
rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)��@c
Cs�|dkrZz0t�d�}|jdd�}t|�dkr6t|�WSWntttfk
rRYnXtj	}t
}ttjd�rvtj�
|�}t|d���`}|�|�}d}	|	t|�k�r�d	|ks�d
|kr�t�||	�}
nd}
|
r�|
��t|�k�r|�|�}|�r|t|	t|�d�d�|}d}	q�|
�s�q�dd
�|
��D�\}}
}}}}|�rF|�sFd}n�|
�rx|dk�r`d}|}n||�||�k�r�|}n\|�r�|dk�r�d}|�r�|�r�||�||�k�r�|}|�r�|t|�d�|k�r�||}|
��}	q�W5QRX||fS)a Tries to determine the libc version that the file executable
        (which defaults to the Python interpreter) is linked against.

        Returns a tuple of strings (lib,version) which default to the
        given parameters in case the lookup fails.

        Note that the function has intimate knowledge of how different
        libc versions add symbols to the executable and thus is probably
        only useable for executables compiled using gcc.

        The file is read and scanned in chunks of chunksize bytes.

    N�CS_GNU_LIBC_VERSION�)�maxsplit��realpath�rbrslibcsGLIBCi�cSs"g|]}|dk	r|�d�n|�qS)N�latin1)�decode)�.0�srrr�
<listcomp>�s�zlibc_ver.<locals>.<listcomp>Zlibc�glibc)�os�confstrr�len�tuple�AttributeErrorr�OSError�sys�
executabler�hasattr�pathr"�open�read�_libc_search�search�end�max�groups)r1�librZ	chunksize�ver�parts�V�fZbinary�pos�m�chunkZlibcinitr)ZglibcversionZsoZthreadsZ	soversionrrr�libc_ver�s^


�

rCcCs`|�d�}|r|�|�zttttt|���}Wntk
rH|}YnXd�|dd��}|S)z� Normalize the version and build strings and return a single
        version string using the format major.minor.build (or patchlevel).
    �.N�)r�append�list�map�strrr�join)r�build�lZstringsrrr�
_norm_version�s


rMz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc	Cs�tj|kr|||fSddl}dD]R}z|j||jddd�}Wn0t|jfk
rl}zWY�q W5d}~XYq Xq~q |||fS|��}t�	|�}|dk	r�|�
�\}}}|ddkr�|dd�}|ddkr�|dd�}t|�}|||fS)a+ Tries to figure out the OS version used and returns
        a tuple (system, release, version).

        It uses the "ver" shell command for this which is known
        to exists on Windows, DOS. XXX Others too ?

        In case this fails, the given parameters are used as
        defaults.

    rN)r<zcommand /c verz
cmd /c verT)�stderr�text�shell���rD)r0�platform�
subprocess�check_output�DEVNULLr/�CalledProcessError�strip�_ver_output�matchr:rM)	�system�releaserZsupported_platformsrW�cmd�infoZwhyrArrr�_syscmd_vers0

�


rbZ2000ZXPZ
2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10))�r)rfr�rfr!)rfN��r�rir�rir!�rirE�riN)rr)rNZ
2008ServerZ2008ServerR2Z
2012ServerZ2012ServerR2Zpost2012ServerR2)rgrhrjrkrlrmcCs
t�dkS)N)ZIoTUAPZ
NanoServerZWindowsCoreHeadlessZ	IoTEdgeOS)�
win32_editionrrrr�win32_is_iotOsroc
Cs�z.zddl}Wntk
r*ddl}YnXWntk
rBYnTXz<d}|�|j|�� }|�|d�dW5QR�WSQRXWntk
r�YnXdS)Nr�,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ	EditionId)�winreg�ImportError�_winreg�	OpenKeyEx�HKEY_LOCAL_MACHINE�QueryValueExr/)rq�cvkey�keyrrrrnRs(rnc	Cs�zddlm}Wn tk
r0||||fYSX|�}z ttt�d�d��\}}}Wn,tk
r�|jpx|dd�\}}}YnXd�	|||�}t
�||f�p�t
�|df�p�|}|dd�||fk�rzd�	|j�}Wn8t
k
�r|dd�d	k�rd
|dd�}YnXt|dd�dk�rJt�||f��pHt�|df��pH|}z0zddl}	Wntk
�rvddl}	YnXWntk
�r�YnLXz2d}
|	�|	j|
��}|	�|d
�d}W5QRXWntk
�r�YnX||||fS)Nr)�getwindowsversionr!rDrEz{0}.{1}.{2}zSP{}�
z
Service Pack ZSPZproduct_typerpZCurrentType)r0ryrrrHrrbrrZplatform_version�format�_WIN32_CLIENT_RELEASESrZservice_pack_majorr.�getattr�_WIN32_SERVER_RELEASESrqrsrtrurvr/)r_r�csd�ptyperyZwinver�major�minorrKrqrwrxrrr�	win32_verdsR ����r�c	Cs�d}tj�|�sdSzddl}Wntk
r6YdSXt|d��}|�|�}W5QRX|d}d}t��j}|dkrzd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr#ZProductVersion�rrr)ZppczPower MacintoshZPowerPC)	r*r3�exists�plistlibrrr4�load�uname�machine)�fnr�r?rr_�versioninfor�rrr�_mac_ver_xml�s
r�r�cCst�}|dk	r|S|||fS)a< Get macOS version information and return it as tuple (release,
        versioninfo, machine) with versioninfo being a tuple (version,
        dev_stage, non_release_version).

        Entries which cannot be determined are set to the parameter values
        which default to ''. All tuple entries are strings.
    N)r�)r_r�r�rarrr�mac_ver�sr�cCsHddlm}z|�|�}|dkr&|WS|WStk
rB|YSXdS)Nr)�System)�	java.langr�ZgetPropertyr.)�name�defaultr��valuerrr�
_java_getprop�s
r�cCs�zddl}Wn tk
r,||||fYSXtd|�}td|�}|\}}}td|�}td|�}td|�}|||f}|\}}	}
td|
�}
td	|�}td
|	�}	||	|
f}||||fS)a] Version interface for Jython.

        Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being
        a tuple (vm_name, vm_release, vm_vendor) and osinfo being a
        tuple (os_name, os_version, os_arch).

        Values which cannot be determined are set to the defaults
        given as parameters (which all default to '').

    rNzjava.vendorzjava.versionzjava.vm.namezjava.vm.vendorzjava.vm.versionzjava.os.archzjava.os.namezjava.os.version)r�rrr�)r_�vendor�vminfo�osinfo�javaZvm_nameZ
vm_releaseZ	vm_vendor�os_name�
os_version�os_archrrr�java_ver�s"












r�cCs�|dkr�|dkr|||fS|�d�}|rlzt|d�}Wntk
rLYn X|d}t|�|d<d�|�}|dkrzd}q�d}n,|dkr�d	}|r�|d
}q�d}n|dkr�d
}|||fS)z� Returns (system, release, version) aliased to common
        marketing names used for some systems.

        It also does some reordering of the information in some cases
        where it would otherwise cause confusion.

    ZSunOS�5rDrrE�6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rOrP�Windows)rrrrIrJ)r^r_rrLr�rrr�system_alias�s.	



r�cGs�d�dd�tt|�D��}|�dd�}|�dd�}|�dd�}|�dd�}|�d	d�}|�d
d�}|�dd�}|�dd�}|�d
d�}|�dd�}||kr�q�|}q�|ddkr�|dd�}q�|S)zq Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
    �-css|]}|��VqdS)N)r[)r&�xrrr�	<genexpr>(sz_platform.<locals>.<genexpr>� �_�/�\�:�;�"�(�)�unknownrz--rUN)rJ�filterr,�replace)�argsrVZcleanedrrr�	_platform"s"r�cCsNzddl}Wntk
r$|YSXz
|��WStk
rH|YSXdS)z8 Helper to determine the node name of this machine.
    rN)�socketrrZgethostnamer/)r�r�rrr�_nodeBs

r�cCsBtj�|�}tj�|�r>tj�tj�tj�|�t�|���}q|S)zT In case filepath is a symlink, follow it until a
        real file is reached.
    )r*r3�abspath�islink�normpathrJ�dirname�readlink)�filepathrrr�_follow_symlinksQs�r�c	Cs\tjdkr|Sddl}z|jd|f|jdd�}Wnt|jfk
rN|YSX|��pZ|S)z. Interface to the system's uname command.
    �rQrOrPrNr�T)rRrS)r0rVrWrXrYr/rZr[)Zoptionr�rW�outputrrr�
_syscmd_uname\s

�

r�c	Csztjdkr|Sddl}t|�}ttjdd�}z|jdd|g|j|d�}Wnt	|j
fk
rf|YSX|sp|S|�d	�S)
z� Interface to the system's file command.

        The function uses the -b option of the file command to have it
        omit the filename in its output. Follow the symlinks. It returns
        default in case the command should fail.

    r�rN�C)�LC_ALL�filez-b)rR�envzlatin-1)r0rVrWr��dictr*�environrXrYr/rZr%)�targetr�rWr�r�rrr�_syscmd_filems	
�

r�)r�	WindowsPE)rr�)r�MSDOScCs|s&ddl}|�d�}t|d�d}|r6t|d�}nd}|sx|tjkrxtjtkrpttj\}}|rh|}|rp|}||fSd|kr�d|kr�||fSd	|kr�d
}nd|kr�d}nd
|kr�d}d|kr�d}n8d|kr�d|kr�d}q�d}nd|kr�d}nd|kr�d}n||fS)a� Queries the given executable (defaults to the Python interpreter
        binary) for various architecture information.

        Returns a tuple (bits, linkage) which contains information about
        the bit architecture and the linkage format used for the
        executable. Both values are returned as strings.

        Values that cannot be determined are returned as given by the
        parameter presets. If bits is given as '', the sizeof(pointer)
        (or sizeof(long) on Python version < 1.5.2) is used as
        indicator for the supported pointer size.

        The function relies on the system's "file" command to do the
        actual work. This is available on most if not all Unix
        platforms. On some non-Unix platforms where the "file" command
        does not exist and the executable is set to the Python interpreter
        binary defaults from _default_architecture are used.

    rN�P��bitrr1z
shared objectz32-bit�32bitZN32Zn32bitz64-bitr�ZELFZPEr�r�ZCOFFzMS-DOSr�)�structZcalcsizerIr�r0r1rV�_default_architecture)r1�bits�linkager��sizeZfileoutr	rLrrr�architecture�sH
�
r��uname_resultz-system node release version machine processorcCs�d}tdk	rtSd}zt��\}}}}}Wntk
rBd}YnX|sbttd|||||f���s�|r~tj}d}d}t�}d}d}|dkr�t	�\}}}}	|r�|r�d}|s�dtj
kr�tj
�dd�}ntj
�dd�}|s�tj
�d|�}|�r:t|�\}}}|d	k�rd
}n4|dk�r:|d
k�r:d
}d|dd
�k�r6d}nd}|dk�rd|�s^|dk�rZd}nd}d
}n8|dd�dk�r�t
�\}}
}}d}d�|�}|�s�|
}|dk�r|�r�|dk�r�|}d}zddl}
Wntk
�r�Yn&X|
�dd�\}}|dk�rd}nd}|�stdd�}|dk�r$d}|dk�r2d}|dk�r@d}|dk�rNd}|dk�r\d}|dk�rjd}|dk�r�|d
k�r�d
}d}t||||||�atS)an Fairly portable uname interface. Returns a tuple
        of strings (system, node, release, version, machine, processor)
        identifying the underlying platform.

        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.

        Entries which cannot be determined are set to ''.

    rNrrrOZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr�Z	Microsoftz6.0rErcr�r�Z16bit�r��Javaz, ZOpenVMS�0zSYI$_CPU�ZAlphaZVAXz-pr�)�_uname_cacher*r�r.rGr�r0rVr�r�r�rrbr�rJ�vms_librrZgetsyir�r�)Zno_os_uname�	processorr^�noder_rr�Zuse_syscmd_verrr�r�r�r�r�ZcsidZ
cpu_numberrrrr��s�
















�r�cCst�jS)z� Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.

        An empty string is returned if the value cannot be determined.

    )r�r^rrrrr^usr^cCst�jS)z� Returns the computer's network name (which may not be fully
        qualified)

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr�~sr�cCst�jS)z� Returns the system's release, e.g. '2.2.0' or 'NT'

        An empty string is returned if the value cannot be determined.

    )r�r_rrrrr_�sr_cCst�jS)z� Returns the system's release version, e.g. '#3 on degas'

        An empty string is returned if the value cannot be determined.

    )r�rrrrrr�srcCst�jS)zt Returns the machine type, e.g. 'i386'

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr��sr�cCst�jS)a Returns the (true) processor name, e.g. 'amdk6'

        An empty string is returned if the value cannot be
        determined. Note that many platforms do not provide this
        information or simply return the same value as for machine(),
        e.g.  NetBSD does this.

    )r�r�rrrrr��s
r�zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCs|dkrtj}t�|d�}|dk	r&|Sd|kr�d}|�d�rHt�|�}n
t�|�}|dkrjtdt	|���|�
�\}}}d}d}n�tj�d�r�d}t�|�}|dkr�tdt	|���|�
�\}}}}	}
|dkr�d}tj}n�d|k�r"d}t
�|�}|dk�rtd	t	|���|�
�\}}}}	d}n\t�|�}|dk�rFtd
t	|���|�
�\}}}}	}d}|dk�rld}n|	�r~|d|	}ttd
��r�tj\}
}}n"ttd��r�tj\}
}}nd}d}|�d�}
t|
�dk�r�|
�d�d�|
�}|||||||f}|t|<|S)a� Returns a parsed version of Python's sys.version as tuple
        (name, version, branch, revision, buildno, builddate, compiler)
        referring to the Python implementation name, version, branch,
        revision, build number, build date/time as string and the compiler
        identification string.

        Note that unlike the Python sys.version, the returned value
        for the Python version will always include the patchlevel (it
        defaults to '.0').

        The function returns empty strings for tuple entries that
        cannot be determined.

        sys_version may be given to parse an alternative version
        string, e.g. if the version was read from a different Python
        interpreter.

    NZ
IronPythonz*failed to parse IronPython sys.version: %srr�ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr��_git�
_mercurialrDr!r�)r0r�_sys_version_cacher�
startswith�_ironpython_sys_version_parserr]� _ironpython26_sys_version_parserr�reprr:rV�_sys_version_parser�_pypy_sys_version_parserr2r�r�rr,rFrJ)�sys_versionrr�r]rZalt_versionZcompilerZbuildnoZ	builddateZ	buildtimer��branchZrevisionrLrrr�_sys_version�s�

��
��


�

���



r�cCs
t�dS)aR Returns a string identifying the Python implementation.

        Currently, the following implementations are identified:
          'CPython' (C implementation of Python),
          'IronPython' (.NET implementation of Python),
          'Jython' (Java implementation of Python),
          'PyPy' (Python implementation of Python).

    r�r�rrrr�python_implementation5sr�cCs
t�dS)z� Returns the Python version as string 'major.minor.patchlevel'

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rr�rrrr�python_versionBsr�cCstt�d�d��S)z� Returns the Python version as tuple (major, minor, patchlevel)
        of strings.

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rrD)r-r�rrrrr�python_version_tupleLs	r�cCs
t�dS)z� Returns a string identifying the Python implementation
        branch.

        For CPython this is the SCM branch from which the
        Python binary was built.

        If not available, an empty string is returned.

    r!r�rrrr�
python_branchWsr�cCs
t�dS)z� Returns a string identifying the Python implementation
        revision.

        For CPython this is the SCM revision from which the
        Python binary was built.

        If not available, an empty string is returned.

    rEr�rrrr�python_revisionesr�cCst�dd�S)zh Returns a tuple (buildno, builddate) stating the Python
        build number and date as strings.

    r�rir�rrrr�python_buildrsr�cCs
t�dS)zS Returns a string identifying the compiler used for compiling
        Python.

    rir�rrrr�python_compilerzsr�cCsbt�||fd�}|dk	r|St�\}}}}}}||kr:d}|rPt|||�\}}}|dkrnt�d}	|	rnd}|	}|dkr�t|�\}
}}}
|r�t||�}nt||||�}n�|dkr�ttj	�\}}t||||d||�}n~|d	k�r t
�\}}}\}}}|s�|�s
t|||�}nt|||d
|||�}n2|�r2t||�}n ttj	�\}}t||||||�}|t||f<|S)a� Returns a single string identifying the underlying platform
        with as much useful information as possible (but no more :).

        The output is intended to be human readable rather than
        machine parseable. It may look different on different
        platforms and this is intended.

        If "aliased" is true, the function will use aliases for
        various platforms that report system names which differ from
        their common names, e.g. SunOS will be reported as
        Solaris. The system_alias() function is used to implement
        this.

        Setting terse to true causes the function to return only the
        absolute minimum information needed to identify the platform.

    NrZDarwinrZmacOSr�)ZLinux�withr�Zon)�_platform_cacherr�r�r�r�r�rCr0r1r�r�)�aliased�terserr^r�r_rr�r�Z
macos_releaseZrelZversrr�rVZlibcnameZlibcversion�rrr�r�r�r�r�r�rrrrV�sX

�

��rV�__main__r�z--terseZ
nonaliasedz--nonaliased)Nrrr)r)rrrrN)rrrr)rr�r)rrr�r�)r)r)r)N)rr)B�__doc__Z
__copyright__�__version__�collectionsr*�rer0r�compilerr�ASCIIr6rCrMr\rbr|r~rornr�r�r�r�r�r�r�r�r�r�r�r�r1r��
namedtupler�r�r�r^r�r_rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rV�__name__�argvr�r��print�exitrrrr�<module>s�Y
�
�
G


�
1��

3

#4 


$�P�	
			����
h




L
numbers.cpython-38.opt-2.pyc000064400000020225151450073350011613 0ustar00U

e5d(�@s�ddlmZmZdddddgZGdd�ded�ZGd	d�de�Ze�e�Gd
d�de�Ze�e	�Gdd�de�Z
Gdd�de
�Ze�e�d
S)�)�ABCMeta�abstractmethod�Number�Complex�Real�Rational�Integralc@seZdZdZdZdS)r�N)�__name__�
__module__�__qualname__�	__slots__�__hash__r	r	r	�/usr/lib64/python3.8/numbers.pyrs)�	metaclassc@s�eZdZdZedd��Zdd�Zeedd���Zeedd	���Z	ed
d��Z
edd
��Zedd��Zedd��Z
dd�Zdd�Zedd��Zedd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd(S))rr	cCsdS�Nr	��selfr	r	r�__complex__-szComplex.__complex__cCs|dkS�Nrr	rr	r	r�__bool__1szComplex.__bool__cCst�dSr��NotImplementedErrorrr	r	r�real5szComplex.realcCst�dSrrrr	r	r�imag>szComplex.imagcCst�dSrr�r�otherr	r	r�__add__GszComplex.__add__cCst�dSrrrr	r	r�__radd__LszComplex.__radd__cCst�dSrrrr	r	r�__neg__QszComplex.__neg__cCst�dSrrrr	r	r�__pos__VszComplex.__pos__cCs
||Srr	rr	r	r�__sub__[szComplex.__sub__cCs
||Srr	rr	r	r�__rsub___szComplex.__rsub__cCst�dSrrrr	r	r�__mul__cszComplex.__mul__cCst�dSrrrr	r	r�__rmul__hszComplex.__rmul__cCst�dSrrrr	r	r�__truediv__mszComplex.__truediv__cCst�dSrrrr	r	r�__rtruediv__rszComplex.__rtruediv__cCst�dSrr)r�exponentr	r	r�__pow__wszComplex.__pow__cCst�dSrr)r�baser	r	r�__rpow__|szComplex.__rpow__cCst�dSrrrr	r	r�__abs__�szComplex.__abs__cCst�dSrrrr	r	r�	conjugate�szComplex.conjugatecCst�dSrrrr	r	r�__eq__�szComplex.__eq__N)r
rrr
rrr�propertyrrrrrr r!r"r#r$r%r&r(r*r+r,r-r	r	r	rr sL












c@s�eZdZdZedd��Zedd��Zedd��Zedd	��Zed%dd��Z	d
d�Z
dd�Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zdd�Zedd ��Zed!d"��Zd#d$�Zd
S)&rr	cCst�dSrrrr	r	r�	__float__�szReal.__float__cCst�dSrrrr	r	r�	__trunc__�szReal.__trunc__cCst�dSrrrr	r	r�	__floor__�szReal.__floor__cCst�dSrrrr	r	r�__ceil__�sz
Real.__ceil__NcCst�dSrr)rZndigitsr	r	r�	__round__�szReal.__round__cCs||||fSrr	rr	r	r�
__divmod__�szReal.__divmod__cCs||||fSrr	rr	r	r�__rdivmod__�szReal.__rdivmod__cCst�dSrrrr	r	r�__floordiv__�szReal.__floordiv__cCst�dSrrrr	r	r�
__rfloordiv__�szReal.__rfloordiv__cCst�dSrrrr	r	r�__mod__�szReal.__mod__cCst�dSrrrr	r	r�__rmod__�sz
Real.__rmod__cCst�dSrrrr	r	r�__lt__�szReal.__lt__cCst�dSrrrr	r	r�__le__�szReal.__le__cCstt|��Sr)�complex�floatrr	r	rr�szReal.__complex__cCs|
Srr	rr	r	rr�sz	Real.realcCsdSrr	rr	r	rr�sz	Real.imagcCs|
Srr	rr	r	rr,szReal.conjugate)N)r
rrr
rr/r0r1r2r3r4r5r6r7r8r9r:r;rr.rrr,r	r	r	rr�s>	











c@s8eZdZdZeedd���Zeedd���Zdd�ZdS)	rr	cCst�dSrrrr	r	r�	numeratorszRational.numeratorcCst�dSrrrr	r	r�denominatorszRational.denominatorcCs|j|jSr)r>r?rr	r	rr/szRational.__float__N)	r
rrr
r.rr>r?r/r	r	r	rrsc@s�eZdZdZedd��Zdd�Zed%dd��Zed	d
��Zedd��Z	ed
d��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd �Zed!d"��Zed#d$��ZdS)&rr	cCst�dSrrrr	r	r�__int__+szIntegral.__int__cCst|�Sr)�intrr	r	r�	__index__0szIntegral.__index__NcCst�dSrr)rr'�modulusr	r	rr(4s	zIntegral.__pow__cCst�dSrrrr	r	r�
__lshift__?szIntegral.__lshift__cCst�dSrrrr	r	r�__rlshift__DszIntegral.__rlshift__cCst�dSrrrr	r	r�
__rshift__IszIntegral.__rshift__cCst�dSrrrr	r	r�__rrshift__NszIntegral.__rrshift__cCst�dSrrrr	r	r�__and__SszIntegral.__and__cCst�dSrrrr	r	r�__rand__XszIntegral.__rand__cCst�dSrrrr	r	r�__xor__]szIntegral.__xor__cCst�dSrrrr	r	r�__rxor__bszIntegral.__rxor__cCst�dSrrrr	r	r�__or__gszIntegral.__or__cCst�dSrrrr	r	r�__ror__lszIntegral.__ror__cCst�dSrrrr	r	r�
__invert__qszIntegral.__invert__cCstt|��Sr)r=rArr	r	rr/wszIntegral.__float__cCs|
Srr	rr	r	rr>{szIntegral.numeratorcCsdS)N�r	rr	r	rr?�szIntegral.denominator)N)r
rrr
rr@rBr(rDrErFrGrHrIrJrKrLrMrNr/r.r>r?r	r	r	rr&sB













N)
�abcrr�__all__rr�registerr<rr=rrrAr	r	r	r�<module>sp
u
_string.cpython-38.pyc000064400000016206151450073350010512 0ustar00U

e5d')�@s�dZddddddddd	d
ddgZd
dlZdZdZdZeeZdZeddZdZ	dZ
eee
eZddd�Zd
dl
Zd
dlmZiZGdd�de�ZGdd�ded�ZGdd�d�ZdS)anA collection of string constants.

Public module variables:

whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable

�
ascii_letters�ascii_lowercase�ascii_uppercase�capwords�digits�	hexdigits�	octdigits�	printable�punctuation�
whitespace�	Formatter�Template�Nz 	

ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZ�
0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pd�dd�|�|�D��S)a�capwords(s [,sep]) -> string

    Split the argument into words using split, capitalize each
    word using capitalize, and join the capitalized words using
    join.  If the optional second argument sep is absent or None,
    runs of whitespace characters are replaced by a single space
    and leading and trailing whitespace are removed, otherwise
    sep is used to split and join the words.

    � css|]}|��VqdS�N)�
capitalize)�.0�x�r�/usr/lib64/python3.8/string.py�	<genexpr>0szcapwords.<locals>.<genexpr>)�join�split)�s�seprrrr%s)�ChainMapcs eZdZdZ�fdd�Z�ZS)�_TemplateMetaclassa/
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(bid)s)}  |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    csbtt|��|||�d|kr$|j}n$tjt�|j�|j|jp@|jd�}t�	||j
tjB�|_dS)N�pattern)Zdelim�idZbid)�superr�__init__r�_re�escape�	delimiter�	idpattern�braceidpattern�compile�flags�VERBOSE)�cls�name�basesZdctr��	__class__rrr Cs

�z_TemplateMetaclass.__init__)�__name__�
__module__�__qualname__rr �
__classcell__rrr,rr9s	rc@sJeZdZdZdZdZdZejZ	dd�Z
dd�Zefd	d
�Z
efdd�ZdS)
rz.A string class for supporting $-substitutions.�$z(?a:[_a-z][_a-z0-9]*)NcCs
||_dSr)�template)�selfr3rrrr \szTemplate.__init__cCsd|�d�}|jd|�jdd�}|s.d}d}n"|td�|dd���}t|�}td||f��dS)N�invalidT)�keepends�����z.Invalid placeholder in string: line %d, col %d)�startr3�
splitlines�lenr�
ValueError)r4�mo�i�lines�colno�linenorrr�_invalidas
�zTemplate._invalidcs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncsd|�d�p|�d�}|dk	r(t�|�S|�d�dk	r<�jS|�d�dk	rT��|�td�j��dS�N�namedZbracedZescapedr5z#Unrecognized named group in pattern)�group�strr#rCr=r�r>rE��mappingr4rr�convertss
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr�subr3�r4rJZkwsrKrrIr�
substitutems
zTemplate.substitutecs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|dk	rHzt�|�WStk
rF|��YSX|�d�dk	r\�jS|�d�dk	rr|��Std�j��dSrD)rFrG�KeyErrorr#r=rrHrIrrrK�s�z)Template.safe_substitute.<locals>.convertrLrPrrIr�safe_substitute�s

zTemplate.safe_substitute)r.r/r0�__doc__r#r$r%r!�
IGNORECASEr'r rCrMrQrSrrrrrPs)�	metaclassc@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r4�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r4rXrYrZ�	used_args�result�_rrrrW�szFormatter.vformatr
c	Cs�|dkrtd��g}|�|�D]�\}}	}
}|r8|�|�|	dk	r|	dkrj|dkrXtd��t|�}	|d7}n|	��r�|r~td��d}|�|	||�\}}
|�|
�|�||�}|j|
||||d|d�\}
}|�|�	||
��qd�
|�|fS)Nr
zMax string recursion exceededr8FzJcannot switch from manual field specification to automatic field numberingr7)�auto_arg_index)r=�parse�appendrG�isdigit�	get_field�add�
convert_fieldr^�format_fieldr)r4rXrYrZr`Zrecursion_depthrcraZliteral_text�
field_name�format_spec�
conversion�objZarg_usedrrrr^�s<�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r4�keyrYrZrrr�	get_value�s
zFormatter.get_valuecCsdSrr)r4r`rYrZrrrr_�szFormatter.check_unused_argscCs
t||�Sr)r[)r4�valuerlrrrrj�szFormatter.format_fieldcCsN|dkr|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rG�repr�asciir=r[)r4rsrmrrrri�szFormatter.convert_fieldcCs
t�|�Sr)�_stringZformatter_parser)r4rXrrrrdszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)rxZformatter_field_name_splitrr�getattr)	r4rkrYrZ�first�restrnZis_attrr?rrrrg
s
zFormatter.get_fieldN)r
)r.r/r0r[rWr^rrr_rjrirdrgrrrrr�s�
6	)N)rT�__all__rxr
rrrrrrr	rr�rer!�collectionsrrNrM�typerrrrrrr�<module>s6�
Qoptparse.cpython-38.opt-1.pyc000064400000135550151450073350012004 0ustar00U

e5d���@s�dZdZdddddddd	d
ddd
dddddgZdZddlZddlZddlZdd�ZzddlmZm	Z	Wn$e
k
r�dd�Zdd�Z	YnXeZGdd
�d
e�Z
Gdd�de
�ZGdd�de�ZGd d�de
�ZGd!d�de
�ZGd"d#�d#e�ZGd$d
�d
�ZGd%d�de�ZGd&d�de�Zd'd(�Zd)d*�Zeed+�feed+�feed,�feed-�fd.�Zd/d0�Zd1d�Zd2ZGd3d�d�Zd4Zd5Z Gd6d�d�Z!Gd7d�d�Z"Gd8d�de"�Z#Gd9d	�d	e"�Z$d:d;�Z%eZ&dS)<a�A powerful, extensible, and easy-to-use option parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).

Simple usage example:

   from optparse import OptionParser

   parser = OptionParser()
   parser.add_option("-f", "--file", dest="filename",
                     help="write report to FILE", metavar="FILE")
   parser.add_option("-q", "--quiet",
                     action="store_false", dest="verbose", default=True,
                     help="don't print status messages to stdout")

   (options, args) = parser.parse_args()
z1.5.3�Option�make_option�
SUPPRESS_HELP�SUPPRESS_USAGE�Values�OptionContainer�OptionGroup�OptionParser�
HelpFormatter�IndentedHelpFormatter�TitledHelpFormatter�
OptParseError�OptionError�OptionConflictError�OptionValueError�BadOptionError�check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
�NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��self�r� /usr/lib64/python3.8/optparse.py�_reprOsr)�gettext�ngettextcCs|S�Nr)�messagerrrr\srcCs|dkr|S|S�N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)rcCs
||_dSr��msg�rr#rrr�__init__hszOptParseError.__init__cCs|jSrr"rrrr�__str__kszOptParseError.__str__N)r�
__module__�__qualname__r%r&rrrrrgsc@s eZdZdZdd�Zdd�ZdS)r
z]
    Raised if an Option instance is created with invalid or
    inconsistent arguments.
    cCs||_t|�|_dSr)r#�str�	option_id)rr#�optionrrrr%uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz
option %s: %s)r*r#rrrrr&yszOptionError.__str__N�rr'r(�__doc__r%r&rrrrr
osc@seZdZdZdS)rzE
    Raised if conflicting options are added to an OptionParser.
    N�rr'r(r-rrrrrsc@seZdZdZdS)rzS
    Raised if an invalid option value is encountered on the command
    line.
    Nr.rrrrr�sc@s eZdZdZdd�Zdd�ZdS)rzB
    Raised if an invalid option is seen on the command line.
    cCs
||_dSr)�opt_str�rr/rrrr%�szBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r/rrrrr&�szBadOptionError.__str__Nr,rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�AmbiguousOptionErrorzD
    Raised if an ambiguous option is seen on the command line.
    cCst�||�||_dSr)rr%�
possibilities)rr/r3rrrr%�szAmbiguousOptionError.__init__cCstd�|jd�|j�fS)Nzambiguous option: %s (%s?)�, )r1r/�joinr3rrrrr&�s�zAmbiguousOptionError.__str__Nr,rrrrr2�sr2c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"r	a�
    Abstract base class for formatting option help.  OptionParser
    instances should use one of the HelpFormatter subclasses for
    formatting help; by default IndentedHelpFormatter is used.

    Instance attributes:
      parser : OptionParser
        the controlling OptionParser instance
      indent_increment : int
        the number of columns to indent per nesting level
      max_help_position : int
        the maximum starting column for option help text
      help_position : int
        the calculated starting column for option help text;
        initially the same as the maximum
      width : int
        total number of columns for output (pass None to constructor for
        this value to be taken from the $COLUMNS environment variable)
      level : int
        current indentation level
      current_indent : int
        current indentation level (in columns)
      help_width : int
        number of columns available for option help text (calculated)
      default_tag : str
        text to replace with each option's default value, "%default"
        by default.  Set to false value to disable default value expansion.
      option_strings : { Option : str }
        maps Option instances to the snippet of help text explaining
        the syntax of that option, e.g. "-h, --help" or
        "-fFILE, --file=FILE"
      _short_opt_fmt : str
        format string controlling how short options with values are
        printed in help text.  Must be either "%s%s" ("-fFILE") or
        "%s %s" ("-f FILE"), because those are the two syntaxes that
        Optik supports.
      _long_opt_fmt : str
        similar but for long options; must be either "%s %s" ("--file FILE")
        or "%s=%s" ("--file=FILE").
    Znonec	Cs�d|_||_|dkrLzttjd�}Wnttfk
rBd}YnX|d8}||_t|t	|d|d��|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	NZCOLUMNS�P��rz%defaultz%s %sz%s=%s)�parser�indent_increment�int�os�environ�KeyError�
ValueError�width�min�max�
help_position�max_help_position�current_indent�level�
help_width�short_first�default_tag�option_strings�_short_opt_fmt�
_long_opt_fmt�rr:rDr@rHrrrr%�s&
�
zHelpFormatter.__init__cCs
||_dSr)r9�rr9rrr�
set_parser�szHelpFormatter.set_parsercCs&|dkrtd|��d|d|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)r?rK�rZdelimrrr�set_short_opt_delimiter�s
�z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|��d|d|_dS)N)�=rQz.invalid metavar delimiter for long options: %rrR)r?rLrSrrr�set_long_opt_delimiter�s
�z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSr�rEr:rFrrrr�indent�szHelpFormatter.indentcCs"|j|j8_|jd8_dSrrWrrrr�dedent�szHelpFormatter.dedentcCstd��dS�Nzsubclasses must implement��NotImplementedError�r�usagerrr�format_usage�szHelpFormatter.format_usagecCstd��dSrZr[�rZheadingrrr�format_headingszHelpFormatter.format_headingcCs.t|j|jd�}d|j}tj||||d�S)z�
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        �rQ)Zinitial_indentZsubsequent_indent)rBr@rE�textwrapZfill)r�textZ
text_widthrXrrr�_format_texts
�zHelpFormatter._format_textcCs|r|�|�dSdSdS�N�
rP�re�r�descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|�|�dSdSdSrfrh)r�epilogrrr�
format_epilogszHelpFormatter.format_epilogcCsP|jdks|js|jS|jj�|j�}|tks6|dkr<|j}|j�|jt	|��Sr)
r9rI�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer))rr+Z
default_valuerrr�expand_defaultszHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|krBd�jd|f}�j}nd�jd||f}d}|�|�|jr���|�}t�|�j	�}|�d|d|df�|�
�fdd�|dd�D��n|d	d
kr�|�d
�d�|�S)Nr7�%*s%s
rPz	%*s%-*s  rcsg|]}d�jd|f�qS)rvrP)rC)�.0�linerrr�
<listcomp>Es�z/HelpFormatter.format_option.<locals>.<listcomp>r ���rg)rJrCrE�len�appendrnrurcZwraprG�extendr5)rr+�result�optsZ	opt_widthZindent_firstZ	help_textZ
help_linesrrr�
format_option(s&



�

zHelpFormatter.format_optioncCs�|��d}|jD],}|�|�}||j|<t|t|�|j�}q|��|jD]8}|jD],}|�|�}||j|<t|t|�|j�}qXqN|��|��t	|d|j
�|_t|j|jd�|_
dS)Nrr7rb)rX�option_list�format_option_stringsrJrBr{rE�
option_groupsrYrArDrCr@rG)rr9Zmax_len�optZstrings�grouprrr�store_option_stringsKs 






z"HelpFormatter.store_option_stringscst|��rF|jp|j�����fdd�|jD�}��fdd�|jD�}n|j}|j}�jrb||}n||}d�|�S)z@Return a comma-separated list of option strings & metavariables.csg|]}�j|�f�qSr)rK)rwZsopt��metavarrrrryas�z7HelpFormatter.format_option_strings.<locals>.<listcomp>csg|]}�j|�f�qSr)rL)rwZloptr�rrrycs�r4)�takes_valuer�rq�upper�_short_opts�
_long_optsrHr5)rr+Z
short_optsZ	long_optsrrr�rr�]s��
z#HelpFormatter.format_option_stringsN)rr'r(r-rsr%rOrTrVrXrYr_rarerkrmrur�r�r�rrrrr	�s")
#c@s*eZdZdZddd�Zdd	�Zd
d�ZdS)
r
z.Format help with indented section bodies.
    r7�Nr cCst�|||||�dSr�r	r%rMrrrr%ts�zIndentedHelpFormatter.__init__cCstd�|S)Nz
Usage: %s
)r1r]rrrr_|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s:
rP)rEr`rrrrasz$IndentedHelpFormatter.format_heading)r7r�Nr �rr'r(r-r%r_rarrrrr
ps�
c@s*eZdZdZddd�Zdd�Zd	d
�ZdS)rz1Format help with underlined section headers.
    rr�NcCst�|||||�dSrr�rMrrrr%�s�zTitledHelpFormatter.__init__cCsd|�td��|fS)Nz%s  %s
ZUsage)rar1r]rrrr_�sz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s
%s
z=-)rFr{r`rrrra�sz"TitledHelpFormatter.format_heading)rr�Nrr�rrrrr�s�
cCsh|dd���dkrd}nD|dd���dkrDd}|dd�p@d}n|dd�dkrZd}nd}|||�S)	Nr7Z0x�Z0b�0r ��
)�lower)�val�type�radixrrr�
_parse_num�sr�cCs
t|t�Sr)r�r;)r�rrr�
_parse_int�sr�Zintegerzfloating-point�complex)r;�long�floatr�cCsHt|j\}}z
||�WStk
rBttd�|||f��YnXdS)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�r?rr1)r+r��valueZcvtZwhatrrr�
check_builtin�s
�r�cCs:||jkr|Sd�tt|j��}ttd�|||f��dS)Nr4z.option %s: invalid choice: %r (choose from %s))�choicesr5�map�reprrr1)r+r�r�r�rrrr�s
��)ZNOZDEFAULTc@s�eZdZdZdddddddd	d
ddd
gZdZdZdZdZdZ	dZ
eeeeed�Z
dZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZeeeeeeegZd,d-�ZeZd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"dS):rar
    Instance attributes:
      _short_opts : [string]
      _long_opts : [string]

      action : string
      type : string
      dest : string
      default : any
      nargs : int
      const : any
      choices : [string]
      callback : function
      callback_args : (any*)
      callback_kwargs : { string : any }
      help : string
      metavar : string
    �actionr�rq�default�nargs�constr��callback�
callback_args�callback_kwargsrnr�)
�store�store_const�
store_true�store_falser|�append_const�countr�rn�version)r�r�r�r�r|r�r�)r�r|r�)r�r|)r�r�)�stringr;r�r�r��choice)r;r�r�r�r�NcOsBg|_g|_|�|�}|�|�|�|�|jD]}||�q0dSr)r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr�attrs�checkerrrrr%4s



zOption.__init__cCsdd�|D�}|std��|S)NcSsg|]}|r|�qSrr)rwr�rrrryKsz-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)�	TypeError)rrrrrr�GszOption._check_opt_stringscCs�|D]�}t|�dkr$td||��qt|�dkrd|ddkrH|ddksVtd||��|j�|�q|dd�dkr�|ddks�td||��|j�|�qdS)	Nr7z>invalid option string %r: must be at least two characters longr�-r zMinvalid short option string %r: must be of the form -x, (x any non-dash char)�--zGinvalid long option string %r: must start with --, followed by non-dash)r{r
r�r|r�)rrr�rrrr�Ps2������zOption._set_opt_stringscCsv|jD]F}||kr*t||||�||=q|dkr@t||t�qt||d�q|rrt|���}tdd�|�|��dS)Nr�zinvalid keyword arguments: %sr4)�ATTRS�setattrrr�sorted�keysr
r5)rr��attrrrrr�es
�zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr
rrrr�
_check_actionxs
zOption._check_actioncCs�|jdkr0|j|jkr�|jdk	r(d|_q�d|_n^t|jt�rF|jj|_|jdkrVd|_|j|jkrrtd|j|��|j|jkr�td|j|��dS)Nr�r�r)zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr
�
TYPED_ACTIONSrrrr�_check_type~s 



�zOption._check_typecCsr|jdkrT|jdkr td|��qnt|jttf�sntdtt|j���d�d|��n|jdk	rntd|j|��dS)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'r z#must not supply choices for type %r)r�r�r
r��tuple�listr)�splitrrrr�
_check_choice�s$

���
�zOption._check_choicecCs\|j|jkp|jdk	}|jdkrX|rX|jrH|jddd��dd�|_n|jdd|_dS)Nrr7r�r1r )r��
STORE_ACTIONSr�rqr�rtr�)rr�rrr�_check_dest�s�zOption._check_destcCs*|j|jkr&|jdk	r&td|j|��dS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�r
rrrr�_check_const�s
�zOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk	r8td|j|��dS)Nr z*'nargs' must not be supplied for action %r)r�r�r�r
rrrr�_check_nargs�s

�zOption._check_nargscCs�|jdkrrt|j�s$td|j|��|jdk	rJt|jt�sJtd|j|��|jdk	r�t|jt�s�td|j|��nB|jdk	r�td|j|��|jdk	r�td|��|jdk	r�td|��dS)Nr�zcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option)	r��callabler�r
r�r�r�r��dictrrrr�_check_callback�sR

�

���

���
��
�
�zOption._check_callbackcCsd�|j|j�S)N�/)r5r�r�rrrrr&�szOption.__str__cCs
|jdk	Sr)r�rrrrr��szOption.takes_valuecCs|jr|jdS|jdSdS�Nr)r�r�rrrr�get_opt_string�s
zOption.get_opt_stringcCs*|j�|j�}|dkr|S||||�SdSr)�TYPE_CHECKERrpr�)rr�r�r�rrr�check_value�szOption.check_valuecs:|dk	r6�jdkr���|�St��fdd�|D��SdS)Nr csg|]}���|��qSr)r�)rw�v�r�rrrrysz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rr�r�rr�r�
convert_values
zOption.convert_valuecCs$|�||�}|�|j|j||||�Sr)r��take_actionr�rq)rr�r��valuesr9rrr�processs�zOption.processc	Cs:|dkrt|||��n|dkr2t|||j��n|dkrHt||d�n�|dkr^t||d�n�|dkrz|�|g��|�n�|dkr�|�|g��|j�n�|d	kr�t|||�|d
�d�n||dkr�|jp�d
}|jp�i}|j||||f|�|�nF|dk�r|��|��n*|dk�r(|�	�|��nt
d|j��dS)Nr�r�r�Tr�Fr|r�r�rr r�rrnr�zunknown action %r)r�r��ensure_valuer|r�r�r��
print_help�exit�
print_versionr?r�)	rr�rqr�r�r�r9�args�kwargsrrrr�s4





zOption.take_action)#rr'r(r-r�r�r�r�r�r�r�r�rr�r�r%r�r�r�r�r�r�r�r�r�r�r&r�__repr__r�r�r�r�r�r�rrrrr�sl�
�	
	�	ZSUPPRESSHELPZ
SUPPRESSUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
dS)rNcCs&|r"|��D]\}}t|||�qdSr)�itemsr�)rror�r�rrrr%9szValues.__init__cCs
t|j�Sr)r)�__dict__rrrrr&>szValues.__str__cCs2t|t�r|j|jkSt|t�r*|j|kStSdSr)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs



z
Values.__eq__cCs6t|�D](}||kr||}|dk	rt|||�qdS)z�
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        N)�dirr�)rr�r�Zdvalrrr�_update_carefulKs
zValues._update_carefulcCs|j�|�dS)z�
        Update the option values from an arbitrary dictionary,
        using all keys from the dictionary regardless of whether
        they have a corresponding attribute in self or not.
        N)r��update)rr�rrr�
_update_looseXszValues._update_loosecCs8|dkr|�|�n |dkr(|�|�ntd|��dS)N�carefulZloosezinvalid update mode: %r)r�r�r?)rr��moderrr�_update`s
zValues._updater�cCs&t|�tj|}|�t|�|�dSr)�
__import__�sys�modulesr��vars)r�modnamer��modrrr�read_modulehs
zValues.read_modulecCs&i}tt|���|�|�||�dSr)�exec�open�readr�)r�filenamer�r�rrr�	read_filemszValues.read_filecCs.t||�rt||�dkr$t|||�t||�Sr)�hasattr�getattrr�)rr�r�rrrr�rszValues.ensure_value)N)r�)r�)rr'r(r%r&rr�r�r�r�r�r�r�r�rrrrr7s



c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)#ra�
    Abstract base class.

    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      option_list : [Option]
        the list of Option objects contained by this OptionContainer
      _short_opt : { string : Option }
        dictionary mapping short option strings, eg. "-f" or "-X",
        to the Option instances that implement them.  If an Option
        has multiple short option strings, it will appear in this
        dictionary multiple times. [1]
      _long_opt : { string : Option }
        dictionary mapping long option strings, eg. "--file" or
        "--exclude", to the Option instances that implement them.
        Again, a given Option can occur multiple times in this
        dictionary. [1]
      defaults : { string : any }
        dictionary mapping option destination names to default
        values for each destination [1]

    [1] These mappings are common to (shared by) all components of the
        controlling OptionParser, where they are initially created.

    cCs&|��||_|�|�|�|�dSr)�_create_option_list�option_class�set_conflict_handler�set_description)rr�conflict_handlerrjrrrr%�s
zOptionContainer.__init__cCsi|_i|_i|_dSr��
_short_opt�	_long_optrorrrr�_create_option_mappings�sz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrNrrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dkrtd|��||_dS)N)�error�resolvez$invalid conflict_resolution value %r)r?r)r�handlerrrrr�sz$OptionContainer.set_conflict_handlercCs
||_dSr�rjrirrrr�szOptionContainer.set_descriptioncCs|jSrrrrrr�get_description�szOptionContainer.get_descriptioncCs|`|`|`dS�zsee OptionParser.destroy().Nrrrrr�destroy�szOptionContainer.destroycCs�g}|jD]"}||jkr
|�||j|f�q
|jD]"}||jkr4|�||j|f�q4|r�|j}|dkr�tdd�dd�|D��|��nd|dkr�|D]V\}}|�d�r�|j�	|�|j|=n|j�	|�|j|=|js�|js�|j
j�	|�q�dS)Nrz conflicting option string(s): %sr4cSsg|]}|d�qS)rr)rw�corrrry�sz3OptionContainer._check_conflict.<locals>.<listcomp>rr�)r�rr|r�rrrr5�
startswith�remove�	containerr�)rr+Z
conflict_optsr�r
Zc_optionrrr�_check_conflict�s2



��

zOptionContainer._check_conflictcOs�t|dt�r|j||�}n8t|�dkrL|sL|d}t|t�sTtd|��ntd��|�|�|j�|�||_	|j
D]}||j|<qv|jD]}||j
|<q�|jdk	r�|jtk	r�|j|j|j<n|j|jkr�d|j|j<|S)zOadd_option(Option)
           add_option(opt_str, ..., kwarg=val, ...)
        rr znot an Option instance: %r�invalid argumentsN)r�r)rr{rr�rr�r|rr�rr�rrqr�rrro)rr�r�r+r�rrr�
add_option�s(





zOptionContainer.add_optioncCs|D]}|�|�qdSr)r)rr�r+rrr�add_optionsszOptionContainer.add_optionscCs|j�|�p|j�|�Sr)rrprr0rrr�
get_options
�zOptionContainer.get_optioncCs||jkp||jkSr)rrr0rrr�
has_options
�zOptionContainer.has_optioncCsn|j�|�}|dkr |j�|�}|dkr4td|��|jD]}|j|=q:|jD]}|j|=qN|jj�|�dS)Nzno such option %r)	rrprr?r�r�rr�r)rr/r+r�rrr�
remove_options



zOptionContainer.remove_optioncCs>|js
dSg}|jD]}|jtk	r|�|�|��qd�|�S�NrP)r�rnrr|r�r5)r�	formatterr~r+rrr�format_option_helps

z"OptionContainer.format_option_helpcCs|�|���Sr)rkr�rrrrrrk(sz"OptionContainer.format_descriptioncCs:g}|jr|�|�|��|jr0|�|�|��d�|�S)Nrg)rjr|rkr�rr5�rrr~rrr�format_help+szOptionContainer.format_helpN)rr'r(r-r%r	r
rrrrrrrrrrrrkr"rrrrrxs"			c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs$||_t�||j|j|�||_dSr)r9rr%rr�title)rr9r#rjrrrr%6s�zOptionGroup.__init__cCsg|_|�|j�dSr)r�r
r9rrrrr<szOptionGroup._create_option_listcCs
||_dSr)r#)rr#rrr�	set_title@szOptionGroup.set_titlecCst�|�|`dSr)rrr�rrrrrCs
zOptionGroup.destroycCs0|�|j�}|��|t�||�7}|��|Sr)rar#rXrr"rYr!rrrr"Js
zOptionGroup.format_help)N)rr'r(r%rr$rr"rrrrr4s

c
@sbeZdZdZgZddedddddddf
dd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dPdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdQd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z dRd<d=�Z!d>d?�Z"d@dA�Z#dSdBdC�Z$dDdE�Z%dTdFdG�Z&dUdHdI�Z'dJdK�Z(dVdLdM�Z)dWdNdO�Z*dS)Xra$
    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      usage : string
        a usage string for your program.  Before it is displayed
        to the user, "%prog" will be expanded to the name of
        your program (self.prog or os.path.basename(sys.argv[0])).
      prog : string
        the name of the current program (to override
        os.path.basename(sys.argv[0])).
      description : string
        A paragraph of text giving a brief overview of your program.
        optparse reformats this paragraph to fit the current terminal
        width and prints it when the user requests help (after usage,
        but before the list of options).
      epilog : string
        paragraph of help text to print after option help

      option_groups : [OptionGroup]
        list of option groups in this parser (option groups are
        irrelevant for parsing the command-line, but very useful
        for generating help)

      allow_interspersed_args : bool = true
        if true, positional arguments may be interspersed with options.
        Assuming -a and -b each take a single argument, the command-line
          -ablah foo bar -bboo baz
        will be interpreted the same as
          -ablah -bboo -- foo bar baz
        If this flag were false, that command line would be interpreted as
          -ablah -- foo bar -bboo baz
        -- ie. we stop processing options as soon as we see the first
        non-option argument.  (This is the tradition followed by
        Python's getopt module, Perl's Getopt::Std, and other argument-
        parsing libraries, but it is generally annoying to users.)

      process_default_values : bool = true
        if true, option default values are processed similarly to option
        values from the command line: that is, they are passed to the
        type-checking function for the option's type (as long as the
        default value is a string).  (This really only matters if you
        have defined custom types; see SF bug #955889.)  Set it to false
        to restore the behaviour of Optik 1.4.1 and earlier.

      rargs : [string]
        the argument list currently being parsed.  Only set when
        parse_args() is active, and continually trimmed down as
        we consume arguments.  Mainly there for the benefit of
        callback options.
      largs : [string]
        the list of leftover arguments that we have skipped while
        parsing options.  If allow_interspersed_args is false, this
        list is always empty.
      values : Values
        the set of option values currently being accumulated.  Only
        set when parse_args() is active.  Also mainly for callbacks.

    Because of the 'rargs', 'largs', and 'values' attributes,
    OptionParser is not thread-safe.  If, for some perverse reason, you
    need to parse command-line arguments simultaneously in different
    threads, use different OptionParser instances.

    NrTcCsrt�||||�|�|�|	|_||_d|_d|_|dkr@t�}||_|j�	|�|
|_
|j||d�|��dS)NT)�add_help)
rr%�	set_usage�progr��allow_interspersed_args�process_default_valuesr
rrOrl�_populate_option_list�_init_parsing_state)rr^r�rr�rrjrZadd_help_optionr'rlrrrr%�s(�
�zOptionParser.__init__cCs.t�|�|jD]}|��q|`|`|`dS)a
        Declare that you are done with this OptionParser.  This cleans up
        reference cycles so the OptionParser (and all objects referenced by
        it) can be garbage-collected promptly.  After calling destroy(), the
        OptionParser is unusable.
        N)rrr�r�r)rr�rrrr�s


zOptionParser.destroycCsg|_g|_|��dSr)r�r�r	rrrrr�sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helprnzshow this help message and exit�r�rn�rr1rrrr�_add_help_option�s�zOptionParser._add_help_optioncCs|jddtd�d�dS)Nz	--versionr�z&show program's version number and exitr,r-rrrr�_add_version_option�s�z OptionParser._add_version_optioncCs>|jr|�|j�|r |�|�|jr.|��|r:|��dSr)�standard_option_listrr�r/r.)rr�r%rrrr*�s
z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)�rargs�largsr�rrrrr+�sz OptionParser._init_parsing_statecCsL|dkrtd�|_n4|tkr$d|_n$|���d�rB|dd�|_n||_dS)Nz%prog [options]zusage: �)r1r^rr�rr]rrrr&�szOptionParser.set_usagecCs
d|_dS)aSet parsing to not stop on the first non-option, allowing
        interspersing switches with command arguments. This is the
        default behavior. See also disable_interspersed_args() and the
        class documentation description of the attribute
        allow_interspersed_args.TN�r(rrrr�enable_interspersed_args�sz%OptionParser.enable_interspersed_argscCs
d|_dS)z�Set parsing to stop on the first non-option. Use this if
        you have a command processor which runs another command that
        has options of its own and you want to make sure these options
        don't get confused.
        FNr4rrrr�disable_interspersed_argssz&OptionParser.disable_interspersed_argscCs
||_dSr)r))rr�rrr�set_process_default_valuessz'OptionParser.set_process_default_valuescCs||j|<dSr)ro)rrqr�rrr�set_defaultszOptionParser.set_defaultcKs|j�|�dSr)ror�)rr�rrr�set_defaultsszOptionParser.set_defaultscCs*|jdd�}|jD]}|�|j�q|Sr)r�r�r})rZoptionsr�rrr�_get_all_optionss
zOptionParser._get_all_optionscCs`|jst|j�S|j��}|��D]4}|�|j�}t|t�r"|�	�}|�
||�||j<q"t|�Sr)r)rro�copyr:rprqr�r)r�r�)rror+r�r/rrr�get_default_valuess


zOptionParser.get_default_valuescOszt|dt�r t|f|�|�}nJt|�dkrb|sb|d}t|t�sNtd|��|j|k	rjtd��ntd��|j�|�|S)Nrr znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r)	r�r)rr{r�r9r?r�r|)rr�r�r�rrr�add_option_group+s


zOptionParser.add_option_groupcCs0|j�|�p|j�|�}|r,|j|k	r,|jSdSr)rrprr)rr/r+rrr�get_option_group;s
�zOptionParser.get_option_groupcCs&|dkrtjdd�S|dd�SdSr)r��argv)rr�rrr�	_get_argsEszOptionParser._get_argsc
Cs�|�|�}|dkr|��}||_g|_}||_z|�|||�}Wn4ttfk
rv}z|�t	|��W5d}~XYnX||}|�
||�S)aR
        parse_args(args : [string] = sys.argv[1:],
                   values : Values = None)
        -> (values : Values, args : [string])

        Parse the command-line options found in 'args' (default:
        sys.argv[1:]).  Any errors result in a call to 'error()', which
        by default prints the usage message to stderr and calls
        sys.exit() with an error message.  On success returns a pair
        (values, args) where 'values' is a Values instance (with all
        your option values) and 'args' is the list of arguments left
        over after parsing options.
        N)r@r<r1r2r��
_process_argsrrrr)�check_values)rr�r�r1r2�stop�errrrr�
parse_argsKs

 zOptionParser.parse_argscCs||fS)a�
        check_values(values : Values, args : [string])
        -> (values : Values, args : [string])

        Check that the supplied option values and leftover arguments are
        valid.  Returns the option values and leftover arguments
        (possibly adjusted, possibly completely new -- whatever you
        like).  Default implementation just returns the passed-in
        values; subclasses may override as desired.
        r)rr�r�rrrrBrszOptionParser.check_valuescCs�|r�|d}|dkr|d=dS|dd�dkr<|�||�q|dd�dkrft|�dkrf|�||�q|jr~|�|�|d=qdSqdS)a�_process_args(largs : [string],
                         rargs : [string],
                         values : Values)

        Process command-line arguments and populate 'values', consuming
        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
        false, stop at the first non-option argument.  If true, accumulate any
        interspersed non-option arguments in 'largs'.
        rr�Nr7r r�)�_process_long_optr{�_process_short_optsr(r|)rr2r1r��argrrrrAs

zOptionParser._process_argscCst||j�S)a_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbreviation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.
        )�
_match_abbrevr)rr�rrr�_match_long_opt�szOptionParser._match_long_optc
Cs�|�d�}d|kr4|�dd�\}}|�d|�d}n|}d}|�|�}|j|}|��r�|j}t|�|kr�|�t	dd|�||d��q�|dkr�|�d�}	q�t
|d|��}	|d|�=n|r�|�td	�|�nd}	|�||	||�dS)
NrrUr TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r+Znumberz%s option does not take a value)
�popr��insertrJrr�r�r{rrr�r1r�)
rr1r�rHr�Znext_argZhad_explicit_valuer+r�r�rrrrF�s6


��zOptionParser._process_long_optcCs�|�d�}d}d}|dd�D]�}d|}|j�|�}|d7}|sJt|��|��r�|t|�krv|�d||d��d}|j}	t|�|	kr�|�t	dd|	�||	d��q�|	dkr�|�d�}
q�t
|d|	��}
|d|	�=nd}
|�||
||�|rq�qdS)	NrFr r�TrKrLrM)rNrrprr�r{rOr�rrr�r�)rr1r�rHrC�iZchr�r+r�r�rrrrG�s<
��z OptionParser._process_short_optscCs&|jdkrtj�tjd�S|jSdSr�)r'r<�path�basenamer�r?rrrr�
get_prog_names
zOptionParser.get_prog_namecCs|�d|���S)Nz%prog)rtrS)r�srrr�expand_prog_nameszOptionParser.expand_prog_namecCs|�|j�Sr)rUrjrrrrrszOptionParser.get_descriptionrcCs|rtj�|�t�|�dSr)r��stderr�writer�)rZstatusr#rrrr�szOptionParser.exitcCs(|�tj�|�dd|��|f�dS)z�error(msg : string)

        Print a usage message incorporating 'msg' to stderr and exit.
        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        r7z%s: error: %s
N)�print_usager�rVr�rSr$rrrrszOptionParser.errorcCs"|jr|j�|�|j��SdSdSr)r^rr_rUrrrr�	get_usage#s

�zOptionParser.get_usagecCs|jrt|��|d�dS)aaprint_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.
        ��fileN)r^�printrY�rr[rrrrX*s	zOptionParser.print_usagecCs|jr|�|j�SdSdSr)r�rUrrrr�get_version6szOptionParser.get_versioncCs|jrt|��|d�dS)aEprint_version(file : file = stdout)

        Print the version message for this program (self.version) to
        'file' (default stdout).  As with print_usage(), any occurrence
        of "%prog" in self.version is replaced by the current program's
        name.  Does nothing if self.version is empty or undefined.
        rZN)r�r\r^r]rrrr�<szOptionParser.print_versioncCs�|dkr|j}|�|�g}|�|�td���|��|jrZ|�t�||��|�d�|j	D]}|�|�
|��|�d�q`|��d�|dd��S)NZOptionsrgrPrz)
rr�r|rar1rXr�rrr�r"rYr5)rrr~r�rrrrGs


zOptionParser.format_option_helpcCs|�|j�Sr)rmrlr rrrrmXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*|�|��d�|jrD|�|�|�d�|�|�|��|�|�|��d�|�Srf)	rr^r|rYrjrkrrmr5r!rrrr"[szOptionParser.format_helpcCs |dkrtj}|�|���dS)z�print_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).
        N)r��stdoutrWr"r]rrrr�gszOptionParser.print_help)T)NN)rN)N)N)N)N)N)+rr'r(r-r0rr%rrr.r/r*r+r&r5r6r7r8r9r:r<r=r>r@rErBrArJrFrGrSrUrr�rrYrXr^r�rrmr"r�rrrrrRsbD�
"

	

'
3	$)





csZ�|kr�S�fdd�|��D�}t|�dkr6|dS|sDt���n|��t�|��dS)z�_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.
    csg|]}|���r|�qSr)r)rwZword�rTrrry�s
�z!_match_abbrev.<locals>.<listcomp>r rN)r�r{r�sortr2)rTZwordmapr3rr`rrIts
rI)'r-�__version__�__all__Z
__copyright__r�r<rcrrr�ImportErrorr1�	Exceptionrr
rrrr2r	r
rr�r�r�r�r�r�rrrrrrrrrrrIrrrrr�<module>s�� 


P




�uA=&__future__.cpython-38.opt-2.pyc000064400000004214151450073350012246 0ustar00U

e5d�
@s�dddddddddd	g
Zd
geZdZdZd
ZdZdZdZdZdZ	dZ
dZGdd�d�Zedde�Z
edde�Zedde�Zedde�Zedde�Zedde�Zedde�Zed d!e	�Zed"d#e
�Zed$d%e�Zd&S)'�
nested_scopes�
generators�division�absolute_import�with_statement�print_function�unicode_literals�barry_as_FLUFL�generator_stop�annotations�all_feature_names��iiiii i@i�ic@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_FeaturecCs||_||_||_dS�N)�optional�	mandatory�
compiler_flag)�selfZoptionalReleaseZmandatoryReleaser�r�"/usr/lib64/python3.8/__future__.py�__init__Ssz_Feature.__init__cCs|jSr)r�rrrr�getOptionalReleaseXsz_Feature.getOptionalReleasecCs|jSr)rrrrr�getMandatoryRelease_sz_Feature.getMandatoryReleasecCsdt|j|j|jf�S)Nr)�reprrrrrrrr�__repr__gs�z_Feature.__repr__N)�__name__�
__module__�__qualname__rrrrrrrrrQsr)��r
�betar )rrr
�alphar
)rrr
r"r )r�r
�finalr
)rrr
r"r)r#r
r
r"r
)r�r
r"r )r�r
r"r
)rr&r
r"r)r#r r
r"r)�r
r
r"r
)r#r%r
r!r )r#�r
r"r
)r#r(r
r!r )r#�
r
r"r
N)r�__all__Z	CO_NESTEDZCO_GENERATOR_ALLOWEDZCO_FUTURE_DIVISIONZCO_FUTURE_ABSOLUTE_IMPORTZCO_FUTURE_WITH_STATEMENTZCO_FUTURE_PRINT_FUNCTIONZCO_FUTURE_UNICODE_LITERALSZCO_FUTURE_BARRY_AS_BDFLZCO_FUTURE_GENERATOR_STOPZCO_FUTURE_ANNOTATIONSrrrrrrrrrr	r
rrrr�<module>3s|�
����������gettext.cpython-38.opt-2.pyc000064400000041452151450073350011631 0ustar00U

e5dj�@s�ddlZddlZddlZddlZdddddddd	d
ddd
dddddddddgZej�ejdd�Ze�	dej
ejB�Zdd�Z
dd�ZdZdd �eed!�D�Zd"d#d$d%�ZdFd'd(�Zd)d*�Zd+d,�Zd-d.�ZGd/d�d�ZGd0d�de�ZdGd2d�ZiZd3gZdddd1efd4d�Zdedfd5d�Ziaiad6adHd7d�Z dId8d	�Z!dJd9d
�Z"d:d�Z#d;d�Z$d<d�Z%d=d�Z&d>d�Z'd?d�Z(d@d
�Z)dAd�Z*dBd�Z+dCd�Z,dDd�Z-dEd�Z.eZ/dS)K�N�NullTranslations�GNUTranslations�Catalog�find�translation�install�
textdomain�bindtextdomain�bind_textdomain_codeset�dgettext�	dngettext�gettext�lgettext�	ldgettext�
ldngettext�	lngettext�ngettext�pgettext�	dpgettext�	npgettext�
dnpgettextZshare�localea�
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccsPt�t|�D]8}|j}|dkr q|�|�}|dkr>td|��|VqdVdS)NZWHITESPACESZINVALIDz invalid token in plural form: %s�)�re�finditer�_token_pattern�	lastgroup�group�
ValueError)�pluralZmoZkind�value�r!�/usr/lib64/python3.8/gettext.py�	_tokenizeWs
r#cCs|rtd|�Std�SdS)Nz#unexpected token in plural form: %szunexpected end of plural form)r)r r!r!r"�_errorbsr$))�||)�&&)z==z!=)�<�>z<=z>=)�+�-)�*�/�%cCs i|]\}}|D]
}||�qqSr!r!)�.0�iZops�opr!r!r"�
<dictcomp>ps
r1��or�andz//)r%r&r,���cCs�d}t|�}|dkr&|d7}t|�}q|dkrXt|�\}}d||f}|dkr�td��nP|dkrnd	||f}n:zt|d
�}Wntk
r�t|�d�YnXd||f}t|�}d}|tk�rt|}||krҐq|d
kr�|d
kr�d|}t�||�}t||d�\}	}d|||	f}|}q�||k�r4dk�r@nnd|}|dk�r�|dk�r�t|d�\}
}|dk�rtt|��t|�\}}d|
||f}|dk�r�d|}||fS)Nr�!znot �(z%s(%s)�)z%unbalanced parenthesis in plural form�nz%s%s�
z%s%d�d)��z(%s)r2z%s %s %sr=�?r�:z%s if %s else %s)�next�_parser�intr$�_binary_ops�	_c2py_ops�get)�tokensZpriority�result�nexttok�subr �jr/r0�rightZif_trueZif_falser!r!r"rAssP




rAcCsZzt|�}Wn(tk
r4td|jjf�d�YnXddl}|�d|jjftd�|S)Nz'Plural value must be an integer, got %srr=)�round�	TypeError�	__class__�__name__�warnings�warn�DeprecationWarning)r9r/rPr!r!r"�_as_int�s ����rScCs�t|�dkrtd��z|tt|��\}}|r2t|��d}|D]6}|dkr`|d7}|dkrptd��q:|dkr:|d8}q:d	ti}td
||�|dWStk
r�td��YnXdS)Ni�z"plural form expression is too longrr7r2�z%plural form expression is too complexr8rSz�if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            �func)�lenrrAr#r$rS�exec�RecursionError)rrGrHZdepth�c�nsr!r!r"�c2py�s.

��
r[c
Cs4t�|�}d}d}d}d}|�d�}|dkrN||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|}	g}
t|d�D]P}||@s�|	}||@r�||7}||@�r
||7}||@�r||7}|
�|�q�|
��|
S)	Nr2�r=r�@r�.�_)rZ	normalizer�range�append�reverse)
ZlocZCOMPONENT_CODESETZCOMPONENT_TERRITORYZCOMPONENT_MODIFIER�mask�posZmodifier�codesetZ	territoryZlanguageZretr/�valr!r!r"�_expand_lang�sJ









rgc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zddd�ZdS) rNcCs.i|_d|_d|_d|_|dk	r*|�|�dS�N)�_info�_charset�_output_charset�	_fallbackrA��self�fpr!r!r"�__init__�szNullTranslations.__init__cCsdSrhr!rmr!r!r"rAszNullTranslations._parsecCs|jr|j�|�n||_dSrh)rl�add_fallback)rn�fallbackr!r!r"rq
szNullTranslations.add_fallbackcCs|jr|j�|�S|Srh)rlr
)rn�messager!r!r"r
szNullTranslations.gettextc
Csrddl}|�dtd�|jrR|���(|�ddt�|j�|�W5QR�SQRX|jrd|�|j�S|�t	�
��S)Nr�/lgettext() is deprecated, use gettext() insteadr\�ignore�.*\blgettext\b.*)rPrQrRrl�catch_warnings�filterwarningsrrk�encoder�getpreferredencoding)rnrsrPr!r!r"rs�
�zNullTranslations.lgettextcCs*|jr|j�|||�S|dkr"|S|SdS�Nr2)rlr)rn�msgid1�msgid2r9r!r!r"r"s
zNullTranslations.ngettextc
Cs�ddl}|�dtd�|jrV|���,|�ddt�|j�|||�W5QR�SQRX|dkrd|}n|}|jrz|�|j�S|�t	�
��S)Nr�1lngettext() is deprecated, use ngettext() insteadr\ru�.*\blngettext\b.*r2)rPrQrRrlrwrxrrkryrrz�rnr|r}r9rP�tmsgr!r!r"r*s"�
�"zNullTranslations.lngettextcCs|jr|j�||�S|Srh)rlr)rn�contextrsr!r!r"r;szNullTranslations.pgettextcCs,|jr|j�||||�S|dkr$|S|SdSr{)rlr)rnr�r|r}r9r!r!r"r@s
zNullTranslations.npgettextcCs|jSrh)ri�rnr!r!r"�infoHszNullTranslations.infocCs|jSrh)rjr�r!r!r"�charsetKszNullTranslations.charsetcCsddl}|�dtd�|jS)Nrzoutput_charset() is deprecatedr\�rPrQrRrk)rnrPr!r!r"�output_charsetNs�zNullTranslations.output_charsetcCs ddl}|�dtd�||_dS)Nrz"set_output_charset() is deprecatedr\r�)rnr�rPr!r!r"�set_output_charsetTs�z#NullTranslations.set_output_charsetcCsRddl}|j|jd<|dk	rNddddddh}|t|�@D]}t||�|j|<q8dS)	Nrr_r
rrrrr)�builtinsr
�__dict__�set�getattr)rn�namesr�Zallowed�namer!r!r"rZs�zNullTranslations.install)N)N)rO�
__module__�__qualname__rprArqr
rrrrrr�r�r�r�rr!r!r!r"r�s

c@s\eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)rl�*l�$<z%s%s)rr2cCs|d?|d@fS)N�i��r!)rn�versionr!r!r"�
_get_versionspszGNUTranslations._get_versionsc"Cs�ddlm}t|dd�}i|_}dd�|_|��}t|�}|d|dd��d}||jkr||d	|dd
��\}}	}
}d}n6||jkr�|d|dd
��\}}	}
}d
}nt	dd|��|�
|�\}
}|
|jkr�t	ddt|
�|��t
d|	�D�]}||||
|
d��\}}||}|||||d��\}}||}||k�r`||k�r`|||�}|||�}nt	dd|��|dk�rld}|�d�D]�}|����}|�s��q�|�d��r�|�d��r��q�d}}d|k�r|�dd�\}}|����}|��}||j|<|}n|�r|j|d|7<|dk�r8|�d�d|_n0|dk�r�|�d�}|d�d�d}t|�|_�q�|j�pvd}d|k�r�|�d�\}} |�d�}t||�}t|�D]\}}!t|!|�|||f<�q�nt||�|t||�<|
d7}
|d7}q�dS)Nr)�unpackr�rcSst|dk�Sr{)rB)r9r!r!r"�<lambda>}�z(GNUTranslations._parse.<locals>.<lambda>z<Ir=z<4IrTz<IIz>4Iz>IIzBad magic numberzBad version number �zFile is corrupt�
z	#-#-#-#-#r?r2�
zcontent-typezcharset=zplural-forms�;zplural=�ascii�)Zstructr�r��_catalogr�readrV�LE_MAGIC�BE_MAGIC�OSErrorr��VERSIONS�strr`�split�decode�strip�
startswith�endswith�lowerrirjr[�	enumerate)"rnror��filenameZcatalogZbufZbuflen�magicr�ZmsgcountZ	masteridxZtransidxZiiZ
major_versionZ
minor_versionr/ZmlenZmoffZmendZtlenZtoffZtend�msgr�ZlastkZb_item�item�k�vrr�r|r}�xr!r!r"rAtsv














zGNUTranslations._parsecCshddl}|�dtd�t�}|j�||�}||krH|jrD|j�|�S|}|jrZ|�	|j�S|�	t
���S)Nrrtr\)rPrQrR�objectr�rErlrrkryrrz)rnrsrP�missingr�r!r!r"r�s�zGNUTranslations.lgettextcCs�ddl}|�dtd�z|j||�|�f}Wn@tk
rn|jrX|j�|||�YS|dkrf|}n|}YnX|jr�|�	|j�S|�	t
���S)Nrr~r\r2)rPrQrRr�r�KeyErrorrlrrkryrrzr�r!r!r"r�s �
zGNUTranslations.lngettextcCs6t�}|j�||�}||kr2|jr.|j�|�S|S|Srh)r�r�rErlr
)rnrsr�r�r!r!r"r
�szGNUTranslations.gettextcCs^z|j||�|�f}Wn@tk
rX|jrB|j�|||�YS|dkrP|}n|}YnX|Sr{)r�rr�rlr)rnr|r}r9r�r!r!r"r�s
zGNUTranslations.ngettextcCsF|j||f}t�}|j�||�}||krB|jr>|j�||�S|S|Srh)�CONTEXTr�r�rErlr)rnr�rs�ctxt_msg_idr�r�r!r!r"rszGNUTranslations.pgettextc	Csn|j||f}z|j||�|�f}WnBtk
rh|jrR|j�||||�YS|dkr`|}n|}YnX|Sr{)r�r�rr�rlr)rnr�r|r}r9r�r�r!r!r"rs
zGNUTranslations.npgettextN)rOr�r�r�r�r�r�r�rArrr
rrrr!r!r!r"rdsY	
FcCs�|dkrt}|dkrRg}dD]"}tj�|�}|r|�d�}q@qd|krR|�d�g}|D]$}t|�D]}||krf|�|�qfqZ|r�g}	nd}	|D]J}|dkr�q�tj�||dd|�}
tj�	|
�r�|r�|	�|
�q�|
Sq�|	S)N)ZLANGUAGE�LC_ALL�LC_MESSAGESZLANGr?�Cr�z%s.mo)
�_default_localedir�os�environrEr�rarg�path�join�exists)�domain�	localedir�	languages�allZenvarrfZnelangsZlangZnelangrG�mofiler!r!r"rs8


Zunspecifiedc
Cs|dkrt}t|||dd�}|sB|r*t�Sddlm}t|d|��d}|D]�}	|tj�|	�f}
t	�
|
�}|dkr�t|	d��}t	�|
||��}W5QRXddl
}
|
�
|�}|tk	r�ddl}|�dtd�|r�|���|�d	d
t�|�|�W5QRX|dk�r|}qJ|�|�qJ|S)NT)r�r)�ENOENTz$No translation file found for domain�rbzparameter codeset is deprecatedr\ruz.*\bset_output_charset\b.*)rrr�errnor��FileNotFoundErrorr�r��abspath�
_translationsrE�open�
setdefault�copy�_unspecifiedrPrQrRrwrxr�rq)r�r�r�Zclass_rrreZmofilesr�rGr��key�tror�rPr!r!r"rCsH�

�
�
cCst||d|d�}|�|�dS)NT)rrre)rr)r�r�rer�r�r!r!r"rnsZmessagescCs|dk	r|atSrh)�_current_domain)r�r!r!r"r|scCs|dk	r|t|<t�|t�Srh)�_localedirsrEr�)r�r�r!r!r"r	�scCs0ddl}|�dtd�|dk	r&|t|<t�|�S)Nrz'bind_textdomain_codeset() is deprecatedr\)rPrQrR�_localecodesetsrE)r�rerPr!r!r"r
�s�cCs:zt|t�|d��}Wntk
r.|YSX|�|�Srh)rr�rEr�r
)r�rsr�r!r!r"r�s

c
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn&t	k
r�|�
|pzt���YSX|���&|�ddt�|�
|�W5QR�SQRXdS)Nrz1ldgettext() is deprecated, use dgettext() insteadr\ru�.*\bparameter codeset\b.*�rerv)rPrQrRr�rErwrxrr�r�ryrrzr)r�rsrPrer�r!r!r"r�s&�

�$
�cCsRzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�|||�Sr{)rr�rEr�r)r�r|r}r9r�r!r!r"r�sc
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn8t	k
r�|dkrz|}n|}|�
|p�t���YSX|���*|�ddt�|�
|||�W5QR�SQRXdS)	Nrz3ldngettext() is deprecated, use dngettext() insteadr\rur�r�r2r)rPrQrRr�rErwrxrr�r�ryrrzr)r�r|r}r9rPrer�r�r!r!r"r�s,�

�$
�cCs<zt|t�|d��}Wntk
r.|YSX|�||�Srh)rr�rEr�r)r�r�rsr�r!r!r"r�s

cCsTzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�||||�Sr{)rr�rEr�r)r�r�r|r}r9r�r!r!r"r�scCs
tt|�Srh)rr�)rsr!r!r"r
�sc
CsNddl}|�dtd�|���&|�ddt�tt|�W5QR�SQRXdS)Nrrtr\ruz.*\bldgettext\b.*)rPrQrRrwrxrr�)rsrPr!r!r"r�s�
�cCstt|||�Srh)rr�)r|r}r9r!r!r"r�sc
CsRddl}|�dtd�|���*|�ddt�tt|||�W5QR�SQRXdS)Nrr~r\ruz.*\bldngettext\b.*)rPrQrRrwrxrr�)r|r}r9rPr!r!r"r�s�
�cCstt||�Srh)rr�)r�rsr!r!r"r�scCstt||||�Srh)rr�)r�r|r}r9r!r!r"r�s)r5)NNF)N)N)N)0rr�r�sys�__all__r�r��base_prefixr��compile�VERBOSE�DOTALLrr#r$rCr�rDrArSr[rgrrrr�r�rrr�r�r�rr	r
rrrrrrr
rrrrrrr!r!r!r"�<module>1s��
�

1$*f7
&�
+




	
platform.cpython-38.opt-1.pyc000064400000057410151450073350011771 0ustar00U

e5d��@sldZdZdZddlZddlZddlZddlZddddddd	d	d
d
d�
Ze�d�Z	d
d�Z
e�dej�Zdwdd�Z
dxdd�Ze�d�Zdydd�Zddddddd d!d"d#d$d%�Zdd&d'd(d)d*d+�Zd,d-�Zd.d/�Zdzd0d1�Zd2d3�Zd{d5d6�Zd7d8�Zd|d9d:�Zd;d<�Zd=d>�Zd}d?d@�ZdAdB�Zd~dCdD�ZddEdF�ZdGdHdId�Z ej!ddfdJdK�Z"e�#dLdM�Z$da%dNdO�Z&dPdQ�Z'dRdS�Z(dTdU�Z)dVdW�Z*dXdY�Z+dZd[�Z,e�d\ej�Z-e�d]ej�Z.e�d^�Z/e�d_�Z0iZ1d�d`da�Z2dbdc�Z3ddde�Z4dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9iZ:d�dpdq�Z;e<drk�rhdsej=k�p8dtej=kZ>duej=k�oNdvej=kZ?e@e;e?e>��e�Ad�dS)�a8 This module tries to retrieve as much platform-identifying data as
    possible. It makes this information available via function APIs.

    If called from the command line, it prints the platform
    information concatenated as single string to stdout. The output
    format is useable as part of a filename.

a
    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee or royalty is hereby granted,
    provided that the above copyright notice appear in all copies and that
    both that copyright notice and this permission notice appear in
    supporting documentation or portions thereof, including modifications,
    that you make.

    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !

z1.0.8�N�
���(�2��)
ZdevZalpha�aZbeta�b�cZRCZrc�pl�pz([0-9]+|[._+-])c	Csbg}t�|�D]N}|dkrzt|d�}d}Wn tk
rLt�|d�}YnX|�||f�q|S)Nz._+-r�dr)�
_component_re�split�int�
ValueError�_ver_stages�get�extend)�version�result�v�t�r� /usr/lib64/python3.8/platform.py�_comparable_version�s
rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)��@c
Cs�|dkrZz0t�d�}|jdd�}t|�dkr6t|�WSWntttfk
rRYnXtj	}t
}ttjd�rvtj�
|�}t|d���`}|�|�}d}	|	t|�k�r�d	|ks�d
|kr�t�||	�}
nd}
|
r�|
��t|�k�r|�|�}|�r|t|	t|�d�d�|}d}	q�|
�s�q�dd
�|
��D�\}}
}}}}|�rF|�sFd}n�|
�rx|dk�r`d}|}n||�||�k�r�|}n\|�r�|dk�r�d}|�r�|�r�||�||�k�r�|}|�r�|t|�d�|k�r�||}|
��}	q�W5QRX||fS)a Tries to determine the libc version that the file executable
        (which defaults to the Python interpreter) is linked against.

        Returns a tuple of strings (lib,version) which default to the
        given parameters in case the lookup fails.

        Note that the function has intimate knowledge of how different
        libc versions add symbols to the executable and thus is probably
        only useable for executables compiled using gcc.

        The file is read and scanned in chunks of chunksize bytes.

    N�CS_GNU_LIBC_VERSION�)�maxsplit��realpath�rbrslibcsGLIBCi�cSs"g|]}|dk	r|�d�n|�qS)N�latin1)�decode)�.0�srrr�
<listcomp>�s�zlibc_ver.<locals>.<listcomp>Zlibc�glibc)�os�confstrr�len�tuple�AttributeErrorr�OSError�sys�
executabler�hasattr�pathr"�open�read�_libc_search�search�end�max�groups)r1�librZ	chunksize�ver�parts�V�fZbinary�pos�m�chunkZlibcinitr)ZglibcversionZsoZthreadsZ	soversionrrr�libc_ver�s^


�

rCcCs`|�d�}|r|�|�zttttt|���}Wntk
rH|}YnXd�|dd��}|S)z� Normalize the version and build strings and return a single
        version string using the format major.minor.build (or patchlevel).
    �.N�)r�append�list�map�strrr�join)r�build�lZstringsrrr�
_norm_version�s


rMz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc	Cs�tj|kr|||fSddl}dD]R}z|j||jddd�}Wn0t|jfk
rl}zWY�q W5d}~XYq Xq~q |||fS|��}t�	|�}|dk	r�|�
�\}}}|ddkr�|dd�}|ddkr�|dd�}t|�}|||fS)a+ Tries to figure out the OS version used and returns
        a tuple (system, release, version).

        It uses the "ver" shell command for this which is known
        to exists on Windows, DOS. XXX Others too ?

        In case this fails, the given parameters are used as
        defaults.

    rN)r<zcommand /c verz
cmd /c verT)�stderr�text�shell���rD)r0�platform�
subprocess�check_output�DEVNULLr/�CalledProcessError�strip�_ver_output�matchr:rM)	�system�releaserZsupported_platformsrW�cmd�infoZwhyrArrr�_syscmd_vers0

�


rbZ2000ZXPZ
2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10))�r)rfr�rfr!)rfN��r�rir�rir!�rirE�riN)rr)rNZ
2008ServerZ2008ServerR2Z
2012ServerZ2012ServerR2Zpost2012ServerR2)rgrhrjrkrlrmcCs
t�dkS)N)ZIoTUAPZ
NanoServerZWindowsCoreHeadlessZ	IoTEdgeOS)�
win32_editionrrrr�win32_is_iotOsroc
Cs�z.zddl}Wntk
r*ddl}YnXWntk
rBYnTXz<d}|�|j|�� }|�|d�dW5QR�WSQRXWntk
r�YnXdS)Nr�,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ	EditionId)�winreg�ImportError�_winreg�	OpenKeyEx�HKEY_LOCAL_MACHINE�QueryValueExr/)rq�cvkey�keyrrrrnRs(rnc	Cs�zddlm}Wn tk
r0||||fYSX|�}z ttt�d�d��\}}}Wn,tk
r�|jpx|dd�\}}}YnXd�	|||�}t
�||f�p�t
�|df�p�|}|dd�||fk�rzd�	|j�}Wn8t
k
�r|dd�d	k�rd
|dd�}YnXt|dd�dk�rJt�||f��pHt�|df��pH|}z0zddl}	Wntk
�rvddl}	YnXWntk
�r�YnLXz2d}
|	�|	j|
��}|	�|d
�d}W5QRXWntk
�r�YnX||||fS)Nr)�getwindowsversionr!rDrEz{0}.{1}.{2}zSP{}�
z
Service Pack ZSPZproduct_typerpZCurrentType)r0ryrrrHrrbrrZplatform_version�format�_WIN32_CLIENT_RELEASESrZservice_pack_majorr.�getattr�_WIN32_SERVER_RELEASESrqrsrtrurvr/)r_r�csd�ptyperyZwinver�major�minorrKrqrwrxrrr�	win32_verdsR ����r�c	Cs�d}tj�|�sdSzddl}Wntk
r6YdSXt|d��}|�|�}W5QRX|d}d}t��j}|dkrzd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr#ZProductVersion�rrr)ZppczPower MacintoshZPowerPC)	r*r3�exists�plistlibrrr4�load�uname�machine)�fnr�r?rr_�versioninfor�rrr�_mac_ver_xml�s
r�r�cCst�}|dk	r|S|||fS)a< Get macOS version information and return it as tuple (release,
        versioninfo, machine) with versioninfo being a tuple (version,
        dev_stage, non_release_version).

        Entries which cannot be determined are set to the parameter values
        which default to ''. All tuple entries are strings.
    N)r�)r_r�r�rarrr�mac_ver�sr�cCsHddlm}z|�|�}|dkr&|WS|WStk
rB|YSXdS)Nr)�System)�	java.langr�ZgetPropertyr.)�name�defaultr��valuerrr�
_java_getprop�s
r�cCs�zddl}Wn tk
r,||||fYSXtd|�}td|�}|\}}}td|�}td|�}td|�}|||f}|\}}	}
td|
�}
td	|�}td
|	�}	||	|
f}||||fS)a] Version interface for Jython.

        Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being
        a tuple (vm_name, vm_release, vm_vendor) and osinfo being a
        tuple (os_name, os_version, os_arch).

        Values which cannot be determined are set to the defaults
        given as parameters (which all default to '').

    rNzjava.vendorzjava.versionzjava.vm.namezjava.vm.vendorzjava.vm.versionzjava.os.archzjava.os.namezjava.os.version)r�rrr�)r_�vendor�vminfo�osinfo�javaZvm_nameZ
vm_releaseZ	vm_vendor�os_name�
os_version�os_archrrr�java_ver�s"












r�cCs�|dkr�|dkr|||fS|�d�}|rlzt|d�}Wntk
rLYn X|d}t|�|d<d�|�}|dkrzd}q�d}n,|dkr�d	}|r�|d
}q�d}n|dkr�d
}|||fS)z� Returns (system, release, version) aliased to common
        marketing names used for some systems.

        It also does some reordering of the information in some cases
        where it would otherwise cause confusion.

    ZSunOS�5rDrrE�6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rOrP�Windows)rrrrIrJ)r^r_rrLr�rrr�system_alias�s.	



r�cGs�d�dd�tt|�D��}|�dd�}|�dd�}|�dd�}|�dd�}|�d	d�}|�d
d�}|�dd�}|�dd�}|�d
d�}|�dd�}||kr�q�|}q�|ddkr�|dd�}q�|S)zq Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
    �-css|]}|��VqdS)N)r[)r&�xrrr�	<genexpr>(sz_platform.<locals>.<genexpr>� �_�/�\�:�;�"�(�)�unknownrz--rUN)rJ�filterr,�replace)�argsrVZcleanedrrr�	_platform"s"r�cCsNzddl}Wntk
r$|YSXz
|��WStk
rH|YSXdS)z8 Helper to determine the node name of this machine.
    rN)�socketrrZgethostnamer/)r�r�rrr�_nodeBs

r�cCsBtj�|�}tj�|�r>tj�tj�tj�|�t�|���}q|S)zT In case filepath is a symlink, follow it until a
        real file is reached.
    )r*r3�abspath�islink�normpathrJ�dirname�readlink)�filepathrrr�_follow_symlinksQs�r�c	Cs\tjdkr|Sddl}z|jd|f|jdd�}Wnt|jfk
rN|YSX|��pZ|S)z. Interface to the system's uname command.
    �rQrOrPrNr�T)rRrS)r0rVrWrXrYr/rZr[)Zoptionr�rW�outputrrr�
_syscmd_uname\s

�

r�c	Csztjdkr|Sddl}t|�}ttjdd�}z|jdd|g|j|d�}Wnt	|j
fk
rf|YSX|sp|S|�d	�S)
z� Interface to the system's file command.

        The function uses the -b option of the file command to have it
        omit the filename in its output. Follow the symlinks. It returns
        default in case the command should fail.

    r�rN�C)�LC_ALL�filez-b)rR�envzlatin-1)r0rVrWr��dictr*�environrXrYr/rZr%)�targetr�rWr�r�rrr�_syscmd_filems	
�

r�)r�	WindowsPE)rr�)r�MSDOScCs|s&ddl}|�d�}t|d�d}|r6t|d�}nd}|sx|tjkrxtjtkrpttj\}}|rh|}|rp|}||fSd|kr�d|kr�||fSd	|kr�d
}nd|kr�d}nd
|kr�d}d|kr�d}n8d|kr�d|kr�d}q�d}nd|kr�d}nd|kr�d}n||fS)a� Queries the given executable (defaults to the Python interpreter
        binary) for various architecture information.

        Returns a tuple (bits, linkage) which contains information about
        the bit architecture and the linkage format used for the
        executable. Both values are returned as strings.

        Values that cannot be determined are returned as given by the
        parameter presets. If bits is given as '', the sizeof(pointer)
        (or sizeof(long) on Python version < 1.5.2) is used as
        indicator for the supported pointer size.

        The function relies on the system's "file" command to do the
        actual work. This is available on most if not all Unix
        platforms. On some non-Unix platforms where the "file" command
        does not exist and the executable is set to the Python interpreter
        binary defaults from _default_architecture are used.

    rN�P��bitrr1z
shared objectz32-bit�32bitZN32Zn32bitz64-bitr�ZELFZPEr�r�ZCOFFzMS-DOSr�)�structZcalcsizerIr�r0r1rV�_default_architecture)r1�bits�linkager��sizeZfileoutr	rLrrr�architecture�sH
�
r��uname_resultz-system node release version machine processorcCs�d}tdk	rtSd}zt��\}}}}}Wntk
rBd}YnX|sbttd|||||f���s�|r~tj}d}d}t�}d}d}|dkr�t	�\}}}}	|r�|r�d}|s�dtj
kr�tj
�dd�}ntj
�dd�}|s�tj
�d|�}|�r:t|�\}}}|d	k�rd
}n4|dk�r:|d
k�r:d
}d|dd
�k�r6d}nd}|dk�rd|�s^|dk�rZd}nd}d
}n8|dd�dk�r�t
�\}}
}}d}d�|�}|�s�|
}|dk�r|�r�|dk�r�|}d}zddl}
Wntk
�r�Yn&X|
�dd�\}}|dk�rd}nd}|�stdd�}|dk�r$d}|dk�r2d}|dk�r@d}|dk�rNd}|dk�r\d}|dk�rjd}|dk�r�|d
k�r�d
}d}t||||||�atS)an Fairly portable uname interface. Returns a tuple
        of strings (system, node, release, version, machine, processor)
        identifying the underlying platform.

        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.

        Entries which cannot be determined are set to ''.

    rNrrrOZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr�Z	Microsoftz6.0rErcr�r�Z16bit�r��Javaz, ZOpenVMS�0zSYI$_CPU�ZAlphaZVAXz-pr�)�_uname_cacher*r�r.rGr�r0rVr�r�r�rrbr�rJ�vms_librrZgetsyir�r�)Zno_os_uname�	processorr^�noder_rr�Zuse_syscmd_verrr�r�r�r�r�ZcsidZ
cpu_numberrrrr��s�
















�r�cCst�jS)z� Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.

        An empty string is returned if the value cannot be determined.

    )r�r^rrrrr^usr^cCst�jS)z� Returns the computer's network name (which may not be fully
        qualified)

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr�~sr�cCst�jS)z� Returns the system's release, e.g. '2.2.0' or 'NT'

        An empty string is returned if the value cannot be determined.

    )r�r_rrrrr_�sr_cCst�jS)z� Returns the system's release version, e.g. '#3 on degas'

        An empty string is returned if the value cannot be determined.

    )r�rrrrrr�srcCst�jS)zt Returns the machine type, e.g. 'i386'

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr��sr�cCst�jS)a Returns the (true) processor name, e.g. 'amdk6'

        An empty string is returned if the value cannot be
        determined. Note that many platforms do not provide this
        information or simply return the same value as for machine(),
        e.g.  NetBSD does this.

    )r�r�rrrrr��s
r�zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCs|dkrtj}t�|d�}|dk	r&|Sd|kr�d}|�d�rHt�|�}n
t�|�}|dkrjtdt	|���|�
�\}}}d}d}n�tj�d�r�d}t�|�}|dkr�tdt	|���|�
�\}}}}	}
|dkr�d}tj}n�d|k�r"d}t
�|�}|dk�rtd	t	|���|�
�\}}}}	d}n\t�|�}|dk�rFtd
t	|���|�
�\}}}}	}d}|dk�rld}n|	�r~|d|	}ttd
��r�tj\}
}}n"ttd��r�tj\}
}}nd}d}|�d�}
t|
�dk�r�|
�d�d�|
�}|||||||f}|t|<|S)a� Returns a parsed version of Python's sys.version as tuple
        (name, version, branch, revision, buildno, builddate, compiler)
        referring to the Python implementation name, version, branch,
        revision, build number, build date/time as string and the compiler
        identification string.

        Note that unlike the Python sys.version, the returned value
        for the Python version will always include the patchlevel (it
        defaults to '.0').

        The function returns empty strings for tuple entries that
        cannot be determined.

        sys_version may be given to parse an alternative version
        string, e.g. if the version was read from a different Python
        interpreter.

    NZ
IronPythonz*failed to parse IronPython sys.version: %srr�ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr��_git�
_mercurialrDr!r�)r0r�_sys_version_cacher�
startswith�_ironpython_sys_version_parserr]� _ironpython26_sys_version_parserr�reprr:rV�_sys_version_parser�_pypy_sys_version_parserr2r�r�rr,rFrJ)�sys_versionrr�r]rZalt_versionZcompilerZbuildnoZ	builddateZ	buildtimer��branchZrevisionrLrrr�_sys_version�s�

��
��


�

���



r�cCs
t�dS)aR Returns a string identifying the Python implementation.

        Currently, the following implementations are identified:
          'CPython' (C implementation of Python),
          'IronPython' (.NET implementation of Python),
          'Jython' (Java implementation of Python),
          'PyPy' (Python implementation of Python).

    r�r�rrrr�python_implementation5sr�cCs
t�dS)z� Returns the Python version as string 'major.minor.patchlevel'

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rr�rrrr�python_versionBsr�cCstt�d�d��S)z� Returns the Python version as tuple (major, minor, patchlevel)
        of strings.

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rrD)r-r�rrrrr�python_version_tupleLs	r�cCs
t�dS)z� Returns a string identifying the Python implementation
        branch.

        For CPython this is the SCM branch from which the
        Python binary was built.

        If not available, an empty string is returned.

    r!r�rrrr�
python_branchWsr�cCs
t�dS)z� Returns a string identifying the Python implementation
        revision.

        For CPython this is the SCM revision from which the
        Python binary was built.

        If not available, an empty string is returned.

    rEr�rrrr�python_revisionesr�cCst�dd�S)zh Returns a tuple (buildno, builddate) stating the Python
        build number and date as strings.

    r�rir�rrrr�python_buildrsr�cCs
t�dS)zS Returns a string identifying the compiler used for compiling
        Python.

    rir�rrrr�python_compilerzsr�cCsbt�||fd�}|dk	r|St�\}}}}}}||kr:d}|rPt|||�\}}}|dkrnt�d}	|	rnd}|	}|dkr�t|�\}
}}}
|r�t||�}nt||||�}n�|dkr�ttj	�\}}t||||d||�}n~|d	k�r t
�\}}}\}}}|s�|�s
t|||�}nt|||d
|||�}n2|�r2t||�}n ttj	�\}}t||||||�}|t||f<|S)a� Returns a single string identifying the underlying platform
        with as much useful information as possible (but no more :).

        The output is intended to be human readable rather than
        machine parseable. It may look different on different
        platforms and this is intended.

        If "aliased" is true, the function will use aliases for
        various platforms that report system names which differ from
        their common names, e.g. SunOS will be reported as
        Solaris. The system_alias() function is used to implement
        this.

        Setting terse to true causes the function to return only the
        absolute minimum information needed to identify the platform.

    NrZDarwinrZmacOSr�)ZLinux�withr�Zon)�_platform_cacherr�r�r�r�r�rCr0r1r�r�)�aliased�terserr^r�r_rr�r�Z
macos_releaseZrelZversrr�rVZlibcnameZlibcversion�rrr�r�r�r�r�r�rrrrV�sX

�

��rV�__main__r�z--terseZ
nonaliasedz--nonaliased)Nrrr)r)rrrrN)rrrr)rr�r)rrr�r�)r)r)r)N)rr)B�__doc__Z
__copyright__�__version__�collectionsr*�rer0r�compilerr�ASCIIr6rCrMr\rbr|r~rornr�r�r�r�r�r�r�r�r�r�r�r�r1r��
namedtupler�r�r�r^r�r_rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rV�__name__�argvr�r��print�exitrrrr�<module>s�Y
�
�
G


�
1��

3

#4 


$�P�	
			����
h




L
compileall.cpython-38.pyc000064400000022304151450073350011321 0ustar00U

e5dn5�	@s�dZddlZddlZddlZddlZddlZddlmZdddgZ	ddd	�Z
dd
d�Zdd�Zddd�Z
ddd�Zdd�Zedkr�ee��Ze�e�dS)a�Module/script to byte-compile all .py files to .pyc files.

When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.

Without arguments, if compiles all modules on sys.path, without
recursing into subdirectories.  (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.
�N)�partial�compile_dir�compile_file�compile_path�
ccs|dkrt|tj�rt�|�}|s0td�|��zt�|�}Wn.tk
rl|dkrdtd�|��g}YnX|��|D]�}|dkr�qztj	�
||�}|dk	r�tj	�
||�}nd}tj	�|�s�||fVqz|dkrz|tjkrz|tj
krztj	�|�rztj	�|�szt|||d|d�EdHqzdS)N�zListing {!r}...zCan't list {!r}�__pycache__r�)�ddir�	maxlevels�quiet)�
isinstance�os�PathLike�fspath�print�format�listdir�OSError�sort�path�join�isdir�curdir�pardir�islink�	_walk_dir)�dirr
rr�names�name�fullname�dfile�r"�"/usr/lib64/python3.8/compileall.pyrs:


�
��rF���r	c
Cs�d}
|dkrtd��|dkrFzddlm}
Wntk
rDd}YnXt||||d�}d}|dkr�|
dk	r�|ppd}|
|d��0}
|
�tt||||||	d	�|�}t|dd
�}W5QRXn(|D]"\}}t	||||||||	�s�d}q�|S)aByte-compile all modules in the given directory tree.

    Arguments (only dir is required):

    dir:       the directory to byte-compile
    maxlevels: maximum recursion level (default 10)
    ddir:      the directory that will be prepended to the path to the
               file as it is compiled into each byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    workers:   maximum number of parallel workers
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    Nrz%workers must be greater or equal to 0r	)�ProcessPoolExecutor)rrr
T)Zmax_workers)�force�rxr�legacy�optimize�invalidation_mode)�defaultF)
�
ValueErrorZconcurrent.futuresr%�ImportErrorr�mapr�_compile_file_tuple�minr)rrr
r&r'rr(r)�workersr*r%Zfiles_and_ddirs�successZexecutorZresults�filer!r"r"r#r2sF
����cKs|\}}t||f|�S)z-Needs to be toplevel for ProcessPoolExecutor.)r)Zfile_and_dfile�kwargsr3r!r"r"r#r/esr/c
Cs�d}|dkr"t|tj�r"t�|�}tj�|�}	|dk	rFtj�||	�}
nd}
|dk	rd|�|�}|rd|Stj�|��r�|r�|d}nB|dkr�|dkr�|nd}
t	j
j||
d�}nt	j
�|�}tj�|�}|	dd	�|	d	d�}}|d
k�r�|�s\zXt
t�|�j�}t�dt	j
jd|�}t|d��}|�d
�}W5QRX||k�rB|WSWntk
�rZYnX|�sptd�|��ztj|||
d||d�}W�ntjk
�r}zjd}|dk�r�|WY�RS|�r�td�|��ntddd�|jjtjjdd�}|� tjj�}t|�W5d}~XYn�t!t"tfk
�r�}zRd}|dk�rJ|WY�:S|�r`td�|��ntddd�t|j#j$d|�W5d}~XYnX|dk�r�d}|S)aTByte-compile one file.

    Arguments (only fullname is required):

    fullname:  the file to byte-compile
    ddir:      if given, the directory name compiled in to the
               byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    TrN�crr	�)�optimization���z.pyz<4sll�rb�zCompiling {!r}...)r)r*Fz*** Error compiling {!r}...z*** )�end�backslashreplace)�errors�:)%r
rrrr�basenamer�search�isfile�	importlib�util�cache_from_source�dirname�int�stat�st_mtime�structZpack�MAGIC_NUMBER�open�readrrr�
py_compile�compile�PyCompileError�msg�encode�sys�stdout�encoding�decode�SyntaxError�UnicodeError�	__class__�__name__)r r
r&r'rr(r)r*r2rr!Zmo�cfile�optZ	cache_dir�head�tail�mtimeZexpectZchandleZactual�ok�errrP�er"r"r#rjs�


�
�

�
�
$
c	CsTd}tjD]D}|r|tjkr2|r2|dkrNtd�q
|oLt||d|||||d�}q
|S)a�Byte-compile all module on sys.path.

    Arguments (all optional):

    skip_curdir: if true, skip current directory (default True)
    maxlevels:   max recursion level (default 0)
    force: as for compile_dir() (default False)
    quiet: as for compile_dir() (default 0)
    legacy: as for compile_dir() (default False)
    optimize: as for compile_dir() (default -1)
    invalidation_mode: as for compiler_dir()
    TrzSkipping current directoryN)rr(r)r*)rRrrrrr)	Zskip_curdirrr&rr(r)r*r2rr"r"r#r�s 

�
c
Cs�ddl}|jdd�}|jdddddd	d
�|jdtdd
d�|jddddd�|jdddddd�|jddddd�|jdddddd �|jd!d"d#dd$d �|jd%d&d'd(d)�|jd*d+d,d-d.�|jd/d0d1td2d3�d4d5�tjD�}|jd6t|�d7d8�|��}|j}|j	�r$ddl
}|�|j	�|_	|jdk	�r8|j}n|j
}|j�r�zF|jd9k�rZtjnt|j�� }|D]}|�|����qjW5QRXWn4tk
�r�|jd:k�r�td;�|j��Yd<SX|j�r�|j�d9d=���}	tj|	}
nd}
d>}z�|�rl|D]h}tj�|��r6t||j|j |j	|j|j!|
d?��sbd<}n,t"|||j|j |j	|j|j!|j#|
d@�	�s�d<}�q�|WSt$|j!|j |j|
dA�WSWn,t%k
�r�|jd:k�r�tdB�Yd<SXd>S)CzScript main program.rNz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrrz!don't recurse into subdirectories)�actionZconstr+�dest�helpz-r�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)�typercrdz-f�
store_truer&z/force rebuild even if timestamps are up to date)rbrcrdz-q�countrzIoutput only error messages; -qq will suppress the error messages as well.)rbrcr+rdz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)�metavarrcr+rdz-xZREGEXPr'zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILE�flistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rircrd�compile_destzFILE|DIR�*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)ri�nargsrdz-jz	--workersr	zRun compileall concurrently)r+rfrdcSsg|]}|j���dd��qS)�_�-)r�lower�replace)�.0�moder"r"r#�
<listcomp>	s�zmain.<locals>.<listcomp>z--invalidation-modez�set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)�choicesrdrorzError reading file list {}FrnT)r*)r1r*)r(r&rr*z
[interrupted])&�argparse�ArgumentParser�add_argumentrFrM�PycInvalidationMode�sorted�
parse_argsrkr'�rerNrerrjrR�stdinrK�append�striprrrrr*rq�upperrrrArr
r&r(rr1r�KeyboardInterrupt)
rv�parserZinvalidation_modes�argsZ
compile_destsr|r�f�lineZivl_moder*r2rcr"r"r#�main�s��
�
�
��
���
�
�
��� �
�
�r��__main__)Nrr)	rNFNrFr$r	N)NFNrFr$N)r	rFrFr$N)�__doc__rrR�importlib.utilrBrMrI�	functoolsr�__all__rrr/rrr�rYrFZexit_status�exitr"r"r"r#�<module>s<

�
3�
V�
"istringprep.cpython-38.opt-2.pyc000064400000024765151450073350012352 0ustar00U

e5du2��@s�ddlmZdd�Zedddddd	d
ddd
dgeedd���Zdd�Zdddddddddddddd d!d"d#d$d%d&dd'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBd;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdCdDdEdFdGdHdIdJdKdLdMdNdOdLddPdQdRdSdTdQdUddVdWdXddYdZd[d\d]d^d_d`d]dadbdcdddedfdfdfdgdgdhdidjdkdldmdmdmdndodpdqdqdrdbdsdtdudvd$dwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�dbdwd�d�d�did�dkdldd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdwdsdtd�d�d�dhdudid�dkdldd�d�d�d�d�d�d�drdwdsdtd�dgd�d�dhdud�dd�d�d�d�d�d�d�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�ddɐ��Zd�d˄Z	d�d̈́Z
d�dτZd�dфZd�dӄZ
d�dՄZed�d�d�ddd�d�dgeed
dۃ�eed�d݃�eed�d߃�eed�d���Zd�d�Zd�d�Zd�d�Zd�d�Zd�d�Zeed�d��Zd�d�Zeed�d��Zd�d�Zed�d�d�d�geed�d���eed�d݃��Zd�d��Zed�geed�d����Zd�d��Z�d�d�Z�d�d�Z�dS(�)�	ucd_3_2_0cCsBt�|�dkrdSt|�}d|kr.dkr6nndS|d@dkS)NZCnF�������r)�unicodedata�category�ord��code�c�r�"/usr/lib64/python3.8/stringprep.py�in_table_a1sr�iOiiii
i i i
 i` i��i�i�cCst|�tkS�N)r
�b1_set�rrrr�in_table_b1sruμZssui̇uʼn�suǰuιu ιuΐuΰuσuβuθuυuύuϋuφuπuκuρuεuեւuẖuẗuẘuẙuaʾuṡuὐuὒuὔuὖuἀιuἁιuἂιuἃιuἄιuἅιuἆιuἇιuἠιuἡιuἢιuἣιuἤιuἥιuἦιuἧιuὠιuὡιuὢιuὣιuὤιuὥιuὦιuὧιuὰιuαιuάιuᾶuᾶιuὴιuηιuήιuῆuῆιuῒuῖuῗuῢuῤuῦuῧuὼιuωιuώιuῶuῶιZrsr
u°cuɛu°f�h�i�l�nZno�p�q�rZsmZtelZtm�z�b�e�f�muγ�dZhpaZauZovZpaZnauμaZmaZkaZkbZmbZgbZpfZnfuμf�hzZkhzZmhzZghzZthzZkpaZmpaZgpaZpvZnvuμvZmvZkvZpwZnwuμwZmw�kwukωumωZbquc∕kgzco.ZdbZgyZhpZkkZkmZphZppmZprZsv�wbZffZfiZflZffiZffl�stuմնuմեuմիuվնuմխ�a�g�j�k�o�t�u�v�w�x�yuαuδuζuηuλuνuξuοuτuχuψuω(����i0iIii�iEizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iPiRiTiVi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i� i!i!i!i	!i!i!i
!i!i!i!i!i!i!i!i!i!i!i !i!!i"!i$!i(!i,!i-!i0!i1!i3!i>!i?!iE!iq3is3iu3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i4�i5�i6�i7�i8�i9�i:�i;�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�ih�ii�ij�ik�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i�i�i�i	�i
�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i8�i9�i;�i<�i=�i>�i@�iA�iB�iC�iD�iF�iJ�iK�iL�iM�iN�iO�iP�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i �i!�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�iN�iO�iP�iQ�iR�iS�iT�iU�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i
�i�i�i�i�i �i!�i"�i#�i$�i%�i&�i'�i(�i)�i*�i+�i,�i-�i.�i/�i0�i1�i2�i3�i4�iG�iV�iW�iX�iY�iZ�i[�i\�i]�i^�i_�i`�ia�ib�ic�id�ie�if�ig�ih�ii�ij�ik�il�im�in�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��cCs"t�t|��}|dk	r|S|��Sr)�
b3_exceptions�getr
�lower)rrrrr�map_table_b3�sr8cCsHt|�}t�d|�}d�dd�|D��}t�d|�}||kr@|S|SdS)NZNFKC�cSsg|]}t|��qSr)r8)�.0Zchrrr�
<listcomp>�sz map_table_b2.<locals>.<listcomp>)r8rZ	normalize�join)r(ZalrZblr
rrr�map_table_b2�sr=cCs|dkS)N� rrrrr�in_table_c11�sr?cCst�|�dko|dkS)N�Zsr>�rr	rrrr�in_table_c12�srBcCst�|�dkS)Nr@rArrrr�in_table_c11_c12�srCcCst|�dkot�|�dkS)N��Cc)r
rr	rrrr�in_table_c21�srFi�iii( i) id ij ip i��i��is�i{�cCs.t|�}|dkrdSt�|�dkr&dS|tkS)NrDFrET)r
rr	�c22_specialsrrrr�in_table_c22�srHcCst�|�dkpt|�tkS)NrE)rr	r
rGrrrr�in_table_c21_c22�s
�rIcCst�|�dkS)NZCorArrrr�in_table_c3�srJcCs0t|�}|dkrdS|dkr dSt|�d@dkS)NrFrTrr)r
rrrr�in_table_c4�srKcCst�|�dkS)NZCsrArrrr�in_table_c5�srLrcCst|�tkSr)r
�c6_setrrrr�in_table_c6�srNi�/i�/cCst|�tkSr)r
�c7_setrrrr�in_table_c7�srPi@iAi i i* i/ cCst|�tkSr)r
�c8_setrrrr�in_table_c8srRii i�cCst|�tkSr)r
�c9_setrrrr�in_table_c9srTcCst�|�dkS)N)�RZAL�rZ
bidirectionalrrrr�in_table_d1srWcCst�|�dkS)N�LrVrrrr�in_table_d2srYN)rrr�set�list�rangerrr5r8r=r?rBrCrFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrWrYrrrr�<module>sL,��&P,weakref.cpython-38.opt-2.pyc000064400000037516151450073350011577 0ustar00U

e5d�S�
@s�ddlmZmZmZmZmZmZmZmZddl	m
Z
mZddlZddl
Z
ddlZeefZdddddd	d
ddd
dddg
ZGdd�de�ZGdd
�d
ej�ZGdd�de�ZGdd�dej�ZGdd�d�ZdS)�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr
�
WeakMethod�finalizecs@eZdZdZddd�Z�fdd�Zdd�Zd	d
�Zej	Z	�Z
S)r)�	_func_ref�
_meth_type�_alive�__weakref__Ncs~z|j}|j}Wn(tk
r8td�t|���d�YnX��fdd�}t�|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs&��}|jr"d|_�dk	r"�|�dS�NF)r)�arg�self��callbackZself_wr��/usr/lib64/python3.8/weakref.py�_cb3s
zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�clsZmethr�obj�funcrrrrrr#,s 
��
zWeakMethod.__new__cs2t���}|��}|dks"|dkr&dS|�||�S�N)�super�__call__rr)rr%r&��	__class__rrr)Bs

zWeakMethod.__call__cCs:t|t�r6|jr|js||kSt�||�o4|j|jkSdSr)�
isinstancerrr�__eq__r�r�otherrrrr-Is

zWeakMethod.__eq__cCs:t|t�r6|jr|js||k	St�||�p4|j|jkSdS�NT)r,rrr�__ne__rr.rrrr1Ps

zWeakMethod.__ne__)N)�__name__�
__module__�__qualname__�	__slots__r#r)r-r1r�__hash__�
__classcell__rrr*rr$s
c@s�eZdZd+dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZeZdd�Z
d,dd�Zdd�Zdd�ZeZdd�Zdd �Zd!d"�Zd#d$�Zd-d%d&�Zd.d'd(�Zd)d*�ZdS)/rrcKs>t|�tfdd�}||_g|_t�|_i|_|j|f|�dS)NcSs6|�}|dk	r2|jr$|j�|j�n||j|j�dSr')�
_iterating�_pending_removals�append�key�data)�wr�selfrefZ_atomic_removalrrrr�removegs
z,WeakValueDictionary.__init__.<locals>.remove)rr	�_remover9�setr8r<�update)rr/�kwr?rrr�__init__fs	zWeakValueDictionary.__init__cCs(|j}|j}|r$|��}t||�qdSr')r9r<�popr	)r�l�dr;rrr�_commit_removalsws
z$WeakValueDictionary._commit_removalscCs4|jr|��|j|�}|dkr,t|��n|SdSr'�r9rHr<�KeyError�rr;�orrr�__getitem__�s
zWeakValueDictionary.__getitem__cCs|jr|��|j|=dSr')r9rHr<�rr;rrr�__delitem__�szWeakValueDictionary.__delitem__cCs|jr|��t|j�Sr')r9rH�lenr<�rrrr�__len__�szWeakValueDictionary.__len__cCs>|jr|��z|j|�}Wntk
r4YdSX|dk	SrrIrKrrr�__contains__�sz WeakValueDictionary.__contains__cCsd|jjt|�fS�Nz<%s at %#x>�r+r2�idrQrrr�__repr__�szWeakValueDictionary.__repr__cCs&|jr|��t||j|�|j|<dSr')r9rH�KeyedRefr@r<�rr;�valuerrr�__setitem__�szWeakValueDictionary.__setitem__c	CsV|jr|��t�}t|��0|j��D]\}}|�}|dk	r(|||<q(W5QRX|Sr')r9rHrrr<�items)r�newr;r=rLrrr�copy�s
zWeakValueDictionary.copyc	Csjddlm}|jr|��|��}t|��6|j��D]$\}}|�}|dk	r6|||||�<q6W5QRX|S�Nr)�deepcopy)r^r`r9rHr+rr<r\)r�memor`r]r;r=rLrrr�__deepcopy__�s
z WeakValueDictionary.__deepcopy__NcCsP|jr|��z|j|}Wntk
r4|YSX|�}|dkrH|S|SdSr'rI)rr;�defaultr=rLrrr�get�s
zWeakValueDictionary.getc	csR|jr|��t|��2|j��D] \}}|�}|dk	r"||fVq"W5QRXdSr'�r9rHrr<r\)r�kr=�vrrrr\�s
zWeakValueDictionary.itemsc	csJ|jr|��t|��*|j��D]\}}|�dk	r"|Vq"W5QRXdSr're)rrfr=rrr�keys�s

zWeakValueDictionary.keysc	cs6|jr|��t|��|j��EdHW5QRXdSr'�r9rHrr<�valuesrQrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc	csJ|jr|��t|��*|j��D]}|�}|dk	r"|Vq"W5QRXdSr'ri�rr=r%rrrrj�s
zWeakValueDictionary.valuescCs8|jr|��|j��\}}|�}|dk	r||fSqdSr')r9rHr<�popitem)rr;r=rLrrrrm�szWeakValueDictionary.popitemcGs`|jr|��z|j�|��}Wntk
r8d}YnX|dkrX|rN|dSt|��n|SdS)Nr)r9rHr<rErJ)rr;�argsrLrrrrEs

zWeakValueDictionary.popcCs`z|j|�}Wntk
r(d}YnX|dkrX|jr@|��t||j|�|j|<|S|SdSr')r<rJr9rHrXr@)rr;rcrLrrr�
setdefaults
zWeakValueDictionary.setdefaultcKsz|jr|��|j}|dk	rRt|d�s.t|�}|��D]\}}t||j|�||<q6|��D]\}}t||j|�||<qZdS�Nr\)r9rHr<�hasattr�dictr\rXr@)rr/�kwargsrGr;rLrrrrBs
zWeakValueDictionary.updatecCs|jr|��t|j���Sr')r9rH�listr<rjrQrrr�	valuerefs(s
zWeakValueDictionary.valuerefs)r)N)N)N)r2r3r4rDrHrMrOrRrSrWr[r^�__copy__rbrdr\rh�__iter__rkrjrmrErorBrurrrrrZs,
			
			

cs(eZdZdZdd�Z�fdd�Z�ZS)rX�r;cCst�|||�}||_|Sr')rr#r;)r"�obrr;rrrrr#CszKeyedRef.__new__cst��||�dSr')r(rD)rryrr;r*rrrDHszKeyedRef.__init__)r2r3r4r5r#rDr7rrr*rrX7s
rXc@s�eZdZd*dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZeZdd�Z
d+dd�Zdd�Zdd�Zdd�ZeZdd�Zd d!�Zd"d#�Zd$d%�Zd,d&d'�Zd-d(d)�ZdS).rNcCsFi|_t|�fdd�}||_g|_t�|_d|_|dk	rB|�|�dS)NcSs.|�}|dk	r*|jr"|j�|�n|j|=dSr')r8r9r:r<)rfr>rrrrr?Ys
z*WeakKeyDictionary.__init__.<locals>.removeF)r<rr@r9rAr8�
_dirty_lenrB)rrrr?rrrrDWszWeakKeyDictionary.__init__cCs:|j}|j}|r6z||��=Wqtk
r2YqXqdSr')r9r<rErJ)rrFrGrrrrHhsz"WeakKeyDictionary._commit_removalscs&|j��fdd�|jD�|_d|_dS)Ncsg|]}|�kr|�qSrr)�.0rf�rGrr�
<listcomp>wsz5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r<r9rzrQrr|r�_scrub_removalsusz!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dSr0)rzr<rrNrrrrOzszWeakKeyDictionary.__delitem__cCs|jt|�Sr')r<rrNrrrrM~szWeakKeyDictionary.__getitem__cCs(|jr|jr|��t|j�t|j�Sr')rzr9r~rPr<rQrrrrR�szWeakKeyDictionary.__len__cCsd|jjt|�fSrTrUrQrrrrW�szWeakKeyDictionary.__repr__cCs||jt||j�<dSr')r<rr@rYrrrr[�szWeakKeyDictionary.__setitem__c	CsHt�}t|��0|j��D]\}}|�}|dk	r|||<qW5QRX|Sr')rrr<r\)rr]r;rZrLrrrr^�s
zWeakKeyDictionary.copyc	Cs\ddlm}|��}t|��6|j��D]$\}}|�}|dk	r(|||�||<q(W5QRX|Sr_)r^r`r+rr<r\)rrar`r]r;rZrLrrrrb�s
zWeakKeyDictionary.__deepcopy__cCs|j�t|�|�Sr')r<rdr�rr;rcrrrrd�szWeakKeyDictionary.getcCs.zt|�}Wntk
r"YdSX||jkSr)rr r<)rr;r=rrrrS�s
zWeakKeyDictionary.__contains__c	csDt|��2|j��D] \}}|�}|dk	r||fVqW5QRXdSr'�rr<r\)rr=rZr;rrrr\�s

zWeakKeyDictionary.itemsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr')rr<rlrrrrh�s


zWeakKeyDictionary.keysc	cs<t|��*|j��D]\}}|�dk	r|VqW5QRXdSr'r�)rr=rZrrrrj�s

zWeakKeyDictionary.valuescCs
t|j�Sr')rtr<rQrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCs0d|_|j��\}}|�}|dk	r||fSqdSr0)rzr<rm)rr;rZrLrrrrm�s
zWeakKeyDictionary.popitemcGsd|_|jjt|�f|��Sr0)rzr<rEr)rr;rnrrrrE�szWeakKeyDictionary.popcCs|j�t||j�|�Sr')r<rorr@rrrrro�szWeakKeyDictionary.setdefaultcKs\|j}|dk	rFt|d�s$ti�|�}|��D]\}}||t||j�<q,t|�rX|�|�dSrp)r<rqr"r\rr@rPrB)rrrrsrGr;rZrrrrB�s
zWeakKeyDictionary.update)N)N)N)N)r2r3r4rDrHr~rOrMrRrWr[r^rvrbrdrSr\rhrwrjr�rmrErorBrrrrrLs,

	


c@s�eZdZdZiZdZe��ZdZ	dZ
Gdd�d�Zdd�Zde_
dd	d
�Zdd�Zd
d�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��ZdS)rrFc@seZdZdZdS)zfinalize._Info)�weakrefr&rnrs�atexit�indexN)r2r3r4r5rrrr�_Infosr�cOs>t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|js�ddl}|�	|j
�dt_|��}t
||�|_||_||_|�pd|_d|_t|j�|_||j|<dt_dS)
N�z<descriptor '__init__' of 'finalize' object needs an argumentr&z9finalize expected at least 2 positional arguments, got %d��rz0Passing 'func' as keyword argument is deprecated)�
stacklevelr%z/Passing 'obj' as keyword argument is deprecatedT)rPr rE�warnings�warn�DeprecationWarning�tuple�_registered_with_atexitr��register�	_exitfuncrr�rr�r&rnrs�next�_index_iterr��	_registry�_dirty)rnrsrr%r&r�r��inforrrrDsR

�

�
�
�
zfinalize.__init__z&($self, obj, func, /, *args, **kwargs)NcCs0|j�|d�}|r,|js,|j|j|jp(i�SdSr')r�rE�	_shutdownr&rnrs)r�_r�rrrr)1s
zfinalize.__call__cCsH|j�|�}|o|��}|dk	rD|j�|d�rD||j|j|jp@ifSdSr')r�rdr�rEr&rnrs�rr�r%rrr�detach8szfinalize.detachcCs:|j�|�}|o|��}|dk	r6||j|j|jp2ifSdSr')r�rdr�r&rnrsr�rrr�peek@sz
finalize.peekcCs
||jkSr')r�rQrrr�aliveHszfinalize.alivecCs|j�|�}t|�o|jSr'�r�rd�boolr�)rr�rrrr�Mszfinalize.atexitcCs|j�|�}|rt|�|_dSr'r�)rrZr�rrrr�SscCs^|j�|�}|o|��}|dkr6dt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)r�rdr�r"r2rVr�rrrrWYs�zfinalize.__repr__cCs2dd�|j��D�}|jdd�d�dd�|D�S)NcSsg|]\}}|jr||f�qSr)r��r{�f�irrrr}esz-finalize._select_for_exit.<locals>.<listcomp>cSs
|djS)Nr�)r�)�itemrrr�<lambda>f�z+finalize._select_for_exit.<locals>.<lambda>rxcSsg|]\}}|�qSrrr�rrrr}gs)r�r\�sort)r$�Lrrr�_select_for_exitbszfinalize._select_for_exitcCs�d}z�|jr�ddl}|��r(d}|��d}|dks:tjrH|��}dt_|sNq�|�	�}z
|�Wq,t
k
r�tjt�
��Yq,Xq,W5dt_|r�|��XdS)NFTr)rr�Zenabler��gcZ	isenabledZdisabler�r�rE�	Exception�sys�
excepthook�exc_info)r$Zreenable_gcr�Zpendingr�rrrr�is,
zfinalize._exitfunc)N)r2r3r4r5r�r��	itertools�countr�r�r�r�rD�__text_signature__r)r�r��propertyr�r��setterrW�classmethodr�r�rrrrr�s.*



	
)�_weakrefrrrrrrrr	Z_weakrefsetr
r�_collections_abcr�r�r
�__all__r�MutableMappingrrXrrrrrr�<module>s.(
�6^csv.cpython-38.opt-1.pyc000064400000027210151450073350010733 0ustar00U

e5d?�@s@dZddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZdddd	d
ddd
dddddddddddddgZGdd�d�ZGdd
�d
e�Zed
e�Gdd�de�Zede�Gdd�de�Zed e�Gd!d�d�ZGd"d�d�ZzeWnek
�r,eZYnXGd#d�d�ZdS)$z+
csv.py - read/write/investigate CSV files
�N)�Error�__version__�writer�reader�register_dialect�unregister_dialect�get_dialect�
list_dialects�field_size_limit�
QUOTE_MINIMAL�	QUOTE_ALL�QUOTE_NONNUMERIC�
QUOTE_NONE�__doc__)�Dialect)�StringIOrrr
rrrr�excel�	excel_tabr
rrrrr	�Snifferrr�
DictReader�
DictWriter�unix_dialectc@sDeZdZdZdZdZdZdZdZdZ	dZ
dZdZdd�Z
dd�ZdS)	rz�Describe a CSV dialect.

    This must be subclassed (see csv.excel).  Valid attributes are:
    delimiter, quotechar, escapechar, doublequote, skipinitialspace,
    lineterminator, quoting.

    �FNcCs|jtkrd|_|��dS)NT)�	__class__r�_valid�	_validate��self�r�/usr/lib64/python3.8/csv.py�__init__*s
zDialect.__init__c
Cs@zt|�Wn.tk
r:}ztt|���W5d}~XYnXdS�N)�_Dialect�	TypeErrorr�str)r�errrr/szDialect._validate)�__name__�
__module__�__qualname__r�_namer�	delimiter�	quotecharZ
escapechar�doublequote�skipinitialspace�lineterminator�quotingr rrrrrrsc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz;Describe the usual properties of Excel-generated CSV files.�,�"TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrr6sc@seZdZdZdZdS)rzEDescribe the usual properties of Excel-generated TAB-delimited files.�	N)r&r'r(rr*rrrrr@sz	excel-tabc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz:Describe the usual properties of Unix-generated CSV files.r0r1TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrrEsZunixc@s@eZdZddd�Zdd�Zedd��Zejd	d��Zd
d�ZdS)
rNrcOs6||_||_||_t||f|�|�|_||_d|_dS�Nr)�_fieldnames�restkey�restvalr�dialect�line_num)r�f�
fieldnamesr7r8r9�args�kwdsrrrr QszDictReader.__init__cCs|Sr!rrrrr�__iter__ZszDictReader.__iter__cCs@|jdkr0zt|j�|_Wntk
r.YnX|jj|_|jSr!)r6�nextr�
StopIterationr:rrrrr<]s

zDictReader.fieldnamescCs
||_dSr!)r6)r�valuerrrr<gscCs�|jdkr|jt|j�}|jj|_|gkr8t|j�}q$tt|j|��}t|j�}t|�}||krv||d�||j<n&||kr�|j|d�D]}|j||<q�|Sr5)	r:r<r@r�dict�zip�lenr7r8)r�row�dZlfZlr�keyrrr�__next__ks



zDictReader.__next__)NNNr)	r&r'r(r r?�propertyr<�setterrIrrrrrPs�
	
	
c@s6eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rr�raisercOsB||_||_|��dkr$td|��||_t||f|�|�|_dS)N)rL�ignorez-extrasaction (%s) must be 'raise' or 'ignore')r<r8�lower�
ValueError�extrasactionr)rr;r<r8rPr9r=r>rrrr �s�zDictWriter.__init__cCstt|j|j��}|�|�Sr!)rCrDr<�writerow)r�headerrrr�writeheader�szDictWriter.writeheadercsN�jdkr8����j}|r8tdd�dd�|D������fdd��jD�S)NrLz(dict contains fields not in fieldnames: z, cSsg|]}t|��qSr)�repr)�.0�xrrr�
<listcomp>�sz,DictWriter._dict_to_list.<locals>.<listcomp>c3s|]}��|�j�VqdSr!)�getr8)rUrH��rowdictrrr�	<genexpr>�sz+DictWriter._dict_to_list.<locals>.<genexpr>)rP�keysr<rO�join)rrZZwrong_fieldsrrYr�
_dict_to_list�s
�zDictWriter._dict_to_listcCs|j�|�|��Sr!)rrQr^)rrZrrrrQ�szDictWriter.writerowcCs|j�t|j|��Sr!)r�	writerows�mapr^)rZrowdictsrrrr_�szDictWriter.writerowsN)rrLr)r&r'r(r rSr^rQr_rrrrr�s�

c@s:eZdZdZdd�Zd
dd�Zdd�Zd	d
�Zdd�ZdS)rze
    "Sniffs" the format of a CSV file (i.e. delimiter, quotechar)
    Returns a Dialect object.
    cCsdddddg|_dS)Nr0r3�;� �:)�	preferredrrrrr �szSniffer.__init__NcCsd|�||�\}}}}|s(|�||�\}}|s4td��Gdd�dt�}||_||_|pVd|_||_|S)zI
        Returns a dialect (or None) corresponding to the sample
        zCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff.<locals>.dialectZsniffedr2N)r&r'r(r)r.rr/rrrrr9�sr9r1)�_guess_quote_and_delimiter�_guess_delimiterrrr,r*r+r-)r�sample�
delimitersr+r,r*r-r9rrr�sniff�s
�
�
z
Sniffer.sniffc	Cs�g}dD]*}t�|tjtjB�}|�|�}|rq4q|s<dSi}i}d}|j}	|D]�}
|	dd}|
|}|r�|�|d�d||<z|	dd}|
|}Wntk
r�YqRYnX|r�|dks�||kr�|�|d�d||<z|	dd}Wntk
�rYqRYnX|
|rR|d7}qRt||jd	�}
|�rXt||jd	�}|||k}|d
k�r`d}nd}d}t�dt�	|�|
d
�tj�}|�
|��r�d}nd}|
|||fS)a�
        Looks for text enclosed between two identical quotes
        (the probable quotechar) which are preceded and followed
        by the same character (the probable delimiter).
        For example:
                         ,'some text',
        The quote with the most wins, same with the delimiter.
        If there is no quotechar the delimiter can't be determined
        this way.
        )zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n))rFNrr�quote��delimNZspace�rHr4rz]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rlrjTF)�re�compile�DOTALL�	MULTILINE�findall�
groupindexrX�KeyError�max�escape�search)r�datarhZmatchesZrestrZregexpZquotes�delimsZspacesrs�m�nrHr+rlr-Z	dq_regexpr,rrrre�s`




��z"Sniffer._guess_quote_and_delimitercCsttd|�d���}dd�td�D�}tdt|��}d}i}i}i}d|}	}
|	t|�k�rR|d7}||	|
�D]@}|D]6}|�|i�}
|�|�}|
�|d�d|
|<|
||<qxqp|��D]�}t||�	��}t|�dkr�|dddkr�q�t|�dk�rLt
|d	d
�d�||<|�||�||d||dtdd
�|D��f||<q�|d||<q�|�	�}t
t||t|���}d}d}t|�dk�r�||k�r�|D]T\}}|ddk�r�|ddk�r�|d||k�r�|dk�s�||k�r�|||<�q�|d8}�q�t|�dk�rDt|���d}|d�|�|d�d|�k}||fS|
}	|
|7}
qN|�s\dSt|�dk�r�|jD]@}||��k�rp|d�|�|d�d|�k}||fS�qpdd�|�	�D�}|��|dd}|d�|�|d�d|�k}||fS)a�
        The delimiter /should/ occur the same number of times on
        each row. However, due to malformed data, it may not. We don't want
        an all or nothing approach, so we allow for small variations in this
        number.
          1) build a table of the frequency of each character on every line.
          2) build a table of frequencies of this frequency (meta-frequency?),
             e.g.  'x occurred 5 times in 10 rows, 6 times in 1000 rows,
             7 times in 2 rows'
          3) use the mode of the meta-frequency to determine the /expected/
             frequency for that character
          4) find out how often the character actually meets that goal
          5) the character that best meets its goal is the delimiter
        For performance reasons, the data is evaluated in chunks, so it can
        try and evaluate the smallest portion of the data possible, evaluating
        additional chunks as necessary.
        Nr4cSsg|]}t|��qSr)�chr)rU�crrrrW-sz,Sniffer._guess_delimiter.<locals>.<listcomp>��
rrkcSs|dS)Nrkr)rVrrr�<lambda>G�z*Sniffer._guess_delimiter.<locals>.<lambda>rmcss|]}|dVqdS)rkNr)rU�itemrrrr[Lsz+Sniffer._guess_delimiter.<locals>.<genexpr>g�?g�������?g{�G�z�?z%c )rrcSsg|]\}}||f�qSrr)rU�k�vrrrrWvs���)�list�filter�split�range�minrErX�countr\�itemsru�remove�sum�floatrd�sort)rrxrh�asciiZchunkLengthZ	iterationZ
charFrequencyZmodesry�start�end�line�charZ
metaFrequencyZfreqr�ZmodeListZtotalZconsistencyZ	thresholdr�r�rlr-rGrrrrfs�

����

��zSniffer._guess_delimiterc
Cs�tt|�|�|��}t|�}t|�}i}t|�D]}d||<q0d}|D]�}|dkrVq�|d7}t|�|krlqFt|���D]x}	tt	t
fD]4}
z|
||	�Wq�Wq�ttfk
r�Yq�Xq�t||	�}
|
||	krx||	dkr�|
||	<qx||	=qxqFd}|�
�D]~\}	}t|�td�k�r@t||	�|k�r6|d7}n|d8}n<z|||	�Wn"ttfk
�rr|d7}Yn
X|d8}�q|dkS)Nr�rk)rrrir@rEr�r�r\�intr��complexrO�
OverflowErrorr��typer#)
rrgZrdrrR�columnsZcolumnTypes�i�checkedrF�colZthisTypeZ	hasHeaderZcolTyperrr�
has_headersJ






zSniffer.has_header)N)	r&r'r(rr rirerfr�rrrrr�s
Lg)rrnZ_csvrrrrrrrr	r
rrr
rrr"�ior�__all__rrrrrr��	NameErrorr�rrrrr�<module>sJ@�


2
typing.cpython-38.opt-2.pyc000064400000131071151450073350011454 0ustar00U

e5db
�G@s�ddlmZmZddlZddlZddlZddlZddlZddlZ	ddl
Z
ddlZddlmZm
Z
mZdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJgGZd�dLdM�ZdNdO�ZdPdQ�ZdRdS�ZdTdU�ZdVdW�ZgZdXdY�ZdZd[�ZGd\d]�d]�ZGd^d_�d_�ZGd`da�daeedKdb�Zeddcdd�ZedFdedd�Zeddfdd�Zeddgdd�Zeddhdd�Z eddidd�Z!ed
djdd�Z"Gdkd�dedKdb�Z#Gdld�deedKdb�Z$d6d
d4d8d9d3d5dddm�	Z%dndo�Z&Gdpdq�dqedKdb�Z'Gdrds�dse'dKdb�Z(Gdtd	�d	�Z)Gdudv�dv�Z*Gdwdx�dx�Z+dydzd{d|d}gZ,d~dd�d�d�d�d�d�d�d�g
Z-e,e-d�gZ.d�d��Z/d�d��Z0d�d��Z1d�d��Z2dd"ddd$dd dd&d)g
d�d�gd��Z3Gd�d��d�e�Z4Gd�d�de)e4d��Z5d�dH�Z6d�d>�Z7d�d��Z8ej9ej:ej;ej<ee
efZ=d�d�dB�Z>d�dA�Z?d�d@�Z@d�dD�ZAd�dE�ZBd�d��ZCd�dG�ZDd�d?�ZEe$d��ZFe$d��ZGe$d��ZHe$d�dKd��ZIe$d�dKd��ZJe$d�dKd��ZKe$d�dKd��ZLe$d�dKeMd��ZNe$d=eOeP�ZQd�d�d��ZReRejjSd��ZSeRejjTeI�ZTeRejjUeIeLeJf�ZUeRejjVeI�ZVeRejjWeI�ZWeRejjXeI�ZXeRejjYeI�ZYeRejjZeI�ZZeRejj[d��Z[eRejj\eI�Z\eRejj]eI�Z]e(ejj^d�dKd��Z^d�e^__eRejj`eI�ZaeRejjbeF�ZbeRejjceGeKf�ZceRejjdeGeHf�ZdeRejjeeI�ZeeRejjfeF�ZfeRejjgd��Zge(ehd�d�dKd��Zid�ei__eRejeFd�d��ZkeRejleF�ZmeReneFd�d��Z`eReoeId�d��ZpeRejjqeI�ZqeRejjreG�ZreRejjseGeKf�ZseRejjteK�ZteRejueI�ZveRejweI�ZxeReyeGeHfd�d��ZzeRej{eGeHf�Z|eRej}eGeHf�Z}eRej~eF�Z~eRejeGeHf�ZeRejj�eIeLeJf�Z�eRejj�eIeLf�Z�eReMeNd�d��Z�d�e�__e6Gd�d/�d/e5��Z�e6Gd�d-�d-e5��Z�e6Gd�d,�d,e5��Z�e6Gd�d+�d+e5��Z�e6Gd�d.�d.e5��Z�e6Gd�d*�d*e5eI��Z�e6Gd�d0�d0e5eI��Z�d�d„Z�d�Z�d�Z�Gd�dƄd�eM�Z�Gd�d:�d:e�d��Z�d�dɄZ�d�dKdʜd�d̄Z�d�d΄Z�Gd�dЄd�eM�Z�Gd�d;�d;eye�d��Z�d�dC�Z�ePZ�d�Z�Gd�dԄd�e)eQ�Z�Gd�dքd�e�eO�Z�Gd�d؄d�e�eP�Z�Gd�dڄdڃZ�e�d�e�_�e�e
j�e�j�<eRe	j�eQ�Z�eRe	j�eQ�Z�Gd�d݄d݃Ze�d�e_�ee
j�ej�<dS)��)�abstractmethod�ABCMetaN)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�Any�Callable�ClassVar�Final�
ForwardRef�Generic�Literal�Optional�Protocol�Tuple�Type�TypeVar�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�AnyStr�cast�final�get_args�
get_origin�get_type_hints�NewType�
no_type_check�no_type_check_decorator�NoReturn�overload�runtime_checkable�Text�
TYPE_CHECKINGTcCs�ttf}|r|ttf}|dkr(td�St|t�r:t|�St|t�r\|j	|kr\t
|�d���t|t�rr|tt
fks~|ttfkr�t
d|�d���t|tttf�r�|St|�s�t
|�d|d�d���|S)Nz is not valid as type argumentzPlain z Got z.100�.)rrr	r
�type�
isinstance�strr�
_GenericAlias�
__origin__�	TypeError�_SpecialFormrrIr�callable)�arg�msg�is_argumentZinvalid_generic_forms�rZ�/usr/lib64/python3.8/typing.py�_type_checkxs(

�
�r\cCsRt|t�r,|jdkr|jS|j�d|j��S|dkr8dSt|tj�rJ|jSt|�S)N�builtinsrN.z...)rPrO�
__module__�__qualname__�types�FunctionType�__name__�repr)�objrZrZr[�
_type_repr�s

recs\g�|D]J}t|t�r(|�kr(��|�t|t�r|js���fdd�|jD��qt��S)Ncsg|]}|�kr|�qSrZrZ��.0�t��tvarsrZr[�
<listcomp>�sz&_collect_type_vars.<locals>.<listcomp>)rPr�appendrR�_special�extend�__parameters__�tuple)r`rhrZrir[�_collect_type_vars�s
rqcCs�t|t�s|St|j�}t|j�D]J\}}t|t�r\t|�D]\}}||kr<||||<q<q"t|||�||<q"|jtkr�tt	|�S|�
t	|��S�N)rPrR�list�__args__�	enumerater�_subs_tvarsrSrrp�	copy_with)�tprjZsubsZnew_args�arW�iZtvarrZrZr[rv�s



rvc	Cs^|jst|�d���t|�}t|j�}||krZtd||kr>dnd�d|�d|�d|����dS)Nz is not a generic classzToo ZmanyZfewz parameters for z	; actual z, expected )rorT�len)�cls�
parametersZalenZelenrZrZr[�_check_generic�s
r~cCs�g}|D]f}t|t�r.|jtkr.|�|j�qt|t�rdt|�dkrd|dtkrd|�|dd��q|�|�qt	|�}t|�t|�kr�g}|D] }||kr�|�|�|�
|�q�|}t|�S)Nr�)rPrRrSrrnrtrpr{rl�set�remove)r}�params�pZ
all_paramsZ
new_paramsrhrZrZr[�_remove_dups_flatten�s "
r�cs4t�����t��j�t�����fdd��}|S)Ncs,z�||�WStk
r YnX�||�Srr�rT��args�kwds��cached�funcrZr[�inner�s
z_tp_cache.<locals>.inner)�	functools�	lru_cache�	_cleanupsrl�cache_clear�wraps)r�r�rZr�r[�	_tp_cache�s
r�csbt|t�r|����St|t�r^t��fdd�|jD��}||jkrH|S|�|�}|j|_|S|S)Nc3s|]}t|���VqdSrr)�
_eval_type�rgry��globalns�localnsrZr[�	<genexpr>sz_eval_type.<locals>.<genexpr>)rPr�	_evaluaterRrprtrwrm)rhr�r�Zev_args�resrZr�r[r�	s



r�c@seZdZdZdd�ZdS)�_Final)�__weakref__cOsd|krtd��dS)N�_rootz&Cannot subclass special typing classesr���selfr�r�rZrZr[�__init_subclass__sz_Final.__init_subclass__N)rbr^r_�	__slots__r�rZrZrZr[r�sr�c@seZdZdd�Zdd�ZdS)�
_ImmutablecCs|SrrrZ�r�rZrZr[�__copy__%sz_Immutable.__copy__cCs|SrrrZ)r�ZmemorZrZr[�__deepcopy__(sz_Immutable.__deepcopy__N)rbr^r_r�r�rZrZrZr[r�"sr�csleZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
dd��Z�ZS)rU��_nameZ_doccsBt|�dkr6t|dt�r6t|dt�r6td|����t��|�S)N�rrzCannot subclass )r{rPrQrprT�super�__new__)r|r�r���	__class__rZr[r�3s��z_SpecialForm.__new__cCs||_||_dSrrr�)r��name�docrZrZr[�__init__@sz_SpecialForm.__init__cCst|t�stS|j|jkSrr)rPrU�NotImplementedr��r��otherrZrZr[�__eq__Ds
z_SpecialForm.__eq__cCst|jf�Srr)�hashr�r�rZrZr[�__hash__Isz_SpecialForm.__hash__cCs
d|jS)N�typing.�r�r�rZrZr[�__repr__Lsz_SpecialForm.__repr__cCs|jSrrr�r�rZrZr[�
__reduce__Osz_SpecialForm.__reduce__cOstd|����dS)NzCannot instantiate r�r�rZrZr[�__call__Rsz_SpecialForm.__call__cCst|�d���dS)Nz! cannot be used with isinstance()r��r�rdrZrZr[�__instancecheck__Usz_SpecialForm.__instancecheck__cCst|�d���dS)Nz! cannot be used with issubclass()r��r�r|rZrZr[�__subclasscheck__Xsz_SpecialForm.__subclasscheck__cs�|jdkr(t||j�d��}t||f�S|jdkr�|dkrBtd��t|t�sR|f}d�t�fdd�|D��}t|�}t|�d	kr�|d
St||�S|jdkr�t|d�}t|t	d�fS|jd
kr�t||�St|�d���dS)N)r	r
z accepts only single type.rrZz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3s|]}t|��VqdSrr�r\�rgr��rXrZr[r�fsz+_SpecialForm.__getitem__.<locals>.<genexpr>rrrz#Optional[t] requires a single type.r
z is not subscriptable)
r�r\rRrTrPrpr�r{rrO)r�r}�itemrWrZr�r[�__getitem__[s(







z_SpecialForm.__getitem__)rbr^r_r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rZrZr�r[rU,s
rU)r�a`Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    )r�aSpecial type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    a3Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    a'Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    zEOptional type.

    Optional[X] is equivalent to Union[X, None].
    a�Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

   Literal[...] cannot be subclassed. At runtime, an arbitrary value
   is allowed as type argument to Literal[...], but type checkers may
   impose restrictions.
    c@s:eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__TcCsnt|t�std|����zt|dd�}Wn"tk
rJtd|����YnX||_||_d|_d|_||_	dS)Nz*Forward reference must be a string -- got z<string>�evalz/Forward reference must be an expression -- got F)
rPrQrT�compile�SyntaxErrorr�r�r�r�r�)r�rWrY�coderZrZr[r��s
zForwardRef.__init__cCsj|jr||k	rd|dkr(|dkr(i}}n|dkr6|}n|dkrB|}tt|j||�d|jd�|_d|_|jS)Nz*Forward references must evaluate to types.�rYT)r�r\r�r�r�r�)r�r�r�rZrZr[r��s
�zForwardRef._evaluatecCs>t|t�stS|jr2|jr2|j|jko0|j|jkS|j|jkSrr)rPrr�r�r�r�r�rZrZr[r�s

�zForwardRef.__eq__cCs
t|j�Srr)r�r�r�rZrZr[r�szForwardRef.__hash__cCsd|j�d�S)NzForwardRef(�))r�r�rZrZr[r�szForwardRef.__repr__N)T)	rbr^r_r�r�r�r�r�r�rZrZrZr[r�s

c@s2eZdZdZdddd�dd�Zdd�Zd	d
�ZdS)r)rb�	__bound__�__constraints__�
__covariant__�__contravariant__NF)�bound�	covariant�
contravariantc	s�||_|r|rtd��t|�|_t|�|_|r>|dk	r>td��|rVt|�dkrVtd��d�t�fdd�|D��|_|r�t	|d�|_
nd|_
zt�d�j
�d	d
�}Wnttfk
r�d}YnX|dkr�||_dS)Nz"Bivariant types are not supported.z-Constraints cannot be combined with bound=...rz"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|��VqdSrrr�rfr�rZr[r�Vsz#TypeVar.__init__.<locals>.<genexpr>zBound must be a type.rb�__main__�typing)rb�
ValueError�boolr�r�rTr{rpr�r\r��sys�	_getframe�	f_globals�get�AttributeErrorr^)r�r�r�r�r�ZconstraintsZdef_modrZr�r[r�Js(


zTypeVar.__init__cCs&|jrd}n|jrd}nd}||jS)N�+�-�~)r�r�rb)r��prefixrZrZr[r�bszTypeVar.__repr__cCs|jSrr)rbr�rZrZr[r�kszTypeVar.__reduce__)rbr^r_r�r�r�r�rZrZrZr[rs,�	)	rsrp�dictr��	frozenset�deque�defaultdictrOr;cCs|�d�o|�d�S)N�__)�
startswith�endswith)�attrrZrZr[�
_is_dunder�sr�cs�eZdZdddd�dd�Zedd��Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Z�fdd�Z
dd�Zdd�Zdd�Z�ZS)rRTFN)�inst�specialr�cCsz||_||_|r*|dkr*|j}t�||�}||_t|t�s@|f}||_tdd�|D��|_	t
|�|_d|_|sv|j
|_
dS)Ncss*|]"}|tkrdn|tkrdn|VqdS).rZN)�_TypingEllipsis�_TypingEmptyr�rZrZr[r��s�z)_GenericAlias.__init__.<locals>.<genexpr>)�_instrmrb�_normalize_aliasr�r�rPrprSrtrqror�r^)r��originr�r�r�r�Z	orig_namerZrZr[r��s 
�

z_GenericAlias.__init__cs^|jttfkrtd|����t|t�s,|f}d�t�fdd�|D��}t||�t||j|�S)Nz%Cannot subscript already-subscripted �*Parameters to generic types must be types.c3s|]}t|��VqdSrrr�r�r�rZr[r��sz,_GenericAlias.__getitem__.<locals>.<genexpr>)	rSrrrTrPrpr~rvro�r�r�rZr�r[r��s

z_GenericAlias.__getitem__cCst|j||j|jd�S)N)r�r�)rRrSr�r�r�rZrZr[rw�sz_GenericAlias.copy_withcCs�|jdks&t|j�dkrx|jdtkrx|jr8d|j}n
t|j�}|jshdd�dd�|jD���d	�}nd
}|�|��S|jr�dSdd�d
d�|jdd�D���dt|jd��d	�S)Nr�rr��[�, cSsg|]}t|��qSrZ�rer�rZrZr[rk�sz*_GenericAlias.__repr__.<locals>.<listcomp>�]�ztyping.Callableztyping.Callable[[cSsg|]}t|��qSrZr�r�rZrZr[rk�s���z], )r�r{rt�EllipsisrerSrm�join)r�r�r�rZrZr[r��s
��
 z_GenericAlias.__repr__cCsRt|t�stS|j|jkrdS|jtkrF|jtkrFt|j�t|j�kS|j|jkS)NF)rPrRr�rSrr�rtr�rZrZr[r��s
z_GenericAlias.__eq__cCs,|jtkrttt|j�f�St|j|jf�Srr)rSrr�r�rtr�rZrZr[r��s
z_GenericAlias.__hash__cOsT|js$td|j�d|j���d���|j||�}z
||_Wntk
rNYnX|S)N�Type z cannot be instantiated; use z
() instead)r�rTr��lowerrS�__orig_class__r�)r�r��kwargs�resultrZrZr[r��s
z_GenericAlias.__call__cCs�|jrZg}|j|kr |�|j�|�|�}tdd�||dd�D��sR|�t�t|�S|jtkr�t|krpdS|�|�}||dd�D]}t|t	�r�||k	r�dSq�|jfS)Ncss"|]}t|t�pt|t�VqdSrr)rPrR�
issubclassr�rg�brZrZr[r��s�z0_GenericAlias.__mro_entries__.<locals>.<genexpr>rrZ)
r�rSrl�index�anyrrprrPrR)r��basesr�rzrrZrZr[�__mro_entries__�s$

�


z_GenericAlias.__mro_entries__cCs*d|jkrt|�st|j|�St|��dS)NrS)�__dict__r��getattrrSr�)r�r�rZrZr[�__getattr__�sz_GenericAlias.__getattr__cs2t|�s|dkr t��||�nt|j||�dS)N)r�r�rm)r�r��__setattr__�setattrrS)r�r��valr�rZr[r�sz_GenericAlias.__setattr__cCs|�t|��Srr)r�rOr�rZrZr[r�sz_GenericAlias.__instancecheck__cCs<|jr0t|t�st||j�S|jr0t|j|j�Std��dS)NzBSubscripted generics cannot be used with class and instance checks)rmrPrRrrSrTr�rZrZr[r�s
z_GenericAlias.__subclasscheck__cCs�|jr|jS|jr t�|j}n|j}|tkrht|j�dkrJ|jdtksht|jdd��|jdf}n*t	|j�}t|�dkr�t
|dt	�s�|\}tj||ffS)Nr�rr�r)
rmr��globalsrSrr{rtr�rsrprP�operator�getitem)r�r�r�rZrZr[r�s��
z_GenericAlias.__reduce__)rbr^r_r�r�r�rwr�r�r�r�r
r
rr�r�r�r�rZrZr�r[rR�s	
		rRcs(eZdZdd�Ze�fdd��Z�ZS)�_VariadicGenericAliascCs�|jdks|js|�|�St|t�r0t|�dkr8td��|\}}|tkrRt|f}n$t|t�sjtd|����t|�|f}|�|�S)Nrr�z6Callable must be used as Callable[[arg, ...], result].z1Callable[args, result]: args must be a list. Got )	r�rm�__getitem_inner__rPrpr{rTr�rs)r�r�r�rrZrZr[r�"s


z!_VariadicGenericAlias.__getitem__cs
|jtkr�|jr�|dkr$|�tf�St|t�s4|f}t|�dkrl|ddkrld�t|d��}|�|tf�Sd�t�fdd	�|D��}|�|�S|jt	j
jkr�|jr�|\}}d
�t|��}|tkr�|�t|f�Sd�t�fdd	�|D��}||f}|�|�St
��|�S)
NrZr�r.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|��VqdSrrr�r�r�rZr[r�>sz:_VariadicGenericAlias.__getitem_inner__.<locals>.<genexpr>z.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|��VqdSrrr�)rgrWr�rZr[r�Gs)rSrprmrwr�rPr{r\r��collections�abcrr�r�r�)r�r�r�r�rr�r�r[r2s.




z'_VariadicGenericAlias.__getitem_inner__)rbr^r_r�r�rr�rZrZr�r[rsrcs<eZdZdZdZ�fdd�Zedd��Z�fdd�Z�Z	S)	rrZFcs^|ttfkrtd|j�d���t�jtjkrF|jtjk	rFt��|�}nt�j|f|�|�}|S)Nr�z< cannot be instantiated; it can be used only as a base class)rrrTrbr�r��objectr�)r|r�r�rdr�rZr[r�dszGeneric.__new__cs�t|t�s|f}|s.|tk	r.td|j�d���d�t�fdd�|D��}|ttfkr�tdd�|D��sxtd|j�d���t	t
|��t	|�kr�td|j�d	���n
t||�t||�S)
NzParameter list to z[...] cannot be emptyr�c3s|]}t|��VqdSrrr�r�r�rZr[r�vsz,Generic.__class_getitem__.<locals>.<genexpr>css|]}t|t�VqdSrr)rPrr�rZrZr[r�yszParameters to z [...] must all be type variablesz[...] must all be unique)
rPrprrTr_rr�allrbr{r�r~rR)r|r�rZr�r[�__class_getitem__ns&
���
zGeneric.__class_getitem__c
s
t�j||�g}d|jkr(t|jk}nt|jko:|jdk}|rHtd��d|jkr�t|j�}d}|jD].}t	|t
�rf|jtkrf|dk	r�td��|j}qf|dk	r�t
|�}t
|��|�ks�d��fdd�|D��}d�dd�|D��}	td	|�d
|	�d���|}t|�|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.r�c3s|]}|�krt|�VqdSrr�rQrf�ZgvarsetrZr[r��sz,Generic.__init_subclass__.<locals>.<genexpr>css|]}t|�VqdSrrr)rg�grZrZr[r��szSome type variables (z) are not listed in Generic[r�)r�r�rrr�	__bases__rbrTrqrPrRrSror�r�rp)
r|r�rrj�errorZgvars�baseZtvarsetZs_varsZs_argsr�rr[r��s8




��zGeneric.__init_subclass__)
rbr^r_r��_is_protocolr�r�rr�r�rZrZr�r[rMs

c@seZdZdS)r�N�rbr^r_rZrZrZr[r��sr�c@seZdZdS)r�Nr#rZrZrZr[r��sr�rorrr"�_is_runtime_protocol�__abstractmethods__�__annotations__r�__doc__r�r^r�r��__subclasshook__r��_MutableMapping__markercCsrt�}|jdd�D]X}|jdkr$qt|di�}t|j���t|���D] }|�d�sJ|tkrJ|�	|�qJq|S)Nr�)rrr&Z_abc_)
r��__mro__rbrrsr�keysr��EXCLUDED_ATTRIBUTES�add)r|�attrsr!�annotationsr�rZrZr[�_get_protocol_attrs�s
r0cst�fdd�t��D��S)Nc3s|]}tt�|d��VqdSrr)rVr�rgr��r|rZr[r��sz,_is_callable_members_only.<locals>.<genexpr>)rr0r2rZr2r[�_is_callable_members_only�sr3cOst|�jrtd��dS)Nz Protocols cannot be instantiated)rOr"rT)r�r�rrZrZr[�_no_init�s
r4c	Cs6zt�d�jddkWSttfk
r0YdSXdS)Nr�rb)rr�T)r�r�r�r�r�rZrZrZr[�_allow_reckless_class_cheks�sr5�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibcseZdZ�fdd�Z�ZS)�
_ProtocolMetacsVt�dd�rt��r$t�j��r$dS�jrJt��fdd�t��D��rJdSt����S)Nr"FTc3s8|]0}t�|�o.tt�|d��p.t�|�dk	VqdSrr)�hasattrrVrr1�r|�instancerZr[r��s�
z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)	rr3rr�r"rr0r�r�r;r�r;r[r��s�
��z_ProtocolMeta.__instancecheck__)rbr^r_r�r�rZrZr�r[r9�sr9cs(eZdZdZdZdZ�fdd�Z�ZS)rrZTFcs�t�j||��j�dd�s2tdd��jD���_�fdd�}d�jkrN|�_�jsXdS�jD]F}|tt	fks^|j
tkr�|jt|j
ks^t
|t	�r�|js^td|��q^t�_dS)	Nr"Fcss|]}|tkVqdSrr)rrrZrZr[r�)sz-Protocol.__init_subclass__.<locals>.<genexpr>cs��j�dd�stSt�dd�s0t�r(tStd��t��sJt�rBtStd��t|t�s\td��t	��D]v}|j
D]b}||jkr�|j|dkr�tSqdt|di�}t|tjj
�rn||krnt|t�rn|jrnqdqntSqddS)	Nr"Fr$zLInstance and class checks can only be used with @runtime_checkable protocolsz<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr&T)rr�r�rr5rTr3rPrOr0r*rrrrrr")r�r�r!r/r2rZr[�_proto_hook,s:


���
z/Protocol.__init_subclass__.<locals>._proto_hookr(z7Protocols can only inherit from other protocols, got %r)r�r�rr�rrr"r(rrr^�_PROTO_WHITELISTrbrrTr4r�)r|r�rr=r!r�r2r[r�$s,&

�����zProtocol.__init_subclass__)rbr^r_r�r"r$r�r�rZrZr�r[rs)�	metaclasscCs&t|t�r|jstd|��d|_|S)NzB@runtime_checkable can be only applied to protocol classes, got %rT)rrr"rTr$r2rZrZr[rKds�cCs|SrrrZ)�typrrZrZr[rA}sc
Cs�z
|j}Wntk
r"iYSX|j}|j}|d|�}|jpDd}|j}|rXt|�ni}|t|�}t||d�|�D]\}}	|	||<qz|S)NrZ)	�__code__r��co_argcount�co_varnames�__defaults__�__kwdefaults__r�r{�zip)
r�r�Z	pos_countZ	arg_names�defaultsZ
kwdefaultsr�Z
pos_offsetr��valuerZrZr[�
_get_defaults�s



rIcCs�t|dd�riSt|t�r�i}t|j�D]z}|dkrDtj|jj}n|}|j�	di�}|�
�D]B\}}|dkrvtd�}t|t�r�t|dd�}t
|||�}|||<q^q(|S|dkr�t|tj�r�|j}n"|}	t|	d�r�|	j}	q�t|	di�}|dkr�|}n|dk�r|}t|dd�}|dk�r6t|t��r(iStd�|���t|�}
t|�}|�
�D]d\}}|dk�rhtd�}t|t��r|t|�}t
|||�}||
k�r�|
|dk�r�t|}|||<�qN|S)N�__no_type_check__r&Fr��__wrapped__�__globals__z1{!r} is not a module, class, method, or function.)rrPrO�reversedr*r��modulesr^rr��itemsrQrr�r`�
ModuleTyper:rK�_allowed_typesrT�formatrIr�r)rdr�r�Zhintsr!Zbase_globals�annr�rHZnsobjrGrZrZr[rE�s^




�
cCs t|t�r|jS|tkrtSdSrr)rPrRrSr)rxrZrZr[rD�s

cCsRt|t�rN|jsN|j}t|�tjjkrJ|dtk	rJt	|dd��|df}|SdS)Nrr�rZ)
rPrRrmrtrDrrrr�rs)rxr�rZrZr[rCscCs�t|t�rt|j��}|j��D]"\}}||j|fkr|�|�q|��D](}t|tj	�r`d|_
t|t�rJt|�qJz
d|_
Wntk
r�YnX|S)NT)
rPrOr�copyrOr�pop�valuesr`rarJrGrT)rWZ	arg_attrsr�rrdrZrZr[rGs	




cst����fdd��}|S)Ncs�||�}t|�}|Srr)rG)r�r�r���	decoratorrZr[�wrapped_decorator@s
z2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)rXrYrZrWr[rH9scOstd��dS)Nz�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.)�NotImplementedErrorr�rZrZr[�_overload_dummyIs�r[cCstSrr)r[)r�rZrZr[rJRscCs|SrrrZ)�frZrZr[rBos�T�KT�VT�T_co)r��V_co�VT_co�T_contra)r��CT_co)r�r�cCst||d|d�S)NT)r�r�)rR)r�r�r�rZrZr[�_alias�srerZ)r�a�Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    F)r�r�a@Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    )r�a�A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c@s"eZdZdZeed�dd��ZdS)r2rZ��returncCsdSrrrZr�rZrZr[�__int__�szSupportsInt.__int__N)rbr^r_r�r�intrhrZrZrZr[r2�sc@s"eZdZdZeed�dd��ZdS)r0rZrfcCsdSrrrZr�rZrZr[�	__float__szSupportsFloat.__float__N)rbr^r_r�r�floatrjrZrZrZr[r0�sc@s"eZdZdZeed�dd��ZdS)r/rZrfcCsdSrrrZr�rZrZr[�__complex__
szSupportsComplex.__complex__N)rbr^r_r�r�complexrlrZrZrZr[r/sc@s"eZdZdZeed�dd��ZdS)r.rZrfcCsdSrrrZr�rZrZr[�	__bytes__szSupportsBytes.__bytes__N)rbr^r_r�r�bytesrnrZrZrZr[r.sc@s"eZdZdZeed�dd��ZdS)r1rZrfcCsdSrrrZr�rZrZr[�	__index__szSupportsIndex.__index__N)rbr^r_r�rrirprZrZrZr[r1sc@s"eZdZdZeed�dd��ZdS)r-rZrfcCsdSrrrZr�rZrZr[�__abs__(szSupportsAbs.__abs__N)rbr^r_r�rr`rqrZrZrZr[r-#sc@s&eZdZdZedeed�dd��ZdS)r3rZr)�ndigitsrgcCsdSrrrZ)r�rrrZrZr[�	__round__2szSupportsRound.__round__N)r)rbr^r_r�rrir`rsrZrZrZr[r3-sc	std��fdd�|D�}t�|dd�|D��}t|�|_|_zt�d�j�dd�|_	Wnt
tfk
rnYnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecsg|]\}}|t|��f�qSrZr��rg�nrhr�rZr[rk9sz!_make_nmtuple.<locals>.<listcomp>cSsg|]\}}|�qSrZrZrtrZrZr[rk:sr�rbr�)r�
namedtupler�r&�_field_typesr�r�r�r�r^r�r�)r�r`�nm_tplrZr�r[�
_make_nmtuple7sry)r�r�r��__getnewargs__�_fields�_field_defaultsrw�_make�_replace�_asdictZ_source)r^rbr&cseZdZ�fdd�Z�ZS)�NamedTupleMetacs�|�dd�rt��||||�S|�di�}t||���}g}i}|D]H}||krl||}	|�|	�|	||<qD|rDtdj|d�|�	��d���qDt
|�|j_t|�|j_
||_|D]<}
|
tkr�td|
��q�|
tkr�|
|jkr�t||
||
�q�|S)Nr�Fr&zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}r�)�
field_nameZ
default_namesz&Cannot overwrite NamedTuple attribute )r�r�r�ryrOrlrTrRr�r+r�r&rprDr|�_prohibitedr�rmr{r)r|�typenamer	�nsr`rxrGZ
defaults_dictr�Z
default_value�keyr�rZr[r�Os2

�
zNamedTupleMeta.__new__)rbr^r_r�r�rZrZr�r[r�Msr�c@seZdZdZdd�Zde_dS)r=TcOs�|std��|^}}|r"|^}}n4d|krN|�d�}ddl}|jdtdd�ntd��|r�z
|\}Wq�tk
r�tdt|�d�d	��d�Yq�Xn<d
|kr�t|�dkr�|�d
�}ddl}|jdtdd�nd}|dkr�|��}n|r�td
��t||�S)Nz*NamedTuple.__new__(): not enough argumentsr�rz4Passing 'typename' as keyword argument is deprecatedr�)�
stacklevelzGNamedTuple.__new__() missing 1 required positional argument: 'typename'z@NamedTuple.__new__() takes from 2 to 3 positional arguments but z were given�fieldsrz2Passing 'fields' as keyword argument is deprecatedzIEither list of fields or keywords can be provided to NamedTuple, not both)	rTrU�warnings�warn�DeprecationWarningr�r{rOry)r�rr|r�r�r�rZrZr[r��sB

�
�

�
zNamedTuple.__new__z*($cls, typename, fields=None, /, **kwargs)N)rbr^r_r�r��__text_signature__rZrZrZr[r=ls#cOs
t||�Srr)r�)r|r�rrZrZr[�	_dict_new�sr�)�totalc	Ksj|dkr|}n|rtd��t|�|d�}zt�d�j�dd�|d<Wnttfk
r\YnXt|d|�S)Nz@TypedDict takes either a dict or keyword arguments, but not both)r&�	__total__rrbr�r^rZ)	rTr�r�r�r�r�r�r��_TypedDictMeta)r|r�r�r�rr�rZrZr[�_typeddict_new�sr�cCstd��dS)Nz4TypedDict does not support instance and class checksr�)r|r�rZrZr[�_check_fails�sr�cs&eZdZd�fdd�	ZeZZ�ZS)r�Tcs�|dkrtnt|d<tt|��||tf|�}|�di�}d��fdd�|��D�}|D]}|�|j	�di��qV||_
t|d�s�||_|S)Nr>r�r&z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecsi|]\}}|t|���qSrZr�)rgrurxr�rZr[�
<dictcomp>�sz*_TypedDictMeta.__new__.<locals>.<dictcomp>r�)
r�r�r�r�r�r�r�rO�updaterr&r:r�)r|r�r	r�r�Ztp_dictZannsr!r�r�r[r��s	
z_TypedDictMeta.__new__)T)rbr^r_r�r�r�r�r�rZrZr�r[r��sr�c@seZdZdS)r>Nr#rZrZrZr[r>�scCsdd�}||_||_|S)NcSs|SrrrZ)�xrZrZr[�new_typeszNewType.<locals>.new_type)rbZ
__supertype__)r�rxr�rZrZr[rFsc@s�eZdZdZeeed�dd���Zeeed�dd���Zedd�dd	��Z	eee
d�d
d���Zeed�dd
��Z
edd�dd��Zee
d�dd��Zed6eed�dd��Zee
d�dd��Zed7eed�dd��Zed8eeed�dd��Zed9eeed�d d!��Zee
d�d"d#��Zeed�d$d%��Zed:eed&�d'd(��Zee
d�d)d*��Zeeed+�d,d-��Zeeedd.�d/d0��Zed1d�d2d3��Zedd�d4d5��ZdS);�IOrZrfcCsdSrrrZr�rZrZr[�mode=szIO.modecCsdSrrrZr�rZrZr[r�BszIO.nameNcCsdSrrrZr�rZrZr[�closeGszIO.closecCsdSrrrZr�rZrZr[�closedKsz	IO.closedcCsdSrrrZr�rZrZr[�filenoPsz	IO.filenocCsdSrrrZr�rZrZr[�flushTszIO.flushcCsdSrrrZr�rZrZr[�isattyXsz	IO.isattyr�)rurgcCsdSrrrZ)r�rurZrZr[�read\szIO.readcCsdSrrrZr�rZrZr[�readable`szIO.readable)�limitrgcCsdSrrrZ)r�r�rZrZr[�readlinedszIO.readline)�hintrgcCsdSrrrZ)r�r�rZrZr[�	readlineshszIO.readlinesr)�offset�whencergcCsdSrrrZ)r�r�r�rZrZr[�seeklszIO.seekcCsdSrrrZr�rZrZr[�seekablepszIO.seekablecCsdSrrrZr�rZrZr[�telltszIO.tell)�sizergcCsdSrrrZ)r�r�rZrZr[�truncatexszIO.truncatecCsdSrrrZr�rZrZr[�writable|szIO.writable��srgcCsdSrrrZ�r�r�rZrZr[�write�szIO.write)�linesrgcCsdSrrrZ)r�r�rZrZr[�
writelines�sz
IO.writelinesz
IO[AnyStr]cCsdSrrrZr�rZrZr[�	__enter__�szIO.__enter__cCsdSrrrZ)r�rOrH�	tracebackrZrZr[�__exit__�szIO.__exit__)r�)r�)r�)r)N)rbr^r_r��propertyrrQr�r�r�r�r�rir�r�r�r@r�r�r�r9r�r�r�r�r�r�r�r�r�r�rZrZrZr[r�.sX
r�c@s>eZdZdZeeeefed�dd��Z	edd�dd��Z
dS)	�BinaryIOrZr�cCsdSrrrZr�rZrZr[r��szBinaryIO.writerfcCsdSrrrZr�rZrZr[r��szBinaryIO.__enter__N)rbr^r_r�rrro�	bytearrayrir�r�rZrZrZr[r��s
r�c@s�eZdZdZeeed�dd���Zeeed�dd���Z	eee
ed�dd���Zeeed�d	d
���Z
eeed�dd���Zedd�d
d��ZdS)�TextIOrZrfcCsdSrrrZr�rZrZr[�buffer�sz
TextIO.buffercCsdSrrrZr�rZrZr[�encoding�szTextIO.encodingcCsdSrrrZr�rZrZr[�errors�sz
TextIO.errorscCsdSrrrZr�rZrZr[�line_buffering�szTextIO.line_bufferingcCsdSrrrZr�rZrZr[�newlines�szTextIO.newlinescCsdSrrrZr�rZrZr[r��szTextIO.__enter__N)rbr^r_r�r�rr�r�rQr�rr�r�r�rr�r�rZrZrZr[r��s$r�c@s"eZdZdddgZeZeZeZdS)�ior�r�r�N)rbr^r_�__all__r�r�r�rZrZrZr[r��s
r�z.ioc@seZdZddgZeZeZdS)�re�Pattern�MatchN)rbr^r_r�r�r�rZrZrZr[r��sr�z.re)T)NN)T)N)�rrrrZcollections.abcr8r�rr�Z	stdlib_rer�r`rrrr�r\rerqrvr~r�r�r�r�r�r�rUrrIr	r
rrr
rrr�r�rRrrr�r�Z_TYPING_INTERNALSZ_SPECIAL_NAMESr,r0r3r4r5r>r9rrKrArIra�BuiltinFunctionType�
MethodTyperPrQrErDrCrGrHr[rJrBr]r^r_r`rarbrcrOrdrorQr@rerr%r(r'r&rrr,r#rr)rr'r;rr!rrr"r rrprrsr9r�r6r�r�r<rrrr$r6rr7r+r�r7r�r8r:r5r4r?r*rr2r0r/r.r1r-r3ryr�rmr�r=r�r�r�r�r>rFrLrMr�r�r�r�rbrNr�r�rZrZrZr[�<module>s&�X
!
	
I��
�����2a�
/[����	b�
V	
�
�	�							@+c#	

lzma.cpython-38.pyc000064400000027364151450073350010156 0ustar00U

e5d�2�$@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g$Zd%d&lZd%d&lZd%d&lZd%d'lTd%d(lmZmZd%d&lZd%Z	d)Z
d*ZGd+d�dej�Z
d2d&d-d&d&d&d&d&d.�d/d!�Zed-d&d&fd0d"�Zed&d&fd1d#�Zd&S)3aSInterface to the liblzma compression library.

This module provides a class for reading and writing compressed files,
classes for incremental (de)compression, and convenience functions for
one-shot (de)compression.

These classes and functions support both the XZ and legacy LZMA
container formats, as well as raw compressed data streams.
Z
CHECK_NONEZCHECK_CRC32ZCHECK_CRC64ZCHECK_SHA256ZCHECK_ID_MAXZ
CHECK_UNKNOWNZFILTER_LZMA1ZFILTER_LZMA2ZFILTER_DELTAZ
FILTER_X86ZFILTER_IA64Z
FILTER_ARMZFILTER_ARMTHUMBZFILTER_POWERPCZFILTER_SPARC�FORMAT_AUTO�	FORMAT_XZZFORMAT_ALONEZ
FORMAT_RAWZMF_HC3ZMF_HC4ZMF_BT2ZMF_BT3ZMF_BT4Z	MODE_FASTZMODE_NORMALZPRESET_DEFAULTZPRESET_EXTREME�LZMACompressor�LZMADecompressor�LZMAFile�	LZMAError�open�compress�
decompressZis_check_supported�N)�*)�_encode_filter_properties�_decode_filter_properties��c@s�eZdZdZd"ddddd�dd�Zdd	�Zed
d��Zdd
�Zdd�Z	dd�Z
dd�Zd#dd�Zd$dd�Z
d%dd�Zd&dd�Zdd�Zejfdd�Zd d!�ZdS)'ra@A file object providing transparent LZMA (de)compression.

    An LZMAFile can act as a wrapper for an existing file object, or
    refer directly to a named file on disk.

    Note that LZMAFile provides a *binary* file interface - data read
    is returned as bytes, and data to be written must be given as bytes.
    N�r�����format�check�preset�filtersc	Cs&d|_d|_t|_|dkrL|dkr*td��|dk	r:td��|dkrFt}t}n@|dkr~|dkr`t}t}t	||||d�|_
d	|_ntd
�|���t
|tttjf�r�d|kr�|d7}t�||�|_d|_||_n*t|d
�s�t|d�r�||_||_ntd��|jtk�r"tj|jtt||d�}t�|�|_dS)a�Open an LZMA-compressed file in binary mode.

        filename can be either an actual file name (given as a str,
        bytes, or PathLike object), in which case the named file is
        opened, or it can be an existing file object to read from or
        write to.

        mode can be "r" for reading (default), "w" for (over)writing,
        "x" for creating exclusively, or "a" for appending. These can
        equivalently be given as "rb", "wb", "xb" and "ab" respectively.

        format specifies the container format to use for the file.
        If mode is "r", this defaults to FORMAT_AUTO. Otherwise, the
        default is FORMAT_XZ.

        check specifies the integrity check to use. This argument can
        only be used when opening a file for writing. For FORMAT_XZ,
        the default is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not
        support integrity checks - for these formats, check must be
        omitted, or be CHECK_NONE.

        When opening a file for reading, the *preset* argument is not
        meaningful, and should be omitted. The *filters* argument should
        also be omitted, except when format is FORMAT_RAW (in which case
        it is required).

        When opening a file for writing, the settings used by the
        compressor can be specified either as a preset compression
        level (with the *preset* argument), or in detail as a custom
        filter chain (with the *filters* argument). For FORMAT_XZ and
        FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
        level. For FORMAT_RAW, the caller must always specify a filter
        chain; the raw compressor does not support preset compression
        levels.

        preset (if provided) should be an integer in the range 0-9,
        optionally OR-ed with the constant PRESET_EXTREME.

        filters (if provided) should be a sequence of dicts. Each dict
        should have an entry for "id" indicating ID of the filter, plus
        additional entries for options to the filter.
        NF)r�rbrzACannot specify an integrity check when opening a file for readingzICannot specify a preset compression level when opening a file for reading)�w�wb�aZab�xZxbrr
zInvalid mode: {!r}�bT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorrr)�_fp�_closefp�_MODE_CLOSED�_mode�
ValueErrorr�
_MODE_READr�_MODE_WRITEr�_compressor�_posr�
isinstance�str�bytes�os�PathLike�builtinsr�hasattr�	TypeError�_compressionZDecompressReaderrr�io�BufferedReader�_buffer)	�self�filename�moderrrrZ	mode_code�raw�r8�/usr/lib64/python3.8/lzma.py�__init__1sL,�
�zLZMAFile.__init__cCs�|jtkrdSzB|jtkr,|j��d|_n"|jtkrN|j�|j	�
��d|_	W5z|jrd|j��W5d|_d|_t|_XXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)r"r!rr �closer$r3r%rr&�flush�r4r8r8r9r;�s




zLZMAFile.closecCs
|jtkS)zTrue if this file is closed.)r"r!r=r8r8r9�closed�szLZMAFile.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor=r8r8r9r@�szLZMAFile.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler=r8r8r9rB�szLZMAFile.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)r?r"r$r=r8r8r9rA�szLZMAFile.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)r?r"r%r=r8r8r9�writable�szLZMAFile.writablecCs|��|j�|�S)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        )�_check_can_readr3�peek�r4�sizer8r8r9rE�sz
LZMAFile.peekcCs|��|j�|�S)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b"" if the file is already at EOF.
        )rDr3rrFr8r8r9r�sz
LZMAFile.readcCs"|��|dkrtj}|j�|�S)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b"" if the file is at EOF.
        r
)rDr1�DEFAULT_BUFFER_SIZEr3�read1rFr8r8r9rI�szLZMAFile.read1cCs|��|j�|�S)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        )rDr3�readlinerFr8r8r9rJ�szLZMAFile.readlinecCs:|��|j�|�}|j�|�|jt|�7_t|�S)z�Write a bytes object to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        )Z_check_can_writer&rrrr'�len)r4�dataZ
compressedr8r8r9r�s
zLZMAFile.writecCs|��|j�||�S)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Possible values for whence are:

            0: start of stream (default): offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        )Z_check_can_seekr3�seek)r4�offset�whencer8r8r9rM�sz
LZMAFile.seekcCs"|��|jtkr|j��S|jS)z!Return the current file position.)r?r"r$r3�tellr'r=r8r8r9rP�s

z
LZMAFile.tell)Nr)r)r)r)r)�__name__�
__module__�__qualname__�__doc__r:r;�propertyr>r@rBrArCrErrIrJrr1�SEEK_SETrMrPr8r8r8r9r&s*	�U


	



rr)rrrr�encoding�errors�newlinecCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}	t||	||||d	�}
d|kr�t�|
|||�S|
SdS)
a�Open an LZMA-compressed file in binary or text mode.

    filename can be either an actual file name (given as a str, bytes,
    or PathLike object), in which case the named file is opened, or it
    can be an existing file object to read from or write to.

    The mode argument can be "r", "rb" (default), "w", "wb", "x", "xb",
    "a", or "ab" for binary mode, or "rt", "wt", "xt", or "at" for text
    mode.

    The format, check, preset and filters arguments specify the
    compression settings, as for LZMACompressor, LZMADecompressor and
    LZMAFile.

    For binary mode, this function is equivalent to the LZMAFile
    constructor: LZMAFile(filename, mode, ...). In this case, the
    encoding, errors and newline arguments must not be provided.

    For text mode, an LZMAFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�r)r#�replacerr1�
TextIOWrapper)r5r6rrrrrWrXrYZlz_modeZbinary_filer8r8r9rs"
�cCs t||||�}|�|�|��S)z�Compress a block of data.

    Refer to LZMACompressor's docstring for a description of the
    optional arguments *format*, *check*, *preset* and *filters*.

    For incremental compression, use an LZMACompressor instead.
    )rrr<)rLrrrr�compr8r8r9r6scCspg}t|||�}z|�|�}Wn tk
r>|r8Yqfn�YnX|�|�|jsXtd��|j}|sqfqd�|�S)z�Decompress a block of data.

    Refer to LZMADecompressor's docstring for a description of the
    optional arguments *format*, *check* and *filters*.

    For incremental decompression, use an LZMADecompressor instead.
    zACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rLrZmemlimitrZresultsZdecomp�resr8r8r9r	Bs
)r)rT�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>sv�
b�/modulefinder.cpython-38.pyc000064400000037365151450073350011672 0ustar00U

e5dn_�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ejdZejdZ
ejdZejdZeefZejZdZdZdZd	Zd
ZdZdZiZd
d�ZiZdd�Zddd�ZGdd�d�ZGdd�d�Zdd�Z e!dk�rz
e �Z"Wne#k
�re$d�YnXdS)z3Find modules used by a script, using introspection.�N�
LOAD_CONST�IMPORT_NAME�
STORE_NAME�STORE_GLOBAL������cCst�|g��|�dS�N)�packagePathMap�
setdefault�append)Zpackagename�path�r�$/usr/lib64/python3.8/modulefinder.py�AddPackagePath(srcCs|t|<dSr)�replacePackageMap)Zoldname�newnamerrr�ReplacePackage3srcCstjj��tjj�||�}|dkr8tdj|d�|d��|jtjjkrVddddt	ffS|jtjj
krtddddtffS|j}|j�
|�r�dtj�|�ddtffSt|jtjj�r�t}n<t|jtjj�r�t}n&t|jtjj�r�t}nddddtffSt�|�}tj�|�d}|||d|ffS)zDAn importlib reimplementation of imp.find_module (for our purposes).NzNo module named {name!r})�name�����rb)�	importlib�	machinery�
PathFinder�invalidate_caches�	find_spec�ImportError�format�loader�BuiltinImporter�
_C_BUILTIN�FrozenImporter�
_PY_FROZEN�origin�
is_package�osr�dirname�_PKG_DIRECTORY�
isinstance�SourceFileLoader�
_PY_SOURCE�ExtensionFileLoader�_C_EXTENSION�SourcelessFileLoader�_PY_COMPILED�
_SEARCH_ERROR�io�	open_code�splitext)rr�specZ	file_pathZkind�file�suffixrrr�_find_module7s*
r:c@seZdZddd�Zdd�ZdS)�ModuleNcCs(||_||_||_d|_i|_i|_dSr)�__name__�__file__�__path__�__code__�globalnames�starimports)�selfrr8rrrr�__init__fszModule.__init__cCsLd|jf}|jdk	r&|d|jf}|jdk	r@|d|jf}|d}|S)Nz	Module(%rz, %r�))r<r=r>)rB�srrr�__repr__ss

zModule.__repr__)NN)r<�
__module__�__qualname__rCrFrrrrr;ds

r;c@s�eZdZd6dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zd7dd�Z	d8dd�Z
dd�Zdd�Zd9dd�Z
dd�Zdd�Zdd�Zd d!�Zd:d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd;d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)<�ModuleFinderNrcCsZ|dkrtj}||_i|_i|_||_d|_|dk	r8|ng|_|dk	rJ|ng|_g|_dS)Nr)	�sysr�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rBrrMrOrPrrrrC~szModuleFinder.__init__cGsV||jkrRt|j�D]}tddd�qt|dd�|D]}tt|�dd�q6t�dS)N�   � ��end)rM�rangerN�print�repr)rB�level�str�args�i�argrrr�msg�s
zModuleFinder.msgcGs,|d}||jkr(|jd|_|j|�dS�Nrr�rMrNr^�rBr[rYrrr�msgin�s
zModuleFinder.msgincGs,|d}||jkr(|jd|_|j|�dSr_r`rarrr�msgout�s
zModuleFinder.msgoutc	CsB|�dd|�t�|�� }ddtf}|�d|||�W5QRXdS)Nr�
run_scriptrr�__main__)r^r4r5r.�load_module)rB�pathname�fp�stuffrrrrd�s
zModuleFinder.run_scriptc	CsTtj�|�\}}tj�|�\}}t�|�� }|dtf}|�||||�W5QRXdS)Nr)r)r�splitr6r4r5r.rf)rBrg�dirrZextrhrirrr�	load_file�s

zModuleFinder.load_filerc	Cs\|�dd||||�|j||d�}|�||�\}}|�||�}|sF|S|jrX|�||�dS)Nr�import_hook�rY)r^�determine_parent�find_head_package�	load_tailr>�ensure_fromlist)	rBr�caller�fromlistrY�parent�q�tail�mrrrrm�szModuleFinder.import_hookcCsN|�dd||�|r|dkr,|�dd�dS|j}|dkr�|jrH|d8}|dkrx|j|}||ksft�|�dd|�|S|�d�|kr�td��d�|�	d�d|��}|j|}|�dd|�|S|jr�|j|}||ks�t�|�dd|�|Sd|k�r>|�
d�}|d|�}|j|}|j|k�s,t�|�dd|�|S|�dd�dS)	N�rorzdetermine_parent -> Nonerzdetermine_parent ->�.zrelative importpath too deep)rbrcr<r>rK�AssertionError�countr �joinrj�rfind)rBrsrYZpnamerur\rrrro�sB





zModuleFinder.determine_parentcCs�|�dd||�d|kr@|�d�}|d|�}||dd�}n|}d}|r\d|j|f}n|}|�|||�}|r�|�dd||f�||fS|r�|}d}|�|||�}|r�|�dd||f�||fS|�dd|�td	|��dS)
Nryrprzrr�%s.%szfind_head_package ->�"raise ImportError: No module named�No module named )rb�findr<�
import_modulercr )rBrurr\�headrwZqnamervrrrrp�s.
zModuleFinder.find_head_packagecCs�|�dd||�|}|r�|�d�}|dkr2t|�}|d|�||dd�}}d|j|f}|�|||�}|s|�dd|�td|��q|�dd	|�|S)
Nryrqrzrrrr�r�zload_tail ->)rbr��lenr<r�rcr )rBrvrwrxr\r�Zmnamerrrrq�s
zModuleFinder.load_tailcCs�|�dd|||�|D]d}|dkrD|sz|�|�}|rz|�||d�qt||�sd|j|f}|�|||�}|std|��qdS)Nryrr�*rrr�)r^�find_all_submodulesrr�hasattrr<r�r )rBrxrt�	recursive�sub�all�subnameZsubmodrrrrrs

zModuleFinder.ensure_fromlistc
	Cs�|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}|jD]�}zt�|�}Wn&tk
r�|�	dd|�YqTYnX|D]R}d}|D]0}t
|�}	||	d�|kr�|d|	�}q�q�|r�|dkr�|||<q�qT|��S)Nrzcan't list directoryrC)r>rr�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr)�listdir�OSErrorr^r��keys)
rBrxrK�suffixesrk�namesr�modZsuff�nrrrr�s.

z ModuleFinder.find_all_submodulescCs
|�dd|||�z|j|}Wntk
r4YnX|�dd|�|S||jkrb|�dd�dS|r�|jdkr�|�dd�dSz|�||o�|j|�\}}}Wn$tk
r�|�ddd�YdSXz|�	||||�}W5|r�|��X|r�t
|||�|�dd|�|S)Nrr�zimport_module ->zimport_module -> None)rbrK�KeyErrorrcrLr>�find_moduler �closerf�setattr)rBZpartname�fqnamerurxrhrgrirrrr�.s:
�
zModuleFinder.import_modulec
Cs(|\}}}|�dd||od|�|tkrF|�||�}|�dd|�|S|tkr`t|��|d�}	n||tkr�z|��}
tj	�
|
|i�Wn:tk
r�}z|�ddt|�|��W5d}~XYnXt
�t|
�dd��}	nd}	|�|�}||_|	�r|j�r|�|	�}	|	|_|�|	|�|�dd|�|S)Nrrfrhzload_module ->�execzraise ImportError: �)rbr+�load_packagercr.�compile�readr2r�_bootstrap_external�
_classify_pycr rZ�marshal�loads�
memoryview�
add_moduler=rP�replace_paths_in_coder?�	scan_code)rBr�rhrg�	file_infor9�mode�typerx�co�data�excrrrrfNs4


zModuleFinder.load_modulecCs<||jkri|j|<|r*d|j||j<nd|j|d<dS)Nr�-)rLr<)rBrrsrrr�_add_badmoduleks


zModuleFinder._add_badmodulecCsB||jkr|�||�dSz|j|||d�Wn~tk
rn}z"|�ddt|��|�||�W5d}~XYn�tk
r�}z"|�ddt|��|�||�W5d}~XYn�X|�r>|D]�}|d|}||jkr�|�||�q�z|j|||g|d�Wq�tk
�r:}z"|�ddt|��|�||�W5d}~XYq�Xq�dS)NrnrzImportError:zSyntaxError:rz)rLr�rmr r^rZ�SyntaxError)rBrrsrtrYr^r��fullnamerrr�_safe_import_hookss,

zModuleFinder._safe_import_hookccs�|j}|j}|j}dd�t�|�D�}t|�D]�\}\}}|tkrTd||ffVq.|tkr.|dkr.||dd||ddkr�tkr.nq.|||dd}	|||dd}
|	dkr�d|
||ffVq.d|	|
||ffVq.q.dS)	NcSs"g|]\}}}|tkr||f�qSr)�EXTENDED_ARG)�.0�_�opr]rrr�
<listcomp>�s�z-ModuleFinder.scan_opcodes.<locals>.<listcomp>�storerrr�absolute_import�relative_import)	�co_code�co_names�	co_consts�disZ_unpack_opargs�	enumerate�	STORE_OPSrr)rBr��coder��constsZopargsr\r�ZopargrYrtrrr�scan_opcodes�s(��
zModuleFinder.scan_opcodescCs�|j}|j}||�D�]F\}}|dkr8|\}d|j|<q|dk�r|\}}d}	|dk	rpd|krbd}	dd�|D�}|j|||dd�|	�r\d}
|jr�|j�|jd	|�}
|
dkr�|j�|�}
|
dk	r�|j�|
j�|j	�|
j	�|
j
dkr�d|j	|<n
d|j	|<q|d
k�rT|\}}}|�r0|j||||d�n"|j||d�}|j|jd|dd�qt|��q|j
D]"}
t|
t|���rd|�|
|��qddS)Nr�rr�rr�cSsg|]}|dkr|�qS)r�r)r��frrrr��sz*ModuleFinder.scan_code.<locals>.<listcomp>rnrzr�)r�r�r@r�r>rK�getr<�updaterAr?ro�RuntimeErrorr�r,r�r�)rBr�rxr��scannerZwhatr[rrtZ	have_starZmmrYru�crrrr��sH





zModuleFinder.scan_codecCs�|�dd||�t�|�}|r"|}|�|�}||_|g|_|jt�|g�|_|�d|j�\}}}z&|�	||||�|�
dd|�|W�S|r�|��XdS)Nrr�rCzload_package ->)rbrr�r�r=r>r
r�r�rfrc)rBr�rgrrxrhZbufrirrrr��s

zModuleFinder.load_packagecCs*||jkr|j|St|�|j|<}|Sr)rKr;)rBr�rxrrrr��s

zModuleFinder.add_modulecCsn|dk	r|jd|}n|}||jkr<|�dd|�t|��|dkrd|tjkr^ddddtffS|j}t||�S)Nrzrzfind_module -> Excludedr)	r<rOrcr rJ�builtin_module_namesr$rr:)rBrrrur�rrrr��s

zModuleFinder.find_modulecCst�tdd�tdd�t|j���}|D]B}|j|}|jrRtddd�ntddd�td||jpnd	�q0|��\}}|r�t�td
�|D]*}t|j|���}td|dd
�|��q�|�rt�tddd�td�|D]*}t|j|���}td|dd
�|��q�dS)z�Print a report to stdout, listing the found modules with their
        paths, as well as modules that are missing, or seem to be missing.
        z
  %-25s %s)�NameZFile)�----r��PrSrTrxz%-25srzMissing modules:�?z
imported fromz, z7Submodules that appear to be missing, but could also bez#global names in the parent package:N)	rW�sortedrKr�r>r=�any_missing_mayberLr})rBr��keyrx�missing�mayberZmodsrrr�reports0
zModuleFinder.reportcCs|��\}}||S)z�Return a list of modules that appear to be missing. Use
        any_missing_maybe() if you want to know which modules are
        certain to be missing, and which *may* be missing.
        )r�)rBr�r�rrr�any_missing"szModuleFinder.any_missingcCs�g}g}|jD]�}||jkrq|�d�}|dkr<|�|�q||dd�}|d|�}|j�|�}|dk	r�||j|kr�|�|�q�||jkr�q�|jr�|�|�q�|�|�q|�|�q|��|��||fS)a�Return two lists, one with modules that are certainly missing
        and one with modules that *may* be missing. The latter names could
        either be submodules *or* just global names in the package.

        The reason it can't always be determined is that it's impossible to
        tell which names are imported when "from module import *" is done
        with an extension module, short of actually importing it.
        rzrrN)	rLrOr~rrKr�r@rA�sort)rBr�r�rr\r�ZpkgnameZpkgrrrr�*s0	




zModuleFinder.any_missing_maybecCs�tj�|j�}}|jD]*\}}|�|�r||t|�d�}qDq|jr�||jkr�||krr|�	dd||f�n|�	dd|f�|j�
|�t|j�}t
t|��D](}t||t|��r�|�||�||<q�|jt|�|d�S)Nrzco_filename %r changed to %rz co_filename %r remains unchanged)r��co_filename)r)r�normpathr�rP�
startswithr�rMrQrcr�listr�rVr,r�r��replace�tuple)rBr�Znew_filenameZoriginal_filenamer��rr�r\rrrr�Xs&
��
z"ModuleFinder.replace_paths_in_code)NrNN)NNr)r)r)r)N)r<rGrHrCr^rbrcrdrlrmrorprqrrr�r�rfr�r�r�r�r�r�r�r�r�r�r�rrrrrI|s2
	

#
 
1
".rIc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnXd}d}g}g}|D]Z\}}	|dkr�|d}|dkr�d}|dkr�||	�tj�}|dkr�d}|dkrn|�|	�qn|s�d	}
n|d}
tj	dd�}tj	�
|
�|d<||}|dk�r.td
�|D]}tdt|���qt|||�}
|dd�D]`}|dk�r\d}�qF|�r�|dd�d
k�r�|
�
|dd�ddg�n
|
�
|�n
|
�|��qF|
�|
�|
��|
S)Nrrzdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:rR���z.*r�)�getoptrJ�argv�errorrWrjr)�pathseprrr*rXrIrmrlrdr�)r�Zoptsr[r^rMZdomodsZaddpathZexclude�o�aZscriptr�item�mfr]rrr�testpsX


r�rez
[interrupted])N)%�__doc__r�Zimportlib._bootstrap_externalr�importlib.machineryr�r)r4rJ�types�warningsZopmaprrrrr�r�r3r.r2r0r+r$r&r
rrrr:r;rIr�r<r��KeyboardInterruptrWrrrr�<module>sL




-w;

ipaddress.cpython-38.opt-1.pyc000064400000165113151450073350012123 0ustar00U

e5d��@s�dZdZddlZdZdZGdd�de�ZGdd	�d	e�Zd
d�Zd=d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZGd#d$�d$�ZejGd%d&�d&e��ZejGd'd(�d(e��ZGd)d*�d*�ZGd+d,�d,ee�ZGd-d.�d.e�ZGd/d0�d0ee�ZGd1d2�d2�Zee_Gd3d4�d4�ZGd5d6�d6ee�ZGd7d8�d8e�Z Gd9d:�d:ee�Z!Gd;d<�d<�Z"e"e_dS)>z�A fast, lightweight IPv4/IPv6 manipulation library in Python.

This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.

z1.0�N� �c@seZdZdZdS)�AddressValueErrorz%A Value Error related to the address.N��__name__�
__module__�__qualname__�__doc__�r
r
�!/usr/lib64/python3.8/ipaddress.pyrsrc@seZdZdZdS)�NetmaskValueErrorz%A Value Error related to the netmask.Nrr
r
r
rrsrc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Address or IPv6Address object.

    Raises:
        ValueError: if the *address* passed isn't either a v4 or a v6
          address

    z0%r does not appear to be an IPv4 or IPv6 addressN)�IPv4Addressrr�IPv6Address�
ValueError��addressr
r
r�
ip_addresss

�rTc	Cs\zt||�WSttfk
r$YnXzt||�WSttfk
rJYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP network.  Either IPv4 or
          IPv6 networks may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Network or IPv6Network object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address. Or if the network has host bits set.

    z0%r does not appear to be an IPv4 or IPv6 networkN)�IPv4Networkrr�IPv6Networkr)r�strictr
r
r�
ip_network9s�rc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)agTake an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Interface or IPv6Interface object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address.

    Notes:
        The IPv?Interface classes describe an Address on a particular
        Network, so they're basically a combination of both the Address
        and Network classes.

    z2%r does not appear to be an IPv4 or IPv6 interfaceN)�
IPv4Interfacerr�
IPv6Interfacerrr
r
r�ip_interfaceWs

�rcCs0z|�dd�WStk
r*td��YnXdS)a`Represent an address as 4 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv4 IP address.

    Returns:
        The integer address packed as 4 bytes in network (big-endian) order.

    Raises:
        ValueError: If the integer is negative or too large to be an
          IPv4 IP address.

    ��bigz&Address negative or too large for IPv4N��to_bytes�
OverflowErrorrrr
r
r�v4_int_to_packedzsrcCs0z|�dd�WStk
r*td��YnXdS)z�Represent an address as 16 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv6 IP address.

    Returns:
        The integer address packed as 16 bytes in network (big-endian) order.

    �rz&Address negative or too large for IPv6Nrrr
r
r�v6_int_to_packed�s
r!cCs*t|��d�}t|�dkr&td|��|S)zAHelper to split the netmask and raise AddressValueError if needed�/�zOnly one '/' permitted in %r)�str�split�lenr)r�addrr
r
r�_split_optional_netmask�sr(ccsNt|�}t|�}}|D]&}|j|jdkr:||fV|}|}q||fVdS)z�Find a sequence of sorted deduplicated IPv#Address.

    Args:
        addresses: a list of IPv#Address objects.

    Yields:
        A tuple containing the first and last IP addresses in the sequence.

    �N)�iter�next�_ip)�	addresses�it�first�last�ipr
r
r�_find_address_range�s

r2cCs$|dkr|St|||d@���S)z�Count the number of zero bits on the right hand side.

    Args:
        number: an integer.
        bits: maximum number of bits to count.

    Returns:
        The number of zero bits on the right hand side of the number.

    rr))�min�
bit_length)Znumber�bitsr
r
r�_count_righthand_zero_bits�sr6ccs�t|t�rt|t�std��|j|jkr8td||f��||krHtd��|jdkrXt}n|jdkrht}ntd��|j}|j}|j}||kr�t	t
||�||d��d�}||||f�}|V|d|>7}|d|jkr�q�q�dS)	a�Summarize a network range given the first and last IP addresses.

    Example:
        >>> list(summarize_address_range(IPv4Address('192.0.2.0'),
        ...                              IPv4Address('192.0.2.130')))
        ...                                #doctest: +NORMALIZE_WHITESPACE
        [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'),
         IPv4Network('192.0.2.130/32')]

    Args:
        first: the first IPv4Address or IPv6Address in the range.
        last: the last IPv4Address or IPv6Address in the range.

    Returns:
        An iterator of the summarized IPv(4|6) network objects.

    Raise:
        TypeError:
            If the first and last objects are not IP addresses.
            If the first and last objects are not the same version.
        ValueError:
            If the last object is not greater than the first.
            If the version of the first address is not 4 or 6.

    z1first and last must be IP addresses, not networks�%%s and %s are not of the same versionz*last IP address must be greater than firstr�zunknown IP versionr)N)
�
isinstance�_BaseAddress�	TypeError�versionrrr�_max_prefixlenr,r3r6r4�	_ALL_ONES)r/r0r1Zip_bitsZ	first_intZlast_intZnbits�netr
r
r�summarize_address_range�s8
��


�r@ccs�t|�}i}|rV|��}|��}|�|�}|dkr<|||<q||kr||=|�|�qd}t|���D]$}|dk	r�|j|jkr�qf|V|}qfdS)auLoops through the addresses, collapsing concurrent netblocks.

    Example:

        ip1 = IPv4Network('192.0.2.0/26')
        ip2 = IPv4Network('192.0.2.64/26')
        ip3 = IPv4Network('192.0.2.128/26')
        ip4 = IPv4Network('192.0.2.192/26')

        _collapse_addresses_internal([ip1, ip2, ip3, ip4]) ->
          [IPv4Network('192.0.2.0/24')]

        This shouldn't be called directly; it is called via
          collapse_addresses([]).

    Args:
        addresses: A list of IPv4Network's or IPv6Network's

    Returns:
        A list of IPv4Network's or IPv6Network's depending on what we were
        passed.

    N)�list�pop�supernet�get�append�sorted�values�broadcast_address)r-Zto_merge�subnetsr?rCZexistingr0r
r
r�_collapse_addresses_internals$

rJc	Cs0g}g}g}|D]�}t|t�rR|rF|dj|jkrFtd||df��|�|�q|j|jkr�|r�|dj|jkr�td||df��z|�|j�Wq�tk
r�|�|j	�Yq�Xq|r�|dj|jkr�td||df��|�|�qt
t|��}|�r$t|�D]\}}|�
t||���qt||�S)a�Collapse a list of IP objects.

    Example:
        collapse_addresses([IPv4Network('192.0.2.0/25'),
                            IPv4Network('192.0.2.128/25')]) ->
                           [IPv4Network('192.0.2.0/24')]

    Args:
        addresses: An iterator of IPv4Network or IPv6Network objects.

    Returns:
        An iterator of the collapsed IPv(4|6)Network objects.

    Raises:
        TypeError: If passed a list of mixed version objects.

    ���r7)r9r:�_versionr;rE�
_prefixlenr=r1�AttributeError�network_addressrF�setr2�extendr@rJ)r-ZaddrsZipsZnetsr1r/r0r
r
r�collapse_addresses2s@
���rRcCs(t|t�r|��St|t�r$|��StS)a2Return a key suitable for sorting between networks and addresses.

    Address and Network objects are not sortable by default; they're
    fundamentally different so the expression

        IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')

    doesn't make any sense.  There are some times however, where you may wish
    to have ipaddress sort these for you anyway. If you need to do this, you
    can use this function as the key= argument to sorted().

    Args:
      obj: either a Network or Address object.
    Returns:
      appropriate key.

    )r9�_BaseNetwork�_get_networks_keyr:�_get_address_key�NotImplemented)�objr
r
r�get_mixed_type_keyhs


rXc@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�ZdS)�_IPAddressBasezThe mother class.r
cCs|��S)z:Return the longhand version of the IP address as a string.)�_explode_shorthand_ip_string��selfr
r
r�exploded�sz_IPAddressBase.explodedcCst|�S)z;Return the shorthand version of the IP address as a string.�r$r[r
r
r�
compressed�sz_IPAddressBase.compressedcCs|��S)aIThe name of the reverse DNS pointer for the IP address, e.g.:
            >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
            '1.0.0.127.in-addr.arpa'
            >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
            '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'

        )�_reverse_pointerr[r
r
r�reverse_pointer�s	z_IPAddressBase.reverse_pointercCsdt|�f}t|��dS)Nz%200s has no version specified��type�NotImplementedError�r\�msgr
r
rr<�sz_IPAddressBase.versioncCsF|dkrd}t|||jf��||jkrBd}t|||j|jf��dS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrLr>r=)r\rrfr
r
r�_check_int_address�s

�z!_IPAddressBase._check_int_addresscCs.t|�}||kr*d}t|||||jf��dS)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r&rrL)r\rZexpected_lenZaddress_lenrfr
r
r�_check_packed_address�s�z$_IPAddressBase._check_packed_addresscCs|j|j|?AS)z�Turn the prefix length into a bitwise netmask

        Args:
            prefixlen: An integer, the prefix length.

        Returns:
            An integer.

        )r>)�cls�	prefixlenr
r
r�_ip_int_from_prefix�sz"_IPAddressBase._ip_int_from_prefixc	Cs\t||j�}|j|}||?}d|>d}||krX|jd}|�|d�}d}t||��|S)aReturn prefix length from the bitwise netmask.

        Args:
            ip_int: An integer, the netmask in expanded bitwise format

        Returns:
            An integer, the prefix length.

        Raises:
            ValueError: If the input intermingles zeroes & ones
        r)�rz&Netmask pattern %r mixes zeroes & ones)r6r=rr)	ri�ip_intZtrailing_zeroesrjZleading_onesZall_onesZbyteslenZdetailsrfr
r
r�_prefix_from_ip_int�s
�

z"_IPAddressBase._prefix_from_ip_intcCsd|}t|�d�dS)Nz%r is not a valid netmask)r)riZnetmask_strrfr
r
r�_report_invalid_netmask�sz&_IPAddressBase._report_invalid_netmaskcCsl|��r|��s|�|�zt|�}Wntk
rD|�|�YnXd|kr\|jkshn|�|�|S)a	Return prefix length from a numeric string

        Args:
            prefixlen_str: The string to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask
        r)�isascii�isdigitro�intrr=)riZ
prefixlen_strrjr
r
r�_prefix_from_prefix_string�s

z)_IPAddressBase._prefix_from_prefix_stringcCs�z|�|�}Wntk
r,|�|�YnXz|�|�WStk
rNYnX||jN}z|�|�WStk
r�|�|�YnXdS)aTurn a netmask/hostmask string into a prefix length

        Args:
            ip_str: The netmask/hostmask to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask/hostmask
        N)�_ip_int_from_stringrrornrr>)ri�ip_strrmr
r
r�_prefix_from_ip_string�s
z%_IPAddressBase._prefix_from_ip_stringcCsHt|ttf�r||jfSt|t�s*t|�}t|�dkr:|S|d|jfS)z�Helper function to parse address of Network/Interface.

        Arg:
            address: Argument of Network/Interface.

        Returns:
            (addr, prefix) tuple.
        r)r)r9�bytesrrr=�tupler(r&)rirr
r
r�_split_addr_prefixs

z!_IPAddressBase._split_addr_prefixcCs|jt|�ffS�N)�	__class__r$r[r
r
r�
__reduce__/sz_IPAddressBase.__reduce__N)rrrr	�	__slots__�propertyr]r_rar<rgrh�classmethodrkrnrorsrvryr|r
r
r
rrY�s2




	




!
rYc@sdeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)r:z�A generic IP object.

    This IP class contains the version independent methods which are
    used by single IP addresses.
    r
cCs|jSrz�r,r[r
r
r�__int__>sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk
r2tYSXdSrz)r,rLrNrV�r\�otherr
r
r�__eq__As
�z_BaseAddress.__eq__cCsFt|t�stS|j|jkr*td||f��|j|jkrB|j|jkSdS�Nr7F)r9r:rVrLr;r,r�r
r
r�__lt__Hs
�z_BaseAddress.__lt__cCs t|t�stS|�t|�|�Srz�r9rrrVr{r�r
r
r�__add__Ts
z_BaseAddress.__add__cCs t|t�stS|�t|�|�Srzr�r�r
r
r�__sub__Ys
z_BaseAddress.__sub__cCsd|jjt|�fS�Nz%s(%r)�r{rr$r[r
r
r�__repr__^sz_BaseAddress.__repr__cCst|�|j��Srz)r$�_string_from_ip_intr,r[r
r
r�__str__asz_BaseAddress.__str__cCsttt|j���Srz)�hash�hexrrr,r[r
r
r�__hash__dsz_BaseAddress.__hash__cCs
|j|fSrz�rLr[r
r
rrUgsz_BaseAddress._get_address_keycCs|j|jffSrz)r{r,r[r
r
rr|jsz_BaseAddress.__reduce__N)rrrr	r}r�r�r�r�r�r�r�r�rUr|r
r
r
rr:3sr:c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ejdd��Zejdd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zd&d'�Zd(d)�Zd*d+�ZdFd.d/�ZdGd0d1�Zed2d3��Zed4d5��Z d6d7�Z!d8d9�Z"ed:d;��Z#ed<d=��Z$ed>d?��Z%ed@dA��Z&edBdC��Z'edDdE��Z(d-S)HrSz}A generic IP network object.

    This IP class contains the version independent methods which are
    used by networks.
    cCsd|jjt|�fSr�r�r[r
r
rr�vsz_BaseNetwork.__repr__cCsd|j|jfS�N�%s/%d)rOrjr[r
r
rr�ysz_BaseNetwork.__str__ccs8t|j�}t|j�}t|d|�D]}|�|�Vq"dS)z�Generate Iterator over usable hosts in a network.

        This is like __iter__ except it doesn't return the network
        or broadcast addresses.

        r)N�rrrOrH�range�_address_class�r\�network�	broadcast�xr
r
r�hosts|s

z_BaseNetwork.hostsccs8t|j�}t|j�}t||d�D]}|�|�Vq"dS�Nr)r�r�r
r
r�__iter__�s

z_BaseNetwork.__iter__cCslt|j�}t|j�}|dkr>|||kr0td��|�||�S|d7}|||krZtd��|�||�SdS)Nrzaddress out of ranger))rrrOrH�
IndexErrorr�)r\�nr�r�r
r
r�__getitem__�s

z_BaseNetwork.__getitem__cCs^t|t�stS|j|jkr*td||f��|j|jkrB|j|jkS|j|jkrZ|j|jkSdSr�)r9rSrVrLr;rO�netmaskr�r
r
rr��s
�z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|j�t|j�kWStk
rFtYSXdSrz)rLrOrrr�rNrVr�r
r
rr��s
��z_BaseNetwork.__eq__cCstt|j�t|j�A�Srz)r�rrrOr�r[r
r
rr��sz_BaseNetwork.__hash__cCs8|j|jkrdSt|t�rdS|j|jj@|jjkSdS�NF)rLr9rSr,r�rOr�r
r
r�__contains__�s

z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kS)z*Tell if self is partly contained in other.)rOrHr�r
r
r�overlaps�s



�z_BaseNetwork.overlapscCs|�t|j�t|j�B�Srz)r�rrrO�hostmaskr[r
r
rrH�s�z_BaseNetwork.broadcast_addresscCs|�t|j�|jA�Srz)r�rrr�r>r[r
r
rr��sz_BaseNetwork.hostmaskcCsd|j|jfSr�)rOrMr[r
r
r�with_prefixlen�sz_BaseNetwork.with_prefixlencCsd|j|jfS�N�%s/%s)rOr�r[r
r
r�with_netmask�sz_BaseNetwork.with_netmaskcCsd|j|jfSr�)rOr�r[r
r
r�
with_hostmask�sz_BaseNetwork.with_hostmaskcCst|j�t|j�dS)z&Number of hosts in the current subnet.r))rrrHrOr[r
r
r�
num_addresses�sz_BaseNetwork.num_addressescCsdt|�f}t|��dS)Nz%%200s has no associated address classrbrer
r
rr��sz_BaseNetwork._address_classcCs|jSrz)rMr[r
r
rrj�sz_BaseNetwork.prefixlenccs|j|jkstd||f��t|t�s2td|��|�|�sLtd||f��||krXdS|�d|j|jf�}|�	�\}}||kr�||kr�|�|�r�|V|�	�\}}qz|�|�r�|V|�	�\}}qzt
d|||f��qz||kr�|Vn"||kr�|Vnt
d|||f��dS)a�Remove an address from a larger block.

        For example:

            addr1 = ip_network('192.0.2.0/28')
            addr2 = ip_network('192.0.2.1/32')
            list(addr1.address_exclude(addr2)) =
                [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'),
                 IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')]

        or IPv6:

            addr1 = ip_network('2001:db8::1/32')
            addr2 = ip_network('2001:db8::1/128')
            list(addr1.address_exclude(addr2)) =
                [ip_network('2001:db8::1/128'),
                 ip_network('2001:db8::2/127'),
                 ip_network('2001:db8::4/126'),
                 ip_network('2001:db8::8/125'),
                 ...
                 ip_network('2001:db8:8000::/33')]

        Args:
            other: An IPv4Network or IPv6Network object of the same type.

        Returns:
            An iterator of the IPv(4|6)Network objects which is self
            minus other.

        Raises:
            TypeError: If self and other are of differing address
              versions, or if other is not a network object.
            ValueError: If other is not completely contained by self.

        r7z%s is not a network objectz%s not contained in %sNr�z3Error performing exclusion: s1: %s s2: %s other: %s)rLr;r9rS�	subnet_ofrr{rOrjrI�AssertionError)r\r��s1�s2r
r
r�address_exclude�s@$�


�

��z_BaseNetwork.address_excludecCs`|j|jkrtd||f��|j|jkr,dS|j|jkr<dS|j|jkrLdS|j|jkr\dSdS)a�Compare two IP objects.

        This is only concerned about the comparison of the integer
        representation of the network addresses.  This means that the
        host bits aren't considered at all in this method.  If you want
        to compare host bits, you can easily enough do a
        'HostA._ip < HostB._ip'

        Args:
            other: An IP object.

        Returns:
            If the IP versions of self and other are the same, returns:

            -1 if self < other:
              eg: IPv4Network('192.0.2.0/25') < IPv4Network('192.0.2.128/25')
              IPv6Network('2001:db8::1000/124') <
                  IPv6Network('2001:db8::2000/124')
            0 if self == other
              eg: IPv4Network('192.0.2.0/24') == IPv4Network('192.0.2.0/24')
              IPv6Network('2001:db8::1000/124') ==
                  IPv6Network('2001:db8::1000/124')
            1 if self > other
              eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25')
                  IPv6Network('2001:db8::2000/124') >
                      IPv6Network('2001:db8::1000/124')

          Raises:
              TypeError if the IP versions are different.

        z"%s and %s are not of the same typerKr)r)rLr;rOr�r�r
r
r�compare_networks6s!�z_BaseNetwork.compare_networkscCs|j|j|jfS)z�Network-only key function.

        Returns an object that identifies this address' network and
        netmask. This function is a suitable "key" argument for sorted()
        and list.sort().

        )rLrOr�r[r
r
rrTfsz_BaseNetwork._get_networks_keyr)Nc	cs�|j|jkr|VdS|dk	rJ||jkr0td��|dkr@td��||j}|dkrZtd��|j|}||jkr~td||f��t|j�}t|j�d}t|j�d|?}t|||�D]}|�||f�}|Vq�dS)a�The subnets which join to make the current subnet.

        In the case that self contains only one IP
        (self._prefixlen == 32 for IPv4 or self._prefixlen == 128
        for IPv6), yield an iterator with just ourself.

        Args:
            prefixlen_diff: An integer, the amount the prefix length
              should be increased by. This should not be set if
              new_prefix is also set.
            new_prefix: The desired new prefix length. This must be a
              larger number (smaller prefix) than the existing prefix.
              This should not be set if prefixlen_diff is also set.

        Returns:
            An iterator of IPv(4|6) objects.

        Raises:
            ValueError: The prefixlen_diff is too small or too large.
                OR
            prefixlen_diff and new_prefix are both set or new_prefix
              is a smaller number than the current prefix (smaller
              number means a larger network)

        Nznew prefix must be longerr)�(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s)	rMr=rrrrOrHr�r�r{)	r\�prefixlen_diff�
new_prefix�
new_prefixlen�start�end�stepZnew_addrZcurrentr
r
rrIps2



��
z_BaseNetwork.subnetscCs�|jdkr|S|dk	rB||jkr(td��|dkr8td��|j|}|j|}|dkrftd|j|f��|�t|j�t|j�|>@|f�S)a�The supernet containing the current network.

        Args:
            prefixlen_diff: An integer, the amount the prefix length of
              the network should be decreased by.  For example, given a
              /24 network and a prefixlen_diff of 3, a supernet with a
              /21 netmask is returned.

        Returns:
            An IPv4 network object.

        Raises:
            ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have
              a negative prefix length.
                OR
            If prefixlen_diff and new_prefix are both set or new_prefix is a
              larger number than the current prefix (larger number means a
              smaller network)

        rNznew prefix must be shorterr)r�z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rMrrjr{rrrOr�)r\r�r�r�r
r
rrC�s&



���z_BaseNetwork.supernetcCs|jjo|jjS�z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        )rO�is_multicastrHr[r
r
rr��s	�z_BaseNetwork.is_multicastcCshz:|j|jkr"t|�d|�d���|j|jko8|j|jkWStk
rbtd|�d|����YnXdS)Nz and z are not of the same versionz*Unable to test subnet containment between )rLr;rOrHrN)�a�br
r
r�
_is_subnet_of�s
�z_BaseNetwork._is_subnet_ofcCs|�||�S)z1Return True if this network is a subnet of other.�r�r�r
r
rr��sz_BaseNetwork.subnet_ofcCs|�||�S)z3Return True if this network is a supernet of other.r�r�r
r
r�supernet_of�sz_BaseNetwork.supernet_ofcCs|jjo|jjS)��Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        )rO�is_reservedrHr[r
r
rr��s	�z_BaseNetwork.is_reservedcCs|jjo|jjS�z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        )rO�
is_link_localrHr[r
r
rr��s�z_BaseNetwork.is_link_localcCs|jjo|jjS)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        )rO�
is_privaterHr[r
r
rr�s	�z_BaseNetwork.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        �r�r[r
r
r�	is_globals	z_BaseNetwork.is_globalcCs|jjo|jjS)��Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        )rO�is_unspecifiedrHr[r
r
rr�s	�z_BaseNetwork.is_unspecifiedcCs|jjo|jjS)��Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        )rO�is_loopbackrHr[r
r
rr�(s	�z_BaseNetwork.is_loopback)r)N)r)N))rrrr	r�r�r�r�r�r�r�r�r�r��	functools�cached_propertyrHr�r~r�r�r�r�r�rjr�r�rTrIrCr��staticmethodr�r�r�r�r�r�r�r�r�r
r
r
rrSnsd








K0

5
)








rSc@s�eZdZdZdZdZdedZeZiZ	dd�Z
edd	��Zed
d��Z
edd
��Zedd��Zdd�Zedd��Zedd��ZdS)�_BaseV4zyBase IPv4 object.

    The following methods are used by IPv4 objects in both single IP
    addresses and networks.

    r
rr#r)cCst|�Srzr^r[r
r
rrZHsz$_BaseV4._explode_shorthand_ip_stringcCs�||jkr�t|t�r<|}d|kr.|jksjn|�|�n.z|�|�}Wntk
rh|�|�}YnXt|�	|��}||f|j|<|j|S�aMake a (netmask, prefix_len) tuple from the given argument.

        Argument can be:
        - an integer (the prefix length)
        - a string representing the prefix length (e.g. "24")
        - a string representing the prefix netmask (e.g. "255.255.255.0")
        r)
�_netmask_cacher9rrr=rorsrrvr
rk�ri�argrjr�r
r
r�
_make_netmaskKs	

z_BaseV4._make_netmaskc
Cs~|std��|�d�}t|�dkr.td|��zt�t|j|�d�WStk
rx}ztd||f�d�W5d}~XYnXdS)aTurn the given IP string into an integer for comparison.

        Args:
            ip_str: A string, the IP ip_str.

        Returns:
            The IP ip_str as an integer.

        Raises:
            AddressValueError: if ip_str isn't a valid IPv4 Address.

        �Address cannot be empty�.rzExpected 4 octets in %rr�%s in %rN)rr%r&rr�
from_bytes�map�_parse_octetr)riruZoctets�excr
r
rrtes
z_BaseV4._ip_int_from_stringcCs�|std��|��r|��s,d}t||��t|�dkrHd}t||��|dkrl|ddkrld}t||��t|d�}|d	kr�td
|��|S)aConvert a decimal octet into an integer.

        Args:
            octet_str: A string, the number to parse.

        Returns:
            The octet as an integer.

        Raises:
            ValueError: if the octet isn't strictly a decimal from [0..255].

        zEmpty octet not permittedz#Only decimal digits permitted in %r�z$At most 3 characters permitted in %r�0rz%Leading zeros are not permitted in %r�
�zOctet %d (> 255) not permitted)rrprqr&rr)riZ	octet_strrfZ	octet_intr
r
rr�s
z_BaseV4._parse_octetcCsd�tt|�dd���S)z�Turns a 32-bit integer into dotted decimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            The IP address as a string in dotted decimal notation.

        r�rr)�joinr�r$r)rirmr
r
rr��sz_BaseV4._string_from_ip_intcCs&t|��d�ddd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv4 address.

        This implements the method described in RFC1035 3.5.

        r�NrKz
.in-addr.arpa)r$r%r�)r\Zreverse_octetsr
r
rr`�sz_BaseV4._reverse_pointercCs|jSrz�r=r[r
r
r�
max_prefixlen�sz_BaseV4.max_prefixlencCs|jSrzr�r[r
r
rr<�sz_BaseV4.versionN)rrrr	r}rL�
IPV4LENGTHr>r=r�rZrr�rtr�r�r`r~r�r<r
r
r
rr�5s(


#
	
r�c@s�eZdZdZdZdd�Zedd��Zedd��Zee	�
�d	d
���Zee	�
�dd���Zed
d��Z
edd��Zedd��Zedd��ZdS)r
z/Represent and manipulate single IPv4 Addresses.�r,�__weakref__cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)a�
        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv4Address('192.0.2.1') == IPv4Address(3221225985).
              or, more generally
              IPv4Address(int(IPv4Address('192.0.2.1'))) ==
                IPv4Address('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.

        Nrrr"�Unexpected '/' in %r�
r9rrrgr,rwrhr�r$rrt�r\rZaddr_strr
r
r�__init__�s


zIPv4Address.__init__cCs
t|j�S�z*The binary representation of this address.)rr,r[r
r
r�packed�szIPv4Address.packedcCs||jjkS)z�Test if the address is otherwise IETF reserved.

         Returns:
             A boolean, True if the address is within the
             reserved IPv4 Network range.

        )�
_constants�_reserved_networkr[r
r
rr��s	zIPv4Address.is_reservedcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry.

        c3s|]}�|kVqdSrzr
��.0r?r[r
r�	<genexpr>sz)IPv4Address.is_private.<locals>.<genexpr>��anyr��_private_networksr[r
r[rr��s
zIPv4Address.is_privatecCs||jjko|jSrz)r��_public_networkr�r[r
r
rr�szIPv4Address.is_globalcCs||jjkS)z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is multicast.
            See RFC 3171 for details.

        �r��_multicast_networkr[r
r
rr�s	zIPv4Address.is_multicastcCs||jjkS)z�Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 5735 3.

        )r��_unspecified_addressr[r
r
rr�s	zIPv4Address.is_unspecifiedcCs||jjkS)z�Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback per RFC 3330.

        )r��_loopback_networkr[r
r
rr�"szIPv4Address.is_loopbackcCs||jjkS)z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is link-local per RFC 3927.

        �r��_linklocal_networkr[r
r
rr�,szIPv4Address.is_link_localN)rrrr	r}r�r~r�r�r��	lru_cacher�r�r�r�r�r�r
r
r
rr
�s*#








	r
c@sxeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dS�NF)r)ryr
r�rr�r�rM�r\rr'�maskr
r
rr�9s

zIPv4Interface.__init__cCs|jjSrz�r�r�r[r
r
rr�AszIPv4Interface.hostmaskcCsd|�|j�|jfSr��r�r,rMr[r
r
rr�Es�zIPv4Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)r
r�rVr�rN�r\r�Z
address_equalr
r
rr�IszIPv4Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)r
r�rVr�rN�r\r�Zaddress_lessr
r
rr�Us�zIPv4Interface.__lt__cCst|j|jt|jj�f�Srz�r�r,rMrrr�rOr[r
r
rr�aszIPv4Interface.__hash__cCs
t|j�Srz)r
r,r[r
r
rr1fszIPv4Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr�js�zIPv4Interface.with_prefixlencCsd|�|j�|jfSr��r�r,r�r[r
r
rr�os�zIPv4Interface.with_netmaskcCsd|�|j�|jfSr��r�r,r�r[r
r
rr�ts�zIPv4Interface.with_hostmaskN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r
r
r
rr7s 



rc@s2eZdZdZeZddd�Zee�	�dd���Z
dS)	raeThis class represents and manipulates 32-bit IPv4 network + addresses..

    Attributes: [examples for IPv4Network('192.0.2.0/27')]
        .network_address: IPv4Address('192.0.2.0')
        .hostmask: IPv4Address('0.0.0.31')
        .broadcast_address: IPv4Address('192.0.2.32')
        .netmask: IPv4Address('255.255.255.224')
        .prefixlen: 27

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)aInstantiate a new IPv4 network object.

        Args:
            address: A string or integer representing the IP [& network].
              '192.0.2.0/24'
              '192.0.2.0/255.255.255.0'
              '192.0.2.0/0.0.0.255'
              are all functionally the same in IPv4. Similarly,
              '192.0.2.1'
              '192.0.2.1/255.255.255.255'
              '192.0.2.1/32'
              are also functionally equivalent. That is to say, failing to
              provide a subnetmask will create an object with a mask of /32.

              If the mask (portion after the / in the argument) is given in
              dotted quad form, it is treated as a netmask if it starts with a
              non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it
              starts with a zero field (e.g. 0.255.255.255 == /8), with the
              single exception of an all-zero mask which is treated as a
              netmask == /0. If no mask is given, a default of /32 is used.

              Additionally, an integer can be passed, so
              IPv4Network('192.0.2.1') == IPv4Network(3221225985)
              or, more generally
              IPv4Interface(int(IPv4Interface('192.0.2.1'))) ==
                IPv4Interface('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv4 address.
            ValueError: If strict is True and a network address is not
              supplied.
        �%s has host bits setr)cs
t��gSrz)r
r
�r'r
r�<lambda>��z&IPv4Network.__init__.<locals>.<lambda>N)ryr
rOr�r�rMrrrr=r�r��r\rrr�r�r
rrr��s#

�
zIPv4Network.__init__cCs&|jtd�ko|jtd�ko$|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry.

        �
100.64.0.0/10)rOrrHr�r[r
r
rr��s

��zIPv4Network.is_globalN)T)rrrr	r
r�r�r~r�r�r�r
r
r
rrzs
4rc@s�eZdZed�Zed�Zed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�ed
�ed�ed�ed�gZed�Z	e
d�ZdS)�_IPv4Constantsz169.254.0.0/16z127.0.0.0/8z224.0.0.0/4rz	0.0.0.0/8z
10.0.0.0/8z
172.16.0.0/12z192.0.0.0/29z192.0.0.170/31z192.0.2.0/24z192.168.0.0/16z
198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z240.0.0.0/4z255.255.255.255/32z0.0.0.0N)rrrrr�r�r�r�r�r�r
r�r
r
r
rr�s*�rc@s�eZdZdZdZdZdedZdZe	d�Z
eZiZe
dd	��Ze
d
d��Ze
dd
��Ze
dd��Ze
ddd��Zdd�Zdd�Zedd��Zedd��ZdS)�_BaseV6zyBase IPv6 object.

    The following methods are used by IPv6 objects in both single IP
    addresses and networks.

    r
r8r#r)rlZ0123456789ABCDEFabcdefcCsl||jkrbt|t�r<|}d|kr.|jksFn|�|�n
|�|�}t|�|��}||f|j|<|j|Sr�)r�r9rrr=rorsrrkr�r
r
rr�s	


z_BaseV6._make_netmaskc
Cs�|std��|�d�}d}t|�|kr:d||f}t|��d|dkr�zt|���j}Wn4tk
r�}ztd||f�d�W5d}~XYnX|�d	|d
?d@�|�d	|d@�|jd}t|�|kr�d
|d|f}t|��d}tdt|�d�D]*}	||	s�|dk	�r d|}t|��|	}q�|dk	�r�|}
t|�|d}|d�sl|
d8}
|
�rld}t||��|d�s�|d8}|�r�d}t||��|j|
|}|dk�r2d}t||jd|f��njt|�|jk�r�d}t||j|f��|d�sd}t||��|d�s"d}t||��t|�}
d}d}znd}
t|
�D] }	|
d
K}
|
|�	||	�O}
�q@|
d
|K}
t|d�D] }	|
d
K}
|
|�	||	�O}
�qz|
WSt
k
�r�}ztd||f�d�W5d}~XYnXdS)z�Turn an IPv6 ip_str into an integer.

        Args:
            ip_str: A string, the IPv6 ip_str.

        Returns:
            An int, the IPv6 address

        Raises:
            AddressValueError: if ip_str isn't a valid IPv6 Address.

        r��:r�z At least %d parts expected in %rr�rKr�N�%xr �r)z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r)rr%r&r
rBr,rE�
_HEXTET_COUNTr��
_parse_hextetr)riru�partsZ
_min_partsrfZipv4_intr�Z
_max_partsZ
skip_index�iZparts_hiZparts_loZ
parts_skippedrmr
r
rrts�
$







z_BaseV6._ip_int_from_stringcCs>|j�|�std|��t|�dkr4d}t||��t|d�S)a&Convert an IPv6 hextet string into an integer.

        Args:
            hextet_str: A string, the number to parse.

        Returns:
            The hextet as an integer.

        Raises:
            ValueError: if the input isn't strictly a hex number from
              [0..FFFF].

        zOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr )�_HEX_DIGITS�
issupersetrr&rr)riZ
hextet_strrfr
r
rr~sz_BaseV6._parse_hextetc	Cs�d}d}d}d}t|�D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr�||}|t|�kr~|dg7}dg|||�<|dkr�dg|}|S)a�Compresses a list of hextets.

        Compresses a list of strings, replacing the longest continuous
        sequence of "0" in the list with "" and adding empty strings at
        the beginning or at the end of the string such that subsequently
        calling ":".join(hextets) will produce the compressed version of
        the IPv6 address.

        Args:
            hextets: A list of strings, the hextets to compress.

        Returns:
            A list of strings.

        rKrr�r)�)�	enumerater&)	ri�hextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_len�indexZhextetZbest_doublecolon_endr
r
r�_compress_hextets�s0�

z_BaseV6._compress_hextetsNcsZ|dkrt|j�}||jkr$td��d|��fdd�tddd�D�}|�|�}d	�|�S)
a,Turns a 128-bit integer into hexadecimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            A string, the hexadecimal representation of the address.

        Raises:
            ValueError: The address is bigger than 128 bits of all ones.

        NzIPv6 address is too large�%032xcs&g|]}dt�||d�d��qS)rrr )rr�r�r��Zhex_strr
r�
<listcomp>�sz/_BaseV6._string_from_ip_int.<locals>.<listcomp>rrrr)rrr,r>rr�rr�)rirmrr
rrr��s


z_BaseV6._string_from_ip_intcs�t|t�rt|j�}nt|t�r,t|j�}nt|�}|�|�}d|��fdd�tddd�D�}t|ttf�r�dd�	|�|j
fSd�	|�S)	z�Expand a shortened IPv6 address.

        Args:
            ip_str: A string, the IPv6 address.

        Returns:
            A string, the expanded IPv6 address.

        rcsg|]}�||d��qS)rr
rrr
rr�sz8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>rrrr�r)r9rr$rOrr1rtr�rSr�rM)r\rurmrr
rrrZ�s



z$_BaseV6._explode_shorthand_ip_stringcCs&|jddd��dd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv6 address.

        This implements the method described in RFC3596 2.5.

        NrKrrr�z	.ip6.arpa)r]�replacer�)r\Z
reverse_charsr
r
rr`�sz_BaseV6._reverse_pointercCs|jSrzr�r[r
r
rr�sz_BaseV6.max_prefixlencCs|jSrzr�r[r
r
rr<sz_BaseV6.version)N)rrrr	r}rL�
IPV6LENGTHr>r�	frozensetrr=r�rr�rtrrr�rZr`r~r�r<r
r
r
rr
�s0

g

/	
r
c@s�eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	edd��Z
ed
d��Zee�
�dd���Zedd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)rz/Represent and manipulate single IPv6 Addresses.r�cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)aInstantiate a new IPv6 address object.

        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv6Address('2001:db8::') ==
                IPv6Address(42540766411282592856903984951653826560)
              or, more generally
              IPv6Address(int(IPv6Address('2001:db8::'))) ==
                IPv6Address('2001:db8::')

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.

        Nr rr"r�r�r�r
r
rr�s


zIPv6Address.__init__cCs
t|j�Sr�)r!r,r[r
r
rr�6szIPv6Address.packedcCs||jjkSr�r�r[r
r
rr�;s	zIPv6Address.is_multicastcst�fdd��jjD��S)r�c3s|]}�|kVqdSrzr
rr[r
rr�Osz*IPv6Address.is_reserved.<locals>.<genexpr>)r�r��_reserved_networksr[r
r[rr�Fs	zIPv6Address.is_reservedcCs||jjkSr�r�r[r
r
rr�QszIPv6Address.is_link_localcCs||jjkS�a`Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        )r��_sitelocal_networkr[r
r
r�
is_site_local[szIPv6Address.is_site_localcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv6-special-registry.

        c3s|]}�|kVqdSrzr
r�r[r
rr�ssz)IPv6Address.is_private.<locals>.<genexpr>r�r[r
r[rr�is
zIPv6Address.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, true if the address is not reserved per
            iana-ipv6-special-registry.

        r�r[r
r
rr�us	zIPv6Address.is_globalcCs
|jdkS)r�rr�r[r
r
rr��s	zIPv6Address.is_unspecifiedcCs
|jdkS)r�r)r�r[r
r
rr��s	zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@�S)z�Return the IPv4 mapped address.

        Returns:
            If the IPv6 address is a v4 mapped address, return the
            IPv4 mapped address. Return None otherwise.

        rrN����r,r
r[r
r
r�ipv4_mapped�s	zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@�t|jd@�fS)z�Tuple of embedded teredo IPs.

        Returns:
            Tuple of the (server, client) IPs or None if the address
            doesn't appear to be a teredo address (doesn't start with
            2001::/32)

        �`i N�@r'r(r[r
r
r�teredo�s

�zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@�S)z�Return the IPv4 6to4 embedded address.

        Returns:
            The IPv4 6to4-embedded address if present or None if the
            address doesn't appear to contain a 6to4 embedded address.

        �pi N�Pr'r(r[r
r
r�	sixtofour�s	zIPv6Address.sixtofourN)rrrr	r}r�r~r�r�r�r�r&r�r�r�r�r�r�r)r,r/r
r
r
rrs8$





	










rc@s�eZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dSr�)ryrr�rr�r�rMr�r
r
rr��s

zIPv6Interface.__init__cCs|jjSrzr�r[r
r
rr��szIPv6Interface.hostmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)rr�rVr�rNrr
r
rr��szIPv6Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)rr�rVr�rNrr
r
rr��s�zIPv6Interface.__lt__cCst|j|jt|jj�f�Srzrr[r
r
rr��szIPv6Interface.__hash__cCs
t|j�Srz)rr,r[r
r
rr1�szIPv6Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_prefixlencCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_netmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_hostmaskcCs|jdko|jjS)Nr)r,r�r�r[r
r
rr�szIPv6Interface.is_unspecifiedcCs|jdko|jjSr�)r,r�r�r[r
r
rr�szIPv6Interface.is_loopbackN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r�r�r
r
r
rr�s(





rc@s2eZdZdZeZd
dd�Zdd�Zedd��Z	d	S)ravThis class represents and manipulates 128-bit IPv6 networks.

    Attributes: [examples for IPv6('2001:db8::1000/124')]
        .network_address: IPv6Address('2001:db8::1000')
        .hostmask: IPv6Address('::f')
        .broadcast_address: IPv6Address('2001:db8::100f')
        .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0')
        .prefixlen: 124

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)a�Instantiate a new IPv6 Network object.

        Args:
            address: A string or integer representing the IPv6 network or the
              IP and prefix/netmask.
              '2001:db8::/128'
              '2001:db8:0000:0000:0000:0000:0000:0000/128'
              '2001:db8::'
              are all functionally the same in IPv6.  That is to say,
              failing to provide a subnetmask will create an object with
              a mask of /128.

              Additionally, an integer can be passed, so
              IPv6Network('2001:db8::') ==
                IPv6Network(42540766411282592856903984951653826560)
              or, more generally
              IPv6Network(int(IPv6Network('2001:db8::'))) ==
                IPv6Network('2001:db8::')

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::1000/124 and not an
              IP address on a network, eg, 2001:db8::1/124.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.
        rr)cs
t��gSrz)rr
rr
rrIr	z&IPv6Network.__init__.<locals>.<lambda>N)ryrrOr�r�rMrrrr=r�r�r
r
rrr�s

�
zIPv6Network.__init__ccs<t|j�}t|j�}t|d|d�D]}|�|�Vq&dS)z�Generate Iterator over usable hosts in a network.

          This is like __iter__ except it doesn't return the
          Subnet-Router anycast address.

        r)Nr�r�r
r
rr�Ks

zIPv6Network.hostscCs|jjo|jjSr$)rOr&rHr[r
r
rr&Ws�zIPv6Network.is_site_localN)T)
rrrr	rr�r�r�r~r&r
r
r
rrs
0rc@s�eZdZed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�g
Zed�ed
�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�gZed�ZdS)�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z100::/64z	2001::/23z2001:2::/48z
2001:db8::/32z2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)	rrrrr�r�r�r#r%r
r
r
rr0gs<��r0)T)#r	�__version__r�r�r!rrrrrrrr!r(r2r6r@rJrRrXrY�total_orderingr:rSr�r
rrrr�r
rrrr0r
r
r
r�<module>sV
#7163:IuCR 5K\!__future__.cpython-38.pyc000064400000010100151450073350011275 0ustar00U

e5d�
@s�dZddddddddd	d
g
ZdgeZdZd
ZdZdZdZdZdZ	dZ
dZdZGdd�d�Z
e
dde�Ze
dde�Ze
dde�Ze
dde�Ze
dde�Ze
d de�Ze
d de	�Ze
d!d"e
�Ze
d#d$e�Ze
d%d&e�Zd'S)(afRecord of phased-in incompatible language changes.

Each line is of the form:

    FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
                              CompilerFlag ")"

where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:

    (PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
     PY_MINOR_VERSION, # the 1; an int
     PY_MICRO_VERSION, # the 0; an int
     PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
     PY_RELEASE_SERIAL # the 3; an int
    )

OptionalRelease records the first release in which

    from __future__ import FeatureName

was accepted.

In the case of MandatoryReleases that have not yet occurred,
MandatoryRelease predicts the release in which the feature will become part
of the language.

Else MandatoryRelease records when the feature became part of the language;
in releases at or after that, modules no longer need

    from __future__ import FeatureName

to use the feature in question, but may continue to use such imports.

MandatoryRelease may also be None, meaning that a planned feature got
dropped.

Instances of class _Feature have two corresponding methods,
.getOptionalRelease() and .getMandatoryRelease().

CompilerFlag is the (bitfield) flag that should be passed in the fourth
argument to the builtin function compile() to enable the feature in
dynamically compiled code.  This flag is stored in the .compiler_flag
attribute on _Future instances.  These values must match the appropriate
#defines of CO_xxx flags in Include/compile.h.

No feature line is ever to be deleted from this file.
�
nested_scopes�
generators�division�absolute_import�with_statement�print_function�unicode_literals�barry_as_FLUFL�generator_stop�annotations�all_feature_names��iiiii i@i�ic@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_FeaturecCs||_||_||_dS)N)�optional�	mandatory�
compiler_flag)�selfZoptionalReleaseZmandatoryReleaser�r�"/usr/lib64/python3.8/__future__.py�__init__Ssz_Feature.__init__cCs|jS)z�Return first release in which this feature was recognized.

        This is a 5-tuple, of the same form as sys.version_info.
        )r�rrrr�getOptionalReleaseXsz_Feature.getOptionalReleasecCs|jS)z�Return release in which this feature will become mandatory.

        This is a 5-tuple, of the same form as sys.version_info, or, if
        the feature was dropped, is None.
        )rrrrr�getMandatoryRelease_sz_Feature.getMandatoryReleasecCsdt|j|j|jf�S)Nr)�reprrrrrrrr�__repr__gs�z_Feature.__repr__N)�__name__�
__module__�__qualname__rrrrrrrrrQsr)��r
�betar)rrr
�alphar
)rrr
r!r)r�r
�finalr
)rrr
r!r)r"r
r
r!r
)r�r
r!r)r�r
r!r
)rr%r
r!r)r"rr
r!r)�r
r
r!r
)r"r$r
r r)r"�r
r!r
)r"r'r
r r)r"�
r
r!r
N)�__doc__r�__all__Z	CO_NESTEDZCO_GENERATOR_ALLOWEDZCO_FUTURE_DIVISIONZCO_FUTURE_ABSOLUTE_IMPORTZCO_FUTURE_WITH_STATEMENTZCO_FUTURE_PRINT_FUNCTIONZCO_FUTURE_UNICODE_LITERALSZCO_FUTURE_BARRY_AS_BDFLZCO_FUTURE_GENERATOR_STOPZCO_FUTURE_ANNOTATIONSrrrrrrrrrr	r
rrrr�<module>s~2�
����������reprlib.cpython-38.opt-2.pyc000064400000012035151450073350011577 0ustar00U

e5d��@sZdddgZddlZddlmZddlmZddd�ZGd	d�d�Zd
d�Ze�Z	e	j
Z
dS)
�Repr�repr�recursive_repr�N)�islice)�	get_ident�...cs�fdd�}|S)NcsXt�����fdd�}t�d�|_t�d�|_t�d�|_t�d�|_t�di�|_|S)Nc	sBt|�t�f}|�kr�S��|�z�|�}W5��|�X|S�N)�idr�add�discard)�self�key�result)�	fillvalue�repr_running�
user_function��/usr/lib64/python3.8/reprlib.py�wrappers
z<recursive_repr.<locals>.decorating_function.<locals>.wrapper�
__module__�__doc__�__name__�__qualname__�__annotations__)�set�getattrrrrrr)rr�r)rrr�decorating_functionsz+recursive_repr.<locals>.decorating_functionr)rrrrrr	sc@s~eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)N�����()�maxlevel�maxtuple�maxlist�maxarray�maxdict�maxset�maxfrozenset�maxdeque�	maxstring�maxlong�maxother)rrrr�__init__&sz
Repr.__init__cCs|�||j�Sr)�repr1r#)r�xrrrr3sz	Repr.reprcCsVt|�j}d|kr$|��}d�|�}t|d|�rFt|d|�||�S|�||�SdS)N� �_�repr_)�typer�split�join�hasattrr�
repr_instance)rr0�level�typename�partsrrrr/6s

z
Repr.repr1�c
s�t|�}|dkr|rd}nX|d�|j���fdd�t||�D�}	||krT|	�d�d�|	�}|dkrr|rr||}d|||fS)Nrr�csg|]}�|���qSrr)�.0�elem��newlevelr/rr�
<listcomp>Gsz'Repr._repr_iterable.<locals>.<listcomp>�, z%s%s%s)�lenr/r�appendr6)
rr0r9�left�right�maxiter�trail�n�s�piecesrr@r�_repr_iterable@s

zRepr._repr_iterablecCs|�||dd|jd�S)N�(�)�,)rMr$�rr0r9rrr�
repr_tupleMszRepr.repr_tuplecCs|�||dd|j�S)N�[�])rMr%rQrrr�	repr_listPszRepr.repr_listcCs,|sd|jSd|j}|�|||d|j�S)Nzarray('%s')z
array('%s', [�]))�typecoderMr&)rr0r9�headerrrr�
repr_arraySs

zRepr.repr_arraycCs$|sdSt|�}|�||dd|j�S)Nzset()�{�})�_possibly_sortedrMr(rQrrr�repr_setYsz
Repr.repr_setcCs$|sdSt|�}|�||dd|j�S)Nzfrozenset()zfrozenset({z}))r\rMr)rQrrr�repr_frozenset_s�zRepr.repr_frozensetcCs|�||dd|j�S)Nzdeque([rV)rMr*rQrrr�
repr_dequefszRepr.repr_dequecCs�t|�}|dkrdS|dkr dS|d}|j}g}tt|�|j�D].}|||�}||||�}	|�d||	f�qB||jkr�|�d�d�|�}
d|
fS)	Nrz{}z{...}r=z%s: %srrCz{%s})rDr/rr\r'rEr6)rr0r9rJrAr/rLr
�keyrepr�valreprrKrrr�	repr_dictis 



zRepr.repr_dictcCs�t�|d|j��}t|�|jkr�td|jdd�}td|jd|�}t�|d|�|t|�|d��}|d|�d|t|�|d�}|S�Nr��r)�builtinsrr+rD�max�rr0r9rK�i�jrrr�repr_strxs&$z
Repr.repr_strcCsht�|�}t|�|jkrdtd|jdd�}td|jd|�}|d|�d|t|�|d�}|Src)rfrrDr,rgrhrrr�repr_int�s
$z
Repr.repr_intcCs�zt�|�}Wn(tk
r6d|jjt|�fYSXt|�|jkr�td|jdd�}td|jd|�}|d|�d|t|�|d�}|S)Nz<%s instance at %#x>rrdrer)	rfr�	Exception�	__class__rr	rDr-rgrhrrrr8�s$zRepr.repr_instanceN)r<)rrrr.rr/rMrRrUrYr]r^r_rbrkrlr8rrrrr$s



	cCs,z
t|�WStk
r&t|�YSXdSr)�sortedrm�list)r0rrrr\�s
r\)r)�__all__rf�	itertoolsr�_threadrrrr\�aReprrrrrr�<module>s

s	shutil.cpython-38.opt-1.pyc000064400000111044151450073350011447 0ustar00U

e5d1��@s�dZddlZddlZddlZddlZddlZddlZzddlZ[dZWne	k
r^dZYnXzddl
Z
[
dZWne	k
r�dZYnXzddlZ[dZ
Wne	k
r�dZ
YnXzddlmZWne	k
r�dZYnXzddlmZWne	k
�rdZYnXejdkZdZZejdk�r6ddlZne�rDddlZe�rNd	nd
Zeed��ohej�d�ae�oxeed
�ZdZdddddddddddddddddd d!d"d#d$d%d&d'gZGd(d�de�ZGd)d'�d'e�Z Gd*d�de�Z!Gd+d�de�Z"Gd,d-�d-e�Z#Gd.d/�d/e$�Z%Gd0d1�d1e$�Z&d2d3�Z'd4d5�Z(efd6d7�Z)d�d8d�Z*d9d:�Z+d;d<�Z,d=d>�Z-dd?�d@d�Z.dd?�dAd�Z/eedB��r�dd?�dCdD�Z0ndEdD�Z0dd?�dFd�Z1dd?�dGd�Z2dd?�dHd�Z3dId#�Z4d�dJdK�Z5dde3ddfdLd�Z6eej7dM��rdNdO�Z8dPdQ�Z9ndRdO�Z8dSdQ�Z9dTdU�Z:dVdW�Z;ej<ejej=ej>hej?k�ofej@ejAk�ofejejBkZCd�dXd�ZDeCeD_EdYdZ�ZFe3fd[d�ZGd\d]�ZHd^d_�ZId`da�ZJdbdc�ZKd�dedf�ZLd�dgdh�ZMdieLdjgdkfiZNe�r�eLdlgdmfeNdn<eMgdofeNdp<e�r
eLdqgdrfeNds<e
�r eLdtgdufeNdv<dwd�ZOd�dyd�ZPdzd�ZQd�d{d�ZRd|d�ZSd}d~�ZTd�dd �ZUd�d!�ZVd�d��ZWd�d��ZXdd��d�d��ZYd�geYgdkfd�geXgdofd��ZZe�r�d�d�geYgdmfeZdn<e�r�d�d�geYgdrfeZds<e
�r�d�d�geYgdufeZdv<d�d��Z[d�dd��d�d"�Z\eed���rLe�]d��e�^d�d��Z_d�e_j`_d�e_ja_d�e_jb_d�d��Zcn$e�rpe�]d��e�^d�d��Z_d�d��Zcd�d�d$�Zdd�d�d&�Zed�d��ZfejgejhBdfd�d%�ZidS)�z�Utility functions for copying and archiving files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

�NTF)�getpwnam)�getgrnam�nt�posixii�sendfileZlinux�
_fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)rN)�__name__�
__module__�__qualname__�r$r$�/usr/lib64/python3.8/shutil.pyrEsc@seZdZdZdS)r z5Raised when source and destination are the same file.N�r!r"r#�__doc__r$r$r$r%r Hsc@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is
    not supported on a special file (e.g. a named pipe)Nr&r$r$r$r%rKsc@seZdZdZdS)rz+Raised when a command could not be executedNr&r$r$r$r%rOsc@seZdZdZdS)�	ReadErrorz%Raised when an archive cannot be readNr&r$r$r$r%r(Rsr(c@seZdZdZdS)�
RegistryErrorzVRaised when a registry operation with the archiving
    and unpacking registries failsNr&r$r$r$r%r)Usr)c@seZdZdZdS)�_GiveupOnFastCopyzuRaised as a signal to fallback on using raw read()/write()
    file copy when fast-copy functions fail to do so.
    Nr&r$r$r$r%r*Ysr*c
Cs�z|��}|��}Wn*tk
r>}zt|��W5d}~XYnXzt�|||�WnTtk
r�}z6|j|_|j|_|j	t	j
t	jhkr�t|��n|d�W5d}~XYnXdS)zhCopy a regular file content or metadata by using high-performance
    fcopyfile(3) syscall (macOS).
    N)�fileno�	Exceptionr*rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr$r$r%�_fastcopy_fcopyfile^s
r:c
CsDz|��}|��}Wn*tk
r>}zt|��W5d}~XYnXztt�|�jd�}Wntk
rnd}YnXtj	dkr�t
|d�}d}zt�||||�}Wn�tk
�r&}zj|j|_
|j|_|jtjkr�dat|��|jtjkr�|d�|dk�rt�|dtj�dk�rt|��|�W5d}~XYq�X|dk�r6�q@||7}q�dS)z�Copy data from one regular mmap-like fd to another by using
    high-performance sendfile(2) syscall.
    This should work on Linux >= 2.6.33 only.
    Ni�ili@rF)r+r,r*�max�os�fstat�st_sizer-�sys�maxsize�minrr.r/r0r1ZENOTSOCK�_USE_CP_SENDFILEZENOSPC�lseek�SEEK_CUR)r4r5r7r8r9Z	blocksize�offsetZsentr$r$r%�_fastcopy_sendfilers8


 
rFc
Csn|j}|j}tt|���L}||�}|s*q`q||krV|d|��}|�|�W5QRXq||�qW5QRXdS)z�readinto()/memoryview() based variant of copyfileobj().
    *fsrc* must support readinto() method and both files must be
    open in binary mode.
    N)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr$r$r%�_copyfileobj_readinto�srNcCs0|st}|j}|j}||�}|s"q,||�qdS)z=copy data from file-like object fsrc to file-like object fdstN)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr$r$r%r�scCs�t|tj�rJttjd�rJztj�|��t�|��WStk
rHYdSXttjd�r~ztj�||�WStk
r|YdSXtj�	tj�
|��tj�	tj�
|��kS)N�samestatF�samefile)�
isinstancer<�DirEntry�hasattr�pathrQ�statr-rR�normcase�abspath��src�dstr$r$r%�	_samefile�s�r]cCst|tj�r|��St�|�S�N)rSr<rTrW��fnr$r$r%�_stat�sracCs t|tj�r|��Stj�|�Sr^)rSr<rT�
is_symlinkrV�islinkr_r$r$r%�_islink�srd��follow_symlinksc	Cs�t�d||�t||�r(td�||���d}t||g�D]j\}}zt|�}Wntk
r`Yq8Xt�	|j
�r�t|tj
�r�|jn|}td|��tr8|dkr8|j}q8|s�t|�r�t�t�|�|��n
t|d����}t|d���}t�r,z,t||tj�|WW5QR�W5QR�Stk
�r(YnXn�t�rtz(t||�|WW5QR�W5QR�Stk
�rpYnXn>t�r�|dk�r�t||t|t��|W5QR�W5QR�St ||�W5QRXW5QRX|S)z�Copy data from src to dst in the most efficient way possible.

    If follow_symlinks is not set and src is a symbolic link, a new
    symlink will be created instead of copying the file it points to.

    zshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wb)!r?�auditr]r �format�	enumeraterar-rW�S_ISFIFO�st_moderSr<rTrVr�_WINDOWSr>rd�symlink�readlink�open�_HAS_FCOPYFILEr:rZ_COPYFILE_DATAr*rBrFrNrArOr)	r[r\rf�	file_size�ir`�str4r5r$r$r%r	�sD

cCspt�d||�|sFt|�rFtj�|�rFttd�r@tjtj}}qRdSnt	tj
}}||�}||t�|j
��dS)z�Copy mode bits from src to dst.

    If follow_symlinks is not set, symlinks aren't followed if and only
    if both `src` and `dst` are symlinks.  If `lchmod` isn't available
    (e.g. Linux) this method does nothing.

    zshutil.copymode�lchmodN)r?rirdr<rVrcrU�lstatrvra�chmodrW�S_IMODErm)r[r\rfZ	stat_funcZ
chmod_funcrur$r$r%r
!s
�	listxattrcCs�ztj||d�}Wn@tk
rR}z"|jtjtjtjfkr<�WY�dSd}~XYnX|D]j}z&tj|||d�}tj||||d�WqXtk
r�}z |jtj	tjtjtjfkr��W5d}~XYqXXqXdS)z�Copy extended filesystem attributes from `src` to `dst`.

        Overwrite existing attributes.

        If `follow_symlinks` is false, symlinks won't be followed.

        reN)
r<rzr-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\rf�names�er.�valuer$r$r%�
_copyxattr7s	�r�cOsdSr^r$)�args�kwargsr$r$r%r�Osc	
s`t�d||�ddd�dd��|p6t|�o4tj�|�}|rJ�fdd�}n�fdd�}t|tj�rp|j|d	�}n|d
�||d	�}t�	|j
�}|d�||j|jf|d�t
|||d	�z|d�|||d	�Wntk
r�YnXt|d
��r\z|d�||j|d	�WnVtk
�rZ}z6dD]*}tt|��r|jtt|�k�r�qJ�q�W5d}~XYnXdS)a�Copy file metadata

    Copy the permission bits, last access time, last modification time, and
    flags from `src` to `dst`. On Linux, copystat() also copies the "extended
    attributes" where possible. The file contents, owner, and group are
    unaffected. `src` and `dst` are path-like objects or path names given as
    strings.

    If the optional flag `follow_symlinks` is not set, symlinks aren't
    followed if and only if both `src` and `dst` are symlinks.
    zshutil.copystatN)�nsrfcWsdSr^r$)r�rfr�r$r$r%�_nop`szcopystat.<locals>._nopcstt|��Sr^)�getattrr<�r.�r�r$r%�lookupgszcopystat.<locals>.lookupcstt|��}|tjkr|S�Sr^)r�r<�supports_follow_symlinks)r.r`r�r$r%r�ls
rerW�utimerx�st_flagsZchflags)Z
EOPNOTSUPPr3)r?rirdr<rVrcrSrTrWryrm�st_atime_ns�st_mtime_nsr��NotImplementedErrorrUr�r-r1r�)	r[r\rfZfollowr�ru�mode�whyr9r$r�r%rRs4�
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a3Copy data and mode bits ("cp src dst"). Return the file's destination.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".

    If source and destination are the same file, a SameFileError will be
    raised.

    re)r<rV�isdir�join�basenamer	r
�r[r\rfr$r$r%r�s
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a0Copy data and metadata. Return the file's destination.

    Metadata is copied with copystat(). Please see the copystat function
    for more information.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".
    re)r<rVr�r�r�r	rr�r$r$r%r
�s
cs�fdd�}|S)z�Function that can be used as copytree() ignore parameter.

    Patterns is a sequence of glob-style patterns
    that are used to exclude filescs(g}�D]}|�t�||��qt|�Sr^)�extend�fnmatch�filter�set)rVr}�
ignored_names�pattern��patternsr$r%�_ignore_patterns�sz)ignore_patterns.<locals>._ignore_patternsr$)r�r�r$r�r%r�scCs>|dk	r$|t�|�dd�|D��}nt�}tj||d�g}	|tkpJ|tk}
|D�]~}|j|krbqPtj�||j�}tj�||j�}
|
r�|n|}z�|�	�}|r�tjdkr�|j
dd�}|jt
jkr�d}|�r8t�
|�}|r�t�||
�t||
|d�nBtj�|��s|�rWqP|���r,t||
||||d�n
|||
�n*|���rXt||
||||d�n
|||
�WqPtk
�r�}z|	�|jd�W5d}~XYqPtk
�r�}z|	�||
t|�f�W5d}~XYqPXqPzt||�WnJtk
�r*}z*t|d	d�dk�r|	�||t|�f�W5d}~XYnX|	�r:t|	��|S)
NcSsg|]
}|j�qSr$r�)�.0�xr$r$r%�
<listcomp>�sz_copytree.<locals>.<listcomp>)�exist_okrFre)�
dirs_exist_okrZwinerror)r<�fspathr��makedirsr
rr.rVr�rbrW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrpror�exists�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinksr�r��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrbrw�linktor9r�r$r$r%�	_copytree�s`




�
� (&r�c	
CsDt�d||�t�|��}t|�}W5QRXt||||||||d�S)aeRecursively copy a directory tree and return the destination directory.

    dirs_exist_ok dictates whether to raise an exception in case dst or any
    missing parent directory already exists.

    If exception(s) occur, an Error is raised with a list of reasons.

    If the optional symlinks flag is true, symbolic links in the
    source tree result in symbolic links in the destination tree; if
    it is false, the contents of the files pointed to by symbolic
    links are copied. If the file pointed by the symlink doesn't
    exist, an exception will be added in the list of errors raised in
    an Error exception at the end of the copy process.

    You can set the optional ignore_dangling_symlinks flag to true if you
    want to silence this exception. Notice that this has no effect on
    platforms that don't support os.symlink.

    The optional ignore argument is a callable. If given, it
    is called with the `src` parameter, which is the directory
    being visited by copytree(), and `names` which is the list of
    `src` contents, as returned by os.listdir():

        callable(src, names) -> ignored_names

    Since copytree() is called recursively, the callable will be
    called once for each directory that is copied. It returns a
    list of names relative to the `src` directory that should
    not be copied.

    The optional copy_function argument is a callable that will be used
    to copy each file. It will be called with the source path and the
    destination path as arguments. By default, copy2() is used, but any
    function that supports the same signature (like copy()) can be used.

    zshutil.copytree)r�r[r\r�r�r�r�r�)r?rir<�scandir�listr�)	r[r\r�r�r�r�r�Zitrr�r$r$r%rs&
��st_file_attributescCsPz4|jdd�}t�|j�o2|jtj@o0|jtjkWStk
rJYdSXdS�NFre)rW�S_ISDIRrmr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrur$r$r%�
_rmtree_isdir6s
�r�cCsLz0t�|�}t�|j�p.|jtj@o.|jtjkWSt	k
rFYdSXdS)NF)
r<rwrW�S_ISLNKrmr�r�r�r�r-)rVrur$r$r%�_rmtree_islink?s

�r�cCs*z|jdd�WStk
r$YdSXdSr�)r�r-)r�r$r$r%r�HscCstj�|�Sr^)r<rVrc)rVr$r$r%r�Nsc	Cs&z"t�|��}t|�}W5QRXWn*tk
rL|tj|t���g}YnX|D]�}|j}t|�r�z|��rvtd��Wn,tk
r�|tjj	|t���YqRYnXt
||�qRzt�|�WqRtk
r�|tj|t���YqRXqRzt�|�Wn(tk
�r |tj|t���YnXdS)N�%Cannot call rmtree on a symbolic link)
r<r�r�r-r?�exc_inforVr�rbrc�_rmtree_unsafe�unlink�rmdir)rV�onerror�
scandir_itr�r��fullnamer$r$r%r�Rs0

r�c
Cs.z"t�|��}t|�}W5QRXWn@tk
rb}z"||_|tj|t���WY�dSd}~XYnX|D�]�}tj�||j	�}z|j
dd�}Wntk
r�d}YnNX|r�z|jdd�}	t�|	j
�}Wn*tk
r�|tj|t���YqhYnX|�r�ztj|j	tj|d�}
Wn(tk
�r:|tj|t���Yn�Xz�tj�|	t�|
���r�t|
||�ztj|j	|d�Wn(tk
�r�|tj|t���YnXn8ztd��Wn*tk
�r�|tjj|t���YnXW5t�|
�Xqhztj|j	|d�Wqhtk
�r&|tj|t���YqhXqhdS)NFre)�dir_fdr�)r<r�r�r-r/r?r�rVr�r.r�rWr�rmrwrq�O_RDONLY�closerQr=�_rmtree_safe_fdr�rcr�)�topfdrVr�r�r�r9r�r�r��orig_st�dirfdr$r$r%r�qsR


r�c	Cs�t�d|�|rdd�}n|dkr*dd�}t�r`t|t�rDt�|�}zt�|�}Wn(tk
rz|tj|t�	��YdSXzt�
|tj�}Wn(tk
r�|tj
|t�	��YdSXz�tj
�|t�|���rt|||�zt�|�Wn(tk
�r|tj|t�	��YnXn8ztd��Wn*tk
�rL|tj
j|t�	��YnXW5t�|�XnNzt|��rttd��Wn,tk
�r�|tj
j|t�	��YdSXt||�SdS)a�Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if onerror
    is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is platform and implementation dependent;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
    is false and onerror is None, an exception is raised.

    z
shutil.rmtreecWsdSr^r$�r�r$r$r%r��szrmtree.<locals>.onerrorNcWs�dSr^r$r�r$r$r%r��sr�)r?ri�_use_fd_functionsrS�bytesr<�fsdecoderwr,r�rqr�r�rVrQr=r�r�r-rcr�r�)rV�
ignore_errorsr�r��fdr$r$r%r�sJ



cCs&tjjtjjpd}tj�|�|��S)N�)r<rV�sep�altsepr��rstrip)rVr�r$r$r%�	_basename�sr�c	CsTt�d||�|}tj�|�rbt||�r8t�||�dStj�|t|��}tj�	|�rbt
d|��zt�||�Wn�tk
�rNtj�|�r�t�
|�}t�||�t�|�n�tj�|��r6t||�r�t
d||f��t|��st�|tj��st�|��rtjdk�rtd||f��t|||dd�t|�n|||�t�|�YnX|S)	a+Recursively move a file or directory to another location. This is
    similar to the Unix "mv" command. Return the file or directory's
    destination.

    If the destination is a directory or a symlink to a directory, the source
    is moved inside the directory. The destination path must not already
    exist.

    If the destination already exists but is not a directory, it may be
    overwritten depending on os.rename() semantics.

    If the destination is on our current filesystem, then rename() is used.
    Otherwise, src is copied to the destination and then removed. Symlinks are
    recreated under the new name if os.rename() fails because of cross
    filesystem renames.

    The optional `copy_function` argument is a callable that will be used
    to copy the source or it will be delegated to `copytree`.
    By default, copy2() is used, but any function that supports the same
    signature (like copy()) can be used.

    A lot more could be done here...  A look at a mv.c shows a lot of
    the issues this implementation glosses over.

    zshutil.moveNz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.�darwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)r�r�)r?rir<rVr�r]�renamer�r�r�rr-rcrpror��
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)r[r\r�Zreal_dstr�r$r$r%r�sL


�
�����

cCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�Sr^)r<rVrY�endswithr��
startswithrZr$r$r%r�/sr�cCs(t|�}tjtjg}t|d�o&|j|kS)Nr�)rarW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[ruZimmutable_statesr$r$r%r�8sr�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns a gid, given a group name.N�)r�KeyError�r.�resultr$r$r%�_get_gid=s
r�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns an uid, given a user name.Nr�)rr�r�r$r$r%�_get_uidIs
r��gzipcs |dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���d	dl}	|rfd
|nd}
|d|
}tj�|�}|r�tj�	|�s�|dk	r�|�
d|�|s�t�|�|dk	r�|�
d
�t���t
�������fdd�}
|�s|	�|d|�}z|j||
d�W5|��X|S)a�Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", or None.

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_name' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", or ".xz").

    Returns the output filename.
    Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|Sr^)�gidZgname�uid�uname)Ztarinfo�r��group�ownerr�r$r%�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorrj�tarfiler<rV�dirnamer��infor�r�r�rqr��add)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionr�Zcompress_extZarchive_name�archive_dirr��tarr$r�r%�
_make_tarballUs>�

	
r	c	Csnddl}|d}tj�|�}|rNtj�|�sN|dk	r@|�d|�|sNt�|�|dk	rd|�d||�|�sj|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dk	r�|�d|	�t�|�D]�\}
}}t
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dk	r�|�d|	�q�|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|dk	�r|�d|	��qq�W5QRX|S)	z�Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Returns the
    name of the output zip file.
    rN�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVr�r�r�r��ZipFileZZIP_DEFLATED�normpath�curdirrH�walk�sortedr��isfile)rrrrrrZzip_filenamerZzfrV�dirpathZdirnames�	filenamesr.r$r$r%�
_make_zipfile�sH
��

rr)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)z�Returns a list of supported formats for archiving and unarchiving.

    Each element of the returned sequence is a tuple (name, description)
    cSsg|]\}}||df�qS)r�r$)r�r.�registryr$r$r%r��sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr$r$r%r�s
�r�cCst|dkrg}t|�s td|��t|ttf�s6td��|D]&}t|ttf�rXt|�dkr:td��q:|||ft|<dS)auRegisters an archive format.

    name is the name of the format. function is the callable that will be
    used to create archives. If provided, extra_args is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_archive_formats() function.
    NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorrS�tupler��lenr)r.�function�
extra_args�descriptionZelementr$r$r%r�s	
cCs
t|=dSr^)rr�r$r$r%r�sc	
Cst�d||||�t��}	|dk	rP|dk	r6|�d|�tj�|�}|sPt�|�|dkr^tj}||d�}
zt	|}Wn"t
k
r�td|�d�YnX|d}|dD]\}
}||
|
<q�|dkr�||
d	<||
d
<z|||f|
�}W5|dk	�r|dk	�r|�d|	�t�|	�X|S)aCreate an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", or "xztar".  Or any other registered format.

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    zshutil.make_archiveNzchanging into '%s')rrzunknown archive format '%s'r�rr�r�zchanging back to '%s')r?rir<�getcwd�debugrVrY�chdirrrr�r�)rrjZroot_dirrrrr�r�rZsave_cwdr��format_info�func�arg�valr/r$r$r%r�s8




cCsdd�t��D�}|��|S)z�Returns a list of supported formats for unpacking.

    Each element of the returned sequence is a tuple
    (name, extensions, description)
    cSs"g|]\}}||d|df�qS)r�r$)r�r.r�r$r$r%r�3sz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSrrrr$r$r%r-s
�c	Csji}t��D]\}}|dD]}|||<qq|D]$}||kr0d}t||||f��q0t|�sftd��dS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)r,rr)rr)	�
extensionsr r!Zexisting_extensionsr.r��ext�	extension�msgr$r$r%�_check_unpack_options8s�
r1cCs,|dkrg}t|||�||||ft|<dS)aMRegisters an unpack format.

    `name` is the name of the format. `extensions` is a list of extensions
    corresponding to the format.

    `function` is the callable that will be
    used to unpack archives. The callable will receive archives to unpack.
    If it's unable to handle an archive, it needs to raise a ReadError
    exception.

    If provided, `extra_args` is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_unpack_formats() function.
    N)r1r,)r.r-r r!r"r$r$r%rJscCs
t|=dS)z*Removes the pack format from the registry.N)r,r�r$r$r%r`scCs&tj�|�}tj�|�s"t�|�dS)z1Ensure that the parent directory of `path` existsN)r<rVr�r�r�)rVr�r$r$r%�_ensure_directorydsr2c		Cs�ddl}|�|�std|��|�|�}z�|��D]�}|j}|�d�s2d|krPq2tj	j
|f|�d���}|snq2t|�|�
d�s2|�|j�}t|d�}z|�|�W5|��~Xq2W5|��XdS)z+Unpack zip `filename` to `extract_dir`
    rNz%s is not a zip file�/z..rh)rZ
is_zipfiler(r
r�Zinfolistr/r�r<rVr��splitr2r�rPrqrH)	r/�extract_dirrrr�r.�target�data�fr$r$r%�_unpack_zipfilejs*




r9r�cCs\ddl}z|�|�}Wn"|jk
r8td|��YnXz|j||d�W5|��XdS)zAUnpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
    rNz/%s is not a compressed or uncompressed tar filer�)r�rqZTarErrorr(r�Z
extractall)r/r5r�r�Ztarobjr$r$r%�_unpack_tarfile�s�
r:r�r
)rrz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D],\}}|dD]}|�|�r|SqqdS)Nr)r,rr�)r/r.r�r/r$r$r%�_find_unpack_format�s

r;cCs�t�d|||�|dkr t��}t�|�}t�|�}|dkrBi}nd|i}|dk	r�zt|}Wn$tk
r�td�|��d�YnX|d}|||ft	|d�|��nRt
|�}|dkr�td�|���t|d}t	t|d�}|�|�|||f|�dS)a]Unpack an archive.

    `filename` is the name of the archive.

    `extract_dir` is the name of the target directory, where the archive
    is unpacked. If not provided, the current working directory is used.

    `format` is the archive format: one of "zip", "tar", "gztar", "bztar",
    or "xztar".  Or any other registered format.  If not provided,
    unpack_archive will use the filename extension and see if an unpacker
    was registered for that extension.

    In case none is found, a ValueError is raised.

    If `filter` is given, it is passed to the underlying
    extraction function.
    zshutil.unpack_archiveNr�zUnknown unpack format '{0}'r#r�zUnknown archive format '{0}')
r?rir<r$r�r,r�r�rj�dictr;r(�update)r/r5rjr�Z
filter_kwargsr'r(r�r$r$r%r�s,


�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�S)z�Return disk usage statistics about the given path.

        Returned value is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )r<r>�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVru�free�total�usedr$r$r%r?�s

cCs"t�|�\}}||}t|||�S)z�Return disk usage statistics about the given path.

        Returned values is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )rZ
_getdiskusagerD)rVrFrErGr$r$r%r?�scCs�t�d|||�|dkr(|dkr(td��|}|}|dkr>d}n(t|t�rft|�}|dkrftd�|���|dkrtd}n(t|t�s�t	|�}|dkr�td�|���t
�|||�dS)z�Change owner user and group of the given path.

    user and group can be the uid/gid or the user/group names, and in that case,
    they are converted to their respective uid/gid.
    zshutil.chownNzuser and/or group must be set���zno such user: {!r}zno such group: {!r})r?rir�rSr�r��LookupErrorrj�intr�r<r)rV�userr�Z_userZ_groupr$r$r%rs$

��P�c
Cs�zttjd�}Wnttfk
r.d}YnXzttjd�}Wnttfk
r^d}YnX|dksp|dkr�zt�tj���}Wn$t	tt
fk
r�t�|�}YnX|dkr�|j}|dkr�|j
}t�||f�S)aGet the size of the terminal window.

    For each of the two dimensions, the environment variable, COLUMNS
    and LINES respectively, is checked. If the variable is defined and
    the value is a positive integer, it is used.

    When COLUMNS or LINES is not defined, which is the common case,
    the terminal connected to sys.__stdout__ is queried
    by invoking os.get_terminal_size.

    If the terminal size cannot be successfully queried, either because
    the system doesn't support querying, or because we are not
    connected to a terminal, the value given in fallback parameter
    is used. Fallback defaults to (80, 24) which is the default
    size used by many terminal emulators.

    The value returned is a named tuple of type os.terminal_size.
    ZCOLUMNSrZLINES)rJr<�environr�r�rr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)ZfallbackrSrT�sizer$r$r%r(s$

cCs&tj�|�o$t�||�o$tj�|�Sr^)r<rVr�r�r�)r`r�r$r$r%�
_access_checkYs�rVc
	s�tj���rt�|�r�SdSt�t�}|dkrttj�dd�}|dkrtzt�d�}Wnt	t
fk
rrtj}YnX|s|dS|r�t�|�}|�
t�tj��}nt�|�}|�
tj�}tjdk�rTtj}|r�t�|�}||kr�|�d|�t�d�p�t}dd�|�
tj�D�}|�r d	d�|D�}t�fd
d�|D���r@�g}n�fdd�|D�}n�g}t�}|D]X}	tj�|	�}
|
|k�rd|�|
�|D],}tj�|	|�}t||��r�|S�q��qddS)
a3Given 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.

    N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr$r$�r�r.r$r$r%r��szwhich.<locals>.<listcomp>cSsg|]}t�|��qSr$)r<�fsencoderYr$r$r%r��sc3s |]}����|���VqdSr^)�lowerr�rY��cmdr$r%�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSr$r$rYr\r$r%r��s)r<rVr�rVrSr�rO�get�confstrrQr��defpathrZr4�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
r]r�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r$r\r%r^sV







)r)F)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)rL)jr'r<r?rWr��collectionsr1�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrprr.rnrrrOrUr�r�rBrrre�__all__r-rr rrr(r,r)r*r:rFrNrr]rardr	r
r�rrr
rr�r�stat_resultr�r�r�r�rqr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�rr�r�r�r�r	rrrrrrrr1rrr2r9r:r,r;rr��
namedtuplerDrFrGrEr?rrrV�F_OK�X_OKrr$r$r$r%�<module>st






�
@

7B
�
A�
.	
	4�
�
�
>?	�
A
-
����

�
8�
"�
�
�
�2



 
1_dummy_thread.cpython-38.opt-2.pyc000064400000006502151450073350012763 0ustar00U

e5d��@s�ddddddddgZdZeZifd	d�Zd
d�Zdd�Zdd�Zddd�Zdd�Z	Gdd�de
�ZGdd�de�Zda
dadd�Zd
S)�error�start_new_thread�exit�	get_ident�
allocate_lock�interrupt_main�LockType�RLocklcCs�t|�tt��krtd��t|�tt��kr4td��daz|||�Wn.tk
rZYnddl}|��YnXdatr�dat	�dS)Nz2nd arg must be a tuplez3rd arg must be a dictF�T)
�type�tuple�	TypeError�dict�_main�
SystemExit�	traceback�	print_exc�
_interrupt�KeyboardInterrupt)Zfunction�args�kwargsr�r�%/usr/lib64/python3.8/_dummy_thread.pyrs 
cCst�dS�N)rrrrrr=scCsdS�N�rrrrrrAscCst�Sr�rrrrrrJsNcCs|dk	rtd��dS)Nz'setting thread stack size not supportedr	)r)�sizerrr�
stack_sizeNsrcCst�Srrrrrr�
_set_sentinelTsrc@sBeZdZdd�Zddd�ZeZdd�Zd	d
�Zdd�Zd
d�Z	dS)rcCs
d|_dS)NF��
locked_status��selfrrr�__init__cszLockType.__init__N���cCsH|dks|rd|_dS|js&d|_dS|dkr@ddl}|�|�dSdS)NTr	F)r �time�sleep)r"�waitflag�timeoutr%rrr�acquirefs
zLockType.acquirecCs|��dSr)�release)r"�typ�val�tbrrr�__exit__�szLockType.__exit__cCs|js
t�d|_dS)NFT)r rr!rrrr*�szLockType.releasecCs|jSrrr!rrr�locked�szLockType.lockedcCs*d|jrdnd|jj|jjtt|��fS)Nz<%s %s.%s object at %s>r/Zunlocked)r �	__class__�
__module__�__qualname__�hex�idr!rrr�__repr__�s
�zLockType.__repr__)Nr$)
�__name__r1r2r#r)�	__enter__r.r*r/r5rrrrrXs
	cs6eZdZ�fdd�Zd	�fdd�	Z�fdd�Z�ZS)
rcst���d|_dS)Nr	)�superr#�_levelsr!�r0rrr#�s
zRLock.__init__Nr$cs$t��||�}|r |jd7_|Sr)r8r)r9)r"r'r(r/r:rrr)�sz
RLock.acquirecs4|jdkrt�|jdkr"t���|jd8_dS)Nr	r)r9rr8r*r!r:rrr*�s



z
RLock.release)Nr$)r6r1r2r#r)r*�
__classcell__rrr:rr�sFTcCstr
t�ndadS)NT)rrrrrrrr�s)N)�__all__�TIMEOUT_MAX�RuntimeErrorrrrrrrr�objectrrrrrrrrr�<module>s"
� 	
@_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-38.opt-1.pyc000064400000070505151450073350017626 0ustar00U

��.e]���@s`dddddddddddd	d
dddd
ddddddddddddddddddddddd	dd dd!d"d#d$d%dddd&d'dd(d)d*d&d+dd!dd,d-dddddddd.d&d&d&d&dd&dd&d&d&d&d&dddddddddd&dd&d&d&d&d&d&d&d&dd&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&dd&dd&dd&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&ddd&d&dd&dddd&d&d&ddd&d&dddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&dd&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&d&d&d&d&ddd&d&d&dd&d&ddd&d&d&d&d&d&d&dddddd&dd&d&dddddd&ddd&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&ddd&d&d&ddd&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&dd
d/ddd0d1d0d0d2d3d4dd5d6d7ddd8dd	d9dd:d;dd<d=dd>ddd?d@dAdBddd+ddCdDddEdd	dddd&dFdGdHdIdddJddKdLd&dMddddNdOdddddddddPdQdRdddSd&d&dddddTddddUdVdddWddXd&dYdZdd[d6d\d]dd^d&d&ddd_d`dadbdcd9dddded?dfd&dddgdhdidhdgdidgdgdhdhdgd]dgdgdgdgdhd&djdkdld&dmdnddod:d&dddddpddqdrdd&ddddsd&dtdud&d&d&d&dddd&d&ddvdwdudxdydydudz���Zd{S)|�d�z"cpython-38-x86_64-linux-gnu"ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPython�z/usr/binz/usr/lib64/python3.8z-L. -lpython3.8dzOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa{-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Ogz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--with-pydebug' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8dz=/builddir/build/BUILD/Python-3.8.17/build/debug/coverage.infoz;/builddir/build/BUILD/Python-3.8.17/build/debug/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz .cpython-38d-x86_64-linux-gnu.soi�ZyeszI/usr/include /usr/include /usr/include/python3.8d /usr/include/python3.8dz/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8d.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8d.soz3.8dz
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz1/usr/lib64/python3.8/config-3.8d-x86_64-linux-gnuzlibpython3.8d.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa1-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgozno-frameworkz./python -Ez	python3.8a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internala�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidz?LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debugz	@SGI_ABI@z/bin/shz.so���zcpython-38d-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczHLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz3.8z#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz//builddir/build/BUILD/Python-3.8.17/build/debugz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�?/usr/lib64/python3.8/_sysconfigdata_d_linux_x86_64-linux-gnu.py�<module>sb2+-��������uuid.cpython-38.opt-1.pyc000064400000056035151450073350011115 0ustar00U

&�.e3w�@s dZddlZddlZddlmZdZejdkr8dZZn ddlZe�	�Z
e
dkZe
dkZd	d
ddg\ZZZ
ZeZeZGd
d�de�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zdaa da!zddl"Z"Wne#k
�rdZ"YnXd%d&�Z$d'd(�Z%d)d*�Z&d+d,�Z'e�rFeegZ(nJejd-k�r^eeegZ(n2ejd.k�rteegZ(ne�r�egZ(neeeeegZ(ej)d/k�r�e%ge(Z*nej)d0k�r�e&ge(Z*ne(Z*da+dd1�d2d3�Z,da-d@d4d5�Z.d6d7�Z/d8d9�Z0d:d;�Z1ed<�Z2ed=�Z3ed>�Z4ed?�Z5dS)AaQUUID objects (universally unique identifiers) according to RFC 4122.

This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call uuid1() or uuid4().
Note that uuid1() may compromise privacy since it creates a UUID containing
the computer's network address.  uuid4() creates a random UUID.

Typical usage:

    >>> import uuid

    # make a UUID based on the host ID and current time
    >>> uuid.uuid1()    # doctest: +SKIP
    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')

    # make a UUID using an MD5 hash of a namespace UUID and a name
    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

    # make a random UUID
    >>> uuid.uuid4()    # doctest: +SKIP
    UUID('16fd2706-8baf-433b-82eb-8c7fada847da')

    # make a UUID using a SHA-1 hash of a namespace UUID and a name
    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')

    # make a UUID from a string of hex digits (braces and hyphens ignored)
    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')

    # convert a UUID to a string of hex digits in standard form
    >>> str(x)
    '00010203-0405-0607-0809-0a0b0c0d0e0f'

    # get the raw 16 bytes of the UUID
    >>> x.bytes
    b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

    # make a UUID from a 16-byte string
    >>> uuid.UUID(bytes=x.bytes)
    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
�N)�EnumzKa-Ping Yee <ping@zesty.ca>)�win32�darwinFZAIXZLinuxzreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definitionc@seZdZdZdZdZdS)�SafeUUIDr���N)�__name__�
__module__�__qualname__ZsafeZunsafe�unknown�rr�/usr/lib64/python3.8/uuid.pyrHsrc@s:eZdZdZdZd=ejd�dd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zed)d*��Zed+d,��Zed-d.��Zed/d0��Zed1d2��Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#dS)>�UUIDa�	Instances of the UUID class represent UUIDs as specified in RFC 4122.
    UUID objects are immutable, hashable, and usable as dictionary keys.
    Converting a UUID to a string with str() yields something in the form
    '12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts
    five possible forms: a similar string of hexadecimal digits, or a tuple
    of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
    48-bit values respectively) as an argument named 'fields', or a string
    of 16 bytes (with all the integer fields in big-endian order) as an
    argument named 'bytes', or a string of 16 bytes (with the first three
    fields in little-endian order) as an argument named 'bytes_le', or a
    single 128-bit integer as an argument named 'int'.

    UUIDs have these read-only attributes:

        bytes       the UUID as a 16-byte string (containing the six
                    integer fields in big-endian byte order)

        bytes_le    the UUID as a 16-byte string (with time_low, time_mid,
                    and time_hi_version in little-endian byte order)

        fields      a tuple of the six integer fields of the UUID,
                    which are also available as six individual attributes
                    and two derived attributes:

            time_low                the first 32 bits of the UUID
            time_mid                the next 16 bits of the UUID
            time_hi_version         the next 16 bits of the UUID
            clock_seq_hi_variant    the next 8 bits of the UUID
            clock_seq_low           the next 8 bits of the UUID
            node                    the last 48 bits of the UUID

            time                    the 60-bit timestamp
            clock_seq               the 14-bit sequence number

        hex         the UUID as a 32-character hexadecimal string

        int         the UUID as a 128-bit integer

        urn         the UUID as a URN as specified in RFC 4122

        variant     the UUID variant (one of the constants RESERVED_NCS,
                    RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)

        version     the UUID version number (1 through 5, meaningful only
                    when the variant is RFC_4122)

        is_safe     An enum indicating whether the UUID has been generated in
                    a way that is safe for multiprocessing applications, via
                    uuid_generate_time_safe(3).
    )�int�is_safe�__weakref__N)rcCs�|||||g�d�dkr td��|dk	rl|�dd��dd�}|�d��dd�}t|�d	krbtd
��t|d�}|dk	r�t|�dkr�td��|d
dd�|dd
d�|ddd�|dd�}|dk	r�t|�dkr�td��tj|dd�}|dk	�rt|�dk�rtd��|\}}	}
}}}
d|k�r0dk�s:ntd��d|	k�rRdk�s\ntd��d|
k�rtdk�s~ntd��d|k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|
k�r�d k�s�ntd!��|d>|B}|d">|	d#>B|
d$>B|d%>B|
B}|dk	�rDd|k�r:d&d'>k�sDntd(��|dk	�r�d&|k�rfdk�spntd)��|d*M}|d+O}|d,M}||d->O}t�	|d.|�t�	|d/|�dS)0aLCreate a UUID from either a string of 32 hexadecimal digits,
        a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
        in little-endian order as the 'bytes_le' argument, a tuple of six
        integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
        8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
        the 'fields' argument, or a single 128-bit integer as the 'int'
        argument.  When a string of hex digits is given, curly braces,
        hyphens, and a URN prefix are all optional.  For example, these
        expressions all yield the same UUID:

        UUID('{12345678-1234-5678-1234-567812345678}')
        UUID('12345678123456781234567812345678')
        UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
        UUID(bytes='\x12\x34\x56\x78'*4)
        UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' +
                      '\x12\x34\x56\x78\x12\x34\x56\x78')
        UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
        UUID(int=0x12345678123456781234567812345678)

        Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must
        be given.  The 'version' argument is optional; if given, the resulting
        UUID will have its variant and version set according to RFC 4122,
        overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'.

        is_safe is an enum exposed as an attribute on the instance.  It
        indicates whether the UUID has been generated in a way that is safe
        for multiprocessing applications, via uuid_generate_time_safe(3).
        N�zGone of the hex, bytes, bytes_le, fields, or int arguments must be givenzurn:�zuuid:z{}�-� z$badly formed hexadecimal UUID string�z bytes_le is not a 16-char string�r���zbytes is not a 16-char string�big)�	byteorder�zfields is not a 6-tuplerlz*field 1 out of range (need a 32-bit value)iz*field 2 out of range (need a 16-bit value)z*field 3 out of range (need a 16-bit value)�z*field 4 out of range (need an 8-bit value)z*field 5 out of range (need an 8-bit value)�z*field 6 out of range (need a 48-bit value)�`�P�@�0��z*int is out of range (need a 128-bit value)zillegal version numberl�����l�����Lrr)
�count�	TypeError�replace�strip�len�
ValueError�int_�
from_bytes�object�__setattr__)�self�hex�bytes�bytes_le�fieldsr�versionr�time_low�time_mid�time_hi_version�clock_seq_hi_variant�
clock_seq_low�node�	clock_seqrrr�__init__�sx 
�
�
����

z
UUID.__init__cCs&d|ji}|jtjkr"|jj|d<|S�Nrr)rrrr
�value)r1�drrr�__getstate__�s
zUUID.__getstate__cCs:t�|d|d�t�|dd|kr.t|d�ntj�dSr?)r/r0rr
)r1�staterrr�__setstate__�s��zUUID.__setstate__cCst|t�r|j|jkStS�N��
isinstancer
r�NotImplemented�r1�otherrrr�__eq__�s
zUUID.__eq__cCst|t�r|j|jkStSrErFrIrrr�__lt__�s
zUUID.__lt__cCst|t�r|j|jkStSrErFrIrrr�__gt__�s
zUUID.__gt__cCst|t�r|j|jkStSrErFrIrrr�__le__�s
zUUID.__le__cCst|t�r|j|jkStSrErFrIrrr�__ge__s
zUUID.__ge__cCs
t|j�SrE)�hashr�r1rrr�__hash__sz
UUID.__hash__cCs|jSrE�rrQrrr�__int__szUUID.__int__cCsd|jjt|�fS)Nz%s(%r))�	__class__r�strrQrrr�__repr__sz
UUID.__repr__cCstd��dS)NzUUID objects are immutable)r()r1�namer@rrrr0szUUID.__setattr__cCsDd|j}d|dd�|dd�|dd�|dd�|dd�fS)N�%032xz%s-%s-%s-%s-%sr�r�rS)r1r2rrr�__str__s





�zUUID.__str__cCs|j�dd�S)Nrr)r�to_bytesrQrrrr3sz
UUID.bytescCs<|j}|ddd�|ddd�|ddd�|dd�S)Nrrrrr�r3)r1r3rrrr4s(
�z
UUID.bytes_lecCs|j|j|j|j|j|jfSrE)r7r8r9r:r;r<rQrrrr5 s
�zUUID.fieldscCs
|jd?S)NrrSrQrrrr7%sz
UUID.time_lowcCs|jd?d@S)Nr �rSrQrrrr8)sz
UUID.time_midcCs|jd?d@S)Nr!r_rSrQrrrr9-szUUID.time_hi_versioncCs|jd?d@S)N�8�rSrQrrrr:1szUUID.clock_seq_hi_variantcCs|jd?d@S)Nr"rarSrQrrrr;5szUUID.clock_seq_lowcCs|jd@d>|jd>B|jBS)N�r"r)r9r8r7rQrrr�time9s
��z	UUID.timecCs|jd@d>|jBS)N�?r)r:r;rQrrrr=>s�zUUID.clock_seqcCs
|jd@S)Nl���rSrQrrrr<Csz	UUID.nodecCs
d|jS)NrYrSrQrrrr2GszUUID.hexcCsdt|�S)Nz	urn:uuid:)rVrQrrr�urnKszUUID.urncCs2|jd@stS|jd@stS|jd@s*tStSdS)Nr%ll)r�RESERVED_NCS�RFC_4122�RESERVED_MICROSOFT�RESERVED_FUTURErQrrr�variantOs


zUUID.variantcCs |jtkrt|jd?d@�SdS)Nr&�)rjrgrrQrrrr6Zs
zUUID.version)NNNNNN)$rrr	�__doc__�	__slots__rr
r>rBrDrKrLrMrNrOrRrTrWr0r\�propertyr3r4r5r7r8r9r:r;rcr=r<r2rerjr6rrrrr
Nsd3��V














r
c	Gs�ddl}ddl}ddl}|�|�}|dkrP|j�d�}|j||d�}|dkrPdSt|j�}d|d<|j|f||j	|j
|d�}|S)Nr)z/sbinz	/usr/sbin)�path�C�LC_ALL)�stdout�stderr�env)�os�shutil�
subprocessZwhich�pathsep�join�dict�environ�Popen�PIPEZDEVNULL)	�command�argsrurvrw�
executablerort�procrrr�_popen`s

�r�cCs
|d@S)Nlr��macrrr�
_is_universal�sr�cCs�d}z�t|f|����}|s"WdS|��|jD]�}|������}tt|��D]x}|||krNzN|||�}	t|	�dd�d�}
t	|
�r�|
WW5QR�WS|p�|
}WqNt
tfk
r�YqNXqNq.W5QRXWntk
r�YnX|p�dS)N�:�r)
r��splitrr�lower�rstrip�ranger+rr)r�r,�
IndexError�OSError)r~rZhw_identifiersZ	get_index�first_local_macr��line�words�i�wordr�rrr�	_find_mac�s*
r�cCs4d}dD]&}td||dd��}|r*|SdSdS)z5Get the hardware address on Unix by running ifconfig.)shwaddrsethersaddress:slladdr)rz-az-avZifconfigcSs|dS�Nr#r�r�rrr�<lambda>�r�z#_ifconfig_getnode.<locals>.<lambda>N�r�)�keywordsrr�rrr�_ifconfig_getnode�sr�cCs tdddgdd��}|r|SdS)z/Get the hardware address on Unix by running ip.Zip�links
link/ethercSs|dSr�rr�rrrr��r�z_ip_getnode.<locals>.<lambda>Nr�r�rrr�_ip_getnode�sr�cCs�ddl}ddl}z|�|���}Wntk
r8YdSXtdd|�|�gdd��}|r\|Stdd|�|�gdd��}|r~|Stdd|�d|�gd	d��}|r�|SdS)
z0Get the hardware address on Unix by running arp.rNZarpz-ancSsdS)Nrrr�rrrr��r�z_arp_getnode.<locals>.<lambda>cSs|dSr�rr�rrrr��r�z(%s)cSs|dS)N�rr�rrrr��r�)ru�socketZ
gethostbynameZgethostnamer�r��fsencode)rur�Zip_addrr�rrr�_arp_getnode�s"�r�cCstdddgdd��S)z4Get the hardware address on Unix by running lanscan.Zlanscanz-aislan0cSsdS)Nrrr�rrrr��r�z"_lanscan_getnode.<locals>.<lambda>r�rrrr�_lanscan_getnode�sr�cCs&d}�z�tdd�}|sWdS|��|j������}z|�d�}Wn"tk
rdYW5QR�WdSX|jD]�}zl|����}||}t|�dkr�|�d�dkr�t	|�
dd�d	�}t|�r�|WW5QR�WS|p�|}Wqlttfk
r�YqlXqlW5QRXWnt
k
�rYnX|�p$dS)
z4Get the hardware address on Unix by running netstat.NZnetstatz-iasAddress�r�rr�r)r�rr�readliner�r��indexr,r+r'rr)r�r�r�)r�r�r�r�r�r�r�rrr�_netstat_getnode�s2

r�cCs<ddl}ddl}ddl}d}dddg}z:ddl}|�d�}|jj�|d�|�d|j	�
d��WnYnX|D]�}z$|j|j�
|d�d	g|jd
d�}Wntk
r�YqrYnX|�r|jD]d}	|	�d�d
����}
|�d|
�r�t|
�dd�d�}t|��r|W5QR�S|�p"|}q�W5QRXqr|�p:dS)z<Get the hardware address on Windows by running ipconfig.exe.rNrzc:\windows\system32zc:\winnt\system32i,�mbcsZipconfigz/allZoem)rr�encoding�:rz((?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]rr)ru�rerw�ctypes�create_string_buffer�windllZkernel32ZGetSystemDirectoryA�insertr@�decoder|roryr}r�rrr�r*r��	fullmatchrr)r�)rur�rwr��dirsr��buffer�dirr�r�r@r�rrr�_ipconfig_getnode�s6

�



r�c	Cs6ddl}ddl}d}|��}|j|_|��|_}|��|�|�dkrLdS|�	�t
|j�D]�}|��|j
|_t|j|�|_|�|�dkr�q^|��|j|_t|j|�|_d�d�|_|��|_}|�|�dkr�q^|�	�|jdd�}t|�dk�rq^t�|d�}t|��r |S|�p(|}q^|�p4dS)ztGet the hardware address on Windows using NetBIOS calls.
    See http://support.microsoft.com/kb/118623 for details.rN�*rrr)�	win32wnet�netbiosZNCBZNCBENUMZCommandZ	LANA_ENUMZBufferZ_packZNetbiosZ_unpackr�ZlengthZResetZNCBRESET�ordZlanaZLana_numZNCBASTAT�ljustZCallnameZADAPTER_STATUSZadapter_addressr+rr.r�)	r�r�r�ZncbZadaptersr�Zstatusr3r�rrr�_netbios_getnodes>
r�c
s�tdk	rdSdatjdkr8tt��j�d�d�dkr8ntdk	rPtj	a
tjadSz�ddl�ddl
�dg}tj�d�s~|�d	�|D]�}z���j�|��}Wntk
r�Yq�YnXt|d
�r�|j���fdd�a
d
a�qq�t|d�r�|j�d�_��fdd�a
�qq�z�jj}Wnd}YnXt|dt|dd��aWn>tk
�r~}zddl}|�d|��t�W5d}~XYnXdS)zG
    Try to load platform-specific functions for generating uuids.
    NFr�.r�	Zuuid�win�c�uuid_generate_time_safecs ��d�}�|�}t|j�|fS�Nr�r�r3�raw)�_buffer�res)�_uuid_generate_time_safer�rr�_generate_time_safehs
r�T�uuid_generate_timecs ��d�}�|�t|j�dfSr�r�)r�)�_uuid_generate_timer�rrr�ss
ZUuidCreateSequentialZ
UuidCreatez/Could not find fallback ctypes uuid functions: )�_has_uuid_generate_time_safe�sys�platformrru�uname�releaser��_uuidZgenerate_time_safer�Zhas_uuid_generate_time_safer�Zctypes.util�
startswith�appendZCDLL�utilZfind_library�	Exception�hasattrr�r�Zrestyper�Zrpcrt4�getattr�_UuidCreate�warnings�warn�
ImportWarning)Z	_libnamesZlibname�lib�excr�r)r�r�r�r�_load_system_functions:sT&






��r�cCst�t�\}}t|d�jS)zPGet the hardware address on Unix using the _uuid extension module
    or ctypes.r^)r�r�r
r<)�	uuid_time�_rrr�
_unix_getnode�s
r�cCs:ddl}t�|�d�}t|�dkr6tt|j�d�jSdS)z1Get the hardware address on Windows using ctypes.rNrr^)r�r�r�r�r
�bytes_r�r<)r�r�rrr�_windll_getnode�s

r�cCsddl}|�d�dBS)zGet a random node ID.rNr"l)�random�getrandbits)r�rrr�_random_getnode�sr�rr�posix�nt)�getterscCsdtdk	rtSttgD]H}z
|�aWnYqYnXtdk	rdtkrRdkrnqtSqdS)a3Get the hardware address as a 48-bit positive integer.

    The first time this runs, it may launch a separate program, which could
    be quite slow.  If all attempts to obtain the hardware address fail, we
    choose a random 48-bit number with its eighth bit set to 1 as recommended
    in RFC 4122.
    Nrr)�_node�_GETTERSr�)r��getterrrr�getnode�s	

 
r�cCst�tdk	rd||kr"dkrdnn>t�\}}zt|�}Wntk
rVtj}YnXt||d�Sddl}|��}|dd}tdk	r�|tkr�td}|a|dkr�ddl	}|�
d�}|d@}	|d	?d
@}
|d?d@}|d
@}|d?d@}
|dkr�t�}t|	|
||
||fdd�S)aGenerate a UUID from a host ID, sequence number, and the current time.
    If 'node' is not given, getnode() is used to obtain the hardware
    address.  If 'clock_seq' is given, it is used as the sequence number;
    otherwise a random 14-bit sequence number is chosen.N)r3rr�dl@'Hw�
r#�l��rr_r"rbrarrd)r5r6)r�r�rr,r
r
rc�time_ns�_last_timestampr�r�r�)r<r=r�Zsafely_generatedrrcZnanosecondsZ	timestampr�r7r8r9r;r:rrr�uuid1�s> 

��r�cCs<ddlm}||jt|d�dd���}t|dd�dd	�S)
zAGenerate a UUID from the MD5 hash of a namespace UUID and a name.r)�md5�utf-8F)ZusedforsecurityNrr�r3r6)�hashlibr�r3�digestr
)�	namespacerXr�r�rrr�uuid3s�
r�cCstt�d�dd�S)zGenerate a random UUID.rrr�)r
ru�urandomrrrr�uuid4sr�cCs8ddlm}||jt|d����}t|dd�dd�S)zCGenerate a UUID from the SHA-1 hash of a namespace UUID and a name.r)�sha1r�Nrrr�)r�r�r3r�r
)r�rXr�rPrrr�uuid5sr�z$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8)NN)6rlrur��enumr�
__author__r�Z_AIXZ_LINUX�systemZ_platform_systemrfrgrhrirr-r3r�rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r��ImportErrorr�r�r�r�Z_OS_GETTERSrXr�r�r�r�r�r�r�r�Z
NAMESPACE_DNSZ
NAMESPACE_URLZ
NAMESPACE_OIDZNAMESPACE_X500rrrr�<module>s�.

�"
$
T

�
'	string.cpython-38.opt-2.pyc000064400000014064151450073350011452 0ustar00U

e5d')�@s�dddddddddd	d
dgZdd
lZdZdZdZeeZdZeddZdZdZ	eee	eZ
ddd�Zdd
lZ
ddlmZiZGdd�de�ZGdd�ded�ZGdd
�d
�Zd
S)�
ascii_letters�ascii_lowercase�ascii_uppercase�capwords�digits�	hexdigits�	octdigits�	printable�punctuation�
whitespace�	Formatter�Template�Nz 	

ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZ�
0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pd�dd�|�|�D��S)N� css|]}|��VqdS�N)�
capitalize)�.0�x�r�/usr/lib64/python3.8/string.py�	<genexpr>0szcapwords.<locals>.<genexpr>)�join�split)�s�seprrrr%s)�ChainMapcs eZdZdZ�fdd�Z�ZS)�_TemplateMetaclassa/
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(bid)s)}  |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    csbtt|��|||�d|kr$|j}n$tjt�|j�|j|jp@|jd�}t�	||j
tjB�|_dS)N�pattern)Zdelim�idZbid)�superr�__init__r�_re�escape�	delimiter�	idpattern�braceidpattern�compile�flags�VERBOSE)�cls�name�basesZdctr��	__class__rrr Cs

�z_TemplateMetaclass.__init__)�__name__�
__module__�__qualname__rr �
__classcell__rrr,rr9s	rc@sFeZdZdZdZdZejZdd�Z	dd�Z
efdd	�Zefd
d�Z
dS)r�$z(?a:[_a-z][_a-z0-9]*)NcCs
||_dSr)�template)�selfr3rrrr \szTemplate.__init__cCsd|�d�}|jd|�jdd�}|s.d}d}n"|td�|dd���}t|�}td||f��dS)N�invalidT)�keepends�����z.Invalid placeholder in string: line %d, col %d)�startr3�
splitlines�lenr�
ValueError)r4�mo�i�lines�colno�linenorrr�_invalidas
�zTemplate._invalidcs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncsd|�d�p|�d�}|dk	r(t�|�S|�d�dk	r<�jS|�d�dk	rT��|�td�j��dS�N�namedZbracedZescapedr5z#Unrecognized named group in pattern)�group�strr#rCr=r�r>rE��mappingr4rr�convertss
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr�subr3�r4rJZkwsrKrrIr�
substitutems
zTemplate.substitutecs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|dk	rHzt�|�WStk
rF|��YSX|�d�dk	r\�jS|�d�dk	rr|��Std�j��dSrD)rFrG�KeyErrorr#r=rrHrIrrrK�s�z)Template.safe_substitute.<locals>.convertrLrPrrIr�safe_substitute�s

zTemplate.safe_substitute)r.r/r0r#r$r%r!�
IGNORECASEr'r rCrMrQrSrrrrrPs)�	metaclassc@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r4�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r4rWrXrY�	used_args�result�_rrrrV�szFormatter.vformatr
c	Cs�|dkrtd��g}|�|�D]�\}}	}
}|r8|�|�|	dk	r|	dkrj|dkrXtd��t|�}	|d7}n|	��r�|r~td��d}|�|	||�\}}
|�|
�|�||�}|j|
||||d|d�\}
}|�|�	||
��qd�
|�|fS)Nr
zMax string recursion exceededr8FzJcannot switch from manual field specification to automatic field numberingr7)�auto_arg_index)r=�parse�appendrG�isdigit�	get_field�add�
convert_fieldr]�format_fieldr)r4rWrXrYr_Zrecursion_depthrbr`Zliteral_text�
field_name�format_spec�
conversion�objZarg_usedrrrr]�s<�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r4�keyrXrYrrr�	get_value�s
zFormatter.get_valuecCsdSrr)r4r_rXrYrrrr^�szFormatter.check_unused_argscCs
t||�Sr)rZ)r4�valuerkrrrri�szFormatter.format_fieldcCsN|dkr|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rG�repr�asciir=rZ)r4rrrlrrrrh�szFormatter.convert_fieldcCs
t�|�Sr)�_stringZformatter_parser)r4rWrrrrcszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)rwZformatter_field_name_splitrq�getattr)	r4rjrXrY�first�restrmZis_attrr?rrrrf
s
zFormatter.get_fieldN)r
)r.r/r0rZrVr]rqr^rirhrcrfrrrrr�s�
6	)N)�__all__rwr
rrrrrrr	rr�rer!�collectionsrrNrM�typerrrrrrr�<module>s4�
Qsmtplib.cpython-38.opt-2.pyc000064400000045462151450073350011624 0ustar00U

e5dɯ�
@snddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Zddddddd	d
ddd
ddg
ZdZdZdZdZdZdZe�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z Gdd
�d
e�Z!Gdd�de�Z"Gd d�de�Z#d!d
�Z$d"d#�Z%d$d�Z&d%d&�Z'd'd(�Z(zddl)Z)Wne*k
�r�d)Z+YnXd*Z+Gd+d�d�Z,e+�r�Gd,d-�d-e,�Z-e�.d-�d.Z/Gd/d0�d0e,�Z0e1d1k�rjd2d3�Z2e2d4�Z3e2d5��4d6�Z5e6d7�d8Z7ej8�9�Z:e:�s&�q2e7e:Z7�qe6d9e;e7��e,d:�Z<e<�=d;�e<�>e3e5e7�e<�?�dS)<�N)�body_encode�
SMTPException�SMTPNotSupportedError�SMTPServerDisconnected�SMTPResponseException�SMTPSenderRefused�SMTPRecipientsRefused�
SMTPDataError�SMTPConnectError�
SMTPHeloError�SMTPAuthenticationError�	quoteaddr�	quotedata�SMTP�i��
s
i �z	auth=(.*)c@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/smtplib.pyrHsc@seZdZdS)rNrrrrrrKsc@seZdZdS)rNrrrrrrRsc@seZdZdd�ZdS)rcCs||_||_||f|_dS�N)�	smtp_code�
smtp_error�args)�self�code�msgrrr�__init__cszSMTPResponseException.__init__N�rrrr rrrrrZs	c@seZdZdd�ZdS)rcCs"||_||_||_|||f|_dSr)rr�senderr)rrrr"rrrr oszSMTPSenderRefused.__init__Nr!rrrrrhsc@seZdZdd�ZdS)rcCs||_|f|_dSr)�
recipientsr)rr#rrrr }szSMTPRecipientsRefused.__init__Nr!rrrrrusc@seZdZdS)r	Nrrrrrr	�sc@seZdZdS)r
Nrrrrrr
�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�scCs>tj�|�\}}||fdkr6|���d�r.|Sd|Sd|S)N��r%�<z<%s>)�email�utils�	parseaddr�strip�
startswith�Z
addrstringZdisplayname�addrrrrr
�scCs$tj�|�\}}||fdkr |S|S)Nr$)r'r(r)r,rrr�
_addr_only�sr.c	Cst�ddt�dt|��S)Nz(?m)^\.z..�(?:\r\n|\n|\r(?!\n))��re�sub�CRLF��datarrrr�s�cCst�dd|�S)Ns(?m)^\.s..)r1r2)Zbindatarrr�_quote_periods�sr6cCst�dt|�S)Nr/r0r4rrr�	_fix_eols�sr7FTc@sveZdZdZdZdZdZdZdZdZ	e
Zdddej
dfdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�ZdMdd�Zdd�ZdNdd�Zdd�ZdOdd�ZdPdd�ZdQdd�Zd d!�ZdRd"d#�Zd$d%�Zd&d'�Zd(d)�ZdSd+d,�Z dTd-d.�Z!d/d0�Z"d1d2�Z#e#Z$d3d4�Z%d5d6�Z&d7d8�d9d:�Z'dUd;d<�Z(dVd=d>�Z)dWd?d@�Z*d7d8�dAdB�Z+dXdCdD�Z,dYdEdF�Z-dZdGdH�Z.dIdJ�Z/dKdL�Z0dS)[rrN�ehlor%c
Cs�||_||_i|_d|_||_d|_|rR|�||�\}}|dkrR|��t||��|dk	rb||_	nPt
��}d|krz||_	n8d}	zt
�t
�
��}	Wnt
jk
r�YnXd|	|_	dS)N�asciir���.z	127.0.0.1z[%s])�_host�timeout�esmtp_features�command_encoding�source_address�_auth_challenge_count�connect�closer
�local_hostname�socketZgetfqdnZ
gethostbynameZgethostnameZgaierror)
r�host�portrDr=r@rrZfqdnr-rrrr �s,
z
SMTP.__init__cCs|Srr�rrrr�	__enter__szSMTP.__enter__cGsNz>z$|�d�\}}|dkr$t||��Wntk
r:YnXW5|��XdS)NZQUIT��)rC�docmdrr)rrr�messagerrr�__exit__s
z
SMTP.__exit__cCs
||_dSr)�
debuglevel)rrNrrr�set_debuglevel"szSMTP.set_debuglevelcGs@|jdkr,ttj����f|�dtji�nt|dtji�dS)N��file)rN�print�datetimeZnow�time�sys�stderr�rrrrr�_print_debug+s
"zSMTP._print_debugcCs2|jdkr|�d||f|j�t�||f||j�S)Nrzconnect: to)rNrXr@rE�create_connection)rrFrGr=rrr�_get_socket1s

�zSMTP._get_socket�	localhostcCs�|r
||_|s||�d�|�d�kr||�d�}|dkr||d|�||dd�}}zt|�}Wntk
rztd��YnX|s�|j}t�d|||�|�	|||j
�|_d|_|�
�\}}|jdkr�|�dt|��||fS)N�:rrPznonnumeric portzsmtplib.connect�connect:)r@�find�rfind�int�
ValueError�OSError�default_portrU�auditrZr=�sockrQ�getreplyrNrX�repr)rrFrGr@�irrrrrrB9s&

zSMTP.connectcCs�|jdkr|�dt|��|jr|t|t�r6|�|j�}t�	d||�z|j�
|�Wq�tk
rx|��t
d��Yq�Xnt
d��dS)Nrzsend:zsmtplib.send�Server not connectedzplease run connect() first)rNrXrgre�
isinstance�str�encoder?rUrdZsendallrbrCr)r�srrr�sendZs

z	SMTP.sendcCsd|dkr|}n|�d|��}d|ks,d|krN|�dd��dd�}td|����|�|�t���dS)Nr%� �
�
z\nz\rz=command and arguments contain prohibited newline characters: )�replacerarnr3)r�cmdrrmrrr�putcmdms�zSMTP.putcmdc
CsPg}|jdkr|j�d�|_z|j�td�}Wn:tk
rj}z|��tdt|���W5d}~XYnX|s�|��td��|j	dkr�|�
dt|��t|�tkr�|��t
dd��|�|d	d��d
��|dd�}zt|�}Wn tk
�rd}Y�q YnX|dd	�d
kr�q qd�|�}|j	dk�rH|�
d||f�||fS)N�rbrPz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:i�zLine too long.�s 	
�����-�
zreply: retcode (%s); Msg: %a)rQreZmakefile�readline�_MAXLINErbrCrrkrNrXrg�lenr�appendr*r`ra�join)r�resp�line�erZerrcode�errmsgrrrrfzs>

�


z
SMTP.getreplycCs|�||�|��Sr�rtrf)rrsrrrrrK�sz
SMTP.docmdcCs,|�d|p|j�|��\}}||_||fS)N�helo)rtrDrf�	helo_resp)r�namerrrrrr��sz	SMTP.heloc
Cs.i|_|�|j|p|j�|��\}}|dkrJt|�dkrJ|��td��||_|dkr`||fSd|_	|j�
d��d�}|d=|D]�}t�
|�}|r�|j�dd	�d
|�d�d|jd<q�t�
d|�}|r�|�d���}|j|�d�d���}	|dk�r|j�|d	�d
|	|j|<q�|	|j|<q�||fS)
Nrxrri�rPzlatin-1rq�authr%roz((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?�feature)r>rt�ehlo_msgrDrfr}rCr�	ehlo_resp�
does_esmtp�decode�split�
OLDSTYLE_AUTH�match�get�groupsr1�group�lower�string�endr*)
rr�rrr��eachZ
auth_match�mr�Zparamsrrrr8�sB
��

��z	SMTP.ehlocCs|��|jkSr)r�r>)r�optrrr�has_extn�sz
SMTP.has_extncCs|�d|�|��dS)N�helprPr�rWrrrr��sz	SMTP.helpcCsd|_|�d�S)Nr9�rset)r?rKrHrrrr��sz	SMTP.rsetcCs&z|��Wntk
r YnXdSr)r�rrHrrr�_rset�sz
SMTP._rsetcCs
|�d�S)N�noop)rKrHrrrr�	sz	SMTP.nooprcCshd}|rH|jrHtdd�|D��r:|�d�r2d|_ntd��dd�|�}|�dd	t|�|f�|��S)
Nr%css|]}|��dkVqdS)�smtputf8N)r�)�.0�xrrr�	<genexpr>szSMTP.mail.<locals>.<genexpr>r�zutf-8z SMTPUTF8 not supported by serverro�mailz	FROM:%s%s)	r��anyr�r?rrrtr
rf)rr"�options�
optionlistrrrr�
s	

�z	SMTP.mailcCs<d}|r|jrdd�|�}|�ddt|�|f�|��S)Nr%ro�rcptzTO:%s%s)r�rrtr
rf)rZrecipr�r�rrrr�"s

z	SMTP.rcptcCs�|�d�|��\}}|jdkr0|�d||f�|dkrDt||��n|t|t�r\t|��d�}t	|�}|dd�t
kr||t
}|dt
}|�|�|��\}}|jdkr�|�d||f�||fSdS)Nr5rzdata:ibr9����.)rtrfrNrXr	rjrkr7rlr6�bCRLFrn)rrr�repl�qrrrr5*s"





z	SMTP.datacCs|�dt|��|��S)N�vrfy�rtr.rf�rZaddressrrr�verifyGszSMTP.verifycCs|�dt|��|��S)N�expnr�r�rrrr�Nsz	SMTP.expncCsb|jdkr^|jdkr^d|��dkr0dks^n|��\}}d|krRdks^nt||��dS)N��ri+)r�r�r8r�r)rrr�rrr�ehlo_or_helo_if_neededUs
zSMTP.ehlo_or_helo_if_neededT��initial_response_okc	Cs�|��}|r|�nd}|dk	rPt|�d�dd�}|�d|d|�\}}d|_n|�d|�\}}d|_|dkr�|jd7_t�|�}t||��d�dd�}|�|�\}}|jtkrftd	t	||f���qf|d
kr�||fSt
||��dS)Nr9r%)ZeolZAUTHrorPriNz4Server AUTH mechanism infinite loop. Last response: ���i�)�upper�
encode_base64rlrKrA�base64Zdecodebytes�
_MAXCHALLENGErrgr)	rZ	mechanismZ
authobjectr�Zinitial_responseZresponserr��	challengerrrr�fs2
�

��z	SMTP.authcCs0|dkrdS|jdt�|j�d�|d���S)Nror9Zmd5)�user�hmacZHMAC�passwordrlZ	hexdigest�rr�rrr�
auth_cram_md5�s
�zSMTP.auth_cram_md5cCsd|j|jfS)Nz%s%s)r�r�r�rrr�
auth_plain�szSMTP.auth_plaincCs"|dks|jdkr|jS|jSdS)N�)rAr�r�r�rrr�
auth_login�szSMTP.auth_logincs�|��|�d�std��|jd���dddg}�fdd�|D�}|sPtd��|||_|_|D]t}d	|���	d
d�}z4|j
|t||�|d�\}}	|d
kr�||	fWSWqbtk
r�}
z|
}W5d}
~
XYqbXqb|�dS)Nr�z,SMTP AUTH extension not supported by server.zCRAM-MD5ZPLAINZLOGINcsg|]}|�kr|�qSrr)r�r��Zadvertised_authlistrr�
<listcomp>�s�zSMTP.login.<locals>.<listcomp>z(No suitable authentication method found.Zauth_�-�_r�r�)
r�r�rr>r�rr�r�r�rrr��getattrr)rr�r�r�Zpreferred_authsZauthlistZ
authmethodZmethod_namerr�r�Zlast_exceptionrr�r�login�s0
�
�
z
SMTP.logincCs�|��|�d�std��|�d�\}}|dkr�ts<td��|dk	rT|dk	rTtd��|dk	rl|dk	rltd��|dk	s||dk	r�ddl}|�d	t	d
�|dkr�t
j||d�}|j|j
|jd�|_
d|_d|_d|_i|_d|_n
t||��||fS)
N�starttlsz+STARTTLS extension not supported by server.ZSTARTTLSr:z&No SSL support included in this Python�4context and keyfile arguments are mutually exclusive�5context and certfile arguments are mutually exclusiver�Akeyfile and certfile are deprecated, use a custom context insteadr���certfile�keyfile�Zserver_hostname)r�r�rrK�	_have_ssl�RuntimeErrorra�warnings�warn�DeprecationWarning�ssl�_create_stdlib_context�wrap_socketrer<rQr�r�r>r�r)rr�r��contextr�Zreplyr�rrrr��sB
����
z
SMTP.starttlscCs^|��g}t|t�r$t|��d�}|jrZ|�d�rF|�dt|��|D]}|�|�qJ|�	||�\}}	|dkr�|dkr�|�
�n|��t||	|��i}
t|t�r�|g}|D]H}|�
||�\}}	|dkr�|dkr�||	f|
|<|dkr�|�
�t|
��q�t|
�t|�k�r|��t|
��|�|�\}}	|dk�rZ|dk�rH|�
�n|��t||	��|
S)Nr9�sizezsize=%dr�i��)r�rjrkr7rlr�r�r~r}r�rCr�rr�rr5r	)r�	from_addr�to_addrsr�mail_options�rcpt_optionsZ
esmtp_optsZoptionrr�Zsenderrsr�rrr�sendmail&sF@








z
SMTP.sendmailc	Cs�|��|�d�}|dkr d}nt|�dkr2d}ntd��|dkr||d|krZ||dn
||d}tj�|g�dd}|dkr�d	d
�||d||d||d
fD�}dd
�tj�|�D�}t�|�}	|	d=|	d=d}
zd�|f|���	d�Wn.t
k
�r(|�d��s td��d}
YnXt
���R}|
�r^tjj||jjdd�d�}|d�}ntj�|�}|j|	dd�|��}
W5QRX|�|||
||�S)NzResent-Dater%rPzResent-z0message has more than one 'Resent-' header blockZSender�FromrcSsg|]}|dk	r|�qSrr)r��frrrr��s�z%SMTP.send_message.<locals>.<listcomp>�ToZBccZCccSsg|]}|d�qS)rPr)r��arrrr��sz
Resent-BccFr9r�z�One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)�utf8)�policy�SMTPUTF8�
BODY=8BITMIMEr)�linesep)r�r�)r�Zget_allr}rar'r(Zgetaddresses�copyrrl�UnicodeEncodeErrorr�r�io�BytesIO�	generatorZBytesGeneratorr�ZcloneZflatten�getvaluer�)rrr�r�r�r�ZresentZ
header_prefixZaddr_fieldsZmsg_copyZ
internationalZbytesmsg�gZflatmsgrrr�send_message�sX

�
�

�
�

�
�zSMTP.send_messagecCs<z|j}d|_|r|��W5|j}d|_|r6|��XdSr)rerCrQ)rrerQrrrrC�sz
SMTP.closecCs.|�d�}d|_|_i|_d|_|��|S)N�quitF)rKr�r�r>r�rC)r�resrrrr��s
z	SMTP.quit)r[rN)r%)r%)r%)r%)r%)r)r)N)N)N)NNN)rr)NNrr)1rrrrNrerQr�r�r�r��	SMTP_PORTrcrE�_GLOBAL_DEFAULT_TIMEOUTr rIrMrOrXrZrBrnrtrfrKr�r8r�r�r�r�r�r�r�r5r�r�r�r�r�r�r�r�r�r�r�r�rCr�rrrrr�sf�
0
	
!

1



3


0
	

B
8�
h�
M
c@s4eZdZeZdddddejddfdd�Zdd�ZdS)�SMTP_SSLr%rNc	
Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}	|	�dtd�||_||_|dkrxtj||d�}||_t	�
||||||�dS)Nr�r�rr�r�r�)rar�r�r�r�r�r�r�r�rr )
rrFrGrDr�r�r=r@r�r�rrrr s(���zSMTP_SSL.__init__cCsD|jdkr|�d||f�t�||f||j�}|jj||jd�}|S)Nrr]r�)rNrXrErYr@r�r�r<)rrFrGr=Z
new_socketrrrrZs
��zSMTP_SSL._get_socket)	rrr�
SMTP_SSL_PORTrcrEr�r rZrrrrr��s�
r�i�c@s,eZdZdZdeddfdd�Zd
dd	�ZdS)�LMTPZlhlor%NcCstj|||||d�dS)N)rDr@)rr )rrFrGrDr@rrrr ;s�z
LMTP.__init__r[rcCs�|ddkrtj||||d�Sz(t�tjtj�|_d|_|j�|�WnBtk
r�|jdkrl|�	d|�|jr||j�
�d|_�YnX|��\}}|jdkr�|�	d|�||fS)Nr�/)r@z
connect fail:r])rrBrEZAF_UNIXZSOCK_STREAMrerQrbrNrXrCrf)rrFrGr@rrrrrrBAs"


zLMTP.connect)r[rN)rrrr��	LMTP_PORTr rBrrrrr�+s
�
r��__main__cCs(tj�|d�tj��tj����S)Nz: )rU�stdout�write�flush�stdinr{r*)�promptrrrr[s
rr�r��,zEnter message, end with ^D:r%zMessage length is %dr[rP)@rEr�r1Zemail.utilsr'Z
email.messageZemail.generatorr�r�r�rSrUZemail.base64mimerr��__all__r�r�r3r�r|r��compile�Ir�rbrrrrrrr	r
rrr
r.rr6r7r��ImportErrorr�rr�r~r�r�rrZfromaddrr�ZtoaddrsrRrrr{r�r}ZserverrOr�r�rrrr�<module>,s��


	
:0
/


statistics.cpython-38.opt-1.pyc000064400000100751151450073350012334 0ustar00U

e5d
��@sndZddddddddd	d
ddd
ddddgZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZmZmZmZmZmZmZddlmZddlmZGdd�de�Zdddd�Zdd�Zd d!�Zd"d#�Zd$d%�Z d&d'�Z!d(d)�Z"ded+d,�Z#d-d�Z$d.d�Z%d/d�Z&d0d�Z'd1d�Z(d2d
�Z)d3d	�Z*dfd5d�Z+d6d�Z,d7d�Z-d8d9d:�d;d�Z.dgd<d=�Z/dhd>d�Z0did?d�Z1djd@d�Z2dkdAd
�Z3dBdC�Z4GdDd�d�Z5zddEl6m4Z4Wne7k
�r�YnXe8dFk�rjddGlm9Z9ddHlm:Z:m;Z;m<Z<m=Z=ddIl	m>Z>ddl?Z?e5dJdK�Z@e5dLdM�ZAdNZBe@�CeB�ZDeA�CeB�ZEe:e;fD]<ZFeGdOeFj8�dP��eGeFe@eA��eGe5�HeIeFeDeE����qRdQZJe:e;e<e=fD]@ZFeGdOeFj8�dR��eGeFe@eJ��eGe5�HeIeFeDe>eJ�����q�dSZJe:e;e<fD]@ZFeGdTeFj8�dU��eGeFeJe@��eGe5�HeIeFe>eJ�eD����q�dVdW�ZKe5dXdY�ZLe5dZd[�ZMd\ZNdNZBe5�Hd]d^�eL�CeB�D��ZOeKeLeNeO�e5�Hd_d^�eL�CeB�D��ZOeKeLeNeO�e5�Hd`d^�eL�CeB�D��ZOeKeLeNeO�e5�Hdad^�eL�CeB�D��ZOeKeLeNeO�e5�Hdbd^�ePeL�CeB�eM�CeB��D��ZOeKeLeMeO�e5�Hdcd^�ePeL�CeB�eM�CeB��D��ZOeKeLeMeO�eGe?�Q��dS)lam

Basic statistics module.

This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.

Calculating averages
--------------------

==================  ==================================================
Function            Description
==================  ==================================================
mean                Arithmetic mean (average) of data.
fmean               Fast, floating point arithmetic mean.
geometric_mean      Geometric mean of data.
harmonic_mean       Harmonic mean of data.
median              Median (middle value) of data.
median_low          Low median of data.
median_high         High median of data.
median_grouped      Median, or 50th percentile, of grouped data.
mode                Mode (most common value) of data.
multimode           List of modes (most common values of data).
quantiles           Divide data into intervals with equal probability.
==================  ==================================================

Calculate the arithmetic mean ("the average") of data:

>>> mean([-1.0, 2.5, 3.25, 5.75])
2.625


Calculate the standard median of discrete data:

>>> median([2, 3, 4, 5])
3.5


Calculate the median, or 50th percentile, of data grouped into class intervals
centred on the data values provided. E.g. if your data points are rounded to
the nearest whole number:

>>> median_grouped([2, 2, 3, 3, 3, 4])  #doctest: +ELLIPSIS
2.8333333333...

This should be interpreted in this way: you have two data points in the class
interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in
the class interval 3.5-4.5. The median of these data points is 2.8333...


Calculating variability or spread
---------------------------------

==================  =============================================
Function            Description
==================  =============================================
pvariance           Population variance of data.
variance            Sample variance of data.
pstdev              Population standard deviation of data.
stdev               Sample standard deviation of data.
==================  =============================================

Calculate the standard deviation of sample data:

>>> stdev([2.5, 3.25, 5.5, 11.25, 11.75])  #doctest: +ELLIPSIS
4.38961843444...

If you have previously calculated the mean, you can pass it as the optional
second argument to the four "spread" functions to avoid recalculating it:

>>> data = [1, 2, 2, 4, 4, 4, 5, 6]
>>> mu = mean(data)
>>> pvariance(data, mu)
2.5


Exceptions
----------

A single exception is defined: StatisticsError is a subclass of ValueError.

�
NormalDist�StatisticsError�fmean�geometric_mean�
harmonic_mean�mean�median�median_grouped�median_high�
median_low�mode�	multimode�pstdev�	pvariance�	quantiles�stdev�variance�N��Fraction)�Decimal)�groupby)�bisect_left�bisect_right)�hypot�sqrt�fabs�exp�erf�tau�log�fsum)�
itemgetter)�Counterc@seZdZdS)rN)�__name__�
__module__�__qualname__�r&r&�"/usr/lib64/python3.8/statistics.pyruscCs�d}t|�\}}||i}|j}ttt|��}t|t�D]@\}}	t||�}tt|	�D]"\}}|d7}||d�|||<qRq6d|kr�|d}
ntdd�t|�	��D��}
||
|fS)aC_sum(data [, start]) -> (type, sum, count)

    Return a high-precision sum of the given numeric data as a fraction,
    together with the type to be converted to and the count of items.

    If optional argument ``start`` is given, it is added to the total.
    If ``data`` is empty, ``start`` (defaulting to 0) is returned.


    Examples
    --------

    >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
    (<class 'float'>, Fraction(11, 1), 5)

    Some sources of round-off error will be avoided:

    # Built-in sum returns zero.
    >>> _sum([1e50, 1, -1e50] * 1000)
    (<class 'float'>, Fraction(1000, 1), 3000)

    Fractions and Decimals are also supported:

    >>> from fractions import Fraction as F
    >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
    (<class 'fractions.Fraction'>, Fraction(63, 20), 4)

    >>> from decimal import Decimal as D
    >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
    >>> _sum(data)
    (<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)

    Mixed types are currently treated as an error, except that int is
    allowed.
    r�Ncss|]\}}t||�VqdS�Nr)�.0�d�nr&r&r'�	<genexpr>�sz_sum.<locals>.<genexpr>)
�_exact_ratio�get�_coerce�int�typer�map�sum�sorted�items)�data�start�countr,r+ZpartialsZpartials_get�T�typ�values�totalr&r&r'�_sum{s$
r>cCs.z
|��WStk
r(t�|�YSXdSr))Z	is_finite�AttributeError�mathZisfinite)�xr&r&r'�	_isfinite�s
rBcCs�||kr|S|tks|tkr |S|tkr,|St||�r:|St||�rH|St|t�rV|St|t�rd|St|t�r|t|t�r||St|t�r�t|t�r�|Sd}t||j|jf��dS)z�Coerce types T and S to a common type, or raise TypeError.

    Coercion rules are currently an implementation detail. See the CoerceTest
    test class in test_statistics for details.
    z"don't know how to coerce %s and %sN)r1�bool�
issubclassr�float�	TypeErrorr#)r:�S�msgr&r&r'r0�s(



r0cCs�zrt|�tkst|�tkr$|��WSz|j|jfWWStk
rnz|��WYWStk
rhYnXYnXWn ttfk
r�|dfYSXd}t	|�
t|�j���dS)z�Return Real number x to exact (numerator, denominator) pair.

    >>> _exact_ratio(0.25)
    (1, 4)

    x is expected to be an int, Fraction, Decimal or float.
    Nz0can't convert type '{}' to numerator/denominator)r2rEr�as_integer_ratio�	numerator�denominatorr?�
OverflowError�
ValueErrorrF�formatr#)rArHr&r&r'r.�s
r.cCspt|�|kr|St|t�r(|jdkr(t}z
||�WStk
rjt|t�rd||j�||j�YS�YnXdS)z&Convert value to given numeric type T.r(N)r2rDr1rKrErFrrJ)�valuer:r&r&r'�_convert�s

rPcCs.t||�}|t|�kr&|||kr&|St�dS)z,Locate the leftmost value exactly equal to xN)r�lenrM)�arA�ir&r&r'�
_find_lteq
s
rTcCs>t|||d�}|t|�dkr6||d|kr6|dSt�dS)z-Locate the rightmost value exactly equal to x)�lor(N)rrQrM)rR�lrArSr&r&r'�
_find_rteqs rW�negative valueccs$|D]}|dkrt|��|VqdS)z7Iterate over values, failing if any are less than zero.rN)r)r<�errmsgrAr&r&r'�	_fail_negsrZcCsHt|�|krt|�}t|�}|dkr,td��t|�\}}}t|||�S)a�Return the sample arithmetic mean of data.

    >>> mean([1, 2, 3, 4, 4])
    2.8

    >>> from fractions import Fraction as F
    >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
    Fraction(13, 21)

    >>> from decimal import Decimal as D
    >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
    Decimal('0.5625')

    If ``data`` is empty, StatisticsError will be raised.
    r(z%mean requires at least one data point)�iter�listrQrr>rP)r7r,r:r=r9r&r&r'r'scstzt|��Wn0tk
r<d��fdd�}t||��}Yn
Xt|�}z
|�WStk
rntd�d�YnXdS)z�Convert data to floats and compute the arithmetic mean.

    This runs faster than the mean() function and it always returns a float.
    If the input dataset is empty, it raises a StatisticsError.

    >>> fmean([3.5, 4.0, 5.25])
    4.25
    rc3s t|dd�D]\�}|VqdS)Nr()r8)�	enumerate)�iterablerA�r,r&r'r9Oszfmean.<locals>.countz&fmean requires at least one data pointN)rQrFr �ZeroDivisionErrorr)r7r9r=r&r_r'rAs	
cCs8ztttt|���WStk
r2td�d�YnXdS)aYConvert data to floats and compute the geometric mean.

    Raises a StatisticsError if the input dataset is empty,
    if it contains a zero, or if it contains a negative value.

    No special efforts are made to achieve exact results.
    (However, this may change in the future.)

    >>> round(geometric_mean([54, 24, 36]), 9)
    36.0
    zHgeometric mean requires a non-empty dataset  containing positive numbersN)rrr3rrMr)r7r&r&r'r\s�cCs�t|�|krt|�}d}t|�}|dkr2td��n<|dkrn|d}t|tjtf�rf|dkrbt|��|Std��z"t	dd�t
||�D��\}}}Wntk
r�YdSXt|||�S)aReturn the harmonic mean of data.

    The harmonic mean, sometimes called the subcontrary mean, is the
    reciprocal of the arithmetic mean of the reciprocals of the data,
    and is often appropriate when averaging quantities which are rates
    or ratios, for example speeds. Example:

    Suppose an investor purchases an equal value of shares in each of
    three companies, with P/E (price/earning) ratios of 2.5, 3 and 10.
    What is the average P/E ratio for the investor's portfolio?

    >>> harmonic_mean([2.5, 3, 10])  # For an equal investment portfolio.
    3.6

    Using the arithmetic mean would give an average of about 5.167, which
    is too high.

    If ``data`` is empty, or any element is less than zero,
    ``harmonic_mean`` will raise ``StatisticsError``.
    z.harmonic mean does not support negative valuesr(z.harmonic_mean requires at least one data pointrzunsupported typecss|]}d|VqdS)r(Nr&�r*rAr&r&r'r-�sz harmonic_mean.<locals>.<genexpr>)
r[r\rQr�
isinstance�numbersZRealrrFr>rZr`rP)r7rYr,rAr:r=r9r&r&r'ros$
"cCs\t|�}t|�}|dkr td��|ddkr8||dS|d}||d||dSdS)aBReturn the median (middle value) of numeric data.

    When the number of data points is odd, return the middle data point.
    When the number of data points is even, the median is interpolated by
    taking the average of the two middle values:

    >>> median([1, 3, 5])
    3
    >>> median([1, 3, 5, 7])
    4.0

    r�no median for empty data�r(N�r5rQr)r7r,rSr&r&r'r�s
cCsLt|�}t|�}|dkr td��|ddkr8||dS||ddSdS)a	Return the low median of numeric data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the smaller of the two middle values is returned.

    >>> median_low([1, 3, 5])
    3
    >>> median_low([1, 3, 5, 7])
    3

    rrdrer(Nrf�r7r,r&r&r'r
�scCs,t|�}t|�}|dkr td��||dS)aReturn the high median of data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the larger of the two middle values is returned.

    >>> median_high([1, 3, 5])
    3
    >>> median_high([1, 3, 5, 7])
    5

    rrdrerfrgr&r&r'r	�s
r(c
Cs�t|�}t|�}|dkr"td��n|dkr2|dS||d}||fD]}t|ttf�rFtd|��qFz||d}Wn(tk
r�t|�t|�d}YnXt||�}t	|||�}|}||d}	|||d||	S)a�Return the 50th percentile (median) of grouped continuous data.

    >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
    3.7
    >>> median_grouped([52, 52, 53, 54])
    52.5

    This calculates the median as the 50th percentile, and should be
    used when your data is continuous and grouped. In the above example,
    the values 1, 2, 3, etc. actually represent the midpoint of classes
    0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
    class 3.5-4.5, and interpolation is used to estimate it.

    Optional argument ``interval`` represents the class interval, and
    defaults to 1. Changing the class interval naturally will change the
    interpolated 50th percentile value:

    >>> median_grouped([1, 3, 3, 5, 7], interval=1)
    3.25
    >>> median_grouped([1, 3, 3, 5, 7], interval=2)
    3.5

    This function does not check whether the data points are at least
    ``interval`` apart.
    rrdr(rezexpected number but got %r)
r5rQrrb�str�bytesrFrErTrW)
r7Zintervalr,rA�obj�L�l1�l2Zcf�fr&r&r'r�s&

cCsHt|�}t|��d�}z|ddWStk
rBtd�d�YnXdS)axReturn the most common data point from discrete or nominal data.

    ``mode`` assumes discrete data, and returns a single value. This is the
    standard treatment of the mode as commonly taught in schools:

        >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
        3

    This also works with nominal (non-numeric) data:

        >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
        'red'

    If there are multiple modes with same frequency, return the first one
    encountered:

        >>> mode(['red', 'red', 'green', 'blue', 'blue'])
        'red'

    If *data* is empty, ``mode``, raises StatisticsError.

    r(rzno mode for empty dataN)r[r"�most_common�
IndexErrorr)r7Zpairsr&r&r'rscCs@tt|����}tt|td�d�dgf�\}}tttd�|��S)a.Return a list of the most frequently occurring values.

    Will return more than one result if there are multiple modes
    or an empty list if *data* is empty.

    >>> multimode('aabbbbbbbbcc')
    ['b']
    >>> multimode('aabbbbccddddeeffffgg')
    ['b', 'd', 'f']
    >>> multimode('')
    []
    r()�keyr)r"r[ro�nextrr!r\r3)r7ZcountsZmaxcountZ
mode_itemsr&r&r'r5s
��	exclusive)r,�methodc
CsL|dkrtd��t|�}t|�}|dkr0td��|dkr�|d}g}td|�D]N}|||}||||}||||||d||}	|�|	�qN|S|dk�r:|d}g}td|�D]r}|||}|dkr�dn||dkr�|dn|}||||}||d||||||}	|�|	�q�|Std|����dS)	a�Divide *data* into *n* continuous intervals with equal probability.

    Returns a list of (n - 1) cut points separating the intervals.

    Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
    Set *n* to 100 for percentiles which gives the 99 cuts points that
    separate *data* in to 100 equal sized groups.

    The *data* can be any iterable containing sample.
    The cut points are linearly interpolated between data points.

    If *method* is set to *inclusive*, *data* is treated as population
    data.  The minimum value is treated as the 0th percentile and the
    maximum value is treated as the 100th percentile.
    r(zn must be at least 1rez"must have at least two data pointsZ	inclusivertzUnknown method: N)rr5rQ�range�appendrM)
r7r,ruZld�m�resultrS�jZdeltaZinterpolatedr&r&r'rls4$
$$cs��dk	r,t�fdd�|D��\}}}||fSt|��t�fdd�|D��\}}}t�fdd�|D��\}}}||dt|�8}||fS)a;Return sum of square deviations of sequence data.

    If ``c`` is None, the mean is calculated in one pass, and the deviations
    from the mean are calculated in a second pass. Otherwise, deviations are
    calculated from ``c`` as given. Use the second case with care, as it can
    lead to garbage results.
    Nc3s|]}|�dVqdS�reNr&ra��cr&r'r-�sz_ss.<locals>.<genexpr>c3s|]}|�dVqdSr{r&rar|r&r'r-�sc3s|]}|�VqdSr)r&rar|r&r'r-�sre)r>rrQ)r7r}r:r=r9�UZtotal2Zcount2r&r|r'�_ss�srcCsLt|�|krt|�}t|�}|dkr,td��t||�\}}t||d|�S)a�Return the sample variance of data.

    data should be an iterable of Real-valued numbers, with at least two
    values. The optional argument xbar, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function when your data is a sample from a population. To
    calculate the variance from the entire population, see ``pvariance``.

    Examples:

    >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
    >>> variance(data)
    1.3720238095238095

    If you have already calculated the mean of your data, you can pass it as
    the optional second argument ``xbar`` to avoid recalculating it:

    >>> m = mean(data)
    >>> variance(data, m)
    1.3720238095238095

    This function does not check that ``xbar`` is actually the mean of
    ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
    impossible results.

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('31.01875')

    >>> from fractions import Fraction as F
    >>> variance([F(1, 6), F(1, 2), F(5, 3)])
    Fraction(67, 108)

    rez*variance requires at least two data pointsr(�r[r\rQrrrP)r7�xbarr,r:�ssr&r&r'r�s&cCsHt|�|krt|�}t|�}|dkr,td��t||�\}}t|||�S)a,Return the population variance of ``data``.

    data should be a sequence or iterable of Real-valued numbers, with at least one
    value. The optional argument mu, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function to calculate the variance from the entire population.
    To estimate the variance from a sample, the ``variance`` function is
    usually a better choice.

    Examples:

    >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
    >>> pvariance(data)
    1.25

    If you have already calculated the mean of the data, you can pass it as
    the optional second argument to avoid recalculating it:

    >>> mu = mean(data)
    >>> pvariance(data, mu)
    1.25

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('24.815')

    >>> from fractions import Fraction as F
    >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
    Fraction(13, 72)

    r(z*pvariance requires at least one data pointr�)r7�mur,r:r�r&r&r'r�s#cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the sample variance.

    See ``variance`` for arguments and other details.

    >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    1.0810874155219827

    N)rrr?r@)r7r��varr&r&r'rs
	

cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the population variance.

    See ``pvariance`` for arguments and other details.

    >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    0.986893273527251

    N)rrr?r@)r7r�r�r&r&r'r
&s
	

cCs|d}t|�dkr�d||}d|d|d|d|d|d	|d
|d|}d|d
|d|d|d|d|d|d}||}|||S|dkr�|nd|}tt|��}|dk�r^|d}d|d|d|d|d|d|d|d}d|d |d!|d"|d#|d$|d%|d}n�|d}d&|d'|d(|d)|d*|d+|d,|d-}d.|d/|d0|d1|d2|d3|d4|d}||}|dk�r�|}|||S)5N��?g333333�?g��Q��?g^�}o)��@g�E.k�R�@g ��Ul�@g*u��>l�@g�N����@g�"]Ξ@gnC���`@gu��@giK��~j�@gv��|E�@g��d�|1�@gfR��r��@g��u.2�@g���~y�@g�n8(E@��?�g@g�������?g鬷�ZaI?gg�El�D�?g7\�����?g�uS�S�?g�=�.
@gj%b�@g���Hw�@gjR�e�?g�9dh?
>g('߿��A?g��~z �?g@�3��?gɅ3��?g3fR�x�?gI�F��l@g����t��>g*�Y��n�>gESB\T?g�N;A+�?g�UR1��?gE�F���?gP�n��@g&�>���@g����i�<g�@�F�>g�tcI,\�>g�ŝ���I?g*F2�v�?g�C4�?g��O�1�?)rrr)�pr��sigma�q�rZnumZdenrAr&r&r'�_normal_dist_inv_cdf9sd���������������������������
��������������������������	��������������������������
r�c@s�eZdZdZddd�Zd8dd�Zed	d
��Zdd�d
d�Zdd�Z	dd�Z
dd�Zd9dd�Zdd�Z
edd��Zedd��Zedd��Zed d!��Zed"d#��Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZeZd0d1�ZeZd2d3�Zd4d5�Zd6d7�ZdS):rz(Normal distribution of a random variablez(Arithmetic mean of a normal distributionz+Standard deviation of a normal distribution)�_mu�_sigmar�r�cCs(|dkrtd��t|�|_t|�|_dS)zDNormalDist where mu is the mean and sigma is the standard deviation.r�zsigma must be non-negativeN)rrEr�r�)�selfr�r�r&r&r'�__init__�s
zNormalDist.__init__cCs.t|ttf�st|�}t|�}||t||��S)z5Make a normal distribution instance from sample data.)rbr\�tuplerr)�clsr7r�r&r&r'�from_samples�szNormalDist.from_samplesN)�seedcsB|dkrtjn
t�|�j�|j|j�����fdd�t|�D�S)z=Generate *n* samples for a given mean and standard deviation.Ncsg|]}�����qSr&r&�r*rS��gaussr�r�r&r'�
<listcomp>�sz&NormalDist.samples.<locals>.<listcomp>)�randomr�ZRandomr�r�rv)r�r,r�r&r�r'�samples�szNormalDist.samplescCs<|jd}|std��t||jdd|�tt|�S)z4Probability density function.  P(x <= X < x+dx) / dx�@z$pdf() not defined when sigma is zerog�)r�rrr�rr)r�rArr&r&r'�pdf�s
zNormalDist.pdfcCs2|jstd��ddt||j|jtd��S)z,Cumulative distribution function.  P(X <= x)z$cdf() not defined when sigma is zeror�r�r�)r�rrr�r)r�rAr&r&r'�cdf�szNormalDist.cdfcCs:|dks|dkrtd��|jdkr*td��t||j|j�S)aSInverse cumulative distribution function.  x : P(X <= x) = p

        Finds the value of the random variable such that the probability of
        the variable being less than or equal to that value equals the given
        probability.

        This function is also called the percent point function or quantile
        function.
        r�r�z$p must be in the range 0.0 < p < 1.0z-cdf() not defined when sigma at or below zero)rr�r�r�)r�r�r&r&r'�inv_cdf�s


zNormalDist.inv_cdfrscs��fdd�td��D�S)anDivide into *n* continuous intervals with equal probability.

        Returns a list of (n - 1) cut points separating the intervals.

        Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
        Set *n* to 100 for percentiles which gives the 99 cuts points that
        separate the normal distribution in to 100 equal sized groups.
        csg|]}��|���qSr&)r�r��r,r�r&r'r��sz(NormalDist.quantiles.<locals>.<listcomp>r()rv)r�r,r&r�r'r�s	zNormalDist.quantilescCst|t�std��||}}|j|jf|j|jfkr>||}}|j|j}}|rT|s\td��||}t|j|j�}|s�dt|d|jt	d��S|j||j|}|j|jt	|d|t
||��}	||	|}
||	|}dt|�|
�|�|
��t|�|�|�|��S)a�Compute the overlapping coefficient (OVL) between two normal distributions.

        Measures the agreement between two normal probability distributions.
        Returns a value between 0.0 and 1.0 giving the overlapping area in
        the two underlying probability density functions.

            >>> N1 = NormalDist(2.4, 1.6)
            >>> N2 = NormalDist(3.2, 2.0)
            >>> N1.overlap(N2)
            0.8035050657330205
        z$Expected another NormalDist instancez(overlap() not defined when sigma is zeror�r�)rbrrFr�r�rrrrrrr�)r��other�X�YZX_varZY_varZdvZdmrR�b�x1�x2r&r&r'�overlap�s"


(zNormalDist.overlapcCs|jS)z+Arithmetic mean of the normal distribution.�r��r�r&r&r'r�szNormalDist.meancCs|jS)z,Return the median of the normal distributionr�r�r&r&r'r�szNormalDist.mediancCs|jS)z�Return the mode of the normal distribution

        The mode is the value x where which the probability density
        function (pdf) takes its maximum value.
        r�r�r&r&r'r�szNormalDist.modecCs|jS)z.Standard deviation of the normal distribution.�r�r�r&r&r'r�szNormalDist.stdevcCs
|jdS)z!Square of the standard deviation.r�r�r�r&r&r'rszNormalDist.variancecCs8t|t�r&t|j|jt|j|j��St|j||j�S)ajAdd a constant or another NormalDist instance.

        If *other* is a constant, translate mu by the constant,
        leaving sigma unchanged.

        If *other* is a NormalDist, add both the means and the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        �rbrr�rr��r�r�r&r&r'�__add__	s

zNormalDist.__add__cCs8t|t�r&t|j|jt|j|j��St|j||j�S)asSubtract a constant or another NormalDist instance.

        If *other* is a constant, translate by the constant mu,
        leaving sigma unchanged.

        If *other* is a NormalDist, subtract the means and add the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        r�r�r&r&r'�__sub__s

zNormalDist.__sub__cCst|j||jt|��S)z�Multiply both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        �rr�r�rr�r&r&r'�__mul__%szNormalDist.__mul__cCst|j||jt|��S)z�Divide both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        r�r�r&r&r'�__truediv__-szNormalDist.__truediv__cCst|j|j�S)zReturn a copy of the instance.�rr�r��r�r&r&r'�__pos__5szNormalDist.__pos__cCst|j|j�S)z(Negates mu while keeping sigma the same.r�r�r&r&r'�__neg__9szNormalDist.__neg__cCs
||S)z<Subtract a NormalDist from a constant or another NormalDist.r&r�r&r&r'�__rsub__?szNormalDist.__rsub__cCs&t|t�stS|j|jko$|j|jkS)zFTwo NormalDist objects are equal if their mu and sigma are both equal.)rbr�NotImplementedr�r�r�r&r&r'�__eq__Es
zNormalDist.__eq__cCst|j|jf�S)zCNormalDist objects hash equal if their mu and sigma are both equal.)�hashr�r�r�r&r&r'�__hash__KszNormalDist.__hash__cCs t|�j�d|j�d|j�d�S)Nz(mu=z, sigma=�))r2r#r�r�r�r&r&r'�__repr__OszNormalDist.__repr__)r�r�)rs) r#r$r%�__doc__�	__slots__r��classmethodr�r�r�r�r�rr��propertyrrrrrr�r�r�r�r�r��__radd__r��__rmul__r�r�r�r&r&r&r'r�sF�


"




)r��__main__)�isclose)�add�sub�mul�truediv)�repeat�
�����i��z
Test z with another NormalDist:�z with a constant:�z
Test constant with �:cCsdSr)r&)�G1�G2r&r&r'�assert_closesr�i�����I��/g`@@cCsg|]}|t�qSr&��srar&r&r'r��sr�cCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]\}}||�qSr&r&�r*rA�yr&r&r'r��scCsg|]\}}||�qSr&r&r�r&r&r'r��s)r)rX)r()N)N)N)N)N)Rr��__all__r@rcr�Z	fractionsrZdecimalr�	itertoolsrZbisectrrrrrrrrrr �operatorr!�collectionsr"rMrr>rBr0r.rPrTrWrZrrrrrr
r	rrrrrrrrr
r�rZ_statistics�ImportErrorr#r�r�r�r�r�r�ZdoctestZg1Zg2r,r�r�r��func�printr�r3Zconstr�r�r�r�rG�zipZtestmodr&r&r&r'�<module>s�S�(
: 

/
779

/
,

JQ






�
�
_collections_abc.cpython-38.opt-2.pyc000064400000056204151450073350013430 0ustar00U

e5d�e�@spddlmZmZddlZddddddd	d
ddd
ddddddddddddddgZdZeed��Zeee	���Z
eei����Zeei�
���Zeei����Zeeg��Zeeeg���Zeeed���Zeeedd>���Zeee���Zeed ��Zeed!��Zeee���Zei���Zei�
��Zei���Zeej �Z!ed"d#���Z"d$d%�Z#e#�Z#ee#�Z$e#�%�[#d&d'�Z&e&�Z&ee&�Z'[&d(d)�Z(Gd*d�ded+�Z)Gd,d�ded+�Z*Gd-d�de*�Z+e+�,e$�Gd.d�ded+�Z-Gd/d�de-�Z.Gd0d�de.�Z/e/�,e'�Gd1d	�d	ed+�Z0Gd2d
�d
e0�Z1e1�,e�e1�,e
�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�Gd3d�de0�Z2Gd4d�de1�Z3e3�,e"�Gd5d
�d
ed+�Z4Gd6d�ded+�Z5Gd7d�de4e0e5�Z6Gd8d�ded+�Z7Gd9d�de6�Z8e8�,e9�Gd:d�de8�Z:e:�,e�Gd;d�de6�Z;e;�,e!�Gd<d�de4�Z<Gd=d�de<e8�Z=e=�,e�Gd>d�de<e8�Z>e>�,e�Gd?d�de<e6�Z?e?�,e�Gd@d�de;�Z@e@�,eA�GdAd�de2e6�ZBeB�,eC�eB�,eD�eB�,e�eB�,eE�GdBd�deB�ZFeF�,eG�eF�,e	�GdCd�deB�ZHeH�,eI�eH�,e	�dS)D�)�ABCMeta�abstractmethodN�	Awaitable�	Coroutine�
AsyncIterable�
AsyncIterator�AsyncGenerator�Hashable�Iterable�Iterator�	Generator�
Reversible�Sized�	Container�Callable�
Collection�Set�
MutableSet�Mapping�MutableMapping�MappingView�KeysView�	ItemsView�
ValuesView�Sequence�MutableSequence�
ByteStringzcollections.abc��i���ccsdVS�Nr r r r �(/usr/lib64/python3.8/_collections_abc.py�<lambda>8rr#c�sdSr!r r r r r"�_coro:rr$cCs
dVdSr!r r r r r"�_ag@rr%cGsN|j}|D]>}|D],}||jkr|j|dkr:tSq
qtSq
dS)NT)�__mro__�__dict__�NotImplemented)�C�methods�mro�method�Br r r"�_check_methodsHs

r.c@s(eZdZdZedd��Zedd��ZdS)r	r cCsdS�Nrr ��selfr r r"�__hash__XszHashable.__hash__cCs|tkrt|d�StS)Nr2)r	r.r(��clsr)r r r"�__subclasshook__\s
zHashable.__subclasshook__N)�__name__�
__module__�__qualname__�	__slots__rr2�classmethodr5r r r r"r	Ts

)�	metaclassc@s(eZdZdZedd��Zedd��ZdS)rr ccs
dVdSr!r r0r r r"�	__await__gszAwaitable.__await__cCs|tkrt|d�StS)Nr<)rr.r(r3r r r"r5ks
zAwaitable.__subclasshook__N)r6r7r8r9rr<r:r5r r r r"rcs

c@s>eZdZdZedd��Zeddd��Zdd�Zed	d
��Z	dS)rr cCst�dSr!��
StopIteration�r1�valuer r r"�sendvszCoroutine.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dSr!��with_traceback�r1�typ�val�tbr r r"�throw}s
zCoroutine.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)Nzcoroutine ignored GeneratorExit�rH�
GeneratorExitr>�RuntimeErrorr0r r r"�close�s
zCoroutine.closecCs|tkrt|dddd�StS)Nr<rArHrL)rr.r(r3r r r"r5�szCoroutine.__subclasshook__)NN)
r6r7r8r9rrArHrLr:r5r r r r"rrs

c@s(eZdZdZedd��Zedd��ZdS)rr cCst�Sr!)rr0r r r"�	__aiter__�szAsyncIterable.__aiter__cCs|tkrt|d�StS)NrM)rr.r(r3r r r"r5�s
zAsyncIterable.__subclasshook__N)r6r7r8r9rrMr:r5r r r r"r�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr c�st�dSr!��StopAsyncIterationr0r r r"�	__anext__�szAsyncIterator.__anext__cCs|Sr!r r0r r r"rM�szAsyncIterator.__aiter__cCs|tkrt|dd�StS)NrPrM)rr.r(r3r r r"r5�szAsyncIterator.__subclasshook__N)	r6r7r8r9rrPrMr:r5r r r r"r�s
c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr c�s|�d�IdHSr!)�asendr0r r r"rP�szAsyncGenerator.__anext__c�st�dSr!rNr?r r r"rQ�szAsyncGenerator.asendNc�s4|dkr|dkr|�|�}|dk	r,|�|�}|�dSr!rBrDr r r"�athrow�s
zAsyncGenerator.athrowc	�s:z|�t�IdHWnttfk
r,Yn
Xtd��dS)Nz,asynchronous generator ignored GeneratorExit)rRrJrOrKr0r r r"�aclose�s
zAsyncGenerator.aclosecCs|tkrt|ddddd�StS)NrMrPrQrRrS)rr.r(r3r r r"r5�s�zAsyncGenerator.__subclasshook__)NN)r6r7r8r9rPrrQrRrSr:r5r r r r"r�s

c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__iter__�szIterable.__iter__cCs|tkrt|d�StS)NrT)r
r.r(r3r r r"r5�s
zIterable.__subclasshook__N)r6r7r8r9rrTr:r5r r r r"r
�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr cCst�dSr!r=r0r r r"�__next__szIterator.__next__cCs|Sr!r r0r r r"rTszIterator.__iter__cCs|tkrt|dd�StS)NrTrU)rr.r(r3r r r"r5szIterator.__subclasshook__N)	r6r7r8r9rrUrTr:r5r r r r"rs
c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__reversed__)szReversible.__reversed__cCs|tkrt|dd�StS)NrVrT)r
r.r(r3r r r"r5.szReversible.__subclasshook__N)r6r7r8r9rrVr:r5r r r r"r
%s

c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr cCs
|�d�Sr!)rAr0r r r"rU9szGenerator.__next__cCst�dSr!r=r?r r r"rA?szGenerator.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dSr!rBrDr r r"rHFs
zGenerator.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)Nzgenerator ignored GeneratorExitrIr0r r r"rLSs
zGenerator.closecCs|tkrt|ddddd�StS)NrTrUrArHrL)rr.r(r3r r r"r5]s�zGenerator.__subclasshook__)NN)r6r7r8r9rUrrArHrLr:r5r r r r"r5s

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdSr/r r0r r r"�__len__ksz
Sized.__len__cCs|tkrt|d�StS)NrW)rr.r(r3r r r"r5os
zSized.__subclasshook__N)r6r7r8r9rrWr:r5r r r r"rgs

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdS�NFr )r1�xr r r"�__contains__zszContainer.__contains__cCs|tkrt|d�StS)NrZ)rr.r(r3r r r"r5~s
zContainer.__subclasshook__N)r6r7r8r9rrZr:r5r r r r"rvs

c@seZdZdZedd��ZdS)rr cCs|tkrt|ddd�StS)NrWrTrZ)rr.r(r3r r r"r5�szCollection.__subclasshook__N)r6r7r8r9r:r5r r r r"r�sc@s(eZdZdZedd��Zedd��ZdS)rr cOsdSrXr )r1�args�kwdsr r r"�__call__�szCallable.__call__cCs|tkrt|d�StS)Nr])rr.r(r3r r r"r5�s
zCallable.__subclasshook__N)r6r7r8r9rr]r:r5r r r r"r�s

c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
dd�ZeZdd�Z
dd�ZeZdd�Zdd�Zdd�ZeZdd�ZdS)rr cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dS�NFT��
isinstancerr(�len�r1�other�elemr r r"�__le__�s
z
Set.__le__cCs(t|t�stSt|�t|�ko&|�|�Sr!�r`rr(rare�r1rcr r r"�__lt__�s
z
Set.__lt__cCs(t|t�stSt|�t|�ko&|�|�Sr!)r`rr(ra�__ge__rgr r r"�__gt__�s
z
Set.__gt__cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dSr^r_rbr r r"ri�s
z
Set.__ge__cCs(t|t�stSt|�t|�ko&|�|�Sr!rfrgr r r"�__eq__�s
z
Set.__eq__cCs||�Sr!r )r4�itr r r"�_from_iterable�szSet._from_iterablecs&t|t�stS���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ��.0r@r0r r"�	<genexpr>�szSet.__and__.<locals>.<genexpr>�r`r
r(rmrgr r0r"�__and__�s
zSet.__and__cCs|D]}||krdSqdSr^r )r1rcr@r r r"�
isdisjoint�szSet.isdisjointcCs*t|t�stSdd�||fD�}|�|�S)Ncss|]}|D]
}|Vq
qdSr!r )ro�s�er r r"rp�szSet.__or__.<locals>.<genexpr>rq)r1rc�chainr r r"�__or__�s
z
Set.__or__cs:t�t�s"t�t�stS|����|��fdd�|D��S)Nc3s|]}|�kr|VqdSr!r rn�rcr r"rp�s�zSet.__sub__.<locals>.<genexpr>�r`rr
r(rmrgr rxr"�__sub__�s



zSet.__sub__cs:t|t�s"t|t�stS��|�}���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r rnr0r r"rp�s�zSet.__rsub__.<locals>.<genexpr>ryrgr r0r"�__rsub__�s



zSet.__rsub__cCs2t|t�s"t|t�stS|�|�}||||BSr!ryrgr r r"�__xor__s



zSet.__xor__cCs�tj}d|d}t|�}d|d}||M}|D],}t|�}|||d>AdAdN}||M}q2|dd}||M}||kr�||d8}|d	kr�d
}|S)N�riM��r�i�M[l�4~2i�
i��6���i��8#)�sys�maxsizera�hash)r1�MAX�MASK�n�hrY�hxr r r"�_hash	s 
z	Set._hashN)r6r7r8r9rerhrjrirkr:rmrr�__rand__rsrw�__ror__rzr{r|�__rxor__r�r r r r"r�s$


c@s`eZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)rr cCst�dSr!��NotImplementedErrorr?r r r"�add:szMutableSet.addcCst�dSr!r�r?r r r"�discard?szMutableSet.discardcCs||krt|��|�|�dSr!)�KeyErrorr�r?r r r"�removeDszMutableSet.removecCs>t|�}zt|�}Wntk
r.td�YnX|�|�|Sr!)�iter�nextr>r�r��r1rlr@r r r"�popJs
zMutableSet.popcCs(z|��qWntk
r"YnXdSr!)r�r�r0r r r"�clearTszMutableSet.clearcCs|D]}|�|�q|Sr!)r�r�r r r"�__ior__\szMutableSet.__ior__cCs||D]}|�|�q|Sr!)r�r�r r r"�__iand__aszMutableSet.__iand__cCsR||kr|��n<t|t�s&|�|�}|D]"}||krB|�|�q*|�|�q*|Sr!)r�r`rrmr�r�r�r r r"�__ixor__fs


zMutableSet.__ixor__cCs*||kr|��n|D]}|�|�q|Sr!)r�r�r�r r r"�__isub__ss

zMutableSet.__isub__N)r6r7r8r9rr�r�r�r�r�r�r�r�r�r r r r"r,s



c@sReZdZdZedd��Zddd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdS)rr cCst�dSr!�r��r1�keyr r r"�__getitem__�szMapping.__getitem__NcCs(z
||WStk
r"|YSXdSr!r��r1r��defaultr r r"�get�s
zMapping.getcCs,z||Wntk
r"YdSXdSdSr^r�r�r r r"rZ�s
zMapping.__contains__cCst|�Sr!)rr0r r r"�keys�szMapping.keyscCst|�Sr!)rr0r r r"�items�sz
Mapping.itemscCst|�Sr!)rr0r r r"�values�szMapping.valuescCs&t|t�stSt|���t|���kSr!)r`rr(�dictr�rgr r r"rk�s
zMapping.__eq__)N)
r6r7r8r9rr�r�rZr�r�r�rkrVr r r r"r�s


c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��_mappingcCs
||_dSr!r�)r1�mappingr r r"�__init__�szMappingView.__init__cCs
t|j�Sr!)rar�r0r r r"rW�szMappingView.__len__cCs
d�|�S)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr0r r r"�__repr__�szMappingView.__repr__N)r6r7r8r9r�rWr�r r r r"r�sc@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!��set�r1rlr r r"rm�szKeysView._from_iterablecCs
||jkSr!r�r�r r r"rZ�szKeysView.__contains__ccs|jEdHdSr!r�r0r r r"rT�szKeysView.__iter__N�r6r7r8r9r:rmrZrTr r r r"r�s

c@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!r�r�r r r"rm�szItemsView._from_iterablecCsB|\}}z|j|}Wntk
r,YdSX||kp<||kSdSrX)r�r�)r1�itemr�r@�vr r r"rZ�szItemsView.__contains__ccs |jD]}||j|fVqdSr!r�r�r r r"rT�s
zItemsView.__iter__Nr�r r r r"r�s

	c@s eZdZdZdd�Zdd�ZdS)rr cCs0|jD]$}|j|}||ks$||krdSqdS�NTFr�)r1r@r�r�r r r"rZ�s


zValuesView.__contains__ccs|jD]}|j|VqdSr!r�r�r r r"rT�s
zValuesView.__iter__N)r6r7r8r9rZrTr r r r"r�sc@s^eZdZdZedd��Zedd��Ze�Zefdd�Z	dd	�Z
d
d�Zddd
�Zddd�Z
dS)rr cCst�dSr!r��r1r�r@r r r"�__setitem__szMutableMapping.__setitem__cCst�dSr!r�r�r r r"�__delitem__szMutableMapping.__delitem__cCs@z||}Wn$tk
r0||jkr(�|YSX||=|SdSr!)r��_MutableMapping__marker)r1r�r�r@r r r"r�s

zMutableMapping.popcCsBztt|��}Wntk
r*td�YnX||}||=||fSr!)r�r�r>r�r�r r r"�popitem$szMutableMapping.popitemcCs(z|��qWntk
r"YnXdSr!)r�r�r0r r r"r�0szMutableMapping.clearcKs|t|t�r"|D]}||||<qn<t|d�rH|��D]}||||<q4n|D]\}}|||<qL|��D]\}}|||<qfdS)Nr�)r`r�hasattrr�r�)r1rcr\r�r@r r r"�update8s


zMutableMapping.updateNcCs,z
||WStk
r&|||<YnX|Sr!r�r�r r r"�
setdefaultJs

zMutableMapping.setdefault)r )N)r6r7r8r9rr�r��objectr�r�r�r�r�r�r r r r"r�s


c@sFeZdZdZedd��Zdd�Zdd�Zdd	�Zddd
�Z	dd�Z
dS)rr cCst�dSr!��
IndexError�r1�indexr r r"r�bszSequence.__getitem__ccs<d}z||}|V|d7}qWntk
r6YdSXdS�Nrrr�)r1�ir�r r r"rTfszSequence.__iter__cCs$|D]}||ks||krdSqdSr�r )r1r@r�r r r"rZpszSequence.__contains__ccs$ttt|���D]}||VqdSr!)�reversed�rangera)r1r�r r r"rVvszSequence.__reversed__rNcCs�|dk	r"|dkr"tt|�|d�}|dk	r>|dkr>|t|�7}|}|dksR||kr�z"||}||ksl||krr|WSWntk
r�Yq�YnX|d7}qBt�dSr�)�maxrar��
ValueError)r1r@�start�stopr�r�r r r"r�zs


zSequence.indexcst�fdd�|D��S)Nc3s"|]}|�ks|�krdVqdS)rNr )ror��r@r r"rp�sz!Sequence.count.<locals>.<genexpr>)�sumr?r r�r"�count�szSequence.count)rN)r6r7r8r9rr�rTrZrVr�r�r r r r"rXs


c@seZdZdZdS)rr N)r6r7r8r9r r r r"r�sc@sneZdZdZedd��Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�ZdS)rr cCst�dSr!r��r1r�r@r r r"r��szMutableSequence.__setitem__cCst�dSr!r�r�r r r"r��szMutableSequence.__delitem__cCst�dSr!r�r�r r r"�insert�szMutableSequence.insertcCs|�t|�|�dSr!)r�rar?r r r"�append�szMutableSequence.appendcCs(z|��qWntk
r"YnXdSr!)r�r�r0r r r"r��szMutableSequence.clearcCsHt|�}t|d�D].}|||d||||<|||d<qdS)Nr}r)rar�)r1r�r�r r r"�reverse�szMutableSequence.reversecCs(||krt|�}|D]}|�|�qdSr!)�listr�)r1r�r�r r r"�extend�szMutableSequence.extendrcCs||}||=|Sr!r )r1r�r�r r r"r��szMutableSequence.popcCs||�|�=dSr!)r�r?r r r"r��szMutableSequence.removecCs|�|�|Sr!)r�)r1r�r r r"�__iadd__�s
zMutableSequence.__iadd__N)r)r6r7r8r9rr�r�r�r�r�r�r�r�r�r�r r r r"r�s	



)J�abcrrr��__all__r6�typer��bytes_iterator�	bytearray�bytearray_iteratorr��dict_keyiteratorr��dict_valueiteratorr��dict_itemiterator�
list_iteratorr��list_reverseiteratorr��range_iterator�longrange_iteratorr��set_iterator�str_iterator�tuple_iterator�zip�zip_iterator�	dict_keys�dict_values�
dict_itemsr'�mappingproxy�	generatorr$�	coroutinerLr%�async_generatorr.r	rr�registerrrrr
rr
rrrrrr�	frozensetrrrrrrrr�r�tuple�str�
memoryviewr�bytesrr�r r r r"�<module>	s��	
)
0













/



O
2



S
=



	

C
io.cpython-38.opt-2.pyc000064400000003657151450073350010561 0ustar00U

e5d�
�@sfdZddddddddd	d
ddd
ddddddgZddlZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZejZde_dZdZdZGdd�dejejd�ZGdd�deje�ZGdd	�d	eje�ZGdd�deje�Ze� e	�e
ee
eefD]Z!e� e!��qeefD]Z!e� e!��q[!zddlm"Z"Wne#k
�rVYnXe� e"�dS) z�Guido van Rossum <guido@python.org>, Mike Verdone <mike.verdone@gmail.com>, Mark Russell <mark.russell@zen.co.uk>, Antoine Pitrou <solipsis@pitrou.net>, Amaury Forgeot d'Arc <amauryfa@gmail.com>, Benjamin Peterson <benjamin@python.org>�BlockingIOError�open�	open_code�IOBase�	RawIOBase�FileIO�BytesIO�StringIO�BufferedIOBase�BufferedReader�BufferedWriter�BufferedRWPair�BufferedRandom�
TextIOBase�
TextIOWrapper�UnsupportedOperation�SEEK_SET�SEEK_CUR�SEEK_END�N)�DEFAULT_BUFFER_SIZErrrrrrrr
rrr
�IncrementalNewlineDecoderr�io��c@seZdZejjZdS)rN)�__name__�
__module__�__qualname__�_io�_IOBase�__doc__�r r �/usr/lib64/python3.8/io.pyrHs)�	metaclassc@seZdZejjZdS)rN)rrrr�
_RawIOBaserr r r r!rKsc@seZdZejjZdS)r	N)rrrr�_BufferedIOBaserr r r r!r	Nsc@seZdZejjZdS)rN)rrrr�_TextIOBaserr r r r!rQs)�_WindowsConsoleIO)$�
__author__�__all__r�abcrrrrrrrrr
rrr
rr�OpenWrapperrrrrr�ABCMetarr#rr$r	r%r�register�klassr&�ImportErrorr r r r!�<module>%sR
�@
�typing.cpython-38.opt-1.pyc000064400000171645151450073350011466 0ustar00U

e5db
�G@s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddlm
Z
mZmZddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKgGZd�dMdN�ZdOdP�ZdQdR�ZdSdT�ZdUdV�ZdWdX�ZgZdYdZ�Zd[d\�ZGd]d^�d^�ZGd_d`�d`�ZGdadb�dbeedLdc�Zedddde�ZedGdfde�Zeddgde�Zeddhde�Z eddide�Z!eddjde�Z"eddkde�Z#Gdld	�d	edLdc�Z$Gdmd�deedLdc�Z%d7dd5d9d:d4d6dddn�	Z&dodp�Z'Gdqdr�dredLdc�Z(Gdsdt�dte(dLdc�Z)Gdud
�d
�Z*Gdvdw�dw�Z+Gdxdy�dy�Z,dzd{d|d}d~gZ-dd�d�d�d�d�d�d�d�d�g
Z.e-e.d�gZ/d�d��Z0d�d��Z1d�d��Z2d�d��Z3dd#ddd%dd!dd'd*g
d�d�gd��Z4Gd�d��d�e�Z5Gd�d
�d
e*e5d��Z6d�dI�Z7d�d?�Z8d�d��Z9ej:ej;ej<ej=e
eefZ>d�d�dC�Z?d�dB�Z@d�dA�ZAd�dE�ZBd�dF�ZCd�d��ZDd�dH�ZEd�d@�ZFe%d��ZGe%d��ZHe%d��ZIe%d�dLd��ZJe%d�dLd��ZKe%d�dLd��ZLe%d�dLd��ZMe%d�dLeNd��ZOe%d>ePeQ�ZRd�d�d��ZSeSejjTd��ZTeSejjUeJ�ZUeSejjVeJeMeKf�ZVeSejjWeJ�ZWeSejjXeJ�ZXeSejjYeJ�ZYeSejjZeJ�ZZeSejj[eJ�Z[eSejj\d��Z\eSejj]eJ�Z]eSejj^eJ�Z^e)ejj_d�dLd��Z_d�e__eSejj`eJ�ZaeSejjbeG�ZbeSejjceHeLf�ZceSejjdeHeIf�ZdeSejjeeJ�ZeeSejjfeG�ZfeSejjgd��Zge)ehd�d�dLd��Zid�ei_eSejeGd�d��ZkeSejleG�ZmeSeneGd�d��Z`eSeoeJd�d��ZpeSejjqeJ�ZqeSejjreH�ZreSejjseHeLf�ZseSejjteL�ZteSejueJ�ZveSejweJ�ZxeSeyeHeIfd�d��ZzeSej{eHeIf�Z|eSej}eHeIf�Z}eSej~eG�Z~eSejeHeIf�ZeSejj�eJeMeKf�Z�eSejj�eJeMf�Z�eSeNeOd�d��Z�d�e�_e7Gd�d0�d0e6��Z�e7Gd�d.�d.e6��Z�e7Gd�d-�d-e6��Z�e7Gd�d,�d,e6��Z�e7Gd�d/�d/e6��Z�e7Gd�d+�d+e6eJ��Z�e7Gd�d1�d1e6eJ��Z�d�dÄZ�d�Z�d�Z�Gd�dDŽd�eN�Z�Gd�d;�d;e�d��Z�d�dʄZ�d�dLd˜d�d̈́Z�d�dτZ�Gd�dфd�eN�Z�Gd�d<�d<eye�d��Z�d�dD�Z�eQZ�d�Z�Gd�dՄd�e*eR�Z�Gd�dׄd�e�eP�Z�Gd�dلd�e�eQ�Z�Gd�dۄdۃZ�e�d�e�_�e�ej�e�j�<eSe
j�eR�Z�eSe
j�eR�Z�Gd�dބdރZ	e�d�e	_�e	ej�e	j�<dS)�a=
The typing module: Support for gradual typing as defined by PEP 484.

At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its instances (special forms): Any, NoReturn, ClassVar, Union, Optional
* Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar
* The core of internal generics API: _GenericAlias and _VariadicGenericAlias, the latter is
  currently only used by Tuple and Callable. All subscripted types like X[int], Union[int, str],
  etc., are instances of either of these classes.
* The public counterpart of the generics API consists of two classes: Generic and Protocol.
* Public helper functions: get_type_hints, overload, cast, no_type_check,
  no_type_check_decorator.
* Generic aliases for collections.abc ABCs and few additional protocols.
* Special types: NewType, NamedTuple, TypedDict.
* Wrapper submodules for re and io related types.
�)�abstractmethod�ABCMetaN)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�Any�Callable�ClassVar�Final�
ForwardRef�Generic�Literal�Optional�Protocol�Tuple�Type�TypeVar�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�AnyStr�cast�final�get_args�
get_origin�get_type_hints�NewType�
no_type_check�no_type_check_decorator�NoReturn�overload�runtime_checkable�Text�
TYPE_CHECKINGTcCs�ttf}|r|ttf}|dkr(td�St|t�r:t|�St|t�r\|j	|kr\t
|�d���t|t�rr|tt
fks~|ttfkr�t
d|�d���t|tttf�r�|St|�s�t
|�d|d�d���|S)a�Check that the argument is a type, and return it (internal helper).

    As a special case, accept None and return type(None) instead. Also wrap strings
    into ForwardRef instances. Consider several corner cases, for example plain
    special forms like Union are not valid, while Union[int, str] is OK, etc.
    The msg argument is a human-readable error message, e.g::

        "Union[arg, ...]: arg should be a type."

    We append the repr() of the actual value (truncated to 100 chars).
    Nz is not valid as type argumentzPlain z Got z.100�.)rrr	r
�type�
isinstance�strr�
_GenericAlias�
__origin__�	TypeError�_SpecialFormrrIr�callable)�arg�msg�is_argumentZinvalid_generic_forms�rZ�/usr/lib64/python3.8/typing.py�_type_checkxs(

�
�r\cCsRt|t�r,|jdkr|jS|j�d|j��S|dkr8dSt|tj�rJ|jSt|�S)a;Return the repr() of an object, special-casing types (internal helper).

    If obj is a type, we return a shorter version than the default
    type.__repr__, based on the module and qualified name, which is
    typically enough to uniquely identify a type.  For everything
    else, we fall back on repr(obj).
    �builtinsrN.z...)rPrO�
__module__�__qualname__�types�FunctionType�__name__�repr)�objrZrZr[�
_type_repr�s

recs\g�|D]J}t|t�r(|�kr(��|�t|t�r|js���fdd�|jD��qt��S)z�Collect all type variable contained in types in order of
    first appearance (lexicographic order). For example::

        _collect_type_vars((T, List[S, T])) == (T, S)
    csg|]}|�kr|�qSrZrZ��.0�t��tvarsrZr[�
<listcomp>�sz&_collect_type_vars.<locals>.<listcomp>)rPr�appendrR�_special�extend�__parameters__�tuple)r`rhrZrir[�_collect_type_vars�s
rqcCs�t|t�s|St|j�}t|j�D]J\}}t|t�r\t|�D]\}}||kr<||||<q<q"t|||�||<q"|jtkr�tt	|�S|�
t	|��S)zjSubstitute type variables 'tvars' with substitutions 'subs'.
    These two must have the same length.
    )rPrR�list�__args__�	enumerater�_subs_tvarsrSrrp�	copy_with)�tprjZsubsZnew_args�arW�iZtvarrZrZr[ru�s



ruc	Cs^|jst|�d���t|�}t|j�}||krZtd||kr>dnd�d|�d|�d|����dS)	z�Check correct count for parameters of a generic cls (internal helper).
    This gives a nice error message in case of count mismatch.
    z is not a generic classzToo ZmanyZfewz parameters for z	; actual z, expected N)rorT�len)�cls�
parametersZalenZelenrZrZr[�_check_generic�s
r}cCs�g}|D]f}t|t�r.|jtkr.|�|j�qt|t�rdt|�dkrd|dtkrd|�|dd��q|�|�qt	|�}t|�t|�kr�g}|D] }||kr�|�|�|�
|�q�|}t|�S)zyAn internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
    r�N)rPrRrSrrnrsrprzrl�set�remove)r|�params�pZ
all_paramsZ
new_paramsrhrZrZr[�_remove_dups_flatten�s "
r�cs4t�����t��j�t�����fdd��}|S)zInternal wrapper caching __getitem__ of generic types with a fallback to
    original function for non-hashable arguments.
    cs,z�||�WStk
r YnX�||�S�N�rT��args�kwds��cached�funcrZr[�inner�s
z_tp_cache.<locals>.inner)�	functools�	lru_cache�	_cleanupsrl�cache_clear�wraps)r�r�rZr�r[�	_tp_cache�s
r�csbt|t�r|����St|t�r^t��fdd�|jD��}||jkrH|S|�|�}|j|_|S|S)z�Evaluate all forward references in the given type t.
    For use of globalns and localns see the docstring for get_type_hints().
    c3s|]}t|���VqdSr�)�
_eval_type�rgrx��globalns�localnsrZr[�	<genexpr>sz_eval_type.<locals>.<genexpr>)rPr�	_evaluaterRrprsrvrm)rhr�r�Zev_args�resrZr�r[r�	s



r�c@seZdZdZdZdd�ZdS)�_FinalzMixin to prohibit subclassing)�__weakref__cOsd|krtd��dS)N�_rootz&Cannot subclass special typing classesr���selfr�r�rZrZr[�__init_subclass__sz_Final.__init_subclass__N)rbr^r_�__doc__�	__slots__r�rZrZrZr[r�sr�c@s eZdZdZdd�Zdd�ZdS)�
_Immutablez3Mixin to indicate that object should not be copied.cCs|Sr�rZ�r�rZrZr[�__copy__%sz_Immutable.__copy__cCs|Sr�rZ)r�ZmemorZrZr[�__deepcopy__(sz_Immutable.__deepcopy__N)rbr^r_r�r�r�rZrZrZr[r�"sr�cspeZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
edd��Z�ZS)rUzhInternal indicator of special typing constructs.
    See _doc instance attribute for specific docs.
    ��_nameZ_doccsBt|�dkr6t|dt�r6t|dt�r6td|����t��|�S)z�Constructor.

        This only exists to give a better error message in case
        someone tries to subclass a special typing object (not a good idea).
        �rr~zCannot subclass )rzrPrQrprT�super�__new__)r{r�r���	__class__rZr[r�3s��z_SpecialForm.__new__cCs||_||_dSr�r�)r��name�docrZrZr[�__init__@sz_SpecialForm.__init__cCst|t�stS|j|jkSr�)rPrU�NotImplementedr��r��otherrZrZr[�__eq__Ds
z_SpecialForm.__eq__cCst|jf�Sr�)�hashr�r�rZrZr[�__hash__Isz_SpecialForm.__hash__cCs
d|jS)N�typing.�r�r�rZrZr[�__repr__Lsz_SpecialForm.__repr__cCs|jSr�r�r�rZrZr[�
__reduce__Osz_SpecialForm.__reduce__cOstd|����dS)NzCannot instantiate r�r�rZrZr[�__call__Rsz_SpecialForm.__call__cCst|�d���dS)Nz! cannot be used with isinstance()r��r�rdrZrZr[�__instancecheck__Usz_SpecialForm.__instancecheck__cCst|�d���dS)Nz! cannot be used with issubclass()r��r�r{rZrZr[�__subclasscheck__Xsz_SpecialForm.__subclasscheck__cs�|jdkr(t||j�d��}t||f�S|jdkr�|dkrBtd��t|t�sR|f}d�t�fdd�|D��}t|�}t|�d	kr�|d
St||�S|jdkr�t|d�}t|t	d�fS|jd
kr�t||�St|�d���dS)N)r	r
z accepts only single type.rrZz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3s|]}t|��VqdSr��r\�rgr��rXrZr[r�fsz+_SpecialForm.__getitem__.<locals>.<genexpr>r~rrz#Optional[t] requires a single type.r
z is not subscriptable)
r�r\rRrTrPrpr�rzrrO)r�r|�itemrWrZr�r[�__getitem__[s(







z_SpecialForm.__getitem__)rbr^r_r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rZrZr�r[rU,s
rU)r�a`Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    )r�aSpecial type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    a3Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    a'Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    zEOptional type.

    Optional[X] is equivalent to Union[X, None].
    a�Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

   Literal[...] cannot be subclassed. At runtime, an arbitrary value
   is allowed as type argument to Literal[...], but type checkers may
   impose restrictions.
    c@s>eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rz-Internal wrapper to hold a forward reference.)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__TcCsnt|t�std|����zt|dd�}Wn"tk
rJtd|����YnX||_||_d|_d|_||_	dS)Nz*Forward reference must be a string -- got z<string>�evalz/Forward reference must be an expression -- got F)
rPrQrT�compile�SyntaxErrorr�r�r�r�r�)r�rWrY�coderZrZr[r��s
zForwardRef.__init__cCsj|jr||k	rd|dkr(|dkr(i}}n|dkr6|}n|dkrB|}tt|j||�d|jd�|_d|_|jS)Nz*Forward references must evaluate to types.�rYT)r�r\r�r�r�r�)r�r�r�rZrZr[r��s
�zForwardRef._evaluatecCs>t|t�stS|jr2|jr2|j|jko0|j|jkS|j|jkSr�)rPrr�r�r�r�r�rZrZr[r�s

�zForwardRef.__eq__cCs
t|j�Sr�)r�r�r�rZrZr[r�szForwardRef.__hash__cCsd|j�d�S)NzForwardRef(�))r�r�rZrZr[r�szForwardRef.__repr__N)T)
rbr^r_r�r�r�r�r�r�r�rZrZrZr[r�s

c@s6eZdZdZdZdddd�dd�Zdd	�Zd
d�ZdS)ra�Type variable.

    Usage::

      T = TypeVar('T')  # Can be anything
      A = TypeVar('A', str, bytes)  # Must be str or bytes

    Type variables exist primarily for the benefit of static type
    checkers.  They serve as the parameters for generic types as well
    as for generic function definitions.  See class Generic for more
    information on generic types.  Generic functions work as follows:

      def repeat(x: T, n: int) -> List[T]:
          '''Return a list containing n references to x.'''
          return [x]*n

      def longest(x: A, y: A) -> A:
          '''Return the longest of two strings.'''
          return x if len(x) >= len(y) else y

    The latter example's signature is essentially the overloading
    of (str, str) -> str and (bytes, bytes) -> bytes.  Also note
    that if the arguments are instances of some subclass of str,
    the return type is still plain str.

    At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.

    Type variables defined with covariant=True or contravariant=True
    can be used to declare covariant or contravariant generic types.
    See PEP 484 for more details. By default generic types are invariant
    in all type variables.

    Type variables can be introspected. e.g.:

      T.__name__ == 'T'
      T.__constraints__ == ()
      T.__covariant__ == False
      T.__contravariant__ = False
      A.__constraints__ == (str, bytes)

    Note that only type variables defined in global scope can be pickled.
    )rb�	__bound__�__constraints__�
__covariant__�__contravariant__NF)�bound�	covariant�
contravariantc	s�||_|r|rtd��t|�|_t|�|_|r>|dk	r>td��|rVt|�dkrVtd��d�t�fdd�|D��|_|r�t	|d�|_
nd|_
zt�d�j
�d	d
�}Wnttfk
r�d}YnX|dkr�||_dS)Nz"Bivariant types are not supported.z-Constraints cannot be combined with bound=...r~z"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|��VqdSr�r�rfr�rZr[r�Vsz#TypeVar.__init__.<locals>.<genexpr>zBound must be a type.rb�__main__�typing)rb�
ValueError�boolr�r�rTrzrpr�r\r��sys�	_getframe�	f_globals�get�AttributeErrorr^)r�r�r�r�r�ZconstraintsZdef_modrZr�r[r�Js(


zTypeVar.__init__cCs&|jrd}n|jrd}nd}||jS)N�+�-�~)r�r�rb)r��prefixrZrZr[r�bszTypeVar.__repr__cCs|jSr�)rbr�rZrZr[r�kszTypeVar.__reduce__)rbr^r_r�r�r�r�r�rZrZrZr[rs+�	)	rrrp�dictr�	frozenset�deque�defaultdictrOr;cCs|�d�o|�d�S)N�__)�
startswith�endswith)�attrrZrZr[�
_is_dunder�sr�cs�eZdZdZdddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Zdd�Z�ZS) rRa�The central part of internal API.

    This represents a generic version of type 'origin' with type arguments 'params'.
    There are two kind of these aliases: user defined and special. The special ones
    are wrappers around builtin collections and ABCs in collections.abc. These must
    have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
    this is used by e.g. typing.List and typing.Dict.
    TFN)�inst�specialr�cCsz||_||_|r*|dkr*|j}t�||�}||_t|t�s@|f}||_tdd�|D��|_	t
|�|_d|_|sv|j
|_
dS)Ncss*|]"}|tkrdn|tkrdn|VqdS).rZN)�_TypingEllipsis�_TypingEmptyr�rZrZr[r��s�z)_GenericAlias.__init__.<locals>.<genexpr>)�_instrmrb�_normalize_aliasr�r�rPrprSrsrqror�r^)r��originr�r�r�r�Z	orig_namerZrZr[r��s 
�

z_GenericAlias.__init__cs^|jttfkrtd|����t|t�s,|f}d�t�fdd�|D��}t||�t||j|�S)Nz%Cannot subscript already-subscripted �*Parameters to generic types must be types.c3s|]}t|��VqdSr�r�r�r�rZr[r��sz,_GenericAlias.__getitem__.<locals>.<genexpr>)	rSrrrTrPrpr}ruro�r�r�rZr�r[r��s

z_GenericAlias.__getitem__cCst|j||j|jd�S)N)r�r�)rRrSr�r�r�rZrZr[rv�sz_GenericAlias.copy_withcCs�|jdks&t|j�dkrx|jdtkrx|jr8d|j}n
t|j�}|jshdd�dd�|jD���d	�}nd
}|�|��S|jr�dSdd�d
d�|jdd�D���dt|jd��d	�S)Nr�rr��[�, cSsg|]}t|��qSrZ�rer�rZrZr[rk�sz*_GenericAlias.__repr__.<locals>.<listcomp>�]�ztyping.Callableztyping.Callable[[cSsg|]}t|��qSrZr�r�rZrZr[rk�s���z], )r�rzrs�EllipsisrerSrm�join)r�r�r�rZrZr[r��s
��
 z_GenericAlias.__repr__cCsRt|t�stS|j|jkrdS|jtkrF|jtkrFt|j�t|j�kS|j|jkS)NF)rPrRr�rSrr�rsr�rZrZr[r��s
z_GenericAlias.__eq__cCs,|jtkrttt|j�f�St|j|jf�Sr�)rSrr�r�rsr�rZrZr[r��s
z_GenericAlias.__hash__cOsT|js$td|j�d|j���d���|j||�}z
||_Wntk
rNYnX|S)N�Type z cannot be instantiated; use z
() instead)r�rTr��lowerrS�__orig_class__r�)r�r��kwargs�resultrZrZr[r��s
z_GenericAlias.__call__cCs�|jrZg}|j|kr |�|j�|�|�}tdd�||dd�D��sR|�t�t|�S|jtkr�t|krpdS|�|�}||dd�D]}t|t	�r�||k	r�dSq�|jfS)Ncss"|]}t|t�pt|t�VqdSr�)rPrR�
issubclassr�rg�brZrZr[r��s�z0_GenericAlias.__mro_entries__.<locals>.<genexpr>r~rZ)
r�rSrl�index�anyrrprrPrR)r��basesr�ryrrZrZr[�__mro_entries__�s$

�


z_GenericAlias.__mro_entries__cCs*d|jkrt|�st|j|�St|��dS)NrS)�__dict__r��getattrrSr�)r�r�rZrZr[�__getattr__�sz_GenericAlias.__getattr__cs2t|�s|dkr t��||�nt|j||�dS)N)r�r�rm)r�r��__setattr__�setattrrS)r�r��valr�rZr[r�sz_GenericAlias.__setattr__cCs|�t|��Sr�)r�rOr�rZrZr[r�sz_GenericAlias.__instancecheck__cCs<|jr0t|t�st||j�S|jr0t|j|j�Std��dS)NzBSubscripted generics cannot be used with class and instance checks)rmrPrRrrSrTr�rZrZr[r�s
z_GenericAlias.__subclasscheck__cCs�|jr|jS|jr t�|j}n|j}|tkrht|j�dkrJ|jdtksht|jdd��|jdf}n*t	|j�}t|�dkr�t
|dt	�s�|\}tj||ffS)Nr�rr�r~)
rmr��globalsrSrrzrsr�rrrprP�operator�getitem)r�r�r�rZrZr[r�s��
z_GenericAlias.__reduce__)rbr^r_r�r�r�r�rvr�r�r�r�rrrr�r�r�r�rZrZr�r[rR�s
		rRcs,eZdZdZdd�Ze�fdd��Z�ZS)�_VariadicGenericAliasz�Same as _GenericAlias above but for variadic aliases. Currently,
    this is used only by special internal aliases: Tuple and Callable.
    cCs�|jdks|js|�|�St|t�r0t|�dkr8td��|\}}|tkrRt|f}n$t|t�sjtd|����t|�|f}|�|�S)Nrr�z6Callable must be used as Callable[[arg, ...], result].z1Callable[args, result]: args must be a list. Got )	r�rm�__getitem_inner__rPrprzrTr�rr)r�r�r�rrZrZr[r�"s


z!_VariadicGenericAlias.__getitem__cs
|jtkr�|jr�|dkr$|�tf�St|t�s4|f}t|�dkrl|ddkrld�t|d��}|�|tf�Sd�t�fdd	�|D��}|�|�S|jt	j
jkr�|jr�|\}}d
�t|��}|tkr�|�t|f�Sd�t�fdd	�|D��}||f}|�|�St
��|�S)
NrZr�r~.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|��VqdSr�r�r�r�rZr[r�>sz:_VariadicGenericAlias.__getitem_inner__.<locals>.<genexpr>z.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|��VqdSr�r�)rgrWr�rZr[r�Gs)rSrprmrvr�rPrzr\r��collections�abcrr�r�r�)r�r�r�r�rr�r�r[r2s.




z'_VariadicGenericAlias.__getitem_inner__)rbr^r_r�r�r�rr�rZrZr�r[rsrcs@eZdZdZdZdZ�fdd�Zedd��Z�fdd	�Z	�Z
S)
raCAbstract base class for generic types.

    A generic type is typically declared by inheriting from
    this class parameterized with one or more type variables.
    For example, a generic mapping type might be defined as::

      class Mapping(Generic[KT, VT]):
          def __getitem__(self, key: KT) -> VT:
              ...
          # Etc.

    This class can then be used as follows::

      def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
          try:
              return mapping[key]
          except KeyError:
              return default
    rZFcs^|ttfkrtd|j�d���t�jtjkrF|jtjk	rFt��|�}nt�j|f|�|�}|S)Nrz< cannot be instantiated; it can be used only as a base class)rrrTrbr�r��objectr�)r{r�r�rdr�rZr[r�dszGeneric.__new__cs�t|t�s|f}|s.|tk	r.td|j�d���d�t�fdd�|D��}|ttfkr�tdd�|D��sxtd|j�d���t	t
|��t	|�kr�td|j�d	���n
t||�t||�S)
NzParameter list to z[...] cannot be emptyr�c3s|]}t|��VqdSr�r�r�r�rZr[r�vsz,Generic.__class_getitem__.<locals>.<genexpr>css|]}t|t�VqdSr�)rPrr�rZrZr[r�yszParameters to z [...] must all be type variablesz[...] must all be unique)
rPrprrTr_rr�allrbrzrr}rR)r{r�rZr�r[�__class_getitem__ns&
���
zGeneric.__class_getitem__c
s
t�j||�g}d|jkr(t|jk}nt|jko:|jdk}|rHtd��d|jkr�t|j�}d}|jD].}t	|t
�rf|jtkrf|dk	r�td��|j}qf|dk	r�t
|�}t
|��|�ks�d��fdd�|D��}d�dd�|D��}	td	|�d
|	�d���|}t|�|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.r�c3s|]}|�krt|�VqdSr��rQrf�ZgvarsetrZr[r��sz,Generic.__init_subclass__.<locals>.<genexpr>css|]}t|�VqdSr�r)rg�grZrZr[r��szSome type variables (z) are not listed in Generic[r�)r�r�rrr�	__bases__rbrTrqrPrRrSrorr�rp)
r{r�rrj�errorZgvars�baseZtvarsetZs_varsZs_argsr�rr[r��s8




��zGeneric.__init_subclass__)rbr^r_r�r��_is_protocolr�r�rr�r�rZrZr�r[rMs

c@seZdZdZdS)r�z�Internal placeholder for () or []. Used by TupleMeta and CallableMeta
    to allow empty list/tuple in specific places, without allowing them
    to sneak in where prohibited.
    N�rbr^r_r�rZrZrZr[r��sr�c@seZdZdZdS)r�z(Internal placeholder for ... (ellipsis).Nr$rZrZrZr[r��sr�rorrr#�_is_runtime_protocol�__abstractmethods__�__annotations__rr�r�r^r�r��__subclasshook__r��_MutableMapping__markercCsrt�}|jdd�D]X}|jdkr$qt|di�}t|j���t|���D] }|�d�sJ|tkrJ|�	|�qJq|S)z�Collect protocol members from a protocol class objects.

    This includes names actually defined in the class dictionary, as well
    as names that appear in annotations. Special names (above) are skipped.
    Nr�)rrr'Z_abc_)
r�__mro__rbr
rrr�keysr��EXCLUDED_ATTRIBUTES�add)r{�attrsr"�annotationsr�rZrZr[�_get_protocol_attrs�s
r0cst�fdd�t��D��S)Nc3s|]}tt�|d��VqdSr�)rVr
�rgr��r{rZr[r��sz,_is_callable_members_only.<locals>.<genexpr>)rr0r2rZr2r[�_is_callable_members_only�sr3cOst|�jrtd��dS)Nz Protocols cannot be instantiated)rOr#rT)r�r�rrZrZr[�_no_init�s
r4c	Cs6zt�d�jddkWSttfk
r0YdSXdS)z�Allow instnance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    r�rb)rr�TN)r�r�r�r�r�rZrZrZr[�_allow_reckless_class_cheks�sr5�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibcseZdZ�fdd�Z�ZS)�
_ProtocolMetacsVt�dd�rt��r$t�j��r$dS�jrJt��fdd�t��D��rJdSt����S)Nr#FTc3s8|]0}t�|�o.tt�|d��p.t�|�dk	VqdSr�)�hasattrrVr
r1�r{�instancerZr[r��s�
z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)	r
r3rr�r#rr0r�r�r;r�r;r[r��s�
��z_ProtocolMeta.__instancecheck__)rbr^r_r�r�rZrZr�r[r9�sr9cs,eZdZdZdZdZdZ�fdd�Z�ZS)raZBase class for protocol classes.

    Protocol classes are defined as::

        class Proto(Protocol):
            def meth(self) -> int:
                ...

    Such classes are primarily used with static type checkers that recognize
    structural subtyping (static duck-typing), for example::

        class C:
            def meth(self) -> int:
                return 0

        def func(x: Proto) -> int:
            return x.meth()

        func(C())  # Passes static type check

    See PEP 544 for details. Protocol classes decorated with
    @typing.runtime_checkable act as simple-minded runtime protocols that check
    only the presence of given attributes, ignoring their type signatures.
    Protocol classes can be generic, they are defined as::

        class GenProto(Protocol[T]):
            def meth(self) -> T:
                ...
    rZTFcs�t�j||��j�dd�s2tdd��jD���_�fdd�}d�jkrN|�_�jsXdS�jD]F}|tt	fks^|j
tkr�|jt|j
ks^t
|t	�r�|js^td|��q^t�_dS)	Nr#Fcss|]}|tkVqdSr�)rrrZrZr[r�)sz-Protocol.__init_subclass__.<locals>.<genexpr>cs��j�dd�stSt�dd�s0t�r(tStd��t��sJt�rBtStd��t|t�s\td��t	��D]v}|j
D]b}||jkr�|j|dkr�tSqdt|di�}t|tjj
�rn||krnt|t�rn|jrnqdqntSqddS)	Nr#Fr%zLInstance and class checks can only be used with @runtime_checkable protocolsz<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr'T)rr�r�r
r5rTr3rPrOr0r*rrrrrr#)r�r�r"r/r2rZr[�_proto_hook,s:


���
z/Protocol.__init_subclass__.<locals>._proto_hookr(z7Protocols can only inherit from other protocols, got %r)r�r�rr�r	r r#r(rrr^�_PROTO_WHITELISTrbrrTr4r�)r{r�rr=r"r�r2r[r�$s,&

�����zProtocol.__init_subclass__)	rbr^r_r�r�r#r%r�r�rZrZr�r[rs
)�	metaclasscCs&t|t�r|jstd|��d|_|S)a9Mark a protocol class as a runtime protocol.

    Such protocol can be used with isinstance() and issubclass().
    Raise TypeError if applied to a non-protocol class.
    This allows a simple-minded structural check very similar to
    one trick ponies in collections.abc such as Iterable.
    For example::

        @runtime_checkable
        class Closable(Protocol):
            def close(self): ...

        assert isinstance(open('/some/file'), Closable)

    Warning: this will check only the presence of the required methods,
    not their type signatures!
    zB@runtime_checkable can be only applied to protocol classes, got %rT)rrr#rTr%r2rZrZr[rKds�cCs|S)z�Cast a value to a type.

    This returns the value unchanged.  To the type checker this
    signals that the return value has the designated type, but at
    runtime we intentionally don't check anything (we want this
    to be as fast as possible).
    rZ)�typrrZrZr[rA}sc
Cs�z
|j}Wntk
r"iYSX|j}|j}|d|�}|jpDd}|j}|rXt|�ni}|t|�}t||d�|�D]\}}	|	||<qz|S)z:Internal helper to extract the default arguments, by name.NrZ)	�__code__r��co_argcount�co_varnames�__defaults__�__kwdefaults__r�rz�zip)
r�r�Z	pos_countZ	arg_names�defaultsZ
kwdefaultsr�Z
pos_offsetr��valuerZrZr[�
_get_defaults�s



rIcCs�t|dd�riSt|t�r�i}t|j�D]z}|dkrDtj|jj}n|}|j�	di�}|�
�D]B\}}|dkrvtd�}t|t�r�t|dd�}t
|||�}|||<q^q(|S|dkr�t|tj�r�|j}n"|}	t|	d�r�|	j}	q�t|	di�}|dkr�|}n|dk�r|}t|dd�}|dk�r6t|t��r(iStd�|���t|�}
t|�}|�
�D]d\}}|dk�rhtd�}t|t��r|t|�}t
|||�}||
k�r�|
|dk�r�t|}|||<�qN|S)	a�Return type hints for an object.

    This is often the same as obj.__annotations__, but it handles
    forward references encoded as string literals, and if necessary
    adds Optional[t] if a default value equal to None is set.

    The argument may be a module, class, method, or function. The annotations
    are returned as a dictionary. For classes, annotations include also
    inherited members.

    TypeError is raised if the argument is not of a type that can contain
    annotations, and an empty dictionary is returned if no annotations are
    present.

    BEWARE -- the behavior of globalns and localns is counterintuitive
    (unless you are familiar with how eval() and exec() work).  The
    search order is locals first, then globals.

    - If no dict arguments are passed, an attempt is made to use the
      globals from obj (or the respective module's globals for classes),
      and these are also used as the locals.  If the object does not appear
      to have globals, an empty dictionary is used.

    - If one dict argument is passed, it is used for both globals and
      locals.

    - If two dict arguments are passed, they specify globals and
      locals, respectively.
    �__no_type_check__Nr'Fr��__wrapped__�__globals__z1{!r} is not a module, class, method, or function.)r
rPrO�reversedr*r��modulesr^rr��itemsrQrr�r`�
ModuleTyper:rK�_allowed_typesrT�formatrIr�r)rdr�r�Zhintsr"Zbase_globals�annr�rHZnsobjrGrZrZr[rE�s^




�
cCs t|t�r|jS|tkrtSdS)a�Get the unsubscripted version of a type.

    This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar.
    Return None for unsupported types. Examples::

        get_origin(Literal[42]) is Literal
        get_origin(int) is None
        get_origin(ClassVar[int]) is ClassVar
        get_origin(Generic) is Generic
        get_origin(Generic[T]) is Generic
        get_origin(Union[T, int]) is Union
        get_origin(List[Tuple[T, T]][int]) == list
    N)rPrRrSr)rwrZrZr[rD�s

cCsRt|t�rN|jsN|j}t|�tjjkrJ|dtk	rJt	|dd��|df}|SdS)a�Get type arguments with all substitutions performed.

    For unions, basic simplifications used by Union constructor are performed.
    Examples::
        get_args(Dict[str, int]) == (str, int)
        get_args(int) == ()
        get_args(Union[int, Union[T, int], str][int]) == (int, str)
        get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
        get_args(Callable[[], T][int]) == ([], int)
    rNr�rZ)
rPrRrmrsrDrrrr�rr)rwr�rZrZr[rCscCs�t|t�rt|j��}|j��D]"\}}||j|fkr|�|�q|��D](}t|tj	�r`d|_
t|t�rJt|�qJz
d|_
Wntk
r�YnX|S)aIDecorator to indicate that annotations are not type hints.

    The argument must be a class or function; if it is a class, it
    applies recursively to all methods and classes defined in that class
    (but not to methods defined in its superclasses or subclasses).

    This mutates the function(s) or class(es) in place.
    T)
rPrOr�copyrOr �pop�valuesr`rarJrGrT)rWZ	arg_attrsr�rrdrZrZr[rGs	




cst����fdd��}|S)z�Decorator to give another decorator the @no_type_check effect.

    This wraps the decorator with something that wraps the decorated
    function in @no_type_check.
    cs�||�}t|�}|Sr�)rG)r�r�r���	decoratorrZr[�wrapped_decorator@s
z2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)rXrYrZrWr[rH9scOstd��dS)z*Helper for @overload to raise when called.z�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.N)�NotImplementedErrorr�rZrZr[�_overload_dummyIs�r[cCstS)a
Decorator for overloaded functions/methods.

    In a stub file, place two or more stub definitions for the same
    function in a row, each decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...

    In a non-stub file (i.e. a regular .py file), do the same but
    follow it with an implementation.  The implementation should *not*
    be decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...
      def utf8(value):
          # implementation goes here
    )r[)r�rZrZr[rJRscCs|S)aVA decorator to indicate final methods and final classes.

    Use this decorator to indicate to type checkers that the decorated
    method cannot be overridden, and decorated class cannot be subclassed.
    For example:

      class Base:
          @final
          def done(self) -> None:
              ...
      class Sub(Base):
          def done(self) -> None:  # Error reported by type checker
                ...

      @final
      class Leaf:
          ...
      class Other(Leaf):  # Error reported by type checker
          ...

    There is no runtime checking of these properties.
    rZ)�frZrZr[rBos�T�KT�VT�T_co)r��V_co�VT_co�T_contra)r��CT_co)r�r�cCst||d|d�S)NT)r�r�)rR)r�r�r�rZrZr[�_alias�srerZ)r�a�Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    F)r�r�a@Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    )r�a�A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c@s&eZdZdZdZeed�dd��ZdS)r2z(An ABC with one abstract method __int__.rZ��returncCsdSr�rZr�rZrZr[�__int__�szSupportsInt.__int__N)rbr^r_r�r�r�intrhrZrZrZr[r2�sc@s&eZdZdZdZeed�dd��ZdS)r0z*An ABC with one abstract method __float__.rZrfcCsdSr�rZr�rZrZr[�	__float__szSupportsFloat.__float__N)rbr^r_r�r�r�floatrjrZrZrZr[r0�sc@s&eZdZdZdZeed�dd��ZdS)r/z,An ABC with one abstract method __complex__.rZrfcCsdSr�rZr�rZrZr[�__complex__
szSupportsComplex.__complex__N)rbr^r_r�r�r�complexrlrZrZrZr[r/sc@s&eZdZdZdZeed�dd��ZdS)r.z*An ABC with one abstract method __bytes__.rZrfcCsdSr�rZr�rZrZr[�	__bytes__szSupportsBytes.__bytes__N)rbr^r_r�r�r�bytesrnrZrZrZr[r.sc@s&eZdZdZdZeed�dd��ZdS)r1z*An ABC with one abstract method __index__.rZrfcCsdSr�rZr�rZrZr[�	__index__szSupportsIndex.__index__N)rbr^r_r�r�rrirprZrZrZr[r1sc@s&eZdZdZdZeed�dd��ZdS)r-zMAn ABC with one abstract method __abs__ that is covariant in its return type.rZrfcCsdSr�rZr�rZrZr[�__abs__(szSupportsAbs.__abs__N)rbr^r_r�r�rr`rqrZrZrZr[r-#sc@s*eZdZdZdZedeed�dd��ZdS)	r3zOAn ABC with one abstract method __round__ that is covariant in its return type.rZr)�ndigitsrgcCsdSr�rZ)r�rrrZrZr[�	__round__2szSupportsRound.__round__N)r)	rbr^r_r�r�rrir`rsrZrZrZr[r3-sc	std��fdd�|D�}t�|dd�|D��}t|�|_|_zt�d�j�dd�|_	Wnt
tfk
rnYnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecsg|]\}}|t|��f�qSrZr��rg�nrhr�rZr[rk9sz!_make_nmtuple.<locals>.<listcomp>cSsg|]\}}|�qSrZrZrtrZrZr[rk:sr�rbr�)r�
namedtupler�r'�_field_typesr�r�r�r�r^r�r�)r�r`�nm_tplrZr�r[�
_make_nmtuple7sry)r�r�r��__getnewargs__�_fields�_field_defaultsrw�_make�_replace�_asdictZ_source)r^rbr'cseZdZ�fdd�Z�ZS)�NamedTupleMetacs�|�dd�rt��||||�S|�di�}t||���}g}i}|D]H}||krl||}	|�|	�|	||<qD|rDtdj|d�|�	��d���qDt
|�|j_t|�|j_
||_|D]<}
|
tkr�td|
��q�|
tkr�|
|jkr�t||
||
�q�|S)Nr�Fr'zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}r�)�
field_nameZ
default_namesz&Cannot overwrite NamedTuple attribute )r�r�r�ryrOrlrTrRr�r+r�r'rprDr|�_prohibitedr�rmr{r)r{�typenamer
�nsr`rxrGZ
defaults_dictr�Z
default_value�keyr�rZr[r�Os2

�
zNamedTupleMeta.__new__)rbr^r_r�r�rZrZr�r[r�Msr�c@s"eZdZdZdZdd�Zde_dS)r=a�Typed version of namedtuple.

    Usage in Python versions >= 3.6::

        class Employee(NamedTuple):
            name: str
            id: int

    This is equivalent to::

        Employee = collections.namedtuple('Employee', ['name', 'id'])

    The resulting class has an extra __annotations__ attribute, giving a
    dict that maps field names to types.  (The field names are also in
    the _fields attribute, which is part of the namedtuple API.)
    Alternative equivalent keyword syntax is also accepted::

        Employee = NamedTuple('Employee', name=str, id=int)

    In Python versions <= 3.5 use::

        Employee = NamedTuple('Employee', [('name', str), ('id', int)])
    TcOs�|std��|^}}|r"|^}}n4d|krN|�d�}ddl}|jdtdd�ntd��|r�z
|\}Wq�tk
r�tdt|�d�d	��d�Yq�Xn<d
|kr�t|�dkr�|�d
�}ddl}|jdtdd�nd}|dkr�|��}n|r�td
��t||�S)Nz*NamedTuple.__new__(): not enough argumentsr�rz4Passing 'typename' as keyword argument is deprecatedr�)�
stacklevelzGNamedTuple.__new__() missing 1 required positional argument: 'typename'z@NamedTuple.__new__() takes from 2 to 3 positional arguments but z were given�fieldsr~z2Passing 'fields' as keyword argument is deprecatedzIEither list of fields or keywords can be provided to NamedTuple, not both)	rTrU�warnings�warn�DeprecationWarningr�rzrOry)r�rr{r�r�r�rZrZr[r��sB

�
�

�
zNamedTuple.__new__z*($cls, typename, fields=None, /, **kwargs)N)rbr^r_r�r�r��__text_signature__rZrZrZr[r=ls#cOs
t||�Sr�)r�)r{r�rrZrZr[�	_dict_new�sr�)�totalc	Ksj|dkr|}n|rtd��t|�|d�}zt�d�j�dd�|d<Wnttfk
r\YnXt|d|�S)Nz@TypedDict takes either a dict or keyword arguments, but not both)r'�	__total__r~rbr�r^rZ)	rTr�r�r�r�r�r�r��_TypedDictMeta)r{r�r�r�rr�rZrZr[�_typeddict_new�sr�cCstd��dS)Nz4TypedDict does not support instance and class checksr�)r{r�rZrZr[�_check_fails�sr�cs&eZdZd�fdd�	ZeZZ�ZS)r�Tcs�|dkrtnt|d<tt|��||tf|�}|�di�}d��fdd�|��D�}|D]}|�|j	�di��qV||_
t|d�s�||_|S)agCreate new typed dict class object.

        This method is called directly when TypedDict is subclassed,
        or via _typeddict_new when TypedDict is instantiated. This way
        TypedDict supports all three syntax forms described in its docstring.
        Subclasses and instances of TypedDict return actual dictionaries
        via _dict_new.
        r>r�r'z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecsi|]\}}|t|���qSrZr�)rgrurwr�rZr[�
<dictcomp>�sz*_TypedDictMeta.__new__.<locals>.<dictcomp>r�)
r�r�r�r�r�r�r�rO�updaterr'r:r�)r{r�r
r�r�Ztp_dictZannsr"r�r�r[r��s	
z_TypedDictMeta.__new__)T)rbr^r_r�r�r�r�r�rZrZr�r[r��sr�c@seZdZdZdS)r>a�A simple typed namespace. At runtime it is equivalent to a plain dict.

    TypedDict creates a dictionary type that expects all of its
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime but is only enforced by type checkers.
    Usage::

        class Point2D(TypedDict):
            x: int
            y: int
            label: str

        a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check

        assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')

    The type info can be accessed via Point2D.__annotations__. TypedDict
    supports two additional equivalent forms::

        Point2D = TypedDict('Point2D', x=int, y=int, label=str)
        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality.
    Usage::

        class point2D(TypedDict, total=False):
            x: int
            y: int

    This means that a point2D TypedDict can have any of the keys omitted.A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.

    The class syntax is only supported in Python 3.6+, while two other
    syntax forms work for Python 2.7 and 3.2+
    Nr$rZrZrZr[r>�scCsdd�}||_||_|S)a%NewType creates simple unique types with almost zero
    runtime overhead. NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy function that simply returns its argument. Usage::

        UserId = NewType('UserId', int)

        def name_by_id(user_id: UserId) -> str:
            ...

        UserId('user')          # Fails type check

        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK

        num = UserId(5) + 1     # type: int
    cSs|Sr�rZ)�xrZrZr[�new_typeszNewType.<locals>.new_type)rbZ
__supertype__)r�rwr�rZrZr[rFsc@s�eZdZdZdZeeed�dd���Zeeed�dd���Z	edd�d	d
��Z
eeed�dd���Zee
d�d
d��Zedd�dd��Zeed�dd��Zed7e
ed�dd��Zeed�dd��Zed8e
ed�dd��Zed9e
eed�dd��Zed:e
e
e
d �d!d"��Zeed�d#d$��Zee
d�d%d&��Zed;e
e
d'�d(d)��Zeed�d*d+��Zeee
d,�d-d.��Zeeedd/�d0d1��Zed2d�d3d4��Zedd�d5d6��ZdS)<�IOa�Generic base class for TextIO and BinaryIO.

    This is an abstract, generic version of the return of open().

    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    rZrfcCsdSr�rZr�rZrZr[�mode=szIO.modecCsdSr�rZr�rZrZr[r�BszIO.nameNcCsdSr�rZr�rZrZr[�closeGszIO.closecCsdSr�rZr�rZrZr[�closedKsz	IO.closedcCsdSr�rZr�rZrZr[�filenoPsz	IO.filenocCsdSr�rZr�rZrZr[�flushTszIO.flushcCsdSr�rZr�rZrZr[�isattyXsz	IO.isattyr�)rurgcCsdSr�rZ)r�rurZrZr[�read\szIO.readcCsdSr�rZr�rZrZr[�readable`szIO.readable)�limitrgcCsdSr�rZ)r�r�rZrZr[�readlinedszIO.readline)�hintrgcCsdSr�rZ)r�r�rZrZr[�	readlineshszIO.readlinesr)�offset�whencergcCsdSr�rZ)r�r�r�rZrZr[�seeklszIO.seekcCsdSr�rZr�rZrZr[�seekablepszIO.seekablecCsdSr�rZr�rZrZr[�telltszIO.tell)�sizergcCsdSr�rZ)r�r�rZrZr[�truncatexszIO.truncatecCsdSr�rZr�rZrZr[�writable|szIO.writable��srgcCsdSr�rZ�r�r�rZrZr[�write�szIO.write)�linesrgcCsdSr�rZ)r�r�rZrZr[�
writelines�sz
IO.writelinesz
IO[AnyStr]cCsdSr�rZr�rZrZr[�	__enter__�szIO.__enter__cCsdSr�rZ)r�rOrH�	tracebackrZrZr[�__exit__�szIO.__exit__)r�)r�)r�)r)N) rbr^r_r�r��propertyrrQr�r�r�r�r�rir�r�r�r@r�r�r�r9r�r�r�r�r�r�r�r�r�r�rZrZrZr[r�.sZr�c@sBeZdZdZdZeeeefe	d�dd��Z
edd�dd��Zd	S)
�BinaryIOz5Typed version of the return of open() in binary mode.rZr�cCsdSr�rZr�rZrZr[r��szBinaryIO.writerfcCsdSr�rZr�rZrZr[r��szBinaryIO.__enter__N)rbr^r_r�r�rrro�	bytearrayrir�r�rZrZrZr[r��sr�c@s�eZdZdZdZeeed�dd���Zeee	d�dd���Z
eeee	d�dd	���Zeee
d�d
d���Zeeed�dd
���Zedd�dd��ZdS)�TextIOz3Typed version of the return of open() in text mode.rZrfcCsdSr�rZr�rZrZr[�buffer�sz
TextIO.buffercCsdSr�rZr�rZrZr[�encoding�szTextIO.encodingcCsdSr�rZr�rZrZr[�errors�sz
TextIO.errorscCsdSr�rZr�rZrZr[�line_buffering�szTextIO.line_bufferingcCsdSr�rZr�rZrZr[�newlines�szTextIO.newlinescCsdSr�rZr�rZrZr[r��szTextIO.__enter__N)rbr^r_r�r�r�rr�r�rQr�rr�r�r�rr�r�rZrZrZr[r��s&r�c@s&eZdZdZdddgZeZeZeZdS)�ioz)Wrapper namespace for IO generic classes.r�r�r�N)rbr^r_r��__all__r�r�r�rZrZrZr[r��s

r�z.ioc@s eZdZdZddgZeZeZdS)�rez&Wrapper namespace for re type aliases.�Pattern�MatchN)rbr^r_r�r�r�r�rZrZrZr[r��sr�z.re)T)NN)T)N)�r�rrrrZcollections.abcr8r�rr�Z	stdlib_rer�r`rrrr�r\rerqrur}r�r�r�r�r�r�rUrrIr	r
rrr
rrr�r�rRrrr�r�Z_TYPING_INTERNALSZ_SPECIAL_NAMESr,r0r3r4r5r>r9rrKrArIra�BuiltinFunctionType�
MethodTyperPrQrErDrCrGrHr[rJrBr]r^r_r`rarbrcrOrdrorQr@rerr%r(r'r&rrr,r#rr)rr;rr!rrr"r rrprrrr9r�r6rr�r<rrrr$r6rr7r+r�r7r�r8r:r5r4r?r*rr2r0r/r.r1r-r3ryr�rmr�r=r�r�r�r�r>rFrLrMr�r�r�r�rbrNr�r�rZrZrZr[�<module>s(�X
!
	
I��
�����2a�
/[����	b�
V	
�
�	�							@+c#	

nntplib.cpython-38.pyc000064400000102270151450073350010647 0ustar00U

e5d���@s�dZddlZddlZddlZddlZddlZddlZzddlZWnek
rXdZ	YnXdZ	ddl
mZddlm
Z
ddd	d
ddd
dgZdZGdd�de�ZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd
�d
e�ZdZdZddddddddd d!d"d#hZd$d%d&d'd(d)d*gZd)d*d+�Zd,Ze�d-d.d/d0d1g�Ze�d2d3d4d5g�Zd6d�Zd7d8�Z dmd9d:�Z!dnd;d<�Z"dod=d>�Z#e	�r�d?d@�Z$GdAdB�dB�Z%GdCd�de%�Z&e	�r�GdDdE�dEe%�Z'e�(dE�e)dFk�r�ddl*Z*e*j+dGdH�Z,e,j-dIdJdKdLdM�e,j-dNdOdPdQdM�e,j-dRdSdTe.dUeefdV�e,j-dWdXdYe.dZdV�e,j-d[d\d]dd^d_�e,�/�Z0e0j1Z1e0j�s�e1dTk�r|eZ1e&e0j2e1d`�Z3ne1dTk�r�eZ1e'e0j2e1d`�Z3e3�4�Z5dae5k�r�e3�6�e3�7e0j7�\Z8Z9Z:Z;Z<e=dbe<dce9dde:dee;�dfdg�Z>e?e.e;�e0j@dh�Z:e3�Ae:e;�\Z8ZBeBD]Z\ZCZDeeDd%��Edidh�dZFeeDd$�ZGe.eDd*�ZHe=dj�IeCe>eFdk�e>eGdl�eH���q e3�J�dS)pa�An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)

Example:

>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print('Group', name, 'has', count, 'articles, range', first, 'to', last)
Group comp.lang.python has 51 articles, range 5770 to 5821
>>> resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last))
>>> resp = s.quit()
>>>

Here 'resp' is the server response line.
Error responses are turned into exceptions.

To post an article from a file:
>>> f = open(filename, 'rb') # file containing article, including header
>>> resp = s.post(f)
>>>

For descriptions of all methods, read the comments in the code below.
Note that all arguments and return values representing article numbers
are strings, not numbers, since they are rarely used for calculations.
�NFT)�
decode_header)�_GLOBAL_DEFAULT_TIMEOUT�NNTP�	NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError�
NNTPDataErrorric@seZdZdZdd�ZdS)rz%Base class for all nntplib exceptionscGs>tj|f|��z|d|_Wntk
r8d|_YnXdS)NrzNo response given)�	Exception�__init__�response�
IndexError)�self�args�r�/usr/lib64/python3.8/nntplib.pyrcs
zNNTPError.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrrrasc@seZdZdZdS)rzUnexpected [123]xx replyN�rrrrrrrrrjsc@seZdZdZdS)rz
4xx errorsNrrrrrrnsc@seZdZdZdS)rz
5xx errorsNrrrrrrrsc@seZdZdZdS)r	z"Response does not begin with [1-5]Nrrrrrr	vsc@seZdZdZdS)r
zError in response dataNrrrrrr
zs�wi3Z100Z101�211�215Z220Z221Z222Z224Z225Z230Z231Z282�subject�from�datez
message-idZ
referencesz:bytesz:lines)�bytes�lines�
�	GroupInfo�group�last�first�flag�ArticleInfoZnumber�
message_idrcCsJg}t|�D]2\}}t|t�r4|�|�|p,d��q|�|�qd�|�S)zvTakes a unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value.�ascii�)�_email_decode_header�
isinstancer�append�decode�join)Z
header_str�parts�v�encrrrr�s
cCs�g}|D]`}|ddkr:|dd��d�\}}}d|}n|�d�\}}}|��}t�||�}|�|�qt}t|�t|�kr�td��|dt|��|kr�td��|S)z�Parse a list of string representing the response to LIST OVERVIEW.FMT
    and return a list of header/metadata names.
    Raises NNTPDataError if the response is not compliant
    (cf. RFC 3977, section 8.4).r�:�Nz$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)�	partition�lower�_OVERVIEW_FMT_ALTERNATIVES�getr,�_DEFAULT_OVERVIEW_FMT�lenr
)r�fmt�line�name�_�suffix�defaultsrrr�_parse_overview_fmt�s
r@cCs�tt�}g}|D]�}i}|�d�^}}t|�}t|�D]�\}	}
|	t|�krLq6||	}|�d�}|	|kr�|s�|d}
|
r�|
dt|
����|
kr�td��|
r�|
t|
�d�nd}
|
|||	<q6|�||f�q|S)zZParse the response to an OVER or XOVER command according to the
    overview format `fmt`.�	r2z: Nz?OVER/XOVER response doesn't include names of additional headers)	r9r8�split�int�	enumerate�
startswithr5r
r,)rr:Zdata_process_funcZ
n_defaultsZoverviewr;ZfieldsZarticle_number�tokens�i�tokenZ
field_nameZis_metadata�hrrr�_parse_overview�s&
rJcCs�|dkr |dd�}|dd�}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}|dkr�|d7}n|d	kr�|d
7}t�||||||�S)z�Parse a pair of (date, time) strings, and return a datetime object.
    If only the date is given, it is assumed to be date and time
    concatenated together (e.g. response to the DATE command).
    Ni�������������Fi��dil)rC�datetime)�date_str�time_strZhoursZminutesZseconds�yearZmonthZdayrrr�_parse_datetime�s
rUcCsPt|tj�sd}n
d�|�}|j}|r<|d}d�||�}nd�||�}||fS)aPFormat a date or datetime object as a pair of (date, time) strings
    in the format required by the NEWNEWS and NEWGROUPS commands.  If a
    date object is passed, the time is assumed to be midnight (00h00).

    The returned representation depends on the legacy flag:
    * if legacy is False (the default):
      date has the YYYYMMDD format and time the HHMMSS format
    * if legacy is True:
      date has the YYMMDD format and time the HHMMSS format.
    RFC 3977 compliant servers should understand both formats; therefore,
    legacy is only needed when talking to old servers.
    Z000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rPz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})r+rQ�formatrT)ZdtZlegacyrS�yrRrrr�_unparse_datetime�s

rXcCs|dkrt��}|j||d�S)z�Wrap a socket in SSL/TLS. Arguments:
        - sock: Socket to wrap
        - context: SSL context to use for the encrypted connection
        Returns:
        - sock: New, encrypted socket.
        N)Zserver_hostname)�sslZ_create_stdlib_contextZwrap_socket)�sock�contextZhostnamerrr�_encrypt_onsr\c@seZdZdZdZdefdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZeZdd�Z
dd�Zdhdd�Zdd�Zdidd�Zdd�Zdjdd�Zdkdd �Zd!d"�Zd#d$�Zd%d&�Zdd'�d(d)�Zdd'�d*d+�Zdldd'�d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zdd'�d6d7�Zd8d9�Z d:d;�Z!dmd<d=�Z"d>d?�Z#d@dA�Z$dndBdC�Z%dodd'�dDdE�Z&dpdd'�dFdG�Z'dqdd'�dHdI�Z(dJdK�Z)dd'�dLdM�Z*dd'�dNdO�Z+dd'�dPdQ�Z,dd'�dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4drdbdc�Z5ddde�Z6e7�rdsdfdg�Z8dS)t�	_NNTPBasezutf-8�surrogateescapeNcCsj||_||_d|_|��|_d|_|��d|_|rZd|jkrZ|��|jsZd|_|��d|_	d|_
dS)aSInitialize an instance.  Arguments:
        - file: file-like object (open for read/write in binary mode)
        - host: hostname of the server
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        rNF�READER)�host�file�	debugging�_getresp�welcome�_caps�getcapabilities�readermode_afterauth�_setreadermode�tls_on�
authenticated)rrar`�
readermode�timeoutrrrr9s
	z_NNTPBase.__init__cCs|S�Nr�rrrr�	__enter__hsz_NNTPBase.__enter__c	sR�fdd�}|�rNz*z���Wnttfk
r8YnXW5|�rL���XdS)Ncs
t�d�S)Nra)�hasattrrrnrr�<lambda>l�z$_NNTPBase.__exit__.<locals>.<lambda>)�_close�quit�OSError�EOFError)rrZis_connectedrrnr�__exit__ks
z_NNTPBase.__exit__cCs|jrtdt|j��|jS)z�Get the welcome message from the server
        (this is read and squirreled away by __init__()).
        If the response code is 200, posting is allowed;
        if it 201, posting is not allowed.z	*welcome*)rb�print�reprrdrnrrr�
getwelcomevsz_NNTPBase.getwelcomec	Cs�|jdkr�d|_d|_z|��\}}Wnttfk
rDi|_Yn<X||_d|krhttt|d��|_d|kr�d�	|d�|_|jS)z�Get the server capabilities, as read by __init__().
        If the CAPABILITIES command is not supported, an empty dict is
        returned.Nr3ZVERSIONZIMPLEMENTATION� )
re�nntp_versionZnntp_implementation�capabilitiesrr�max�maprCr.)r�resp�capsrrrrfs
z_NNTPBase.getcapabilitiescCs
||_dS)z�Set the debugging level.  Argument 'level' means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)rb)r�levelrrr�set_debuglevel�sz_NNTPBase.set_debuglevelcCsHt�d||�|t}|jdkr.tdt|��|j�|�|j��dS)zfInternal: send one line to the server, appending CRLF.
        The `line` must be a bytes-like object.znntplib.putliner3z*put*N)	�sys�audit�_CRLFrbrxryra�write�flush�rr;rrr�_putline�s
z_NNTPBase._putlinecCs2|jrtdt|��|�|j|j�}|�|�dS)zkInternal: send one command to the server (through _putline()).
        The `line` must be a unicode string.z*cmd*N)rbrxry�encode�encoding�errorsr�r�rrr�_putcmd�sz_NNTPBase._putcmdTcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sDt�|r�|dd�t	krf|dd�}n|dd�t	kr�|dd�}|S)z�Internal: return one line from the server, stripping _CRLF.
        Raise EOFError if the connection is closed.
        Returns a bytes object.r3z
line too longz*get*rNN���)
ra�readline�_MAXLINEr9r
rbrxryrvr�)rZ
strip_crlfr;rrr�_getline�s
z_NNTPBase._getlinecCsl|��}|jrtdt|��|�|j|j�}|dd�}|dkrHt|��|dkrXt|��|dkrht	|��|S)z�Internal: get a response from the server.
        Raise various errors if the response indicates an error.
        Returns a unicode string.z*resp*Nr3�4�5Z123)
r�rbrxryr-r�r�rrr	)rr��crrrrc�sz_NNTPBase._getrespcCs�d}z�t|ttf�r"t|d�}}|��}|dd�tkrBt|��g}|dk	r�dtdf}|�	d�}||krnq�|�
d�r�|dd�}|�|�qZn8d}|�	�}||kr�q�|�
d�r�|dd�}|�|�q�W5|r�|��X||fS)	aPInternal: get a response plus following text from the server.
        Raise various errors if the response indicates an error.

        Returns a (response, lines) tuple where `response` is a unicode
        string and `lines` is a list of bytes objects.
        If `file` is a file-like object, it must be open in binary mode.
        N�wb��.s.
Fs..r3)
�closer+�strr�openrc�	_LONGRESPrr�r�rEr�r,)rraZ
openedFiler�rZterminatorsr;�
terminatorrrr�_getlongresp�s4	



z_NNTPBase._getlongrespcCs|�|�|��S)zWInternal: send a command and get the response.
        Same return value as _getresp().)r�rcr�rrr�	_shortcmd�s
z_NNTPBase._shortcmdcCs|�|�|�|�S)zoInternal: send a command and get the response plus following text.
        Same return value as _getlongresp().�r�r�)rr;rarrr�_longcmds
z_NNTPBase._longcmdcs.��|���|�\}}|�fdd�|D�fS)z�Internal: send a command and get the response plus following text.
        Same as _longcmd() and _getlongresp(), except that the returned `lines`
        are unicode strings rather than bytes objects.
        csg|]}|��j�j��qSr)r-r�r���.0r;rnrr�
<listcomp>s�z,_NNTPBase._longcmdstring.<locals>.<listcomp>r�)rr;rar��listrrnr�_longcmdstring	s

�z_NNTPBase._longcmdstringcCsdz|jWStk
rYnXz|�d�\}}Wn tk
rPtdd�}Yn
Xt|�}||_|S)zqInternal: get the overview format. Queries the server if not
        already done, else returns the cached value.zLIST OVERVIEW.FMTN)Z_cachedoverviewfmt�AttributeErrorr�rr8r@)rr�rr:rrr�_getoverviewfmtsz_NNTPBase._getoverviewfmtcCsdd�|D�S)NcSsg|]}t|����qSr)r!rBr�rrrr�&sz(_NNTPBase._grouplist.<locals>.<listcomp>r)rrrrr�
_grouplist$sz_NNTPBase._grouplistcCs8i}|�d�\}}|D]}|��^}}|||<q||fS)a!Process a CAPABILITIES command.  Not supported by all servers.
        Return:
        - resp: server response if successful
        - caps: a dictionary mapping capability names to lists of tokens
        (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })
        ZCAPABILITIES)r�rB)rr�r�rr;r<rFrrrr}(s
z_NNTPBase.capabilities)racCsbt|tjtjf�s$td�|jj���t||jdk�\}}d�||�}|�	||�\}}||�
|�fS)z�Process a NEWGROUPS command.  Arguments:
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of newsgroup names
        �Athe date parameter must be a date or datetime object, not '{:40}'rKzNEWGROUPS {0} {1})r+rQr�	TypeErrorrV�	__class__rrXr|r�r�)rrrarRrS�cmdr�rrrr�	newgroups6s��z_NNTPBase.newgroupscCsRt|tjtjf�s$td�|jj���t||jdk�\}}d�|||�}|�	||�S)z�Process a NEWNEWS command.  Arguments:
        - group: group name or '*'
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of message ids
        r�rKzNEWNEWS {0} {1} {2})
r+rQrr�rVr�rrXr|r�)rr"rrarRrSr�rrr�newnewsFs��z_NNTPBase.newnewscCs4|dk	rd|}nd}|�||�\}}||�|�fS)a@Process a LIST or LIST ACTIVE command. Arguments:
        - group_pattern: a pattern indicating which groups to query
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (group, last, first, flag) (strings)
        NzLIST ACTIVE ZLIST)r�r�)r�
group_patternra�commandr�rrrrr�Vs

z_NNTPBase.listcCs�t�d�}|�d|�\}}|�d�s8|�d|�\}}i}|D]:}|�|���}|r@|�dd�\}	}
|sr|
S|
||	<q@|r�||fSdSdS)Nz^(?P<group>[^ 	]+)[ 	]+(.*)$zLIST NEWSGROUPS r�XGTITLE r3rKr))�re�compiler�rE�search�stripr")rr�Z
return_all�line_patr�r�groups�raw_line�matchr<Zdescrrr�_getdescriptionses


z_NNTPBase._getdescriptionscCs|�|d�S)a�Get a description for a single group.  If more than one
        group matches ('group' is a pattern), return the first.  If no
        group matches, return an empty string.

        This elides the response code from the server, since it can
        only be '215' or '285' (for xgtitle) anyway.  If the response
        code is needed, use the 'descriptions' method.

        NOTE: This neither checks for a wildcard in 'group' nor does
        it check whether the group actually exists.F�r�)rr"rrr�description|sz_NNTPBase.descriptioncCs|�|d�S)z'Get descriptions for a range of groups.Tr�)rr�rrr�descriptions�sz_NNTPBase.descriptionscCs�|�d|�}|�d�s t|��|��}d}}}t|�}|dkr�|d}|dkr�|d}|dkr�|d}|dkr�|d��}|t|�t|�t|�|fS)aProcess a GROUP command.  Argument:
        - group: the group name
        Returns:
        - resp: server response if successful
        - count: number of articles
        - first: first article number
        - last: last article number
        - name: the group name
        zGROUP rrr3rKr�rL)r�rErrBr9r5rC)rr<r��words�countr$r#�nrrrr"�s

z_NNTPBase.groupcCs|�d|�S)aProcess a HELP command. Argument:
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of strings returned by the server in response to the
                HELP command
        ZHELP)r�)rrarrr�help�sz_NNTPBase.helpcCs8|�d�st|��|��}t|d�}|d}|||fS)z_Internal: parse the response line of a STAT, NEXT, LAST,
        ARTICLE, HEAD or BODY command.Z22r3rK)rErrBrC)rr�r��art_numr'rrr�
_statparse�s
z_NNTPBase._statparsecCs|�|�}|�|�S)z/Internal: process a STAT, NEXT or LAST command.)r�r�)rr;r�rrr�_statcmd�s
z_NNTPBase._statcmdcCs"|r|�d�|��S|�d�SdS)a(Process a STAT command.  Argument:
        - message_spec: article number or message id (if not specified,
          the current article is selected)
        Returns:
        - resp: server response if successful
        - art_num: the article number
        - message_id: the message id
        zSTAT {0}ZSTATN)r�rV)r�message_specrrr�stat�s	z_NNTPBase.statcCs
|�d�S)z;Process a NEXT command.  No arguments.  Return as for STAT.ZNEXT�r�rnrrr�next�sz_NNTPBase.nextcCs
|�d�S)z;Process a LAST command.  No arguments.  Return as for STAT.ZLASTr�rnrrrr#�sz_NNTPBase.lastcCs0|�||�\}}|�|�\}}}|t|||�fS)z2Internal: process a HEAD, BODY or ARTICLE command.)r�r�r&)rr;rar�rr�r'rrr�_artcmd�sz_NNTPBase._artcmdcCs$|dk	rd�|�}nd}|�||�S)a0Process a HEAD command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the headers in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of header lines)
        NzHEAD {0}ZHEAD�rVr��rr�rar�rrr�head�sz_NNTPBase.headcCs$|dk	rd�|�}nd}|�||�S)a+Process a BODY command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the body in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of body lines)
        NzBODY {0}ZBODYr�r�rrr�body�sz_NNTPBase.bodycCs$|dk	rd�|�}nd}|�||�S)a5Process an ARTICLE command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the article in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of article lines)
        NzARTICLE {0}ZARTICLEr�r�rrr�article�sz_NNTPBase.articlecCs
|�d�S)zYProcess a SLAVE command.  Returns:
        - resp: server response if successful
        ZSLAVE)r�rnrrr�slavesz_NNTPBase.slavecsDt�d��|�d�||�|�\}}�fdd��|�fdd�|D�fS)aiProcess an XHDR command (optional server extension).  Arguments:
        - hdr: the header type (e.g. 'subject')
        - str: an article nr, a message id, or a range nr1-nr2
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (nr, value) strings
        z^([0-9]+) ?(.*)
?zXHDR {0} {1}cs��|�}|r|�dd�S|S)Nr3rK)r�r")r;�m)�patrr�
remove_numbers
z%_NNTPBase.xhdr.<locals>.remove_numbercsg|]}�|��qSrrr�)r�rrr�sz"_NNTPBase.xhdr.<locals>.<listcomp>)r�r�r�rV)rZhdrr�rar�rr)r�r�r�xhdrs	
z_NNTPBase.xhdrcCs.|�d�||�|�\}}|��}|t||�fS)aFProcess an XOVER command (optional server extension) Arguments:
        - start: start of range
        - end: end of range
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields
        z
XOVER {0}-{1})r�rVr�rJ)r�start�endrar�rr:rrr�xovers
	�z_NNTPBase.xoverc	Csxd|jkrdnd}t|ttf�r>|\}}|d�||p6d�7}n|dk	rR|d|}|�||�\}}|��}|t||�fS)a�Process an OVER command.  If the command isn't supported, fall
        back to XOVER. Arguments:
        - message_spec:
            - either a message id, indicating the article to fetch
              information about
            - or a (start, end) tuple, indicating a range of article numbers;
              if end is None, information up to the newest message will be
              retrieved
            - or None, indicating the current article number must be used
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields

        NOTE: the "message id" form isn't supported by XOVER
        ZOVERZXOVERz {0}-{1}r)Nr{)rer+�tupler�rVr�r�rJ)	rr�rar�r�r�r�rr:rrr�over*sz_NNTPBase.overc	Csft�dtd�t�d�}|�d||�\}}g}|D](}|�|���}|r4|�|�	dd��q4||fS)z�Process an XGTITLE command (optional server extension) Arguments:
        - group: group name wildcard (i.e. news.*)
        Returns:
        - resp: server response if successful
        - list: list of (name,title) stringszFThe XGTITLE extension is not actively used, use descriptions() insteadrKz^([^ 	]+)[ 	]+(.*)$r�r3)
�warnings�warn�DeprecationWarningr�r�r�r�r�r,r")	rr"rar�r�Z	raw_linesrr�r�rrr�xgtitleEs�
z_NNTPBase.xgtitlecCslt�dtd�|�d�|��}|�d�s0t|��z|��\}}Wntk
r^t|�d�Yn
X||fSdS)z�Process an XPATH command (optional server extension) Arguments:
        - id: Message id of article
        Returns:
        resp: server response if successful
        path: directory path to article
        z(The XPATH extension is not actively usedrKz	XPATH {0}Z223N)	r�r�r�r�rVrErrB�
ValueError)r�idr�Zresp_num�pathrrr�xpathWs�
z_NNTPBase.xpathcCsb|�d�}|�d�st|��|��}t|�dkr8t|��|d}t|�dkrTt|��|t|d�fS)z�Process the DATE command.
        Returns:
        - resp: server response if successful
        - date: datetime object
        ZDATEZ111rKr3�N)r�rErrBr9r
rU)rr��elemrrrrrks

z_NNTPBase.datecCs�|�|�}|�d�st|��t|ttf�r2|��}|D]:}|�t�sR|�	d�t}|�d�rdd|}|j
�|�q6|j
�d�|j
��|�
�S)N�3r r�s.
)r�rErr+r�	bytearray�
splitlines�endswithr��rstriprar�r�rc)rr��fr�r;rrr�_post|s




z_NNTPBase._postcCs|�d|�S)z�Process a POST command.  Arguments:
        - data: bytes object, iterable or file containing the article
        Returns:
        - resp: server response if successfulZPOST)r�)r�datarrr�post�sz_NNTPBase.postcCs|�d�|�|�S)aProcess an IHAVE command.  Arguments:
        - message_id: message-id of the article
        - data: file containing the article
        Returns:
        - resp: server response if successful
        Note that if the server refuses the article an exception is raised.z	IHAVE {0})r�rV)rr'r�rrr�ihave�sz_NNTPBase.ihavecCs|j��|`dSrm)rar�rnrrrrs�s
z_NNTPBase._closecCsz|�d�}W5|��X|S)zdProcess a QUIT command and close the socket.  Returns:
        - resp: server response if successfulZQUIT)rsr�)rr�rrrrt�s
z_NNTPBase.quitcCs�|jrtd��|s|std��z<|rX|sXddl}|��}|�|j�}|rX|d}|d}Wntk
rnYnX|sxdS|�d|�}|�d�r�|s�t|��n |�d|�}|�d�s�t	|��d|_
|��|jr�d	|j
kr�|�
�d|_
|��dS)
NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrKzauthinfo user Z381zauthinfo pass Z281r_)rjr��netrcZauthenticatorsr`rur�rErrrerfrgrh)r�user�password�usenetrcr�ZcredentialsZauthr�rrr�login�s>�


z_NNTPBase.loginc
Cs`z|�d�|_WnJtk
r$Yn8tk
rZ}z|j�d�rHd|_n�W5d}~XYnXdS)Nzmode readerZ480T)r�rdrrr
rErg)r�errrrh�sz_NNTPBase._setreadermodecCs||jrtd��|jrtd��|�d�}|�d�rp|j��t|j||j	�|_|j�
d�|_d|_d|_|��nt
d��dS)	zzProcess a STARTTLS command. Arguments:
            - context: SSL context to use for the encrypted connection
            zTLS is already enabled.z+TLS cannot be started after authentication.�STARTTLSZ382�rwbTNzTLS failed to start.)rir�rjr�rErar�r\rZr`�makefilererfr)rr[r�rrr�starttls�s



z_NNTPBase.starttls)T)N)N)N)N)N)N)N)N)N)NNT)N)9rrrr�r�rrrorwrzrfr��debugr�r�r�rcr�r�r�r�r�r�r}r�r�r�r�r�r�r"r�r�r�r�r�r#r�r�r�r�r�r�r�r�r�r�rr�r�r�rsrtr�rh�	_have_sslr�rrrrr])sn
�
/		

.







		
)
r]c@s*eZdZeddddefdd�Zdd�ZdS)rNFc	Cs�||_||_t�d|||�t�||f|�|_d}z8|j�d�}t�	|||||�|sZ|rh|�
|||�Wn$|r~|��|j���YnXdS)a,Initialize an instance.  Arguments:
        - host: hostname to connect to
        - port: port to connect to (default the standard NNTP port)
        - user: username to authenticate with
        - password: password to use with username
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - usenetrc: allow loading username and password from ~/.netrc file
                    if not specified explicitly
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        �nntplib.connectNr�)r`�portr�r��socket�create_connectionrZr�r]rr�r�)	rr`r�r�r�rkr�rlrarrrr�s$
�
z
NNTP.__init__cCs zt�|�W5|j��XdSrm�rZr�r]rsrnrrrrs$szNNTP._close)rrr�	NNTP_PORTrrrsrrrrr�s�
%c@s,eZdZedddddefdd�Zdd�ZdS)�NNTP_SSLNFc	
Cs�t�d|||�t�||f|�|_d}	zJt|j||�|_|j�d�}	tj||	|||d�|s`|rn|�	|||�Wn$|	r�|	�
�|j�
��YnXdS)z�This works identically to NNTP.__init__, except for the change
            in default port and the `ssl_context` argument for SSL connections.
            r�Nr�)rkrl)r�r�r�r�rZr\r�r]rr�r�)
rr`r�r�r�Zssl_contextrkr�rlrarrrr.s"
�
zNNTP_SSL.__init__cCs zt�|�W5|j��XdSrmr�rnrrrrsEszNNTP_SSL._close)rrr�
NNTP_SSL_PORTrrrsrrrrr,s�
r�__main__zJ        nntplib built-in demo - display the latest articles in a newsgroup)r�z-gz--groupzgmane.comp.python.generalz3group to fetch messages from (default: %(default)s))�defaultr�z-sz--serverz
news.gmane.ioz+NNTP server hostname (default: %(default)s)z-pz--portr�z#NNTP port number (default: %s / %s))r�typer�z-nz
--nb-articles�
z2number of articles to fetch (default: %(default)s)z-Sz--ssl�
store_truezuse NNTP over SSL)�actionrr�)r`r�r�ZGroupZhaszarticles, range�tocCs$t|�|kr |d|d�d}|S)NrLz...)r9)�sZlimrrr�cutpsr
r3�<z{:7} {:20} {:42} ({})��*)N)N)F)Krr�r��collectionsrQr�r�rY�ImportErrorr�Zemail.headerrr*r�__all__r�rrrrrr	r
r�rr�r8r6r��
namedtupler!r&r@rJrUrXr\r]rrr,r�argparse�ArgumentParser�parser�add_argumentrC�
parse_argsrr�Zserverr	rfr�r�r"r�r�r$r#r<rxr
r�Znb_articlesr�Z	overviewsZartnumr�rBZauthorrrrVrtrrrr�<module>s�A
�
	���
��


Y.


�
�
���


�
keyword.cpython-38.opt-2.pyc000064400000001075151450073350011626 0ustar00U

e5d��#@s`ddgZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g#Zee�jZd%S)&�	iskeyword�kwlist�False�None�True�and�as�assert�async�await�break�class�continue�def�del�elif�else�except�finally�for�from�global�if�import�in�is�lambda�nonlocal�not�or�pass�raise�return�try�while�with�yieldN)�__all__r�	frozenset�__contains__r�r)r)�/usr/lib64/python3.8/keyword.py�<module>sJ�&smtpd.cpython-38.pyc000064400000063541151450073350010337 0ustar00U

e5d���@s^dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddddd	gZejdZd
ZGdd�d�Ze�ad
ZdZdZd%dd�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGdd�d�Z dd�Z!e"dk�rZe!�Z#e#j$Z$de$k�rpe$�%d�Z&e'e$de&�e(�e)�dg�Z*e$e&dd�Z$nddl+Z*e,e*e$�Z-e-e#j.e#j/fe#j0e#j1fe#j2e#j3d�Z4e#j5�r6zddl6Z6Wn.e7k
�r�e8d ej9d!�e�:d�YnXe6�;d"�d#Z<ze�5e<�Wn.e=k
�r4e8d$ej9d!�e�:d�YnXze�>�Wne?k
�rXYnXdS)&a�An RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions.

Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]

Options:

    --nosetuid
    -n
        This program generally tries to setuid `nobody', unless this flag is
        set.  The setuid call will fail if this program is not run as root (in
        which case, use this flag).

    --version
    -V
        Print the version number and exit.

    --class classname
    -c classname
        Use `classname' as the concrete SMTP proxy class.  Uses `PureProxy' by
        default.

    --size limit
    -s limit
        Restrict the total size of the incoming message to "limit" number of
        bytes via the RFC 1870 SIZE extension.  Defaults to 33554432 bytes.

    --smtputf8
    -u
        Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy.

    --debug
    -d
        Turn on debugging prints.

    --help
    -h
        Print this message and exit.

Version: %(__version__)s

If localhost is not given then `localhost' is used, and if localport is not
given then 8025 is used.  If remotehost is not given then `localhost' is used,
and if remoteport is not given, then 25 is used.
�N)�warn)�
get_addr_spec�get_angle_addr�SMTPChannel�
SMTPServer�DebuggingServer�	PureProxy�MailmanProxyzPython SMTP proxy version 0.3c@seZdZdd�Zdd�ZdS)�DevnullcCsdS�N���self�msgrr�/usr/lib64/python3.8/smtpd.py�writef�z
Devnull.writecCsdSrr�rrrr�flushgrz
Devnull.flushN)�__name__�
__module__�__qualname__rrrrrrr
esr
�
z, i�cCs4ttt�tjd�|r&t|tjd�t�|�dS)N��file)�print�__doc__�globals�sys�stderr�exit)�coderrrr�usagepsr#c@s�eZdZdZdZdZe�efdd��Ze	dd��Z
edd	d	fd
d�Zdd
�Z
dd�Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd ��Zejd!d ��Ze	d"d#��Zejd$d#��Ze	d%d&��Zejd'd&��Ze	d(d)��Zejd*d)��Ze	d+d,��Zejd-d,��Ze	d.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dS)Srr�icCs|Srr)�xrrr�<lambda>|rzSMTPChannel.<lambda>cCs0zt|j���WStk
r*|jYSXdSr)�max�command_size_limits�values�
ValueError�command_size_limitrrrr�max_command_size_limit~sz"SMTPChannel.max_command_size_limitNFc	
Cs&tjj|||d�||_||_||_||_||_||_|rF|rFt	d��|rdd|_
d|_d|_t
|_nd|_
d|_td�|_d	|_|��d|_d
|_|j��t��|_z|��|_WnBtk
r�}z$|��|jdtjkr�WY�dSd}~XYnXtdt |j�t!d
�|�"d|jt#f�dS)N��map�Fdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer�
�.r�
�.�
FrzPeer:rz	220 %s %s)$�asynchat�
async_chat�__init__�smtp_server�conn�addr�data_size_limit�enable_SMTPUTF8�_decode_datar*�_emptystring�_linesep�_dotsep�NEWLINE�_newline�ord�_set_rset_state�
seen_greeting�
extended_smtpr(�clear�socketZgetfqdn�fqdnZgetpeername�peer�OSError�close�args�errnoZENOTCONNr�repr�DEBUGSTREAM�push�__version__)	rZserverr9r:r;r.r<�decode_data�errrrrr7�s@


zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|�d�dS)z/Reset state variables to their post-DATA state.NFrr2)�COMMAND�
smtp_state�mailfrom�rcpttos�require_SMTPUTF8�	num_bytes�set_terminatorrrrr�_set_post_data_state�sz SMTPChannel._set_post_data_statecCs|��d|_g|_dS)z.Reset all state variables except the greeting.rN)r\�
received_data�received_linesrrrrrD�szSMTPChannel._set_rset_statecCstdtd�|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' instead��r�DeprecationWarningr8rrrr�__server�s
�zSMTPChannel.__servercCstdtd�||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr_r`�r�valuerrrrb�s
�cCstdtd�|jS)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr_�rrar^rrrr�__line�s
�zSMTPChannel.__linecCstdtd�||_dS)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr_rercrrrrf�s
�cCstdtd�|jS)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr_�rrarVrrrr�__state�s
�zSMTPChannel.__statecCstdtd�||_dS)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr_rgrcrrrrh�s
�cCstdtd�|jS)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr_�rrarErrrr�
__greeting�s
�zSMTPChannel.__greetingcCstdtd�||_dS)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr_rircrrrrj�s
�cCstdtd�|jS)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr_�rrarWrrrr�
__mailfrom�s
�zSMTPChannel.__mailfromcCstdtd�||_dS)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr_rkrcrrrrl�s
�cCstdtd�|jS)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr_�rrarXrrrr�	__rcpttos�s
�zSMTPChannel.__rcpttoscCstdtd�||_dS)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr_rmrcrrrrn�s
�cCstdtd�|jS)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr_�rrar]rrrr�__data�s
�zSMTPChannel.__datacCstdtd�||_dS)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr_rorcrrrrps
�cCstdtd�|jS)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr_�rrarIrrrr�__fqdn
s
�zSMTPChannel.__fqdncCstdtd�||_dS)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr_rqrcrrrrrs
�cCstdtd�|jS)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr_�rrarJrrrr�__peers
�zSMTPChannel.__peercCstdtd�||_dS)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr_rsrcrrrrts
�cCstdtd�|jS)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr_�rrar9rrrr�__conn s
�zSMTPChannel.__conncCstdtd�||_dS)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr_rurcrrrrv%s
�cCstdtd�|jS)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr_�rrar:rrrr�__addr+s
�zSMTPChannel.__addrcCstdtd�||_dS)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr_rwrcrrrrx0s
�cCs&tj�|t|d|jrdnd��dS)Nr0�utf-8�ascii)r5r6rQ�bytesrYr
rrrrQ7s
�zSMTPChannel.pushcCs|d}|j|jkr|j}n|j|jkr*|j}|r<|j|kr<dS|rR|jt|�7_|jrl|j�	t
|d��n|j�	|�dS)Nry)rVrUr,�DATAr;rZ�lenr=r^�append�str)r�data�limitrrr�collect_incoming_data<sz!SMTPChannel.collect_incoming_datac
Cs|j�|j�}tdt|�td�g|_|j|jk�r|jd}|_|sT|�	d�dS|j
sdt|d�}|�d�}|dkr�|�
�}d}n$|d|��
�}||dd���}|jr�|j|n|j}||kr�|�	d�dSt|d	|d�}|s�|�	d
|�dS||�dS|j|jk�r(|�	d�d|_dS|j�rR|j|jk�rR|�	d�d|_dSg}|�|j�D]:}	|	�r�|	d|jk�r�|�|	dd��n
|�|	��qb|j�|�|_|j|j|j|jf}
i}|j
�s�|j|jd
�}|j j!|
|�}|�"�|�s|�	d�n
|�	|�dS)NzData:rrz500 Error: bad syntaxry� r$z500 Error: line too longZsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data)�mail_options�rcpt_options�250 OK)#r>�joinr^rrOrPrVrUrZrQr=r�find�upper�striprFr(r+�getattrr|r;�splitr?r@r~rBr]rJrWrXr�r�r8�process_messager\)
r�lineZsz�i�command�argZmax_sz�methodr��textrM�kwargsZstatusrrr�found_terminatorLsl


��


�zSMTPChannel.found_terminatorcCsH|s|�d�dS|jr&|�d�dS|��||_|�d|j�dS)Nz501 Syntax: HELO hostname�503 Duplicate HELO/EHLOz250 %s)rQrErDrI�rr�rrr�	smtp_HELO�s

zSMTPChannel.smtp_HELOcCs�|s|�d�dS|jr&|�d�dS|��||_d|_|�d|j�|jrr|�d|j�|jdd7<|js�|�d�|jr�|�d	�|jdd
7<|�d�dS)Nz501 Syntax: EHLO hostnamer�Tz250-%sz250-SIZE %s�MAIL�z250-8BITMIMEz250-SMTPUTF8�
z250 HELP)	rQrErDrFrIr;r(r=r<r�rrr�	smtp_EHLO�s&



zSMTPChannel.smtp_EHLOcCs|r|�d�n
|�d�dS)Nz501 Syntax: NOOPr��rQr�rrr�	smtp_NOOP�szSMTPChannel.smtp_NOOPcCs|�d�|��dS)Nz221 Bye)rQZclose_when_doner�rrr�	smtp_QUIT�s
zSMTPChannel.smtp_QUITcCs0t|�}|d|���|kr,||d���SdS)Nr)r}r�r�)r�keywordr�Zkeylenrrr�_strip_command_keyword�sz"SMTPChannel._strip_command_keywordcCsF|sdS|���d�r$t|�\}}nt|�\}}|s<||fS|j|fS)N)rr�<)�lstrip�
startswithrrZ	addr_spec)rr��address�restrrr�_getaddr�szSMTPChannel._getaddrcCsHi}|D]:}|�d�\}}}|��r,|r2|s2dS|r:|nd||<q|S)N�=T)�	partition�isalnum)r�params�resultZparam�eqrdrrr�
_getparams�szSMTPChannel._getparamscCs|r�d}|��}|dkr$|�d�q�|dkr8|�d�q�|dkr^d}|jrR||7}|�|�q�|dkr�d	}|jrx||7}|�|�q�|d
kr�|�d�q�|dkr�|�d
�q�|dkr�|�d�q�|dkr�|�d�q�|dkr�|�d�q�|�d�n
|�d�dS)N� [SP <mail-parameters>]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamer�z 250 Syntax: MAIL FROM: <address>ZRCPTz250 Syntax: RCPT TO: <address>r|z250 Syntax: DATAZRSETz250 Syntax: RSETZNOOPz250 Syntax: NOOPZQUITz250 Syntax: QUITZVRFYz250 Syntax: VRFY <address>zD501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFYzD250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY)r�rQrF)rr�ZextendedZlc_argrrrr�	smtp_HELP�s:zSMTPChannel.smtp_HELPcCs@|r2|�|�\}}|r"|�d�q<|�d|�n
|�d�dS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY <address>)r�rQ)rr�r�r�rrr�	smtp_VRFY�szSMTPChannel.smtp_VRFYcCs�|js|�d�dStd|td�d}|jr4|d7}|dkrJ|�|�dS|�d|�}|�|�\}}|sv|�|�dS|js�|r�|�|�dS|jr�|�d�dS|���	�|_
|�|j
�}|dkr�|�|�dS|js�|�
dd	�}|d
kr�|�d�dS|j�r8|�
dd
�}|dk�r d|_n|d
k	�r8|�d�dS|�
dd�}|�r�|���sb|�|�dS|j�r�t|�|jk�r�|�d�dSt|���dk�r�|�d�dS||_td|jtd�|�d�dS)N�503 Error: send HELO firstz	===> MAILrz 501 Syntax: MAIL FROM: <address>r�zFROM:z503 Error: nested MAIL commandZBODY�7BIT)r�Z8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMEZSMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsZSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r�)rErQrrPrFr�r�rWr�r�r�r�r=�popr<rY�isdigitr;�intr}�keys)rr��	syntaxerrr�r�Zbody�smtputf8�sizerrr�	smtp_MAILsh














zSMTPChannel.smtp_MAILcCs|js|�d�dStd|td�|js6|�d�dSd}|jrH|d7}|dkr^|�|�dS|�d|�}|�|�\}}|s�|�|�dS|js�|r�|�|�dS|���	�|_
|�|j
�}|dkr�|�|�dSt|�
��dkr�|�d	�dS|j�|�td
|jtd�|�d�dS)Nr�z	===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO: <address>r�zTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r�)rErQrrPrWrFr�r�r�r�r�r�r}r�rXr~)rr�r�r�r�rrr�	smtp_RCPT7s@







zSMTPChannel.smtp_RCPTcCs(|r|�d�dS|��|�d�dS)Nz501 Syntax: RSETr�)rQrDr�rrr�	smtp_RSETZs

zSMTPChannel.smtp_RSETcCsZ|js|�d�dS|js(|�d�dS|r:|�d�dS|j|_|�d�|�d�dS)Nr�z503 Error: need RCPT commandz501 Syntax: DATAs
.
z#354 End data with <CR><LF>.<CR><LF>)rErQrXr|rVr[r�rrr�	smtp_DATAas



zSMTPChannel.smtp_DATAcCs|�d�dS)Nz502 EXPN not implementedr�r�rrr�	smtp_EXPNpszSMTPChannel.smtp_EXPN),rrrrUr|r+�collections�defaultdictr(�propertyr,�DATA_SIZE_DEFAULTr7r\rDZ_SMTPChannel__server�setterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrws�
�
'	





















>#6#c@s2eZdZeZedddfdd�Zdd�Zdd�ZdS)	rNFcCs�||_||_||_||_||_|r.|r.td��tjj||d�zNt	j
|dt	ji�}|�|dd|dd�|�
�|�|�|�d�Wn|���Yn(Xtd|jjt�t���||ftd�dS)	Nr/r-�typerr$�z0%s started at %s
	Local addr: %s
	Remote addr:%sr)Z
_localaddr�_remoteaddrr;r<r=r*�asyncore�
dispatcherr7rHZgetaddrinfoZSOCK_STREAMZ
create_socketZset_reuse_addrZbindZlistenrLr�	__class__r�time�ctimerP)rZ	localaddrZ
remoteaddrr;r.r<rSZgai_resultsrrrr7xs6�
��zSMTPServer.__init__c	Cs6tdt|�td�|�||||j|j|j|j�}dS)NzIncoming connection from %sr)rrOrP�
channel_classr;�_mapr<r=)rr9r:Zchannelrrr�handle_accepted�s�zSMTPServer.handle_acceptedcKst�dS)aOverride this abstract method to handle messages from the client.

        peer is a tuple containing (ipaddr, port) of the client that made the
        socket connection to our smtp port.

        mailfrom is the raw address the client claims the message is coming
        from.

        rcpttos is a list of raw addresses the client wishes to deliver the
        message to.

        data is a string containing the entire full text of the message,
        headers (if supplied) and all.  It has been `de-transparencied'
        according to RFC 821, Section 4.5.2.  In other words, a line
        containing a `.' followed by other text has had the leading dot
        removed.

        kwargs is a dictionary containing additional information.  It is
        empty if decode_data=True was given as init parameter, otherwise
        it will contain the following keys:
            'mail_options': list of parameters to the mail command.  All
                            elements are uppercase strings.  Example:
                            ['BODY=8BITMIME', 'SMTPUTF8'].
            'rcpt_options': same, for the rcpt command.

        This function should return None for a normal `250 Ok' response;
        otherwise, it should return the desired response string in RFC 821
        format.

        N)�NotImplementedError�rrJrWrXr�r�rrrr��szSMTPServer.process_message)	rrrrr�r�r7r�r�rrrrrts�
c@seZdZdd�Zdd�ZdS)rcCsld}|��}|D]V}|rL|sLd|d}t|t�s@t|�d��}t|�d}t|t�s^t|�}t|�qdS)Nr$zX-Peer: rry)�
splitlines�
isinstancerrO�encoder)rrJr�Z	inheaders�linesr�Z
peerheaderrrr�_print_message_content�s

z&DebuggingServer._print_message_contentcKsXtd�|r@|�d�r&td|d�|�d�r@td|d�|�||�td�dS)Nz%---------- MESSAGE FOLLOWS ----------r�zmail options: %sr�zrcpt options: %s
z%------------ END MESSAGE ------------)r�getr�r�rrrr��s

zDebuggingServer.process_messageN)rrrr�r�rrrrr�scs,eZdZ�fdd�Zdd�Zdd�Z�ZS)rcs.d|kr|drtd��tt|�j||�dS)Nr<z$PureProxy does not support SMTPUTF8.�r*�superrr7�rrMr��r�rrr7�szPureProxy.__init__c	Csf|�d�}d}|D]}|sq(|d7}q|�|d|d�t�|�}|�|||�}td|td�dS)Nrrr$z
X-Peer: %szwe got some refusals:r)r��insertrAr��_deliverrrP)	rrJrWrXr�r�r�r��refusedrrrr��s


zPureProxy.process_messagec
Cs�ddl}i}zB|��}|�|jd|jd�z|�|||�}W5|��XWn�|jk
r�}ztdtd�|j	}W5d}~XYnft
|jfk
r�}zBtd|jtd�t
|dd�}t
|dd	�}	|D]}
||	f||
<q�W5d}~XYnX|S)
Nrr$zgot SMTPRecipientsRefusedrZgotZ	smtp_code���Z
smtp_error�ignore)�smtplibZSMTPZconnectr��quitZsendmailZSMTPRecipientsRefusedrrPZ
recipientsrKZ
SMTPExceptionr�r�)rrWrXr�r�r��s�eZerrcode�errmsg�rrrrr��s$ zPureProxy._deliver)rrrr7r�r��
__classcell__rrr�rr�scs$eZdZ�fdd�Zdd�Z�ZS)r	cs.d|kr|drtd��tt|�j||�dS)Nr<z'MailmanProxy does not support SMTPUTF8.r�r�r�rrr7
szMailmanProxy.__init__cCs*ddlm}ddlm}ddlm}ddlm}g}	|D]t}
|
���d�d}|�d�}t|�dkrfq8|d}
t|�dkr�|d	}nd
}|�	|
�r8|dkr�q8|	�
|
|
|f�q8|	D]\}
}
}|�|
�q�tdd
�
|�td�|r�|�|||�}td|td�i}||�}|�|�}|�d��s&||d<|�d��sDt�t���|d<|	D]�\}
}
}td|
td�|�|
�}|�s�|j|
dd�}|||
<|d
k�r�|j|d	d�n�|dk�r�|j|d	d�nh|dk�r�|j|d	d�nN|dk�r�|j|d	d�n4|dk�rH|dk�rd|d <nd!|d <|j|d	d��qHdS)"Nr)�StringIO)�Utils)�Message)�MailList�@�-r_r$r)r�admin�owner�requestr��leavezforwarding recips:r�rzwe got refusals:�fromZFrom�dateZDatezsending message to)�lock)�tolistr�)Ztoadminr�)Ztoownerr�)Z	torequest)r�r�r�Z	subscribeZSubjectZunsubscribe)�ior�ZMailmanr�r�r��lowerr�r}Zlist_existsr~�removerr�rPr�r�r�r�ZEnqueue)rrJrWrXr�r�r�r�r�Z	listnamesZrcptZlocal�partsZlistnamer�r�Zmlistsr�rZmlistrrrr�sb










zMailmanProxy.process_message)rrrr7r�r�rrr�rr	sc@seZdZdZdZdZdZdS)�OptionsTrNF)rrr�setuid�	classname�
size_limitr<rrrrr�_sr�c
Cspz.t�tjdd�dddddddd	g�\}}Wn.tjk
r\}ztd|�W5d}~XYnXt�}|D]�\}}|d
kr�td�qh|dkr�tt�t�d�qh|d
kr�d|_	qh|dkr�||_
qh|dkr�tjaqh|dkr�d|_
qh|dkrhzt|�}||_Wqhtd|tjd�t�d�YqhXqht|�dk�r<d}d}nPt|�dk�rX|d}d}n4t|�dk�rx|d}|d}ntddt�|��|�d�}	|	dk�r�tdd|�|d|	�|_zt||	dd��|_Wn$tk
�r�tdd|�YnX|�d�}	|	dk�rtdd|�|d|	�|_zt||	dd��|_Wn$tk
�rjtdd|�YnX|S) Nr$z	nVhc:s:duzclass=Znosetuid�version�helpzsize=�debugr�)z-hz--helpr)z-Vz	--version)z-nz
--nosetuidF)z-cz--class)z-dz--debug)z-uz
--smtputf8T)z-sz--sizezInvalid size: rzlocalhost:8025zlocalhost:25r_�zInvalid arguments: %s�:zBad local spec: %szBad local port: %szBad remote spec: %szBad remote port: %s)�getoptr�argv�errorr#r�rrRr!r�r�r rPr<r�r�r}�
COMMASPACEr�r��	localhost�	localportr*�
remotehost�
remoteport)
ZoptsrMr��options�optr�Zint_sizeZ	localspecZ
remotespecr�rrr�	parseargsfsv��






r
�__main__r1r$)r<z7Cannot import module "pwd"; try running with -n option.r�nobodyr_z3Cannot setuid "nobody"; try running with -n option.)r)@rr�osrNrr�rHr�r5r��warningsrZemail._header_value_parserrr�__all__rZprogramrRr
rPrArr�r#r6rr�rrrr	r�r
rrr��rfindZlastdot�
__import__r�locals�modrr�Zclass_rrr	r
r�r<�proxyr��pwd�ImportErrorrr r!�getpwnamr�PermissionErrorZloop�KeyboardInterruptrrrr�<module>s�N�

M-SB




�_threading_local.cpython-38.opt-2.pyc000064400000006070151450073350013420 0ustar00U

e5d4�@sZddlmZddlmZdgZGdd�d�Zedd��ZGdd�d�Zdd	lm	Z	m
Z
d
S)�)�ref)�contextmanager�localc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
_localimpl)�key�dicts�	localargs�	locallock�__weakref__cCsdtt|��|_i|_dS)Nz_threading_local._localimpl.)�str�idrr)�self�r�(/usr/lib64/python3.8/_threading_local.py�__init__�sz_localimpl.__init__cCst�}|jt|�dS)N�)�current_threadrr)r
�threadrrr�get_dict�sz_localimpl.get_dictcshi}|j}t�}t|�}|f�fdd�	}|f�fdd�	}t||��t||���|j|<�|f|j|<|S)Ncs��}|dk	r|j|=dS�N)�__dict__)�_rr)�wrthreadrr�
local_deleted�sz-_localimpl.create_dict.<locals>.local_deletedcs��}|dk	r|j�|�}dSr)r�pop)r�idtr�dct)�wrlocalrr�thread_deleted�sz._localimpl.create_dict.<locals>.thread_deleted)rrrrrr)r
Z	localdictrrrrrr)rrr�create_dict�s


z_localimpl.create_dictN)�__name__�
__module__�__qualname__�	__slots__rrrrrrrr�src	csvt�|d�}z|��}Wn2tk
rJ|��}|j\}}|j||�YnX|j�t�|d|�dVW5QRXdS)N�_local__implr)	�object�__getattribute__r�KeyErrorrrrr	�__setattr__)r
�implr�args�kwrrr�_patch�s
r,c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)r$rcOsX|s|r|jtjkrtd��t�|�}t�}||f|_t�|_t�|d|�|�	�|S)Nz*Initialization arguments are not supportedr$)
rr%�	TypeError�__new__rr�RLockr	r(r)�clsr*r+r
r)rrrr.�s

z
local.__new__c
Cs,t|��t�||�W5QR�SQRXdSr)r,r%r&�r
�namerrrr&�s
zlocal.__getattribute__c
CsF|dkrtd|jj��t|��t�|||�W5QR�SQRXdS�Nrz+%r object attribute '__dict__' is read-only)�AttributeError�	__class__r r,r%r()r
r2�valuerrrr(�s��
zlocal.__setattr__c
CsD|dkrtd|jj��t|��t�||�W5QR�SQRXdSr3)r4r5r r,r%�__delattr__r1rrrr7�s��
zlocal.__delattr__N)r r!r"r#r.r&r(r7rrrrr�s
)rr/N)�weakrefr�
contextlibr�__all__rr,rZ	threadingrr/rrrr�<module>�s,

&socketserver.cpython-38.opt-2.pyc000064400000034467151450073350012674 0ustar00U

e5d�j�	@sdZddlZddlZddlZddlZddlZddlmZddlm	Zddddd	d
ddd
g	Z
eed�rte
�dddg�eed�r�e
�ddddg�eed�r�ej
ZnejZGdd�d�ZGdd�de�ZGdd�de�Zeed�r�Gdd�d�ZGdd�de�ZGdd�d�ZGd d
�d
�Zeed��rJGd!d�dee�ZGd"d�dee�ZGd#d�dee�ZGd$d	�d	ee�Zeed��r�Gd%d�de�ZGd&d�de�ZGd'd�dee�ZGd(d�dee�ZGd)d
�d
�Z Gd*d�de �Z!Gd+d,�d,e�Z"Gd-d�de �Z#dS).z0.4�N)�BufferedIOBase)�	monotonic�
BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�PollSelectorc@s�eZdZdZdd�Zdd�Zd%dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)&rNcCs ||_||_t��|_d|_dS�NF)�server_address�RequestHandlerClass�	threadingZEvent�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrr�r�$/usr/lib64/python3.8/socketserver.py�__init__�s
zBaseServer.__init__cCsdS�Nr�rrrr�server_activate�szBaseServer.server_activate��?c	Cst|j��zRt��B}|�|tj�|jsP|�|�}|jr:qP|rF|�	�|�
�q"W5QRXW5d|_|j��XdSr)r�clearr�set�_ServerSelector�register�	selectors�
EVENT_READ�select�_handle_request_noblock�service_actions)rZ
poll_interval�selector�readyrrr�
serve_forever�s

zBaseServer.serve_forevercCsd|_|j��dS�NT)rr�waitr"rrr�shutdown�szBaseServer.shutdowncCsdSr!rr"rrrr-�szBaseServer.service_actionsc
Cs�|j��}|dkr|j}n|jdk	r0t||j�}|dk	rBt�|}t��f}|�|tj�|�	|�}|rz|�
�W5QR�S|dk	rX|t�}|dkrX|��W5QR�SqXW5QRXdS)Nr)�socketZ
gettimeout�timeout�min�timer'r(r)r*r+r,�handle_timeout)rr5Zdeadliner.r/rrr�handle_requests 




zBaseServer.handle_requestcCs�z|��\}}Wntk
r&YdSX|�||�r�z|�||�Wq�tk
rn|�||�|�|�Yq�|�|��Yq�Xn
|�|�dSr!)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r�request�client_addressrrrr,/s

z"BaseServer._handle_request_noblockcCsdSr!rr"rrrr8FszBaseServer.handle_timeoutcCsdSr1rrArrrr<MszBaseServer.verify_requestcCs|�||�|�|�dSr!)�finish_requestr@rArrrr=UszBaseServer.process_requestcCsdSr!rr"rrr�server_close^szBaseServer.server_closecCs|�|||�dSr!)rrArrrrDfszBaseServer.finish_requestcCs|�|�dSr!��
close_request�rrBrrrr@jszBaseServer.shutdown_requestcCsdSr!rrHrrrrGnszBaseServer.close_requestcCs@tdtjd�td|tjd�ddl}|��tdtjd�dS)Nz(----------------------------------------)�filez4Exception happened during processing of request fromr)�print�sys�stderr�	traceback�	print_exc)rrBrCrMrrrr?rs�zBaseServer.handle_errorcCs|Sr!rr"rrr�	__enter__szBaseServer.__enter__cGs|��dSr!)rE)r�argsrrr�__exit__�szBaseServer.__exit__)r$)�__name__�
__module__�__qualname__r5r r#r0r3r-r9r,r8r<r=rErDr@rGr?rOrQrrrrr�s$-

	
c@sbeZdZejZejZdZdZ	ddd�Z
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�ZdS)r�FTcCsTt�|||�t�|j|j�|_|rPz|��|��Wn|���YnXdSr!)rr r4�address_family�socket_type�server_bindr#rE)rrrZbind_and_activaterrrr �s�zTCPServer.__init__cCs8|jr|j�tjtjd�|j�|j�|j��|_dS)N�)�allow_reuse_addressr4�
setsockoptZ
SOL_SOCKETZSO_REUSEADDRZbindrZgetsocknamer"rrrrX�szTCPServer.server_bindcCs|j�|j�dSr!)r4Zlisten�request_queue_sizer"rrrr#�szTCPServer.server_activatecCs|j��dSr!)r4�closer"rrrrE�szTCPServer.server_closecCs
|j��Sr!)r4�filenor"rrrr^�szTCPServer.filenocCs
|j��Sr!)r4Zacceptr"rrrr:�szTCPServer.get_requestcCs4z|�tj�Wntk
r$YnX|�|�dSr!)r3r4ZSHUT_WRr;rGrHrrrr@�s
zTCPServer.shutdown_requestcCs|��dSr!)r]rHrrrrG�szTCPServer.close_requestN)T)rRrSrTr4ZAF_INETrVZSOCK_STREAMrWr\rZr rXr#rEr^r:r@rGrrrrr�s/


c@s:eZdZdZejZdZdd�Zdd�Z	dd�Z
d	d
�ZdS)rFi cCs |j�|j�\}}||jf|fSr!)r4Zrecvfrom�max_packet_size)r�dataZclient_addrrrrr:szUDPServer.get_requestcCsdSr!rr"rrrr#szUDPServer.server_activatecCs|�|�dSr!rFrHrrrr@szUDPServer.shutdown_requestcCsdSr!rrHrrrrGszUDPServer.close_requestN)rRrSrTrZr4Z
SOCK_DGRAMrWr_r:r#r@rGrrrrrscsReZdZdZdZdZdZdd�dd�Zd	d
�Zdd�Z	d
d�Z
�fdd�Z�ZS)ri,N�(TF��blockingc	Cs�|jdkrdSt|j�|jkrvz t�dd�\}}|j�|�Wqtk
r\|j��Yqtk
rrYqvYqXq|j�	�D]f}z.|r�dntj
}t�||�\}}|j�|�Wq�tk
r�|j�|�Yq�tk
r�Yq�Xq�dS)N���r)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr%r;�copy�WNOHANG)rrc�pid�_�flagsrrr�collect_children(s&
zForkingMixIn.collect_childrencCs|��dSr!�rqr"rrrr8KszForkingMixIn.handle_timeoutcCs|��dSr!rrr"rrrr-RszForkingMixIn.service_actionscCs�t��}|r8|jdkrt�|_|j�|�|�|�dSd}z:z|�||�d}Wn t	k
rr|�
||�YnXW5z|�|�W5t�|�XXdS)NrYr)rhr
rer&�addrG�_exitr@rDr>r?)rrBrCrnZstatusrrrr=Ys 

zForkingMixIn.process_requestcst���|j|jd�dS)Nrb)�superrErq�block_on_closer"��	__class__rrrErs
zForkingMixIn.server_close)
rRrSrTr5rergrvrqr8r-r=rE�
__classcell__rrrwrrs#cs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	�_Threadscs"|��|jrdSt��|�dSr!)�reap�daemonru�append�r�threadrwrrr}{sz_Threads.appendcCsg|dd�|dd�<}|Sr!r)r�resultrrr�pop_all�sz_Threads.pop_allcCs|��D]}|��qdSr!)r��joinr~rrrr��sz
_Threads.joincCsdd�|D�|dd�<dS)Ncss|]}|��r|VqdSr!)Zis_alive)�.0rrrr�	<genexpr>�sz _Threads.reap.<locals>.<genexpr>rr"rrrr{�sz
_Threads.reap)rRrSrTr}r�r�r{ryrrrwrrzwsrzc@seZdZdd�Zdd�ZdS)�
_NoThreadscCsdSr!rr~rrrr}�sz_NoThreads.appendcCsdSr!rr"rrrr��sz_NoThreads.joinN)rRrSrTr}r�rrrrr��sr�cs:eZdZdZdZe�Zdd�Zdd�Z�fdd�Z	�Z
S)	rFTc	CsHz6z|�||�Wn tk
r2|�||�YnXW5|�|�XdSr!)r@rDr>r?rArrr�process_request_thread�s
z%ThreadingMixIn.process_request_threadcCsL|jrt|��dt��tj|j||fd�}|j|_|j	�
|�|��dS)N�_threads)�targetrP)rv�vars�
setdefaultrzrZThreadr��daemon_threadsr|r�r}�start)rrBrC�trrrr=�s�zThreadingMixIn.process_requestcst���|j��dSr!)rurEr�r�r"rwrrrE�s
zThreadingMixIn.server_close)rRrSrTr�rvr�r�r�r=rEryrrrwrr�s

c@seZdZdS)rN�rRrSrTrrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZejZdS)rN�rRrSrTr4rrVrrrrr�sc@seZdZejZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r	cCs6||_||_||_|��z|��W5|��XdSr!)rBrC�server�setup�finish�handle)rrBrCr�rrrr �szBaseRequestHandler.__init__cCsdSr!rr"rrrr��szBaseRequestHandler.setupcCsdSr!rr"rrrr��szBaseRequestHandler.handlecCsdSr!rr"rrrr��szBaseRequestHandler.finishN)rRrSrTr r�r�r�rrrrr	�s
c@s,eZdZdZdZdZdZdd�Zdd�ZdS)	r
rdrNFcCsz|j|_|jdk	r |j�|j�|jr:|j�tjtjd�|j�	d|j
�|_|jdkrdt
|j�|_n|j�	d|j�|_dS)NT�rbr�wb)rBZ
connectionr5Z
settimeout�disable_nagle_algorithmr[r4ZIPPROTO_TCPZTCP_NODELAYZmakefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler"rrrr�s

�
zStreamRequestHandler.setupcCsF|jjs.z|j��Wntjk
r,YnX|j��|j��dSr!)r��closed�flushr4�errorr]r�r"rrrr�#s
zStreamRequestHandler.finish)	rRrSrTr�r�r5r�r�r�rrrrr
s
c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCs
||_dSr!)�_sock)rZsockrrrr 3sz_SocketWriter.__init__cCsdSr1rr"rrr�writable6sz_SocketWriter.writablec
Cs2|j�|�t|��}|jW5QR�SQRXdSr!)r�Zsendall�
memoryview�nbytes)r�bZviewrrr�write9s
z_SocketWriter.writecCs
|j��Sr!)r�r^r"rrrr^>sz_SocketWriter.filenoN)rRrSrTr r�r�r^rrrrr�.sr�c@seZdZdd�Zdd�ZdS)rcCs2ddlm}|j\|_|_||j�|_|�|_dS)Nr)�BytesIO)�ior�rBZpacketr4r�r�)rr�rrrr�EszDatagramRequestHandler.setupcCs|j�|j��|j�dSr!)r4Zsendtor��getvaluerCr"rrrr�KszDatagramRequestHandler.finishN)rRrSrTr�r�rrrrrAs)$�__version__r4r)rhrKrr�rr7r�__all__�hasattr�extendrr'ZSelectSelectorrrrr�listrzr�rrrrrrrrrr	r
r�rrrrr�<module>{s`�

�
n~
X(.-pipes.cpython-38.opt-1.pyc000064400000017165151450073350011270 0ustar00U

e5d�"�@spdZddlZddlZddlZddlmZdgZdZdZdZ	dZ
d	Zd
Zeee	e
eegZ
Gdd�d�Zdd
�ZdS)a�Conversion pipeline templates.

The problem:
------------

Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format.  Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode).  Some of the conversion steps may require that their input
is a disk file, others may be able to read standard input; similar for
their output.  The input to the entire conversion may also be read
from a disk file or from an open file, and similar for its output.

The module lets you construct a pipeline template by sticking one or
more conversion steps together.  It will take care of creating and
removing temporary files if they are necessary to hold intermediate
data.  You can then use the template to do conversions from many
different sources to many different destinations.  The temporary
file names used are different each time the template is used.

The templates are objects so you can create templates for many
different conversion steps and store them in a dictionary, for
instance.


Directions:
-----------

To create a template:
    t = Template()

To add a conversion step to a template:
   t.append(command, kind)
where kind is a string of two characters: the first is '-' if the
command reads its standard input or 'f' if it requires a file; the
second likewise for the output. The command must be valid /bin/sh
syntax.  If input or output files are required, they are passed as
$IN and $OUT; otherwise, it must be  possible to use the command in
a pipeline.

To add a conversion step at the beginning:
   t.prepend(command, kind)

To convert a file to another file using a template:
  sts = t.copy(infile, outfile)
If infile or outfile are the empty string, standard input is read or
standard output is written, respectively.  The return value is the
exit status of the conversion pipeline.

To open a file for reading or writing through a conversion pipeline:
   fp = t.open(file, mode)
where mode is 'r' to read the file, or 'w' to write it -- just like
for the built-in function open() or for os.popen().

To create a new template object initialized to a given one:
   t2 = t.clone()
�N)�quote�TemplateZffz-fzf-�--z.-z-.c@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz'Class representing a pipeline template.cCsd|_|��dS)z-Template() returns a fresh pipeline template.rN)�	debugging�reset��self�r	�/usr/lib64/python3.8/pipes.py�__init__UszTemplate.__init__cCsd|jfS)z t.__repr__() implements repr(t).z<Template instance, steps=%r>��stepsrr	r	r
�__repr__ZszTemplate.__repr__cCs
g|_dS)z<t.reset() restores a pipeline template to its initial state.Nrrr	r	r
r^szTemplate.resetcCs"t�}|jdd�|_|j|_|S)zbt.clone() returns a new pipeline template with identical
        initial state as the current one.N)rr
r)r�tr	r	r
�clonebszTemplate.clonecCs
||_dS)z(t.debug(flag) turns debugging on or off.N)r)r�flagr	r	r
�debugjszTemplate.debugcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|dd	kr~t�d
|�s~td��|dd	kr�t�d|�s�td
��|j�	||f�dS)z/t.append(cmd, kind) adds a new step at the end.�z%Template.append: cmd must be a stringzTemplate.append: bad kind %rz-Template.append: SOURCE can only be prepended����z'Template.append: already ends with SINKr�f�\$IN\bz#Template.append: missing $IN in cmd�\$OUT\bz$Template.append: missing $OUT in cmdN)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append�r�cmd�kindr	r	r
r!nszTemplate.appendcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|ddkr~t�d	|�s~td
��|ddkr�t�d|�s�td��|j�	d||f�d
S)z2t.prepend(cmd, kind) adds a new step at the front.rz&Template.prepend: cmd must be a stringzTemplate.prepend: bad kind %rz+Template.prepend: SINK can only be appendedrrz,Template.prepend: already begins with SOURCErrz$Template.prepend: missing $IN in cmdrz%Template.prepend: missing $OUT in cmdN)
rrrrrr
rrr �insertr"r	r	r
�prepend~szTemplate.prependcCs6|dkr|�|�S|dkr$|�|�Std|f��dS)z~t.open(file, rw) returns a pipe or file object open for
        reading or writing; the file is the other end of the pipeline.�r�wz,Template.open: rw must be 'r' or 'w', not %rN)�open_r�open_wr)r�fileZrwr	r	r
�open�s

�z
Template.opencCsB|jst|d�S|jddtkr*td��|�|d�}t�|d�S)zit.open_r(file) and t.open_w(file) implement
        t.open(file, 'r') and t.open(file, 'w') respectively.r'rrz)Template.open_r: pipeline ends width SINKr)r
r,rr�makepipeline�os�popen�rr+r#r	r	r
r)�s
zTemplate.open_rcCsB|jst|d�S|jddtkr*td��|�d|�}t�|d�S)Nr(rrz,Template.open_w: pipeline begins with SOURCEr)r
r,rrr-r.r/r0r	r	r
r*�s
zTemplate.open_wcCst�|�||��S)N)r.�systemr-)r�infile�outfiler	r	r
�copy�sz
Template.copycCs(t||j|�}|jr$t|�d|}|S)Nzset -x; )r-r
r�print)rr2r3r#r	r	r
r-�s
zTemplate.makepipelineN)�__name__�
__module__�__qualname__�__doc__rrrrrr!r&r,r)r*r4r-r	r	r	r
rRs

cCs�g}|D]\}}|�d||dg�q|s:|�ddddg�|ddd�\}}|ddkrr|sr|�dddddg�||dd<|ddd�\}}|ddkr�|s�|�ddddg�||dd<g}tdt|��D]v}||dd	}||d	}	|ddk�s|	ddkr�t��\}
}t�|
�|�|�|||dd<||d<q�|D]�}|\}
}}}|ddk�r�d
t|�d|}|ddk�r�dt|
�d|}|dd
k�r�|
�r�|dt|
�}|dd
k�r�|�r�|dt|�}||d<�qN|dd}|dd�D]T}|dd�\}}|ddk�rTd|k�rFd|d}|d|}n|d|}�q|�r�d}|D]}|dt|�}�qrdt|d�d}|d|d|}|S)Nr�catrrr�rr�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15)	r!r%�range�len�tempfileZmkstempr.�closer)r2r
r3�listr#r$Zgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr+Ztrapcmdr	r	r
r-�s`


r-)r9rr.rBZshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr-r	r	r	r
�<module>s";�cprofile.cpython-38.opt-1.pyc000064400000034350151450073350011603 0ustar00U

e5d�[�@sxdZddlZddlZddlZddlZdddgZGdd�d�Zdd	d�Zdd
d�ZGdd�d�Z	dd
�Z
edkrte
�dS)z Class for profiling Python code.�N�run�runctx�Profilec@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Utilsz�Support class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    cCs
||_dS�N)�profiler)�selfr�r	�/usr/lib64/python3.8/profile.py�__init__0sz_Utils.__init__cCsF|��}z(z|�|�Wntk
r,YnXW5|�|||�XdSr)r�_showr�
SystemExit)r�	statement�filename�sort�profr	r	r
r3s
z
_Utils.runcCsJ|��}z,z|�|||�Wntk
r0YnXW5|�|||�XdSr)rrrr
)rr�globals�localsrrrr	r	r
r<s
z
_Utils.runctxcCs"|dk	r|�|�n
|�|�dSr)�
dump_stats�print_stats)rrrrr	r	r
rEsz_Utils._showN)�__name__�
__module__�__qualname__�__doc__rrrrr	r	r	r
r*s
		r���cCstt��|||�S)aRun statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    )rrr)rrrr	r	r
rQscCstt��|||||�S)z�Run statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    )rrr)rrrrrr	r	r
r^sc@s�eZdZdZdZd5dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ee
e
ee
e
d�Zdd�ZGdd�d�ZGdd�d�Zdd�Zdd �Zd6d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0e_d7d1d2�Zd3d4�ZdS)8raProfiler class.

    self.cur is always a tuple.  Each such tuple corresponds to a stack
    frame that is currently active (self.cur[-2]).  The following are the
    definitions of its members.  We use this external "parallel stack" to
    avoid contaminating the program that we are profiling. (old profiler
    used to write into the frames local dictionary!!) Derived classes
    can change the definition of some entries, as long as they leave
    [-2:] intact (frame and previous tuple).  In case an internal error is
    detected, the -3 element is used as the function name.

    [ 0] = Time that needs to be charged to the parent frame's function.
           It is used so that a function call will not have to access the
           timing data for the parent frame.
    [ 1] = Total time spent in this frame's function, excluding time in
           subfunctions (this latter is tallied in cur[2]).
    [ 2] = Total time spent in subfunctions, excluding time executing the
           frame's function (this latter is tallied in cur[1]).
    [-3] = Name of the function that corresponds to this frame.
    [-2] = Actual frame that we correspond to (used to sync exception handling).
    [-1] = Our parent 6-tuple (corresponds to frame.f_back).

    Timing data for each function is stored as a 5-tuple in the dictionary
    self.timings[].  The index is always the name stored in self.cur[-3].
    The following are the definitions of the members:

    [0] = The number of times this function was called, not counting direct
          or indirect recursion,
    [1] = Number of times this function appears on the stack, minus one
    [2] = Total time spent internal to this function
    [3] = Cumulative time that this function was present on the stack.  In
          non-recursive functions, this is the total execution time from start
          to finish of each invocation of a function, including time spent in
          all subfunctions.
    [4] = A dictionary indicating for each function name, the number of times
          it was called by us.
    rNcCs�i|_d|_d|_d|_|dkr&|j}||_|sHtj|_|_|j	|_
nl||_|��}zt|�}Wn"tk
r�||_|j	|_
Yn0X|dkr�|j
|_
n|j|_
|tfdd�}||_|��|_|�d�dS)N��cSs
||��Srr	)�timer�sumr	r	r
�get_time_timer�sz(Profile.__init__.<locals>.get_time_timerr)�timings�cur�cmd�c_func_name�bias�time�process_timer�get_time�trace_dispatch_i�
dispatcher�len�	TypeError�trace_dispatch�trace_dispatch_lr�t�
simulate_call)rrr$r.Zlengthrr	r	r
r�s0


zProfile.__init__cCs�|j}|�}|d|d|j|j}|dkr8|j|_|j||||�rd|�}|d|d|_n|�}|d|d||_dS)Nr��c_call�rr.r$rr#�dispatch)r�frame�event�argrr.�rr	r	r
r,�szProfile.trace_dispatchcCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dS�Nr1r2�rr4r5r6rr.r	r	r
r(�s
zProfile.trace_dispatch_icCs`|j}|�d|j|j}|dkr,|j|_|j||||�rL|�d|_n|�d||_dS)NgN@r1r2r9r	r	r
�trace_dispatch_mac�szProfile.trace_dispatch_maccCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dSr8)r'r.r$rr#r3)rr4r5r6r'r.r	r	r
r-�s
zProfile.trace_dispatch_lc	CsD|j\}}}}}}||k	r*|r*|�||�S|||||||f|_dS�Nr0)r!�trace_dispatch_return)	rr4r.�rpt�rit�ret�rfn�rframe�rcurr	r	r
�trace_dispatch_exception�s
z Profile.trace_dispatch_exceptioncCs�|jr@|j|jdk	r@|j\}}}}}}t|tj�s@|�|d�|j}	|	j|	j|	j	f}
|dd|
||jf|_|j
}|
|kr�||
\}}
}}}||
d|||f||
<nddddif||
<dS�N���rr0)r!�f_back�
isinstancer�
fake_framer<�f_code�co_filename�co_firstlineno�co_namer )rr4r.r=r>r?r@rArBZfcode�fnr �cc�ns�tt�ct�callersr	r	r
�trace_dispatch_callszProfile.trace_dispatch_callc
Csndd|jf}|dd|||jf|_|j}||krX||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr0)r#r!r )
rr4r.rMr rNrOrPrQrRr	r	r
�trace_dispatch_c_callszProfile.trace_dispatch_c_callcCs�||jdk	r |�|jdd�|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s�||}|d}||kr�||d||<nd||<||d||||f||<dSrD)r!r<r )rr4r.r=r>r?r@rBZframe_totalZpptZpitZpetZpfn�pframeZpcurr rNrOrPrQrRr	r	r
r<"s"zProfile.trace_dispatch_return)�callZ	exception�returnr1Zc_exceptionZc_returncCs"|jdrdS||_|�|�dS)Nr)r!r"r/)rr"r	r	r
�set_cmdXs
zProfile.set_cmdc@seZdZdd�Zdd�ZdS)zProfile.fake_codecCs||_||_||_d|_dS�Nr)rJ�co_linerLrK)rr�line�namer	r	r
r^szProfile.fake_code.__init__cCst|j|j|jf�Sr)�reprrJrZrL�rr	r	r
�__repr__dszProfile.fake_code.__repr__N)rrrrr_r	r	r	r
�	fake_code]sr`c@seZdZdd�ZdS)zProfile.fake_framecCs||_||_dSr)rIrF)r�codeZpriorr	r	r
rhszProfile.fake_frame.__init__N)rrrrr	r	r	r
rHgsrHcCsF|�dd|�}|jr |jd}nd}|�||�}|jd||d�dS)NZprofilerrErV)r`r!rHr3)rr\rarUr4r	r	r
r/lszProfile.simulate_callcCsJ|j}|�|j}|jdr:|jd||jd|�d}q|�||_dS)NrrWrEr)r'r.r!r3)rr'r.r	r	r
�simulate_cmd_completexs
zProfile.simulate_cmd_completercCs$ddl}|�|����|���dSrY)�pstatsZStatsZ
strip_dirsZ
sort_statsr)rrrcr	r	r
r�szProfile.print_statsc	Cs0t|d��}|��t�|j|�W5QRXdS)N�wb)�open�create_stats�marshal�dump�stats)r�file�fr	r	r
r�szProfile.dump_statscCs|��|��dSr)rb�snapshot_statsr^r	r	r
rf�szProfile.create_statsc	Cs^i|_|j��D]H\}\}}}}}|��}d}|��D]}||7}q6|||||f|j|<qdSrY)rir �items�copy�values)	r�funcrNrOrPrQrRZncZcallcntr	r	r
rl�s
zProfile.snapshot_statscCsddl}|j}|�|||�SrY)�__main__�__dict__r)rr"rq�dictr	r	r
r�szProfile.runc	Cs8|�|�t�|j�zt|||�W5t�d�X|Sr)rX�sys�
setprofiler)�exec)rr"rrr	r	r
r�s
zProfile.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|�t|��t�	|j
�z|||�W�St�	d�XdS)	Nrz:descriptor 'runcall' of 'Profile' object needs an argumentrprz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr0)r*r+�pop�warnings�warn�DeprecationWarningrXr]rtrur))�args�kwrrpryr	r	r
�runcall�s(

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs<|jtk	rtd��|j}d|_z|�||�W�S||_XdS)Nz&Subclasses must override .calibrate().r)�	__class__rr+r$�_calibrate_inner)r�m�verboseZ
saved_biasr	r	r
�	calibrate�s
zProfile.calibratecCs|j}dd�}|fdd�}||�|�}||�|�}||}|rLtd|�t�}	|�}|	�dt�t��|�}||}
|r�td|
�d}d}|	j��D]0\\}
}}\}}}}}|d	kr�||7}||7}q�|r�td
|�td|�||dkr�td
|��||d|}|�rtd|�|S)NcSst|�D]}d}qdSr;��range)�n�i�xr	r	r
�f1sz$Profile._calibrate_inner.<locals>.f1cSst|�D]}|d�qdS)N�dr�)r�r�r�r	r	r
rksz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rkr�z!'CPU seconds' profiler reported =ztotal # calls =r0z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r'�printrrrrr rm�
ValueError)rr�r�r'r�rkZt0�t1Zelapsed_noprofile�pZelapsed_profileZtotal_callsZ
reported_timerr[�funcnamerNrOrPrQrRZmeanr	r	r
r��sB

�



zProfile._calibrate_inner)NN)r)r)rrrrr$rr,r(r:r-rCrSrTr<r3rXr`rHr/rbrrrfrlrrr~�__text_signature__r�r�r	r	r	r
rgsB&
''�



+
c
Cs�ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddd�|jdddddd
�tjdd�s�|��t�d�|�	�\}}|tjdd�<|j
dk	r�|j�|j
�|_
t
|�dk�r�|jr�ddl}d}|j|dd�}nR|d}	tj�d|j�|	��t�|	��}
t|
��|	d�}W5QRX|	dddd�}zt||d|j
|j�Wn6tk
�r�}zdt_t�|j�W5d}~XYnXn|��|S)Nr)�OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-m�module�
store_truezProfile a library module.)r��actionr�r�z-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrr0rz(run_module(modname, run_name='__main__'))�
run_module�modnamervrq)�__file__r�__package__�
__cached__)�osZoptparser�Zallow_interspersed_argsZ
add_optionrt�argvZprint_usage�exit�
parse_argsr��path�abspathr*r��runpyr��insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)r�r�r��parserZoptionsr|r�raZglobsZprogname�fp�excr	r	r
�main9s^

�
�
�

�� r�rq)Nr)Nr)rr�rtr%rg�__all__rrrrr�rr	r	r	r
�<module>	s

'

	U9_pyio.cpython-38.opt-2.pyc000064400000143740151450073350011267 0ustar00U

e5d�k�@sxddlZddlZddlZddlZddlZddlZddlmZej	dkrTddl
mZndZddl
Z
ddl
mZmZmZmZdddhZeed�r�e�ej�e�ej�d	ZeZeed
�p�ejjZd6dd�Zdd�Zz
e
jZWnek
�r�eZYnXGdd�d�Z Gdd�d�Z!z
e
j"Z"Wn(ek
�rDGdd�de#e$�Z"YnXGdd�dej%d�Z&e
j&�'e&�Gdd�de&�Z(e
j(�'e(�ddl)m*Z*e(�'e*�Gdd�de&�Z+e
j+�'e+�Gd d!�d!e+�Z,Gd"d#�d#e+�Z-Gd$d%�d%e,�Z.Gd&d'�d'e,�Z/Gd(d)�d)e+�Z0Gd*d+�d+e/e.�Z1Gd,d-�d-e(�Z*Gd.d/�d/e&�Z2e
j2�'e2�Gd0d1�d1ej3�Z4Gd2d3�d3e2�Z5Gd4d5�d5e5�Z6dS)7�N)�
allocate_lock>�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END���	SEEK_HOLEi Zgettotalrefcount�r���Tc	Cs�t|t�st�|�}t|tttf�s0td|��t|t�sFtd|��t|t�s\td|��|dk	rzt|t�sztd|��|dk	r�t|t�s�td|��t|�}|td�s�t|�t|�kr�t	d|��d|k}	d|k}
d	|k}d
|k}d|k}
d|k}d
|k}d|k�rD|	�s"|�s"|�s"|
�r*t	d��ddl
}|�dtd�d}
|�rX|�rXt	d��|	|
||dk�rvt	d��|	�s�|
�s�|�s�|�s�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r|dk�rddl
}|�dt
d�t||	�rd�pd|
�r"d�p$d|�r2d	�p4d|�rBd
�pDd|
�rRd�pTd||d�}|}�z$d}|dk�s�|dk�r�|���r�d}d}|dk�r�t}zt�|���j}Wnttfk
�r�YnX|dk�r�|}|dk�r�t	d ��|dk�r|�r|WSt	d!��|
�r t||�}n<|	�s2|�s2|�r>t||�}n|
�rPt||�}nt	d"|��|}|�rl|WSt|||||�}|}||_|WS|���YnXdS)#Nzinvalid file: %rzinvalid mode: %rzinvalid buffering: %r�invalid encoding: %r�invalid errors: %rzaxrwb+tU�xr
�w�a�+�t�b�Uz4mode U cannot be combined with 'x', 'w', 'a', or '+'rz'U' mode is deprecatedrTz'can't have text and binary mode at oncer
z)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argumentzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used�)�openerFrzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)�
isinstance�int�os�fspath�str�bytes�	TypeError�set�len�
ValueError�warnings�warn�DeprecationWarning�RuntimeWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno�
st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader�
TextIOWrapper�mode�close)�filer4�	buffering�encoding�errors�newline�closefdrZmodesZcreatingZreadingZwritingZ	appendingZupdating�textZbinaryr$�raw�result�line_bufferingZbs�buffer�rA�/usr/lib64/python3.8/_pyio.py�open)s�{




�������



rCcCs ddl}|�dtd�t|d�S)Nrz(_pyio.open_code() may not be using hooksr�rb)r$r%r'rC)�pathr$rArArB�_open_code_with_warnings�rFc@seZdZddd�ZdS)�
DocDescriptorNcCs
dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)

)rC�__doc__)�self�obj�typrArArB�__get__s��zDocDescriptor.__get__)N)�__name__�
__module__�__qualname__rLrArArArBrGsrGc@seZdZe�Zdd�ZdS)�OpenWrappercOs
t||�S�N)rC)�cls�args�kwargsrArArB�__new__,szOpenWrapper.__new__N)rMrNrOrGrHrUrArArArBrP"srPc@seZdZdS)�UnsupportedOperationN)rMrNrOrArArArBrV5srVc@s�eZdZdd�Zd5dd�Zdd�Zd6d	d
�Zdd�Zd
Zdd�Z	dd�Z
dd�Zd7dd�Zdd�Z
d8dd�Zdd�Zd9dd�Zedd��Zd:d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd;d+d,�Zd-d.�Zd/d0�Zd<d1d2�Zd3d4�ZdS)=�IOBasecCstd|jj|f��dS)Nz%s.%s() not supported)rV�	__class__rM)rI�namerArArB�_unsupported\s
�zIOBase._unsupportedrcCs|�d�dS)N�seek�rZ�rI�pos�whencerArArBr[cszIOBase.seekcCs|�dd�S�Nrr
)r[�rIrArArB�tellsszIOBase.tellNcCs|�d�dS�N�truncater\�rIr^rArArBrdwszIOBase.truncatecCs|��dSrQ��_checkClosedrarArArB�flush�szIOBase.flushFcCs |jsz|��W5d|_XdS)NT)�_IOBase__closedrhrarArArBr5�szIOBase.closecCsVz
|j}Wntk
r YdSX|r*dStr8|��nz|��WnYnXdSrQ)�closedr/�_IOBASE_EMITS_UNRAISABLEr5)rIrjrArArB�__del__�s

zIOBase.__del__cCsdS�NFrArarArArB�seekable�szIOBase.seekablecCs |��st|dkrdn|��dS)NzFile or stream is not seekable.)rnrV�rI�msgrArArB�_checkSeekable�s��zIOBase._checkSeekablecCsdSrmrArarArArB�readable�szIOBase.readablecCs |��st|dkrdn|��dS)NzFile or stream is not readable.)rrrVrorArArB�_checkReadable�s��zIOBase._checkReadablecCsdSrmrArarArArB�writable�szIOBase.writablecCs |��st|dkrdn|��dS)NzFile or stream is not writable.)rtrVrorArArB�_checkWritable�s��zIOBase._checkWritablecCs|jSrQ)rirarArArBrj�sz
IOBase.closedcCs|jrt|dkrdn|��dS�N�I/O operation on closed file.�rjr#rorArArBrg�s��zIOBase._checkClosedcCs|��|SrQrfrarArArB�	__enter__�szIOBase.__enter__cGs|��dSrQ)r5)rIrSrArArB�__exit__�szIOBase.__exit__cCs|�d�dS)Nr,r\rarArArBr,�sz
IOBase.filenocCs|��dSrmrfrarArArBr)sz
IOBase.isattyrcs�t�d�r��fdd�}ndd�}�dkr0d�n4z
�j}Wn"tk
r\t��d���YnX|��t�}�dks~t|��kr���|��}|s�q�||7}|�d�rjq�qjt|�S)	N�peekcs>��d�}|sdS|�d�dp&t|�}�dkr:t|��}|S)Nr
�
r)r{�findr"�min)Z	readahead�n�rI�sizerArB�
nreadaheads

z#IOBase.readline.<locals>.nreadaheadcSsdS�Nr
rArArArArBr� sr� is not an integerrr|)	�hasattr�	__index__r/r �	bytearrayr"�read�endswithr)rIr�r��
size_index�resrrAr�rB�readlines&
	

zIOBase.readlinecCs|��|SrQrfrarArArB�__iter__5szIOBase.__iter__cCs|��}|st�|SrQ)r��
StopIteration�rI�linerArArB�__next__9szIOBase.__next__cCsP|dks|dkrt|�Sd}g}|D]&}|�|�|t|�7}||kr$qLq$|S�Nr)�list�appendr")rIZhintr�linesr�rArArB�	readlines?s
zIOBase.readlinescCs |��|D]}|�|�qdSrQ)rg�write)rIr�r�rArArB�
writelinesQszIOBase.writelines)r)N)N)N)N)N)r)N)rMrNrOrZr[rbrdrhrir5rlrnrqrrrsrtru�propertyrjrgryrzr,r)r�r�r�r�r�rArArArBrW9s4#







	

*
rW)�	metaclassc@s.eZdZddd�Zdd�Zdd�Zdd	�Zd
S)�	RawIOBasercCsP|dkrd}|dkr|��St|���}|�|�}|dkr>dS||d�=t|�S)Nrr)�readallr�r��readintor)rIr�rrrArArBr�ls

zRawIOBase.readcCs4t�}|�t�}|sq ||7}q|r,t|�S|SdSrQ)r�r�r*r)rIr��datarArArBr�}s

zRawIOBase.readallcCs|�d�dS)Nr�r\�rIrrArArBr��szRawIOBase.readintocCs|�d�dS�Nr�r\r�rArArBr��szRawIOBase.writeN)r)rMrNrOr�r�r�r�rArArArBr�^s
r�)r(c@sHeZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIOBasercCs|�d�dS�Nr�r\r�rArArBr��szBufferedIOBase.readcCs|�d�dS)N�read1r\r�rArArBr��szBufferedIOBase.read1cCs|j|dd�S)NF�r���	_readintor�rArArBr��szBufferedIOBase.readintocCs|j|dd�S)NTr�r�r�rArArB�	readinto1�s	zBufferedIOBase.readinto1cCsVt|t�st|�}|�d�}|r0|�t|��}n|�t|��}t|�}||d|�<|S�N�B)r�
memoryview�castr�r"r�)rIrr�r�rrArArBr��s

zBufferedIOBase._readintocCs|�d�dSr�r\r�rArArBr��s	zBufferedIOBase.writecCs|�d�dS�N�detachr\rarArArBr��szBufferedIOBase.detachN)r)r)
rMrNrOr�r�r�r�r�r�r�rArArArBr��s

r�c@s�eZdZdd�Zd#dd�Zdd�Zd$d	d
�Zdd�Zd
d�Zdd�Z	dd�Z
edd��Zedd��Z
edd��Zedd��Zdd�Zdd�Zdd �Zd!d"�ZdS)%�_BufferedIOMixincCs
||_dSrQ��_raw�rIr=rArArB�__init__sz_BufferedIOMixin.__init__rcCs"|j�||�}|dkrtd��|S)Nrz#seek() returned an invalid position)r=r[r.)rIr^r_Znew_positionrArArBr[sz_BufferedIOMixin.seekcCs|j��}|dkrtd��|S)Nrz#tell() returned an invalid position)r=rbr.rerArArBrbs
z_BufferedIOMixin.tellNcCs$|��|dkr|��}|j�|�SrQ)rhrbr=rdrerArArBrd$sz_BufferedIOMixin.truncatecCs|jrtd��|j��dS)N�flush on closed file)rjr#r=rhrarArArBrh2sz_BufferedIOMixin.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r=rjr5rhrarArArBr57sz_BufferedIOMixin.closecCs*|jdkrtd��|��|j}d|_|S)Nzraw stream already detached)r=r#rhr�r�rArArBr�?s
z_BufferedIOMixin.detachcCs
|j��SrQ)r=rnrarArArBrnIsz_BufferedIOMixin.seekablecCs|jSrQr�rarArArBr=Lsz_BufferedIOMixin.rawcCs|jjSrQ)r=rjrarArArBrjPsz_BufferedIOMixin.closedcCs|jjSrQ)r=rYrarArArBrYTsz_BufferedIOMixin.namecCs|jjSrQ)r=r4rarArArBr4Xsz_BufferedIOMixin.modecCstd|jj�d���dS�Nzcannot pickle z object�r rXrMrarArArB�__getstate__\sz_BufferedIOMixin.__getstate__cCsN|jj}|jj}z
|j}Wn tk
r:d�||�YSXd�|||�SdS)Nz<{}.{}>z<{}.{} name={!r}>)rXrNrOrYr/�format)rI�modnameZclsnamerYrArArB�__repr___s
z_BufferedIOMixin.__repr__cCs
|j��SrQ)r=r,rarArArBr,ksz_BufferedIOMixin.filenocCs
|j��SrQ)r=r)rarArArBr)nsz_BufferedIOMixin.isatty)r)N)rMrNrOr�r[rbrdrhr5r�rnr�r=rjrYr4r�r�r,r)rArArArBr�
s(	






r�cs�eZdZdZd dd�Zdd�Zdd�Zdd	�Z�fd
d�Zd!d
d�Z	d"dd�Z
dd�Zd#dd�Zdd�Z
d$dd�Zdd�Zdd�Zdd�Z�ZS)%�BytesIONcCs&t�}|dk	r||7}||_d|_dSr�)r��_buffer�_pos)rIZ
initial_bytes�bufrArArBr�zs
zBytesIO.__init__cCs|jrtd��|j��S)Nz__getstate__ on closed file)rjr#�__dict__�copyrarArArBr��szBytesIO.__getstate__cCs|jrtd��t|j�S)Nzgetvalue on closed file)rjr#rr�rarArArB�getvalue�szBytesIO.getvaluecCs|jrtd��t|j�S)Nzgetbuffer on closed file)rjr#r�r�rarArArB�	getbuffer�szBytesIO.getbuffercs"|jdk	r|j��t���dSrQ)r��clear�superr5ra�rXrArBr5�s

z
BytesIO.closercCs�|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|dkrbt|j�}t|j�|jkrvdStt|j�|j|�}|j|j|�}||_t	|�S)N�read from closed filerr�r�)
rjr#r�r/r r"r�r�r~r)rIr�r�ZnewposrrArArBr��s"

zBytesIO.readcCs
|�|�SrQ)r�r�rArArBr��sz
BytesIO.read1c	Cs�|jrtd��t|t�r td��t|��}|j}W5QRX|dkrFdS|j}|t|j	�krzd|t|j	�}|j	|7_	||j	|||�<|j|7_|S)N�write to closed file� can't write str to binary streamr�)
rjr#rrr r��nbytesr�r"r�)rIrZviewrr^ZpaddingrArArBr��s

z
BytesIO.writercCs�|jrtd��z
|j}Wn"tk
r:t|�d���YnX|�}|dkrh|dkr`td|f��||_nD|dkr�td|j|�|_n(|dkr�tdt|j�|�|_ntd��|jS)Nzseek on closed filer�r�negative seek position %rr
rzunsupported whence value)	rjr#r�r/r r��maxr"r�)rIr^r_�	pos_indexrArArBr[�s"
zBytesIO.seekcCs|jrtd��|jS)N�tell on closed file)rjr#r�rarArArBrb�szBytesIO.tellcCsx|jrtd��|dkr|j}nJz
|j}Wn"tk
rJt|�d���YnX|�}|dkrhtd|f��|j|d�=|S)Nztruncate on closed filer�rznegative truncate position %r)rjr#r�r�r/r r�)rIr^r�rArArBrd�s
zBytesIO.truncatecCs|jrtd��dS�NrwTrxrarArArBrr�szBytesIO.readablecCs|jrtd��dSr�rxrarArArBrt�szBytesIO.writablecCs|jrtd��dSr�rxrarArArBrn�szBytesIO.seekable)N)r)r)r)N)rMrNrOr�r�r�r�r�r5r�r�r�r[rbrdrrrtrn�
__classcell__rArAr�rBr�rs




r�c@steZdZefdd�Zdd�Zdd�Zddd	�Zdd
d�Zdd
d�Z	ddd�Z
ddd�Zdd�Zdd�Z
ddd�ZdS) r2cCsF|��std��t�||�|dkr,td��||_|��t�|_dS)Nz "raw" argument must be readable.r�invalid buffer size)	rrr.r�r�r#�buffer_size�_reset_read_buf�Lock�
_read_lock�rIr=r�rArArBr�szBufferedReader.__init__cCs
|j��SrQ)r=rrrarArArBrrszBufferedReader.readablecCsd|_d|_dS)Nr�r)�	_read_buf�	_read_posrarArArBr�szBufferedReader._reset_read_bufNc
Cs@|dk	r|dkrtd��|j�|�|�W5QR�SQRXdS)Nrzinvalid number of bytes to read)r#r��_read_unlockedr�rArArBr� szBufferedReader.readcCs�d}d}|j}|j}|dks$|dkr�|��t|jd�rj|j��}|dkrZ||d�pXdS||d�|S||d�g}d}|j��}||kr�|}q�|t|�7}|�|�q|d�	|�p�|St|�|}	||	kr�|j|7_||||�S||d�g}t
|j|�}
|	|k�rH|j�|
�}||k�r.|}�qH|	t|�7}	|�|��qt||	�}d�	|�}||d�|_d|_|�r�|d|�S|S)Nr�)r�Nrr�r)
r�r�r�r�r=r�r�r"r��joinr�r�r~)rIrZ
nodata_valZempty_valuesr�r^�chunkZchunksZcurrent_size�availZwanted�outrArArBr�-sL





zBufferedReader._read_unlockedrc
Cs(|j�|�|�W5QR�SQRXdSrQ)r��_peek_unlockedr�rArArBr{aszBufferedReader.peekcCsrt||j�}t|j�|j}||ks,|dkrb|j|}|j�|�}|rb|j|jd�||_d|_|j|jd�Sr�)r~r�r"r�r�r=r�)rIrZwantZhaveZto_readZcurrentrArArBr�ks
zBufferedReader._peek_unlockedrc
Cs^|dkr|j}|dkrdS|j�4|�d�|�t|t|j�|j��W5QR�SQRXdS)Nrr�r
)r�r�r�r�r~r"r�r�r�rArArBr�vs
�zBufferedReader.read1c	Cs
t|t�st|�}|jdkr dS|�d�}d}|j��|t|�kr�tt|j�|jt|��}|r�|j|j|j|�||||�<|j|7_||7}|t|�kr�q�t|�||j	kr�|j
�||d��}|s�q�||7}n|r�|s�|�d�s�q�|r6|r6q�q6W5QRX|S)Nrr�r
)
rr�r�r�r�r"r~r�r�r�r=r�r�)rIr�r��writtenr�rrArArBr��s6


�

zBufferedReader._readintocCst�|�t|j�|jSrQ)r�rbr"r�r�rarArArBrb�szBufferedReader.tellc
Csd|tkrtd��|j�D|dkr4|t|j�|j8}t�|||�}|��|W5QR�SQRXdS)N�invalid whence valuer
)	�valid_seek_flagsr#r�r"r�r�r�r[r�r]rArArBr[�szBufferedReader.seek)N)N)r)r)r)r)rMrNrOr*r�rrr�r�r�r{r�r�r�rbr[rArArArBr2s


4



.r2c@s\eZdZefdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
ddd�Zdd�ZdS)r1cCsF|��std��t�||�|dkr,td��||_t�|_t�|_	dS)Nz "raw" argument must be writable.rr�)
rtr.r�r�r#r�r��
_write_bufr��_write_lockr�rArArBr��szBufferedWriter.__init__cCs
|j��SrQ)r=rtrarArArBrt�szBufferedWriter.writablecCst|t�rtd��|j��|jr(td��t|j�|jkr@|�	�t|j�}|j�
|�t|j�|}t|j�|jkr�z|�	�Wnltk
r�}zNt|j�|jkr�t|j�|j}||8}|jd|j�|_t|j|j
|��W5d}~XYnX|W5QR�SQRXdS)Nr�r�)rrr r�rjr#r"r�r��_flush_unlocked�extend�BlockingIOError�errno�strerror)rIrZbeforer��eZoveragerArArBr��s(

"zBufferedWriter.writeNc
CsD|j�4|��|dkr"|j��}|j�|�W5QR�SQRXdSrQ)r�r�r=rbrdrerArArBrd�s

zBufferedWriter.truncatec	Cs|j�|��W5QRXdSrQ)r�r�rarArArBrh�szBufferedWriter.flushcCs�|jrtd��|jr�z|j�|j�}Wntk
rBtd��YnX|dkrZttjdd��|t	|j�ksp|dkrxt
d��|jd|�=qdS)Nr�zHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes)rjr#r�r=r�r��RuntimeErrorr�ZEAGAINr"r.�rIrrArArBr�s �zBufferedWriter._flush_unlockedcCst�|�t|j�SrQ)r�rbr"r�rarArArBrbszBufferedWriter.tellrc
CsD|tkrtd��|j�$|��t�|||�W5QR�SQRXdS)Nr�)r�r#r�r�r�r[r]rArArBr[s
zBufferedWriter.seekcCs`|j�$|jdks|jr&W5QR�dSW5QRXz|��W5|j�|j��W5QRXXdSrQ)r�r=rjr5rhrarArArBr5szBufferedWriter.close)N)r)
rMrNrOr*r�rtr�rdrhr�rbr[r5rArArArBr1�s	

r1c@s�eZdZefdd�Zddd�Zdd�Zdd	�Zddd�Zd d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��ZdS)!�BufferedRWPaircCs<|��std��|��s td��t||�|_t||�|_dS)Nz#"reader" argument must be readable.z#"writer" argument must be writable.)rrr.rtr2�readerr1�writer)rIr�r�r�rArArBr�<szBufferedRWPair.__init__rcCs|dkrd}|j�|�S�Nr)r�r�r�rArArBr�JszBufferedRWPair.readcCs|j�|�SrQ)r�r�r�rArArBr�OszBufferedRWPair.readintocCs|j�|�SrQ)r�r�r�rArArBr�RszBufferedRWPair.writercCs|j�|�SrQ)r�r{r�rArArBr{UszBufferedRWPair.peekcCs|j�|�SrQ)r�r�r�rArArBr�XszBufferedRWPair.read1cCs|j�|�SrQ)r�r�r�rArArBr�[szBufferedRWPair.readinto1cCs
|j��SrQ)r�rrrarArArBrr^szBufferedRWPair.readablecCs
|j��SrQ)r�rtrarArArBrtaszBufferedRWPair.writablecCs
|j��SrQ)r�rhrarArArBrhdszBufferedRWPair.flushcCs z|j��W5|j��XdSrQ)r�r5r�rarArArBr5gszBufferedRWPair.closecCs|j��p|j��SrQ)r�r)r�rarArArBr)mszBufferedRWPair.isattycCs|jjSrQ)r�rjrarArArBrjpszBufferedRWPair.closedN)r)r)r)rMrNrOr*r�r�r�r�r{r�r�rrrtrhr5r)r�rjrArArArBr�,s


r�c@sjeZdZefdd�Zddd�Zdd�Zdd	d
�Zddd�Zd
d�Z	ddd�Z
ddd�Zdd�Zdd�Z
dS)r0cCs(|��t�|||�t�|||�dSrQ)rqr2r�r1r�rArArBr�~szBufferedRandom.__init__rc	Cs�|tkrtd��|��|jrJ|j� |j�|jt|j�d�W5QRX|j�||�}|j�|�	�W5QRX|dkr�t
d��|S)Nr�r
rz seek() returned invalid position)r�r#rhr�r�r=r[r�r"r�r.r]rArArBr[�s$zBufferedRandom.seekcCs|jrt�|�St�|�SdSrQ)r�r1rbr2rarArArBrb�s
zBufferedRandom.tellNcCs|dkr|��}t�||�SrQ)rbr1rdrerArArBrd�szBufferedRandom.truncatecCs |dkrd}|��t�||�Sr�)rhr2r�r�rArArBr��szBufferedRandom.readcCs|��t�||�SrQ)rhr2r�r�rArArBr��szBufferedRandom.readintocCs|��t�||�SrQ)rhr2r{r�rArArBr{�szBufferedRandom.peekrcCs|��t�||�SrQ)rhr2r�r�rArArBr��szBufferedRandom.read1cCs|��t�||�SrQ)rhr2r�r�rArArBr��szBufferedRandom.readinto1c	CsF|jr:|j�(|j�|jt|j�d�|��W5QRXt�||�Sr�)	r�r�r=r[r�r"r�r1r�r�rArArBr��s
zBufferedRandom.write)r)N)N)r)r)rMrNrOr*r�r[rbrdr�r�r{r�r�r�rArArArBr0us	




r0cs�eZdZdZdZdZdZdZdZdZ	d0dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zd1dd�Zd2dd�Zdd�Zdd�Zdd�Zefdd�Zdd�Zd3dd�Z�fd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zed,d-��Zed.d/��Z �Z!S)4r(rFNTr
c
CsB|jdkr*z|jrt�|j�W5d|_Xt|t�r<td��t|t�r\|}|dkr`td��nd}t|t	�sxtd|f��t
|�t
d�ks�td|f��tdd�|D��d	ks�|�d
�d	kr�td��d|kr�d
|_
d
|_tjtjB}nTd|kr�d
|_d}n@d|k�rd
|_tjtjB}n"d|k�r8d
|_d
|_tjtjB}d
|k�rNd
|_d
|_|j�rj|j�rj|tjO}n|j�r~|tjO}n
|tjO}|ttdd�O}ttdd��p�ttdd�}||O}d}�zT|dk�r:|�s�td��|dk�r�t�||d�}n0|||�}t|t��std��|dk�r$td��|}|�s:t�|d�||_t�|�}	z(t�|	j��rpt t!j"t�#t!j"�|��Wnt$k
�r�YnXt|	dd�|_%|j%d	k�r�t&|_%t'�r�t'|tj(�||_)|j�rzt�*|dt+�Wn4tk
�r}
z|
j!t!j,k�r�W5d}
~
XYnXWn"|dk	�r0t�|��YnX||_dS)Nrrz$integer argument expected, got floatznegative file descriptorzinvalid mode: %szxrwab+css|]}|dkVqdS)ZrwaxNrA)�.0�crArArB�	<genexpr>�sz"FileIO.__init__.<locals>.<genexpr>r
rzKMust have exactly one of create/read/write/append mode and at most one plusrTr
rr�O_BINARYZO_NOINHERIT�	O_CLOEXECz'Cannot use closefd=False with file namei�zexpected integer from openerzNegative file descriptorFr-)-�_fd�_closefdrr5r�floatr rr#rr!�sum�count�_created�	_writable�O_EXCL�O_CREAT�	_readable�O_TRUNC�
_appending�O_APPEND�O_RDWR�O_RDONLY�O_WRONLY�getattrrCr.�set_inheritabler+�stat�S_ISDIR�st_mode�IsADirectoryErrorr�ZEISDIRr�r/�_blksizer*�_setmoder�rY�lseekr	ZESPIPE)rIr6r4r;r�fd�flagsZnoinherit_flagZowned_fdZfdfstatr�rArArBr��s�




$




�





�

zFileIO.__init__cCsB|jdkr>|jr>|js>ddl}|jd|ftd|d�|��dS)Nrzunclosed file %rr)�
stacklevel�source)r�r�rjr$r%�ResourceWarningr5)rIr$rArArBrlAs�zFileIO.__del__cCstd|jj�d���dSr�r�rarArArBr�HszFileIO.__getstate__cCspd|jj|jjf}|jr"d|Sz
|j}Wn*tk
rVd||j|j|jfYSXd|||j|jfSdS)Nz%s.%sz
<%s [closed]>z<%s fd=%d mode=%r closefd=%r>z<%s name=%r mode=%r closefd=%r>)	rXrNrOrjrYr/r�r4r�)rI�
class_namerYrArArBr�Ks�
�
�zFileIO.__repr__cCs|jstd��dS)NzFile not open for reading)r�rVrarArArBrsYszFileIO._checkReadablecCs|jstd��dS)NzFile not open for writing)r�rVrorArArBru]szFileIO._checkWritablecCsT|��|��|dks |dkr(|��Szt�|j|�WStk
rNYdSXdSr�)rgrsr�rr�r�r�r�rArArBr�aszFileIO.readcCs�|��|��t}z6t�|jdt�}t�|j�j}||krH||d}Wnt	k
r^YnXt
�}t|�|kr�t|�}|t|t�7}|t|�}zt�
|j|�}Wntk
r�|r�Yq�YdSX|s�q�||7}qft|�Sr`)rgrsr*rr
r�rr+�st_sizer.r�r"r�r�r�r)rI�bufsizer^�endr>rr�rArArBr�qs2
zFileIO.readallcCs4t|��d�}|�t|��}t|�}||d|�<|Sr�)r�r�r�r")rIr�mr�rrArArBr��s
zFileIO.readintocCs<|��|��zt�|j|�WStk
r6YdSXdSrQ)rgrurr�r�r�r�rArArBr��szFileIO.writecCs*t|t�rtd��|��t�|j||�S)Nzan integer is required)rr�r rgrr
r�r]rArArBr[�s
zFileIO.seekcCs|��t�|jdt�Sr�)rgrr
r�rrarArArBrb�szFileIO.tellcCs2|��|��|dkr |��}t�|j|�|SrQ)rgrurbr�	ftruncater�r�rArArBrd�szFileIO.truncatecs.|js*z|jrt�|j�W5t���XdSrQ)rjr�r5r�rr�rar�rArBr5�s
zFileIO.closecCsF|��|jdkr@z|��Wntk
r8d|_YnXd|_|jS)NFT)rg�	_seekablerbr.rarArArBrn�s
zFileIO.seekablecCs|��|jSrQ)rgr�rarArArBrr�szFileIO.readablecCs|��|jSrQ)rgr�rarArArBrt�szFileIO.writablecCs|��|jSrQ)rgr�rarArArBr,�sz
FileIO.filenocCs|��t�|j�SrQ)rgrr)r�rarArArBr)�sz
FileIO.isattycCs|jSrQ)r�rarArArBr;�szFileIO.closefdcCsJ|jr|jrdSdSn0|jr,|jr&dSdSn|jrB|jr<dSdSndSdS)Nzxb+Zxbzab+Zabzrb+rD�wb)r�r�rr�rarArArBr4szFileIO.mode)r
TN)N)N)N)"rMrNrOr�r�r�r�rrr�r�rlr�r�rsrur�r�r�r�rr[rbrdr5rnrrrtr,r)r�r;r4r�rArAr�rBr(�s<
y

#



r(c@s\eZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zed
d��Z	edd��Z
edd��ZdS)�
TextIOBasercCs|�d�dSr�r\r�rArArBr�szTextIOBase.readcCs|�d�dSr�r\)rI�srArArBr�(szTextIOBase.writeNcCs|�d�dSrcr\rerArArBrd,szTextIOBase.truncatecCs|�d�dS)Nr�r\rarArArBr�0szTextIOBase.readlinecCs|�d�dSr�r\rarArArBr�7szTextIOBase.detachcCsdSrQrArarArArBr8@szTextIOBase.encodingcCsdSrQrArarArArB�newlinesEszTextIOBase.newlinescCsdSrQrArarArArBr9OszTextIOBase.errors)r)N)rMrNrOr�r�rdr�r�r�r8rr9rArArArBrs


	

	rc@sPeZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
ZdZ	dZ
edd��ZdS)�IncrementalNewlineDecoder�strictcCs,tjj||d�||_||_d|_d|_dS)N)r9rF)�codecs�IncrementalDecoderr��	translate�decoder�seennl�	pendingcr)rIr#r"r9rArArBr�`s
z"IncrementalNewlineDecoder.__init__FcCs�|jdkr|}n|jj||d�}|jr<|s.|r<d|}d|_|�d�r\|s\|dd�}d|_|�d�}|�d�|}|�d�|}|j|o�|j|o�|jB|o�|jBO_|j	r�|r�|�
dd�}|r�|�
dd�}|S)N��final�
FrT�
�
)r#�decoder%r�r�r$�_LF�_CR�_CRLFr"�replace)rI�inputr'�outputZcrlfZcrZlfrArArBr+gs*

�z IncrementalNewlineDecoder.decodecCs@|jdkrd}d}n|j��\}}|dK}|jr8|dO}||fS)Nr�rr
)r#�getstater%)rIr��flagrArArBr2�s
z"IncrementalNewlineDecoder.getstatecCs8|\}}t|d@�|_|jdk	r4|j�||d?f�dSr�)�boolr%r#�setstate)rI�stater�r3rArArBr5�s
z"IncrementalNewlineDecoder.setstatecCs$d|_d|_|jdk	r |j��dS)NrF)r$r%r#�resetrarArArBr7�s
zIncrementalNewlineDecoder.resetr
r�cCs
d|jS)N)Nr*r()r(r*r))r*r))r(r))r(r*r))r$rarArArBr�s�z"IncrementalNewlineDecoder.newlinesN)r)F)
rMrNrOr�r+r2r5r7r,r-r.r�rrArArArBrYs

rc@sreZdZdZdZdNdd�Zdd�ZdOdd	�Zd
d�Ze	dd
��Z
e	dd��Ze	dd��Ze	dd��Z
e	dd��Zddeddd�dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Ze	d#d$��Ze	d%d&��Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�ZdPd3d4�Zd5d6�Zd7d8�Z dQd:d;�Z!d<d=�Z"d>d?�Z#dRd@dA�Z$dBdC�Z%dSdDdE�Z&dTdFdG�Z'dHdI�Z(dUdJdK�Z)e	dLdM��Z*dS)Vr3iNFc		Cs|�|�|dkrvzt�|���}Wnttfk
r<YnX|dkrvzddl}Wntk
rjd}YnX|�d�}t	|t
�s�td|��t�
|�js�d}t||��|dkr�d}nt	|t
�s�td|��||_d|_d|_d|_|j��|_|_t|jd	�|_|�|||||�dS)
Nr�asciiFrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsrrrr�)�_check_newliner�device_encodingr,r/rV�locale�ImportErrorZgetpreferredencodingrrr#r �lookup�_is_text_encoding�LookupErrorr��_decoded_chars�_decoded_chars_used�	_snapshotr@rnr�_tellingr��
_has_read1�
_configure)	rIr@r8r9r:r?�
write_throughr<rprArArBr��s>





�zTextIOWrapper.__init__cCs>|dk	r$t|t�s$tdt|�f��|dkr:td|f��dS)Nzillegal newline type: %r)Nrr*r(r)zillegal newline value: %r)rrr �typer#)rIr:rArArBr:�szTextIOWrapper._check_newlinecCs�||_||_d|_d|_d|_||_|dk|_||_|dk|_|pHt	j
|_||_||_
|jr�|��r�|j��}|dkr�z|���d�Wntk
r�YnXdS)N�rr)�	_encoding�_errors�_encoder�_decoder�	_b2cratio�_readuniversal�_readtranslate�_readnl�_writetranslater�linesep�_writenl�_line_buffering�_write_throughrrtr@rb�_get_encoderr5r@)rIr8r9r:r?rG�positionrArArBrF�s&


zTextIOWrapper._configurecCs�d�|jj|jj�}z
|j}Wntk
r2YnX|d�|�7}z
|j}Wntk
r`YnX|d�|�7}|d�|j�S)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)r�rXrNrOrYr/r4r8)rIr>rYr4rArArBr�!s
�

zTextIOWrapper.__repr__cCs|jSrQ)rJrarArArBr82szTextIOWrapper.encodingcCs|jSrQ)rKrarArArBr96szTextIOWrapper.errorscCs|jSrQ)rUrarArArBr?:szTextIOWrapper.line_bufferingcCs|jSrQ)rVrarArArBrG>szTextIOWrapper.write_throughcCs|jSrQ)r�rarArArBr@BszTextIOWrapper.buffer)r8r9r:r?rGcCs�|jdk	r*|dk	s"|dk	s"|tk	r*td��|dkrH|dkrB|j}q^d}nt|t�s^td|��|dkrn|j}nt|t�s�td|��|tkr�|j}|�	|�|dkr�|j
}|dkr�|j}|��|�
|||||�dS)NzPIt is not possible to set the encoding or newline of stream after the first readrrr)rM�EllipsisrVrKrrr rJrQr:r?rGrhrF)rIr8r9r:r?rGrArArB�reconfigureFs@
����



�zTextIOWrapper.reconfigurecCs|jrtd��|jSrv)rjr#rrarArArBrnoszTextIOWrapper.seekablecCs
|j��SrQ)r@rrrarArArBrrtszTextIOWrapper.readablecCs
|j��SrQ)r@rtrarArArBrtwszTextIOWrapper.writablecCs|j��|j|_dSrQ)r@rhrrDrarArArBrhzs
zTextIOWrapper.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r@rjr5rhrarArArBr5~szTextIOWrapper.closecCs|jjSrQ)r@rjrarArArBrj�szTextIOWrapper.closedcCs|jjSrQ)r@rYrarArArBrY�szTextIOWrapper.namecCs
|j��SrQ)r@r,rarArArBr,�szTextIOWrapper.filenocCs
|j��SrQ)r@r)rarArArBr)�szTextIOWrapper.isattycCs�|jrtd��t|t�s(td|jj��t|�}|js<|j	oBd|k}|rf|jrf|j
dkrf|�d|j
�}|jpr|�
�}|�|�}|j�|�|j	r�|s�d|kr�|��|�d�d|_|jr�|j��|S)Nr�zcan't write %s to text streamr*r(r)rjr#rrr rXrMr"rRrUrTr/rLrW�encoder@r�rh�_set_decoded_charsrCrMr7)rIrZlengthZhaslf�encoderrrArArBr��s(
�


zTextIOWrapper.writecCst�|j�}||j�|_|jSrQ)r �getincrementalencoderrJrKrL)rIZmake_encoderrArArBrW�szTextIOWrapper._get_encodercCs2t�|j�}||j�}|jr(t||j�}||_|SrQ)r �getincrementaldecoderrJrKrOrrPrM)rIZmake_decoderr#rArArB�_get_decoder�s
zTextIOWrapper._get_decodercCs||_d|_dSr�)rArB)rI�charsrArArBr\�sz TextIOWrapper._set_decoded_charscCsF|j}|dkr|j|d�}n|j|||�}|jt|�7_|SrQ)rBrAr")rIr�offsetrarArArB�_get_decoded_chars�sz TextIOWrapper._get_decoded_charscCs$|j|krtd��|j|8_dS)Nz"rewind decoded_chars out of bounds)rB�AssertionErrorr�rArArB�_rewind_decoded_chars�s
z#TextIOWrapper._rewind_decoded_charscCs�|jdkrtd��|jr&|j��\}}|jr<|j�|j�}n|j�|j�}|}|j�	||�}|�
|�|r�t|�t|j�|_
nd|_
|jr�|||f|_|S)Nz
no decoderrI)rMr#rDr2rEr@r��_CHUNK_SIZEr�r+r\r"rArNrC)rI�
dec_buffer�	dec_flags�input_chunk�eofZ
decoded_charsrArArB�_read_chunk�s 

zTextIOWrapper._read_chunkrcCs(||d>B|d>B|d>Bt|�d>BS)N�@���)r4)rIrXrh�
bytes_to_feed�need_eof�
chars_to_skiprArArB�_pack_cookie�s
�
�zTextIOWrapper._pack_cookiecCsFt|d�\}}t|d�\}}t|d�\}}t|d�\}}|||||fS)Nl)�divmod)rIZbigint�restrXrhrprqrrrArArB�_unpack_cookie	s
zTextIOWrapper._unpack_cookiec	Cs@|jstd��|jstd��|��|j��}|j}|dksF|jdkrX|j	rTt
d��|S|j\}}|t|�8}|j}|dkr�|�
||�S|��}�z�t|j|�}d}|dk�r"|�d|f�t|�|d|���}	|	|k�r|��\}
}|
s�|}||	8}�q4|t|
�8}d}q�||8}|d}q�d}|�d|f�||}|}
|dk�rZ|�
||
�W��Sd}d}d}t|t|��D]x}|d7}|t|�|||d���7}|��\}}|�s�||k�r�||7}||8}|dd}
}}||k�rt�q�qt|t|jddd	��7}d}||k�rtd
��|�
||
|||�W�S|�|�XdS)N�!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrr
r�rTr&z'can't reconstruct logical file position)rrVrDr.rhr@rbrMrCrArdr"rBrsr2r5rrNr+�range)rIrXr#rhZ
next_inputrrZsaved_stateZ
skip_bytesZ	skip_backrr�d�	start_posZstart_flagsZ	bytes_fedrqZ
chars_decoded�irgrArArBrb
	s�








�zTextIOWrapper.tellcCs$|��|dkr|��}|j�|�SrQ)rhrbr@rdrerArArBrdm	szTextIOWrapper.truncatecCs*|jdkrtd��|��|j}d|_|S)Nzbuffer is already detached)r@r#rhr�)rIr@rArArBr�s	s
zTextIOWrapper.detachcs��fdd�}�jrtd���js(td��|tkrN|dkr@td��d}���}nZ|tkr�|dkrftd������j�	d|�}��
d�d�_�jr��j�
�||�|S|dkr�td	|f��|dkr�td
|f�������|�\}}}}}	�j�	|���
d�d�_|dk�r*�j�r*�j�
�n@�j�s>|�s>|	�rj�j�pL����_�j�d|f�|df�_|	�r��j�|�}
��
�j�|
|��||
f�_t�j�|	k�r�td��|	�_||�|S)
NcsHz�jp���}Wntk
r&YnX|dkr<|�d�n|��dSr�)rLrWr@r5r7)rXr]rarArB�_reset_encoder|	sz*TextIOWrapper.seek.<locals>._reset_encoderr�rwrz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksrzunsupported whence (%r)r�r�z#can't restore logical file position)rjr#rrVrrbr	rhr@r[r\rCrMr7rvr`r5r�r+r"rAr.rB)rIZcookier_r|rXrzrhrprqrrrirArarBr[{	s`



�

�
zTextIOWrapper.seekcCs�|��|dkrd}n4z
|j}Wn"tk
rBt|�d���YnX|�}|jpV|��}|dkr�|��|j|j�	�dd�}|�
d�d|_|Sd}|�|�}t|�|kr�|s�|�
�}||�|t|��7}q�|SdS)Nrr�rTr&rF)rsr�r/r rMr`rcr+r@r�r\rCr"rk)rIr�r�r#r>rjrArArBr��	s,
�


zTextIOWrapper.readcCs(d|_|��}|s$d|_|j|_t�|Srm)rDr�rCrr�r�rArArBr��	szTextIOWrapper.__next__c	Cs
|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|��}d}|jsj|��d}}|jr�|�	d|�}|dkr�|d}�q�nt
|�}n�|j�rF|�	d|�}|�	d|�}|dkr�|dkr�t
|�}n|d}�q�nX|dk�r|d}�q�n@||k�r|d}�q�n(||dk�r8|d}�q�n|d}�q�n(|�	|j�}|dk�rn|t
|j�}�q�|dk�r�t
|�|k�r�|}�q�|�
��r�|j�r��q��q�|j�r�||��7}qr|�d	�d|_|Sqr|dk�r�||k�r�|}|�t
|�|�|d|�S)
Nr�rr�rr*r
r(rr)rjr#r�r/r rcrMr`rPr}r"rOrQrkrAr\rCre)	rIr�r�r��startr^�endposZnlposZcrposrArArBr��	st







zTextIOWrapper.readlinecCs|jr|jjSdSrQ)rMrrarArArBrH
szTextIOWrapper.newlines)NNNFF)NNNFF)N)rrrr)N)r)N)N)+rMrNrOrfr�r�r:rFr�r�r8r9r?rGr@rYrZrnrrrtrhr5rjrYr,r)r�rWr`r\rcrerkrsrvrbrdr�r[r�r�r�rrArArArBr3�sz�
(�
$




�)



*�

c

K
	
]r3csNeZdZd�fdd�	Zdd�Zdd�Zed	d
��Zedd��Zd
d�Z	�Z
S)�StringIOrr*csftt|�jt�dd|d�|dkr(d|_|dk	rbt|t�sNtd�t	|�j
���|�|�|�d�dS)Nzutf-8�
surrogatepass)r8r9r:Fz*initial_value must be str or None, not {0}r)
r�rr�r�rRrrr r�rHrMr�r[)rIZ
initial_valuer:r�rArBr�T
s�
�
zStringIO.__init__c	CsP|��|jp|��}|��}|��z|j|j��dd�W�S|�|�XdS)NTr&)	rhrMr`r2r7r5r+r@r�)rIr#Z	old_staterArArBr�d
szStringIO.getvaluecCs
t�|�SrQ)�objectr�rarArArBr�n
szStringIO.__repr__cCsdSrQrArarArArBr9s
szStringIO.errorscCsdSrQrArarArArBr8w
szStringIO.encodingcCs|�d�dSr�r\rarArArBr�{
szStringIO.detach)rr*)rMrNrOr�r�r�r�r9r8r�r�rArAr�rBrM
s


r)r
rNNNTN)7r�abcr r�r�sys�_threadrr��platformZmsvcrtrr�iorrrr	r�r��addr�	SEEK_DATAr*r�r�dev_moderkrCrF�	open_coder/rGrPrVr.r#�ABCMetarW�registerr��_ior(r�r�r�r2r1r�r0rr!rr3rrArArArB�<module>s�


�
[

	
$=
ghCiIJY@U$string.cpython-38.opt-1.pyc000064400000016206151450073350011451 0ustar00U

e5d')�@s�dZddddddddd	d
ddgZd
dlZdZdZdZeeZdZeddZdZ	dZ
eee
eZddd�Zd
dl
Zd
dlmZiZGdd�de�ZGdd�ded�ZGdd�d�ZdS)anA collection of string constants.

Public module variables:

whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable

�
ascii_letters�ascii_lowercase�ascii_uppercase�capwords�digits�	hexdigits�	octdigits�	printable�punctuation�
whitespace�	Formatter�Template�Nz 	

ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZ�
0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pd�dd�|�|�D��S)a�capwords(s [,sep]) -> string

    Split the argument into words using split, capitalize each
    word using capitalize, and join the capitalized words using
    join.  If the optional second argument sep is absent or None,
    runs of whitespace characters are replaced by a single space
    and leading and trailing whitespace are removed, otherwise
    sep is used to split and join the words.

    � css|]}|��VqdS�N)�
capitalize)�.0�x�r�/usr/lib64/python3.8/string.py�	<genexpr>0szcapwords.<locals>.<genexpr>)�join�split)�s�seprrrr%s)�ChainMapcs eZdZdZ�fdd�Z�ZS)�_TemplateMetaclassa/
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(bid)s)}  |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    csbtt|��|||�d|kr$|j}n$tjt�|j�|j|jp@|jd�}t�	||j
tjB�|_dS)N�pattern)Zdelim�idZbid)�superr�__init__r�_re�escape�	delimiter�	idpattern�braceidpattern�compile�flags�VERBOSE)�cls�name�basesZdctr��	__class__rrr Cs

�z_TemplateMetaclass.__init__)�__name__�
__module__�__qualname__rr �
__classcell__rrr,rr9s	rc@sJeZdZdZdZdZdZejZ	dd�Z
dd�Zefd	d
�Z
efdd�ZdS)
rz.A string class for supporting $-substitutions.�$z(?a:[_a-z][_a-z0-9]*)NcCs
||_dSr)�template)�selfr3rrrr \szTemplate.__init__cCsd|�d�}|jd|�jdd�}|s.d}d}n"|td�|dd���}t|�}td||f��dS)N�invalidT)�keepends�����z.Invalid placeholder in string: line %d, col %d)�startr3�
splitlines�lenr�
ValueError)r4�mo�i�lines�colno�linenorrr�_invalidas
�zTemplate._invalidcs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncsd|�d�p|�d�}|dk	r(t�|�S|�d�dk	r<�jS|�d�dk	rT��|�td�j��dS�N�namedZbracedZescapedr5z#Unrecognized named group in pattern)�group�strr#rCr=r�r>rE��mappingr4rr�convertss
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr�subr3�r4rJZkwsrKrrIr�
substitutems
zTemplate.substitutecs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|dk	rHzt�|�WStk
rF|��YSX|�d�dk	r\�jS|�d�dk	rr|��Std�j��dSrD)rFrG�KeyErrorr#r=rrHrIrrrK�s�z)Template.safe_substitute.<locals>.convertrLrPrrIr�safe_substitute�s

zTemplate.safe_substitute)r.r/r0�__doc__r#r$r%r!�
IGNORECASEr'r rCrMrQrSrrrrrPs)�	metaclassc@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r4�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r4rXrYrZ�	used_args�result�_rrrrW�szFormatter.vformatr
c	Cs�|dkrtd��g}|�|�D]�\}}	}
}|r8|�|�|	dk	r|	dkrj|dkrXtd��t|�}	|d7}n|	��r�|r~td��d}|�|	||�\}}
|�|
�|�||�}|j|
||||d|d�\}
}|�|�	||
��qd�
|�|fS)Nr
zMax string recursion exceededr8FzJcannot switch from manual field specification to automatic field numberingr7)�auto_arg_index)r=�parse�appendrG�isdigit�	get_field�add�
convert_fieldr^�format_fieldr)r4rXrYrZr`Zrecursion_depthrcraZliteral_text�
field_name�format_spec�
conversion�objZarg_usedrrrr^�s<�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r4�keyrYrZrrr�	get_value�s
zFormatter.get_valuecCsdSrr)r4r`rYrZrrrr_�szFormatter.check_unused_argscCs
t||�Sr)r[)r4�valuerlrrrrj�szFormatter.format_fieldcCsN|dkr|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rG�repr�asciir=r[)r4rsrmrrrri�szFormatter.convert_fieldcCs
t�|�Sr)�_stringZformatter_parser)r4rXrrrrdszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)rxZformatter_field_name_splitrr�getattr)	r4rkrYrZ�first�restrnZis_attrr?rrrrg
s
zFormatter.get_fieldN)r
)r.r/r0r[rWr^rrr_rjrirdrgrrrrr�s�
6	)N)rT�__all__rxr
rrrrrrr	rr�rer!�collectionsrrNrM�typerrrrrrr�<module>s6�
Qlzma.cpython-38.opt-2.pyc000064400000013333151450073350011105 0ustar00U

e5d�2�$@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#g$Zd$d%lZd$d%lZd$d%lZd$d&lTd$d'lmZmZd$d%lZd$Zd(Z	d)Z
Gd*d�dej�Zd1d%d,d%d%d%d%d%d-�d.d �Z
ed,d%d%fd/d!�Zed%d%fd0d"�Zd%S)2Z
CHECK_NONEZCHECK_CRC32ZCHECK_CRC64ZCHECK_SHA256ZCHECK_ID_MAXZ
CHECK_UNKNOWNZFILTER_LZMA1ZFILTER_LZMA2ZFILTER_DELTAZ
FILTER_X86ZFILTER_IA64Z
FILTER_ARMZFILTER_ARMTHUMBZFILTER_POWERPCZFILTER_SPARC�FORMAT_AUTO�	FORMAT_XZZFORMAT_ALONEZ
FORMAT_RAWZMF_HC3ZMF_HC4ZMF_BT2ZMF_BT3ZMF_BT4Z	MODE_FASTZMODE_NORMALZPRESET_DEFAULTZPRESET_EXTREME�LZMACompressor�LZMADecompressor�LZMAFile�	LZMAError�open�compress�
decompressZis_check_supported�N)�*)�_encode_filter_properties�_decode_filter_properties��c@s�eZdZd!ddddd�dd�Zdd�Zed	d
��Zdd�Zd
d�Zdd�Z	dd�Z
d"dd�Zd#dd�Zd$dd�Z
d%dd�Zdd�Zejfdd�Zdd �ZdS)&rN�r�����format�check�preset�filtersc	Cs&d|_d|_t|_|dkrL|dkr*td��|dk	r:td��|dkrFt}t}n@|dkr~|dkr`t}t}t	||||d�|_
d|_ntd	�|���t
|tttjf�r�d
|kr�|d
7}t�||�|_d|_||_n*t|d�s�t|d
�r�||_||_ntd��|jtk�r"tj|jtt||d�}t�|�|_dS)NF)r�rbrzACannot specify an integrity check when opening a file for readingzICannot specify a preset compression level when opening a file for reading)�w�wb�aZab�xZxbrr
zInvalid mode: {!r}�bT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorrr)�_fp�_closefp�_MODE_CLOSED�_mode�
ValueErrorr�
_MODE_READr�_MODE_WRITEr�_compressor�_posr�
isinstance�str�bytes�os�PathLike�builtinsr�hasattr�	TypeError�_compressionZDecompressReaderrr�io�BufferedReader�_buffer)	�self�filename�moderrrrZ	mode_code�raw�r8�/usr/lib64/python3.8/lzma.py�__init__1sL,�
�zLZMAFile.__init__cCs�|jtkrdSzB|jtkr,|j��d|_n"|jtkrN|j�|j	�
��d|_	W5z|jrd|j��W5d|_d|_t|_XXdS)NF)r"r!rr �closer$r3r%rr&�flush�r4r8r8r9r;�s




zLZMAFile.closecCs
|jtkS�N)r"r!r=r8r8r9�closed�szLZMAFile.closedcCs|��|j��Sr>)�_check_not_closedr�filenor=r8r8r9rA�szLZMAFile.filenocCs|��o|j��Sr>)�readabler3�seekabler=r8r8r9rC�szLZMAFile.seekablecCs|��|jtkSr>)r@r"r$r=r8r8r9rB�szLZMAFile.readablecCs|��|jtkSr>)r@r"r%r=r8r8r9�writable�szLZMAFile.writablecCs|��|j�|�Sr>)�_check_can_readr3�peek�r4�sizer8r8r9rF�sz
LZMAFile.peekcCs|��|j�|�Sr>)rEr3rrGr8r8r9r�sz
LZMAFile.readcCs"|��|dkrtj}|j�|�S)Nr
)rEr1�DEFAULT_BUFFER_SIZEr3�read1rGr8r8r9rJ�szLZMAFile.read1cCs|��|j�|�Sr>)rEr3�readlinerGr8r8r9rK�szLZMAFile.readlinecCs:|��|j�|�}|j�|�|jt|�7_t|�Sr>)Z_check_can_writer&rrrr'�len)r4�dataZ
compressedr8r8r9r�s
zLZMAFile.writecCs|��|j�||�Sr>)Z_check_can_seekr3�seek)r4�offset�whencer8r8r9rN�sz
LZMAFile.seekcCs"|��|jtkr|j��S|jSr>)r@r"r$r3�tellr'r=r8r8r9rQ�s

z
LZMAFile.tell)Nr)r)r)r)r)�__name__�
__module__�__qualname__r:r;�propertyr?rArCrBrDrFrrJrKrr1�SEEK_SETrNrQr8r8r8r9r&s(�U


	



rr)rrrr�encoding�errors�newlinecCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}	t||	||||d�}
d|kr�t�|
|||�S|
SdS)	N�trzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�r)r#�replacerr1�
TextIOWrapper)r5r6rrrrrWrXrYZlz_modeZbinary_filer8r8r9rs"
�cCs t||||�}|�|�|��Sr>)rrr<)rMrrrr�compr8r8r9r6scCspg}t|||�}z|�|�}Wn tk
r>|r8Yqfn�YnX|�|�|jsXtd��|j}|sqfqd�|�S)NzACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rMrZmemlimitrZresultsZdecomp�resr8r8r9r	Bs
)r)�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>st�
b�/subprocess.cpython-38.pyc000064400000122341151450073350011372 0ustar00U

e5d�1�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZdddddd	d
ddd
ddddgZ
zddlZddlZdZWn0ek
r�dZddlZddlZddlZYn�XddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&e
�'dddddddddddd d!d"d#d$d%d&d'g�Gd(d�de(�Z)Gd)d
�d
e)�Z*Gd*d�de)�Z+e�r�Gd+d�d�Z,Gd,d-�d-e-�Z.n&e/ed.d/�Z0e1ed0��r�ej2Z3nej4Z3e�r�dZ5d1d2�Z6ngZ5d3d2�Z6d4Z7d5Z8d6Z9d7d8�Z:d9d:�Z;dd;�d<d�Z<d=d�Z=dd;�d>d�Z>Gd?d�de?�Z@ddddd@�dAd�ZAdBdC�ZBdDd	�ZCdEd
�ZDdFdG�ZEeE�ZFGdHd�de?�ZGdS)Ia�Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API
========
run(...): Runs a command, waits for it to complete, then returns a
          CompletedProcess instance.
Popen(...): A class for flexibly executing a command in a new process

Constants
---------
DEVNULL: Special value that indicates that os.devnull should be used
PIPE:    Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout


Older API
=========
call(...): Runs a command, waits for it to complete, then returns
    the return code.
check_call(...): Same as call() but raises CalledProcessError()
    if return code is not 0
check_output(...): Same as check_call() but returns the contents of
    stdout instead of a return code
getoutput(...): Runs a command in the shell, waits for it to complete,
    then returns the output
getstatusoutput(...): Runs a command in the shell, waits for it to complete,
    then returns a (exitcode, output) tuple
�N)�	monotonic�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOBrrrrrrrr�STARTUPINFOrrrrrrrr r!r"c@seZdZdS)rN)�__name__�
__module__�__qualname__�r'r'�"/usr/lib64/python3.8/subprocess.pyr`sc@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�Raised when run() is called with check=True and the process
    returns a non-zero exit status.

    Attributes:
      cmd, returncode, stdout, stderr, output
    NcCs||_||_||_||_dS�N)�
returncode�cmd�output�stderr)�selfr*r+r,r-r'r'r(�__init__jszCalledProcessError.__init__cCsh|jrT|jdkrTzd|jt�|j�fWStk
rPd|j|jfYSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r*r+�signalZSignals�
ValueError�r.r'r'r(�__str__ps���zCalledProcessError.__str__cCs|jS)z+Alias for output attribute, to match stderr�r,r2r'r'r(�stdout|szCalledProcessError.stdoutcCs
||_dSr)r4�r.�valuer'r'r(r5�s)NN�	r$r%r&�__doc__r/r3�propertyr5�setterr'r'r'r(rcs

c@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�This exception is raised when the timeout expires while waiting for a
    child process.

    Attributes:
        cmd, output, stdout, stderr, timeout
    NcCs||_||_||_||_dSr))r+�timeoutr,r-)r.r+r<r,r-r'r'r(r/�szTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r+r<r2r'r'r(r3�s
�zTimeoutExpired.__str__cCs|jSr)r4r2r'r'r(r5�szTimeoutExpired.stdoutcCs
||_dSr)r4r6r'r'r(r5�s)NNr8r'r'r'r(r�s

c@s,eZdZddddddd�dd�Zdd�ZdS)r#rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)N�handle_listr=)r.r>r?r@rArBrCr'r'r(r/�szSTARTUPINFO.__init__cCs@|j��}d|kr"t|d�|d<t|j|j|j|j|j|d�S)NrDr=)	rC�copy�listr#r>r?r@rArB)r.Z	attr_listr'r'r(rE�s
�zSTARTUPINFO.copy)r$r%r&r/rEr'r'r'r(r#�s�	c@s2eZdZdZejfdd�Zdd�Zdd�ZeZ	dS)	�HandleFcCs|jsd|_||�dS)NT)�closed)r.�CloseHandler'r'r(�Close�szHandle.ClosecCs |jsd|_t|�Std��dS)NTzalready closed)rH�intr1r2r'r'r(�Detach�sz
Handle.DetachcCsd|jjt|�fS)Nz%s(%d))�	__class__r$rKr2r'r'r(�__repr__�szHandle.__repr__N)
r$r%r&rH�_winapirIrJrLrN�__del__r'r'r'r(rG�s
rGZPIPE_BUFi�PollSelectorcCsdSr)r'r'r'r'r(�_cleanup�srRc	Cs\tdkrdStdd�D]>}|jtjd�}|dk	rzt�|�Wqtk
rTYqXqdS)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover1)�inst�resr'r'r(rR�s���������cCs*g}tjj}|dkr&|�dd|�|S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r�-�O)rW�flags�optimize�append)�argsr7r'r'r(�"_optim_args_from_interpreter_flagss
recCsVddddddd�}t�}|��D].\}}ttj|�}|dkr |�d	||�q tjjrd|�d
�n$tjjrv|�d�tjjr�|�d�tj	d
d
�}tjj
}ttdi�}d|k}|dkr�|�d�n|r�|�d�|r�|�d�|D]}|�d|�q�|�r
|�d�dD]B}||k�r||}	|	dk�r4|}
nd||	f}
|�d|
f��q|S)z}Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrr_z-Iz-Ez-sN�	_xoptions�dev�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-Xrs)Zfaulthandler�tracemallocZ
importtimeZshowalloccountZshowrefcount�utf8Tz%s=%srv)
re�items�getattrrWrarc�isolated�ignore_environment�no_user_site�warnoptionsrprY�extend)Zflag_opt_maprd�flag�optriZwarnoptsrpZxoptions�dev_moder7�argr'r'r(�_args_from_interpreter_flagssP�






r��r<c
OsLt||��8}z|j|d�WW5QR�S|���YnXW5QRXdS)z�Run command with arguments.  Wait for command to complete or
    timeout, then return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    r�N)r�wait�kill)r<�	popenargs�kwargs�pr'r'r(rLscOs6t||�}|r2|�d�}|dkr(|d}t||��dS)aORun command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    rdNr)r�getr)r�r��retcoder+r'r'r(r]s



cOsbd|krtd��d|krJ|ddkrJ|�d�s8|�d�r>d}nd}||d<t|t|d	d
�|��jS)aRun command with arguments and return its output.

    If the exit code was non-zero it raises a CalledProcessError.  The
    CalledProcessError object will have the return code in the returncode
    attribute and output in the output attribute.

    The arguments are the same as for the Popen constructor.  Example:

    >>> check_output(["ls", "-l", "/dev/null"])
    b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

    The stdout argument is not allowed as it is used internally.
    To capture standard error in the result, use stderr=STDOUT.

    >>> check_output(["/bin/sh", "-c",
    ...               "ls -l non_existent_file ; exit 0"],
    ...              stderr=STDOUT)
    b'ls: non_existent_file: No such file or directory\n'

    There is an additional optional argument, "input", allowing you to
    pass a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it too will be used internally.  Example:

    >>> check_output(["sed", "-e", "s/foo/bar/"],
    ...              input=b"when in the course of fooman events\n")
    b'when in the course of barman events\n'

    By default, all communication is in bytes, and therefore any "input"
    should be bytes, and the return value will be bytes.  If in text mode,
    any "input" should be a string, and the return value will be a string
    decoded according to locale encoding, or by "encoding" if set. Text mode
    is triggered by setting any of text, encoding, errors or universal_newlines.
    r5z3stdout argument not allowed, it will be overridden.�inputN�universal_newlines�text��T)r5r<�check)r1r�rrr5)r<r�r��emptyr'r'r(r
ps#�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
raEA process that has finished running.

    This is returned by run().

    Attributes:
      args: The list or str args passed to run().
      returncode: The exit code of the process, negative for signals.
      stdout: The standard output (None if not captured).
      stderr: The standard error (None if not captured).
    NcCs||_||_||_||_dSr))rdr*r5r-)r.rdr*r5r-r'r'r(r/�szCompletedProcess.__init__cCshd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�t|�jd�|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatrdr*r5rcr-�typer$�join)r.rdr'r'r(rN�s

�

zCompletedProcess.__repr__cCs |jrt|j|j|j|j��dS)z6Raise CalledProcessError if the exit code is non-zero.N)r*rrdr5r-r2r'r'r(�check_returncode�s�z!CompletedProcess.check_returncode)NN)r$r%r&r9r/rNr�r'r'r'r(r�s

	)r��capture_outputr<r�cOs |dk	r&|�d�dk	rtd��t|d<|r^|�d�dk	sF|�d�dk	rNtd��t|d<t|d<t||���}z|j||d�\}}Wn^tk
r�}	z,|��tr�|��\|	_|	_	n|�
��W5d}	~	XYn|���YnX|��}
|�r|
�rt|
|j
||d��W5QRXt|j
|
||�S)	aKRun command with arguments and return a CompletedProcess instance.

    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.

    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.

    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.

    There is an optional argument "input", allowing you to
    pass bytes or a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.

    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.

    The other arguments are the same as for the Popen constructor.
    N�stdinz/stdin and input arguments may not both be used.r5r-z@stdout and stderr arguments may not be used with capture_output.r��r,r-)r�r1rr�communicaterr��
_mswindowsr5r-r��pollrrdr)r�r�r<r�r�r�Zprocessr5r-�excr�r'r'r(r�s8�cCs�g}d}ttj|�D]�}g}|r*|�d�d|kp>d|kp>|}|rN|�d�|D]b}|dkrj|�|�qR|dkr�|�dt|�d�g}|�d�qR|r�|�|�g}|�|�qR|r�|�|�|r|�|�|�d�qd�|�S)	a�
    Translate a sequence of arguments into a command line
    string, using the same rules as the MS C runtime:

    1) Arguments are delimited by white space, which is either a
       space or a tab.

    2) A string surrounded by double quotation marks is
       interpreted as a single argument, regardless of white space
       contained within.  A quoted string can be embedded in an
       argument.

    3) A double quotation mark preceded by a backslash is
       interpreted as a literal double quotation mark.

    4) Backslashes are interpreted literally, unless they
       immediately precede a double quotation mark.

    5) If backslashes immediately precede a double quotation mark,
       every pair of backslashes is interpreted as a literal
       backslash.  If the number of backslashes is odd, the last
       backslash escapes the next double quotation mark as
       described in rule 3.
    F� �	�"�\�z\"r�)�map�os�fsdecoderc�lenrr�)�seq�resultZ	needquoter�Zbs_buf�cr'r'r(�list2cmdline	s4




r�c
Cslzt|ddtd�}d}Wn.tk
rF}z|j}|j}W5d}~XYnX|dd�dkrd|dd�}||fS)a�Return (exitcode, output) of executing cmd in a shell.

    Execute the string 'cmd' in a shell with 'check_output' and
    return a 2-tuple (status, output). The locale encoding is used
    to decode the output and process newlines.

    A trailing newline is stripped from the output.
    The exit status for the command can be interpreted
    according to the rules for the function 'wait'. Example:

    >>> import subprocess
    >>> subprocess.getstatusoutput('ls /bin/ls')
    (0, '/bin/ls')
    >>> subprocess.getstatusoutput('cat /bin/junk')
    (1, 'cat: /bin/junk: No such file or directory')
    >>> subprocess.getstatusoutput('/bin/junk')
    (127, 'sh: /bin/junk: not found')
    >>> subprocess.getstatusoutput('/bin/kill $$')
    (-15, '')
    T)�shellr�r-rNr\�
)r
rrr,r*)r+�dataZexitcodeZexr'r'r(rRscCst|�dS)a%Return output (stdout or stderr) of executing cmd in a shell.

    Like getstatusoutput(), except the exit status is ignored and the return
    value is a string containing the command's output.  Example:

    >>> import subprocess
    >>> subprocess.getoutput('ls /bin/ls')
    '/bin/ls'
    rt)r)r+r'r'r(r	qs
c
Cs�tsttd�sdStjdkr dSzjt�d�}|jdd�}t|�dkrHt�|d	}t	t
t|d�d
���}tjdkr�|dkr�|d
kr�WdSWnttt
fk
r�YnXdS)a�Check if posix_spawn() can be used for subprocess.

    subprocess requires a posix_spawn() implementation that properly reports
    errors to the parent process, & sets errno on the following failures:

    * Process attribute actions failed.
    * File actions failed.
    * exec() failed.

    Prefer an implementation which can use vfork() in some cases for best
    performance.
    �posix_spawnF�darwinT�CS_GNU_LIBC_VERSIONrt)�maxsplitr�r�.ZlinuxZglibc)r��)r��hasattrr�rW�platform�confstr�splitr�r1�tupler�rK�AttributeError�OSError)Zver�partsZlibc�versionr'r'r(�_use_posix_spawn~s 



r�c@s�eZdZdZdZdKdddd�d	d
�Zedd��Zejd
d��Zdd�Z	dd�Z
dd�Zej
ejfdd�Zdd�Zdd�ZdLdd�Zdd�Zdd�ZdMd d!�ZdNd"d#�Zd$d%�Ze�rd&d'�Zd(d)�Zd*d+�Zd,d-�Zdejej ej!fd.d/�Z"d0d1�Z#d2d3�Z$d4d5�Z%d6d7�Z&d8d9�Z'e'Z(n�d:d'�Zd;d<�Z)d=d-�Ze*j+e*j,e*j-e*j.e*j/e*j0fd>d?�Z1de*j2e*j3e4j5fd@d/�Z"dAdB�Z6dCd1�Z#dDd5�Z%dEdF�Z7dGd7�Z&dHd9�Z'dIdJ�Z(dS)Ora� Execute a child program in a new process.

    For a complete description of the arguments see the Python documentation.

    Arguments:
      args: A string, or a sequence of program arguments.

      bufsize: supplied as the buffering argument to the open() function when
          creating the stdin/stdout/stderr pipe file objects

      executable: A replacement program to execute.

      stdin, stdout and stderr: These specify the executed programs' standard
          input, standard output and standard error file handles, respectively.

      preexec_fn: (POSIX only) An object to be called in the child process
          just before the child is executed.

      close_fds: Controls closing or inheriting of file descriptors.

      shell: If true, the command will be executed through the shell.

      cwd: Sets the current directory before the child is executed.

      env: Defines the environment variables for the new process.

      text: If true, decode stdin, stdout and stderr using the given encoding
          (if set) or the system default otherwise.

      universal_newlines: Alias of text, provided for backwards compatibility.

      startupinfo and creationflags (Windows only)

      restore_signals (POSIX only)

      start_new_session (POSIX only)

      pass_fds (POSIX only)

      encoding and errors: Text mode encoding and error handling to use for
          file objects stdin, stdout and stderr.

    Attributes:
        stdin, stdout, stderr, pid, returncode
    Fr\NTrr')�encoding�errorsr�cCslt�t��|_d|_d|_|dkr(d}t|t�s:td��t	rP|dk	r�t
d��n8|rh|sht�dt
�d}|
dk	rxt
d��|d	kr�t
d
��||_d|_d|_d|_d|_d|_||_||_|dk	r�|dk	r�t|�t|�kr�td��|�|||�\}}}}}}t	�rN|dk�rt�|��d	�}|dk�r4t�|��d	�}|dk�rNt�|��d	�}|�pb|�pb|�pb||_d|_d|_|j�r�|d
k�r�d}d}nd}z�|dk�r�t� |d|�|_|j�r�tj!|jd|||d�|_|dk�rt� |d|�|_|j�rtj!|j||d�|_|dk�r:t� |d|�|_|j�r:tj!|j||d�|_|�"||||||
||
||	||||||||�Wn�t#d|j|j|jf�D]*}z|�$�Wnt%k
�r�YnX�q�|j�s`g}|t&k�r�|�'|�|t&k�r�|�'|�|t&k�r�|�'|�t(|d��r|�'|j)�|D]H}z*t	�r8t|t*��r8|�+�n
t,�$|�Wnt%k
�rZYnX�q�YnXdS)zCreate new Popen instance.NFr\zbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?rt�wb)�
write_through�line_bufferingr�r��rb)r�r��_devnull)-rR�	threadingZLock�
_waitpid_lock�_input�_communication_started�
isinstancerK�	TypeErrorr�r1�warnings�warn�RuntimeWarningrdr�r5r-�pidr*r�r��boolr�_get_handles�msvcrtZopen_osfhandlerL�	text_mode�_sigint_wait_secs�_closed_child_pipe_fds�io�open�
TextIOWrapper�_execute_child�filter�closer�rrcr�r�rGrJr�)r.rd�bufsize�
executabler�r5r-�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsr�r�r��p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��fZto_close�fdr'r'r(r/�s�


��





�
�
��








zPopen.__init__cCs|jSr))r�r2r'r'r(r�~szPopen.universal_newlinescCst|�|_dSr))r�r�)r.r�r'r'r(r��scCs |�||�}|�dd��dd�S)Nz
r��
)�decode�replace)r.r�r�r�r'r'r(�_translate_newlines�szPopen._translate_newlinescCs|Sr)r'r2r'r'r(�	__enter__�szPopen.__enter__cCs�|jr|j��|jr |j��dz|jr4|j��W5|tkr�|jdkrrz|j|jd�Wntk
rpYnXd|_�dS|��XdS)Nrr�)	r5r�r-�KeyboardInterruptr��_waitrr�r�)r.�exc_typer7�	tracebackr'r'r(�__exit__�s 


zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d�|j|d�|jdkrPtdk	rPt�|�dS)Nzsubprocess %s is still running)�sourcerS)�_child_createdr*r��ResourceWarningrVrUrc)r.Z_maxsizeZ_warnr'r'r(rP�s

�z
Popen.__del__cCs"t|d�st�tjtj�|_|jS)Nr�)r�r�r��devnull�O_RDWRr�r2r'r'r(�_get_devnull�s
zPopen._get_devnullc
Cs�|rZz|j�|�WnDtk
r(Yn2tk
rX}z|jtjkrFn�W5d}~XYnXz|j��WnDtk
r|Yn2tk
r�}z|jtjkr�n�W5d}~XYnXdSr))r��write�BrokenPipeErrorr��errnoZEINVALr�)r.r�r�r'r'r(�_stdin_write�s"zPopen._stdin_writecCsT|jr|rtd��|dkr�|js�|j|j|jg�d�dkr�d}d}|jrT|�|�n6|jrp|j��}|j��n|jr�|j��}|j��|�	�n�|dk	r�t
�|}nd}z�z|�|||�\}}Wnhtk
�r,|dk	r�t
|j|�|��}n|j}d|_z|j|d�Wntk
�r$YnX�YnXW5d|_X|j	|�|�d�}||fS)a9Interact with process: Send data to stdin and close it.
        Read data from stdout and stderr, until end-of-file is
        reached.  Wait for process to terminate.

        The optional "input" argument should be data to be sent to the
        child process, or None, if no data should be sent to the child.
        communicate() returns a tuple (stdout, stderr).

        By default, all communication is in bytes, and therefore any
        "input" should be bytes, and the (stdout, stderr) will be bytes.
        If in text mode (indicated by self.text_mode), any "input" should
        be a string, and (stdout, stderr) will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode
        is triggered by setting any of text, encoding, errors or
        universal_newlines.
        z.Cannot send input after starting communicationNr�Trr�)r�r1r�r5r-�countr�readr�r��_time�_communicater��minr��_remaining_timer�r)r.r�r<r5r-�endtime�sigint_timeout�stsr'r'r(r��sH
�



�zPopen.communicatecCs|��S)zSCheck if child process has terminated. Set and return returncode
        attribute.)rVr2r'r'r(r�sz
Popen.pollcCs|dkrdS|t�SdS)z5Convenience for _communicate when computing timeouts.N)r)r.r	r'r'r(r"szPopen._remaining_timecCsL|dkrdS|st�|krHt|j||r0d�|�nd|r@d�|�ndd��dS)z2Convenience for checking if a timeout has expired.Nr�r�)rrrdr�)r.r	�orig_timeoutZ
stdout_seqZ
stderr_seq�skip_check_and_raiser'r'r(�_check_timeout*s�zPopen._check_timeoutcCs�|dk	rt�|}z|j|d�WStk
r�|dk	rLt|j|�|��}n|j}d|_z|j|d�Wntk
r|YnX�YnXdS)z=Wait for child process to terminate; returns self.returncode.Nr�r)rr�r�rr�rr)r.r<r	r
r'r'r(r�6s 
�z
Popen.waitc		Cs�t|dd�}t����}trX|dkr.|�|j�|dkrB|�|j�|dkr�|�|j�nr|dkr~|dkr~||kr~|�tj|�|dkr�|dkr�||kr�|�tj|�|dkr�|dkr�||kr�|�tj|�|dk	r�|�tj|�W5QRXd|_dS)Nr�r\T)	rz�
contextlib�	ExitStackr��callbackrJr�r�r�)	r.r�r�r�r�r�r�Z
devnull_fd�stackr'r'r(�_close_pipe_fdsMs$
zPopen._close_pipe_fdscCs~|dkr|dkr|dkrdSd\}}d\}}d\}}	|dkrtt�tj�}|dkr�t�dd�\}}
t|�}t�|
�nh|tkr�t�dd�\}}t|�t|�}}n<|tkr�t�	|�
��}n$t|t�r�t�	|�}nt�	|�
��}|�|�}|dk�r*t�tj�}|dk�r�t�dd�\}
}t|�}t�|
�nn|tk�rXt�dd�\}}t|�t|�}}n@|tk�rrt�	|�
��}n&t|t��r�t�	|�}nt�	|�
��}|�|�}|dk�r�t�tj�}	|	dk�rdt�dd�\}
}	t|	�}	t�|
�n~|tk�rt�dd�\}}	t|�t|	�}}	nP|tk�r$|}	n@|tk�r>t�	|�
��}	n&t|t��rVt�	|�}	nt�	|�
��}	|�|	�}	||||||	fS)�|Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            N)r\r\r\r\r\r\�r\r\r)rOZGetStdHandlerZ
CreatePiperGrIrr
r�Z
get_osfhandler�r�rK�fileno�_make_inheritablerrr)r.r�r5r-r�r�r�r�r�r��_r'r'r(r�nst












�zPopen._get_handlescCs&t�t��|t��ddtj�}t|�S)z2Return a duplicate of handle, which is inheritablerrt)rOZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrG)r.�handle�hr'r'r(r�s�zPopen._make_inheritablecCstdd�|D��S)z�Filter out console handles that can't be used
            in lpAttributeList["handle_list"] and make sure the list
            isn't empty. This also removes duplicate handles.cSs,h|]$}|d@dks$t�|�tjkr|�qS)�)rOZGetFileTypeZFILE_TYPE_CHAR)�.0rr'r'r(�	<setcomp>�s��z,Popen._filter_handle_list.<locals>.<setcomp>)rF)r.rDr'r'r(�_filter_handle_list�szPopen._filter_handle_listcCs�|rtd��t|t�rnNt|t�r:|
r.td��t|g�}n,t|tj�r^|
rRtd��t|g�}nt|�}|dk	rxt�|�}|dkr�t	�}n|�
�}d|||fk}|r�|jtj
O_||_||_||_|j}t|o�d|ko�|d�}|s�|�rl|�rl|dk�ri}|_t|�dg��}|d<|�r>|t|�t|�t|�g7}|�|�|dd�<|�rl|�sht�dt�d}|
�r�|jtjO_tj|_|�s�tj�d	�}|�s�tj�d
d�}tj�|dd
�}tj� |��s�t!d��tj� |��r�|}n|}d�"||�}|dk	�rt�|�}t#�$d||||�z,t�&||ddt|�|	|||�	\}}}}W5|�%|||
|||�Xd|_'t(|�|_)||_*t�+|�dS)z$Execute program (MS Windows version)z"pass_fds not supported on Windows.z$bytes args is not allowed on Windows�0path-like args is not allowed when shell is trueNr\rDz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZComSpecZ
SystemRootr�ZSystem32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz
{} /c "{}"�subprocess.PopenT),�AssertionErrorr��str�bytesr�r�r��PathLiker�r#rEr>rOrr?r@rArCr�rFr�rKrr�r�r�rrrB�environ�pathr��isabs�FileNotFoundErrorr�rW�auditrZ
CreateProcessr�rG�_handler�rI)r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listrDZcomspecZsystem_rootZhpZhtr��tidr'r'r(r��s�	


��

�
�

��
zPopen._execute_childcCs,|jdkr&||jd�|kr&||j�|_|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it can only refer to objects
            in its local scope.

            Nr)r*r*)r.rTZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessr'r'r(rVHs
zPopen._internal_pollcCs^|dkrtj}nt|d�}|jdkrXt�|j|�}|tjkrJt|j|��t�	|j�|_|jS)z-Internal implementation of wait() on Windows.Ni�)
rOZINFINITErKr*�WaitForSingleObjectr*ZWAIT_TIMEOUTrrd�GetExitCodeProcess)r.r<Ztimeout_millisr�r'r'r(r�Ys
�
zPopen._waitcCs|�|���|��dSr))rcrr�)r.Zfh�bufferr'r'r(�
_readerthreadiszPopen._readerthreadcCs\|jrBt|d�sBg|_tj|j|j|jfd�|_d|j_|j��|j	r�t|d�s�g|_
tj|j|j	|j
fd�|_d|j_|j��|jr�|�
|�|jdk	r�|j�|�|��|j��r�t|j|��|j	dk	r�|j�|�|��|j��r�t|j|��d}d}|j�r|j}|j��|j	�r0|j
}|j	��|�r>|dnd}|�rP|dnd}||fS)N�_stdout_buff)�targetrdT�_stderr_buffr)r5r�r0r�ZThreadr/Z
stdout_threadZdaemon�startr-r2Z
stderr_threadr�rr�rZis_aliverrdr�)r.r�r	rr5r-r'r'r(rnsJ
��

��







zPopen._communicatecCsl|jdk	rdS|tjkr"|��nF|tjkr>t�|jtj�n*|tjkrZt�|jtj�nt	d�
|���dS)�Send a signal to the process.NzUnsupported signal: {})r*r0�SIGTERM�	terminateZCTRL_C_EVENTr�r�r�ZCTRL_BREAK_EVENTr1r��r.Zsigr'r'r(�send_signal�s




zPopen.send_signalcCsX|jdk	rdSzt�|jd�Wn2tk
rRt�|j�}|tjkrH�||_YnXdS)zTerminates the process.Nrt)r*rOZTerminateProcessr*�PermissionErrorr-ZSTILL_ACTIVE)r.Zrcr'r'r(r6�s

zPopen.terminatec
Cs,d\}}d\}}d\}}	|dkr"n@|tkr8t��\}}n*|tkrJ|��}nt|t�rZ|}n|��}|dkrln@|tkr�t��\}}n*|tkr�|��}nt|t�r�|}n|��}|dkr�nf|tkr�t��\}}	nP|tkr�|dkr�|}	n
t	j
��}	n.|tk�r|��}	nt|t��r|}	n|��}	||||||	fS)rrNr\)rr��piper
r�r�rKrrrW�
__stdout__)
r.r�r5r-r�r�r�r�r�r�r'r'r(r��sP





�cCs�|dkrtj}i}|rJg}dD]"}
tt|
d�}|dk	r|�|�q||d<g}|||	fD]}|dkrX|�tj|f�qX|df|df|
dffD]"\}}|dkr�|�tj||f�q�|r�||d<tj|||f|�|_d	|_	|�
|||||	|
�dS)
z'Execute program using os.posix_spawn().N)�SIGPIPEZSIGXFZ�SIGXFSZZ	setsigdefr\rrtr��file_actionsT)r�r%rzr0rc�POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2r�r�r�r)r.rdr�r�r�r�r�r�r�r�r�r�ZsigsetZsignameZsignumr>r�Zfd2r'r'r(�_posix_spawn�s<��zPopen._posix_spawnc)s�t|ttf�r|g}n(t|tj�r6|
r.td��|g}nt|�}|
rlttd�rPdnd}|dg|}�rl�|d<�dkr||d�t�	d�|||�t
�rtj����r|dk�r|�s|�s|dk�r|d	ks�|d
k�r|d	ks�|d
k�r|d	ks�|d
k�r|�s|�
|�|||||
|||�
dS�}t��\}}g}|dk�rT|�|�t�|�}�q2|D]}t�|��qX�zJz�|dk	�r�g}|��D]>\}}t�|�}d|k�r�td
��|�|dt�|���q�nd}t����tj����r�f}nt�fdd�t�|�D��}t|�}|�|�t�|||tttt|���|||||
||||||||�|_d|_W5t�|�X|� |||
|||�t!�}t�"|d�}||7}|�r�t#|�dk�r��q��q�W5t�|�X|�r�z6t�$|jd�\} }!| |jk�r�|�%|!�ntj&|_'Wnt(k
�rYnXz|�)dd
�\}"}#}$|$�*�}$Wn,tk
�rbd}"d}#d�+t|��}$YnXt,t-|"�*d�t.�}%t/|%t0��r�|#�r�t|#d�}&|$dk}'|'�r�d}$|}(n|}(|&dk�r�t�1|&�}$|%|&|$|(��|%|$��dS)zExecute program (POSIX version)rZgetandroidapilevelz/system/bin/shz/bin/shz-crNr r\r�r�=z!illegal environment variable namec3s"|]}tj�t�|���VqdSr))r�r&r��fsencode)r�dir�r�r'r(�	<genexpr>rs�z'Popen._execute_child.<locals>.<genexpr>TiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�Znoexecr�)2r�r"r#r�r$r�rFr�rWr)�_USE_POSIX_SPAWNr&�dirnamerAr:rc�dupr�ryrCr1r��
get_exec_path�set�add�_posixsubprocessZ	fork_exec�sortedr�rKr�r�r�	bytearrayrr��waitpid�_handle_exitstatusrXr*�ChildProcessErrorr�r�r�rz�builtinsr�
issubclassr��strerror))r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
unix_shellZorig_executableZerrpipe_readZ
errpipe_writeZlow_fds_to_closeZlow_fdZenv_list�kriZexecutable_listZfds_to_keepZerrpipe_data�partr�rZexception_nameZ	hex_errno�err_msgZchild_exception_typeZ	errno_numZchild_exec_never_calledZerr_filenamer'rEr(r� s"	��
�����������	�
�





�
�
�
��
�


cCsL||�r||�|_n2||�r*||�|_n||�r@||�|_ntd��dS)�:All callers to this function MUST hold self._waitpid_lock.zUnknown child exit status!N)r*r)r.rZ_WIFSIGNALEDZ	_WTERMSIGZ
_WIFEXITEDZ_WEXITSTATUSZ_WIFSTOPPEDZ	_WSTOPSIGr'r'r(rU�szPopen._handle_exitstatusc
Cs�|jdkr�|j�d�sdSz�z>|jdk	r4|jWW�pS||j|�\}}||jkrX|�|�WnBtk
r�}z$|dk	r|||_n|j|kr�d|_W5d}~XYnXW5|j��X|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it cannot reference anything
            outside of the local scope (nor can any methods it calls).

            NFr)r*r��acquire�releaser�rUr�r)r.rTZ_waitpidZ_WNOHANGZ_ECHILDr�r�er'r'r(rV�s 	



cCs>zt�|j|�\}}Wntk
r4|j}d}YnX||fS)r]r)r�rTr�rV)r.Z
wait_flagsr�rr'r'r(�	_try_wait�s
zPopen._try_waitc	Cs2|jdk	r|jS|dk	r�t�|}d}|j�d�r�zT|jdk	rDW�Fq�|�tj�\}}||jksj|dksjt	�||jkr�|�
|�W�q�W5|j��X|�|�}|dkr�t|j
|��t|d|d�}t�|�q&n\|jdk�r,|j�B|jdk	r�W5QR��q,|�d�\}}||jk�r |�
|�W5QRXq�|jS)z+Internal implementation of wait() on POSIX.Ng����Mb@?Frr�g�������?)r*rr�r^r_rar��WNOHANGr�r!rUrrrdr�time�sleep)r.r<r	Zdelayr�rZ	remainingr'r'r(r��s8







c
Cs"|jrX|jsXz|j��Wntk
r.YnX|sXz|j��Wntk
rVYnXd}d}|js�i|_|jr~g|j|j<|jr�g|j|j<|jr�|j|j}|jr�|j|j}|�|�|j	r�t
|j	�}t����}|jr�|r�|�|jt
j�|j�r|jj�s|�|jt
j�|j�r6|jj�s6|�|jt
j�|���r�|�|�}|dk	�rz|dk�rz|j||||dd�td��|�|�}	|�||||�|	D]�\}
}|
j|jk�r6||j|jt�}z|jt�|
j|�7_Wn,tk
�r
|�|
j�|
j��Yn*X|jt|j	�k�r�|�|
j�|
j��nP|
j|j|jfk�r�t�|
jd�}
|
�st|�|
j�|
j��|j|
j�|
��q��q6W5QRX|j |�|�d�|dk	�r�d�!|�}|dk	�r�d�!|�}|j"�r|dk	�r�|�#||jj$|jj%�}|dk	�r|�#||jj$|jj%�}||fS)NrT)r
zN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r�)&r�r��flushrr�Z_fileobj2outputr5r-�_save_inputr��
memoryview�_PopenSelector�register�	selectorsZEVENT_WRITErHZ
EVENT_READZget_maprr�RuntimeError�selectZfileobj�
_input_offset�	_PIPE_BUFr�r�r�Z
unregisterr�rrcr�r�r�r�r�r�)r.r�r	rr5r-Z
input_viewZselectorr<Zready�keyZevents�chunkr�r'r'r(r's�





��
�
$




�
�cCsF|jrB|jdkrBd|_||_|dk	rB|jrB|j�|jj|jj�|_dS)Nr)r�r�rmr��encoder�r�)r.r�r'r'r(rf�s�zPopen._save_inputcCs|jdkrt�|j|�dS)r4N)r*r�r�r�r7r'r'r(r8�s
cCs|�tj�dS)z/Terminate the process with SIGTERM
            N)r8r0r5r2r'r'r(r6�scCs|�tj�dS)z*Kill the process with SIGKILL
            N)r8r0�SIGKILLr2r'r'r(r��sz
Popen.kill)r\NNNNNTFNNNNrTFr')NN)F)N)8r$r%r&r9r�r/r:r�r;r�r�r�rWrXr�r�rPr�rr�r�rrr�rr�r�rrr�rOr,Z
WAIT_OBJECT_0r-rVr�r/rr8r6r�rAr��WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED�WSTOPSIGrUrTrbrZECHILDrarfr'r'r'r(r�s�-��


D	�

H	
|�
26'�
�
#
)f)Hr9rWrr�r�rcr0rWr�r�rrr�__all__r�rOr��ModuleNotFoundErrorrQrlrjrrrrrrrrrrrrrrrr r!r"r�	Exceptionrrrr#rKrGrzrnr�rQrhZSelectSelectorrUrRrrr
rer�rrr
�objectrrr�rr	r�rKrr'r'r'r(�<module>
s�"�P
�
%	


;3"�EI
/shelve.cpython-38.opt-1.pyc000064400000022424151450073350011430 0ustar00U

e5dO!�@s�dZddlmZmZddlmZddlZddddgZGd	d
�d
ej	j
�ZGdd�dej	j
�ZGdd�de�Z
Gd
d�de�Zddd�ZdS)a�
Manage shelves of pickled objects.

A "shelf" is a persistent, dictionary-like object.  The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle.  This includes most class instances, recursive data
types, and objects containing lots of shared sub-objects.  The keys
are ordinary strings.

To summarize the interface (key is a string, data is an arbitrary
object):

        import shelve
        d = shelve.open(filename) # open, with (g)dbm filename -- no suffix

        d[key] = data   # store data at key (overwrites old data if
                        # using an existing key)
        data = d[key]   # retrieve a COPY of the data at key (raise
                        # KeyError if no such key) -- NOTE that this
                        # access returns a *copy* of the entry!
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # a list of all existing keys (slow!)

        d.close()       # close it

Dependent on the implementation, closing a persistent dictionary may
or may not be necessary to flush changes to disk.

Normally, d[key] returns a COPY of the entry.  This needs care when
mutable entries are mutated: for example, if d[key] is a list,
        d[key].append(anitem)
does NOT modify the entry d[key] itself, as stored in the persistent
mapping -- it only modifies the copy, which is then immediately
discarded, so that the append has NO effect whatsoever.  To append an
item to d[key] in a way that will affect the persistent mapping, use:
        data = d[key]
        data.append(anitem)
        d[key] = data

To avoid the problem with mutable entries, you may pass the keyword
argument writeback=True in the call to shelve.open.  When you use:
        d = shelve.open(filename, writeback=True)
then d keeps a cache of all entries you access, and writes them all back
to the persistent mapping when you call d.close().  This ensures that
such usage as d[key].append(anitem) works as intended.

However, using keyword argument writeback=True may consume vast amount
of memory for the cache, and it may make d.close() very slow, if you
access many of d's entries after opening it in this way: d has no way to
check which of the entries you access are mutable and/or which ones you
actually mutate, so it must cache, and write back at close, all of the
entries that you access.  You can call d.sync() to write back all the
entries in the cache, and empty the cache (d.sync() also synchronizes
the persistent dictionary on disk, if feasible).
�)�Pickler�	Unpickler)�BytesION�Shelf�
BsdDbShelf�DbfilenameShelf�openc@s8eZdZdZdd�ZeZZZZZ	Z
dd�ZdS)�_ClosedDictz>Marker for a closed dict.  Access attempts raise a ValueError.cGstd��dS)Nz!invalid operation on closed shelf)�
ValueError)�self�args�r
�/usr/lib64/python3.8/shelve.py�closedEsz_ClosedDict.closedcCsdS)Nz<Closed Dictionary>r
�rr
r
r�__repr__Isz_ClosedDict.__repr__N)�__name__�
__module__�__qualname__�__doc__r�__iter__�__len__�__getitem__�__setitem__�__delitem__�keysrr
r
r
rr	Bsr	c@s|eZdZdZddd�Zdd�Zd	d
�Zdd�Zd d
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)!rz�Base class for shelf implementations.

    This is initialized with a dictionary-like object.
    See the module's __doc__ string for an overview of the interface.
    NF�utf-8cCs.||_|dkrd}||_||_i|_||_dS)N�)�dict�	_protocol�	writeback�cache�keyencoding�rr�protocolr r"r
r
r�__init__TszShelf.__init__ccs"|j��D]}|�|j�Vq
dS�N)rr�decoder")r�kr
r
rr^szShelf.__iter__cCs
t|j�Sr&)�lenrrr
r
rrbsz
Shelf.__len__cCs|�|j�|jkSr&��encoder"r�r�keyr
r
r�__contains__eszShelf.__contains__cCs|�|j�|jkr||S|Sr&r*)rr-�defaultr
r
r�gethsz	Shelf.getcCsZz|j|}WnFtk
rTt|j|�|j��}t|���}|jrP||j|<YnX|Sr&)	r!�KeyErrorrrr+r"r�loadr �rr-�value�fr
r
rrmszShelf.__getitem__cCsF|jr||j|<t�}t||j�}|�|�|��|j|�|j	�<dSr&)
r r!rrr�dump�getvaluerr+r")rr-r4r5�pr
r
rrws

zShelf.__setitem__cCs6|j|�|j�=z|j|=Wntk
r0YnXdSr&)rr+r"r!r1r,r
r
rrs
zShelf.__delitem__cCs|Sr&r
rr
r
r�	__enter__�szShelf.__enter__cCs|��dSr&)�close)r�typer4�	tracebackr
r
r�__exit__�szShelf.__exit__cCsf|jdkrdSz0|��z|j��Wntk
r:YnXW5zt�|_Wnd|_YnXXdSr&)rr	�syncr:�AttributeErrorrr
r
rr:�s

zShelf.closecCst|d�sdS|��dS)Nr )�hasattrr:rr
r
r�__del__�s
z
Shelf.__del__cCsT|jr:|jr:d|_|j��D]\}}|||<qd|_i|_t|jd�rP|j��dS)NFTr>)r r!�itemsr@rr>)rr-�entryr
r
rr>�s
z
Shelf.sync)NFr)N)rrrrr%rrr.r0rrrr9r=r:rAr>r
r
r
rrMs �



c@sBeZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)ra�Shelf implementation using the "BSD" db interface.

    This adds methods first(), next(), previous(), last() and
    set_location() that have no counterpart in [g]dbm databases.

    The actual database must be opened using one of the "bsddb"
    modules "open" routines (i.e. bsddb.hashopen, bsddb.btopen or
    bsddb.rnopen) and passed to the constructor.

    See the module's __doc__ string for an overview of the interface.
    NFrcCst�|||||�dSr&)rr%r#r
r
rr%�szBsdDbShelf.__init__cCs0|j�|�\}}t|�}|�|j�t|���fSr&)r�set_locationrr'r"rr2r3r
r
rrD�szBsdDbShelf.set_locationcCs.t|j�\}}t|�}|�|j�t|���fSr&)�nextrrr'r"rr2r3r
r
rrE�szBsdDbShelf.nextcCs.|j��\}}t|�}|�|j�t|���fSr&)r�previousrr'r"rr2r3r
r
rrF�szBsdDbShelf.previouscCs.|j��\}}t|�}|�|j�t|���fSr&)r�firstrr'r"rr2r3r
r
rrG�szBsdDbShelf.firstcCs.|j��\}}t|�}|�|j�t|���fSr&)r�lastrr'r"rr2r3r
r
rrH�szBsdDbShelf.last)NFr)
rrrrr%rDrErFrGrHr
r
r
rr�s�
c@seZdZdZddd�ZdS)rz�Shelf implementation using the "dbm" generic dbm interface.

    This is initialized with the filename for the dbm database.
    See the module's __doc__ string for an overview of the interface.
    �cNFcCs$ddl}t�||�||�||�dS)Nr)�dbmrr%r)r�filename�flagr$r rJr
r
rr%�szDbfilenameShelf.__init__)rINF)rrrrr%r
r
r
rr�srIFcCst||||�S)a�Open a persistent dictionary for reading and writing.

    The filename parameter is the base filename for the underlying
    database.  As a side-effect, an extension may be added to the
    filename and more than one file may be created.  The optional flag
    parameter has the same interpretation as the flag parameter of
    dbm.open(). The optional protocol parameter specifies the
    version of the pickle protocol.

    See the module's __doc__ string for an overview of the interface.
    )r)rKrLr$r r
r
rr�s
)rINF)r�picklerr�iorZcollections.abc�collections�__all__�abc�MutableMappingr	rrrrr
r
r
r�<module>s:b+tracemalloc.cpython-38.opt-2.pyc000064400000037120151450073350012430 0ustar00U

e5d�B�@sddlmZmZddlmZddlZddlZddlZddl	Z	ddl
Tddl
mZmZdd�Z
Gdd	�d	�ZGd
d�d�Zdd
�ZeGdd�d��ZeGdd�de��Zdd�ZGdd�d�ZGdd�de�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGd d!�d!�Zd"d#�ZdS)$�)�Sequence�Iterable)�total_orderingN)�*)�_get_object_traceback�_get_tracescCs�dD]|}t|�dkr@|dkr@|r0d||fSd||fSt|�dksT|dkrx|rhd||fSd	||fS|d
}qdS)N)�BZKiBZMiBZGiB�TiB�drz%+.1f %sz%.1f %si(r	z%+.0f %sz%.0f %si)�abs)�sizeZsignZunit�r
�#/usr/lib64/python3.8/tracemalloc.py�_format_size
src@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�	Statistic��	tracebackr�countcCs||_||_||_dS�Nr)�selfrrrr
r
r�__init__%szStatistic.__init__cCst|j|j|jf�Sr)�hashrrr�rr
r
r�__hash__*szStatistic.__hash__cCs$|j|jko"|j|jko"|j|jkSrr�r�otherr
r
r�__eq__-s

�
�zStatistic.__eq__cCsBd|jt|jd�|jf}|jr>|j|j}|dt|d�7}|S)Nz%s: size=%s, count=%iF�, average=%s)rrrr�r�textZaverager
r
r�__str__2s
��zStatistic.__str__cCsd|j|j|jfS)Nz)<Statistic traceback=%r size=%i count=%i>rrr
r
r�__repr__<s�zStatistic.__repr__cCs|j|j|jfSr)rrrrr
r
r�	_sort_key@szStatistic._sort_keyN�
�__name__�
__module__�__qualname__�	__slots__rrrr r!r"r
r
r
rrs
rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
StatisticDiff�rr�	size_diffr�
count_diffcCs"||_||_||_||_||_dSrr))rrrr*rr+r
r
rrKs
zStatisticDiff.__init__cCst|j|j|j|j|jf�Sr)rrrr*rr+rr
r
rrRs�zStatisticDiff.__hash__cCs<|j|jko:|j|jko:|j|jko:|j|jko:|j|jkSrr)rr
r
rrVs
�
�
�
�zStatisticDiff.__eq__cCsPd|jt|jd�t|jd�|j|jf}|jrL|j|j}|dt|d�7}|S)Nz %s: size=%s (%s), count=%i (%+i)FTr)rrrr*rr+rr
r
rr ]s

��zStatisticDiff.__str__cCsd|j|j|j|j|jfS)Nz9<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>r)rr
r
rr!is��zStatisticDiff.__repr__cCs t|j�|jt|j�|j|jfSr)rr*rr+rrrr
r
rr"ns
�zStatisticDiff._sort_keyNr#r
r
r
rr(Dsr(cCs�g}|��D]d\}}|�|d�}|dk	rNt||j|j|j|j|j|j�}nt||j|j|j|j�}|�|�q|��D]*\}}t|d|jd|j�}|�|�qz|S�Nr)�items�popr(rr�append)�	old_group�	new_group�
statisticsr�statZpreviousr
r
r�_compare_grouped_statsts*

��r4c@sXeZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�Frame��_framecCs
||_dSrr6�r�framer
r
rr�szFrame.__init__cCs
|jdSr,r6rr
r
r�filename�szFrame.filenamecCs
|jdS�N�r6rr
r
r�lineno�szFrame.linenocCs|j|jkSrr6rr
r
rr�szFrame.__eq__cCs|j|jkSrr6rr
r
r�__lt__�szFrame.__lt__cCs
t|j�Sr)rr7rr
r
rr�szFrame.__hash__cCsd|j|jfS)Nz%s:%s�r:r=rr
r
rr �sz
Frame.__str__cCsd|j|jfS)Nz<Frame filename=%r lineno=%r>r?rr
r
rr!�szFrame.__repr__N)
r$r%r&r'r�propertyr:r=rr>rr r!r
r
r
rr5�s

r5c@sbeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dS)�	Traceback��_framescCst�|�tt|��|_dSr)rr�tuple�reversedrC)r�framesr
r
rr�s
zTraceback.__init__cCs
t|j�Sr)�lenrCrr
r
r�__len__�szTraceback.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r5��.0�tracer
r
r�	<genexpr>�sz(Traceback.__getitem__.<locals>.<genexpr>)�
isinstance�slicerDrCr5�r�indexr
r
r�__getitem__�s
zTraceback.__getitem__cCs|j|jkSr)r7rCr8r
r
r�__contains__�szTraceback.__contains__cCs
t|j�Sr)rrCrr
r
rr�szTraceback.__hash__cCs|j|jkSrrBrr
r
rr�szTraceback.__eq__cCs|j|jkSrrBrr
r
rr>�szTraceback.__lt__cCst|d�Sr,)�strrr
r
rr �szTraceback.__str__cCsdt|�fS)Nz<Traceback %r>)rDrr
r
rr!�szTraceback.__repr__NFcCs�g}|dk	r2|dkr$||d�}q6|d|�}n|}|rBt|�}|D]@}|�d|j|jf�t�|j|j���}|rF|�d|�qF|S)Nrz  File "%s", line %sz    %s)rEr/r:r=�	linecache�getline�strip)r�limitZmost_recent_first�linesZframe_slicer9�liner
r
r�format�s 
�zTraceback.format)NF)r$r%r&r'rrHrQrRrrr>r r!rZr
r
r
rrA�srAcCs t|�}|dk	rt|�SdSdSr)rrA)�objrFr
r
r�get_object_traceback�sr\c@s\eZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�Trace��_tracecCs
||_dSrr^�rrKr
r
rrszTrace.__init__cCs
|jdSr,r^rr
r
r�domainszTrace.domaincCs
|jdSr;r^rr
r
rr	sz
Trace.sizecCst|jd�S)N�)rAr_rr
r
rr
szTrace.tracebackcCs|j|jkSrr^rr
r
rrszTrace.__eq__cCs
t|j�Sr)rr_rr
r
rrszTrace.__hash__cCsd|jt|jd�fS)Nz%s: %sF)rrrrr
r
rr sz
Trace.__str__cCsd|jt|jd�|jfS)Nz'<Trace domain=%s size=%s, traceback=%r>F)rarrrrr
r
rr!s�zTrace.__repr__N)
r$r%r&r'rr@rarrrrr r!r
r
r
rr]�s


r]c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_TracescCst�|�||_dSr)rr�_traces)r�tracesr
r
rr s
z_Traces.__init__cCs
t|j�Sr)rGrdrr
r
rrH%sz_Traces.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r]rIr
r
rrL*sz&_Traces.__getitem__.<locals>.<genexpr>)rMrNrDrdr]rOr
r
rrQ(s
z_Traces.__getitem__cCs|j|jkSr)r_rdr`r
r
rrR.sz_Traces.__contains__cCs|j|jkSr)rdrr
r
rr1sz_Traces.__eq__cCsdt|�S)Nz<Traces len=%s>)rGrr
r
rr!4sz_Traces.__repr__N)	r$r%r&rrHrQrRrr!r
r
r
rrcsrccCs&tj�|�}|�d�r"|dd�}|S)Nz.pyc���)�os�path�normcase�endswith)r:r
r
r�_normalize_filename8s
rkc@seZdZdd�Zdd�ZdS)�
BaseFiltercCs
||_dSr)�	inclusive)rrmr
r
rr@szBaseFilter.__init__cCst�dSr)�NotImplementedErrorr`r
r
r�_matchCszBaseFilter._matchN)r$r%r&rror
r
r
rrl?srlcsJeZdZd�fdd�	Zedd��Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�FilterNFcs2t��|�||_t|�|_||_||_||_dSr)�superrrmrk�_filename_patternr=�
all_framesra)rrm�filename_patternr=rsra��	__class__r
rrHs
zFilter.__init__cCs|jSr)rrrr
r
rrtQszFilter.filename_patterncCs6t|�}t�||j�sdS|jdkr(dS||jkSdS)NFT)rk�fnmatchrrr=�rr:r=r
r
r�_match_frame_implUs
zFilter._match_frame_implcCs|�||�|jASr)ryrmrxr
r
r�_match_frame^szFilter._match_framecsH�jr,t�fdd�|D��r"�jS�jSn|d\}}��||�SdS)Nc3s|]\}}��||�VqdSr)ry)rJr:r=rr
rrLcs�z*Filter._match_traceback.<locals>.<genexpr>r)rs�anyrmrz)rrr:r=r
rr�_match_tracebackas�
zFilter._match_tracebackcCsD|\}}}|�|�}|jdk	r@|jr2|o0||jkS|p>||jkS|Sr)r|rarm)rrKrarr�resr
r
rrols


z
Filter._match)NFN)r$r%r&rr@rtryrzr|ro�
__classcell__r
r
rurrpGs�	
	rpcs0eZdZ�fdd�Zedd��Zdd�Z�ZS)�DomainFiltercst��|�||_dSr)rqr�_domain)rrmrarur
rrxszDomainFilter.__init__cCs|jSr)r�rr
r
rra|szDomainFilter.domaincCs|\}}}||jk|jASr)rarm)rrKrarrr
r
rro�s
zDomainFilter._match)r$r%r&rr@raror~r
r
rurrws
rc@sTeZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	ddd�Z
ddd�ZdS)�SnapshotcCst|�|_||_dSr)rcre�traceback_limit)rrer�r
r
rr�s
zSnapshot.__init__c	Cs*t|d��}t�||tj�W5QRXdS)N�wb)�open�pickle�dumpZHIGHEST_PROTOCOL)rr:�fpr
r
rr��sz
Snapshot.dumpc
Cs,t|d��}t�|�W5QR�SQRXdS)N�rb)r�r��load)r:r�r
r
rr��sz
Snapshot.loadcs@|rt�fdd�|D��sdS|r<t�fdd�|D��r<dSdS)Nc3s|]}|���VqdSr�ro�rJ�trace_filter�rKr
rrL�s�z)Snapshot._filter_trace.<locals>.<genexpr>Fc3s|]}|���VqdSrr�r�r�r
rrL�s�T)r{)r�include_filters�exclude_filtersrKr
r�r�
_filter_trace�s��zSnapshot._filter_tracecs�t|t�stdt|�j��|rjg�g�|D] }|jrB��|�q,��|�q,���fdd��jjD�}n�jj�	�}t
|�j�S)Nz)filters must be a list of filters, not %scsg|]}����|�r|�qSr
)r�rI�r�r�rr
r�
<listcomp>�s��z*Snapshot.filter_traces.<locals>.<listcomp>)rMr�	TypeError�typer$rmr/rerd�copyr�r�)r�filtersr�Z
new_tracesr
r�r�
filter_traces�s
�zSnapshot.filter_tracesc

Cs�|dkrtd|f��|r.|dkr.td|��i}i}|�s|jjD]�}|\}}}z||}	WnZtk
r�|dkr||}
n(|dkr�|dd�}
n|dddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_WqDtk
�rt|	|d�||	<YqDXqDn�|jjD]�}|\}}}|D]�}z||}	WnFtk
�r~|dk�r\|f}
n|ddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_Wn&tk
�r�t|	|d�||	<YnX�q(�q|S)	N)rr:r=zunknown key_type: %r)r=r:z/cumulative mode cannot by used with key type %rrr=r<r)�
ValueErrorrerd�KeyErrorrArrr)
r�key_type�
cumulativeZstatsZ
tracebacksrKrarZtrace_tracebackrrFr3r9r
r
r�	_group_by�sZ�


zSnapshot._group_byFcCs,|�||�}t|���}|jdtjd�|S�NT)�reverse�key)r��list�values�sortrr")rr�r�Zgroupedr2r
r
rr2�szSnapshot.statisticscCs6|�||�}|�||�}t||�}|jdtjd�|Sr�)r�r4r�r(r")rZold_snapshotr�r�r1r0r2r
r
r�
compare_tos

zSnapshot.compare_toN)F)F)r$r%r&rr��staticmethodr�r�r�r�r2r�r
r
r
rr��s
3

r�cCs$t�std��t�}t�}t||�S)NzLthe tracemalloc module must be tracing memory allocations to take a snapshot)�
is_tracing�RuntimeErrorrZget_traceback_limitr�)rer�r
r
r�
take_snapshot
s
r�)Zcollections.abcrr�	functoolsrrwrTZos.pathrgr�Z_tracemallocrrrrr(r4r5rAr\r]rcrkrlrprr�r�r
r
r
r�<module>s2&0"?%0	sre_parse.cpython-38.opt-1.pyc000064400000052142151450073350012125 0ustar00U

e5d&��@s�dZddlTdZdZed�Zed�Zed�Zed�Zed	�Z	ee
eh�Zee
eeeeeh�Zeed
�feed�feed�feed
�feed�feed�feed�feed�fd�Zeefeefeefeeefgfeeefgfeeefgfeeefgfeeefgfeeefgfee fd�
Z!e"e#e$e%e&e'e(e)d�Z*e'e#Be)BZ+e,e(BZ-Gdd�de.�Z/Gdd�d�Z0Gdd�d�Z1Gdd�d�Z2dd�Z3dd �Z4d!d"�Z5d#d$�Z6d3d&d'�Z7d(d)�Z8d*d+�Z9d4d-d.�Z:d/d0�Z;d1d2�Z<d,S)5zInternal support module for sre�)�*z.\[{()*+?^$|z*+?{�
0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz 	

����
�
�	��\)z\a�\bz\fz\nz\rz\tz\vz\\)
z\Arz\Bz\dz\Dz\sz\Sz\wz\Wz\Z)�i�L�m�s�x�a�t�uc@seZdZdS)�VerboseN)�__name__�
__module__�__qualname__�rr�!/usr/lib64/python3.8/sre_parse.pyrGsrc@sBeZdZdd�Zedd��Zddd�Zdd	�Zd
d�Zdd
�Z	dS)�StatecCsd|_i|_dg|_d|_dS)Nr)�flags�	groupdict�groupwidths�lookbehindgroups��selfrrr�__init__LszState.__init__cCs
t|j�S�N)�lenrr rrr�groupsQszState.groupsNcCsb|j}|j�d�|jtkr$td��|dk	r^|j�|d�}|dk	rTtd|||f��||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)r%r�append�	MAXGROUPS�errorr�get)r!�name�gid�ogidrrr�	opengroupTs
�
zState.opengroupcCs|��|j|<dSr#)�getwidthr)r!r+�prrr�
closegroup`szState.closegroupcCs||jko|j|dk	Sr#)r%r)r!r+rrr�
checkgroupbszState.checkgroupcCs6|jdk	r2|�|�s|�d��||jkr2|�d��dS)N�cannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr1r()r!r+�sourcerrr�checklookbehindgroupes




zState.checklookbehindgroup)N)
rrrr"�propertyr%r-r0r1r4rrrrrJs

rc@s`eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
SubPatternNcCs"||_|dkrg}||_d|_dSr#)�state�data�width)r!r7r8rrrr"os
zSubPattern.__init__rcCs�d}ttf}|jD�]t\}}t|dt|�dd�|tkrlt�|D]"\}}t|ddt|�|�qFq|tkr�t�t|d�D]*\}}|r�t|dd�|�|d�q�q|t	k�r|\}}	}
td|�|	�|d�|
�r�t|dd�|
�|d�qt
||��r~d}|D]T}t
|t��rJ|�s6t�|�|d�d}n"|�s\td	dd�t|dd�d}�q|�s�t�qtd|�qdS)
NTz  �)�end��OR�ELSEF� )�tuple�listr8�print�str�IN�BRANCH�	enumerate�dump�GROUPREF_EXISTS�
isinstancer6)r!�level�nl�seqtypes�op�avrr
�	condgroup�item_yes�item_norrrrGvsH


zSubPattern.dumpcCs
t|j�Sr#)�reprr8r rrr�__repr__�szSubPattern.__repr__cCs
t|j�Sr#)r$r8r rrr�__len__�szSubPattern.__len__cCs|j|=dSr#�r8�r!�indexrrr�__delitem__�szSubPattern.__delitem__cCs&t|t�rt|j|j|�S|j|Sr#)rI�slicer6r7r8rVrrr�__getitem__�s
zSubPattern.__getitem__cCs||j|<dSr#rU�r!rW�coderrr�__setitem__�szSubPattern.__setitem__cCs|j�||�dSr#)r8�insertr[rrrr^�szSubPattern.insertcCs|j�|�dSr#)r8r&)r!r\rrrr&�szSubPattern.appendc	Cs�|jdk	r|jSd}}|jD�]�\}}|tkr|td}d}|dD]$}|��\}}t||�}t||�}qD||}||}q|tkr�|��\}}||}||}q|tkr�|d��\}}||}||}q|t	k�r|d��\}}|||d}|||d}q|t
k�r$|d}|d}q|tk�rP|jj
|\}}||}||}q|tk�r�|d��\}}|ddk	�r�|d��\}}t||�}t||�}nd}||}||}q|tkr�q�qt|td�t|t�f|_|jS)Nrr<����)r9r8rE�	MAXREPEATr.�min�max�CALL�
SUBPATTERN�_REPEATCODES�
_UNITCODES�GROUPREFr7rrH�SUCCESS)	r!�lo�hirMrNr
�j�l�hrrrr.�sZ












zSubPattern.getwidth)N)r)
rrrr"rGrSrTrXrZr]r^r&r.rrrrr6ms

(r6c@sbeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	d
d��Z
dd�Zdd�Zddd�Z
dS)�	TokenizercCs@t|t�|_||_|js"t|d�}||_d|_d|_|��dS)N�latin1r)rIrC�istext�string�decoded_stringrW�next�_Tokenizer__next)r!rrrrrr"�s
zTokenizer.__init__cCs�|j}z|j|}Wntk
r0d|_YdSX|dkr�|d7}z||j|7}Wn.tk
r�td|jt|j�d�d�YnX|d|_||_dS)Nrr<zbad escape (end of pattern))rWrs�
IndexErrorrtr(rrr$)r!rW�charrrr�__next�s&��
zTokenizer.__nextcCs||jkr|��dSdS)NTF�rtru)r!rwrrr�match�s
zTokenizer.matchcCs|j}|��|Sr#ry)r!�thisrrrr)�sz
Tokenizer.getcCs8d}t|�D]&}|j}||kr"q4||7}|��q|S�Nr:)�rangertru)r!�n�charset�result�_�crrr�getwhiles
zTokenizer.getwhilecCsld}|j}|��|dkr@|s,|�d|��|�d|t|���||kr^|sh|�d|d��qh||7}q|S)Nr:zmissing zmissing %s, unterminated namer<)rtrur(r$)r!�
terminatorr*r�r�rrr�getuntils
�
zTokenizer.getuntilcCs|jt|jpd�Sr|�rWr$rtr rrr�possz
Tokenizer.poscCs|jt|jpd�Sr|r�r rrr�tellszTokenizer.tellcCs||_|��dSr#)rWrurVrrr�seek szTokenizer.seekrcCst||j|��|�Sr#)r(rrr�)r!�msg�offsetrrrr($szTokenizer.errorN)r)rrrr"rurzr)r�r�r5r�r�r�r(rrrrro�s		
roc	Cs�t�|�}|r|St�|�}|r0|dtkr0|S�zJ|dd�}|dkr�||�dt�7}t|�dkrx|�d|t|���tt	|dd�d�fWS|dkr�|j
r�||�dt�7}t|�d	kr�|�d|t|���tt	|dd�d�fWS|d
k�rN|j
�rN||�dt�7}t|�dk�r*|�d|t|���t	|dd�d�}t|�t|fWS|d
k�r�|j
�r�ddl}|�
d��s~|�d��|�dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|tk�r.||�dt�7}t	|dd�d�}|dk�r$|�d|t|���t|fWS|tk�r<t�t|�dk�rz|tk�rh|�d|t|���tt|d�fWSWntk
�r�YnX|�d|t|���dS)Nrr<r`r��incomplete escape %s�r��U��
�N�{�	missing {�}�character name�undefined character name %r�\N{}��.octal escape value %s outside of range 0-0o377�
bad escape %s)�ESCAPESr)�
CATEGORIESrDr��	HEXDIGITSr$r(�LITERAL�intrq�chr�unicodedatarzr��ord�lookup�KeyError�	OCTDIGITS�DIGITS�
ValueError�ASCIILETTERS)r3�escaper\r�r��charnamerrr�
_class_escape'sp




�



��


r�c	Csft�|�}|r|St�|�}|r$|S�z|dd�}|dkr�||�dt�7}t|�dkrl|�d|t|���tt|dd�d�fWS|dkr�|j	r�||�dt�7}t|�dkr�|�d|t|���tt|dd�d�fWS|d	k�rB|j	�rB||�d
t�7}t|�dk�r|�d|t|���t|dd�d�}t
|�t|fWS|dk�r�|j	�r�d
dl}|�d��sr|�d��|�
dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|dk�r||�dt�7}tt|dd�d
�fWS|tk�r�|jtk�r�||��7}|dtk�r�|dtk�r�|jtk�r�||��7}t|dd�d
�}|dk�r�|�d|t|���t|fWSt|dd��}||jk�r�|�|��s�|�dt|���|�||�t|fWS|�d|t|�d��t|�dk�r4|tk�r"|�d|t|���tt|d�fWSWntk
�rLYnX|�d|t|���dS)Nr<r`rr�r�r�rr�r�r�r�r�rr�r�r�r�r�r��0r�r�r2�invalid group reference %dr�)r�r)r�r�r�r$r(r�r�rqr�r�rzr�r�r�r�r�r�rtr%r1r4rhr�r�)r3r�r7r\r�r�r��grouprrr�_escapecs�




�



�
��
�

r�cCstt�|��Sr#)rA�dict�fromkeys)�itemsrrr�_uniq�sr�cCsVg}|j}|j}|��}|t||||d|o2|��|d�sqDqt|�dkrX|dSt|�}d}	|D].}
|
stq�|	dkr�|
d}	qh|
d|	krhq�qh|D]
}
|
d=q�|�|	�q`q�q`g}|D]h}
t|
�dkr��q@|
d\}}
|tkr�|�||
f�q�|tk�r"|
ddtk	�r"|�	|
�q��q@q�|�tt
|�f�|S|�td|ff�|S)Nr<�|r)r&rzr��_parser$r6r�rD�NEGATE�extendr�rE)r3r7�verbose�nestedr��itemsappend�sourcematch�start�
subpattern�prefix�item�setrMrNrrr�
_parse_sub�sN
�

r�Fc/
Cs�t|�}|j}|j}|j}t}	t}
|j}|dkr4�q*|dkr@�q*|�|rx|tkrTq"|dkrx|�}|dksv|dkr\q"q\q"|ddkr�t|||�}||�q"|t	kr�|t
|
|�f�q"|dk�r�|��d}
g}|j}|jdk�rddl}|j
d|��t|d	d
�|d�}|�}|dk�r0|�d|��|
��|d
k�rF|�rF�qbn�|ddk�r`t||�}n~|�r�|dk�r�|j|k�r�ddl}|j
d|dk�r�dn|dk�r�dn|dk�r�dnd|��dft|d	d
�t
|
|�f}|d��r<|�}|dk�r|�d|��|
��|d
k�rL|dtk�r0|dd}||�|t
|
d�f��qb|ddk�rft||�}n>|dk�r�ddl}|j
d|��dt|d	d
�t
|
|�f}|dt
k�s�|dt
k�r�d||f}|�|t|�dt|���|d}|d}||k�r*d||f}|�|t|�dt|���|t||ff�n"|dtk�rV|dd}||��qt|�}|	|�dk�r�|ddt
k�r�|�r�|t|ddf�n||d�n"|�r�|�dtdf�|t|f�q"|tk�r.|��}
|dk�rd\}}�nB|dk�rdt}}�n*|dk�r0dt}}�n|dk�r4|jdk�rX|t
|
|�f�q"dt}}d }}|jtk�r�||�7}�qj|d!��r�|jtk�r�||�7}�q�n|}|d��s�|t
|
|�f�|�|
�q"|�r�t|�}|tk�r�td"��|�rBt|�}|tk�rtd"��||k�rB|�d#|��|
��ntd$|f��|�rV|d%d�}nd}|�rr|ddtk�r�|�d&|��|
t|���|ddtk�r�|�d'|��|
t|���|ddt k�r�|dd\}}}}|dk�r�|�s�|�s�|}|d��rt!|||ff|d%<nt"|||ff|d%<q"|d(k�rF|t#df�q"|d)k�r�|��d} d*}d}!d}d}|d��r|�}|dk�r�|�d+��|d,k�r�|d-��r�|�$d.d/�}!|!�%��s�d0|!}|�|t|!�d��n�|d1��r�|�$d2d/�}!|!�%��sd0|!}|�|t|!�d��|j&�|!�}"|"dk�rFd3|!}|�|t|!�d��|�'|"��sf|�d4t|!�d��|�(|"|�|t)|"f�q"n2|�}|dk�r�|�d+��|�d5|t|�d���nd|d6k�r�d}�nR|dk�r|jdk�r�|�d7|��| ��|�d2k�r�q"�q�q"�n|d8k�r�d}#|d-k�r||�}|dk�r>|�d+��|d9k�r`|�d:|t|�d��d%}#|j*}$|$dk�r||j+|_*t,||||d�}|#dk�r�|$dk�r�d|_*|d2��s�|�d;|��| ��|d1k�r�|t-|#|ff�q"|t.|#|ff�q"�n$|d)k�
rj|�$d2d/�}%|%�%��	rL|j&�|%�}&|&dk�	r�d3|%}|�|t|%�d��n�zt|%�}&|&dk�	rdt/�Wn4t/k
�	r�d0|%}|�|t|%�d�d�YnX|&�	s�|�d<t|%�d��|&t0k�	r�d=|&}|�|t|%�d��|�(|&|�t1||||d�}'|�d>��
r0t1||||d�}(|jd>k�
r4|�d?��nd}(|�d2��
sT|�d;|��| ��|t2|&|'|(ff�q"n�|t3k�
s~|dk�rt4|||�})|)dk�
r�|�
r�|�
r�ddl}|j
d@|j5ddA�t|j5�dAk�
r�dBnd ft6|d	d
�|j7t8@r"|s"t9�q"|)\}}d}n|�dC|t|�d��|dk	�rrz|�:|!�}Wn<tk
�rp}*z|�|*j;t|!�d�d�W5d}*~*XYnX|�s�|t8@�o�|t8@}+t,|||+|d�}|�d2��s�|�d;|��| ��|dk	�r�|�<||�|t ||||ff�q"|dk�r|tt=f�q"|dDk�r|tt>f�q"tdE|f��q"t?t|��ddd%�D]N},||,\}-}.|-t k�r@|.\}}}}|dk�r@|�s@|�s@|||,|,d�<�q@|S)FNz|)�#rrr�[r<z"Possible nested set at position %dr�)�
stacklevel�^zunterminated character set�]z-&~|zPossible set %s at position %d�-�
difference�&�intersection�~zsymmetric difference�unionz&Possible set difference at position %dr`zbad character range %s-%s�?)rr<r�+r�r�r:�,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rr_znothing to repeatzmultiple repeat�.�(Tzunexpected end of pattern�P�<�>�
group name�bad character in group name %r�=�)�unknown group name %rr2zunknown extension ?P�:zmissing ), unterminated commentz=!<z=!zunknown extension ?<z"missing ), unterminated subpatternzbad group numberr�r�z/conditional backref with more than two branchesz-Flags not at the start of the expression %r%s�z (truncated)zunknown extension ?�$z unsupported special character %r)@r6r&r)rzr$r�rt�
WHITESPACEr��
SPECIAL_CHARSr�r��warnings�warn�
FutureWarningr(r�rD�RANGEr��NOT_LITERALr^r��REPEAT_CHARSrar�r�r��
OverflowError�AssertionError�ATrfre�
MIN_REPEAT�
MAX_REPEAT�ANYr��isidentifierrr1r4rhrr%r��ASSERT�
ASSERT_NOTr�r'r�rH�FLAGS�_parse_flagsrr�DeprecationWarningr�SRE_FLAG_VERBOSErr-r�r0�AT_BEGINNING�AT_ENDr})/r3r7r�r��firstr��subpatternappend�	sourcegetr��_len�_ordr{r\�herer��	setappendr��negate�code1�that�code2r�rjrkrbrcrwr�r��	add_flags�	del_flagsr/r�r*r+�dirr�condnamerOrPrQr�err�sub_verboser
rMrNrrrr��s|


�

�
��	


�


��
 












���












�



�


�






�




�





�

�
��

�
*�
�



r�cCs�|j}d}d}|dkr�t|}|jr<|dkrRd}|�|��n|dkrRd}|�|��||O}|t@r||t@|kr|d}|�|��|�}|dkr�|�d��|d	kr�q�|tkr|��r�d
nd}|�|t|���q|dkr�|j|O_dS|t@r�|�dd
��|dk�r�|�}|dk�r|�d��|tk�rF|���r2d
nd}|�|t|���t|}|t@�rfd}|�|��||O}|�}|dk�r�|�d��|dk�r��q�|tk�rF|���r�d
nd}|�|t|����qF|t@�r�|�dd
��||@�r�|�dd
��||fS)Nrr�rz8bad inline flags: cannot use 'L' flag with a str patternrz:bad inline flags: cannot use 'u' flag with a bytes patternz9bad inline flags: flags 'a', 'u' and 'L' are incompatiblezmissing -, : or )z)-:zunknown flagr�z,bad inline flags: cannot turn on global flagr<zmissing flagz8bad inline flags: cannot turn off flags 'a', 'u' and 'L'z	missing :r�z-bad inline flags: cannot turn off global flagz(bad inline flags: flag turned on and off)	r)r�rqr(�
TYPE_FLAGS�isalphar$r�GLOBAL_FLAGS)r3r7rwr�rr�flagr�rrrr�]sl














r�cCsjt|t�r>|t@rtd��|t@s,|tO}qf|t@rftd��n(|t@rNtd��|t@rf|t@rftd��|S)Nz)cannot use LOCALE flag with a str patternz(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz'ASCII and LOCALE flags are incompatible)rIrC�SRE_FLAG_LOCALEr��SRE_FLAG_ASCII�SRE_FLAG_UNICODE)�srcrrrr�	fix_flags�s


rNcCs�t|�}|dkrt�}||_||_zt|||t@d�}WnBtk
rzt�}|tB|_||_|�d�t||dd�}YnXt||j	j�|j	_|j
dk	r�|�d��|t@r�|�
�|S)NrTzunbalanced parenthesis)rorrrCr�r�rr�rr7rtr(�SRE_FLAG_DEBUGrG)rCrr7r3r/rrr�parse�s&



rcs�t|���j}g�g�g��j}�����fdd�}�j}|�}|dkrL�q�|ddk�r�|d}|dk�rJd}��d�s���d	����d
d�}|��r�z||}	Wn tk
r�t	d|��YnXnlzt
|�}	|	dkr�t�Wn0tk
�r��d
|t|�d�d�YnX|	t
k�r4��d|	t|�d��||	t|�d��q�|dk�r��jtk�r�||�7}�jtk�r�||�7}|tt
|dd�d�d@���q�|tk�rZd}
�jtk�r4||�7}|tk�r4|dtk�r4�jtk�r4||�7}d}
t
|dd�d�}|dk�r(��d|t|���|t|��|
�s�|t
|dd��t|�d�nRztt|d�}Wn4tk
�r�|tk�r���d|t|���YnX||�q:||�q:��rΈ�d����t|t��s�dd��D����fS)NcsX|�jkr��d||���r8��d�����dd�=��t��|f���d�dS)Nr�r:)r%r(r&�joinr$)rWr��r%�literal�literalsrr7rr�addgroup�s

z parse_template.<locals>.addgrouprrr<�gr:r�z	missing <r�r�r�r�r�r�r�r�Fr`Tr�r�cSs"g|]}|dkrdn|�d��qS)Nzlatin-1)�encode)�.0rrrr�
<listcomp>sz"parse_template.<locals>.<listcomp>)ror)r&�
groupindexrzr(r�r�r�rvr�r�r$r'rtr�r�r�r�r�rrIrC)r3r7�sget�lappendrrr{r�r*rW�isoctalrrr�parse_template�s�




��


�


"

�

�� 


rcCsv|j}|jdd�}|\}}|dd�}z"|D]\}}||�p@|||<q.Wn tk
rjtd|��YnX|�|�S)Nrr�)r�rrrvr(r)�templaterzr�emptyr%rrWr�rrr�expand_templatesr")F)rN)=�__doc__�
sre_constantsr�r��	frozensetr�r�r�r�r�r�r�rfr�r�rDr�r��CATEGORYrgr�r�r�ZAT_BEGINNING_STRINGZAT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_NOT_WORDZ
AT_END_STRINGr��SRE_FLAG_IGNORECASEr�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALLr�r�SRE_FLAG_TEMPLATEr
r�rrr	�	Exceptionrrr6ror�r�r�r�r�r�rrrr"rrrr�<module>sr







���
#rH<M:
r<
 Udecimal.cpython-38.pyc000064400000000551151450073350010576 0ustar00U

e5d@�@svz0ddlTddlmZddlmZddlmZWn@ek
rpddlTddlmZddlmZddlmZYnXdS)�)�*)�__doc__)�__version__)�__libmpdec_version__N)Z_decimalrrr�ImportErrorZ
_pydecimal�rr�/usr/lib64/python3.8/decimal.py�<module>scmd.cpython-38.opt-1.pyc000064400000030524151450073350010705 0ustar00U

e5d:�@s@dZddlZddlZdgZdZejejdZGdd�d�ZdS)a	A generic class to build line-oriented command interpreters.

Interpreters constructed with this class obey the following conventions:

1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
   of characters in the identchars member.
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
   is passed a single argument consisting of the remainder of the line.
4. Typing an empty line repeats the last command.  (Actually, it calls the
   method `emptyline', which may be overridden in a subclass.)
5. There is a predefined `help' method.  Given an argument `topic', it
   calls the command `help_topic'.  With no arguments, it lists all topics
   with defined help_ functions, broken into up to three topics; documented
   commands, miscellaneous help topics, and undocumented commands.
6. The command '?' is a synonym for `help'.  The command '!' is a synonym
   for `shell', if a do_shell method exists.
7. If completion is enabled, completing commands will be done automatically,
   and completing of commands args is done by calling complete_foo() with
   arguments text, line, begidx, endidx.  text is string we are matching
   against, all returned matches must begin with it.  line is the current
   input line (lstripped), begidx and endidx are the beginning and end
   indexes of the text being matched, which could be used to provide
   different completion depending upon which position the argument is in.

The `default' method may be overridden to intercept commands for which there
is no do_ method.

The `completedefault' method may be overridden to intercept completions for
commands that have no complete_ method.

The data member `self.ruler' sets the character used to draw separator lines
in the help messages.  If empty, no ruler line is drawn.  It defaults to "=".

If the value of `self.intro' is nonempty when the cmdloop method is called,
it is printed out on interpreter startup.  This value may be overridden
via an optional argument to the cmdloop() method.

The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.
�N�Cmdz(Cmd) �_c@s�eZdZdZeZeZdZdZ	dZ
dZdZdZ
dZdZd	Zd0dd�Zd1d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Z d+d,�Z!d2d.d/�Z"dS)3raA simple framework for writing line-oriented command interpreters.

    These are often useful for test harnesses, administrative tools, and
    prototypes that will later be wrapped in a more sophisticated interface.

    A Cmd instance or subclass instance is a line-oriented interpreter
    framework.  There is no good reason to instantiate Cmd itself; rather,
    it's useful as a superclass of an interpreter class you define yourself
    in order to inherit Cmd's methods and encapsulate action methods.

    �=�Nz(Documented commands (type help <topic>):zMiscellaneous help topics:zUndocumented commands:z*** No help on %s��tabcCs@|dk	r||_ntj|_|dk	r(||_ntj|_g|_||_dS)a�Instantiate a line-oriented interpreter framework.

        The optional argument 'completekey' is the readline name of a
        completion key; it defaults to the Tab key. If completekey is
        not None and the readline module is available, command completion
        is done automatically. The optional arguments stdin and stdout
        specify alternate input and output file objects; if not specified,
        sys.stdin and sys.stdout are used.

        N)�stdin�sys�stdout�cmdqueue�completekey)�selfrrr
�r�/usr/lib64/python3.8/cmd.py�__init__LszCmd.__init__cCs�|��|jr\|jr\z2ddl}|��|_|�|j�|�|jd�Wnt	k
rZYnXz�|dk	rl||_
|j
r�|j�t
|j
�d�d}|�s4|jr�|j�d�}nl|jr�zt|j�}Wntk
r�d}YnXn<|j�|j�|j��|j��}t|��sd}n
|�d�}|�|�}|�|�}|�||�}q�|��W5|j�r�|j�r�zddl}|�|j�Wnt	k
�r~YnXXdS)z�Repeatedly issue a prompt, accept input, parse an initial prefix
        off the received input, and dispatch to action methods, passing them
        the remainder of the line as argument.

        rNz
: complete�
�EOFz
)�preloop�use_rawinputr�readlineZ
get_completerZ
old_completerZ
set_completer�complete�parse_and_bind�ImportError�intror
�write�strr�pop�input�prompt�EOFError�flushr�len�rstrip�precmd�onecmd�postcmd�postloop)r
rr�stop�linerrr�cmdloopbsN






zCmd.cmdloopcCs|S)z�Hook method executed just before the command line is
        interpreted, but after the input prompt is generated and issued.

        r�r
r(rrrr#�sz
Cmd.precmdcCs|S)z?Hook method executed just after a command dispatch is finished.r)r
r'r(rrrr%�szCmd.postcmdcCsdS)z>Hook method executed once when the cmdloop() method is called.Nr�r
rrrr�szCmd.preloopcCsdS)zYHook method executed once when the cmdloop() method is about to
        return.

        Nrr+rrrr&�szCmd.postloopcCs�|��}|sdd|fS|ddkr4d|dd�}n2|ddkrft|d�r\d|dd�}n
dd|fSdt|�}}||kr�|||jkr�|d}qt|d|�||d���}}|||fS)	z�Parse the line into a command name and a string containing
        the arguments.  Returns a tuple containing (command, args, line).
        'command' and 'args' may be None if the line couldn't be parsed.
        Nr�?zhelp r�!Zdo_shellzshell )�strip�hasattrr!�
identchars)r
r(�i�n�cmd�argrrr�	parseline�s



z
Cmd.parselinecCs�|�|�\}}}|s|��S|dkr.|�|�S||_|dkrBd|_|dkrT|�|�Szt|d|�}Wntk
r�|�|�YSX||�SdS)ahInterpret the argument as though it had been typed in response
        to the prompt.

        This may be overridden, but should not normally need to be;
        see the precmd() and postcmd() methods for useful execution hooks.
        The return value is a flag indicating whether interpretation of
        commands by the interpreter should stop.

        Nrr�do_)r5�	emptyline�default�lastcmd�getattr�AttributeError)r
r(r3r4�funcrrrr$�s


z
Cmd.onecmdcCs|jr|�|j�SdS)z�Called when an empty line is entered in response to the prompt.

        If this method is not overridden, it repeats the last nonempty
        command entered.

        N)r9r$r+rrrr7�sz
Cmd.emptylinecCs|j�d|�dS)z�Called on an input line when the command prefix is not recognized.

        If this method is not overridden, it prints an error message and
        returns.

        z*** Unknown syntax: %s
N)r
rr*rrrr8�szCmd.defaultcGsgS)z�Method called to complete an input line when no command-specific
        complete_*() method is available.

        By default, it returns an empty list.

        r)r
�ignoredrrr�completedefault�szCmd.completedefaultcsd|��fdd�|��D�S)Nr6cs"g|]}|���r|dd��qS)�N��
startswith��.0�a�Zdotextrr�
<listcomp>�s
z%Cmd.completenames.<locals>.<listcomp>)�	get_names)r
�textr=rrEr�
completenames�szCmd.completenamesc
Cs�|dkr�ddl}|��}|��}t|�t|�}|��|}|��|}|dkr�|�|�\}	}
}|	dkrp|j}q�zt|d|	�}Wq�t	k
r�|j}Yq�Xn|j
}|||||�|_z|j|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        rNrZ	complete_)
rZget_line_buffer�lstripr!Z
get_begidxZ
get_endidxr5r>r:r;rIZcompletion_matches�
IndexError)
r
rH�staterZorigliner(�strippedZbegidxZendidxr3�argsZfooZcompfuncrrrr�s*zCmd.completecCs
t|j�S)N)�dir�	__class__r+rrrrGsz
Cmd.get_namescs4t|j���}t�fdd�|��D��}t||B�S)Nc3s,|]$}|�d�d�r|dd�VqdS)�help_r�Nr@rB�rNrr�	<genexpr> s�z$Cmd.complete_help.<locals>.<genexpr>)�setrIrG�list)r
rNZcommandsZtopicsrrSr�
complete_helpszCmd.complete_helpcCs�|r�zt|d|�}Wn|tk
r�z4t|d|�j}|rX|j�dt|��WYdSWntk
rnYnX|j�dt|j|f��YdSX|��n|��}g}g}i}|D]$}|dd�dkr�d||dd�<q�|��d}	|D]p}|dd�dkr�||	k�rq�|}	|dd�}
|
|k�r8|�	|
�||
=q�t||�j�rR|�	|
�q�|�	|
�q�|j�dt|j
��|�|j|d	d
�|�|j
t|���d	d
�|�|j|d	d
�dS)zEList available commands with "help" or detailed help with "help cmd".rQr6�%s
NrRrrr?��P)r:r;�__doc__r
rr�nohelprG�sort�append�
doc_leader�print_topics�
doc_header�misc_headerrV�keys�undoc_header)r
r4r<�doc�namesZcmds_docZ
cmds_undoc�help�nameZprevnamer3rrr�do_help$sN



zCmd.do_helpcCs\|rX|j�dt|��|jr<|j�dt|jt|���|�||d�|j�d�dS)NrXrr)r
rr�rulerr!�	columnize)r
�headerZcmdsZcmdlenZmaxcolrrrr`RszCmd.print_topicsrZcs��s|j�d�dS�fdd�tt���D�}|rJtdd�tt|����t��}|dkrv|j�dt�d	��dStdt���D]�}||d|}g}d
}t|�D]h}	d	}
t|�D]2}|||	}||kr�q�|}
t|
t|
��}
q�|�	|
�||
d7}||kr��qq�||kr��q4q�t��}d}d	g}t|�D]�}g}t|�D]4}	|||	}||k�rld}
n�|}
|�	|
��qL|�r�|d
�s�|d
=�q�tt|��D]}	||	�
||	�||	<�q�|j�dtd�|����q<dS)z�Display a list of strings as a compact set of columns.

        Each column is only as wide as necessary.
        Columns are separated by two spaces (one was not legible enough).
        z<empty>
Ncsg|]}t�|t�s|�qSr)�
isinstancer)rCr1�rVrrrFds�z!Cmd.columnize.<locals>.<listcomp>z list[i] not a string for i in %sz, rrXr����r���z  )r
r�ranger!�	TypeError�join�mapr�maxr^�ljust)r
rVZdisplaywidthZ
nonstrings�sizeZnrowsZncolsZ	colwidthsZtotwidth�colZcolwidth�rowr1�xZtextsrrnrrkZs\�


z
Cmd.columnize)rNN)N)rZ)#�__name__�
__module__�__qualname__r[�PROMPTr�
IDENTCHARSr0rjr9rr_rarbrdr\rrr)r#r%rr&r5r$r7r8r>rIrrGrWrir`rkrrrrr4s<

4
		.)	r[�stringr	�__all__rZ
ascii_lettersZdigitsr�rrrrr�<module>s
,profile.cpython-38.pyc000064400000034675151450073350010656 0ustar00U

e5d�[�@sxdZddlZddlZddlZddlZdddgZGdd�d�Zdd	d�Zdd
d�ZGdd�d�Z	dd
�Z
edkrte
�dS)z Class for profiling Python code.�N�run�runctx�Profilec@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Utilsz�Support class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    cCs
||_dS�N)�profiler)�selfr�r	�/usr/lib64/python3.8/profile.py�__init__0sz_Utils.__init__cCsF|��}z(z|�|�Wntk
r,YnXW5|�|||�XdSr)r�_showr�
SystemExit)r�	statement�filename�sort�profr	r	r
r3s
z
_Utils.runcCsJ|��}z,z|�|||�Wntk
r0YnXW5|�|||�XdSr)rrrr
)rr�globals�localsrrrr	r	r
r<s
z
_Utils.runctxcCs"|dk	r|�|�n
|�|�dSr)�
dump_stats�print_stats)rrrrr	r	r
rEsz_Utils._showN)�__name__�
__module__�__qualname__�__doc__rrrrr	r	r	r
r*s
		r���cCstt��|||�S)aRun statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    )rrr)rrrr	r	r
rQscCstt��|||||�S)z�Run statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    )rrr)rrrrrr	r	r
r^sc@s�eZdZdZdZd5dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ee
e
ee
e
d�Zdd�ZGdd�d�ZGdd�d�Zdd�Zdd �Zd6d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0e_d7d1d2�Zd3d4�ZdS)8raProfiler class.

    self.cur is always a tuple.  Each such tuple corresponds to a stack
    frame that is currently active (self.cur[-2]).  The following are the
    definitions of its members.  We use this external "parallel stack" to
    avoid contaminating the program that we are profiling. (old profiler
    used to write into the frames local dictionary!!) Derived classes
    can change the definition of some entries, as long as they leave
    [-2:] intact (frame and previous tuple).  In case an internal error is
    detected, the -3 element is used as the function name.

    [ 0] = Time that needs to be charged to the parent frame's function.
           It is used so that a function call will not have to access the
           timing data for the parent frame.
    [ 1] = Total time spent in this frame's function, excluding time in
           subfunctions (this latter is tallied in cur[2]).
    [ 2] = Total time spent in subfunctions, excluding time executing the
           frame's function (this latter is tallied in cur[1]).
    [-3] = Name of the function that corresponds to this frame.
    [-2] = Actual frame that we correspond to (used to sync exception handling).
    [-1] = Our parent 6-tuple (corresponds to frame.f_back).

    Timing data for each function is stored as a 5-tuple in the dictionary
    self.timings[].  The index is always the name stored in self.cur[-3].
    The following are the definitions of the members:

    [0] = The number of times this function was called, not counting direct
          or indirect recursion,
    [1] = Number of times this function appears on the stack, minus one
    [2] = Total time spent internal to this function
    [3] = Cumulative time that this function was present on the stack.  In
          non-recursive functions, this is the total execution time from start
          to finish of each invocation of a function, including time spent in
          all subfunctions.
    [4] = A dictionary indicating for each function name, the number of times
          it was called by us.
    rNcCs�i|_d|_d|_d|_|dkr&|j}||_|sHtj|_|_|j	|_
nl||_|��}zt|�}Wn"tk
r�||_|j	|_
Yn0X|dkr�|j
|_
n|j|_
|tfdd�}||_|��|_|�d�dS)N��cSs
||��Srr	)�timer�sumr	r	r
�get_time_timer�sz(Profile.__init__.<locals>.get_time_timerr)�timings�cur�cmd�c_func_name�bias�time�process_timer�get_time�trace_dispatch_i�
dispatcher�len�	TypeError�trace_dispatch�trace_dispatch_lr�t�
simulate_call)rrr$r.Zlengthrr	r	r
r�s0


zProfile.__init__cCs�|j}|�}|d|d|j|j}|dkr8|j|_|j||||�rd|�}|d|d|_n|�}|d|d||_dS)Nr��c_call�rr.r$rr#�dispatch)r�frame�event�argrr.�rr	r	r
r,�szProfile.trace_dispatchcCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dS�Nr1r2�rr4r5r6rr.r	r	r
r(�s
zProfile.trace_dispatch_icCs`|j}|�d|j|j}|dkr,|j|_|j||||�rL|�d|_n|�d||_dS)NgN@r1r2r9r	r	r
�trace_dispatch_mac�szProfile.trace_dispatch_maccCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dSr8)r'r.r$rr#r3)rr4r5r6r'r.r	r	r
r-�s
zProfile.trace_dispatch_lc	CsD|j\}}}}}}||k	r*|r*|�||�S|||||||f|_dS�Nr0)r!�trace_dispatch_return)	rr4r.�rpt�rit�ret�rfn�rframe�rcurr	r	r
�trace_dispatch_exception�s
z Profile.trace_dispatch_exceptioncCs|jr�|j|jdk	r�|j\}}}}}}t|tj�s�|j|jksXtd|||j||jf��|�|d�|jdks�|j|jdks�td|jdf��|j}	|	j|	j	|	j
f}
|dd|
||jf|_|j}|
|kr�||
\}}
}}}||
d|||f||
<nddddif||
<dS)N���zBad callr���r0)r!�f_back�
isinstancer�
fake_frame�AssertionErrorr<�f_code�co_filename�co_firstlineno�co_namer )rr4r.r=r>r?r@rArBZfcode�fnr �cc�ns�tt�ct�callersr	r	r
�trace_dispatch_calls4�
���zProfile.trace_dispatch_callc
Csndd|jf}|dd|||jf|_|j}||krX||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr0)r#r!r )
rr4r.rNr rOrPrQrRrSr	r	r
�trace_dispatch_c_callszProfile.trace_dispatch_c_callcCs�||jdk	rB||jdjks0td|jdf��|�|jdd�|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s�||}|d}||kr�||d||<nd||<||d||||f||<dS)NrDz
Bad returnrErr0)r!rFrIr<r )rr4r.r=r>r?r@rBZframe_totalZpptZpitZpetZpfn�pframeZpcurr rOrPrQrRrSr	r	r
r<"s$"zProfile.trace_dispatch_return)�callZ	exception�returnr1Zc_exceptionZc_returncCs"|jdrdS||_|�|�dS)Nr)r!r"r/)rr"r	r	r
�set_cmdXs
zProfile.set_cmdc@seZdZdd�Zdd�ZdS)zProfile.fake_codecCs||_||_||_d|_dS�Nr)rK�co_linerMrL)rr�line�namer	r	r
r^szProfile.fake_code.__init__cCst|j|j|jf�Sr)�reprrKr[rM�rr	r	r
�__repr__dszProfile.fake_code.__repr__N)rrrrr`r	r	r	r
�	fake_code]srac@seZdZdd�ZdS)zProfile.fake_framecCs||_||_dSr)rJrF)r�codeZpriorr	r	r
rhszProfile.fake_frame.__init__N)rrrrr	r	r	r
rHgsrHcCsF|�dd|�}|jr |jd}nd}|�||�}|jd||d�dS)NZprofilerrDrW)rar!rHr3)rr]rbrVr4r	r	r
r/lszProfile.simulate_callcCsJ|j}|�|j}|jdr:|jd||jd|�d}q|�||_dS)NrrXrDr)r'r.r!r3)rr'r.r	r	r
�simulate_cmd_completexs
zProfile.simulate_cmd_completercCs$ddl}|�|����|���dSrZ)�pstatsZStatsZ
strip_dirsZ
sort_statsr)rrrdr	r	r
r�szProfile.print_statsc	Cs0t|d��}|��t�|j|�W5QRXdS)N�wb)�open�create_stats�marshal�dump�stats)r�file�fr	r	r
r�szProfile.dump_statscCs|��|��dSr)rc�snapshot_statsr_r	r	r
rg�szProfile.create_statsc	Cs^i|_|j��D]H\}\}}}}}|��}d}|��D]}||7}q6|||||f|j|<qdSrZ)rjr �items�copy�values)	r�funcrOrPrQrRrSZncZcallcntr	r	r
rm�s
zProfile.snapshot_statscCsddl}|j}|�|||�SrZ)�__main__�__dict__r)rr"rr�dictr	r	r
r�szProfile.runc	Cs8|�|�t�|j�zt|||�W5t�d�X|Sr)rY�sys�
setprofiler)�exec)rr"rrr	r	r
r�s
zProfile.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|�t|��t�	|j
�z|||�W�St�	d�XdS)	Nrz:descriptor 'runcall' of 'Profile' object needs an argumentrqrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr0)r*r+�pop�warnings�warn�DeprecationWarningrYr^rurvr))�args�kwrrqrzr	r	r
�runcall�s(

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs<|jtk	rtd��|j}d|_z|�||�W�S||_XdS)Nz&Subclasses must override .calibrate().r)�	__class__rr+r$�_calibrate_inner)r�m�verboseZ
saved_biasr	r	r
�	calibrate�s
zProfile.calibratecCs|j}dd�}|fdd�}||�|�}||�|�}||}|rLtd|�t�}	|�}|	�dt�t��|�}||}
|r�td|
�d}d}|	j��D]0\\}
}}\}}}}}|d	kr�||7}||7}q�|r�td
|�td|�||dkr�td
|��||d|}|�rtd|�|S)NcSst|�D]}d}qdSr;��range)�n�i�xr	r	r
�f1sz$Profile._calibrate_inner.<locals>.f1cSst|�D]}|d�qdS)N�dr�)r�r�r�r	r	r
rlsz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rlr�z!'CPU seconds' profiler reported =ztotal # calls =r0z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r'�printrrrrr rn�
ValueError)rr�r�r'r�rlZt0�t1Zelapsed_noprofile�pZelapsed_profileZtotal_callsZ
reported_timerr\�funcnamerOrPrQrRrSZmeanr	r	r
r��sB

�



zProfile._calibrate_inner)NN)r)r)rrrrr$rr,r(r:r-rCrTrUr<r3rYrarHr/rcrrrgrmrrr�__text_signature__r�r�r	r	r	r
rgsB&
''�



+
c
Cs�ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddd�|jdddddd
�tjdd�s�|��t�d�|�	�\}}|tjdd�<|j
dk	r�|j�|j
�|_
t
|�dk�r�|jr�ddl}d}|j|dd�}nR|d}	tj�d|j�|	��t�|	��}
t|
��|	d�}W5QRX|	dddd�}zt||d|j
|j�Wn6tk
�r�}zdt_t�|j�W5d}~XYnXn|��|S)Nr)�OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-m�module�
store_truezProfile a library module.)r��actionr�r�z-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrr0rz(run_module(modname, run_name='__main__'))�
run_module�modnamerwrr)�__file__r�__package__�
__cached__)�osZoptparser�Zallow_interspersed_argsZ
add_optionru�argvZprint_usage�exit�
parse_argsr��path�abspathr*r��runpyr��insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)r�r�r��parserZoptionsr}r�rbZglobsZprogname�fp�excr	r	r
�main9s^

�
�
�

�� r�rr)Nr)Nr)rr�rur%rh�__all__rrrrr�rr	r	r	r
�<module>	s

'

	U9profile.cpython-38.opt-2.pyc000064400000026506151450073350011610 0ustar00U

e5d�[�@stddlZddlZddlZddlZdddgZGdd�d�Zddd�Zdd	d�ZGd
d�d�Zdd�Z	e
d
krpe	�dS)�N�run�runctx�Profilec@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_UtilscCs
||_dS�N)�profiler)�selfr�r	�/usr/lib64/python3.8/profile.py�__init__0sz_Utils.__init__cCsF|��}z(z|�|�Wntk
r,YnXW5|�|||�XdSr)r�_showr�
SystemExit)r�	statement�filename�sort�profr	r	r
r3s
z
_Utils.runcCsJ|��}z,z|�|||�Wntk
r0YnXW5|�|||�XdSr)rrrr
)rr�globals�localsrrrr	r	r
r<s
z
_Utils.runctxcCs"|dk	r|�|�n
|�|�dSr)�
dump_stats�print_stats)rrrrr	r	r
rEsz_Utils._showN)�__name__�
__module__�__qualname__rrrrr	r	r	r
r*s		r���cCstt��|||�Sr)rrr)rrrr	r	r
rQscCstt��|||||�Sr)rrr)rrrrrr	r	r
r^sc@s�eZdZdZd4dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
e	eeeed�Z
dd�ZGdd�d�ZGdd�d�Zdd�Zdd�Zd5d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/e_d6d0d1�Zd2d3�ZdS)7rrNcCs�i|_d|_d|_d|_|dkr&|j}||_|sHtj|_|_|j	|_
nl||_|��}zt|�}Wn"tk
r�||_|j	|_
Yn0X|dkr�|j
|_
n|j|_
|tfdd�}||_|��|_|�d�dS)N��cSs
||��Srr	)�timer�sumr	r	r
�get_time_timer�sz(Profile.__init__.<locals>.get_time_timerr)�timings�cur�cmd�c_func_name�bias�time�process_timer�get_time�trace_dispatch_i�
dispatcher�len�	TypeError�trace_dispatch�trace_dispatch_lr�t�
simulate_call)rrr#r-Zlengthrr	r	r
r�s0


zProfile.__init__cCs�|j}|�}|d|d|j|j}|dkr8|j|_|j||||�rd|�}|d|d|_n|�}|d|d||_dS)Nr��c_call�rr-r#rr"�dispatch)r�frame�event�argrr-�rr	r	r
r+�szProfile.trace_dispatchcCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dS�Nr0r1�rr3r4r5rr-r	r	r
r'�s
zProfile.trace_dispatch_icCs`|j}|�d|j|j}|dkr,|j|_|j||||�rL|�d|_n|�d||_dS)NgN@r0r1r8r	r	r
�trace_dispatch_mac�szProfile.trace_dispatch_maccCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dSr7)r&r-r#rr"r2)rr3r4r5r&r-r	r	r
r,�s
zProfile.trace_dispatch_lc	CsD|j\}}}}}}||k	r*|r*|�||�S|||||||f|_dS�Nr/)r �trace_dispatch_return)	rr3r-�rpt�rit�ret�rfn�rframe�rcurr	r	r
�trace_dispatch_exception�s
z Profile.trace_dispatch_exceptioncCs�|jr@|j|jdk	r@|j\}}}}}}t|tj�s@|�|d�|j}	|	j|	j|	j	f}
|dd|
||jf|_|j
}|
|kr�||
\}}
}}}||
d|||f||
<nddddif||
<dS�N���rr/)r �f_back�
isinstancer�
fake_framer;�f_code�co_filename�co_firstlineno�co_namer)rr3r-r<r=r>r?r@rAZfcode�fnr�cc�ns�tt�ct�callersr	r	r
�trace_dispatch_callszProfile.trace_dispatch_callc
Csndd|jf}|dd|||jf|_|j}||krX||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr/)r"r r)
rr3r-rLrrMrNrOrPrQr	r	r
�trace_dispatch_c_callszProfile.trace_dispatch_c_callcCs�||jdk	r |�|jdd�|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s�||}|d}||kr�||d||<nd||<||d||||f||<dSrC)r r;r)rr3r-r<r=r>r?rAZframe_totalZpptZpitZpetZpfn�pframeZpcurrrMrNrOrPrQr	r	r
r;"s"zProfile.trace_dispatch_return)�callZ	exception�returnr0Zc_exceptionZc_returncCs"|jdrdS||_|�|�dS)Nr)r r!r.)rr!r	r	r
�set_cmdXs
zProfile.set_cmdc@seZdZdd�Zdd�ZdS)zProfile.fake_codecCs||_||_||_d|_dS�Nr)rI�co_linerKrJ)rr�line�namer	r	r
r^szProfile.fake_code.__init__cCst|j|j|jf�Sr)�reprrIrYrK�rr	r	r
�__repr__dszProfile.fake_code.__repr__N)rrrrr^r	r	r	r
�	fake_code]sr_c@seZdZdd�ZdS)zProfile.fake_framecCs||_||_dSr)rHrE)r�codeZpriorr	r	r
rhszProfile.fake_frame.__init__N)rrrrr	r	r	r
rGgsrGcCsF|�dd|�}|jr |jd}nd}|�||�}|jd||d�dS)NZprofilerrDrU)r_r rGr2)rr[r`rTr3r	r	r
r.lszProfile.simulate_callcCsJ|j}|�|j}|jdr:|jd||jd|�d}q|�||_dS)NrrVrDr)r&r-r r2)rr&r-r	r	r
�simulate_cmd_completexs
zProfile.simulate_cmd_completercCs$ddl}|�|����|���dSrX)�pstatsZStatsZ
strip_dirsZ
sort_statsr)rrrbr	r	r
r�szProfile.print_statsc	Cs0t|d��}|��t�|j|�W5QRXdS)N�wb)�open�create_stats�marshal�dump�stats)r�file�fr	r	r
r�szProfile.dump_statscCs|��|��dSr)ra�snapshot_statsr]r	r	r
re�szProfile.create_statsc	Cs^i|_|j��D]H\}\}}}}}|��}d}|��D]}||7}q6|||||f|j|<qdSrX)rhr�items�copy�values)	r�funcrMrNrOrPrQZncZcallcntr	r	r
rk�s
zProfile.snapshot_statscCsddl}|j}|�|||�SrX)�__main__�__dict__r)rr!rp�dictr	r	r
r�szProfile.runc	Cs8|�|�t�|j�zt|||�W5t�d�X|Sr)rW�sys�
setprofiler(�exec)rr!rrr	r	r
r�s
zProfile.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|�t|��t�	|j
�z|||�W�St�	d�XdS)	Nrz:descriptor 'runcall' of 'Profile' object needs an argumentrorz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr/)r)r*�pop�warnings�warn�DeprecationWarningrWr\rsrtr()�args�kwrrorxr	r	r
�runcall�s(

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs<|jtk	rtd��|j}d|_z|�||�W�S||_XdS)Nz&Subclasses must override .calibrate().r)�	__class__rr*r#�_calibrate_inner)r�m�verboseZ
saved_biasr	r	r
�	calibrate�s
zProfile.calibratecCs|j}dd�}|fdd�}||�|�}||�|�}||}|rLtd|�t�}	|�}|	�dt�t��|�}||}
|r�td|
�d}d}|	j��D]0\\}
}}\}}}}}|d	kr�||7}||7}q�|r�td
|�td|�||dkr�td
|��||d|}|�rtd|�|S)NcSst|�D]}d}qdSr:��range)�n�i�xr	r	r
�f1sz$Profile._calibrate_inner.<locals>.f1cSst|�D]}|d�qdS)N�dr�)r�r�r�r	r	r
rjsz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rjr�z!'CPU seconds' profiler reported =ztotal # calls =r/z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r&�printrrrrrrl�
ValueError)rr�r�r&r�rjZt0�t1Zelapsed_noprofile�pZelapsed_profileZtotal_callsZ
reported_timerrZ�funcnamerMrNrOrPrQZmeanr	r	r
r�sB

�



zProfile._calibrate_inner)NN)r)r)rrrr#rr+r'r9r,rBrRrSr;r2rWr_rGr.rarrrerkrrr}�__text_signature__r�rr	r	r	r
rgs@'
''�



+
c
Cs�ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddd�|jdddddd
�tjdd�s�|��t�d�|�	�\}}|tjdd�<|j
dk	r�|j�|j
�|_
t
|�dk�r�|jr�ddl}d}|j|dd�}nR|d}	tj�d|j�|	��t�|	��}
t|
��|	d�}W5QRX|	dddd�}zt||d|j
|j�Wn6tk
�r�}zdt_t�|j�W5d}~XYnXn|��|S)Nr)�OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-m�module�
store_truezProfile a library module.)r��actionr�r�z-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrr/rz(run_module(modname, run_name='__main__'))�
run_module�modnamerurp)�__file__r�__package__�
__cached__)�osZoptparser�Zallow_interspersed_argsZ
add_optionrs�argvZprint_usage�exit�
parse_argsr��path�abspathr)r��runpyr��insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)r�r�r��parserZoptionsr{r�r`ZglobsZprogname�fp�excr	r	r
�main9s^

�
�
�

�� r�rp)Nr)Nr)r�rsr$rf�__all__rrrrr�rr	r	r	r
�<module>s

'

	U9posixpath.cpython-38.opt-2.pyc000064400000021013151450073350012153 0ustar00U

e5d=�&@sZdZdZdZdZdZdZdZdZddlZddl	Z	ddl
Z
ddlZddlTd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g&Zd/d0�Z
d1d	�Zd2d
�Zd3d�Zd4d
�Zd5d�Zejje_d6d�Zd7d�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zdadad=d�Zd>d�Zd?d�Z d@d+�Z!dAdB�Z"e	j#dCkZ$dFdDd-�Z%dEd.�Z&dS)G�.�..�/�:z
/bin:/usr/binNz	/dev/null�)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes��path�r2�!/usr/lib64/python3.8/posixpath.py�_get_sep)s
r4cCs
t�|�S�N��os�fspath)�sr2r2r3r4scCst�|�}t|�}|�|�Sr5)r7r8r4�
startswith)r9r#r2r2r3r<s
c
Gs�t�|�}t|�}|}z^|s,|dd�|ttj|�D]8}|�|�rL|}q8|rZ|�|�rd||7}q8|||7}q8Wn.tttfk
r�t	j
d|f|���YnX|S)Nrr	)r7r8r4�mapr:�endswith�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr#r1�br2r2r3r	Gs 


cCs`t�|�}t|�}|�|�d}|d|�||d�}}|rX||t|�krX|�|�}||fS�N��r7r8r4�rfind�len�rstrip)rCr#�i�head�tailr2r2r3rds

cCs6t�|�}t|t�rd}d}nd}d}t�||d|�S)Nr-�.rr)r7r8r.r/r@�	_splitext)rCr#r'r2r2r3rus

cCst�|�}|dd�|fS�Nrr6)rCr2r2r3r
�s
cCs,t�|�}t|�}|�|�d}||d�SrE)r7r8r4rH)rCr#rKr2r2r3r
�s
cCsNt�|�}t|�}|�|�d}|d|�}|rJ||t|�krJ|�|�}|SrErG)rCr#rKrLr2r2r3r�s

c
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)NF)r7�lstat�OSError�
ValueErrorr>�stat�S_ISLNK�st_mode)r1�str2r2r3r�s
c	Cs.zt�|�Wnttfk
r(YdSXdS)NFT)r7rQrRrSr0r2r2r3r�s
c	Cs�zt�|�}Wnttfk
r(YdSXt�|j�r:dSt|t�rPt	|d�}n
t	|d�}t
|�}zt�|�}Wnttfk
r�YdSX|j}|j}||kr�dS|j}|j}||kr�dSdS)NF�..rT)
r7rQrRrSrTrUrVr.r/r	r)�st_dev�st_ino)r1�s1�parent�s2�dev1�dev2�ino1�ino2r2r2r3r�s.

c	Cs<t�|�}t|t�rd}nd}|�|�s,|St|�}|�|d�}|dkrPt|�}|dkr�dtjkr�ddl	}z|�
t���j}Wq�t
k
r�|YSXn
tjd}nVddl	}|d|�}t|t�r�t|d�}z|�|�}Wnt
k
r�|YSX|j}t|t��rt�|�}d}nd}|�|�}|||d��p:|S)	N�~�~rFr�HOME�ASCIIr-r)r7r8r.r/r:r4�findrI�environ�pwd�getpwuid�getuid�pw_dir�KeyError�str�getpwnam�fsencoderJ)	r1�tilder#rKrh�userhome�name�pwent�rootr2r2r3r�sB








cCsZt�|�}t|t�rVd|kr |Sts:ddl}|�d|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|�d|j�a
t
j}d	}d
}tj}d}|||�}|s��qV|�d�\}}|�
d�}	|	�|�r�|	�|�r�|	dd�}	z.|dk�rt�tjt�|	��}
n||	}
Wntk
�r&|}Yq�X||d�}|d|�|
}t|�}||7}q�|S)
N�$rs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}rF���)r7r8r.r/�	_varprogb�re�compilere�search�getattr�_varprogrg�span�groupr:r<ro�fsdecoderlrI)r1r~r��start�endrgrK�m�jrr�valuerMr2r2r3rsN






c	Cs�t�|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|�|�}|rp|�|d	�rp|�|d
�spd	}|�|�}g}|D]J}|||fkr�q�||ks�|s�|r�|r�|d|kr�|�|�q�|r�|��q�|}|�|�}|r�|||}|p�|S)Nr-�rNrXr�rr��r|)	r7r8r.r/r:r�append�popr	)	r1r#�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr2r2r3rNsJ


��
�
�

cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�Sr5)	r7r8rr.r/�getcwdb�getcwdr	r)r1�cwdr2r2r3rts



cCs*t�|�}t|dd�|i�\}}t|�SrP)r7r8�
_joinrealpathr)�filenamer1�okr2r2r3r)�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}|�r|�|�\}}}|r<||kr`q<||kr�|r�t|�\}}||kr�t|||�}q<|}q<t||�}t|�s�|}q<||kr�||}|dk	r�q<t||�dfSd||<t|t�	|�|�\}}	|	�st||�dfS|||<q<|d	fS)
Nr-rNrXrrrrFFT)
r.r/r�	partitionrr	rr�r7�readlink)
r1�rest�seenr#r!r"rr�_�newpathr�r2r2r3r��sH


r��darwinc	Cs�|std��t�|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
t�|�}zrdd	�t|��|�D�}d
d	�t|��|�D�}tt||g��}|gt|�|||d�}|s�|WSt	|�WSt
ttt
fk
r�t�d||��YnXdS)Nzno path specifiedrNr-rXrrrcSsg|]}|r|�qSr2r2��.0�xr2r2r3�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr2r2r�r2r2r3r��sr+)rSr7r8r.r/rrrIrr	r=r>r?�DeprecationWarningr@rA)	r1r�r!r#r"�
start_list�	path_listrK�rel_listr2r2r3r+�s0



c		s2|std��tttj|��}t|dt�r4d�d�nd�d�zƇfdd�|D�}zt�fd	d
�|D��\}Wntk
r�td�d�YnX�fdd�|D�}t|�}t	|�}|}t
|�D]$\}}|||kr�|d|�}q�q�|r�n
�dd�}|��|�WStt
fk
�r,tjd|���YnXdS)Nz%commonpath() arg is an empty sequencerr-rNrrcsg|]}|����qSr2)r)r�r1�r#r2r3r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdSrEr2)r�rCr�r2r3�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathscsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr2r2)r��c�r!r2r3r�sz)commonpath.<locals>.<listcomp>.<listcomp>r2)r�r9r�r2r3r�sr,)r,)rS�tupler;r7r8r.r/�set�min�max�	enumerater	r=r>r@rA)	�paths�split_pathsrr[r]�commonrKr��prefixr2)r!r#r3r,�s6)N)'r!r"r'r#r$r%r&r(r7�sysrTr@�__all__r4rrr	rrrO�__doc__r
r
rrrrrr�r}rrrr)r��platformr*r+r,r2r2r2r3�<module>s��
	
	

*25&	3

)tty.cpython-38.pyc000064400000002066151450073350010023 0ustar00U

e5do�@sLdZddlTddgZdZdZdZdZdZd	Zd
Z	e
fdd�Ze
fdd�Zd
S)zTerminal utilities.�)�*�setraw�	setcbreak������cCs�t|�}|tttBtBtBtB@|t<|tt@|t<|t	t
tB@|t	<|t	tB|t	<|t
ttBtBtB@|t
<d|tt<d|tt<t|||�dS)zPut terminal into a raw mode.rrN)�	tcgetattr�IFLAGZBRKINTZICRNLZINPCKZISTRIPZIXON�OFLAGZOPOST�CFLAGZCSIZEZPARENBZCS8�LFLAG�ECHO�ICANONZIEXTENZISIG�CC�VMIN�VTIME�	tcsetattr��fdZwhen�mode�r�/usr/lib64/python3.8/tty.pyrs"cCsFt|�}|tttB@|t<d|tt<d|tt<t|||�dS)z Put terminal into a cbreak mode.rrN)rrrrrrrrrrrrrs
N)
�__doc__Ztermios�__all__rr
rrZISPEEDZOSPEEDrZ	TCSAFLUSHrrrrrr�<module>sre.cpython-38.opt-2.pyc000064400000013706151450073350010554 0ustar00U

e5d�=�@s�ddlZddlZddlZddlZzddlZWnek
rDdZYnXdddddddd	d
ddd
dddddddddddddddddgZdZGd d!�d!ej�Z	e
��e	j�ej
Z
d?d"d�Zd@d#d�ZdAd$d�ZdBd%d�ZdCd&d�ZdDd'd�ZdEd(d�ZdFd)d	�ZdGd*d
�Zd+d�ZdHd,d�Zd-d.�d/D�Zd0d
�Zee�d1d��Zee�d1d��d1��ZiZd2Zd3d4�Z e�!e�d5d6��Z"d7d8�Z#d9d:�Z$ddl%Z%d;d<�Z&e%�'ee&e �Gd=d>�d>�Z(dS)I�N�match�	fullmatch�search�sub�subn�split�findall�finditer�compile�purge�template�escape�error�Pattern�Match�A�I�L�M�S�X�U�ASCII�
IGNORECASE�LOCALE�	MULTILINE�DOTALL�VERBOSE�UNICODEz2.2.1c@speZdZejZZejZZ	ej
ZZej
ZZejZZejZZejZZejZZejZdd�Zej Z dS)�	RegexFlagcCs�|jdk	rd|j��S|j}g}|dk}|r2|}|jD],}||j@r8||jM}|�d|j���q8|rx|�t|��d�|�}|r�t|�dkr�d|�d�}n
d|��}|S)Nzre.r�|�z~(�)�~)�_name_�_value_�	__class__�append�hex�join�len)�self�value�members�negative�m�res�r1�/usr/lib64/python3.8/re.py�__repr__�s&




zRegexFlag.__repr__N)!�__name__�
__module__�__qualname__�sre_compile�SRE_FLAG_ASCIIrr�SRE_FLAG_IGNORECASErr�SRE_FLAG_LOCALErr�SRE_FLAG_UNICODErr�SRE_FLAG_MULTILINErr�SRE_FLAG_DOTALLrr�SRE_FLAG_VERBOSErr�SRE_FLAG_TEMPLATE�TEMPLATE�T�SRE_FLAG_DEBUG�DEBUGr3�object�__str__r1r1r1r2r�s







rcCst||��|�S�N)�_compiler��pattern�string�flagsr1r1r2r�scCst||��|�SrF)rGrrHr1r1r2r�scCst||��|�SrF)rGrrHr1r1r2r�scCst||��|||�SrF)rGr�rI�replrJ�countrKr1r1r2r�scCst||��|||�SrF)rGrrLr1r1r2r�s	cCst||��||�SrF)rGr)rIrJ�maxsplitrKr1r1r2r�scCst||��|�SrF)rGrrHr1r1r2r�scCst||��|�SrF)rGr	rHr1r1r2r	�scCs
t||�SrF)rG�rIrKr1r1r2r
�scCst��t��dSrF)�_cache�clear�
_compile_repl�cache_clearr1r1r1r2r�scCst||tB�SrF)rGrArPr1r1r2rscCsi|]}|dt|��qS)�\)�chr)�.0�ir1r1r2�
<dictcomp>srYs()[]{}?*+-|^$\.&~# 	

cCs2t|t�r|�t�St|d�}|�t��d�SdS)N�latin1)�
isinstance�str�	translate�_special_chars_map�encode)rIr1r1r2r
s


�ic
Cs�t|t�r|j}ztt|�||fWStk
r8YnXt|t�rT|rPtd��|St�	|�sft
d��t�||�}|t@s�t
t�tkr�ztttt��=Wntttfk
r�YnX|tt|�||f<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled pattern)r[rr,rQ�type�KeyErrorr�
ValueErrorr7�isstring�	TypeErrorr
rCr*�	_MAXCACHE�next�iter�
StopIteration�RuntimeError)rIrK�pr1r1r2rG!s.

�
rGcCst�||�SrF)�	sre_parse�parse_template)rMrIr1r1r2rS;srScCst�||�}t�||�SrF)rlrm�expand_template)rIrrr1r1r2�_expand@srocCs>t||�}|ds.t|d�dkr.|ddS|fdd�}|S)Nrr!cSst�||�SrF)rlrn)rrr1r1r2�filterKsz_subx.<locals>.filter)rSr*)rIrrpr1r1r2�_subxEs

rqcCst|j|jffSrF)rGrIrK)rkr1r1r2�_pickleSsrrc@seZdZddd�Zdd�ZdS)�Scannerrc
Cs�ddlm}m}t|t�r |j}||_g}t��}||_	|D]H\}}|�
�}	|�t�|||	ddt�
||�ffg��|�|	|d�q<t�||d|ffg�}t�|�|_dS)Nr)�BRANCH�
SUBPATTERN���)�
sre_constantsrtrur[rr,�lexiconrl�StaterK�	opengroupr'�
SubPattern�parse�
closegroupr7r
�scanner)
r+rxrKrtrurk�s�phrase�action�gidr1r1r2�__init__\s

�zScanner.__init__c	Cs�g}|j}|j�|�j}d}|�}|s(q�|��}||kr:q�|j|jdd}t|�rj||_|||���}|dk	rz||�|}q|||d�fS)Nrr!)r'r~r�endrx�	lastindex�callable�group)	r+rJ�resultr'rrXr/�jr�r1r1r2�scanms$zScanner.scanN)r)r4r5r6r�r�r1r1r1r2rs[s
rs)r)r)r)rr)rr)rr)r)r)r)r))�enumr7rl�	functools�_locale�ImportError�__all__�__version__�IntFlagr�globals�update�__members__rrrrrrrrr	r
rrr^r
rarrrQrfrG�	lru_cacherSrorq�copyregrr�picklersr1r1r1r2�<module>|s�
�#



	







	

keyword.cpython-38.pyc000064400000001750151450073350010666 0ustar00U

e5d��#@sddZddgZddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g#Zee�jZd&S)'a�Keywords (from "Grammar/Grammar")

This file is automatically generated; please don't muck it up!

To update the symbols in this file, 'cd' to the top directory of
the python source tree and run:

    python3 -m Parser.pgen.keywordgen Grammar/Grammar                                       Grammar/Tokens                                       Lib/keyword.py

Alternatively, you can run 'make regen-keyword'.
�	iskeyword�kwlist�False�None�True�and�as�assert�async�await�break�class�continue�def�del�elif�else�except�finally�for�from�global�if�import�in�is�lambda�nonlocal�not�or�pass�raise�return�try�while�with�yieldN)�__doc__�__all__r�	frozenset�__contains__r�r*r*�/usr/lib64/python3.8/keyword.py�<module>sL�&configparser.cpython-38.pyc000064400000131230151450073350011661 0ustar00U

e5df��@s�dZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddddd	d
ddd
ddddddddddddgZ
eZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d	�d	e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�ZGd&d
�d
e�ZGd'd�de�Ze�ZGd(d�d�Z Gd)d�de �Z!Gd*d�de �Z"Gd+d�de �Z#Gd,d�de�Z$Gd-d�de$�Z%Gd.d�de%�Z&Gd/d�de�Z'Gd0d�de�Z(dS)1a�Configuration file parser.

A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
                    configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
             delimiters=('=', ':'), comment_prefixes=('#', ';'),
             inline_comment_prefixes=None, strict=True,
             empty_lines_in_values=True, default_section='DEFAULT',
             interpolation=<unset>, converters=<unset>):
        Create the parser. When `defaults' is given, it is initialized into the
        dictionary or intrinsic defaults. The keys must be strings, the values
        must be appropriate for %()s string interpolation.

        When `dict_type' is given, it will be used to create the dictionary
        objects for the list of sections, for the options within a section, and
        for the default values.

        When `delimiters' is given, it will be used as the set of substrings
        that divide keys from values.

        When `comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in empty lines. Comments can be
        indented.

        When `inline_comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in non-empty lines.

        When `strict` is True, the parser won't allow for any section or option
        duplicates while reading from a single source (file, string or
        dictionary). Default is True.

        When `empty_lines_in_values' is False (default: True), each empty line
        marks the end of an option. Otherwise, internal empty lines of
        a multiline option are kept as part of the value.

        When `allow_no_value' is True (default: False), options without
        values are accepted; the value presented for these is None.

        When `default_section' is given, the name of the special section is
        named accordingly. By default it is called ``"DEFAULT"`` but this can
        be customized to point to any other valid section name. Its current
        value can be retrieved using the ``parser_instance.default_section``
        attribute and may be modified at runtime.

        When `interpolation` is given, it should be an Interpolation subclass
        instance. It will be used as the handler for option value
        pre-processing when using getters. RawConfigParser objects don't do
        any sort of interpolation, whereas ConfigParser uses an instance of
        BasicInterpolation. The library also provides a ``zc.buildbot``
        inspired ExtendedInterpolation implementation.

        When `converters` is given, it should be a dictionary where each key
        represents the name of a type converter and each value is a callable
        implementing the conversion from string to the desired datatype. Every
        converter gets its corresponding get*() method on the parser object and
        section proxies.

    sections()
        Return all the configuration section names, sans DEFAULT.

    has_section(section)
        Return whether the given section exists.

    has_option(section, option)
        Return whether the given option exists in the given section.

    options(section)
        Return list of configuration options for the named section.

    read(filenames, encoding=None)
        Read and parse the iterable of named configuration files, given by
        name.  A single filename is also allowed.  Non-existing files
        are ignored.  Return list of successfully read files.

    read_file(f, filename=None)
        Read and parse one configuration file, given as a file object.
        The filename defaults to f.name; it is only used in error
        messages (if f has no `name' attribute, the string `<???>' is used).

    read_string(string)
        Read configuration from a given string.

    read_dict(dictionary)
        Read configuration from a dictionary. Keys are section names,
        values are dictionaries with keys and values that should be present
        in the section. If the used dictionary type preserves order, sections
        and their keys will be added in order. Values are automatically
        converted to strings.

    get(section, option, raw=False, vars=None, fallback=_UNSET)
        Return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults. If `option' is a key in
        `vars', the value from `vars' is used.

    getint(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to an integer.

    getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a float.

    getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a boolean (currently case
        insensitively defined as 0, false, no, off for False, and 1, true,
        yes, on for True).  Returns False or True.

    items(section=_UNSET, raw=False, vars=None)
        If section is given, return a list of tuples with (name, value) for
        each option in the section. Otherwise, return a list of tuples with
        (section_name, section_proxy) for each section, including DEFAULTSECT.

    remove_section(section)
        Remove the given file section and all its options.

    remove_option(section, option)
        Remove the given option from the given section.

    set(section, option, value)
        Set the given option.

    write(fp, space_around_delimiters=True)
        Write the configuration state in .ini format. If
        `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
�)�MutableMapping)�ChainMapN�NoSectionError�DuplicateOptionError�DuplicateSectionError�
NoOptionError�InterpolationError�InterpolationDepthError�InterpolationMissingOptionError�InterpolationSyntaxError�ParsingError�MissingSectionHeaderError�ConfigParser�SafeConfigParser�RawConfigParser�
Interpolation�BasicInterpolation�ExtendedInterpolation�LegacyInterpolation�SectionProxy�ConverterMapping�DEFAULTSECT�MAX_INTERPOLATION_DEPTHZDEFAULT�
c@s&eZdZdZddd�Zdd�ZeZdS)	�Errorz'Base class for ConfigParser exceptions.�cCs||_t�||�dS�N)�message�	Exception�__init__)�self�msg�r"�$/usr/lib64/python3.8/configparser.pyr�szError.__init__cCs|jSr)r�r r"r"r#�__repr__�szError.__repr__N)r)�__name__�
__module__�__qualname__�__doc__rr%�__str__r"r"r"r#r�s
rc@seZdZdZdd�ZdS)rz2Raised when no section matches a requested option.cCs$t�|d|f�||_|f|_dS)NzNo section: %r)rr�section�args�r r+r"r"r#r�szNoSectionError.__init__N�r&r'r(r)rr"r"r"r#r�sc@seZdZdZddd�ZdS)raRaised when a section is repeated in an input source.

    Possible repetitions that raise this exception are: multiple creation
    using the API or in strict parsers when a section is found more than once
    in a single input file, string or dictionary.
    NcCs�t|�dg}|dk	rRdt|�g}|dk	r8|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
|||f|_dS)N� already exists�While reading from � [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr+�source�linenor,)r r+r8r9r!rr"r"r#r�s

zDuplicateSectionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZddd�ZdS)rz�Raised by strict parsers when an option is repeated in an input source.

    Current implementation raises this exception only when an option is found
    more than once in a single file, string or dictionary.
    NcCs�t|�dt|�dg}|dk	rZdt|�g}|dk	r@|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
||_||||f|_dS)	Nz in section r/r0r1z	: option rzOption r)
r2r3r4r5r6rrr7r+�optionr8r9r,)r r+r:r8r9r!rr"r"r#r�s"�

zDuplicateOptionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz!A requested option was not found.cCs.t�|d||f�||_||_||f|_dS)NzNo option %r in section: %r�rrr:r+r,)r r:r+r"r"r#r�s�zNoOptionError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz0Base class for interpolation-related exceptions.cCs(t�||�||_||_|||f|_dSrr;)r r:r+r!r"r"r#rszInterpolationError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)r
zAA string substitution required a setting which was not available.cCs8d�||||�}t�||||�||_||||f|_dS)Nz�Bad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})r4rr�	referencer,)r r:r+�rawvalr<r!r"r"r#rs�z(InterpolationMissingOptionError.__init__Nr.r"r"r"r#r
sc@seZdZdZdS)rz�Raised when the source text contains invalid syntax.

    Current implementation raises this exception when the source text into
    which substitutions are made does not conform to the required syntax.
    N)r&r'r(r)r"r"r"r#rsc@seZdZdZdd�ZdS)r	z0Raised when substitutions are nested too deeply.cCs0d�||t|�}t�||||�|||f|_dS)Nz�Recursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})r4rrrr,)r r:r+r=r!r"r"r#rs�z InterpolationDepthError.__init__Nr.r"r"r"r#r	sc@s<eZdZdZd
dd�Zedd��Zejdd��Zdd	�ZdS)rz>Raised when a configuration file does not follow legal syntax.NcCsT|r|rtd��n|s$|s$td��n|r,|}t�|d|�||_g|_|f|_dS)Nz:Cannot specify both `filename' and `source'. Use `source'.z%Required argument `source' not given.z"Source contains parsing errors: %r)�
ValueErrorrrr8�errorsr,)r r8�filenamer"r"r#r,s

zParsingError.__init__cCstjdtdd�|jS)zDeprecated, use `source'.�SThe 'filename' attribute will be removed in future versions.  Use 'source' instead.���
stacklevel��warnings�warn�DeprecationWarningr8r$r"r"r#r@;s�zParsingError.filenamecCstjdtdd�||_dS)zDeprecated, user `source'.rArBrCNrE�r �valuer"r"r#r@Es�cCs*|j�||f�|jd||f7_dS)Nz
	[line %2d]: %s)r?r3r)r r9�liner"r"r#r3OszParsingError.append)NN)	r&r'r(r)r�propertyr@�setterr3r"r"r"r#r)s

	
	c@seZdZdZdd�ZdS)r
z@Raised when a key-value pair is found before any section header.cCs8t�|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr8r9rKr,)r r@r9rKr"r"r#rWs��z"MissingSectionHeaderError.__init__Nr.r"r"r"r#r
Tsc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBDummy interpolation that passes the value through with no changes.cCs|Srr")r �parserr+r:rJ�defaultsr"r"r#�
before_getkszInterpolation.before_getcCs|Srr"�r rNr+r:rJr"r"r#�
before_setnszInterpolation.before_setcCs|Srr"rQr"r"r#�before_readqszInterpolation.before_readcCs|Srr"rQr"r"r#�before_writetszInterpolation.before_writeN)r&r'r(r)rPrRrSrTr"r"r"r#rhs
c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
ra!Interpolation as implemented in the classic ConfigParser.

    The option values can contain format strings which refer to other values in
    the same section, or values in the special default section.

    For example:

        something: %(dir)s/whatever

    would resolve the "%(dir)s" to the value of dir.  All reference
    expansions are done late, on demand. If a user needs to use a bare % in
    a configuration file, she can escape it by writing %%. Other % usage
    is considered a user error and raises `InterpolationSyntaxError'.z
%\(([^)]+)\)sc	Cs$g}|�||||||d�d�|�S�N�r��_interpolate_somer7�r rNr+r:rJrO�Lr"r"r#rP�szBasicInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz%%r�%�1invalid interpolation syntax in %r at position %d��replace�_KEYCRE�subr>�find�r rNr+r:rJZ	tmp_valuer"r"r#rR�s�zBasicInterpolation.before_setc
Csj|j||d|d�}|tkr&t|||��|�rf|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rR|j�|�}|dkr�t||d|��|�|�	d��}||�
�d�}z||}
Wn&tk
�rt||||�d�YnXd|
k�rF|�
||||
|||d�n
|�|
�q&t||d	|f��q&dS)
NT��raw�fallbackr[rrVrB�(�'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr	rar3r_�matchr�optionxform�group�end�KeyErrorr
rX)r rNr:�accum�restr+�map�depthr=�p�c�m�var�vr"r"r#rX�s`



���
���z$BasicInterpolation._interpolate_someN�
r&r'r(r)�re�compiler_rPrRrXr"r"r"r#rxs

c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
rzyAdvanced variant of interpolation, supports the syntax used by
    `zc.buildout'. Enables interpolation between sections.z
\$\{([^}]+)\}c	Cs$g}|�||||||d�d�|�SrUrWrYr"r"r#rP�sz ExtendedInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz$$r�$r\r]rbr"r"r#rR�s�z ExtendedInterpolation.before_setcCs�|j||d|d�}|tkr&t|||��|�r�|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�r�|j�|�}|dkr�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn2t
ttfk
�r�t|||d	�|��d�YnXd|k�r�|�|||||
t|j|
dd
��|d�n
|�|�q&t||d|f��q&dS)
NTrcrzrrVrB�{rg�:)rdzMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rhrr	rar3r_rirrk�splitrl�lenrjrmrrr
r7rX�dict�items)r rNr:rnror+rprqr=rrrsrt�pathZsect�optrvr"r"r#rX�sx



�
���
���z'ExtendedInterpolation._interpolate_someNrwr"r"r"r#r�s

c@s6eZdZdZe�d�Zdd�Zdd�Ze	dd��Z
d	S)
rz{Deprecated interpolation used in old versions of ConfigParser.
    Use BasicInterpolation or ExtendedInterpolation instead.z%\(([^)]*)\)s|.c

Cs�|}t}|r�|d8}|r�d|kr�tj|j|d�}|j�||�}z||}Wq�tk
r�}	zt||||	jd�d�W5d}	~	XYq�Xqq�q|r�d|kr�t	|||��|S)NrVz%()rNr)
r�	functools�partial�_interpolation_replacer_r`rmr
r,r	)
r rNr+r:rJ�varsr=rqr^�er"r"r#rPs0���zLegacyInterpolation.before_getcCs|Srr"rQr"r"r#rR$szLegacyInterpolation.before_setcCs,|�d�}|dkr|��Sd|�|�SdS)NrVz%%(%s)s)rkrj)rirN�sr"r"r#r�'s
z*LegacyInterpolation._interpolation_replaceN)r&r'r(r)rxryr_rPrR�staticmethodr�r"r"r"r#r
s
c
s6eZdZdZdZdZdZe�Ze	�
ee	j�Ze	�
ej
dd�e	j�Ze	�
ej
dd�e	j�Ze	�
d�Zddddd	d	d	d	d
�Zded	fdd
dddeeed�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdddd�Zdedd�Zdfd d!�Zdgd#d$�Zdhd%d&�Zd	ded'�d(d)�Z d*d+�Z!d	ded'�d,d-�Z"d	ded'�d.d/�Z#d	ded'�d0d1�Z$d	ded'�d2d3�Z%ed	df�fd4d5�	Z&d6d7�Z'd8d9�Z(d:d;�Z)did<d=�Z*djd>d?�Z+d@dA�Z,dBdC�Z-dDdE�Z.dFdG�Z/dHdI�Z0dJdK�Z1dLdM�Z2dNdO�Z3dPdQ�Z4dRdS�Z5dTdU�Z6dVdW�Z7dXdY�Z8dZd[�Z9d\d]�Z:d^d^d^d_�d`da�Z;e<dbdc��Z=�Z>S)krz,ConfigParser that does not do interpolation.z�
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        z=|:�Zdelimz\STF)�1Zyes�trueZon�0ZnoZfalseZoffN��=r|)�#�;)�
delimiters�comment_prefixes�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
convertersc
Cs<||_|��|_|��|_t|�|_|��|_t||	�|j|	<t|�|_|dkrd|rZ|j	n|j
|_nNd�dd�|D��}|r�t
�|jj|d�t
j�|_nt
�|jj|d�t
j�|_t|p�d�|_t|p�d�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdk�rt�|_|tk	�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rx�escape)�.0�dr"r"r#�	<genexpr>jsz+RawConfigParser.__init__.<locals>.<genexpr>r�r")�_dict�	_sections�	_defaultsr�_converters�_proxiesr�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer7rxry�_OPT_NV_TMPLr4�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update�_read_defaults)
r rOZ	dict_typeZallow_no_valuer�r�r�r�r�r�r�r�r�r"r"r#rYs@




��

zRawConfigParser.__init__cCs|jSr)r�r$r"r"r#rO�szRawConfigParser.defaultscCst|j���S)z3Return a list of section names, excluding [DEFAULT])�listr��keysr$r"r"r#�sections�szRawConfigParser.sectionscCsJ||jkrtd|��||jkr(t|��|��|j|<t||�|j|<dS)z�Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists. Raise ValueError if name is DEFAULT.
        zInvalid section name: %rN)r�r>r�rr�rr�r-r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jkS)z~Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        )r�r-r"r"r#�has_section�szRawConfigParser.has_sectioncCsJz|j|��}Wntk
r0t|�d�YnX|�|j�t|���S)z9Return a list of option names for the given section name.N)r��copyrmrr�r�r�r�)r r+Zoptsr"r"r#�options�szRawConfigParser.optionsc
Cs�t|tttjf�r|g}g}|D]f}z(t||d��}|�||�W5QRXWntk
rdYq YnXt|tj�r|t�|�}|�	|�q |S)a�Read and parse a filename or an iterable of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify an iterable of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the iterable will be read.  A single
        filename may also be given.

        Return list of successfully read files.
        )�encoding)
�
isinstance�str�bytes�os�PathLike�open�_read�OSError�fspathr3)r �	filenamesr�Zread_okr@�fpr"r"r#�read�s

zRawConfigParser.readcCs<|dkr,z
|j}Wntk
r*d}YnX|�||�dS)aPLike read() but the argument must be a file-like object.

        The `f' argument must be iterable, returning one line at a time.
        Optional second argument is the `source' specifying the name of the
        file being read. If not given, it is taken from f.name. If `f' has no
        `name' attribute, `<???>' is used.
        Nz<???>)�name�AttributeErrorr�)r �fr8r"r"r#�	read_file�s

zRawConfigParser.read_file�<string>cCst�|�}|�||�dS)z'Read configuration from a given string.N)�io�StringIOr�)r �stringr8Zsfiler"r"r#�read_string�s
zRawConfigParser.read_string�<dict>c
Cs�t�}|��D]�\}}t|�}z|�|�Wn(ttfk
rT|jrP||krP�YnX|�|�|��D]`\}}|�t|��}|dk	r�t|�}|jr�||f|kr�t	|||��|�||f�|�|||�qhqdS)aRead configuration from a dictionary.

        Keys are section names, values are dictionaries with keys and values
        that should be present in the section. If the used dictionary type
        preserves order, sections and their keys will be added in order.

        All types held in the dictionary are converted to strings during
        reading, including section names, option names and keys.

        Optional second argument is the `source' specifying the name of the
        dictionary being read.
        N)
�setr�r�r�rr>r��addrjr)r Z
dictionaryr8�elements_addedr+r��keyrJr"r"r#�	read_dict�s"

zRawConfigParser.read_dictcCs"tjdtdd�|j||d�dS)z"Deprecated, use read_file instead.zRThis method will be removed in future versions.  Use 'parser.read_file()' instead.rBrC)r8N)rFrGrHr�)r r�r@r"r"r#�readfp�s�zRawConfigParser.readfp�rdr�recCs�z|�||�}Wn(tk
r8|tkr,�n|YSYnX|�|�}z||}Wn0tk
r�|tkrtt||��n|YSYnX|s�|dkr�|S|j�|||||�SdS)a]Get an option value for a given section.

        If `vars' is provided, it must be a dictionary. The option is looked up
        in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
        If the key is not found and `fallback' is provided, it is used as
        a fallback value. `None' can be provided as a `fallback' value.

        If interpolation is enabled and the optional argument `raw' is False,
        all interpolations are expanded in the return values.

        Arguments `raw', `vars', and `fallback' are keyword only.

        The section DEFAULT is special.
        N)�
_unify_valuesrr�rjrmrr�rP)r r+r:rdr�rer�rJr"r"r#rh�s$
�zRawConfigParser.getcKs||j||f|��Sr)rh)r r+�convr:�kwargsr"r"r#�_get"szRawConfigParser._getc	KsJz|j|||f||d�|��WSttfk
rD|tkr<�|YSXdS)N)rdr�)r�rrr�)r r+r:r�rdr�rer�r"r"r#�	_get_conv%s�zRawConfigParser._get_convcKs|j||tf|||d�|��S�Nr�)r��int�r r+r:rdr�rer�r"r"r#�getint0s
��zRawConfigParser.getintcKs|j||tf|||d�|��Sr�)r��floatr�r"r"r#�getfloat5s
��zRawConfigParser.getfloatcKs |j|||jf|||d�|��Sr�)r��_convert_to_booleanr�r"r"r#�
getboolean:s��zRawConfigParser.getbooleancs��tkrt���S�j���z���j��Wn&tk
rV��jkrRt	���YnXt
����}|r�|��D]\}}|���|�<qp���fdd��|r��fdd���fdd�|D�S)a�Return a list of (name, value) tuples for each option in a section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        cs�j���|�|��Sr)r�rP�r:)r�r+r r"r#�<lambda>Ws
�z'RawConfigParser.items.<locals>.<lambda>cs�|Srr"r�)r�r"r#r�Z�csg|]}|�|�f�qSr"r")r�r:)�value_getterr"r#�
<listcomp>[sz)RawConfigParser.items.<locals>.<listcomp>)
r��superr�r�r�r�r�rmr�rr�r�rj)r r+rdr�Z	orig_keysr�rJ��	__class__)r�r+r r�r#r�?s 


zRawConfigParser.itemscCs.|��D]}||}||=||fSt�dS)z�Remove a section from the parser and return it as
        a (section_name, section_proxy) tuple. If no section is present, raise
        KeyError.

        The section DEFAULT is never returned because it cannot be removed.
        N)r�rm�r r�rJr"r"r#�popitem]s
zRawConfigParser.popitemcCs|��Sr)�lower)r Z	optionstrr"r"r#rjjszRawConfigParser.optionxformcCsV|r||jkr"|�|�}||jkS||jkr0dS|�|�}||j|kpP||jkSdS)z�Check for the existence of a given option in a given section.
        If the specified `section' is None or an empty string, DEFAULT is
        assumed. If the specified `section' does not exist, returns False.FN)r�rjr�r�)r r+r:r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsl|r|j�||||�}|r$||jkr,|j}n.z|j|}Wntk
rXt|�d�YnX|||�|�<dS)zSet an option.N)r�rRr�r�r�rmrrj)r r+r:rJ�sectdictr"r"r#r�{s�zRawConfigParser.setcCsh|rd�|jd�}n
|jd}|jr>|�||j|j��|�|jD]}|�|||j|��|�qDdS)z�Write an .ini-format representation of the configuration state.

        If `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
        z {} rN)r4r�r��_write_sectionr�r�r�)r r�Zspace_around_delimitersr�r+r"r"r#�write�s

�
�zRawConfigParser.writecCsx|�d�|��|D]T\}}|j�||||�}|dk	s<|jsR|t|��dd�}nd}|�d�||��q|�d�dS)z-Write a single section to the specified `fp'.z[{}]
N�
z
	rz{}{}
)r�r4r�rTr�r�r^)r r�Zsection_nameZ
section_itemsZ	delimiterr�rJr"r"r#r��s�zRawConfigParser._write_sectioncCsd|r||jkr|j}n.z|j|}Wntk
rBt|�d�YnX|�|�}||k}|r`||=|S)zRemove an option.N)r�r�r�rmrrj)r r+r:r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jk}|r|j|=|j|=|S)zRemove a file section.)r�r�)r r+r�r"r"r#�remove_section�s

zRawConfigParser.remove_sectioncCs&||jkr|�|�st|��|j|Sr)r�r�rmr��r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsX||kr|||krdS||jkr.|j��n||jkrF|j|��|�||i�dSr)r�r��clearr�r�r�r"r"r#�__setitem__�s

zRawConfigParser.__setitem__cCs2||jkrtd��|�|�s$t|��|�|�dS)Nz"Cannot remove the default section.)r�r>r�rmr�r�r"r"r#�__delitem__�s


zRawConfigParser.__delitem__cCs||jkp|�|�Sr)r�r�r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrV)r~r�r$r"r"r#�__len__�szRawConfigParser.__len__cCst�|jf|j���Sr)�	itertools�chainr�r�r�r$r"r"r#�__iter__�szRawConfigParser.__iter__cCs t�}d}d}d}d}d}d}	t|dd�D�]�\}}
tj}dd�|jD�}|tjkr�|r�i}
|��D]T\}}|
�||d�}|dkr�qd||
|<|dks�|dkrd|
|d��rdt||�}qd|
}qJ|j	D]}|
�
��|�r�d}q�q�|tjkr�d}|
d|��
�}|�sN|j�rF|dk�rL|dk	�rL|�rL||dk	�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|dk	�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d	�}||jk�r�|j�r�||k�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|dk�rTt|||
��q*|j�|�}|�r�|�d
dd�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|k�r�t"||||��|�||f�|dk	�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)
aParse a sectioned configuration file.

        Each section in a configuration file contains a header, indicated by
        a name in square brackets (`[]'), plus key/value options, indicated by
        `name' and `value' delimited with a specific substring (`=' or `:' by
        default).

        Values can span multiple lines, as long as they are indented deeper
        than the first line of the value. Depending on the parser's mode, blank
        lines may be treated as parts of multiline values or ignored.

        Configuration files may include comments, prefixed by specific
        characters (`#' and `;' by default). Comments may appear on their own
        in an otherwise empty line or may be entered in lines holding values or
        section names.
        NrrV)�startcSsi|]
}|d�qS)���r")r�rrr"r"r#�
<dictcomp>�sz)RawConfigParser._read.<locals>.<dictcomp>rr�headerr:�virJ)$r��	enumerate�sys�maxsizer�r�ra�isspace�minr��strip�
startswithr�r3�NONSPACECRE�searchr�SECTCRErirkr�r�rr�r�r�r�rr�r
r��
_handle_errorrj�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer9Zindent_levelr�rKZ
comment_startZinline_prefixesZ
next_prefixes�prefix�indexrJZfirst_nonspaceZcur_indent_levelZmor	Zoptvalr"r"r#r��s� 


��
��
�




��

zRawConfigParser._readcCsr|j|jf}t�|f|j���}|D]H\}}|��D]6\}}t|t�rTd�|��	�}|j
�||||�||<q4q$dS)Nr�)r�r�rrr�r�r�r�r7rr�rS)r rOZall_sectionsr+r�r��valr"r"r#r[s�
�z&RawConfigParser._join_multiline_valuescCs&|��D]\}}||j|�|�<qdS)zTRead the defaults passed in the initializer.
        Note: values can be non-string.N)r�r�rj)r rOr�rJr"r"r#r�gszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr3r2)r �excrr9rKr"r"r#rmszRawConfigParser._handle_errorcCs�i}z|j|}Wn(tk
r:||jkr6t|�d�YnXi}|rt|��D]&\}}|dk	rdt|�}|||�|�<qLt|||j�S)z�Create a sequence of lookups with 'vars' taking priority over
        the 'section' which takes priority over the DEFAULTSECT.

        N)	r�rmr�rr�r�rj�	_ChainMapr�)r r+r�ZsectiondictZvardictr�rJr"r"r#r�ss
zRawConfigParser._unify_valuescCs(|��|jkrtd|��|j|��S)zJReturn a boolean value translating from other types if necessary.
        zNot a boolean: %s)r��BOOLEAN_STATESr>rIr"r"r#r��sz#RawConfigParser._convert_to_booleanr)r+r:rJcCsDt|t�std��t|t�s$td��|jr.|r@t|t�s@td��dS)a�Raises a TypeError for non-string values.

        The only legal non-string value if we allow valueless
        options is None, so we need to check if the value is a
        string if:
        - we do not allow valueless options, or
        - we allow valueless options but the value is not None

        For compatibility reasons this method is not used in classic set()
        for RawConfigParsers. It is invoked in every case for mapping protocol
        access and in ConfigParser.set().
        zsection names must be stringszoption keys must be stringszoption values must be stringsN)r�r��	TypeErrorr��r r+r:rJr"r"r#�_validate_value_types�s



z%RawConfigParser._validate_value_typescCs|jSr)r�r$r"r"r#r��szRawConfigParser.converters)N)N)r�)r�)N)N)T)?r&r'r(r)Z
_SECT_TMPLr�r�rr�rxryr�rr4r�r�rr�
_default_dictrr�rrOr�r�r�r�r�r�r�r�r�rhr�r�r�r�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrr�rr�rr�r�r rLr��
__classcell__r"r"r�r#r0s�

���(	




	%����




zcs<eZdZdZe�Zd	�fdd�	Z�fdd�Zdd�Z�Z	S)
rz(ConfigParser implementing interpolation.Ncs"|j||d�t��|||�dS)zmSet an option.  Extends RawConfigParser.set by validating type and
        interpolation syntax on the value.�r:rJN)r r�r�rr�r"r#r��szConfigParser.setcs|j|d�t��|�dS)z�Create a new section in the configuration.  Extends
        RawConfigParser.add_section by validating if the section name is
        a string.)r+N)r r�r�r-r�r"r#r��szConfigParser.add_sectioncCs0z"|j}t�|_|�|j|i�W5||_XdS)z�Reads the defaults passed in the initializer, implicitly converting
        values to strings like the rest of the API.

        Does not perform interpolation for backwards compatibility.
        N)r�rr�r�)r rOZhold_interpolationr"r"r#r��s
zConfigParser._read_defaults)N)
r&r'r(r)rr�r�r�r�r"r"r"r�r#r�s
cs eZdZdZ�fdd�Z�ZS)rz8ConfigParser alias for backwards compatibility purposes.cs"t�j||�tjdtdd�dS)Nz�The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.rBrC)r�rrFrGrH)r r,r�r�r"r#r�s�zSafeConfigParser.__init__)r&r'r(r)rr"r"r"r�r#r�sc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Zddddd�dd�ZdS)rz+A proxy for a single section from a parser.cCsF||_||_|jD].}d|}tj|jt||�d�}t|||�qdS)z@Creates a view on a section of the specified `name` in `parser`.rh��_implN)�_parser�_namer�r�r�rh�getattr�setattr)r rNr�r�r��getterr"r"r#r�s
zSectionProxy.__init__cCsd�|j�S)Nz
<Section: {}>)r4r'r$r"r"r#r%�szSectionProxy.__repr__cCs(|j�|j|�st|��|j�|j|�Sr)r&r�r'rmrhr�r"r"r#r��szSectionProxy.__getitem__cCs"|jj||d�|j�|j||�S)Nr#)r&r r�r'r�r"r"r#r��szSectionProxy.__setitem__cCs,|j�|j|�r |j�|j|�s(t|��dSr)r&r�r'r�rmr�r"r"r#r��s�zSectionProxy.__delitem__cCs|j�|j|�Sr)r&r�r'r�r"r"r#r�szSectionProxy.__contains__cCst|���Sr)r~�_optionsr$r"r"r#r�szSectionProxy.__len__cCs|����Sr)r+rr$r"r"r#r�szSectionProxy.__iter__cCs*|j|jjkr|j�|j�S|j��SdSr)r'r&r�r�rOr$r"r"r#r+�szSectionProxy._optionscCs|jSr)r&r$r"r"r#rNszSectionProxy.parsercCs|jSr)r'r$r"r"r#r�szSectionProxy.nameNF)rdr�r%cKs(|s|jj}||j|f|||d�|��S)z�Get an option value.

        Unless `fallback` is provided, `None` will be returned if the option
        is not found.

        r�)r&rhr')r r:rerdr�r%r�r"r"r#rhs
��zSectionProxy.get)N)r&r'r(r)rr%r�r�r�rrrr+rLrNr�rhr"r"r"r#r�s"	

�c@sJeZdZdZe�d�Zdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)ra/Enables reuse of get*() methods between the parser and section proxies.

    If a parser class implements a getter directly, the value for the given
    key will be ``None``. The presence of the converter name here enables
    section proxies to find and use the implementation on the parser class.
    z^get(?P<name>.+)$cCsR||_i|_t|j�D]6}|j�|�}|rtt|j|��s<qd|j|�d�<qdS)Nr�)r&�_data�dir�	GETTERCREri�callabler(rk)r rNr*rtr"r"r#r%szConverterMapping.__init__cCs
|j|Sr)r,r�r"r"r#r�.szConverterMapping.__getitem__c	Cs�zd|}Wn(tk
r4td�|t|����YnX|dkrFtd��||j|<tj|jj|d�}||_	t
|j||�|j��D] }tj|j|d�}t
|||�q�dS)NrhzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a name)r�r$)
rr>r4�typer,r�r�r&r�Z	converterr)�valuesrh)r r�rJ�k�func�proxyr*r"r"r#r�1s �
zConverterMapping.__setitem__c	Cs~zd|p
d}Wntk
r,t|��YnX|j|=t�|jf|j���D],}zt||�WqLtk
rvYqLYqLXqLdS)Nrh)	rrmr,rrr&r1�delattrr�)r r�r2�instr"r"r#r�AszConverterMapping.__delitem__cCs
t|j�Sr)�iterr,r$r"r"r#rOszConverterMapping.__iter__cCs
t|j�Sr)r~r,r$r"r"r#rRszConverterMapping.__len__N)
r&r'r(r)rxryr.rr�r�r�rrr"r"r"r#rs
	))r)Zcollections.abcr�collectionsrrr�r�rr�rxrrF�__all__rr!rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>st
�	
	

+HJ&| 
Fnetrc.cpython-38.pyc000064400000007303151450073350010315 0ustar00U

e5d��@sXdZddlZddlZddlZddgZGdd�de�ZGdd�d�ZedkrTe	e��dS)z-An object-oriented interface to .netrc files.�N�netrc�NetrcParseErrorc@s"eZdZdZddd�Zdd�ZdS)rz5Exception raised on syntax errors in the .netrc file.NcCs"||_||_||_t�||�dS)N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r
�/usr/lib64/python3.8/netrc.pyrszNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r	r
r
r�__str__szNetrcParseError.__str__)NN)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rr
s
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNc	CsX|dk}|dkr&tj�tj�d�d�}i|_i|_t|��}|�|||�W5QRXdS)N�~z.netrc)�os�path�join�
expanduser�hosts�macros�open�_parse)r	�file�
default_netrc�fpr
r
rrs
znetrc.__init__cCs�t�|�}|jd7_|j�dd�|_|j}|��}}|sD�q�n�|ddkrt|j|kr(t|�dkr(|j��q(n�|dkr�|��}nt|dkr�d}nf|dkr�|��}g|j	|<d	|_
|j��}	|	r�|	d
kr�d|_
q(|j	|�|	�q�q(ntd|||j��d}
d}}i|j
|<|��}|�d��s.|d
k�rr|�rR|
||f|j
|<|�|�q(ntd||t|�f||j���q|dk�s�|dk�r�|��}
�q|dk�r�|��}�q|dk�r�tjdk�r�|�r�t�|���}
|
jt��k�rpddl}z|�|
j�d}Wn tk
�rd|
j}YnXz|�t���d}Wn"tk
�rXdt��}YnXtd||f||j��|
jtjtjB@�r�td||j��|��}ntd|||j���qq(dS)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#�r��machine�default�macdefz 	�
z 	
zbad toplevel token %r>rr"r!r z&malformed %s entry %s terminated by %s�login�user�account�password�posixzuid %sz9~/.netrc file owner (%s) does not match current user (%s)zY~/.netrc access too permissive: access permissions must restrict access to only the ownerzbad follower token %r)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuid�KeyError�st_mode�stat�S_IRWXG�S_IRWXO)r	rrrZlexerZsaved_linenoZtoplevelZttZ	entryname�liner$r&r'Zpropr5Zfownerr%r
r
rr s�




�
�
��

���
�znetrc._parsecCs0||jkr|j|Sd|jkr(|jdSdSdS)z8Return a (user, account, password) tuple for given host.r!N)r)r	�hostr
r
r�authenticatorsqs




znetrc.authenticatorscCs�d}|j��D]X}|j|}|d|�d|d�d�7}|drR|d|d�d�7}|d|d	�d�7}q|j��D]4}|d
|�d�7}|j|D]}||7}q�|d7}qr|S)z3Dump the class data in the format of a .netrc file.rzmachine z
	login rr#rz		account z
	password �zmacdef )r�keysr)r	Zrepr=�attrsZmacror<r
r
r�__repr__zs


znetrc.__repr__)N)r
rrrrr>rBr
r
r
rrs
	Q	�__main__)
rrr)r9�__all__rrrr
�printr
r
r
r�<module>stthis.cpython-38.opt-2.pyc000064400000002357151450073350011115 0ustar00U

e5d��@s\dZiZdD]2Zed�D]$Zeedde�eeee�<qqed�dd�eD���dS)aXGur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!)�A�a��
�cCsg|]}t�||��qS�)�d�get)�.0�crr�/usr/lib64/python3.8/this.py�
<listcomp>srN)�srr
�range�i�chr�print�joinrrrr�<module>s
$_compression.cpython-38.opt-2.pyc000064400000007536151450073350012652 0ustar00U

e5d��@s6ddlZejZGdd�dej�ZGdd�dej�ZdS)�Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
BaseStreamcCs|jrtd��dS)NzI/O operation on closed file)�closed�
ValueError��self�r�$/usr/lib64/python3.8/_compression.py�_check_not_closedszBaseStream._check_not_closedcCs|��st�d��dS)NzFile not open for reading)�readable�io�UnsupportedOperationrrrr�_check_can_readszBaseStream._check_can_readcCs|��st�d��dS)NzFile not open for writing)�writablerrrrrr�_check_can_writeszBaseStream._check_can_writecCs(|��st�d��|��s$t�d��dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r
rr�seekablerrrr�_check_can_seeks
zBaseStream._check_can_seekN)�__name__�
__module__�__qualname__r	r
rrrrrrr	srcsfeZdZdd�Zddd�Z�fdd�Zdd	�Zd
d�Zdd
d�Zdd�Z	e
jfdd�Zdd�Z
�ZS)�DecompressReadercCsdS)NTrrrrrr
$szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|j�|_||_dS)NFr���)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args�
_decompressor�_trailing_error)r�fpZdecomp_factoryZtrailing_errorZdecomp_argsrrr�__init__'szDecompressReader.__init__csd|_t���S�N)r�super�closer��	__class__rrr#;szDecompressReader.closecCs
|j��Sr!)rrrrrrr?szDecompressReader.seekablec
CsPt|��:}|�d��$}|�t|��}||dt|��<W5QRXW5QRXt|�S)N�B)�
memoryview�cast�read�len)r�bZviewZ	byte_view�datarrr�readintoBs$zDecompressReader.readintorcCs�|dkr|��S|r|jrdSd}|jjr�|jjp<|j�t�}|sDq�|jf|j	�|_z|j�
||�}Wq�|jk
r�Yq�Yq�Xn4|jjr�|j�t�}|s�t
d��nd}|j�
||�}|r"q�q"|s�d|_|j|_dS|jt|�7_|S)Nr�zACompressed file ended before the end-of-stream marker was reachedT)�readallrr�eofZunused_datarr)�BUFFER_SIZErr�
decompressrZneeds_input�EOFErrorrrr*)r�sizer,Zrawblockrrrr)Hs@

��
zDecompressReader.readcCs,|j�d�d|_d|_|jf|j�|_dS)NrF)r�seekrrrrrrrrr�_rewindrszDecompressReader._rewindcCs�|tjkrnR|tjkr"|j|}n<|tjkrP|jdkrD|�tj�rDq6|j|}ntd�	|���||jkrr|�
�n
||j8}|dkr�|�ttj|��}|s�q�|t|�8}q||jS)NrzInvalid value for whence: {})
r�SEEK_SET�SEEK_CURr�SEEK_ENDrr)�DEFAULT_BUFFER_SIZEr�formatr6�minr*)r�offset�whencer,rrrr5xs&






zDecompressReader.seekcCs|jSr!)rrrrr�tell�szDecompressReader.tell)r)r)rrrr
r r#rr-r)r6rr7r5r?�
__classcell__rrr$rr!s

*r)rr:r1�BufferedIOBaser�	RawIOBaserrrrr�<module>sbase64.cpython-38.pyc000064400000041261151450073350010267 0ustar00U

e5d�O�@s�dZddlZddlZddlZddddddd	d
ddd
dddddddgZeefZdd�ZdCdd�Z	dDdd�Z
dd�Zdd�Ze�
dd�Ze�
dd�Zdd�Zdd�Zd Zdadad!d	�ZdEd"d
�Zd#d�ZdFd$d�Zdadad%Zd&ZdGd'd(�Zddddd)�d*d�Zddd+d,�d-d�Zd.Z da!da"da#dHd/d
�Z$d0d�Z%d1Z&e&d2d3Z'd4d�Z(d5d�Z)d6d7�Z*d8d�Z+d9d:�Z,d;d�Z-d<d=�Z.d>d?�Z/d@dA�Z0e1dBk�r�e/�dS)IzDBase16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings�N�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodecCs|t|t�r4z|�d�WStk
r2td��YnXt|t�rB|Szt|���WStk
rvtd|j	j
�d�YnXdS)N�asciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r)�
isinstance�strr�UnicodeEncodeError�
ValueError�bytes_types�
memoryview�tobytes�	TypeError�	__class__�__name__��s�r!�/usr/lib64/python3.8/base64.py�_bytes_from_decode_data"s

��r#cCsDtj|dd�}|dk	r@t|�dks.tt|���|�t�d|��S|S)a*Encode the bytes-like object s using Base64 and return a bytes object.

    Optional altchars should be a byte string of length 2 which specifies an
    alternative alphabet for the '+' and '/' characters.  This allows an
    application to e.g. generate url or filesystem safe Base64 strings.
    F)�newlineN��+/)�binascii�
b2a_base64�len�AssertionError�repr�	translate�bytes�	maketrans)r �altchars�encodedr!r!r"r3s
FcCsft|�}|dk	rBt|�}t|�dks0tt|���|�t�|d��}|r\t�d|�s\t	�
d��t	�|�S)anDecode the Base64 encoded bytes-like object or ASCII string s.

    Optional altchars must be a bytes-like object or ASCII string of length 2
    which specifies the alternative alphabet used instead of the '+' and '/'
    characters.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded.

    If validate is False (the default), characters that are neither in the
    normal base-64 alphabet nor the alternative alphabet are discarded prior
    to the padding check.  If validate is True, these non-alphabet characters
    in the input result in a binascii.Error.
    Nr%r&s[A-Za-z0-9+/]*={0,2}zNon-base64 digit found)r#r)r*r+r,r-r.�re�	fullmatchr'�Error�
a2b_base64)r r/Zvalidater!r!r"rAs
cCst|�S)zrEncode bytes-like object s using the standard Base64 alphabet.

    The result is returned as a bytes object.
    )rrr!r!r"rZscCst|�S)aQDecode bytes encoded with the standard Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the standard alphabet
    are discarded prior to the padding check.
    )rrr!r!r"rasr&s-_cCst|��t�S)z�Encode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object to encode.  The result is returned as a
    bytes object.  The alphabet uses '-' instead of '+' and '_' instead of
    '/'.
    )rr,�_urlsafe_encode_translationrr!r!r"roscCst|�}|�t�}t|�S)a�Decode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the URL-safe base-64
    alphabet, and are not a plus '+' or slash '/', are discarded prior to the
    padding check.

    The alphabet uses '-' instead of '+' and '_' instead of '/'.
    )r#r,�_urlsafe_decode_translationrrr!r!r"rxs
s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567cs>tdkr,dd�tD���fdd��D�ad�t|t�sBt|���}t|�d}|rb|dd|}t�}tj	}t}t
dt|�d�D]V}||||d�d�}|||d	?||d
?d@||d?d@||d@7}q�|d
kr�d|dd�<nF|dk�rd|dd�<n.|dk�r d|dd�<n|dk�r6d|dd�<t|�S)zKEncode the bytes-like object s using Base32 and return a bytes object.
    NcSsg|]}t|f��qSr!�r-��.0�ir!r!r"�
<listcomp>�szb32encode.<locals>.<listcomp>csg|]}�D]}||�qqSr!r!�r9�a�b�Zb32tabr!r"r;�s��r�big��i��
�s======i����r%s====����s===�����=���)�_b32tab2�_b32alphabetrrrrr)�	bytearray�int�
from_bytes�ranger-)r �leftoverr0rQZb32tab2r:�cr!r?r"r�s<
��
�


c
	Cs�tdkrdd�tt�D�at|�}t|�dr8t�d��|dk	rvt|�}t|�dks`tt|���|�	t
�dd|��}|r�|��}t|�}|�
d	�}|t|�}t�}t}td
t|�d�D]j}|||d�}d
}	z|D]}
|	d>||
}	q�Wn"tk
�rt�d�d�YnX||	�dd
�7}q�|d�s:|dk�rDt�d��|�r�|�r�|	d|K}	|	�dd
�}dd|d}|d|�|dd�<t
|�S)aZDecode the Base32 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    RFC 3548 allows for optional mapping of the digit 0 (zero) to the
    letter O (oh), and for optional mapping of the digit 1 (one) to
    either the letter I (eye) or letter L (el).  The optional argument
    map01 when not None, specifies which letter the digit 1 should be
    mapped to (when map01 is not None, the digit 0 is always mapped to
    the letter O).  For security purposes the default is None, so that
    0 and 1 are not allowed in the input.

    The result is returned as a bytes object.  A binascii.Error is raised if
    the input is incorrectly padded or if there are non-alphabet
    characters present in the input.
    NcSsi|]\}}||�qSr!r!)r9�k�vr!r!r"�
<dictcomp>�szb32decode.<locals>.<dictcomp>�zIncorrect paddingrFs01�OrKrr@zNon-base32 digit foundrB>rrFrHrJ��+���)�_b32rev�	enumeraterNr#r)r'r3r*r+r,r-r.�upper�rstriprOrR�KeyError�to_bytes)
r �casefoldZmap01�lZpadchars�decodedZb32revr:Zquanta�accrTZlastrSr!r!r"r	�sB


cCst�|���S)zKEncode the bytes-like object s using Base16 and return a bytes object.
    )r'Zhexlifyr_rr!r!r"r
�scCs4t|�}|r|��}t�d|�r*t�d��t�|�S)a�Decode the Base16 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded or if there are non-alphabet characters present
    in the input.
    s	[^0-9A-F]zNon-base16 digit found)r#r_r1�searchr'r3Z	unhexlify)r rcr!r!r"r�s

s<~s~>c	s�t|t�st|���}t|�d}|r4|d|}t�dt|�d��|�}����fdd�|D�}|r�|s�|ddkr��dd	|d<|dd|�|d<d
�|�S)NrJrAz!%dIcsPg|]H}�r|sdn6�r$|dkr$dn&�|d�|dd�|d�qS)�zi    �yi�^	�Ui9r!)r9Zword��chars�chars2�foldnuls�
foldspacesr!r"r;!s�
�
�z_85encode.<locals>.<listcomp>rLrhrr@�)	rrrrr)�struct�StructZunpack�join)	r>rlrm�padrnro�paddingZwords�chunksr!rkr"�	_85encodes
�rw)ro�wrapcolrt�adobecs�tdkr*dd�tdd�D�add�tD�at|tt|d|��|rHt���r�t|rVdnd	�����fd
d�tdt����D�}|r�t|d�d�kr�|�d
�d�|��|r��t	7��S)a�Encode bytes-like object b using Ascii85 and return a bytes object.

    foldspaces is an optional flag that uses the special short sequence 'y'
    instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
    feature is not supported by the "standard" Adobe encoding.

    wrapcol controls whether the output should have newline (b'\n') characters
    added to it. If this is non-zero, each output line will be at most this
    many characters long.

    pad controls whether the input is padded to a multiple of 4 before
    encoding. Note that the btoa implementation always pads.

    adobe controls whether the encoded byte sequence is framed with <~ and ~>,
    which is used by the Adobe implementation.
    NcSsg|]}t|f��qSr!r7r8r!r!r"r;Dsza85encode.<locals>.<listcomp>�!�vcSsg|]}tD]}||�qqSr!)�	_a85charsr<r!r!r"r;EsTr%rFcsg|]}�||���qSr!r!r8��resultrxr!r"r;Ms�rrLrp�
)
�
_a85chars2rRr|rw�	_A85START�maxr)�appendrs�_A85END)r>rorxrtryrvr!r}r"r/s$�

s 	

)rory�ignorecharsc	Cs�t|�}|rH|�t�s$td�t���|�t�r<|dd�}n|dd�}t�d�j	}g}|j
}g}|j
}|j}	|dD]�}
d|
kr�dkr�nnl||
�t|�d	kr�d
}|D]}
d||
d}q�z|||��Wn tj
k
r�td�d�YnX|	�qv|
d
k�r |�rtd��|d�qv|�rH|
dk�rH|�r>td��|d�qv|
|k�rVqvqvtd|
��qvd�|�}dt|�}
|
�r�|d|
�}|S)a�Decode the Ascii85 encoded bytes-like object or ASCII string b.

    foldspaces is a flag that specifies whether the 'y' short sequence should be
    accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
    not supported by the "standard" Adobe encoding.

    adobe controls whether the input sequence is in Adobe Ascii85 format (i.e.
    is framed with <~ and ~>).

    ignorechars should be a byte string containing characters to ignore from the
    input. This should only contain whitespace characters, and by default
    contains all whitespace characters in ASCII.

    The result is returned as a bytes object.
    z1Ascii85 encoded byte sequences must end with {!r}r%���N�!Isuuuurz�ur@rrjzAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %crprJ)r#�endswithr�r�format�
startswithr�rqrr�packr��clearr)�errorrs)r>roryr��packIreZdecoded_appendZcurrZcurr_appendZ
curr_clear�xrfr~rur!r!r"rXsZ
��





sU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs2tdkr$dd�tD�add�tD�at|tt|�S)z�Encode bytes-like object b in base85 format and return a bytes object.

    If pad is true, the input is padded with b'\0' so its length is a multiple of
    4 bytes before encoding.
    NcSsg|]}t|f��qSr!r7r8r!r!r"r;�szb85encode.<locals>.<listcomp>cSsg|]}tD]}||�qqSr!)�	_b85charsr<r!r!r"r;�s)�
_b85chars2�_b85alphabetr�rw)r>rtr!r!r"r�s	c
	CsJtdkr,dgdatt�D]\}}|t|<qt|�}t|�d}|d|}g}t�d�j}tdt|�d�D]�}|||d�}d}z|D]}|dt|}q�WnFt	k
r�t|�D]&\}}t|dkr�t
d||�d�q��YnXz|�||��Wqntjk
�r$t
d	|�d�YqnXqnd
�
|�}	|�rF|	d|�}	|	S)zqDecode the base85-encoded bytes-like object or ASCII string b

    The result is returned as a bytes object.
    N�r@�~r�rrjz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %drp)�_b85decr^r�r#r)rqrrr�rRrrr�r�rs)
r>r:rTru�outr��chunkrf�jr~r!r!r"r
�sH

����

�LrJrHcCsX|�t�}|sqTt|�tkr>|�tt|��}|s4q>||7}qt�|�}|�|�qdS)z1Encode a file; input and output are binary files.N)�read�
MAXBINSIZEr)r'r(�write)�input�outputr �ns�liner!r!r"r�s


cCs(|��}|sq$t�|�}|�|�qdS)z1Decode a file; input and output are binary files.N)�readliner'r4r�)r�r�r�r r!r!r"r�s

c
Cs�zt|�}Wn8tk
rD}zd|jj}t|�|�W5d}~XYnX|jdkrjd|j|jjf}t|��|jdkr�d|j|jjf}t|��dS)Nz"expected bytes-like object, not %s)rTr>�Bz-expected single byte elements, not %r from %srFz(expected 1-D data, not %d-D data from %s)rrrrr��ndim)r �m�err�msgr!r!r"�_input_type_check�s
�
�r�cCsLt|�g}tdt|�t�D]$}|||t�}|�t�|��qd�|�S)zVEncode a bytestring into a bytes object containing multiple lines
    of base-64 data.rrp)r�rRr)r�r�r'r(rs)r �piecesr:r�r!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of encodebytes().rNzAencodestring() is a deprecated alias since 3.1, use encodebytes()r%)�warnings�warn�DeprecationWarningr�r r�r!r!r"�encodestrings�r�cCst|�t�|�S)z8Decode a bytestring of base-64 data into a bytes object.)r�r'r4rr!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of decodebytes().rNzHdecodestring() is a deprecated alias since Python 3.1, use decodebytes()r%)r�r�r�rr�r!r!r"�decodestring$s�r�c	
Csddl}ddl}z|�|jdd�d�\}}WnP|jk
r~}z0|j|_t|�td|jd�|�d�W5d}~XYnXt}|D]@\}}|dkr�t}|dkr�t	}|d	kr�t	}|d
kr�t
�dSq�|�r|ddk�rt|dd��}|||jj�W5QRXn||j
j|jj�dS)
zSmall main programrNrFZdeutz�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'r%z-ez-dz-uz-t�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)	r�r�Zopts�argsr��func�or=�fr!r!r"�main.s2�r�cCsHd}tt|��t|�}tt|��t|�}tt|��||ksDt�dS)NsAladdin:open sesame)r�r+rrr*)Zs0�s1�s2r!r!r"r�Hsr��__main__)N)NF)FN)F)FFF)F)2�__doc__r1rqr'�__all__r-rOrr#rrrrr.r5r6rrrNrMr]rr	r
rr|r�r�r�rwrrr�r�r�r�rr
ZMAXLINESIZEr�rrr�rr�rr�r�r�rr!r!r!r"�<module>s��

	&
C

)H
-	
	


tempfile.cpython-38.opt-1.pyc000064400000055547151450073350011763 0ustar00U

e5d�k�
@s�dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZ	ddl
ZddlZ
ddlmZddlZddlZddlZejZe	je	jBe	jBZee	d�r�ee	jOZeZee	d�r�ee	jOZee	d�r�e	j Z ndZ dZ!e�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&dd�Z'dd �Z(da)d!d"�Z*d#d$�Z+d%d	�Z,d&d�Z-da.d'd�Z/d(d
�Z0d=d*d�Z1d>d+d�Z2d,e!dfd-d�Z3Gd.d/�d/�Z4Gd0d1�d1�Z5d?dd5�d6d�Z6e	j7d7k�s�ej8d8k�r�e6Z9nee	d9�a:d@dd5�d:d�Z9Gd;d�d�Z;Gd<d�de<�Z=dS)Aa�Temporary files.

This module provides generic, low- and high-level interfaces for
creating temporary files and directories.  All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'.  'mktemp' is subject to race conditions and
should not be used; it is provided for backward compatibility only.

The default path names are returned as str.  If you supply bytes as
input, all return values will be in bytes.  Ex:

    >>> tempfile.mkstemp()
    (4, '/tmp/tmptpu9nin8')
    >>> tempfile.mkdtemp(suffix=b'')
    b'/tmp/tmppbi8f0hy'

This module also provides some data items to the user:

  TMP_MAX  - maximum number of names that will be tried before
             giving up.
  tempdir  - If this is set to a string before the first use of
             any routine from this module, it will be considered as
             another candidate location to store temporary files.
�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�N)�Random�
O_NOFOLLOW�O_BINARYi'ZtmpcCs.zt�|�Wntk
r$YdSXdSdS)NFT)�_os�lstat�OSError)�fn�r� /usr/lib64/python3.8/tempfile.py�_existsKs
rcGs\d}|D]B}|dkrqt|t�r6|tkr0td��t}q|tkrFtd��t}q|dkrXtS|S)zBLook at the type of all args and divine their implied return type.Nz1Can't mix bytes and non-bytes in path components.)�
isinstance�bytes�str�	TypeError)�argsZreturn_type�argrrr�_infer_return_typeTs
rcCsdt|||�}|dkr|�}|dkr:|tkr0t}n
t�t�}|dkrX|tkrRt�}nt�}||||fS)z9Common parameter processing for most APIs in this module.N)rr�templater�fsencoderr
)�prefix�suffix�dir�output_typerrr�_sanitize_paramsis
r&c@s0eZdZdZdZedd��Zdd�Zdd�Zd	S)
�_RandomNameSequencea,An instance of _RandomNameSequence generates an endless
    sequence of unpredictable strings which can safely be incorporated
    into file names.  Each string is eight characters long.  Multiple
    threads can safely use the same instance at the same time.

    _RandomNameSequence is an iterator.Z%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t��}|t|dd�kr&t�|_||_|jS)N�_rng_pid)r�getpid�getattr�_RandomZ_rngr()�selfZcur_pidrrr�rng�s
z_RandomNameSequence.rngcCs|S�Nr�r,rrr�__iter__�sz_RandomNameSequence.__iter__cs0|j�|jj���fdd�td�D�}d�|�S)Ncsg|]}����qSrr)�.0Zdummy��cZchooserr�
<listcomp>�sz0_RandomNameSequence.__next__.<locals>.<listcomp>��)�
charactersr-Zchoice�range�join)r,Zlettersrr2r�__next__�sz_RandomNameSequence.__next__N)	�__name__�
__module__�__qualname__�__doc__r7�propertyr-r0r:rrrrr'{s
r'c	Cs�g}dD]}t�|�}|r|�|�qtjdkrX|�tj�d�tj�d�ddddg�n|�d	d
dg�z|�t���Wn$t	t
fk
r�|�tj�YnX|S)z[Generate a list of candidate temporary directories which
    _get_default_tempdir will try.)ZTMPDIRZTEMPZTMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmpz/tmpz/var/tmpz/usr/tmp)r�getenv�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlistZenvname�dirnamerrr�_candidate_tempdir_list�s&


�rMcCsFt�}t�}|D�]}|tjkr,tj�|�}td�D�]�}t|�}tj�||�}zft�	|t
d�}z<z*t
j	|ddd��}|�d�W5QRXW5t�|�XW5t�|�X|WStk
r�Yq4tk
�rtjdk�rtj�|��rt�|tj��rYq4YqYq4tk
�r,YqYq4Xq4qttjd|��d	S)
aqCalculate the default directory to use for temporary files.
    This routine should be called exactly once.

    We determine whether or not a candidate temp dir is usable by
    trying to create and write to a file in that directory.  If this
    is successful, the test file is deleted.  To prevent denial of
    service, the name of the test file must be randomized.�d��wbF)�closefdsblatr@z)No usable temporary directory found in %sN)r'rMrrJrE�abspathr8�nextr9�open�_bin_openflags�unlink�close�_io�write�FileExistsError�PermissionErrorrC�isdir�access�W_OKr�FileNotFoundError�_errnoZENOENT)ZnamerrKr$�seqrC�filename�fd�fprrr�_get_default_tempdir�s@	

�
��recCs2tdkr.t��ztdkr t�aW5t��XtS)z7Common setup sequence for all user-callable interfaces.N)�_name_sequence�
_once_lock�acquire�releaser'rrrr�_get_candidate_names�s

rjc
	Cs�t�}|tkrttj|�}tt�D]�}t|�}tj�	||||�}t
�d|�zt�||d�}	WnVt
k
rzYq"Yn@tk
r�tjdkr�tj�|�r�t�|tj�r�Yq"n�YnX|	tj�|�fSt
tjd��dS)z>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.ztempfile.mkstemprOr@z#No usable temporary file name foundN)rjr�maprr!r8rrSrEr9�_sys�auditrTrZr[rCr\r]r^rRr`�EEXIST)
r$ZpreZsuf�flagsr%�namesrarC�filercrrr�_mkstemp_inner�s*��rrcCstS)z-The default prefix for temporary directories.)r rrrrr	
scCst�t��S)z6The default prefix for temporary directories as bytes.)rr!r	rrrrrscCs2tdkr.t��ztdkr t�aW5t��XtS)zAccessor for tempfile.tempdir.N)r
rgrhrirerrrrrs

cCst�t��S)z)A bytes version of tempfile.gettempdir().)rr!rrrrrr
#sFcCs2t|||�\}}}}|rt}nt}t|||||�S)a�User-callable function to create and return a unique temporary
    file.  The return value is a pair (fd, name) where fd is the
    file descriptor returned by os.open, and name is the filename.

    If 'suffix' is not None, the file name will end with that suffix,
    otherwise there will be no suffix.

    If 'prefix' is not None, the file name will begin with that prefix,
    otherwise a default prefix is used.

    If 'dir' is not None, the file will be created in that directory,
    otherwise a default directory is used.

    If 'text' is specified and true, the file is opened in text
    mode.  Else (the default) the file is opened in binary mode.

    If any of 'suffix', 'prefix' and 'dir' are not None, they must be the
    same type.  If they are bytes, the returned name will be bytes; str
    otherwise.

    The file is readable and writable only by the creating user ID.
    If the operating system uses permission bits to indicate whether a
    file is executable, the file is executable by no one. The file
    descriptor is not inherited by children of this process.

    Caller is responsible for deleting the file when done with it.
    )r&�_text_openflagsrUrr)r#r"r$�textr%rorrrr's
c	Cs�t|||�\}}}}t�}|tkr.ttj|�}tt�D]�}t|�}tj	�
||||�}t�d|�zt�
|d�WnVtk
r�Yq6Yn@tk
r�tjdkr�tj	�|�r�t�|tj�r�Yq6n�YnX|Sttjd��dS)aUser-callable function to create and return a unique temporary
    directory.  The return value is the pathname of the directory.

    Arguments are as for mkstemp, except that the 'text' argument is
    not accepted.

    The directory is readable, writable, and searchable only by the
    creating user.

    Caller is responsible for deleting the directory when done with it.
    ztempfile.mkdtemp�r@z(No usable temporary directory name foundN)r&rjrrkrr!r8rrSrEr9rlrm�mkdirrZr[rCr\r]r^r`rn)r#r"r$r%rprarCrqrrrrNs,
��r6cCs`|dkrt�}t�}tt�D]2}t|�}tj�||||�}t|�s|Sqt	t
jd��dS)a�User-callable function to return a unique temporary file name.  The
    file is not created.

    Arguments are similar to mkstemp, except that the 'text' argument is
    not accepted, and suffix=None, prefix=None and bytes file names are not
    supported.

    THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED.  The file name may
    refer to a file that did not exist at some point, but by the time
    you get around to creating it, someone else may have beaten you to
    the punch.
    Nz"No usable temporary filename found)rrjr8rrSrrEr9rrZr`rn)r#r"r$rprarCrqrrrrvs
�c@sLeZdZdZdZdZd
dd�Zejdkr@ej	fdd	�Z
d
d�Zndd	�Z
dS)�_TemporaryFileCloserz�A separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file.NFTcCs||_||_||_dSr.)rqrC�delete�r,rqrCrxrrr�__init__�sz_TemporaryFileCloser.__init__r@cCs<|js8|jdk	r8d|_z|j��W5|jr6||j�XdS�NT)�close_calledrqrxrCrW)r,rVrrrrW�sz_TemporaryFileCloser.closecCs|��dSr.)rWr/rrr�__del__�sz_TemporaryFileCloser.__del__cCs|jsd|_|j��dSr{)r|rqrWr/rrrrW�s)T)r;r<r=r>rqr|rzrrCrVrWr}rrrrrw�s



rwc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�_TemporaryFileWrapperz�Temporary file wrapper

    This class provides a wrapper around files opened for
    temporary use.  In particular, it seeks to automatically
    remove the file when it is no longer needed.
    TcCs$||_||_||_t|||�|_dSr.)rqrCrxrw�_closerryrrrrz�sz_TemporaryFileWrapper.__init__cs^|jd}t||�}t|d�rD|�t����fdd��}|j|_|}t|t�sZt|||�|S)Nrq�__call__cs
�||�Sr.r)r�kwargs��funcrr�func_wrapper�sz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	�__dict__r*�hasattr�
_functools�wrapsrr�int�setattr)r,rCrq�ar�rr�r�__getattr__�s



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr.)rq�	__enter__r/rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr.)rq�__exit__rW)r,�exc�value�tb�resultrrrr��sz_TemporaryFileWrapper.__exit__cCs|j��dS)zA
        Close the temporary file, possibly deleting it.
        N)rrWr/rrrrW�sz_TemporaryFileWrapper.closeccs|jD]
}|VqdSr.)rq)r,�linerrrr0�s
z_TemporaryFileWrapper.__iter__N)T)
r;r<r=r>rzr�r�r�rWr0rrrrr~�s
r~�w+b���T��errorscCs�t|||�\}}}}	t}
tjdkr0|r0|
tjO}
t||||
|	�\}}z$tj||||||d�}
t|
||�WSt	k
r�t�
|�t�|��YnXdS)a�Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
    r@��	buffering�newline�encodingr�N)r&rUrrCZO_TEMPORARYrrrXrTr~�
BaseExceptionrVrW)�moder�r�r�r#r"r$rxr�r%rorcrCrqrrrrs 

�

�posix�cygwin�	O_TMPFILEc
Cs�t|||�\}}}}t}	tr�z$|	tjBtj@}
t�||
d�}Wn*tk
rXdaYnFtk
rjYn4Xzt	j||||||d�WSt�
|��YnXt||||	|�\}}z"t�|�t	j||||||d�WSt�
|��YnXdS)a�Create and return a temporary file.
        Arguments:
        'prefix', 'suffix', 'dir' -- as for mkstemp.
        'mode' -- the mode argument to io.open (default "w+b").
        'buffering' -- the buffer size argument to io.open (default -1).
        'encoding' -- the encoding argument to io.open (default None)
        'newline' -- the newline argument to io.open (default None)
        'errors' -- the errors argument to io.open (default None)
        The file is created as mkstemp() would do it.

        Returns an object with a file-like interface.  The file has no
        name, and will cease to exist when it is closed.
        rOFr�N)
r&rU�_O_TMPFILE_WORKSrr��O_CREATrT�IsADirectoryErrorrrXrWrrrV)
r�r�r�r�r#r"r$r�r%roZflags2rcrCrrrr2s<
�


�
c@seZdZdZdZd:dd�dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zed0d1��Zd2d3�Zd;d4d5�Zd6d7�Zd8d9�ZdS)<rz�Temporary file wrapper, specialized to switch from BytesIO
    or StringIO to a real file when it exceeds a certain size or
    when a fileno is needed.
    Frr�r�Nr�c	
	CsTd|krt��|_ntjt��||	|d�|_||_d|_||||||||	d�|_dS)N�b)r�r�r�F)r�r�r#r"r�r�r$r�)rX�BytesIO�_file�
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r,�max_sizer�r�r�r�r#r"r$r�rrrrzus"
��zSpooledTemporaryFile.__init__cCs,|jr
dS|j}|r(|��|kr(|��dSr.)r�r��tell�rollover)r,rqr�rrr�_check�s
zSpooledTemporaryFile._checkcCsr|jr
dS|j}tf|j�}|_|`|��}t|d�rN|j�|���	��n|�|�	��|�
|d�d|_dS)N�bufferrT)r�r�rr�r�r�r�rY�detach�getvalue�seek)r,rqZnewfile�posrrrr��s
zSpooledTemporaryFile.rollovercCs|jjrtd��|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr/rrrr��szSpooledTemporaryFile.__enter__cCs|j��dSr.�r�rW�r,r�r�r�rrrr��szSpooledTemporaryFile.__exit__cCs
|j��Sr.)r�r0r/rrrr0�szSpooledTemporaryFile.__iter__cCs|j��dSr.r�r/rrrrW�szSpooledTemporaryFile.closecCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.closedcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.encodingcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.errorscCs|��|j��Sr.)r�r��filenor/rrrr��szSpooledTemporaryFile.filenocCs|j��dSr.)r��flushr/rrrr��szSpooledTemporaryFile.flushcCs
|j��Sr.)r��isattyr/rrrr��szSpooledTemporaryFile.isattycCs.z
|jjWStk
r(|jdYSXdS)Nr�)r�r�rIr�r/rrrr��s
zSpooledTemporaryFile.modecCs&z
|jjWStk
r YdSXdSr.)r�rCrIr/rrrrC�s
zSpooledTemporaryFile.namecCs|jjSr.)r��newlinesr/rrrr��szSpooledTemporaryFile.newlinescGs|jj|�Sr.)r��read�r,rrrrr��szSpooledTemporaryFile.readcGs|jj|�Sr.)r��readliner�rrrr��szSpooledTemporaryFile.readlinecGs|jj|�Sr.)r��	readlinesr�rrrr��szSpooledTemporaryFile.readlinescGs|jj|�Sr.)r�r�r�rrrr��szSpooledTemporaryFile.seekcCs|jjSr.)r��	softspacer/rrrr��szSpooledTemporaryFile.softspacecCs
|j��Sr.)r�r�r/rrrr��szSpooledTemporaryFile.tellcCs6|dkr|j��n||jkr&|��|j�|�dSr.)r��truncater�r�)r,�sizerrrr��s

zSpooledTemporaryFile.truncatecCs|j}|�|�}|�|�|Sr.)r�rYr�)r,�srq�rvrrrrY�s

zSpooledTemporaryFile.writecCs|j}|�|�}|�|�|Sr.)r��
writelinesr�)r,�iterablerqr�rrrr��s

zSpooledTemporaryFile.writelines)rr�r�NNNNN)N)r;r<r=r>r�rzr�r�r�r�r0rWr?r�r�r�r�r�r�r�rCr�r�r�r�r�r�r�r�rYr�rrrrrnsT��







c@sReZdZdZddd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)ra+Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everything contained
    in it are removed.
    NcCs0t|||�|_tj||j|jd�|�d�|_dS)NzImplicitly cleaning up {!r})�warn_message)rrC�_weakrefZfinalize�_cleanup�format�
_finalizer)r,r#r"r$rrrrzs�zTemporaryDirectory.__init__cs ��fdd�}tj�|d�dS)Nc	s�t|dt�r�dd�}zV|�kr0|tj�|��||�zt�|�Wn"ttfk
rh��|�YnXWq�tk
r�Yq�Xnt|dt�r�n�dS)NrcSs6zt�|d�Wntk
r$YnXt�|d�dS)Nrru)rZchflagsrI�chmod)rErrr�
resetpermss
z?TemporaryDirectory._rmtree.<locals>.onerror.<locals>.resetperms)	�
issubclassr[rrErLrVr��_rmtreer_)r�rE�exc_infor���clsrCrr�onerrorsz+TemporaryDirectory._rmtree.<locals>.onerror)r�)�_shutilZrmtree)r�rCr�rr�rr�szTemporaryDirectory._rmtreecCs|�|�t�|t�dSr.)r��	_warnings�warn�ResourceWarning)r�rCr�rrrr�/s
zTemporaryDirectory._cleanupcCsd�|jj|j�S)Nz	<{} {!r}>)r��	__class__r;rCr/rrr�__repr__4szTemporaryDirectory.__repr__cCs|jSr.)rCr/rrrr�7szTemporaryDirectory.__enter__cCs|��dSr.)�cleanupr�rrrr�:szTemporaryDirectory.__exit__cCs|j��r|�|j�dSr.)r�r�r�rCr/rrrr�=s
zTemporaryDirectory.cleanup)NNN)r;r<r=r>rz�classmethodr�r�r�r�r�r�rrrrr�s


)NNNF)NNN)r�r�NNNNNT)r�r�NNNNN)>r>�__all__�	functoolsr��warningsr��iorX�osrZshutilr��errnor`Zrandomrr+�sysrl�weakrefr��_thread�
allocate_lockZ_allocate_lock�O_RDWRr��O_EXCLrsr�rrUrrr rgrrr&r'rMrerfrjrrr	rr
rr
rrrrwr~rrC�platformrr�r�objectrrrrr�<module>s��





	-
'
( +?��'
��<mailbox.cpython-38.pyc000064400000165552151450073350010650 0ustar00U

e5dE3�@sRdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZzddl
Z
Wnek
r�dZ
YnXddddddd	d
ddd
ddddddgZej�d�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	ejj�ZGd d
�d
e�ZGd!d"�d"e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�Z Gd&d�de�Z!Gd'd(�d(�Z"Gd)d*�d*e"�Z#d=d,d-�Z$d.d/�Z%d0d1�Z&d2d3�Z'd4d5�Z(d6d7�Z)Gd8d�de*�Z+Gd9d�de+�Z,Gd:d�de+�Z-Gd;d�de+�Z.Gd<d�de+�Z/dS)>zDRead/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.�N�Mailbox�Maildir�mbox�MH�Babyl�MMDF�Message�MaildirMessage�mboxMessage�	MHMessage�BabylMessage�MMDFMessage�Error�NoSuchMailboxError�
NotEmptyError�ExternalClashError�FormatError�asciic@seZdZdZdCdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dDdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdEd0d1�Zd2d3�ZdFd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@Z"dGdAdB�Z#dS)Hrz*A group of messages in a particular place.NTcCs tj�tj�|��|_||_dS)zInitialize a Mailbox instance.N)�os�path�abspath�
expanduser�_path�_factory��selfr�factory�create�r�/usr/lib64/python3.8/mailbox.py�__init__$szMailbox.__init__cCstd��dS)�$Add message and return assigned key.�&Method must be implemented by subclassN��NotImplementedError�r�messagerrr�add)szMailbox.addcCstd��dS)�=Remove the keyed message; raise KeyError if it doesn't exist.r"Nr#�r�keyrrr�remove-szMailbox.removecCs|�|�dS�N)r+r)rrr�__delitem__1szMailbox.__delitem__cCs(z|�|�Wntk
r"YnXdS�z'If the keyed message exists, remove it.N)r+�KeyErrorr)rrr�discard4szMailbox.discardcCstd��dS)�>Replace the keyed message; raise KeyError if it doesn't exist.r"Nr#�rr*r&rrr�__setitem__;szMailbox.__setitem__cCs*z|�|�WStk
r$|YSXdS)z9Return the keyed message, or default if it doesn't exist.N)�__getitem__r/)rr*�defaultrrr�get?szMailbox.getc
CsB|js|�|�St�|�|���}|�|�W5QR�SQRXdS)z=Return the keyed message; raise KeyError if it doesn't exist.N)r�get_message�
contextlib�closing�get_file)rr*�filerrrr4Fs
zMailbox.__getitem__cCstd��dS)�4Return a Message representation or raise a KeyError.r"Nr#r)rrrr7NszMailbox.get_messagecCst�|�|����S)z�Return a string representation or raise a KeyError.

        Uses email.message.Message to create a 7bit clean string
        representation of the message.��email�message_from_bytes�	get_bytesZ	as_stringr)rrr�
get_stringRszMailbox.get_stringcCstd��dS)z8Return a byte string representation or raise a KeyError.r"Nr#r)rrrr@YszMailbox.get_bytescCstd��dS)�6Return a file-like representation or raise a KeyError.r"Nr#r)rrrr:]szMailbox.get_filecCstd��dS)�Return an iterator over keys.r"Nr#�rrrr�iterkeysaszMailbox.iterkeyscCst|���S)zReturn a list of keys.)�listrErDrrr�keyseszMailbox.keysc	cs>|��D]0}z||}Wntk
r0YqYnX|VqdS)z%Return an iterator over all messages.N�rEr/�rr*�valuerrr�
itervaluesis
zMailbox.itervaluescCs|��Sr,)rKrDrrr�__iter__rszMailbox.__iter__cCst|���S)z,Return a list of messages. Memory intensive.)rFrKrDrrr�valuesuszMailbox.valuesc	csB|��D]4}z||}Wntk
r0YqYnX||fVqdS)z.Return an iterator over (key, message) tuples.NrHrIrrr�	iteritemsys
zMailbox.iteritemscCst|���S)z9Return a list of (key, message) tuples. Memory intensive.)rFrNrDrrr�items�sz
Mailbox.itemscCstd��dS)�9Return True if the keyed message exists, False otherwise.r"Nr#r)rrr�__contains__�szMailbox.__contains__cCstd��dS)�*Return a count of messages in the mailbox.r"Nr#rDrrr�__len__�szMailbox.__len__cCs|��D]}|�|�qdS)zDelete all messages.N)rGr0r)rrr�clear�sz
Mailbox.clearcCs4z||}Wntk
r$|YSX|�|�|S)z3Delete the keyed message and return it, or default.)r/r0)rr*r5�resultrrr�pop�s

zMailbox.popcCs*|��D]}||�|�fStd��dS)z6Delete an arbitrary (key, message) pair and return it.zNo messages in mailboxN)rErVr/r)rrr�popitem�szMailbox.popitemc	Cstt|d�r|��}nt|d�r(|��}n|}d}|D].\}}z|||<Wq4tk
r`d}Yq4Xq4|rptd��dS)z4Change the messages that correspond to certain keys.rNrOFTzNo message with key(s)N)�hasattrrNrOr/)r�arg�sourceZbad_keyr*r&rrr�update�s



zMailbox.updatecCstd��dS)�&Write any pending changes to the disk.r"Nr#rDrrr�flush�sz
Mailbox.flushcCstd��dS)�Lock the mailbox.r"Nr#rDrrr�lock�szMailbox.lockcCstd��dS)�#Unlock the mailbox if it is locked.r"Nr#rDrrr�unlock�szMailbox.unlockcCstd��dS)�Flush and close the mailbox.r"Nr#rDrrr�close�sz
Mailbox.closecCs.z|�d�WStk
r(td��YnXdS)Nrz?String input must be ASCII-only; use bytes or a Message instead)�encode�UnicodeError�
ValueErrorr%rrr�_string_to_bytes�szMailbox._string_to_bytesFc	Cs�t|tjj�rvt��}tj�||d�}|�|�|�	d�|�
�}|�dt�}|�
|�|jrr|�t�sr|�
t��n�t|tttjf��rt|tj�r�t�dtd�|��}t|t�r�|�|�}|r�|�dd�}|�dt�}|�
|�|j�r�|�t��s�|�
t�n�t|d��r�t|d��r2t�d	td�|j}d
}|��}|�d��r\|d
d�d}n|�d
��rx|d
d�d}|�s��q�|�r�|�d��r�d|dd
�}|�dt�}|�
|�|}�q6|j�r�|�r�|�t��s�|�
t�ntdt|���d
S)z%Dump message contents to target file.r�
�8Use of StringIO input is deprecated, use BytesIO instead�s
From s
>From �read�buffer�DUse of text mode files is deprecated, use a binary mode file insteadN�
����
����From s>From ��Invalid message type: %s)�
isinstancer>r&r�io�BytesIO�	generator�BytesGenerator�flatten�seekrk�replace�linesep�write�_append_newline�endswith�str�bytes�StringIO�warnings�warn�DeprecationWarning�getvaluergrXrl�readline�
startswith�	TypeError�type)	rr&�targetZmangle_from_rl�gen�dataZlastline�linerrr�
_dump_message�s`


�


�
zMailbox._dump_message)NT)N)N)N)F)$�__name__�
__module__�__qualname__�__doc__r r'r+r-r0r3r6r4r7rAr@r:rErGrKrLrMrNrOrQrSrTrVrWr[r]r_rarcrgrr�rrrrr!sB

		
	
c@s�eZdZdZdZd6dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7rzA qmail-style Maildir mailbox.�:NTcCs�t�||||�tj�|jd�tj�|jd�tj�|jd�d�|_tj�|j�s�|r�t�|jd�|j�	�D]}t�|d�qln
t
|j��i|_ddd�|_d|_
d|_d	S)
zInitialize a Maildir instance.�tmp�new�cur)r�r�r��r)r�r�g�������?N)rr rr�joinr�_paths�exists�mkdirrMr�_toc�_toc_mtimes�
_last_read�_skewfactor)r�dirnamerrrrrrr 
s�
zMaildir.__init__c
Cs~|��}z|�||�Wn*tk
rB|��t�|j��YnXt|�t|t	�r||�
�}|j|��}||jkr�d}nd}d}tj
�|j��|j�d}tj
�|j|||�}t|t	�r�t�|jtj
�|j�|��f�zLzt�|j|�Wn(ttfk
�rt�|j|�YnXt�|j�WnNtk
�rx}z.t�|j�|jtjk�rftd|��n�W5d}~XYnX|S)r!�r�rz$Name clash with existing message: %sN)�_create_tmpr��
BaseExceptionrcrr+�name�_sync_closerur	�
get_subdir�colon�get_infor�basename�splitr�r�utime�getatime�get_date�link�AttributeError�PermissionError�rename�OSError�errnoZEEXISTr)rr&Ztmp_file�subdir�suffix�uniq�dest�errrr'!sF


��zMaildir.addcCs t�tj�|j|�|���dS�r(N)rr+rr�r�_lookupr)rrrr+KszMaildir.removec	Cs,z|�|�Wnttfk
r&YnXdSr.)r+r/�FileNotFoundErrorr)rrrr0OszMaildir.discardcCs�|�|�}|�|�}|�|�}t|t�r.|}n|}tj�|�}|j|kr`|j|�|j�d}nd}|�	|�tj�
|j|�}	tj�
|j|||�}
t|t�r�t�|	tj�
|	�|��f�t�|	|
�dS)r1rqr�N)r�r'rur	rrr�r�r�r0r�rr�r�r�r�)rr*r&Zold_subpathZtemp_keyZtemp_subpathZdominant_subpathr�r�Ztmp_path�new_pathrrrr3Ws$






�zMaildir.__setitem__c	Cs�|�|�}ttj�|j|�d�� }|jr4|�|�}nt|�}W5QRXtj�|�\}}|�	|�|j
|kr�|�|�|j
�d�|�tj�
tj�|j|���|S)r<�rbrq)r��openrrr�rrr	r��
set_subdirr��set_info�set_date�getmtime)rr*Zsubpath�f�msgr�r�rrrr7rs


zMaildir.get_messagec
CsDttj�|j|�|��d��}|���td�W5QR�SQRXdS)�2Return a bytes representation or raise a KeyError.r�rhN)	r�rrr�rr�rkr|r}�rr*r�rrrr@�szMaildir.get_bytescCs$ttj�|j|�|��d�}t|�S)rBr�)r�rrr�rr��
_ProxyFiler�rrrr:�szMaildir.get_filec	csF|��|jD]2}z|�|�Wntk
r8YqYnX|VqdS�rCN)�_refreshr�r�r/r)rrrrE�s

zMaildir.iterkeyscCs|��||jkS�rP)r�r�r)rrrrQ�szMaildir.__contains__cCs|��t|j�S�rR)r��lenr�rDrrrrS�szMaildir.__len__cCsdS)�"Write any pending changes to disk.NrrDrrrr]�sz
Maildir.flushcCsdS)r^NrrDrrrr_�szMaildir.lockcCsdS)r`NrrDrrrra�szMaildir.unlockcCsdS�rbNrrDrrrrc�sz
Maildir.closecCs\g}t�|j�D]F}t|�dkr|ddkrtj�tj�|j|��r|�|dd��q|S)�Return a list of folder names.�r�.N)r�listdirrr�r�isdirr��append�rrU�entryrrr�list_folders�s�zMaildir.list_folderscCs ttj�|jd|�|jdd�S)z/Return a Maildir instance for the named folder.r�F�rr)rrrr�rr�r�folderrrr�
get_folder�s�zMaildir.get_foldercCs\tj�|jd|�}t||jd�}tj�|d�}tj�|�sXt�t�|tj	tj
Bd��|S)z>Create a folder and return a Maildir instance representing it.r��rZ
maildirfolder�)rrr�rrrr�rcr��O_CREAT�O_WRONLY)rr�rrUZmaildirfolder_pathrrr�
add_folder�s�zMaildir.add_foldercCstj�|jd|�}t�tj�|d��t�tj�|d��D](}t|�dksX|ddkr<td|��q<t�|�D]B}|dkrp|dkrp|dkrptj�tj�||��rptd||f��qptj|d	d
�D]F\}}}|D]}t�	tj�||��q�|D]}t�
tj�||��q�q�t�
|�dS)�-Delete the named folder, which must be empty.r�r�r�r�rzFolder contains message(s): %sr�z%Folder contains subdirectory '%s': %sF)�topdownN)rrr�rr�r�rr��walkr+�rmdir)rr�rr��root�dirs�filesrrr�
remove_folder�s&���zMaildir.remove_foldercCsXt��}t�tj�|jd��D]4}tj�|jd|�}|tj�|�dkrt�|�qdS)zDelete old files in "tmp".r�i@�N)�timerr�rr�rr�r+)r�nowr�rrrr�clean�s
z
Maildir.cleanr�cCs�t��}t��}d|kr$|�dd�}d|kr8|�dd�}dt|�t|dd�t��tj|f}tj	�
|jd|�}zt�|�WnFt
k
r�tjd7_zt|�WYStk
r�YnXYnXtd	|��d
S)z=Create a file in the tmp subdirectory and open and return it.�/z\057r�z\072z%s.M%sP%sQ%s.%sr�g��.Ar�z&Name clash prevented file creation: %sN)r��socket�gethostnamer|�intr�getpidr�_countrr�r�statr��_create_carefully�FileExistsErrorr)rr�Zhostnamer�rrrrr��s,��zMaildir._create_tmpcCs�t��|jd|jkr^d}|jD]2}tj�|j|�}||j|krJd}||j|<q"|s^dSi|_|jD]^}|j|}t�	|�D]D}tj�
||�}tj�|�r�q�|�|j
�d}tj�
||�|j|<q�qjt��|_dS)z!Update table of contents mapping.�FTNr)r�r�r�r�rrr�r�r�r�r�r�r�r�)rZrefreshr��mtimerr��pr�rrrr��s&


zMaildir._refreshcCs�z.tj�tj�|j|j|��r,|j|WSWntk
rBYnX|��z|j|WStk
rztd|�d�YnXdS)z=Use TOC to return subpath for given key, or raise a KeyError.�No message with key: %sN)rrr�r�rr�r/r�r)rrrr�#szMaildir._lookupcCsXt|d�s|��|_z|t|j�WStk
r:YdStk
rPYqYqXqdS)z0Return the next message in a one-time iteration.�
_onetime_keysN)rXrEr��next�
StopIterationr/rDrrrr�1s

zMaildir.next)NT)r�r�r�r�r�r r'r+r0r3r7r@r:rErQrSr]r_rarcr�r�r�r�r�r�r�r�r�r�rrrrrs6
*
	
$c@s�eZdZdZd$dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd%d d!�Zd"d#�ZdS)&�_singlefileMailboxzA single-file mailbox.NTc
Cs�t�||||�zt|jd�}Wnntk
r�}zP|jtjkr\|rPt|jd�}q~t|j��n"|jtjtj	fkr|t|jd�}n�W5d}~XYnX||_
d|_d|_d|_
d|_d|_d|_dS)z!Initialize a single-file mailbox.�rb+zwb+r�NrF)rr r�rr�r��ENOENTr�EACCES�EROFS�_filer��	_next_key�_pending�
_pending_sync�_locked�_file_length)rrrrr�r�rrrr As$z_singlefileMailbox.__init__cCs8|��|�|�|j|j<|jd7_d|_|jdS)r!r�T)r��_append_messager�rrr%rrrr'Xs
z_singlefileMailbox.addcCs|�|�|j|=d|_dS)r(TN)r�r�rr)rrrr+bs
z_singlefileMailbox.removecCs$|�|�|�|�|j|<d|_dS)r1TN)r�r	r�rr2rrrr3hs
z_singlefileMailbox.__setitem__ccs|��|j��EdHdSr�)r�r�rGrDrrrrEnsz_singlefileMailbox.iterkeyscCs|��||jkSr�)r�r�r)rrrrQssz_singlefileMailbox.__contains__cCs|��t|j�Sr�)r�r�r�rDrrrrSxsz_singlefileMailbox.__len__cCs|jst|j�d|_dS)r^TN)r�
_lock_filerrDrrrr_}s
z_singlefileMailbox.lockcCs|jrt|j�d|_dS�r`FN)r�_unlock_filerrDrrrra�s
z_singlefileMailbox.unlockc
Cs�|js |jrt|j�d|_dS|jdk	s.t�|j�dd�|j��}||jkrbt	d|j|f��t
|j�}z�i}|�|�t
|j���D]x}|j|\}}|j�|�|�|�|��}|j�td||j����}|s�q�|�|�q�||��f||<|�|�q�|��|_Wn"|��t�|j��YnXt|�|j��t�|j�j}	t�|j|	�zt�|j|j�Wn2tk
�r�t�|j�t�|j|j�YnXt|jd�|_||_d|_d|_|j�r�t |jdd�dS)	r�FNrr�z4Size of mailbox file changed (expected %i, found %i)�r�)�dotlock)!rr�_sync_flushrr��AssertionErrorr{�tellrr�_create_temporaryr�_pre_mailbox_hook�sortedrG�_pre_message_hookrk�minr~�_post_message_hookrcrr+r�r�r��st_mode�chmodr�r�r�rr
)
rZcur_lenZnew_fileZnew_tocr*�start�stopZ	new_startrl�moderrrr]�sb


�



�
z_singlefileMailbox.flushcCsdS)�,Called before writing the mailbox to file f.Nr�rr�rrrr�sz$_singlefileMailbox._pre_mailbox_hookcCsdS)�-Called before writing each message to file f.Nrrrrrr�sz$_singlefileMailbox._pre_message_hookcCsdS��,Called after writing each message to file f.Nrrrrrr�sz%_singlefileMailbox._post_message_hookcCs4z|��W5z|jr|��W5|j��XXdSr�)rrcrrar]rDrrrrc�sz_singlefileMailbox.closecCsN|jdkr|��|dk	rJz|j|WStk
rHtd|�d�YnXdS)z'Return (start, stop) or raise KeyError.Nr�)r��
_generate_tocr/r)rrrr��s
z_singlefileMailbox._lookupcCs�|j�dd�|j��}t|j�dkr8|js8|�|j�z&|�|j�|�|�}|�	|j�Wn"t
k
r�|j�|��YnX|j��|j��|_
|S)z;Append message to mailbox and return (start, stop) offsets.rr�)rr{rr�r�rrr�_install_messagerr��truncater]r)rr&ZbeforeZoffsetsrrrr	�s


z"_singlefileMailbox._append_message)NT)N)r�r�r�r�r r'r+r3rErQrSr_rar]rrrrcr�r	rrrrr�>s"

@

r�c@sBeZdZdZdZdd�Zddd�Zddd	�Zdd
d�Zdd
�Z	dS)�	_mboxMMDFzAn mbox or MMDF mailbox.TcCsp|�|�\}}|j�|�|j���td�}|j�||j���}|�|�td��}|�	|dd��
d��|S)r<�rhrsNr)r�rr{r�r|r}rkr�_message_factory�set_from�decode)rr*rr�	from_line�stringr�rrrr7sz_mboxMMDF.get_messageFcCst�|�||��j|d�S)�3Return a string representation or raise a KeyError.)�unixfromr=)rr*�from_rrrrAs

��z_mboxMMDF.get_stringcCsJ|�|�\}}|j�|�|s(|j��|j�||j���}|�td�S)r,rh)r�rr{r�rkrr|r})rr*r.rrr+rrrr@s
z_mboxMMDF.get_bytescCs<|�|�\}}|j�|�|s(|j��t|j|j��|�S)rB)r�rr{r��_PartialFiler)rr*r.rrrrrr:s

z_mboxMMDF.get_filecCsd}t|t�r|�|�}t|t�rf|�d�rf|�d�}|dkr\|d|�}||dd�}q�|}d}nJt|t�r�|���d�}d|}n(t|t	j
j�r�|��}|dk	r�|�d�}|dkr�dt
�t
�����}|j��}|j�|t�|�||j|j�|j��}||fS)	z1Format a message and blindly write to self._file.Nrrrhrqr�r&rsFrom MAILER-DAEMON )rur�rgr�r��find�_mboxMMDFMessage�get_fromrdr>r&r�get_unixfromr��asctime�gmtimerrr~r}r��
_mangle_from_)rr&r*�newlineZauthorrrrrrr#&s0







z_mboxMMDF._install_messageN)F)F)F)
r�r�r�r�r6r7rAr@r:r#rrrrr%s


	
r%c@s2eZdZdZdZdZd
dd�Zdd�Zdd	�ZdS)rzA classic mbox mailbox.TNcCst|_t�||||�dS)zInitialize an mbox mailbox.N)r
r'r%r rrrrr Lsz
mbox.__init__cCs|�t�dSr �r~r}rrrrrQszmbox._post_message_hookcCs�gg}}d}|j�d�|j��}|j��}|�d�rzt|�t|�krj|r`|�|tt��n
|�|�|�|�d}q|s�|r�|�|tt��q�|�|�q�q|tkr�d}qd}qtt	t
||���|_t|j�|_|j��|_
dS)�0Generate key-to-(start, stop) table of contents.FrrrTN)rr{rr�r�r�r�r}�dict�	enumerate�zipr�rr)r�starts�stopsZlast_was_empty�line_posr�rrrr"Us.






zmbox._generate_toc)NT)	r�r�r�r�r6rr rr"rrrrrCs
c@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
rzAn MMDF mailbox.NTcCst|_t�||||�dS)zInitialize an MMDF mailbox.N)r
r'r%r rrrrr zsz
MMDF.__init__cCs|�dt�dS)r�Nr8rrrrrszMMDF._pre_message_hookcCs|�tdt�dS)r!r@Nr8rrrrr�szMMDF._post_message_hookcCs�gg}}|j�d�d}|}|j��}|j��}|�dt�r�|�|�|}|j��}|j��}|dtkr�|�|tt��q�qJ|sJ|�|�q�qJq|sq�qtt	t
||���|_t|j�|_|j�dd�|j��|_
dS)r9rr@r�N)rr{r�rr�r}r�r�r:r;r<r�rr)rr=r>�next_posr?r�rrrr"�s.






zMMDF._generate_toc)NT)r�r�r�r�r rrr"rrrrrws

c@s�eZdZdZd0dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdS)1rzAn MH mailbox.NTcCstt�||||�tj�|j�sj|r`t�|jd�t�t�tj�	|jd�tj
tjBtjBd��n
t
|j��d|_dS)zInitialize an MH instance.r��
.mh_sequencesi�FN)rr rrr�rr�rcr�r�r��O_EXCLr�rrrrrrr �s�
zMH.__init__cCs�|��}t|�dkrd}nt|�d}tj�|jt|��}t|�}d}z�|j
rVt|�zfz|�
||�Wn:tk
r�|j
r�t|�t	|�d}t�|��YnXt|t�r�|�||�W5|j
r�t|�XW5|s�t	|�X|S)r!rr�FT)rGr��maxrrr�rr�r�r�rr
rr�r�r+rur�_dump_sequences)rr&rGZnew_keyr�r��closedrrrr'�s6


zMH.addc
Csxtj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnX|�
�t�|�dS)r(r�r�N)rrr�rr�r�r�r�rr/rcr+)rr*rr�r�rrrr+�sz	MH.removec
Cs�tj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnXzd|jrrt|�z@t�t�|tjtjB��|�||�t|t�r�|�||�W5|jr�t
|�XW5t
|�XdS)r1r�r�N)rrr�rr�r�r�r�rr/r�rr
rrcr��O_TRUNCr�rurrE)rr*r&rr�r�rrrr3�s$
zMH.__setitem__c
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�2|jr�t|�zt
|�}W5|jr�t|�XW5QRX|����D]\}}||kr�|�|�q�|S)r<r�r�r�N)rr�rrr�rr�r�r�rr/r
rr�
get_sequencesrO�add_sequence)rr*r�r�r�r��key_listrrrr7�s&zMH.get_messagec
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�F|jr�t|�z |�
��td�W�W5QR�S|jr�t|�XW5QRXdS)r�r�r�r�Nrh)rr�rrr�rr�r�r�rr/r
rrkr|r}�rr*r�r�rrrr@s zMH.get_bytesc
Csfzttj�|jt|��d�}Wn>tk
r\}z |jtjkrJt	d|��n�W5d}~XYnXt
|�S)rBr�r�N)r�rrr�rr�r�r�rr/r�rKrrrr:)szMH.get_filecCsttdd�t�|j�D���S)rCcss|]}|��rt|�VqdSr,)�isdigitr�)�.0r�rrr�	<genexpr>6s�zMH.iterkeys.<locals>.<genexpr>)�iterrrr�rrDrrrrE4szMH.iterkeyscCstj�tj�|jt|���Sr�)rrr�r�rr�r)rrrrQ9szMH.__contains__cCstt|����Sr�)r�rFrErDrrrrS=sz
MH.__len__cCs2|js.ttj�|jd�d�|_t|j�d|_dS)r^rBr�TN)rr�rrr�rrr
rDrrrr_As
zMH.lockcCs(|jr$t|j�t|j�|`d|_dSr)rrrr�rDrrrraHs


z	MH.unlockcCsdS)r\NrrDrrrr]PszMH.flushcCs|jr|��dSr�)rrarDrrrrcTszMH.closecCs<g}t�|j�D]&}tj�tj�|j|��r|�|�q|S)r�)rr�rrr�r�r�r�rrrr�Ys
zMH.list_folderscCsttj�|j|�|jdd�S)z+Return an MH instance for the named folder.Fr��rrrr�rrr�rrrr�as�z
MH.get_foldercCsttj�|j|�|jd�S)z:Create a folder and return an MH instance representing it.r�rPr�rrrr�fs�z
MH.add_foldercCs`tj�|j|�}t�|�}|dgkr:t�tj�|d��n|gkrDntd|j��t�|�dS)r�rBzFolder not empty: %sN)rrr�rr�r+rr�)rr�r�entriesrrrr�ks

zMH.remove_folderc

si}ttj�|jd�ddd���}t|����|D]�}z�|�d�\}}t�}|��D]H}|��rn|�	t
|��qRdd�|�d�D�\}}	|�t||	d	��qR�fd
d�t
|�D�||<t||�dkr�||=Wq0tk
r�td
|����Yq0Xq0W5QRX|S)z=Return a name-to-key-list dictionary to define each sequence.rB�r�ASCII��encodingr�css|]}t|�VqdSr,)r�)rM�xrrrrN�sz#MH.get_sequences.<locals>.<genexpr>�-r�csg|]}|�kr|�qSrr)rMr*�Zall_keysrr�
<listcomp>�s�z$MH.get_sequences.<locals>.<listcomp>rz"Invalid sequence specification: %s)r�rrr�r�setrGr�rLr'r�r[�rangerr�rfr�rstrip)
rZresultsr�r�r��contentsrG�specrrrrXrrHws(
�zMH.get_sequencescCsttj�|jd�ddd�}z�t�t�|jtjtj	B��|�
�D]�\}}t|�dkrVq@|�|d�d}d}t
t|��D]R}|d	|kr�|s�d
}|�d�n*|r�d}|�d||f�n|�d
|�|}qx|r�|�t|�d�q@|�d�q@W5t|�XdS)z:Set sequences using the given name-to-key-list dictionary.rBzr+rSrTrr�NFr�TrWz%s %sz %s�
)r�rrr�rr�rcr�r�rGrOr�r~rrZr�)r�	sequencesr�r�rG�prevZ
completingr*rrr�
set_sequences�s.zMH.set_sequencesc	
Cs>|��}d}g}|��D]�}|d|kr�|�||df�z4t�tj�|jt|��tj�|jt|d���WnHt	t
fk
r�t�tj�|jt|��tj�|jt|d���YnXt�tj�|jt|���|d7}q|d|_
t|�dkr�dS|��D]0\}}|D]"\}}||k�r
|||�|�<�q
q�|�|�dS)z?Re-name messages to eliminate numbering gaps. Invalidates keys.rr�N)rHrEr�rr�rr�rr�r�r�r��unlinkrr�rO�indexrb)	rr`raZchangesr*r�rJ�oldr�rrr�pack�s0��



zMH.packcCst|��}|��}|��D]0\}}||kr4|�|�q||kr||�|�=q|D]}||krN|g||<qN|�|�dS)z;Inspect a new MHMessage and update sequences appropriately.N)rHrOr�rdrb)rr&r*Zpending_sequencesZ
all_sequencesr�rJ�sequencerrrrE�szMH._dump_sequences)NT)r�r�r�r�r r'r+r3r7r@r:rErQrSr_rar]rcr�r�r�r�rHrbrfrErrrrr�s.
"c@s�eZdZdZedddddddh�Zd%dd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd	S)&rzAn Rmail-style Babyl mailbox.�unseen�deletedZfiled�answered�	forwardedZedited�resentNTcCst�||||�i|_dS)zInitialize a Babyl mailbox.N)r�r �_labelsrrrrr �szBabyl.__init__cCs(t�||�}t|t�r$|��|j|<|S)r!)r�r'rur�
get_labelsrm)rr&r*rrrr'�s
z	Babyl.addcCs"t�||�||jkr|j|=dSr�)r�r+rmr)rrrr+�s
zBabyl.removecCs*t�|||�t|t�r&|��|j|<dS)r1N)r�r3rurrnrmr2rrrr3�s
zBabyl.__setitem__c
Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,t��}|j��}|tks�|s|q�|�|�td��qd||j�	�}|dks�t
�|j�|�}|�td�}t|�
�|�}	|	�|�
��||jkr�|	�|j|�|	S)r<�*** EOOH ***rhr)r�rr{r�rvrwr}r~r|rrrkrr��set_visiblerm�
set_labels)
rr*rr�original_headersr�Zvisible_headers�nZbodyr�rrrr7�s,



zBabyl.get_messagec	Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,|j��}|tksv|s\qvq\|�	�}||j�
�}|dks�t�|j�|�}|�td�}||S)r,rorhr)
r�rr{r�rvrwr}r~r|r�rrrk)	rr*rrrrr�Zheadersrsr�rrrr@s"


zBabyl.get_bytescCst�|�|��dt��S)rBrh)rvrwr@r|r}r)rrrr:%szBabyl.get_filecCs<|��t�}|j��D]}|�|�q|�|j�t|�S)z4Return a list of user-defined labels in the mailbox.)r�rZrmrMr[�difference_update�_special_labelsrF)r�labelsZ
label_listrrrrn)szBabyl.get_labelscCs:gg}}|j�d�d}g}|}|j��}|j��}|dtkr�t|�t|�krd|�|tt��|�|�dd�|j��dd��d�D�}|�|�q|dks�|dtkr�t|�t|�kr�|�|tt��q|s|�|tt��q�qtt	t
||���|_tt	|��|_t|j�|_
|j�dd	�|j��|_dS)
r9rscSsg|]}|��r|���qSr)�strip�rM�labelrrrrY@s�z'Babyl._generate_toc.<locals>.<listcomp>r�N�,�r�)rr{r�rr}r�r�r�r:r;r<r�rmrr)rr=r>rAZlabel_listsr?r�rvrrrr"2s4



�zBabyl._generate_toccCsVdt}|dt7}|��}dd�|D�}|dd�|�t7}|d7}|�|�dS)	rsBABYL OPTIONS:s
Version: 5css|]}|��VqdSr,)rdrxrrrrNUsz*Babyl._pre_mailbox_hook.<locals>.<genexpr>sLabels:rzr{N)r}rnr�r~)rr�ZbabylrvrrrrPszBabyl._pre_mailbox_hookcCs|�dt�dS)r�Nr8rrrrrZszBabyl._pre_message_hookcCs|�td�dS)r!r{Nr8rrrrr^szBabyl._post_message_hookcCsx|j��}t|t�r�g}g}|��D]$}||jkr>|�|�q$|�|�q$|j�d�|D]}|j�d|���qZ|j�d�|D]}|j�d|��d�q�|j�t	�n|j�dt	�t|t
jj��rt
��}t
j�|dd�}|�|�|�d�|��}|j�|�d	t	��|d	k�s,|s��q,q�|j�d
t	�t|t��r�t
��}	t
j�|	dd�}
|
�|���|	��}|j�|�d	t	��|d	k�s�|�sn�q�qnn>|�d�|��}|j�|�d	t	��|d	k�s�|�s��q�q�|�d�}|�s��qf|j�|�d	t	���q�nTt|ttt
jf��rt|t
j��rJt�dtd
�|��}t|t��r`|�|�}|�d�d}|ddk�r�|j�|d|��d	t	��|j�d
t	�|j�|d|��d	t	��|j�||d��d	t	��n(|j�d
t	t	�|j�|�d	t	���nXt |d��rVt |d��r:t�dtd
�|j!}|��}
d}|��}|�"d��rl|dd�d	}n|�"d��r�|dd�d	}|j�|�d	t	��|d	k�s�|�sF|�r�d}|j�d
t	�|�|
�n�qڐqF|��}|�s�qf|�"d��r
|dd�t	}n:|�"d��r(|dd�t	}n|�"d	��rD|dd�t	}|j�|��q�nt#dt$|���|j��}||fS)z0Write message contents and return (start, stop).�1s, s,,� rzs1,,Frrhror
rirjs

r�rqNr�rlrmTrnrorprt)%rrrurrnrur�r~rdr}r>r&rrvrwrxryrzr{r�r|�get_visiblerkr�r�r�r�r�r�r�rgr0rXrlr�r�r�)rr&rZspecial_labelsrvryZorig_bufferZorig_generatorr�Z
vis_bufferZ
vis_generatorrlZ
body_startZoriginal_posZ
first_passrrrrr#bs�







�
�
zBabyl._install_message)NT)r�r�r�r��	frozensetrur r'r+r3r7r@r:rnr"rrrr#rrrrr�s&
�
	
c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz0Message with mailbox-format-specific properties.NcCs�t|tjj�r4|�t�|��t|t�r�|�|�n�t|t�rP|�t�	|��n~t|t
�rl|�t�|��nbt|tj
�r�|�t�|��nDt|d�r�|�t�|��n(|dkr�tjj�|�ntdt|���dS)zInitialize a Message instance.rkNrt)rur>r&r�_become_message�copyZdeepcopy�_explain_tor�r?r�Zmessage_from_stringrv�
TextIOWrapperZmessage_from_filerXZmessage_from_binary_filer r�r�r%rrrr �s



zMessage.__init__cCs4t|dg�}|jD]}||kr|j||j|<qdS)z0Assume the non-format-specific state of message.�_type_specific_attributesN)�getattr�__dict__)rr&Z
type_specificr�rrrr��s
zMessage._become_messagecCst|t�rdStd��dS)z:Copy format-specific state to message insofar as possible.Nz Cannot convert to specified type)rurr�r%rrrr��s
zMessage._explain_to)N)r�r�r�r�r r�r�rrrrr�s
c@s|eZdZdZdddgZddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)r	z)Message with Maildir-specific properties.�_subdir�_info�_dateNcCs&d|_d|_t��|_t�||�dS)z%Initialize a MaildirMessage instance.r�r�N)r�r�r�r�rr r%rrrr �s
zMaildirMessage.__init__cCs|jS)zReturn 'new' or 'cur'.)r�rDrrrr��szMaildirMessage.get_subdircCs(|dks|dkr||_ntd|��dS)zSet subdir to 'new' or 'cur'.r�r�z!subdir must be 'new' or 'cur': %sN)r�rf)rr�rrrr�szMaildirMessage.set_subdircCs"|j�d�r|jdd�SdSdS)�*Return as a string the flags that are set.�2,r�Nr�)r�r�rDrrr�	get_flags
szMaildirMessage.get_flagscCsdd�t|��|_dS)�)Set the given flags and unset all others.r�r�N)r�rr�)r�flagsrrr�	set_flagsszMaildirMessage.set_flagscCs$|�d�t|���t|�B��dS�z.Set the given flag(s) without changing others.r�N�r�r�rZr��r�flagrrr�add_flagszMaildirMessage.add_flagcCs,|��r(|�d�t|���t|���dS)�7Unset the given string flag(s) without changing others.r�N)r�r�r�rZr�rrr�remove_flagszMaildirMessage.remove_flagcCs|jS)z<Return delivery date of message, in seconds since the epoch.)r�rDrrrr�szMaildirMessage.get_datecCs6zt|�|_Wn"tk
r0td|�d�YnXdS)z9Set delivery date of message, in seconds since the epoch.zcan't convert to float: %sN)�floatr�rfr�)r�daterrrr�"szMaildirMessage.set_datecCs|jS)z%Get the message's "info" as a string.)r�rDrrrr�)szMaildirMessage.get_infocCs&t|t�r||_ntdt|���dS)z Set the message's "info" string.zinfo must be a string: %sN)rur�r�r�r�)r�inforrrr�-s
zMaildirMessage.set_infocCs�t|t�r8|�|���|�|���|�|����nht|t�r�t	|���}d|kr`|�
d�|��dkrv|�
d�d|kr�|�
d�d|kr�|�
d�d|kr�|�
d�|�d	t�
|����n�t|t��rt	|���}d|kr�|�d
�d|k�r|�d�d|k�r�|�d�n�t|t��r�t	|���}d|k�rD|�d
�d|k�rX|�d
�d|k�rl|�d�d|k�r�|�d�nt|t��r�ntdt|���dS)z;Copy Maildir-specific state to message insofar as possible.�S�Rr��O�T�D�F�A�
MAILER-DAEMONrh�replied�flaggedrirj�Prk�$Cannot convert to specified type: %sN)rur	r�r�r�r�r�r�r1rZr�r(r�r5rrIr�	add_labelrr�r�)rr&r�rrrr�4sP

















�zMaildirMessage._explain_to)N)r�r�r�r�r�r r�r�r�r�r�r�r�r�r�r�r�rrrrr	�s

c@sZeZdZdZdgZddd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)r1z/Message with mbox- or MMDF-specific properties.�_fromNcCsV|�dd�t|tjj�rF|��}|dk	rF|�d�rF|�|dd��t�||�dS)z'Initialize an mboxMMDFMessage instance.r�TNzFrom rs)r(rur>r&rr3r�r )rr&r-rrrr esz_mboxMMDFMessage.__init__cCs|jS)z Return contents of "From " line.)r�rDrrrr2nsz_mboxMMDFMessage.get_fromcCs4|dk	r*|dkrt��}|dt�|�7}||_dS)z>Set "From " line, formatting and appending time_ if specified.NT� )r�r5r4r�)rr.Ztime_rrrr(rs
z_mboxMMDFMessage.set_fromcCs|�dd�|�dd�S)r��Statusr��X-Status)r6rDrrrr�zsz_mboxMMDFMessage.get_flagscCs�t|�}d\}}dD]}||kr||7}|�|�qdD]}||kr8||7}|�|�q8|d�t|��7}z|�d|�Wn tk
r�|�d|�YnXz|�d|�Wn tk
r�|�d|�YnXdS)r�)r�r�)r�r�)r�r�r�r�r�r�N)rZr+r�r�replace_headerr/Z
add_header)rr�Zstatus_flagsZ
xstatus_flagsr�rrrr�~s&z_mboxMMDFMessage.set_flagscCs$|�d�t|���t|�B��dSr�r�r�rrrr��sz_mboxMMDFMessage.add_flagcCs4d|ksd|kr0|�d�t|���t|���dS)r�r�r�r�Nr�r�rrrr��sz_mboxMMDFMessage.remove_flagc	Cs�t|t�r�t|���}d|kr(|�d�d|kr:|�d�d|krL|�d�d|kr^|�d�d|krp|�d�|d	=|d
=d�|����dd
��}z|�	t
�t�
|d���Wnttfk
r�YnX�n
t|t�r�|�|���|�|���n�t|t��rZt|���}d|k�r$|�d�d|k�r8|�d�d|k�rL|�d�|d	=|d
=n�t|t��r�t|���}d|k�r�|�d�d|k�r�|�d�d|k�r�|�d�|d	=|d
=nt|t��r�ntdt|���d
S)zACopy mbox- or MMDF-specific state to message insofar as possible.r�r�r�r�r�r�r�r�Zstatuszx-statusr����Nz%a %b %d %H:%M:%S %Yrhr�r�rirjr�)rur	rZr�r�r�r�r2r�r��calendarZtimegmr��strptimerf�
OverflowErrorr1r�r(rrIrr�rr�r�)rr&r�Z
maybe_daterrrr��sb





�













�z_mboxMMDFMessage._explain_to)N)N)
r�r�r�r�r�r r2r(r�r�r�r�r�rrrrr1`s
	
r1c@seZdZdZdS)r
z&Message with mbox-specific properties.N�r�r�r�r�rrrrr
�sc@sHeZdZdZdgZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz$Message with MH-specific properties.�
_sequencesNcCsg|_t�||�dS)z!Initialize an MHMessage instance.N)r�rr r%rrrr �szMHMessage.__init__cCs|jdd�S)z4Return a list of sequences that include the message.N)r�rDrrrrH�szMHMessage.get_sequencescCst|�|_dS)z3Set the list of sequences that include the message.N)rFr�)rr`rrrrb�szMHMessage.set_sequencescCs6t|t�r"||jkr2|j�|�ntdt|���dS)z8Add sequence to list of sequences including the message.zsequence type must be str: %sN)rur�r�r�r�r��rrgrrrrI�s

zMHMessage.add_sequencecCs*z|j�|�Wntk
r$YnXdS)zARemove sequence from the list of sequences including the message.N)r�r+rfr�rrr�remove_sequence�szMHMessage.remove_sequencecCsFt|t�rdt|���}d|kr*|�d�n|�d�|�d�d|krP|�d�d|krb|�d�n�t|t�r�t|���}d|kr�|�d�n
|�d	�d|kr�|�d�d|kr�|�d
�n�t|t�r�|��D]}|�|�q�n`t|t	��r$t|���}d|k�r|�
d�d|k�rB|�
d�nt|t��r2ntdt
|���d
S)z6Copy MH-specific state to message insofar as possible.rhr�r�r�r�r�r��ROr�r�rjr�N)rur	rZrHr�r�r1rrIrr�rr�r�)rr&r`rgrrrr��sB










�zMHMessage._explain_to)N)r�r�r�r�r�r rHrbrIr�r�rrrrr�s
c@sbeZdZdZddgZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz'Message with Babyl-specific properties.rm�_visibleNcCsg|_t�|_t�||�dS)z#Initialize a BabylMessage instance.N)rmrr�r r%rrrr "szBabylMessage.__init__cCs|jdd�S)z'Return a list of labels on the message.N)rmrDrrrrn(szBabylMessage.get_labelscCst|�|_dS)z&Set the list of labels on the message.N)rFrm)rrvrrrrq,szBabylMessage.set_labelscCs6t|t�r"||jkr2|j�|�ntdt|���dS)z+Add label to list of labels on the message.zlabel must be a string: %sN)rur�rmr�r�r��rryrrrr�0s

zBabylMessage.add_labelcCs*z|j�|�Wntk
r$YnXdS)z4Remove label from the list of labels on the message.N)rmr+rfr�rrr�remove_label8szBabylMessage.remove_labelcCs
t|j�S)z3Return a Message representation of visible headers.�rr�rDrrrr?szBabylMessage.get_visiblecCst|�|_dS)z2Set the Message representation of visible headers.Nr�)rZvisiblerrrrpCszBabylMessage.set_visiblecCsb|j��D](}||kr*|j�|||�q
|j|=q
dD]$}||kr8||jkr8|||j|<q8dS)z9Update and/or sensibly generate a set of visible headers.)ZDateZFromzReply-ToZToZCCZSubjectN)r�rGr�)r�headerrrr�update_visibleGs
zBabylMessage.update_visiblecCsrt|t�r~t|���}d|kr*|�d�n|�d�|�d�d|ksNd|krX|�d�d|krj|�d�d	|kr||�d
�n�t|t�r�t|���}d|kr�|�d�n
|�d�d	|kr�|�d
�d|kr�|�d�n�t|t��rt|���}d|k�r|�d�d|k�rn|�d�nTt|t	��rP|�
|���|��D]}|�|��q<nt|t
��r^ntdt|���dS)z9Copy Babyl-specific state to message insofar as possible.rhr�r�rkrlr�rjr�rir�r�r�r�r�r�r�N)rur	rZrnr�r�r1rrIrrprr�rr�r�)rr&rvryrrrr�RsH










�zBabylMessage._explain_to)N)r�r�r�r�r�r rnrqr�r�rrpr�r�rrrrrs
c@seZdZdZdS)r
z&Message with MMDF-specific properties.Nr�rrrrr
|sc@s�eZdZdZd&dd�Zd'dd�Zd(dd�Zd)d	d
�Zd*dd�Zd
d�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zed$d%��ZdS),r�zA read-only wrapper of a file.NcCs$||_|dkr|��|_n||_dS)zInitialize a _ProxyFile.N)rr�_pos)rr��posrrrr �sz_ProxyFile.__init__cCs|�||jj�S�zRead bytes.)�_readrrk�r�sizerrrrk�sz_ProxyFile.readcCs|�||jj�Sr�)r�r�read1r�rrrr��sz_ProxyFile.read1cCs|�||jj�S)zRead a line.)r�rr�r�rrrr��sz_ProxyFile.readlinecCs<g}|D].}|�|�|dk	r|t|�8}|dkrq8q|S)zRead multiple lines.Nr)r�r�)r�sizehintrUr�rrr�	readlines�s
z_ProxyFile.readlinesccs|��}|sdS|VqdS)zIterate over lines.N)r�)rr�rrrrL�sz_ProxyFile.__iter__cCs|jS)zReturn the position.)r�rDrrrr�sz_ProxyFile.tellrcCs4|dkr|j�|j�|j�||�|j��|_dS)zChange position.r�N�rr{r�r�r�offset�whencerrrr{�sz_ProxyFile.seekcCs0t|d�r,zt|jd�r"|j��W5|`XdS)zClose the file.rrcN)rXrrcrDrrrrc�s

z_ProxyFile.closecCs2|dkrd}|j�|j�||�}|j��|_|S)z"Read size bytes using read_method.Nrqr�)rr��read_methodrUrrrr��sz_ProxyFile._readcCs|S)z$Context management protocol support.rrDrrr�	__enter__�sz_ProxyFile.__enter__cGs|��dSr,)rc)r�excrrr�__exit__�sz_ProxyFile.__exit__cCs
|j��Sr,)r�readablerDrrrr��sz_ProxyFile.readablecCs
|j��Sr,)r�writablerDrrrr��sz_ProxyFile.writablecCs
|j��Sr,)r�seekablerDrrrr��sz_ProxyFile.seekablecCs
|j��Sr,)rr]rDrrrr]�sz_ProxyFile.flushcCs&t|d�sdSt|jd�sdS|jjS)NrTrFF)rXrrFrDrrrrF�s

z_ProxyFile.closed)N)N)N)N)N)r)r�r�r�r�r rkr�r�r�rLrr{rcr�r�r�r�r�r�r]�propertyrFrrrrr��s&





		r�c@s<eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�ZdS)r/z&A read-only wrapper of part of a file.NcCst�|||�||_||_dS)zInitialize a _PartialFile.N)r�r �_start�_stop)rr�rrrrrr �sz_PartialFile.__init__cCst�|�|jS)z*Return the position with respect to start.)r�rr�rDrrrr�sz_PartialFile.tellrcCs<|dkr|j|_d}n|dkr*|j|_d}t�|||�dS)z8Change position, possibly with respect to start or stop.rr�r�N)r�r�r�r�r{r�rrrr{�sz_PartialFile.seekcCsB|j|j}|dkrdS|dks0|dks0||kr4|}t�|||�S)z;Read size bytes using read_method, honoring start and stop.rr&N)r�r�r�r�)rr�r�Z	remainingrrrr��sz_PartialFile._readcCst|d�r|`dS)Nr)rXrrDrrrrcs
z_PartialFile.close)NN)r)	r�r�r�r�r rr{r�rcrrrrr/�s


	r/Tc
Cs�d}�zbtrpzt�|tjtjB�WnJtk
rn}z,|jtjtjtjfkr\t	d|j
��n�W5d}~XYnX|�rfzt|j
d�}|��WnBtk
r�}z$|jtjtjfkr�WY�WdS�W5d}~XYnXz`zt
�|j
|j
d�d}Wn2ttfk
�r$t
�|j
|j
d�d}YnXt
�|j
�Wn0tk
�rdt
�|j
�t	d|j
��YnXWn8t�r�t�|tj�|�r�t
�|j
d��YnXdS)z(Lock file f using lockf and dot locking.Fzlockf: lock unavailable: %sN�.lockTzdot lock unavailable: %s)�fcntl�lockfZLOCK_EXZLOCK_NBr�r�ZEAGAINrrrr�rrcrr�r�r�r�rcr�r+�LOCK_UN)r�rZdotlock_doner�Zpre_lockrrrr

sL�
�r
cCs8trt�|tj�tj�|jd�r4t�|jd�dS)z*Unlock file f using lockf and dot locking.r�N)r�r�r�rrr�r�r+�r�rrrr4src	Cs<t�|tjtjBtjBd�}zt|d�W�St�|�XdS)zCCreate a file if it doesn't exist and open for reading and writing.r�r�N)rr�r�rC�O_RDWRrc)r�fdrrrr�;sr�cCs$td|tt���t��t��f�S)zBCreate a temp file based on path and open for reading and writing.z%s.%s.%s.%s)r�r�r�r�r�rr�)rrrrrCs�rcCs$|��ttd�r t�|���dS)z0Ensure changes to file f are physically on disk.�fsyncN)r]rXrr��filenor�rrrrIs
rcCst|�|��dS)z:Close file f, ensuring all changes are physically on disk.N)rrcr�rrrr�Osr�c@seZdZdZdS)rz"Raised for module-specific errors.Nr�rrrrrUsc@seZdZdZdS)rz:The specified mailbox does not exist and won't be created.Nr�rrrrrXsc@seZdZdZdS)rz>The specified mailbox is not empty and deletion was requested.Nr�rrrrr[sc@seZdZdZdS)rz)Another process caused an action to fail.Nr�rrrrr^sc@seZdZdZdS)rz)A file appears to have an invalid format.Nr�rrrrras)T)0r�rr�r�r�r�r�r�r>Z
email.messageZemail.generatorrvr8r��ImportError�__all__r}rdrrr�r%rrrrr&rr	r1r
rrr
r�r/r
rr�rrr��	Exceptionrrrrrrrrr�<module>s�
�h8DB4-3z%mqH_c'
*signal.cpython-38.pyc000064400000005435151450073350010463 0ustar00U

e5d��@s&ddlZddlTddlmZddlmZe�Ze�	de
dd��e�	de
d	d��d
ekrle�	de
dd��d
d�Zdd�Zeej
�dd��Z
eej�dd��Zd
ekr�eej�dd
��Zejje_dekr�eej�dd��Zdek�reej�dd��Zeje_dek�reej�dd��Z[[dS)�N)�*)�wraps)�IntEnum�SignalscCs(|��r|�d�r|�d�p&|�d�S)NZSIGZSIG_ZCTRL_)�isupper�
startswith��name�r
�/usr/lib64/python3.8/signal.py�<lambda>
s�r�HandlerscCs|dkS)N)�SIG_DFL�SIG_IGNr
rr
r
rr��pthread_sigmaskZSigmaskscCs|dkS)N)�	SIG_BLOCK�SIG_UNBLOCK�SIG_SETMASKr
rr
r
rrrcCs(z
||�WStk
r"|YSXdS)zsConvert a numeric value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassr
r
r�_int_to_enums
rc	Cs,z
t|�WSttfk
r&|YSXdS)zmConvert an IntEnum member to a numeric value.
    If it's not an IntEnum member return the value itself.
    N)�intr�	TypeError)rr
r
r�_enum_to_int#s
rcCst�t|�t|��}t|t�S�N)�_signal�signalrrr
�Z	signalnumZhandlerr
r
rr-srcCst�|�}t|t�Sr)r�	getsignalrr
rr
r
rr3s
rcCst�||�}tdd�|D��S)Ncss|]}t|t�VqdSr�rr��.0�xr
r
r�	<genexpr>=sz"pthread_sigmask.<locals>.<genexpr>)rr�set)Zhow�maskZsigs_setr
r
rr:s�
sigpendingcCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
r�	<setcomp>Dszsigpending.<locals>.<setcomp>)rr'r
r
r
rr'Bs�sigwaitcCst�|�}t|t�Sr)rr)rr)ZsigsetZretsigr
r
rr)Hs
�
valid_signalscCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
rr(Rsz valid_signals.<locals>.<setcomp>)rr*r
r
r
rr*Ps)r�	functoolsrZ_wraps�enumrZ_IntEnum�globalsZ_globals�	_convert_�__name__rrrrr�__doc__r'r)r*r
r
r
r�<module>sR���










runpy.cpython-38.opt-1.pyc000064400000017767151450073350011335 0ustar00U

e5d/�@sdZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddgZGdd�de�Z
Gdd	�d	e�Zd d
d�Zd!dd
�Zefdd�ZGdd�de�Zd"dd�Zd#dd�Zefdd�Zdd�Zd$dd�Zedk�reej�dk�r�edejd�nejd=eejd�dS)%aZrunpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
�N)�	read_code�get_importer�
run_module�run_pathc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_TempModulezCTemporarily replace a module in sys.modules with an empty namespacecCs||_t�|�|_g|_dS�N)�mod_name�types�
ModuleType�module�
_saved_module��selfr�r�/usr/lib64/python3.8/runpy.py�__init__sz_TempModule.__init__cCsB|j}z|j�tj|�Wntk
r0YnX|jtj|<|Sr)rr�append�sys�modules�KeyErrorrr
rrr�	__enter__ sz_TempModule.__enter__cGs.|jr|jdtj|j<n
tj|j=g|_dS�Nr)rrrr�r�argsrrr�__exit__)s
z_TempModule.__exit__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrrs	rc@s$eZdZdd�Zdd�Zdd�ZdS)�_ModifiedArgv0cCs||_t�|_|_dSr)�value�object�_saved_value�	_sentinel)rr rrrr1sz_ModifiedArgv0.__init__cCs0|j|jk	rtd��tjd|_|jtjd<dS)NzAlready preserving saved valuer)r"r#�RuntimeErrorr�argvr )rrrrr5sz_ModifiedArgv0.__enter__cGs|j|_|jtjd<dSr)r#r r"rr%rrrrr;sz_ModifiedArgv0.__exit__N)rrrrrrrrrrr0src
	Csn|dk	r|�|�|dkr(d}|}d}	n |j}|j}|j}	|dkrH|j}|j|||	d|||d�t||�|S)z)Helper to run code in nominated namespaceN)r�__file__�
__cached__r�
__loader__�__package__�__spec__)�update�loader�origin�cached�parent�exec)
�codeZrun_globals�init_globalsr�mod_spec�pkg_name�script_namer,�fnamer.rrr�	_run_code@s*
�
r7c	
Cs^|dkr|n|j}t|��6}t|��"|jj}t|||||||�W5QRXW5QRX|��S)z5Helper to run code in new namespace with sys modifiedN)r-rrr�__dict__r7�copy)	r1r2rr3r4r5r6�temp_module�mod_globalsrrr�_run_module_codeZs�r<c
Cs2|�d�r|d��|�d�\}}}|r�zt|�WnHtk
rz}z*|jdksh|j|krj|�|jd�sj�W5d}~XYnXtj�|�}|dk	r�t|d�s�ddl	m
}dj||d�}|t|��zt
j�|�}WnJttttfk
�r}	z"d}||�|t|	�j|	��|	�W5d}	~	XYnX|dk�r2|d	|��|jdk	�r�|d
k�sT|�d��r\|d��z|d}
t|
|�WS|k
�r�}z"|tjk�r��|d
||f��W5d}~XYnX|j}|dk�r�|d|��z|�|�}Wn2tk
�r}z|t|��|�W5d}~XYnX|dk�r(|d|��|||fS)N�.z#Relative module names not supported�__path__r)�warnz�{mod_name!r} found in sys.modules after import of package {pkg_name!r}, but prior to execution of {mod_name!r}; this may result in unpredictable behaviour)rr4z:Error while finding module specification for {!r} ({}: {})zNo module named %s�__main__z	.__main__z%Cannot use package as __main__ modulez3%s; %r is a package and cannot be directly executedz0%r is a namespace package and cannot be executedzNo code object available for %s)�
startswith�
rpartition�
__import__�ImportError�namerr�get�hasattr�warningsr?�format�RuntimeWarning�	importlib�util�	find_spec�AttributeError�	TypeError�
ValueError�typer�submodule_search_locations�endswith�_get_module_detailsr,�get_code)
r�errorr4�_�eZexistingr?�msg�specZexZ
pkg_main_namer,r1rrrrThsd
��,
�
� 
rTc@seZdZdZdS)�_ErrorzBError that _run_module_as_main() should report without a tracebackN)rrrrrrrrr[�sr[Tc
Cs�z0|s|dkr t|t�\}}}ntt�\}}}Wn:tk
rj}zdtj|f}t�|�W5d}~XYnXtjdj}|r�|jtj	d<t
||dd|�S)a�Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __cached__
           __loader__
           __package__
    r@z%s: %sNr)rTr[�_get_main_module_detailsr�
executable�exitrr8r-r%r7)rZ
alter_argvr3r1�excrYZmain_globalsrrr�_run_module_as_main�s�r`FcCs@t|�\}}}|dkr|}|r,t||||�St|i|||�SdS)znExecute a module's code without importing it

       Returns the resulting top level namespace dictionary
    N)rTr<r7)rr2�run_nameZ	alter_sysr3r1rrrr�sc
Cs�d}tj|}tj|=z\zt|�WW�NStk
rn}z*|t|�kr\|d|tjdf�|��W5d}~XYnXW5|tj|<XdS)Nr@zcan't find %r module in %rr)rrrTrD�str�path)rVZ	main_nameZ
saved_mainr_rrrr\�s
��r\c	Csftj�t�|��}t�|��}t|�}W5QRX|dkr^t�|��}t|��|d�}W5QRX||fS)Nr0)	�osrc�abspath�fsdecode�io�	open_coder�compile�read)rar6Zdecoded_path�fr1rrr�_get_code_from_file�srlcCs$|dkrd}|�d�d}t|�}d}t|�jdkrFt|�jdkrFd}t|td��sX|rxt||�\}}t|||||d	�Stj	�
d|�znt
�\}}	}t|��P}
t|��<|
jj}t|||||	|���W5QR�W5QR�W�SQRXW5QRXW5ztj	�|�Wntk
�rYnXXdS)
a_Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    Nz
<run_path>r=rFZimpZNullImporterT)r4r5)rBrrQrr�
isinstancerlr<rrc�insert�removerPr\rrrr8r7r9)Z	path_namer2rar4ZimporterZis_NullImporterr1r6rr3r:r;rrrr�s<
�
��8r@�z!No module specified for execution)�file)NNNNN)NNNNN)T)NNF)NN)rr�importlib.machineryrK�importlib.utilrgr	rdZpkgutilrr�__all__r!rrr7r<rDrT�	Exceptionr[r`rr\rlrr�lenr%�print�stderrrrrr�<module>sN��
�
:
�

1