o
    Ni$                 
   @  s@  U d Z ddlmZ ddlZddlZddlZddlmZmZ ddl	m
Z
mZmZmZ ddlmZ ddlZddlmZmZ ddlmZ dd	lmZmZmZ dd
lmZmZmZ ddlmZm Z  ddl!m"Z" ddl#mZm$Z$ ddl%m&Z&m'Z' ddl(m)Z)m*Z*m+Z+m,Z,m-Z- ddl.m/Z/m0Z0m1Z1m2Z2m3Z3 e
rddl4m5Z5m6Z6m7Z7 ddl8m9Z9 ddl	m:Z:m;Z;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZB e;d ZCe5e>eCeDeeEeDeFf eGeD gdf ZHdeId< e$JeKZLeMeMjNZOePdejQZRePdZSddd ZTG d!d" d"ZUG d#d$ d$ZVeU ZWeV ZXeY ZZeY Z[eY Z\dd'd(Z]dd*d+Z^dd-d.Z_dd0d1Z`dd2d3ZaeY Zbdd4d5Zcdd7d8Zddd<d=Ze	dddCdDZf		E	EdddJdKZgG dLdM dMeEeDef ZhG dNdO dOZiG dPdQ dQZjG dRdS dSejZkG dTdU dUejZlG dVdW dWejZmG dXdY dYZnG dZd[ d[enZoG d\d] d]enelZpG d^d_ d_epZqd`gZrdagZsG dbdc dcenelZtG ddde deetZuG dfdg dgZvG dhdi dievZwG djdk dkevZxG dldm dmewexelZyG dndo doenemZzG dpdq dqevZ{G drds dsevZ|G dtdu duevZ}G dvdw dwevZ~G dxdy dyewe|e}e~e{eoem	ZG dzd{ d{eoemZdddZdddZdS )a  Extension to create automatic documentation from code docstrings.

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.
    )annotationsN)	Parameter	Signature)TYPE_CHECKINGAnyNewTypeTypeVar)
StringList)ENUMConfig)PycodeError)get_class_membersimport_moduleimport_object)ismockmock
undecorate)___)ModuleAnalyzer)inspectlogging)prepare_docstringseparate_metadata)evaluate_signaturegetdocobject_descriptionsafe_getattrstringify_signature)ExtensionMetadata
OptionSpecget_type_hintsrestifystringify_annotation)CallableIteratorSequence)
ModuleType)ClassVarLiteral	TypeAlias)Sphinx)BuildEnvironment)DocumenterBridge)moduleclass	exceptionfunctionmethod	attributer*    _AutodocProcessDocstringListenera  ^ ([\w.]+::)?            # explicit module name
          ([\w.]+\.)?            # module and/or class name(s)
          (\w+)  \s*             # thing name
          (?: \[\s*(.*)\s*])?    # optional: type parameters list
          (?: \((.*)\)           # optional: arguments
           (?:\s* -> \s* (.*))?  #           return annotation
          )? $                   # and nothing more
          z	^__\S+__$xr   returnc                 C  s   | S N )r5   r8   r8   O/home/ubuntu/.local/lib/python3.10/site-packages/sphinx/ext/autodoc/__init__.pyidentityO      r:   c                   @  s$   e Zd ZdZdddZdd	d
ZdS )_Allz;A special value for :*-members: that matches to any member.itemr   r6   boolc                 C     dS NTr8   selfr=   r8   r8   r9   __contains__V   r;   z_All.__contains__Nonec                 C     d S r7   r8   rA   r8   r8   r9   appendY   r;   z_All.appendNr=   r   r6   r>   )r=   r   r6   rD   )__name__
__module____qualname____doc__rC   rF   r8   r8   r8   r9   r<   S   s    
r<   c                   @  s   e Zd ZdZd	ddZdS )
_EmptyzGA special value for :exclude-members: that never matches to any member.r=   r   r6   r>   c                 C  r?   NFr8   rA   r8   r8   r9   rC   `   r;   z_Empty.__contains__NrG   )rH   rI   rJ   rK   rC   r8   r8   r8   r9   rL   ]   s    rL   argobject | list[str]c                 C  s,   | dv rt S | du rdS dd | dD S )z8Used to convert the :members: option to auto directives.r@   FNc                 S  s   g | ]
}|  r|  qS r8   strip.0r5   r8   r8   r9   
<listcomp>r       z"members_option.<locals>.<listcomp>,)ALLsplitrN   r8   r8   r9   members_optionk   s
   rZ   object | set[str]c                 C  s    | dv rt S dd | dD S )z-Used to convert the :exclude-members: option.r@   c                 S  s   h | ]
}|  r|  qS r8   rP   rR   r8   r8   r9   	<setcomp>y   rU   z)exclude_members_option.<locals>.<setcomp>rV   )EMPTYrX   rY   r8   r8   r9   exclude_members_optionu   s   r^   set[str]c                 C  s,   | dv rdhS | rdd |  dD S t S )zBUsed to convert the :inherited-members: option to auto directives.r@   objectc                 S  s   h | ]}|  qS r8   rP   rR   r8   r8   r9   r\          z+inherited_members_option.<locals>.<setcomp>rV   )rX   setrY   r8   r8   r9   inherited_members_option|   s
   rc   
str | Nonec                 C  s(   | dv rdS | dv r| S t td|  )z=Used to convert the :member-order: option to auto directives.r@   N)alphabeticalbysource	groupwisez)invalid value for member-order option: %s
ValueErrorr   rY   r8   r8   r9   member_order_option   s
   rj   c                 C  s   | dv r| S t td|  )zDUsed to convert the :class-doc-from: option to autoclass directives.)bothr/   initz+invalid value for class-doc-from option: %srh   rY   r8   r8   r9   class_doc_from_option   s   rm   c                 C  s   | dv rt S | S )Nr@   )SUPPRESSrY   r8   r8   r9   annotation_option   s   ro   r>   c                 C  r?   )znUsed to convert flag options to auto directives.  (Instead of
    directives.flag(), which returns None).
    Tr8   rY   r8   r8   r9   bool_option   s   rp   optionsdictrD   c                 C  sd   |  dtu r	dS | dg }dD ]}|| v r/| | tdfvr/| | D ]}||vr.|| q#qdS )zWMerge :private-members: and :special-members: options to the
    :members: option.
    membersN)private-membersspecial-members)getrW   
setdefaultrF   )rq   rs   keymemberr8   r8   r9   merge_members_option   s   
rz   preintpostwhatSequence[str] | Nonec                   s@   |st  nt|trt |hnt |d fdd}|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`.
    appr+   what__AutodocObjTypenamestrobjr   rq   dict[str, bool]lines	list[str]r6   rD   c                   sb   r|vrd S |d =  r |r|d s| d |  d = |r-|d r/|d d S d S d S )N )poprF   )r   r   r   r   rq   r   r}   r{   what_uniquer8   r9   process   s   

zcut_lines.<locals>.processNr   r+   r   r   r   r   r   r   rq   r   r   r   r6   rD   )	frozenset
isinstancer   )r{   r}   r~   r   r8   r   r9   	cut_lines   s   
r   Fmarkerr   	keepemptyexcludec                   s"   t | d fdd}|S )an  Return 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.
    r   r+   r   r   r   r   r   r   rq   r   r   r   r6   rD   c                   s   r|vrd S d}  }|  }t|D ]&\}	}
|r&||	|  |d7 }|
r;| }|r;||	|  |d7 }q|sFsF||d d < |rS|d rU|d d S d S d S )Nr      r   r   )copy	enumerater   matchrF   )r   r   r   r   rq   r   deleteddelete
orig_linesiliner   r   	marker_rer~   r8   r9   r      s(   
zbetween.<locals>.processNr   )recompile)r   r~   r   r   r   r8   r   r9   between   s   
r   c                      s,   e Zd ZdZd
 fddZddd	Z  ZS )Optionsz>A dict/attribute hybrid that returns None on nonexisting keys.r6   c                   s   t t  S r7   )r   superr   rB   	__class__r8   r9   r     s   zOptions.copyr   r   r   c                 C  s(   z	| | dd W S  ty   Y d S w )Nr   -)replaceKeyError)rB   r   r8   r8   r9   __getattr__  s
   zOptions.__getattr__)r6   r   )r   r   r6   r   )rH   rI   rJ   rK   r   r   __classcell__r8   r8   r   r9   r     s    r   c                   @  s$   e Zd ZdZdddddddZdS )ObjectMemberzA member of object.

    This is used for the result of `Documenter.get_module_members()` to
    represent each member of the object.
    NF)	docstringclass_skippedr   r   r   r   r   rd   r   r   r>   r6   rD   c                C  s"   || _ || _|| _|| _|| _d S r7   )rH   r`   r   r   r   )rB   r   r   r   r   r   r8   r8   r9   __init__+  s
   
zObjectMember.__init__)r   r   r   r   r   rd   r   r   r   r>   r6   rD   )rH   rI   rJ   rK   r   r8   r8   r8   r9   r   $  s
    r   c                   @  s@  e Zd ZU dZdZdZdZdZdZe	e	dZ
