Autopep8 and adding minimum event duration