Number of blocks with zeros from the left in block row `r`.
351798
def _left_zero_blocks(self, r):
    """"""
    if not self._include_off_diagonal:
      return r
    elif not self._upper:
      return 0
    elif self._include_diagonal:
      return r
    else:
      return r + 1
78438
void countNonZeroInV( int []parent ) {
        int []w = gwork.data;
        findMinElementIndexInRows(leftmost);
        createRowElementLinkedLists(leftmost,w);
        countNonZeroUsingLinkedList(parent,w);
    }
608079
def rowCount(self, parent):
        """"""
        if not parent.isValid():
            v = self._conf
        else:
            v = self.get_value(parent)
        if isinstance(v, Section):
            return len(v.keys())
        else:
            return 0
1346893
private int getNumBlocks(R delta) {
        ByteBuffer content = getValue(delta);
        int numBlocks = 0;

        // build numBlocks by adding together each hex digit
        for (int i = 0; i < _prefixLength; i++) {
            byte b = content.get(i);
            numBlocks = numBlocks << 4 | (b <= '9' ? b - '0' : b - 'A' + 10);
        }

        return numBlocks;
    }
596696
def iter_zeros(self):
        """"""
        num = quotient = 0
        while num < self._len:
            chunk = self.data[quotient]
            if chunk & self.zero_mask:
                remainder = 0
                while remainder < self.width and num < self._len:
                    item = (chunk >> remainder) & 3
                    if item == PC_ZERO:
                        yield num
                    remainder += 2
                    num += 1
            else:
                num += (self.width >> 1)
            quotient += 1
246327
def row(self):
        
        z = self.Z
        total = 0
        if 57 <= z <= 71:
            return 8
        elif 89 <= z <= 103:
            return 9

        for i in range(len(_pt_row_sizes)):
            total += _pt_row_sizes[i]
            if total >= z:
                return i + 1
        return 8
1168577
def block_sep1(self, Y):
        
        """

        return Y[(slice(None),)*self.blkaxis + (slice(self.blkidx, None),)]
1249943
private static int zero(byte[] block, int offset, int len) {
    Util.zero(block, offset, len);
    return len;
  }
1298516
def block_sep1(self, Y):
        
        """

        # This method is overridden because we have to change the
        # mechanism for combining the Y0 and Y1 blocks into a single
        # array (see comment in the __init__ method).
        shp = Y.shape[0:self.cri.axisC] + self.y1shp[self.cri.axisC:]
        return Y[(slice(None),)*self.cri.axisC +
                 (slice(self.y0I, None),)].reshape(shp)
1107741
def print_block_num_row(block_num, cliques, next_cliques):
    """"""
    n_cliques = len(cliques)
    if n_cliques == 0:
        print('|  {}'.format(block_num))
        return

    def mapper(clique):
        block_id, _ = clique
        if block_id not in next_cliques:
            return ' '
        return '|'

    format_str = '{:<' + str(n_cliques * 2) + '} {}'
    branches = list(map(mapper, cliques))
    for end in ('', block_num):
        print(format_str.format(' '.join(branches), end))
678119
def split_block_by_row_length(block, split_row_length):
    '''
    
    '''
    split_blocks = []
    current_block = []
    for row in block:
        if row_content_length(row) <= split_row_length:
            if current_block:
                split_blocks.append(current_block)
            split_blocks.append([row])
            current_block = []
        else:
            current_block.append(row)
    if current_block:
        split_blocks.append(current_block)

    return split_blocks
876837
def parameters(self):
        

        return self.block_tl, self.block_br, self.rows, self.cols, self.cells
1116950
def reversed_blocks(handle, blocksize=4096):
    """"""
    handle.seek(0, os.SEEK_END)
    here = handle.tell()
    while 0 < here:
        delta = min(blocksize, here)
        here -= delta
        handle.seek(here, os.SEEK_SET)
        yield handle.read(delta)
131753
int getNumReplicas(Block block) {
    synchronized (pendingReplications) {
      PendingBlockInfo found = pendingReplications.get(block);
      if (found != null) {
        return found.getNumReplicas();
      }
    }
    return 0;
  }
986071
def four_neighbors(self, row, col):
        
        ans = []
        if row > 0:
            ans.append((row - 1, col))
        if row < self.grid_height - 1:
            ans.append((row + 1, col))
        if col > 0:
            ans.append((row, col - 1))
        if col < self.grid_width - 1:
            ans.append((row, col + 1))
        return ans
151510
def block_sep0(self, Y):
        
        """

        return Y[(slice(None),)*self.blkaxis + (slice(0, self.blkidx),)]
367827
def p_generate_block(self, p):
        ''
        p[0] = Block(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))