from typing import Type
import importlib
from typing import cast


def _import_class(path: str, /) -> Type:
    """Import a class from a provided path."""
    module_path, _, class_name = path.rpartition(".")
    package, _, module_name = module_path.rpartition(".")
    module = importlib.import_module(name=module_name, package=package)

    return cast(Type, getattr(module, class_name))