Cache the coinbase address so that we don't make two requests for every
        single transaction.
505176
def default_from_address(self):
        
        if self._coinbase_cache_til is not None:
            if time.time - self._coinbase_cache_til > 30:
                self._coinbase_cache_til = None
                self._coinbase_cache = None

        if self._coinbase_cache is None:
            self._coinbase_cache = self.get_coinbase()

        return self._coinbase_cache
482951
def reset(self, addresses):
        
        request = self._call(SetEnqueueResetReverseDns.SetEnqueueResetReverseDns, IPs=addresses)
        response = request.commit()
        return response['Success']
1066877
private static void addCacheInfoUpdate(CacheStatus cacheStatus) {
    long cacheSize = cacheStatus.size;
    synchronized (baseDirSize) {
      Long dirSize = baseDirSize.get(cacheStatus.getBaseDir());
      if( dirSize == null ) {
        dirSize = Long.valueOf(cacheSize);
      } else {
        dirSize += cacheSize;
      }
      baseDirSize.put(cacheStatus.getBaseDir(), dirSize);
    }
    synchronized (baseDirNumberSubDir) {
      Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir());
      if( dirSubDir == null ) {
        dirSubDir = 1;
      } else {
        dirSubDir += 1;
      }
      baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir);
    }
  }
52376
def clear_cache():
        """"""
        del Cache._keys
        for k in list(Cache._cache.keys()):
            it = Cache._cache.pop(k)
            del it
        del Cache._cache
        Cache._keys = []
        Cache._cache = {}
        gc.collect()
766527
def spendables_for_address(self, address):
        
        spendables = []
        r = json.loads(urlopen(self.base_url('get_tx_unspent', address)).read().decode("utf8"))

        for u in r['data']['txs']:
            coin_value = int(float(u['value']) * 100000000)
            script = h2b(u["script_hex"])
            previous_hash = h2b_rev(u["txid"])
            previous_index = u["output_no"]
            spendables.append(Tx.Spendable(coin_value, script, previous_hash, previous_index))

        return spendables
1020110
def clear_cache(ip=None):
    """"""
    if ip:
        with ignored(Exception):
            client = CLIENT_CACHE[ip]
            del CLIENT_CACHE[ip]
            client.close()
    else:
        for client in CLIENT_CACHE.values():
            with ignored(Exception):
                client.close()
        CLIENT_CACHE.clear()
604044
def cleanup(self):
        """"""
        self.num_puts = 0
        cached = []
        for i, url_data in enumerate(self.queue):
            key = url_data.cache_url
            cache = url_data.aggregate.result_cache
            if cache.has_result(key):
                cached.append(i)
        for pos in cached:
            self._move_to_top(pos)
1234300
def spendables_for_address(self, address):
        
        URL = "%s/addr/%s/utxo" % (self.base_url, address)
        r = json.loads(urlopen(URL).read().decode("utf8"))
        spendables = []
        for u in r:
            coin_value = btc_to_satoshi(str(u.get("amount")))
            script = h2b(u.get("scriptPubKey"))
            previous_hash = h2b_rev(u.get("txid"))
            previous_index = u.get("vout")
            spendables.append(Tx.Spendable(coin_value, script, previous_hash, previous_index))
        return spendables
807689
function( address, bank, size ) {
		var offset = bank * size,
			bankData = this.prgData.subarray( offset, offset + size );

		this.prgRead.set( bankData, address - 0x8000 );
	}
1106984
def enable_caching(self):
        ""
        self.caching_enabled = True
        for c in self.values():
            c.enable_cacher()
635107
final void cache(String hostname, E value, int ttl, EventLoop loop) {
        Entries entries = resolveCache.get(hostname);
        if (entries == null) {
            entries = new Entries(hostname);
            Entries oldEntries = resolveCache.putIfAbsent(hostname, entries);
            if (oldEntries != null) {
                entries = oldEntries;
            }
        }
        entries.add(value, ttl, loop);
    }
990365
def _cached_request(self, base_url, client_id, client_secret,
                        parameters, **kwargs):
        """"""
        key = (base_url, client_id, tuple(parameters.items()))
        cached = self._cache.get(key, {})

        if not cached.get('access_token') or self._expired(cached):
            cached = yield self._request(base_url, client_id, client_secret,
                                         parameters, **kwargs)
            self._cache[key] = cached
            # Purge cache when adding a new item so it doesn't grow too large
            # It's assumed the cache size is small enough that it's OK to loop
            # over the whole cache regularly. If not, could change this to
            # just pop off the oldest one
            self.purge_cache()

        logging.debug('Using a cached token: %s', cached.get('access_token'))
        raise Return(cached)
448679
public Response noCache() {
        checkCommitted();

        // no-cache headers for HTTP/1.1
        header(HttpConstants.Header.CACHE_CONTROL, "no-store, no-cache, must-revalidate");

        // no-cache headers for HTTP/1.1 (IE)
        header(HttpConstants.Header.CACHE_CONTROL, "post-check=0, pre-check=0");

        // no-cache headers for HTTP/1.0
        header(HttpConstants.Header.PRAGMA, "no-cache");

        // set the expires to past
        httpServletResponse.setDateHeader("Expires", 0);

        return this;
    }
525449
def reset(self):
        
        self._request = None
        self._response = None
        self._transaction_id = uuid.uuid4().hex
662165
protected function prepareCacheStore()
    {
        if ($this->retrieve('expires') != $this->throttle->getExpires()) {
            $this->forget('requests');
            $this->forget('expires');
            $this->forget('reset');
        }
    }
237870
private void forgetTransaction(GlobalTransaction gtx, RpcManager rpcManager, CommandsFactory factory) {
      TxCompletionNotificationCommand cmd = factory.buildTxCompletionNotificationCommand(xid, gtx);
      rpcManager.sendToAll(cmd, DeliverOrder.NONE);
      perCacheTxTable.removeLocalTx(xid);
      globalTxTable.remove(cacheXid);
   }
1209868
@Override
	public void clearCache() {
		entityCache.clearCache(CommerceTaxFixedRateAddressRelImpl.class);

		finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}