403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/sphinx/ext/autodoc/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/ext/autodoc/__pycache__/__init__.cpython-39.pyc
a

�ab*��@s�dZddlZddlZddlmZmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZddlZddlmZddlmZmZdd	lmZm Z dd
l!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)m*Z*m+Z+dd
l,m-Z-m.Z.ddl/m0Z0m1Z1ddl2mZm3Z3ddl4m5Z5m6Z6ddl7m8Z8m9Z9m:Z:m;Z;m<Z<ddl=m>Z>m?Z?m@Z@ddl=mAZBe	�rrddlCmDZDe3�EeF�ZGeHeHjI�ZJe�KdejL�ZMe�Kd�ZNe
e
d�dd�ZOGdd�d�ZPGdd�d�ZQeP�ZReQ�ZSeT�ZUeT�ZVeT�ZWe
eeTeeXfd�dd �ZYe
eeTeeXfd�d!d"�ZZe
eeTeeXfd�d#d$�Z[e
eeTeeXfd�d%d&�Z\e
eeXd�d'd(�Z]e
eeXd�d)d*�Z^eT�Z_e
e
d�d+d,�Z`e
ead�d-d.�Zbedd/�d0d1�Zcedd/�d2d3�Zdd�eeeeeXed4�d5d6�Zfd�eXeeXeaeaed8�d9d:�ZgGd;d<�d<eh�ZiGd=d>�d>ej�ZkeeekeeeXe
ffZlGd?d@�d@�ZmGdAdB�dBem�ZnGdCdD�dDem�ZoGdEdF�dFem�ZpGdGdH�dH�ZqGdIdJ�dJeq�ZrGdKdL�dLeqeo�ZsGdMdN�dNes�ZtdOgZudPgZvGdQdR�dReqeo�ZwGdSdT�dTew�ZxGdUdV�dV�ZyGdWdX�dXey�ZzGdYdZ�dZey�Z{Gd[d\�d\ey�Z|Gd]d^�d^ey�Z}Gd_d`�d`eze{e|e}eo�Z~Gdadb�dbe~�ZGdcdd�ddeqep�Z�Gdedf�dfey�Z�Gdgdh�dhey�Z�Gdidj�djey�Z�Gdkdl�dley�Z�Gdmdn�dneze{e�e|e�e�e�erep�Z�Gdodp�dperep�Z�Gdqdr�dre��Z�eeeXeemfds�dtdu�Z�ee
eXe
e
dv�dwdx�Z�eeddy�dzd{�Z�dd|l�m�Z�dd}l�m�Z�dd~l�m�Z�ddl�m�Z�dd�l�m�Z�dd�l�m�Z�dd�l�m�Z�eeeXe
fds�d�d��Z�dS)�ap
    sphinx.ext.autodoc
    ~~~~~~~~~~~~~~~~~~

    Automatically insert docstrings for functions, classes or whole modules into
    the doctree, thus avoiding duplication between docstrings and documentation
    for those who like elaborate docstrings.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�	Parameter�	Signature)�
ModuleType)
�
TYPE_CHECKING�Any�Callable�Dict�Iterator�List�Optional�Sequence�Set�Tuple�Type�TypeVar�Union)�
StringList)�Sphinx)�ENUM�Config)�RemovedInSphinx50Warning�RemovedInSphinx60Warning)�BuildEnvironment)�get_class_members�get_object_members�
import_module�
import_object)�ismock�mock�
undecorate)�_�__)�ModuleAnalyzer�PycodeError)�inspect�logging)�prepare_docstring�separate_metadata)�evaluate_signature�getdoc�object_description�safe_getattr�stringify_signature)�
OptionSpec�get_type_hints�restify)�	stringify)�DocumenterBridgeaQ^ ([\w.]+::)?            # explicit module name
          ([\w.]+\.)?            # module and/or class name(s)
          (\w+)  \s*             # thing name
          (?: \((.*)\)           # optional: arguments
           (?:\s* -> \s* (.*))?  #           return annotation
          )? $                   # and nothing more
          z	^__\S+__$)�x�returncCs|S�N�)r2r5r5�?/usr/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py�identity?sr7c@s0eZdZdZeed�dd�Zedd�dd�ZdS)�_Allz;A special value for :*-members: that matches to any member.��itemr3cCsdS�NTr5��selfr:r5r5r6�__contains__Fsz_All.__contains__NcCsdSr4r5r<r5r5r6�appendIsz_All.append)�__name__�
__module__�__qualname__�__doc__r�boolr>r?r5r5r5r6r8Csr8c@s eZdZdZeed�dd�ZdS)�_EmptyzGA special value for :exclude-members: that never matches to any member.r9cCsdS�NFr5r<r5r5r6r>Psz_Empty.__contains__N)r@rArBrCrrDr>r5r5r5r6rEMsrE)�argr3cCs0|dvrtS|durdSdd�|�d�D�SdS)�8Used to convert the :members: option to auto directives.r;FNcSsg|]}|��r|���qSr5��strip��.0r2r5r5r6�
<listcomp>b�z"members_option.<locals>.<listcomp>�,)�ALL�split�rGr5r5r6�members_option[s
rScCs0tjdtdd�|durtSdd�|�d�D�S)rHz#members_set_option() is deprecated.���
stacklevelNcSsh|]}|��r|���qSr5rIrKr5r5r6�	<setcomp>krNz%members_set_option.<locals>.<setcomp>rO)�warnings�warnrrPrQrRr5r5r6�members_set_optiones�rZcCs |dvrtSdd�|�d�D�S)z-Used to convert the :exclude-members: option.r;cSsh|]}|��r|���qSr5rIrKr5r5r6rWrrNz)exclude_members_option.<locals>.<setcomp>rO)�EMPTYrQrRr5r5r6�exclude_members_optionnsr\cCs|dvrdS|SdS)rHr;�objectNr5rRr5r5r6�inherited_members_optionusr^cCs,|dvrdS|dvr|Sttd�|��dS)rHr;N)�alphabetical�bysource�	groupwisez)invalid value for member-order option: %s��
ValueErrorr!rRr5r5r6�member_order_option}s
rdcCs |dvr|Sttd�|��dS)zDUsed to convert the :class-doc-from: option to autoclass directives.)�both�class�initz+invalid value for class-doc-from option: %sNrbrRr5r5r6�class_doc_from_option�srhcCs|dvrtS|SdS)Nr;)�SUPPRESSrRr5r5r6�annotation_option�srjcCsdS)znUsed to convert flag options to auto directives.  (Instead of
    directives.flag(), which returns None).
    Tr5rRr5r5r6�bool_option�srk)�optionsr3cCsxtjdtdd�d|vrt|dturt|�d�tur4n@|�d�rh|dD]}||dvrF|d�|�qFn|d|d<dS)z3Merge :special-members: option to :members: option.z-merge_special_members_option() is deprecated.rTrU�special-members�membersN)rXrYrrP�getr?)rl�memberr5r5r6�merge_special_members_option�s�
rqcCsd|�d�turdS|�dg�}dD]<}||vr"||tdfvr"||D]}||vrF|�|�qFq"dS)z1Merge :*-members: option to the :members: option.rnN>�private-membersrm)rorP�
setdefaultr?)rlrn�keyrpr5r5r6�merge_members_option�sru)�pre�post�whatr3cs*tttttttdd����fdd�}|S)a�Return a listener that removes the first *pre* and last *post*
    lines of every docstring.  If *what* is a sequence of strings,
    only docstrings of a type in *what* will be processed.

    Use like this (e.g. in the ``setup()`` function of :file:`conf.py`)::

       from sphinx.ext.autodoc import cut_lines
       app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))

    This can (and should) be used in place of :confval:`automodule_skip_lines`.
    N��app�what_�name�objrl�linesr3csZ�r|�vrdS|d��=�r@|r4|ds4|�d�|�d�=|rV|drV|�d�dS)N����)�popr?)rzr{r|r}rlr~�rwrvrxr5r6�process�s

zcut_lines.<locals>.process)r�strrr
)rvrwrxr�r5r�r6�	cut_lines�s�
r�F)�markerrx�	keepempty�excluder3cs6t�|��tttttttdd�����fdd�}|S)anReturn a listener that either keeps, or if *exclude* is True excludes,
    lines between lines that match the *marker* regular expression.  If no line
    matches, the resulting docstring would be empty, so no change will be made
    unless *keepempty* is true.

    If *what* is a sequence of strings, only docstrings of a type in *what* will
    be processed.
    Nrycs��r|�vrdSd}�}|dd�}t|�D]L\}	}
|rP|�|	|�|d7}��|
�r.|}|r.|�|	|�|d7}q.|s��s�||dd�<|r�|dr�|�d�dS)Nr�rr�)�	enumerater��matchr?)rzr{r|r}rlr~Zdeleted�deleteZ
orig_lines�i�line�r�r�Z	marker_rerxr5r6r��s$

zbetween.<locals>.process)�re�compilerr�rr
)r�rxr�r�r�r5r�r6�between�s


�r�cs6eZdZdZdd��fdd�Zeed�dd�Z�ZS)�Optionsz>A dict/attribute hybrid that returns None on nonexisting keys.�r3cstt����Sr4)r��super�copy�r=��	__class__r5r6r�szOptions.copy)r|r3cCs,z||�dd�WSty&YdS0dS)Nr �-)�replace�KeyError)r=r|r5r5r6�__getattr__szOptions.__getattr__)	r@rArBrCr�r�rr��
__classcell__r5r5r�r6r�sr�csJeZdZdZeeeed��fdd�Zd
eeeeeedd�dd	�Z	�Z
S)�ObjectMembera}A member of object.

    This is used for the result of `Documenter.get_object_members()` to
    represent each member of the object.

    .. Note::

       An instance of this class behaves as a tuple of (name, object)
       for compatibility to old Sphinx.  The behavior will be dropped
       in the future.  Therefore extensions should not use the tuple
       interface.
    )r|r}�kwargsr3cst��|||f�Sr4)r��__new__)�clsr|r}r�r�r5r6r�szObjectMember.__new__NF)r|r}�	docstring�class_�skippedr3cCs"||_||_||_||_||_dSr4)r@r]r�r�r�)r=r|r}r�r�r�r5r5r6�__init__s
zObjectMember.__init__)NNF)r@rArBrCr�rr�rrDr�r�r5r5r�r6r�s
��r�c@sHeZdZUdZdZdZdZdZdZde	iZ
eed<e
ee
e
d�d	d
�Zee
eee
ed�dd
��ZdLdeedd�dd�Zeeeedfd�dd��Zeeedd�dd�Zee
ee
eeeefd�dd�Zed�dd�ZdMeed�d d!�Zed�d"d#�Zed�d$d%�Z e
ed&�d'd(�Z!ed�d)d*�Z"e
ed&�d+d,�Z#e
ed&�d-d.�Z$edd/�d0d1�Z%dNee&eeed2�d3d4�Z'eeee(ed5�d6d7�Z)ed�d8d9�Z*dOe&e+edd:�d;d<�Z,eeee-fd=�d>d?�Z.e-eeeee
efd@�dAdB�Z/dPeddC�dDdE�Z0eedefeeedefdF�dGdH�Z1dQe&e+eeeddI�dJdK�Z2dS)R�
Documenterae
    A Documenter knows how to autodocument a single object type.  When
    registered with the AutoDirective, it will be used to document objects
    of that type when needed by autodoc.

    Its *objtype* attribute selects what auto directive it is assigned to
    (the directive name is 'auto' + objtype), and what directive it generates
    by default, though that can be overridden by an attribute called
    *directivetype*.

    A Documenter has an *option_spec* that works like a docutils directive's;
    in fact, it will be used to parse an auto directive's options that matches
    the Documenter.
    r]�   rF�noindex�option_spec)r}r|�defargsr3cGst|jj||g|�R�S)z5getattr() override for types such as Zope interfaces.)�autodoc_attrgetter�envrz)r=r}r|r�r5r5r6�get_attrJszDocumenter.get_attr�rp�
membername�isattr�parentr3cCstd��dS)z?Called to see if a member can be documented by this Documenter.�!must be implemented in subclassesN��NotImplementedError�r�rpr�r�r�r5r5r6�can_document_memberNszDocumenter.can_document_memberr�r1N)�	directiver|�indentr3cCsl||_|jj|_|j|_|j|_||_||_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_dSr4)r�r��configZgenoptrlr|r��modname�module�objpath�fullname�args�retannr]�object_namer��analyzer)r=r�r|r�r5r5r6r�Ts 
zDocumenter.__init__r�cCs|jjjjS)�%Returns registered Documenter classes)r�rz�registry�documentersr�r5r5r6r�mszDocumenter.documenters)r��source�linenor3cGsD|��r(|jjj|j||g|�R�n|jjjd|g|�R�dS)z0Append one line of generated reST to the output.r�N)rJr��resultr?r�)r=r�r�r�r5r5r6�add_liners zDocumenter.add_line�r��parents�path�baser3cCstd��dS)a@Resolve the module and name of the object to document given by the
        arguments and the current module/class.

        Must return a pair of the module name and a chain of attributes; for
        example, it would return ``('zipfile', ['ZipFile', 'open'])`` for the
        ``zipfile.ZipFile.open`` method.
        r�Nr��r=r�r�r�r�r5r5r6�resolve_nameys	zDocumenter.resolve_namec	Csz"t�|j�}|��\}}}}}Wn2tyTtjtd�|j|jfdd�YdS0|dur�|dd�}|r~|�	d��
d�ng}nd}g}t|jj
��(|�||||�\|_|_Wd�n1s�0Y|js�dS||_||_|jp�d|j�rdd�|j�nd|_d	S)
z�Determine what module to import and what attribute to document.

        Returns True and sets *self.modname*, *self.objpath*, *self.fullname*,
        *self.args* and *self.retann* if parsing and resolving was successful.
        z!invalid signature for auto%s (%r)�autodoc��typeFN����.r�T)�
py_ext_sig_rer�r|�groups�AttributeError�logger�warningr!�objtype�rstriprQrr��autodoc_mock_importsr�r�r�r�r��joinr�)	r=�matchedZexplicit_modnamer�r�r�r�r�r�r5r5r6�
parse_name�s.	�6�zDocumenter.parse_name��
raiseerrorr3cCs�t|jj���zZt|j|j|j|j|jjd�}|\|_	|_
|_|_t
|j�rXt|j�|_WWd�dSty�}zN|r��n:tj|jdddd�|j��WYd}~Wd�dSWYd}~n
d}~00Wd�n1s�0YdS)	z�Import the object given by *self.modname* and *self.objpath* and set
        it as *self.object*.

        Returns True if successful, False if an error occurred.
        ��
attrgetterZwarningiserrorNTrr�r�r�ZsubtypeF)rr�r�rr�r�r�r��autodoc_warningiserrorr�r�r�r]rr�ImportErrorr�r�r�r��note_reread�r=r��ret�excr5r5r6r�s �

zDocumenter.import_objectcCs|�|jdd�p|jS)z�Get the real module name of an object to document.

        It can differ from the name of the module through which the object was
        imported.
        rAN)r�r]r�r�r5r5r6�get_real_modname�szDocumenter.get_real_modnamecCs<|jjrdSt�|j�}|�|dd�}|r8||jkr8dSdS)z`Check if *self.object* is really defined in the module given by
        *self.modname*.
        TrANF)rlZimported_membersr$Z	unpartialr]r�r�)r=Zsubjectr�r5r5r6�check_module�szDocumenter.check_module�r�r3cKsdS)z}Format the argument signature of *self.object*.

        Should return None if the object does not have a signature.
        Nr5�r=r�r5r5r6�format_args�szDocumenter.format_argscCsd�|j�p|jS)z�Format the name of *self.object*.

        This normally should be something that can be parsed by the generated
        directive, but doesn't need to be (Sphinx will display it unparsed
        then).
        r�)r�r�r�r�r5r5r6�format_name�s	zDocumenter.format_namecKs2|r*z|jfi|��WSty(Yn0|��Sr4)r��	TypeErrorr�r5r5r6�_call_format_args�szDocumenter._call_format_argsc
