docstr: Get an action from the user keyboard
  
  :return: action index
code: def get_action_from_user(self) -> ActionType:
      """
      Get an action from the user keyboard
  
      :return: action index
      """
      if self.wait_for_explicit_human_action:
          while len(self.renderer.pressed_keys) == 0:
              self.renderer.get_events()
  
      if self.key_to_action == {}:
          # the keys are the numbers on the keyboard corresponding to the action index
          if len(self.renderer.pressed_keys) > 0:
              action_idx = self.renderer.pressed_keys[0] - ord("1")
              if 0 <= action_idx < self.action_space.shape[0]:
                  return action_idx
      else:
          # the keys are mapped through the environment to more intuitive keyboard keys
          # key = tuple(self.renderer.pressed_keys)
          # for key in self.renderer.pressed_keys:
          for env_keys in self.key_to_action.keys():
              if set(env_keys) == set(self.renderer.pressed_keys):
                  return self.action_space.actions[
                      self.key_to_action[env_keys]
                  ]
  
      # return the default action 0 so that the environment will continue running
      return self.action_space.default_action
  
imports: import operator
  import time
  from collections import OrderedDict
  from typing import Union, List, Tuple, Dict
  import numpy
  from rl_coach import logger
  from rl_coach.base_parameters import Parameters
  from rl_coach.base_parameters import VisualizationParameters
  from rl_coach.core_types import GoalType, ActionType, EnvResponse, RunPhase
  from rl_coach.environments.environment_interface import EnvironmentInterface
  from rl_coach.logger import screen
  from rl_coach.renderer import Renderer
  from rl_coach.spaces import ActionSpace, ObservationSpace, DiscreteActionSpace, RewardSpace, StateSpace
  from rl_coach.utils import squeeze_list, force_list
label_desc: Use image node_id 8 for calling the Environment obj's underlying member method code with example usage: obj.get_action_from_user() and returns: self, action_idx, self