
    ڏDj                     |   d dl Z ddlmZ  G 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
 Zd Z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d-dd.dd/dd0dd1di d2dd3dd4dd5dd6d7d8d$d9dd:dddd;dd<dd=dd>dd?d$d@ddAddBdi dCddDddEddFddGddHddIddJddKddLddMddNddOddPddQd$dRddSg g dg g ddTZddddUZddVdWZdXdXdXdYdYdZj>                  Z d[ Z! G d\ d]      Z" e"       Z"i d1e#de$d^e%d_e$d` edadb      d%e"d&e"dce"d'ddde$d,e$de$deddfddgdde$dhdi diddjddke$dle$dme&dne&d@e#doe'd6 ed7dpdqdrdrdqiV      d8e!dse$dtddue"dve"d eddwdx      d eddydz      d{e$Z(ejS                         D ]  \  Z*Z+e*e(vs e&e+      e(e*<    i dd|d_d}d"d~d`dd%dd&dd'ddcddhddeddfddmddndd^ddiddkddldi ddddjdd.d~d0d~d/d~d@d~dSddddd~dd~d{ddoddd~d*d~d6d~d8d~d9d|i d1d~dd~d;d~d4d~d<d~d5ddsddtddudd=ddgdd>d~d?ddQd~dRd~dd~dd~Z,h dZ-ddZ.	 	 ddZ/d Z0ddZ1 G d d      Z2 e%di dd dd dddd dddddddddd dd dd$dddd dd di di ddddddddd1dddddddddddddddddddd;dd>dddddZ3y)    N   )Utilsc                   0    e Zd Zg ZddZd Zd Zd Zd Zy)ShouldBeFromDirectiveNc                 l    || _         |xs || _        || _        | j                  j	                  |        y N)options_namedirective_namedisallowknown_directivesappend)selfr	   r
   r   s       [C:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\Cython/Compiler/Options.py__init__zShouldBeFromDirective.__init__   s2    (,< $$T*    c                 $    | j                          y r   _bad_accessr   s    r   __nonzero__z!ShouldBeFromDirective.__nonzero__       r   c                 $    | j                          y r   r   r   s    r   __int__zShouldBeFromDirective.__int__   r   r   c                 *    t        t        |             r   )RuntimeErrorreprr   s    r   r   z!ShouldBeFromDirective._bad_access   s    4:&&r   c                 <    d| j                   d| j                  dS )NzIllegal access of 'z-' from Options module rather than directive '')r	   r
   r   s    r   __repr__zShouldBeFromDirective.__repr__   s    t224 	4r   )NF)	__name__
__module____qualname__r   r   r   r   r   r    r   r   r   r      s!    +'4r   r   TFold_style_globals   c                  R   t         j                  D ]  } t               j                  | j                        }| j
                  t        v sJ t        |t               rK| j                  r&t        d| j                  d| j
                  d      |t        | j
                  <    t        S )NzOption 'z' must be set from directive 'r   )r   r   globalsgetr	   r
   _directive_defaults
