Ë
    :vžjµP  ã                   ó:  — d Z ddlZddlZddlZddlmZmZmZ  ede«      Z	 ede«      Z
	 ddl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mZmZ ddlmZ ddlmZ  G d„ de«      Z e G d„ d«      «       Z! G d„ d«      Z" G d„ de«      Z#y# e$ r	 ddlmZ Y Œiw xY w)zA base class session manager.é    N)ÚAnyÚNewTypeÚcastÚ
KernelNameÚ	ModelName)Údbapi2)Ú	dataclassÚfields)Úensure_async)Úweb)ÚInstanceÚ
TraitErrorÚUnicodeÚvalidate)ÚLoggingConfigurable)ÚInstanceFromClassesc                   ó   — e Zd ZdZy)ÚKernelSessionRecordConflictzgException class to use when two KernelSessionRecords cannot
    merge because of conflicting data.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú€/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/jupyter_server/services/sessions/sessionmanager.pyr   r      s   „ òr   r   c                   óR   — e Zd ZU dZdZedz  ed<   dZedz  ed<   dede	fd„Z
d	d„Zy)
ÚKernelSessionRecordzèA record object for tracking a Jupyter Server Kernel Session.

    Two records that share a session_id must also share a kernel_id, while
    kernels can have multiple session (and thereby) session_ids
    associated with them.
    NÚ
session_idÚ	kernel_idÚotherÚreturnc                 ó´  — t        |t        «      rÈ| j                  xr | j                  |j                  k(  }t        | j                  |j                  k(  | j                  du xs |j                  du g«      }t        ||g«      ryt        | j                  | j                  |j                  k(  | j                  |j                  k7  g«      rd}t        |«      ‚y)z Whether a record equals another.NTzåA single session_id can only have one kernel_id associated with. These two KernelSessionRecords share the same session_id but have different kernel_ids. This should not be possible and is likely an issue with the session records.F)Ú
isinstancer   r   Úallr   Úanyr   )Úselfr    Ú
condition1Ú
condition2Úmsgs        r   Ú__eq__zKernelSessionRecord.__eq__/   sÇ   € ä�eÔ0Ô1ØŸ™ÒM¨D¯N©N¸e¿o¹oÑ,MˆJÜà—O‘O u×'7Ñ'7Ñ7Ø—N‘N dÐ*ÒE¨e¯o©oÀÐ.EðóˆJô �J 
Ð+Ô,Øô à—O‘OØ—O‘O u×'7Ñ'7Ñ7Ø—N‘N e§o¡oÑ5ðôðð ô 2°#Ó6Ð6Ør   c           	      óŒ  — t        |t        «      sd}t        |«      ‚|j                  r2| j                  r&|j                  | j                  k7  rd}t	        |«      ‚t        | «      D ][  }t        ||j                  «      sŒt        ||j                  «      sŒ1t        | |j                  t        ||j                  «      «       Œ] y)zCUpdates in-place a kernel from other (only accepts positive updatesz3'other' must be an instance of KernelSessionRecord.zJCould not update the record from 'other' because the two records conflict.N)
r#   r   Ú	TypeErrorr   r   r
   ÚhasattrÚnameÚgetattrÚsetattr)r&   r    r)   Úfields       r   ÚupdatezKernelSessionRecord.updateO   sŒ   € ä˜%Ô!4Ô5ØGˆCÜ˜C“.Ð à�?Š?˜tŸ~š~°%·/±/ÀTÇ^Á^Ò2SØ^ˆCÜ-¨cÓ2Ð2ä˜D–\ˆEÜ�u˜eŸj™jÕ)¬g°e¸U¿Z¹ZÕ.HÜ˜˜eŸj™j¬'°%¸¿¹Ó*DÕEñ "r   )r    r   r!   N)r   r   r   r   r   ÚstrÚ__annotations__r   ÚobjectÚboolr*   r2   r   r   r   r   r   #   s?   … ñð "€J��d‘
