<commit_before>class PolymerUtils {

    static isUndefined(obj) {
        return typeof obj === "undefined";
    }

    static isNotUndefined(obj) {
        return typeof obj !== "undefined";
    }

    static isNull(obj) {
        return obj === null;
    }

    static isNotNull(obj) {
        return obj !== null;
    }

    static isUndefinedOrNull(obj) {
        return typeof obj === "undefined" || obj === null;
    }

    static isNotUndefinedOrNull(obj) {
        return typeof obj !== "undefined" && obj !== null;
    }


    static isEmpty(str) {
        return typeof str === "undefined" || str === null || str === "";
    }

    static isNotEmpty(str) {
        return typeof str !== "undefined" && str !== null && str !== "";
    }

    static isEmptyArray(arr) {
        return typeof arr !== "undefined" && arr !== null && arr.length === 0;
    }

    static isNotEmptyArray(arr) {
        return typeof arr !== "undefined" && arr !== null && arr.length > 0;
    }

    static isNotEmptyValueById(id) {
        let value = PolymerUtils.getValue(id);
        return typeof value !== "undefined" && value !== null && value !== "";
    }


    static getValue(id) {
        return PolymerUtils.getPropertyById(id, "value");
    }

    static setValue(id, value) {
        return PolymerUtils.setPropertyById(id, "value", value);

    }


    static getElementById(id) {
        return document.getElementById(id);
    }

    static getElementsByClassName(className, element) {
        if (PolymerUtils.isUndefined(element)) {
            return document.getElementsByClassName(className);
        } else {
            // If element is a string we do first a getElementById, if it exist we execute the query
            if (typeof element === "string") {
                let elem = PolymerUtils.getElementById(element);
                if (elem !== undefined) {
                    return element.getElementsByClassName(className);
                } else {
                    // The given element id does not exist
                    return undefined;
                }
            } else {
                // Element exists and it is not a string, it must be a object
                return element.getElementsByClassName(className);
            }
        }
    }

    static querySelector(selectors, element) {
        if (PolymerUtils.isUndefinedOrNull(element)) {
            return document.querySelector(selectors);
        } else {
            // If element is a string we do first a getElementById, if it exist we execute the query
            if (typeof element === "string") {
                let elem = PolymerUtils.getElementById(element);
                if (elem !== undefined) {
                    return elem.querySelector(selectors);
                } else {
                    // The given element id does not exist
                    return undefined;
                }
            } else {
                // Element exists and it is not a string, it must be a object
                return element.querySelector(selectors);
            }
        }
    }

    static querySelectorAll(selectors, element) {
        if (PolymerUtils.isUndefinedOrNull(element)) {
            return document.querySelectorAll(selectors);
        } else {
            // If element is a string we do first a getElementById, if it exist we execute the query
            if (typeof element === "string") {
                let elem = PolymerUtils.getElementById(element);
                if (elem !== undefined) {
                    return elem.querySelectorAll(selectors);
                } else {
                    // The given element id does not exist
                    return undefined;
                }
            } else {
                // Element exists and it is not a string, it must be a object
                return element.querySelectorAll(selectors);<commit_msg>lib: check object is different from null in PolymerUtils<commit_after>class PolymerUtils {

    static isUndefined(obj) {
        return typeof obj === "undefined";
    }

    static isNotUndefined(obj) {
        return typeof obj !== "undefined";
    }

    static isNull(obj) {
        return obj === null;
    }

    static isNotNull(obj) {
        return obj !== null;
    }

    static isUndefinedOrNull(obj) {
        return typeof obj === "undefined" || obj === null;
    }

    static isNotUndefinedOrNull(obj) {
        return typeof obj !== "undefined" && obj !== null;
    }


    static isEmpty(str) {
        return typeof str === "undefined" || str === null || str === "";
    }

    static isNotEmpty(str) {
        return typeof str !== "undefined" && str !== null && str !== "";
    }

    static isEmptyArray(arr) {
        return typeof arr !== "undefined" && arr !== null && arr.length === 0;
    }

    static isNotEmptyArray(arr) {
        return typeof arr !== "undefined" && arr !== null && arr.length > 0;
    }

    static isNotEmptyValueById(id) {
        let value = PolymerUtils.getValue(id);
        return typeof value !== "undefined" && value !== null && value !== "";
    }


    static getValue(id) {
        return PolymerUtils.getPropertyById(id, "value");
    }

    static setValue(id, value) {
        return PolymerUtils.setPropertyById(id, "value", value);

    }


    static getElementById(id) {
        return document.getElementById(id);
    }

    static getElementsByClassName(className, element) {
        if (PolymerUtils.isUndefined(element)) {
            return document.getElementsByClassName(className);
        } else {
            // If element is a string we do first a getElementById, if it exist we execute the query
            if (typeof element === "string") {
                let elem = PolymerUtils.getElementById(element);
                if (elem !== undefined && elem !== null) {
                    return element.getElementsByClassName(className);
                } else {
                    // The given element id does not exist
                    return undefined;
                }
            } else {
                // Element exists and it is not a string, it must be a object
                return element.getElementsByClassName(className);
            }
        }
    }

    static querySelector(selectors, element) {
        if (PolymerUtils.isUndefinedOrNull(element)) {
            return document.querySelector(selectors);
        } else {
            // If element is a string we do first a getElementById, if it exist we execute the query
            if (typeof element === "string") {
                let elem = PolymerUtils.getElementById(element);
                if (elem !== undefined && elem !== null) {
                    return elem.querySelector(selectors);
                } else {
                    // The given element id does not exist
                    return undefined;
                }
            } else {
                // Element exists and it is not a string, it must be a object
                return element.querySelector(selectors);
            }
        }
    }

    static querySelectorAll(selectors, element) {
        if (PolymerUtils.isUndefinedOrNull(element)) {
            return document.querySelectorAll(selectors);
        } else {
            // If element is a string we do first a getElementById, if it exist we execute the query
            if (typeof element === "string") {
                let elem = PolymerUtils.getElementById(element);
                if (elem !== undefined && elem !== null) {
                    return elem.querySelectorAll(selectors);
                } else {
                    // The given element id does not exist
                    return undefined;
                }
            } else {
                // Element exists and it is not a string, it must be a object
                return element.querySelectorAll(selectors);
{'fraction_non_alphanumeric': 0.1008616320324379, 'fraction_numerical': 0.0005068423720223011, 'mean_word_length': 1.7377731529656608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3731569', 'n_tokens_mistral': 1982, 'n_tokens_neox': 1880, 'n_words': 603}