+
    Rip>                        R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^RIH	t	H
t
HtHtHtHtHtHtHt RTR R lltR R lt]P(                  ! R]P*                  R	7      t]P(                  ! R
4      t]P(                  ! R4      t]P(                  ! R4      t]P(                  ! R4      t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t  ! R R] 4      t! ! R R]4      t" ! R R]4      t#. ]! R R!4      N]! R"R!4      N]! R#R!4      N]! R$R!4      N]! R%R&4      N]! R'R&4      N]! R(R&4      N]! R)R&4      N]! R*R+4      N]! R,R+4      N]! R-R.4      N]! R/R.4      N]! R0R14      N]! R2R14      N]! R3R44      N]! R5R44      N] ! R6R74      N] ! R8R74      N]!! R9R:4      N]!! R;R:4      N]#! R<R=4      N]#! R>R=4      N]! R?R@4      N]! RAR@4      N]! RBRC4      N]! RDRC4      N]! RERF4      N]! RGRF4      N]! RHRI4      N]! RJRI4      N]"! RKRL4      Nt$ ! RM RN4      t%RO RP lt&]PN                  RQ3RR RS llt(R# )Uz_Numpydoc-style docstring parsing.

:see: https://numpydoc.readthedocs.io/en/latest/format.html
N)dedent)		DocstringDocstringDeprecatedDocstringExampleDocstringMetaDocstringParamDocstringRaisesDocstringReturnsDocstringStyleRenderingStylec                X    V ^8  d   QhR\         P                  R\         P                  /# )   iterablereturn)TIterable)formats   "X/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/docstring_parser/numpydoc.py__annotate__r      s"     = =

 = =    c                 z    \         P                  ! V 4      w  r#\        VR 4       \         P                  ! W#VR7      # )N)	fillvalue)	itertoolsteenextzip_longest)r   endleftrights   &&  r   	_pairwiser      s/    --)KD  <<r   c                Z    V ^8  d   QhR\         R\        P                  \         ,          /# )r   stringr   )strr   Optional)r   s   "r   r   r      s"      s qzz# r   c                 J    V P                  4       p \        V 4      ^ 8  d   V # R# )    N)striplen)r!   s   &r   
_clean_strr(      s     \\^F
6{Qr   z	^[^\s].*$flagsz(^(?P<name>.*?)(?:\s*:\s*(?P<type>.*?))?$z)(?P<type>.*?)(?:, optional|\(optional\))$z@(?<!\S)[Dd]efault(?: is | = |: |s to |)\s*(?P<value>[\w\-\.]*\w)z(^(?:(?P<name>.*?)\s*:\s*)?(?P<type>.*?)$c                   d   a  ] tR t^3t o RtV 3R lR lt]V 3R lR l4       tV 3R lR ltRt	V t
R	# )
Sectionao  Numpydoc section parser.

:param title: section title. For most sections, this is a heading like
              "Parameters" which appears on its own line, underlined by
              en-dashes ('-') on the following line.
:param key: meta key string. In the parsed ``DocstringMeta`` instance this
            will be the first element of the ``args`` attribute list.
c                *   < V ^8  d   QhRS[ RS[ RR/# )r   titlekeyr   Nr"   )r   __classdict__s   "r   r   Section.__annotate__=   s"      c   r   c                    Wn         W n        R # N)r.   r/   )selfr.   r/   s   &&&r   __init__Section.__init__=   s    
r   c                    < V ^8  d   QhRS[ /# r   r   r0   )r   r1   s   "r   r   r2   B   s     5 5s 5r   c                `    R\        V P                  4      ,          pRV P                   RV R2# )zRegular expression pattern matching this section's header.

This pattern will match this instance's ``title`` attribute in
an anonymous group.
-z^(z)\s*?\nz\s*$)r'   r.   )r5   dashess   & r   title_patternSection.title_patternA   s/     s4::&TZZLxt44r   c                J   < V ^8  d   QhRS[ RS[P                  S[,          /# r   textr   r"   r   r   r   )r   r1   s   "r   r   r2   K   s(     F F# F!**]"; Fr   c              #  T   "   \        V P                  .\        V4      R7      x  R# 5i)zParse ``DocstringMeta`` objects from the body of this section.

:param text: section body text. Should be cleaned with
             ``inspect.cleandoc`` before parsing.
)descriptionN)r   r/   r(   )r5   rA   s   &&r   parseSection.parseK   s      TXXJJt4DEEs   &()r/   r.   N)__name__
__module____qualname____firstlineno____doc__r6   propertyr=   rE   __static_attributes____classdictcell__r1   s   @r   r,   r,   3   s4       5 5F Fr   r,   c                   H   a  ] tR t^Tt o RtV 3R lR ltV 3R lR ltRtV tR# )
_KVSectionzBase parser for numpydoc sections with key-value syntax.

