
    Mhx              	       `   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m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 dd	lmZ dd
lmZmZ ddlmZ ddlmZ ddlmZ dej         e!e!f         ddfdZ"ddej#        dej#        de!dej#        fdZ$ G d de          Z% ej&        e%           dS )z:Base class to manage the interaction with a running kernel    N)partial)getpass)Empty)ensure_async)AnyBoolInstanceType   )major_protocol_version)
ChannelABCHBChannelABC)KernelClientABC)ConnectionFileMixin)Sessiondctreturnc                     |                                  D ]S\  }}t          |t                    st          d|z            t          |t                    st          d|z            TdS )z]Validate that the input is a dict with string keys and values.

    Raises ValueError if not.zkey %r in dict must be a stringz!value %r in dict must be a stringN)items
isinstancestr
ValueError)r   kvs      U/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/jupyter_client/client.pyvalidate_string_dictr      s     		 F F1!S!! 	D>BCCC!S!! 	F@1DEEE	FF F    shellwrappedmethchannelc                 &    | ||          } |j         s| S |j                             dd          \  }}|                                g}d|vr|                    d           |                    d           d                    |          | _         | S )NzReturns
r   
Parametersz/
        Parameters
        ----------
        a  
        reply: bool (default: False)
            Whether to wait for and return reply
        timeout: float or None (default: None)
            Timeout to use when waiting for a reply

        Returns
        -------
        msg_id: str
            The msg_id of the request sent, if reply=False (default)
        reply: dict
            The reply message for this request, if reply=True
    
)__doc__splitstripappendjoin)r   r    r!   basedoc_partss         r   reqrepr-   &   s    gdG$$G<  ##K33JGQ]]__E7""	
 	
 	
 
LL	   ii&&GONr   c                       e Zd ZU dZ eej                  Z ed          Z	dej        fdZ
 ee          Z ee          Z ee          Z ee          Z ee          Z e            Z e            Z e            Z e            Z e            ZdZeed<   dE fdZd	ej        d
ej        dej        eej        f         fdZ d	ej        d
ej        dej        eej        f         fdZ!d	ej        d
ej        dej        eej        f         fdZ"d	ej        d
ej        dej        eej        f         fdZ#dFdej$        e%         ddfdZ&	 dGdedej$        e%         dedej        eej        f         fdZ'dej        eej        f         ddfdZ(dej        eej        f         ddfdZ)de*dej+        j,        j-        dej        dej        eej        f         ddf
dZ.	 	 	 	 	 dHdedededededdfd Z/dEd!Z0e1defd"            Z2dZ3e1dej        fd#            Z4e1dej        fd$            Z5e1dej        fd%            Z6e1dej        fd&            Z7e1dej        fd'            Z8defd(Z9	 	 	 	 	 	 	 	 dId)ed*ed+ed,ej$        ej        eej        f                  dej$        e         d-edej$        e%         d.ej$        ej:                 d/ej$        ej:                 dej        eej        f         fd0Z;	 	 	 	 	 dJd)ed*ed+ed,ej$        ej        eej        f                  dej$        e         d-edefd1Z<dFd)ed2ej$        e=         defd3Z>dKd)ed2ej$        e=         d5e=defd6Z?	 	 	 dLd8ed9ed:ed
ej        def
d;Z@defd<ZAdFd=ej$        e         defd>ZBdej        eej        f         ddfd?ZCd)edefd@ZDdAeddfdBZEdMdCedefdDZF xZGS )NKernelClienta  Communicates with a single kernel on any host via zmq channels.

    There are five channels associated with each kernel:

    * shell: for request/reply calls to the kernel.
    * iopub: for the kernel to publish results to frontends.
    * hb: for monitoring the kernel's heartbeat.
    * stdin: for frontends to reply to raw_input calls in the kernel.
    * control: for kernel management calls to the kernel.

    The messages that can be sent on these channels are exposed as methods of the
    client (KernelClient.execute, complete, history, etc.). These methods only
    send the message, they don't wait for a reply. To get results, use e.g.
    :meth:`get_shell_msg` to fetch messages from the shell channel.
    Fr   c                 6    d| _         t          j                    S )NT)_created_contextzmqContextselfs    r   _context_defaultzKernelClient._context_default_   s     ${}}r   Tallow_stdinNc                 d   | j         rx| j        q| j        j        se| j        r#| j        r| j                            d|            n;| j        r| j                            d|            | j                                         	 t                      j	        } |             dS # t          $ r Y dS w xY w)z:Handle garbage collection.  Destroy context if applicable.Nz$Could not destroy zmq context for %szDestroying zmq context for %s)r1   contextclosedchannels_runninglogwarningdebugdestroysuper__del__AttributeError)r5   	super_del	__class__s     r   rA   zKernelClient.__del__t   s     !	'(L' ) $ '8 SH$$%KTRRR8 JHNN#BDIII$$&&&	I IKKKKK  	 	 	DD	s   B! !
B/.B/argskwargsc                 P   K   t           | j        j        |i |           d{V S )z$Get a message from the shell channelN)r   shell_channelget_msgr5   rE   rF   s      r   _async_get_shell_msgz!KernelClient._async_get_shell_msg   <      !"<$"4"<d"Mf"M"MNNNNNNNNNr   c                 P   K   t           | j        j        |i |           d{V S )z$Get a message from the iopub channelN)r   iopub_channelrI   rJ   s      r   _async_get_iopub_msgz!KernelClient._async_get_iopub_msg   rL   r   c                 P   K   t           | j        j        |i |           d{V S )z$Get a message from the stdin channelN)r   stdin_channelrI   rJ   s      r   _async_get_stdin_msgz!KernelClient._async_get_stdin_msg   rL   r   c                 P   K   t           | j        j        |i |           d{V S )z&Get a message from the control channelN)r   control_channelrI   rJ   s      r   _async_get_control_msgz#KernelClient._async_get_control_msg   s<      !">$"6">"O"O"OPPPPPPPPPr   timeoutc                   K   |t          d          }t          j                    |z   }ddlm} t	          | j        |          sw|                                  d{V s]t          j                    |k    rt          d|z            t          j	        d           d{V  |                                  d{V ]	 | 
                                 	 t          | j                            d                     d{V }|d	         d
k    rU	 t          | j                            d                     d{V  |                     |           nw# t           $ r Y nw xY wn# t           $ r Y nw xY w|                                  d{V sd}t          |          t          j                    |k    rt          d|z            	 	 t          | j                            d                     d{V }n# t           $ r Y dS w xY wB)a@  Waits for a response when a client is blocked

        - Sets future time for timeout
        - Blocks on shell channel until a message is received
        - Exit if the kernel has died
        - If client times out before receiving a message from the kernel, send RuntimeError
        - Flush the IOPub channel
        Ninfr   KernelManagerz?Kernel didn't respond to heartbeats in %d seconds and timed outg?TrV   msg_typekernel_info_replyz*Kernel died before replying to kernel_infoz#Kernel didn't respond in %d seconds)floattimemanagerrZ   r   parent_async_is_aliveRuntimeErrorasynciosleepkernel_infor   rH   rI   rN   _handle_kernel_info_replyr   )r5   rV   abs_timeoutrZ   msgs        r   _async_wait_for_readyz"KernelClient._async_wait_for_ready   s      ?EllGikkG+******$+}55 		) !0022222222 )9;;,,&Y\cc   mC((((((((( !0022222222 )	T();)C)CA)C)N)NOOOOOOOO z?&999*4+=+E+Ec+E+R+RSSSSSSSSS 66s;;;	 !   	 :     --//////// (B"3''' y{{[(("#H7#RSSS/	T4	();)C)CC)C)P)PQQQQQQQQ   	s6   .E" .E 
EE"
E/.E/
.G9 9
HHr   msg_idr!   c                   K   |t          j                    |z   }	 |$t          d|t          j                    z
            }	 |dk    r|                     |           d{V }n|                     |           d{V }n$# t
          $ r}d}t          |          |d}~ww xY w|d                             d          |k    r|S )	z0Receive and return the reply for a given requestNTr   controlr[   zTimeout waiting for replyparent_headerrk   )r_   	monotonicmaxrU   rK   r   TimeoutErrorget)r5   rk   rV   r!   deadlinereplyeri   s           r   _async_recv_replyzKernelClient._async_recv_reply   s      ~'''1H	"aDN,<,<!<==/i''"&"="=g"="N"NNNNNNNEE"&";";G";"L"LLLLLLLE / / /1"3''Q./ _%))(33v==Ls   ?B 
B$BB$ri   c                   K   |d         }|                     dd          rt          nt          }	  ||d                   }n=# t          $ r d}Y n/t          $ r# t
          j                            d           Y dS w xY w| j        	                                 d{V s6| j
        	                                 d{V s|                     |           dS dS dS )zHandle an input requestcontentpasswordFpromptr$   N)rr   r   inputEOFErrorKeyboardInterruptsysstdoutwriterQ   	msg_readyrH   )r5   ri   rx   rz   raw_datas        r   _stdin_hook_defaultz KernelClient._stdin_hook_default   s     i.#KK
E::E	vgh/00HH 	 	 	HHH  	 	 	JT"""FF	 (2244444444 	!d>P>Z>Z>\>\8\8\8\8\8\8\ 	!JJx     	! 	! 	! 	!s   A A<(A<;A<c                    |d         d         }|d         }|dk    r8t          t          |d                   }|                    |d                    dS |dv r;t          j                            |d                             d	d
                     dS |dk    r:t          j                            d                    |d                              dS dS )z/Default hook for redisplaying plain-text outputheaderr\   rx   streamnametext)display_dataexecute_resultdataz
text/plain errorr$   	tracebackN)getattrr   r   r   rr   stderrr)   )r5   ri   r\   rx   r   s        r   _output_hook_defaultz!KernelClient._output_hook_default  s    x=,i.xS'&/22FLL)))));;;JWV_00rBBCCCCC  JTYYw{';<<===== ! r   sessionsocketrn   c                     |d         d         }|dv r!|                     |||d         |           dS |                     |           dS )z]Output hook when running inside an IPython kernel

        adds rich output support.
        r   r\   )r   r   r   rx   )ra   N)sendr   )r5   r   r   rn   ri   r\   s         r   _output_hook_kernelz KernelClient._output_hook_kernel  s\     x=,BBBLL3y>-LPPPPP%%c*****r   iopubstdinhbrm   c                 6   |r| j                                          |r| j                                         |r!| j                                         d| _        nd| _        |r| j                                         |r| j                                         dS dS )a}  Starts the channels for this kernel.

        This will create the channels if they do not exist and then start
        them (their activity runs in a thread). If port numbers of 0 are
        being used (random ports) then you must first call
        :meth:`start_kernel`. If the channels have been stopped and you
        call this, :class:`RuntimeError` will be raised.
        TFN)rN   startrH   rQ   r7   
hb_channelrT   )r5   r   r   r   r   rm   s         r   start_channelszKernelClient.start_channels"  s       	'$$&&& 	'$$&&& 	%$$&&&#D$D 	$O!!### 	) &&(((((	) 	)r   c                    | j                                         r| j                                          | j                                        r| j                                         | j                                        r| j                                         | j                                        r| j                                         | j                                        r| j                                         dS dS )zwStops all the running channels for this kernel.

        This stops their event loops and joins their threads.
        N)rH   is_alivestoprN   rQ   r   rT   r4   s    r   stop_channelszKernelClient.stop_channels@  s    
 &&(( 	&##%%%&&(( 	&##%%%&&(( 	&##%%%?##%% 	#O  """((** 	( %%'''''	( 	(r   c                 B   | j         r| j                                        p| j        o| j                                        p_| j        o| j                                        p?| j        o| j                                        p| j	        o| j
                                        S )z,Are any of the channels created and running?)_shell_channelrH   r   _iopub_channelrN   _stdin_channelrQ   _hb_channelr   _control_channelrT   r4   s    r   r;   zKernelClient.channels_runningP  s      BT%7%@%@%B%B K#E(:(C(C(E(EK#E(:(C(C(E(EK  ?T_%=%=%?%?K %I$*>*G*G*I*I	
r   c                 
   | j         v|                     d          }| j                            d|           |                     | j        j                  }|                     || j        | j                  | _         | j         S )z-Get the shell channel object for this kernel.Nr   zconnecting shell channel to %sidentity)	r   	_make_urlr<   r>   connect_shellr   bsessionshell_channel_classioloopr5   urlr   s      r   rH   zKernelClient.shell_channel]  ~     &..))CHNN;SAAA''1F'GGF"&":":dk# #D ""r   c                     | j         j|                     d          }| j                            d|           |                                 }|                     || j        | j                  | _         | j         S )z-Get the iopub channel object for this kernel.Nr   zconnecting iopub channel to %s)r   r   r<   r>   connect_iopubiopub_channel_classr   r   r   s      r   rN   zKernelClient.iopub_channeli  st     &..))CHNN;SAAA''))F"&":":dk# #D ""r   c                 
   | j         v|                     d          }| j                            d|           |                     | j        j                  }|                     || j        | j                  | _         | j         S )z-Get the stdin channel object for this kernel.Nr   zconnecting stdin channel to %sr   )	r   r   r<   r>   connect_stdinr   r   stdin_channel_classr   r   s      r   rQ   zKernelClient.stdin_channelu  r   r   c                     | j         V|                     d          }| j                            d|           |                     | j        | j        |          | _         | j         S )z*Get the hb channel object for this kernel.Nr   z"connecting heartbeat channel to %s)r   r   r<   r>   hb_channel_classr9   r   )r5   r   s     r   r   zKernelClient.hb_channel  sc     #..&&CHNN?EEE#44dlC   D r   c                 
   | j         v|                     d          }| j                            d|           |                     | j        j                  }|                     || j        | j                  | _         | j         S )z/Get the control channel object for this kernel.Nrm   z connecting control channel to %sr   )	r   r   r<   r>   connect_controlr   r   control_channel_classr   r   s      r   rT   zKernelClient.control_channel  s~      (..++CHNN=sCCC))4<3H)IIF$($>$>dk% %D! $$r   c                    K   ddl m} t          | j        |          r| j                                         d{V S | j        | j                                        S dS )z$Is the kernel process still running?r   rY   NT)r`   rZ   r   ra   rb   r   
