o
    B©Zhs  ã                   @  s^   d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlm	Z	 dd
d„Zdddd„Z
dS )z*
Utilities imported from ipython_genutils
é    )ÚannotationsN)Údedent)Úindent)ÚListÚvalÚstrÚreturnc                 C  s
   t | dƒS )Nz    )Ú_indent)r   © r
   úK/var/www/html/lang_env/lib/python3.10/site-packages/traitlets/utils/text.pyr      s   
r   éP   ÚtextÚncolsÚintú	List[str]c                 C  sr   t  dt j¡}t| ƒ ¡ } | | ¡ddd… }g }t  dt j¡}|D ]}| |¡du r1t ||¡}| 	|¡ q"|S )a  Wrap multiple paragraphs to fit a specified width.

    This is equivalent to textwrap.wrap, but with support for multiple
    paragraphs, as separated by empty lines.

    Returns
    -------

    list of complete paragraphs, wrapped to fill `ncols` columns.
    z
\n(\s*\n)+Né   z\n\s+)
ÚreÚcompileÚ	MULTILINEr   ÚstripÚsplitÚsearchÚtextwrapÚfillÚappend)r   r   Zparagraph_reZ
paragraphsZout_psZ	indent_reÚpr
   r
   r   Úwrap_paragraphs   s   r   )r   r   r   r   )r   )r   r   r   r   r   r   )Ú__doc__Ú
__future__r   r   r   r   r   r	   Útypingr   r   r
   r
   r
   r   Ú<module>   s    