E.g. sections that look like this:
    key
        value
    key2 : type
        values can also span...
        ... multiple lines
c                ,   < V ^8  d   QhRS[ RS[ RS[/# r   r/   valuer   )r"   r   )r   r1   s   "r   r   _KVSection.__annotate___   s"      s 3 = r   c                    R # r4    r5   r/   rT   s   &&&r   _parse_item_KVSection._parse_item_   s    r   c                J   < V ^8  d   QhRS[ RS[P                  S[,          /# r@   rB   )r   r1   s   "r   r   rU   b   s$      # !**]"; r   c              #    "   \        \        P                  V4      4       Ff  w  r#VP                  4       pVe   VP	                  4       MR pWV pV P                  VP                  4       \        P                  ! V4      R7      x  Kh  	  R # 5i)N)r/   rT   )	r   KV_REGEXfinditerr   startrY   groupinspectcleandoc)r5   rA   match
next_matchr_   r   rT   s   &&     r   rE   _KVSection.parseb   sz     !*8+<+<T+B!CEIIKE(2(>*""$DCsOE""KKM)9)9%)@ #  	 "Ds   BBrW   N)	rG   rH   rI   rJ   rK   rY   rE   rM   rN   rO   s   @r   rQ   rQ   T   s       r   rQ   c                   @   a  ] tR t^lt o Rt]V 3R lR l4       tRtV tR# )_SphinxSectionzBase parser for numpydoc sections with sphinx-style syntax.

E.g. sections that look like this:
    .. title:: something
        possibly over multiple lines
c                    < V ^8  d   QhRS[ /# r9   r0   )r   r1   s   "r   r   _SphinxSection.__annotate__u   s     / /s /r   c                "    R V P                    R2# )z	^\.\.\s*(z)\s*::)r.   r5   s   &r   r=   _SphinxSection.title_patternt   s    DJJ<v..r   rW   N)	rG   rH   rI   rJ   rK   rL   r=   rM   rN   rO   s   @r   rg   rg   l   s      / /r   rg   c                   6   a  ] tR t^yt o RtV 3R lR ltRtV tR# )ParamSectionzParser for numpydoc parameter sections.

E.g. any section that looks like this:
    arg_name
        arg_description
    arg_2 : type, optional
        descriptions can also span...
        ... multiple lines
c                ,   < V ^8  d   QhRS[ RS[ RS[/# rS   )r"   r   )r   r1   s   "r   r   ParamSection.__annotate__   s"     
 
s 
3 
> 
r   c           	        \         P                  V4      pR ;p;rVVeV   VP                  R4      pVP                  R4      pVe0   \        P                  V4      pVe   VP                  R4      pRpMRpR p\	        V4      ^ 8  d+   \
        P                  V4      p	V	e   V	P                  R4      p\        V P                  V.\        V4      VVVVR7      # )NnametypeTFrT   )argsrD   arg_name	type_nameis_optionaldefault)
PARAM_KEY_REGEXrc   r`   PARAM_OPTIONAL_REGEXr'   PARAM_DEFAULT_REGEXsearchr   r/   r(   )
r5   r/   rT   rc   ru   rv   rw   optional_matchrx   default_matchs
   &&&       r   rY   ParamSection._parse_item   s    %%c*-1119{{6*HF+I$!5!;!;I!F!- . 4 4V <I"&K"'Ku:>/66u=M('--g6((H%"5)#
 	
r   rW   NrG   rH   rI   rJ   rK   rY   rM   rN   rO   s   @r   rn   rn   y   s     
 
r   rn   c                   6   a  ] tR t^t o RtV 3R lR ltRtV tR# )RaisesSectionzParser for numpydoc raises sections.

E.g. any section that looks like this:
    ValueError
        A description of what might raise ValueError
c                ,   < V ^8  d   QhRS[ RS[ RS[/# rS   )r"   r   )r   r1   s   "r   r   RaisesSection.__annotate__   s"     
 
s 
3 
? 
r   c                v    \        V P                  V.\        V4      \        V4      ^ 8  d   VR7      # RR7      # )r%   N)rt   rD   rv   )r   r/   r(   r'   rX   s   &&&r   rY   RaisesSection._parse_item   s>    ((C"5) X\c
 	
 04
 	
r   rW   Nr   rO   s   @r   r   r      s     
 
r   r   c                   :   a  ] tR t^t o RtRtV 3R lR ltRtV tR# )ReturnsSectionzParser for numpydoc returns sections.

E.g. any section that looks like this:
    return_name : type
        A description of this returned value
    another_type
        Return names are optional, types are required
Fc                ,   < V ^8  d   QhRS[ RS[ RS[/# rS   )r"   r	   )r   r1   s   "r   r   ReturnsSection.__annotate__   s#     
 
s 
3 
3C 
r   c                    \         P                  V4      pVe$   VP                  R4      pVP                  R4      pMR pR p\        V P                  .\        V4      VV P                  VR7      # )Nrr   rs   )rt   rD   rv   is_generatorreturn_name)RETURN_KEY_REGEXrc   r`   r	   r/   r(   r   )r5   r/   rT   rc   r   rv   s   &&&   r   rY   ReturnsSection._parse_item   sk     &&s+++f-KF+IKI(("5)**#
 	
r   rW   N)	rG   rH   rI   rJ   rK   r   rY   rM   rN   rO   s   @r   r   r      s      L
 
r   r   c                       ] tR t^tRtRtRtR# )YieldsSectionz0Parser for numpydoc generator "yields" sections.TrW   N)rG   rH   rI   rJ   rK   r   rM   rW   r   r   r   r      s
    :Lr   r   c                   6   a  ] tR t^t o RtV 3R lR ltRtV tR# )DeprecationSectionz3Parser for numpydoc "deprecation warning" sections.c                J   < V ^8  d   QhRS[ RS[P                  S[,          /# r@   )r"   r   r   r   )r   r1   s   "r   r   DeprecationSection.__annotate__   s%     
 
# 
!**-@"A 
r   c              #     "   VP                  R ^R7      RR.,           vr#pVe    \        \        P                  ! V4      4      p\	        V P
                  .V\        V4      R7      x  R# 5i)
)sepmaxsplitN)rt   rD   version)splitr(   ra   rb   r   r/   )r5   rA   r   desc_s   &&   r   rE   DeprecationSection.parse   s_      JJ4!J<d|Kg..t45D!((z'7J
 	
s   A(A*rW   NrG   rH   rI   rJ   rK   rE   rM   rN   rO   s   @r   r   r      s     =
 
r   r   c                   6   a  ] tR t^t o RtV 3R lR ltRtV tR# )ExamplesSectiona  Parser for numpydoc examples sections.

E.g. any section that looks like this:
    >>> import numpy.matlib
    >>> np.matlib.empty((2, 2))    # filled with random data
    matrix([[  6.76425276e-320,   9.79033856e-307], # random
            [  7.39337286e-309,   3.22135945e-309]])
    >>> np.matlib.empty((2, 2), dtype=int)
    matrix([[ 6600475,        0], # random
            [ 6586976, 22740995]])
c                J   < V ^8  d   QhRS[ RS[P                  S[,          /# r@   rB   )r   r1   s   "r   r   ExamplesSection.__annotate__   s$      # !**]"; r   c              #  "  "   \        V4      P                  4       P                  4       pV'       d   . p. pV'       dB   V^ ,          P                  R4      '       g   M"VP	                  VP                  ^ 4      4       KI  V'       dB   V^ ,          P                  R4      '       d   M"VP	                  VP                  ^ 4      4       KI  \        V P                  .V'       d   RP                  V4      MRRP                  V4      R7      x  K  R# 5i)zParse ``DocstringExample`` objects from the body of this section.

:param text: section body text. Should be cleaned with
             ``inspect.cleandoc`` before parsing.
z>>>r   N)snippetrD   )	r   r&   
splitlines
startswithappendpopr   r/   join)r5   rA   linessnippet_linesdescription_liness   &&   r   rE   ExamplesSection.parse   s      t""$//1M "Qx**511$$UYYq\28&&u--!((16"
4A		-0t II&78  s"   /DDD*DD%A*DrW   Nr   rO   s   @r   r   r      s     
 r   r   
ParametersparamParams	ArgumentsArgsOther Parametersother_paramzOther ParamszOther Argumentsz
Other ArgsReceivesreceivesReceiveRaisesraisesRaiseWarnswarnsWarn
Attributes	attribute	AttributeReturnsreturnsReturnYieldsyieldsYieldExamplesexamplesExampleWarningswarningsWarningzSee Alsosee_alsoRelatedNotesnotesNote
References
references	Reference
deprecateddeprecationc                   d   a  ] tR tRt o RtRV 3R lR lltR tV 3R lR ltV 3R	 lR
 ltRt	V t
R# )NumpydocParseri-  z%Parser for numpydoc-style docstrings.Nc                n   < V ^8  d   QhRS[ P                  S[ P                  S[S[3,          ,          /# )r   sections)r   r#   Dictr"   r,   )r   r1   s   "r   r   NumpydocParser.__annotate__0  s*      AFF3<,@!A r   c                    T;'       g    \         pV Uu/ uF  q"P                  VbK  	  upV n        V P                  4        R# u upi )zKSetup sections.

:param sections: Recognized sections or None to defaults.
N)DEFAULT_SECTIONSr.   r   _setup)r5   r   ss   && r   r6   NumpydocParser.__init__0  s<    
 ///-56X!X6 7s   Ac                    \         P                  ! R P                  R V P                  P	                  4        4       4      \         P
                  R7      V n        R# )|c              3   8   "   T F  qP                   x  K  	  R # 5ir4   )r=   ).0r   s   & r   	<genexpr>(NumpydocParser._setup.<locals>.<genexpr>;  s     F/E!oo/Es   r)   N)recompiler   r   valuesM	titles_rerk   s   &r   r   NumpydocParser._setup9  s8    IIFt}}/C/C/EFF$$
r   c                    < V ^8  d   QhRS[ /# )r   section)r,   )r   r1   s   "r   r   r   ?  s      7 r   c                V    WP                   VP                  &   V P                  4        R# )z<Add or replace a section.

:param section: The new section.
N)r   r.   r   )r5   r   s   &&r   add_sectionNumpydocParser.add_section?  s     (/gmm$r   c                &   < V ^8  d   QhRS[ RS[/# r@   r"   r   )r   r1   s   "r   r   r   H  s     * *# *) *r   c                   \        \        P                  R7      pV'       g   V# \        P                  ! V4      pV P
                  P                  V4      pV'       d'   VRVP                  4        pWP                  4       R pMTpRpVP                  R^4      pV^ ,          ;'       g    RVn	        \        V4      ^8  d_   V^,          ;'       g    RpVP                  R4      Vn        VP                  R4      Vn        VP                  4       ;'       g    RVn        \#        V P
                  P%                  V4      4       F  w  r8\'        R VP)                  4        4       4      p	V P*                  V	,          p
VP-                  4       pVe   VP                  4       MRpVP.                  P1                  V
P3                  W[V 4      4       K  	  V# )QParse the numpy-style docstring into its components.

:returns: parsed docstring
)styleN r   z

c              3   0   "   T F  qf   K  Vx  K  	  R # 5ir4   rW   )r   gs   & r   r   'NumpydocParser.parse.<locals>.<genexpr>i  s     DNqNs   
)r   r
   NUMPYDOCra   rb   r   r|   r_   r   short_descriptionr'   r   blank_after_short_descriptionendswithblank_after_long_descriptionr&   long_descriptionr   r^   r   groupsr   r   metaextendrE   )r5   rA   retrc   
desc_chunk
meta_chunkpartslong_desc_chunk	nextmatchr.   factoryr_   r   s   &&           r   rE   NumpydocParser.parseH  s   
 n556J % %%d+o.Jkkmo.JJJ   q) %a 0 0Du:>#Ahnn"O0?0J0J1C- 0?/G/G/OC,#2#8#8#:#B#BdC  )$..*A*A**M NEDELLNDDEmmE*G IIKE'0'<)//#$CHHOOGMM*3*?@A !O 
r   )r   r   r4   )rG   rH   rI   rJ   rK   r6   r   r   rE   rM   rN   rO   s   @r   r   r   -  s+     / 
 * *r   r   c                0    V ^8  d   QhR\         R\        /# r@   r   )r   s   "r   r   r   u  s     ( ( (	 (r   c                4    \        4       P                  V 4      # )r   )r   rE   )rA   s   &r   rE   rE   u  s    
 !!$''r   z    c                H    V ^8  d   QhR\         R\        R\        R\        /# )r   	docstringrendering_styleindentr   )r   r   r"   )r   s   "r   r   r   }  s8     W WW $W 	W
 	Wr   c                
  aa
