
    3[g 	                     v   d Z ddlZddlZddlZddlmZ ddlmZmZ 	 ddl	Z	 eed      Z	 ddlZd Z	 ddlmZ d	 Zd
 Zd Z eedu d      Z eej,                  j/                  d       d      Z ee	du d      Z ee	dud      Zy# e
$ r dZ	Y sw xY w# e
$ r d ZdZY rw xY w# e
$ r
 d ZdxZZY ww xY w)z
Small utilities for testing.
    N)mp)SkipTestskipifpypy_version_infoc                     | S )*A decorator to skip tests requiring numpy. funcs    M/var/www/html/bid-api/venv/lib/python3.12/site-packages/joblib/test/common.py
with_numpyr              c                     d }|S )r   c                      t        d      )NzTest requires numpyr   r	   r   r   my_funczwith_numpy.<locals>.my_func   s    011r   r	   )r   r   s     r   r   r      s    	2r   )memory_usagec                     | S )4A decorator to skip tests requiring memory_profiler.r	   r
   s    r   with_memory_profilerr   )   r   r   c                 x    t        j                          t        | ||fd      }t        |      t	        |      z
  S )z)Compute memory usage when executing func.gMbP?)interval)gccollectr   maxmin)r   argskwargsmem_uses       r   memory_usedr!   -   s1    


dF3dC7|c'l**r   c                     d }|S )r   c                      t        d      )NzTest requires memory_profiler.r   r	   r   r   
dummy_funcz(with_memory_profiler.<locals>.dummy_func6   s    ;<<r   r	   )r   r$   s     r   r   r   4   s    	=r   c                  ^    t         r'dd l}  | j                           | j                          y y )Nr   )IS_PYPYr   r   )r   s    r   force_gc_pypyr'   =   s'      	



 r   zNeeds multiprocessing to run.)reasonz/dev/shmz5This test requires a large /dev/shm shared memory fs.zNeeds lz4 compression to runz$Needs lz4 not being installed to run)__doc__osr   sysjoblib._multiprocessing_helpersr   joblib.testingr   r   lz4ImportErrorhasattrr&   numpynpr   memory_profilerr   r   r!   r'   with_multiprocessingpathexistswith_dev_shmwith_lz4without_lz4r	   r   r   <module>r:      s   
 	 
 . + #*
+ &,+ 	 $J68  
z""BD #+&DEtOBDM  
C  
 
B2  & "&%L;&s3   B B B) BB
B&%B&)B87B8