class_docstr: Helper for drawing the complete menu to the screen.
  
  :param scroll_offset: Number (integer) representing the preferred amount of
      completions to be displayed before and after the current one. When this
      is a very high number, the current completion will be shown in the
      middle most of the time.
class_docstr_tok: ["Helper","for","drawing","the","complete","menu","to","the","screen",".",":","param","scroll_offset",":","Number","(","integer",")","representing","the","preferred","amount","of","completions","to","be","displayed","before","and","after","the","current","one",".","When","this","is","a","very","high","number",",","the","current","completion","will","be","shown","in","the","middle","most","of","the","time","."]
docstr: Create a UIContent object for this control.
code: def create_content(self, width: int, height: int) -> UIContent:
      """
      Create a UIContent object for this control.
      """
      complete_state = get_app().current_buffer.complete_state
      if complete_state:
          completions = complete_state.completions
          index = complete_state.complete_index  # Can be None!
  
          # Calculate width of completions menu.
          menu_width = self._get_menu_width(width, complete_state)
          menu_meta_width = self._get_menu_meta_width(
              width - menu_width, complete_state
          )
          show_meta = self._show_meta(complete_state)
  
          def get_line(i: int) -> StyleAndTextTuples:
              c = completions[i]
              is_current_completion = i == index
              result = _get_menu_item_fragments(
                  c, is_current_completion, menu_width, space_after=True
              )
  
              if show_meta:
                  result += self._get_menu_item_meta_fragments(
                      c, is_current_completion, menu_meta_width
                  )
              return result
  
          return UIContent(
              get_line=get_line,
              cursor_position=Point(x=0, y=index or 0),
              line_count=len(completions),
          )
  
      return UIContent()
  
imports: from __future__ import annotations
  import math
  from itertools import zip_longest
  from typing import TYPE_CHECKING, Callable, Iterable, Sequence, TypeVar, cast
  from weakref import WeakKeyDictionary
  from prompt_toolkit.application.current import get_app
  from prompt_toolkit.buffer import CompletionState
  from prompt_toolkit.completion import Completion
  from prompt_toolkit.data_structures import Point
  from prompt_toolkit.filters import Condition, FilterOrBool, has_completions, is_done, to_filter
  from prompt_toolkit.formatted_text import StyleAndTextTuples, fragment_list_width, to_formatted_text
  from prompt_toolkit.key_binding.key_processor import KeyPressEvent
  from prompt_toolkit.layout.utils import explode_text_fragments
  from prompt_toolkit.mouse_events import MouseEvent, MouseEventType
  from prompt_toolkit.utils import get_cwidth
  from .containers import ConditionalContainer, HSplit, ScrollOffsets, Window
  from .controls import GetLinePrefixCallable, UIContent, UIControl
  from .dimension import Dimension
  from .margins import ScrollbarMargin
label_desc: Use image node_id 4 for calling the CompletionsMenuControl obj's underlying member method code with example usage: obj.create_content(width, height) and returns: UIContent, UIContent, result