code: def test_filter(self):
      d = HashDictionary(self.texts, myhash=zlib.adler32)
      d.filter_extremes()
      expected = {}
      self.assertEqual(d.dfs, expected)
  
      d = HashDictionary(self.texts, myhash=zlib.adler32)
      d.filter_extremes(no_below=0, no_above=0.3)
      expected = {
          29104: 2,
          31049: 2,
          28591: 2,
          5232: 2,
          10608: 2,
          12466: 2,
          15001: 2,
          31002: 2,
      }
      self.assertEqual(d.dfs, expected)
  
      d = HashDictionary(self.texts, myhash=zlib.adler32)
      d.filter_extremes(no_below=3, no_above=1.0, keep_n=4)
      expected = {5798: 3, 12736: 3, 18451: 3, 23844: 3}
      self.assertEqual(d.dfs, expected)
  
file_path: gensim/gensim/test/test_corpora_hashdictionary.py
imports: import logging
  import unittest
  import os
  import zlib
  from gensim.corpora.hashdictionary import HashDictionary
  from gensim.test.utils import get_tmpfile, common_texts
label_desc: Use image node_id 8 for calling the TestHashDictionary obj's underlying member method code with example usage: obj.test_filter() without return types