code: def test_emacs_selection():
      # Copy/paste empty selection should not do anything.
      operations = (
          "hello"
          # Twice left.
          "\x1b[D\x1b[D"
          # Control-Space
          "\x00"
          # ControlW (cut)
          "\x17"
          # ControlY twice. (paste twice)
          "\x19\x19\r"
      )
  
      result, cli = _feed_cli_with_input(operations)
      assert result.text == "hello"
  
      # Copy/paste one character.
      operations = (
          "hello"
          # Twice left.
          "\x1b[D\x1b[D"
          # Control-Space
          "\x00"
          # Right.
          "\x1b[C"
          # ControlW (cut)
          "\x17"
          # ControlA (Home).
          "\x01"
          # ControlY (paste)
          "\x19\r"
      )
  
      result, cli = _feed_cli_with_input(operations)
      assert result.text == "lhelo"
  
imports: from __future__ import annotations
  from functools import partial
  import pytest
  from prompt_toolkit.clipboard import ClipboardData, InMemoryClipboard
  from prompt_toolkit.enums import EditingMode
  from prompt_toolkit.filters import ViInsertMode
  from prompt_toolkit.history import InMemoryHistory
  from prompt_toolkit.input.defaults import create_pipe_input
  from prompt_toolkit.input.vt100_parser import ANSI_SEQUENCES
  from prompt_toolkit.key_binding.bindings.named_commands import prefix_meta
  from prompt_toolkit.key_binding.key_bindings import KeyBindings
  from prompt_toolkit.output import DummyOutput
  from prompt_toolkit.shortcuts import PromptSession
label_desc: Use image node_id 17 for calling a global function with example usage: test_emacs_selection() without return types