Import an attribute from a module located in a package.
This utility function is used in custom __getattr__ methods within __init__.py
files to dynamically import attributes.
The name of the attribute to import.
The name of the module to import from.
If None, the attribute is imported from the package itself.
The name of the package where the module is located.