Return the counts for only those examples that are below the threshold
510337
def filter(self, run_counts, criteria):
    
    wrong_confidence = criteria['wrong_confidence']
    below_t = wrong_confidence <= self.t
    filtered_counts = deep_copy(run_counts)
    for key in filtered_counts:
      filtered_counts[key] = filtered_counts[key][below_t]
    return filtered_counts
429616
private Counter<L> scoresOfRVFDatum(RVFDatum<L, F> example) {
    Counter<L> scores = new ClassicCounter<L>();
    for (L l : labels()) {
      scores.setCount(l, scoreOfRVFDatum(example, l));
    }
    //System.out.println("Scores are: " + scores + "   (gold: " + example.label() + ")");
    return scores;
  }
1248038
def sample_counters(mc, system_info):
    """"""
    return {
        (x, y): mc.get_router_diagnostics(x, y) for (x, y) in system_info
    }
528434
def _check_count(self, result, func, args):
        #pylint: disable=unused-argument
        
        if result == 0:
            raise ctypes.WinError(ctypes.get_last_error())
        return args
95988
def count(self):
        
        return functools.reduce(lambda x, y: x * y, (x.count for x in self.bounds))
462189
def except(names)
      filtered_stats = @stats.reject do |stat|
        names.include? stat[:name]
      end
      StatsRegistry.new(filtered_stats)
    end
1085204
def skip(self, count):
        '''
        
        '''
        skipped = 0
        for _ in range(count):
            if self.mutate():
                skipped += 1
            else:
                break
        return skipped
993772
def get_threshold(self):
        """"""
        value_map = dict()
        for key, value in list(self.threshold_classes.items()):
            value_map[key] = [
                value[0].value(),
                value[1].value(),
            ]
        return value_map
1121854
def _get_counts(self, f):
        
        self._consolidate_inplace()
        counts = dict()
        for b in self.blocks:
            v = f(b)
            counts[v] = counts.get(v, 0) + b.shape[0]
        return counts
1248496
def word_counts(self):
        """"""
        counts = defaultdict(int)
        stripped_words = [lowerstrip(word) for word in self.words]
        for word in stripped_words:
            counts[word] += 1
        return counts
1247990
def countByValue(self):
        
        return self.map(lambda x: (x, 1)).reduceByKey(lambda x, y: x+y)
71449
def count_of_certain_kind(kind):
        '''
        
        '''

        recs = TabWiki.select().where(TabWiki.kind == kind)

        return recs.count()
1053858
def count(self, seqs, nreport=100, scan_rc=True):
        
        for matches in self.scan(seqs, nreport, scan_rc):
            counts = [len(m) for m in matches]
            yield counts
1227250
def get_counts(entities=None,
               object_category=None,
               min_count=1,
               **kwargs):
    
    if entities is None:
        entities = []
    results = search_associations(subjects=entities,
                                  subject_direct=True,
                                  rows=0,
                                  facet_fields=[M.IS_DEFINED_BY, M.SUBJECT_TAXON, M.SUBJECT_CATEGORY],
                                  object_category=object_category,
                                  facet_mincount=3, # TODO
                                  facet_limit=-1,
                                  json_facet={
                                      'categories':{
                                          'limit':-1,
                                          'type': 'terms',
                                          'field' : M.OBJECT_CLOSURE,
                                          'facet' : {
                                              'uniq_subject': "unique(subject)"
                                          }
                                      }
                                  },
                                  **kwargs)
    buckets = results['facets']['categories']['buckets']
    cmap = {}
    for bucket in buckets:
        if bucket['uniq_subject'] >= min_count:
            cmap[bucket['val']] = bucket['uniq_subject']
    return (cmap, results)
211197
def list(type, sym, count: nil)
      if count
        raise BadCountError unless count.positive?
      end

      @expected << [:list, type, sym, count]
    end
590548
def expected_count

      if h.ccount.nil?
        count_list_size
      elsif h.ccount >= 0
        [ h.ccount, count_list_size ].min
      else # all but 1, 2, ...
        i = count_list_size + h.ccount
        i < 1 ? 1 : i
      end
    end
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')