HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/__pycache__/pydoc.cpython-310.opt-2.pyc
o

�i��@s4	dgZdZdZdZddlZddlZddlZddlZddl	Zddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZd	d
�Zdd�Zd
d�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd�Z(dd �Z)e�*d!ej+�Z,d"d#�Z-d$d%�Z.d&d'�Z/d(d)�Z0d�d*d+�Z1d,d-�Z2d.d/�Z3d0d1�Z4d2d3�Z5ifd4d5�Z6Gd6d7�d7e7�Z8d8d9�Z9difd:d;�Z:Gd<d=�d=�Z;Gd>d?�d?e�Z<Gd@dA�dAe;�Z=GdBdC�dCe�Z>GdDdE�dEe;�Z?GdFdG�dGe?�Z@dHdI�aAdJdK�ZBdLdM�ZCdNdO�ZDdPdQ�ZEdRdS�ZFdTdU�ZGdVdW�ZHdXdY�ZId�dZd[�ZJe?�ZKe@�ZLe=�ZMd�d\d]�ZN		d�d_d`�ZO		d�dadb�ZPd�dcdd�ZQd�dfdg�ZRGdhdi�di�ZSeS�ZTGdjdk�dk�ZUdldm�ZVdndo�ZWd�dqdr�ZXd�dsdtdu�dvdw�ZYdxdy�ZZdzd{�Z[d|d}�Z\d~d�Z]e^d�k�r�e]�dSdS)��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]$}tj�|pd�}tj�|�}||vr,tj�|�r,|�|�|�|�q|S�N�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dir�normdir�r�"/usr/local/lib/python3.10/pydoc.py�pathdirsRs


�rcCst�|�ot|tj�S�N)�inspectZisclass�
isinstance�types�GenericAlias��objectrrr�_isclass^srcCsNtj�|j�}|dur
dS|j�d�dd�D]}t||�}qt|�s%dS|S)Nr���)r�modules�get�
__module__�__qualname__�split�getattrr)�func�cls�namerrr�
_findclassasr'c	Cs�t�|�r#|jj}|j}t|�rtt||d�d�|jur|}n�|j}n�t�|�r=|j}t	|�}|dus:t||�|ur<dSnqt�
|�r]|j}|j}t|�rY|jd||jkrY|}nU|j}nQt|t
�rz|j}|j}t	|�}|duswt||�|urydSn4t�|�s�t�|�r�|j}|j}t||�|ur�dSt�|�r�t|dd�}t|t�r�||vr�||SndS|jD]}z	tt||��}Wn	ty�Yq�w|dur�|Sq�dS)N�__func__r�	__slots__)r�ismethodr(�__name__�__self__rr#�	__class__�
isfunctionr'�	isbuiltinr!r�property�fgetZismethoddescriptor�isdatadescriptor�__objclass__�ismemberdescriptor�dict�__mro__�
_getowndoc�AttributeError)�objr&�selfr%r$�slots�base�docrrr�_finddocks`

�

�
�
��r>cCsb	z%t�|d�}|durWdS|tur$t|�j}t|t�r$||kr$WdS|WSty0YdSw)N�__doc__)r�__getattribute__�typer?r�strr8)r9r=Ztypedocrrrr7�s
�r7c	CsP	t|�}|durzt|�}WnttfyYdSwt|t�s#dSt�|�Sr)r7r>r8�	TypeErrorrrBrZcleandoc)rr=rrr�_getdoc�s�

rDcCs.	t|�p	t�|�}|rt�dd|���pdS)Nz^ *
�)rDrZgetcomments�re�sub�rstrip)r�resultrrr�getdoc�srJcCsh	|���d�}t|�dkr|ddfSt|�dkr-|d��s-|dd�|dd��fSdd�|�fS)N�
�rrE�)�stripr"�lenrH�join)r=�linesrrr�splitdoc�srRcCs$	|j}|j|kr|jd|}|Sr)r+r )r�modnamer&rrr�	classname�s

rTcCs>	t�|�pt|�pt�|�pt�|�pt�|�pt�|�Sr)r�ismoduler�	isroutineZisframeZistracebackZiscoderrrr�isdata�s����rWcGs2	|r|d�|�|d��}|dd�}|s|S)NrLrrM)rPr")�text�pairsrrr�replace�s�rZcCsZ	t|�|kr+td|dd�}td|d|�}|d|�d|t|�|d�S|S)Nr�rM�...)rO�max)rX�maxlen�preZpostrrr�cram�s$r`z at 0x[0-9a-f]{6,16}(>+)$cCs	t�d|�S)Nz\1)�_re_stripidrG�rXrrr�stripid�srccCs>	t�|�rdSt�|�rt|dd�}t�|�p|duSdS)NTr,F)rr*r/r#rU)�fnr:rrr�_is_bound_method�s

recCs^i}t�|tj�D]\}}d||<q	|jD]	}|�t|��q|��D]	}t||�||<q#|S�NrL)r�
getmembersrV�	__bases__�update�
allmethods�keysr#)�cl�methods�key�valuer<rrrrj�s

