
    ܙd	                         d dl Z d dlZd dlmZ d dlmZmZ d dlm	Z	 d dl
mZ  G d de j                  Z G d d	e j                  Zed
k    r e j                     dS dS )    N)jit)typesconfig)compile_isolated)override_configc                       e Zd Zd Zd ZdS )TestJITMethodc                     G d dt                     } |d          }t          j                            |                    d          t          j        g dt          j                             |j        j                                        \  }|j	        d         }|j                                        \  }| 
                    |j        j                   d S )Nc                   *    e Zd Zd Zed             ZdS )ETestJITMethod.test_bound_jit_method_with_loop_lift.<locals>.Somethingc                     || _         d S Nx0selfr   s     :lib/python3.11/site-packages/numba/tests/test_jitmethod.py__init__zNTestJITMethod.test_bound_jit_method_with_loop_lift.<locals>.Something.__init__           c                     t          j        dt           j                  }| j        }t	          |j        d                   D ]
}||z  ||<   |S )N   )shapedtyper   )npemptyfloat32r   ranger   )r   xar   is        r   methodzLTestJITMethod.test_bound_jit_method_with_loop_lift.<locals>.Something.method   sP    H1BJ777Wqwqz** " "A6AaDDr   N__name__
__module____qualname__r   r   r"    r   r   	Somethingr      s>             S  r   r(      r   )   r*   r*   r*   r*   )r   r   )objectr   testingassert_array_equalr"   arrayr   	overloadsvalueslifted
assertTruefndescnative)r   r(   	somethingcresjitlooploopcress         r   $test_bound_jit_method_with_loop_liftz2TestJITMethod.test_bound_jit_method_with_loop_lift   s    	 	 	 	 	 	 	 	 IaLL	

%%i&6&6q&9&9H)))<<<	> 	> 	> !+2244+a.&--//
./////r   c                      G d dt                     } |d          }|                     |                    |          d           d S )Nc                   *    e Zd Zd Zed             ZdS )8TestJITMethod.test_unbound_jit_method.<locals>.Somethingc                     || _         d S r   r   r   s     r   r   zATestJITMethod.test_unbound_jit_method.<locals>.Something.__init__'   r   r   c                     | j         S r   r   )r   s    r   r"   z?TestJITMethod.test_unbound_jit_method.<locals>.Something.method*   s	    wr   Nr#   r'   r   r   r(   r<   &   s>             S  r   r(   r)   )r+   assertEqualsr"   )r   r(   r5   s      r   test_unbound_jit_methodz%TestJITMethod.test_unbound_jit_method%   se    	 	 	 	 	 	 	 	 IaLL	)**955q99999r   N)r$   r%   r&   r9   r@   r'   r   r   r	   r	      s2        0 0 02
: 
: 
: 
: 
:r   r	   c                       e Zd Zd Zd ZdS )TestDisabledJITc                 "   t          dd          5  d }t          |          }d d d            n# 1 swxY w Y   |                     ||           |                     d |d                     |                     d |d                     d S )NDISABLE_JITTc                     | S r   r'   r   s    r   r"   z7TestDisabledJIT.test_decorated_function.<locals>.method5       r   
   r   r   assertEqualr   r"   jitteds      r   test_decorated_functionz'TestDisabledJIT.test_decorated_function3   s    ]D11 	! 	!  [[F	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!
 	(((VVBZZ(((VVBZZ(((((s   044c                 6   t          dd          5  d } t          d          |          }d d d            n# 1 swxY w Y   |                     ||           |                     d |d                     |                     d |d                     d S )NrD   Tc                     | S r   r'   rF   s    r   r"   zCTestDisabledJIT.test_decorated_function_with_kwargs.<locals>.method?   rG   r   )nopythonrH   rI   rK   s      r   #test_decorated_function_with_kwargsz3TestDisabledJIT.test_decorated_function_with_kwargs=   s    ]D11 	0 	0  'S$'''//F	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0
 	(((VVBZZ(((VVBZZ(((((s   :>>N)r$   r%   r&   rM   rQ   r'   r   r   rB   rB   2   s2        ) ) )) ) ) ) )r   rB   __main__)unittestnumpyr   numbar   
numba.corer   r   numba.core.compilerr   numba.tests.supportr   TestCaser	   rB   r$   mainr'   r   r   <module>r[      s               $ $ $ $ $ $ $ $ 0 0 0 0 0 0 / / / / / /$: $: $: $: $:H% $: $: $:N) ) ) ) )h' ) ) )* zHMOOOOO r   