§
    ŒŸj�=  ã                  ó  — d Z ddlmZ ddlZddlZddlZddl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mZ ddlmZ dd	lmZ dd
lmZ  G d„ dej        ¦  «        Zdd„Zdd„Zdd„Zd d„Zdd„Zd!d„Zd"d„Zedk    r e¦   «          dS dS )#zgThe root `jupyter` command.

This does nothing other than dispatch to subcommands or output path info.
é    )ÚannotationsN)ÚPath)Úwhich)ÚPopen)ÚAnyé   )Úpaths)Ú__version__c                  óT   — e Zd ZdZedd„¦   «         Zej        dd„¦   «         Zdd	„Zd
S )ÚJupyterParserzA Jupyter argument parser.ÚreturnÚstrc                óN   — d                      t          ¦   «         ¦  «        }d|› �S )z}Add subcommands to epilog on request

        Avoids searching PATH for subcommands unless help output is requested.
        ú zAvailable subcommands: )ÚjoinÚlist_subcommands)ÚselfÚsubcommandss     úa/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/jupyter_core/command.pyÚepilogzJupyterParser.epilog   s*   € ð Ÿ8š8Õ$4Ñ$6Ô$6Ñ7Ô7ˆØ6¨Ð6Ð6Ð6ó    Úxr   ÚNonec                ó   — dS )z$Ignore epilog set in Parser.__init__N© )r   r   s     r   r   zJupyterParser.epilog'   s   € € € r   c                ó\   — 	 ddl }|                     | ¦  «         dS # t          $ r Y dS w xY w)z#Trigger auto-completion, if enabledr   N)ÚargcompleteÚautocompleteÚImportError)r   r   s     r   r   zJupyterParser.argcomplete+   sO   € ð	ØÐÐÐà×$Ò$ TÑ*Ô*Ð*Ð*Ð*øÝð 	ð 	ð 	ØˆDˆDð	øøøs   ‚ �
+ª+N)r   r   )r   r   r   r   ©r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   Úsetterr   r   r   r   r   r      sn   € € € € € Ø$Ð$àð7ð 7ð 7ñ „Xð7ð „]ð3ð 3ð 3ñ „]ð3ðð ð ð ð ð r   r   r   c                 óî  — t          d¬¦  «        } |                      d¬¦  «        }|                     ddd¬¦  «         |                     d	t          d
d¬¦  «        }d„ |_        |                     ddd¬¦  «         |                     ddd¬¦  «         |                     ddd¬¦  «         |                     ddd¬¦  «         |                      ddd¬¦  «         |                      ddd¬¦  «         | S )zCreate a jupyter parser object.zJupyter: Interactive Computing)ÚdescriptionF)Úrequiredz	--versionÚ
store_truez3show the versions of core jupyter packages and exit)ÚactionÚhelpÚ
subcommandú?zthe subcommand to launch)ÚtypeÚnargsr,   c                 ó   — t          ¦   «         S ©N)r   )ÚargsÚkwargss     r   ú<lambda>z jupyter_parser.<locals>.<lambda>C   s   € Õ:JÑ:LÔ:L€ r   z--config-dirzshow Jupyter config dirz
--data-dirzshow Jupyter data dirz--runtime-dirzshow Jupyter runtime dirz--pathsz?show all Jupyter paths. Add --json for machine-readable format.z--jsonz%output paths as machine-readable jsonz--debugz$output debug information about paths)r   Úadd_mutually_exclusive_groupÚadd_argumentr   Ú	completer)ÚparserÚgroupÚsubcommand_actions      r   Újupyter_parserr<   5   sE  € åØ4ðñ ô €Fð ×/Ò/¸Ð/Ñ?Ô?€Eà	×ÒØ˜LÐ/dð ñ ô ð ð ×*Ò*Ø�3 cÐ0Jð +ñ ô Ðð #MÐ"LÐÔà	×Ò�~¨lÐAZÐÑ[Ô[Ð[Ø	×Ò�|¨LÐ?VÐÑWÔWÐWØ	×Ò�¨|ÐB\ÐÑ]Ô]Ð]Ø	×ÒØØØNð ñ ô ð ð
 ×Ò˜¨Ð<cÐÑdÔdÐdØ
