
    Ji=                    H   d dl mZ d dlmZ d dlmZ d dlmZ erd dlm	Z	 d dlm
Z
mZ d dlmZ  G d d	      Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d  d!e      Z G d" d#e      Z G d$ d%e      Z G d& d'e      Z G d( d)      Z G d* d+e      Z G d, d-e      Z G d. d/e      Z  G d0 d1e      Z! G d2 d3e      Z" G d4 d5e      Z# G d6 d7e      Z$ G d8 d9e      Z% G d: d;e      Z& G d< d=e      Z' G d> d?e      Z( G d@ dAe      Z) G dB dCe      Z* G dD dEe      Z+ G dF dGe      Z, G dH dIe      Z- G dJ dKe      Z.yL)M    )annotations)TYPE_CHECKING)DocstringSectionKind)	ExprTuple)Sequence)AnyLiteral)Exprc                  &    e Zd ZdZddddZddZy)DocstringElementz8This base class represents annotated, nameless elements.N
annotationc               "    || _         	 || _        y)zInitialize the element.

        Parameters:
            annotation: The element annotation, if any.
            description: The element description.
        Ndescriptionr   )selfr   r   s      t/var/www/html/BankruptcyAI-uat/bankruptcy-ai/venv/lib/python3.12/site-packages/griffe/_internal/docstrings/models.py__init__zDocstringElement.__init__   s     !,&-7%    c                4    | j                   | j                  dS )Return this element's data as a dictionary.

        Parameters:
            **kwargs: Additional serialization options.

        Returns:
            A dictionary.
        r   r   r   )r   kwargss     r   as_dictzDocstringElement.as_dict!   s     //++
 	
