o
    tf;                     @   s  U d 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mZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZ dd	lmZ dd
lm Z  ddl!m"Z"m#Z# ddl$m%Z%m&Z&m'Z' ddl(Z(e()eZ*dd Z+e%,dd Z-e&,dd Z.e+dddZ/i Z0ej1e2df e3d< dd Z4dd Z5e5e4dZ6e7e8e9fZ:dd Z;dd Z<dd  Z=d!d" Z>G d#d$ d$eZ?G d%d& d&e?Z@d'd( ZAG d)d* d*ZBeB ZCd+d, ZDG d-d. d.eEZFG d/d de?ZGdS )0zqBase Widget class.  Allows user to create widgets in the back-end that render
in the Jupyter notebook front-end.
    N)contextmanager)Iterable)get_ipython)Any	HasTraitsUnicodeDictInstanceListIntSetBytesobservedefault	Container	Undefined)loadsdumps   comm)standard_b64encode   )deprecation
_get_frame)__protocol_version____control_protocol_version__ __jupyter_widgets_base_version__c                 C   s$   | t jv rt j|   dvS t|S )aB  Return True if the given environment variable is turned on, otherwise False
    If the environment variable is set, True will be returned if it is assigned to a value
    other than 'no', 'n', 'false', 'off', '0', or '0.0' (case insensitive).
    If the environment variable is not set, the default value is returned.
    )nonfalseoff0z0.0)osenvironlowerbool)namer    r(   b/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/ipywidgets/widgets/widget.pyenvset   s   
r*   .JUPYTER_WIDGETS_ECHOTr   Widget
_instancesc                    sX   t | tr fdd|  D S t | ttfr  fdd| D S t | tr*d| j S | S )Nc                       i | ]
\}}|t | qS r(   _widget_to_json.0kvobjr(   r)   
<dictcomp>2       z#_widget_to_json.<locals>.<dictcomp>c                       g | ]}t | qS r(   r1   r4   r6   r7   r(   r)   
<listcomp>4       z#_widget_to_json.<locals>.<listcomp>
IPY_MODEL_)
isinstancedictitemslisttupler.   model_idxr8   r(   r7   r)   r2   0   s   


r2   c                    sx   t | tr fdd|  D S t | ttfr  fdd| D S t | tr:| dr:| dd  tv r:t| dd   S | S )Nc                    r0   r(   _json_to_widgetr3   r7   r(   r)   r9   <   r:   z#_json_to_widget.<locals>.<dictcomp>c                    r;   r(   rH   r<   r7   r(   r)   r=   >   r>   z#_json_to_widget.<locals>.<listcomp>r?   
   )r@   rA   rB   rC   rD   str
startswithr/   rF   r(   r7   r)   rI   :   s   
$rI   )	from_jsonto_jsonc                 C   sB   t ||D ]\}}| }|dd D ]}|| }q|||d < qdS )zThe inverse of _remove_buffers, except here we modify the existing dict/lists.
    Modifying should be fine, since this is used when state comes from the wire.
    N)zip)statebuffer_pathsbuffersZbuffer_pathbufferr8   keyr(   r(   r)   _put_buffersK   s   
rV   c           	      C   sZ  t | ttfrUd}t| D ]E\}}t |tr0|st| } d}d| |< || |||g  qt |tttfrRt|||g ||}||urR|sNt| } d}|| |< q| S t | trd}|  D ]D\}}t |tr|sqt| } d}| |= || |||g  q`t |tttfrt|||g ||}||ur|st| } d}|| |< q`| S t	d|  )z!For internal, see _remove_buffersFTNz+expected state to be a list or dict, not %r)
r@   rC   rD   	enumerate_binary_typesappendrA   _separate_buffersrB   
ValueError)	ZsubstatepathrR   rS   Z	is_clonedir6   Zvnewr5   r(   r(   r)   rZ   W   sN   




rZ   c                 C   s"   g g }}t | g ||} | ||fS )a  Return (state_without_buffers, buffer_paths, buffers) for binary message parts

    A binary message part is a memoryview, bytearray, or python 3 bytes object.

    As an example:
    >>> state = {'plain': [0, 'text'], 'x': {'ar': memoryview(ar1)}, 'y': {'shape': (10,10), 'data': memoryview(ar2)}}
    >>> _remove_buffers(state)
    ({'plain': [0, 'text']}, {'x': {}, 'y': {'shape': (10, 10)}}, [['x', 'ar'], ['y', 'data']],
     [<memory at 0x107ffec48>, <memory at 0x107ffed08>])
    )rZ   )rQ   rR   rS   r(   r(   r)   _remove_buffers   s   

r^   c                 C   sZ   t | t |kr
dS | |krdS t| |D ]\}}t|dt|dkr* dS qdS )zCompare two lists of buffers for equality.

    Used to decide whether two sequences of buffers (memoryviews,
    bytearrays, or python 3 bytes) differ, such that a sync is needed.

    Returns True if equal, False if unequal
    FTB)lenrP   
