code: def create_content(self, width: int, height: int) -> UIContent:
      all_fragments: StyleAndTextTuples = []
  
      complete_state = get_app().current_buffer.complete_state
      if complete_state:
          completions = complete_state.completions
          index = complete_state.complete_index  # Can be None!
  
          # Width of the completions without the left/right arrows in the margins.
          content_width = width - 6
  
          # Booleans indicating whether we stripped from the left/right
          cut_left = False
          cut_right = False
  
          # Create Menu content.
          fragments: StyleAndTextTuples = []
  
          for i, c in enumerate(completions):
              # When there is no more place for the next completion
              if (
                  fragment_list_len(fragments) + len(c.display_text)
                  >= content_width
              ):
                  # If the current one was not yet displayed, page to the next sequence.
                  if i <= (index or 0):
                      fragments = []
                      cut_left = True
                  # If the current one is visible, stop here.
                  else:
                      cut_right = True
                      break
  
              fragments.extend(
                  to_formatted_text(
                      c.display_text,
                      style=(
                          "class:completion-toolbar.completion.current"
                          if i == index
                          else "class:completion-toolbar.completion"
                      ),
                  )
              )
              fragments.append(("", " "))
  
          # Extend/strip until the content width.
          fragments.append(
              ("", " " * (content_width - fragment_list_len(fragments)))
          )
          fragments = fragments[:content_width]
  
          # Return fragments
          all_fragments.append(("", " "))
          all_fragments.append(
              (
                  "class:completion-toolbar.arrow",
                  "<" if cut_left else " ",
              )
          )
          all_fragments.append(("", " "))
  
          all_fragments.extend(fragments)
  
          all_fragments.append(("", " "))
          all_fragments.append(
              (
                  "class:completion-toolbar.arrow",
                  ">" if cut_right else " ",
              )
          )
          all_fragments.append(("", " "))
  
      def get_line(i: int) -> StyleAndTextTuples:
          return all_fragments
  
      return UIContent(get_line=get_line, line_count=1)
  
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 for calling the _CompletionsToolbarControl obj's underlying member method code with example usage: obj.create_content(width, height) and returns: UIContent, all_fragments