Hacked By AnonymousFox

Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/pydoc.cpython-312.opt-1.pyc

�

�Q�f����dZdgZdZdZdZddlZddlZddlZddl	Zddl
ZddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd	lmZd
�Zd�Z d�Z!d
�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*ejVdejX�Z-d�Z.d�Z/d�Z0d�Z1e2ejf�Z4dPd�Z5d�Z6d�Z7d�Z8d�Z9ifd �Z:Gd!�d"e;�Z<d#�Z=difd$�Z>Gd%�d&�Z?Gd'�d(e�Z@Gd)�d*e?�ZAGd+�d,e�ZBGd-�d.e?�ZCGd/�d0eC�ZDd1�aEd2�ZFd3�ZGd4�ZHd5�ZId6�ZJd7�ZKd8�ZLd9�ZMdQd:�ZNeC�ZOeD�ZPeA�ZQdQd;�ZR		dRd<�ZS		dSd=�ZTdQd>�ZUdTd?�ZVGd@�dA�ZWeW�ZXGdB�dC�ZYdD�ZZdE�Z[dUdF�Z\dQdGdHdI�dJ�Z]dK�Z^dL�Z_dM�Z`dN�ZaebdOk(rea�yy)VaGenerate 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_onlyc�J�g}g}tjD]�}tjj|xsd�}tjj	|�}||vs�Jtjj|�s�j|j
|�|j
|���|S)zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirs�normdirs�dir�normdirs    �,/opt/alt/python312/lib64/python3.12/pydoc.py�pathdirsrRsz��
�D��H��x�x���g�g�o�o�c�j�S�)���'�'�"�"�3�'���(�"�r�w�w�}�}�S�'9��K�K����O�O�G�$���K�c���tjj|j�}|�y|jjd�ddD]}t
||�}�tj|�sy|S)Nr���)	r	�modules�get�
__module__�__qualname__�split�getattr�inspect�isclass)�func�cls�names   r�
_findclassr$^sb��

�+�+�/�/�$�/�/�
*�C�
�{���!�!�'�'��,�S�b�1���c�4� ��2��?�?�3����Jrc�~�tj|�rl|jj}|j}tj
|�r't
t
||d�d�|jur|}�n�|j}�n�tj|�r)|j}t|�}|�t
||�|u�rCytj|�r\|j}|j}tj
|�r"|jdz|z|jk(r|}n�|j}n�t|t�r4|j}|j}t|�}|�t
||�|ur�ytj|�stj |�rb|j}|j"}t
||�|urytj$|�r't
|dd�}t|t&�r
||vr||Sy|j(D]}	t+t
||��}|��|cSy#t,$rY�-wxYw)N�__func__r�	__slots__)r�ismethodr&�__name__�__self__r r�	__class__�
isfunctionr$�	isbuiltinr�
isinstance�property�fget�ismethoddescriptor�isdatadescriptor�__objclass__�ismemberdescriptor�dict�__mro__�
_getowndoc�AttributeError)�objr#�selfr"r!�slots�base�docs        r�_finddocr>hs���������|�|�$�$���|�|���O�O�D�!��G�D�$��-�z�:�c�l�l�J��C��.�.�C�	�	�	�C�	 ��|�|����o���;�'�#�t�,�C�7��	�	�	�3�	��|�|���|�|���O�O�D�!�����#�d�*�c�.>�.>�>��C��.�.�C�	�C��	"��x�x���}�}�������;�'�#�t�,�C�7��	�	#�	#�C�	(�G�,D�,D�S�,I��|�|�������3���S�(���%�%�c�*��C��d�3�E��%��&�4�5�=��T�{�"������	��W�T�4�0�1�C��?��J�
���	�	��	�s�H0�0	H<�;H<c��	tj|d�}|�y|tur+t|�j}t	|t
�r||k(ry|S#t$rYywxYw)zUGet the documentation string for an object if it is not
    inherited from its class.�__doc__N)�object�__getattribute__�typer@r.�strr8)r9r=�typedocs   rr7r7�sa��
��%�%�c�9�5���;���d�?��3�i�'�'�G��'�3�'�G�s�N���
������s�A�2A�A�	A�Ac��t|�}|�	t|�}t	|t
�syt
j|�S#ttf$rYywxYw)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)r7r>r8�	TypeErrorr.rDr�cleandoc)rAr=s  r�_getdocrI�s[���V�
�C�
�{�	��6�"�C��c�3������C� � ��	�	�*�	��	�s�A�A�Ac��t|�xstj|�}|xr%tjdd|j��xsdS)z-Get the doc string or comments for an object.z^ *
�)rIr�getcomments�re�sub�rstrip)rA�results  r�getdocrQ�s>��
�V�_�
;�� 3� 3�F� ;�F��:�b�f�f�W�b�&�-�-�/�:�@�b�@rc��|j�jd�}t|�dk(r|ddfSt|�dk\r,|dj�s|ddj	|dd�fSddj	|�fS)z>Split a doc string into a synopsis line (if any) and the rest.�
�rrK�N)�stripr�lenrO�join)r=�liness  r�splitdocrZ�s{���I�I�K���d�#�E�
�5�z�Q���Q�x��|��	�U��q���q����!2��Q�x����5���9�-�-�-�
�t�y�y����rc�`�|j}|j|k7r|jdz|z}|S)z@Get a class name and qualify it with a module name if necessary.r)r)r�rA�modnamer#s   r�	classnamer^�s3���?�?�D�
���G�#�� � �3�&��-���Krc���d|jvrA|jjd�d}|j|k7r|jdz|zS|S|j|k7r|jSy)z_Get a name of the enclosing class (qualified it with a module name
    if necessary) or module.rrN)r�
rpartitionrr\s   r�
parentnamera�su���f�!�!�!��"�"�-�-�c�2�1�5������'��$�$�s�*�T�1�1��K�����'��$�$�$�(rc��tj|�xsqtj|�xsZtj|�xsCtj|�xs,tj
|�xstj|�S)z>Check if an object is of a type that probably means it's data.)r�ismoduler �	isroutine�isframe�istraceback�iscode)rAs r�isdatarh�sy��� � ��(�F�G�O�O�F�,C�F��!�!�&�)�F�-4�_�_�V�-D�F��#�#�F�+�F�/6�~�~�f�/E�G�Grc�f�|r.|dj|j|d��}|dd}|r�.|S)z/Do a series of global replacements on a string.rTrrUN)rXr)�text�pairss  r�replacerl�s;��
��Q�x�}�}�T�Z�Z��a��1�2���a�b�	����Krc��t|�|kDr>td|dz
dz�}td|dz
|z
�}|d|dz|t|�|z
dzS|S)zCOmit part of a string if needed to make it fit in a maximum length.r�rUN�...)rW�max)rj�maxlen�pre�posts    r�cramrt�s`��
�4�y�6���!�f�Q�h��]�#���1�f�Q�h�s�l�#���D�S�z�E�!�D��T��4���$9�9�9��Krz at 0x[0-9a-f]{6,16}(>+)$c�.�tjd|�S)z>Remove the hexadecimal id from a Python object representation.z\1)�_re_stripidrN�rjs r�stripidrx�s���?�?�5�$�'�'rc��tj|�rytj|�r)t|dd�}tj|�xs|duSy)zo
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    Tr*NF)rr(r-rrc)�fnr:s  r�_is_bound_methodr{�sQ��
������������r�:�t�,���$�$�T�*�<�t�t�|�=�=�rc�
�i}tj|tj�D]
\}}d||<�|jD]}|j	t|���|j
�D]}t||�||<�|S�NrT)r�
getmembersrd�	__bases__�update�
allmethods�keysr)�cl�methods�key�valuer<s     rr�r�sv���G��(�(��W�->�->�?�
��U�����@��������z�$�'�(���|�|�~���r�3�'������Nrc�v�g}g}|D]-}||�r|j|��|j|��/||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�	predicate�yes�no�xs     r�_split_listr�s@��
�C�	�B�
���Q�<��J�J�q�M��I�I�a�L�	�
��7�Nrc�*�|dvry|jd�r|jd�ry|jd�r
t|d�ry|tur.|tvr&tt
||d�tj�ry	|�||vS|jd�S)
z3Decide whether to show documentation on a variable.>r@�__date__�__file__r)�__path__�__spec__r'�
__author__�
__cached__�
__loader__r�__credits__�__package__�__version__�__builtins__rr�__rT�_�_fieldsTNF)�
startswith�endswith�hasattr�
__future__�_future_feature_namesr.r�_Feature)r#�allr9s   r�visiblenamer�!s����H�H�����t�����t�!4�Q����s����Y� 7��
�*���)>�!>��g�c�4��.�
�0C�0C�D��
���s�{���?�?�3�'�'�'rc��g}tj|�D]d\}}}}tj|�r!d}t|t�r!|j
�d}n|dk(r
t
|�rd}|j||||f��f|S)zUWrap inspect.classify_class_attrs, with fixup for data descriptors and bound methods.�data descriptor�readonly property�method�
static method)r�classify_class_attrsr2r.r/�fsetr{r)rA�resultsr#�kindr"r�s      rr�r�9s����G�$+�$@�$@��$H� ��t�S�%��#�#�E�*�$�D��%��*�u�z�z�/A�*��
�X�
�"2�5�"9�"�D�����d�C��/�0�%I��Nrc	����t|dg�}	t|�D��cic]\}}||t|�z
��c}}��fd�}|j	|��ycc}}w#t$ri�Y�+wxYw)zGSort the attrs list in-place by _fields and then alphabetically by namer�c�8���j|dd�|dfS�Nr)r)�attr�field_orders �r�<lambda>z!sort_attributes.<locals>.<lambda>Os���K�O�O�D��G�Q�7��a��Ar�r�N)r�	enumeraterWrG�sort)�attrsrA�fields�ir#�keyfuncr�s      @r�sort_attributesr�Fst����V�Y��
+�F��=F�v�=N�O�=N�	��D�t�a��F��m�+�=N�O��B�G�	�J�J�7�J���	P�������s!�A�A�A�A�A'�&A'c���tjj|�rIdD]D}tjjtjj	|d|z��s�Dyy)z3Guess whether a path refers to a package directory.)z.pyz.pyc�__init__TF)rr
r�isfilerX)r
�exts  r�	ispackager�TsH��	�w�w�}�}�T��"�C��w�w�~�~�b�g�g�l�l�4��c�1A�B�C��#�rc���|j�}|dddk(s|j�s-|j�}|sn|dddk(r�|j�s�-|j�}|dddk(r|dd}|dddk(rj|dd}|dddk(r|dd}|j�s$|j�}|sn|j�s�$|jd�d	j�}|Sd}|S)
NrT�#�zr"""rn�"""r�\r)�readlinerVr)�file�linerPs   r�source_synopsisr�\s����=�=�?�D�
�r��(�c�/������}�}����U��r��(�c�/������:�:�<�D��B�Q�x�6��$�q�r�(�4��B�Q�x�5���A�B�x�����9���T�#�2�Y�d��*�*�,��=�=�?�D����*�*�,����E�"�1�%�+�+�-���M��&��Mrc�t�tj|�j}|j|d�\}}|�||k�rY|j	ttjj��rtjj}nO|j	ttjj��rtjj}nd}|�-	tj|�}|5t|�}ddd�n�|d|�}tj j#d||��}	tj$j'|�}	t(j*d=|	j,r|	j,j/�dnd}||f||<|S#t$rYywxYw#1swY�!xYw#YyxYw)z.Get the one-line summary out of a module file.�NNN�__temp__��loaderr)r�stat�st_mtimerr��tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr	rr@�
splitlines)
�filename�cache�mtime�
lastupdaterP�
loader_clsr�r��spec�modules
          r�synopsisr�msz���G�G�H��&�&�E����8�\�:��J����Z�%�/����U�9�#6�#6�#H�#H�I�J�"�,�,�A�A�J�
�
�
�u�Y�%8�%8�%K�%K�L�
M�"�,�,�@�@�J��J���
��}�}�X�.��
�(��.���� �
�H�5�F��>�>�9�9�*�h�AG�:�I�D�
�"�-�-�3�3�D�9�����J�'�7=�~�~�V�^�^�.�.�0��3�4�F� �&�/��h���M��)�
��
�����
��s*�F�3F'�4F3�	F$�#F$�'F0�3F7c��eZdZdZd�Zd�Zy)�ErrorDuringImportzEErrors that occurred while trying to import something to document it.c���t|t�s0t|�|_||_|j
|_||_
ytjdt�|\|_|_|_||_
y)NzCA tuple value for exc_info is deprecated, use an exception instance)r.r�rC�excr��
__traceback__�tb�warnings�warn�DeprecationWarningr�)r:r��exc_infos   rr�zErrorDuringImport.__init__�sc���(�E�*��H�~�D�H�!�D�J��,�,�D�G�!��
�	
�M�M�_�,�
.�-5�)�D�H�d�j�$�'� ��
rc�l�|jj}d|j�d|�d|j��S)Nzproblem in � - z: )r�r)r�r�)r:r�s  r�__str__zErrorDuringImport.__str__�s&���h�h����+/�=�=�#�t�z�z�J�JrN)r)rrr@r�r��rrr�r��s��O�!�Krr�c�x�tjj}t|d�5}||j	t|��k(}ddd�tjj|�}tjj|�\}}r!tjj||�}n tjj||�}tjj|||��}	tjj|�S#1swY��xYw#t $r}	t#||	��d}	~	wwxYw)z<Import a Python source file or compiled file given its path.�rbNr�)r�r��MAGIC_NUMBERr��readrWrr
�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r��
BaseExceptionr�)
r
�magicr��is_bytecoder�r#r�r�r��errs
          r�
