§
    �Ÿj
  ã                  ó^   — d Z ddlmZ ddlZddlmZ  G d„ de¦  «        Zd„ Zd	„ Z	d
„ Z
d„ ZdS )z/API for reading notebooks of different versionsé    )ÚannotationsNé   )ÚValidationErrorc                  ó   — e Zd ZdZdS )ÚNotJSONErrorz1An error raised when an object is not valid JSON.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú\/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/nbformat/reader.pyr   r      s   € € € € € Ø;Ð;Ð;Ð;r   r   c                ó¼   — 	 t          j        | fi |¤Ž}nG# t          $ r:}d| ›�}t          |¦  «        dk    r|dd…         dz   }t	          |¦  «        |‚d}~ww xY w|S )z Parse a JSON string into a dict.z%Notebook does not appear to be JSON: éP   NéM   z...)ÚjsonÚloadsÚ
ValueErrorÚlenr   )ÚsÚkwargsÚnb_dictÚeÚmessages        r   Ú
parse_jsonr      s†   € ð+Ý”*˜QÐ)Ð) &Ð)Ð)ˆˆøÝð +ð +ð +Ø?¸!Ð?Ð?ˆåˆw‰<Œ<˜"ÒÐØ˜c˜r˜c”l UÑ*ˆGÝ˜7Ñ#Ô#¨Ð*øøøøð+øøøð €Ns   ‚ •
AŸ5AÁAc                ób   — |                       dd¦  «        }|                       dd¦  «        }||fS )záGet the version of a notebook.

    Parameters
    ----------
    nb : dict
        NotebookNode or dict containing notebook data.

    Returns
    -------
    Tuple containing major (int) and minor (int) version numbers
    Únbformatr   Únbformat_minorr   )Úget)ÚnbÚmajorÚminors      r   Úget_versionr#       s5   € ð �FŠF�:˜qÑ!Ô!€EØ�FŠFÐ# QÑ'Ô'€EØ�5ˆ>Ðr   c                óþ   — ddl m}m} t          | fi |¤Ž}t	          |¦  «        \  }}||v rE	 ||                              ||¬¦  «        S # t          $ r}d|› �}t          |¦  «        d‚d}~ww xY w |d|z  ¦  «        ‚)aQ  Read a notebook from a json string and return the
    NotebookNode object.

    This function properly reads notebooks of any version.  No version
    conversion is performed.

    Parameters
    ----------
    s : unicode | bytes
        The raw string or bytes object to read the notebook from.

    Returns
    -------
    nb : NotebookNode
        The notebook that was read.

    Raises
    ------
    ValidationError
        Notebook JSON for a given version is missing an expected key and cannot be read.
    NBFormatError
        Specified major version is invalid or unsupported.
    r   )ÚNBFormatErrorÚversions)r"   z8The notebook is invalid and is missing an expected key: NzUnsupported nbformat version %s)Ú r%   r&   r   r#   Úto_notebook_jsonÚAttributeErrorr   )	r   r   r%   r&   r   r!   r"   r   Úmsgs	            r   Úreadsr+   1   sÃ   € ð0 *Ð)Ð)Ð)Ð)Ð)Ð)Ð)å˜Ð%Ð%˜fÐ%Ð%€GÝ  Ñ)Ô)�N€UˆEØ�ÐÐð	1Ø˜E”?×3Ò3°GÀ5Ð3ÑIÔIÐIøÝð 	1ð 	1ð 	1ØPÈQÐPÐPˆCÝ! #Ñ&Ô&¨DÐ0øøøøð	1øøøð ˆmÐ=ÀÑEÑFÔFÐFs   ­A
 Á

A.ÁA)Á)A.c                ó@   — t          |                      ¦   «         fi |¤ŽS )aZ  Read a notebook from a file and return the NotebookNode object.

    This function properly reads notebooks of any version.  No version
    conversion is performed.

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

    Returns
    -------
    nb : NotebookNode
        The notebook that was read.
    )r+   Úread)Úfpr   s     r   r-   r-   W   s"   € õ  �—’‘”Ð%Ð%˜fÐ%Ð%Ð%r   )r   Ú
__future__r   r   Ú	validatorr   r   r   r   r#   r+   r-   r   r   r   ú<module>r1      s®   ðØ 5Ð 5ð #Ð "Ð "Ð "Ð "Ð "à €€€à &Ð &Ð &Ð &Ð &Ð &ð<ð <ð <ð <ð <�:ñ <ô <ð <ð
ð 
ð 
ð ð ð ð"#Gð #Gð #GðL&ð &ð &ð &ð &r   