
    Ji                    	   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	 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/m0Z0 d dl1m2Z2 d dl3m4Z4 i de,jj                  de,jj                  de,jj                  de,jj                  de,jl                  de,jl                  de,jl                  de,jl                  de,jl                  de,jl                  de,jn                  de,jn                  de,jn                  de,jn                  de,jp                  de,jp                  de,jr                  e,jt                  e,jv                  e,jx                  e,jz                  e,j|                  e,j|                  e,j~                  e,j                  e,j                  e,j                  e,j                  dZCeDeEeFeG   f   ZHeFeH   ZIeDeIeEf   ZJ ej                  dej                        ZMd eNd!<    ej                  d"      ZOd eNd#<    ej                  d$      ZPd eNd%<    ej                  d&      ZQd eNd'<   d(d)dMd*ZRdNd+ZSd(d(d(d,	 	 	 	 	 	 	 	 	 	 	 	 	 dOd-ZT	 	 	 	 	 	 	 	 dPd.ZUd(d/	 	 	 	 	 	 	 	 	 dQd0ZVd(d/	 	 	 	 	 	 	 	 	 dRd1ZWd(d)	 	 	 	 	 	 	 	 	 dSd2ZXd(d)	 	 	 	 	 	 	 	 	 dTd3ZYd(d)	 	 	 	 	 	 	 	 	 dUd4ZZ	 	 	 	 	 	 	 	 dVd5Z[d(d)	 	 	 	 	 	 	 	 	 dWd6Z\d(d)	 	 	 	 	 	 	 	 	 dXd7Z]d(d)	 	 	 	 	 	 	 	 	 dYd8Z^d(d9	 	 	 	 	 	 	 	 	 dZd:Z_d(d(d;	 	 	 	 	 	 	 	 	 	 	 d[d<Z`d=d d>	 	 	 	 	 	 	 	 	 d\d?Zad(d(d(d(d@	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d]dAZbd(d(d(d(d@	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d^dBZcd(d(d(d(dC	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d_dDZdd(dE	 	 	 	 	 	 	 	 	 d`dFZedadGZfe,jj                  eUe,jl                  eVe,jn                  eWe,jp                  e]e,j                  e^e,jx                  eee,jz                  eXe,j|                  eYe,j~                  eZe,j                  e[e,j                  e\e,jr                  ebe,jt                  ece,jv                  ediZg G dH dIed=J      Zhd=d(d(d(d=d(d(d(d(d(dK
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dbdLZiy)c    )annotationsN)suppress)TYPE_CHECKING	TypedDict)warn)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>   optionsrH   
new_offsetitemsindentcurrent_itemlinecont_indents              t/var/www/html/BankruptcyAI-uat/bankruptcy-ai/venv/lib/python3.12/site-packages/griffe/_internal/docstrings/google.py_read_block_itemsrX   ]   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 )NrE   rD   r   rG   
)rH   rI   rJ   rK   rL   rM   joinrstrip)rN   rO   rP   rH   rQ   blockrS   s          rW   _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8rY   )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rO   r>   r   :rD   -Failed to get 'name: description' pair from ''r[   ()
, optionalz%No type or annotation for parameter 'zParameter 'z+' does not appear in the function signature***. Did you mean ''?namevalue
annotationdescription)rX   split
ValueErrorr%   r\   rK   r]   endswithstripremovesuffixr&   parentr1   rq   AttributeErrorKeyErrordefaultr   rL   r   )rN   rO   r`   ra   r>   rP   r1   r^   rQ   line_numberparam_linesname_with_typerr   ro   rq   r{   r0   messagestarred_names                      rW   _read_parametersr      s    J *)aFXaY`aE: %* 1x [		*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+.) G"))44v% +D61\]G+,TFr$[(A "'61#)9,r'JJG!" &igFG 	,$gR\juvwc1xf z!!_  	!CKPQNCSSTU
 	. #H- "!
"
 ) 	G	G GsG   G##G3#H2H"H"G0/G03HHHH"H+	c               >    t        | fd|i|\  }}t        |      |fS NrO   )r   r   )rN   rO   rP   r1   rQ   s        rW   _read_parameters_sectionr     s-     .iRR'RJ
