� c��jd����dZdgZdZdZdZddlZddlZddlZddlZ ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd lmZd �Z d �Z!d �Z"d �Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+ejXdejZ�Z.d�Z/d�Z0d�Z1d�Z2e3ejh�Z5dPd�Z6d�Z7d�Z8d�Z9d�Z:ifd �Z;Gd!�d"e<�Z=d#�Z>difd$�Z?Gd%�d&�Z@Gd'�d(e�ZAGd)�d*e@�ZBGd+�d,e�ZCGd-�d.e@�ZDGd/�d0eD�ZEd1�aFd2�ZGd3�ZHd4�ZId5�ZJd6�ZKd7�ZLd8�ZMd9�ZNdQd:�ZOeD�ZPeE�ZQeB�ZRdQd;�ZS dRd<�ZT dSd=�ZUdQd>�ZVdTd?�ZWGd@�dA�ZXeX�ZYGdB�dC�ZZdD�Z[dE�Z\dUdF�Z]dQdGdHdI�dJ�Z^dK�Z_dL�Z`dM�ZadN�ZbecdOk(reb�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 " to show documentation on something. 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 " to search for a keyword in the synopsis lines of all available modules. Run "pydoc -n " to start an HTTP server with the given hostname (default: localhost) on the local machine. Run "pydoc -p " 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 " to write out the HTML documentation for a module to a file named ".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 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 �/usr/lib64/python3.12/pydoc.py�pathdirsrSsz�� �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|jj d�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>is���������|�|�$�$���|�|�� �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|jvrM|jjd�d}|j|k7r|j�|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�s��� �f�!�!�!��"�"�-�-�c�2�1�5�� � � �� '�F�,=�,=�,I��$�$�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&t t ||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�:s����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�z!sort_attributes..Ps���K�O�O�D��G�Q�7��a��Ar�r�N)r� enumeraterWrG�sort)�attrsrA�fields�ir#�keyfuncr�s @r�sort_attributesr�Gst����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)r r r�isfilerX)r �exts r� ispackager�UsH�� �w�w�}�}�T��"�C��w�w�~�~�b�g�g�l�l�4��c�1A�B�C��#� rc���d} tj|j�}|D�]\}}}}}|tjk(r||z }�#|tjk(r�t j �5t jdt�tj|�}ddd�tt�sy|j�jd�dj�cS|tjk(r |dvr||z }��|tj tj"tj$fvs��y y#1swY��xYw#tj&t(t*f$rYywxYw)z8Return the one-line summary of a file object, if presentrK�ignoreNrSr)�(�))�tokenize�generate_tokens�readline�STRING�NEWLINE�warnings�catch_warnings� simplefilter� SyntaxWarning�ast� literal_evalr.rDrVr�OP�COMMENT�NL�ENCODING� TokenError�UnicodeDecodeError� SyntaxError)�file�string�tokens�tok_type� tok_stringr�� docstrings r�source_synopsisr�]s/���F���)�)�$�-�-�8��-3� )�H�j�!�Q���8�?�?�*��*�$���X�-�-�-��,�,�.��)�)�(�M�B� #� 0� 0�� 8�I�/�"�)�S�1�� ���(�.�.�t�4�Q�7�=�=�?�?��X�[�[�(�Z�:�-E��*�$���(�"2�"2�H�K�K��AR�AR�!S�S��.4�" �/�.�� � � �!3�[� A����sC�A+E �/0E�E �91E �+AE �;E �=E �E �E � E-�,E-c�t�tj|�j}|j|d�\}}|�||k�rY|j t t jj��rt jj}nO|j t t 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�ExtensionFileLoaderr��open�OSErrorr��util�spec_from_file_location� _bootstrap�_loadr rr@� splitlines) �filename�cache�mtime� lastupdaterP� loader_clsr�r��spec�modules r�synopsisr�vsz�� �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�sBt|t�sJ�t|�|_||_|j |_||_ ytjdt�|\|_|_|_||_ y)NzCA tuple value for exc_info is deprecated, use an exception instance) r.r�� BaseExceptionrC�excr�� __traceback__�tbr��warn�DeprecationWarningr�)r:r��exc_infos rr�zErrorDuringImport.__init__�ss���(�E�*��h� �6� 6�6��H�~�D�H�!�D�J��,�,�D�G� !�� � �M�M�_�,� .�-5� )�D�H�d�j�$�'� �� rc�l�|jj}d|j�d|�d|j��S)Nz problem in � - z: )rr)r�r�)r:rs 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�>� 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�rCr�r�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��eZdZejj ddejddz�Zd d�Z d d�Z e xZ xZ 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.fails6�� � %�S�4��:�%� %�t�F�|�'<�'<�>���� � r�stdlibc��� tj|�}tjj d|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 �environrr r r r.rCr)r�rX�formatrO�lower)r:rA�basedirr��doclocs r� getdoclocz Doc.getdocloc s)�� ��%�%�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)rrr r<rr � version_infor r(r-r"r#r$r&� docpropertyr%� sysconfig�get_pathrAr 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 eZ y) �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&�z>)rl�r:rjs r�escapezHTMLRepr.escape0s���t�S�'�3���V�D�Drc�.�tj||�SrB)rr+�r:rAs rr+z HTMLRepr.repr3s���y�y��v�&�&rc �B�tt|�d�rTddjt|�jj ��z}t||�rt ||�||�S|j ttt|��|j��S�Nr)�repr_r�) r�rCrXr)rrr[rtrxr+rS�r:r��level� methodnames r�repr1zHTMLRepr.repr16sy�� �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|dzSt j dd|j |��S)N�\�\\rK�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z\1)rtrRr+rlr[rMrN�r:r�rb�test�testreprs r� repr_stringzHTMLRepr.repr_string=s}���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>)r[rtrxr+rRr+r)�r:r�rbs r� repr_instancezHTMLRepr.repr_instanceJsQ�� 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�r[r+rdrl�repr_strrp� repr_unicoder rrrHrH(s4��L�-� E�'�B� -��H�G� �LrrHc� �eZdZdZe�Zej ZejZd�Zdd�Z dd�Z d�Z d�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 Python: z z r )r:�title�contentss r�pagez HTMLDoc.page[s���H�&� &rc��d|�d|xsd�d�S)zFormat a page heading.zU
 
