import importlib


def _get_module_attr(module_name, attribute_name):
    """Import a module and get an attribute from it.

    Args:
        module_name (str): The module name.
        attribute_name (str): The attribute name.

    Returns:
        Any: The attribute.

    Raises:
        ModuleNotFoundError: The module could not be imported.
        AttributeError: The attribute could not be found in the module.
    """
    module = importlib.import_module(module_name)
    attribute = getattr(module, attribute_name)
    return attribute