<commit_before>TbUtils.$inject = ['toaster', '$rootScope', '$mdDialog'];

function TbUtils(toaster, $rootScope, $mdDialog) {
    var service = {
        fillListWithResponseData: fillListWithResponseData,
        displayNotification: displayNotification,
        preventGeneralLoading: preventGeneralLoading,
        initArrayToValue: initArrayToValue,
        removeItemFromList: removeItemFromList,
        showErrorMessage: showErrorMessage,
        getTable: getTable,
        setModalParams: setModalParams,
        getModalParams: getModalParams,
        toTitleCase: toTitleCase,
        confirm: confirm,
        prompt: prompt,
        customDialog: customDialog
    };
    var vm = this;
    vm.ModalParams;

    return service;

    function fillListWithResponseData(responseData, list) {

        for (let obj in responseData)
            list.push(responseData[obj]);

    }

    function displayNotification(type, title, body) {
        toaster.pop({
            type: type,
            title: title,
            body: body,
            timeout: 1500
        });
    }

    function preventGeneralLoading() {
        $rootScope.generalLoading = false;
    }

    function initArrayToValue(array, value, size) {
        for (let i = 0; i < size; i++)
            array.push(value);
    }

    function removeItemFromList(listItem, list) {
        let indexOfItem = list.indexOf(list);
        list.splice(indexOfItem, 1);
    }

    function showErrorMessage(type, response, customMessage, customTitle) {
        if (validateApiErrorMessageExists(response))
            displayNotification(type, response.statusText, response.data);

        else
            displayNotification(type, customTitle, customMessage);
    }

    function validateApiErrorMessageExists(response) {
        if (response.data === undefined || response.data === "")
            return false;

        return true;
    }

    function getTable(headers) {
        let table = {
            headers: headers,
            body: [],
            actions: true
        }

        return table;
    }

    function setModalParams(params) {
        vm.ModalParams = params;
    }

    function getModalParams() {
        return vm.ModalParams;
    }

    function toTitleCase(str) {<commit_msg>Actions is false in getTable<commit_after>TbUtils.$inject = ['toaster', '$rootScope', '$mdDialog'];

function TbUtils(toaster, $rootScope, $mdDialog) {
    var service = {
        fillListWithResponseData: fillListWithResponseData,
        displayNotification: displayNotification,
        preventGeneralLoading: preventGeneralLoading,
        initArrayToValue: initArrayToValue,
        removeItemFromList: removeItemFromList,
        showErrorMessage: showErrorMessage,
        getTable: getTable,
        setModalParams: setModalParams,
        getModalParams: getModalParams,
        toTitleCase: toTitleCase,
        confirm: confirm,
        prompt: prompt,
        customDialog: customDialog
    };
    var vm = this;
    vm.ModalParams;

    return service;

    function fillListWithResponseData(responseData, list) {

        for (let obj in responseData)
            list.push(responseData[obj]);

    }

    function displayNotification(type, title, body) {
        toaster.pop({
            type: type,
            title: title,
            body: body,
            timeout: 1500
        });
    }

    function preventGeneralLoading() {
        $rootScope.generalLoading = false;
    }

    function initArrayToValue(array, value, size) {
        for (let i = 0; i < size; i++)
            array.push(value);
    }

    function removeItemFromList(listItem, list) {
        let indexOfItem = list.indexOf(list);
        list.splice(indexOfItem, 1);
    }

    function showErrorMessage(type, response, customMessage, customTitle) {
        if (validateApiErrorMessageExists(response))
            displayNotification(type, response.statusText, response.data);

        else
            displayNotification(type, customTitle, customMessage);
    }

    function validateApiErrorMessageExists(response) {
        if (response.data === undefined || response.data === "")
            return false;

        return true;
    }

    function getTable(headers) {
        let table = {
            headers: headers,
            body: [],
            actions: false
        }

        return table;
    }

    function setModalParams(params) {
        vm.ModalParams = params;
    }

    function getModalParams() {
        return vm.ModalParams;
    }

    function toTitleCase(str) {
{'fraction_non_alphanumeric': 0.09074967119684349, 'fraction_numerical': 0.00263042525208242, 'mean_word_length': 2.3185454545454545, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4729806', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1177, 'n_words': 270}