
    -Ph                        d Z ddlmZ ddlZddlZddlmZ  ej        ej        d                   Z	dd
Z
dddZddZdS )z#Utilities for docstring processing.    )annotationsN)Bodyfield_markers
str | Nonereturn!tuple[str | None, dict[str, str]]c                   d}i }g }| s| |fS t          |           D ]}|                                sd}|                    |           /t                              |          }|r|s|                                dd                             dd          d         }|                    d          rN|dd                                         }||                                d                                         ||<   |                    |           d}|                    |           d		                    |          |fS )
z,Separate docstring into metadata and others.F   N:r   zmeta    T
)
prepare_docstringstripappendfield_list_item_rematchgroupsplit
startswithendjoin)r   in_other_elementmetadatalineslinematched
field_namenames           V/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx/util/docstrings.pyseparate_metadatar!      sR   !HE ({!!$$ # #zz|| 	#$LL(..t44G 	#/ 	#$]]__QRR066sA>>qA
((11 '%abb>//11D%)'++--//%:%@%@%B%BHTNNLL&&&&#' T""""99UX%%       strtabsizeint	list[str]c                ~   |                      |                                          }t          j        }|dd         D ]G}t	          |                                          }|r"t	          |          |z
  }t          ||          }Ht	          |          r|d                                         |d<   |t          j        k     r3t          dt	          |                    D ]}||         |d         ||<   |r'|d         s|                    d           |r|d         |r|d         r|	                    d           |S )aw  Convert a docstring into lines of parseable reST.  Remove common leading
    indentation, where the indentation of the first line is ignored.

    Return the docstring as a list of lines usable for inserting into a docutils
    ViewList (used as argument of nested_parse().)  An empty line is added to
    act as a separator between this docstring and following content.
    r   Nr    )

expandtabs
splitlinessysmaxsizelenlstripminrangepopr   )r   r%   r   marginr   contentindentis           r    r   r   *   sH    LL!!,,..E[Fabb	 ) )dkkmm$$ 	)YY(F((F
5zz %8??$$aq#e**%% 	) 	)AQx(E!HH
 a 		!  a   r RLr"   c                J   g }d |                                                                  D             }|D ]N}|                    d          r7|dd         }|r|d         dk    r
|dd         }|                    |           O|r|d         r|                    d	           |S )
zExtract documentation comment lines (starting with #:) and return them
    as a list of lines.  Returns an empty list if there is no documentation.
    c                6    g | ]}|                                 S  )r   ).0r   s     r    
<listcomp>z&prepare_commentdoc.<locals>.<listcomp>N   s     BBBdTZZ\\BBBr"   z#:   Nr    r   r)   r*   )r+   r,   r   r   )r   resultr   r   s       r    prepare_commentdocr@   I   s     FBBallnn&?&?&A&ABBBE    ??4   	 8D  Q3ABBxMM$ &* bMr"   )r   r   r   r	   )r#   )r   r$   r%   r&   r   r'   )r   r$   r   r'   )__doc__
__future__r   rer-   docutils.parsers.rst.statesr   compilepatternsr   r!   r   r@   r:   r"   r    <module>rG      s    ) ) " " " " " " 				 



 , , , , , ,RZn =>> & & & &:    >     r"   