o
     ¢iK  ã                   @   sN   d dl Z d dlmZ d dlmZ d dlmZ dedeeef defdd	„ZdS )
é    N)ÚPath)Ú
ModuleType)ÚUnionÚnameÚlocÚreturnc                 C   s.   t j | t|ƒ¡}t j |¡}|j |¡ |S )z¶Import module from a file. Used to load models from a directory.

    name (str): Name of module to load.
    loc (str / Path): Path to the file.
    RETURNS: The loaded module.
    )Ú	importlibÚutilÚspec_from_file_locationÚstrÚmodule_from_specÚloaderÚexec_module)r   r   ÚspecÚmodule© r   úG/home/ubuntu/.local/lib/python3.10/site-packages/weasel/util/modules.pyÚimport_file   s   r   )	r   Úpathlibr   Útypesr   Útypingr   r   r   r   r   r   r   Ú<module>   s
    "