
    Ng}              	       .   d dl mZmZ d dlZd dlZd dlZd dlZej        dd         dk     sdej        dd         cxk    rdk     rFn nCej        	                    d e
ej        dd                   z              ej        d           	 d d	lmZ n# e$ r eZY nw xY wdd
lmZ ddlmZ ddlmZmZ ddlmZmZmZmZ ddlmZ ddlmZ ddlmZ ddlmZm Z  ddl!m"Z" ddl#m$Z$m%Z%m&Z&m'Z' d Z(d)                    e$ e(e&          e% e(e'                    Z* ej+        d)                    e*                    Z*ej,        -                    ej,        .                    ej,        /                    ej,        /                    e0                    d                    Z1 G d de2          Z3d Z4d Z5d,dZ6 G d de2          Z7 G d d e2          Z8 G d! d"e9          Z:d-d#Z;d$ Z<d,d%Z+ej=        d.d(            Z>ej=        d)             Z?d* Z@d/d+ZAdS )0    )absolute_importprint_functionN   )r      )   r   )r   r   z7Sorry, Cython requires Python 2.7 or 3.3+, found %d.%d
   )
basestring)Errors)EncodedString)PyrexScannerFileSourceDescriptor)
PyrexErrorCompileErrorerrorwarning)ModuleScope)Utils)Options)CompilationOptionsdefault_options)parse_command_line)unicode_start_ch_anyunicode_continuation_ch_anyunicode_start_ch_rangeunicode_continuation_ch_rangec           	          g }t          dt          |           d          D ]:}|                    d                    | |         | |dz                                 ;d                    |          S )Nr   r   z{0}-{1}r    )rangelenappendformatjoin)chrsoutis      P/var/www/html/ai-engine/env/lib/python3.11/site-packages/Cython/Compiler/Main.py_make_range_rer'   '   si    
C1c$ii## : :

