
    iKjț                    	   U d dl mZ d dlZd dlmZ d dlmZmZ d dlm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% d dl&m'Z'm(Z( d dl)m*Z*m+Z+ erd dlm,Z, d d	lm-Z-m.Z. d d
l/m0Z0 d dl1m2Z2 i de*jf                  de*jf                  de*jf                  de*jf                  de*jh                  de*jh                  de*jh                  de*jh                  de*jh                  de*jh                  de*jj                  de*jj                  de*jj                  de*jj                  de*jl                  de*jl                  de*jn                  e*jp                  e*jr                  e*jt                  e*jv                  e*jx                  e*jx                  e*jz                  e*j|                  e*j~                  e*j                  e*j                  dZAeBeCeDeE   f   ZFeDeF   ZGeBeGeCf   ZH ej                  dej                        ZKdeLd <    ej                  d!      ZMdeLd"<    ej                  d#      ZNdeLd$<    ej                  d%      ZOdeLd&<   d'd(dLd)ZPdMd*ZQd'd'd'd+	 	 	 	 	 	 	 	 	 	 	 	 	 dNd,ZR	 	 	 	 	 	 	 	 dOd-ZSd'd.	 	 	 	 	 	 	 	 	 dPd/ZTd'd.	 	 	 	 	 	 	 	 	 dQd0ZUd'd(	 	 	 	 	 	 	 	 	 dRd1ZVd'd(	 	 	 	 	 	 	 	 	 dSd2ZWd'd(	 	 	 	 	 	 	 	 	 dTd3ZX	 	 	 	 	 	 	 	 dUd4ZYd'd(	 	 	 	 	 	 	 	 	 dVd5ZZd'd(	 	 	 	 	 	 	 	 	 dWd6Z[d'd(	 	 	 	 	 	 	 	 	 dXd7Z\d'd8	 	 	 	 	 	 	 	 	 dYd9Z]d'd'd:	 	 	 	 	 	 	 	 	 	 	 dZd;Z^d<d d=	 	 	 	 	 	 	 	 	 d[d>Z_d'd'd'd'd?	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d\d@Z`d'd'd'd'd?	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d]dAZad'd'd'd'dB	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d^dCZbd'dD	 	 	 	 	 	 	 	 	 d_dEZcd`dFZde*jf                  eSe*jh                  eTe*jj                  eUe*jl                  e[e*j                  e\e*jt                  ece*jv                  eVe*jx                  eWe*jz                  eXe*j|                  eYe*j~                  eZe*jn                  e`e*jp                  eae*jr                  ebiZe G dG dHed<I      Zfd<d'd'd'd<d'd'd'd'd'dJ
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dadKZgy)b    )annotationsN)suppress)TYPE_CHECKING	TypedDict)DocstringAttributeDocstringClassDocstringFunctionDocstringModuleDocstringParameterDocstringRaiseDocstringReceiveDocstringReturnDocstringSectionDocstringSectionAdmonitionDocstringSectionAttributesDocstringSectionClassesDocstringSectionExamplesDocstringSectionFunctionsDocstringSectionModulesDocstringSectionOtherParametersDocstringSectionParametersDocstringSectionRaisesDocstringSectionReceivesDocstringSectionReturnsDocstringSectionTextDocstringSectionTypeAliasesDocstringSectionTypeParametersDocstringSectionWarnsDocstringSectionYieldsDocstringTypeAliasDocstringTypeParameterDocstringWarnDocstringYield)docstring_warningparse_docstring_annotation)DocstringSectionKindLogLevel)Pattern)AnyLiteral)Expr)	Docstringargs	argumentsparams
parameterszkeyword argszkeyword argumentsz
other argszother argumentszother paramszother parametersz	type argsztype argumentsztype paramsztype parametersraises
exceptionsreturns)yieldsreceivesexamples
attributes	functionsmethodsclassesztype aliasesmoduleswarnswarningsz4^(?P<type>[\w][\s\w-]*):(\s+(?P<title>[^\s].*))?\s*$r(   _RE_ADMONITIONz=^(?:(?P<name>\w+)?\s*(?:\((?P<type>.+)\))?:\s*)?(?P<desc>.*)$_RE_NAME_ANNOTATION_DESCRIPTIONz^\s*<BLANKLINE>\s*$_RE_DOCTEST_BLANKLINEz(\s*#\s*doctest:.+)$_RE_DOCTEST_FLAGST)r=   c                  | j                   }|t        |      k\  rg |fS |}g }t        ||         r|dz  }t        ||         rt        ||         t        ||   j                               z
  }|dk(  rg |dz
  fS |||   |d  gf}|dz  }|t        |      k  r||   }	t        |	      r|d   j	                  d       n|	j                  |dz  dz        r|d   j	                  |	|dz  d         n|	j                  |dz   dz        r^t        |	      t        |	j                               z
  }
