If *key* is in the dictionary, remove it and return its value,
        else return *default*. If *default* is not given and *key* is not
        in the dictionary, a :exc:`KeyError` is raised.
354546
def pop(self, key, default=__marker):
        
        pickled_key = self._pickle_key(key)

        if key in self.cache:
            self.redis.hdel(self.key, pickled_key)
            return self.cache.pop(key)

        def pop_trans(pipe):
            pickled_value = pipe.hget(self.key, pickled_key)
            if pickled_value is None:
                if default is self.__marker:
                    raise KeyError(key)
                return default

            pipe.hdel(self.key, pickled_key)
            return self._unpickle(pickled_value)

        value = self._transaction(pop_trans)
        self.cache.pop(key, None)

        return value
915785
def value(self, key, default=None):
        
        curr = self._stack[-1]
        return curr.get(key, default)
719411
def apply_dict_default(dictionary, arg, default):
    '''
    
    '''
    if arg not in dictionary:
        if hasattr(default, '__call__'):
            # Don't try/catch because the method could raise a TypeError and we'd hide it
            default = restrict_args(default, arg)
        dictionary[arg] = default
    return dictionary
49100
def get_dict(dictionary, *keys,**kwargs):
    

    if 'default' in kwargs:
        default = kwargs['default']
    else:
        default = None

    existing = dictionary
    for i in range(0, len(keys)):

        if keys[i] in existing:

            existing = existing[keys[i]]
        else:

            return default
    return existing
490997
def pop(self, key, default=_marker):
        
        try:
            popped = self[key]
            del self[key]
            return popped
        except KeyError:
            if default == _marker:
                raise
            return default
531668
def setdefault(self, k, d=None):
        
        if k not in self._col_dict:
            self._set_key(k, d)
        return self._col_dict.get(k)
439181
def unset(self, key):
        
        key = key.strip().upper()
        if key not in dir(default_settings) and key not in self._defaults:
            self.logger.debug("Unset %s", key)
            delattr(self, key)
            self.store.pop(key, None)
493072
def pop(self, key, default=None):
        
        if key not in self:
            if default is not None:
                return default
            raise KeyError(key)
        for map in [self._pb.IntMap, self._pb.FloatMap, self._pb.StringMap,
                    self._pb.BoolMap]:
            if key in map.keys():
                return map.pop(key)
510246
def get(self, key, default=None):
        
        try:
            return self.items[key]
        except IndexError:
            return value(default)
1048106
def is_true(key, default=False):
    
    value = get(key, default)
    if isinstance(value, list):
        value = value[0]
    if isinstance(value, bool):
        return value
    if value is default:
        return default
    return value.lower() in TRUE_VALUES
157493
def setdefault(self, key, value):
        
        with self.lock:
            if key in self:
                return self.getitem(key)

            else:
                self.setitem(key, value)
                return value
337990
def setdefault(self, key, default=None):
        
        self._wlock.acquire()
        try:
            try:
                return self[key]
            except KeyError:
                self[key] = default
                return default
        finally:
            self._wlock.release()
1219639
def handle_key(self, key):
        
        try:
            func = None
            if key.is_sequence:
                try:
                    func = self.config.keymap[key.name]
                except:
                    try:
                        func = self.config.keymap[key.code]
                    except:
                        func = self.config.keymap[str(key)]
            else:
                func = self.config.keymap[str(key)]

            if func in self.valid_key_funcs:
                getattr(self, func)()
        except:
            raise
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
1036606
def kremove(self, key, value=None):
        
        for item in self:
            if value is None:
                # Just pop the key if present,
                # otherwise return None
                # (shortcut to ignore the exception)
                item.pop(key, None)
            else:
                try:
                    # Use the key as a set
                    item[key].remove(value)
                    # If the set contains a single element
                    # just store the latter
                    if len(item[key]) == 1:
                        item[key] = item[key].pop()
                except KeyError:
                    # This happens when the item
                    # does not contain the key
                    pass
                except AttributeError:
                    # This happens when the key is not a set
                    # and shall be removed only if values match
                    if item[key] == value:
                        item.pop(key)
400818
def setdefault(self, key, default=None):
        
        if key in self:
            return self[key]
        else:
            self._setitem(key, default)
            self._list_add(key)
            return default
226473
def get_from_dicts(dict1, key, default_value, dict2, extra=''):
    

    value=default_value

    if key not in dict1:
       if dict2!=None:
          value=dict2.get(extra+key, default_value)
    else:
       value=dict1[key]
       del(dict1[key])

       if dict2!=None:
          dict2[extra+key]=value

    return value