§
    ŽŸj}  ã                  ó
  — U d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
Z
ddlmZ ddl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dddœZded<   dddiidfdddiidfdœZded<    G d„ de¦  «        Zej        ZdS )znbclient cli.é    )ÚannotationsN)ÚPath)Údedent)Ú
JupyterApp)ÚBoolÚIntegerÚListÚUnicodeÚdefault)Úcatch_config_error)Ú__version__é   )ÚNotebookClientzNbClientApp.timeoutzNbClientApp.startup_timeoutzNbClientApp.kernel_namezNbClientApp.output_base)ÚtimeoutÚstartup_timeoutÚkernel_nameÚoutputzdict[str, str]Únbclient_aliasesÚNbClientAppÚallow_errorsTzLErrors are ignored and execution is continued until the end of the notebook.Úinplacez/Overwrite input notebook with executed results.)zallow-errorsr   zdict[str, typing.Any]Únbclient_flagsc                  ó8  ‡ — e Zd ZdZ ee¦  «        ZdZeZ	e
ZdZ e e¦   «         d¬¦  «                             d¬¦  «        Z edd ed	¦  «        ¬
¦  «                             d¬¦  «        Z ed ed¦  «        ¬¦  «                             d¬¦  «        Z ed ed¦  «        ¬¦  «                             d¬¦  «        Z ed ed¦  «        ¬¦  «                             d¬¦  «        Z ed ed¦  «        ¬¦  «                             d¬¦  «        Z ed ed¦  «        ¬¦  «                             d¬¦  «        Z edd ed¦  «        ¬
¦  «                             d¬¦  «        Z ed¦  «        d"d„¦   «         Zed#d$ˆ fd„¦   «         Zd%d„Zd&d!„Zˆ xZ S )'r   zE
    An application used to execute notebook files (``*.ipynb``)
    zjupyter-executez7An application used to execute notebook files (*.ipynb)zPath of notebooks to convert)ÚhelpT)ÚconfigNzÈ
            The time to wait (in seconds) for output from executions.
            If a cell execution takes longer, a TimeoutError is raised.
            ``-1`` will disable the timeout.
            )Ú
allow_noner   é<   z¢
            The time to wait (in seconds) for the kernel to start.
            If kernel startup takes longer, a RuntimeError is
            raised.
            FaB  
            When a cell raises an error the default behavior is that
            execution is stopped and a :py:class:`nbclient.exceptions.CellExecutionError`
            is raised.
            If this flag is provided, errors are ignored and execution
            is continued until the end of the notebook.
            zskip-executionz^
            Name of the cell tag to use to denote a cell that should be skipped.
            Ú z‹
            Name of kernel to use to execute the cells.
            If not set, use the kernel_spec embedded in the notebook.
            zÔ
            Default is execute notebook without writing the newly executed notebook.
            If this flag is provided, the newly generated notebook will
            overwrite the input notebook.
            a8  
            Write executed notebook to this file base name.
            Supports pattern replacements ``'{notebook_name}'``,
            the name of the input notebook file without extension.
            Note that output is always relative to the parent directory of the
            input notebook.
            Ú	log_levelÚreturnÚintc                ó   — t           j        S ©N)ÚloggingÚINFO)Úselfs    úY/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/nbclient/cli.pyÚ_log_level_defaultzNbClientApp._log_level_default†   s
   € åŒ|Ðó    Úargvúlist[str] | NoneÚNonec                ób  •— t          ¦   «                              |¦  «         |                      ¦   «         | _        | j        st	          j        d¦  «         t          | j        ¦  «        dk    r!| j        �d| j        vrd}t          |¦  «        ‚| j        D ]}|  	                    |¦  «         ŒdS )zInitialize the app.éÿÿÿÿr   Nz{notebook_name}zgIf passing multiple notebooks with `--output=output` option, output string must contain {notebook_name})
ÚsuperÚ
initializeÚget_notebooksÚ	notebooksÚsysÚexitÚlenÚoutput_baseÚ
ValueErrorÚrun_notebook)r&   r*   ÚmsgÚpathÚ	__class__s       €r'   r0   zNbClientApp.initializeŠ   sÅ   ø€ õ 	‰Œ×Ò˜4Ñ Ô Ð ð ×+Ò+Ñ-Ô-ˆŒð Œ~ð 	ÝŒH�R‰LŒLˆLõ ˆtŒ~ÑÔ Ò"Ð" tÔ'7Ð'CØ ¨Ô(8Ð8Ð8ðAð õ ! ‘o”oÐ%ð ”Nð 	$ð 	$ˆDØ×Ò˜dÑ#Ô#Ð#Ð#ð	$ð 	$r)   ú	list[str]c                ó2   — | j         r| j         }n| j        }|S )zGet the notebooks for the app.)Ú
extra_argsr2   )r&   r2   s     r'   r1   zNbClientApp.get_notebooks£   s(   € ð Œ?ð 	'ØœˆIˆIð œˆIð Ðr)   Únotebook_pathÚstrc                ó‚  — | j                              d|› �¦  «         t          |¦  «                             d¦  «        }|j                             ¦   «         }| j        r|}nh| j        r_|j                             | j         	                    |                     d¦  «        j
        ¬¦  «        ¦  «                             d¦  «        }nd}|r3|j                             ¦   «         sd|j        › d�}t          |¦  «        ‚|                     ¦   «         5 }t          j        |d¬	¦  «        }ddd¦  «         n# 1 swxY w Y   t!          || j        | j        | j        | j        | j        d
