code: def __init__(self, show_position: bool = False) -> None:
      def get_formatted_text() -> StyleAndTextTuples:
          buff = get_app().current_buffer
  
          if buff.validation_error:
              row, column = buff.document.translate_index_to_position(
                  buff.validation_error.cursor_position
              )
  
              if show_position:
                  text = "{} (line={} column={})".format(
                      buff.validation_error.message,
                      row + 1,
                      column + 1,
                  )
              else:
                  text = buff.validation_error.message
  
              return [("class:validation-toolbar", text)]
          else:
              return []
  
      self.control = FormattedTextControl(get_formatted_text)
  
      self.container = ConditionalContainer(
          content=Window(self.control, height=1),
          filter=has_validation_error,
      )
  
imports: from __future__ import annotations
  from typing import Any
  from prompt_toolkit.application.current import get_app
  from prompt_toolkit.buffer import Buffer
  from prompt_toolkit.enums import SYSTEM_BUFFER
  from prompt_toolkit.filters import Condition, FilterOrBool, emacs_mode, has_arg, has_completions, has_focus, has_validation_error, to_filter, vi_mode, vi_navigation_mode
  from prompt_toolkit.formatted_text import AnyFormattedText, StyleAndTextTuples, fragment_list_len, to_formatted_text
  from prompt_toolkit.key_binding.key_bindings import ConditionalKeyBindings, KeyBindings, KeyBindingsBase, merge_key_bindings
  from prompt_toolkit.key_binding.key_processor import KeyPressEvent
  from prompt_toolkit.key_binding.vi_state import InputMode
  from prompt_toolkit.keys import Keys
  from prompt_toolkit.layout.containers import ConditionalContainer, Container, Window
  from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl, SearchBufferControl, UIContent, UIControl
  from prompt_toolkit.layout.dimension import Dimension
  from prompt_toolkit.layout.processors import BeforeInput
  from prompt_toolkit.lexers import SimpleLexer
  from prompt_toolkit.search import SearchDirection
label_desc: Use image node_id 1 to create a new ValidationToolbar object  with example: obj = ValidationToolbar(show_position)