
    M/Phs	                     H    d dl Z d dlZd dlZd dlZd ZddZ	 ddZ	 ddZ	dS )	    Nc                 R     dd l t          j                    fd            }|S )Nr   c                      	                       fd j        d                   \  }}|S # t          j        j        $ r t          j        cY S w xY w)Nc                     d|          S )Nr    )ntest_seriess    W/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/visions/utils/profiling.py<lambda>z-big_o_tester.<locals>.inner.<locals>.<lambda>   s    [1%5     r   )max_n)big_oshapenplinalgLinAlgErrornan)r   best_r   	test_funcs   `  r	   innerzbig_o_tester.<locals>.inner   sp    	kk5555[=Nq=Q "  GD! Ky$ 	 	 	6MMM	s   */  AA)r   	functoolswraps)r   r   r   s   ` @r	   big_o_testerr      sG    LLL_Y       Lr   
   順 c                      fd|                                 D             }t           fd           fd|                                 D             S )Nc           	          i | ]K\  }}t          |          d k    |t          j        t          j                            |                    LS r   lenpdSeriesr   randomchoice.0namedatanormed_lengths      r	   
<dictcomp>z profile_type.<locals>.<dictcomp>   R       D$t99q== 	bi	((}==>>==r   c                     | v S Nr   )xdtypes    r	   r
   zprofile_type.<locals>.<lambda>   s    U
 r   c           	      p    g | ]1\  }|t          j         fd           z             d2S )c                       v S r-   r   )r(   r/   s   r	   r
   z)profile_type.<locals>.<listcomp>.<lambda>$   s    dem r   number)typeseries	run countaverage run timebig Otimeit)r&   r'   r(   
big_O_testr/   	run_counts     @r	   
<listcomp>z profile_type.<locals>.<listcomp>   st     
 
 
 D$ " &.C.C.C.C.CI V V V!Z%%	
 	

 
 
r   )itemsr   )r/   profile_datar<   r)   r;   s   ` ``@r	   profile_typer@      s       &,,..  L
 222233J
 
 
 
 
 
 ',,..
 
 
 
r   c                      fd|                                 D             }t           j                   fd|                                 D             S )Nc           	          i | ]K\  }}t          |          d k    |t          j        t          j                            |                    LS r   r   r%   s      r	   r*   z0profile_relation_is_relation.<locals>.<dictcomp>/   r+   r   c           	      l    g | ]0\  }}|t          j         fd           z   |          d1S )c                       j         S r-   )is_relationrelations   r	   r
   z9profile_relation_is_relation.<locals>.<listcomp>.<lambda>;   s
    , r   r2   rG   r5   r6   r7   r8   r9   r&   r'   r(   r;   rG   r<   s      r	   r=   z0profile_relation_is_relation.<locals>.<listcomp>5   sz        D$ !" &,,,,Y! ! ! !  Z%%		
 		
  r   )r>   r   rE   rG   r?   r<   r)   r;   s   ` ``@r	   profile_relation_is_relationrK   ,   s       &,,..  L
 h233J      ',,..   r   c                      fd|                                 D             }t           j                   fd|                                 D             S )Nc           	          i | ]K\  }}t          |          d k    |t          j        t          j                            |                    LS r   r   r%   s      r	   r*   z.profile_relation_transform.<locals>.<dictcomp>G   r+   r   c           	      l    g | ]0\  }}|t          j         fd           z   |          d1S )c                       j         S r-   )	transformrF   s   r	   r
   z7profile_relation_transform.<locals>.<listcomp>.<lambda>S   s
    * r   r2   rH   r9   rI   s      r	   r=   z.profile_relation_transform.<locals>.<listcomp>M   sz        D$ !" &****9! ! ! !  Z%%		
 		
  r   )r>   r   rP   rJ   s   ` ``@r	   profile_relation_transformrQ   D   s       &,,..  L
 h011J      ',,..   r   )r   r   )
r   r:   numpyr   pandasr!   r   r@   rK   rQ   r   r   r	   <module>rT      s                      * 9?   2 9?     r   