o
    jI}                  
   @   s  d dl Z ddlmZ G dd dZ	 dZdZdZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZg ZedZdZd	Zd	Zd
d Zdd Zdd Zi 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i d#dd$dd%dd&d'd(dd)dd*dd+dd,dd-dd.dd/dd0dd1dd2dd3dd4di d5dd6dd7dd8dd9d:d;d'd<dd=dddd>dd?dd@ddAddBd'dCddDddEdi dFddGddHddIddJddKddLddMddNddOddPddQddRddSddTd'dUddVg g dg g ddWZddddXZddYdZd[Zd\d\d\d]d]d^jZ d_d` Z!G dadb dbZ"e" Z"i d4e#de$dce%dde$deedfdgd(e"d)e"dhe"d*ddie$d/e$de$djddkddldde$dmdi dnddoddpe$dqe$dre&dse&dCe#dte'd9ed:dudvdwdwdvidYd;e!dxe$dyddze"d{e"dedd|d}dedd~dde$Z(e) D ]\Z*Z+e*e(vre&e+e(e*< qi dddddd%ddedd(dd)dd*ddhddmddjddkddrddsddcddnddpddqdi diddodd1dd3dd2ddCddVddddddddddtdddd-dd9dd;dd<di d4dddd>dd7dd?dd8ddxddyddzdd@ddlddAddBddTddUdddddZ,h dZ-dddZ.		dddZ/dd Z0dddZ1G dd dZ2e%di dd dd dddd dddddddddd dd dd'dddd dd di di ddddddddd4dddddddddddddddddddd>ddAdddddZ3dS )    N   )Utilsc                   @   s:   e Zd Zg ZdddZdd Zdd Zd	d
 Zdd ZdS )ShouldBeFromDirectiveNFc                 C   s&   || _ |p|| _|| _| j|  d S N)options_namedirective_namedisallowknown_directivesappend)selfr   r   r    r   X/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/Cython/Compiler/Options.py__init__   s   
zShouldBeFromDirective.__init__c                 C      |    d S r   _bad_accessr   r   r   r   __nonzero__      z!ShouldBeFromDirective.__nonzero__c                 C   r   r   r   r   r   r   r   __int__   r   zShouldBeFromDirective.__int__c                 C   s   t t| r   )RuntimeErrorreprr   r   r   r   r      r   z!ShouldBeFromDirective._bad_accessc                 C   s   d| j | jf S )NzEIllegal access of '%s' from Options module rather than directive '%s')r   r   r   r   r   r   __repr__   s   zShouldBeFromDirective.__repr__)NF)	__name__
__module____qualname__r	   r   r   r   r   r   r   r   r   r   r      s    
r   TFold_style_globals   c                  C   sZ   t jD ]'} t | j}| jtv sJ t|t s*| jr%t	d| j
| jf |t| j< qtS )Nz+Option '%s' must be set from directive '%s')r   r	   globalsgetr   r   _directive_defaults
isinstancer   r   option_name)Z
old_optionvaluer   r   r   get_directive_defaults   s   


r$   c                 K   s,   t | }dD ]}||d  q|| |S )N)test_assert_path_existstest_fail_if_path_existstest_assert_c_code_hastest_fail_if_c_code_has"test_body_needs_exception_handlingcritical_section)dictpopupdate)outer_directivesZnew_directivesZnew_directives_outnamer   r   r   copy_inherited_directives   s
   
