code: def start_search(
      buffer_control: BufferControl | None = None,
      direction: SearchDirection = SearchDirection.FORWARD,
  ) -> None:
      """
      Start search through the given `buffer_control` using the
      `search_buffer_control`.
  
      :param buffer_control: Start search for this `BufferControl`. If not given,
          search through the current control.
      """
      from prompt_toolkit.layout.controls import BufferControl
  
      assert buffer_control is None or isinstance(
          buffer_control, BufferControl
      )
  
      layout = get_app().layout
  
      # When no control is given, use the current control if that's a BufferControl.
      if buffer_control is None:
          if not isinstance(layout.current_control, BufferControl):
              return
          buffer_control = layout.current_control
  
      # Only if this control is searchable.
      search_buffer_control = buffer_control.search_buffer_control
  
      if search_buffer_control:
          buffer_control.search_state.direction = direction
  
          # Make sure to focus the search BufferControl
          layout.focus(search_buffer_control)
  
          # Remember search link.
          layout.search_links[search_buffer_control] = buffer_control
  
          # If we're in Vi mode, make sure to go into insert mode.
          get_app().vi_state.input_mode = InputMode.INSERT
  
file_path: catboost/contrib/python/prompt-toolkit/py3/prompt_toolkit/search.py
imports: from __future__ import annotations
  from enum import Enum
  from typing import TYPE_CHECKING
  from .application.current import get_app
  from .filters import FilterOrBool, is_searching, to_filter
  from .key_binding.vi_state import InputMode
label_desc: Use image node_id 1 for calling a global function with example usage: start_search(buffer_control, direction) without return types