
    ^j                    T    d dl mZ d dlZd dlmZ d dlmZ d dlmZ dd	 	 	 	 	 ddZ	y)	    )annotationsN)Callable)
ModuleType)DynamicLibNotFoundError)probe_functionc                   	 t        j                  |       }|	  ||       |S |S # t        $ r}|j                  | k7  r Y d}~yd}~ww xY w# t        $ r Y yw xY w)a#  Import an optional CUDA module without masking unrelated import bugs.

    Returns:
        The imported module if available and the optional probe succeeds,
        otherwise ``None`` when the requested module is unavailable.

    Raises:
        ModuleNotFoundError: If the import fails because a dependency of the
            target module is missing (instead of the target module itself).
        Exception: Any exception raised by ``probe_function`` except
            :class:`DynamicLibNotFoundError`, which is treated as "unavailable".
    N)	importlibimport_moduleModuleNotFoundErrornamer   )fully_qualified_modnamer   moduleerrs       p/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/cuda/pathfinder/_optional_cuda_import.py_optional_cuda_importr      sp    "(()@A !	6" M6M  88.. ' 		s%   & A 	A	AA		AA)r   strr   z%Callable[[ModuleType], object] | NonereturnzModuleType | None)

__future__r   r	   collections.abcr   typesr   ,cuda.pathfinder._dynamic_libs.load_dl_commonr   r        r   <module>r      s=    #  $  P =A  : 	r   