def filter_count(self, words_compact, min_count=15, max_count=0,
                     max_replacement=None, min_replacement=None):
        self._check_finalized()
        ret = words_compact.copy()
        if min_replacement is None:
            min_replacement = self.specials_to_compact['out_of_vocabulary']
        if max_replacement is None:
            max_replacement = self.specials_to_compact['out_of_vocabulary']
        not_specials = np.ones(self.keys_counts.shape[0], dtype='bool')
        not_specials[:self.n_specials] = False
        if min_count:
            # Find first index with count less than min_count
            min_idx = np.argmax(not_specials & (self.keys_counts < min_count))
            # Replace all indices greater than min_idx
            ret[ret > min_idx] = min_replacement
        if max_count:
            # Find first index with count less than max_count
            max_idx = np.argmax(not_specials & (self.keys_counts < max_count))
            # Replace all indices less than max_idx
            ret[ret < max_idx] = max_replacement
        return ret
Callback to any open handler that was provided in the ctor. Handler is
dataset/ETHPy150Open cemoody/lda2vec/lda2vec/corpus.py/Corpus.filter_count--crossover with--dataset/ETHPy150Open agoragames/haigha/haigha/connection.py/Connection._callback_open