import types
import importlib


def _import_module(path: str, /) -> types.ModuleType:
    """Import a module from a provided path."""
    package, _, module_name = path.rpartition(".")

    return importlib.import_module(name=module_name, package=package)