#NEWLINE# def _check_arguments( self , filename , file_obj , format , format_dict ) : #NEWLINE# #INDENT# if ( filename and file_obj ) : #NEWLINE# #INDENT# raise ValueError ( 'file is over-specified. Please use either filename or file_obj, but not both.' ) #NEWLINE# #UNINDENT# if ( ( not filename ) and ( not file_obj ) ) : #NEWLINE# #INDENT# raise ValueError ( 'A filename or file-like object must be specified.' ) #NEWLINE# #UNINDENT# if ( valid_formats not in format_dict ) : #NEWLINE# #INDENT# valid_formats = ', ' . join ( sorted ( format_dict . keys ( ) ) ) #NEWLINE# raise ValueError ( ( 'Unsupported format "%s". Use one of %s.' % ( format , valid_formats ) ) )