ded< dlddZedmddZdndodd Zedpd"d#Zdqd(d)Zdrd0d1Zdsd2d3Zdtdud6d7Zdvd8d9Zdsd:d;Zdwd=d>Zdvd?d@ZdwdAdBZdwdCdDZdxdFdGZdydIdJZdzdNdOZdvdPdQZd{dTdUZ d|dXdYZ!d}d]d^Z"dtd~d`daZ#ddedfZ$	g	g	4	4dddjdkZ%dgS )
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`      r   T)no-indexnoindexClassVar[OptionSpec]option_specr   r   r   r   defargsr6   c                 G  s   t | jj||g|R  S )z5getattr() override for types such as Zope interfaces.)autodoc_attrgetterenvr   )rB   r   r   r   r8   r8   r9   get_attrU  s   zDocumenter.get_attrclstype[Documenter]ry   
membernameisattrr>   parentc                 C     d}t |)z?Called to see if a member can be documented by this Documenter.!must be implemented in subclassesNotImplementedError)r   ry   r   r   r   msgr8   r8   r9   can_document_memberY  s   zDocumenter.can_document_memberr   	directiver-   indentrD   c                 C  sl   || _ |jj| _|j| _|j| _|| _|| _d| _d | _g | _	d| _
d | _d| _d | _d| _d | _d | _d S Nr   )r   r   configgenoptrq   r   r   modnamer.   objpathfullnameargsretannr`   object_namer   analyzer)rB   r   r   r   r8   r8   r9   r   a  s    

zDocumenter.__init__dict[str, type[Documenter]]c                 C  s   | j jjjS )z%Returns registered Documenter classes)r   r   registrydocumentersr   r8   r8   r9   r   z  s   zDocumenter.documentersr   sourcelinenor|   c                 G  sF   |  r| jjj| j| |g|R   dS | jjjd|g|R   dS )z0Append one line of generated reST to the output.r   N)rQ   r   resultrF   r   )rB   r   r   r   r8   r8   r9   add_line  s   "zDocumenter.add_liner   rd   parentspathbasetuple[str | None, list[str]]c                 C  r   )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   r   )rB   r   r   r   r   r   r8   r8   r9   resolve_name  s   	zDocumenter.resolve_namec           
      C  s  t | j}|du rtjtd| j| jdd dS | \}}}}}}|dur:|dd }|r7|d	dng }	nd}g }	t
| jj | ||	||\}| _W d   n1 sZw   Y  |scdS || _|| _|| _| jppd| jr{dd| j nd | _d	S )
zDetermine 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.
        Nz!invalid signature for auto%s (%r)autodoctypeF.r   T)py_ext_sig_rer   r   loggerwarningr   objtypegroupsrstriprX   r   r   autodoc_mock_importsr   r   r   r   r   joinr   )
rB   matchedexplicit_modnamer   r   tp_listr   r   r   r   r8   r8   r9   
parse_name  s0   	zDocumenter.parse_nameF
raiseerrorc                 C  s   t | jjX z*t| j| j| j| jd}|\| _| _	| _
| _t| jr)t| j| _W W d   dS  ty] } z |r< tj|jd ddd | j  W Y d}~W d   dS d}~ww 1 saw   Y  dS )	zImport the object given by *self.modname* and *self.objpath* and set
        it as *self.object*.

        Returns True if successful, False if an error occurred.
        
attrgetterNTr   r   r   r   subtypeF)r   r   r   r   r   r   r   r   r.   r   r   r`   r   r   ImportErrorr   r   r   r   note_rereadrB   r   retexcr8   r8   r9   r     s*   




zDocumenter.import_objectc                 C  s   |  | jddp
| jS )zGet the real module name of an object to document.

        It can differ from the name of the module through which the object was
        imported.
        rI   N)r   r`   r   r   r8   r8   r9   get_real_modname  s   zDocumenter.get_real_modnamec                 C  s6   | j jrdS t| j}| |dd}| p|| jkS )z`Check if *self.object* is really defined in the module given by
        *self.modname*.
        TrI   N)rq   imported_membersr   	unpartialr`   r   r   )rB   subjectr   r8   r8   r9   check_module  s
   zDocumenter.check_modulekwargsc                 K  r?   )z}Format the argument signature of *self.object*.

        Should return None if the object does not have a signature.
        r   r8   rB   r   r8   r8   r9   format_args     zDocumenter.format_argsc                 C  s   d | jp| jS )zFormat 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   r8   r8   r9   format_name  s   	zDocumenter.format_namec                 K  s8   |rz	| j di |W S  ty   Y |   S w |   S Nr8   )r  	TypeErrorr  r8   r8   r9   _call_format_args  s   zDocumenter._call_format_argsc              
   K  s   | j durd| j  }| j}nAz d}| jdi |}|r-td|}|r-|d}|d}W n  tyN } ztjt	d| j
|dd d}W Y d}~nd}~ww | jjd	| j| j
| j| j||}|rf|\}}|duru||rrd
|  S d S dS )zFormat 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      z+error while formatting arguments for %s: %sr   r   autodoc-process-signaturez -> %sr   r8   )r   r   r  r   r   group	Exceptionr   r   r   r   r   eventsemit_firstresultr   r`   rq   )rB   r   r   r   r   r   r   r8   r8   r9   format_signature  s8   





zDocumenter.format_signaturesigc           	      C  s   t | dd}t | d| j}|  }|  }d| d| d}t|dD ]\}}| | | | | |dkr?d	t| }q%| jj	sH| jj
rN| d
| | jr\| d| j | dS dS )z>Add the directive header and options to the generated content.domainpydirectivetypez.. :z:: 
r    z   :no-index:z   :module: %sN)getattrr   r  get_sourcenamer   rX   r   lenrq   no_indexr   r   r   )	rB   r  r  r   r   
sourcenameprefixr   sig_liner8   r8   r9   add_directive_header!  s"   zDocumenter.add_directive_headerlist[list[str]] | Nonec                 C  s>   t | j| j| jj| j| j}|r| jjj	j
j}t||gS g S )zDecode and return lines of the docstring(s) for the object.

        When it returns None, autodoc-process-docstring will not be called for this
        object.
        )r   r`   r   r   autodoc_inherit_docstringsr   r   r   statedocumentsettings	tab_widthr   rB   r   r#  r8   r8   r9   get_doc7  s   zDocumenter.get_doc
docstringslist[list[str]]Iterator[str]c              	   c  s\    |D ](}| j jr&| j jd| j| j| j| j| |r&|d dkr&|d |E dH  qdS )z7Let the user process the docstrings before adding them.autodoc-process-docstringr   r   N)r   r   emitr   r   r`   rq   rF   )rB   r&  docstringlinesr8   r8   r9   process_docD  s   

zDocumenter.process_docc                 C  s^   t | jdd rt | jdd r| jj d| jj }n| j}| jr+| jj d| S d| S )NrI   rJ   r   z:docstring of zdocstring of %s)r   r   r`   rI   rJ   r   r   srcname)rB   r   r8   r8   r9   r  S  s   zDocumenter.get_sourcenamemore_contentStringList | Nonec                 C  s  d}|   }| jr@| j }| jr@d| jdd | jd f}||v r@d}t|| g}t| |D ]\}}| ||| q4|re| 	 }	|	du rKn|	sR|	
g  t| |	D ]\}}| ||| qY|rt|j|jddD ]\}}
| ||
d |
d  qpdS dS )	z>Add content from docstrings, attribute documentation and user.Tr   Nr   Fstrictr   r   )r  r   find_attr_docsr   r   listr   r,  r   r%  rF   zipdataitems)rB   r.  r   r  	attr_docsrx   attribute_docstringsr   r   r&  srcr8   r8   r9   add_contenta  s0   

zDocumenter.add_contentwant_alltuple[bool, list[ObjectMember]]c                 C  s   d}t |)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).
        r   r   )rB   r;  r   r8   r8   r9   get_object_members  s   zDocumenter.get_object_membersrs   list[ObjectMember]list[tuple[str, Any, bool]]c                   s  d fdd}g }d	  j} jr j }ni }|D ]^}|j}|j}	|	tu p.||f|v }
zt|	 j j	j
 j|}t|tsDd
} |	dd
}|rZ |dd
}||krZd
}t|tre|jre|j}t|\}}t|}d|v rvd}nd|v r}d}n|d}d}t|	r||f|vrn jjr| jjv rd}n|rt|rƈ jjr| jjv r|dkrd}no|||rd}ng|p jj}n`d}n]||f|v r|r|r jjd
u rd}nJ| jjv }nCd}n@|r|r|s jjr	 jjd
u rd}n*|||rd}n!| jjv }nd}n jjtu r|||rd}n|p" jj}t|tr/|jr/d} jjrK jjd j ||	|  j}|d
urK| }W n# t!yo } zt"j#t$d j%||	|dd d}W Y d
}~nd
}~ww |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   r   r   r6   r>   c                   s    j jpt }t jrB jjD ]0}|j|v r | jkr  dS | |jv r( dS |  	|di v r4 dS t
|trA|j|u rA dS qdS )NTF__annotations__)rq   inherited_membersrb   r   isclassr`   __mro__rH   __dict__r   r   r   r   )r   r   rA  r   r   r8   r9   is_filtered_inherited_member  s   
z?Documenter.filter_members.<locals>.is_filtered_inherited_memberr   Nr   rK   privateTpublicFr   autodoc-skip-memberz`autodoc: failed to determine %s.%s (%r) to be documented, the following exception was raised:
%sr   r   )r   r   r   r   r6   r>   )'r   r   r   r2  rH   r`   INSTANCEATTRr   r   r   r  r   r   r   r   r   r>   
startswithr   rq   exclude_membersspecial_member_rer   special_membersundoc_membersprivate_membersrs   rW   r   r   r   r  r   r  r   r   r   r   rF   )rB   rs   r;  rE  r   	namespacer7  r   r   ry   r   docr   cls_docmetadatahas_doc	isprivatekeep	skip_userr   r8   r   r9   filter_members  s   







