def METHOD_NAME(module, class_name):
    """Returns the class from the given module, importing it if necessary"""
    if not sys.modules.get(module):
        parts = module.split(".")
        importlib.import_module(f".{parts[-1]}", ".".join(parts[0:-1]))
    return getattr(sys.modules[module], class_name)