class_docstr: A container for a set of key bindings.
  
  Example usage::
  
      kb = KeyBindings()
  
      @kb.add('c-t')
      def _(event):
          print('Control-T pressed')
  
      @kb.add('c-a', 'c-b')
      def _(event):
          print('Control-A pressed, followed by Control-B')
  
      @kb.add('c-x', filter=is_searching)
      def _(event):
          print('Control-X pressed')  # Works only if we are searching.
docstr: Remove a key binding.
  
  This expects either a function that was given to `add` method as
  parameter or a sequence of key bindings.
  
  Raises `ValueError` when no bindings was found.
  
  Usage::
  
      remove(handler)  # Pass handler.
      remove('c-x', 'c-a')  # Or pass the key bindings.
docstr_tok: ["Remove","a","key","binding",".","This","expects","either","a","function","that","was","given","to","`","add","`","method","as","parameter","or","a","sequence","of","key","bindings",".","Raises","`","ValueError","`","when","no","bindings","was","found",".","Usage",":",":","remove","(","handler",")","#","Pass","handler",".","remove","(","'","c-x","'",",","'","c-a","'",")","#","Or","pass","the","key","bindings","."]
code: def remove(self, *args: Keys | str | KeyHandlerCallable) -> None:
      """
      Remove a key binding.
  
      This expects either a function that was given to `add` method as
      parameter or a sequence of key bindings.
  
      Raises `ValueError` when no bindings was found.
  
      Usage::
  
          remove(handler)  # Pass handler.
          remove('c-x', 'c-a')  # Or pass the key bindings.
      """
      found = False
  
      if callable(args[0]):
          assert len(args) == 1
          function = args[0]
  
          # Remove the given function.
          for b in self.bindings:
              if b.handler == function:
                  self.bindings.remove(b)
                  found = True
  
      else:
          assert len(args) > 0
          args = cast(Tuple[Union[Keys, str]], args)
  
          # Remove this sequence of key bindings.
          keys = tuple(_parse_key(k) for k in args)
  
          for b in self.bindings:
              if b.keys == keys:
                  self.bindings.remove(b)
                  found = True
  
      if found:
          self._clear_cache()
      else:
          # No key binding found for this function. Raise ValueError.
          raise ValueError(f"Binding not found: {function!r}")
  
imports: from __future__ import annotations
  from abc import ABCMeta, abstractmethod, abstractproperty
  from inspect import isawaitable
  from typing import TYPE_CHECKING, Any, Callable, Coroutine, Hashable, Sequence, Tuple, TypeVar, Union, cast
  from prompt_toolkit.cache import SimpleCache
  from prompt_toolkit.filters import FilterOrBool, Never, to_filter
  from prompt_toolkit.keys import KEY_ALIASES, Keys
label_desc: Use image node_id 6 for calling the KeyBindings obj's underlying member method code with example usage: obj.remove() without return types