def METHOD_NAME(self, judge):
    with self.lock:
        sub = judge.get_current_submission()
        if sub is not None:
            try:
                del self.submission_map[sub]
            except KeyError:
                pass
        self.judges.discard(judge)
        # Since we reserve a judge for high priority submissions when there are more than one,
        # we'll need to start judging if there is exactly one judge and it's free.
        if len(self.judges) == 1:
            judge = next(iter(self.judges))
            if not judge.working:
                self._handle_free_judge(judge)