import importlib


def importify(module: str, key: str) -> object:
    """Lazily loads object from 'module'.

    Args:
        module (str): name of module holding object that is sought.
        key (str): name of object sought.

    Raises:
        ImportError: if 'key' is not found in 'module'.

    Returns:
        object: class, function, or variable in 'module'.
        
    """
    try:
        return getattr(importlib.import_module(module), key)
    except (ImportError, AttributeError):
        raise ImportError(f'failed to load {key} in {module}')