#NEWLINE# def ExpandExpression( stack ) : #NEWLINE# #INDENT# 'Convert stack into the form of factor * field + constant.\n\n  Arguments:\n    stack: The postfix expression wished to be expanded.\n\n  Returns:\n    The infix string of stack iff stack is unencrypted. Otherwise, expands\n    stack into the form of factor * field + constant.\n  ' #NEWLINE# def IsEncrypted( tokens ) : #NEWLINE# #INDENT# for token in tokens : #NEWLINE# #INDENT# if util . IsEncrypted ( token ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# return False #NEWLINE# #UNINDENT# if ( not IsEncrypted ( stack ) ) : #NEWLINE# #INDENT# return [ [ [ 1.0 , ToInfix ( stack ) ] ] , 0.0 ] #NEWLINE# #UNINDENT# return _ExpandExpression ( stack )