+
    /i                         ^RI Ht ^ RIt]P                  ! ]P                  4      P
                  ^ ,          tRs ! R R4      sR t	 ! R R]
4      tRR ltR	 tR
 tRR ltR tR# )   )_ccallback_cNc                       ] tR t^	tRtR# )CData N)__name__
__module____qualname____firstlineno____static_attributes__r       S/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/_lib/_ccallback.pyr   r   	   s    r   r   c                      \         e   R #  ^ R Ip V P                  4       s \         P                  sR #   \         d    Rs  R # i ; i)NF)fficffiFFIr   ImportError)r   s    r   _import_cffir      s<     hhj		 s   $2 AAc                      a  ] tR t^t o RtRtRR ltR t]R 4       t	]R 4       t
]R 4       tR t]RR	 l4       t]RR
 l4       tRtV tR# )LowLevelCallablea  
Low-level callback function.

Some functions in SciPy take as arguments callback functions, which
can either be python callables or low-level compiled functions. Using
compiled callback functions can improve performance somewhat by
avoiding wrapping data in Python objects.

Such low-level functions in SciPy are wrapped in `LowLevelCallable`
objects, which can be constructed from function pointers obtained from
ctypes, cffi, Cython, or contained in Python `PyCapsule` objects.

.. seealso::

   Functions accepting low-level callables:

   `scipy.integrate.quad`, `scipy.ndimage.generic_filter`,
   `scipy.ndimage.generic_filter1d`, `scipy.ndimage.geometric_transform`

   Usage examples:

   :ref:`ndimage-ccallbacks`, :ref:`quad-callbacks`

Parameters
----------
function : {PyCapsule, ctypes function pointer, cffi function pointer}
    Low-level callback function.
user_data : {PyCapsule, ctypes void pointer, cffi void pointer}
    User data to pass on to the callback function.
signature : str, optional
    Signature of the function. If omitted, determined from *function*,
    if possible.

Attributes
----------
function
    Callback function given.
user_data
    User data given.
signature
    Signature of the function.

Methods
-------
from_cython
    Class method for constructing callables from Cython C-exported
    functions.

Notes
-----
The argument ``function`` can be one of:

- PyCapsule, whose name contains the C function signature
- ctypes function pointer
- cffi function pointer

The signature of the low-level callback must match one of those expected
by the routine it is passed to.

If constructing low-level functions from a PyCapsule, the name of the
capsule must be the corresponding signature, in the format::

    return_type (arg1_type, arg2_type, ...)

For example::

    "void (double)"
    "double (double, int *, void *)"

The context of a PyCapsule passed in as ``function`` is used as ``user_data``,
if an explicit value for ``user_data`` was not given.

Nc                T    V P                  WV4      p\        P                  WW34      # N)_parse_callbacktuple__new__)clsfunction	user_data	signatureitems   &&&& r   r   LowLevelCallable.__new__h   s*     ""8	B}}S"=>>r   c                @    R V P                   : RV P                  : R2# )zLowLevelCallable(, ))r   r   selfs   &r   __repr__LowLevelCallable.__repr__n   s!    "4=="32dnn5GqIIr   c                .    \         P                  V ^4      # )r   r   __getitem__r$   s   &r   r   LowLevelCallable.functionq         q))r   c                .    \         P                  V ^4      # )   r)   r$   s   &r   r   LowLevelCallable.user_datau   r,   r   c                V    \         P                  ! \        P                  V ^ 4      4      # )    )r   get_capsule_signaturer   r*   r$   s   &r   r   LowLevelCallable.signaturey   s     11%2C2CD!2LMMr   c                    \        4       hr   )
ValueError)r%   idxs   &&r   r*   LowLevelCallable.__getitem__}   s
    lr   c                     VP                   V,          pT ! YST4      #   \         d   pRp\        T4      ThRp?i\         d   pRT: R2p\        T4      ThRp?ii ; i)a  
Create a low-level callback function from an exported Cython function.

