
    ڏDj                         d dl mZ d dl d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ h dZ G d	 d
e      Zd Zd Z ed      Z ed      Z ed      Z eddeeg      Z ed      Zy)   )ModuleScope)*)CythonUtilityCodeerror)StringSourceDescriptor)
MemoryView)EncodedString>   enumconstunionstructpointerrestrictvolatilec                   \     e Zd ZdZdZd Zd Z fdZ fdZd Z	ddZ
d	 Zd
 Zd Z xZS )CythonScoper   Fc                    t        j                  | dd d        d| _        | j                          || _        t
        t        t        fD ](  }| j                  |j                  |d d      }d|_
        * t               }| j                  d|d d      }|j                         |_        t               }| j                  d|d d      }|j                         |_        y )	NcythonTz<error>)cnamepymutex__Pyx_Locks_PyMutexpythread_type_lock__Pyx_Locks_PyThreadTypeLock)r   __init__pxd_file_loadedpopulate_cython_scope_contextcy_integral_typecy_floating_typecy_numeric_typedeclare_typedefnamein_cincludeget_cy_pymutex_typedeclare_typeget_decl_utility_codeutility_code_definitionget_cy_pythread_type_lock_type)selfcontext
fused_typeentrycy_pymutex_typecy_pythread_type_lock_types         _C:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\Cython/Compiler/CythonScope.pyr   zCythonScope.__init__   s    T8T48#""$+-=O 	%J(()3)-/8 ) :E !%E	% ./!!' " ) )8(M(M(O%%C%E"!! "<d0 " 2 )C(X(X(Z%    c                 .    | j                   j                  S N)r+   cpp)r*   s    r0   is_cppzCythonScope.is_cpp(   s    ||r1   c                 R    |t         v ry t        |      }|r|S t        |   |      S r3   )NON_TYPE_NAMESparse_basic_typesuperlookup_type)r*   r#   type	__class__s      r0   r:   zCythonScope.lookup_type,   s0    >!%Kw"4((r1   c                     t         |   |      }|+| j                  s| j                          t         |   |      }|S r3   )r9   lookup_cythonscope_initializedload_cythonscope)r*   r#   r-   r<   s      r0   r>   zCythonScope.lookup6   s=    t$=!>!>!!#GN4(Er1   c                 "    t        d|z  |       y )Ncython.%s is not availabler   )r*   module_nameposs      r0   find_modulezCythonScope.find_module?   s    *[8#>r1   c                    | j                   j                  |d       }|s,| j                          | j                   j                  |d       }|r|j                  r|j                  S t	        t        dd      ddfd|z        )Nr        rB   )entriesgetr@   	as_moduler   r   )r*   rC   
as_packager-   s       r0   find_submodulezCythonScope.find_submoduleB   sx      d3!!#LL$$[$7EU__??" /"=q!D.<> >r1   c                     |j                  d      }| }t        |      dkD  r7|j                  |d         }|r|j                  }|d= |y t        |      dkD  r7|j                  |d         S )N.r   rH   )splitlenlookup_hererK   )r*   qname	name_pathscopes       r0   lookup_qualified_namez!CythonScope.lookup_qualified_nameR   su    KK$	)nq %%il3E!} )nq  $$Yq\22r1   c                     | j                  dt        d d      }d|_        |j                  }| j	                  dt        t        t        dt        d       t        dt        |      d       g      d dd       y )	NPyTypeObject)	base_typerD   r   TPyObject_TypeCheckotr   )rD   definingr   )
r"   c_void_typeis_voidr;   declare_cfunction	CFuncTypec_bint_typeCFuncTypeArgpy_object_type
c_ptr_type)r*   type_objecttype_object_types      r0   r   z!CythonScope.populate_cython_scope`   s    **#"	 + $
 #&++ kLnd$K$0jAQ6RTX$Y$[ \( 	 	*r1   c                    | j                   ryd| _         t        j                  | |        t        j                  | |        t	        d| d      x| _        }|| j                  d|d      _        d|_        d|_	        t        j                  ||        t        j                  | j                  j                        j                  | j
                  | t        j                        }|j                   j#                         D cg c]$  }|j$                  j&                  r|j$                  & }}|D ]	  }d|_         t+        d      }t	        || d      }|| j                  ||d	      _        d|_        d|_	        yc c}w )
zy
        Creates some entries for testing purposes and entries for
        cython.array() and for cython.view.*.
        NT)cython_scopeview)ri   	allowlistr   dataclassesr+   )rD   )r?   cython_testscope_utility_codedeclare_in_scope!cython_test_extclass_utility_coder   	viewscopedeclare_modulerK   is_cython_builtinr   !cythonview_testscope_utility_coder	   get_view_utility_coder+   shared_utility_qualified_nameview_utility_allowlistrI   valuesr;   is_extension_typeis_cython_builtin_typer
   )r*   rq   view_utility_scoper-   	ext_typesext_typedc_strdataclassesscopes           r0   r@   zCythonScope.load_cythonscoper   s   
 (((,%%66 $4 	7 	9)::$(t 	; 	= &1t%DDAJFIt4>&*	#$(	!)::,5D 	; 	J (==LL66


NN9Z9Z  \ 	 '9&@&@&G&G&I;"!JJ88 jj ;	 ; " 	0H./H+	0 }-&vtTBL\F$4$?I-1*+/(;s   )E=)F)__name__
__module____qualname__rs   r?   r   r5   r:   r>   rE   rM   rV   r   r@   __classcell__)r<   s   @r0   r   r      s=    $[2 )?> 3*$-0r1   r   c                     t        |       S r3   )r   rm   s    r0   create_cython_scoper      s     wr1   c                 0    t        j                  | dfi |S )NzTestCythonScope.pyx)r   load)cy_util_namekwargss     r0   load_testscope_utilityr      s    !!,0EPPPr1   a  
    /* These methods are undecorated and have therefore no prototype */
    static PyObject *__pyx_TestClass_cdef_method(
            struct __pyx_TestClass_obj *self, int value);
    static PyObject *__pyx_TestClass_cpdef_method(
            struct __pyx_TestClass_obj *self, int value, int skip_dispatch);
    static PyObject *__pyx_TestClass_def_method(
            PyObject *self, PyObject *value);
)proto	TestScopeTestDep	TestClass)r#   requireszView.TestScopeN)Symtabr   
PyrexTypesUtilityCoder   Errorsr   Scanningr   rG   r	   StringEncodingr
   r7   r   r   r   undecorated_methods_protosrn   test_cython_utility_deprp   rt    r1   r0   <module>r      s      *  ,  )XT0+ T0p Q ) 0   !7{ C 0;  ;[%?%<%>? "
 %;;K$L !r1   