AlkantarClanX12

Your IP : 18.226.93.22


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/pydoc.cpython-37.opt-2.pyc

B

 f���@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*d d!�Z+dyd"d#�Z,d$d%�Z-d&d'�Z.d(d)�Z/d*d+�Z0ifd,d-�Z1Gd.d/�d/e2�Z3d0d1�Z4difd2d3�Z5Gd4d5�d5�Z6Gd6d7�d7e�Z7Gd8d9�d9e6�Z8Gd:d;�d;e�Z9Gd<d=�d=e6�Z:Gd>d?�d?e:�Z;d@dA�a<dBdC�Z=dDdE�Z>dFdG�Z?dHdI�Z@dJdK�ZAdLdM�ZBdNdO�ZCdPdQ�ZDdzdRdS�ZEe:�ZFe;�ZGe8�ZHd{dTdU�ZId|dWdX�ZJd}dYdZ�ZKd~d[d\�ZLdd^d_�ZMGd`da�da�ZNeN�ZOGdbdc�dc�ZPddde�ZQdfdg�ZRd�didj�ZSd�dkdldm�dndo�ZTdpdq�ZUdrds�ZVdtdu�ZWdvdw�ZXeYdxk�r�eX�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}xRtjD]H}tj�|p d�}tj�|�}||krtj�|�r|�|�|�|�qW|S)N�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir�r�*/opt/alt/python37/lib64/python3.7/pydoc.py�pathdirsQs
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�splitdocbsr$cCs"|j}|j|kr|jd|}|S)Nr)�__name__�
__module__)r�modname�namerrr�	classnameks
r)cCs>t�|�p:t�|�p:t�|�p:t�|�p:t�|�p:t�|�S)N)r�ismodule�isclass�	isroutineZisframeZistracebackZiscode)rrrr�isdatarsr-cGs2x,|r,|d�|�|d��}|dd�}qW|S)Nrrr)r!r)�textZpairsrrr�replacexsr/cCsXt|�|krTtd|dd�}td|d|�}|d|�d|t|�|d�S|S)Nr�rz...)r �max)r.�maxlenZpreZpostrrr�crams
$r3z at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)Nz\1)�_re_stripidr)r.rrr�stripid�sr5cCs(t�|�p&t�|�p&t�|�p&t�|�S)N)r�
isfunction�ismethod�	isbuiltinZismethoddescriptor)�objrrr�_is_some_method�s


r:cCs<t�|�rdSt�|�r8t|dd�}t�|�p4|dkSdS)NT�__self__F)rr7r8�getattrr*)�fn�selfrrr�_is_bound_method�s

r?cCshi}x t�|t�D]\}}d||<qWx|jD]}|�t|��q.Wx|��D]}t||�||<qNW|S)Nr)r�
getmembersr:�	__bases__�update�
allmethods�keysr<)�cl�methods�key�value�baserrrrC�srCcCs<g}g}x*|D]"}||�r&|�|�q|�|�qW||fS)N)r
)�s�	predicateZyes�no�xrrr�_split_list�s
rNcCs\|dkrdS|�d�r$|�d�r$dS|�d�r<t|d�r<dS|dk	rL||kS|�d�SdS)N>�__file__�	__slots__r&�
__loader__�__package__�__path__�
__author__�__doc__�
__cached__�__spec__�__date__�__builtins__�__qualname__�__credits__r%�__version__r�__r�_�_fieldsT)�
startswith�endswith�hasattr)r(�allr9rrr�visiblename�srdcCsDg}x:t�|�D],\}}}}t�|�r*d}|�||||f�qW|S)Nzdata descriptor)r�classify_class_attrs�isdatadescriptorr
)r�resultsr(�kind�clsrHrrrre�s
recs\t|dg��y�fdd�t��D��Wntk
r>i�YnX�fdd�}|j|d�dS)Nr_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>)rG)r<�	enumerate�	TypeError�sort)�attrsrZkeyfuncr)rprlr�sort_attributes�s
rwcCs<tj�|�r8x*dD]"}tj�tj�|d|��rdSqWdS)N)z.pyz.pyc�__init__TF)r	rr�isfiler!)r�extrrr�	ispackage�s

r{cCs�|��}x*|dd�dks"|��s2|��}|s
Pq
W|��}|dd�dkrX|dd�}|dd�dkr�|dd�}|dd�dkr�|dd�}x|��s�|��}|s�Pq�W|�d�d	��}nd}|S)
Nr�#�zr"""r0z"""����\r)�readlinerr)�file�linerrrr�source_synopsis�s&
r�c
	Cst�|�j}|�|d�\}}|dks.||k�r|�ttjj��rJtjj	}n |�ttjj
��rftjj}nd}|dkr�yt�
|�}Wntk
r�dSX|�t|�}WdQRXnZ|d|�}tjjd||d�}ytj�|�}	Wn
dStjd=|	j�r|	j��dnd}||f||<|S)N)NNZ__temp__)�loaderr)r	�stat�st_mtimernra�tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr�modulesrU�
splitlines)
�filename�cache�mtimeZ
lastupdaterZ
loader_clsr�r��spec�modulerrr�synopsis�s4



