§
    ŽŸjá  ã                  óè   — U d Z ddlmZ ddlmZ ddlmZ  G d„ de¦  «        Z G d„ de	e¦  «        Z
 G d	„ d
e¦  «        Z G d„ de¦  «        Z G d„ de¦  «        ZdZded<   dZded<   dZded<   dS )zExceptions for nbclient.é    )Úannotations)ÚAny)ÚNotebookNodec                  ó   — e Zd ZdZdS )ÚCellControlSignalzÃ
    A custom exception used to indicate that the exception is used for cell
    control actions (not the best model, but it's needed to cover existing
    behavior without major refactors).
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú`/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/nbclient/exceptions.pyr   r   	   s   € € € € € ðð ð 	€Dr   r   c                  ó*   — e Zd ZdZedd	„¦   «         Zd
S )ÚCellTimeoutErrorzS
    A custom exception to capture when a cell has timed out during execution.
    ÚmsgÚstrÚtimeoutÚintÚcellr   Úreturnc                ó   — |re|j         r^|j                              ¦   «                              d¦  «        }t          |¦  «        dk     r|j         n|dd…         › d|dd…         › �}nd} | t                               |||¬¦  «        ¦  «        S )	z)Create an error from a timeout on a cell.ú
é   Né   z
...
éûÿÿÿzCell contents not found.)r   r   Úcell_contents)ÚsourceÚstripÚsplitÚlenÚtimeout_err_msgÚformat)Úclsr   r   r   Úsrc_by_linesÚsrcs         r   Úerror_from_timeout_and_cellz,CellTimeoutError.error_from_timeout_and_cell   s«   € ð
 ð 	-�D”Kð 	-Øœ;×,Ò,Ñ.Ô.×4Ò4°TÑ:Ô:ˆLõ �|Ñ$Ô$ rÒ)Ð)ð ”�à$ R a RÔ(ÐDÐD°¸b¸c¸cÔ1BÐDÐDð ˆCð -ˆCØˆs•?×)Ò)°'¸sÐRUÐ)ÑVÔVÑWÔWÐWr   N)r   r   r   r   r   r   r   r   )r	   r
   r   r   Úclassmethodr'   r   r   r   r   r      sD   € € € € € ðð ð ðXð Xð Xñ „[ðXð Xð Xr   r   c                  ó   — e Zd ZdZdS )ÚDeadKernelErrorzA dead kernel error.Nr   r   r   r   r*   r*   )   s   € € € € € ØÐà€Dr   r*   c                  ó   — e Zd ZdZdS )ÚCellExecutionCompletezõ
    Used as a control signal for cell execution across execute_cell and
    process_message function calls. Raised when all execution requests
    are completed and no further messages are expected from the kernel
    over zeromq channels.
    Nr   r   r   r   r,   r,   /   s   € € € € € ðð ð 	€Dr   r,   c                  óL   ‡ — e Zd ZdZdˆ fd„Zdd
„Zdd„Zedd„¦   «         Zˆ xZ	S )ÚCellExecutionErrorzâ
    Custom exception to propagate exceptions that are raised during
    notebook execution to the caller. This is mostly useful when
    using nbconvert as a library, since it allows to deal with
    failures gracefully.
    Ú	tracebackr   ÚenameÚevaluer   ÚNonec                ót   •— t          ¦   «                              |¦  «         || _        || _        || _        dS )zInitialize the error.N)ÚsuperÚ__init__r/   r0   r1   )Úselfr/   r0   r1   Ú	__class__s       €r   r5   zCellExecutionError.__init__B   s4   ø€ å‰Œ×Ò˜Ñ#Ô#Ð#Ø"ˆŒØˆŒ
ØˆŒˆˆr   ú
tuple[Any]c                óH   — t          | ¦  «        | j        | j        | j        ffS )zReduce implementation.)Útyper/   r0   r1   ©r6   s    r   Ú
__reduce__zCellExecutionError.__reduce__I   s    € å�D‰zŒz˜DœN¨D¬J¸¼ÐDÐDÐDr   c                ó@   — | j         r| j         S | j        › d| j        › �S )z	Str repr.z: )r/   r0   r1   r;   s    r   Ú__str__zCellExecutionError.__str__M   s,   € àŒ>ð 	2Ø”>Ð!à”jÐ1Ð1 D¤KÐ1Ð1Ð1r   r   r   r   údict[str, Any]c                óH  — g }|j         D ][}|d         dk    rM|                     t                               |d         |d                              ¦   «         ¬¦  «        ¦  «         Œ\|r+|                     dd¦  «         |                     d¦  «         d	                     |¦  «        }d	                     |                     d
g ¦  «        pg ¦  «        } | t                               |||¬¦  «        |                     dd¦  «        |                     dd¦  «        ¬¦  «        S )zvInstantiate from a code cell object and a message contents
        (message is either execute_reply or error)
        Úoutput_typeÚstreamÚnameÚtext)rC   rD   r   Ú z------------------r   r/   )r   Ústream_outputr/   r0   z<Error>r1   )r0   r1   )	ÚoutputsÚappendÚstream_output_msgr#   ÚrstripÚinsertÚjoinÚgetÚexec_err_msg)r$   r   r   Ústream_outputsÚoutputrF   Útbs          r   Úfrom_cell_and_msgz$CellExecutionError.from_cell_and_msgT   s7  € ð %'ˆØ”lð 	ð 	ˆFØ�mÔ$¨Ò0Ð0Ø×%Ò%Ý%×,Ò,°&¸´.ÀvÈfÄ~×G\ÒG\ÑG^ÔG^Ð,Ñ_Ô_ñô ð øð ð 	8ð ×!Ò! ! RÑ(Ô(Ð(Ø×!Ò!Ð"6Ñ7Ô7Ð7Ø!ŸYšY ~Ñ6Ô6ˆà�YŠY�s—w’w˜{¨BÑ/Ô/Ð5°2Ñ6Ô6ˆØˆsÝ×ÒØØ+Øð  ñ ô ð
 —'’'˜' 9Ñ-Ô-Ø—7’7˜8 RÑ(Ô(ð
ñ 
ô 
ð 	
r   )r/   r   r0   r   r1   r   r   r2   )r   r8   )r   r   )r   r   r   r?   r   r.   )
r	   r
   r   r   r5   r<   r>   r(   rR   Ú__classcell__)r7   s   @r   r.   r.   :   s“   ø€ € € € € ðð ðð ð ð ð ð ðEð Eð Eð Eð2ð 2ð 2ð 2ð ð
ð 
ð 
ñ „[ð
ð 
ð 
ð 
ð 
r   r.   z----- {name} -----
{text}r   rI   z‡An error occurred while executing the following cell:
------------------
{cell.source}
------------------
{stream_output}

{traceback}
rN   z¿A cell timed out while it was being executed, after {timeout} seconds.
The message was: {msg}.
Here is a preview of the cell contents:
-------------------
{cell_contents}
-------------------
r"   N)r   Ú
__future__r   Útypingr   Únbformatr   Ú	Exceptionr   ÚTimeoutErrorr   ÚRuntimeErrorr*   r,   r.   rI   Ú__annotations__rN   r"   r   r   r   ú<module>r[      s€  ðØ Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð à !Ð !Ð !Ð !Ð !Ð !ð	ð 	ð 	ð 	ð 	˜	ñ 	ô 	ð 	ðXð Xð Xð Xð X�|Ð%6ñ Xô Xð Xð,	ð 	ð 	ð 	ð 	�lñ 	ô 	ð 	ð	ð 	ð 	ð 	ð 	Ð-ñ 	ô 	ð 	ð7
ð 7
ð 7
ð 7
ð 7
Ð*ñ 7
ô 7
ð 7
ðt
Ð ð 
ð 
ð 
ñ 
ð€ð ð ð ñ ð€ð ð ð ñ ð ð r   