code: def test_init(self):
      # create the transformation model by analyzing a corpus
      # uses the global `corpus`!
      model1 = tfidfmodel.TfidfModel(common_corpus)
      dfs = common_dictionary.dfs
  
      # make sure the dfs<->idfs transformation works
      self.assertEqual(model1.dfs, dfs)
      self.assertEqual(
          model1.idfs,
          tfidfmodel.precompute_idfs(
              model1.wglobal, dfs, len(common_corpus)
          ),
      )
  
      # create the transformation model by directly supplying a term->docfreq
      # mapping from the global var `dictionary`.
      model2 = tfidfmodel.TfidfModel(dictionary=common_dictionary)
      self.assertEqual(model1.idfs, model2.idfs)
  
file_path: gensim/gensim/test/test_tfidfmodel.py
imports: import logging
  import unittest
  import numpy
  from gensim.corpora.mmcorpus import MmCorpus
  from gensim.models import tfidfmodel
  from gensim.test.utils import datapath, get_tmpfile, common_dictionary, common_corpus
  from gensim.corpora import Dictionary
label_desc: Use image node_id 3 for calling the TestTfidfModel obj's underlying member method code with example usage: obj.test_init() without return types