run ruff via pre-commit

This commit is contained in:
Min RK
2024-03-11 09:39:10 +01:00
parent 25da2c2ad3
commit 52af3abedc
22 changed files with 59 additions and 87 deletions

View File

@@ -254,14 +254,15 @@
}
],
"source": [
"from IPython.display import display, HTML\n",
"from IPython.display import HTML, display\n",
"\n",
"full_accept_url = f\"{hub_host}{code_info['accept_url']}\"\n",
"\n",
"display(\n",
" HTML(f\"\"\"\n",
" <a href='{full_accept_url}'>share this link to grant access</a>\n",
" \"\"\")\n",
")\n"
")"
]
},
{
@@ -347,7 +348,9 @@
"from urllib.parse import urlencode\n",
"\n",
"this_notebook_url = server_base_url + \"lab/tree/share-api.ipynb\"\n",
"this_notebook_accept_url = full_accept_url + \"&\" + urlencode({\"next\": this_notebook_url})\n",
"this_notebook_accept_url = (\n",
" full_accept_url + \"&\" + urlencode({\"next\": this_notebook_url})\n",
")\n",
"print(this_notebook_accept_url)\n",
"\n",
"display(\n",
@@ -355,7 +358,7 @@
" share <a href='{this_notebook_accept_url}'>this link</a>\n",
" to grant access and direct users to this notebook\n",
" \"\"\")\n",
")\n"
")"
]
},
{
@@ -488,16 +491,16 @@
"import json\n",
"\n",
"options = {\n",
" \"scopes\": [\n",
" f\"access:servers!server={user_server}\", # access the server (default)\n",
" f\"servers!server={user_server}\", # start/stop the server\n",
" f\"shares!server={user_server}\", # further share the server with others\n",
" ],\n",
" \"expires_in\": 3600, # code expires in one hour\n",
" \"scopes\": [\n",
" f\"access:servers!server={user_server}\", # access the server (default)\n",
" f\"servers!server={user_server}\", # start/stop the server\n",
" f\"shares!server={user_server}\", # further share the server with others\n",
" ],\n",
" \"expires_in\": 3600, # code expires in one hour\n",
"}\n",
"\n",
"\n",
"session.post(share_codes_url, data=json.dumps(options))\n"
"session.post(share_codes_url, data=json.dumps(options))"
]
},
{
@@ -598,7 +601,7 @@
" \"user\": \"shared-with\",\n",
"}\n",
"\n",
"session.patch(shares_url, data=json.dumps(options))\n"
"session.patch(shares_url, data=json.dumps(options))"
]
},
{