Returns the number of connected distal synapses on these cells.

    Parameters:
    ----------------------------
    @param  cells (iterable)
            Indices of the cells. If None return count for all cells.
16190
def numberOfConnectedDistalSynapses(self, cells=None):
    
    if cells is None:
      cells = xrange(self.numberOfCells())

    n = _countWhereGreaterEqualInRows(self.internalDistalPermanences, cells,
                                      self.connectedPermanenceDistal)

    for permanences in self.distalPermanences:
      n += _countWhereGreaterEqualInRows(permanences, cells,
                                         self.connectedPermanenceDistal)

    return n
564204
private Cell findCell() {
        
        final int rowStart = startRow < 0 ? 0 : startRow;
        final int columnStart = startColumn < 0 ? 0 : startColumn;
        
        final int maxRow = POIUtils.getRows(sheet);
        for(int i=rowStart; i < maxRow; i++) {
            final Row row = sheet.getRow(i);
            if(row == null) {
                continue;
            }
            
            final int maxCol = row.getLastCellNum();;
            for(int j=columnStart; j < maxCol; j++) {
                
                if(excludeStartPoisition && includeInStartPosition(j, i)) {
                    // 開始位置を除外する場合
                    continue;
                }
                
                final Cell cell = row.getCell(j, MissingCellPolicy.CREATE_NULL_AS_BLANK);
                final String cellValue = POIUtils.getCellContents(cell, config.getCellFormatter());
                if(Utils.matches(cellValue, label, config)) {
                    return cell;
                }
            }
        }
        
        return null;
        
    }
1060300
function incidence(from_cells, to_cells) {
  var index = new Array(from_cells.length)
  for(var i=0, il=index.length; i<il; ++i) {
    index[i] = []
  }
  var b = []
  for(var i=0, n=to_cells.length; i<n; ++i) {
    var c = to_cells[i]
    var cl = c.length
    for(var k=1, kn=(1<<cl); k<kn; ++k) {
      b.length = bits.popCount(k)
      var l = 0
      for(var j=0; j<cl; ++j) {
        if(k & (1<<j)) {
          b[l++] = c[j]
        }
      }
      var idx=findCell(from_cells, b)
      if(idx < 0) {
        continue
      }
      while(true) {
        index[idx++].push(i)
        if(idx >= from_cells.length || compareCells(from_cells[idx], b) !== 0) {
          break
        }
      }
    }
  }
  return index
}
668600
public void addRow(final String... cells){
        final Row row = new Row((Object[]) cells);

        if(!rows.contains(row)){
            rows.add(row);
        }
    }
1065329
def column_count(index = Celerity.index_offset)
      assert_exists
      @object.getRow(index - Celerity.index_offset).getCells.length
    end
425285
function collect(cells) {
    var key, i, t, v;
    for (key in cells) {
      t = cells[key].tuple;
      for (i=0; i<n; ++i) {
        vals[i][(v = t[dims[i]])] = v;
      }
    }
  }
811246
public int getNumberOfConnections() {
		int ret = 0;
		for (int i = 0; i < square.size(); i++) {
			if( edges[i] != null )
				ret++;
		}
		return ret;
	}
221908
public static int getColumns(final Sheet sheet) {
        ArgUtils.notNull(sheet, "sheet");

        int minRowIndex = sheet.getFirstRowNum();
        int maxRowIndex = sheet.getLastRowNum();
        int maxColumnsIndex = 0;
        for(int i = minRowIndex; i <= maxRowIndex; i++) {
            final Row row = sheet.getRow(i);
            if(row == null) {
                continue;
            }

            final int column = row.getLastCellNum();
            if(column > maxColumnsIndex) {
                maxColumnsIndex = column;
            }
        }

        return maxColumnsIndex;
    }
197917
public static int count(final Iterable<Range<Long>> ranges) {
        int count = 0;
        for (Range<Long> range : ranges) {
            checkClosedOpen(range);
            count++;
        }
        return count;
    }
147181
def signed_cell_areas(self):
        
        # http://mathworld.wolfram.com/TriangleArea.html
        assert (
            self.node_coords.shape[1] == 2
        ), "Signed areas only make sense for triangles in 2D."

        if self._signed_cell_areas is None:
            # One could make p contiguous by adding a copy(), but that's not
            # really worth it here.
            p = self.node_coords[self.cells["nodes"]].T
            # <https://stackoverflow.com/q/50411583/353337>
            self._signed_cell_areas = (
                +p[0][2] * (p[1][0] - p[1][1])
                + p[0][0] * (p[1][1] - p[1][2])
                + p[0][1] * (p[1][2] - p[1][0])
            ) / 2
        return self._signed_cell_areas
401105
public Cell<C, T> getCell(C widget) {
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.widget == widget)
                return c;
        }
        return null;
    }
990816
def printDiagnosticsAfterTraining(exp, verbosity=0):
  """"""
  print "Number of connected synapses per cell"
  l2 = exp.getAlgorithmInstance("L2")

  numConnectedCells = 0
  connectedSynapses = 0
  for c in range(4096):
    cp = l2.numberOfConnectedProximalSynapses([c])
    if cp>0:
      # print c, ":", cp
      numConnectedCells += 1
      connectedSynapses += cp

  print "Num L2 cells with connected synapses:", numConnectedCells
  if numConnectedCells > 0:
    print "Avg connected synapses per connected cell:", float(connectedSynapses)/numConnectedCells

  print
526345
def _getMostActiveCells(self):
    
    poolingActivation = self._poolingActivation
    nonZeroCells = numpy.argwhere(poolingActivation > 0)[:,0]

    # include a tie-breaker before sorting
    poolingActivationSubset = poolingActivation[nonZeroCells] + \
                              self._poolingActivation_tieBreaker[nonZeroCells]
    potentialUnionSDR = nonZeroCells[numpy.argsort(poolingActivationSubset)[::-1]]

    topCells = potentialUnionSDR[0: self._maxUnionCells]

    if max(self._poolingTimer) > self._minHistory:
      self._unionSDR = numpy.sort(topCells).astype(UINT_DTYPE)
    else:
      self._unionSDR = []

    return self._unionSDR
1331339
public boolean removeCellLink(GridCell<P> cell) {
		final int idx = this.cells.indexOf(cell);
		if (idx >= 0) {
			this.cells.remove(idx);
		}
		return idx == 0;
	}
1207680
def getSegmentOnCell(self, c, i, segIdx):
    
    return self.cells[c][i][segIdx]
1070940
public void addCell(int... elements) {
        SortedSet<Integer> cell = new TreeSet<Integer>();
        for (int element : elements) {
            cell.add(element);
        }
        this.cells.add(cell);
    }
1129148
def _get_cells(self, row):
        """"""

        childnodes = row.childNodes
        qname_childnodes = [(s.qname[1], s) for s in childnodes]
        return [node for name, node in qname_childnodes
                if name == u'table-cell']