def filter_presence_idle_user_ids(user_ids: Set[int]) -> List[int]:
    if (not user_ids):
        return []
    OFFLINE_THRESHOLD_SECS = 140
    recent = (timezone_now() - datetime.timedelta(seconds=OFFLINE_THRESHOLD_SECS))
    rows = UserPresence.objects.filter(user_profile_id__in=user_ids, status=UserPresence.ACTIVE, timestamp__gte=recent).exclude(client__name='ZulipMobile').distinct('user_profile_id').values('user_profile_id')
    active_user_ids = {row['user_profile_id'] for row in rows}
    idle_user_ids = (user_ids - active_user_ids)
    return sorted(list(idle_user_ids))
def filter_presence_idle_user_ids(user_ids: Set[int]) -> List[int]:
    if (not user_ids):
        return []
    OFFLINE_THRESHOLD_SECS = 140
    recent = (timezone_now() - datetime.timedelta(seconds=OFFLINE_THRESHOLD_SECS))
    rows = UserPresence.objects.filter(user_profile_id__in=user_ids, status=UserPresence.ACTIVE, timestamp__gte=recent).exclude(client__name='ZulipMobile').distinct('user_profile_id').values('user_profile_id')
    active_user_ids = {row['user_profile_id'] for row in rows}
    idle_user_ids = (user_ids - active_user_ids)
    return sorted(list(idle_user_ids))