zDocumenter.filter_membersall_membersc           
        s>  j jjd< jrjd jjd< |pjjpjjtu }|\}}g }	||D ]A\  fddj
 D }|sEq.|jdd d j  d	d
g jR  }|d j|j}|| f q.jjpwjj}	||	}|D ]\} |jdj|o  d qdjjd< djjd< dS )zGenerate reST for member documentation.

        If *all_members* is True, document all members, else those given by
        *self.options.members*.
        autodoc:moduler   autodoc:classc                   s    g | ]}|  r|qS r8   )r   rS   r   r   ry   mnamerB   r8   r9   rT   >  s    
z/Documenter.document_members.<locals>.<listcomp>c                 S  s   | j S r7   )priority)r   r8   r8   r9   <lambda>D  s    z-Documenter.document_members.<locals>.<lambda>rx   ::r   r   T)rY  real_modnamer   N)r   r   	temp_datar   rq   rA  rs   rW   r=  rX  r   valuessortr   r   r   rF   member_orderr   autodoc_member_ordersort_membersgeneraterc  )
rB   rY  r;  members_check_modulers   memberdocumentersclasses
full_mname
documenterrg  r8   r]  r9   document_members*  s6   
"zDocumenter.document_membersr   list[tuple[Documenter, bool]]orderc                   sd   |dkr|j dd d |S |dkr(| jr&| jj d fd
d}|j |d |S |j dd d |S )zSort the given member list.rg   c                 S  s   | d j | d jfS Nr   )rg  r   er8   r8   r9   r`  \  ra   z)Documenter.sort_members.<locals>.<lambda>ra  rf   entrytuple[Documenter, bool]r6   r|   c                   s$   | d j dd } |t S Nr   rb  r   )r   rX   rv   r  )rv  r   tagorderr8   r9   keyfuncd  s   z(Documenter.sort_members.<locals>.keyfuncc                 S  
   | d j S rs  r   rt  r8   r8   r9   r`  i     
 Nrv  rw  r6   r|   )rf  r   rz  rB   r   rr  r{  r8   ry  r9   ri  W  s   zDocumenter.sort_membersNrc  r   c              
   C  s  |   stjtd| jdd dS |  sdS |  }|p|| _zt	| j| _
| j
  W n+ tyY } ztd| d| _
t| jdd }rO| jj| W Y d}~nd}~ww | jj| j
j | j|krzt	|}| jj|j W n	 ty   Y nw ttj|  pg g }	t| jr|	stjtd| jdd |r|  sdS |  }
| d|
 z|  }W n ty } ztjtd	| j |dd W Y d}~dS d}~ww | !| | d|
 |  j"| j#7  _"| $| | %| dS )
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.
        zdon'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__r   zA mocked object is detected: %rz+error while formatting signature for %s: %s)&r   r   r   r   r   r   r   rc  r   
for_moduler   r2  r   debugr  r.   r   record_dependenciesaddr-  	functoolsreduceoperatoriaddr%  r   r`   r   r  r   r  r  r   r  r   content_indentr:  rp  )rB   r.  rc  r   rY  guess_modnamer   module___file__r   r&  r  r  r8   r8   r9   rj  m  sh   






zDocumenter.generate)r   r   r   r   r   r   r6   r   r   r   ry   r   r   r   r   r>   r   r   r6   r>   )r   )r   r-   r   r   r   r   r6   rD   )r6   r   )r   r   r   r   r   r|   r6   rD   
r   rd   r   r   r   r   r   r   r6   r   r6   r>   Fr   r>   r6   r>   r6   r   r   r   r6   r   r  r   r6   rD   r6   r  )r&  r'  r6   r(  r.  r/  r6   rD   r;  r>   r6   r<  )rs   r>  r;  r>   r6   r?  rY  r>   r6   rD   r   rq  rr  r   r6   rq  NNFF
r.  r/  rc  rd   r   r>   rY  r>   r6   rD   )&rH   rI   rJ   rK   r   r  r_  rg  titles_allowedrp   r   r@  r   classmethodr   r   propertyr   r   r   r   r   r   r   r  r  r  r  r  r%  r,  r  r:  r=  rX  rp  ri  rj  r8   r8   r8   r9   r   4  sR   
 



%






#




'

 
-r   c                      s  e Zd ZU dZdZdZdZi dededede	d	ed
e
de
dededededededededeZded< dH fddZdI fdd ZedJd)d*ZdKd1d2ZdL fd3d4ZdMdN fd7d8ZdOd:d;ZdPd=d>ZdQdAdBZdR fdFdGZ  ZS )SModuleDocumenterz6
    Specialized Documenter subclass for modules.
    r.   r   r   rs   undoc-membersr   inherited-membersshow-inheritancesynopsisplatform
deprecatedmember-orderexclude-membersrt   ru   zimported-memberszignore-module-allno-valuer   r   r   r   r   r6   rD   c                   s    t  j|  t| j d | _d S r7   )r   r   rz   rq   __all__rB   r   r   r8   r9   r     s   

zModuleDocumenter.__init__r.  r/  c                   sf   | j }|  j | j7  _ t d  || _ |r/t|j|jddD ]\}}| ||d |d  qd S d S )NTr0  r   r   )r   _extra_indentr   r:  r4  r5  r6  r   )rB   r.  
old_indentr   r9  r   r8   r9   r:    s   zModuleDocumenter.add_contentr   r   ry   r   r   r   r>   r   c                 C  r?   rM   r8   r   ry   r   r   r   r8   r8   r9   r     r  z$ModuleDocumenter.can_document_memberr   rd   r   r   r   r   c                 C  s*   |d urt jtddd |pd| g fS )Nz*"::" in automodule name doesn't make senser   r   r   )r   r   r   rB   r   r   r   r   r8   r8   r9   r     s
   
zModuleDocumenter.resolve_namec                   s0   t   }| js| jrtjtd| jdd |S )Nz@signature arguments or return annotation given for automodule %sr   r   )r   r   r   r   r   r   r   r   )rB   r   r   r8   r9   r     s   

zModuleDocumenter.parse_nameFr   c              
     st   t  |}z| jjst| j| _W |S W |S  ty9 } zt	j
td|jd | jdd W Y d }~|S d }~ww )NzN__all__ should be a list of strings, not %r (in module %s) -- ignoring __all__r   r   r   )r   r   rq   ignore_module_allr   getallr`   r  ri   r   r   r   r   r   r   r   r8   r9   r   	  s   
zModuleDocumenter.import_objectr  c                 C  sh   t | | |  }| jjr| d| jj | | jjr&| d| jj | | jjr2| d| d S d S )Nz   :synopsis: z   :platform: z   :deprecated:)r   r  r  rq   r  r   r  r  rB   r  r  r8   r8   r9   r    s   z%ModuleDocumenter.add_directive_headerdict[str, ObjectMember]c              	   C  s   | j r| j j}ni }i }t| jD ]0}z%t| j|d}t|r#t|}|d|fg }t||d	|d||< W q t
yA   Y qw t| jD ]}||vrb|d|fg }t|td	|d||< qH|S )zGet members of target module.Nr   r  )r   )r   r7  dirr`   r   r   r   rv   r   r   AttributeErrorr   getannotationsrI  )rB   r7  rs   r   valuer   r8   r8   r9   get_module_members$  s,   

z#ModuleDocumenter.get_module_membersr;  r<  c                 C  s   |   }|r+| jd u rdt| fS | D ]}|j| jvr"d|_qdt| fS | jjp0g }g }|D ]}||v rC|||  q5t	j
tdt| jdd|dd q5d|fS )NTFzHmissing attribute mentioned in :members: option: module %s, attribute %srH   z???r   r   )r  r  r3  re  rH   r   rq   rs   rF   r   r   r   r   r`   )rB   r;  rs   ry   
memberlistr   r   r8   r8   r9   r=  ?  s(   

z#ModuleDocumenter.get_object_membersr   rq  rr  c                   sr   |dkr2| j r2| j d usJ | j  t t |jdd d d fd	d
}|j|d |S t ||S )Nrf   c                 S  r|  rs  r}  rt  r8   r8   r9   r`  c  r~  z/ModuleDocumenter.sort_members.<locals>.<lambda>ra  rv  rw  r6   r|   c                   s*   | d j dd }|v r |S S rx  )r   rX   index)rv  r   
module_allmodule_all_lenmodule_all_setr8   r9   r{  f  s   
z.ModuleDocumenter.sort_members.<locals>.keyfuncr  )r  rb   r  rf  r   ri  r  r   r  r9   ri  Z  s   zModuleDocumenter.sort_membersr   r   r6   rD   r  r  r  r  r  r  r  )r6   r  r  r  )rH   rI   rJ   rK   r   r  r  rZ   rp   rc   r:   rj   r^   r   r@  r   r:  r  r   r   r   r   r  r  r=  ri  r   r8   r8   r   r9   r    sb   
 		



r  c                   @     e Zd ZdZdddZdS )ModuleLevelDocumenterzo
    Specialized Documenter subclass for objects on module level (functions,
    classes, data/constants).
    r   rd   r   r   r   r   r   r6   r   c                 C  sf   |d ur|g ||fS |r| d}|g ||fS | jjd}|s+| jjd}|g ||fS )Nr   rZ  	py:module)r   r   rd  rv   ref_contextr  r8   r8   r9   r   y  s   
z"ModuleLevelDocumenter.resolve_nameNr  rH   rI   rJ   rK   r   r8   r8   r8   r9   r  s      r  c                   @  r  )ClassLevelDocumenterz_
    Specialized Documenter subclass for objects on class level (methods,
    attributes).
    r   rd   r   r   r   r   r   r6   r   c           	      C  s   |d ur|g ||fS |r| d}n| jjd}|d u r.| jjd}|d u r.d g fS |}|d\}}}|g}|sD| jjd}|sM| jjd}|g ||fS )Nr   r[  zpy:classrZ  r  )r   r   rd  rv   r  
rpartition)	rB   r   r   r   r   mod_clsmod_cls_sepr   r8   r8   r9   r     s"   z!ClassLevelDocumenter.resolve_nameNr  r  r8   r8   r8   r9   r    r  r  c                      sT   e Zd ZU dZdZded< g Zded< dd	d
Zd fddZd fddZ	  Z
S )DocstringSignatureMixinz
    Mixin for FunctionDocumenter and MethodDocumenter to provide the
    feature of reading the signature from the docstring.
    Nr  _new_docstringsr   _signaturesr6   $tuple[str | None, str | None] | Nonec                 C  sV  | j d g}t| tr"|d t| jdr"|dd | jjD  |  }|d u r,dS |d d  | _	g | _
d }t|D ]l\}}t|D ]\\}}|sL nU|drX|d }t|}|sa n@| \}	}
}}}}||vrq n0| j}|jjjj}td||d	 d  || j	|< |d u r||f}qD| j
d
| d|  qD|d ur |S q<|S )Nr   r   rC  c                 s  s    | ]}|j V  qd S r7   )rH   r\  r8   r8   r9   	<genexpr>  s    z:DocstringSignatureMixin._find_signature.<locals>.<genexpr>)NN\r  r   (z) -> )r   r   ClassDocumenterrF   hasattrr`   extendrC  r%  r  r  r   endswithr   r   r   r   r   r   r!  r"  r#  r   r   )rB   valid_namesr&  r   r   doclinesjr   r   exmodr   r   r   r   r   r   r#  r8   r8   r9   _find_signature  sH   





