
    -Ph                       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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 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" 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/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9m:Z:m;Z;m<Z< ddl=m>Z>m?Z? ddl@mAZA ddlBmCZC er6ddlDmEZE ddlmFZFmGZG ddlHmIZImJZJ dd lKmLZL dd!l#mMZM dd"lNmOZO dd#lPmQZQmRZR dd$lSmTZT  e5jU        eV          ZW ejX        d%          ZY ejX        d&          ZZd'Z[ G d( d)ej\                  Z]dqd/Z^drd1Z_ G d2 d3ej\                  Z`dsd5Za G d6 d7          Zb G d8 d9e'          Zcdtd@ZddudCZe G dD dEe9          ZfdvdHZgdvdIZhdwdxdNZidydRZj	 dzd{dWZk G dX dYel          Zmd|d]Zn	 d}d~dcZodddhZp	 dddiZq G dj dke:          ZrddmZsddnZtddpZudS )ab  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::
       :signatures: none
       :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cast)nodes)
directives)RSTStateMachineStructstate_classes)
StringList)addnodes)Config)BuildEnvironment)PycodeError)INSTANCEATTROptions)DocumenterBridge)import_module)mock)__)Project)ModuleAnalyzer)SphinxComponentRegistry)loggingrst)NullReporterSphinxDirective
SphinxRolenew_documentswitch_source_input)getmrosignature_from_str)Matcher)nested_parse_to_nodes)Sequence)AnyClassVar)Nodesystem_message)Sphinx)
Documenter)	Extension)ExtensionMetadata
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__     _/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx/ext/autosummary/__init__.pyr3   r3   t           Dr9   r3   selfnodes.NodeVisitornodereturnNonec                    t           j        )z-Hide autosummary toctree list in HTML output.)r	   SkipNoder<   r>   s     r:   autosummary_toc_visit_htmlrD   x   s
    
.r9   r*   c                    d S Nr8   rC   s     r:   autosummary_nooprG   }   s    Dr9   c                      e Zd ZdS )autosummary_tableNr4   r8   r9   r:   rI   rI      r;   r9   rI   r1   c                &   	 t          d|d                   }t          d|d                   }t          d|d                   }t          d|          }|D ]}t          d|d                   }t          d|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.znodes.tabler   znodes.tgroupznodes.tbodyzlist[nodes.row]znodes.entryznodes.paragraph     N)	r   	enumeratelist
isinstancer	   Textastextreplace
IndexError)r<   r>   tabletgrouptbodyrowsrow
col1_entryparjsubnodenew_texts               r:   autosummary_table_visit_htmlr_      s!   ]DG,,neAh//]F2J//%u-- 	2 	2CmSV44J(*Q-88C'S		22 2 2
7guz22 2&~~//77XFFH"Z11CF2	2 	2    s   C>D 
DDc                      e Zd ZdZddZdS )FakeApplicationr   r?   r@   c                    t                      | _        d | _        i | _        t                      | _        t                      | _        t          di           | _        t                      | _
        d S )N )r   
doctreedirevents
extensionssrcdirr   configr   projectr   registry)r<   s    r:   __init__zFakeApplication.__init__   sQ    &&02ffhhr2/11r9   Nr?   r@   )r5   r6   r7   	verbosityrk   r8   r9   r:   ra   ra      s-        I2 2 2 2 2 2r9   ra   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mixedenvr8   )documentr   )r   ra   rh   addr   superrk   r   )r<   rs   rw   apprv   state	__class__s         r:   rk   zFakeDirective.__init__   s    A&&&8,,,
0'5"EEEs##)))dGIIq%88888r9   rl   )r5   r6   r7   rk   __classcell__r|   s   @r:   ro   ro      s=        9 9 9 9 9 9 9 9 9 9r9   ro   rz   r,   objr(   parenttype[Documenter]c                0    t          ||| j                  S )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.
    rj   )_get_documenterrj   )rz   r   r   s      r:   get_documenterr      s     3>>>>r9   rj   r   c                   ddl m}m} t          j                   r|S |t          |d|          }n|}t          |d          r |t                      |j                  n |t                      d           fd|j	        
                                D             }|r|                    d 	           |d
         S |S )r   r   )DataDocumenterModuleDocumenterNr   r5   rc   c                D    g | ]}|                     d d          |S )rc   F)can_document_member).0clsr   