×Ò˜	¨,Ð=cÐÑdÔdÐdà€Mr   ú	list[str]c            
     óÎ  ‡‡— t          ¦   «         Št          ¦   «         D ]Æ} 	 t          t          | ¦  «                             ¦   «         ¦  «        }n# t
          $ r Y Œ>w xY w|D ]�}|j        }|                     d¦  «        rct          j	                             d¦  «        r|j
        }‰                     t          |                     d¦  «        dd…         ¦  «        ¦  «         Œ‚ŒÇt          ¦   «         }‰D ]aŠt          ˆˆfd„t          dt!          ‰¦  «        ¦  «        D ¦   «         ¦  «        s(|                     d                     ‰¦  «        ¦  «         Œbt%          |¦  «        S )zÙList all jupyter subcommands

    searches PATH for `jupyter-name`

    Returns a list of jupyter's subcommand names, without the `jupyter-` prefix.
    Nested children (e.g. jupyter-sub-subsub) are not included.
    újupyter-Úwinú-r   Nc              3  ó0   •K  — | ]}‰d |…         ‰v V — Œd S r2   r   )Ú.0ÚiÚsub_tupÚsubcommand_tupless     €€r   ú	<genexpr>z#list_subcommands.<locals>.<genexpr>m   s1   øè è € ÐTÐT¸�7˜2˜A˜2”;Ð"3Ð3ÐTÐTÐTÐTÐTÐTr   )ÚsetÚ_path_with_selfÚlistr   ÚiterdirÚOSErrorÚnameÚ
startswithÚsysÚplatformÚstemÚaddÚtupleÚsplitÚanyÚrangeÚlenr   Úsorted)ÚdÚ	bin_pathsÚpathrM   r   rE   rF   s        @@r   r   r   S   sl  øø€ õ ™œÐåÑÔð Bð Bˆð	Ý�T !™WœWŸ_š_Ñ.Ô.Ñ/Ô/ˆIˆIøÝð 	ð 	ð 	ØˆHð	øøøàð 	Bð 	BˆDØ”9ˆDØ�Š˜zÑ*Ô*ð BÝ”<×*Ò*¨5Ñ1Ô1ð %àœ9�DØ!×%Ò%¥e¨D¯JªJ°s©O¬O¸A¸B¸BÔ,?Ñ&@Ô&@ÑAÔAÐAøð	Bõ ‘%”%€Kà$ð /ð /ˆÝÐTÐTÐTÐTÐT½UÀ1ÅcÈ'ÁlÄlÑ=SÔ=SÐTÑTÔTÑTÔTð 	/Ø�OŠO˜CŸHšH WÑ-Ô-Ñ.Ô.Ð.øÝ�+ÑÔÐs   ¢.AÁ
AÁAÚcmdr   Úargvr   c                ó¨  — t           j                             d¦  «        r�t          | ¦  «        }|€| ›d�}t	          |t
          j        ¦  «        ‚t          |g|dd…         ¢¦  «        }ddl}|                     |j	        |j
        ¦  «         |                     ¦   «          t          j        |j        ¦  «         dS t          j        | |¦  «         dS )z�execvp, except on Windows where it uses Popen

    Python provides execvp on Windows, but its behavior is problematic (Python bug#9148).
    r@   Nz
 not foundr   r   )rO   rP   rN   r   rL   ÚerrnoÚENOENTr   ÚsignalÚSIGINTÚSIG_IGNÚwaitÚexitÚ
returncodeÚosÚexecvp)r\   r]   Úcmd_pathÚmsgÚpra   s         r   Ú_execvprl   r   sÌ   € õ
 „|×Ò˜uÑ%Ô%ð õ ˜‘:”:ˆØÐØÐ&Ð&Ð&ˆCÝ˜#�uœ|Ñ,Ô,Ð,Ý�8Ð'˜d 1 2 2œhÐ'Ñ(Ô(ˆð 	ˆˆˆà�Š�f”m V¤^Ñ4Ô4Ð4Ø	�Š‰ŒˆÝŒ�”ÑÔÐÐÐå