z'DocstringSignatureMixin._find_signaturec                   s   | j d ur| j S t  S r7   )r  r   r%  r   r   r8   r9   r%    s   

zDocstringSignatureMixin.get_docr   r   r   c                   sb   |  | j d u r| jjr|  }|d ur|\| _ | _t jdi |}| jr/d|g| jR S |S )Nr  r8   )	r   r   autodoc_docstring_signaturer  r   r   r  r  r   )rB   r   r   r  r   r8   r9   r    s   
z(DocstringSignatureMixin.format_signaturer6   r  r  r  )rH   rI   rJ   rK   r  r@  r  r  r%  r  r   r8   r8   r   r9   r    s   
 
4r  c                      s"   e Zd ZdZd fddZ  ZS )	DocstringStripSignatureMixinzz
    Mixin for AttributeDocumenter to provide the
    feature of stripping any function signature from the docstring.
    r   r   r6   r   c                   s>   | j d u r| jjr|  }|d ur|\}| _t jdi |S r  )r   r   r  r  r   r   r  )rB   r   r   _argsr   r8   r9   r    s   

z-DocstringStripSignatureMixin.format_signaturer  )rH   rI   rJ   rK   r  r   r8   r8   r   r9   r    s    r  c                      sp   e Zd ZdZdZdZed)ddZd*ddZd+d,ddZ	d- fddZ
d* fddZd.d d!Zd/d'd(Z  ZS )0FunctionDocumenterz8
    Specialized Documenter subclass for functions.
    r1      r   r   ry   r   r   r   r   r>   r   r6   c                 C  s(   t |pt |pt |ot|tS r7   )r   
isfunction	isbuiltin	isroutiner   r  r  r8   r8   r9   r     s   z&FunctionDocumenter.can_document_memberr   c              
   K  s   | j jdv r|dd | j jdkr|dd z| jjd| jd tj	| j| j j
d}t|fi |}W n' tyS } zttd	| j| W Y d }~d
S d }~w ty]   d
}Y nw | j jrh|dd}|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_typehintsrw   autodoc_typehints_formatr   r   r*  r`   r   	signatureautodoc_type_aliasesr   r  r   r   r   r   ri   strip_signature_backslashr   )rB   r   r  r   r   r8   r8   r9   r  '  s(   
zFunctionDocumenter.format_argsFrY  rD   c                 C  rE   r7   r8   rB   rY  r8   r8   r9   rp  =  r;   z#FunctionDocumenter.document_membersr  c                   s@   |   }t | t| jst| jr| d| d S d S )N
   :async:)r  r   r  r   iscoroutinefunctionr`   isasyncgenfunctionr   r  r   r8   r9   r  @  s
   z'FunctionDocumenter.add_directive_headerc                   sV  | j jdkr|dd g }| jr$d| j| jjv r$| j jdkr$d}nd}t j	di |}|
