
    7 fy                       d Z ddlmZ ddlZddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ ddlmZmZmZ ddlmZ dd	lmZ dd
lmZmZmZ ddlmZ ddlZddlmZ ddl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' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7m8Z8m9Z9m:Z:m;Z; ddl<m=Z=m>Z> ddl?m@Z@ er&ddlAmBZB ddlCmDZDmEZE ddlFmGZG ddlHmIZI ddlJmKZK dd lLmMZM  e4jN        eO          ZP ejQ        d!          ZR ejQ        d"          ZSd#ZT G d$ d%ejU                  ZVdjd+ZWdkd-ZX G d. d/ejU                  ZYdld1ZZ G d2 d3          Z[ G d4 d5e$          Z\dmd<Z] G d= d>e8          Z^dndAZ_dndBZ`dodpdGZadqdKZb	 	 drdsdPZc G dQ dRed          ZedtdVZf	 dudvd\ZgdwdxdaZh	 	 dydzdbZi G dc dde9          Zjd{dfZkd|dgZld}diZmdS )~a_  Extension that adds an autosummary:: directive.

The directive 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'.
    )annotationsN)	Parameter)path)
ModuleType)TYPE_CHECKINGAnycast)nodes)
directives)RSTStateMachineStructstate_classes)
StringList)addnodes)Config)BuildEnvironment)INSTANCEATTR
Documenter)DocumenterBridgeOptions)import_module)mock)__)Project)ModuleAnalyzerPycodeError)SphinxComponentRegistry)loggingrst)NullReporterSphinxDirective
SphinxRolenew_documentswitch_source_input)getmrosignature_from_str)Matcher)Sequence)Nodesystem_message)Sphinx)	Extension)
OptionSpec)HTML5Translatorz	\.(?:\s+)z::\s*$)zet al.ze.g.zi.e.c                      e Zd ZdS )autosummary_tocN__name__
__module____qualname__     U/var/www/equiseq/venv/lib/python3.11/site-packages/sphinx/ext/autosummary/__init__.pyr0   r0   n           Dr6   r0   selfnodes.NodeVisitornodereturnNonec                    t           j        )z-Hide autosummary toctree list in HTML output.)r
   SkipNoder9   r;   s     r7   autosummary_toc_visit_htmlrA   r   s
    
.r6   r)   c                    d S Nr5   r@   s     r7   autosummary_nooprD   w   s    Dr6   c                      e Zd ZdS )autosummary_tableNr1   r5   r6   r7   rF   rF   }   r8   r6   rF   r.   c                   	 t          t          j        |d                   }t          t          j        |d                   }t          t          j        |d                   }t          t
          t          j                 |          }|D ]}t          t          j        |d                   }t          t          j        |d                   }t          t          |                    D ]^\  }	}
t          |
t          j                  r?|
                                                    dd          }t          j        |          ||	<   _dS # t          $ r Y dS w xY w)z0Make the first column of the table non-breaking.r        N)r	   r
   tabletgrouptbodylistrowentry	paragraph	enumerate
isinstanceTextastextreplace
IndexError)r9   r;   rK   rL   rM   rowsrO   
col1_entryparjsubnodenew_texts               r7   autosummary_table_visit_htmlr^      s/   U[$q'**elE!H--U[&*--DOU++ 	2 	2Cek3q622Ju
166C'S		22 2 2
7guz22 2&~~//77XFFH"Z11CF2	2 	2    s   EE	 	
EEc                      e Zd ZddZdS )FakeApplicationr<   r=   c                    d | _         d | _        i | _        d | _        t	                      | _        t          di           | _        t                      | _	        d S )N )

