ó
    Ð]j+  ã                  óÈ  • S SK Jr  S SKrS SKJrJrJr  S SKJr  \(       a$  S SK	J
r
  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  \R*                  \R,                  \R.                  /r\S   r \R,                  S/ SQ4\R.                  S/ SQ4\R*                  S/ SQ40r " S S\SS9rSSSSS.           SS jjr " S S\SS9rSSSSS.           SS jjrg)é    )ÚannotationsN)ÚTYPE_CHECKINGÚLiteralÚ	TypedDict)ÚParser)ÚGoogleOptions)ÚDocstringSection)ÚNumpyOptions)ÚDocstringStyle)ÚSphinxOptions)Ú	Docstring)Ú
heuristicsÚmax_sectionsz!\n[ \t]*{0}:([ \t]+.+)?\n[ \t]+.+)ÚargsÚ	argumentsÚparamsÚ
parameterszkeyword argszkeyword argumentsz
other argszother argumentszother paramsúother parametersÚraisesÚ
exceptionsÚreturnsÚyieldsÚreceivesÚexamplesÚ
attributesÚ	functionsÚmethodsÚclassesÚmodulesÚwarnsÚwarningsz\n[ \t]*{0}\n[ \t]*---+\n)Ú
deprecatedr   r   r   r   r   r   r    r   r   r   r   r   z&\n[ \t]*:{0}([ \t]+\w+)*:([ \t]+.+)?\n)ÚparamÚ	parameterÚargÚargumentÚkeyÚkeywordÚtypeÚvarÚivarÚcvarÚvartyper   ÚreturnÚrtyper   ÚraiseÚexceptÚ	exceptionc                  ó<   • \ rS rSr% SrS\S'    S\S'    S\S'   S	rg
)ÚPerStyleOptionséi   z(Per-style options for docstring parsing.r   Úgoogler
   Únumpyr   Úsphinx© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Ú__static_attributes__r9   ó    Ú]/home/mande/repo/quber/.venv/lib/python3.13/site-packages/griffe/_internal/docstrings/auto.pyr4   r4   i   s    ‡ Ù2àÓØ.ØÓØ-ØÓÚ.rB   r4   F)Útotalr   ©ÚmethodÚstyle_orderÚdefaultÚper_style_optionsc          	     ón  ^ • SSK Jn  U=(       d    0 nU=(       d    [         Vs/ s H%  n[        U[        5      (       a  [        U5      OUPM'     nnUS:X  a²  U Hƒ  n[        U   u  pxU V	s/ s HH  n	[        R                  " UR                  U	5      [        R                  [        R                  -  5      PMJ     n
n	[        U 4S jU
 5       5      (       d  M  US4s  $    Ub  [        U[
        5      (       a  US4$ [        U5      S4$ US:X  aˆ  0 nU H   nXV   " T 40 UR                  U0 5      D6X¶'   M"     UR                  5        VVs0 s H  u  plU[        U5      _M     nnn[!        UR#                  5       5      nU H  nXÖ   U:X  d  M  XkU   4s  $    [%        SU S35      es  snf s  sn	f s  snnf )	a¢  Infer the parser to use for the docstring.

The 'heuristics' method uses regular expressions. The 'max_sections' method
parses the docstring with all parsers specified in `style_order` and returns
the one who parsed the most sections.

If heuristics fail, the `default` parser is returned. If multiple parsers
parsed the same number of sections, `style_order` is used to decide which
one to return. The `default` parser is never used with the 'max_sections' method.

Additional options are parsed to the detected parser, if any.

Parameters:
    docstring: The docstring to parse.
    method: The method to use to infer the parser.
    style_order: The order of the styles to try when inferring the parser.
    default: The default parser to use if the inference fails.
    per_style_options: Additional parsing options per style.

Returns:
    The inferred parser, and optionally parsed sections (when method is 'max_sections').
r   )Úparsersr   c              3  óX   >#   • U  H  oR                  TR                  5      v •  M!     g 7f)N)ÚsearchÚvalue)Ú.0ÚpatternÚ	docstrings     €rC   Ú	<genexpr>Ú(infer_docstring_style.<locals>.<genexpr>ž   s   øé € ÐKÂ(°w—>‘> )§/¡/×2Ð2Â(ùs   ƒ'*Nr   zInvalid method 'z'.)Ú#griffe._internal.docstrings.parsersrK   Ú_default_style_orderÚ
isinstanceÚstrr   Ú	_patternsÚreÚcompileÚformatÚ
IGNORECASEÚ	MULTILINEÚanyÚgetÚitemsÚlenÚmaxÚvaluesÚ
ValueError)rQ   rF   rG   rH   rI   rK   ÚstylerP   ÚreplacementsÚreplacementÚpatternsÚstyle_sectionsÚsectionÚstyle_lengthsr   s   `              rC   Úinfer_docstring_stylerl   t   s³  ø€ õ< <à)×/¨RÐàS^×SvÔbvÐSvÓwÒSvÈ%¤J¨u´c×$:Ñ$:”6˜%”=ÀÒEÑSv€KÐwà�ÓÛ ˆEÜ$-¨eÑ$4Ñ!ˆGáiuóÚiuÐZe”—
’
˜7Ÿ>™>¨+Ó6¼¿¹ÌÏÉÑ8TÖUÑiuð ð ô ÔKÁ(ÓK×KÓKØ˜d�{Ò"ñ !ð "™/¬Z¸Ä×-HÑ-HˆwÐ_cÐcÐcÌfÐU\ËoÐ_cÐcÐcà�ÓØˆÛ ˆEØ$+¢N°9Ñ$aÐ@Q×@UÑ@UÐV[Ð]_Ó@`Ñ$aˆNÓ!ñ !àCQ×CWÑCWÔCYÔZÒCY±°˜¤ G£Ò,ÑCYˆÑZÜ˜=×/Ñ/Ó1Ó2ˆÛ ˆEØÑ# |Õ3Ø¨UÑ3Ð3Ò3ñ !ô Ð'¨ x¨rÐ2Ó
3Ð3ùò- xùò
ùó [s   ¤,F'Á,AF,ÅF1c                  óH   • \ rS rSr% SrS\S'    S\S'    S\S'    S	\S
'   Srg)ÚAutoOptionsé¯   z"Options for Auto-style docstrings.ÚDocstringDetectionMethodrF   ú*list[Parser] | list[DocstringStyle] | NonerG   úParser | DocstringStyle | NonerH   úPerStyleOptions | NonerI   r9   Nr:   r9   rB   rC   rn   rn   ¯   s)   ‡ Ù,à$Ó$Ø0Ø;Ó;Ø?Ø+Ó+Ø;Ø-Ó-Ú/rB   rn   c               ó~   • SSK Jn  U=(       d    0 n[        U UUUUS9u  pgUc  U" X40 UR                  U0 5      D6$ U$ )a	  Parse a docstring by automatically detecting the style it uses.

See [`infer_docstring_style`][griffe.infer_docstring_style] for more information
on the available parameters.

Parameters:
    docstring: The docstring to parse.
    method: The method to use to infer the parser.
    style_order: The order of the styles to try when inferring the parser.
    default: The default parser to use if the inference fails.
    per_style_options: Additional parsing options per style.

Returns:
    A list of docstring sections.
r   )ÚparserE   )rT   ru   rl   r_   )rQ   rF   rG   rH   rI   ru   re   Úsectionss           rC   Ú
parse_autorw   ¼   sX   € õ. :à)×/¨RÐä+ØØØØØ+ñ�O€Eð ÑÙ�YÑJÐ):×)>Ñ)>¸uÀbÓ)IÑJÐJØ€OrB   )rQ   r   rF   rp   rG   rq   rH   rr   rI   rs   r.   z3tuple[Parser | None, list[DocstringSection] | None])rQ   r   rF   rp   rG   rq   rH   rr   rI   rs   r.   zlist[DocstringSection])Ú
__future__r   rY   Útypingr   r   r   Úgriffe._internal.enumerationsr   Ú"griffe._internal.docstrings.googler   Ú"griffe._internal.docstrings.modelsr	   Ú!griffe._internal.docstrings.numpyr
   rT   r   Ú"griffe._internal.docstrings.sphinxr   Úgriffe._internal.modelsr   r8   r6   r7   rU   rp   rX   r4   rl   rn   rw   r9   rB   rC   Ú<module>r€      sZ  ðõ #ã 	ß 4Ñ 4å 0æÝ@ÝCÝ>ÝBÝ@Ý1ð Ÿ™ v§}¡}°f·l±lÐCÐ ð #Ð#?Ñ@Ð Ø 6ð ‡M�MØ,ò	
ðð8 ‡L�LØ$ò	
ðð& ‡M�MØ1ò	
ððaG€	ôT/�i uò /ð (4Ø>BØ.2Ø04ñ84Øð84ð %ð84ð <ð	84ð
 ,ð84ð .ð84ð 9õ84ôv
0�) 5ò 
0ð  (4Ø>BØ.2Ø04ñ$Øð$ð %ð$ð <ð	$ð
 ,ð$ð .ð$ð ö$rB   