Revise attributes value with dictionary data.

        :type data: dict
        :type ignore_none: bool

        **中文文档**

        将一个字典中的数据更新到本条文档。当且仅当数据值不为None时。
174885
def revise(self, data, ignore_none=True):
        
        if not isinstance(data, dict):
            raise TypeError("`data` has to be a dict!")

        if ignore_none:
            for key, value in data.items():
                if value is not None:
                    setattr(self, key, deepcopy(value))
        else:
            for key, value in data.items():
                setattr(self, key, deepcopy(value))

        return self
480182
def _combine_attr_fast_update(self, attr, typ):
        '''

        '''
        values = dict(getattr(self, attr, {}))
        
        for base in self._class_data.bases:
            vals = dict(getattr(base, attr, {}))
            preserve_attr_data(vals, values)
            values = combine(vals, values)
            
        setattr(self, attr, typ(values))
620917
def update(self, new_data: Dict[Text, Dict[Text, Text]]):
        

        for locale, data in new_data.items():
            if locale not in self.dict:
                self.dict[locale] = {}

            self.dict[locale].update(data)
446523
def ignore_samples(self, data):
        
        try:
            if isinstance(data, OrderedDict):
                newdata = OrderedDict()
            elif isinstance(data, dict):
                newdata = dict()
            else:
                return data
            for k,v in data.items():
                # Match ignore glob patterns
                glob_match = any( fnmatch.fnmatch(k, sn) for sn in config.sample_names_ignore )
                re_match = any( re.match(sn, k) for sn in config.sample_names_ignore_re )
                if not glob_match and not re_match:
                    newdata[k] = v
            return newdata
        except (TypeError, AttributeError):
            return data
772075
def edit(self, path, value):
    
    _dict = PyVDF.__UseDict
    p = [re.sub('[\[\]]', '', w) for w in PyVDF.__RE_Path_Seperator.findall(path)]
    array = self.getData()
    a = array
    for c in p[:-1]:
      try:
        if not isinstance(a[c], dict):
          a[c] = _dict()
      except KeyError:
        a[c] = _dict()
      a = a[c]
    if value == None:
      a.pop(p[-1], None)
    else:
      a[p[-1]] = value
    self.__data = array
408370
def _update_data(self, data, update_original=False, remove_missing=False):
        
        self._data.update(dict((key, self._deserialize(key, value))
                               for key, value in data.items()))

        # In certain situations, we want to treat missing keys as removals
        if remove_missing:
            for key in set(self._data.keys()) - set(data.keys()):
                self._data[key] = None

        if update_original:
            self._original_data = copy.deepcopy(self._data)
327874
def update(self, data=None, **kwargs):
        
        if data is None:
            data = {}
        data.update(kwargs)
        return self.model.write([self.id], data)
1020250
def update_without_overwrite(d, *args, **kwds):
    
    if args:
        assert len(args) == 1, \
            'At most one positional parameter is allowed: {0!r}'.format(args)

        (other,) = args
        if isinstance(other, Mapping):
            for key in other:
                setitem_without_overwrite(d, key, other[key])
        elif hasattr(other, "keys"):
            for key in other.keys():
                setitem_without_overwrite(d, key, other[key])
        else:
            for key, value in other:
                setitem_without_overwrite(d, key, value)

    for key, value in kwds.items():
        setitem_without_overwrite(d, key, value)
1278990
def update(self, data):
        
        if not isinstance(data, dict):
            raise TypeError('Data to update must be in a dictionary.')
        for k, v in data.items():
            arr = np.array(v)
            try:
                self[k] = arr
            except TypeError:
                logging.warning("Values under key ({}) not supported by VTK".format(k))
        return
675047
def update(self, key, value):
        
        if not isinstance(value, dict):
            raise BadValueError(
                'The value {} is incorrect.'
                ' Values should be strings'.format(value))
        if key in self.data:
            v = self.get(key)
            v.update(value)
        else:
            v = value
        self.set(key, v)
1041288
def _get_ignored_version():
    
    if os.path.exists(filepath):
        with open(filepath) as data_file:
            data = json.load(data_file)
            version = data.get('version')
    else:
        version = None
    return version
1309491
def filter_none(data: Dict[str, Any],
                keys: OptKeys = None) -> Dict[str, Any]:
    

    def limited_filter(k: str, v: Any) -> bool:
        return k not in keys or v is not None  # type: ignore

    def full_filter(k: str, v: Any) -> bool:
        return v is not None

    f = limited_filter if keys is not None else full_filter
    return {k: v for k, v in data.items() if f(k, v)}
65071
def setData(self, type: str, data: str) -> None:
        
        type = normalize_type(type)
        if type in self.__data:
            del self.__data[type]
        self.__data[type] = data
975719
def set_data(self, data_np, metadata=None, order=None, astype=None):
        
        if astype:
            data = data_np.astype(astype, copy=False)
        else:
            data = data_np
        self._data = data

        self._calc_order(order)

        if metadata:
            self.update_metadata(metadata)

        self._set_minmax()

        self.make_callback('modified')
780024
def update(self, data):
        
        data = values.of({'Data': serialize.object(data), })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return DocumentInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
82666
def setitem_without_overwrite(d, key, value):
    
    if key in d:
        raise OverwriteError(key, value, d[key])
    else:
        dict.__setitem__(d, key, value)
589645
def _replace_none(self, aDict):
        
        for k, v in aDict.items():
            if v is None:
                aDict[k] = 'none'