Ks�|jdurd|j}|j}n�z@d}|jfi|��}|rZt�d|�}|rZ|�d�}|�d�}Wn@ty�}z(tjt	d�|j
|dd�d}WYd}~n
d}~00|jj�
d	|j|j
|j|j||�}|r�|\}}|dur�||r�d
|ndSdSdS)z�Format the signature (arguments and return annotation) of the object.

        Let the user process it via the ``autodoc-process-signature`` event.
        Nz(%s)z^(\(.*\))\s+->\s+(.*)$r�rTz+error while formatting arguments for %s: %sr�r��autodoc-process-signaturez -> %sr�)r�r�r�r�r��group�	Exceptionr�r�r!r�r��events�emit_firstresultr�r]rl)r=r�r�r�r�r�r�r5r5r6�format_signature�s2



�
�zDocumenter.format_signature��sigr3c	Cs�t|dd�}t|d|j�}|��}|��}d||f}t|�d��D]2\}}|�d|||f|�|dkrDdt|�}qD|jj	r�|�d	|�|j
r�|�d
|j|�dS)z>Add the directive header and options to the generated content.�domain�py�
directivetypez.. %s:%s:: �
z%s%s%sr� z   :noindex:z   :module: %sN)�getattrr�r��get_sourcenamer�rQr��lenrlr�r�r�)	r=r�r�r�r|�
sourcename�prefixr�Zsig_liner5r5r6�add_directive_headers�zDocumenter.add_directive_header��ignorer3cCs`|dur tjd|jjtdd�t|j|j|jj	|j
|j�}|r\|jj
jjj}t|||�gSgS)z�Decode and return lines of the docstring(s) for the object.

        When it returns None, autodoc-process-docstring will not be called for this
        object.
        N�<The 'ignore' argument to autodoc.%s.get_doc() is deprecated.rTrU)rXrYr�r@rr)r]r�r��autodoc_inherit_docstringsr�r�r��state�document�settings�	tab_widthr&�r=rr�r
r5r5r6�get_doc+s���zDocumenter.get_doc)�
docstringsr3c	csZ|D]P}|jjrJ|jj�d|j|j|j|j|�|rJ|ddkrJ|�d�|EdHqdS)z7Let the user process the docstrings before adding them.�autodoc-process-docstringrr�N)r�rz�emitr�r�r]rlr?)r=rZdocstringlinesr5r5r6�process_doc<s
�
zDocumenter.process_doccCs^t�|jdd�r6t�|jdd�r6d|jj|jjf}n|j}|jrRd|jj|fSd|SdS)NrArBz%s.%sz%s:docstring of %szdocstring of %s)r$r+r]rArBr�r��srcname)r=r�r5r5r6rKs�zDocumenter.get_sourcename��more_content�no_docstringr3c
Cs|rtjd|jjtdd�|��}|jr�|j��}|jr�d�	|jdd��|jdf}||vr�d}t
||�g}t|�|��D]\}}|�
|||�q�|s�|��}|dur�n4|s�|�g�t|�|��D]\}}|�
|||�q�|�rt|j|j�D]\}}	|�
||	d|	d	�q�dS)
z>Add content from docstrings, attribute documentation and user.z>The 'no_docstring' argument to %s.add_content() is deprecated.rTrUr�NrTrr�)rXrYr�r@rrr��find_attr_docsr�r��listr�rr�rr?�zip�data�items)
r=rrr�	attr_docsrtrr�r��srcr5r5r6�add_contentYs6��

zDocumenter.add_content��want_allr3cCs�t�dt�t|j|j|j|j�}|s�|jj	s6dgfSg}|jj	D]>}||vrd|�
|||jf�qBtj
td�||jfdd�qBd|fS|jjr�ddd�|��D�fSddd�|��D�fSd	S)
a+Return `(members_check_module, members)` where `members` is a
        list of `(membername, member)` pairs of the members of *self.object*.

        If *want_all* is True, return all members.  Else, only return those
        members given by *self.options.members* (which may also be None).
        zVThe implementation of Documenter.get_object_members() will be removed from Sphinx-6.0.F�!missing attribute %s in object %sr�r�cSsg|]}|j|jf�qSr5)r|�value�rL�mr5r5r6rM�rNz1Documenter.get_object_members.<locals>.<listcomp>cSsg|]}|jr|j|jf�qSr5)Zdirectly_definedr|r#r$r5r5r6rM�s�N)rXrYrrr]r�r�r�rlrnr?r#r�r�r!r��inherited_members�values�r=r!rnZselectedr|r5r5r6r�s(�
��zDocumenter.get_object_members)rnr!r3cs8tttd��fdd�}g}d��j�}�jr8�j��}ni}|D�]�}�z�|\}}	|	tur`d}
n||f|vrrd}
nd}
t|	�j	�j
j�j|�}t
|t�s�d}��	|	dd�}|rȈ�	|d	d�}
|
|kr�d}t
|t�r�|jr�|j}t|�\}}t|�}d
|v�rd}nd|v�rd}n
|�d�}d}t|	��r<||f|v�r<�nH�jj�r\|�jjv�r\d}�n(|�r�t�|��r��jj�r�|�jjv�r�|d	k�r�d}n |||��r�d}n|�p��jj}nd}n�||f|v�r|�r�|�r��jjdu�r�d}n|�jjv}nd}n�|�rV|�rV|�s�jj�rP�jjdu�r0d}n|||��rBd}n|�jjv}nd}n.�jjtu�rv|||��rvd}n|�p��jj}t
|t��r�|j�r�d}�jj�rԈjj�d
�j ||	|�j�}|du�r�|}WnFt!�y}z,t"j#t$d��j%||	|dd�d}WYd}~n
d}~00|r@|�&||	|
f�q@|S)a�Filter the given member list.

        Members are skipped if

        - they are private (except if given explicitly or the private-members
          option is set)
        - they are special methods (except if given explicitly or the
          special-members option is set)
        - they are undocumented (except if the undoc-members option is set)

        The user can override the skipping decision by connecting to the
        ``autodoc-skip-member`` event.
        )r|r}r3cs~t��j�rz�jjD]d}|j�jjkr6|�jkr6dS||jvrFdS|��|di�vr^dSt	|t
