
    Ug 	                        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	n# e
$ r dZ	Y nw xY w eed          Z	 ddlZd Zn# e
$ r d ZdZY nw xY w	 ddlmZ d	 Zd
 Zn# e
$ r
 d ZdxZZY nw xY wd Z eedu d          Z eej                            d           d          Z ee	du d          Z ee	dud          ZdS )z
Small utilities for testing.
    N)mp)SkipTestskipifpypy_version_infoc                     | S )*A decorator to skip tests requiring numpy. funcs    Q/var/www/surfInsights/venv3-11/lib/python3.11/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11r   r	   )r   r   s     r   r   r      s    	2 	2 	2r   )memory_usagec                     | S )4A decorator to skip tests requiring memory_profiler.r	   r
   s    r   with_memory_profilerr   )   r   r   c                     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!   -   s=    

dF3dCCC7||c'll**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                     d S d S )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    
			 				 



 . . . . . . + + + + + + + +JJJJ   
CCC '#*
+
+         
 
BBB&,,,,,,  + + + +  & & &   "&%L;;;&	 	 	 v$J68 8 8  v
z"""BD D D 6#+&DEEEftOBD D Ds/   # --A 
AAA# #A21A2