def METHOD_NAME(self):
    if self._pending_removals:
        self._commit_removals()
    while True:
        try:
            itemref = self.data.METHOD_NAME()
        except KeyError:
            raise KeyError('pop from empty WeakSet') from None
        item = itemref()
        if item is not None:
            return item