�r|j|urdSqdS)NTF�__annotations__)r$Zisclassr]�__mro__r@rlr&�__dict__r��
isinstancer�r�)r|r}r�r�r5r6�is_filtered_inherited_member�s
z?Documenter.filter_members.<locals>.is_filtered_inherited_memberr�TFNr�rCZprivateZpublicr �autodoc-skip-memberz`autodoc: failed to determine %s.%s (%r) to be documented, the following exception was raised:
%sr�r�)'r�rrDr�r�r�r�INSTANCEATTRr)r�r�r	r]r,r�r�r'�
startswithrrlZexclude_members�special_member_rer��special_membersZ
undoc_membersZprivate_membersrnrPr�r�rzr�r�r�r�r�r!r|r?)r=rnr!r-r��	namespacerr}r�rpr��docr�Zcls_doc�metadataZhas_docZ	isprivateZkeepZ	skip_userr�r5r�r6�filter_members�s�
�





�

�
�

�


�zDocumenter.filter_members��all_membersr3c
s:�j�jjd<�jr&�jd�jjd<|p<�jjp<�jjtu}��|�\}}g}��	||�D]|\�������fdd��j
��D�}|s�q\|jdd�d��jd	d
�
�j�g�}|d�j|�j�}|�|�f�q\�jjp�jj}	��||	�}|D]"\}�|jd�j|�o�d
�q�d�jjd<d�jjd<dS)z�Generate reST for member documentation.

        If *all_members* is True, document all members, else those given by
        *self.options.members*.
        �autodoc:moduler�
autodoc:classcs g|]}|������r|�qSr5)r��rLr��r�rpZmnamer=r5r6rMMs�z/Documenter.document_members.<locals>.<listcomp>cSs|jSr4��priority)r�r5r5r6�<lambda>SrNz-Documenter.document_members.<locals>.<lambda>�rt�::r�rT)r8�real_modnamer�N)r�r��	temp_datar�rlr&rnrPrr6r�r'�sortr�r�r�r?�member_orderr��autodoc_member_order�sort_members�generaterB)
r=r8r!Zmembers_check_modulernZmemberdocumenters�classesZ
full_mname�
documenterrEr5r<r6�document_members9s6�
�
�zDocumenter.document_members�r��orderr3csp|dkr|jdd�d�nR|dkr\|jrl|jj�tttftd��fdd�}|j|d�qln|jd	d�d�|S)
zSort the given member list.racSs|dj|djfS�Nr)rEr|��er5r5r6r?krNz)Documenter.sort_members.<locals>.<lambda>r@r`��entryr3cs$|dj�d�d}��|t���S�NrrAr�)r|rQror)rRr���tagorderr5r6�keyfuncqsz(Documenter.sort_members.<locals>.keyfunccSs
|djSrN�r|rOr5r5r6r?{rN)rDr�rUrr�rD�int�r=r�rMrVr5rTr6rGfszDocumenter.sort_members�rrBr�r8r3c
Cs�|��s$tjtd�|jdd�dS|��s0dS|��}|p>||_zt�	|j�|_
|j
��Wn\ty�}zDt�
d|�d|_
t|jd�r�|jjr�|jj�|jj�WYd}~nd}~00|jj�|j
j�|j|k�rzt�	|�}|jj�|j�Wnt�yYn0t|���pgg�}t|j��rJ|�sJtjtd�|jdd�|�r^|���s^dS|��}	|�d|	�z|��}
Wn@t�y�}z&tjtd	�|j|dd�WYd}~dSd}~00|�|
�|�d|	�|j |j!7_ |�"|�|�#|�dS)
a�Generate reST for the object given by *self.name*, and possibly for
        its members.

        If *more_content* is given, include that content. If *real_modname* is
        given, use that module name to find attribute docs. If *check_module* is
        True, only generate if the object is defined in the module name it is
        imported from. If *all_members* is True, document all members.
        z�don't know which module to import for autodocumenting %r (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)r�r�Nz$[autodoc] module analyzer failed: %s�__file__zA mocked object is detected: %rr�z+error while formatting signature for %s: %s)$r�r�r�r!r|rr�rBr"�
for_moduler�rr#�debug�hasattrr�r[r�Zrecord_dependencies�addr�sumrrr]r�rr�r�r�r�rr��content_indentrrK)r=rrBr�r8Z
guess_modnamer�r�rrr�r5r5r6rHsb
��
(

�

�

zDocumenter.generate)r�)F)N)F)F)NNFF)3r@rArBrCr�rar>rE�titles_allowedrkr�r-r)rr�r��classmethodrDr�r��propertyrrr�rXr�rr
r�r�rr�r�r�r�r�r�rrrr	rrrr�
ObjectMembersrr6rKrGrHr5r5r5r6r�+sb
���%
#
�+�-��
�r�cs0eZdZUdZdZdZdZeeee	ee
e
eeeeeeed�Z
eed<edd��fd	d
�Zeeeeeed�dd
��Zeeeeeeeefd�dd�Zed��fdd�Zd$eed��fdd�
Zedd�dd�Zeeefd�dd�Zeeeefd�dd�Z eed efeeed efd!��fd"d#�Z!�Z"S)%�ModuleDocumenterz6
    Specialized Documenter subclass for modules.
    r�r�T)rn�
undoc-membersr��inherited-members�show-inheritance�synopsis�platform�
deprecated�member-order�exclude-membersrrrmzimported-memberszignore-module-allr�N�r�r3cs t�j|�t|j�d|_dSr4)r�r�rurl�__all__�r=r�r�r5r6r��s
zModuleDocumenter.__init__r�cCsdSrFr5r�r5r5r6r��sz$ModuleDocumenter.can_document_memberr�cCs*|durtjtd�dd�|p d|gfS)Nz*"::" in automodule name doesn't make senser�r�r�)r�r�r!r�r5r5r6r��s

�zModuleDocumenter.resolve_namer�cs2t���}|js|jr.tjtd�|jdd�|S)Nz@signature arguments or return annotation given for automodule %sr�r�)r�r�r�r�r�r�r!r�)r=r�r�r5r6r�s