a R VV
3R lloR V
V3R llp. o
V P                   '       d   S
P                  V P                   4       V P                  '       d   S
P                  R4       V P                  '       d   RpV P                  P                  '       d!   VRV P                  P                   2,          pV P                  P
                  '       d&   V P                  P
                  P                  4       pM. pRS 2pS
P                  VP                  V.V,           4      4       V P                  '       d   S
P                  V P                  4       V P                  '       d   S
P                  R4       T! R	V P                  ;'       g    .  Uu. uF  qwP                  ^ ,          R
8X  g   K  VNK   	  up4       T! RV P                  ;'       g    .  Uu. uF  pVP                  ^ ,          R8X  g   K  VNK!  	  up4       T! RV P                  ;'       g    .  Uu. uF  pVP                  '       d   K  VNK  	  up4       T! RV P                  ;'       g    .  Uu. uF  qwP                  '       g   K  VNK  	  up4       V P                  '       dj   V P                  '       gX   V P                  pS
P                  V'       d   RMR4       S
P                  R\        S
R,          4      ,          4       S! V4       T! RV P                  ;'       g    .  Uu. uF  pVP                  ^ ,          R8X  g   K  VNK!  	  up4       T! RV P                  ;'       g    .  Uu. uF  pVP                  ^ ,          R8X  g   K  VNK!  	  up4       T! RV P                   ;'       g    .  Uu. uF  qwP                  ^ ,          R8X  g   K  VNK   	  up4       T! RV P                   ;'       g    .  Uu. uF  qwP                  ^ ,          R8X  g   K  VNK   	  up4       V P"                   F  p	\%        V	\&        \(        \*        \,        34      '       d   K+  S
P                  R4       S
P                  V	P                  ^ ,          P/                  RR4      P1                  4       4       S
P                  R\        V	P                  ^ ,          4      ,          4       V	P
                  '       g   K  S
