code: def test_filter(self):
      d = Dictionary(self.texts)
      d.filter_extremes(no_below=2, no_above=1.0, keep_n=4)
      dfs_expected = {0: 3, 1: 3, 2: 3, 3: 3}
      cfs_expected = {0: 4, 1: 3, 2: 3, 3: 3}
      self.assertEqual(d.dfs, dfs_expected)
      self.assertEqual(d.cfs, cfs_expected)
  
imports: from collections.abc import Mapping
  from itertools import chain
  import logging
  import unittest
  import codecs
  import os
  import os.path
  import scipy
  import gensim
  from gensim.corpora import Dictionary
  from gensim.utils import to_utf8
  from gensim.test.utils import get_tmpfile, common_texts
label_desc: Use image node_id 8 for calling the TestDictionary obj's underlying member method code with example usage: obj.test_filter() without return types