
    Mhcs                     :   U d 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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 ddlmZ ddl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' d
dl(m)Z) d
dl*m+Z+ d
dl,m-Z. d
dl,m/Z/ d
dl0m1Z1 	 ddl2m3Z3 n# e4$ r dZ3Y nw xY w	 ddl5m6Z7 ddl5m8Z9 dZ:n# e4$ r dZ:Y nw xY wdZ;d Z< ej=                    Z>da?e
j@        e%         eAd<   d ZBe<e_C        eBe_D         G d de.          ZE G d deE          Z-dS ) z!The IPython kernel implementation    N)contextmanager)partial)release)line_at_cursortoken_at_cursor)extract_header)AnyBool	HasTraitsInstanceListTypeobserveobserve_compat)	ZMQStream   BaseComm)CommManager)XCachingCompiler)_use_appnope)	OutStream)Kernel)_accepts_parameters)ZMQInteractiveShell)_asyncio_runner)provisionalcompleter)rectify_completionsTF_jupyter_types_experimentalc                      t          | i |S )zCreate a new Comm.r   argskwargss     R/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipykernel/ipkernel.py_create_commr%   0   s    T$V$$$    _comm_managerc                      t           2t          5  t           t          | i |a ddd           n# 1 swxY w Y   t           S )zCreate a new CommManager.N)r'   
_comm_lockr   r!   s     r$   _get_comm_managerr*   :   s      	= 	=$ +T <V < <	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= s   /33c                       e Zd ZdZ edd          Z ee          Z e	dd          
                    d          Z eed          Z e            Z ed          ed	                         Z eed
d          Z ed          ed                         Z e            Z e            Z fdZ eddej        d
d         z  dddddddddddddddddddg          
                    d          ZdZej        Z d ej        !                                d!         d"dej        d!         d#d$d%z  d d&d'Z"d( Z#e$d)             Z%d* Z& fd+Z'dI fd-	Z( fd.Z)d/ Z*dJd1Z+d2 Z,e$d3             Z-e-j.        d4             Z-e/d5             Z0 fd6Z1	 	 	 dKd
d
d7d8Z2d9 Z3d: Z4d; Z5dLd=Z6	 	 	 	 	 	 dMd>Z7d? Z8d@ Z9dA Z:dB Z;dC Z<dD Z=dEe>j?        dF         dGe>j@        eAe>j        f         fdHZB xZCS )NIPythonKernelzThe IPython Kernel class.z1IPython.core.interactiveshell.InteractiveShellABCT)
allow_nonezUSet this flag to False to deactivate the use of experimental IPython completion APIs.)help)configuser_modulec                 <    | j         |d         | j         _        d S d S Nnew)shellr0   selfchanges     r$   _user_module_changedz"IPythonKernel._user_module_changedW   s(     :!%+E]DJ""" "!r&   N)r"   r-   user_nsc                 n    | j         -|d         | j         _        | j                                          d S d S r2   )r4   r9   init_user_nsr5   s     r$   _user_ns_changedzIPythonKernel._user_ns_changed_   s<     :!!'DJJ##%%%%% "!r&   c                     t                      j        di | ddlm}m} |r3 || j        | j        | j        | j        | j	        | j
                  | _        | j                            | | j        | j        | j        | t                     | _        | j	        | j        j        _	        t&          j                            d          }|r|| j        j        d<   | j        | j        j        _        |                     d          | j        j        _        | j	        | j        j        _	        | j        | j        j        _        t7          j                    | _        t=          | j        t>                    sJ | j        j         !                    | j                   g d}|D ]}tE          | j        |          | j#        |<    tI                      r| j%        rdd	l&}|'                                 i | _(        | )                                 tU          tV          d
          r&tV          j,        !                    | j-                   d	S d	S )zInitialize the kernel.r   )Debugger_is_debugpy_available)parentprofile_dirr0   r9   kernelcompiler_classJPY_SESSION_NAME__session__execute_result)	comm_opencomm_msg
