from typing import Any
import importlib


def dynamic_import_class(module_name: str, class_name: str) -> Any:
    """
    Dynamically imports a class from a given module

    Args:
        module_name (str): the module to dynamically load
        class_name (str): the class to dynamically load

    Returns:
        Any: the class from the module specified
    """
    dclass = None
    module = None

    # assert module existss
    try:
        module = importlib.import_module(module_name)
    except ImportError:
        print("module not found: " + module_name)

    # load class from module
    try:
        dclass = getattr(module, class_name)
    except Exception as e:
        print(e)

    return dclass