z
� z
r )r:rw�extrass r�headingzHTMLDoc.headinggs�� �&�$�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.zr{zz-

z z-decor">z
 
z
z z
�z. %s
r ) r:rwr"rx�width�prelude� marginalia�gaprPs r�sectionzHTMLDoc.sectionps{�� � �.��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&%s)r�)r:rwr's r� bigsectionzHTMLDoc.bigsection�s"��8�5�@���t�|�|�E�)�D�)�)rc �f�|j|j��}t|dddddddd� S)z!Format literal preformatted text.� z r*r{rS�
)r[� expandtabsrlrZs r� preformatzHTMLDoc.preformat�s7���{�{�4�?�?�,�-���t�V�W�f�g� �(�D�(�<� r�rz%s
)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%sr rZs 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.� �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)r]s 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"%s (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%sNrK) r[rM�compile�search�spanr�groupsrl�intr�rX)r:rjr[�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

r��, r�z
z
%s
z
%s
)r.r�r�rrXr�� formattree) r:�treer]�parentrP�entry�c�bases�parentsr<s rr�zHTMLDoc.formattrees������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"�}|dd d k(r|ddd k(r|d dj%�}|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�!%sr0r�� � $Revision: �$z version %sr�z (%s)r�z-
Module ReferencerKzindex
�#r�z#-z%sz

%s

r�rzPackage Contentsz pkg-contentc�,���j|d�Sr})r�)�tr:s �rr�z#HTMLDoc.docmodule..gs���4�?�?�1�Q�4�#8r�Modules�Classes�indexr*� Functions� functions�Data�datar�r��Author�authorr��Credits�credits)6r)�__all__r8rr�rWrrXrr;�urllib�parse�quoter�rGr�rDr�rVr[r�rA�localsr}r~rcr � getmoduler�rrr rrrrdr-r,rhr�rQr��pkgutil� iter_modulesr�r�r�r�r�r�� getclasstreer(r�r�)#r:rAr#�mod�ignoredr��parts�linksr�� linkedname�headr r�r��info�versionr@rPrr��cdictr�r�r<r]r�r��fdictr�r=�modpkgs�importer�ispkgrx� classlists#` rr"zHTMLDoc.docmodules�������� ��.�.�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.HorizontalRulec��d|_yr���needonerTs rr�z1HTMLDoc.docclass..HorizontalRule.__init__�� �� �� rc�<��|jr�d�d|_y)Nz
rTr��r:�pushs �r�maybez.HTMLDoc.docclass..HorizontalRule.maybe������<�<���N� �� rN�r)rrr�r��r�s�r�HorizontalRuler��� ��� !� !rrrUz&
Method resolution order:
z
%s
�
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..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||� ���"|SrB�r�r�r%� rr�r�rr#r�rr�r r�r�r:s ����r�spilldescriptorsz*HTMLDoc.docclass..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;�j t |��j � � � �} d| z} �d|�| �d���d���|S)Nz
%s
z
%s�
rrS)r�r�r&rrQr�r�)rr�r�rr#r�rr�r<r=r�r�r r r�rAr�r:s ��������r� spilldataz#HTMLDoc.docclass..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..�����A�a�D�I� z Methods %sc��|ddk(S�NrTr�r �r�s rr�z"HTMLDoc.docclass..�� ��A�a�D�H�$4rzClass methods %sc��|ddk(S�NrTz class methodr rs rr�z"HTMLDoc.docclass..�� ��A�a�D�N�$:rzStatic methods %sc��|ddk(S�NrTr�r rs rr�z"HTMLDoc.docclass..� ��A�a�D�O�$;rzReadonly properties %sc��|ddk(S�NrTr�r rs rr�z"HTMLDoc.docclass..���q��t�7J�/JrzData descriptors %sc��|ddk(S�NrTr�r rs rr�z"HTMLDoc.docclass..���q��t�7H�/HrzData and other attributes %sc��|ddk(S�NrTr�r rs rr�z"HTMLDoc.docclass..� ���!���rrK� class � zz = class r��(%s)r�N�()r�z&%s
 
