def _mkstemp_inner(dir, pre, suf, flags):

    names = _get_candidate_names()

    for seq in xrange(TMP_MAX):
        name = names.next()
        file = _os.path.join(dir, pre + name + suf)
        try:
            fd = _os.open(file, flags, 0600)
            _set_cloexec(fd)
            return (fd, _os.path.abspath(file))
        except OSError, e:
            if e.errno == _errno.EEXIST:
                continue # try again
            raise

    raise IOError, (_errno.EEXIST, "No usable temporary file name found")


# User visible interfaces.
Use a simple algorithm to find broken optimizations.
dataset/ETHPy150Open eBay/restcommander/play-1.2.4/python/Lib/tempfile.py/_mkstemp_inner--crossover with--dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/compile/debugmode.py/_find_bad_optimizations2