r�c@seZdZdd�Zdd�ZdS)�ErrorDuringImportcCs||_|\|_|_|_dS)N)r��excrH�tb)r>r��exc_inforrrrx(szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r%r�rH)r>r�rrr�__str__,szErrorDuringImport.__str__N)r%r&rZrxr�rrrrr�&sr�c		Cs�tjj}t|d��}||�t|��k}WdQRXtj�|�}tj�	|�\}}|r`tj
�||�}ntj
�||�}tjj
|||d�}ytj�|�St|t����YnXdS)N�rb)r�)r�r��MAGIC_NUMBERr��readr r	r�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r�magicr�Zis_bytecoder�r(rzr�r�rrr�
importfile0sr�c	s"yb|rX�tjkrX�tjkrX�fdd�tjD�}x(�g|D]}tj|||<tj|=q:Wt��}Wnxt��\}}}}	�tjkr�ttj�j|	��n<|tkr�t|j|	��n&t	|t
�r�|j�kr�dSt�t����YnXx@��d�dd�D]*}
yt
||
�}Wq�tk
�rdSXq�W|S)Ncsg|]}|��d�r|�qS)r)r`)rj�m)rrr�
<listcomp>Vszsafeimport.<locals>.<listcomp>rr)rr��builtin_module_names�
__import__r�r�rO�SyntaxErrorr��
issubclass�ImportErrorr(rr<�AttributeError)r�	forceloadr�ZsubsrGr�r�rHr��info�partr)rr�
safeimportBs.


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|}t�|�r |j|�St�|�r4|j|�Sy@t�|�rJ|j|�St�|�r^|j|�St�|�rr|j	|�SWnt
k
r�YnXt|t�r�|j
|�S|j|�S)N)r�isgetsetdescriptor�docdata�ismemberdescriptorr*�	docmoduler+�docclassr,�
docroutiner��
isinstance�property�docproperty�docother)r>rr(�argsrrr�documentxs"










zDoc.documentcGs*d|odt|�t|�jf}t|��dS)Nz.don't know how to document object%s of type %s� )�repr�typer%rt)r>rr(r��messagerrr�fail�szDoc.failZstdlibcCs�yt�|�}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)
Nz
(built-in)r�)
�errno�
exceptionsZgcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z%s/%s�/z.html)r�
getabsfilertr	�environrnr�rrr�r�r%r`r!r�lower)r>rZbasedirr��doclocrrr�	getdocloc�s 




z
Doc.getdocloc)N)N)r%r&rZr	r�rnr�version_infor�r�r�r�r�r�r�r�r��	sysconfigZget_pathr�rrrrr�rs

r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZeZdd�Z	eZ
d
S)�HTMLReprcCs,t�|�d|_|_d|_d|_|_dS)N��
�d)rrx�maxlist�maxtuple�maxdict�	maxstring�maxother)r>rrrrx�s
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)r/)r>r.rrr�escape�szHTMLRepr.escapecCst�||�S)N)rr�)r>rrrrr��sz
HTMLRepr.reprcCsZtt|�d�r@dd�t|�j���}t||�r@t||�||�S|�ttt	|��|j
��S)Nr%�repr_r^)rbr�r!r%rr<r�r3r5r�r�)r>rM�level�
methodnamerrr�repr1�s

zHTMLRepr.repr1cCs^t||j�}t|�}d|krJdt|dd�krJd|d|�|�|dSt�dd|�|��S)Nrz\\r�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r3r�r�r/r�rr)r>rMr��test�testreprrrr�repr_string�szHTMLRepr.repr_stringcCs8y|�ttt|��|j��S|�d|jj�SdS)Nz
<%s instance>)r�r3r5r�r��	__class__r%)r>rMr�rrr�
repr_instance�szHTMLRepr.repr_instanceN)r%r&rZrxr�r�r�r��repr_strr�Zrepr_unicoderrrrr��sr�c@s
eZdZe�ZejZejZdd�Zd4dd�Zd5d	d
�Z	dd�Z
d
d�Zd6dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd�Zd7d d!�Zd8d"d#�Zddiifd$d%�Zd&d'�Zddiiidfd(d)�Zd*d+�Zd9d,d-�Zd:d.d/�Zd;d0d1�Zd<d2d3�ZdS)=�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�sz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>
    z&nbsp;r)r>r��fgcol�bgcol�extrasrrr�heading�s	zHTMLDoc.heading�N�&nbsp;c	
Cs^|dkrdd|d}d|||f}	|r@|	d||||f}	n|	d|||f}	|	d|S)Nz<tt>z&nbsp;z</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>r�r�r�r��widthZpreludeZ
marginaliaZgaprrrr�section�szHTMLDoc.sectioncGsd|}|j|f|��S)Nz<big><strong>%s</strong></big>)r�)r>r�r�rrr�
bigsectionszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)Nz

z
 
r�z&nbsp;rz<br>
)r��
expandtabsr/)r>r.rrr�	preformatszHTMLDoc.preformatr}cCs�d}t|�|d|}xht|�D]\}|dd|}x>t|||||�D]$}|t|�krN||||�d}qNW|d}q"Wd|S)Nrrz<td width="%d%%" valign=top>r�z<br>
z</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r �range)r>�list�formatZcolsr�rows�colrkrrr�multicolumnszHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>r)r>r.rrr�grey#rrzHTMLDoc.greycGs*x$|D]}||krd|||fSqW|S)Nz<a href="%s">%s</a>r)r>r(Zdicts�dictrrr�namelink%s
zHTMLDoc.namelinkcCsN|jtj�|j�}}t||�rDt||�|krDd|j|t||�fSt||�S)Nz<a href="%s.html#%s">%s</a>)r%rr�rnr&rbr<r))r>rr'r(r�rrr�	classlink,s
zHTMLDoc.classlinkcCsd|j|jfS)Nz<a href="%s.html">%s</a>)r%)r>rrrr�
modulelink4szHTMLDoc.modulelinkcCsR|\}}}}|r|�|�S|r,d||f}nd|}|rBd|}n|}d||fS)Nz
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)z<a href="%s">%s</a>)r)r>Z
modpkginfor(rr{�shadowed�urlr.rrr�
modpkglink8s

zHTMLDoc.modpkglinkcCsd||fS)Nz<a href="file:%s">%s</a>r)r>rrrrr�filelinkGszHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}�xL|�||�}	|	s2P|	��\}
}|�||||
���|	��\}}
}}}}|
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�rR|�|�	||||��n|�|�	||��|}q W|�|||d���d�
|�S)
NrzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;z<a href="%s">%s</a>z'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
�groupsr/�intrr!)r>r.r��funcs�classesrFrg�here�pattern�match�start�endrcZschemeZrfcZpepZselfdotr(rrrr�markupKs<

zHTMLDoc.markupc
Cs�d}x�|D]�}t|�td�kr�|\}}|d}||�||�}|r�||fkr�g}x|D]}	|�|�|	|��qVW|dd�|�d}|d}q
t|�tg�kr
|d|�|||�}q
Wd	|S)
Nrrz"<dt><font face="helvetica, arial">rz, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r�rr
r!�
formattree)
r>�treer'�parentr�entry�c�bases�parentsrIrrrrvs 


zHTMLDoc.formattreec#
s�|j}y
|j}Wntk
r(d}YnX|�d�}g}x@tt|�d�D],}|�dd�|d|d��||f�qJWd�||dd��}	d|	}
y&t�	|�}t
j�|�}��
||�}
Wntk
r�d}
YnXg}t|d��r:t|j�}|dd�d	k�r&|dd�d
k�r&|dd���}|�d��|��t|d��r\|���t|j���|�rt|
d
d�|�}
��|�}|dk	�r�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}xlt�|tj�D]Z\}}|dk	�st�|��p�||k�r�t|||��r�|�||f�d|||<||<�q�Wx�|D]�\}}xx|jD]n}|j|j}}tj �!|�}||k�rL|�rLt||��rLt"||�|k�rL||k�rL|d|||<||<�qLW�q<Wgi}}x�t�|tj#�D]p\}}|dk	�st�$|��st�|�|k�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q�Wg}x6t�|t&�D]&\}}t|||��rd|�||f��qdW��'t(|��j)||�}|�o�d|}|d|}t|d��r*g}x.t*�+|j,�D]\}}} |�||| df��q�W|�-���.|�j/�}!|��0ddd|!�}n.|�rX��.|�fdd��}!|��0ddd|!�}|�r�d d!�|D�}"��1t�2|"d�|�g}!x*|D]"\}}|!���3|||||���q�W|��0d"dd#d$�|!��}|�rg}!x*|D]"\}}|!���3|||||���q�W|��0d%dd&d$�|!��}|�rbg}!x$|D]\}}|!���3||���q(W|��0d'dd(d)�|!��}t|d*��r���'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~z)<big><big><strong>%s</strong></big></big>z
(built-in)r\�z$Revision: �$z
version %srXz (%s)z, z-<br><a href="%(docloc)s">Module Reference</a>rz#ffffffz#7799eez<a href=".">index</a><br>r|z.html#z#-z<tt>%s</tt>z
<p>%s</p>
rSrzPackage Contentsz#aa55cccs��|d�S)Nr)r	)�t)r>rrrq�rrz#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|�qSrr)rjrGrHrrrr��sz%HTMLDoc.docmodule.<locals>.<listcomp>ZClassesz#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55z<br>
rTZAuthorr[ZCredits)6r%�__all__r�rr�r r
r!rr��urllib�parseZquoter
rtrb�strr\rr�rXr��localsr�r@r*r+�	getmodulerdrAr&rr�rnr<r,r8r6r-rrr��pkgutil�iter_modulesrSrurrr�r�getclasstreer�rTr[)#r>rr(�mod�ignoredrc�partsZlinksrkZ
linkedname�headrrr
r��versionr�rr�rZcdictrGrHrIr'r�rZfdict�datar"�modpkgs�importer�ispkgr��	classlistr)r>rr��s�


&


$




$

zHTMLDoc.docmodulec	sz�j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkr�����d�x"|D]}�d��|�j	��qfW�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�xv|D]n\}}}}d|d|�|<}yt�|�}Wntk
�r:YnXy|�|<Wq�t
k
�r^Yq�Xq�Wx�|�rT|�r||���n|dd�t|�fdd��\}}�tjk�r�|}�qfn"��k�r�d}nd����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|}�qfWd!�|	�}	||k�rxd"||f}nd#|||f}|�r�g}x"|D]}|���|�j	���q�W|d$d%�|�}d!}yt���}Wntt
fk
�r�d}YnX|�r(t|�}|�r(|d&k�r(|��|�d'}t��}|�rD||�p@d!}��|�j����}|�odd(|}��|d)d*|	d+|�S),Ncs eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dS)Nr)�needone)r>rrrrxsz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)Nz<hr>
r)r;)r>)�pushrr�maybesz.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN)r%r&rZrxr=r)r<rr�HorizontalRule
sr>rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
z</dl>
cs�t||�\}}|r�����|�xl|D]d\}}}}yt�|�}Wn&tk
rh���||���YnX���||��������d�q(W|S)Nr)rNr=r<�	Exception�_docdescriptorr�)�msgrvrK�okr(rh�homeclsrH)rr�hr�mdictr1rr<r>rr�spill szHTMLDoc.docclass.<locals>.spillcsNt||�\}}|rJ����|�x&|D]\}}}}���||���q(W|S)N)rNr=r@)rArvrKrBr(rhrCrH)rDr1r<r>rr�spilldescriptors2sz*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|r�����|�x�|D]�\}}}}��t�|�|��}t|�sZt�|�rht|dd�}	nd}	|	dkr��d|�n0��t|��j	����}	d|	}	�d||	f��d�q(W|S)NrUz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rNr=r�r<�callablerrfrrr�)
rArvrKrBr(rhrCrHrIr")rrrDrEr1rr<r>rr�	spilldata;s"
z#HTMLDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS))r9)rd)rjr(rhrirH)rrrr�Ps
z$HTMLDoc.docclass.<locals>.<listcomp>r|�-rcs|d�kS)Nrr)r')�	thisclassrrrqirrz"HTMLDoc.docclass.<locals>.<lambda>zdefined herezinherited from %sz:<br>
z
Methods %scSs|ddkS)Nr�methodr)r'rrrrqyrrzClass methods %scSs|ddkS)Nrzclass methodr)r'rrrrq{rrzStatic methods %scSs|ddkS)Nrz
static methodr)r'rrrrq}rrzData descriptors %scSs|ddkS)Nrzdata descriptorr)r'rrrrqrrzData and other attributes %scSs|ddkS)Nrr6r)r'rrrrq�rrrz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>z(%s)z, z()z

z<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r0)r%rAr
rr�getmror r=rr&rer<r?rt�popleftrN�builtinsrrwr!�	signature�
ValueErrorr+r�rrr�r�)r>rr(r1rrr2�realnamer#r�r>�mrorIrFrGrIrvrGrhrCrH�anchor�	inherited�tagr�r$�declrP�argspecr"r)	rrrDrEr1rr<r>rKrr�s�

	




















zHTMLDoc.docclasscCs|�d|�|��S)N�=)rr�)r>rrrr�formatvalue�szHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jpdd|}	d}
d}t|�r�|jj}|rZ||k	r�d|�||�}
n0|jdk	rzd|�|jj|�}
nd|�||�}
||kr�d|	|f}
nD|r�t�||g�|kr�d|jd||f}d	}n|}d
|	||f}
d}t�|��rNyt�|�}Wnt	t
fk
�r d}YnX|�rNt|�}|dk�rNd|}
|d	d
�}|�sXd}|
|�|�|
�ov|�
d|
�}|�r�d|S|�t|�|j|||�}|�o�d|}d||fSdS)NrrJrz from z method of %s instancez unbound %s methodz$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %sz<lambda>z$<strong>%s</strong> <em>lambda</em> r~z(...)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?r;r�rr�getattr_staticr,rPrQrtr+r�rrrr�)r>rr(r1rrrFrErRrT�note�skipdocs�imclassr�ZreallinkrXrPrWr"rrrr��sX


zHTMLDoc.docroutinecCsTg}|j}|r|d|�|jdk	rB|�t|�|j�}|d|�|d�d�|�S)Nz!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
z</dl>
r)r
rUrrr�r!)r>r(rHr1rgr<r"rrrr@�s
zHTMLDoc._docdescriptorcCs|�|||�S)N)r@)r>rr(r1rErrrr��szHTMLDoc.docpropertycGs|rd|pd}||�|�S)Nz<strong>%s</strong> = r)r�)r>rr(r1r2Zlhsrrrr��szHTMLDoc.docothercCs|�|||�S)N)r@)r>rr(r1rErrrr��szHTMLDoc.docdatacCs�g}|dkri}xLt�|g�D]<\}}}tdd�|D��r<q|�|d|||kf�d||<qW|��|�||j�}|�|dd|�S)Ncss*|]"}dt|�kodknVqdS)i�i��N)�ord)rj�chrrr�	<genexpr>sz HTMLDoc.index.<locals>.<genexpr>rrz#ffffffz#ee77aa)r.r/�anyr
rurrr�)r>rr
r7r8r(r9r�rrr�index�sz
HTMLDoc.index)r)r�rNr�)r})N)NN)NNN)NN)NNN)N)r%r&rZr��_repr_instancer�r�r�r�r�r�r�rrrrr	rr
rrr�r�rZr�r@r�r�r�rcrrrrr��s:



+

y$:


r�c@s0eZdZdd�Zdd�Zdd�ZeZdd�Zd	S)
�TextReprcCs,t�|�d|_|_d|_d|_|_dS)Nr�r�r�)rrxr�r�r�r�r�)r>rrrrxs
zTextRepr.__init__cCsTtt|�d�r@dd�t|�j���}t||�r@t||�||�Sttt|��|j	�S)Nr%r�r^)
rbr�r!r%rr<r3r5r�r�)r>rMr�r�rrrr�s

zTextRepr.repr1cCsHt||j�}t|�}d|krDdt|dd�krDd|d||dS|S)Nrz\\rr�r)r3r�r�r/)r>rMr�r�r�rrrr�s
zTextRepr.repr_stringcCs,yttt|��|j�Sd|jjSdS)Nz
<%s instance>)r3r5r�r�r�r%)r>rMr�rrrr�)szTextRepr.repr_instanceN)r%r&rZrxr�r�r�r�rrrrres
	rec@s�eZdZe�ZejZdd�Zddd�Zdd�Zdd
d�Z	ddd
�Z
ddd�Zdd�Zd dd�Z
dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$�TextDoccCsd�dd�|D��S)Nrcss|]}|d|VqdS)�Nr)rjr`rrrra9szTextDoc.bold.<locals>.<genexpr>)r!)r>r.rrr�bold7szTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r4|d��|d<d�|�S)Nrcsg|]}�|�qSrr)rjr�)�prefixrrr�>sz"TextDoc.indent.<locals>.<listcomp>rr~)rrr!)r>r.rjr#r)rjr�indent;szTextDoc.indentcCs$|�|���}|�|�d|dS)Nrz

)rkrrh)r>r�r�Zclean_contentsrrrr�BszTextDoc.sectionNrc
	s�d}x�|D]�}t|�td�krt|\}}||t|��}|rj||fkrj�fdd�|D�}	|dd�|	�}|d}q