comm_closer   N	callbacks ).super__init__debuggerr>   r?   logdebugpy_stream_publish_debug_eventdebug_shell_socketsessiondebug_just_my_codeshell_classinstancerA   r0   r9   r   r4   displayhookosenvirongetiopub_socket
pub_socket_topictopicdisplay_pubcommget_comm_managercomm_manager
isinstancer   configurablesappendgetattrshell_handlersr   _darwin_app_napappnopenope_new_threads_parent_header_initialize_thread_hookshasattrgcrJ   _clean_thread_parent_frames)	r6   r#   r>   r?   jupyter_session_namecomm_msg_typesmsg_typeri   	__class__s	           r$   rM   zIPythonKernel.__init__k   s>   ""6"""======== ! 	$H#)'' DM %..((L+ / 
 

 *.
&!z~~.@AA 	E0DDJ}-,0,=
)'+{{3C'D'D
$)-
&,0,=
) 133$+Y77777
 ''(9:::@@@& 	Q 	QH,3D4Ex,P,PD))>> 	d2 	NNNLLNNN*,'%%'''2{## 	B L @AAAAA	B 	Br&   zPython Referencezhttps://docs.python.org/%i.%i   )texturlzIPython Referencez&https://ipython.org/documentation.htmlzNumPy Referencez+https://docs.scipy.org/doc/numpy/reference/zSciPy Referencez+https://docs.scipy.org/doc/scipy/reference/zMatplotlib Referencez$https://matplotlib.org/contents.htmlzSymPy Referencez'http://docs.sympy.org/latest/index.htmlzpandas Referencez-https://pandas.pydata.org/pandas-docs/stable/ipythonpythonr   ztext/x-python)nameversionz	ipython%d   z.py)ry   rz   mimetypecodemirror_modepygments_lexernbconvert_exporterfile_extensionc                     ddl m} |r\|d         j                            d          }| j                            d|           | j         j                            |           d S d S )Nr   r?   zutf-8zDebugpy received: %s)rN   r?   bytesdecoderO   debug
tcp_clientreceive_dap_frame)r6   msgr?   frames       r$   dispatch_debugpyzIPythonKernel.dispatch_debugpy   su    333333  	>FL''00EHNN15999M$66u=====		> 	>r&   c                 ,    | j         r| j         j        S d S N)r4   bannerr6   s    r$   r   zIPythonKernel.banner   s    : 	%:$$tr&   c                 H   K   	 | j                                          d{V   )zPoll the stopped queue.TN)rN   handle_stopped_eventr   s    r$   poll_stopped_queuez IPythonKernel.poll_stopped_queue   s6      	7-44666666666	7r&   c                 r   | j         rd| j         _        | j        | j                            d           n!| j                            | j        d           t                                                       | j        r8t          j
        |                                 | j        j        j                   dS dS )zStart the kernel.FNz7debugpy_stream undefined, debugging will not be enabledcopy)r4   exit_nowrP   rO   warningon_recvr   rL   startasynciorun_coroutine_threadsafer   control_threadio_loopasyncio_loop)r6   rs   s    r$   r   zIPythonKernel.start   s    : 	("'DJ&HVWWWW''(=E'JJJ 	,''))4+>+F+S    	 	r&   r4   c                     t                                          |||           |dk    r#| j        r| j                            |           dS dS dS )zmOverridden from parent to tell the display hook and output streams
        about the parent message.
        r4   N)rL   
