#NEWLINE# def makeConditionalStatement( condition , yes_branch , no_branch , source_ref ) : #NEWLINE# #INDENT# ' Create conditional statement, with yes_branch not being empty.\n\n        May have to invert condition to achieve that.\n    ' #NEWLINE# if ( yes_branch is None ) : #NEWLINE# #INDENT# condition = ExpressionOperationNOT ( operand = condition , source_ref = condition . getSourceReference ( ) ) #NEWLINE# ( yes_branch , no_branch ) = ( no_branch , yes_branch ) #NEWLINE# #UNINDENT# if ( not yes_branch . isStatementsSequence ( ) ) : #NEWLINE# #INDENT# yes_branch = makeStatementsSequenceFromStatement ( yes_branch ) #NEWLINE# #UNINDENT# if ( ( no_branch is not None ) and ( not no_branch . isStatementsSequence ( ) ) ) : #NEWLINE# #INDENT# no_branch = makeStatementsSequenceFromStatement ( no_branch ) #NEWLINE# #UNINDENT# return StatementConditional ( condition = condition , yes_branch = yes_branch , no_branch = no_branch , source_ref = source_ref )