:$$T!Wd1Q3i88999988C==    z[{0}{1}][{0}{2}{1}{3}]*z{0}(\.{0})*$Includesc                      e Zd ZdZdZ	 	 d dZed             Zd Zd!dZ	d Z
d Zd"d	Zed
             Zed             Z	 	 d#dZd$dZd$dZd%dZ	 d&dZd Zd Zd Zd Zd Zd Zd Zd"dZd Zd Zd Zd Z d Z!dS )'ContextNFc                 z   ddl m}m} d|j        i| _        |                    |           | _        | j        | j        d<   || _        t                      | _	        || _
        || _        || _        i | _        i | _        ||                     |           | j
                            dd          | _        d | _        d S )Nr   )BuiltinCythonScope__builtin__cythonlegacy_implicit_noexceptF)r   r-   r.   builtin_scopemodulescreate_cython_scopecython_scopeinclude_directoriessetfuture_directivescompiler_directivescppoptionspxds	_internedset_language_levelgetr1   gdb_debug_outputwriter)selfr6   r9   r:   language_levelr;   r-   r.   s           r&   __init__zContext.__init__H   s     	+*******%(=>';;DAA!%!2X#6 !$#6 	%##N333(,(@(D(DE_af(g(g%&*###r(   c                 J     | |j         |j        |j        |j        |          S )N)r;   )include_pathr9   cplusrB   )clsr;   s     r&   from_optionszContext.from_optionsb   s5    s7')D='"8'K K K 	Kr(   c                 8   ddl m}m}m}m}m} t                      }|dk    rd}n*t          |          }|dk    r|                    |           |dk    r|	                    ||||g           || _
        || _        |dk    r| j        d         | j        d<   d S d S )Nr   )r   unicode_literalsr   divisiongenerator_stop3strr   r/   builtins)Futurer   rJ   r   rK   rL   r7   intaddupdaterB   r8   r3   )rA   levelr   rJ   r   rK   rL   r8   s           r&   r>   zContext.set_language_levelg   s    ggggggggggggggEEF??EEJJEzz!%%&6777A::$$noxQ_%`aaa#!2A::'+|M'BDL$$$ :r(   c                     t           ||f}	 | j        |         S # t          $ r Y nw xY wt          |          }|r||_        || j        |<   |S N)r   r=   KeyErrorencoding)rA   valuerW   keys       r&   intern_ustringzContext.intern_ustringw   sm    eX.	>#&& 	 	 	D	e$$ 	&%EN#ss    
&&c                 t   ddl m} t          |t                    ro|j        dk    rdt          ||t          j                              }t          || j	                  }|
                    | |          }|                    ||          }n-|                    | ||          }|                    ||          }|S )Nr   Pipelinepyx)r   r]   
isinstancer   
_file_typeCompilationSourceosgetcwdcreate_default_resultobjr;   create_pyx_as_pxd_pipelinerun_pipelinecreate_pxd_pipeline)	rA   source_descscopemodule_namer]   sourceresult_sinkpipelineresults	            r&   process_pxdzContext.process_pxd   s    k#788 	B[=SW\=\=\&{KMMF264<HHK::4MMH**8V<<FF33D%MMH**8[AAFr(   c                 *    t          j        |          S rU   )r
   report_error)rA   excs     r&   nonfatal_errorzContext.nonfatal_error   s    "3'''r(   c                     |                     d          }|                                }d |D             }|dk    rRd}dD ]6}|                     ||d d |           }|r|                     |          } n7|                    ||f           |S )N.c                     g | ]}|d fS )T ).0ps     r&   
<listcomp>z1Context._split_qualified_name.<locals>.<listcomp>   s    HHHaD	HHHr(   rC   F).py.pyx)suffix
source_possource_file_pathsys_path)splitpopsearch_include_directories_is_init_filer    )rA   qualified_namerelative_importqualified_name_parts	last_part
is_packager}   paths           r&   _split_qualified_namezContext._split_qualified_name   s    -33C88(,,..	HH3GHHH
"" J)  66"6dUYhwdw 7 y y !%!3!3D!9!9JE !''J(?@@@##r(   c                 L    | r!t           j                            |           dv ndS )N)z__init__.pyxz__init__.pyz__init__.pxdF)rb   r   basename)r   s    r&   r   zContext._is_init_file   s)    \`krw%%)XXXfkkr(   c                     |sd S t           j                            |          }d|v r@|t           j                            |          d         k    rt	          | d|z  d           d S d S d S )Nru   r   ^Dotted filenames ('%s') are deprecated. Please use the normal Python package directory layout.r   rS   )rb   r   r   splitextr   )pospxd_pathnamer   pxd_filenames       r&   _check_pxd_filenamezContext._check_pxd_filename   s     	Fw''55.  ^rw7G7G7U7UVW7X%X%XC NP\]deg g g g g g ! %X%Xr(   r   Tc           
      <   d}|rt          d|d|d|d|           d }d }	|r$|r|                    |          }
n|j        }
|}d }n|}
t                              |
          st          |p|ddfd|z            |r|rt          d           |                    |          }|s^|                     |
||           }	|                     ||	|
           |	r,| 	                    |	          }|
                    ||	          }|sK|rt          d
           |r|}
| }|                     |
|          D ]\  }}|
                    ||	          }|rt          d|z             |j        s|rt          d           |	s|rt          d           |                     |
||o|           }	|                     ||	|
           |rt          d|	z             |	sv|rtd|_        |                     |
d||           }|r |                    t          j                  rn1t#          |d|
                    dt&          j                  z             |	rd|_        	 |rt          d|	z             |                    dt&          j                  t&          j                            |	          d         z   }|	                    |          s|	}t/          |	|          }|                     |||
          \  }}|r||\  }}||f| j        |<   n# t
          $ r Y nw xY w|S )Nr   z#Context.find_module: module_name = z, from_module = z, pos = z, need_pxd = z'%s' is not a valid module namez...trying relative importr   )
as_packagez...trying absolute import)r   z...scope = %sz...pxd not loadedz...looking for pxd filez......found %sTr{   )r}   r~   r   z'%s.pxd' not foundru   zContext.find_module: Parsing %sr   )printqualify_namer   module_name_patternmatchr   lookup_submodulefind_pxd_filer   r   find_submoduler   pxd_file_loadedr   endswithr   PACKAGE_FILESr   replacerb   sepr   r   r   ro   r<   )rA   rj   from_moduler   need_pxdabsolute_fallbackr   debug_find_moduleri   r   r   r   namepackage_pathnamerel_pathrh   errrn   pxd_codenodes	pxd_scopes                       r&   find_modulezContext.find_module   s6     	:E[[[###xx9 : : :  
	) #!,!9!9+!F!F "-!;#"(N"((88 	Qs9{Aq&9AKOQ Q Q  		[  3122200==E [#11.#TcPc1dd((lNKKK [!%!3!3L!A!AJ'66{z6ZZE 	J  31222  -!,E$($>$>~_n$>$o$o J J j,,Tj,II 	+/E)***$ %	  +)*** _$ 53444  $11.#PXPpap]p1qq((lNKKK$ ;*\9:::# 	_ 	_ -1E)'+'F'F&uSbOb (G (d (d$' _,<,E,EeFY,Z,Z _c#7.:P:PQTVXV\:]:]#]^^^ (,%( P?,NOOO*223??"'BRBRS_B`B`abBccH'00:: 0#/"6|X"N"NK"&"2"2;~"V"VKC "!	17.]I.;Y-GDIk**#   Ds   B0L 
LLc                     |                      |d|||          }|$t          j        r|                     |||          S |S )N.pxdr}   r~   r   r   r   )r   r   cimport_from_pyxfind_pyx_file)rA   r   r   r   r   pxds         r&   r   zContext.find_pxd_file  sX     --6cH_o . q q;73;%%ncH%MMM
r(   c                 6    |                      |d|||          S )Nr|   r   )r   )rA   r   r   r   r   s        r&   r   zContext.find_pyx_file  s0     ..6cH_o / q q 	qr(   c                 b    |                      ||d|          }|st          |d|z             |S )NT)r~   includer   z'%s' not found)r   r   )rA   filenamer   r   r   s        r&   find_include_filezContext.find_include_file%  sM     ..dEU / W W 	4#'(2333r(   c                     | j         }|r|t          j        z   }t          |t          gz             }t          |||pd|||          S )Nr   )r6   sysr   tuplestandard_include_pathr   )rA   r   r}   r~   r   r   r   include_dirss           r&   r   z"Context.search_include_directories.  s[    / 	3'#(2L\-B,CCDD).&,B
GM]_ _ 	_r(   c                 *    t          j        |          S rU   )r   find_root_package_dir)rA   	file_paths     r&   r   zContext.find_root_package_dir8  s    *9555r(   c                 F    t          j        |t          |                    S rU   )r   check_package_dirr   )rA   dirpackage_namess      r&   r   zContext.check_package_dir;  s    &sE-,@,@AAAr(   c                    t           j                            |          sdS t          j        |          }t          j        ||          rdS t          j        |d          }t           j                            |          rt          j        ||          rdS |                     |          D ]\\  }}|dk    r|                     ||          }n|dk    r| 	                    ||          }nB|rt          j        ||          r dS ]dS )Nr   r   cimport)r   r   r   )
rb   r   existsr   modification_timefile_newer_thanreplace_suffixread_dependency_filer   r   )rA   source_pathoutput_pathc_timepxd_pathkindr   dep_paths           r&   c_file_out_of_datezContext.c_file_out_of_date>  s    w~~k** 	1(55 f55 	1'V<<7>>(## 	(=h(O(O 	133K@@ 	 	JD$y  --d[-QQ""::4R]:^^ E1(FCC qqqr(   c                 @    d |                      |          D             S )Nc                 $    g | ]\  }}|d k    |S )r   rw   )rx   r   r   s      r&   rz   z7Context.find_cimported_module_names.<locals>.<listcomp>S  s0     ( ( (*$I%% %%%r(   )r   )rA   r   s     r&   find_cimported_module_namesz#Context.find_cimported_module_namesR  s0    ( ((A(A+(N(N ( ( ( 	(r(   c                 *    t          j        |          S rU   )r   is_package_dir)rA   dir_paths     r&   r   zContext.is_package_dirV  s    #H---r(   c                     t          j        |d          }t          j                            |          r@t          |d          5 }d d |D             D             }d d d            n# 1 swxY w Y   |S dS )Nz.deprUc                 B    g | ]}d |v |                     d d          S ) r   )r   )rx   lines     r&   rz   z0Context.read_dependency_file.<locals>.<listcomp>]  s7     , , ,#!Tkk  ::c1--)kkr(   c              3   >   K   | ]}|                                 V  d S rU   )strip)rx   ls     r&   	<genexpr>z/Context.read_dependency_file.<locals>.<genexpr>^  s*      '='=a		'='='='='='=r(   rw   )r   r   rb   r   r   open)rA   r   r   fchunkss        r&   r   zContext.read_dependency_fileY  s    'V<<7>>(## 	h%% ,, ,'='=1'='='=, , ,, , , , , , , , , , , , , , , M2s   A((A,/A,c                 8    | j                             |d           S rU   )r3   r?   )rA   r   s     r&   r   zContext.lookup_submoduled  s    |d+++r(   c                 n    |                      |          }|st          |d | |          }|| j        |<   |S )N)parent_modulecontextr   )r   r   r3   )rA   r   r   ri   s       r&   r   zContext.find_submoduleh  sN    %%d++ 	' $M M ME!&DLr(   c                    t          |t                    st          d          |j        }| j        |_        t          j                    }	 t          j        |          5 }ddl	m
} t          |||j        ||           }	|                    |	||          }
| j        j        r:	 ddlm} n# t$          $ r t          d          w xY w|                    |           d d d            n# 1 swxY w Y   n(# t&          $ r}|                     ||          d }~ww xY wt          j                    |k    rt+                      |
S )N$Only file sources for code supportedr   )Parsing)source_encodingri   r   r   )ConcreteSyntaxTreezLFormal grammar can only be used with compiled Cython with an available pgen.)r_   r   RuntimeErrorr   r:   r
   get_errors_countr   open_source_filer   r   r   rW   p_moduler;   formal_grammarParserr   ImportErrorUnicodeDecodeError_report_decode_errorr   )rA   rh   ri   r   full_module_namesource_filename
num_errorsr   r   streer   es                r&   parsezContext.parseq  s   +';<< 	GEFFF%.H	,..
	<'88 AA%%%%%% K1:).$@ @ @''30@AA<. Al???????& l l l*jl l ll '//@@@A A A A A A A A A A A A A A A " 	< 	< 	< ++K;;;	<
 "$$z11.. sU   C5  AC)$B+*C)+CC)C5 )C--C5 0C-1C5 5
D?DDc                    |j         d         }|j         d         }|j         d         }d}dx}}t          j        |j        ddd          5 }	t	          |	d          D ]7\  }}
|t          |
          z  }||k    r||t          |
          z
  z
  dz   } n8d d d            n# 1 swxY w Y   t          |||fd	|d
|d          S )Nr   r   r   rz	iso8859-1r   )rW   newlinezjDecoding error, missing or incorrect coding=<encoding-name> at top of source (cannot decode with encoding z: ))argsior   r   	enumerater   r   )rA   rh   rr   msgpositionrW   r   columnidxr   datas              r&   r   zContext._report_decode_error  s3   hrl8A;8A;W[)3bQQQ 	UV'1oo  
ds4yy (??%s4yy9A=FE #	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 k400PXPXPXZ]Z]Z]_` ` 	`s   A	B  B$'B$c                    t           j                            |          \  }}t           j                            |          \  }}d|v r|S |g}|                     |          rUt           j                            |          \  }}	||k    rn,|                    |	           |}|                     |          U|                                 d                    |          S )Nru   )rb   r   r   r   r   r    reverser"   )
rA   r   r;   r   r   rj   _namesparentpackage_names
             r&   extract_module_namezContext.extract_module_name  s     d++X))(33Q+!!#&& 	#%7==#5#5 FL}}LL&&&C !!#&& 	 	xxr(   c                     t          j                     |j        r"t          j        |j        d          x}|_        nd }t          j        ||j                   d S )Nz.lis)r   echo_to_stderr)	r
   init_threaduse_listing_filer   r   main_source_filelisting_fileopen_listing_fileerrors_to_stderr)rA   r;   rn   r   s       r&   setup_errorszContext.setup_errors  sa    # 	).)=f>UW])^)^^D6&&D d7;STTTTTTr(   c                    |j         j        }t          |t                    st	          d          t          j                     t          j                    |_        |j        dk    rd}|rS|j	        rN	 t          j        |j	        t          j        |j                             n# t          $ r Y nw xY wd |_	        d S d S d S )Nr   r   T)compilation_sourcerh   r_   r   r   r
   close_listing_filer   r   c_filer   castrate_filerb   statr   EnvironmentError)rA   r   r;   rn   rh   s        r&   teardown_errorszContext.teardown_errors  s    /;+';<< 	GEFFF!###"355q  C 	!6= 	!#FM27;;O3P3PQQQQ#    FMMM	! 	! 	! 	!s   31B% %
