Commit Graph

2764 Commits

Author SHA1 Message Date
Blake Reimer
84b6852de8
Graham's Law (#8162)
* grahams law

* doctest and type hints

* doctest formatting

* peer review updates
2023-04-01 18:43:07 +02:00
Tianyi Zheng
a213cea5f5
Fix mypy errors in dilation_operation.py (#8595)
* updating DIRECTORY.md

* Fix mypy errors in dilation_operation.py

* Rename functions to use snake case

* updating DIRECTORY.md

* updating DIRECTORY.md

* Replace raw file string with pathlib Path

* Update digital_image_processing/morphological_operations/dilation_operation.py

Co-authored-by: Christian Clauss <cclauss@me.com>

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-04-01 18:39:22 +02:00
Maxim Smolskiy
59cae167e0
Reduce the complexity of digital_image_processing/edge detection/canny.py (#8167)
* Reduce the complexity of digital_image_processing/edge_detection/canny.py

* Fix

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Fix review issues

* Rename dst to destination

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-04-01 18:22:33 +02:00
amirsoroush
63710883c8
Remove extra len calls in doubly-linked-list's methods (#8600) 2023-04-01 17:53:21 +05:30
Maxim Smolskiy
3d2012c4ba
Add Project Euler problem 94 solution 1 (#8599)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-01 17:50:08 +05:30
Maxim Smolskiy
d66e1e8732
Add Project Euler problem 800 solution 1 (#8567)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-01 17:48:13 +05:30
Dhruv Manilawala
9e0c357a57
chore: additional Project Euler solution hash (#8593) 2023-04-01 08:29:26 +02:00
amirsoroush
e4d90e2d5b
change space complexity of linked list's __len__ from O(n) to O(1) (#8183) 2023-04-01 08:26:43 +02:00
Maxim Smolskiy
dc4f603dad
Add Project Euler problem 187 solution 1 (#8182)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-01 11:17:24 +05:30
Tianyi Zheng
5ce63b5966
Fix mypy errors in lu_decomposition.py (attempt 2) (#8100)
* updating DIRECTORY.md

* Fix mypy errors in lu_decomposition.py

* Replace for-loops with comprehensions

* Add explanation of LU decomposition and extra doctests

Add an explanation of LU decomposition with conditions for when an LU
decomposition exists

Add extra doctests to handle each of the possible conditions for when a
decomposition exists/doesn't exist

* updating DIRECTORY.md

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-04-01 07:11:24 +02:00
NIKITA PANDEY
238fe8c494
Update receive_file.py (#8541)
* Update receive_file.py

Here are the changes I made:

Added the main() function and called it from if __name__ == "__main__" block. This makes it easier to test the code and import it into other programs.
Added socket.AF_INET as the first argument to socket.socket(). This specifies the address family to be used, which is necessary when using connect().
Changed print(f"{data = }") to print("Received:", len(data), "bytes"). This makes it clearer what's happening and how much data is being received.
Changed the final print statement to "Successfully received the file". This makes it more accurate and descriptive.
Moved the import statement to the top of the file. This is a common convention in Python.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-31 16:08:13 +02:00
Rohan Anand
a00492911a
added a problem on kadane's algo and its solution. (#8569)
* added kadane's algorithm directory with one problem's solution.

* added type hints

* Rename kaadne_algorithm/max_product_subarray.py to dynamic_programming/max_product_subarray.py

* Update dynamic_programming/max_product_subarray.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update max_product_subarray.py

* Update max_product_subarray.py

* Update dynamic_programming/max_product_subarray.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update max_product_subarray.py

* Update max_product_subarray.py

* Update max_product_subarray.py

* Update max_product_subarray.py

* Update max_product_subarray.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update max_product_subarray.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update max_product_subarray.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update max_product_subarray.py

* Update max_product_subarray.py

* Update dynamic_programming/max_product_subarray.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dynamic_programming/max_product_subarray.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update max_product_subarray.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-31 13:17:13 +02:00
Rohan Anand
a71f22dae5
Update cnn_classification.py (#8570) 2023-03-30 07:09:21 +02:00
Maxim Smolskiy
ac111ee463
Reduce the complexity of graphs/bi_directional_dijkstra.py (#8165)
* Reduce the complexity of graphs/bi_directional_dijkstra.py

* Try to lower the --max-complexity threshold in the file .flake8

* Lower the --max-complexity threshold in the file .flake8

* updating DIRECTORY.md

* updating DIRECTORY.md

* Try to lower max-complexity

* Try to lower max-complexity

* Try to lower max-complexity

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-03-28 23:41:54 +02:00
Christian Veenhuis
86b2ab09aa
Fix broken links to Gitter Community (Fixes: #8197) (#8546)
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-03-26 18:20:47 +02:00
Genesis
7cdb011ba4
New gitter link added or replaced (#8551)
* New gitter link added

* ruff==0.0.258

* noqa: S310

* noqa: S310

* Update ruff.yml

* Add Ruff rule S311

* Ruff v0.0.259

* return ("{:08x}" * 5).format(*self.h)

* pickle.load(f)  # noqa: S301

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-03-26 17:19:18 +02:00
pre-commit-ci[bot]
3f9150c1b2
[pre-commit.ci] pre-commit autoupdate (#8294)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.255 → v0.0.257](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.255...v0.0.257)

* Fix PLR1711 Useless  statement at end of function

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-03-20 22:16:13 +01:00
Christian Clauss
521fbca61c
Replace flake8 with ruff (#8184) 2023-03-16 13:31:29 +01:00
Christian Clauss
c96241b5a5
Replace bandit, flake8, isort, and pyupgrade with ruff (#8178)
* Replace bandit, flake8, isort, and pyupgrade with ruff

* Comment on ruff rules

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-03-15 13:58:25 +01:00
Maxim Smolskiy
adc3ccdabe
Add Project Euler problem 131 solution 1 (#8179)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-15 18:26:03 +05:30
David Leal
47b3c72982
docs: add the other/miscellaneous form (#8163)
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2023-03-14 11:16:52 +05:30
Maxim Smolskiy
9701e459e8
Add Project Euler problem 100 solution 1 (#8175)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-14 11:09:36 +05:30
Andrey
b797e437ae
Add hashmap implementation (#7967) 2023-03-14 01:31:27 +01:00
pre-commit-ci[bot]
8959211100
[pre-commit.ci] pre-commit autoupdate (#8177)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.254 → v0.0.255](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.254...v0.0.255)
- [github.com/pre-commit/mirrors-mypy: v1.0.1 → v1.1.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.1...v1.1.1)
- [github.com/codespell-project/codespell: v2.2.2 → v2.2.4](https://github.com/codespell-project/codespell/compare/v2.2.2...v2.2.4)

* updating DIRECTORY.md

* Fixes for new version of codespell

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-03-13 23:18:35 +01:00
Maxim Smolskiy
f9cc25221c
Reduce the complexity of backtracking/word_search.py (#8166)
* Lower the --max-complexity threshold in the file .flake8
2023-03-10 15:18:05 +05:30
Subhendu Dash
9e28ecca28
Add circular convolution (#8158)
* add circular convolution

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add type hint for __init__

* rounding off final values to 2 and minor changes

* add test case for unequal signals

* changes in list comprehension and enumeraton

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-07 17:16:25 +01:00
pre-commit-ci[bot]
41b633a841
[pre-commit.ci] pre-commit autoupdate (#8168)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.253 → v0.0.254](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.253...v0.0.254)

* Rename get_top_billionaires.py to get_top_billionaires.py.disabled

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-03-07 00:10:39 +01:00
Maxim Smolskiy
9720e6a6cf
Add Project Euler problem 117 solution 1 (#6872)
Update DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-03-02 22:21:48 +05:30
Maxim Smolskiy
ee778128bd
Reduce the complexity of other/scoring_algorithm.py (#8045)
* Increase the --max-complexity threshold in the file .flake8
2023-03-02 10:27:07 +05:30
Maxim Smolskiy
069a14b1c5
Add Project Euler problem 082 solution 1 (#6282)
Update DIRECTORY.md
---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-03-02 10:25:47 +05:30
Christian Clauss
64543faa98
Make some ruff fixes (#8154)
* Make some ruff fixes

* Undo manual fix

* Undo manual fix

* Updates from ruff=0.0.251
2023-03-01 17:23:33 +01:00
pre-commit-ci[bot]
1c15cdff70
[pre-commit.ci] pre-commit autoupdate (#8160)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/tox-dev/pyproject-fmt: 0.9.1 → 0.9.2](https://github.com/tox-dev/pyproject-fmt/compare/0.9.1...0.9.2)

* pre-commit: Add ruff

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-02-27 23:08:40 +01:00
pre-commit-ci[bot]
67676c3b79
[pre-commit.ci] pre-commit autoupdate (#8149)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/tox-dev/pyproject-fmt: 0.8.0 → 0.9.1](https://github.com/tox-dev/pyproject-fmt/compare/0.8.0...0.9.1)
- [github.com/pre-commit/mirrors-mypy: v1.0.0 → v1.0.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.0...v1.0.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-21 08:33:44 +01:00
Jan Wojciechowski
1bf03889c5
Update bogo_sort.py (#8144) 2023-02-20 11:14:01 +13:00
pre-commit-ci[bot]
126e89d8a3
[pre-commit.ci] pre-commit autoupdate (#8141)
updates:
- [github.com/tox-dev/pyproject-fmt: 0.6.0 → 0.8.0](https://github.com/tox-dev/pyproject-fmt/compare/0.6.0...0.8.0)
- [github.com/pre-commit/mirrors-mypy: v0.991 → v1.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.0.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-13 22:05:56 +01:00
Damon Gregory
77b4fa8b3f
fix_ci_badge (#8134) 2023-02-12 16:55:25 +01:00
Christian Clauss
c909da9b08
pre-commit: Upgrade psf/black for stable style 2023 (#8110)
* pre-commit: Upgrade psf/black for stable style 2023

Updating https://github.com/psf/black ... updating 22.12.0 -> 23.1.0 for their `2023 stable style`.
* https://github.com/psf/black/blob/main/CHANGES.md#2310

> This is the first [psf/black] release of 2023, and following our stability policy, it comes with a number of improvements to our stable style…

Also, add https://github.com/tox-dev/pyproject-fmt and https://github.com/abravalheri/validate-pyproject to pre-commit.

I only modified `.pre-commit-config.yaml` and all other files were modified by pre-commit.ci and psf/black.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-01 18:44:54 +05:30
pre-commit-ci[bot]
ed0a581f93
[pre-commit.ci] pre-commit autoupdate (#8107)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/PyCQA/isort: 5.11.4 → 5.12.0](https://github.com/PyCQA/isort/compare/5.11.4...5.12.0)

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-01-30 23:42:15 +01:00
Tianyi Zheng
57c12fab28
Fix mypy errors in lorentz_transformation_four_vector.py (#8075)
* updating DIRECTORY.md

* Fix mypy errors in lorentz_transformation_four_vector.py

* Remove unused symbol vars

* Add function documentation and rewrite algorithm explanation

Previous explanation was misleading, as the code only calculates Lorentz
transformations for movement in the x direction (0 velocity in the y and
z directions) and not movement in any direction

* updating DIRECTORY.md

* Update error message for speed

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-01-26 08:13:03 +01:00
Caeden Perelli-Harris
c00af459fe
feat: Concatenate both factorial implementations (#8099)
* feat: Concatenate both factorial implementations

* fix: Rename factorial recursive method
2023-01-26 08:12:11 +01:00
MohammadReza Balakhaniyan
1a27258bd6
gcd_of_n_numbers (#8057)
* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add maths/Gcd of N Numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* more pythonic

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* more pythonic

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* merged

* merged

* more readable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-10 23:47:02 +01:00
Caeden Perelli-Harris
4939e8463f
Create cached fibonacci algorithm (#8084)
* feat: Add `fib_recursive_cached` func

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* doc: Show difference in time when caching algorithm

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-07 17:56:39 +01:00
Abhishek Mulik
32a1ff9359
Update is_palindrome.py (#8022) 2023-01-04 13:47:15 +13:00
Tianyi Zheng
9f041e9cc8
Refactor sierpinski_triangle.py (#8068)
* updating DIRECTORY.md

* Update sierpinski_triangle.py header doc

* Remove unused PROGNAME var in sierpinski_triangle.py

The PROGNAME var was used to print an image description in the reference
code that this implementation was taken from, but it's entirely unused
here

* Refactor triangle() function to not use list of vertices

Since the number of vertices is always fixed at 3, there's no need to
pass in the vertices as a list, and it's clearer to give the vertices
distinct names rather than index them from the list

* Refactor sierpinski_triangle.py to use tuples

Tuples make more sense than lists for storing coordinate pairs

* Flip if-statement condition in sierpinski_triangle.py to avoid nesting

* Add type hints to sierpinski_triangle.py

* Add doctests to sierpinski_triangle.py

* Fix return types in doctests

* Update fractals/sierpinski_triangle.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-01-02 14:15:14 +01:00
Tianyi Zheng
725731c8d2
Refactor local_weighted_learning.py to use np.array (#8069)
* updating DIRECTORY.md

* Format local_weighted_learning.py doctests for clarity

* Refactor local_weighted_learning.py to use np.array instead of np.mat

The np.matrix class is planned to be eventually depreciated in favor of
np.array, and current use of the class raises warnings in pytest

* Update local_weighted_learning.py documentation

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-01-02 14:07:39 +01:00
Tianyi Zheng
7c1d23d448
Change prime_sieve_eratosthenes.py to return list (#8062) 2023-01-02 14:10:59 +13:00
Tianyi Zheng
d29afca93b
Fix get_top_billioners.py file name typo (#8066) 2023-01-01 14:30:14 +01:00
Alexander Pantyukhin
c6223c71d8
add word_break dynamic approach up -> down. (#8039)
* add word_break dynamic approach up -> down.

* updating DIRECTORY.md

* Update word_break.py

fix review notes.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update word_break.py

fix review notes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix review notes

* add trie type

* Update word_break.py

add typing Any to trie.

* Update dynamic_programming/word_break.py

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

* Update dynamic_programming/word_break.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update dynamic_programming/word_break.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update dynamic_programming/word_break.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update dynamic_programming/word_break.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* fix review notes

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-12-30 06:47:40 +01:00
Tianyi Zheng
b72d0681ec
Remove extra imports in gamma.py doctests (#8060)
* Refactor bottom-up function to be class method

* Add type hints

* Update convolve function namespace

* Remove depreciated np.float

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Renamed function for consistency

* updating DIRECTORY.md

* Remove extra imports in gamma.py doctests

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
2022-12-29 18:06:26 +01:00
Lucia Harcekova
90686e39b9
Add LZ77 compression algorithm (#8059)
* - add "lz77_compressor" class with compress and decompress methods using LZ77 compression algorithm

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* - use "list" instead "List", formatting

* - fix spelling

* - add Python type hints

* - add 'Token' class to represent triplet (offset, length, indicator)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* - add test, hange type rom List to list

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* - remove extra import

* - remove extra types in comments

* - better test

* - edit comments

* - add return types

* - add tests for __str__ and __repr__

* Update lz77.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-12-28 18:34:35 +01:00