set_parentr4   )r6   identr@   channelrs   s       r$   r   zIPythonKernel.set_parent   s]     	5&'222g$*J!!&))))) r&   c                     t                                          |          }|                    d| j        d           |S )zVInitialize metadata.

        Run at the beginning of each execution request.
        T)dependencies_metengine)rL   init_metadataupdater   )r6   r@   mdrs   s      r$   r   zIPythonKernel.init_metadata   sM    
 WW""6** 			$(* 	
 	
 	
 	r&   c                 V    |d         |d<   |d         dk    r|d         dk    rd|d<   |S )zXFinish populating metadata.

        Run after completing an execution request.
        statuserrorenameUnmetDependencyFr   rK   )r6   r@   metadatareply_contents       r$   finish_metadatazIPythonKernel.finish_metadata  sC     +84"g---2HL]2]2]+0H'(r&   Fc                     || _         t          j        | _        | j        t          _        t
          j        | _        | j        t
          _        dS )zZForward raw_input and getpass to the current frontend.

        via input_request
        N)_allow_stdinbuiltinsinput_sys_raw_input	raw_inputgetpass_save_getpass)r6   allow_stdins     r$   _forward_inputzIPythonKernel._forward_input  s6    
 (&n$_,r&   c                 J    | j         t          _        | j        t          _        dS )zRestore raw_input, getpassN)r   r   r   r   r   r   s    r$   _restore_inputzIPythonKernel._restore_input(  s    ,,r&   c                 ,    | j         r| j         j        S d S r   )r4   execution_countr   s    r$   r   zIPythonKernel.execution_count.  s    : 	.:--tr&   c                     d S r   rK   )r6   values     r$   r   zIPythonKernel.execution_count4  s	     	r&   c              #      K   t          j                    d }                    t          ||                     |                    t          |                      fd}t	          j        t          j        |          }	 dV  t	          j        t          j        |           dS # t	          j        t          j        |           w xY w)aP  ContextManager for capturing SIGINT and cancelling a future

        SIGINT raises in the event loop when running async code,
        but we want it to halt a coroutine.

        Ideally, it would raise KeyboardInterrupt,
        but this turns it into a CancelledError.
        At least it gets a decent traceback to the user.
        c                     |                                  s|                                 rd S |                                  d S r   )	cancelleddonecancel)f_ignoreds     r$   cancel_unless_donez;IPythonKernel._cancel_on_sigint.<locals>.cancel_unless_doneI  s7    {{}}  HHJJJJJr&   c                  F    fd}j                             |           d S )Nc                                                        s                                 rd S                      d           d S )Nr   )r   r   
set_result)sigint_futures   r$   set_sigint_resultzQIPythonKernel._cancel_on_sigint.<locals>.handle_sigint.<locals>.set_sigint_resultV  sI     **,, 0B0B0D0D F((+++++r&   )r   add_callback)r"   r   r6   r   s     r$   handle_sigintz6IPythonKernel._cancel_on_sigint.<locals>.handle_sigintU  s;    , , , , , L%%&788888r&   N)r   Futureadd_done_callbackr   signalSIGINT)r6   futurer   r   save_sigintr   s   `    @r$   _cancel_on_sigintzIPythonKernel._cancel_on_sigint:  s       .5^-=-=	 	 	 	''0BF(K(KLLL 	  );]!K!KLLL	9 	9 	9 	9 	9 	9 mFM=AA	6EEE M&-55555FM&-5555s   B, ,!Cc                    K   t          |          }|                     |           t                                          |||           d{V  dS )z/Override for cell output - cell reconciliation.N)r   %_associate_new_top_level_threads_withrL   execute_request)r6   streamr   r@   parent_headerrs   s        r$   r   zIPythonKernel.execute_requestf  s\      &v..22=AAAgg%%feV<<<<<<<<<<<r&   )	cell_metacell_idc                :  K   | j         J |                     |           i }t          d          r0t          d          r j        }	j        }
t          |	dg          }nd }
fd}	t          j        dg          }	 d}	                     |          }n%# t          $ r |}t          j
                    }Y nw xY wt          r.j        t          u rt          j                                                    r |