��zModuleDocumenter.parse_nameFr�c
srt��|�}z|jjs$t�|j�|_WnFtyl}z.t	j
td�|jd|j
fdd�WYd}~n
d}~00|S)NzN__all__ should be a list of strings, not %r (in module %s) -- ignoring __all__rr�r�)r�rrlZignore_module_allr$Zgetallr]rprcr�r�r!r�r�r�r�r5r6r	s
��zModuleDocumenter.import_objectr�cCsdt�||�|��}|jjr0|�d|jj|�|jjrL|�d|jj|�|jjr`|�d|�dS)Nz   :synopsis: z   :platform: z   :deprecated:)r�rrrlrjr�rkrl�r=r�rr5r5r6rsz%ModuleDocumenter.add_directive_headerc	Cs�|jr|jj}ni}i}t|j�D]f}zJt|j|d�}t|�rFt|�}|�d|fg�}t||d�	|�d�||<Wq"t
y�Yq"Yq"0q"t�|j�D]4}||vr�|�d|fg�}t|t
d�	|�d�||<q�|S)zGet members of target module.Nr�r�)r�)r�r�dirr]r+rrror�r�r�r$�getannotationsr/)r=rrnr|r#r�r5r5r6�get_module_members$s(
�z#ModuleDocumenter.get_module_membersr cCs�|��}|rX|jdur&dt|���fS|��D]}|j|jvr.d|_q.dt|���fSn^|jjpbg}g}|D]@}||vr�|�||�qlt	j
td�t|j
dd�|fdd�qld|fSdS)NTFzHmissing attribute mentioned in :members: option: module %s, attribute %sr@z???r�r�)rurprr'r@r�rlrnr?r�r�r!r+r])r=r!rnrpZ
memberlistr�r|r5r5r6r?s&

��z#ModuleDocumenter.get_object_membersr�rLcs\|dkrJ�jrJ|jdd�d�tttftd��fdd�}|j|d�|St��||�SdS)Nr`cSs
|djSrNrWrOr5r5r6r?]rNz/ModuleDocumenter.sort_members.<locals>.<lambda>r@rQcs>|dj�d�d}�jr0|�jvr0�j�|�St�j�SdSrS)r|rQrp�indexr)rRr|r�r5r6rV`sz.ModuleDocumenter.sort_members.<locals>.keyfunc)rprDrr�rDrXr�rGrYr�r�r6rGYszModuleDocumenter.sort_members)F)#r@rArBrCr�rarbrSrkr^r7rdr\r�r-r)rr�rcr�rDr�rr
r�r�rrrr�rurerrGr�r5r5r�r6rf�s8
�
��
�rfc@s2eZdZdZeeeeeeeefd�dd�ZdS)�ModuleLevelDocumenterzo
    Specialized Documenter subclass for objects on module level (functions,
    classes, data/constants).
    r�cCsF|dur8|r|�d�}n |jj�d�}|s8|jj�d�}|||gfS)Nr�r9�	py:module)r�r�rCro�ref_contextr�r5r5r6r�rsz"ModuleLevelDocumenter.resolve_nameN�	r@rArBrCr�rrr
r�r5r5r5r6rwms�rwc@s2eZdZdZeeeeeeeefd�dd�ZdS)�ClassLevelDocumenterz_
    Specialized Documenter subclass for objects on class level (methods,
    attributes).
    r�cCs�|dur�|r|�d�}n8d}|jj�d�}|dur@|jj�d�}|durPdgfS|�d�\}}}|g}|sx|jj�d�}|s�|jj�d�}|||gfS)Nr�r:zpy:classr9rx)r�r�rCrory�
rpartition)r=r�r�r�r�Zmod_cls�sepr�r5r5r6r��s z!ClassLevelDocumenter.resolve_nameNrzr5r5r5r6r{�s�r{cs�eZdZUdZdZeeeed<dZeeed<e	eefd�dd�Z
deeeed��fd	d
�
Ze
ed��fdd
�Z�ZS)�DocstringSignatureMixinz�
    Mixin for FunctionDocumenter and MethodDocumenter to provide the
    feature of reading the signature from the docstring.
    N�_new_docstrings�_signaturesr�cCsR|jdg}t|t�rD|�d�t|jd�rD|�dd�|jjD��|��}|durXdS|dd�|_	g|_
d}t|�D]�\}}t|�D]�\}}|s��qB|�d�r�|�
d��
�}t�|�}|s��qB|��\}	}
}}}
||vr��qB|jjjjj}td�||d	d��|d
�|j	|<|du�r,||
f}q�|j
�d||
f�q�|rx�qNqx|S)Nrr�r*css|]}|jVqdSr4)r@r;r5r5r6�	<genexpr>�rNz:DocstringSignatureMixin._find_signature.<locals>.<genexpr>)NN�\r�r���tabsizez
(%s) -> %s)r�r,�ClassDocumenterr?r^r]�extendr*rrr�r��endswithr�r�r�r�r�r
rrr
r&r�)r=Zvalid_namesrr�r�Zdoclines�jr�r�Zexmodr�r�r�r�r
r5r5r6�_find_signature�sB



�

z'DocstringSignatureMixin._find_signaturercs|jdur|jSt��|�Sr4)rr�r�r=rr�r5r6r�s
zDocstringSignatureMixin.get_docr�cs`|jdur.|jjr.|��}|dur.|\|_|_t�jfi|��}|jrXd�|g|j�S|SdS)Nr�)	r�r��autodoc_docstring_signaturer�r�r�r�r�r�)r=r�r�r�r�r5r6r��sz(DocstringSignatureMixin.format_signature)N)r@rArBrCrr
r�r)r�rr�rXrrr�r�r5r5r�r6r~�s
3r~cs(eZdZdZeed��fdd�Z�ZS)�DocstringStripSignatureMixinzz
    Mixin for AttributeDocumenter to provide the
    feature of stripping any function signature from the docstring.
    r�cs>|jdur,|jjr,|��}|dur,|\}|_t�jfi|��Sr4)r�r�r�r�r�r�r�)r=r�r��_argsr�r5r6r��s

z-DocstringStripSignatureMixin.format_signature)r@rArBrCrr�r�r�r5r5r�r6r��sr�cs�eZdZdZdZdZeeee	ee	d�dd��Z
eed�dd	�Zde	dd�d
d�Zedd��fdd�Z
eed��fdd�Zeeed�dd�Zeeeed�dd�Z�ZS)�FunctionDocumenterz8
    Specialized Documenter subclass for functions.
    �function�r�cCs(t�|�p&t�|�p&t�|�o&t|t�Sr4)r$�
isfunction�	isbuiltin�	isroutiner,rfr�r5r5r6r�
s�z&FunctionDocumenter.can_document_memberr�c
Ks�|jjdvr|�dd�|jjdkr0|�dd�z<|jj�d|jd�tj	|j|jj
d�}t|fi|��}WnNty�}z"t
�td	�|j|�WYd}~dSd}~0ty�d
}Yn0|jjr�|�dd�}|S)
N��none�description�show_annotationF�short�unqualified_typehintsT� autodoc-before-process-signature��type_aliases�-Failed to get a function signature for %s: %sr�r��\\)r��autodoc_typehintsrs�autodoc_typehints_formatr�rzrr]r$�	signature�autodoc_type_aliasesr,r�r�r�r!r�rc�strip_signature_backslashr�)r=r�r�r�r�r5r5r6r�s$
�
zFunctionDocumenter.format_argsFNr7cCsdSr4r5�r=r8r5r5r6rK'sz#FunctionDocumenter.document_membersr�cs<|��}t��|�t�|j�s,t�|j�r8|�d|�dS)N�
   :async:)rr�rr$�iscoroutinefunctionr]�isasyncgenfunctionr�rrr�r5r6r*sz'FunctionDocumenter.add_directive_headercsR|jjdkr|�dd�g}|jrHd�|j�|jjvrH|jjdkrHd}n d}t�j	fi|��}|�
|�t�|j
�r�|j
j��D]J\}}|t
ur�q�|�||�}|r�t|jd�}||_
dg|_|�
|�	��q�|�rHtj|j
|jjd�}	t|j
d	i�}
|jj�d�|j��D]<}|�|	|�}t||
|jj�}t|fi|��}|�
|��q
d
�|�S)Nr�r�Tr�r�Fr�r��__globals__r�)r�r�rsr�r�r��	overloadsr�r�r�r?r$Zis_singledispatch_functionr]r�r�annotate_to_first_argumentr�r�r�r�r+ro�merge_default_valuer(r,)r=r��sigs�
overloadedr��typ�funcZdispatchfuncrJ�actualr��overloadr�r5r6r�1sF�
�
��z#FunctionDocumenter.format_signature�r�r�r3cCsZt|j���}t|�D]6\}}|j�|j�}|r|jdkr|j|jd�||<q|j|d�S�zGMerge default values of actual implementation to the overload variants.z...)�default��
parameters�rr�r'r�ror|r�r��r=r�r�r�r�ZparamZactual_paramr5r5r6r�Zsz&FunctionDocumenter.merge_default_value�r�r�r3c
Cs�ztj||jjd�}WnLtyP}z"t�td�|j|�WYd}~dSd}~0t	ybYdS0t
|j�dkrvdSdd�}t|j�
��}|djtjur�|dj|d�|d<z|j|d�|_|WSttfy�YdS0ndSdS)	�?Annotate type hint to the first argument of function if needed.r�r�NrcSsdSr4r5r5r5r5r6�dummyrsz<FunctionDocumenter.annotate_to_first_argument.<locals>.dummy��
annotationr��r$r�r�r�r�r�r�r!r�rcrr�rr'r�r�emptyr��
__signature__r��r=r�r�r�r�r��paramsr5r5r6r�ds*
�
z-FunctionDocumenter.annotate_to_first_argument)F)r@rArBrCr�rErcrr�rDr�r�rKrr�rr�rrrr�r�r5r5r�r6r�s�)
r�cs0eZdZdZdZdZeed��fdd�Z�ZS)�DecoratorDocumenterzB
    Specialized Documenter subclass for decorator functions.
    �	decoratorrr�cs&t�jfi|��}d|vr|SdSdS)NrO)r�r�)r=r�r�r�r5r6r��szDecoratorDocumenter.format_args)	r@rArBrCr�r>rr�r�r5r5r�r6r��sr�zenum.EnumMeta.__call__ztyping.Generic.__new__cs�eZdZUdZdZdZeeeeee	e
