# Path: compilertools/_utils.py
# def import_class(package_name, module_name, class_name, default_class):
#     """Imports a sub module by name
# 
#     Parameters
#     ----------
#     package_name : str
#         Package name in compilertools.
#     module_name : str
#         Module name in package.
#     class_name : str
#         Class name in module.
#     default_class : class
#         Default class to return if import or attribute error
# 
#     Returns
#     -------
#     class
#         Imported class."""
#     path = f"compilertools.{package_name}.{module_name}"
#     try:
#         import_module(path)
#     except ImportError:
#         return default_class
#     try:
#         return getattr(sys.modules[path], class_name)
#     except AttributeError:
#         return default_class
# 
# class BaseClass(MutableMapping):
#     """Base class for data storage classes with default values, attribute/item access
#     and memoization"""
# 
#     def __init__(self):
#         self._items = {}
#         self._default = {}
# 
#     @staticmethod
#     def _memoized_property(class_property):
#         """Property decorator with memoization"""
# 
#         @property
#         @wraps(class_property)
#         def _property(self):
#             key = class_property.__name__
# 
#             try:
#                 return self._items.__getitem__(key)
#             except KeyError:
#                 pass
# 
#             value = class_property(self)
# 
#             if value is None:
#                 try:
#                     value = self._default.__getitem__(key)
#                 except KeyError:
#                     pass
# 
#             self._items[key] = value
#             return value
# 
#         return _property
# 
#     def __getitem__(self, key):
#         try:
#             return self._items.__getitem__(key)
#         except KeyError:
#             pass
# 
#         if hasattr(self, key):
#             return getattr(self, key)
# 
#         return self._default.__getitem__(key)
# 
#     def __getattr__(self, name):
#         try:
#             return self._items.__getitem__(name)
#         except KeyError:
#             pass
# 
#         try:
#             return self._default.__getitem__(name)
#         except KeyError:
#             raise AttributeError
# 
#     def __setitem__(self, key, value):
#         return self._items.__setitem__(key, value)
# 
#     def __delitem__(self, key):
#         return self._items.__delitem__(key)
# 
#     def __len__(self):
#         return self._items.__len__()
# 
#     def __iter__(self):
#         return self._items.__iter__()
# 
# Path: compilertools/_config.py
# CONFIG = {
#     # Architectures, Key is name or alias, Value is name to use
#     "architectures": {
#         # ARM 32bits
#         "arm": "arm_32",
#         # ARM 64bits
#         "arm64": "arm_64",
#         # x86 32bits
#         "x86_32": "x86_32",
#         "x86": "x86_32",
#         "i386": "x86_32",
#         "i686": "x86_32",
#         "ia32": "x86_32",
#         "win32": "x86_32",
#         # x86 64bits
#         "x86_64": "x86_64",
#         "x86-64": "x86_64",
#         "amd64": "x86_64",
#         "em64t": "x86_64",
#         "x64": "x86_64",
#     },
#     # Compilers, Key is name or alias, Value is name to use
#     "compilers": {
#         # Unix unspecified compiler
#         "unix": "unix",
#         "cc": "unix",
#         "c++": "unix",
#         # GNU Compiler Collection
#         "gcc": "gcc",
#         "g++": "gcc",
#         "gfortran": "gcc",
#         "gnu fortran": "gcc",
#         "mingw32": "gcc",
#         "cygwin": "gcc",
#         # LLVM
#         "clang": "llvm",
#         "clang++": "llvm",
#         "flang": "llvm",
#         # Microsoft Visual C
#         "msvc": "msvc",
#     },
#     # Logging: If False, don't log exceptions on stdout
#     "logging": True,
# }


from platform import machine
from compilertools._utils import import_class, BaseClass
from compilertools._config import CONFIG
            arch = name

    arch = arch_dict.get(arch, arch)

    return arch


def get_processor(arch, *args, **kwargs):
    """Return processor class

    Parameters
    ----------
    arch : str or None
        processor architecture
    args, kwargs
        args for class instantiation

    Returns
    -------
    ProcessorBase subclass instance
        Processor class instance."""
    return import_class("processors", get_arch(arch), "Processor", ProcessorBase)(
        *args, **kwargs
    )


class ProcessorBase(BaseClass):
    """Base class for CPU"""

    def __init__(self, current_machine=False):