parent_docs     r:   
<listcomp>z#_get_documenter.<locals>.<listcomp>   sC       ""3E:>>  r9   c                    | j         S rF   )priority)r   s    r:   <lambda>z!_get_documenter.<locals>.<lambda>   s    S\ r9   )keyrK   )sphinx.ext.autodocr   r   inspectismoduler   hasattrro   r5   documentersvaluessort)r   r   rj   r   r   parent_doc_clsclassesr   s   `      @r:   r   r      s	    DCCCCCCC   (III)vz"" 9#^MOOV_EE

#^MOOR88
    '..00  G
  11222r{r9   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        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 )%AutosummaryzPretty table containing short signatures and summaries of functions etc.

    autosummary can also optionally generate a hidden toctree:: node.
    r   FT)captionclasstoctreenosignatures	recursive
signaturestemplatezClassVar[OptionSpec]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r |t1          | j                            |d                              rt5          d          }nt5          d          }t6                              |||                                            |                    |           |rmt?          j                     }||d<   d |D             |d	<   d
|d<   d |d<   | j                            d          |d<    |j        tC          dd|                     d| j        vr8d| j        v r/t6                              t5          d          |d
                    |S )Nc                    g | ]o}|                                 t          j        d |                                 d                   C|                                                                 d         pS )z^[~a-zA-Z_]r   )stripresearchsplit)r   xs     r:   r   z#Autosummary.run.<locals>.<listcomp>  so     
 
 
wwyy
  Y~qwwyy|DD
GGIIOOa 
 
 
r9   r   Fz5autosummary references excluded document %r. Ignored.zMautosummary: stub file not found %r. Check your autosummary_generate setting.locationincludefilesc                    g | ]}d |fS rF   r8   )r   docns     r:   r   z#Autosummary.run.<locals>.<listcomp>,  s    %H%H%HttTl%H%H%Hr9   entriesrK   maxdepthglobr   rc   z;A captioned autosummary requires :toctree: option. ignored.)"r   rv   r{   rw   reporterr   linenobridgecontent	get_items	get_tableoptions	posixpathdirnamedocnamer   r%   rh   exclude_patternsautosummary_filename_mapgetjoinnormpath
found_docsstrdoc2pathr   loggerwarningget_locationappendr   r   r3   )r<   namesitemsr	   r   tree_prefixdocnamesexcludedfilename_map_name_sig_summary	real_namer   msgtocnodes                   r:   runzAutosummary.run  s   &Hdj)2GIIt{DJ
 

 
\
 
 

 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DH$5$5gu$E$E F FGG  S  !G 
 NN3	D<M<M<O<ONPPP(((( ?"*,,*2'%H%Hx%H%H%H	"&(
#"&%)\%5%5i%@%@	"_RW==>>>DL((Y$,-F-FNNPQQr    
 r9   namer   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g |j        |j        }ng |j        |}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   rh   autosummary_mock_importsimport_by_nameImportExceptionGroupimport_ivar_by_nameImportError	__cause__
exceptionsargs)r<   r   r   excexc2errorss         r:   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~ 96W6W6W!83>!84!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r   r(   r   	full_namerj   r   r-   c               H    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   r   )r<   r   r   r   rj   docclss         r:   create_documenterzAutosummary.create_documenterM  s,     !fx@@@vdk9---r9   r   	list[str]&list[tuple[str, str | None, str, str]]c           	        t          | j                  }g }| j                            d          }|d| j        v rdnd}|dvrd|d}t	          |          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           *	 t7          j        |                                          |_        |j                                         n9# t@          $ r,}t          !                    d|           d|_        Y d}~nd}~ww xY w|dk    rd}n	 |"                    d          }n$# tF          $ r |"                                }Y nw xY w|sd}n@|dk    r	|dk    rd}n1tI          d|t+          |          z
            }tK          ||          }d|_&        |'                    d           tQ          | j        j        j)        dd         | j*        j+                  }|                    ||||	f           |S ) zTry to import the given names, and return a list of
        ``[(name, signature, summary_string, real_name), ...]``.

        signature is already formatted and is None if :nosignatures: option was given.
        r   Nr   nonelong>   r   r   shortz3Invalid value for autosummary :signatures: option: z*. Valid values are 'none', 'short', 'long'2   ~   .rK   )r   c                B    h | ]}d t          |          j         d| S )z* z: )typer5   r   es     r:   	<setcomp>z(Autosummary.get_items.<locals>.<setcomp>~  s2    TTT;DGG$4;;;;TTTr9   z4autosummary: failed to import %s.
Possible hints:
%s
r   z::r   zfailed to parse name %src   zfailed to import object %sz$[autodoc] module analyzer failed: %sF)show_annotationr   z()u   (…)
   	max_chars),get_import_prefixes_from_envrv   r   r   