|d   j	                  |	|
d         |rOt        | |d|dz    d| d|dz   d	|
        n/|	j                  |dz        r|j	                  |       ||	|d  gf}nn|dz  }|t        |      k  r|r|j	                  |       ||dz
  fS )
N   r        z,Confusing indentation for continuation line z in docstring, should be z * 2 = z spaces, not )lineslen_is_empty_linelstripappend
startswithr$   )	docstringoffsetr=   optionsrG   
new_offsetitemsindentcurrent_itemlinecont_indents              s/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/griffe/_internal/docstrings/google.py_read_block_itemsrW   \   s   OOEU6zJE z*
+a
 z*
+ z"#c%
*;*B*B*D&EEF{:>!! z!267!; <=L!OJ s5z
!Z $O""2&__VaZ#-.O""4
#56__fqjC/0d)c$++-&88KO""4#56!B:PQ>BR S!!'
|=W __Vc\*LL&&fg8L a
A s5z
!D \"*q.      c                  | j                   }|t        |      k\  rd|dz
  fS |}g }t        ||         r|dz  }t        ||         rt        ||         t        ||   j                               z
  }|dk(  rd|dz
  fS |j	                  ||   j                                |dz  }|t        |      k  rv||   j                  |dz        st        ||         rQ|j	                  ||   |d         |dz  }|t        |      k  r'||   j                  |dz        rBt        ||         rQdj                  |      j                  d      |dz
  fS )NrD   rC   r   rF   
)rG   rH   rI   rJ   rK   rL   joinrstrip)rM   rN   rO   rG   rP   blockrR   s          rV   _read_blockr^      se   OOEU6A:~JE z*
+a
 z*
+ z"#c%
*;*B*B*D&EEF{6A:~ 
LLz"))+,!OJ s5z
!uZ'8'C'CFSL'QUcdijtduUvU:&vw/0a
 s5z
!uZ'8'C'CFSL'QUcdijtduUv 99U""4(*q.88rX   )warn_unknown_paramswarn_missing_typesr=   c          	     \   g }t        | f||d|\  }}|D ]  \  }	}
	 |