is_beating)r5   rZ   s     r   rb   zKernelClient._async_is_alive  s{      ******dk=11 	7 44666666666' #..000 tr   codesilentstore_historyuser_expressionsstop_on_erroroutput_hook
stdin_hookc
           
      n  K   | j                                         sd}
t          |
          || j        }|r*| j                                        sd}
t          |
          t          |                     ||||||                     d{V }|	| j        }	|fdt          j	        v rXddl
m}  |            }t          |dd	          }|r5t          | j        |j        j        |j        j        |j        j                  }|| j        }|t)          j                    |z   }nd}t,          j                                        }| j         j        }|                    |t,          j                   |r-| j        j        }|                    |t,          j                   nd}	 |6t9          d|t)          j                    z
            }t;          d|z            }t=          |                    |           d{V           }|sd}
tA          |
          ||v rVt          | j        !                    d                     d{V } |	|          }tE          j#        |          r| d{V  ||vrt          | j         !                    d                     d{V }|d         $                    d          |k    r" ||           |d         d         dk    r|d         d         dk    rnS|$t9          d|t)          j                    z
            }| %                    ||           d{V S )a.  Execute code in the kernel interactively

        Output will be redisplayed, and stdin prompts will be relayed as well.
        If an IPython kernel is detected, rich output will be displayed.

        You can pass a custom output_hook callable that will be called
        with every IOPub message that is produced instead of the default redisplay.

        .. versionadded:: 5.0

        Parameters
        ----------
        code : str
            A string of code in the kernel's language.

        silent : bool, optional (default False)
            If set, the kernel will execute the code as quietly possible, and
            will force store_history to be False.

        store_history : bool, optional (default True)
            If set, the kernel will store command history.  This is forced
            to be False if silent is True.

        user_expressions : dict, optional
            A dict mapping names to expressions to be evaluated in the user's
            dict. The expression values are returned as strings formatted using
            :func:`repr`.

        allow_stdin : bool, optional (default self.allow_stdin)
            Flag for whether the kernel can send stdin requests to frontends.

            Some frontends (e.g. the Notebook) do not support stdin requests.
            If raw_input is called from code executed from such a frontend, a
            StdinNotImplementedError will be raised.

        stop_on_error: bool, optional (default True)
            Flag whether to abort the execution queue, if an exception is encountered.

        timeout: float or None (default: None)
            Timeout to use when waiting for a reply

        output_hook: callable(msg)
            Function to be called with output messages.
            If not specified, output will be redisplayed.

        stdin_hook: callable(msg)
            Function or awaitable to be called with stdin_request messages.
            If not specified, input/getpass will be called.

        Returns
        -------
        reply: dict
            The reply message for this request
        z/IOPub channel must be running to receive outputNz,stdin channel must be running to allow input)r   r   r   r7   r   IPythonr   )get_ipythonkernelFTi  zTimeout waiting for outputr[   rn   rk   r   r\   statusrx   execution_stateidle)&rN   r   rc   r7   rQ   r   executer   r   modulesr   r   r   r   r   display_pubr   
