code: def test_kl_divergence(summarizer):
      EPS = 0.00001
  
      w1 = {"one": 0.35, "two": 0.5, "three": 0.15}
      w2 = {"one": 1.0 / 3.0, "two": 1.0 / 3.0, "three": 1.0 / 3.0}
  
      # This value comes from scipy.stats.entropy(w2_, w1_)
      # Note: the order of params is different
      kl_correct = 0.11475080798005841
      assert abs(summarizer._kl_divergence(w1, w2) - kl_correct) < EPS
  
      w1 = {"one": 0.1, "two": 0.2, "three": 0.7}
      w2 = {"one": 0.2, "two": 0.4, "three": 0.4}
  
      # This value comes from scipy.stats.entropy(w2_, w1_)
      # Note: the order of params is different
      kl_correct = 0.1920419931617981
      assert abs(summarizer._kl_divergence(w1, w2) - kl_correct) < EPS
  
file_path: sumy/tests/test_summarizers/test_kl.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import pytest
  from sumy.models.dom._sentence import Sentence
  from sumy.nlp.tokenizers import Tokenizer
  from sumy.summarizers.kl import KLSummarizer
  from ..utils import build_document
label_desc: Use image node_id 8 for calling a global function with example usage: test_kl_divergence(summarizer) without return types