HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/__pycache__/pydoc.cpython-35.pyc


Fa@s:dZdgZdZdZdZddlZddlZddlZddl	Zddl
ZddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd	lmZd
dZdd
ZddZddZ ddZ!ddZ"ddZ#ej$dej%Z&ddZ'ddZ(ddZ)dd Z*d!d"Z+ddd#d$Z,d%d&Z-d'd(Z.d)d*Z/id+d,Z0Gd-d.d.e1Z2d/d0Z3did1d2Z4Gd3d4d4Z5Gd5d6d6eZ6Gd7d8d8e5Z7Gd9d:d:eZ8Gd;d<d<e5Z9Gd=d>d>e9Z:d?d@a;dAdBZ<dCdDZ=dEdFZ>dGdHZ?dIdJZ@dKdLZAdMdNZBdOdPZCddQdRZDe9ZEe:ZFe7ZGddSdTZHdUdddVdWZIdUdddXdYZJddZd[ZKd\dd]d^ZLGd_d`d`ZMeMZNGdadbdbZOdcddZPdedfZQdgdhdiZRddjdkdldmZSdndoZTdpdqZUeVdrkr6eUdS)saGenerate 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 -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.  The -p option
can be used with the -b option to explicitly specify the server port.

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 <ping@lfw.org>z26 February 2001zGuido 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_onlycCsg}g}xstjD]h}tjj|p.d}tjj|}||krtjj|r|j||j|qW|S)zAConvert sys.path into a list of absolute, existing, unique paths..)syspathosabspathnormcaseisdirappend)dirsZnormdirsdirZnormdirr/usr/lib/python3.5/pydoc.pypathdirsQs
rcCsCtj|ptj|}|r?tjdd|jpBdS)z-Get the doc string or comments for an object.z^ *
)inspectgetdocZgetcommentsresubrstrip)objectresultrrrr]srcCs|jjd}t|dkr5|ddfSt|dkry|djry|ddj|ddfSddj|fS)z>Split a doc string into a synopsis line (if any) and the rest.
rrN)stripsplitlenrjoin)doclinesrrrsplitdocbs#!r$cCs-|j}|j|kr)|jd|}|S)z@Get a class name and qualify it with a module name if necessary.r)__name__
__module__)rmodnamenamerrr	classnameks	r)cCsYtj|pWtj|pWtj|pWtj|pWtj|pWtj|S)z>Check if an object is of a type that probably means it's data.)rismoduleisclass	isroutineZisframeZistracebackZiscode)rrrrisdatarsr-cGsAx:|r<|dj|j|d}|dd}qW|S)z/Do a series of global replacements on a string.rrrN)r!r)textZpairsrrrreplacexs	 r/cCsnt||krjtd|dd}td|d|}|d|d|t||dS|S)zCOmit part of a string if needed to make it fit in a maximum length.rrNz...)r max)r.maxlenZpreZpostrrrcrams
*r3z at 0x[0-9a-f]{6,16}(>+)$cCstjd|S)z>Remove the hexadecimal id from a Python object representation.z\1)_re_stripidr)r.rrrstripidsr5cCs:tj|p9tj|p9tj|p9tj|S)N)r
isfunctionismethod	isbuiltinZismethoddescriptor)objrrr_is_some_methodsr:cCsRtj|rdStj|rNt|dd}tj|pL|dkSdS)zo
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    T__self__NF)rr7r8getattrr*)fnselfrrr_is_bound_methodsr?cCsi}x*tj|tD]\}}d||<qWx$|jD]}|jt|q=Wx'|jD]}t||||<qgW|S)Nr)r
getmembersr:	__bases__update
allmethodskeysr<)clmethodskeyvaluebaserrrrCsrCcCsPg}g}x7|D]/}||r5|j|q|j|qW||fS)zSplit 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	predicateZyesZnoxrrr_split_lists
rMcCs||dkrdS|jdr2|jdr2dS|jdrTt|drTdS|dk	rj||kS|jdSdS)z3Decide whether to show documentation on a variable.
__author____builtins__
__cached____credits____date____doc____file____spec__
__loader__r&r%__package____path____qualname__	__slots____version__r__r__fieldsTN>rZrRrUr&rSrVrQrTrYrOr%rXr[rWrPrN)
startswithendswithhasattr)r(allr9rrrvisiblenames	
rccCs^g}xQtj|D]@\}}}}tj|r=d}|j||||fqW|S)zCWrap inspect.classify_class_attrs, with fixup for data descriptors.zdata descriptor)rclassify_class_attrsisdatadescriptorr
)rresultsr(kindclsrHrrrrds"rdcCsPtjj|rLx7dD]/}tjjtjj|d|rdSqWdS)z3Guess whether a path refers to a package directory..py.pyc__init__TF)rirj)r	rrisfiler!)rextrrr	ispackages

%rncCs|j}x:|dddks2|jrH|j}|sPqW|j}|dddkr{|dd}|dddkr	|dd}|d	ddkr|dd
}x#|js|j}|sPqW|jddj}nd}|S)Nr#zr"""r0z"""\rrr)readlinerr)filelinerrrrsource_synopsiss&&rvc
Cstj|j}|j|d\}}|dksB||kr||jttjjrltjj	}n0|jttjj
rtjj}nd}|dkrytj
|}Wntk
rdSYnX|t|}WdQRXn{|d|}tjjd|d|}ytjj|}	WndSYnXtjd=|	jrf|	jjdnd}||f||<|S)z.Get the one-line summary out of a module file.NZ__temp__loaderr)NN)r	statst_mtimegetr`tuple	importlib	machineryBYTECODE_SUFFIXESSourcelessFileLoaderEXTENSION_SUFFIXESExtensionFileLoadertokenizeopenOSErrorrvutilspec_from_file_location
_bootstrap_loadrmodulesrS
splitlines)
filenamecachemtimeZ
lastupdaterZ
loader_clsrtrwspecmodulerrrsynopsiss4
			
"rc@s.eZdZdZddZddZdS)ErrorDuringImportzEErrors that occurred while trying to import something to document it.cCs%||_|\|_|_|_dS)N)rexcrHtb)r>rexc_inforrrrks	zErrorDuringImport.__init__cCs#|jj}d|j||jfS)Nzproblem in %s - %s: %s)rr%rrH)r>rrrr__str__ szErrorDuringImport.__str__N)r%r&rYrSrkrrrrrrsrc	Cstjj}t|d"}||jt|k}WdQRXtjj|}tjj	|\}}|rtj
j||}ntj
j||}tjj
||d|}ytjj|SWnt|tjYnXdS)z<Import a Python source file or compiled file given its path.rbNrw)r|rMAGIC_NUMBERrreadr r	rbasenamesplitext_bootstrap_externalrSourceFileLoaderrrrrrr)	rmagicrtZis_bytecoderr(rmrwrrrr
importfile$s"rcs{y|rvtjkrvtjkrvfddtjD}x0g|D]!}tj|||<tj|=qQWt}Wntj\}}}}	tjkrttjj|	nU|tkrt|j|	n4|t	kr
|j
kr
dSttjYnXxMjdddD]2}
yt||
}WqAt
k
rrdSYqAXqAW|S)aImport 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).cs)g|]}|jdr|qS)r)r_).0m)rrr
<listcomp>Js	zsafeimport.<locals>.<listcomp>Nrr)rrbuiltin_module_names
__import__rrrTSyntaxErrorrImportErrorr(rr<AttributeError)r	forceloadrZsubsrGrrrHrinfopartr)rr
safeimport6s. 

rc@seZdZejjddejddZdddZ	dddZ
e
ZZZ
ZZZejjejd	d
ejddddZdS)
Doc
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrcGs||f|}tj|r,|j|Stj|rH|j|SyXtj|rg|j|Stj|r|j|Stj|r|j	|SWnt
k
rYnXt|tr|j
|S|j|S)z%Generate documentation for an object.)risgetsetdescriptordocdataismemberdescriptorr*	docmoduler+docclassr,
docroutiner
isinstancepropertydocpropertydocother)r>rr(argsrrrdocumentls"





zDoc.documentcGs9d|odt|t|jf}t|dS)z+Raise an exception for unimplemented types.z.don't know how to document object%s of type %s N)reprtyper%	TypeError)r>rr(rmessagerrrfail~s&zDoc.failZlibzpython%d.%dcCs;ytj|}Wntk
r-d}YnXtjjd|j}tjj|}t	|t
tr1|jdks|j|r1|jtjj
|d
r1|jtjj
|dr1|jdkr1|jdrd|jd|jjf}q7tjj
||jjd}nd}|S)z*Return the location of module docs or Nonez
(built-in)rerrno
exceptionsgcimpmarshalposixsignalr_thread	zipimportz
dist-packagesz
site-packages	xml.etreetest.pydoc_modhttp://https://z%s/%s/z.htmlN)
rrrrrrrrrr)rr)rr)r
getabsfilerr	environrzrrrrrr%r_r!rlower)r>rZbasedirrtdoclocrrr	getdoclocs&
	%%z
Doc.getdocloc)r%r&rYr	rrzrversion_inforrrrrrrrrrr!base_exec_prefixrrrrrrfsrc@sjeZdZdZddZddZddZdd	Zd
dZeZ	dd
Z
eZdS)HTMLReprzBClass for safely making an HTML representation of a Python object.cCs:tj|d|_|_d|_d|_|_dS)N
d)rrkmaxlistmaxtuplemaxdict	maxstringmaxother)r>rrrrks
	zHTMLRepr.__init__cCst|ddddddS)N&z&amp;<z&lt;>z&gt;)r/)r>r.rrrescapeszHTMLRepr.escapecCstj||S)N)rr)r>rrrrrsz
HTMLRepr.reprcCstt|dr\ddjt|jj}t||r\t||||S|jttt	||j
S)Nr%repr_r])rarr!r%rr<rr3r5rr)r>rLlevel
methodnamerrrrepr1s
"zHTMLRepr.repr1cCst||j}t|}d|krcdt|ddkrcd|d|j||dStjdd|j|S)Nrqz\\rrrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r3rrr/rrr)r>rLrtesttestreprrrrrepr_strings$!	zHTMLRepr.repr_stringcCsOy)|jttt||jSWn|jd|jjSYnXdS)Nz
<%s instance>)rr3r5rr	__class__r%)r>rLrrrr
repr_instances)zHTMLRepr.repr_instanceN)r%r&rYrSrkrrrrrepr_strrZrepr_unicoderrrrrsrc@seZdZdZeZejZejZddZdddZ	dddd	d
dZ
dd
ZddZdddZ
ddZddZddZddZddZddZdiiidd Zdd!d"Zddd#d$Zddiid%d&Zd'd(Zddiiidd)d*Zd+d,Zdddd-d.Zddd/d0Zdddd1d2Zdd3d4ZdS)5HTMLDocz'Formatter class for HTML documentation.cCsd||fS)zFormat 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>titlecontentsrrrpageszHTMLDoc.pagercCsd|||||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>
    z&nbsp;r)r>rfgcolbgcolZextrasrrrheadings	zHTMLDoc.headingNz&nbsp;c	
Csw|dkrdd|d}d|||f}	|rT|	d||||f}	n|	d|||f}	|	d|S)	z Format a section with a heading.Nz<tt>z&nbsp;z</tt>z<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r>rrrrwidthZpreludeZ
marginaliaZgaprrrrsectionszHTMLDoc.sectioncGsd|}|j||S)z$Format a section with a big heading.z<big><strong>%s</strong></big>)r)r>rrrrr
bigsections
zHTMLDoc.bigsectionc
Cs7|j|j}t|dddddddd	S)z!Format literal preformatted text.z

z
 
rz&nbsp;rz<br>
)r
expandtabsr/)r>r.rrr	preformatszHTMLDoc.preformatrpcCsd}t||d|}xt|D]r}|dd|}xMt|||||D]0}|t|kr_||||d}q_W|d}q+Wd|S)z0Format a list of items into a multi-column list.rrz<td width="%d%%" valign=top>rz<br>
z</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r range)r>listformatZcolsrrowscolirrrmulticolumns"zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>r)r>r.rrrgreyszHTMLDoc.greycGs3x,|D]$}||krd|||fSqW|S)z:Make a link for an identifier, given name-to-URL mappings.z<a href="%s">%s</a>r)r>r(Zdictsdictrrrnamelinks
zHTMLDoc.namelinkcCsm|jtjj|j}}t||r`t|||kr`d|j|t||fSt||S)zMake a link for a class.z<a href="%s.html#%s">%s</a>)r%rrrzr&rar<r))r>rr'r(rrrr	classlink#s
$zHTMLDoc.classlinkcCsd|j|jfS)zMake a link for a module.z<a href="%s.html">%s</a>)r%)r>rrrr
modulelink+szHTMLDoc.modulelinkcCso|\}}}}|r%|j|S|r>d||f}n
d|}|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)z<a href="%s">%s</a>)r)r>Z
modpkginfor(rrnshadowedurlr.rrr
modpkglink/s


zHTMLDoc.modpkglinkcCsd||fS)zMake a link to source file.z<a href="file:%s">%s</a>r)r>rrrrrfilelink>szHTMLDoc.filelinkcCs|p|j}g}d}tjd}x|j||}	|	sFP|	j\}
}|j||||
|	j\}}
}}}}|
r||jdd}|jd||fn|rdt|}|jd|||fn|r7dt|}|jd|||fn|r|||dd	krw|jd
|j	||q|jd|nU|||dd	kr|j|j	||||n|j|j	|||}q-W|j|||dd
j
|S)zMark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))"z&quot;z<a href="%s">%s</a>z'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r(zself.zself.<strong>%s</strong>Nr)rrcompilesearchspanr
groupsr/intrr!)r>r.rfuncsclassesrFrfherepatternmatchstartendrbZschemeZrfcZpepZselfdotr(rrrrmarkupBs<   "
zHTMLDoc.markupc
Csd}x|D]}t|tfkr|\}}|d}||j||}|r||fkrg}x'|D]}	|j|j|	|qyW|ddj|d}|d}q
t|tgkr
|d|j|||}q
Wd|S)	zAProduce HTML for a class tree as given by inspect.getclasstree().rz"<dt><font face="helvetica, arial">r
z, )z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)rrr
r!
formattree)
r>treer'parentrentrycbasesparentsrIrrrrms 



zHTMLDoc.formattreec#s|j}y
|j}Wntk
r0d}YnX|jd}g}xPtt|dD]8}|jddj|d|d||fq]Wdj||d.d}	d|	}
y7tj	|}t
jj|}j
||}
Wntk
rd}
YnXg}t|drt|j}|ddd/krx|d0dd	krx|dd1j}|jdj|t|dr|jjt|j|r|
d
dj|}
j|}|dk	rdt}nd}j|
ddd|
|}tj|tj}gi}}xtj|tjD]n\}}|dk	stj|p||krft|||rf|j||fd|||<||<qfWx|D]\}}x|jD]}|j|j}}tj j!|}||kr|rt||rt"|||kr||kr|d|||<||<qWqWgi}}xtj|tj#D]\}}|dk	stj$|stj||krt|||r|j||fd|||<tj%|r||||<qWg}xEtj|t&D]1\}}t|||rP|j||fqPWj't(|j)||}|od|}|d|}t|drVg}x<t*j+|j,D](\}}} |j||| dfqW|j-j.|j/}!|j0ddd|!}n@|rj.|fdd}!|j0ddd|!}|r.d d!|D}"j1tj2|"d|g}!x6|D].\}}|!jj3|||||qW|j0d"dd#d$j|!}|rg}!x6|D].\}}|!jj3|||||qAW|j0d%dd&d$j|!}|rg}!x-|D]%\}}|!jj3||qW|j0d'dd(d)j|!}t|d*rBj't|j4j)}!|j0d+dd|!}t|d,rj't|j5j)}!|j0d-dd|!}|S)2z/Produce HTML documentation for a module object.Nrrz5<a href="%s.html"><font color="#ffffff">%s</font></a>z)<big><big><strong>%s</strong></big></big>z
(built-in)r[$z
Revision: z
version %srRz (%s)z, z-<br><a href="%(docloc)s">Module Reference</a>rz#ffffffz#7799eez<a href=".">index</a><br>roz.html#z#-z<tt>%s</tt>z
<p>%s</p>
rXrzPackage Contentsz#aa55cccsj|dS)Nr)r)t)r>rr<lambda>sz#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|qSrr)rrGrHrrrrs	z%HTMLDoc.docmodule.<locals>.<listcomp>ZClassesz#ee77aarZ	Functionsz#eeaa77ZDataz#55aa55z<br>
rNZAuthorrQZCreditsrrz$Revision: rrrr)6r%__all__rrrr r
r!rrurllibparseZquoterrrastrr[rrrRrlocalsrr@r*r+	getmodulercrAr&rrrzr<r,r8r6r-rrrpkgutiliter_modulesrXsortrrrrgetclasstreerrNrQ)#r>rr(modignoredrbpartsZlinksrZ
linkednameheadrrrrversionrrrrZcdictrGrHrIr'rrZfdictdatar"modpkgsimporterispkgr	classlistr)r>rrs	

-

,	
"!"
"$!"
		!&	&				zHTMLDoc.docmodulecsj}|p|}j}g}	|	jGfddd}
|
ttj}t|dkrjdx+|D]#}dj|j	qWdfdd}
fd	d
}fdd}fd
dt
D}ix|D]w\}}}}d|d||<}yt|}Wntk
rYnXy||<WqWt
k
rYqWXqWWx[|r/|r|jn|ddt|fdd\}}tjkr:|}qn.krOd}ndjj	}|d7}|jddd|
d||dd}|
d||dd}|
d||dd}|d||d d}|d!||d"d}|gks&t|}qWd#j|	}	||kr^d$||f}nd%|||f}|rg}x*|D]"}|jj|j	qW|d&d'j|}jtj}|od(|}j|d)d*|	d+|S),z.Produce HTML documentation for a class object.cs.eZdZddZfddZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dS)Nr)needone)r>rrrrksz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs |jrdd|_dS)Nz<hr>
r)r8)r>)pushrrmaybes	
z.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN)r%r&rYrkr:r)r9rrHorizontalRulesr;rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
z</dl>
cst||\}}|rj|x|D]\}}}}yt|}Wn+tk
rj||Yn&Xj||dq6W|S)Nr)rMr:r<	Exception_docdescriptorr)msgattrsrKokr(rghomeclsrH)rrhrmdictr.rr9r>rrspills


zHTMLDoc.docclass.<locals>.spillcsit||\}}|rej|x3|D]+\}}}}j||q6W|S)N)rMr:r=)r>r?rKr@r(rgrArH)rBr.r9r>rrspilldescriptors)s

z*HTMLDoc.docclass.<locals>.spilldescriptorsc
s
t||\}}|r	j|x|D]\}}}}jt||}t|stj|rt|dd}	nd}	|	dkrd|nBjt|j	}	d|	}	d||	fdq6W|S)NrSz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rMr:rr<callablerrerrr)
r>r?rKr@r(rgrArHrIr")rrrBrCr.rr9r>rr	spilldata2s"


z#HTMLDoc.docclass.<locals>.spilldatacs@g|]6\}}}}t|dr||||fqS)r9)rc)rr(rgrhrH)rrrrGs	z$HTMLDoc.docclass.<locals>.<listcomp>ro-rcs|dkS)Nrr)r")	thisclassrrr#`sz"HTMLDoc.docclass.<locals>.<lambda>zdefined herezinherited from %sz:<br>
rGcSs|dS)Nrr)r"rrrr#msz
Methods %scSs|ddkS)Nrmethodr)r"rrrr#qszClass methods %scSs|ddkS)Nrzclass methodr)r"rrrr#sszStatic methods %scSs|ddkS)Nrz
static methodr)r"rrrr#uszData descriptors %scSs|ddkS)Nrzdata descriptorr)r"rrrr#wszData and other attributes %scSs|ddkS)Nrr3r)r"rrrr#ysrz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>z(%s)z, z<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r0)r%rAr
rrgetmror r:rr&rdr<r<rpopleftrMbuiltinsrr,AssertionErrorr!rrrr)r>rr(r.rrr/realnamerrr;mrorIrDrErGr?rGrgrArHanchor	inheritedtagrrr"r)	rrrBrCr.rr9r>rIrrs				



'	'

		!	








 $zHTMLDoc.docclasscCs|jd|j|S)z)Format an argument default value as text.=)rr)r>rrrrformatvalueszHTMLDoc.formatvaluecCsT|j}|p|}|r$|jp'dd|}	d}
