HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sphinx/ext/autosummary/__pycache__/__init__.cpython-310.pyc
o

o�ax�@sDdZddlZddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZddlmZddlmZmZmZdd	lmZdd
lmZmZmZddlm Z ddl!Z!ddl!m"Z"dd
l#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl;m<Z<ddl=m>Z>m?Z?ddl@mAZAddlBmCZCmDZDddlEmFZFmGZGmHZHmIZImJZJddlKmLZLddlMmNZNddlOmPZPddlQmRZReC�SeT�ZUe�Vd �ZWe�Vd!�ZXd"ZYGd#d$�d$ejZ�Z[d%e$d&ej\d'dfd(d)�Z]d*ej^d+e[d'dfd,d-�Z_d*ej^d+ed'dfd.d/�Z`Gd0d1�d1ejZ�Zad*eRd+ead'dfd2d3�Zbe*d4d5die)i�Gd6d7�d7�ZcGd8d9�d9e3�Zdd%e$d:ed;ed'ee1fd<d=�ZeGd>d?�d?eG�Zfd@egd'egfdAdB�Zhd@egd'egfdCdD�ZidgdFegdGejd'egfdHdI�ZkdJeegdKed'egfdLdM�Zl	E	NdhdOegdPeegdGejdQegd'egf
dRdS�ZmdTe,d'eegfdUdV�ZndgfdWegdXeegd'eegeeegffdYdZ�ZodWegd'eeeegffd[d\�ZpdgfdWegdXeegd'eegeeegffd]d^�ZqGd_d`�d`eH�Zrd%e$d'egfdadb�Zsd%e$d'dfdcdd�Ztd%e$d'e
egeffdedf�ZudS)ia�
    sphinx.ext.autosummary
    ~~~~~~~~~~~~~~~~~~~~~~

    Sphinx extension that adds an autosummary:: directive, which can be
    used to generate function/method/attribute/etc. summary lists, similar
    to those output eg. by Epydoc and other API doc generation tools.

    An :autolink: role is also provided.

    autosummary directive
    ---------------------

    The autosummary directive has the form::

        .. autosummary::
           :nosignatures:
           :toctree: generated/

           module.function_1
           module.function_2
           ...

    and it generates an output table (containing signatures, optionally)

        ========================  =============================================
        module.function_1(args)   Summary line from the docstring of function_1
        module.function_2(args)   Summary line from the docstring
        ...
        ========================  =============================================

    If the :toctree: option is specified, files matching the function names
    are inserted to the toctree with the given prefix:

        generated/module.function_1
        generated/module.function_2
        ...

    Note: The file names contain the module:: or currentmodule:: prefixes.

    .. seealso:: autosummary_generate.py


    autolink role
    -------------

    The autolink role functions as ``:obj:`` when the name referred can be
    resolved to a Python object, and otherwise it becomes simple emphasis.
    This can be used as the default role to make links 'smart'.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�	Parameter)�path)�
ModuleType)�Any�Dict�List�Optional�Tuple�Type�cast)�nodes)�Element�Node�system_message)�
directives)�RSTStateMachine�Struct�
state_classes)�
StringList)�addnodes)�Sphinx)�Config)�RemovedInSphinx50Warning�RemovedInSphinx60Warning�deprecated_alias)�BuildEnvironment)�TocTree)�INSTANCEATTR�
Documenter)�DocumenterBridge�Options)�
import_module)�mock)�__)�Project)�ModuleAnalyzer�PycodeError)�SphinxComponentRegistry)�logging�rst)�NullReporter�SphinxDirective�
SphinxRole�new_document�switch_source_input)�signature_from_str)�Matcher)�
OptionSpec)�HTMLTranslatorz	\.(?:\s+)z::\s*$)zet al.z i.e.c@�eZdZdS)�autosummary_tocN��__name__�
__module__�__qualname__�r9r9�A/usr/lib/python3/dist-packages/sphinx/ext/autosummary/__init__.pyr4k�r4�app�doctree�returncsHtjdtdd�|jj�i�ddtdtddf���fd	d
�
��|�dS)ziInsert items described in autosummary:: to the TOC tree, but do
    not generate the toctree:: list.
    z'process_autosummary_toc() is deprecated�)�
stacklevel��node�depthr>Nc	s�d�|<t|�D]<\}}zt|t�r't|dtj�r't����j|d�WqWn	ty1Yqwt|t	j
�s9q|�vrD�||d�qdS)NTrrA)�	enumerate�
isinstancer4r�toctreer�note�docname�
IndexErrorr�section)rBrC�j�subnode��	crawl_toc�crawled�envr9r:rNxs$
�����z*process_autosummary_toc.<locals>.crawl_toc)rA)�warnings�warnr�builderrPr
�int)r<r=r9rMr:�process_autosummary_tocos� rU�selfrBcCstj�)z-Hide autosummary toctree list in HTML output.)r�SkipNode�rVrBr9r9r:�autosummary_toc_visit_html�srYcCsdS�Nr9rXr9r9r:�autosummary_noop�sr[c@r3)�autosummary_tableNr5r9r9r9r:r\�r;r\cCs�zXttj|d�}ttj|d�}ttj|d�}tttj|�}|D]2}ttj|d�}ttj|d�}t	t
|��D]\}	}
t|
tj�rT|
�
��dd�}t�|�||	<q;q#WdStybYdSw)z0Make the first column of the table non-breaking.r���� � N)rr�table�tgroup�tbodyr�row�entry�	paragraphrD�listrE�Text�astext�replacerI)rVrBr`rarb�rowsrc�
col1_entry�parrKrL�new_textr9r9r:�autosummary_table_visit_html�s$����rnzsphinx.ext.autosummary�_appc@seZdZdd�ZdS)�FakeApplicationcCs8d|_d|_i|_d|_t�|_tdd�|_t�|_	dSrZ)
�
doctreedir�events�
extensions�srcdirr�configr$�projectr'�registry)rVr9r9r:�__init__�szFakeApplication.__init__N)r6r7r8rxr9r9r9r:rp�srpcseZdZd�fdd�Z�ZS)�
FakeDirectiver>NcsXtdd�}t|d�}t�}|j�dddd�t|�}t|d�}t��|dt�d|�dS)	N�)�	tab_width)�settings�autodoc_class_signature�mixedT)�documentr)rrpru�addr�superrxr )rVr|rr<rP�state��	__class__r9r:rx�s


zFakeDirective.__init__)r>N)r6r7r8rx�
__classcell__r9r9r�r:ry�sry�obj�parentcs�ddlm}m}t���r|S|durt||d�}n|}t|d�r)|t�|j��n|t�d����fdd�|j	j
��D�}|rK|jdd	�d
�|dS|S)z�Get an autodoc.Documenter class suitable for documenting the given
    object.

    *obj* is the Python object to be documented, and *parent* is an
    another Python object (e.g. a module or a class) to which *obj*
    belongs to.
    r)�DataDocumenter�ModuleDocumenterNr6�cs g|]}|��dd��r|�qS)r�F)�can_document_member)�.0�cls�r��
parent_docr9r:�
<listcomp>�s
�z"get_documenter.<locals>.<listcomp>cS�|jSrZ)�priority)r�r9r9r:�<lambda>��z get_documenter.<locals>.<lambda>)�keyr])
�sphinx.ext.autodocr�r��inspect�ismodule�get_documenter�hasattrryr6rw�documenters�values�sort)r<r�r�r�r��parent_doc_cls�classesr9r�r:r��s

