__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
o

#T_i<��@s6dZdgZdZdZdZddlZddlZddlZddl	Zddl
ZddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd	lmZd
d�Zdd
�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd�Z(dd�Z)d d!�Z*e�+d"ej,�Z-d#d$�Z.d%d&�Z/d'd(�Z0d)d*�Z1d�d+d,�Z2d-d.�Z3d/d0�Z4d1d2�Z5d3d4�Z6ifd5d6�Z7Gd7d8�d8e8�Z9d9d:�Z:difd;d<�Z;Gd=d>�d>�Z<Gd?d@�d@e�Z=GdAdB�dBe<�Z>GdCdD�dDe�Z?GdEdF�dFe<�Z@GdGdH�dHe@�ZAdIdJ�aBdKdL�ZCdMdN�ZDdOdP�ZEdQdR�ZFdSdT�ZGdUdV�ZHdWdX�ZIdYdZ�ZJd�d[d\�ZKe@�ZLeA�ZMe>�ZNd�d]d^�ZO		d�d`da�ZP		d�dbdc�ZQd�ddde�ZRd�dgdh�ZSGdidj�dj�ZTeT�ZUGdkdl�dl�ZVdmdn�ZWdodp�ZXd�drds�ZYd�dtdudv�dwdx�ZZdydz�Z[d{d|�Z\d}d~�Z]dd��Z^e_d�k�r�e^�dSdS)�a^Generate 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

    /usr/share/doc/pythonX.Y/html/library

if the pythonX.Y-doc package is installed or 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 <[email protected]>z26 February 2001z�Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
�N)�deque)�Repr)�format_exception_onlycCs\g}g}tjD]$}tj�|pd�}tj�|�}||vr+tj�|�r+|�|�|�|�q|S)zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirs�normdirs�dir�normdir�r�/usr/lib/python3.10/pydoc.py�pathdirsVs


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

�

�
�
��r@cCs`z%t�|d�}|durWdS|tur#t|�j}t|t�r#||kr#WdS|WSty/YdSw)zUGet the documentation string for an object if it is not
    inherited from its class.�__doc__N)r�__getattribute__�typerAr�strr:)r;r?�typedocrrrr9�s
�r9c	CsNt|�}|durzt|�}WnttfyYdSwt|t�s"dSt�|�S)z�Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed.N)r9r@r:�	TypeErrorrrDr�cleandoc)rr?rrr�_getdoc�s�

rHcCs,t|�pt�|�}|rt�dd|���pdS)z-Get the doc string or comments for an object.z^ *
�)rHr�getcomments�re�sub�rstrip)r�resultrrr�getdoc�srOcCsf|���d�}t|�dkr|ddfSt|�dkr,|d��s,|dd�|dd��fSdd�|�fS)z>Split a doc string into a synopsis line (if any) and the rest.�
�rrI�N)�stripr#�lenrM�join)r?�linesrrr�splitdoc�srWcCs"|j}|j|kr|jd|}|S)z@Get a class name and qualify it with a module name if necessary.r)r,r!)r�modnamer'rrr�	classname�s
rYcCs<t�|�pt|�pt�|�pt�|�pt�|�pt�|�S)z>Check if an object is of a type that probably means it's data.)r�ismoduler�	isroutine�isframe�istraceback�iscoderrrr�isdata�s����r_cGs0|r|d�|�|d��}|dd�}|s|S)z/Do a series of global replacements on a string.rQrrRN)rUr#)�text�pairsrrr�replace�s
�rbcCsXt|�|kr*td|dd�}td|d|�}|d|�d|t|�|d�S|S)zCOmit part of a string if needed to make it fit in a maximum length.r�rRN�...)rT�max)r`�maxlen�pre�postrrr�cram�s
$riz at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)z>Remove the hexadecimal id from a Python object representation.z\1)�_re_stripidrL�r`rrr�stripid�srlcCs<t�|�rdSt�|�rt|dd�}t�|�p|duSdS)zo
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    Tr-NF)rr+r0r$rZ)�fnr<rrr�_is_bound_method�s

rncCs^i}t�|tj�D]\}}d||<q	|jD]	}|�t|��q|��D]	}t||�||<q#|S�NrQ)r�
getmembersr[�	__bases__�update�
allmethods�keysr$)�cl�methods�key�valuer>rrrrs�s

rscCs8g}g}|D]}||�r|�|�q|�|�q||fS)z�Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    �r
)�s�	predicate�yes�no�xrrr�_split_listsrcCsX|dvrdS|�d�r|�d�rdS|�d�rt|d�rdS|dur&||vS|�d�S)	z3Decide whether to show documentation on a variable.>rA�__date__�__file__r,�__path__�__spec__r*�
__author__�
__cached__�
__loader__r!�__credits__�__package__�__version__�__builtins__r"r�__rQ�_�_fieldsTN)�
startswith�endswith�hasattr)r'�allr;rrr�visiblenamesr�cCsXg}t�|�D]"\}}}}t�|�r d}t|t�r |jdur d}|�||||f�q|S)zCWrap inspect.classify_class_attrs, with fixup for data descriptors.�data descriptorN�readonly property)r�classify_class_attrsr4rr1�fsetr
)r�resultsr'�kindr&rxrrrr�-s
r�csZt|dg��z
�fdd�t��D��Wntyi�Ynw�fdd�}|j|d�dS)zGSort the attrs list in-place by _fields and then alphabetically by namer�csi|]\}}||t���qSr)rT)�.0�ir')�fieldsrr�
<dictcomp>>�z#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)r )�attr)�field_orderrr�<lambda>Asz!sort_attributes.<locals>.<lambda>�rwN)r$�	enumeraterF�sort)�attrsr�keyfuncr)r�r�r�sort_attributes8s�r�cCs:tj�|�rdD]}tj�tj�|d|��rdSqdS)z3Guess whether a path refers to a package directory.)z.pyz.pyc�__init__TF)r	rr�isfilerU)r�extrrr�	ispackageFs�r�cCs�|��}|dd�dks|��s#|��}|sn|dd�dks|��r|��}|dd�dkr5|dd�}|dd�dkrk|dd�}|dd�dkrQ|dd�}|��s`|��}|s\n|��rU|�d�d	��}|Sd}|S)
NrQ�#�zr"""rc�"""r�\r)�readlinerSr#)�file�linerNrrr�source_synopsisNs$���r�c
Cs,t�|�j}|�|d�\}}|dus||kr�|�ttjj��r$tjj	}n|�ttjj
��r2tjj}nd}|durazt�
|�}Wn
tyIYdSw|�t|�}Wd�n1s[wYn-|d|�}tjjd||d�}ztj�|�}	WnYdStjd=|	jr�|	j��dnd}||f||<|S)z.Get the one-line summary out of a module file.�NNN�__temp__��loaderr)r	�stat�st_mtimer r��tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadrrrA�
splitlines)
�filename�cache�mtime�
lastupdaterN�
loader_clsr�r��spec�modulerrr�synopsis_s<

�
��

�r�c@s eZdZdZdd�Zdd�ZdS)�ErrorDuringImportzEErrors that occurred while trying to import something to document it.cCs||_|\|_|_|_dSr)r��excrx�tb)r<r��exc_inforrrr��szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r,r�rx)r<r�rrr�__str__�szErrorDuringImport.__str__N)r,r!r"rAr�r�rrrrr��sr�c	Cs�tjj}t|d��}||�t|��k}Wd�n1swYtj�|�}tj�	|�\}}|r:tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����)z<Import a Python source file or compiled file given its path.�rbNr�)r�r��MAGIC_NUMBERr��readrTr	r�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r�magicr��is_bytecoder�r'r�r�r�rrr�
importfile�s�r�c	sz/|r*�tjvr*�tjvr*�fdd�tjD�}�g|D]
}tj|||<tj|=qt��}Wn8t��\}}}}	�tjvrJttj�j|	��|turTt|j|	��t	|t
�ra|j�kraYdSt�t������d�dd�D]}
zt
||
�}Wqqty�YdSw|S)a�Import a module; handle errors; return None if the module isn't found.

    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning.  If the optional 'forceload' argument
    is 1, we reload the module from disk (unless it's a dynamic extension).csg|]}|��d�r|�qS)r)r�)r��m�rrr�
<listcomp>�r�zsafeimport.<locals>.<listcomp>NrrQ)rr�builtin_module_names�
__import__r�r�r��SyntaxErrorr��
issubclass�ImportErrorr'r#r$r:)r�	forceloadr��subsrwr�r�rxr��info�partrr�r�
safeimport�s*


r�c@sfeZdZej�ddejdd��Zddd�Z	ddd�Z
e
ZZZ
ZZZe�d	�fd
d�ZdS)
�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrRcGs�||f|}z"t�|�r|j|�WSt|�r|j|�WSt�|�r'|j|�WSWn	ty1Ynwt�|�r<|j	|�S|j
|�S)z%Generate documentation for an object.)rrZ�	docmoduler�docclassr[�
docroutiner:r4�docdata�docother)r<rr'�argsrrr�document�s�
zDoc.documentcGs&d|odt|�t|�jf}t|��)z+Raise an exception for unimplemented types.z.don't know how to document object%s of type %s� )�reprrCr,rF)r<rr'r��messagerrr�fail�s�zDoc.fail�stdlibcCs�zt�|�}Wntyd}Ynwtj�d|j�}tj�|�}t	|t
t��rl|jdvsF|�|�rl|�tj�
|d��sl|�tj�
|d��sl|jdvrl|�d�r^d�|�d	�|j���}|Stj�
||j��d
�}|Sd}|S)z*Return the location of module docs or None�
(built-in)r�)
�errno�
exceptions�gc�imp�marshal�posix�signalr�_thread�	zipimportz
dist-packagesz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z
{}/{}.html�/�.htmlN)r�
getabsfilerFr	�environr r�rrrrCr,r�rU�formatrM�lower)r<r�basedirr��doclocrrr�	getdocloc�s.�
���

��z
Doc.getdoclocr)r,r!r"r	rr r�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfig�get_pathr
rrrrr��s��

r�c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZeZ	dd
�Z
eZdS)�HTMLReprzBClass for safely making an HTML representation of a Python object.cC�,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r<rrrr��
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)rb�r<r`rrr�escapeszHTMLRepr.escapecCst�||�Sr)rr��r<rrrrr��z
HTMLRepr.reprcCsZtt|�d�r dd�t|�j���}t||�r t||�||�S|�ttt	|��|j
��S�Nr,�repr_r�)r�rCrUr,r#r$r$rirlr�r�r<r~�level�
methodnamerrr�repr1s

zHTMLRepr.repr1cCs^t||j�}t|�}d|vr%dt|dd�vr%d|d|�|�|dSt�dd|�|��S)Nr��\\rI�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)rirr�rbr$rKrL�r<r~r*�test�testreprrrr�repr_string"s�zHTMLRepr.repr_stringcCs:z|�ttt|��|j��WS|�d|jj�YS�Nz
<%s instance>)r$rirlr�rr.r,�r<r~r*rrr�
repr_instance/szHTMLRepr.repr_instanceN)r,r!r"rAr�r$r�r,r2�repr_strr5�repr_unicoderrrrr
src@seZdZdZe�ZejZejZdd�Zd1dd�Z				d2d
d�Z
dd
�Zdd�Zd3dd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd �Zd4d!d"�Zd5d#d$�Zddiifd%d&�Zd'd(�Zddiiidfd)d*�Zd6d+d,�ZeZd5d-d.�Zd4d/d0�ZdS)7�HTMLDocz'Formatter class for HTML documentation.cC�d||fS)�Format an HTML page.z�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>r)r<�title�contentsrrr�page@s�zHTMLDoc.pagerIcCsd|||||pdfS)zFormat a page heading.a'
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    �&nbsp;r)r<r;�fgcol�bgcol�extrasrrr�headingJs�zHTMLDoc.heading�Nr>c	
Cs^|durdd|d}d|||f}	|r |	d||||f}	n	|	d|||f}	|	d|S)	z Format a section with a heading.Nz<tt>r>z</tt>z�<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r<r;r?r@r<�width�prelude�
marginalia�gaprNrrr�sectionUs�
��zHTMLDoc.sectioncGsd|}|j|g|�R�S)z$Format a section with a big heading.z<big><strong>%s</strong></big>)rH)r<r;r�rrr�
bigsectionkszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)z!Format literal preformatted text.�

z
 
r�r>rP�<br>
)r$�
expandtabsrbr#rrr�	preformatps�zHTMLDoc.preformatr�cCs�d}t|�|d|}t|�D],}|dd|}t|||||�D]}|t|�kr7||||�d}q%|d}qd|S)z0Format a list of items into a multi-column list.rIrQz<td width="%d%%" valign=top>rrKz</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)rT�range)r<�listr	�colsrN�rows�colr�rrr�multicolumnvs�
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rr#rrr�grey�szHTMLDoc.greycGs*|D]}||vrd|||fSq|S)z:Make a link for an identifier, given name-to-URL mappings.�<a href="%s">%s</a>r)r<r'�dictsr7rrr�namelink�s
�zHTMLDoc.namelinkcCsN|jtj�|j�}}t||�r"t||�|ur"d|j|t||�fSt||�S)zMake a link for a class.z<a href="%s.html#%s">%s</a>)r,rrr r!r�r$rY)r<rrXr'r�rrr�	classlink�s�
zHTMLDoc.classlinkcCsd|j|jfS)zMake a link for a module.�<a href="%s.html">%s</a>)r,r%rrr�
modulelink�szHTMLDoc.modulelinkcCsR|\}}}}|r
|�|�S|rd||f}nd|}|r!d|}n|}d||fS)z;Make a link for a module or package to display in an index.z
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)rU)rT)r<�
modpkginfor'rr��shadowed�urlr`rrr�
modpkglink�s

