o
    1j                     @   s,   d dl Z d dlZddgZdd Zdd ZdS )    Nimport_paddleimport_paddle_modulec                   C   s   t dS )z<Import `paddle` without keeping root StreamHandlers it adds.paddle)r    r   r   [/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddlex/utils/import_guard.pyr      s   c              
   C   s   | dkr|  dstd| dt }dd |jD }z&t| W |jdd D ]}t||v r3q*t|tj	rB|
| |  q*S |jdd D ]}t||v rTqKt|tj	rc|
| |  qKw )zAImport a `paddle` module while preserving existing root handlers.r   zpaddle.z'Expected a paddle module name, but got .c                 S   s   h | ]}t |qS r   )id).0handlerr   r   r   	<setcomp>    s    z'import_paddle_module.<locals>.<setcomp>N)
startswith
ValueErrorlogging	getLoggerhandlers	importlibimport_moduler   
isinstanceStreamHandlerremoveHandlerclose)module_nameZroot_loggerZexisting_handler_idsr
   r   r   r   r      s*   


)r   r   __all__r   r   r   r   r   r   <module>   s
   