Counts the number of nodes in the given list into active and decommissioned
counters.
170855
private int countCorruptNodes(Block b, 
                                    Iterator<DatanodeDescriptor> nodeIter) {
    int corrupt = 0;
    Collection<DatanodeDescriptor> nodesCorrupt = corruptReplicas.getNodes(b);
    while (nodeIter.hasNext()) {
      DatanodeDescriptor node = nodeIter.next();
      if ((nodesCorrupt != null) && (nodesCorrupt.contains(node))) {
        corrupt++;
      }
    }
    return corrupt;
  }
628738
public int countReduceTasks() {
    int reduceCount = 0;
    for (Iterator<TaskStatus> it = taskReports.iterator(); it.hasNext();) {
      TaskStatus ts = (TaskStatus) it.next();
      if ((!ts.getIsMap()) && isTaskRunning(ts)) {
        reduceCount++;
      }
    }
    return reduceCount;
  }
867067
private void countDescendants() throws TTIOException {
        long descendants = 1;
        final long nodeKey = mRtx.getNode().getDataKey();
        if (((ITreeStructData)mRtx.getNode()).hasFirstChild()) {
            mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getFirstChildKey());
            do {
                descendants += mDescendants.get(mRtx.getNode());
            } while (((ITreeStructData)mRtx.getNode()).hasRightSibling()
                && mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getRightSiblingKey()));
        }
        mRtx.moveTo(nodeKey);
        mDescendants.put(mRtx.getNode(), descendants);
    }
649990
public static int count(Iterable it) {
        int n = 0;

        for(Object v: it) {
            if(v != null) {
                ++n;
            }
        }

        return n;
    }
522891
public static <T> int count(Iterable<T> iterable) {
        int count = 0;

        if (iterable != null) {
            Iterator<T> iter = iterable.iterator();
            while (iter.hasNext()) {
                iter.next();
                count++;
            }
        }

        return count;
    }
95988
def count(self):
        
        return functools.reduce(lambda x, y: x * y, (x.count for x in self.bounds))
103168
def count(self):
        ""
        if getattr(self, '_count', None) is None:
            self._count = getattr(self.node, 'count', 0)
        return self._count
1147411
def rowCount(self, parent=QModelIndex()):
        

        if not parent.isValid():
            parent_node = self.__root_node
        else:
            parent_node = parent.internalPointer()
        return parent_node.children_count()
1197463
private void checkCoverTree(Node cur, int[] counts, int depth) {
    counts[0] += 1; // Node count
    counts[1] += depth; // Sum of depth
    counts[2] = depth > counts[2] ? depth : counts[2]; // Max depth
    counts[3] += cur.singletons.size() - 1;
    counts[4] += cur.singletons.size() - (cur.children == null ? 0 : 1);
    if(cur.children != null) {
      ++depth;
      for(Node chi : cur.children) {
        checkCoverTree(chi, counts, depth);
      }
      assert (!cur.children.isEmpty()) : "Empty childs list.";
    }
  }
748616
function treeNodeCount (leafCount) {
  var count = 1
  for (var i = leafCount; i > 1; i = (i + 1) >> 1) count += i
  return count
}
500012
public int countOnes(int location) {

    int count = 0;
    for (int i = 0; i < populationSize; i++) {
      if (subregionIdx[location][i] == 1) {
        count++;
      }
    }

    return count;
  }
1042127
private static int[][] countCounts2IntArrays(Counter<Integer> countCounts) {
    int size = countCounts.size();
    int[][] arrays = new int[2][];
    arrays[0] = new int[size]; // counts
    arrays[1] = new int[size]; // count counts
    PriorityQueue<Integer> q = new PriorityQueue<Integer>(countCounts.keySet());
    int i = 0;
    while (!q.isEmpty()) {
      Integer count = q.poll();
      Integer countCount = (int) Math.round(countCounts.getCount(count));
      arrays[0][i] = count;
      arrays[1][i] = countCount;
      i++;
    }
    return arrays;
  }
1193869
def count(self, Class, set=None, recursive=True,  ignore=True, node=None):
        
        return sum(1 for i in self.select(Class,set,recursive,ignore,node) )
818226
private static int countTailoredNodes(long[] nodesArray, int i, int strength) {
        int count = 0;
        for(;;) {
            if(i == 0) { break; }
            long node = nodesArray[i];
            if(strengthFromNode(node) < strength) { break; }
            if(strengthFromNode(node) == strength) {
                if(isTailoredNode(node)) {
                    ++count;
                } else {
                    break;
                }
            }
            i = nextIndexFromNode(node);
        }
        return count;
    }
1330427
private void init( List<T> list ) {
		this.list = list;
		indexes = new int[ list.size() ];
		counters = new int[ list.size() ];

		for( int i = 0; i < indexes.length ; i++ ) {
			counters[i] = indexes[i] = i;
		}

		total = 1;
		for( int i = 2; i <= indexes.length ; i++ ) {
			total *= i;
		}

		permutation = 0;
	}
682189
def status_counter(self):
        
        counter = collections.Counter()

        for task in self:
            counter[str(task.status)] += 1

        return counter
220671
def read_counts(node):
  
  cfg.forward(node, cfg.ReachingDefinitions())

  rc = ReadCounts()
  rc.visit(node)
  return rc.n_read