Ë
    :vžj¨  ã                   ó<   — d Z ddlmZmZmZ ddlmZ  G d„ d«      Zy)zBProvides access to variables pertaining to specific call contexts.é    )ÚContextÚ
ContextVarÚcopy_context)ÚAnyc                   óÂ   — e Zd ZU dZdZeed<   dZ ee«      Z	ee
eef      ed<   ededefd„«       Zedededdfd	„«       Zedee   fd
„«       Zede
eef   fd„«       Zy)ÚCallContexta6  CallContext essentially acts as a namespace for managing context variables.

    Although not required, it is recommended that any "file-spanning" context variable
    names (i.e., variables that will be set or retrieved from multiple files or services) be
    added as constants to this class definition.
    ÚJUPYTER_HANDLERÚ_name_value_mapÚnameÚreturnc                 ó>   — t         j                  «       }||v r||   S y)a™  Returns the value corresponding the named variable relative to this context.

        If the named variable doesn't exist, None will be returned.

        Parameters
        ----------
        name : str
            The name of the variable to get from the call context

        Returns
        -------
        value: Any
            The value associated with the named variable for this call context
        N)r   Ú_get_map)Úclsr   Úname_value_maps      úq/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/jupyter_server/base/call_context.pyÚgetzCallContext.get   s(   € ô  %×-Ñ-Ó/ˆØ�>Ñ!Ø! $Ñ'Ð'Øó    ÚvalueNc                 ó�   — t         j                  «       j                  «       }|||<   t         j                  j	                  |«       y)aY  Sets the named variable to the specified value in the current call context.

        Parameters
        ----------
        name : str
            The name of the variable to store into the call context
        value : Any
            The value of the variable to store into the call context

        Returns
        -------
        None
        N)r   r   Úcopyr
   Úset)r   r   r   r   s       r   r   zCallContext.set0   s9   € ô %×-Ñ-Ó/×4Ñ4Ó6ˆØ$ˆ�tÑÜ×#Ñ#×'Ñ'¨Õ7r   c                 ó\   — t         j                  «       }t        |j                  «       «      S )z¾Returns a list of variable names set for this call context.

        Returns
        -------
        names: List[str]
            A list of variable names set for this call context.
        )r   r   ÚlistÚkeys)r   r   s     r   Úcontext_variable_namesz"CallContext.context_variable_namesC   s&   € ô %×-Ñ-Ó/ˆÜ�N×'Ñ'Ó)Ó*Ð*r   c                 ó´   — t        «       }t        j                  |vrt        j                  j                  i «       t        j                  j	                  «       S )z´Get the map of names to their values from the _NAME_VALUE_MAP context var.

        If the map does not exist in the current context, an empty map is created and returned.
        )r   r   r
   r   r   )r   Úctxs     r   r   zCallContext._get_mapO   sB   € ô $“~ˆÜ×&Ñ&¨cÑ1Ü×'Ñ'×+Ñ+¨BÔ/Ü×*Ñ*×.Ñ.Ó0Ð0r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   ÚstrÚ__annotations__Ú_NAME_VALUE_MAPr   r
   Údictr   Úclassmethodr   r   r   r   r   © r   r   r   r   	   sÁ   … ñð -€O�SÓ,ð
 (€OÙ2<¸_Ó2M€O�Z  S¨# X¡Ñ/ÓMàð�sð ˜sò ó ðð( ð8�sð 8 3ð 8¨4ò 8ó ð8ð$ ð	+ t¨C¡yò 	+ó ð	+ð ð1˜˜c 3˜h™ò 1ó ñ1r   r   N)r!   Úcontextvarsr   r   r   Útypingr   r   r'   r   r   Ú<module>r*      s   ðÙ H÷ :Ñ 9Ý ÷O1ò O1r   