
    }c}z                     8   d 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mZmZmZmZmZmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZmZmZ ddlm Z  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.m/Z/ ddl0m1Z1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z<m=Z= ddl>m?Z? ddl@mAZAmBZB ddlCmDZDmEZEmFZFmGZGmHZH ddlImJZJ ddlKmLZL ddlMmNZN ddlOmPZP  eAjQ        eR          ZS ejT        d          ZU ejT        d           ZVd!ZW G d" d#ejX                  ZYd$ejZ        d%eYd&dfd'Z[d$ejZ        d%ed&dfd(Z\ G d) d*ejX                  Z]d$ePd%e]d&dfd+Z^ e*d,d-die(i             G d. d/          Z_ G d0 d1e1          Z`d2e$d3ed4ed&ee/         fd5Za G d6 d7eE          Zbd8ecd&ecfd9Zdd8ecd&ecfd:ZedWd<ecd=efd&ecfd>Zgd?eec         d@ed&ecfdAZh	 	 dXdCecdDeec         d=efdEecd&ecf
dFZi G dG dHej          ZkdIe,d&eec         fdJZldgdKfdLecdMeec         dNemd&eeceeecf         fdOZndYdLecdNemd&eeeecf         fdPZodgdKfdLecdMeec         dNemd&eeceeecf         fdQZp G dR dSeF          Zqd2e$d&ecfdTZrd2e$d&dfdUZsd2e$d&eecef         fdVZtdS )Za_  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'.
    N)	Parameter)path)
ModuleType)AnyDictListOptionalSequenceTupleTypecast)nodes)Nodesystem_message)
directives)RSTStateMachineStructstate_classes)
StringList)addnodes)Sphinx)Config)RemovedInSphinx60WarningRemovedInSphinx70Warningdeprecated_alias)BuildEnvironment)INSTANCEATTR
Documenter)DocumenterBridgeOptions)import_module)mock)__)Project)ModuleAnalyzerPycodeError)SphinxComponentRegistry)loggingrst)NullReporterSphinxDirective
SphinxRolenew_documentswitch_source_input)signature_from_str)Matcher)
OptionSpec)HTMLTranslatorz	\.(?:\s+)z::\s*$)zet al.z i.e.c                       e Zd ZdS )autosummary_tocN__name__
__module____qualname__     ?lib/python3.11/site-packages/sphinx/ext/autosummary/__init__.pyr4   r4   d           Dr:   r4   selfnodereturnc                     t           j        )z-Hide autosummary toctree list in HTML output.)r   SkipNoder=   r>   s     r;   autosummary_toc_visit_htmlrC   h   s
    
