def test_trio( ) : try : from tf import trio except: print( 'Cannot import tf.trio() ;; ' ) return x1 = [0, -3, 0, -4, -2] x2 = [-3, 1, -2, 1, -3, -3, -2, -4, -1, -4] x3 = [2, -1, 0, 3, 0, 3, -2, -2, -1, -4, 3, -4, 3, -1, 3] x4 = [] tests = [ x1, x2, x3, x4 ] for i in range( 0, len ( tests ) ) : try : x = tests[ i ] t = trio( x ) print( 'trio( x' + str(i+1), '):', t ) except: print( 'trio( x' + str(i+1), ') does not complete' ) def test_flatten() : try : from tf import flatten except: print( 'Cannot import tf.flatten() ;; ' ) return d1 = [ [ 0 ], [ 1, 2 ], [ 1, 2, 3 ], [ 0 ] ] d2 = [ [ 1, 0, 1, 2, 2 ], [ 3, 0, 1, 1, 1, 0 ], [ 2 ], [ 0, 0, 1 ] ] d3 = [ [ 3, 0, 3], [ 3, 0, 3, 0, 1], [ 1, 0, 2 ] ] d4 = [ ] tests = [ d1, d2, d3, d4 ] for i in range( 0, len ( tests ) ) : try : d = tests[ i ] f = flatten( d ) print( 'flatten( d' + str(i+1), '):', f ) except: print( 'flatten( d' + str(i+1), ') does not complete' ) if ( __name__ == '__main__' ) : try : import tf test_trio() print() test_flatten() except: print( 'Cannot import tf' )