importfiler�s����N�N�'�'�E�	
�d�D�	�T��t�y�y��U��4�4��
��w�w����%�H���� � ��*�I�D�#���.�.�C�C�D�$�O���.�.�?�?��d�K���>�>�1�1�$��V�1�L�D�+��#�#�)�)�$�/�/�
�	���+���c�*�*��+�s#�D�4D�D�	D9�(D4�4D9c��	|r�|tjvrv|tjvrdtjD�cgc]}|j|dz�s�|��}}|g|zD])}tj|||<tj|=�+t	j
|�}|Scc}w#t$r�}|tjvr'ttj|j|��t|�turt|j|��t|t�r|j|k(rYd}~yt||��d}~wwxYw)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).rN)r	r�builtin_module_namesr�r��
import_moduler�r�r�rC�SyntaxErrorr�r.�ImportErrorr#)r
�	forceloadr��m�subsr�r�rs        r�
safeimportr�s��/�
�����,��3�3�3�3�$'�;�;�K�;�a�!�,�,�t�c�z�2J��;��K� �6�D�=�C�!$���S�!1�E�#�J����C�(�)��(�(��.���M��)L���
/��3�;�;��#�C�K�K��$5�$>�$>��D�D�
�#�Y�+�
%�#�C�L�L�#�6�6�
��[�
)�c�h�h�$�.>��$�D�#�.�.��
/�s6�8B(�B#�B#�A	B(�#B(�(	E�1A?E�5E�Ec��eZdZejjddejddz�Zd	d�Z	d	d�Z
e
xZxZxZ
xZxZZej$d�fd�Zy)
�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrUc�p�||f|z}	tj|�r|j|�Stj|�r|j|�Stj
|�r|j|�S	tj|�r|j|�S|j|�S#t$rY�>wxYw)z%Generate documentation for an object.)rrc�	docmoduler �docclassrd�
docroutiner8r2�docdata�docother)r:rAr#�argss    r�documentzDoc.document�s�����~��$��
	�����'������0E�)E����v�&�}�t�}�}�d�/C�(C�� � ��(�����$�1G�*G�(��#�#�F�+�L�D�L�L�$�4G�-G��t�}�}�d�#�#���	��	�s�#B)�#B)�#B)�)	B5�4B5c�n�d|xrdt|�z�dt|�j��}t|��)z+Raise an exception for unimplemented types.z!don't know how to document object� z	 of type )�reprrCr)rG)r:rAr#r�messages     r�failzDoc.fail�s6��
�%�S�4��:�%�%�t�F�|�'<�'<�>���� � r�stdlibc���	tj|�}tjjd|j�}tjj|�}t|tt��r�|jdvs@|j|�r�|jtjj|d��s�|jdvr�|jd�r;dj|jd�|jj!��}|Stjj||jj!�d	z�}|Sd
}|S#t$rd}Y��YwxYw)z*Return the location of module docs or None�
(built-in)r)	�errno�
exceptions�gc�marshal�posix�signalr	�_thread�	zipimportz
site-packages)z	xml.etreeztest.test_pydoc.pydoc_mod)zhttp://zhttps://z
{}/{}.html�/�.htmlN)r�
getabsfilerGr�environrrr
r
r.rCr)r�rX�formatrO�lower)r:rA�basedirr��doclocs     r�	getdoclocz
Doc.getdoclocs)��	 ��%�%�f�-�D�������d�o�o�>���'�'�"�"�7�+���v�t�B�x�(�
�_�_�!9�9��o�o�g�&��/�/�"�'�'�,�,�w��"H�I��O�O�#M�M�� � �!8�9�%�,�,�V�]�]�3�-?����AV�AV�AX�Y��
�
������f�f�o�o�.C�.C�.E��.O�P���
��F��
��'�	 ��D�	 �s�E"�"E1�0E1�N)r)rrrr+rr	�version_inforrrrrrr�docpropertyr�	sysconfig�get_pathr0r�rrrr�so�������� G�"%�"2�"2�2�A�"6�!7�8�J�$� !�LP�O�I�O��O�:�O��O�;��(:�	�(:�(:�8�(D�rrc�<�eZdZdZd�Zd�Zd�Zd�Zd�ZeZ	d�Z
eZy)	�HTMLReprzBClass for safely making an HTML representation of a Python object.c�t�tj|�dx|_|_d|_dx|_|_y�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r:s rr�zHTMLRepr.__init__!�1���
�
�d��')�)���t�}����),�,����rc	�$�t|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)rl�r:rjs  r�escapezHTMLRepr.escape's���t�S�'�3���V�D�Drc�.�tj||�Sr1)rr�r:rAs  rrz
HTMLRepr.repr*s���y�y��v�&�&rc	�B�tt|�d�rTddjt|�jj	��z}t||�rt||�||�S|j
ttt|��|j��S�Nr)�repr_r�)r�rCrXr)rrrJrtrxrrB�r:r��level�
methodnames    r�repr1zHTMLRepr.repr1-sy���4��7�J�'� �3�8�8�D��G�,<�,<�,B�,B�,D�#E�E�J��t�Z�(�0�w�t�Z�0��E�:�:��{�{�4���Q�� 0�$�-�-�@�A�Arc��t||j�}t|�}d|vr/dt|dd�vr d|dz|j	|�z|dzStjdd|j	|��S)Nr��\\rK�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<span class="repr">\1</span>)rtrArrlrJrMrN�r:r�rQ�test�testreprs     r�repr_stringzHTMLRepr.repr_string4s}���A�t�~�~�&����:���4�<�D���%��(D�D���!��$�t�{�{�4�'8�8�8�A�;�F�F��v�v�F�5��k�k�(�+�-�	-rc	���	|jttt|��|j��S#|jd|j
jz�cYSxYw�Nz
<%s instance>)rJrtrxrrAr+r)�r:r�rQs   r�
repr_instancezHTMLRepr.repr_instanceAsQ��	G��;�;�t�G�D��G�$4�d�n�n�E�F�F��	G��;�;�����1E�1E�E�F�F�s	�69�*A%N)r)rrr@r�rJrrSrZ�repr_strr^�repr_unicoder�rrr7r7s4��L�-�E�'�B�	-��H�G��Lrr7c��eZdZdZe�ZejZejZd�Zdd�Z			dd�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zdiiifd�Zdd�Zdd�Zddiifd�Zd�Zddiiiddfd�Zdd�ZeZdd�Zdd�Zy)�HTMLDocz'Formatter class for HTML documentation.c��d|�d|�d�S)�Format an HTML page.zN<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Python: z</title>
</head><body>
z
</body></html>r�)r:�title�contentss   r�pagezHTMLDoc.pageRs���H�&�	&rc��d|�d|xsd�d�S)zFormat a page heading.zU
<table class="heading">
<tr class="heading-text decor">
<td class="title">&nbsp;<br>z</td>
<td class="extra">�&nbsp;z</td></tr></table>
    r�)r:re�extrass   r�headingzHTMLDoc.heading^s���&�$�H�$�&�	&rNc��|�dd|zzdz}d|�d|�d�}|r|d|�d|�d	|�d
|�d|�d�z}n|d|�d
|�d|�d�z}|d|zzS)z Format a section with a heading.z<span class="code">riz</span>z-<p>
<table class="section">
<tr class="decor zD-decor heading-text">
<td class="section-title" colspan=3>&nbsp;<br>z</td></tr>
    z
<tr><td class="decor z-decor" rowspan=2>z</td>
<td class="decor z-decor" colspan=2>z</td></tr>
<tr><td>�</td>z-decor">z	</td><td>z.
<td class="singlecolumn">%s</td></tr></table>r�)	r:rer"rf�width�prelude�
marginalia�gaprPs	         r�sectionzHTMLDoc.sectiongs{����.��E�1A�A�I�M�J��
��	��
���:�s�G�S�:�:�F�
�8;�Z��N�N�F��I�H�T�T�Trc�2�d|z}|j|g|���S)z$Format a section with a big heading.z&<strong class="bigsection">%s</strong>)rr)r:rers   r�
bigsectionzHTMLDoc.bigsection|s"��8�5�@���t�|�|�E�)�D�)�)rc�f�|j|j��}t|dddddddd�	S)z!Format literal preformatted text.�

z
 