.r:   c                     d S Nr9   rB   s     r;   autosummary_nooprF   m   s    Dr:   c                       e Zd ZdS )autosummary_tableNr5   r9   r:   r;   rH   rH   s   r<   r:   rH   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tbodyr   rowentry	paragraph	enumeratelist
isinstanceTextastextreplace
IndexError)r=   r>   rM   rN   rO   rowsrP   
col1_entryparjsubnodenew_texts               r;   autosummary_table_visit_htmlr`   w   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zsphinx.ext.autosummary_appc                       e Zd Zd ZdS )FakeApplicationc                     d | _         d | _        i | _        d | _        t	                      | _        t          d d           | _        t                      | _	        d S rE   )

doctreedirevents
extensionssrcdirr   configr$   projectr'   registry)r=   s    r;   __init__zFakeApplication.__init__   sK    hhtT**/11r:   N)r6   r7   r8   rl   r9   r:   r;   rc   rc      s#        2 2 2 2 2r:   rc   c                         e Zd Zd fdZ xZS )FakeDirectiver?   Nc                 >   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   rc   ri   addr   superrl   r    )r=   rr   ru   appenvstate	__class__s         r;   rl   zFakeDirective.__init__   s    A&&&8,,,
0'4FFFs##)))dGIIq%88888r:   )r?   N)r6   r7   r8   rl   __classcell__r{   s   @r;   rn   rn      s=        9 9 9 9 9 9 9 9 9 9r:   rn   rx   objparentc                    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ModuleDocumenterNr6    c                 D    g | ]}|                     d d          |S )r   F)can_document_member).0clsr~   
parent_docs     r;   
<listcomp>z"get_documenter.<locals>.<listcomp>   sH     G G Gs))#r5*EEGs G G Gr:   c                     | j         S rE   )priority)r   s    r;   <lambda>z get_documenter.<locals>.<lambda>   s    S\ r:   )keyrJ   )sphinx.ext.autodocr   r   inspectismoduleget_documenterhasattrrn   r6   rk   documentersvaluessort)rx   r~   r   r   r   parent_doc_clsclassesr   s    `     @r;   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{r:   c            
       P   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eed<   dee         fdZd	ed
ee         deeeeef         fdZdededededdf
dZdee         deeeeeef                  fdZdeeeeeef                  dee         f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templateoption_specr?   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     r;   r   z#Autosummary.run.<locals>.<listcomp>   ss     K K K!GGIIK"$)NAGGIIaL"I"IK""1% K K Kr:   r   z5autosummary references excluded document %r. Ignored.zMautosummary: stub file not found %r. Check your autosummary_generate setting.locationincludefilesc                     g | ]}d |fS rE   r9   )r   docns     r;   r   z#Autosummary.run.<locals>.<listcomp>  s    %H%H%HttTl%H%H%Hr:   entriesrJ   maxdepthglobr   r   z;A captioned autosummary requires :toctree: option. ignored.)!r   ry   rz   ru   reporterr    linenobridgecontent	get_items	get_tableoptions	posixpathdirnamedocnamer   r0   ri   exclude_patternsautosummary_filename_mapgetjoinnormpath
found_docsdoc2pathr#   loggerwarningget_locationappendr   r   r4   )r=   namesitemsr   r   tree_prefixdocnamesexcludedfilename_map_name_sig_summary	real_namer   msgtocnodes                   r;   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 x 1 1'4 @ @AA 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 	/NN2[\\$)"I  / / / r:   nameprefixesc                    t          | j        j                  5  	 t          ||          cd d d            S # t          $ rw}	 t          ||          cY d }~cd d d            S # t          $ rC}|j        r|j        |j        gz   }n|j        |gz   }t	          |j	        d         |          d }~ww xY wd }~ww xY w# 1 swxY w Y   d S )Nr   )
r"   ri   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 	D 	DD%dH55	D 	D 	D 	D 	D 	D 	D 	D ( 
D 
D 
DD.tX>>>>>>>	D 	D 	D 	D 	D 	D 	D 	D # D D D~ 969nGW6W!$4&!8.sx{FCCCD	
D	D 	D 	D 	D 	D 	D 	D 	D 	D 	DsP   B<8
B9A$B9B<$
B1.>B,,B11B44B99B<<C C rx   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   )r=   rx   r~   r   r   docclss         r;   create_documenterzAutosummary.create_documenter!  s)      S&11vdk9---r:   r   c           	      J   t          | j                  }g }d}|D ]}|}|                    d          r%|dd         }|                    d          d         }	 |                     ||          \  }}}	}
n# t
          $ r}t          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           6	 t3          j        |                                          |_        |j                                         n9# t<          $ r,}t                              d|           d|_        Y d}~nd}~ww xY w	 |                     d          }n$# tB          $ r |                                 }Y nw xY w|sd}n1tE          d|t'          |          z
            }tG          ||          }|$                    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.rJ   )r   c              3   J   K   | ]}d t          |          j        d|V  dS )z* z: N)typer6   r   es     r;   	<genexpr>z(Autosummary.get_items.<locals>.<genexpr>>  s:      !]!]Q0@0@0@!!"D!]!]!]!]!]!]r:   z4autosummary: failed to import %s.
Possible hints:
%s
r   z::zfailed to parse name %sr   zfailed to import object %sz$[autodoc] module analyzer failed: %sF)show_annotation
   	max_chars))get_import_prefixes_from_envry   