%j1:==rY   )r`   c               @    t        | f|dd|\  }}t        |      |fS )NF)rO   r`   )r   r   )rN   rO   r`   rP   r1   rQ   s         rW   _read_other_parameters_sectionr     s1     .im\amelmJ
*:6
BBrY   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)NrO   r   rd   rD   re   rf   r[   rG   rg   rh   zType parameter 'z' does not appear in the z
 signaturerj   rk   rl   rm   rn   )rX   rs   rt   r%   r\   rK   r]   rM   ru   r&   rx   type_parametersrq   ry   rz   r{   r   kindrp   rL   r"   r   )rN   rO   r`   rP   r   r^   rQ   r|   type_param_linesname_with_boundrr   ro   boundr{   type_paramsr   r   s                    rW   _read_type_parameters_sectionr     s    O *)NFNgNE:). 4
%%	+;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 .) G'..>>{* 06OPYP`P`PePePkPkOllvwG+,TFr$[(A "';6#)9,r'JJG!" &igFG 	" '		
[4
l */:JFFe  	?@PQR@S?TTUV
 	, #H- 
 ) 	G	G 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)Nrc   r   rd   rD   re   rf   r[   rG   z()ri   ro   rq   rr   )rX   rs   rt   r%   r\   rK   r]   rv   rw   r&   r   ry   rz   	TypeErrorrx   rq   rL   r   r   )rN   rO   r>   rP   r8   r^   rQ   rq   r|   
attr_linesr~   rr   ro   s                rW   _read_attributes_sectionr   [  s    J))aFXaY`aE:$(J#( i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i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
Nrc   r   rd   rD   z2Failed to get 'signature: description' pair from 'rf   r[   rg   r   )
rX   rs   rt   r%   r\   rK   r]   rL   r
   r   )rN   rO   r>   rP   r9   r^   rQ   	signaturer|   
func_linesname_with_signaturerr   ro   s                rW   _read_functions_sectionr     s'    I))aFXaY`aE:#'I#( f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+f. %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   )
rX   rs   rt   r%   r\   rK   r]   rL   r	   r   )rN   rO   r>   rP   r;   r^   rQ   r   r|   class_linesr   rr   ro   s                rW   _read_classes_sectionr     s%    G))aFXaY`aE:#'I$) a [		/:1~/C/CC/K, ii!3!3!5 HAB HIPPQUV%%&,,S!4Q7D+I&DI~4IS^_`+a. #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)	NrO   r   rd   rD   re   rf   r[   ro   rr   )
rX   rs   rt   r%   r\   rK   r]   rL   r!   r   )
rN   rO   rP   type_aliasesr^   rQ   r|   type_alias_linesro   rr   s
             rW   _read_type_aliases_sectionr     s     L))NFNgNE:). T%%	 0 3 9 9#q AD+ ii!3!3!5 M8H8L MNUUVZ[.DkRST '|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)	Nrc   r   rd   rD   re   rf   r[   r   )
rX   rs   rt   r%   r\   rK   r]   rL   r   r   )rN   rO   r>   rP   r<   r^   rQ   r|   module_linesro   rr   s              rW   _read_modules_sectionr     s     G))aFXaY`aE:%* L!\		 ,Q 5 5c1 =D+ ii!3!3!5 IQR8H IJQQRVWDkJKL #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)	Nrc   r   rd   rD   z2Failed to get 'exception: description' pair from 'rf   r[   rq   rr   )rX   rs   rt   r%   r\   rK   r]   r&   rL   r   r   )rN   rO   r>   rP   r3   r^   rQ   r|   exception_linesrq   rr   s              rW   _read_raises_sectionr     s     J))aFXaY`aE: ). Z$_		&5a&8&>&>sA&F#J ii!3!3!5 L8K LMTTUYZ/
IF
.JKXYZ" "*-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)	Nrc   r   rd   rD   z0Failed to get 'warning: description' pair from 'rf   r[   r   )
rX   rs   rt   r%   r\   rK   r]   rL   r#   r   )rN   rO   r>   rP   r=   r^   rQ   r|   warning_linesrq   rr   s              rW   _read_warns_sectionr   #  s     E))aFXaY`aE:&+ T"]		&3A&6&<&<S!&D#J ii!3!3!5 Jab8I JKRRSWX]jkRST !'33  	!F}UVGWFXXYZ
 	r   )multiplec               n    |rt        | fd|i|S t        | fd|i|\  }}||j                         fg|fS r   )rX   r_   