Ó!Ø €Iˆs�T‰zÓ ð˜Fð  tó ô@Fr   r   c                   ó†   — e Zd ZU dZee   ed<   defd„Zd„ Zdee	z  de
fd„Zd	„ Zdee	z  defd
„Zdeddfd„Zdeddfd„Zy)ÚKernelSessionRecordLista.  An object for storing and managing a list of KernelSessionRecords.

    When adding a record to the list, the KernelSessionRecordList
    first checks if the record already exists in the list. If it does,
    the record will be updated with the new information; otherwise,
    it will be appended.
    Ú_recordsÚrecordsc                 óB   — g | _         |D ]  }| j                  |«       Œ y©zInitialize a record list.N)r9   r2   )r&   r:   Úrecords      r   Ú__init__z KernelSessionRecordList.__init__i   s   € àˆŒÛˆFØ�K‰K˜Õñ r   c                 ó,   — t        | j                  «      S )z+The string representation of a record list.)r3   r9   ©r&   s    r   Ú__str__zKernelSessionRecordList.__str__o   ó   € ä�4—=‘=Ó!Ð!r   r=   r!   c                 ó¼   — t        |t        «      r|| j                  v ryt        |t        «      r-| j                  D ]  }||j                  |j
                  fv sŒ y y)z.Search for records by kernel_id and session_idTF)r#   r   r9   r3   r   r   )r&   r=   Úrs      r   Ú__contains__z$KernelSessionRecordList.__contains__s   sP   € ä�fÔ1Ô2°vÀÇÁÑ7NØä�fœcÔ"Ø—]”]�Ø˜aŸl™l¨A¯K©KÐ8Ò8Ùð #ð r   c                 ó,   — t        | j                  «      S )zThe length of the record list.)Úlenr9   r@   s    r   Ú__len__zKernelSessionRecordList.__len__~   rB   r   c                 óö   — t        |t        «      r0| j                  D ]   }||j                  |j                  fv sŒ|c S  n*t        |t
        «      r| j                  D ]  }||k(  sŒ	|c S  |› d�}t        |«      ‚)zsReturn a full KernelSessionRecord from a session_id, kernel_id, or
        incomplete KernelSessionRecord.
        z& not found in KernelSessionRecordList.)r#   r3   r9   r   r   r   Ú
ValueError)r&   r=   rD   r)   s       r   ÚgetzKernelSessionRecordList.get‚   sv   € ô �fœcÔ"Ø—]”]�Ø˜aŸk™k¨1¯<©<Ð8Ò8Ø’Hñ #ô ˜Ô 3Ô4Ø—]”]�Ø˜Q“;Ø!’Mð #ð �Ð>Ð?ˆÜ˜‹oÐr   Nc                 óÌ   — 	 | j                   j                  |«      }| j                   |   j                  |«       y# t        $ r | j                   j	                  |«       Y yw xY w)z9Update a record in-place or append it if not in the list.N)r9   Úindexr2   rJ   Úappend)r&   r=   Úidxs      r   r2   zKernelSessionRecordList.update‘   sS   € ð	)Ø—-‘-×%Ñ% fÓ-ˆCØ�M‰M˜#Ñ×%Ñ% fÕ-øÜò 	)Ø�M‰M× Ñ  Ö(ð	)ús   ‚9< ¼$A#Á"A#c                 óX   — || j                   v r| j                   j                  |«       yy)zYRemove a record if its found in the list. If it's not found,
        do nothing.
        N)r9   Úremove)r&   r=   s     r   rQ   zKernelSessionRecordList.remove™   s'   € ð �T—]‘]Ñ"Ø�M‰M× Ñ  Õ(ð #r   )r   r   r   r   Úlistr   r4   r>   rA   r3   r6   rE   rH   rK   r2   rQ   r   r   r   r8   r8   ^   s‡   … ñð Ð&Ñ'Ó'ð Ð!4ó  ò"ð	Ð#6¸Ñ#<ð 	Àó 	ò"ðÐ-°Ñ3ð Ð8Kó ð)Ð0ð )°Tó )ð)Ð0ð )°Tô )r   r8   c                   óâ  ‡ — e Zd ZdZ edd¬«      j                  d¬«      Z ed«      d„ «       Z e	d	«      Z
 ed
