code: def test_word_completer_pattern():
      # With a pattern which support '.'
      completer = WordCompleter(
          ["abc", "a.b.c", "a.b", "xyz"],
          pattern=re.compile(r"^([a-zA-Z0-9_.]+|[^a-zA-Z0-9_.\s]+)"),
      )
      completions = completer.get_completions(
          Document("a."), CompleteEvent()
      )
      assert [c.text for c in completions] == ["a.b.c", "a.b"]
  
      # Without pattern
      completer = WordCompleter(["abc", "a.b.c", "a.b", "xyz"])
      completions = completer.get_completions(
          Document("a."), CompleteEvent()
      )
      assert [c.text for c in completions] == []
  
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 17 for calling a global function with example usage: test_word_completer_pattern() without return types