
    ~TiY}                       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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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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/m0Z0m1Z1 ddl2m3Z3m4Z4m5Z5m6Z6m7Z7 ddl8m9Z9m:Z: ddl;m<Z< ddl=m>Z> er6ddl?m@Z@ ddlmAZAmBZB ddlCmDZDmEZE ddlFmGZG ddlHmIZI dd lJmKZK dd!lLmMZMmNZN dd"lOmPZP  e0j                  eR      ZS ej                  d#      ZU ej                  d$      ZVd%ZW G d& d'ej                        ZYdAd(ZZdBd)Z[ G d* d+ej                        Z\	 	 	 	 	 	 dCd,Z]dDd-Z^ G d. d/e4      Z_dEd0Z`dEd1ZadFdGd2ZbdHd3ZcdId4Zd	 dJ	 	 	 	 	 	 	 	 	 dKd5Ze G d6 d7ef      ZgdLd8Zh	 dM	 	 	 	 	 dNd9ZidOdPd:Zj	 dQ	 	 	 	 	 	 	 dRd;Zk G d< d=e5      ZldSd>ZmdTd?ZndUd@Zoy)Vab  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)
ModuleType)TYPE_CHECKINGcast)nodes)
directives)RSTStateMachinestate_classes)
StringList)addnodes)PycodeError)_AutoDocumenterOptions)_import_module)_load_object_by_name)_best_object_type_for_member)mock)INSTANCE_ATTR)_AutodocAttrGetter_AutodocConfig)__)ModuleAnalyzer)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)BuildEnvironment)_AutodocObjType)ExtensionMetadata
OptionSpec)HTML5Translatorz	\.(?:\s+)z::\s*$)zet al.ze.g.zi.e.zvs.c                      e Zd Zy)autosummary_tocN__name__
__module____qualname__     R/home/agent/.local/lib/python3.12/site-packages/sphinx/ext/autosummary/__init__.pyr0   r0   r       r6   r0   c                "    t         j                  )z-Hide autosummary toctree list in HTML output.)r   SkipNodeselfnodes     r7   autosummary_toc_visit_htmlr>   v   s    
..r6   c                     y Nr5   r;   s     r7   autosummary_nooprA   {   s    r6   c                      e Zd Zy)autosummary_tableNr1   r5   r6   r7   rC   rC      r8   r6   rC   c                   	 t        d|d         }t        d|d         }t        d|d         }t        d|      }|D ]  }t        d|d         }t        d|d         }t        t        |            D ]X  \  }	}
t        |
t        j
                        s!|
j                         j                  d	d
      }t	        j
                  |      ||	<   Z  y# t        $ r Y y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               r7   autosummary_table_visit_htmlrY      s    ]DG,neAh/]F2J/%u- 	2CmSV4J(*Q-8C'S	2 2