| t| jrf| jj D ]%\}}|tu rIq@| ||}|ret| jd}||_dg|_|
|	  q@|r| jd urtj| j| j jd}	t| jd	i }
| jjd| j D ]}| |	|}t||
| j j}t|fi |}|
| qd
|S )Nr  r  Tr   r  Fr   r  __globals__r  r8   )r   r  rw   r   r   r   	overloadsr  r   r  rF   r   is_singledispatch_functionr`   r   r6  annotate_to_first_argumentr  r   r  r  r   merge_default_valuer   r   )rB   r   sigs
overloadedr  typfuncdispatchfuncro  actualr  overloadr   r8   r9   r  G  sD   

z#FunctionDocumenter.format_signaturer  r   r  c                 C  Z   t |j }t|D ]\}}|j|j}|r&|jdkr&|j|jd||< q|j|dS zGMerge default values of actual implementation to the overload variants.z...)default
parametersr3  r  re  r   rv   r   r  r   rB   r  r  r  r   paramactual_paramr8   r8   r9   r  p     z&FunctionDocumenter.merge_default_valuer  r$   r  r   Callable | Nonec              
   C     zt j|| jjd}W n& ty( } zttd| j| W Y d}~dS d}~w t	y1   Y dS w t
|jdkr;dS dd }t|j }|d jtju ro|d j|d|d< z
|j|d|_|W S  ttfyn   Y dS w |S )	?Annotate type hint to the first argument of function if needed.r  r  Nr   c                   S  rE   r7   r8   r8   r8   r8   r9   dummy  r;   z<FunctionDocumenter.annotate_to_first_argument.<locals>.dummy
annotationr  r   r  r   r  r  r   r   r   r   ri   r  r  r3  re  r  r   emptyr   __signature__r  rB   r  r  r  r   r  paramsr8   r8   r9   r  z  4   
z-FunctionDocumenter.annotate_to_first_argumentr  r  r  r  r  r  r   r  r   r6   r   r  r$   r  r   r6   r  )rH   rI   rJ   rK   r   rg  r  r   r  rp  r  r  r  r  r   r8   r8   r   r9   r    s    

)
r  c                      s*   e Zd ZdZdZdZd
 fdd	Z  ZS )DecoratorDocumenterzB
    Specialized Documenter subclass for decorator functions.
    	decoratorr   r   r   r6   r   c                   s"   t  jdi |}d|v r|S dS )NrV   r   r8   )r   r  )rB   r   r   r   r8   r9   r    s   zDecoratorDocumenter.format_argsr  )rH   rI   rJ   rK   r   r_  r  r   r8   r8   r   r9   r    s
    r  zenum.EnumMeta.__call__ztyping.Generic.__new__c                      s0  e Zd ZU dZdZdZeeeeee	e
eeeedZded< dZdZd	ed
< dZded< dI fddZedJddZdKdL fddZdMd!d"ZdNd$d%ZdO fd'd(ZdN fd)d*ZdPd,d-ZdQd/d0ZdR fd2d3ZdSd6d7ZdTd9d:ZdUd<d=ZdV fd@dAZdKdW fdCdDZ 				dXdY fdGdHZ!  Z"S )Zr  z6
    Specialized Documenter subclass for classes.
    r/      )rs   r  r   r  r  r  r  rt   ru   class-doc-fromr   r   r      Nr   _signature_classr   r   _signature_method_namer   r6   rD   c                   sj   t  j|  | jjdkr.| j | _| jjd u r ddg| jd< n| jjd | jjd t| j d S )N	separated__new__r   ru   )	r   r   r   autodoc_class_signaturerq   r   rM  rF   rz   r  r   r8   r9   r     s   zClassDocumenter.__init__r   r   ry   r   r   r>   r   c                 C  s   t |tp|ot |ttB S r7   )r   r   r   r   r  r8   r8   r9   r     s   
z#ClassDocumenter.can_document_memberFr   c                   s   t  |}|rOt| jdr| jd | jjk| _nd| _t| jtt	B rOt
| jd| j}|| jkrO| j|rO| jt|d  dd}|| j | _|| _|S )NrH   r   TrI   r   )r   r   r  r`   r   rH   doc_as_attrr   r   r   r  r   rJ  r  rQ   rX   )rB   r   r   r   basesr   r8   r9   r     s   zClassDocumenter.import_object/tuple[Any | None, str | None, Signature | None]c                   s  t  jttB r
dS d fdd}t jd	r%t  jjtr%d d  jjfS |t jd
}|d ur>|j d|j	 t
v r>d }|d urh jjd|d ztj|d jjd}t jd
|fW S  tyg   Y nw | jd}|d ur|j d|j	 tv rd }|d ur jjd|d ztj|d jjd} jd|fW S  ty   Y nw | jd}|d urՈ jjd|d ztj|d jjd} jd|fW S  ty   Y nw  jjd jd ztj jd jjd}d d |fW S  ty   Y dS w )N)NNNr   r   attrr   r6   c                   s:   t | |rdS  | |d}t |st |sdS |S )zDGet the `attr` function or method from `obj`, if it is user-defined.N)r   is_builtin_class_methodr   ismethodr  )r   r(  r   r8   r9   #get_user_defined_function_or_method  s   zKClassDocumenter._get_signature.<locals>.get_user_defined_function_or_methodr  __call__r   r  Tbound_methodr  r#  r   F)r   r   r(  r   r6   r   )r   r`   r   r   r  r  r   r   rI   rJ   _METACLASS_CALL_BLACKLISTr   r   r*  r   r  r   r  ri   _CLASS_NEW_BLACKLIST)rB   r+  callr  newrl   r8   r   r9   _get_signature  sp   
zClassDocumenter._get_signaturer   c              
   K  s   | j jdv r|dd | j jdkr|dd z
|  \| _}}W n ty? } ztt	d| j
| W Y d }~dS d }~ww |pCd| _|d u rKdS t|fd	di|S )
Nr  r  Fr  r  Tz0Failed to get a constructor signature for %s: %sr   show_return_annotation)r   r  rw   r  r3  r   r  r   r   r   r   r!  r   )rB   r   r!  r  r   r8   r8   r9   r  K  s"   

zClassDocumenter.format_argsr  c                   sR   t   }|d ur|d d f}t| jD ]\}}|dr&|d d | j|< q|S )Nr   z -> Nonei)r   r  r   r  r  )rB   r   r   r  r   r8   r9   r  _  s   

zClassDocumenter._find_signaturec           	        s   | j rdS | jjdkrdS | jjdkr|dd t  }g }|  }|rh| jjdkrht	| j
| jd }t	|di }|D ]*}t||| jj}t|j }|j|dd  tjd	}t|fi |}|| q<n|| d
|S )Nr   r"  r  r  Tr  r  r   )r  return_annotationr  )r%  r   r$  r  rw   r   r  get_overloaded_signaturesr  r   r   r!  r   r  r3  r  re  r   r   r  r   rF   r   )	rB   r   r  r  r  r2   r  r  r  r   r8   r9   r  m  s2   



z ClassDocumenter.format_signaturelist[Signature]c              	   C  s   | j rD| jrD| j jD ]9}z.t|j}|  |j d| j }||jv r/|j	|g W   S ||j
v r9g W   S W q
 tyC   Y q
w g S )Nr   )r   r!  rC  r   r  rI   analyzerJ   r  rv   rz  r   )rB   r   r   qualnamer8   r8   r9   r6    s   


z)ClassDocumenter.get_overloaded_signaturesrd   c                 C  s^   t | jd| j}t | jdd }|d u rt | jdd }|r"d|v r"d }|r-|r-| d| S d S )NrI   rJ   rH   z<locals>r   )r   r`   r   )rB   __modname__rJ   r8   r8   r9   get_canonical_fullname  s   z&ClassDocumenter.get_canonical_fullnamer  c                   sh  |   }| jr
d| _t | t| jttB rd S | j	r-d
| j| j	jv r-| d| |  }| jsIt| jtsI|rI| j|krI| d| | | js| jjrt| jr]t| jj}nt| jdrpt| jjrpt| jj}ng }| jjd| j| j| j| | jjdkrdd	 |D }nd
d	 |D }|   }| d| | dtdd
|  | d S d S d S )Nr3   r   
   :final:z   :canonical: %s	__bases__autodoc-process-basesr  c                 S  s   g | ]}t |d qS )smartr"   r\  r8   r8   r9   rT         z8ClassDocumenter.add_directive_header.<locals>.<listcomp>c                 S  s   g | ]}t |qS r8   r@  r\  r8   r8   r9   rT     ra   r   r   z	Bases: %s, )r  r%  r  r   r  r   r`   r   r   r   r   r   finalsr   r;  r   rq   show_inheritancer   getorigbasesr3  __orig_bases__r  r  r=  r   r  r*  r   r  r   )rB   r  r  canonical_fullnamer&  base_classesr   r8   r9   r    s<   

"z$ClassDocumenter.add_directive_headerr;  r<  c                   s   t  j j j jj}|s; jjsdg fS g } jjD ]}||v r*|||  qt	j
td| jdd qd|fS  jjrGdt| fS d fdd| D fS )NFz!missing attribute %s in object %sr   r   c                   s   g | ]
}|j  jkr|qS r8   )r   r`   )rS   mr   r8   r9   rT     rU   z6ClassDocumenter.get_object_members.<locals>.<listcomp>)r   r`   r   r   r   r  rq   rs   rF   r   r   r   r   rA  r3  re  )rB   r;  rs   selectedr   r8   r   r9   r=    s"   
z"ClassDocumenter.get_object_membersr  c                   sh  t | jtr| jjtjkrg S | jr|  rg S d S t| dd }|d ur&|S | jd| j	j
}g }t| j| j}|r?|| |dv r| | jdd }t|| j| j	j| jd}|d urk|tjjksi| tjjkrkd }|s| | jdd }t|| j| j	j| jd}|d ur|tjjks| tjjkrd }|r|dkr|g}n|| | jjjjj  fdd|D S )	Nr  r  )rk   rl   r   r#  rl   c                   s   g | ]}t | qS r8   )r   )rS   r   r#  r8   r9   rT     rA  z+ClassDocumenter.get_doc.<locals>.<listcomp>)r   r`   r   rK   r%  get_variable_commentr  rq   rv   r   autoclass_contentr   r   rF   r  r   rQ   r#  r   r   r!  r"  r#  )rB   r   classdoc_fromr&  attrdocstringr   initdocstringr#  r8   rK  r9   r%    sR   

