Don't look for coincidences today or in the future

Limit the enddate for the search for analysissessions to 'today'
Some PEP8 fixes