
    Ngf&                     (   d dl mZmZ d dlZd dl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Z e ej                    dz            Zn# e$ r dZd ZY nw xY w G d	 d
e          Zd Zd Zd Zd Zd Zd Zd ZddZedk    r e             dS dS )    )absolute_importprint_functionN   )	cythonizeextended_iglob   )is_package_dir)Optionsg      ?c                   &    e Zd Zd Zd Zd Zd ZdS )	_FakePoolc                 b    	 ddl m} n# t          $ r
 t          }Y nw xY w |||          D ]}d S )Nr   )imap)	itertoolsr   ImportErrormap)selffuncargsr   _s        R/var/www/html/ai-engine/env/lib/python3.11/site-packages/Cython/Build/Cythonize.py	map_asyncz_FakePool.map_async   sh    	&&&&&&& 	 	 	DDD	dD!! 	 	A	 	s   	 c                     d S N r   s    r   closez_FakePool.close           c                     d S r   r   r   s    r   	terminatez_FakePool.terminate   r   r   c                     d S r   r   r   s    r   joinz_FakePool.join"   r   r   N)__name__
__module____qualname__r   r   r    r"   r   r   r   r   r      sP                  r   r   c                     t           j                            |           \  }}t          |          r8t           j                            |          \  }}|d|}t          |          8||fS )N/)ospathsplitr	   )r)   base_dirpackage_pathparents       r   find_package_baser.   &   sq    W]]400Hl

"
" 87==22&"(&&,,7 
"
" 8 \!!r   c                 ~    t          t          j        j        t	          |                     }t          ||           d S r   )r   r(   r)   abspathr   _cython_compile_files)path_patternoptions	all_pathss      r   cython_compiler5   -   s3    BGO^L%A%ABBI)W-----r   c                    d }	 | D ]}|j         r~|t          j                                      rt	                    rMt          j                                      t          j                                      >t	                    Mnd t          j                            |          r#t          j                            |dd          g}n|g}t          |f|j        |j	        |j
        |j        |j        |j        |j        |j        |j        d	|j        }|r|j        rt'          |          dk    ro|j        dk    rd|9	 t)          j        |j                  }n# t,          $ r t/                      }Y nw xY w|                    t2          fd|D                        t3          |f           	 |*|                                 |                                 d S d S #  ||                                  xY w)Nz**z
*.{py,pyx})	nthreadsexclude_failuresexcludecompiler_directivescompile_time_envforcequietdepfilelanguager   c                     g | ]}|gfS r   r   ).0extr+   s     r   
<listcomp>z)_cython_compile_files.<locals>.<listcomp>W   s3     3B 3B 3B.1C5)3B 3B 3Br   )build_inplacer(   r)   isdirr	   dirnamer"   r   parallel
keep_goingexcludes
directivesr;   r<   r=   r>   r?   r3   buildlenmultiprocessingPoolOSErrorr   r   run_distutilsr   r    )r4   r3   poolr)   pathsext_modulesr+   s         @r   r1   r1   1   s^   D/ &	; &	;D$  '--11 9^H5M5M 9!wx88H '--11 9^H5M5M 9  w}}T"" dD,??@ ## )!(!3($+$6!(!9mm )# # /# #K  
;w} 
;{##a''G,<q,@,@|/#2#78H#I#IDD& / / /#,;;DDD/NN= 3B 3B 3B 3B5@3B 3B 3B C C C C "8["9:::M&	;X JJLLLIIKKKKK NNs0   EG, 	E#"G, #E>;G, =E>>?G, ,Hc                    	 ddl m} n5# t          $ r( 	 ddlm} n# t          $ r t          d          w xY wY nw xY w| \  }}ddg}t	          j                    }d }	 |r@t	          j        |           t          j        |          }|	                    d|g            |d||	           |rKt	          j        |           |r7t          j
                            |          rt          j        |           d S d S d S d S # |rJt	          j        |           |r5t          j
                            |          rt          j        |           w w w w xY w)
