<commit_before>import os, subprocess, sys
import pkg_resources

try:
    from packaging import version
    has_packaging = True
except:
    has_packaging = False


# This function is used to check if an apt package is installed on Raspbian, Ubuntu, Debian, etc.
def apt_package_installed(package_name: str) -> bool:
    devnull = open(os.devnull,"w")
    retval = subprocess.call(["dpkg", "-s", package_name],stdout=devnull,stderr=subprocess.STDOUT)
    devnull.close()
    if retval != 0:
        return False
    return True


# This is just a means to check if apt (dpkg) is installed at all
def has_apt() -> bool:
    try:
        devnull = open(os.devnull,"w")
        retval = subprocess.call(["dpkg", "--version"],stdout=devnull,stderr=subprocess.STDOUT)
        devnull.close()
        if retval != 0:
            return False
        return True
    except:
        # dpkg doesn't exist
        return False


def check_apt_packages() -> (bool, list):
    package_list = ["bluez", "libcap2-bin", "libbluetooth3", "libbluetooth-dev", "redis-server", "python3-dev"]
    test_results = []
    all_packages_ok = True

    for package in package_list:
        result = {'package': package, 'result': True}
        if apt_package_installed(package):
            result['result'] = True
        else:
            result ['result'] = False
            all_packages_ok = False
        test_results.append(result)
<commit_msg>Remove python3-dev from tested package list (Closes #479)<commit_after>import os, subprocess, sys
import pkg_resources

try:
    from packaging import version
    has_packaging = True
except:
    has_packaging = False


# This function is used to check if an apt package is installed on Raspbian, Ubuntu, Debian, etc.
def apt_package_installed(package_name: str) -> bool:
    devnull = open(os.devnull,"w")
    retval = subprocess.call(["dpkg", "-s", package_name],stdout=devnull,stderr=subprocess.STDOUT)
    devnull.close()
    if retval != 0:
        return False
    return True


# This is just a means to check if apt (dpkg) is installed at all
def has_apt() -> bool:
    try:
        devnull = open(os.devnull,"w")
        retval = subprocess.call(["dpkg", "--version"],stdout=devnull,stderr=subprocess.STDOUT)
        devnull.close()
        if retval != 0:
            return False
        return True
    except:
        # dpkg doesn't exist
        return False


def check_apt_packages() -> (bool, list):
    package_list = ["bluez", "libcap2-bin", "libbluetooth3", "libbluetooth-dev", "redis-server"]
    test_results = []
    all_packages_ok = True

    for package in package_list:
        result = {'package': package, 'result': True}
        if apt_package_installed(package):
            result['result'] = True
        else:
            result ['result'] = False
            all_packages_ok = False
        test_results.append(result)

{'fraction_non_alphanumeric': 0.11045501910385551, 'fraction_numerical': 0.0045154567558179926, 'mean_word_length': 2.8348868175765647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5971503', 'n_tokens_mistral': 887, 'n_tokens_neox': 855, 'n_words': 250}