rrirS�<br>
)rJ�
expandtabsrlrIs  r�	preformatzHTMLDoc.preformat�s7���{�{�4�?�?�,�-���t�V�W�f�g� �(�D�(�<�	<rc���d}t|�dzdz}td�D]F}|dz}t||z||z|z�D]"}|t|�ks�||||�zdz}�$|dz}�Hd|zS)z0Format a list of items into a multi-column list.rKrnr�z<td class="multicolumn">rwrmz<table><tr>%s</tr></table>)rW�range)r:�listr,rP�rows�colr�s       r�multicolumnzHTMLDoc.multicolumn�s������D�	�A�
�!�#����8�C��8�8�F��4��8�T�#�X�d�]�3���s�4�y�=�#�f�T�!�W�o�5��@�F�4��g�%�F��,�f�4�4rc��d|zS)Nz<span class="grey">%s</span>r�rIs  r�greyzHTMLDoc.grey�s
��!?�$�!F�Frc�8�|D]}||vs�d||�d|�d�cS|S)z:Make a link for an identifier, given name-to-URL mappings.�	<a href="�">�</a>r�)r:r#�dictsr5s    r�namelinkzHTMLDoc.namelink�s)���D��t�|�04�T�
�D�A�A���rc	��|jtjj|j�}}t||�r.t
||�|ur d|j�d|�dt||��d�St||�S)zMake a link for a class.r��.html#r�r�)r)r	rrrr�rr^)r:rAr]r#r�s     r�	classlinkzHTMLDoc.classlink�se�����������8I�8I�(J�f���6�4� �W�V�T�%:�f�%D�����y���'A�C�
C����)�)rc���d}|jtjj|j�}}t||�rt
||�|urqd|jvrE|jjd�d}|j|k7r|j�d|��}n$d|z}n|j|k7rd|jz}|rd|�dt||��d	�St||�S)
z.Make a link for the enclosing class or module.Nrrr�z#%s�%s.htmlr�r�r�)
r)r	rrrr�rrr`ra)r:rAr]�linkr#r�s      r�
parentlinkzHTMLDoc.parentlink�s��������������8I�8I�(J�f���6�4� �W�V�T�%:�f�%D��f�)�)�)��*�*�5�5�c�:�1�=���$�$��/�+1�?�?�D�A�D� �4�<�D��$�$��/�$�v���6�D��,0�*�V�W�2M�N�N��f�g�.�.rc�<�d|j�d|j�d�S)zMake a link for a module.r��.html">r�)r)rLs  r�
modulelinkzHTMLDoc.modulelink�s��-3�_�_�f�o�o�N�Nrc�|�|\}}}}|r|j|�S|r	|�d|�d�}nd|z}|rd|z}n|}d|�d|�d�S)z;Make a link for a module or package to display in an index.rr)r�z"<strong>%s</strong>&nbsp;(package)r�r�r�)r�)r:�
modpkginfor#r
r��shadowed�urlrjs        r�
modpkglinkzHTMLDoc.modpkglink�sV��*4�'��d�I�x���9�9�T�?�"��"&��-�C��d�"�C��7�$�>�D��D��(+�T�2�2rc��d|�d|�d�S)zMake a link to source file.z<a href="file:r�r�r�)r:r�r
s   r�filelinkzHTMLDoc.filelink�s
��-0�$�7�7rc���|xs|j}g}d}tjd�}|j||�x}	�r�|	j	�\}
}|j||||
��|	j
�\}}
}}}}|
r1||�jdd�}|jd|�d|�d��n�|r-dt|�z}|jd|�d||��d��n�|r-d	t|�z}|jd|�d||��d��n�|rE|||d
zdk(r%|jd|j||�z�ne|jd
|z�nP|||d
zdk(r$|j|j||||��n!|j|j||��|}|j||�x}	r���|j|||d��dj|�S)z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzJ\b((http|https|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;r�r�r�z(https://www.rfc-editor.org/rfc/rfc%d.txtz!https://peps.python.org/pep-%04d/rT�(zself.zself.<strong>%s</strong>NrK)rJrM�compile�search�spanr�groupsrl�intr�rX)r:rjrJ�funcs�classesr�r��here�pattern�match�start�endr��scheme�rfc�pep�selfdotr#r�s                   r�markupzHTMLDoc.markup�s����&�4�;�;�������*�*�3�4���~�~�d�D�1�1�e�1�����J�E�3��N�N�6�$�t�E�"2�3�4�38�<�<�>�0�C���c�7�D���S�k�)�)�#�x�8������S�A�B��@�3�s�8�K������V�C�[�I�J��9�C��H�D������V�C�[�I�J����C��E�?�c�)��N�N�7�T�]�]�4��-I�#I�J��N�N�#=��#D�E��c�#�a�%��C�'����t�}�}�T�7�E�7�K�L����t�}�}�T�7�;�<��D�3�~�~�d�D�1�1�e�1�4	���v�d�4�5�k�*�+��w�w�w��rc�t�d}|D]�}t|t�rq|\}}|dz}||j||�z}|rJ||fk7rDg}|D]#}	|j|j|	|���%|dzdj	|�zdz}|dz}��t|t
�s��|d|j
||�zz}��d|zS)	zAProduce HTML for a class tree as given by inspect.getclasstree().rKz<dt class="heading-text">r��, �)z
</dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r.r�r�rrXr|�
formattree)
r:�treer]�parentrP�entry�c�bases�parentsr<s
          rr�zHTMLDoc.formattree�s������E��%��'� ���5��"=�=���$�.�.��G�"<�<���U�v�i�/� �G� %�����t�~�~�d�G�'D�E�!&�#�c�\�D�I�I�g�,>�>��D�F��)�+���E�4�(��"3�d�o�o��7�A�7'�#'�'���!�6�)�)rc
��
��|j}	|j}|jd�}g}t	t|�dz
�D]2}|j
ddj|d|dz��d||�d���4dj||ddz�}	d|	z}
	tj|�}tjj|�}�j||�}
g}t|d
�r[t!|j"�}|dddk(r|ddd
k(r|ddj%�}|j
d�j'|�z�t|d�r3|j
�j't!|j(���|r|
ddj|�zz}
�j+|�}|�dt-�z}nd}�j/|
d|
z|z�}tj0|tj2�}gi}}tj0|tj4�D]Q\}}|�tj6|�xs||us�$t9|||�s�2|j
||f�d|zx||<||<�S|D]�\}}|j:D]s}|j|j<}}t>j@jC|�}||k7s�@|s�Ct||�s�PtE||�|us�_||vs�d|dz|zx||<||<�u��gi}}tj0|tjF�D]{\}}|�-tjH|�stj6|�|us�5t9|||�s�C|j
||f�d|z||<tjJ|�s�t||||<�}g}tj0|tL�D]&\}}t9|||�s�|j
||f��(�jOtQ|��jR||�}|xrd|z}|d|zz}t|d�r�g}tUjV|jX�D]\}}} |j
||| df��|j[��j]|�j^�}!|�jadd|!�z}n-|r+�j]|�fd��}!|�jadd|!�z}|r�|D��cgc]\}}|��	}"}}�jctjd|"d�|�g}!|D])\}}|!j
�jg|||||���+|�jad d!d"j|!��z}|rUg}!|D])\}}|!j
�jg|||||���+|�jad#d$d"j|!��z}|rRg}!|D]&\}}|!j
�jg||���(|�jad%d&d'j|!��z}t|d(�rE�jOt!|jh��jR�}!|�jad)d*|!�z}t|d+�rE�jOt!|jj��jR�}!|�jad,d-|!�z}|S#t$rd}Y���wxYw#t$rd	}
Y��wxYwcc}}w).z/Produce HTML documentation for a module object.NrrTr�z.html" class="white">r�r�!<strong class="title">%s</strong>rr���$Revision: �$z
version %sr�z (%s)r�z-<br><a href="%(docloc)s">Module Reference</a>rKz<a href=".">index</a><br>r�r�z#-z<span class="code">%s</span>z
<p>%s</p>
r�rzPackage Contentszpkg-contentc�,���j|d�Sr})r�)�tr:s �rr�z#HTMLDoc.docmodule.<locals>.<lambda>^s���4�?�?�1�Q�4�#8r�Modules�Classes�indexr�	Functions�	functions�Data�datarwr��Author�authorr��Credits�credits)6r)�__all__r8rr{rWrrXrr*�urllib�parse�quoter�rGr�rDr�rVrJr�r0�localsrkr~rcr �	getmoduler�rrr	rrrrdr-r,rhr�rQry�pkgutil�iter_modulesr�r�rr�rtr��getclasstreerr�r�)#r:rAr#�mod�ignoredr��parts�linksr��
linkedname�headr
r�r��info�versionr/rPrr��cdictr�r�r<r]r�r��fdictr�r=�modpkgs�importer�ispkgrf�	classlists#`                                  rrzHTMLDoc.docmodule
s��������	��.�.�C��
�
�3������s�5�z�!�|�$�A��L�L����%���1��+�&��a��2�
3�%��X�X�e�e�B�C�j�0�1�
�2�Z�?��	$��%�%�f�-�D��,�,�$�$�T�*�C��}�}�S�$�/�H����6�=�)��&�,�,�-�G��s��|�1�1�g�b�c�l�c�6I�!�"�R�.�.�.�0���K�K��t�{�{�7�';�;�<��6�:�&��K�K����C����$8�9�:���'�D�I�I�d�O�3�3�D�����'����D�v�x�O�F��F����d�$?�(�$J�V�$S�T���$�$�V�W�-=�-=�>���R���!�,�,�V�W�_�_�E�J�C�����"�"�5�)�3�V��>��s�C��0��N�N�C��<�0�03�c�	�9�E�#�J��u��
F�"�J�C������#�}�}�d�o�o�W��������1���d�?�v�'�&�#�2F��v�s�+�t�3�"�e�|�7>��7I�C�7O�O�E�#�J��t��
(�"��2�u��!�,�,�V�W�5F�5F�G�J�C�����!�!�%�(�G�,=�,=�e�,D��,N��s�C��0��L�L�#�u��.�!%���E�#�J��)�)�%�0��s��%��,�H���!�,�,�V�V�<�J�C���3��V�,����S�%�L�)�=��k�k�&��.�$�.�.�%��G���:�4�s�:���-�#�-�-���6�:�&��G�,3�,@�,@����,Q�(��'�5������u�a�8�9�-R��L�L�N��'�'�����A�H��d�o�o�"�M�8�=�=�F�
��'�'��8�:�H��d�o�o��=�(�4�4�F��3:�;�7�<�C���7�I�;����� 4� 4�Y�� B�D�I�K�H�%�
��U�����
�
�e�S�$��u� M�N�&��d�o�o��7�C�H�H�X�$6�8�8�F���H�#�
��U�����
�
�e�S�$��u� M�N�$��d�o�o��[�#�(�(�8�*<�>�>�F���H�"�
��U�����
�
�e�S� 9�:�#��d�o�o����
�
�h� 7�9�9�F��6�<�(��{�{�3�v�'8�'8�#9�4�>�>�J�H��d�o�o�h��(�K�K�F��6�=�)��{�{�3�v�'9�'9�#:�D�N�N�K�H��d�o�o�i��H�M�M�F��
��]�	��C�	���	$�#�H�	$��L<s*�[�A[�*[&�[�[�[#�"[#c
��������� �!�"��j}|xs|}�j}g}	|	j�!G�!fd�d�}
|
��tt	j
���}t
|�dkDrL�j��!d�|D]'}�!d�j|�j�z��)�!d����� ���!�fd�}
���!�fd�}���� ���!�fd	�}t��D����cgc]\}}}}t|��
�r||||f��}}}}}i� |D]*\}}}}dzdz|zx� |<}	t�|�}	|� |<�,|r�|r|j��"n|d
d�"t!|�"fd��\}}�t"j$ur�"t"j$ur|}�V�"�urd}nd�j�"�j�z}|dz
}t'|��|
d|z|d��}|
d|z|d��}|
d|z|d��}|d|z|d��}|d|z|d��}|d|z|d��}|}|r��dj)|	�}	|k(r
d|�d |�d!�}nd"|�d#|�d$|�d%�}|rKg}|D]-}|j�j|�j���/|d&d'j)|�zz}d}	t	j*��}|r)t/|�}|r|d)k7r|�j1|�zd*z}t3��}|r	||xsdz}�j5|�j6��� �}|xrd+|z}�j9|d,|	d-|�Scc}}}}w#t$rY��wxYw#t$rY��FwxYw#t,tf$rd(}Y��wxYw).z.Produce HTML documentation for a class object.c���eZdZd�Z�fd�Zy)�(HTMLDoc.docclass.<locals>.HorizontalRulec��d|_yr���needonerCs rr�z1HTMLDoc.docclass.<locals>.HorizontalRule.__init__��	�� ��rc�<��|jr�d�d|_y)Nz<hr>
rTr��r:�pushs �r�maybez.HTMLDoc.docclass.<locals>.HorizontalRule.maybe������<�<���N� ��rN�r)rrr�r��r�s�r�HorizontalRuler���
���
!�
!rr�rUz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
c
�(��t||�\}}|rW�
j��|�|D]:\}}}}	t�
|�}��j||��	���
|���d��<|S#t$r��j||���Y�0wxYw)NrS�r�r�rr�	Exceptionr)�msgr�r��okr#r��homeclsr�r�r��hr�mdictr�rAr�r:s        ��������r�spillzHTMLDoc.docclass.<locals>.spill�s����#�E�9�5�I�B������
��S�	�24�.�D�$���Q� '��� 5���T�]�]�5�$��(-�w��v�w�P�Q���J�35��L��%�=��T�\�\�%��s�;�<�=�s�A,�,"B�Bc���t||�\}}|r=�j��
|�|D] \}}}}�
�j||�	���"|Sr1�r�r�r�r�r�r�r�r#r�r�r�r�r�r�r:s        ����r�spilldescriptorsz*HTMLDoc.docclass.<locals>.spilldescriptors��S���#�E�9�5�I�B������
��S�	�24�.�D�$�������e�T�3�7�8�35��Lrc�d��t||�\}}|r��j��|�|D]�\}}}}�jt�|�|��}t	|�}	|	s�d|z�n;�jt	|��j��
�
�}	d|	z}	�d|�|	�d���d���|S)Nz<dl><dt>%s</dl>
z <dd><span class="code">%s</span>�<dl><dt>r�rS)r�r�rrrQr�ry)r�r�r�r�r#r�r�r�r<r=r�r�r�r�r�rAr�r:s          ��������r�	spilldataz#HTMLDoc.docclass.<locals>.spilldata�s����#�E�9�5�I�B������
��S�	�24�.�D�$����=�=����)>��c�J�D� ��-�C���0�4�7�8�"�k�k�&��-����*/��%�A��@�3�F���d�C�@�A���J�35��Lr�r9r��-rc���|d�uS�NrUr��r��	thisclasss �rr�z"HTMLDoc.docclass.<locals>.<lambda>�����A�a�D�I�<Mr�defined here�inherited from %sz:<br>
z
Methods %sc��|ddk(S�NrTr�r��r�s rr�z"HTMLDoc.docclass.<locals>.<lambda>��
��A�a�D�H�$4rzClass methods %sc��|ddk(S�NrTzclass methodr�r
s rr�z"HTMLDoc.docclass.<locals>.<lambda>��
��A�a�D�N�$:rzStatic methods %sc��|ddk(S�NrTr�r�r
s rr�z"HTMLDoc.docclass.<locals>.<lambda>��
��A�a�D�O�$;rzReadonly properties %sc��|ddk(S�NrTr�r�r
s rr�z"HTMLDoc.docclass.<locals>.<lambda>����q��t�7J�/JrzData descriptors %sc��|ddk(S�NrTr�r�r
s rr�z"HTMLDoc.docclass.<locals>.<lambda>����q��t�7H�/HrzData and other attributes %sc��|ddk(S�NrTr�r�r
s rr�z"HTMLDoc.docclass.<locals>.<lambda>�����!���rrK�	<a name="z">class <strong>�
</strong></a>z<strong>z</strong> = <a name="z">class r��(%s)r�N�()rvz&<span class="code">%s<br>&nbsp;</span>rern)r)rrrr�getmrorWr�r�rr�r�rr�rG�popleftr��builtinsrAr�rX�	signature�
ValueErrorrDrJrQr�ryrr)#r:rAr#r�r�r�r��realnamer�rfr��mror<r�r�rr�r"r�r�r�r��anchor�	inherited�tagrer��declr%�argspecr=r�r�r�rs#`` ```                         @@@@rrzHTMLDoc.docclasss�����?�?����x��� � ��������	!�	!��
���G�N�N�6�*�+���s�8�a�<��H�H�J��:�;����_�t�~�~�d�6<�6G�6G�(I�I�J��
��O�	�	�$	�	�	�&0D�F�/K�3�/K�+�T�4��e���&�1���c�5�)�/K�	�3���).�%�C��w��"%��*�s�"2�S�"8�8�E�#�J��
����-��

� &��e��*/����K�K�M�	�!�!�H�Q�K�	�*�5�2M�N��E�9��X�_�_�,��h�o�o�1M�!����f�$�$��)�D�N�N�9�;A�;L�;L�-N�N���9��C��E�6�*��,��,�e�4�6�E��,�s�2�E�:�<�E��-��3�U�;�=�E�$�%=��%C�U�%J�L�E�$�%:�S�%@�%�%H�J�E��<�s�B�E�6�8�E��E�C�F�7�7�8�$���8���h� �E��
�d�H�&�E���G������t�~�~�d�F�4E�4E�F�G���F�T�Y�Y�w�%7�7�7�E���	��)�)�&�1�I���)�n�G��7�d�?��d�k�k�'�2�2�V�;���V�n����#�)��$�C��k�k�#�t�~�~�u�g�u�E���D�>��D���|�|�E�7�H�a��=�=��k3���
��
���
��
��n�I�&�	��I�	�s<�1L;
�2M�?M�(M#�	M�M�	M �M �#M7�6M7c�H�|jd|j|�z�S�z)Format an argument default value as text.�=)r�rrLs  r�formatvaluezHTMLDoc.formatvalue!s���y�y��t�y�y��0�0�1�1rc	��|j}	|xs|	}|�|}|�dn|jdz|z}
d}d}d}
t|�ri|j}||urt|dd�}
n�t	j
|�rd|j
||�z}n�d|j
|j|�z}nkt	j|�st	j|�r?	|j}|�d|j
||�z}n||urd	|j
||�z}n|}
t	j|
�rS|�Q|
j|jk7s|
j|jd
z|	zk7r|j|
|�}|rd|z}t	j |�st	j"|�rd}nd}||	k(r
d
|
�d|	�d�}nW|�Ht	j$||	g�|ur/d|jdz|	z�d|	�d�}d}|j'd	�rd}n|	}d
|
�d|�d|��}d}t	j(|�r>	t	j*|�}|r&t1|�}|	dk(rd|z}|j2s|dd}|sd}||z|j5|�z|xr|j7d|z�z}|rd|zS|j9t;|�|j<|||�}|xrd|z}d|�d|�d�S#t$rY���wxYw#t,t.f$rd}Y��wxYw) z;Produce HTML documentation for a function or method object.NrKrFr&� class method of %s� method of %s instance� unbound %s method� from r� from %s�async rz
"><strong>rz
<a href="#r�r�Tz</strong></a> = �<lambda>z$<strong>%s</strong> <em>lambda</em> rTr�(...)z$<span class="heading-text">%s</span>z<dl><dt>%s</dt></dl>
z%<dd><span class="code">%s</span></dd>rz</dt>r�)r)r{r*rrr r�r+r1�ismethodwrapperr3r8r,rrr��iscoroutinefunction�isasyncgenfunction�getattr_staticr�rdr%r&rGrD�__annotations__rJr�r�rQry)r:rAr#r�r�r�r�r�r�r'r)�note�skipdocs�imfunc�imself�objclass�pname�asyncqualifierre�reallinkr-r%r,r=s                        rrzHTMLDoc.docroutine%s1���?�?����x���?��G��
�"����s�:�T�A���������F�#��_�_�F���|� ���T�:������(�,�t�~�~�f�c�/J�J��/�$�.�.��$�$�c�3+�+���(�(��0��%�%�f�-�
D�!�.�.���:�/�$�.�.��3�2O�O�D��W�,�#�d�n�n�X�s�&C�C�D��F����f�%�'�*=�����!3�!3�3����7�#7�#7�#�#=��#H�H��O�O�F�C�0�E��!�E�)���'�'��/��*�*�6�2�%�N��N��8��>D�h�O�E����&�&�r�8�R�8�F�B��K�K�#�%��0�(�<�����?�?�8�,��D�#�����h�(�E������V�$�
!�#�-�-�f�5�	���i�.���z�)�B�T�I�E�"�1�1�")�!�B�-����G���%����G�(<�<��AH��y�y�?�$�F�G�I���+�d�2�2��+�+��v������w��I�C��G�A�C�G�C�15�s�;�;��"�
��
��P�	�*�
!� �	�
!�s$�K�'K)�	K&�%K&�)K=�<K=c���g}|j}|r|d|z�|jt|�|j�}|r|d|z�|d�dj	|�S)z1Produce html documentation for a data descriptor.z!<dl><dt><strong>%s</strong></dt>
z&<dd><span class="code">%s</span></dd>
r�rK)rr�rQryrX�	r:rAr#r�r�r�r�r�r=s	         rrzHTMLDoc.docdata~s`�����~�~����5��<�=��k�k�&��.�$�.�.�9����:�S�@�A��Y���w�w�w��rc�D�|xrd|zxsd}||j|�zS)z-Produce HTML documentation for a data object.z<strong>%s</strong> = rK�r)r:rAr#r�r��lhss      rrzHTMLDoc.docother�s+���6�/�$�6�<�"���T�Y�Y�v�&�&�&rc�(�g}|�i}tj|g�D]5\}}}td�|D��r�|j|d|||vf�d||<�7|j	�|j||j�}|j|d|�S)z2Generate an HTML index for a directory of modules.c3�NK�|]}dt|�cxkxrdknc���y�w)i�i��N)�ord��.0�chs  r�	<genexpr>z HTMLDoc.index.<locals>.<genexpr>�s"����@�4�R�F�c�"�g�/��/�/�4�s�#%rKrTr�)r�r��anyrr�rr�rt)r:rr�r�r�r#r�rfs        rr�z
HTMLDoc.index�s��������X�%,�%9�%9�3�%�%@�!�H�d�E��@�4�@�@���N�N�D�"�e�T�X�-=�>�?��H�T�N�&A�	�����#�#�G�T�_�_�=�����s�G�X�6�6r�rK)�rKNrir1r��NNN)r)rrr@r7�_repr_instancerrJrgrkrrrtryrr�r�r�r�r�r�r�r�r�rrr1rrr3rr�r�rrrbrbIs���1��Z�N����D�
�
"�
"�F�
&�&�34�19�U�**�
<�
5�G��*�/�&O�
3�8�#'�b�"�b�% �R*�&s�j%)�d�"�b�`>�D2�'+���R���d�W<�r ��K�'�

7rrbc�,�eZdZdZd�Zd�Zd�ZeZd�Zy)�TextReprzAClass for safely making a text representation of a Python object.c�t�tj|�dx|_|_d|_dx|_|_yr9r=rCs rr�zTextRepr.__init__�rDrc�$�tt|�d�rTddjt|�jj	��z}t||�rt||�||�St
tt|��|j�SrN)
r�rCrXr)rrrtrxrrBrPs    rrSzTextRepr.repr1�sp���4��7�J�'� �3�8�8�D��G�,<�,<�,B�,B�,D�#E�E�J��t�Z�(�0�w�t�Z�0��E�:�:��G�D��G�$�d�m�m�4�4rc��t||j�}t|�}d|vr dt|dd�vrd|dz|z|dzS|S)Nr�rUrKrVr)rtrArrlrWs     rrZzTextRepr.repr_string�sV���A�t�~�~�&����:���4�<�D���%��(D�D���!��$�t�+�h�q�k�9�9��rc��	ttt|��|j�S#d|jj
zcYSxYwr\)rtrxrrAr+r)r]s   rr^zTextRepr.repr_instance�s=��	:����Q��(�$�.�.�9�9��	:�"�Q�[�[�%9�%9�9�9�s	�'*�AN)	r)rrr@r�rSrZr_r^r�rrrZrZ�s ��K�-�5���H�:rrZc��eZdZdZe�ZejZd�Zdd�Zd�Z	dd�Z
dd�Zdd�Zd	�Z
dd
�Zdd�ZeZdddd�d
�Zy)�TextDocz'Formatter class for text documentation.c�2�djd�|D��S)z(Format a string in bold by overstriking.rKc3�,K�|]}|dz|z���y�w)�Nr�rPs  rrSzTextDoc.bold.<locals>.<genexpr>�s����5��"�r�D�y�2�~��s�)rXrIs  r�boldzTextDoc.bold�s���w�w�5��5�5�5rc��|sy|jd�D�cgc]}||zj���}}dj|�Scc}w)z6Indent text by prepending a given prefix to each line.rKrS)rrOrX)r:rj�prefixr�rYs     r�indentzTextDoc.indent�sH���B�6:�j�j��6F�G�6F�d�&�4�-�'�'�)�6F��G��y�y�����Hs�Ac�t�|j|�j�}|j|�dz|zdzS)z&Format a section with a given heading.rSrv)rgrOrd)r:rerf�clean_contentss    rrrzTextDoc.section�s7�����X�.�5�5�7���y�y���$�&��7�&�@�@rNc	���d}|D]�}t|t�rG|\}}||zt|��z}|r(||fk7r"�fd�|D�}	|ddj|	�zz}|dz}�Zt|t�s�k||j|�|dz�z}��|S)zBRender in text a class tree as returned by inspect.getclasstree().rKc3�6�K�|]}t|�����y�wr1�r^)rQr�r]s  �rrSz%TextDoc.formattree.<locals>.<genexpr>�s�����D�e��y��G�4�e�s�r r�rS�    )r.r�r^rXr|r�)
r:r�r]r�rfrPr�r�r�r�s
  `       rr�zTextDoc.formattree�s�������E��%��'� ���5��&��9�Q��+@�@���U�v�i�/�D�e�D�G�#�f�t�y�y��/A�&A�A�F��$����E�4�(��$�/�/��7�A�v���#8�8����
rc	��
�|j}tt|��\}}|jd||xrd|zz�}t	|dd�}|j|�}	|	�||jd|	dz�z}|r||jd|�z}g}
t
j|tj�D]D\}}|�t
j|�xs||us�$t|||�s�2|
j||f��Fg}
t
j|tj�D]U\}}|�-t
j|�st
j|�|us�5t|||�s�C|
j||f��Wg}t
j|t�D]&\}}t|||�s�|j||f��(g}t�}t!|d�r�t#j$|j&�D]?\}}}|j)|�|r|j|d	z��/|j|��A|j+�||jd
dj-|��z}g}t
j|tj.�D]:\}}|jj1|dz�s�%||vs�*|j|��<|r4|j+�||jd
dj-|��z}|
r�|
D��cgc]\}}|��	}}}|j3t
j4|d�|�g}|
D]'\}}|j|j7|||���)||jddj-|��z}|
rRg}|
D]'\}}|j|j7|||���)||jddj-|��z}|rTg}|D])\}}|j|j9|||d����+||jddj-|��z}t!|d�rMt;|j<�}|dddk(r|dddk(r|ddj?�}||jd|�z}t!|d�r(||jdt;|j@��z}t!|d�r(||jdt;|jB��z}t!|d�r(||jdt;|jD��z}	t
jF|�}||jd!|�z}|Scc}}w#tH$rd }Y�*wxYw)"z5Produce text documentation for a given module object.�NAMEr�r�NzMODULE 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.
�DESCRIPTIONr��
 (package)zPACKAGE CONTENTSrSr�
SUBMODULESrT�CLASSES�	FUNCTIONS�F)rq�DATAr�r�r�rr��VERSIONr��DATEr��AUTHORr��CREDITSr�FILE)%r)rZrQrrrr0rr~r r�r�rrdr-rh�setr�r�r�r��addr�rXrcr�r�r�rrrDr�rVr�r�r�r*rG)r:rAr#r�r��synop�descrPr�r/r�r�r�r�r�r��
modpkgs_namesr�r]r��
submodulesr�rfr�r�s                         rrzTextDoc.docmodule�s�������v�f�~�.���t����f�d�e�.E���
�&F�G���f�i��.������'�����d�l�l�+=�v�I�@���F���d�l�l�=�$�?�?�F���!�,�,�V�W�_�_�E�J�C�����%�%�e�,�6��6�A��s�C��0��N�N�C��<�0�F���!�,�,�V�W�5F�5F�G�J�C�����!�!�%�(�G�,=�,=�e�,D��,N��s�C��0��L�L�#�u��.�H���!�,�,�V�V�<�J�C���3��V�,����S�%�L�)�=�����
��6�:�&�,3�,@�,@����,Q�(��'�5��!�!�'�*���N�N�7�\�#9�:��N�N�7�+�-R�
�L�L�N��d�l�l�"�D�I�I�g�$6�8�8�F��
�!�,�,�V�W�5E�5E�F�J�C���~�~�(�(����4��M�9Q��!�!�#�&�G���O�O���d�l�l��d�i�i�
�3�5�5�F��18�9��:�3����I�9�����$�$�Y��2�D�:�;�H�%�
��U�����
�
�e�S�$� ?�@�&��d�l�l�9�d�i�i��6I�J�J�F���H�#�
��U�����
�
�e�S�$� ?�@�$��d�l�l�;��	�	�(�8K�L�L�F���H�"�
��U�����
�
�e�S�$�r�
� J�K�#��d�l�l�6�4�9�9�X�3F�G�G�F��6�=�)��&�,�,�-�G��s��|�1�1�g�b�c�l�c�6I�!�"�R�.�.�.�0���d�l�l�9�g�>�>�F��6�:�&��d�l�l�6�3�v���3G�H�H�F��6�<�(��d�l�l�8�S��9J�9J�5K�L�L�F��6�=�)��d�l�l�9�c�&�:L�:L�6M�N�N�F�	 ��%�%�f�-�D��$�,�,�v�t�4�4���
��G:��@�	 ��D�	 �s�U�2U$�$U2�1U2c
�������� ��j}|xs|}�j}�jfd�}||k(rd�j|�z}n�j|�dz|z}|r#t	||�}	|ddj|	�zz}g}
|
j�	tj��}|r t|�}|r|dk7r�||zdz�t��}
|
r�|
dz�ttj���}t|�d	kDr(�d
�|D]}�d||�z���d�t!d
�t"j%��D�tj&��}t|�}d}|rD�d�|d|D]
}�d|z��||kDr�dt||z
�zdz��d�G�fd�d�}|�������fd�}����fd�}�����fd�}t)��D����cgc]\}}}}t+|���r||||f��}}}}}|r�|r|j-�� n|dd	� t/|� fd��\}}�t0j2ur� t0j2ur|}�V� �urd}ndt5� �j�z}t7|��|d|z|d��}|d|z|d ��}|d!|z|d"��}|d#|z|d$��}|d%|z|d&��}|d'|z|d(��}|}|r��dj|
�}
|
s|dzS|dz�j9|
j;�d)�zdzS#ttf$rd}Y���wxYwcc}}}}w)*z4Produce text documentation for a given class object.c��t||�Sr1rl)r�r
s  r�makenamez"TextDoc.docclass.<locals>.makenameXs���Q��?�"r�class z	 = class r r�Nr!rSrUzMethod resolution order:rmrKc3�K�|]C}|jjd�s&|jdk(rt|j����Ey�w)r�r$N)r)r�rrD)rQr"s  rrSz#TextDoc.docclass.<locals>.<genexpr>}s?����
S�*E�3��L�L�+�+�C�0�S�^�^�z�5Q�����
�*E�s�A	Ar�r�zBuilt-in subclasses:z    ... and z other subclassesc���eZdZd�Z�fd�Zy)�(TextDoc.docclass.<locals>.HorizontalRulec��d|_yr�r�rCs rr�z1TextDoc.docclass.<locals>.HorizontalRule.__init__�r�rc�<��|jr�d�d|_y)NzF----------------------------------------------------------------------rTr�r�s �rr�z.TextDoc.docclass.<locals>.HorizontalRule.maybe�r�rNr�r�s�rr�r��r�rr�c
���t||�\}}|rL�j��|�|D]/\}}}}	t�
|�}��j||�	�
|���1|S#t$r��j||�	��Y�XwxYwr1r�)
r�r�r�r�r#r�r�r�r�r�rAr�r:s
        �����rr�zTextDoc.docclass.<locals>.spill�s����#�E�9�5�I�B������
��S�	�24�.�D�$���E� '��� 5���T�]�]�5�(,�c�6�7�D�E�35��L��%�=��T�\�\�%��s�;�<�=�s�A!�!"B�Bc���t||�\}}|r=�j��
|�|D] \}}}}�
�j||�	���"|Sr1r�r�s        ����rr�z*TextDoc.docclass.<locals>.spilldescriptors�r�rc
���t||�\}}|r[�
j��
|�|D]>\}}}}t|�}	t�|�}	�
�j
|	|�d|��dz��@|S#t$r|j
|}	Y�=wxYw)Nru�rqr=rS)r�r�rQrr8�__dict__r)r�r�r�r�r#r�r�r�r=r9r�r�rAr�r:s          �����rrz#TextDoc.docclass.<locals>.spilldata�s����#�E�9�5�I�B������
��S�	�24�.�D�$��� ��-�C�5�%�f�d�3������s�D�#�b�c��J����
35��L��	*�5�%�.�.�t�4��5�s�A0�0B�
Brrc���|d�uSrr�rs �rr�z"TextDoc.docclass.<locals>.<lambda>�rrr	r
zMethods %s:
c��|ddk(Srr�r
s rr�z"TextDoc.docclass.<locals>.<lambda>�rrzClass methods %s:
c��|ddk(Srr�r
s rr�z"TextDoc.docclass.<locals>.<lambda>�rrzStatic methods %s:
c��|ddk(Srr�r
s rr�z"TextDoc.docclass.<locals>.<lambda>�rrzReadonly properties %s:
c��|ddk(Srr�r
s rr�z"TextDoc.docclass.<locals>.<lambda>�rrzData descriptors %s:
c��|ddk(Srr�r
s rr�z"TextDoc.docclass.<locals>.<lambda>�rrzData and other attributes %s:
c��|ddk(Srr�r
s rr�z"TextDoc.docclass.<locals>.<lambda>�rrz |  )r)rrrd�maprXrrr%r&rGrDrQrr"rW�sortedrC�__subclasses__r-r�r�r#r�r$rAr^r�rgrO)!r:rAr#r�r�r'r�r�rer�rfr%r-r=r(r<�
subclasses�no_of_subclasses�MAX_SUBCLASSES_TO_DISPLAY�subclassnamer�r�r�rr�r"r�r�r*r+r�r�rs!`` `                          @@@rrzTextDoc.docclassRs�����?�?����x��� � �� �+�+�	#��8���t�y�y��2�2�E��I�I�d�O�k�1�H�<�E���(�E�*�G��F�T�Y�Y�w�%7�7�7�E�������	��)�)�&�1�I���)�n�G��7�d�?��T�G�^�d�*�+��V�n�����t����G�N�N�6�*�+���s�8�a�<��+�,����V�h�t�n�,�-����H��
S�$�*=�*=�f�*E�
S��	�	�
�
�
�z�?��$%�!���'�(� *�+E�,E� F���V�l�*�+�!G��";�;��^��)�,E�E�F�G�(�)�*�
��H�	!�	!��
��	�	�"	�
	�
	� 0D�F�/K�3�/K�+�T�4��e���&�1���c�5�)�/K�	�3����K�K�M�	�!�!�H�Q�K�	�*�5�2M�N��E�9��X�_�_�,��h�o�o�1M�!����f�$�$��)�I�i�6<�6G�6G�-I�I��
�E�6�*��/�C�/��4�6�E��/�#�5�u�:�<�E��0�3�6��;�=�E�$�%@�3�%F��%J�L�E�$�%=��%C�U�%H�J�E��?�#�E�u�6�8�E��E�C�F�9�9�X�&����4�<���t�|�d�k�k�(�/�/�*;�V�D�D�t�K�K��E�I�&�	��I�	��p3s�M�M
�M�Mc�*�d|j|�zSr/rKrLs  rr1zTextDoc.formatvalue�s���T�Y�Y�v�&�&�&rc�^�|j}|xs|}|�|}d}d}d}	t|�r]|j}
|
|urt|dd�}	n�t	j
|
�rdt
|
|�z}nydt
|
j|�z}n_t	j|�st	j|�r3	|j}|�dt
||�z}n||urdt
||�z}n|}	t	j|	�rM|�K|	j|jk7s|	j|jd	z|zk7rt|	|�}|rd
|z}t	j |�st	j"|�rd}
nd}
||k(r|j%|�}nG|�.t	j&||g�|urd}|j)d�rd}|j%|�d
z|z}d}t	j*|�rM	t	j,|�}|r5t3|�}|dk(r%|j%|�dz}|j4s|dd}|sd}|
|z|z|z}|r|dzSt7|�xsd}|dz|xr"|j9|�j;�dzzS#t$rY���wxYw#t.t0f$rd}Y��wxYw)z;Produce text documentation for a function or method object.NrKFr&r3r4r5r6rr7r8T� = r9z lambda rTrr:rS)r)r{r*rrr r^r+r1r;r3r8r,rrrar<r=rdr>r�rdr%r&rGrDr?rQrgrO)r:rAr#r�r�r�r'r@rArBrCrDrErFrer-r%r,r=s                   rrzTextDoc.docroutine�s����?�?����x���?��G��������F�#��_�_�F���|� ���T�:������(�,�y���/E�E��/�)��$�$�c�3+�+���(�(��0��%�%�f�-�
?�!�.�.���:�/�)�H�c�2J�J�D��W�,�#�i��#�&>�>�D��F����f�%�'�*=�����!3�!3�3����7�#7�#7�#�#=��#H�H��v�s�+�E��!�E�)���'�'��/��*�*�6�2�%�N��N��8���I�I�h�'�E����&�&�r�8�R�8�F�B����?�?�8�,��D��I�I�d�O�e�+�h�6�E������V�$�
!�#�-�-�f�5�	���i�.���z�)� �I�I�d�O�j�8�E�"�1�1�")�!�B�-����G���%��/�$�6����$�;����.�&�B�C��$�;�#�"J�$�+�+�c�*:�*A�*A�*C�d�*J�K�K��o"�
��
��H�	�*�
!� �	�
!�s$�0J�+J�	J�J�J,�+J,c���g}|j}|r||j|��|d�t|�xsd}|r||j|��|d�dj	|�S)z1Produce text documentation for a data descriptor.rSrK)rrdrQrgrXrIs	         rrzTextDoc.docdata?sb�����~�~�������4��!���J��V�n�"��������S�!�"���J��w�w�w��rr�c�$�|j|�}|r+|xr|dzxsd|z}	|t|	�z
}
|
dkr|d|
dz}|xr|j|�dzxsd|z}	|st|�}|r#|	d|j	t|��zdzz
}	|	S)z-Produce text documentation for a data object.r�rKrNrorS)rrWrdrQrgrD)r:rAr#r�r�rqr=r�rr��chops           rrzTextDoc.docotherOs����y�y�� ����)�T�E�\�/�R�4�7�D��C��I�%�D��a�x��U�d��e� 3���0����4��5�0�6�B�$�>�����.�C���D�4�;�;�s�3�x�0�0�4�7�7�D��r)rm)NrKr�)NNNNrW)r)rrr@rZrXrrdrgrrr�rrr1rrr3rr�rrr`r`�se��1��Z�N����D�6� �A�� c�JXL�t'�ML�^ ��K�
��$�
rr`c��eZdZdZd�Zy)�
_PlainTextDocz2Subclass of TextDoc which overrides string stylingc��|Sr1r�rIs  rrdz_PlainTextDoc.bold`s���rN)r)rrr@rdr�rrr�r�^s
��<�rr�c�.�t�at|�y)zCThe first time this is called, determine what kind of pager to use.N)�getpager�pagerrws rr�r�es��
�J�E�	�$�Krc�^��ttjd�stSttjd�stStjj�rtjj�stStjdk(rtStjjd�xstjjd���rCtjdk(r�fd�Stjjd�dvr�fd	�S�fd
�Stjjd�dvrtStjdk(rd�Sttd�rtjd
�dk(rd�Sddl}|j�\}}tj|�	ttd�r3tjd|z�dk(rd�tj|�Sttj|�S#tj|�wxYw)z2Decide what method to use for paging through text.�isatty�
emscripten�MANPAGER�PAGER�win32c�.��tt|���Sr1��
tempfilepager�plain�rj�	use_pagers �rr�zgetpager.<locals>.<lambda>xs���
�e�D�k�9� Er�TERM)�dumb�emacsc�.��tt|���Sr1)�	pipepagerr�r�s �rr�zgetpager.<locals>.<lambda>zs���	�%��+�y� Arc���t|��Sr1�r�r�s �rr�zgetpager.<locals>.<lambda>|s���	�$�	� :rc�,�tt|�d�S)Nzmore <r�rws rr�zgetpager.<locals>.<lambda>�s��M�%��+�x�@r�systemz(less) 2>/dev/nullrc��t|d�S)N�lessr�rws rr�zgetpager.<locals>.<lambda>�s��I�d�F�3rNz	more "%s"c��t|d�S)N�morer�rws rr�zgetpager.<locals>.<lambda>�s��	�$�� 7r)r�r	�stdin�
plainpager�stdoutr��platformrr+rr��tempfile�mkstemp�close�unlink�ttypager)r��fdr�r�s   @rr�r�ks����3�9�9�h�'����3�:�:�x�(����9�9����S�Z�Z�%6�%6�%8���
�|�|�|�#����
�
���z�*�E�b�j�j�n�n�W�.E�I���<�<�7�"�E�E�
�Z�Z�^�^�F�
#�'8�
8�A�A�:�:�	�z�z�~�~�f��!2�2���
�|�|�w��@�@��r�8�����+?�!@�A�!E�3�3���%�%�'�N�R���H�H�R�L���2�x� �R�Y�Y�{�X�/E�%F�!�%K�7�	�	�	�(���
�	�	�(����	�	�(��s�7-H�:H�H,c�0�tjdd|�S)z%Remove boldface formatting from text.z.rK)rMrNrws rr�r��s��
�6�6�%��T�"�"rc�2�ddl}|j|d|jd��}	|j5}	|j	|�ddd�		|j�y#t
$rY�&wxYw#1swY�+xYw#t$rY�9wxYw#t
$rYnwxYw�L)z3Page through text by feeding it to another program.rNT�backslashreplace)�shellr��errors)�
subprocess�Popen�PIPEr��write�KeyboardInterruptr��wait)rj�cmdr��proc�pipes     rr�r��s�������C�t�:�?�?�#5��7�D�	
�
�Z�Z�4�
��
�
�4� ���	��I�I�K���%�
��
���Z���
��
��!�	�
�	��	sW�A:�A.�A�A:�B	�	A+�(A.�*A+�+A.�.A7�3A:�:	B�B�		B�Bc	��ddl}|j�5}tjj	|d�}t|ddtjdk(rtjd�nd��5}|j|�ddd�tj|dz|zd	z�ddd�y#1swY�0xYw#1swYyxYw)
z<Page through text by invoking a program on a temporary file.rNz	pydoc.out�wr�r�)r��encodingz "r�)r��TemporaryDirectoryrr
rXr�r	r��device_encodingr�r�)rjr�r��tempdirr�r�s      rr�r��s����	�	$�	$�	&�'��7�7�<�<���5��
�(�C�(:��,�,�'�)��-�-�a�0�/3����J�J�t��	�
	�	�	�#��*�x�'�#�-�.�
'�	&����
'�	&�s$�AB:�-B.�?&B:�.B7	�3B:�:Cc��ttjdd�xsd}|j|d�j	|�S)Nr��utf-8r�)rr	r��encode�decode)rjr�s  r�_escape_stdoutr��s6���s�z�z�:�t�4�?��H��;�;�x�!3�4�;�;�H�E�Erc	��tt|��jd�}	ddl}tj
j
�}|j|�}|j|�d�}		ttjj!dd��}|dkrd}|dz
x}}tj$j'dj)|d|�dz�||dr�tj$j'd	�tj$j+�|�}	|	d
vr tj$j'd�n�|	dvr.tj$j'd||zdz�|dz}��|	d
vr||z
|z
}|dkrd}tj$j'ddj)||||z�zdz�||z}||dr��|r|j-|j.�yy#tttjf$r	d}d�}Y���wxYw#t"$rd}Y���wxYw#|r|j-|j.�wwxYw)z%Page through text on a text terminal.rSrNc�@�tjjd�Sr})r	r�r�r�rrr�zttypager.<locals>.<lambda>�s��#�)�)�.�.��+rc�J�tjj�ddddS)NrrT)r	r�r�r�rrr�zttypager.<locals>.<lambda>�s��#�)�)�,�,�.�s��3�B�Q�7r�LINESrT�z
-- more --)�q�Qz
          
)�
rS)�b�B�)r�r�r�ttyr	r��fileno�	tcgetattr�	setcbreakrr8�io�UnsupportedOperationr�rr+rr&r�r�rX�flush�	tcsetattr�	TCSAFLUSH)
rjrYr�r��old�getchar�hrV�incr�s
          rr�r��s���.��&�'�-�-�d�3�E�8��
�Y�Y�
�
�
���m�m�B����
�
�b��+��
2�	��B�J�J�N�N�7�A�.�/�A�
��6��A��a�%���C��
�
������5��#�;�/�$�6�7��A�B�i��J�J���\�*��J�J�����	�A��J���
�
� � �!1�2���l�"��
�
� � �!1�E�!�H�!<�t�!C�D���E����&�&���G�c�M���q�5�a�!��J�J���T�D�I�I�e�A�a��e�n�$=�=��D�E��C��A�!�A�B�i�&��M�M�"�c�m�m�S�1���A
���)@�)@�A�8���7��8���	��A�	��2��M�M�"�c�m�m�S�1��s=�AG1�.)H�D8H-�1#H�H�H*�&H-�)H*�*H-�-"Ic�f�tjjtt	|���y)z>Simply print unformatted text.  This is the ultimate fallback.N)r	r�r�r�r�rws rr�r��s���J�J���U�>�$�/�0�1rc�h�tj|�rU|jtjvrd|jzSt|d�rd|jzSd|jzStj|�rd|jzStj|�r=d|jj�d|jj�d|j��Stj|�r=d|jj�d|jj�d|j��Stj|�rd	|jzStj|�rd
|jzStj|�rd|jzSt|�jS)z/Produce a short description of the given thing.zbuilt-in module r�zpackage zmodule zbuilt-in function zgetset descriptor rzmember descriptor r�z	function zmethod )rrcr)r	rr�r-�isgetsetdescriptorr3rr4r r,r(rC)�things r�describer�sW��������>�>�S�5�5�5�%����6�6��5�*�%�����.�.��u�~�~�-�-������#�e�n�n�4�4��!�!�%�(����)�)�5�+=�+=�+F�+F��N�N��	��!�!�%�(����)�)�5�+=�+=�+F�+F��N�N��	����u���%�.�.�(�(����%� ��U�^�^�+�+�������5�>�>�)�)���;���rc�R�|jd�D�cgc]}|s�|��	}}d\}}|t|�kr;tdj|d|dz�|�}|r||dz}}nn|t|�kr�;|r|}nt}||dD]}	t||�}�|Scc}w#t$rYywxYw)z@Locate an object by name or dotted path, importing as necessary.rr�NrT)rrWrrXr$rr8)r
r	�partr�r��n�
nextmodulerAs        r�locaters���"�j�j��o�6�o�d��T�o�E�6��I�F�A�
�c�%�j�.������t��!��� 5�y�A�
��:�q�1�u�q�v���c�%�j�.�������a�b�	��	��V�T�*�F��
�M��
7���	��	�s�B�B�B�	B&�%B&c��t|t�r t||�}|�td|z��||fSt	|dd�}|t|t�r|fSdfS)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))r.rDrrr)rr	rAr#s    r�resolver	 so���%�����y�)���>��,�/4�4�5�
5��u�}���u�j�$�/���j��s�3�d�=�=��=�=rc�(�|�t}t||�\}}t|�}tj|�}|rd|vr|d|d|jd�zz
}n|r||ur|d|jzz
}tj|�sstj|�s^tj|�sItj|�s4t|�s)t|d�r
|j}nt|�}|dz
}||zdz|j||�zS)zBRender text documentation, given an object or a path to an object.Nrz in z in module �
__origin__z objectrv)rjr	rrr��rfindr)rcr rdr2rIr�rrCr)rrer	�rendererrAr#rr�s        r�
render_docr.s�������5�)�,�L�F�D��F��D�
�
�
�v�
&�F���t�����.�t�z�z�#��/�/�/��	�F�&�(��
����/�/�����V�$��o�o�f�%�����'��&�&�v�.��f�o��6�<�(��&�&�F��&�\�F��I��D��4�<�&� �8�#4�#4�V�T�#B�B�Brc�
�|�	tt|||��y	t|||t�}|j
|�y#t$r}|r�t|�Yd}~yd}~wwxYw#t$r}t|�}Yd}~�Od}~wwxYw)zCDisplay text documentation, given an object or a path to an object.N)r�rr�print�	plaintextrDr�)rrer	�output�is_clir�r�s       rr=r=Is|���~�	��*�U�E�9�5�6�	��5�%��I�>�A�	���Q����	����#�J�J��	���	��C��A��	�s.�A�A$�	A!�	A�A!�$	B�-A=�=Bc��t||�\}}tjt|�tj	||��}t|dzdd��5}|j
|�ddd�td|dz�y#1swY�xYw)z<Write HTML documentation to a file in the current directory.r)r�r�)r�N�wrote)r	�htmlrgrrr�r�r)rr	rAr#rgr�s      r�writedocrZsl���5�)�,�L�F�D��9�9�X�f�%�t�}�}�V�T�'B�C�D�	
�d�W�n�c�G�	4���
�
�4��
5�	�'�4�'�>�"�
5�	4�s�A>�>Bc�b�|�i}tj|g|�D]\}}}t|��y)zAWrite out HTML documentation for all modules in a directory tree.N)r��
walk_packagesr)r�pkgpath�doner�r]r�s      r�	writedocsrbs7���|�B�T�$+�$9�$9�3�%��$I� ��'�5����%J�
rc�T�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���cgc]}d?D]}||z��	�c}}}Zd@dAdBdCge��dDdEdFdGdHdIdJ�ZdKdLdMdNdOdPdQdRdSdTdUdVdVdWdWdX�Zej�D]/\ZZ	e	D]%Z
eje
e�ZeevredYzezZeee
<�'�1[[	[
[idZd[�dRd\�d]d^�d_d`�dadb�dcdd�dedf�dgdh�didj�dkdl�dmdn�dodp�dqdr�dsdt�dudv�dwdZ�dxdZ�idydz�dOd{�d|d}�d~d�d�d��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��dSd��d�d��d�dk�d�d��d�d��d�d��dnd��d�d���id�d��d�d��d�d��d�d��dLd��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ՄZ
edք�Zedׄ�Zd؄Ze�ZefdلZdڄZdۄZd�d܄Zd݄Zd�dބZd߄Zd�Zd�Zd�d�Zd�d�Zd�Zd�d�Z y�cc}}}w)��Helper�FalserK�None�True�and�BOOLEAN�as�with�assert)r&rK�async)r'rK�await)r(rK�break)r)�	while for�class)r+zCLASSES SPECIALMETHODS�continue)r,r*�def)�functionrK�del)r/�BASICMETHODS�elif�if�else)r3r*�except�try�finally�for)r7zbreak continue while�from�import�global)r:znonlocal NAMESPACES)r2�
TRUTHVALUE)r9�MODULES�in)r=�SEQUENCEMETHODS�is�
COMPARISON�lambda)rArt�nonlocal)rBzglobal NAMESPACES�not�or�pass)rErK�raise)rF�
EXCEPTIONS�return)rHrt)r5rG�while)rIzbreak continue if TRUTHVALUE)r%z CONTEXTMANAGERS EXCEPTIONS yield�yield)rJrK)r��frV�u��'r�rNz'''r�r�)�+r�*�**r(z//�%�<<�>>rF�|�^�~rGrH�<=�>=�==�!=�<>)rGrHrXrYrZr[r\)rrW)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rSrTrFrUrVrW)�j�J)�STRINGS�	OPERATORSr@�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classr_�PRIVATENAMESzPRIVATENAMES SPECIALMETHODS�
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)rRrQ�,rro�:�@r�r�r��`r�r��[�]r�TYPES)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES�
STRINGMETHODS)zstring-methodszSTRINGS FORMATTING�
FORMATTING)�
formatstringsr`�UNICODE)rqz:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES�NUMBERS)�numberszINTEGER FLOAT COMPLEX TYPES�INTEGER)�integersz	int range�FLOAT)�floatingz
float mathrd)�	imaginaryz
complex cmath�	SEQUENCES)�typesseqz$STRINGMETHODS FORMATTING range LISTS�MAPPINGS�DICTIONARIESrt)�typesfunctionsz	def TYPES�METHODS)�typesmethodszclass def CLASSES TYPES�CODEOBJECTS)zbltin-code-objectszcompile FUNCTIONS TYPES�TYPEOBJECTS)zbltin-type-objectsztypes TYPES�FRAMEOBJECTS�
TRACEBACKS�NONE)zbltin-null-objectrK)zbltin-ellipsis-object�SLICINGS�SPECIALATTRIBUTES)�specialattrsrKrs)rpz!class SPECIALMETHODS PRIVATENAMESr<)�typesmodulesr9�PACKAGES�EXPRESSIONS)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIESr`�
PRECEDENCE�OBJECTS)�objectsro�SPECIALMETHODS)�specialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSESr0)�
customizationzhash repr str SPECIALMETHODS�ATTRIBUTEMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS�CALLABLEMETHODS)zcallable-typeszCALLS SPECIALMETHODSr>)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS�MAPPINGMETHODS)r�zMAPPINGS SPECIALMETHODS�
NUMBERMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS�	EXECUTION)�	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS�
NAMESPACES)�namingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES�DYNAMICFEATURES)zdynamic-featuresrK�SCOPING�FRAMESrG)r!ztry except finally raise�CONVERSIONS)�conversionsrK�IDENTIFIERS)�identifierszkeywords SPECIALIDENTIFIERS�SPECIALIDENTIFIERS)z
id-classesrK)zatom-identifiersrK�LITERALS)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�TUPLES�
TUPLELITERALS)�	exprlistszTUPLES LITERALS�LISTS)ztypesseq-mutable�LISTLITERALSr�)�listszLISTS LITERALS)�typesmapping�DICTIONARYLITERALSr�)r5zDICTIONARIES LITERALS�
ATTRIBUTES)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS�
SUBSCRIPTS)�
subscriptionsr>r�)�slicingsr>�CALLS)�callsr�)�powerr�ra)�unaryr��BINARY)�binaryr��SHIFTING)�shiftingr�rc)�bitwiser�)�comparisonszEXPRESSIONS BASICMETHODS)�booleanszEXPRESSIONS TRUTHVALUE�	ASSERTION�
ASSIGNMENT)�
assignmentrbrb)�	augassignr��DELETION�	RETURNING�	IMPORTING)�compoundzfor while break continue)�truthz if while and or not BASICMETHODS)�debugger�pdb)zcontext-managersr%)�CONDITIONAL�LOOPINGr;�	DEBUGGING�CONTEXTMANAGERSNc� �||_||_yr1)�_input�_output)r:�inputrs   rr�zHelper.__init__s�������rc�>�|jxstjSr1)r�r	r�rCs rr�zHelper.inputs���{�{�'�c�i�i�'rc�>�|jxstjSr1)r�r	r�rCs rrz
Helper.output!s���|�|�)�s�z�z�)rc��tj�dddk(r|�yd|jj�d|jj�d�S)NrTrn�?rKrGrz
 instance>)r�stackr+rrrCs r�__repr__zHelper.__repr__%sO���=�=�?�1��a� �C�'��F��(�&*�^�^�%>�%>�%)�^�^�%@�%@�B�	Brc�$�||jur	|j|�y|j�|j
�|jj	d�y#t$r(}|jj	|�d��Yd}~yd}~wwxYw)NrSa
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.
)�_GoInteractiverrrr��intro�interact)r:�requestrs   r�__call__zHelper.__call__-sy���$�-�-�-�
.��	�	�'�"�
�J�J�L��M�M�O��K�K����
���
.����!�!�S�E��*�-�-��
.�s�A�	B�'B
�
Bc��|jjd�		|jd�}|sy	|j�}t
|�dkDr"|d|dcxk(rdvrnn|d|ddvr|dd}|j�dvry|d	k(r|j�n|j|���#ttf$rYywxYw)
NrSzhelp> rUrrrMrT)r��quitr)
rr��getliner��EOFErrorrVrWr-r�r)r:r�s  rr�zHelper.interact=s��������$���
��,�,�x�0����w��m�m�o�G��G��q� �W�Q�Z�7�2�;�%L�*�%L���
�'�!�B�-�7�!�!�B�-���}�}��-�/���&� ��
�
���	�	�'�"�#��&�x�0�
��
�s�B.�.C�?Cc���|jtjurt|�S|jj	|�|jj�|jj
�S)z.Read one line, using input() when appropriate.)r�r	r�rr�r�r�)r:�prompts  rr�zHelper.getlineRsQ���:�:����"���=� ��K�K���f�%��K�K�����:�:�&�&�(�(rc�n�t|t��rX|j�}|dk(r|j��nb|dk(r|j	��nK|dk(r|j��n4|dk(r|j
��n|dddk(r#|j
|j�d�n�||jvr|j|�n�|dvr#tt|�d	|j|�
�n�||jvr|j|�n�||jvr|j|�nk|rt|d	|j|�
�nOttd	|j|�
�n1t|t �r|�nt|d	|j|�
�|j"j%d�y)N�keywords�symbols�topicsr�zmodules rT)r!rr zHelp on %s:)rrrS)r.rDrV�listkeywords�listsymbols�
listtopics�listmodulesrr��
showsymbolr=�evalr�r��	showtopicr�rrr�)r:r�rs   rrzHelper.help[sE���g�s�#��m�m�o�G��*�$�d�&7�&7�&9��I�%�t�'7�'7�'9��H�$�d�o�o�&7��I�%�t�'7�'7�'9���!��
�*�� � ������!3�4��D�L�L�(�$�/�/�'�*B��5�5��D��M�=����f�U��D�M�M�)�4�>�>�'�+B��D�K�K�'�����)@��#�g�}�T�\�\�RX�Y��c�=����f�M�
���
(�$�&��'�=����f�M������$�rc��|jjdjdtjddz��y)Na�Welcome to Python {0}'s help utility! If this is your first time using
Python, you should definitely check out the tutorial 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 get a list of available
modules, keywords, symbols, or topics, enter "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",
enter "modules spam".

To quit this help utility and return to the interpreter,
enter "q" or "quit".
z%d.%drU)rr�r,r	r2rCs rr�zHelper.introps7�������� �F�7�S�%�%�b�q�)�)�*�!	,rc��tt|��}||z}t|�|zdz
|z}t|�D]�}t|�D]s}||z|z}|t|�ks�|jj||�||dz
ks�A|jjdd|dz
t||�z
zz��u|jjd���y)NrTrrS)r|r�rWr{rr�)	r:�items�columnsrn�colwr}�rowr~r�s	         rr|zHelper.list�s����V�E�]�#�������E�
�W�$�q�(�W�4����;�C��W�~���$�J��$���s�5�z�>��K�K�%�%�e�A�h�/��W�q�[�(����)�)�#��t�a�x�#�e�A�h�-�7O�0P�*P�Q�&�
�K�K���d�#�rc��|jjd�|j|jj	��y)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rr�r|r�r�rCs rr�zHelper.listkeywords�s4��������	�	
�	�	�$�-�-�$�$�&�'rc��|jjd�|j|jj	��y)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rr�r|r�r�rCs rr�zHelper.listsymbols�s4��������	�
	
�	�	�$�,�,�#�#�%�&rc��|jjd�|j|jj	��y)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rr�r|r�r�rCs rr�zHelper.listtopics�s4��������	�	
�	�	�$�+�+�"�"�$�%rc�^�	ddl}|jj||jj|��}|s(|jjdt|�z�yt|t�r|j||�S|\}}	|jj|}|j�dz}|r|xsddz|z}|rRddl
}ddj|j��zdz}	|j!|	d	�}
|d
dj|
�zz
}|j"�t%|�y|jj|�y#t$r|jjd�YywxYw#t$r*|jjdt|�z�YywxYw)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
rSrKr�Related help topics: r��Hz
%s
)�pydoc_data.topicsrrr�r�rr�rr.rDr��KeyErrorrV�textwraprXr�wrapr�r�)r:�topic�
more_xrefs�
pydoc_data�target�label�xrefsr=r�rj�wrapped_texts           rr�zHelper.showtopic�s���	�$��������
�
�(9�(9�%�(@�A����K�K���?�$�u�+�M�N���f�c�"��>�>�&�*�5�5����u�	��#�#�*�*�5�1�C��i�i�k�D� ����[�b�C�'�*�4�E���*�T�Y�Y�u�{�{�}�-E�E��L�D�#�=�=��r�2�L��8�d�i�i��5�5�5�C��<�<���#�J��K�K���c�"��?�	��K�K����
�
�	�� �	��K�K���?�$�u�+�M�N��	�s#�E�
E9�$E6�5E6�90F,�+F,c�R�	ddl}|jj||jj|��}|std��t
|t�r|j||�S|\}}|jj|}|r|xsddz|z}||fS#t$rYywxYw)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�rKzcould not find topicrKr)	r�rr�rr�r&r.rD�	_gettopic)r:rrrrrrr=s        rrzHelper._gettopic�s���	
�$��������
�
�(9�(9�%�(@�A����3�4�4��f�c�"��>�>�&�*�5�5����u����&�&�u�-����[�b�C�'�*�4�E��E�z����	
�
�	
�s�B�	B&�%B&c�p�|j|}|jd�\}}}|j||�y)Nr)r��	partitionr�)r:�symbolrrr�rs      rr�zHelper.showsymbol�s4�����f�%�� �*�*�3�/���q�%����u�e�$rc�n��|r6|jjdj|��t|�y|jjd�i}|fd���fd�}t	�j�|��|j
|j��|jjd�y)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...

