def create_temp_file(buffer):
 (fd, absolute_file_name) = mkstemp(text=True)
 file = os.fdopen(fd, ('wb' if (type(buffer) is bytes) else 'w'))
 file.write(buffer)
 file.close()
 return absolute_file_name

def create_temp_file ( buffer ) : ( fd , absolute_file_name ) = mkstemp ( text = True ) file = os . fdopen ( fd , ( 'wb' if ( type ( buffer ) is bytes ) else 'w' ) ) file . write ( buffer ) file . close ( ) return absolute_file_name
helper method to create temp file on disk .