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: Return a list of key bindings that can handle this key.
  (This return also inactive bindings, so the `filter` still has to be
  called, for checking it.)
  
  :param keys: tuple of keys.
docstr_tok: ["Return","a","list","of","key","bindings","that","can","handle","this","key",".","(","This","return","also","inactive","bindings",",","so","the","`","filter","`","still","has","to","be","called",",","for","checking","it",".",")",":","param","keys",":","tuple","of","keys","."]
code: def get_bindings_for_keys(self, keys: KeysTuple) -> list[Binding]:
      """
      Return a list of key bindings that can handle this key.
      (This return also inactive bindings, so the `filter` still has to be
      called, for checking it.)
  
      :param keys: tuple of keys.
      """
  
      def get() -> list[Binding]:
          result: list[tuple[int, Binding]] = []
  
          for b in self.bindings:
              if len(keys) == len(b.keys):
                  match = True
                  any_count = 0
  
                  for i, j in zip(b.keys, keys):
                      if i != j and i != Keys.Any:
                          match = False
                          break
  
                      if i == Keys.Any:
                          any_count += 1
  
                  if match:
                      result.append((any_count, b))
  
          # Place bindings that have more 'Any' occurrences in them at the end.
          result = sorted(result, key=lambda item: -item[0])
  
          return [item[1] for item in result]
  
      return self._get_bindings_for_keys_cache.get(keys, get)
  
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 7 for calling the KeyBindings obj's underlying member method code with example usage: obj.get_bindings_for_keys(keys) and returns: self, unknown