Returns the A2 value defined in II.8 (Table 3)
962851
def _get_a2_value(bbar, dbar, slip, beta, mmax):
        
        return ((dbar - bbar) / bbar) * (slip / beta) *\
            np.exp(-(dbar / 2.) * mmax)
389684
private int readCorner2(int numRows, int numColumns) {
    int currentByte = 0;
    if (readModule(numRows - 3, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 2, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 1, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 4, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 3, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 2, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(1, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    return currentByte;
  }
318846
public int getValue(int c, int column) {
        if (isCompacted || c < 0 || c > MAX_CP || column < 0
                || column >= (columns - 2)) {
            return 0;
        }
        int index = findRow(c);
        return v[index + 2 + column];
    }
1315923
function inc (value, step, mult) {
	mult = mult || 0;

	var isArr = isArray(value);
	value = plainify(value);

	if (isFn(step)) step = step(value + (mult > 0 ? + MIN_STEP : - MIN_STEP));

	value += step * mult;

	return isArr ? [value] : value;
}
771954
def _f_A20(self, r_a, r_s):
        
        return r_a/(1+np.sqrt(1 + r_a**2)) - r_s/(1+np.sqrt(1 + r_s**2))
301685
function(table) {
    var rows = 0;
    var columns = 0;
    var trs = table.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
      var rowspan = trs[i].getAttribute("rowspan") || 0;
      if (rowspan) {
        rowspan = parseInt(rowspan, 10);
      }
      rows += (rowspan || 1);

      // Now look for column-related info
      var columnsInThisRow = 0;
      var cells = trs[i].getElementsByTagName("td");
      for (var j = 0; j < cells.length; j++) {
        var colspan = cells[j].getAttribute("colspan") || 0;
        if (colspan) {
          colspan = parseInt(colspan, 10);
        }
        columnsInThisRow += (colspan || 1);
      }
      columns = Math.max(columns, columnsInThisRow);
    }
    return {rows: rows, columns: columns};
  }
428380
def a2s(a):
    
    s = np.zeros((6,), 'f')  # make the a matrix
    for i in range(3):
        s[i] = a[i][i]
    s[3] = a[0][1]
    s[4] = a[1][2]
    s[5] = a[0][2]
    return s
663528
def _handleLookupType2Format2(subtable, lookupIndex, subtableIndex):
    
    # extract the classes
    leftClasses = _extractFeatureClasses(lookupIndex=lookupIndex, subtableIndex=subtableIndex, classDefs=subtable.ClassDef1.classDefs, coverage=subtable.Coverage.glyphs)
    rightClasses = _extractFeatureClasses(lookupIndex=lookupIndex, subtableIndex=subtableIndex, classDefs=subtable.ClassDef2.classDefs)
    # extract the pairs
    kerning = {}
    for class1RecordIndex, class1Record in enumerate(subtable.Class1Record):
        for class2RecordIndex, class2Record in enumerate(class1Record.Class2Record):
            leftClass = (lookupIndex, subtableIndex, class1RecordIndex)
            rightClass = (lookupIndex, subtableIndex, class2RecordIndex)
            valueFormat1 = subtable.ValueFormat1
            if valueFormat1:
                value = class2Record.Value1
            else:
                value = class2Record.Value2
            if hasattr(value, "XAdvance") and value.XAdvance != 0:
                value = value.XAdvance
                kerning[leftClass, rightClass] = value
    return kerning, leftClasses, rightClasses
1246791
function C(iid, left) {
        var aret;
        if (sandbox.analysis && sandbox.analysis.conditional) {
            aret = sandbox.analysis.conditional(iid, left);
            if (aret) {
                left = aret.result;
            }
        }

        lastVal = left;
        return (lastComputedValue = left);
    }
1179003
void radb2(final int ido, final int l1, final double in[], final int in_off, final double out[], final int out_off, final int offset) {
		int i, ic;
		double t1i, t1r, w1r, w1i;
		int iw1 = offset;

		int idx0 = l1 * ido;
		for (int k = 0; k < l1; k++) {
			int idx1 = k * ido;
			int idx2 = 2 * idx1;
			int idx3 = idx2 + ido;
			int oidx1 = out_off + idx1;
			int iidx1 = in_off + idx2;
			int iidx2 = in_off + ido - 1 + idx3;
			double i1r = in[iidx1];
			double i2r = in[iidx2];
			out[oidx1] = i1r + i2r;
			out[oidx1 + idx0] = i1r - i2r;
		}
		if (ido < 2)
			return;
		if (ido != 2) {
			for (int k = 0; k < l1; ++k) {
				int idx1 = k * ido;
				int idx2 = 2 * idx1;
				int idx3 = idx2 + ido;
				int idx4 = idx1 + idx0;
				for (i = 2; i < ido; i += 2) {
					ic = ido - i;
					int idx5 = i - 1 + iw1;
					int idx6 = out_off + i;
					int idx7 = in_off + i;
					int idx8 = in_off + ic;
					w1r = wtable_r[idx5 - 1];
					w1i = wtable_r[idx5];
					int iidx1 = idx7 + idx2;
					int iidx2 = idx8 + idx3;
					int oidx1 = idx6 + idx1;
					int oidx2 = idx6 + idx4;
					t1r = in[iidx1 - 1] - in[iidx2 - 1];
					t1i = in[iidx1] + in[iidx2];
					double i1i = in[iidx1];
					double i1r = in[iidx1 - 1];
					double i2i = in[iidx2];
					double i2r = in[iidx2 - 1];

					out[oidx1 - 1] = i1r + i2r;
					out[oidx1] = i1i - i2i;
					out[oidx2 - 1] = w1r * t1r - w1i * t1i;
					out[oidx2] = w1r * t1i + w1i * t1r;
				}
			}
			if (ido % 2 == 1)
				return;
		}
		for (int k = 0; k < l1; k++) {
			int idx1 = k * ido;
			int idx2 = 2 * idx1;
			int oidx1 = out_off + ido - 1 + idx1;
			int iidx1 = in_off + idx2 + ido;
			out[oidx1] = 2 * in[iidx1 - 1];
			out[oidx1 + idx0] = -2 * in[iidx1];
		}
	}
993300
def _get_decimal128(data, position, dummy0, dummy1, dummy2):
    """"""
    end = position + 16
    return Decimal128.from_bid(data[position:end]), end
53527
public double fBeta(double beta, EvaluationAveraging averaging) {
        if(getNumRowCounter() == 0.0){
            return Double.NaN;  //No data
        }
        int nClasses = confusion().getClasses().size();

        if (nClasses == 2) {
            return EvaluationUtils.fBeta(beta, (long) truePositives.getCount(1), (long) falsePositives.getCount(1),
                            (long) falseNegatives.getCount(1));
        }

        if (averaging == EvaluationAveraging.Macro) {
            double macroFBeta = 0.0;
            int count = 0;
            for (int i = 0; i < nClasses; i++) {
                double thisFBeta = fBeta(beta, i, -1);
                if (thisFBeta != -1) {
                    macroFBeta += thisFBeta;
                    count++;
                }
            }
            macroFBeta /= count;
            return macroFBeta;
        } else if (averaging == EvaluationAveraging.Micro) {
            long tpCount = 0;
            long fpCount = 0;
            long fnCount = 0;
            for (int i = 0; i < nClasses; i++) {
                tpCount += truePositives.getCount(i);
                fpCount += falsePositives.getCount(i);
                fnCount += falseNegatives.getCount(i);
            }
            return EvaluationUtils.fBeta(beta, tpCount, fpCount, fnCount);
        } else {
            throw new UnsupportedOperationException("Unknown averaging approach: " + averaging);
        }
    }
958978
private String arith(){

        if(params.length != 3){
            throw new IllegalArgumentException("Wrong number of Parameters for arithmetic expression");
        }

        double res = 0;
        try{
            String operator = params[2];

            double firstValue = Double.parseDouble(record.getValueByFieldName(params[0]));

            double secondValue = Double.parseDouble(record.getValueByFieldName(params[1]));


            if("+".equals(operator)){
                res = firstValue + secondValue;
            }else if("-".equals(operator)){
                res = firstValue - secondValue;
            }else if("*".equals(operator)){
                res = firstValue * secondValue;
            }else if("/".equals(operator)){
                res = firstValue / secondValue;
            }else if("%".equals(operator)){
                res = (firstValue / secondValue) * 100;
            }

            NumberFormat decimalFormat = NumberFormat.getFormat(".##");
            res = Double.parseDouble(decimalFormat.format(res));
        }catch(Exception e){
            System.err.println("Error calculating table arithmetic function");
        }
        return Double.toString(res);

    }
888467
private int ssMedian3(int Td, int PA, int v1, int v2, int v3) {
        if (T[start + Td + SA[PA + SA[v1]]] > T[start + Td + SA[PA + SA[v2]]]) {
            int t = v1;
            v1 = v2;
            v2 = t;
        }
        if (T[start + Td + SA[PA + SA[v2]]] > T[start + Td + SA[PA + SA[v3]]]) {
            if (T[start + Td + SA[PA + SA[v1]]] > T[start + Td + SA[PA + SA[v3]]]) {
                return v1;
            } else {
                return v3;
            }
        }
        return v2;
    }
313439
def table_abcd():
    """"""
    table_instance = SingleTable([['A', 'B'], ['C', 'D']])

    # Get first table lines.
    table_instance.outer_border = False
    table_inner_borders = table_instance.table.splitlines()

    # Get second table lines.
    table_instance.outer_border = True
    table_instance.inner_heading_row_border = False
    table_instance.inner_column_border = False
    table_outer_borders = table_instance.table.splitlines()

    # Combine.
    smallest, largest = sorted([table_inner_borders, table_outer_borders], key=len)
    smallest += [''] * (len(largest) - len(smallest))  # Make both same size.
    combined = list()
    for i, row in enumerate(largest):
        combined.append(row.ljust(10) + '          ' + smallest[i])
    return '\n'.join(combined)
654042
def get_change_type(self, ref, a1, a2):
        
        if ref == '.':
            return self.INSERTION
        elif a1 == '.' or a2 == '.':
            return self.DELETION
710411
def n2s(self, offset, length):
        """"""
        s = ''
        for dummy in range(length):
            if self.endian == 'I':
                s += chr(offset & 0xFF)
            else:
                s = chr(offset & 0xFF) + s
            offset = offset >> 8
        return s