doctreedirevents
extensionssrcdirr   configr   projectr   registry)r9   s    r7   __init__zFakeApplication.__init__   sI    02hhr2/11r6   Nr<   r=   )r2   r3   r4   rj   r5   r6   r7   r`   r`      s(        2 2 2 2 2 2r6   r`   c                        e Zd Zd fdZ xZS )FakeDirectiver<   r=   c                >   t          d          }t          |          }t                      }|j                            dddd            t	          |          }t          |          }t                                          |d t                      d|           d S )	N   )	tab_width)settingsautodoc_class_signaturemixedT)documentr   )r   r`   rg   addr   superrj   r   )r9   rq   rt   appenvstate	__class__s         r7   rj   zFakeDirective.__init__   s    A&&&8,,,
0'4FFFs##)))dGIIq%88888r6   rk   )r2   r3   r4   rj   __classcell__rz   s   @r7   rm   rm      s=        9 9 9 9 9 9 9 9 9 9r6   rm   rw   r+   objr   parenttype[Documenter]c                   ddl m}m} t          j                  r|S |t          | |d          }n|}t          |d          r |t                      |j                  n |t                      d          fd| j	        j
                                        D             }|r|                    d            |d	         S |S )
zGet 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ModuleDocumenterNr2   rb   c                D    g | ]}|                     d d          |S )rb   F)can_document_member).0clsr}   
parent_docs     r7   
<listcomp>z"get_documenter.<locals>.<listcomp>   sH     G G Gs))#r5*EEGs G G Gr6   c                    | j         S rC   )priority)r   s    r7   <lambda>z get_documenter.<locals>.<lambda>   s    S\ r6   )keyrH   )sphinx.ext.autodocr   r   inspectismoduleget_documenterhasattrrm   r2   ri   documentersvaluessort)rw   r}   r~   r   r   parent_doc_clsclassesr   s    `     @r7   r   r      s    DCCCCCCC   'VT::)vz"" 9#^MOOV_EE

#^MOOR88
G G G G Gcl6==?? G G GG 11222r{r6   c                      e Zd ZU dZdZdZdZdZej	        ej
        ej        ej        ej
        dZded<   d d
Zd!dZd"dZd#dZd$dZdS )%Autosummaryz
    Pretty table containing short signatures and summaries of functions etc.

    autosummary can also optionally generate a hidden toctree:: node.
    r   FT)captiontoctreenosignatures	recursivetemplater-   option_specr<   
list[Node]c                    t          | j        | j        j        j        t                      | j        | j                  | _        d | j        D             }| 	                    |          }| 
                    |          }d| j        v rt          j        | j        j                  }| j        d                                         }g }t!          | j        j                  }| j        j        }|D ]\  }	}
}}|                    ||          }t          j        ||          }t          j        t          j        ||                    }|| j        j        vrs || j                            |d                    rt3          d          }nt3          d          }t4                              |||                                            |                    |           |rmt=          j                    }||d<   d |D             |d	<   d
|d<   d |d<   | j                            d          |d<    |j        tA          dd|                     d| j        vr8d| j        v r/t4                              t3          d          |d
                    |S )Nc                    g | ]o}|                                 t          j        d |                                 d                   C|                                                                 d         pS )z^[~a-zA-Z_]r   )stripresearchsplit)r   xs     r7   r   z#Autosummary.run.<locals>.<listcomp>   ss     K K K!GGIIK"$)NAGGIIaL"I"IK""1% K K Kr6   r   Fz5autosummary references excluded document %r. Ignored.zMautosummary: stub file not found %r. Check your autosummary_generate setting.locationincludefilesc                    g | ]}d |fS rC   r5   )r   docns     r7   r   z#Autosummary.run.<locals>.<listcomp>  s    %H%H%HttTl%H%H%Hr6   entriesrH   maxdepthglobr   rb   z;A captioned autosummary requires :toctree: option. ignored.)!r   rx   ry   rt   reporterr   linenobridgecontent	get_items	get_tableoptions	posixpathdirnamedocnamer   r'   rg   exclude_patternsautosummary_filename_mapgetjoinnormpath