memoryviewcast)abiaibr(   r(   r)   _buffer_list_equal   s   rg   c                   @   s(   e Zd ZdZedZeddd ZdS )LoggingHasTraitszA parent class for HasTraits that log.
    Subclasses have a log trait, and the default behavior
    is to get the logger from the currently running Application.
    zlogging.Loggerlogc                 C   s   ddl m} | S )Nr   )ri   )	traitletsri   Z
get_logger)selfri   r(   r(   r)   _log_default   s   zLoggingHasTraits._log_defaultN)__name__
__module____qualname____doc__r	   ri   r   rl   r(   r(   r(   r)   rh      s
    rh   c                   @   s(   e Zd ZdZe Zdd ZdddZdS )	CallbackDispatcherz1A structure for registering and running callbacksc                 O   s   d}| j D ]<}z	||i |}W n( ty8 } zt }|du r*| jjd||dd n|  W Y d}~qd}~ww |dur?|n|}q|S )z%Call all of the registered callbacks.NzException in callback %s: %sTexc_info)	callbacks	Exceptionr   ri   warningshowtraceback)rk   argskwargsvaluecallbackZlocal_valueeipr(   r(   r)   __call__   s   
zCallbackDispatcher.__call__Fc                 C   sD   |r|| j v r| j | dS |s|| j vr | j | dS dS dS )z(Un)Register a callback

        Parameters
        ----------
        callback: method handle
            Method to be registered or unregistered.
        remove=False: bool
            Whether to unregister the callback.N)rt   removerY   rk   r{   r   r(   r(   r)   register_callback   s
   z$CallbackDispatcher.register_callbackNF)rm   rn   ro   rp   r
   rt   r~   r   r(   r(   r(   r)   rq      s
    rq   c                    s    fdd}|S )z decorator for showing tracebacksc              
      sz   z | g|R i |W S  t y< } z$t }|d u r&| jjd |dd n|  W Y d }~d S W Y d }~d S d }~ww )Nz!Exception in widget method %s: %sTrr   )ru   r   ri   rv   rw   )rk   rx   ry   r|   r}   methodr(   r)   m   s   z_show_traceback.<locals>.mr(   )r   r   r(   r   r)   _show_traceback   s   	r   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
WidgetRegistryc                 C   s
   i | _ d S N)	_registryrk   r(   r(   r)   __init__      
zWidgetRegistry.__init__c           
      C   sJ   | j |i }||i }||i }||i }||i }	||	|< dS )zRegister a valueN)r   
setdefault)
rk   model_moduleZmodel_module_version_range
model_nameview_moduleZview_module_version_range	view_nameklassmodel_versionview_versionr(   r(   r)   register   s   zWidgetRegistry.registerc                 C   sF   | j | }t| d }|| }	|	| }
t|
 d }|| }|S )zGet a valuer   )r   rC   values)rk   r   model_module_versionr   r   Zview_module_versionr   Zmodule_versionsZmodel_namesZview_modulesZview_versionsZ
view_nameswidget_classr(   r(   r)   get   s   
zWidgetRegistry.getc                 c   s    t | j D ]F\}}t | D ];\}}t | D ]0\}}t | D ]%\}}t | D ]\}	}
t |
 D ]\}}|||||	|f|fV  q:q0q&qqqd S r   )sortedr   rB   )rk   r   mmr   mvr   vmr   vvr   Zvnr   widgetr(   r(   r)   rB     s   zWidgetRegistry.itemsN)rm   rn   ro   r   r   r   rB   r(   r(   r(   r)   r      s
    	r   c              	   C   sF   |   }t|d j|d j|d j|d j|d j|d j|  | S )z>A decorator registering a widget class in the widget registry._model_module_model_module_version_model_name_view_module_view_module_version