|||          r|d         r |	||||||          }n |	|||||	          }t          j        |          }|                     |          5  d}	 | d{V }j                            d
           |sj                            d|           n=# j                            d
           |sj                            d|           w w xY wddd           n# 1 swxY w Y   n:|d         r                    ||||          }n                    |||          }|                                  n# |                                  w xY w|j        |j        n|j        }|j        rd|d<   nrd|d<   |                    j        pg t5          t7          |          j                  t5          |          d           t;          | j        | j        d          }||d<   j         dz
  |d<   d|v r4| j!        "                    dd#                    |d                              |d         dk    r$                    |pi           |d<   ni |d<   j%        &                                |d<   j%        '                                 |S )zHandle code execution.Nrun_cell_asyncshould_run_asyncr   c                     dS )NFrK   )cells    r$   <lambda>z*IPythonKernel.do_execute.<locals>.<lambda>  s    E r&   c                  "   K    j         | i |S r   )run_cell)r"   r#   r4   s     r$   r   z*IPythonKernel.do_execute.<locals>.run_cell  s      %u~t6v666r&   )transformed_cellpreprocessing_exc_tuple)store_historysilentr   r   r   )r   r   r   r   post_executepost_run_cell)r   r   r   )r   r   okr   r   	tracebackr   evalueexecuteengine_uuid	engine_idmethodengine_infor   r   r   z Exception in execute request:
%s
user_expressionspayload)(r4   r   rm   r   r   r   r   transform_cell	Exceptionsysexc_infor   loop_runnerr   get_event_loop
is_runningensure_futurer   eventstriggerr   error_before_execerror_in_execsuccessr   _last_tracebackstrtype__name__dictr   int_idr   rO   infojoinr   payload_managerread_payloadclear_payload)r6   coder   r   r   r   r   r   r   r   r   accepts_paramsr   r   corocoro_futurereserre_infor4   s                      @r$   
do_executezIPythonKernel.do_executel  s      
   K(((,.5*++ 	N?Q0R0R 	N+H$50I;GGNN117 7 7 7 7 1)MMN?	" '+#9#(#7#7#=#=   9 9 9#' *-,..'''9
  2[%88*,,7799 9$$%5,C   9 "), #8&3%)90G '  DD $8&3%)90G  D &3D99++K88 G GCG$///////,,^<<<% G!L00#FFF ,,^<<<% G!L00#FFFFGG G G G G G G G G G G G G G G "), [..&3% '	 )  CC  ..]SY.ZZC!!!!D!!!!'*'<'Hc##cN_; 	2&*M(##&-M(#  !&!6!<" c!344!#hh    djDKPYZZZF+1M-( ,1+@1+D'(-''HMM3		-455   "d**050F0FGWG][]0^0^M,-- 13M,-
 $)#8#E#E#G#Gi  	++---sm   I B I C =I ?C  B I  G-$F$,8G-$:GG-!I -G11I 4G15>I Ic                    t           r| j        r|                     ||          S |t          |          }t	          ||          \  }}||z
  }| j        J | j                            d||          \  }}|||t          |          z
  i ddS )zHandle code completion.N r   matches
cursor_endcursor_startr   r   )_use_experimental_60_completionuse_experimental_completions_experimental_do_completelenr   r4   complete)r6   r  
cursor_poslineoffsetline_cursortxtr  s           r$   do_completezIPythonKernel.do_complete  s    * 	Dt/P 	D11$
CCC
 TJ%dJ77f 6)z%%%z**2t[AAW$&S1
 
 	
r&   c                 Z   K   ddl m} |r | j                             |           d{V S dS )zHandle a debug request.r   r   N)rN   r?   process_request)r6   r   r?   s      r$   do_debug_requestzIPythonKernel.do_debug_request  sM      333333  	<66s;;;;;;;;;tr&   c                    |t          |          }t                      5  | j        J | j        j                            ||          }t          t          ||                    }g }|D ]B}|                    t          |j	        |j
        |j        |j        |j                             C	 ddd           n# 1 swxY w Y   |r'|d         j	        }|d         j
        }d |D             }	n|}|}g }	|	||t          |iddS )zD
        Experimental completions from IPython, using Jedi.
        N)r   endru   r  	signaturer   c                     g | ]	}|j         
