code: def accept_search() -> None:
      """
      Accept current search query. Focus original `BufferControl` again.
      """
      layout = get_app().layout
  
      search_control = layout.current_control
      target_buffer_control = layout.search_target_buffer_control
  
      from prompt_toolkit.layout.controls import BufferControl
  
      if not isinstance(search_control, BufferControl):
          return
      if target_buffer_control is None:
          return
  
      search_state = target_buffer_control.search_state
  
      # Update search state.
      if search_control.buffer.text:
          search_state.text = search_control.buffer.text
  
      # Apply search.
      target_buffer_control.buffer.apply_search(
          search_state, include_current_position=True
      )
  
      # Add query to history of search line.
      search_control.buffer.append_to_history()
  
      # Stop search and focus previous control again.
      stop_search(target_buffer_control)
  
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 4 for calling a global function with example usage: accept_search() without return types