d|ii¬¦  «        }|                     ¦   «          |r4| j                              d|› �¦  «         t          j        ||¦  «         dS dS )zRun a notebook by path.z
Executing z.ipynbr   )Únotebook_nameNzCannot write to directory=z that does not existé   )Ú
as_versionÚmetadatar:   )r   r   Úskip_cells_with_tagr   r   Ú	resourceszSave executed results to )ÚlogÚinfor   Úwith_suffixÚparentÚabsoluter   r6   ÚjoinpathÚformatÚnameÚis_dirr7   ÚopenÚnbformatÚreadr   r   r   rF   r   r   ÚexecuteÚwrite)	r&   r?   Ú
input_pathr:   Úoutput_pathr9   ÚfÚnbÚclients	            r'   r8   zNbClientApp.run_notebook¯   s  € ð 	Œ�ŠÐ2 =Ð2Ð2Ñ3Ô3Ð3å˜-Ñ(Ô(×4Ò4°XÑ>Ô>ˆ
ð Ô ×)Ò)Ñ+Ô+ˆð Œ<ð 	Ø$ˆKˆKØÔð 	Ø$Ô+×4Ò4ØÔ ×'Ò'°j×6LÒ6LÈRÑ6PÔ6PÔ6UÐ'ÑVÔVñô çŠk˜(Ñ#Ô#ð ˆKð ˆKàð 	"˜{Ô1×8Ò8Ñ:Ô:ð 	"ØW¨{Ô/AÐWÐWÐWˆCÝ˜S‘/”/Ð!ð �_Š_ÑÔð 	0 !Ý”˜q¨QÐ/Ñ/Ô/ˆBð	0ð 	0ð 	0ñ 	0ô 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0øøøð 	0ð 	0ð 	0ð 	0õ  ØØ”LØ Ô0Ø $Ô 8ØÔ*ØÔ(Ø! F¨D >Ð2ð
ñ 
ô 
ˆð 	�ŠÑÔÐð ð 	,ØŒH�MŠMÐC°kÐCÐCÑDÔDÐDÝŒN˜2˜{Ñ+Ô+Ð+Ð+Ð+ð	,ð 	,s   ÄD7Ä7D;Ä>D;)r    r!   r#   )r*   r+   r    r,   )r    r<   )r?   r@   r    r,   )!Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   ÚversionrO   r   Úaliasesr   ÚflagsÚdescriptionr	   Útagr2   r   r   r   r   r   r   rF   r   r   r6   r   r(   r   r0   r1   r8   Ú__classcell__)r;   s   @r'   r   r   0   s×  ø€ € € € € ðð ð ˆg�kÑ"Ô"€GØ€DØ€GØ€EàK€KØ��W�W‘Y”YÐ%CÐDÑDÔD×HÒHÐPTÐHÑUÔU€IØˆgØØØˆVðñ
ô 
ð
ñ 
ô 
÷ 
‚c�€cÑÔð ð �gØ
ØˆVðñ
ô 
ð	ñ 	ô 	÷ 
‚c�€cÑÔð ð �4ØØˆVðñ
ô 
ðñ ô ÷ 
‚c�€cÑÔð ð "˜'ØØˆVðñ
ô 
ðñ ô ÷ 
‚c�€cÑÔð ð �'Ø
ØˆVðñ
ô 
ðñ ô ÷ 
‚c�€cÑÔð ð ˆdØØˆVðñ
ô 
ð	ñ 	ô 	÷ 
‚c�€cÑÔð ð �'ØØØˆVðñ
ô 
ðñ ô ÷ 
‚c�€cÑÔð ð €Wˆ[ÑÔðð ð ñ Ôðð ð$ð $ð $ð $ð $ð $ñ Ôð$ð0
ð 
ð 
ð 
ð-,ð -,ð -,ð -,ð -,ð -,ð -,ð -,r)   )r^   Ú
__future__r   r$   r3   ÚtypingÚpathlibr   Útextwrapr   rR   Újupyter_core.applicationr   Ú	traitletsr   r   r	   r
   r   Útraitlets.configr   Únbclientr   rZ   r   r   Ú__annotations__r   r   Úlaunch_instanceÚmain© r)   r'   ú<module>rq      s§  ðØ Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "à €€€Ø 
€
€
€
Ø €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à €€€Ø /Ð /Ð /Ð /Ð /Ð /Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø /Ð /Ð /Ð /Ð /Ð /à  Ð  Ð  Ð  Ð  Ð  à "Ð "Ð "Ð "Ð "Ð "ð
 %Ø4Ø,Ø'ð	$ð $Ð ð ð ð ñ ð Ø ðð	
ð
 	Wðð Ø˜4ðð	
ð
 	:ðð)ð )€ð ð ð ñ ð(l,ð l,ð l,ð l,ð l,�*ñ l,ô l,ð l,ð^ Ô"€€€r)   