def METHOD_NAME(name: str, path: t.Optional[t.List[str]] = None) -> types.ModuleType:
    """
    Derived from `import_from_dotted_path`:
    https://chase-seibert.github.io/blog/2014/04/23/python-imp-examples.html
    import_from_dotted_path('foo.bar') -> from foo import bar; return bar
    """
    try:
        next_module, remaining_names = name.split(".", 1)
    except ValueError:
        next_module = name
        remaining_names = None
    fp, pathname, description = imp.find_module(next_module, path)
    module = imp.load_module(next_module, fp, pathname, description)  # type: ignore[arg-type]
    if remaining_names is None:
        return module
    if hasattr(module, remaining_names):
        return getattr(module, remaining_names)
    else:
        return METHOD_NAME(remaining_names, path=list(module.__path__))