d}t|r|jj}|r||k	rd|j||}
nD|jdk	rd|j|jj|}
nd|j||}
||krd|	|f}
ne|r0||jkr0|j||kr0d	|jd||f}d
}n|}d|	||f}
d}tj|rytj|}Wnt	t
fk
rd}YnX|rt|}|dkrd
|}
|d
d}|sd}|
|j||
o|j
d|
}|rd|S|jt||j|||}|o?d|}d||fSdS)z;Produce HTML documentation for a function or method object.rrHrz from Nz method of %s instancez unbound %s methodz$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %sz<lambda>z$<strong>%s</strong> <em>lambda</em> z(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
rr)r%r?r;rr__dict__rr,	signature
ValueErrorrr'rrrrr)r>rr(r.rrrFrErOrQnoteskipdocsimclassrZreallinkargspecrWdeclr"rrrrsZ			
zHTMLDoc.docroutinecCsrg}|j}|r#|d||jdk	r[|jt||j}|d||ddj|S)Nz!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
z</dl>
r)r
rSrrrr!)r>r(rHr.rfr9r"rrrr=s	
zHTMLDoc._docdescriptorcCs|j|||S)z*Produce html documentation for a property.)r=)r>rr(r.rErrrrszHTMLDoc.docpropertycGs'|rd|pd}||j|S)z-Produce HTML documentation for a data object.z<strong>%s</strong> = r)r)r>rr(r.r/ZlhsrrrrszHTMLDoc.docothercCs|j|||S)z1Produce html documentation for a data descriptor.)r=)r>rr(r.rErrrrszHTMLDoc.docdatacCsg}|dkri}xhtj|gD]T\}}}tdd|DrVq+|j|d|||kfd||<q+W|j|j||j}|j|dd|S)z2Generate an HTML index for a directory of modules.Ncss1|]'}dt|ko&dknVqdS)iiN)ord)rchrrr	<genexpr>sz HTMLDoc.index.<locals>.<genexpr>rrz#ffffffz#ee77aa)r*r+anyr
r,rrr)r>rrr4r5r(r6rrrrindexs"
z
HTMLDoc.index)r%r&rYrSr_repr_instancerrrrrrrrrrrrrrrrrrrUrr=rrrrbrrrrrs:			
+y;
rc@sLeZdZdZddZddZddZeZdd	Zd
S)TextReprzAClass for safely making a text representation of a Python object.cCs:tj|d|_|_d|_d|_|_dS)Nrrr)rrkrrrrr)r>rrrrks
	zTextRepr.__init__cCsxtt|dr\ddjt|jj}t||r\t||||Sttt||j	S)Nr%rr])
