#NEWLINE# def compute( self ) : #NEWLINE# #INDENT# list1 = self . get_input ( 'List1' ) #NEWLINE# list2 = self . get_input ( 'List2' ) #NEWLINE# result = [ ] #NEWLINE# if ( not self . get_input ( 'CombineTuple' ) ) : #NEWLINE# #INDENT# for i in list1 : #NEWLINE# #INDENT# for j in list2 : #NEWLINE# #INDENT# tuple_ = ( i , j ) #NEWLINE# result . append ( tuple_ ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for i in list1 : #NEWLINE# #INDENT# for j in list2 : #NEWLINE# #INDENT# if ( isinstance ( i , tuple ) and isinstance ( j , tuple ) ) : #NEWLINE# #INDENT# tuple_ = ( i + j ) #NEWLINE# result . append ( tuple_ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( i , tuple ) and ( not isinstance ( j , tuple ) ) ) : #NEWLINE# #INDENT# tuple_ = ( i + ( j , ) ) #NEWLINE# result . append ( tuple_ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not isinstance ( i , tuple ) ) and isinstance ( j , tuple ) ) : #NEWLINE# #INDENT# tuple_ = ( ( i , ) + j ) #NEWLINE# result . append ( tuple_ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# tuple_ = ( i , j ) #NEWLINE# result . append ( tuple_ ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# self . set_output ( 'Result' , result )