Compute column counts.
971043
def counts(A, parent, post):
    
    n = A.size[0]
    colcount = matrix(0,(n,1))
    ancestor = matrix(range(n),(n,1))
    maxfirst = matrix(-1,(n,1))
    prevleaf = matrix(-1,(n,1))
    first = matrix(-1,(n,1))
    
    for k in range(n):
        j = post[k]
        if first[j] == -1:
            colcount[j] = 1
        else:
            colcount[j] = 0
        while  j != -1 and first[j] == -1:
            first[j] = k;
            j = parent[j]

    cp,ri,_ = A.CCS
    for k in range(n):
        j = post[k]
        if parent[j] != j:
            colcount[parent[j]] -= 1
        for p in range(cp[j],cp[j+1]):
            i = ri[p]
            if i <= j: continue
            q, jleaf = __leaf(i, j, first, maxfirst, prevleaf, ancestor)
            if jleaf >= 1: colcount[j] += 1
            if jleaf == 2: colcount[q] -= 1
        if parent[j] != j: ancestor[j] = parent[j]
    for j in range(n):
        if parent[j] != j: colcount[parent[j]] += colcount[j]

    return colcount
960517
def _total_jxn_counts(fns):
    """"""
    df = pd.read_table(fns[0], header=None, names=COLUMN_NAMES)
    df.index = (df.chrom + ':' + df.start.astype(int).astype(str) + '-' +
                df.end.astype(int).astype(str))
    counts = df.unique_junction_reads
    for fn in fns[1:]:
        df = pd.read_table(fn, header=None, names=COLUMN_NAMES)
        df.index = (df.chrom + ':' + df.start.astype(int).astype(str) + '-' +
                    df.end.astype(int).astype(str))
        counts = counts.add(df.unique_junction_reads, fill_value=0)
    return counts
1066012
public int count(String column, Object value) {
        return count(Operators.match(column, value));
    }
117577
def count_by_time(self):
        """"""
        out = np.empty((len(self.timesteps),), dtype=[('time', float), ('count', int)])
        for cursor,timestep in enumerate(self.timesteps):
            out[cursor] = (timestep,len([x for x in self.timeseries if x.time==timestep]))
        return out.view(np.recarray)
631579
public function get_column_count()
    {
        list($columns, $hidden) = $this->get_column_info();

        $hidden = array_intersect(array_keys($columns), array_filter($hidden));
        return count($columns) - count($hidden);
    }
261586
private int countNumberOfAggregates(Frame fr, int numberOfColumns, AstRoot asts[]) {
    int validGroupByCols = 0;
    for (int idx=3; idx < asts.length; idx+=3) {  // initial loop to count operations on valid columns, ignore String columns
      AstNumList col = check(numberOfColumns, asts[idx + 1]);
      if (col.cnt() != 1) throw new IllegalArgumentException("Group-By functions take only a single column");
      int agg_col = (int) col.min(); // Aggregate column
      if (fr.vec(agg_col).isString()) {
        Log.warn("Column "+fr._names[agg_col]+" is a string column.  Groupby operations will be skipped for this column.");
      } else
        validGroupByCols++;
    }
    return validGroupByCols;
  }
671661
def column_names(self):
        """"""
        return [name for (name, d) in self._columns.items()
                if d.get('show', True)]
679158
def num_columns(self):
        """"""
        if self.term.is_a_tty:
            return self.term.width // self.hint_width
        return 1
1171813
void computeColumnSpans() {
        for (int index = 0; index < _generatedMappings().size(); ++index) {
            ParsedMapping mapping = _generatedMappings().get(index);

            // Mappings do not contain a field for the last generated columnt. We
            // can come up with an optimistic estimate, however, by assuming that
            // mappings are contiguous (i.e. given two consecutive mappings, the
            // first mapping ends where the second one starts).
            if (index + 1 < _generatedMappings().size()) {
                ParsedMapping nextMapping = _generatedMappings().get(index + 1);

                if (mapping.generatedLine == nextMapping.generatedLine) {
                    mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
                    continue;
                }
            }

            // The last mapping for each line spans the entire line.
            mapping.lastGeneratedColumn = Integer.MAX_VALUE;
        }
    }
1320416
def fetch_column_names(self, table: str) -> List[str]:
        """"""
        return self.flavour.fetch_column_names(self, table)
1231508
def _load_type_counts(self):
		""""""

		rel_path = os.path.join(CLTK_DATA_DIR,
                                'old_english',
                                'model',
                                'old_english_models_cltk',
                                'data',
                                'oe.counts')
		path = os.path.expanduser(rel_path)

		self.type_counts = {}

		with open(path, 'r') as infile:
			lines = infile.read().splitlines()
			for line in lines:
				count, word = line.split()
				self.type_counts[word] = int(count)
782862
def check_columns(column, line, columns):
    
    return column <= min(len(line), max(columns))
98622
def __parseColumns(self):
        """"""
        columns = []
        if self.__dataItem.has_key('columnModel'):
            for column in self.__dataItem['columnModel']:
                columns.append(Column(column))
        return columns
4211
public function count($columns = '*')
    {
        if (! is_array($columns)) {
            $columns = [$columns];
        }

        return (int) $this->aggregate(__FUNCTION__, $columns);
    }
219072
private function calculateNumberOfColumns() {
        if (null !== $this->numberOfColumns) {
            return;
        }

        $columns = array(0);
        foreach (array_merge($this->headers, $this->rows) as $row) {
            if ($row instanceof Separator) {
                continue;
            }

            $columns[] = $this->getNumberOfColumns($row);
        }

        $this->numberOfColumns = max($columns);
    }
114468
def column_count(self, ):
        
        if self.child_count():
            return self.childItems[0]._data.column_count()
        else:
            return self._data.column_count() if self._data else 0
1005034
def count(self):
        """"""
        if self._primary_keys is None:
            return self.queryset.count()
        else:
            return len(self.pks)