rarr!r%rr<r3r5rr)r>rLrrrrrrs
"zTextRepr.repr1cCs^t||j}t|}d|krZdt|ddkrZd|d||dS|S)Nrqz\\rrr)r3rrr/)r>rLrrrrrrr	s
$zTextRepr.repr_stringc
Cs=y ttt||jSWnd|jjSYnXdS)Nz
<%s instance>)r3r5rrrr%)r>rLrrrrrs zTextRepr.repr_instanceN)	r%r&rYrSrkrrrrrrrrrds	rdc@seZdZdZeZejZddZdddZddZ	d	d
ddZ
d	d	d
dZd	d	ddZddZ
d	d	d	ddZddZd	d	d	ddZd	d	d	ddZd	d	d	d	d	ddZd	S)TextDocz'Formatter class for text documentation.cCsdjdd|DS)z(Format a string in bold by overstriking.rcss|]}|d|VqdS)Nr)rr_rrrr`$szTextDoc.bold.<locals>.<genexpr>)r!)r>r.rrrbold"szTextDoc.boldz    csS|s
dSfdd|jdD}|rF|dj|d<dj|S)z6Indent text by prepending a given prefix to each line.rcsg|]}|qSrr)rru)prefixrrr)s	z"TextDoc.indent.<locals>.<listcomp>rrrrrr)rrr!)r>r.rhr#r)rhrindent&s"zTextDoc.indentcCs.|j|j}|j|d|dS)z&Format a section with a given heading.rz

)rirrg)r>rrZclean_contentsrrrr-szTextDoc.sectionNrc
sd}x|D]}t|tfkr|\}}||t|}|r||fkrfdd|D}	|ddj|	}|d}q
t|tgkr
||j|||d}q
W|S)zBRender in text a class tree as returned by inspect.getclasstree().rc3s|]}t|VqdS)N)r))rr)r'rrr`<sz%TextDoc.formattree.<locals>.<genexpr>z(%s)z, rz    )rr)r!r)
r>rr'rrhrrrrrr)r'rr4s

	zTextDoc.formattreecCs|j}tt|\}}|jd||o:d|}t|dd}|j|}|dk	r||jd|d}|r||jd|}g}	xotj|tjD]X\}
}|dk	stj	|p||krt
|
||r|	j|
|fqWg}xxtj|tjD]a\}
}|dk	sttj
|sttj	||kr8t
|
||r8|j|
|fq8Wg}
xEtj|tD]1\}
}t
|
||r|
j|
|fqWg}t}t|drxWtj|jD]C\}}}|j||rR|j|d	q|j|qW|j||jd
dj|}g}xRtj|tjD];\}
}|jj|dr|
|kr|j|
qW|r|j||jd
dj|}|	rdd|	D}|jtj|d|g}x0|	D](\}
}|j|j||
|qWW||jddj|}|rg}x0|D](\}
}|j|j||
|qW||jddj|}|
rdg}x6|
D].\}
}|j|j||
|ddqW||jddj|}t|drt|j}|ddd#kr|d$ddkr|dd%j}||jd|}t|dr||jdt|j }t|dr6||jdt|j!}t|drd||jd t|j"}ytj#|}Wnt$k
rd!}YnX||jd"|}|S)&z5Produce text documentation for a given module object.NAMEz - 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.
ZDESCRIPTIONrXz
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|qSrr)rrGrHrrrrs	z%TextDoc.docmodule.<locals>.<listcomp>rCLASSES	FUNCTIONSr2FZDATAr[r r!z
Revision: ZVERSIONrRZDATErNZAUTHORrQZCREDITSz
(built-in)ZFILEz$Revision: rrrr)%r%r$rrr<rrr@r+r)rcr
r,r8r-setrar*r+rXaddr,r!r*r_rr-rrr'r[rrRrNrQrr)r>rr(r.ZsynopdescrrbrrrGrHrr3r4Z
modpkgs_namesr5r'r6Z
submodulesr7rr2rtrrrrDs	 ""$	"

	""
	  &,