eeed�
Ze
ed<dZeed<dZeed<edd	��fd
d�Zeeeeeed�d
d��Zd3eed��fdd�
Zeeeeeeefd�dd�Zeed�dd�Zeed��fdd�Zeed�dd�Zeed�dd�Z edd��fd d!�Z!eeee"fd"�d#d$�Z#d4e$eeeed%�d&d'�Z%eeed�d(d)�Z&d5ee'edd*��fd+d,�
Z(d6edd-��fd.d/�
Z)d7ee'eeedd0��fd1d2�
Z*�Z+S)8r�z6
    Specialized Documenter subclass for classes.
    rf�)
rnrgr�rhrirmrnrrrm�class-doc-fromr�N�_signature_class�_signature_method_namerocsjt�j|�|jjdkr\|j��|_|jjdur@ddg|jd<n|jj�d�|jj�d�t|j�dS)N�	separatedr�r�rm)	r�r�r��autodoc_class_signaturerlr�r2r?rurqr�r5r6r��szClassDocumenter.__init__r�cCs
t|t�Sr4)r,r�r�r5r5r6r��sz#ClassDocumenter.can_document_memberFr�cs<t��|�}|r8t|jd�r2|jd|jjk|_nd|_|S)Nr@rT)r�rr^r]r�r@�doc_as_attr�r=r�r�r�r5r6r�szClassDocumenter.import_objectr�cs�tttd��fdd�}t�jd�r>t�jjt�r>dd�jjfS|t�j�d�}|durhd�|�t	vrhd}|dur��j
j�d|d�z&t
j|d�jjd	�}t�j�d|fWSty�Yn0|�jd
�}|dur�d�|�tvr�d}|du�r6�j
j�d|d�z"t
j|d�jjd	�}�jd
|fWSt�y4Yn0|�jd�}|du�r��j
j�d|d�z"t
j|d�jjd	�}�jd|fWSt�y�Yn0�j
j�d�jd�z"t
j�jd�jjd	�}dd|fWSt�y�Yn0d
S)N)r}�attrr3cs:t�||�rdS��||d�}t�|�s6t�|�s6dS|S)zF Get the `attr` function or method from `obj`, if it is user-defined. N)r$Zis_builtin_class_methodr��ismethodr�)r}r�r�r5r6�#get_user_defined_function_or_method�szKClassDocumenter._get_signature.<locals>.get_user_defined_function_or_methodr��__call__z{0.__module__}.{0.__qualname__}r�T�Zbound_methodr�r�r�F)NNN)rr�r^r]r,r�rr��format�_METACLASS_CALL_BLACKLISTr�rzrr$r�r�r�rc�_CLASS_NEW_BLACKLIST)r=r��callr��newrgr5r�r6�_get_signature�sd
��
�
�
�zClassDocumenter._get_signaturer�c
Ks�|jjdvr|�dd�|jjdkr0|�dd�z|��\|_|_}Wn:ty�}z"t�	t
d�|j|�WYd}~dSd}~00|dur�dSt|fddi|��S)	Nr�r�Fr�r�Tz0Failed to get a constructor signature for %s: %sZshow_return_annotation)
r�r�rsr�r�r�r�r�r�r�r!r�r,)r=r�r�r�r5r5r6r� s
�zClassDocumenter.format_argsc	s�|jr
dS|jjdkrdS|jjdkr2|�dd�t���}g}|��}|r�|jjdkr�t	|j
|jd�}t	|di�}|D]T}t|||jj
�}t|j���}|j|dd�tjd	�}t|fi|��}|�|�qxn
|�|�d
�|�S)Nr�r�r�r�Tr�r�r�)r��return_annotationr�)r�r�r�r�rsr�r��get_overloaded_signaturesr�r+r�r�r(r�rr�r'r�rr�r,r?r�)	r=r�r�r�r��methodr�r�r�r�r5r6r�3s0
��
z ClassDocumenter.format_signaturec	Cs�|jr�|jr�|jjD]r}zZt�|j�}|��d�|j|jg�}||j	vr\|j	�
|�WS||jvrpgWSWqty�Yq0qgS)Nr�)
r�r�r*r"r\rA�analyzer�rBr�rorUr#)r=r�r��qualnamer5r5r6r�Ss

z)ClassDocumenter.get_overloaded_signaturescCsbt|jd|j�}t|jdd�}|dur4t|jdd�}|rDd|vrDd}|rZ|rZd�||g�SdSdS)NrArBr@z<locals>r�)r+r]r�r�)r=Z__modname__rBr5r5r6�get_canonical_fullnamedsz&ClassDocumenter.get_canonical_fullnamer�csF|��}|jrd|_t��|�|jrFd�|j�|jjvrF|�	d|�|�
�}|jsr|rr|j|krr|�	d||�|j�sB|jj
�rBt�|j�r�t|jj�}n*t|jd�r�t|jj�r�t|jj�}ng}|jj�d|j|j|j|�|jjdk�rdd	�|D�}nd
d	�|D�}|��}|�	d|�|�	dtd
�d�|�|�dS)N�	attributer��
   :final:z   :canonical: %s�	__bases__�autodoc-process-basesr�cSsg|]}t|d��qS)�smart�r/r;r5r5r6rM�rNz8ClassDocumenter.add_directive_header.<locals>.<listcomp>cSsg|]}t|��qSr5r�r;r5r5r6rM�rNr�r�z	Bases: %s�, )rr�r�r�rr�r�r��finalsr�r�r�rlZshow_inheritancer$Zgetorigbasesr]r�__orig_bases__r^rr�r�r�rr�r�r )r=r�rZcanonical_fullname�basesZbase_classesr�r5r6rrs0
�z$ClassDocumenter.add_directive_headerr cs�t�j�j�j�}|st�jjs&dgfSg}�jjD]8}||vrN|�||�q2tjt	d�|�j
fdd�q2d|fS�jjr�dt|�
��fSd�fdd�|�
�D�fSdS)NFr"r�r�csg|]}|j�jkr|�qSr5)r�r]r$r�r5r6rM�rNz6ClassDocumenter.get_object_members.<locals>.<listcomp>)rr]r�r�rlrnr?r�r�r!r�r&rr'r(r5r�r6r�s"
��z"ClassDocumenter.get_object_membersrc
s^|jr|��}|rgSdSt|dd�}|dur2|S|j�d|jj�}g}t|j|j	�}|rd|�
|�|dv�r<|�	|jdd�}t||j	|jj|jd�}|dur�|tjj
ks�|��tjj
kr�d}|�s|�	|jdd�}	t|	|j	|jj|jd�}|du�r|tjj
k�s|��tjj
k�rd}|�r<|dk�r2|g}n
|�
|�|jjjjj���fdd�|D�S)	Nrr�)rergr�r�rgcsg|]}t|����qSr5)r&)rLr��rr
r5r6rM�rNz+ClassDocumenter.get_doc.<locals>.<listcomp>)r��get_variable_commentrrlror��autoclass_contentr)r]r�r?r	r�rCrJr�r�r
rrr
)
r=r�commentr~Z
classdoc_fromrZ
attrdocstringr�Z
initdocstringr�r5r�r6r�sV

�
���

��

zClassDocumenter.get_doccCshzNdd�|j�f}|jr&t�|j�}nt�|���}|��t|j	�
|g��WStybYdS0dS)Nr�r�)r�r�r�r"r\r�r�r�rrror#)r=rtr�r5r5r6r��sz$ClassDocumenter.get_variable_commentrcs�|jr,|j|��kr,t�|j�|_|j��|jr�|��s�z>|jj	dkrVt
|jd�}n
t
|j�}tt
d�|gdd�}Wnty�Yn0t��|�dS)Nr�r��alias of %sr�)r�)r�r�r�r"r\r�r�r�r�r�r/r]rr r�r�r)r=rr�aliasr�r5r6r�s

zClassDocumenter.add_contentr7cs|jr
dSt��|�dSr4)r�r�rKr�r�r5r6rK�sz ClassDocumenter.document_membersrZcst�j|||d�S)N)rr�r8)r�rH)r=rrBr�r8r�r5r6rHs�zClassDocumenter.generate)F)N)F)F)NNFF),r@rArBrCr�rErSrkr^rdr\rhr�r-r)r�rr�r�r�rcrDr�rrrrr�r�r�r
r�r�rrerrXrr�rrrKrHr�r5r5r�r6r��sH
�	�$N &4
��
�r�c@s6eZdZdZdZdZdZeee	e
ee
d�dd��ZdS)�ExceptionDocumenterz>
    Specialized ClassDocumenter subclass for exceptions.
    �	exception�
