
    M/Ph                         d dl Z d dlZd dlZd dlZd dlmZmZ  ed          Zdedef         dedef         fdZdedef         dedef         fdZ	dS )	    N)CallableTypeVarTfunc.returnc                 V     t          j                   dt          f fd            }|S )z@Suppress warnings produces while executing the wrapped function.r   c                      t          j                    5  t          j        d            | i |cd d d            S # 1 swxY w Y   d S )Nignore)warningscatch_warningssimplefilter)argskwargsr   s     ^/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/visions/utils/warning_handling.pyinnerz suppress_warnings.<locals>.inner   s    $&& 	) 	)!(+++4(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)s   >AA	functoolswrapsr   )r   r   s   ` r   suppress_warningsr   
   sF     _T)! ) ) ) ) ) )
 L    c                 V     t          j                   dt          f fd            }|S )zShapely logs failures at a silly severity, just trying to suppress it's output on failures.
    Only known way to get rid of sys output when wkt.loads hits a bad valuer   c                      t          t          j        d          t          _         | i |}t          j        t          _        |S )Nw)openosdevnullsysstderr
__stderr__)r   r   resr   s      r   wrapperzdiscard_stderr.<locals>.wrapper   s8    "*c**
dD#F##^

r   r   )r   r!   s   ` r   discard_stderrr"      sF     _TA       Nr   )
r   r   r   r   typingr   r   r   r   r"    r   r   <module>r%      s        				 



  $ $ $ $ $ $ $ $GCLL	HS!V, 	#q&1A 	 	 	 	#q&) hsAv.>      r   