zTextDoc.docmodulecs?j}|p|}j}jdd}||krRdj|}nj|d|}|rt||}	|ddj|	}t}
|
r|
dgpg}|jtt	j
}t|dkr#d	x"|D]}
d
||
qWdGfdd
d
}|fdd}fdd}fdd}fddtD}xB|r|r|j
n|ddt|fdd\}}tjkr#|}qn+kr8d}ndtj}|j|d||dd}|d||dd}|d||d d}|d!||d"d}|d#||d$d}|gkst|}qWdj|}|s|dS|dj|jd%dS)&z4Produce text documentation for a given class object.cSs
t||S)N)r))rrrrrmakenamesz"TextDoc.docclass.<locals>.makenamezclass z	 = class z(%s)z, rrzMethod resolution order:z    rcs.eZdZddZfddZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dS)Nr)r8)r>rrrrksz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs$|jrddd|_dS)NrHrmr)r8)r>)r9rrr:s	z.TextDoc.docclass.<locals>.HorizontalRule.maybeN)r%r&rYrkr:r)r9rrr;sr;cst||\}}|rj|xw|D]o\}}}}yt|}Wn+tk
rj||Yq6Xj||q6W|S)N)rMr:r<r<r=r)r>r?rKr@r(rgrArH)rBr.rr9r>rrrDs


zTextDoc.docclass.<locals>.spillcsit||\}}|rej|x3|D]+\}}}}j||q6W|S)N)rMr:r=)r>r?rKr@r(rgrArH)rBr.r9r>rrrEs