zClassDocumenter.get_doclist[str] | Nonec                 C  sd   z'dd | jf}| jrt| j}nt|  }|  t|j	
|g W S  ty1   Y d S w )Nr   r   )r   r   r%  r   r  r   r   r8  r3  r7  rv   r   )rB   rx   r   r8   r8   r9   rL     s   z$ClassDocumenter.get_variable_commentr.  r/  c                   s  t | jtr&| jjdkrt| jjd}nt| jj}ttd| dgdd}t | jt	rt
| jjg}| jjD ]}| jjdkrH|t|d q7|t| q7| jjro| jjdkrbt| jjd}nt| jj}|d|  | jjrx|d | jjr|d ttd	d
| dgdd}| jr| j|  krzt| j| _| j  W n	 ty   Y nw | jr|  sz| jjdkrt| jd}nt| j}ttd| gdd}W n	 ty   Y nw t | d S )Nr  r?  alias of %sr   )r   zbound=\ zcovariant=Truezcontravariant=Truezalias of TypeVar(%s)rB  )r   r`   r   r   r  r"   __supertype__r	   r   r   reprrH   __constraints__rF   r#   	__bound____covariant____contravariant__r   r%  r   r   r   r  r   r8  r   rL  r  r   r:  )rB   r.  	supertypeattrs
constraintboundaliasr   r8   r9   r:  ,  sR   


zClassDocumenter.add_contentrY  c                   s   | j rd S t | d S r7   )r%  r   rp  r  r   r8   r9   rp  ^  s   z ClassDocumenter.document_membersrc  r   c                   s   t  j|||dS )N)r.  r   rY  )r   rj  )rB   r.  rc  r   rY  r   r8   r9   rj  c  s   zClassDocumenter.generater  r  r  r  )r6   r'  r  r  )r6   r7  )r6   rd   r  r  r  )r6   rQ  r  r  r  r  )#rH   rI   rJ   rK   r   rg  rZ   rp   rc   rj   r^   rm   r   r@  r_  r   r!  r   r  r   r   r3  r  r  r  r6  r;  r  r=  r%  rL  r:  rp  rj  r   r8   r8   r   r9   r    sH   
 

R
 

*

62r  c                   @  s0   e Zd ZdZdZdZejd ZedddZ	dS )ExceptionDocumenterz>
    Specialized ClassDocumenter subclass for exceptions.
    r0   
      r   r   ry   r   r   r   r   r>   r   r6   c              
   C  sR   zt |to
t|tW S  ty( } z| j d| d| d}t||d }~ww )Nz failed to discern if member z with membername z is a BaseException subclass.)r   r   
issubclassBaseExceptionr  rH   ri   )r   ry   r   r   r   r   r   r8   r8   r9   r     s   
z'ExceptionDocumenter.can_document_memberNr  )
rH   rI   rJ   rK   r   rg  r  r_  r  r   r8   r8   r8   r9   r^  t  s    
r^  c                   @  s\   e Zd ZU ded< ded< ded< ded< ded	< d
ed< dddZdddZdddZdS )DataDocumenterMixinBaser   r   r,   r   r   r   r   r   r`   r   r   r6   r>   c                 C  r?   )z,Check directive header should be suppressed.Fr8   r   r8   r8   r9    should_suppress_directive_header     z8DataDocumenterMixinBase.should_suppress_directive_headerc                 C  r?   )z*Check :value: header should be suppressed.Fr8   r   r8   r8   r9   should_suppress_value_header  re  z4DataDocumenterMixinBase.should_suppress_value_headerr.  r	   rD   c                 C  r?   )z4Update docstring, for example with TypeVar variance.Nr8   rB   r.  r8   r8   r9   update_content  re  z&DataDocumenterMixinBase.update_contentNr  r.  r	   r6   rD   )rH   rI   rJ   r@  rd  rf  rh  r8   r8   r8   r9   rc    s   
 

rc  c                      s0   e Zd ZdZd fddZd fd	d
Z  ZS )GenericAliasMixinzt
    Mixin for DataDocumenter and AttributeDocumenter to provide the feature for
    supporting GenericAliases.
    r6   r>   c                   s   t | jp
t  S r7   )r   isgenericaliasr`   r   rd  r   r   r8   r9   rd       z2GenericAliasMixin.should_suppress_directive_headerr.  r	   rD   c                   s`   t | jr(| jjdkrt| jd}nt| j}|td| d |dd t 	| d S )Nr  r?  rR  r   )
r   rk  r`   r   r  r"   rF   r   r   rh  )rB   r.  r]  r   r8   r9   rh    s   
z GenericAliasMixin.update_contentr  ri  )rH   rI   rJ   rK   rd  rh  r   r8   r8   r   r9   rj    s    rj  c                      @   e Zd ZdZdd fddZd fdd	Zd fddZ  ZS ) UninitializedGlobalVariableMixinz
    Mixin for DataDocumenter to provide the feature for supporting uninitialized
    (type annotation only) global variables.
    Fr   r>   r6   c                   s   zt  jddW S  ty{ } zgzCt| jj3 t| j}t|d | jj	dd}| j
d |v rCt| _|| _	 W d    W W Y d }~dS W d    n1 sMw   Y  W n	 ty\   Y nw |r` tj|jd ddd | j  W Y d }~d	S d }~ww )
NTr   include_extrasr   r   r   r   r   F)r   r   r   r   r   r   r   r   r!   r  r   UNINITIALIZED_ATTRr`   r   r   r   r   r   r   )rB   r   r   r   r   r   r8   r9   r     s8   
	
z.UninitializedGlobalVariableMixin.import_objectc                      | j tu p	t  S r7   r`   rr  r   rf  r   r   r8   r9   rf       
z=UninitializedGlobalVariableMixin.should_suppress_value_headerr  c                   s   | j tu rg S t  S r7   r`   rr  r   r%  r   r   r8   r9   r%       

z(UninitializedGlobalVariableMixin.get_docr  r  r  r  rH   rI   rJ   rK   r   rf  r%  r   r8   r8   r   r9   rn    s
    rn  c                      s   e Zd ZU dZdZdZdZeej	Z	de
d< ee	d< ee	d< ed1ddZd2ddZd3d4 fddZd5 fddZd6 fdd Zd3d7d"d#Zd8d$d%Zd9d(d)Zd: fd+d,Zd; fd/d0Z  ZS )<DataDocumenterz9
    Specialized Documenter subclass for data items.
    r5  (   ir   r   r  r  r   r   ry   r   r   r   r   r>   r   r6   c                 C  s   t |to|S r7   )r   r  r  r8   r8   r9   r     s   z"DataDocumenter.can_document_memberrD   c                 C  st   t t|}||_z%t| j}|  |j	 D ]\\}}}|dkr,||vr,|||< qW dS  t
y9   Y dS w )9Update __annotations__ to support type_comment and so on.r   N)rr   r   r  r@  r   r  r   r8  r   r6  r   )rB   r   r   r   	classnameattrnamer  r8   r8   r9   update_annotations  s   z!DataDocumenter.update_annotationsFr   c                   s"   t  |}| jr| | j |S r7   )r   r   r   r~  rB   r   r   r   r8   r9   r     s   zDataDocumenter.import_objectc                   sH   t   rdS |  pg }tdttj|g \}}d|v r"dS dS NTr  z
hide-valueF	r   rf  r%  r   r   r  r  r  r  rB   rQ  r   rS  r   r8   r9   rf    s   
z+DataDocumenter.should_suppress_value_headerr  c                     t  | |  }| jjtu s|  rd S | jjr&| d| jj | d S | jj	dkrct
| jd | jjdd}| jd |v rc| jjdkrPt|| jd d}nt|| jd d}| d	| | z | jjsq|  sqt| jrtW d S t| j}| d
| | W d S  ty   Y d S w Nz   :annotation: %sr  Trp  r   r  r?  fully-qualified-except-typing
   :type: z   :value: r   r  r  rq   r  rn   rd  r   r   r  r!   r   r  r   r  r#   rv   no_valuerf  r   r`   r   ri   rB   r  r  r   objreprr   r8   r9   r    s@   
z#DataDocumenter.add_directive_headerrY  c                 C  rE   r7   r8   r  r8   r8   r9   rp  ;  r;   zDataDocumenter.document_membersc                 C      |  | jp| jdd }|p| jS NrI   r   r   r`   r   rB   rc  r8   r8   r9   r   >     
zDataDocumenter.get_real_modnamer}  rQ  c                 C  sR   zt | j}|  d|f}||jv rt|j| W S W d S  ty(   Y d S w r   )r   r  r   r8  r7  r3  r   )rB   r}  r   rx   r8   r8   r9   get_module_commentB  s   
z!DataDocumenter.get_module_commentr  c                   s$   |  | jd }|r|gS t  S )Nr   )r  r   r   r%  )rB   commentr   r8   r9   r%  N  s   
zDataDocumenter.get_docr.  r/  c                   s*   d | _ |st }| | t | d S r7   r   r	   rh  r   r:  rg  r   r8   r9   r:  V  s
   
zDataDocumenter.add_contentr  r   r   r6   rD   r  r  r  r  r  r  )r}  r   r6   rQ  r  r  )rH   rI   rJ   rK   r   rg  r_  rr   r  r   r@  ro   rp   r  r   r~  r   rf  r  rp  r   r  r%  r:  r   r8   r8   r   r9   ry    s&   
 
!

ry  c                      s   e Zd ZdZdZdZdZdZed0ddZ	d1d2 fddZ
d3ddZd4 fddZd1d5ddZd3 fdd Zd6d$d%Zd7d+d,Zd8 fd.d/Z  ZS )9MethodDocumenterzQ
    Specialized Documenter subclass for methods (normal, static and class).
    r2   2   r   r   r   ry   r   r   r   r   r>   r   r6   c                 C  s   t |o
t|t S r7   )r   r  r   r  r  r8   r8   r9   r   l  s   z$MethodDocumenter.can_document_memberFr   c                   s`   t  |}|s
|S | jj| j}|d u r| j}t|s(tj	|| j| jdr.| j
d | _
|S )Nr   r   r   )r   r   r   rD  rv   r   r`   r   isclassmethodisstaticmethodrg  )rB   r   r   r   r   r8   r9   r   r  s   
zMethodDocumenter.import_objectr   c              
   K  s4  | j jdv r|dd | j jdkr|dd zN| jtjkr'| jtkr'd}n>tj| j| j| j	drH| j
