Find the member of a set that means "count" or "frequency" or "probability" or "number of occurrences".
327832
def find_count_label(d):
    
    for name in COUNT_NAMES:
        if name in d:
            return name
    for name in COUNT_NAMES:
        if str(name).lower() in d:
            return name
35479
def rand(self, count=1):
        
        result = self._client.srandmember(self.key_prefix, count)
        return set(map(self._loads, result))
327611
def count(expr, where=None):
    
    op = expr.op()
    if isinstance(op, ops.DistinctColumn):
        result = ops.CountDistinct(op.args[0], where).to_expr()
    else:
        result = ops.Count(expr, where).to_expr()

    return result.name('count')
71052
public long countNNZ() {
        long count = 0;

        for (int i = 0; i < values.length(); i++) {
            int[] idx = getUnderlyingIndicesOf(i).asInt();
            boolean isIn = true;
            int idxNotFixed = 0;
            for (int dim = 0; dim < idx.length; dim++) {

                if (flags()[dim] == 1) {
                    if (sparseOffsets()[dim] != idx[dim]) {
                        isIn = false;
                        break;
                    }
                } else {
                    int lowerBound = sparseOffsets()[dim];
                    long upperBound = sparseOffsets()[dim] + shape()[idxNotFixed];
                    if (!(idx[dim] >= lowerBound && idx[dim] < upperBound)) {
                        isIn = false;
                        break;
                    }
                    idxNotFixed++;
                }
            }
            count = isIn ? count + 1 : count;
        }
        return count;
    }
637905
def count(self, strg, case_sensitive=False, *args, **kwargs):
    
    if not case_sensitive:
        return [word.lower() for word in self].count(strg.lower(), *args,
                **kwargs)
    return self._collection.count(strg, *args, **kwargs)
1083774
private Collection<SwimMember> selectRandomMembers(int count, ImmutableMember exclude) {
    List<SwimMember> members = this.members.values().stream()
        .filter(member -> !member.id().equals(localMember.id()) && !member.id().equals(exclude.id()))
        .collect(Collectors.toList());
    Collections.shuffle(members);
    return members.subList(0, Math.min(members.size(), count));
  }
1360761
def Value(self, p):
        
        if p < 0 or p > 1:
            raise ValueError('Probability p must be in range [0, 1]')

        if p == 0: return self.xs[0]
        if p == 1: return self.xs[-1]
        index = bisect.bisect(self.ps, p)
        if p == self.ps[index - 1]:
            return self.xs[index - 1]
        else:
            return self.xs[index]
126793
def find_one(cls, *args, **kwargs):
        """"""
        d = cls.collection.find_one(*args, **kwargs)
        if d:
            return cls(**d)
246842
def find_same_occurence
      selected = @candidates.select { |delim, count|
        begin
          CSV.parse(@sample, col_sep: delim).select{|e| !e.empty? }.map{|e| e.count}.uniq.count == 1
        rescue Exception => ex
          false
        end
      }.keys

      return selected.first if selected.count == 1
      return DEFAULT_DELIMITER if selected.include?(DEFAULT_DELIMITER)
    end
970984
def frequencies_for(words)
      word_frequencies = {}
      words.each { |word| word_frequencies[word] = words.count(word) }
      word_frequencies
    end
784494
def nonempty_set(C, mincount_connectivity=0):
    
    # truncate to states with at least one observed incoming or outgoing count.
    if mincount_connectivity > 0:
        C = C.copy()
        C[np.where(C < mincount_connectivity)] = 0
    return np.where(C.sum(axis=0) + C.sum(axis=1) > 0)[0]
925086
def countRandomBitFrequencies(numTerms = 100000, percentSparsity = 0.01):
  """"""
  # Accumulate counts by inplace-adding sparse matrices
  counts = SparseMatrix()
  size = 128*128
  counts.resize(1, size)

  # Pre-allocate buffer sparse matrix
  sparseBitmap = SparseMatrix()
  sparseBitmap.resize(1, size)

  random.seed(42)

  # Accumulate counts for each bit for each word
  numWords=0
  for term in xrange(numTerms):
    bitmap = random.sample(xrange(size), int(size*percentSparsity))
    bitmap.sort()

    sparseBitmap.setRowFromSparse(0, bitmap, [1]*len(bitmap))
    counts += sparseBitmap
    numWords += 1

  # Compute normalized version of counts as a separate matrix
  frequencies = SparseMatrix()
  frequencies.resize(1, size)
  frequencies.copy(counts)
  frequencies.divide(float(numWords))

  # Wrap up by printing some statistics and then saving the normalized version
  printFrequencyStatistics(counts, frequencies, numWords, size)

  frequencyFilename = "bit_frequencies_random.pkl"
  print "Saving frequency matrix in",frequencyFilename
  with open(frequencyFilename, "wb") as frequencyPickleFile:
    pickle.dump(frequencies, frequencyPickleFile)

  return counts
421144
def from_data(cls, data):
        
        frequencies = collections.Counter(data)
        return cls.from_frequencies(frequencies, concat=_guess_concat(data))
1121500
public static int getBondCount(IRingSet set) {
        int count = 0;
        for (IAtomContainer atomContainer : set.atomContainers()) {
            count += atomContainer.getBondCount();
        }
        return count;
    }
649990
public static int count(Iterable it) {
        int n = 0;

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

        return n;
    }
601997
private static int countWildcardsOccurrences(String templateMessage, String occurrence) {
        if (templateMessage != null && occurrence != null) {
            final Pattern pattern = Pattern.compile(occurrence);
            final Matcher matcher = pattern.matcher(templateMessage);
            int count = 0;
            while (matcher.find()) {
                count++;
            }
            return count;
        } else {
            return 0;
        }
    }
829924
def getCountGT(self, item):
        """"""
        index = bisect.bisect_right(self._list, item)
        return len(self._list) - index