#NEWLINE# def close( self ) : #NEWLINE# #INDENT# 'Parse all remaining data and return the root message object.' #NEWLINE# self . _input . close ( ) #NEWLINE# self . _call_parse ( ) #NEWLINE# root = self . _pop_message ( ) #NEWLINE# assert ( not self . _msgstack ) #NEWLINE# if ( ( root . get_content_maintype ( ) == 'multipart' ) and ( not root . is_multipart ( ) ) ) : #NEWLINE# #INDENT# defect = errors . MultipartInvariantViolationDefect ( ) #NEWLINE# self . policy . handle_defect ( root , defect ) #NEWLINE# #UNINDENT# return root