code: def __init__(
      self,
      max_height: int | None = None,
      scroll_offset: int | Callable[[], int] = 0,
      extra_filter: FilterOrBool = True,
      display_arrows: FilterOrBool = False,
      z_index: int = 10**8,
  ) -> None:
      extra_filter = to_filter(extra_filter)
      display_arrows = to_filter(display_arrows)
  
      super().__init__(
          content=Window(
              content=CompletionsMenuControl(),
              width=Dimension(min=8),
              height=Dimension(min=1, max=max_height),
              scroll_offsets=ScrollOffsets(
                  top=scroll_offset, bottom=scroll_offset
              ),
              right_margins=[
                  ScrollbarMargin(display_arrows=display_arrows)
              ],
              dont_extend_width=True,
              style="class:completion-menu",
              z_index=z_index,
          ),
          # Show when there are completions but not at the point we are
          # returning the input.
          filter=extra_filter & has_completions & ~is_done,
      )
  
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 1 to create a new CompletionsMenu object from inherited base classes: ConditionalContainer with example: obj = CompletionsMenu(max_height, scroll_offset, extra_filter, display_arrows, z_index)