code: def test_word_completer_sentence():
      # With sentence=True
      completer = WordCompleter(
          ["hello world", "www", "hello www", "hello there"],
          sentence=True,
      )
      completions = completer.get_completions(
          Document("hello w"), CompleteEvent()
      )
      assert [c.text for c in completions] == [
          "hello world",
          "hello www",
      ]
  
      # With sentence=False
      completer = WordCompleter(
          ["hello world", "www", "hello www", "hello there"],
          sentence=False,
      )
      completions = completer.get_completions(
          Document("hello w"), CompleteEvent()
      )
      assert [c.text for c in completions] == ["www"]
  
imports: from __future__ import annotations
  import os
  import re
  import shutil
  import tempfile
  from contextlib import contextmanager
  from prompt_toolkit.completion import CompleteEvent, FuzzyWordCompleter, NestedCompleter, PathCompleter, WordCompleter, merge_completers
  from prompt_toolkit.document import Document
label_desc: Use image node_id 15 for calling a global function with example usage: test_word_completer_sentence() without return types