r�cCst|t�ot|t�Sr4)r,r��
issubclass�
BaseExceptionr�r5r5r6r�sz'ExceptionDocumenter.can_document_memberN)r@rArBrCr�rEr>rcrr�rDr�r5r5r5r6r�s�r�c@s�eZdZUdZeed<dZeed<dZe	ed<dZ
eed<dZeed<dZ
ee	ed<ed�d	d
�Zed�dd�Zedd
�dd�ZdS)�DataDocumenterMixinBaseNr�r�r�r�r]r�r�cCsdS)z,Check directive header should be suppressed.Fr5r�r5r5r6� should_suppress_directive_header(sz8DataDocumenterMixinBase.should_suppress_directive_headercCsdS)z*Check :value: header should be suppressed.Fr5r�r5r5r6�should_suppress_value_header,sz4DataDocumenterMixinBase.should_suppress_value_header�rr3cCsdS)z(Update docstring for the NewType object.Nr5)r=rr5r5r6�update_content0sz&DataDocumenterMixinBase.update_content)r@rArBr�rr)r�rr�r�r�rr]r�r
rDr�r�rr�r5r5r5r6r�s
r�cs:eZdZdZed��fdd�Zedd��fdd�Z�ZS)	�GenericAliasMixinzt
    Mixin for DataDocumenter and AttributeDocumenter to provide the feature for
    supporting GenericAliases.
    r�cst�|j�pt���Sr4)r$�isgenericaliasr]r�r�r�r�r5r6r�;s�z2GenericAliasMixin.should_suppress_directive_headerNr�cs`t�|j�rP|jjdkr&t|jd�}n
t|j�}|�td�|d�|�dd�t��	|�dS�Nr�r�r�r�)
r$r�r]r�r�r/r?r r�r�)r=rr�r�r5r6r�?s
z GenericAliasMixin.update_content�	r@rArBrCrDr�rr�r�r5r5r�r6r�5sr�cs:eZdZdZed��fdd�Zedd��fdd�Z�ZS)	�NewTypeMixinzn
    Mixin for DataDocumenter and AttributeDocumenter to provide the feature for
    supporting NewTypes.
    r�cst�|j�pt���Sr4)r$�	isNewTyper]r�r�r�r�r5r6r�Rs�z-NewTypeMixin.should_suppress_directive_headerNr�csdt�|j�rT|jjdkr(t|jjd�}nt|jj�}|�td�|d�|�dd�t	��
|�dSr�)r$r�r]r�r�r/�
__supertype__r?r r�r�)r=rZ	supertyper�r5r6r�VszNewTypeMixin.update_contentr�r5r5r�r6r�Lsr�cs\eZdZdZed��fdd�Zdeeeee	d��fdd�
Z
edd	��fd
d�Z�Z
S)
�TypeVarMixinzn
    Mixin for DataDocumenter and AttributeDocumenter to provide the feature for
    supporting TypeVars.
    r�cst|jt�pt���Sr4)r,r]rr�r�r�r�r5r6r�is�z-TypeVarMixin.should_suppress_directive_headerNrcsX|dur tjd|jjtdd�t|jt�rJ|jjtjkrDt	��
�SgSn
t	��
�SdS)NrrTrU)rXrYr�r@rr,r]rrCr�rr�r�r5r6rms��
zTypeVarMixin.get_docr�cs�t|jt�r�t|jj�g}|jjD]}|�t|��q"|jjrt|j	j
dkrZt|jjd�}nt|jj�}|�d|�|jjr�|�d�|jj
r�|�d�|�td�d�|�d�|�dd�t��|�dS)	Nr�r�zbound=\ zcovariant=Truezcontravariant=Truezalias of TypeVar(%s)r�r�)r,r]r�reprr@�__constraints__r?�stringify_typehint�	__bound__r�r�r/�
__covariant__�__contravariant__r r�r�r�)r=r�attrsZ
constraint�boundr�r5r6r�{s 

zTypeVarMixin.update_content)N)r@rArBrCrDr�rXrr
r�rrr�r�r5r5r�r6r�cs"r�cs^eZdZdZd
eed��fdd�
Zed��fdd�Zdeee	e	e
d
��fdd�
Z�ZS)� UninitializedGlobalVariableMixinz�
    Mixin for DataDocumenter to provide the feature for supporting uninitialized
    (type annotation only) global variables.
    Fr�cszt�jdd�WSt�y}z�z�t|jj��ft|j|jj�}t	|d|jj
�}|jd|vr�t|_
||_Wd�WWYd}~dSWd�n1s�0YWnty�Yn0|rĂn.tj|jdddd�|j��WYd}~dSWYd}~n
d}~00dS)	NT�r�rrr�rr�F)r�rr�rr�r�rr�r�r.r�r��UNINITIALIZED_ATTRr]r�r�r�r�r�r�)r=r�r�r��annotationsr�r5r6r�s(�>
z.UninitializedGlobalVariableMixin.import_objectr�cs|jtupt���Sr4�r]r
r�r�r�r�r5r6r��s
�z=UninitializedGlobalVariableMixin.should_suppress_value_headerNrcs|jturgSt��|�SdSr4�r]r
r�rr�r�r5r6r�s
z(UninitializedGlobalVariableMixin.get_doc)F)N�
r@rArBrCrDrr�rXrr
r�rr�r5r5r�r6r�srcs eZdZUdZdZdZdZeej	�Z	e
ed<ee	d<e
e	d<eeeeeed�d	d
��Zedd�d
d�Zd'eed��fdd�
Zed��fdd�Zedd��fdd�Zd(edd�dd�Zed�dd�Zeeeed�dd �Zd)eeeeed!��fd"d#�
Zd*eeedd$��fd%d&�
Z�Z S)+�DataDocumenterz9
    Specialized Documenter subclass for data items.
    r�(i����r�r��no-valuer�cCst|t�o|Sr4)r,rfr�r5r5r6r��sz"DataDocumenter.can_document_memberN�r�r3cCsttt�|��}||_zHt�|j�}|��|j�	�D]$\\}}}|dkr4||vr4|||<q4Wnt
ynYn0dS)�9Update __annotations__ to support type_comment and so on.r�N)�dictr$rtr)r"r\r�r�rrr#)r=r�rr��	classname�attrnamer�r5r5r6�update_annotations�sz!DataDocumenter.update_annotationsFr�cs"t��|�}|jr|�|j�|Sr4)r�rr�rr�r�r5r6r�szDataDocumenter.import_objectr�cs>t���rdS|��}td�t|g���\}}d|vr:dSdS�NTr�z
hide-valueF�r�r�rr'r�r`�r=r4r�r5r�r5r6r��s
z+DataDocumenter.should_suppress_value_headerr�cs�t��|�|��}|jjtus�|��r*n�|jjrH|�d|jj|�n�|jj	dkr�t
|jd|jj�}|j
d|vr�t|�|j
d��}|�d||�z:|jjs�|��s�t|j�r�nt|j�}|�d||�Wnty�Yn0dS�Nz   :annotation: %sr�r�
   :type: z   :value: �r�rrrlr�rir�r�r�r�r.r�r�r�rroZno_valuer�rr]r*rc�r=r�rr�objreprr�r5r6r�s0���
z#DataDocumenter.add_directive_headerr7cCsdSr4r5r�r5r5r6rKszDataDocumenter.document_memberscCs |�|jp|jdd�}|p|jS�NrA�r�r�r]r��r=rBr5r5r6r�	szDataDocumenter.get_real_modname)rr3cCsRz:t�|j�}|��d|f}||jvr8t|j|�WSWntyLYn0dS)Nr�)r"r\r�r�rrr#)r=rr�rtr5r5r6�get_module_comment
s
z!DataDocumenter.get_module_commentrcs*|�|jd�}|r|gSt��|�SdS)Nr)r#r�r�r)r=rr�r�r5r6rszDataDocumenter.get_docrcs.d|_|st�}|�|�t�j||d�dS)N)r�r�rr�r�r�r=rrr�r5r6r!s

zDataDocumenter.add_content)F)F)N)F)!r@rArBrCr�rEr>rrwr�r-r)rjrkrcrr�rDr�rrr�rrKr�rr
r#rXrrrr�r5r5r�r6r�s,
�"
�rc@s<eZdZdZdZdZejdZee	e
ee	ed�dd��ZdS)	�NewTypeDataDocumenterz�
    Specialized Documenter subclass for NewTypes.

    Note: This must be invoked before FunctionDocumenter because NewType is a kind of
    function object.
    Znewtypedatarr�r�cCst�|�o|Sr4)r$r�r�r5r5r6r�:sz)NewTypeDataDocumenter.can_document_memberN)