pub_socketrn   r   r_   ro   r2   rd   Pollerr   registerPOLLINrp   intdictpollrq   rI   inspectisawaitablerr   rv   )r5   r   r   r   r   r7   r   rV   r   r   emsgrk   r   ip	in_kernelrs   
timeout_mspolleriopub_socketstdin_socketeventsreqresri   s                           r   _async_execute_interactivez'KernelClient._async_execute_interactive  s     D !**,, 	%DDt$$$*K 	%t1::<< 	%ADt$$$#LL+!1'+   	
 	
 	
 	
 	
 	
 	
 	
 1J9#;#;++++++BHe44I %,N*N-N0	  3K ~'''1HHJ##%%)0cj111 	 -4LOOL#*5555L	"aDN,<,<!<== 00
J 7 777777788F )3"4(((v%%();)C)CA)C)N)NOOOOOOOO joo&s++ IIIIIII6))$T%7%?%?%?%J%JKKKKKKKKC?#''11V;;K Hj)X55	N#45??;	@ !X(8(8899G++FG+DDDDDDDDDr   c                     |i }|| j         }t          |t                    st          d|z            t	          |           ||||||d}| j                            d|          }| j                            |           |d         d         S )a  Execute code in the kernel.

        Parameters
        ----------
        code : str
            A string of code in the kernel's language.

        silent : bool, optional (default False)
            If set, the kernel will execute the code as quietly possible, and
            will force store_history to be False.

        store_history : bool, optional (default True)
            If set, the kernel will store command history.  This is forced
            to be False if silent is True.

        user_expressions : dict, optional
            A dict mapping names to expressions to be evaluated in the user's
            dict. The expression values are returned as strings formatted using
            :func:`repr`.

        allow_stdin : bool, optional (default self.allow_stdin)
            Flag for whether the kernel can send stdin requests to frontends.

            Some frontends (e.g. the Notebook) do not support stdin requests.
            If raw_input is called from code executed from such a frontend, a
            StdinNotImplementedError will be raised.

        stop_on_error: bool, optional (default True)
            Flag whether to abort the execution queue, if an exception is encountered.

        Returns
        -------
        The msg_id of the message sent.
        Nzcode %r must be a string)r   r   r   r   r7   r   execute_requestr   rk   )	r7   r   r   r   r   r   ri   rH   r   )	r5   r   r   r   r   r7   r   rx   ri   s	            r   r   zKernelClient.executeD  s    V #!*K $$$ 	@7$>???-...
 * 0&*
 
 l0'::$$$8}X&&r   