startswithr   r   r   rT   setr   r   r   r#   r   r   r   r   resultrU   r   lenr   rx   
parse_namer   import_objectr%   
for_moduleget_real_modnameanalyzerfind_attr_docsr&   debugformat_signature	TypeErrormaxmangle_signatureadd_contentextract_summarydatarz   ru   )r=   r   r   r   max_item_charsr   display_namer   r~   r   modnamer   r   r   
documentererrsigr   summarys                      r;   r   zAutosummary.get_items+  s    09913 A	B A	BDLs## 3ABBx#zz#r2262E2EdU]2E2^2^/	3'   c!]!]cn!]!]!]]]^^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@@@ ""4(((%dk&8&=aaa&@$*BUVVGLL,Wi@AAAAsD   A88
DA;DDAJ
K!"KKK((L	L	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t          ddf 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}specr   zautosummary longtabler      )colsr   )colwidthZ   column_textsr?   Nc                  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 )Nr   z%s:%d:<autosummary>r   )r   rP   state_machineget_source_and_linerR   r   r   r.   rz   nested_parserU   rY   rQ   )	r  rP   sourcelinetextr>   vlbodyr=   s	          r;   
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   tabular_col_specrH   r   rM   r   rN   colspecrO   strr   r)   escape)r=   r   
table_specrM   
real_tablegroupr  r   r
  r  r   	qualifiercol1col2r  s   `             @r;   r   zAutosummary.get_tablez  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	c 	d 	 	 	 	 	 	 	" .3 	# 	#)D#w	IT\1 I I2;))TTT999cjY\ooo^I .7YYiiiHDJtT""""E""r:   N)r6   r7   r8   __doc__required_argumentsoptional_argumentsfinal_argument_whitespacehas_contentr   unchanged_required	unchangedflagr   r1   __annotations__r   r   r   r   r   r   r   r   r   r   r   r9   r:   r;   r   r      s           %K0'"_( K   .T$Z . . . .`D3 D$s) Dc3PSUXFX@Y D D D D .V .# ."%.25.:F. . . .MtCy MT%S#s8J2K-L M M M M^,#tE#sC*<$=> ,#4: ,# ,# ,# ,# ,# ,#r:   r   sc                 \    |                      d          d                                         S )z+Strip a type hint from argument definition.:r   )r   r   )r1  s    r;   strip_arg_typehintr4    s"    773<<?  """r:   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/   rT   r8  r   rS   r6  r   emptyrX   r7  r   	Exception)r1  r
  r8  iparams        r;   _cleanup_signaturer>    s     ###.//1122
!*-- 	" 	"HAuy6 BAA}IO3 4d33!JqMMkkZ9?kSS3xx   s   CC C,+C,   r
  r   c           
         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\\\\r   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))r>  r   subr   r   compiler   insertr$  rS   r4  limited_joinr   )
r
  r   r1  r   optsopt_remr<  argopts
             r;   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-- 	S8l45>S5IA5MPQ5QS S S S SC C<r:   docru   c                    dt           t                   dt          dt          j        f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t0                              d|          }|S )zExtract summary from docstring.rN  rr   r?   c                     t          t          d          }t          d|          }t                      |_        |                    | |           |S )NBodyr   )r   r   r-   r*   r   r   )rN  rr   r  r>   s       r;   parsezextract_summary.<locals>.parse  sF    'v>>B))$#t$$$r:   r   Nr   rK   r   z. r   )r   r   r   r   ru   r   poprS   rr   rU   sectionrW   rR   
periods_rer   r   r   rangerstripendswithWELL_KNOWN_ABBREVIATIONSanyfindallr   
literal_rerE  )rN  ru   rR  r<  piecer>   r  	sentencess           r;   r  r    sc   49        c!fllnn 


  c!fllnn  cNN  5{{}} 	bqb'CE	 by 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Nr:   ...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   rT   )r`  r   r   ra  full_strn_charsn_itemsitems           r;   rH  rH  5  s     xxH
