Compute htm index of htm_level at position ra,dec
770728
def htmIndex(ra,dec,htm_level=3):
    """"""
    import re
    if os.uname()[0] == "Linux": javabin = '/opt/java2/bin/java '
    htm_level = htm_level
    verc_htm_cmd = javabin+'-classpath /usr/cadc/misc/htm/htmIndex.jar edu.jhu.htm.app.lookup %s %s %s' % (htm_level, ra, dec)

    for result in os.popen( verc_htm_cmd ).readlines():
        result = result[:-1]
        if re.search("ID/Name cc", result):
            (void, coord ) = result.split("=")
            (void, junk, htm_index) = coord.split(" ")
            return htm_index
158110
function findElementIndex(tableData, rowIndex, colIndex) {
  const cellData = tableData[rowIndex][colIndex];

  rowIndex = util.isExisty(cellData.rowMergeWith) ? cellData.rowMergeWith : rowIndex;
  colIndex = util.isExisty(cellData.colMergeWith) ? cellData.colMergeWith : colIndex;

  return tableData[rowIndex][colIndex].elementIndex;
}
661729
function indexOfNode (host, node) {
  const chs = host.childNodes;
  const chsLen = chs.length;
  for (let a = 0; a < chsLen; a++) {
    if (chs[a] === node) {
      return a;
    }
  }
  return -1;
}
705231
def arrays_to_mgr(arrays, arr_names, index, columns, dtype=None):
    
    # figure out the index, if necessary
    if index is None:
        index = extract_index(arrays)
    else:
        index = ensure_index(index)

    # don't force copy because getting jammed in an ndarray anyway
    arrays = _homogenize(arrays, index, dtype)

    # from BlockManager perspective
    axes = [ensure_index(columns), index]

    return create_block_manager_from_arrays(arrays, arr_names, axes)
56400
def _compute_dlt(self):
        """"""
        res = super()._compute_dlt()
        for rec in self:
            ltaf_to_apply = self.env['ddmrp.adjustment'].search(
                rec._ltaf_to_apply_domain())
            if ltaf_to_apply:
                ltaf = 1
                values = ltaf_to_apply.mapped('value')
                for val in values:
                    ltaf *= val
                prev = rec.dlt
                rec.dlt *= ltaf
                _logger.debug(
                    "LTAF=%s applied to %s. DLT: %s -> %s" %
                    (ltaf, rec.name, prev, rec.dlt))
        return res
613480
def ColumnToIndex (col):
        """"""
        ndx = 0
        for c in col:
                ndx = ndx * 26 + ord(c.upper()) - 64
        return ndx
643149
def downstream_index(dir_value, i, j, alg='taudem'):
        """"""
        assert alg.lower() in FlowModelConst.d8_deltas
        delta = FlowModelConst.d8_deltas.get(alg.lower())
        drow, dcol = delta[int(dir_value)]
        return i + drow, j + dcol
476173
function getNodeIndex(node) {
	var ret = 0;
	while (node.previousSibling) {
		ret++;
		node = node.previousSibling;
	}
	return ret;
}
1038862
function indexLevels(summary) {
    var parts = summary.getParts();
    parts = parts.map(indexPartLevels);

    return summary.set('parts', parts);
}
1187991
private int getDeltaInsertionIndex(
      MethodInvocationTree methodInvocationTree, VisitorState state) {
    JCTree lastArgument = (JCTree) Iterables.getLast(methodInvocationTree.getArguments());
    return state.getEndPosition(lastArgument);
  }
1299920
function getIndexForLoc(loc) {
  var col = Math.floor(loc.x / total_width);
  var row = Math.floor(loc.y / total_width);
  var index = col + (row * 5);
  return index;
}
759512
int getIndexedField(ReadablePeriod period, int index) {
        int realIndex = iIndices[index];
        return (realIndex == -1 ? 0 : period.getValue(realIndex));
    }
695211
def _compute_childtab_next_l_index(self, lcptab):
        
        stack = [0]
        n = len(lcptab)
        childtab_next_l_index = np.zeros(n, dtype=np.int)  # Zeros / -1 ?
        for i in xrange(n):
            while lcptab[i] < lcptab[stack[-1]]:
                stack.pop()
            if lcptab[i] == lcptab[stack[-1]]:
                last_index = stack.pop()
                childtab_next_l_index[last_index] = i
            stack.append(i)
        return childtab_next_l_index
935439
def rsdl_s(self, Yprev, Y):
        """"""

        return self.rho * self.cnst_AT(self.U)
815733
private long getIndex(T x, T y) {
        int i = elementIndices.index(x);
        int j = elementIndices.index(y);
        long index = (((long)i) << 32) | j;
        return index;
    }
1345339
def get_indices(self, src, ridx, mag):
        
        centroids = src.get_centroids(ridx)
        mindistance = min_geodetic_distance(
            (centroids[:, 0], centroids[:, 1]), self.sitecol.xyz)
        idist = self.integration_distance(DEFAULT_TRT, mag)
        indices, = (mindistance <= idist).nonzero()
        return indices
629524
void findMinElementIndexInRows(int leftmost[] )
    {
        Arrays.fill(leftmost,0,m,-1);

        // leftmost[i] = min(find(A(i,:)))
        for (int k = n-1; k >= 0; k--) {
            int idx0 = A.col_idx[k];
            int idx1 = A.col_idx[k+1];

            for( int p = idx0; p < idx1; p++ ) {
                leftmost[A.nz_rows[p]] = k;
            }
        }
    }