# Path: temci/utils/util.py
# def recursive_exec_for_leafs(data: dict, func, _path_prep = []):
# def has_root_privileges() -> bool:
# def has_pdflatex() -> bool:
# def does_command_succeed(cmd: str) -> bool:
# def warn_for_pdflatex_non_existence_once(_warned = [False]):
# def get_cache_line_size(cache_level: int = None) -> t.Optional[int]:
# def get_memory_page_size() -> int:
# def get_distribution_name() -> str:
# def get_distribution_release() -> str:
# def does_program_exist(program: str) -> bool:
# def on_apple_os() -> bool:
#     def __enter__(self):
#         def try_wait(self, wait_flags):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# def join_strs(strs: t.List[str], last_word: str = "and") -> str:
# def can_import(module: str) -> bool:
# def sphinx_doc() -> bool:
# def get_doc_for_type_scheme(type_scheme: 'Type') -> str:
# def document(**kwargs: t.Dict[str, str]):
#     def dec(klass):
#     def __call__(cls, *args, **kwargs):
#     def __init__(self):
#     def __delitem__(self, key):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __iter__(self):
#     def values(self) -> t.List:
#     def keys(self) -> t.List:
#     def __len__(self):
#     def items(self) -> t.List[t.Tuple[t.Any, t.Any]]:
#     def from_list(cls, items: t.Optional[list], key_func: t.Callable[[t.Any], t.Any]) -> 'InsertionTimeOrderedDict':
# def geom_std(values: t.List[float]) -> float:
# def parse_timespan(time: str) -> float:
# def rusage_header() -> str:
# class proc_wait_with_rusage:
# class Singleton(type):
# class InsertionTimeOrderedDict:


import enum
import functools
import subprocess
import typing as t
        import multiprocessing
        import psutil
        import platform
from temci.utils import util

        return fmt.format(pval) + ["", "k", "M", "G", "T", "P"][exponents] + self.suffix()

    def suffix(self) -> str:
        return {self.IB: "iB", self.HZ: "Hz", self.NORMAL: ""}[self]


def format_nt(nt: t.NamedTuple, **units: Unit) -> t.List[t.Tuple[str, str]]:
    """
    Format the passed named tuple, some of its properties might have
    associated units
    """
    ret = []
    for i, f in enumerate(nt._fields):
        val = nt[i]
        if f in units:
            val = units[f].format(val)
        ret.append([f, str(val)])
    return ret


class CpuInfo(t.NamedTuple):

    cpu: str
    cores: int
    threads: int

    @staticmethod
    @functools.lru_cache(1)
    def create() -> 'CpuInfo':

# Path: temci/utils/util.py
# def recursive_exec_for_leafs(data: dict, func, _path_prep = []):
# def has_root_privileges() -> bool:
# def has_pdflatex() -> bool:
# def does_command_succeed(cmd: str) -> bool:
# def warn_for_pdflatex_non_existence_once(_warned = [False]):
# def get_cache_line_size(cache_level: int = None) -> t.Optional[int]:
# def get_memory_page_size() -> int:
# def get_distribution_name() -> str:
# def get_distribution_release() -> str:
# def does_program_exist(program: str) -> bool:
# def on_apple_os() -> bool:
#     def __enter__(self):
#         def try_wait(self, wait_flags):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# def join_strs(strs: t.List[str], last_word: str = "and") -> str:
# def can_import(module: str) -> bool:
# def sphinx_doc() -> bool:
# def get_doc_for_type_scheme(type_scheme: 'Type') -> str:
# def document(**kwargs: t.Dict[str, str]):
#     def dec(klass):
#     def __call__(cls, *args, **kwargs):
#     def __init__(self):
#     def __delitem__(self, key):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __iter__(self):
#     def values(self) -> t.List:
#     def keys(self) -> t.List:
#     def __len__(self):
#     def items(self) -> t.List[t.Tuple[t.Any, t.Any]]:
#     def from_list(cls, items: t.Optional[list], key_func: t.Callable[[t.Any], t.Any]) -> 'InsertionTimeOrderedDict':
# def geom_std(values: t.List[float]) -> float:
# def parse_timespan(time: str) -> float:
# def rusage_header() -> str:
# class proc_wait_with_rusage:
# class Singleton(type):
# class InsertionTimeOrderedDict:


# Path: temci/utils/envinfo.py
import enum
import functools
import subprocess
import typing as t
        import multiprocessing
        import psutil
        import platform
from temci.utils import util


        return fmt.format(pval) + ["", "k", "M", "G", "T", "P"][exponents] + self.suffix()

    def suffix(self) -> str:
        return {self.IB: "iB", self.HZ: "Hz", self.NORMAL: ""}[self]


def format_nt(nt: t.NamedTuple, **units: Unit) -> t.List[t.Tuple[str, str]]:
    """
    Format the passed named tuple, some of its properties might have
    associated units
    """
    ret = []
    for i, f in enumerate(nt._fields):
        val = nt[i]
        if f in units:
            val = units[f].format(val)
        ret.append([f, str(val)])
    return ret


class CpuInfo(t.NamedTuple):

    cpu: str
    cores: int
    threads: int

    @staticmethod
    @functools.lru_cache(1)
    def create() -> 'CpuInfo':

        if util.on_apple_os():