B21B2)FNNrU   )F)NNr   TF)NTNNN)NNFFN)"__name__
__module____qualname__r5   rB   rC   classmethodrH   r>   rZ   ro   rs   r   staticmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r$  rw   r(   r&   r+   r+   9   s?        LNEJ.2+ + + +4 K K [KC C C 
 
 
 

 
 
( ( ($ $ $ $& l l \l g g \g MN<AZ Z Z Zx   q q q q    rv_ _ _ _6 6 6B B B  (( ( (. . .	 	 	, , ,     :` ` `$  "U U U! ! ! ! !r(   r+   c                 \   |j         rd}nd}t          j        | |          }|j        rt          j                            ||j                  }t          j                            |          r=t          j                            |t          j                            |                    S |S |S )Nz.cppz.c)	rF   r   r   output_filerb   r   r"   isdirr   )r   cwdr;   c_suffixsuggested_file_nameout_paths         r&   get_output_filenamer2    s    } .II #7<<W%8997=="" 	7<<"'*:*:;N*O*OPPPO""r(   c                     t                      }| j        j        |_        | |_        | j        }t          |j        | j        |          |_        |j        |_        |S rU   )	CompilationResultrh   r   r  r  r2  r.  r   embedded_metadata)r  r;   rn   rh   s       r&   rd   rd     sY      F0<EF 2F$0K'(<*.9 9FM&8FMr(   c                    ddl m} t          j        d         dk    r*t	          j        |           } |rt	          j        |          }t          j                            |           d         }|	                    |dd                     |t                              |          }t          j                    }t          j                            |           }|p|                    | |          }t          |          }t	          j        |           |j        r;|                    dt          j                  |z   }|                    |          s| }n|}t+          ||          }	t-          |	||          } t/          | |          }
|j        t          j                            |
j                  d         dz   }t          j                            |          rMt7          j        |dd	          5 }d
|                    d          v rd|_        d d d            n# 1 swxY w Y   |                                dk    s|s|                    |||
          }n|                     |||
          }|!                    ||
           d|v rydt          j                            t          j        "                    |                    d         v r5tG          |	ddfdt          j        "                    |          z  d           |$                    ||           \  }}|%                    |||
           |P|j&        rIddl'm(}  ||          )                    |
j*                  }t	          j+        |
j        |
j*        |           |
S )Nr   r\   r   r   ru   z.htmlr  zUTF-8)rW   z<!-- Generated by Cythond   Tr{   r   r   )create_dependency_tree),r   r]   r   version_infor   decode_filenamerb   r   r   configure_language_defaultsr+   rH   rc   abspathr  r   $raise_error_if_module_name_forbidden'relative_path_in_code_position_commentsr   r   r   r   ra   rd   annotater   r   r  r   readlowercreate_py_pipelinecreate_pyx_pipeliner  r   r   rf   r$  depfileBuild.Dependenciesr8  all_dependenciesr  write_depfile)rk   r;   r   r   r]   
source_extr.  abs_pathr   rh   rn   html_filename	html_filerm   r   enddatar8  dependenciess                     r&   rf   rf     s    a&v.. 	G$45EFF!!&))!,J''
122777&&w// )++Cwv&&H'W7+F+Fvw+W+W$%566	./?@@@6 #++C88:E  ** 	H&x::K{,<cBBF &fg66F((77:WD7>>-(( 	,g>>> ,).)..2E2EEE'+G$, , , , , , , , , , , , , , ,
 U""*"..wHH//&II&)))
3"'*:*:27;K;KH;U;U*V*VWX*Y#Y#Ya#JLNGL\L\]eLfLfgno	q 	q 	q 	q ((6::LCC&111
{w{??????--g66GGH_``FM6+BLQQQMs   1HH #H c                       e Zd ZdZd ZdS )ra   zk
    Contains the data necessary to start up a compilation pipeline for
    a single compilation unit.
    c                 0    || _         || _        || _        d S rU   )rh   r   r.  )rA   rh   r   r.  s       r&   rC   zCompilationSource.__init__/  s    & 0r(   Nr&  r'  r(  __doc__rC   rw   r(   r&   ra   ra   *  s-             r(   ra   c                       e Zd ZdZd ZdS )r4  af  
    Results from the Cython compiler:

    c_file           string or None   The generated C source file
    h_file           string or None   The generated C header file
    i_file           string or None   The generated .pxi file
    api_file         string or None   The generated C API .h file
    listing_file     string or None   File of error messages
    object_file      string or None   Result of compiling the C file
    extension_file   string or None   Result of linking the object file
    num_errors       integer          Number of compilation errors
    compilation_source CompilationSource
    c                 v    d | _         d | _        d | _        d | _        d | _        d | _        d | _        d | _        d S rU   )r   h_filei_fileapi_filer  object_fileextension_filer  )rA   s    r&   rC   zCompilationResult.__init__D  sD     " $r(   NrP  rw   r(   r&   r4  r4  5  s-         % % % % %r(   r4  c                       e Zd ZdZdZd ZdS )CompilationResultSetz
    Results from compiling multiple Pyrex source files. A mapping
    from source file paths to CompilationResult instances. Also
    has the following attributes:

    num_errors   integer   Total number of compilation errors
    r   c                 :    || |<   | xj         |j         z  c_         d S rU   )r   )rA   rk   rn   s      r&   rQ   zCompilationResultSet.addZ  s"    V6,,r(   N)r&  r'  r(  rQ  r   rQ   rw   r(   r&   rZ  rZ  O  s4          J- - - - -r(   rZ  c                 $    t          | ||          S )z
    compile_single(source, options, full_module_name)

    Compile the given Pyrex implementation file and return a CompilationResult.
    Always compiles a single file; does not perform timestamp checking or
    recursion.
    )rf   )rk   r;   r   s      r&   compile_singler]  _  s     )9:::r(   c                 `   t          |           dk    r|j        rt          d          d | D             } t                      }t	                      }|j        }|j        }d}t          j                    }| D ]}||vr|t          
                    |          }t          |||          }	|                    ||	          }