8}}y  GG  3t99s3xx''Y_!5!555 	qLGG88Dxx))_,==>>>r:   c                   D     e Zd ZdZdee         dee         f 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.
    messager   c                 r    t                                          |           t          |          | _        d S rE   )rw   rl   rT   r   )r=   rh  r   r{   s      r;   rl   zImportExceptionGroup.__init__W  s.    !!!z**r:   )
r6   r7   r8   r(  r	   r   r
   BaseExceptionrl   r|   r}   s   @r;   r   r   Q  s^         
+ +8M;R + + + + + + + + + +r:   r   ry   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   rG  )ry   r   
currmodule	currclasss       r;   r   r   \  s    
 &*FH$$[11J ':&&&##J//I * 	*OOAzC/);<<<<OOAy)))Or:   Tr   r   grouped_exceptionc                 T   |du rt          j        dt          d           g }g }|D ]}	 |rd                    || g          }n| }t	          ||          \  }}}	||||	fc S # t
          $ r |                    |           Y \t          $ r4}
|                    |           |                    |
           Y d}
~
d}
~
ww xY w|r@t          d |D             g           }t          dd	                    |          z  |          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.
    FzUsing grouped_exception keyword for import_by_name() is not recommended. It will be removed at v7.0.  Therefore you should catch ImportExceptionGroup exception instead of ImportError.r  )
stacklevelr   Nc              3   $   K   | ]}|j         V  d S rE   )r   r   s     r;   r   z!import_by_name.<locals>.<genexpr>  s$      .L.Lq|.L.L.L.L.L.Lr:   zno module named %sz or )	warningswarnr   r   _import_by_namer   r   r   sum)r   r   ro  triedr   prefixprefixed_namer~   r   r  r   r   s               r;   r   r   q  s   
 E! > U /1	> 	> 	> 	>
 E)+F  	 % #&$ 8 8 $#2=BS#T#T C #vw6666 	( 	( 	(LL'''''# 	 	 	LL'''MM#	  E*-.L.LV.L.L.Lb*Q*Q