r@rArBrCr�r�r�r>rcrr�rDr�r5r5r5r6r&.s
�r&cs�eZdZdZdZdZdZdZee	e
ee	ed�dd��Zd!eed	��fd
d�
Z
e	e
d�d
d�Ze
dd��fdd�Zd"edd�dd�Ze	e
d��fdd�Zeeed�dd�Zeeeed�dd�Zd#eeeee
d��fdd �
Z�ZS)$�MethodDocumenterzQ
    Specialized Documenter subclass for methods (normal, static and class).
    r��2r�r�cCst�|�ot|t�Sr4)r$r�r,rfr�r5r5r6r�Isz$MethodDocumenter.can_document_memberFr�cs`t��|�}|s|S|jj�|j�}|dur2|j}t�|�sPtj	||j|jd�r\|j
d|_
|S)N�r�r|r�)r�rr�r+ror�r]r$�
isclassmethod�isstaticmethodrE)r=r�r�r}r�r5r6rNs
�zMethodDocumenter.import_objectr�c
Ks:|jjdvr|�dd�|jjdkr0|�dd�z�|jtjkrN|jtkrNd}n|tj|j|j|j	d�r�|j
j�d	|jd�tj
|jd|jjd
�}n*|j
j�d	|jd�tj
|jd|jjd
�}t|fi|��}WnRt�y}z"t�td�|j|�WYd}~dSd}~0t�yd}Yn0|jj�r6|�d
d�}|S)Nr�r�Fr�r�Tz()r)r�r��+Failed to get a method signature for %s: %sr�r�r�)r�r�rsr�r]r�r�r$r+r�r�rzrr�r�r,r�r�r�r!r�rcr�r�)r=r�r�r�r�r5r5r6r�_s6
�
�
�

zMethodDocumenter.format_argsNr�cs�t��|�|��}|jj�|j|j�}t�	|�r>|�
d|�t�|�sRt�|�r^|�
d|�t�
|�rt|�
d|�tj||j|jd�r�|�
d|�|jr�d�|j�|jjvr�|�
d|�dS)N�   :abstractmethod:r��   :classmethod:r)z   :staticmethod:r�r�)r�rrr�r+ror�r]r$�isabstractmethodr�r�r�r*r+r�r�r�r�)r=r�rr}r�r5r6r�s

z%MethodDocumenter.add_directive_headerr7cCsdSr4r5r�r5r5r6rK�sz!MethodDocumenter.document_memberscs�|jjdkr|�dd�g}|jrHd�|j�|jjvrH|jjdkrHd}n d}t�j	fi|��}|�
|�|jj�
|jd�}t�|�r�|jj��D]R\}}|tur�q�|�||�}|r�t|jd�}	|j|	_||	_dg|	_|�
|	�	��q�|�r�tj|j|j|jd	��rtj|jd|jjd
�}
ntj|jd|jjd
�}
t|jdi�}|jj�
d�|j��D]v}|�|
|�}t|||jj�}tj|j|j|jd	��s�t|j� ��}
|j!|
dd�d
�}t"|fi|��}|�
|��qVd�|�S)Nr�r�Tr�r�Frr�r)r�r�r�r�r�)#r�r�rsr�r�r�r�r�r�r�r?r�r+ror$Zis_singledispatch_method�
dispatcherr�rr]r�r'r�r+r�r�r�r+r�r(rr�r'r�r,)r=r�r�r�r�Zmethr�r�ZdispatchmethrJr�r�r�r�r�r5r6r��s\�
�


�
���z!MethodDocumenter.format_signaturer�cCsZt|j���}t|�D]6\}}|j�|j�}|r|jdkr|j|jd�||<q|j|d�Sr�r�r�r5r5r6r��sz$MethodDocumenter.merge_default_valuer�c
Cs�ztj||jjd�}WnLtyP}z"t�td�|j|�WYd}~dSd}~0t	ybYdS0t
|j�dkrvdSdd�}t|j�
��}|djtjur�|dj|d�|d<z|j|d�|_|WSttfy�YdS0ndSdS)	r�r�r,Nr�cSsdSr4r5r5r5r5r6r��sz:MethodDocumenter.annotate_to_first_argument.<locals>.dummyr�r�r�r�r5r5r6r��s*
�
z+MethodDocumenter.annotate_to_first_argumentrcs|jdur|jS|jddkr�t|j|j|jj|j|j�}|durb|tj	j
ks^|��tj	j
krbd}|r�|jj
jjj}t||d�gSgSn�|jddk�rt|j|j|jj|j|j�}|dur�|tjj
ks�|��tjj
kr�d}|�r�|jj
jjj}t||d�gSgSn
t���SdS)Nrr�r�r�)rr�r)r]r�r�r	r�r�r�rCrJr�r
rrr
r&r�r�rrr�r5r6r�sB

�
��
�
��zMethodDocumenter.get_doc)F)F)N)r@rArBrCr�r�rEr>rcrr�rDr�rr�rrKr�rr�rrrr�rXr
rr�r5r5r�r6r'@s"�#4
r'cs^eZdZdZd
eed��fdd�
Zed��fdd�Zdeee	e	e
d
��fdd�
Z�ZS)�NonDataDescriptorMixina
    Mixin for AttributeDocumenter to provide the feature for supporting non
    data-descriptors.

    .. note:: This mix-in must be inherited after other mix-ins.  Otherwise, docstring
              and :value: header will be suppressed unexpectedly.
    Fr�cs.t��|�}|r$t�|j�s$d|_nd|_|S)NTF)r�rr$�isattributedescriptorr]�non_data_descriptorr�r�r5r6r	s
z$NonDataDescriptorMixin.import_objectr�cst|dd�pt���S�Nr3F)rr�r�r�r�r5r6r�'	s�z3NonDataDescriptorMixin.should_suppress_value_headerNrcs t|dd�rdSt��|�SdSr4)rr�rr�r�r5r6r+	szNonDataDescriptorMixin.get_doc)F)Nrr5r5r�r6r1	s	r1cs~eZdZdZed�dd�Zdeed��fdd�
Zed��fd	d
�Zdee	e
e
ed��fd
d�
Ze
ed�dd��Z�ZS)�
SlotsMixinzX
    Mixin for AttributeDocumenter to provide the feature for supporting __slots__.
    r�c	CsLz.t�|j�}|r&|jd|vr&WdSWdSWnttfyFYdS0dS)z/Check the subject is an attribute in __slots__.rTFN)r$�getslotsr�r�rcr�)r=�	__slots__r5r5r6�isslotsattribute9	s
zSlotsMixin.isslotsattributeFr�cst��|�}|��rt|_|Sr4)r�rr8�	SLOTSATTRr]r�r�r5r6rD	szSlotsMixin.import_objectcs|jturdSt���SdSr;)r]r9r�r�r�r�r5r6r�K	s
z'SlotsMixin.should_suppress_value_headerNrc
s�|jtur�zDt�|j�}|rF|�|jd�rFt||jd�}|gWSgWSWq�ty�}z,t	j
td�|jj|fdd�gWYd}~Sd}~00nt
��|�SdS)Nrz'Invalid __slots__ found on %s. Ignored.r�r�)r]r9r$r6r�ror�r&rcr�r�r!rBr�r)r=rr7r�r�r�r5r6rQ	s


�zSlotsMixin.get_doccCs"t�dt�|jturdSdSdS)Nz4AttributeDocumenter._datadescriptor() is deprecated.TF)rXrYrr]r9r�r5r5r6�_datadescriptora	s�
zSlotsMixin._datadescriptor)F)N)r@rArBrCrDr8rr�rXrr
r�rrdr:r�r5r5r�r6r54	s"r5cs�eZdZdZe�Zeed�dd�Zeed�dd�Z	deed��fd	d
�
Z
ed��fdd
�Zdee
eeed��fdd�
Z�ZS)�RuntimeInstanceAttributeMixina1
    Mixin for AttributeDocumenter to provide the feature for supporting runtime
    instance attributes (that are defined in __init__() methods with doc-comments).

    Example:

        class Foo:
            def __init__(self):
                self.attr = None  #: This is a target of this mix-in.
    rcCs,|�||jd�rdS|�|�r$dSdSdS)z8Check the subject is an attribute defined in __init__().rTFN)�get_attribute_commentr��+is_runtime_instance_attribute_not_commented)r=r�r5r5r6�is_runtime_instance_attributey	s

z;RuntimeInstanceAttributeMixin.is_runtime_instance_attributec
Cs�t�|�D]v}zZt|d�}t|d�}t�|�}|��|rf|jrfd�||jdg�}||jvrfWdSWq
t	t
fy~Yq
0q
dS)zHCheck the subject is an attribute defined in __init__() without comment.rArBr�rTN)r$�getmror+r"r\r�r�r�rUr�r#)r=r�r�r�r�r�rtr5r5r6r=�	s




zIRuntimeInstanceAttributeMixin.is_runtime_instance_attribute_not_commentedFr�cszt�jdd�WSt�y}z�z�t|jj��pt|j|jdd�d|j|jj	d�}|d}|�
|�r�|j|_||_
Wd�WWYd}~dSWd�n1s�0YWnty�Yn0|r΂n.tj|jdd	d
d�|j��WYd}~dSWYd}~n
d}~00dS)
z`Check the existence of runtime instance attribute after failing to import the
        attribute.Tr	Nrrfr��rr�rr�F)r�rr�rr�r�r�r�r�r�r>�RUNTIME_INSTANCE_ATTRIBUTEr]r�r�r�r�r�r��r=r�r�r�r�r�r5r6r�	s*�
>
z+RuntimeInstanceAttributeMixin.import_objectr�cs|j|jupt���Sr4)r]rAr�r�r�r�r5r6r��	s�z:RuntimeInstanceAttributeMixin.should_suppress_value_headerNrcs,|j|jur|�|j�rdSt��|�SdSr4)r]rAr=r�r�rr�r�r5r6r�	s

�z%RuntimeInstanceAttributeMixin.get_doc)F)N)r@rArBrCr]rArrDr>r=rr�rXrr
r�rr�r5r5r�r6r;k	s
r;csneZdZdZeed�dd�Zdeed��fdd�
Zed	��fd
d�Zde	e
eeed
��fdd�
Z
�ZS)�#UninitializedInstanceAttributeMixinz�
    Mixin for AttributeDocumenter to provide the feature for supporting uninitialized
    instance attributes (PEP-526 styled, annotation only attributes).

    Example:

        class Foo:
            attr: int  #: This is a target of this mix-in.
    rcCs*t|d|jj�}|jd|vr"dSdSdS)z2Check the subject is an annotation only attribute.NrTF)r.r�r�r�)r=r�rr5r5r6�#is_uninitialized_instance_attribute�	szGUninitializedInstanceAttributeMixin.is_uninitialized_instance_attributeFr�cs�zt�jdd�WSty�}z�zVt|j|jdd�d|j|jjd�}|d}|�|�rtt	|_
||_WWYd}~dSWnty�Yn0|r��n.tj
|jdd	d
d�|j��WYd}~dSWYd}~n
d}~00dS)
�eCheck the exisitence of uninitialized instance attribute when failed to import
        the attribute.Tr	Nrrfr�r@rr�rr�F)r�rr�r�r�r�r�r�rDr
r]r�r�r�r�r�r�rBr�r5r6r�	s(�

z1UninitializedInstanceAttributeMixin.import_objectr�cs|jtupt���Sr4rr�r�r5r6r��	s
�z@UninitializedInstanceAttributeMixin.should_suppress_value_headerNrcs|jturdSt��|�SdSr4r
r�r�r5r6r�	s
z+UninitializedInstanceAttributeMixin.get_doc)F)N)r@rArBrCrrDrDrr�rXrr
r�rr�r5r5r�r6rC�	s

