An indexed priority queue implementation in Python