rjcCs:	g}g}|D]}||�r|�|�q|�|�q||fSr�r)�s�	predicateZyes�no�xrrr�_split_listsrucCsZ	|dvrdS|�d�r|�d�rdS|�d�rt|d�rdS|dur'||vS|�d�S)N>r+�__credits__�__package__�
__cached__r)�__date__�__spec__r �__file__r?r!�__builtins__�
__author__�
__loader__�__version__�__path__r�__rL�_�_fieldsT)�
startswith�endswith�hasattr)r&�allr9rrr�visiblenamesr�cCsZ	g}t�|�D]"\}}}}t�|�r!d}t|t�r!|jdur!d}|�||||f�q|S)N�data descriptor�readonly property)r�classify_class_attrsr2rr0�fsetr)r�resultsr&�kindr%rorrrr�)s
r�cs\	t|dg��z
�fdd�t��D��Wntyi�Ynw�fdd�}|j|d�dS)Nr�csi|]\}}||t���qSr)rO)�.0�ir&)�fieldsrr�
<dictcomp>:�z#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)r)�attr)�field_orderrr�<lambda>=sz!sort_attributes.<locals>.<lambda>�rn)r#�	enumeraterC�sort)�attrsrZkeyfuncr)r�r�r�sort_attributes4s�r�cCs<	tj�|�rdD]}tj�tj�|d|��rdSq	dS)N)z.pyz.pyc�__init__TF)r
r	r
�isfilerP)r	�extrrr�	ispackageBs�r�cCs�|��}|dd�dks|��s#|��}|sn|dd�dks|��r|��}|dd�dkr5|dd�}|dd�dkrk|dd�}|dd�dkrQ|dd�}|��s`|��}|s\n|��rU|�d�d	��}|Sd}|S)
NrL�#�zr"""r[�"""r�\r)�readlinerNr")�file�linerIrrr�source_synopsisJs$���r�c
Cs.	t�|�j}|�|d�\}}|dus||kr�|�ttjj��r%tjj	}n|�ttjj
��r3tjj}nd}|durbzt�
|�}Wn
tyJYdSw|�t|�}Wd�n1s\wYn-|d|�}tjjd||d�}ztj�|�}	WnYdStjd=|	jr�|	j��dnd}||f||<|S)N�NNZ__temp__��loaderr)r
�stat�st_mtimerr��tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadrrr?�
splitlines)
�filename�cache�mtimeZ
lastupdaterIZ
loader_clsr�r��spec�modulerrr�synopsis[s>

�
��

�r�c@seZdZ	dd�Zdd�ZdS)�ErrorDuringImportcCs||_|\|_|_|_dSr)r��excro�tb)r:r��exc_inforrrr��szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r+r�ro)r:r�rrr�__str__�szErrorDuringImport.__str__N)r+r r!r�r�rrrrr��sr�c	Cs�	tjj}t|d��}||�t|��k}Wd�n1swYtj�|�}tj�	|�\}}|r;tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����)N�rbr�)r�r��MAGIC_NUMBERr��readrOr
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/|r+�tjvr+�tjvr+�fdd�tjD�}�g|D]
}tj|||<tj|=qt��}Wn8t��\}}}}	�tjvrKttj�j|	��|turUt|j|	��t	|t
�rb|j�krbYdSt�t������d�dd�D]}
zt
||
�}Wqrty�YdSw|S)Ncsg|]}|��d�r|�qS)r)r�)r��m�r	rr�
<listcomp>�r�zsafeimport.<locals>.<listcomp>rrL)rr�builtin_module_names�
__import__r�r�r{�SyntaxErrorr��
issubclass�ImportErrorr&r"r#r8)r	�	forceloadr�Zsubsrnr�r�ror��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/libraryNrMcGs�	||f|}z"t�|�r|j|�WSt|�r|j|�WSt�|�r(|j|�WSWn	ty2Ynwt�|�r=|j	|�S|j
|�Sr)rrU�	docmoduler�docclassrV�
docroutiner8r2�docdata�docother)r:rr&�argsrrr�document�s�
zDoc.documentcGs(	d|o	dt|�t|�jf}t|��)Nz.don't know how to document object%s of type %s� )�reprrAr+rC)r:rr&r��messagerrr�fail�s
�zDoc.failZstdlibcCs�	zt�|�}Wntyd}Ynwtj�d|j�}tj�|�}t	|t
t��rc|jdvs=|�|�rc|�tj�
|d��sc|jdvrc|�d�rUd�|�d�|j���}|Stj�
||j��d	�}|Sd}|S)
N�
(built-in)r�)
�errno�
exceptions�gcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z
{}/{}.html�/�.html)r�
getabsfilerCr
�environrr�r	rrrAr+r�rP�formatrH�lower)r:rZbasedirr��doclocrrr�	getdocloc�s,�
��

��z
Doc.getdoclocr)r+r r!r
r�rr�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfigZget_pathr�rrrrr��s��

r�c@sFeZdZ	dd�Zdd�Zdd�Zdd�Zd	d
�ZeZdd�Z	eZ
d
S)�HTMLReprcC�,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r:rrrr�
�
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)rZ�r:rXrrr�escapeszHTMLRepr.escapecCst�||�Sr)rr��r:rrrrr��z
HTMLRepr.reprcCsZtt|�d�r dd�t|�j���}t||�r t||�||�S|�ttt	|��|j
��S�Nr+�repr_r�)r�rArPr+r"r#rr`rcr�r�r:rt�levelZ
methodnamerrr�repr1s