ValueError
startswithr   r   r   rO   r   r   r   r   r   r   r   r   resultrP   r   lenr   	_registry
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datar{   rw   )r<   r   r   r   signatures_optionr   max_item_charsr   display_namer   r   r   modnamer   r   r   
documentererrsigr  summarys                        r:   r   zAutosummary.get_items]  s    0998: L,,\::$*8DL*H*Hf$===S$S S S  S//! X	B X	BDLs## 3ABBx#zz#r2262E2E8 3F 3 3/	3 (   TTS^TTTUUOPPIIf%%!..00	      ",DK!Ic:.. K $dNYs7||a7G7I7I-JJ	 //VY1C 0  J ((** 011!..00    
 lBI>???++-- 344!..00    
 lBI>???
+&4&?//11' '
#
 #224444 + + +CSIII&*
######+ !F**8$55e5LLCC  8 8 8$5577CCC8  ECC&'11d{{% #B\9J9J(J K KI*3)DDDC
 (*J$""4(((%dk&8&=aaa&@$*BUVVGLL,Wi@AAAAsD   B::
D<A.D77D<AK
L"K>>LL''MMr   c                    t          j                    }d|d<   t          d          }t          j        dddg j                            dd                    }|                    |           t          j        dd	
          }|                    |           |                    t          j	        dd                     |                    t          j	        dd                     t          j
        d          |                               d fd}|D ]F\  }}}	}
d}|d| d| d|
 d}n d| d| d|
 dt          j        |           }|	} |||           G||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}specrc   autosummary	longtabler   r8   r      )colsr   )colwidthZ   column_textsr   r?   r@   c                     t          j        d          }	j                                        \  }}| D ]}t	          |g| d| d          }t          	j        |          5  t          	j        |d          }|r)t          |d         t           j	                  r	|d         }nt          j	        d          }|
                    t          j        d|                     d d d            n# 1 swxY w Y   ŉ
                    |           d S )Nrc   :z:<autosummary>F)allow_section_headingsr   )r	   rY   state_machineget_source_and_liner   r"   r{   r&   rP   	paragraphr   entry)
