import importlib


def find_class_using_name(module_name, class_name, suffix='', type=object):
    """Import the module

    In the file, the class called ClassNameFuffix() will
    be instantiated. It has to be a subclass of type,
    and it is case-insensitive.
    """
    filename = module_name
    lib = importlib.import_module(filename)
    target = None
    target_class_name = class_name.replace('_', '') + suffix
    for name, cls in lib.__dict__.items():
        if name.lower() == target_class_name.lower() \
           and issubclass(cls, type):
            target = cls

    if target is None:
        print(f"In {filename}.py, there should be a subclass of {type} with class name that matches {target_class_name} in lowercase.")
        exit(0)

    return target