<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from numba import jit , generated_jit , types <EOL> from numba . tests . ctypes_usecases import c_sin <EOL> @ jit ( cache = True , nopython = True ) <EOL> def add_usecase ( x , y ) : <EOL> return x + y + Z <EOL> @ jit ( cache = True , forceobj = True ) <EOL> def add_objmode_usecase ( x , y ) : <EOL> object ( ) <EOL> return x + y + Z <EOL> @ jit ( nopython = True ) <EOL> def add_nocache_usecase ( x , y ) : <EOL> return x + y + Z <EOL> @ generated_jit ( cache = True , nopython = True ) <EOL> def generated_usecase ( x , y ) : <EOL> if isinstance ( x , types . Complex ) : <EOL> def impl ( x , y ) : <EOL> return x + y <EOL> else : <EOL> def impl ( x , y ) : <EOL> return x - y <EOL> return impl <EOL> @ jit ( cache = True , nopython = True ) <EOL> def inner ( x , y ) : <EOL> return x + y + Z <EOL> @ jit ( cache = True , nopython = True ) <EOL> def outer ( x , y ) : <EOL> return inner ( - y , x ) <EOL> @ jit ( cache = False , nopython = True ) <EOL> def outer_uncached ( x , y ) : <EOL> return inner ( - y , x ) <EOL> @ jit ( cache = True , forceobj = True ) <EOL> def looplifted ( n ) : <EOL> object ( ) <EOL> res = <NUM_LIT:0> <EOL> for i in range ( n ) : <EOL> res = res + i <EOL> return res <EOL> @ jit ( cache = True , nopython = True ) <EOL> def use_c_sin ( x ) : <EOL> return c_sin ( x ) <EOL> @ jit ( cache = True , nopython = True ) <EOL> def ambiguous_function ( x ) : <EOL> return x + <NUM_LIT:2> <EOL> renamed_function1 = ambiguous_function <EOL> @ jit ( cache = True , nopython = True ) <EOL> def ambiguous_function ( x ) : <EOL> return x + <NUM_LIT:6> <EOL> renamed_function2 = ambiguous_function <EOL> def make_closure ( x ) : <EOL> @ jit ( cache = True , nopython = True ) <EOL> def closure ( y ) : <EOL> return x + y <EOL> return closure <EOL> closure1 = make_closure ( <NUM_LIT:3> ) <EOL> closure2 = make_closure ( <NUM_LIT:5> ) <EOL> Z = <NUM_LIT:1> <EOL> packed_record_type = np . dtype ( [ ( '<STR_LIT:a>' , np . int8 ) , ( '<STR_LIT:b>' , np . float64 ) ] ) <EOL> aligned_record_type = np . dtype ( [ ( '<STR_LIT:a>' , np . int8 ) , ( '<STR_LIT:b>' , np . float64 ) ] , align = True ) <EOL> packed_arr = np . empty ( <NUM_LIT:2> , dtype = packed_record_type ) <EOL> for i in range ( packed_arr . size ) : <EOL> packed_arr [ i ] [ '<STR_LIT:a>' ] = i + <NUM_LIT:1> <EOL> packed_arr [ i ] [ '<STR_LIT:b>' ] = i + <NUM_LIT> <EOL> aligned_arr = np . array ( packed_arr , dtype = aligned_record_type ) <EOL> @ jit ( cache = True , nopython = True ) <EOL> def record_return ( ary , i ) : <EOL> return ary [ i ] </s>
