<commit_before>-- lua-npge, Nucleotide PanGenome explorer (Lua module)
-- Copyright (C) 2014-2016 <NAME>
-- See the LICENSE file for terms of use.

local TMP

return function()
    local fname = os.tmpname()
    local fileExists = require 'npge.util.fileExists'
    if not fileExists(fname) then
        -- http://www.luafaq.org/#T1.40
        TMP = TMP or os.getenv("TMP")
        if TMP then
            fname = TMP .. fname
        end
        local f = assert(io.open(fname, 'w'))
        f:close()
    end
    return fname
end<commit_msg>tmpName: make sure that file is writable<commit_after>-- lua-npge, Nucleotide PanGenome explorer (Lua module)
-- Copyright (C) 2014-2016 <NAME>
-- See the LICENSE file for terms of use.

local TMP

return function()
    local fname = os.tmpname()
    local f = io.open(fname, 'w')
    if not f then
        -- http://www.luafaq.org/#T1.40
        TMP = TMP or os.getenv("TMP")
        if TMP then
            fname = TMP .. fname
        end
        f = assert(io.open(fname, 'w'))
    end
    f:close()
    return fname
end
{'fraction_non_alphanumeric': 0.1190253045923149, 'fraction_numerical': 0.020618556701030927, 'mean_word_length': 2.150442477876106, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4904955', 'n_tokens_mistral': 391, 'n_tokens_neox': 364, 'n_words': 114}