§
    ÁÞMhÊ  ã                   óv   — d Z ddlmZ ddlmZ  G d„ d¦  «        Z G d„ d¦  «        Z ej        e¦  «         dS )	z'A kernel client for in-process kernels.é    )ÚList)ÚHBChannelABCc                   ól   ‡ — e Zd ZU dZg Zee         ed<   dˆ fd„	Zd„ Z	d„ Z
d„ Zd„ Zdd
„Zd„ Zd„ Zˆ xZS )ÚInProcessChannelz#Base class for in-process channels.Úproxy_methodsNc                 ód   •— t          ¦   «                              ¦   «          || _        d| _        dS )úInitialize the channel.FN)ÚsuperÚ__init__ÚclientÚ	_is_alive©Úselfr   Ú	__class__s     €ú\/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipykernel/inprocess/channels.pyr   zInProcessChannel.__init__   s+   ø€ å‰Œ×ÒÑÔÐØˆŒØˆŒˆˆó    c                 ó   — | j         S ©zTest if the channel is alive.©r   ©r   s    r   Úis_alivezInProcessChannel.is_alive   ó
   € àŒ~Ðr   c                 ó   — d| _         dS ©zStart the channel.TNr   r   s    r   ÚstartzInProcessChannel.start   ó   € àˆŒˆˆr   c                 ó   — d| _         dS ©zStop the channel.FNr   r   s    r   ÚstopzInProcessChannel.stop"   ó   € àˆŒˆˆr   c                 ó$   — d}t          |¦  «        ‚)z–This method is called in the main thread when a message arrives.

        Subclasses should override this method to handle incoming messages.
        z,call_handlers must be defined in a subclass.©ÚNotImplementedError)r   Úmsgs     r   Úcall_handlerszInProcessChannel.call_handlers&   s   € ð
 =ˆÝ! #Ñ&Ô&Ð&r   ç      ð?c                 ó   — dS )zFlush the channel.N© )r   Útimeouts     r   ÚflushzInProcessChannel.flush.   s   € € € r   c                 ó    —  | j         |i |¤Ž dS )a  Call the message handlers later.

        The default implementation just calls the handlers immediately, but this
        method exists so that GUI toolkits can defer calling the handlers until
        after the event loop has run, as expected by GUI frontends.
        N)r%   )r   ÚargsÚkwdss      r   Úcall_handlers_laterz$InProcessChannel.call_handlers_later1   s"   € ð 	ˆÔ˜DÐ) DÐ)Ð)Ð)Ð)Ð)r   c                 ó   — t           ‚)z Process any pending GUI events.

        This method will be never be called from a frontend without an event
        loop (e.g., a terminal frontend).
        r"   r   s    r   Úprocess_eventszInProcessChannel.process_events:   s
   € õ "Ð!r   ©N)r&   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚobjectÚ__annotations__r   r   r   r   r%   r*   r.   r0   Ú__classcell__©r   s   @r   r   r      sÇ   ø€ € € € € € Ø-Ð-à"$€M4˜”<Ð$Ð$Ñ$ðð ð ð ð ð ðð ð ðð ð ðð ð ð'ð 'ð 'ð!ð !ð !ð !ð*ð *ð *ð"ð "ð "ð "ð "ð "ð "r   r   c                   óL   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zˆ xZS )ÚInProcessHBChannelz÷A dummy heartbeat channel interface for in-process kernels.

    Normally we use the heartbeat to check that the kernel process is alive.
    When the kernel is in-process, that doesn't make sense, but clients still
    expect this interface.
    g      @Nc                 ór   •— t          ¦   «                              ¦   «          || _        d| _        d| _        dS )r	   FTN)r
   r   r   r   Ú_pauser   s     €r   r   zInProcessHBChannel.__init__M   s2   ø€ å‰Œ×ÒÑÔÐØˆŒØˆŒØˆŒˆˆr   c                 ó   — | j         S r   r   r   s    r   r   zInProcessHBChannel.is_aliveT   r   r   c                 ó   — d| _         dS r   r   r   s    r   r   zInProcessHBChannel.startX   r   r   c                 ó   — d| _         dS r   r   r   s    r   r   zInProcessHBChannel.stop\   r    r   c                 ó   — d| _         dS )zPause the channel.TN©r=   r   s    r   ÚpausezInProcessHBChannel.pause`   s   € àˆŒˆˆr   c                 ó   — d| _         dS )zUnpause the channel.FNrB   r   s    r   ÚunpausezInProcessHBChannel.unpaused   s   € àˆŒˆˆr   c                 ó   — | j          S )zTest if the channel is beating.rB   r   s    r   Ú
is_beatingzInProcessHBChannel.is_beatingh   s   € à”;ˆÐr   r1   )r2   r3   r4   r5   Útime_to_deadr   r   r   r   rC   rE   rG   r8   r9   s   @r   r;   r;   C   s¨   ø€ € € € € ðð ð €Lðð ð ð ð ð ðð ð ðð ð ðð ð ðð ð ðð ð ðð ð ð ð ð ð r   r;   N)r5   Útypingr   Újupyter_client.channelsabcr   r   r;   Úregisterr(   r   r   ú<module>rL      sŸ   ðØ -Ð -ð
 Ð Ð Ð Ð Ð à 3Ð 3Ð 3Ð 3Ð 3Ð 3ð1"ð 1"ð 1"ð 1"ð 1"ñ 1"ô 1"ð 1"ðh'ð 'ð 'ð 'ð 'ñ 'ô 'ð 'ðT €Ô Ð(Ñ )Ô )Ð )Ð )Ð )r   