def METHOD_NAME(self, model: QAbstractItemModel, source_type: type):  # pylint: disable=R0201, no-self-use
    """
    The Delegate may belong to a view using a ProxyModel. However,
    the source model for that Proxy Model(s) should be a QFileSystemLibraryModel
    and is returned by this function
    Args:
        model(QAbstractItemModel): Current model
        source_type(type): Expected source model type
    Returns:
        QFileSystemLibraryModel: Source model
    Raises:
        QLibraryGUIException: If unable to find the source model for the given model
    """
    while True:
        # https://stackoverflow.com/questions/50478661/python-isinstance-not-working-as-id-expect
        if model.__class__.__name__ == source_type.__name__:
            return model
        if isinstance(model, QAbstractProxyModel):
            model = model.sourceModel()
        else:
            raise QLibraryGUIException(
                f"Unable to find source model: "
                f"\n Expected Type is:"
                f"\n{source_type}"
                f"\n First non-proxy model type found is"
                f"\n{type(model)} for"
                f"\n{model}")