isinstancer   r   option_name)
old_optionvalues     r   get_directive_defaultsr.      s     ,<< 
G
	j556((,???%!67"""**J,E,EGH H
 BG#J$=$=>
G r   c                 p    t        |       }dD ]  }|j                  |d         |j                  |       |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_directivesnew_directivesnew_directives_outnames       r   copy_inherited_directivesr=      sH     ./K +tT*+ n-r   c                      t        | ddd      S )NF)bindingprofile	linetrace)r=   )r9   s    r   copy_for_internalrB      s    $	 r   r?   boundscheck	nonecheckinitializedcheckfreethreading_compatiblesubinterpreters_compatiblenoembedsignaturezembedsignature.formatc
auto_cpdefauto_pickle	cdivisioncdivision_warningscpowc_api_binop_methodsoverflowcheckzoverflowcheck.foldalways_allow_keywordsallow_none_for_extension_args
wraparoundccomplexcallspec nogilgilwith_gilr@   rA   emit_code_commentsannotation_typinginfer_typeszinfer_types.verboseautotestdictzautotestdict.cdefzautotestdict.alllanguage_levelfast_getattr
py2_importpreliminary_late_includes_cy28iterable_coroutinec_string_typebytesc_string_encodingtype_version_tagunraisable_tracebacks
np_pythranfast_gil
cpp_localslegacy_implicit_noexceptc_compile_guard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.IFshow_performance_hintszoptimize.inline_defnode_callszoptimize.unpack_method_callsz&optimize.unpack_method_calls_in_pyinitzoptimize.use_switchremove_unreachablezcontrol_flow.dot_outputzcontrol_flow.dot_annotate_defsr0   )r1   r4   r2   r3   formal_grammar)rq   rp   rr   )mapc                       fd}|S )Nc                 `    j                  ||      }|vrt        | dd|d      |S )Nz directive must be one of z, got 'r   )r(   
ValueError)r<   r-   argsrv   s     r   validatezone_of.<locals>.validate%  s>    ?GGE5)EdE# $ $r   r#   )rv   rz   r{   s   `` r   one_ofr|   $  s     Or   utf8ascii)r}   zutf-8defaultr~   zus-asciic                     |syt        |j                               }||S ddl}	 |j                  |      }dD ]  }|j                  |      |k(  s|c S  |S # t        $ r |cY S w xY w)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'
    rW   Nr   )r~   r}   )_normalise_common_encoding_namelowercodecs
getdecoderLookupError)r+   encodingencoding_namer   decoderr<   s         r   normalise_encoding_namer   8  s    & 3HNN4DEM ##H- " T"g-K O  s   A A&%A&c                       e Zd Zy)DEFER_ANALYSIS_OF_ARGUMENTSN)r    r!   r"   r#   r   r   r   r   ^  s    r   r   localsfinalcollection_typesequencemappingr5   internalcfuncccallufuncinlinestaticmethodcclassno_gc_clearno_gcreturns	exceptvalfreelist	bytearraystrunicodetrashcantotal_orderingdataclasses.dataclasszdataclasses.fieldclinicpython
shared_gilown_gilr4   )moduler   )r   function)r   )r   )r   with statementr   )r   )classr   r   )r   r   r   r1   r2   r3   )r   ru   )r   r   )r   r   )r   r   r   >   r   r   r   r   r   r   r   r   r   r   rZ   r   rL   r   r   r   rg   r0   r1   r4   r   c                    t         j                  |       }|sy|}|t        u rDt        |      }|dk(  ry|dk(  ry|r|j	                         }|dv ry|dv ryt        | d|d	      |t        u r	 t        |      S |t        u rt        |      S t        |      r	 || |      S J # t
        $ r t        | d
|d	      w xY w)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)falserH   z. directive must be set to True or False, got 'r   z+ directive must be set to an integer, got ')directive_typesr(   boolr   r   ry   intcallable)r<   r-   relaxed_booltype
orig_values        r   parse_directive_valuer     s    8 t$DJt|E
F?GKKME'/)*  			#u: 
5z	$D%    	#j" # #	#s   0
B$ $B?c                    |i }n|}| j                  d      D ]  }|j                         }|sd|vrt        d|z        |j                         j                  dd      D  cg c]  } | j                          c} \  }}|t        vr^d}|j	                  d      r7|dd }	t        D ])  }
|
j                  |	      sd	}t        |
||
      }|||
<   + |r|rt        d|z        t        j                  |      t        u r"||v r||   j                  |       |g||<   t        |||
      }|||<     |S c c} w )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"   Fz.allT)r   zUnknown option: "%s")splitstripry   r)   endswith
startswithr   r   r(   listr   )sr   ignore_unknowncurrent_settingsresultitemr<   r-   foundprefix	directiveparsed_values               r   parse_directive_listr     sT   : ! (zz|d?:TABB*.**,*<*<S!*DEQqwwyEe**E}}V$cr!4 9I ++F3 $'<Y\h'i,8y)	9
  !7$!>??  &$.v~t##E* %wt0u<XL'F4L3(4 M) Fs   $D<c                     | dk(  ry| dk(  ry| dk(  ry| j                         rt        |       S 	 t        |       } | S # t        $ r Y | S w xY 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

    r   Tr   FNoneN)isdigitr   float	Exception)r-   s    r   parse_variable_valuer   P  sd    & 	'		&	5z	%LE   		s   < 	A	A	c                    |i }n|}| j                  d      D ]f  }|j                         }|sd|vrt        d|z        |j                  dd      D  cg c]  } | j                          c} \  }}t        |      ||<   h |S c c} w )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
    r   r   r   r   )r   r   ry   r   )r   r   r   r   r<   r-   s         r   parse_compile_time_envr   t  s    & ! 3zz|d?:TABB*.**S!*<=Qqwwy=e+E2t3 M >s   Bc                   $    e Zd ZdZddZd Zd Zy)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                 d   g | _         |rt        |t              r|j                  }nt        }t        |      }|j                  |       t        |      t        t              z
  }|j                  dg       |r2dt        |      dkD  rdndddj                  |      }t        |      t               }t        |d         }t        |      t        |      z
  }|r2d	t        |      dkD  rdndd
dj                  |      }t        |      ||d<   |j                  dd      r|d   sdd l}	|	j                  d       d|d<   d|vr|j                  d      r	|d   |d<   n%|j                  d      s|j                  d      |d<   d|v rd|vr|d   |d<   | j                  j                  |       y )Ninclude_pathzgot unknown compilation optionr   r   rW   z, please remove: z, compiler_directiveszgot unknown compiler directivez: ri   Fcplusr   z%C++ mode forced when in Pythran mode!Tr_   ru   )r   r*   r   __dict__default_optionsr6   r8   setdifference_updatelenjoinry   r.   r(   warningsro   )
r   defaultskwoptionsunknown_optionsmessagedirective_defaults
directivesunknown_directivesr   s
             r   r   zCompilationOptions.__init__  s   ($67#,,&Hx.r g,_)==))>*:;?+a/R7		/*,G W%%35'"789
 _s3E/FF-.2:		,-/G W%%)3%&>>,.ww7GMMAB#GG2%*..9I*J(23C(DG$%-.(:(>(>?O(PG$%z).>b.H(23C(DG$%W%r   c                 f    |dk(  r,| j                   j                  d      d| j                   d<   y y y )Npyr?   T)r   r(   )r   source_extensions     r   configure_language_defaultsz.CompilationOptions.configure_language_defaults  s;    t#''++I6>6:((3 ? $r   c                 N   i }| j                   j                         D ]y  \  }}|dv r|dv r|dv r|dv r|dv r|dv r$|dv r)|dv r.|d	v r3|d
v r8|dv r|||<   B|dv r|||<   L|dv r|||<   V|dv r|||<   `|dv r|sgt        | d      |||<   { f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)ru   evaluate_tree_assertions)embedded_metadataemit_linenumsc_line_in_traceback	gdb_debug'relative_path_in_code_position_comments)r   r_   compile_time_envri   )capi_reexport_cincludescommon_utility_include_dirz& is not compatible with Cython cachingc           
          t        | t              r=t        | j                         D cg c]  \  }}t	        |       |      f c}}      } t	        |       S c c}}w )z
            Recursively turn item into a string, turning dicts into lists with
            deterministic ordering.
            )r*   r6   sorteditemsr   )r   keyr-   to_fingerprints      r   r  z:CompilationOptions.get_fingerprint.<locals>.to_fingerprint  sP    
 $%TXT^T^T`ajc5S	>%+@Aab: bs   A
)r   r  NotImplementedError)r   datar  r-   r  s       @r   get_fingerprintz"CompilationOptions.get_fingerprint  s6   
 ----/ ;	"JCNN55#&	!//(( (( ,, % aa "S	FF!S	 D D "S	UU!S	QQ-5[.\]] "S	w;	"z	 d##r   r   )r    r!   r"   __doc__r   r   r  r#   r   r   r   r     s    
+&Z;
M$r   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   shared_c_file_pathshared_utility_qualified_name)F)FFNr   r#   )4osrW   r   r   
docstringsembed_pos_in_docstring
pre_importgenerate_cleanup_codeclear_to_noner   r   	fast_failwarning_errorserror_on_unknown_nameserror_on_uninitializedconvert_rangecache_builtinsgcc_branch_hintslookup_module_cpdefembedembed_modulesr$   cimport_from_pyxbuffer_max_dimsclosure_freelist_sizer.   r=   rB   r)   extra_warningsr|   r(   r   r   r   r   r   r6   r   r   r   r  r  valdirective_scopesimmediate_decorator_directivesr   r   r   r   r   r   r#   r   r   <module>r,     sL   
 4 40 
   
       	            	  **=>   
   "	XtXDX %X 	X
 X !$X eX SX %X 4X X %X DX 5X  U!X" $#X$ T%X& $T'X( 4)X* +X, -X. e/X0 
E1X2 3X4 u5X6 7X8 $9X: ;X< 4=X> 5?X@ DAXB CXD EXF dGXH EIXJ %KXL %eMXN %OXP WQXR SXT UXV TWXX YXZ %[X\ ]X^ %_X` aXb rcXh iXl DmXn uoXp qXr sXt 5uXv uwXx %yXz  {X| 5}X~ $X@ dAXF $TGXH #DIXJ -eKXL 4MXR $SXX rYXZ %e[X` aXb "$+/! " oX x !%   # #  !L	 	9; #c#4# d# d	#
 vj)4# )# 
'# 4# # # D# # d# d# T#  T!#" t##$ T%#& t'#( D)#* d+#, -#. /#0 1#2 3#4 VG[%TYHZ[5#6 07#8 9#: d;#< 8=#> 4?#@ VC8<A#B !&|Y"GC#D )$E#J $))+ )HC
/!#Cy)8'8 $8 	8
 {8 ,8 
8 8 68 }8 ,8 ,8 8 -8 }8  ]!8" K#8$ k%8& '8( 4)8* [+8, -8. +/80 182  ?384 !@586 {788 98: )+>;8< =8> k?8@ +A8D [E8F G8H ,I8J kK8P Q8R +S8T %kU8V W8X 0Y8Z [8\ )]8^ 1_8` 2a8b ]c8d e8f }g8h {i8j %kk8l m8n !+o8 z
" 9x @E*.;|!HLE$ E$\  ### # 	#
 # # # # # # # # # # #  !#" ###$ %#& -1'#( )#* +#, -#. /#0 1#2 3#4  $5#6 7#8 9#: ;#< =#> ?#@ "A#B C#D %)E#r   