
    -i                     L    S SK r S SKrS SKJr  SS jrS r\S:X  a  \" 5         gg)    N)Tempitac                 &   [        U SSS9 nUR                  5       nSSS5        [        R                  " W5      nUR	                  5       n[        USSS9 nUR                  U5        SSS5        g! , (       d  f       NZ= f! , (       d  f       g= f)zProcess tempita templated file and write out the result.

The template file is expected to end in `.c.tp` or `.pyx.tp`:
E.g. processing `template.c.in` generates `template.c`.

rzutf-8)encodingNw)openreadtempitaTemplate
substitutewrite)fromfileoutfileftemplate_contenttemplatecontents         O/var/www/html/venv/lib/python3.13/site-packages/sklearn/_build_utils/tempita.pyprocess_tempitar      sx     
hg	.!668 
/  01H!!#G	gsW	-	 
.	- 
/	. 
.	-s   A1B1
A?
Bc                     [         R                  " 5       n U R                  S[        SS9  U R                  SS[        SS9  U R                  SS[        S	S9  U R	                  5       nUR
                  R                  S
5      (       d  [        SUR
                   35      eUR                  (       d  [        S5      e[        R                  R                  [        R                  " 5       UR                  5      n[        R                  R                  U[        R                  R                  [        R                  R                  UR
                  5      S   5      S   5      n[        UR
                  U5        g )NinfilezPath to the input file)typehelpz-oz--outdirzPath to the output directoryz-iz--ignorezKAn ignored input - may be useful to add a dependency between custom targetsz.tpzUnexpected extension: z)Missing `--outdir` argument to tempita.py   r   )argparseArgumentParseradd_argumentstr
parse_argsr   endswith
ValueErroroutdirospathjoingetcwdsplitextsplitr   )parserargs
outdir_absr   s       r   mainr,       s   $$&F
s1IJ
js9WX
0   D;;&&1$++?@@;;DEEbiik4;;7JggllBGG$$RWW]]4;;%?%BCAFG DKK)    __main__)N)r   r#   Cythonr   r
   r   r,   __name__ r-   r   <module>r2      s.     	 %"*: zF r-   