§
    �Ÿjù  ã                  ó^  — 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mZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ dd	lmZ dd
lmZ ddlm Z m!Z!  ej"        de#d¬¦  «         g d¢Z$eZ%eZ&e	j'        Z( G d„ de)¦  «        Z*d„ Z+d„ Z,d„ Z-d„ Z.d„ Z/d„ Z0de%fd„Zde%fd„Z1dd„Z2dd„Z3dS )zŸDeprecated API for working with notebooks

- use nbformat for read/write/validate public API
- use nbformat.vX directly for Python API for composing notebooks
é    )ÚannotationsN)Ú
get_logger)Úv3)ÚNotebookNodeÚnbformatÚnbformat_minorÚnbformat_schemaÚ
new_authorÚnew_code_cellÚnew_heading_cellÚnew_metadataÚnew_notebookÚ
new_outputÚnew_text_cellÚnew_worksheetÚparse_filenameÚto_notebook_jsoné   )Úversions)Úconvert)Úreads)ÚValidationErrorÚvalidatez¶nbformat.current is deprecated since before nbformat 3.0

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version
é   ©Ú
stacklevel)r   r   r   r   r   r   r   r   r
   r   r   r   r	   r   r   r   ÚNBFormatErrorÚparse_pyÚ
reads_jsonÚwrites_jsonÚreads_pyÚ	writes_pyr   ÚwritesÚreadÚwritec                  ó   — e Zd ZdZdS )r   z&An error raised for an nbformat error.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú]/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/nbformat/current.pyr   r   S   s   € € € € € Ø0Ð0Ð0Ð0r,   r   c                 ó2   — t          j        dd¬¦  «         d S )NzwNon-JSON file support in nbformat is deprecated since nbformat 1.0.
    Use nbconvert to create files of other formats.r   r   )ÚwarningsÚwarnr+   r,   r-   Ú_warn_formatr1   W   s-   € Ý„Mð	7àðñ ô ð ð ð r,   c                ó$  — t           }t          }d}t          j        || ¦  «        }|�e|                     d¦  «                             d¦  «        }t          |d         ¦  «        }t          |¦  «        dk    rt          |d         ¦  «        }||| fS )z/Parse a string into a (nbformat, string) tuple.z0# <nbformat>(?P<nbformat>\d+[\.\d+]*)</nbformat>Nr   ú.r   r   )Úcurrent_nbformatÚcurrent_nbformat_minorÚreÚsearchÚgroupÚsplitÚintÚlen)ÚsÚkwargsÚnbfÚnbmÚpatternÚmÚdigitss          r-   r   r   _   s   € å
€CÝ
 €CàA€GÝ
Œ	�'˜1ÑÔ€AØ€}Ø—’˜Ñ$Ô$×*Ò*¨3Ñ/Ô/ˆÝ�&˜”)‰nŒnˆÝˆv‰;Œ;˜Š?ˆ?Ý�f˜Q”i‘.”.ˆCà��Qˆ;Ðr,   c                óX   — t          j        dt          d¬¦  «         t          | ¦  «        S )zDEPRECATED, use readsz6reads_json is deprecated since nbformat 3.0, use readsr   r   )r/   r0   ÚDeprecationWarningr   )Únbjsonr=   s     r-   r   r   o   s2   € å„MØ@ÝØðñ ô ð õ
 �‰=Œ=Ðr,   c                óT   — t          j        dt          d¬¦  «         t          | fi |¤ŽS )zDEPRECATED, use writesz8writes_json is deprecated since nbformat 3.0, use writesr   r   )r/   r0   rD   r#   ©Únbr=   s     r-   r    r    y   s<   € å„MØBÝØðñ ô ð õ
 �"ÐÐ˜ÐÐÐr,   c                ó¢   — t          ¦   «          t          | fi |¤Ž\  }}} |dv rt          |         j        | fi |¤Ž}nt	          d|z  ¦  «        ‚|S )úDEPRECATED: use nbconvert)r   é   z#Unsupported PY nbformat version: %i)r1   r   r   Úto_notebook_pyr   )r<   r=   r>   r?   rH   s        r-   r!   r!   ƒ   sf   € å�N„N€NÝ˜1Ð'Ð' Ð'Ð'�K€CˆˆaØ
ˆf€}€}Ý�cŒ]Ô)¨!Ð6Ð6¨vÐ6Ð6ˆˆåÐAÀCÑGÑHÔHÐHØ€Ir,   c                óN   — t          ¦   «          t          d         j        | fi |¤ŽS )rJ   rK   )r1   r   r"   rG   s     r-   r"   r"   Ž   s(   € å�N„N€NÝ�AŒ;Ô  Ð.Ð. vÐ.Ð.Ð.r,   Ú
DEPRECATEDc                óˆ  — |dvrt          ¦   «          t          | fi |¤Ž}t          ||¦  «        }	 t          j        ¦   «         5  t          j        dt          ¬¦  «         t          |d¬¦  «         ddd¦  «         n# 1 swxY w Y   n9# t          $ r,}t          ¦   «          
                    d|¦  «         Y d}~nd}~ww xY w|S )aŠ  Read a notebook from a string and return the NotebookNode object.

    This function properly handles notebooks of any version. The notebook
    returned will always be in the current version's format.

    Parameters
    ----------
    s : unicode
        The raw unicode string to read the notebook from.

    Returns
    -------
    nb : NotebookNode
        The notebook that was read.
    >   ÚjsonrN   Úignore©ÚcategoryF©Úrepair_duplicate_cell_idsNúNotebook JSON is invalid: %s)r1   Úreader_readsr   r/   Úcatch_warningsÚfilterwarningsrD   r   r   r   Úerror)r<   ÚformatÚversionr=   rH   Úes         r-   r   r   —   s!  € ð  Ð+Ð+Ð+Ý‰ŒˆÝ	�aÐ	"Ð	"˜6Ð	"Ð	"€BÝ	��WÑ	Ô	€Bð>ÝÔ$Ñ&Ô&ð 	:ð 	:ÝÔ# HÕ7IÐJÑJÔJÐJÝ�R°5Ð9Ñ9Ô9Ð9ð	:ð 	:ð 	:ñ 	:ô 	:ð 	:ð 	:ð 	:ð 	:ð 	:ð 	:øøøð 	:ð 	:ð 	:ð 	:øøõ ð >ð >ð >Ý‰Œ×ÒÐ9¸1Ñ=Ô=Ð=Ð=Ð=Ð=Ð=Ð=øøøøð>øøøà€Is;   ±B	 Á-A=Á1B	 Á=BÂB	 ÂBÂB	 Â	