dg«      Zˆ fd„ZdZdZh d£Zed„ «       Zed„ «       Zd„ Zd„ Zd„ Zdefd„Z	 	 	 	 	 d&dedz  dedz  dedz  dedz  dedz  deeef   fd„Zd'dedz  dedz  deeef   fd„Z	 d'dededz  dedz  dedz  dedz  dedz  defd„Zd(d„Z d „ Z!d!„ Z"dede#fd"„Z$d)d#„Z%d$„ Z&d%„ Z'ˆ xZ(S )*ÚSessionManagerzA session manager.ú:memory:zíThe filesystem path to SQLite Database file (e.g. /path/to/session_database.db). By default, the session database is stored in-memory (i.e. `:memory:` setting from sqlite3) and does not persist when the current Jupyter Server shuts down.)Údefault_valueÚhelpT)ÚconfigÚdatabase_filepathc                 óL  — |d   }|dk(  r|S t        j                  |«      }|j                  «       rf|j                  «       rd}t	        |«      ‚t        |d«      5 }|j                  d«      }ddd«       j                  d«      s|dk7  rd	}t	        |«      ‚|S # 1 sw Y   Œ.xY w)
zValidate a database file path.ÚvaluerU   zL`database_filepath` expected a file path, but the given path is a directory.Úrbéd   Ns   SQLite format 3r   z.The given file is not an SQLite database file.)ÚpathlibÚPathÚexistsÚis_dirr   ÚopenÚreadÚ
startswith)r&   Úproposalr[   Úpathr)   ÚfÚheaders          r   Ú_validate_database_filepathz*SessionManager._validate_database_filepath®   sœ   € ð ˜Ñ!ˆØ�JÒØˆLÜ�|‰|˜EÓ"ˆØ�;‰;Œ=à�{‰{Œ}Ød�Ü  “oÐ%ä�e˜TÔ" aØŸ™ ›�÷ #ð ×$Ñ$Ð%7Ô8¸VÀsº]ØF�Ü  “oÐ%Øˆ÷ #Ð"ús   ÁBÂB#zBjupyter_server.services.kernels.kernelmanager.MappingKernelManagerz8jupyter_server.services.contents.manager.ContentsManagerz2notebook.services.contents.manager.ContentsManagerc                 óB   •— t        ‰| �  |i |¤Ž t        «       | _        yr<   )Úsuperr>   r8   Ú_pending_sessions)r&   ÚargsÚkwargsÚ	__class__s      €r   r>   zSessionManager.__init__Ë   s    ø€ ä‰Ñ˜$Ð) &Ò)Ü!8Ó!:ˆÕr   N>   r.   rf   Útyper   r   c                 ó¦   — | j                   €:| j                  j                  «       | _         | j                   j                  d«       | j                   S )z5Start a cursor and create a database called 'session'z\CREATE TABLE IF NOT EXISTS session
                (session_id, path, name, type, kernel_id))Ú_cursorÚ
connectionÚcursorÚexecuter@   s    r   rt   zSessionManager.cursorÕ   sE   € ð �<‰<ÐØŸ?™?×1Ñ1Ó3ˆDŒLØ�L‰L× Ñ ð=ôð �|‰|Ðr   c                 ó¼   — | j                   €Et        j                  | j                  d¬«      | _         t        j                  | j                   _        | j                   S )zStart a database connectionN)Úisolation_level)Ú_connectionÚsqlite3ÚconnectrY   ÚRowÚrow_factoryr@   s    r   rs   zSessionManager.connectionà   sH   € ð ×ÑÐ#ä&Ÿ™¨t×/EÑ/EÐW[Ô\ˆDÔÜ+2¯;©;ˆD×ÑÔ(Ø×ÑÐr   c                 ó`   — | j                   �"| j                   j                  «        d| _         yy)zClose the sqlite connectionN)rr   Úcloser@   s    r   r~   zSessionManager.closeé   s(   € à�<‰<Ð#Ø�L‰L×ÑÔ ØˆD�Lð $r   c                 ó$   — | j                  «        y)z+Close connection once SessionManager closesN)r~   r@   s    r   Ú__del__zSessionManager.__del__ï   s   € à�
‰
�r   c              ƒ   óÆ   K  — d}| j                   j                  d|f«       | j                   j                  «       }|�| j                  |d¬«      ƒ d{  –—† }|�d}|S 7 Œ
­w)z2Check to see if the session of a given name existsFz"SELECT * FROM session WHERE path=?NT)Útolerate_culled)rt   ru   ÚfetchoneÚrow_to_model)r&   rf   r`   ÚrowÚmodels        r   Úsession_existszSessionManager.session_existsó   si   è ø€ àˆØ�‰×ÑÐ@À4À'ÔJØ�k‰k×"Ñ"Ó$ˆØˆ?ð ×+Ñ+¨CÀÐ+ÓF×FˆEØÐ Ø�Øˆð Gús   ‚AA!ÁAÁA!r!   c                 ó<   — t        t        j                  «       «      S )zCreate a uuid for a new session)r3   ÚuuidÚuuid4r@   s    r   Únew_session_idzSessionManager.new_session_id  s   € ä”4—:‘:“<Ó Ð r   rf   r.   rp   Úkernel_namer   c              ƒ   ó®  K  — | j                  «       }t        |¬«      }| j                  j                  |«       |�|| j                  v rn| j                  ||||||¬«      ƒ d{  –—† }||_        | j                  j                  |«       | j                  |||||¬«      ƒ d{  –—† }| j                  j                  |«       t        d|«      S 7 Œk7 Œ-­w)zÖCreates a session and returns its model

        Parameters
        ----------
        name: ModelName(str)
            Usually the model name, like the filename associated with current
            kernel.
        ©r   N)r   rf   r.   rp   rŒ   r   )rf   r.   rp   r   zdict[str, Any])
