def get_write_by_locked_item(self):
    result = {}
    for (locked_item, locks) in self.write_by_item.items():
        if locks:
            result[locked_item] = sorted(locks, (lambda a, b: cmp(a.job.id, b.job.id)))[(- 1)]
    return result
def get_write_by_locked_item(self):
    result = {}
    for (locked_item, locks) in self.write_by_item.items():
        if locks:
            result[locked_item] = sorted(locks, (lambda a, b: cmp(a.job.id, b.job.id)))[(- 1)]
    return result