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/util/__pycache__/__init__.cpython-310.pyc
o

u�a�L�@s�UdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
ddlmZddlmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZmZddl m!Z!m"Z"m#Z#m$Z$m%Z%dd	l&m'Z'dd
l(m)Z)m*Z*m+Z+ddl,m-Z-ddl.m/Z/dd
l0m1Z1m2Z2m3Z3m4Z4ddl5m6Z6ddl7m8Z8m9Z9m:Z:m;Z;ddl<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEddlFmGZGer�ddlHmIZIe/�JeK�ZLe�Md�ZNeeOd<e�Md�ZPeeOd<deQdeQdeQfdd�ZRdeQdeQfdd�ZS	d~d eQd!eeGd"fdeeQfd#d$�ZTd%eeQeQfd&eQdeQfd'd(�ZUGd)d*�d*eV�ZWdd,d-�ZXdd.d/�ZYGd0d1�d1eV�ZZd2Z[d3d4deQfd5d6�Z\d7eQd8eQdeQfd9d:�Z]e�Md;�Z^Gd<d=�d=�Z_Gd>d?�d?�Z`d@eQdAeadeeafdBdC�ZbdDeQdEeQdeQfdFdG�ZcdHeQdIeQdeeQeQffdJdK�ZddLeadMeQdNeQdeeQfdOdP�ZedMeQdNeQdeeQfdQdR�Zfd�dTeadeQfdUdV�Zgd�dWeQdXeQdefdYdZ�Zhd[eQdeeeQeQffd\d]�Zid^eQdeQfd_d`�ZjdaeQdekfdbdc�ZlddedeQfdedf�ZmdgemfdhedieQdjeQdkeegeQfdef
dldm�ZndgddemfdhedieQdjeQdneadoeadkeegeQfdefdpdq�ZoGdrds�dsep�ZqGdtdu�du�ZrdvesdeQfdwdx�ZtdyeQdesfdzd{�Zudefd|d}�ZvdS)�z�
    sphinx.util
    ~~~~~~~~~~~

    Utility functions for Sphinx.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�datetime)�
import_module)�path��mktime�strptime)
�IO�
TYPE_CHECKING�Any�Callable�Dict�Iterable�Iterator�List�Optional�Pattern�Set�Tuple�Type)�	parse_qsl�
quote_plus�	urlencode�urlsplit�
urlunsplit)�RemovedInSphinx50Warning)�ExtensionError�FiletypeNotFoundError�SphinxParallelError)�__)�logging)�bold�colorize�strip_colors�term_width_line)�	patfilter)�caption_ref_re�explicit_title_re�nested_parse_with_titles�split_explicit_title)	�SEP�copyfile�	copytimes�	ensuredir�
make_filename�movefile�mtimes_of_files�os_path�relative_uri)�PathMatcher)�Sphinxz\s+�ws_rez(?P<schema>.+)://.*�url_re�basedocname�docname�returncCs t�t�d|d|��dd�S)N�/z..�)�	posixpath�normpath�join)r6r7�r>�6/usr/lib/python3/dist-packages/sphinx/util/__init__.py�docname_join8s
��r@�filepathcCs|�tjjt�}t�d|�S)z+Normalize path separator and unicode string�NFC)�replace�osr�sepr)�unicodedata�	normalize)rA�newpathr>r>r?�path_stabilize=srIr>�dirname�exclude_matchers.c	#s��t�t�|��}t|�d}tj|dd�D]S\}�}||d��t�fdd��D��}t�fdd�|D��}|D]��fdd	�|D�}�fd
d	�|D�}q9t�fdd�|D���dd�<t|�D]\}}|VqaqdS)z}Get all file names in a directory, recursively.

    Exclude files and dirs matching some matcher in *exclude_matchers*.
    r:T)�followlinksNc3� �|]}tt��|��VqdS�N�rIrr=)�.0�dn��relativerootr>r?�	<genexpr>P���z%get_matching_files.<locals>.<genexpr>c3rMrNrO)rP�fnrRr>r?rTRrUc�g|]
}�|d�s|�qS�r:r>�rP�entry��matcherr>r?�
<listcomp>U�z&get_matching_files.<locals>.<listcomp>crWrXr>rYr[r>r?r]Vr^c3s�|]	\}}�|VqdSrNr>)rP�i�_)�dirsr>r?rTXs�)rr<�abspath�lenrD�walk�	enumerate�sorted)	rJrK�dirlen�root�files�qdirs�qfilesr_�filenamer>)rar\rSr?�get_matching_filesCs&�����rm�
source_suffixrlcCs,|��D]\}}|�|�r|pdSqt�)N�restructuredtext)�items�endswithr)rnrl�suffix�filetyper>r>r?�get_filetype^s