r‹   r   rl   r2   Úkernel_managerÚstart_kernel_for_sessionr   Úsave_sessionrQ   r   )	r&   rf   r.   rp   rŒ   r   r   r=   Úresults	            r   Úcreate_sessionzSessionManager.create_session  sè   è ø€ ð  ×(Ñ(Ó*ˆ
Ü$°
Ô;ˆØ×Ñ×%Ñ% fÔ-ØÐ  Y°$×2EÑ2EÑ%EØà"×;Ñ;Ø%ØØØØ'Ø#ð <ó ÷ ˆIð %ˆÔØ×Ñ×%Ñ% fÔ-Ø×(Ñ(Ø˜T¨°4À9ð )ó 
÷ 
ˆð 	×Ñ×%Ñ% fÔ-ÜÐ$ fÓ-Ð-ðøð
ús$   ‚A#CÁ%CÁ&?CÂ%CÂ&,CÃCc                 óÌ   — |�;| j                   j                  |«      }t        j                  j	                  ||«      }t        |t        «      sJ ‚i t        j                  ¥d|i¥S )a[  Return the environment variables that need to be set in the kernel

        Parameters
        ----------
        path : str
            the url path for the given session.
        name: ModelName(str), optional
            Here the name is likely to be the name of the associated file
            with the current kernel at startup time.
        ÚJPY_SESSION_NAME)r�   Úcwd_for_pathÚosrf   Újoinr#   r3   Úenviron)r&   rf   r.   Úcwds       r   Úget_kernel_envzSessionManager.get_kernel_env-  s[   € ð ÐØ×%Ñ%×2Ñ2°4Ó8ˆCÜ—7‘7—<‘<  TÓ*ˆDÜ˜$¤Ô$Ð$Ð$Ø7”"—*‘*Ð7Ð0°$Ñ7Ð7r   r   c              ƒ   óö   K  — t        | j                  j                  |¬«      «      ƒ d{  –—† }| j                  ||«      }| j                  j                  ||||¬«      ƒ d{  –—† }t        d|«      S 7 ŒI7 Œ­w)at  Start a new kernel for a given session.

        Parameters
        ----------
        session_id : str
            uuid for the session; this method must be given a session_id
        path : str
            the path for the given session - seem to be a session id sometime.
        name : str
            Usually the model name, like the filename associated with current
            kernel.
        type : str
            the type of the session
        kernel_name : str
            the name of the kernel specification to use.  The default kernel name will be used if not provided.
        kernel_id : str, optional
            client-supplied UUID to register the new kernel under.  When
            provided, forwarded to ``kernel_manager.start_kernel`` so the
            kernel is created at that exact id.  If omitted, the kernel
            manager mints a fresh id.
        )rf   N)rf   rŒ   Úenvr   r3   )r   Úcontents_managerÚget_kernel_pathr›   r�   Ústart_kernelr   )	r&   r   rf   r.   rp   rŒ   r   Úkernel_pathÚ