d   j                  dd      \  }}dj	                  |j                         g|
dd        j                  d      }d|v rq|j                  d	      r`|j                  dd      \  }}|j                         }|j                  d	      j                  d
      j                         }t        ||       }n&|}	 | j                  j                  |   j                  }	 | j                  j                  |   j                   }|r|r|t        | |	d| d       |re|rct#        t              5  | j                  j                  }||vr1d| d}d| d| fD ]  }||v s|d| dz  } n t        | |	|       d d d        |j%                  t'        ||||              ||fS # t        $ r |rt        | |	d|
d    d       Y w xY w# t        t        f$ r d }Y w xY w# t        t        f$ r d }Y w xY w# 1 sw Y   xY w)NrN   r=   r   :rC   -Failed to get 'name: description' pair from ''rZ   ()
, optionalz%No type or annotation for parameter 'zParameter 'z+' does not appear in the function signature***. Did you mean ''?namevalue
annotationdescription)rW   split
ValueErrorr$   r[   rJ   r\   endswithstripremovesuffixr%   parentr0   rp   AttributeErrorKeyErrordefaultr   rK   r   )rM   rN   r_   r`   r=   rO   r0   r]   rP   line_numberparam_linesname_with_typerq   rn   rp   rz   r/   messagestarred_names                      rV   _read_parametersr      s    J *)aFXaY`aE: %* [		*5a.*>*>sA*F'NK ii!3!3!5 HAB HIPPQUV . ^%<%<S%A-33C;D*::<D#005BB<PVVXJ3J	JJ!D"&--88>II
	&&11$7??G *z/Ai8]^b]ccd6ef+.)"))44v% +D61\]G+,TFr$[(A'61#)9,r'JJG! )B &igF * 	,$gR\juvwc %*f z!!_  	!CKPQNCSSTU
 	. #H- "!
"
 ) 	G	 *)sG   G##G3#H2H"H"G0/G03HHHH"H+	c               >    t        | fd|i|\  }}t        |      |fS NrN   )r   r   )rM   rN   rO   r0   rP   s        rV   _read_parameters_sectionr      s-     .iRR'RJ
%j1:==rX   )r_   c               @    t        | f|dd|\  }}t        |      |fS )NF)rN   r_   )r   r   )rM   rN   r_   rO   r0   rP   s         rV   _read_other_parameters_sectionr   
  s1     .im\amelmJ
*:6
BBrX   c          	     *   g }t        | fd|i|\  }}|D ]  \  }}	 |d   j                  dd      \  }	}
dj	                  |
j                         g|dd        j                  d      }
d|	v rI|	j                  dd      \  }}|j                  d	      r|j                  d
      r|dd }t        ||       }n&|	}	 | j                  j                  |   j                  }	 | j                  j                  |   j                  }|rt!        t              5  | j                  j                  }||vrRd| d| j                  j"                  j$                   d}d| d| fD ]  }||v s|d| dz  } n t        | ||       d d d        |j'                  t)        ||||
              t+        |      |fS # t        $ r t        | |d|d    d       Y w xY w# t        t        f$ r d }Y w xY w# t        t        f$ r d }Y w xY w# 1 sw Y   xY w)NrN   r   rc   rC   rd   re   rZ   rF   rf   rg   zType parameter 'z' does not appear in the z
 signatureri   rj   rk   rl   rm   )rW   rr   rs   r$   r[   rJ   r\   rL   rt   r%   rw   type_parametersrp   rx   ry   rz   r   kindro   rK   r!   r   )rM   rN   r_   rO   r   r]   rP   r{   type_param_linesname_with_boundrq   rn   boundrz   type_paramsr~   r   s                    rV   _read_type_parameters_sectionr     sn    O *)NFNgNE:).%%	+;A+>+D+DS!+L(O[ ii!3!3!5 M8H8L MNUUVZ[ /!)//Q7KD%$)<a.ui@E"D!((88>II	&&66t<DDG .)'..>>{* 06OPYP`P`PePePkPkOllvwG+,TFr$[(A';6#)9,r'JJG! )B &igF * 	" '		
[ */l */:JFFe  	?@PQR@S?TTUV
 	, #H- 
 ) 	G	 *)sH   F5:#G#G1AH	&H	5GGG.-G.1HH	H	c          	        g }t        | f||d|\  }}d }|D ]  \  }}		 |	d   j                  dd      \  }
}dj	                  |j                         g|	dd        j                  d      }d|
v rD|
j                  dd      \  }}|j                  d	      }|j                  d
      }t        ||       }n=|
}t        t        t        t              5  | j                  |   j                  }d d d        |j!                  t#        |||              t%        |      |fS # t        $ r |rt        | |d|	d    d       Y &w xY w# 1 sw Y   [xY w)Nrb   r   rc   rC   rd   re   rZ   rF   z()rh   rn   rp   rq   )rW   rr   rs   r$   r[   rJ   r\   ru   rv   r%   r   rx   ry   	TypeErrorrw   rp   rK   r   r   )rM   rN   r=   rO   r7   r]   rP   rp   r{   
attr_linesr}   rq   rn   s                rV   _read_attributes_sectionr   Z  sq    J))aFXaY`aE:$(J#(Z		*4Q-*=*=c1*E'NK ii!3!3!5 G
12 GHOOPTU. -33C;D*#))$/J#00>J3J	JJ!D.(I>&--d3>>
 ? 	,$:[fgh5 $)8 &j1:==3  	!CJqM?RST
 	& ?>s   DEE ?E E	c          	        g }t        | f||d|\  }}d }|D ]  \  }}		 |	d   j                  dd      \  }
}dj	                  |j                         g|	dd        j                  d      }d|
v r|
j                  dd      d   }|
}n|
}d }|j                  t        |||	              t        |      |fS # t        $ r |rt        | |d|	d    d       Y w xY w
Nrb   r   rc   rC   z2Failed to get 'signature: description' pair from 're   rZ   rf   r   )
rW   rr   rs   r$   r[   rJ   r\   rK   r	   r   )rM   rN   r=   rO   r8   r]   rP   	signaturer{   
func_linesname_with_signaturerq   rn   s                rV   _read_functions_sectionr     s     I))aFXaY`aE:#'I#(Z		/9!}/B/B3/J, ii!3!3!5 G
12 GHOOPTU%%&,,S!4Q7D+I&DI*Xcde+ $). %Y/;;)  	!HTUWXY
 	   B88CCc          	        g }t        | f||d|\  }}d }|D ]  \  }}		 |	d   j                  dd      \  }
}dj	                  |j                         g|	dd        j                  d      }d|
v r|
j                  dd      d   }|
}n|
}d }|j                  t        |||	              t        |      |fS # t        $ r |rt        | |d|	d    d       Y w xY wr   )
rW   rr   rs   r$   r[   rJ   r\   rK   r   r   )rM   rN   r=   rO   r:   r]   rP   r   r{   class_linesr   rq   rn   s                rV   _read_classes_sectionr     s    G))aFXaY`aE:#'I$) [		/:1~/C/CC/K, ii!3!3!5 HAB HIPPQUV%%&,,S!4Q7D+I&DI~4IS^_`+ %*. #7+Z77)  	!HUVHXXYZ
 	r   c          	     n   g }t        | fd|i|\  }}|D ]n  \  }}	 |d   j                  dd      \  }}	dj	                  |	j                         g|dd        j                  d      }	|j                  t        ||	             p t        |      |fS # t        $ r t        | |d|d    d       Y w xY w)	NrN   r   rc   rC   rd   re   rZ   rn   rq   )
