#NEWLINE# def SaveImagesToTemp( images , basename ) : #NEWLINE# #INDENT# tempdir = tempfile . mkdtemp ( ) #NEWLINE# idx = 0 #NEWLINE# filenames = [ ] #NEWLINE# for image in images : #NEWLINE# #INDENT# name = '{0}{1}.png' . format ( basename , idx ) #NEWLINE# filename = os . path . join ( tempdir , name ) #NEWLINE# filenames . append ( filename ) #NEWLINE# image . save ( filename ) #NEWLINE# idx += 1 #NEWLINE# #UNINDENT# return ( tempdir , filenames )