t|�tg�kr
||�|�||d�}q
W|S)	Nrrc3s|]}t|��VqdS)N)r))rjr")r'rrraQsz%TextDoc.formattree.<locals>.<genexpr>z(%s)z, rz    )r�r)r!r)
r>rr'r rjrr!r"r#r$r)r'rrIs

zTextDoc.formattreec	CsD|j}tt|��\}}|�d||o(d|�}t|dd�}|�|�}|dk	r`||�d|d�}|rt||�d|�}g}	xNt�|tj�D]<\}
}|dk	s�t�	|�p�||kr�t
|
||�r�|	�|
|f�q�Wg}xXt�|tj�D]F\}
}|dk	�st�
|��st�	|�|kr�t
|
||�r�|�|
|f�q�Wg}
x6t�|t�D]&\}
}t
|
||��r8|
�|
|f��q8Wg}t�}t|d��r�xFt�|j�D]6\}}}|�|�|�r�|�|d�n
|�|��q�W|��||�d	d
�|��}g}xBt�|tj�D]0\}
}|j�|d��r�|
|k�r�|�|
��q�W|�rJ|��||�dd
�|��}|	�r�d
d�|	D�}|�t�|d�|�g}x&|	D]\}
}|�|�||
|���qzW||�dd
�|��}|�r�g}x&|D]\}
}|�|�||
|���q�W||�dd
�|��}|
�rFg}x*|
D]"\}
}|�|j||
|dd���q
W||�dd
�|��}t|d��r�t|j�}|dd�dk�r�|dd�dk�r�|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d��r||�d t|j"��}yt�#|�}Wnt$k
�r.d!}YnX||�d"|�}|S)#N�NAMEz - r(zMODULE 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.
ZDESCRIPTIONrSz
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|�qSrr)rjrGrHrrrr��sz%TextDoc.docmodule.<locals>.<listcomp>r�CLASSES�	FUNCTIONS�F)r2ZDATAr\r%z$Revision: r~r&ZVERSIONrXZDATErTZAUTHORr[ZCREDITSz
(built-in)�FILE)%r%r$rr�r<r�rr@r+r-rdr
r,r8r-�setrbr.r/rS�addrur!r*r`rr0r�r�r+r\rrXrTr[r�rt)r>rr(r1Zsynop�descrrcr�rrGrHrr6r7Z
modpkgs_namesr8r'r9Z
submodulesr:r�r5r�rrrr�Ys�





$
zTextDoc.docmodulec	s��j}|p|}�j}�jfdd�}||kr:d��|�}n��|�d|}|rlt||�}	|dd�|	�}g}
|
j�yt���}Wnt	t
fk
r�d}YnX|r�t|�}|r�|dkrʈ||d�t��}
|
r�|
d�t
t����}t|�d	k�r.�d
�x|D]}�d||���qW�d�G�fd
d�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}x�|�r||�r�|���n|dd	�t|�fdd��\}}�tjk�r�|}�q�n ��k�r�d}ndt��j�}t|��|d||dd��}|d||dd��}|d ||d!d��}|d"||d#d��}|d$||d%d��}|}�q�Wd�|
�}
|
�s�|dS|d��|
��d&�dS)'NcSs
t||�S)N)r))r"r�rrr�makename�sz"TextDoc.docclass.<locals>.makenamezclass z	 = class z(%s)z, z()rrzMethod resolution order:z    rcs eZdZdd�Z�fdd�ZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dS)Nr)r;)r>rrrrx�sz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)NzF----------------------------------------------------------------------r)r;)r>)r<rrr=�sz.TextDoc.docclass.<locals>.HorizontalRule.maybeN)r%r&rZrxr=r)r<rrr>�sr>c
s�t||�\}}|r�����|�x^|D]V\}}}}yt�|�}Wn&tk
rh���||���Yq(X���||����q(W|S)N)rNr=r<r?r@r�)rArvrKrBr(rhrCrH)rDr1rr<r>rrrF�szTextDoc.docclass.<locals>.spillcsNt||�\}}|rJ����|�x&|D]\}}}}���||���q(W|S)N)rNr=r@)rArvrKrBr(rhrCrH)rDr1r<r>rrrGsz*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|r�����|�x~|D]v\}}}}t|�sFt�|�rPt|�}nd}yt�|�}	Wntk
r�|j|}	YnX��j	|	|�d|d�d�q(W|S)Nro)r2r"r)
rNr=rHrrfrr<r��__dict__r�)
rArvrKrBr(rhrCrHr"r9)rDr1rr<r>rrrIs
z#TextDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS))r9)rd)rjr(rhrirH)rrrr�s
z$TextDoc.docclass.<locals>.<listcomp>rcs|d�kS)Nrr)r')rKrrrq&rrz"TextDoc.docclass.<locals>.<lambda>zdefined herezinherited from %szMethods %s:
cSs|ddkS)NrrLr)r'rrrrq5rrzClass methods %s:
cSs|ddkS)Nrzclass methodr)r'rrrrq7rrzStatic methods %s:
cSs|ddkS)Nrz
static methodr)r'rrrrq9rrzData descriptors %s:
cSs|ddkS)Nrzdata descriptorr)r'rrrrq;rrzData and other attributes %s:
cSs|ddkS)Nrr6r)r'rrrrq=rrz |  )r%rAr&rh�mapr!r
rrPrQrtr+rrrMr rerNrNrOrr)rwrkr)r>rr(r1r2rRr#rtr�r$r�rPrXr"rSrIr>rFrGrIrvrUrVr)rDr1rr<r>rKrr��s�


	
















zTextDoc.docclasscCsd|�|�S)NrY)r�)r>rrrrrZGszTextDoc.formatvaluec	Csr|j}|p|}d}d}t|�rn|jj}|rB||k	rndt||�}n,|jdk	r`dt|jj|�}ndt||�}||kr�|�|�}	n,|r�t�||g�|kr�d}|�|�d|}	d}
t�|��ryt�	|�}Wnt
tfk
r�d}YnX|�rt|�}
|dk�r|�|�d	}	|
dd
�}
|
�s&d}
|	|
|}|�r@|dSt
|��pLd}
|d|
�oj|�|
���dSdS)
Nrrz from z method of %s instancez unbound %s methodrz = z<lambda>z lambda r~z(...)r)r%r?r;r�r)rhrr[r,rPrQrtr+rrkr)r>rr(r1rErRr\r]r^r�rXrPrWr"rrrr�KsH


zTextDoc.docroutinecCsTg}|j}|r$||�|��|d�t|�p.d}|rJ||�|��|d�d�|�S)Nrr)r
rhrrkr!)r>r(rHr1rgr<r"rrrr@|szTextDoc._docdescriptorcCs|�|||�S)N)r@)r>rr(r1rErrrr��szTextDoc.docpropertycCs|�|||�S)N)r@)r>rr(r1rErrrr��szTextDoc.docdatac
Cs�|�|�}|rF|r|dpd|}|t|�}	|	dkrF|d|	�d}|rX|�|�dpZd|}|dk	r~|d|�t|��7}|S)Nz = rrz...r)r�r rhrkr+)
r>rr(r1r r2r"r�r�Zchoprrrr��s
zTextDoc.docother)ri)Nr)NN)NN)NNN)NNN)NNN)NNNNN)r%r&rZrerdr�rhrkr�rr�r�rZr�r@r�r�r�rrrrrf/s


e


1

rfc@seZdZdd�ZdS)�
_PlainTextDoccCs|S)Nr)r>r.rrrrh�sz_PlainTextDoc.boldN)r%r&rZrhrrrrrw�srwcCst�at|�dS)N)�getpager�pager)r.rrrry�sryc	s8ttjd�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�
|�z0ttd��r t�
d|�dk�r dd�StSWdt�|�XdS)N�isattyZMANPAGERZPAGER�win32cstt|���S)N)�
tempfilepager�plain)r.)�	use_pagerrrrq�rrzgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscstt|���S)N)�	pipepagerr})r.)r~rrrq�rrcs
t|��S)N)r)r.)r~rrrq�rrcSstt|�d�S)Nzmore <)r|r})r.rrrrq�rr�systemz(less) 2>/dev/nullrcSs
t|d�S)NZless)r)r.rrrrq�rrz	more "%s"cSs
t|d�S)NZmore)r)r.rrrrq�rr)rbr�stdin�
plainpager�stdoutrzr	r�rn�platformr��tempfileZmkstemp�close�ttypager�unlink)r��fdr�r)r~rrx�s6


 rxcCst�dd|�S)Nz.r)rr)r.rrrr}�sr}c	Cs�ddl}|j|d|jd�}yDtj|jdd��*}y|�|�Wntk
rPYnXWdQRXWntk
rrYnXx(y|�	�PWqvtk
r�YqvXqvWdS)NrT)�shellr��backslashreplace)�errors)
�
subprocess�Popen�PIPE�io�
TextIOWrapperr��write�KeyboardInterruptr��wait)r.�cmdr��proc�piperrrr�s rc	Cs`ddl}|��}t|ddd��}|�|�WdQRXzt�|d|d�Wdt�|�XdS)Nr�wr�)r�z "r)r�Zmktempr�r�r	r�r�)r.r�r�r�r�rrrr|�sr|cCs$ttjdd�pd}|�|d��|�S)N�encodingzutf-8r�)r<rr��encode�decode)r.r�rrr�_escape_stdout�sr�c
Cs�tt|���d�}y2ddl}tj��}|�|�}|�|�dd�}Wn(t	t
tjfk
rld}dd�}YnX�z2yt
tj�dd��}Wntk
r�d}YnX|dkr�d}|d}}tj�d�|d|��d�x�||d��r�tj�d	�tj��|�}	|	d
k�rtj�d�Pn,|	dk�rJtj�d||d�|d}q�|	d
k�rn|||}|dk�rnd}tj�dd�||||��d�||}q�WWd|�r�|�||j|�XdS)NrrcSstj�d�S)Nr)rr�r�rrrrrq�rrzttypager.<locals>.<lambda>cSstj��dd�dd�S)Nr~r)rr�r�rrrrrqrrZLINESr�z
-- more --)�q�Qz
          
)�
r)�b�B�)r}r�r�ttyrr��filenoZ	tcgetattrZ	setcbreakr�r�r��UnsupportedOperationrr	r�rnrQr�r�r!�flushZ	tcsetattrZ	TCSAFLUSH)
r.r#r�r��oldZgetchar�hr�Zincr"rrrr��sL








