HH-42371 fix docs and speed up unittests, fix PEP8