Œ	�#�tÑÔÐÐÐr   r-   c                ó  — t           j                             t          ¦   «         ¦  «        }d| › �}t	          ||¬¦  «        }|€d|› d�}t          |¦  «        ‚t          j        |t           j        ¦  «        sd|› d�}t          |¦  «        ‚|S )z^This method get the abspath of a specified jupyter-subcommand with no
    changes on ENV.
    r?   )r[   Nz
Jupyter command `z` not found.z` is not executable.)rg   Úpathsepr   rI   r   Ú	ExceptionÚaccessÚX_OK)r-   Úsearch_pathÚjupyter_subcommandÚabs_pathrj   s        r   Ú_jupyter_abspathru   Š   s™   € õ
 ”*—/’/¥/Ñ"3Ô"3Ñ4Ô4€Kà0 JÐ0Ð0ÐÝÐ'¨kÐ:Ñ:Ô:€HØÐØDÐ$6ÐDÐDÐDˆÝ˜‰nŒnÐåŒ9�X�rœwÑ'Ô'ð ØLÐ$6ÐLÐLÐLˆÝ˜‰nŒnÐà€Or   c                 óè  — t           j                             d¦  «        pt           j                             t           j        ¦  «        } 	 t          j        d¦  «        }|                      |¦  «         n# t          $ r Y nw xY wt          j        d         g}t          |d         ¦  «                             ¦   «         r8|                     t           j                             |d         ¦  «        ¦  «         |D ]y}t!          t          |¦  «        j        ¦  «        }t          |¦  «                             ¦   «         r5t          j        |t           j        ¦  «        r|                      d|¦  «         Œz| S )zÀPut `jupyter`'s dir at the front of PATH

    Ensures that /path/to/jupyter subcommand
    will do /path/to/jupyter-subcommand
    even if /other/jupyter-subcommand is ahead of it on PATH
    ÚPATHÚscriptsr   )rg   ÚenvironÚgetÚdefpathrT   rn   Ú	sysconfigÚget_pathÚappendÚKeyErrorrO   r]   r   Ú
is_symlinkr[   Úrealpathr   ÚparentÚis_dirrp   rq   Úinsert)Ú	path_listÚbindirrx   Úscripts       r   rI   rI   ž   sF  € õ ”—’ Ñ'Ô'Ð5­2¬:×<Ò<½R¼ZÑHÔH€Ið!ÝÔ# IÑ.Ô.ˆð
 	×Ò˜Ñ Ô Ð Ð øõ	 ð ð ð àˆðøøøõ Œx˜Œ{ˆm€GÝˆG�AŒJÑÔ×"Ò"Ñ$Ô$ð 5à�Š•r”w×'Ò'¨°¬
Ñ3Ô3Ñ4Ô4Ð4àð (ð (ˆÝ•T˜&‘\”\Ô(Ñ)Ô)ˆÝ�‰<Œ<×ÒÑ Ô ð 	(¥R¤Y¨vµr´wÑ%?Ô%?ð 	(ð ×Ò˜Q Ñ'Ô'Ð'øØÐs   Á
A4 Á4
BÂ Br9   c                ó4  — 	 ddl m}m}  |¦   «         }|r:t          |¦  «        dk    r'|d                              d¦  «        s |¦   «          |S |                      ¦   «          n$# t          $ r |                      ¦   «          Y nw xY wd}t          |¦  «        ‚)a  If argcomplete is enabled, trigger autocomplete or return current words

    If the first word looks like a subcommand, return the current command
    that is attempting to be completed so that the subcommand can evaluate it;
    otherwise auto-complete using the main parser.
    r   )Úget_argcomplete_cwordsÚincrement_argcomplete_indexr   rA   z3Control flow should not reach end of autocomplete())Ú#traitlets.config.argcomplete_configr‰   rŠ   rW   rN   r   r   ÚAssertionError)r9   r‰   rŠ   Úcwordsrj   s        r   Ú_evaluate_argcompleterŽ   Ä   sá   € ðð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð
 (Ð'Ñ)Ô)ˆØð 	•c˜&‘k”k A’o�o¨f°Q¬i×.BÒ.BÀ3Ñ.GÔ.G�oð (Ð'Ñ)Ô)Ð)ØˆMà×ÒÑÔÐÐøÝð ð ð ð 	×ÒÑÔÐÐÐðøøøð @€CÝ
˜Ñ
Ô
Ðs   ‚AA% ÁA% Á%BÂBc                 óB  — t          ¦   «         } t          j        }d}dt          j        v rt          | ¦  «        }|d         }�nât          |¦  «        dk    r%|d                              d¦  «        s
|d         }�nª|                      ¦   «         \  }}|j	        }|j
        rbt          d¦  «         dD ]N}	 |dk    rt          }nt          |¦  «        }|j        }n# t          $ r d}Y nw xY wt          |d	›d
�|¦  «         ŒOdS |j        r|j        st          j        d¦  «         |j        r|j        st          j        d¦  «         |j        r|j        rt          j        d¦  «         |j        r"t          t!          j        ¦   «         ¦  «         dS |j        r"t          t!          j        ¦   «         ¦  «         dS |j        r"t          t!          j        ¦   «         ¦  «         dS |j        �r:i }t!          j        ¦   «         g|d<   t!          j        ¦   «         |d<   t!          j        ¦   «         |d<   |j        r#t          t          j        |¦  «        ¦  «         �nÉ|j        �r~t          j        }	t!          j        ¦   «         rt          d¦  «         nt          d¦  «         t!          j        ¦   «         rt          d¦  «         nt          d¦  «         |	                     d¦  «        rt          d¦  «         nt          d¦  «         |	                     d¦  «        r't          d|	                     d¦  «        › d�¦  «         nt          d¦  «         |	                     d¦  «        r't          d|	                     d¦  «        › d�¦  «         nt          d¦  «         t>          j         r%t          d t?          j!        ¦   «         › d!�¦  «         n$t          d"t?          j!        ¦   «         › d!�¦  «         |	                     d#¦  «        r't          d$|	                     d#¦  «        › d%�¦  «         nt          d&¦  «         |	                     d'¦  «        r't          d(|	                     d'¦  «        › d)�¦  «         nt          d*¦  «         |	                     d+¦  «        r't          d,|	                     d+¦  «        › d-�¦  «         nt          d.¦  «         t          ¦   «          tE          |¦  «        D ]3}
||
         }t          |
› d
�¦  «         |D ]}t          d/|z   ¦  «         ŒŒ4dS |s4|  #                    t          j$        ¬0¦  «         t          j        d1¦  «         	 tK          |¦  «        }nd# tL          $ rW}|  #                    t          j$        ¬0¦  «         |d2k    rY d}~dS t          j        tO          |¦  «        ¦  «         Y d}~nd}~ww xY w	 tQ          ||g|d3d…         ¢¦  «         dS # tR          $ r%}t          j        d4|›d5|› �¦  «         Y d}~dS d}~ww xY w)6zThe command entry point.NÚ_ARGCOMPLETEr   rA   z!Selected Jupyter core packages...)ÚIPythonÚ	ipykernelÚ
ipywidgetsÚjupyter_clientÚjupyter_coreÚjupyter_serverÚ
jupyterlabÚnbclientÚ	nbconvertÚnbformatÚnotebookÚ	qtconsoleÚ	traitletsr•   znot installedz<17ú:z --json is only used with --pathsz!--debug is only used with --pathsz"--debug cannot be used with --jsonÚruntimeÚconfigÚdatazjJUPYTER_PLATFORM_DIRS is set to a true value, so we use platformdirs to find platform-specific directoriesz€JUPYTER_PLATFORM_DIRS is set to a false value, or is not set, so we use hardcoded legacy paths for platform-specific directorieszÕJUPYTER_PREFER_ENV_PATH is set to a true value, or JUPYTER_PREFER_ENV_PATH is not set and we detected a virtual environment, making the environment-level path preferred over the user-level path for data and configzÜJUPYTER_PREFER_ENV_PATH is set to a false value, or JUPYTER_PREFER_ENV_PATH is not set and we did not detect a virtual environment, making the user-level path preferred over the environment-level path for data and configÚJUPYTER_NO_CONFIGzWJUPYTER_NO_CONFIG is set, making the config path list only a single temporary directoryzEJUPYTER_NO_CONFIG is not set, so we use the full path list for configÚJUPYTER_CONFIG_PATHzJUPYTER_CONFIG_PATH is set to 'zO', which is prepended to the config path list (unless JUPYTER_NO_CONFIG is set)zQJUPYTER_CONFIG_PATH is not set, so we do not prepend anything to the config pathsÚJUPYTER_CONFIG_DIRzJUPYTER_CONFIG_DIR is set to 'z5', overriding the default user-level config directoryzPJUPYTER_CONFIG_DIR is not set, so we use the default user-level config directoryzKPython's site.ENABLE_USER_SITE is True, so we add the user site directory 'ú'z]Python's site.ENABLE_USER_SITE is not True, so we do not add the Python site user directory 'ÚJUPYTER_PATHzJUPYTER_PATH is set to 'z'', which is prepended to the data pathszHJUPYTER_PATH is not set, so we do not prepend anything to the data pathsÚJUPYTER_DATA_DIRzJUPYTER_DATA_DIR is set to 'z3', overriding the default user-level data directoryzLJUPYTER_DATA_DIR is not set, so we use the default user-level data directoryÚJUPYTER_RUNTIME_DIRzJUPYTER_RUNTIME_DIR is set to 'z+', overriding the default runtime directoryzGJUPYTER_RUNTIME_DIR is not set, so we use the default runtime directoryz    )Úfilez>
Please specify a subcommand or one of the optional arguments.r,   é   z Error executing Jupyter command z: )*r<   rO   r]   rg   ry   rŽ   rW   rN   Úparse_known_argsr-   ÚversionÚprintr
   Ú
__import__r   Újsonr	   re   ÚdebugÚ
config_dirÚjupyter_config_dirÚdata_dirÚjupyter_data_dirÚruntime_dirÚjupyter_runtime_dirÚjupyter_config_pathÚjupyter_pathÚdumpsÚuse_platform_dirsÚprefer_environment_over_userrz   ÚsiteÚENABLE_USER_SITEÚgetuserbaserX   Ú
print_helpÚstderrru   ro   r   rl   rL   )r9   r]   r-   r3   Ú_optsÚpackager¬   Úmodr¡   ÚenvrM   r[   rk   ÚcommandÚes                  r   ÚmainrÇ   ã   sŸ  € åÑÔ€FÝŒ8€DØ€JØ�œÐ#Ð#Ý$ VÑ,Ô,ˆØ˜!”Wˆ
‰
Ý	ˆT‰Œ�QŠˆ˜t Aœw×1Ò1°#Ñ6Ô6ˆð ˜!”Wˆ
‰
à×-Ò-Ñ/Ô/‰ˆˆeØ”_ˆ
ØŒ<ð 	ÝÐ5Ñ6Ô6Ð6ðð 2ð 2�ð.Ø .Ò0Ð0Ý"-˜˜å(¨Ñ1Ô1˜Ø"%¤/˜øøÝ"ð .ð .ð .Ø-�G�G�Gð.øøøå˜Ð'Ð'Ð'Ð'¨Ñ1Ô1Ð1Ð1ØˆFØŒ9ð 	9˜TœZð 	9ÝŒHÐ7Ñ8Ô8Ð8ØŒ:ð 	:˜dœjð 	:ÝŒHÐ8Ñ9Ô9Ð9ØŒ:ð 	;˜$œ)ð 	;ÝŒHÐ9Ñ:Ô:Ð:ØŒ?ð 	Ý•%Ô*Ñ,Ô,Ñ-Ô-Ð-ØˆFØŒ=ð 	Ý•%Ô(Ñ*Ô*Ñ+Ô+Ð+ØˆFØÔð 	Ý•%Ô+Ñ-Ô-Ñ.Ô.Ð.ØˆFØŒ:ñ f	ØˆDÝ$Ô8Ñ:Ô:Ð;ˆD�‰OÝ"Ô6Ñ8Ô8ˆD�‰NÝ Ô-Ñ/Ô/ˆD�‰LØŒyð `*Ý•d”j Ñ&Ô&Ñ'Ô'Ð'Ñ'à”:ñ WÝœ*�CåÔ.Ñ0Ô0ð Ýð Iñô ð ð õ ð _ñô ð õ Ô9Ñ;Ô;ð Ýð tñô ð ð õ ð {ñô ð ð
 —w’wÐ2Ñ3Ô3ð ÝØuñô ð ð õ Øcñô ð ð —w’wÐ4Ñ5Ô5ð Ýð n¸c¿gºgÐF[Ñ>\Ô>\ð  nð  nð  nñô ð ð õ Øoñô ð ð —w’wÐ3Ñ4Ô4ð Ýð R¸S¿WºWÐEYÑ=ZÔ=Zð  Rð  Rð  Rñô ð ð õ Ønñô ð õ Ô,ð ÝØÕjnÔjzÑj|Ôj|ÐÐÐñô ð ð õ ð Rõ  }Aô  }Mñ  }Oô  }Oð  Rð  Rð  Rñô ð ð
 —w’w˜~Ñ.Ô.ð ÝØw°s·w²w¸~Ñ7NÔ7NÐwÐwÐwñô ð ð õ Øfñô ð ð —w’wÐ1Ñ2Ô2ð Ýð L¸3¿7º7ÐCUÑ;VÔ;Vð  Lð  Lð  Lñô ð ð õ Øjñô ð ð
 —w’wÐ4Ñ5Ô5ð Ýð J¸c¿gºgÐF[Ñ>\Ô>\ð  Jð  Jð  Jñô ð ð õ Øeñô ð õ ‘G”G�Gå" 4™LœLð *ð *�DØ œ:�DÝ˜T˜*˜*˜*Ñ%Ô%Ð%Ø!ð *ð *˜Ý˜f q™jÑ)Ô)Ð)Ð)ð*àˆFàð TØ×Ò�sœzÐÑ*Ô*Ð*ÝŒÐRÑSÔSÐSðÝ" :Ñ.Ô.ˆˆøÝð ð ð Ø×Ò�sœzÐÑ*Ô*Ð*à˜ÒÐØˆFˆFˆFˆFˆFÝŒ•�Q‘”ÑÔÐÐÐÐÐÐøøøøðøøøðIÝ�˜'Ð- D¨¨¨¤HÐ-Ñ.Ô.Ð.Ð.Ð.øÝð Ið Ið IÝŒÐG°JÐGÐGÀAÐGÐGÑHÔHÐHÐHÐHÐHÐHÐHÐHøøøøðIøøøsH   Â5$CÃC)Ã(C)ÕU- Õ-
WÕ7&W	Ö#!W	×	W×W/ ×/
X×9XØXÚ__main__)r   r   )r   r=   )r\   r   r]   r=   r   r   )r-   r   r   r   )r9   r   r   r=   r    ) r$   Ú
__future__r   Úargparser_   r¯   rg   r¼   rO   r|   Úpathlibr   Úshutilr   Ú
subprocessr   Útypingr   Ú r	   r¬   r
   ÚArgumentParserr   r<   r   rl   ru   rI   rŽ   rÇ   r!   r   r   r   ú<module>rÑ      s¸  ððð ð #Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø €€€Ø 	€	€	€	Ø €€€Ø 
€
€
€
Ø Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  ðð ð ð ð �HÔ+ñ ô ð ð4ð ð ð ð<ð ð ð ð>ð ð ð ð0ð ð ð ð(#ð #ð #ð #ðLð ð ð ð>qIð qIð qIð qIðh ˆzÒÐØ€D�F„F€F€F€Fð Ðr   