&r�cCstj�tt|���dS)N)rr�r�r}r�)r.rrrr�#sr�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 rSzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%szclass z	function zmethod )rr*r%rr�rbr8r��__objclass__r&r�r+r6r7r�)�thingrrr�describe's.
















r�c	Cs�dd�|�d�D�}d\}}xB|t|�kr^td�|d|d��|�}|rZ||d}}qPqW|rj|}nt}x8||d�D](}yt||�}Wq|tk
r�dSXq|W|S)NcSsg|]}|r|�qSrr)rjr�rrrr�Dszlocate.<locals>.<listcomp>r)Nrr)rr r�r!rOr<r�)rr�r3r��nZ
nextmodulerr�rrr�locateBs 
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%)r�r+r�r�r<)r�r�rr(rrr�resolve[s


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�|�s�t|t
�s�t|�}|d7}||d|�||�S)Nrz in z in module z objectz

)r.r�r�rr-�rfindr%r*r+r,r�r�r�r�r�r�)r�r�r�Zrendererrr(rsr�rrr�
render_docis$






r�c
Csfy2|dkrtt|||��n|�t|||t��Wn.ttfk
r`}zt|�Wdd}~XYnXdS)N)ryr�r��	plaintextr�r��print)r�r�r��outputrHrrrr"�sr"c
Cs�y`t||�\}}t�t|�t�||��}t|dddd��}|�|�WdQRXtd|d�Wn.tt	fk
r�}zt|�Wdd}~XYnXdS)Nz.htmlr�zutf-8)r�Zwrote)
r��htmlr�r�r�r�r�r�r�r�)r�r�rr(r�r�rHrrr�writedoc�sr�rcCs6|dkri}x$t�|g|�D]\}}}t|�qWdS)N)r.�
walk_packagesr�)r�pkgpathZdoner8r'r9rrr�	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;�ZxJe��D]>\ZZ	x4e	D],Z
e�e
e�Zeekr�ed<eZeee
<q�Wq�Wd=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)�breakz	while for)�classzCLASSES SPECIALMETHODS)�continuez	while for)Zfunctionr)�del�BASICMETHODS�if)�elsez	while for�try)�forzbreak continue while�import)�globalznonlocal NAMESPACES)r��
TRUTHVALUE)r��MODULES)�in�SEQUENCEMETHODS�
COMPARISON)�lambdarn)�nonlocalzglobal NAMESPACES)�passr)�raise�
EXCEPTIONS)�returnrn)r�r�)�whilezbreak continue if TRUTHVALUE)r�z CONTEXTMANAGERS EXCEPTIONS yield)�yieldr)#�False�None�True�and�asr�r�r�r�r�r��defr��elifr��except�finallyr��fromr�r�r�r��isr�r��not�orr�r�r�r�r�r�r�cCsg|]}dD]}||�qqS))�'rr)rj�pr�rrrr��szHelper.<listcomp>)r��fr��ur��'''r�""")�+rJ�*z**r�z//�%z<<z>>r��|�^�~r�r�z<=z>=z==z!=z<>)r�r�z<=z>=z==z!=z<>)rJr�)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)z<<z>>r�r�r�r�)�j�J)�STRINGS�	OPERATORSr��UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classr��PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)r�z**�,rz...�:�@rr^r]�`rr�[�]r�)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES)zstring-methodszSTRINGS FORMATTING)Z
formatstringsr�)rz: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)rz!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)zsequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS)zsequence-typeszMAPPINGS 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�)Zcallsr)Zpowerr)Zunaryr)Zbinaryr)Zshiftingr)Zbitwiser)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEr�)Z
assignmentr�)Z	augassign�
NUMBERMETHODSr�r�)Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersr�)Irr�Z
STRINGMETHODSZ
FORMATTING�UNICODEZNUMBERSZINTEGERZFLOATr�r
ZMAPPINGSrnZMETHODSZCODEOBJECTSZTYPEOBJECTSZFRAMEOBJECTSZ
TRACEBACKSZNONEr�ZSPECIALATTRIBUTESrmr�ZPACKAGESrr�Z
PRECEDENCEZOBJECTSZSPECIALMETHODSr�ZATTRIBUTEMETHODSZCALLABLEMETHODSr�ZMAPPINGMETHODSr
Z	EXECUTIONr	ZDYNAMICFEATURESZSCOPINGZFRAMESr�ZCONVERSIONSZIDENTIFIERSZSPECIALIDENTIFIERSr�ZLITERALSZTUPLESZ
TUPLELITERALSZLISTSrrrZ
ATTRIBUTESZ
SUBSCRIPTSrZCALLSr�r�ZBINARYZSHIFTINGr�r�r�Z	ASSERTIONZ
ASSIGNMENTr�ZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGr�Z	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dS)N)�_input�_output)r>�inputr�rrrrxNszHelper.__init__cCs|jp
tjS)N)rrr�)r>rrrrRszHelper.inputcCs|jp
tjS)N)rrr�)r>rrrr�Vsz
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)Nrr0�?rz<%s.%s instance>)r�stackr�r&rZ)r>rrr�__repr__Zs
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�interactr�r�)r>�requestrrr�__call__bs
zHelper.__call__c	Cs�|j�d�x�y|�d�}|s PWnttfk
r<PYnX|��}t|�dkr�|d|dkrndkr�nn |d|dd�kr�|dd�}|��dkr�P|d	kr�|��q|�	|�qWdS)
Nrzhelp> rrr~)r�rr)r��quitr)
r�r��getliner��EOFErrorrr r�rr)r>rrrrros"
,
zHelper.interactcCs8|jtjkrt|�S|j�|�|j��|j��SdS)N)rrr�r�r�r�r�)r>�promptrrrr�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:)r�r)r�r�listkeywords�listsymbols�
listtopics�listmodulesrr �
showsymbolr"�evalr�	showtopicr!rr+r�r�r�r�)r>rrrrr�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)r�r�rrr�)r>rrrr�szHelper.intror}�Pc	
Cs�tt|��}||}t|�|d|}x�t|�D]z}xht|�D]\}|||}|t|�kr@|j�||�||dkr@|j�dd|dt||��q@W|j�d�q2WdS)Nrr�r)r�sortedr r�r�r�)	r>�items�columnsr�Zcolwr�rowrrkrrrr�s(zHelper.listcCs |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)r�r�rrrD)r>rrrr#�szHelper.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.

)r�r�rr rD)r>rrrr$�szHelper.listsymbolscCs |j�d�|�|j���dS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)r�r�rr!rD)r>rrrr%�szHelper.listtopicscCs,yddl}Wn tk
r,|j�d�dSX|j�||j�|��}|s`|j�dt|��dSt|�td�kr||�	||�S|\}}y|jj|}Wn(t
k
r�|j�dt|��dSX|��d}|r�|p�dd|}|�r ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nrzt
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrr�zRelated help topics: z, �Hz
%s
)�pydoc_data.topicsr�r�r�r!rnrr�r�r)�KeyErrorr�textwrapr!r�wrapry)r>�topic�
more_xrefs�
pydoc_data�target�label�xrefsr"r2r.Zwrapped_textrrrr)�s6zHelper.showtopiccCs�yddl}Wntk
r dSX|j�||j�|��}|sDtd��t|t�rZ|�||�S|\}}|jj|}|r�|pxdd|}||fS)Nr)zt
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
rzcould not find topicrr�)	r0r�r!rnrrQr�r+�	_gettopic)r>r4r5r6r7r8r9r"rrrr:�s	
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)r �	partitionr))r>�symbolr7r4r^r9rrrr'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)Ni����z	.__init__z
 (package)rrr)�find)rr'rsr�rrr�callback$sz$Helper.listmodules.<locals>.callbackcs�d|d�dS)Nr)r')r>rr�onerror)sz#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".
)r�r�r�apropos�
ModuleScanner�runrrD)r>rGr�r?r)r>rr&s
zHelper.listmodules)r�r�rr�)NN)r}r*)r)r)r)!r%r&rZrZ_strprefixesZ_symbols_inverser r,r4Zsymbols_r<rnr!rxr�rr�rrrrrrrrrr#r$r%r)r:r'r&rrrrr��s6


	


 
r�c@seZdZddd�ZdS)rANc	Cs
|r|��}d|_i}xztjD]p}|dkrd||<|dkrH|d|d�qt|�jpTd}|�d�d}|d|}|���|�dkr|d||�qW�xdtj	|d�D�]R\}	}}
|jr�P|dkr�|d|d�q�yt�
|	|�}Wntk
r�w�YnX|j}t
|d	��rny|�|�}
Wn&tk
�r:|�r4||�w�YnXtt�|
���pNd}t
|d
��rh|�|�}nd}n^ytj�|�}Wn&tk
�r�|�r�||�w�YnX|j�r�|j��dnd}t|dd�}|d|}|���|�dkr�||||�q�W|�r|�dS)NF�__main__rrrrz - )r?�
get_source�get_filenamerO)r�rrr�r�rUrr=r.r��	_get_specr�r�rbrDr?r�r��StringIOrEr�r�r�r�r�r<)r>r>rGZ	completerr?�seenr'r(rsr8r9r�r��sourcerr�rrrrB7s`zModuleScanner.run)NNN)r%r&rZrBrrrrrA4srAc	CsDdd�}dd�}t���"t�d�t�j|||d�WdQRXdS)NcSs6|dd�dkr |dd�d}t||o.d|�dS)Ni����z	.__init__z
 (package)z- )r�)rr'rsrrrr>sszapropos.<locals>.callbackcSsdS)Nr)r'rrrr?wszapropos.<locals>.onerror�ignore)r?)�warnings�catch_warnings�filterwarningsrArB)rGr>r?rrrr@qs


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