r(  rY   sourcelinetextvl	col_nodesr>   bodyr<   s
           r:   
append_rowz)Autosummary.get_table.<locals>.append_row  sQ   )B--C-AACCLFD$ 
6 
66(H(HD(H(H(HII(R88 6 6 5
Bu! ! !I ! 3Z	!eo%N%N 3(|$r22JJu{2t445556 6 6 6 6 6 6 6 6 6 6 6 6 6 6 KKs   "A?C--C1	4C1	r   Nz:py:z:`z <z>`z>`\ )r(  r   r?   r@   )r   tabular_col_specrI   r	   rU   r   r   r   rV   colspecrW   r   escape)r<   r   
table_specrU   
real_tablegroupr6  r   r  r  r   	qualifiercol1col2r5  s   `             @r:   r   zAutosummary.get_table  s   
 .00
0
6!"%%[Tdl6F6FwPR6S6ST
 
 

 	Z   Ra(((%   U]2333444U]2333444{2T	 	 	 	 	 	 	  .3 	# 	#)D#w	I{@i@@4@@9@@@TiTT4TT9TT3:c??TTDJtT""""E""r9   N)r?   r   )r   r   r   r   r?   r   )
r   r(   r   r(   r   r   rj   r   r?   r-   )r   r   r?   r   )r   r   r?   r   )r5   r6   r7   __doc__required_argumentsoptional_argumentsfinal_argument_whitespacehas_contentr
   unchanged_requiredclass_option	unchangedflagr   __annotations__r   r   r   r   r   r8   r9   r:   r   r      s          
  %K0('"_ *() )K    8 8 8 8tN N N N$. . . . p p p pd.# .# .# .# .# .#r9   r   sr   c                \    |                      d          d                                         S )z+Strip a type hint from argument definition.r*  r   )r   r   )rJ  s    r:   strip_arg_typehintrL     s"    773<<?  """r9   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$   rO   rP  r   rN   rN  r   emptyrS   rO  r   	Exception)rJ  r  rP  iparams        r:   _cleanup_signaturerV    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\\\\rc   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))rV  r   subr   r   compiler   insertr<  rN   rL  limited_joinr  )
r  r  rJ  r   optsopt_remrT  argopts
             r:   r  r    s   3A 	Q''A 	}eQ''--//A 	wAA
vr1A
vr1A
z2q!!A
z2q!!A )a  ( F<Q'' )a  ( )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  	<di!mLLLLCCXX	A)A---8ldi#c((&:Q&>&B    C C<r9   docr   rw   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.rg  r   rs   r(   r?   nodes.documentc                    t          t          d          }t          d|          }t                      |_        |                    | |           |S )NBodyrc   )r   r   r!   r   r   r   )rg  rs   r,  r>   s       r:   parsezextract_summary.<locals>.parseZ  sF    'v>>B))$#t$$$r9   r   Nrc   rL   r   z. r   )rg  r   rs   r(   r?   ri  )r   poprN   rs   rP   r	   sectionrR   r.  
periods_rer   r   r  rangerstripendswithWELL_KNOWN_ABBREVIATIONSanyfindallr+   
literal_rer^  )rg  rw   rl  rT  piecer>   r  	sentencess           r:   r  r  W  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>>**  ))IgAg$677>>sCCcIQQQuS("344##$<== T\\%*>??@@ E
 nnS'**GNr9   ...sepr   overflow_markerc                @   |                      |          }t          |          |k     r|S d}d}|D ]@}|t          |          t          |           z   z  }||t          |          z
  k     r|dz  }@ |                      g t          |d|                   |          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  rO   )rz  r   r  r{  full_strn_charsn_itemsitems           r:   ra  ra    s     xxH
8}}y  GG  3t99s3xx''Y_!5!5555qLGG88=d5'?++=_=>>>r9   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]r?   r@   c                r    t                                          |           t          |          | _        d S rF   )ry   rk   rO   r   )r<   r  r   r|   s      r:   rk   zImportExceptionGroup.__init__  s0     	!!!z**r9   )r  r  r   r  r?   r@   )r5   r6   r7   r@  rk   r}   r~   s   @r:   r   r     sG         
+ + + + + + + + + +r9   r   rv   r   r   c                   dg}| j                             d          }|r|                    d|           | j                             d          }|r4|r|                    d| d|            n|                    d|           |S )z[Obtain current Python import prefixes (for `import_by_name`)
    from ``document.env``
    Nz	py:moduler   zpy:classr   )ref_contextr   r`  )rv   r   
currmodule	currclasss       r:   r  r    s     #'H$$[11J ':&&&##J//I * 	*OOA*::y::;;;;OOAy)))Or9   rF   r   r   Sequence[str | None]r   c           	        g }g }|D ]}|]|                      | d          rEt          d          }t                              || |                     | d          dd           a	 |r| d|  }n| }t          |d          \  }}}	||||	fc S # t          $ r |                    |           Y t          $ r4}
|                    |           |                    |
           Y d}
~
d}
~
ww xY wt          j
        t          j        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.
    Nr   zKSummarised items should not include the current module. Replace %r with %r.r!  import_cycle)r   subtypeT)grouped_exceptionc              3  $   K   | ]}|j         V  d S rF   )r   r   s     r:   	<genexpr>z!import_by_name.<locals>.<genexpr>  s$      55555555r9   zno module named %sz or )r  r   r   r   removeprefix_import_by_namer   r   r   	functoolsreduceoperatoriaddr   )r   r   triedr   prefixr   prefixed_namer   r   r  r   r   s               r:   r   r     s    E)+F  $//V,,,"?"?& C NN!!V,,,//"&     	 %#) 2 2D 2 2 $#2$ $ $ C !#vw6666 	( 	( 	(LL'''''# 	 	 	LL'''MM#	 '0&655f555r' 'J 3fkk%6H6HH*
U
UUs   )&BC03	C0<*C++C0Tr  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   NrK   r   rc   r   )r   r   r   getattrr   rT   AttributeErrorr   r   reversedrp  r  sysmodulesr  KeyErrorr   r   )r   r  r   
name_partsr  modr   last_jr\   r   r   obj_names               r:   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| 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   r6   c                    h | ]\  }}|S r8   r8   r   qualnameattrs      r:   r   z&import_ivar_by_name.<locals>.<setcomp>@  s    LLL%5hDLLLr9   c                    h | ]\  }}|S r8   r8   r  s      r:   r   z&import_ivar_by_name.<locals>.<setcomp>A  s    NNN%5hDNNNr9   N)rsplitr   r#   r  r   r
  r  analyzeset	attr_docsr   r   r   r  r   r   )r   r   r  r  r   r   r   r  candidate_objectscandidate_objr  found_attrsr   s                r:   r   r   )  sm   [[a((
d*8x*H*H'	3 #3KK !!Q&&!$. 
	I 
	IM%0|W== H %%KLL9KLLLLKNN9MNNNNK{""#,,d,,lCHHHH #
	I [1 # # #s"    s   CC C D5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           	     T   | j         j        j                            d          }|J  |d| j        | j        | j        | j        | j        | j	                  \  }}|r||fS t          |          dk    sJ t          d|d                   }	 t          | j                   }|d         fd|D             }t          |           n]# t          $ rP t          d|d                   }t          j        | j        |                                |d         	          |d<   Y nw xY w||fS )
Nr   r   zaddnodes.pending_xrefr   	reftargetc                T    g | ]$}|                     | d          s|k    "|%S )Nr   )r  )r   r  r   s     r:   r   z AutoLink.run.<locals>.<listcomp>k  sL       >655 "9=  :Hr9   znodes.literalr   r#  )rv   domainspython_domainrolerawtextr2  r   inlinerr   r   r  r   r  r   r   r	   emphasisrR   )r<   
pyobj_roleobjectsr   pending_xrefr   literalr   s          @r:   r   zAutoLink.runV  sj   X%388??
%%%$*LIKLLL
 
  	#F?"7||q    3WQZ@@	3DH==H,D   &  H 4****# 	 	 	?LO<<Ggnn..	8J  GAJJJ	 s   :C	 	AD#"D#N)r?   r  )r5   r6   r7   r@  r   r8   r9   r:   r  r  O  s2         " " " " " "r9   r  r  c                X     d fd}d } j         j        D ]}d ||          v r|c S d S )Nsuffixr   r?   tuple[str, ...]c                    j                                                             |                     d                    }|dS |j        S )Nr   )restructuredtext)rj   get_source_parsersr   r  	supported)r  parser_classrz   s     r:   get_supported_formatz,get_rst_suffix.<locals>.get_supported_format|  sH    |6688<<V=P=PQT=U=UVV((%%r9   r  )r  r   r?   r  )rh   source_suffix)rz   r  r  s   `  r:   get_rst_suffixr  {  sh    & & & & & & F**  !5!5f!=!===MMM > 4r9   c           
        | j         j        }|du r| j        fdj        D             }n|du rnt	          | j         j                  fd|D             }|d d          D ][}| j        |z                                  s=t          	                    t          d          |           |                    |           \|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 | ]M}                     |                                          )t                               |d                     NS )F)base)r   is_filer   )r   r   rv   s     r:   r   z,process_generate_options.<locals>.<listcomp>  s]     
 
 
||A&&((
QU++,,
 
 
r9   Fc                n    g | ]1}||                     t                              sd          ndz   2S )r   rc   )rr  tuple)r   genfileexts     r:   r   z,process_generate_options.<locals>.<listcomp>  sO     
 
 
 W%5%5eCjj%A%AIs1vvrJ
 
 
r9   z(autosummary_generate: file not found: %szcautosummary generates .rst files internally. But your source_suffix does not contain .rst. Skipped.r   )generate_autosummary_docs)r  	base_pathrz   imported_members	overwriteencoding)rh   autosummary_generaterv   r   rO   r  rg   r  r   r   r   remover  sphinx.ext.autosummary.generater  autosummary_imported_membersr   r   autosummary_generate_overwritesource_encoding)rz   genfilesr/  r  r  r  rv   r  s         @@r:   process_generate_optionsr    s   z.H4g
 
 
 
^
 
 

 
U		3:+,,
 
 
 