7guzz2&~~/77XFH"ZZ1CF2	2  s   BC <C 	CCc                    t        j                  |       ry|t        j                  |      rd}nt        |dddd      }||nd}t        | dd|d      x}r|S y)zGet the best object type suitable for documenting the given object.

    *obj* is the Python object to be documented, and *parent* is another
    Python object (e.g. a module or a class) to which *obj* belongs.
    moduleN F)membermember_nameis_attrparent_obj_typeparent_propsdata)inspectismoduler   )objparentr`   
parent_optobj_types        r7   _get_documenterri      s     ~))&1"1$

 )3(>*F/' x  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                  ej                  ej                  dZded<   ddZ	 	 	 	 	 	 dd	Zdd
ZddZy)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_specc           	        | j                   D cg c]Z  }|j                         rHt        j                  d|j                         d         r!|j                         j	                         d   \ }}| j                  |      }| j                  |      }d| j                  v rt        j                  | j                  j                  j                        }| j                  d   j                         }g }t        | j                  j                        }| j                  j                   }	|D ]  \  }
}}}|	j#                  ||      }t        j$                  ||      }t        j&                  t        j$                  ||            }|| j                  j(                  vri |t+        | j                  j-                  |d                  rt/        d      }nt/        d      }t0        j3                  ||| j5                                |j7                  |        |rst9        j:                         }||d<   |D cg c]  }d |f c}|d	<   d
|d<   d |d<   | j                  j#                  d      |d<    |j6                  t=        dd|             d| j                  vr1d| j                  v r#t0        j3                  t/        d      |d
          |S c c}w c c}w )Nz^[~a-zA-Z_]r   rn   Fz5autosummary references excluded document %r. Ignored.zMautosummary: stub file not found %r. Check your autosummary_generate setting.locationincludefilesentriesrE   maxdepthglobrl   r\   z;A captioned autosummary requires :toctree: option. ignored.)contentstripresearchsplit	get_items	get_tableoptions	posixpathdirnameenvcurrent_documentdocnamer"   configexclude_patternsautosummary_filename_mapgetjoinnormpath
found_docsstrdoc2pathr   loggerwarningget_locationappendr   rn   r0   )r<   xnamesitemsr   r   tree_prefixdocnamesexcludedfilename_map_name_sig_summary	real_namer   msgtocnodedocns                     r7   runzAutosummary.run   su    \\
wwyRYY~qwwy|D GGIOOa 
 

 u%u%$''(A(A(I(IJG,,y1779KHt{{;;<H;;??L49 )0tXy(,,Y	B	#..i@#,,Y^^GW-MN$(("5"55DHH$5$5gu$E FG S !G
 NN3	D<M<M<ONP(%)( "**,*2'?G%HttTl%H	"&(
#"&%)\\%5%5i%@	"_RW=>DLL(Y$,,-FNNPQr  
 g
L &Is   AK6Kc                   t        | j                  j                        5  	 t        ||      cd d d        S # t        $ r}	 t        ||      cY d }~cd d d        S # t        $ rV}|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 Y   y xY w)Nr   )
r   r   autosummary_mock_importsimport_by_nameImportExceptionGroupimport_ivar_by_nameImportError	__cause__
exceptionsargs)r<   nameprefixesexcexc2errorss         r7   r   zAutosummary.import_by_name
  s     $++667 	NN%dH5	N 	N ( 
NN.tX>>	N 	N # N~~6W6W6W!83>>!84!8.sxx{FCMN	
N	N 	NsK   C7	CACC	B:$AB55B::B==CCCc                &   t        | j                        }g }| j                  j                  d      }|d| j                  v rdnd}|dvrd|d}t	        |      | j
                  j                  j                  }| j                  }t        j                  |j                        }|j                  }	|j                  }
t        |j                  j                        }t!               }|j"                  }|j$                  }d	}|D ]q  }|}|j'                  d
      r|dd }|j)                  d      d   }	 | j+                  ||      \  }}}}tA        ||      }tC        |tD              r|}n| d|tG        |      dz   d  }tI        |||	||
||||	      }|Et6        j9                  t;        d      || j?                                |jK                  |dd|f       |dk(  rd}nf|jL                  sd}nW|dk(  r|jL                  dk(  rdnd}n>tO        d|tG        |      z
        }tQ        dj=                  |jL                        |      }tS        |jT                  |      }|jK                  ||||f       t |S # t,        $ r}t/        |j0                  D ch c]  }dt3        |      j4                   d|  nc c}w c}      }t6        j9                  t;        d      |dj=                  |      | j?                                Y d}~d}~ww xY w)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.
        rq   Nro   nonelong>   r   r   shortz3Invalid value for autosummary :signatures: option: z*. Valid values are 'none', 'short', 'long'2   ~   .rE   )r   z* z: z4autosummary: failed to import %s.
Possible hints:
%s
ru   z::)	r   objtyper   r   eventsget_attrr   ref_contextreread_alwayszfailed to import object %sr\   r   )()r   u   (…)
   	max_chars)+get_import_prefixes_from_envr   r   r   
ValueErrorstatedocumentsettingsr   from_configr   r   r   r   	_registryautodoc_attrgettersr   r   r   
startswithr   r   r   rI   r   typer2   r   r   r   r   r   ri   rJ   r   lenr   r   rq   maxmangle_signatureextract_summarydocstring_lines)r<   r   r   r   signatures_optionr   document_settingsr   r   r   r   r   optsr   r   max_item_charsr   display_namer   re   rf   modnamer   er   rh   	full_namepropssigr   summarys                                  r7   r   zAutosummary.get_items  s(    098: LL,,\:$*8DLL*Hf$==E$''QS  S/! JJ//88hh++CJJ7//%cmm&G&GH%'oo)) B	BDLs#ABx#zz#r2262E2E8 3F 3/	3 'sF3H#z*%	  'ir)CL14D4F*G)HI	 ) !1!'+
E }34!..0  
 lBI>? !F*%%"g-#..'9dwNS5F$FG	&tyy1A1A'BiX
 &e&;&;=NOGLL,Wi@AEB	BH u ( S^^TDG$4$4#5Rs;TTUOPIIf%!..0	   s%   5I;;	LL"J:9ALLc                    t        j                         }d|d<   t        d      }t        j                  dddg j
                  j                  dd            }|j                  |       t        j                  dd	
      }|j                  |       |j                  t        j                  dd             |j                  t        j                  dd             t        j                  d      |j                         d fd}|D ]D  \  }}}	}
d}|d| d| d|
 d}n!d| d| d|
 dt        j                  |       }|	} |||       F ||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\   autosummary	longtablerm   r5   classes   )colsr   )colwidthZ   c                    t        j                  d      }	j                  j                         \  }}| D ]  }t	        |g| d| d      }t        	j                  |      5  t        	j                  |d      }|r#t        |d   t         j                        r|d   }nt        j                  d      }|j                  t        j                  d|             d d d         j                  |       y # 1 sw Y   xY w)Nr\   :z:<autosummary>F)allow_section_headingsr   )r   rS   state_machineget_source_and_liner   r   r   r#   rJ   	paragraphr   entry)
column_textsrS   sourcelinetextvl	col_nodesr=   bodyr<   s
           r7   
append_rowz)Autosummary.get_table.<locals>.append_row  s    ))B-C--AACLFD$ 
66(!D6(HI(R8 6 5

Bu!I !Z	!eoo%N(|$r2JJu{{2t456 6
6 KK6 6s   "A8C66C?	re   z:py:z:`z <z>`z>`\ )r   r   returnNone)r   tabular_col_specrC   r   rO   r   r   r   rP   colspecrQ   r   escape)r<   r   
table_specrO   
real_tablegroupr   r   r   r   r   	qualifiercol1col2r   s   `             @r7   r   zAutosummary.get_table  sO   
 ..0
0
6!"%[[Tdll6F6FwPR6ST

 	Z Ra(% U]]234U]]234{{2T	  .3 	#)D#w	I{i[4&9+R@i[4&9+U3::c?BSTDtT"	# E""r6   N)r   
list[Node])r   r   r   list[str | None]r   tuple[str, Any, Any, str])r   	list[str]r   &list[tuple[str, str | None, str, str]])r   r  r   r  )r2   r3   r4   __doc__required_argumentsoptional_argumentsfinal_argument_whitespacehas_contentr	   unchanged_requiredclass_option	unchangedflagrs   __annotations__r   r   r   r   r5   r6   r7   rk   rk      s    
  %K00((''"__ **(()K% 4lNN#3N	"N$dL.#r6   rk   c                F    | j                  d      d   j                         S )z+Strip a type hint from argument definition.r   r   )	partitionr|   )ss    r7   strip_arg_typehintr    s    ;;sA$$&&r6   c                   	 t        |       }t        |j                  j                               }t	        |      D ]t  \  }}|j
                  t        j                  ur |j                  t        j                        }|j                  t        j                  ur|j                  d      }|||<   v |j                  |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!   rI   r  valuesrH   r  r   emptyrM   r  r   	Exception)r  r   r  iparams        r7   _cleanup_signaturer    s     ##..//12
!*- 	"HAuy6A}}IOO3d3!JqM	" kkZ9??kS3x s   CC C,+C,c           
     b   t        |       }t        j                  dd|      }t        j                  dd|      j                         }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|      r.t        j                  d|      r.t        j                  dd|      }t        j                  d|      r.t        j                  d|      r.t        j                  dd|      }t        j                  d|      r.g }g }t        j
                  d      }|r]|j	                  |      }|s|j                  d      }n8|j                  d|j                  d             |j                  d      dd }|r]t        |      D ]  \  }}t        |      ||<    t        |      D ]  \  }}	t        |	      ||<    t        d||dz
        } |rX| sdt        d||dz
        z  } d| z  S t        |       |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   rH   r  limited_joinr   )
r   r   r  r   r   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 ))a FF<Q' ))a ))J
"FF:r1% ))J
"
))J
"FF:r1% ))J
" DDZZ:;F
MM!774=DAqwwqz"GGAJsO  D/ *3$S)Q* D/ *3$S)Q* tTY]
;C<di!mLLC C< X	A)A--8ldi#c(&:Q&>&B  C C<r6   c                f   g }d}| D ]6  }| xs |j                         }|s|rd}|s"|r n|j                  |       8 |syt        ||      }t        |d   t        j
                        r#|d   j                         j                         }nt        |d   t        j                        s|d   j                         }nt        j                  dj                  |            }t        |      dk(  r|d   j                         }nd}t        t        |            D ]|  }	dj                  |d|	dz          j                  d	      d	z   }g |dd t        ||      }|j                  t               rSt#        |j%                  t        j&                              r| n t(        j+                  d	|      }|S )
zExtract summary from docstring.FTr\   r   rF   r   z. Nr   )isspacer   _parse_summaryrJ   r   sectionrL   r|   r   
periods_rer   r   r   rangerstripendswithWELL_KNOWN_ABBREVIATIONSanyfindallr(   
literal_rer%  )
docr   first_stanzacontent_startedr   is_blank_liner=   r   	sentencesr  s
             r7   r   r   
  s   
 LO 
& 2DLLN"O%
&  ,1D$q'5==)q'.."((*Q1q/'') $$SXXl%;<	y>Ql((*GG3y>* ))IgA$67>>sCcIQ%lH=##$<=T\\%*>*>?@ nnS'*GNr6   c                    t        t        d      }t        d|      }t               |_        |j                  | |       |S )NBodyr\   )r
   r   r   r   reporterr   )r9  r   r   r=   s       r7   r/  r/  ?  s8    #M6:MH%D NDMc4 Kr6   c                    | j                  |      }t        |      |k  r|S d}d}|D ]4  }|t        |      t        |       z   z  }||t        |      z
  k  r|dz  }4 n | j                  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   rI   )sepr   r   overflow_markerfull_strn_charsn_itemsitems           r7   r(  r(  H  s     xxH
8}y GG 3t9s3x''Y_!555qLG 88=d5'?+=_=>>r6   c                      e Zd ZdZy)r   zExceptions raised during importing the target objects.

    It contains an error message and a list of exceptions as its arguments.
    N)r2   r3   r4   r  r5   r6   r7   r   r   e  s    r6   r   c                    dg}| j                   j                  d      }|r|j                  d|       | j                   j                  d      }|r-|r|j                  d| d|        |S |j                  d|       |S )z[Obtain current Python import prefixes (for `import_by_name`)
    from ``document.env``
    Nz	py:moduler   zpy:classr   )r   r   r'  )r   r   
currmodule	currclasss       r7   r   r   l  s     #'H$$[1J:&##J/IOOA*Qyk:; O OOAy)Or6   c           	     >   g }g }|D ]u  }|L| j                  | d      r8t        d      }t        j                  || | j	                  | d      dd       Q	 |r| d|  }n| }t        |d      \  }}}	||||	fc S  t        j                  t        j                  d	 |D        g       }d
dj                  |       }t        ||      # t        $ r |j                         Y t        $ r-}
|j                         |j                  |
       Y d}
~
d}
~
ww xY w)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  4   K   | ]  }|j                     y wr@   )r   ).0r   s     r7   	<genexpr>z!import_by_name.<locals>.<genexpr>  s     55s   zcould not import z or )r   r   r   r   removeprefix_import_by_namer   r   r   	functoolsreduceoperatoriaddr   )r   r   triedr   prefixr   prefixed_namere   rf   r   r   r   s               r7   r   r     sH    E)+F $//VHA,"?&C NN!!VHA,/"&   	#)(!D6 2 $#2$ C !#vw66/< '0&6&65f5r'J fkk%01
2C
sJ
//  	(LL'# 	LL'MM#	s   "CD'D/"DDc                   g }	 | j                  d      }dj                  |dd       }|r	 t        |      }t        ||d         ||fS d}d}t        t        dt        |      dz               D ]8  }|}dj                  |d|       }	 t        |       |t        j                  v s8 n |t        |      k  r2d}	t        j                  |   }
||d D ]  }|
}	t        |
|      }
 |
|	|fS t        j                  |   d|fS # t        t
        t        f$ r)}|j                  |j                  xs |       Y d}~d}~ww xY w# t        $ r)}|j                  |j                  xs |       Y d}~d}~ww xY w# t        t        t        t        f$ r8}|j                  |       |rt!        d|      dt	        |j"                   |d}~ww xY w)z+Import a Python object given its full name.r   NrE   r   r\   r   )r   r   r   getattrr   rN   AttributeErrorr   r   reversedr2  r   sysmodulesr   KeyErrorr   r   )r   rO  r   
name_partsr   modr   last_jrV   rf   re   obj_names               r7   rT  rT    s   "$F(2ZZ_
 ((:cr?+4$W-sJrN3S'AA
 %3z?Q#678 		AFhhz"1~.G4w' #++%		 C
O#F++g&C&vw/ -c8,- '';;w'w663  ^< 4cmm2s334  4cmm2s334 ^X> 2c&r62<sxx(c12sw   'E4 C? 	>E4 D?E4 &AE4 )E4 ?D<D72E4 7D<<E4 ?	E1E,'E4 ,E11E4 4G3G  Gc                :   	 | j                  dd      \  } }t        | |      \  }}}}t        |      }t        |      dk(  r|f}|D ]  }	t	        j
                  t        |	d|            }
|
j                          t               }||
j                  D ch c]  \  }}|	 c}}z  }||
j                  D ch c]  \  }}|	 c}}z  }|v s| d| t        ||fc S  	 t        c c}}w c c}}w # t        t        t        f$ r}t        |d}~wt        $ r  w xY w)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   N)rsplitr   r    r   r   
for_moduler]  analyzeset	attr_docsr   r   r   r   r   r   )r   r   rO  attrr   re   _parentr   candidate_objectscandidate_objanalyzerfound_attrsqualnamer   s                 r7   r   r     s3   [[a(
d+9$+I(	3 #3K !Q&!$. 
	JM%00|W=H %K9K9KL%5hDLLK9M9MN%5hDNNK{"#AdV,mS'II
	J   MN [1 #s" sB   BC1 C%
C1 5C+

C1 C1 C1 %C1 1DDDc                      e Zd ZdZddZy)AutoLinkzSmart linking role.

    Expands to ':obj:`text`' if `text` is an object that can be imported;
    otherwise expands to '*text*'.
    c           	        | j                   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   }|D cg c]  }||j                  | d      s||k(  s|! }}t        ||       ||fS c c}w # t        $ rK t        d|d         }t!        j"                  | j                  |j%                         |d   	      |d<   Y ||fS w xY w)
Nre   r   zaddnodes.pending_xrefr   	reftargetr   znodes.literalr   r   )r   domainspython_domainrolerawtextr   linenoinlinerr   r{   r   r   r   r   r   r   r   emphasisrL   )	r<   
pyobj_roleobjectsr   pending_xrefr   r   rZ  literals	            r7   r   zAutoLink.run	  sg   XX%%3388?
%%%$LLIIKKLLLLLL
 F?"7|q   3WQZ@	3DHH=H,D '>6(!5 H  4*  $ 	?LO<Ggnn.	8JGAJ 	s%   'D  $C;)D  ;D   AEEN)r   z'tuple[list[Node], list[system_message]])r2   r3   r4   r  r   r5   r6   r7   ru  ru    s    "r6   ru  c                h     d fd}d } j                   j                  D ]  }d ||      v s|c S  y )Nc                    j                   j                         j                  | j                  d            }|y|j                  S )Nr   )restructuredtext)registryget_source_parsersr   rS  	supported)suffixparser_classapps     r7   get_supported_formatz,get_rst_suffix.<locals>.get_supported_format/  sA    ||668<<V=P=PQT=UV(%%%r6   r  )r  r   r   ztuple[str, ...])r   source_suffix)r  r  r  s   `  r7   get_rst_suffixr  .  s@    & F**** !5f!==M r6   c           
        | j                   j                  }|du r_| j                  }|j                  D cg c]=  }|j	                  |      j                         rt        |j	                  |d            ? }}n|du rnt        | j                   j                        }|D cg c]&  }||j                  t        |            s|d   ndz   ( }}|d d  D ]P  }| j                  |z  j                         r!t        j                  t        d      |       |j                  |       R |sy t!        |       }|t        j                  t        d             y ddlm} | j                   j&                  }	t)        | j                   j*                        5   |||| j                  | |	| j                   j,                  | j                   j.                  	       d d d        y c c}w c c}w # 1 sw Y   y xY w)