rwrn)r)rrrr�getmrorWr�r�rr�r�rrrG�popleftr��builtinsrAr�rX� signature� ValueErrorrDr[rQr�r�r�)#r:rAr#r�r�r�r��realnamer�rxr�mror<r rrr�r"r�r�r�r�anchor� inherited�tagrwr��declr7�argspecr=r r r�rs#`` ``` @@@@rr#zHTMLDoc.docclass�s�����?�?����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��B�;� �;��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<�1M �2 M �?M�/M*� M�M� M'�&M'�*M>�=M>c�H�|jd|j|�z�S�z)Format an argument default value as text.�=)r�r+r]s 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 r0z ">r1z
%sz
%s
z%
%s
rzr)r)r{r*rrr r�r+r1�ismethodwrapperr3r8r,rrr��iscoroutinefunction�isasyncgenfunction�getattr_staticr�rdr7r8rGrD�__annotations__r[r�r�rQr�)r:rAr#r�r�r�r�r�rr9r;�note�skipdocs�imfunc�imself�objclass�pname�asyncqualifierrw�reallinkr?r7r>r=s rr$zHTMLDoc.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!
%s
z&
%s
rrK)rr�rQr�rX� r:rAr#r�r�r�r�r�r=s rr%zHTMLDoc.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%s = rK�r+)r:rAr#r�r��lhss rr&zHTMLDoc.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� z HTMLDoc.index..�s"����@�4�R�F�c�"�g�/��/�/�4�s�#%rKrTr�)r�r��anyrr�r�r�r�)r:rr�r�r�r#r�rxs 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)�rKNr{rBr��NNN)r)rrr@rH�_repr_instancer+r[ryr}r�r�r�r�r�r�r�r�r�r�r�r�r�r"r#rCr$r%rDr&r�r rrrtrtRs���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�'� 7rrtc�,�eZdZdZd�Zd�Zd�ZeZd�Zy)�TextReprzAClass for safely making a text representation of a Python object.c�t�tj|�dx|_|_d|_dx|_|_yrJrNrTs rr�zTextRepr.__init__�rUrc�$�tt|�d�rTddjt|�jj ��z}t||�rt ||�||�St tt|��|j�Sr_) r�rCrXr)rrrtrxr+rSras rrdzTextRepr.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)NrfrgrKrhr)rtrRr+rlris rrlzTextRepr.repr_string�sV���A�t�~�~�&����:�� �4�<�D���%��(D�D���!��$�t�+�h�q�k�9� 9��rc�� ttt|��|j�S#d|jj zcYSxYwrn)rtrxr+rRr+r)ros rrpzTextRepr.repr_instance�s=�� :����Q��(�$�.�.�9� 9�� :�"�Q�[�[�%9�%9�9� 9�s �'*�AN) r)rrr@r�rdrlrqrpr rrrlrl�s ��K�-� 5���H�:rrlc��eZdZdZe�Zej Zd�Zdd�Zd�Z dd�Z dd�Z dd�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 rbs rrezTextDoc.bold..�s����5��"�r�D�y�2�~��s�)rXrZs 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�prefix�linerYs 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.rSr�)rzrOrv)r:rwrx�clean_contentss rr�zTextDoc.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�wrB�r^)rcr�r]s �rrez%TextDoc.formattree..�s�����D�e��y��G�4�e�s�r2r�rS� )r.r�r^rXr�r�) r:r�r]r�rxrPr�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 d j-|��z}g}t j|t j.�D]:\} } | jj1|d z�s�%| |vs�*|j| ��<|r4|j+�||jd d j-|��z}| r�| D� � cgc]\} } | �� }} } |j3t j4|d�|�g}| D]'\} } |j|j7| | |���)||jdd j-|��z}| rRg}| D]'\} } |j|j7| | |���)||jdd j-|��z}|rTg}|D])\} } |j|j9| | |d����+||jdd j-|��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.�NAMErr�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��CREDITSr0�FILE)%r)rZrQr�rrArr~r r�r�rrdr-rh�setr�r�r�r��addr�rXrcr�r�r�r(r&rDr�rVr�r�r�r;rG)r:rAr#r�r��synop�descrPr�r@r�r�r�r�r�r�� modpkgs_namesr�r]r�� submodulesr�rxr�r�s rr"zTextDoc.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(��}|gk(sJ�|}|r��dj | �} | s|dzS|dz�j9| j;�d)�zdzS#ttf$rd} Y���wxYwcc}}}}w)*z4Produce text documentation for a given class object.c��t||�SrBr)r�rs r�makenamez"TextDoc.docclass..makenameas���Q��?� "r�class z = class r2r�Nr3rSrUzMethod resolution order:r�rKc3�K�|]C}|jjd�s&|jdk(rt|j����Ey�w)r�r6N)r)r�rrD)rcr"s rrez#TextDoc.docclass..�s?���� S�*E�3��L�L�+�+�C�0�S�^�^�z�5Q����� �*E�s�A A r�r�zBuilt-in subclasses:z ... and z other subclassesc���eZdZd�Z�fd�Zy)�(TextDoc.docclass..HorizontalRulec��d|_yr�r�rTs rr�z1TextDoc.docclass..HorizontalRule.__init__�r�rc�<��|jr�d�d|_y)NzF----------------------------------------------------------------------rTr�r�s �rr�z.TextDoc.docclass..HorizontalRule.maybe�r�rNr�r�s�rrr��rrrc ���t||�\}}|rL�j�� |�|D]/\}}}} t� |�}� � j||� � |���1|S#t$r� � j ||� ��Y�XwxYwrBr) rr�r�rr#r�rr�r r�rAr�r:s �����rr zTextDoc.docclass..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||� ���"|SrBr rs ����rrz*TextDoc.docclass..spilldescriptors�rrc ���t||�\}}|r[� j�� |�|D]>\}}}}t|�} t� |�} � �j | |� d|��dz��@|S#t$r|j |} Y�=wxYw)Nr��rqr=rS)r�r�rQrr8�__dict__r&)rr�r�rr#r�rr�r=r9r r�rAr�r:s �����rrz#TextDoc.docclass..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 � B rrc���|d�uSrr rs �rr�z"TextDoc.docclass..�rrrrz Methods %s: c��|ddk(Srr rs rr�z"TextDoc.docclass..�r rzClass methods %s: c��|ddk(Sr"r rs rr�z"TextDoc.docclass..�r#rzStatic methods %s: c��|ddk(Sr%r rs rr�z"TextDoc.docclass..�r&rzReadonly properties %s: c��|ddk(Sr(r rs rr�z"TextDoc.docclass..�r)rzData descriptors %s: c��|ddk(Sr+r rs rr�z"TextDoc.docclass..�r,rzData and other attributes %s: c��|ddk(Sr.r rs rr�z"TextDoc.docclass..�r/rz | )r)rrrv�maprXrrr7r8rGrDrQrr4rW�sortedrC�__subclasses__r>r�r�r5r�r6rAr^r�rzrO)!r:rAr#r�r�r9r�r�rwr�rxr7r?r=r:r<� subclasses�no_of_subclasses�MAX_SUBCLASSES_TO_DISPLAY� subclassnamerr rrr�r"r�r�r<r=r r�rs!`` ` @@@rr#zTextDoc.docclass[s�����?�?����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��B�;� �;��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|�zSrAr]r]s rrCzTextDoc.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&rErFrGrHrrIrJT� = rKz lambda rTrrLrS)r)r{r*rrr r^r+r1rMr3r8r,rrrarNrOrvrPr�rdr7r8rGrDrQrQrzrO)r:rAr#r�r�rr9rRrSrTrUrVrWrXrwr?r7r>r=s rr$zTextDoc.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)rrvrQrzrXr[s rr%zTextDoc.docdataHsb�����~�~�� � ����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} |s t|�}|r#| d|j t |��zdzz } | S)z-Produce text documentation for a data object.r�rKrNrorS)r+rWrvrQrzrD) r:rAr#r�r�rqr=r�r+ry�chops rr&zTextDoc.docotherXs����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)r�)NrKr�)NNNNri)r)rrr@rlrjr+rvrzr�r�r"r#rCr$r%rDr&r rrrrrr�se��1��Z�N� � � �D�6� � A�� c�JXL�t'�ML�^  ��K� ��$� rrrc��eZdZdZd�Zy)� _PlainTextDocz2Subclass of TextDoc which overrides string stylingc��|SrBr rZs rrvz_PlainTextDoc.boldis��� rN)r)rrr@rvr rrr�r�gs ��<�rr�c�.�t�at|�y)zCThe first time this is called, determine what kind of pager to use.N)�getpager�pagerrws rr�r�ns�� �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|���SrB�� tempfilepager�plain�rj� use_pagers �rr�zgetpager..�s��� �e�D�k�9� Er�TERM)�dumb�emacsc�.��tt|���SrB)� pipepagerr�r�s �rr�zgetpager..�s��� �%��+�y� Arc���t|��SrB�r�r�s �rr�zgetpager..�s ��� �$� � :rc�,�tt|�d�S)Nzmore .�s��M�%��+�x�@r�systemz(less) 2>/dev/nullrc��t|d�S)N�lessr�rws rr�zgetpager..�s ��I�d�F�3rNz more "%s"c��t|d�S)N�morer�rws rr�zgetpager..�s �� �$�� 7r)r�r �stdin� plainpager�stdoutr��platformr r<rr��tempfile�mkstemp�close�unlink�ttypager)r��fdr�r�s @rr�r�ts��� �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.�s��#�)�)�.�.��+rc�J�tjj�ddddS)NrrT)r r�r�r rrr�zttypager..�s��#�)�)�,�,�.�s��3�B�Q�7r�LINESrT�z -- more --)�q�Qz )� rS)�b�B�)r�r�r�ttyr r��fileno� tcgetattr� setcbreakrr8�io�UnsupportedOperationr�r r<rr8r�r�rX�flush� tcsetattr� TCSAFLUSH) rjrYrr��old�getchar�hrh�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)rrWrrXr6rr8)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)rrrAr#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|j d�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 objectr�)rjrrrr��rfindr)rcr rdr2rIr�rrCr()rrwr�rendererrAr#r�r�s r� render_docr!7s�������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�r!r�print� plaintextrDr�)rrwr�output�is_clirr�s rr=r=Rs|���~� � �*�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�"� 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� writedocsr/ks7�� �|�B�T�$+�$9�$9�3�%��$I� ��'�5����%J� rc�T�eZdZidd�dd�dd�dd�dd�d d �d d �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;��dD���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)r9rK�async)r:rK�await)r;rK�break)r<� while for�class)r>zCLASSES SPECIALMETHODS�continue)r?r=�def)�functionrK�del)rB� BASICMETHODS�elif�if�else)rFr=�except�try�finally�for)rJzbreak continue while�from�import�global)rMznonlocal NAMESPACES)rE� TRUTHVALUE)rL�MODULES�in)rP�SEQUENCEMETHODS�is� COMPARISON�lambda)rTr��nonlocal)rUzglobal NAMESPACES�not�or�pass)rXrK�raise)rY� EXCEPTIONS�return)r[r�)rHrZ�while)r\zbreak continue if TRUTHVALUE)r8z CONTEXTMANAGERS EXCEPTIONS yield�yield)r]rK)r�frh�u��'r�raz'''r�z""")�+r�*�**r9z//�%�<<�>>rW�|�^�~rXrY�<=�>=�==�!=�<>)rXrYrkrlrmrnro)rrj) z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rfrgrWrhrirj)�j�J)�STRINGS� OPERATORSrS�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz def classrr� PRIVATENAMESzPRIVATENAMES SPECIALMETHODS� BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)rerd�,rro�:�@rfr�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)� formatstringsrs�UNICODE)r�z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES�NUMBERS)�numberszINTEGER FLOAT COMPLEX TYPES�INTEGER)�integersz int range�FLOAT)�floatingz float mathrw)� imaginaryz complex cmath� SEQUENCES)�typesseqz$STRINGMETHODS FORMATTING range LISTS�MAPPINGS� DICTIONARIESr�)�typesfunctionsz def TYPES�METHODS)� typesmethodszclass def CLASSES TYPES� CODEOBJECTS)zbltin-code-objectszcompile FUNCTIONS TYPES� TYPEOBJECTS)zbltin-type-objectsz types TYPES� FRAMEOBJECTS� TRACEBACKS�NONE)zbltin-null-objectrK)zbltin-ellipsis-object�SLICINGS�SPECIALATTRIBUTES)� specialattrsrKr�)r�z!class SPECIALMETHODS PRIVATENAMESrO)� typesmodulesrL�PACKAGES� EXPRESSIONS)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIESrs� PRECEDENCE�OBJECTS)�objectsr��SPECIALMETHODS)� specialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSESrC)� customizationzhash repr str SPECIALMETHODS�ATTRIBUTEMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS�CALLABLEMETHODS)zcallable-typeszCALLS SPECIALMETHODSrQ)�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�FRAMESrZ)r2ztry 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)� subscriptionsrQr�)�slicingsrQ�CALLS)�callsr�)�powerr�rt)�unaryr��BINARY)�binaryr��SHIFTING)�shiftingr�rv)�bitwiser�)� comparisonszEXPRESSIONS BASICMETHODS)�booleanszEXPRESSIONS TRUTHVALUE� ASSERTION� ASSIGNMENT)� assignmentruru)� augassignr��DELETION� RETURNING� IMPORTING)�compoundzfor while break continue)�truthz if while and or not BASICMETHODS)�debugger�pdb)zcontext-managersr8)� CONDITIONAL�LOOPINGrN� DEBUGGING�CONTEXTMANAGERSNc� �||_||_yrB)�_input�_output)r:�inputr%s rr�zHelper.__init__"s���� ��� rc�>�|jxstjSrB)r�r r�rTs rr�z Helper.input&s���{�{�'�c�i�i�'rc�>�|jxstjSrB)r�r r�rTs rr%z Helper.output*s���|�|�)�s�z�z�)rc��tj�dddk(r|�yd|jj�d|jj�d�S)NrTrn�?rKrXrz instance>)r�stackr+rrrTs 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. )�_GoInteractiverrr%r��intro�interact)r:�requestrs r�__call__zHelper.__call__6sy�� �$�-�-� -� .�� � �'�"� �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> rUrrr`rT)r��quitr) r%r��getliner��EOFErrorrVrWr>r�r)r:r�s rr�zHelper.interactFs��� � � ���$��� ��,�,�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���|jtjur t|�S|jj |�|jj �|jj �S)z.Read one line, using input() when appropriate.)r�r r�r%r�r r�)r:�prompts rr�zHelper.getline[sQ�� �:�:���� "���=� � �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)r4r2r3z Help on %s:)r%r&rS)r.rDrV� listkeywords� listsymbols� listtopics� listmodulesrr�� showsymbolr=�evalr�r�� showtopicr�r1r%r�)r:r�r&s rrz Helper.helpdsE�� �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)r%r�r=r rCrTs rr�z Helper.introys7�� � � ����  �F�7�S�%�%�b�q�)� )�*�! ,rc ��tt|��}||z}t|�|zdz |z}t|�D]�}t|�D]s}||z|z}|t|�ks�|jj ||�||dz ks�A|jj dd|dz t||�z zz��u|jj d���y)NrTr*rS)r�r�rWr�r%r�) r:�items�columnsr��colwr��rowr�r�s rr�z Helper.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. )r%r�r�r�r�rTs 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. )r%r�r�r�r�rTs 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. )r%r�r�r�r�rTs 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.topicsrr%r�r�rr�r+r.rDr�KeyErrorrV�textwraprXr�wrapr�r�) r:�topic� more_xrefs� pydoc_data�target�label�xrefsr=rrj� wrapped_texts rrzHelper.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|��}|s t d��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*) rrr�rr�r8r.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__r�rrrT)�find)r r]r�rs r�callbackz$Helper.listmodules..callback sB���w�r�s�|�{�:�%�c�r�l�\�9�G��<�<��$�q�(�'(�G�G�$�)rc����d|d�yrBr )r]r$s �r�onerrorz#Helper.listmodules..onerror s�����w��-r�r&z� Enter any module name to get more help. Or, type "modules spam" to search for modules whose name or summary contain the string "spam". )r%r�r=�apropos� ModuleScanner�runr�r�)r:r�rr&r$s @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��Prg)!r)rrr�� _strprefixes�_symbols_inverser�rr�symbols_rrr�r�r/r�r%r�rAr�r�r�r�rr�r�r�r�r�rrr�r�)rc�pr�s000rr1r1rse��$���$���$� ��$� �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#r1c��eZdZdZdd�Zy)r)z7An 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|d d�}|dz|z}|j�j|�dk\s��'||||���3|r|�yy#t$rY��KwxYw#t$r|r||�Y��ewxYw#t.$r|r||�Y��wxYw) NF�__main__rTrKrSrrr'� get_source� get_filenamer�)r>r�r r� __import__r@rr#r�r,� find_specr�r�r�r3rr�r�StringIOr4r�r�r�rr�r)r:r$r�� completerr&�seenr]r#r�r�r�r�r��sourcer r�s rr*zModuleScanner.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�Iri)r)rrr@r*r rrr)r) s ��A�8rr)c���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�Nr!r"r�z- )r#)r r]r�s rr$zapropos..callbackP s3�� �2�3�<�;� &��c�r�l�\�1�G� �g�t�+��t� �,rc��yrBr �r]s rr&zapropos..onerrorT s�� rr�r'N)r�r��filterwarningsr)r*)r�r$r&s rr(r(N 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..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..DocHandler.do_GET� s�� �y�y�!�!�&�)�)� �*� � � � �s� #� � � �^�-@�<�-O� P� � � � � �J�J� � �T�_�_�� � �<�)�)/���� :rc��yrBr )r:r's r� log_messagez-_start_server..DocHandler.log_message� s�� rN)r)rrrNrPr rr� DocHandlerrC� s �� :�  rrQc�$��eZdZd�Z�fd�Zd�Zy)� _start_server..DocServerc��||_|j|f|_||_|jj ||j|j �d|_y�NF)�host�addressr$r<r��handlerr�)r:rV�portr$s rr�z)_start_server..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�exr[s �r�serve_until_quitz1_start_server..DocServer.serve_until_quit� sZ����i�i�#�]�]�D�K�K�,>�,>�,@�+A�2�r�1�M� ��B����'�'�)��i�i� � � � rc�v�|jj|�|jr|j|�yyrB)r<�server_activater$rTs rrdz0_start_server..DocServer.server_activate� s,�� �I�I� %� %�d� +��}�}�� � �d�#�rN)r)rrr�rbrd)r[s�r� DocServerrS� s��� � � $rrec�4��eZdZ�fd�Z����fd�Zd�Zd�Zy)�#_start_server..ServerThreadc���||_||_t|�|_�jj |�d|_d|_d|_yrU) rLrVr�rY�Threadr��serving�error� docserver)r:rLrVrY� threadings �rr�z,_start_server..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<rXr,�Message� MessageClass� staticmethodrLrVrY�readyrlrbrrk)r:�docsvrrrQre�email�https ����rr*z'_start_server..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/)rjrV� server_portrYr�)r:ros rrtz)_start_server..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)rlr�rXrjr�rTs r�stopz(_start_server..ServerThread.stop� s.��"&�D�N�N� � �I�I�K�"�D�N� �D�L��D�HrN)r)rrr�r*rtr{)rQrervrwrms�����r� ServerThreadrg� s��� "� !� @�  rr|g{�G�z�?)� http.server� email.messager[rmro�BaseHTTPRequestHandlerrprir�rkrjrl�time�sleep) rL�hostnamerYr|�threadrQrervrwr[rms @@@@@@r� _start_serverr�\ 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 tjj t ��}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.._HTMLDocc �:��d}d|z}d|�d|�d���d|�d� S)rvzpydoc_data/_pydoc.cssz1zH Pydoc: z z z*
z
r )r:rwrx�css_path�css_link� html_navbars �rryz#_url_handler.._HTMLDoc.page s/���.�H�C��� ��H�k�m�X�?� ?rN)r)rrry)r�s�r�_HTMLDocr�� s��� ?rr�c����jtj��dtj�d�dtj��d��}d|�d�jtjd����d �S) Nz [rr�r�z=
Python �
T)�tersea
)r[r��python_version� python_build�python_compiler)r�r)s �rr�z!_url_handler..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..html_index..bltinlink0 � ��15�t�<� Index of Modules
r2z

