code: def shutdown_notebook(request, username):
      
  
      manager = get_notebook_manager(request)
      if manager.is_running(username):
          manager.stop_notebook(username)
docs: Stop any running notebook for a user.