def check_installed_node_packs(node_packs):
    """Raise error if issues are found in installed node packs."""
    ### try importing each installed node pack while
    ### filling a map associating the node pack name with
    ### its path in the system

    node_pack_path_map = {}

    for name in node_packs:

        try:
            node_pack_module = import_module(name)

        except ModuleNotFoundError:

            raise NodePackNotImportedError(
                f"the '{name}' node pack,"
                " expected to be installed, could not be imported"
            )

        else:
            node_pack_path_map[name] = Path(node_pack_module.__path__[0])

    ### check whether each node pack has at least
    ### one script

    for name, node_pack in node_pack_path_map.items():

        category_folders = [
            path
            for path in node_pack.iterdir()
            if path.is_dir()
            if not path.name.startswith(".")
            if not path.name == "__pycache__"
        ]

        if not category_folders:

            raise NodePackLackingCategoryError(
                f"installed node pack '{name}' must have at least 1 category",
                name,
            )

        for category_folder in category_folders:

            script_dirs = [
                path
                for path in category_folder.iterdir()
                if path.is_dir()
                if not path.name.startswith(".")
                if not path.name == "__pycache__"
            ]

            if not script_dirs:

                raise CategoryLackingScriptDirectoryError(
                    (
                        f"category dir '{category_folder.name}'"
                        f" from installed node pack '{name}' "
                        "must have at least 1 script directory"
                    ),
                    name,
                )

            for script_dir in script_dirs:

                script_file = script_dir / NODE_SCRIPT_NAME

                if not script_file.is_file():

                    raise ScriptDirectoryLackingScriptError(
                        name,
                        category_folder,
                        script_dir,
                        script_file,
                    )
Raise error if issues are found in installed node packs.
nodezator/graphman/nodepacksissues.py