def METHOD_NAME(room_id, candidates, occurrences, allow_admin):
    conflicts = set()
    conflicting_candidates = set()
    for candidate in candidates:
        for occurrence in occurrences:
            blocking = occurrence.blocking
            if blocking.start_date <= candidate.start_dt.date() <= blocking.end_date:
                if blocking.can_override(session.user, room=Room.get(room_id), allow_admin=allow_admin):
                    continue
                conflicting_candidates.add(candidate)
                obj = TempReservationOccurrence(candidate.start_dt, candidate.end_dt, None)
                conflicts.add(obj)
    return conflicts, conflicting_candidates