zHTMLRepr.repr1cCs^t||j�}t|�}d|vr%dt|dd�vr%d|d|�|�|dSt�dd|�|��S)Nr��\\rE�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r`rr�rZrrFrG�r:rtr�testZtestreprrrr�repr_strings�zHTMLRepr.repr_stringcCs:z|�ttt|��|j��WS|�d|jj�YS�Nz
<%s instance>)rr`rcr�rr-r+�r:rtrrrr�
repr_instance*szHTMLRepr.repr_instanceN)r+r r!r�rr�rr�repr_strrZrepr_unicoderrrrr�sr�c@seZdZ	e�ZejZejZdd�Zd0dd�Z		d1d	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+�ZeZd4d,d-�Zd3d.d/�ZdS)6�HTMLDoccC�	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.pagerEcCs	d|||||p	dfS)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�bgcol�extrasrrr�headingEs�zHTMLDoc.heading�Nr%c	
Cs`	|dur
dd|d}d|||f}	|r!|	d||||f}	n	|	d|||f}	|	d|S)Nz<tt>r%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
marginaliaZgaprIrrr�sectionPs�
��zHTMLDoc.sectioncGs	d|}|j|g|�R�S)Nz<big><strong>%s</strong></big>)r,)r:r"r�rrr�
bigsectionfszHTMLDoc.bigsectionc
Cs(	|�|���}t|dddddddd�	S)N�

z
 
r�r%rK�<br>
)r�
expandtabsrZrrrr�	preformatks
�zHTMLDoc.preformatr�cCs�	d}t|�|d|}t|�D],}|dd|}t|||||�D]}|t|�kr8||||�d}q&|d}qd|S)NrErLz<td width="%d%%" valign=top>rr/z</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)rO�range)r:�listr�ZcolsrI�rows�colr�rrr�multicolumnqs�
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rrrrr�grey}szHTMLDoc.greycGs,	|D]}||vrd|||fSq|S)N�<a href="%s">%s</a>r)r:r&Zdictsr5rrr�namelinks�zHTMLDoc.namelinkcCsP	|jtj�|j�}}t||�r#t||�|ur#d|j|t||�fSt||�S)Nz<a href="%s.html#%s">%s</a>)r+rrrr r�r#rT)r:rrSr&r�rrr�	classlink�s�
zHTMLDoc.classlinkcCs	d|j|jfS�Nz<a href="%s.html">%s</a>)r+rrrr�
modulelink�szHTMLDoc.modulelinkcCsT	|\}}}}|r|�|�S|rd||f}nd|}|r"d|}n|}d||fS)Nz
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)r8)r7)r:Z
modpkginfor&r	r��shadowed�urlrXrrr�
modpkglink�s

zHTMLDoc.modpkglinkcCr!)Nz<a href="file:%s">%s</a>r)r:r>r	rrr�filelink�szHTMLDoc.filelinkcCs�	|p|j}g}d}t�d�}	|�||�}	|	sn�|	��\}
}|�||||
���|	��\}}
}}}}|
rH||��dd�}|�d||f�ng|r\dt|�}|�d|||�f�nS|rpdt|�}|�d|||�f�n?|r�|||d	�d
kr�|�d|�	||��n'|�d|�n|||d	�d
kr�|�|�	||||��n	|�|�	||��|}q|�|||d���d
�
|�S)NrzJ\b((http|https|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))T�"z&quot;r8z'http://www.rfc-editor.org/rfc/rfc%d.txtz)https://www.python.org/dev/peps/pep-%04d/rL�(zself.zself.<strong>%s</strong>rE)rrF�compile�search�spanr�groupsrZ�intr9rP)r:rXr�funcs�classesrmr��here�pattern�match�start�endr��schemeZrfcZpepZselfdotr&r>rrr�markup�s>

�
zHTMLDoc.markupc
Cs�	d}|D]T}t|�td�urF|\}}|d}||�||�}|rA||fkrAg}|D]}	|�|�|	|��q*|dd�|�d}|d}qt|�tg�urY|d|�|||�}qd	|S)
NrErz"<dt><font face="helvetica, arial">rB�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)rAr:rrP�
formattree)
r:�treerS�parentrI�entry�c�bases�parentsr<rrrrS�s&
��zHTMLDoc.formattreec#
s�	|j}z|j}Wntyd}Ynw|�d�}g}tt|�d�D]}|�dd�|d|d��||f�q$d�||dd��}	d|	}
zt�	|�}t
j�|�}��
||�}
Wntyhd}
Ynwg}t|d�r�t|j�}|dd�d	kr�|dd�d
kr�|dd���}|�d��|��t|d�r�|���t|j���|r�|
d
d�|�}
��|�}|dur�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|t�D]*\}}|dus�t�|�p�||u�rt|||��r|�||f�d|||<||<q�|D]@\}}|jD]7}|j|j}}tj �!|�}||k�rK|�rKt||��rKt"||�|u�rK||v�rK|d|||<||<�q�qgi}}t�|tj#�D]8\}}|du�srt�$|��srt�|�|u�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q[g}t�|t&�D]\}}t|||��r�|�||f��q���'t(|��j)||�}|�o�d|}|d|}t|d��r�g}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n|�r��.|�fdd��}!|��0ddd|!�}|�rId d!�|D�}"��1t�2|"d�|�g}!|D]\}}|!���3|||||���q*|��0d"dd#d$�|!��}|�rog}!|D]\}}|!���3|||||���qP|��0d%dd&d$�|!��}|�r�g}!|D]\}}|!���3||���qv|��0d'dd(d)�|!��}t|d*��r���'t|j4��j)�}!|��0d+dd|!�}t|d,��rƈ�'t|j5��j)�}!|��0d-dd|!�}|S).NrrLz5<a href="%s.html"><font color="#ffffff">%s</font></a>r�)<big><big><strong>%s</strong></big></big>r�r��$Revision: �$z
version %sryz (%s)rQz-<br><a href="%(docloc)s">Module Reference</a>rE�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
r�rzPackage Contentsz#aa55cccs��|d�Srf)r<��tr	rrr�9�z#HTMLDoc.docmodule.<locals>.<lambda>ZModulescS�g|]\}}|�qSrr�r�rnrorrrr�>�z%HTMLDoc.docmodule.<locals>.<listcomp>ZClasses�#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55r/r}ZAuthorrvZCredits)6r+�__all__r8r"r2rOrrPrr��urllib�parse�quoter@rCr�rBrrNrryr��localsr)rgrUr�	getmoduler�rhr rrrr#rVr/r.rWrPrJr1�pkgutil�iter_modulesr�r�r6r?r-rS�getclasstreer�r}rv)#r:rr&�mod�ignoredr��partsZlinksr�Z
linkedname�headr	r>r@r��versionr�rIrrIZcdictrnror<rSr�rHZfdict�datar=�modpkgs�importer�ispkgr#�	classlistrr	rr��s
�
��
�

 


�
�

��

������������zHTMLDoc.docmodulec	st	�j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkrE����d�|D]
}�d��|�j	��q3�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]2\}}}}d|d|�|<}zt�|�}Wn	ty�Ynwz|�|<Wqwt
y�Yqww|�r+|r�|���n|dd�t|�fdd��\}}�tjur҈tjur�|}q���ur�d}n	d����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|}|s�d#�|	�}	||k�r<d$||f}nd%|||f}|�rag}|D]
}|���|�j	���qJ|d&d'�|�}d#}zt���}Wntt
f�yxd}Ynw|�r�t|�}|�r�|d(k�r�|��|�d)}t��}|�r�||�p�d#}��|�j����}|�o�d*|}��|d+d,|	d-|�S).Nc� eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecS�
d|_dSr��Zneedoner	rrrr�h�
z1HTMLDoc.docclass.<locals>.HorizontalRule.__init__c�|jr�d�d|_dS)Nz<hr>
rLr|r	��pushrr�maybej�
z.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r+r r!r�r�rrrr�HorizontalRuleg�r�rMz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|rE����|�|D]1\}}}}zt�|�}Wnty2���||���Ynw���||��������d�q|S)NrK�rur�r#�	Exceptionr�r���msgr�rr�okr&r��homeclsro�rIrH�hr�mdictrprr�r:rr�spillzs��
zHTMLDoc.docclass.<locals>.spillc�Jt||�\}}|r#����|�|D]\}}}}���||���q|Sr�rur�r�r��r�rpr�r:rr�spilldescriptors��z*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|rM����|�|D]9\}}}}��t�|�|��}t|�}	|	s0�d|�n��t|��j����}	d|	}	�d||	f��d�q|S)Nz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
rK)rur�r�r#rJrPr1)
r�r�rrr�r&r�r�ror<r=r�rr�	spilldata�s �
z#HTMLDoc.docclass.<locals>.spilldatac�,g|]\}}}}t|�d�r||||f�qS�)r9�r��r�r&r�r%rorrrr���

�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rc�|d�uS�NrMrr`��	thisclassrrr���z"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scS�|ddkS�NrL�methodrr`rrrr��r�zClass methods %scSr��NrLzclass methodrr`rrrr��r�zStatic methods %scSr��NrLz
static methodrr`rrrr��r�zReadonly properties %scSr��NrLr�rr`rrrr��r�zData descriptors %scSr��NrLr�rr`rrrr��r�zData and other attributes %scSr��NrLrurr`rrrr��r�rEz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)rQ�()r.z<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r[)r+rhrrr�getmrorOr�r:r r�r#r�rC�popleftru�builtinsrr�rP�	signature�
ValueErrorrBrrJrPr1r,)r:rr&rprHrIrq�realnamerXr#r��mror<r�r�r�r�rnr�r�ro�anchor�	inherited�tagr"rY�declr��argspecr=r)	rIrHr�r�rprr�r:r�rr�\s�

�	
���
�

�
�
�
�
�
��
#
���zHTMLDoc.docclasscCs	|�d|�|��S�N�=)r7r�rrrr�formatvalue��zHTMLDoc.formatvaluec	Cs�	|j}|p|}|r
|jpdd|}	d}
d}t|�rF|jj}|r.||ur-d|�||�}
n|jdur>d|�|jj|�}
nd|�||�}
t�|�sPt�|�rSd}
nd}
||kr`d|	|f}n"|ryt�||g�|uryd	|jd||f}d
}n|}d|	||f}d}t�	|�r�zt�
|�}Wn
ttfy�d}Ynw|r�t
|�}|dkr�d
|}|d
d�}|s�d}|
||�|�|
o�|�d|
�}|r�d|S|�t|�|j|||�}|o�d|}d||fS)NrEr�r� from � method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rLz)<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+rer,r-r:r�iscoroutinefunction�isasyncgenfunction�getattr_staticrVr�r�rCrBrr7rPrJr1)r:rr&rprHrIrmrlr�r��note�skipdocs�imclass�asyncqualifierr"Zreallinkr�r�r�r=rrrr�sr�
�
���
���zHTMLDoc.docroutinecCsP	g}|j}|r|d|�|�t|�|j�}|r|d|�|d�d�|�S)Nz!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
r�rE)rrPrJr1rP�r:rr&rprlr�r�r=rrrr�Cs
zHTMLDoc.docdatacGs 	|rd|pd}||�|�S)Nz<strong>%s</strong> = rE�r�)r:rr&rprqZlhsrrrr�SszHTMLDoc.docothercCs�	g}|dur	i}t�|g�D]\}}}tdd�|D��rq|�|d|||vf�d||<q|��|�||j�}|�|dd|�S)Ncss,�|]}dt|�kodknVqdS)i�i��N)�ord�r�Zchrrr�	<genexpr>]s�*z HTMLDoc.index.<locals>.<genexpr>rErLr^rf)rmrn�anyrr�r6r?r-)r:rr=rvrwr&rxr#rrr�indexXs
z
HTMLDoc.index�rE)r*rENr%)r�rr��NNN)r+r r!r��_repr_instancer�rr$r)r,r-r1r6r7r9r:r<r?r@rPrSr�r�r�r�r�r�r�r�rrrrr 2s@


�

+
y#
�
A
r c@s2eZdZ	dd�Zdd�Zdd�ZeZdd�Zd	S)
�TextReprcCr�r�rr	rrrr�kr
zTextRepr.__init__cCsTtt|�d�r dd�t|�j���}t||�r t||�||�Sttt|��|j	�Sr)
r�rArPr+r"r#r`rcr�rrrrrrqs

zTextRepr.repr1cCsHt||j�}t|�}d|vr"dt|dd�vr"d|d||dS|S)Nr�rrErr)r`rr�rZrrrrrxs
zTextRepr.repr_stringcCs.zttt|��|j�WSd|jjYSr)r`rcr�rr-r+rrrrr�szTextRepr.repr_instanceN)r+r r!r�rrrrrrrrr�is	r�c@s|eZdZ	e�ZejZdd�Zddd�Zdd�Zdd
d�Z	ddd
�Z
ddd�Zdd�Zddd�Z
ddd�ZeZddd�ZdS)�TextDoccCs	d�dd�|D��S)NrEcss�|]	}|d|VqdS)�Nrr�rrrr��s�zTextDoc.bold.<locals>.<genexpr>)rPrrrr�bold�r�zTextDoc.bold�    cs@	|sdS�fdd�|�d�D�}|r|d��|d<d�|�S)NrEcsg|]}�|�qSrr�r�r���prefixrrr��rez"TextDoc.indent.<locals>.<listcomp>rKr)r"rHrP)r:rXr�rQrr�r�indent�s

zTextDoc.indentcCs&	|�|���}|�|�d|dS)NrKr.)r�rHr�)r:r"r#Zclean_contentsrrrr,�szTextDoc.sectionNrEc
	s�	d}|D]I}t|�td�ur:|\}}||t|��}|r5||fkr5�fdd�|D�}	|dd�|	�}|d}qt|�tg�urN||�|�||d�}q|S)	NrErc3s�|]}t|��VqdSr�rT)r�rW�rSrrr����z%TextDoc.formattree.<locals>.<genexpr>r�rQrKr�)rArTrPrS)
r:rTrSrUr�rIrVrWrXrYrr�rrS�s 
��zTextDoc.formattreec	Cs	|j}tt|��\}}|�d||od|�}t|dd�}|�|�}|dur1||�d|d�}|r;||�d|�}g}	t�|t�D]\}
}|dusTt�	|�pQ||urat
|
||�ra|	�|
|f�qCg}t�|tj�D]!\}
}|dust�
|�st�	|�|ur�t
|
||�r�|�|
|f�qkg}
t�|t�D]\}
}t
|
||�r�|
�|
|f�q�g}t�}t|d�r�t�|j�D]\}}}|�|�|r�|�|d�q�|�|�q�|��||�d	d
�|��}g}t�|tj�D]\}
}|j�|d�r�|
|vr�|�|
�q�|�r|��||�dd
�|��}|	�rCd
d�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���q(||�dd
�|��}|�reg}|D]\}
}|�|�||
|���qJ||�dd
�|��}|
�r�g}|
D]\}
}|�|j||
|dd���ql||�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"��}zt�#|�}Wnt$�y�d!}Ynw||�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.
ZDESCRIPTIONr��
 (package)zPACKAGE CONTENTSrKrZ
SUBMODULEScSrcrrrdrrrr��rez%TextDoc.docmodule.<locals>.<listcomp>rL�CLASSES�	FUNCTIONS�F)r^ZDATArr[r\rr]�VERSIONryZDATEr}ZAUTHORrvZCREDITSr��FILE)%r+rRrJr,r#r�rrgrrlr�rrVr/rW�setr�rmrnr��addr�rPrUr�rSror�r�rBrrNryr}rvr�rC)r:rr&rpZsynop�descrIr�r�rIrnrorHrurvZ
modpkgs_namesrwrSrxZ
submodulesryr#rtr�rrrr��s�
	����


�
�
��
$�zTextDoc.docmodulec	sB	�j}|p|}�j}�jfdd�}||krd��|�}n	��|�d|}|r7t||�}	|dd�|	�}g}
|
j�zt���}Wn
t	t
fyPd}Ynw|ret|�}|re|dkre�||d�t��}
|
rq�|
d�t
t����}t|�d	kr��d
�|D]
}�d||��q��d�td
d�t���D�tjd�}t|�}d}|rшd�|d|�D]}�d|�q�||kr͈dt||�d��d�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r�|�r|���n|dd	�t|�fdd ��\}}�tju�r1�tju�r1|}�q��u�r9d!}nd"t��j�}t|��|d#||d$d ��}|d%||d&d ��}|d'||d(d ��}|d)||d*d ��}|d+||d,d ��}|d-||d.d ��}|}|�sd�|
�}
|
�s�|dS|d��|
��d/�dS)0NcSs
t||�Srr�)rWr�rrr�makenamer}z"TextDoc.docclass.<locals>.makename�class z	 = class r�rQr�rKrMzMethod resolution order:r�rEcss0�|]}|j�d�s|jdkrt|j�VqdS)r�r�N)r+r�r rB)r�r%rrrr�Cs�
�
��z#TextDoc.docclass.<locals>.<genexpr>r�r�zBuilt-in subclasses:z    ... and z other subclassescrz)z(TextDoc.docclass.<locals>.HorizontalRulecSr{r�r|r	rrrr�Ur}z1TextDoc.docclass.<locals>.HorizontalRule.__init__cr~)NzF----------------------------------------------------------------------rLr|r	rrrr�Wr�z.TextDoc.docclass.<locals>.HorizontalRule.maybeNr�rrrrr�Tr�r�c
s�t||�\}}|r>����|�|D]*\}}}}zt�|�}Wnty2���||���Yqw���||����q|Srr�r��r�rprr�r:rrr�]s��zTextDoc.docclass.<locals>.spillcr�rr�r�r�rrr�nr�z*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|rB����|�|D].\}}}}t|�}zt�|�}	Wnty2|j|}	Ynw��j|	|�d|d�d�q|S)Nr�)r^r=rK)rur�rJr#r8�__dict__r�)
r�r�rrr�r&r�r�ror=r9r�rrr�ws��z#TextDoc.docclass.<locals>.spilldatacr�r�r�r�rrrr��r�z$TextDoc.docclass.<locals>.<listcomp>rcr�r�rr`r�rrr��r�z"TextDoc.docclass.<locals>.<lambda>r�r�zMethods %s:
cSr�r�rr`rrrr��r�zClass methods %s:
cSr�r�rr`rrrr��r�zStatic methods %s:
cSr�r�rr`rrrr��r�zReadonly properties %s:
cSr�r�rr`rrrr��r�zData descriptors %s:
cSr�r�rr`rrrr��r�zData and other attributes %s:
cSr�r�rr`rrrr��r�z |  )r+rhr r��maprPrrr�r�rCrBrJrr�rO�sortedrA�__subclasses__r�r�r�rur�rrTr�r�rH)r:rr&rprqr�rXr�r"rYr#r�r�r=r�r<Z
subclassesZno_of_subclassesZMAX_SUBCLASSES_TO_DISPLAYZsubclassnamer�r�r�r�r�r�r�r)r�rprr�r:r�rr�s�
��
��	
�

