Formula for computing the current backoff

        :rtype: float
196791
def get_backoff_time(self):
        
        # We want to consider only the last consecutive errors sequence (Ignore redirects).
        consecutive_errors_len = len(list(takewhile(lambda x: x.redirect_location is None,
                                                    reversed(self.history))))
        if consecutive_errors_len <= 1:
            return 0

        backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1))
        return min(self.BACKOFF_MAX, backoff_value)
979994
public static int cudnnActivationBackward(
        cudnnHandle handle, 
        cudnnActivationDescriptor activationDesc, 
        Pointer alpha, 
        cudnnTensorDescriptor yDesc, 
        Pointer y, 
        cudnnTensorDescriptor dyDesc, 
        Pointer dy, 
        cudnnTensorDescriptor xDesc, 
        Pointer x, 
        Pointer beta, 
        cudnnTensorDescriptor dxDesc, 
        Pointer dx)
    {
        return checkResult(cudnnActivationBackwardNative(handle, activationDesc, alpha, yDesc, y, dyDesc, dy, xDesc, x, beta, dxDesc, dx));
    }
228250
def truncated_exponential_backoff(
    slot_delay, collision=0, max_collisions=5,
    op=operator.mul, in_range=True):
    
    truncated_collision = collision % max_collisions
    if in_range:
        slots = random.randint(0, truncated_collision)
    else:
        slots = truncated_collision
    return op(slot_delay, slots)
822751
def main(self, x):
        
        self.acc[0] = x * self.TAPS[-1]
        for i in range(1, len(self.acc)):
            self.acc[i] = self.acc[i - 1] + x * self.TAPS[len(self.TAPS) - 1 - i]

        self.out = self.acc[-1]
        return self.out
941388
def canGoBack(self):
        
        try:
            backId = self._navigation.index(self.currentId())-1
            if backId >= 0:
                self._navigation[backId]
            else:
                return False
        except StandardError:
            return False
        else:
            return True
805756
def _symm_current(C):
    """"""
    nans = np.isnan(C)
    C[nans] = np.einsum('klij', C)[nans]
    return C
270525
def advance(self, dt_msec):
        
        # TODO: Make the time step adjustable, and choose an appropriate
        # numerical integration method to maintain stability.
        # TODO: The need to catch overflows indicates that the current method is
        # not stable for all possible network configurations and states.
        try:
            self.v += 0.5 * dt_msec * (0.04 * self.v ** 2 + 5 * self.v + 140 - self.u + self.current)
            self.v += 0.5 * dt_msec * (0.04 * self.v ** 2 + 5 * self.v + 140 - self.u + self.current)
            self.u += dt_msec * self.a * (self.b * self.v - self.u)
        except OverflowError:
            # Reset without producing a spike.
            self.v = self.c
            self.u = self.b * self.v

        self.fired = 0.0
        if self.v > 30.0:
            # Output spike and reset.
            self.fired = 1.0
            self.v = self.c
            self.u += self.d
2754
def ACC_calc(TP, TN, FP, FN):
    
    try:
        result = (TP + TN) / (TP + TN + FN + FP)
        return result
    except ZeroDivisionError:
        return "None"
544019
def checkback ( tmp, len ) # :nodoc:
      if len > 0 then
	i = len
	len.times do
	  i = i - 1
	  return i if cmp( tmp, i )
	end
      end
      return -1
    end
219960
def rate(self):
        """"""
        return float(self._eta.rate_unstable if self.eta_every > 1 else self._eta.rate)
934875
def getTopLeft(self):
        
        return (float(self.get_cx()) - float(self.get_r()), float(self.get_cy()) + float(self.get_r()))
646914
public long backoff(int attempt) {
    long duration = base * (long) Math.pow(factor, attempt);
    if (jitter != 0) {
      double random = Math.random();
      int deviation = (int) Math.floor(random * jitter * duration);
      if ((((int) Math.floor(random * 10)) & 1) == 0) {
        duration = duration - deviation;
      } else {
        duration = duration + deviation;
      }
    }
    if (duration < 0) {
      duration = Long.MAX_VALUE;
    }
    return Math.min(Math.max(duration, base), cap);
  }
536047
def standard_backtrack(self):
        

        gradY = self.eval_grad()  # Given Y(f), this updates computes gradY(f)

        maxiter = self.L_maxiter

        iterBTrack = 0
        linesearch = 1
        while linesearch and iterBTrack < maxiter:

            self.proximal_step(gradY)  # Given gradY(f), L, this updates X(f)

            f = self.obfn_f(self.var_x())
            Dxy = self.eval_Dxy()
            Q = self.obfn_f(self.var_y()) + \
                self.eval_linear_approx(Dxy, gradY) + \
                (self.L / 2.) * np.linalg.norm(Dxy.flatten(), 2)**2

            if f <= Q:
                linesearch = 0
            else:
                self.L *= self.L_gamma_u

            iterBTrack += 1

        self.F = f
        self.Q = Q
        self.iterBTrack = iterBTrack
        # Update auxiliary sequence
        self.combination_step()
827208
function isOff () {
  debug('check if turned off')

  return this.getCurrentActivity()
    .then(function (activityId) {
      var off = (activityId === '-1')
      debug(off ? 'system is currently off' : 'system is currently on with activity ' + activityId)

      return off
    })
}
690113
def getChargingCurrent(self):
    """"""
    command = '$GG'
    currentAndVoltage = self.sendCommand(command)
    amps = float(currentAndVoltage[1])/1000
    return amps
193206
def backward(self, y):
        
        if self.squeeze:
            y = y[None, :, :]
        ind = np.tril_indices(self.N)
        return np.vstack([y_i[ind] for y_i in y])
918482
def prob_correction(self, f=1):
        
        total = {'rockyou': 32602160}
        return f * self._T[TOTALF_W] / total.get(self._leak, self._T[TOTALF_W])