kernel_envs	            r   r�   z'SessionManager.start_kernel_for_session>  sƒ   è ø€ ô> )¨×)>Ñ)>×)NÑ)NÐTXÐ)NÓ)YÓZ×Zˆà×(Ñ(¨¨tÓ4ˆ
Ø×-Ñ-×:Ñ:ØØ#ØØð	 ;ó 
÷ 
ˆ	ô �E˜9Ó%Ð%ð [øð
ús!   ‚)A9«A5¬8A9Á$A7Á%A9Á7A9c              ƒ   óˆ   K  — | j                   j                  d|||||f«       | j                  |¬«      ƒ d{  –—† }|S 7 Œ­w)aã  Saves the items for the session with the given session_id

        Given a session_id (and any other of the arguments), this method
        creates a row in the sqlite session database that holds the information
        for a session.

        Parameters
        ----------
        session_id : str
            uuid for the session; this method must be given a session_id
        path : str
            the path for the given session
        name : str
            the name of the session
        type : str
            the type of the session
        kernel_id : str
            a uuid for the kernel associated with this session

        Returns
        -------
        model : dict
            a dictionary of the session model
        z&INSERT INTO session VALUES (?,?,?,?,?)rŽ   N)rt   ru   Úget_session)r&   r   rf   r.   rp   r   r’   s          r   r‘   zSessionManager.save_sessionh  sM   è ø€ ð2 	�‰×ÑØ4Ø˜˜t T¨9Ð5ô	
ð ×'Ñ'°:Ð'Ó>×>ˆØˆð ?ús   ‚7A¹A ºAc              ‹   óÜ  K  — |sd}t        |«      ‚g }|D ]4  }|| j                  vrd|› �}t        |«      ‚|j                  d|z  «       Œ6 ddj                  |«      z  }| j                  j                  |t        |j                  «       «      «       	 | j                  j                  «       }|€Xg }|j                  «       D ]  \  }}	|j                  |› d|	›�«       Œ t        j                  dd	d
j                  |«      z  «      ‚	 | j                  |«      ƒ d{  –—† }
|
S # t        $ r d}Y Œƒw xY w7 Œ# t        $ r(}t        j                  dd	t        |«      z  «      |‚d}~ww xY w­w)a:  Returns the model for a particular session.

        Takes a keyword argument and searches for the value in the session
        database, then returns the rest of the session's info.

        Parameters
        ----------
        **kwargs : dict
            must be given one of the keywords and values from the session database
            (i.e. session_id, path, name, type, kernel_id)

        Returns
        -------
        model : dict
            returns a dictionary that includes all the information from the
            session described by the kwarg.
        zmust specify a column to queryzNo such column: ú%s=?zSELECT * FROM session WHERE %sz AND NÚ=i”  zSession not found: %sú, )r,   Ú_columnsrN   r˜   rt   ru   rR   Úvaluesrƒ   ÚKeyErrorÚitemsr   Ú	HTTPErrorr„   r3   )r&   rn   r)   Ú
conditionsÚcolumnÚqueryr…   ÚqÚkeyr[   r†   Úes               r   r¤   zSessionManager.get_sessionˆ  si  è ø€ ñ$ Ø2ˆCÜ˜C“.Ð àˆ
ÛˆFØ˜TŸ]™]Ñ*Ø(¨¨Ð1�Ü “nÐ$Ø×Ñ˜f v™oÕ.ð	 ð 1°G·L±LÀÓ4LÑMˆà�‰×Ñ˜E¤4¨¯©«Ó#8Ô9ð	Ø—+‘+×&Ñ&Ó(ˆCð
 ˆ;ØˆAØ$Ÿl™lžn‘
��UØ—‘˜C˜5  % Ð+Õ,ð -ô —-‘- Ð%<ÀÇ	Á	È!ÃÑ%MÓNÐNð	NØ×+Ñ+¨CÓ0×0ˆEð ˆøô ò 	àŠCð	úð 1ùÜò 	NÜ—-‘- Ð%<¼sÀ1»vÑ%EÓFÈAÐMûð	Nüsa   ‚BE,ÂD% Â/AE,Ä
D8 ÄD6ÄD8 Ä#E,Ä%D3Ä0E,Ä2D3Ä3E,Ä6D8 Ä8	E)Å#E$Å$E)Å)E,c              ‹   óR  K  — | j                  |¬«      ƒ d{  –—†  |syg }|D ]2  }|| j                  vrt        d|z  «      ‚|j                  d|z  «       Œ4 ddj	                  |«      z  }| j
                  j                  |g t        |j                  «       «      ¢|‘«       t        | j                  d«      ri| j
                  j                  d|g«       | j
                  j                  «       \  }}}| j                  j                  || j                  ||«      ¬	«       yy7 �Œ­w)