�

�
�
�
�
�
��
#zTextDoc.docclasscCs	d|�|�Sr�r�rrrrr���zTextDoc.formatvaluec	Cs�	|j}|p|}d}d}t|�r8|jj}|r"||ur!dt||�}n|jdur1dt|jj|�}ndt||�}t�|�sBt�|�rEd}	nd}	||krQ|�|�}
n|r^t�	||g�|ur^d}|�|�d|}
d}t�
|�r�zt�|�}Wn
tt
fy�d}Ynw|r�t|�}|d	kr�|�|�d
}
|dd�}|s�d}|	|
||}
|r�|
d
St|�p�d}|
d
|o�|�|���d
S)NrErr�r�r�r�rL� = r�z lambda rr�rK)r+rer,r-rTrr�r�r�r�rVr�r�rCrBrJr�rH)r:rr&rprlr�r�r�r�r�r"r�r�r�r=rrrr��sZ�
�
�
�zTextDoc.docroutinecCsV	g}|j}|r||�|��|d�t|�pd}|r&||�|��|d�d�|�S)NrKrE)rr�rJr�rPr�rrrr��s
zTextDoc.docdatac
Cs�	|�|�}|r$|r|dpd|}|t|�}	|	dkr$|d|	�d}|r-|�|�dp.d|}|s7t|�}|rF|d|�t|��d7}|S)Nr�rErr\rK)r�rOr�rJr�rB)
r:rr&rprUr^r=r�r�Zchoprrrr��s
zTextDoc.docother)r�)NrEr�r�)NNNNN)r+r r!r�r�r�r�r�r,rSr�r�r�r�r�r�r�rrrrr��s 



e

7r�c@seZdZ	dd�ZdS)�
_PlainTextDoccCs|Srrrrrrr�
�z_PlainTextDoc.boldN)r+r r!r�rrrrr�sr�cCs	t�at|�dSr)�getpager�pagerrbrrrr�sr�c	sF	ttjd�s	tSttjd�stStj��rtj��stStj�d�p(tj�d���rJtj	dkr6�fdd�Stj�d�dvrD�fd	d�S�fd
d�Stj�d�dvrTtStj	dkr]dd�Sttd�rmt�
d
�dkrmdd�Sddl}|��\}}t�
|�z ttd�r�t�
d|�dkr�dd�Wt�|�StWt�|�St�|�w)N�isattyZMANPAGERZPAGER�win32c�tt|���Sr��
tempfilepager�plainrb�Z	use_pagerrrr�#rbzgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscr�r)�	pipepagerr�rbr�rrr�%rbcs
t|��Sr�rrbr�rrr�'�
cSstt|�d�S)Nzmore <r�rbrrrr�+rb�systemz(less) 2>/dev/nullrcS�
t|d�S)NZlessrrbrrrr�-rz	more "%s"cSr)NZmorerrbrrrr�4r)r�r�stdin�
plainpager�stdoutr�r
r�r�platformr�tempfile�mkstemp�close�unlink�ttypager)r	�fdr�rr�rr�s:


�r�cCs	t�dd|�S)Nz.rE)rFrGrbrrrr�:r�r�c	Cs�	ddl}|j|d|jdd�}z&|j�}z|�|�Wn	ty$YnwWd�n1s/wYWn	ty>Ynw	z|��WdStyPYnwq@)NrT�backslashreplace)�shellr�errors)�
subprocess�Popen�PIPEr�write�KeyboardInterruptr��wait)rX�cmdr�proc�piperrrr>s4��������rc	Cs�	ddl}|���B}tj�|d�}t|ddtjdkrt�d�ndd��
}|�	|�Wd�n1s3wYt�
|d|d�Wd�dS1sNwYdS)	Nrz	pydoc.out�wrr�)r�encodingz "rA)r	�TemporaryDirectoryr
r	rPr�rr�device_encodingrr)rXrr	�tempdirr�r�rrrr�Vs


���"�r�cCs$ttjdd�pd}|�|d��|�S)Nr�utf-8r)r#rr�encode�decode)rXrrrr�_escape_stdoutbsr#c
Cs�	tt|���d�}zddl}tj��}|�|�}|�|�dd�}Wnt	t
tjfy6d}dd�}Ynwz�zt
tj�dd��}WntyNd}Ynw|dkrUd}|d}}tj�d�|d|��d�||d�r�tj�d	�tj��|�}	|	d
vr�tj�d�nB|	dvr�tj�d||d�|d}qj|	d
vr�|||}|dkr�d}tj�dd�||||��d�||}||d�spW|r�|�||j|�dSdS|r�|�||j|�ww)NrKrcSstj�d�Srf)rrr�rrrrr�or�zttypager.<locals>.<lambda>cSstj��dd�dd�S)NrrL)rrr�rrrrr�rs�LINESrL�z
-- more --)�q�Qz
          
)�
rK)�b�B�)r�r#r"�ttyrr�filenoZ	tcgetattrZ	setcbreakr�r8�io�UnsupportedOperationrGr
r�rr�rrrP�flushZ	tcsetattrZ	TCSAFLUSH)
rXrQr,r�oldZgetchar�hrZincrWrrrr
gsZ


��
&����r
cCs	tj�tt|���dSr)rrrr�r#rbrrrr�srcCs�	t�|�r |jtjvrd|jSt|d�rd|jSd|jSt�|�r*d|jSt�|�r;d|jj	|jj|jfSt�
|�rLd|jj	|jj|jfSt|�rUd|jSt�|�r_d	|jSt�
|�rid
|jSt|�jS)Nzbuilt-in module r�zpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr�z	function zmethod )rrUr+rr�r�r/Zisgetsetdescriptorr3r r4rr.r*rA)�thingrrr�describe�s4







�
�





r4c	Cs�	dd�|�d�D�}d\}}|t|�kr4td�|d|d��|�}|r-||d}}nn|t|�ks|r9|}nt}||d�D]}zt||�}WqAtyUYdSw|S)NcSsg|]}|r|�qSrr)r�r�rrrr��rezlocate.<locals>.<listcomp>rr�rL)r"rOr�rPr�r#r8)r	r�rrr��nZ
nextmodulerr�rrr�locate�s$��r6cCsV	t|t�rt||�}|durtd|��||fSt|dd�}|t|t�r(|fSdfS)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+)rrBr6r�r#)r3r�rr&rrr�resolve�s