r�c
@s�eZdZUdZdZdZdZdZej	ej
ejejej
d�Ze
ed<deefdd	�Zd
edeedeeeeeffdd
�Zdededededdf
dd�Zdeedeeeeeeffdd�Zdeeeeeefdeefdd�ZdS)�Autosummaryz�
    Pretty table containing short signatures and summaries of functions etc.

    autosummary can also optionally generate a hidden toctree:: node.
    rFT)�captionrF�nosignatures�	recursive�template�option_specr>cCs�t|j|jjjt�|j|j�|_dd�|jD�}|�	|�}|�
|�}d|jvr�t�
|jj�}|jd��}g}t|jj�}|jj}|D]C\}	}
}}|�||�}t�||�}
t�t�||
��}
|
|jjvr�||j�|
d��rrtd�}ntd�}tj|||��d�qC|�|
�qC|r�t��}||d<dd�|D�|d	<d
|d<d|d<|j�d
�|d
<|�t dd|��d|jvr�d
|jvr�tjtd�|d
d�|S)NcSs8g|]}|��rt�d|��d�r|����d�qS)z^[~a-zA-Z_]r)�strip�re�search�split�r��xr9r9r:r�s
��z#Autosummary.run.<locals>.<listcomp>rFz5autosummary references excluded document %r. Ignored.zMautosummary: stub file not found %r. Check your autosummary_generate setting.��location�includefilescSsg|]}d|f�qSrZr9)r��docnr9r9r:r�%s�entriesr]�maxdepth�globr�r�z;A captioned autosummary requires :toctree: option. ignored.)!rrPr�r�reporterr �lineno�bridge�content�	get_items�	get_table�options�	posixpath�dirnamerHr�r0ru�exclude_patterns�autosummary_filename_map�get�join�normpath�
found_docs�doc2pathr#�logger�warning�get_location�appendrrFr4)rV�names�itemsrr��tree_prefix�docnames�excluded�filename_map�name�sig�summary�	real_namerH�msg�tocnoder9r9r:�runsH�




�zAutosummary.runr��prefixescCs�t|jj��9z
t||�WWd�Sty>}zzt||�WWYd}~Wd�Sty9Y|�wd}~ww1sBwYdSrZ)r"ru�autosummary_mock_imports�import_by_name�ImportError�import_ivar_by_name)rVr�r��excr9r9r:r�2s
������zAutosummary.import_by_namer<r�r��	full_namercCst|||�}||j|�S)z�Get an autodoc.Documenter class suitable for documenting the given
        object.

        Wraps get_documenter and is meant as a hook for extensions.
        )r�r�)rVr<r�r�r��docclsr9r9r:�create_documenter?szAutosummary.create_documenterr�cCs4t|j�}g}d}|D�]}|}|�d�r"|dd�}|�d�d}z
|j||d�\}}}	}
WntyDtjtd�||�	�d	�Yqwt
�|j_|}t
|t�s_|
d
|t|
�dd�}|�|jj||	|�}|��s�tjtd�||�	�d	�|�|dd|f�q|��s�tjtd
�||�	�d	�|�|dd|f�q|jjr�|��s�qzt�|���|_|j��Wnty�}
zt�d|
�d|_WYd}
~
nd}
~
wwz|jdd�}Wn
t y�|��}Ynw|s�d}nt!d|t|��}t"||d�}|�#d�t$|jjj%dd�|j&j'�}|�||||f�q|S)z}Try to import the given names, and return a list of
        ``[(name, signature, summary_string, real_name), ...]``.
        �2�~rAN�.r])r�z autosummary: failed to import %sr�z::zfailed to parse name %sr�zfailed to import object %sz$[autodoc] module analyzer failed: %sF)�show_annotation�
��	max_chars)(�get_import_prefixes_from_envrP�
startswithr�r�r�r�r�r#r�rr��resultrEr�lenr�r<�
parse_namer��
import_objectr��members�check_moduler%�
for_module�get_real_modname�analyzer�find_attr_docsr&�debug�format_signature�	TypeError�max�mangle_signature�add_content�extract_summary�datar�r)rVr�r�r��max_item_charsr��display_namer�r�r��modnamer��
documenter�errr�r�r�r9r9r:r�Ist


