code: def load_vi_search_bindings() -> KeyBindingsBase:
      key_bindings = KeyBindings()
      handle = key_bindings.add
      from . import search
  
      @Condition
      def search_buffer_is_empty() -> bool:
          "Returns True when the search buffer is empty."
          return get_app().current_buffer.text == ""
  
      # Vi-style forward search.
      handle(
          "/",
          filter=(vi_navigation_mode | vi_selection_mode)
          & ~vi_search_direction_reversed,
      )(search.start_forward_incremental_search)
      handle(
          "?",
          filter=(vi_navigation_mode | vi_selection_mode)
          & vi_search_direction_reversed,
      )(search.start_forward_incremental_search)
      handle("c-s")(search.start_forward_incremental_search)
  
      # Vi-style backward search.
      handle(
          "?",
          filter=(vi_navigation_mode | vi_selection_mode)
          & ~vi_search_direction_reversed,
      )(search.start_reverse_incremental_search)
      handle(
          "/",
          filter=(vi_navigation_mode | vi_selection_mode)
          & vi_search_direction_reversed,
      )(search.start_reverse_incremental_search)
      handle("c-r")(search.start_reverse_incremental_search)
  
      # Apply the search. (At the / or ? prompt.)
      handle("enter", filter=is_searching)(search.accept_search)
  
      handle("c-r", filter=is_searching)(
          search.reverse_incremental_search
      )
      handle("c-s", filter=is_searching)(
          search.forward_incremental_search
      )
  
      handle("c-c")(search.abort_search)
      handle("c-g")(search.abort_search)
      handle("backspace", filter=search_buffer_is_empty)(
          search.abort_search
      )
  
      # Handle escape. This should accept the search, just like readline.
      # `abort_search` would be a meaningful alternative.
      handle("escape")(search.accept_search)
  
      return ConditionalKeyBindings(key_bindings, vi_mode)
  
imports: from __future__ import annotations
  import codecs
  import string
  from enum import Enum
  from itertools import accumulate
  from typing import Callable, Iterable, Tuple, TypeVar
  from prompt_toolkit.application.current import get_app
  from prompt_toolkit.buffer import Buffer, indent, reshape_text, unindent
  from prompt_toolkit.clipboard import ClipboardData
  from prompt_toolkit.document import Document
  from prompt_toolkit.filters import Always, Condition, Filter, has_arg, is_read_only, is_searching
  from prompt_toolkit.filters.app import in_paste_mode, is_multiline, vi_digraph_mode, vi_insert_mode, vi_insert_multiple_mode, vi_mode, vi_navigation_mode, vi_recording_macro, vi_replace_mode, vi_replace_single_mode, vi_search_direction_reversed, vi_selection_mode, vi_waiting_for_text_object_mode
  from prompt_toolkit.input.vt100_parser import Vt100Parser
  from prompt_toolkit.key_binding.digraphs import DIGRAPHS
  from prompt_toolkit.key_binding.key_processor import KeyPress, KeyPressEvent
  from prompt_toolkit.key_binding.vi_state import CharacterFind, InputMode
  from prompt_toolkit.keys import Keys
  from prompt_toolkit.search import SearchDirection
  from prompt_toolkit.selection import PasteMode, SelectionState, SelectionType
  from ..key_bindings import ConditionalKeyBindings, KeyBindings, KeyBindingsBase
  from .named_commands import get_by_name
label_desc: Use image node_id 4 for calling a global function with example usage: load_vi_search_bindings() and returns: ConditionalKeyBindings, unknown