code: def get_keys_to_action(self):
      
      # Based on gym AtariEnv.get_keys_to_action()
      keyword_to_key = {
          "UP": ord("w"),
          "DOWN": ord("s"),
          "LEFT": ord("a"),
          "RIGHT": ord("d"),
          "FIRE": ord(" "),
      }
  
      keys_to_action = {}
  
      for action_id, action_meaning in enumerate(self.action_meanings):
        keys_tuple = tuple(sorted([
            key for keyword, key in keyword_to_key.items()
            if keyword in action_meaning]))
        assert keys_tuple not in keys_to_action
        keys_to_action[keys_tuple] = action_id
  
      # Special actions:
      keys_to_action[(ord("r"),)] = self.RETURN_DONE_ACTION
      keys_to_action[(ord("c"),)] = self.TOGGLE_WAIT_ACTION
      keys_to_action[(ord("n"),)] = self.WAIT_MODE_NOOP_ACTION
  
      return keys_to_action
docs: Get mapping from keyboard keys to actions.
  
      Required by gym.utils.play in environment or top level wrapper.
  
      Returns:
        {
          Unicode code point for keyboard key: action (formatted for step()),
          ...
        }