P                  V	P
                  4       K  	  RP                  S
4      # u upi u upi u upi u upi u upi u upi u upi u upi )zRender a parsed docstring into docstring text.

:param docstring: parsed docstring representation
:param rendering_style: the style to render docstrings
:param indent: the characters used as indentation in the docstring string
:returns: docstring text
c                d    V ^8  d   QhR\         P                  \        \        \        3,          /# )r   one)r   Unionr   r	   r   )r   s   "r   r   compose.<locals>.__annotate__  s%      WW^%5FGr   c                   < \        V \        4      '       d   V P                  pM%\        V \        4      '       d   V P                  pMR pV P
                  '       d    V'       d   VRV P
                   2,          pM)V P
                  '       d   V P
                  pM
V'       g   Rp\        V \        4      '       d   V P                  '       d
   VR,          pV P                  '       dH   RS 2P                  V.V P                  P                  4       ,           4      pSP                  V4       R # SP                  V4       R # )Nz : r   z
, optionalr   )
isinstancer   ru   r	   r   rv   rw   rD   r   r   r   )r  headbodyr  r	  s   &  r   process_onecompose.<locals>.process_one  s     c>**<<D-..??DD===Tc#--))D]]]==DDc>**sL D???x=%%tfs/I/I/K&KLDLLLLr   c                n    V ^8  d   QhR\         R\        P                  \        P                  ,          /# )r   rr   rt   )r"   r   ListAny)r   s   "r   r   r    s&     ! !3 !affQUUm !r   c                    < V'       d^   SP                  R 4       SP                  V 4       SP                  R\        SR,          4      ,          4       V F  pS! V4       K  	  R# R# )r   r;   N)r   r'   )rr   rt   argr	  r  s   && r   process_sectcompose.<locals>.process_sect  sN    LLLLLLs59~-.C  	 r   r   z.. deprecated:: r   r   r   r   r   r   r   r;   r   r   r   r   r   r   r   r   r   r#  )r   r   r   r   r   rD   r   r   r  r  paramsrt   many_returnsr   r   r'   r   r  r  r   r   r	   r   replacer.   )r  r  r  r%  firstrestr   itemr  r  r	  r  s   &&f       @@r   composer.  }  s    4! ! E"""Y001...R!  (((q..66788E  ,,,((44??ADD6(mSXXugn-.!!!Y//0---R#**00b0L0$IIaLG4K0L
  "((..B.	
