Updates keyword indices for the given cache key.
516494
protected function updateKeywordIndex($key)
    {
        $this->setKeywordsOperation(true);

        $keywordsState = $this->determineKeywordsState($key);

        foreach (array_merge($keywordsState['new'], $keywordsState['obsolete']) as $keyword) {
            $indexKey = $this->generateIndexKey($keyword);
            $oldIndex = parent::pull($indexKey, []);
            $newIndex = in_array($keyword, $keywordsState['obsolete']) ?
                array_values(array_diff($oldIndex, [$key])) :
                array_values(array_unique(array_merge($oldIndex, [$key])));

            if (! empty($newIndex)) {
                parent::forever($indexKey, $newIndex);
            }
        }

        $this->setKeywordsOperation(false);
    }
536094
def update(self, key: str, data: np.ndarray) -> None:
        
        self.data[key] = data
1049422
private void updateIgnoredWordDictionary() {
    wordsToBeIgnoredDictionary = wordsToBeIgnored
                                   .stream()
                                   .collect(Collectors.groupingBy(s -> s.substring(0,1), Collectors.toSet()));
    wordsToBeIgnoredDictionaryIgnoreCase = wordsToBeIgnored
                                             .stream()
                                             .map(String::toLowerCase)
                                             .collect(Collectors.groupingBy(s -> s.substring(0,1), Collectors.toSet()));
  }
1038676
def flush(key):
    
    flush_list = []
    for item in cache:
        if key in item:
            flush_list.append(item)
    for item in flush_list:
        del cache[item]
1150657
def _update_key(self, mask, key):
        
        mask = np.asanyarray(mask)
        if key in self._data:
            self._data[key] = self._data[key][mask]
433860
def update(self, key, value=None, dir=False, ttl=None, refresh=False,
               prev_value=None, prev_index=None, timeout=None):
        """"""
        return self.adapter.set(key, value, dir=dir, ttl=ttl, refresh=refresh,
                                prev_value=prev_value, prev_index=prev_index,
                                prev_exist=True, timeout=timeout)
1076029
def _update_keycache(self, *args, forward):
        """"""
        entity, key, branch, turn, tick, value = args[-6:]
        parent = args[:-6]
        kc = self._get_keycache(parent + (entity,), branch, turn, tick, forward=forward)
        if value is None:
            kc = kc.difference((key,))
        else:
            kc = kc.union((key,))
        self.keycache[parent+(entity, branch)][turn][tick] = kc
1272217
def hash_key(*args, **kwargs):
    """"""

    if kwargs:
        return cachetools.keys._HashedTuple(args + _kwargs_mark + tuple(itertools.chain(sorted(kwargs.items()))))
    else:
        return cachetools.keys._HashedTuple(args)
1181119
def _update_cache(self):
        "  "
        expected_version = (self.registry._version, self._extra_registry._version)

        if self._last_version != expected_version:
            registry2 = Registry()

            # Copy all bindings from `self.registry`, adding our condition.
            for reg in (self.registry, self._extra_registry):
                for b in reg.key_bindings:
                    registry2.key_bindings.append(
                        _Binding(
                            keys=b.keys,
                            handler=b.handler,
                            filter=self.filter & b.filter,
                            eager=b.eager,
                            save_before=b.save_before))

            self._registry2 = registry2
            self._last_version = expected_version
686628
private void updateCacheState(Map<String, Object> props) {
        getAuthenticationConfig(props);

        if (cacheEnabled) {
            authCacheServiceRef.activate(cc);
        } else {
            authCacheServiceRef.deactivate(cc);
        }
    }
759392
private void loadAllAndKeepExisting(Set<? extends K> keys) {
    List<K> keysToLoad = keys.stream()
        .filter(key -> !cache.asMap().containsKey(key))
        .collect(toList());
    Map<K, V> result = cacheLoader.get().loadAll(keysToLoad);
    for (Map.Entry<K, V> entry : result.entrySet()) {
      if ((entry.getKey() != null) && (entry.getValue() != null)) {
        putIfAbsentNoAwait(entry.getKey(), entry.getValue(), /* publishToWriter */ false);
      }
    }
  }
751999
def update(self, other_dict):
        """"""
        for key, value in iter_multi_items(other_dict):
            MultiDict.add(self, key, value)
1084557
public final void updateKey(String key) throws IOException {
    Objects.requireNonNull(key, "old key required");
    if (index.containsKey(key)) {
      MtasSolrStatus status = index.get(key);
      index.remove(key);
      if (!index.containsKey(status.key())) {
        index.put(status.key(), status);
      } else {
        throw new IOException("key already exists");
      }
    }
  }
129231
def _apply_cached_indexes(self, cached_indexes, persist=False):
        """"""
        # cacheable_dict = {}
        for elt in ['valid_input_index', 'valid_output_index',
                    'index_array', 'distance_array']:
            val = cached_indexes[elt]
            if isinstance(val, tuple):
                val = cached_indexes[elt][0]
            elif isinstance(val, np.ndarray):
                val = da.from_array(val, chunks=CHUNK_SIZE)
            elif persist and isinstance(val, da.Array):
                cached_indexes[elt] = val = val.persist()
            setattr(self.resampler, elt, val)
20016
def refresh(self):
        
        self.client.indices.refresh(index=self.model.search_objects.mapping.index)
1247563
def set(self, key, response):
        """"""
        mod = response.headers.pop('last-modified', None)
        status = int(response.status_code)
        rec = (key, status, mod, response.encoding, response.content,
               json.dumps(dict(response.headers)))
        with self._conn:
            self._conn.execute("DELETE FROM cache WHERE key=?", (key, ))
            self._conn.execute("INSERT INTO cache VALUES (?,?,?,?,?,?)", rec)
151925
async def _replace(self, key: Text, data: Dict[Text, Any]) -> None:
        

        with await self.pool as r:
            await r.set(self.register_key(key), ujson.dumps(data))