def METHOD_NAME(class_path):
    module_name, class_name = class_path.rsplit(".", 1)
    try:
        module_ = importlib.import_module(module_name)
        try:
            class_ = getattr(module_, class_name)
        except AttributeError:
            raise ValueError("Class {} does not exist".format(class_path))
    except AttributeError:
        raise ValueError("Module {} does not exist".format(class_path))
    return class_