+
    LV-j¯  ã                   óÎ   € ^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   ó    Úf/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/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<   € ô ‚ÙðÛØ�h‰h‹jˆÜ—	‘	ŠøÜô Ø‹ðú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§=¡=Ñ"3°2°d·n±nÑ5GÀqÐ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´%×2CÑ2CÀDÈ!Ó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Õ0ˆHñ �8¨	Ó2Ð2øô ô 	-ØWˆGÜ˜WÓ%¨1Ð,ûÜô 	-Ø$ T¡HÐ,PÐQˆGÜ˜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Ó>‰OˆD�)Ü˜œU×#Ò#Ü,¨SÓ<‰OˆD�)Ü×'Ò'¨×,Ò,Ø‰Däð Jó Kð Kô �i¤§¡×1Ò1Ü& yÓ1‰GÜ˜	¤5×)Ò)Ü$ YÓ/‰GØÒØ‰GÜ×'Ò'¨	×2Ò2Ø‰Gäð Oó Pð Pô ×+Ò+¨D¸WÓ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ó ð3ð4 ó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Ñ7€Hð ÒÜ)¨$¯,©,Ó7¸$Õ>ˆ	Ü §¡Ö.‰FˆAØ�AŒvØÔ2°3Ó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Ø
�/‰/˜%×
 Ò
 Ø˜ÕˆØ�B�xŠà‡��t×ÒØ�B�xˆà�qÔØ��c˜-Õ'Õ'Õ'ˆà€Kr   c                 ó`   € \         P                  ! V \         P                  4      P                  # r   )rH   rX   rI   rY   ©Údatas   &r   rJ   rJ   å   s   € ä�;Š;�tœVŸ_™_Ó-×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   € ä�x‰x˜ TÓ*€Hð ÒÜ—L‘L¤§¡¨DÓ!1Ó2×:Ñ:¸5À#ÓFˆ	àÐÐr   c                 ó.   € \         P                  R V 4      # )rn   )r   rX   rk   s   &r   rK   rK   ù   s   € ä�8‰8�K Ó&Ð&r   r   )Ú r   rH   Ú	CFUNCTYPErI   Ú	__bases__rD   r   r   r   r   r   rE   rZ   rJ   rF   rK   r   r   r   Ú<module>rv      sh   ðÝ ã à×Ò˜fŸo™oÓ.×8Ñ8¸Õ;€
à
€÷	ñ 	òô]F�uô ]FôHò"ò,4ôô'r   