r   )r   strr   str | Expr | NonereturnNoner   r   r   zdict[str, Any])__name__
__module____qualname____doc__r   r    r   r   r   r      s    BLP 
&
r   r   c                  J     e Zd ZdZddd	 	 	 	 	 	 	 	 	 d fdZd fdZ xZS )DocstringNamedElementz5This base class represents annotated, named elements.N)r   valuec               F    t         |   ||       || _        	 || _        y)zInitialize the element.

        Parameters:
            name: The element name.
            description: The element description.
            annotation: The element annotation, if any.
            value: The element value, as a string.
        r   N)superr   namer'   )r   r*   r   r   r'   	__class__s        r   r   zDocstringNamedElement.__init__3   s+      	[ZH	(-
'r   c                x    d| j                   it        |   di |}| j                  | j                  |d<   |S )r   r*   r'   r$   )r*   r)   r   r'   )r   r   baser+   s      r   r   zDocstringNamedElement.as_dictI   s@     		?UW_%>v%>?::! JJDMr   )
r*   r   r   r   r   r   r'   r   r   r   r   )r    r!   r"   r#   r   r   __classcell__r+   s   @r   r&   r&   0   sM    ? )-#'(( 	(
 &( !( 
(, r   r&   c                      e Zd ZdZedd       Zej                  dd       Zed	d       Zej                  d
d       Zy)DocstringAdmonitionz$This class represents an admonition.c                    | j                   S )zThe kind of this admonition.r   r   s    r   kindzDocstringAdmonition.kind[        r   c                    || _         y Nr   r   r'   s     r   r4   zDocstringAdmonition.kind`   	    r   c                    | j                   S )z The contents of this admonition.r   r3   s    r   contentszDocstringAdmonition.contentsd   s     r   c                    || _         y r7   r;   r8   s     r   r<   zDocstringAdmonition.contentsi   s
     r   Nr   r   )r'   z
str | Exprr   r   r   r   r'   r   r   r   )r    r!   r"   r#   propertyr4   setterr<   r$   r   r   r1   r1   X   s[    .  
[[        __! !r   r1   c                  H    e Zd ZdZedd       Zej                  dd       Zy)DocstringDeprecatedz3This class represents a documented deprecated item.c                    | j                   S )z The version of this deprecation.r   r3   s    r   versionzDocstringDeprecated.versionq   r5   r   c                    || _         y r7   r   r8   s     r   rF   zDocstringDeprecated.versionv   r9   r   Nr?   r@   )r    r!   r"   r#   rA   rF   rB   r$   r   r   rD   rD   n   s/    =  ^^   r   rD   c                      e Zd ZdZy)DocstringRaisez/This class represents a documented raise value.Nr    r!   r"   r#   r$   r   r   rI   rI   {       9r   rI   c                      e Zd ZdZy)DocstringWarnz.This class represents a documented warn value.NrJ   r$   r   r   rM   rM          8r   rM   c                      e Zd ZdZy)DocstringReturnz0This class represents a documented return value.NrJ   r$   r   r   rP   rP      s    :r   rP   c                      e Zd ZdZy)DocstringYieldz/This class represents a documented yield value.NrJ   r$   r   r   rR   rR      rK   r   rR   c                      e Zd ZdZy)DocstringReceivez1This class represents a documented receive value.NrJ   r$   r   r   rT   rT      s    ;r   rT   c                  H    e Zd ZdZedd       Zej                  dd       Zy)DocstringParameterz5This class represent a documented function parameter.c                    | j                   S )z$The default value of this parameter.r'   r3   s    r   defaultzDocstringParameter.default        zzr   c                    || _         y r7   rX   r8   s     r   rY   zDocstringParameter.default   	    
r   Nr>   r@   )r    r!   r"   r#   rA   rY   rB   r$   r   r   rV   rV      s/    ?  ^^ r   rV   c                      e Zd ZdZed	d       Zej                  d
d       Zed	d       Zej                  dd       Zedd       Zej                  dd       Zy)DocstringTypeParameterz1This class represent a documented type parameter.c                    | j                   S )z)The default value of this type parameter.rX   r3   s    r   rY   zDocstringTypeParameter.default   rZ   r   c                    || _         y r7   rX   r8   s     r   rY   zDocstringTypeParameter.default   r\   r   c                P    t        | j                  t              s| j                  S y)z!The bound of this type parameter.N)
isinstancer   r   r3   s    r   boundzDocstringTypeParameter.bound   s     $//95??"r   c                    || _         y r7   r   )r   rc   s     r   rc   zDocstringTypeParameter.bound   r9   r   c                v    t        | j                  t              rt        | j                  j                        S y)z'The constraints of this type parameter.N)rb   r   r   tupleelementsr3   s    r   constraintsz"DocstringTypeParameter.constraints   s*     dooy11122r   c                8    |t        |      | _        y d | _        y r7   )r   r   )r   rh   s     r   rh   z"DocstringTypeParameter.constraints   s    "'4DO"DOr   Nr>   r@   )rc   r   r   r   )r   ztuple[str | Expr, ...] | None)rh   zSequence[str | Expr] | Noner   r   )	r    r!   r"   r#   rA   rY   rB   rc   rh   r$   r   r   r^   r^      s    ;  ^^    \\      # #r   r^   c                      e Zd ZdZy)DocstringAttributez:This class represents a documented module/class attribute.NrJ   r$   r   r   rk   rk      s    Dr   rk   c                  "    e Zd ZdZedd       Zy)DocstringFunctionz,This class represents a documented function.c                    | j                   S )zThe function signature.r   r3   s    r   	signaturezDocstringFunction.signature   r5   r   Nr>   r    r!   r"   r#   rA   ro   r$   r   r   rm   rm      s    6 r   rm   c                  "    e Zd ZdZedd       Zy)DocstringClassz)This class represents a documented class.c                    | j                   S )zThe class signature.r   r3   s    r   ro   zDocstringClass.signature   r5   r   Nr>   rp   r$   r   r   rr   rr      s    3 r   rr   c                      e Zd ZdZy)DocstringTypeAliasz.This class represents a documented type alias.NrJ   r$   r   r   ru   ru      rN   r   ru   c                      e Zd ZdZy)DocstringModulez*This class represents a documented module.NrJ   r$   r   r   rw   rw      s    4r   rw   c                  8    e Zd ZU dZded<   	 dd	dZd
dZddZy)DocstringSectionz*This class represents a docstring section.r   r4   Nc                "    || _         	 d| _        y)z[Initialize the section.

        Parameters:
            title: An optional title.
        N)titler'   )r   r{   s     r   r   zDocstringSection.__init__   s     "'
 
 r   c                ,    t        | j                        S )z*Whether this section has a true-ish value.)boolr'   r3   s    r   __bool__zDocstringSection.__bool__   s    DJJr   c                    t        | j                  d      r | j                  j                  di |}n| j                  }| j                  j                  |d}| j                  r| j                  |d<   |S )zReturn this section's data as a dictionary.

        Parameters:
            **kwargs: Additional serialization options.

        Returns:
            A dictionary.
        r   )r4   r'   r{   r$   )hasattrr'   r   r4   r{   )r   r   serialized_valuer-   s       r   r   zDocstringSection.as_dict   sb     4::y)1tzz11;F;#zz		2BC:: JJDMr   r7   )r{   
