U
    -e                     @   s   d dl mZ d dlZd dlZd dlmZ d dlZd dlmZ e	dZ
de
j_de
j_de
j_dd Zedeeddf dddZdd ZdS )    )contextmanagerN)	Generator)HDFStoretables   c                 C   s.   z| d k	r|    W n tk
r(   Y nX d S )N)closeOSError)store r
   `/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/pandas/tests/io/pytables/common.py
safe_close   s
    r   aF)returnc              
   c   sH   t  6}t|| }t|||||d}|V  W 5 Q R X W 5 Q R X d S )N)mode	complevelcomplib
fletcher32)tempfileTemporaryDirectorypathlibPathr   )pathr   r   r   r   Z
tmpdirnameZtmp_pathr	   r
   r
   r   ensure_clean_store   s    
r   c              	   C   s,   z|  | W n ttfk
r&   Y nX dS )z
    For tests using tables, try removing the table to be sure there is
    no content from previous tests using the same table name.
    N)remove
ValueErrorKeyError)r	   keyr
   r
   r   _maybe_remove*   s    r   )r   NNF)
contextlibr   r   r   typingr   ZpytestZpandas.io.pytablesr   Zimportorskipr   
parametersZMAX_NUMEXPR_THREADSZMAX_BLOSC_THREADSZMAX_THREADSr   r   r   r
   r
   r
   r   <module>   s&   
	       