import importlib
import inspect


def get_class_name(module_name: str, module_path: str) -> str:
    """Retrieves the correct class name of a module"""

    # Import the module
    module = importlib.import_module(module_name, module_path)

    for class_name, _ in inspect.getmembers(module, inspect.isclass):
        if class_name.lower() == module_name.lower():
            return class_name

    raise ModuleNotFoundError(
        f"Couldnt find corresponding class {module_name} in {module_path}."
    )