zHTMLDoc.modpkglinkcCr9)zMake a link to source file.z<a href="file:%s">%s</a>r)r<r]rrrr�filelink��zHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}	|�||�}	|	sn�|	��\}
}|�||||
���|	��\}}
}}}}|
rG||��dd�}|�d||f�ng|r[dt|�}|�d|||�f�nS|rodt|�}|�d|||�f�n?|r�|||d	�d
kr�|�d|�	||��n'|�d|�n|||d	�d
kr�|�|�	||||��n	|�|�	||��|}q|�|||d
���d�
|�S)z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzJ\b((http|https|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))T�"z&quot;rUz'http://www.rfc-editor.org/rfc/rfc%d.txtz)https://www.python.org/dev/peps/pep-%04d/rQ�(zself.zself.<strong>%s</strong>NrI)r$rK�compile�search�spanr
�groupsrb�intrWrU)r<r`r$�funcs�classesrvr��here�pattern�match�start�endr��scheme�rfc�pep�selfdotr'r]rrr�markup�s<

�
zHTMLDoc.markupc
Cs�d}|D]T}t|�td�urE|\}}|d}||�||�}|r@||fkr@g}|D]}	|�|�|	|��q)|dd�|�d}|d}qt|�tg�urX|d|�|||�}qd	|S)
zAProduce HTML for a class tree as given by inspect.getclasstree().rIrz"<dt><font face="helvetica, arial">rb�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)rCrXr
rU�
formattree)
r<�treerX�parentrN�entry�c�bases�parentsr>rrrrv�s$
��zHTMLDoc.formattreec#
s�|j}z|j}Wntyd}Ynw|�d�}g}tt|�d�D]}|�dd�|d|d��||f�q#d�||dd��}	d|	}
zt�	|�}t
j�|�}��
||�}
Wntygd}
Ynwg}t|d�r�t|j�}|dd	�d
kr�|dd�dkr�|d	d���}|�d��|��t|d
�r�|���t|j���|r�|
dd�|�}
��|�}|dur�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|t�D]*\}}|dus�t�|�p�||u�r
t|||��r
|�||f�d|||<||<q�|D]@\}}|jD]7}|j|j}}tj �!|�}||k�rJ|�rJt||��rJt"||�|u�rJ||v�rJ|d|||<||<�q�q
gi}}t�|tj#�D]8\}}|du�sqt�$|��sqt�|�|u�r�t|||��r�|�||f�d|||<t�%|��r�||||<�qZg}t�|t&�D]\}}t|||��r�|�||f��q���'t(|��j)||�}|�o�d|}|d|}t|d��r�g}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n|�r��.|�fdd��}!|��0d dd|!�}|�rHd!d"�|D�}"��1t�2|"d�|�g}!|D]\}}|!���3|||||���q)|��0d#dd$d%�|!��}|�rng}!|D]\}}|!���3|||||���qO|��0d&dd'd%�|!��}|�r�g}!|D]\}}|!���3||���qu|��0d(dd)d*�|!��}t|d+��r���'t|j4��j)�}!|��0d,dd|!�}t|d-��rň�'t|j5��j)�}!|��0d.dd|!�}|S)/z/Produce HTML documentation for a module object.NrrQz5<a href="%s.html"><font color="#ffffff">%s</font></a>r�)<big><big><strong>%s</strong></big></big>r�r���$Revision: �$z
version %sr�z (%s)rtz-<br><a href="%(docloc)s">Module Reference</a>rI�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
r�rzPackage Contentsz#aa55cccs��|d�Sro)rZ��trrrr�>�z#HTMLDoc.docmodule.<locals>.<lambda>�ModulescS�g|]\}}|�qSrr�r�rwrxrrrr�C�z%HTMLDoc.docmodule.<locals>.<listcomp>�Classes�#ee77aar��	Functionsz#eeaa77�Dataz#55aa55rKr��Authorr��Credits)6r,�__all__r:r#rNrTr
rUrr�urllib�parse�quoter_rFr�rDr�rSr$r�r
�localsrBrprZr�	getmoduler�rqr!rrr r$r[r0r/r_rsrOrM�pkgutil�iter_modulesr�r�rSr^rIrv�getclasstreer�r�r�)#r<rr'�mod�ignoredr��parts�linksr��
linkedname�headrr]r_r��versionrrNrri�cdictrwrxr>rXr�rh�fdict�datar?�modpkgs�importer�ispkgr<�	classlistrrrr��s
�
��
�

 


�
�

��

������������zHTMLDoc.docmodulec	s��j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkrD����d�|D]
}�d��|�j	��q2�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]2\}}}}d|d|�|<}zt�|�}Wn	ty�Ynwz|�|<Wqvt
y�Yqvw|�r1|r�|���n|dd�t|�fdd��\}}�tjurшtjur�|}q���ur�d}n	d����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|gk�s-J�|}|s�d#�|	�}	||k�rBd$||f}nd%|||f}|�rgg}|D]
}|���|�j	���qP|d&d'�|�}d#}zt���}Wntt
f�y~d(}Ynw|�r�t|�}|�r�|d)k�r�|��|�d*}t��}|�r�||�p�d#}��|�j����}|�o�d+|}��|d,d-|	d.|�S)/z.Produce HTML documentation for a class object.c� eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecS�
d|_dSr���needonerrrrr�m�
z1HTMLDoc.docclass.<locals>.HorizontalRule.__init__c�|jr�d�d|_dS)Nz<hr>
rQr�r��pushrr�maybeo�
z.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r,r!r"r�r�rr�rr�HorizontalRulel�r�rRz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|rE����|�|D]1\}}}}zt�|�}Wnty2���||���Ynw���||��������d�q|S)NrP�rr�r$�	Exceptionr�r���msgr�r{�okr'r��homeclsrx�rirh�hr�mdictr�rr�r<rr�spills��
zHTMLDoc.docclass.<locals>.spillc�Jt||�\}}|r#����|�|D]\}}}}���||���q|Sr�rr�r�r��r�r�r�r<rr�spilldescriptors��z*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|rM����|�|D]9\}}}}��t�|�|��}t|�}	|	s0�d|�n��t|��j����}	d|	}	�d||	f��d�q|S)Nz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
rP)rr�r�r$rOrsrM)
r�r�r{r�r'r�r�rxr>r?r�rr�	spilldata�s �
z#HTMLDoc.docclass.<locals>.spilldatac�,g|]\}}}}t|�d�r||||f�qS�)r;�r��r�r'r�r&rxrrrr���

�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rc�|d�uS�NrRrr���	thisclassrrr���z"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scS�|ddkS�NrQ�methodrr�rrrr��r�zClass methods %scSr��NrQzclass methodrr�rrrr��r�zStatic methods %scSr��NrQz
static methodrr�rrrr��r�zReadonly properties %scSr��NrQr�rr�rrrr��r�zData descriptors %scSr��NrQr�rr�rrrr��r�zData and other attributes %scSr��NrQr�rr�rrrr��r�rIz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)rtN�()rJz<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8rc)r,rqr
rr�getmrorTr�rXr!r�r$r�rF�popleftr�builtinsrr�rU�	signature�
ValueErrorrDr$rOrsrMrH)r<rr'r�rhrir��realnamer{r<r��mror>r�r�r�r�rwr�r�rx�anchor�	inherited�tagr;r|�declr��argspecr?r)	rirhr�r�r�rr�r<r�rr�as�

�	
���
�

�
�
�
�
�
��
#
���zHTMLDoc.docclasscCs|�d|�|��S�z)Format an argument default value as text.�=)rTr�r%rrr�formatvalue�zHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jp
dd|}	d}
d}t|�rE|jj}|r-||ur,d|�||�}
n|jdur=d|�|jj|�}
nd|�||�}
t�|�sOt�|�rRd}
nd}
||kr_d	|	|f}n"|rxt�||g�|urxd
|jd||f}d}n|}d|	||f}d}t�	|�r�zt�
|�}Wn
ttfy�d}Ynw|r�t
|�}|d
kr�d|}|dd�}|s�d}|
||�|�|
o�|�d|
�}|r�d|S|�t|�|j|||�}|o�d|}d||fS)z;Produce HTML documentation for a function or method object.rIr�r� from N� method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rQz)<a name="%s"><strong>%s</strong></a> = %s�<lambda>z$<strong>%s</strong> <em>lambda</em> r�(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r,rnr-r.rXr�iscoroutinefunction�isasyncgenfunction�getattr_staticr[r�r�rFrDr$rTrsrOrM)r<rr'r�rhrirvrur�r��note�skipdocs�imclass�asyncqualifierr;�reallinkr�r�r�r?rrrr�sp�
�
���
���zHTMLDoc.docroutinecCsNg}|j}|r
|d|�|�t|�|j�}|r|d|�|d�d�|�S)z1Produce html documentation for a data descriptor.z!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
r�rI)r
rsrOrMrU�r<rr'r�rur�r�r?rrrr�Hs
zHTMLDoc.docdatacGs|rd|pd}||�|�S)z-Produce HTML documentation for a data object.z<strong>%s</strong> = rI�r�)r<rr'r�r��lhsrrrr�XszHTMLDoc.docothercCs�g}|duri}t�|g�D]\}}}tdd�|D��rq|�|d|||vf�d||<q|��|�||j�}|�|dd|�S)z2Generate an HTML index for a directory of modules.Ncss,�|]}dt|�kodknVqdS)i�i��N)�ord�r��chrrr�	<genexpr>bs�*z HTMLDoc.index.<locals>.<genexpr>rIrQr�r�)r�r��anyr
r�rSr^rI)r<rr\r�r�r'r�r<rrr�index]s
z
HTMLDoc.index�rI)rCrINr>)r�rr��NNN)r,r!r"rAr�_repr_instancer�r$r=rBrHrIrMrSrTrWrXrZr^r_rsrvr�r�r�r�r�rr�rrrrrr87s@


�

+
y#
�
A
r8c@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�TextReprzAClass for safely making a text representation of a Python object.cCrrrrrrrr�przTextRepr.__init__cCsTtt|�d�r dd�t|�j���}t||�r t||�||�Sttt|��|j	�Sr')
r�rCrUr,r#r$rirlr�rr)rrrr,vs

zTextRepr.repr1cCsHt||j�}t|�}d|vr"dt|dd�vr"d|d||dS|S)Nr�r-rIr.r)rirr�rbr/rrrr2}s
zTextRepr.repr_stringcCs.zttt|��|j�WSd|jjYSr3)rirlr�rr.r,r4rrrr5�szTextRepr.repr_instanceN)	r,r!r"rAr�r,r2r6r5rrrrrns	rc@s~eZdZdZe�ZejZdd�Zddd�Zdd�Z	ddd�Z
dd
d�Zddd�Zdd�Z
ddd�Zddd�ZeZddd�Zd	S)�TextDocz'Formatter class for text documentation.cCsd�dd�|D��S)z(Format a string in bold by overstriking.rIcss�|]	}|d|VqdS)�Nrr�rrrr�s�zTextDoc.bold.<locals>.<genexpr>)rUr#rrr�bold�r�zTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r|d��|d<d�|�S)z6Indent text by prepending a given prefix to each line.rIcsg|]}�|�qSrr�r�r���prefixrrr��r�z"TextDoc.indent.<locals>.<listcomp>rPr)r#rMrU)r<r`r
rVrrr�indent�s
zTextDoc.indentcCs$|�|���}|�|�d|dS)z&Format a section with a given heading.rPrJ)rrMr	)r<r;r<�clean_contentsrrrrH�szTextDoc.sectionNrIc
	s�d}|D]I}t|�td�ur9|\}}||t|��}|r4||fkr4�fdd�|D�}	|dd�|	�}|d}qt|�tg�urM||�|�||d�}q|S)	zBRender in text a class tree as returned by inspect.getclasstree().rIrc3s�|]}t|��VqdSr�rY)r�rz�rXrrr���z%TextDoc.formattree.<locals>.<genexpr>r�rtrPr
)rCrYrUrv)
r<rwrXrxr
rNryrzr{r|rrrrv�s
��zTextDoc.formattreec	Cs|j}tt|��\}}|�d||od|�}t|dd�}|�|�}|dur0||�d|d�}|r:||�d|�}g}	t�|t�D]\}
}|dusSt�	|�pP||ur`t
|
||�r`|	�|
|f�qBg}t�|tj�D]!\}
}|dus~t�
|�s~t�	|�|ur�t
|
||�r�|�|
|f�qjg}
t�|t�D]\}
}t
|
||�r�|
�|
|f�q�g}t�}t|d�r�t�|j�D]\}}}|�|�|r�|�|d	�q�|�|�q�|��||�d
d�|��}g}t�|tj�D]\}
}|j�|d�r�|
|vr�|�|
�q�|�r|��||�d
d�|��}|	�rBdd�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���q'||�dd�|��}|�rdg}|D]\}
}|�|�||
|���qI||�dd�|��}|
�r�g}|
D]\}
}|�|j||
|dd���qk||�dd�|��}t|d��r�t|j�}|dd�dk�r�|dd�dk�r�|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d ��r�||�d!t|j"��}zt�#|�}Wnt$�y�d"}Ynw||�d#|�}|S)$z5Produce text documentation for a given module object.�NAME� - 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 CONTENTSrPr�
SUBMODULEScSr�rrr�rrrr��r�z%TextDoc.docmodule.<locals>.<listcomp>rQ�CLASSES�	FUNCTIONS�F)rf�DATAr�r~rrr��VERSIONr��DATEr��AUTHORr��CREDITSr��FILE)%r,rWrOrHr$r
rrprr�r�r
r[r0r_�setr�r�r�r��addr�rUrZr�rvr�r�r�rDr�rSr�r�r�rrF)r<rr'r��synop�descrNr�rrirwrxrhr�r��
modpkgs_namesr�rXr��
submodulesr�r<r�r�rrrr��s�
	����


�
�
��
$�zTextDoc.docmodulec	sN�j}|p|}�j}�jfdd�}||krd��|�}n	��|�d|}|r6t||�}	|dd�|	�}g}
|
j�zt���}Wn
t	t
fyOd}Ynw|rdt|�}|rd|dkrd�||d	�t��}
|
rp�|
d	�t
t����}t|�d
kr��d�|D]
}�d||��q��d
�tdd�t���D�tjd�}t|�}d}|rЈd�|d|�D]}�d|�q�||kr̈dt||�d��d
�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r�|�r|���n|dd
�t|�fd d!��\}}�tju�r0�tju�r0|}�q��u�r8d"}nd#t��j�}t|��|d$||d%d!��}|d&||d'd!��}|d(||d)d!��}|d*||d+d!��}|d,||d-d!��}|d.||d/d!��}|gk�s�J�|}|�sd	�|
�}
|
�s�|d	S|d	��|
��d0�d	S)1z4Produce text documentation for a given class object.cSs
t||�Srr)rzr�rrr�makename#r�z"TextDoc.docclass.<locals>.makename�class z	 = class r�rtNr�rPrRzMethod resolution order:r
rIcss0�|]}|j�d�s|jdkrt|j�VqdS)r�r�N)r,r�r!rD)r�r&rrrrHs�
�
��z#TextDoc.docclass.<locals>.<genexpr>r�r�zBuilt-in subclasses:z    ... and z other subclassescr�)z(TextDoc.docclass.<locals>.HorizontalRulecSr�r�r�rrrrr�Zr�z1TextDoc.docclass.<locals>.HorizontalRule.__init__cr�)NzF----------------------------------------------------------------------rQr�rr�rrr�\r�z.TextDoc.docclass.<locals>.HorizontalRule.maybeNr�rr�rrr�Yr�r�c
s�t||�\}}|r>����|�|D]*\}}}}zt�|�}Wnty2���||���Yqw���||����q|Srr�r��r�r�rr�r<rrr�bs��zTextDoc.docclass.<locals>.spillcr�rr�r�r�rrr�sr�z*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|rB����|�|D].\}}}}t|�}zt�|�}	Wnty2|j|}	Ynw��j|	|�d|d�d�q|S)Nr)rfr?rP)rr�rOr$r:�__dict__r�)
r�r�r{r�r'r�r�rxr?r;r)rrr�|s��z#TextDoc.docclass.<locals>.spilldatacr�r�r�r�rrrr��r�z$TextDoc.docclass.<locals>.<listcomp>rcr�r�rr�r�rrr��r�z"TextDoc.docclass.<locals>.<lambda>r�r�zMethods %s:
cSr�r�rr�rrrr��r�zClass methods %s:
cSr�r�rr�rrrr��r�zStatic methods %s:
cSr�r�rr�rrrr��r�zReadonly properties %s:
cSr�r�rr�rrrr��r�zData descriptors %s:
cSr�r�rr�rrrr��r�zData and other attributes %s:
cSr�r�rr�rrrr��r�z |  )r,rqr!r	�maprUr
rr�r�rFrDrOrr�rT�sortedrC�__subclasses__r
r�r�rr�rrYr�rrM)r<rr'r�r�r�r{r'r;r|r<r�r�r?r�r>�
subclasses�no_of_subclasses�MAX_SUBCLASSES_TO_DISPLAY�subclassnamer�r�r�r�r�r�r�r)r�r�rr�r<r�rr�s�
��
��	
�

�

�
�
�
�
�
��
#zTextDoc.docclasscCsd|�|�Sr�r�r%rrrr���zTextDoc.formatvaluec	Cs�|j}|p|}d}d}t|�r7|jj}|r!||ur dt||�}n|jdur0dt|jj|�}ndt||�}t�|�sAt�|�rDd}	nd}	||krP|�|�}
n|r]t�	||g�|ur]d}|�|�d	|}
d}t�
|�r�zt�|�}Wn
tt
fy�d}Ynw|r�t|�}|d
kr�|�|�d}
|dd�}|s�d
}|	|
||}
|r�|
dSt|�p�d}|
d|o�|�|���dS)z;Produce text documentation for a function or method object.rIrr�Nr�r�r�rQ� = r�z lambda rr�rP)r,rnr-r.rYrr�r�r	r�r[r�r�rFrDrOrrM)r<rr'r�rur�r�r�r�r�r;r�r�r�r?rrrr��sX�
�
�
�zTextDoc.docroutinecCsTg}|j}|r||�|��|d�t|�pd}|r%||�|��|d�d�|�S)z1Produce text documentation for a data descriptor.rPrI)r
r	rOrrUr�rrrr��s
zTextDoc.docdatac
Cs�|�|�}|r#|r
|dpd|}|t|�}	|	dkr#|d|	�d}|r,|�|�dp-d|}|s6t|�}|rE|d|�t|��d7}|S)z-Produce text documentation for a data object.r3rIrNrdrP)r�rTr	rOrrD)
r<rr'r�rxrfr?r�r��choprrrr�s
zTextDoc.docother)r
)NrIr�r)NNNNN)r,r!r"rArrr�r	rrHrvr�r�r�r�r�rr�rrrrr�s 



e

7rc@seZdZdZdd�ZdS)�
_PlainTextDocz2Subclass of TextDoc which overrides string stylingcCs|Srrr#rrrr	�z_PlainTextDoc.boldN)r,r!r"rAr	rrrrr5sr5cCst�at|�dS)zCThe first time this is called, determine what kind of pager to use.N)�getpager�pagerrkrrrr8sr8c	sdttjd�stSttjd�stStj��rtj��stStj�d�p'tj�d���rItj	dkr5�fdd�Stj�d�dvrC�fd	d�S�fd
d�Stj�d�dvrStStj	dkr\dd�Sttd�rlt�
d
�dkrldd�Sttd�r|t�
d�dkr|dd�Sddl}|��\}}t�
|�z ttd�r�t�
d|�dkr�dd�Wt�|�StWt�|�St�|�w)z2Decide what method to use for paging through text.�isatty�MANPAGER�PAGER�win32c�tt|���Sr��
tempfilepager�plainrk��	use_pagerrrr�(r�zgetpager.<locals>.<lambda>�TERM)�dumb�emacscr=r)�	pipepagerr@rkrArrr�*r�cs
t|��Sr�rFrkrArrr�,�
cSstt|�d�S)Nzmore <r>rkrrrr�0r��systemz(pager) 2>/dev/nullrcS�
t|d�S)Nr8rGrkrrrr�2rHz(less) 2>/dev/nullcSrJ)N�lessrGrkrrrr�4rHNz	more "%s"cSrJ)N�morerGrkrrrr�;rH)r�r�stdin�
plainpager�stdoutr9r	rr �platformrI�tempfile�mkstemp�close�unlink�ttypager)rQ�fdr�rrArr7s<


�r7cCst�dd|�S)z%Remove boldface formatting from text.z.rI)rKrLrkrrrr@Ar2r@c	Cs�ddl}|j|d|jdd�}z&|j�}z|�|�Wn	ty#YnwWd�n1s.wYWn	ty=Ynw	z|��WdStyOYnwq?)z3Page through text by feeding it to another program.rNT�backslashreplace)�shellrM�errors)�
subprocess�Popen�PIPErM�write�KeyboardInterruptr��wait)r`�cmdrZ�proc�piperrrrFEs2��������rFc	Cs�ddl}|���B}tj�|d�}t|ddtjdkrt�d�ndd��
}|�	|�Wd�n1s2wYt�
|d|d	�Wd�dS1sMwYdS)
z<Page through text by invoking a program on a temporary file.rNz	pydoc.out�wrWr<)rY�encodingz "ra)rQ�TemporaryDirectoryr	rrUr�rrP�device_encodingr]rI)r`r`rQ�tempdirr�r�rrrr?]s


���"�r?cCs$ttjdd�pd}|�|d��|�S)Nrd�utf-8rW)r$rrO�encode�decode)r`rdrrr�_escape_stdoutisrkc
Cs�tt|���d�}zddl}tj��}|�|�}|�|�dd�}Wnt	t
tjfy5d}dd�}Ynwz�zt
tj�dd��}WntyMd}Ynw|dkrTd	}|d}}tj�d�|d|��d�||d�r�tj�d
�tj��|�}	|	dvr�tj�d�nB|	d
vr�tj�d||d�|d}qi|	dvr�|||}|dkr�d}tj�dd�||||��d�||}||d�soW|r�|�||j|�dSdS|r�|�||j|�ww)z%Page through text on a text terminal.rPrNcSstj�d�Sro)rrMr�rrrrr�vr�zttypager.<locals>.<lambda>cSstj��dd�dd�S)NrrQ)rrMr�rrrrr�ys�LINESrQ�z
-- more --)�q�Qz
          
)�
rP)�b�B�)r@rkr#�ttyrrM�fileno�	tcgetattr�	setcbreakr�r:�io�UnsupportedOperationrgr	rr r�rOr]rU�flush�	tcsetattr�	TCSAFLUSH)
r`rVrtrV�old�getchar�hr.�incrzrrrrUnsX


��
&����rUcCstj�tt|���dS)z>Simply print unformatted text.  This is the ultimate fallback.N)rrOr]r@rkrkrrrrN�srNcCs�t�|�r|jtjvrd|jSt|d�rd|jSd|jSt�|�r)d|jSt�|�r:d|jj	|jj|jfSt�
|�rKd|jj	|jj|jfSt|�rTd|jSt�|�r^d	|jSt�
|�rhd
|jSt|�jS)z/Produce a short description of the given thing.zbuilt-in module r�zpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr(z	function zmethod )rrZr,rr�r�r0�isgetsetdescriptorr5r!r6rr/r+rC)�thingrrr�describe�s2







�
�





r�c	Cs�dd�|�d�D�}d\}}|t|�kr3td�|d|d��|�}|r,||d}}nn|t|�ks|r8|}nt}||d�D]}zt||�}Wq@tyTYdSw|S)z@Locate an object by name or dotted path, importing as necessary.cSsg|]}|r|�qSrr)r�r�rrrr��r�zlocate.<locals>.<listcomp>rr�NrQ)r#rTr�rUr�r$r:)rr�r�r��n�
nextmodulerr�rrr�locate�s"��r�cCsTt|t�rt||�}|durtd|��||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,)rrDr�r�r$)r�r�rr'rrr�resolve�s

�r�� Python Library Documentation: %scCs�|durt}t||�\}}t|�}t�|�}|r*d|vr*|d|d|�d��7}n
|r7||ur7|d|j7}t�|�s_t|�s_t�	|�s_t�
|�s_t|�s_t|d�rW|j
}nt|�}|d7}||d|�||�S)zBRender text documentation, given an object or a path to an object.Nrz in z in module �
__origin__z objectrJ)r`r�r�rr��rfindr,rZrr[r4rHr�r�rCr�)r�r;r��rendererrr'r$r�rrr�
render_doc�s.