�rtc@s�eZdZdZddd�Zdededefdd	�Zdeddfd
d�Zdeed
e	ee
eeeffddfdd�Zdeefdd�Z
deeddfdd�ZdS)�FilenameUniqDictz�
    A dictionary that automatically generates unique names for its keys,
    interpreted as filenames, and keeps track of a set of docnames they
    appear in.  Used for images and downloadable files in the environment.
    r8NcCst�|_dSrN)�set�	_existing��selfr>r>r?�__init__mszFilenameUniqDict.__init__r7�newfilecCs�||vr||d�|�||dSt�|�}t�|�\}}d}||jvr6|d7}d|||f}||jvs&|h|f||<|j�|�|S)Nrr:z%s%s%s)�addr�basename�splitextrw)ryr7r{�
uniquename�base�extr_r>r>r?�add_fileps


�zFilenameUniqDict.add_filecCs>t|���D]\}\}}|�|�|s||=|j�|�qdSrN)�listrp�discardrw)ryr7rl�docs�uniquer>r>r?�	purge_doc~s
��zFilenameUniqDict.purge_doc�docnames�othercC�8|��D]\}\}}|t|�@D]}|�||�qqdSrN�rprvr�)ryr�r�rlr�r��docr>r>r?�merge_other��
��zFilenameUniqDict.merge_othercCs|jSrN�rwrxr>r>r?�__getstate__�szFilenameUniqDict.__getstate__�statecC�
||_dSrNr�)ryr�r>r>r?�__setstate__��
zFilenameUniqDict.__setstate__�r8N)�__name__�
__module__�__qualname__�__doc__rz�strr�r�rrrr
r�r�r�r>r>r>r?rugs
.ru�cK�Bz
tj|fi|��WSty tj|fi|�ddi��YSw)a3Wrapper around hashlib.md5

    Attempt call with 'usedforsecurity=False' if we get a ValueError, which happens when
    OpenSSL FIPS mode is enabled:
    ValueError: error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips

    See: https://github.com/sphinx-doc/sphinx/issues/7611
    �usedforsecurityF)�hashlib�md5�
ValueError��data�kwargsr>r>r?r��s

�r�cKr�)z�Wrapper around hashlib.sha1

    Attempt call with 'usedforsecurity=False' if we get a ValueError

    See: https://github.com/sphinx-doc/sphinx/issues/7611
    r�F)r��sha1r�r�r>r>r?r��s
�r�c@sfeZdZdZdededefdd�Zdeddfdd	�Zd
eedeee	eee
ffddfdd
�ZdS)�
DownloadFilesz�A special dictionary for download files.

    .. important:: This class would be refactored in nearly future.
                   Hence don't hack this directly.
    r7rlr8cCsX||vrt|�����}d|tj�|�f}t�|f||<||d�|�||dS)Nz%s/%srr:)r��encode�	hexdigestrDrr}rvr|)ryr7rl�digest�destr>r>r?r��szDownloadFiles.add_fileNcCs2t|���D]\}\}}|�|�|s||=qdSrN)r�rpr�)ryr7rlr�r�r>r>r?r��s
��zDownloadFiles.purge_docr�r�cCr�rNr�)ryr�r�rlr�r�r7r>r>r?r��r�zDownloadFiles.merge_other)r�r�r�r�r�r�r�rrrr
r�r>r>r>r?r��s
	2r�z�# Sphinx version: %s
