def mkstemp(self, suffix, prefix, directory=None):
if not directory:<EOL><INDENT>directory = self.artifacts_dir<EOL><DEDENT>fd, fname = tempfile.mkstemp(suffix, prefix, directory)<EOL>os.close(fd)<EOL>os.chmod(fname, <NUM_LIT>)  <EOL>return fname<EOL>
Generate temp file name in artifacts base dir
and close temp file handle