From e9f032c70bdc0571c59e64aa5edd88ebee3161e8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 20:30:43 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- lectures/pandas/PublicAPIs.ipynb | 6 +++--- .../monty-hall-game4/monty_hall_game/__main__.py | 2 +- lectures/python/exercises.ipynb | 3 +-- lectures/python/point.py | 3 +-- lectures/web-servers/monty-hall-game/game_server2.py | 1 - lectures/web-servers/monty-hall-game/game_server3.py | 1 - lectures/web-servers/monty-hall-game/game_server4.py | 1 - lectures/web-servers/monty-hall-game/game_server6.py | 1 - lectures/web-servers/monty-hall-game/game_server7.py | 1 - lectures/web-servers/monty-hall-game/game_server_rest.py | 1 - .../web-servers/monty-hall-game/game_server_rest_soln.py | 1 - 11 files changed, 6 insertions(+), 15 deletions(-) diff --git a/lectures/pandas/PublicAPIs.ipynb b/lectures/pandas/PublicAPIs.ipynb index 1c80de7..65b02ac 100644 --- a/lectures/pandas/PublicAPIs.ipynb +++ b/lectures/pandas/PublicAPIs.ipynb @@ -3320,9 +3320,9 @@ "source": [ "url = \"https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=51.5&lon=0\"\n", "s = requests.Session()\n", - "s.headers[\n", - " \"User-Agent\"\n", - "] = \"uio-in3110 https://github.com/uio-in3110/uio-in3110.github.io\"\n", + "s.headers[\"User-Agent\"] = (\n", + " \"uio-in3110 https://github.com/uio-in3110/uio-in3110.github.io\"\n", + ")\n", "r = s.get(url)\n", "r" ] diff --git a/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py b/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py index 27d14a7..9ae637f 100644 --- a/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py +++ b/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py @@ -1,4 +1,4 @@ from .cli import main if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/lectures/python/exercises.ipynb b/lectures/python/exercises.ipynb index 0bc0490..a26d0c0 100644 --- a/lectures/python/exercises.ipynb +++ b/lectures/python/exercises.ipynb @@ -404,8 +404,7 @@ "metadata": {}, "outputs": [], "source": [ - "class Square(...):\n", - " ...\n", + "class Square(...): ...\n", "\n", "\n", "sq = Square(5)\n", diff --git a/lectures/python/point.py b/lectures/python/point.py index a34e7fb..16a3364 100755 --- a/lectures/python/point.py +++ b/lectures/python/point.py @@ -4,8 +4,7 @@ class Point: """Class representing a 2-D Cartesian point""" - def __init__(self, x, y): - ... + def __init__(self, x, y): ... def __repr__(self): return f"Point({self.x}, {self.y})" diff --git a/lectures/web-servers/monty-hall-game/game_server2.py b/lectures/web-servers/monty-hall-game/game_server2.py index 2979508..cbddd17 100644 --- a/lectures/web-servers/monty-hall-game/game_server2.py +++ b/lectures/web-servers/monty-hall-game/game_server2.py @@ -11,7 +11,6 @@ - The template contains a form with a POST request to the /reselect. """ - from fastapi import FastAPI, Request from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates diff --git a/lectures/web-servers/monty-hall-game/game_server3.py b/lectures/web-servers/monty-hall-game/game_server3.py index 59b7d85..b9bc710 100644 --- a/lectures/web-servers/monty-hall-game/game_server3.py +++ b/lectures/web-servers/monty-hall-game/game_server3.py @@ -12,7 +12,6 @@ and displays it in the reselect3.html template """ - from fastapi import FastAPI, Form, Request from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates diff --git a/lectures/web-servers/monty-hall-game/game_server4.py b/lectures/web-servers/monty-hall-game/game_server4.py index 6627fd3..50dd29c 100644 --- a/lectures/web-servers/monty-hall-game/game_server4.py +++ b/lectures/web-servers/monty-hall-game/game_server4.py @@ -22,7 +22,6 @@ """ - import random import uuid diff --git a/lectures/web-servers/monty-hall-game/game_server6.py b/lectures/web-servers/monty-hall-game/game_server6.py index b19f81f..23ef7bb 100644 --- a/lectures/web-servers/monty-hall-game/game_server6.py +++ b/lectures/web-servers/monty-hall-game/game_server6.py @@ -13,7 +13,6 @@ information """ - import random import uuid from statistics import mean diff --git a/lectures/web-servers/monty-hall-game/game_server7.py b/lectures/web-servers/monty-hall-game/game_server7.py index 4667e4e..e57c8b8 100644 --- a/lectures/web-servers/monty-hall-game/game_server7.py +++ b/lectures/web-servers/monty-hall-game/game_server7.py @@ -13,7 +13,6 @@ information """ - import random import uuid from statistics import mean diff --git a/lectures/web-servers/monty-hall-game/game_server_rest.py b/lectures/web-servers/monty-hall-game/game_server_rest.py index 1d4c79a..351ce68 100644 --- a/lectures/web-servers/monty-hall-game/game_server_rest.py +++ b/lectures/web-servers/monty-hall-game/game_server_rest.py @@ -13,7 +13,6 @@ information """ - import random import uuid from functools import partial diff --git a/lectures/web-servers/monty-hall-game/game_server_rest_soln.py b/lectures/web-servers/monty-hall-game/game_server_rest_soln.py index dad2da4..9939d5c 100644 --- a/lectures/web-servers/monty-hall-game/game_server_rest_soln.py +++ b/lectures/web-servers/monty-hall-game/game_server_rest_soln.py @@ -11,7 +11,6 @@ use in combination with autoplay.py to play monty hall via a REST API. """ - import random import uuid from enum import IntEnum