c�\�|r|dddk(r|dddz}|jd�dkrd||<yy)N����	.__init__rqrrrT)�find)r
r]rrs    r�callbackz$Helper.listmodules.<locals>.callback�sB���w�r�s�|�{�:�%�c�r�l�\�9�G��<�<��$�q�(�'(�G�G�$�)rc����d|d�yr1r�)r]rs �r�onerrorz#Helper.listmodules.<locals>.onerror�s�����w��-r�rz�
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�runr|r�)r:r�rrrs    @rr�zHelper.listmodules�s������K�K�����F�3�K�	
�

�C�L��K�K����
��G�6=�
)�

.��O����'��:��I�I�g�l�l�n�%��K�K����
rr�)F)r��PrU)!r)rrr��_strprefixes�_symbols_inverser�r�r�symbols_rrr�r�r/r�rr�rAr�r�r�r�rr�r|r�r�r�r�rr�r�)rQ�pr�s000rrrise��$���$���$�	��$�	�y�	$�
	
�f�$�	�.�
$�	��$�	��$�	�'�$�	�4�$�	�-�$�	��$�	�&�$�	��$�	�%�$� 	�%�!$�"	�5�#$�$	�.�%$�&	��'$�(	�3�)$�*	
�"�+$�,	�'�-$�.	
�'�/$�0	
�l�1$�2	�)�3$�4	�5�5$�6	�y�7$�8	
�i�9$�:	��;$�<	�(�=$�>	�)�?$�@	�$�A$�B	�:�C$�D	�<�E$�F	��G$�H�N$8�L�#7�a��A�A��E��E�#7�L�L��%��e�;�l�;�N�?��!B�4��
��$��
%�
/��
*�
��
�+�
�
%�
%�
(�
(��G�",�1�1�3���x��F��[�[���/�F��F�"��#���-��$�G�F�O�	�4�	�x���U��=�U�	�(�U�
	�A�U�	�4�
U�	�(�U�	�=�U�	�,�U�	�+�U�	�1�U�	�I�U�	�N�U�	�4�U� 	�>�!U�"	�H�#U�$	�<�%U�&	��'U�(	�g�)U�*	�)�+U�,	�9�-U�.	�1�/U�0	�A�1U�2	�-�3U�4	�H�5U�6	�.�7U�>	�]�?U�@	�m�AU�B	�'�CU�D	�4�EU�J	�I�KU�L	�M�MU�N	�E�OU�P	�/�QU�T	�G�UU�V	�,�WU�Z	�K�[U�\	�W�]U�^	�3�_U�`	�<�aU�b	�,�cU�d	�@�eU�f	�*�gU�h	�E�iU�j	�0�kU�l	�0�mU�n	�8�oU�r	�+�sU�t	�9�uU�v	�5�wU�x	�3�yU�z	�>�{U�|	�?�}U�~	�Z�U�@	�:�AU�B	�3�CU�D	�)�EU�F	�)�GU�H	�)�IU�J	�+�KU�L	�/�MU�N	�-�OU�P	�A�QU�R	�9�SU�T	�X�UU�V	�;�WU�X	�=�YU�Z	�E�[U�\	�X�]U�^	�X�_U�`�;�C�(�7�iU�F�n��(��(��*��*�B��X�N�-�� #�*)� �*,�&$�(�'�&�"#�H�6%�
��[
Ms�9H#rc��eZdZdZdd�Zy)rz7An interruptible scanner that searches module synopses.Nc��|r|j�}d|_i}tjD]|}|dk7s�	d||<|�|d|d��t	|�j
xsd}|j
d�d}|dz|z}|j�j|�dk\s�s|d||��~tj|��D�]0\}	}}
|jr�n|�|d|d��$	|	j|�}|j}t|d	�rU	|j|�}
t!t#j$|
��xsd}t|d
�r|j'|�}n[d}nX	t(j*j-|�}|j
r|j
j1�dnd}t3|dd�}|dz|z}|j�j|�dk\s��'||||���3|r|�yy#t$rY��KwxYw#t$r|r||�Y��ewxYw#t.$r|r||�Y��wxYw)NF�__main__rTrKrSrr�r�
get_source�get_filenamer�)r-r�r	r�
__import__r@rrr�r�	find_specrr�r�r r�r�r��StringIOr!r�r�r�rr�r)r:rr��	completerr�seenr]r#rr�r�r�r��sourcer
r�s                rrzModuleScanner.run	s=���c�i�i�k����	����/�/�G��*�$� !��W�
��;��T�7�B�/�%�g�.�6�6�<�"�D��:�:�d�+�A�.�D�"�U�?�T�1�D��z�z�|�(�(��-��2� ��w��5�0�)0�(=�(=�g�(N�(N�$�H�g�u��y�y���{���w��+��#�-�-�g�6�D������6�<�0�!�!'�!2�!2�7�!;��
+�2�;�;�v�+>�?�E�2�D��v�~�6�%�2�2�7�;��#��!�!*�!5�!5�!;�!;�D�!A��
>D�^�^�6�>�>�4�4�6�q�9�QS�D�"�6�*�T�:�D�����-���:�:�<�$�$�S�)�Q�.��T�7�D�1�I)O�L��K���;#�����%�!�"�#�G�,� �!��'�!�"�#�G�,� �!�s6�&H�H�%H*�	H
�H
�H'�&H'�*I�IrW)r)rrr@rr�rrrr	s
��A�8rrc���d�}d�}tj�5tjd�t�j	|||��ddd�y#1swYyxYw)zAPrint all the one-line module summaries that contain a substring.c�J�|dddk(r|dddz}t||xrd|z�y�Nrrrqz- )r)r
r]rs   rrzapropos.<locals>.callbackG	s3���2�3�<�;�&��c�r�l�\�1�G�
�g�t�+��t��,rc��yr1r��r]s rrzapropos.<locals>.onerrorK	s��r�ignorerN)r��catch_warnings�filterwarningsrr)r�rrs   rrrE	sI��-�
�	�	 �	 �	"�����)�����H�c�7��;�
#�	"�	"�s�2A�Ac�������	�
�ddl�ddl�ddl�	ddl�
Gd�d�jj
��G�	fd�d�jj��G�����
fd�d�
j�}||||�}|j�|jsS|jr|js;tjd	�|js|js�.|js�;|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��eZdZd�Zd�Zy)�!_start_server.<locals>.DocHandlerc�8�|jjd�rd}nd}|jd�|jdd|z�|j	�|j
j
|j|j|�jd��y)	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)	r
r��
send_response�send_header�end_headers�wfiler��
urlhandlerr�)r:�content_types  r�do_GETz(_start_server.<locals>.DocHandler.do_GET�	s���y�y�!�!�&�)�)��*�����s�#����^�-@�<�-O�P������J�J���T�_�_��	�	�<�)�)/����
:rc��yr1r�)r:rs  r�log_messagez-_start_server.<locals>.DocHandler.log_message�	s��rN)r)rrr=r?r�rr�
DocHandlerr2�	s��	:� 	rr@c�$��eZdZd�Z�fd�Zd�Zy)� _start_server.<locals>.DocServerc��||_|j|f|_||_|jj	||j|j
�d|_y�NF)�host�addressrr<r��handlerr�)r:rE�portrs    rr�z)_start_server.<locals>.DocServer.__init__�	sE���D�I� �I�I�t�,�D�L�$�D�M��I�I���t�T�\�\�4�<�<�@��D�Irc����|jsP�j|jj�gggd�\}}}|r|j	�|js�P|j�yr})r��select�socketr��handle_request�server_close)r:�rd�wr�exrJs    �r�serve_until_quitz1_start_server.<locals>.DocServer.serve_until_quit�	sZ����i�i�#�]�]�D�K�K�,>�,>�,@�+A�2�r�1�M�
��B����'�'�)��i�i�
���rc�v�|jj|�|jr|j|�yyr1)r<�server_activaterrCs rrSz0_start_server.<locals>.DocServer.server_activate�	s,���I�I�%�%�d�+��}�}��
�
�d�#�rN)r)rrr�rQrS)rJs�r�	DocServerrB�	s���	�	 �	$rrTc�4��eZdZ�fd�Z����fd�Zd�Zd�Zy)�#_start_server.<locals>.ServerThreadc���||_||_t|�|_�jj|�d|_d|_d|_yrD)	r;rEr�rH�Threadr��serving�error�	docserver)r:r;rErH�	threadings    �rr�z,_start_server.<locals>.ServerThread.__init__�	sE���(�D�O��D�I��D�	�D�I����%�%�d�+� �D�L��D�J�!�D�Nrc�n��	�jj�_��_�jj
�_t|j��_�|j|j|j�}||_|j�y#t$r}||_Yd}~yd}~wwxYw)zStart the server.N)�server�
HTTPServerr<rGr�Message�MessageClass�staticmethodr;rErH�readyr[rQr�rZ)r:�docsvrrr@rT�email�https   ����rrz'_start_server.<locals>.ServerThread.run�	s����	
!�!%���!7�!7�	��$.�	�!�*/�-�-�*?�*?�
�'�(4�T�_�_�(E�
�%�"�4�9�9�d�i�i����D��!'����'�'�)���
!� ��
�
��
!�s�BB�	B4�#B/�/B4c��d|_|j|_|j|_d|j|jfz|_y)NTz
http://%s:%d/)rYrE�server_portrHr�)r:r^s  rrcz)_start_server.<locals>.ServerThread.ready�	s:���D�L����D�I��*�*�D�I�&�$�)�)�T�Y�Y�)?�?�D�Hrc�p�d|j_|j�d|_d|_d|_y)z&Stop the server and this thread nicelyTNF)r[r�rXrYr�rCs r�stopz(_start_server.<locals>.ServerThread.stop�	s.��"&�D�N�N���I�I�K�"�D�N� �D�L��D�HrN)r)rrr�rrcrj)r@rTrerfr\s�����r�ServerThreadrV�	s���	"�	!�	@�	rrkg{�G�z�?)�http.server�
email.messagerJr\r^�BaseHTTPRequestHandlerr_rXr�rZrYr[�time�sleep)r;�hostnamerHrk�threadr@rTrerfrJr\s     @@@@@@r�
_start_serverrsS	s����p�����T�[�[�7�7��,$�D�K�K�*�*�$�*&�&�y�'�'�&�P�*�h��
5�F�
�L�L�N��l�l�F�N�N�v�7G�7G��
�
�3���l�l�F�N�N�v�7G�7G��Mrc�^���	�
���
���G�fd�dt�}|���fd���fd��
�fd��
�fd���fd���fd���fd	��	�fd
�����	�
��
��fd�}|jd�r|d
d}|dk(r�tjj	tjjt��}tjj||�}t|�5}dj|j��cddd�S|dk(r||�Std|�d|����#1swY�xYw)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.
    c���eZdZ�fd�Zy)�_url_handler.<locals>._HTMLDocc	�:��d}d|z}d|�d|�d���d|�d�	S)rdzpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">zH<!DOCTYPE>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Pydoc: z	</title>