S rK   )ru   ).0cs     r$   
<listcomp>z;IPythonKernel._experimental_do_complete.<locals>.<listcomp>2  s    333!qv333r&   r   r  )r!  _provisionalcompleterr4   	Completercompletionslist_rectify_completionsre   r	  r   r-  ru   r  r.  _EXPERIMENTAL_KEY_NAME)
r6   r  r#  raw_completionsr5  compscompser  s
             r$   r   z'IPythonKernel._experimental_do_complete  s    TJ"$$ 	 	:)))"j2>>tZPPO3D/JJKKKE# 	 	"j H!Y!Y"&.     		 	 	 	 	 	 	 	 	 	 	 	 	 	 	"  	A$AA"A33{333GGAAG /7
 
 	
s   BB;;B?B?rK   c                    t          ||          }ddi}i |d<   i |d<   | j        J 	 t          j        dk    r| j                            |||          }n| j                            ||          }|d                             |           | j        j        s|d                             d	           d
|d<   n# t          $ r d|d<   Y nw xY w|S )zHandle code inspection.r   r   datar   N)   )detail_levelomit_sections)rA  z	text/htmlTfoundF)	r   r4   r   version_infoobject_inspect_mimer   enable_html_pagerpopKeyError)r6   r  r#  rA  rB  ry   r   bundles           r$   
do_inspectzIPythonKernel.do_inspect@  s   tZ00-5t,< "f$&j!z%%%	+#t++ 77!-"/ 8   77<7XX&!((000:/ 7f%))+666%)M'"" 	+ 	+ 	+%*M'"""	+ s   BB; ;CCc
                 <   | j         J |dk    r$| j         j                            |||d          }
nX|dk    r%| j         j                            |||||          }
n-|dk    r%| j         j                            |||||	          }
ng }
d	t          |
          d
S )zHandle code history.NtailT)rawoutputinclude_latestrange)rM  rN  search)rM  rN  nuniquer   )r   history)r4   history_managerget_tail	get_rangerQ  r6  )r6   hist_access_typerN  rM  rS   r   stoprR  patternrS  hists              r$   
do_historyzIPythonKernel.do_history\  s     z%%%v%%:-66s6$ 7  DD ((:-77#f 8  DD )):-44S1V 5  DD D Dzz
 
 	
r&   c                 J    | j         rd| j         _        t          d|          S )zHandle kernel shutdown.Tr   )r   restart)r4   r   r	  )r6   r^  s     r$   do_shutdownzIPythonKernel.do_shutdown  s)    : 	'"&DJ41111r&   c                     t          | j        dd          }|| j        J | j        j        }|                    |          \  }}d|i}|dk    rd|z  |d<   |S )zHandle an is_complete request.input_transformer_managerNr   
incomplete indent)rf   r4   input_splittercheck_complete)r6   r  transformer_managerr   indent_spacesrs         r$   do_is_completezIPythonKernel.do_is_complete  sv    %dj2MtTT&:)))"&*"; 3 B B4 H Hv\!!-AhKr&   c           	         	 ddl m}m} n# t          $ r ddlm}m} Y nw xY w| j        }|J 	 |j        }dt          |                              dd          z   dz   }	 |||d	          \  }
}}t          |
d
d          }|	dz   }|	dz   }|	dz   }|	dz   }||
|||||di}|
                    |           | d| d| d| d}	 t          ||j        |j                   |                    |          }|D ]}|                    |           n# |D ]}|                    |           w xY w| j        J  ||| j        j        | j        j                  }ddi}n# t$          $ r}|                                 |j        pg t          t+          |          j                  t          |          d}t/          | j        | j        d          }||d<   |                     | j        d||                     d                     | j                            dd                    |d                              g }d|d<   Y d}~nd}~ww xY w||fS )zHandle an apply request.r   )serialize_objectunpack_apply_messager   N_-r  Fr   r  r   r"   r#   resultz = z(*z,**))buffer_thresholditem_thresholdr   r   r   applyr   r   r   r   zException in apply request:
%sr   r   ) ipyparallel.serializerl  rm  ImportError	serializer4   r9   r  replacerf   r   execuser_global_nsrZ   rG  rS   rr  rs  BaseExceptionshowtracebackr  r  r  r	  r   r
  send_responser[   r]   rO   r  r  )r6   contentbufsmsg_idreply_metadatarl  rm  r4   workingprefixr   r"   r#   fnameargname	kwargname
resultnamensr  rp  key
result_bufr   r=  r  s                            r$   do_applyzIPythonKernel.do_apply  s,   	JTTTTTTTTT 	J 	J 	JIIIIIIIIII	J 
   5	-mG3v;;..sB777#=F224uMMMOAtVAz3//ESLEvoG)I(*JGT9fj$OBNN2 FFUFFgFF)FFFD%T5/??? Z00 % %CKK$$$$%2 % %CKK$$$$% <+++))!%!>#|:  J8 &t,MM-  	. 	. 	.!!!"28bT!WW-..a&& M djDKPWXXXF+1M-(!kk'**	     HMM;TYY}U`Ga=b=bcccJ&-M(######)	.0 j((s=      BE 0D 4E D++.E 
I(CIIc                 d    | j         r| j                             d           t          d          S )zClear the kernel.Fr   )r   )r4   resetr	  r   s    r$   do_clearzIPythonKernel.do_clear  s3    : 	$JU###4    r&   c                     || _         dS )zBStore the parent header to associate it with new top-level threadsN)rk   )r6   r   s     r$   r   z3IPythonKernel._associate_new_top_level_threads_with  s    *7'''r&   c                 0   | j         | j        t          j                    | t          j        j        t          j        j        dt          j        ffd}dt          j        ffd}|t          j        _        |t          j        _        dS )z=Store thread hierarchy and thread-parent_header associations.r6   c                     	 | j         }n# t          $ r Y dS w xY wfD ]A}t          |t                    r*|k    rj        |j        | j        <   2||j        | j        <   B |            dS )aY  Wrap the `threading.Thread.start` to intercept thread identity.

            This is needed because there is no "start" hook yet, but there
            might be one in the future: https://bugs.python.org/issue14073

            This is a no-op if the `self._stdout` and `self._stderr` are not
            sub-classes of `OutStream`.
            N)_ipykernel_parent_thread_identAttributeErrorrc   r   rk   _thread_to_parent_headerr   _thread_to_parent)r6   r@   r   _threading_Thread_runrB   kernel_thread_identstderrstdouts      r$   run_closurez;IPythonKernel._initialize_thread_hooks.<locals>.run_closure  s    <!   !6* F Ffi00 F!444 #= 7 J  @F0<!!$'''''s    
c                 P     | g|R i | t          j                    | _        d S r   )	threading	get_identr  )r6   r"   r#   _threading_Thread__init__s      r$   init_closurez<IPythonKernel._initialize_thread_hooks.<locals>.init_closure   s;    %%d<T<<<V<<<2;2E2G2GD///r&   N)_stdout_stderrr  r  ThreadrunrM   )	r6   r  r  r  r  rB   r  r  r  s	      @@@@@@r$   rl   z&IPythonKernel._initialize_thread_hooks  s    '133 ) 0 4$-$4$=!	(i. 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(0	Hy/ 	H 	H 	H 	H 	H 	H %1	!*	r&   phase)r   rY  r  c                    |dk    rdS d t          j                    D             }| j        | j        fD ]}t	          |t
                    r|j        }t          |                                          D ]}||vr	 ||= # t          $ r Y w xY w|j
        }t          |                                          D ]}||vr	 ||= # t          $ r Y w xY wdS )a  Clean parent frames of threads which are no longer running.
        This is meant to be invoked by garbage collector callback hook.

        The implementation enumerates the threads because there is no "exit" hook yet,
        but there might be one in the future: https://bugs.python.org/issue14073

        This is a no-op if the `self._stdout` and `self._stderr` are not
        sub-classes of `OutStream`.
        r   Nc                     h | ]	}|j         
S rK   ru  )r0  threads     r$   	<setcomp>z<IPythonKernel._clean_thread_parent_frames.<locals>.<setcomp>  s    KKK6&,KKKr&   )r  	enumerater  r  rc   r   r  r6  keysrH  r  )r6   r  r  active_threadsr   thread_to_parent_headeridentitythread_to_parents           r$   ro   z)IPythonKernel._clean_thread_parent_frames  sA    GFKKY5H5J5JKKK|T\2 	! 	!F&),, !*0*I' $%<%A%A%C%C D D ! !H~55! 7 A A' ! ! ! D! 6
 $*#;  $%5%:%:%<%< = = ! !H~55! 0 : :' ! ! ! D! 6	! 	!s$   :A>>
B
B>C
CC)r4   )F)TNF)r   rK   )r   r   NNNF)Dr  
__module____qualname____doc__r   r4   r   r   rU   r
   tagr  r   rP   r	   r0   r   r   r8   r	  r9   r<   r   _sys_eval_inputrM   r   r   rD  
help_linksimplementationr   rz   implementation_versionsplitlanguage_infor   propertyr   r   r   r   r   r   r   r   r   setterr   r   r   r  r(  r+  r   rJ  r\  r_  rj  r  r  r   rl   tLiteralDictr  ro   __classcell__rs   s   @r$   r,   r,   H   s       ##HHUYZZZE$*++K#'4d$ $ $ 
cc !
 XiD999N#%%KW]3 3 ^ 3 ht$4888GWY& & ^ & SUUNceeO9B 9B 9B 9B 9Bv  +69I"1"9MM 
 ,? 
 *D 
 *D 
 /= 
 *@ 
 +F 3	
 > 
cc? D N$_;$$&&q)#$-#:J1:MNN%/& M> > >   X
7 7 7
    * * * * * *       ' ' ' '- - -   X
   
 )6 )6 ^)6V= = = = = L L L L L L\
 
 
,  &
 &
 &
P   B 
"
 "
 "
 "
H2 2 2  @) @) @)D! ! !8 8 8&+ &+ &+P!Y/!78vc15j7I! ! ! ! ! ! ! !r&   r,   c                   "     e Zd ZdZ fdZ xZS )r   z3DEPRECATED.  An alias for the IPython kernel class.c                 |    ddl }|                    dt          d            t                      j        |i | dS )zDEPRECATED.r   Nz@Kernel is a deprecated alias of ipykernel.ipkernel.IPythonKernelrt   )
stacklevel)warningswarnDeprecationWarningrL   rM   )r6   r"   r#   r  rs   s       r$   rM   zKernel.__init__/  sT    N 	 	
 	
 	

 	$)&)))))r&   )r  r  r  r  rM   r  r  s   @r$   r   r   ,  s>        ==	* 	* 	* 	* 	* 	* 	* 	* 	*r&   r   )Fr  r   r   rn   r   rX   r   r   r  typingr  
contextlibr   	functoolsr   r`   IPython.corer   IPython.utils.tokenutilr   r   jupyter_client.sessionr   	traitletsr	   r
   r   r   r   r   r   r   zmq.eventloop.zmqstreamr   	comm.commr   comm.managerr   compilerr   
eventloopsr   iostreamr   
kernelbaser   
KernelBaser   zmqshellr   IPython.core.interactiveshellr   rw  IPython.core.completerr   r3  r   r7  r  r8  r%   Lockr)   r'   Optional__annotations__r*   create_commra   r,   rK   r&   r$   <module>r     s
   ' ' '   				  				  



         % % % % % %                    C C C C C C C C 1 1 1 1 1 1 Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y - - - - - -       % % % % % % & & & & & & $ $ $ $ $ $       , , , , , , + + + + + + ) ) ) ) ) )=======   OOO,TTTTTTRRRRRR&*## , , ,&+###, 7 % % % Y^
)-qz+& - - -     ) ^! ^! ^! ^! ^!J ^! ^! ^!H* * * * *] * * * * *s$   B B('B(,B; ;CC