class_docstr: Key binding registry.
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):
      """
      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():
          result = []
          for b in self.key_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' occurences 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 unicode_literals
  from abc import ABCMeta, abstractmethod
  from prompt_toolkit.cache import SimpleCache
  from prompt_toolkit.filters import CLIFilter, to_cli_filter, Never
  from prompt_toolkit.keys import Key, Keys
  from six import text_type, with_metaclass
label_desc: Use image node_id 5 for calling the Registry obj's underlying member method code with example usage: obj.get_bindings_for_keys(keys) and returns: self, unknown