def sign_out_other_sessions(user, request):
    count = 0
    active_sessions = get_active_sessions(user=user, request=request)
    for session_info in active_sessions:
        if not session_info.is_current:
            session_info.session.flush()
            count += 1
    return count
Deactivate all user's sessions that do not belong to
dataset/ETHPy150Open nigma/django-session-activity/session_activity/activity.py/sign_out_other_sessions