r0   c                 C   s   t | ddddS )NF)bindingprofile	linetrace)r0   )r.   r   r   r   copy_for_internal   s   r4   r1   ZboundscheckZ	nonecheckZinitializedcheckZfreethreading_compatibleZsubinterpreters_compatiblenoZembedsignaturezembedsignature.formatcZ
auto_cpdefauto_pickleZ	cdivisionZcdivision_warningsZcpowZc_api_binop_methodsZoverflowcheckzoverflowcheck.foldZalways_allow_keywordsZallow_none_for_extension_argsZ
wraparoundZccomplexZcallspec ZnogilZgilwith_gilr2   r3   Zemit_code_commentsZannotation_typingZinfer_typeszinfer_types.verboseZautotestdictzautotestdict.cdefzautotestdict.alllanguage_levelZfast_getattrZ
py2_importZpreliminary_late_includes_cy28Ziterable_coroutineZc_string_typebytesZc_string_encodingtype_version_tagZunraisable_tracebacks
np_pythranZfast_gilZ
cpp_localsZlegacy_implicit_noexceptZc_compile_guardZset_initial_pathwarnzwarn.undeclaredwarn.unreachablewarn.maybe_uninitializedwarn.unusedzwarn.unused_argzwarn.unused_resultzwarn.multiple_declaratorszwarn.deprecated.DEFzwarn.deprecated.IFZshow_performance_hintszoptimize.inline_defnode_callszoptimize.unpack_method_callsz&optimize.unpack_method_calls_in_pyinitzoptimize.use_switchZremove_unreachablezcontrol_flow.dot_outputzcontrol_flow.dot_annotate_defsr%   )r&   r)   r'   r(   formal_grammar)r@   r?   rA   )mapc                    s    fdd}|S )Nc                    s2   d ur
 ||}| vrtd|  |f |S )Nz(%s directive must be one of %s, got '%s')r   
ValueError)r/   r#   argsrC   r   r   validate%  s   zone_of.<locals>.validater   )rC   rF   rG   r   rE   r   one_of$  s   rH   utf8ascii)rI   zutf-8defaultrJ   zus-asciic                 C   sr   |sdS t | }|dur|S ddl}z||}W n ty&   | Y S w dD ]}|||kr6|  S q)|S )a  
    >>> normalise_encoding_name('c_string_encoding', 'ascii')
    'ascii'
    >>> normalise_encoding_name('c_string_encoding', 'AsCIi')
    'ascii'
    >>> normalise_encoding_name('c_string_encoding', 'us-ascii')
    'ascii'
    >>> normalise_encoding_name('c_string_encoding', 'utF8')
    'utf8'
    >>> normalise_encoding_name('c_string_encoding', 'utF-8')
    'utf8'
    >>> normalise_encoding_name('c_string_encoding', 'deFAuLT')
    'utf8'
    >>> normalise_encoding_name('c_string_encoding', 'default')
    'utf8'
    >>> normalise_encoding_name('c_string_encoding', 'SeriousLyNoSuch--Encoding')
    'SeriousLyNoSuch--Encoding'
    r8   Nr   )rJ   rI   )_normalise_common_encoding_namelowercodecs
getdecoderLookupError)r"   encodingZencoding_namerN   decoderr/   r   r   r   normalise_encoding_name8  s    rS   c                   @   s   e Zd ZdS )DEFER_ANALYSIS_OF_ARGUMENTSN)r   r   r   r   r   r   r   rT   ^  s    rT   localsfinalcollection_typesequencemappingr*   internalcfuncccallufuncinlinestaticmethodcclassno_gc_clearno_gcreturns	exceptvalfreelist	bytearraystrunicodeZtrashcantotal_orderingdataclasses.dataclasszdataclasses.fieldZclinicpythonZ
shared_gilZown_gilr)   )moduler`   )r`   function)rl   )r`   )rm   with statementrn   )rm   )classr`   rn   )rm   ro   r`   r&   r'   r(   )rn   rB   )rl   rm   )ro   r`   )rl   rm   r`   >   r[   rd   r\   rZ   ri   r^   rb   rc   r&   r)   re   r7   r<   rj   rW   r9   r%   r]   ra   r`   rV   c                 C   s   t | }|s	dS |}|tu r9t|}|dkrdS |dkrdS |r1| }|dv r+dS |dv r1dS td| |f |tu rRzt|W S  tyQ   td	| |f w |tu rZt|S t|rc|| |S J )
a  
    Parses value as an option value for the given name and returns
    the interpreted value. None is returned if the option does not exist.

    >>> print(parse_directive_value('nonexisting', 'asdf asdfd'))
    None
    >>> parse_directive_value('boundscheck', 'True')
    True
    >>> parse_directive_value('boundscheck', 'true')
    Traceback (most recent call last):
       ...
    ValueError: boundscheck directive must be set to True or False, got 'true'

    >>> parse_directive_value('c_string_encoding', 'us-ascii')
    'ascii'
    >>> parse_directive_value('c_string_type', 'str')
    'str'
    >>> parse_directive_value('c_string_type', 'bytes')
    'bytes'
    >>> parse_directive_value('c_string_type', 'bytearray')
    'bytearray'
    >>> parse_directive_value('c_string_type', 'unicode')
    'str'
    >>> parse_directive_value('c_string_type', 'unnicode')
    Traceback (most recent call last):
    ValueError: c_string_type directive must be one of ('bytes', 'bytearray', 'str', 'unicode'), got 'unnicode'
    NTrueTFalseF)trueyes)falser5   z3%s directive must be set to True or False, got '%s'z0%s directive must be set to an integer, got '%s')directive_typesr   boolrg   rM   rD   intcallable)r/   r#   relaxed_booltypeZ