str | Noner   r   )r   r}   r   )r    r!   r"   r#   __annotations__r   r~   r   r$   r   r   ry   ry      s    4
	! r   ry   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionTextz%This class represents a text section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section text.
            title: An optional title.
        Nr)   r   r'   r   r'   r{   r+   s      r   r   zDocstringSectionText.__init__  s     	
r   r7   )r'   r   r{   r   r   r   )
r    r!   r"   r#   r   textr4   r   r   r.   r/   s   @r   r   r   	  s!    /!5!:!:D
:   r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionParametersz+This class represents a parameters section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section parameters.
            title: An optional title.
        Nr   r   s      r   r   z#DocstringSectionParameters.__init__       	/4
r   r7   )r'   zlist[DocstringParameter]r{   r   r   r   )
r    r!   r"   r#   r   
parametersr4   r   r   r.   r/   s   @r   r   r     s!    5!5!@!@D
@5 5r   r   c                  4    e Zd ZU dZej
                  Zded<   y)DocstringSectionOtherParametersz2This class represents an other parameters section.r   r4   N)r    r!   r"   r#   r   other_parametersr4   r   r$   r   r   r   r   )  s    <!5!F!FD
Fr   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionTypeParametersz0This class represents a type parameters section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section type parameters.
            title: An optional title.
        Nr   r   s      r   r   z'DocstringSectionTypeParameters.__init__4  s     	38
r   r7   )r'   zlist[DocstringTypeParameter]r{   r   r   r   )
r    r!   r"   r#   r   type_parametersr4   r   r   r.   r/   s   @r   r   r   /  s!    :!5!E!ED
E9 9r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionRaisesz'This class represents a raises section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section exceptions.
            title: An optional title.
        Nr   r   s      r   r   zDocstringSectionRaises.__init__D       	+0
r   r7   )r'   zlist[DocstringRaise]r{   r   r   r   )
r    r!   r"   r#   r   raisesr4   r   r   r.   r/   s   @r   r   r   ?  !    1!5!<!<D
<1 1r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionWarnsz&This class represents a warns section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section warnings.
            title: An optional title.
        Nr   r   s      r   r   zDocstringSectionWarns.__init__T  s     	*/
r   r7   )r'   zlist[DocstringWarn]r{   r   r   r   )
r    r!   r"   r#   r   warnsr4   r   r   r.   r/   s   @r   r   r   O  s!    0!5!;!;D
;0 0r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionReturnsz(This class represents a returns section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section returned items.
            title: An optional title.
        Nr   r   s      r   r   z DocstringSectionReturns.__init__d       	,1
r   r7   )r'   zlist[DocstringReturn]r{   r   r   r   )
r    r!   r"   r#   r   returnsr4   r   r   r.   r/   s   @r   r   r   _  !    2!5!=!=D
=2 2r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionYieldsz'This class represents a yields section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section yielded items.
            title: An optional title.
        Nr   r   s      r   r   zDocstringSectionYields.__init__t  r   r   r7   )r'   zlist[DocstringYield]r{   r   r   r   )
r    r!   r"   r#   r   yieldsr4   r   r   r.   r/   s   @r   r   r   o  r   r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionReceivesz)This class represents a receives section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section received items.
            title: An optional title.
        Nr   r   s      r   r   z!DocstringSectionReceives.__init__  s     	-2
r   r7   )r'   zlist[DocstringReceive]r{   r   r   r   )
r    r!   r"   r#   r   receivesr4   r   r   r.   r/   s   @r   r   r     s!    3!5!>!>D
>3 3r   r   c                  V     e Zd ZU dZej
                  Zded<   	 d	 	 	 	 	 d fdZ xZ	S )DocstringSectionExamplesz*This class represents an examples section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section examples.
            title: An optional title.
        Nr   r   s      r   r   z!DocstringSectionExamples.__init__  s     	jo