|r|
rT|r"t          j                            d|z             t!          |||j        |          }|                    ||           d}|                    |           |S )z
    compile_multiple(sources, options)

    Compiles the given sequence of Pyrex implementation files and returns
    a CompilationResultSet. Performs timestamp checking and/or recursion
    if these are specified in the options.
    r   z>Full module name can only be set for single source compilationc                 L    g | ]!}t           j                            |          "S rw   )rb   r   r<  )rx   rk   s     r&   rz   z$compile_multiple.<locals>.<listcomp>w  s&    ===6rwv&&===r(   NzCompiling %s
)r   r   )r   rj   r   r7   rZ  
timestampsverboserb   rc   r+   rH   r2  r   r   stderrwriterf   rQ   )sourcesr;   	processedresultsr`  ra  r   r.  rk   output_filenameout_of_datern   s               r&   compile_multipleri  j  s^    7||aG/ ; < < 	< >=W===GI"$$G#JoGG
)++C " """!..w771&#wGGO!44V_MMK 	; 	 @J$$%5%>???%fg7>7J.57 7 7 FF+++ MM&!!!Nr(   c                     t          dd|i|}t          | t                    r|j        st	          | ||          S | g} t          | |          S )a  
    compile(source [, options], [, <option> = <value>]...)

    Compile one or more Pyrex implementation files, with optional timestamp
    checking and recursing on dependencies.  The source argument may be a string
    or a sequence of strings.  If it is a string and no recursion or timestamp
    checking is requested, a CompilationResult is returned, otherwise a
    CompilationResultSet is returned.
    defaultsrw   )r   r_   r	   r`  r]  ri  )rk   r;   r   kwdss       r&   compilerm    sd     !<<G<t<<G&*%% ! 	E!&'3CDDDFG,,,r(   r   Fc                    |r5|s3|d         }t          |t                    st          d          |j        }|r>|r$t          j                            |          f| z   } nt          j        |          f| z   } |}|r||z  }| D ]E}t          j        	                    ||          }	t          j        
                    |	          r|	c S F|s|                    d          }
