#NEWLINE# def mkstemp( * args , **kwargs ) : #NEWLINE# #INDENT# "\n    Helper function which does exactly what `tempfile.mkstemp()` does but\n    accepts another argument, `close_fd`, which, by default, is true and closes\n    the fd before returning the file path. Something commonly done throughout\n    Salt's code.\n    " #NEWLINE# close_fd = kwargs . pop ( 'close_fd' , True ) #NEWLINE# ( fd_ , fpath ) = tempfile . mkstemp ( * args , ** kwargs ) #NEWLINE# if ( close_fd is False ) : #NEWLINE# #INDENT# return ( fd_ , fpath ) #NEWLINE# #UNINDENT# os . close ( close_fd ) #NEWLINE# del fd_ #NEWLINE# return fpath