rCcsDeZdZUdZdZdZeej�Ze	e
d<eed<eed<dZ
eeed�d	d
��Zeeeeeed�dd
��Zd,edd�dd�Zed�dd�Zedd�dd�Zd-eed��fdd�
Zed�dd�Zed��fdd�Zedd ��fd!d"�Zeeeeed#�d$d%�Zd.eeeeed&��fd'd(�
Z d/ee!edd)��fd*d+�
Z"�Z#S)0�AttributeDocumenterz9
    Specialized Documenter subclass for attributes.
    r��<r�r�rr�)r}r3cCst�|�pt�|�pt�|�Sr4)r$r�r�r�)r}r5r5r6�is_function_or_method
sz)AttributeDocumenter.is_function_or_methodr�cCs<t|t�rdSt�|�rdSt�|�s4t|t�s4dSdSdS)NFT)r,rfr$r2r�r�r�r5r5r6r�
s

z'AttributeDocumenter.can_document_memberFNr7cCsdSr4r5r�r5r5r6rK
sz$AttributeDocumenter.document_membersr�c	Cs�t�dt�t|jj���zjt|j|jdd�d|j	|jj
d�}|d|_t|jd|jj
�}|jd|vr�t|_WWd�dSWnty�Yn0Wd�n1s�0YdS)	z+Check the subject is an instance attribute.z8AttributeDocumenter.isinstanceattribute() is deprecated.Nrrfr�r@TF)rXrYrrr�r�rr�r�r�r�r�r.r�r
r]r�)r=r�rr5r5r6�isinstanceattribute
s&��
�$z'AttributeDocumenter.isinstanceattributerc

Cs�z�tt�|��}||_t�|�D]v}zZt|d�}t|d�}t�|�}|��|j	�
�D]$\\}}}	||krV||vrV|	||<qVWq ttfy�Yq 0q Wntt
fy�Yn0dS)rrArBN)rr$rtr)r?r+r"r\r�rrr�r#r�)
r=r�rr�r�r�r�rrr�r5r5r6r+
s 


z&AttributeDocumenter.update_annotationsr�cs8t��|�}t�|j�r"|jj|_|jr4|�|j�|Sr4)r�rr$Zisenumattributer]r#r�rr�r�r5r6rA
s
z!AttributeDocumenter.import_objectcCs |�|jp|jdd�}|p|jSr r!r"r5r5r6r�J
sz$AttributeDocumenter.get_real_modnamecsBt���rdS|��}|r>td�t|g���\}}d|vr>dSdSrrrr�r5r6r�N
s
z0AttributeDocumenter.should_suppress_value_headerr�cs�t��|�|��}|jjtus�|��r*n�|jjrH|�d|jj|�n�|jj	dkr�t
|jd|jj�}|j
d|vr�t|�|j
d��}|�d||�z:|jjs�|��s�t|j�r�nt|j�}|�d||�Wnty�Yn0dSrrrr�r5r6rZ
s,��
z(AttributeDocumenter.add_directive_header)r�rr3c
Cs�t�|�D]v}zZt|d�}t|d�}t�|�}|��|rf|jrf||f}||jvrft|j|�WSWq
t	t
fy~Yq
0q
dS)NrArB)r$r?r+r"r\r�r�rrr�r#)r=r�rr�r�r�r�rtr5r5r6r<t
s




z)AttributeDocumenter.get_attribute_commentrcsT|�|j|jd�}|r|gSz&|jj}d|j_t��|�W||j_S||j_0dS)NrF)r<r�r�r�r	r�r)r=rr�Zorigr�r5r6r�
s�zAttributeDocumenter.get_docrcs0d|_|durt�}|�|�t��||�dSr4r$r%r�r5r6r�
s

zAttributeDocumenter.add_content)F)F)N)F)$r@rArBrCr�rErrwr�r-r)rjrkr>�staticmethodrrDrHrcr�r�rKrIrrr�r�rrr
r<rXrrrr�r5r5r�r6rF�	s2
�	"
�rFcs�eZdZdZdZdZejdZee	e
ee	ed�dd��Zdeed	��fd
d�
Z
dedd
�dd�Ze
d�dd�Ze
dd��fdd�Z�ZS)�PropertyDocumenterz9
    Specialized Documenter subclass for properties.
    rdrGr�r�cCsPt|t�rHt�|�rdSt|jdi�}|�|�}t|t�oDt�|j�SndSdS)NTr+F)	r,r�r$�
ispropertyr+r]rorc�__func__)r�rpr�r�r�r+r}r5r5r6r��
s


z&PropertyDocumenter.can_document_memberFr�cspt��|�}|rft�|j�sft|jdi�}|�|jd�}t	|t
�rbt�|j�rb|j|_d|_dSdSd|_|S)rEr+rTF)
r�rr$rLr]r+r�ror�r,rcrMr*)r=r�r�r+r}r�r5r6r�
sz PropertyDocumenter.import_objectNr7cCsdSr4r5r�r5r5r6rK�
sz#PropertyDocumenter.document_membersr�cCs |�|jp|jdd�}|p|jSr r!r"r5r5r6r��
sz#PropertyDocumenter.get_real_modnamer�c
st��|�|��}t�|j�r,|�d|�|jr>|�d|�t|jdd�rV|jj	}nt|jdd�rn|jj
}nd}|�r|jjdk�rz<tj
||jjd�}|jtjur�t|j�}|�d||�WnPt�y�}z"t�td�|j|�WYd}~dSd}~0t�yYdS0dS)	Nr-r.�fgetr�r�r�rr�)r�rrr$r/r]r�r*r+rNr�r�r�r�r�r�rr�rr�r�r�r!r�rc)r=r�rr�r�rr�r�r5r6r�
s4

�

�z'PropertyDocumenter.add_directive_header)F)F)r@rArBrCr�rErFr>rcrr�rDr�rrKr�rr�r5r5r�r6rK�
s
�rKc@s<eZdZdZdZdZejdZee	e
ee	ed�dd��ZdS)	�NewTypeAttributeDocumenterz�
    Specialized Documenter subclass for NewTypes.

    Note: This must be invoked before MethodDocumenter because NewType is a kind of
    function object.
    Znewvarattributer�r�r�cCst|t�ot�|�Sr4)r,rfr$r�r�r5r5r6r��
sz.NewTypeAttributeDocumenter.can_document_memberN)
r@rArBrCr�r�r'r>rcrr�rDr�r5r5r5r6rO�
s
�rO)rzr3cCstjdtdd�|jjS)r�z get_documenters() is deprecated.rTrU)rXrYrr�r��rzr5r5r6�get_documenterssrQ)rzr}r|r�r3cGsH|jj��D](\}}t||�r|||g|�R�Sqt||g|�R�S)zAlternative getattr() for types)r�Zautodoc_attrgettrsrr,r+)rzr}r|r�r�r�r5r5r6r�s
r�)rzr�r3cCs"|jdkrt�td��d|_dS)N�
alphabeticzdautodoc_member_order now accepts "alphabetical" instead of "alphabetic". Please update your setting.r_)rFr�r�r!)rzr�r5r5r6�migrate_autodoc_member_orders
rS)�DataDeclarationDocumenter)�GenericAliasDocumenter)�InstanceAttributeDocumenter)� SingledispatchFunctionDocumenter)�SingledispatchMethodDocumenter)�SlotsAttributeDocumenter)�TypeVarDocumenterc
Cs�|�t�|�t�|�t�|�t�|�t�|�t�|�t�|�t�|�t	�|�t
�|�t�|�dddt
ddd��|�dddt
ddd	d
��|�dddt
dd
��|�did�|�ddd�|�dgd�|�dddt
dddd��|�dddt
dd��|�did�|�dddt
dd��|�ddd�|�ddd�|�d�|�d �|�d!�|�d"�|�d#�|jd$td%d&�|�d'�|�d(�|�d)�tjdd*�S)+Nr�rfTrergrFr_rRr`rar�Zmixedr�Zautodoc_default_optionsr�r�r�r�r�r�Z$autodoc_typehints_description_target�allZ
documentedr�r�zfully-qualifiedr�r�r�r	r�rr�r.r�z
config-initedi r=z$sphinx.ext.autodoc.preserve_defaultszsphinx.ext.autodoc.type_commentzsphinx.ext.autodoc.typehints)�versionZparallel_read_safe)Zadd_autodocumenterrfr�r�rr&r�r�r'rFrKrOZadd_config_valuerZ	add_eventZconnectrSZsetup_extension�sphinxZ__display_version__rPr5r5r6�setup!sR











�
�
�
�







r^)rN)NFF)�rCr�rXr$rr�typesr�typingrrrrr	r
rrr
rrrrZdocutils.statemachinerr]Zsphinx.applicationrZ
sphinx.configrrZsphinx.deprecationrrZsphinx.environmentrZsphinx.ext.autodoc.importerrrrrZsphinx.ext.autodoc.mockrrrZ
sphinx.localer r!Z
sphinx.pycoder"r#Zsphinx.utilr%Zsphinx.util.docstringsr&r'Zsphinx.util.inspectr(r)r*r+r,Zsphinx.util.typingr-r.r/r0rZsphinx.ext.autodoc.directiver1Z	getLoggerr@r�r��__subclasses__�MethodDescriptorTyper��VERBOSEr�r1r7r8rErPr[r]r
r/r9r�rSrZr\r^rdrhrirjrDrkrqrurXr�r�rr��tupler�rer�rfrwr{r~r�r�r�r�r�r�r�r�r�r�r�rrr&r'r1r5r;rCrFrKrOrQr�rSZsphinx.ext.autodoc.deprecatedrTrUrVrWrXrYrZr^r5r5r5r6�<module>s�<

�


	
��&7!N��p.)�tV7P7�0M		

Youez - 2016 - github.com/yon3zu
LinuXploit