Fix some pep8 in detect.py