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: Handle mouse events: clicking and scrolling.
code: def mouse_handler(
      self, mouse_event: MouseEvent
  ) -> NotImplementedOrNone:
      """
      Handle mouse events: clicking and scrolling.
      """
      b = get_app().current_buffer
  
      if mouse_event.event_type == MouseEventType.MOUSE_UP:
          # Select completion.
          b.go_to_completion(mouse_event.position.y)
          b.complete_state = None
  
      elif mouse_event.event_type == MouseEventType.SCROLL_DOWN:
          # Scroll up.
          b.complete_next(count=3, disable_wrap_around=True)
  
      elif mouse_event.event_type == MouseEventType.SCROLL_UP:
          # Scroll down.
          b.complete_previous(count=3, disable_wrap_around=True)
  
      return None
  
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 9 for calling the CompletionsMenuControl obj's underlying member method code with example usage: obj.mouse_handler(mouse_event) and returns: None