����
r�c
Cslz|durtt|||��WdS|�t|||t��WdSttfy5}zt|�WYd}~dSd}~ww)zCDisplay text documentation, given an object or a path to an object.N)r8r�r]�	plaintextr�r��print)r�r;r��outputrxrrrr?�s��r?c
Cs�z;t||�\}}t�t|�t�||��}t|dddd��
}|�|�Wd�n1s-wYtd|d�WdStt	fyT}zt|�WYd}~dSd}~ww)z<Write HTML documentation to a file in the current directory.rrcrh)rdN�wrote)
r��htmlr=r�r�r�r]r�r�r�)r�r�rr'r=r�rxrrr�writedocs���r�rIcCs2|duri}t�|g|�D]	\}}}t|�q
dS)zAWrite out HTML documentation for all modules in a directory tree.N)r��
walk_packagesr�)r�pkgpath�doner�rXr�rrr�	writedocss
r�c@s�eZdZidd�dd�dd�dd�dd�d	d
�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�id d!�d"d#�d$d%�dd&�d#d'�d(d)�d*d+�d,d-�d.d/�d0d�d1d�d2d3�d4d5�d6d7�dd8�d9d:�dd;��d<d=i�Zd>d?�d@D�ZdAdBdCdDge�RdEdFdGdHdIdJdK�ZdLdMdNdOdPdQdRdSdTdUdVdWdWdXdXdY�Ze��D]\ZZ	e	D]Z
e�e
e�Zeevr�edZeZeee
<q�q�id[d\�dSd]�d^d_�d`da�dbdc�ddde�dfdg�dhdi�djdk�dldm�dndo�dpdq�drds�dtdu�dvdw�dxd[�dyd[�idzd{�dPd|�d}d~�dd��d�d��d�d#�d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d���id�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��dTd��d�d��d�dl�d�d��d�d��d�d��dod��d�d���id�d��d�d��d�d��d�d��dMd��d�d��d�d��d�dÓd�dœd+dƓddǓd�d	�d�dʓd�d̓d�d�d�d6�d�d#��dd�d�d�d�dԜ�Zd�d�dׄZ
ed�dل�Zed�dۄ�Zd�d݄Ze�Zefd�d߄Zd�d�Zd�d�Zd�d�Zd�d�Zd�d�d�Zd�d�Zd�d�Zd�d�Zd�d�d�Zd�d�d��Zd�d��Zd�d�d��Z d�S)��Helper�FalserI�None�True�and�BOOLEAN�as�with�assert)r�rI�async)r�rI�await)r�rI�break)r��	while for�class)r�zCLASSES SPECIALMETHODS�continue)r�r��def)�functionrI�del)r��BASICMETHODS�elif�if�else)r�r��except�try�finally�for)r�zbreak continue while�from�import�global)r�znonlocal NAMESPACES)r��
TRUTHVALUE)r��MODULES�in)r��SEQUENCEMETHODS�is�
COMPARISON�lambda)r�r�nonlocal)r�zglobal NAMESPACES�not�or�pass)r�rI�raise)r��
EXCEPTIONS�return)r�r)r�r��while)r�zbreak continue if TRUTHVALUE)r�z CONTEXTMANAGERS EXCEPTIONS yield�yield)r�rIcCsg|]}dD]}||�qqS)��'rar)r��prnrrrr�Lr�zHelper.<listcomp>)rq�fr.�ur�z'''rar�)�+r��*�**rz//�%�<<�>>r �|�^�~r!r"�<=�>=�==�!=�<>)r!r"r�r�r�r�r�)r�r�)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)r�r�r r�r�r�)�j�J)�STRINGS�	OPERATORSr��UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classr��PRIVATENAMESzPRIVATENAMES SPECIALMETHODS�
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)r�r��,rrd�:�@r�r�r��`rbru�[�]r��TYPES)rzRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES�
STRINGMETHODS)zstring-methodszSTRINGS FORMATTING�
FORMATTING)�
formatstringsr��UNICODE)r�z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES�NUMBERS)�numberszINTEGER FLOAT COMPLEX TYPES�INTEGER)�integersz	int range�FLOAT)�floatingz
float mathr�)�	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-objectsztypes TYPES�FRAMEOBJECTS�
TRACEBACKS�NONE)zbltin-null-objectrI)zbltin-ellipsis-object�SLICINGS�SPECIALATTRIBUTES)�specialattrsrIr)rz!class SPECIALMETHODS PRIVATENAMESr�)�typesmodulesr��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)�objectsr��SPECIALMETHODS)�specialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSESr�)�
customizationzhash repr str SPECIALMETHODS�ATTRIBUTEMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS�CALLABLEMETHODS)zcallable-typeszCALLS SPECIALMETHODSr�)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS�MAPPINGMETHODS)rzMAPPINGS SPECIALMETHODS�
NUMBERMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS�	EXECUTION)�	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS�
NAMESPACES)�namingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES�DYNAMICFEATURES)zdynamic-featuresrI�SCOPING�FRAMESr�)r�ztry except finally raise�CONVERSIONS)�conversionsrI�IDENTIFIERS)�identifierszkeywords SPECIALIDENTIFIERS�SPECIALIDENTIFIERS)z
id-classesrI)zatom-identifiersrI�LITERALS)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�TUPLES�
TUPLELITERALS)�	exprlistszTUPLES LITERALS�LISTS)ztypesseq-mutable�LISTLITERALSr$)�listszLISTS LITERALS)�typesmapping�DICTIONARYLITERALSr')r7zDICTIONARIES LITERALS�
ATTRIBUTES)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS�
SUBSCRIPTS)�
subscriptionsr�r)�slicingsr��CALLS)�callsr)�powerrr�)�unaryr�BINARY)�binaryr�SHIFTING)�shiftingrr�)�bitwiser)�comparisonszEXPRESSIONS BASICMETHODS)�booleanszEXPRESSIONS TRUTHVALUE�	ASSERTION�
ASSIGNMENT)�
assignmentr�r�)�	augassignr�DELETION�	RETURNING�	IMPORTING)�compoundzfor while break continue)�truthz if while and or not BASICMETHODS)�debugger�pdb)zcontext-managersr�)�CONDITIONAL�LOOPINGr��	DEBUGGING�CONTEXTMANAGERSNcCs||_||_dSr)�_input�_output)r<�inputr�rrrr��s
zHelper.__init__cC�|jptjSr)rFrrMrrrrrH�r`zHelper.inputcCrIr)rGrrOrrrrr��r`z
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)NrQrc�?rIz<%s.%s instance>)r�stackr.r!r"rrrr�__repr__�s�zHelper.__repr__cCs8||jur|�|�dS|��|��|j�d�dS)Na
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
)�_GoInteractiver�intro�interactr�r]�r<�requestrrr�__call__�s

zHelper.__call__c	Cs�|j�d�	z|�d�}|sWdSWnttfyYdSw|��}t|�dkrJ|d|dkr8dvrJnn|d|dd�vrJ|dd�}|��d	vrRdS|d
kr[|��n|�	|�q)NrPTzhelp> rRrrr�rQ)rn�quitr)
r�r]�getliner^�EOFErrorrSrTr
rNrrPrrrrO�s"
�,

�zHelper.interactcCs4|jtjur
t|�S|j�|�|j��|j��S)z.Read one line, using input() when appropriate.)rHrrMr�r]rzr�)r<�promptrrrrT�s


