def METHOD_NAME(event):
    from indico.modules.events.surveys.models.surveys import Survey
    private_criterion = ~Survey.private
    if session.user:
        user_pending_criterion = ~SurveySubmission.is_submitted & (SurveySubmission.user == session.user)
        private_criterion |= Survey.submissions.any(user_pending_criterion)
    return (Survey.query.with_parent(event)
            .filter(Survey.is_active, private_criterion)
            .order_by(db.func.lower(Survey.title)))