class_docstr: A search 'query', associated with a search field (like a SearchToolbar).
  
  Every searchable `BufferControl` points to a `search_buffer_control`
  (another `BufferControls`) which represents the search field. The
  `SearchState` attached to that search field is used for storing the current
  search query.
  
  It is possible to have one searchfield for multiple `BufferControls`. In
  that case, they'll share the same `SearchState`.
  If there are multiple `BufferControls` that display the same `Buffer`, then
  they can have a different `SearchState` each (if they have a different
  search control).
class_docstr_tok: ["A","search","'query","'",",","associated","with","a","search","field","(","like","a","SearchToolbar",")",".","Every","searchable","`","BufferControl","`","points","to","a","`","search_buffer_control","`","(","another","`","BufferControls","`",")","which","represents","the","search","field",".","The","`","SearchState","`","attached","to","that","search","field","is","used","for","storing","the","current","search","query",".","It","is","possible","to","have","one","searchfield","for","multiple","`","BufferControls","`",".","In","that","case",",","they","'ll","share","the","same","`","SearchState","`",".","If","there","are","multiple","`","BufferControls","`","that","display","the","same","`","Buffer","`",",","then","they","can","have","a","different","`","SearchState","`","each","(","if","they","have","a","different","search","control",")","."]
docstr: Create a new SearchState where backwards becomes forwards and the other
  way around.
docstr_tok: ["Create","a","new","SearchState","where","backwards","becomes","forwards","and","the","other","way","around","."]
code: def __invert__(self) -> SearchState:
      """
      Create a new SearchState where backwards becomes forwards and the other
      way around.
      """
      if self.direction == SearchDirection.BACKWARD:
          direction = SearchDirection.FORWARD
      else:
          direction = SearchDirection.BACKWARD
  
      return SearchState(
          text=self.text,
          direction=direction,
          ignore_case=self.ignore_case,
      )
  
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 3 for calling the SearchState obj's underlying member method code with example usage: obj.__invert__() and returns: SearchState