o
    wZh1                     @   sr   d dl Z d dlZd dlmZ d dlmZ d dlZdede	fddZ
e jde	fdd	Ze jdee fd
dZdS )    N)
ModuleType)Optionalnamereturnc                 C   s,   zt j| }|duW S  ty   Y dS w )aP  Returns if a top-level module with :attr:`name` exists *without**
    importing it. This is generally safer than try-catch block around a
    `import X`. It avoids third party libraries breaking assumptions of some of
    our tests, e.g., setting multiprocessing start method when imported
    (see librosa/#747, torchvision/#544).
    NF)	importlibutil	find_specImportError)r   spec r   H/var/www/auris/lib/python3.10/site-packages/torch/utils/_import_utils.py_check_module_exists	   s   
r   c                   C   s   t dot  S )Ndill)r   torchZ_running_with_deployr   r   r   r   dill_available   s   r   c                  C   s"   t  sd S dd l} | jdd | S )Nr   F)Zuse_dill)r   r   extend)r   r   r   r   import_dill    s
   r   )	functoolsimportlib.utilr   typesr   typingr   r   strboolr   	lru_cacher   r   r   r   r   r   <module>   s    