code: def reset_buffer(event):
      b = event.current_buffer
      if b.complete_state:
          b.cancel_completion()
      else:
          b.reset()
  
imports: import signal
  import sys
  from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER
  from prompt_toolkit.filters import HasFocus, HasSelection, Condition, ViInsertMode, EmacsInsertMode, HasCompletions
  from prompt_toolkit.filters.cli import ViMode
  from prompt_toolkit.keys import Keys
  from prompt_toolkit.key_binding.bindings.completion import display_completions_like_readline
  from IPython.utils.decorators import undoc
label_desc: Use image node_id 7 for calling a global function with example usage: reset_buffer(event) without return types