Fills bucket with accrued tokens since last fill.
420988
def _fill(self):
        """"""

        right_now = time.time()
        time_diff = right_now - self._last_fill
        if time_diff < 0:
            return

        self._count = min(
            self._count + self._fill_rate * time_diff,
            self._capacity,
        )
        self._last_fill = right_now
536572
private void setLastCompleted(long lastCompleted) {
    if (!log.isOpen())
      return;

    this.lastCompleted = Math.max(this.lastCompleted, lastCompleted);

    // Update the log compaction minor index.
    log.compactor().minorIndex(this.lastCompleted);

    completeSnapshot();
  }
322411
protected void accumulatePersistedNodesChanges(Map<String, Long> calculatedChangedNodesSize)
      throws QuotaManagerException
   {
      for (Entry<String, Long> entry : calculatedChangedNodesSize.entrySet())
      {
         String nodePath = entry.getKey();
         long delta = entry.getValue();

         try
         {
            long dataSize = delta + quotaPersister.getNodeDataSize(rName, wsName, nodePath);
            quotaPersister.setNodeDataSizeIfQuotaExists(rName, wsName, nodePath, dataSize);
         }
         catch (UnknownDataSizeException e)
         {
            calculateNodeDataSizeTool.getAndSetNodeDataSize(nodePath);
         }
      }
   }
964207
private function fill() {

        //Prefill value
        if(true === $this -> filled) {

            if(true === isset($this -> attributes['name'])) {

                if(true === Request :: isPost()) {
                    $this -> attributes['value'] = Request :: fromPost($this -> attributes['name']);
                }
            }
        }
    }
629083
private void expandAndRehash() {
    final int[] newHashSet = new int[hashSet.length * 2];
    final int bucketMask = (newHashSet.length - 1);

    for (int j = 0; j < hashSet.length; j++) {
      final int state = hashSet[j];
      if (state > 0) {
        int slot = hash(state, stateLength(state)) & bucketMask;
        for (int i = 0; newHashSet[slot] > 0;) {
          slot = (slot + (++i)) & bucketMask;
        }
        newHashSet[slot] = state;
      }
    }
    this.hashSet = newHashSet;
  }
475167
def _fill(self):
    """"""
    try:
      self._head = self._iterable.next()
    except StopIteration:
      self._head = None
54834
protected function fillIfNotFilled()
    {
        if (!$this->lazyLoad || $this->lazyLoaded || !$this->repository) {
            return;
        }

        $this->repository->fill($this, $this->lazyLoadAttributes);

        $this->lazyLoaded = true;
    }
620300
def _prepare_reserved_tokens(reserved_tokens):
  """"""
  reserved_tokens = [tf.compat.as_text(tok) for tok in reserved_tokens or []]
  dups = _find_duplicates(reserved_tokens)
  if dups:
    raise ValueError("Duplicates found in tokens: %s" % dups)
  reserved_tokens_re = _make_reserved_tokens_re(reserved_tokens)
  return reserved_tokens, reserved_tokens_re
780626
protected void rolling() {
        synchronized (this) {
            if (unflushed != null) {
                buckets.put(currBucketTime, unflushed);
                unflushed = null;
            }

            currBucketTime = getCurrBucketTime();

            return;
        }
    }
18855
function(T, SA, C, B, n, k) {
        var b, i, j;
        var c0, c1;
        /* compute SAl */
        if (C === B) { getCounts(T, C, n, k); }
        getBuckets(C, B, k, false); /* find starts of buckets */
        j = n - 1;
        b = B[c1 = T[j]];
        j--;
        SA[b++] = (T[j] < c1) ? ~j : j;
        for (i = 0; i < n; i++) {
            if ((j = SA[i]) > 0) {
                ASSERT(T[j] >= T[j+1]);
                if ((c0 = T[j]) !== c1) { B[c1] = b; b = B[c1 = c0]; }
                ASSERT(i < b);
                j--;
                SA[b++] = (T[j] < c1) ? ~j : j;
                SA[i] = 0;
            } else if (j < 0) {
                SA[i] = ~j;
            }
        }
        /* compute SAs */
        if (C === B) { getCounts(T, C, n, k); }
        getBuckets(C, B, k, 1); /* find ends of buckets */
        for (i = n-1, b = B[c1 = 0]; i >= 0; i--) {
            if ((j = SA[i]) > 0) {
                ASSERT(T[j] <= T[j+1]);
                if ((c0 = T[j]) !== c1) { B[c1] = b; b = B[c1 = c0]; }
                ASSERT(b <= i);
                j--;
                SA[--b] = (T[j] > c1) ? ~(j+1) : j;
                SA[i] = 0;
            }
        }
    }
1156464
public synchronized void refill(long numTokens)
  {
    long newTokens = Math.min(capacity, Math.max(0, numTokens));
    size = Math.max(0, Math.min(size + newTokens, capacity));
  }
1192743
function harvest() {
  var q = "DELETE FROM tokens WHERE expires_at < now() AT TIME ZONE 'UTC'";
  db.getClient(function(err, client, done) {
    client.query(q, function(err) {
      if(err) {
        console.error(new Date);
        console.error(err.stack);
      }
      done(err);
    });
  });
}
28806
def lonely_buckets(self):
        
        hrago = time.monotonic() - 3600
        return [b for b in self.buckets if b.last_updated < hrago]
837342
def fetch_deposits_since(self, since: int) -> List[Deposit]:
        """"""
        return self._transactions_since(self._deposits_since, 'deposits', since)
1292796
def handle_sd_sm(tokens, options)
      new_tokens = [tokens[1], tokens[0]]
      time_tokens = tokens.last(tokens.size - 2)
      handle_sm_sd(new_tokens + time_tokens, options)
    end
1320063
private function fill()
    {
        foreach ($this->attributes as $key => $value) {
            $key = $this->camelCase($key);

            $this->{$key} = $value;
        }
    }
1055743
function(tokens) {
      tokensObj = tokens;

      if (tokens === null) {
        storage.remove(tokensKey);
      } else {
        storage.set(tokensKey, tokens);
      }
    }