aõ  Updates the values in the session database.

        Changes the values of the session with the given session_id
        with the values from the keyword arguments.

        Parameters
        ----------
        session_id : str
            a uuid that identifies a session in the sqlite3 database
        **kwargs : str
            the key must correspond to a column title in session database,
            and the value replaces the current value in the session
            with session_id.
        rŽ   NzNo such column: %rr¦   z(UPDATE session SET %s WHERE session_id=?r¨   Ú
update_envz<SELECT path, name, kernel_id FROM session WHERE session_id=?)r   r�   )r¤   r©   r,   rN   r˜   rt   ru   rR   rª   r-   r�   rƒ   rµ   r›   )	r&   r   rn   Úsetsr¯   r°   rf   r.   r   s	            r   Úupdate_sessionzSessionManager.update_session»  s  è ø€ ð ×Ñ¨*ÐÓ5×5Ð5áààˆÛˆFØ˜TŸ]™]Ñ*ÜÐ 4°vÑ =Ó>Ð>Ø�K‰K˜ ™Õ(ð ð ;¸d¿i¹iÈ»oÑNˆØ�‰×Ñ˜EÐ#G¤T¨&¯-©-«/Ó%:Ð#G¸JÐ#GÔHä�4×&Ñ&¨Ô5Ø�K‰K×ÑØNÐQ[ÐP\ôð %)§K¡K×$8Ñ$8Ó$:Ñ!ˆD�$˜	Ø×Ñ×*Ñ*°YÀD×DWÑDWÐX\Ð^bÓDcÐ*Õdð 6ð 	6ûs   ‚D'˜D$™DD'c              ƒ   ó&   K  — || j                   vS ­w)zQChecks if the kernel is still considered alive and returns true if its not found.)r�   )r&   r   s     r   Úkernel_culledzSessionManager.kernel_culledß  s   è ø€ à × 3Ñ 3Ð3Ð3ùs   ‚c              ƒ   óà  K  — t        | j                  |d   «      «      ƒ d{  –—† }|re| j                  j                  d|d   f«       dj	                  |d   |d   ¬«      }|r| j
                  j                  |› d�«       yt        |«      ‚t        | j                  j                  |d   «      «      ƒ d{  –—† }|d   |d   |d	   |d
   |dœ}|d
   dk(  r|d   |d	   dœ|d<   |S 7 ŒÆ7 Œ2­w)z@Takes sqlite database session row and turns it into a dictionaryr   Nú&DELETE FROM session WHERE session_id=?r   z‰Kernel '{kernel_id}' appears to have been culled or died unexpectedly, invalidating session '{session_id}'. The session has been removed.)r   r   z  Continuing...rf   r.   rp   )Úidrf   r.   rp   ÚkernelÚnotebook)rf   r.   )
