§
    bP„j  ã                  ób  — 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!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„ Z0d„ Z1de&fd„Zde&fd„Z2dd„Z3dd„Z4d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Ú	_validateÚ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)ÚNBFormatErrorr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   Úparse_pyÚreadr   Ú
reads_jsonÚreads_pyr   r   ÚwriteÚwritesÚwrites_jsonÚ	writes_pyc                  ó   — e Zd ZdZdS )r   z&An error raised for an nbformat error.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úU/root/disk_3tb/conda_envs/Huy-visual/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_formatr2   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   )r0   r1   Ú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   )r0   r1   rE   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)r2   r   r   Úto_notebook_pyr   )r=   r>   r?   Ú_nbmrI   s        r.   r"   r"   ƒ   sf   € å�N„N€NÝ˜AÐ(Ð( Ð(Ð(�L€CˆˆqØ
ˆf€}€}Ý�cŒ]Ô)¨!Ð6Ð6¨vÐ6Ð6ˆˆåÐAÀCÑGÑHÔHÐHØ€Ir-   c                óN   — t          ¦   «          t          d         j        | fi |¤ŽS )rK   rL   )r2   r   r&   rH   s     r.   r&   r&   Ž   s(   € å�N„N€NÝ�AŒ;Ô  Ð.Ð. vÐ.Ð.Ð.r-   Ú
DEPRECATEDc                óü   — |dvrt          ¦   «          t          | fi |¤Ž}t          ||¦  «        }	 t          |d¬¦  «         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.
    >   ÚjsonrP   F©Úrepair_duplicate_cell_idsúNotebook JSON is invalid: %sN)r2   Úreader_readsr   r   r   r   Úerror)r=   ÚformatÚversionr>   rI   Úes         r.   r   r   —   s¦   € ð  Ð+Ð+Ð+Ý‰ŒˆÝ	�aÐ	"Ð	"˜6Ð	"Ð	"€BÝ	��WÑ	Ô	€Bð>Ý�"°Ð6Ñ6Ô6Ð6Ð6øÝð >ð >ð >Ý‰Œ×ÒÐ9¸1Ñ=Ô=Ð=Ð=Ð=Ð=Ð=Ð=øøøøð>øøøà€Is   ±A Á
A9Á"A4Á4A9c                ó  — |dvrt          ¦   «          t          | |¦  «        } 	 t          | d¬¦  «         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.
    >   rR   rP   FrS   rU   N)r2   r   r   r   r   rW   r   r%   )rI   rX   rY   r>   rZ   s        r.   r$   r$   ²   sª   € ð$ Ð+Ð+Ð+Ý‰ŒˆÝ	��WÑ	Ô	€Bð>Ý�"°Ð6Ñ6Ô6Ð6Ð6øÝð >ð >ð >Ý‰Œ×ÒÐ9¸1Ñ=Ô=Ð=Ð=Ð=Ð=Ð=Ð=øøøøð>øøøå�GÔÔ(¨Ð6Ð6¨vÐ6Ð6Ð6s   ¤6 ¶
A,Á "A'Á'A,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    )ÚfprX   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#   )rI   r]   rX   r>   r=   s        r.   r#   r#   á   sL   € õ 	ˆrÐÐ�VÐÐ€AÝ�!•UÑÔð Ø�HŠH�VÑÔˆØ�8Š8�A‰;Œ;Ðr-   )rP   )5r+   Ú
__future__r   r7   r0   Útraitlets.logr   r   r   Ú	_v_latestÚnbformat.v3r   r   r	   r
   r   r   r   r   r   r   r   r   r   Ú r   Ú	converterr   Úreaderr   rV   Ú	validatorr   r   r   r1   rE   Ú__all__r5   r6   r(   Úcurrent_nbformat_moduleÚ
ValueErrorr   r2   r   r!   r%   r"   r&   r$   r    r#   r,   r-   r.   ú<module>rn      s�  ððð ð #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø €€€à $Ð $Ð $Ð $Ð $Ð $à $Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð" Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø )Ð )Ð )Ð )Ð )Ð )Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;à €„ðð
 Øðñ ô ð ðð ð €ð: Ð Ø'Ð Ø#Ô,Ð ð1ð 1ð 1ð 1ð 1�Jñ 1ô 1ð 1ðð ð ðð ð ð ð ð ð ð  ð  ðð ð ð/ð /ð /ð !Ð*:ð ð ð ð ð6 #Ð,<ð 7ð 7ð 7ð 7ð8&ð &ð &ð &ð&ð ð ð ð ð r-   