Remove and return an arbitrary set element.

        :raises KeyError: if the set is empty.
332132
def pop(self):
        
        member = self.client.spop(self.name)
        if member is not None:
            return member
        raise KeyError()
313885
def then_the_return_element_have_no_key(context, line, key):
    
    line = int(line)
    data = context.apiRequest.data
    assert 0 <= line < len(data)
    assert key not in data[line]
30981
function slice(obj, set) {
		var r = {};
		for (var key in obj) {
			if (key in set) {
				r[key] = obj[key];
				delete obj[key];
			}
		}
		return r;
	}
243291
def unset(self, name):
        
        try:
            attr = self.getAttribute(name)
            self.attributes.remove(attr)
        except Exception:
            pass
        return self
847639
function getSetRemoveProperty (collection, property, value) {
		if (isUndefined(value)) {
			// get property of first element if there is one
			return collection[0] ? collection[0][property] : undefined;
		} else if (value !== null) {
			collection.forEach(element => element[property] = value)
		} else {
			collection.forEach(element => delete element[property])
			}

		return collection;
	}
57348
def popitem(self):
        
        for key in self.sections():
            value = self[key]
            del self[key]
            return key, value
        raise KeyError
1194306
def pop(self, key, default=_NotGiven):
        
        if key in self:
            self._list_remove(key)
            return self._pop(key)
        else:
            if default is _NotGiven:
                raise KeyError(key)
            else:
                return default
716031
def remove_from_set(set, item)
      Predictor.redis.multi do |redis|
        redis.srem(redis_key(:items, set), item)
        redis.srem(redis_key(:sets, item), set)
      end
    end
493402
def _pop(self, key, default=None):
        
        value = default
        if key in self:
            value = self[key]
            del self[key]
        return value
346653
def pop(self, key=NOT_SET, index=NOT_SET, d=NOT_SET):
		
		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
1371312
def clean(self, value):
		

		# If the value is None and it's optional, return as is
		if value is None and self._optional:
			return None

		# If the value is not a dict
		if not isinstance(value, dict):
			raise ValueError('value')

		# Recurse and return it
		return {str(self._key.clean(k)):self._node.clean(v) for k,v in iteritems(value)}
1181839
def empty(self, start=None, stop=None):
		
		self.set(NOT_SET, start=start, stop=stop)
264924
def unlist(list_thing, complain=True):
    """"""
    if complain and len(list_thing) > 1:
        raise ValueError("More than one element in {}".format(list_thing))
    elif len(list_thing) == 1:
        return list_thing[0]

    if complain:
        raise ValueError("Nothing in {}".format(list_thing))
    return None
1128700
def pop(self, index=-1):
        
        # pylint: disable=arguments-differ
        value = self._list.pop(index)
        self._set.remove(value)
        return value
132296
def pop(self):
        """"""
        try:
            x = next(iter(self))
            self.remove(x)
            return x
        except StopIteration:
            raise KeyError('pop from an empty set')
1253514
def __mark(self, element, mark_set):
        
        try:
            # The given element can be of a different type than the original
            # one (JID instead of str, ...), so we retrieve the original one
            original = self.__elements.pop(element)
            mark_set.add(original)
        except KeyError:
            return False
        else:
            if not self.__elements:
                # No more elements to wait for
                self.__call()
            return True
1130859
def try_pop(d, key, default):
    
    value = d.get(key, default)
    if key in d:
        d.pop(key)
    return value