z*TextDoc.docclass.<locals>.spilldescriptorsc
st||\}}|rj|x|D]\}}}}t|sctj|rrt|}nd}yt|}	Wntk
r|j|}	YnXj	|	|ddd|dq6W|S)Nr2rmr"r)
rMr:rFrrerr<rrVr)
r>r?rKr@r(rgrArHr"r9)rBr.rr9r>rrrGs


!z#TextDoc.docclass.<locals>.spilldatacs@g|]6\}}}}t|dr||||fqS)r9)rc)rr(rgrhrH)rrrrs	z$TextDoc.docclass.<locals>.<listcomp>rcs|dkS)Nrr)r")rIrrr#sz"TextDoc.docclass.<locals>.<lambda>zdefined herezinherited from %szMethods %s:
cSs|ddkS)NrrJr)r"rrrr#szClass methods %s:
cSs|ddkS)Nrzclass methodr)r"rrrr#szStatic methods %s:
cSs|ddkS)Nrz
static methodr)r"rrrr#szData descriptors %s:
cSs|ddkS)Nrzdata descriptorr)r"rrrr#szData and other attributes %s:
cSs|ddkS)Nrr3r)r"rrrr#sz |  )r%rAr&rgmapr!rr
rrrKr rdrLrMrMrr)r,rNrir)r>rr(r.r/rOrrqrrr"rrPrIr;rDrErGr?rRrSr)rBr.rr9r>rIrrsn			


			!		







zTextDoc.docclasscCsd|j|S)z)Format an argument default value as text.rT)r)r>rrrrrU&szTextDoc.formatvaluecCs|j}|p|}d}d}t|r|jj}|ra||k	rdt||}n>|jdk	rdt|jj|}ndt||}||kr|j|}	nE|r||jkr|j||krd}|j|d|}	d}
tj|rytj	|}Wnt
tfk
rJd}YnX|rt|}
|d	kr|j|d
}	|
dd
}
|
sd}
|	|
|}|r|dSt
|pd}
|d|
o|j|
jdSdS)z;Produce text documentation for a function or method object.rrz from Nz method of %s instancez unbound %s methodrz = z<lambda>z lambda z(...)rrr)r%r?r;rr)rgrVrr,rWrXrr'rrir)r>rr(r.rErOrYrZr[rr\rWr]r"rrrr*sJ	zTextDoc.docroutinecCstg}|j}|r2||j||dt|pAd}|rg||j||ddj|S)Nrr)r
rgrrir!)r>r(rHr.rfr9r"rrrr=\s	

zTextDoc._docdescriptorcCs|j|||S)z*Produce text documentation for a property.)r=)r>rr(r.rErrrriszTextDoc.docpropertycCs|j|||S)z1Produce text documentation for a data descriptor.)r=)r>rr(r.rErrrrmszTextDoc.docdatac
Cs|j|}|r_|r%|dp(d|}|t|}	|	dkr_|d|	d}|rx|j|dp{d|}|dk	r|d|jt|7}|S)z-Produce text documentation for a data object.z = rrNz...r)rr rgrir')
r>rr(r.rr2r"rruZchoprrrrqs#zTextDoc.docother)r%r&rYrSrdrcrrgrirrrrrUrr=rrrrrrrres		e}2
rec@s"eZdZdZddZdS)
_PlainTextDocz2Subclass of TextDoc which overrides string stylingcCs|S)Nr)r>r.rrrrgsz_PlainTextDoc.boldN)r%r&rYrSrgrrrrrs}srscCstat|dS)zCThe first time this is called, determine what kind of pager to use.N)getpagerpager)r.rrrrus	rucCsttjdstSttjds,tStjjsLtjjrPtSdtjkrtjdkrxddStjj	ddkrd	dSd
dStjj	ddkrtStjdkrddSttdrtj
d
dkrddSttdr5tj
ddkr5ddSddl}|j\}}tj
|z:ttdrtj
d|dkrddStSWdtj|XdS)z2Decide what method to use for paging through text.isattyPAGERZwin32cSstt|tjdS)Nrw)
tempfilepagerplainr	r)r.rrrr#szgetpager.<locals>.<lambda>ZTERMdumbemacscSstt|tjdS)Nrw)	pipepagerryr	r)r.rrrr#scSst|tjdS)Nrw)r|r	r)r.rrrr#scSstt|dS)Nzmore <)rxry)r.rrrr#ssystemz(pager) 2>/dev/nullrcSs
t|dS)Nru)r|)r.rrrr#sz(less) 2>/dev/nullcSs
t|dS)NZless)r|)r.rrrr#sNz	more "%s"cSs
t|dS)NZmore)r|)r.rrrr#s)rzr{)rzr{)rarstdin
plainpagerstdoutrvr	rplatformrzr}tempfileZmkstempclosettypagerunlink)rfdrrrrrts8 



$
$

(
rtcCstjdd|S)z%Remove boldface formatting from text.z.r)rr)r.rrrrysryc Csddl}|j|ddd|j}yLtj|jdd-}y|j|Wntk
rmYnXWdQRXWntk
rYnXx(y|j	PWqtk
rYqXqWdS)z3Page through text by feeding it to another program.rNshellTr~errorsbackslashreplace)

subprocessPopenPIPEio
TextIOWrapperr~writeKeyboardInterruptrwait)r.cmdrprocpiperrrr|s 



r|cCsvddl}|j}t|ddd}|j|WdQRXztj|d|dWdtj|XdS)z<Page through text by invoking a program on a temporary file.rNwrrz "r	)rZmktemprrr	r}r)r.rrrrtrrrrxsrxcCs4ttjddpd}|j|dj|S)Nencodingzutf-8r)r<rrencodedecode)r.rrrr_escape_stdoutsrc
Cs5tt|jd}yGddl}tjj}|j|}|j|dd}Wn0t	t
tjfk
rd}dd}YnXz|yt
tjjdd}Wntk
rd}YnX|dkrd	}|d}}tjjdj|d|dx||drtjjd
tjj|}	|	dkrrtjjd
Pn5|	dkrtjjd
||d|d}q|	dkr|||}|dkrd}tjjddj||||d||}qWWd|r0|j||j|XdS)z%Page through text on a text terminal.rrNcSstjjdS)Nr)rr~rrrrrr#szttypager.<locals>.<lambda>cSs!tjjddddS)Nrrr)rr~rsrrrrr#sZLINESrz
-- more --qQz
          

bB)rr)rr)rrr)ryrrttyrr~filenoZ	tcgetattrZ	setcbreakrrrUnsupportedOperationrr	rrzrXrrr!flushZ	tcsetattrZ	TCSAFLUSH)
r.r#rroldZgetcharhrZincrrrrrsL

'
	
/rcCs tjjtt|dS)z>Simply print unformatted text.  This is the ultimate fallback.N)rrrryr)r.rrrrsrcCs$tj|rQ|jtjkr,d|jSt|drFd|jSd|jStj|rkd|jStj|rd|jj	|jj|jfStj
|rd|jj	|jj|jfStj|rd|jStj|rd	|jStj
|rd
|jSt|jS)z/Produce a short description of the given thing.zbuilt-in module rXzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%szclass z	function zmethod )rr*r%rrrar8r__objclass__r&rr+r6r7r)thingrrrdescribes.rcCsdd|jdD}d\}}xW|t|krtdj|d|d|}|r}||d}}q+Pq+W|r|}nt}xD||dD]2}yt||}Wqtk
rdSYqXqW|S)z@Locate an object by name or dotted path, importing as necessary.cSsg|]}|r|qSrr)rrrrrr%s	zlocate.<locals>.<listcomp>rNrr)Nr)rr rr!rMr<r)rrr0rnZ
nextmodulerrrrrlocate#s &	

rcCsyt|trDt||}|dkr:td|||fSt|dd}|t|trn|ndfSdS)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%)rr'rrr<)rrrr(rrrresolve<s

