
    Ng	                         d dl mZ d dlZd dlZd dlZ	 d dlmZ dZn5# e$ r- dZ	 d dl	m
Z n # e$ r 	 d dl	mZ n# e$ r dZY nw xY wY nw xY wY nw xY wdd	lmZ dd
lmZ d Z G d de          ZdS )    )absolute_importN)etreeTF)cElementTree)ElementTree   )Errors)EncodedStringc                     t          | t                    r3|                     d          r| dd                                         rdS dS )z
    Names like '.0' are used internally for arguments
    to functions creating generator expressions,
    however they are not identifiers.

    See https://github.com/cython/cython/issues/5552
    .   NFT)
isinstancer	   
startswith	isdecimal)names    W/var/www/html/ai-engine/env/lib/python3.11/site-packages/Cython/Debugger/DebugWriter.pyis_valid_tagr      sO     $&& ??3 	DH$6$6$8$8 	54    c                   2    e Zd ZdZd ZddZd Zd Zd ZdS )	CythonDebugWriterz
    Class to output debugging information for cygdb

    It writes debug information to cython_debug/cython_debug_info_<modulename>
    in the build directory.
    c                 $   t           t          j                    t          j                            |pt          j        d          | _        t          j                    | _	        d | _
        |                     dt          d                     d S )Ncython_debugz1.0)version)attrs)r   r   NoElementTreeInstalledExceptionospathjoincurdir
output_dirTreeBuildertbmodule_namestartdict)selfr   s     r   __init__zCythonDebugWriter.__init__.   ss    =8:::',,z'>RYOO#%%

>e)<)<)<
=====r   Nc                 b    t          |          r| j                            ||pi            d S d S N)r   r!   r#   r%   r   r   s      r   r#   zCythonDebugWriter.start8   s<     	-GMM$,,,,,	- 	-r   c                 \    t          |          r| j                            |           d S d S r(   )r   r!   end)r%   r   s     r   r+   zCythonDebugWriter.end<   s6     	GKK	 	r   c                     t          |          r7| j                            ||           | j                            |           d S d S r(   )r   r!   r#   r+   r)   s      r   	add_entryzCythonDebugWriter.add_entry@   sL     	GMM$&&&GKK	 	r   c                    | j                             d           | j                             d           | j                                         }	 t          j        | j                   n-# t          $ r }|j        t          j        k    r Y d }~nd }~ww xY wt          j
        |          }i }t          rd|d<   d| j        z   } |j        t          j                            | j        |          fddi| t          j                            | j        d          }t!          |d	          5 }|                    t"          j                   d d d            d S # 1 swxY w Y   d S )
NModuler   Tpretty_printcython_debug_info_encodingzUTF-8interpreterw)r!   r+   closer   makedirsr   OSErrorerrnoEEXISTr   r   	have_lxmlr"   writer   r   opensys
executable)r%   xml_root_elementeetkwfninterpreter_pathfs           r   	serializezCythonDebugWriter.serializeE   s   HN###7==??	K(((( 	 	 	w%,&& '&&&&	 /00 	&!%B~!D$44dor22KKWKKKK7<<GG"C(( 	$AGGCN###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s*   A) )
B3BB* EEEr(   )	__name__
__module____qualname____doc__r&   r#   r+   r-   rF    r   r   r   r   &   sn         > > >- - - -    
$ $ $ $ $r   r   )
__future__r   r   r=   r8   lxmlr   r:   ImportError	xml.etreer   r   Compilerr   Compiler.StringEncodingr	   r   objectr   rK   r   r   <module>rS      sP   & & & & & & 				 



 II   I3333333   	6666666 	 	 	EEE		       3 3 3 3 3 3  4$ 4$ 4$ 4$ 4$ 4$ 4$ 4$ 4$ 4$sO    A,AA	9A	A A	AA	AA		AA