def clear_all_sessions():
	frappe.only_for("Administrator")
	for sid in frappe.db.sql_list("select sid from `tabSessions`"):
		delete_session(sid)
This effectively logs out all users
dataset/ETHPy150Open frappe/frappe/frappe/sessions.py/clear_all_sessions