def METHOD_NAME(queryset, name, training):
    if training is None:
        return queryset
    else:
        return queryset.filter(
            task__role__name="learner", task__event=training
        ).distinct()