z(_start_server.<locals>.DocHandler.do_GETcWsdS)Nr)r>r�rrr�log_message�sz-_start_server.<locals>.DocHandler.log_messageN)r%r&rZrQrRrrrr�
DocHandler�srScs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS)NF)�hostZaddressr>rIrx�handlerr)r>rT�portr>rrrrx�s
z)_start_server.<locals>.DocServer.__init__csBx4|js4��|j��gggd�\}}}|r|��qW|��dS)Nr)r�selectZsocketr�Zhandle_requestZserver_close)r>ZrdZwrZex)rWrr�serve_until_quit�s
z1_start_server.<locals>.DocServer.serve_until_quitcSs |j�|�|jr|�|�dS)N)rI�server_activater>)r>rrrrY�sz0_start_server.<locals>.DocServer.server_activateN)r%r&rZrxrXrYr)rWrr�	DocServer�srZcs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dS)NF)rOrTrrV�Threadrx�serving�error)r>rOrTrV)�	threadingrrrx�s
z,_start_server.<locals>.ServerThread.__init__c
sxyJ�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�Wn(tk
rr}z
||_Wdd}~XYnXdS)N)�server�
HTTPServerrIrUr�ZMessageZMessageClass�staticmethodrOrTrV�ready�	docserverrXr?r])r>Zdocsvr�e)rSrZ�email�httprrrB�s

