
    i4                     
   S SK rS SKrS SKrS SKrS SKrS SKJr  S SKJ	r	  SSK
JrJr  SSKJr  SSKJr   S SKrS	 rS
 rS\4S jr\	S 5       rS rS rSS jrS rS rS rSS jr\S:X  a  \" 5         gg! \ a    Sr NGf = f)    N)defaultdict)contextmanager   )	cythonizeextended_iglob   )is_package_dir)Optionsc                     [         R                  R                  U 5      u  p[        U5      (       a<  [         R                  R                  U5      u  pU< SU< 3n[        U5      (       a  M<  X4$ )N/)ospathsplitr	   )r   base_dirpackage_pathparents       V/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/Cython/Build/Cythonize.pyfind_package_baser      sY    WW]]40H

"
"77==2"(,7 
"
" !!    c                     [        [        R                  R                  [	        U 5      5      n[        X!5      n[        [        UR                  5       5      UR                  5        g N)
mapr   r   abspathr   _cython_compile_files_buildlistitemsparallel)path_patternoptions	all_pathsext_modules_by_basedirs       r   cython_compiler#      sE    BGGOO^L%ABI29F
4&,,./1A1ABr   returnc                 x   [        [        5      nU  GH  nUR                  (       a  Un[        R                  R                  U5      (       a  [        U5      (       aW  [        R                  R                  U5      n[        R                  R                  U5      (       d  ME  [        U5      (       a  MW  OS n[        R                  R                  U5      (       a#  [        R                  R                  USS5      /nOU/n[        U4UR                  UR                  UR                  UR                  UR                  UR                  UR                   UR"                  UR$                  S.	UR&                  D6nU(       d  GMs  UR(                  (       d  GM  X$   R+                  U5        GM     [-        U5      $ )Nz**z
*.{py,pyx})	nthreadsexclude_failuresexcludecompiler_directivescompile_time_envforcequietdepfilelanguage)r   r   build_inplacer   r   isdirr	   dirnamejoinr   r   
keep_goingexcludes
directivesr*   r+   r,   r-   r.   r    buildextenddict)r!   r    ext_modules_to_buildr   r   pathsext_moduless          r   r   r   !   sI   &t,  HggmmH--1I1I77??84 ggmmH--1I1I H77==WW\\$l;<E FE%%$//$$ ' 2 2$55----OO%% oo ;7=== *11+>; > $%%r   c              #      #    U  n Uv    S S S 5        g ! [          a!    UR                  5         UR                  SS9  e f = f! , (       d  f       g = f7f)NT)cancel_futures)KeyboardInterruptterminate_workersshutdown)pool_cm	proc_pools     r   _interruptible_poolrC   F   sS     	I	O 
 ! 	'')d3	 
s*   AA	A+A  A
AAc                    [        S U  5       5      nU(       d  g US:H  =(       d    US L=(       a    US:  n U(       a  S O[        R                  R                  US9nU(       a  U  H  n[        U5        M     g [        W5       nU  VVVs/ s H'  u  pxU  H  nUR                  [        Xu/45      PM     M)     n	nnn[        R                  R                  U	[        R                  R                  S9  / n
U	 H  n UR                  5         M     U
(       a  SnUSR                  S	/[        [         U
5      Q75      -  nUS
-  nU
 Vs/ s H  n[#        U[$        5      (       d  M  UPM     nn[&        R(                  S S S:  a  U(       a  [+        X5      e[-        U5      U
S   e S S S 5        g ! [        [
        4 a    Sn GNff = fs  snnnf ! [         a  nU
R                  U5         S nAM  S nAff = fs  snf ! , (       d  f       g = f)Nc              3   <   #    U  H  u  p[        U5      v   M     g 7fr   )len).0_moduless      r   	<genexpr>_build.<locals>.<genexpr>R   s     >+JA3w<<+s   r   r   )max_workersT)return_whenz4Compiling Cython modules failed with these errors:

z
	*  z

)      r   )sum
concurrentfuturesProcessPoolExecutorOSErrorImportErrorrun_distutilsrC   submitwaitFIRST_EXCEPTIONresultBaseExceptionappendr2   r   str
isinstance	Exceptionsysversion_infoExceptionGroupRuntimeError)r;   r   modcountserial_execution_moderA   extrB   r   rI   compiler_tasksworker_exceptionstaskproc_errexc_msgexcnon_base_exceptionss                   r   r   r   Q   s   >+>>H$M /-A %)D##77H7M 	 C# 	W	% &1
%0! ]Xu,=> ?%0 	 
 	J<N<N<^<^_"D3 # NGx}}b%G3s4E+F%GHHGvG  1#0c9- 0   # #w.3F$WBB"7+1B11EE ! 
&	% [! % !%%
 ! 3!((223#+ 
&	%sl   &F/ G=.G
:AG=<G<G=G8%G8+:G=/GGG=
G5G0*G=0G55G==
Hc                     SSK Jn  U u  p#SS/n[        R
                  " 5       nS n U(       a=  [        R                  " U5        [        R                  " US9nUR                  SU/5        U" SUUS	9  U(       aZ  [        R                  " U5        U(       a<  [        R                  R                  U5      (       a  [        R                  " U5        g g g g ! [         a#     SSKJn   N! [         a    [        S5      ef = ff = f! U(       aZ  [        R                  " U5        U(       a<  [        R                  R                  U5      (       a  [        R                  " U5        f f f f = f)
Nr   )setupzL'distutils' is not available. Please install 'setuptools' for binary builds.	build_ext-i)dirz--build-tempzsetup.py)script_namescript_argsr;   )distutils.corerp   rV   
setuptoolsr   getcwdchdirtempfilemkdtempr7   r   r0   shutilrmtree)argsrp   r   r;   ru   cwdtemp_dirs          r   rW   rW      s+   n( !H%K
))+CH(HHX''H5H9:"##	
 HHSMBGGMM(33h' 4x +  n	n( 	nlmm	nn* HHSMBGGMM(33h' 4x s*   C AD 
D!C))C??DA#E)c                   ^ SSK Jn  U" XX#SS9u  pVSSSSS	.n[        UR                  5       5       VV	s/ s H  u  pX4PM
     sn	nmU4S
 jn
UR	                  5         [        U5      S-  S:X  d   eUS   U[        U5      S-     US   pn[        U S[        U5       SU
" U5       SU
" U5       S35        XS-  :  a  [        SU
" U5       SU
" U5       S35        g g s  sn	nf )Nr   )cymeit	   )repeatg&.>gư>gMbP?g      ?)nsecusecmsecsecc                 R   > T H  u  pX:  d  M    O   [        S5      eX-  S SU 3$ )Nz"Timing is below nanoseconds: {t:f}z.3f )rd   )tscaleunitscaless      r   format_timebenchmark.<locals>.format_time   s;    !KEz " CDD)S!4&))r   r   r   z loops, best of z: z per loop (median: )   z3The timings are likely unreliable. The worst time (z6) was more than four times slower than the best time (z).)Cython.Build.Inliner   reversedr   sortrF   print)code
setup_codeimport_moduler5   r   timingsnumberunitsr   r   r   fastestmedianslowestr   s                 @r   	benchmarkr      s   *T}QRSOG 4cBE/7/FG/Fum/FGF* LLNw<!q   &qz73w<13D+Ewr{WG	VH$S\N"[5I4JJ]^ijp^q]rrs
tu1*734 5**5g*>)?rC	D ! Hs   C c                     SSK Jn Jn  SSKJnJnJn  U " USS9nUR                  SSS	S
0 [        USS9  UR                  SSS	S0 [        USS9  UR                  SSSS0 [        USS9  UR                  SSSSS SS9  UR                  SSSSSS9  UR                  SSSSS S9  UR                  S!S"S#SS$S S%S9  UR                  S&S'SS(S)S*S+9  UR                  S,SS-S)S.S+9  UR                  S/S0S1S2S3/ S4S59  UR                  S6S7S8S9S S:S;9  UR                  S<S=S>S9S S?S;9  UR                  S@SASB[        S SCSD9  UR                  SESFSB[        S SGSD9  UR                  SHSISJSK[        S SLSD9  UR                  SMSNSOS9S SPS;9  UR                  SQSRSSS9S STS;9  UR                  SUSVS9S SWS;9  UR                  SXSYSZS9S S[S;9  UR                  S\S]S9S S^S;9  UR                  S_S`S9SaSb9  UR                  ScSdSe9  U$ )fNr   )ArgumentParserRawDescriptionHelpFormatterr   )ParseDirectivesActionParseOptionsActionParseCompileTimeEnvActiona  Environment variables:
  CYTHON_FORCE_REGEN: if set to 1, forces cythonize to regenerate the output files regardless
        of modification times and changes.
  CYTHON_CACHE_DIR: the base directory containing Cython's caches.
  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,...r5   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=VALUEr    zset a cythonize optionz-2language_levelstore_constz#use Python 2 syntax mode by default)r   r   constr   r   z-3rO   z#use Python 3 syntax mode by default)r   r   r   r   z--3strz=use Python 3 syntax mode by default (deprecated alias for -3)z-+z--cplusr.   zc++zCompile as C++ rather than Cz-az
--annotater   annotatez/Produce a colorized HTML version of the source.)r   r   r   r   z--annotate-fullcfullczZProduce a colorized HTML version of the source which includes entire generated C/C++-code.z-xz	--excludePATTERNr4   r]   z2exclude certain file patterns from the compilation)r   r   r   r   r   z-bz--buildr6   
store_truez2build extension modules using distutils/setuptools)r   r   r   r   rr   z	--inplacer/   zHbuild extension modules in place using distutils/setuptools (implies -b)z--timeitr   
CODESTRINGzabuild in place, then compile+run CODESTRING as benchmark in first module's namespace (implies -i))r   r   r   r   r   z--setupbenchmark_setupz6use CODESTRING as pre-benchmark setup code for --benchz-jz
--parallelr   Nz2run builds in N parallel jobs (default: CPU count)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-goingr3   z8compile as much as possible, ignore compilation failuresz--no-docstringsno_docstringszstrip docstringsz-Mz	--depfilez produce depfiles for the sources)r   r   sources*)nargs)
argparser   r   Compiler.CmdLiner   r   r   add_argumentr^   int)r   r   r   r   r   parsers         r   create_args_parserr      s    Dgg3a	F m5E'#25  7 2<L-r6D  F j,$bs/3  5 #3MQR\`@  B
#3MQR@  B
'7UVZ  \
ijV[ei;  =
l=	XbL  N
*=V`I  J k9:%rO  Q iglTXO  Q
k^be  g 
lQT^b~  @
	(9<VYcgS  U lSO  Q iglTX0  2
iglTX?  A )LRV_  a
n<^bU  W
)^b-  /
k,Egh
	-Mr   c                     U R                  U5      u  p#UR                  nU H@  nUR                  S5      (       a  U R                  SU-   5        M/  UR	                  U5        MB     U?X$4$ )N-zunknown option )parse_known_argsr   
startswitherrorr]   )r   r~   r    unknownr   options         r   parse_args_rawr     si    ..t4GooG S!!LL*612NN6"	 
 	r   c                 &   [        5       n[        X5      u  p UR                  b  SUl        OU (       d  UR	                  S5        UR                  (       a  SUl        [        c  SUl        UR                  (       a+  UR                  S;   d   eUR                  UR                  S'   UR                  (       a  S[        l        S[        l        UR                  (       a  UR                  [        l        UR                  (       a  S[        l        X 4$ )NTzno source files providedr   )r   rO   3strr   F)r   r   r   r/   r   r6   multiprocessingr   r   r    r   r
   error_on_unknown_nameserror_on_uninitializedr   r   
docstrings)r~   r   r    s      r   
parse_argsr     s    !F"60MG$ $/0%%777,3,B,B()).&).&"++"=r   c                 f   [        U 5      u  p/ nU H  n[        U5       Vs/ s H"  n[        R                  R	                  U5      PM$     nnU(       dO  [        SR                  [        R                  S   U5      [        R                  S9  [        R                  " S5        UR                  U5        M     [        X15      nU(       a>  UR                  (       a-  [        [        UR!                  5       5      UR"                  5        UR$                  b  S =pU(       a(  UR'                  5       u  pU
(       a  U
S   R(                  n	Ub   [        R                  R+                  SU5        [%        UR$                  UR,                  U	S9  Ub   [        R                  R/                  U5        g g g s  snf )Nz#{}: No such file or directory: '{}'r   )filer   )r   )r   r   r   r   r   r   formatra   argvstderrexitr7   r   r6   r   r   r   r   r   popitemnameinsertr   remove)r~   r    r:   r!   r   pexpanded_pathr"   r   r   first_extensionss              r   mainr   9  sT   %NGI5CD5IJ5I+5IJ7>>sxx{DQX[XbXbcHHQK'  39F'--t*0023W5E5EF$#''!)?)G)G)I&H 0 3 8 8HHOOAx(w66'	

 HHOOH%   % Ks   )F.__main__)NNNr   ) concurrent.futuresrR   r   r|   ra   rz   collectionsr   
contextlibr   Dependenciesr   r   Utilsr	   Compilerr
   r   rV   r   r#   r8   r   rC   r   rW   r   r   r   r   r   __name__ r   r   <module>r      s     	  
  # % 3 " 
"C"& "&J  3Fl(<D<FR> &F zF [
  Os   A7 7BB