Update dict with None values filtered out.
9973
def dict_filter_update(base, updates):
    # type: (dict, dict) -> None
    
    base.update((k, v) for k, v in updates.items() if v is not None)
396509
def _clear_empty_values(args):
    '''
    
    '''
    result = {}
    for param in args:
        if args[param] is not None:
            result[param] = args[param]
    return result
610972
def dictlist_replace(dict_list: Iterable[Dict], key: str, value: Any) -> None:
    
    for d in dict_list:
        d[key] = value
475417
def cleanup(self):
        
        for dict in (self.rule2func, self.rules, self.rule2name):
            for i in list(dict.keys()):
                dict[i] = None
        for i in dir(self):
            setattr(self, i, None)
1317766
def unused(self, _dict):
        
        for key, value in _dict.items():
            if value is None:
                del _dict[key]
        return _dict
1013697
def filter_out_none_valued_keys(self, d):
        # type: (typing.Dict[K, V]) -> typing.Dict[K, V]
        """"""
        new_d = {}
        for k, v in d.items():
            if v is not None:
                new_d[k] = v
        return new_d
977228
def update_filter_dict(d, user, status):
    
    if user is not None:
        if not user.id:
            return None
        d['user'] = user
    if status is not None:
        d['status'] = status
396554
def update(self, defaults=values.unset):
        
        return self._proxy.update(defaults=defaults, )
300560
def update(self, *args, **kwargs):
        '''
        
        '''
        preprocess = kwargs.get('preprocess')
        for s in args:
            for e in s:
                self._dict_set(preprocess(e) if preprocess else e, True)
1072051
def remove_none_dict_values(obj):
    
    if isinstance(obj, (list, tuple, set)):
        return type(obj)(remove_none_dict_values(x) for x in obj)
    elif isinstance(obj, dict):
        return type(obj)((k, remove_none_dict_values(v))
                         for k, v in obj.items()
                         if v is not None)
    else:
        return obj
1366225
def compare_dicts(old=None, new=None):
    '''
    
    '''
    ret = {}
    for key in set((new or {})).union((old or {})):
        if key not in old:
            # New key
            ret[key] = {'old': '',
                        'new': new[key]}
        elif key not in new:
            # Key removed
            ret[key] = {'new': '',
                        'old': old[key]}
        elif new[key] != old[key]:
            # Key modified
            ret[key] = {'old': old[key],
                        'new': new[key]}
    return ret
216491
def filter_dict(iterable, keys):
  
  if type(keys) is not list:
    keys = [keys]
  for i in iterable:
    try:
      d = {}
      for a in keys:
        try:
          d[a] = i[a]
        except KeyError:
          pass
      if d != {}:
        yield d
    except Exception:
      pass
572347
def _clean_data(self, str_value, file_data, obj_value):
        """"""
        str_value = str_value or None
        obj_value = obj_value or None
        return (str_value, None, obj_value)
740298
def remove_none_value(data):
    
    return dict((k, v) for k, v in data.items() if v is not None)
567800
def update(self, dictionary):
        """"""
        allowed_attrs = list(self.__attributes__.keys())
        allowed_attrs += [a.alias for a in self.__attributes__.values()]
        for k in dictionary:
            # We only update existing attributes
            if k in allowed_attrs:
                setattr(self, k, dictionary[k])
        return self
1349321
def update(self, sequence=None, **mapping):
        """"""
        if sequence is not None:
            if isinstance(sequence, dict):
                for slot in sequence:
                    self[slot] = sequence[slot]
            else:
                for slot, value in sequence:
                    self[slot] = value
        if mapping:
            for slot in sequence:
                self[slot] = sequence[slot]
664678
def update(self) -> None:
        """"""
        mask = self.mask
        weights = self.refweights[mask]
        self[~mask] = numpy.nan
        self[mask] = weights/numpy.sum(weights)