�r7� Python Library Documentation: %scCs�	|durt}t||�\}}t|�}t�|�}|r+d|vr+|d|d|�d��7}n
|r8||ur8|d|j7}t�|�s`t|�s`t�	|�s`t�
|�s`t|�s`t|d�rX|j
}nt|�}|d7}||d|�||�S)Nrz in z in module �
__origin__z objectr.)rXr7r4rrl�rfindr+rUrrVr2rDr�r9rAr�)r3r"r�Zrendererrr&r�r�rrr�
render_doc�s0

����
r;c
Csn	z|durtt|||��WdS|�t|||t��WdSttfy6}zt|�WYd}~dSd}~wwr)r�r;r�	plaintextr�r��print)r3r"r��outputrorrrr=�s��r=c
Cs�	z;t||�\}}t�t|�t�||��}t|dddd��
}|�|�Wd�n1s.wYtd|d�WdStt	fyU}zt|�WYd}~dSd}~ww)Nr�rr )rZwrote)
r7�htmlr$r4r�r�rr=r�r�)r3r�rr&r$r�rorrr�writedoc�s���r@rEcCs4	|duri}t�|g|�D]	\}}}t|�qdSr)rm�
walk_packagesr@)r�pkgpath�donerwrSrxrrr�	writedocs
s

rDc@s�eZdZidd�dd�dd�dd�dd�d	d
�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�id d!�d"d#�d$d%�dd&�d#d'�d(d)�d*d+�d,d-�d.d/�d0d�d1d�d2d3�d4d5�d6d7�dd8�d9d:�dd;��d<d=i�Zd>d?�d@D�ZdAdBdCdDge�RdEdFdGdHdIdJdK�ZdLdMdNdOdPdQdRdSdTdUdVdWdWdXdXdY�Ze��D]\ZZ	e	D]Z
e�e
e�Zeevr�edZeZeee
<q�q�id[d\�dSd]�d^d_�d`da�dbdc�ddde�dfdg�dhdi�djdk�dldm�dndo�dpdq�drds�dtdu�dvdw�dxd[�dyd[�idzd{�dPd|�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���id�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��dTd��d�d��d�dl�d�d��d�d��d�d��dod��d�d���id�d��d�d��d�d��d�d��dMd��d�d��d�d��d�dÓd�dœd+dƓddǓd�d	�d�dʓd�d̓d�d�d�d6�d�d#��dd�d�d�d�dԜ�Z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)��Helper�FalserE�None�True�andZBOOLEAN�as�with�assert)rLrE�async)rMrE�await)rNrE�break)rO�	while for�class)rQzCLASSES SPECIALMETHODS�continue)rRrP�def)�functionrE�del)rU�BASICMETHODS�elif�if�else)rYrP�except�try�finally�for)r]zbreak continue while�from�import�global)r`znonlocal NAMESPACES)rX�
TRUTHVALUE)r_�MODULES�in)rc�SEQUENCEMETHODS�is�
COMPARISON�lambda)rgr��nonlocal)rhzglobal NAMESPACES�not�or�pass)rkrE�raise)rl�
EXCEPTIONS�return)rnr�)r[rm�while)rozbreak continue if TRUTHVALUE)rKz CONTEXTMANAGERS EXCEPTIONS yield�yield)rprEcCsg|]}dD]}||�qqS)��'rAr)r��pr&rrrr�Er�zHelper.<listcomp>)r)�fr�urrz'''rAr�)�+r��*�**r�z//�%�<<�>>r�|�^�~rr
�<=�>=�==�!=�<>)rr
rr�r�r�r�)r�r~)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rzr{rr|r}r~)�j�J)�STRINGS�	OPERATORSrf�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTINGZPOWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classr�ZPRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)ryrx�,rr\�:�@r�r�r��`rBrR�[�]r��TYPES)rzRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPESZ
STRINGMETHODS)zstring-methodszSTRINGS FORMATTINGZ
FORMATTING)Z
formatstringsr��UNICODE)r�z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPESZNUMBERS)ZnumberszINTEGER FLOAT COMPLEX TYPESZINTEGER)Zintegersz	int range�FLOAT)Zfloatingz
float mathr�)Z	imaginaryz
complex cmathZ	SEQUENCES)Ztypesseqz$STRINGMETHODS FORMATTING range LISTSZMAPPINGSZDICTIONARIESr�)Ztypesfunctionsz	def TYPESZMETHODS)Ztypesmethodszclass def CLASSES TYPESZCODEOBJECTS)zbltin-code-objectszcompile FUNCTIONS TYPESZTYPEOBJECTS)zbltin-type-objectsztypes TYPESZFRAMEOBJECTSZ
TRACEBACKS�NONE)zbltin-null-objectrE)zbltin-ellipsis-object�SLICINGSZSPECIALATTRIBUTES)ZspecialattrsrEr�)rz!class SPECIALMETHODS PRIVATENAMESrb)Ztypesmodulesr_ZPACKAGES�EXPRESSIONS)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIESr�Z
PRECEDENCEZOBJECTS)Zobjectsr�ZSPECIALMETHODS)ZspecialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSESrV)Z
customizationzhash repr str SPECIALMETHODSZATTRIBUTEMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODSZCALLABLEMETHODS)zcallable-typeszCALLS SPECIALMETHODSrd)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODSZMAPPINGMETHODS)r�zMAPPINGS SPECIALMETHODS�
NUMBERMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODSZ	EXECUTION)Z	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONSZ
NAMESPACES)Znamingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURESZDYNAMICFEATURES)zdynamic-featuresrEZSCOPINGZFRAMESrm)r�ztry except finally raiseZCONVERSIONS)ZconversionsrEZIDENTIFIERS)Zidentifierszkeywords SPECIALIDENTIFIERSZSPECIALIDENTIFIERS)z
id-classesrE)zatom-identifiersrEZLITERALS)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALSZTUPLESZ
TUPLELITERALS)Z	exprlistszTUPLES LITERALSZLISTS)ztypesseq-mutable�LISTLITERALSr�)ZlistszLISTS LITERALS)Ztypesmapping�DICTIONARYLITERALSr�)r5zDICTIONARIES LITERALSZ
ATTRIBUTES)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODSZ
SUBSCRIPTS)Z
subscriptionsrdr�)ZslicingsrdZCALLS)Zcallsr�)Zpowerr�r�)Zunaryr�ZBINARY)�binaryr�ZSHIFTING)Zshiftingr�r�)Zbitwiser�)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEZ	ASSERTIONZ
ASSIGNMENT)Z
assignmentr�r�)Z	augassignr�ZDELETIONZ	RETURNINGZ	IMPORTING)Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersrK)ZCONDITIONALZLOOPINGraZ	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dSr)�_input�_output)r:�inputr>rrrr��s
zHelper.__init__cC�|jptjSr)r�rrr	rrrr���zHelper.inputcCr�r)r�rrr	rrrr>�r�z
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)NrLr[�?rEz<%s.%s instance>)r�stackr-r r!r	rrr�__repr__�s�zHelper.__repr__cCs8||jur|�|�dS|��|��|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:Zrequestrrr�__call__�s

zHelper.__call__c	Cs�|j�d�	z|�d�}|sWdSWnttfyYdSw|��}t|�dkrJ|d|dkr8dvrJnn|d|dd�vrJ|dd�}|��d	vrRdS|d
kr[|��n|�	|�q)NrKTzhelp> rMrrrqrL)r&�quitr)
r>r�getliner�EOFErrorrNrOr�r�rr�rrrr��s"
�,

�zHelper.interactcCs6	|jtjurt|�S|j�|�|j��|j��Sr)r�rrr>rr0r�)r:�promptrrrr��s

zHelper.getlinecCs8t|�td�ur�|��}|dkr|��n|dkr|��nv|dkr'|��nm|dkr0|��nd|dd�dkrB|�|��d�nR||jvrM|�|�nG|d	vrYt	t
|�d
�n;||jvrd|�|�n0||j
vro|�|�n%|rzt	|d
|jd�nt	td
|jd�nt|t�r�|�nt	|d
|jd�|j�d�dS)
NrE�keywords�symbols�topicsr�zmodules rL)rHrFrGzHelp on %s:)r>rK)rArN�listkeywords�listsymbols�
listtopics�listmodulesr"r��
showsymbolr=�evalr��	showtopicr�r�rBrrEr>rr�rrrr�s$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.%drM)r>rr�rr�r	rrrr�s�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D];}t|�D].}|||}|t|�krL|j�||�||dkrL|j�dd|dt||��q|j�d�qdS)NrLr�rK)r3r�rOr2r>r)	r:�items�columnsr+Zcolwr4�rowr5r�rrrr3%s$��zHelper.listcC� |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)r>rr3r�rkr	rrrr�2�zHelper.listkeywordscCr�)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)r>rr3r�rkr	rrrr�9szHelper.listsymbolscCr�)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)r>rr3r�rkr	rrrr�Ar�zHelper.listtopicscCs*zddl}Wnty|j�d�YdSw|j�||j�|��}|s0|j�dt|��dSt|�td�ur>|�	||�S|\}}z|jj|}Wnt
y^|j�dt|��YdSw|��d}|ro|pjdd|}|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
rErKr��Related help topics: rQ�Hz
%s
)�pydoc_data.topicsr�r>rr�rr�r�rAr��KeyErrorrN�textwraprPr"�wrapr�)r:�topic�
more_xrefs�
pydoc_data�target�label�xrefsr=r�rXZwrapped_textrrrr�Hs8��zHelper.showtopiccCs�	zddl}Wn
tyYdSw|j�||j�|��}|s#td��t|t�r.|�||�S|\}}|jj|}|rB|p=dd|}||fS)Nr)r�rEzcould not find topicrEr�)	r�r�r�rr�r�rrB�	_gettopic)r:r�r�r�r�r�r�r=rrrr�hs �
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)r��	partitionr�)r:�symbolr�r�r�r�rrrr��s
zHelper.showsymbolcsx|r|j�d�|��t|�dS|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...

cSsB|r|dd�dkr|dd�d}|�d�dkrd||<dSdS)N����	.__init__r�rrrL)�find)r	rSr�rrrr�callback�s
�z$Helper.listmodules.<locals>.callbackcs�d|d�dSrrr��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>rr��apropos�
ModuleScanner�runr3rk)r:rnrr�rr�rr��s�zHelper.listmodulesr�)r�r�r�)!r+r r!r�Z_strprefixesZ_symbols_inverser�r�r�Zsymbols_r�rr�r�r0r�r>r�rr�r�r�r�rr�r3r�r�r�r�r�r�r�rrrrrEs
��������	�
���
������������������� �!�"�#�'��
������	�
���
���������������� �!�"�%�&�'�(�*�+�-�.�/�0�1�2�3�4�5�6�7�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�
W


	



 rEc@seZdZ	ddd�ZdS)r�Nc	Cs�|r|��}d|_i}tjD]8}|dkrFd||<|dur#|d|d�qt|�jp)d}|�d�d}|d|}|���|�dkrF|d||�qtj	|d�D]�\}	}}
|jrWn�|durb|d|d�qMzt�
|	|�}Wn	tysYqMw|j}t
|d	�r�z|�|�}
Wnty�|r�||�YqMwtt�|
��p�d}t
|d
�r�|�|�}n-d}n*ztj�|�}Wnty�|r�||�YqMw|jr�|j��dnd}t|dd�}|d|}|���|�dkr�||||�qM|r�|�dSdS)NF�__main__rLrErKrr�r��
get_source�get_filenamer{)r�r�rr�r�r?r"r�rmrA�	_get_specr�r�r�r�r�r�r.�StringIOr�r�r�r�r�r�r#)r:r�rnZ	completerr��seenrSr&r�rwrxr�r��sourcer	r�rrrr��sj
��
�
��
�zModuleScanner.runr�)r+r r!r�rrrrr��sr�cCs\	dd�}dd�}t���t�d�t�j|||d�Wd�dS1s'wYdS)NcSs6|dd�dkr|dd�d}t||od|�dS�Nr�r�r�z- )r=�r	rSr�rrrr��szapropos.<locals>.callbackcS�dSrrr�rrrr��r�zapropos.<locals>.onerror�ignorer�)�warnings�catch_warnings�filterwarningsr�r�)rnr�r�rrrr��s

"�r�cs�	ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	sQ|j
sQt�d�|j	sQ|j
rF|S)	Nrc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsZ	|j�d�r
d}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)Nz.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8r )	r	r�Z
send_responseZsend_headerZend_headersZwfiler�
urlhandlerr!)r:�content_typerrr�do_GET0	s

��z(_start_server.<locals>.DocHandler.do_GETcWr�rr)r:r�rrr�log_message@	sz-_start_server.<locals>.DocHandler.log_messageN)r+r r!r�r�rrrr�
DocHandler.	sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�host�addressr�r<r��handlerr�)r:r��portr�rrrr�F	s

z)_start_server.<locals>.DocServer.__init__csB|js��|j��gggd�\}}}|r|��|jr|��dSrf)r��select�socketr-Zhandle_requestZserver_close)r:Zrd�wr�ex�r�rr�serve_until_quitM	s�z1_start_server.<locals>.DocServer.serve_until_quitcSs$|j�|�|jr|�|�dSdSr)r<�server_activater�r	rrrr�T	s�z0_start_server.<locals>.DocServer.server_activateN)r+r r!r�r�r�rr�rr�	DocServerD	sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�rGr��Threadr��serving�error)r:r�r�r�)�	threadingrrr�[	s

z,_start_server.<locals>.ServerThread.__init__c
s|	z&�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�WdSty=}z
||_WYd}~dSd}~wwr)�server�
HTTPServerr<r�r�ZMessageZMessageClass�staticmethodr�r�r��ready�	docserverr�r�r)r:Zdocsvr�e)r�r��email�httprrr�c	s

��z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)rr�Zserver_portr�r>)r:rrrrrp	sz)_start_server.<locals>.ServerThread.readycSs(	d|j_|��d|_d|_d|_dS)NTF)rr�rPrr>r	rrr�stopv	s
z(_start_server.<locals>.ServerThread.stopN)r+r r!r�r�rrr)r�r�r	r
rrr�ServerThreadY	s

rg{�G�z�?)
Zhttp.serverZ
email.messager�rrZBaseHTTPRequestHandlerrr�rMrr�time�sleep)r��hostnamer�r�threadr)r�r�r	r
r�rr�
_start_server�s7'
�rr�cs.	G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�rV|dd�}|dkr�tj�tj�t��}tj�||�}t|��}d�|�	��Wd�S1s�wYn|dkr�||�St
d||f��)NcseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccs 	d}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$�	s���z#_url_handler.<locals>._HTMLDoc.pageN)r+r r!r$rrrr�_HTMLDoc�	srcs>��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)rrZpython_versionZpython_buildZpython_compiler)rt�r?rrr�	s
��z!_url_handler.<locals>.html_navbarcs�	dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��q+|�d�dd
�|�fS)NcS�d||fSr;r�r&rrr�	bltinlink�	rz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>r^r_cSsg|]}|dkr|�qS)r�r)r�r&rrrr��	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 ModulesrE)	r)rr�r6r-r	rr�rP)rr)�namesr#r�rrrr�
html_index�	s$��
�z _url_handler.<locals>.html_indexc		s�	g��fdd�}t���t�d�dd�}t�j|||d�Wd�n1s*wYdd�}g}��d	d
d�}�D]
\}}|�||�|�q>|��d|d
d
d�|��}d|fS)Ncs:|dd�dkr|dd�d}��||od|f�dSr�rpr��Z
search_resultrrr��	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSr�rrr�rrrr��	r�z2_url_handler.<locals>.html_search.<locals>.onerrorr�cSrr;rrrrrr�	rz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>r^r_zkey = %srf�<br>zSearch Results)	r�r�r�r�r�r)rr-rP)	rnr�r�rr�r)r&r�r#rrr�html_search�	s(

���z!_url_handler.<locals>.html_searchcsN	dd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)NcSr�Nz<a href="topic?key=%s">%s</a>rrrrrr�	rz4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>r^r_ZTopicsrf)r)r�rEr�rkr6r-)rr)rr#rrr�html_topics�	s��z!_url_handler.<locals>.html_topicscsN	��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)Nr r^r_cSrrrrrrrr
rz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsrf)r)r�rEr�rkr6r-)r)rrr#rrr�
html_keywords
s��z#_url_handler.<locals>.html_keywordscs�	t��}t||�}|�|�\}}||jvrd}nd}��d|dd�}d��|�}��|dd|�}|rMt|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
NZKEYWORDZTOPICrZr^r_z
<pre>%s</pre>rfcSrrrrrrrr&
rz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkr�z%s %srE)
r.r�rEr�r�r)rPr-r�r"r6r,rP)r��bufZhtmlhelpr#r�r"r)rrrr�html_topicpage
s.

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dur|dkrtd��t|�}��||�}||fS)NrL)r�rGzcould not find object)r6r�r4r�)r>r9r"�contentrrr�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>r^r_rc3s�|]}��|�VqdSr)rr�rrrr�;
r�z3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)r)rPrrAr-)r>r�r)r#rrr�
html_error7
s���z _url_handler.<locals>.html_errorc
sb	|}|�d�r|dd�}z�|dvr��\}}nw|dkr#��\}}nm|dkr-��\}}ncd|vr�|�d�\}}}|dkrD�|�\}}nL|dkr`z�|�\}}Wn?ty_�|�\}}Yn1w|d	kr�|dvrn��\}}n"z�|�\}}Wnty��|�\}}Ynwtd
���|�\}}Wnty�}z
�||�\}}WYd}~nd}~ww��||�S)Nr����)rEr�r�r�r�z
search?keyz	topic?keyzget?keyz
bad pydoc url)r�r�r�r�r$)r>Zcomplete_urlr"r%�opr�r�)r?r'r&rr"rr$r!rr�
get_html_pageA
sJ
�����z#_url_handler.<locals>.get_html_pager�rLr�rEr�z"unknown content type %r for url %s)r r�r
r	�dirname�realpathr{rPr��	readlinesrC)r>r�rr*Z	path_herer�fpr)	r?r'r&rr"rrr$r!r�_url_handler�	s.

