<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , division <EOL> import unittest <EOL> import numpy as np <EOL> import theano <EOL> from theano . gof import FunctionGraph <EOL> from theano import gof <EOL> from theano . tests import unittest_tools as utt <EOL> from theano . scalar . basic import ( floats , float32 , float64 , <EOL> ints , int8 , int32 , complex64 , <EOL> ComplexError , IntDiv , TrueDiv , <EOL> Composite , add , div_proxy , <EOL> and_ , eq , neq , invert , mul , Scalar , InRange ) <EOL> from theano . scalar . basic import ( <EOL> true_div , inv , log , log2 , log10 , log1p , exp , exp2 , expm1 , sqrt , deg2rad , <EOL> rad2deg , cos , arccos , sin , arcsin , tan , arctan , arctan2 , cosh , arccosh , <EOL> sinh , arcsinh , tanh , arctanh ) <EOL> def inputs ( ) : <EOL> return floats ( '<STR_LIT>' ) <EOL> class test_ScalarOps ( unittest . TestCase ) : <EOL> def test_straightforward ( self ) : <EOL> x , y , z = inputs ( ) <EOL> e = mul ( add ( x , y ) , div_proxy ( x , y ) ) <EOL> g = FunctionGraph ( [ x , y ] , [ e ] ) <EOL> fn = gof . DualLinker ( ) . accept ( g ) . make_function ( ) <EOL> assert fn ( <NUM_LIT:1.0> , <NUM_LIT> ) == <NUM_LIT> <EOL> def tes_mod ( self ) : <EOL> """<STR_LIT>""" <EOL> x , y = ints ( '<STR_LIT>' ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x % y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , - <NUM_LIT:1> ) , ( <NUM_LIT:1> , - <NUM_LIT:1> ) , ( - <NUM_LIT:1> , - <NUM_LIT:1> ) , <EOL> ( <NUM_LIT:1> , <NUM_LIT:2> ) , ( - <NUM_LIT:1> , <NUM_LIT:2> ) , ( <NUM_LIT:1> , - <NUM_LIT:2> ) , ( - <NUM_LIT:1> , - <NUM_LIT:2> ) , <EOL> ( <NUM_LIT:5> , <NUM_LIT:3> ) , ( - <NUM_LIT:5> , <NUM_LIT:3> ) , ( <NUM_LIT:5> , - <NUM_LIT:3> ) , ( - <NUM_LIT:5> , - <NUM_LIT:3> ) <EOL> ) : <EOL> self . assertTrue ( fn ( a , b ) == a % b , ( a , ) ) <EOL> class test_composite ( unittest . TestCase ) : <EOL> def test_straightforward ( self ) : <EOL> x , y , z = inputs ( ) <EOL> e = mul ( add ( x , y ) , div_proxy ( x , y ) ) <EOL> C = Composite ( [ x , y ] , [ e ] ) <EOL> c = C . make_node ( x , y ) <EOL> g = FunctionGraph ( [ x , y ] , [ c . out ] ) <EOL> fn = gof . DualLinker ( ) . accept ( g ) . make_function ( ) <EOL> assert fn ( <NUM_LIT:1.0> , <NUM_LIT> ) == <NUM_LIT> <EOL> def test_flatten ( self ) : <EOL> x , y , z = inputs ( ) <EOL> C = Composite ( [ x , y ] , [ x + y ] ) <EOL> CC = Composite ( [ x , y ] , [ C ( x * y , y ) ] ) <EOL> assert not isinstance ( CC . outputs [ <NUM_LIT:0> ] . owner . op , Composite ) <EOL> CC = Composite ( [ x , y , z ] , [ C ( x * y , y ) , C ( x * z , y ) ] ) <EOL> assert isinstance ( CC . outputs [ <NUM_LIT:0> ] . owner . op , Composite ) <EOL> def test_with_constants ( self ) : <EOL> x , y , z = inputs ( ) <EOL> e = mul ( add ( <NUM_LIT> , y ) , div_proxy ( x , y ) ) <EOL> C = Composite ( [ x , y ] , [ e ] ) <EOL> c = C . make_node ( x , y ) <EOL> assert "<STR_LIT>" in c . op . c_code ( c , '<STR_LIT>' , [ '<STR_LIT:x>' , '<STR_LIT:y>' ] , [ '<STR_LIT:z>' ] , dict ( id = <NUM_LIT:0> ) ) <EOL> g = FunctionGraph ( [ x , y ] , [ c . out ] ) <EOL> fn = gof . DualLinker ( ) . accept ( g ) . make_function ( ) <EOL> assert fn ( <NUM_LIT:1.0> , <NUM_LIT> ) == <NUM_LIT> <EOL> def test_many_outputs ( self ) : <EOL> x , y , z = inputs ( ) <EOL> e0 = x + y + z <EOL> e1 = x + y * z <EOL> e2 = x / y <EOL> C = Composite ( [ x , y , z ] , [ e0 , e1 , e2 ] ) <EOL> c = C . make_node ( x , y , z ) <EOL> g = FunctionGraph ( [ x , y , z ] , c . outputs ) <EOL> fn = gof . DualLinker ( ) . accept ( g ) . make_function ( ) <EOL> assert fn ( <NUM_LIT:1.0> , <NUM_LIT> , <NUM_LIT> ) == [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.5> ] <EOL> def test_composite_printing ( self ) : <EOL> x , y , z = floats ( '<STR_LIT>' ) <EOL> e0 = x + y + z <EOL> e1 = x + y * z <EOL> e2 = x / y <EOL> e3 = x // <NUM_LIT:5> <EOL> e4 = - x <EOL> e5 = x - y <EOL> e6 = x ** y + ( - z ) <EOL> e7 = x % <NUM_LIT:3> <EOL> C = Composite ( [ x , y , z ] , [ e0 , e1 , e2 , e3 , e4 , e5 , e6 , e7 ] ) <EOL> c = C . make_node ( x , y , z ) <EOL> g = FunctionGraph ( [ x , y , z ] , c . outputs ) <EOL> fn = gof . DualLinker ( ) . accept ( g ) . make_function ( ) <EOL> assert str ( g ) == ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def test_make_node_continue_graph ( self ) : <EOL> si0 = theano . scalar . int8 ( ) <EOL> si1 = theano . scalar . int8 ( ) <EOL> si2 = theano . scalar . float32 ( ) <EOL> sout = ( si0 * si1 ) / si2 <EOL> sop = theano . scalar . Composite ( [ si0 , si1 , si2 ] , <EOL> [ sout ] ) <EOL> si0 = theano . scalar . int8 ( ) <EOL> si1 = theano . scalar . int8 ( ) <EOL> si2 = theano . scalar . float32 ( ) <EOL> si3 = theano . scalar . float32 ( ) <EOL> sop . make_node ( si0 * si3 , si1 , si2 ) <EOL> def test_composite_neg_bool ( self ) : <EOL> x = floats ( '<STR_LIT:x>' ) <EOL> y = - ( x > <NUM_LIT:0> ) <EOL> z = Composite ( [ x ] , [ y ] ) . make_node ( x ) . outputs [ <NUM_LIT:0> ] <EOL> f = theano . function ( [ x ] , z , mode = theano . Mode ( linker = '<STR_LIT>' ) ) <EOL> for inp , out in zip ( [ - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> ] , [ <NUM_LIT:0> , <NUM_LIT:0> , - <NUM_LIT:1> ] ) : <EOL> self . assertTrue ( f ( inp ) == out ) <EOL> class test_logical ( unittest . TestCase ) : <EOL> def test_gt ( self ) : <EOL> x , y , z = inputs ( ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x > y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT> , <NUM_LIT:9> ) , ( <NUM_LIT:3> , <NUM_LIT> ) , ( <NUM_LIT:3> , <NUM_LIT:3> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a > b ) ) <EOL> def test_lt ( self ) : <EOL> x , y , z = inputs ( ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x < y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT> , <NUM_LIT:9> ) , ( <NUM_LIT:3> , <NUM_LIT> ) , ( <NUM_LIT:3> , <NUM_LIT:3> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a < b ) ) <EOL> def test_le ( self ) : <EOL> x , y , z = inputs ( ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x <= y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT> , <NUM_LIT:9> ) , ( <NUM_LIT:3> , <NUM_LIT> ) , ( <NUM_LIT:3> , <NUM_LIT:3> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a <= b ) ) <EOL> def test_ge ( self ) : <EOL> x , y , z = inputs ( ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x >= y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT> , <NUM_LIT:9> ) , ( <NUM_LIT:3> , <NUM_LIT> ) , ( <NUM_LIT:3> , <NUM_LIT:3> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a >= b ) ) <EOL> def test_eq ( self ) : <EOL> x , y , z = inputs ( ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ eq ( x , y ) ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT> , <NUM_LIT:9> ) , ( <NUM_LIT:3> , <NUM_LIT> ) , ( <NUM_LIT:3> , <NUM_LIT:3> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a == b ) ) <EOL> def test_neq ( self ) : <EOL> x , y , z = inputs ( ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ neq ( x , y ) ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT> , <NUM_LIT:9> ) , ( <NUM_LIT:3> , <NUM_LIT> ) , ( <NUM_LIT:3> , <NUM_LIT:3> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a != b ) ) <EOL> def test_or ( self ) : <EOL> x , y , z = ints ( '<STR_LIT>' ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x | y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a | b ) , ( a , b ) ) <EOL> def test_xor ( self ) : <EOL> x , y , z = ints ( '<STR_LIT>' ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x ^ y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a ^ b ) , ( a , b ) ) <EOL> def test_and ( self ) : <EOL> x , y , z = ints ( '<STR_LIT>' ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ and_ ( x , y ) ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a & b ) , ( a , b ) ) <EOL> x , y , z = ints ( '<STR_LIT>' ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ x & y ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ( a & b ) , ( a , b ) ) <EOL> def test_not ( self ) : <EOL> x , y , z = ints ( '<STR_LIT>' ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ invert ( x ) ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ~ a , ( a , ) ) <EOL> x , y , z = ints ( '<STR_LIT>' ) <EOL> fn = gof . DualLinker ( ) . accept ( FunctionGraph ( [ x , y ] , [ ~ x ] ) ) . make_function ( ) <EOL> for a , b in ( ( <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) : <EOL> self . assertTrue ( fn ( a , b ) == ~ a , ( a , ) ) <EOL> class test_upgrade_to_float ( object ) : <EOL> unary_ops_vals = [ <EOL> ( inv , list ( range ( - <NUM_LIT> , <NUM_LIT:0> ) ) + list ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) ) , <EOL> ( sqrt , list ( range ( <NUM_LIT:0> , <NUM_LIT> ) ) ) , <EOL> ( log , list ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) ) , <EOL> ( log2 , list ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) ) , <EOL> ( log10 , list ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) ) , <EOL> ( log1p , list ( range ( <NUM_LIT:0> , <NUM_LIT> ) ) ) , <EOL> ( exp , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( exp2 , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( expm1 , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( deg2rad , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( rad2deg , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( cos , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( arccos , list ( range ( - <NUM_LIT:1> , <NUM_LIT:2> ) ) ) , <EOL> ( cosh , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( arccosh , list ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) ) , <EOL> ( sin , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( arcsin , list ( range ( - <NUM_LIT:1> , <NUM_LIT:2> ) ) ) , <EOL> ( sinh , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( arcsinh , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( tan , list ( range ( - <NUM_LIT:3> , <NUM_LIT:4> ) ) ) , <EOL> ( arctan , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( tanh , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) , <EOL> ( arctanh , [ <NUM_LIT:0> ] ) ] <EOL> binary_ops_vals = [ <EOL> ( arctan2 , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) , list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) ) ] <EOL> @ staticmethod <EOL> def _test_unary ( unary_op , x_range ) : <EOL> xi = int8 ( '<STR_LIT>' ) <EOL> xf = float32 ( '<STR_LIT>' ) <EOL> ei = unary_op ( xi ) <EOL> fi = theano . function ( [ xi ] , ei ) <EOL> ef = unary_op ( xf ) <EOL> ff = theano . function ( [ xf ] , ef ) <EOL> for x_val in x_range : <EOL> outi = fi ( x_val ) <EOL> outf = ff ( x_val ) <EOL> assert outi . dtype == outf . dtype , '<STR_LIT>' <EOL> assert np . allclose ( outi , outf ) , '<STR_LIT>' <EOL> @ staticmethod <EOL> def _test_binary ( binary_op , x_range , y_range ) : <EOL> xi = int8 ( '<STR_LIT>' ) <EOL> yi = int8 ( '<STR_LIT>' ) <EOL> xf = float32 ( '<STR_LIT>' ) <EOL> yf = float32 ( '<STR_LIT>' ) <EOL> ei = binary_op ( xi , yi ) <EOL> fi = theano . function ( [ xi , yi ] , ei ) <EOL> ef = binary_op ( xf , yf ) <EOL> ff = theano . function ( [ xf , yf ] , ef ) <EOL> for x_val in x_range : <EOL> for y_val in y_range : <EOL> outi = fi ( x_val , y_val ) <EOL> outf = ff ( x_val , y_val ) <EOL> assert outi . dtype == outf . dtype , '<STR_LIT>' <EOL> assert np . allclose ( outi , outf ) , '<STR_LIT>' <EOL> def test_true_div ( self ) : <EOL> x_range = list ( range ( - <NUM_LIT> , <NUM_LIT> ) ) <EOL> y_range = list ( range ( - <NUM_LIT> , <NUM_LIT:0> ) ) + list ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) <EOL> xi = int8 ( '<STR_LIT>' ) <EOL> yi = int8 ( '<STR_LIT>' ) <EOL> xf = Scalar ( theano . config . floatX ) ( '<STR_LIT>' ) <EOL> yf = Scalar ( theano . config . floatX ) ( '<STR_LIT>' ) <EOL> ei = true_div ( xi , yi ) <EOL> fi = theano . function ( [ xi , yi ] , ei ) <EOL> ef = true_div ( xf , yf ) <EOL> ff = theano . function ( [ xf , yf ] , ef ) <EOL> for x_val in x_range : <EOL> for y_val in y_range : <EOL> outi = fi ( x_val , y_val ) <EOL> outf = ff ( x_val , y_val ) <EOL> assert outi . dtype == outf . dtype , '<STR_LIT>' <EOL> assert np . allclose ( outi , outf ) , '<STR_LIT>' <EOL> def test_unary ( self ) : <EOL> for unary_op , x_range in self . unary_ops_vals : <EOL> test_name = '<STR_LIT>' % unary_op . name <EOL> test = lambda : self . _test_unary ( unary_op , x_range ) <EOL> test . description = test_name <EOL> yield test <EOL> def test_binary ( self ) : <EOL> for binary_op , x_range , y_range in self . binary_ops_vals : <EOL> test_name = '<STR_LIT>' % binary_op . name <EOL> test = lambda : self . _test_binary ( binary_op , x_range , y_range ) <EOL> test . description = test_name <EOL> yield test <EOL> class test_complex_mod ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_fail ( self ) : <EOL> x = complex64 ( ) <EOL> y = int32 ( ) <EOL> try : <EOL> x % y <EOL> assert False <EOL> except ComplexError : <EOL> pass <EOL> class test_div ( unittest . TestCase ) : <EOL> def test_0 ( self ) : <EOL> a = int8 ( ) <EOL> b = int32 ( ) <EOL> c = complex64 ( ) <EOL> d = float64 ( ) <EOL> f = float32 ( ) <EOL> assert isinstance ( ( a // b ) . owner . op , IntDiv ) <EOL> assert isinstance ( ( b // a ) . owner . op , IntDiv ) <EOL> assert isinstance ( ( b / d ) . owner . op , TrueDiv ) <EOL> assert isinstance ( ( b / f ) . owner . op , TrueDiv ) <EOL> assert isinstance ( ( f / a ) . owner . op , TrueDiv ) <EOL> assert isinstance ( ( d / b ) . owner . op , TrueDiv ) <EOL> assert isinstance ( ( d / f ) . owner . op , TrueDiv ) <EOL> assert isinstance ( ( f / c ) . owner . op , TrueDiv ) <EOL> assert isinstance ( ( a / c ) . owner . op , TrueDiv ) <EOL> def test_grad_gt ( ) : <EOL> x = float32 ( name = '<STR_LIT:x>' ) <EOL> y = float32 ( name = '<STR_LIT:y>' ) <EOL> z = x > y <EOL> g = theano . gradient . grad ( z , y ) <EOL> assert g . eval ( { y : <NUM_LIT:1.> } ) == <NUM_LIT:0.> <EOL> def test_grad_switch ( ) : <EOL> x = theano . tensor . matrix ( ) <EOL> c = theano . tensor . matrix ( ) <EOL> s = theano . tensor . switch ( c , x , <NUM_LIT:0> ) <EOL> l = s . sum ( ) <EOL> theano . gradient . grad ( l , x ) <EOL> def test_grad_identity ( ) : <EOL> x = theano . tensor . imatrix ( '<STR_LIT:x>' ) <EOL> y = theano . tensor . tensor_copy ( x ) <EOL> l = y . sum ( dtype = theano . config . floatX ) <EOL> theano . gradient . grad ( l , x ) <EOL> def test_grad_inrange ( ) : <EOL> for bound_definition in [ ( True , True ) , ( False , False ) ] : <EOL> op = InRange ( * bound_definition ) <EOL> x = theano . tensor . fscalar ( '<STR_LIT:x>' ) <EOL> low = theano . tensor . fscalar ( '<STR_LIT>' ) <EOL> high = theano . tensor . fscalar ( '<STR_LIT>' ) <EOL> out = op ( x , low , high ) <EOL> gx , glow , ghigh = theano . tensor . grad ( out , [ x , low , high ] ) <EOL> f = theano . function ( [ x , low , high ] , [ gx , glow , ghigh ] ) <EOL> utt . assert_allclose ( f ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:5> ) , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> utt . assert_allclose ( f ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> ) , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> utt . assert_allclose ( f ( <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:5> ) , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> utt . assert_allclose ( f ( <NUM_LIT:5> , <NUM_LIT:1> , <NUM_LIT:5> ) , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> utt . assert_allclose ( f ( <NUM_LIT:7> , <NUM_LIT:1> , <NUM_LIT:5> ) , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