Parameters
----------
module : module
    Cython module where the exported function resides
name : str
    Name of the exported function
user_data : {PyCapsule, ctypes void pointer, cffi void pointer}, optional
    User data to pass on to the callback function.
signature : str, optional
    Signature of the function. If omitted, determined from *function*.

z?Given module is not a Cython module with __pyx_capi__ attributeNzNo function z$ found in __pyx_capi__ of the module)__pyx_capi__AttributeErrorr5   KeyError)r   modulenamer   r   r   emessages   &&&&&   r   from_cythonLowLevelCallable.from_cython   so    "	-**40H 8	22  	-WGW%1, 	-$TH,PQGW%1,	-s$    A7AAAAc                   \        4        \        V\        4      '       d   \        P	                  V^ 4      pMr\        V\
        4      '       d   \        W4      w  rCMN\        V\        4      '       d   \        W4      w  rCM*\        P                  ! V4      '       d   TpM\        R4      h\        V\        P                  4      '       d   \        V4      pMS\        V\        4      '       d   \        V4      pM1Vf   ^ pM*\        P                  ! V4      '       d   TpM\        R4      h\        P                   ! WCV4      # )r1   zMGiven input is not a callable or a low-level callable (pycapsule/ctypes/cffi)zNGiven user data is not a valid low-level void* pointer (pycapsule/ctypes/cffi))r   
isinstancer   r   r*   
PyCFuncPtr_get_ctypes_funcr   _get_cffi_funcr   check_capsuler5   ctypesc_void_p_get_ctypes_data_get_cffi_dataget_raw_capsule)r   objr   r   funccontexts   &&&&  r   r    LowLevelCallable._parse_callback   s   c+,,$$S!,DZ((.s>OD)U##,S<OD)'',,D J K K i11&y1G	5))$Y/GG''	22G O P P ++DWEEr   r   )NN)r   r   r	   r
   __doc__	__slots__r   r&   propertyr   r   r   r*   classmethodr@   r   r   __classdictcell__)__classdict__s   @r   r   r      s     HV I?J * * * * N N 3 34 F Fr   r   c                 \   \         P                  ! V \         P                  4      P                  pVfx   \	        V P
                  4      R,           p\        V P                  4       F9  w  r4V^ 8X  d   V\	        V4      ,          pK   VR\	        V4      ,           ,          pK;  	  VR,          pW!3# )Nz (r"   r#   )rH   castrI   value_typename_from_ctypesrestype	enumerateargtypes)rN   r   func_ptrjargs   &&   r   rE   rE      s    {{4177H )$,,7$>	.FAAv2377	T$9#$>>>		 /
 	S	r   c                 ,   V f   R# V \         P                  J d   R# V P                  p^ pVP                  R4      '       d   V^,          pVR,          pK+  VP                  R4      '       d
   VR,          pV^ 8  d   VRRV,          ,           ,          pV# )	Nvoidzvoid *LP_:   NNc_:r.   NN *)rH   rI   r   
startswith)r   r=   pointer_levels   &  r   rZ   rZ      s    |		 ==DM
//%
 
 BxtBxqc-'''Kr   c                 `    \         P                  ! V \         P                  4      P                  # r   )rH   rX   rI   rY   datas   &r   rJ   rJ      s    ;;tV__-333r   c                     \         P                  R V 4      pVf9   \         P                  \         P                  V 4      4      P	                  RR4      pW!3# )	uintptr_tz(*)rf   )r   rX   getctypetypeofreplace)rN   r   r^   s   && r   rF   rF      sG    xxT*H LLD!12::5#F	r   c                 .    \         P                  R V 4      # )rn   )r   rX   rk   s   &r   rK   rK      s    88K&&r   r   ) r   rH   	CFUNCTYPErI   	__bases__rD   r   r   r   r   r   rE   rZ   rJ   rF   rK   r   r   r   <module>rv      sh     foo.88;

	 	]Fu ]FH",4'r   