
    -hI4                       d dl mZ d dlmZ d dlmZ er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#          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 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'dBS )C    )annotations)TYPE_CHECKING)DocstringSectionKind)AnyLiteral)Exprc                  (    e Zd ZdZdddd
ZddZdS )DocstringElementz8This base class represents annotated, nameless elements.N
annotationdescriptionstrr   str | Expr | NonereturnNonec               $    || _         	 || _        dS )zInitialize the element.

        Parameters:
            annotation: The element annotation, if any.
            description: The element description.
        Nr   r   )selfr   r   s      V/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/_griffe/docstrings/models.py__init__zDocstringElement.__init__   s     !,&-7%%    kwargsr   dict[str, Any]c                     | j         | j        dS )Return this element's data as a dictionary.

        Parameters:
            **kwargs: Additional serialization options.

        Returns:
            A dictionary.
        r   r   r   )r   r   s     r   as_dictzDocstringElement.as_dict   s     /+
 
 	
r   )r   r   r   r   r   r   r   r   r   r   )__name__
__module____qualname____doc__r   r    r   r   r
   r
      sO        BBLP 
& 
& 
& 
& 
& 
&
 
 
 
 
 
r   r
   c                  8     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   valuenamer   r   r   r   r&   
str | Noner   r   c               l    t                                          ||           || _        	 || _        dS )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   r'   r&   )r   r'   r   r   r&   	__class__s        r   r   zDocstringNamedElement.__init__1   s9      	[ZHHH	!&
''r   r   r   r   c                n    d| j         i t                      j        di |}| j        
| j        |d<   |S )r   r'   Nr&   r#   )r'   r*   r   r&   )r   r   baser+   s      r   r   zDocstringNamedElement.as_dictG   sD     	?_UWW_%>%>v%>%>?:! JD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%   .   ss        ?? )- ( ( ( ( ( ( ( (,         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dS )DocstringAdmonitionz$This class represents an admonition.r   r   c                    | j         S )zThe kind of this admonition.r   r   s    r   kindzDocstringAdmonition.kindY        r   r&   
str | Exprr   c                    || _         d S Nr   r   r&   s     r   r4   zDocstringAdmonition.kind^       r   r   c                    | j         S )z The contents of this admonition.r   r3   s    r   contentszDocstringAdmonition.contentsb   s     r   c                    || _         d S r8   r<   r9   s     r   r=   zDocstringAdmonition.contentsg   s     r   Nr   r   )r&   r6   r   r   r   r   r&   r   r   r   )r   r    r!   r"   propertyr4   setterr=   r#   r   r   r1   r1   V   s        ..   X 
[      [        X  _! ! ! _! ! !r   r1   c                  L    e Zd ZdZed	d            Zej        d
d            ZdS )DocstringDeprecatedz3This class represents a documented deprecated item.r   r   c                    | j         S )z The version of this deprecation.r   r3   s    r   versionzDocstringDeprecated.versiono   r5   r   r&   r   c                    || _         d S r8   r   r9   s     r   rG   zDocstringDeprecated.versiont   r:   r   Nr@   rA   )r   r    r!   r"   rB   rG   rC   r#   r   r   rE   rE   l   sZ        ==   X ^      ^     r   rE   c                      e Zd ZdZdS )DocstringRaisez/This class represents a documented raise value.Nr   r    r!   r"   r#   r   r   rJ   rJ   y           9999r   rJ   c                      e Zd ZdZdS )DocstringWarnz.This class represents a documented warn value.NrK   r#   r   r   rN   rN   }   s        8888r   rN   c                      e Zd ZdZdS )DocstringReturnz0This class represents a documented return value.NrK   r#   r   r   rP   rP      s        ::::r   rP   c                      e Zd ZdZdS )DocstringYieldz/This class represents a documented yield value.NrK   r#   r   r   rR   rR      rL   r   rR   c                      e Zd ZdZdS )DocstringReceivez1This class represents a documented receive value.NrK   r#   r   r   rT   rT      s        ;;;;r   rT   c                  L    e Zd ZdZed
d            Zej        dd            Zd	S )DocstringParameterz5This class represent a documented function parameter.r   r(   c                    | j         S )z$The default value of this parameter.r&   r3   s    r   defaultzDocstringParameter.default   s     zr   r&   r   r   c                    || _         d S r8   rX   r9   s     r   rY   zDocstringParameter.default   s    


r   N)r   r(   rA   )r   r    r!   r"   rB   rY   rC   r#   r   r   rV   rV      sZ        ??   X ^   ^  r   rV   c                      e Zd ZdZdS )DocstringAttributez:This class represents a documented module/class attribute.NrK   r#   r   r   r\   r\      s        DDDDr   r\   c                  *    e Zd ZdZedd            ZdS )DocstringFunctionz,This class represents a documented function.r   r   c                    | j         S )zThe function signature.r   r3   s    r   	signaturezDocstringFunction.signature   r5   r   Nr?   r   r    r!   r"   rB   r`   r#   r   r   r^   r^      s8        66   X  r   r^   c                  *    e Zd ZdZedd            ZdS )DocstringClassz)This class represents a documented class.r   r   c                    | j         S )zThe class signature.r   r3   s    r   r`   zDocstringClass.signature   r5   r   Nr?   ra   r#   r   r   rc   rc      s8        33   X  r   rc   c                      e Zd ZdZdS )DocstringModulez*This class represents a documented module.NrK   r#   r   r   rf   rf      s        4444r   rf   c                  :    e Zd ZU dZded<   	 ddd	ZddZddZdS )DocstringSectionz*This class represents a docstring section.r   r4   Ntitler(   r   r   c                $    || _         	 d| _        dS )z[Initialize the section.

        Parameters:
            title: An optional title.
        N)ri   r&   )r   ri   s     r   r   zDocstringSection.__init__   s     "'
 
  r   boolc                *    t          | j                  S )z*Whether this section has a true-ish value.)rk   r&   r3   s    r   __bool__zDocstringSection.__bool__   s    DJr   r   r   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&   ri   r#   )hasattrr&   r   r4   ri   )r   r   serialized_valuer-   s       r   r   zDocstringSection.as_dict   sj     4:y)) 	*1tz1;;F;;#z	2BCC: 	' JDMr   r8   )ri   r(   r   r   )r   rk   r   )r   r    r!   r"   __annotations__r   rm   r   r#   r   r   rh   rh      sl         44	! 	! 	! 	! 	!            r   rh   c                  @     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   Nr&   r   ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section text.
            title: An optional title.
        Nr*   r   r&   r   r&   ri   r+   s      r   r   zDocstringSectionText.__init__   s(     	


r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   textr4   rq   r   r.   r/   s   @r   rs   rs      s^         //!5!:D::::                     r   rs   c                  @     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   Nr&   list[DocstringParameter]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section parameters.
            title: An optional title.
        Nru   rv   s      r   r   z#DocstringSectionParameters.__init__   (     	/4


r   r8   )r&   rz   ri   r(   r   r   )
r   r    r!   r"   r   
parametersr4   rq   r   r.   r/   s   @r   ry   ry      s^         55!5!@D@@@@5 5 5 5 5 5 5 5 5 5 5r   ry   c                  ,    e Zd ZU dZej        Zded<   dS )DocstringSectionOtherParametersz2This class represents an other parameters section.r   r4   N)r   r    r!   r"   r   other_parametersr4   rq   r#   r   r   r   r      s,         <<!5!FDFFFFFFr   r   c                  @     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   Nr&   list[DocstringRaise]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section exceptions.
            title: An optional title.
        Nru   rv   s      r   r   zDocstringSectionRaises.__init__  (     	+0


r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   raisesr4   rq   r   r.   r/   s   @r   r   r     ^         11!5!<D<<<<1 1 1 1 1 1 1 1 1 1 1r   r   c                  @     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   Nr&   list[DocstringWarn]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section warnings.
            title: An optional title.
        Nru   rv   s      r   r   zDocstringSectionWarns.__init__  s(     	*/


r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   warnsr4   rq   r   r.   r/   s   @r   r   r     s^         00!5!;D;;;;0 0 0 0 0 0 0 0 0 0 0r   r   c                  @     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   Nr&   list[DocstringReturn]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section returned items.
            title: An optional title.
        Nru   rv   s      r   r   z DocstringSectionReturns.__init__(  (     	,1


r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   returnsr4   rq   r   r.   r/   s   @r   r   r   #  ^         22!5!=D====2 2 2 2 2 2 2 2 2 2 2r   r   c                  @     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   Nr&   list[DocstringYield]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section yielded items.
            title: An optional title.
        Nru   rv   s      r   r   zDocstringSectionYields.__init__8  r   r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   yieldsr4   rq   r   r.   r/   s   @r   r   r   3  r   r   r   c                  @     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   Nr&   list[DocstringReceive]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section received items.
            title: An optional title.
        Nru   rv   s      r   r   z!DocstringSectionReceives.__init__H  s(     	-2


r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   receivesr4   rq   r   r.   r/   s   @r   r   r   C  s^         33!5!>D>>>>3 3 3 3 3 3 3 3 3 3 3r   r   c                  B     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   Nr&   Slist[tuple[Literal[DocstringSectionKind.text, DocstringSectionKind.examples], str]]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section examples.
            title: An optional title.
        Nru   rv   s      r   r   z!DocstringSectionExamples.__init__X  s(     	jo


r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   examplesr4   rq   r   r.   r/   s   @r   r   r   S  sn         44!5!>D>>>>
 !p p p p p p p p p p pr   r   c                  @     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   Nr&   list[DocstringAttribute]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section attributes.
            title: An optional title.
        Nru   rv   s      r   r   z#DocstringSectionAttributes.__init__l  r|   r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   
attributesr4   rq   r   r.   r/   s   @r   r   r   g  s^         66!5!@D@@@@5 5 5 5 5 5 5 5 5 5 5r   r   c                  @     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   Nr&   list[DocstringFunction]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section functions.
            title: An optional title.
        Nru   rv   s      r   r   z"DocstringSectionFunctions.__init__|  s(     	.3


r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   	functionsr4   rq   r   r.   r/   s   @r   r   r   w  s^         <<!5!?D????4 4 4 4 4 4 4 4 4 4 4r   r   c                  @     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   Nr&   list[DocstringClass]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section classes.
            title: An optional title.
        Nru   rv   s      r   r   z DocstringSectionClasses.__init__  r   r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   classesr4   rq   r   r.   r/   s   @r   r   r     s^         22!5!=D====1 1 1 1 1 1 1 1 1 1 1r   r   c                  @     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   Nr&   list[DocstringModule]ri   r(   r   r   c                X    t                                          |           || _        dS )zInitialize the section.

        Parameters:
            value: The section modules.
            title: An optional title.
        Nru   rv   s      r   r   z DocstringSectionModules.__init__  r   r   r8   )r&   r   ri   r(   r   r   )
r   r    r!   r"   r   modulesr4   rq   r   r.   r/   s   @r   r   r     r   r   r   c                  @     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   NrG   r   rw   ri   r(   r   r   c                v    t                                          |           t          ||          | _        dS )zInitialize the section.

        Parameters:
            version: The deprecation version.
            text: The deprecation text.
            title: An optional title.
        r   N)r*   r   rE   r&   )r   rG   rw   ri   r+   s       r   r   z#DocstringSectionDeprecated.__init__  s6     	*=^b*c*c*c


r   r8   )rG   r   rw   r   ri   r(   r   r   )
r   r    r!   r"   r   
deprecatedr4   rq   r   r.   r/   s   @r   r   r     si         55!5!@D@@@@	d 	d 	d 	d 	d 	d 	d 	d 	d 	d 	dr   r   c                  @     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   Nr   rw   ri   r(   r   r   c                v    t                                          |           t          ||          | _        dS )zInitialize the section.

        Parameters:
            kind: The admonition kind.
            text: The admonition text.
            title: An optional title.
        r   N)r*   r   r1   r&   )r   r4   rw   ri   r+   s       r   r   z#DocstringSectionAdmonition.__init__  s6     	*=[_*`*`*`