r   r7   )r'   zSlist[tuple[Literal[DocstringSectionKind.text, DocstringSectionKind.examples], str]]r{   r   r   r   )
r    r!   r"   r#   r   examplesr4   r   r   r.   r/   s   @r   r   r     sG    4!5!>!>D
>
 !pbp p 
	p pr   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionAttributesz,This class represents an attributes section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section attributes.
            title: An optional title.
        Nr   r   s      r   r   z#DocstringSectionAttributes.__init__  r   r   r7   )r'   zlist[DocstringAttribute]r{   r   r   r   )
r    r!   r"   r#   r   
attributesr4   r   r   r.   r/   s   @r   r   r     s!    6!5!@!@D
@5 5r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionFunctionsz2This class represents a functions/methods section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section functions.
            title: An optional title.
        Nr   r   s      r   r   z"DocstringSectionFunctions.__init__  s     	.3
r   r7   )r'   zlist[DocstringFunction]r{   r   r   r   )
r    r!   r"   r#   r   	functionsr4   r   r   r.   r/   s   @r   r   r     s!    <!5!?!?D
?4 4r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionClassesz(This class represents a classes section.r   r4   c                2    t         |   |       || _        yzInitialize the section.

        Parameters:
            value: The section classes.
            title: An optional title.
        Nr   r   s      r   r   z DocstringSectionClasses.__init__  r   r   r7   )r'   zlist[DocstringClass]r{   r   r   r   )
r    r!   r"   r#   r   classesr4   r   r   r.   r/   s   @r   r   r     s!    2!5!=!=D
=1 1r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionTypeAliasesz-This class represents a type aliases section.r   r4   c                2    t         |   |       || _        yr   r   r   s      r   r   z$DocstringSectionTypeAliases.__init__  r   r   r7   )r'   zlist[DocstringTypeAlias]r{   r   r   r   )
r    r!   r"   r#   r   type_aliasesr4   r   r   r.   r/   s   @r   r   r     s!    7!5!B!BD
B5 5r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionModulesz(This class represents a modules section.r   r4   c                2    t         |   |       || _        y)zInitialize the section.

        Parameters:
            value: The section modules.
            title: An optional title.
        Nr   r   s      r   r   z DocstringSectionModules.__init__  r   r   r7   )r'   zlist[DocstringModule]r{   r   r   r   )
r    r!   r"   r#   r   modulesr4   r   r   r.   r/   s   @r   r   r     r   r   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionDeprecatedz+This class represents a deprecated section.r   r4   c                H    t         |   |       t        ||      | _        y)zInitialize the section.

        Parameters:
            version: The deprecation version.
            text: The deprecation text.
            title: An optional title.
        r   N)r)   r   rD   r'   )r   rF   r   r{   r+   s       r   r   z#DocstringSectionDeprecated.__init__  s!     	*=^b*c
r   r7   )rF   r   r   r   r{   r   r   r   )
r    r!   r"   r#   r   
deprecatedr4   r   r   r.   r/   s   @r   r   r     s#    5!5!@!@D
@	d 	dr   r   c                  J     e Zd ZU dZej
                  Zded<   dd fdZ xZ	S )DocstringSectionAdmonitionz,This class represents an admonition section.r   r4   c                H    t         |   |       t        ||      | _        y)zInitialize the section.

        Parameters:
            kind: The admonition kind.
            text: The admonition text.
            title: An optional title.
        r   N)r)   r   r1   r'   )r   r4   r   r{   r+   s       r   r   z#DocstringSectionAdmonition.__init__	  s!     	*=[_*`
r   r7   )r4   r   r   r   r{   r   r   r   )
r    r!   r"   r#   r   
admonitionr4   r   r   r.   r/   s   @r   r   r     s#    6!5!@!@D
@	a 	ar   r   N)/
__future__r   typingr   griffe._internal.enumerationsr   griffe._internal.expressionsr   collections.abcr   r   r	   r
   r   r&   r1   rD   rI   rM   rP   rR   rT   rV   r^   rk   rm   rr   ru   rw   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r$   r   r   <module>r      s   #   > 2(#1
 
<%, %P!* !,
 * 
 :% :9$ 9;+ ;:* :<, <
. 
##2 ##LE. E- * 9. 95+ 5
% %P +   5!1 5 G&@ G9%5 9 1- 1 0, 0 2. 2 1- 1 3/ 3 p/ p(5!1 5 4 0 4 1. 1 5"2 5 2. 2 d!1 d"a!1 ar   