Given a dotted path, returns the class

def load_class_by_name(name: str):
    """Given a dotted path, returns the class"""
    mod_path, _, cls_name = name.rpartition('.')
    mod = importlib.import_module(mod_path)
    cls = getattr(mod, cls_name)
    return cls