rW   rr   rs   r$   r[   rJ   r\   rK   r    r   )
rM   rN   rO   type_aliasesr]   rP   r{   type_alias_linesrn   rq   s
             rV   _read_type_aliases_sectionr     s     L))NFNgNE:).%%	 0 3 9 9#q AD+ ii!3!3!5 M8H8L MNUUVZ[.DkRS */ '|4j@@  	?@PQR@S?TTUV
 	s   BB43B4c          	     t   g }t        | f||d|\  }}|D ]n  \  }}	 |d   j                  dd      \  }	}
dj	                  |
j                         g|dd        j                  d      }
|j                  t        |	|
             p t        |      |fS # t        $ r |rt        | |d|d    d       Y w xY w)	Nrb   r   rc   rC   rd   re   rZ   r   )
rW   rr   rs   r$   r[   rJ   r\   rK   r
   r   )rM   rN   r=   rO   r;   r]   rP   r{   module_linesrn   rq   s              rV   _read_modules_sectionr     s     G))aFXaY`aE:%*!\		 ,Q 5 5c1 =D+ ii!3!3!5 IQR8H IJQQRVWDkJK &+ #7+Z77  	!CLQROCTTUV
 	   BB76B7c          	        g }t        | f||d|\  }}|D ]z  \  }}	 |d   j                  dd      \  }	}
dj	                  |
j                         g|dd        j                  d      }
t        |	|       }	|j                  t        |	|
             | t        |      |fS # t        $ r |rt        | |d|d    d       Y w xY w)	Nrb   r   rc   rC   z2Failed to get 'exception: description' pair from 're   rZ   rp   rq   )rW   rr   rs   r$   r[   rJ   r\   r%   rK   r   r   )rM   rN   r=   rO   r2   r]   rP   r{   exception_linesrp   rq   s              rV   _read_raises_sectionr     s     J))aFXaY`aE: ).$_		&5a&8&>&>sA&F#J ii!3!3!5 L8K LMTTUYZ/
IF
.JKXY )." "*-z99  	!HYZI[H\\]^
 	s   B!!CCc          	     t   g }t        | f||d|\  }}|D ]n  \  }}	 |d   j                  dd      \  }	}
dj	                  |
j                         g|dd        j                  d      }
|j                  t        |	|
             p t        |      |fS # t        $ r |rt        | |d|d    d       Y w xY w)	Nrb   r   rc   rC   z0Failed to get 'warning: description' pair from 're   rZ   r   )
