utility script to run pyflakes on all python scripts
Inventory API: remove unecessary joins in the queries

We were joining catalog for section, node and resource, mainly in order to
expose _title and _relative_url in brains. We just need to select the
corresponding uids and let brains do another catalog search to get the object
when accessed.
Inventory API: omit_simulation can filter on stock.portal_type instead of catalog.portal_type

This way mysql will probably merge this with other constraints on
stock.portal_type when portal_type= is passed.
Alarm: restore workaround for getLastActiveProcess

92aa42c378783603e90f7ff27208034bdfe5a5e5 reintroduced the random failure. This
restores the same workaround using the 3 item sort syntax