---------------------------------------------------------------------- This is the API documentation for the gdtest_sphinx_mixed_roles library. ---------------------------------------------------------------------- ## Classes Main classes provided by the package Registry(strict: bool = False) A registry that maps names to types. Use :py:func:`register` to add entries, or call :py:meth:`Registry.get` directly. Parameters ---------- strict If True, raises :py:exc:`KeyError` on missing lookups. ## Functions Utility functions lookup(name: str) -> type Look up a type in the default :py:class:`Registry`. Delegates to :py:meth:`Registry.get`. May raise :py:exc:`KeyError` in strict mode. Parameters ---------- name The name to look up. Returns ------- type The registered type. register(name: str, cls: type) -> None Register a type in the default :py:class:`Registry`. Calls :py:meth:`Registry.add` on the default instance. Parameters ---------- name The name to register under. cls The type to register. validate_entry(entry: dict) -> bool Validate a registry entry dict. An entry must have ``"name"`` and ``"cls"`` keys. The ``"cls"`` value should be passable to :py:func:`register`. If invalid, raises :py:exc:`ValueError`. Checks :py:attr:`Registry.strict` on the default registry to determine validation level. Parameters ---------- entry A dict with ``"name"`` and ``"cls"`` keys. Returns ------- bool True if the entry is valid. Raises ------ ValueError If the entry dict is missing required keys.