��

������
zAutosummary.get_itemsr�cs�t��}d|d<td�}tjddgd�}|�|�tjddd�}|�|�|�tjddd	��|�tjdd
d	��t�d��|���dt	dd
f��fdd�}|D]'\}}}	}
d}d�j
vrjd|||
t�|�f}nd|||
f}|	}
|||
�qQ||gS)z�Generate a proper list of table nodes for autosummary:: directive.

        *items* is a list produced by :meth:`get_items`.
        z\X{1}{2}\X{1}{2}�specr��	longtable�r�r?)�colsr�)�colwidth�Z�column_textsr>Nc
s�t�d�}�j��\}}|D]S}t�d�}t�}|�|d||f�t�j|��1�j�	|d|�zt
|dtj�r>|d}Wn	tyHYnw|�t�d|��Wd�n1s\wYq��|�dS)Nr�z%s:%d:<autosummary>r)
rrc�
state_machine�get_source_and_linererr�r.r��nested_parserErIrd)rrc�source�line�textrB�vl��bodyrVr9r:�
append_row�s&

����z)Autosummary.get_table.<locals>.append_rowr�r�z:py:%s:`%s <%s>`\ %sz:py:%s:`%s <%s>`)
r�tabular_col_specr\rr`r�ra�colspecrb�strr�r)�escape)rVr��
table_specr`�
real_table�groupr
r�r�r�r��	qualifier�col1�col2r9rr:r��s(




zAutosummary.get_tableN)r6r7r8�__doc__�required_arguments�optional_arguments�final_argument_whitespace�has_contentr�unchanged_required�	unchanged�flagr�r1�__annotations__rrr�rr	rr�rr�r�r�r9r9r9r:r��s.
�&0

��
�&
*Pr��scCs|�d�d��S)z+Strip a type hint from argument definition.�:r)r�r�)r!r9r9r:�strip_arg_typehint�sr#cCs�z>t|�}t|j���}t|�D]!\}}|jtjur!|jtjd�}|j	tjur-|jdd�}|||<q|j|tjd�}t
|�WStyI|YSw)zCClean up signature using inspect.signautre() for mangle_signature())�
annotationN)�default)�
parameters�return_annotation)r/rfr&r�rDr$r�emptyrir%r�	Exception)r!r�r&�i�paramr9r9r:�_cleanup_signature�s

�r,�r�r�c
Cs�t|�}t�dd|�}t�dd|���}t�dd|�}t�dd|�}t�dd|�}t�d	d|�}t�d
d|�}t�d|�rJt�dd|�}t�d|�s=t�d|�r]t�dd|�}t�d|�sPt�d
|�rpt�d
d|�}t�d
|�scg}g}t�d�}|r�|�|�}|s�|�d�}n|�d|�d��|�d�dd�}|s{t	|�D]
\}}t
|�||<q�t	|�D]
\}}	t
|	�||<q�td||dd�}|r�|s�dtd||dd�}d|St|�|dddkr�|dtd||t|�ddd�7}d|S)z5Reformat a function signature to a more compact form.z\)\s*->\s.*$�)z
^\((.*)\)$z\1z\\\\r�z\\'z\\"z'[^']*'z"[^"]*"z	\([^)]*\)z<[^>]*>z{[^}]*}z^(.*, |)([a-zA-Z0-9_*]+)\s*=\s*z, rr?rAN���r�z[%s]��z[, %s]z(%s))
r,r��subr�r��compiler��insertrrDr#�limited_joinr�)
r�r�r!�args�opts�opt_re�mr*�arg�optr9r9r:r��sT���


��

�r��docrcCspdttdtdtjfdd�}|r#|d��s#|�d�|r#|d��rt|�D]\}}|��s7|d|�}nq'|gkr>dS|||j�}t	|dtj
�rU|d����}n[t	|dtj�sd|d��}nLt
�d	�|��}t|�d
kry|d��}n7d}tt|��D].}d�|d|d
���d�d}g|dd�<|||j�}|�t�r�q�t|�tj��s�nq�t�d|�}|S)
zExtract summary from docstring.r<r|r>cSs,ttd�}td|�}t�|_|�||�|S)N�Bodyr�)rrr-r*r�r�)r<r|rrBr9r9r:�parses


zextract_summary.<locals>.parserNr�r^rAz. r�)rrrrrr��poprDr|rErJrhre�
periods_rer�r�r��range�rstrip�endswith�WELL_KNOWN_ABBREVIATIONSrf�traverser�
literal_rer2)r<rr>r*�piecerBr��	sentencesr9r9r:r�s>	
�� 
�r��...�sepr��overflow_markerc	Cs~|�|�}t|�|kr
|Sd}d}t|�D]\}}|t|�t|�7}||t|�kr0|d7}q|�t|d|��|g�S)z�Join a number of strings into one, limiting the length to *max_chars*.

    If the string overflows this limit, replace the last fitting item by
    *overflow_marker*.

    Returns: joined_string
    rrAN)r�r�rDrf)	rJr�r�rK�full_str�n_chars�n_itemsrK�itemr9r9r:r5Ts
	
r5rPcCs^dg}|j�d�}|r|�d|�|j�d�}|r-|r'|�d|d|�|S|�d|�|S)z`
    Obtain current Python import prefixes (for `import_by_name`)
    from ``document.env``
    Nz	py:modulerzpy:classr�)�ref_contextr�r4)rPr��
currmodule�	currclassr9r9r:r�os�r�r�r�c	Cstg}|D],}z|rd�||g�}n|}t|�\}}}||||fWSty0|�|�Yqwtdd�|���)z~Import a Python object that has the given *name*, under one of the
    *prefixes*.  The first name that succeeds is used.
    r�zno module named %sz or )r��_import_by_namer�r�)r�r��tried�prefix�
prefixed_namer�r�r�r9r9r:r��s�r�c
CsHz�|�d�}d�|dd��}|r.zt|�}t||d�||fWWStttfy-Ynwd}d}ttdt	|�d��D]$}|}d�|d|��}zt|�Wn	tyYYq=w|t
jvranq=|t	|�kr�d}t
j|}||d�D]	}|}t||�}qu|||fWSt
j|d|fWStttt
fy�}	zt|	j�|	�d}	~	ww)z+Import a Python object given its full name.r�Nr]rrA)r�r�r!�getattrr�rI�AttributeError�reversedrAr��sys�modules�
ValueError�KeyErrorr6)
r��
name_partsr��mod�last_jrKr�r��obj_name�er9r9r:rS�sF
��
�
��rSc	
Cs�zB|�dd�\}}t||�\}}}}|�|dd�}t�t|d|��}|��||f|jvs5||f|jvr@|d|t	||fWSWt
�t
ttfyOYt
�w)z�Import an instance variable that has the given *name*, under one of the
    *prefixes*.  The first name that succeeds is used.
    r�rAr�r7)
�rsplitr�rir%r�rW�analyze�	attr_docs�annotationsrr�r\r&)	r�r��attrr�r�r�r��qualnamer�r9r9r:r��s���r�c@s.eZdZdZdeeeeeffdd�ZdS)�AutoLinkz�Smart linking role.

    Expands to ':obj:`text`' if `text` is an object that can be imported;
    otherwise expands to '*text*'.
    r>cCs�|j�d��d�}|d|j|j|j|j|j|j�\}}|r!||fSt	|�dks)J�t