z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r\rTZserver_portrVr)r>r_rrrrb�sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)NTF)rcrr!r\r)r>rrr�stop	s
z(_start_server.<locals>.ServerThread.stopN)r%r&rZrxrBrbrgr)rSrZrerfr^rr�ServerThread�s
rhg{�G�z�?)
Zhttp.serverZ
email.messagerWr^r_ZBaseHTTPRequestHandlerr`r[rr]r\�timeZsleep)rO�hostnamerVrhZthreadr)rSrZrerfrWr^r�
_start_servers8'rk�	text/htmlc	sG�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�r�|dd�}|dkr�tj�tj�t��}tj�||�}t|��}d�|�	��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>r�r��css_pathZcss_link)�html_navbarrrr�"	sz#_url_handler.<locals>._HTMLDoc.pageN)r%r&rZr�r)rnrr�_HTMLDoc 	srocs>��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)r5)r�rrrn2	s
z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}x tjD]}|���||��qVW|�d�dd
�|�fS)NcSsd||fS)Nz<a href="%s.html">%s</a>r)r(rrr�	bltinlinkP	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>z#ffffffz#7799eecSsg|]}|dkr|�qS)rCr)rjr(rrrr�V	sz4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in Modulesz#ee77aaz|<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)	r�rr�rr�rr
rcr!)rpr��namesr�rHr)r�rr�
html_indexM	sz _url_handler.<locals>.html_indexc		s�g��fdd�}t���*t�d�dd�}t�j|||d�WdQRXdd�}g}��d	d
d�}x"�D]\}}|�||�|�qhW|��d|d
d
d�|��}d|fS)Ncs:|dd�dkr |dd�d}��||o0d|f�dS)Ni����z	.__init__z
 (package)z- )r
)rr'rs)�
search_resultrrr>k	sz3_url_handler.<locals>.html_search.<locals>.callbackrJcSsdS)Nr)r'rrrr?r	sz2_url_handler.<locals>.html_search.<locals>.onerror)r?cSsd||fS)Nz<a href="%s.html">%s</a>r)r(rrrrpw	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>z#ffffffz#7799eezkey = %sz#ee77aaz<br>zSearch Results)	rKrLrMrArBr�r
r�r!)	rGr>r?rprgr�r(rsr�)r�)rsr�html_searchf	s 

z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)NcSsd||fS)Nz<a href="topic?key=%s">%s</a>r)r(rrrrp�	sz4_url_handler.<locals>.html_topics.<locals>.bltinlinkz,<big><big><strong>INDEX</strong></big></big>z#ffffffz#7799eeZTopicsz#ee77aa)r�r+r�r!rDrr�)rpr�rqr�)r�rr�html_topics�	sz!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)Nz,<big><big><strong>INDEX</strong></big></big>z#ffffffz#7799eecSsd||fS)Nz<a href="topic?key=%s">%s</a>r)r(rrrrp�	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsz#ee77aa)r�r+r�rrDrr�)r�rqrpr�)r�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)
NZKEYWORDZTOPICz)<big><big><strong>%s</strong></big></big>z#ffffffz#7799eez
<pre>%s</pre>z#ee77aacSsd||fS)Nz<a href="topic?key=%s">%s</a>r)r(rrrrp�	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkzRelated help topics: z%s %sr)
r�rGr�r:rr�rr�r+rrr�r!)r4�bufZhtmlhelpr�r9r�r�rp)r�rr�html_topicpage�	s&



z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dkr$|dkr$td��t|�}��||�}||fS)Nr)r�r�zcould not find object)r�rQr�r�)rr9r��content)r�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>z#ffffffz#7799eez<br>c3s|]}��|�VqdS)N)r�)rjr�)r�rrra�	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)r�r!rr�r�)rr�r�r�)r�rr�
html_error�	sz _url_handler.<locals>.html_errorc
sr|}|�d�r|dd�}�y|dkr2��\}}n�|dkrF��\}}n�|dkrZ��\}}n�d|k�r$|�d�\}}}|dkr��|�\}}n�|dkr�y�|�\}}Wn tk
r��|�\}}YnXn\|d	k�r|dkr��\}}n4y�|�\}}Wn"tk
�r�|�\}}YnXntd
��n�|�\}}Wn2tk
�rd}z�||�\}}Wdd}~XYnX��||�S)Nz.html���)rrcr!rrYz
search?keyz	topic?keyzget?keyz
bad pydoc url)rar;rQr?r�)rZcomplete_urlr�ry�opr^r�)r�r{rzrrrvrtrxrurr�
get_html_page�	s>



 z#_url_handler.<locals>.get_html_pager�rztext/cssrz	text/htmlz"unknown content type %r for url %s)r�r`r	r�dirname�realpathrOr!r��	readlinesrt)rrPror~Z	path_hererm�fpr)	r�r{rzrrrvrnrtrxrur�_url_handler	s*	
(


r�T�	localhost)�open_browserrjc	Cs�ddl}tt||�}|jr(t|j�dS|jr�d}|rB|�|j�z�y^td|j�t|�xD|jr�td�}|�	�}|dkr~Pq\|dkr�|�|j�q\t|�q\WWnt
tfk
r�t�YnXWd|jr�|��td�XdS)Nrz"Server commands: [b]rowser, [q]uitzServer ready atzserver> r�r�zServer stopped)
�
webbrowserrkr�r]r�r\r�rrr�r�rrg)rVr�rjr�ZserverthreadZserver_help_msgr�rrr�browse
s2
r�cCst|t�o|�tj�dkS)Nr)r�r+r=r	�sep)rMrrr�ispath)
sr�cCsvd|kstj|kst��|kr"dStj�t�}tj�|�}|��}||krbtj�||�sb|�|�|�	dt���|S)Nrr)
r	�curdir�getcwdrrrO�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path,
s

r�cCs,ttjtjd�}|dk	r(|tjdd�<dS)Nr)r�rr�argv)r�rrr�_adjust_cli_sys_pathH
sr�cCs�ddl}Gdd�dt�}t��yp|�tjdd�d�\}}d}d}d}d}d}x`|D]X\}	}
|	dkrnd	}d	}|	d
kr�t|
�dS|	dkr�d	}|
}|	dkr�d	}|	d
krVd	}|
}qVW|r�t|||d�dS|s�|�x�|D]�}t|�r�tj	�
|�s�td|�Py`t|��rtj	�|��rt
|�}|�rPt|��rFtj	�|��rFt|�nt|�n
t�|�Wq�tk
�r�}zt|�Wdd}~XYq�Xq�WWnN|j|fk
�r�tj	�tj	�tjd��d}
tdj|
tjd��YnXdS)Nrc@seZdZdS)zcli.<locals>.BadUsageN)r%r&rZrrrr�BadUsageU
sr�rzbk:n:p:wFr�z-bTz-kz-pz-wz-n)rjr�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�)�getoptr?r�rr�r@r�r�r	r�existsr�ryr�rr�r�rr�r]r�r�rr�)r�r�Zoptsr�ZwritingZstart_serverr�rVrj�opt�val�argrHr�rrr�cliR
s`


"r�rC)NN)r)r)r�rN)r�rN)r)rN)rl)r)Zr(rTrXr[rOZimportlib._bootstrapr�Zimportlib._bootstrap_externalZimportlib.machinery�importlib.utilrr�r	r.r�rrr�rir�Zurllib.parser)rK�collectionsr�reprlibr�	tracebackrrrr$r)r-r/r3r�
IGNORECASEr4r5r:r?rCrNrdrerwr{r�r�r?r�r�r�r�r�r�rerfrwryrxr}rr|r�r�r�r�r�r.r�r�r�r�r"r�r�r�rrAr@rkr�r�r�r�r�r�r%rrrr�<module>(s�		


	'
0<*; p",






=
n%
U