§
    ŽŸjé
  ã                   ó>   — d Z ddlmZ ddlmZ  G d„ de¦  «        ZdS )zBase class for preprocessorsé    )ÚBool)ÚNbConvertBasec                   ór   ‡ — e Zd ZdZ ed¦  «                             d¬¦  «        Zˆ fd„Zd„ Zd„ Z	d„ Z
ˆ xZS )	ÚPreprocessora.  A configurable preprocessor

    Inherit from this class if you wish to have configurability for your
    preprocessor.

    Any configurable traitlets this class exposed will be configurable in
    profiles using c.SubClassName.attribute = value

    You can overwrite `preprocess_cell()` to apply a transformation
    independently on each cell or `preprocess()` if you prefer your own
    logic. See corresponding docstring for information.

    Disabled by default and can be enabled via the config by
        'c.YourPreprocessorName.enabled = True'
    FT)Úconfigc                 ó:   •—  t          ¦   «         j        di |¤Ž dS )zÕ
        Public constructor

        Parameters
        ----------
        config : Config
            Configuration file structure
        `**kw`
            Additional keyword arguments passed to parent
        N© )ÚsuperÚ__init__)ÚselfÚkwÚ	__class__s     €úi/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/nbconvert/preprocessors/base.pyr   zPreprocessor.__init__   s(   ø€ ð 	�‰ŒÔÐÐ˜2ÐÐÐÐÐó    c                 óŽ   — | j         r;| j                             d| j        j        ¦  «         |                      ||¦  «        S ||fS )zApply the preprocessor.zApplying preprocessor: %s)ÚenabledÚlogÚdebugr   Ú__name__Ú
preprocess)r   ÚnbÚ	resourcess      r   Ú__call__zPreprocessor.__call__,   sF   € àŒ<ð 	2ØŒH�NŠNÐ6¸¼Ô8OÑPÔPÐPØ—?’? 2 yÑ1Ô1Ð1Ø�9ˆ}Ðr   c                 ó‚   — t          |j        ¦  «        D ]'\  }}|                      |||¦  «        \  |j        |<   }Œ(||fS )aú  
        Preprocessing to apply on each notebook.

        Must return modified nb, resources.

        If you wish to apply your preprocessing to each cell, you might want
        to override preprocess_cell method instead.

        Parameters
        ----------
        nb : NotebookNode
            Notebook being converted
        resources : dictionary
            Additional resources used in the conversion process.  Allows
            preprocessors to pass variables into the Jinja engine.
        )Ú	enumerateÚcellsÚpreprocess_cell)r   r   r   ÚindexÚcells        r   r   zPreprocessor.preprocess3   sQ   € õ" % R¤XÑ.Ô.ð 	Vð 	V‰KˆE�4Ø)-×)=Ò)=¸dÀIÈuÑ)UÔ)UÑ&ˆBŒH�U‰O˜Y˜YØ�9ˆ}Ðr   c                 ó$   — d}t          |¦  «        ‚)aê  
        Override if you want to apply some preprocessing to each cell.
        Must return modified cell and resource dictionary.

        Parameters
        ----------
        cell : NotebookNode cell
            Notebook cell being processed
        resources : dictionary
            Additional resources used in the conversion process.  Allows
            preprocessors to pass variables into the Jinja engine.
        index : int
            Index of the cell being processed
        z!should be implemented by subclass)ÚNotImplementedError)r   r   r   r   Úmsgs        r   r   zPreprocessor.preprocess_cellH   s   € ð 2ˆÝ! #Ñ&Ô&Ð&r   )r   Ú
__module__Ú__qualname__Ú__doc__r   Útagr   r   r   r   r   Ú__classcell__)r   s   @r   r   r      sŒ   ø€ € € € € ðð ð  ˆd�5‰kŒk�oŠo TˆoÑ*Ô*€Gðð ð ð ð ðð ð ðð ð ð*'ð 'ð 'ð 'ð 'ð 'ð 'r   r   N)r%   Ú	traitletsr   Únbconvert.utils.baser   r   r	   r   r   ú<module>r*      so   ðØ "Ð "ð
 Ð Ð Ð Ð Ð à .Ð .Ð .Ð .Ð .Ð .ðM'ð M'ð M'ð M'ð M'�=ñ M'ô M'ð M'ð M'ð M'r   