<commit_before>Table = Table or {}

function Table:Merge(table2)
    for k, v in pairs(table2) do
        if type(v) == 'table' then
            local sv = type(self[k])
            if sv == 'table' or sv == 'nil' then
                if sv == 'nil' then
                    self[k] = {}
                end
                Table.Merge(self[k], v)
            end
        elseif self[k] == nil then
            self[k] = v
        end
    end
    return self
end

-- Concatenates one or more array tables into a
-- new table and returns it
function Table.Concat(...)
    local ret = {}
    local tables = {...}
    for _, tbl in ipairs(tables) do
        for _, element in ipairs(tbl) do
            table.insert(ret, element)
        end
    end
    return ret
end

-- This function is a workaround for the # operator which fails with associative
-- arrays. 
function Table.IsEmpty(t)
    -- luacheck: ignore
    for _ in pairs(t) do
        return false
    end
    return true
end

function Table.GetSize(t)
    local i = 0
    for _ in pairs(t) do
        i = i + 1
    end
    return i
end

-- FIXME
-- FIXME: Cleanup everything below
-- FIXME
function SB.CreateNameMapping(origArray)
    local newArray = {}
    for i = 1, #origArray do
        local item = origArray[i]
        newArray[item.name] = item
    end
    return newArray<commit_msg>Fix travis<commit_after>Table = Table or {}

function Table:Merge(table2)
    for k, v in pairs(table2) do
        if type(v) == 'table' then
            local sv = type(self[k])
            if sv == 'table' or sv == 'nil' then
                if sv == 'nil' then
                    self[k] = {}
                end
                Table.Merge(self[k], v)
            end
        elseif self[k] == nil then
            self[k] = v
        end
    end
    return self
end

-- Concatenates one or more array tables into a
-- new table and returns it
function Table.Concat(...)
    local ret = {}
    local tables = {...}
    for _, tbl in ipairs(tables) do
        for _, element in ipairs(tbl) do
            table.insert(ret, element)
        end
    end
    return ret
end

-- This function is a workaround for the # operator which fails with associative
-- arrays.
function Table.IsEmpty(t)
    -- luacheck: ignore
    for _ in pairs(t) do
        return false
    end
    return true
end

function Table.GetSize(t)
    local i = 0
    for _ in pairs(t) do
        i = i + 1
    end
    return i
end

-- FIXME
-- FIXME: Cleanup everything below
-- FIXME
function SB.CreateNameMapping(origArray)
    local newArray = {}
    for i = 1, #origArray do
        local item = origArray[i]
        newArray[item.name] = item
    end
    return newArray
{'fraction_non_alphanumeric': 0.09414381022979985, 'fraction_numerical': 0.0037064492216456633, 'mean_word_length': 1.7071213640922769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2101103', 'n_tokens_mistral': 830, 'n_tokens_neox': 817, 'n_words': 294}