tj|d�}zt
|j�}t|d|�W||fStyet
tj|d�}tj|j|��|dd�|d<Y||fSw)N�pyr�rAr�	reftargetr�r�)rP�
get_domain�role�rawtextr	r��inlinerr�r�r�rr�pending_xrefr�r�r�r�literal�emphasisrh)rV�
pyobj_role�objects�errorsrpr�rqr9r9r:r��s&�
���zAutoLink.runN)	r6r7r8rr	rrrr�r9r9r9r:ri�s"ricsHdtdttdff�fdd�}d}�jjD]}d||�vr!|SqdS)N�suffixr>.cs"�j���|�}|durdS|jS)N)�restructuredtext)rw�get_source_parsersr��	supported)rv�parser_class�r<r9r:�get_supported_format�sz,get_rst_suffix.<locals>.get_supported_formatrw)rr	ru�
source_suffix)r<r|rvr9r{r:�get_rst_suffix�s�r~c
s&|jj}|dur|jj��fdd��jD�}n4|durn/t|jj���fdd�|D�}|dd�D]}t�t�	|j
|��sJt�t
d�|�|�|�q1|sOdSt|�}|dur`t�t
d��dSdd	lm}|jj}t|jj��||||j
|||jj|jjd
�Wd�dS1s�wYdS)NTcs,g|]}tj���|��r�j|dd��qS)N)�base)�osr�isfiler�r�)rPr9r:r�s�z,process_generate_options.<locals>.<listcomp>Fcs*g|]}||�t���s�dnd�qS)rr�)rC�tuple)r��genfile)�extr9r:r�	s"�z(autosummary_generate: file not found: %szbautosummary generats .rst files internally. But your source_suffix does not contain .rst. Skipped.r)�generate_autosummary_docs)rv�	base_pathr<�imported_members�	overwrite�encoding)ru�autosummary_generaterSrPr�rfr}rr�r�rtr�r�r#�remover~�sphinx.ext.autosummary.generater��autosummary_imported_membersr"r��autosummary_generate_overwrite�source_encoding)r<�genfilesrdrvr�r�r9)rPr�r:�process_generate_options�s<
�
�
�"�r�cCs�|�d�|jtttfttfttfttfttfd�|jtttfttfttfttfttfd�|�dt�|�	dt
��|�dt�|�
did�|�
did	�|�
d
ddttg�|�
ddd�|�
d
dd�d�|�
dgdtg�tjdd�S)Nzsphinx.ext.autodoc)�html�latexr	�man�texinfo�autosummary�autolinkzbuilder-inited�autosummary_contextTr�r�r�r�Fr�cSr�rZ)�autodoc_mock_imports)rur9r9r:r�;r�zsetup.<locals>.<lambda>rPr�)�version�parallel_read_safe)�setup_extension�add_noder4rYr[r\rn�
add_directiver��add_roleri�connectr��add_config_value�boolrf�sphinx�__display_version__r{r9r9r:�setup$s6
���r�)r-)r-rI)vrr�r�r�r�rZrQrr�typesr�typingrrrrr	r
r�docutilsr�docutils.nodesr
rr�docutils.parsers.rstr�docutils.parsers.rst.statesrrr�docutils.statemachinerr�r�sphinx.applicationr�
sphinx.configr�sphinx.deprecationrrr�sphinx.environmentr�#sphinx.environment.adapters.toctreerr�rr�sphinx.ext.autodoc.directiverr �sphinx.ext.autodoc.importerr!�sphinx.ext.autodoc.mockr"�
sphinx.localer#�sphinx.projectr$�
sphinx.pycoder%r&�sphinx.registryr'�sphinx.utilr(r)�sphinx.util.docutilsr*r+r,r-r.�sphinx.util.inspectr/�sphinx.util.matchingr0�sphinx.util.typingr1�sphinx.writers.htmlr2�	getLoggerr6r�r3r@rFrD�commentr4rrU�NodeVisitorrYr[r\rnrpryr�r�rr#r,rTr�r�r5r�r�rSr�rir~r�r�r9r9r9r:�<module>s�6$


��	%Z;8��
�,,)&