_view_name)Zclass_traitsr   r   default_value)r   wr(   r(   r)   r     s   r   c                   @   s   e Zd Zdd Zdd ZdS )_staticpropertyc                 C   s
   || _ d S r   fget)rk   r   r(   r(   r)   r   $  r   z_staticproperty.__init__c                 C   s   |d u sJ |   S r   r   )rk   Z
owner_selfZ	owner_clsr(   r(   r)   __get__'  s   z_staticproperty.__get__N)rm   rn   ro   r   r   r(   r(   r(   r)   r   #  s    r   c                       s  e Zd ZdZdZedd Zedd Zedd Zedd	 Z	e
d
d Zedd Zedd Ze
dd Ze
dd Zedd ZedmddZdnddZdd Zedddd jdd!Zed"d#dd jdd!Zeed$dd jdd!Zeddd%d&jdd!Zeddd'd&jdd!Zed(d)d*jdd!Zeddd+d&jdd!Ze dd,Z!e"d-d*Z#e$d.d/d0 Z%e& Z'dZ(e) Z*e+e,d1Z- fd2d3Z.d4d5 Z/d6d7 Z0d8d9 Z1d:d; Z2e3d<d=d> Z4e5d?d@ Z6dAdB Z7dodCdDZ8dpdEdFZ9dGdH Z:dIdJ Z;dKdL Z<dodMdNZ=dndOdPZ> fdQdRZ? fdSdTZ@dUdV ZAeBdWdX ZCeBdYdZ ZDd[d\ ZEeFd]d^ ZGd_d` ZHedadb ZIedcdd ZJdedf ZKdodgdhZLdidj ZMdkdl ZN  ZOS )qr.   Nc                  C   ,   t d} | jjtkr| jjdv std tS )Nr   
getmembersZsetup_instanceZsetup_classzWidget.widgets is deprecated.r   f_codeco_filenameTRAITLETS_FILEco_namer   r/   framer(   r(   r)   widgets4     zWidget.widgetsc                  C   r   )Nr   r   z%Widget._active_widgets is deprecated.r   r   r(   r(   r)   _active_widgets>  r   zWidget._active_widgetsc                  C   r   )Nr   r   z#Widget._widget_types is deprecated.r   r   r   r   r   r   r   r   r(   r(   r)   _widget_typesH  r   zWidget._widget_typesc                  C   r   )Nr   r   z"Widget.widget_types is deprecated.r   r   r(   r(   r)   widget_typesR  r   zWidget.widget_typesc                 C   s   t t D ]}|  qd S r   )rC   r/   r   close)clsr   r(   r(   r)   	close_all\  s   
zWidget.close_allc                 C   s
   | t _dS )zRegisters a callback to be called when a widget is constructed.

        The callback must have the following signature:
        callback(widget)N)r.   _widget_construction_callback)r{   r(   r(   r)   on_widget_constructeda  s   
zWidget.on_widget_constructedc                 C   s*   t jdurtt jrt |  dS dS dS )3Static method, called when a widget is constructed.N)r.   r   callable)r   r(   r(   r)   _call_widget_constructedi  s   zWidget._call_widget_constructedc                 C   sN   | di  dd}|dd tkrtd|tf || _| j| j dS )z
        Class method, called when the comm-open message on the
        "jupyter.widget.control" comm channel is received
        metadataversion r+   r   zWIncompatible widget control protocol versions: received version %r, expected version %rN)r   splitCONTROL_PROTOCOL_VERSION_MAJORr[   r   _control_common_msg_handle_control_comm_msg)r   r   msgr   r(   r(   r)   handle_control_comm_openedo  s
   z!Widget.handle_control_comm_openedc           
      C   s   | j d u r	td|d d }|d }|dkrO|   t }i }d}|D ]}|j|j|j|j|dd||j	< q%t
