factor: relative length (1->no change, 2-> double, 0.5:half)
1029
def resize(line, factor):
    
    a = angle(line)
    mx, my = middle(line)
    d = length(line) * factor * 0.5
    dx = cos(a) * d
    dy = sin(a) * d
    return mx - dx, my - dy, mx + dx, my + dy
1139667
def waveform_length(X):
    '''  '''
    return np.sum(np.abs(np.diff(X, axis=1)), axis=1)
411808
def obfn_dfd(self):
        
        """

        return 0.5*np.linalg.norm((self.D.dot(self.obfn_fvar()) - self.S))**2
1220427
def length(self, t0=0, t1=1, error=LENGTH_ERROR, min_depth=LENGTH_MIN_DEPTH):
        """"""
        assert 0 <= t0 <= 1 and 0 <= t1 <= 1
        if _quad_available:
            return quad(lambda tau: abs(self.derivative(tau)), t0, t1,
                        epsabs=error, limit=1000)[0]
        else:
            return segment_length(self, t0, t1, self.point(t0), self.point(t1),
                                  error, min_depth, 0)
196608
def length(self):
        """"""
        return math.sqrt((self.x * self.x) + (self.y * self.y) + (self.z * self.z) + (self.w * self.w))
924519
def time_coef(tc, nc, tb, nb):
    
    tc = float(tc)
    nc = float(nc)
    tb = float(tb)
    nb = float(nb)
    q = (tc * nb) / (tb * nc)
    return q
250031
function numToIndexableString(num) {

  if (num === 0) {
    return '1';
  }

  // convert number to exponential format for easier and
  // more succinct string sorting
  var expFormat = num.toExponential().split(/e\+?/);
  var magnitude = parseInt(expFormat[1], 10);

  var neg = num < 0;

  var result = neg ? '0' : '2';

  // first sort by magnitude
  // it's easier if all magnitudes are positive
  var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE);
  var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS);

  result += SEP + magString;

  // then sort by the factor
  var factor = Math.abs(parseFloat(expFormat[0])); // [1..10)
  /* istanbul ignore next */
  if (neg) { // for negative reverse ordering
    factor = 10 - factor;
  }

  var factorStr = factor.toFixed(20);

  // strip zeros from the end
  factorStr = factorStr.replace(/\.?0+$/, '');

  result += SEP + factorStr;

  return result;
}
383567
def autocorr_coeff(x, t, tau1, tau2):
    """"""
    return corr_coeff(x, x, t, tau1, tau2)
60121
def length(self):
        """"""
        length = self.parse['attributes'].get('Shape_Length')
        if length:
            return round(float(length))
1275451
def _value_length(self, value, t):
        """"""

        if isinstance(value, int):
            fmt = '<%s' % (type_codes[t])
            output = struct.pack(fmt, value)
            return len(output)
        elif isinstance(value, str):
            return len(value) + 1  # Account for final 0

        len_accum = 0
        for x in value:
            len_accum += self._value_length(x, t)

        return len_accum
982399
private int calcTZeroDepth(int proposedK)
    {
        int d = -1;
        if ( (proposedK >= 0) && (proposedK < _t0_d.length) )
            d = _t0_d[proposedK];
        if (d < 0)
        {
            String x =
            "K Factor (" + proposedK + ") is invalid.\n" +
            "Valid K factors are: " + kFactorString() + ".";
            throw new IllegalArgumentException(x);
        }
        return d;
    }
658412
def **(x)
      check_operable
      m = Utils.as_numeric(x)
      dims = dimension_uop{|a| a*m}
      Unit.new(@factor**m,dims)
    end
378480
public void setFactor(int factor) {
        this.factor = factor = Math.max(-127, Math.min(127, factor));

        if (factor > 1) {
            baseFilter.setInRed(new IntRange(factor, 255 - factor));
            baseFilter.setInGreen(new IntRange(factor, 255 - factor));
            baseFilter.setInBlue(new IntRange(factor, 255 - factor));
            baseFilter.setInGray(new IntRange(factor, 255 - factor));

            baseFilter.setOutRed(new IntRange(0, 255));
            baseFilter.setOutGreen(new IntRange(0, 255));
            baseFilter.setOutBlue(new IntRange(0, 255));
            baseFilter.setOutGray(new IntRange(0, 255));
        } else {
            baseFilter.setInRed(new IntRange(-factor, 255 + factor));
            baseFilter.setInGreen(new IntRange(-factor, 255 + factor));
            baseFilter.setInBlue(new IntRange(-factor, 255 + factor));
            baseFilter.setInGray(new IntRange(-factor, 255 + factor));

            baseFilter.setOutRed(new IntRange(0, 255));
            baseFilter.setOutGreen(new IntRange(0, 255));
            baseFilter.setOutBlue(new IntRange(0, 255));
            baseFilter.setOutGray(new IntRange(0, 255));
        }
    }
1292416
def get_t_factor(t1, t2):
    
    t_factor = None
    if t1 is not None and t2 is not None and t1 != t2:  
        dt = t2 - t1
        year = timedelta(days=365.25)
        t_factor = abs(dt.total_seconds() / year.total_seconds()) 
    return t_factor
1293121
def _doublec(self, word):
        """"""
        if len(word) < 2:
            return False
        if (word[-1] != word[-2]):
            return False
        return self._cons(word, len(word)-1)
1328851
function lengthOfNumber(number) {
        if (isNumber(number)) {
            var length_1 = 0;
            while (number > 0) {
                length_1++;
                number = backIntegerOfNumber(number / 10);
            }
            return length_1;
        }
        else {
            return 0;
        }
    }
1054809
def __separate_scalar_factor(monomial):
    
    scalar_factor = 1
    if is_number_type(monomial):
        return S.One, monomial
    if monomial == 0:
        return S.One, 0
    comm_factors, _ = split_commutative_parts(monomial)
    if len(comm_factors) > 0:
        if isinstance(comm_factors[0], Number):
            scalar_factor = comm_factors[0]
    if scalar_factor != 1:
        return monomial / scalar_factor, scalar_factor
    else:
        return monomial, scalar_factor