zHelper.getlinecCs8t|�td�ur�|��}|dkr|��n|dkr|��nv|dkr'|��nm|dkr0|��nd|dd�dkrB|�|��d�nR||jvrM|�|�nG|d	vrYt	t
|�d
�n;||jvrd|�|�n0||j
vro|�|�n%|rzt	|d
|jd�nt	td
|jd�nt|t�r�|�nt	|d
|jd�|j�d�dS)
NrI�keywords�symbols�topicsr�zmodules rQ)r�r�r�zHelp on %s:)r�rP)rCrS�listkeywords�listsymbols�
listtopics�listmodulesr#rX�
showsymbolr?�evalrW�	showtopicrYrGrDrr�r�r]rPrrrrs$zHelper.helpcCs$|j�d�dtjdd���dS)Na�
Welcome to Python {0}'s help utility!

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

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

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
z%d.%drR)r�r]r	rrrrrrrNs�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D];}t|�D].}|||}|t|�krL|j�||�||dkrL|j�dd|dt||��q|j�d�qdS)NrQr�rP)rOr,rTrNr�r])	r<�items�columnsrD�colwrQ�rowrRr�rrrrO,s$��zHelper.listcC� |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)r�r]rOrWrtrrrrr[9�zHelper.listkeywordscCrg)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)r�r]rOrXrtrrrrr\@szHelper.listsymbolscCrg)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)r�r]rOrYrtrrrrr]HrhzHelper.listtopicscCs*zddl}Wnty|j�d�YdSw|j�||j�|��}|s0|j�dt|��dSt|�td�ur>|�	||�S|\}}z|jj|}Wnt
y^|j�dt|��YdSw|��d}|ro|pjdd|}|r�ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nr�t
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rIrPr��Related help topics: rt�Hz
%s
)�pydoc_data.topicsr�r�r]rYr rWr�rCra�KeyErrorrS�textwraprUr#�wrapr8)r<�topic�
more_xrefs�
pydoc_data�target�label�xrefsr?rnr`�wrapped_textrrrraOs8��zHelper.showtopiccCs�zddl}Wn
tyYdSw|j�||j�|��}|s"td��t|t�r-|�||�S|\}}|jj|}|rA|p<dd|}||fS)a*Return unbuffered tuple of (topic, xrefs).

        If an error occurs here, the exception is caught and displayed by
        the url handler.

        This function duplicates the showtopic method but returns its
        result directly so it can be formatted for display in an html page.
        rN)rirIzcould not find topicrIr�)	rlr�rYr rWr�rrD�	_gettopic)r<rprqrrrsrtrur?rrrrwos	�
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)rX�	partitionra)r<�symbolrsrpr�rurrrr_�s
zHelper.showsymbolcsx|r|j�d�|��t|�dS|j�d�i}|fdd���fdd�}t�j�|d�|�|���|j�d�dS)	Nzy
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

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

cSsB|r|dd�dkr|dd�d}|�d�dkrd||<dSdS)N����	.__init__rrrrQ)�find)rrXr$rrrr�callback�s
�z$Helper.listmodules.<locals>.callbackcs�d|d�dSrrr�r}rr�onerror�sz#Helper.listmodules.<locals>.onerror�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".
)r�r]r	�apropos�
ModuleScanner�runrOrt)r<rwrrrr~rr^�s�zHelper.listmodulesr�)r�rbr)!r,r!r"rW�_strprefixes�_symbols_inverserXrcrp�symbols_ryr rYr�r1rHr�rLrrMrRrOrTrrNrOr[r\r]rarwr_r^rrrrr�s
��������	�
���
������������������� �!�"�#�'��
������	�
���
���������������� �!�"�%�&�'�(�*�+�-�.�/�0�1�2�3�4�5�6�7�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�
W


	



 r�c@seZdZdZddd�ZdS)r�z7An interruptible scanner that searches module synopses.Nc	Cs�|r|��}d|_i}tjD]8}|dkrFd||<|dur#|d|d�qt|�jp)d}|�d�d}|d|}|���|�dkrF|d||�qtj	|d�D]�\}	}}
|jrWn�|durb|d|d�qMzt�
|	|�}Wn	tysYqMw|j}t
|d	�r�z|�|�}
Wnty�|r�||�YqMwtt�|
��p�d}t
|d
�r�|�|�}n-d}n*ztj�|�}Wnty�|r�||�YqMw|jr�|j��dnd}t|dd�}|d|}|���|�dkr�||||�qM|r�|�dSdS)NF�__main__rQrIrPrrr��
get_source�get_filenamer�)r
rSrr�r�rAr#r|r�r��	_get_specr�r�r�r�r�r�rx�StringIOr�r�r�r�r�r�r$)r<r}rw�	completerr�seenrXr'r$r�r�r�r��sourcerr�rrrr��sj
��
�
��
�zModuleScanner.runr)r,r!r"rAr�rrrrr��sr�cCsZdd�}dd�}t���t�d�t�j|||d�Wd�dS1s&wYdS)zAPrint all the one-line module summaries that contain a substring.cSs6|dd�dkr|dd�d}t||od|�dS�Nrzr{rz- )r��rrXr$rrrr}�szapropos.<locals>.callbackcS�dSrrrrrrr�r6zapropos.<locals>.onerror�ignorer�N)�warnings�catch_warnings�filterwarningsr�r�)rwr}rrrrr��s

"�r�cs�ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	sP|j
sPt�d	�|j	sP|j
rE|S)
aAStart an HTTP server thread on a specific port.

    Start an HTML/text server thread, so HTML or text documents can be
    browsed dynamically and interactively with a web browser.  Example use:

        >>> import time
        >>> import pydoc

        Define a URL handler.  To determine what the client is asking
        for, check the URL and content_type.

        Then get or generate some text or HTML code and return it.

        >>> def my_url_handler(url, content_type):
        ...     text = 'the URL sent was: (%s, %s)' % (url, content_type)
        ...     return text

        Start server thread on port 0.
        If you use port 0, the server will pick a random port number.
        You can then use serverthread.port to get the port number.

        >>> port = 0
        >>> serverthread = pydoc._start_server(my_url_handler, port)

        Check that the server is really started.  If it is, open browser
        and get first page.  Use serverthread.url as the starting page.

        >>> if serverthread.serving:
        ...    import webbrowser

        The next two lines are commented out so a browser doesn't open if
        doctest is run on this module.

        #...    webbrowser.open(serverthread.url)
        #True

        Let the server do its thing. We just need to monitor its status.
        Use time.sleep so the loop doesn't hog the CPU.

        >>> starttime = time.monotonic()
        >>> timeout = 1                    #seconds

        This is a short timeout for testing purposes.

        >>> while serverthread.serving:
        ...     time.sleep(.01)
        ...     if serverthread.serving and time.monotonic() - starttime > timeout:
        ...          serverthread.stop()
        ...          break

        Print any errors that may have occurred.

        >>> print(serverthread.error)
        None
   rNc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsX|j�d�r	d}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)	z�Process a request from an HTML browser.

            The URL received is in self.path.
            Get an HTML page from self.urlhandler and send it.
            z.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8rhN)	rr��
send_response�send_header�end_headers�wfiler]�
urlhandlerri)r<�content_typerrr�do_GET7	s

��z(_start_server.<locals>.DocHandler.do_GETcWr�rr)r<r�rrr�log_messageG	sz-_start_server.<locals>.DocHandler.log_messageN)r,r!r"r�r�rrrr�
DocHandler5	sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�host�addressr}r>r��handlerrS)r<r��portr}rrrr�M	s

z)_start_server.<locals>.DocServer.__init__csB|js��|j��gggd�\}}}|r|��|jr|��dSro)rS�select�socketru�handle_request�server_close)r<�rd�wr�ex�r�rr�serve_until_quitT	s�z1_start_server.<locals>.DocServer.serve_until_quitcSs$|j�|�|jr|�|�dSdSr)r>�server_activater}rrrrr�[	s�z0_start_server.<locals>.DocServer.server_activateN)r,r!r"r�r�r�rr�rr�	DocServerK	sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�rgr��Threadr��serving�error)r<r�r�r�)�	threadingrrr�b	s

z,_start_server.<locals>.ServerThread.__init__c
szz&�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�WdSty<}z
||_WYd}~dSd}~ww)zStart the server.N)�server�
HTTPServerr>r�r��Message�MessageClass�staticmethodr�r�r��ready�	docserverr�r�r�)r<�docsvr�e)r�r��email�httprrr�j	s

��z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r�r��server_portr�r])r<r�rrrr�w	sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)z&Stop the server and this thread nicelyTNF)r�rSrUr�r]rrrr�stop}	s

z(_start_server.<locals>.ServerThread.stopN)r,r!r"r�r�r�r�r)r�r�r�r�r�rr�ServerThread`	s