cursor_posc                     |t          |          }||d}| j                            d|          }| j                            |           |d         d         S )a  Tab complete text in the kernel's namespace.

        Parameters
        ----------
        code : str
            The context in which completion is requested.
            Can be anything between a variable name and an entire cell.
        cursor_pos : int, optional
            The position of the cursor in the block of code where the completion was requested.
            Default: ``len(code)``

        Returns
        -------
        The msg_id of the message sent.
        N)r   r   complete_requestr   rk   lenr   ri   rH   r   )r5   r   r   rx   ri   s        r   completezKernelClient.complete  s`      TJz::l17;;$$$8}X&&r   r   detail_levelc                     |t          |          }|||d}| j                            d|          }| j                            |           |d         d         S )a  Get metadata information about an object in the kernel's namespace.

        It is up to the kernel to determine the appropriate object to inspect.

        Parameters
        ----------
        code : str
            The context in which info is requested.
            Can be anything between a variable name and an entire cell.
        cursor_pos : int, optional
            The position of the cursor in the block of code where the info was requested.
            Default: ``len(code)``
        detail_level : int, optional
            The level of detail for the introspection (0-2)

        Returns
        -------
        The msg_id of the message sent.
        N)r   r   r   inspect_requestr   rk   r   )r5   r   r   r   rx   ri   s         r   r   zKernelClient.inspect  sj    ( TJ$(
 

 l0'::$$$8}X&&r   rangerawoutputhist_access_typec                    |dk    r,|                     dd           |                     dd           t          d	|||d|}| j                            d|          }| j                            |           |d         d         S )
a  Get entries from the kernel's history list.

        Parameters
        ----------
        raw : bool
            If True, return the raw input.
        output : bool
            If True, then return the output as well.
        hist_access_type : str
            'range' (fill in session, start and stop params), 'tail' (fill in n)
             or 'search' (fill in pattern param).

        session : int
            For a range request, the session from which to get lines. Session
            numbers are positive integers; negative ones count back from the
            current session.
        start : int
            The first line number of a history range.
        stop : int
            The final (excluded) line number of a history range.

        n : int
            The number of lines of history to get for a tail request.

        pattern : str
            The glob-syntax pattern for a search request.

        Returns
        -------
        The ID of the message sent.
        r   r   r   r   )r   r   r   history_requestr   rk    )
setdefaultr   r   ri   rH   r   )r5   r   r   r   rF   rx   ri   s          r   historyzKernelClient.history  s    L w&&i+++gq)))[3v@P[[TZ[[l0'::$$$8}X&&r   c                     | j                             d          }| j                            |           |d         d         S )zdRequest kernel info

        Returns
        -------
        The msg_id of the message sent
        kernel_info_requestr   rk   r   ri   rH   r   )r5   ri   s     r   rf   zKernelClient.kernel_info  s@     l455$$$8}X&&r   target_namec                     |i nd|i}| j                             d|          }| j                            |           |d         d         S )zbRequest comm info

        Returns
        -------
        The msg_id of the message sent
        Nr   comm_info_requestr   rk   r   )r5   r   rx   ri   s       r   	comm_infozKernelClient.comm_info  sU     $+""-1Ml2G<<$$$8}X&&r   c                     t          |d         d                             d          d                   }|t          k    r|| j        _        dS dS )z~handle kernel info reply

        sets protocol adaptation version. This might
        be run from a separate thread.
        rx   protocol_version.r   N)r   r&   r   r   adapt_version)r5   ri   r  s      r   rg   z&KernelClient._handle_kernel_info_reply  sR     C	N+=>DDSII!LMM222)6DL&&& 32r   c                     | j                             dd|i          }| j                            |           |d         d         S )zAsk the kernel whether some code is complete and ready to execute.

        Returns
        -------
        The ID of the message sent.
        is_complete_requestr   r   rk   r   )r5   r   ri   s      r   is_completezKernelClient.is_complete  sF     l4vtnEE$$$8}X&&r   stringc                 x    d|i}| j                             d|          }| j                            |           dS )zSend a string of raw input to the kernel.

        This should only be called in response to the kernel sending an
        ``input_request`` message on the stdin channel.

        Returns
        -------
        The ID of the message sent.
        valueinput_replyN)r   ri   rQ   r   )r5   r  rx   ri   s       r   r|   zKernelClient.input  sB     F#l}g66$$$$$r   restartc                     | j                             dd|i          }| j                            |           |d         d         S )a  Request an immediate kernel shutdown on the control channel.

        Upon receipt of the (empty) reply, client code can safely assume that
        the kernel has shut down and it's safe to forcefully terminate it if
        it's still alive.

        The kernel will send the reply via a function registered with Python's
        atexit module, ensuring it's truly done as the kernel is done with all
        normal operation.

        Returns
        -------
        The msg_id of the message sent
        shutdown_requestr  r   rk   )r   ri   rT   r   )r5   r  ri   s      r   shutdownzKernelClient.shutdown%  sG    " l1Iw3GHH!!#&&&8}X&&r   )r   N)N)Nr   )TTTTT)FTNNTNNN)FTNNT)Nr   )TFr   )F)H__name__
__module____qualname__r%   r	   r2   r3   r9   r   r1   r6   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r7   bool__annotations__rA   tDictr   rK   rO   rR   rU   Optionalr^   rj   rv   r   r   r   sugarr   Socketr   r   r   propertyr;   r   rH   rN   rQ   r   rT   rb   Callabler   r   r   r   r   r   rf   r   rg   r  r|   r  __classcell__)rD   s   @r   r/   r/   I   s8         " hs{##GtE{{#+    
 $z**$z**$z**tL)) D,, SUUNSUUNSUUN#%%Ksuu K     2O O O16RUWXW\R\K] O O O OO O O16RUWXW\R\K] O O O OO O O16RUWXW\R\K] O O O OQ!% Q15 QQVTWYZY^T^M_ Q Q Q Q9 91:e3D 9PT 9 9 9 9x NU $%Ju$5GJ	
QU
	   ,!QVCJ-? !D ! ! ! !&
>sAEz(: 
>t 
> 
> 
> 
>++ 	 '+ u	+
 VCJ+ 
+ + + +. ) )) ) 	)
 ) ) 
) ) ) )<( ( ( (  
$ 
 
 
 X
 F	#qu 	# 	# 	# X	# 	#qu 	# 	# 	# X	# 	#qu 	# 	# 	# X	#  AE       X  	% 	% 	% 	% X	%t    & ";?(,"%).2-1YE YEYE YE 	YE
 *QVCJ%78YE Z%YE YE E"YE Z
+YE Jqz*YE 
QU
	YE YE YE YE~ ";?(,"A' A'A' A' 	A'
 *QVCJ%78A' Z%A' A' 
A' A' A' A'F' 'S 'ajo ' ' ' ' '.' 'C 'QZ_ 'SV '_b ' ' ' 'B  '	,' ,',' ,' 	,'
 %,' 
,' ,' ,' ,'\	'S 	' 	' 	' 	'
' 
'QZ_ 
' 
' 
' 
' 
'7QVCJ-? 7D 7 7 7 7	' 	' 	' 	' 	' 	'%C %D % % % %' ' ' ' ' ' ' ' ' ' 'r   r/   )r   )'r%   rd   r   r   r_   typingr  	functoolsr   r   queuer   zmq.asyncior2   jupyter_core.utilsr   	traitletsr   r   r	   r
   channelsr   channelsabcr   r   	clientabcr   connectr   r   r   r  r   r   r  r-   r/   r   r   r   r   <module>r'     s   @ @   



                            + + + + + + / / / / / / / / / / / / , , , , , , 1 1 1 1 1 1 1 1 & & & & & & ( ( ( ( ( (      FafS#X. F4 F F F F   AJ  aj  3  QZ        Fo' o' o' o' o'& o' o' o'd   & & & & &r   