rW   rr   rs   r$   r[   rJ   r\   rK   r"   r   )rM   rN   r=   rO   r<   r]   rP   r{   warning_linesrp   rq   s              rV   _read_warns_sectionr   "  s     E))aFXaY`aE:&+"]		&3A&6&<&<S!&D#J ii!3!3!5 Jab8I JKRRSWX]jkRS ', !'33  	!F}UVGWFXXYZ
 	r   )multiplec               n    |rt        | fd|i|S t        | fd|i|\  }}||j                         fg|fS r   )rW   r^   
splitlines)rM   rN   r   rO   	one_blockrP   s         rV   _read_block_items_mayber   >  sQ      E6EWEE'	L&LGLIz--/01:==rX   )namedr=   c                  |rKt         j                  |d         }|s|rt        | |d|d    d       t        |j	                         \  }}}nId }d|d   v r9|d   j                  dd      \  }}|j                  d      j                  d      }nd }|d   }dj                  |j                         g|dd        j                  d      }|||fS )	Nr   z4Failed to get name, annotation or description from 're   rc   rC   rf   rg   rZ   )	r?   matchr$   rs   groupsrr   rJ   r\   r[   )	rM   r{   rG   r   r=   r   rn   rp   rq   s	            rV    _get_name_annotation_descriptionr   K  s     /55eAh?!J5QR8*TUV
 (-%j+%(?&+AhnnS!&<#J#**3/66s;JJ(K))[//1>E!"I>?FFtLK[((rX   F)r   indexc               T   d }t        t              5  | j                  j                  }|j                  r|j
                  j                  |   }n|j                  r|dk(  r|j
                  }|r%|j                  r|j
                  j                  |   }d d d        |S # 1 sw Y   |S xY w)Nr   )	r   	Exceptionrw   rp   is_generatorsliceelementsis_iteratoris_tuple)rM   	gen_indexr   r   rp   s        rV   _annotation_from_parentr   j  s     J	)	%%00
""#))229=J##	Q#))J
++#))2259J 
  
 s   BBB')returns_multiple_itemsreturns_named_valuer`   r=   c                  g }t        | f||d|\  }}	t        |      D ]  \  }
\  }}	 t        | |||      \  }}}|rt	        ||       }nCt        | dt        |      dkD  |
      }|r&|r$|"|rt        |      n|
dz   }t        | |d|        |j                  t        |xs d||              t        |      |	fS # t        $ r Y w xY w)	NrN   r   r   rE   rC   r   r   r   z)No type or annotation for returned value rD   r   )r   	enumerater   rs   r%   r   rH   reprr$   rK   r   r   )rM   rN   r   r   r`   r=   rO   r3   r]   rP   r   r{   return_linesrn   rp   rq   returned_values                    rV   _read_returns_sectionr   }  s    G/' 	E: /8.>**\	,L)	-)D*k 3J	JJ 1aRUV[R\_`R`hmnJ.:3E/3d!)[<efteu:vwDJB:[fgh- /?0 #7+Z77!  		   B??	C
Cc                  g }t        | f||d|\  }}	t        |      D ]  \  }
\  }}	 t        | |||      \  }}}|rt	        ||       }nCt        | dt        |      dkD  |
      }|r&|r$|"|rt        |      n|
dz   }t        | |d|        |j                  t        |xs d||              t        |      |	fS # t        $ r Y w xY w)	Nr   r   r   rC   r   z(No type or annotation for yielded value rD   r   )r   r   r   rs   r%   r   rH   r   r$   rK   r#   r   )rM   rN   r   r   r`   r=   rO   r4   r]   rP   r   r{   yield_linesrn   rp   rq   yielded_values                    rV   _read_yields_sectionr     s    F/' 	E: .7u-=))[	,L)	-)D*k 3J	JJ 1aRUV[R\_`R`hmnJ.:3E.2T
	!)[<derds:tun$*"Ydef- .>0 "&):55!  		r   )receives_multiple_itemsreceives_named_valuer`   r=   c                  g }t        | f||d|\  }}	t        |      D ]  \  }
\  }}	 t        | |||      \  }}}|rt	        ||       }nt        | dt        |      dkD  |
      }|r&|r$|"|rt        |      n|
dz   }t        | |d|        |j                  t        |xs d||              t        |      |	fS # t        $ r Y w xY w)Nr   r   rC   r   z)No type or annotation for received value rD   r   )r   r   r   rs   r%   r   rH   r   r$   rK   r   r   )rM   rN   r   r   r`   r=   rO   r5   r]   rP   r   r{   receive_linesrn   rp   rq   received_values                    rV   _read_receives_sectionr     s    H/( 	E: 09/?++]	,L*	-)D*k 3J	JJ 1aRUV[R\_`R`hmnJ*z/A+/T$ZUQYNi8abpaq6rs(djbZ]hij- 0@0 $H-z99!  		r   )trim_doctest_flagsc               2   t        | fd|i|\  }}g }d}d}g }	g }
|j                  d      D ]g  }t        |      rK|r7|
r2|j                  t        j
                  dj                  |
      f       g }
