#NEWLINE# def test_flatten( self ) : #NEWLINE# #INDENT# self . assertEqual ( [ 1 , 2 , 3 , 4 ] , list ( iters . flatten ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) ) ) #NEWLINE# self . assertEqual ( [ 1 , 2 , 3 , 4 , 5 , 6 ] , list ( iters . flatten ( [ [ 1 , 2 ] , [ 3 , [ 4 , 5 , 6 ] ] ] ) ) ) #NEWLINE# self . assertEqual ( [ 1 , 2 , 3 , 4 , 5 , 6 ] , list ( iters . flatten ( ( ( 1 , 2 ) , ( 3 , ( 4 , 5 , 6 ) ) ) ) ) ) #NEWLINE# self . assertEqual ( [ 1 , 2 , 3 ] , list ( iters . flatten ( set ( [ 1 , frozenset ( [ 2 , 3 ] ) ] ) ) ) ) #NEWLINE# generators = ( ( ( num + 1 ) for num in range ( 0 , n ) ) for n in range ( 1 , 4 ) ) #NEWLINE# self . assertEqual ( [ 1 , 1 , 2 , 1 , 2 , 3 ] , list ( iters . flatten ( generators ) ) ) #NEWLINE# self . assertEqual ( [ 1 , 2 , 3 ] , list ( iters . flatten ( [ 1 , 2 , 3 ] ) ) ) #NEWLINE# self . assertEqual ( [ 2 , 'abc' , 1 ] , list ( iters . flatten ( [ 2 , 'abc' , 1 ] ) ) ) #NEWLINE# self . assertEqual ( [ 2 , b'abc' , 1 ] , list ( iters . flatten ( [ 2 , b'abc' , 1 ] ) ) ) #NEWLINE# self . assertEqual ( [ 2 , bytearray ( b'abc' ) , 1 ] , list ( iters . flatten ( [ 2 , bytearray ( b'abc' ) , 1 ] ) ) )