def popitem(self):
pq = self.pq<EOL>while pq:<EOL><INDENT>priority, key, val = heapq.heappop(pq)<EOL>if val is None:<EOL><INDENT>self.removed_count -= <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>del self.item_finder[key]<EOL>return key, val, priority<EOL><DEDENT><DEDENT>raise KeyError("<STR_LIT>")<EOL>
remove the next prioritized [key, val, priority] and return it