found_docsdoc2pathr   loggerwarningget_locationappendr   r   r0   )r9   namesitemsr
   r   tree_prefixdocnamesexcludedfilename_map_name_sig_summary	real_namer   msgtocnodes                   r7   runzAutosummary.run   s   &tx1D1M'.yy$+tzK KK Kt| K K Ku%%u%%$$'(899G,y17799KHt{;<<H;?L49 ) )0tXy(,,Y	BB	#.i@@#,Y^GW-M-MNN$("555x 1 1'5 A ABB M !XYY  "L M M NN3	D<M<M<O<ONPPP(((( ?"*,,*2'%H%Hx%H%H%H	"&(
#"&%)\%5%5i%@%@	"_RW==>>>DL((Y$,-F-FNN2[\\$)"I  / / / r6   namestrprefixeslist[str | None]tuple[str, Any, Any, str]c                   t          | j        j                  5  	 t          ||          cd d d            S # t          $ rx}	 t          ||          cY d }~cd d d            S # t          $ rD}|j        r|j        |j        gz   }n|j        |gz   }t	          |j	        d         |          d d }~ww xY wd }~ww xY w# 1 swxY w Y   d S )Nr   )
r   rg   autosummary_mock_importsimport_by_nameImportExceptionGroupimport_ivar_by_nameImportError	__cause__
exceptionsargs)r9   r   r   excexc2errorss         r7   r   zAutosummary.import_by_name  s    $+677 	N 	NN%dH55	N 	N 	N 	N 	N 	N 	N 	N ( 
N 
N 
NN.tX>>>>>>>	N 	N 	N 	N 	N 	N 	N 	N # N N N~ 969nGW6W!$4&!8.sx{FCCMN	
N	N 	N 	N 	N 	N 	N 	N 	N 	N 	NsP   B=8
B:A$B:B=$
B2.?B--B22B55B::B==CCrw   r+   r}   r   r~   	full_namer   c                F    t          |||          } || j        |          S )zGet an autodoc.Documenter class suitable for documenting the given
        object.

        Wraps get_documenter and is meant as a hook for extensions.
        )r   r   )r9   rw   r}   r~   r   docclss         r7   create_documenterzAutosummary.create_documenter%  s)      S&11vdk9---r6   r   	list[str]list[tuple[str, str, str, str]]c           	     >   t          | j                  }g }d}|D ]}|}|                    d          r%|dd         }|                    d          d         }	 |                     ||          \  }}}	}
n# t
          $ rx}t          d |j        D                       }t          	                    t          d	          |d
                    |          |                                            Y d}~d}~ww xY wt                      | j        _        |}t!          |t"                    s |
dz   |t%          |
          dz   d         z   }|                     | j        j        ||	|          }|                                sWt          	                    t          d          ||                                            |                    |dd|f           |                                sWt          	                    t          d          ||                                            |                    |dd|f           )	 t1          j        |                                          |_        |j                                         n9# t:          $ r,}t                              d|           d|_        Y d}~nd}~ww xY w	 |                    d          }n$# t@          $ r |                                }Y nw xY w|sd}n1tC          d|t%          |          z
            }tE          ||          }d|_#        |$                    d           tK          | j        j        j&        dd         | j'        j(                  }|                    ||||f           |S )z}Try to import the given names, and return a list of
        ``[(name, signature, summary_string, real_name), ...]``.
        2   ~   N.rH   )r   c                B    h | ]}d t          |          j         d| S )z* z: )typer2   r   es     r7   	<setcomp>z(Autosummary.get_items.<locals>.<setcomp>B  s2    TTT;DGG$4;;;;TTTr6   z4autosummary: failed to import %s.
Possible hints:
%s
r   z::zfailed to parse name %srb   zfailed to import object %sz$[autodoc] module analyzer failed: %sF)show_annotation
   	max_chars))get_import_prefixes_from_envrx   
startswithr   r   r   rN   r   r   r   r   r   r   r   r   resultrS   r   lenr   rw   
parse_namer   import_objectr   
for_moduleget_real_modnameanalyzerfind_attr_docsr   debugformat_signature	TypeErrormaxmangle_signature_extra_indentadd_contentextract_summarydatary   rt   )r9   r   r   r   max_item_charsr   display_namer   r}   r~   modnamer   r   r   
documentererrsigr   summarys                      r7   r   zAutosummary.get_items/  s    09913 D	B D	BDLs## 3ABBx#zz#r2262E2EdU]2E2^2^/	3'   TTS^TTTUUr"Z[[#TYYv%6%6ARARATAT  V V V	 ",DK!Ic:.. J $dNYs7||a7G7H7H-II	 //c69UUJ((** r";<<i(,(9(9(;(;  = = =lBI>???++-- r">??(,(9(9(;(;  = = =lBI>???	+&4&?//11'3 '3
# #224444 + + +CSIII&*
######+4 11%1HH 4 4 4 11334  ANS5F5F$FGG	&si@@@
 (*J$""4(((%dk&8&=aaa&@$*BUVVGLL,Wi@AAAAsD   A88
C:A.C55C:AJ


K "J;;K KK<;K<r   c                    t          j                    }d|d<   t          d          }t          j        ddg          }|                    |           t          j        dd          }|                    |           |                    t          j        dd	                     |                    t          j        dd
	                     t          j        d          |                               d fd}|D ]M\  }}}	}
