Remove and return value with given key or index (last item by default).

		If key is not found, returns d if given,
		otherwise raises KeyError or IndexError.

		This is generally O(N) unless removing last item, then O(1).

def pop(self, key=NOT_SET, index=NOT_SET, d=NOT_SET):
		"""Remove and return value with given key or index (last item by default).

		If key is not found, returns d if given,
		otherwise raises KeyError or IndexError.

		This is generally O(N) unless removing last item, then O(1).
		"""
		has_default = d is not NOT_SET

		if index is NOT_SET and key is not NOT_SET:
			index, value = self._pop_key(key, has_default)
		elif key is NOT_SET:
			key, index, value = self._pop_index(index, has_default)
		else:
			raise KEY_AND_INDEX_ERROR

		if index is None:
			return d
		else:
			self._fix_indices_after_delete(index)
			return value