# Python version: %s (%s)
# Docutils version: %s %s
# Jinja2 version: %s
# Last messages:
%s
# Loaded extensions:
�appr3cCsddl}ddl}ddl}ddl}t��d}t|t�r!d|j}nt�	�}t
�dd�\}}d}	|dur>d�d	d
�|j
D��}	t�|t|j|��|��|j|j|j|	f���|dur~|j��D]}
t|
jdd�}|
jd
kr}t�|d|
j|
j|f���q`t�||���t�|�|S)z;Save the current exception's traceback in a temporary file.rNr:z(Error in parallel process)
z.logzsphinx-err-��
css �|]}dt|���VqdS)z#   %sN)r"�strip)rP�sr>r>r?rT�s
��
�z!save_traceback.<locals>.<genexpr>�__file__�unknown�builtinz#   %s (%s) from %s
)�platform�docutils�jinja2�sphinx�sys�exc_info�
isinstancer�	traceback�
format_exc�tempfile�mkstempr=�
messagelogrD�write�
_DEBUG_HEADER�__display_version__�python_version�python_implementation�__version__�__version_details__r��
extensions�values�getattr�module�version�name�close)r�r�r�r�r��exc�
exc_format�fdr�	last_msgsr��modfiler>r>r?�save_traceback�sL

����
���
r��modname�	attributecCsB|durdSt|�}|}|�d�D]	}|rt||�}qt|dd�S)N�.r�)r�splitr�)r�r�r��value�attrr>r>r?�get_full_modname�s
�r�zcoding[:=]\s*([-\w.]+)c@s<eZdZdZdeddfdd�Zdedeeeffdd	�Z	dS)
�UnicodeDecodeErrorHandlerz8Custom error handler for open() that warns and replaces.r7r8NcCr�rN)r7)ryr7r>r>r?rzr�z"UnicodeDecodeErrorHandler.__init__�errorcCs�|j�dd|j�}|j�d|j�}|dkrt|j�}|j�dd|j�d}tjtd�|j|d|j�d|j|j|j	�d|j|j	|�|j
|fd�d	|j	fS)
N�
r���r:z5undecodable source characters, replacing with "?": %rs>>>s<<<)�location�?)�object�rfind�start�findrc�count�logger�warningr�endr7)ryr��	linestart�lineend�linenor>r>r?�__call__s 

����
z"UnicodeDecodeErrorHandler.__call__)
r�r�r�r�r�rz�UnicodeDecodeErrorr�intr�r>r>r>r?r�sr�c@sBeZdZdZdededdfdd�Zdeddfd	d
�Zd
dd�ZdS)�Teez2
    File-like object writing to two streams.
    �stream1�stream2r8NcCs||_||_dSrN)r�r�)ryr�r�r>r>r?rz*s
zTee.__init__�textcCs|j�|�|j�|�dSrN)r�r�r�)ryr�r>r>r?r�.sz	Tee.writecCs4t|jd�r|j��t|jd�r|j��dSdS)N�flush)�hasattrr�r�r�rxr>r>r?r�2s

�z	Tee.flushr�)	r�r�r�r�rrzr�r�r�r>r>r>r?r�&s
r��spec�totalc	Cs�t�}|�d�}|D]d}zO|���d�}ddg|krt�t|�dkr.|�t|d�d�n,t|�dkrXt|dp:d�}t|dpEt||��}||krMt�|�t	|d|��nt�Wq
t
yn}ztd|�|�d}~ww|S)	z_Parse a line number spec (such as "1,2,4-6") and return a list of
    wanted line numbers.
    �,�-r�r:r�zinvalid line number spec: %rN)r�r�r�r�rc�appendr��max�extend�range�	Exception)	r�r�rp�parts�part�begendr�r�r�r>r>r?�parselinenos9s,
���r�string�encodingcCs`tjdtdd�t|t�r.z|r|�|�}W|S|��}W|Sty-|�d�}Y|Sw|S)z2Forcibly get a unicode string out of a bytestring.zforce_decode() is deprecated.r���
stacklevel�latin1)�warnings�warnrr��bytes�decode�UnicodeError)rrr>r>r?�force_decodeTs�

���rr��tcCsJtjdtdd�|�|�}|dkr!|d|�||t|�d�fSd|fS)zESimilar to str.rpartition from 2.5, but doesn't return the separator.zrpartition() is now deprecated.r�rr�Nr�)rrrr�rc)r�rr_r>r>r?�
rpartitiones

 r
�n�typer�cCsDdd�|�d|d�D�}tdd�|D��|kr td||f��|S)z@Split an index entry into a given number of parts at semicolons.cSsg|]}|���qSr>)r�)rP�xr>r>r?r]pszsplit_into.<locals>.<listcomp>�;r:css�|]}|rdVqdS)r:Nr>)rPr�r>r>r?rTqs�zsplit_into.<locals>.<genexpr>�invalid %s index entry %r)r��sumr�)rrr�r�r>r>r?�
split_intonsrcCs�|dkrz	tdd|�}W|Stytdd|�}Y|Sw|dkr*tdd|�}|S|dkr6tdd|�}|S|dkrBtdd|�}|S|dkrNtdd|�}|Std	||f��)
N�singler�r:�pair�triple��see�seealsor)rr�)rr��resultr>r>r?�split_index_msgvs*��
����rr:rcCsHt��\}}}g}t�|�}|||d�7}|t�||�7}d�|�S)z?Format an exception with traceback, but only the last x frames.Nr�)r�r�r��	format_tb�format_exception_onlyr=)r�typ�val�tb�res�tbresr>r>r?�format_exception_cut_frames�s

r$�objname�sourcec
Cs�z0|�d�}|�d�}t|�}|D]}|d|7}zt||�}Wqty-t|�}Yqw|WSttfyR}z|rFtd||f|�|�td||�|�d}~ww)z!Import python object by qualname.r�rz#Could not import %s (needed for %s)zCould not import %sN)r��poprr��AttributeError�ImportErrorr)r%r&�objpathr��objr�r�r>r>r?�
import_object�s0

������r,r�c
Cs�|�d�}t|d�D]O\}}zd�|d|��}t|�Wq
tyQ|d|d�rFd�|d|d��d�||dd��fYSdd�|�fYStyYYq
w|dfS)aSplit full qualified name to a pair of modname and qualname.

    A qualname is an abbreviation for "Qualified name" introduced at PEP-3155
    (https://www.python.org/dev/peps/pep-3155/).  It is a dotted path name
    from the module top-level.

    A "full" qualified name means a string containing both module name and
    qualified name.

    .. note:: This function actually imports the module to check its existence.
              Therefore you need to mock 3rd party modules if needed before
              calling this function.
    r�r:Nr�)r�rer=rr)�
IndexError)r�r�r_r�r�r>r>r?�split_full_qualified_name�s
4�r.�uricCshtt|��}|d�d��d�|d<t|d��d�|d<tdd�t|d�D��}t|�|d<t|�S)	Nr:�idna�asciir�r9css �|]\}}||��fVqdSrN)r�)rP�q�vr>r>r?rT�s�zencode_uri.<locals>.<genexpr>r)r�rr�r	rrrr)r/r��queryr>r>r?�
encode_uri�sr5�urlcCs|rd|vrdSdS)zCheck *url* is URL or not.z://TFr>)r6r>r>r?�isurl�sr7�chunkcCsBt|ttf�rt|�dkrt|d�Sd|d|dfSt|�S)Nr:rz%s .. %sr�)r�r��tuplercr�)r8r>r>r?�
display_chunk�s
r:�	darkgreen�iterable�summary�color�stringify_funcccsp�d}|D]%}|dkrtjt|�dd�d}tj||�|dd�tjddd�|Vq|dkr6t�d�dSdS)NrT��nonlr:)r>rA� r�)r��infor )r<r=r>r?�l�itemr>r>r?�old_status_iterator�s��rF�length�	verbosityc	cs��|dkrt||||�EdHdSd}t|�}|D]+}|d7}d|d||t|||��f}|r6|d7}nt|�}tj|dd�|Vq|dkrPt�d�dSdS)	Nrr:z%s[%3d%%] %s�dr�Tr@r�)rFr r!r#r�rC)	r<r=r>rGrHr?rDrEr�r>r>r?�status_iterator�s"� 
�rJc@seZdZdS)�SkipProgressMessageN)r�r�r�r>r>r>r?rKsrKc@sXeZdZdeddfdd�Zddd�Zdeed	ed
ede	fdd�Z
d
edefdd�ZdS)�progress_message�messager8NcCr�rN)rM)ryrMr>r>r?rzr�zprogress_message.__init__cCstjt|jd�dd�dS)Nz... Tr@)r�rCr rMrxr>r>r?�	__enter__szprogress_message.__enter__�exc_type�	exc_valuer�cCsVt|t�rt�td��|jrtj|j�dS|r"t�td��dSt�td��dS)N�skippedT�failed�doneF)r�rKr�rCr�args)ryrOrPr�r>r>r?�__exit__s
�zprogress_message.__exit__�fcs*t���dtdtdtf��fdd��}|S)NrTr�r8cs6���|i|��Wd�S1swYdSrNr>)rTr��rVryr>r?�wrapper s$�z*progress_message.__call__.<locals>.wrapper)�	functools�wrapsr
)ryrVrXr>rWr?r�szprogress_message.__call__r�)
r�r�r�r�rzrNrr�r
�boolrUrr�r>r>r>r?rLs


rL�epochcCs,ddlm}t�|�}d}|||dd�dS)z)Convert datetime format epoch to RFC1123.r)�format_datetimezEEE, dd LLL yyyy hh:mm:ss�en)�localez GMT)�babel.datesr]r�
fromtimestamp)r\r]�dt�fmtr>r>r?�epoch_to_rfc1123(s
rd�rfc1123cCstt|d��S)Nz%a, %d %b %Y %H:%M:%S %Zr)rer>r>r?�rfc1123_to_epoch1srfcs�dddgdddgddgd	d
gddgd
dgddgddgddgddgddgddgddgddgg}dd d!d"gd#d$d%gd&d'gg}d/d)td*td+tf�fd,d-�
��|�}�|�}t�d.|||f�S)0N�:�A�Zr`�a�z�À�Ö�Ø�ö�øu˿uͰuͽuͿu῿u‌u‍u⁰u↏uⰀu⿯u、u퟿u豈u﷏uﷰu�u𐀀u󯿿z\-z\.�0�9�·ùuͯu‿u⁀�|�entries�splitterr8csBg}|D]}t|t�r|�d�|d��q|�|�q|�|�S)Nz[%s]r�)r�r�r�r=)rurv�resultsrZ��convertr>r?ryCs

z xmlname_checker.<locals>.convertz(%s)(%s|%s)*)rt)r
r��re�compile)�name_start_chars�
name_chars�start_chars_regex�name_chars_regexr>rxr?�xmlname_checker5s��	�r�)r>)r�rXrN)wr�rYr�rDr;rzr�r�r�rFrr�	importlibrr�timerr�typingrr	r
rrr
rrrrrrr�urllib.parserrrrr�sphinx.deprecationr�
sphinx.errorsrrr�
sphinx.localer�sphinx.utilr�sphinx.util.consoler r!r"r#�sphinx.util.matchingr$�sphinx.util.nodesr%r&r'r(�sphinx.util.osutilr)r*r+r,r-r.r/r0r1�sphinx.util.typingr2�sphinx.applicationr3�	getLoggerr�r�r{r4�__annotations__r5r�r@rIrmrt�dictrur�r�r�r�r�r��
_coding_rer�r�r�rrr
rrr$r,r.r5r[r7r:rFrJr�rKrL�floatrdrfr�r>r>r>r?�<module>s�
<,
�
�
�	
*
%
		��
�����
