def METHOD_NAME(user):
    """Returns query filter for published projects accessible by a specified user through events"""
    events_all = Event.objects.filter(Q(host=user) | Q(participants__user=user))
    active_events = set(events_all.filter(end_date__gte=datetime.now()))
    accessible_datasets = EventDataset.objects.filter(event__in=active_events, is_active=True)
    accessible_projects_ids = []
    for event_dataset in accessible_datasets:
        if has_access_to_event_dataset(user, event_dataset):
            accessible_projects_ids.append(event_dataset.dataset.id)
    query = Q(id__in=accessible_projects_ids)
    return query