(
"�r/T�	localhost)�open_browserrc	Cs�	ddl}tt||�}|jrt|j�dS|jr}d}|r"|�|j�zMz.td|j�t|�|jrPtd�}|�	�}|dkr>n|dkrI|�|j�nt|�|js1Wnt
tfy_t�YnwW|jrn|��td�dSdS|jr||��td�wwdS)Nrz"Server commands: [b]rowser, [q]uitzServer ready atzserver> r&r)zServer stopped)
�
webbrowserrr/rr=rr�r>r�r�rr�r)r�r1rr2ZserverthreadZserver_help_msgrrrr�browsev
sF
��	
��
�
��r3cCst|t�o|�tj�dkSr�)rrBr�r
�sep)rtrrr�ispath�
sr5cCsx	d|vstj|vst��|vrdStj�t�}tj�|�}|��}||vr2tj�||�s2|�|�|�	dt���|S)NrEr)
r
�curdir�getcwdr	r+r{�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path�
s
r=cCs2	ttjtjd�}|dur|tjdd�<dSdSr�)r=rr	�argv)r<rrr�_adjust_cli_sys_path�
s
�r?cCs�	ddl}Gdd�dt�}t�z�|�tjdd�d�\}}d}d}d}d}d}|D].\}	}
|	dkr6d	}d	}|	d
krBt|
�WdS|	dkrJd	}|
}|	dkrPd	}|	d
krXd	}|
}q*|ret|||d�WdS|si|�|D]W}t|�r�tj	�
|�s�td|�WdSz+t|�r�tj	�|�r�t
|�}|r�t|�r�tj	�|�r�t|�n
t|�nt�|�Wqkty�}z
t|�WYd}~qkd}~wwWdS|j|fy�tj	�tj	�tjd��d}
tdj|
tjd��YdSw)Nrc@seZdZdS)zcli.<locals>.BadUsageN)r+r r!rrrr�BadUsage�
r�r@rLzbk:n:p:wFr0z-bTz-kz-pz-wz-n)rr1zfile %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.
)rr4)�getoptr�r?rr>r�r3r5r
r	�existsr=r�r�r
rDr@rr�rr�r�r�r4)rAr@Zoptsr��writingZstart_serverr1r�r�opt�val�argrorrrr�cli�
sn�


������rGr�r�)r)r8rN)rEN)r�)_rgr}ryrvr�Zimportlib._bootstrapr�Zimportlib._bootstrap_external�importlib.machinery�importlib.utilrr.r
rmrrFrr�r
r�r�urllib.parserhr��collectionsr�reprlibr�	tracebackrrrr'r>r7rDrJrRrTrWrZr`rC�
IGNORECASErarcrerjrur�r�r�r�r�r�r�r�r�r�r�r�r r�r�r�r�r�r�rr�r#r
rr4r6rXr<r?r7r;r=r@rDrErr�r�rr/r3r5r=r?rGr+rrrr�<module>s�&

3	


'
0:*; ",


�
�

=
n%

U
