Internal count helper.
166130
def _count(self, cmd, collation=None):
        """"""
        with self._socket_for_reads() as (sock_info, slave_ok):
            res = self._command(
                sock_info, cmd, slave_ok,
                allowable_errors=["ns missing"],
                codec_options=self.__write_response_codec_options,
                read_concern=self.read_concern,
                collation=collation)
        if res.get("errmsg", "") == "ns missing":
            return 0
        return int(res["n"])
345482
def tally(self, name, value):
        """"""
        value = value or 0  # Protection against None.
        # Start at 0 if this is the first value.
        if 'used' not in self.usages[name]:
            self.usages[name]['used'] = 0
        # Increment our usage and update the "available" metric.
        self.usages[name]['used'] += int(value)  # Fail if can't coerce to int.
        self.update_available(name)
654494
def count(self, item):
        """"""
        if not isinstance(item, str):
            return 0
        count = 0
        for entry in self:
            if item.lower() == entry.lower():
                count += 1
        return count
321324
def count_courses(self):
        """"""
        c = 0
        for x in self.tuning:
            if type(x) == list:
                c += len(x)
            else:
                c += 1
        return float(c) / len(self.tuning)
293746
def objectcount(data, key):
    """"""
    objkey = key.upper()
    return len(data.dt[objkey])
719371
def count(self):
        """"""
        cursor = self.conn.cursor()
        with contextlib.closing(cursor):
            cursor.execute('SELECT COUNT(*) FROM events')
            res = cursor.fetchone()
            return res[0]
844950
def _count(self, cmd, collation=None, session=None):
        """"""
        def _cmd(session, server, sock_info, slave_ok):
            res = self._command(
                sock_info,
                cmd,
                slave_ok,
                allowable_errors=["ns missing"],
                codec_options=self.__write_response_codec_options,
                read_concern=self.read_concern,
                collation=collation,
                session=session)
            if res.get("errmsg", "") == "ns missing":
                return 0
            return int(res["n"])

        return self.__database.client._retryable_read(
            _cmd, self._read_preference_for(session), session)
846310
def _counter(self):
        """"""
        count = int(self._client.kv[self._counter_path])
        count += 1
        count_str = str(count).zfill(self._COUNTER_FILL)
        self._client.kv[self._counter_path] = count_str
        return count_str
649990
public static int count(Iterable it) {
        int n = 0;

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

        return n;
    }
1373614
def symbols_count(self):
        """"""
        if not self._ptr:
            raise BfdException("BFD not initialized")

        return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.SYMCOUNT)
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
996282
def count(self, count):
        
        if count is None:
            raise ValueError("Invalid value for `count`, must not be `None`")
        if count is not None and count < 0:
            raise ValueError("Invalid value for `count`, must be a value greater than or equal to `0`")

        self._count = count
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
1304554
def count(self, q):
        
        q = "SELECT COUNT(*) %s"%q
        return int(self.quick(q).split("\n")[1])
1365801
public void tally( Statistics other )
    {
        rightCount += other.rightCount();
        wrongCount += other.wrongCount();
        ignoredCount += other.ignoredCount();
        exceptionCount += other.exceptionCount();
    }
299860
def col_counts(col, weights=None, gap_chars='-.'):
    """"""
    cnt = defaultdict(float)
    for aa, wt in zip(col, weights):
        if aa not in gap_chars:
            cnt[aa] += wt
    return cnt
483214
def count(self):
        ""
        return self.rpc_model.search_count(
            self.domain, context=self.context
        )