
    Mh:                        d Z ddlZddlZddlZddlmZ d Zd Zej        dk    rO	 ddl	Z	ddl
mZmZmZmZ e	j        j        j        Zeeege_        ee_        d Z ee           eZn# e$ r Y nw xY wd	 Zd
 Zd Z G d de          ZdS )z"Compiler helpers for the debugger.    N)CachingCompilerc                    d}d t                               | d          D             } t          |           }||z  }|dz  }t          d|d          D ]}t	          | |                   dz  t	          | |dz                      dz  d	z  z  t	          | |d
z                      dz  dz  z  t	          | |dz                      dz  z  }||z  dz  }||dz	  z  }||z  dz  }||z  dz  }||z  }|dz  }d}|dk    rt	          | |d
z                      dz  dz  }|dv r!|t	          | |dz                      dz  d	z  z  }|dv r(|t	          | |                   dz  z  }||z  }||z  dz  }||dz	  z  }||z  dz  }||dz	  z  }|S )zGet the murmur2 hash.i[c                 ,    g | ]}t          |          S  )chr).0ds     R/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipykernel/compiler.py
<listcomp>zmurmur2_x86.<locals>.<listcomp>   s    555qCFF555    utf8l    r                           l    )r   r   )r   r   r         )strencodelenrangeord)	dataseedmlengthhrounded_endikvals	            r
   murmur2_x86r&   	   s   A55CJJtV44555DYYFvA:%K1k1%%  a\\D DQK  4'A-/DQK  4'B.0 4A;2%' 	
 Uj 	Q"WUj Uj 	Q
4-C	A
axxkAo&''$.25
f}}	c${Q'((4/A55
i	Sk"##d**	QUj bLA	
Q*AbLAHr   c                     | S )Nr   )filenames    r
   <lambda>r)   0   s    H r   win32)DWORDLPCWSTRLPWSTRMAX_PATHc                     t          j        t                    }t          | |t                    }|dk    r|t          k    r|j        } | S )Nr   )ctypescreate_unicode_bufferr.   _GetLongPathNamevalue)r(   bufrvs      r
   _convert_to_long_pathnamer6   ;   s@    .x88C!(C::BQww2>>9Or   c                      t          t          j                              } t          j                    }| t          j        z   dz   t          |          z   S )zGet a temp directory.
ipykernel_)convert_to_long_pathnametempfile
gettempdirosgetpidsepr   )tmp_dirpids     r
   get_tmp_directoryrA   J   s@    &x':'<'<==G
)++CRVl*SXX55r   c                      dS )zGet a temp hash seed.l   i r   r   r   r
   get_tmp_hash_seedrC   Q   s    :r   c                     t           j                            d          }|Jt          | t	                                }t                      t           j        z   t          |          z   dz   }|S )zGet a file name.IPYKERNEL_CELL_NAMENz.py)r<   environgetr&   rC   rA   r>   r   )code	cell_namenames      r
   get_file_namerK   V   sZ    
455I4!2!4!455%''"&03t99<uD	r   c                   (     e Zd ZdZ fdZd Z xZS )XCachingCompilerzA custom caching compiler.c                 H     t                      j        |i | d| _        dS )zInitialize the compiler.N)super__init__log)selfargskwargs	__class__s      r
   rP   zXCachingCompiler.__init__b   s*    $)&)))r   c                      t          |          S )zGet the code name.)rK   )rR   raw_coderH   numbers       r
   get_code_namezXCachingCompiler.get_code_nameg   s    X&&&r   )__name__
__module____qualname____doc__rP   rY   __classcell__)rU   s   @r
   rM   rM   _   sM        $$    
' ' ' ' ' ' 'r   rM   )r]   r<   sysr:   IPython.core.compileropr   r&   r9   platformr0   ctypes.wintypesr+   r,   r-   r.   windllkernel32GetLongPathNameWr2   argtypesrestyper6   __file__	ExceptionrA   rC   rK   rM   r   r   r
   <module>rj      si   ( ( 				 



  3 3 3 3 3 3$ $ $N 54 <7=DDDDDDDDDDDD!=1B%,fe$<!#( 	 	 	 	"!(+++ $=      6 6 6  
  
' 
' 
' 
' 
' 
' 
' 
' 
' 
's   A A* *A21A2