splitlines)rN   rO   r   rP   	one_blockrQ   s         rW   _read_block_items_mayber   ?  sQ      E6EWEE'	L&LGLIz--/01:==rY   )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 'rf   rd   rD   rg   rh   r[   )	r@   matchr%   rt   groupsrs   rK   r]   r\   )	rN   r|   rH   r   r>   r   ro   rq   rr   s	            rW    _get_name_annotation_descriptionr   L  s     /55eAh?!J5QR8*TUV
 (-%j+%(?&+AhnnS!&<#J#**3/66s;JJ(K))[//1>E!"I>?FFtLK[((rY   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   	Exceptionrx   rq   is_generatorsliceelementsis_iteratoris_tuple)rN   	gen_indexr   r   rq   s        rW   _annotation_from_parentr   k  s     J	)	 :%%00
""#))229=J##	Q#))J
++#))2259J: : s   BBB')returns_multiple_itemsreturns_named_valuera   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rO   r   r   rF   rD   r   r   r   z)No type or annotation for returned value rE   r   )r   	enumerater   rt   r&   r   rI   reprr%   rL   r   r   )rN   rO   r   r   ra   r>   rP   r4   r^   rQ   r   r|   return_linesro   rq   rr   returned_values                    rW   _read_returns_sectionr   ~  s    G/' 	E: /8.> i**\	,L)	-)D*k 3J	JJ 1aRUV[R\_`R`hmnJ.:3E/3d!)[<efteu:vwDJB:[fgh-i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   rD   r   z(No type or annotation for yielded value rE   r   )r   r   r   rt   r&   r   rI   r   r%   rL   r$   r    )rN   rO   r   r   ra   r>   rP   r5   r^   rQ   r   r|   yield_linesro   rq   rr   yielded_values                    rW   _read_yields_sectionr     s    F/' 	E: .7u-= g))[	,L)	-)D*k 3J	JJ 1aRUV[R\_`R`hmnJ.:3E.2T
	!)[<derds:tun$*"Ydef-g0 "&):55!  		r   )receives_multiple_itemsreceives_named_valuera   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   rD   r   z)No type or annotation for received value rE   r   )r   r   r   rt   r&   r   rI   r   r%   rL   r   r   )rN   rO   r   r   ra   r>   rP   r6   r^   rQ   r   r|   receive_linesro   rq   rr   received_values                    rW   _read_receives_sectionr     s    H/( 	E: 09/? k++]	,L*	-)D*k 3J	JJ 1aRUV[R\_`R`hmnJ*z/A+/T$ZUQYNi8abpaq6rs(djbZ]hij-k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 )NrO   Fr[   rE   ```z>>>T)r_   rs   rJ   rL   r'   r7   r\   rB   subrA   rM   textr]   r   )rN   rO   r   rP   r   rQ   sub_sectionsin_code_examplein_code_blockcurrent_textcurrent_examplerU   s               rW   _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:==rY   c                $    | j                          S )N)rv   )rU   s    rW   rJ   rJ   C  s    zz|rY   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`   ra   r>   N)__name__
