Counts the number of times value appears in array.
174977
public static int count(int[] array, int value) {
        int count = 0;
        for (int i = 0; i < array.length; i++) {
            if (array[i] == value) {
                count++;
            }
        }
        return count;
    }
561676
def countIndex(self):
		""""""
		self.data = self.index.count(self.searchString, self.category, self.math, self.game, self.searchFiles, self.extension)
1219069
def count(self, value):
        
        cnt = 0
        for x in self:
            if x == value:
                cnt += 1
        return cnt
570371
def _scatter(self):
        """"""

        plt.scatter(self.count_arr, self.elapsed_arr)
        plt.title('{}: Count vs. Elapsed'.format(self.name))
        plt.xlabel('Items')
        plt.ylabel('Seconds')
273345
def count_values(tokens):
    """"""
    ntoks = 0
    for tok in tokens:
        if tok in ('=', '/', '$', '&'):
            if ntoks > 0 and tok == '=':
                ntoks -= 1
            break
        elif tok in whitespace + ',':
            continue
        else:
            ntoks += 1

    return ntoks
1207815
function(recentEntryArray, value) {
			var indexOfElement = -1;
			
			recentEntryArray.some(function(entry, index){
				if (entry.value === value) {
					indexOfElement = index;
					return true;
				}
				return false;
			});
			
			return indexOfElement;
		}
968977
public static int count(String str,String target){
		int count=0; 
		int index=0; 
		while(true){ 
			index=str.indexOf(target,index+1); 
			if(index>0){ 
				count++; 
			}else{ 
				break; 
			} 
		} 
		return count; 
	}
301865
public function count($value)
    {
        if (is_array($value) === true || $value instanceof Countable) {
            return count($value);
        } elseif ($value instanceof IteratorAggregate) {
            // Note: getIterator() returns a Traversable, not an Iterator
            // thus rewind() and valid() methods may not be present
            return iterator_count($value->getIterator());
        } elseif ($value instanceof Iterator) {
            if ($value instanceof Generator) {
                return 1;
            }
            return iterator_count($value);
        } elseif ($value instanceof PDOStatement) {
            return $value->rowCount();
        } elseif ($value instanceof Traversable) {
            return iterator_count($value);
        } elseif ($value instanceof ArrayAccess) {
            if ($value->offsetExists(0)) {
                return 1;
            }
        } elseif (is_object($value)) {
            return count($value);
        }
        return 0;
    }
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;
  }
1133524
def contains_duplicates(values: Iterable[Any]) -> bool:
    
    for v in Counter(values).values():
        if v > 1:
            return True
    return False
302824
public static int countSameElements(byte[] arra, int start, byte[] arrb) {

        int k     = 0;
        int limit = arra.length - start;

        if (limit > arrb.length) {
            limit = arrb.length;
        }

        for (int i = 0; i < limit; i++) {
            if (arra[i + start] == arrb[i]) {
                k++;
            } else {
                break;
            }
        }

        return k;
    }
714981
def count(self, value):
		
		return sum(getattr(row, self.Name) == value for row in self.parentNode)
615584
function incrementCounter() {
            for (var i = innerLen-1; i >= innerLen-4; i--) {
                inner[i]++;
                if (inner[i] <= 0xff) return;
                inner[i] = 0;
            }
        }
831990
def count(self, Class, set=None, recursive=True,ignore=True):
        """"""
        if self.mode == Mode.MEMORY:
            s = 0
            for t in self.data:
                s +=  sum( 1 for e in t.select(Class,recursive,True ) )
            return s
612372
function countBy(array, exp) {

  var result = {},
    prop;

  if(!isArray(array) || isUndefined(exp)) {
    return array;
  }

  array.forEach( function(elm) {
    prop = $parse(exp)(elm);

    if(!result[prop]) {
      result[prop] = 0;
    }

    result[prop]++;
  });

  return result;
}
381081
function ArrayindexOf(thing) {
  var index = 0;
  var count = this.length;
  while (index < count) {
    if (this[index] === thing) return index
    index = index + 1
  }
  return -1
}
1185363
def _count(self, X, Y):
        """"""

        self.feature_count_ += safe_sparse_dot(Y.T, X)
        self.class_count_ += Y.sum(axis=0)