code: def test_extract_keyterms():
      message = "ranker \"bulthaup\" not available; use one of ['textrank', 'sgrank', 'scake', 'yake']"
      with pytest.raises(ValueError, match=re.escape(message)):
          DOC_1.extract_keyterms(ranker="bulthaup")
      assert len(DOC_1.extract_keyterms()) == 10
      # limits number of keyterms
      assert len(DOC_1.extract_keyterms(n_terms=2)) == 2
      # works with empty documents
      assert DOC_3.extract_keyterms() == []
      # works with other rankers
      assert isinstance(DOC_2.extract_keyterms(ranker="textrank"), list)
  
imports: import re
  from unittest import mock
  import pytest
  import spacy
  import numpy
  from fakeredis import FakeRedis
  from textpipe.doc import Doc, TextpipeMissingModelException, RedisIDFWeightingMismatchException
  from textpipe.wrappers import RedisKeyedVectors
label_desc: Use image node_id 8 for calling a global function with example usage: test_extract_keyterms() without return types