r   r¹   rt   ru   ÚformatÚlogÚwarningr«   r�   Úkernel_model)r&   r…   r‚   r¹   r)   rÂ   r†   s          r   r„   zSessionManager.row_to_modelã  s  è ø€ ä$0°×1CÑ1CÀCÈÑDTÓ1UÓ$V×VˆÙð �K‰K×ÑÐ HÈ3È|ÑK\ÐJ^Ô_ðUßU[ÑU[Ø! +Ñ.¸3¸|Ñ;Lð V\ó Vð ñ Ø—‘× Ñ  C 5¨Ð!8Ô9ØÜ˜3“-Ðä)¨$×*=Ñ*=×*JÑ*JÈ3È{ÑK[Ó*\Ó]×]ˆà�lÑ#Ø˜‘KØ˜‘KØ˜‘KØ"ñ
ˆð ˆv‰;˜*Ò$à),¨V©¸cÀ&¹kÑ JˆE�*ÑØˆðA Wøð* ^ús"   ‚!C.£C*¤BC.Â9C,Â:1C.Ã,C.c              ƒ   óê   K  — | j                   j                  d«      }g }|j                  «       D ]-  }	 | j                  |«      ƒ d{  –—† }|j	                  |«       Œ/ |S 7 Œ# t
        $ r Y Œ?w xY w­w)z_Returns a list of dictionaries containing all the information from
        the session databasezSELECT * FROM sessionN)rt   ru   Úfetchallr„   rN   r«   )r&   Úcr’   r…   r†   s        r   Úlist_sessionszSessionManager.list_sessions  su   è ø€ ð �K‰K×ÑÐ 7Ó8ˆØˆð —:‘:–<ˆCðØ"×/Ñ/°Ó4×4�Ø—‘˜eÕ$ð  ð ˆð	 5ùäò Ùðüs:   ‚1A3´A$ÁA"Á	A$ÁA3Á"A$Á$	A0Á-A3Á/A0Á0A3c              ƒ   ój  K  — t        |¬«      }| j                  j                  |«       | j                  |¬«      ƒ d{  –—† }t	        | j
                  j                  |d   d   «      «      ƒ d{  –—†  | j                  j                  d|f«       | j                  j                  |«       y7 Œo7 Œ?­w)z=Deletes the row in the session database with given session_idrŽ   Nr½   r¼   r»   )
r   rl   r2   r¤   r   r�   Úshutdown_kernelrt   ru   rQ   )r&   r   r=   Úsessions       r   Údelete_sessionzSessionManager.delete_session  s™   è ø€ ä$°
Ô;ˆØ×Ñ×%Ñ% fÔ-Ø×(Ñ(°JÐ(Ó?×?ˆÜ˜4×.Ñ.×>Ñ>¸wÀxÑ?PÐQUÑ?VÓWÓX×XÐXØ�‰×ÑÐDÀzÀmÔTØ×Ñ×%Ñ% fÕ-ð @øØXús"   ‚=B3¿B/Á 1B3Á1B1Á2>B3Â1B3)NNNNN)N)NNNN)F))r   r   r   r   r   ÚtagrY   r   ri   r   r�   r   rž   r>   rr   rx   r©   Úpropertyrt   rs   r~   r€   r‡   r3   r‹   r   r   Údictr   r“   r›   r�   r‘   r¤   r·   r6   r¹   r„   rÆ   rÊ   Ú__classcell__)ro   s   @r   rT   rT   ¡   sø  ø„ ÙáØ ðOô÷ 
�c�€cÓð ñ Ð!Ó"ñó #ðñ( ÐbÓc€NÙ*àFØ@ð	
óÐô;ð €GØ€KÚB€Hàñó ðð ñ ó ð ò òòð ! ó !ð  Ø!%ØØ)-Ø $ñ$.à�D‰jð$.ð ˜$Ñð$.ð �D‰jð	$.ð
   $Ñ&ð$.ð ˜‘:ð$.ð 
ˆc�3ˆh‰ó$.ñL8 3¨¡:ð 8°YÀÑ5Eð 8ÐQUÐVYÐ[^ÐV^ÑQ_ó 8ð0 !%ñ(&àð(&ð �D‰jð(&ð ˜$Ñð	(&ð
 �D‰jð(&ð   $Ñ&ð(&ð ˜‘:ð(&ð 
ó(&óTò@1òf"eðH4¨Sð 4°Tó 4ó"òHö.r   rT   )$r   r—   r^   r‰   Útypingr   r   r   r3   r   r   ry   ÚImportErrorÚ	pysqlite2r   Údataclassesr	   r
   Újupyter_core.utilsr   Útornador   Ú	traitletsr   r   r   r   Útraitlets.config.configurabler   Újupyter_server.traittypesr   Ú	Exceptionr   r   r8   rT   r   r   r   Ú<module>rÙ      sª   ðÙ #ó 
Û Û ß %Ñ %á�\ 3Ó'€
Ù�K Ó%€	ð,Û÷
 *å +Ý ß =Ó =Ý =å 9ô )ô ð ÷7Fð 7Fó ð7F÷t@)ñ @)ôF|.Ð(õ |.øðe ò ,ç+ð,ús   ¬B ÂBÂB