S.count(value) -> integer -- return number of occurrences of value
546610
def count(self, value):
        """"""
        from pcapkit.protocols.protocol import Protocol
        try:
            flag = issubclass(value, Protocol)
        except TypeError:
            flag = issubclass(type(value), Protocol)
        if flag or isinstance(value, Protocol):
            value = value.__index__()
            if isinstance(value, tuple):
                value = r'|'.join(value)

        with contextlib.suppress(Exception):
            return sum(1 for data in self.__data__ if re.fullmatch(value, data, re.IGNORECASE) is not None)
        return 0
866017
def count(self, item):
        """"""
        # pylint: disable=arguments-differ
        key, value = item
        return 1 if key in self._dict and self._dict[key] == value else 0
465366
def number_occurences(self, proc):
        
        return len([True for row in self.data if proc in row[self.command_name]])
192180
def count(self, value):
        

        if value is not None:
            assert type(value) is int, "'{0}' attribute: '{1}' type is not 'int'!".format(
                "count", value)
            assert value > 0, "'{0}' attribute: '{1}' need to be exactly positive!".format("count", value)
        self.__count = value
658715
def count(self, value):
        
        if self.__modified_data__ is not None:
            return self.__modified_data__.count(value)
        return self.__original_data__.count(value)
1304554
def count(self, q):
        
        q = "SELECT COUNT(*) %s"%q
        return int(self.quick(q).split("\n")[1])
235544
def count(self, searchString, category="", math=False, game=False, searchFiles=False, extension=""):
		""""""
		fileData = {}
		nameData = {}
		
		#Search the index
		if searchFiles:
			fileData = self.searchNamesIndex(self.fileIndex, fileData, searchString, category, math, game, extension)
		else:
			nameData = self.searchNamesIndex(self.nameIndex, nameData, searchString)
			
		#Now search the other index
		if searchFiles:
			nameData, fileData = self.searchFilesIndex(fileData, nameData, self.nameIndex, searchString)
		else:
			fileData, nameData = self.searchFilesIndex(nameData, fileData, self.fileIndex, searchString, category, math, game, extension)

		# Bail out if we failed to do either of those things.
		if fileData is None or nameData is None:
			self.repo.printd("Error: failed to load one or more of the index files for this repo. Exiting.")
			self.repo.printd("Please run 'calcpkg update' and retry this command.")
			sys.exit(1)

		#Now obtain a count (exclude "none" elements)
		count = 0
		for element in nameData:
			if not nameData[element] is None:
				count += 1

		self.repo.printd("Search for '" + searchString + "' returned " + str(count) + " result(s) in " + self.repo.name)
		return count
382883
public int occurrences(Object obj)
    {
        int count = 0;
        for (int i = 0; i < this.size(); i++)
        {
            if ((obj == null) ? this.get(i) == null : this.get(i).equals(obj))
            {
                count++;
            }
        }
        return count;
    }
1188706
def count(self):
        '''
        
        '''
        args = self.format_args
        if args is None or \
                (isinstance(args, dict) and self.count_field not in args):
            raise TypeError("count is required")
        return args[self.count_field] if isinstance(args, dict) else args
181127
def pop_int(count = 1)
      i = stack.pop(count).map{ |s| cast_to_int(s) }
      count == 1 ? i.first : i
    end
80868
public static int count(final String string, final String substring)
   {
      int count = 0;
      int idx = 0;

      while ((idx = string.indexOf(substring, idx)) != -1)
      {
         idx++;
         count++;
      }

      return count;
   }
46476
def count(self):
        
        return self.mapPartitions(lambda i: [sum(1 for _ in i)]).reduce(operator.add)
977759
def count_token_occurrences(cls, words):
        
        counts = {}
        for word in words:
            if word in counts:
                counts[word] += 1
            else:
                counts[word] = 1
        return counts
1141880
private static int countTrue(final boolean... b) {
        if (b == null) {
            return 0;
        }
        int count = 0;
        for (boolean bb : b) {
            if (bb) {
                ++count;
            }
        }
        return count;
    }
204602
def value_count(x, value):
    
    if not isinstance(x, (np.ndarray, pd.Series)):
        x = np.asarray(x)

    if np.isnan(value):
        return np.isnan(x).sum()
    else:
        return x[x == value].size
139801
def count(expr):
    

    if isinstance(expr, SequenceExpr):
        unique_input = _extract_unique_input(expr)
        if unique_input:
            return nunique(unique_input).rename('count')
        else:
            return Count(_value_type=types.int64, _input=expr)
    elif isinstance(expr, SequenceGroupBy):
        return GroupedCount(_data_type=types.int64, _input=expr.to_column(),
                            _grouped=expr.input)
    elif isinstance(expr, CollectionExpr):
        return Count(_value_type=types.int64, _input=expr).rename('count')
    elif isinstance(expr, GroupBy):
        return GroupedCount(_data_type=types.int64, _input=expr.input,
                            _grouped=expr).rename('count')
149784
private static <E> Counter<Integer> collectCountCounts(Counter<E> counts) {
    Counter<Integer> cc = new ClassicCounter<Integer>(); // counts of counts
    for (Map.Entry<E, Double> entry : counts.entrySet()) {
      //E item = entry.getKey();
      Integer count = (int) Math.round(entry.getValue());
      cc.incrementCount(count);
    }
    return cc;
  }