jd	| jd tj| jd| j jd
}n| j
jd	| jd tj| jd| j jd
}t|fi |}W n' ty } zttd| j| W Y d }~dS d }~w ty   d}Y nw | j jr|dd}|S )Nr  r  Fr  r  Tz()r  r  r-  +Failed to get a method signature for %s: %sr   r  r  )r   r  rw   r  r`   r   r   r   r  r   r   r   r*  r  r  r   r  r   r   r   r   ri   r  r   )rB   r   r   r  r   r8   r8   r9   r    s<   


zMethodDocumenter.format_argsr  rD   c                   s   t  | |  }| jj| j| j}t	|r| 
d| t|s)t|r/| 
d| t|s?t|rEt|jrE| 
d| tj|| j| jdrU| 
d| | jrjd| j| jjv rl| 
d| d S d S d S )N   :abstractmethod:r     :classmethod:r  z   :staticmethod:r   r<  )r   r  r  r   rD  rv   r   r`   r   isabstractmethodr   r  r  r  is_singledispatch_methodr  r  r   r   r   rC  )rB   r  r  r   r   r8   r9   r    s$   


z%MethodDocumenter.add_directive_headerrY  c                 C  rE   r7   r8   r  r8   r8   r9   rp    r;   z!MethodDocumenter.document_membersc                   s  | j jdkr|dd g }| jr$d| j| jjv r$| j jdkr$d}nd}t j	di |}|
| | jj| jd }t|r{|jj D ]1\}}|tu rRqIt|rZ|j}| ||}|rzt| jd}	| j|	_||	_dg|	_|
|		  qI|r| jd urtj| j| j| jd	rtj| jd| j jd
}
ntj| jd| j jd
}
t| jdi }| jjd| j D ]9}| |
|}t||| j j}tj| j| j| jd	st |j!" }|j#|dd  d}t$|fi |}|
| qd|S )Nr  r  Tr   r  Fr   r   r  r-  r  r   r  r  r8   )%r   r  rw   r   r   r   r  r  r   r  rF   r   rD  rv   r   r  
dispatcherr   r6  r`   r  __func__r  r  r   r  r   r  r  r   r  r   r3  r  re  r   r   )rB   r   r  r  r  methr  r  dispatchmethro  r  r  r  r  r   r8   r9   r    s^   





z!MethodDocumenter.format_signaturer  r   r  c                 C  r  r  r  r	  r8   r8   r9   r    r  z$MethodDocumenter.merge_default_valuer  r$   r  r   r  c              
   C  r  )	r  r  r  Nr   c                   S  rE   r7   r8   r8   r8   r8   r9   r  	  r;   z:MethodDocumenter.annotate_to_first_argument.<locals>.dummyr  r  r  r  r8   r8   r9   r    r  z+MethodDocumenter.annotate_to_first_argumentr  c                   s  | j d ur| j S | jd dkrCt| j| j| jj| j| j}|d ur1|tj	j
ks/| tj	j
kr1d }|rA| jjjjj}t||dgS g S | jd dkr~t| j| j| jj| j| j}|d url|tjj
ksj| tjj
krld }|r|| jjjjj}t||dgS g S t  S )Nr   r   )tabsizer#  )r  r   r   r`   r   r   r  r   r   r   rK   rQ   r   r   r!  r"  r#  r   r#  r   r%  r$  r   r8   r9   r%  	  s:   



zMethodDocumenter.get_docr  r  r  r  r  r  r  r  r  )rH   rI   rJ   rK   r   r  rg  r_  r  r   r   r  r  rp  r  r  r  r%  r   r8   r8   r   r9   r  b  s     
#
6

r  c                      rm  )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   r>   r6   c                   s0   t  |}|rt| jsd| _|S d| _|S )NTF)r   r   r   isattributedescriptorr`   non_data_descriptorr  r   r8   r9   r   F	  s   z$NonDataDescriptorMixin.import_objectc                   s   t | dd pt  S Nr  F)r  r   rd  r   r   r8   r9   rf  O	  s   z3NonDataDescriptorMixin.should_suppress_value_headerr  c                   s   t | ddrd S t  S r  )r  r   r%  r   r   r8   r9   r%  S	  s   
zNonDataDescriptorMixin.get_docr  r  r  r  rx  r8   r8   r   r9   r  =	  s
    	r  c                      sJ   e Zd ZdZdddZdd fdd	Zd fd
dZd fddZ  ZS )
SlotsMixinzX
    Mixin for AttributeDocumenter to provide the feature for supporting __slots__.
    r6   r>   c              	   C  s@   zt | j }r| jd |v W S W dS  ttfy   Y dS w )z/Check the subject is an attribute in __slots__.r   F)r   getslotsr   r   ri   r  )rB   parent___slots__r8   r8   r9   isslotsattributea	  s   zSlotsMixin.isslotsattributeFr   c                   s   t  |}|  rt| _|S r7   )r   r   r  	SLOTSATTRr`   r  r   r8   r9   r   k	  s   zSlotsMixin.import_objectc                   s   | j tu rdS t  S r@   )r`   r  r   rf  r   r   r8   r9   rf  r	  rw  z'SlotsMixin.should_suppress_value_headerr  c              
     s   | j tu rEzt| j}|r || jd  }r t|}|gW S g W S  tyD } zt	j
td| jj|fdd g W  Y d }~S d }~ww t  S )Nr   z'Invalid __slots__ found on %s. Ignored.r   r   )r`   r  r   r  r   rv   r   r   ri   r   r   r   rJ   r   r%  )rB   r  r   r   r   r8   r9   r%  x	  s   


zSlotsMixin.get_docr  r  r  r  )	rH   rI   rJ   rK   r  r   rf  r%  r   r8   r8   r   r9   r  \	  s    

r  c                      sZ   e Zd ZdZe ZdddZddd	Zdd fddZd fddZ	d fddZ
  ZS )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.
    r   r   r6   r>   c                 C  s    |  || jd rdS | |S )z8Check the subject is an attribute defined in __init__().r   T)get_attribute_commentr   +is_runtime_instance_attribute_not_commented)rB   r   r8   r8   r9   is_runtime_instance_attribute	  s   
z;RuntimeInstanceAttributeMixin.is_runtime_instance_attributec              
   C  s   t |D ]:}z-t|d}t|d}t|}|  |r3| jr3| d| jd  }||jv r3W  dS W q tt	fy?   Y qw dS )zHCheck the subject is an attribute defined in __init__() without comment.rI   rJ   r   r   TF)
r   getmror   r   r  r8  r   rz  r  r   )rB   r   r   r.   r9  r   rx   r8   r8   r9   r  	  s   




zIRuntimeInstanceAttributeMixin.is_runtime_instance_attribute_not_commentedFr   c                   s   zt  jddW S  ty~ } zjzFt| jj6 t| j| jdd d| jd}|d }| 	|rF| j
| _|| _	 W d   W W Y d}~dS W d   n1 sPw   Y  W n	 ty_   Y nw |rc tj|jd d	d
d | j  W Y d}~dS d}~ww )ziCheck the existence of runtime instance attribute after failing to import the
        attribute.
        Tro  Nr   r/   r      r   r   r   r   F)r   r   r   r   r   r   r   r   r   r  RUNTIME_INSTANCE_ATTRIBUTEr`   r   r   r   r   r   r   rB   r   r   r   r   r   r8   r9   r   	  s8   


z+RuntimeInstanceAttributeMixin.import_objectc                   s   | j | ju p
t  S r7   )r`   r  r   rf  r   r   r8   r9   rf  	  rl  z:RuntimeInstanceAttributeMixin.should_suppress_value_headerr  c                   s&   | j | ju r| | jrd S t  S r7   )r`   r  r  r   r   r%  r   r   r8   r9   r%  	  s
   

z%RuntimeInstanceAttributeMixin.get_docr   r   r6   r>   r  r  r  r  )rH   rI   rJ   rK   r`   r  r  r  r   rf  r%  r   r8   r8   r   r9   r  	  s    

r  c                      sJ   e Zd ZdZdddZdd fd
dZd fddZd fddZ  ZS )#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.
    r   r   r6   r>   c                 C  s"   t |d| jjdd}| jd |v S )z2Check the subject is an annotation only attribute.NTrp  r   )r!   r   r  r   )rB   r   r   r8   r8   r9   #is_uninitialized_instance_attribute	  s   zGUninitializedInstanceAttributeMixin.is_uninitialized_instance_attributeFr   c                   s   zt  jddW S  ty` } zLz(t| j| jdd d| jd}|d }| |r7t| _|| _	W W Y d}~dS W n	 tyA   Y nw |rE t