r   r8   )r4   r   rw   r   ri   r(   r   r   )
r   r    r!   r"   r   
admonitionr4   rq   r   r.   r/   s   @r   r   r     si         66!5!@D@@@@	a 	a 	a 	a 	a 	a 	a 	a 	a 	a 	ar   r   N)(
__future__r   typingr   _griffe.enumerationsr   r   r   _griffe.expressionsr   r
   r%   r1   rE   rJ   rN   rP   rR   rT   rV   r\   r^   rc   rf   rh   rs   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   r#   r   r   <module>r      s   # " " " " "             5 5 5 5 5 5 )########((((((
 
 
 
 
 
 
 
<% % % % %, % % %P! ! ! ! !* ! ! !,
  
  
  
  
 * 
  
  
 : : : : :% : : :9 9 9 9 9$ 9 9 9; ; ; ; ;+ ; ; ;: : : : :* : : :< < < < <, < < <
 
 
 
 
. 
 
 
E E E E E. E E E    -       *   5 5 5 5 5+ 5 5 5
% % % % % % % %P         +       5 5 5 5 5!1 5 5 5 G G G G G&@ G G G1 1 1 1 1- 1 1 1 0 0 0 0 0, 0 0 0 2 2 2 2 2. 2 2 2 1 1 1 1 1- 1 1 1 3 3 3 3 3/ 3 3 3 p p p p p/ p p p(5 5 5 5 5!1 5 5 5 4 4 4 4 4 0 4 4 4 1 1 1 1 1. 1 1 1 2 2 2 2 2. 2 2 2 d d d d d!1 d d d"a a a a a!1 a a a a ar   