d}d j	        vr!d| d| d|
 dt          j        |           }nd| d| d|
 d}|	} |||           N||gS )zGenerate 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}specrb   zautosummary longtabler      )colsr   )colwidthZ   column_textsr   r<   r=   c                 l   t          j        d          }j                                        \  }}| D ]}t          j        d          }t                      }|                    |d||fz             t          j        |          5  j        	                    |d|           	 t          |d         t           j                  r|d         }n# t          $ r Y nw xY w|                    t          j        d|                     d d d            n# 1 swxY w Y                       |           d S )Nrb   z%s:%d:<autosummary>r   )r
   rO   state_machineget_source_and_linerQ   r   r   r$   ry   nested_parserS   rW   rP   )	r  rO   sourcelinetextr;   vlbodyr9   s	          r7   
append_rowz)Autosummary.get_table.<locals>.append_row  sn   )B--C-AACCLFD$ 6 6r**\\		$ 5 FGGG(R88 6 6J++B4888%d1gu?? +#'7D%   JJu{2t445556 6 6 6 6 6 6 6 6 6 6 6 6 6 6 KKs6   D&(CD
CDC+DD	D	r}   r   z:py:z:`z <z>`\ z>`)r  r   r<   r=   )r   tabular_col_specrF   r
   rK   r   rL   colspecrM   r   r   escape)r9   r   
table_specrK   
real_tablegroupr"  r   r  r  r   	qualifiercol1col2r!  s   `             @r7   r   zAutosummary.get_table  s   
 .00
0
6!"%%[.E-FGGG
Z   Ra(((%   U]2333444U]2333444{2T	 	 	 	 	 	 	" .3 	# 	#)D#w	IT\11TiTT4TT9TT3:c??TT@i@@4@@9@@@DJtT""""E""r6   N)r<   r   )r   r   r   r   r<   r   )
rw   r+   r}   r   r~   r   r   r   r<   r   )r   r   r<   r   )r   r   r<   r   )r2   r3   r4   __doc__required_argumentsoptional_argumentsfinal_argument_whitespacehas_contentr   unchanged_required	unchangedflagr   __annotations__r   r   r   r   r   r5   r6   r7   r   r      s            %K0'"_( K    . . . .`N N N N$. . . .P P P Pd,# ,# ,# ,# ,# ,#r6   r   sr   c                \    |                      d          d                                         S )z+Strip a type hint from argument definition.:r   )r   r   )r5  s    r7   strip_arg_typehintr8    s"    773<<?  """r6   c                   	 t          |           }t          |j                                                  }t	          |          D ]f\  }}|j        t          j        ur |                    t          j                  }|j	        t          j        ur|                    d          }|||<   g|                    |t          j                  }t          |          S # t          $ r | cY S w xY w)zCClean up signature using inspect.signautre() for mangle_signature())
annotationN)default)
parametersreturn_annotation)r&   rN   r<  r   rR   r:  r   emptyrV   r;  r   	Exception)r5  r  r<  iparams        r7   _cleanup_signaturerB    s     ###.//1122
!*-- 	" 	"HAuy66AA}IO33d33!JqMMkkZ9?kSS3xx   s   CC C,+C,   r  r   intc           
        t          |           }t          j        dd|          }t          j        dd|                                          }t          j        dd|          }t          j        dd|          }t          j        dd|          }t          j        d	d|          }t          j        d
