code: def get_bindings_for_keys(self, 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)
docs: 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.