§
    �Ÿj
  ã                  óF   — d Z ddlmZ ddlmZmZ d„ Zdd„Zd„ Zd	„ Z	d
„ Z
dS )z8Code for converting notebooks to and from the v2 format.é    )Úannotationsé   )ÚnbformatÚnbformat_minorc                óX  — t          | t          ¦  «        r-|                      ¦   «         D ]\  }}t          |¦  «        | |<   Œngt          | t          ¦  «        r(t          | ¦  «        D ]\  }}t          |¦  «        | |<   Œn*t          | t          ¦  «        r|                      d¦  «        } | S )z^There should be no bytes objects in a notebook

    v2 stores png/jpeg as b64 ascii bytes
    Úascii)Ú
isinstanceÚdictÚitemsÚ_unbytesÚlistÚ	enumerateÚbytesÚdecode)ÚobjÚkÚvÚis       ú`/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/nbformat/v3/convert.pyr   r   
   s°   € õ
 �#•tÑÔð "Ø—I’I‘K”Kð 	!ð 	!‰DˆAˆqÝ˜a‘[”[ˆC�‰FˆFð	!å	�C�Ñ	Ô	ð "Ý˜c‘N”Nð 	!ð 	!‰DˆAˆqÝ˜a‘[”[ˆC�‰FˆFð	!å	�C�Ñ	Ô	ð "à�jŠj˜Ñ!Ô!ˆØ€Jó    é   c                ó:  — |dk    r\t           | _         t          | _        d| _        t          | ¦  «        } | d         D ]#}|d         D ]}|                     di ¦  «         ŒŒ$| S |dk    r |t          k    r|| _        t          | _        | S d|z  }t          |¦  «        ‚)aP  Convert a notebook to v3.

    Parameters
    ----------
    nb : NotebookNode
        The Python representation of the notebook to convert.
    from_version : int
        The original version of the notebook to convert.
    from_minor : int
        The original minor version of the notebook to convert (only relevant for v >= 3).
    r   Ú
worksheetsÚcellsÚmetadataé   zZCannot convert a notebook directly from v%s to v3.  Try using the nbformat.convert module.)r   r   Úorig_nbformatr   Ú
setdefaultÚorig_nbformat_minorÚ
ValueError)ÚnbÚfrom_versionÚ
from_minorÚwsÚcellÚmsgs         r   Úupgrader'      sÅ   € ð �qÒÐåˆŒÝ*ˆÔàˆÔÝ�b‰\Œ\ˆØ�\Ô"ð 	0ð 	0ˆBØ˜7œð 0ð 0�Ø—’ 
¨BÑ/Ô/Ð/Ð/ð0àˆ	Ø�qÒÐØ�Ò'Ð'Ø%/ˆBÔ"Ý*ˆÔØˆ	ð	1Ø3?ñ	@ð õ �S‰/Œ/Ðr   c                ój   — d| _         |                      dd¦  «        }d|z  dz   | j        z   | _        dS )z-turn heading cell into corresponding markdownÚmarkdownÚlevelr   ú#ú N)Ú	cell_typeÚpopÚsource)r%   r*   s     r   Úheading_to_mdr0   >   s7   € à€D„NØ�HŠH�W˜aÑ Ô €EØ˜‘+ Ñ# d¤kÑ1€D„K€K€Kr   c                ó   — d| _         dS )zlet raw passthrough as markdownr)   N)r-   )r%   s    r   Ú	raw_to_mdr2   E   s   € à€D„N€N€Nr   c                óÀ   — | j         dk    r| S d| _         | j        D ]A}|j        D ]7}|j        dk    rt	          |¦  «         Œ|j        dk    rt          |¦  «         Œ8ŒB| S )z”Convert a v3 notebook to v2.

    Parameters
    ----------
    nb : NotebookNode
        The Python representation of the notebook to convert.
    r   r   ÚheadingÚraw)r   r   r   r-   r0   r2   )r!   r$   r%   s      r   Ú	downgrader6   J   s‚   € ð 
„{�aÒÐØˆ	Ø€B„KØŒmð  ð  ˆØ”Hð 	 ð 	 ˆDØŒ~ Ò*Ð*Ý˜dÑ#Ô#Ð#Ð#Ø” 5Ò(Ð(Ý˜$‘”�øð		 ð
 €Ir   N)r   r   )Ú__doc__Ú
__future__r   Únbbaser   r   r   r'   r0   r2   r6   © r   r   ú<module>r;      s’   ðØ >Ð >ð #Ð "Ð "Ð "Ð "Ð "à ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ðð ð ð" ð  ð  ð  ðF2ð 2ð 2ð ð  ð  ð
ð ð ð ð r   