Fix coding style of advanced search

Fix the coding style so it is PEP8 / flake8 compliant.