code: def test_nested_completer():
      completer = NestedCompleter.from_nested_dict(
          {
              "show": {
                  "version": None,
                  "clock": None,
                  "interfaces": None,
                  "ip": {"interface": {"brief"}},
              },
              "exit": None,
          }
      )
  
      # Empty input.
      completions = completer.get_completions(
          Document(""), CompleteEvent()
      )
      assert {c.text for c in completions} == {"show", "exit"}
  
      # One character.
      completions = completer.get_completions(
          Document("s"), CompleteEvent()
      )
      assert {c.text for c in completions} == {"show"}
  
      # One word.
      completions = completer.get_completions(
          Document("show"), CompleteEvent()
      )
      assert {c.text for c in completions} == {"show"}
  
      # One word + space.
      completions = completer.get_completions(
          Document("show "), CompleteEvent()
      )
      assert {c.text for c in completions} == {
          "version",
          "clock",
          "interfaces",
          "ip",
      }
  
      # One word + space + one character.
      completions = completer.get_completions(
          Document("show i"), CompleteEvent()
      )
      assert {c.text for c in completions} == {"ip", "interfaces"}
  
      # One space + one word + space + one character.
      completions = completer.get_completions(
          Document(" show i"), CompleteEvent()
      )
      assert {c.text for c in completions} == {"ip", "interfaces"}
  
      # Test nested set.
      completions = completer.get_completions(
          Document("show ip interface br"), CompleteEvent()
      )
      assert {c.text for c in completions} == {"brief"}
  
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 19 for calling a global function with example usage: test_nested_completer() without return types