code: def test_idf_metrics():
      summarizer = LexRankSummarizer()
  
      sentences = [
          (
              "this",
              "sentence",
              "is",
              "simple",
              "sentence",
          ),
          (
              "this",
              "is",
              "simple",
              "sentence",
              "yes",
              "is",
              "too",
              "too",
              "too",
          ),
          (
              "not",
              "every",
              "sentence",
              "makes",
              "me",
              "happy",
          ),
          ("yes",),
          (),
          (
              "every",
              "day",
              "is",
              "happy",
              "day",
          ),
      ]
      metrics = summarizer._compute_idf(sentences)
  
      expected = {
          "this": math.log(6 / 3),
          "is": math.log(6 / 4),
          "yes": math.log(6 / 3),
          "simple": math.log(6 / 3),
          "sentence": math.log(6 / 4),
          "too": math.log(6 / 2),
          "not": math.log(6 / 2),
          "every": math.log(6 / 3),
          "makes": math.log(6 / 2),
          "me": math.log(6 / 2),
          "happy": math.log(6 / 3),
          "day": math.log(6 / 2),
      }
      assert expected == metrics
  
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import math
  import numpy
  import pytest
  import sumy.summarizers.lex_rank
  from sumy.nlp.stemmers.czech import stem_word
  from sumy.nlp.tokenizers import Tokenizer
  from sumy.parsers.plaintext import PlaintextParser
  from sumy.summarizers.lex_rank import LexRankSummarizer
  from sumy.utils import get_stop_words
  from ..utils import build_document, load_resource
label_desc: Use image node_id 3 for calling a global function with example usage: test_idf_metrics() without return types