orig_valuer   r   r   parse_directive_value  s@   


r{   c                 C   s  |du ri }n|}|  dD ]y}| }|sqd|vr!td| dd |  ddD \}}|tvrcd}|d	rX|dd
 }	tD ]}
|
|	rWd}t|
||d}|||
< qC|sb|sbtd| qt|t	u r|||v rv|| 
| q|g||< qt|||d}|||< q|S )aJ  
    Parses a comma-separated list of pragma options. Whitespace
    is not considered.

    >>> parse_directive_list('      ')
    {}
    >>> (parse_directive_list('boundscheck=True') ==
    ... {'boundscheck': True})
    True
    >>> parse_directive_list('  asdf')
    Traceback (most recent call last):
       ...
    ValueError: Expected "=" in option "asdf"
    >>> parse_directive_list('boundscheck=hey')
    Traceback (most recent call last):
       ...
    ValueError: boundscheck directive must be set to True or False, got 'hey'
    >>> parse_directive_list('unknown=True')
    Traceback (most recent call last):
       ...
    ValueError: Unknown option: "unknown"
    >>> warnings = parse_directive_list('warn.all=True')
    >>> len(warnings) > 1
    True
    >>> sum(warnings.values()) == len(warnings)  # all true.
    True
    N,=Expected "=" in option "%s"c                 S      g | ]}|  qS r   strip.0sr   r   r   
<listcomp>9      z(parse_directive_list.<locals>.<listcomp>   Fz.allT)ry   zUnknown option: "%s")splitr   rD   r    endswith
startswithr{   ru   r   listr
   )r   ry   Zignore_unknowncurrent_settingsresultitemr/   r#   foundprefix	directiveZparsed_valuer   r   r   parse_directive_list  s<   


r   c                 C   sX   | dkrdS | dkrdS | dkrdS |   rt| S zt| } W | S  ty+   Y | S w )a  
    Parses value as an option value for the given name and returns
    the interpreted value.

    >>> parse_variable_value('True')
    True
    >>> parse_variable_value('true')
    'true'
    >>> parse_variable_value('us-ascii')
    'us-ascii'
    >>> parse_variable_value('str')
    'str'
    >>> parse_variable_value('123')
    123
    >>> parse_variable_value('1.23')
    1.23

    rp   Trq   FNoneN)isdigitrw   float	Exception)r#   r   r   r   parse_variable_valueP  s   
r   c                 C   sn   |du ri }n|}|  dD ]&}| }|sqd|vr!td| dd | ddD \}}t|||< q|S )a  
    Parses a comma-separated list of pragma options. Whitespace
    is not considered.

    >>> parse_compile_time_env('      ')
    {}
    >>> (parse_compile_time_env('HAVE_OPENMP=True') ==
    ... {'HAVE_OPENMP': True})
    True
    >>> parse_compile_time_env('  asdf')
    Traceback (most recent call last):
       ...
    ValueError: Expected "=" in option "asdf"
    >>> parse_compile_time_env('NUM_THREADS=4') == {'NUM_THREADS': 4}
    True
    >>> parse_compile_time_env('unknown=anything') == {'unknown': 'anything'}
    True
    Nr|   r}   r~   c                 S   r   r   r   r   r   r   r   r     r   z*parse_compile_time_env.<locals>.<listcomp>r   )r   r   rD   r   )r   r   r   r   r/   r#   r   r   r   parse_compile_time_envt  s   r   c                   @   s*   e Zd ZdZd	ddZdd Zdd ZdS )