z
</head><body>z*<div style="clear:both;padding-top:.5em;">z</div>
</body></html>r�)r:rerf�css_path�css_link�html_navbars     �rrgz#_url_handler.<locals>._HTMLDoc.page�	s/���.�H�C���
��H�k�m�X�?�
?rN)r)rrrg)rzs�r�_HTMLDocrv�	s���
	?rr{c����jtj��dtj�d�dtj��d��}d|�d�jtjd����d	�S)
Nz [rr�rnz=
            <div style='float:left'>
                Python �<br>T)�tersea
            </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>
            )rJr��python_version�python_build�python_compiler)r�rs �rrzz!_url_handler.<locals>.html_navbar	
sg����+�+�x�/F�/F�/H�/7�/D�/D�/F�q�/I�/7�/G�/G�/I�K�L��0�D�K�K��(9�(9��(E�F�+H�	Hrc���d�}�jd�}tjD�cgc]	}|dk7r|��}}�j||�}|d�j	dd|�zg}i}tj
D]#}|j
�j||���%|j
d�dd	j|�fScc}w)
zModule Index page.c��d|�d|�d�S�Nr�r�r�r��r#s r�	bltinlinkz3_url_handler.<locals>.html_index.<locals>.bltinlink'
�
��15�t�<�<rz/<strong class="title">Index of Modules</strong>rz<p>zBuilt-in Modulesr�zf<p align=right class="heading-text grey"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</p>zIndex of ModulesrK)	rkr	rrrtr
rr�rX)r�rkr#�namesrfr&rrs       �r�
html_indexz _url_handler.<locals>.html_index$
s����	=��,�,�=�
��#&�":�":�(�":�$��J�&��":��(��#�#�E�9�5���U�T�_�_����&3�3�4�����8�8�C��O�O�D�J�J�s�D�1�2��	���
'�	(�"�2�7�7�8�#4�4�4��(s�B>c���	�g�	�	fd�}tj�5tjd�d�}t�j	|||��ddd�d�}g}�
jd�}�	D]\}}|j
||�|z��!|�
jd|zd	d
j|��z}d|fS#1swY�oxYw)zSearch results page.c�Z��|dddk(r|dddz}�j||xrd|zf�yr*r�)r
r]r�
search_results   �rrz3_url_handler.<locals>.html_search.<locals>.callbackA
s=����r�s�|�{�*�!�#�2�,��5��� � �'�4�+?�D�4�K�!@�Arr-c��yr1r�r,s rrz2_url_handler.<locals>.html_search.<locals>.onerrorH
s��rrNc��d|�d|�d�Sr�r�r�s rr�z4_url_handler.<locals>.html_search.<locals>.bltinlinkM
r�rz-<strong class="title">Search Results</strong>zkey = %sr�r}zSearch Results)	r�r.r/rrrkrrtrX)r�rrr�r�rkr#rrfr�rs         @�r�html_searchz!_url_handler.<locals>.html_search<
s�����
�	B�
�
$�
$�
&��#�#�H�-�
��O����#�w��?�	'�	=����,�,�;�
��(�J�D�$��N�N�9�T�?�T�1�2�(��T�_�_����g�v�{�{�7�';�=�=����)�)�%'�
&�s�5C�C
c����d�}�jd�}ttjj	��}�j||�}|�j
dd|�z}d|fS)zIndex of topic texts available.c��d|�d|�d�S�Nz<a href="topic?key=r�r�r�r�s rr�z4_url_handler.<locals>.html_topics.<locals>.bltinlink]
�
��6:�D�A�Ar�$<strong class="title">INDEX</strong>�Topicsr�)rkr�rr�r�rrt)r�rkr�rfrs    �r�html_topicsz!_url_handler.<locals>.html_topicsZ
sn���	B��,�,�2�
���v�}�}�)�)�+�,���#�#�E�9�5���T�_�_��g�x�)�)����!�!rc�����jd�}ttjj	��}d�}�j||�}|�j
dd|�z}d|fS)zIndex of keywords.r�c��d|�d|�d�Sr�r�r�s rr�z6_url_handler.<locals>.html_keywords.<locals>.bltinlinkq
r�r�Keywordsr�)rkr�rr�r�rrt)rkr�r�rfrs    �r�
html_keywordsz#_url_handler.<locals>.html_keywordsj
sn����,�,�2�
���v���+�+�-�.��	B��#�#�E�9�5���T�_�_����+�+���8�#�#rc����tj�}t||�}|j|�\}}||jvrd}nd}�jd|z�}d�j
|�z}�j|d|�}|rAt|j��}d�}�j||�}�jdd|�}|�d|��d	j|||f�fS)
zTopic or keyword help page.�KEYWORD�TOPICr�z
<pre>%s</pre>r�c��d|�d|�d�Sr�r�r�s rr�z7_url_handler.<locals>.html_topicpage.<locals>.bltinlink�
s
��:>��E�Err�rrK)
r�r$rrr�rkr�rtr�rrrrrX)	r�buf�htmlhelprfrrerkr�rs	        �r�html_topicpagez$_url_handler.<locals>.html_topicpagey
s�����k�k�m���#�s�#��"�,�,�U�3���%��H�%�%�%��E��E��,�,�/�%�7�
��#�T�[�[��%:�:���?�?�5�7�H�=����5�;�;�=�)�E�
F��$�$�U�I�6�E��L�L�!8�'�5�I�E� �%�(�����(�E�2�3�5�	5rc���t|d��}|�|dk7rtd��t|�}�j||�}||fS)NrT)r	r zcould not find object)rr&rr)r�r9re�contentrs    �r�html_getobjz!_url_handler.<locals>.html_getobj�
sI����S�A�&���;�3�&�=��4�5�5���
���-�-��S�)���g�~�rc����jd�}dj�fd�tt|�|�D��}|�j	|d|�z}d|z|fS)Nz$<strong class="title">Error</strong>r}c3�@�K�|]}�j|����y�wr1)rJ)rQr�rs  �rrSz3_url_handler.<locals>.html_error.<locals>.<genexpr>�
s#�����F�D�6:�t�{�{�4�0�D�s�rZz
Error - %s)rkrXrrCrt)r�r�rkrfrs    �r�
html_errorz _url_handler.<locals>.html_error�
sf����,�,�2�
���;�;�F�4�T�#�Y��D�F�F���T�_�_�S�'�8�D�D���c�!�8�+�+rc�J��|}|jd�r|dd}	|dvr�
�\}}n�|dk(r��\}}n�|dk(r��\}}nsd|vrd|jd�\}}}|dk(r�|�\}}nI|d	k(r
	�
|�\}}n7|d
k(r|dvr�
�\}}n#	�	|�\}}ntd���	|�\}}�j	||�S#t$r�	|�\}}Y�(wxYw#t$r�
|�\}}Y�BwxYw#t$r}�||�\}}Yd}~�`d}~wwxYw)zGenerate an HTML page for url.r)N���)rKr�r�r�r0z
search?keyz	topic?keyzget?keyz
bad pydoc url)r�r
r&r�rg)r��complete_urlrer��opr�r�rr�r�r�r�r�r�r�s       ��������r�
get_html_pagez#_url_handler.<locals>.get_html_page�
sf������<�<�� ��c�r�(�C� 	;��m�#�!+����w����!,����w��
�"�!.����w���� �]�]�3�/�
��A�s���%�%0��%5�N�E�7��;�&�:�)7��)<���w��9�_��m�+�)3����w�A�-8��-=�N�E�7�%�_�5�5�!,�S�!1���w��y�y���(�(��%&�:�)4�S�)9���w�:�� *�A�-;�C�-@�N�E�7�A���	;�'��c�:�N�E�7��	;�s`�AD�:C�D�C)�&D�C&�#D�%C&�&D�)D�=D�?D�D�	D"�D�D"r(rTNr4rKr5zunknown content type z	 for url )rbr�rr
�dirname�realpathr�rXr��	readlinesrG)r�r<r{r��	path_hererx�fprr�r�r�r�rzr�r�r�s       @@@@@@@@@r�_url_handlerr��	s�����?�7�?�$�:�D�H�65�0*�<"� 
$�5�2�,�&)�&)�P�~�~�c���!�"�g���z�!��G�G�O�O�B�G�G�$4�$4�X�$>�?�	��7�7�<�<�	�3�/��
�(�^�r��7�7�2�<�<�>�*�	+�	+�	��	$��S�!�!�
�L�#�N�
O�O��^�s�D#�#D,T�	localhost)�open_browserrqc���ddl}tt||�}|jrt	|j�y|j
r�d}|r|j
|j�	t	d|j�t	|�|j
rZtd�}|j�}|dk(rn9|dk(r|j
|j�nt	|�|j
r�Z|j
r|j�t	d�yyy#ttf$r
t	�Y�EwxYw#|j
r|j�t	d�wwxYw)	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 ready atzserver> r�r�zServer stopped)
�
webbrowserrsr�rZrrYr�r�r�r-r�r�rj)rHr�rqr��serverthread�server_help_msgr�s       r�browser��
s/��� ��x��>�L����
�l� � �!�����>����O�O�L�,�,�-�	(��#�\�%5�%5�6��/�"��&�&��J�'���i�i�k���#�:���C�Z��O�O�L�$4�$4�5��/�*��&�&��#�#��!�!�#��&�'�$�'�� "�8�,�	��G�	���#�#��!�!�#��&�'�$�s%�$BD�D1�.D4�0D1�1D4�4*Ec�j�t|t�xr"|jtj�dk\Sr�)r.rDrr�sep)r�s r�ispathr��
s%���a���5�!�&�&����.�A�"5�5rc��d|vs(tj|vstj�|vrytjj	t
�}tjj	|�}|j
�}||vr1tjj||�s|j|�|jdtj��|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.
    rKNr)
r�curdir�getcwdr
r�r��copy�samefile�remove�insert)�
given_path�argv0�
stdlib_dir�
script_dir�revised_paths     r�_get_revised_pathr�s���
�Z��2�9�9�
�2�b�i�i�k�Z�6O��������*�J�������'�J��?�?�$�L��Z�����(8�(8��Z�(P����J�'�����2�9�9�;�'��rc��ttjtjd�}|�|tjddyy)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�r	r
�argv)r�s r�_adjust_cli_sys_pathr�s4��
%�S�X�X�s�x�x��{�;�L���"������ rc��ddl}Gd�dt�}t�	|jtjddd�\}}d}d}d}d}d}|D]:\}	}
|	d	k(rd
}d
}|	dk(r
t|
�y|	dk(rd
}|
}|	d
k(rd
}|	dk(s�7d
}|
}�<|rt
|||��y|s|�|D]�}t|�rBtjj|�s#td|z�tjd�	t|�r*tjj|�rt|�}|rBt|�r+tjj|�rt!|�n#t#|�nt$j%|d
����y#t&t(f$r+}t|�tjd�Yd}~��d}~wwxYw#|j*|f$r}tjj-tjj/tjd��d}
tdj1|
tj2���YywxYw)z@Command-line interface (looks at sys.argv to decide what to do).rNc��eZdZy)�cli.<locals>.BadUsageN)r)rrr�rr�BadUsager�)s�rr�rTzbk:n:p:wFr�z-bTz-kz-pz-wz-n)rqr�zfile %r does not exist)ra�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�r	r�rr�r�rr
�existsr�exitr�rrrrrrr�rZr�r�r,r�)r�r��optsr�writing�start_serverr�rHrq�opt�val�argr�r�s              r�clir�&s����#�9�#���M!��]�]�3�8�8�A�B�<��<�
��d������������H�C���d�{�#��#���d�{������d�{�#�����d�{����d�{�#����� ��4�(��F���8�^��C��c�{�2�7�7�>�>�#�#6��.��4�5������
��#�;�2�7�7�>�>�#�#6�$�S�/�C���c�{�r�w�w�}�}�S�'9�!�#�� ��
��I�I�c�$�I�/���� �!2�3�
��e���������
��
�L�L�(�#�!��g�g���r�w�w�/�/������<�=�a�@��
��:�F�s����F��;	!�!�sQ�AG�2G�G�AG�6BF	�G�	G� F>�8G�>G�G�BI�Irr�)r)� Python Library Documentation: %srN)r�rNF)rKN)r5)cr@r�r�r�r�r�r$�importlib._bootstrapr��importlib._bootstrap_external�importlib.machinery�importlib.utilrr�rr�r�rMr	r4ror��urllib.parser�r��collectionsr�reprlibr�	tracebackrrr$r>r7rIrQrZr^rarhrlrtr��
IGNORECASErvrxr{r�r�r|�all_feature_namesr�r�r�r�r�r�r�r�r�rrrr7rbrZr`r�r�r�r�r�r�r�r�r�rrrjrrr	rr=rrrrrrrsr�r�r�r�r�r�r)r�rr�<module>r�s`��%�L�(��
)�
��������$����	�	���	�
��������+�

��1�f
�!� A�
 ��%�G����b�j�j�5�r�}�}�E��(�

���"�J�8�8�9��(�0�
���" �%�NK�	�K�&+�$ !��(�X6�6�t(�t�(�TW	7�c�W	7�v:�t�:�@X�c�X�t�G���"�H#��0
/�F�
*2�X2� �6�*�y���O�	��y��>�KL��C�6DE�!��"#��[�[�z�x��;�;�z
<�V�riP�X (�4�+� (�J6��8#�T!�l�z���E�r

Hacked By AnonymousFox1.0, Coded By AnonymousFox