def METHOD_NAME(cls, mod_path: str, package: str = None) -> ModuleType:
    """Load a module by its absolute path.
    Args:
        mod_path: the absolute or relative module path
        package: the parent package to search for the module
    Returns:
        The resolved module or `None` if the module cannot be found
    Raises:
        ModuleLoadError: If there was an error loading the module
    """
    if package:
        # preload parent package
        if not cls.METHOD_NAME(package):
            return None
        # must treat as a relative import
        if not mod_path.startswith("."):
            mod_path = f".{mod_path}"
    full_path = resolve_name(mod_path, package)
    if full_path in sys.modules:
        return sys.modules[full_path]
    if "." in mod_path:
        parent_mod_path, mod_name = mod_path.rsplit(".", 1)
        if parent_mod_path and parent_mod_path[-1] != ".":
            parent_mod = cls.METHOD_NAME(parent_mod_path, package)
            if not parent_mod:
                return None
            package = parent_mod.__name__
            mod_path = f".{mod_name}"
    # Load the module spec first
    # this means that a later ModuleNotFoundError indicates a code issue
    spec = find_spec(mod_path, package)
    if not spec:
        return None
    try:
        return import_module(mod_path, package)
    except ModuleNotFoundError as e:
        raise ModuleLoadError(
            f"Unable to import module {full_path}: {str(e)}"
        ) from e