parameters: (self, keys_list: Sequence[Sequence[str]])
return_statement: return result
docstring: Convert list of keys being pressed to actions, used in interactive mode
docstring_summary: Convert list of keys being pressed to actions, used in interactive mode
docstring_tokens: Convert list of keys being pressed to actions used in interactive mode
function: def keys_to_act(self, keys_list: Sequence[Sequence[str]]) -> List[Optional[np.ndarray]]:
          """
          Convert list of keys being pressed to actions, used in interactive mode
          """
          result = []
          for keys in keys_list:
              action = None
              max_len = -1
              for i, combo in enumerate(self.get_combos()):
                  pressed = True
                  for key in combo:
                      if key not in keys:
                          pressed = False
  
                  if pressed and (max_len < len(combo)):
                      action = i
                      max_len = len(combo)
  
              if action is not None:
                  action = np.array([action])
              result.append(action)
          return result
function_tokens: def keys_to_act ( self , keys_list : Sequence [ Sequence [ str ] ] ) -> List [ Optional [ np . ndarray ] ] : result = [ ] for keys in keys_list : action = None max_len = - 1 for i , combo in enumerate ( self . get_combos ( ) ) : pressed = True for key in combo : if key not in keys : pressed = False if pressed and ( max_len < len ( combo ) ) : action = i max_len = len ( combo ) if action is not None : action = np . array ( [ action ] ) result . append ( action ) return result