.yy|{* D.	
  "..44"4	
4$$ D4	
 #0066B6L6$:K:K6L
 !7!7!7X)4S3uRy>)*C "((..B.	
.yy|z) D.	
  "((..B.	
.yy|}, D.	
 #**00b0M0$IIaLH4L0M
 #**00b0L0$IIaLG4K0L
 # 	
 
 RTYYq\))#r288:;S3tyy|,,-LL))*# & 99U_ 	M
	
	
 	M	
	
 	N
 	Ms`   T
3T
T 
:T 
"T%
;T%
#T*
;T*
T/
=T/
%T4
T4
,T9

T9
2T>
T>
r4   ))rK   ra   r   r   typingr   textwrapr   commonr   r   r   r   r   r   r	   r
   r   r   r(   r   r   r]   ry   rz   r{   r   r,   rQ   rg   rn   r   r   r   r   r   r   r   rE   COMPACTr.  rW   r   r   <module>r3     s@  
   	  
 
 
= ::l"$$/**HIzz"NO  jjG  ::IJ F FB 0
/W 
/&
: &
R
J 
 
Z 
<N 
 
#g #L w' 7#  g&  !	 
 #]3  /  "M2  }-  Z(  J'  (H%  '8$  '7#  &'"  {+   k*! " 9i(# $ 8Y'% & (H%' ( '8$) * J
++ , Iz*- . J
#/ 0 Iz"1 2 J
#3 4 Iz"5 6 GW7 8 FG9 : L,'; < K&= > |]3?  FE EP( '5&<&<	W Wr   