r�g{�G�z�?)
�http.server�
email.messager�r�r��BaseHTTPRequestHandlerr�r�rmr�r��time�sleep)r��hostnamer�r��threadr)r�r�r�r�r�r�r�
_start_server�s8'
�r�r�cs,G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�rU|dd�}|dkr�tj�tj�t��}tj�||�}t|��}d�|�	��Wd�S1s�wYn|dkr�||�St
d||f��)aThe pydoc url handler for use with the pydoc server.

    If the content_type is 'text/css', the _pydoc.css style
    sheet is read and returned if it exits.

    If the content_type is 'text/html', then the result of
    get_html_page(url) is returned.
    cseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccsd}d|}d||��|fS)r:zpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">a<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>r)r<r;r<�css_path�css_link��html_navbarrrr=�	s���z#_url_handler.<locals>._HTMLDoc.pageN)r,r!r"r=rr�rr�_HTMLDoc�	sr�cs>��dt��t��dt��f�}d|��tjdd��fS)Nz%s [%s, %s]raZ
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            T)�terse)r$rP�python_version�python_build�python_compiler)r��r�rrr��	s
��z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��q*|�d�dd
�|�fS)zModule Index page.cS�d||fS�NrYr�r'rrr�	bltinlink�	r&z3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>r�r�cSsg|]}|dkr|�qS)r�r)r�r'rrrr��	s�z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in Modulesr�z|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;[email protected]&gt;</font>zIndex of ModulesrI)	rBrr�rSrIrr
rrU)r�rB�namesr<r�rr�rr�
html_index�	s"��
�z _url_handler.<locals>.html_indexc		s�g��fdd�}t���t�d�dd�}t�j|||d�Wd�n1s)wYdd	�}g}��d
dd�}�D]
\}}|�||�|�q=|��d
|ddd�|��}d|fS)zSearch results page.cs:|dd�dkr|dd�d}��||od|f�dSr�ryr���
search_resultrrr}�	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSr�rrrrrrr�	r6z2_url_handler.<locals>.html_search.<locals>.onerrorr�NcSr�r�rr�rrrr��	r&z4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>r�r�zkey = %sr��<br>zSearch Results)	r�r�r�r�r�rBr
rIrU)	rwr}rr�r�rBr'r$r<r�r�r�html_search�	s&

���z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)zIndex of topic texts available.cSr��Nz<a href="topic?key=%s">%s</a>rr�rrrr�
r&z4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>r�r��Topicsr�)rBr,r�rYrtrSrI)r�rBr�r<r�rr�html_topics�	s��z!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)zIndex of keywords.r�r�r�cSr�r�rr�rrrr�
r&z6_url_handler.<locals>.html_keywords.<locals>.bltinlink�Keywordsr�)rBr,r�rWrtrSrI)rBr�r�r<r�rr�
html_keywords
s��z#_url_handler.<locals>.html_keywordscs�t��}t||�}|�|�\}}||jvrd}nd}��d|dd�}d��|�}��|dd|�}|rLt|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
zTopic or keyword help page.�KEYWORD�TOPICr}r�r�z
<pre>%s</pre>r�cSr�r�rr�rrrr�-
r&z7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkrjz%s %srI)
rxr�r�rwrWrBrsrIr,r#rSrHrU)rp�buf�htmlhelpr<rur;rBr�r�rr�html_topicpage
s,

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dur|dkrtd��t|�}��||�}||fS)NrQ)r�r�zcould not find object)r�r�r�r�)r]r;r;�contentr�rr�html_getobj6
sz!_url_handler.<locals>.html_getobjcsP��ddd�}d��fdd�tt|�|�D��}|��|dd|�}d||fS)	Nz,<big><big><strong>Error</strong></big></big>r�r�r�c3s�|]}��|�VqdSr)r$rr�rrrB
rz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rBrUrrCrI)r]r�rBr<r�rr�
html_error>
s���z _url_handler.<locals>.html_errorc
s`|}|�d�r
|dd�}z�|dvr��\}}nw|dkr"��\}}nm|dkr,��\}}ncd|vr�|�d�\}}}|dkrC�|�\}}nL|d	kr_z�|�\}}Wn?ty^�|�\}}Yn1w|d
kr�|dvrm��\}}n"z�|�\}}Wnty��|�\}}Ynwtd���|�\}}Wnty�}z
�||�\}}WYd}~nd}~ww��||�S)zGenerate an HTML page for url.rN���)rIrrYrWr�z
search?keyz	topic?keyzget?keyz
bad pydoc url)r�rxr�r�r=)r]�complete_urlr;r��opr�r�)r�r�r�r�r�r�r�r�rr�
get_html_pageH
sH
�����z#_url_handler.<locals>.get_html_pagerrQNr�rIr�z"unknown content type %r for url %s)r8r�r	r�dirname�realpathr�rUr��	readlinesrF)r]r�r�r��	path_herer��fpr)	r�r�r�r�r�r�r�r�r�r�_url_handler�	s,	

(
"�r�T�	localhost)�open_browserr�c	Cs�ddl}tt||�}|jrt|j�dS|jr|d}|r!|�|j�zMz.td|j�t|�|jrOtd�}|�	�}|dkr=n|dkrH|�|j�nt|�|js0Wnt
tfy^t�YnwW|jrm|��td�dSdS|jr{|��td�wwdS)	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> rnrqzServer stopped)
�
webbrowserr�r�r�r�r�r�r]rHr
r^rUr�)r�r�r�r��serverthread�server_help_msgr`rrr�browse}
sD
��	
��
�
��r�cCst|t�o|�tj�dkSr�)rrDr|r	�sep)r~rrr�ispath�
sr�cCsvd|vstj|vst��|vrdStj�t�}tj�|�}|��}||vr1tj�||�s1|�|�|�	dt���|S)z�Ensures current directory is on returned path, and argv0 directory is not

    Exception: argv0 dir is left alone if it's also pydoc's directory.

    Returns a new path entry list, or None if no adjustment is needed.
    rINr)
r	�curdir�getcwdrr�r��copy�samefile�remove�insert)�
given_path�argv0�
stdlib_dir�
script_dir�revised_pathrrr�_get_revised_path�
s

rcCs0ttjtjd�}|dur|tjdd�<dSdS)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)rrr�argv)r
rrr�_adjust_cli_sys_path�
s�r
cCs�ddl}Gdd�dt�}t�z�|�tjdd�d�\}}d}d}d}d}d}|D].\}	}
|	d	kr5d
}d
}|	dkrAt|
�WdS|	dkrId
}|
}|	d
krOd
}|	dkrWd
}|
}q)|rdt|||d�WdS|sh|�|D]W}t|�r�tj	�
|�s�td|�WdSz+t|�r�tj	�|�r�t
|�}|r�t|�r�tj	�|�r�t|�n
t|�nt�|�Wqjty�}z
t|�WYd}~qjd}~wwWdS|j|fy�tj	�tj	�tjd��d}
tdj|
tjd��YdSw)z@Command-line interface (looks at sys.argv to decide what to do).rNc@seZdZdS)zcli.<locals>.BadUsageN)r,r!r"rrrr�BadUsage�
r�rrQzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exista�pydoc - the Python documentation tool

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

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

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

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

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

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
)r`r�)�getoptr�r
rrr�r�r�r	r�existsr�r�r�rr�r�rr�r�r�r�r	r�)rr�optsr��writing�start_serverr�r�r��opt�val�argrxr`rrr�cli�
sl�


������rr�r�)r)r�rN)rIN)r�)`rAr�r�r�r�r��importlib._bootstrapr��importlib._bootstrap_external�importlib.machinery�importlib.utilrrxr	r�rPrKrrr�r�r�urllib.parser�r��collectionsr�reprlibr�	tracebackrrrr(r@r9rHrOrWrYr_rbrirc�
IGNORECASErjrlrnrsrr�r�r�r�r�r�r�r�r�r�r�rr8rrr5r8r7r@rFr?rkrUrNr�r�r`r�r�r�r�r?r�r�r�rr�r�r�r�r�r�rr
rr,rrrr�<module>s�*

3	


'
0;*; $,


�
�

=
n%

U
�

Filemanager

Name Type Size Permission Actions
__future__.cpython-310.pyc File 4.03 KB 0644
__phello__.foo.cpython-310.pyc File 130 B 0644
_aix_support.cpython-310.pyc File 2.81 KB 0644
_bootsubprocess.cpython-310.pyc File 2.24 KB 0644
_collections_abc.cpython-310.pyc File 32.15 KB 0644
_compat_pickle.cpython-310.pyc File 5.73 KB 0644
_compression.cpython-310.pyc File 4.41 KB 0644
_distutils_system_mod.cpython-310.pyc File 5.29 KB 0644
_markupbase.cpython-310.pyc File 7.39 KB 0644
_osx_support.cpython-310.pyc File 11.26 KB 0644
_py_abc.cpython-310.pyc File 4.57 KB 0644
_pydecimal.cpython-310.pyc File 154.04 KB 0644
_pyio.cpython-310.pyc File 71.93 KB 0644
_sitebuiltins.cpython-310.pyc File 3.46 KB 0644
_strptime.cpython-310.pyc File 15.57 KB 0644
_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc File 34.56 KB 0644
_sysconfigdata__x86_64-linux-gnu.cpython-310.pyc File 34.55 KB 0644
_threading_local.cpython-310.pyc File 6.39 KB 0644
_weakrefset.cpython-310.pyc File 7.43 KB 0644
abc.cpython-310.pyc File 6.59 KB 0644
aifc.cpython-310.pyc File 24.11 KB 0644
antigravity.cpython-310.pyc File 822 B 0644
argparse.cpython-310.pyc File 62.05 KB 0644
ast.cpython-310.pyc File 54.43 KB 0644
asynchat.cpython-310.pyc File 6.86 KB 0644
asyncore.cpython-310.pyc File 15.63 KB 0644
base64.cpython-310.pyc File 16.76 KB 0644
bdb.cpython-310.pyc File 25.23 KB 0644
binhex.cpython-310.pyc File 12.57 KB 0644
bisect.cpython-310.pyc File 2.53 KB 0644
bz2.cpython-310.pyc File 10.62 KB 0644
cProfile.cpython-310.pyc File 4.99 KB 0644
calendar.cpython-310.pyc File 25.69 KB 0644
cgi.cpython-310.pyc File 26.1 KB 0644
cgitb.cpython-310.pyc File 9.76 KB 0644
chunk.cpython-310.pyc File 4.75 KB 0644
cmd.cpython-310.pyc File 12.41 KB 0644
code.cpython-310.pyc File 9.72 KB 0644
codecs.cpython-310.pyc File 32.44 KB 0644
codeop.cpython-310.pyc File 5.46 KB 0644
colorsys.cpython-310.pyc File 3.19 KB 0644
compileall.cpython-310.pyc File 12.43 KB 0644
configparser.cpython-310.pyc File 44.39 KB 0644
contextlib.cpython-310.pyc File 20.41 KB 0644
contextvars.cpython-310.pyc File 246 B 0644
copy.cpython-310.pyc File 6.83 KB 0644
copyreg.cpython-310.pyc File 4.57 KB 0644
crypt.cpython-310.pyc File 3.47 KB 0644
csv.cpython-310.pyc File 11.52 KB 0644
dataclasses.cpython-310.pyc File 25.96 KB 0644
datetime.cpython-310.pyc File 55.21 KB 0644
decimal.cpython-310.pyc File 362 B 0644
difflib.cpython-310.pyc File 57.52 KB 0644
dis.cpython-310.pyc File 15.29 KB 0644
doctest.cpython-310.pyc File 74.39 KB 0644
enum.cpython-310.pyc File 25.45 KB 0644
filecmp.cpython-310.pyc File 8.54 KB 0644
fileinput.cpython-310.pyc File 13.74 KB 0644
fnmatch.cpython-310.pyc File 4.14 KB 0644
fractions.cpython-310.pyc File 18.16 KB 0644
ftplib.cpython-310.pyc File 28.3 KB 0644
functools.cpython-310.pyc File 27.67 KB 0644
genericpath.cpython-310.pyc File 3.82 KB 0644
getopt.cpython-310.pyc File 6.19 KB 0644
getpass.cpython-310.pyc File 4.11 KB 0644
gettext.cpython-310.pyc File 17.79 KB 0644
glob.cpython-310.pyc File 5.71 KB 0644
graphlib.cpython-310.pyc File 7.44 KB 0644
gzip.cpython-310.pyc File 18.11 KB 0644
hashlib.cpython-310.pyc File 6.68 KB 0644
heapq.cpython-310.pyc File 13.54 KB 0644
hmac.cpython-310.pyc File 6.81 KB 0644
imaplib.cpython-310.pyc File 41.32 KB 0644
imghdr.cpython-310.pyc File 3.81 KB 0644
imp.cpython-310.pyc File 9.56 KB 0644
inspect.cpython-310.pyc File 83.16 KB 0644
io.cpython-310.pyc File 3.58 KB 0644
ipaddress.cpython-310.pyc File 61.2 KB 0644
keyword.cpython-310.pyc File 927 B 0644
linecache.cpython-310.pyc File 4.04 KB 0644
locale.cpython-310.pyc File 45.07 KB 0644
lzma.cpython-310.pyc File 11.82 KB 0644
mailbox.cpython-310.pyc File 58.68 KB 0644
mailcap.cpython-310.pyc File 7.15 KB 0644
mimetypes.cpython-310.pyc File 17.21 KB 0644
modulefinder.cpython-310.pyc File 15.79 KB 0644
netrc.cpython-310.pyc File 3.84 KB 0644
nntplib.cpython-310.pyc File 30.88 KB 0644
ntpath.cpython-310.pyc File 14.36 KB 0644
nturl2path.cpython-310.pyc File 1.71 KB 0644
numbers.cpython-310.pyc File 11.59 KB 0644
opcode.cpython-310.pyc File 5.32 KB 0644
operator.cpython-310.pyc File 13.19 KB 0644
optparse.cpython-310.pyc File 46.63 KB 0644
os.cpython-310.pyc File 30.86 KB 0644
pathlib.cpython-310.pyc File 41.07 KB 0644
pdb.cpython-310.pyc File 46.33 KB 0644
pickle.cpython-310.pyc File 45.78 KB 0644
pickletools.cpython-310.pyc File 66.17 KB 0644
pipes.cpython-310.pyc File 7.59 KB 0644
pkgutil.cpython-310.pyc File 17.93 KB 0644
platform.cpython-310.pyc File 26.79 KB 0644
plistlib.cpython-310.pyc File 23 KB 0644
poplib.cpython-310.pyc File 13.25 KB 0644
posixpath.cpython-310.pyc File 10.31 KB 0644
pprint.cpython-310.pyc File 17.46 KB 0644
profile.cpython-310.pyc File 14.05 KB 0644
pstats.cpython-310.pyc File 23.07 KB 0644
pty.cpython-310.pyc File 4.05 KB 0644
py_compile.cpython-310.pyc File 7.17 KB 0644
pyclbr.cpython-310.pyc File 9.55 KB 0644
pydoc.cpython-310.pyc File 83.64 KB 0644
queue.cpython-310.pyc File 10.54 KB 0644
quopri.cpython-310.pyc File 5.66 KB 0644
random.cpython-310.pyc File 22.21 KB 0644
re.cpython-310.pyc File 13.89 KB 0644
reprlib.cpython-310.pyc File 5.13 KB 0644
rlcompleter.cpython-310.pyc File 5.81 KB 0644
runpy.cpython-310.pyc File 9.19 KB 0644
sched.cpython-310.pyc File 5.97 KB 0644
secrets.cpython-310.pyc File 2.12 KB 0644
selectors.cpython-310.pyc File 16.7 KB 0644
shelve.cpython-310.pyc File 9.27 KB 0644
shlex.cpython-310.pyc File 7.6 KB 0644
shutil.cpython-310.pyc File 37.63 KB 0644
signal.cpython-310.pyc File 2.87 KB 0644
site.cpython-310.pyc File 17.5 KB 0644
sitecustomize.cpython-310.pyc File 225 B 0644
smtpd.cpython-310.pyc File 25.53 KB 0644
smtplib.cpython-310.pyc File 34.93 KB 0644
sndhdr.cpython-310.pyc File 6.8 KB 0644
socket.cpython-310.pyc File 28.28 KB 0644
socketserver.cpython-310.pyc File 24.75 KB 0644
sre_compile.cpython-310.pyc File 14.84 KB 0644
sre_constants.cpython-310.pyc File 6.21 KB 0644
sre_parse.cpython-310.pyc File 21.25 KB 0644
ssl.cpython-310.pyc File 44.21 KB 0644
stat.cpython-310.pyc File 4.17 KB 0644
statistics.cpython-310.pyc File 36.18 KB 0644
string.cpython-310.pyc File 6.94 KB 0644
stringprep.cpython-310.pyc File 16.67 KB 0644
struct.cpython-310.pyc File 307 B 0644
subprocess.cpython-310.pyc File 43.69 KB 0644
sunau.cpython-310.pyc File 16.1 KB 0644
symtable.cpython-310.pyc File 12.53 KB 0644
sysconfig.cpython-310.pyc File 17.73 KB 0644
tabnanny.cpython-310.pyc File 6.79 KB 0644
tarfile.cpython-310.pyc File 69.02 KB 0644
telnetlib.cpython-310.pyc File 18.07 KB 0644
tempfile.cpython-310.pyc File 26.7 KB 0644
textwrap.cpython-310.pyc File 13.49 KB 0644
this.cpython-310.pyc File 1.23 KB 0644
threading.cpython-310.pyc File 43.92 KB 0644
timeit.cpython-310.pyc File 11.49 KB 0644
token.cpython-310.pyc File 2.67 KB 0644
tokenize.cpython-310.pyc File 16.79 KB 0644
trace.cpython-310.pyc File 19.4 KB 0644
traceback.cpython-310.pyc File 21.2 KB 0644
tracemalloc.cpython-310.pyc File 17.11 KB 0644
tty.cpython-310.pyc File 1.05 KB 0644
turtle.cpython-310.pyc File 125.84 KB 0644
types.cpython-310.pyc File 9.3 KB 0644
typing.cpython-310.pyc File 83.28 KB 0644
uu.cpython-310.pyc File 3.78 KB 0644
uuid.cpython-310.pyc File 21.97 KB 0644
warnings.cpython-310.pyc File 13.33 KB 0644
wave.cpython-310.pyc File 17.18 KB 0644
weakref.cpython-310.pyc File 19.87 KB 0644
webbrowser.cpython-310.pyc File 16.6 KB 0644
xdrlib.cpython-310.pyc File 7.7 KB 0644
zipapp.cpython-310.pyc File 5.87 KB 0644
zipfile.cpython-310.pyc File 60.4 KB 0644
zipimport.cpython-310.pyc File 16.63 KB 0644
Filemanager