__module____qualname____doc____annotations__ rY   rW   r   r   Y  s^    6JE  Mz&**[!!An3]N7rY   r   )total
r   r   r   r   r   r   r   r`   ra   r>   c       
        L   g }g }d}| j                   }|rt        dt        d       |||||||||	|
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 }t0        t        |j                               }# |#| fd|dz   i|\  }$}|$r||$_        |j                  |$       nt5        | |dz         \  }%}|%r|rEt+        |      r8|j                  t-        dj#                  |      j/                  d                   g }||}|j                         j7                  d
d      }|j                  t9        ||%|             nAt;        t<              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	   jB                  j                         jE                  d      }d|d	   v rj|d	   jE                  dd      \  }&}'|'g|dd }dj#                  |      |d	   _!        |j                  tG        tI        ddtK        |&|              g             |S # 1 sw Y   AxY w)!ae  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.
        **options: Swallowing keyword arguments for backward-compatibility.

    Returns:
        A list of docstring sections.
    FzDPassing additional options is deprecated, these options are ignored.rF   )
stacklevelr   r   N__init__r   rG   r   TtitletyperD   section
admonitionzMissing blank line above zExtraneous blank line below z titlez; z	Possible z skipped, reasons: r[   rO   )rO   -)r   r   r   propertyrd   rE   )rr   rq   )&rH   r   DeprecationWarningrx   ro   is_functionis_classrI   lowerrK   rM   rL   r?   r   	groupdict_section_kindrJ   r\   r%   r(   debuganyr   r]   _section_readerr   r_   replacer   r   
IndexErroris_attributelabelsrp   rs   r   r   r&   )(rN   r   r   r   r   r   r   r   r`   ra   r>   rP   sectionscurrent_sectionr   rH   ignore_summaryrO   
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   contentsrq   rU   s(                                           rW   parse_googler  r  s   ^ (*HOMOOE SUgtuv  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   0VV#)
rN   r-   rO   intr>   r   rP   r*   return_ItemsBlock)rN   r-   rO   r  rP   r*   r  ztuple[str, int])rN   r-   rO   r  r`   r   ra   r   r>   r   rP   r*   r  z$tuple[list[DocstringParameter], int])rN   r-   rO   r  rP   r*   r  z-tuple[DocstringSectionParameters | None, int])
rN   r-   rO   r  r`   r   rP   r*   r  z2tuple[DocstringSectionOtherParameters | None, int])
rN   r-   rO   r  r`   r   rP   r*   r  z1tuple[DocstringSectionTypeParameters | None, int])
rN   r-   rO   r  r>   r   rP   r*   r  z-tuple[DocstringSectionAttributes | None, int])
rN   r-   rO   r  r>   r   rP   r*   r  z,tuple[DocstringSectionFunctions | None, int])
rN   r-   rO   r  r>   r   rP   r*   r  z*tuple[DocstringSectionClasses | None, int])rN   r-   rO   r  rP   r*   r  z.tuple[DocstringSectionTypeAliases | None, int])
rN   r-   rO   r  r>   r   rP   r*   r  z*tuple[DocstringSectionModules | None, int])
rN   r-   rO   r  r>   r   rP   r*   r  z)tuple[DocstringSectionRaises | None, int])
rN   r-   rO   r  r>   r   rP   r*   r  z(tuple[DocstringSectionWarns | None, int])
rN   r-   rO   r  r   r   rP   r*   r  r  )rN   r-   r|   r  rH   z	list[str]r   r   r>   r   r  ztuple[str | None, Any, str])
rN   r-   r   zLiteral[0, 1, 2]r   r   r   r  r  zstr | Expr | None)rN   r-   rO   r  r   r   r   r   ra   r   r>   r   rP   r*   r  z*tuple[DocstringSectionReturns | None, int])rN   r-   rO   r  r   r   r   r   ra   r   r>   r   rP   r*   r  z)tuple[DocstringSectionYields | None, int])rN   r-   rO   r  r   r   r   r   ra   r   r>   r   rP   r*   r  z+tuple[DocstringSectionReceives | None, int])
rN   r-   rO   r  r   r   rP   r*   r  z+tuple[DocstringSectionExamples | None, int])rU   strr  r   )rN   r-   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   r   ra   r   r>   r   rP   r*   r  zlist[DocstringSection])j
__future__r   re
contextlibr   typingr   r   r>   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-   r1   other_parametersr   r2   r4   r5   r6   r7   r8   r9   r;   r   r<   r=   r   tupler  listr  
_BlockItem_BlockItemsr  compile
IGNORECASEr?   r   r@   rA   rB   rX   r_   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rJ   r  r   r  r   rY   rW   <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$(!% $#ww w 	w
 !w w '+w "w w w w w w wrY   