def stream_to_file(stream, suffix='', prefix='', dir=None, text=False, **kwd):
 (fd, temp_name) = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir, text=text)
 return stream_to_open_named_file(stream, fd, temp_name, **kwd)

def stream_to_file ( stream , suffix = '' , prefix = '' , dir = None , text = False , ** kwd ) : ( fd , temp_name ) = tempfile . mkstemp ( suffix = suffix , prefix = prefix , dir = dir , text = text ) return stream_to_open_named_file ( stream , fd , temp_name , ** kwd )
writes a stream to a temporary file .