o
    ¹i;  ã                   @   s"   d Z ddlZddlZddd„ZdS )zText related utils.é    Né   Fc                 C   sp   | du rdS d| d|  }|rt  dt j¡nt  dt j¡}t  ||| ¡}| tj| ¡r6|dt|ƒ … S |S )aš  Indent a string a given number of spaces or tabstops.

    indent(str,nspaces=4,ntabs=0) -> indent str by ntabs+nspaces.

    Parameters
    ----------

    instr : basestring
        The string to be indented.
    nspaces : int (default: 4)
        The number of spaces to be indented.
    ntabs : int (default: 0)
        The number of tabs to be indented.
    flatten : bool (default: False)
        Whether to scrub existing indentation.  If True, all lines will be
        aligned to the same indentation.  If False, existing indentation will
        be strictly increased.

    Returns
    -------

    str|unicode : string indented by ntabs and nspaces.

    Nú	ú z^\s*ú^)ÚreÚcompileÚ	MULTILINEÚsubÚendswithÚosÚlinesepÚlen)ÚinstrÚnspacesÚntabsÚflattenÚindÚpatÚoutstr© r   úO/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/nbconvert/utils/text.pyÚindent   s    r   )r   r   F)Ú__doc__r   r   r   r   r   r   r   Ú<module>   s    