Format code

Description

It would be nice to format the code to make it more legible.
It will also make it easier to add new code following the formatting guidelines.

Links to source code

Let's try with pre-commit using flake8 and pydocstyle.

Pseudocode or screenshots