Returns how many cards in the deck have the specified value under the
        specified key in their info data.

        This method requires a library to be stored in the deck instance and
        will return `None` if there is no library.
510696
def contains_info(self, key, value):
        
        if self.library is None:
            return 0

        load = self.library.load_card
        matches = 0
        for code in self.cards:
            card = load(code)
            if card.get_info(key) == value:
                matches += 1
        return matches
837532
function (card) {
	if (typeof card == 'number')
		return card >= 1 && card <= deckSize ? card : undefined; // Already codified
	if (typeof card != 'string' || card.length != 2)
		return undefined; // Invalid input
	var posRank = abbr[card[0]];
	var posSuit = (abbr[card[1]] - ranks.length) >> 1;
	if (typeof posRank != 'number' || posRank >= ranks.length || posSuit < 0)
		return undefined; // Invalid characters
	return posRank * suits.length + posSuit + 1;
}
406127
def count(self):
        
        count = 0
        operation = self._get_operation()
        kwargs = self.kwargs.copy()
        kwargs['select'] = 'COUNT'
        limit = kwargs.get('limit', None)
        while True:
            result = operation(self.model.get_table_name(), **kwargs)
            count += result['Count']
            if limit is not None:
                limit -= result['Count']

            last_evaluated_key = result.get('LastEvaluatedKey', None)
            if not self._prepare_next_fetch(kwargs, last_evaluated_key, limit):
                break
        return count
629187
def _check_equals(self):
        
        card_string = self['card_string']
        if len(card_string) < 9:
            self._has_equals = False
        elif card_string[8] == '=':
            self._has_equals = True
        else:
            self._has_equals = False
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
228756
def count(self):
        
        if self._result_cache is not None and not self._iter:
            return len(self._result_cache)

        return self.query.get_count()
1319347
def has_more_pages(self):
        

        # if has_next property exists, it represents whether more pages exist
        if self.has_next is not None:
            return self.has_next

        # otherwise, try to compute whether or not more pages exist
        total_pages = self.get_total_pages()
        if self.page_number is None or total_pages is None:
            return None
        else:
            return self.page_number + 1 < total_pages
1202964
public int count(List<String> statusList) {
        Map<String, Object> request = new HashMap<>();
        request.put("offset", 0);
        request.put("count", 1);
        if (statusList != null && !statusList.isEmpty()) {
            request.put("status_list", statusList);
        }

        String url = WxEndpoint.get("url.card.list");
        String json = JsonMapper.defaultMapper().toJson(request);
        String response = wxClient.post(url, json);

        Map<String, Object> result = JsonMapper.defaultMapper().json2Map(response);
        if (result.containsKey("total_num")) {
            return (Integer) result.get("total_num");
        } else {
            throw new WxRuntimeException(999, "create card failed.");
        }
    }
808484
def info_count(i: int, n: int, *rest: Token, **kwargs: Any) -> None:
    
    num_digits = len(str(n))
    counter_format = "(%{}d/%d)".format(num_digits)
    counter_str = counter_format % (i + 1, n)
    info(green, "*", reset, counter_str, reset, *rest, **kwargs)
725975
def _collection_length(self, final_set):
        
        conn = self.cls.get_connection()

        # we have a sorted set without need to sort, use zcard
        if self._has_sortedsets:
            return conn.zcard(final_set)

        # we have a stored collection, without other filter, use llen
        elif self.stored_key and not self._lazy_collection['sets']\
                and len(self._lazy_collection['intersects']) == 1:

            return conn.llen(final_set)

        # normal call
        return super(ExtendedCollectionManager, self)._collection_length(final_set)
114985
private static function isStraight(CardCollection $cards)
    {
        if ($cards->count() !== 5) {
            return false;
        }

        $uniqueCards = $cards->map->value()->unique();
        if ($cards->count() !== $uniqueCards->count()) {
            return false;
        }

        if ($cards->sumByValue() === array_sum(range(
            $cards->sortByValue()->first()->value(),
            $cards->sortByValue()->last()->value()
        ))) {
            return $cards->sortByValue()->values();
        }

        return false;
    }
457211
def contains(self, key, counter_id):
        
        with self._lock:
            return counter_id in self._metadata[key]
1021669
def _record_count(self):
        

        self.filepath_or_buffer.seek(0, 2)
        total_records_length = (self.filepath_or_buffer.tell() -
                                self.record_start)

        if total_records_length % 80 != 0:
            warnings.warn("xport file may be corrupted")

        if self.record_length > 80:
            self.filepath_or_buffer.seek(self.record_start)
            return total_records_length // self.record_length

        self.filepath_or_buffer.seek(-80, 2)
        last_card = self.filepath_or_buffer.read(80)
        last_card = np.frombuffer(last_card, dtype=np.uint64)

        # 8 byte blank
        ix = np.flatnonzero(last_card == 2314885530818453536)

        if len(ix) == 0:
            tail_pad = 0
        else:
            tail_pad = 8 * len(ix)

        self.filepath_or_buffer.seek(self.record_start)

        return (total_records_length - tail_pad) // self.record_length
202959
def count(limit = false)
      command = { count: collection.name, query: selector }
      command.merge!(skip: operation.skip, limit: operation.limit) if limit
      result = collection.database.command(command)
      result["n"].to_i
    end
613228
def count(self, model_class, conditions=None):
        '''
        
        '''
        query = 'SELECT count() FROM $table'
        if conditions:
            query += ' WHERE ' + conditions
        query = self._substitute(query, model_class)
        r = self._send(query)
        return int(r.text) if r.text else 0
353223
def multiget_count(self, keys, column_parent, predicate, consistency_level):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_multiget_count(keys, column_parent, predicate, consistency_level)
    return d
1034010
def getNumTables(dbid)
      numTables = 0
      dbid ||= @dbid
      if getSchema(dbid)      
        if @chdbids
           chdbidArray = findElementsByAttributeName( @chdbids, "name" )
           numTables = chdbidArray.length
         end
       end
      numTables       
  end