code: def test_scrubber():
      """
      Works as a pipeline component and can be disabled.
      """
      # given
  
      text = "This is a test for scrubber."
  
      nlp1 = spacy.load("en_core_web_sm")
      nlp1.add_pipe("topicrank", last=True)
  
      doc = nlp1(text)
  
      phrases = [phrase.text for phrase in doc._.phrases]
  
      assert set(phrases) == {"test", "scrubber"}
  
      @spacy.registry.misc("modify_scrubber")
      def modify_scrubber():  # pylint: disable=W0612
          def scrubber_func(text_span: Span) -> str:
              print("scrubbed_func called")
              if text_span.text == "scrubber":
                  return "modified scrubber"
              return text_span.text
  
          return scrubber_func
  
      # add "modify_scrubber" to config
      # then see if phrases has `modified scrubber` in it?
  
      nlp2 = spacy.load("en_core_web_sm")
      nlp2.add_pipe(
          "topicrank",
          config={
              "stopwords": {"test": ["NOUN"]},
              "scrubber": {"@misc": "modify_scrubber"},
          },
          last=True,
      )
  
      # then
      doc = nlp2(text)
  
      phrases = [phrase.text for phrase in doc._.phrases]
  
      # we expect the "test" to be filtered away (due to stopwords),
      # and "scrubber" to be replaced with "modified scrubber"
      assert set(phrases) == {"modified scrubber"}
  
file_path: pytextrank/tests/test_topicrank.py
imports: from spacy.language import Language
  from spacy.tokens import Span, Doc
  import spacy
  import sys
  from pytextrank.topicrank import TopicRankFactory
label_desc: Use image node_id 6 for calling a global function with example usage: test_scrubber() and returns: scrubber_func, text_span, str