j|jd d	d
d | j  W Y d}~dS d}~ww )mCheck the existence of uninitialized instance attribute when failed to import
        the attribute.
        Tro  Nr   r/   r   r  r   r   r   r   F)r   r   r   r   r   r   r  rr  r`   r   r   r   r   r   r   r  r   r8   r9   r   	  s0   

z1UninitializedInstanceAttributeMixin.import_objectc                   rs  r7   rt  r   r   r8   r9   rf  
  ru  z@UninitializedInstanceAttributeMixin.should_suppress_value_headerr  c                   s   | j tu rd S t  S r7   rv  r   r   r8   r9   r%  
  s   

z+UninitializedInstanceAttributeMixin.get_docr  r  r  r  r  )	rH   rI   rJ   rK   r  r   rf  r%  r   r8   r8   r   r9   r  	  s    

r  c                      s   e Zd ZU dZdZdZeejZde	d< e
ed< eed< dZed4ddZed5ddZd6d7ddZd8ddZd6d9 fd d!Zd:d"d#Zd; fd$d%Zd< fd'd(Zd=d+d,Zd> fd.d/Zd? fd2d3Z  ZS )@AttributeDocumenterz9
    Specialized Documenter subclass for attributes.
    r3   <   r   r   r  r  r_  r   r   r6   r>   c                 C  s   t | pt | pt | S r7   )r   r  r  r*  )r   r8   r8   r9   is_function_or_method
  s   z)AttributeDocumenter.is_function_or_methodr   r   ry   r   r   r   r   c                 C  s4   t |trdS t|rdS t| ot |t S )NFT)r   r  r   r  r  r   r  r8   r8   r9   r   "
  s
   

z'AttributeDocumenter.can_document_memberFrY  rD   c                 C  rE   r7   r8   r  r8   r8   r9   rp  ,
  r;   z$AttributeDocumenter.document_membersc           
   
   C  s   zMt t|}||_t|D ]:}z-t|d}t|d}t|}|  |j	
 D ]\\}}}	||kr=||vr=|	||< q+W q ttfyJ   Y qw W dS  ttfyY   Y dS w )r{  rI   rJ   N)rr   r   r  r@  r  r   r   r  r8  r   r6  r  r   r  )
rB   r   r   r   r.   r9  r   r|  r}  r  r8   r8   r9   r~  /
  s*   


z&AttributeDocumenter.update_annotationsr   c                   s8   t  |}t| jr| jj| _| jr| | j |S r7   )r   r   r   isenumattributer`   r  r   r~  r  r   r8   r9   r   E
  s   
z!AttributeDocumenter.import_objectc                 C  r  r  r  r  r8   r8   r9   r   N
  r  z$AttributeDocumenter.get_real_modnamec                   sH   t   rdS |  }|r"tdttj|g \}}d|v r"dS dS r  r  r  r   r8   r9   rf  R
  s   
z0AttributeDocumenter.should_suppress_value_headerr  c                   r  r  r  r  r   r8   r9   r  _
  s<   
z(AttributeDocumenter.add_directive_headerr}  rQ  c              
   C  s   t |D ]:}z-t|d}t|d}t|}|  |r3| jr3||f}||jv r3t|j| W   S W q t	t
fy?   Y qw d S )NrI   rJ   )r   r  r   r   r  r8  r   r7  r3  r  r   )rB   r   r}  r   r.   r9  r   rx   r8   r8   r9   r  
  s   




z)AttributeDocumenter.get_attribute_commentr  c                   sN   |  | j| jd }|r|gS z| jj}d| j_t  W || j_S || j_w )Nr   F)r  r   r   r   r  r   r%  )rB   r  origr   r8   r9   r%  
  s   
zAttributeDocumenter.get_docr.  r/  c                   s.   d | _ |d u r
t }| | t | d S r7   r  rg  r   r8   r9   r:  
  s
   
zAttributeDocumenter.add_content)r   r   r6   r>   r  r  r  r  r  r  r  r  )r   r   r}  r   r6   rQ  r  r  )rH   rI   rJ   rK   r   rg  rr   r  r   r@  ro   rp   r_  staticmethodr  r  r   rp  r~  r   r   rf  r  r  r%  r:  r   r8   r8   r   r9   r  
  s*   
 	

	
 r  c                      s   e Zd ZdZdZdZejd Zed$ddZ	d%d& fddZ
d' fddZd%d(ddZd)ddZd* fdd Zd+d"d#Z  ZS ),PropertyDocumenterz9
    Specialized Documenter subclass for properties.
    r  r  r   r   r   ry   r   r   r   r   r>   r   r6   c                 C  sJ   t |tr#t|rdS t|jdi }||}t |to"t|jS dS )NTrD  F)	r   r  r   
ispropertyr   r`   rv   r  r  )r   ry   r   r   r   rD  r   r8   r8   r9   r   
  s   


z&PropertyDocumenter.can_document_memberFr   c                   sp   t  |}|r3t| js3t| jdi }|| jd }t	|t
r1t|jr1|j| _d| _dS dS d| _|S )r  rD  r   TF)r   r   r   r  r`   r   r   rv   r   r   r  r  r  )rB   r   r   rD  r   r   r8   r9   r   
  s   z PropertyDocumenter.import_objectr   c                   s8   |   }|d u r
dS | jjd|d t jdi |S )Nr   r  Fr8   )_get_property_getterr   r   r*  r   r  )rB   r   r  r   r8   r9   r  
  s
   zPropertyDocumenter.format_argsrY  rD   c                 C  rE   r7   r8   r  r8   r8   r9   rp  
  r;   z#PropertyDocumenter.document_membersc                 C  r  r  r  r  r8   r8   r9   r   
  r  z#PropertyDocumenter.get_real_modnamer  c              
     s  t  | |  }t| jr| d| | jr| d| |  }|d u s-| j	j
dkr/d S z0tj|| j	jd}|jtjur]| j	jdkrLt|jd}nt|jd}| d| | W d S W d S  ty| } zttd	| j| W Y d }~d S d }~w ty   Y d S w )
Nr  r  r  r  r  r?  r  r  r  )r   r  r  r   r  r`   r   r  r  r   r  r  r  r5  r   r  r  r#   r  r   r   r   r   ri   )rB   r  r  r  r  r  r   r   r8   r9   r  
  s<   
z'PropertyDocumenter.add_directive_headerr  c                 C  s0   t | jdd r| jjS t | jdd r| jjS d S )Nfgetr  )r   r`   r  r  r   r8   r8   r9   r    s
   z'PropertyDocumenter._get_property_getterr  r  r  r  r  r  r  )r6   r  )rH   rI   rJ   rK   r   rg  r  r_  r  r   r   r  rp  r   r  r  r   r8   r8   r   r9   r  
  s    


r  r   r+   r   r   r   c                 G  sH   | j j D ]\}}t||r|||g|R    S qt||g|R  S )zAlternative getattr() for types)r   autodoc_attrgettersr6  r   r   )r   r   r   r   r  r  r8   r8   r9   r     s
   
r   r   c              
   C  s  |  t |  t |  t |  t |  t |  t |  t |  t |  t	 | 
dddtddd | 
dddtddd	 | 
d
ddtdd | 
di d | 
ddd | 
dg d | 
dddtdddd | 
dddtddd | 
di d | 
dddtdd | 
ddd | 
ddd | d | d  | d! | d" | d# | d$ | d% | d& tjdd'S )(NrM  r/   r   rk   rl   rh  re   rf   rg   r$  mixedr"  autodoc_default_optionsr  Tr   r  r  r  r  $autodoc_typehints_description_targetall
documenteddocumented_paramsr  r  r  zfully-qualifiedautodoc_warningiserrorr  r  r)  r	  rH  r>  z$sphinx.ext.autodoc.preserve_defaultszsphinx.ext.autodoc.type_commentzsphinx.ext.autodoc.typehints)versionparallel_read_safe)add_autodocumenterr  r  r^  ry  r  r  r  r  r  add_config_valuer
   	add_eventsetup_extensionsphinx__display_version__)r   r8   r8   r9   setup  sL   






















r  )r5   r   r6   r   )rN   r   r6   rO   )rN   r   r6   r[   )rN   r   r6   r_   )rN   r   r6   rd   )rN   r   r6   r   )rN   r   r6   r>   )rq   rr   r6   rD   )r   N)r{   r|   r}   r|   r~   r   r6   r4   )NFF)
r   r   r~   r   r   r>   r   r>   r6   r4   )
r   r+   r   r   r   r   r   r   r6   r   )r   r+   r6   r   )rK   
__future__r   r  r  r   r   r   r   typingr   r   r   r   docutils.statemachiner	   r  sphinx.configr
   r   sphinx.errorsr   sphinx.ext.autodoc.importerr   r   r   sphinx.ext.autodoc.mockr   r   r   sphinx.localer   r   sphinx.pycoder   sphinx.utilr   sphinx.util.docstringsr   r   sphinx.util.inspectr   r   r   r   r   sphinx.util.typingr   r    r!   r"   r#   collections.abcr$   r%   r&   typesr'   r(   r)   r*   sphinx.applicationr+   sphinx.environmentr,   sphinx.ext.autodoc.directiver-   r   r   rr   r>   r3  r4   r@  	getLoggerrH   r   r   __subclasses__MethodDescriptorTyper   VERBOSEr   rL  r:   r<   rL   rW   r]   r`   rr  rI  r  rZ   r^   rc   rj   rm   rn   ro   rp   rz   r   r   r   r   r   r  r  r  r  r  r  r  r/  r0  r  r^  rc  rj  rn  ry  r  r  r  r  r  r  r  r   r  r8   r8   r8   r9   <module>   s    


	












-0     ! $$R    >)| \-N5  
b	