"#7&++e:L:L#LjYYY.U1C1CCDDDs   5A""C 	C *B;;C 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|          t	          |j         |d}~ww xY w)z+Import a Python object given its full name.r   NrJ   r   r   r   )r   r   r!   getattrr   rY   AttributeErrorr   r   reversedrV  r   sysmodules
ValueErrorKeyErrorr   r   )r   ro  r   
name_partsr  modr   last_jr]   r   r~   obj_names               r;   ru  ru    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# 	7F+g&C&vww/ - -c8,,'';w'w66^X> 2 2 2c 	2&r62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 6G;;H c                    	 |                      dd          \  } }t          | ||          \  }}}}|                    |dz   d          }t          j        t          |d|                    }	|	                                 ||f|	j        v s||f|	j        v r|dz   |z   t          ||f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   r7   N)rsplitr   rX   r%   r   r{  analyze	attr_docsannotationsr   r   r  r&   r   )r   r   ro  attrr   r~   r   r  qualnamer   r   s              r;   r   r     s   
[[a((
d*8xIZ*[*['	3$$Ws]B77!,WS,-P-PQQdx11 	Fh5EI]5] 	Fs?T)<gEE	F[1 # # #s"    s   B%B) )C CCc                   F    e Zd ZdZdeee         ee         f         f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?   c           	      d   | j                             d                              d          } |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  )ry   
get_domainrolerawtextr  r   inlinerr   r   r   r   r   pending_xrefr   r   r   r   literalemphasisrW   )r=   
pyobj_roleobjectsr   r  r   r  s          r;   r   zAutoLink.run  s<   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)	r6   r7   r8   r(  r   r   r   r   r   r9   r:   r;   r  r    sL         
U4:tN';;<      r:   r  c                      dt           dt          t           df         f fd}d } j        j        D ]}d ||          v r|c S d S )Nsuffixr?   .c                 r    j                                                             |           }|dS |j        S )N)restructuredtext)rk   get_source_parsersr   	supported)r  parser_classrx   s     r;   get_supported_formatz,get_rst_suffix.<locals>.get_supported_format  s;    |6688<<VDD 	)((%%r:   r  )r   r   ri   source_suffix)rx   r  r  s   `  r;   get_rst_suffixr    s    &S &U38_ & & & & & & F**  !5!5f!=!== 	MMM	 4r:   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 )N)base)osr   isfiler   )r   r   ry   s     r;   r   z,process_generate_options.<locals>.<listcomp>	  sU     8 8 81w~~cll1oo668CLLL.. 8 8 8r:   Fc                 n    g | ]1}||                     t                              sd          ndz   2S )r   r   )rX  tuple)r   genfileexts     r;   r   z,process_generate_options.<locals>.<listcomp>  sO     - - - W-=-=eCjj-I-IQs1vvrR - - -r:   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_pathrx   imported_members	overwriteencoding)ri   autosummary_generatebuilderry   r   rT   r  r   r  r   rh   r   r   r#   remover  sphinx.ext.autosummary.generater  autosummary_imported_membersr"   r   autosummary_generate_overwritesource_encoding)rx   genfilesrQ   r  r  r  ry   r  s         @@r;   process_generate_optionsr    s:   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;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 rE   )autodoc_mock_imports)ri   s    r;   r   zsetup.<locals>.<lambda>A  s	    (C r:   ry   r  autosummary_ignore_module_all)versionparallel_read_safe)setup_extensionadd_noder4   rC   rF   rH   r`   add_directiver   add_roler  connectr  add_config_valueboolrT   sphinx__display_version__)rx   s    r;   setupr  *  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Nr:   )r?  )r?  r_  )T)ur(  r   r  r   r   r~  rs  r   r   typesr   typingr   r   r   r	   r
   r   r   r   docutilsr   docutils.nodesr   r   docutils.parsers.rstr   docutils.parsers.rst.statesr   r   r   docutils.statemachiner   r  r   sphinx.applicationr   sphinx.configr   sphinx.deprecationr   r   r   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/   sphinx.util.matchingr0   sphinx.util.typingr1   sphinx.writers.htmlr2   	getLoggerr6   r   rF  rU  r\  rY  commentr4   NodeVisitorrC   rF   rH   r`   rc   rn   r   r   r   r4  r>  intr  r  rH  r;  r   r   r  r   ru  r   r  r  r  r  r9   r:   r;   <module>r     s  . .`  				     				 



                    I I I I I I I I I I I I I I I I I I I I       / / / / / / / / + + + + + + N N N N N N N N N N , , , , , ,        % % % % % %            2 2 2 2 2 2 2 2 2 2 / / / / / / 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 $ $ $ $ $ $ $ $7 7 7 7 7 7 7 7 7 7 7 7 7 7 2 2 2 2 2 2 ( ( ( ( ( ( ) ) ) ) ) ) . . . . . .		8	$	$ RZ%%
RZ	""
/ 
	 	 	 	 	em 	 	 	U%6 o RV    
	5, 	D 	T 	 	 	 		 	 	 	 	 	 	 	~ =N SW    &  )T *  2 2 2 2 2 2 2 29 9 9 9 9$ 9 9 9   S  #  $z:J        JX# X# X# X# X#/ X# X# X#v## ## # # # #
# #    (8 8# 8# 8s 8 8 8 8v5c 5c 5c 5 5 5 5p ?A(-? ?c ?$s) ? ?"%?25? ? ? ?8+ + + + +9 + + +&6 49    * 6:FVZ E E ES	 Et Ec3S01E E E ED,2 ,2# ,2$ ,2%SRUBV ,2 ,2 ,2 ,2^ ;?26 c T#Y +/;@c3PSAS;T   0    z   6 3    #G& #GT #G #G #G #GLOv O$sCx. O O O O O Or:   