#
 
 

 aaa[ 	' 	'EJ&//11 'r"LMMuUUU&&& C  F~I 	
 	
 	
 	IIIIIIz>	cj1	2	2 	
 	
!!j-j?Z/	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
s   ),E""E&)E&r/   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t          t          h                     |                     d	i d
t          t          h                     |                     dddt          t           t"          h                     |                     dddt          t           h                     |                     dd dt          t"          t$          h                     |                     dddt          t           h                     |                     dddt          t           h                     t&          j        ddS )Nzsphinx.ext.autodoc)htmllatexr2  mantexinfor!  autolinkzbuilder-initedautosummary_contextrv   )typesr   r  r  Tr  rc   r   c                    | j         S rF   )autodoc_mock_imports)rh   s    r:   r   zsetup.<locals>.<lambda>  s	    v2 r9   r  Fautosummary_ignore_module_all)versionparallel_read_safe)setup_extensionadd_noder3   rD   rG   rI   r_   add_directiver   add_roler  connectr  add_config_value	frozensetdictr  rO   r  sphinx__display_version__)rz   s    r:   setupr    sk   ,---LL(*:;!12 01/0!#34     LL*,<=!12 01/0!#34     m[111LLXZZ(((KK ":;;;.ED6ARARSSS"Bi6G6G     e9dD\3J3J     ($)TF:K:K     "22u&&	     &rD69J9J     'uItf<M<M    
 -"  r9   )r<   r=   r>   r3   r?   r@   )r<   r=   r>   r*   r?   r@   )r<   r1   r>   rI   r?   r@   )rz   r,   r   r(   r   r(   r?   r   )r   r(   r   r(   rj   r   r?   r   )rJ  r   r?   r   )rW  )r  r   r  rX  r?   r   )rg  r   rw   r(   r?   r   )rW  ry  )
rz  r   r   r   r  rX  r{  r   r?   r   )rv   r   r?   r   )rF   )r   r   r   r  r?   r   )T)r   r   r  r  r?   r  )rF   T)r   r   r   r  r  r  r?   r   )rz   r,   r?   r  )rz   r,   r?   r@   )rz   r,   r?   r/   )vr@  
__future__r   r  r   r  r   r   r  r   pathlibr   r  r   typingr   r   docutilsr	   docutils.parsers.rstr
   docutils.parsers.rst.statesr   r   r   docutils.statemachiner   r  r   sphinx.configr   sphinx.environmentr   sphinx.errorsr   r   r   r   sphinx.ext.autodoc.directiver   sphinx.ext.autodoc.importerr   sphinx.ext.autodoc.mockr   sphinx.localer   sphinx.projectr   sphinx.pycoder   sphinx.registryr   sphinx.utilr   r   sphinx.util.docutilsr   r   r    r!   r"   sphinx.util.inspectr#   r$   sphinx.util.matchingr%   sphinx.util.parsingr&   collections.abcr'   r(   r)   docutils.nodesr*   r+   sphinx.applicationr,   r-   sphinx.extensionr.   sphinx.util.typingr/   r0   sphinx.writers.html5r1   	getLoggerr5   r   r_  ro  rv  rs  commentr3   rD   rG   rI   r_   ra   ro   r   r   r   rL  rV  r  r  ra  rS  r   r  r   r  r   r  r  r  r  r8   r9   r:   <module>r     s4  . .` # " " " " "           				 



                   & & & & & & & &       + + + + + + N N N N N N N N N N , , , , , ,                    / / / / / / % % % % % % 4 4 4 4 4 4 4 4 9 9 9 9 9 9 5 5 5 5 5 5 ( ( ( ( ( (       " " " " " " ( ( ( ( ( ( 3 3 3 3 3 3 $ $ $ $ $ $ $ $              ; : : : : : : : ( ( ( ( ( ( 5 5 5 5 5 5 
5(((((($$$$$$$$33333333))))))------******@@@@@@@@444444		8	$	$ RZ%%
RZ	""
5 	 	 	 	 	em 	 	 	   
	 	 	 		 	 	 	 	 	 	 	   .
2 
2 
2 
2 
2 
2 
2 
29 9 9 9 9$ 9 9 9? ? ? ?% % % %VP# P# P# P# P#/ P# P# P#f# # # #
   (; ; ; ; ;|6 6 6 6t MR? ? ? ? ?:
+ 
+ 
+ 
+ 
+9 
+ 
+ 
+   * 18)V )V )V )V )VX,2 ,2 ,2 ,2 ,2` TX         L) ) ) ) )z ) ) )X   1
 1
 1
 1
h0 0 0 0 0 0r9   