rz Python Library Documentation: %scCs'|dkrt}t||\}}t|}tj|}|rxd|krx|d|d|jd7}n#|r||k	r|d|j7}tj|ptj|ptj	|ptj
|ptj|pt|t
st|}|d7}||d|j||S)zBRender text documentation, given an object or a path to an object.Nrz in z in module z objectz

)r.rrrr)rfindr%r*r+r,rrrrrr)rrrZrendererrr(rprrrr
render_docJs$$
rcCsyE|dkr(tt|||n|jt|||tWn5ttfk
r|}zt|WYdd}~XnXdS)zCDisplay text documentation, given an object or a path to an object.N)rurr	plaintextrrprint)rrroutputrHrrrr"cs r"cCsy~t||\}}tjt|tj||}t|dddd}|j|WdQRXtd|dWn5tt	fk
r}zt|WYdd}~XnXdS)z<Write HTML documentation to a file in the current directory.z.htmlrrzutf-8NZwrote)
rhtmlrrrrrrrr)rrrr(rrtrHrrrwritedocns$rrcCsI|dkri}x0tj|g|D]\}}}t|q(WdS)zAWrite out HTML documentation for all modules in a directory tree.N)r*
walk_packagesr)rpkgpathZdoner5r'r6rrr	writedocsys
%rc@seZdZddddddddddd	d5d
d6dd7dd8dd9dd:dddd;dddddd<dddd=dd>dd?d!d@d#d$d%dAd'dBd)dd*dd+dCd,dDd.dEddFd/dGddHd2dIi!Zd3dJd<dKd$dLdQdMdRdNd_dOd`dPiZdCdcd@dddedfdgdhdidjdkdldmdndod3dpdqdrdsdtdudvdwdxdwdydzd{dziZxaejD]S\ZZxDeD]<Z	ej
e	eZeekred|eZeee	<qWquWd}dQd3dRddSddTddUddVddWddXd`dYddZddd&d[dd\dd]dd^dd}dd}dd_djd`ddaddbd dcdddddd<dddddeddfddgddhddid"djddkddlddmddnddoddddd-dpddqddrddsdqdtdduddddvddwddxddyddzdd{dd|dd}dd~ddddQdddddd_dd$ddddd	dddRddddd.ddddddddddddiIZddddZe
ddZe
ddZddZeZeddZddZddZdd Zd!d"Zd#d$d%d&Zd'd(Zd)d*Zd+d,Zdd-d.Zdd/d0Zd1d2Zdd3d4ZdS(HelperFalserNoneTrueandZBOOLEANaswithassertbreak	while forclassCLASSES SPECIALMETHODScontinuedeffunctiondelBASICMETHODSelififelseexcepttryfinallyforbreak continue whilefromimportglobalnonlocal NAMESPACES
TRUTHVALUEMODULESinSEQUENCEMETHODSisZ
COMPARISONlambdarlnonlocalglobal NAMESPACESnotorpassraise
EXCEPTIONSreturnwhilebreak continue if TRUTHVALUE CONTEXTMANAGERS EXCEPTIONS yieldyieldZSTRINGS''''r'b'"""r	r"b"	OPERATORS+rH***r//%<<>>r|^~rr<=>===!=<>ZUNARYAUGMENTEDASSIGNMENT+=-=*=/=%=&=|=^=<<=>>=**=//=ZBITWISEZCOMPLEXjJzOPERATORS FORMATTINGZPOWER,zTUPLES LISTS FUNCTIONSrz ATTRIBUTES FLOAT MODULES OBJECTSz...ELLIPSIS:zSLICINGS DICTIONARYLITERALS@z	def classrqr]ZPRIVATENAMESr\zPRIVATENAMES SPECIALMETHODS`Z
BACKQUOTESr
zTUPLES FUNCTIONS CALLSr[zLISTS SUBSCRIPTS SLICINGS]rTYPEStypesRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspectstrings4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPESZ
STRINGMETHODSstring-methodsSTRINGS FORMATTINGZ
FORMATTING
formatstringsUNICODE:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPESZNUMBERSnumbersINTEGER FLOAT COMPLEX TYPESZINTEGERintegers	int rangeZFLOATfloating
float math	imaginary
complex cmathZ	SEQUENCEStypesseq$STRINGMETHODS FORMATTING range LISTSZMAPPINGSZDICTIONARIEStypesfunctions	def TYPESZMETHODStypesmethodsclass def CLASSES TYPESZCODEOBJECTSbltin-code-objectscompile FUNCTIONS TYPESZTYPEOBJECTSbltin-type-objectstypes TYPESZFRAMEOBJECTSZ
TRACEBACKSZNONEbltin-null-objectbltin-ellipsis-objectSLICINGSZSPECIALATTRIBUTESspecialattrsrk!class SPECIALMETHODS PRIVATENAMEStypesmodulesZPACKAGESEXPRESSIONSoperator-summarylambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIESZ
PRECEDENCEZOBJECTSobjectsZSPECIALMETHODSspecialnamesbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES
customizationhash repr str SPECIALMETHODSZATTRIBUTEMETHODSattribute-accessATTRIBUTES SPECIALMETHODSZCALLABLEMETHODScallable-typesCALLS SPECIALMETHODSsequence-types(SEQUENCES SEQUENCEMETHODS SPECIALMETHODSZMAPPINGMETHODSMAPPINGS SPECIALMETHODS
NUMBERMETHODS
numeric-types*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODSZ	EXECUTION	execmodel%NAMESPACES DYNAMICFEATURES EXCEPTIONSZ
NAMESPACESnaming3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURESZDYNAMICFEATURESdynamic-featuresZSCOPINGZFRAMESrtry except finally raiseZCONVERSIONSconversionsZIDENTIFIERSidentifierskeywords SPECIALIDENTIFIERSZSPECIALIDENTIFIERS
id-classesatom-identifiersZLITERALS
atom-literals=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALSZTUPLESZ
TUPLELITERALS	exprlistsTUPLES LITERALSZLISTStypesseq-mutableLISTLITERALSlistsLISTS LITERALStypesmappingDICTIONARYLITERALSrDICTIONARIES LITERALSZ
ATTRIBUTESattribute-references(getattr hasattr setattr ATTRIBUTEMETHODSZ
SUBSCRIPTS
subscriptionsslicingsZCALLScallspowerunaryZBINARYbinaryZSHIFTINGshiftingbitwisecomparisonsEXPRESSIONS BASICMETHODSbooleansEXPRESSIONS TRUTHVALUEZ	ASSERTIONZ
ASSIGNMENT
assignment	augassignZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGcompoundfor while break continuetruth if while and or not BASICMETHODSZ	DEBUGGINGdebuggerpdbZCONTEXTMANAGERScontext-managersNcCs||_||_dS)N)_input_output)r>inputrrrrrk,s	zHelper.__init__cCs|jptjS)N)rtrr~)r>rrrr#0szHelper.<lambda>cCs|jptjS)N)rurr)r>rrrr#1scCs?tjdddkr%|dSd|jj|jjfS)Nrr0?rz<%s.%s instance>)rstackrr&rY)r>rrr__repr__3s
zHelper.__repr__cCsG||jk	r|j|n$|j|j|jjddS)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.
)_GoInteractiverintrointeractrr)r>requestrrr__call__;s

	zHelper.__call__cCs|jjdxy|jd}|s,PWnttfk
rHPYnXt|ddddj}|jd	krzP|dkr|jq|j	|qWdS)
Nrzhelp> r	rrrquitr)rr)
rrgetlinerEOFErrorr/rrr{r)r>r}rrrr|Hs
zHelper.interactcCsJ|jtjkrt|S|jj||jj|jjSdS)z.Read one line, using input() when appropriate.N)rvrr~rrrrs)r>ZpromptrrrrWs


zHelper.getlinecCst|tdkro|j}|dkr=|jq|dkrV|jq|dkro|jq|dkr|jq|dddkr|j|jdq||jkr|j|q|dkrt	t
|dq||jkr|j|q||j
kr7|j|q|rVt	|dd
|jqt	tdd
|jn/t|tr|nt	|dd
|j|jjddS)Nrkeywordssymbolstopicsrzmodules rrrrzHelp on %s:rr)rrr)rrlistkeywordslistsymbols
listtopicslistmodulesrr
showsymbolr"evalr	showtopicrrur'rrrr)r>r}rrrr`s6




zHelper.helpcCs2|jjdttjddgddS)Na
Welcome to Python %s's help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/%s/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".
r0r)rrr{rr2)r>rrrr{us	zHelper.introrpPc		Cstt|}||}t||d|}xt|D]}xt|D]t}|||}|t|krT|jj||||dkrT|jjdd|dt||qTW|jjdqAWdS)Nrrr)rsortedr rrr)	r>itemscolumnsrZcolwrrowrrrrrrs
.zHelper.listcCs*|jjd|j|jjdS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rrrrrD)r>rrrrs	zHelper.listkeywordscCs*|jjd|j|jjdS)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rrrrrD)r>rrrrs	zHelper.listsymbolscCs*|jjd|j|jjdS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rrrrrD)r>rrrrs	zHelper.listtopicscCsyddl}Wn&tk
r8|jjddSYnX|jj||jj|}|s~|jjdt|dSt|tdkr|j	||S|\}}y|jj|}Wn0t
k
r|jjdt|dSYnXt|jd|r'|pdd|}|rddl
}ddj|jd}	|j|	d	}
|jjd
dj|
dS)Nrzt
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrrzRelated help topics: z, Hz
%s
)pydoc_data.topicsrrrrrzrrrrKeyErrorrurtextwrapr!rZwrap)r>topic
more_xrefs
pydoc_datatargetlabelxrefsr"rr.Zwrapped_textrrrrs4
		!
	zHelper.showtopiccCsyddl}Wntk
r(dSYnX|jj||jj|}|s\tdt|tr{|j||S|\}}|jj|}|r|pdd|}||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.
        rNt
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
rzcould not find topicr)rr)	rrrrzrrXrr'	_gettopic)r>rrrrrrr"rrrrs	
	!zHelper._gettopiccCs9|j|}|jd\}}}|j||dS)Nr)r	partitionr)r>symbolrrr]rrrrrs
zHelper.showsymbolcs|r,|jjdj|t|np|jjdi}|ddfdd}tjd||j|j|jjddS)	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...

cSsS|r0|dddkr0|ddd}|jddkrOd||<dS)	N	z	.__init__z
 (package)rrrii)find)rr'rprrrrcallbacksz$Helper.listmodules.<locals>.callbackcsd|ddS)Nr)r')rrronerrorsz#Helper.listmodules.<locals>.onerrorrz
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
)rrrapropos
ModuleScannerrunrrD)r>rGrrr)rrrs	
		zHelper.listmodules)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rrl)rr)rr)rr)rrl)rr)rr)rr)rr)rrrrrr	rr)rrHrrrrrrrrrrrrrrrrrr)rrrrrrr)rHr)rrrrrrrrrrrr	)rrrrrr)r
r)rr)rr)rr)rr)rr)rr)rr )r!r")r#r$)r%r&)r'r()r)r*)r+r,)r-r.)r/r)r0r1)r2r)rr3)r4r)r6r7)r8r)r9r:)r;r<)r=r>)r?r@)rArB)rArC)rErF)rGrH)rIrJ)rKr)rrL)rMr)rNrO)rPr)rQr)rRrS)rTrU)rVrW)rXrY)rZr[)rr\)r]r^)r_r)r`r)rar5)rbr5)rcr5)rdr5)rer5)rfr5)rgrh)rirj)rkr)rlrD)rmrn)rorp)rqrr)rsr) r%r&rYrZ_symbols_inverserrrZsymbols_rrzrrkrrvrryrrzr~r|rrr{rrrrrrrrrrrrrs4
	
	
rc@s+eZdZdZdddddZdS)rz7An interruptible scanner that searches module synopses.NcCs|r|j}d|_i}xtjD]}|dkr+d||<|dkrf|d|dq+t|jpxd}|jdd}|d|}|jj|dkr+|d||q+Wxtj	d|D]\}	}}
|jrP|dkr|d|dqytj
|	|}Wntk
rCwYnX|j}t
|d	ry|j|}
Wn%tk
r|r||wYnXttj|
pd}t
|d
r|j|}qNd}nrytjj|}Wn%tk
r|r||wYnX|jr6|jjdnd}t|dd}|d|}|jj|dkr||||qW|r|dS)NF__main__rrrrz - r
get_sourceget_filenamerT)rrrrrrSrrr*r	_get_specrrwrarr<rvrStringIOrr|rrrrr<)r>rrGZ	completerrseenr'r(rpr5r6rrwsourcerrrrrr	s`	
"	
	

	

"zModuleScanner.run)r%r&rYrSrrrrrrsrcCsVdd}dd}tj+tjdtj||d|WdQRXdS)zAPrint all the one-line module summaries that contain a substring.cSsE|dddkr*|ddd}t||o=d|dS)Nrz	.__init__z
 (package)z- ii)r)rr'rprrrrEszapropos.<locals>.callbackcSsdS)Nr)r'rrrrIszapropos.<locals>.onerrorignorerN)warningscatch_warningsfilterwarningsrr)rGrrrrrrCs


rcsddlddlddlddlGdddjjGfdddjjGfdddj}|||}|jx%|j	r|j
rtjd	qW|S)
a7Start 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.time()
        >>> timeout = 1                    #seconds

        This is a short timeout for testing purposes.

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

        Print any errors that may have occurred.

        >>> print(serverthread.error)
        None
   rNc@s(eZdZddZddZdS)z!_start_server.<locals>.DocHandlercSsx|jjdrd}nd}|jd|jdd||j|jj|j|j|jddS)	zProcess a request from an HTML browser.

            The URL received is in self.path.
            Get an HTML page from self.urlhandler and send it.
            z.cssztext/cssz	text/htmlzContent-Typez%s; charset=UTF-8zutf-8N)	rr`Z
send_responseZsend_headerZend_headersZwfiler
urlhandlerr)r>content_typerrrdo_GETs	

z(_start_server.<locals>.DocHandler.do_GETcWsdS)Nr)r>rrrrlog_messagesz-_start_server.<locals>.DocHandler.log_messageN)r%r&rYrrrrrr
DocHandlersrcs:eZdZddZfddZddZdS)z _start_server.<locals>.DocServercSsMd|_|j|f|_||_|jj||j|jd|_dS)NZ	localhostF)hostZaddressrrIrkhandlerr)r>portrrrrrks
		z)_start_server.<locals>.DocServer.__init__cs[xJ|jsLj|jjgggd\}}}|r|jqW|jdS)Nr)rselectZsocketrZhandle_requestZserver_close)r>ZrdwrZex)rrrserve_until_quits
-z1_start_server.<locals>.DocServer.serve_until_quitcSs*|jj||jr&|j|dS)N)rIserver_activater)r>rrrrs	z0_start_server.<locals>.DocServer.server_activateN)r%r&rYrkrrr)rrr	DocServersrcsUeZdZfddZfddZddZddZd	S)
z#_start_server.<locals>.ServerThreadcs>||_t||_jj|d|_d|_dS)NF)rrrThreadrkservingerror)r>rr)	threadingrrrks
		z,_start_server.<locals>.ServerThread.__init__csyejj__jj_t|j_|j	|j
}||_|jWn.t
k
r}z||_WYdd}~XnXdS)zStart the server.N)server
HTTPServerrIrrZMessageZMessageClassstaticmethodrrready	docserverrr<r)r>Zdocsvre)rremailhttprrrs		z'_start_server.<locals>.ServerThread.runcSs>d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)rrZserver_portrr)r>rrrrrs	z)_start_server.<locals>.ServerThread.readycSs"d|j_d|_d|_dS)z&Stop the server and this thread nicelyTFN)rrrr)r>rrrstops	z(_start_server.<locals>.ServerThread.stopN)r%r&rYrkrrrr)rrrrrrrServerThreads
rg{Gz?)
Zhttp.serverZ
email.messagerrrZBaseHTTPRequestHandlerrrrrrtimeZsleep)rrrZthreadr)rrrrrrr
_start_serverQs8"+"
rz	text/htmlcsGfdddt}|fddfddfddfd	d
fddfd
dfddfddfdd}|jdr|dd}|dkrftjjtjjt}tjj||}t|}dj|j	SWdQRXn|dkr|||St
d||fdS)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.
    cs"eZdZfddZdS)z_url_handler.<locals>._HTMLDoccs'd}d|}d|||fS)zFormat an HTML page.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>rrcss_pathZcss_link)html_navbarrrrsz#_url_handler.<locals>._HTMLDoc.pageN)r%r&rYrr)rrr_HTMLDocsrcsUjdtjtjdtjf}d|jtjddfS)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>
            ZterseT)rrZpython_versionZpython_buildZpython_compiler)r2)rrrrs
z!_url_handler.<locals>.html_navbarcsdd}jddd}ddtjD}j||}|djd	dd
|g}i}x*tjD]}|jj||q{W|jddd
j|fS)zModule Index page.cSsd||fS)Nz<a href="%s.html">%s</a>r)r(rrr	bltinlink	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>z#ffffffz#7799eecSs"g|]}|dkr|qS)rr)rr(rrrr#	s	z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in Modulesz#ee77aaz|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</font>zIndex of Modulesr)	rrrrrrr
rbr!)rrnamesrrr)rrr
html_index	sz _url_handler.<locals>.html_indexc	sgfdd}tj7tjddd}tj||d|WdQRXdd	}g}jd
dd}x+D]#\}}|j|||qW|jd
|dddj|}d|fS)zSearch results page.csK|dddkr*|ddd}j||o@d|fdS)Nrz	.__init__z
 (package)z- ii)r
)rr'rp)
search_resultrrr8	sz3_url_handler.<locals>.html_search.<locals>.callbackrcSsdS)Nr)r'rrrr?	sz2_url_handler.<locals>.html_search.<locals>.onerrorrNcSsd||fS)Nz<a href="%s.html">%s</a>r)r(rrrrD	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>z#ffffffz#7799eezkey = %sz#ee77aaz<br>zSearch Results)	rrrrrrr
rr!)	rGrrrrfrr(rpr)r)rrhtml_search3	s 

 	 z!_url_handler.<locals>.html_searchcsndd}jddd}ttjj}j||}|jddd|}d|fS)zIndex of topic texts available.cSsd||fS)Nz<a href="topic?key=%s">%s</a>r)r(rrrrT	sz4_url_handler.<locals>.html_topics.<locals>.bltinlinkz,<big><big><strong>INDEX</strong></big></big>z#ffffffz#7799eeZTopicsz#ee77aa)rrrrrDrr)rrrr)rrrhtml_topicsQ	s	z!_url_handler.<locals>.html_topicscsnjddd}ttjj}dd}j||}|jddd|}d|fS)zIndex of keywords.z,<big><big><strong>INDEX</strong></big></big>z#ffffffz#7799eecSsd||fS)Nz<a href="topic?key=%s">%s</a>r)r(rrrrh	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsz#ee77aa)rrrrrDrr)rrrr)rrr
html_keywordsa	s	z#_url_handler.<locals>.html_keywordscstj}t||}|j|\}}||jkrHd}nd}jd|dd}dj|}j|dd|}|rt|j	}dd	}j
||}jd
dd|}d||fdj|||ffS)
zTopic or keyword help page.ZKEYWORDZTOPICz)<big><big><strong>%s</strong></big></big>z#ffffffz#7799eez
<pre>%s</pre>z#ee77aacSsd||fS)Nz<a href="topic?key=%s">%s</a>r)r(rrrr	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkzRelated help topics: z%s %sr)
rrrrrrrrrrrrr!)rZbufZhtmlhelprrrrr)rrrhtml_topicpagep	s&		
z$_url_handler.<locals>.html_topicpagecs^t|dd}|dkr6|dkr6tdt|}j||}||fS)Nrrrzcould not find object)rrXrr)rr9rcontent)rrrhtml_getobj	sz!_url_handler.<locals>.html_getobjcspjddd}djfddtt||D}|j|dd|}d||fS)	Nz,<big><big><strong>Error</strong></big></big>z#ffffffz#7799eez<br>c3s|]}j|VqdS)N)r)rru)rrrr`	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rr!rrr)rrrr)rrr
html_error	s
z _url_handler.<locals>.html_errorcs|}|jdr%|dd
}yz|dkrF\}}nX|dkrd\}}n:|dkr\}}nd|kr|jd\}}}|d	kr|\}}q|d
kry|\}}Wqtk
r|\}}YqXq|dkr}|dkr=\}}qy|\}}Wqtk
ry|\}}YqXqtdn|\}}Wn:tk
r}z||\}}WYdd}~XnXj||S)zGenerate an HTML page for url.z.htmlNrrbrrrTz
search?keyz	topic?keyzget?keyz
bad pydoc url)rrb)rrb)r`rrXr<r)rZcomplete_urlrropr]r)rrrrrrrrrr
get_html_page	s>

(z#_url_handler.<locals>.get_html_pagerrNztext/cssrz	text/htmlz"unknown content type %r for url %s)rr_r	rdirnamerealpathrTr!r	readlinesr)rrrrZ	path_hererfpr)	rrrrrrrrrr_url_handlers*		
'(
ropen_browserTcCs$ddl}tt|}|jr5t|jdS|jr d}|rZ|j|jzytd|jt|x^|jrtd}|j	}|dkrPq}|dkr|j|jq}t|q}WWnt
tfk
rtYnXWd|jr|jtdXdS)	zStart 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> rrzServer stopped)
webbrowserrrrrrrrrvrrrr)rrrZserverthreadZserver_help_msgrrrrbrowse	s2	
	
	
rcCs%t|to$|jtjdkS)Nr)rr'rr	sep)rLrrrispath	srcCsddl}Gdddt}dtjkr|tjjtjd}|tjkritjj|tjjddy|jtjddd\}}d	}d	}d	}d}xp|D]h\}	}
|	d
krd}d}|	dkrt	|
dS|	d
krd}|
}|	dkrd}qW|r[|dkrGd}t
|d|dS|sg|x|D]}t|rtjj|rt
d|Pyyt|rtjj|rt|}|r
t|rtjj|rt|qt|n
tj|Wqntk
rL}zt
|WYdd}~XqnXqnWWnc|j|fk
rtjjtjjtjdd}
t
djd|
dtjYnXdS)z@Command-line interface (looks at sys.argv to decide what to do).rNc@seZdZdS)zcli.<locals>.BadUsageN)r%r&rYrrrrBadUsage	srrrrzbk:p:wFz-bTz-kz-pz-wrzfile %r does not existapydoc - 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} -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.  The -p option can be used with
    the -b option to explicitly specify the server port.

{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.
rr)getoptr<rrr	rargvremoveinsertrrrexistsrrlrrrrrrrrrrr)rrZ	scriptdirZoptsrZwritingZstart_serverrrZoptvalargrHrrrrcli	sd%




%)rr)WrSr$rNrRrQrMZimportlib._bootstrapr|importlib._bootstrap_externalimportlib.machineryimportlib.utilrrr	r*rrrrrZurllib.parser%rcollectionsrreprlibr	tracebackrrrr$r)r-r/r3r
IGNORECASEr4r5r:r?rCrMrcrdrnrvrr<rrrrrrrdrersrurtryr|rxrrrrrr.rrrrr"rrrrrrrrrrrr%rrrr<module>(s			

'
0?*- d#,			
	=%V