def get_latest_write(self, locked_item, not_job=None):
    try:
        if (not_job is not None):
            return sorted([l for l in self.write_by_item[locked_item] if (l.job != not_job)], (lambda a, b: cmp(a.job.id, b.job.id)))[(- 1)]
        return sorted(self.write_by_item[locked_item], (lambda a, b: cmp(a.job.id, b.job.id)))[(- 1)]
    except IndexError:
        return None
def get_latest_write(self, locked_item, not_job=None):
    try:
        if (not_job is not None):
            return sorted([l for l in self.write_by_item[locked_item] if (l.job != not_job)], (lambda a, b: cmp(a.job.id, b.job.id)))[(- 1)]
        return sorted(self.write_by_item[locked_item], (lambda a, b: cmp(a.job.id, b.job.id)))[(- 1)]
    except IndexError:
        return None