#NEWLINE# def check_reflection( self , pyfunc ) : #NEWLINE# #INDENT# cfunc = jit ( nopython = True ) ( pyfunc ) #NEWLINE# samples = [ ( set ( [ 1.0 , 2.0 , 3.0 , 4.0 ] ) , set ( [ 0.0 ] ) ) , ( set ( [ 1.0 , 2.0 , 3.0 , 4.0 ] ) , set ( [ 5.0 , 6.0 , 7.0 , 8.0 , 9.0 ] ) ) ] #NEWLINE# for ( dest , src ) in samples : #NEWLINE# #INDENT# expected = set ( dest ) #NEWLINE# got = set ( dest ) #NEWLINE# pyres = pyfunc ( expected , src ) #NEWLINE# with self . assertRefCount ( got , src ) : #NEWLINE# #INDENT# cres = cfunc ( got , src ) #NEWLINE# self . assertPreciseEqual ( cres , pyres ) #NEWLINE# self . assertPreciseEqual ( src , got ) #NEWLINE# self . assertEqual ( ( pyres [ 0 ] is expected ) , ( cres [ 0 ] is got ) ) #NEWLINE# del pyres , cres