Nr   )setupzL'distutils' is not available. Please install 'setuptools' for binary builds.	build_ext-i)dirz--build-tempzsetup.py)script_namescript_argsrS   )distutils.corerU   r   
setuptoolsr(   getcwdchdirtempfilemkdtempextendr)   rE   shutilrmtree)r   rU   r+   rS   rZ   cwdtemp_dirs          r   rP   rP   e   s   n((((((( n n n	n((((((( 	n 	n 	nlmmm	n )(n !Hk%K
)++CH( 	;HX'H555H9:::"##	
 	
 	
 	
  	(HSMMM (BGMM(33 (h'''''	( 	(( ( ( (  	(HSMMM (BGMM(33 (h''''	(( (s*   	 
;;5;;AD   AEc            
         ddl m} m} ddlm}m}m}  | |d          }|                    ddd	d
i t          |d           |                    ddd	di t          |d           |                    ddddi t          |d           |                    ddddd d           |                    ddddd           |                    dddd d           |                    d!d"d#dd$d d%           |                    d&d'dd(d)d*+           |                    d,dd-d)d.+           |                    d/d0d1d2d3g d45           |                    d6d7d8d9d d:;           |                    d<d=d>d9d d?;           |                    d@dAdBdCt          t          dDt          z  pdEF           |                    dGdHdId9d dJ;           |                    dKdLdMd9d dN;           |                    dOdPd9d dQ;           |                    dRdSdTd9d dU;           |                    dVdWd9d dX;           |                    dYdZd9d[\           |                    d]d^_           |S )`Nr   )ArgumentParserRawDescriptionHelpFormatterr   )ParseDirectivesActionParseOptionsActionParseCompileTimeEnvActionaa  Environment variables:
  CYTHON_FORCE_REGEN: if set to 1, forces cythonize to regenerate the output files regardless
        of modification times and changes.
  Environment variables accepted by setuptools are supported to configure the C compiler and build:
  https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#compiler-and-linker-options)formatter_classepilogz-Xz--directivezNAME=VALUE,...rJ   zset a compiler directive)metavardestdefaulttypeactionhelpz-Ez--compile-time-envr;   z'set a compile time environment variablez-sz--optionz
NAME=VALUEr3   zset a cythonize optionz-2language_levelstore_constz#use Python 2 syntax mode by default)ro   rr   constrp   rs   z-3   z#use Python 3 syntax mode by default)ro   rr   rv   rs   z--3str3strz-+z--cplusr?   zc++zCompile as C++ rather than Cz-az
--annotaterp   annotatez/Produce a colorized HTML version of the source.)rr   rv   ro   rs   z--annotate-fullcfullczZProduce a colorized HTML version of the source which includes entire generated C/C++-code.z-xz	--excludePATTERNrI   appendz2exclude certain file patterns from the compilation)rn   ro   rr   rp   rs   z-bz--buildrK   
store_truez2build extension modules using distutils/setuptools)ro   rr   rp   rs   rW   z	--inplacerD   zHbuild extension modules in place using distutils/setuptools (implies -b)z-jz
--parallelrG   Nz+run builds in N parallel jobs (default: %d)r   )ro   rn   rq   rp   rs   z-fz--forcer<   zforce recompilationz-qz--quietr=   z"be less verbose during compilationz	--lenientlenientzBincrease Python compatibility by ignoring some compile time errorsz-kz--keep-goingrH   z8compile as much as possible, ignore compilation failuresz--no-docstringsno_docstringszstrip docstringsz-Mz	--depfilez produce depfiles for the sources)rr   rs   sources*)nargs)argparserg   rh   Compiler.CmdLineri   rj   rk   add_argumentstrintparallel_compiles)rg   rh   ri   rj   rk   parsers         r   create_args_parserr      s   DDDDDDDDgggggggggg^3a  F m5E'#25  7 7 7 2<L-r6D  F F F j,$bs/3  5 5 5 #3MQR\`@  B B B
#3MQR@  B B B
'7U[@  B B B
ijV[ei;  = = =
l=	XbL  N N N
*=V`I  J J J k9:%rO  Q Q Q iglTXO  Q Q Q
k^be  g g g
lS(9I-. 312  5 5 5 iglTX0  2 2 2
iglTX?  A A A )LRV_  a a a
n<^bU  W W W
)^b-  / / /
k,Eghhh
	---Mr   c                     |                      |          \  }}|j        }|D ]E}|                    d          r|                     d|z              0|                    |           F|`||fS )N-zunknown option )parse_known_argsr   
startswitherrorr|   )r   r   r3   unknownr   options         r   parse_args_rawr      s    ..t44GWoG  # #S!! 	#LL*612222NN6""""Wr   c                    t                      }t          ||           \  }} | s|                    d           |j        rd|_        t
          d|_        |j        r|j        dv sJ |j        |j        d<   |j	        rdt          _        dt          _        |j        r|j        t          _        |j        rdt          _        || fS )Nzno source files providedTr   )r   rw   rx   rt   F)r   r   r   rD   rK   rM   rG   rt   r3   r   r
   error_on_unknown_nameserror_on_uninitializedry   r   
docstrings)r   r   r3   s      r   
parse_argsr      s    !!F"6400MGT 1/000  C%7777,3,B() /).&).& ,"+ #"D=r   c                 T   t          |           \  }}g }|D ]}d t          |          D             }|sNdd l}t          d                    |j        d         |          |j                   |                    d           |                    |           t          ||           d S )Nc                 L    g | ]!}t           j                            |          "S r   )r(   r)   r0   )rA   ps     r   rC   zmain.<locals>.<listcomp>   s&    JJJ++JJJr   r   z#{}: No such file or directory: '{}')filer   )
r   r   sysprintformatargvstderrexitra   r1   )r   r3   rR   r4   r)   expanded_pathr   s          r   mainr      s    %%NGUI ( (JJ^D5I5IJJJ 	JJJ7>>sx{DQQX[XbccccHHQKKK'''')W-----r   __main__r   )
__future__r   r   r(   rb   r_   Dependenciesr   r   Utilsr	   Compilerr
   rM   r   	cpu_countr   r   objectr   r.   r5   r1   rP   r   r   r   r   r#   r   r   r   <module>r      s   6 6 6 6 6 6 6 6 				   3 3 3 3 3 3 3 3 " " " " " "      5O577#=>>   O
       &" " ". . .1 1 1h( ( (<@ @ @F    8. . . . zDFFFFF s   A
 
	AA