zBuilt-in Modulesr�zf

pydoc by Ka-Ping Yee<[email protected]>

zIndex of ModulesrK) r}r rr�r�r rr�rX)r�r}r#�namesrxr9rr)s �r� html_indexz _url_handler..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}� j d�}� 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 �rr$z3_url_handler..html_search..callbackJ s=����r�s�|�{�*�!�#�2�,��5�� � � �'�4�+?�D�4�K�!@� Arr�c��yrBr r?s rr&z2_url_handler..html_search..onerrorQ s��rr'Nc��d|�d|�d�Sr�r r�s rr�z4_url_handler..html_search..bltinlinkV r�rz-Search Resultszkey = %sr�r�zSearch Results) r�r�r@r)r*r}rr�rX) r�r$r&r�r�r}r#r�rxr�r)s @�r� html_searchz!_url_handler..html_searchE 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�NzINDEX�Topicsr�)r}r�r1r�r�r�r�)r�r}r�rxr)s �r� html_topicsz!_url_handler..html_topicsc 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..html_keywords..bltinlinkz r�r�Keywordsr�)r}r�r1r�r�r�r�)r}r�r�rxr)s �r� html_keywordsz#_url_handler..html_keywordss sn����,�,� 2� ���v���+�+�-�.�� B��#�#�E�9�5���T�_�_� ���+�+���8�#�#rc����tj�}t||�}|j|�\}}||jvrd}nd}�j d|z�}d�j |�z}�j|d|�}|rAt|j��}d�}�j||�}�jdd|�}|�d|��d j|||f�fS) zTopic or keyword help page.�KEYWORD�TOPICr�z
%s
r�c��d|�d|�d�Sr�r r�s rr�z7_url_handler..html_topicpage..bltinlink� s ��:>��E�Err r*rK) rr7r1rr�r}r�r�r�rr�r�rX) r�buf�htmlhelprxrrwr}r�r)s �r�html_topicpagez$_url_handler..html_topicpage� 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��}|�|dk7r td��t|�}�j||�}||fS)NrT)rr3zcould not find object)rr8rr()r�r9rw�contentr)s �r� html_getobjz!_url_handler..html_getobj� sI����S�A�&�� �;�3�&�=��4�5� 5��� ���-�-��S�)���g�~�rc����jd�}dj�fd�tt|�|�D��}|�j |d|�z}d|z|fS)Nz$Errorr�c3�@�K�|]}�j|����y�wrB)r[)rcryr)s �rrez3_url_handler..html_error..� s#�����F�D�6:�t�{�{�4�0�D�s�rkz Error - %s)r}rXrrCr�)r�rr}rxr)s �r� html_errorz _url_handler..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�rBz search?keyz topic?keyzget?keyz bad pydoc url)r�rr8rry)r�� complete_urlrwr��opr�rr)r�r�r�r�r�r�r�s ��������r� get_html_pagez#_url_handler..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"r9rTNrErKrFzunknown content type z for url ) rtr�r r �dirname�realpathr�rXr�� readlinesrG)r�rMr�r�� path_herer��fpr)r�r�r�r�r�r�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_browserr�c���ddl}tt||�}|jrt |j�y|j r�d}|r|j |j� t d|j�t |�|j rZtd�}|j�}|dk(rn9|dk(r|j |j�n t |�|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�rzServer stopped) � webbrowserr�r�rkr#rjr�r�r�r>r�r�r{)rYr�r�r�� 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.rDr#r �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 }| d k(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| �r t| �} |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..BadUsageN)r)rrr rr�BadUsager�2 s�rr�rTzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exist)r&a�pydoc - the Python documentation tool {cmd} ... Show text documentation on something. 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 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 Search for a keyword in the synopsis lines of all available modules. {cmd} -n Start an HTTP server with the given hostname (default: localhost). {cmd} -p 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 ... Write out the HTML documentation for a module to a file in the current directory. If contains a '{sep}', it is treated as a filename; if it names a directory, documentation is written for all the contents. )r�r�)�getoptrr�r r�r(r�r�r r �existsr#�exitr�rrr/r*rrr�rkrrr=r�)r�r��optsr'�writing� start_serverr�rYr��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�B I�Ir2r�)r)� Python Library Documentation: %srN)r�rNF)rKN)rF)dr@r�r�r�r�r�r�r6�importlib._bootstrapr��importlib._bootstrap_external�importlib.machinery�importlib.utilrrr r�r�rMr rEr�r�� urllib.parser�r�� collectionsr�reprlibr� tracebackrrr$r>r7rIrQrZr^rarhrlrtr�� IGNORECASErvrxr{r�r�r��all_feature_namesr�r�r�r�r�r�r�rr�rrrrHrtrlrrr�r�r�r�r�r�r�r�r�rrrjr$r)rr!r=r*r/r1rr)r(r�r�r�r�r�r�r�r)r rr�r�sc��%�L �(�� )� � ��� � ����$���� � ��� � �� ������+� ��1�f �!� A�  �� %�G� ���b�j�j�5�r�}�}�E� �(� ���"�J�8�8�9��(�0 � ���2 �%�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