apache/spark — pull request #97 by ScrapCodes (2014-03-07 10:39:42+00:00)
Title: Spark 1162 Implemented takeOrdered in pyspark.

Since python does not have a library for max heap and usual tricks like inverting values etc.. does not work for all cases. So best thing I could think of is modify heapq itself.