# Path: compilertools/_utils.py
# def import_class(package_name, module_name, class_name, default_class):
#     """Imports a sub module by name
# 
#     Parameters
#     ----------
#     package_name : str
#         Package name in compilertools.
#     module_name : str
#         Module name in package.
#     class_name : str
#         Class name in module.
#     default_class : class
#         Default class to return if import or attribute error
# 
#     Returns
#     -------
#     class
#         Imported class."""
#     path = f"compilertools.{package_name}.{module_name}"
#     try:
#         import_module(path)
#     except ImportError:
#         return default_class
#     try:
#         return getattr(sys.modules[path], class_name)
#     except AttributeError:
#         return default_class
# 
# class BaseClass(MutableMapping):
#     """Base class for data storage classes with default values, attribute/item access
#     and memoization"""
# 
#     def __init__(self):
#         self._items = {}
#         self._default = {}
# 
#     @staticmethod
#     def _memoized_property(class_property):
#         """Property decorator with memoization"""
# 
#         @property
#         @wraps(class_property)
#         def _property(self):
#             key = class_property.__name__
# 
#             try:
#                 return self._items.__getitem__(key)
#             except KeyError:
#                 pass
# 
#             value = class_property(self)
# 
#             if value is None:
#                 try:
#                     value = self._default.__getitem__(key)
#                 except KeyError:
#                     pass
# 
#             self._items[key] = value
#             return value
# 
#         return _property
# 
#     def __getitem__(self, key):
#         try:
#             return self._items.__getitem__(key)
#         except KeyError:
#             pass
# 
#         if hasattr(self, key):
#             return getattr(self, key)
# 
#         return self._default.__getitem__(key)
# 
#     def __getattr__(self, name):
#         try:
#             return self._items.__getitem__(name)
#         except KeyError:
#             pass
# 
#         try:
#             return self._default.__getitem__(name)
#         except KeyError:
#             raise AttributeError
# 
#     def __setitem__(self, key, value):
#         return self._items.__setitem__(key, value)
# 
#     def __delitem__(self, key):
#         return self._items.__delitem__(key)
# 
#     def __len__(self):
#         return self._items.__len__()
# 
#     def __iter__(self):
#         return self._items.__iter__()
# 
# Path: compilertools/_config.py
# CONFIG = {
#     # Architectures, Key is name or alias, Value is name to use
#     "architectures": {
#         # ARM 32bits
#         "arm": "arm_32",
#         # ARM 64bits
#         "arm64": "arm_64",
#         # x86 32bits
#         "x86_32": "x86_32",
#         "x86": "x86_32",
#         "i386": "x86_32",
#         "i686": "x86_32",
#         "ia32": "x86_32",
#         "win32": "x86_32",
#         # x86 64bits
#         "x86_64": "x86_64",
#         "x86-64": "x86_64",
#         "amd64": "x86_64",
#         "em64t": "x86_64",
#         "x64": "x86_64",
#     },
#     # Compilers, Key is name or alias, Value is name to use
#     "compilers": {
#         # Unix unspecified compiler
#         "unix": "unix",
#         "cc": "unix",
#         "c++": "unix",
#         # GNU Compiler Collection
#         "gcc": "gcc",
#         "g++": "gcc",
#         "gfortran": "gcc",
#         "gnu fortran": "gcc",
#         "mingw32": "gcc",
#         "cygwin": "gcc",
#         # LLVM
#         "clang": "llvm",
#         "clang++": "llvm",
#         "flang": "llvm",
#         # Microsoft Visual C
#         "msvc": "msvc",
#     },
#     # Logging: If False, don't log exceptions on stdout
#     "logging": True,
# }


# Path: compilertools/processors/_core.py
from platform import machine
from compilertools._utils import import_class, BaseClass
from compilertools._config import CONFIG

            arch = name

    arch = arch_dict.get(arch, arch)

    return arch


def get_processor(arch, *args, **kwargs):
    """Return processor class

    Parameters
    ----------
    arch : str or None
        processor architecture
    args, kwargs
        args for class instantiation

    Returns
    -------
    ProcessorBase subclass instance
        Processor class instance."""
    return import_class("processors", get_arch(arch), "Processor", ProcessorBase)(
        *args, **kwargs
    )


class ProcessorBase(BaseClass):
    """Base class for CPU"""

    def __init__(self, current_machine=False):

        BaseClass.__init__(self)