|\}}}	| j jtd	||d
|	d d S td| )Nz)Control comm has not been properly openedcontentdatar   Zrequest_statesFdrop_defaults)r   r   r   rQ   Zupdate_states)r   ZstatesrR   rS   zAUnknown front-end to back-end widget control msg with method "%s")r   RuntimeErrorget_manager_stater/   r   r   r   r   	get_staterE   r^   sendrA   )
r   r   r   r   r   Z
full_stater   r   rR   rS   r(   r(   r)   r   |  s0   


zWidget._handle_control_comm_msgc              	   C   s   | di  dd}|dd tkrtd|tf |d d }|d	 }t |d
 |d |d |d |d |d }|| d}d|v rNt||d |d  || dS )r   r   r   r   r+   r   zOIncompatible widget protocol versions: received version %r, expected version %rr   r   rQ   r   r   r   r   r   r   r   rR   rS   N)r   r   PROTOCOL_VERSION_MAJORr[   r   r   rV   	set_state)r   r   r   r   rQ   r   r   r(   r(   r)   handle_comm_opened  s    

zWidget.handle_comm_openedFc                 C   s<   i }|du r
t  }|D ]}|j| d||j< qdd|dS )zReturns the full state for a widget manager for embedding

        :param drop_defaults: when True, it will not include default value
        :param widgets: list with widgets to include in the state (or all widgets when None)
        :return:
        Nr   r   r   )version_majorversion_minorrQ   )r/   r   _get_embed_staterE   )r   r   rQ   r   r(   r(   r)   r     s   zWidget.get_manager_statec                 C   sX   | j | j| jd}t| j|d\}}}||d< t|dkr*dd t||D |d< |S )N)r   r   r   r   rQ   r   c                 S   s&   g | ]\}}d |t |ddqS )base64ascii)encodingr\   r   )r   decode)r4   pdr(   r(   r)   r=     s    
z+Widget._get_embed_state.<locals>.<listcomp>rS   )r   r   r   r^   r   r`   rP   )rk   r   rQ   Zmodel_staterR   rS   r(   r(   r)   r     s   
zWidget._get_embed_statec                 C   s   t dd| jdS )Nr   r   r   r   rE   )rA   	_model_idr   r(   r(   r)   get_view_spec  s   zWidget.get_view_specZWidgetModelzName of the model.T)helpZ	read_onlysyncz@jupyter-widgets/basezThe namespace for the model.z@A semver requirement for namespace version containing the model.zName of the view.)
allow_noner   zThe namespace for the view.r   zCA semver requirement for the namespace version containing the view.)r   zEXPERIMENTAL: The number of views of the model displayed in the frontend. This attribute is experimental and may change or be removed in the future. None signifies that views will not be tracked. Set this to 0 to start tracking view creation/deletion.)r   zThe traits which are synced.keysc                 C   s   dd | j ddD S )Nc                 S   s   g | ]}|qS r(   r(   )r4   r'   r(   r(   r)   r=     s    z(Widget._default_keys.<locals>.<listcomp>Tr   )traitsr   r(   r(   r)   _default_keys  s   zWidget._default_keysr(   c                    s6   | dd| _t jdi | t|  |   dS )zPublic constructorrE   Nr(   )popr   superr   r.   r   open)rk   ry   	__class__r(   r)   r     s   
zWidget.__init__c                 C      t dNz8Widgets cannot be copied; custom implementation requiredNotImplementedErrorr   r(   r(   r)   __copy__     zWidget.__copy__c                 C   r   r   r   )rk   memor(   r(   r)   __deepcopy__  r   zWidget.__deepcopy__c                 C   s   |    dS )zObject disposalN)r   r   r(   r(   r)   __del__  s   zWidget.__del__c                 C   sd   | j du r0t|  \}}}td||d|dtid}| jdur%| j|d< t jdi || _ dS dS )z6Open a comm to the frontend if one isn't already open.Nzjupyter.widget)rQ   rR   r   )target_namer   rS   r   comm_idr(   )r   r^   r   rA   r   r   Zcreate_comm)rk   rQ   rR   rS   rx   r(   r(   r)   r   
  s   


zWidget.openr   c                 C   s4   |d du rdS | j | _| j| j | t| j < dS )z Called when the comm is changed.newN)rE   r   r   r   _handle_msgr/   )rk   changer(   r(   r)   _comm_changed  s
   zWidget._comm_changedc                 C   s   | j jS )zmGets the model id of this widget.

        If a Comm doesn't exist yet, a Comm will be created automagically.)r   r   r   r(   r(   r)   rE   #  s   zWidget.model_idc                 C   s6   | j durt| jd | j   d| _ d| _dS dS )zClose method.

        Closes the underlying comm.
        When the comm is closed, all of the widget views are automatically
        removed from the front-end.N)r   r/   r   rE   r   _repr_mimebundle_r   r(   r(   r)   r   .  s   


zWidget.closec                 C   st   | j |d}t|dkr8| jr"| D ]\}}|| jv r!|| j|< qt|\}}}d||d}| j||d dS dS )a  Sends the widget state, or a piece of it, to the front-end, if it exists.

        Parameters
        ----------
        key : unicode, or iterable (optional)
            A single property's name or iterable of property names to sync with the front-end.
        rU   r   updater   rQ   rR   r   N)r   r`   _property_lockrB   r^   _send)rk   rU   rQ   r'   rz   rR   rS   r   r(   r(   r)   
