code: def test_bigram2():
      b = BigramCollocationFinder.from_words(SENT)
  
      assert sorted(b.ngram_fd.items()) == [
          (("a", "a"), 1),
          (("a", "test"), 1),
          (("is", "a"), 1),
          (("is", "is"), 1),
          (("test", "test"), 1),
          (("this", "is"), 1),
          (("this", "this"), 1),
      ]
      assert sorted(b.word_fd.items()) == [
          ("a", 2),
          ("is", 2),
          ("test", 2),
          ("this", 2),
      ]
  
      assert (
          len(SENT)
          == sum(b.word_fd.values())
          == sum(b.ngram_fd.values()) + 1
      )
      assert close_enough(
          sorted(b.score_ngrams(BigramAssocMeasures.pmi)),
          [
              (("a", "a"), 1.0),
              (("a", "test"), 1.0),
              (("is", "a"), 1.0),
              (("is", "is"), 1.0),
              (("test", "test"), 1.0),
              (("this", "is"), 1.0),
              (("this", "this"), 1.0),
          ],
      )
  
imports: from nltk.collocations import BigramCollocationFinder
  from nltk.metrics import BigramAssocMeasures
label_desc: Use image node_id 2 for calling a global function with example usage: test_bigram2() without return types