a
    Žù»j—  ã                   @   st   d dl Z d dlmZmZ d dlmZmZ d dlmZ d dl	m
Z
 edd„ ƒZe
ddd	gƒe
d
ddgƒdd„ ƒƒZdS )é    N)ÚParallelÚdelayed)Úconcurrency_safe_renameÚmake_memmap)Ú
with_numpy)Úparametrizec                 C   sB   |   d¡j}dtj }tjd }t||d|d�}|j|ks>J ‚d S )Nz	test.mmapé   é   zw+)ÚshapeÚmodeÚoffset)ÚjoinÚstrpathÚmmapÚALLOCATIONGRANULARITYr   r   )ÚtmpdirÚfnameÚsizer   Z
memmap_obj© r   ú@E:\soccer\ml_env\Lib\site-packages\joblib/test/test_backports.pyÚtest_memmap	   s
    

r   Údst_contentzdst contentÚbackendÚ	threadingc                    sš   ‡fdd„t dƒD ƒ}|D ]}| d¡ qˆ d¡‰ |d urFˆ  |¡ td|d�‡ fdd„|D ƒƒ ˆ  ¡ spJ ‚ˆ  ¡ dks€J ‚|D ]}| ¡ r„J ‚q„d S )	Nc                    s   g | ]}ˆ   d | ¡‘qS )zsrc_%d)r   )Ú.0Úi)r   r   r   Ú
<listcomp>   ó    z0test_concurrency_safe_rename.<locals>.<listcomp>é   zsrc contentÚdst)Zn_jobsr   c                 3   s    | ]}t tƒ|jˆ jƒV  qd S )N)r   r   r   )r   Úsrc_path)Údst_pathr   r   Ú	<genexpr>   s   ÿz/test_concurrency_safe_rename.<locals>.<genexpr>)ÚrangeÚwriter   r   ÚexistsÚread)r   r   r   Z	src_pathsr    r   )r!   r   r   Útest_concurrency_safe_rename   s    

þr'   )r   Zjoblibr   r   Zjoblib.backportsr   r   Zjoblib.test.commonr   Zjoblib.testingr   r   r'   r   r   r   r   Ú<module>   s   