send_state:  s   

zWidget.send_statec           	      C   s   |du r| j }nt|tr|g}nt|tr|}ntdi }|  }|D ]!}| |d| j}|t| || }|rB| 	||| j
sF|||< q%|S )a]  Gets the widget state, or a piece of it.

        Parameters
        ----------
        key : unicode or iterable (optional)
            A single property's name or iterable of property names to get.

        Returns
        -------
        state : dict of states
        metadata : dict
            metadata for each field: {key: metadata}
        Nz2key must be a string, an iterable of keys, or NonerN   )r   r@   rK   r   r[   r   trait_metadata_trait_to_jsongetattr_comparer   )	rk   rU   r   r   rQ   r   r5   rN   rz   r(   r(   r)   r   M  s    

zWidget.get_statec                 C   s   |j jdko|j jdkS )NZndarraynumpy)r   rm   rn   )rk   rG   r(   r(   r)   	_is_numpyl  s   zWidget._is_numpyc                 C   s0   |  |s
|  |rdd l}|||S ||kS )Nr   )r  r  Zarray_equal)rk   rc   rd   npr(   r(   r)   r  o  s   zWidget._comparec           
   	   C   s  t r4i }| D ]\}}|| jv r| j|dddr|||< q|r4t|\}}}d||d}| j||d | jdi |B |  % |D ]}|| jv r^| |d| j}	| 	||	|| |  qDW d   n1 siw   Y  W d   dS W d   dS 1 sw   Y  dS )	z3Called when a state is received from the front-end.Zecho_updateTr-   r  r   rM   Nr(   )
r,   rB   r   r  r^   r  _lock_propertyZhold_trait_notifications_trait_from_jsonZ	set_trait)
rk   Z	sync_dataZ
echo_stateattrrz   Zecho_buffer_pathsZecho_buffersr   r'   rM   r(   r(   r)   r   v  s.   
PzWidget.set_statec                 C   s   | j d|d|d dS )a  Sends a custom msg to the widget model in the front-end.

        Parameters
        ----------
        content : dict
            Content of the message to send.
        buffers : list of binary buffers
            Binary buffers to send with message
        custom)r   r   r   N)r  rk   r   rS   r(   r(   r)   r     s   
zWidget.sendc                 C   s   | j j||d dS )a=  (Un)Register a custom msg receive callback.

        Parameters
        ----------
        callback: callable
            callback will be passed three arguments when a message arrives::

                callback(widget, content, buffers)

        remove: bool
            True if the callback should be unregistered.)r   N)_msg_callbacksr   r   r(   r(   r)   r     s   zWidget.on_msgc                    sH   t  jdi | | D ]\}}|dr!| j| | | qdS )z/Dynamically add trait attributes to the Widget.r   Nr(   )r   
add_traitsrB   get_metadatar   rY   r  )rk   r   r'   traitr   r(   r)   r    s   

zWidget.add_traitsc                    s\   |d }| j dur&t| j dddur&|| jv r&| |t| |r&| j|d t | dS )z#Called when a property has changed.r'   NkernelTr  )r   r
  r   _should_send_propertyr  r   notify_change)rk   r   r'   r   r(   r)   r    s
   zWidget.notify_changec                 C   s   |  |  S r   )_gen_repr_from_keys
_repr_keysr   r(   r(   r)   __repr__  s   zWidget.__repr__c                 k   s$    || _ z	dV  W i | _ dS i | _ w )a  Lock a property-value pair.

        The value should be the JSON state of the property.

        NOTE: This, in addition to the single lock for all state changes, is
        flawed.  In the future we may want to look into buffering state changes
        back to the front-end.N)r  )rk   