d}H|	j                  |       Z|r@|r,t        j                  d|      }t        j                  d|      }|
j                  |       |j                  d      r| }|	j                  |       |r|	j                  |       |j                  d      rp|	rA|j                  t        j                  dj                  |	      j                  d      f       g }	d}|rt        j                  d|      }|
j                  |       W|	j                  |       j |	r@|j                  t        j                  dj                  |	      j                  d      f       n2|
r0|j                  t        j
                  dj                  |
      f       t        |      |fS )NrN   FrZ   rD   ```z>>>T)r^   rr   rI   rK   r&   r6   r[   rA   subr@   rL   textr\   r   )rM   rN   r   rO   r   rP   sub_sectionsin_code_examplein_code_blockcurrent_textcurrent_examplerT   s               rV   _read_examples_sectionr     s    #9GVGwGD*hjLOM L!#O

4 $" '')=)F)F		RaHb(cd&(O"'##D)!(,,R6,00T:""4(__U# --M%%__U###%9%>%>		,@W@^@^_c@d$ef!"O!(,,R6""4( %E !H 166		,8O8V8VW[8\]^	1::DIIo<VWX#L1:==rX   c                $    | j                          S )N)ru   )rT   s    rV   rI   rI   B  s    zz|rX   c                      e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded	<   	 ded
<   	 ded<   	 ded<   y)GoogleOptionsz,Options for parsing Google-style docstrings.boolignore_init_summaryr   r   r    returns_type_in_property_summaryr   r   r_   r`   r=   N)__name__
__module____qualname____doc____annotations__ rX   rV   r   r   X  s^    6JE  Mz&**[!!An3]N7rX   r   )total
r   r   r   r   r   r   r   r_   r`   r=   c       
        $   g }g }d}| j                   }|||||||||	|
d
}|d   xr} | j                  duxrm | j                  j                  dk(  xrR | j                  j                  xr: | j                  j                  duxr  | j                  j                  j                  }|rdnd}|t        |      k  r||   j                         }|r8|j                  d      j                  d	      rd}|j                  ||          nH|j                  d      j                  d	      rd
}|j                  ||          nt        j                  ||         x}r|j                         }|d   }|d   }|j                         t        v }|dkD  }| xs t        ||dz
           }|t        |      dz
  k  }|t        |      dz
  k  }|xr t        ||dz            }|xr t        ||dz            }|xr | xr ||dz      j                  d      }|xr | xr ||dz      j                  d      }|s|s|j                  ||          |dz  }g } |rdnd}!|s|r|s| j                  d|!        |r|r| j                  d|! d       | rP|
r3dj                  |       }"t!        | |d|! d|" t"        j$                         |j                  ||          |dz  }2|r|rEt'        |      r8|j                  t)        dj                  |      j+                  d                   g }t,        t        |j                               }# |#| fd|dz   i|\  }$}|$r||$_        |j                  |$       nt1        | |dz         \  }%}|%r|rEt'        |      r8|j                  t)        dj                  |      j+                  d                   g }||}|j                         j3                  dd      }|j                  t5        ||%|             nAt7        t8              5  |j                  ||          ddd       n|j                  ||          |dz  }|t        |      k  r|rCt'        |      r8|j                  t)        dj                  |      j+                  d                   |r|r| j                  r| j                  j:                  rd| j                  j<                  v r|d   j>                  j                         jA                  d      }d|d   v rj|d   jA                  dd      \  }&}'|'g|dd }dj                  |      |d   _        |j                  tC        tE        ddtG        |&|             g             |S # 1 sw Y   AxY w)a  Parse a Google-style docstring.

    This function iterates on lines of a docstring to build sections.
    It then returns this list of sections.

    Parameters:
        docstring: The docstring to parse.
        ignore_init_summary: Whether to ignore the summary in `__init__` methods' docstrings.
        trim_doctest_flags: Whether to remove doctest flags from Python example blocks.
        returns_multiple_items: Whether to parse multiple items in `Yields` and `Returns` sections.
            When true, each item's continuation lines must be indented.
            When false (single item), no further indentation is required.
        returns_named_value: Whether to parse `Yields` and `Returns` section items as name and description, rather than type and description.
            When true, type must be wrapped in parentheses: `(int): Description.`. Names are optional: `name (int): Description.`.
            When false, parentheses are optional but the items cannot be named: `int: Description`.
        receives_multiple_items: Whether to parse multiple items in `Receives` sections.
            When true, each item's continuation lines must be indented.
            When false (single item), no further indentation is required.
        receives_named_value: Whether to parse `Receives` section items as name and description, rather than type and description.
            When true, type must be wrapped in parentheses: `(int): Description.`. Names are optional: `name (int): Description.`.
            When false, parentheses are optional but the items cannot be named: `int: Description`.
        returns_type_in_property_summary: Whether to parse the return type of properties
            at the beginning of their summary: `str: Summary of the property`.
        warn_unknown_params: Warn about documented parameters not appearing in the signature.
        warn_missing_types: Warn about missing types/annotations for parameters, return values, etc.
        warnings: Whether to log warnings at all.

    Returns:
        A list of docstring sections.
    Fr   r   N__init__rE   r   rF   r   TtitletyperC   section
admonitionzMissing blank line above zExtraneous blank line below z titlez; z	Possible z skipped, reasons: rZ   rN   )rN   -)r   r   r   propertyrc   rD   )rq   rp   )$rG   rw   rn   is_functionis_classrH   lowerrJ   rL   rK   r>   r   	groupdict_section_kindrI   r[   r$   r'   debuganyr   r\   _section_readerr   r^   replacer   r   
IndexErroris_attributelabelsro   rr   r   r   r%   )(rM   r   r   r   r   r   r   r   r_   r`   r=   sectionscurrent_sectionr   rG   rO   ignore_summaryrN   
line_lowerr   r   r   admonition_type
is_sectionhas_previous_lineblank_line_abovehas_next_linehas_next_linesblank_line_belowblank_lines_belowindented_line_belowindented_lines_belowreasonsr   reasons_stringreaderr   contentsrp   rT   s(                                           rV   parse_googler  q  s   X (*HOMOOE  30"82,L#: 420G 	%& 	-D(	-!!Z/	- ((	- ##4/		-
 ##,,  !QaF
3u:
6]((*
  %007 %""5=1s#..u5 M""5=1$**5=99U9__&F7OE$VnO(..0MAJ &
#44YuVVWZGX8Y"SZ!^3M#c%j1n4N,Rfqj@Q1R . T>%QR
BS3T"/"n8H4H"nUSY\]S]M^MiMijmMn#1#q:K6K#qPUV\_`V`PaPlPlmpPq '+?  &&uV}5!G *9D#';EU!:4&AB#(8!=dV6JK%)YYw%7N%!#D6)<^<LM 	  &&uV}5!"?+ (<TYY=W=^=^_c=d(ef&(O(7L7L7N)OP"("Q6A:"Q"Q$)GMOOG, $/y!#L &&/$OO,@?A[AbAbcgAh,ij*,} /&5&;&;&=&E&Ec3&OOOO$>OZbjo$pq!*-'..uV}= .- ""5=1!_ 3u:
b 3/,TYY-G-N-Nt-TUV 	))))**111!!((*006%(?$Qx~~c15J&E!"I&E $		% 0HQKOO'$RRD^_iktDuvw O9 .-s   VV)
rM   r,   rN   intr=   r   rO   r)   return_ItemsBlock)rM   r,   rN   r  rO   r)   r  ztuple[str, int])rM   r,   rN   r  r_   r   r`   r   r=   r   rO   r)   r  z$tuple[list[DocstringParameter], int])rM   r,   rN   r  rO   r)   r  z-tuple[DocstringSectionParameters | None, int])
rM   r,   rN   r  r_   r   rO   r)   r  z2tuple[DocstringSectionOtherParameters | None, int])
rM   r,   rN   r  r_   r   rO   r)   r  z1tuple[DocstringSectionTypeParameters | None, int])
rM   r,   rN   r  r=   r   rO   r)   r  z-tuple[DocstringSectionAttributes | None, int])
rM   r,   rN   r  r=   r   rO   r)   r  z,tuple[DocstringSectionFunctions | None, int])
rM   r,   rN   r  r=   r   rO   r)   r  z*tuple[DocstringSectionClasses | None, int])rM   r,   rN   r  rO   r)   r  z.tuple[DocstringSectionTypeAliases | None, int])
rM   r,   rN   r  r=   r   rO   r)   r  z*tuple[DocstringSectionModules | None, int])
rM   r,   rN   r  r=   r   rO   r)   r  z)tuple[DocstringSectionRaises | None, int])
rM   r,   rN   r  r=   r   rO   r)   r  z(tuple[DocstringSectionWarns | None, int])
rM   r,   rN   r  r   r   rO   r)   r  r  )rM   r,   r{   r  rG   z	list[str]r   r   r=   r   r  ztuple[str | None, Any, str])
rM   r,   r   zLiteral[0, 1, 2]r   r   r   r  r  zstr | Expr | None)rM   r,   rN   r  r   r   r   r   r`   r   r=   r   rO   r)   r  z*tuple[DocstringSectionReturns | None, int])rM   r,   rN   r  r   r   r   r   r`   r   r=   r   rO   r)   r  z)tuple[DocstringSectionYields | None, int])rM   r,   rN   r  r   r   r   r   r`   r   r=   r   rO   r)   r  z+tuple[DocstringSectionReceives | None, int])
rM   r,   rN   r  r   r   rO   r)   r  z+tuple[DocstringSectionExamples | None, int])rT   strr  r   )rM   r,   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r_   r   r`   r   r=   r   r  zlist[DocstringSection])h
__future__r   re
contextlibr   typingr   r   "griffe._internal.docstrings.modelsr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   !griffe._internal.docstrings.utilsr$   r%   griffe._internal.enumerationsr&   r'   r(   r)   r*   griffe._internal.expressionsr+   griffe._internal.modelsr,   r0   other_parametersr   r1   r3   r4   r5   r6   r7   r8   r:   r   r;   r<   r   tupler  listr  
_BlockItem_BlockItemsr  compile
IGNORECASEr>   r   r?   r@   rA   rW   r^   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rI   r   r   r  r   rX   rV   <module>r,     s   # 	  +       > \ H#11
 ++%00 "-- &11	
 (99 ->> &77 +<< (99 ,== %55 *:: '77 +;; "))  &--!" #++#$ #))$--$--&11%//#--#++(55#++!''$**9> 3S	>"
:K$%$"**%\^`^k^kl l+52::6v+w  w!+,B!C w C'RZZ(?@ 7 @ NR =!@9F !%#B"B" B" 	B"
 B" B" B" *B"J>> > 	>
 3> !%	CC C 	C
 C 8C !%	BGBG BG 	BG
 BG 7BGR 	'>'> '> 	'>
 '> 3'>\ 	"<"< "< 	"<
 "< 2"<R 	"8"8 "8 	"8
 "8 0"8JAA A 	A
 4A: 	88 8 	8
 8 08@ 	:: : 	:
 : /:F 	44 4 	4
 4 .4@ 	
>
> 
> 	
>
 
> 
>$ ))) )
 ) ) !)F    	
  . $( $#+8+8 +8 !	+8
 +8 +8 +8 +8 0+8d $( $#+6+6 +6 !	+6
 +6 +6 +6 +6 /+6d %)!%#+:+: +: "	+:
 +: +: +: +: 1+:d  $	8>8> 8> 	8>
 8> 18>v
 ##%=))+I((*G!5 3!!#9##%=""$;  "7%%'A  "7  "7!5!!#9$8IU 88 !&##' $-2$(!% $#pp p 	p
 !p p '+p "p p p p p prX   