def get_state_ptr(context, builder, name):
 assert (name in ('py', 'np'))
 func_name = ('numba_get_%s_random_state' % name)
 fnty = ir.FunctionType(rnd_state_ptr_t, ())
 fn = builder.module.get_or_insert_function(fnty, func_name)
 fn.attributes.add('readnone')
 fn.attributes.add('nounwind')
 return builder.call(fn, ())

def get_state_ptr ( context , builder , name ) : assert ( name in ( 'py' , 'np' ) ) func_name = ( 'numba_get_%s_random_state' % name ) fnty = ir . FunctionType ( rnd_state_ptr_t , ( ) ) fn = builder . module . get_or_insert_function ( fnty , func_name ) fn . attributes . add ( 'readnone' ) fn . attributes . add ( 'nounwind' ) return builder . call ( fn , ( ) )
get a pointer to the given thread-local random state .