
    
`iz                        d Z ddlZddlZddlmZmZmZmZ ddl	m
Z
 ddlmZmZmZmZ ej        eej        eej        eej        eiZej        fdededefd	Zej        fd
ej        dedefdZej        ej        dfdededededef
dZdS )zThe main parsing routine.    N)epydocgooglenumpydocrest)add_attribute_docstrings)	DocstringDocstringStyle
ParseErrorRenderingStyletextstylereturnc                 d   |t           j        k    r t          |                             |           S d}g }t                                          D ]F}	 |                    |           }|                    |           .# t          $ r}|}Y d}~?d}~ww xY w|s|t          |d d          d         S )zParse the docstring into its components.

    :param text: docstring text to parse
    :param style: docstring style
    :returns: parsed docstring representation
    Nc                 *    t          | j                  S )N)lenmeta)ds    k/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/docstring_parser/parser.py<lambda>zparse.<locals>.<lambda>.   s    c!&kk     T)keyreverser   )r	   AUTO
_STYLE_MAPparsevaluesappendr
   sorted)r   r   excretsmoduleretexs          r   r   r      s     ###% &&t,,,!%CD##%%  	,,t$$C KK  	 	 	CCCCCC	
  	$114@@@CCs   A<<
BBBobjc                     t          | j        |          }t          j        |           st          j        |           rt          | |           |S )aQ  Parse the object's docstring(s) into its components.

    The object can be anything that has a ``__doc__`` attribute. In contrast to
    the ``parse`` function, ``parse_from_object`` is able to parse attribute
    docstrings which are defined in the source code instead of ``__doc__``.

    Currently only attribute docstrings defined at class and module levels are
    supported. Attribute docstrings defined in ``__init__`` methods are not
    supported.

    When given a class, only the attribute docstrings of that class are parsed,
    not its inherited classes. This is a design decision. Separate calls to
    this function should be performed to get attribute docstrings of parent
    classes.

    :param obj: object from which to parse the docstring(s)
    :param style: docstring style
    :returns: parsed docstring representation
    )r   )r   __doc__inspectisclassismoduler   )r$   r   	docstrings      r   parse_from_objectr+   1   sR    . ck///Is 1w/44 1 i000r   z    r*   rendering_styleindentc                 z    t           |t          j        k    r| j        n|         }|                    | ||          S )a  Render a parsed docstring into docstring text.

    :param docstring: parsed docstring representation
    :param style: docstring style to render
    :param indent: the characters used as indentation in the docstring string
    :returns: docstring text
    )r,   r-   )r   r	   r   r   compose)r*   r   r,   r-   r!   s        r   r/   r/   P   sH      N$777	UF >>?6    r   )r&   r'   typingTdocstring_parserr   r   r   r   docstring_parser.attrdocr   docstring_parser.commonr   r	   r
   r   RESTGOOGLENUMPYDOCEPYDOCr   r   strr   Anyr+   COMPACTr/    r   r   <module>r=      s          ; ; ; ; ; ; ; ; ; ; ; ; = = = = = =            6X6	
 .<-@ D D DN DY D D D D8 +/ 	
    B +/&4&<	  $ 	
 	     r   