code: def verify_all(module: str | ModuleType, ALL: Sequence[str]) -> type:
      """ """
  
      class Test___all__:
          _module: ModuleType | None = None
  
          @property
          def module(self) -> ModuleType:
              if self._module is None:
                  if isinstance(module, str):
                      self._module = importlib.import_module(module)
                  else:
                      self._module = module
              return self._module
  
          def test___all__(self) -> None:
              __all__: Sequence[str] | None = getattr(
                  self.module, "__all__", None
              )
  
              assert (
                  __all__ is not None
              ), f"module {self.module.__name__} doesn't define __all__"
              assert (
                  __all__ == ALL
              ), f"for module {self.module.__name__}, expected: {set(ALL) - set(__all__)!r}, actual: {set(__all__) - set(ALL)!r}"
  
          @pytest.mark.parametrize("name", ALL)
          def test_contents(self, name: str) -> None:
              assert hasattr(self.module, name)
  
      return Test___all__
  
imports: from __future__ import annotations
  import logging
  import importlib
  from types import ModuleType
  from typing import Sequence
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: verify_all(module, ALL) and returns: Test___all__, self