NTF)baser   r\   z(autosummary_generate: file not found: %szcautosummary generates .rst files internally. But your source_suffix does not contain .rst. Skipped.)generate_autosummary_docs)r  	base_pathr  imported_members	overwriteencoding)r   autosummary_generater   r   r   is_filer   rI   r  r4  tuplesrcdirr   r   r   remover  sphinx.ext.autosummary.generater  autosummary_imported_membersr   r   autosummary_generate_overwritesource_encoding)
r  genfilesr   r   extgenfiler   r  r  r  s
             r7   process_generate_optionsr  =  s   zz..H4gg ^^
||A&&( QU+,
 

 
U	3::++, $
 W%5%5eCj%As1vrJ
 

 a[ 	'EJJ&//1r"LMuU&	'
 C F~I	
 	Izz>>	cjj11	2 	
!jj-jj??ZZ//	
	
 	
G

4	
 	
s   AG"+G!AG&&G/c           	     
   | j                  d       | j                  t        t        t        ft        t        ft        t        ft        t        ft        t        f       | j                  t
        t        t        ft        t        ft        t        ft        t        ft        t        f       | j                  dt               | j                  dt                      | j                  dt               | j                  di dt        t        h             | j                  d	i d
t        t        h             | j                  dddt        t         t"        h             | j                  dddt        t         h             | j                  dd dt        t"        t$        h             | j                  dddt        t         h             | j                  dddt        t         h             t&        j(                  ddS )Nzsphinx.ext.autodoc)htmllatexr   mantexinfor   autolinkzbuilder-initedautosummary_contextr   )typesr   r  r  Tr  r\   r   c                    | j                   S r@   )autodoc_mock_imports)r   s    r7   <lambda>zsetup.<locals>.<lambda>  s    v22 r6   r  Fautosummary_ignore_module_all)versionparallel_read_safe)setup_extensionadd_noder0   r>   rA   rC   rY   add_directiverk   add_roleru  connectr  add_config_value	frozensetdictboolrI   r  sphinx__display_version__)r  s    r7   setupr  q  s   ,-LL(*:;!12 01/0!#34   LL*,<=!12 01/0!#34   m[1LLXZ(KK ":;.ED6ARS"Bi6G   e9dD\3J   ($)TF:K   "2u&	   &rD69J   'uItf<M  
 --" r6   )r<   nodes.NodeVisitorr=   r0   r   r   )r<   r  r=   r'   r   r   )r<   r.   r=   rC   r   r   )re   r%   rf   r%   r   r+   )r  r   r   r   )   )r   r   r   intr   r   )r9  Sequence[str]r   r%   r   r   )r9  r  r   r%   r   znodes.document)r  z...)
rB  r   r   r  r   r  rC  r   r   r   )r   r*   r   r  )r@   )r   r   r   Sequence[str | None]r   r  )T)r   r   rO  r  r   ztuple[Any, Any, str])r@   T)r   r   r   r  rO  r  r   r  )r  r)   r   z
str | None)r  r)   r   r   )r  r)   r   r,   )pr  
__future__r   rU  rc   rW  r   r}   r`  r   r  r   typingr   r   docutilsr   docutils.parsers.rstr	   docutils.parsers.rst.statesr
   r   docutils.statemachiner   r  r   sphinx.errorsr   %sphinx.ext.autodoc._directive_optionsr   %sphinx.ext.autodoc._dynamic._importerr   #sphinx.ext.autodoc._dynamic._loaderr   *sphinx.ext.autodoc._dynamic._member_finderr   !sphinx.ext.autodoc._dynamic._mockr   sphinx.ext.autodoc._sentinelsr   sphinx.ext.autodoc._sharedr   r   sphinx.localer   sphinx.pycoder   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)   sphinx.environmentr*   "sphinx.ext.autodoc._property_typesr+   sphinx.util.typingr,   r-   sphinx.writers.html5r.   	getLoggerr2   r   r&  r1  r8  r5  commentr0   r>   rA   rC   rY   ri   rk   r  r  r   r   r/  r(  BaseExceptionGroupr   r   r   rT  r   ru  r  r  r  r5   r6   r7   <module>r     s  .` #     	 
   &  + F ,   % H @ D S 2 7 I  ( $  ; ( 5($3)3B@4			8	$ RZZ%
RZZ	"
< 	emm 	
		 	
!2	.Fp#/ p#f'
(;|2j MR?	??+.?FI??:- * 18*0
*0-*0*0Z,2` TX 
 - LP  L)z )X1
h0r6   