t          |
dd                   }|
d         }g }| D ]K}t          j        ||          \  }}|/|r|                    |           4t          |||          }	|	r|	c S L|D ]}t          |||          }	|	r|	c S dS )a)  
    Search the list of include directories for the given file name.

    If a source file path or position is given, first searches the directory
    containing that file.  Returns None if not found, but does not report an error.

    The 'include' option will disable package dereferencing.
    r   r   ru   Nr  )r_   r   r   r   rb   r   dirnamer   r   r"   r   r   r   r   r    search_module_in_dir)dirsr   r}   r   r   r   	file_descdotted_filenamero  r   r  r   rj   namespace_dirspackage_diris_namespaces                   r&   r   r     s     .# .F	)%9:: 	GEFFF$- K 	KGOO$4557$>DD/0@AACdJD %O "6!  w||G_557>>$ 	KKK	  $$S))eCRCj))Bi  	  	 G(-(?(W(W%K& "))+666+KfMM  KKK * 	 	K'[&IID  4r(   c                     t          j        | ||          }|s6|r4t          j        t          j                            | |          d|          }|S )NrC   )r   find_versioned_filerb   r   r"   )ru  rj   r}   r   s       r&   rp  rp    sV     $[+vFFD  eF e(k;)O)OQ[]cddKr(   c                  "    t          d          S )Nr   )command_line)mainrw   r(   r&   setuptools_mainr|    s    q!!!!r(   c                    t           j        dd          }d}| r	 t          |          \  }}n# t          $ rw}dd l}|j        |j        k    r t          d                    t           j        d         |j                  t           j	                   t          j
        d           Y d }~nd }~ww xY wt          t                    }|}|j        rt          j                     |j        dk    rt#          j        |j                   	 t'          ||          }|j        dk    rd}nO# t*          t,          f$ r;}t           j	                            t1          |          dz              d}Y d }~nd }~ww xY w|rt          j
        d           d S d S )Nr   r   z#{}: No such file or directory: '{}')filer   
)r   argvr   IOErrorerrnoENOENTr   r!   r   rb  exitr   r   show_versionr   print_versionworking_pathrb   chdirrm  r   r#  r   rc  str)rz  r  any_failuresr;   rd  r   r  rn   s           r&   r{  r{    s   8ABB<DL 		1$77GWW 	 	 	LLL|qw&&7>>sx{AJWW^a^hiiiiHQKKKKKKKK	 %_55 R
%&&&'**q  Lj)   
Q$'''   s-   - 
B.A-B))B.D$ $E051E++E0r%  rU   )r   NFN)r   )B
__future__r   r   rb   rer   r  r9  rb  rc  r   r  r/   r	   r   r  r   r
   StringEncodingr   Scanningr   r   r   r   r   r   Symtabr   r   r   r   r   CmdLiner   Lexiconr   r   r   r   r'   r!   r   rm  r   r<  r"   ro  __file__r   objectr+   r2  rd   rf   ra   r4  dictrZ  r]  ri  cached_functionr   rp  r|  r{  rw   r(   r&   <module>r     sX  
 7 6 6 6 6 6 6 6 				 				 



 				BQB&  Fc.>rr.B$K$K$K$KV$K$K$K$K$KJORWRWX[XhikjkikXlRmRmmnnnCHQKKK&&&&&&&   JJJ       ) ) ) ) ) ) 8 8 8 8 8 8 8 8 < < < < < < < < < < < <                   8 8 8 8 8 8 8 8 ' ' ' ' ' 'M M M M M M M M M M M M   177..)?@@N0113 3  !bj!1!8!89L!M!MNN  GLL!:!:;;ZHHJ J M! M! M! M! M!f M! M! M!`# # #   = = = =L       % % % % % % % %4- - - - -4 - - - ; ; ; ;% % %P- - - -$ 7 7 7 7t   "" " "           s   B BB