code: def test_pathcompleter_completes_files_in_absolute_directory():
      # setup: create a test dir with 10 files
      test_dir = tempfile.mkdtemp()
      write_test_files(test_dir)
  
      expected = sorted(str(i) for i in range(10))
  
      test_dir = os.path.abspath(test_dir)
      if not test_dir.endswith(os.path.sep):
          test_dir += os.path.sep
  
      completer = PathCompleter()
      # force unicode
      doc_text = str(test_dir)
      doc = Document(doc_text, len(doc_text))
      event = CompleteEvent()
      completions = list(completer.get_completions(doc, event))
      result = sorted(c.text for c in completions)
      assert expected == result
  
      # cleanup
      shutil.rmtree(test_dir)
  
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 5 for calling a global function with example usage: test_pathcompleter_completes_files_in_absolute_directory() without return types