d|          }t          j        d|          r+t          j        dd|          }t          j        d|          +t          j        d|          r+t          j        dd|          }t          j        d|          +t          j        d|          r+t          j        dd|          }t          j        d|          +g }g }t          j        d          }|ru|                    |          }|s|                    d          }nH|                    d|                    d                     |                    d          dd         }|ut          |          D ]\  }}t          |          ||<   t          |          D ]\  }}	t          |	          ||<   t          d||dz
            } |re| sdt          d||dz
            z  } nJt          |           |dz
  dz
  dz
  k     r.| dt          d||t          |           z
  dz
  dz
            z  z  } d| z  S )z5Reformat a function signature to a more compact form.z\)\s*->\s.*$)z
^\((.*)\)$z\1z\\\\rb   z\\'z\\"z'[^']*'z"[^"]*"z	\([^)]*\)z<[^>]*>z{[^}]*}z^(.*, |)([a-zA-Z0-9_*]+)\s*=\s*z, r   r  r   Nr   z[%s]      z[, %s]z(%s))rB  r   subr   r   compiler   insertr(  rR   r8  limited_joinr   )
r  r   r5  r   optsopt_remr@  argopts
             r7   r  r    s   3A 	Q''A 	}eQ''--//A 	wAA
vr1A
vr1A
z2q!!A
z2q!!A )L!
$
$ (F<Q'' )L!
$
$ (
)J
"
" &F:r1%% )J
"
" &
)J
"
" &F:r1%% )J
"
" & DDZ:;;F
 MM! 	774==DAqwwqzz"""GGAJJssO   D// * *3$S))QD// * *3$S))Q tTY]
;
;
;C S 	S<di!mLLLLCCXX	A)A---8l45>S5IA5MPQ5QS S S S SC C<r6   docr   rt   c                   dd}| rK| d                                          s1|                     d           | r| d                                          1t          |           D ]%\  }}|                                 s| d	|         }  n&| g k    rd
S  || |j                  }t	          |d         t
          j                  r.|d                                                                          }nOt	          |d         t
          j                  s| d                                          }nt          
                    d                    |                     }t          |          dk    r|d                                          }nd
}t          t          |                    D ]}d                    |d	|dz                                          d          dz   }g |d	d	<    || |j                  }|                    t                     rkt#          |                    t
          j                            s nt(                              d|          }|S )zExtract summary from docstring.rS  r   rq   r   r<   nodes.documentc                    t          t          d          }t          d|          }t                      |_        |                    | |           |S )NBodyrb   )r   r   r#   r    r   r   )rS  rq   r  r;   s       r7   parsezextract_summary.<locals>.parse  sF    'v>>B))$#t$$$r6   r   Nrb   rI   r   z. r   )rS  r   rq   r   r<   rU  )r   poprR   rq   rS   r
   sectionrU   rQ   
periods_rer   r   r   rangerstripendswithWELL_KNOWN_ABBREVIATIONSanyfindallr*   
literal_rerJ  )rS  rt   rX  r@  piecer;   r  	sentencess           r7   r  r    sC        c!fllnn 


  c!fllnn  cNN  5{{}} 	bqb'CE	 byyr 5h'((D$q'5=)) q'..""((**Q11 a&,,.. $$SXXc]]33	y>>Ql((**GGG3y>>**  ))Ifq1uf$566==cBBSHQQQuS("344##$<== T\\%*>??@@ E
 nnS'**GNr6   ...sepr   overflow_markerc                @   |                      |          }t          |          |k     r|S d}d}|D ]@}|t          |          t          |           z   z  }||t          |          z
  k     r|dz  }@ |                      t          |d|                   |gz             S )zJoin 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
    r   r   N)r   r   rN   )rf  r   r   rg  full_strn_charsn_itemsitems           r7   rM  rM  <  s     xxH
8}}y  GG  3t99s3xx''Y_!5!5555qLGG88Dxx))_,==>>>r6   c                  $     e Zd ZdZd fdZ xZS )r   zExceptions raised during importing the target objects.

    It contains an error messages and a list of exceptions as its arguments.
    message
str | Noner   Sequence[BaseException]c                r    t                                          |           t          |          | _        d S rC   )rv   rj   rN   r   )r9   rn  r   rz   s      r7   rj   zImportExceptionGroup.__init__^  s.    !!!z**r6   )rn  ro  r   rp  )r2   r3   r4   r,  rj   r{   r|   s   @r7   r   r   X  sG         
+ + + + + + + + + +r6   r   rx   r   r   c                   dg}| j                             d          }|r|                    d|           | j                             d          }|r5|r|                    d|dz   |z              n|                    d|           |S )z`
    Obtain current Python import prefixes (for `import_by_name`)
    from ``document.env``
    Nz	py:moduler   zpy:classr   )ref_contextr   rL  )rx   r   
currmodule	currclasss       r7   r   r   c  s    
 #'H$$[11J ':&&&##J//I * 	*OOAzC/);<<<<OOAy)))Or6   rC   r   r   Sequence[str | None]r   c                   g }g }|D ]}	 |rd                     || g          }n| }t          |d          \  }}}||||fc S # t          $ r |                    |           Y ]t          $ r4}	|                    |           |                    |	           Y d}	~	d}	~	ww xY wt          d |D             g           }
t	          dd                     |          z  |
          )z~Import a Python object that has the given *name*, under one of the
    *prefixes*.  The first name that succeeds is used.
    r   T)grouped_exceptionNc              3  $   K   | ]}|j         V  d S rC   )r   r   s     r7   	<genexpr>z!import_by_name.<locals>.<genexpr>  s$      *H*HA1<*H*H*H*H*H*Hr6   zno module named %sz or )r   _import_by_namer   r   r   sum)r   r   triedr   prefixprefixed_namer}   r~   r  r   r   s              r7   r   r   x  s3    E)+F  	 % #&$ 8 8 $#2=TX#Y#Y#Y C #vw6666 	( 	( 	(LL'''''# 	 	 	LL'''MM#	 '**H*H*H*H*H"&M&MJ
3fkk%6H6HH*
U
UUs   6AB!$	B!-*BB!Trx  booltuple[Any, Any, str]c                   g }	 |                      d          }d                    |dd                   }|ri	 t          |          }t          ||d                   ||fS # t          t
          t          f$ r&}|                    |j        p|           Y d}~nd}~ww xY wd}d}t          t          dt          |          dz                       D ]u}|}d                    |d|                   }	 t          |           n3# t          $ r&}|                    |j        p|           Y d}~nd}~ww xY w|t          j        v r nv|t          |          k     r8d}	t          j        |         }
||d         D ]}|
}	t          |
|          }
|
|	|fS t          j        |         d|fS # t          t          t          t          f$ r<}|                    |           |rt!          d|          dt	          |j         |d}~ww xY w)z+Import a Python object given its full name.r   NrH   r   rb   r   )r   r   r   getattrr   rW   AttributeErrorr   r   reversedr\  r   sysmodules
ValueErrorKeyErrorr   r   )r   rx  r   
name_partsr  modr   last_jr[   r~   r}   obj_names               r7   r{  r{    s[   "$F(2ZZ__
 ((:crc?++ 	44#G,,sJrN33S'AA^< 4 4 4cm2s333333334 %3z??Q#67788 		 		AFhhz"1"~..G4g&&&& 4 4 4cm2s333333334 #+%% & C
OO##F+g&C&vww/ - -c8,,'';w'w66^X> 2 2 2c 	2&r622<sx(c12sl   4F( 'A! !B8BF( BAF( 4DF( 
D4D/*F( /D44AF( F( (H7G<<Hc                .   	 |                      dd          \  } }t          | |          \  }}}}t          |          }t          |          dk    r|f}|D ]}	t	          j        t          |	d|                    }
|
                                 t                      }|d |
j	        D             z  }|d |
j
        D             z  }||v r|dz   |z   t          ||fc S n1# t          t          t          f$ r}t          |d}~wt          $ r  w xY wt          )zImport an instance variable that has the given *name*, under one of the
    *prefixes*.  The first name that succeeds is used.
    r   r   r   r3   c                    h | ]\  }}|S r5   r5   r   qualnameattrs      r7   r   z&import_ivar_by_name.<locals>.<setcomp>  s    LLL%5hDLLLr6   c                    h | ]\  }}|S r5   r5   r  s      r7   r   z&import_ivar_by_name.<locals>.<setcomp>  s    NNN%5hDNNNr6   N)rsplitr   r%   r   r   r   r  analyzeset	attr_docsr   r   r   r  r   r   )r   r   rx  r  r   r}   r~   r  candidate_objectscandidate_objr   found_attrsr   s                r7   r   r     sb   
[[a((
d*8x*H*H'	3 #3KK !!Q&&!$. 	J 	JM%0V]1^1^__H%%KLL9KLLLLKNN9MNNNNK{"" 3-|S'IIII #	J [1 # # #s"    s   CC C D6C>>Dc                      e Zd ZdZddZdS )AutoLinkzSmart linking role.

    Expands to ':obj:`text`' if `text` is an object that can be imported;
    otherwise expands to '*text*'.
    r<   'tuple[list[Node], list[system_message]]c           	     l   | j                             d                              d          }|J  |d| j        | j        | j        | j        | j        | j                  \  }}|r||fS t          |          dk    sJ t          t          j        |d                   }	 t          | j                   }t          |d         |           ng# t          $ rZ t          t           j        |d                   }t!          j        | j        |                                |d                   |d<   Y nw xY w||fS )Npyr}   r   r   	reftargetr   r  )rx   
get_domainrolerawtextr  r   inlinerr   r   r   r	   r   pending_xrefr   r   r   r
   literalemphasisrU   )r9   
pyobj_roleobjectsr   r  r   r  s          r7   r   zAutoLink.run  sH   X((..33E::
%%%$*UDL$)T[%)\4<O O 	#F?"7||q    H171:>>	D3DH==H<4h????# 	D 	D 	D5=,q/::Ggnn6F6F07	0BD D DGAJJJ	D
 s    *C A!D/.D/N)r<   r  )r2   r3   r4   r,  r   r5   r6   r7   r  r    s2         
     r6   r  ro  c                X     d fd}d } j         j        D ]}d ||          v r|c S d S )Nsuffixr   r<   tuple[str, ...]c                r    j                                                             |           }|dS |j        S )N)restructuredtext)ri   get_source_parsersr   	supported)r  parser_classrw   s     r7   get_supported_formatz,get_rst_suffix.<locals>.get_supported_format   s9    |6688<<VDD((%%r6   r  )r  r   r<   r  )rg   source_suffix)rw   r  r  s   `  r7   get_rst_suffixr    sh    & & & & & & F**  !5!5f!=!===MMM > 4r6   c           
        | j         j        }|du r | j        j        fdj        D             }n|du rnt          | j         j                  fd|D             }|d d          D ]k}t          j        t          j	        | j
        |                    s=t                              t          d          |           |                    |           l|sd S t          |           }|)t                              t          d                     d S ddlm} | j         j        }t'          | j         j                  5   |||| j
        | || j         j        | j         j        	           d d d            d S # 1 swxY w Y   d S )
NTc                    g | ]K}t           j                                                |                    4                    |d           LS )F)base)osr   isfiler   )r   r   rx   s     r7   r   z,process_generate_options.<locals>.<listcomp>  sU     8 8 8Aw~~cll1oo668CLLL// 8 8 8r6   Fc                n    g | ]1}||                     t                              sd          ndz   2S )r   rb   )r^  tuple)r   genfileexts     r7   r   z,process_generate_options.<locals>.<listcomp>  sO     - - - W-=-=eCjj-I-IQs1vvrR - - -r6   z(autosummary_generate: file not found: %szbautosummary generats .rst files internally. But your source_suffix does not contain .rst. Skipped.r   )generate_autosummary_docs)r  	base_pathrw   imported_members	overwriteencoding)rg   autosummary_generatebuilderrx   r   rN   r  r   r  r   rf   r   r   r   remover  sphinx.ext.autosummary.generater  autosummary_imported_membersr   r   autosummary_generate_overwritesource_encoding)rw   genfilesrP   r  r  r  rx   r  s         @@r7   process_generate_optionsr    s3   z.H4ko8 8 8 8 8 8 8	U		3:+,,- - - -#+- - - aaa[ 	' 	'E;tyU;;<< 'r"LMMuUUU&&& C  F~r S T T 	U 	U 	UIIIIIIz>	cj1	2	2 G G!!(6SZ&)<L,/J,U+.:+E	G 	G 	G 	GG G G G G G G G G G G G G G G G G Gs   >,E77E;>E;dict[str, Any]c           	        |                      d           |                     t          t          t          ft          t          ft          t          ft          t          ft          t          f           |                     t
          t          t          ft          t          ft          t          ft          t          ft          t          f           |                     dt                     | 	                    dt                                 |                     dt                     |                     di d           |                     di d	           |                     d
ddt          t          g           |                     ddd           |                     dd d           |                     dg dt          g           |                     dddt                     t           j        ddS )Nzsphinx.ext.autodoc)htmllatexr  mantexinfoautosummaryautolinkzbuilder-initedautosummary_contextTr   r  r  r  Fr   c                    | j         S rC   )autodoc_mock_imports)rg   s    r7   r   zsetup.<locals>.<lambda>K  s	    (C r6   rx   r  autosummary_ignore_module_all)versionparallel_read_safe)setup_extensionadd_noder0   rA   rD   rF   r^   add_directiver   add_roler  connectr  add_config_valuer  rN   sphinx__display_version__)rw   s    r7   setupr  4  s   ,---LL13CD(*:;')9:&(89*,<=  ? ? ? LL"35EF(*:;')9:&(89*,<=  ? ? ? m[111LLXZZ(((KK ":;;;.D9993R@@@/tdD\JJJ94GGG3CCUL L L7UTFKKK8$tLLL1NNNr6   )r9   r:   r;   r0   r<   r=   )r9   r:   r;   r)   r<   r=   )r9   r.   r;   rF   r<   r=   )rw   r+   r}   r   r~   r   r<   r   )r5  r   r<   r   )rC  )r  r   r   rD  r<   r   )rS  r   rt   r   r<   r   )rC  re  )
rf  r   r   r   r   rD  rg  r   r<   r   )rx   r   r<   r   )rC   )r   r   r   rv  r<   r   )T)r   r   rx  r  r<   r  )rC   T)r   r   r   rv  rx  r  r<   r   )rw   r+   r<   ro  )rw   r+   r<   r=   )rw   r+   r<   r  )nr,  
__future__r   r   r  r   r   r  r   r   typesr   typingr   r   r	   docutilsr
   docutils.parsers.rstr   docutils.parsers.rst.statesr   r   r   docutils.statemachiner   r  r   sphinx.configr   sphinx.environmentr   r   r   r   sphinx.ext.autodoc.directiver   r   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%   r&   sphinx.util.matchingr'   collections.abcr(   docutils.nodesr)   r*   sphinx.applicationr+   sphinx.extensionr,   sphinx.util.typingr-   sphinx.writers.htmlr.   	getLoggerr2   r   rK  r[  rb  r_  commentr0   rA   rD   rF   r^   r`   rm   r   r   r8  rB  r  r  rM  r?  r   r   r   r{  r   r  r  r  r  r5   r6   r7   <module>r     s  . .` # " " " " "  				     				 



                   + + + + + + + + + +       + + + + + + N N N N N N N N N N , , , , , ,                    / / / / / / 7 7 7 7 7 7 7 7 B B B B B B B B 5 5 5 5 5 5 ( ( ( ( ( (       " " " " " " 5 5 5 5 5 5 5 5 3 3 3 3 3 3 $ $ $ $ $ $ $ $              ; : : : : : : : ( ( ( ( ( ( 4((((((33333333))))))******------333333		8	$	$ RZ%%
RZ	""
5 
	 	 	 	 	em 	 	 	   
	 	 	 		 	 	 	 	 	 	 	   (2 2 2 2 2 2 2 29 9 9 9 9$ 9 9 9       J]# ]# ]# ]# ]#/ ]# ]# ]#@# # # #
   (8 8 8 8 8v5 5 5 5p ?A(-? ? ? ? ?8+ + + + +9 + + +   , 18V V V V V4,2 ,2 ,2 ,2 ,2^ EL26    D    z   8   #G #G #G #GLO O O O O Or6   