code: def kill_line(event: E) -> None:
      """
      Kill the text from the cursor to the end of the line.
  
      If we are at the end of the line, this should remove the newline.
      (That way, it is possible to delete multiple lines by executing this
      command multiple times.)
      """
      buff = event.current_buffer
      if event.arg < 0:
          deleted = buff.delete_before_cursor(
              count=-buff.document.get_start_of_line_position()
          )
      else:
          if buff.document.current_char == "\n":
              deleted = buff.delete(1)
          else:
              deleted = buff.delete(
                  count=buff.document.get_end_of_line_position()
              )
      event.app.clipboard.set_text(deleted)
  
imports: from __future__ import annotations
  from typing import Callable, TypeVar, Union, cast
  from prompt_toolkit.document import Document
  from prompt_toolkit.enums import EditingMode
  from prompt_toolkit.key_binding.key_bindings import Binding, key_binding
  from prompt_toolkit.key_binding.key_processor import KeyPress, KeyPressEvent
  from prompt_toolkit.keys import Keys
  from prompt_toolkit.layout.controls import BufferControl
  from prompt_toolkit.search import SearchDirection
  from prompt_toolkit.selection import PasteMode
  from .completion import display_completions_like_readline, generate_completions
label_desc: Use image node_id 28 for calling a global function with example usage: kill_line(event) without return types