CompilationOptionsz
    See default_options at the end of this module for a list of all possible
    options and CmdLine.usage and CmdLine.parse_command_line() for their
    meaning.
    Nc           
      K   sf  g | _ |rt|tr|j}nt}t|}|| t|tt }|dg |r>dt	|dkr2dndd
|f }t|t }t|d }t|t| }|rfdt	|dkrZdndd
|f }t|||d< |d	d
r|d sdd l}	|	d d|d< d|vr|dr|d |d< n|ds|d|d< d|v rd|vr|d |d< | j| d S )Ninclude_pathz3got unknown compilation option%s, please remove: %sr   r   r8   z, compiler_directivesz$got unknown compiler directive%s: %sr=   Fcplusr   z%C++ mode forced when in Pythran mode!Tr:   rB   )r   r!   r   __dict__default_optionsr+   r-   setdifference_updatelenjoinrD   r$   r   warningsr>   )
r   defaultskwoptionsZunknown_optionsmessageZdirective_defaultsZ
directivesZunknown_directivesr   r   r   r   r     sJ   



zCompilationOptions.__init__c                 C   s.   |dkr| j dd u rd| j d< d S d S d S )Npyr1   T)r   r   )r   Zsource_extensionr   r   r   configure_language_defaults  s
   z.CompilationOptions.configure_language_defaultsc                    s   i }| j  D ]l\}}|dv rq|dv rq|dv rq|dv rq|dv r$q|dv r)q|dv r.q|dv r3q|d	v r8q|d
v r=q|dv rF|||< q|dv rO|||< q|dv rX|||< q|dv ra|||< q|dv ro|rnt| dq|||< q fdd  |S )zi
        Return a string that contains all the options that are relevant for cache invalidation.
        )show_versionerrors_to_stderrverbosequiet)output_file
output_dir)depfile)
timestamps)cache)r   )r   )working_path)create_extension)	build_dir)use_listing_filegenerate_pxiannotateannotate_coverage_xml)rB   evaluate_tree_assertions)embedded_metadataemit_linenumsc_line_in_traceback	gdb_debug'relative_path_in_code_position_comments)r   r:   compile_time_envr=   )capi_reexport_cincludescommon_utility_include_dirz& is not compatible with Cython cachingc                    s,   t | trt fdd|  D } t| S )z
            Recursively turn item into a string, turning dicts into lists with
            deterministic ordering.
            c                    s    g | ]\}}t | |fqS r   )r   )r   keyr#   to_fingerprintr   r   r     s     zNCompilationOptions.get_fingerprint.<locals>.to_fingerprint.<locals>.<listcomp>)r!   r+   sorteditemsr   )r   r   r   r   r     s   
z:CompilationOptions.get_fingerprint.<locals>.to_fingerprint)r   r   NotImplementedError)r   datar   r#   r   r   r   get_fingerprint  sJ   




	z"CompilationOptions.get_fingerprintr   )r   r   r   __doc__r   r   r   r   r   r   r   r     s
    
-r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   module_namer   r   r   r   r   Zshared_c_file_pathZshared_utility_qualified_name)F)FFNr   r   )4osr8   r   r   Z
docstringsZembed_pos_in_docstringZ
pre_importZgenerate_cleanup_codeZclear_to_noner   r   Z	fast_failZwarning_errorsZerror_on_unknown_namesZerror_on_uninitializedZconvert_rangeZcache_builtinsZgcc_branch_hintsZlookup_module_cpdefZembedZembed_modulesr   Zcimport_from_pyxZbuffer_max_dimsZclosure_freelist_sizer$   r0   r4   r    Zextra_warningsrH   r   rL   rS   rT   rg   rv   r+   rz   rw   ru   r   r   valZdirective_scopesZimmediate_decorator_directivesr{   r   r   r   r   r   r   r   r   r   <module>   sr  
	
	
 !"#$%&'()*+,-./0146789:;<=>?@CDEFILMPQ\	&
	
 !"%
	
 "#$%()*+,-./01234567=
<
>
$& 	
 !"