#NEWLINE# def binary_ufunc_check( fun , lims_A = [ ( - 2 ) , 2 ] , lims_B = [ ( - 2 ) , 2 ] , test_complex = True ) : #NEWLINE# #INDENT# T_A = ( lambda x : transform ( lims_A , x ) ) #NEWLINE# T_B = ( lambda x : transform ( lims_B , x ) ) #NEWLINE# scalar_int = 1 #NEWLINE# scalar = 0.6 #NEWLINE# vector = npr . rand ( 2 ) #NEWLINE# mat = npr . rand ( 3 , 2 ) #NEWLINE# mat2 = npr . rand ( 1 , 2 ) #NEWLINE# combo_check ( fun , ( 0 , 1 ) , [ T_A ( scalar ) , T_A ( scalar_int ) , T_A ( vector ) , T_A ( mat ) , T_A ( mat2 ) ] , [ T_B ( scalar ) , T_B ( scalar_int ) , T_B ( vector ) , T_B ( mat ) , T_B ( mat2 ) ] ) #NEWLINE# if test_complex : #NEWLINE# #INDENT# comp = ( 0.6 + 0.3j ) #NEWLINE# matc = ( npr . rand ( 3 , 2 ) + ( 0.1j * npr . rand ( 3 , 2 ) ) ) #NEWLINE# combo_check ( fun , ( 0 , 1 ) , [ T_A ( scalar ) , T_A ( comp ) , T_A ( vector ) , T_A ( matc ) , T_A ( mat2 ) ] , [ T_B ( scalar ) , T_B ( comp ) , T_B ( vector ) , T_B ( matc ) , T_B ( mat2 ) ] )