B?Â"B:Â:B?c                óš  — |dvrt          ¦   «          t          | |¦  «        } 	 t          j        ¦   «         5  t          j        dt
          ¬¦  «         t          | d¬¦  «         ddd¦  «         n# 1 swxY w Y   n9# t          $ r,}t          ¦   «          	                    d|¦  «         Y d}~nd}~ww xY wt          |         j        | fi |¤ŽS )až  Write a notebook to a string in a given format in the current nbformat version.

    This function always writes the notebook in the current nbformat version.

    Parameters
    ----------
    nb : NotebookNode
        The notebook to write.
    version : int
        The nbformat version to write.
        Used for downgrading notebooks.

    Returns
    -------
    s : unicode
        The notebook string.
    >   rP   rN   rQ   rR   FrT   NrV   )r1   r   r/   rX   rY   rD   r   r   r   rZ   r   r    )rH   r[   r\   r=   r]   s        r-   r#   r#   ´   s%  € ð$ Ð+Ð+Ð+Ý‰ŒˆÝ	��WÑ	Ô	€Bð>ÝÔ$Ñ&Ô&ð 	:ð 	:ÝÔ# HÕ7IÐJÑJÔJÐJÝ�R°5Ð9Ñ9Ô9Ð9ð	:ð 	:ð 	:ñ 	:ô 	:ð 	:ð 	:ð 	:ð 	:ð 	:ð 	:øøøð 	:ð 	:ð 	:ð 	:øøõ ð >ð >ð >Ý‰Œ×ÒÐ9¸1Ñ=Ô=Ð=Ð=Ð=Ð=Ð=Ð=øøøøð>øøøå�GÔÔ(¨Ð6Ð6¨vÐ6Ð6Ð6s:   ¤A< ·-A0Á$A< Á0A4Á4A< Á7A4Á8A< Á<
B2Â"B-Â-B2c                ó@   — t          |                      ¦   «         fi |¤ŽS )a}  Read a notebook from a file and return the NotebookNode object.

    This function properly handles notebooks of any version. The notebook
    returned will always be in the current version's format.

    Parameters
    ----------
    fp : file
        Any file-like object with a read method.

    Returns
    -------
    nb : NotebookNode
        The notebook that was read.
    )r   r$   )Úfpr[   r=   s      r-   r$   r$   Ò   s"   € õ  �—’‘”Ð%Ð%˜fÐ%Ð%Ð%r,   c                óš   — t          | fi |¤Ž}t          |t          ¦  «        r|                     d¦  «        }|                     |¦  «        S )a5  Write a notebook to a file in a given format in the current nbformat version.

    This function always writes the notebook in the current nbformat version.

    Parameters
    ----------
    nb : NotebookNode
        The notebook to write.
    fp : file
        Any file-like object with a write method.
    Úutf8)r#   Ú
isinstanceÚbytesÚdecoder%   )rH   r`   r[   r=   r<   s        r-   r%   r%   å   sL   € õ 	ˆrÐÐ�VÐÐ€AÝ�!•UÑÔð Ø�HŠH�VÑÔˆØ�8Š8�A‰;Œ;Ðr,   )rN   )4r*   Ú
__future__r   r6   r/   Útraitlets.logr   r   r   Ú	_v_latestÚnbformat.v3r   r   r	   r
   r   r   r   r   r   r   r   r   r   Ú r   Ú	converterr   Úreaderr   rW   Ú	validatorr   r   r0   rD   Ú__all__r4   r5   r'   Úcurrent_nbformat_moduleÚ
ValueErrorr   r1   r   r   r    r!   r"   r#   r$   r%   r+   r,   r-   ú<module>rq      s‡  ððð ð #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø €€€à $Ð $Ð $Ð $Ð $Ð $à $Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð" Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø )Ð )Ð )Ð )Ð )Ð )Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0à €„ðð
 Øðñ ô ð ðð ð €ð: Ð Ø'Ð Ø#Ô,Ð ð1ð 1ð 1ð 1ð 1�Jñ 1ô 1ð 1ðð ð ðð ð ð ð ð ð ð  ð  ðð ð ð/ð /ð /ð !Ð*:ð ð ð ð ð: #Ð,<ð 7ð 7ð 7ð 7ð<&ð &ð &ð &ð&ð ð ð ð ð r,   