propertiesr(   r(   r)   r    s
   	zWidget._lock_propertyc              	   c   sd    | j du rdV  dS zd| _ dV  W d| _ | | j | j  dS d| _ | | j | j  w )z@Hold syncing any state until the outermost context manager exitsTNF)_holding_syncr  _states_to_sendclearr   r(   r(   r)   	hold_sync  s   

zWidget.hold_syncc                 C   s   |  |d| j}|| jv rGt|||| i}t|| j| i}tt|d |d krG|d |d krGt|d |d rG| jrE| j	| dS | jrR| j
| dS dS )z'Check the property lock (property_lock)rN   r   r   r   FT)r  r	  r  r^   	jsonloads	jsondumpsrg   r  r   discardadd)rk   rU   rz   rN   Zsplit_valueZ
split_lockr(   r(   r)   r    s   
zWidget._should_send_propertyc                 C   s   |d d }|d }|dkr-d|v r+|d }d|v r$t ||d |d  | | dS dS |dkr7|   dS |d	krMd|v rK| |d |d  dS dS | jd
|  dS )z0Called when a msg is received from the front-endr   r   r   r  rQ   rR   rS   Zrequest_stater  z9Unknown front-end to back-end widget msg with method "%s"N)rV   r   r  _handle_custom_msgri   error)rk   r   r   r   rQ   r(   r(   r)   r     s    zWidget._handle_msgc                 C   s   |  | || dS )z%Called when a custom msg is received.N)r  r  r(   r(   r)   r'    s   zWidget._handle_custom_msgc                 C      | S )zConvert a trait value to json.r(   rG   rk   r(   r(   r)   r	       zWidget._trait_to_jsonc                 C   r)  )zConvert json values to objects.r(   r*  r(   r(   r)   r    r+  zWidget._trait_from_jsonc                 K   sP   t | }t|dkr|d d d }d|i}| jd ur&dd| jd|d< |S d S )Nn   u   …z
text/plainr   r   r   z(application/vnd.jupyter.widget-view+json)reprr`   r   r   )rk   ry   Z	plaintextr   r(   r(   r)   r  "  s   

zWidget._repr_mimebundle_c                 C   sB   | j durt| j dr| j jdurn	 | j j||d dS dS dS )z.Sends a message to the model in the front-end.Nr  T)r   rS   )r   hasattrr  r   )rk   r   rS   r(   r(   r)   r  6  s   &zWidget._sendc                 c   s    |   }t| jD ]4}|d dkrq
t| |}|| }| ||jr$q
t|ttfr;|jt	kr;|d u s:t
|dkr;q
|V  q
d S )Nr   _)r   r   r   r
  r  r   r@   r   r   r   r`   )rk   r   rU   rz   r  r(   r(   r)   r  ;  s   

zWidget._repr_keysc                    s,    j j}d fdd|D }d||S )Nz, c                 3   s"    | ]}d  |t |V  qdS )z{}={!r}N)formatr
  )r4   rU   r   r(   r)   	<genexpr>O  s
    
z-Widget._gen_repr_from_keys.<locals>.<genexpr>z{}({}))r   rm   joinr0  )rk   r   
class_name	signaturer(   r   r)   r  M  s
   zWidget._gen_repr_from_keys)FNr   r   )NF)Prm   rn   ro   r   r   r   r   r   r   r   classmethodr   staticmethodr   r   r   r   r   r   r   r   r   tagr   r   r   r   r   r   r   r   Z_view_countr   r   r
   r   r   r   r   r  r  r   r   r	   rq   r  r   r   r   r   r   r   r   propertyrE   r   r  r   r  r  r   r   r   r  r  r  r   r  r"  r  r   r   r'  r	  r  r  r  r  r  __classcell__r(   r(   r   r)   r.   -  s    
	
	
	
	











	











)Hrp   r#   systyping
contextlibr   collections.abcr   ZIPythonr   rj   r   r   r   r   r	   r
   r   r   r   r   r   r   r   jsonr   r#  r   r$  r   r   r   r   utilsr   r   _versionr   r   r   inspectgetfiler   r*   r   r   r   r,   r/   MutableMappingrK   __annotations__r2   rI   Zwidget_serializationra   	bytearraybytesrX   rV   rZ   r^   rg   rh   rq   r   r   r   r   objectr   r.   r(   r(   r(   r)   <module>   sL   <


-$,
