code: def _test_doc_length_normalized_frequency_ranker(self):
      tdm = make_a_test_term_doc_matrix()
      len_ranker = DocLengthNormalizedFrequencyRanker(tdm)
      abs_ranker = AbsoluteFrequencyRanker(tdm)
      abs_rank_df = abs_ranker.get_ranks()
      len_ranker_df = len_ranker.get_ranks()
      self.assertEqual(len(abs_rank_df), len(len_ranker_df))
      doc_lengths = [12, 35, 29]
      avg_length = sum(doc_lengths) * 1.0 / len(doc_lengths)
      np.testing.assert_almost_equal(
          np.array(len_ranker_df.loc["blah"]),
          [0, avg_length * 3.0 / 12],
      )
      np.testing.assert_almost_equal(
          np.array(len_ranker_df.loc["name"]),
          [avg_length * 1.0 / 35, avg_length * 1.0 / 29],
      )
  
file_path: scattertext/scattertext/test/test_termRanker.py
imports: from unittest import TestCase
  import numpy
  from scattertext.termranking import AbsoluteFrequencyRanker
  from scattertext.termranking import DocLengthDividedFrequencyRanker
  from scattertext.termranking import DocLengthNormalizedFrequencyRanker
  from scattertext.termranking.OncePerDocFrequencyRanker import OncePerDocFrequencyRanker
  from scattertext.test.test_TermDocMat import make_a_test_term_doc_matrix
label_desc: Use image node_id 2 for calling the TestTermRanker obj's underlying member method code with example usage: obj._test_doc_length_normalized_frequency_ranker() without return types