
    Mh                         d Z ddlZddlmZmZmZmZ ddlmZ ddl	m
Z
 	 ddlmZ n# e$ r	 ddlmZ Y nw xY wddlmZmZ  ej        ded	
            G d de          Zd ZdS )z/Publishing native (typically pickled) objects.
    N)AnyCBytesDictInstance)Configurable)
json_clean)serialize_object)Sessionextract_headerDipykernel.datapub is deprecated. It has moved to ipyparallel.datapub   
stacklevelc                       e Zd ZdZ ed          xZZ eed          Z e	d          Z
 ei           Zd Zd ZdS )ZMQDataPublisherzA zmq data publisher.s   datapubT)
allow_nonec                 .    t          |          | _        dS )z%Set the parent for outbound messages.N)r   parent_header)selfparents     Q/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipykernel/datapub.py
set_parentzZMQDataPublisher.set_parent&   s    +F33    c                     | j         }|J t          ||j        |j                  }t	          t          t          |                                                              }|                    | j	        d|| j
        || j                   dS )zpublish a data_message on the IOPub channel

        Parameters
        ----------
        data : dict
            The data to be published. Think of it as a namespace.
        N)buffer_thresholditem_threshold)keysdata_message)contentr   buffersident)sessionr	   r   r   r   dictlistr   send
pub_socketr   topic)r   datar"   r    r   s        r   publish_datazZMQDataPublisher.publish_data*   s     ,""""$5"1
 
 

 TtDIIKK'8'8999::O%* 	 	
 	
 	
 	
 	
r   N)__name__
__module____qualname____doc__r   r'   r   r
   r"   r   r&   r   r   r   r)    r   r   r   r      s        F:&&&EEhw4000G%%%JDHHM4 4 4
 
 
 
 
r   r   c                     t          j        dt          d           ddlm} |                                j                            |            dS )zpublish a data_message on the IOPub channel

    Parameters
    ----------
    data : dict
        The data to be published. Think of it as a namespace.
    r   r   r   r   )ZMQInteractiveShellN)warningswarnDeprecationWarningipykernel.zmqshellr0   instancedata_pubr)   )r(   r0   s     r   r)   r)   D   sc     MN    766666  ""+88>>>>>r   )r-   r1   	traitletsr   r   r   r   traitlets.configr   ipykernel.jsonutilr   ipyparallel.serializer	   ImportErroripykernel.serializejupyter_client.sessionr
   r   r2   r3   r   r)   r.   r   r   <module>r>      s1     1 1 1 1 1 1 1 1 1 1 1 1 ) ) ) ) ) ) ) ) ) ) ) )56666666 5 5 5444444445 ; : : : : : : : J   #
 #
 #
 #
 #
| #
 #
 #
L? ? ? ? ?s   ' 55