L i6dZddlZddlZddlZddlZddlmZddlmZm Z  ddl Z e edZ ejdxrej Z ddlZdZ dd lmZd Zd Ze edud Ze ej2j5d dZe e dudZe e dudZy#e $rdZ YwxYw#e $rdZdZYowxYw#e $r d ZdxZZYtwxYw)z Small utilities for testing. N)mp)SkipTestskipifpypy_version_infoPy_GIL_DISABLEDc|S)*A decorator to skip tests requiring numpy.funcs X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/joblib/test/common.py with_numpyr c d}|S)r ctd)NzTest requires numpyrr rr my_funczwith_numpy..my_func%s01 1rr )r rs r rr"s 2r) memory_usagec|S)4A decorator to skip tests requiring memory_profiler.r r s r with_memory_profilerr3rrcxtjt|||fd}t|t |z S)z)Compute memory usage when executing func.gMbP?)interval)gccollectrmaxmin)r argskwargsmem_uses r memory_usedr"7s1 dF3eD7|c'l**rc d}|S)rctd)NzTest requires memory_profiler.rr rr dummy_funcz(with_memory_profiler..dummy_funcBs;< r=s, .+ #* +I./M8K8K8K8M4M (&,+&bDj1PQ z"" B #+&D ES_-ST K C"  B : &"&%L; &s5B3C C3B=<B= C  C  CC